@codeworksh/cli 0.0.1-dev.20260918042316 → 0.0.1-dev.20260922183613

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 (76) hide show
  1. package/README.md +94 -0
  2. package/add--i7mPR73.mjs +81 -0
  3. package/add--i7mPR73.mjs.map +1 -0
  4. package/{catalog-Cv1zoZ5S.mjs → catalog-DJxy_lne.mjs} +2 -2
  5. package/{catalog-Cv1zoZ5S.mjs.map → catalog-DJxy_lne.mjs.map} +1 -1
  6. package/check-Dq2WOgap.mjs +47 -0
  7. package/check-Dq2WOgap.mjs.map +1 -0
  8. package/commonjs-BDiLMfFF.mjs +160 -0
  9. package/commonjs-BDiLMfFF.mjs.map +1 -0
  10. package/definitions-Dfwyyv_K.mjs +3348 -0
  11. package/definitions-Dfwyyv_K.mjs.map +1 -0
  12. package/entries-Gfsq7U4P.mjs +48 -0
  13. package/entries-Gfsq7U4P.mjs.map +1 -0
  14. package/{error-zJGKAF4a.mjs → error-BrbT9_4g.mjs} +2470 -1853
  15. package/error-BrbT9_4g.mjs.map +1 -0
  16. package/{generate-DdscbX3w.mjs → generate-DrGYpD3l.mjs} +3 -3
  17. package/{generate-DdscbX3w.mjs.map → generate-DrGYpD3l.mjs.map} +1 -1
  18. package/{harness-BBTdWdhx.mjs → harness-Bgvrr0ZB.mjs} +2 -2
  19. package/{harness-BBTdWdhx.mjs.map → harness-Bgvrr0ZB.mjs.map} +1 -1
  20. package/index.d.mts +6 -1
  21. package/index.mjs +22 -6
  22. package/index.mjs.map +1 -1
  23. package/install-DoO4D3fk.mjs +53 -0
  24. package/install-DoO4D3fk.mjs.map +1 -0
  25. package/lib-BkWR53Bz.mjs +37659 -0
  26. package/lib-BkWR53Bz.mjs.map +1 -0
  27. package/lib-CyynPpjH.mjs +846 -0
  28. package/lib-CyynPpjH.mjs.map +1 -0
  29. package/lib-Dw7R2suc.mjs +16078 -0
  30. package/lib-Dw7R2suc.mjs.map +1 -0
  31. package/lib-JQygPqgO.mjs +10868 -0
  32. package/lib-JQygPqgO.mjs.map +1 -0
  33. package/link-B1zfETsS.mjs +40 -0
  34. package/link-B1zfETsS.mjs.map +1 -0
  35. package/list-3OR68HpY.mjs +76 -0
  36. package/list-3OR68HpY.mjs.map +1 -0
  37. package/{list-C6BrwuV-.mjs → list-CfPfmfe0.mjs} +4 -4
  38. package/{list-C6BrwuV-.mjs.map → list-CfPfmfe0.mjs.map} +1 -1
  39. package/login-GFV3Z9f2.mjs +45 -0
  40. package/login-GFV3Z9f2.mjs.map +1 -0
  41. package/logout-D17TQUfo.mjs +29 -0
  42. package/logout-D17TQUfo.mjs.map +1 -0
  43. package/p-map-C2WSUhyP.mjs +116 -0
  44. package/p-map-C2WSUhyP.mjs.map +1 -0
  45. package/package.json +12 -9
  46. package/{providers-fO-GJuXn.mjs → providers-DLXs9aWZ.mjs} +4 -4
  47. package/{providers-fO-GJuXn.mjs.map → providers-DLXs9aWZ.mjs.map} +1 -1
  48. package/refresh-BTNuP1zL.mjs +35 -0
  49. package/refresh-BTNuP1zL.mjs.map +1 -0
  50. package/reload-BzwsCBQq.mjs +26 -0
  51. package/reload-BzwsCBQq.mjs.map +1 -0
  52. package/remove-DgB3l5JL.mjs +36 -0
  53. package/remove-DgB3l5JL.mjs.map +1 -0
  54. package/{run-CgPOJ-wJ.mjs → run-BVo4XsL6.mjs} +11 -8
  55. package/run-BVo4XsL6.mjs.map +1 -0
  56. package/runtime-Dl621FOp.mjs +345 -0
  57. package/runtime-Dl621FOp.mjs.map +1 -0
  58. package/{serve-Du6luqoi.mjs → serve-Dpep18-A.mjs} +93 -17
  59. package/serve-Dpep18-A.mjs.map +1 -0
  60. package/settings-C52IrA72.mjs +215 -0
  61. package/settings-C52IrA72.mjs.map +1 -0
  62. package/shared-Uwjcofff.mjs +115 -0
  63. package/shared-Uwjcofff.mjs.map +1 -0
  64. package/status-DPYq2Sx4.mjs +31 -0
  65. package/status-DPYq2Sx4.mjs.map +1 -0
  66. package/type-defs-BZxrtlVD.mjs +538 -0
  67. package/type-defs-BZxrtlVD.mjs.map +1 -0
  68. package/update-CJrBbHwq.mjs +44 -0
  69. package/update-CJrBbHwq.mjs.map +1 -0
  70. package/valid-BWgW_TUl.mjs +354 -0
  71. package/valid-BWgW_TUl.mjs.map +1 -0
  72. package/error-zJGKAF4a.mjs.map +0 -1
  73. package/run-CgPOJ-wJ.mjs.map +0 -1
  74. package/runtime-DuL-GGrx.mjs +0 -163
  75. package/runtime-DuL-GGrx.mjs.map +0 -1
  76. package/serve-Du6luqoi.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lib-Dw7R2suc.mjs","names":["npa","homedir","npa","relative","EE","resolve","dirname","basename","lstat","readlink","dirname","basename","dirname","dirname","stat","mkdir","dirname","readFile","relative","writeFile","chmod","fs","promisify","fs","crypto","readFile","stat","lstat","resolve","dirname","sep","lstat","rm","readlink","resolve","dirname","sep","mkdir","symlink","resolve","relative","dirname","resolve","readlink","dirname","sep","dirname","resolve","basename","npa","dirname","npa","relative","npa","util","npa","npa","util","exports","npa","resolve","npa","resolve","dirname","relative","basename","dirname","resolve","relative","isAbsolute","dirname","npa","resolve","relative","readFile","resolve","sep","existsSync","dirname","npa","basename","URL","npa","basename","resolve","readdir","readlink","readFile","relative","rm","npa","resolve","lstat","readlink","dirname","sep","dirname","resolve","sep","join","relative","resolve","npa","resolve","existsSync","crypto","dirname","resolve","resolve","resolve","join"],"sources":["../../../../node_modules/.pnpm/treeverse@3.0.0/node_modules/treeverse/lib/breadth.js","../../../../node_modules/.pnpm/treeverse@3.0.0/node_modules/treeverse/lib/depth-descent.js","../../../../node_modules/.pnpm/treeverse@3.0.0/node_modules/treeverse/lib/depth.js","../../../../node_modules/.pnpm/treeverse@3.0.0/node_modules/treeverse/lib/index.js","../../../../node_modules/.pnpm/@isaacs+string-locale-compare@1.1.0/node_modules/@isaacs/string-locale-compare/index.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/vuln.js","../../../../node_modules/.pnpm/@npmcli+metavuln-calculator@10.0.0/node_modules/@npmcli/metavuln-calculator/lib/hash.js","../../../../node_modules/.pnpm/@npmcli+metavuln-calculator@10.0.0/node_modules/@npmcli/metavuln-calculator/lib/get-dep-spec.js","../../../../node_modules/.pnpm/@npmcli+metavuln-calculator@10.0.0/node_modules/@npmcli/metavuln-calculator/lib/advisory.js","../../../../node_modules/.pnpm/@npmcli+metavuln-calculator@10.0.0/node_modules/@npmcli/metavuln-calculator/lib/index.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/release-age-exclude.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/audit-report.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/relpath.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/packument-cache.js","../../../../node_modules/.pnpm/proggy@4.0.0/node_modules/proggy/lib/client.js","../../../../node_modules/.pnpm/proggy@4.0.0/node_modules/proggy/lib/tracker.js","../../../../node_modules/.pnpm/proggy@4.0.0/node_modules/proggy/lib/index.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/tracker.js","../../../../node_modules/.pnpm/promise-call-limit@3.0.2/node_modules/promise-call-limit/dist/commonjs/index.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/realpath.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/debug.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/tree-check.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/peer-entry-sets.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/deepest-nesting-target.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/can-place-dep.js","../../../../node_modules/.pnpm/bin-links@7.0.0/node_modules/bin-links/lib/is-windows.js","../../../../node_modules/.pnpm/bin-links@7.0.0/node_modules/bin-links/lib/get-node-modules.js","../../../../node_modules/.pnpm/bin-links@7.0.0/node_modules/bin-links/lib/get-prefix.js","../../../../node_modules/.pnpm/bin-links@7.0.0/node_modules/bin-links/lib/bin-target.js","../../../../node_modules/.pnpm/cmd-shim@9.0.2/node_modules/cmd-shim/lib/to-batch-syntax.js","../../../../node_modules/.pnpm/cmd-shim@9.0.2/node_modules/cmd-shim/lib/index.js","../../../../node_modules/.pnpm/read-cmd-shim@7.0.0/node_modules/read-cmd-shim/lib/index.js","../../../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/cjs/signals.js","../../../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/cjs/index.js","../../../../node_modules/.pnpm/write-file-atomic@8.0.0/node_modules/write-file-atomic/lib/index.js","../../../../node_modules/.pnpm/bin-links@7.0.0/node_modules/bin-links/lib/fix-bin.js","../../../../node_modules/.pnpm/bin-links@7.0.0/node_modules/bin-links/lib/shim-bin.js","../../../../node_modules/.pnpm/bin-links@7.0.0/node_modules/bin-links/lib/link-gently.js","../../../../node_modules/.pnpm/bin-links@7.0.0/node_modules/bin-links/lib/link-bin.js","../../../../node_modules/.pnpm/bin-links@7.0.0/node_modules/bin-links/lib/link-bins.js","../../../../node_modules/.pnpm/bin-links@7.0.0/node_modules/bin-links/lib/check-bin.js","../../../../node_modules/.pnpm/bin-links@7.0.0/node_modules/bin-links/lib/check-bins.js","../../../../node_modules/.pnpm/bin-links@7.0.0/node_modules/bin-links/lib/man-target.js","../../../../node_modules/.pnpm/bin-links@7.0.0/node_modules/bin-links/lib/get-paths.js","../../../../node_modules/.pnpm/bin-links@7.0.0/node_modules/bin-links/lib/index.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/case-insensitive-map.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/from-path.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/dep-valid.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/override-set.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/edge.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/inventory.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/consistent-resolve.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/gather-dep-set.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/printable.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/util/unesc.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/util/getProp.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/util/ensureObject.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/util/stripComments.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/util/maxNestingDepth.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/util/index.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/node.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/types.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/container.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/root.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/selector.js","../../../../node_modules/.pnpm/cssesc@3.0.0/node_modules/cssesc/cssesc.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/className.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/comment.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/id.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/namespace.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/tag.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/string.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/pseudo.js","../../../../node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/node.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/attribute.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/universal.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/combinator.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/nesting.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/sortAscending.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/tokenTypes.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/tokenize.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/parser.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/processor.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/constructors.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/guards.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/selectors/index.js","../../../../node_modules/.pnpm/postcss-selector-parser@7.1.6/node_modules/postcss-selector-parser/dist/index.js","../../../../node_modules/.pnpm/@npmcli+query@5.0.0/node_modules/@npmcli/query/lib/index.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/query-selector-all.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/node.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/link.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/place-dep.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/calc-dep-flags.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/diff/base.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/diff/character.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/util/string.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/diff/word.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/util/params.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/diff/line.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/diff/sentence.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/diff/css.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/diff/json.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/diff/array.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/patch/line-endings.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/patch/parse.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/util/distance-iterator.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/patch/apply.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/patch/reverse.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/patch/create.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/convert/dmp.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/convert/xml.js","../../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libcjs/index.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/patch.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/patched-dependencies.js","../../../../node_modules/.pnpm/validate-npm-package-name@8.0.0/node_modules/validate-npm-package-name/lib/builtin-modules.json","../../../../node_modules/.pnpm/validate-npm-package-name@8.0.0/node_modules/validate-npm-package-name/lib/index.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/package-extensions.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/npm-extension.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/yarn-lock.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/spec-from-lock.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/version-from-tgz.js","../../../../node_modules/.pnpm/just-diff@6.0.2/node_modules/just-diff/index.cjs","../../../../node_modules/.pnpm/just-diff-apply@5.5.0/node_modules/just-diff-apply/index.cjs","../../../../node_modules/.pnpm/parse-conflict-json@6.0.0/node_modules/parse-conflict-json/lib/index.js","../../../../node_modules/.pnpm/json-stringify-nice@1.1.4/node_modules/json-stringify-nice/index.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/override-resolves.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/shrinkwrap.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/optional-set.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/reset-dep-flags.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js","../../../../node_modules/.pnpm/common-ancestor-path@2.0.0/node_modules/common-ancestor-path/dist/commonjs/index.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/arborist/load-actual.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/arborist/load-virtual.js","../../../../node_modules/.pnpm/promise-all-reject-late@1.0.1/node_modules/promise-all-reject-late/index.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/script-allowed.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/arborist/rebuild.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/diff.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/signals.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/signal-handling.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/retire-path.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/isolated-classes.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/arborist/reify.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/arborist/isolated-reifier.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/arborist/index.js","../../../../node_modules/.pnpm/@npmcli+arborist@10.0.2/node_modules/@npmcli/arborist/lib/index.js"],"sourcesContent":["// Perform a breadth-first walk of a tree, either logical or physical\n// This one only visits, it doesn't leave. That's because\n// in a breadth-first traversal, children may be visited long\n// after their parent, so the \"exit\" pass ends up being just\n// another breadth-first walk.\n//\n// Breadth-first traversals are good for either creating a tree (ie,\n// reifying a dep graph based on a package.json without a node_modules\n// or package-lock), or mutating it in-place. For a map-reduce type of\n// walk, it doesn't make a lot of sense, and is very expensive.\nconst breadth = ({\n visit,\n filter = () => true,\n getChildren,\n tree,\n}) => {\n const queue = []\n const seen = new Map()\n\n const next = () => {\n while (queue.length) {\n const node = queue.shift()\n const res = visitNode(node)\n if (isPromise(res)) {\n return res.then(() => next())\n }\n }\n return seen.get(tree)\n }\n\n const visitNode = (visitTree) => {\n if (seen.has(visitTree)) {\n return seen.get(visitTree)\n }\n\n seen.set(visitTree, null)\n const res = visit ? visit(visitTree) : visitTree\n if (isPromise(res)) {\n const fullResult = res.then(resThen => {\n seen.set(visitTree, resThen)\n return kidNodes(visitTree)\n })\n seen.set(visitTree, fullResult)\n return fullResult\n } else {\n seen.set(visitTree, res)\n return kidNodes(visitTree)\n }\n }\n\n const kidNodes = (kidTree) => {\n const kids = getChildren(kidTree, seen.get(kidTree))\n return isPromise(kids) ? kids.then(processKids) : processKids(kids)\n }\n\n const processKids = (kids) => {\n kids = (kids || []).filter(filter)\n queue.push(...kids)\n }\n\n queue.push(tree)\n return next()\n}\n\nconst isPromise = p => p && typeof p.then === 'function'\n\nmodule.exports = breadth\n","// Perform a depth-first walk of a tree, ONLY doing the descent (visit)\n//\n// This uses a stack rather than recursion, so that it can handle deeply\n// nested trees without call stack overflows. (My kingdom for proper TCO!)\n//\n// This is only used for cases where leave() is not specified.\n//\n// a\n// +-- b\n// | +-- 1\n// | +-- 2\n// +-- c\n// +-- 3\n// +-- 4\n//\n// Expect:\n// visit a\n// visit b\n// visit 1\n// visit 2\n// visit c\n// visit 3\n// visit 4\n//\n// stack.push(tree)\n// while stack not empty\n// pop T from stack\n// VISIT(T)\n// get children C of T\n// push each C onto stack\n\nconst depth = ({\n visit,\n filter,\n getChildren,\n tree,\n}) => {\n const stack = []\n const seen = new Map()\n\n const next = () => {\n while (stack.length) {\n const node = stack.pop()\n const res = visitNode(node)\n if (isPromise(res)) {\n return res.then(() => next())\n }\n }\n return seen.get(tree)\n }\n\n const visitNode = (visitTree) => {\n if (seen.has(visitTree)) {\n return seen.get(visitTree)\n }\n\n seen.set(visitTree, null)\n const res = visit ? visit(visitTree) : visitTree\n if (isPromise(res)) {\n const fullResult = res.then(resThen => {\n seen.set(visitTree, resThen)\n return kidNodes(visitTree)\n })\n seen.set(visitTree, fullResult)\n return fullResult\n } else {\n seen.set(visitTree, res)\n return kidNodes(visitTree)\n }\n }\n\n const kidNodes = (kidTree) => {\n const kids = getChildren(kidTree, seen.get(kidTree))\n return isPromise(kids) ? kids.then(processKids) : processKids(kids)\n }\n\n const processKids = (kids) => {\n kids = (kids || []).filter(filter)\n stack.push(...kids)\n }\n\n stack.push(tree)\n return next()\n}\n\nconst isPromise = p => p && typeof p.then === 'function'\n\nmodule.exports = depth\n","// Perform a depth-first walk of a tree.\n//\n// `visit(node)` is called when the node is first encountered.\n// `leave(node, children)` is called when all of the node's children\n// have been left or (in the case of cyclic graphs) visited.\n//\n// Only one of visit or leave is required. (Technically both are optional,\n// but if you don't provide at least one, the tree is just walked without\n// doing anything, which is a bit pointless.) If visit is provided, and\n// leave is not, then this is a root->leaf traversal. If leave is provided,\n// and visit is not, then it's leaf->root. Both can be provided for a\n// map-reduce operation.\n//\n// If either visit or leave return a Promise for any node, then the\n// walk returns a Promise.\n\nconst depthDescent = require('./depth-descent.js')\nconst depth = ({\n visit,\n leave,\n filter = () => true,\n seen = new Map(),\n getChildren,\n tree,\n}) => {\n if (!leave) {\n return depthDescent({ visit, filter, getChildren, tree })\n }\n\n if (seen.has(tree)) {\n return seen.get(tree)\n }\n\n seen.set(tree, null)\n\n const visitNode = () => {\n const res = visit ? visit(tree) : tree\n if (isPromise(res)) {\n const fullResult = res.then(resThen => {\n seen.set(tree, resThen)\n return kidNodes()\n })\n seen.set(tree, fullResult)\n return fullResult\n } else {\n seen.set(tree, res)\n return kidNodes()\n }\n }\n\n const kidNodes = () => {\n const kids = getChildren(tree, seen.get(tree))\n return isPromise(kids) ? kids.then(processKids) : processKids(kids)\n }\n\n const processKids = nodes => {\n const kids = (nodes || []).filter(filter).map(kid =>\n depth({ visit, leave, filter, seen, getChildren, tree: kid }))\n return kids.some(isPromise)\n ? Promise.all(kids).then(leaveNode)\n : leaveNode(kids)\n }\n\n const leaveNode = kids => {\n const res = leave(seen.get(tree), kids)\n seen.set(tree, res)\n // if it's a promise at this point, the caller deals with it\n return res\n }\n\n return visitNode()\n}\n\nconst isPromise = p => p && typeof p.then === 'function'\n\nmodule.exports = depth\n","module.exports = {\n breadth: require('./breadth.js'),\n depth: require('./depth.js'),\n}\n","const hasIntl = typeof Intl === 'object' && !!Intl\nconst Collator = hasIntl && Intl.Collator\nconst cache = new Map()\n\nconst collatorCompare = (locale, opts) => {\n const collator = new Collator(locale, opts)\n return (a, b) => collator.compare(a, b)\n}\n\nconst localeCompare = (locale, opts) => (a, b) => a.localeCompare(b, locale, opts)\n\nconst knownOptions = [\n 'sensitivity',\n 'numeric',\n 'ignorePunctuation',\n 'caseFirst',\n]\n\nconst { hasOwnProperty } = Object.prototype\n\nmodule.exports = (locale, options = {}) => {\n if (!locale || typeof locale !== 'string')\n throw new TypeError('locale required')\n\n const opts = knownOptions.reduce((opts, k) => {\n if (hasOwnProperty.call(options, k)) {\n opts[k] = options[k]\n }\n return opts\n }, {})\n const key = `${locale}\\n${JSON.stringify(opts)}`\n\n if (cache.has(key))\n return cache.get(key)\n\n const compare = hasIntl\n ? collatorCompare(locale, opts)\n : localeCompare(locale, opts)\n cache.set(key, compare)\n\n return compare\n}\n","// add and remove dependency specs to/from pkg manifest\n\nconst { log } = require('proc-log')\nconst localeCompare = require('@isaacs/string-locale-compare')('en')\n\nconst add = ({ pkg, add, saveBundle, saveType }) => {\n for (const { name, rawSpec } of add) {\n let addSaveType = saveType\n // if the user does not give us a type, we infer which type(s)\n // to keep based on the same order of priority we do when\n // building the tree as defined in the _loadDeps method of\n // the node class.\n if (!addSaveType) {\n addSaveType = inferSaveType(pkg, name)\n }\n\n if (addSaveType === 'prod') {\n // a production dependency can only exist as production (rpj ensures it\n // doesn't coexist w/ optional)\n deleteSubKey(pkg, 'devDependencies', name, 'dependencies')\n deleteSubKey(pkg, 'peerDependencies', name, 'dependencies')\n } else if (addSaveType === 'dev') {\n // a dev dependency may co-exist as peer, or optional, but not production\n deleteSubKey(pkg, 'dependencies', name, 'devDependencies')\n } else if (addSaveType === 'optional') {\n // an optional dependency may co-exist as dev (rpj ensures it doesn't\n // coexist w/ prod)\n deleteSubKey(pkg, 'peerDependencies', name, 'optionalDependencies')\n } else { // peer or peerOptional is all that's left\n // a peer dependency may coexist as dev\n deleteSubKey(pkg, 'dependencies', name, 'peerDependencies')\n deleteSubKey(pkg, 'optionalDependencies', name, 'peerDependencies')\n }\n\n const depType = saveTypeMap.get(addSaveType)\n\n pkg[depType] = pkg[depType] || {}\n if (rawSpec !== '*' || pkg[depType][name] === undefined) {\n pkg[depType][name] = rawSpec\n }\n if (addSaveType === 'optional') {\n // Affordance for previous npm versions that require this behaviour\n pkg.dependencies = pkg.dependencies || {}\n pkg.dependencies[name] = pkg.optionalDependencies[name]\n }\n\n if (addSaveType === 'peer' || addSaveType === 'peerOptional') {\n const pdm = pkg.peerDependenciesMeta || {}\n if (addSaveType === 'peer' && pdm[name] && pdm[name].optional) {\n pdm[name].optional = false\n } else if (addSaveType === 'peerOptional') {\n pdm[name] = pdm[name] || {}\n pdm[name].optional = true\n pkg.peerDependenciesMeta = pdm\n }\n // peerDeps are often also a devDep, so that they can be tested when\n // using package managers that don't auto-install peer deps\n if (pkg.devDependencies && pkg.devDependencies[name] !== undefined) {\n pkg.devDependencies[name] = pkg.peerDependencies[name]\n }\n }\n\n if (saveBundle && addSaveType !== 'peer' && addSaveType !== 'peerOptional') {\n // keep it sorted, keep it unique\n const bd = new Set(pkg.bundleDependencies || [])\n bd.add(name)\n pkg.bundleDependencies = [...bd].sort(localeCompare)\n }\n }\n\n return pkg\n}\n\n// Canonical source of both the map between saveType and where it correlates to\n// in the package, and the names of all our dependencies attributes\nconst saveTypeMap = new Map([\n ['dev', 'devDependencies'],\n ['optional', 'optionalDependencies'],\n ['prod', 'dependencies'],\n ['peerOptional', 'peerDependencies'],\n ['peer', 'peerDependencies'],\n])\n\n// Finds where the package is already in the spec and infers saveType from that\nconst inferSaveType = (pkg, name) => {\n for (const saveType of saveTypeMap.keys()) {\n if (hasSubKey(pkg, saveTypeMap.get(saveType), name)) {\n if (\n saveType === 'peerOptional' &&\n (!hasSubKey(pkg, 'peerDependenciesMeta', name) ||\n !pkg.peerDependenciesMeta[name].optional)\n ) {\n return 'peer'\n }\n return saveType\n }\n }\n return 'prod'\n}\n\nconst hasSubKey = (pkg, depType, name) => {\n return pkg[depType] && Object.prototype.hasOwnProperty.call(pkg[depType], name)\n}\n\n// Removes a subkey and warns about it if it's being replaced\nconst deleteSubKey = (pkg, depType, name, replacedBy) => {\n if (hasSubKey(pkg, depType, name)) {\n if (replacedBy) {\n log.warn('idealTree', `Removing ${depType}.${name} in favor of ${replacedBy}.${name}`)\n }\n delete pkg[depType][name]\n\n // clean up peerDepsMeta if we are removing something from peerDependencies\n if (depType === 'peerDependencies' && pkg.peerDependenciesMeta) {\n delete pkg.peerDependenciesMeta[name]\n if (!Object.keys(pkg.peerDependenciesMeta).length) {\n delete pkg.peerDependenciesMeta\n }\n }\n\n if (!Object.keys(pkg[depType]).length) {\n delete pkg[depType]\n }\n }\n}\n\nconst rm = (pkg, rm) => {\n for (const depType of new Set(saveTypeMap.values())) {\n for (const name of rm) {\n deleteSubKey(pkg, depType, name)\n }\n }\n if (pkg.bundleDependencies) {\n pkg.bundleDependencies = pkg.bundleDependencies\n .filter(name => !rm.includes(name))\n if (!pkg.bundleDependencies.length) {\n delete pkg.bundleDependencies\n }\n }\n return pkg\n}\n\nmodule.exports = { add, rm, saveTypeMap, hasSubKey }\n","// An object representing a vulnerability either as the result of an\n// advisory or due to the package in question depending exclusively on\n// vulnerable versions of a dep.\n//\n// - name: package name\n// - range: Set of vulnerable versions\n// - nodes: Set of nodes affected\n// - effects: Set of vulns triggered by this one\n// - advisories: Set of advisories (including metavulns) causing this vuln.\n// All of the entries in via are vulnerability objects returned by\n// @npmcli/metavuln-calculator\n// - via: dependency vulns which cause this one\n\nconst { satisfies, simplifyRange } = require('semver')\nconst semverOpt = { loose: true, includePrerelease: true }\n\nconst localeCompare = require('@isaacs/string-locale-compare')('en')\nconst npa = require('npm-package-arg')\n\nconst severities = new Map([\n ['info', 0], [0, 'info'],\n ['low', 1], [1, 'low'],\n ['moderate', 2], [2, 'moderate'],\n ['high', 3], [3, 'high'],\n ['critical', 4], [4, 'critical'],\n [null, -1], [-1, null],\n])\n\nclass Vuln {\n #range = null\n #simpleRange = null\n // assume a fix is available unless it hits a top node\n // that locks it in place, setting this false or {isSemVerMajor, version}.\n #fixAvailable = true\n\n constructor ({ name, advisory }) {\n this.name = name\n this.via = new Set()\n this.advisories = new Set()\n this.severity = null\n this.effects = new Set()\n this.topNodes = new Set()\n this.nodes = new Set()\n this.fixBlockedByReleaseAge = false\n this.addAdvisory(advisory)\n this.packument = advisory.packument\n this.versions = advisory.versions\n }\n\n get fixAvailable () {\n return this.#fixAvailable\n }\n\n set fixAvailable (f) {\n this.#fixAvailable = f\n // if there's a fix available for this at the top level, it means that\n // it will also fix the vulns that led to it being there. to get there,\n // we set the vias to the most \"strict\" of fix availables.\n // - false: no fix is available\n // - {name, version, isSemVerMajor} fix requires -f, is semver major\n // - {name, version} fix requires -f, not semver major\n // - true: fix does not require -f\n // TODO: duped entries may require different fixes but the current\n // structure does not support this, so the case were a top level fix\n // corrects a duped entry may mean you have to run fix more than once\n for (const v of this.via) {\n // don't blow up on loops\n if (v.fixAvailable === f) {\n continue\n }\n\n if (f === false) {\n v.fixAvailable = f\n } else if (v.fixAvailable === true) {\n v.fixAvailable = f\n } else if (typeof f === 'object' && (\n typeof v.fixAvailable !== 'object' || !v.fixAvailable.isSemVerMajor)) {\n v.fixAvailable = f\n }\n }\n }\n\n get isDirect () {\n for (const node of this.nodes.values()) {\n for (const edge of node.edgesIn) {\n if (edge.from.isProjectRoot || edge.from.isWorkspace) {\n return true\n }\n }\n }\n return false\n }\n\n testSpec (spec) {\n const specObj = npa(spec)\n if (!specObj.registry) {\n return true\n }\n\n if (specObj.subSpec) {\n spec = specObj.subSpec.rawSpec\n }\n\n for (const v of this.versions) {\n if (satisfies(v, spec) && !satisfies(v, this.range, semverOpt)) {\n return false\n }\n }\n return true\n }\n\n toJSON () {\n return {\n name: this.name,\n severity: this.severity,\n isDirect: this.isDirect,\n // just loop over the advisories, since via is only Vuln objects,\n // and calculated advisories have all the info we need\n via: [...this.advisories].map(v => v.type === 'metavuln' ? v.dependency : {\n ...v,\n versions: undefined,\n vulnerableVersions: undefined,\n id: undefined,\n }).sort((a, b) =>\n localeCompare(String(a.source || a), String(b.source || b))),\n effects: [...this.effects].map(v => v.name).sort(localeCompare),\n range: this.simpleRange,\n nodes: [...this.nodes].map(n => n.location).sort(localeCompare),\n fixAvailable: this.#fixAvailable,\n ...(this.fixBlockedByReleaseAge\n ? { fixBlockedByReleaseAge: this.fixBlockedByReleaseAge }\n : {}),\n }\n }\n\n addVia (v) {\n this.via.add(v)\n v.effects.add(this)\n // call the setter since we might add vias _after_ setting fixAvailable\n this.fixAvailable = this.fixAvailable\n }\n\n deleteVia (v) {\n this.via.delete(v)\n v.effects.delete(this)\n }\n\n deleteAdvisory (advisory) {\n this.advisories.delete(advisory)\n // make sure we have the max severity of all the vulns causing this one\n this.severity = null\n this.#range = null\n this.#simpleRange = null\n // refresh severity\n for (const advisory of this.advisories) {\n this.addAdvisory(advisory)\n }\n\n // remove any effects that are no longer relevant\n const vias = new Set([...this.advisories].map(a => a.dependency))\n for (const via of this.via) {\n if (!vias.has(via.name)) {\n this.deleteVia(via)\n }\n }\n }\n\n addAdvisory (advisory) {\n this.advisories.add(advisory)\n const sev = severities.get(advisory.severity)\n this.#range = null\n this.#simpleRange = null\n if (sev > severities.get(this.severity)) {\n this.severity = advisory.severity\n }\n }\n\n get range () {\n if (!this.#range) {\n this.#range = [...this.advisories].map(v => v.range).join(' || ')\n }\n return this.#range\n }\n\n get simpleRange () {\n if (this.#simpleRange && this.#simpleRange === this.#range) {\n return this.#simpleRange\n }\n\n const versions = [...this.advisories][0].versions\n const range = this.range\n this.#simpleRange = simplifyRange(versions, range, semverOpt)\n this.#range = this.#simpleRange\n return this.#simpleRange\n }\n\n isVulnerable (node) {\n if (this.nodes.has(node)) {\n return true\n }\n\n const { version } = node.package\n if (!version) {\n return false\n }\n\n for (const v of this.advisories) {\n if (v.testVersion(version)) {\n this.nodes.add(node)\n return true\n }\n }\n\n return false\n }\n}\n\nmodule.exports = Vuln\n","const { createHash } = require('crypto')\n\nmodule.exports = ({ name, source }) => createHash('sha512')\n .update(JSON.stringify([name, source]))\n .digest('base64')\n","module.exports = (mani, name) => {\n // skip dev because that only matters at the root,\n // where we aren't fetching a manifest from the registry\n // with multiple versions anyway.\n const {\n dependencies: deps = {},\n optionalDependencies: optDeps = {},\n peerDependencies: peerDeps = {},\n } = mani\n\n return deps && typeof deps[name] === 'string' ? deps[name]\n : optDeps && typeof optDeps[name] === 'string' ? optDeps[name]\n : peerDeps && typeof peerDeps[name] === 'string' ? peerDeps[name]\n : null\n}\n","const hash = require('./hash.js')\nconst semver = require('semver')\nconst semverOpt = { includePrerelease: true, loose: true }\nconst getDepSpec = require('./get-dep-spec.js')\n\n// any fields that we don't want in the cache need to be hidden\nconst _source = Symbol('source')\nconst _packument = Symbol('packument')\nconst _versionVulnMemo = Symbol('versionVulnMemo')\nconst _updated = Symbol('updated')\nconst _options = Symbol('options')\nconst _specVulnMemo = Symbol('specVulnMemo')\nconst _testVersion = Symbol('testVersion')\nconst _testVersions = Symbol('testVersions')\nconst _calculateRange = Symbol('calculateRange')\nconst _markVulnerable = Symbol('markVulnerable')\nconst _testSpec = Symbol('testSpec')\n\nclass Advisory {\n constructor (name, source, options = {}) {\n this.source = source.id\n this[_source] = source\n this[_options] = options\n this.name = name\n if (!source.name) {\n source.name = name\n }\n\n this.dependency = source.name\n\n if (this.type === 'advisory') {\n this.title = source.title\n this.url = source.url\n } else {\n this.title = `Depends on vulnerable versions of ${source.name}`\n this.url = null\n }\n\n this.severity = source.severity || 'high'\n this.versions = []\n this.vulnerableVersions = []\n this.cwe = source.cwe\n this.cvss = source.cvss\n\n // advisories have the range, metavulns do not\n // if an advisory doesn't specify range, assume all are vulnerable\n this.range = this.type === 'advisory' ? source.vulnerable_versions || '*'\n : null\n\n this.id = hash(this)\n\n this[_packument] = null\n // memoized list of which versions are vulnerable\n this[_versionVulnMemo] = new Map()\n // memoized list of which dependency specs are vulnerable\n this[_specVulnMemo] = new Map()\n this[_updated] = false\n }\n\n // true if we updated from what we had in cache\n get updated () {\n return this[_updated]\n }\n\n get type () {\n return this.dependency === this.name ? 'advisory' : 'metavuln'\n }\n\n get packument () {\n return this[_packument]\n }\n\n // load up the data from a cache entry and a fetched packument\n load (cached, packument) {\n // basic data integrity gutcheck\n if (!cached || typeof cached !== 'object') {\n throw new TypeError('invalid cached data, expected object')\n }\n\n if (!packument || typeof packument !== 'object') {\n throw new TypeError('invalid packument data, expected object')\n }\n\n if (cached.id && cached.id !== this.id) {\n throw Object.assign(new Error('loading from incorrect cache entry'), {\n expected: this.id,\n actual: cached.id,\n })\n }\n if (packument.name !== this.name) {\n throw Object.assign(new Error('loading from incorrect packument'), {\n expected: this.name,\n actual: packument.name,\n })\n }\n if (this[_packument]) {\n throw new Error('advisory object already loaded')\n }\n\n // if we have a range from the initialization, and the cached\n // data has a *different* range, then we know we have to recalc.\n // just don't use the cached data, so we will definitely not match later\n if (!this.range || cached.range && cached.range === this.range) {\n Object.assign(this, cached)\n }\n\n this[_packument] = packument\n\n const pakuVersions = Object.keys(packument.versions || {})\n const allVersions = new Set([...pakuVersions, ...this.versions])\n const versionsAdded = []\n const versionsRemoved = []\n for (const v of allVersions) {\n if (!this.versions.includes(v)) {\n versionsAdded.push(v)\n this.versions.push(v)\n } else if (!pakuVersions.includes(v)) {\n versionsRemoved.push(v)\n }\n }\n\n // strip out any removed versions from our lists, and sort by semver\n this.versions = semver.sort(this.versions.filter(v =>\n !versionsRemoved.includes(v)), semverOpt)\n\n // if no changes, then just return what we got from cache\n // versions added or removed always means we changed\n // otherwise, advisories change if the range changes, and\n // metavulns change if the source was updated\n const unchanged = this.type === 'advisory'\n ? this.range && this.range === cached.range\n : !this[_source].updated\n\n // if the underlying source changed, by an advisory updating the\n // range, or a source advisory being updated, then we have to re-check\n // otherwise, only recheck the new ones.\n this.vulnerableVersions = !unchanged ? []\n : semver.sort(this.vulnerableVersions.filter(v =>\n !versionsRemoved.includes(v)), semverOpt)\n\n if (unchanged && !versionsAdded.length && !versionsRemoved.length) {\n // nothing added or removed, nothing to do here. use the cached copy.\n return this\n }\n\n this[_updated] = true\n\n // test any versions newly added\n if (!unchanged || versionsAdded.length) {\n this[_testVersions](unchanged ? versionsAdded : this.versions)\n }\n this.vulnerableVersions = semver.sort(this.vulnerableVersions, semverOpt)\n\n // metavulns have to calculate their range, since cache is invalidated\n // advisories just get their range from the advisory above\n if (this.type === 'metavuln') {\n this[_calculateRange]()\n }\n\n return this\n }\n\n [_calculateRange] () {\n // calling semver.simplifyRange with a massive list of versions, and those\n // versions all concatenated with `||` is a geometric CPU explosion!\n // we can try to be a *little* smarter up front by doing x-y for all\n // contiguous version sets in the list\n const ranges = []\n this.versions = semver.sort(this.versions, semverOpt)\n this.vulnerableVersions = semver.sort(this.vulnerableVersions, semverOpt)\n for (let v = 0, vulnVer = 0; v < this.versions.length; v++) {\n // figure out the vulnerable subrange\n const vr = [this.versions[v]]\n while (v < this.versions.length) {\n if (this.versions[v] !== this.vulnerableVersions[vulnVer]) {\n // we don't test prerelease versions, so just skip past it\n if (/-/.test(this.versions[v])) {\n v++\n continue\n }\n break\n }\n if (vr.length > 1) {\n vr[1] = this.versions[v]\n } else {\n vr.push(this.versions[v])\n }\n v++\n vulnVer++\n }\n // it'll either be just the first version, which means no overlap,\n // or the start and end versions, which might be the same version\n if (vr.length > 1) {\n const tail = this.versions[this.versions.length - 1]\n ranges.push(vr[1] === tail ? `>=${vr[0]}`\n : vr[0] === vr[1] ? vr[0]\n : vr.join(' - '))\n }\n }\n const metavuln = ranges.join(' || ').trim()\n this.range = !metavuln ? '<0.0.0-0'\n : semver.simplifyRange(this.versions, metavuln, semverOpt)\n }\n\n // returns true if marked as vulnerable, false if ok\n // spec is a dependency specifier, for metavuln cases\n // where the version might not be in the packument. if\n // we have the packument and spec is not provided, then\n // we use the dependency version from the manifest.\n testVersion (version, spec = null) {\n const sv = String(version)\n if (this[_versionVulnMemo].has(sv)) {\n return this[_versionVulnMemo].get(sv)\n }\n\n const result = this[_testVersion](version, spec)\n if (result) {\n this[_markVulnerable](version)\n }\n this[_versionVulnMemo].set(sv, !!result)\n return result\n }\n\n [_markVulnerable] (version) {\n const sv = String(version)\n if (!this.vulnerableVersions.includes(sv)) {\n this.vulnerableVersions.push(sv)\n }\n }\n\n [_testVersion] (version, spec) {\n const sv = String(version)\n if (this.vulnerableVersions.includes(sv)) {\n return true\n }\n\n if (this.type === 'advisory') {\n // advisory, just test range\n return semver.satisfies(version, this.range, semverOpt)\n }\n\n // check the dependency of this version on the vulnerable dep\n // if we got a version that's not in the packument, fall back on\n // the spec provided, if possible.\n const mani = this[_packument]?.versions?.[version] || {\n dependencies: {\n [this.dependency]: spec,\n },\n }\n\n if (!spec) {\n spec = getDepSpec(mani, this.dependency)\n }\n\n // no dep, no vuln\n if (spec === null) {\n return false\n }\n\n if (!semver.validRange(spec, semverOpt)) {\n // not a semver range, nothing we can hope to do about it\n return true\n }\n\n const bd = mani.bundleDependencies\n const bundled = bd && bd.includes(this[_source].name)\n // XXX if bundled, then semver.intersects() means vulnerable\n // else, pick a manifest and see if it can't be avoided\n // try to pick a version of the dep that isn't vulnerable\n const avoid = this[_source].range\n\n if (bundled) {\n return semver.intersects(spec, avoid, semverOpt)\n }\n\n return this[_source].testSpec(spec)\n }\n\n testSpec (spec) {\n // testing all the versions is a bit costly, and the spec tends to stay\n // consistent across multiple versions, so memoize this as well, in case\n // we're testing lots of versions.\n const memo = this[_specVulnMemo]\n if (memo.has(spec)) {\n return memo.get(spec)\n }\n\n const res = this[_testSpec](spec)\n memo.set(spec, res)\n return res\n }\n\n [_testSpec] (spec) {\n for (const v of this.versions) {\n const satisfies = semver.satisfies(v, spec, semverOpt)\n if (!satisfies) {\n continue\n }\n if (!this.testVersion(v)) {\n return false\n }\n }\n // either vulnerable, or not installable because nothing satisfied\n // either way, best avoided.\n return true\n }\n\n [_testVersions] (versions) {\n if (!versions.length) {\n return\n }\n\n // set of lists of versions\n const versionSets = new Set()\n versions = semver.sort(versions.map(v => semver.parse(v, semverOpt)))\n\n // start out with the versions grouped by major and minor\n let last = versions[0].major + '.' + versions[0].minor\n let list = []\n versionSets.add(list)\n for (const v of versions) {\n const k = v.major + '.' + v.minor\n if (k !== last) {\n last = k\n list = []\n versionSets.add(list)\n }\n list.push(v)\n }\n\n for (const set of versionSets) {\n // it's common to have version lists like:\n // 1.0.0\n // 1.0.1-alpha.0\n // 1.0.1-alpha.1\n // ...\n // 1.0.1-alpha.999\n // 1.0.1\n // 1.0.2-alpha.0\n // ...\n // 1.0.2-alpha.99\n // 1.0.2\n // with a huge number of prerelease versions that are not installable\n // anyway.\n // If mid has a prerelease tag, and set[0] does not, then walk it\n // back until we hit a non-prerelease version\n // If mid has a prerelease tag, and set[set.length-1] does not,\n // then walk it forward until we hit a version without a prerelease tag\n // Similarly, if the head/tail is a prerelease, but there is a non-pr\n // version in the set, then start there instead.\n let h = 0\n const origHeadVuln = this.testVersion(set[h])\n while (h < set.length && /-/.test(String(set[h]))) {\n h++\n }\n\n // don't filter out the whole list! they might all be pr's\n if (h === set.length) {\n h = 0\n } else if (origHeadVuln) {\n // if the original was vulnerable, assume so are all of these\n for (let hh = 0; hh < h; hh++) {\n this[_markVulnerable](set[hh])\n }\n }\n\n let t = set.length - 1\n const origTailVuln = this.testVersion(set[t])\n while (t > h && /-/.test(String(set[t]))) {\n t--\n }\n\n // don't filter out the whole list! might all be pr's\n if (t === h) {\n t = set.length - 1\n } else if (origTailVuln) {\n // if original tail was vulnerable, assume these are as well\n for (let tt = set.length - 1; tt > t; tt--) {\n this[_markVulnerable](set[tt])\n }\n }\n\n const headVuln = h === 0 ? origHeadVuln\n : this.testVersion(set[h])\n\n const tailVuln = t === set.length - 1 ? origTailVuln\n : this.testVersion(set[t])\n\n // if head and tail both vulnerable, whole list is thrown out\n if (headVuln && tailVuln) {\n for (let v = h; v < t; v++) {\n this[_markVulnerable](set[v])\n }\n continue\n }\n\n // if length is 2 or 1, then we marked them all already\n if (t < h + 2) {\n continue\n }\n\n const mid = Math.floor(set.length / 2)\n const pre = set.slice(0, mid)\n const post = set.slice(mid)\n\n // if the parent list wasn't prereleases, then drop pr tags\n // from end of the pre list, and beginning of the post list,\n // marking as vulnerable if the midpoint item we picked is.\n if (!/-/.test(String(pre[0]))) {\n const midVuln = this.testVersion(pre[pre.length - 1])\n while (/-/.test(String(pre[pre.length - 1]))) {\n const v = pre.pop()\n if (midVuln) {\n this[_markVulnerable](v)\n }\n }\n }\n\n if (!/-/.test(String(post[post.length - 1]))) {\n const midVuln = this.testVersion(post[0])\n while (/-/.test(String(post[0]))) {\n const v = post.shift()\n if (midVuln) {\n this[_markVulnerable](v)\n }\n }\n }\n\n versionSets.add(pre)\n versionSets.add(post)\n }\n }\n}\n\nmodule.exports = Advisory\n","// this is the public class that is used by consumers.\n// the Advisory class handles all the calculation, and this\n// class handles all the IO with the registry and cache.\nconst pacote = require('pacote')\nconst cacache = require('cacache')\nconst { time } = require('proc-log')\nconst Advisory = require('./advisory.js')\nconst { homedir } = require('os')\nconst jsonParse = require('json-parse-even-better-errors')\n\nconst _packument = Symbol('packument')\nconst _cachePut = Symbol('cachePut')\nconst _cacheGet = Symbol('cacheGet')\nconst _cacheData = Symbol('cacheData')\nconst _packuments = Symbol('packuments')\nconst _cache = Symbol('cache')\nconst _options = Symbol('options')\nconst _advisories = Symbol('advisories')\nconst _calculate = Symbol('calculate')\n\nclass Calculator {\n constructor (options = {}) {\n this[_options] = { ...options }\n this[_cache] = this[_options].cache || (homedir() + '/.npm/_cacache')\n this[_options].cache = this[_cache]\n this[_packuments] = new Map()\n this[_cacheData] = new Map()\n this[_advisories] = new Map()\n }\n\n get cache () {\n return this[_cache]\n }\n\n get options () {\n return { ...this[_options] }\n }\n\n async calculate (name, source) {\n const k = `security-advisory:${name}:${source.id}`\n if (this[_advisories].has(k)) {\n return this[_advisories].get(k)\n }\n\n const p = this[_calculate](name, source)\n this[_advisories].set(k, p)\n return p\n }\n\n async [_calculate] (name, source) {\n const k = `security-advisory:${name}:${source.id}`\n const timeEnd = time.start(`metavuln:calculate:${k}`)\n const advisory = new Advisory(name, source, this[_options])\n // load packument and cached advisory\n const [cached, packument] = await Promise.all([\n this[_cacheGet](advisory),\n this[_packument](name),\n ])\n const timeEndLoad = time.start(`metavuln:load:${k}`)\n advisory.load(cached, packument)\n timeEndLoad()\n if (advisory.updated) {\n await this[_cachePut](advisory)\n }\n this[_advisories].set(k, advisory)\n timeEnd()\n return advisory\n }\n\n async [_cachePut] (advisory) {\n const { name, id } = advisory\n const key = `security-advisory:${name}:${id}`\n const timeEnd = time.start(`metavuln:cache:put:${key}`)\n const data = JSON.stringify(advisory)\n const options = { ...this[_options] }\n this[_cacheData].set(key, jsonParse(data))\n await cacache.put(this[_cache], key, data, options).catch(() => {})\n timeEnd()\n }\n\n async [_cacheGet] (advisory) {\n const { name, id } = advisory\n const key = `security-advisory:${name}:${id}`\n /* istanbul ignore if - should be impossible, since we memoize the\n * advisory object itself using the same key, just being cautious */\n if (this[_cacheData].has(key)) {\n return this[_cacheData].get(key)\n }\n\n const timeEnd = time.start(`metavuln:cache:get:${key}`)\n const p = cacache.get(this[_cache], key, { ...this[_options] })\n .catch(() => ({ data: '{}' }))\n .then(({ data }) => {\n data = jsonParse(data)\n timeEnd()\n this[_cacheData].set(key, data)\n return data\n })\n this[_cacheData].set(key, p)\n return p\n }\n\n async [_packument] (name) {\n if (this[_packuments].has(name)) {\n return this[_packuments].get(name)\n }\n\n const timeEnd = time.start(`metavuln:packument:${name}`)\n const p = pacote.packument(name, { ...this[_options] })\n .catch(() => {\n // presumably not something from the registry.\n // an empty packument will have an effective range of *\n return {\n name,\n versions: {},\n }\n })\n .then(paku => {\n timeEnd()\n this[_packuments].set(name, paku)\n return paku\n })\n this[_packuments].set(name, p)\n return p\n }\n}\n\nmodule.exports = Calculator\n","// Determine whether a package name is exempt from the `min-release-age` /\n// `before` release-age filter, based on the `min-release-age-exclude` config.\n//\n// Patterns are exact package names or `minimatch` globs (e.g. `@myorg/*`), and\n// match against the package name only. This is a \"named-only\" exemption: a\n// matched package's own dependencies still follow the filter unless they match\n// a pattern too.\n//\n// Callers must match against the resolved registry identity of a package, not\n// the self-reported alias or dependency-edge name. For `npm:` aliases the\n// fetched package is the alias target, so run specs through `trustedSpecName`\n// first; otherwise an alias key could match an exclude pattern and turn the\n// filter off for the unrelated package it resolves to.\nconst { minimatch } = require('minimatch')\n\n// This list only ever widens the exemption (turns the security filter off for a\n// package), so disable pattern features that could silently turn it into a\n// match-all: `nonegate` keeps a leading `!` literal (so a stray `!foo` exempts\n// nothing instead of everything-but-foo), `nocomment` keeps a leading `#`\n// literal, and `noext` disables extglobs.\nconst minimatchOptions = { nonegate: true, nocomment: true, noext: true }\n\nconst isReleaseAgeExcluded = (name, patterns) => {\n if (!name || !Array.isArray(patterns) || patterns.length === 0) {\n return false\n }\n return patterns.some(pattern =>\n name === pattern || minimatch(name, pattern, minimatchOptions))\n}\n\n// Resolve the trusted registry name for an npa spec. For `npm:` aliases (e.g.\n// `\"x\": \"npm:other@1\"`) the installed/fetched package is the alias target\n// (`subSpec`), not the alias key, so the exemption must be keyed on the\n// underlying package name. Mirrors `nameFromEdges` in script-allowed.js.\nconst trustedSpecName = (spec) => {\n if (!spec) {\n return undefined\n }\n if (spec.type === 'alias' && spec.subSpec && spec.subSpec.registry) {\n return spec.subSpec.name\n }\n return spec.name\n}\n\nmodule.exports = { isReleaseAgeExcluded, trustedSpecName }\n","// an object representing the set of vulnerabilities in a tree\n\nconst localeCompare = require('@isaacs/string-locale-compare')('en')\nconst npa = require('npm-package-arg')\nconst pickManifest = require('npm-pick-manifest')\n\nconst Vuln = require('./vuln.js')\nconst Calculator = require('@npmcli/metavuln-calculator')\nconst { isReleaseAgeExcluded } = require('./release-age-exclude.js')\n\nconst { log, time } = require('proc-log')\n\nconst npmFetch = require('npm-registry-fetch')\n\nclass AuditReport extends Map {\n #omit\n error = null\n topVulns = new Map()\n\n static load (tree, opts) {\n return new AuditReport(tree, opts).run()\n }\n\n get auditReportVersion () {\n return 2\n }\n\n toJSON () {\n const obj = {\n auditReportVersion: this.auditReportVersion,\n vulnerabilities: {},\n metadata: {\n vulnerabilities: {\n info: 0,\n low: 0,\n moderate: 0,\n high: 0,\n critical: 0,\n total: this.size,\n },\n dependencies: {\n prod: 0,\n dev: 0,\n optional: 0,\n peer: 0,\n peerOptional: 0,\n total: this.tree.inventory.size - 1,\n },\n },\n }\n\n for (const node of this.tree.inventory.values()) {\n const { dependencies } = obj.metadata\n let prod = true\n for (const type of [\n 'dev',\n 'optional',\n 'peer',\n 'peerOptional',\n ]) {\n if (node[type]) {\n dependencies[type]++\n prod = false\n }\n }\n if (prod) {\n dependencies.prod++\n }\n }\n\n // if it doesn't have any topVulns, then it's fixable with audit fix\n // for each topVuln, figure out if it's fixable with audit fix --force,\n // or if we have to just delete the thing, and if the fix --force will\n // require a semver major update.\n const vulnerabilities = []\n for (const [name, vuln] of this.entries()) {\n vulnerabilities.push([name, vuln.toJSON()])\n obj.metadata.vulnerabilities[vuln.severity]++\n }\n\n obj.vulnerabilities = vulnerabilities\n .sort(([a], [b]) => localeCompare(a, b))\n .reduce((set, [name, vuln]) => {\n set[name] = vuln\n return set\n }, {})\n\n return obj\n }\n\n constructor (tree, opts = {}) {\n super()\n this.#omit = new Set(opts.omit || [])\n this.calculator = new Calculator(opts)\n this.options = opts\n this.tree = tree\n this.filterSet = opts.filterSet\n }\n\n async run () {\n this.report = await this.#getReport()\n log.silly('audit report', this.report)\n if (this.report) {\n await this.#init()\n }\n return this\n }\n\n isVulnerable (node) {\n const vuln = this.get(node.packageName)\n return !!(vuln && vuln.isVulnerable(node))\n }\n\n async #init () {\n const timeEnd = time.start('auditReport:init')\n\n const promises = []\n for (const [name, advisories] of Object.entries(this.report)) {\n for (const advisory of advisories) {\n promises.push(this.calculator.calculate(name, advisory))\n }\n }\n\n // now the advisories are calculated with a set of versions\n // and the packument. turn them into our style of vuln objects\n // which also have the affected nodes, and also create entries\n // for all the metavulns that we find from dependents.\n const advisories = new Set(await Promise.all(promises))\n const seen = new Set()\n for (const advisory of advisories) {\n const { name, range } = advisory\n const k = `${name}@${range}`\n\n const vuln = this.get(name) || new Vuln({ name, advisory })\n if (this.has(name)) {\n vuln.addAdvisory(advisory)\n }\n super.set(name, vuln)\n\n // don't flag the exact same name/range more than once\n // adding multiple advisories with the same range is fine, but no\n // need to search for nodes we already would have added.\n if (!seen.has(k)) {\n const p = []\n for (const node of this.tree.inventory.query('packageName', name)) {\n if (!this.shouldAudit(node)) {\n continue\n }\n\n // if not vulnerable by this advisory, keep searching\n if (!advisory.testVersion(node.version)) {\n continue\n }\n\n // already marked this one, no need to do it again\n if (vuln.nodes.has(node)) {\n continue\n }\n\n // haven't marked this one yet. get its dependents.\n vuln.nodes.add(node)\n for (const { from: dep, spec } of node.edgesIn) {\n if (dep.isTop && !vuln.topNodes.has(dep)) {\n vuln.fixAvailable = this.#fixAvailable(vuln, spec)\n if (vuln.fixAvailable !== true) {\n // now we know the top node is vulnerable, and cannot be\n // upgraded out of the bad place without --force. But, there's\n // no need to add it to the actual vulns list, because nothing\n // depends on root.\n this.topVulns.set(vuln.name, vuln)\n vuln.topNodes.add(dep)\n } else {\n // An in-range fix exists, but a `min-release-age`/`before`\n // window may put the patched version out of reach, leaving the\n // vulnerable version installed.\n vuln.fixBlockedByReleaseAge = this.#fixBlockedByReleaseAge(vuln, spec)\n }\n } else {\n // calculate a metavuln, if necessary\n const calc = this.calculator.calculate(dep.packageName, advisory)\n // eslint-disable-next-line promise/always-return\n p.push(calc.then(meta => {\n // eslint-disable-next-line promise/always-return\n if (meta.testVersion(dep.version, spec)) {\n advisories.add(meta)\n }\n }))\n }\n }\n }\n await Promise.all(p)\n seen.add(k)\n }\n\n // make sure we actually got something. if not, remove it\n // this can happen if you are loading from a lockfile created by\n // npm v5, since it lists the current version of all deps,\n // rather than the range that is actually depended upon,\n // or if using --omit with the older audit endpoint.\n if (this.get(name).nodes.size === 0) {\n this.delete(name)\n continue\n }\n\n // if the vuln is valid, but THIS advisory doesn't apply to any of\n // the nodes it references, then remove it from the advisory list.\n // happens when using omit with old audit endpoint.\n for (const advisory of vuln.advisories) {\n const relevant = [...vuln.nodes]\n .some(n => advisory.testVersion(n.version))\n if (!relevant) {\n vuln.deleteAdvisory(advisory)\n }\n }\n }\n\n // post-loop reconciliation: establish all via links\n // done here to ensure all vulns exist, avoid redundant setter triggers,\n // and correctly handle multiple paths and omission cleanups.\n for (const vuln of this.values()) {\n for (const advisory of vuln.advisories) {\n if (advisory.type === 'metavuln') {\n vuln.addVia(this.get(advisory.dependency))\n }\n }\n }\n\n timeEnd()\n }\n\n // given the spec, see if there is a fix available at all, and note whether or not it's a semver major fix or not (i.e. will need --force)\n #fixAvailable (vuln, spec) {\n // TODO we return true, false, OR an object here. this is probably a bad pattern.\n if (!vuln.testSpec(spec)) {\n return true\n }\n\n // even if we HAVE a packument, if we're looking for it somewhere other than the registry and we have something vulnerable then we're stuck with it.\n const specObj = npa(spec)\n if (!specObj.registry) {\n return false\n }\n\n if (specObj.subSpec) {\n spec = specObj.subSpec.rawSpec\n }\n\n // we don't provide fixes for top nodes other than root, but we still check to see if the node is fixable with a different version, and note if that is a semver major bump.\n try {\n const {\n _isSemVerMajor: isSemVerMajor,\n version,\n name,\n } = pickManifest(vuln.packument, spec, {\n ...this.options,\n before: null,\n avoid: vuln.range,\n avoidStrict: true,\n })\n return { name, version, isSemVerMajor }\n } catch (er) {\n return false\n }\n }\n\n // A fix that `#fixAvailable` reports as installable in-range can still be\n // unreachable when a release-age window (`before` / `min-release-age`) is set,\n // because the patched version was published after the cutoff. `npm audit fix`\n // then resolves back to a version that is still vulnerable, so detect that\n // here and let callers warn about it. Only meaningful when an in-range fix\n // exists (fixAvailable === true). Returns the blocked fix as\n // `{ version, before }`, or `false` when nothing is blocked.\n #fixBlockedByReleaseAge (vuln, spec) {\n const { before, minReleaseAgeExclude } = this.options\n // No window, or this package is explicitly exempt from it.\n if (!before || isReleaseAgeExcluded(vuln.name, minReleaseAgeExclude)) {\n return false\n }\n\n // For `npm:` aliases the fix resolves against the alias target, so feed\n // pickManifest the underlying range rather than the alias spec (which it\n // rejects). Mirrors `#fixAvailable`.\n const specObj = npa(spec)\n if (specObj.subSpec) {\n spec = specObj.subSpec.rawSpec\n }\n\n // The version that would be installed if the window were lifted.\n const { version } = pickManifest(vuln.packument, spec, {\n ...this.options,\n before: null,\n avoid: vuln.range,\n })\n\n // What resolution can actually reach within the window. This mirrors how\n // `build-ideal-tree` re-resolves the edge (non-strict avoid + `before`).\n let windowed\n try {\n windowed = pickManifest(vuln.packument, spec, {\n ...this.options,\n avoid: vuln.range,\n })\n } catch {\n // Nothing is old enough to install at all: the fix is blocked.\n return { version, before }\n }\n\n // `_shouldAvoid` means the best version available within the window is still\n // in the vulnerable range, so the only non-vulnerable fix is too new.\n return windowed._shouldAvoid ? { version, before } : false\n }\n\n set () {\n throw new Error('do not call AuditReport.set() directly')\n }\n\n async #getReport () {\n // if we're not auditing, just return false\n if (this.options.audit === false || this.options.offline === true || this.tree.inventory.size === 1) {\n return null\n }\n\n const timeEnd = time.start('auditReport:getReport')\n try {\n const body = this.prepareBulkData()\n log.silly('audit', 'bulk request', body)\n\n // no sense asking if we don't have anything to audit,\n // we know it'll be empty\n if (!Object.keys(body).length) {\n return null\n }\n\n const res = await npmFetch('/-/npm/v1/security/advisories/bulk', {\n ...this.options,\n registry: this.options.auditRegistry || this.options.registry,\n method: 'POST',\n gzip: true,\n body,\n })\n\n return await res.json()\n } catch (er) {\n log.verbose('audit error', er)\n log.silly('audit error', String(er.body))\n this.error = er\n return null\n } finally {\n timeEnd()\n }\n }\n\n // return true if we should audit this one\n shouldAudit (node) {\n if (\n !node.version ||\n node.isRoot ||\n node.isLink ||\n node.linksIn?.size > 0 ||\n (this.filterSet && this.filterSet?.size !== 0 && !this.filterSet?.has(node))\n ) {\n return false\n }\n if (this.#omit.size === 0) {\n return true\n }\n return !node.shouldOmit(this.#omit)\n }\n\n prepareBulkData () {\n const payload = {}\n for (const name of this.tree.inventory.query('packageName')) {\n const set = new Set()\n for (const node of this.tree.inventory.query('packageName', name)) {\n if (!this.shouldAudit(node)) {\n continue\n }\n\n set.add(node.version)\n }\n if (set.size) {\n payload[name] = [...set]\n }\n }\n return payload\n }\n}\n\nmodule.exports = AuditReport\n","const { relative } = require('node:path')\nconst relpath = (from, to) => relative(from, to).replace(/\\\\/g, '/')\nmodule.exports = relpath\n","const { LRUCache } = require('lru-cache')\nconst { getHeapStatistics } = require('node:v8')\nconst { log } = require('proc-log')\n\n// This is an in-memory cache that Pacote uses for packuments.\n// Packuments are usually cached on disk. This allows for rapid re-requests\n// of the same packument to bypass disk reads. The tradeoff here is memory\n// usage for disk reads.\nclass PackumentCache extends LRUCache {\n static #heapLimit = Math.floor(getHeapStatistics().heap_size_limit)\n\n #sizeKey\n #disposed = new Set()\n\n #log (...args) {\n log.silly('packumentCache', ...args)\n }\n\n constructor ({\n // How much of this.#heapLimit to take up\n heapFactor = 0.25,\n // How much of this.#maxSize we allow any one packument to take up\n // Anything over this is not cached\n maxEntryFactor = 0.5,\n sizeKey = '_contentLength',\n } = {}) {\n const maxSize = Math.floor(PackumentCache.#heapLimit * heapFactor)\n const maxEntrySize = Math.floor(maxSize * maxEntryFactor)\n super({\n maxSize,\n maxEntrySize,\n sizeCalculation: (p) => {\n // Don't cache if we don't know the size\n // Some versions of pacote set this to `0`, newer versions set it to `null`\n if (!p[sizeKey]) {\n return maxEntrySize + 1\n }\n if (p[sizeKey] < 10_000) {\n return p[sizeKey] * 2\n }\n if (p[sizeKey] < 1_000_000) {\n return Math.floor(p[sizeKey] * 1.5)\n }\n // It is less beneficial to store a small amount of super large things\n // at the cost of all other packuments.\n return maxEntrySize + 1\n },\n dispose: (v, k) => {\n this.#disposed.add(k)\n this.#log(k, 'dispose')\n },\n })\n this.#sizeKey = sizeKey\n this.#log(`heap:${PackumentCache.#heapLimit} maxSize:${maxSize} maxEntrySize:${maxEntrySize}`)\n }\n\n set (k, v, ...args) {\n // we use disposed only for a logging signal if we are setting packuments that\n // have already been evicted from the cache previously. logging here could help\n // us tune this in the future.\n const disposed = this.#disposed.has(k)\n /* istanbul ignore next - this doesnt happen consistently so hard to test without resorting to unit tests */\n if (disposed) {\n this.#disposed.delete(k)\n }\n this.#log(k, 'set', `size:${v[this.#sizeKey]} disposed:${disposed}`)\n return super.set(k, v, ...args)\n }\n\n has (k, ...args) {\n const has = super.has(k, ...args)\n this.#log(k, `cache-${has ? 'hit' : 'miss'}`)\n return has\n }\n}\n\nmodule.exports = PackumentCache\n","const EE = require('events')\nconst onProgress = Symbol('onProgress')\nconst bars = Symbol('bars')\nconst listener = Symbol('listener')\nconst normData = Symbol('normData')\nclass Client extends EE {\n constructor ({ normalize = false, stopOnDone = false } = {}) {\n super()\n this.normalize = !!normalize\n this.stopOnDone = !!stopOnDone\n this[bars] = new Map()\n this[listener] = null\n }\n\n get size () {\n return this[bars].size\n }\n\n get listening () {\n return !!this[listener]\n }\n\n addListener (...args) {\n return this.on(...args)\n }\n\n on (ev, ...args) {\n if (ev === 'progress' && !this[listener]) {\n this.start()\n }\n return super.on(ev, ...args)\n }\n\n off (ev, ...args) {\n return this.removeListener(ev, ...args)\n }\n\n removeListener (ev, ...args) {\n const ret = super.removeListener(ev, ...args)\n if (ev === 'progress' && this.listeners(ev).length === 0) {\n this.stop()\n }\n return ret\n }\n\n stop () {\n if (this[listener]) {\n process.removeListener('progress', this[listener])\n this[listener] = null\n }\n }\n\n start () {\n if (!this[listener]) {\n this[listener] = (...args) => this[onProgress](...args)\n process.on('progress', this[listener])\n }\n }\n\n [onProgress] (key, data) {\n data = this[normData](key, data)\n if (!this[bars].has(key)) {\n this.emit('bar', key, data)\n }\n this[bars].set(key, data)\n this.emit('progress', key, data)\n if (data.done) {\n this[bars].delete(key)\n this.emit('barDone', key, data)\n if (this.size === 0) {\n if (this.stopOnDone) {\n this.stop()\n }\n this.emit('done')\n }\n }\n }\n\n [normData] (key, data) {\n const actualValue = data.value\n const actualTotal = data.total\n let value = actualValue\n let total = actualTotal\n const done = data.done || value >= total\n if (this.normalize) {\n const bar = this[bars].get(key)\n total = 100\n if (done) {\n value = 100\n } else {\n // show value as a portion of 100\n const pct = 100 * actualValue / actualTotal\n if (bar) {\n // don't ever go backwards, and don't stand still\n // move at least 1% of the remaining value if it wouldn't move.\n value = (pct > bar.value) ? pct\n : (100 - bar.value) / 100 + bar.value\n }\n }\n }\n // include the key\n return {\n ...data,\n key,\n name: data.name || key,\n value,\n total,\n actualValue,\n actualTotal,\n done,\n }\n }\n}\nmodule.exports = Client\n","// The tracker class is intentionally as naive as possible. it is just\n// an ergonomic wrapper around process.emit('progress', ...)\nconst EE = require('events')\nclass Tracker extends EE {\n constructor (name, key, total) {\n super()\n if (!name) {\n throw new Error('proggy: Tracker needs a name')\n }\n\n if (typeof key === 'number' && !total) {\n total = key\n key = null\n }\n\n if (!total) {\n total = 100\n }\n\n if (!key) {\n key = name\n }\n\n this.done = false\n this.name = name\n this.key = key\n this.value = 0\n this.total = total\n }\n\n finish (metadata = {}) {\n this.update(this.total, this.total, metadata)\n }\n\n update (value, total, metadata) {\n if (!metadata) {\n if (total && typeof total === 'object') {\n metadata = total\n } else {\n metadata = {}\n }\n }\n if (typeof total !== 'number') {\n total = this.total\n }\n\n if (this.done) {\n const msg = `proggy: updating completed tracker: ${JSON.stringify(this.key)}`\n throw new Error(msg)\n }\n this.value = value\n this.total = total\n const done = this.value >= this.total\n process.emit('progress', this.key, {\n ...metadata,\n name: this.name,\n key: this.key,\n value,\n total,\n done,\n })\n if (done) {\n this.done = true\n this.emit('done')\n }\n }\n}\nmodule.exports = Tracker\n","exports.Client = require('./client.js')\nexports.Tracker = require('./tracker.js')\n\nconst trackers = new Map()\nexports.createTracker = (name, key, total) => {\n const tracker = new exports.Tracker(name, key, total)\n if (trackers.has(tracker.key)) {\n const msg = `proggy: duplicate progress id ${JSON.stringify(tracker.key)}`\n throw new Error(msg)\n }\n trackers.set(tracker.key, tracker)\n tracker.on('done', () => trackers.delete(tracker.key))\n return tracker\n}\nexports.createClient = (options = {}) => new exports.Client(options)\n","const proggy = require('proggy')\n\nmodule.exports = cls => class Tracker extends cls {\n #progress = new Map()\n\n #createTracker (key, name) {\n const tracker = new proggy.Tracker(name ?? key)\n tracker.on('done', () => this.#progress.delete(key))\n this.#progress.set(key, tracker)\n }\n\n addTracker (section, subsection = null, key = null) {\n if (section === null || section === undefined) {\n this.#onError(`Tracker can't be null or undefined`)\n }\n\n if (key === null) {\n key = subsection\n }\n\n const hasTracker = this.#progress.has(section)\n const hasSubtracker = this.#progress.has(`${section}:${key}`)\n\n if (hasTracker && subsection === null) {\n // 0. existing tracker, no subsection\n this.#onError(`Tracker \"${section}\" already exists`)\n } else if (!hasTracker && subsection === null) {\n // 1. no existing tracker, no subsection\n // Create a new progress tracker\n this.#createTracker(section)\n } else if (!hasTracker && subsection !== null) {\n // 2. no parent tracker and subsection\n this.#onError(`Parent tracker \"${section}\" does not exist`)\n } else if (!hasTracker || !hasSubtracker) {\n // 3. existing parent tracker, no subsection tracker\n // Create a new subtracker and update parents\n const parentTracker = this.#progress.get(section)\n parentTracker.update(parentTracker.value, parentTracker.total + 1)\n this.#createTracker(`${section}:${key}`, `${section}:${subsection}`)\n }\n // 4. existing parent tracker, existing subsection tracker\n // skip it\n }\n\n finishTracker (section, subsection = null, key = null) {\n if (section === null || section === undefined) {\n this.#onError(`Tracker can't be null or undefined`)\n }\n\n if (key === null) {\n key = subsection\n }\n\n const hasTracker = this.#progress.has(section)\n const hasSubtracker = this.#progress.has(`${section}:${key}`)\n\n // 0. parent tracker exists, no subsection\n // Finish parent tracker and remove from this.#progress\n if (hasTracker && subsection === null) {\n // check if parent tracker does\n // not have any remaining children\n const keys = this.#progress.keys()\n for (const key of keys) {\n if (key.match(new RegExp(section + ':'))) {\n this.finishTracker(section, key)\n }\n }\n // remove parent tracker\n this.#progress.get(section).finish()\n } else if (!hasTracker && subsection === null) {\n // 1. no existing parent tracker, no subsection\n this.#onError(`Tracker \"${section}\" does not exist`)\n } else if (!hasTracker || hasSubtracker) {\n // 2. subtracker exists\n // Finish subtracker and remove from this.#progress\n const parentTracker = this.#progress.get(section)\n parentTracker.update(parentTracker.value + 1)\n this.#progress.get(`${section}:${key}`).finish()\n }\n // 3. existing parent tracker, no subsection\n }\n\n #onError (msg) {\n throw new Error(msg)\n }\n}\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.callLimit = void 0;\nconst os = __importStar(require(\"node:os\"));\n// availableParallelism available only since node v19, for older versions use\n// cpus() cpus() can return an empty list if /proc is not mounted, use 1 in\n// this case\n/* c8 ignore start */\nconst defLimit = 'availableParallelism' in os ?\n Math.max(1, os.availableParallelism() - 1)\n : Math.max(1, os.cpus().length - 1);\nconst callLimit = (queue, { limit = defLimit, rejectLate } = {}) => new Promise((res, rej) => {\n let active = 0;\n let current = 0;\n const results = [];\n // Whether or not we rejected, distinct from the rejection just in case the rejection itself is falsey\n let rejected = false;\n let rejection;\n const reject = (er) => {\n if (rejected)\n return;\n rejected = true;\n rejection ??= er;\n if (!rejectLate)\n rej(rejection);\n };\n let resolved = false;\n const resolve = () => {\n if (resolved || active > 0)\n return;\n resolved = true;\n res(results);\n };\n const run = () => {\n const c = current++;\n if (c >= queue.length)\n return rejected ? reject() : resolve();\n active++;\n const step = queue[c];\n /* c8 ignore start */\n if (!step)\n throw new Error('walked off queue');\n /* c8 ignore stop */\n results[c] = step()\n .then(result => {\n active--;\n results[c] = result;\n return result;\n }, er => {\n active--;\n reject(er);\n })\n .then(result => {\n if (rejected && active === 0)\n return rej(rejection);\n run();\n return result;\n });\n };\n for (let i = 0; i < limit; i++)\n run();\n});\nexports.callLimit = callLimit;\n//# sourceMappingURL=index.js.map","// look up the realpath, but cache stats to minimize overhead\n// If the parent folder is in the realpath cache, then we just\n// lstat the child, since there's no need to do a full realpath\n// This is not a separate module, and is much simpler than Node's\n// built-in fs.realpath, because we only care about symbolic links,\n// so we can handle many fewer edge cases.\n\nconst { lstat, readlink } = require('node:fs/promises')\nconst { resolve, basename, dirname } = require('node:path')\n\nconst realpathCached = (path, rpcache, stcache, depth) => {\n // just a safety against extremely deep eloops\n /* istanbul ignore next */\n if (depth > 2000) {\n throw eloop(path)\n }\n\n path = resolve(path)\n if (rpcache.has(path)) {\n return Promise.resolve(rpcache.get(path))\n }\n\n const dir = dirname(path)\n const base = basename(path)\n\n if (base && rpcache.has(dir)) {\n return realpathChild(dir, base, rpcache, stcache, depth)\n }\n\n // if it's the root, then we know it's real\n if (!base) {\n rpcache.set(dir, dir)\n return Promise.resolve(dir)\n }\n\n // the parent, what is that?\n // find out, and then come back.\n return realpathCached(dir, rpcache, stcache, depth + 1).then(() =>\n realpathCached(path, rpcache, stcache, depth + 1))\n}\n\nconst lstatCached = (path, stcache) => {\n if (stcache.has(path)) {\n return Promise.resolve(stcache.get(path))\n }\n\n const p = lstat(path).then(st => {\n stcache.set(path, st)\n return st\n })\n stcache.set(path, p)\n return p\n}\n\n// This is a slight fib, as it doesn't actually occur during a stat syscall.\n// But file systems are giant piles of lies, so whatever.\nconst eloop = path =>\n Object.assign(new Error(\n `ELOOP: too many symbolic links encountered, stat '${path}'`), {\n errno: -62,\n syscall: 'stat',\n code: 'ELOOP',\n path: path,\n })\n\nconst realpathChild = (dir, base, rpcache, stcache, depth) => {\n const realdir = rpcache.get(dir)\n // that unpossible\n /* istanbul ignore next */\n if (typeof realdir === 'undefined') {\n throw new Error('in realpathChild without parent being in realpath cache')\n }\n\n const realish = resolve(realdir, base)\n return lstatCached(realish, stcache).then(st => {\n if (!st.isSymbolicLink()) {\n rpcache.set(resolve(dir, base), realish)\n return realish\n }\n\n return readlink(realish).then(target => {\n const resolved = resolve(realdir, target)\n if (realish === resolved) {\n throw eloop(realish)\n }\n\n return realpathCached(resolved, rpcache, stcache, depth + 1)\n }).then(real => {\n rpcache.set(resolve(dir, base), real)\n return real\n })\n })\n}\n\nmodule.exports = realpathCached\n","// certain assertions we should do only when testing arborist itself, because\n// they are too expensive or aggressive and would break user programs if we\n// miss a situation where they are actually valid.\n//\n// call like this:\n//\n// /* istanbul ignore next - debug check */\n// debug(() => {\n// if (someExpensiveCheck)\n// throw new Error('expensive check should have returned false')\n// })\n\n// run in debug mode if explicitly requested, running arborist tests,\n// or working in the arborist project directory.\n\nconst debug = process.env.ARBORIST_DEBUG !== '0' && (\n process.env.ARBORIST_DEBUG === '1' ||\n /\\barborist\\b/.test(process.env.NODE_DEBUG || '') ||\n process.env.npm_package_name === '@npmcli/arborist' &&\n ['test', 'snap'].includes(process.env.npm_lifecycle_event) ||\n process.cwd() === require('node:path').resolve(__dirname, '..')\n)\n\nmodule.exports = debug ? fn => fn() : () => {}\nconst red = process.stderr.isTTY ? msg => `\\x1B[31m${msg}\\x1B[39m` : m => m\nmodule.exports.log = (...msg) => module.exports(() => {\n const { format } = require('node:util')\n const prefix = `\\n${process.pid} ${red(format(msg.shift()))} `\n msg = (prefix + format(...msg).trim().split('\\n').join(prefix)).trim()\n /* eslint-disable-next-line no-console */\n console.error(msg)\n})\n","const debug = require('./debug.js')\n\nconst checkTree = (tree, checkUnreachable = true) => {\n const log = [['START TREE CHECK', tree.path]]\n\n // this can only happen in tests where we have a \"tree\" object\n // that isn't actually a tree.\n if (!tree.root || !tree.root.inventory) {\n return tree\n }\n\n const { inventory } = tree.root\n const seen = new Set()\n const check = (node, via = tree, viaType = 'self') => {\n log.push([\n 'CHECK',\n node && node.location,\n via && via.location,\n viaType,\n 'seen=' + seen.has(node),\n 'promise=' + !!(node && node.then),\n 'root=' + !!(node && node.isRoot),\n ])\n\n if (!node || seen.has(node) || node.then) {\n return\n }\n\n seen.add(node)\n\n if (node.isRoot && node !== tree.root) {\n throw Object.assign(new Error('double root'), {\n node: node.path,\n realpath: node.realpath,\n tree: tree.path,\n root: tree.root.path,\n via: via.path,\n viaType,\n log,\n })\n }\n\n if (node.root !== tree.root) {\n throw Object.assign(new Error('node from other root in tree'), {\n node: node.path,\n realpath: node.realpath,\n tree: tree.path,\n root: tree.root.path,\n via: via.path,\n viaType,\n otherRoot: node.root && node.root.path,\n log,\n })\n }\n\n if (!node.isRoot && node.inventory.size !== 0) {\n throw Object.assign(new Error('non-root has non-zero inventory'), {\n node: node.path,\n tree: tree.path,\n root: tree.root.path,\n via: via.path,\n viaType,\n inventory: [...node.inventory.values()].map(node =>\n [node.path, node.location]),\n log,\n })\n }\n\n if (!node.isRoot && !inventory.has(node) && !node.dummy) {\n throw Object.assign(new Error('not in inventory'), {\n node: node.path,\n tree: tree.path,\n root: tree.root.path,\n via: via.path,\n viaType,\n log,\n })\n }\n\n const devEdges = [...node.edgesOut.values()].filter(e => e.dev)\n if (!node.isTop && devEdges.length) {\n throw Object.assign(new Error('dev edges on non-top node'), {\n node: node.path,\n tree: tree.path,\n root: tree.root.path,\n via: via.path,\n viaType,\n devEdges: devEdges.map(e => [e.type, e.name, e.spec, e.error]),\n log,\n })\n }\n\n if (node.path === tree.root.path && node !== tree.root && !tree.root.isLink) {\n throw Object.assign(new Error('node with same path as root'), {\n node: node.path,\n tree: tree.path,\n root: tree.root.path,\n via: via.path,\n viaType,\n log,\n })\n }\n\n if (!node.isLink && node.path !== node.realpath) {\n throw Object.assign(new Error('non-link with mismatched path/realpath'), {\n node: node.path,\n tree: tree.path,\n realpath: node.realpath,\n root: tree.root.path,\n via: via.path,\n viaType,\n log,\n })\n }\n\n const { parent, fsParent, target } = node\n check(parent, node, 'parent')\n check(fsParent, node, 'fsParent')\n check(target, node, 'target')\n log.push(['CHILDREN', node.location, ...node.children.keys()])\n for (const kid of node.children.values()) {\n check(kid, node, 'children')\n }\n for (const kid of node.fsChildren) {\n check(kid, node, 'fsChildren')\n }\n for (const link of node.linksIn) {\n check(link, node, 'linksIn')\n }\n for (const top of node.tops) {\n check(top, node, 'tops')\n }\n log.push(['DONE', node.location])\n }\n check(tree)\n if (checkUnreachable) {\n for (const node of inventory.values()) {\n if (!seen.has(node) && node !== tree.root) {\n throw Object.assign(new Error('unreachable in inventory'), {\n node: node.path,\n realpath: node.realpath,\n location: node.location,\n root: tree.root.path,\n tree: tree.path,\n log,\n })\n }\n }\n }\n return tree\n}\n\n// should only ever run this check in debug mode\nmodule.exports = tree => tree\ndebug(() => module.exports = checkTree)\n","// Given a node in a tree, return all of the peer dependency sets that\n// it is a part of, with the entry (top or non-peer) edges into the sets\n// identified.\n//\n// With this information, we can determine whether it is appropriate to\n// replace the entire peer set with another (and remove the old one),\n// push the set deeper into the tree, and so on.\n//\n// Returns a Map of { edge => Set(peerNodes) },\n\nconst peerEntrySets = node => {\n // this is the union of all peer groups that the node is a part of\n // later, we identify all of the entry edges, and create a set of\n // 1 or more overlapping sets that this node is a part of.\n const unionSet = new Set([node])\n for (const node of unionSet) {\n for (const edge of node.edgesOut.values()) {\n if (edge.valid && edge.peer && edge.to) {\n unionSet.add(edge.to)\n }\n }\n for (const edge of node.edgesIn) {\n if (edge.valid && edge.peer) {\n unionSet.add(edge.from)\n }\n }\n }\n const entrySets = new Map()\n for (const peer of unionSet) {\n for (const edge of peer.edgesIn) {\n // if not valid, it doesn't matter anyway. either it's been previously\n // peerConflicted, or it's the thing we're interested in replacing.\n if (!edge.valid) {\n continue\n }\n // this is the entry point into the peer set\n if (!edge.peer || edge.from.isTop) {\n // get the subset of peer brought in by this peer entry edge\n const sub = new Set([peer])\n for (const peer of sub) {\n for (const edge of peer.edgesOut.values()) {\n if (edge.valid && edge.peer && edge.to) {\n sub.add(edge.to)\n }\n }\n }\n // if this subset does not include the node we are focused on,\n // then it is not relevant for our purposes. Example:\n //\n // a -> (b, c, d)\n // b -> PEER(d) b -> d -> e -> f <-> g\n // c -> PEER(f, h) c -> (f <-> g, h -> g)\n // d -> PEER(e) d -> e -> f <-> g\n // e -> PEER(f)\n // f -> PEER(g)\n // g -> PEER(f)\n // h -> PEER(g)\n //\n // The unionSet(e) will include c, but we don't actually care about\n // it. We only expanded to the edge of the peer nodes in order to\n // find the entry edges that caused the inclusion of peer sets\n // including (e), so we want:\n // Map{\n // Edge(a->b) => Set(b, d, e, f, g)\n // Edge(a->d) => Set(d, e, f, g)\n // }\n if (sub.has(node)) {\n entrySets.set(edge, sub)\n }\n }\n }\n }\n\n return entrySets\n}\n\nmodule.exports = peerEntrySets\n","// given a starting node, what is the *deepest* target where name could go?\n// This is not on the Node class for the simple reason that we sometimes\n// need to check the deepest *potential* target for a Node that is not yet\n// added to the tree where we are checking.\nconst deepestNestingTarget = (start, name) => {\n for (const target of start.ancestry()) {\n // note: this will skip past the first target if edge is peer\n if (target.isProjectRoot || !target.resolveParent || target.globalTop) {\n return target\n }\n const targetEdge = target.edgesOut.get(name)\n if (!targetEdge || !targetEdge.peer) {\n return target\n }\n }\n}\n\nmodule.exports = deepestNestingTarget\n","// Internal methods used by buildIdealTree.\n// Answer the question: \"can I put this dep here?\"\n//\n// IMPORTANT: *nothing* in this class should *ever* modify or mutate the tree\n// at all. The contract here is strictly limited to read operations. We call\n// this in the process of walking through the ideal tree checking many\n// different potential placement targets for a given node. If a change is made\n// to the tree along the way, that can cause serious problems!\n//\n// In order to enforce this restriction, in debug mode, canPlaceDep() will\n// snapshot the tree at the start of the process, and then at the end, will\n// verify that it still matches the snapshot, and throw an error if any changes\n// occurred.\n//\n// The algorithm is roughly like this:\n// - check the node itself:\n// - if there is no version present, and no conflicting edges from target,\n// OK, provided all peers can be placed at or above the target.\n// - if the current version matches, KEEP\n// - if there is an older version present, which can be replaced, then\n// - if satisfying and preferDedupe? KEEP\n// - else: REPLACE\n// - if there is a newer version present, and preferDedupe, REPLACE\n// - if there is a newer vulnerable version present during an audit fix,\n// and the candidate is older and not vulnerable, REPLACE\n// - if the version present satisfies the edge, KEEP\n// - else: CONFLICT\n// - if the node is not in conflict, check each of its peers:\n// - if the peer can be placed in the target, continue\n// - else if the peer can be placed in a parent, and there is no other\n// conflicting version shadowing it, continue\n// - else CONFLICT\n// - If the peers are not in conflict, return the original node's value\n//\n// An exception to this logic is that if the target is the deepest location\n// that a node can be placed, and the conflicting node can be placed deeper,\n// then we will return REPLACE rather than CONFLICT, and Arborist will queue\n// the replaced node for resolution elsewhere.\n\nconst localeCompare = require('@isaacs/string-locale-compare')('en')\nconst semver = require('semver')\nconst debug = require('./debug.js')\nconst peerEntrySets = require('./peer-entry-sets.js')\nconst deepestNestingTarget = require('./deepest-nesting-target.js')\n\nconst CONFLICT = Symbol('CONFLICT')\nconst OK = Symbol('OK')\nconst REPLACE = Symbol('REPLACE')\nconst KEEP = Symbol('KEEP')\n\nclass CanPlaceDep {\n // dep is a dep that we're trying to place. it should already live in\n // a virtual tree where its peer set is loaded as children of the root.\n // target is the actual place where we're trying to place this dep\n // in a node_modules folder.\n // edge is the edge that we're trying to satisfy with this placement.\n // parent is the CanPlaceDep object of the entry node when placing a peer.\n constructor (options) {\n const {\n dep,\n target,\n edge,\n preferDedupe,\n parent = null,\n peerPath = [],\n explicitRequest = false,\n auditReport = null,\n } = options\n\n debug(() => {\n if (!dep) {\n throw new Error('no dep provided to CanPlaceDep')\n }\n\n if (!target) {\n throw new Error('no target provided to CanPlaceDep')\n }\n\n if (!edge) {\n throw new Error('no edge provided to CanPlaceDep')\n }\n\n this._treeSnapshot = JSON.stringify([...target.root.inventory.entries()]\n .map(([loc, { packageName, version, resolved }]) => {\n return [loc, packageName, version, resolved]\n }).sort(([a], [b]) => localeCompare(a, b)))\n })\n\n // the result of whether we can place it or not\n this.canPlace = null\n // if peers conflict, but this one doesn't, then that is useful info\n this.canPlaceSelf = null\n\n this.dep = dep\n this.target = target\n this.edge = edge\n this.explicitRequest = explicitRequest\n this.auditReport = auditReport\n\n // preventing cycles when we check peer sets\n this.peerPath = peerPath\n // we always prefer to dedupe peers, because they are trying\n // a bit harder to be singletons.\n this.preferDedupe = !!preferDedupe || edge.peer\n this.parent = parent\n this.children = []\n\n this.isSource = target === this.peerSetSource\n this.name = edge.name\n this.current = target.children.get(this.name)\n this.targetEdge = target.edgesOut.get(this.name)\n this.conflicts = new Map()\n\n // check if this dep was already subject to a peerDep override while\n // building the peerSet.\n this.edgeOverride = !dep.satisfies(edge)\n\n this.canPlace = this.checkCanPlace()\n if (!this.canPlaceSelf) {\n this.canPlaceSelf = this.canPlace\n }\n\n debug(() => {\n const treeSnapshot = JSON.stringify([...target.root.inventory.entries()]\n .map(([loc, { packageName, version, resolved }]) => {\n return [loc, packageName, version, resolved]\n }).sort(([a], [b]) => localeCompare(a, b)))\n /* istanbul ignore if */\n if (this._treeSnapshot !== treeSnapshot) {\n throw Object.assign(new Error('tree changed in CanPlaceDep'), {\n expect: this._treeSnapshot,\n actual: treeSnapshot,\n })\n }\n })\n }\n\n checkCanPlace () {\n const { target, targetEdge, current, dep } = this\n\n // if the dep failed to load, we're going to fail the build or\n // prune it out anyway, so just move forward placing/replacing it.\n if (dep.errors.length) {\n return current ? REPLACE : OK\n }\n\n // cannot place peers inside their dependents, except for tops\n if (targetEdge && targetEdge.peer && !target.isTop) {\n return CONFLICT\n }\n\n // skip this test if there's a current node, because we might be able\n // to dedupe against it anyway\n if (!current &&\n targetEdge &&\n !dep.satisfies(targetEdge) &&\n targetEdge !== this.edge) {\n return CONFLICT\n }\n\n return current ? this.checkCanPlaceCurrent() : this.checkCanPlaceNoCurrent()\n }\n\n // we know that the target has a dep by this name in its node_modules\n // already. Can return KEEP, REPLACE, or CONFLICT.\n checkCanPlaceCurrent () {\n const { preferDedupe, explicitRequest, current, target, edge, dep } = this\n\n if (dep.matches(current)) {\n if (current.satisfies(edge) || this.edgeOverride) {\n return explicitRequest ? REPLACE : KEEP\n }\n }\n\n const { version: curVer } = current\n const { version: newVer } = dep\n // Audit fix may select an older safe version within the declared range.\n // This only makes the candidate eligible; canReplace() and peer checks\n // below still enforce placement compatibility.\n const auditFixDowngrade = curVer && newVer &&\n semver.lt(newVer, curVer) &&\n this.auditReport?.isVulnerable(current) &&\n !this.auditReport.isVulnerable(dep)\n const tryReplace = curVer && newVer &&\n (semver.gte(newVer, curVer) || auditFixDowngrade)\n if (tryReplace && dep.canReplace(current)) {\n // It's extremely rare that a replaceable node would be a conflict, if\n // the current one wasn't a conflict, but it is theoretically possible\n // if peer deps are pinned. In that case we treat it like any other\n // conflict, and keep trying.\n const cpp = this.canPlacePeers(REPLACE)\n if (cpp !== CONFLICT) {\n return cpp\n }\n }\n\n // ok, can't replace the current with new one, but maybe current is ok?\n if (current.satisfies(edge) && (!explicitRequest || preferDedupe)) {\n return KEEP\n }\n\n // if we prefer deduping, then try replacing newer with older\n if (preferDedupe && !tryReplace && dep.canReplace(current)) {\n const cpp = this.canPlacePeers(REPLACE)\n if (cpp !== CONFLICT) {\n return cpp\n }\n }\n\n // Check for interesting cases!\n // First, is this the deepest place that this thing can go, and NOT the\n // deepest place where the conflicting dep can go? If so, replace it,\n // and let it re-resolve deeper in the tree.\n const myDeepest = this.deepestNestingTarget\n\n // ok, i COULD be placed deeper, so leave the current one alone.\n if (target !== myDeepest) {\n return CONFLICT\n }\n\n // if we are not checking a peerDep, then we MUST place it here, in the\n // target that has a non-peer dep on it.\n if (!edge.peer && target === edge.from) {\n return this.canPlacePeers(REPLACE)\n }\n\n // if we aren't placing a peer in a set, then we're done here.\n // This is ignored because it SHOULD be redundant, as far as I can tell,\n // with the deepest target and target===edge.from tests. But until we\n // can prove that isn't possible, this condition is here for safety.\n /* istanbul ignore if - allegedly impossible */\n if (!this.parent && !edge.peer) {\n return CONFLICT\n }\n\n // check the deps in the peer group for each edge into that peer group\n // if ALL of them can be pushed deeper, or if it's ok to replace its\n // members with the contents of the new peer group, then we're good.\n let canReplace = true\n for (const [entryEdge, currentPeers] of peerEntrySets(current)) {\n if (entryEdge === this.edge || entryEdge === this.peerEntryEdge) {\n continue\n }\n\n // First, see if it's ok to just replace the peerSet entirely.\n // we do this by walking out from the entryEdge, because in a case like\n // this:\n //\n // v -> PEER(a@1||2)\n // a@1 -> PEER(b@1)\n // a@2 -> PEER(b@2)\n // b@1 -> PEER(a@1)\n // b@2 -> PEER(a@2)\n //\n // root\n // +-- v\n // +-- a@2\n // +-- b@2\n //\n // Trying to place a peer group of (a@1, b@1) would fail to note that\n // they can be replaced, if we did it by looping 1 by 1. If we are\n // replacing something, we don't have to check its peer deps, because\n // the peerDeps in the placed peerSet will presumably satisfy.\n const entryNode = entryEdge.to\n const entryRep = dep.parent.children.get(entryNode.name)\n if (entryRep) {\n if (entryRep.canReplace(entryNode, dep.parent.children.keys())) {\n continue\n }\n }\n\n let canClobber = !entryRep\n if (!entryRep) {\n const peerReplacementWalk = new Set([entryNode])\n OUTER: for (const currentPeer of peerReplacementWalk) {\n for (const edge of currentPeer.edgesOut.values()) {\n if (!edge.peer || !edge.valid) {\n continue\n }\n const rep = dep.parent.children.get(edge.name)\n if (!rep) {\n if (edge.to) {\n peerReplacementWalk.add(edge.to)\n }\n continue\n }\n if (!rep.satisfies(edge)) {\n canClobber = false\n break OUTER\n }\n }\n }\n }\n if (canClobber) {\n continue\n }\n\n // ok, we can't replace, but maybe we can nest the current set deeper?\n let canNestCurrent = true\n for (const currentPeer of currentPeers) {\n if (!canNestCurrent) {\n break\n }\n\n // still possible to nest this peerSet\n const curDeep = deepestNestingTarget(entryEdge.from, currentPeer.name)\n if (curDeep === target || target.isDescendantOf(curDeep)) {\n canNestCurrent = false\n canReplace = false\n }\n if (canNestCurrent) {\n continue\n }\n }\n }\n\n // if we can nest or replace all the current peer groups, we can replace.\n if (canReplace) {\n return this.canPlacePeers(REPLACE)\n }\n\n return CONFLICT\n }\n\n checkCanPlaceNoCurrent () {\n const { target, peerEntryEdge, dep, name } = this\n\n // check to see what that name resolves to here, and who may depend on\n // being able to reach it by crawling up past the parent. we know\n // that it's not the target's direct child node, and if it was a direct\n // dep of the target, we would have conflicted earlier.\n const current = target !== peerEntryEdge.from && target.resolve(name)\n if (current) {\n for (const edge of current.edgesIn.values()) {\n if (edge.from.isDescendantOf(target) && edge.valid) {\n if (!dep.satisfies(edge)) {\n return CONFLICT\n }\n }\n }\n }\n\n // no objections, so this is fine as long as peers are ok here.\n return this.canPlacePeers(OK)\n }\n\n get deepestNestingTarget () {\n const start = this.parent ? this.parent.deepestNestingTarget\n : this.edge.from\n return deepestNestingTarget(start, this.name)\n }\n\n get conflictChildren () {\n return this.allChildren.filter(c => c.canPlace === CONFLICT)\n }\n\n get allChildren () {\n const set = new Set(this.children)\n for (const child of set) {\n for (const grandchild of child.children) {\n set.add(grandchild)\n }\n }\n return [...set]\n }\n\n get top () {\n return this.parent ? this.parent.top : this\n }\n\n // check if peers can go here. returns state or CONFLICT\n canPlacePeers (state) {\n this.canPlaceSelf = state\n if (this._canPlacePeers) {\n return this._canPlacePeers\n }\n\n // TODO: represent peerPath in ERESOLVE error somehow?\n const peerPath = [...this.peerPath, this.dep]\n let sawConflict = false\n for (const peerEdge of this.dep.edgesOut.values()) {\n if (!peerEdge.peer || !peerEdge.to || peerPath.includes(peerEdge.to)) {\n continue\n }\n const peer = peerEdge.to\n // it may be the case that the *initial* dep can be nested, but a peer\n // of that dep needs to be placed shallower, because the target has\n // a peer dep on the peer as well.\n const target = deepestNestingTarget(this.target, peer.name)\n const cpp = new CanPlaceDep({\n dep: peer,\n target,\n parent: this,\n edge: peerEdge,\n peerPath,\n auditReport: this.auditReport,\n // always place peers in preferDedupe mode\n preferDedupe: true,\n })\n /* istanbul ignore next */\n debug(() => {\n if (this.children.some(c => c.dep === cpp.dep)) {\n throw new Error('checking same dep repeatedly')\n }\n })\n this.children.push(cpp)\n\n if (cpp.canPlace === CONFLICT) {\n sawConflict = true\n }\n }\n\n this._canPlacePeers = sawConflict ? CONFLICT : state\n return this._canPlacePeers\n }\n\n // what is the node that is causing this peerSet to be placed?\n get peerSetSource () {\n return this.parent ? this.parent.peerSetSource : this.edge.from\n }\n\n get peerEntryEdge () {\n return this.top.edge\n }\n\n static get CONFLICT () {\n return CONFLICT\n }\n\n static get OK () {\n return OK\n }\n\n static get REPLACE () {\n return REPLACE\n }\n\n static get KEEP () {\n return KEEP\n }\n\n get description () {\n const { canPlace } = this\n return canPlace && canPlace.description ||\n /* istanbul ignore next - old node affordance */ canPlace\n }\n}\n\nmodule.exports = CanPlaceDep\n","const platform = process.env.__TESTING_BIN_LINKS_PLATFORM__ || process.platform\nmodule.exports = platform === 'win32'\n","// we know it's global and/or not top, so the path has to be\n// {prefix}/node_modules/{name}. Can't rely on pkg.name, because\n// it might be installed as an alias.\n\nconst { dirname, basename } = require('path')\n// this gets called a lot and can't change, so memoize it\nconst memo = new Map()\nmodule.exports = path => {\n if (memo.has(path)) {\n return memo.get(path)\n }\n\n const scopeOrNm = dirname(path)\n const nm = basename(scopeOrNm) === 'node_modules' ? scopeOrNm\n : dirname(scopeOrNm)\n\n memo.set(path, nm)\n return nm\n}\n","const { dirname } = require('path')\nconst getNodeModules = require('./get-node-modules.js')\nmodule.exports = path => dirname(getNodeModules(path))\n","const isWindows = require('./is-windows.js')\nconst getPrefix = require('./get-prefix.js')\nconst getNodeModules = require('./get-node-modules.js')\nconst { dirname } = require('path')\n\nmodule.exports = ({ top, path }) =>\n !top ? getNodeModules(path) + '/.bin'\n : isWindows ? getPrefix(path)\n : dirname(getPrefix(path)) + '/bin'\n","exports.replaceDollarWithPercentPair = replaceDollarWithPercentPair\r\nexports.convertToSetCommand = convertToSetCommand\r\nexports.convertToSetCommands = convertToSetCommands\r\n\r\nfunction convertToSetCommand (key, value) {\r\n var line = ''\r\n key = key || ''\r\n key = key.trim()\r\n value = value || ''\r\n value = value.trim()\r\n if (key && value && value.length > 0) {\r\n line = '@SET ' + key + '=' + replaceDollarWithPercentPair(value) + '\\r\\n'\r\n }\r\n return line\r\n}\r\n\r\nfunction extractVariableValuePairs (declarations) {\r\n var pairs = {}\r\n declarations.map(function (declaration) {\r\n var split = declaration.split('=')\r\n pairs[split[0]] = split[1]\r\n })\r\n return pairs\r\n}\r\n\r\nfunction convertToSetCommands (variableString) {\r\n var variableValuePairs = extractVariableValuePairs(variableString.split(' '))\r\n var variableDeclarationsAsBatch = ''\r\n Object.keys(variableValuePairs).forEach(function (key) {\r\n variableDeclarationsAsBatch += convertToSetCommand(key, variableValuePairs[key])\r\n })\r\n return variableDeclarationsAsBatch\r\n}\r\n\r\nfunction replaceDollarWithPercentPair (value) {\r\n var dollarExpressions = /\\$\\{?([^$@#?\\- \\t{}:]+)\\}?/g\r\n var result = ''\r\n var startIndex = 0\r\n do {\r\n var match = dollarExpressions.exec(value)\r\n if (match) {\r\n var betweenMatches = value.substring(startIndex, match.index) || ''\r\n result += betweenMatches + '%' + match[1] + '%'\r\n startIndex = dollarExpressions.lastIndex\r\n }\r\n } while (dollarExpressions.lastIndex > 0)\r\n result += value.slice(startIndex)\r\n return result\r\n}\r\n","// On windows, create a .cmd file.\n// Read the #! in the file to see what it uses. The vast majority\n// of the time, this will be either:\n// \"#!/usr/bin/env <prog> <args...>\"\n// or:\n// \"#!<prog> <args...>\"\n//\n// Write a binroot/pkg.bin + \".cmd\" file that has this line in it:\n// @<prog> <args...> %dp0%<target> %*\n\nconst {\n chmod,\n mkdir,\n readFile,\n stat,\n unlink,\n writeFile,\n} = require('fs/promises')\n\nconst { dirname, relative } = require('path')\nconst toBatchSyntax = require('./to-batch-syntax')\n// linting disabled because this regex is really long\n// eslint-disable-next-line max-len\nconst shebangExpr = /^#!\\s*(?:\\/usr\\/bin\\/env\\s+(?:-S\\s+)?((?:[^ \\t=]+=[^ \\t=]+\\s+)*))?([^ \\t]+)(.*)$/\n\nconst cmdShimIfExists = (from, to) =>\n stat(from).then(() => cmdShim(from, to), () => {})\n\n// Try to unlink, but ignore errors.\n// Any problems will surface later.\nconst rm = path => unlink(path).catch(() => {})\n\nconst cmdShim = (from, to) =>\n stat(from).then(() => cmdShim_(from, to))\n\nconst cmdShim_ = (from, to) => Promise.all([\n rm(to),\n rm(to + '.cmd'),\n rm(to + '.ps1'),\n]).then(() => writeShim(from, to))\n\nconst writeShim = (from, to) =>\n // make a cmd file and a sh script\n // First, check if the bin is a #! of some sort.\n // If not, then assume it's something that'll be compiled, or some other\n // sort of script, and just call it directly.\n mkdir(dirname(to), { recursive: true })\n .then(() => readFile(from, 'utf8'))\n .then(data => {\n const firstLine = data.trim().split(/\\r*\\n/)[0]\n const shebang = firstLine.match(shebangExpr)\n if (!shebang) {\n return writeShim_(from, to)\n }\n const vars = shebang[1] || ''\n const prog = shebang[2]\n const args = shebang[3] || ''\n return writeShim_(from, to, prog, args, vars)\n }, () => writeShim_(from, to))\n\nconst writeShim_ = (from, to, prog, args, variables) => {\n let shTarget = relative(dirname(to), from)\n shTarget = shTarget.split('\\\\').join('/')\n let target = shTarget.split('/').join('\\\\')\n let pwshTarget = shTarget\n let longProg\n let shProg = prog && prog.split('\\\\').join('/')\n let shLongProg\n let pwshProg = shProg && `\"${shProg}$exe\"`\n let pwshLongProg\n args = args || ''\n variables = variables || ''\n if (!prog) {\n prog = `\"%dp0%\\\\${target}\"`\n shProg = `\"$basedir/${shTarget}\"`\n pwshProg = shProg\n args = ''\n target = ''\n shTarget = ''\n pwshTarget = ''\n } else {\n longProg = `\"%dp0%\\\\${prog}.exe\"`\n shLongProg = `\"$basedir/${prog}\"`\n pwshLongProg = `\"$basedir/${prog}$exe\"`\n target = `\"%dp0%\\\\${target}\"`\n shTarget = `\"$basedir_win/${shTarget}\"`\n pwshTarget = `\"$basedir/${pwshTarget}\"`\n }\n\n // Subroutine trick to fix https://github.com/npm/cmd-shim/issues/10\n // and https://github.com/npm/cli/issues/969\n const head = '@ECHO off\\r\\n' +\n 'GOTO start\\r\\n' +\n ':find_dp0\\r\\n' +\n 'SET dp0=%~dp0\\r\\n' +\n 'EXIT /b\\r\\n' +\n ':start\\r\\n' +\n 'SETLOCAL\\r\\n' +\n 'CALL :find_dp0\\r\\n'\n\n let cmd\n if (longProg) {\n args = args.trim()\n const variablesBatch = toBatchSyntax.convertToSetCommands(variables)\n cmd = head\n + variablesBatch\n + '\\r\\n'\n + `IF EXIST ${longProg} (\\r\\n`\n + ` SET \"_prog=${longProg.replace(/(^\")|(\"$)/g, '')}\"\\r\\n`\n + ') ELSE (\\r\\n'\n + ` SET \"_prog=${prog.replace(/(^\")|(\"$)/g, '')}\"\\r\\n`\n + ')\\r\\n'\n + '\\r\\n'\n // prevent \"Terminate Batch Job? (Y/n)\" message\n // https://github.com/npm/cli/issues/969#issuecomment-737496588\n + 'endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & '\n + `set PATHEXT=%PATHEXT:;.JS;=;% & \"%_prog%\" ${args} ${target} %*\\r\\n`\n } else {\n cmd = `${head}${prog} ${args} ${target} %*\\r\\n`\n }\n\n // #!/bin/sh\n // basedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")\n // basedir_win=\"$basedir\"\n //\n // case `uname -a` in\n // *CYGWIN*|*MINGW*|*MSYS*)\n // if command -v cygpath > /dev/null 2>&1; then\n // basedir_win=`cygpath -w \"$basedir\"`\n // fi\n // ;;\n // *WSL2*)\n // if command -v wslpath > /dev/null 2>&1; then\n // basedir_win=\"$(wslpath -w \"$basedir\" 2> /dev/null)\"\n // if [ $? -ne 0 ] || [ -z \"$basedir_win\" ]; then\n // echo \"Error: wslpath failed to convert path. WSL environment may be misconfigured.\" >&2\n // exit 1\n // fi\n // fi\n // ;;\n // esac\n //\n // PROG_EXE=\"$basedir/node.exe\"\n // if ! [ -x \"$PROG_EXE\" ]; then\n // PROG_EXE=\"$basedir/node\"\n // if ! [ -x \"$PROG_EXE\" ]; then\n // PROG_EXE=node\n // if ! [ -x \"$PROG_EXE\" ]; then\n // PROG_EXE=node.exe\n // fi\n // fi\n // fi\n //\n // exec \"$PROG_EXE\" \"$basedir_win/node_modules/npm/bin/npm-cli.js\" \"$@\"\n\n let sh = '#!/bin/sh\\n'\n\n sh = sh\n + `basedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\\\\\,/,g')\")\\n`\n + 'basedir_win=\"$basedir\"\\n'\n + '\\n'\n + 'case `uname -a` in\\n'\n + ' *CYGWIN*|*MINGW*|*MSYS*)\\n'\n + ' if command -v cygpath > /dev/null 2>&1; then\\n'\n + ' basedir_win=`cygpath -w \"$basedir\"`\\n'\n + ' fi\\n'\n + ' ;;\\n'\n + ' *WSL2*)\\n'\n + ' if command -v wslpath > /dev/null 2>&1; then\\n'\n + ' basedir_win=\"$(wslpath -w \"$basedir\" 2> /dev/null)\"\\n'\n + ' if [ $? -ne 0 ] || [ -z \"$basedir_win\" ]; then\\n'\n + ' echo \"Error: wslpath failed to convert path. WSL environment may be misconfigured.\" >&2\\n'\n + ' exit 1\\n'\n + ' fi\\n'\n + ' fi\\n'\n + ' ;;\\n'\n + 'esac\\n'\n + '\\n'\n\n if (shLongProg) {\n sh = sh\n + `PROG_EXE=${shLongProg.replace(/\"$/, '.exe\"')}\\n`\n + 'if ! [ -x \"$PROG_EXE\" ]; then\\n'\n + ` PROG_EXE=${shLongProg}\\n`\n + ' if ! [ -x \"$PROG_EXE\" ]; then\\n'\n + ` PROG_EXE=${shProg}\\n`\n + ' if ! [ -x \"$PROG_EXE\" ]; then\\n'\n + ` PROG_EXE=${shProg}.exe\\n`\n + ' fi\\n'\n + ' fi\\n'\n + 'fi\\n'\n + '\\n'\n + `exec ${variables}\"$PROG_EXE\" ${args} ${shTarget} \"$@\"\\n`\n } else {\n sh = sh\n + `exec ${shProg} ${args} ${shTarget} \"$@\"\\n`\n }\n\n // #!/usr/bin/env pwsh\n // $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\n //\n // $ret=0\n // $exe = \"\"\n // if ($PSVersionTable.PSVersion -lt \"6.0\" -or $IsWindows) {\n // # Fix case when both the Windows and Linux builds of Node\n // # are installed in the same directory\n // $exe = \".exe\"\n // }\n // if (Test-Path \"$basedir/node\") {\n // # Suport pipeline input\n // if ($MyInvocation.ExpectingInput) {\n // input | & \"$basedir/node$exe\" \"$basedir/node_modules/npm/bin/npm-cli.js\" $args\n // } else {\n // & \"$basedir/node$exe\" \"$basedir/node_modules/npm/bin/npm-cli.js\" $args\n // }\n // $ret=$LASTEXITCODE\n // } else {\n // # Support pipeline input\n // if ($MyInvocation.ExpectingInput) {\n // $input | & \"node$exe\" \"$basedir/node_modules/npm/bin/npm-cli.js\" $args\n // } else {\n // & \"node$exe\" \"$basedir/node_modules/npm/bin/npm-cli.js\" $args\n // }\n // $ret=$LASTEXITCODE\n // }\n // exit $ret\n let pwsh = '#!/usr/bin/env pwsh\\n'\n + '$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\\n'\n + '\\n'\n + '$exe=\"\"\\n'\n + 'if ($PSVersionTable.PSVersion -lt \"6.0\" -or $IsWindows) {\\n'\n + ' # Fix case when both the Windows and Linux builds of Node\\n'\n + ' # are installed in the same directory\\n'\n + ' $exe=\".exe\"\\n'\n + '}\\n'\n if (pwshLongProg) {\n pwsh = pwsh\n + '$ret=0\\n'\n + `if (Test-Path ${pwshLongProg}) {\\n`\n + ' # Support pipeline input\\n'\n + ' if ($MyInvocation.ExpectingInput) {\\n'\n + ` $input | & ${pwshLongProg} ${args} ${pwshTarget} $args\\n`\n + ' } else {\\n'\n + ` & ${pwshLongProg} ${args} ${pwshTarget} $args\\n`\n + ' }\\n'\n + ' $ret=$LASTEXITCODE\\n'\n + '} else {\\n'\n + ' # Support pipeline input\\n'\n + ' if ($MyInvocation.ExpectingInput) {\\n'\n + ` $input | & ${pwshProg} ${args} ${pwshTarget} $args\\n`\n + ' } else {\\n'\n + ` & ${pwshProg} ${args} ${pwshTarget} $args\\n`\n + ' }\\n'\n + ' $ret=$LASTEXITCODE\\n'\n + '}\\n'\n + 'exit $ret\\n'\n } else {\n pwsh = pwsh\n + '# Support pipeline input\\n'\n + 'if ($MyInvocation.ExpectingInput) {\\n'\n + ` $input | & ${pwshProg} ${args} ${pwshTarget} $args\\n`\n + '} else {\\n'\n + ` & ${pwshProg} ${args} ${pwshTarget} $args\\n`\n + '}\\n'\n + 'exit $LASTEXITCODE\\n'\n }\n\n return Promise.all([\n writeFile(to + '.ps1', pwsh, 'utf8'),\n writeFile(to + '.cmd', cmd, 'utf8'),\n writeFile(to, sh, 'utf8'),\n ]).then(() => chmodShim(to))\n}\n\nconst chmodShim = to => Promise.all([\n chmod(to, 0o755),\n chmod(to + '.cmd', 0o755),\n chmod(to + '.ps1', 0o755),\n])\n\nmodule.exports = cmdShim\ncmdShim.ifExists = cmdShimIfExists\n","const fs = require('fs')\nconst { promisify } = require('util')\nconst { readFileSync } = fs\nconst readFile = promisify(fs.readFile)\n\nconst extractPath = (path, cmdshimContents) => {\n if (/[.]cmd$/.test(path)) {\n return extractPathFromCmd(cmdshimContents)\n } else if (/[.]ps1$/.test(path)) {\n return extractPathFromPowershell(cmdshimContents)\n } else {\n return extractPathFromCygwin(cmdshimContents)\n }\n}\n\nconst extractPathFromPowershell = cmdshimContents => {\n const matches = cmdshimContents.match(/\"[$]basedir[/]([^\"]+?)\"\\s+[$]args/)\n return matches && matches[1]\n}\n\nconst extractPathFromCmd = cmdshimContents => {\n const matches = cmdshimContents.match(/\"%(?:~dp0|dp0%)\\\\([^\"]+?)\"\\s+%[*]/)\n return matches && matches[1]\n}\n\nconst extractPathFromCygwin = cmdshimContents => {\n const matches = cmdshimContents.match(/\"[$]basedir[/]([^\"]+?)\"\\s+\"[$]@\"/)\n return matches && matches[1]\n}\n\nconst wrapError = (thrown, newError) => {\n newError.message = thrown.message\n newError.code = thrown.code\n newError.path = thrown.path\n return newError\n}\n\nconst notaShim = (path, er) => {\n if (!er) {\n er = new Error()\n Error.captureStackTrace(er, notaShim)\n }\n er.code = 'ENOTASHIM'\n er.message = `Can't read shim path from '${path}', ` +\n `it doesn't appear to be a cmd-shim`\n return er\n}\n\nconst readCmdShim = path => {\n // create a new error to capture the stack trace from this point,\n // instead of getting some opaque stack into node's internals\n const er = new Error()\n Error.captureStackTrace(er, readCmdShim)\n return readFile(path).then(contents => {\n const destination = extractPath(path, contents.toString())\n if (destination) {\n return destination\n }\n throw notaShim(path, er)\n }, readFileEr => {\n throw wrapError(readFileEr, er)\n })\n}\n\nconst readCmdShimSync = path => {\n const contents = readFileSync(path)\n const destination = extractPath(path, contents.toString())\n if (!destination) {\n throw notaShim(path)\n }\n return destination\n}\n\nreadCmdShim.sync = readCmdShimSync\nmodule.exports = readCmdShim\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.signals = void 0;\n/**\n * This is not the set of all possible signals.\n *\n * It IS, however, the set of all signals that trigger\n * an exit on either Linux or BSD systems. Linux is a\n * superset of the signal names supported on BSD, and\n * the unknown signals just fail to register, so we can\n * catch that easily enough.\n *\n * Windows signals are a different set, since there are\n * signals that terminate Windows processes, but don't\n * terminate (or don't even exist) on Posix systems.\n *\n * Don't bother with SIGKILL. It's uncatchable, which\n * means that we can't fire any callbacks anyway.\n *\n * If a user does happen to register a handler on a non-\n * fatal signal like SIGWINCH or something, and then\n * exit, it'll end up firing `process.emit('exit')`, so\n * the handler will be fired anyway.\n *\n * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n * artificially, inherently leave the process in a\n * state from which it is not safe to try and enter JS\n * listeners.\n */\nexports.signals = [];\nexports.signals.push('SIGHUP', 'SIGINT', 'SIGTERM');\nif (process.platform !== 'win32') {\n exports.signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n );\n}\nif (process.platform === 'linux') {\n exports.signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT');\n}\n//# sourceMappingURL=signals.js.map","\"use strict\";\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unload = exports.load = exports.onExit = exports.signals = void 0;\n// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\n// grab a reference to node's real process object right away\nconst signals_js_1 = require(\"./signals.js\");\nObject.defineProperty(exports, \"signals\", { enumerable: true, get: function () { return signals_js_1.signals; } });\nconst processOk = (process) => !!process &&\n typeof process === 'object' &&\n typeof process.removeListener === 'function' &&\n typeof process.emit === 'function' &&\n typeof process.reallyExit === 'function' &&\n typeof process.listeners === 'function' &&\n typeof process.kill === 'function' &&\n typeof process.pid === 'number' &&\n typeof process.on === 'function';\nconst kExitEmitter = Symbol.for('signal-exit emitter');\nconst global = globalThis;\nconst ObjectDefineProperty = Object.defineProperty.bind(Object);\n// teeny special purpose ee\nclass Emitter {\n emitted = {\n afterExit: false,\n exit: false,\n };\n listeners = {\n afterExit: [],\n exit: [],\n };\n count = 0;\n id = Math.random();\n constructor() {\n if (global[kExitEmitter]) {\n return global[kExitEmitter];\n }\n ObjectDefineProperty(global, kExitEmitter, {\n value: this,\n writable: false,\n enumerable: false,\n configurable: false,\n });\n }\n on(ev, fn) {\n this.listeners[ev].push(fn);\n }\n removeListener(ev, fn) {\n const list = this.listeners[ev];\n const i = list.indexOf(fn);\n /* c8 ignore start */\n if (i === -1) {\n return;\n }\n /* c8 ignore stop */\n if (i === 0 && list.length === 1) {\n list.length = 0;\n }\n else {\n list.splice(i, 1);\n }\n }\n emit(ev, code, signal) {\n if (this.emitted[ev]) {\n return false;\n }\n this.emitted[ev] = true;\n let ret = false;\n for (const fn of this.listeners[ev]) {\n ret = fn(code, signal) === true || ret;\n }\n if (ev === 'exit') {\n ret = this.emit('afterExit', code, signal) || ret;\n }\n return ret;\n }\n}\nclass SignalExitBase {\n}\nconst signalExitWrap = (handler) => {\n return {\n onExit(cb, opts) {\n return handler.onExit(cb, opts);\n },\n load() {\n return handler.load();\n },\n unload() {\n return handler.unload();\n },\n };\n};\nclass SignalExitFallback extends SignalExitBase {\n onExit() {\n return () => { };\n }\n load() { }\n unload() { }\n}\nclass SignalExit extends SignalExitBase {\n // \"SIGHUP\" throws an `ENOSYS` error on Windows,\n // so use a supported signal instead\n /* c8 ignore start */\n #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP';\n /* c8 ignore stop */\n #emitter = new Emitter();\n #process;\n #originalProcessEmit;\n #originalProcessReallyExit;\n #sigListeners = {};\n #loaded = false;\n constructor(process) {\n super();\n this.#process = process;\n // { <signal>: <listener fn>, ... }\n this.#sigListeners = {};\n for (const sig of signals_js_1.signals) {\n this.#sigListeners[sig] = () => {\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n const listeners = this.#process.listeners(sig);\n let { count } = this.#emitter;\n // This is a workaround for the fact that signal-exit v3 and signal\n // exit v4 are not aware of each other, and each will attempt to let\n // the other handle it, so neither of them do. To correct this, we\n // detect if we're the only handler *except* for previous versions\n // of signal-exit, and increment by the count of listeners it has\n // created.\n /* c8 ignore start */\n const p = process;\n if (typeof p.__signal_exit_emitter__ === 'object' &&\n typeof p.__signal_exit_emitter__.count === 'number') {\n count += p.__signal_exit_emitter__.count;\n }\n /* c8 ignore stop */\n if (listeners.length === count) {\n this.unload();\n const ret = this.#emitter.emit('exit', null, sig);\n /* c8 ignore start */\n const s = sig === 'SIGHUP' ? this.#hupSig : sig;\n if (!ret)\n process.kill(process.pid, s);\n /* c8 ignore stop */\n }\n };\n }\n this.#originalProcessReallyExit = process.reallyExit;\n this.#originalProcessEmit = process.emit;\n }\n onExit(cb, opts) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return () => { };\n }\n /* c8 ignore stop */\n if (this.#loaded === false) {\n this.load();\n }\n const ev = opts?.alwaysLast ? 'afterExit' : 'exit';\n this.#emitter.on(ev, cb);\n return () => {\n this.#emitter.removeListener(ev, cb);\n if (this.#emitter.listeners['exit'].length === 0 &&\n this.#emitter.listeners['afterExit'].length === 0) {\n this.unload();\n }\n };\n }\n load() {\n if (this.#loaded) {\n return;\n }\n this.#loaded = true;\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n this.#emitter.count += 1;\n for (const sig of signals_js_1.signals) {\n try {\n const fn = this.#sigListeners[sig];\n if (fn)\n this.#process.on(sig, fn);\n }\n catch (_) { }\n }\n this.#process.emit = (ev, ...a) => {\n return this.#processEmit(ev, ...a);\n };\n this.#process.reallyExit = (code) => {\n return this.#processReallyExit(code);\n };\n }\n unload() {\n if (!this.#loaded) {\n return;\n }\n this.#loaded = false;\n signals_js_1.signals.forEach(sig => {\n const listener = this.#sigListeners[sig];\n /* c8 ignore start */\n if (!listener) {\n throw new Error('Listener not defined for signal: ' + sig);\n }\n /* c8 ignore stop */\n try {\n this.#process.removeListener(sig, listener);\n /* c8 ignore start */\n }\n catch (_) { }\n /* c8 ignore stop */\n });\n this.#process.emit = this.#originalProcessEmit;\n this.#process.reallyExit = this.#originalProcessReallyExit;\n this.#emitter.count -= 1;\n }\n #processReallyExit(code) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return 0;\n }\n this.#process.exitCode = code || 0;\n /* c8 ignore stop */\n this.#emitter.emit('exit', this.#process.exitCode, null);\n return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);\n }\n #processEmit(ev, ...args) {\n const og = this.#originalProcessEmit;\n if (ev === 'exit' && processOk(this.#process)) {\n if (typeof args[0] === 'number') {\n this.#process.exitCode = args[0];\n /* c8 ignore start */\n }\n /* c8 ignore start */\n const ret = og.call(this.#process, ev, ...args);\n /* c8 ignore start */\n this.#emitter.emit('exit', this.#process.exitCode, null);\n /* c8 ignore stop */\n return ret;\n }\n else {\n return og.call(this.#process, ev, ...args);\n }\n }\n}\nconst process = globalThis.process;\n// wrap so that we call the method on the actual handler, without\n// exporting it directly.\n_a = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback()), \n/**\n * Called when the process is exiting, whether via signal, explicit\n * exit, or running out of stuff to do.\n *\n * If the global process object is not suitable for instrumentation,\n * then this will be a no-op.\n *\n * Returns a function that may be used to unload signal-exit.\n */\nexports.onExit = _a.onExit, \n/**\n * Load the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\nexports.load = _a.load, \n/**\n * Unload the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\nexports.unload = _a.unload;\n//# sourceMappingURL=index.js.map","'use strict'\nmodule.exports = writeFile\nmodule.exports.sync = writeFileSync\nmodule.exports._getTmpname = getTmpname // for testing\nmodule.exports._cleanupOnExit = cleanupOnExit\n\nconst fs = require('fs')\nconst crypto = require('node:crypto')\nconst { onExit } = require('signal-exit')\nconst path = require('path')\nconst { promisify } = require('util')\nconst activeFiles = {}\n\n// if we run inside of a worker_thread, `process.pid` is not unique\n/* istanbul ignore next */\nconst threadId = (function getId () {\n try {\n const workerThreads = require('worker_threads')\n\n /// if we are in main thread, this is set to `0`\n return workerThreads.threadId\n } catch (e) {\n // worker_threads are not available, fallback to 0\n return 0\n }\n})()\n\nlet invocations = 0\nfunction getTmpname (filename) {\n return filename + '.' +\n crypto.createHash('sha1')\n .update(__filename)\n .update(String(process.pid))\n .update(String(threadId))\n .update(String(++invocations))\n .digest()\n .readUInt32BE(0)\n}\n\nfunction cleanupOnExit (tmpfile) {\n return () => {\n try {\n fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile)\n } catch {\n // ignore errors\n }\n }\n}\n\nfunction serializeActiveFile (absoluteName) {\n return new Promise(resolve => {\n // make a queue if it doesn't already exist\n if (!activeFiles[absoluteName]) {\n activeFiles[absoluteName] = []\n }\n\n activeFiles[absoluteName].push(resolve) // add this job to the queue\n if (activeFiles[absoluteName].length === 1) {\n resolve()\n } // kick off the first one\n })\n}\n\n// https://github.com/isaacs/node-graceful-fs/blob/master/polyfills.js#L315-L342\nfunction isChownErrOk (err) {\n if (err.code === 'ENOSYS') {\n return true\n }\n\n const nonroot = !process.getuid || process.getuid() !== 0\n if (nonroot) {\n if (err.code === 'EINVAL' || err.code === 'EPERM') {\n return true\n }\n }\n\n return false\n}\n\nasync function writeFileAsync (filename, data, options = {}) {\n if (typeof options === 'string') {\n options = { encoding: options }\n }\n\n let fd\n let tmpfile\n /* istanbul ignore next -- The closure only gets called when onExit triggers */\n const removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile))\n const absoluteName = path.resolve(filename)\n\n try {\n await serializeActiveFile(absoluteName)\n const truename = await promisify(fs.realpath)(filename).catch(() => filename)\n tmpfile = getTmpname(truename)\n\n if (!options.mode || !options.chown) {\n // Either mode or chown is not explicitly set\n // Default behavior is to copy it from original file\n const stats = await promisify(fs.stat)(truename).catch(() => {})\n if (stats) {\n if (options.mode == null) {\n options.mode = stats.mode\n }\n\n if (options.chown == null && process.getuid) {\n options.chown = { uid: stats.uid, gid: stats.gid }\n }\n }\n }\n\n fd = await promisify(fs.open)(tmpfile, 'w', options.mode)\n if (options.tmpfileCreated) {\n await options.tmpfileCreated(tmpfile)\n }\n if (ArrayBuffer.isView(data)) {\n await promisify(fs.write)(fd, data, 0, data.length, 0)\n } else if (data != null) {\n await promisify(fs.write)(fd, String(data), 0, String(options.encoding || 'utf8'))\n }\n\n if (options.fsync !== false) {\n await promisify(fs.fsync)(fd)\n }\n\n await promisify(fs.close)(fd)\n fd = null\n\n if (options.chown) {\n await promisify(fs.chown)(tmpfile, options.chown.uid, options.chown.gid).catch(err => {\n if (!isChownErrOk(err)) {\n throw err\n }\n })\n }\n\n if (options.mode) {\n await promisify(fs.chmod)(tmpfile, options.mode).catch(err => {\n if (!isChownErrOk(err)) {\n throw err\n }\n })\n }\n\n await promisify(fs.rename)(tmpfile, truename)\n } finally {\n if (fd) {\n await promisify(fs.close)(fd).catch(\n /* istanbul ignore next */\n () => {}\n )\n }\n removeOnExitHandler()\n await promisify(fs.unlink)(tmpfile).catch(() => {})\n activeFiles[absoluteName].shift() // remove the element added by serializeSameFile\n if (activeFiles[absoluteName].length > 0) {\n activeFiles[absoluteName][0]() // start next job if one is pending\n } else {\n delete activeFiles[absoluteName]\n }\n }\n}\n\nasync function writeFile (filename, data, options, callback) {\n if (options instanceof Function) {\n callback = options\n options = {}\n }\n\n const promise = writeFileAsync(filename, data, options)\n if (callback) {\n try {\n const result = await promise\n return callback(result)\n } catch (err) {\n return callback(err)\n }\n }\n\n return promise\n}\n\nfunction writeFileSync (filename, data, options) {\n if (typeof options === 'string') {\n options = { encoding: options }\n } else if (!options) {\n options = {}\n }\n try {\n filename = fs.realpathSync(filename)\n } catch (ex) {\n // it's ok, it'll happen on a not yet existing file\n }\n const tmpfile = getTmpname(filename)\n\n if (!options.mode || !options.chown) {\n // Either mode or chown is not explicitly set\n // Default behavior is to copy it from original file\n try {\n const stats = fs.statSync(filename)\n options = Object.assign({}, options)\n if (!options.mode) {\n options.mode = stats.mode\n }\n if (!options.chown && process.getuid) {\n options.chown = { uid: stats.uid, gid: stats.gid }\n }\n } catch (ex) {\n // ignore stat errors\n }\n }\n\n let fd\n const cleanup = cleanupOnExit(tmpfile)\n const removeOnExitHandler = onExit(cleanup)\n\n let threw = true\n try {\n fd = fs.openSync(tmpfile, 'w', options.mode || 0o666)\n if (options.tmpfileCreated) {\n options.tmpfileCreated(tmpfile)\n }\n if (ArrayBuffer.isView(data)) {\n fs.writeSync(fd, data, 0, data.length, 0)\n } else if (data != null) {\n fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8'))\n }\n if (options.fsync !== false) {\n fs.fsyncSync(fd)\n }\n\n fs.closeSync(fd)\n fd = null\n\n if (options.chown) {\n try {\n fs.chownSync(tmpfile, options.chown.uid, options.chown.gid)\n } catch (err) {\n if (!isChownErrOk(err)) {\n throw err\n }\n }\n }\n\n if (options.mode) {\n try {\n fs.chmodSync(tmpfile, options.mode)\n } catch (err) {\n if (!isChownErrOk(err)) {\n throw err\n }\n }\n }\n\n fs.renameSync(tmpfile, filename)\n threw = false\n } finally {\n if (fd) {\n try {\n fs.closeSync(fd)\n } catch (ex) {\n // ignore close errors at this stage, error may have closed fd already.\n }\n }\n removeOnExitHandler()\n if (threw) {\n cleanup()\n }\n }\n}\n","// make sure that bins are executable, and that they don't have\n// windows line-endings on the hashbang line.\nconst {\n chmod,\n open,\n readFile,\n stat,\n} = require('fs/promises')\n\nconst execMode = 0o777 & (~process.umask())\n\nconst writeFileAtomic = require('write-file-atomic')\n\nconst isWindowsHashBang = buf =>\n buf[0] === '#'.charCodeAt(0) &&\n buf[1] === '!'.charCodeAt(0) &&\n /^#![^\\n]+\\r\\n/.test(buf.toString())\n\nconst isWindowsHashbangFile = file => {\n const FALSE = () => false\n return open(file, 'r').then(fh => {\n const buf = Buffer.alloc(2048)\n return fh.read(buf, 0, 2048, 0)\n .then(\n () => {\n const isWHB = isWindowsHashBang(buf)\n return fh.close().then(() => isWHB, () => isWHB)\n },\n // don't leak FD if read() fails\n () => fh.close().then(FALSE, FALSE)\n )\n }, FALSE)\n}\n\nconst dos2Unix = file =>\n readFile(file, 'utf8').then(content =>\n writeFileAtomic(file, content.replace(/^(#![^\\n]+)\\r\\n/, '$1\\n')))\n\nconst fixBin = (file, mode = execMode) => stat(file)\n .then(st => (st.mode & mode) === mode ? null : chmod(file, mode))\n .then(() => isWindowsHashbangFile(file))\n .then(isWHB => isWHB ? dos2Unix(file) : null)\n\nmodule.exports = fixBin\n","const { resolve, dirname, sep } = require('path')\nconst { lstat } = require('fs/promises')\nconst throwNonEnoent = er => {\n if (er.code !== 'ENOENT') {\n throw er\n }\n}\n\nconst cmdShim = require('cmd-shim')\nconst readCmdShim = require('read-cmd-shim')\n\nconst fixBin = require('./fix-bin.js')\n\n// even in --force mode, we never create a shim over a shim we've\n// already created. you can have multiple packages in a tree trying\n// to contend for the same bin, which creates a race condition and\n// nondeterminism.\nconst seen = new Set()\n\nconst failEEXIST = ({ to, from }) =>\n Promise.reject(Object.assign(new Error('EEXIST: file already exists'), {\n path: to,\n dest: from,\n code: 'EEXIST',\n }))\n\nconst handleReadCmdShimError = ({ er, from, to }) =>\n er.code === 'ENOENT' ? null\n : er.code === 'ENOTASHIM' ? failEEXIST({ from, to })\n : Promise.reject(er)\n\nconst SKIP = Symbol('skip - missing or already installed')\nconst shimBin = ({ path, to, from, absFrom, force }) => {\n const shims = [\n to,\n to + '.cmd',\n to + '.ps1',\n ]\n\n for (const shim of shims) {\n if (seen.has(shim)) {\n return true\n }\n seen.add(shim)\n }\n\n return Promise.all([\n ...shims,\n absFrom,\n ].map(f => lstat(f).catch(throwNonEnoent))).then((stats) => {\n const [, , , stFrom] = stats\n if (!stFrom) {\n return SKIP\n }\n\n if (force) {\n return false\n }\n\n return Promise.all(shims.map((s, i) => [s, stats[i]]).map(([s, st]) => {\n if (!st) {\n return false\n }\n return readCmdShim(s)\n .then(target => {\n target = resolve(dirname(to), target)\n const base = resolve(path)\n if (target !== base && !target.startsWith(base + sep)) {\n return failEEXIST({ from, to, path })\n }\n return false\n }, er => handleReadCmdShimError({ er, from, to }))\n }))\n })\n .then(skip => skip !== SKIP && doShim(absFrom, to))\n}\n\nconst doShim = (absFrom, to) =>\n cmdShim(absFrom, to).then(() => fixBin(absFrom))\n\nconst resetSeen = () => {\n for (const p of seen) {\n seen.delete(p)\n }\n}\n\nmodule.exports = Object.assign(shimBin, { resetSeen })\n","// if the thing isn't there, skip it\n// if there's a non-symlink there already, eexist\n// if there's a symlink already, pointing somewhere else, eexist\n// if there's a symlink already, pointing into our pkg, remove it first\n// then create the symlink\n\nconst { resolve, dirname, sep } = require('path')\nconst { lstat, mkdir, readlink, rm, symlink } = require('fs/promises')\nconst { log } = require('proc-log')\nconst throwSignificant = er => {\n if (er.code === 'ENOENT') {\n return\n }\n if (er.code === 'EACCES') {\n log.warn('error adding file', er.message)\n return\n }\n throw er\n}\n\nconst rmOpts = {\n recursive: true,\n force: true,\n}\n\n// even in --force mode, we never create a link over a link we've\n// already created. you can have multiple packages in a tree trying\n// to contend for the same bin, or the same manpage listed multiple times,\n// which creates a race condition and nondeterminism.\nconst seen = new Set()\n\nconst SKIP = Symbol('skip - missing or already installed')\nconst CLOBBER = Symbol('clobber - ours or in forceful mode')\n\nconst linkGently = async ({ path, to, from, absFrom, force }) => {\n if (seen.has(to)) {\n return false\n }\n seen.add(to)\n\n // if the script or manpage isn't there, just ignore it.\n // this arguably *should* be an install error of some sort,\n // or at least a warning, but npm has always behaved this\n // way in the past, so it'd be a breaking change\n return Promise.all([\n lstat(absFrom).catch(throwSignificant),\n lstat(to).catch(throwSignificant),\n ]).then(([stFrom, stTo]) => {\n // not present in package, skip it\n if (!stFrom) {\n return SKIP\n }\n\n // exists! maybe clobber if we can\n if (stTo) {\n if (!stTo.isSymbolicLink()) {\n return force && rm(to, rmOpts).then(() => CLOBBER)\n }\n\n return readlink(to).then(target => {\n if (target === from) {\n return SKIP\n } // skip it, already set up like we want it.\n\n target = resolve(dirname(to), target)\n if (target === path || target.startsWith(path + sep) || force) {\n return rm(to, rmOpts).then(() => CLOBBER)\n }\n // neither skip nor clobber\n return false\n })\n } else {\n // doesn't exist, dir might not either\n return mkdir(dirname(to), { recursive: true })\n }\n })\n .then(skipOrClobber => {\n if (skipOrClobber === SKIP) {\n return false\n }\n return symlink(from, to, 'file').catch(er => {\n if (skipOrClobber === CLOBBER || force) {\n return rm(to, rmOpts).then(() => symlink(from, to, 'file'))\n }\n throw er\n }).then(() => true)\n })\n}\n\nconst resetSeen = () => {\n for (const p of seen) {\n seen.delete(p)\n }\n}\n\nmodule.exports = Object.assign(linkGently, { resetSeen })\n","const linkGently = require('./link-gently.js')\nconst fixBin = require('./fix-bin.js')\n\n// linking bins is simple. just symlink, and if we linked it, fix the bin up\nconst linkBin = ({ path, to, from, absFrom, force }) =>\n linkGently({ path, to, from, absFrom, force })\n .then(linked => linked && fixBin(absFrom))\n\nmodule.exports = linkBin\n","const isWindows = require('./is-windows.js')\nconst binTarget = require('./bin-target.js')\nconst { dirname, resolve, relative } = require('path')\nconst linkBin = isWindows ? require('./shim-bin.js') : require('./link-bin.js')\nconst normalize = require('npm-normalize-package-bin')\n\nconst linkBins = ({ path, pkg, top, force }) => {\n pkg = normalize(pkg)\n if (!pkg.bin) {\n return Promise.resolve([])\n }\n const promises = []\n const target = binTarget({ path, top })\n for (const [key, val] of Object.entries(pkg.bin)) {\n const to = resolve(target, key)\n const absFrom = resolve(path, val)\n const from = relative(dirname(to), absFrom)\n promises.push(linkBin({ path, from, to, absFrom, force }))\n }\n return Promise.all(promises)\n}\n\nmodule.exports = linkBins\n","// check to see if a bin is allowed to be overwritten\n// either rejects or resolves to nothing. return value not relevant.\nconst isWindows = require('./is-windows.js')\nconst binTarget = require('./bin-target.js')\nconst { resolve, dirname, sep } = require('path')\nconst readCmdShim = require('read-cmd-shim')\nconst { readlink } = require('fs/promises')\n\nconst checkBin = async ({ bin, path, top, global, force }) => {\n // always ok to clobber when forced\n // always ok to clobber local bins, or when forced\n if (force || !global || !top) {\n return\n }\n\n // ok, need to make sure, then\n const target = resolve(binTarget({ path, top }), bin)\n path = resolve(path)\n return isWindows ? checkShim({ target, path }) : checkLink({ target, path })\n}\n\n// only enoent is allowed. anything else is a problem.\nconst handleReadLinkError = async ({ er, target }) =>\n er.code === 'ENOENT' ? null\n : failEEXIST({ target })\n\nconst checkLink = async ({ target, path }) => {\n const current = await readlink(target)\n .catch(er => handleReadLinkError({ er, target }))\n\n if (!current) {\n return\n }\n\n const resolved = resolve(dirname(target), current)\n\n const resolvedLower = resolved.toLowerCase()\n const pathLower = path.toLowerCase()\n if (resolvedLower !== pathLower && !resolvedLower.startsWith(pathLower + sep)) {\n return failEEXIST({ target })\n }\n}\n\nconst handleReadCmdShimError = ({ er, target }) =>\n er.code === 'ENOENT' ? null\n : failEEXIST({ target })\n\nconst failEEXIST = ({ target }) =>\n Promise.reject(Object.assign(new Error('EEXIST: file already exists'), {\n path: target,\n code: 'EEXIST',\n }))\n\nconst checkShim = async ({ target, path }) => {\n const shims = [\n target,\n target + '.cmd',\n target + '.ps1',\n ]\n await Promise.all(shims.map(async shim => {\n const current = await readCmdShim(shim)\n .catch(er => handleReadCmdShimError({ er, target: shim }))\n\n if (!current) {\n return\n }\n\n const resolved = resolve(dirname(shim), current.replace(/\\\\/g, '/'))\n\n const resolvedLower = resolved.toLowerCase()\n const pathLower = path.toLowerCase()\n if (resolvedLower !== pathLower && !resolvedLower.startsWith(pathLower + sep)) {\n return failEEXIST({ target: shim })\n }\n }))\n}\n\nmodule.exports = checkBin\n","const checkBin = require('./check-bin.js')\nconst normalize = require('npm-normalize-package-bin')\nconst checkBins = async ({ pkg, path, top, global, force }) => {\n // always ok to clobber when forced\n // always ok to clobber local bins, or when forced\n if (force || !global || !top) {\n return\n }\n\n pkg = normalize(pkg)\n if (!pkg.bin) {\n return\n }\n\n await Promise.all(Object.keys(pkg.bin)\n .map(bin => checkBin({ bin, path, top, global, force })))\n}\nmodule.exports = checkBins\n","const isWindows = require('./is-windows.js')\nconst getPrefix = require('./get-prefix.js')\nconst { dirname } = require('path')\n\nmodule.exports = ({ top, path }) => !top || isWindows ? null\n : dirname(getPrefix(path)) + '/share/man'\n","// get all the paths that are (or might be) installed for a given pkg\n// There's no guarantee that all of these will be installed, but if they\n// are present, then we can assume that they're associated.\nconst binTarget = require('./bin-target.js')\nconst manTarget = require('./man-target.js')\nconst { resolve, basename, extname } = require('path')\nconst isWindows = require('./is-windows.js')\nmodule.exports = ({ path, pkg, global, top }) => {\n if (top && !global) {\n return []\n }\n\n const binSet = []\n const binTarg = binTarget({ path, top })\n if (pkg.bin) {\n for (const bin of Object.keys(pkg.bin)) {\n const b = resolve(binTarg, bin)\n binSet.push(b)\n if (isWindows) {\n binSet.push(b + '.cmd')\n binSet.push(b + '.ps1')\n }\n }\n }\n\n const manTarg = manTarget({ path, top })\n const manSet = []\n if (manTarg && pkg.man && Array.isArray(pkg.man) && pkg.man.length) {\n for (const man of pkg.man) {\n if (!/.\\.[0-9]+(\\.gz)?$/.test(man)) {\n return binSet\n }\n\n const section = extname(basename(man, '.gz')).slice(1)\n const base = basename(man)\n\n manSet.push(resolve(manTarg, 'man' + section, base))\n }\n }\n\n return manSet.length ? [...binSet, ...manSet] : binSet\n}\n","const linkBins = require('./link-bins.js')\n\nconst binLinks = opts => {\n const { path, pkg, force, global, top } = opts\n // global top pkgs on windows get bins installed in {prefix}.\n //\n // unix global top pkgs get their bins installed in {prefix}/bin.\n //\n // non-top pkgs get their bins installed in {prefix}/node_modules/.bin.\n //\n // non-global top pkgs don't have any bins linked. From here on out, if it's top, we know that it's global, so no need to pass that option further down the stack.\n //\n // As of v7, bin-links no longer installs man pages into the system man path for any package. `getPaths` still returns legacy man paths so pre-existing installs can be cleaned up on uninstall.\n if (top && !global) {\n return Promise.resolve()\n }\n\n // allow clobbering within the local node_modules/.bin folder. only global bins are protected in this way, or else it is yet another vector for excessive dependency conflicts.\n return linkBins({ path, pkg, top, force: force || !top })\n}\n\nconst shimBin = require('./shim-bin.js')\nconst linkGently = require('./link-gently.js')\nconst resetSeen = () => {\n shimBin.resetSeen()\n linkGently.resetSeen()\n}\n\nconst checkBins = require('./check-bins.js')\nconst getPaths = require('./get-paths.js')\n\nmodule.exports = Object.assign(binLinks, {\n checkBins,\n resetSeen,\n getPaths,\n})\n","// package children are represented with a Map object, but many file systems\n// are case-insensitive and unicode-normalizing, so we need to treat\n// node.children.get('FOO') and node.children.get('foo') as the same thing.\n\nmodule.exports = class CIMap extends Map {\n #keys = new Map()\n\n constructor (items = []) {\n super()\n for (const [key, val] of items) {\n this.set(key, val)\n }\n }\n\n #normKey (key) {\n if (typeof key !== 'string') {\n return key\n }\n return key.normalize('NFKD').toLowerCase()\n }\n\n get (key) {\n const normKey = this.#normKey(key)\n return this.#keys.has(normKey) ? super.get(this.#keys.get(normKey))\n : undefined\n }\n\n set (key, val) {\n const normKey = this.#normKey(key)\n if (this.#keys.has(normKey)) {\n super.delete(this.#keys.get(normKey))\n }\n this.#keys.set(normKey, key)\n return super.set(key, val)\n }\n\n delete (key) {\n const normKey = this.#normKey(key)\n if (this.#keys.has(normKey)) {\n const prevKey = this.#keys.get(normKey)\n this.#keys.delete(normKey)\n return super.delete(prevKey)\n }\n }\n\n has (key) {\n const normKey = this.#normKey(key)\n return this.#keys.has(normKey) && super.has(this.#keys.get(normKey))\n }\n}\n","// file dependencies need their dependencies resolved based on the location\n// where the tarball was found, not the location where they end up getting\n// installed. directory (ie, symlink) deps also need to be resolved based on\n// their targets, but that's what realpath is\n\nconst { dirname } = require('node:path')\nconst npa = require('npm-package-arg')\n\nconst fromPath = (node, edge) => {\n if (edge && edge.overrides && edge.overrides.name === edge.name && edge.overrides.value) {\n // fromPath could be called with a node that has a virtual root, if that\n // happens we want to make sure we get the real root node when overrides\n // are in use. this is to allow things like overriding a dependency with a\n // tarball file that's a relative path from the project root\n if (node.sourceReference) {\n return node.sourceReference.root.realpath\n }\n return node.root.realpath\n }\n\n if (node.resolved) {\n const spec = npa(node.resolved)\n if (spec?.type === 'file') {\n return dirname(spec.fetchSpec)\n }\n }\n return node.realpath\n}\n\nmodule.exports = fromPath\n","// Do not rely on package._fields, so that we don't throw\n// false failures if a tree is generated by other clients.\n// Only relies on child.resolved, which MAY come from\n// client-specific package.json meta _fields, but most of\n// the time will be pulled out of a lockfile\n\nconst semver = require('semver')\nconst npa = require('npm-package-arg')\nconst { relative } = require('node:path')\nconst fromPath = require('./from-path.js')\n\n// A named ref (tag or branch) resolves to a commit hash, so look up the\n// committish recorded for this edge in the lockfile to detect spec changes.\nconst lockedGitCommittish = (child, requestor) => {\n const lock = requestor.root?.meta?.data?.packages?.[requestor.location]\n const spec = lock && (\n lock.dependencies?.[child.name] ||\n lock.optionalDependencies?.[child.name] ||\n lock.devDependencies?.[child.name] ||\n lock.peerDependencies?.[child.name]\n )\n if (!spec) {\n return null\n }\n try {\n const parsed = npa.resolve(child.name, spec, requestor.realpath)\n return parsed.type === 'git' ? parsed.gitCommittish || '' : null\n } catch {\n return null\n }\n}\n\nconst depValid = (child, requested, requestor) => {\n // NB: we don't do much to verify 'tag' type requests.\n // Just verify that we got a remote resolution. Presumably, it\n // came from a registry and was tagged at some point.\n\n if (typeof requested === 'string') {\n try {\n // tarball/dir must have resolved to the same tgz on disk, but for\n // file: deps that depend on other files/dirs, we must resolve the\n // location based on the *requestor* file/dir, not where it ends up.\n // '' is equivalent to '*'\n requested = npa.resolve(child.name, requested || '*', fromPath(requestor, requestor.edgesOut.get(child.name)))\n } catch (er) {\n // Not invalid because the child doesn't match, but because\n // the spec itself is not supported. Nothing would match,\n // so the edge is definitely not valid and never can be.\n er.dependency = child.name\n er.requested = requested\n requestor.errors.push(er)\n return false\n }\n }\n\n // if the lockfile is super old, or hand-modified,\n // then it's possible to hit this state.\n if (!requested) {\n const er = new Error('Invalid dependency specifier')\n er.dependency = child.name\n er.requested = requested\n requestor.errors.push(er)\n return false\n }\n\n switch (requested.type) {\n case 'range':\n if (requested.fetchSpec === '*') {\n return true\n }\n // fallthrough\n case 'version':\n // if it's a version or a range other than '*', semver it\n return semver.satisfies(child.version, requested.fetchSpec, true)\n\n case 'directory':\n return linkValid(child, requested, requestor)\n\n case 'file':\n return tarballValid(child, requested, requestor)\n\n case 'alias':\n // check that the alias target is valid\n return depValid(child, requested.subSpec, requestor)\n\n case 'tag':\n // if it's a tag, we just verify that it has a tarball resolution\n // presumably, it came from the registry and was tagged at some point\n return child.resolved && npa(child.resolved).type === 'remote'\n\n case 'remote':\n // verify that we got it from the desired location\n return child.resolved === requested.fetchSpec\n\n case 'git': {\n // if it's a git type, verify that they're the same repo\n //\n // if it specifies a definite commit, then it must have the\n // same commit to be considered the same repo\n //\n // if it has a #semver:<range> specifier, verify that the\n // version in the package is in the semver range\n const resRepo = npa(child.resolved || '')\n const resHost = resRepo.hosted\n const reqHost = requested.hosted\n const reqCommit = /^[a-fA-F0-9]{40,64}$/.test(requested.gitCommittish || '')\n const nc = { noCommittish: !reqCommit }\n if (!resHost) {\n if (resRepo.fetchSpec !== requested.fetchSpec) {\n return false\n }\n } else {\n if (reqHost?.ssh(nc) !== resHost.ssh(nc)) {\n return false\n }\n }\n if (!requested.gitRange) {\n // a named ref can't be verified against the resolved commit offline,\n // so re-resolve if it differs from the committish in the lockfile\n if (!reqCommit) {\n const locked = lockedGitCommittish(child, requestor)\n if (locked !== null && locked !== (requested.gitCommittish || '')) {\n return false\n }\n }\n return true\n }\n return semver.satisfies(child.package.version, requested.gitRange, {\n loose: true,\n })\n }\n\n default: // impossible, just being cautious\n break\n }\n\n const er = new Error('Unsupported dependency type')\n er.dependency = child.name\n er.requested = requested\n requestor.errors.push(er)\n return false\n}\n\nconst linkValid = (child, requested, requestor) => {\n const isLink = !!child.isLink\n // if we're installing links and the node is a link, then it's invalid because we want\n // a real node to be there. Except for workspaces. They are always links.\n if (requestor.installLinks && !child.isWorkspace) {\n return !isLink\n }\n\n // directory must be a link to the specified folder\n return isLink && relative(child.realpath, requested.fetchSpec) === ''\n}\n\nconst tarballValid = (child, requested) => {\n if (child.isLink) {\n return false\n }\n\n if (child.resolved) {\n return child.resolved.replace(/\\\\/g, '/') === `file:${requested.fetchSpec.replace(/\\\\/g, '/')}`\n }\n\n // if we have a legacy mutated package.json file. we can't be 100%\n // sure that it resolved to the same file, but if it was the same\n // request, that's a pretty good indicator of sameness.\n if (child.package._requested) {\n return child.package._requested.saveSpec === requested.saveSpec\n }\n\n // ok, we're probably dealing with some legacy cruft here, not much\n // we can do at this point unfortunately.\n return false\n}\n\nmodule.exports = (child, requested, accept, requestor) =>\n depValid(child, requested, requestor) ||\n (typeof accept === 'string' ? depValid(child, accept, requestor) : false)\n","const npa = require('npm-package-arg')\nconst semver = require('semver')\nconst { log } = require('proc-log')\n\nclass OverrideSet {\n constructor ({ overrides, key, parent }) {\n this.parent = parent\n this.children = new Map()\n\n if (typeof overrides === 'string') {\n overrides = { '.': overrides }\n }\n\n // change a literal empty string to * so we can use truthiness checks on\n // the value property later\n if (overrides['.'] === '') {\n overrides['.'] = '*'\n }\n\n if (parent) {\n const spec = npa(key)\n if (!spec.name) {\n throw new Error(`Override without name: ${key}`)\n }\n\n this.name = spec.name\n spec.name = ''\n this.key = key\n this.keySpec = spec.toString()\n this.value = overrides['.'] || this.keySpec\n }\n\n for (const [key, childOverrides] of Object.entries(overrides)) {\n if (key === '.') {\n continue\n }\n\n const child = new OverrideSet({\n parent: this,\n key,\n overrides: childOverrides,\n })\n\n this.children.set(child.key, child)\n }\n }\n\n childrenAreEqual (other) {\n if (this.children.size !== other.children.size) {\n return false\n }\n for (const [key] of this.children) {\n if (!other.children.has(key)) {\n return false\n }\n if (this.children.get(key).value !== other.children.get(key).value) {\n return false\n }\n if (!this.children.get(key).childrenAreEqual(other.children.get(key))) {\n return false\n }\n }\n return true\n }\n\n isEqual (other) {\n if (this === other) {\n return true\n }\n if (!other) {\n return false\n }\n if (this.key !== other.key || this.value !== other.value) {\n return false\n }\n if (!this.childrenAreEqual(other)) {\n return false\n }\n if (!this.parent) {\n return !other.parent\n }\n return this.parent.isEqual(other.parent)\n }\n\n getEdgeRule (edge) {\n for (const rule of this.ruleset.values()) {\n if (rule.name !== edge.name) {\n continue\n }\n\n // if keySpec is * we found our override\n if (rule.keySpec === '*') {\n return rule\n }\n\n // We need to use the rawSpec here, because the spec has the overrides applied to it already.\n // rawSpec can be undefined, so we need to use the fallback value of spec if it is.\n let spec = npa(`${edge.name}@${edge.rawSpec || edge.spec}`)\n if (spec.type === 'alias') {\n spec = spec.subSpec\n }\n\n if (spec.type === 'git') {\n if (spec.gitRange && semver.intersects(spec.gitRange, rule.keySpec)) {\n return rule\n }\n\n continue\n }\n\n if (spec.type === 'range' || spec.type === 'version') {\n if (semver.intersects(spec.fetchSpec, rule.keySpec)) {\n return rule\n }\n\n continue\n }\n\n // if we got this far, the spec type is one of tag, directory or file\n // which means we have no real way to make version comparisons, so we\n // just accept the override\n return rule\n }\n\n return this\n }\n\n getNodeRule (node) {\n for (const rule of this.ruleset.values()) {\n if (rule.name !== node.name) {\n continue\n }\n\n if (semver.satisfies(node.version, rule.keySpec) ||\n semver.satisfies(node.version, rule.value)) {\n return rule\n }\n }\n\n return this\n }\n\n getMatchingRule (node) {\n for (const rule of this.ruleset.values()) {\n if (rule.name !== node.name) {\n continue\n }\n\n if (semver.satisfies(node.version, rule.keySpec) ||\n semver.satisfies(node.version, rule.value)) {\n return rule\n }\n }\n\n return null\n }\n\n * ancestry () {\n for (let ancestor = this; ancestor; ancestor = ancestor.parent) {\n yield ancestor\n }\n }\n\n get isRoot () {\n return !this.parent\n }\n\n get ruleset () {\n const ruleset = new Map()\n\n for (const override of this.ancestry()) {\n for (const kid of override.children.values()) {\n if (!ruleset.has(kid.key)) {\n ruleset.set(kid.key, kid)\n }\n }\n\n if (!override.isRoot && !ruleset.has(override.key)) {\n ruleset.set(override.key, override)\n }\n }\n\n return ruleset\n }\n\n static findSpecificOverrideSet (first, second) {\n for (let overrideSet = second; overrideSet; overrideSet = overrideSet.parent) {\n if (overrideSet.isEqual(first)) {\n return second\n }\n }\n for (let overrideSet = first; overrideSet; overrideSet = overrideSet.parent) {\n if (overrideSet.isEqual(second)) {\n return first\n }\n }\n\n // The override sets are incomparable (e.g. siblings like the \"react\" and \"react-dom\" children of the root override set). Check if they have semantically conflicting rules before treating this as an error.\n if (this.haveConflictingRules(first, second)) {\n log.silly('Conflicting override sets', first, second)\n return undefined\n }\n\n // The override sets are structurally incomparable but have compatible rules. Fall back to their nearest common ancestor so the node still has a valid override set.\n return this.findCommonAncestor(first, second)\n }\n\n static findCommonAncestor (first, second) {\n const firstAncestors = []\n for (const ancestor of first.ancestry()) {\n firstAncestors.push(ancestor)\n }\n for (const secondAnc of second.ancestry()) {\n for (const firstAnc of firstAncestors) {\n if (firstAnc.isEqual(secondAnc)) {\n return firstAnc\n }\n }\n }\n return null\n }\n\n static doOverrideSetsConflict (first, second) {\n // If override sets contain one another then we can try to use the more specific one.\n // If neither one is more specific, check for semantic conflicts.\n const specificSet = this.findSpecificOverrideSet(first, second)\n if (specificSet !== undefined) {\n // One contains the other, so no conflict\n return false\n }\n\n // The override sets are structurally incomparable, but this doesn't necessarily\n // mean they conflict. We need to check if they have conflicting version requirements\n // for any package that appears in both rulesets.\n return this.haveConflictingRules(first, second)\n }\n\n static haveConflictingRules (first, second) {\n // Get all rules from both override sets\n const firstRules = first.ruleset\n const secondRules = second.ruleset\n\n // Check each package that appears in both rulesets\n for (const [key, firstRule] of firstRules) {\n const secondRule = secondRules.get(key)\n if (!secondRule) {\n // Package only appears in one ruleset, no conflict\n continue\n }\n\n // Same rule object means no conflict\n if (firstRule === secondRule || firstRule.isEqual(secondRule)) {\n continue\n }\n\n // Both rulesets have rules for this package with different values.\n // Check if the version requirements are actually incompatible.\n const firstValue = firstRule.value\n const secondValue = secondRule.value\n\n // If either value is a reference (starts with $), we can't determine\n // compatibility here - the reference might resolve to compatible versions.\n // We defer to runtime resolution rather than failing early.\n if (firstValue.startsWith('$') || secondValue.startsWith('$')) {\n continue\n }\n\n // Check if the version ranges are compatible using semver\n // If both specify version ranges, they conflict only if they have no overlap\n try {\n const firstSpec = npa(`${firstRule.name}@${firstValue}`)\n const secondSpec = npa(`${secondRule.name}@${secondValue}`)\n\n // For range/version types, check if they intersect\n if ((firstSpec.type === 'range' || firstSpec.type === 'version') &&\n (secondSpec.type === 'range' || secondSpec.type === 'version')) {\n // Check if the ranges intersect\n const firstRange = firstSpec.fetchSpec\n const secondRange = secondSpec.fetchSpec\n\n // If the ranges don't intersect, we have a real conflict\n if (!semver.intersects(firstRange, secondRange)) {\n log.silly('Found conflicting override rules', {\n package: firstRule.name,\n first: firstValue,\n second: secondValue,\n })\n return true\n }\n }\n // For other types (git, file, directory, tag), we can't easily determine\n // compatibility, so we conservatively assume no conflict\n } catch {\n // If we can't parse the specs, conservatively assume no conflict\n // Real conflicts will be caught during dependency resolution\n }\n }\n\n // No conflicting rules found\n return false\n }\n}\n\nmodule.exports = OverrideSet\n","// An edge in the dependency graph\n// Represents a dependency relationship of some kind\n\nconst util = require('node:util')\nconst npa = require('npm-package-arg')\nconst depValid = require('./dep-valid.js')\nconst OverrideSet = require('./override-set.js')\n\nclass ArboristEdge {\n constructor (edge) {\n this.name = edge.name\n this.spec = edge.spec\n this.type = edge.type\n\n const edgeFrom = edge.from?.location\n const edgeTo = edge.to?.location\n const override = edge.overrides?.value\n\n if (edgeFrom != null) {\n this.from = edgeFrom\n }\n if (edgeTo) {\n this.to = edgeTo\n }\n if (edge.error) {\n this.error = edge.error\n }\n if (edge.peerConflicted) {\n this.peerConflicted = true\n }\n if (override) {\n this.overridden = override\n }\n }\n}\n\nclass Edge {\n #accept\n #error\n #explanation\n #from\n #name\n #spec\n #to\n #type\n\n static types = Object.freeze([\n 'prod',\n 'dev',\n 'optional',\n 'peer',\n 'peerOptional',\n 'workspace',\n ])\n\n // XXX where is this used?\n static errors = Object.freeze([\n 'DETACHED',\n 'MISSING',\n 'PEER LOCAL',\n 'INVALID',\n ])\n\n constructor (options) {\n const { type, name, spec, accept, from, overrides } = options\n\n // XXX are all of these error states even possible?\n if (typeof spec !== 'string') {\n throw new TypeError('must provide string spec')\n }\n if (!Edge.types.includes(type)) {\n throw new TypeError(`invalid type: ${type}\\n(valid types are: ${Edge.types.join(', ')})`)\n }\n if (type === 'workspace' && npa(spec).type !== 'directory') {\n throw new TypeError('workspace edges must be a symlink')\n }\n if (typeof name !== 'string') {\n throw new TypeError('must provide dependency name')\n }\n if (!from) {\n throw new TypeError('must provide \"from\" node')\n }\n if (accept !== undefined) {\n if (typeof accept !== 'string') {\n throw new TypeError('accept field must be a string if provided')\n }\n this.#accept = accept || '*'\n }\n if (overrides !== undefined) {\n this.overrides = overrides\n }\n\n this.#name = name\n this.#type = type\n this.#spec = spec\n this.#explanation = null\n this.#from = from\n\n from.edgesOut.get(this.#name)?.detach()\n from.addEdgeOut(this)\n\n this.reload(true)\n this.peerConflicted = false\n }\n\n satisfiedBy (node) {\n if (node.name !== this.#name || !this.#from) {\n return false\n }\n\n // NOTE: this condition means we explicitly do not support overriding\n // bundled dependencies\n if (node.inDepBundle) {\n return depValid(node, this.rawSpec, this.#accept, this.#from)\n }\n\n // If there's no override we just use the spec.\n if (!this.overrides?.keySpec) {\n return depValid(node, this.spec, this.#accept, this.#from)\n }\n // There's some override. If the target node satisfies the overriding spec\n // then it's okay.\n if (depValid(node, this.spec, this.#accept, this.#from)) {\n return true\n }\n // If it doesn't, then it should at least satisfy the original spec.\n if (!depValid(node, this.rawSpec, this.#accept, this.#from)) {\n return false\n }\n // It satisfies the original spec, not the overriding spec. We need to make\n // sure it doesn't use the overridden spec.\n // For example:\n // we might have an ^8.0.0 rawSpec, and an override that makes\n // keySpec=8.23.0 and the override value spec=9.0.0.\n // If the node is 9.0.0, then it's okay because it's consistent with spec.\n // If the node is 8.24.0, then it's okay because it's consistent with the rawSpec.\n // If the node is 8.23.0, then it's not okay because even though it's consistent\n // with the rawSpec, it's also consistent with the keySpec.\n // So we're looking for ^8.0.0 or 9.0.0 and not 8.23.0.\n return !depValid(node, this.overrides.keySpec, this.#accept, this.#from)\n }\n\n // return the edge data, and an explanation of how that edge came to be here\n explain (seen = []) {\n if (!this.#explanation) {\n const explanation = {\n type: this.#type,\n name: this.#name,\n spec: this.spec,\n }\n if (this.rawSpec !== this.spec) {\n explanation.rawSpec = this.rawSpec\n explanation.overridden = true\n }\n if (this.bundled) {\n explanation.bundled = this.bundled\n }\n if (this.error) {\n explanation.error = this.error\n }\n if (this.#from) {\n explanation.from = this.#from.explain(null, seen)\n // note when this edge was created or changed by a root packageExtensions repair on the from node\n const applied = this.#from.packageExtensionsApplied\n if (applied) {\n for (const field of ['dependencies', 'optionalDependencies', 'peerDependencies', 'peerDependenciesMeta']) {\n if (applied[field]?.includes(this.#name)) {\n explanation.packageExtensions = { selector: applied.selector, field }\n break\n }\n }\n }\n // note when this edge was created or changed by a root .npm-extension transformManifest repair on the from node\n const transformed = this.#from.npmExtensionApplied\n if (transformed) {\n for (const field of ['dependencies', 'optionalDependencies', 'peerDependencies', 'peerDependenciesMeta']) {\n if (transformed[field]?.includes(this.#name)) {\n explanation.npmExtension = { extensionPoint: transformed.extensionPoint, field }\n break\n }\n }\n }\n }\n this.#explanation = explanation\n }\n return this.#explanation\n }\n\n get bundled () {\n return !!this.#from?.package?.bundleDependencies?.includes(this.#name)\n }\n\n get workspace () {\n return this.#type === 'workspace'\n }\n\n get prod () {\n return this.#type === 'prod'\n }\n\n get dev () {\n return this.#type === 'dev'\n }\n\n get optional () {\n return this.#type === 'optional' || this.#type === 'peerOptional'\n }\n\n get peer () {\n return this.#type === 'peer' || this.#type === 'peerOptional'\n }\n\n get type () {\n return this.#type\n }\n\n get name () {\n return this.#name\n }\n\n get rawSpec () {\n return this.#spec\n }\n\n get spec () {\n if (this.overrides?.value && this.overrides.value !== '*' && this.overrides.name === this.#name) {\n if (this.overrides.value.startsWith('$')) {\n const ref = this.overrides.value.slice(1)\n let pkg = this.#from?.sourceReference\n ? this.#from?.sourceReference.root.package\n : this.#from?.root?.package\n\n let specValue = this.#calculateReferentialOverrideSpec(ref, pkg)\n\n // If the package isn't found in the root package, fall back to the local package.\n if (!specValue) {\n pkg = this.#from?.package\n specValue = this.#calculateReferentialOverrideSpec(ref, pkg)\n }\n\n if (specValue) {\n return specValue\n }\n throw new Error(`Unable to resolve reference ${this.overrides.value}`)\n }\n return this.overrides.value\n }\n return this.#spec\n }\n\n #calculateReferentialOverrideSpec (ref, pkg) {\n if (pkg.devDependencies?.[ref]) {\n return pkg.devDependencies[ref]\n }\n if (pkg.optionalDependencies?.[ref]) {\n return pkg.optionalDependencies[ref]\n }\n if (pkg.dependencies?.[ref]) {\n return pkg.dependencies[ref]\n }\n if (pkg.peerDependencies?.[ref]) {\n return pkg.peerDependencies[ref]\n }\n }\n\n get accept () {\n return this.#accept\n }\n\n get valid () {\n return !this.error\n }\n\n get missing () {\n return this.error === 'MISSING'\n }\n\n get invalid () {\n return this.error === 'INVALID'\n }\n\n get peerLocal () {\n return this.error === 'PEER LOCAL'\n }\n\n get error () {\n if (!this.#error) {\n if (!this.#to) {\n if (this.optional) {\n this.#error = null\n } else {\n this.#error = 'MISSING'\n }\n } else if (this.peer && this.#from === this.#to.parent && !this.#from?.isTop) {\n this.#error = 'PEER LOCAL'\n } else if (!this.satisfiedBy(this.#to)) {\n this.#error = 'INVALID'\n } else if (this.overrides && this.#to.overrides && this.#to.edgesOut.size && OverrideSet.doOverrideSetsConflict(this.overrides, this.#to.overrides)) {\n // Check for conflicts between the edge's override set and the target node's override set.\n // This catches cases where different parts of the tree have genuinely incompatible\n // version requirements for the same package.\n // The improved conflict detection uses semantic comparison (checking for incompatible\n // version ranges) rather than pure structural equality, avoiding false positives from:\n // - Reference overrides ($syntax) that resolve to compatible versions\n // - Peer dependencies with different but compatible override contexts\n // Note: We only check if the target has dependencies (edgesOut.size > 0), since\n // override conflicts are only relevant if the target has its own dependencies.\n this.#error = 'INVALID'\n } else {\n this.#error = 'OK'\n }\n }\n if (this.#error === 'OK') {\n return null\n }\n return this.#error\n }\n\n reload (hard = false) {\n this.#explanation = null\n\n let needToUpdateOverrideSet = false\n let newOverrideSet\n let oldOverrideSet\n if (this.#from?.overrides) {\n newOverrideSet = this.#from.overrides.getEdgeRule(this)\n if (newOverrideSet && !newOverrideSet.isEqual(this.overrides)) {\n // If there's a new different override set we need to propagate it to the nodes.\n // If we're deleting the override set then there's no point propagating it right now since it will be filled with another value later.\n needToUpdateOverrideSet = true\n oldOverrideSet = this.overrides\n this.overrides = newOverrideSet\n }\n } else {\n delete this.overrides\n }\n const newTo = this.#from?.resolve(this.#name)\n if (newTo !== this.#to) {\n if (this.#to) {\n this.#to.deleteEdgeIn(this)\n }\n this.#to = newTo\n this.#error = null\n if (this.#to) {\n this.#to.addEdgeIn(this)\n }\n } else if (hard) {\n this.#error = null\n } else if (needToUpdateOverrideSet && this.#to) {\n // Propagate the new override set to the target node.\n this.#to.updateOverridesEdgeInRemoved(oldOverrideSet)\n this.#to.updateOverridesEdgeInAdded(newOverrideSet)\n }\n }\n\n detach () {\n this.#explanation = null\n if (this.#to) {\n this.#to.deleteEdgeIn(this)\n }\n this.#from?.edgesOut.delete(this.#name)\n this.#to = null\n this.#error = 'DETACHED'\n this.#from = null\n }\n\n get from () {\n return this.#from\n }\n\n get to () {\n return this.#to\n }\n\n toJSON () {\n return new ArboristEdge(this)\n }\n\n [util.inspect.custom] () {\n return this.toJSON()\n }\n}\n\nmodule.exports = Edge\n","// a class to manage an inventory and set of indexes of a set of objects based on specific fields.\nconst { hasOwnProperty } = Object.prototype\nconst debug = require('./debug.js')\n\nconst keys = ['name', 'license', 'funding', 'realpath', 'packageName']\nclass Inventory extends Map {\n #index\n\n constructor () {\n super()\n this.#index = new Map()\n for (const key of keys) {\n this.#index.set(key, new Map())\n }\n }\n\n // XXX where is this used?\n get primaryKey () {\n return 'location'\n }\n\n // XXX where is this used?\n get indexes () {\n return [...keys]\n }\n\n * filter (fn) {\n for (const node of this.values()) {\n if (fn(node)) {\n yield node\n }\n }\n }\n\n add (node) {\n const root = super.get('')\n if (root && node.root !== root && node.root !== root.root) {\n debug(() => {\n throw Object.assign(new Error('adding external node to inventory'), {\n root: root.path,\n node: node.path,\n nodeRoot: node.root.path,\n })\n })\n return\n }\n\n const current = super.get(node.location)\n if (current) {\n if (current === node) {\n return\n }\n this.delete(current)\n }\n super.set(node.location, node)\n for (const [key, map] of this.#index.entries()) {\n let val\n if (hasOwnProperty.call(node, key)) {\n // if the node has the value, use it even if it's false\n val = node[key]\n } else if (key === 'license' && node.package) {\n // handling for the outdated \"licenses\" array, just pick the first one\n // also support the alternative spelling \"licence\"\n if (node.package.license) {\n val = node.package.license\n } else if (node.package.licence) {\n val = node.package.licence\n } else if (Array.isArray(node.package.licenses)) {\n val = node.package.licenses[0]\n } else if (Array.isArray(node.package.licences)) {\n val = node.package.licences[0]\n }\n } else if (node[key]) {\n val = node[key]\n } else {\n val = node.package?.[key]\n }\n if (val && typeof val === 'object') {\n // We currently only use license and funding\n /* istanbul ignore next - not used */\n if (key === 'license') {\n val = val.type\n } else if (key === 'funding') {\n val = val.url\n }\n }\n if (!map.has(val)) {\n map.set(val, new Set())\n }\n map.get(val).add(node)\n }\n }\n\n delete (node) {\n if (!this.has(node)) {\n return\n }\n\n super.delete(node.location)\n for (const [key, map] of this.#index.entries()) {\n let val\n if (node[key] !== undefined) {\n val = node[key]\n } else {\n val = node.package?.[key]\n }\n const set = map.get(val)\n if (set) {\n set.delete(node)\n if (set.size === 0) {\n map.delete(node[key])\n }\n }\n }\n }\n\n query (key, val) {\n const map = this.#index.get(key)\n if (arguments.length === 2) {\n if (map.has(val)) {\n return map.get(val)\n }\n return new Set()\n }\n return map.keys()\n }\n\n has (node) {\n return super.get(node.location) === node\n }\n\n set () {\n throw new Error('direct set() not supported, use inventory.add(node)')\n }\n}\n\nmodule.exports = Inventory\n","// take a path and a resolved value, and turn it into a resolution from\n// the given new path. This is used with converting a package.json's\n// relative file: path into one suitable for a lockfile, or between\n// lockfiles, and for converting hosted git repos to a consistent url type.\nconst npa = require('npm-package-arg')\nconst relpath = require('./relpath.js')\nconst consistentResolve = (resolved, fromPath, toPath, relPaths = false) => {\n if (!resolved) {\n return null\n }\n\n try {\n const hostedOpt = { noCommittish: false }\n const {\n fetchSpec,\n saveSpec,\n type,\n hosted,\n rawSpec,\n raw,\n } = npa(resolved, fromPath)\n if (type === 'file' || type === 'directory') {\n if (relPaths && toPath) {\n return `file:${relpath(toPath, fetchSpec)}`\n }\n return `file:${fetchSpec}`\n }\n if (hosted) {\n return `git+${(hosted.auth || hosted.default === 'https') ? hosted.https(hostedOpt) : hosted.sshurl(hostedOpt)}`\n }\n if (type === 'git') {\n return saveSpec\n }\n if (rawSpec === '*') {\n return raw\n }\n return rawSpec\n } catch (_) {\n // whatever we passed in was not acceptable to npa.\n // leave it 100% untouched.\n return resolved\n }\n}\nmodule.exports = consistentResolve\n","// Given a set of nodes in a tree, and a filter function to test\n// incoming edges to the dep set that should be ignored otherwise.\n//\n// find the set of deps that are only depended upon by nodes in the set, or\n// their dependencies, or edges that are ignored.\n//\n// Used when figuring out what to prune when replacing a node with a newer\n// version, or when an optional dep fails to install.\n\nconst gatherDepSet = (set, edgeFilter) => {\n const deps = new Set(set)\n\n // add the full set of dependencies. note that this loop will continue\n // as the deps set increases in size.\n for (const node of deps) {\n for (const edge of node.edgesOut.values()) {\n if (edge.to && edgeFilter(edge)) {\n deps.add(edge.to)\n }\n }\n }\n\n // now remove all nodes in the set that have a dependent outside the set\n // if any change is made, then re-check\n // continue until no changes made, or deps set evaporates fully.\n let changed = true\n while (changed === true && deps.size > 0) {\n changed = false\n for (const dep of deps) {\n for (const edge of dep.edgesIn) {\n if (!deps.has(edge.from) && edgeFilter(edge)) {\n changed = true\n deps.delete(dep)\n break\n }\n }\n }\n }\n\n return deps\n}\n\nmodule.exports = gatherDepSet\n","// helper function to output a clearer visualization\n// of the current node and its descendents\nconst localeCompare = require('@isaacs/string-locale-compare')('en')\nconst util = require('node:util')\nconst relpath = require('./relpath.js')\n\nclass ArboristNode {\n constructor (tree, path) {\n this.name = tree.name\n if (tree.packageName && tree.packageName !== this.name) {\n this.packageName = tree.packageName\n }\n if (tree.version) {\n this.version = tree.version\n }\n this.location = tree.location\n this.path = tree.path\n if (tree.realpath !== this.path) {\n this.realpath = tree.realpath\n }\n if (tree.resolved !== null) {\n this.resolved = tree.resolved\n }\n if (tree.extraneous) {\n this.extraneous = true\n }\n if (tree.dev) {\n this.dev = true\n }\n if (tree.optional) {\n this.optional = true\n }\n if (tree.devOptional && !tree.dev && !tree.optional) {\n this.devOptional = true\n }\n if (tree.peer) {\n this.peer = true\n }\n if (tree.inBundle) {\n this.bundled = true\n }\n if (tree.inDepBundle) {\n this.bundler = tree.getBundler().location\n }\n if (tree.isProjectRoot) {\n this.isProjectRoot = true\n }\n if (tree.isWorkspace) {\n this.isWorkspace = true\n }\n const bd = tree.package && tree.package.bundleDependencies\n if (bd && bd.length) {\n this.bundleDependencies = bd\n }\n if (tree.error) {\n this.error = treeError(tree.error)\n }\n if (tree.errors && tree.errors.length) {\n this.errors = tree.errors.map(treeError)\n }\n\n if (tree.overrides) {\n this.overrides = new Map([...tree.overrides.ruleset.values()]\n .map((override) => [override.key, override.value]))\n }\n\n // edgesOut sorted by name\n if (tree.edgesOut.size) {\n this.edgesOut = new Map([...tree.edgesOut.entries()]\n .sort(([a], [b]) => localeCompare(a, b))\n .map(([name, edge]) => [name, new EdgeOut(edge)]))\n }\n\n // edgesIn sorted by location\n if (tree.edgesIn.size) {\n this.edgesIn = new Set([...tree.edgesIn]\n .sort((a, b) => localeCompare(a.from.location, b.from.location))\n .map(edge => new EdgeIn(edge)))\n }\n\n if (tree.workspaces && tree.workspaces.size) {\n this.workspaces = new Map([...tree.workspaces.entries()]\n .map(([name, path]) => [name, relpath(tree.root.realpath, path)]))\n }\n\n // fsChildren sorted by path\n if (tree.fsChildren.size) {\n this.fsChildren = new Set([...tree.fsChildren]\n .sort(({ path: a }, { path: b }) => localeCompare(a, b))\n .map(tree => printableTree(tree, path)))\n }\n\n // children sorted by name\n if (tree.children.size) {\n this.children = new Map([...tree.children.entries()]\n .sort(([a], [b]) => localeCompare(a, b))\n .map(([name, tree]) => [name, printableTree(tree, path)]))\n }\n }\n}\n\nclass ArboristVirtualNode extends ArboristNode {\n constructor (tree, path) {\n super(tree, path)\n this.sourceReference = printableTree(tree.sourceReference, path)\n }\n}\n\nclass ArboristLink extends ArboristNode {\n constructor (tree, path) {\n super(tree, path)\n this.target = printableTree(tree.target, path)\n }\n}\n\nconst treeError = ({ code, path }) => ({\n code,\n ...(path ? { path } : {}),\n})\n\n// print out edges without dumping the full node all over again\n// this base class will toJSON as a plain old object, but the\n// util.inspect() output will be a bit cleaner\nclass Edge {\n constructor (edge) {\n this.type = edge.type\n this.name = edge.name\n this.spec = edge.rawSpec || '*'\n if (edge.rawSpec !== edge.spec) {\n this.override = edge.spec\n }\n if (edge.error) {\n this.error = edge.error\n }\n if (edge.peerConflicted) {\n this.peerConflicted = edge.peerConflicted\n }\n }\n}\n\n// don't care about 'from' for edges out\nclass EdgeOut extends Edge {\n constructor (edge) {\n super(edge)\n this.to = edge.to && edge.to.location\n }\n\n [util.inspect.custom] () {\n return `{ ${this.type} ${this.name}@${this.spec}${\n this.override ? ` overridden:${this.override}` : ''\n }${\n this.to ? ' -> ' + this.to : ''\n }${\n this.error ? ' ' + this.error : ''\n }${\n this.peerConflicted ? ' peerConflicted' : ''\n } }`\n }\n}\n\n// don't care about 'to' for edges in\nclass EdgeIn extends Edge {\n constructor (edge) {\n super(edge)\n this.from = edge.from && edge.from.location\n }\n\n [util.inspect.custom] () {\n return `{ ${this.from || '\"\"'} ${this.type} ${this.name}@${this.spec}${\n this.error ? ' ' + this.error : ''\n }${\n this.peerConflicted ? ' peerConflicted' : ''\n } }`\n }\n}\n\nconst printableTree = (tree, path = []) => {\n if (!tree) {\n return tree\n }\n\n const Cls = tree.isLink ? ArboristLink\n : tree.sourceReference ? ArboristVirtualNode\n : ArboristNode\n if (path.includes(tree)) {\n const obj = Object.create(Cls.prototype)\n return Object.assign(obj, { location: tree.location })\n }\n path.push(tree)\n return new Cls(tree, path)\n}\n\nmodule.exports = printableTree\n","\"use strict\";\n// Many thanks for this post which made this migration much easier.\n// https://mathiasbynens.be/notes/css-escapes\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = unesc;\n/**\n *\n * @param {string} str\n * @returns {[string, number]|undefined}\n */\nfunction gobbleHex(str) {\n var lower = str.toLowerCase();\n var hex = \"\";\n var spaceTerminated = false;\n for (var i = 0; i < 6 && lower[i] !== undefined; i++) {\n var code = lower.charCodeAt(i);\n // check to see if we are dealing with a valid hex char [a-f|0-9]\n var valid = (code >= 97 && code <= 102) || (code >= 48 && code <= 57);\n // https://drafts.csswg.org/css-syntax/#consume-escaped-code-point\n spaceTerminated = code === 32;\n if (!valid) {\n break;\n }\n hex += lower[i];\n }\n if (hex.length === 0) {\n return undefined;\n }\n var codePoint = parseInt(hex, 16);\n var isSurrogate = codePoint >= 0xd800 && codePoint <= 0xdfff;\n // Add special case for\n // \"If this number is zero, or is for a surrogate, or is greater than the maximum allowed code point\"\n // https://drafts.csswg.org/css-syntax/#maximum-allowed-code-point\n if (isSurrogate || codePoint === 0x0000 || codePoint > 0x10ffff) {\n return [\"\\uFFFD\", hex.length + (spaceTerminated ? 1 : 0)];\n }\n return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)];\n}\nvar CONTAINS_ESCAPE = /\\\\/;\nfunction unesc(str) {\n var needToProcess = CONTAINS_ESCAPE.test(str);\n if (!needToProcess) {\n return str;\n }\n var ret = \"\";\n for (var i = 0; i < str.length; i++) {\n if (str[i] === \"\\\\\") {\n var gobbled = gobbleHex(str.slice(i + 1, i + 7));\n if (gobbled !== undefined) {\n ret += gobbled[0];\n i += gobbled[1];\n continue;\n }\n // Retain a pair of \\\\ if double escaped `\\\\\\\\`\n // https://github.com/postcss/postcss-selector-parser/commit/268c9a7656fb53f543dc620aa5b73a30ec3ff20e\n if (str[i + 1] === \"\\\\\") {\n ret += \"\\\\\";\n i++;\n continue;\n }\n // if \\\\ is at the end of the string retain it\n // https://github.com/postcss/postcss-selector-parser/commit/01a6b346e3612ce1ab20219acc26abdc259ccefb\n if (str.length === i + 1) {\n ret += str[i];\n }\n continue;\n }\n ret += str[i];\n }\n return ret;\n}\n//# sourceMappingURL=unesc.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = getProp;\nfunction getProp(obj) {\n var props = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n props[_i - 1] = arguments[_i];\n }\n while (props.length > 0) {\n var prop = props.shift();\n if (!obj[prop]) {\n return undefined;\n }\n obj = obj[prop];\n }\n return obj;\n}\n//# sourceMappingURL=getProp.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = ensureObject;\nfunction ensureObject(obj) {\n var props = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n props[_i - 1] = arguments[_i];\n }\n while (props.length > 0) {\n var prop = props.shift();\n if (!obj[prop]) {\n obj[prop] = {};\n }\n obj = obj[prop];\n }\n}\n//# sourceMappingURL=ensureObject.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = stripComments;\nfunction stripComments(str) {\n var s = \"\";\n var commentStart = str.indexOf(\"/*\");\n var lastEnd = 0;\n while (commentStart >= 0) {\n s = s + str.slice(lastEnd, commentStart);\n var commentEnd = str.indexOf(\"*/\", commentStart + 2);\n if (commentEnd < 0) {\n return s;\n }\n lastEnd = commentEnd + 2;\n commentStart = str.indexOf(\"/*\", lastEnd);\n }\n s = s + str.slice(lastEnd);\n return s;\n}\n//# sourceMappingURL=stripComments.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MAX_NESTING_DEPTH = void 0;\nexports.default = resolveMaxNestingDepth;\n/**\n * The default maximum selector nesting depth allowed when parsing or\n * serializing a selector. Going beyond this would otherwise recurse deeply\n * enough to overflow the call stack (CVE-2026-9358 / CWE-674). Real-world\n * selectors never get anywhere near this, so it acts purely as a safety net\n * that turns an uncatchable stack overflow into a catchable error.\n */\nexports.MAX_NESTING_DEPTH = 256;\n/**\n * Coerce a user-supplied nesting-depth limit into a safe value. Anything that\n * is not a non-negative safe integer (NaN, Infinity, negative numbers, or a\n * non-number) would disable or break the guard, so it falls back to the\n * default.\n *\n * @param {unknown} value the limit provided through the `maxNestingDepth` option\n * @returns {number} a safe, non-negative integer limit\n */\nfunction resolveMaxNestingDepth(value) {\n return Number.isSafeInteger(value) && value >= 0 ? value : exports.MAX_NESTING_DEPTH;\n}\n//# sourceMappingURL=maxNestingDepth.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MAX_NESTING_DEPTH = exports.resolveMaxNestingDepth = exports.stripComments = exports.ensureObject = exports.getProp = exports.unesc = void 0;\nvar unesc_1 = require(\"./unesc\");\nObject.defineProperty(exports, \"unesc\", { enumerable: true, get: function () { return __importDefault(unesc_1).default; } });\nvar getProp_1 = require(\"./getProp\");\nObject.defineProperty(exports, \"getProp\", { enumerable: true, get: function () { return __importDefault(getProp_1).default; } });\nvar ensureObject_1 = require(\"./ensureObject\");\nObject.defineProperty(exports, \"ensureObject\", { enumerable: true, get: function () { return __importDefault(ensureObject_1).default; } });\nvar stripComments_1 = require(\"./stripComments\");\nObject.defineProperty(exports, \"stripComments\", { enumerable: true, get: function () { return __importDefault(stripComments_1).default; } });\nvar maxNestingDepth_1 = require(\"./maxNestingDepth\");\nObject.defineProperty(exports, \"resolveMaxNestingDepth\", { enumerable: true, get: function () { return __importDefault(maxNestingDepth_1).default; } });\nObject.defineProperty(exports, \"MAX_NESTING_DEPTH\", { enumerable: true, get: function () { return maxNestingDepth_1.MAX_NESTING_DEPTH; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"../util\");\nvar cloneNode = function (obj, parent, depth) {\n if (depth === void 0) { depth = 0; }\n // Bound recursion so a pathologically deep node tree raises a catchable\n // error instead of overflowing the call stack (CVE-2026-9358 / CWE-674).\n if (depth > util_1.MAX_NESTING_DEPTH) {\n throw new Error(\"Cannot clone selector: nesting depth exceeds the maximum of \".concat(util_1.MAX_NESTING_DEPTH, \".\"));\n }\n if (typeof obj !== \"object\" || obj === null) {\n return obj;\n }\n var cloned = new obj.constructor();\n for (var i in obj) {\n if (!obj.hasOwnProperty(i)) {\n continue;\n }\n var value = obj[i];\n var type = typeof value;\n if (i === \"parent\" && type === \"object\") {\n if (parent) {\n cloned[i] = parent;\n }\n }\n else if (value instanceof Array) {\n cloned[i] = value.map(function (j) { return cloneNode(j, cloned, depth + 1); });\n }\n else {\n cloned[i] = cloneNode(value, cloned, depth + 1);\n }\n }\n return cloned;\n};\nvar Node = /** @class */ (function () {\n function Node(opts) {\n if (opts === void 0) { opts = {}; }\n Object.assign(this, opts);\n this.spaces = this.spaces || {};\n this.spaces.before = this.spaces.before || \"\";\n this.spaces.after = this.spaces.after || \"\";\n }\n Node.prototype.remove = function () {\n if (this.parent) {\n this.parent.removeChild(this);\n }\n this.parent = undefined;\n return this;\n };\n Node.prototype.replaceWith = function () {\n if (this.parent) {\n for (var index in arguments) {\n this.parent.insertBefore(this, arguments[index]);\n }\n this.remove();\n }\n return this;\n };\n Node.prototype.next = function () {\n return this.parent.at(this.parent.index(this) + 1);\n };\n Node.prototype.prev = function () {\n return this.parent.at(this.parent.index(this) - 1);\n };\n Node.prototype.clone = function (overrides) {\n if (overrides === void 0) { overrides = {}; }\n var cloned = cloneNode(this);\n for (var name in overrides) {\n cloned[name] = overrides[name];\n }\n return cloned;\n };\n /**\n * Some non-standard syntax doesn't follow normal escaping rules for css.\n * This allows non standard syntax to be appended to an existing property\n * by specifying the escaped value. By specifying the escaped value,\n * illegal characters are allowed to be directly inserted into css output.\n * @param {string} name the property to set\n * @param {any} value the unescaped value of the property\n * @param {string} valueEscaped optional. the escaped value of the property.\n */\n Node.prototype.appendToPropertyAndEscape = function (name, value, valueEscaped) {\n if (!this.raws) {\n this.raws = {};\n }\n var originalValue = this[name];\n var originalEscaped = this.raws[name];\n this[name] = originalValue + value; // this may trigger a setter that updates raws, so it has to be set first.\n if (originalEscaped || valueEscaped !== value) {\n this.raws[name] = (originalEscaped || originalValue) + valueEscaped;\n }\n else {\n delete this.raws[name]; // delete any escaped value that was created by the setter.\n }\n };\n /**\n * Some non-standard syntax doesn't follow normal escaping rules for css.\n * This allows the escaped value to be specified directly, allowing illegal\n * characters to be directly inserted into css output.\n * @param {string} name the property to set\n * @param {any} value the unescaped value of the property\n * @param {string} valueEscaped the escaped value of the property.\n */\n Node.prototype.setPropertyAndEscape = function (name, value, valueEscaped) {\n if (!this.raws) {\n this.raws = {};\n }\n this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.\n this.raws[name] = valueEscaped;\n };\n /**\n * When you want a value to passed through to CSS directly. This method\n * deletes the corresponding raw value causing the stringifier to fallback\n * to the unescaped value.\n * @param {string} name the property to set.\n * @param {any} value The value that is both escaped and unescaped.\n */\n Node.prototype.setPropertyWithoutEscape = function (name, value) {\n this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.\n if (this.raws) {\n delete this.raws[name];\n }\n };\n /**\n *\n * @param {number} line The number (starting with 1)\n * @param {number} column The column number (starting with 1)\n */\n Node.prototype.isAtPosition = function (line, column) {\n if (this.source && this.source.start && this.source.end) {\n if (this.source.start.line > line) {\n return false;\n }\n if (this.source.end.line < line) {\n return false;\n }\n if (this.source.start.line === line && this.source.start.column > column) {\n return false;\n }\n if (this.source.end.line === line && this.source.end.column < column) {\n return false;\n }\n return true;\n }\n return undefined;\n };\n Node.prototype.stringifyProperty = function (name) {\n return (this.raws && this.raws[name]) || this[name];\n };\n Object.defineProperty(Node.prototype, \"rawSpaceBefore\", {\n get: function () {\n var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before;\n if (rawSpace === undefined) {\n rawSpace = this.spaces && this.spaces.before;\n }\n return rawSpace || \"\";\n },\n set: function (raw) {\n (0, util_1.ensureObject)(this, \"raws\", \"spaces\");\n this.raws.spaces.before = raw;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"rawSpaceAfter\", {\n get: function () {\n var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after;\n if (rawSpace === undefined) {\n rawSpace = this.spaces.after;\n }\n return rawSpace || \"\";\n },\n set: function (raw) {\n (0, util_1.ensureObject)(this, \"raws\", \"spaces\");\n this.raws.spaces.after = raw;\n },\n enumerable: false,\n configurable: true\n });\n Node.prototype.valueToString = function () {\n return String(this.stringifyProperty(\"value\"));\n };\n Node.prototype.toString = function () {\n return [this.rawSpaceBefore, this.valueToString(), this.rawSpaceAfter].join(\"\");\n };\n // Internal recursion entry point used by Container serialization. Leaf\n // nodes don't recurse, so they ignore the depth/limit and stringify\n // themselves. Containers override this to thread the nesting depth.\n Node.prototype._stringify = function () {\n return this.toString();\n };\n return Node;\n}());\nexports.default = Node;\n//# sourceMappingURL=node.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UNIVERSAL = exports.ATTRIBUTE = exports.CLASS = exports.COMBINATOR = exports.COMMENT = exports.ID = exports.NESTING = exports.PSEUDO = exports.ROOT = exports.SELECTOR = exports.STRING = exports.TAG = void 0;\nexports.TAG = \"tag\";\nexports.STRING = \"string\";\nexports.SELECTOR = \"selector\";\nexports.ROOT = \"root\";\nexports.PSEUDO = \"pseudo\";\nexports.NESTING = \"nesting\";\nexports.ID = \"id\";\nexports.COMMENT = \"comment\";\nexports.COMBINATOR = \"combinator\";\nexports.CLASS = \"class\";\nexports.ATTRIBUTE = \"attribute\";\nexports.UNIVERSAL = \"universal\";\n//# sourceMappingURL=types.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"../util\");\nvar node_1 = __importDefault(require(\"./node\"));\nvar types = __importStar(require(\"./types\"));\nvar Container = /** @class */ (function (_super) {\n __extends(Container, _super);\n function Container(opts) {\n var _this = _super.call(this, opts) || this;\n if (!_this.nodes) {\n _this.nodes = [];\n }\n return _this;\n }\n Container.prototype.append = function (selector) {\n selector.parent = this;\n this.nodes.push(selector);\n return this;\n };\n Container.prototype.prepend = function (selector) {\n selector.parent = this;\n this.nodes.unshift(selector);\n for (var id in this.indexes) {\n this.indexes[id]++;\n }\n return this;\n };\n Container.prototype.at = function (index) {\n return this.nodes[index];\n };\n Container.prototype.index = function (child) {\n if (typeof child === \"number\") {\n return child;\n }\n return this.nodes.indexOf(child);\n };\n Object.defineProperty(Container.prototype, \"first\", {\n get: function () {\n return this.at(0);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Container.prototype, \"last\", {\n get: function () {\n return this.at(this.length - 1);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Container.prototype, \"length\", {\n get: function () {\n return this.nodes.length;\n },\n enumerable: false,\n configurable: true\n });\n Container.prototype.removeChild = function (child) {\n child = this.index(child);\n this.at(child).parent = undefined;\n this.nodes.splice(child, 1);\n var index;\n for (var id in this.indexes) {\n index = this.indexes[id];\n if (index >= child) {\n this.indexes[id] = index - 1;\n }\n }\n return this;\n };\n Container.prototype.removeAll = function () {\n var e_1, _a;\n try {\n for (var _b = __values(this.nodes), _c = _b.next(); !_c.done; _c = _b.next()) {\n var node = _c.value;\n node.parent = undefined;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n this.nodes = [];\n return this;\n };\n Container.prototype.empty = function () {\n return this.removeAll();\n };\n Container.prototype.insertAfter = function (oldNode, newNode) {\n var _a;\n newNode.parent = this;\n var oldIndex = this.index(oldNode);\n var resetNode = [];\n for (var i = 2; i < arguments.length; i++) {\n resetNode.push(arguments[i]);\n }\n (_a = this.nodes).splice.apply(_a, __spreadArray([oldIndex + 1, 0, newNode], __read(resetNode), false));\n newNode.parent = this;\n var index;\n for (var id in this.indexes) {\n index = this.indexes[id];\n if (oldIndex < index) {\n this.indexes[id] = index + arguments.length - 1;\n }\n }\n return this;\n };\n Container.prototype.insertBefore = function (oldNode, newNode) {\n var _a;\n newNode.parent = this;\n var oldIndex = this.index(oldNode);\n var resetNode = [];\n for (var i = 2; i < arguments.length; i++) {\n resetNode.push(arguments[i]);\n }\n (_a = this.nodes).splice.apply(_a, __spreadArray([oldIndex, 0, newNode], __read(resetNode), false));\n newNode.parent = this;\n var index;\n for (var id in this.indexes) {\n index = this.indexes[id];\n if (index >= oldIndex) {\n this.indexes[id] = index + arguments.length - 1;\n }\n }\n return this;\n };\n Container.prototype._findChildAtPosition = function (line, col) {\n var found = undefined;\n this.each(function (node) {\n if (node.atPosition) {\n var foundChild = node.atPosition(line, col);\n if (foundChild) {\n found = foundChild;\n return false;\n }\n }\n else if (node.isAtPosition(line, col)) {\n found = node;\n return false;\n }\n });\n return found;\n };\n /**\n * Return the most specific node at the line and column number given.\n * The source location is based on the original parsed location, locations aren't\n * updated as selector nodes are mutated.\n *\n * Note that this location is relative to the location of the first character\n * of the selector, and not the location of the selector in the overall document\n * when used in conjunction with postcss.\n *\n * If not found, returns undefined.\n * @param {number} line The line number of the node to find. (1-based index)\n * @param {number} col The column number of the node to find. (1-based index)\n */\n Container.prototype.atPosition = function (line, col) {\n if (this.isAtPosition(line, col)) {\n return this._findChildAtPosition(line, col) || this;\n }\n else {\n return undefined;\n }\n };\n Container.prototype._inferEndPosition = function () {\n if (this.last && this.last.source && this.last.source.end) {\n this.source = this.source || {};\n this.source.end = this.source.end || {};\n Object.assign(this.source.end, this.last.source.end);\n }\n };\n Container.prototype.each = function (callback) {\n if (!this.lastEach) {\n this.lastEach = 0;\n }\n if (!this.indexes) {\n this.indexes = {};\n }\n this.lastEach++;\n var id = this.lastEach;\n this.indexes[id] = 0;\n if (!this.length) {\n return undefined;\n }\n var index, result;\n while (this.indexes[id] < this.length) {\n index = this.indexes[id];\n result = callback(this.at(index), index);\n if (result === false) {\n break;\n }\n this.indexes[id] += 1;\n }\n delete this.indexes[id];\n if (result === false) {\n return false;\n }\n };\n Container.prototype.walk = function (callback, depth) {\n if (depth === void 0) { depth = 0; }\n // Bound recursion so a pathologically deep node tree raises a catchable\n // error instead of overflowing the call stack (CVE-2026-9358 / CWE-674).\n if (depth > util_1.MAX_NESTING_DEPTH) {\n throw new Error(\"Cannot walk selector: nesting depth exceeds the maximum of \".concat(util_1.MAX_NESTING_DEPTH, \".\"));\n }\n return this.each(function (node, i) {\n var result = callback(node, i);\n if (result !== false && node.length) {\n result = node.walk(callback, depth + 1);\n }\n if (result === false) {\n return false;\n }\n });\n };\n Container.prototype.walkAttributes = function (callback) {\n var _this = this;\n return this.walk(function (selector) {\n if (selector.type === types.ATTRIBUTE) {\n return callback.call(_this, selector);\n }\n });\n };\n Container.prototype.walkClasses = function (callback) {\n var _this = this;\n return this.walk(function (selector) {\n if (selector.type === types.CLASS) {\n return callback.call(_this, selector);\n }\n });\n };\n Container.prototype.walkCombinators = function (callback) {\n var _this = this;\n return this.walk(function (selector) {\n if (selector.type === types.COMBINATOR) {\n return callback.call(_this, selector);\n }\n });\n };\n Container.prototype.walkComments = function (callback) {\n var _this = this;\n return this.walk(function (selector) {\n if (selector.type === types.COMMENT) {\n return callback.call(_this, selector);\n }\n });\n };\n Container.prototype.walkIds = function (callback) {\n var _this = this;\n return this.walk(function (selector) {\n if (selector.type === types.ID) {\n return callback.call(_this, selector);\n }\n });\n };\n Container.prototype.walkNesting = function (callback) {\n var _this = this;\n return this.walk(function (selector) {\n if (selector.type === types.NESTING) {\n return callback.call(_this, selector);\n }\n });\n };\n Container.prototype.walkPseudos = function (callback) {\n var _this = this;\n return this.walk(function (selector) {\n if (selector.type === types.PSEUDO) {\n return callback.call(_this, selector);\n }\n });\n };\n Container.prototype.walkTags = function (callback) {\n var _this = this;\n return this.walk(function (selector) {\n if (selector.type === types.TAG) {\n return callback.call(_this, selector);\n }\n });\n };\n Container.prototype.walkUniversals = function (callback) {\n var _this = this;\n return this.walk(function (selector) {\n if (selector.type === types.UNIVERSAL) {\n return callback.call(_this, selector);\n }\n });\n };\n Container.prototype.split = function (callback) {\n var _this = this;\n var current = [];\n return this.reduce(function (memo, node, index) {\n var split = callback.call(_this, node);\n current.push(node);\n if (split) {\n memo.push(current);\n current = [];\n }\n else if (index === _this.length - 1) {\n memo.push(current);\n }\n return memo;\n }, []);\n };\n Container.prototype.map = function (callback) {\n return this.nodes.map(callback);\n };\n Container.prototype.reduce = function (callback, memo) {\n return this.nodes.reduce(callback, memo);\n };\n Container.prototype.every = function (callback) {\n return this.nodes.every(callback);\n };\n Container.prototype.some = function (callback) {\n return this.nodes.some(callback);\n };\n Container.prototype.filter = function (callback) {\n return this.nodes.filter(callback);\n };\n Container.prototype.sort = function (callback) {\n return this.nodes.sort(callback);\n };\n Container.prototype.toString = function (options) {\n if (options === void 0) { options = {}; }\n return this._stringify(options, 0, (0, util_1.resolveMaxNestingDepth)(options.maxNestingDepth));\n };\n Container.prototype._stringify = function (options, depth, max) {\n var _this = this;\n return this.map(function (child) { return _this._stringifyChild(child, options, depth, max); }).join(\"\");\n };\n // Serialize a child node. Historically `toString` used `this.map(String)`,\n // which leniently coerced anything — including raw arrays inserted via\n // `replaceWith(array)` / `insertBefore` / `insertAfter` (e.g. Tailwind's\n // `:merge()` expansion). Fall back to `String(child)` for values that are not\n // parser nodes so that behaviour is preserved.\n Container.prototype._stringifyChild = function (child, options, depth, max) {\n return typeof child._stringify === \"function\"\n ? child._stringify(options, depth, max)\n : String(child);\n };\n return Container;\n}(node_1.default));\nexports.default = Container;\n//# sourceMappingURL=container.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = __importDefault(require(\"./container\"));\nvar types_1 = require(\"./types\");\nvar Root = /** @class */ (function (_super) {\n __extends(Root, _super);\n function Root(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = types_1.ROOT;\n return _this;\n }\n Root.prototype._stringify = function (options, depth, max) {\n var _this = this;\n var str = this.reduce(function (memo, selector) {\n memo.push(_this._stringifyChild(selector, options, depth, max));\n return memo;\n }, []).join(\",\");\n return this.trailingComma ? str + \",\" : str;\n };\n Root.prototype.error = function (message, options) {\n if (this._error) {\n return this._error(message, options);\n }\n else {\n return new Error(message);\n }\n };\n Object.defineProperty(Root.prototype, \"errorGenerator\", {\n set: function (handler) {\n this._error = handler;\n },\n enumerable: false,\n configurable: true\n });\n return Root;\n}(container_1.default));\nexports.default = Root;\n//# sourceMappingURL=root.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = __importDefault(require(\"./container\"));\nvar types_1 = require(\"./types\");\nvar Selector = /** @class */ (function (_super) {\n __extends(Selector, _super);\n function Selector(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = types_1.SELECTOR;\n return _this;\n }\n return Selector;\n}(container_1.default));\nexports.default = Selector;\n//# sourceMappingURL=selector.js.map","/*! https://mths.be/cssesc v3.0.0 by @mathias */\n'use strict';\n\nvar object = {};\nvar hasOwnProperty = object.hasOwnProperty;\nvar merge = function merge(options, defaults) {\n\tif (!options) {\n\t\treturn defaults;\n\t}\n\tvar result = {};\n\tfor (var key in defaults) {\n\t\t// `if (defaults.hasOwnProperty(key) { … }` is not needed here, since\n\t\t// only recognized option names are used.\n\t\tresult[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key];\n\t}\n\treturn result;\n};\n\nvar regexAnySingleEscape = /[ -,\\.\\/:-@\\[-\\^`\\{-~]/;\nvar regexSingleEscape = /[ -,\\.\\/:-@\\[\\]\\^`\\{-~]/;\nvar regexAlwaysEscape = /['\"\\\\]/;\nvar regexExcessiveSpaces = /(^|\\\\+)?(\\\\[A-F0-9]{1,6})\\x20(?![a-fA-F0-9\\x20])/g;\n\n// https://mathiasbynens.be/notes/css-escapes#css\nvar cssesc = function cssesc(string, options) {\n\toptions = merge(options, cssesc.options);\n\tif (options.quotes != 'single' && options.quotes != 'double') {\n\t\toptions.quotes = 'single';\n\t}\n\tvar quote = options.quotes == 'double' ? '\"' : '\\'';\n\tvar isIdentifier = options.isIdentifier;\n\n\tvar firstChar = string.charAt(0);\n\tvar output = '';\n\tvar counter = 0;\n\tvar length = string.length;\n\twhile (counter < length) {\n\t\tvar character = string.charAt(counter++);\n\t\tvar codePoint = character.charCodeAt();\n\t\tvar value = void 0;\n\t\t// If it’s not a printable ASCII character…\n\t\tif (codePoint < 0x20 || codePoint > 0x7E) {\n\t\t\tif (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) {\n\t\t\t\t// It’s a high surrogate, and there is a next character.\n\t\t\t\tvar extra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) {\n\t\t\t\t\t// next character is low surrogate\n\t\t\t\t\tcodePoint = ((codePoint & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000;\n\t\t\t\t} else {\n\t\t\t\t\t// It’s an unmatched surrogate; only append this code unit, in case\n\t\t\t\t\t// the next code unit is the high surrogate of a surrogate pair.\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' ';\n\t\t} else {\n\t\t\tif (options.escapeEverything) {\n\t\t\t\tif (regexAnySingleEscape.test(character)) {\n\t\t\t\t\tvalue = '\\\\' + character;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' ';\n\t\t\t\t}\n\t\t\t} else if (/[\\t\\n\\f\\r\\x0B]/.test(character)) {\n\t\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' ';\n\t\t\t} else if (character == '\\\\' || !isIdentifier && (character == '\"' && quote == character || character == '\\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) {\n\t\t\t\tvalue = '\\\\' + character;\n\t\t\t} else {\n\t\t\t\tvalue = character;\n\t\t\t}\n\t\t}\n\t\toutput += value;\n\t}\n\n\tif (isIdentifier) {\n\t\tif (/^-[-\\d]/.test(output)) {\n\t\t\toutput = '\\\\-' + output.slice(1);\n\t\t} else if (/\\d/.test(firstChar)) {\n\t\t\toutput = '\\\\3' + firstChar + ' ' + output.slice(1);\n\t\t}\n\t}\n\n\t// Remove spaces after `\\HEX` escapes that are not followed by a hex digit,\n\t// since they’re redundant. Note that this is only possible if the escape\n\t// sequence isn’t preceded by an odd number of backslashes.\n\toutput = output.replace(regexExcessiveSpaces, function ($0, $1, $2) {\n\t\tif ($1 && $1.length % 2) {\n\t\t\t// It’s not safe to remove the space, so don’t.\n\t\t\treturn $0;\n\t\t}\n\t\t// Strip the space.\n\t\treturn ($1 || '') + $2;\n\t});\n\n\tif (!isIdentifier && options.wrap) {\n\t\treturn quote + output + quote;\n\t}\n\treturn output;\n};\n\n// Expose default options (so they can be overridden globally).\ncssesc.options = {\n\t'escapeEverything': false,\n\t'isIdentifier': false,\n\t'quotes': 'single',\n\t'wrap': false\n};\n\ncssesc.version = '3.0.0';\n\nmodule.exports = cssesc;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar cssesc_1 = __importDefault(require(\"cssesc\"));\nvar util_1 = require(\"../util\");\nvar node_1 = __importDefault(require(\"./node\"));\nvar types_1 = require(\"./types\");\nvar ClassName = /** @class */ (function (_super) {\n __extends(ClassName, _super);\n function ClassName(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = types_1.CLASS;\n _this._constructed = true;\n return _this;\n }\n Object.defineProperty(ClassName.prototype, \"value\", {\n get: function () {\n return this._value;\n },\n set: function (v) {\n if (this._constructed) {\n var escaped = (0, cssesc_1.default)(v, { isIdentifier: true });\n if (escaped !== v) {\n (0, util_1.ensureObject)(this, \"raws\");\n this.raws.value = escaped;\n }\n else if (this.raws) {\n delete this.raws.value;\n }\n }\n this._value = v;\n },\n enumerable: false,\n configurable: true\n });\n ClassName.prototype.valueToString = function () {\n return \".\" + _super.prototype.valueToString.call(this);\n };\n return ClassName;\n}(node_1.default));\nexports.default = ClassName;\n//# sourceMappingURL=className.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar node_1 = __importDefault(require(\"./node\"));\nvar types_1 = require(\"./types\");\nvar Comment = /** @class */ (function (_super) {\n __extends(Comment, _super);\n function Comment(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = types_1.COMMENT;\n return _this;\n }\n return Comment;\n}(node_1.default));\nexports.default = Comment;\n//# sourceMappingURL=comment.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar node_1 = __importDefault(require(\"./node\"));\nvar types_1 = require(\"./types\");\nvar ID = /** @class */ (function (_super) {\n __extends(ID, _super);\n function ID(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = types_1.ID;\n return _this;\n }\n ID.prototype.valueToString = function () {\n return \"#\" + _super.prototype.valueToString.call(this);\n };\n return ID;\n}(node_1.default));\nexports.default = ID;\n//# sourceMappingURL=id.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar cssesc_1 = __importDefault(require(\"cssesc\"));\nvar util_1 = require(\"../util\");\nvar node_1 = __importDefault(require(\"./node\"));\nvar Namespace = /** @class */ (function (_super) {\n __extends(Namespace, _super);\n function Namespace() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(Namespace.prototype, \"namespace\", {\n get: function () {\n return this._namespace;\n },\n set: function (namespace) {\n if (namespace === true || namespace === \"*\" || namespace === \"&\") {\n this._namespace = namespace;\n if (this.raws) {\n delete this.raws.namespace;\n }\n return;\n }\n var escaped = (0, cssesc_1.default)(namespace, { isIdentifier: true });\n this._namespace = namespace;\n if (escaped !== namespace) {\n (0, util_1.ensureObject)(this, \"raws\");\n this.raws.namespace = escaped;\n }\n else if (this.raws) {\n delete this.raws.namespace;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Namespace.prototype, \"ns\", {\n get: function () {\n return this._namespace;\n },\n set: function (namespace) {\n this.namespace = namespace;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Namespace.prototype, \"namespaceString\", {\n get: function () {\n if (this.namespace) {\n var ns = this.stringifyProperty(\"namespace\");\n if (ns === true) {\n return \"\";\n }\n else {\n return ns;\n }\n }\n else {\n return \"\";\n }\n },\n enumerable: false,\n configurable: true\n });\n Namespace.prototype.qualifiedName = function (value) {\n if (this.namespace) {\n return \"\".concat(this.namespaceString, \"|\").concat(value);\n }\n else {\n return value;\n }\n };\n Namespace.prototype.valueToString = function () {\n return this.qualifiedName(_super.prototype.valueToString.call(this));\n };\n return Namespace;\n}(node_1.default));\nexports.default = Namespace;\n//# sourceMappingURL=namespace.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar namespace_1 = __importDefault(require(\"./namespace\"));\nvar types_1 = require(\"./types\");\nvar Tag = /** @class */ (function (_super) {\n __extends(Tag, _super);\n function Tag(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = types_1.TAG;\n return _this;\n }\n return Tag;\n}(namespace_1.default));\nexports.default = Tag;\n//# sourceMappingURL=tag.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar node_1 = __importDefault(require(\"./node\"));\nvar types_1 = require(\"./types\");\nvar String = /** @class */ (function (_super) {\n __extends(String, _super);\n function String(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = types_1.STRING;\n return _this;\n }\n return String;\n}(node_1.default));\nexports.default = String;\n//# sourceMappingURL=string.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = __importDefault(require(\"./container\"));\nvar types_1 = require(\"./types\");\nvar Pseudo = /** @class */ (function (_super) {\n __extends(Pseudo, _super);\n function Pseudo(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = types_1.PSEUDO;\n return _this;\n }\n Pseudo.prototype._stringify = function (options, depth, max) {\n var _this = this;\n if (depth >= max) {\n throw new Error(\"Cannot serialize selector: nesting depth exceeds the maximum of \".concat(max, \".\"));\n }\n var params = this.length\n ? \"(\" +\n this.map(function (child) { return _this._stringifyChild(child, options, depth + 1, max); }).join(\",\") +\n \")\"\n : \"\";\n return [this.rawSpaceBefore, this.stringifyProperty(\"value\"), params, this.rawSpaceAfter].join(\"\");\n };\n return Pseudo;\n}(container_1.default));\nexports.default = Pseudo;\n//# sourceMappingURL=pseudo.js.map","\n/**\n * For Node.js, simply re-export the core `util.deprecate` function.\n */\n\nmodule.exports = require('util').deprecate;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unescapeValue = unescapeValue;\nvar cssesc_1 = __importDefault(require(\"cssesc\"));\nvar unesc_1 = __importDefault(require(\"../util/unesc\"));\nvar namespace_1 = __importDefault(require(\"./namespace\"));\nvar types_1 = require(\"./types\");\nvar deprecate = require(\"util-deprecate\");\nvar WRAPPED_IN_QUOTES = /^('|\")([^]*)\\1$/;\nvar warnOfDeprecatedValueAssignment = deprecate(function () { }, \"Assigning an attribute a value containing characters that might need to be escaped is deprecated. \" +\n \"Call attribute.setValue() instead.\");\nvar warnOfDeprecatedQuotedAssignment = deprecate(function () { }, \"Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead.\");\nvar warnOfDeprecatedConstructor = deprecate(function () { }, \"Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now.\");\nfunction unescapeValue(value) {\n var deprecatedUsage = false;\n var quoteMark = null;\n var unescaped = value;\n var m = unescaped.match(WRAPPED_IN_QUOTES);\n if (m) {\n quoteMark = m[1];\n unescaped = m[2];\n }\n unescaped = (0, unesc_1.default)(unescaped);\n if (unescaped !== value) {\n deprecatedUsage = true;\n }\n return {\n deprecatedUsage: deprecatedUsage,\n unescaped: unescaped,\n quoteMark: quoteMark,\n };\n}\nfunction handleDeprecatedContructorOpts(opts) {\n if (opts.quoteMark !== undefined) {\n return opts;\n }\n if (opts.value === undefined) {\n return opts;\n }\n warnOfDeprecatedConstructor();\n var _a = unescapeValue(opts.value), quoteMark = _a.quoteMark, unescaped = _a.unescaped;\n if (!opts.raws) {\n opts.raws = {};\n }\n if (opts.raws.value === undefined) {\n opts.raws.value = opts.value;\n }\n opts.value = unescaped;\n opts.quoteMark = quoteMark;\n return opts;\n}\nvar Attribute = /** @class */ (function (_super) {\n __extends(Attribute, _super);\n function Attribute(opts) {\n if (opts === void 0) { opts = {}; }\n var _this = _super.call(this, handleDeprecatedContructorOpts(opts)) || this;\n _this.type = types_1.ATTRIBUTE;\n _this.raws = _this.raws || {};\n Object.defineProperty(_this.raws, \"unquoted\", {\n get: deprecate(function () { return _this.value; }, \"attr.raws.unquoted is deprecated. Call attr.value instead.\"),\n set: deprecate(function () { return _this.value; }, \"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.\"),\n });\n _this._constructed = true;\n return _this;\n }\n /**\n * Returns the Attribute's value quoted such that it would be legal to use\n * in the value of a css file. The original value's quotation setting\n * used for stringification is left unchanged. See `setValue(value, options)`\n * if you want to control the quote settings of a new value for the attribute.\n *\n * You can also change the quotation used for the current value by setting quoteMark.\n *\n * Options:\n * * quoteMark {'\"' | \"'\" | null} - Use this value to quote the value. If this\n * option is not set, the original value for quoteMark will be used. If\n * indeterminate, a double quote is used. The legal values are:\n * * `null` - the value will be unquoted and characters will be escaped as necessary.\n * * `'` - the value will be quoted with a single quote and single quotes are escaped.\n * * `\"` - the value will be quoted with a double quote and double quotes are escaped.\n * * preferCurrentQuoteMark {boolean} - if true, prefer the source quote mark\n * over the quoteMark option value.\n * * smart {boolean} - if true, will select a quote mark based on the value\n * and the other options specified here. See the `smartQuoteMark()`\n * method.\n **/\n Attribute.prototype.getQuotedValue = function (options) {\n if (options === void 0) { options = {}; }\n var quoteMark = this._determineQuoteMark(options);\n var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark];\n var escaped = (0, cssesc_1.default)(this._value, cssescopts);\n return escaped;\n };\n Attribute.prototype._determineQuoteMark = function (options) {\n return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options);\n };\n /**\n * Set the unescaped value with the specified quotation options. The value\n * provided must not include any wrapping quote marks -- those quotes will\n * be interpreted as part of the value and escaped accordingly.\n */\n Attribute.prototype.setValue = function (value, options) {\n if (options === void 0) { options = {}; }\n this._value = value;\n this._quoteMark = this._determineQuoteMark(options);\n this._syncRawValue();\n };\n /**\n * Intelligently select a quoteMark value based on the value's contents. If\n * the value is a legal CSS ident, it will not be quoted. Otherwise a quote\n * mark will be picked that minimizes the number of escapes.\n *\n * If there's no clear winner, the quote mark from these options is used,\n * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is\n * true). If the quoteMark is unspecified, a double quote is used.\n *\n * @param options This takes the quoteMark and preferCurrentQuoteMark options\n * from the quoteValue method.\n */\n Attribute.prototype.smartQuoteMark = function (options) {\n var v = this.value;\n var numSingleQuotes = v.replace(/[^']/g, \"\").length;\n var numDoubleQuotes = v.replace(/[^\"]/g, \"\").length;\n if (numSingleQuotes + numDoubleQuotes === 0) {\n var escaped = (0, cssesc_1.default)(v, { isIdentifier: true });\n if (escaped === v) {\n return Attribute.NO_QUOTE;\n }\n else {\n var pref = this.preferredQuoteMark(options);\n if (pref === Attribute.NO_QUOTE) {\n // pick a quote mark that isn't none and see if it's smaller\n var quote = this.quoteMark || options.quoteMark || Attribute.DOUBLE_QUOTE;\n var opts = CSSESC_QUOTE_OPTIONS[quote];\n var quoteValue = (0, cssesc_1.default)(v, opts);\n if (quoteValue.length < escaped.length) {\n return quote;\n }\n }\n return pref;\n }\n }\n else if (numDoubleQuotes === numSingleQuotes) {\n return this.preferredQuoteMark(options);\n }\n else if (numDoubleQuotes < numSingleQuotes) {\n return Attribute.DOUBLE_QUOTE;\n }\n else {\n return Attribute.SINGLE_QUOTE;\n }\n };\n /**\n * Selects the preferred quote mark based on the options and the current quote mark value.\n * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)`\n * instead.\n */\n Attribute.prototype.preferredQuoteMark = function (options) {\n var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark;\n if (quoteMark === undefined) {\n quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark;\n }\n if (quoteMark === undefined) {\n quoteMark = Attribute.DOUBLE_QUOTE;\n }\n return quoteMark;\n };\n Object.defineProperty(Attribute.prototype, \"quoted\", {\n get: function () {\n var qm = this.quoteMark;\n return qm === \"'\" || qm === '\"';\n },\n set: function (value) {\n warnOfDeprecatedQuotedAssignment();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Attribute.prototype, \"quoteMark\", {\n /**\n * returns a single (`'`) or double (`\"`) quote character if the value is quoted.\n * returns `null` if the value is not quoted.\n * returns `undefined` if the quotation state is unknown (this can happen when\n * the attribute is constructed without specifying a quote mark.)\n */\n get: function () {\n return this._quoteMark;\n },\n /**\n * Set the quote mark to be used by this attribute's value.\n * If the quote mark changes, the raw (escaped) value at `attr.raws.value` of the attribute\n * value is updated accordingly.\n *\n * @param {\"'\" | '\"' | null} quoteMark The quote mark or `null` if the value should be unquoted.\n */\n set: function (quoteMark) {\n if (!this._constructed) {\n this._quoteMark = quoteMark;\n return;\n }\n if (this._quoteMark !== quoteMark) {\n this._quoteMark = quoteMark;\n this._syncRawValue();\n }\n },\n enumerable: false,\n configurable: true\n });\n Attribute.prototype._syncRawValue = function () {\n var rawValue = (0, cssesc_1.default)(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]);\n if (rawValue === this._value) {\n if (this.raws) {\n delete this.raws.value;\n }\n }\n else {\n this.raws.value = rawValue;\n }\n };\n Object.defineProperty(Attribute.prototype, \"qualifiedAttribute\", {\n get: function () {\n return this.qualifiedName(this.raws.attribute || this.attribute);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Attribute.prototype, \"insensitiveFlag\", {\n get: function () {\n return this.insensitive ? \"i\" : \"\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Attribute.prototype, \"value\", {\n get: function () {\n return this._value;\n },\n /**\n * Before 3.0, the value had to be set to an escaped value including any wrapped\n * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value\n * is unescaped during parsing and any quote marks are removed.\n *\n * Because the ambiguity of this semantic change, if you set `attr.value = newValue`,\n * a deprecation warning is raised when the new value contains any characters that would\n * require escaping (including if it contains wrapped quotes).\n *\n * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe\n * how the new value is quoted.\n */\n set: function (v) {\n if (this._constructed) {\n var _a = unescapeValue(v), deprecatedUsage = _a.deprecatedUsage, unescaped = _a.unescaped, quoteMark = _a.quoteMark;\n if (deprecatedUsage) {\n warnOfDeprecatedValueAssignment();\n }\n if (unescaped === this._value && quoteMark === this._quoteMark) {\n return;\n }\n this._value = unescaped;\n this._quoteMark = quoteMark;\n this._syncRawValue();\n }\n else {\n this._value = v;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Attribute.prototype, \"insensitive\", {\n get: function () {\n return this._insensitive;\n },\n /**\n * Set the case insensitive flag.\n * If the case insensitive flag changes, the raw (escaped) value at `attr.raws.insensitiveFlag`\n * of the attribute is updated accordingly.\n *\n * @param {true | false} insensitive true if the attribute should match case-insensitively.\n */\n set: function (insensitive) {\n if (!insensitive) {\n this._insensitive = false;\n // \"i\" and \"I\" can be used in \"this.raws.insensitiveFlag\" to store the original notation.\n // When setting `attr.insensitive = false` both should be erased to ensure correct serialization.\n if (this.raws && (this.raws.insensitiveFlag === \"I\" || this.raws.insensitiveFlag === \"i\")) {\n this.raws.insensitiveFlag = undefined;\n }\n }\n this._insensitive = insensitive;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Attribute.prototype, \"attribute\", {\n get: function () {\n return this._attribute;\n },\n set: function (name) {\n this._handleEscapes(\"attribute\", name);\n this._attribute = name;\n },\n enumerable: false,\n configurable: true\n });\n Attribute.prototype._handleEscapes = function (prop, value) {\n if (this._constructed) {\n var escaped = (0, cssesc_1.default)(value, { isIdentifier: true });\n if (escaped !== value) {\n this.raws[prop] = escaped;\n }\n else {\n delete this.raws[prop];\n }\n }\n };\n Attribute.prototype._spacesFor = function (name) {\n var attrSpaces = { before: \"\", after: \"\" };\n var spaces = this.spaces[name] || {};\n var rawSpaces = (this.raws.spaces && this.raws.spaces[name]) || {};\n return Object.assign(attrSpaces, spaces, rawSpaces);\n };\n Attribute.prototype._stringFor = function (name, spaceName, concat) {\n if (spaceName === void 0) { spaceName = name; }\n if (concat === void 0) { concat = defaultAttrConcat; }\n var attrSpaces = this._spacesFor(spaceName);\n return concat(this.stringifyProperty(name), attrSpaces);\n };\n /**\n * returns the offset of the attribute part specified relative to the\n * start of the node of the output string.\n *\n * * \"ns\" - alias for \"namespace\"\n * * \"namespace\" - the namespace if it exists.\n * * \"attribute\" - the attribute name\n * * \"attributeNS\" - the start of the attribute or its namespace\n * * \"operator\" - the match operator of the attribute\n * * \"value\" - The value (string or identifier)\n * * \"insensitive\" - the case insensitivity flag;\n * @param part One of the possible values inside an attribute.\n * @returns -1 if the name is invalid or the value doesn't exist in this attribute.\n */\n Attribute.prototype.offsetOf = function (name) {\n var count = 1;\n var attributeSpaces = this._spacesFor(\"attribute\");\n count += attributeSpaces.before.length;\n if (name === \"namespace\" || name === \"ns\") {\n return this.namespace ? count : -1;\n }\n if (name === \"attributeNS\") {\n return count;\n }\n count += this.namespaceString.length;\n if (this.namespace) {\n count += 1;\n }\n if (name === \"attribute\") {\n return count;\n }\n count += this.stringifyProperty(\"attribute\").length;\n count += attributeSpaces.after.length;\n var operatorSpaces = this._spacesFor(\"operator\");\n count += operatorSpaces.before.length;\n var operator = this.stringifyProperty(\"operator\");\n if (name === \"operator\") {\n return operator ? count : -1;\n }\n count += operator.length;\n count += operatorSpaces.after.length;\n var valueSpaces = this._spacesFor(\"value\");\n count += valueSpaces.before.length;\n var value = this.stringifyProperty(\"value\");\n if (name === \"value\") {\n return value ? count : -1;\n }\n count += value.length;\n count += valueSpaces.after.length;\n var insensitiveSpaces = this._spacesFor(\"insensitive\");\n count += insensitiveSpaces.before.length;\n if (name === \"insensitive\") {\n return this.insensitive ? count : -1;\n }\n return -1;\n };\n Attribute.prototype.toString = function () {\n var _this = this;\n var selector = [this.rawSpaceBefore, \"[\"];\n selector.push(this._stringFor(\"qualifiedAttribute\", \"attribute\"));\n if (this.operator && (this.value || this.value === \"\")) {\n selector.push(this._stringFor(\"operator\"));\n selector.push(this._stringFor(\"value\"));\n selector.push(this._stringFor(\"insensitiveFlag\", \"insensitive\", function (attrValue, attrSpaces) {\n if (attrValue.length > 0 &&\n !_this.quoted &&\n attrSpaces.before.length === 0 &&\n !(_this.spaces.value && _this.spaces.value.after)) {\n attrSpaces.before = \" \";\n }\n return defaultAttrConcat(attrValue, attrSpaces);\n }));\n }\n selector.push(\"]\");\n selector.push(this.rawSpaceAfter);\n return selector.join(\"\");\n };\n Attribute.NO_QUOTE = null;\n Attribute.SINGLE_QUOTE = \"'\";\n Attribute.DOUBLE_QUOTE = '\"';\n return Attribute;\n}(namespace_1.default));\nexports.default = Attribute;\nvar CSSESC_QUOTE_OPTIONS = (_a = {\n \"'\": { quotes: \"single\", wrap: true },\n '\"': { quotes: \"double\", wrap: true }\n },\n _a[null] = { isIdentifier: true },\n _a);\nfunction defaultAttrConcat(attrValue, attrSpaces) {\n return \"\".concat(attrSpaces.before).concat(attrValue).concat(attrSpaces.after);\n}\n//# sourceMappingURL=attribute.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar namespace_1 = __importDefault(require(\"./namespace\"));\nvar types_1 = require(\"./types\");\nvar Universal = /** @class */ (function (_super) {\n __extends(Universal, _super);\n function Universal(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = types_1.UNIVERSAL;\n _this.value = \"*\";\n return _this;\n }\n return Universal;\n}(namespace_1.default));\nexports.default = Universal;\n//# sourceMappingURL=universal.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar node_1 = __importDefault(require(\"./node\"));\nvar types_1 = require(\"./types\");\nvar Combinator = /** @class */ (function (_super) {\n __extends(Combinator, _super);\n function Combinator(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = types_1.COMBINATOR;\n return _this;\n }\n return Combinator;\n}(node_1.default));\nexports.default = Combinator;\n//# sourceMappingURL=combinator.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar node_1 = __importDefault(require(\"./node\"));\nvar types_1 = require(\"./types\");\nvar Nesting = /** @class */ (function (_super) {\n __extends(Nesting, _super);\n function Nesting(opts) {\n var _this = _super.call(this, opts) || this;\n _this.type = types_1.NESTING;\n _this.value = \"&\";\n return _this;\n }\n return Nesting;\n}(node_1.default));\nexports.default = Nesting;\n//# sourceMappingURL=nesting.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = sortAscending;\nfunction sortAscending(list) {\n return list.sort(function (a, b) { return a - b; });\n}\n//# sourceMappingURL=sortAscending.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.combinator = exports.word = exports.comment = exports.str = exports.tab = exports.newline = exports.feed = exports.cr = exports.backslash = exports.bang = exports.slash = exports.doubleQuote = exports.singleQuote = exports.space = exports.greaterThan = exports.pipe = exports.equals = exports.plus = exports.caret = exports.tilde = exports.dollar = exports.closeSquare = exports.openSquare = exports.closeParenthesis = exports.openParenthesis = exports.semicolon = exports.colon = exports.comma = exports.at = exports.asterisk = exports.ampersand = void 0;\nexports.ampersand = 38; // `&`.charCodeAt(0);\nexports.asterisk = 42; // `*`.charCodeAt(0);\nexports.at = 64; // `@`.charCodeAt(0);\nexports.comma = 44; // `,`.charCodeAt(0);\nexports.colon = 58; // `:`.charCodeAt(0);\nexports.semicolon = 59; // `;`.charCodeAt(0);\nexports.openParenthesis = 40; // `(`.charCodeAt(0);\nexports.closeParenthesis = 41; // `)`.charCodeAt(0);\nexports.openSquare = 91; // `[`.charCodeAt(0);\nexports.closeSquare = 93; // `]`.charCodeAt(0);\nexports.dollar = 36; // `$`.charCodeAt(0);\nexports.tilde = 126; // `~`.charCodeAt(0);\nexports.caret = 94; // `^`.charCodeAt(0);\nexports.plus = 43; // `+`.charCodeAt(0);\nexports.equals = 61; // `=`.charCodeAt(0);\nexports.pipe = 124; // `|`.charCodeAt(0);\nexports.greaterThan = 62; // `>`.charCodeAt(0);\nexports.space = 32; // ` `.charCodeAt(0);\nexports.singleQuote = 39; // `'`.charCodeAt(0);\nexports.doubleQuote = 34; // `\"`.charCodeAt(0);\nexports.slash = 47; // `/`.charCodeAt(0);\nexports.bang = 33; // `!`.charCodeAt(0);\nexports.backslash = 92; // '\\\\'.charCodeAt(0);\nexports.cr = 13; // '\\r'.charCodeAt(0);\nexports.feed = 12; // '\\f'.charCodeAt(0);\nexports.newline = 10; // '\\n'.charCodeAt(0);\nexports.tab = 9; // '\\t'.charCodeAt(0);\n// Expose aliases primarily for readability.\nexports.str = exports.singleQuote;\n// No good single character representation!\nexports.comment = -1;\nexports.word = -2;\nexports.combinator = -3;\n//# sourceMappingURL=tokenTypes.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nvar _a, _b;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FIELDS = void 0;\nexports.default = tokenize;\nvar t = __importStar(require(\"./tokenTypes\"));\nvar unescapable = (_a = {},\n _a[t.tab] = true,\n _a[t.newline] = true,\n _a[t.cr] = true,\n _a[t.feed] = true,\n _a);\nvar wordDelimiters = (_b = {},\n _b[t.space] = true,\n _b[t.tab] = true,\n _b[t.newline] = true,\n _b[t.cr] = true,\n _b[t.feed] = true,\n _b[t.ampersand] = true,\n _b[t.asterisk] = true,\n _b[t.bang] = true,\n _b[t.comma] = true,\n _b[t.colon] = true,\n _b[t.semicolon] = true,\n _b[t.openParenthesis] = true,\n _b[t.closeParenthesis] = true,\n _b[t.openSquare] = true,\n _b[t.closeSquare] = true,\n _b[t.singleQuote] = true,\n _b[t.doubleQuote] = true,\n _b[t.plus] = true,\n _b[t.pipe] = true,\n _b[t.tilde] = true,\n _b[t.greaterThan] = true,\n _b[t.equals] = true,\n _b[t.dollar] = true,\n _b[t.caret] = true,\n _b[t.slash] = true,\n _b);\nvar hex = {};\nvar hexChars = \"0123456789abcdefABCDEF\";\nfor (var i = 0; i < hexChars.length; i++) {\n hex[hexChars.charCodeAt(i)] = true;\n}\n/**\n * Returns the last index of the bar css word\n * @param {string} css The string in which the word begins\n * @param {number} start The index into the string where word's first letter occurs\n */\nfunction consumeWord(css, start) {\n var next = start;\n var code;\n do {\n code = css.charCodeAt(next);\n if (wordDelimiters[code]) {\n return next - 1;\n }\n else if (code === t.backslash) {\n next = consumeEscape(css, next) + 1;\n }\n else {\n // All other characters are part of the word\n next++;\n }\n } while (next < css.length);\n return next - 1;\n}\n/**\n * Returns the last index of the escape sequence\n * @param {string} css The string in which the sequence begins\n * @param {number} start The index into the string where escape character (`\\`) occurs.\n */\nfunction consumeEscape(css, start) {\n var next = start;\n var code = css.charCodeAt(next + 1);\n if (unescapable[code]) {\n // just consume the escape char\n }\n else if (hex[code]) {\n var hexDigits = 0;\n // consume up to 6 hex chars\n do {\n next++;\n hexDigits++;\n code = css.charCodeAt(next + 1);\n } while (hex[code] && hexDigits < 6);\n // if fewer than 6 hex chars, a trailing space ends the escape\n if (hexDigits < 6 && code === t.space) {\n next++;\n }\n }\n else {\n // the next char is part of the current word\n next++;\n }\n return next;\n}\nexports.FIELDS = {\n TYPE: 0,\n START_LINE: 1,\n START_COL: 2,\n END_LINE: 3,\n END_COL: 4,\n START_POS: 5,\n END_POS: 6,\n};\nfunction tokenize(input) {\n var tokens = [];\n var css = input.css.valueOf();\n var length = css.length;\n var offset = -1;\n var line = 1;\n var start = 0;\n var end = 0;\n var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType;\n function unclosed(what, fix) {\n if (input.safe) {\n // fyi: this is never set to true.\n css += fix;\n next = css.length - 1;\n }\n else {\n throw input.error(\"Unclosed \" + what, line, start - offset, start);\n }\n }\n while (start < length) {\n code = css.charCodeAt(start);\n if (code === t.newline) {\n offset = start;\n line += 1;\n }\n switch (code) {\n case t.space:\n case t.tab:\n case t.newline:\n case t.cr:\n case t.feed:\n next = start;\n do {\n next += 1;\n code = css.charCodeAt(next);\n if (code === t.newline) {\n offset = next;\n line += 1;\n }\n } while (code === t.space ||\n code === t.newline ||\n code === t.tab ||\n code === t.cr ||\n code === t.feed);\n tokenType = t.space;\n endLine = line;\n endColumn = next - offset - 1;\n end = next;\n break;\n case t.plus:\n case t.greaterThan:\n case t.tilde:\n case t.pipe:\n next = start;\n do {\n next += 1;\n code = css.charCodeAt(next);\n } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe);\n tokenType = t.combinator;\n endLine = line;\n endColumn = start - offset;\n end = next;\n break;\n // Consume these characters as single tokens.\n case t.asterisk:\n case t.ampersand:\n case t.bang:\n case t.comma:\n case t.equals:\n case t.dollar:\n case t.caret:\n case t.openSquare:\n case t.closeSquare:\n case t.colon:\n case t.semicolon:\n case t.openParenthesis:\n case t.closeParenthesis:\n next = start;\n tokenType = code;\n endLine = line;\n endColumn = start - offset;\n end = next + 1;\n break;\n case t.singleQuote:\n case t.doubleQuote:\n quote = code === t.singleQuote ? \"'\" : '\"';\n next = start;\n do {\n escaped = false;\n next = css.indexOf(quote, next + 1);\n if (next === -1) {\n unclosed(\"quote\", quote);\n }\n escapePos = next;\n while (css.charCodeAt(escapePos - 1) === t.backslash) {\n escapePos -= 1;\n escaped = !escaped;\n }\n } while (escaped);\n tokenType = t.str;\n endLine = line;\n endColumn = start - offset;\n end = next + 1;\n break;\n default:\n if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) {\n next = css.indexOf(\"*/\", start + 2) + 1;\n if (next === 0) {\n unclosed(\"comment\", \"*/\");\n }\n content = css.slice(start, next + 1);\n lines = content.split(\"\\n\");\n last = lines.length - 1;\n if (last > 0) {\n nextLine = line + last;\n nextOffset = next - lines[last].length;\n }\n else {\n nextLine = line;\n nextOffset = offset;\n }\n tokenType = t.comment;\n line = nextLine;\n endLine = nextLine;\n endColumn = next - nextOffset;\n }\n else if (code === t.slash) {\n next = start;\n tokenType = code;\n endLine = line;\n endColumn = start - offset;\n end = next + 1;\n }\n else {\n next = consumeWord(css, start);\n tokenType = t.word;\n endLine = line;\n endColumn = next - offset;\n }\n end = next + 1;\n break;\n }\n // Ensure that the token structure remains consistent\n tokens.push([\n tokenType, // [0] Token type\n line, // [1] Starting line\n start - offset, // [2] Starting column\n endLine, // [3] Ending line\n endColumn, // [4] Ending column\n start, // [5] Start position / Source index\n end, // [6] End position\n ]);\n // Reset offset for the next token\n if (nextOffset) {\n offset = nextOffset;\n nextOffset = null;\n }\n start = end;\n }\n return tokens;\n}\n//# sourceMappingURL=tokenize.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar _a, _b;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar root_1 = __importDefault(require(\"./selectors/root\"));\nvar selector_1 = __importDefault(require(\"./selectors/selector\"));\nvar className_1 = __importDefault(require(\"./selectors/className\"));\nvar comment_1 = __importDefault(require(\"./selectors/comment\"));\nvar id_1 = __importDefault(require(\"./selectors/id\"));\nvar tag_1 = __importDefault(require(\"./selectors/tag\"));\nvar string_1 = __importDefault(require(\"./selectors/string\"));\nvar pseudo_1 = __importDefault(require(\"./selectors/pseudo\"));\nvar attribute_1 = __importStar(require(\"./selectors/attribute\"));\nvar universal_1 = __importDefault(require(\"./selectors/universal\"));\nvar combinator_1 = __importDefault(require(\"./selectors/combinator\"));\nvar nesting_1 = __importDefault(require(\"./selectors/nesting\"));\nvar sortAscending_1 = __importDefault(require(\"./sortAscending\"));\nvar tokenize_1 = __importStar(require(\"./tokenize\"));\nvar tokens = __importStar(require(\"./tokenTypes\"));\nvar types = __importStar(require(\"./selectors/types\"));\nvar util_1 = require(\"./util\");\nvar WHITESPACE_TOKENS = (_a = {},\n _a[tokens.space] = true,\n _a[tokens.cr] = true,\n _a[tokens.feed] = true,\n _a[tokens.newline] = true,\n _a[tokens.tab] = true,\n _a);\nvar WHITESPACE_EQUIV_TOKENS = __assign(__assign({}, WHITESPACE_TOKENS), (_b = {}, _b[tokens.comment] = true, _b));\nfunction tokenStart(token) {\n return {\n line: token[tokenize_1.FIELDS.START_LINE],\n column: token[tokenize_1.FIELDS.START_COL],\n };\n}\nfunction tokenEnd(token) {\n return {\n line: token[tokenize_1.FIELDS.END_LINE],\n column: token[tokenize_1.FIELDS.END_COL],\n };\n}\nfunction getSource(startLine, startColumn, endLine, endColumn) {\n return {\n start: {\n line: startLine,\n column: startColumn,\n },\n end: {\n line: endLine,\n column: endColumn,\n },\n };\n}\nfunction getTokenSource(token) {\n return getSource(token[tokenize_1.FIELDS.START_LINE], token[tokenize_1.FIELDS.START_COL], token[tokenize_1.FIELDS.END_LINE], token[tokenize_1.FIELDS.END_COL]);\n}\nfunction getTokenSourceSpan(startToken, endToken) {\n if (!startToken) {\n return undefined;\n }\n return getSource(startToken[tokenize_1.FIELDS.START_LINE], startToken[tokenize_1.FIELDS.START_COL], endToken[tokenize_1.FIELDS.END_LINE], endToken[tokenize_1.FIELDS.END_COL]);\n}\nfunction unescapeProp(node, prop) {\n var value = node[prop];\n if (typeof value !== \"string\") {\n return;\n }\n if (value.indexOf(\"\\\\\") !== -1) {\n (0, util_1.ensureObject)(node, \"raws\");\n node[prop] = (0, util_1.unesc)(value);\n if (node.raws[prop] === undefined) {\n node.raws[prop] = value;\n }\n }\n return node;\n}\nfunction indexesOf(array, item) {\n var i = -1;\n var indexes = [];\n while ((i = array.indexOf(item, i + 1)) !== -1) {\n indexes.push(i);\n }\n return indexes;\n}\nfunction uniqs() {\n // A Set keeps the first-occurrence order the previous filter/indexOf pass\n // produced, without its quadratic cost on long index lists.\n return Array.from(new Set(Array.prototype.concat.apply([], arguments)));\n}\nvar Parser = /** @class */ (function () {\n function Parser(rule, options) {\n if (options === void 0) { options = {}; }\n this.rule = rule;\n this.options = Object.assign({ lossy: false, safe: false }, options);\n this.position = 0;\n this.nestingDepth = 0;\n this.maxNestingDepth = (0, util_1.resolveMaxNestingDepth)(this.options.maxNestingDepth);\n this.css = typeof this.rule === \"string\" ? this.rule : this.rule.selector;\n this.tokens = (0, tokenize_1.default)({\n css: this.css,\n error: this._errorGenerator(),\n safe: this.options.safe,\n });\n var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]);\n this.root = new root_1.default({ source: rootSource });\n this.root.errorGenerator = this._errorGenerator();\n var selector = new selector_1.default({\n source: { start: { line: 1, column: 1 } },\n sourceIndex: 0,\n });\n this.root.append(selector);\n this.current = selector;\n this.loop();\n }\n Parser.prototype._errorGenerator = function () {\n var _this = this;\n return function (message, errorOptions) {\n if (typeof _this.rule === \"string\") {\n return new Error(message);\n }\n return _this.rule.error(message, errorOptions);\n };\n };\n Parser.prototype.attribute = function () {\n var attr = [];\n var startingToken = this.currToken;\n this.position++;\n while (this.position < this.tokens.length &&\n this.currToken[tokenize_1.FIELDS.TYPE] !== tokens.closeSquare) {\n attr.push(this.currToken);\n this.position++;\n }\n if (!this.currToken) {\n // Ran off the end of the token stream: the attribute was never closed.\n // Point at the opening bracket, which is where the author needs to look.\n return this.expected(\"closing square bracket\", startingToken[tokenize_1.FIELDS.START_POS]);\n }\n if (this.currToken[tokenize_1.FIELDS.TYPE] !== tokens.closeSquare) {\n return this.expected(\"closing square bracket\", this.currToken[tokenize_1.FIELDS.START_POS]);\n }\n var len = attr.length;\n var node = {\n source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]),\n sourceIndex: startingToken[tokenize_1.FIELDS.START_POS],\n };\n if (len === 1 && !~[tokens.word].indexOf(attr[0][tokenize_1.FIELDS.TYPE])) {\n return this.expected(\"attribute\", attr[0][tokenize_1.FIELDS.START_POS]);\n }\n var pos = 0;\n var spaceBefore = \"\";\n var commentBefore = \"\";\n var lastAdded = null;\n var spaceAfterMeaningfulToken = false;\n while (pos < len) {\n var token = attr[pos];\n var content = this.content(token);\n var next = attr[pos + 1];\n switch (token[tokenize_1.FIELDS.TYPE]) {\n case tokens.space:\n // if (\n // len === 1 ||\n // pos === 0 && this.content(next) === '|'\n // ) {\n // return this.expected('attribute', token[TOKEN.START_POS], content);\n // }\n spaceAfterMeaningfulToken = true;\n if (this.options.lossy) {\n break;\n }\n if (lastAdded) {\n (0, util_1.ensureObject)(node, \"spaces\", lastAdded);\n var prevContent = node.spaces[lastAdded].after || \"\";\n node.spaces[lastAdded].after = prevContent + content;\n var existingComment = (0, util_1.getProp)(node, \"raws\", \"spaces\", lastAdded, \"after\") || null;\n if (existingComment) {\n node.raws.spaces[lastAdded].after = existingComment + content;\n }\n }\n else {\n spaceBefore = spaceBefore + content;\n commentBefore = commentBefore + content;\n }\n break;\n case tokens.asterisk:\n if (next[tokenize_1.FIELDS.TYPE] === tokens.equals) {\n node.operator = content;\n lastAdded = \"operator\";\n }\n else if ((!node.namespace || (lastAdded === \"namespace\" && !spaceAfterMeaningfulToken)) &&\n next) {\n if (spaceBefore) {\n (0, util_1.ensureObject)(node, \"spaces\", \"attribute\");\n node.spaces.attribute.before = spaceBefore;\n spaceBefore = \"\";\n }\n if (commentBefore) {\n (0, util_1.ensureObject)(node, \"raws\", \"spaces\", \"attribute\");\n node.raws.spaces.attribute.before = commentBefore;\n commentBefore = \"\";\n }\n node.namespace = (node.namespace || \"\") + content;\n var rawValue = (0, util_1.getProp)(node, \"raws\", \"namespace\") || null;\n if (rawValue) {\n node.raws.namespace += content;\n }\n lastAdded = \"namespace\";\n }\n spaceAfterMeaningfulToken = false;\n break;\n case tokens.dollar:\n if (lastAdded === \"value\") {\n var oldRawValue = (0, util_1.getProp)(node, \"raws\", \"value\");\n node.value += \"$\";\n if (oldRawValue) {\n node.raws.value = oldRawValue + \"$\";\n }\n break;\n }\n // Falls through\n case tokens.caret:\n if (next[tokenize_1.FIELDS.TYPE] === tokens.equals) {\n node.operator = content;\n lastAdded = \"operator\";\n }\n spaceAfterMeaningfulToken = false;\n break;\n case tokens.combinator:\n if (content === \"~\" && next[tokenize_1.FIELDS.TYPE] === tokens.equals) {\n node.operator = content;\n lastAdded = \"operator\";\n }\n if (content !== \"|\") {\n spaceAfterMeaningfulToken = false;\n break;\n }\n if (next[tokenize_1.FIELDS.TYPE] === tokens.equals) {\n node.operator = content;\n lastAdded = \"operator\";\n }\n else if (!node.namespace && !node.attribute) {\n node.namespace = true;\n }\n spaceAfterMeaningfulToken = false;\n break;\n case tokens.word:\n if (next &&\n this.content(next) === \"|\" &&\n attr[pos + 2] &&\n attr[pos + 2][tokenize_1.FIELDS.TYPE] !== tokens.equals && // this look-ahead probably fails with comment nodes involved.\n !node.operator &&\n !node.namespace) {\n node.namespace = content;\n lastAdded = \"namespace\";\n }\n else if (!node.attribute || (lastAdded === \"attribute\" && !spaceAfterMeaningfulToken)) {\n if (spaceBefore) {\n (0, util_1.ensureObject)(node, \"spaces\", \"attribute\");\n node.spaces.attribute.before = spaceBefore;\n spaceBefore = \"\";\n }\n if (commentBefore) {\n (0, util_1.ensureObject)(node, \"raws\", \"spaces\", \"attribute\");\n node.raws.spaces.attribute.before = commentBefore;\n commentBefore = \"\";\n }\n node.attribute = (node.attribute || \"\") + content;\n var rawValue = (0, util_1.getProp)(node, \"raws\", \"attribute\") || null;\n if (rawValue) {\n node.raws.attribute += content;\n }\n lastAdded = \"attribute\";\n }\n else if ((!node.value && node.value !== \"\") ||\n (lastAdded === \"value\" && !(spaceAfterMeaningfulToken || node.quoteMark))) {\n var unescaped_1 = (0, util_1.unesc)(content);\n var oldRawValue = (0, util_1.getProp)(node, \"raws\", \"value\") || \"\";\n var oldValue = node.value || \"\";\n node.value = oldValue + unescaped_1;\n node.quoteMark = null;\n if (unescaped_1 !== content || oldRawValue) {\n (0, util_1.ensureObject)(node, \"raws\");\n node.raws.value = (oldRawValue || oldValue) + content;\n }\n lastAdded = \"value\";\n }\n else {\n var insensitive = content === \"i\" || content === \"I\";\n if ((node.value || node.value === \"\") &&\n (node.quoteMark || spaceAfterMeaningfulToken)) {\n node.insensitive = insensitive;\n if (!insensitive || content === \"I\") {\n (0, util_1.ensureObject)(node, \"raws\");\n node.raws.insensitiveFlag = content;\n }\n lastAdded = \"insensitive\";\n if (spaceBefore) {\n (0, util_1.ensureObject)(node, \"spaces\", \"insensitive\");\n node.spaces.insensitive.before = spaceBefore;\n spaceBefore = \"\";\n }\n if (commentBefore) {\n (0, util_1.ensureObject)(node, \"raws\", \"spaces\", \"insensitive\");\n node.raws.spaces.insensitive.before = commentBefore;\n commentBefore = \"\";\n }\n }\n else if (node.value || node.value === \"\") {\n lastAdded = \"value\";\n node.value += content;\n if (node.raws.value) {\n node.raws.value += content;\n }\n }\n }\n spaceAfterMeaningfulToken = false;\n break;\n case tokens.str:\n if (!node.attribute || !node.operator) {\n return this.error(\"Expected an attribute followed by an operator preceding the string.\", {\n index: token[tokenize_1.FIELDS.START_POS],\n });\n }\n var _a = (0, attribute_1.unescapeValue)(content), unescaped = _a.unescaped, quoteMark = _a.quoteMark;\n node.value = unescaped;\n node.quoteMark = quoteMark;\n lastAdded = \"value\";\n (0, util_1.ensureObject)(node, \"raws\");\n node.raws.value = content;\n spaceAfterMeaningfulToken = false;\n break;\n case tokens.equals:\n if (!node.attribute) {\n return this.expected(\"attribute\", token[tokenize_1.FIELDS.START_POS], content);\n }\n if (node.value) {\n return this.error('Unexpected \"=\" found; an operator was already defined.', {\n index: token[tokenize_1.FIELDS.START_POS],\n });\n }\n node.operator = node.operator ? node.operator + content : content;\n lastAdded = \"operator\";\n spaceAfterMeaningfulToken = false;\n break;\n case tokens.comment:\n if (lastAdded) {\n if (spaceAfterMeaningfulToken ||\n (next && next[tokenize_1.FIELDS.TYPE] === tokens.space) ||\n lastAdded === \"insensitive\") {\n var lastComment = (0, util_1.getProp)(node, \"spaces\", lastAdded, \"after\") || \"\";\n var rawLastComment = (0, util_1.getProp)(node, \"raws\", \"spaces\", lastAdded, \"after\") || lastComment;\n (0, util_1.ensureObject)(node, \"raws\", \"spaces\", lastAdded);\n node.raws.spaces[lastAdded].after = rawLastComment + content;\n }\n else {\n var lastValue = node[lastAdded] || \"\";\n var rawLastValue = (0, util_1.getProp)(node, \"raws\", lastAdded) || lastValue;\n (0, util_1.ensureObject)(node, \"raws\");\n node.raws[lastAdded] = rawLastValue + content;\n }\n }\n else {\n commentBefore = commentBefore + content;\n }\n break;\n default:\n return this.error(\"Unexpected \\\"\".concat(content, \"\\\" found.\"), { index: token[tokenize_1.FIELDS.START_POS] });\n }\n pos++;\n }\n unescapeProp(node, \"attribute\");\n unescapeProp(node, \"namespace\");\n this.newNode(new attribute_1.default(node));\n this.position++;\n };\n /**\n * return a node containing meaningless garbage up to (but not including) the specified token position.\n * if the token position is negative, all remaining tokens are consumed.\n *\n * This returns an array containing a single string node if all whitespace,\n * otherwise an array of comment nodes with space before and after.\n *\n * These tokens are not added to the current selector, the caller can add them or use them to amend\n * a previous node's space metadata.\n *\n * In lossy mode, this returns only comments.\n */\n Parser.prototype.parseWhitespaceEquivalentTokens = function (stopPosition) {\n if (stopPosition < 0) {\n stopPosition = this.tokens.length;\n }\n var startPosition = this.position;\n var nodes = [];\n var space = \"\";\n var lastComment = undefined;\n do {\n if (WHITESPACE_TOKENS[this.currToken[tokenize_1.FIELDS.TYPE]]) {\n if (!this.options.lossy) {\n space += this.content();\n }\n }\n else if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.comment) {\n var spaces = {};\n if (space) {\n spaces.before = space;\n space = \"\";\n }\n lastComment = new comment_1.default({\n value: this.content(),\n source: getTokenSource(this.currToken),\n sourceIndex: this.currToken[tokenize_1.FIELDS.START_POS],\n spaces: spaces,\n });\n nodes.push(lastComment);\n }\n } while (++this.position < stopPosition);\n if (space) {\n if (lastComment) {\n lastComment.spaces.after = space;\n }\n else if (!this.options.lossy) {\n var firstToken = this.tokens[startPosition];\n var lastToken = this.tokens[this.position - 1];\n nodes.push(new string_1.default({\n value: \"\",\n source: getSource(firstToken[tokenize_1.FIELDS.START_LINE], firstToken[tokenize_1.FIELDS.START_COL], lastToken[tokenize_1.FIELDS.END_LINE], lastToken[tokenize_1.FIELDS.END_COL]),\n sourceIndex: firstToken[tokenize_1.FIELDS.START_POS],\n spaces: { before: space, after: \"\" },\n }));\n }\n }\n return nodes;\n };\n /**\n *\n * @param {*} nodes\n */\n Parser.prototype.convertWhitespaceNodesToSpace = function (nodes, requiredSpace) {\n var _this = this;\n if (requiredSpace === void 0) { requiredSpace = false; }\n var space = \"\";\n var rawSpace = \"\";\n nodes.forEach(function (n) {\n var spaceBefore = _this.lossySpace(n.spaces.before, requiredSpace);\n var rawSpaceBefore = _this.lossySpace(n.rawSpaceBefore, requiredSpace);\n space +=\n spaceBefore + _this.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0);\n rawSpace +=\n spaceBefore +\n n.value +\n _this.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0);\n });\n if (rawSpace === space) {\n rawSpace = undefined;\n }\n var result = { space: space, rawSpace: rawSpace };\n return result;\n };\n Parser.prototype.isNamedCombinator = function (position) {\n if (position === void 0) { position = this.position; }\n return (this.tokens[position + 0] &&\n this.tokens[position + 0][tokenize_1.FIELDS.TYPE] === tokens.slash &&\n this.tokens[position + 1] &&\n this.tokens[position + 1][tokenize_1.FIELDS.TYPE] === tokens.word &&\n this.tokens[position + 2] &&\n this.tokens[position + 2][tokenize_1.FIELDS.TYPE] === tokens.slash);\n };\n Parser.prototype.namedCombinator = function () {\n if (this.isNamedCombinator()) {\n var nameRaw = this.content(this.tokens[this.position + 1]);\n var name = (0, util_1.unesc)(nameRaw).toLowerCase();\n var raws = {};\n if (name !== nameRaw) {\n raws.value = \"/\".concat(nameRaw, \"/\");\n }\n var node = new combinator_1.default({\n value: \"/\".concat(name, \"/\"),\n source: getSource(this.currToken[tokenize_1.FIELDS.START_LINE], this.currToken[tokenize_1.FIELDS.START_COL], this.tokens[this.position + 2][tokenize_1.FIELDS.END_LINE], this.tokens[this.position + 2][tokenize_1.FIELDS.END_COL]),\n sourceIndex: this.currToken[tokenize_1.FIELDS.START_POS],\n raws: raws,\n });\n this.position = this.position + 3;\n return node;\n }\n else {\n this.unexpected();\n }\n };\n Parser.prototype.combinator = function () {\n var _this = this;\n if (this.content() === \"|\") {\n return this.namespace();\n }\n // We need to decide between a space that's a descendant combinator and meaningless whitespace at the end of a selector.\n var nextSigTokenPos = this.locateNextMeaningfulToken(this.position);\n if (nextSigTokenPos < 0 ||\n this.tokens[nextSigTokenPos][tokenize_1.FIELDS.TYPE] === tokens.comma ||\n this.tokens[nextSigTokenPos][tokenize_1.FIELDS.TYPE] === tokens.closeParenthesis) {\n var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos);\n if (nodes.length > 0) {\n var last = this.current.last;\n if (last) {\n var _a = this.convertWhitespaceNodesToSpace(nodes), space = _a.space, rawSpace = _a.rawSpace;\n if (rawSpace !== undefined) {\n last.rawSpaceAfter += rawSpace;\n }\n last.spaces.after += space;\n }\n else {\n nodes.forEach(function (n) { return _this.newNode(n); });\n }\n }\n return;\n }\n var firstToken = this.currToken;\n var spaceOrDescendantSelectorNodes = undefined;\n if (nextSigTokenPos > this.position) {\n spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos);\n }\n var node;\n if (this.isNamedCombinator()) {\n node = this.namedCombinator();\n }\n else if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.combinator) {\n node = new combinator_1.default({\n value: this.content(),\n source: getTokenSource(this.currToken),\n sourceIndex: this.currToken[tokenize_1.FIELDS.START_POS],\n });\n this.position++;\n }\n else if (WHITESPACE_TOKENS[this.currToken[tokenize_1.FIELDS.TYPE]]) {\n // pass\n }\n else if (!spaceOrDescendantSelectorNodes) {\n this.unexpected();\n }\n if (node) {\n if (spaceOrDescendantSelectorNodes) {\n var _b = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes), space = _b.space, rawSpace = _b.rawSpace;\n node.spaces.before = space;\n node.rawSpaceBefore = rawSpace;\n }\n }\n else {\n // descendant combinator\n var _c = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true), space = _c.space, rawSpace = _c.rawSpace;\n if (!rawSpace) {\n rawSpace = space;\n }\n var spaces = {};\n var raws = { spaces: {} };\n if (space.endsWith(\" \") && rawSpace.endsWith(\" \")) {\n spaces.before = space.slice(0, space.length - 1);\n raws.spaces.before = rawSpace.slice(0, rawSpace.length - 1);\n }\n else if (space[0] === \" \" && rawSpace[0] === \" \") {\n spaces.after = space.slice(1);\n raws.spaces.after = rawSpace.slice(1);\n }\n else {\n raws.value = rawSpace;\n }\n node = new combinator_1.default({\n value: \" \",\n source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]),\n sourceIndex: firstToken[tokenize_1.FIELDS.START_POS],\n spaces: spaces,\n raws: raws,\n });\n }\n if (this.currToken && this.currToken[tokenize_1.FIELDS.TYPE] === tokens.space) {\n node.spaces.after = this.optionalSpace(this.content());\n this.position++;\n }\n return this.newNode(node);\n };\n Parser.prototype.comma = function () {\n if (this.position === this.tokens.length - 1) {\n this.root.trailingComma = true;\n this.position++;\n return;\n }\n this.current._inferEndPosition();\n var selector = new selector_1.default({\n source: {\n start: tokenStart(this.tokens[this.position + 1]),\n },\n sourceIndex: this.tokens[this.position + 1][tokenize_1.FIELDS.START_POS],\n });\n this.current.parent.append(selector);\n this.current = selector;\n this.position++;\n };\n Parser.prototype.comment = function () {\n var current = this.currToken;\n this.newNode(new comment_1.default({\n value: this.content(),\n source: getTokenSource(current),\n sourceIndex: current[tokenize_1.FIELDS.START_POS],\n }));\n this.position++;\n };\n Parser.prototype.error = function (message, opts) {\n throw this.root.error(message, opts);\n };\n Parser.prototype.missingBackslash = function () {\n return this.error(\"Expected a backslash preceding the semicolon.\", {\n index: this.currToken[tokenize_1.FIELDS.START_POS],\n });\n };\n Parser.prototype.missingParenthesis = function () {\n return this.expected(\"opening parenthesis\", this.currToken[tokenize_1.FIELDS.START_POS]);\n };\n Parser.prototype.missingSquareBracket = function () {\n return this.expected(\"opening square bracket\", this.currToken[tokenize_1.FIELDS.START_POS]);\n };\n Parser.prototype.unexpected = function () {\n return this.error(\"Unexpected '\".concat(this.content(), \"'. Escaping special characters with \\\\ may help.\"), this.currToken[tokenize_1.FIELDS.START_POS]);\n };\n Parser.prototype.unexpectedPipe = function () {\n return this.error(\"Unexpected '|'.\", this.currToken[tokenize_1.FIELDS.START_POS]);\n };\n Parser.prototype.namespace = function () {\n var prev = this.prevToken;\n // Only treat the previous token as a namespace prefix when it can actually\n // be one (a type/word or the universal `*`). A comment, comma, combinator\n // or whitespace before `|` means an empty namespace, not a prefix.\n var before = prev &&\n (prev[tokenize_1.FIELDS.TYPE] === tokens.word ||\n prev[tokenize_1.FIELDS.TYPE] === tokens.asterisk ||\n prev[tokenize_1.FIELDS.TYPE] === tokens.ampersand)\n ? this.content(prev)\n : true;\n if (!this.nextToken) {\n // A trailing `|` with nothing after it. `unexpectedPipe` reports against\n // `currToken`, which is the pipe itself and always present here.\n return this.unexpectedPipe();\n }\n if (this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.word) {\n this.position++;\n return this.word(before);\n }\n else if (this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.asterisk) {\n this.position++;\n return this.universal(before);\n }\n this.unexpectedPipe();\n };\n Parser.prototype.nesting = function () {\n if (this.nextToken) {\n var nextContent = this.content(this.nextToken);\n if (nextContent === \"|\") {\n this.position++;\n return;\n }\n }\n var current = this.currToken;\n this.newNode(new nesting_1.default({\n value: this.content(),\n source: getTokenSource(current),\n sourceIndex: current[tokenize_1.FIELDS.START_POS],\n }));\n this.position++;\n };\n Parser.prototype.parentheses = function () {\n var last = this.current.last;\n var unbalanced = 1;\n var openingToken = this.currToken;\n this.position++;\n if (last && last.type === types.PSEUDO) {\n var selector = new selector_1.default({\n source: { start: tokenStart(this.tokens[this.position]) },\n sourceIndex: this.tokens[this.position][tokenize_1.FIELDS.START_POS],\n });\n var cache = this.current;\n last.append(selector);\n this.current = selector;\n // Track nesting depth so deeply nested pseudo selectors raise a\n // catchable error instead of overflowing the call stack. The\n // counter is restored in `finally` so the parser is never left in\n // an inconsistent state, even on the error path.\n this.nestingDepth++;\n try {\n if (this.nestingDepth > this.maxNestingDepth) {\n this.error(\"Cannot parse selector: nesting depth exceeds the maximum of \".concat(this.maxNestingDepth, \".\"), { index: this.currToken[tokenize_1.FIELDS.START_POS] });\n }\n while (this.position < this.tokens.length && unbalanced) {\n if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.openParenthesis) {\n unbalanced++;\n }\n if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.closeParenthesis) {\n unbalanced--;\n }\n if (unbalanced) {\n this.parse();\n }\n else {\n this.current.source.end = tokenEnd(this.currToken);\n this.current.parent.source.end = tokenEnd(this.currToken);\n this.position++;\n }\n }\n }\n finally {\n this.nestingDepth--;\n }\n this.current = cache;\n }\n else {\n // I think this case should be an error. It's used to implement a basic parse of media queries\n // but I don't think it's a good idea.\n var parenStart = this.currToken;\n var parenValue = \"(\";\n var parenEnd = void 0;\n while (this.position < this.tokens.length && unbalanced) {\n if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.openParenthesis) {\n unbalanced++;\n }\n if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.closeParenthesis) {\n unbalanced--;\n }\n parenEnd = this.currToken;\n parenValue += this.parseParenthesisToken(this.currToken);\n this.position++;\n }\n if (last) {\n last.appendToPropertyAndEscape(\"value\", parenValue, parenValue);\n }\n else {\n this.newNode(new string_1.default({\n value: parenValue,\n source: getSource(parenStart[tokenize_1.FIELDS.START_LINE], parenStart[tokenize_1.FIELDS.START_COL], parenEnd[tokenize_1.FIELDS.END_LINE], parenEnd[tokenize_1.FIELDS.END_COL]),\n sourceIndex: parenStart[tokenize_1.FIELDS.START_POS],\n }));\n }\n }\n if (unbalanced) {\n // `currToken` is undefined when the token stream ran out before the\n // parenthesis was closed; fall back to the opening one.\n return this.expected(\"closing parenthesis\", (this.currToken || openingToken)[tokenize_1.FIELDS.START_POS]);\n }\n };\n Parser.prototype.pseudo = function () {\n var _this = this;\n var pseudoStr = \"\";\n var startingToken = this.currToken;\n while (this.currToken && this.currToken[tokenize_1.FIELDS.TYPE] === tokens.colon) {\n pseudoStr += this.content();\n this.position++;\n }\n if (!this.currToken) {\n return this.expected([\"pseudo-class\", \"pseudo-element\"], this.position - 1);\n }\n if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.word) {\n this.splitWord(false, function (first, length) {\n pseudoStr += first;\n _this.newNode(new pseudo_1.default({\n value: pseudoStr,\n source: getTokenSourceSpan(startingToken, _this.currToken),\n sourceIndex: startingToken[tokenize_1.FIELDS.START_POS],\n }));\n if (length > 1 && _this.nextToken && _this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.openParenthesis) {\n _this.error(\"Misplaced parenthesis.\", {\n index: _this.nextToken[tokenize_1.FIELDS.START_POS],\n });\n }\n });\n }\n else {\n return this.expected([\"pseudo-class\", \"pseudo-element\"], this.currToken[tokenize_1.FIELDS.START_POS]);\n }\n };\n Parser.prototype.space = function () {\n var content = this.content();\n // Handle space before and after the selector\n if (this.position === 0 ||\n this.prevToken[tokenize_1.FIELDS.TYPE] === tokens.comma ||\n this.prevToken[tokenize_1.FIELDS.TYPE] === tokens.openParenthesis ||\n this.current.nodes.every(function (node) { return node.type === \"comment\"; })) {\n this.spaces = this.optionalSpace(content);\n this.position++;\n }\n else if (this.position === this.tokens.length - 1 ||\n this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.comma ||\n this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.closeParenthesis) {\n this.current.last.spaces.after = this.optionalSpace(content);\n this.position++;\n }\n else {\n this.combinator();\n }\n };\n Parser.prototype.string = function () {\n var current = this.currToken;\n this.newNode(new string_1.default({\n value: this.content(),\n source: getTokenSource(current),\n sourceIndex: current[tokenize_1.FIELDS.START_POS],\n }));\n this.position++;\n };\n Parser.prototype.universal = function (namespace) {\n var nextToken = this.nextToken;\n if (nextToken && this.content(nextToken) === \"|\") {\n this.position++;\n return this.namespace();\n }\n var current = this.currToken;\n this.newNode(new universal_1.default({\n value: this.content(),\n source: getTokenSource(current),\n sourceIndex: current[tokenize_1.FIELDS.START_POS],\n }), namespace);\n this.position++;\n };\n Parser.prototype.splitWord = function (namespace, firstCallback) {\n var _this = this;\n var nextToken = this.nextToken;\n var word = this.content();\n while (nextToken &&\n ~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[tokenize_1.FIELDS.TYPE])) {\n this.position++;\n var current = this.content();\n word += current;\n if (current.lastIndexOf(\"\\\\\") === current.length - 1) {\n var next = this.nextToken;\n if (next && next[tokenize_1.FIELDS.TYPE] === tokens.space) {\n word += this.requiredSpace(this.content(next));\n this.position++;\n }\n }\n nextToken = this.nextToken;\n }\n var hasClass = indexesOf(word, \".\").filter(function (i) {\n // Allow escaped dot within class name\n var escapedDot = word[i - 1] === \"\\\\\";\n // Allow decimal numbers percent in @keyframes\n var isKeyframesPercent = /^\\d+\\.\\d+%$/.test(word);\n return !escapedDot && !isKeyframesPercent;\n });\n var hasId = indexesOf(word, \"#\").filter(function (i) { return word[i - 1] !== \"\\\\\"; });\n // Eliminate Sass interpolations from the list of id indexes\n var interpolations = indexesOf(word, \"#{\");\n if (interpolations.length) {\n var interpolationIndexes_1 = new Set(interpolations);\n hasId = hasId.filter(function (hashIndex) { return !interpolationIndexes_1.has(hashIndex); });\n }\n // Membership tests are built once. Scanning the arrays per index would make\n // a flat selector such as `.a.a.a...` quadratic in its number of class/id\n // indexes, which is enough to pin a CPU core on attacker-supplied input.\n var classIndexes = new Set(hasClass);\n var idIndexes = new Set(hasId);\n var indices = (0, sortAscending_1.default)(uniqs(__spreadArray(__spreadArray([0], __read(hasClass), false), __read(hasId), false)));\n indices.forEach(function (ind, i) {\n var index = indices[i + 1] || word.length;\n var value = word.slice(ind, index);\n if (i === 0 && firstCallback) {\n return firstCallback.call(_this, value, indices.length);\n }\n var node;\n var current = _this.currToken;\n var sourceIndex = current[tokenize_1.FIELDS.START_POS] + indices[i];\n var source = getSource(current[1], current[2] + ind, current[3], current[2] + (index - 1));\n if (classIndexes.has(ind)) {\n var classNameOpts = {\n value: value.slice(1),\n source: source,\n sourceIndex: sourceIndex,\n };\n node = new className_1.default(unescapeProp(classNameOpts, \"value\"));\n }\n else if (idIndexes.has(ind)) {\n var idOpts = {\n value: value.slice(1),\n source: source,\n sourceIndex: sourceIndex,\n };\n node = new id_1.default(unescapeProp(idOpts, \"value\"));\n }\n else {\n var tagOpts = {\n value: value,\n source: source,\n sourceIndex: sourceIndex,\n };\n unescapeProp(tagOpts, \"value\");\n node = new tag_1.default(tagOpts);\n }\n _this.newNode(node, namespace);\n // Ensure that the namespace is used only once\n namespace = null;\n });\n this.position++;\n };\n Parser.prototype.word = function (namespace) {\n var nextToken = this.nextToken;\n if (nextToken && this.content(nextToken) === \"|\") {\n this.position++;\n return this.namespace();\n }\n return this.splitWord(namespace);\n };\n Parser.prototype.loop = function () {\n while (this.position < this.tokens.length) {\n this.parse(true);\n }\n this.current._inferEndPosition();\n return this.root;\n };\n Parser.prototype.parse = function (throwOnParenthesis) {\n switch (this.currToken[tokenize_1.FIELDS.TYPE]) {\n case tokens.space:\n this.space();\n break;\n case tokens.comment:\n this.comment();\n break;\n case tokens.openParenthesis:\n this.parentheses();\n break;\n case tokens.closeParenthesis:\n if (throwOnParenthesis) {\n this.missingParenthesis();\n }\n break;\n case tokens.openSquare:\n this.attribute();\n break;\n case tokens.dollar:\n case tokens.caret:\n case tokens.equals:\n case tokens.word:\n this.word();\n break;\n case tokens.colon:\n this.pseudo();\n break;\n case tokens.comma:\n this.comma();\n break;\n case tokens.asterisk:\n this.universal();\n break;\n case tokens.ampersand:\n this.nesting();\n break;\n case tokens.slash:\n case tokens.combinator:\n this.combinator();\n break;\n case tokens.str:\n this.string();\n break;\n // These cases throw; no break needed.\n case tokens.closeSquare:\n this.missingSquareBracket();\n case tokens.semicolon:\n this.missingBackslash();\n default:\n this.unexpected();\n }\n };\n /**\n * Helpers\n */\n Parser.prototype.expected = function (description, index, found) {\n if (Array.isArray(description)) {\n var last = description.pop();\n description = \"\".concat(description.join(\", \"), \" or \").concat(last);\n }\n var an = /^[aeiou]/.test(description[0]) ? \"an\" : \"a\";\n if (!found) {\n return this.error(\"Expected \".concat(an, \" \").concat(description, \".\"), { index: index });\n }\n return this.error(\"Expected \".concat(an, \" \").concat(description, \", found \\\"\").concat(found, \"\\\" instead.\"), { index: index });\n };\n Parser.prototype.requiredSpace = function (space) {\n return this.options.lossy ? \" \" : space;\n };\n Parser.prototype.optionalSpace = function (space) {\n return this.options.lossy ? \"\" : space;\n };\n Parser.prototype.lossySpace = function (space, required) {\n if (this.options.lossy) {\n return required ? \" \" : \"\";\n }\n else {\n return space;\n }\n };\n Parser.prototype.parseParenthesisToken = function (token) {\n var content = this.content(token);\n if (token[tokenize_1.FIELDS.TYPE] === tokens.space) {\n return this.requiredSpace(content);\n }\n else {\n return content;\n }\n };\n Parser.prototype.newNode = function (node, namespace) {\n if (namespace) {\n if (/^ +$/.test(namespace)) {\n if (!this.options.lossy) {\n this.spaces = (this.spaces || \"\") + namespace;\n }\n namespace = true;\n }\n node.namespace = namespace;\n unescapeProp(node, \"namespace\");\n }\n if (this.spaces) {\n node.spaces.before = this.spaces;\n this.spaces = \"\";\n }\n return this.current.append(node);\n };\n Parser.prototype.content = function (token) {\n if (token === void 0) { token = this.currToken; }\n return this.css.slice(token[tokenize_1.FIELDS.START_POS], token[tokenize_1.FIELDS.END_POS]);\n };\n Object.defineProperty(Parser.prototype, \"currToken\", {\n get: function () {\n return this.tokens[this.position];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Parser.prototype, \"nextToken\", {\n get: function () {\n return this.tokens[this.position + 1];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Parser.prototype, \"prevToken\", {\n get: function () {\n return this.tokens[this.position - 1];\n },\n enumerable: false,\n configurable: true\n });\n /**\n * returns the index of the next non-whitespace, non-comment token.\n * returns -1 if no meaningful token is found.\n */\n Parser.prototype.locateNextMeaningfulToken = function (startPosition) {\n if (startPosition === void 0) { startPosition = this.position + 1; }\n var searchPosition = startPosition;\n while (searchPosition < this.tokens.length) {\n if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][tokenize_1.FIELDS.TYPE]]) {\n searchPosition++;\n continue;\n }\n else {\n return searchPosition;\n }\n }\n return -1;\n };\n return Parser;\n}());\nexports.default = Parser;\n//# sourceMappingURL=parser.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar parser_1 = __importDefault(require(\"./parser\"));\nvar Processor = /** @class */ (function () {\n function Processor(func, options) {\n this.func = func || function noop() { };\n this.funcRes = null;\n this.options = options;\n }\n Processor.prototype._shouldUpdateSelector = function (rule, options) {\n if (options === void 0) { options = {}; }\n var merged = Object.assign({}, this.options, options);\n if (merged.updateSelector === false) {\n return false;\n }\n else {\n return typeof rule !== \"string\";\n }\n };\n Processor.prototype._isLossy = function (options) {\n if (options === void 0) { options = {}; }\n var merged = Object.assign({}, this.options, options);\n if (merged.lossless === false) {\n return true;\n }\n else {\n return false;\n }\n };\n Processor.prototype._root = function (rule, options) {\n if (options === void 0) { options = {}; }\n var parser = new parser_1.default(rule, this._parseOptions(options));\n return parser.root;\n };\n Processor.prototype._parseOptions = function (options) {\n var merged = Object.assign({}, this.options, options);\n return {\n lossy: this._isLossy(merged),\n maxNestingDepth: merged.maxNestingDepth,\n };\n };\n Processor.prototype._stringifyOptions = function (options) {\n var merged = Object.assign({}, this.options, options);\n return {\n maxNestingDepth: merged.maxNestingDepth,\n };\n };\n Processor.prototype._run = function (rule, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n return new Promise(function (resolve, reject) {\n try {\n var root_1 = _this._root(rule, options);\n Promise.resolve(_this.func(root_1))\n .then(function (transform) {\n var string = undefined;\n if (_this._shouldUpdateSelector(rule, options)) {\n string = root_1.toString(_this._stringifyOptions(options));\n rule.selector = string;\n }\n return { transform: transform, root: root_1, string: string };\n })\n .then(resolve, reject);\n }\n catch (e) {\n reject(e);\n return;\n }\n });\n };\n Processor.prototype._runSync = function (rule, options) {\n if (options === void 0) { options = {}; }\n var root = this._root(rule, options);\n var transform = this.func(root);\n if (transform && typeof transform.then === \"function\") {\n throw new Error(\"Selector processor returned a promise to a synchronous call.\");\n }\n var string = undefined;\n if (options.updateSelector && typeof rule !== \"string\") {\n string = root.toString(this._stringifyOptions(options));\n rule.selector = string;\n }\n return { transform: transform, root: root, string: string };\n };\n /**\n * Process rule into a selector AST.\n *\n * @param rule {postcss.Rule | string} The css selector to be processed\n * @param options The options for processing\n * @returns {Promise<parser.Root>} The AST of the selector after processing it.\n */\n Processor.prototype.ast = function (rule, options) {\n return this._run(rule, options).then(function (result) { return result.root; });\n };\n /**\n * Process rule into a selector AST synchronously.\n *\n * @param rule {postcss.Rule | string} The css selector to be processed\n * @param options The options for processing\n * @returns {parser.Root} The AST of the selector after processing it.\n */\n Processor.prototype.astSync = function (rule, options) {\n return this._runSync(rule, options).root;\n };\n /**\n * Process a selector into a transformed value asynchronously\n *\n * @param rule {postcss.Rule | string} The css selector to be processed\n * @param options The options for processing\n * @returns {Promise<any>} The value returned by the processor.\n */\n Processor.prototype.transform = function (rule, options) {\n return this._run(rule, options).then(function (result) { return result.transform; });\n };\n /**\n * Process a selector into a transformed value synchronously.\n *\n * @param rule {postcss.Rule | string} The css selector to be processed\n * @param options The options for processing\n * @returns {any} The value returned by the processor.\n */\n Processor.prototype.transformSync = function (rule, options) {\n return this._runSync(rule, options).transform;\n };\n /**\n * Process a selector into a new selector string asynchronously.\n *\n * @param rule {postcss.Rule | string} The css selector to be processed\n * @param options The options for processing\n * @returns {string} the selector after processing.\n */\n Processor.prototype.process = function (rule, options) {\n var _this = this;\n return this._run(rule, options).then(function (result) { return result.string || result.root.toString(_this._stringifyOptions(options)); });\n };\n /**\n * Process a selector into a new selector string synchronously.\n *\n * @param rule {postcss.Rule | string} The css selector to be processed\n * @param options The options for processing\n * @returns {string} the selector after processing.\n */\n Processor.prototype.processSync = function (rule, options) {\n var result = this._runSync(rule, options);\n return result.string || result.root.toString(this._stringifyOptions(options));\n };\n return Processor;\n}());\nexports.default = Processor;\n//# sourceMappingURL=processor.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.universal = exports.tag = exports.string = exports.selector = exports.root = exports.pseudo = exports.nesting = exports.id = exports.comment = exports.combinator = exports.className = exports.attribute = void 0;\nvar attribute_1 = __importDefault(require(\"./attribute\"));\nvar className_1 = __importDefault(require(\"./className\"));\nvar combinator_1 = __importDefault(require(\"./combinator\"));\nvar comment_1 = __importDefault(require(\"./comment\"));\nvar id_1 = __importDefault(require(\"./id\"));\nvar nesting_1 = __importDefault(require(\"./nesting\"));\nvar pseudo_1 = __importDefault(require(\"./pseudo\"));\nvar root_1 = __importDefault(require(\"./root\"));\nvar selector_1 = __importDefault(require(\"./selector\"));\nvar string_1 = __importDefault(require(\"./string\"));\nvar tag_1 = __importDefault(require(\"./tag\"));\nvar universal_1 = __importDefault(require(\"./universal\"));\nvar attribute = function (opts) { return new attribute_1.default(opts); };\nexports.attribute = attribute;\nvar className = function (opts) { return new className_1.default(opts); };\nexports.className = className;\nvar combinator = function (opts) { return new combinator_1.default(opts); };\nexports.combinator = combinator;\nvar comment = function (opts) { return new comment_1.default(opts); };\nexports.comment = comment;\nvar id = function (opts) { return new id_1.default(opts); };\nexports.id = id;\nvar nesting = function (opts) { return new nesting_1.default(opts); };\nexports.nesting = nesting;\nvar pseudo = function (opts) { return new pseudo_1.default(opts); };\nexports.pseudo = pseudo;\nvar root = function (opts) { return new root_1.default(opts); };\nexports.root = root;\nvar selector = function (opts) { return new selector_1.default(opts); };\nexports.selector = selector;\nvar string = function (opts) { return new string_1.default(opts); };\nexports.string = string;\nvar tag = function (opts) { return new tag_1.default(opts); };\nexports.tag = tag;\nvar universal = function (opts) { return new universal_1.default(opts); };\nexports.universal = universal;\n//# sourceMappingURL=constructors.js.map","\"use strict\";\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isUniversal = exports.isTag = exports.isString = exports.isSelector = exports.isRoot = exports.isPseudo = exports.isNesting = exports.isIdentifier = exports.isComment = exports.isCombinator = exports.isClassName = exports.isAttribute = void 0;\nexports.isNode = isNode;\nexports.isPseudoElement = isPseudoElement;\nexports.isPseudoClass = isPseudoClass;\nexports.isContainer = isContainer;\nexports.isNamespace = isNamespace;\nvar types_1 = require(\"./types\");\nvar IS_TYPE = (_a = {},\n _a[types_1.ATTRIBUTE] = true,\n _a[types_1.CLASS] = true,\n _a[types_1.COMBINATOR] = true,\n _a[types_1.COMMENT] = true,\n _a[types_1.ID] = true,\n _a[types_1.NESTING] = true,\n _a[types_1.PSEUDO] = true,\n _a[types_1.ROOT] = true,\n _a[types_1.SELECTOR] = true,\n _a[types_1.STRING] = true,\n _a[types_1.TAG] = true,\n _a[types_1.UNIVERSAL] = true,\n _a);\nfunction isNode(node) {\n return typeof node === \"object\" && IS_TYPE[node.type];\n}\nfunction isNodeType(type, node) {\n return isNode(node) && node.type === type;\n}\nexports.isAttribute = isNodeType.bind(null, types_1.ATTRIBUTE);\nexports.isClassName = isNodeType.bind(null, types_1.CLASS);\nexports.isCombinator = isNodeType.bind(null, types_1.COMBINATOR);\nexports.isComment = isNodeType.bind(null, types_1.COMMENT);\nexports.isIdentifier = isNodeType.bind(null, types_1.ID);\nexports.isNesting = isNodeType.bind(null, types_1.NESTING);\nexports.isPseudo = isNodeType.bind(null, types_1.PSEUDO);\nexports.isRoot = isNodeType.bind(null, types_1.ROOT);\nexports.isSelector = isNodeType.bind(null, types_1.SELECTOR);\nexports.isString = isNodeType.bind(null, types_1.STRING);\nexports.isTag = isNodeType.bind(null, types_1.TAG);\nexports.isUniversal = isNodeType.bind(null, types_1.UNIVERSAL);\nfunction isPseudoElement(node) {\n return ((0, exports.isPseudo)(node) &&\n node.value &&\n (node.value.startsWith(\"::\") ||\n node.value.toLowerCase() === \":before\" ||\n node.value.toLowerCase() === \":after\" ||\n node.value.toLowerCase() === \":first-letter\" ||\n node.value.toLowerCase() === \":first-line\"));\n}\nfunction isPseudoClass(node) {\n return (0, exports.isPseudo)(node) && !isPseudoElement(node);\n}\nfunction isContainer(node) {\n return !!(isNode(node) && node.walk);\n}\nfunction isNamespace(node) {\n return (0, exports.isAttribute)(node) || (0, exports.isTag)(node);\n}\n//# sourceMappingURL=guards.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./constructors\"), exports);\n__exportStar(require(\"./guards\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar processor_1 = __importDefault(require(\"./processor\"));\nvar selectors = __importStar(require(\"./selectors\"));\nvar parser = function (processor) { return new processor_1.default(processor); };\nObject.assign(parser, selectors);\ndelete parser.__esModule;\nmodule.exports = parser;\n//# sourceMappingURL=index.js.map","'use strict'\n\nconst parser = require('postcss-selector-parser')\n\nconst arrayDelimiter = Symbol('arrayDelimiter')\n\nconst escapeSlashes = str =>\n str.replace(/\\//g, '\\\\/')\n\nconst unescapeSlashes = str =>\n str.replace(/\\\\\\//g, '/')\n\n// recursively fixes up any :attr pseudo-class found\nconst fixupAttr = astNode => {\n const properties = []\n const matcher = {}\n for (const selectorAstNode of astNode.nodes) {\n const [firstAstNode] = selectorAstNode.nodes\n if (firstAstNode.type === 'tag') {\n properties.push(firstAstNode.value)\n }\n }\n\n const lastSelectorAstNode = astNode.nodes.pop()\n const [attributeAstNode] = lastSelectorAstNode.nodes\n\n if (attributeAstNode.value === ':attr') {\n const appendParts = fixupAttr(attributeAstNode)\n properties.push(arrayDelimiter, ...appendParts.lookupProperties)\n matcher.qualifiedAttribute = appendParts.attributeMatcher.qualifiedAttribute\n matcher.operator = appendParts.attributeMatcher.operator\n matcher.value = appendParts.attributeMatcher.value\n\n // backwards compatibility\n matcher.attribute = appendParts.attributeMatcher.attribute\n\n if (appendParts.attributeMatcher.insensitive) {\n matcher.insensitive = true\n }\n } else {\n if (attributeAstNode.type !== 'attribute') {\n throw Object.assign(\n new Error('`:attr` pseudo-class expects an attribute matcher as the last value'),\n { code: 'EQUERYATTR' }\n )\n }\n\n matcher.qualifiedAttribute = unescapeSlashes(attributeAstNode.qualifiedAttribute)\n matcher.operator = attributeAstNode.operator\n matcher.value = attributeAstNode.value\n\n // backwards compatibility\n matcher.attribute = matcher.qualifiedAttribute\n\n if (attributeAstNode.insensitive) {\n matcher.insensitive = true\n }\n }\n\n astNode.lookupProperties = properties\n astNode.attributeMatcher = matcher\n astNode.nodes.length = 0\n return astNode\n}\n\n// fixed up nested pseudo nodes will have their internal selectors moved\n// to a new root node that will be referenced by the `nestedNode` property,\n// this tweak makes it simpler to reuse `retrieveNodesFromParsedAst` to\n// recursively parse and extract results from the internal selectors\nconst fixupNestedPseudo = astNode => {\n // create a new ast root node and relocate any children\n // selectors of the current ast node to this new root\n const newRootNode = parser.root()\n astNode.nestedNode = newRootNode\n newRootNode.nodes = [...astNode.nodes]\n\n // clean up the ast by removing the children nodes from the\n // current ast node while also cleaning up their `parent` refs\n astNode.nodes.length = 0\n for (const currAstNode of newRootNode.nodes) {\n currAstNode.parent = newRootNode\n }\n\n // recursively fixup nodes of any nested selector\n transformAst(newRootNode)\n}\n\n// :semver(<version|range|selector>, [version|range|selector], [function])\n// note: the first or second parameter must be a static version or range\nconst fixupSemverSpecs = astNode => {\n // if we have three nodes, the last is the semver function to use, pull that out first\n if (astNode.nodes.length === 3) {\n const funcNode = astNode.nodes.pop().nodes[0]\n if (funcNode.type === 'tag') {\n astNode.semverFunc = funcNode.value\n } else if (funcNode.type === 'string') {\n // a string is always in some type of quotes, we don't want those so slice them off\n astNode.semverFunc = funcNode.value.slice(1, -1)\n } else {\n // anything that isn't a tag or a string isn't a function name\n throw Object.assign(\n new Error('`:semver` pseudo-class expects a function name as last value'),\n { code: 'ESEMVERFUNC' }\n )\n }\n }\n\n // now if we have 1 node, it's a static value\n // istanbul ignore else\n if (astNode.nodes.length === 1) {\n const semverNode = astNode.nodes.pop()\n astNode.semverValue = semverNode.nodes.reduce((res, next) => `${res}${String(next)}`, '')\n } else if (astNode.nodes.length === 2) {\n // and if we have two nodes, one of them is a static value and we need to determine which it is\n for (let i = 0; i < astNode.nodes.length; ++i) {\n const type = astNode.nodes[i].nodes[0].type\n // the type of the first child may be combinator for ranges, such as >14\n if (type === 'tag' || type === 'combinator') {\n const semverNode = astNode.nodes.splice(i, 1)[0]\n astNode.semverValue = semverNode.nodes.reduce((res, next) => `${res}${String(next)}`, '')\n astNode.semverPosition = i\n break\n }\n }\n\n if (typeof astNode.semverValue === 'undefined') {\n throw Object.assign(\n new Error('`:semver` pseudo-class expects a static value in the first or second position'),\n { code: 'ESEMVERVALUE' }\n )\n }\n }\n\n // if we got here, the last remaining child should be attribute selector\n if (astNode.nodes.length === 1) {\n fixupAttr(astNode)\n } else {\n // if we don't have a selector, we default to `[version]`\n astNode.attributeMatcher = {\n insensitive: false,\n attribute: 'version',\n qualifiedAttribute: 'version',\n }\n astNode.lookupProperties = []\n }\n\n astNode.nodes.length = 0\n}\n\nconst fixupTypes = astNode => {\n const [valueAstNode] = astNode.nodes[0].nodes\n const { value } = valueAstNode || {}\n astNode.typeValue = value\n astNode.nodes.length = 0\n}\n\nconst fixupPaths = astNode => {\n astNode.pathValue = unescapeSlashes(String(astNode.nodes[0]))\n astNode.nodes.length = 0\n}\n\nconst fixupOutdated = astNode => {\n if (astNode.nodes.length) {\n astNode.outdatedKind = String(astNode.nodes[0])\n astNode.nodes.length = 0\n }\n}\n\nconst fixupVuln = astNode => {\n const vulns = []\n if (astNode.nodes.length) {\n for (const selector of astNode.nodes) {\n const vuln = {}\n for (const node of selector.nodes) {\n if (node.type !== 'attribute') {\n throw Object.assign(\n new Error(':vuln pseudo-class only accepts attribute matchers or \"cwe\" tag'),\n { code: 'EQUERYATTR' }\n )\n }\n if (!['severity', 'cwe'].includes(node._attribute)) {\n throw Object.assign(\n new Error(':vuln pseudo-class only matches \"severity\" and \"cwe\" attributes'),\n { code: 'EQUERYATTR' }\n )\n }\n if (!node.operator) {\n node.operator = '='\n node.value = '*'\n }\n if (node.operator !== '=') {\n throw Object.assign(\n new Error(':vuln pseudo-class attribute selector only accepts \"=\" operator', node),\n { code: 'EQUERYATTR' }\n )\n }\n if (!vuln[node._attribute]) {\n vuln[node._attribute] = []\n }\n vuln[node._attribute].push(node._value)\n }\n vulns.push(vuln)\n }\n astNode.vulns = vulns\n astNode.nodes.length = 0\n }\n}\n\n// a few of the supported ast nodes need to be tweaked in order to properly be\n// interpreted as proper arborist query selectors, namely semver ranges from\n// both ids and :semver pseudo-class selectors need to be translated from what\n// are usually multiple ast nodes, such as: tag:1, class:.0, class:.0 to a\n// single `1.0.0` value, other pseudo-class selectors also get preprocessed in\n// order to make it simpler to execute later when traversing each ast node\n// using rootNode.walk(), such as :path, :type, etc. transformAst handles all\n// these modifications to the parsed ast by doing an extra, initial traversal\n// of the parsed ast from the query and modifying the parsed nodes accordingly\nconst transformAst = selector => {\n selector.walk((nextAstNode) => {\n switch (nextAstNode.value) {\n case ':attr':\n return fixupAttr(nextAstNode)\n case ':is':\n case ':has':\n case ':not':\n return fixupNestedPseudo(nextAstNode)\n case ':path':\n return fixupPaths(nextAstNode)\n case ':semver':\n return fixupSemverSpecs(nextAstNode)\n case ':type':\n return fixupTypes(nextAstNode)\n case ':outdated':\n return fixupOutdated(nextAstNode)\n case ':vuln':\n return fixupVuln(nextAstNode)\n }\n })\n}\n\nconst queryParser = (query) => {\n // if query is an empty string or any falsy\n // value, just returns an empty result\n if (!query) {\n return []\n }\n\n return parser(transformAst)\n .astSync(escapeSlashes(query), { lossless: false })\n}\n\nmodule.exports = {\n parser: queryParser,\n arrayDelimiter,\n}\n","'use strict'\n\nconst { resolve } = require('node:path')\nconst { parser, arrayDelimiter } = require('@npmcli/query')\nconst localeCompare = require('@isaacs/string-locale-compare')('en')\nconst { log } = require('proc-log')\nconst { minimatch } = require('minimatch')\nconst npa = require('npm-package-arg')\nconst pacote = require('pacote')\nconst semver = require('semver')\nconst npmFetch = require('npm-registry-fetch')\nconst { isReleaseAgeExcluded } = require('./release-age-exclude.js')\n\n// handle results for parsed query asts, results are stored in a map that has a\n// key that points to each ast selector node and stores the resulting array of\n// arborist nodes as its value, that is essential to how we handle multiple\n// query selectors, e.g: `#a, #b, #c` <- 3 diff ast selector nodes\nclass Results {\n #currentAstSelector\n #initialItems\n #inventory\n #outdatedCache = new Map()\n #vulnCache\n #pendingCombinator\n #results = new Map()\n #targetNode\n\n constructor (opts) {\n this.#currentAstSelector = opts.rootAstNode.nodes[0]\n this.#inventory = opts.inventory\n this.#initialItems = opts.initialItems\n this.#vulnCache = opts.vulnCache\n this.#targetNode = opts.targetNode\n\n this.currentResults = this.#initialItems\n\n // We get this when first called and need to pass it to pacote\n this.flatOptions = opts.flatOptions || {}\n\n // reset by rootAstNode walker\n this.currentAstNode = opts.rootAstNode\n }\n\n get currentResults () {\n return this.#results.get(this.#currentAstSelector)\n }\n\n set currentResults (value) {\n this.#results.set(this.#currentAstSelector, value)\n }\n\n // retrieves the initial items to which start the filtering / matching\n // for most of the different types of recognized ast nodes, e.g: class (aka\n // depType), id, *, etc in different contexts we need to start with the\n // current list of filtered results, for example a query for `.workspace`\n // actually means the same as `*.workspace` so we want to start with the full\n // inventory if that's the first ast node we're reading but if it appears in\n // the middle of a query it should respect the previous filtered results,\n // combinators are a special case in which we always want to have the\n // complete inventory list in order to use the left-hand side ast node as a\n // filter combined with the element on its right-hand side\n get initialItems () {\n const firstParsed =\n (this.currentAstNode.parent.nodes[0] === this.currentAstNode) &&\n (this.currentAstNode.parent.parent.type === 'root')\n\n if (firstParsed) {\n return this.#initialItems\n }\n\n if (this.currentAstNode.prev().type === 'combinator') {\n return this.#inventory\n }\n return this.currentResults\n }\n\n // combinators need information about previously filtered items along\n // with info of the items parsed / retrieved from the selector right\n // past the combinator, for this reason combinators are stored and\n // only ran as the last part of each selector logic\n processPendingCombinator (nextResults) {\n if (this.#pendingCombinator) {\n const res = this.#pendingCombinator(this.currentResults, nextResults)\n this.#pendingCombinator = null\n this.currentResults = res\n } else {\n this.currentResults = nextResults\n }\n }\n\n // when collecting results to a root astNode, we traverse the list of child\n // selector nodes and collect all of their resulting arborist nodes into a\n // single/flat Set of items, this ensures we also deduplicate items\n collect (rootAstNode) {\n return new Set(rootAstNode.nodes.flatMap(n => this.#results.get(n)))\n }\n\n // selector types map to the '.type' property of the ast nodes via `${astNode.type}Type`\n //\n // attribute selector [name=value], etc\n attributeType () {\n const nextResults = this.initialItems.filter(node =>\n attributeMatch(this.currentAstNode, node.package)\n )\n this.processPendingCombinator(nextResults)\n }\n\n // dependency type selector (i.e. .prod, .dev, etc)\n // css calls this class, we interpret is as dependency type\n classType () {\n const depTypeFn = depTypes[String(this.currentAstNode)]\n if (!depTypeFn) {\n throw Object.assign(\n new Error(`\\`${String(this.currentAstNode)}\\` is not a supported dependency type.`),\n { code: 'EQUERYNODEPTYPE' }\n )\n }\n const nextResults = depTypeFn(this.initialItems)\n this.processPendingCombinator(nextResults)\n }\n\n // combinators (i.e. '>', ' ', '~')\n combinatorType () {\n this.#pendingCombinator = combinators[String(this.currentAstNode)]\n }\n\n // name selectors (i.e. #foo)\n // css calls this id, we interpret it as name\n idType () {\n const name = this.currentAstNode.value\n const nextResults = this.initialItems.filter(node =>\n (name === node.name) || (name === node.package.name)\n )\n this.processPendingCombinator(nextResults)\n }\n\n // pseudo selectors (prefixed with :)\n async pseudoType () {\n const pseudoFn = `${this.currentAstNode.value.slice(1)}Pseudo`\n if (!this[pseudoFn]) {\n throw Object.assign(\n new Error(`\\`${this.currentAstNode.value\n }\\` is not a supported pseudo selector.`),\n { code: 'EQUERYNOPSEUDO' }\n )\n }\n const nextResults = await this[pseudoFn]()\n this.processPendingCombinator(nextResults)\n }\n\n selectorType () {\n this.#currentAstSelector = this.currentAstNode\n // starts a new array in which resulting items\n // can be stored for each given ast selector\n if (!this.currentResults) {\n this.currentResults = []\n }\n }\n\n universalType () {\n this.processPendingCombinator(this.initialItems)\n }\n\n // pseudo selectors map to the 'value' property of the pseudo selectors in the ast nodes\n // via selectors via `${value.slice(1)}Pseudo`\n attrPseudo () {\n const { lookupProperties, attributeMatcher } = this.currentAstNode\n\n return this.initialItems.filter(node => {\n let objs = [node.package]\n for (const prop of lookupProperties) {\n // if an isArray symbol is found that means we'll need to iterate\n // over the previous found array to basically make sure we traverse\n // all its indexes testing for possible objects that may eventually\n // hold more keys specified in a selector\n if (prop === arrayDelimiter) {\n objs = objs.flat()\n continue\n }\n\n // otherwise just maps all currently found objs\n // to the next prop from the lookup properties list,\n // filters out any empty key lookup\n objs = objs.flatMap(obj => obj[prop] || [])\n\n // in case there's no property found in the lookup\n // just filters that item out\n const noAttr = objs.every(obj => !obj)\n if (noAttr) {\n return false\n }\n }\n\n // if any of the potential object matches\n // that item should be in the final result\n return objs.some(obj => attributeMatch(attributeMatcher, obj))\n })\n }\n\n emptyPseudo () {\n return this.initialItems.filter(node => node.edgesOut.size === 0)\n }\n\n extraneousPseudo () {\n return this.initialItems.filter(node => node.extraneous)\n }\n\n async hasPseudo () {\n const found = []\n for (const item of this.initialItems) {\n // This is the one time initialItems differs from inventory\n const res = await retrieveNodesFromParsedAst({\n flatOptions: this.flatOptions,\n initialItems: [item],\n inventory: this.#inventory,\n rootAstNode: this.currentAstNode.nestedNode,\n targetNode: item,\n vulnCache: this.#vulnCache,\n })\n if (res.size > 0) {\n found.push(item)\n }\n }\n return found\n }\n\n invalidPseudo () {\n const found = []\n for (const node of this.initialItems) {\n for (const edge of node.edgesIn) {\n if (edge.invalid) {\n found.push(node)\n break\n }\n }\n }\n return found\n }\n\n async isPseudo () {\n const res = await retrieveNodesFromParsedAst({\n flatOptions: this.flatOptions,\n initialItems: this.initialItems,\n inventory: this.#inventory,\n rootAstNode: this.currentAstNode.nestedNode,\n targetNode: this.currentAstNode,\n vulnCache: this.#vulnCache,\n })\n return [...res]\n }\n\n linkPseudo () {\n return this.initialItems.filter(node => node.isLink || (node.isTop && !node.isRoot))\n }\n\n missingPseudo () {\n return this.#inventory.reduce((res, node) => {\n for (const edge of node.edgesOut.values()) {\n if (edge.missing) {\n const pkg = { name: edge.name, version: edge.spec }\n const item = new this.#targetNode.constructor({ pkg })\n item.queryContext = {\n missing: true,\n }\n item.edgesIn = new Set([edge])\n res.push(item)\n }\n }\n return res\n }, [])\n }\n\n async notPseudo () {\n const res = await retrieveNodesFromParsedAst({\n flatOptions: this.flatOptions,\n initialItems: this.initialItems,\n inventory: this.#inventory,\n rootAstNode: this.currentAstNode.nestedNode,\n targetNode: this.currentAstNode,\n vulnCache: this.#vulnCache,\n })\n const internalSelector = new Set(res)\n return this.initialItems.filter(node =>\n !internalSelector.has(node))\n }\n\n overriddenPseudo () {\n return this.initialItems.filter(node => node.overridden)\n }\n\n pathPseudo () {\n return this.initialItems.filter(node => {\n if (!this.currentAstNode.pathValue) {\n return true\n }\n return minimatch(\n node.realpath.replace(/\\\\+/g, '/'),\n resolve(node.root.realpath, this.currentAstNode.pathValue).replace(/\\\\+/g, '/')\n )\n })\n }\n\n privatePseudo () {\n return this.initialItems.filter(node => node.package.private)\n }\n\n rootPseudo () {\n return this.initialItems.filter(node => node === this.#targetNode.root)\n }\n\n scopePseudo () {\n return this.initialItems.filter(node => node === this.#targetNode)\n }\n\n semverPseudo () {\n const {\n attributeMatcher,\n lookupProperties,\n semverFunc = 'infer',\n semverValue,\n } = this.currentAstNode\n const { qualifiedAttribute } = attributeMatcher\n\n if (!semverValue) {\n // DEPRECATED: remove this warning and throw an error as part of @npmcli/arborist@6\n log.warn('query', 'usage of :semver() with no parameters is deprecated')\n return this.initialItems\n }\n\n if (!semver.valid(semverValue) && !semver.validRange(semverValue)) {\n throw Object.assign(\n new Error(`\\`${semverValue}\\` is not a valid semver version or range`),\n { code: 'EQUERYINVALIDSEMVER' })\n }\n\n const valueIsVersion = !!semver.valid(semverValue)\n\n const nodeMatches = (node, obj) => {\n // if we already have an operator, the user provided some test as part of the selector\n // we evaluate that first because if it fails we don't want this node anyway\n if (attributeMatcher.operator) {\n if (!attributeMatch(attributeMatcher, obj)) {\n // if the initial operator doesn't match, we're done\n return false\n }\n }\n\n const attrValue = obj[qualifiedAttribute]\n // both valid and validRange return null for undefined, so this will skip both nodes that\n // do not have the attribute defined as well as those where the attribute value is invalid\n // and those where the value from the package.json is not a string\n if ((!semver.valid(attrValue) && !semver.validRange(attrValue)) ||\n typeof attrValue !== 'string') {\n return false\n }\n\n const attrIsVersion = !!semver.valid(attrValue)\n\n let actualFunc = semverFunc\n\n // if we're asked to infer, we examine outputs to make a best guess\n if (actualFunc === 'infer') {\n if (valueIsVersion && attrIsVersion) {\n // two versions -> semver.eq\n actualFunc = 'eq'\n } else if (!valueIsVersion && !attrIsVersion) {\n // two ranges -> semver.intersects\n actualFunc = 'intersects'\n } else {\n // anything else -> semver.satisfies\n actualFunc = 'satisfies'\n }\n }\n\n if (['eq', 'neq', 'gt', 'gte', 'lt', 'lte'].includes(actualFunc)) {\n // both sides must be versions, but one is not\n if (!valueIsVersion || !attrIsVersion) {\n return false\n }\n\n return semver[actualFunc](attrValue, semverValue)\n } else if (['gtr', 'ltr', 'satisfies'].includes(actualFunc)) {\n // at least one side must be a version, but neither is\n if (!valueIsVersion && !attrIsVersion) {\n return false\n }\n\n return valueIsVersion\n ? semver[actualFunc](semverValue, attrValue)\n : semver[actualFunc](attrValue, semverValue)\n } else if (['intersects', 'subset'].includes(actualFunc)) {\n // these accept two ranges and since a version is also a range, anything goes\n return semver[actualFunc](attrValue, semverValue)\n } else {\n // user provided a function we don't know about, throw an error\n throw Object.assign(new Error(`\\`semver.${actualFunc}\\` is not a supported operator.`),\n { code: 'EQUERYINVALIDOPERATOR' })\n }\n }\n\n return this.initialItems.filter((node) => {\n // no lookupProperties just means its a top level property, see if it matches\n if (!lookupProperties.length) {\n return nodeMatches(node, node.package)\n }\n\n // this code is mostly duplicated from attrPseudo to traverse into the package until we get\n // to our deepest requested object\n let objs = [node.package]\n for (const prop of lookupProperties) {\n if (prop === arrayDelimiter) {\n objs = objs.flat()\n continue\n }\n\n objs = objs.flatMap(obj => obj[prop] || [])\n const noAttr = objs.every(obj => !obj)\n if (noAttr) {\n return false\n }\n\n return objs.some(obj => nodeMatches(node, obj))\n }\n })\n }\n\n typePseudo () {\n if (!this.currentAstNode.typeValue) {\n return this.initialItems\n }\n // TODO this differs subtly with `:type()` because it now iterates on edgesIn, which means extraneous deps won't show up\n // note how \"@npmcli/abbrev@2.0.0-beta.45\" is in the `:type()` results in the test but not in any of the other results.\n return this.initialItems\n .flatMap(node => {\n const found = []\n const { typeValue } = this.currentAstNode\n for (const edge of node.edgesIn) {\n const parsedArg = npa(`${edge.name}@${edge.spec}`)\n if (typeValue === 'registry') {\n if (parsedArg.registry) {\n found.push(edge.to)\n }\n } else if (parsedArg.type === typeValue) {\n found.push(edge.to)\n }\n }\n return found\n })\n }\n\n dedupedPseudo () {\n return this.initialItems.filter(node => node.target.edgesIn.size > 1)\n }\n\n async vulnPseudo () {\n if (!this.initialItems.length) {\n return this.initialItems\n }\n if (!this.#vulnCache) {\n const packages = {}\n // We have to map the items twice, once to get the request, and a second time to filter out the results of that request\n this.initialItems.map((node) => {\n if (node.isProjectRoot || node.package.private) {\n return\n }\n if (!packages[node.name]) {\n packages[node.name] = []\n }\n if (!packages[node.name].includes(node.version)) {\n packages[node.name].push(node.version)\n }\n })\n const res = await npmFetch('/-/npm/v1/security/advisories/bulk', {\n ...this.flatOptions,\n registry: this.flatOptions.auditRegistry || this.flatOptions.registry,\n method: 'POST',\n gzip: true,\n body: packages,\n })\n this.#vulnCache = await res.json()\n }\n const advisories = this.#vulnCache\n const { vulns } = this.currentAstNode\n return this.initialItems.filter(item => {\n const vulnerable = advisories[item.name]?.filter(advisory => {\n // This could be for another version of this package elsewhere in the tree\n if (!semver.intersects(advisory.vulnerable_versions, item.version)) {\n return false\n }\n if (!vulns) {\n return true\n }\n // vulns are OR with each other, if any one matches we're done\n for (const vuln of vulns) {\n if (vuln.severity && !vuln.severity.includes('*')) {\n if (!vuln.severity.includes(advisory.severity)) {\n continue\n }\n }\n\n if (vuln?.cwe) {\n // * is special, it means \"has a cwe\"\n if (vuln.cwe.includes('*')) {\n if (!advisory.cwe.length) {\n continue\n }\n } else if (!vuln.cwe.every(cwe => advisory.cwe.includes(`CWE-${cwe}`))) {\n continue\n }\n }\n return true\n }\n })\n if (vulnerable?.length) {\n item.queryContext = {\n advisories: vulnerable,\n }\n return true\n }\n return false\n })\n }\n\n async outdatedPseudo () {\n const { outdatedKind = 'any' } = this.currentAstNode\n\n // filter the initialItems\n // NOTE: this uses a Promise.all around a map without in-line concurrency handling\n // since the only async action taken is retrieving the packument, which is limited\n // based on the max-sockets config in make-fetch-happen\n const initialResults = await Promise.all(this.initialItems.map(async (node) => {\n // the root can't be outdated, skip it\n if (node.isProjectRoot) {\n return false\n }\n\n // private packages can't be published, skip them\n if (node.package.private) {\n return false\n }\n\n // we cache the promise representing the full versions list, this helps reduce the\n // number of requests we send by keeping population of the cache in a single tick\n // making it less likely that multiple requests for the same package will be inflight\n if (!this.#outdatedCache.has(node.name)) {\n this.#outdatedCache.set(node.name, getPackageVersions(node.name, this.flatOptions))\n }\n const availableVersions = await this.#outdatedCache.get(node.name)\n\n // we attach _all_ versions to the queryContext to allow consumers to do their own\n // filtering and comparisons\n node.queryContext.versions = availableVersions\n\n // next we further reduce the set to versions that are greater than the current one\n const greaterVersions = availableVersions.filter((available) => {\n return semver.gt(available, node.version)\n })\n\n // no newer versions than the current one, drop this node from the result set\n if (!greaterVersions.length) {\n return false\n }\n\n // if we got here, we know that newer versions exist, if the kind is 'any' we're done\n if (outdatedKind === 'any') {\n return node\n }\n\n // look for newer versions that differ from current by a specific part of the semver version\n if (['major', 'minor', 'patch'].includes(outdatedKind)) {\n // filter the versions greater than our current one based on semver.diff\n const filteredVersions = greaterVersions.filter((version) => {\n return semver.diff(node.version, version) === outdatedKind\n })\n\n // no available versions are of the correct diff type\n if (!filteredVersions.length) {\n return false\n }\n\n return node\n }\n\n // look for newer versions that satisfy at least one edgeIn to this node\n if (outdatedKind === 'in-range') {\n const inRangeContext = []\n for (const edge of node.edgesIn) {\n const inRangeVersions = greaterVersions.filter((version) => {\n return semver.satisfies(version, edge.spec)\n })\n\n // this edge has no in-range candidates, just move on\n if (!inRangeVersions.length) {\n continue\n }\n\n inRangeContext.push({\n from: edge.from.location,\n versions: inRangeVersions,\n })\n }\n\n // if we didn't find at least one match, drop this node\n if (!inRangeContext.length) {\n return false\n }\n\n // now add to the context each version that is in-range for each edgeIn\n node.queryContext.outdated = {\n ...node.queryContext.outdated,\n inRange: inRangeContext,\n }\n\n return node\n }\n\n // look for newer versions that _do not_ satisfy at least one edgeIn\n if (outdatedKind === 'out-of-range') {\n const outOfRangeContext = []\n for (const edge of node.edgesIn) {\n const outOfRangeVersions = greaterVersions.filter((version) => {\n return !semver.satisfies(version, edge.spec)\n })\n\n // this edge has no out-of-range candidates, skip it\n if (!outOfRangeVersions.length) {\n continue\n }\n\n outOfRangeContext.push({\n from: edge.from.location,\n versions: outOfRangeVersions,\n })\n }\n\n // if we didn't add at least one thing to the context, this node is not a match\n if (!outOfRangeContext.length) {\n return false\n }\n\n // attach the out-of-range context to the node\n node.queryContext.outdated = {\n ...node.queryContext.outdated,\n outOfRange: outOfRangeContext,\n }\n\n return node\n }\n\n // any other outdatedKind is unknown and will never match\n return false\n }))\n\n // return an array with the holes for non-matching nodes removed\n return initialResults.filter(Boolean)\n }\n}\n\n// operators for attribute selectors\nconst attributeOperators = {\n // attribute value is equivalent\n '=' ({ attr, value }) {\n return attr === value\n },\n // attribute value contains word\n '~=' ({ attr, value }) {\n return (attr.match(/\\w+/g) || []).includes(value)\n },\n // attribute value contains string\n '*=' ({ attr, value }) {\n return attr.includes(value)\n },\n // attribute value is equal or starts with\n '|=' ({ attr, value }) {\n return attr.startsWith(`${value}-`)\n },\n // attribute value starts with\n '^=' ({ attr, value }) {\n return attr.startsWith(value)\n },\n // attribute value ends with\n '$=' ({ attr, value }) {\n return attr.endsWith(value)\n },\n}\n\nconst attributeOperator = ({ attr, value, insensitive, operator }) => {\n if (typeof attr === 'number') {\n attr = String(attr)\n }\n if (typeof attr !== 'string') {\n // It's an object or an array, bail\n return false\n }\n if (insensitive) {\n attr = attr.toLowerCase()\n }\n\n return attributeOperators[operator]({\n attr,\n insensitive,\n value,\n })\n}\n\nconst attributeMatch = (matcher, obj) => {\n const insensitive = !!matcher.insensitive\n const operator = matcher.operator || ''\n const attribute = matcher.qualifiedAttribute\n let value = matcher.value || ''\n // return early if checking existence\n if (operator === '') {\n return Boolean(obj[attribute])\n }\n if (insensitive) {\n value = value.toLowerCase()\n }\n // in case the current object is an array\n // then we try to match every item in the array\n if (Array.isArray(obj[attribute])) {\n return obj[attribute].find((i, index) => {\n const attr = obj[attribute][index] || ''\n return attributeOperator({ attr, value, insensitive, operator })\n })\n } else {\n const attr = obj[attribute] || ''\n return attributeOperator({ attr, value, insensitive, operator })\n }\n}\n\nconst edgeIsType = (node, type, seen = new Set()) => {\n for (const edgeIn of node.edgesIn) {\n // TODO Need a test with an infinite loop\n if (seen.has(edgeIn)) {\n continue\n }\n seen.add(edgeIn)\n if (edgeIn.type === type || edgeIn.from[type] || edgeIsType(edgeIn.from, type, seen)) {\n return true\n }\n }\n return false\n}\n\nconst filterByType = (nodes, type) => {\n const found = []\n for (const node of nodes) {\n if (node[type] || edgeIsType(node, type)) {\n found.push(node)\n }\n }\n return found\n}\n\nconst depTypes = {\n // dependency\n '.prod' (prevResults) {\n const found = []\n for (const node of prevResults) {\n if (!node.dev) {\n found.push(node)\n }\n }\n return found\n },\n // devDependency\n '.dev' (prevResults) {\n return filterByType(prevResults, 'dev')\n },\n // optionalDependency\n '.optional' (prevResults) {\n return filterByType(prevResults, 'optional')\n },\n // peerDependency\n '.peer' (prevResults) {\n return filterByType(prevResults, 'peer')\n },\n // workspace\n '.workspace' (prevResults) {\n return prevResults.filter(node => node.isWorkspace)\n },\n // bundledDependency\n '.bundled' (prevResults) {\n return prevResults.filter(node => node.inBundle)\n },\n}\n\n// checks if a given node has a direct parent in any of the nodes provided in\n// the compare nodes array\nconst hasParent = (node, compareNodes) => {\n // All it takes is one so we loop and return on the first hit\n for (let compareNode of compareNodes) {\n if (compareNode.isLink) {\n compareNode = compareNode.target\n }\n\n // Follows logical parent for link ancestors (e.g. workspaces whose target lives outside node_modules).\n // Only match if the node has a link whose parent is the compareNode. Without this check, nodes deep in the store (linked strategy) would incorrectly match as children of root via their fsParent chain.\n if (node.isTop && (node.resolveParent === compareNode)) {\n for (const link of node.linksIn) {\n // A store-backing node (linked strategy) is reached through its logical Link, which matches via edgesIn below, so the store node itself is never a direct child.\n if (link.parent === compareNode && !node.isInStore) {\n return true\n }\n }\n }\n // follows edges-in to check if they match a possible parent\n for (const edge of node.edgesIn) {\n if (edge && edge.from === compareNode) {\n return true\n }\n }\n }\n return false\n}\n\n// checks if a given node is a descendant of any of the nodes provided in the\n// compareNodes array\nconst hasAscendant = (node, compareNodes, seen = new Set()) => {\n // TODO (future) loop over ancestry property\n if (hasParent(node, compareNodes)) {\n return true\n }\n\n if (node.isTop && node.resolveParent) {\n /* istanbul ignore if - investigate if linksIn check obviates need for this */\n if (hasAscendant(node.resolveParent, compareNodes)) {\n return true\n }\n }\n for (const edge of node.edgesIn) {\n // TODO Need a test with an infinite loop\n if (seen.has(edge)) {\n continue\n }\n seen.add(edge)\n if (edge && edge.from && hasAscendant(edge.from, compareNodes, seen)) {\n return true\n }\n }\n for (const linkNode of node.linksIn) {\n if (hasAscendant(linkNode, compareNodes, seen)) {\n return true\n }\n }\n return false\n}\n\nconst combinators = {\n // direct descendant\n '>' (prevResults, nextResults) {\n return nextResults.filter(node => hasParent(node, prevResults))\n },\n // any descendant\n ' ' (prevResults, nextResults) {\n return nextResults.filter(node => hasAscendant(node, prevResults))\n },\n // sibling\n '~' (prevResults, nextResults) {\n // Return any node in nextResults that is a sibling of (aka shares a\n // parent with) a node in prevResults\n const parentNodes = new Set() // Parents of everything in prevResults\n for (const node of prevResults) {\n for (const edge of node.edgesIn) {\n // edge.from always exists cause it's from another node's edgesIn\n parentNodes.add(edge.from)\n }\n }\n return nextResults.filter(node =>\n !prevResults.includes(node) && hasParent(node, [...parentNodes])\n )\n },\n}\n\n// get a list of available versions of a package filtered to respect --before\n// NOTE: this runs over each node and should not throw\nconst getPackageVersions = async (name, opts) => {\n let packument\n try {\n packument = await pacote.packument(name, {\n ...opts,\n fullMetadata: false, // we only need the corgi\n })\n } catch (err) {\n // if the fetch fails, log a warning and pretend there are no versions\n log.warn('query', `could not retrieve packument for ${name}: ${err.message}`)\n return []\n }\n\n // start with a sorted list of all versions (lowest first)\n let candidates = Object.keys(packument.versions).sort(semver.compare)\n\n // if the packument has a time property, and the user passed a before flag, then\n // we filter this list down to only those versions that existed before the specified date.\n // packages matching `min-release-age-exclude` are exempt from this filter.\n if (packument.time && opts.before && !isReleaseAgeExcluded(name, opts.minReleaseAgeExclude)) {\n candidates = candidates.filter((version) => {\n // this version isn't found in the times at all, drop it\n if (!packument.time[version]) {\n return false\n }\n\n return Date.parse(packument.time[version]) <= opts.before\n })\n }\n\n return candidates\n}\n\nconst retrieveNodesFromParsedAst = async (opts) => {\n // when we first call this it's the parsed query. all other times it's\n // results.currentNode.nestedNode\n const rootAstNode = opts.rootAstNode\n\n if (!rootAstNode.nodes) {\n return new Set()\n }\n\n const results = new Results(opts)\n\n const astNodeQueue = new Set()\n // walk is sync, so we have to build up our async functions and then await them later\n rootAstNode.walk((nextAstNode) => {\n astNodeQueue.add(nextAstNode)\n })\n\n for (const nextAstNode of astNodeQueue) {\n // This is the only place we reset currentAstNode\n results.currentAstNode = nextAstNode\n const updateFn = `${results.currentAstNode.type}Type`\n if (typeof results[updateFn] !== 'function') {\n throw Object.assign(\n new Error(`\\`${results.currentAstNode.type}\\` is not a supported selector.`),\n { code: 'EQUERYNOSELECTOR' }\n )\n }\n await results[updateFn]()\n }\n\n return results.collect(rootAstNode)\n}\n\nconst querySelectorAll = async (targetNode, query, flatOptions) => {\n // This never changes ever we just pass it around. But we can't scope it to\n // this whole file if we ever want to support concurrent calls to this\n // function.\n const inventory = [...targetNode.root.inventory.values()]\n // res is a Set of items returned for each parsed css ast selector\n const res = await retrieveNodesFromParsedAst({\n initialItems: inventory,\n inventory,\n flatOptions,\n rootAstNode: parser(query),\n targetNode,\n })\n\n // returns nodes ordered by realpath\n return [...res].sort((a, b) => localeCompare(a.location, b.location))\n}\n\nmodule.exports = querySelectorAll\n","// inventory, path, realpath, root, and parent\n//\n// node.root is a reference to the root module in the tree (ie, typically the\n// cwd project folder)\n//\n// node.location is the /-delimited path from the root module to the node. In\n// the case of link targets that may be outside of the root's package tree,\n// this can include some number of /../ path segments. The location of the\n// root module is always '.'. node.location thus never contains drive letters\n// or absolute paths, and is portable within a given project, suitable for\n// inclusion in lockfiles and metadata.\n//\n// node.path is the path to the place where this node lives on disk. It is\n// system-specific and absolute.\n//\n// node.realpath is the path to where the module actually resides on disk. In\n// the case of non-link nodes, node.realpath is equivalent to node.path. In\n// the case of link nodes, it is equivalent to node.target.path.\n//\n// Setting node.parent will set the node's root to the parent's root, as well\n// as updating edgesIn and edgesOut to reload dependency resolutions as needed,\n// and setting node.path to parent.path/node_modules/name.\n//\n// node.inventory is a Map of name to a Set() of all the nodes under a given\n// root by that name. It's empty for non-root nodes, and changing the root\n// reference will remove it from the old root's inventory and add it to the new\n// one. This map is useful for cases like `npm update foo` or `npm ls foo`\n// where we need to quickly find all instances of a given package name within a\n// tree.\n\nconst PackageJson = require('@npmcli/package-json')\nconst nameFromFolder = require('@npmcli/name-from-folder')\nconst npa = require('npm-package-arg')\nconst semver = require('semver')\nconst util = require('node:util')\nconst { getPaths: getBinPaths } = require('bin-links')\nconst { log } = require('proc-log')\nconst { resolve, relative, dirname, basename } = require('node:path')\nconst { walkUp } = require('walk-up-path')\n\nconst CaseInsensitiveMap = require('./case-insensitive-map.js')\nconst Edge = require('./edge.js')\nconst Inventory = require('./inventory.js')\nconst OverrideSet = require('./override-set.js')\nconst consistentResolve = require('./consistent-resolve.js')\nconst debug = require('./debug.js')\nconst gatherDepSet = require('./gather-dep-set.js')\nconst printableTree = require('./printable.js')\nconst querySelectorAll = require('./query-selector-all.js')\nconst relpath = require('./relpath.js')\nconst treeCheck = require('./tree-check.js')\n\nconst _package = Symbol('_package')\nconst _parent = Symbol('_parent')\nconst _target = Symbol.for('_target')\nconst _fsParent = Symbol('_fsParent')\nconst _reloadNamedEdges = Symbol('_reloadNamedEdges')\n// overridden by Link class\nconst _loadDeps = Symbol.for('Arborist.Node._loadDeps')\nconst _refreshLocation = Symbol.for('_refreshLocation')\nconst _changePath = Symbol.for('_changePath')\n// used by Link class as well\nconst _delistFromMeta = Symbol.for('_delistFromMeta')\nconst _explain = Symbol('_explain')\nconst _explanation = Symbol('_explanation')\n\nclass Node {\n #global\n #meta\n #root\n #workspaces\n\n constructor (options) {\n // NB: path can be null if it's a link target\n const {\n children,\n dev = true,\n devOptional = true,\n dummy = false,\n error,\n extraneous = true,\n fsChildren,\n fsParent,\n global = false,\n inert = false,\n installLinks = false,\n integrity,\n isInStore = false,\n legacyPeerDeps = false,\n linksIn,\n loadOverrides = false,\n meta,\n name, // allow setting name explicitly when we haven't set a path yet\n optional = true,\n overrides,\n packageExtensionsApplied = null,\n npmExtensionApplied = null,\n parent,\n patched = null,\n path,\n peer = true,\n realpath,\n resolved,\n root,\n sourceReference = null,\n } = options\n // this object gives querySelectorAll somewhere to stash context about a node\n // while processing a query\n this.queryContext = {}\n\n // true if part of a global install\n this.#global = global\n\n this.#workspaces = null\n\n this.errors = error ? [error] : []\n this.isInStore = isInStore\n\n // this will usually be null, except when modeling a\n // package's dependencies in a virtual root.\n this.sourceReference = sourceReference\n\n // have to set the internal package ref before assigning the parent, because this.package is read when adding to inventory\n if (sourceReference) {\n this[_package] = sourceReference.package\n } else {\n // TODO if this came from pacote.manifest we don't have to do this, we can be told to skip this step\n const pkg = new PackageJson()\n let content = {}\n // TODO this is overly guarded. If pkg is not an object we should not allow it at all.\n if (options.pkg && typeof options.pkg === 'object') {\n content = options.pkg\n }\n pkg.fromContent(content)\n pkg.syncNormalize()\n this[_package] = pkg.content\n }\n\n this.name = name ||\n nameFromFolder(path || this.package.name || realpath) ||\n this.package.name ||\n null\n\n // should be equal if not a link\n this.path = path ? resolve(path) : null\n\n if (!this.name && (!this.path || this.path !== dirname(this.path))) {\n throw new TypeError('could not detect node name from path or package')\n }\n\n this.realpath = !this.isLink ? this.path : resolve(realpath)\n\n this.resolved = resolved || null\n if (!this.resolved) {\n // note: this *only* works for non-file: deps, so we avoid even\n // trying here.\n // file: deps are tracked in package.json will _resolved set to the\n // full path to the tarball or link target. However, if the package\n // is checked into git or moved to another location, that's 100% not\n // portable at all! The _where and _location don't provide much help,\n // since _location is just where the module ended up in the tree,\n // and _where can be different than the actual root if it's a\n // meta-dep deeper in the dependency graph.\n //\n // If we don't have the other oldest indicators of legacy npm, then it's\n // probably what we're getting from pacote, which IS trustworthy.\n //\n // Otherwise, hopefully a shrinkwrap will help us out.\n const resolved = consistentResolve(this.package._resolved)\n if (resolved && !(/^file:/.test(resolved) && this.package._where)) {\n this.resolved = resolved\n }\n }\n this.integrity = integrity || this.package._integrity || null\n // Patch record { path, integrity } or null, set from patchedDependencies or the lockfile.\n this.patched = patched || null\n // Provenance for a root packageExtensions repair applied to this node's manifest, or null.\n // Shape: { selector, dependencies?, optionalDependencies?, peerDependencies?, peerDependenciesMeta? }.\n this.packageExtensionsApplied = packageExtensionsApplied\n // Provenance for a root .npm-extension transformManifest repair applied to this node's manifest, or null.\n // Shape: { extensionPoint, dependencies?, optionalDependencies?, peerDependencies?, peerDependenciesMeta? }.\n this.npmExtensionApplied = npmExtensionApplied\n this.installLinks = installLinks\n this.legacyPeerDeps = legacyPeerDeps\n\n this.children = new CaseInsensitiveMap()\n this.fsChildren = new Set()\n this.inventory = new Inventory()\n this.tops = new Set()\n this.linksIn = new Set(linksIn || [])\n\n // these three are set by an Arborist taking a catalog\n // after the tree is built. We don't get this along the way,\n // because they have a tendency to change as new children are\n // added, especially when they're deduped. Eg, a dev dep may be\n // a 3-levels-deep dependency of a non-dev dep. If we calc the\n // flags along the way, then they'll tend to be invalid by the\n // time we need to look at them.\n if (!dummy) {\n this.dev = dev\n this.optional = optional\n this.devOptional = devOptional\n this.peer = peer\n this.extraneous = extraneous\n this.dummy = false\n } else {\n // true if this is a placeholder for the purpose of serving as a\n // fsParent to link targets that get their deps resolved outside\n // the root tree folder.\n this.dummy = true\n this.dev = false\n this.optional = false\n this.devOptional = false\n this.peer = false\n this.extraneous = false\n }\n\n this.inert = inert\n\n this.edgesIn = new Set()\n this.edgesOut = new CaseInsensitiveMap()\n\n if (overrides) {\n this.overrides = overrides\n } else if (loadOverrides) {\n const overrides = this.package.overrides || {}\n if (Object.keys(overrides).length > 0) {\n this.overrides = new OverrideSet({\n overrides: this.package.overrides,\n })\n }\n }\n\n // only relevant for the root and top nodes\n this.meta = meta\n\n // Note: this is _slightly_ less efficient for the initial tree\n // building than it could be, but in exchange, it's a much simpler\n // algorithm.\n // If this node has a bunch of children, and those children satisfy\n // its various deps, then we're going to _first_ create all the\n // edges, and _then_ assign the children into place, re-resolving\n // them all in _reloadNamedEdges.\n // A more efficient, but more complicated, approach would be to\n // flag this node as being a part of a tree build, so it could\n // hold off on resolving its deps until its children are in place.\n\n // call the parent setter\n // Must be set prior to calling _loadDeps, because top-ness is relevant\n\n // will also assign root if present on the parent\n this[_parent] = null\n this.parent = parent || null\n\n this[_fsParent] = null\n this.fsParent = fsParent || null\n\n // see parent/root setters below.\n // root is set to parent's root if we have a parent; otherwise, if it's\n // null, then it's set to the node itself.\n if (!parent && !fsParent) {\n this.root = root || null\n }\n\n // mostly a convenience for testing, but also a way to create\n // trees in a more declarative way than setting parent on each\n if (children) {\n for (const c of children) {\n new Node({ ...c, parent: this })\n }\n }\n if (fsChildren) {\n for (const c of fsChildren) {\n new Node({ ...c, fsParent: this })\n }\n }\n\n // now load all the dep edges\n this[_loadDeps]()\n }\n\n get meta () {\n return this.#meta\n }\n\n set meta (meta) {\n this.#meta = meta\n if (meta) {\n meta.add(this)\n }\n }\n\n get global () {\n if (this.#root === this) {\n return this.#global\n }\n return this.#root.global\n }\n\n // true for packages installed directly in the global node_modules folder\n get globalTop () {\n return this.global && this.parent && this.parent.isProjectRoot\n }\n\n get workspaces () {\n return this.#workspaces\n }\n\n set workspaces (workspaces) {\n // deletes edges if they already exists\n if (this.#workspaces) {\n for (const name of this.#workspaces.keys()) {\n if (!workspaces.has(name)) {\n this.edgesOut.get(name).detach()\n }\n }\n }\n\n this.#workspaces = workspaces\n this.#loadWorkspaces()\n this[_loadDeps]()\n }\n\n get binPaths () {\n if (!this.parent) {\n return []\n }\n\n return getBinPaths({\n pkg: this.package,\n path: this.path,\n global: this.global,\n top: this.globalTop,\n })\n }\n\n get hasInstallScript () {\n const { hasInstallScript, scripts } = this.package\n const { install, preinstall, postinstall } = scripts || {}\n return !!(hasInstallScript || install || preinstall || postinstall)\n }\n\n get version () {\n return this.package.version || ''\n }\n\n get packageName () {\n return this.package.name || null\n }\n\n get pkgid () {\n const { name = '', version = '' } = this.package\n // root package will prefer package name over folder name,\n // and never be called an alias.\n const { isProjectRoot } = this\n const myname = isProjectRoot ? name || this.name\n : this.name\n const alias = !isProjectRoot && name && myname !== name ? `npm:${name}@`\n : ''\n return `${myname}@${alias}${version}`\n }\n\n get overridden () {\n if (!this.overrides) {\n return false\n }\n if (!this.overrides.value) {\n return false\n }\n if (this.overrides.name !== this.name) {\n return false\n }\n\n // The overrides rule is for a package with this name, but some override rules only apply to specific\n // versions. To make sure this package was actually overridden, we check whether any edge going in\n // had the rule applied to it, in which case its overrides set is different than its source node.\n for (const edge of this.edgesIn) {\n if (edge.overrides && edge.overrides.name === this.name && edge.overrides.value === this.version) {\n if (!edge.overrides.isEqual(edge.from.overrides)) {\n return true\n }\n }\n }\n\n return false\n }\n\n get package () {\n return this[_package]\n }\n\n set package (pkg) {\n // just detach them all. we could make this _slightly_ more efficient\n // by only detaching the ones that changed, but we'd still have to walk\n // them all, and the comparison logic gets a bit tricky. we generally\n // only do this more than once at the root level, so the resolve() calls\n // are only one level deep, and there's not much to be saved, anyway.\n // simpler to just toss them all out.\n for (const edge of this.edgesOut.values()) {\n edge.detach()\n }\n\n this[_explanation] = null\n /* istanbul ignore next - should be impossible */\n if (!pkg || typeof pkg !== 'object') {\n debug(() => {\n throw new Error('setting Node.package to non-object')\n })\n pkg = {}\n }\n this[_package] = pkg\n this.#loadWorkspaces()\n this[_loadDeps]()\n // do a hard reload, since the dependents may now be valid or invalid\n // as a result of the package change.\n this.edgesIn.forEach(edge => edge.reload(true))\n }\n\n // node.explain(nodes seen already, edge we're trying to satisfy\n // if edge is not specified, it lists every edge into the node.\n explain (edge = null, seen = []) {\n if (this[_explanation]) {\n return this[_explanation]\n }\n\n return this[_explanation] = this[_explain](edge, seen)\n }\n\n [_explain] (edge, seen) {\n if (this.isProjectRoot && !this.sourceReference) {\n return {\n location: this.path,\n }\n }\n\n const why = {\n name: this.isProjectRoot || this.isTop ? this.packageName : this.name,\n version: this.package.version,\n }\n if (this.errors.length || !this.packageName || !this.package.version) {\n why.errors = this.errors.length ? this.errors : [\n new Error('invalid package: lacks name and/or version'),\n ]\n why.package = this.package\n }\n\n if (this.root.sourceReference) {\n const { name, version } = this.root.package\n why.whileInstalling = {\n name,\n version,\n path: this.root.sourceReference.path,\n }\n }\n\n if (this.sourceReference) {\n return this.sourceReference.explain(edge, seen)\n }\n\n if (seen.includes(this)) {\n return why\n }\n\n why.location = this.location\n why.isWorkspace = this.isWorkspace\n\n // make a new list each time. we can revisit, but not loop.\n seen = seen.concat(this)\n\n why.dependents = []\n if (edge) {\n why.dependents.push(edge.explain(seen))\n } else {\n // ignore invalid edges, since those aren't satisfied by this thing,\n // and are not keeping it held in this spot anyway.\n const edges = []\n for (const edge of this.edgesIn) {\n if (!edge.valid && !edge.from.isProjectRoot) {\n continue\n }\n\n edges.push(edge)\n }\n for (const edge of edges) {\n why.dependents.push(edge.explain(seen))\n }\n }\n\n if (this.linksIn.size) {\n why.linksIn = [...this.linksIn].map(link => link[_explain](edge, seen))\n }\n\n return why\n }\n\n isDescendantOf (node) {\n for (let p = this; p; p = p.resolveParent) {\n if (p === node) {\n return true\n }\n }\n return false\n }\n\n shouldOmit (omitSet) {\n if (!omitSet.size) {\n return false\n }\n\n const { top } = this\n\n // if the top is not the root or workspace then we do not want to omit it\n if (!top.isProjectRoot && !top.isWorkspace) {\n return false\n }\n\n // omit node if the dep type matches any omit flags that were set\n return (\n this.peer && omitSet.has('peer') ||\n this.dev && omitSet.has('dev') ||\n this.optional && omitSet.has('optional') ||\n this.devOptional && omitSet.has('optional') && omitSet.has('dev')\n )\n }\n\n getBundler (path = []) {\n // made a cycle, definitely not bundled!\n if (path.includes(this)) {\n return null\n }\n\n path.push(this)\n\n const parent = this[_parent]\n if (!parent) {\n return null\n }\n\n const pBundler = parent.getBundler(path)\n if (pBundler) {\n return pBundler\n }\n\n const ppkg = parent.package\n const bd = ppkg && ppkg.bundleDependencies\n // explicit bundling\n if (Array.isArray(bd) && bd.includes(this.name)) {\n return parent\n }\n\n // deps that are deduped up to the bundling level are bundled.\n // however, if they get their dep met further up than that,\n // then they are not bundled. Ie, installing a package with\n // unmet bundled deps will not cause your deps to be bundled.\n for (const edge of this.edgesIn) {\n const eBundler = edge.from.getBundler(path)\n if (!eBundler) {\n continue\n }\n\n if (eBundler === parent) {\n return eBundler\n }\n }\n\n return null\n }\n\n get inBundle () {\n return !!this.getBundler()\n }\n\n // when reifying, if a package is technically in a bundleDependencies list,\n // but that list is the root project, we still have to install it. This\n // getter returns true if it's in a dependency's bundle list, not the root's.\n get inDepBundle () {\n const bundler = this.getBundler()\n return !!bundler && bundler !== this.root\n }\n\n get isWorkspace () {\n if (this.isProjectRoot) {\n return false\n }\n const { root } = this\n const { type, to } = root.edgesOut.get(this.packageName) || {}\n return type === 'workspace' && to && (to.target === this || to === this)\n }\n\n get isRoot () {\n return this === this.root\n }\n\n get isProjectRoot () {\n // only treat as project root if it's the actual link that is the root, or the target of the root link, but NOT if it's another link to the same root that happens to be somewhere else.\n return this === this.root || this === this.root.target\n }\n\n get isRegistryDependency () {\n if (this.edgesIn.size === 0) {\n return false\n }\n for (const edge of this.edgesIn) {\n if (!npa(edge.spec).registry) {\n return false\n }\n }\n return true\n }\n\n * ancestry () {\n for (let anc = this; anc; anc = anc.resolveParent) {\n yield anc\n }\n }\n\n set root (root) {\n // setting to null means this is the new root\n // should only ever be one step\n while (root && root.root !== root) {\n root = root.root\n }\n\n root = root || this\n\n // delete from current root inventory\n this[_delistFromMeta]()\n\n // can't set the root (yet) if there's no way to determine location\n // this allows us to do new Node({...}) and then set the root later.\n // just make the assignment so we don't lose it, and move on.\n if (!this.path || !root.realpath || !root.path) {\n this.#root = root\n return\n }\n\n // temporarily become a root node\n this.#root = this\n\n // break all linksIn, we're going to re-set them if needed later\n for (const link of this.linksIn) {\n link[_target] = null\n this.linksIn.delete(link)\n }\n\n // temporarily break this link as well, we'll re-set if possible later\n const { target } = this\n if (this.isLink) {\n if (target) {\n target.linksIn.delete(this)\n if (target.root === this) {\n target[_delistFromMeta]()\n }\n }\n this[_target] = null\n }\n\n // if this is part of a cascading root set, then don't do this bit\n // but if the parent/fsParent is in a different set, we have to break\n // that reference before proceeding\n if (this.parent && this.parent.root !== root) {\n this.parent.children.delete(this.name)\n this[_parent] = null\n }\n if (this.fsParent && this.fsParent.root !== root) {\n this.fsParent.fsChildren.delete(this)\n this[_fsParent] = null\n }\n\n if (root === this) {\n this[_refreshLocation]()\n } else {\n // setting to some different node.\n const loc = relpath(root.realpath, this.path)\n const current = root.inventory.get(loc)\n\n // clobber whatever is there now\n if (current) {\n current.root = null\n }\n\n this.#root = root\n // set this.location and add to inventory\n this[_refreshLocation]()\n\n // try to find our parent/fsParent in the new root inventory\n for (const p of walkUp(dirname(this.path))) {\n if (p === this.path) {\n continue\n }\n const ploc = relpath(root.realpath, p)\n const parent = root.inventory.get(ploc)\n if (parent) {\n /* istanbul ignore next - impossible */\n if (parent.isLink) {\n debug(() => {\n throw Object.assign(new Error('assigning parentage to link'), {\n path: this.path,\n parent: parent.path,\n parentReal: parent.realpath,\n })\n })\n continue\n }\n const childLoc = `${ploc}${ploc ? '/' : ''}node_modules/${this.name}`\n const isParent = this.location === childLoc\n if (isParent) {\n const oldChild = parent.children.get(this.name)\n if (oldChild && oldChild !== this) {\n oldChild.root = null\n }\n if (this.parent) {\n this.parent.children.delete(this.name)\n this.parent[_reloadNamedEdges](this.name)\n }\n parent.children.set(this.name, this)\n this[_parent] = parent\n // don't do it for links, because they don't have a target yet\n // we'll hit them up a bit later on.\n if (!this.isLink) {\n parent[_reloadNamedEdges](this.name)\n }\n } else {\n /* istanbul ignore if - should be impossible, since we break\n * all fsParent/child relationships when moving? */\n if (this.fsParent) {\n this.fsParent.fsChildren.delete(this)\n }\n parent.fsChildren.add(this)\n this[_fsParent] = parent\n }\n break\n }\n }\n\n // if it doesn't have a parent, it's a top node\n if (!this.parent) {\n root.tops.add(this)\n } else {\n root.tops.delete(this)\n }\n\n // assign parentage for any nodes that need to have this as a parent\n // this can happen when we have a node at nm/a/nm/b added *before*\n // the node at nm/a, which might have the root node as a fsParent.\n // we can't rely on the public setter here, because it calls into\n // this function to set up these references!\n // check dirname so that /foo isn't treated as the fsparent of /foo-bar\n const nmloc = `${this.location}${this.location ? '/' : ''}node_modules/`\n // only walk top nodes, since anything else already has a parent.\n for (const child of root.tops) {\n const isChild = child.location === nmloc + child.name\n const isFsChild =\n dirname(child.path).startsWith(this.path) &&\n child !== this &&\n !child.parent &&\n (\n !child.fsParent ||\n child.fsParent === this ||\n dirname(this.path).startsWith(child.fsParent.path)\n )\n\n if (!isChild && !isFsChild) {\n continue\n }\n\n // set up the internal parentage links\n if (this.isLink) {\n child.root = null\n } else {\n // can't possibly have a parent, because it's in tops\n if (child.fsParent) {\n child.fsParent.fsChildren.delete(child)\n }\n child[_fsParent] = null\n if (isChild) {\n this.children.set(child.name, child)\n child[_parent] = this\n root.tops.delete(child)\n } else {\n this.fsChildren.add(child)\n child[_fsParent] = this\n }\n }\n }\n\n // look for any nodes with the same realpath. either they're links\n // to that realpath, or a thing at that realpath if we're adding a link\n // (if we're adding a regular node, we already deleted the old one)\n for (const node of root.inventory.query('realpath', this.realpath)) {\n if (node === this) {\n continue\n }\n\n /* istanbul ignore next - should be impossible */\n debug(() => {\n if (node.root !== root) {\n throw new Error('inventory contains node from other root')\n }\n })\n\n if (this.isLink) {\n const target = node.target\n this[_target] = target\n this[_package] = target.package\n target.linksIn.add(this)\n // reload edges here, because now we have a target\n if (this.parent) {\n this.parent[_reloadNamedEdges](this.name)\n }\n break\n } else {\n /* istanbul ignore else - should be impossible */\n if (node.isLink) {\n node[_target] = this\n node[_package] = this.package\n this.linksIn.add(node)\n if (node.parent) {\n node.parent[_reloadNamedEdges](node.name)\n }\n } else {\n debug(() => {\n throw Object.assign(new Error('duplicate node in root setter'), {\n path: this.path,\n realpath: this.realpath,\n root: root.realpath,\n })\n })\n }\n }\n }\n }\n\n // reload all edgesIn where the root doesn't match, so we don't have\n // cross-tree dependency graphs\n for (const edge of this.edgesIn) {\n if (edge.from.root !== root) {\n edge.reload()\n }\n }\n // reload all edgesOut where root doesn't match, or is missing, since\n // it might not be missing in the new tree\n for (const edge of this.edgesOut.values()) {\n if (!edge.to || edge.to.root !== root) {\n edge.reload()\n }\n }\n\n // now make sure our family comes along for the ride!\n const family = new Set([\n ...this.fsChildren,\n ...this.children.values(),\n ...this.inventory.values(),\n ].filter(n => n !== this))\n\n for (const child of family) {\n if (child.root !== root) {\n child[_delistFromMeta]()\n child[_parent] = null\n this.children.delete(child.name)\n child[_fsParent] = null\n this.fsChildren.delete(child)\n for (const l of child.linksIn) {\n l[_target] = null\n child.linksIn.delete(l)\n }\n }\n }\n for (const child of family) {\n if (child.root !== root) {\n child.root = root\n }\n }\n\n // if we had a target, and didn't find one in the new root, then bring\n // it over as well, but only if we're setting the link into a new root,\n // as we don't want to lose the target any time we remove a link.\n if (this.isLink && target && !this.target && root !== this) {\n target.root = root\n }\n\n // tree should always be valid upon root setter completion.\n treeCheck(this)\n if (this !== root) {\n treeCheck(root)\n }\n }\n\n get root () {\n return this.#root || this\n }\n\n #loadWorkspaces () {\n if (!this.#workspaces) {\n return\n }\n\n for (const [name, path] of this.#workspaces.entries()) {\n new Edge({ from: this, name, spec: `file:${path}`, type: 'workspace' })\n }\n }\n\n [_loadDeps] () {\n // Caveat! Order is relevant!\n // Packages in optionalDependencies are optional.\n // Packages in both deps and devDeps are required.\n // Note the subtle breaking change from v6: it is no longer possible\n // to have a different spec for a devDep than production dep.\n\n // Linked targets that are disconnected from the tree are tops,\n // but don't have a 'path' field, only a 'realpath', because we\n // don't know their canonical location. We don't need their devDeps.\n const pd = this.package.peerDependencies\n const ad = this.package.acceptDependencies || {}\n if (pd && typeof pd === 'object' && !this.legacyPeerDeps) {\n const pm = this.package.peerDependenciesMeta || {}\n const peerDependencies = {}\n const peerOptional = {}\n for (const [name, dep] of Object.entries(pd)) {\n if (pm[name]?.optional) {\n peerOptional[name] = dep\n } else {\n peerDependencies[name] = dep\n }\n }\n this.#loadDepType(peerDependencies, 'peer', ad)\n this.#loadDepType(peerOptional, 'peerOptional', ad)\n }\n\n this.#loadDepType(this.package.dependencies, 'prod', ad)\n this.#loadDepType(this.package.optionalDependencies, 'optional', ad)\n\n const { globalTop, isTop, path, sourceReference } = this\n const {\n globalTop: srcGlobalTop,\n isTop: srcTop,\n path: srcPath,\n } = sourceReference || {}\n // A package in the linked strategy's .store is a transitive dependency that is structurally a tree top, but its devDependencies are never installed or required, so they must not be loaded.\n const thisDev = isTop && !globalTop && path && !this.isInStore\n const srcDev = !sourceReference || srcTop && !srcGlobalTop && srcPath\n if (thisDev && srcDev) {\n this.#loadDepType(this.package.devDependencies, 'dev', ad)\n }\n }\n\n #loadDepType (deps, type, ad) {\n // Because of the order in which _loadDeps runs, we always want to\n // prioritize a new edge over an existing one\n for (const [name, spec] of Object.entries(deps || {})) {\n const current = this.edgesOut.get(name)\n if (!current || current.type !== 'workspace') {\n new Edge({ from: this, name, spec, accept: ad[name], type })\n }\n }\n }\n\n get fsParent () {\n // in debug setter prevents fsParent from being this\n return this[_fsParent]\n }\n\n set fsParent (fsParent) {\n if (!fsParent) {\n if (this[_fsParent]) {\n this.root = null\n }\n return\n }\n\n debug(() => {\n if (fsParent === this) {\n throw new Error('setting node to its own fsParent')\n }\n\n if (fsParent.realpath === this.realpath) {\n throw new Error('setting fsParent to same path')\n }\n\n // the initial set MUST be an actual walk-up from the realpath\n // subsequent sets will re-root on the new fsParent's path.\n if (!this[_fsParent] && this.realpath.indexOf(fsParent.realpath) !== 0) {\n throw Object.assign(new Error('setting fsParent improperly'), {\n path: this.path,\n realpath: this.realpath,\n fsParent: {\n path: fsParent.path,\n realpath: fsParent.realpath,\n },\n })\n }\n })\n\n if (fsParent.isLink) {\n fsParent = fsParent.target\n }\n\n // setting a thing to its own fsParent is not normal, but no-op for safety\n if (this === fsParent || fsParent.realpath === this.realpath) {\n return\n }\n\n // nothing to do\n if (this[_fsParent] === fsParent) {\n return\n }\n\n const oldFsParent = this[_fsParent]\n const newPath = !oldFsParent ? this.path\n : resolve(fsParent.path, relative(oldFsParent.path, this.path))\n const nmPath = resolve(fsParent.path, 'node_modules', this.name)\n\n // this is actually the parent, set that instead\n if (newPath === nmPath) {\n this.parent = fsParent\n return\n }\n\n const pathChange = newPath !== this.path\n\n // remove from old parent/fsParent\n const oldParent = this.parent\n const oldName = this.name\n if (this.parent) {\n this.parent.children.delete(this.name)\n this[_parent] = null\n }\n if (this.fsParent) {\n this.fsParent.fsChildren.delete(this)\n this[_fsParent] = null\n }\n\n // update this.path/realpath for this and all children/fsChildren\n if (pathChange) {\n this[_changePath](newPath)\n }\n\n if (oldParent) {\n oldParent[_reloadNamedEdges](oldName)\n }\n\n // clobbers anything at that path, resets all appropriate references\n this.root = fsParent.root\n }\n\n // is it safe to replace one node with another? check the edges to\n // make sure no one will get upset. Note that the node might end up\n // having its own unmet dependencies, if the new node has new deps.\n // Note that there are cases where Arborist will opt to insert a node\n // into the tree even though this function returns false! This is\n // necessary when a root dependency is added or updated, or when a\n // root dependency brings peer deps along with it. In that case, we\n // will go ahead and create the invalid state, and then try to resolve\n // it with more tree construction, because it's a user request.\n canReplaceWith (node, ignorePeers) {\n if (node.name !== this.name) {\n return false\n }\n\n if (node.packageName !== this.packageName) {\n return false\n }\n\n // If this node has no dependencies, then it's irrelevant to check the override\n // rules of the replacement node.\n if (this.edgesOut.size) {\n // XXX need to check for two root nodes?\n if (node.overrides) {\n if (!node.overrides.isEqual(this.overrides)) {\n return false\n }\n } else {\n if (this.overrides) {\n return false\n }\n }\n }\n\n ignorePeers = new Set(ignorePeers)\n\n // gather up all the deps of this node and that are only depended\n // upon by deps of this node. those ones don't count, since\n // they'll be replaced if this node is replaced anyway.\n const depSet = gatherDepSet([this], e => e.to !== this && e.valid)\n\n for (const edge of this.edgesIn) {\n // when replacing peer sets, we need to be able to replace the entire\n // peer group, which means we ignore incoming edges from other peers\n // within the replacement set.\n if (!this.isTop &&\n edge.from.parent === this.parent &&\n edge.peer &&\n ignorePeers.has(edge.from.name)) {\n continue\n }\n\n // only care about edges that don't originate from this node\n if (!depSet.has(edge.from) && !edge.satisfiedBy(node)) {\n return false\n }\n }\n\n return true\n }\n\n canReplace (node, ignorePeers) {\n return node.canReplaceWith(this, ignorePeers)\n }\n\n // return true if it's safe to remove this node, because anything that\n // is depending on it would be fine with the thing that they would resolve\n // to if it was removed, or nothing is depending on it in the first place.\n canDedupe (preferDedupe = false, explicitRequest = false) {\n // not allowed to mess with bundles\n if (this.inDepBundle) {\n return false\n }\n\n // it's a top level pkg, or a dep of one\n if (!this.resolveParent || !this.resolveParent.resolveParent) {\n return false\n }\n\n // no one wants it, remove it\n if (this.edgesIn.size === 0) {\n return true\n }\n\n const other = this.resolveParent.resolveParent.resolve(this.name)\n\n // nothing else, need this one\n if (!other) {\n return false\n }\n\n // if it's the same thing, then always fine to remove\n if (other.matches(this)) {\n return true\n }\n\n // if the other thing can't replace this, then skip it\n if (!other.canReplace(this)) {\n return false\n }\n\n // if we prefer dedupe, or if the version is equal, take the other\n if (preferDedupe || semver.eq(other.version, this.version)) {\n return true\n }\n\n // if our current version isn't the result of an override, then prefer to take the greater version\n if (!this.overridden && semver.gt(other.version, this.version)) {\n return true\n }\n\n // if the other version was an explicit request, then prefer to take the other version\n if (explicitRequest) {\n return true\n }\n\n return false\n }\n\n satisfies (requested) {\n if (requested instanceof Edge) {\n return this.name === requested.name && requested.satisfiedBy(this)\n }\n\n const parsed = npa(requested)\n const { name = this.name, rawSpec: spec } = parsed\n return this.name === name && this.satisfies(new Edge({\n from: new Node({ path: this.root.realpath }),\n type: 'prod',\n name,\n spec,\n }))\n }\n\n matches (node) {\n // if the nodes are literally the same object, obviously a match.\n if (node === this) {\n return true\n }\n\n // if the names don't match, they're different things, even if\n // the package contents are identical.\n if (node.name !== this.name) {\n return false\n }\n\n // if they're links, they match if the targets match\n if (this.isLink) {\n return node.isLink && this.target.matches(node.target)\n }\n\n // if they're two project root nodes, they're different if the paths differ\n if (this.isProjectRoot && node.isProjectRoot) {\n return this.path === node.path\n }\n\n // if the integrity matches, then they're the same.\n if (this.integrity && node.integrity) {\n return this.integrity === node.integrity\n }\n\n // if no integrity, check resolved\n if (this.resolved && node.resolved) {\n return this.resolved === node.resolved\n }\n\n // if no resolved, check both package name and version\n // otherwise, conclude that they are different things\n return this.packageName && node.packageName &&\n this.packageName === node.packageName &&\n this.version && node.version &&\n this.version === node.version\n }\n\n // replace this node with the supplied argument\n // Useful when mutating an ideal tree, so we can avoid having to call\n // the parent/root setters more than necessary.\n replaceWith (node) {\n node.replace(this)\n }\n\n replace (node) {\n this[_delistFromMeta]()\n\n // if the name matches, but is not identical, we are intending to clobber\n // something case-insensitively, so merely setting name and path won't\n // have the desired effect. just set the path so it'll collide in the\n // parent's children map, and leave it at that.\n if (node.parent?.children.get(this.name) === node) {\n this.path = resolve(node.parent.path, 'node_modules', this.name)\n } else {\n this.path = node.path\n this.name = node.name\n }\n\n if (!this.isLink) {\n this.realpath = this.path\n }\n this[_refreshLocation]()\n\n // keep children when a node replaces another\n if (!this.isLink) {\n for (const kid of node.children.values()) {\n kid.parent = this\n }\n if (node.isLink && node.target) {\n node.target.root = null\n }\n }\n\n if (!node.isRoot) {\n this.root = node.root\n }\n\n treeCheck(this)\n }\n\n get parent () {\n // setter prevents _parent from being this\n return this[_parent]\n }\n\n // This setter keeps everything in order when we move a node from\n // one point in a logical tree to another. Edges get reloaded,\n // metadata updated, etc. It's also called when we *replace* a node\n // with another by the same name (eg, to update or dedupe).\n // This does a couple of walks out on the node_modules tree, recursing\n // into child nodes. However, as setting the parent is typically done\n // with nodes that don't have many children, and (deduped) package\n // trees tend to be broad rather than deep, it's not that bad.\n // The only walk that starts from the parent rather than this node is\n // limited by edge name.\n set parent (parent) {\n // when setting to null, just remove it from the tree entirely\n if (!parent) {\n // but only delete it if we actually had a parent in the first place\n // otherwise it's just setting to null when it's already null\n if (this[_parent]) {\n this.root = null\n }\n return\n }\n\n if (parent.isLink) {\n parent = parent.target\n }\n\n // setting a thing to its own parent is not normal, but no-op for safety\n if (this === parent) {\n return\n }\n\n const oldParent = this[_parent]\n\n // nothing to do\n if (oldParent === parent) {\n return\n }\n\n // ok now we know something is actually changing, and parent is not a link\n const newPath = resolve(parent.path, 'node_modules', this.name)\n const pathChange = newPath !== this.path\n\n // remove from old parent/fsParent\n if (oldParent) {\n oldParent.children.delete(this.name)\n this[_parent] = null\n }\n if (this.fsParent) {\n this.fsParent.fsChildren.delete(this)\n this[_fsParent] = null\n }\n\n // update this.path/realpath for this and all children/fsChildren\n if (pathChange) {\n this[_changePath](newPath)\n }\n\n // clobbers anything at that path, resets all appropriate references\n this.root = parent.root\n }\n\n // Call this before changing path or updating the _root reference.\n // Removes the node from its root the metadata and inventory.\n [_delistFromMeta] () {\n const root = this.root\n if (!root.realpath || !this.path) {\n return\n }\n root.inventory.delete(this)\n root.tops.delete(this)\n if (root.meta) {\n root.meta.delete(this.path)\n }\n /* istanbul ignore next - should be impossible */\n debug(() => {\n if ([...root.inventory.values()].includes(this)) {\n throw new Error('failed to delist')\n }\n })\n }\n\n // update this.path/realpath and the paths of all children/fsChildren\n [_changePath] (newPath) {\n // have to de-list before changing paths\n this[_delistFromMeta]()\n const oldPath = this.path\n this.path = newPath\n const namePattern = /(?:^|\\/|\\\\)node_modules[\\\\/](@[^/\\\\]+[\\\\/][^\\\\/]+|[^\\\\/]+)$/\n const nameChange = newPath.match(namePattern)\n if (nameChange && this.name !== nameChange[1]) {\n this.name = nameChange[1].replace(/\\\\/g, '/')\n }\n\n // if we move a link target, update link realpaths\n if (!this.isLink) {\n this.realpath = newPath\n for (const link of this.linksIn) {\n link[_delistFromMeta]()\n link.realpath = newPath\n link[_refreshLocation]()\n }\n }\n // if we move /x to /y, then a module at /x/a/b becomes /y/a/b\n for (const child of this.fsChildren) {\n child[_changePath](resolve(newPath, relative(oldPath, child.path)))\n }\n for (const [name, child] of this.children.entries()) {\n child[_changePath](resolve(newPath, 'node_modules', name))\n }\n\n this[_refreshLocation]()\n }\n\n // Called whenever the root/parent is changed.\n // NB: need to remove from former root's meta/inventory and then update\n // this.path BEFORE calling this method!\n [_refreshLocation] () {\n const root = this.root\n const loc = relpath(root.realpath, this.path)\n\n this.location = loc\n\n root.inventory.add(this)\n if (root.meta) {\n root.meta.add(this)\n }\n }\n\n assertRootOverrides () {\n if (!this.isProjectRoot || !this.overrides) {\n return\n }\n\n for (const edge of this.edgesOut.values()) {\n // if these differ an override has been applied, those are not allowed\n // for top level dependencies so throw an error\n if (edge.spec !== edge.rawSpec && !edge.spec.startsWith('$')) {\n throw Object.assign(new Error(`Override for ${edge.name}@${edge.rawSpec} conflicts with direct dependency`), { code: 'EOVERRIDE' })\n }\n }\n }\n\n addEdgeOut (edge) {\n if (this.overrides) {\n edge.overrides = this.overrides.getEdgeRule(edge)\n }\n\n this.edgesOut.set(edge.name, edge)\n }\n\n recalculateOutEdgesOverrides () {\n // For each edge out propagate the new overrides through.\n for (const edge of this.edgesOut.values()) {\n edge.reload(true)\n if (edge.to) {\n edge.to.updateOverridesEdgeInAdded(edge.overrides)\n }\n }\n }\n\n updateOverridesEdgeInRemoved (otherOverrideSet) {\n // If this edge's overrides isn't equal to this node's overrides, then removing it won't change newOverrideSet later.\n if (!this.overrides || !this.overrides.isEqual(otherOverrideSet)) {\n return false\n }\n let newOverrideSet\n for (const edge of this.edgesIn) {\n if (newOverrideSet && edge.overrides) {\n newOverrideSet = OverrideSet.findSpecificOverrideSet(edge.overrides, newOverrideSet)\n } else {\n newOverrideSet = edge.overrides\n }\n }\n if (this.overrides.isEqual(newOverrideSet)) {\n return false\n }\n this.overrides = newOverrideSet\n if (this.overrides) {\n // Optimization: if there's any override set at all, then no non-extraneous node has an empty override set. So if we temporarily have no\n // override set (for example, we removed all the edges in), there's no use updating all the edges out right now. Let's just wait until\n // we have an actual override set later.\n this.recalculateOutEdgesOverrides()\n }\n return true\n }\n\n // This logic isn't perfect either. When we have two edges in that have different override sets, then we have to decide which set is correct.\n // This function assumes the more specific override set is applicable, so if we have dependencies A->B->C and A->C\n // and an override set that specifies what happens for C under A->B, this will work even if the new A->C edge comes along and tries to change\n // the override set.\n // The strictly correct logic is not to allow two edges with different overrides to point to the same node, because even if this node can satisfy\n // both, one of its dependencies might need to be different depending on the edge leading to it.\n // However, this might cause a lot of duplication, because the conflict in the dependencies might never actually happen.\n updateOverridesEdgeInAdded (otherOverrideSet) {\n if (!otherOverrideSet) {\n // Assuming there are any overrides at all, the overrides field is never undefined for any node at the end state of the tree.\n // So if the new edge's overrides is undefined it will be updated later. So we can wait with updating the node's overrides field.\n return false\n }\n if (!this.overrides) {\n this.overrides = otherOverrideSet\n this.recalculateOutEdgesOverrides()\n return true\n }\n if (this.overrides.isEqual(otherOverrideSet)) {\n return false\n }\n const newOverrideSet = OverrideSet.findSpecificOverrideSet(this.overrides, otherOverrideSet)\n if (newOverrideSet) {\n if (!this.overrides.isEqual(newOverrideSet)) {\n this.overrides = newOverrideSet\n this.recalculateOutEdgesOverrides()\n return true\n }\n return false\n }\n // This is an error condition. We can only get here if the new override set is in conflict with the existing.\n log.silly('Conflicting override sets', this.name)\n }\n\n deleteEdgeIn (edge) {\n this.edgesIn.delete(edge)\n if (edge.overrides) {\n this.updateOverridesEdgeInRemoved(edge.overrides)\n }\n }\n\n addEdgeIn (edge) {\n // We need to handle the case where the new edge in has an overrides field which is different from the current value.\n if (!this.overrides || !this.overrides.isEqual(edge.overrides)) {\n this.updateOverridesEdgeInAdded(edge.overrides)\n }\n\n this.edgesIn.add(edge)\n\n // try to get metadata from the yarn.lock file\n if (this.root.meta) {\n this.root.meta.addEdge(edge)\n }\n }\n\n [_reloadNamedEdges] (name, rootLoc = this.location) {\n const edge = this.edgesOut.get(name)\n // if we don't have an edge, do nothing, but keep descending\n const rootLocResolved = edge && edge.to &&\n edge.to.location === `${rootLoc}/node_modules/${edge.name}`\n const sameResolved = edge && this.resolve(name) === edge.to\n const recheck = rootLocResolved || !sameResolved\n if (edge && recheck) {\n edge.reload(true)\n }\n for (const c of this.children.values()) {\n c[_reloadNamedEdges](name, rootLoc)\n }\n\n for (const c of this.fsChildren) {\n c[_reloadNamedEdges](name, rootLoc)\n }\n }\n\n get isLink () {\n return false\n }\n\n get target () {\n return this\n }\n\n set target (n) {\n debug(() => {\n throw Object.assign(new Error('cannot set target on non-Link Nodes'), {\n path: this.path,\n })\n })\n }\n\n get depth () {\n if (this.isTop) {\n return 0\n }\n return this.parent.depth + 1\n }\n\n get isTop () {\n return !this.parent || this.globalTop\n }\n\n get top () {\n if (this.isTop) {\n return this\n }\n return this.parent.top\n }\n\n get isFsTop () {\n return !this.fsParent\n }\n\n get fsTop () {\n if (this.isFsTop) {\n return this\n }\n return this.fsParent.fsTop\n }\n\n get resolveParent () {\n return this.parent || this.fsParent\n }\n\n resolve (name) {\n /* istanbul ignore next - should be impossible,\n * but I keep doing this mistake in tests */\n debug(() => {\n if (typeof name !== 'string' || !name) {\n throw new Error('non-string passed to Node.resolve')\n }\n })\n const mine = this.children.get(name)\n if (mine) {\n return mine\n }\n const resolveParent = this.resolveParent\n if (resolveParent) {\n return resolveParent.resolve(name)\n }\n return null\n }\n\n inNodeModules () {\n const rp = this.realpath\n const name = this.name\n const scoped = name.charAt(0) === '@'\n const d = dirname(rp)\n const nm = scoped ? dirname(d) : d\n const dir = dirname(nm)\n const base = scoped ? `${basename(d)}/${basename(rp)}` : basename(rp)\n return base === name && basename(nm) === 'node_modules' ? dir : false\n }\n\n // maybe accept both string value or array of strings\n // seems to be what dom API does\n querySelectorAll (query, opts) {\n return querySelectorAll(this, query, opts)\n }\n\n toJSON () {\n return printableTree(this)\n }\n\n [util.inspect.custom] () {\n return this.toJSON()\n }\n\n resetDepFlags () {\n this.extraneous = true\n this.dev = true\n this.optional = true\n this.devOptional = true\n this.peer = true\n }\n\n unsetDepFlags () {\n this.extraneous = false\n this.dev = false\n this.optional = false\n this.devOptional = false\n this.peer = false\n }\n}\n\nmodule.exports = Node\n","const relpath = require('./relpath.js')\nconst Node = require('./node.js')\nconst _loadDeps = Symbol.for('Arborist.Node._loadDeps')\nconst _target = Symbol.for('_target')\nconst { dirname } = require('node:path')\n// defined by Node class\nconst _delistFromMeta = Symbol.for('_delistFromMeta')\nconst _refreshLocation = Symbol.for('_refreshLocation')\nclass Link extends Node {\n constructor (options) {\n const { root, realpath, target, parent, fsParent, isStoreLink } = options\n\n if (!realpath && !(target && target.path)) {\n throw new TypeError('must provide realpath for Link node')\n }\n\n super({\n ...options,\n realpath: realpath || target.path,\n root: root || (parent ? parent.root\n : fsParent ? fsParent.root\n : target ? target.root\n : null),\n })\n\n this.isStoreLink = isStoreLink || false\n\n if (target) {\n this.target = target\n } else if (this.realpath === this.root.path) {\n this.target = this.root\n } else {\n this.target = new Node({\n ...options,\n path: realpath,\n parent: null,\n fsParent: null,\n root: this.root,\n })\n }\n }\n\n get version () {\n return this.target ? this.target.version : this.package.version || ''\n }\n\n get target () {\n return this[_target]\n }\n\n set target (target) {\n const current = this[_target]\n if (target === current) {\n return\n }\n\n if (!target) {\n if (current && current.linksIn) {\n current.linksIn.delete(this)\n }\n if (this.path) {\n this[_delistFromMeta]()\n this[_target] = null\n this.package = {}\n this[_refreshLocation]()\n } else {\n this[_target] = null\n }\n return\n }\n\n if (!this.path) {\n // temp node pending assignment to a tree\n // we know it's not in the inventory yet, because no path.\n if (target.path) {\n this.realpath = target.path\n } else {\n target.path = target.realpath = this.realpath\n }\n target.root = this.root\n this[_target] = target\n target.linksIn.add(this)\n this.package = target.package\n return\n }\n\n // have to refresh metadata, because either realpath or package\n // is very likely changing.\n this[_delistFromMeta]()\n this.package = target.package\n this.realpath = target.path\n this[_refreshLocation]()\n\n target.root = this.root\n }\n\n // a link always resolves to the relative path to its target\n get resolved () {\n // the path/realpath guard is there for the benefit of setting\n // these things in the \"wrong\" order\n return this.path && this.realpath\n ? `file:${relpath(dirname(this.path), this.realpath)}`\n : null\n }\n\n set resolved (r) {}\n\n // deps are resolved on the target, not the Link\n // so this is a no-op\n [_loadDeps] () {}\n\n // Forward overrides to the target only when a rule names a dep it needs, directly or transitively (npm/cli#9357, #9619).\n recalculateOutEdgesOverrides () {\n if (!this.target || !this.overrides) {\n return\n }\n if (!overrideMatchesSubtree(this.overrides, this.target)) {\n return\n }\n this.target.updateOverridesEdgeInAdded(this.overrides)\n }\n\n // links can't have children, only their targets can\n // fix it to an empty list so that we can still call\n // things that iterate over them, just as a no-op\n get children () {\n return new Map()\n }\n\n set children (c) {}\n\n get isLink () {\n return true\n }\n}\n\n// True when an override rule applies to an edge reachable from the target at any depth.\n// getEdgeRule matches on name and spec, returning the set itself when nothing applies, so a non-applicable version-qualified rule doesn't flip an intermediate node to \"has overrides\" (npm/cli#9357).\n// Not a method: runs from the Node super-constructor, before subclass private methods exist.\nconst overrideMatchesSubtree = (overrides, target) => {\n const seen = new Set()\n const stack = [target]\n while (stack.length) {\n const node = stack.pop()\n const resolved = node.isLink ? node.target : node\n if (seen.has(resolved)) {\n continue\n }\n seen.add(resolved)\n for (const edge of resolved.edgesOut.values()) {\n if (overrides.getEdgeRule(edge).name === edge.name) {\n return true\n }\n if (edge.to) {\n stack.push(edge.to)\n }\n }\n }\n return false\n}\n\nmodule.exports = Link\n","// Given a dep, a node that depends on it, and the edge representing that\n// dependency, place the dep somewhere in the node's tree, and all of its\n// peer dependencies.\n//\n// Handles all of the tree updating needed to place the dep, including\n// removing replaced nodes, pruning now-extraneous or invalidated nodes,\n// and saves a set of what was placed and what needs re-evaluation as\n// a result.\n\nconst localeCompare = require('@isaacs/string-locale-compare')('en')\nconst { log } = require('proc-log')\nconst { redact } = require('@npmcli/redact')\nconst deepestNestingTarget = require('./deepest-nesting-target.js')\nconst CanPlaceDep = require('./can-place-dep.js')\nconst {\n KEEP,\n CONFLICT,\n} = CanPlaceDep\nconst debug = require('./debug.js')\n\nconst Link = require('./link.js')\nconst gatherDepSet = require('./gather-dep-set.js')\nconst peerEntrySets = require('./peer-entry-sets.js')\n\nclass PlaceDep {\n constructor (options) {\n this.auditReport = options.auditReport\n this.dep = options.dep\n this.edge = options.edge\n this.explicitRequest = options.explicitRequest\n this.force = options.force\n this.installLinks = options.installLinks\n this.installStrategy = options.installStrategy\n this.legacyPeerDeps = options.legacyPeerDeps\n this.parent = options.parent || null\n this.preferDedupe = options.preferDedupe\n this.strictPeerDeps = options.strictPeerDeps\n this.updateNames = options.updateNames\n\n this.canPlace = null\n this.canPlaceSelf = null\n // XXX this only appears to be used by tests\n this.checks = new Map()\n this.children = []\n this.needEvaluation = new Set()\n this.peerConflict = null\n this.placed = null\n this.target = null\n\n this.current = this.edge.to\n this.name = this.edge.name\n this.top = this.parent?.top || this\n\n // nothing to do if the edge is fine as it is\n if (this.edge.to &&\n !this.edge.error &&\n !this.explicitRequest &&\n !this.updateNames.includes(this.edge.name) &&\n !this.auditReport?.isVulnerable(this.edge.to)) {\n return\n }\n\n // walk up the tree until we hit either a top/root node, or a place\n // where the dep is not a peer dep.\n const start = this.getStartNode()\n\n for (const target of start.ancestry()) {\n // if the current location has a peerDep on it, then we can't place here\n // this is pretty rare to hit, since we always prefer deduping peers,\n // and the getStartNode will start us out above any peers from the\n // thing that depends on it. but we could hit it with something like:\n //\n // a -> (b@1, c@1)\n // +-- c@1\n // +-- b -> PEEROPTIONAL(v) (c@2)\n // +-- c@2 -> (v)\n //\n // So we check if we can place v under c@2, that's fine.\n // Then we check under b, and can't, because of the optional peer dep.\n // but we CAN place it under a, so the correct thing to do is keep\n // walking up the tree.\n const targetEdge = target.edgesOut.get(this.edge.name)\n if (!target.isTop && targetEdge && targetEdge.peer) {\n continue\n }\n\n const cpd = new CanPlaceDep({\n dep: this.dep,\n edge: this.edge,\n // note: this sets the parent's canPlace as the parent of this\n // canPlace, but it does NOT add this canPlace to the parent's\n // children. This way, we can know that it's a peer dep, and\n // get the top edge easily, while still maintaining the\n // tree of checks that factored into the original decision.\n parent: this.parent && this.parent.canPlace,\n target,\n preferDedupe: this.preferDedupe,\n explicitRequest: this.explicitRequest,\n auditReport: this.auditReport,\n })\n this.checks.set(target, cpd)\n\n // It's possible that a \"conflict\" is a conflict among the *peers* of\n // a given node we're trying to place, but there actually is no current\n // node. Eg,\n // root -> (a, b)\n // a -> PEER(c)\n // b -> PEER(d)\n // d -> PEER(c@2)\n // We place (a), and get a peer of (c) along with it.\n // then we try to place (b), and get CONFLICT in the check, because\n // of the conflicting peer from (b)->(d)->(c@2). In that case, we\n // should treat (b) and (d) as OK, and place them in the last place\n // where they did not themselves conflict, and skip c@2 if conflict\n // is ok by virtue of being forced or not ours and not strict.\n if (cpd.canPlaceSelf !== CONFLICT) {\n this.canPlaceSelf = cpd\n }\n\n // we found a place this can go, along with all its peer friends.\n // we break when we get the first conflict\n if (cpd.canPlace !== CONFLICT) {\n this.canPlace = cpd\n } else {\n break\n }\n\n // if it's a load failure, just plop it in the first place attempted,\n // since we're going to crash the build or prune it out anyway.\n // but, this will frequently NOT be a successful canPlace, because\n // it'll have no version or other information.\n if (this.dep.errors.length) {\n break\n }\n\n // nest packages like npm v1 and v2\n // very disk-inefficient\n if (this.installStrategy === 'nested') {\n break\n }\n\n // when installing globally, or just in global style, we never place\n // deps above the first level.\n if (this.installStrategy === 'shallow') {\n const rp = target.resolveParent\n if (rp && rp.isProjectRoot) {\n break\n }\n }\n }\n\n // if we can't find a target, that means that the last place checked,\n // and all the places before it, had a conflict.\n if (!this.canPlace) {\n // if not forced, and it's our dep, or strictPeerDeps is set, then\n // this is an ERESOLVE error.\n if (!this.force && (this.isMine || this.strictPeerDeps)) {\n return this.failPeerConflict()\n }\n\n // ok! we're gonna allow the conflict, but we should still warn\n // if we have a current, then we treat CONFLICT as a KEEP.\n // otherwise, we just skip it. Only warn on the one that actually\n // could not be placed somewhere.\n if (!this.canPlaceSelf) {\n this.warnPeerConflict()\n return\n }\n\n this.canPlace = this.canPlaceSelf\n }\n\n // now we have a target, a tree of CanPlaceDep results for the peer group,\n // and we are ready to go\n\n /* istanbul ignore next */\n if (!this.canPlace) {\n debug(() => {\n throw new Error('canPlace not set, but trying to place in tree')\n })\n return\n }\n\n const { target } = this.canPlace\n\n log.silly(\n 'placeDep',\n target.location || 'ROOT',\n `${this.dep.name}@${this.dep.version}`,\n this.canPlace.description,\n `for: ${this.edge.from.package._id || this.edge.from.location}`,\n `want: ${redact(this.edge.spec || '*')}`\n )\n\n const placementType = this.canPlace.canPlace === CONFLICT\n ? this.canPlace.canPlaceSelf\n : this.canPlace.canPlace\n\n // if we're placing in the tree with --force, we can get here even though\n // it's a conflict. Treat it as a KEEP, but warn and move on.\n if (placementType === KEEP) {\n // this was a peerConflicted peer dep\n if (this.edge.peer && !this.edge.valid) {\n this.warnPeerConflict()\n }\n\n // if we get a KEEP in an update scenario, then we MAY have something\n // already duplicating this unnecessarily! For example:\n // ```\n // root (dep: y@1)\n // +-- x (dep: y@1.1)\n // | +-- y@1.1.0 (replacing with 1.1.2, got KEEP at the root)\n // +-- y@1.1.2 (updated already from 1.0.0)\n // ```\n // Now say we do `reify({update:['y']})`, and the latest version is\n // 1.1.2, which we now have in the root. We'll try to place y@1.1.2\n // first in x, then in the root, ending with KEEP, because we already\n // have it. In that case, we ought to REMOVE the nm/x/nm/y node, because\n // it is an unnecessary duplicate.\n this.pruneDedupable(target)\n return\n }\n\n // we were told to place it here in the target, so either it does not\n // already exist in the tree, OR it's shadowed.\n // handle otherwise unresolvable dependency nesting loops by\n // creating a symbolic link\n // a1 -> b1 -> a2 -> b2 -> a1 -> ...\n // instead of nesting forever, when the loop occurs, create\n // a symbolic link to the earlier instance\n for (let p = target; p; p = p.resolveParent) {\n if (p.matches(this.dep) && !p.isTop) {\n this.placed = new Link({ parent: target, target: p })\n return\n }\n }\n\n // XXX if we are replacing SOME of a peer entry group, we will need to\n // remove any that are not being replaced and will now be invalid, and\n // re-evaluate them deeper into the tree.\n\n const virtualRoot = this.dep.parent\n this.placed = new this.dep.constructor({\n name: this.dep.name,\n pkg: this.dep.package,\n resolved: this.dep.resolved,\n integrity: this.dep.integrity,\n installLinks: this.installLinks,\n legacyPeerDeps: this.legacyPeerDeps,\n error: this.dep.errors[0],\n ...(this.dep.packageExtensionsApplied\n ? { packageExtensionsApplied: this.dep.packageExtensionsApplied }\n : {}),\n ...(this.dep.npmExtensionApplied\n ? { npmExtensionApplied: this.dep.npmExtensionApplied }\n : {}),\n ...(this.dep.overrides ? { overrides: this.dep.overrides } : {}),\n ...(this.dep.isLink ? { target: this.dep.target, realpath: this.dep.realpath } : {}),\n })\n\n this.oldDep = target.children.get(this.name)\n if (this.oldDep) {\n this.replaceOldDep()\n } else {\n this.placed.parent = target\n }\n\n // if it's a peerConflicted peer dep, warn about it\n if (this.edge.peer && !this.placed.satisfies(this.edge)) {\n this.warnPeerConflict()\n }\n\n // If the edge is not an error, then we're updating something, and\n // MAY end up putting a better/identical node further up the tree in\n // a way that causes an unnecessary duplication. If so, remove the\n // now-unnecessary node.\n if (this.edge.valid && this.edge.to && this.edge.to !== this.placed) {\n this.pruneDedupable(this.edge.to, false)\n }\n\n // in case we just made some duplicates that can be removed,\n // prune anything deeper in the tree that can be replaced by this\n for (const node of target.root.inventory.query('name', this.name)) {\n if (node.isDescendantOf(target) && !node.isTop) {\n this.pruneDedupable(node, false)\n // only walk the direct children of the ones we kept\n if (node.root === target.root) {\n for (const kid of node.children.values()) {\n this.pruneDedupable(kid, false)\n }\n }\n }\n }\n\n // also place its unmet or invalid peer deps at this location\n // loop through any peer deps from the thing we just placed, and place\n // those ones as well. it's safe to do this with the virtual nodes,\n // because we're copying rather than moving them out of the virtual root,\n // otherwise they'd be gone and the peer set would change throughout\n // this loop.\n for (const peerEdge of this.placed.edgesOut.values()) {\n if (peerEdge.valid || !peerEdge.peer || peerEdge.peerConflicted) {\n continue\n }\n\n const peer = virtualRoot.children.get(peerEdge.name)\n\n // Note: if the virtualRoot *doesn't* have the peer, then that means\n // it's an optional peer dep. If it's not being properly met (ie,\n // peerEdge.valid is false), then this is likely heading for an\n // ERESOLVE error, unless it can walk further up the tree.\n if (!peer) {\n continue\n }\n\n // peerConflicted peerEdge, just accept what's there already\n if (!peer.satisfies(peerEdge)) {\n continue\n }\n\n this.children.push(new PlaceDep({\n auditReport: this.auditReport,\n explicitRequest: this.explicitRequest,\n force: this.force,\n installLinks: this.installLinks,\n installStrategy: this.installStrategy,\n legacyPeerDeps: this.legacyPeerDeps,\n preferDedupe: this.preferDedupe,\n strictPeerDeps: this.strictPeerDeps,\n updateNames: this.updateName,\n parent: this,\n dep: peer,\n node: this.placed,\n edge: peerEdge,\n }))\n }\n }\n\n replaceOldDep () {\n const target = this.oldDep.parent\n\n // XXX handle replacing an entire peer group?\n // what about cases where we need to push some other peer groups deeper\n // into the tree? all the tree updating should be done here, and track\n // all the things that we add and remove, so that we can know what\n // to re-evaluate.\n\n // if we're replacing, we should also remove any nodes for edges that\n // are now invalid, and where this (or its deps) is the only dependent,\n // and also recurse on that pruning. Otherwise leaving that dep node\n // around can result in spurious conflicts pushing nodes deeper into\n // the tree than needed in the case of cycles that will be removed\n // later anyway.\n const oldDeps = []\n for (const [name, edge] of this.oldDep.edgesOut.entries()) {\n if (!this.placed.edgesOut.has(name) && edge.to) {\n oldDeps.push(...gatherDepSet([edge.to], e => e.to !== edge.to))\n }\n }\n\n // gather all peer edgesIn which are at this level, and will not be\n // satisfied by the new dependency. Those are the peer sets that need\n // to be either warned about (if they cannot go deeper), or removed and\n // re-placed (if they can).\n const prunePeerSets = []\n for (const edge of this.oldDep.edgesIn) {\n if (this.placed.satisfies(edge) ||\n !edge.peer ||\n edge.from.parent !== target ||\n edge.peerConflicted) {\n // not a peer dep, not invalid, or not from this level, so it's fine\n // to just let it re-evaluate as a problemEdge later, or let it be\n // satisfied by the new dep being placed.\n continue\n }\n for (const entryEdge of peerEntrySets(edge.from).keys()) {\n // either this one needs to be pruned and re-evaluated, or marked\n // as peerConflicted and warned about. If the entryEdge comes in from\n // the root or a workspace, then we have to leave it alone, and in that\n // case, it will have already warned or crashed by getting to this point\n const entryNode = entryEdge.to\n const deepestTarget = deepestNestingTarget(entryNode)\n if (deepestTarget !== target &&\n !(entryEdge.from.isProjectRoot || entryEdge.from.isWorkspace)) {\n prunePeerSets.push(...gatherDepSet([entryNode], e => {\n return e.to !== entryNode && !e.peerConflicted\n }))\n } else {\n this.warnPeerConflict(edge, this.dep)\n }\n }\n }\n\n this.placed.replace(this.oldDep)\n this.pruneForReplacement(this.placed, oldDeps)\n for (const dep of prunePeerSets) {\n for (const edge of dep.edgesIn) {\n this.needEvaluation.add(edge.from)\n }\n dep.root = null\n }\n }\n\n pruneForReplacement (node, oldDeps) {\n // gather up all the now-invalid/extraneous edgesOut, as long as they are\n // only depended upon by the old node/deps\n const invalidDeps = new Set([...node.edgesOut.values()]\n .filter(e => e.to && !e.valid).map(e => e.to))\n for (const dep of oldDeps) {\n const set = gatherDepSet([dep], e => e.to !== dep && e.valid)\n for (const dep of set) {\n invalidDeps.add(dep)\n }\n }\n\n // ignore dependency edges from the node being replaced, but\n // otherwise filter the set down to just the set with no\n // dependencies from outside the set, except the node in question.\n const deps = gatherDepSet(invalidDeps, edge =>\n edge.from !== node && edge.to !== node && edge.valid)\n\n // now just delete whatever's left, because it's junk\n for (const dep of deps) {\n dep.root = null\n }\n }\n\n // prune all the nodes in a branch of the tree that can be safely removed\n // This is only the most basic duplication detection; it finds if there\n // is another satisfying node further up the tree, and if so, dedupes.\n // Even if installStrategy is nested, we do this amount of deduplication.\n pruneDedupable (node, descend = true) {\n if (node.canDedupe(this.preferDedupe, this.explicitRequest)) {\n // gather up all deps that have no valid edges in from outside\n // the dep set, except for this node we're deduping, so that we\n // also prune deps that would be made extraneous.\n const deps = gatherDepSet([node], e => e.to !== node && e.valid)\n for (const node of deps) {\n node.root = null\n }\n return\n }\n if (descend) {\n // sort these so that they're deterministically ordered\n // otherwise, resulting tree shape is dependent on the order\n // in which they happened to be resolved.\n const nodeSort = (a, b) => localeCompare(a.location, b.location)\n\n const children = [...node.children.values()].sort(nodeSort)\n for (const child of children) {\n this.pruneDedupable(child)\n }\n const fsChildren = [...node.fsChildren].sort(nodeSort)\n for (const topNode of fsChildren) {\n const children = [...topNode.children.values()].sort(nodeSort)\n for (const child of children) {\n this.pruneDedupable(child)\n }\n }\n }\n }\n\n get isMine () {\n const { edge } = this.top\n const { from: node } = edge\n\n if (node.isWorkspace || node.isProjectRoot) {\n return true\n }\n\n if (!edge.peer) {\n return false\n }\n\n // re-entry case. check if any non-peer edges come from the project,\n // or any entryEdges on peer groups are from the root.\n let hasPeerEdges = false\n for (const edge of node.edgesIn) {\n if (edge.peer) {\n hasPeerEdges = true\n continue\n }\n if (edge.from.isWorkspace || edge.from.isProjectRoot) {\n return true\n }\n }\n if (hasPeerEdges) {\n for (const edge of peerEntrySets(node).keys()) {\n if (edge.from.isWorkspace || edge.from.isProjectRoot) {\n return true\n }\n }\n }\n\n return false\n }\n\n warnPeerConflict (edge, dep) {\n edge = edge || this.edge\n dep = dep || this.dep\n edge.peerConflicted = true\n const expl = this.explainPeerConflict(edge, dep)\n log.warn('ERESOLVE', 'overriding peer dependency', expl)\n }\n\n failPeerConflict (edge, dep) {\n edge = edge || this.top.edge\n dep = dep || this.top.dep\n const expl = this.explainPeerConflict(edge, dep)\n throw Object.assign(new Error('could not resolve'), expl)\n }\n\n explainPeerConflict (edge, dep) {\n const { from: node } = edge\n const curNode = node.resolve(edge.name)\n\n // XXX decorate more with this.canPlace and this.canPlaceSelf,\n // this.checks, this.children, walk over conflicted peers, etc.\n const expl = {\n code: 'ERESOLVE',\n edge: edge.explain(),\n dep: dep.explain(edge),\n force: this.force,\n isMine: this.isMine,\n strictPeerDeps: this.strictPeerDeps,\n }\n\n if (this.parent) {\n // this is the conflicted peer\n expl.current = curNode && curNode.explain(edge)\n expl.peerConflict = this.current && this.current.explain(this.edge)\n } else {\n expl.current = curNode && curNode.explain()\n if (this.canPlaceSelf && this.canPlaceSelf.canPlaceSelf !== CONFLICT) {\n // failed while checking for a child dep\n const cps = this.canPlaceSelf\n for (const peer of cps.conflictChildren) {\n if (peer.current) {\n expl.peerConflict = {\n current: peer.current.explain(),\n peer: peer.dep.explain(peer.edge),\n }\n break\n }\n }\n } else {\n expl.peerConflict = {\n current: this.current && this.current.explain(),\n peer: this.dep.explain(this.edge),\n }\n }\n }\n\n return expl\n }\n\n getStartNode () {\n // if we are a peer, then we MUST be at least as shallow as the peer\n // dependent\n const from = this.parent?.getStartNode() || this.edge.from\n return deepestNestingTarget(from, this.name)\n }\n\n // XXX this only appears to be used by tests\n get allChildren () {\n const set = new Set(this.children)\n for (const child of set) {\n for (const grandchild of child.children) {\n set.add(grandchild)\n }\n }\n return [...set]\n }\n}\n\nmodule.exports = PlaceDep\n","// Dep flag (dev, peer, etc.) calculation requires default or reset flags.\n// Flags are true by default and are unset to false as we walk deps.\n// We iterate outward edges looking for dep flags that can\n// be unset based on the current nodes flags and edge type.\n// Examples:\n// - a non-optional node with a non-optional edge out, the edge node should not be optional\n// - a non-peer node with a non-peer edge out, the edge node should not be peer\n// If a node is changed, we add to the queue and continue until no more changes.\n// Flags that remain after all this unsetting should be valid.\n// Examples:\n// - a node still flagged optional must only be reachable via optional edges\n// - a node still flagged peer must only be reachable via peer edges\nconst calcDepFlags = (tree, resetRoot = true) => {\n if (resetRoot) {\n tree.unsetDepFlags()\n }\n\n const seen = new Set()\n const queue = [tree]\n\n let node\n while (node = queue.pop()) {\n seen.add(node)\n\n // Unset extraneous from all parents to avoid removal of children.\n if (!node.extraneous) {\n for (let n = node.resolveParent; n?.extraneous; n = n.resolveParent) {\n n.extraneous = false\n }\n }\n\n // for links, map their hierarchy appropriately\n if (node.isLink) {\n // node.target can be null, we check to ensure it's not null before proceeding\n if (node.target == null) {\n continue\n }\n // Only unset flags, matching the edge walk below, so multiple links to one target can't clobber a correct value.\n let changed = false\n if (node.target.dev && !node.dev) {\n node.target.dev = false\n changed = true\n }\n if (node.target.optional && !node.optional) {\n node.target.optional = false\n changed = true\n }\n if (node.target.devOptional && !node.devOptional) {\n node.target.devOptional = false\n changed = true\n }\n if (node.target.peer && !node.peer) {\n node.target.peer = false\n changed = true\n }\n if (node.target.extraneous && !node.extraneous) {\n node.target.extraneous = false\n changed = true\n }\n // queue target on first visit so its deps are walked\n if (changed || !seen.has(node.target)) {\n queue.push(node.target)\n }\n continue\n }\n\n for (const { peer, optional, dev, to } of node.edgesOut.values()) {\n // if the dep is missing, then its flags are already maximally unset\n if (!to) {\n continue\n }\n\n let changed = false\n\n // only optional peer dependencies should stay extraneous\n if (to.extraneous && !node.extraneous && !(peer && optional)) {\n to.extraneous = false\n changed = true\n }\n\n if (to.dev && !node.dev && !dev) {\n to.dev = false\n changed = true\n }\n\n if (to.optional && !node.optional && !optional) {\n to.optional = false\n changed = true\n }\n\n // devOptional is the *overlap* of the dev and optional tree.\n // A node may be depended on by separate dev and optional nodes.\n // It SHOULD NOT be removed when pruning dev OR optional.\n // It SHOULD be removed when pruning dev AND optional.\n // We only unset here if a node is not dev AND not optional because\n // if we did unset, it would prevent any overlap deeper in the tree.\n // We correct this later by removing if dev OR optional is set.\n if (to.devOptional && !node.devOptional && !node.dev && !node.optional && !dev && !optional) {\n to.devOptional = false\n changed = true\n }\n\n if (to.peer && !node.peer && !peer) {\n to.peer = false\n changed = true\n }\n\n if (changed) {\n queue.push(to)\n }\n }\n }\n\n // Remove incorrect devOptional flags now that we have walked all deps.\n seen.delete(tree)\n for (const node of seen.values()) {\n if (node.devOptional && (node.dev || node.optional)) {\n node.devOptional = false\n }\n }\n}\n\nmodule.exports = calcDepFlags\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Diff = /** @class */ (function () {\n function Diff() {\n }\n Diff.prototype.diff = function (oldStr, newStr, \n // Type below is not accurate/complete - see above for full possibilities - but it compiles\n options) {\n if (options === void 0) { options = {}; }\n var callback;\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n else if ('callback' in options) {\n callback = options.callback;\n }\n // Allow subclasses to massage the input prior to running\n var oldString = this.castInput(oldStr, options);\n var newString = this.castInput(newStr, options);\n var oldTokens = this.removeEmpty(this.tokenize(oldString, options));\n var newTokens = this.removeEmpty(this.tokenize(newString, options));\n return this.diffWithOptionsObj(oldTokens, newTokens, options, callback);\n };\n Diff.prototype.diffWithOptionsObj = function (oldTokens, newTokens, options, callback) {\n var _this = this;\n var _a;\n var done = function (value) {\n value = _this.postProcess(value, options);\n if (callback) {\n setTimeout(function () { callback(value); }, 0);\n return undefined;\n }\n else {\n return value;\n }\n };\n var newLen = newTokens.length, oldLen = oldTokens.length;\n var editLength = 1;\n var maxEditLength = newLen + oldLen;\n if (options.maxEditLength != null) {\n maxEditLength = Math.min(maxEditLength, options.maxEditLength);\n }\n var maxExecutionTime = (_a = options.timeout) !== null && _a !== void 0 ? _a : Infinity;\n var abortAfterTimestamp = Date.now() + maxExecutionTime;\n var bestPath = [{ oldPos: -1, lastComponent: undefined }];\n // Seed editLength = 0, i.e. the content starts with the same values\n var newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0, options);\n if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {\n // Identity per the equality and tokenizer\n return done(this.buildValues(bestPath[0].lastComponent, newTokens, oldTokens));\n }\n // Once we hit the right edge of the edit graph on some diagonal k, we can\n // definitely reach the end of the edit graph in no more than k edits, so\n // there's no point in considering any moves to diagonal k+1 any more (from\n // which we're guaranteed to need at least k+1 more edits).\n // Similarly, once we've reached the bottom of the edit graph, there's no\n // point considering moves to lower diagonals.\n // We record this fact by setting minDiagonalToConsider and\n // maxDiagonalToConsider to some finite value once we've hit the edge of\n // the edit graph.\n // This optimization is not faithful to the original algorithm presented in\n // Myers's paper, which instead pointlessly extends D-paths off the end of\n // the edit graph - see page 7 of Myers's paper which notes this point\n // explicitly and illustrates it with a diagram. This has major performance\n // implications for some common scenarios. For instance, to compute a diff\n // where the new text simply appends d characters on the end of the\n // original text of length n, the true Myers algorithm will take O(n+d^2)\n // time while this optimization needs only O(n+d) time.\n var minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity;\n // Main worker method. checks all permutations of a given edit length for acceptance.\n var execEditLength = function () {\n for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {\n var basePath = void 0;\n var removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1];\n if (removePath) {\n // No one else is going to attempt to use this value, clear it\n // @ts-expect-error - perf optimisation. This type-violating value will never be read.\n bestPath[diagonalPath - 1] = undefined;\n }\n var canAdd = false;\n if (addPath) {\n // what newPos will be after we do an insertion:\n var addPathNewPos = addPath.oldPos - diagonalPath;\n canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;\n }\n var canRemove = removePath && removePath.oldPos + 1 < oldLen;\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n // @ts-expect-error - perf optimisation. This type-violating value will never be read.\n bestPath[diagonalPath] = undefined;\n continue;\n }\n // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the old string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n if (!canRemove || (canAdd && removePath.oldPos < addPath.oldPos)) {\n basePath = _this.addToPath(addPath, true, false, 0, options);\n }\n else {\n basePath = _this.addToPath(removePath, false, true, 1, options);\n }\n newPos = _this.extractCommon(basePath, newTokens, oldTokens, diagonalPath, options);\n if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {\n // If we have hit the end of both strings, then we are done\n return done(_this.buildValues(basePath.lastComponent, newTokens, oldTokens)) || true;\n }\n else {\n bestPath[diagonalPath] = basePath;\n if (basePath.oldPos + 1 >= oldLen) {\n maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);\n }\n if (newPos + 1 >= newLen) {\n minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);\n }\n }\n }\n editLength++;\n };\n // Performs the length of edit iteration. Is a bit fugly as this has to support the\n // sync and async mode which is never fun. Loops over execEditLength until a value\n // is produced, or until the edit length exceeds options.maxEditLength (if given),\n // in which case it will return undefined.\n if (callback) {\n (function exec() {\n setTimeout(function () {\n if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {\n return callback(undefined);\n }\n if (!execEditLength()) {\n exec();\n }\n }, 0);\n }());\n }\n else {\n while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {\n var ret = execEditLength();\n if (ret) {\n return ret;\n }\n }\n }\n };\n Diff.prototype.addToPath = function (path, added, removed, oldPosInc, options) {\n var last = path.lastComponent;\n if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {\n return {\n oldPos: path.oldPos + oldPosInc,\n lastComponent: { count: last.count + 1, added: added, removed: removed, previousComponent: last.previousComponent }\n };\n }\n else {\n return {\n oldPos: path.oldPos + oldPosInc,\n lastComponent: { count: 1, added: added, removed: removed, previousComponent: last }\n };\n }\n };\n Diff.prototype.extractCommon = function (basePath, newTokens, oldTokens, diagonalPath, options) {\n var newLen = newTokens.length, oldLen = oldTokens.length;\n var oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;\n while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldTokens[oldPos + 1], newTokens[newPos + 1], options)) {\n newPos++;\n oldPos++;\n commonCount++;\n if (options.oneChangePerToken) {\n basePath.lastComponent = { count: 1, previousComponent: basePath.lastComponent, added: false, removed: false };\n }\n }\n if (commonCount && !options.oneChangePerToken) {\n basePath.lastComponent = { count: commonCount, previousComponent: basePath.lastComponent, added: false, removed: false };\n }\n basePath.oldPos = oldPos;\n return newPos;\n };\n Diff.prototype.equals = function (left, right, options) {\n if (options.comparator) {\n return options.comparator(left, right);\n }\n else {\n return left === right\n || (!!options.ignoreCase && left.toLowerCase() === right.toLowerCase());\n }\n };\n Diff.prototype.removeEmpty = function (array) {\n var ret = [];\n for (var i = 0; i < array.length; i++) {\n if (array[i]) {\n ret.push(array[i]);\n }\n }\n return ret;\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Diff.prototype.castInput = function (value, options) {\n return value;\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Diff.prototype.tokenize = function (value, options) {\n return Array.from(value);\n };\n Diff.prototype.join = function (chars) {\n // Assumes ValueT is string, which is the case for most subclasses.\n // When it's false, e.g. in diffArrays, this method needs to be overridden (e.g. with a no-op)\n // Yes, the casts are verbose and ugly, because this pattern - of having the base class SORT OF\n // assume tokens and values are strings, but not completely - is weird and janky.\n return chars.join('');\n };\n Diff.prototype.postProcess = function (changeObjects, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n options) {\n return changeObjects;\n };\n Object.defineProperty(Diff.prototype, \"useLongestToken\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Diff.prototype.buildValues = function (lastComponent, newTokens, oldTokens) {\n // First we convert our linked list of components in reverse order to an\n // array in the right order:\n var components = [];\n var nextComponent;\n while (lastComponent) {\n components.push(lastComponent);\n nextComponent = lastComponent.previousComponent;\n delete lastComponent.previousComponent;\n lastComponent = nextComponent;\n }\n components.reverse();\n var componentLen = components.length;\n var componentPos = 0, newPos = 0, oldPos = 0;\n for (; componentPos < componentLen; componentPos++) {\n var component = components[componentPos];\n if (!component.removed) {\n if (!component.added && this.useLongestToken) {\n var value = newTokens.slice(newPos, newPos + component.count);\n value = value.map(function (value, i) {\n var oldValue = oldTokens[oldPos + i];\n return oldValue.length > value.length ? oldValue : value;\n });\n component.value = this.join(value);\n }\n else {\n component.value = this.join(newTokens.slice(newPos, newPos + component.count));\n }\n newPos += component.count;\n // Common case\n if (!component.added) {\n oldPos += component.count;\n }\n }\n else {\n component.value = this.join(oldTokens.slice(oldPos, oldPos + component.count));\n oldPos += component.count;\n }\n }\n return components;\n };\n return Diff;\n}());\nexports.default = Diff;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.characterDiff = void 0;\nexports.diffChars = diffChars;\nvar base_js_1 = require(\"./base.js\");\nvar CharacterDiff = /** @class */ (function (_super) {\n __extends(CharacterDiff, _super);\n function CharacterDiff() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return CharacterDiff;\n}(base_js_1.default));\nexports.characterDiff = new CharacterDiff();\nfunction diffChars(oldStr, newStr, options) {\n return exports.characterDiff.diff(oldStr, newStr, options);\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.longestCommonPrefix = longestCommonPrefix;\nexports.longestCommonSuffix = longestCommonSuffix;\nexports.replacePrefix = replacePrefix;\nexports.replaceSuffix = replaceSuffix;\nexports.removePrefix = removePrefix;\nexports.removeSuffix = removeSuffix;\nexports.maximumOverlap = maximumOverlap;\nexports.hasOnlyWinLineEndings = hasOnlyWinLineEndings;\nexports.hasOnlyUnixLineEndings = hasOnlyUnixLineEndings;\nexports.segment = segment;\nexports.trailingWs = trailingWs;\nexports.leadingWs = leadingWs;\nexports.leadingAndTrailingWs = leadingAndTrailingWs;\nfunction longestCommonPrefix(str1, str2) {\n var i;\n for (i = 0; i < str1.length && i < str2.length; i++) {\n if (str1[i] != str2[i]) {\n return str1.slice(0, i);\n }\n }\n return str1.slice(0, i);\n}\nfunction longestCommonSuffix(str1, str2) {\n var i;\n // Unlike longestCommonPrefix, we need a special case to handle all scenarios\n // where we return the empty string since str1.slice(-0) will return the\n // entire string.\n if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) {\n return '';\n }\n for (i = 0; i < str1.length && i < str2.length; i++) {\n if (str1[str1.length - (i + 1)] != str2[str2.length - (i + 1)]) {\n return str1.slice(-i);\n }\n }\n return str1.slice(-i);\n}\nfunction replacePrefix(string, oldPrefix, newPrefix) {\n if (string.slice(0, oldPrefix.length) != oldPrefix) {\n throw Error(\"string \".concat(JSON.stringify(string), \" doesn't start with prefix \").concat(JSON.stringify(oldPrefix), \"; this is a bug\"));\n }\n return newPrefix + string.slice(oldPrefix.length);\n}\nfunction replaceSuffix(string, oldSuffix, newSuffix) {\n if (!oldSuffix) {\n return string + newSuffix;\n }\n if (string.slice(-oldSuffix.length) != oldSuffix) {\n throw Error(\"string \".concat(JSON.stringify(string), \" doesn't end with suffix \").concat(JSON.stringify(oldSuffix), \"; this is a bug\"));\n }\n return string.slice(0, -oldSuffix.length) + newSuffix;\n}\nfunction removePrefix(string, oldPrefix) {\n return replacePrefix(string, oldPrefix, '');\n}\nfunction removeSuffix(string, oldSuffix) {\n return replaceSuffix(string, oldSuffix, '');\n}\nfunction maximumOverlap(string1, string2) {\n return string2.slice(0, overlapCount(string1, string2));\n}\n// Nicked from https://stackoverflow.com/a/60422853/1709587\nfunction overlapCount(a, b) {\n // Deal with cases where the strings differ in length\n var startA = 0;\n if (a.length > b.length) {\n startA = a.length - b.length;\n }\n var endB = b.length;\n if (a.length < b.length) {\n endB = a.length;\n }\n // Create a back-reference for each index\n // that should be followed in case of a mismatch.\n // We only need B to make these references:\n var map = Array(endB);\n var k = 0; // Index that lags behind j\n map[0] = 0;\n for (var j = 1; j < endB; j++) {\n if (b[j] == b[k]) {\n map[j] = map[k]; // skip over the same character (optional optimisation)\n }\n else {\n map[j] = k;\n }\n while (k > 0 && b[j] != b[k]) {\n k = map[k];\n }\n if (b[j] == b[k]) {\n k++;\n }\n }\n // Phase 2: use these references while iterating over A\n k = 0;\n for (var i = startA; i < a.length; i++) {\n while (k > 0 && a[i] != b[k]) {\n k = map[k];\n }\n if (a[i] == b[k]) {\n k++;\n }\n }\n return k;\n}\n/**\n * Returns true if the string consistently uses Windows line endings.\n */\nfunction hasOnlyWinLineEndings(string) {\n return string.includes('\\r\\n') && !string.startsWith('\\n') && !string.match(/[^\\r]\\n/);\n}\n/**\n * Returns true if the string consistently uses Unix line endings.\n */\nfunction hasOnlyUnixLineEndings(string) {\n return !string.includes('\\r\\n') && string.includes('\\n');\n}\n/**\n * Split a string into segments using a word segmenter, merging consecutive\n * segments if they are both whitespace segments. Whitespace segments can\n * appear adjacent to one another for two reasons:\n * - newlines always get their own segment\n * - where a diacritic is attached to a whitespace character in the text, the\n * segment ends after the diacritic, so e.g. \" \\u0300 \" becomes two segments.\n * This function therefore runs the segmenter's .segment() method and then\n * merges consecutive segments of whitespace into a single part.\n */\nfunction segment(string, segmenter) {\n var parts = [];\n for (var _i = 0, _a = Array.from(segmenter.segment(string)); _i < _a.length; _i++) {\n var segmentObj = _a[_i];\n var segment_1 = segmentObj.segment;\n if (parts.length && (/\\s/).test(parts[parts.length - 1]) && (/\\s/).test(segment_1)) {\n parts[parts.length - 1] += segment_1;\n }\n else {\n parts.push(segment_1);\n }\n }\n return parts;\n}\n// The functions below take a `segmenter` argument so that, when called from\n// diffWords when it is using a segmenter, they can use a notion of what\n// constitutes \"whitespace\" that is consistent with the segmenter.\n//\n// USUALLY this will be identical to the result of the non-segmenter-based\n// logic, but it differs in at least one case: when whitespace characters are\n// modified by diacritics. A word segmenter considers these diacritics to be\n// part of the whitespace, whereas our non-segmenter-based logic does not.\n//\n// Because the segmenter-based approach necessarily requires segmenting the\n// entire string, we offer a leadingAndTrailingWs function to allow getting the\n// whitespace prefix AND whitespace suffix with a single call to the segmenter,\n// for efficiency's sake.\nfunction trailingWs(string, segmenter) {\n if (segmenter) {\n return leadingAndTrailingWs(string, segmenter)[1];\n }\n // Yes, this looks overcomplicated and dumb - why not replace the whole function with\n // return string.match(/\\s*$/)[0]\n // you ask? Because:\n // 1. the trap described at https://markamery.com/blog/quadratic-time-regexes/ would mean doing\n // this would cause this function to take O(n²) time in the worst case (specifically when\n // there is a massive run of NON-TRAILING whitespace in `string`), and\n // 2. the fix proposed in the same blog post, of using a negative lookbehind, is incompatible\n // with old Safari versions that we'd like to not break if possible (see\n // https://github.com/kpdecker/jsdiff/pull/550)\n // It feels absurd to do this with an explicit loop instead of a regex, but I really can't see a\n // better way that doesn't result in broken behaviour.\n var i;\n for (i = string.length - 1; i >= 0; i--) {\n if (!string[i].match(/\\s/)) {\n break;\n }\n }\n return string.substring(i + 1);\n}\nfunction leadingWs(string, segmenter) {\n if (segmenter) {\n return leadingAndTrailingWs(string, segmenter)[0];\n }\n // Thankfully the annoying considerations described in trailingWs don't apply here:\n var match = string.match(/^\\s*/);\n return match ? match[0] : '';\n}\nfunction leadingAndTrailingWs(string, segmenter) {\n if (!segmenter) {\n return [leadingWs(string), trailingWs(string)];\n }\n if (segmenter.resolvedOptions().granularity != 'word') {\n throw new Error('The segmenter passed must have a granularity of \"word\"');\n }\n var segments = segment(string, segmenter);\n var firstSeg = segments[0];\n var lastSeg = segments[segments.length - 1];\n var head = (/\\s/).test(firstSeg) ? firstSeg : '';\n var tail = (/\\s/).test(lastSeg) ? lastSeg : '';\n return [head, tail];\n}\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.wordsWithSpaceDiff = exports.wordDiff = void 0;\nexports.diffWords = diffWords;\nexports.diffWordsWithSpace = diffWordsWithSpace;\nvar base_js_1 = require(\"./base.js\");\nvar string_js_1 = require(\"../util/string.js\");\n// Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode\n//\n// Chars/ranges counted as \"word\" characters by this regex are as follows:\n//\n// + U+00AD Soft hyphen\n// + 00C0–00FF (letters with diacritics from the Latin-1 Supplement), except:\n// - U+00D7 × Multiplication sign\n// - U+00F7 ÷ Division sign\n// + Latin Extended-A, 0100–017F\n// + Latin Extended-B, 0180–024F\n// + IPA Extensions, 0250–02AF\n// + Spacing Modifier Letters, 02B0–02FF, except:\n// - U+02C7 ˇ &#711; Caron\n// - U+02D8 ˘ &#728; Breve\n// - U+02D9 ˙ &#729; Dot Above\n// - U+02DA ˚ &#730; Ring Above\n// - U+02DB ˛ &#731; Ogonek\n// - U+02DC ˜ &#732; Small Tilde\n// - U+02DD ˝ &#733; Double Acute Accent\n// + Latin Extended Additional, 1E00–1EFF\nvar extendedWordChars = 'a-zA-Z0-9_\\\\u{AD}\\\\u{C0}-\\\\u{D6}\\\\u{D8}-\\\\u{F6}\\\\u{F8}-\\\\u{2C6}\\\\u{2C8}-\\\\u{2D7}\\\\u{2DE}-\\\\u{2FF}\\\\u{1E00}-\\\\u{1EFF}';\n// Each token is one of the following:\n// - A punctuation mark plus the surrounding whitespace\n// - A word plus the surrounding whitespace\n// - Pure whitespace (but only in the special case where the entire text\n// is just whitespace)\n//\n// We have to include surrounding whitespace in the tokens because the two\n// alternative approaches produce horribly broken results:\n// * If we just discard the whitespace, we can't fully reproduce the original\n// text from the sequence of tokens and any attempt to render the diff will\n// get the whitespace wrong.\n// * If we have separate tokens for whitespace, then in a typical text every\n// second token will be a single space character. But this often results in\n// the optimal diff between two texts being a perverse one that preserves\n// the spaces between words but deletes and reinserts actual common words.\n// See https://github.com/kpdecker/jsdiff/issues/160#issuecomment-1866099640\n// for an example.\n//\n// Keeping the surrounding whitespace of course has implications for .equals\n// and .join, not just .tokenize.\n// This regex does NOT fully implement the tokenization rules described above.\n// Instead, it gives runs of whitespace their own \"token\". The tokenize method\n// then handles stitching whitespace tokens onto adjacent word or punctuation\n// tokens.\nvar tokenizeIncludingWhitespace = new RegExp(\"[\".concat(extendedWordChars, \"]+|\\\\s+|[^\").concat(extendedWordChars, \"]\"), 'ug');\nvar WordDiff = /** @class */ (function (_super) {\n __extends(WordDiff, _super);\n function WordDiff() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n WordDiff.prototype.equals = function (left, right, options) {\n if (options.ignoreCase) {\n left = left.toLowerCase();\n right = right.toLowerCase();\n }\n return left.trim() === right.trim();\n };\n WordDiff.prototype.tokenize = function (value, options) {\n if (options === void 0) { options = {}; }\n var parts;\n if (options.intlSegmenter) {\n var segmenter = options.intlSegmenter;\n if (segmenter.resolvedOptions().granularity != 'word') {\n throw new Error('The segmenter passed must have a granularity of \"word\"');\n }\n // We want `parts` to be an array whose elements alternate between being\n // pure whitespace and being pure non-whitespace. This is ALMOST what the\n // segments returned by a word-based Intl.Segmenter already look like,\n // but not quite - see explanation in the docs of our custom segment()\n // function.\n parts = (0, string_js_1.segment)(value, segmenter);\n }\n else {\n parts = value.match(tokenizeIncludingWhitespace) || [];\n }\n var tokens = [];\n var prevPart = null;\n parts.forEach(function (part) {\n if ((/\\s/).test(part)) {\n if (prevPart == null) {\n tokens.push(part);\n }\n else {\n tokens.push(tokens.pop() + part);\n }\n }\n else if (prevPart != null && (/\\s/).test(prevPart)) {\n if (tokens[tokens.length - 1] == prevPart) {\n tokens.push(tokens.pop() + part);\n }\n else {\n tokens.push(prevPart + part);\n }\n }\n else {\n tokens.push(part);\n }\n prevPart = part;\n });\n return tokens;\n };\n WordDiff.prototype.join = function (tokens) {\n // Tokens being joined here will always have appeared consecutively in the\n // same text, so we can simply strip off the leading whitespace from all the\n // tokens except the first (and except any whitespace-only tokens - but such\n // a token will always be the first and only token anyway) and then join them\n // and the whitespace around words and punctuation will end up correct.\n return tokens.map(function (token, i) {\n if (i == 0) {\n return token;\n }\n else {\n return token.replace((/^\\s+/), '');\n }\n }).join('');\n };\n WordDiff.prototype.postProcess = function (changes, options) {\n if (!changes || options.oneChangePerToken) {\n return changes;\n }\n var lastKeep = null;\n // Change objects representing any insertion or deletion since the last\n // \"keep\" change object. There can be at most one of each.\n var insertion = null;\n var deletion = null;\n changes.forEach(function (change) {\n if (change.added) {\n insertion = change;\n }\n else if (change.removed) {\n deletion = change;\n }\n else {\n if (insertion || deletion) { // May be false at start of text\n dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change, options.intlSegmenter);\n }\n lastKeep = change;\n insertion = null;\n deletion = null;\n }\n });\n if (insertion || deletion) {\n dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null, options.intlSegmenter);\n }\n return changes;\n };\n return WordDiff;\n}(base_js_1.default));\nexports.wordDiff = new WordDiff();\nfunction diffWords(oldStr, newStr, options) {\n // This option has never been documented and never will be (it's clearer to\n // just call `diffWordsWithSpace` directly if you need that behavior), but\n // has existed in jsdiff for a long time, so we retain support for it here\n // for the sake of backwards compatibility.\n if ((options === null || options === void 0 ? void 0 : options.ignoreWhitespace) != null && !options.ignoreWhitespace) {\n return diffWordsWithSpace(oldStr, newStr, options);\n }\n return exports.wordDiff.diff(oldStr, newStr, options);\n}\nfunction dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep, segmenter) {\n // Before returning, we tidy up the leading and trailing whitespace of the\n // change objects to eliminate cases where trailing whitespace in one object\n // is repeated as leading whitespace in the next.\n // Below are examples of the outcomes we want here to explain the code.\n // I=insert, K=keep, D=delete\n // 1. diffing 'foo bar baz' vs 'foo baz'\n // Prior to cleanup, we have K:'foo ' D:' bar ' K:' baz'\n // After cleanup, we want: K:'foo ' D:'bar ' K:'baz'\n //\n // 2. Diffing 'foo bar baz' vs 'foo qux baz'\n // Prior to cleanup, we have K:'foo ' D:' bar ' I:' qux ' K:' baz'\n // After cleanup, we want K:'foo ' D:'bar' I:'qux' K:' baz'\n //\n // 3. Diffing 'foo\\nbar baz' vs 'foo baz'\n // Prior to cleanup, we have K:'foo ' D:'\\nbar ' K:' baz'\n // After cleanup, we want K'foo' D:'\\nbar' K:' baz'\n //\n // 4. Diffing 'foo baz' vs 'foo\\nbar baz'\n // Prior to cleanup, we have K:'foo\\n' I:'\\nbar ' K:' baz'\n // After cleanup, we ideally want K'foo' I:'\\nbar' K:' baz'\n // but don't actually manage this currently (the pre-cleanup change\n // objects don't contain enough information to make it possible).\n //\n // 5. Diffing 'foo bar baz' vs 'foo baz'\n // Prior to cleanup, we have K:'foo ' D:' bar ' K:' baz'\n // After cleanup, we want K:'foo ' D:' bar ' K:'baz'\n //\n // Our handling is unavoidably imperfect in the case where there's a single\n // indel between keeps and the whitespace has changed. For instance, consider\n // diffing 'foo\\tbar\\nbaz' vs 'foo baz'. Unless we create an extra change\n // object to represent the insertion of the space character (which isn't even\n // a token), we have no way to avoid losing information about the texts'\n // original whitespace in the result we return. Still, we do our best to\n // output something that will look sensible if we e.g. print it with\n // insertions in green and deletions in red.\n // Between two \"keep\" change objects (or before the first or after the last\n // change object), we can have either:\n // * A \"delete\" followed by an \"insert\"\n // * Just an \"insert\"\n // * Just a \"delete\"\n // We handle the three cases separately.\n if (deletion && insertion) {\n var _a = (0, string_js_1.leadingAndTrailingWs)(deletion.value, segmenter), oldWsPrefix = _a[0], oldWsSuffix = _a[1];\n var _b = (0, string_js_1.leadingAndTrailingWs)(insertion.value, segmenter), newWsPrefix = _b[0], newWsSuffix = _b[1];\n if (startKeep) {\n var commonWsPrefix = (0, string_js_1.longestCommonPrefix)(oldWsPrefix, newWsPrefix);\n startKeep.value = (0, string_js_1.replaceSuffix)(startKeep.value, newWsPrefix, commonWsPrefix);\n deletion.value = (0, string_js_1.removePrefix)(deletion.value, commonWsPrefix);\n insertion.value = (0, string_js_1.removePrefix)(insertion.value, commonWsPrefix);\n }\n if (endKeep) {\n var commonWsSuffix = (0, string_js_1.longestCommonSuffix)(oldWsSuffix, newWsSuffix);\n endKeep.value = (0, string_js_1.replacePrefix)(endKeep.value, newWsSuffix, commonWsSuffix);\n deletion.value = (0, string_js_1.removeSuffix)(deletion.value, commonWsSuffix);\n insertion.value = (0, string_js_1.removeSuffix)(insertion.value, commonWsSuffix);\n }\n }\n else if (insertion) {\n // The whitespaces all reflect what was in the new text rather than\n // the old, so we essentially have no information about whitespace\n // insertion or deletion. We just want to dedupe the whitespace.\n // We do that by having each change object keep its trailing\n // whitespace and deleting duplicate leading whitespace where\n // present.\n if (startKeep) {\n var ws = (0, string_js_1.leadingWs)(insertion.value, segmenter);\n insertion.value = insertion.value.substring(ws.length);\n }\n if (endKeep) {\n var ws = (0, string_js_1.leadingWs)(endKeep.value, segmenter);\n endKeep.value = endKeep.value.substring(ws.length);\n }\n // otherwise we've got a deletion and no insertion\n }\n else if (startKeep && endKeep) {\n var newWsFull = (0, string_js_1.leadingWs)(endKeep.value, segmenter), _c = (0, string_js_1.leadingAndTrailingWs)(deletion.value, segmenter), delWsStart = _c[0], delWsEnd = _c[1];\n // Any whitespace that comes straight after startKeep in both the old and\n // new texts, assign to startKeep and remove from the deletion.\n var newWsStart = (0, string_js_1.longestCommonPrefix)(newWsFull, delWsStart);\n deletion.value = (0, string_js_1.removePrefix)(deletion.value, newWsStart);\n // Any whitespace that comes straight before endKeep in both the old and\n // new texts, and hasn't already been assigned to startKeep, assign to\n // endKeep and remove from the deletion.\n var newWsEnd = (0, string_js_1.longestCommonSuffix)((0, string_js_1.removePrefix)(newWsFull, newWsStart), delWsEnd);\n deletion.value = (0, string_js_1.removeSuffix)(deletion.value, newWsEnd);\n endKeep.value = (0, string_js_1.replacePrefix)(endKeep.value, newWsFull, newWsEnd);\n // If there's any whitespace from the new text that HASN'T already been\n // assigned, assign it to the start:\n startKeep.value = (0, string_js_1.replaceSuffix)(startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length));\n }\n else if (endKeep) {\n // We are at the start of the text. Preserve all the whitespace on\n // endKeep, and just remove whitespace from the end of deletion to the\n // extent that it overlaps with the start of endKeep.\n var endKeepWsPrefix = (0, string_js_1.leadingWs)(endKeep.value, segmenter);\n var deletionWsSuffix = (0, string_js_1.trailingWs)(deletion.value, segmenter);\n var overlap = (0, string_js_1.maximumOverlap)(deletionWsSuffix, endKeepWsPrefix);\n deletion.value = (0, string_js_1.removeSuffix)(deletion.value, overlap);\n }\n else if (startKeep) {\n // We are at the END of the text. Preserve all the whitespace on\n // startKeep, and just remove whitespace from the start of deletion to\n // the extent that it overlaps with the end of startKeep.\n var startKeepWsSuffix = (0, string_js_1.trailingWs)(startKeep.value, segmenter);\n var deletionWsPrefix = (0, string_js_1.leadingWs)(deletion.value, segmenter);\n var overlap = (0, string_js_1.maximumOverlap)(startKeepWsSuffix, deletionWsPrefix);\n deletion.value = (0, string_js_1.removePrefix)(deletion.value, overlap);\n }\n}\nvar WordsWithSpaceDiff = /** @class */ (function (_super) {\n __extends(WordsWithSpaceDiff, _super);\n function WordsWithSpaceDiff() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n WordsWithSpaceDiff.prototype.tokenize = function (value) {\n // Slightly different to the tokenizeIncludingWhitespace regex used above in\n // that this one treats each individual newline as a distinct token, rather\n // than merging them into other surrounding whitespace. This was requested\n // in https://github.com/kpdecker/jsdiff/issues/180 &\n // https://github.com/kpdecker/jsdiff/issues/211\n var regex = new RegExp(\"(\\\\r?\\\\n)|[\".concat(extendedWordChars, \"]+|[^\\\\S\\\\n\\\\r]+|[^\").concat(extendedWordChars, \"]\"), 'ug');\n return value.match(regex) || [];\n };\n return WordsWithSpaceDiff;\n}(base_js_1.default));\nexports.wordsWithSpaceDiff = new WordsWithSpaceDiff();\nfunction diffWordsWithSpace(oldStr, newStr, options) {\n return exports.wordsWithSpaceDiff.diff(oldStr, newStr, options);\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateOptions = generateOptions;\nfunction generateOptions(options, defaults) {\n if (typeof options === 'function') {\n defaults.callback = options;\n }\n else if (options) {\n for (var name in options) {\n /* istanbul ignore else */\n if (Object.prototype.hasOwnProperty.call(options, name)) {\n defaults[name] = options[name];\n }\n }\n }\n return defaults;\n}\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lineDiff = void 0;\nexports.diffLines = diffLines;\nexports.diffTrimmedLines = diffTrimmedLines;\nexports.tokenize = tokenize;\nvar base_js_1 = require(\"./base.js\");\nvar params_js_1 = require(\"../util/params.js\");\nvar LineDiff = /** @class */ (function (_super) {\n __extends(LineDiff, _super);\n function LineDiff() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.tokenize = tokenize;\n return _this;\n }\n LineDiff.prototype.equals = function (left, right, options) {\n // If we're ignoring whitespace, we need to normalise lines by stripping\n // whitespace before checking equality. (This has an annoying interaction\n // with newlineIsToken that requires special handling: if newlines get their\n // own token, then we DON'T want to trim the *newline* tokens down to empty\n // strings, since this would cause us to treat whitespace-only line content\n // as equal to a separator between lines, which would be weird and\n // inconsistent with the documented behavior of the options.)\n if (options.ignoreWhitespace) {\n if (!options.newlineIsToken || !left.includes('\\n')) {\n left = left.trim();\n }\n if (!options.newlineIsToken || !right.includes('\\n')) {\n right = right.trim();\n }\n }\n else if (options.ignoreNewlineAtEof && !options.newlineIsToken) {\n if (left.endsWith('\\n')) {\n left = left.slice(0, -1);\n }\n if (right.endsWith('\\n')) {\n right = right.slice(0, -1);\n }\n }\n return _super.prototype.equals.call(this, left, right, options);\n };\n return LineDiff;\n}(base_js_1.default));\nexports.lineDiff = new LineDiff();\nfunction diffLines(oldStr, newStr, options) {\n return exports.lineDiff.diff(oldStr, newStr, options);\n}\nfunction diffTrimmedLines(oldStr, newStr, options) {\n options = (0, params_js_1.generateOptions)(options, { ignoreWhitespace: true });\n return exports.lineDiff.diff(oldStr, newStr, options);\n}\n// Exported standalone so it can be used from jsonDiff too.\nfunction tokenize(value, options) {\n if (options.stripTrailingCr) {\n // remove one \\r before \\n to match GNU diff's --strip-trailing-cr behavior\n value = value.replace(/\\r\\n/g, '\\n');\n }\n var retLines = [], linesAndNewlines = value.split(/(\\n|\\r\\n)/);\n // Ignore the final empty token that occurs if the string ends with a new line\n if (!linesAndNewlines[linesAndNewlines.length - 1]) {\n linesAndNewlines.pop();\n }\n // Merge the content and line separators into single tokens\n for (var i = 0; i < linesAndNewlines.length; i++) {\n var line = linesAndNewlines[i];\n if (i % 2 && !options.newlineIsToken) {\n retLines[retLines.length - 1] += line;\n }\n else {\n retLines.push(line);\n }\n }\n return retLines;\n}\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sentenceDiff = void 0;\nexports.diffSentences = diffSentences;\nvar base_js_1 = require(\"./base.js\");\nfunction isSentenceEndPunct(char) {\n return char == '.' || char == '!' || char == '?';\n}\nvar SentenceDiff = /** @class */ (function (_super) {\n __extends(SentenceDiff, _super);\n function SentenceDiff() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SentenceDiff.prototype.tokenize = function (value) {\n var _a;\n // If in future we drop support for environments that don't support lookbehinds, we can replace\n // this entire function with:\n // return value.split(/(?<=[.!?])(\\s+|$)/);\n // but until then, for similar reasons to the trailingWs function in string.ts, we are forced\n // to do this verbosely \"by hand\" instead of using a regex.\n var result = [];\n var tokenStartI = 0;\n for (var i = 0; i < value.length; i++) {\n if (i == value.length - 1) {\n result.push(value.slice(tokenStartI));\n break;\n }\n if (isSentenceEndPunct(value[i]) && value[i + 1].match(/\\s/)) {\n // We've hit a sentence break - i.e. a punctuation mark followed by whitespace.\n // We now want to push TWO tokens to the result:\n // 1. the sentence\n result.push(value.slice(tokenStartI, i + 1));\n // 2. the whitespace\n i = tokenStartI = i + 1;\n while ((_a = value[i + 1]) === null || _a === void 0 ? void 0 : _a.match(/\\s/)) {\n i++;\n }\n result.push(value.slice(tokenStartI, i + 1));\n // Then the next token (a sentence) starts on the character after the whitespace.\n // (It's okay if this is off the end of the string - then the outer loop will terminate\n // here anyway.)\n tokenStartI = i + 1;\n }\n }\n return result;\n };\n return SentenceDiff;\n}(base_js_1.default));\nexports.sentenceDiff = new SentenceDiff();\nfunction diffSentences(oldStr, newStr, options) {\n return exports.sentenceDiff.diff(oldStr, newStr, options);\n}\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.cssDiff = void 0;\nexports.diffCss = diffCss;\nvar base_js_1 = require(\"./base.js\");\nvar CssDiff = /** @class */ (function (_super) {\n __extends(CssDiff, _super);\n function CssDiff() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n CssDiff.prototype.tokenize = function (value) {\n return value.split(/([{}:;,]|\\s+)/);\n };\n return CssDiff;\n}(base_js_1.default));\nexports.cssDiff = new CssDiff();\nfunction diffCss(oldStr, newStr, options) {\n return exports.cssDiff.diff(oldStr, newStr, options);\n}\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.jsonDiff = void 0;\nexports.diffJson = diffJson;\nexports.canonicalize = canonicalize;\nvar base_js_1 = require(\"./base.js\");\nvar line_js_1 = require(\"./line.js\");\nvar JsonDiff = /** @class */ (function (_super) {\n __extends(JsonDiff, _super);\n function JsonDiff() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.tokenize = line_js_1.tokenize;\n return _this;\n }\n Object.defineProperty(JsonDiff.prototype, \"useLongestToken\", {\n get: function () {\n // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a\n // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:\n return true;\n },\n enumerable: false,\n configurable: true\n });\n JsonDiff.prototype.castInput = function (value, options) {\n var undefinedReplacement = options.undefinedReplacement, _a = options.stringifyReplacer, stringifyReplacer = _a === void 0 ? function (k, v) { return typeof v === 'undefined' ? undefinedReplacement : v; } : _a;\n return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), null, ' ');\n };\n JsonDiff.prototype.equals = function (left, right, options) {\n return _super.prototype.equals.call(this, left.replace(/,([\\r\\n])/g, '$1'), right.replace(/,([\\r\\n])/g, '$1'), options);\n };\n return JsonDiff;\n}(base_js_1.default));\nexports.jsonDiff = new JsonDiff();\nfunction diffJson(oldStr, newStr, options) {\n return exports.jsonDiff.diff(oldStr, newStr, options);\n}\n// This function handles the presence of circular references by bailing out when encountering an\n// object that is already on the \"stack\" of items being processed. Accepts an optional replacer\nfunction canonicalize(obj, stack, replacementStack, replacer, key) {\n stack = stack || [];\n replacementStack = replacementStack || [];\n if (replacer) {\n obj = replacer(key === undefined ? '' : key, obj);\n }\n var i;\n for (i = 0; i < stack.length; i += 1) {\n if (stack[i] === obj) {\n return replacementStack[i];\n }\n }\n var canonicalizedObj;\n if ('[object Array]' === Object.prototype.toString.call(obj)) {\n stack.push(obj);\n canonicalizedObj = new Array(obj.length);\n replacementStack.push(canonicalizedObj);\n for (i = 0; i < obj.length; i += 1) {\n canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, String(i));\n }\n stack.pop();\n replacementStack.pop();\n return canonicalizedObj;\n }\n if (obj && obj.toJSON) {\n obj = obj.toJSON();\n }\n if (typeof obj === 'object' && obj !== null) {\n stack.push(obj);\n canonicalizedObj = {};\n replacementStack.push(canonicalizedObj);\n var sortedKeys = [];\n var key_1;\n for (key_1 in obj) {\n /* istanbul ignore else */\n if (Object.prototype.hasOwnProperty.call(obj, key_1)) {\n sortedKeys.push(key_1);\n }\n }\n sortedKeys.sort();\n for (i = 0; i < sortedKeys.length; i += 1) {\n key_1 = sortedKeys[i];\n canonicalizedObj[key_1] = canonicalize(obj[key_1], stack, replacementStack, replacer, key_1);\n }\n stack.pop();\n replacementStack.pop();\n }\n else {\n canonicalizedObj = obj;\n }\n return canonicalizedObj;\n}\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.arrayDiff = void 0;\nexports.diffArrays = diffArrays;\nvar base_js_1 = require(\"./base.js\");\nvar ArrayDiff = /** @class */ (function (_super) {\n __extends(ArrayDiff, _super);\n function ArrayDiff() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ArrayDiff.prototype.tokenize = function (value) {\n return value.slice();\n };\n ArrayDiff.prototype.join = function (value) {\n return value;\n };\n ArrayDiff.prototype.removeEmpty = function (value) {\n return value;\n };\n return ArrayDiff;\n}(base_js_1.default));\nexports.arrayDiff = new ArrayDiff();\nfunction diffArrays(oldArr, newArr, options) {\n return exports.arrayDiff.diff(oldArr, newArr, options);\n}\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unixToWin = unixToWin;\nexports.winToUnix = winToUnix;\nexports.isUnix = isUnix;\nexports.isWin = isWin;\nfunction unixToWin(patch) {\n if (Array.isArray(patch)) {\n // It would be cleaner if instead of the line below we could just write\n // return patch.map(unixToWin)\n // but mysteriously TypeScript (v5.7.3 at the time of writing) does not like this and it will\n // refuse to compile, thinking that unixToWin could then return StructuredPatch[][] and the\n // result would be incompatible with the overload signatures.\n // See bug report at https://github.com/microsoft/TypeScript/issues/61398.\n return patch.map(function (p) { return unixToWin(p); });\n }\n return __assign(__assign({}, patch), { hunks: patch.hunks.map(function (hunk) { return (__assign(__assign({}, hunk), { lines: hunk.lines.map(function (line, i) {\n var _a;\n return (line.startsWith('\\\\') || line.endsWith('\\r') || ((_a = hunk.lines[i + 1]) === null || _a === void 0 ? void 0 : _a.startsWith('\\\\')))\n ? line\n : line + '\\r';\n }) })); }) });\n}\nfunction winToUnix(patch) {\n if (Array.isArray(patch)) {\n // (See comment above equivalent line in unixToWin)\n return patch.map(function (p) { return winToUnix(p); });\n }\n return __assign(__assign({}, patch), { hunks: patch.hunks.map(function (hunk) { return (__assign(__assign({}, hunk), { lines: hunk.lines.map(function (line) { return line.endsWith('\\r') ? line.substring(0, line.length - 1) : line; }) })); }) });\n}\n/**\n * Returns true if the patch consistently uses Unix line endings (or only involves one line and has\n * no line endings).\n */\nfunction isUnix(patch) {\n if (!Array.isArray(patch)) {\n patch = [patch];\n }\n return !patch.some(function (index) { return index.hunks.some(function (hunk) { return hunk.lines.some(function (line) { return !line.startsWith('\\\\') && line.endsWith('\\r'); }); }); });\n}\n/**\n * Returns true if the patch uses Windows line endings and only Windows line endings.\n */\nfunction isWin(patch) {\n if (!Array.isArray(patch)) {\n patch = [patch];\n }\n return patch.some(function (index) { return index.hunks.some(function (hunk) { return hunk.lines.some(function (line) { return line.endsWith('\\r'); }); }); })\n && patch.every(function (index) { return index.hunks.every(function (hunk) { return hunk.lines.every(function (line, i) { var _a; return line.startsWith('\\\\') || line.endsWith('\\r') || ((_a = hunk.lines[i + 1]) === null || _a === void 0 ? void 0 : _a.startsWith('\\\\')); }); }); });\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parsePatch = parsePatch;\n/**\n * Parses a patch into structured data, in the same structure returned by `structuredPatch`.\n *\n * @return a JSON object representation of the a patch, suitable for use with the `applyPatch` method.\n */\nfunction parsePatch(uniDiff) {\n var diffstr = uniDiff.split(/\\n/), list = [];\n var i = 0;\n function parseIndex() {\n var index = {};\n list.push(index);\n // Parse diff metadata\n while (i < diffstr.length) {\n var line = diffstr[i];\n // File header found, end parsing diff metadata\n if ((/^(---|\\+\\+\\+|@@)\\s/).test(line)) {\n break;\n }\n // Try to parse the line as a diff header, like\n // Index: README.md\n // or\n // diff -r 9117c6561b0b -r 273ce12ad8f1 .hgignore\n // or\n // Index: something with multiple words\n // and extract the filename (or whatever else is used as an index name)\n // from the end (i.e. 'README.md', '.hgignore', or\n // 'something with multiple words' in the examples above).\n //\n // TODO: It seems awkward that we indiscriminately trim off trailing\n // whitespace here. Theoretically, couldn't that be meaningful -\n // e.g. if the patch represents a diff of a file whose name ends\n // with a space? Seems wrong to nuke it.\n // But this behaviour has been around since v2.2.1 in 2015, so if\n // it's going to change, it should be done cautiously and in a new\n // major release, for backwards-compat reasons.\n // -- ExplodingCabbage\n var headerMatch = (/^(?:Index:|diff(?: -r \\w+)+)\\s+/).exec(line);\n if (headerMatch) {\n index.index = line.substring(headerMatch[0].length).trim();\n }\n i++;\n }\n // Parse file headers if they are defined. Unified diff requires them, but\n // there's no technical issues to have an isolated hunk without file header\n parseFileHeader(index);\n parseFileHeader(index);\n // Parse hunks\n index.hunks = [];\n while (i < diffstr.length) {\n var line = diffstr[i];\n if ((/^(Index:\\s|diff\\s|---\\s|\\+\\+\\+\\s|===================================================================)/).test(line)) {\n break;\n }\n else if ((/^@@/).test(line)) {\n index.hunks.push(parseHunk());\n }\n else if (line) {\n throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(line));\n }\n else {\n i++;\n }\n }\n }\n // Parses the --- and +++ headers, if none are found, no lines\n // are consumed.\n function parseFileHeader(index) {\n var fileHeaderMatch = (/^(---|\\+\\+\\+)\\s+/).exec(diffstr[i]);\n if (fileHeaderMatch) {\n var prefix = fileHeaderMatch[1], data = diffstr[i].substring(3).trim().split('\\t', 2), header = (data[1] || '').trim();\n var fileName = data[0].replace(/\\\\\\\\/g, '\\\\');\n if (fileName.startsWith('\"') && fileName.endsWith('\"')) {\n fileName = fileName.substr(1, fileName.length - 2);\n }\n if (prefix === '---') {\n index.oldFileName = fileName;\n index.oldHeader = header;\n }\n else {\n index.newFileName = fileName;\n index.newHeader = header;\n }\n i++;\n }\n }\n // Parses a hunk\n // This assumes that we are at the start of a hunk.\n function parseHunk() {\n var _a;\n var chunkHeaderIndex = i, chunkHeaderLine = diffstr[i++], chunkHeader = chunkHeaderLine.split(/@@ -(\\d+)(?:,(\\d+))? \\+(\\d+)(?:,(\\d+))? @@/);\n var hunk = {\n oldStart: +chunkHeader[1],\n oldLines: typeof chunkHeader[2] === 'undefined' ? 1 : +chunkHeader[2],\n newStart: +chunkHeader[3],\n newLines: typeof chunkHeader[4] === 'undefined' ? 1 : +chunkHeader[4],\n lines: []\n };\n // Unified Diff Format quirk: If the chunk size is 0,\n // the first number is one lower than one would expect.\n // https://www.artima.com/weblogs/viewpost.jsp?thread=164293\n if (hunk.oldLines === 0) {\n hunk.oldStart += 1;\n }\n if (hunk.newLines === 0) {\n hunk.newStart += 1;\n }\n var addCount = 0, removeCount = 0;\n for (; i < diffstr.length && (removeCount < hunk.oldLines || addCount < hunk.newLines || ((_a = diffstr[i]) === null || _a === void 0 ? void 0 : _a.startsWith('\\\\'))); i++) {\n var operation = (diffstr[i].length == 0 && i != (diffstr.length - 1)) ? ' ' : diffstr[i][0];\n if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\\\') {\n hunk.lines.push(diffstr[i]);\n if (operation === '+') {\n addCount++;\n }\n else if (operation === '-') {\n removeCount++;\n }\n else if (operation === ' ') {\n addCount++;\n removeCount++;\n }\n }\n else {\n throw new Error(\"Hunk at line \".concat(chunkHeaderIndex + 1, \" contained invalid line \").concat(diffstr[i]));\n }\n }\n // Handle the empty block count case\n if (!addCount && hunk.newLines === 1) {\n hunk.newLines = 0;\n }\n if (!removeCount && hunk.oldLines === 1) {\n hunk.oldLines = 0;\n }\n // Perform sanity checking\n if (addCount !== hunk.newLines) {\n throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1));\n }\n if (removeCount !== hunk.oldLines) {\n throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1));\n }\n return hunk;\n }\n while (i < diffstr.length) {\n parseIndex();\n }\n return list;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = default_1;\n// Iterator that traverses in the range of [min, max], stepping\n// by distance from a given start position. I.e. for [0, 4], with\n// start of 2, this will iterate 2, 3, 1, 4, 0.\nfunction default_1(start, minLine, maxLine) {\n var wantForward = true, backwardExhausted = false, forwardExhausted = false, localOffset = 1;\n return function iterator() {\n if (wantForward && !forwardExhausted) {\n if (backwardExhausted) {\n localOffset++;\n }\n else {\n wantForward = false;\n }\n // Check if trying to fit beyond text length, and if not, check it fits\n // after offset location (or desired location on first iteration)\n if (start + localOffset <= maxLine) {\n return start + localOffset;\n }\n forwardExhausted = true;\n }\n if (!backwardExhausted) {\n if (!forwardExhausted) {\n wantForward = true;\n }\n // Check if trying to fit before text beginning, and if not, check it fits\n // before offset location\n if (minLine <= start - localOffset) {\n return start - localOffset++;\n }\n backwardExhausted = true;\n return iterator();\n }\n // We tried to fit hunk before text beginning and beyond text length, then\n // hunk can't fit on the text. Return undefined\n return undefined;\n };\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.applyPatch = applyPatch;\nexports.applyPatches = applyPatches;\nvar string_js_1 = require(\"../util/string.js\");\nvar line_endings_js_1 = require(\"./line-endings.js\");\nvar parse_js_1 = require(\"./parse.js\");\nvar distance_iterator_js_1 = require(\"../util/distance-iterator.js\");\n/**\n * attempts to apply a unified diff patch.\n *\n * Hunks are applied first to last.\n * `applyPatch` first tries to apply the first hunk at the line number specified in the hunk header, and with all context lines matching exactly.\n * If that fails, it tries scanning backwards and forwards, one line at a time, to find a place to apply the hunk where the context lines match exactly.\n * If that still fails, and `fuzzFactor` is greater than zero, it increments the maximum number of mismatches (missing, extra, or changed context lines) that there can be between the hunk context and a region where we are trying to apply the patch such that the hunk will still be considered to match.\n * Regardless of `fuzzFactor`, lines to be deleted in the hunk *must* be present for a hunk to match, and the context lines *immediately* before and after an insertion must match exactly.\n *\n * Once a hunk is successfully fitted, the process begins again with the next hunk.\n * Regardless of `fuzzFactor`, later hunks must be applied later in the file than earlier hunks.\n *\n * If a hunk cannot be successfully fitted *anywhere* with fewer than `fuzzFactor` mismatches, `applyPatch` fails and returns `false`.\n *\n * If a hunk is successfully fitted but not at the line number specified by the hunk header, all subsequent hunks have their target line number adjusted accordingly.\n * (e.g. if the first hunk is applied 10 lines below where the hunk header said it should fit, `applyPatch` will *start* looking for somewhere to apply the second hunk 10 lines below where its hunk header says it goes.)\n *\n * If the patch was applied successfully, returns a string containing the patched text.\n * If the patch could not be applied (because some hunks in the patch couldn't be fitted to the text in `source`), `applyPatch` returns false.\n *\n * @param patch a string diff or the output from the `parsePatch` or `structuredPatch` methods.\n */\nfunction applyPatch(source, patch, options) {\n if (options === void 0) { options = {}; }\n var patches;\n if (typeof patch === 'string') {\n patches = (0, parse_js_1.parsePatch)(patch);\n }\n else if (Array.isArray(patch)) {\n patches = patch;\n }\n else {\n patches = [patch];\n }\n if (patches.length > 1) {\n throw new Error('applyPatch only works with a single input.');\n }\n return applyStructuredPatch(source, patches[0], options);\n}\nfunction applyStructuredPatch(source, patch, options) {\n if (options === void 0) { options = {}; }\n if (options.autoConvertLineEndings || options.autoConvertLineEndings == null) {\n if ((0, string_js_1.hasOnlyWinLineEndings)(source) && (0, line_endings_js_1.isUnix)(patch)) {\n patch = (0, line_endings_js_1.unixToWin)(patch);\n }\n else if ((0, string_js_1.hasOnlyUnixLineEndings)(source) && (0, line_endings_js_1.isWin)(patch)) {\n patch = (0, line_endings_js_1.winToUnix)(patch);\n }\n }\n // Apply the diff to the input\n var lines = source.split('\\n'), hunks = patch.hunks, compareLine = options.compareLine || (function (lineNumber, line, operation, patchContent) { return line === patchContent; }), fuzzFactor = options.fuzzFactor || 0;\n var minLine = 0;\n if (fuzzFactor < 0 || !Number.isInteger(fuzzFactor)) {\n throw new Error('fuzzFactor must be a non-negative integer');\n }\n // Special case for empty patch.\n if (!hunks.length) {\n return source;\n }\n // Before anything else, handle EOFNL insertion/removal. If the patch tells us to make a change\n // to the EOFNL that is redundant/impossible - i.e. to remove a newline that's not there, or add a\n // newline that already exists - then we either return false and fail to apply the patch (if\n // fuzzFactor is 0) or simply ignore the problem and do nothing (if fuzzFactor is >0).\n // If we do need to remove/add a newline at EOF, this will always be in the final hunk:\n var prevLine = '', removeEOFNL = false, addEOFNL = false;\n for (var i = 0; i < hunks[hunks.length - 1].lines.length; i++) {\n var line = hunks[hunks.length - 1].lines[i];\n if (line[0] == '\\\\') {\n if (prevLine[0] == '+') {\n removeEOFNL = true;\n }\n else if (prevLine[0] == '-') {\n addEOFNL = true;\n }\n }\n prevLine = line;\n }\n if (removeEOFNL) {\n if (addEOFNL) {\n // This means the final line gets changed but doesn't have a trailing newline in either the\n // original or patched version. In that case, we do nothing if fuzzFactor > 0, and if\n // fuzzFactor is 0, we simply validate that the source file has no trailing newline.\n if (!fuzzFactor && lines[lines.length - 1] == '') {\n return false;\n }\n }\n else if (lines[lines.length - 1] == '') {\n lines.pop();\n }\n else if (!fuzzFactor) {\n return false;\n }\n }\n else if (addEOFNL) {\n if (lines[lines.length - 1] != '') {\n lines.push('');\n }\n else if (!fuzzFactor) {\n return false;\n }\n }\n /**\n * Checks if the hunk can be made to fit at the provided location with at most `maxErrors`\n * insertions, substitutions, or deletions, while ensuring also that:\n * - lines deleted in the hunk match exactly, and\n * - wherever an insertion operation or block of insertion operations appears in the hunk, the\n * immediately preceding and following lines of context match exactly\n *\n * `toPos` should be set such that lines[toPos] is meant to match hunkLines[0].\n *\n * If the hunk can be applied, returns an object with properties `oldLineLastI` and\n * `replacementLines`. Otherwise, returns null.\n */\n function applyHunk(hunkLines, toPos, maxErrors, hunkLinesI, lastContextLineMatched, patchedLines, patchedLinesLength) {\n if (hunkLinesI === void 0) { hunkLinesI = 0; }\n if (lastContextLineMatched === void 0) { lastContextLineMatched = true; }\n if (patchedLines === void 0) { patchedLines = []; }\n if (patchedLinesLength === void 0) { patchedLinesLength = 0; }\n var nConsecutiveOldContextLines = 0;\n var nextContextLineMustMatch = false;\n for (; hunkLinesI < hunkLines.length; hunkLinesI++) {\n var hunkLine = hunkLines[hunkLinesI], operation = (hunkLine.length > 0 ? hunkLine[0] : ' '), content = (hunkLine.length > 0 ? hunkLine.substr(1) : hunkLine);\n if (operation === '-') {\n if (compareLine(toPos + 1, lines[toPos], operation, content)) {\n toPos++;\n nConsecutiveOldContextLines = 0;\n }\n else {\n if (!maxErrors || lines[toPos] == null) {\n return null;\n }\n patchedLines[patchedLinesLength] = lines[toPos];\n return applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1);\n }\n }\n if (operation === '+') {\n if (!lastContextLineMatched) {\n return null;\n }\n patchedLines[patchedLinesLength] = content;\n patchedLinesLength++;\n nConsecutiveOldContextLines = 0;\n nextContextLineMustMatch = true;\n }\n if (operation === ' ') {\n nConsecutiveOldContextLines++;\n patchedLines[patchedLinesLength] = lines[toPos];\n if (compareLine(toPos + 1, lines[toPos], operation, content)) {\n patchedLinesLength++;\n lastContextLineMatched = true;\n nextContextLineMustMatch = false;\n toPos++;\n }\n else {\n if (nextContextLineMustMatch || !maxErrors) {\n return null;\n }\n // Consider 3 possibilities in sequence:\n // 1. lines contains a *substitution* not included in the patch context, or\n // 2. lines contains an *insertion* not included in the patch context, or\n // 3. lines contains a *deletion* not included in the patch context\n // The first two options are of course only possible if the line from lines is non-null -\n // i.e. only option 3 is possible if we've overrun the end of the old file.\n return (lines[toPos] && (applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength + 1) || applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1)) || applyHunk(hunkLines, toPos, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength));\n }\n }\n }\n // Before returning, trim any unmodified context lines off the end of patchedLines and reduce\n // toPos (and thus oldLineLastI) accordingly. This allows later hunks to be applied to a region\n // that starts in this hunk's trailing context.\n patchedLinesLength -= nConsecutiveOldContextLines;\n toPos -= nConsecutiveOldContextLines;\n patchedLines.length = patchedLinesLength;\n return {\n patchedLines: patchedLines,\n oldLineLastI: toPos - 1\n };\n }\n var resultLines = [];\n // Search best fit offsets for each hunk based on the previous ones\n var prevHunkOffset = 0;\n for (var i = 0; i < hunks.length; i++) {\n var hunk = hunks[i];\n var hunkResult = void 0;\n var maxLine = lines.length - hunk.oldLines + fuzzFactor;\n var toPos = void 0;\n for (var maxErrors = 0; maxErrors <= fuzzFactor; maxErrors++) {\n toPos = hunk.oldStart + prevHunkOffset - 1;\n var iterator = (0, distance_iterator_js_1.default)(toPos, minLine, maxLine);\n for (; toPos !== undefined; toPos = iterator()) {\n hunkResult = applyHunk(hunk.lines, toPos, maxErrors);\n if (hunkResult) {\n break;\n }\n }\n if (hunkResult) {\n break;\n }\n }\n if (!hunkResult) {\n return false;\n }\n // Copy everything from the end of where we applied the last hunk to the start of this hunk\n for (var i_1 = minLine; i_1 < toPos; i_1++) {\n resultLines.push(lines[i_1]);\n }\n // Add the lines produced by applying the hunk:\n for (var i_2 = 0; i_2 < hunkResult.patchedLines.length; i_2++) {\n var line = hunkResult.patchedLines[i_2];\n resultLines.push(line);\n }\n // Set lower text limit to end of the current hunk, so next ones don't try\n // to fit over already patched text\n minLine = hunkResult.oldLineLastI + 1;\n // Note the offset between where the patch said the hunk should've applied and where we\n // applied it, so we can adjust future hunks accordingly:\n prevHunkOffset = toPos + 1 - hunk.oldStart;\n }\n // Copy over the rest of the lines from the old text\n for (var i = minLine; i < lines.length; i++) {\n resultLines.push(lines[i]);\n }\n return resultLines.join('\\n');\n}\n/**\n * applies one or more patches.\n *\n * `patch` may be either an array of structured patch objects, or a string representing a patch in unified diff format (which may patch one or more files).\n *\n * This method will iterate over the contents of the patch and apply to data provided through callbacks. The general flow for each patch index is:\n *\n * - `options.loadFile(index, callback)` is called. The caller should then load the contents of the file and then pass that to the `callback(err, data)` callback. Passing an `err` will terminate further patch execution.\n * - `options.patched(index, content, callback)` is called once the patch has been applied. `content` will be the return value from `applyPatch`. When it's ready, the caller should call `callback(err)` callback. Passing an `err` will terminate further patch execution.\n *\n * Once all patches have been applied or an error occurs, the `options.complete(err)` callback is made.\n */\nfunction applyPatches(uniDiff, options) {\n var spDiff = typeof uniDiff === 'string' ? (0, parse_js_1.parsePatch)(uniDiff) : uniDiff;\n var currentIndex = 0;\n function processIndex() {\n var index = spDiff[currentIndex++];\n if (!index) {\n return options.complete();\n }\n options.loadFile(index, function (err, data) {\n if (err) {\n return options.complete(err);\n }\n var updatedContent = applyPatch(data, index, options);\n options.patched(index, updatedContent, function (err) {\n if (err) {\n return options.complete(err);\n }\n processIndex();\n });\n });\n }\n processIndex();\n}\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.reversePatch = reversePatch;\nfunction reversePatch(structuredPatch) {\n if (Array.isArray(structuredPatch)) {\n // (See comment in unixToWin for why we need the pointless-looking anonymous function here)\n return structuredPatch.map(function (patch) { return reversePatch(patch); }).reverse();\n }\n return __assign(__assign({}, structuredPatch), { oldFileName: structuredPatch.newFileName, oldHeader: structuredPatch.newHeader, newFileName: structuredPatch.oldFileName, newHeader: structuredPatch.oldHeader, hunks: structuredPatch.hunks.map(function (hunk) {\n return {\n oldLines: hunk.newLines,\n oldStart: hunk.newStart,\n newLines: hunk.oldLines,\n newStart: hunk.oldStart,\n lines: hunk.lines.map(function (l) {\n if (l.startsWith('-')) {\n return \"+\".concat(l.slice(1));\n }\n if (l.startsWith('+')) {\n return \"-\".concat(l.slice(1));\n }\n return l;\n })\n };\n }) });\n}\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OMIT_HEADERS = exports.FILE_HEADERS_ONLY = exports.INCLUDE_HEADERS = void 0;\nexports.structuredPatch = structuredPatch;\nexports.formatPatch = formatPatch;\nexports.createTwoFilesPatch = createTwoFilesPatch;\nexports.createPatch = createPatch;\nvar line_js_1 = require(\"../diff/line.js\");\nexports.INCLUDE_HEADERS = {\n includeIndex: true,\n includeUnderline: true,\n includeFileHeaders: true\n};\nexports.FILE_HEADERS_ONLY = {\n includeIndex: false,\n includeUnderline: false,\n includeFileHeaders: true\n};\nexports.OMIT_HEADERS = {\n includeIndex: false,\n includeUnderline: false,\n includeFileHeaders: false\n};\nfunction structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {\n var optionsObj;\n if (!options) {\n optionsObj = {};\n }\n else if (typeof options === 'function') {\n optionsObj = { callback: options };\n }\n else {\n optionsObj = options;\n }\n if (typeof optionsObj.context === 'undefined') {\n optionsObj.context = 4;\n }\n // We copy this into its own variable to placate TypeScript, which thinks\n // optionsObj.context might be undefined in the callbacks below.\n var context = optionsObj.context;\n // @ts-expect-error (runtime check for something that is correctly a static type error)\n if (optionsObj.newlineIsToken) {\n throw new Error('newlineIsToken may not be used with patch-generation functions, only with diffing functions');\n }\n if (!optionsObj.callback) {\n return diffLinesResultToPatch((0, line_js_1.diffLines)(oldStr, newStr, optionsObj));\n }\n else {\n var callback_1 = optionsObj.callback;\n (0, line_js_1.diffLines)(oldStr, newStr, __assign(__assign({}, optionsObj), { callback: function (diff) {\n var patch = diffLinesResultToPatch(diff);\n // TypeScript is unhappy without the cast because it does not understand that `patch` may\n // be undefined here only if `callback` is StructuredPatchCallbackAbortable:\n callback_1(patch);\n } }));\n }\n function diffLinesResultToPatch(diff) {\n // STEP 1: Build up the patch with no \"\\" lines and with the arrays\n // of lines containing trailing newline characters. We'll tidy up later...\n if (!diff) {\n return;\n }\n diff.push({ value: '', lines: [] }); // Append an empty value to make cleanup easier\n function contextLines(lines) {\n return lines.map(function (entry) { return ' ' + entry; });\n }\n var hunks = [];\n var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1;\n for (var i = 0; i < diff.length; i++) {\n var current = diff[i], lines = current.lines || splitLines(current.value);\n current.lines = lines;\n if (current.added || current.removed) {\n // If we have previous context, start with that\n if (!oldRangeStart) {\n var prev = diff[i - 1];\n oldRangeStart = oldLine;\n newRangeStart = newLine;\n if (prev) {\n curRange = context > 0 ? contextLines(prev.lines.slice(-context)) : [];\n oldRangeStart -= curRange.length;\n newRangeStart -= curRange.length;\n }\n }\n // Output our changes\n for (var _i = 0, lines_1 = lines; _i < lines_1.length; _i++) {\n var line = lines_1[_i];\n curRange.push((current.added ? '+' : '-') + line);\n }\n // Track the updated file position\n if (current.added) {\n newLine += lines.length;\n }\n else {\n oldLine += lines.length;\n }\n }\n else {\n // Identical context lines. Track line changes\n if (oldRangeStart) {\n // Close out any changes that have been output (or join overlapping)\n if (lines.length <= context * 2 && i < diff.length - 2) {\n // Overlapping\n for (var _a = 0, _b = contextLines(lines); _a < _b.length; _a++) {\n var line = _b[_a];\n curRange.push(line);\n }\n }\n else {\n // end the range and output\n var contextSize = Math.min(lines.length, context);\n for (var _c = 0, _d = contextLines(lines.slice(0, contextSize)); _c < _d.length; _c++) {\n var line = _d[_c];\n curRange.push(line);\n }\n var hunk = {\n oldStart: oldRangeStart,\n oldLines: (oldLine - oldRangeStart + contextSize),\n newStart: newRangeStart,\n newLines: (newLine - newRangeStart + contextSize),\n lines: curRange\n };\n hunks.push(hunk);\n oldRangeStart = 0;\n newRangeStart = 0;\n curRange = [];\n }\n }\n oldLine += lines.length;\n newLine += lines.length;\n }\n }\n // Step 2: eliminate the trailing `\\n` from each line of each hunk, and, where needed, add\n // \"\\".\n for (var _e = 0, hunks_1 = hunks; _e < hunks_1.length; _e++) {\n var hunk = hunks_1[_e];\n for (var i = 0; i < hunk.lines.length; i++) {\n if (hunk.lines[i].endsWith('\\n')) {\n hunk.lines[i] = hunk.lines[i].slice(0, -1);\n }\n else {\n hunk.lines.splice(i + 1, 0, '\\\');\n i++; // Skip the line we just added, then continue iterating\n }\n }\n }\n return {\n oldFileName: oldFileName, newFileName: newFileName,\n oldHeader: oldHeader, newHeader: newHeader,\n hunks: hunks\n };\n }\n}\n/**\n * creates a unified diff patch.\n * @param patch either a single structured patch object (as returned by `structuredPatch`) or an array of them (as returned by `parsePatch`)\n */\nfunction formatPatch(patch, headerOptions) {\n if (!headerOptions) {\n headerOptions = exports.INCLUDE_HEADERS;\n }\n if (Array.isArray(patch)) {\n if (patch.length > 1 && !headerOptions.includeFileHeaders) {\n throw new Error('Cannot omit file headers on a multi-file patch. '\n + '(The result would be unparseable; how would a tool trying to apply '\n + 'the patch know which changes are to which file?)');\n }\n return patch.map(function (p) { return formatPatch(p, headerOptions); }).join('\\n');\n }\n var ret = [];\n if (headerOptions.includeIndex && patch.oldFileName == patch.newFileName) {\n ret.push('Index: ' + patch.oldFileName);\n }\n if (headerOptions.includeUnderline) {\n ret.push('===================================================================');\n }\n if (headerOptions.includeFileHeaders) {\n ret.push('--- ' + patch.oldFileName + (typeof patch.oldHeader === 'undefined' ? '' : '\\t' + patch.oldHeader));\n ret.push('+++ ' + patch.newFileName + (typeof patch.newHeader === 'undefined' ? '' : '\\t' + patch.newHeader));\n }\n for (var i = 0; i < patch.hunks.length; i++) {\n var hunk = patch.hunks[i];\n // Unified Diff Format quirk: If the chunk size is 0,\n // the first number is one lower than one would expect.\n // https://www.artima.com/weblogs/viewpost.jsp?thread=164293\n if (hunk.oldLines === 0) {\n hunk.oldStart -= 1;\n }\n if (hunk.newLines === 0) {\n hunk.newStart -= 1;\n }\n ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines\n + ' +' + hunk.newStart + ',' + hunk.newLines\n + ' @@');\n for (var _i = 0, _a = hunk.lines; _i < _a.length; _i++) {\n var line = _a[_i];\n ret.push(line);\n }\n }\n return ret.join('\\n') + '\\n';\n}\nfunction createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {\n if (typeof options === 'function') {\n options = { callback: options };\n }\n if (!(options === null || options === void 0 ? void 0 : options.callback)) {\n var patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options);\n if (!patchObj) {\n return;\n }\n return formatPatch(patchObj, options === null || options === void 0 ? void 0 : options.headerOptions);\n }\n else {\n var callback_2 = options.callback;\n structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, __assign(__assign({}, options), { callback: function (patchObj) {\n if (!patchObj) {\n callback_2(undefined);\n }\n else {\n callback_2(formatPatch(patchObj, options.headerOptions));\n }\n } }));\n }\n}\nfunction createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {\n return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);\n}\n/**\n * Split `text` into an array of lines, including the trailing newline character (where present)\n */\nfunction splitLines(text) {\n var hasTrailingNl = text.endsWith('\\n');\n var result = text.split('\\n').map(function (line) { return line + '\\n'; });\n if (hasTrailingNl) {\n result.pop();\n }\n else {\n result.push(result.pop().slice(0, -1));\n }\n return result;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.convertChangesToDMP = convertChangesToDMP;\n/**\n * converts a list of change objects to the format returned by Google's [diff-match-patch](https://github.com/google/diff-match-patch) library\n */\nfunction convertChangesToDMP(changes) {\n var ret = [];\n var change, operation;\n for (var i = 0; i < changes.length; i++) {\n change = changes[i];\n if (change.added) {\n operation = 1;\n }\n else if (change.removed) {\n operation = -1;\n }\n else {\n operation = 0;\n }\n ret.push([operation, change.value]);\n }\n return ret;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.convertChangesToXML = convertChangesToXML;\n/**\n * converts a list of change objects to a serialized XML format\n */\nfunction convertChangesToXML(changes) {\n var ret = [];\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n if (change.added) {\n ret.push('<ins>');\n }\n else if (change.removed) {\n ret.push('<del>');\n }\n ret.push(escapeHTML(change.value));\n if (change.added) {\n ret.push('</ins>');\n }\n else if (change.removed) {\n ret.push('</del>');\n }\n }\n return ret.join('');\n}\nfunction escapeHTML(s) {\n var n = s;\n n = n.replace(/&/g, '&amp;');\n n = n.replace(/</g, '&lt;');\n n = n.replace(/>/g, '&gt;');\n n = n.replace(/\"/g, '&quot;');\n return n;\n}\n","\"use strict\";\n/* See LICENSE file for terms of use */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.canonicalize = exports.convertChangesToXML = exports.convertChangesToDMP = exports.reversePatch = exports.parsePatch = exports.applyPatches = exports.applyPatch = exports.OMIT_HEADERS = exports.FILE_HEADERS_ONLY = exports.INCLUDE_HEADERS = exports.formatPatch = exports.createPatch = exports.createTwoFilesPatch = exports.structuredPatch = exports.arrayDiff = exports.diffArrays = exports.jsonDiff = exports.diffJson = exports.cssDiff = exports.diffCss = exports.sentenceDiff = exports.diffSentences = exports.diffTrimmedLines = exports.lineDiff = exports.diffLines = exports.wordsWithSpaceDiff = exports.diffWordsWithSpace = exports.wordDiff = exports.diffWords = exports.characterDiff = exports.diffChars = exports.Diff = void 0;\n/*\n * Text diff implementation.\n *\n * This library supports the following APIs:\n * Diff.diffChars: Character by character diff\n * Diff.diffWords: Word (as defined by \\b regex) diff which ignores whitespace\n * Diff.diffLines: Line based diff\n *\n * Diff.diffCss: Diff targeted at CSS content\n *\n * These methods are based on the implementation proposed in\n * \"An O(ND) Difference Algorithm and its Variations\" (Myers, 1986).\n * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927\n */\nvar base_js_1 = require(\"./diff/base.js\");\nexports.Diff = base_js_1.default;\nvar character_js_1 = require(\"./diff/character.js\");\nObject.defineProperty(exports, \"diffChars\", { enumerable: true, get: function () { return character_js_1.diffChars; } });\nObject.defineProperty(exports, \"characterDiff\", { enumerable: true, get: function () { return character_js_1.characterDiff; } });\nvar word_js_1 = require(\"./diff/word.js\");\nObject.defineProperty(exports, \"diffWords\", { enumerable: true, get: function () { return word_js_1.diffWords; } });\nObject.defineProperty(exports, \"diffWordsWithSpace\", { enumerable: true, get: function () { return word_js_1.diffWordsWithSpace; } });\nObject.defineProperty(exports, \"wordDiff\", { enumerable: true, get: function () { return word_js_1.wordDiff; } });\nObject.defineProperty(exports, \"wordsWithSpaceDiff\", { enumerable: true, get: function () { return word_js_1.wordsWithSpaceDiff; } });\nvar line_js_1 = require(\"./diff/line.js\");\nObject.defineProperty(exports, \"diffLines\", { enumerable: true, get: function () { return line_js_1.diffLines; } });\nObject.defineProperty(exports, \"diffTrimmedLines\", { enumerable: true, get: function () { return line_js_1.diffTrimmedLines; } });\nObject.defineProperty(exports, \"lineDiff\", { enumerable: true, get: function () { return line_js_1.lineDiff; } });\nvar sentence_js_1 = require(\"./diff/sentence.js\");\nObject.defineProperty(exports, \"diffSentences\", { enumerable: true, get: function () { return sentence_js_1.diffSentences; } });\nObject.defineProperty(exports, \"sentenceDiff\", { enumerable: true, get: function () { return sentence_js_1.sentenceDiff; } });\nvar css_js_1 = require(\"./diff/css.js\");\nObject.defineProperty(exports, \"diffCss\", { enumerable: true, get: function () { return css_js_1.diffCss; } });\nObject.defineProperty(exports, \"cssDiff\", { enumerable: true, get: function () { return css_js_1.cssDiff; } });\nvar json_js_1 = require(\"./diff/json.js\");\nObject.defineProperty(exports, \"diffJson\", { enumerable: true, get: function () { return json_js_1.diffJson; } });\nObject.defineProperty(exports, \"canonicalize\", { enumerable: true, get: function () { return json_js_1.canonicalize; } });\nObject.defineProperty(exports, \"jsonDiff\", { enumerable: true, get: function () { return json_js_1.jsonDiff; } });\nvar array_js_1 = require(\"./diff/array.js\");\nObject.defineProperty(exports, \"diffArrays\", { enumerable: true, get: function () { return array_js_1.diffArrays; } });\nObject.defineProperty(exports, \"arrayDiff\", { enumerable: true, get: function () { return array_js_1.arrayDiff; } });\nvar apply_js_1 = require(\"./patch/apply.js\");\nObject.defineProperty(exports, \"applyPatch\", { enumerable: true, get: function () { return apply_js_1.applyPatch; } });\nObject.defineProperty(exports, \"applyPatches\", { enumerable: true, get: function () { return apply_js_1.applyPatches; } });\nvar parse_js_1 = require(\"./patch/parse.js\");\nObject.defineProperty(exports, \"parsePatch\", { enumerable: true, get: function () { return parse_js_1.parsePatch; } });\nvar reverse_js_1 = require(\"./patch/reverse.js\");\nObject.defineProperty(exports, \"reversePatch\", { enumerable: true, get: function () { return reverse_js_1.reversePatch; } });\nvar create_js_1 = require(\"./patch/create.js\");\nObject.defineProperty(exports, \"structuredPatch\", { enumerable: true, get: function () { return create_js_1.structuredPatch; } });\nObject.defineProperty(exports, \"createTwoFilesPatch\", { enumerable: true, get: function () { return create_js_1.createTwoFilesPatch; } });\nObject.defineProperty(exports, \"createPatch\", { enumerable: true, get: function () { return create_js_1.createPatch; } });\nObject.defineProperty(exports, \"formatPatch\", { enumerable: true, get: function () { return create_js_1.formatPatch; } });\nObject.defineProperty(exports, \"INCLUDE_HEADERS\", { enumerable: true, get: function () { return create_js_1.INCLUDE_HEADERS; } });\nObject.defineProperty(exports, \"FILE_HEADERS_ONLY\", { enumerable: true, get: function () { return create_js_1.FILE_HEADERS_ONLY; } });\nObject.defineProperty(exports, \"OMIT_HEADERS\", { enumerable: true, get: function () { return create_js_1.OMIT_HEADERS; } });\nvar dmp_js_1 = require(\"./convert/dmp.js\");\nObject.defineProperty(exports, \"convertChangesToDMP\", { enumerable: true, get: function () { return dmp_js_1.convertChangesToDMP; } });\nvar xml_js_1 = require(\"./convert/xml.js\");\nObject.defineProperty(exports, \"convertChangesToXML\", { enumerable: true, get: function () { return xml_js_1.convertChangesToXML; } });\n","// Native dependency patching helpers shared across build-ideal-tree and reify.\n// Patches are plain unified diffs (git apply-compatible) applied with jsdiff using a fuzz factor of 0 so that any context drift fails loudly.\nconst { applyPatch, parsePatch } = require('diff')\nconst ssri = require('ssri')\nconst fs = require('node:fs')\nconst { promises: fsp } = fs\nconst { resolve, relative, dirname, isAbsolute } = require('node:path')\n\n// Compute the SSRI integrity of a patch file's contents.\n// Accepts a string or Buffer and returns a sha512 SSRI string.\nconst patchIntegrity = data =>\n ssri.fromData(Buffer.isBuffer(data) ? data : Buffer.from(data, 'utf8'), {\n algorithms: ['sha512'],\n }).toString()\n\n// Strip a leading git-style \"a/\" or \"b/\" prefix from a diff path.\nconst stripPrefix = file => file.replace(/^[ab]\\//, '')\n\n// True when a diff path points at /dev/null, signalling a file add or delete.\nconst isDevNull = file => !file || file === '/dev/null' || /(^|\\/)\\.dev\\/null$/.test(file)\n\nconst patchError = (message, code, file) =>\n Object.assign(new Error(message), { code, file })\n\n// Resolve a diff path under cwd and refuse anything that escapes the package directory.\nconst containedTarget = (cwd, file) => {\n const target = resolve(cwd, file)\n const rel = relative(cwd, target)\n if (!rel || rel.startsWith('..') || isAbsolute(rel)) {\n throw patchError(`patch path escapes the package directory: ${file}`, 'EPATCHUNSAFE', file)\n }\n return target\n}\n\n// Run a parsed file patch against a source string with fuzz 0.\n// Returns the patched text, or throws EPATCHFAILED on any context mismatch.\nconst strictApply = (source, filePatch, file) => {\n const patched = applyPatch(source, filePatch, { fuzzFactor: 0 })\n if (patched === false) {\n throw patchError(`patch could not be applied to ${file}`, 'EPATCHFAILED', file)\n }\n return patched\n}\n\n// Apply a single parsed file patch under cwd.\n// Handles modified, added (--- /dev/null) and deleted (+++ /dev/null) files.\nconst applyFilePatch = async (filePatch, cwd) => {\n const isAdd = isDevNull(filePatch.oldFileName)\n const isDelete = isDevNull(filePatch.newFileName)\n\n if (isDelete) {\n const file = stripPrefix(filePatch.oldFileName)\n const target = containedTarget(cwd, file)\n // verify the file still matches the diff before removing it\n const source = await fsp.readFile(target, 'utf8').catch(() => {\n throw patchError(`patch target to delete is missing: ${file}`, 'EPATCHFAILED', file)\n })\n strictApply(source, filePatch, file)\n await fsp.rm(target, { force: true })\n return\n }\n\n const file = stripPrefix(filePatch.newFileName)\n const target = containedTarget(cwd, file)\n\n if (isAdd) {\n // a new file must not already exist, otherwise the tarball drifted\n if (fs.existsSync(target)) {\n throw patchError(`patch adds a file that already exists: ${file}`, 'EPATCHFAILED', file)\n }\n const created = strictApply('', filePatch, file)\n await fsp.mkdir(dirname(target), { recursive: true })\n await fsp.writeFile(target, created)\n return\n }\n\n const source = await fsp.readFile(target, 'utf8').catch(() => {\n throw patchError(`patch target is missing: ${file}`, 'EPATCHFAILED', file)\n })\n const mode = (await fsp.stat(target)).mode\n const patched = strictApply(source, filePatch, file)\n await fsp.writeFile(target, patched)\n await fsp.chmod(target, mode)\n}\n\n// Apply a unified diff to the package extracted at `cwd`.\n// `patch` is the raw diff contents (string or Buffer).\n// Throws with code EPATCHFAILED on any hunk or file that cannot be applied.\nconst applyPatchToDir = async ({ patch, cwd }) => {\n const filePatches = parsePatch(patch.toString('utf8'))\n for (const filePatch of filePatches) {\n // jsdiff emits an empty trailing patch for some inputs; skip those.\n if (!filePatch.hunks.length && isDevNull(filePatch.oldFileName) && isDevNull(filePatch.newFileName)) {\n continue\n }\n try {\n await applyFilePatch(filePatch, cwd)\n } catch (er) {\n // re-code raw filesystem errors so a patch failure is never mistaken for an optional-install skip\n if (typeof er?.code === 'string' && er.code.startsWith('EPATCH')) {\n throw er\n }\n throw Object.assign(new Error(`failed to apply patch: ${er.message}`), { code: 'EPATCHFAILED', cause: er })\n }\n }\n}\n\nmodule.exports = {\n applyPatchToDir,\n patchIntegrity,\n}\n","// Resolve the root patchedDependencies map against an ideal tree.\n// Attaches node.patched = { path, integrity } to each matched node.\n// Enforces the failure modes (workspace-member entry, missing file, unused patch, non-registry target, ambiguous selectors) as hard errors.\nconst semver = require('semver')\nconst npa = require('npm-package-arg')\nconst { log } = require('proc-log')\nconst { resolve, relative, isAbsolute } = require('node:path')\nconst { readFile } = require('node:fs/promises')\nconst { patchIntegrity } = require('./patch.js')\n\n// Split a selector key into { name, spec }. spec is null for a name-only key.\nconst parseSelector = key => {\n const at = key.indexOf('@', 1)\n return at === -1\n ? { name: key, spec: null }\n : { name: key.slice(0, at), spec: key.slice(at + 1) }\n}\n\nconst err = (message, code, extra = {}) =>\n Object.assign(new Error(message), { code, ...extra })\n\n// Pick the most specific range among several that all match a version.\n// Returns the strict subset, or throws when ordering is ambiguous.\n// semver.subset is transitive, so the running minimum is a subset of every range it did not throw on.\nconst pickRange = (ranges, name, version) => {\n let best = ranges[0]\n for (const r of ranges.slice(1)) {\n if (semver.subset(r.spec, best.spec, { loose: true })) {\n best = r\n } else if (!semver.subset(best.spec, r.spec, { loose: true })) {\n throw err(\n `Ambiguous patch selectors for ${name}@${version}: ` +\n `\"${name}@${best.spec}\" and \"${name}@${r.spec}\" overlap but neither ` +\n `is a subset. Add an exact \"${name}@${version}\" entry to disambiguate.`,\n 'EPATCHAMBIGUOUS'\n )\n }\n }\n return best\n}\n\n// Choose the winning selector for a node: exact > range subset > name-only.\nconst matchSelector = (selectors, node) => {\n const { name, version } = node\n const matches = selectors.filter(s => s.name === name)\n if (!matches.length) {\n return null\n }\n\n const exact = matches.find(s =>\n s.spec && semver.valid(s.spec) && semver.eq(s.spec, version, { loose: true }))\n if (exact) {\n return exact\n }\n\n const ranges = matches.filter(s =>\n s.spec && !semver.valid(s.spec) && semver.satisfies(version, s.spec, { loose: true }))\n if (ranges.length) {\n return pickRange(ranges, name, version)\n }\n\n return matches.find(s => s.spec === null) || null\n}\n\nconst resolvePatchedDependencies = async (tree, { path, allowUnusedPatches, rm }) => {\n const patchedDependencies = tree.package?.patchedDependencies || {}\n const selectors = Object.entries(patchedDependencies)\n .map(([key, patchPath]) => ({ ...parseSelector(key), key, patchPath }))\n\n // cache patch file integrity by path so shared diffs are read once\n const integrityCache = new Map()\n const readPatch = async patchPath => {\n if (integrityCache.has(patchPath)) {\n return integrityCache.get(patchPath)\n }\n // patch files must live inside the project so the patch set stays auditable\n const abs = resolve(path, patchPath)\n const rel = relative(path, abs)\n if (!rel || rel.startsWith('..') || isAbsolute(rel)) {\n throw err(`patch path escapes the project: ${patchPath}`, 'EPATCHUNSAFE', { path: patchPath })\n }\n let contents\n try {\n contents = await readFile(abs)\n } catch {\n throw err(`patch file not found: ${patchPath}`, 'EPATCHNOTFOUND', { path: patchPath })\n }\n const integrity = patchIntegrity(contents)\n integrityCache.set(patchPath, integrity)\n return integrity\n }\n\n const usedKeys = new Set()\n for (const node of tree.inventory.values()) {\n // patchedDependencies is honoured only in the root manifest\n if (node.isWorkspace) {\n // Link.package already delegates to its target's package\n const pkg = node.package\n if (pkg?.patchedDependencies && Object.keys(pkg.patchedDependencies).length) {\n throw err(\n `patchedDependencies is only supported in the root package.json, ` +\n `but was found in workspace \"${node.name}\". Move the entry to the root.`,\n 'EPATCHWORKSPACE',\n { workspace: node.name }\n )\n }\n continue\n }\n if (node.isProjectRoot) {\n continue\n }\n\n const selector = matchSelector(selectors, node)\n if (!selector) {\n // a node that was patched but no longer matches a selector must be re-extracted to revert its files\n if (node.patched) {\n node.patchRemoved = true\n }\n node.patched = null\n continue\n }\n\n // a non-registry consumer edge (file:, git:, http(s)) means there is no registry tarball to patch; npm: aliases stay registry.\n // checking edges (not isRegistryDependency) avoids rejecting an edgeless node, which is still a registry dep.\n if ([...node.edgesIn].some(e => e.spec && !npa(e.spec).registry)) {\n throw err(\n `Cannot patch non-registry dependency ${node.name}@${node.version} ` +\n `(selector \"${selector.key}\"). Only registry dependencies can be patched.`,\n 'EPATCHNONREGISTRY',\n { node: node.name }\n )\n }\n\n const integrity = await readPatch(selector.patchPath)\n node.patched = { path: selector.patchPath, integrity }\n usedKeys.add(selector.key)\n }\n\n if (selectors.length) {\n const unused = selectors.filter(s => !usedKeys.has(s.key))\n\n // an explicit `npm uninstall <name>` orphans that package's patch entry, so drop it instead of failing\n const removed = new Set(rm)\n const dropped = unused.filter(s => removed.has(s.name))\n if (dropped.length) {\n const patched = { ...tree.package.patchedDependencies }\n for (const s of dropped) {\n delete patched[s.key]\n log.notice('patch', `Removing patch entry \"${s.key}\" for uninstalled ${s.name}; left ${s.patchPath} in place.`)\n }\n // undefined drops the key entirely when reify writes package.json\n tree.package.patchedDependencies = Object.keys(patched).length ? patched : undefined\n }\n\n const stillUnused = unused.filter(s => !removed.has(s.name))\n if (stillUnused.length && !allowUnusedPatches) {\n throw err(\n `The following patches were registered but matched no installed ` +\n `package:\\n${stillUnused.map(s => ` ${s.key} -> ${s.patchPath}`).join('\\n')}\\n` +\n `Use --allow-unused-patches to install anyway.`,\n 'EPATCHUNUSED',\n { unused: stillUnused.map(s => s.key) }\n )\n }\n }\n}\n\nmodule.exports = { resolvePatchedDependencies, matchSelector, parseSelector }\n","","'use strict'\nconst builtins = require('./builtin-modules.json')\n\nvar scopedPackagePattern = new RegExp('^(?:@([^/]+?)[/])?([^/]+?)$')\nvar exclusionList = [\n 'node_modules',\n 'favicon.ico',\n]\n\nfunction validate (name) {\n var warnings = []\n var errors = []\n\n if (name === null) {\n errors.push('name cannot be null')\n return done(warnings, errors)\n }\n\n if (name === undefined) {\n errors.push('name cannot be undefined')\n return done(warnings, errors)\n }\n\n if (typeof name !== 'string') {\n errors.push('name must be a string')\n return done(warnings, errors)\n }\n\n if (!name.length) {\n errors.push('name length must be greater than zero')\n }\n\n if (name.startsWith('.')) {\n errors.push('name cannot start with a period')\n }\n\n if (name.startsWith('-')) {\n errors.push('name cannot start with a hyphen')\n }\n\n if (name.match(/^_/)) {\n errors.push('name cannot start with an underscore')\n }\n\n if (name.trim() !== name) {\n errors.push('name cannot contain leading or trailing spaces')\n }\n\n // No funny business\n exclusionList.forEach(function (excludedName) {\n if (name.toLowerCase() === excludedName) {\n errors.push(excludedName + ' is not a valid package name')\n }\n })\n\n // Generate warnings for stuff that used to be allowed\n\n // core module names like http, events, util, etc\n if (builtins.includes(name.toLowerCase())) {\n warnings.push(name + ' is a core module name')\n }\n\n if (name.length > 214) {\n warnings.push('name can no longer contain more than 214 characters')\n }\n\n // mIxeD CaSe nAMEs\n if (name.toLowerCase() !== name) {\n warnings.push('name can no longer contain capital letters')\n }\n\n if (/[~'!()*]/.test(name.split('/').slice(-1)[0])) {\n warnings.push('name can no longer contain special characters (\"~\\'!()*\")')\n }\n\n if (encodeURIComponent(name) !== name) {\n // Maybe it's a scoped package name, like @user/package\n var nameMatch = name.match(scopedPackagePattern)\n if (nameMatch) {\n var user = nameMatch[1]\n var pkg = nameMatch[2]\n\n if (pkg.startsWith('.')) {\n errors.push('name cannot start with a period')\n }\n\n if (encodeURIComponent(user) === user && encodeURIComponent(pkg) === pkg) {\n return done(warnings, errors)\n }\n }\n\n errors.push('name can only contain URL-friendly characters')\n }\n\n return done(warnings, errors)\n}\n\nvar done = function (warnings, errors) {\n var result = {\n validForNewPackages: errors.length === 0 && warnings.length === 0,\n validForOldPackages: errors.length === 0,\n warnings: warnings,\n errors: errors,\n }\n if (!result.warnings.length) {\n delete result.warnings\n }\n if (!result.errors.length) {\n delete result.errors\n }\n return result\n}\n\nmodule.exports = validate\n","// Root-owned `packageExtensions`: declarative repairs to third-party manifests applied before Arborist reads a candidate's dependency edges.\n// See RFC: https://github.com/npm/rfcs/pull/889\n// This module is pure: it parses and validates the root rule set, matches a candidate manifest by name and version, and returns an extended manifest copy plus minimal provenance.\n// It never mutates the input manifest or any shared cache object.\nconst semver = require('semver')\nconst ssri = require('ssri')\nconst validateName = require('validate-npm-package-name')\n\n// The only manifest fields a package extension may add or correct, because they are the fields that affect dependency and peer resolution.\nconst EXTENSION_FIELDS = [\n 'dependencies',\n 'optionalDependencies',\n 'peerDependencies',\n 'peerDependenciesMeta',\n]\n\n// The two normal dependency fields; a name may exist in only one of them.\nconst NORMAL_DEP_FIELDS = ['dependencies', 'optionalDependencies']\n\nconst err = (message, code, extra = {}) =>\n Object.assign(new Error(message), { code, ...extra })\n\n// Parse a selector key into { name, range }, where range is null for a name-only key.\n// Selectors are a package name with an optional semver range; dist-tags, git, file, directory, url, and alias specs are rejected.\nconst parseSelector = key => {\n if (typeof key !== 'string' || !key) {\n throw err(`Invalid packageExtensions selector: ${JSON.stringify(key)}`, 'EEXTENSIONSELECTOR')\n }\n // The separator @ is the first @ after a leading scope @.\n const at = key.indexOf('@', key.startsWith('@') ? 1 : 0)\n const name = at === -1 ? key : key.slice(0, at)\n const range = at === -1 ? null : key.slice(at + 1)\n\n const { validForOldPackages, validForNewPackages } = validateName(name)\n if (!validForOldPackages && !validForNewPackages) {\n throw err(`Invalid package name in packageExtensions selector: \"${key}\"`, 'EEXTENSIONSELECTOR', { selector: key })\n }\n // A blank range such as \"foo@\" is malformed; the name-only form \"foo\" is how you match every version.\n if (range !== null && range.trim() === '') {\n throw err(\n `Invalid packageExtensions selector: \"${key}\". Use the name only to match every version.`,\n 'EEXTENSIONSELECTOR', { selector: key })\n }\n // A versioned selector must be a valid semver range, which rejects dist-tags, git, file, url, and alias specs.\n if (range !== null && semver.validRange(range, { loose: true }) === null) {\n throw err(\n `Invalid version range in packageExtensions selector: \"${key}\". Selectors accept a package name with an optional semver range only.`,\n 'EEXTENSIONSELECTOR', { selector: key })\n }\n return { name, range }\n}\n\n// A selector matches a candidate manifest by its own name and version.\n// Name-only selectors match every version, including non-semver versions.\n// Versioned selectors only match versions that parse as semver and satisfy the range.\nconst rangeMatches = (range, version) => {\n if (range === null) {\n return true\n }\n return semver.valid(version, { loose: true }) !== null &&\n semver.satisfies(version, range, { loose: true })\n}\n\n// Validate a single selector's extension object before it is ever applied.\nconst validateExtensionObject = (key, ext) => {\n if (ext === null || typeof ext !== 'object' || Array.isArray(ext)) {\n throw err(`packageExtensions[\"${key}\"] must be an object`, 'EEXTENSIONVALUE', { selector: key })\n }\n for (const field of Object.keys(ext)) {\n if (!EXTENSION_FIELDS.includes(field)) {\n throw err(\n `packageExtensions[\"${key}\"] has unsupported field \"${field}\". Supported fields: ${EXTENSION_FIELDS.join(', ')}.`,\n 'EEXTENSIONFIELD', { selector: key, field })\n }\n const val = ext[field]\n if (val === null || typeof val !== 'object' || Array.isArray(val)) {\n throw err(`packageExtensions[\"${key}\"].${field} must be an object`, 'EEXTENSIONVALUE', { selector: key, field })\n }\n }\n // Deletion is not supported in v1, so a null, false, or \"-\" value is an error.\n for (const field of [...NORMAL_DEP_FIELDS, 'peerDependencies']) {\n for (const [name, spec] of Object.entries(ext[field] || {})) {\n if (spec === null || spec === false || spec === '-') {\n throw err(\n `packageExtensions[\"${key}\"].${field}.${name} attempts deletion, which is not supported.`,\n 'EEXTENSIONDELETE', { selector: key, field, name })\n }\n }\n }\n // Each peerDependenciesMeta entry must be a non-null metadata object, never a deletion sentinel or primitive.\n for (const [name, meta] of Object.entries(ext.peerDependenciesMeta || {})) {\n if (meta === null || typeof meta !== 'object' || Array.isArray(meta)) {\n throw err(\n `packageExtensions[\"${key}\"].peerDependenciesMeta.${name} must be an object`,\n 'EEXTENSIONVALUE', { selector: key, field: 'peerDependenciesMeta', name })\n }\n }\n}\n\n// Apply a matched extension to a manifest, returning { pkg, applied } where pkg is a copy with extended fields and applied is minimal provenance.\n// The input manifest is never mutated.\nconst applyExtension = (pkg, { key, ext }) => {\n const applied = { selector: key }\n\n // Clone only the fields we may touch; the rest of the manifest is shared by reference since it is never mutated.\n const next = { ...pkg }\n for (const field of EXTENSION_FIELDS) {\n if (pkg[field] && typeof pkg[field] === 'object') {\n next[field] = field === 'peerDependenciesMeta'\n ? Object.fromEntries(Object.entries(pkg[field]).map(([n, m]) => [n, { ...m }]))\n : { ...pkg[field] }\n }\n }\n\n // dependencies and optionalDependencies add missing names only.\n // A name already declared in either normal dependency field is an error, which also prevents moving a name between the fields.\n for (const field of NORMAL_DEP_FIELDS) {\n const adds = ext[field]\n if (!adds) {\n continue\n }\n for (const [name, spec] of Object.entries(adds)) {\n for (const existingField of NORMAL_DEP_FIELDS) {\n if (next[existingField] && name in next[existingField]) {\n throw err(\n `packageExtensions[\"${key}\"].${field}.${name} conflicts with the package's existing ${existingField}.${name}. Use overrides to change a dependency version; packageExtensions only adds missing dependencies.`,\n 'EEXTENSIONDUPDEP', { selector: key, field, name, existingField })\n }\n }\n next[field] = next[field] || {}\n next[field][name] = spec\n ;(applied[field] = applied[field] || []).push(name)\n }\n }\n\n // peerDependencies shallow-merges by peer name, and the extension value replaces an existing range.\n if (ext.peerDependencies) {\n next.peerDependencies = next.peerDependencies || {}\n for (const [name, spec] of Object.entries(ext.peerDependencies)) {\n next.peerDependencies[name] = spec\n ;(applied.peerDependencies = applied.peerDependencies || []).push(name)\n }\n }\n\n // peerDependenciesMeta merges by peer name, then shallow-merges each meta object so an extension can add optional without dropping other meta keys.\n if (ext.peerDependenciesMeta) {\n next.peerDependenciesMeta = next.peerDependenciesMeta || {}\n for (const [name, meta] of Object.entries(ext.peerDependenciesMeta)) {\n next.peerDependenciesMeta[name] = { ...next.peerDependenciesMeta[name], ...meta }\n ;(applied.peerDependenciesMeta = applied.peerDependenciesMeta || []).push(name)\n // Every peerDependenciesMeta entry an extension adds must correspond to a peerDependencies entry present after extension application.\n if (!next.peerDependencies || !(name in next.peerDependencies)) {\n throw err(\n `packageExtensions[\"${key}\"].peerDependenciesMeta.${name} has no corresponding peerDependencies.${name} after extension application.`,\n 'EEXTENSIONORPHANMETA', { selector: key, name })\n }\n }\n }\n\n return { pkg: next, applied }\n}\n\n// Deterministic JSON for hashing: keys sorted lexicographically at every level, string and number values preserved exactly, no insignificant whitespace.\nconst canonicalStringify = val => {\n if (Array.isArray(val)) {\n return `[${val.map(canonicalStringify).join(',')}]`\n }\n if (val && typeof val === 'object') {\n return `{${Object.keys(val).sort()\n .map(k => `${JSON.stringify(k)}:${canonicalStringify(val[k])}`)\n .join(',')}}`\n }\n return JSON.stringify(val)\n}\n\n// Hash the canonical form of the root packageExtensions object using npm's existing lockfile digest encoding.\nconst canonicalHash = packageExtensions =>\n ssri.fromData(canonicalStringify(packageExtensions), { algorithms: ['sha512'] }).toString()\n\nclass PackageExtensions {\n constructor (raw) {\n this.raw = raw\n this.present = raw !== undefined\n this.selectors = []\n this.hash = null\n\n if (!this.present) {\n return\n }\n if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) {\n throw err('packageExtensions must be an object', 'EEXTENSIONROOT')\n }\n for (const [key, ext] of Object.entries(raw)) {\n const { name, range } = parseSelector(key)\n validateExtensionObject(key, ext)\n this.selectors.push({ key, name, range, ext })\n }\n this.hash = canonicalHash(raw)\n }\n\n // Non-throwing check used for warnings: whether any selector matches the candidate.\n wouldMatch (name, version) {\n return this.selectors.some(s => s.name === name && rangeMatches(s.range, version))\n }\n\n // Return the single selector matching a candidate manifest, or null.\n // Throws EEXTENSIONCONFLICT when more than one selector matches the same candidate.\n match (name, version) {\n const matches = this.selectors.filter(s => s.name === name && rangeMatches(s.range, version))\n if (matches.length > 1) {\n const keys = matches.map(s => `\"${s.key}\"`).join(', ')\n throw err(\n `Multiple packageExtensions selectors match ${name}@${version}: ${keys}. Narrow or remove one of the overlapping rules.`,\n 'EEXTENSIONCONFLICT', { name, version, selectors: matches.map(s => s.key) })\n }\n return matches[0] || null\n }\n\n // Apply the matching extension to a manifest copy, returning { pkg, applied } or null when no selector matches.\n // Throws on selector conflict or invalid merge.\n apply (pkg) {\n if (!this.present || !this.selectors.length || !pkg || !pkg.name) {\n return null\n }\n const sel = this.match(pkg.name, pkg.version)\n return sel ? applyExtension(pkg, sel) : null\n }\n}\n\nmodule.exports = PackageExtensions\nmodule.exports.PackageExtensions = PackageExtensions\nmodule.exports.parseSelector = parseSelector\nmodule.exports.rangeMatches = rangeMatches\nmodule.exports.canonicalHash = canonicalHash\nmodule.exports.canonicalStringify = canonicalStringify\nmodule.exports.EXTENSION_FIELDS = EXTENSION_FIELDS\n","// Root-owned `.npm-extension.{mjs,cjs}`: an imperative `transformManifest(pkg, context)` extension point that repairs third-party manifests before Arborist reads a candidate's dependency edges.\n// See RFC: https://github.com/npm/rfcs/pull/903\n// This module discovers and hashes the root extension file, loads its `transformManifest` export, and applies it to a deeply isolated manifest copy, returning an extended manifest plus minimal provenance.\n// It never mutates the input manifest or any shared cache object.\nconst { resolve, sep } = require('node:path')\nconst { readFileSync, existsSync } = require('node:fs')\nconst { pathToFileURL } = require('node:url')\nconst { isDeepStrictEqual } = require('node:util')\nconst { log } = require('proc-log')\nconst ssri = require('ssri')\nconst { EXTENSION_FIELDS } = require('./package-extensions.js')\n\nconst EXTENSION_POINT = 'transformManifest'\n\n// The two supported module formats and their default discovery filenames.\nconst FORMATS = [\n { ext: 'mjs', file: '.npm-extension.mjs' },\n { ext: 'cjs', file: '.npm-extension.cjs' },\n]\n\nconst err = (message, code, extra = {}) =>\n Object.assign(new Error(message), { code, ...extra })\n\n// Read a file's bytes, or null when it does not exist.\nconst readBytes = path => {\n try {\n return readFileSync(path)\n } catch (e) {\n if (e.code === 'ENOENT') {\n return null\n }\n throw e\n }\n}\n\n// Resolve which extension file to load, returning { path, format, bytes } or null when none is present.\n// A configured `extension-file` wins over default discovery; it must resolve inside the project root and use a `.mjs` or `.cjs` extension.\n// When both default files exist npm fails rather than choosing one implicitly.\nconst discover = (root, extensionFile) => {\n if (extensionFile) {\n const path = resolve(root, extensionFile)\n if (path !== root && !path.startsWith(root + sep)) {\n throw err(`extension-file \"${extensionFile}\" must resolve inside the project root`, 'ENPMEXTENSIONPATH')\n }\n const format = FORMATS.find(f => path.endsWith(`.${f.ext}`))?.ext\n if (!format) {\n throw err(`extension-file \"${extensionFile}\" must use a .mjs or .cjs extension`, 'ENPMEXTENSIONPATH')\n }\n const bytes = readBytes(path)\n if (bytes === null) {\n throw err(`extension-file \"${extensionFile}\" was not found`, 'ENPMEXTENSIONPATH')\n }\n return { path, format, bytes }\n }\n const found = FORMATS\n .map(f => ({ path: resolve(root, f.file), format: f.ext, bytes: readBytes(resolve(root, f.file)) }))\n .filter(f => f.bytes !== null)\n if (found.length > 1) {\n throw err('found both .npm-extension.mjs and .npm-extension.cjs; keep only one', 'ENPMEXTENSIONDUP')\n }\n return found[0] || null\n}\n\n// Hash the selected extension file: a format-tagged prefix plus the raw file bytes, using npm's lockfile digest encoding.\n// The prefix keeps `.mjs` and `.cjs` files with identical bytes distinct, and excludes any path so the digest is machine-independent.\nconst hashFile = (format, bytes) =>\n ssri.fromData(\n Buffer.concat([Buffer.from(`npm-extension:v1:${format}\\n`), bytes]),\n { algorithms: ['sha512'] }\n ).toString()\n\nclass NpmExtension {\n #cache = new Map()\n #transform = null\n\n constructor ({ root, extensionFile = null } = {}) {\n this.root = root\n this.path = null\n this.format = null\n this.hash = null\n\n const selected = root ? discover(root, extensionFile) : null\n if (!selected) {\n this.present = false\n return\n }\n this.present = true\n this.path = selected.path\n this.format = selected.format\n this.hash = hashFile(selected.format, selected.bytes)\n }\n\n // Import the extension module and capture its `transformManifest` export.\n // ESM files are loaded with dynamic import; CommonJS files with require.\n // The export must be a function; anything else fails the install.\n async load () {\n if (!this.present) {\n return\n }\n // Key the module load by the file hash so a changed file is reloaded rather than served stale from a module cache within one process.\n let mod\n if (this.format === 'mjs') {\n mod = await import(`${pathToFileURL(this.path).href}?h=${this.hash}`)\n } else {\n delete require.cache[require.resolve(this.path)]\n mod = require(this.path)\n }\n const transform = mod?.transformManifest ?? mod?.default?.transformManifest\n if (typeof transform !== 'function') {\n throw err(`.npm-extension must export a transformManifest function`, 'ENPMEXTENSIONSHAPE')\n }\n this.#transform = transform\n }\n\n // Apply transformManifest to a candidate manifest, returning { pkg, applied } or null when nothing changed.\n // Results are cached once per resolved package identity; consumers get a deeply isolated copy so they cannot mutate the cached effective manifest.\n // Pass { memoize: false } to run without caching, e.g. a staleness probe over partial lockfile manifests that must not seed the cache used by full-manifest fetches.\n apply (pkg, { memoize = true } = {}) {\n if (!this.#transform || !pkg?.name) {\n return null\n }\n const key = this.#identity(pkg)\n let result\n if (this.#cache.has(key)) {\n result = this.#cache.get(key)\n } else {\n result = this.#run(pkg)\n if (memoize) {\n this.#cache.set(key, result)\n }\n }\n return result && { pkg: structuredClone(result.pkg), applied: structuredClone(result.applied) }\n }\n\n // Identity key for the transform cache: package integrity when available, otherwise resolved source plus name and version.\n #identity (pkg) {\n return pkg._integrity || `${pkg._resolved || ''}:${pkg.name}@${pkg.version || ''}`\n }\n\n // Run transformManifest on a deeply isolated copy and validate the result.\n // Returns { pkg, applied } when dependency or peer metadata changed, or null when it did not.\n #run (pkg) {\n const context = {\n log: message => log.silly('npm-extension', message),\n root: this.root,\n extensionPoint: EXTENSION_POINT,\n }\n let returned\n try {\n returned = this.#transform(structuredClone(pkg), context)\n } catch (e) {\n throw err(\n `.npm-extension transformManifest threw while processing ${pkg.name}@${pkg.version}: ${e.message}`,\n 'ENPMEXTENSIONTHROW', { pkgid: `${pkg.name}@${pkg.version}` })\n }\n if (returned && typeof returned.then === 'function') {\n throw err(\n `.npm-extension transformManifest must return a manifest synchronously, not a promise, for ${pkg.name}@${pkg.version}`,\n 'ENPMEXTENSIONRETURN', { pkgid: `${pkg.name}@${pkg.version}` })\n }\n if (!returned || typeof returned !== 'object' || Array.isArray(returned)) {\n throw err(\n `.npm-extension transformManifest must return a manifest object for ${pkg.name}@${pkg.version}`,\n 'ENPMEXTENSIONRETURN', { pkgid: `${pkg.name}@${pkg.version}` })\n }\n // Only dependency and peer fields may change; any other field the returned manifest explicitly alters is rejected.\n // Fields the returned object omits are left untouched, so a handler may return a new object with only the fields it repairs.\n for (const k of Object.keys(returned)) {\n if (!EXTENSION_FIELDS.includes(k) && !isDeepStrictEqual(returned[k], pkg[k])) {\n throw err(\n `.npm-extension transformManifest changed unsupported field \"${k}\" on ${pkg.name}@${pkg.version}; only ${EXTENSION_FIELDS.join(', ')} may change`,\n 'ENPMEXTENSIONFIELD', { pkgid: `${pkg.name}@${pkg.version}`, field: k })\n }\n }\n // Build the effective manifest from the normalized baseline plus the returned allowlisted fields.\n // A field the handler omits is left as the baseline; delete individual entries by returning a field object without them.\n const next = { ...pkg }\n for (const field of EXTENSION_FIELDS) {\n if (returned[field] === undefined) {\n continue\n }\n this.#validateField(field, returned[field], pkg)\n next[field] = returned[field]\n }\n const applied = this.#provenance(pkg, next)\n return applied && { pkg: next, applied }\n }\n\n // Validate a returned allowlisted field and its entries, so invalid output fails with .npm-extension and package context.\n // Dependency maps hold version strings; peerDependenciesMeta holds metadata objects.\n #validateField (field, value, pkg) {\n const fail = (suffix) => err(\n `.npm-extension transformManifest set ${suffix} to an invalid value on ${pkg.name}@${pkg.version}`,\n 'ENPMEXTENSIONVALUE', { pkgid: `${pkg.name}@${pkg.version}`, field })\n if (value === null || typeof value !== 'object' || Array.isArray(value)) {\n throw fail(field)\n }\n for (const [name, entry] of Object.entries(value)) {\n if (field === 'peerDependenciesMeta') {\n if (entry === null || typeof entry !== 'object' || Array.isArray(entry)) {\n throw fail(`${field}.${name}`)\n }\n } else if (typeof entry !== 'string') {\n throw fail(`${field}.${name}`)\n }\n }\n }\n\n // Minimal provenance: the extension point plus, for each changed allowlisted field, a sorted array of affected dependency names.\n // Returns null when nothing changed.\n #provenance (before, after) {\n const applied = { extensionPoint: EXTENSION_POINT }\n let changed = false\n for (const field of EXTENSION_FIELDS) {\n const b = before[field] || {}\n const a = after[field] || {}\n const names = [...new Set([...Object.keys(b), ...Object.keys(a)])]\n .filter(n => !isDeepStrictEqual(b[n], a[n]))\n .sort()\n if (names.length) {\n applied[field] = names\n changed = true\n }\n }\n return changed ? applied : null\n }\n}\n\n// Whether a directory contains any default .npm-extension file; a non-throwing existence check used for non-root workspace warnings.\nconst hasExtensionFile = dir => FORMATS.some(f => existsSync(resolve(dir, f.file)))\n\nmodule.exports = NpmExtension\nmodule.exports.NpmExtension = NpmExtension\nmodule.exports.discover = discover\nmodule.exports.hasExtensionFile = hasExtensionFile\nmodule.exports.hashFile = hashFile\nmodule.exports.EXTENSION_POINT = EXTENSION_POINT\n","// parse a yarn lock file\n// basic format\n//\n// <request spec>[, <request spec> ...]:\n// <key> <value>\n// <subkey>:\n// <key> <value>\n//\n// Assume that any key or value might be quoted, though that's only done\n// in practice if certain chars are in the string. When writing back, we follow\n// Yarn's rules for quoting, to cause minimal friction.\n//\n// The data format would support nested objects, but at this time, it\n// appears that yarn does not use that for anything, so in the interest\n// of a simpler parser algorithm, this implementation only supports a\n// single layer of sub objects.\n//\n// This doesn't deterministically define the shape of the tree, and so\n// cannot be used (on its own) for Arborist.loadVirtual.\n// But it can give us resolved, integrity, and version, which is useful\n// for Arborist.loadActual and for building the ideal tree.\n//\n// At the very least, when a yarn.lock file is present, we update it\n// along the way, and save it back in Shrinkwrap.save()\n//\n// NIHing this rather than using @yarnpkg/lockfile because that module\n// is an impenetrable 10kloc of webpack flow output, which is overkill\n// for something relatively simple and tailored to Arborist's use case.\n\nconst localeCompare = require('@isaacs/string-locale-compare')('en')\nconst consistentResolve = require('./consistent-resolve.js')\nconst { dirname } = require('node:path')\nconst { breadth } = require('treeverse')\n\n// Sort Yarn entries respecting the yarn.lock sort order\nconst yarnEntryPriorities = {\n name: 1,\n version: 2,\n uid: 3,\n resolved: 4,\n integrity: 5,\n registry: 6,\n dependencies: 7,\n}\n\nconst priorityThenLocaleCompare = (a, b) => {\n if (!yarnEntryPriorities[a] && !yarnEntryPriorities[b]) {\n return localeCompare(a, b)\n }\n /* istanbul ignore next */\n return (yarnEntryPriorities[a] || 100) > (yarnEntryPriorities[b] || 100) ? 1 : -1\n}\n\nconst quoteIfNeeded = val => {\n if (\n typeof val === 'boolean' ||\n typeof val === 'number' ||\n val.startsWith('true') ||\n val.startsWith('false') ||\n /[:\\s\\n\\\\\",[\\]]/g.test(val) ||\n !/^[a-zA-Z]/g.test(val)\n ) {\n return JSON.stringify(val)\n }\n\n return val\n}\n\n// sort a key/value object into a string of JSON stringified keys and vals\nconst sortKV = obj => Object.keys(obj)\n .sort(localeCompare)\n .map(k => ` ${quoteIfNeeded(k)} ${quoteIfNeeded(obj[k])}`)\n .join('\\n')\n\n// for checking against previous entries\nconst match = (p, n) =>\n p.integrity && n.integrity ? p.integrity === n.integrity\n : p.resolved && n.resolved ? p.resolved === n.resolved\n : p.version && n.version ? p.version === n.version\n : true\n\nconst prefix =\n`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n# yarn lockfile v1\n\n\n`\n\nconst nullSymbol = Symbol('null')\nclass YarnLock {\n static parse (data) {\n return new YarnLock().parse(data)\n }\n\n static fromTree (tree) {\n return new YarnLock().fromTree(tree)\n }\n\n constructor () {\n this.entries = null\n this.endCurrent()\n }\n\n endCurrent () {\n this.current = null\n this.subkey = nullSymbol\n }\n\n parse (data) {\n const ENTRY_START = /^[^\\s].*:$/\n const SUBKEY = /^ {2}[^\\s]+:$/\n const SUBVAL = /^ {4}[^\\s]+ .+$/\n const METADATA = /^ {2}[^\\s]+ .+$/\n this.entries = new Map()\n this.current = null\n const linere = /([^\\r\\n]*)\\r?\\n/gm\n let match\n let lineNum = 0\n if (!/\\n$/.test(data)) {\n data += '\\n'\n }\n while (match = linere.exec(data)) {\n const line = match[1]\n lineNum++\n if (line.charAt(0) === '#') {\n continue\n }\n if (line === '') {\n this.endCurrent()\n continue\n }\n if (ENTRY_START.test(line)) {\n this.endCurrent()\n const specs = this.splitQuoted(line.slice(0, -1), /, */)\n this.current = new YarnLockEntry(specs)\n specs.forEach(spec => this.entries.set(spec, this.current))\n continue\n }\n if (SUBKEY.test(line)) {\n this.subkey = line.slice(2, -1)\n this.current[this.subkey] = {}\n continue\n }\n if (SUBVAL.test(line) && this.current && this.current[this.subkey]) {\n const subval = this.splitQuoted(line.trimLeft(), ' ')\n if (subval.length === 2) {\n this.current[this.subkey][subval[0]] = subval[1]\n continue\n }\n }\n // any other metadata\n if (METADATA.test(line) && this.current) {\n const metadata = this.splitQuoted(line.trimLeft(), ' ')\n if (metadata.length === 2) {\n // strip off the legacy shasum hashes\n if (metadata[0] === 'resolved') {\n metadata[1] = metadata[1].replace(/#.*/, '')\n }\n this.current[metadata[0]] = metadata[1]\n continue\n }\n }\n\n throw Object.assign(new Error('invalid or corrupted yarn.lock file'), {\n position: match.index,\n content: match[0],\n line: lineNum,\n })\n }\n this.endCurrent()\n return this\n }\n\n splitQuoted (str, delim) {\n // a,\"b,c\",d\"e,f => ['a','\"b','c\"','d\"e','f'] => ['a','b,c','d\"e','f']\n const split = str.split(delim)\n const out = []\n let o = 0\n for (let i = 0; i < split.length; i++) {\n const chunk = split[i]\n if (/^\".*\"$/.test(chunk)) {\n out[o++] = chunk.trim().slice(1, -1)\n } else if (/^\"/.test(chunk)) {\n let collect = chunk.trimLeft().slice(1)\n while (++i < split.length) {\n const n = split[i]\n // something that is not a slash, followed by an even number\n // of slashes then a \" then end => ending on an unescaped \"\n if (/[^\\\\](\\\\\\\\)*\"$/.test(n)) {\n collect += n.trimRight().slice(0, -1)\n break\n } else {\n collect += n\n }\n }\n out[o++] = collect\n } else {\n out[o++] = chunk.trim()\n }\n }\n return out\n }\n\n toString () {\n return prefix + [...new Set([...this.entries.values()])]\n .map(e => e.toString())\n .sort((a, b) => localeCompare(a.replace(/\"/g, ''), b.replace(/\"/g, ''))).join('\\n\\n') + '\\n'\n }\n\n fromTree (tree) {\n this.entries = new Map()\n // walk the tree in a deterministic order, breadth-first, alphabetical\n breadth({\n tree,\n visit: node => this.addEntryFromNode(node),\n getChildren: node => [...node.children.values(), ...node.fsChildren]\n .sort((a, b) => a.depth - b.depth || localeCompare(a.name, b.name)),\n })\n return this\n }\n\n addEntryFromNode (node) {\n const specs = [...node.edgesIn]\n .map(e => `${node.name}@${e.spec}`)\n .sort(localeCompare)\n\n // Note:\n // yarn will do excessive duplication in a case like this:\n // root -> (x@1.x, y@1.x, z@1.x)\n // y@1.x -> (x@1.1, z@2.x)\n // z@1.x -> ()\n // z@2.x -> (x@1.x)\n //\n // where x@1.2 exists, because the \"x@1.x\" spec will *always* resolve\n // to x@1.2, which doesn't work for y's dep on x@1.1, so you'll get this:\n //\n // root\n // +-- x@1.2.0\n // +-- y\n // | +-- x@1.1.0\n // | +-- z@2\n // | +-- x@1.2.0\n // +-- z@1\n //\n // instead of this more deduped tree that arborist builds by default:\n //\n // root\n // +-- x@1.2.0 (dep is x@1.x, from root)\n // +-- y\n // | +-- x@1.1.0\n // | +-- z@2 (dep on x@1.x deduped to x@1.1.0 under y)\n // +-- z@1\n //\n // In order to not create an invalid yarn.lock file with conflicting\n // entries, AND not tell yarn to create an invalid tree, we need to\n // ignore the x@1.x spec coming from z, since it's already in the entries.\n //\n // So, if the integrity and resolved don't match a previous entry, skip it.\n // We call this method on shallower nodes first, so this is fine.\n const n = this.entryDataFromNode(node)\n let priorEntry = null\n const newSpecs = []\n for (const s of specs) {\n const prev = this.entries.get(s)\n // no previous entry for this spec at all, so it's new\n if (!prev) {\n // if we saw a match already, then assign this spec to it as well\n if (priorEntry) {\n priorEntry.addSpec(s)\n } else {\n newSpecs.push(s)\n }\n continue\n }\n\n const m = match(prev, n)\n // there was a prior entry, but a different thing. skip this one\n if (!m) {\n continue\n }\n\n // previous matches, but first time seeing it, so already has this spec.\n // go ahead and add all the previously unseen specs, though\n if (!priorEntry) {\n priorEntry = prev\n for (const s of newSpecs) {\n priorEntry.addSpec(s)\n this.entries.set(s, priorEntry)\n }\n newSpecs.length = 0\n continue\n }\n\n // have a prior entry matching n, and matching the prev we just saw\n // add the spec to it\n priorEntry.addSpec(s)\n this.entries.set(s, priorEntry)\n }\n\n // if we never found a matching prior, then this is a whole new thing\n if (!priorEntry) {\n const entry = Object.assign(new YarnLockEntry(newSpecs), n)\n for (const s of newSpecs) {\n this.entries.set(s, entry)\n }\n } else {\n // pick up any new info that we got for this node, so that we can\n // decorate with integrity/resolved/etc.\n Object.assign(priorEntry, n)\n }\n }\n\n entryDataFromNode (node) {\n const n = {}\n if (node.package.dependencies) {\n n.dependencies = node.package.dependencies\n }\n if (node.package.optionalDependencies) {\n n.optionalDependencies = node.package.optionalDependencies\n }\n if (node.version) {\n n.version = node.version\n }\n if (node.resolved) {\n n.resolved = consistentResolve(\n node.resolved,\n node.isLink ? dirname(node.path) : node.path,\n node.root.path,\n true\n )\n }\n if (node.integrity) {\n n.integrity = node.integrity\n }\n\n return n\n }\n\n static get Entry () {\n return YarnLockEntry\n }\n}\n\nclass YarnLockEntry {\n #specs\n constructor (specs) {\n this.#specs = new Set(specs)\n this.resolved = null\n this.version = null\n this.integrity = null\n this.dependencies = null\n this.optionalDependencies = null\n }\n\n toString () {\n // sort objects to the bottom, then alphabetical\n return ([...this.#specs]\n .sort(localeCompare)\n .map(quoteIfNeeded).join(', ') +\n ':\\n' +\n Object.getOwnPropertyNames(this)\n .filter(prop => this[prop] !== null)\n .sort(priorityThenLocaleCompare)\n .map(prop =>\n typeof this[prop] !== 'object'\n ? ` ${prop} ${prop === 'integrity' ? this[prop] : JSON.stringify(this[prop])}\\n`\n : Object.keys(this[prop]).length === 0 ? ''\n : ` ${prop}:\\n` + sortKV(this[prop]) + '\\n')\n .join('')).trim()\n }\n\n addSpec (spec) {\n this.#specs.add(spec)\n }\n}\n\nmodule.exports = YarnLock\n","const npa = require('npm-package-arg')\n\n// extracted from npm v6 lib/install/realize-shrinkwrap-specifier.js\nconst specFromLock = (name, lock, where) => {\n try {\n if (lock.version) {\n const spec = npa.resolve(name, lock.version, where)\n if (lock.integrity || spec.type === 'git') {\n return spec\n }\n }\n if (lock.from) {\n // legacy metadata includes \"from\", but not integrity\n const spec = npa.resolve(name, lock.from, where)\n if (spec.registry && lock.version) {\n return npa.resolve(name, lock.version, where)\n } else if (!lock.resolved) {\n return spec\n }\n }\n if (lock.resolved) {\n return npa.resolve(name, lock.resolved, where)\n }\n } catch {\n // ignore errors\n }\n try {\n return npa.resolve(name, lock.version, where)\n } catch {\n return {}\n }\n}\n\nmodule.exports = specFromLock\n","const semver = require('semver')\nconst { basename } = require('node:path')\nconst { URL } = require('node:url')\nmodule.exports = (name, tgz) => {\n const base = basename(tgz)\n if (!base.endsWith('.tgz')) {\n return null\n }\n\n if (tgz.startsWith('http:/') || tgz.startsWith('https:/')) {\n const u = new URL(tgz)\n // registry url? check for most likely pattern.\n // either /@foo/bar/-/bar-1.2.3.tgz or\n // /foo/-/foo-1.2.3.tgz, and fall through to\n // basename checking. Note that registries can\n // be mounted below the root url, so /a/b/-/x/y/foo/-/foo-1.2.3.tgz\n // is a potential option.\n const tfsplit = u.pathname.slice(1).split('/-/')\n if (tfsplit.length > 1) {\n const afterTF = tfsplit.pop()\n if (afterTF === base) {\n const pre = tfsplit.pop()\n const preSplit = pre.split(/\\/|%2f/i)\n const project = preSplit.pop()\n const scope = preSplit.pop()\n return versionFromBaseScopeName(base, scope, project)\n }\n }\n }\n\n const split = name.split(/\\/|%2f/i)\n const project = split.pop()\n const scope = split.pop()\n return versionFromBaseScopeName(base, scope, project)\n}\n\nconst versionFromBaseScopeName = (base, scope, name) => {\n if (!base.startsWith(name + '-')) {\n return null\n }\n\n const parsed = semver.parse(base.substring(name.length + 1, base.length - 4))\n return parsed ? {\n name: scope && scope.charAt(0) === '@' ? `${scope}/${name}` : name,\n version: parsed.version,\n } : null\n}\n","module.exports = {\n diff: diff,\n jsonPatchPathConverter: jsonPatchPathConverter,\n};\n\n/*\n const obj1 = {a: 4, b: 5};\n const obj2 = {a: 3, b: 5};\n const obj3 = {a: 4, c: 5};\n\n diff(obj1, obj2);\n [\n { \"op\": \"replace\", \"path\": ['a'], \"value\": 3 }\n ]\n\n diff(obj2, obj3);\n [\n { \"op\": \"remove\", \"path\": ['b'] },\n { \"op\": \"replace\", \"path\": ['a'], \"value\": 4 }\n { \"op\": \"add\", \"path\": ['c'], \"value\": 5 }\n ]\n\n // using converter to generate jsPatch standard paths\n // see http://jsonpatch.com\n import {diff, jsonPatchPathConverter} from 'just-diff'\n diff(obj1, obj2, jsonPatchPathConverter);\n [\n { \"op\": \"replace\", \"path\": '/a', \"value\": 3 }\n ]\n\n diff(obj2, obj3, jsonPatchPathConverter);\n [\n { \"op\": \"remove\", \"path\": '/b' },\n { \"op\": \"replace\", \"path\": '/a', \"value\": 4 }\n { \"op\": \"add\", \"path\": '/c', \"value\": 5 }\n ]\n\n // arrays\n const obj4 = {a: 4, b: [1, 2, 3]};\n const obj5 = {a: 3, b: [1, 2, 4]};\n const obj6 = {a: 3, b: [1, 2, 4, 5]};\n\n diff(obj4, obj5);\n [\n { \"op\": \"replace\", \"path\": ['a'], \"value\": 3 }\n { \"op\": \"replace\", \"path\": ['b', 2], \"value\": 4 }\n ]\n\n diff(obj5, obj6);\n [\n { \"op\": \"add\", \"path\": ['b', 3], \"value\": 5 }\n ]\n\n // nested paths\n const obj7 = {a: 4, b: {c: 3}};\n const obj8 = {a: 4, b: {c: 4}};\n const obj9 = {a: 5, b: {d: 4}};\n\n diff(obj7, obj8);\n [\n { \"op\": \"replace\", \"path\": ['b', 'c'], \"value\": 4 }\n ]\n\n diff(obj8, obj9);\n [\n { \"op\": \"replace\", \"path\": ['a'], \"value\": 5 }\n { \"op\": \"remove\", \"path\": ['b', 'c']}\n { \"op\": \"add\", \"path\": ['b', 'd'], \"value\": 4 }\n ]\n*/\n\nfunction diff(obj1, obj2, pathConverter) {\n if (!obj1 || typeof obj1 != 'object' || !obj2 || typeof obj2 != 'object') {\n throw new Error('both arguments must be objects or arrays');\n }\n\n pathConverter ||\n (pathConverter = function(arr) {\n return arr;\n });\n\n function getDiff({obj1, obj2, basePath, basePathForRemoves, diffs}) {\n var obj1Keys = Object.keys(obj1);\n var obj1KeysLength = obj1Keys.length;\n var obj2Keys = Object.keys(obj2);\n var obj2KeysLength = obj2Keys.length;\n var path;\n\n var lengthDelta = obj1.length - obj2.length;\n\n if (trimFromRight(obj1, obj2)) {\n for (var i = 0; i < obj1KeysLength; i++) {\n var key = Array.isArray(obj1) ? Number(obj1Keys[i]) : obj1Keys[i];\n if (!(key in obj2)) {\n path = basePathForRemoves.concat(key);\n diffs.remove.push({\n op: 'remove',\n path: pathConverter(path),\n });\n }\n }\n\n for (var i = 0; i < obj2KeysLength; i++) {\n var key = Array.isArray(obj2) ? Number(obj2Keys[i]) : obj2Keys[i];\n pushReplaces({\n key,\n obj1,\n obj2,\n path: basePath.concat(key),\n pathForRemoves: basePath.concat(key),\n diffs,\n });\n }\n } else {\n // trim from left, objects are both arrays\n for (var i = 0; i < lengthDelta; i++) {\n path = basePathForRemoves.concat(i);\n diffs.remove.push({\n op: 'remove',\n path: pathConverter(path),\n });\n }\n\n // now make a copy of obj1 with excess elements left trimmed and see if there any replaces\n var obj1Trimmed = obj1.slice(lengthDelta);;\n for (var i = 0; i < obj2KeysLength; i++) {\n pushReplaces({\n key: i,\n obj1: obj1Trimmed,\n obj2,\n path: basePath.concat(i),\n // since list of removes are reversed before presenting result,\n // we need to ignore existing parent removes when doing nested removes\n pathForRemoves: basePath.concat(i + lengthDelta),\n diffs,\n });\n }\n }\n }\n\n var diffs = {remove: [], replace: [], add: []};\n getDiff({\n obj1,\n obj2,\n basePath: [],\n basePathForRemoves: [],\n diffs,\n });\n\n // reverse removes since we want to maintain indexes\n return diffs.remove\n .reverse()\n .concat(diffs.replace)\n .concat(diffs.add);\n\n function pushReplaces({key, obj1, obj2, path, pathForRemoves, diffs}) {\n var obj1AtKey = obj1[key];\n var obj2AtKey = obj2[key];\n\n if(!(key in obj1) && (key in obj2)) {\n var obj2Value = obj2AtKey;\n diffs.add.push({\n op: 'add',\n path: pathConverter(path),\n value: obj2Value,\n });\n } else if(obj1AtKey !== obj2AtKey) {\n if(Object(obj1AtKey) !== obj1AtKey ||\n Object(obj2AtKey) !== obj2AtKey || differentTypes(obj1AtKey, obj2AtKey)\n ) {\n pushReplace(path, diffs, obj2AtKey);\n } else {\n if(!Object.keys(obj1AtKey).length &&\n !Object.keys(obj2AtKey).length &&\n String(obj1AtKey) != String(obj2AtKey)) {\n pushReplace(path, diffs, obj2AtKey);\n } else {\n getDiff({\n obj1: obj1[key],\n obj2: obj2[key],\n basePath: path,\n basePathForRemoves: pathForRemoves,\n diffs});\n }\n }\n }\n }\n\n function pushReplace(path, diffs, newValue) {\n diffs.replace.push({\n op: 'replace',\n path: pathConverter(path),\n value: newValue,\n });\n }\n}\n\nfunction jsonPatchPathConverter(arrayPath) {\n return [''].concat(arrayPath).join('/');\n}\n\nfunction differentTypes(a, b) {\n return Object.prototype.toString.call(a) != Object.prototype.toString.call(b);\n}\n\nfunction trimFromRight(obj1, obj2) {\n var lengthDelta = obj1.length - obj2.length;\n if (Array.isArray(obj1) && Array.isArray(obj2) && lengthDelta > 0) {\n var leftMatches = 0;\n var rightMatches = 0;\n for (var i = 0; i < obj2.length; i++) {\n if (String(obj1[i]) === String(obj2[i])) {\n leftMatches++;\n } else {\n break;\n }\n }\n for (var j = obj2.length; j > 0; j--) {\n if (String(obj1[j + lengthDelta]) === String(obj2[j])) {\n rightMatches++;\n } else {\n break;\n }\n }\n\n // bias to trim right becase it requires less index shifting\n return leftMatches >= rightMatches;\n }\n return true;\n}\n","module.exports = {\n diffApply: diffApply,\n jsonPatchPathConverter: jsonPatchPathConverter,\n};\n\n/*\n const obj1 = {a: 3, b: 5};\n diffApply(obj1,\n [\n { \"op\": \"remove\", \"path\": ['b'] },\n { \"op\": \"replace\", \"path\": ['a'], \"value\": 4 },\n { \"op\": \"add\", \"path\": ['c'], \"value\": 5 }\n ]\n );\n obj1; // {a: 4, c: 5}\n\n // using converter to apply jsPatch standard paths\n // see http://jsonpatch.com\n import {diff, jsonPatchPathConverter} from 'just-diff'\n const obj2 = {a: 3, b: 5};\n diffApply(obj2, [\n { \"op\": \"remove\", \"path\": '/b' },\n { \"op\": \"replace\", \"path\": '/a', \"value\": 4 }\n { \"op\": \"add\", \"path\": '/c', \"value\": 5 }\n ], jsonPatchPathConverter);\n obj2; // {a: 4, c: 5}\n\n // arrays\n const obj3 = {a: 4, b: [1, 2, 3]};\n diffApply(obj3, [\n { \"op\": \"replace\", \"path\": ['a'], \"value\": 3 }\n { \"op\": \"replace\", \"path\": ['b', 2], \"value\": 4 }\n { \"op\": \"add\", \"path\": ['b', 3], \"value\": 9 }\n ]);\n obj3; // {a: 3, b: [1, 2, 4, 9]}\n\n // nested paths\n const obj4 = {a: 4, b: {c: 3}};\n diffApply(obj4, [\n { \"op\": \"replace\", \"path\": ['a'], \"value\": 5 }\n { \"op\": \"remove\", \"path\": ['b', 'c']}\n { \"op\": \"add\", \"path\": ['b', 'd'], \"value\": 4 }\n ]);\n obj4; // {a: 5, b: {d: 4}}\n*/\n\nvar REMOVE = 'remove';\nvar REPLACE = 'replace';\nvar ADD = 'add';\nvar MOVE = 'move';\n\nfunction diffApply(obj, diff, pathConverter) {\n if (!obj || typeof obj != 'object') {\n throw new Error('base object must be an object or an array');\n }\n\n if (!Array.isArray(diff)) {\n throw new Error('diff must be an array');\n }\n\n var diffLength = diff.length;\n for (var i = 0; i < diffLength; i++) {\n var thisDiff = diff[i];\n var subObject = obj;\n var thisOp = thisDiff.op;\n\n var thisPath = transformPath(pathConverter, thisDiff.path);\n var thisFromPath = thisDiff.from && transformPath(pathConverter, thisDiff.from);\n var toPath, toPathCopy, lastToProp, subToObject, valueToMove;\n\n if (thisFromPath) {\n // MOVE only, \"fromPath\" is effectively path and \"path\" is toPath\n toPath = thisPath;\n thisPath = thisFromPath;\n\n toPathCopy = toPath.slice();\n lastToProp = toPathCopy.pop();\n prototypeCheck(lastToProp);\n if (lastToProp == null) {\n return false;\n }\n\n var thisToProp;\n while (((thisToProp = toPathCopy.shift())) != null) {\n prototypeCheck(thisToProp);\n if (!(thisToProp in subToObject)) {\n subToObject[thisToProp] = {};\n }\n subToObject = subToObject[thisToProp];\n }\n }\n\n var pathCopy = thisPath.slice();\n var lastProp = pathCopy.pop();\n prototypeCheck(lastProp);\n if (lastProp == null) {\n return false;\n }\n\n var thisProp;\n while (((thisProp = pathCopy.shift())) != null) {\n prototypeCheck(thisProp);\n if (!(thisProp in subObject)) {\n subObject[thisProp] = {};\n }\n subObject = subObject[thisProp];\n }\n if (thisOp === REMOVE || thisOp === REPLACE || thisOp === MOVE) {\n var path = thisOp === MOVE ? thisDiff.from : thisDiff.path;\n if (!subObject.hasOwnProperty(lastProp)) {\n throw new Error(['expected to find property', path, 'in object', obj].join(' '));\n }\n }\n if (thisOp === REMOVE || thisOp === MOVE) {\n if (thisOp === MOVE) {\n valueToMove = subObject[lastProp];\n }\n Array.isArray(subObject) ? subObject.splice(lastProp, 1) : delete subObject[lastProp];\n }\n if (thisOp === REPLACE || thisOp === ADD) {\n subObject[lastProp] = thisDiff.value;\n }\n\n if (thisOp === MOVE) {\n subObject[lastToProp] = valueToMove;\n }\n }\n return subObject;\n}\n\nfunction transformPath(pathConverter, thisPath) {\n if(pathConverter) {\n thisPath = pathConverter(thisPath);\n if(!Array.isArray(thisPath)) {\n throw new Error([\n 'pathConverter must return an array, returned:',\n thisPath,\n ].join(' '));\n }\n } else {\n if(!Array.isArray(thisPath)) {\n throw new Error([\n 'diff path',\n thisPath,\n 'must be an array, consider supplying a path converter']\n .join(' '));\n }\n }\n return thisPath;\n}\n\nfunction jsonPatchPathConverter(stringPath) {\n return stringPath.split('/').slice(1);\n}\n\nfunction prototypeCheck(prop) {\n // coercion is intentional to catch prop values like `['__proto__']`\n if (prop == '__proto__' || prop == 'constructor' || prop == 'prototype') {\n throw new Error('setting of prototype values not supported');\n }\n}\n","const parseJSON = require('json-parse-even-better-errors')\nconst { diff } = require('just-diff')\nconst { diffApply } = require('just-diff-apply')\n\nconst globalObjectProperties = Object.getOwnPropertyNames(Object.prototype)\n\nconst stripBOM = content => {\n content = content.toString()\n // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n // because the buffer-to-string conversion in `fs.readFileSync()`\n // translates it to FEFF, the UTF-16 BOM.\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1)\n }\n return content\n}\n\nconst PARENT_RE = /\\|{7,}/g\nconst OURS_RE = /<{7,}/g\nconst THEIRS_RE = /={7,}/g\nconst END_RE = />{7,}/g\n\nconst isDiff = str =>\n str.match(OURS_RE) && str.match(THEIRS_RE) && str.match(END_RE)\n\nconst parseConflictJSON = (str, reviver, prefer) => {\n prefer = prefer || 'ours'\n if (prefer !== 'theirs' && prefer !== 'ours') {\n throw new TypeError('prefer param must be \"ours\" or \"theirs\" if set')\n }\n\n str = stripBOM(str)\n\n if (!isDiff(str)) {\n return parseJSON(str)\n }\n\n const pieces = str.split(/[\\n\\r]+/g).reduce((acc, line) => {\n if (line.match(PARENT_RE)) {\n acc.state = 'parent'\n } else if (line.match(OURS_RE)) {\n acc.state = 'ours'\n } else if (line.match(THEIRS_RE)) {\n acc.state = 'theirs'\n } else if (line.match(END_RE)) {\n acc.state = 'top'\n } else {\n if (acc.state === 'top' || acc.state === 'ours') {\n acc.ours += line\n }\n if (acc.state === 'top' || acc.state === 'theirs') {\n acc.theirs += line\n }\n if (acc.state === 'top' || acc.state === 'parent') {\n acc.parent += line\n }\n }\n return acc\n }, {\n state: 'top',\n ours: '',\n theirs: '',\n parent: '',\n })\n\n // this will throw if either piece is not valid JSON, that's intended\n const parent = parseJSON(pieces.parent, reviver)\n const ours = parseJSON(pieces.ours, reviver)\n const theirs = parseJSON(pieces.theirs, reviver)\n\n return prefer === 'ours'\n ? resolve(parent, ours, theirs)\n : resolve(parent, theirs, ours)\n}\n\nconst isObj = obj => obj && typeof obj === 'object'\n\nconst copyPath = (to, from, path, i) => {\n const p = path[i]\n if (isObj(to[p]) && isObj(from[p]) &&\n Array.isArray(to[p]) === Array.isArray(from[p])) {\n return copyPath(to[p], from[p], path, i + 1)\n }\n to[p] = from[p]\n}\n\n// get the diff from parent->ours and applying our changes on top of theirs.\n// If they turned an object into a non-object, then put it back.\nconst resolve = (parent, ours, theirs) => {\n const dours = diff(parent, ours)\n for (let i = 0; i < dours.length; i++) {\n if (globalObjectProperties.find(prop => dours[i].path.includes(prop))) {\n continue\n }\n try {\n diffApply(theirs, [dours[i]])\n } catch (e) {\n copyPath(theirs, ours, dours[i].path, 0)\n }\n }\n return theirs\n}\n\nmodule.exports = Object.assign(parseConflictJSON, { isDiff })\n","const isObj = val => !!val && !Array.isArray(val) && typeof val === 'object'\n\nconst compare = (ak, bk, prefKeys) =>\n prefKeys.includes(ak) && !prefKeys.includes(bk) ? -1\n : prefKeys.includes(bk) && !prefKeys.includes(ak) ? 1\n : prefKeys.includes(ak) && prefKeys.includes(bk)\n ? prefKeys.indexOf(ak) - prefKeys.indexOf(bk)\n : ak.localeCompare(bk, 'en')\n\nconst sort = (replacer, seen) => (key, val) => {\n const prefKeys = Array.isArray(replacer) ? replacer : []\n\n if (typeof replacer === 'function')\n val = replacer(key, val)\n\n if (!isObj(val))\n return val\n\n if (seen.has(val))\n return seen.get(val)\n\n const ret = Object.entries(val).sort(\n ([ak, av], [bk, bv]) =>\n isObj(av) === isObj(bv) ? compare(ak, bk, prefKeys)\n : isObj(av) ? 1\n : -1\n ).reduce((set, [k, v]) => {\n set[k] = v\n return set\n }, {})\n\n seen.set(val, ret)\n return ret\n}\n\nmodule.exports = (obj, replacer, space = 2) =>\n JSON.stringify(obj, sort(replacer, new Map()), space)\n + (space ? '\\n' : '')\n","function overrideResolves (resolved, opts) {\n const { omitLockfileRegistryResolved = false } = opts\n\n if (omitLockfileRegistryResolved) {\n return undefined\n }\n\n return resolved\n}\n\nmodule.exports = { overrideResolves }\n","// a module that manages a lockfile (package-lock.json).\n\n// Increment whenever the lockfile version updates\n// v1 - npm <=6\n// v2 - arborist v1, npm v7, backwards compatible with v1, add 'packages'\n// v3 will drop the 'dependencies' field, backwards comp with v2, not v1\n//\n// We cannot bump to v3 until npm v6 is out of common usage, and\n// definitely not before npm v8.\n\nconst localeCompare = require('@isaacs/string-locale-compare')('en')\nconst defaultLockfileVersion = 3\n// Bumped to 4 only when a node carries a patch record, so older clients abort.\nconst patchedLockfileVersion = 4\n// packageExtensions provenance also forces lockfileVersion 4 so older clients abort rather than silently dropping the repaired graph.\n// Both features share version 4: they are root-owned graph repairs an old npm must not drop.\nconst packageExtensionsLockfileVersion = 4\nconst maxLockfileVersion = 4\n\n// for comparing nodes to yarn.lock entries\nconst mismatch = (a, b) => a && b && a !== b\n\n// this.tree => the root node for the tree (ie, same path as this)\n// - Set the first time we do `this.add(node)` for a path matching this.path\n//\n// this.add(node) =>\n// - decorate the node with the metadata we have, if we have it, and it matches\n// - add to the map of nodes needing to be committed, so that subsequent\n// changes are captured when we commit that location's metadata.\n//\n// this.commit() =>\n// - commit all nodes awaiting update to their metadata entries\n// - re-generate this.data and this.yarnLock based on this.tree\n//\n// Note that between this.add() and this.commit(), `this.data` will be out of\n// date! Always call `commit()` before relying on it.\n//\n// After calling this.commit(), any nodes not present in the tree will have\n// been removed from the shrinkwrap data as well.\n\nconst { log } = require('proc-log')\nconst YarnLock = require('./yarn-lock.js')\nconst {\n readFile,\n readdir,\n readlink,\n rm,\n stat,\n writeFile,\n} = require('node:fs/promises')\n\nconst { resolve, basename, relative } = require('node:path')\nconst specFromLock = require('./spec-from-lock.js')\nconst versionFromTgz = require('./version-from-tgz.js')\nconst npa = require('npm-package-arg')\nconst pkgJson = require('@npmcli/package-json')\nconst parseJSON = require('parse-conflict-json')\nconst nameFromFolder = require('@npmcli/name-from-folder')\n\nconst stringify = require('json-stringify-nice')\nconst swKeyOrder = [\n 'name',\n 'version',\n 'lockfileVersion',\n 'resolved',\n 'integrity',\n 'requires',\n 'packages',\n 'dependencies',\n]\n\n// used to rewrite from yarn registry to npm registry\nconst yarnRegRe = /^https?:\\/\\/registry\\.yarnpkg\\.com\\//\nconst npmRegRe = /^https?:\\/\\/registry\\.npmjs\\.org\\//\n\n// sometimes resolved: is weird or broken, or something npa can't handle\nconst specFromResolved = resolved => {\n try {\n return npa(resolved)\n } catch (er) {\n return {}\n }\n}\n\nconst relpath = require('./relpath.js')\n\nconst consistentResolve = require('./consistent-resolve.js')\nconst { overrideResolves } = require('./override-resolves.js')\n\nconst pkgMetaKeys = [\n // note: name is included if necessary, for alias packages\n 'version',\n 'dependencies',\n 'peerDependencies',\n 'peerDependenciesMeta',\n 'optionalDependencies',\n 'bundleDependencies',\n 'acceptDependencies',\n 'funding',\n 'engines',\n 'os',\n 'cpu',\n 'libc',\n '_integrity',\n 'license',\n 'hasInstallScript',\n 'bin',\n 'deprecated',\n 'workspaces',\n]\n\nconst nodeMetaKeys = [\n 'integrity',\n 'inBundle',\n 'hasInstallScript',\n 'patched',\n 'packageExtensionsApplied',\n 'npmExtensionApplied',\n]\n\nconst metaFieldFromPkg = (pkg, key) => {\n const val = pkg[key]\n if (val) {\n // get only the license type, not the full object\n if (key === 'license' && typeof val === 'object' && val.type) {\n return val.type\n }\n // skip empty objects and falsey values\n if (typeof val !== 'object' || Object.keys(val).length) {\n return val\n }\n }\n return null\n}\n\n// check to make sure that there are no packages newer than or missing from the hidden lockfile\nconst assertNoNewer = async (path, data, lockTime, dir, seen) => {\n const base = basename(dir)\n const isNM = dir !== path && base === 'node_modules'\n const isScope = dir !== path && base.startsWith('@')\n const isParent = (dir === path) || isNM || isScope\n\n const parent = isParent ? dir : resolve(dir, 'node_modules')\n const rel = relpath(path, dir)\n seen.add(rel)\n let entries\n if (dir === path) {\n entries = [{ name: 'node_modules', isDirectory: () => true }]\n } else {\n const { mtime: dirTime } = await stat(dir)\n if (dirTime > lockTime) {\n throw new Error(`out of date, updated: ${rel}`)\n }\n if (!isScope && !isNM && !data.packages[rel]) {\n throw new Error(`missing from lockfile: ${rel}`)\n }\n entries = await readdir(parent, { withFileTypes: true }).catch(() => [])\n }\n\n // TODO limit concurrency here, this is recursive\n await Promise.all(entries.map(async dirent => {\n const child = resolve(parent, dirent.name)\n if (dirent.isDirectory() && !dirent.name.startsWith('.')) {\n await assertNoNewer(path, data, lockTime, child, seen)\n } else if (dirent.isSymbolicLink()) {\n const target = resolve(parent, await readlink(child))\n const tstat = await stat(target).catch(\n /* istanbul ignore next - windows */ () => null)\n seen.add(relpath(path, child))\n /* istanbul ignore next - windows cannot do this */\n if (tstat?.isDirectory() && !seen.has(relpath(path, target))) {\n await assertNoNewer(path, data, lockTime, target, seen)\n }\n }\n }))\n\n if (dir !== path) {\n return\n }\n\n // The walk above can't reach two linked-strategy layouts: a store package's sibling deps under .store/<key>/node_modules (.store is a skipped dot-dir), and an undeclared workspace not symlinked into root node_modules. Walk those dirs, derived from the lockfile entries.\n // A dir reachable through a link entry is skipped: it was already reached (or, if the symlink is stale, correctly stays unseen so the lockfile is rejected). This keeps the hoisted strategy's stale-symlink detection intact, since there every workspace is a link target.\n const linkTargets = new Set()\n for (const loc in data.packages) {\n const { link, resolved } = data.packages[loc]\n if (link && resolved) {\n linkTargets.add(resolved.replace(/\\\\/g, '/'))\n }\n }\n const extraDirs = new Set()\n for (const loc in data.packages) {\n const store = loc.match(/^(.*\\/\\.store\\/.+?)\\/node_modules\\//)\n if (store) {\n // .store/<key> is never walked but has no entry, so mark it seen.\n seen.add(store[1])\n extraDirs.add(`${store[1]}/node_modules`)\n continue\n }\n // A workspace/fsChild dir outside node_modules, e.g. packages/a.\n const i = loc.indexOf('/node_modules/')\n const root = i === -1 ? loc : loc.slice(0, i)\n if (root && !/(^|\\/)node_modules(\\/|$)/.test(root) && !linkTargets.has(root)) {\n extraDirs.add(root)\n }\n }\n for (const rel of extraDirs) {\n await assertNoNewer(path, data, lockTime, resolve(path, rel), seen)\n }\n\n // assert that all the entries in the lockfile were seen\n for (const loc in data.packages) {\n if (!seen.has(loc)) {\n throw new Error(`missing from node_modules: ${loc}`)\n }\n }\n}\n\nclass Shrinkwrap {\n static get defaultLockfileVersion () {\n return defaultLockfileVersion\n }\n\n static load (options) {\n return new Shrinkwrap(options).load()\n }\n\n static get keyOrder () {\n return swKeyOrder\n }\n\n static async reset (options) {\n // still need to know if it was loaded from the disk, but don't\n // bother reading it if we're gonna just throw it away.\n const s = new Shrinkwrap(options)\n s.reset()\n\n const [lock] = await s.resetFiles\n\n if (s.hiddenLockfile) {\n s.filename = resolve(s.path, 'node_modules/.package-lock.json')\n } else {\n s.filename = resolve(s.path, 'package-lock.json')\n }\n s.loadedFromDisk = !!lock\n // TODO what uses this?\n s.type = basename(s.filename)\n\n return s\n }\n\n static metaFromNode (node, path, options = {}) {\n if (node.isLink) {\n return {\n resolved: relpath(path, node.realpath),\n link: true,\n }\n }\n\n const meta = {}\n for (const key of pkgMetaKeys) {\n const val = metaFieldFromPkg(node.package, key)\n if (val) {\n meta[key.replace(/^_/, '')] = val\n }\n }\n // we only include name if different from the node path name, and for the\n // root to help prevent churn based on the name of the directory the\n // project is in\n const pname = node.packageName\n // when Target package name and Target node share the same name, we include the name, target node should have name as per realpath.\n if (pname && (node === node.root || pname !== node.name || nameFromFolder(node.realpath) !== pname)) {\n meta.name = pname\n }\n\n if (node.isTop && node.package.devDependencies) {\n meta.devDependencies = node.package.devDependencies\n }\n\n for (const key of nodeMetaKeys) {\n if (node[key]) {\n meta[key] = node[key]\n }\n }\n\n const resolved = consistentResolve(node.resolved, node.path, path, true)\n // hide resolved from registry dependencies.\n if (!resolved) {\n // no-op\n } else if (node.isRegistryDependency) {\n meta.resolved = overrideResolves(resolved, options)\n } else {\n meta.resolved = resolved\n }\n\n if (node.extraneous) {\n meta.extraneous = true\n } else {\n if (node.peer) {\n meta.peer = true\n }\n if (node.dev) {\n meta.dev = true\n }\n if (node.optional) {\n meta.optional = true\n }\n if (node.devOptional && !node.dev && !node.optional) {\n meta.devOptional = true\n }\n }\n return meta\n }\n\n #awaitingUpdate = new Map()\n\n constructor (options = {}) {\n const {\n path,\n indent = 2,\n newline = '\\n',\n hiddenLockfile = false,\n lockfileVersion,\n resolveOptions = {},\n } = options\n\n if (hiddenLockfile) {\n this.lockfileVersion = 3\n } else if (lockfileVersion) {\n this.lockfileVersion = parseInt(lockfileVersion, 10)\n } else {\n this.lockfileVersion = null\n }\n\n this.tree = null\n this.path = resolve(path || '.')\n this.filename = null\n this.data = null\n this.indent = indent\n this.newline = newline\n this.loadedFromDisk = false\n this.type = null\n this.yarnLock = null\n this.hiddenLockfile = hiddenLockfile\n this.loadingError = null\n this.resolveOptions = resolveOptions\n }\n\n // check to see if a spec is present in the yarn.lock file, and if so,\n // if we should use it, and what it should resolve to. This is only\n // done when we did not load a shrinkwrap from disk. Also, decorate\n // the options object if provided with the resolved and integrity that\n // we expect.\n checkYarnLock (spec, options = {}) {\n spec = npa(spec)\n const { yarnLock, loadedFromDisk } = this\n const useYarnLock = yarnLock && !loadedFromDisk\n const fromYarn = useYarnLock && yarnLock.entries.get(spec.raw)\n if (fromYarn && fromYarn.version) {\n // if it's the yarn or npm default registry, use the version as\n // our effective spec. if it's any other kind of thing, use that.\n const { resolved, version, integrity } = fromYarn\n const isYarnReg = spec.registry && yarnRegRe.test(resolved)\n const isnpmReg = spec.registry && !isYarnReg && npmRegRe.test(resolved)\n const isReg = isnpmReg || isYarnReg\n // don't use the simple version if the \"registry\" url is\n // something else entirely!\n const tgz = isReg && versionFromTgz(spec.name, resolved) || {}\n let yspec = resolved\n if (tgz.name === spec.name && tgz.version === version) {\n yspec = version\n } else if (isReg && tgz.name && tgz.version) {\n yspec = `npm:${tgz.name}@${tgz.version}`\n }\n if (yspec) {\n options.resolved = resolved.replace(yarnRegRe, 'https://registry.npmjs.org/')\n options.integrity = integrity\n return npa(`${spec.name}@${yspec}`)\n }\n }\n return spec\n }\n\n // throw away the shrinkwrap data so we can start fresh\n // still worth doing a load() first so we know which files to write.\n reset () {\n this.tree = null\n this.#awaitingUpdate = new Map()\n this.packageExtensionsHash = null\n this.npmExtensionHash = null\n const lockfileVersion = this.lockfileVersion || defaultLockfileVersion\n this.originalLockfileVersion = lockfileVersion\n\n this.data = {\n lockfileVersion,\n requires: true,\n packages: {},\n dependencies: {},\n }\n }\n\n // files to potentially read from and write to, in order of priority\n get #filenameSet () {\n if (this.hiddenLockfile) {\n return [`${this.path}/node_modules/.package-lock.json`]\n }\n return [\n `${this.path}/package-lock.json`,\n `${this.path}/yarn.lock`,\n ]\n }\n\n get loadFiles () {\n return Promise.all(\n this.#filenameSet.map(file => file && readFile(file, 'utf8').then(d => d, er => {\n /* istanbul ignore else - can't test without breaking module itself */\n if (er.code === 'ENOENT') {\n return ''\n } else {\n throw er\n }\n }))\n )\n }\n\n get resetFiles () {\n // slice out yarn, we only care about the package-lock when checking\n // this way, since we're not actually loading the full lock metadata\n return Promise.all(this.#filenameSet.slice(0, 1)\n .map(file => file && stat(file).then(st => st.isFile(), er => {\n /* istanbul ignore else - can't test without breaking module itself */\n if (er.code === 'ENOENT') {\n return null\n } else {\n throw er\n }\n })\n )\n )\n }\n\n inferFormattingOptions (packageJSONData) {\n const {\n [Symbol.for('indent')]: indent,\n [Symbol.for('newline')]: newline,\n } = packageJSONData\n if (indent !== undefined) {\n this.indent = indent\n }\n if (newline !== undefined) {\n this.newline = newline\n }\n }\n\n async load () {\n let data\n try {\n const [lock, yarn] = await this.loadFiles\n data = lock || '{}'\n\n if (this.hiddenLockfile) {\n this.filename = resolve(this.path, 'node_modules/.package-lock.json')\n } else {\n this.filename = resolve(this.path, 'package-lock.json')\n }\n this.type = basename(this.filename)\n this.loadedFromDisk = Boolean(lock)\n\n if (yarn) {\n this.yarnLock = new YarnLock()\n // ignore invalid yarn data. we'll likely clobber it later anyway.\n try {\n this.yarnLock.parse(yarn)\n } catch {\n // ignore errors\n }\n }\n\n data = parseJSON(data)\n this.inferFormattingOptions(data)\n\n if (this.hiddenLockfile && data.packages) {\n // add a few ms just to account for jitter\n const lockTime = +(await stat(this.filename)).mtime + 10\n await assertNoNewer(this.path, data, lockTime, this.path, new Set())\n }\n\n // all good! hidden lockfile is the newest thing in here.\n } catch (er) {\n /* istanbul ignore else */\n if (typeof this.filename === 'string') {\n const rel = relpath(this.path, this.filename)\n log.verbose('shrinkwrap', `failed to load ${rel}`, er.message)\n } else {\n log.verbose('shrinkwrap', `failed to load ${this.path}`, er.message)\n }\n this.loadingError = er\n this.loadedFromDisk = false\n this.ancientLockfile = false\n data = {}\n }\n // refuse lockfiles newer than we understand so we never drop a patched or repaired graph we cannot read\n if (data.lockfileVersion > maxLockfileVersion) {\n throw Object.assign(\n new Error(`Unsupported lockfileVersion ${data.lockfileVersion}. This npm only supports up to ${maxLockfileVersion}. Please upgrade npm.`),\n { code: 'ELOCKFILEVERSION' }\n )\n }\n // auto convert v1 lockfiles to v3\n // leave v2 in place unless configured\n // v3 by default\n let lockfileVersion = defaultLockfileVersion\n if (this.lockfileVersion) {\n lockfileVersion = this.lockfileVersion\n } else if (data.lockfileVersion && data.lockfileVersion !== 1) {\n lockfileVersion = data.lockfileVersion\n }\n\n this.data = {\n ...data,\n lockfileVersion,\n requires: true,\n packages: data.packages || {},\n dependencies: data.dependencies || {},\n }\n\n this.originalLockfileVersion = data.lockfileVersion\n\n // the canonical packageExtensions hash, if the lockfile recorded one on its root entry\n this.packageExtensionsHash = data.packages?.['']?.packageExtensionsHash || null\n // the .npm-extension file hash, if the lockfile recorded one on its root entry\n this.npmExtensionHash = data.packages?.['']?.npmExtensionHash || null\n\n // use default if it wasn't explicitly set, and the current file is\n // less than our default. otherwise, keep whatever is in the file,\n // unless we had an explicit setting already.\n if (!this.lockfileVersion) {\n this.lockfileVersion = this.data.lockfileVersion = lockfileVersion\n }\n this.ancientLockfile = this.loadedFromDisk &&\n !(data.lockfileVersion >= 2) && !data.requires\n\n // load old lockfile deps into the packages listing\n if (data.dependencies && !data.packages) {\n let pkg\n try {\n pkg = await pkgJson.normalize(this.path)\n pkg = pkg.content\n } catch {\n pkg = {}\n }\n this.#loadAll('', null, this.data)\n this.#fixDependencies(pkg)\n }\n return this\n }\n\n #loadAll (location, name, lock) {\n // migrate a v1 package lock to the new format.\n const meta = this.#metaFromLock(location, name, lock)\n // dependencies nested under a link are actually under the link target\n if (meta.link) {\n location = meta.resolved\n }\n if (lock.dependencies) {\n for (const name in lock.dependencies) {\n const loc = location + (location ? '/' : '') + 'node_modules/' + name\n this.#loadAll(loc, name, lock.dependencies[name])\n }\n }\n }\n\n // v1 lockfiles track the optional/dev flags, but they don't tell us\n // which thing had what kind of dep on what other thing, so we need\n // to correct that now, or every link will be considered prod\n #fixDependencies (pkg) {\n // we need the root package.json because legacy shrinkwraps just\n // have requires:true at the root level, which is even less useful\n // than merging all dep types into one object.\n const root = this.data.packages['']\n for (const key of pkgMetaKeys) {\n const val = metaFieldFromPkg(pkg, key)\n if (val) {\n root[key.replace(/^_/, '')] = val\n }\n }\n\n for (const loc in this.data.packages) {\n const meta = this.data.packages[loc]\n if (!meta.requires || !loc) {\n continue\n }\n\n // resolve each require to a meta entry\n // if this node isn't optional, but the dep is, then it's an optionalDep\n // likewise for dev deps.\n // This isn't perfect, but it's a pretty good approximation, and at\n // least gets us out of having all 'prod' edges, which throws off the\n // buildIdealTree process\n for (const name in meta.requires) {\n const dep = this.#resolveMetaNode(loc, name)\n // this overwrites the false value set above\n // default to dependencies if the dep just isn't in the tree, which\n // maybe should be an error, since it means that the shrinkwrap is\n // invalid, but we can't do much better without any info.\n let depType = 'dependencies'\n /* istanbul ignore else - dev deps are only for the root level */\n if (dep?.optional && !meta.optional) {\n depType = 'optionalDependencies'\n } else if (dep?.dev && !meta.dev) {\n // XXX is this even reachable?\n depType = 'devDependencies'\n }\n if (!meta[depType]) {\n meta[depType] = {}\n }\n meta[depType][name] = meta.requires[name]\n }\n delete meta.requires\n }\n }\n\n #resolveMetaNode (loc, name) {\n for (let path = loc; true; path = path.replace(/(^|\\/)[^/]*$/, '')) {\n const check = `${path}${path ? '/' : ''}node_modules/${name}`\n if (this.data.packages[check]) {\n return this.data.packages[check]\n }\n\n if (!path) {\n break\n }\n }\n return null\n }\n\n #lockFromLoc (lock, path, i = 0) {\n if (!lock) {\n return null\n }\n\n if (path[i] === '') {\n i++\n }\n\n if (i >= path.length) {\n return lock\n }\n\n if (!lock.dependencies) {\n return null\n }\n\n return this.#lockFromLoc(lock.dependencies[path[i]], path, i + 1)\n }\n\n // pass in a path relative to the root path, or an absolute path,\n // get back a /-normalized location based on root path.\n #pathToLoc (path) {\n return relpath(this.path, resolve(this.path, path))\n }\n\n delete (nodePath) {\n if (!this.data) {\n throw new Error('run load() before getting or setting data')\n }\n const location = this.#pathToLoc(nodePath)\n this.#awaitingUpdate.delete(location)\n\n delete this.data.packages[location]\n const path = location.split(/(?:^|\\/)node_modules\\//)\n const name = path.pop()\n const pLock = this.#lockFromLoc(this.data, path)\n if (pLock && pLock.dependencies) {\n delete pLock.dependencies[name]\n }\n }\n\n get (nodePath) {\n if (!this.data) {\n throw new Error('run load() before getting or setting data')\n }\n\n const location = this.#pathToLoc(nodePath)\n if (this.#awaitingUpdate.has(location)) {\n this.#updateWaitingNode(location)\n }\n\n // first try to get from the newer spot, which we know has\n // all the things we need.\n if (this.data.packages[location]) {\n return this.data.packages[location]\n }\n\n // otherwise, fall back to the legacy metadata, and hope for the best\n // get the node in the shrinkwrap corresponding to this spot\n const path = location.split(/(?:^|\\/)node_modules\\//)\n const name = path[path.length - 1]\n const lock = this.#lockFromLoc(this.data, path)\n\n return this.#metaFromLock(location, name, lock)\n }\n\n #metaFromLock (location, name, lock) {\n // This function tries as hard as it can to figure out the metadata\n // from a lockfile which may be outdated or incomplete. Since v1\n // lockfiles used the \"version\" field to contain a variety of\n // different possible types of data, this gets a little complicated.\n if (!lock) {\n return {}\n }\n\n // try to figure out a npm-package-arg spec from the lockfile entry\n // This will return null if we could not get anything valid out of it.\n const spec = specFromLock(name, lock, this.path)\n\n if (spec.type === 'directory') {\n // the \"version\" was a file: url to a non-tarball path\n // this is a symlink dep. We don't store much metadata\n // about symlinks, just the target.\n const target = relpath(this.path, spec.fetchSpec)\n this.data.packages[location] = {\n link: true,\n resolved: target,\n }\n // also save the link target, omitting version since we don't know\n // what it is, but we know it isn't a link to itself!\n if (!this.data.packages[target]) {\n this.#metaFromLock(target, name, { ...lock, version: null })\n }\n return this.data.packages[location]\n }\n\n const meta = {}\n // when calling loadAll we'll change these into proper dep objects\n if (lock.requires && typeof lock.requires === 'object') {\n meta.requires = lock.requires\n }\n\n if (lock.optional) {\n meta.optional = true\n }\n if (lock.dev) {\n meta.dev = true\n }\n\n // the root will typically have a name from the root project's\n // package.json file.\n if (location === '') {\n meta.name = lock.name\n }\n\n // if we have integrity, save it now.\n if (lock.integrity) {\n meta.integrity = lock.integrity\n }\n\n if (lock.version && !lock.integrity) {\n // this is usually going to be a git url or symlink, but it could\n // also be a registry dependency that did not have integrity at\n // the time it was saved.\n // Symlinks were already handled above, so that leaves git.\n //\n // For git, always save the full SSH url. we'll actually fetch the\n // tgz most of the time, since it's faster, but it won't work for\n // private repos, and we can't get back to the ssh from the tgz,\n // so we store the ssh instead.\n // For unknown git hosts, just resolve to the raw spec in lock.version\n if (spec.type === 'git') {\n meta.resolved = consistentResolve(spec, this.path, this.path)\n\n // return early because there is nothing else we can do with this\n return this.data.packages[location] = meta\n } else if (spec.registry) {\n // registry dep that didn't save integrity. grab the version, and\n // fall through to pick up the resolved and potentially name.\n meta.version = lock.version\n }\n // only other possible case is a tarball without integrity.\n // fall through to do what we can with the filename later.\n }\n\n // at this point, we know that the spec is either a registry dep\n // (ie, version, because locking, which means a resolved url),\n // or a remote dep, or file: url. Remote deps and file urls\n // have a fetchSpec equal to the fully resolved thing.\n // Registry deps, we take what's in the lockfile.\n if (lock.resolved || (spec.type && !spec.registry)) {\n if (spec.registry) {\n meta.resolved = lock.resolved\n } else if (spec.type === 'file') {\n meta.resolved = consistentResolve(spec, this.path, this.path, true)\n } else if (spec.fetchSpec) {\n meta.resolved = spec.fetchSpec\n }\n }\n\n // at this point, if still we don't have a version, do our best to\n // infer it from the tarball url/file. This works a surprising\n // amount of the time, even though it's not guaranteed.\n if (!meta.version) {\n if (spec.type === 'file' || spec.type === 'remote') {\n const fromTgz = versionFromTgz(spec.name, spec.fetchSpec) ||\n versionFromTgz(spec.name, meta.resolved)\n if (fromTgz) {\n meta.version = fromTgz.version\n if (fromTgz.name !== name) {\n meta.name = fromTgz.name\n }\n }\n } else if (spec.type === 'alias') {\n meta.name = spec.subSpec.name\n meta.version = spec.subSpec.fetchSpec\n } else if (spec.type === 'version') {\n meta.version = spec.fetchSpec\n }\n // ok, I did my best! good luck!\n }\n\n if (lock.bundled) {\n meta.inBundle = true\n }\n\n // save it for next time\n return this.data.packages[location] = meta\n }\n\n add (node) {\n if (!this.data) {\n throw new Error('run load() before getting or setting data')\n }\n\n // will be actually updated on read\n const loc = relpath(this.path, node.path)\n if (node.path === this.path) {\n this.tree = node\n }\n\n // if we have metadata about this node, and it's a match, then\n // try to decorate it.\n if (node.resolved === null || node.integrity === null) {\n const {\n resolved,\n integrity,\n version,\n } = this.get(node.path)\n\n let pathFixed = null\n if (resolved) {\n if (!/^file:/.test(resolved)) {\n pathFixed = resolved\n } else {\n pathFixed = `file:${resolve(this.path, resolved.slice(5))}`\n }\n }\n\n // if we have one, only set the other if it matches\n // otherwise it could be for a completely different thing.\n const resolvedOk = !resolved || !node.resolved ||\n node.resolved === pathFixed\n const integrityOk = !integrity || !node.integrity ||\n node.integrity === integrity\n const versionOk = !version || !node.version || version === node.version\n\n const allOk = (resolved || integrity || version) &&\n resolvedOk && integrityOk && versionOk\n\n if (allOk) {\n node.resolved = node.resolved || pathFixed || null\n node.integrity = node.integrity || integrity || null\n } else {\n // try to read off the package or node itself\n const {\n resolved,\n integrity,\n } = Shrinkwrap.metaFromNode(node, this.path, this.resolveOptions)\n node.resolved = node.resolved || resolved || null\n node.integrity = node.integrity || integrity || null\n }\n }\n this.#awaitingUpdate.set(loc, node)\n }\n\n addEdge (edge) {\n if (!this.yarnLock || !edge.valid) {\n return\n }\n\n const { to: node } = edge\n\n // if it's already set up, nothing to do\n if (node.resolved !== null && node.integrity !== null) {\n return\n }\n\n // if the yarn lock is empty, nothing to do\n if (!this.yarnLock.entries || !this.yarnLock.entries.size) {\n return\n }\n\n // we relativize the path here because that's how it shows up in the lock\n // XXX why is this different from pathFixed in this.add??\n let pathFixed = null\n if (node.resolved) {\n if (!/file:/.test(node.resolved)) {\n pathFixed = node.resolved\n } else {\n pathFixed = consistentResolve(node.resolved, node.path, this.path, true)\n }\n }\n\n const spec = npa(`${node.name}@${edge.spec}`)\n const entry = this.yarnLock.entries.get(`${node.name}@${edge.spec}`)\n\n if (!entry ||\n mismatch(node.version, entry.version) ||\n mismatch(node.integrity, entry.integrity) ||\n mismatch(pathFixed, entry.resolved)) {\n return\n }\n\n if (entry.resolved && yarnRegRe.test(entry.resolved) && spec.registry) {\n entry.resolved = entry.resolved.replace(yarnRegRe, 'https://registry.npmjs.org/')\n }\n\n node.integrity = node.integrity || entry.integrity || null\n node.resolved = node.resolved ||\n consistentResolve(entry.resolved, this.path, node.path) || null\n\n this.#awaitingUpdate.set(relpath(this.path, node.path), node)\n }\n\n #updateWaitingNode (loc) {\n const node = this.#awaitingUpdate.get(loc)\n this.#awaitingUpdate.delete(loc)\n this.data.packages[loc] = Shrinkwrap.metaFromNode(\n node,\n this.path,\n this.resolveOptions)\n }\n\n commit () {\n if (this.tree) {\n if (this.yarnLock) {\n this.yarnLock.fromTree(this.tree)\n }\n const root = Shrinkwrap.metaFromNode(\n this.tree.target,\n this.path,\n this.resolveOptions)\n // record the canonical packageExtensions hash on the root entry so npm ci can detect stale extension state\n if (this.packageExtensionsHash) {\n root.packageExtensionsHash = this.packageExtensionsHash\n }\n // record the .npm-extension file hash on the root entry for the same reason\n if (this.npmExtensionHash) {\n root.npmExtensionHash = this.npmExtensionHash\n }\n this.data.packages = {}\n if (Object.keys(root).length) {\n this.data.packages[''] = root\n }\n for (const node of this.tree.root.inventory.values()) {\n // only way this.tree is not root is if the root is a link to it\n if (node === this.tree || node.isRoot || node.location === '') {\n continue\n }\n const loc = relpath(this.path, node.path)\n // Drop lockfile entries for extraneous nodes outside node_modules that\n // are direct fsChildren of the root (or detached link targets). These\n // are stale top-level entries: a workspace or file: dep removed from\n // the root manifest, or whose directory was deleted. Extraneous\n // fsChildren nested under another package (e.g. a file: dep of another\n // file: dep) are kept so `npm ci` can resolve the parent's dependency.\n if (node.extraneous && !/(^|\\/)node_modules\\//.test(loc) && loc !== 'node_modules' &&\n (!node.fsParent || node.fsParent.isRoot)) {\n continue\n }\n const meta = Shrinkwrap.metaFromNode(\n node,\n this.path,\n this.resolveOptions)\n // Skip inert nodes — these are optional deps that failed to load\n // (e.g. 404 from a proxy registry that hasn't cached the package,\n // or incomplete manifest missing version field).\n // #pruneFailedOptional marks them inert so they won't be reified;\n // writing them to the lockfile produces invalid entries like\n // {\"optional\": true} that cause \"Invalid Version:\" errors.\n if (node.inert && !node.package.version) {\n continue\n }\n this.data.packages[loc] = meta\n }\n } else if (this.#awaitingUpdate.size > 0) {\n for (const loc of this.#awaitingUpdate.keys()) {\n this.#updateWaitingNode(loc)\n }\n }\n\n // if we haven't set it by now, use the default\n if (!this.lockfileVersion) {\n this.lockfileVersion = defaultLockfileVersion\n }\n // patched nodes force lockfileVersion 4 so older clients abort the install\n // the hidden lockfile is an internal cache pinned to version 3, so it never drives this upgrade\n const hasPatched = !this.hiddenLockfile &&\n Object.values(this.data.packages).some(p => p.patched)\n if (hasPatched && this.lockfileVersion < patchedLockfileVersion) {\n log.warn('shrinkwrap', `patchedDependencies requires lockfileVersion ${patchedLockfileVersion}; upgrading the lockfile from version ${this.lockfileVersion}.`)\n this.lockfileVersion = patchedLockfileVersion\n }\n // packageExtensions and .npm-extension state likewise force lockfileVersion 4 so older clients abort instead of dropping the repaired graph\n const hasExtensionState = !this.hiddenLockfile &&\n (this.packageExtensionsHash || this.npmExtensionHash ||\n Object.values(this.data.packages).some(p => p.packageExtensionsApplied || p.npmExtensionApplied))\n if (hasExtensionState && this.lockfileVersion < packageExtensionsLockfileVersion) {\n log.warn('shrinkwrap', `manifest extensions require lockfileVersion ${packageExtensionsLockfileVersion}; upgrading the lockfile from version ${this.lockfileVersion}.`)\n this.lockfileVersion = packageExtensionsLockfileVersion\n }\n this.data.lockfileVersion = this.lockfileVersion\n\n // hidden lockfiles don't include legacy metadata or a root entry\n if (this.hiddenLockfile) {\n delete this.data.packages['']\n delete this.data.dependencies\n } else if (this.tree && this.lockfileVersion <= 3) {\n this.#buildLegacyLockfile(this.tree, this.data)\n }\n\n // lf version 1 = dependencies only\n // lf version 2 = dependencies and packages\n // lf version 3 = packages only\n if (this.lockfileVersion >= 3) {\n const { dependencies, ...data } = this.data\n return data\n } else if (this.lockfileVersion < 2) {\n const { packages, ...data } = this.data\n return data\n } else {\n return { ...this.data }\n }\n }\n\n #buildLegacyLockfile (node, lock, path = []) {\n if (node === this.tree) {\n // the root node\n lock.name = node.packageName || node.name\n if (node.version) {\n lock.version = node.version\n }\n }\n\n // npm v6 and before tracked 'from', meaning \"the request that led\n // to this package being installed\". However, that's inherently\n // racy and non-deterministic in a world where deps are deduped\n // ahead of fetch time. In order to maintain backwards compatibility\n // with v6 in the lockfile, we do this trick where we pick a valid\n // dep link out of the edgesIn set. Choose the edge with the fewest\n // number of `node_modules` sections in the requestor path, and then\n // lexically sort afterwards.\n const edge = [...node.edgesIn].filter(e => e.valid).sort((a, b) => {\n const aloc = a.from.location.split('node_modules')\n const bloc = b.from.location.split('node_modules')\n /* istanbul ignore next - sort calling order is indeterminate */\n if (aloc.length > bloc.length) {\n return 1\n }\n if (bloc.length > aloc.length) {\n return -1\n }\n return localeCompare(aloc[aloc.length - 1], bloc[bloc.length - 1])\n })[0]\n\n const res = consistentResolve(node.resolved, this.path, this.path, true)\n const rSpec = specFromResolved(res)\n\n // if we don't have anything (ie, it's extraneous) then use the resolved\n // value as if that was where we got it from, since at least it's true.\n // if we don't have either, just an empty object so nothing matches below.\n // This will effectively just save the version and resolved, as if it's\n // a standard version/range dep, which is a reasonable default.\n let spec = rSpec\n if (edge) {\n spec = npa.resolve(node.name, edge.spec, edge.from.realpath)\n }\n\n if (node.isLink) {\n lock.version = `file:${relpath(this.path, node.realpath)}`\n } else if (spec && (spec.type === 'file' || spec.type === 'remote')) {\n lock.version = spec.saveSpec\n } else if (spec && spec.type === 'git' || rSpec.type === 'git') {\n lock.version = node.resolved\n /* istanbul ignore else - don't think there are any cases where a git\n * spec (or indeed, ANY npa spec) doesn't have a .raw member */\n if (spec.raw) {\n lock.from = spec.raw\n }\n } else if (!node.isRoot &&\n node.package &&\n node.packageName &&\n node.packageName !== node.name) {\n lock.version = `npm:${node.packageName}@${node.version}`\n } else if (node.package && node.version) {\n lock.version = node.version\n }\n\n if (node.inDepBundle) {\n lock.bundled = true\n }\n\n // when we didn't resolve to git, file, or dir, and didn't request\n // git, file, dir, or remote, then the resolved value is necessary.\n if (node.resolved &&\n !node.isLink &&\n rSpec.type !== 'git' &&\n rSpec.type !== 'file' &&\n rSpec.type !== 'directory' &&\n spec.type !== 'directory' &&\n spec.type !== 'git' &&\n spec.type !== 'file' &&\n spec.type !== 'remote') {\n lock.resolved = overrideResolves(node.resolved, this.resolveOptions)\n }\n\n if (node.integrity) {\n lock.integrity = node.integrity\n }\n\n if (node.extraneous) {\n lock.extraneous = true\n } else if (!node.isLink) {\n if (node.peer) {\n lock.peer = true\n }\n\n if (node.devOptional && !node.dev && !node.optional) {\n lock.devOptional = true\n }\n\n if (node.dev) {\n lock.dev = true\n }\n\n if (node.optional) {\n lock.optional = true\n }\n }\n\n const depender = node.target\n if (depender.edgesOut.size > 0) {\n if (node !== this.tree) {\n const entries = [...depender.edgesOut.entries()]\n lock.requires = entries.reduce((set, [k, v]) => {\n // omit peer deps from legacy lockfile requires field, because\n // npm v6 doesn't handle peer deps, and this triggers some bad\n // behavior if the dep can't be found in the dependencies list.\n const { spec, peer } = v\n if (peer) {\n return set\n }\n if (spec.startsWith('file:')) {\n // turn absolute file: paths into relative paths from the node\n // this especially shows up with workspace edges when the root\n // node is also a workspace in the set.\n const p = resolve(node.realpath, spec.slice('file:'.length))\n set[k] = `file:${relpath(node.realpath, p)}`\n } else {\n set[k] = spec\n }\n return set\n }, {})\n } else {\n lock.requires = true\n }\n }\n\n // now we walk the children, putting them in the 'dependencies' object\n const { children } = node.target\n if (!children.size) {\n delete lock.dependencies\n } else {\n const kidPath = [...path, node.realpath]\n const dependencies = {}\n // skip any that are already in the descent path, so cyclical link\n // dependencies don't blow up with ELOOP.\n let found = false\n for (const [name, kid] of children.entries()) {\n if (path.includes(kid.realpath)) {\n continue\n }\n dependencies[name] = this.#buildLegacyLockfile(kid, {}, kidPath)\n found = true\n }\n if (found) {\n lock.dependencies = dependencies\n }\n }\n return lock\n }\n\n toJSON () {\n if (!this.data) {\n throw new Error('run load() before getting or setting data')\n }\n\n return this.commit()\n }\n\n toString (options = {}) {\n const data = this.toJSON()\n const { format = true } = options\n const defaultIndent = this.indent || 2\n const indent = format === true ? defaultIndent\n : format || 0\n const eol = format ? this.newline || '\\n' : ''\n return stringify(data, swKeyOrder, indent).replace(/\\n/g, eol)\n }\n\n save (options = {}) {\n if (!this.data) {\n throw new Error('run load() before saving data')\n }\n\n // This must be called before the lockfile conversion check below since it sets properties as part of `commit()`\n const json = this.toString(options)\n if (\n !this.hiddenLockfile\n && this.originalLockfileVersion !== undefined\n && this.originalLockfileVersion !== this.lockfileVersion\n ) {\n log.warn(\n 'shrinkwrap',\n `Converting lock file (${relative(process.cwd(), this.filename)}) from v${this.originalLockfileVersion} -> v${this.lockfileVersion}`\n )\n }\n\n return Promise.all([\n writeFile(this.filename, json).catch(er => {\n if (this.hiddenLockfile) {\n // well, we did our best.\n // if we reify, and there's nothing there, then it might be lacking\n // a node_modules folder, but then the lockfile is not important.\n // Remove the file, so that in case there WERE deps, but we just\n // failed to update the file for some reason, it's not out of sync.\n return rm(this.filename, { recursive: true, force: true })\n }\n throw er\n }),\n this.yarnLock && this.yarnLock.entries.size &&\n writeFile(this.path + '/yarn.lock', this.yarnLock.toString()),\n ])\n }\n}\n\nmodule.exports = Shrinkwrap\n","// when an optional dep fails to install, we need to remove the branch of the\n// graph up to the first optionalDependencies, as well as any nodes that are\n// only required by other nodes in the set.\n//\n// This function finds the set of nodes that will need to be removed in that\n// case.\n//\n// Note that this is *only* going to work with trees where calcDepFlags\n// has been called, because we rely on the node.optional flag.\n\nconst gatherDepSet = require('./gather-dep-set.js')\nconst optionalSet = node => {\n // start with the node, then walk up the dependency graph until we\n // get to the boundaries that define the optional set. since the\n // node is optional, we know that all paths INTO this area of the\n // graph are optional, but there may be non-optional dependencies\n // WITHIN the area.\n const set = new Set([node])\n for (const node of set) {\n for (const edge of node.edgesIn) {\n if (!edge.optional) {\n set.add(edge.from)\n }\n }\n }\n\n // now that we've hit the boundary, gather the rest of the nodes in\n // the optional section that don't have dependents outside the set.\n return gatherDepSet(set, edge => !set.has(edge.to) && !edge.from?.inert)\n}\n\nmodule.exports = optionalSet\n","// Sometimes we need to actually do a walk from the root, because you can\n// have a cycle of deps that all depend on each other, but no path from root.\n// Also, since the ideal tree is loaded from the shrinkwrap, it had extraneous\n// flags set false that might now be actually extraneous, and dev/optional\n// flags that are also now incorrect. This method sets all flags to true, so\n// we can find the set that is actually extraneous.\nmodule.exports = tree => {\n for (const node of tree.inventory.values()) {\n node.resetDepFlags()\n }\n}\n","// mixin implementing the buildIdealTree method\nconst localeCompare = require('@isaacs/string-locale-compare')('en')\nconst PackageJson = require('@npmcli/package-json')\nconst npa = require('npm-package-arg')\nconst pacote = require('pacote')\nconst cacache = require('cacache')\nconst { callLimit: promiseCallLimit } = require('promise-call-limit')\nconst realpath = require('../../lib/realpath.js')\nconst { resolve, dirname, sep } = require('node:path')\nconst treeCheck = require('../tree-check.js')\nconst { readdirScoped } = require('@npmcli/fs')\nconst { lstat, readlink } = require('node:fs/promises')\nconst { depth } = require('treeverse')\nconst { log, time } = require('proc-log')\nconst { redact } = require('@npmcli/redact')\n\nconst {\n OK,\n REPLACE,\n CONFLICT,\n} = require('../can-place-dep.js')\nconst PlaceDep = require('../place-dep.js')\n\nconst debug = require('../debug.js')\nconst fromPath = require('../from-path.js')\nconst calcDepFlags = require('../calc-dep-flags.js')\nconst { isReleaseAgeExcluded, trustedSpecName } = require('../release-age-exclude.js')\nconst { resolvePatchedDependencies } = require('../patched-dependencies.js')\nconst PackageExtensions = require('../package-extensions.js')\nconst NpmExtension = require('../npm-extension.js')\nconst { hasExtensionFile } = require('../npm-extension.js')\nconst Shrinkwrap = require('../shrinkwrap.js')\nconst { defaultLockfileVersion } = Shrinkwrap\nconst Node = require('../node.js')\nconst Link = require('../link.js')\n\n// Maps a parsed spec.type to the corresponding allow-* arborist option name.\n// Hoisted to module scope so #checkAllow doesn't re-allocate it per call.\nconst ALLOW_OPTION_FOR_TYPE = {\n git: 'allowGit',\n remote: 'allowRemote',\n file: 'allowFile',\n directory: 'allowDirectory',\n}\nconst addRmPkgDeps = require('../add-rm-pkg-deps.js')\nconst optionalSet = require('../optional-set.js')\nconst { checkEngine, checkPlatform } = require('npm-install-checks')\nconst relpath = require('../relpath.js')\nconst resetDepFlags = require('../reset-dep-flags.js')\n\n// note: some of these symbols are shared so we can hit\n// them with unit tests and reuse them across mixins\nconst _updateAll = Symbol.for('updateAll')\nconst _flagsSuspect = Symbol.for('flagsSuspect')\nconst _setWorkspaces = Symbol.for('setWorkspaces')\nconst _updateNames = Symbol.for('updateNames')\nconst _resolvedAdd = Symbol.for('resolvedAdd')\nconst _rpcache = Symbol.for('realpathCache')\nconst _stcache = Symbol.for('statCache')\n\n// used by Reify mixin\nconst _addNodeToTrashList = Symbol.for('addNodeToTrashList')\n\n// Push items in, pop them sorted by depth and then path\n// Sorts physically shallower deps up to the front of the queue, because\n// they'll affect things deeper in, then alphabetical for consistency between\n// installs\nclass DepsQueue {\n #deps = []\n #sorted = true\n\n get length () {\n return this.#deps.length\n }\n\n push (item) {\n if (!this.#deps.includes(item)) {\n this.#sorted = false\n this.#deps.push(item)\n }\n }\n\n pop () {\n if (!this.#sorted) {\n this.#deps.sort((a, b) => (a.depth - b.depth) || localeCompare(a.path, b.path))\n this.#sorted = true\n }\n return this.#deps.shift()\n }\n}\n\nmodule.exports = cls => class IdealTreeBuilder extends cls {\n #complete\n #currentDep = null\n #depsQueue = new DepsQueue()\n #depsSeen = new Set()\n #explicitRequests = new Set()\n #follow\n #installStrategy\n #linkNodes = new Set()\n #loadFailures = new Set()\n #manifests = new Map()\n #mutateTree = false\n #packageExtensions = null\n #npmExtension = null\n #requestedTreeMutation = false\n // a map of each module in a peer set to the thing that depended on\n // that set of peers in the first place. Use a WeakMap so that we\n // don't hold onto references for nodes that are garbage collected.\n #peerSetSource = new WeakMap()\n #preferDedupe = false\n #prune\n #strictPeerDeps\n #virtualRoots = new Map()\n\n constructor (options) {\n super(options)\n\n const {\n follow = false,\n installStrategy = 'hoisted',\n strictPeerDeps = false,\n global,\n } = options\n\n this.#strictPeerDeps = !!strictPeerDeps\n\n this.#installStrategy = global ? 'shallow' : installStrategy\n this.#follow = !!follow\n\n this[_updateAll] = false\n this[_updateNames] = []\n this[_resolvedAdd] = []\n\n // caches for cached realpath calls\n const cwd = process.cwd()\n // assume that the cwd is real enough for our purposes\n this[_rpcache] = new Map([[cwd, cwd]])\n this[_stcache] = new Map()\n this[_flagsSuspect] = false\n }\n\n get explicitRequests () {\n return new Set(this.#explicitRequests)\n }\n\n // public method\n async buildIdealTree (options = {}) {\n if (this.idealTree) {\n return this.idealTree\n }\n\n // allow the user to set reify options on the ctor as well.\n // XXX: deprecate separate reify() options object.\n options = { ...this.options, ...options }\n\n // an empty array or any falsey value is the same as null\n if (!options.add || options.add.length === 0) {\n options.add = null\n }\n if (!options.rm || options.rm.length === 0) {\n options.rm = null\n }\n\n const timeEnd = time.start('idealTree')\n\n if (!options.add && !options.rm && !options.update && this.options.global) {\n throw new Error('global requires add, rm, or update option')\n }\n\n // first get the virtual tree, if possible. If there's a lockfile, then\n // that defines the ideal tree, unless the root package.json is not\n // satisfied by what the ideal tree provides.\n // from there, we start adding nodes to it to satisfy the deps requested\n // by the package.json in the root.\n\n this.#parseSettings(options)\n\n // start tracker block\n this.addTracker('idealTree')\n\n try {\n await this.#initTree()\n await this.#loadNpmExtension()\n this.#loadPackageExtensions()\n await this.#inflateAncientLockfile()\n await this.#applyUserRequests(options)\n await this.#buildDeps()\n await this.#fixDepFlags()\n await this.#pruneFailedOptional()\n await this.#checkEngineAndPlatform()\n await resolvePatchedDependencies(this.idealTree, {\n path: this.path,\n allowUnusedPatches: this.options.allowUnusedPatches,\n rm: options.rm || [],\n })\n this.#warnWorkspacePackageExtensions()\n this.#warnWorkspaceNpmExtension()\n } finally {\n timeEnd()\n this.finishTracker('idealTree')\n }\n\n return treeCheck(this.idealTree)\n }\n\n async #checkEngineAndPlatform () {\n const { engineStrict, npmVersion, nodeVersion, omit = [], cpu, os, libc } = this.options\n const omitSet = new Set(omit)\n\n for (const node of this.idealTree.inventory.values()) {\n if (!node.optional && !node.shouldOmit(omitSet)) {\n try {\n // if devEngines is present in the root node we ignore the engines check\n if (!(node.isRoot && node.package.devEngines)) {\n checkEngine(node.package, npmVersion, nodeVersion, this.options.force)\n }\n } catch (err) {\n if (engineStrict) {\n throw err\n }\n log.warn(err.code, err.message, {\n package: err.pkgid,\n required: err.required,\n current: err.current,\n })\n }\n checkPlatform(node.package, this.options.force)\n }\n if (node.optional && !node.inert) {\n // Mark any optional packages we can't install as inert.\n // We ignore the --force and --engine-strict flags.\n try {\n checkEngine(node.package, npmVersion, nodeVersion, false)\n checkPlatform(node.package, false, { cpu, os, libc })\n } catch (error) {\n const set = optionalSet(node)\n for (const node of set) {\n node.inert = true\n }\n }\n }\n }\n }\n\n // Load the root project's packageExtensions rule set.\n // Only the workspace root is authoritative, matching the root-only model of overrides.\n // The canonical hash is stashed on the lockfile meta so commit() can persist it.\n #loadPackageExtensions () {\n const rootPkg = this.idealTree.target.package\n const lockedHash = this.idealTree.meta.packageExtensionsHash\n this.#packageExtensions = new PackageExtensions(rootPkg.packageExtensions)\n this.idealTree.meta.packageExtensionsHash = this.#packageExtensions.hash\n\n // When the rule set has changed since the lockfile was written, the locked manifests for affected packages are stale.\n // The locked manifest is the effective, already-extended manifest, so detach those nodes and rebuild them from fresh manifests under the current rules.\n if (this.idealTree.meta.loadedFromDisk && lockedHash !== this.#packageExtensions.hash) {\n for (const node of [...this.idealTree.inventory.values()]) {\n if (node.isProjectRoot || node.isWorkspace || node.isTop) {\n continue\n }\n // a node is affected if it carries provenance from the old rules or matches a current selector\n const affected = node.packageExtensionsApplied ||\n this.#packageExtensions.wouldMatch(node.packageName, node.version)\n if (affected) {\n for (const edge of node.edgesIn) {\n this.#depsQueue.push(edge.from)\n }\n node.parent = null\n }\n }\n }\n }\n\n // Apply a matching root packageExtension to a copy of a candidate manifest.\n // Returns the possibly-extended manifest and the provenance to attach to the node.\n // Workspace candidates are never extended; that warning is emitted separately.\n #applyPackageExtension (pkg) {\n if (!this.#packageExtensions?.present) {\n return { pkg, applied: null }\n }\n const res = this.#packageExtensions.apply(pkg)\n return res ? { pkg: res.pkg, applied: res.applied } : { pkg, applied: null }\n }\n\n // Load the root project's .npm-extension file and its transformManifest export.\n // ignore-extension (and, via flatten, ignore-scripts) disables discovery and execution; the lockfile then carries no extension state.\n // The selected file's hash is stashed on the lockfile meta so commit() can persist it and npm ci can detect stale extension state.\n async #loadNpmExtension () {\n const lockedHash = this.idealTree.meta.npmExtensionHash\n // ignore-extension (and, via flatten, ignore-scripts) disables discovery and execution.\n // Leave any locked extension state untouched so npm ci reifies the locked graph as-is and the lockfile stays internally consistent.\n if (this.options.ignoreExtension) {\n return\n }\n const ext = new NpmExtension({\n root: this.idealTree.realpath,\n extensionFile: this.options.extensionFile,\n })\n this.#npmExtension = ext\n this.idealTree.meta.npmExtensionHash = ext.hash\n if (ext.present) {\n await ext.load()\n }\n\n // When the extension file changed since the lockfile was written, locked manifests may no longer reflect its output.\n // This also covers removal: a now-absent file hashes to null, which differs from the locked hash and reverts the previously transformed nodes.\n // Arbitrary code has no selector to predict which packages it affects, so re-resolve any node that carried old provenance or that the current file now transforms.\n if (this.idealTree.meta.loadedFromDisk && lockedHash !== ext.hash) {\n for (const node of [...this.idealTree.inventory.values()]) {\n if (node.isProjectRoot || node.isWorkspace || node.isTop || node.isLink) {\n continue\n }\n // A node with old provenance carries an already-transformed manifest, so always refetch it.\n // Otherwise probe the locked manifest (without caching, so the authoritative full-manifest fetch is not pre-seeded).\n // The locked manifest carries every resolution-relevant field (name, version, dependencies, peer metadata); a transform that newly targets a node by a field not persisted in the lockfile is the documented edge that may need a manual re-lock.\n const affected = node.npmExtensionApplied || ext.apply(node.package, { memoize: false })\n if (affected) {\n for (const edge of node.edgesIn) {\n this.#depsQueue.push(edge.from)\n }\n node.parent = null\n }\n }\n }\n }\n\n // Apply the root transformManifest to a copy of a candidate manifest, before any packageExtensions rule.\n // Returns the possibly-transformed manifest and the provenance to attach to the node.\n #applyNpmExtension (pkg) {\n const res = this.#npmExtension?.apply(pkg)\n return res ? { pkg: res.pkg, applied: res.applied } : { pkg, applied: null }\n }\n\n // Warn when packageExtensions appears in a non-root workspace, or when a root selector matches a workspace member.\n // Workspace package manifests are edited directly and are never extension targets.\n #warnWorkspacePackageExtensions () {\n if (!this.#packageExtensions?.present) {\n return\n }\n for (const node of this.idealTree.inventory.values()) {\n // a workspace is in the inventory as both a Link and its target node; warn once by skipping the link\n if (!node.isWorkspace || node.isLink) {\n continue\n }\n if (node.package.packageExtensions !== undefined) {\n log.warn('packageExtensions',\n `\"packageExtensions\" in workspace ${node.name} is ignored; it is only honored at the workspace root`)\n }\n if (this.#packageExtensions.wouldMatch(node.name, node.version)) {\n log.warn('packageExtensions',\n `selector matches workspace package ${node.name}@${node.version}; edit its package.json directly instead of using packageExtensions`)\n }\n }\n }\n\n // Warn when a non-root workspace package contains a .npm-extension file; only the workspace root's file is honored.\n #warnWorkspaceNpmExtension () {\n for (const node of this.idealTree.inventory.values()) {\n // a workspace is in the inventory as both a Link and its target node; warn once by skipping the link\n if (!node.isWorkspace || node.isLink || node.isProjectRoot) {\n continue\n }\n if (hasExtensionFile(node.realpath)) {\n log.warn('npm-extension',\n `\".npm-extension\" in workspace ${node.name} is ignored; it is only honored at the workspace root`)\n }\n }\n }\n\n #parseSettings (options) {\n const update = options.update === true ? { all: true }\n : Array.isArray(options.update) ? { names: options.update }\n : options.update || {}\n\n if (update.all || !Array.isArray(update.names)) {\n update.names = []\n }\n\n this.#complete = !!options.complete\n this.#preferDedupe = !!options.preferDedupe\n\n // validates list of update names, they must\n // be dep names only, no semver ranges are supported\n for (const name of update.names) {\n const spec = npa(name)\n const validationError =\n new TypeError(`Update arguments must only contain package names, eg:\n npm update ${spec.name}`)\n validationError.code = 'EUPDATEARGS'\n\n // If they gave us anything other than a bare package name\n if (spec.raw !== spec.name) {\n throw validationError\n }\n }\n this[_updateNames] = update.names\n\n this[_updateAll] = update.all\n // we prune by default unless explicitly set to boolean false\n this.#prune = options.prune !== false\n\n // set if we add anything, but also set here if we know we'll make\n // changes and thus have to maybe prune later.\n this.#requestedTreeMutation = !!(\n options.add ||\n options.rm ||\n update.all ||\n update.names.length\n )\n this.#mutateTree = this.#requestedTreeMutation\n }\n\n // load the initial tree, either the virtualTree from a shrinkwrap,\n // or just the root node from a package.json\n async #initTree () {\n const timeEnd = time.start('idealTree:init')\n let root\n if (this.options.global) {\n root = await this.#globalRootNode()\n } else {\n try {\n const { content: pkg } = await PackageJson.normalize(this.path)\n root = await this.#rootNodeFromPackage(pkg)\n } catch (err) {\n if (err.code === 'EJSONPARSE') {\n throw err\n }\n root = await this.#rootNodeFromPackage({})\n }\n }\n return this[_setWorkspaces](root)\n // ok to not have a virtual tree. probably initial install.\n // When updating all, we load the shrinkwrap, but don't bother\n // to build out the full virtual tree from it, since we'll be\n // reconstructing it anyway.\n .then(root => {\n if (this.options.global) {\n return root\n } else if (!this.options.usePackageLock || this[_updateAll]) {\n return Shrinkwrap.reset({\n path: this.path,\n lockfileVersion: this.options.lockfileVersion,\n resolveOptions: this.options,\n }).then(meta => Object.assign(root, { meta }))\n } else {\n return this.loadVirtual({ root })\n }\n })\n\n // if we don't have a lockfile to go from, then start with the\n // actual tree, so we only make the minimum required changes.\n // don't do this for global installs or updates, because in those\n // cases we don't use a lockfile anyway.\n // Load on a new Arborist object, so the Nodes aren't the same,\n // or else it'll get super confusing when we change them!\n .then(async root => {\n if ((!this[_updateAll] && !this.options.global && !root.meta.loadedFromDisk) || (this.options.global && this[_updateNames].length)) {\n await new this.constructor(this.options).loadActual({ root })\n const tree = root.target\n // even though we didn't load it from a package-lock.json FILE,\n // we still loaded it \"from disk\", meaning we have to reset\n // dep flags before assuming that any mutations were reflected.\n if (tree.children.size) {\n root.meta.loadedFromDisk = true\n // set these so that we don't try to ancient lockfile reload it\n root.meta.originalLockfileVersion = root.meta.lockfileVersion = this.options.lockfileVersion || defaultLockfileVersion\n }\n }\n root.meta.inferFormattingOptions(root.package)\n return root\n })\n\n .then(tree => {\n // search the virtual tree for missing/invalid edges, if any are found add their source to\n // the depsQueue so that we'll fix it later\n depth({\n tree,\n getChildren: (node) => {\n const children = []\n for (const edge of node.edgesOut.values()) {\n children.push(edge.to)\n }\n return children\n },\n filter: node => node,\n visit: node => {\n for (const edge of node.edgesOut.values()) {\n const skipPeerOptional = edge.type === 'peerOptional' &&\n this.options.save === false &&\n !this.#requestedTreeMutation\n if (!skipPeerOptional && (!edge.to || !edge.valid)) {\n this.#depsQueue.push(node)\n break // no need to continue the loop after the first hit\n }\n }\n },\n })\n // null the virtual tree, because we're about to hack away at it\n // if you want another one, load another copy.\n this.idealTree = tree\n this.virtualTree = null\n timeEnd()\n return tree\n })\n }\n\n async #globalRootNode () {\n const root = await this.#rootNodeFromPackage({ dependencies: {} })\n // this is a gross kludge to handle the fact that we don't save\n // metadata on the root node in global installs, because the \"root\"\n // node is something like /usr/local/lib.\n const meta = new Shrinkwrap({\n path: this.path,\n lockfileVersion: this.options.lockfileVersion,\n resolveOptions: this.options,\n })\n meta.reset()\n root.meta = meta\n return root\n }\n\n async #rootNodeFromPackage (pkg) {\n // if the path doesn't exist, then we explode at this point. Note that\n // this is not a problem for reify(), since it creates the root path\n // before ever loading trees.\n // TODO: make buildIdealTree() and loadActual handle a missing root path,\n // or a symlink to a missing target, and let reify() create it as needed.\n const real = await realpath(this.path, this[_rpcache], this[_stcache])\n const Cls = real === this.path ? Node : Link\n const root = new Cls({\n path: this.path,\n realpath: real,\n pkg,\n extraneous: false,\n dev: false,\n devOptional: false,\n peer: false,\n optional: false,\n global: this.options.global,\n installLinks: this.installLinks,\n legacyPeerDeps: this.legacyPeerDeps,\n loadOverrides: true,\n })\n if (root.isLink) {\n root.target = new Node({\n path: real,\n realpath: real,\n pkg,\n extraneous: false,\n dev: false,\n devOptional: false,\n peer: false,\n optional: false,\n global: this.options.global,\n installLinks: this.installLinks,\n legacyPeerDeps: this.legacyPeerDeps,\n loadOverrides: true,\n root,\n })\n }\n return root\n }\n\n // process the add/rm requests by modifying the root node, and the\n // update.names request by queueing nodes dependent on those named.\n async #applyUserRequests (options) {\n const timeEnd = time.start('idealTree:userRequests')\n const tree = this.idealTree.target\n\n if (!this.options.workspaces.length) {\n await this.#applyUserRequestsToNode(tree, options)\n } else {\n const nodes = this.workspaceNodes(tree, this.options.workspaces)\n if (this.options.includeWorkspaceRoot) {\n nodes.push(tree)\n }\n const appliedRequests = nodes.map(\n node => this.#applyUserRequestsToNode(node, options)\n )\n await Promise.all(appliedRequests)\n }\n\n timeEnd()\n }\n\n async #applyUserRequestsToNode (tree, options) {\n // If we have a list of package names to update, and we know it's\n // going to update them wherever they are, add any paths into those\n // named nodes to the buildIdealTree queue.\n if (!this.options.global && this[_updateNames].length) {\n this.#queueNamedUpdates()\n }\n\n // global updates only update the globalTop nodes, but we need to know\n // that they're there, and not reinstall the world unnecessarily.\n const globalExplicitUpdateNames = []\n if (this.options.global && (this[_updateAll] || this[_updateNames].length)) {\n const nm = resolve(this.path, 'node_modules')\n const paths = await readdirScoped(nm).catch(() => [])\n for (const p of paths) {\n const name = p.replace(/\\\\/g, '/')\n // Match loadActual behavior: hidden entries and retired scoped package\n // folders are not installed global packages.\n if (/^(@[^/]+\\/)?\\./.test(name)) {\n continue\n }\n const updateName = this[_updateNames].includes(name)\n if (this[_updateAll] || updateName) {\n if (updateName) {\n globalExplicitUpdateNames.push(name)\n }\n const dir = resolve(nm, name)\n const st = await lstat(dir)\n .catch(/* istanbul ignore next */ () => null)\n if (st && st.isSymbolicLink()) {\n const target = await readlink(dir)\n const real = resolve(dirname(dir), target)\n tree.package.dependencies[name] = `file:${real}`\n } else {\n tree.package.dependencies[name] = '*'\n }\n }\n }\n }\n\n if (this.auditReport && this.auditReport.size > 0) {\n await this.#queueVulnDependents(options)\n }\n\n const { add, rm } = options\n\n if (rm && rm.length) {\n addRmPkgDeps.rm(tree.package, rm)\n for (const name of rm) {\n this.#explicitRequests.add({ from: tree, name, action: 'DELETE' })\n }\n }\n\n if (add && add.length) {\n await this.#add(tree, options)\n }\n\n // triggers a refresh of all edgesOut. this has to be done BEFORE\n // adding the edges to explicitRequests, because the package setter\n // resets all edgesOut.\n if (add && add.length || rm && rm.length || this.options.global) {\n tree.package = tree.package\n }\n\n for (const spec of this[_resolvedAdd]) {\n if (spec.tree === tree) {\n this.#explicitRequests.add(tree.edgesOut.get(spec.name))\n }\n }\n for (const name of globalExplicitUpdateNames) {\n this.#explicitRequests.add(tree.edgesOut.get(name))\n }\n\n this.#depsQueue.push(tree)\n }\n\n // This returns a promise because we might not have the name yet, and need to call pacote.manifest to find the name.\n async #add (tree, { add, saveType = null, saveBundle = false }) {\n // If we have a link it will need to be added relative to the target's path\n const path = tree.target.path\n\n // Get the name for each of the specs in the list.\n // e.g. doing `foo@bar` we just return foo but if it's a url or git, we don't know the name until we fetch it and look in its manifest.\n await Promise.all(add.map(async rawSpec => {\n // We do NOT provide the path to npa here, because user-additions need to be resolved relative to the tree being added to.\n let spec = npa(rawSpec)\n\n // if it's just @'' then we reload whatever's there, or get latest.\n // if it's an explicit tag, we need to install that specific tag version.\n const isTag = spec.rawSpec && spec.type === 'tag'\n\n // look up the names of file/directory/git specs\n if (!spec.name || isTag) {\n const _isRoot = tree.isProjectRoot || tree.isWorkspace\n const mani = await pacote.manifest(spec, {\n ...this.options,\n _isRoot,\n before: this.#releaseAgeBefore(spec),\n })\n if (isTag) {\n // translate tag to a version\n spec = npa(`${mani.name}@${mani.version}`)\n }\n spec.name = mani.name\n }\n\n const { name } = spec\n if (spec.type === 'file') {\n spec = npa(`file:${relpath(path, spec.fetchSpec)}`, path)\n spec.name = name\n } else if (spec.type === 'directory') {\n try {\n const real = await realpath(spec.fetchSpec, this[_rpcache], this[_stcache])\n spec = npa(`file:${relpath(path, real)}`, path)\n spec.name = name\n } catch {\n // TODO: create synthetic test case to simulate realpath failure\n }\n }\n spec.tree = tree\n this[_resolvedAdd].push(spec)\n }))\n\n // now this._resolvedAdd is a list of spec objects with names.\n // find a home for each of them!\n addRmPkgDeps.add({\n pkg: tree.package,\n add: this[_resolvedAdd],\n saveBundle,\n saveType,\n })\n }\n\n // TODO: provide a way to fix bundled deps by exposing metadata about\n // what's in the bundle at each published manifest. Without that, we\n // can't possibly fix bundled deps without breaking a ton of other stuff,\n // and leaving the user subject to getting it overwritten later anyway.\n async #queueVulnDependents (options) {\n for (const vuln of this.auditReport.values()) {\n // A fix is available in-range but a release-age window blocks the patched\n // version, so audit fix leaves this package at a vulnerable version.\n if (vuln.fixBlockedByReleaseAge) {\n const { version, before } = vuln.fixBlockedByReleaseAge\n const cutoff = new Date(before).toISOString().slice(0, 10)\n log.warn('audit', `A fix for ${vuln.name} is available (${vuln.name}@${version}) ` +\n `but was published after the configured release-age cutoff (${cutoff}), so ` +\n `${vuln.name} was left at a vulnerable version.\\n` +\n `To install it, add \"${vuln.name}\" to min-release-age-exclude, or relax ` +\n 'min-release-age or before.')\n }\n for (const node of vuln.nodes) {\n const bundler = node.getBundler()\n\n // XXX this belongs in the audit report itself, not here.\n // We shouldn't even get these things here, and they shouldn't\n // be printed by npm-audit-report as if they can be fixed, because\n // they can't.\n if (bundler) {\n log.warn(`audit fix ${node.name}@${node.version}`,\n `${node.location}\\nis a bundled dependency of\\n${\n bundler.name}@${bundler.version} at ${bundler.location}\\n` +\n 'It cannot be fixed automatically.\\n' +\n `Check for updates to the ${bundler.name} package.`)\n continue\n }\n\n for (const edge of node.edgesIn) {\n this.addTracker('idealTree', edge.from.name, edge.from.location)\n this.#depsQueue.push(edge.from)\n }\n }\n }\n\n // note any that can't be fixed at the root level without --force\n // if there's a fix, we use that. otherwise, the user has to remove it,\n // find a different thing, fix the upstream, etc.\n //\n // XXX: how to handle top nodes that aren't the root? Maybe the report\n // just tells the user to cd into that directory and fix it?\n if (this.options.force && this.auditReport && this.auditReport.topVulns.size) {\n options.add = options.add || []\n options.rm = options.rm || []\n const nodesTouched = new Set()\n for (const [name, topVuln] of this.auditReport.topVulns.entries()) {\n const {\n simpleRange,\n topNodes,\n fixAvailable,\n } = topVuln\n for (const node of topNodes) {\n if (!node.isProjectRoot && !node.isWorkspace) {\n // not something we're going to fix, sorry. have to cd into\n // that directory and fix it yourself.\n log.warn('audit', 'Manual fix required in linked project ' +\n `at ./${node.location} for ${name}@${simpleRange}.\\n` +\n `'cd ./${node.location}' and run 'npm audit' for details.`)\n continue\n }\n\n if (!fixAvailable) {\n log.warn('audit', `No fix available for ${name}@${simpleRange}`)\n continue\n }\n\n // name may be different if parent fixes the dep\n // see Vuln fixAvailable setter\n const { isSemVerMajor, version, name: fixName } = fixAvailable\n const breakingMessage = isSemVerMajor\n ? 'a SemVer major change'\n : 'outside your stated dependency range'\n log.warn('audit', `Updating ${fixName} to ${version}, ` +\n `which is ${breakingMessage}.`)\n\n await this.#add(node, { add: [`${fixName}@${version}`] })\n nodesTouched.add(node)\n }\n }\n for (const node of nodesTouched) {\n node.package = node.package\n }\n }\n }\n\n #avoidRange (name) {\n if (!this.auditReport) {\n return null\n }\n const vuln = this.auditReport.get(name)\n if (!vuln) {\n return null\n }\n return vuln.range\n }\n\n // Enforces the allow-git / allow-file / allow-directory / allow-remote configs at the arborist resolution layer, before any branching into the symlink (Link) path or the manifest-fetch path.\n // Pacote also enforces these inside FetcherBase.get() as defense-in-depth, but the symlink branch never reaches pacote, and the manifest cache here would bypass pacote on a cached hit.\n // Throws the same { code: EALLOW${TYPE} } shape pacote uses, so callers and downstream consumers stay consistent.\n #checkAllow (spec, edge) {\n const optName = ALLOW_OPTION_FOR_TYPE[spec.type]\n if (!optName) {\n return\n }\n const allow = this.options[optName] ?? 'all'\n if (allow === 'all') {\n return\n }\n const isRoot = !!(edge?.from?.isProjectRoot || edge?.from?.isWorkspace)\n if (allow !== 'none' && isRoot) {\n return\n }\n throw Object.assign(\n new Error(`Fetching${allow === 'root' ? ' non-root' : ''} packages of type \"${spec.type}\" have been disabled`),\n {\n code: `EALLOW${spec.type.toUpperCase()}`,\n package: spec.toString(),\n }\n )\n }\n\n // Builds a Node representing a spec we failed to load (allow-* gate, network failure, ENOTARGET, etc.) and records it in #loadFailures so #pruneFailedOptional can later decide whether the failure is fatal or silently dropped for optional deps.\n #failureNode (name, parent, error, edge) {\n error.requiredBy = edge?.from?.location || '.'\n const n = new Node({\n name,\n parent,\n error,\n installLinks: this.installLinks,\n legacyPeerDeps: this.legacyPeerDeps,\n })\n this.#loadFailures.add(n)\n return n\n }\n\n #queueNamedUpdates () {\n // ignore top nodes, since they are not loaded the same way, and\n // probably have their own project associated with them.\n\n // for every node with one of the names on the list, we add its\n // dependents to the queue to be evaluated. in buildDepStep,\n // anything on the update names list will get refreshed, even if\n // it isn't a problem.\n\n // XXX this could be faster by doing a series of inventory.query('name')\n // calls rather than walking over everything in the tree.\n for (const node of this.idealTree.inventory.values()) {\n // XXX add any invalid edgesOut to the queue\n if (this[_updateNames].includes(node.name) &&\n !node.isTop && !node.inDepBundle) {\n for (const edge of node.edgesIn) {\n this.addTracker('idealTree', edge.from.name, edge.from.location)\n this.#depsQueue.push(edge.from)\n }\n }\n }\n }\n\n async #inflateAncientLockfile () {\n const { meta, inventory } = this.idealTree\n const ancient = meta.ancientLockfile\n const old = meta.loadedFromDisk && !(meta.originalLockfileVersion >= 2)\n\n if (inventory.size === 0 || !ancient && !old) {\n return\n }\n\n // if the lockfile is from node v5 or earlier, then we'll have to reload\n // all the manifests of everything we encounter. this is costly, but at\n // least it's just a one-time hit.\n const timeEnd = time.start('idealTree:inflate')\n\n // don't warn if we're not gonna actually write it back anyway.\n const heading = ancient ? 'ancient lockfile' : 'old lockfile'\n if (ancient || !this.options.lockfileVersion ||\n this.options.lockfileVersion >= defaultLockfileVersion) {\n log.warn(heading,\n `\nThe ${meta.type} file was created with an old version of npm,\nso supplemental metadata must be fetched from the registry.\n\nThis is a one-time fix-up, please be patient...\n`)\n }\n\n this.addTracker('idealTree:inflate')\n const queue = []\n for (const node of inventory.values()) {\n if (node.isProjectRoot) {\n continue\n }\n\n // if the node's location isn't within node_modules then this is actually\n // a link target, so skip it. the link node itself will be queued later.\n if (!node.location.startsWith('node_modules')) {\n continue\n }\n\n queue.push(async () => {\n log.silly('inflate', node.location)\n const { resolved, version, path, name, location, integrity } = node\n // don't try to hit the registry for linked deps\n const useResolved = resolved && (\n !version || resolved.startsWith('file:')\n )\n const id = useResolved ? resolved : version\n const spec = npa.resolve(name, id, dirname(path))\n const t = `idealTree:inflate:${location}`\n this.addTracker(t)\n try {\n const mani = await pacote.manifest(spec, {\n ...this.options,\n resolved: resolved,\n integrity: integrity,\n fullMetadata: false,\n before: this.#releaseAgeBefore(spec),\n })\n node.package = { ...mani, _id: `${mani.name}@${mani.version}` }\n } catch (er) {\n const warning = `Could not fetch metadata for ${name}@${id}`\n log.warn(heading, warning, er)\n }\n this.finishTracker(t)\n })\n }\n await promiseCallLimit(queue)\n\n // have to re-calc dep flags, because the nodes don't have edges\n // until their packages get assigned, so everything looks extraneous\n resetDepFlags(this.idealTree)\n calcDepFlags(this.idealTree)\n\n // yes, yes, this isn't the \"original\" version, but now that it's been\n // upgraded, we need to make sure we don't do the work to upgrade it\n // again, since it's now as new as can be.\n if (!this.options.lockfileVersion && !meta.hiddenLockfile) {\n meta.originalLockfileVersion = defaultLockfileVersion\n }\n this.finishTracker('idealTree:inflate')\n timeEnd()\n }\n\n // at this point we have a virtual tree with the actual root node's\n // package deps, which may be partly or entirely incomplete, invalid\n // or extraneous.\n #buildDeps () {\n const timeEnd = time.start('idealTree:buildDeps')\n const tree = this.idealTree.target\n tree.assertRootOverrides()\n this.#depsQueue.push(tree)\n // XXX also push anything that depends on a node with a name\n // in the override list\n log.silly('idealTree', 'buildDeps')\n this.addTracker('idealTree', tree.name, '')\n return this.#buildDepStep().then(timeEnd)\n }\n\n async #buildDepStep () {\n // removes tracker of previous dependency in the queue\n if (this.#currentDep) {\n const { location, name } = this.#currentDep\n time.end(`idealTree:${location || '#root'}`)\n this.finishTracker('idealTree', name, location)\n this.#currentDep = null\n }\n\n if (!this.#depsQueue.length) {\n return this.#resolveLinks()\n }\n\n const node = this.#depsQueue.pop()\n const bd = node.package.bundleDependencies\n const hasBundle = bd && Array.isArray(bd) && bd.length\n\n // if the node was already visited, or has since been removed from the\n // tree, skip over it and process the rest of the queue.\n if (this.#depsSeen.has(node) ||\n node.root !== this.idealTree) {\n return this.#buildDepStep()\n }\n\n this.#depsSeen.add(node)\n this.#currentDep = node\n time.start(`idealTree:${node.location || '#root'}`)\n\n // if we're loading a _complete_ ideal tree, for a --package-lock-only\n // installation for example, we have to crack open the tarball and\n // look inside if it has bundle deps. note that this is\n // not necessary during a reification, because we just update the\n // ideal tree by reading bundles in place.\n // Don't bother if the node is from the actual tree and hasn't\n // been resolved, because we can't fetch it anyway, could be anything!\n const crackOpen = this.#complete &&\n node !== this.idealTree &&\n node.resolved &&\n hasBundle &&\n !node.inert\n if (crackOpen) {\n const Arborist = this.constructor\n const opt = { ...this.options }\n await cacache.tmp.withTmp(this.cache, opt, async path => {\n await pacote.extract(node.resolved, path, {\n ...opt,\n Arborist,\n resolved: node.resolved,\n integrity: node.integrity,\n })\n\n await new Arborist({ ...this.options, path })\n .loadActual({ root: node, ignoreMissing: true })\n })\n }\n\n // if any deps are missing or invalid, then we fetch the manifest for\n // the thing we want, and build a new dep node from that.\n // Then, find the ideal placement for that node. The ideal placement\n // searches from the node's deps (or parent deps in the case of non-root\n // peer deps), and walks up the tree until it finds the highest spot\n // where it doesn't cause any conflicts.\n //\n // A conflict can be:\n // - A node by that name already exists at that location.\n // - The parent has a peer dep on that name\n // - One of the node's peer deps conflicts at that location, unless the\n // peer dep is met by a node at that location, which is fine.\n //\n // If we create a new node, then build its ideal deps as well.\n //\n // Note: this is the same \"maximally naive\" deduping tree-building\n // algorithm that npm has used since v3. In a case like this:\n //\n // root -> (a@1, b@1||2)\n // a -> (b@1)\n //\n // You'll end up with a tree like this:\n //\n // root\n // +-- a@1\n // | +-- b@1\n // +-- b@2\n //\n // rather than this, more deduped, but just as correct tree:\n //\n // root\n // +-- a@1\n // +-- b@1\n //\n // Another way to look at it is that this algorithm favors getting higher\n // version deps at higher levels in the tree, even if that reduces\n // potential deduplication.\n //\n // Set `preferDedupe: true` in the options to replace the shallower\n // dep if allowed.\n\n const tasks = []\n const peerSource = this.#peerSetSource.get(node) || node\n for (const edge of this.#problemEdges(node)) {\n if (edge.peerConflicted) {\n continue\n }\n\n // peerSetSource is only relevant when we have a peerEntryEdge\n // otherwise we're setting regular non-peer deps as if they have\n // a virtual root of whatever brought in THIS node.\n // so we VR the node itself if the edge is not a peer\n const source = edge.peer ? peerSource : node\n\n const virtualRoot = this.#virtualRoot(source, true)\n // reuse virtual root if we already have one, but don't\n // try to do the override ahead of time, since we MAY be able\n // to create a more correct tree than the virtual root could.\n const vrEdge = virtualRoot && virtualRoot.edgesOut.get(edge.name)\n const vrDep = vrEdge && vrEdge.valid && vrEdge.to\n // only re-use the virtualRoot if it's a peer edge we're placing.\n // otherwise, we end up in situations where we override peer deps that\n // we could have otherwise found homes for. Eg:\n // xy -> (x, y)\n // x -> PEER(z@1)\n // y -> PEER(z@2)\n // If xy is a dependency, we can resolve this like:\n // project\n // +-- xy\n // | +-- y\n // | +-- z@2\n // +-- x\n // +-- z@1\n // But if x and y are loaded in the same virtual root, then they will\n // be forced to agree on a version of z.\n const required = new Set([edge.from])\n const parent = edge.peer ? virtualRoot : null\n let dep = vrDep && vrDep.satisfies(edge) ? vrDep : null\n\n // A peerOptional conflict can be resolved by finding an existing node in the tree that satisfies the edge, avoiding a registry fetch that may introduce an extraneous package. See npm/cli#9249.\n // Skip the shortcut when the user has signaled an explicit re-fetch intent (npm update by name, explicit request, or audit fix), so we honor those signals rather than silently keeping the existing node.\n const skipExistingShortcut = this[_updateNames].includes(edge.name)\n || this.#explicitRequests.has(edge)\n || (edge.to && this.auditReport?.isVulnerable(edge.to))\n if (!dep && edge.type === 'peerOptional' && !skipExistingShortcut) {\n dep = this.#findHoistableNode(\n /* istanbul ignore next - resolveParent is always set for non-root nodes */\n edge.from.resolveParent || edge.from, edge)\n }\n if (!dep) {\n dep = await this.#nodeFromEdge(edge, parent, null, required)\n }\n\n /* istanbul ignore next */\n debug(() => {\n if (!dep) {\n throw new Error('no dep??')\n }\n })\n\n tasks.push({ edge, dep })\n }\n\n const placeDeps = tasks.sort((a, b) => localeCompare(a.edge.name, b.edge.name))\n\n const promises = []\n for (const { edge, dep } of placeDeps) {\n const pd = new PlaceDep({\n edge,\n dep,\n\n auditReport: this.auditReport,\n explicitRequest: this.#explicitRequests.has(edge),\n force: this.options.force,\n installLinks: this.installLinks,\n installStrategy: this.#installStrategy,\n legacyPeerDeps: this.legacyPeerDeps,\n preferDedupe: this.#preferDedupe,\n strictPeerDeps: this.#strictPeerDeps,\n updateNames: this[_updateNames],\n })\n // placing a dep is actually a tree of placing the dep itself\n // and all of its peer group that aren't already met by the tree\n depth({\n tree: pd,\n getChildren: pd => pd.children,\n visit: pd => {\n const { placed, edge, canPlace: cpd, parent } = pd\n // if we didn't place anything, nothing to do here\n if (!placed) {\n return\n }\n\n // we placed something, that means we changed the tree\n if (placed.errors.length) {\n this.#loadFailures.add(placed)\n }\n this.#mutateTree = true\n if (cpd.canPlaceSelf === OK) {\n for (const edgeIn of placed.edgesIn) {\n if (edgeIn === edge) {\n continue\n }\n const { from, valid, peerConflicted } = edgeIn\n if (!peerConflicted && !valid) {\n if (this.#depsSeen.has(from) &&\n (this.options.save ||\n (this.options.save === false && this.#requestedTreeMutation))) {\n // Re-queue already-processed nodes when a newly placed dep\n // creates an invalid edge during npm install or another\n // lockfile-mutating operation. This handles the case where a\n // peerOptional dep was valid (missing) when the node was\n // first processed, but becomes invalid when the dep is later\n // placed by another path with a version that doesn't satisfy\n // the peer spec.\n // See npm/cli#8726.\n this.#depsSeen.delete(from)\n this.#depsQueue.push(from)\n } else if (!this.#depsSeen.has(from)) {\n this.addTracker('idealTree', from.name, from.location)\n this.#depsQueue.push(from)\n }\n }\n }\n } else {\n /* istanbul ignore else - should be only OK or REPLACE here */\n if (cpd.canPlaceSelf === REPLACE) {\n // this may also create some invalid edges, for example if we're\n // intentionally causing something to get nested which was\n // previously placed in this location.\n for (const edgeIn of placed.edgesIn) {\n if (edgeIn === edge) {\n continue\n }\n\n const { valid, peerConflicted } = edgeIn\n if (!valid && !peerConflicted) {\n // if it's already been visited, we have to re-visit\n // otherwise, just enqueue normally.\n this.#depsSeen.delete(edgeIn.from)\n this.#depsQueue.push(edgeIn.from)\n }\n }\n }\n }\n\n /* istanbul ignore if - should be impossible */\n if (cpd.canPlaceSelf === CONFLICT) {\n debug(() => {\n const er = new Error('placed with canPlaceSelf=CONFLICT')\n throw Object.assign(er, { placeDep: pd })\n })\n return\n }\n\n // lastly, also check for the missing deps of the node we placed, and any holes created by pruning out conflicted peer sets.\n this.#depsQueue.push(placed)\n for (const dep of pd.needEvaluation) {\n this.#depsSeen.delete(dep)\n this.#depsQueue.push(dep)\n }\n\n // pre-fetch any problem edges, since we'll need these soon\n // if it fails at this point, though, don't worry because it may well be an optional dep that has gone missing\n // it'll fail later anyway\n for (const e of this.#problemEdges(placed)) {\n // XXX This is somehow load bearing. This makes tests that print the ideal tree of a tree with tarball dependencies fail\n // This can't be changed or removed till we figure out why\n // The test is named \"tarball deps with transitive tarball deps\"\n promises.push(() =>\n this.#fetchManifest(npa.resolve(e.name, e.spec, fromPath(placed, e)), parent, e)\n .catch(() => null)\n )\n }\n },\n })\n }\n\n for (const { to } of node.edgesOut.values()) {\n if (to && to.isLink && to.target) {\n this.#linkNodes.add(to)\n }\n }\n\n await promiseCallLimit(promises)\n return this.#buildDepStep()\n }\n\n // BFS descendants of `root` for a node satisfying `edge`.\n // Prefers nodes closer to root. Skips bundled nodes.\n #findHoistableNode (root, edge) {\n const queue = [...root.children.values()]\n while (queue.length) {\n const node = queue.shift()\n if (node.name === edge.name\n && !node.inDepBundle\n && node.satisfies(edge)) {\n return node\n }\n for (const child of node.children.values()) {\n queue.push(child)\n }\n }\n return null\n }\n\n // loads a node from an edge, and then loads its peer deps (and their peer deps, on down the line) into a virtual root parent.\n async #nodeFromEdge (edge, parent_, secondEdge, required) {\n // create a virtual root node with the same deps as the node that is requesting this one, so that we can get all the peer deps in a context where they're likely to be resolvable.\n // Note that the virtual root will also have virtual copies of the targets of any child Links, so that they resolve appropriately.\n const parent = parent_ || this.#virtualRoot(edge.from)\n\n const spec = npa.resolve(edge.name, edge.spec, edge.from.path)\n const first = await this.#nodeFromSpec(edge.name, spec, parent, edge)\n\n // we might have a case where the parent has a peer dependency on `foo@*` which resolves to v2, but another dep in the set has a peerDependency on `foo@1`.\n // In that case, if we force it to be v2, we're unnecessarily triggering an ERESOLVE.\n // If we have a second edge to worry about, and it's not satisfied by the first node, try a second and see if that satisfies the original edge here.\n const spec2 = secondEdge && npa.resolve(\n edge.name,\n secondEdge.spec,\n secondEdge.from.path\n )\n const second = secondEdge && !secondEdge.valid\n ? await this.#nodeFromSpec(edge.name, spec2, parent, secondEdge)\n : null\n\n // pick the second one if they're both happy with that; otherwise, first\n const node = second && edge.valid ? second : first\n // ensure the one we want is the one that's placed\n node.parent = parent\n\n if (required.has(edge.from) && edge.type !== 'peerOptional' ||\n secondEdge && (\n required.has(secondEdge.from) && secondEdge.type !== 'peerOptional')) {\n required.add(node)\n }\n\n // keep track of the thing that caused this node to be included.\n const src = parent.sourceReference\n this.#peerSetSource.set(node, src)\n\n // do not load the peers along with the set if this is a global top pkg\n // otherwise we'll be tempted to put peers as other top-level installed\n // things, potentially clobbering what's there already, which is not\n // what we want. the missing edges will be picked up on the next pass.\n if (this.options.global && edge.from.isProjectRoot) {\n return node\n }\n\n // otherwise, we have to make sure that our peers can go along with us.\n return this.#loadPeerSet(node, required)\n }\n\n #virtualRoot (node, reuse = false) {\n if (reuse && this.#virtualRoots.has(node)) {\n return this.#virtualRoots.get(node)\n }\n\n const vr = new Node({\n path: node.realpath,\n sourceReference: node,\n installLinks: this.installLinks,\n legacyPeerDeps: this.legacyPeerDeps,\n overrides: node.overrides,\n })\n\n // also need to set up any targets from any link deps, so that\n // they are properly reflected in the virtual environment\n for (const child of node.children.values()) {\n if (child.isLink) {\n new Node({\n path: child.realpath,\n sourceReference: child.target,\n root: vr,\n })\n }\n }\n\n this.#virtualRoots.set(node, vr)\n return vr\n }\n\n #problemEdges (node) {\n // skip over any bundled deps, they're not our problem.\n // Note that this WILL fetch bundled meta-deps which are also dependencies\n // but not listed as bundled deps. When reifying, we first unpack any\n // nodes that have bundleDependencies, then do a loadActual on them, move\n // the nodes into the ideal tree, and then prune. So, fetching those\n // possibly-bundled meta-deps at this point doesn't cause any worse\n // problems than a few unnecessary packument fetches.\n\n // also skip over any nodes in the tree that failed to load, since those\n // will crash the install later on anyway.\n const bd = node.isProjectRoot || node.isWorkspace ? null\n : node.package.bundleDependencies\n const bundled = new Set(bd || [])\n\n const problems = []\n for (const edge of node.edgesOut.values()) {\n // If it's included in a bundle, we take whatever is specified.\n if (bundled.has(edge.name)) {\n continue\n }\n\n // If it's already been logged as a load failure, skip it.\n if (edge.to && this.#loadFailures.has(edge.to)) {\n continue\n }\n\n // If the edge has no destination, that's a problem, unless\n // if it's peerOptional and not explicitly requested.\n if (!edge.to) {\n if (edge.type !== 'peerOptional' ||\n this.#explicitRequests.has(edge)) {\n problems.push(edge)\n }\n continue\n }\n\n // If the edge has an error, there's a problem, unless it's peerOptional\n // and we're not saving or otherwise mutating (e.g. npm ci), in which\n // case we trust the lockfile and skip re-resolution. When saving (npm\n // install) or updating, peerOptional invalid edges ARE treated as\n // problems so the lockfile gets fixed.\n // See npm/cli#8726.\n if (!edge.valid) {\n if (edge.type !== 'peerOptional' ||\n this.options.save !== false ||\n this.#requestedTreeMutation) {\n problems.push(edge)\n }\n continue\n }\n\n // If the edge is a workspace, and it's valid, leave it alone\n if (edge.to.isWorkspace) {\n continue\n }\n\n // user explicitly asked to update this package by name, problem\n if (this[_updateNames].includes(edge.name)) {\n problems.push(edge)\n continue\n }\n\n // fixing a security vulnerability with this package, problem\n if (this.auditReport && this.auditReport.isVulnerable(edge.to)) {\n problems.push(edge)\n continue\n }\n\n // user has explicitly asked to install this package, problem\n if (this.#explicitRequests.has(edge)) {\n problems.push(edge)\n continue\n }\n }\n return problems\n }\n\n // The effective `before` filter for a package, applying `min-release-age-exclude`.\n // Returns null (no age filter) for an exempted package, otherwise the\n // configured `before`. The exemption is keyed on the spec's trusted registry\n // identity (alias targets are unwrapped) so an `npm:` alias key cannot disable\n // the filter for the package it actually resolves to.\n #releaseAgeBefore (spec) {\n const { before, minReleaseAgeExclude } = this.options\n if (!before) {\n return before\n }\n return isReleaseAgeExcluded(trustedSpecName(spec), minReleaseAgeExclude) ? null : before\n }\n\n async #fetchManifest (spec, parent, edge) {\n // Enforce allow-* gates before consulting the manifest cache so a cached entry from a different edge cannot bypass the policy.\n this.#checkAllow(spec, edge)\n const options = {\n ...this.options,\n avoid: this.#avoidRange(spec.name),\n fullMetadata: true,\n before: this.#releaseAgeBefore(spec),\n _isRoot: !!(edge?.from?.isProjectRoot || edge?.from?.isWorkspace),\n }\n // get the intended spec and stored metadata from yarn.lock file,\n // if available and valid.\n spec = this.idealTree.meta.checkYarnLock(spec, options)\n\n if (this.#manifests.has(spec.raw)) {\n return this.#manifests.get(spec.raw)\n } else {\n log.silly('fetch manifest', spec.raw.replace(spec.rawSpec, redact(spec.rawSpec)))\n const mani = await pacote.manifest(spec, options)\n this.#manifests.set(spec.raw, mani)\n return mani\n }\n }\n\n async #nodeFromSpec (name, spec, parent, edge) {\n // Enforce allow-git / allow-file / allow-directory / allow-remote before any branching, so the symlink (Link) path is enforced as well as the manifest-fetch path.\n // Route the failure through #loadFailures so optional-dep semantics apply (e.g. a transitive optionalDependencies entry that resolves to a disallowed git URL is silently dropped rather than failing the install).\n try {\n this.#checkAllow(spec, edge)\n } catch (error) {\n return this.#failureNode(name, parent, error, edge)\n }\n\n // pacote will slap integrity on its options, so we have to clone the object so it doesn't get mutated.\n // Don't bother to load the manifest for link deps, because the target might be within another package that doesn't exist yet.\n const { installLinks, legacyPeerDeps } = this\n const isWorkspace = this.idealTree.workspaces && this.idealTree.workspaces.has(spec.name)\n\n // spec is a directory, link it if:\n // - it's a workspace, OR\n // - it's a project-internal file: dependency (always linked), OR\n // - it's external and installLinks is false\n // TODO post arborist refactor, will need to check for installStrategy=linked\n let isProjectInternalFileSpec = false\n if (edge?.rawSpec.startsWith('file:../') || edge?.rawSpec.startsWith('file:./')) {\n const targetPath = resolve(parent.realpath, edge.rawSpec.slice(5))\n const resolvedProjectRoot = resolve(this.idealTree.realpath)\n // Check if the target is within the project root\n isProjectInternalFileSpec = targetPath.startsWith(resolvedProjectRoot + sep) || targetPath === resolvedProjectRoot\n }\n\n // When using --install-links, we need to handle transitive file dependencies specially\n // If the parent was installed (not linked) due to --install-links, and this is a file: dep, we should also install it rather than link it\n const parentWasInstalled = parent && !parent.isLink && parent.resolved?.startsWith('file:')\n const isTransitiveFileDep = spec.type === 'directory' && parentWasInstalled && installLinks\n\n // Decide whether to link or copy the dependency\n const shouldLink = (isWorkspace || isProjectInternalFileSpec || !installLinks) && !isTransitiveFileDep\n if (spec.type === 'directory' && shouldLink) {\n const realpath = spec.fetchSpec\n const { content: pkg } = await PackageJson.normalize(realpath).catch(() => {\n return { content: {} }\n })\n const link = new Link({ name, parent, realpath, pkg, installLinks, legacyPeerDeps })\n this.#linkNodes.add(link)\n return link\n }\n\n // if the spec matches a workspace name, then see if the workspace node will satisfy the edge. if it does, we return the workspace node to make sure it takes priority.\n if (isWorkspace) {\n const existingNode = this.idealTree.edgesOut.get(spec.name).to\n if (existingNode && existingNode.isWorkspace && existingNode.satisfies(edge)) {\n return existingNode\n }\n }\n\n // For file: dependencies that we're installing (not linking), ensure proper resolution\n if (isTransitiveFileDep && edge) {\n // For transitive file deps, resolve relative to the parent's original source location\n const parentOriginalPath = parent.resolved.slice(5) // Remove 'file:' prefix\n const relativePath = edge.rawSpec.slice(5) // Remove 'file:' prefix\n const absolutePath = resolve(parentOriginalPath, relativePath)\n spec = npa.resolve(name, `file:${absolutePath}`)\n }\n\n // spec isn't a directory, and either isn't a workspace or the workspace we have\n // doesn't satisfy the edge. try to fetch a manifest and build a node from that.\n return this.#fetchManifest(spec, parent, edge)\n .then(\n pkg => {\n // When a proxy/upstream registry returns an incomplete manifest\n // (e.g. missing version field for platform-specific packages it\n // hasn't cached), treat it as a load failure so that optional deps\n // are properly pruned instead of written to the lockfile without\n // version metadata. Only apply to registry specs — file: deps\n // legitimately omit version.\n if (!pkg.version && spec.registry) {\n const error = Object.assign(\n new Error(`incomplete manifest for ${name}, missing version`),\n { code: 'EINCOMPLETEMANIFEST' }\n )\n return this.#failureNode(name, parent, error, edge)\n }\n // Transform the manifest copy before any packageExtensions rule and before the Node reads its dependency and peer edges.\n const transformed = this.#applyNpmExtension(pkg)\n const { pkg: extended, applied } = this.#applyPackageExtension(transformed.pkg)\n const node = new Node({ name, pkg: extended, parent, installLinks, legacyPeerDeps })\n if (transformed.applied) {\n node.npmExtensionApplied = transformed.applied\n }\n if (applied) {\n node.packageExtensionsApplied = applied\n }\n return node\n },\n error => this.#failureNode(name, parent, error, edge)\n )\n }\n\n // load all peer deps and meta-peer deps into the node's parent\n // At the end of this, the node's peer-type outward edges are all\n // resolved, and so are all of theirs, but other dep types are not.\n // We prefer to get peer deps that meet the requiring node's dependency,\n // if possible, since that almost certainly works (since that package was\n // developed with this set of deps) and will typically be more restrictive.\n // Note that the peers in the set can conflict either with each other,\n // or with a direct dependency from the virtual root parent! In strict\n // mode, this is always an error. In force mode, it never is, and we\n // prefer the parent's non-peer dep over a peer dep, or the version that\n // gets placed first. In non-strict mode, we behave strictly if the\n // virtual root is based on the root project, and allow non-peer parent\n // deps to override, but throw if no preference can be determined.\n async #loadPeerSet (node, required) {\n const peerEdges = [...node.edgesOut.values()]\n // we typically only install non-optional peers, but we have to\n // factor them into the peerSet so that we can avoid conflicts\n .filter(e => e.peer && !(e.valid && e.to))\n .sort(({ name: a }, { name: b }) => localeCompare(a, b))\n\n for (const edge of peerEdges) {\n // node.parent gets mutated during loop execution due to recursive #nodeFromEdge calls.\n // When a compatible peer is found (e.g. a@1.1.0 replaces a@1.2.0), the original node loses its parent.\n // if node is detached/removed from the tree, or has no parent, so no need to check remaining edgesOut for that node.\n if (!node.parent) {\n break\n }\n // already placed this one, and we're happy with it.\n if (edge.valid && edge.to) {\n continue\n }\n\n const parentEdge = node.parent.edgesOut.get(edge.name)\n const { isProjectRoot, isWorkspace } = node.parent.sourceReference\n const isMine = isProjectRoot || isWorkspace\n const conflictOK = this.options.force || !isMine && !this.#strictPeerDeps\n\n if (!edge.to) {\n if (!parentEdge) {\n // easy, just put the thing there\n await this.#nodeFromEdge(edge, node.parent, null, required)\n continue\n } else {\n // if the parent's edge is very broad like >=1, and the edge in\n // question is something like 1.x, then we want to get a 1.x, not\n // a 2.x. pass along the child edge as an advisory guideline.\n // if the parent edge doesn't satisfy the child edge, and the\n // child edge doesn't satisfy the parent edge, then we have\n // a conflict. this is always a problem in strict mode, never\n // in force mode, and a problem in non-strict mode if this isn't\n // on behalf of our project. in all such cases, we warn at least.\n const dep = await this.#nodeFromEdge(\n parentEdge,\n node.parent,\n edge,\n required\n )\n\n // hooray! that worked!\n if (edge.valid) {\n continue\n }\n\n // allow it. either we're overriding, or it's not something\n // that will be installed by default anyway, and we'll fail when\n // we get to the point where we need to, if we need to.\n if (conflictOK || !required.has(dep)) {\n edge.peerConflicted = true\n continue\n }\n\n // The recursion above may replace node with a compatible peer, detaching it.\n // A detached node has no real conflict to report, so stop instead of crashing on it.\n if (!node.parent) {\n break\n }\n\n // problem\n this.#failPeerConflict(edge, parentEdge)\n }\n }\n\n // There is something present already, and we're not happy about it\n // See if the thing we WOULD be happy with is also going to satisfy\n // the other dependents on the current node.\n const current = edge.to\n const dep = await this.#nodeFromEdge(edge, null, null, required)\n if (dep.canReplace(current)) {\n await this.#nodeFromEdge(edge, node.parent, null, required)\n continue\n }\n\n // at this point we know that there is a dep there, and\n // we don't like it. always fail strictly, always allow forcibly or\n // in non-strict mode if it's not our fault. don't warn here, because\n // we are going to warn again when we place the deps, if we end up\n // overriding for something else. If the thing that has this dep\n // isn't also required, then there's a good chance we won't need it,\n // so allow it for now and let it conflict if it turns out to actually\n // be necessary for the installation.\n if (conflictOK || !required.has(edge.from)) {\n continue\n }\n\n // ok, it's the root, or we're in unforced strict mode, so this is bad\n this.#failPeerConflict(edge, parentEdge)\n }\n return node\n }\n\n #failPeerConflict (edge, currentEdge) {\n const expl = this.#explainPeerConflict(edge, currentEdge)\n throw Object.assign(new Error('unable to resolve dependency tree'), expl)\n }\n\n #explainPeerConflict (edge, currentEdge) {\n const node = edge.from\n const curNode = node.resolve(edge.name)\n const current = curNode.explain()\n return {\n code: 'ERESOLVE',\n current,\n // it SHOULD be impossible to get here without a current node in place,\n // but this at least gives us something report on when bugs creep into\n // the tree handling logic.\n currentEdge: currentEdge ? currentEdge.explain() : null,\n edge: edge.explain(),\n strictPeerDeps: this.#strictPeerDeps,\n force: this.options.force,\n }\n }\n\n // go through all the links in the this.#linkNodes set\n // for each one:\n // - if outside the root, ignore it, assume it's fine, it's not our problem\n // - if a node in the tree already, assign the target to that node.\n // - if a path under an existing node, then assign that as the fsParent,\n // and add it to the _depsQueue\n //\n // call buildDepStep if anything was added to the queue; otherwise, we're done\n // XXX load-virtual also has a #resolveLinks, is there overlap?\n #resolveLinks () {\n for (const link of this.#linkNodes) {\n this.#linkNodes.delete(link)\n\n // link we never ended up placing, skip it\n if (link.root !== this.idealTree) {\n continue\n }\n\n const tree = this.idealTree.target\n const external = !link.target.isDescendantOf(tree)\n\n // outside the root, somebody else's problem, ignore it\n if (external && !this.#follow) {\n continue\n }\n\n // didn't find a parent for it or it has not been seen yet\n // so go ahead and process it.\n const unseenLink = (link.target.parent || link.target.fsParent) &&\n !this.#depsSeen.has(link.target)\n\n if (this.#follow &&\n !link.target.parent &&\n !link.target.fsParent ||\n unseenLink) {\n // Forward the link's overrides before its subtree resolves, so a root override reaches a transitive dep across the link boundary (npm/cli#9659).\n if (link.overrides) {\n link.target.updateOverridesEdgeInAdded(link.overrides)\n }\n this.addTracker('idealTree', link.target.name, link.target.location)\n this.#depsQueue.push(link.target)\n }\n }\n\n if (this.#depsQueue.length) {\n return this.#buildDepStep()\n }\n }\n\n #fixDepFlags () {\n const timeEnd = time.start('idealTree:fixDepFlags')\n const metaFromDisk = this.idealTree.meta.loadedFromDisk\n const flagsSuspect = this[_flagsSuspect]\n const mutateTree = this.#mutateTree\n // if the options set prune:false, then we don't prune, but we still\n // mark the extraneous items in the tree if we modified it at all.\n // If we did no modifications, we just iterate over the extraneous nodes.\n // if we started with an empty tree, then the dep flags are already\n // all set to true, and there can be nothing extraneous, so there's\n // nothing to prune, because we built it from scratch. if we didn't\n // add or remove anything, then also nothing to do.\n if (metaFromDisk && mutateTree) {\n resetDepFlags(this.idealTree)\n }\n\n // update all the dev/optional/etc flags in the tree\n // either we started with a fresh tree, or we\n // reset all the flags to find the extraneous nodes.\n //\n // if we started from a blank slate, or changed something, then\n // the dep flags will be all set to true.\n if (!metaFromDisk || mutateTree) {\n calcDepFlags(this.idealTree)\n } else {\n // otherwise just unset all the flags on the root node\n // since they will sometimes have the default value\n this.idealTree.unsetDepFlags()\n }\n\n // at this point, any node marked as extraneous should be pruned.\n // if we started from a shrinkwrap, and then added/removed something,\n // then the tree is suspect. Prune what is marked as extraneous.\n // otherwise, don't bother.\n const needPrune = metaFromDisk && (mutateTree || flagsSuspect)\n if (this.#prune && needPrune) {\n this.#idealTreePrune()\n }\n\n timeEnd()\n }\n\n #idealTreePrune () {\n for (const node of this.idealTree.inventory.values()) {\n if (node.extraneous) {\n node.parent = null\n }\n }\n }\n\n #pruneFailedOptional () {\n for (const node of this.#loadFailures) {\n if (!node.optional) {\n throw node.errors[0]\n }\n\n const set = optionalSet(node)\n for (const node of set) {\n node.inert = true\n }\n }\n }\n\n async prune (options = {}) {\n // allow the user to set options on the ctor as well.\n // XXX: deprecate separate method options objects.\n options = { ...this.options, ...options }\n\n await this.buildIdealTree(options)\n\n this.#idealTreePrune()\n\n if (!this.options.workspacesEnabled) {\n const excludeNodes = this.excludeWorkspacesDependencySet(this.idealTree)\n for (const node of this.idealTree.inventory.values()) {\n if (\n node.parent !== null\n && !node.isProjectRoot\n && !excludeNodes.has(node)\n && !node.inert\n ) {\n this[_addNodeToTrashList](node)\n }\n }\n }\n\n return this.reify(options)\n }\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.commonAncestorPath = void 0;\nconst node_path_1 = require(\"node:path\");\nfunction* commonArrayMembers(a, b) {\n const [l, s] = a.length > b.length ? [a, b] : [b, a];\n for (const x of s) {\n if (x === l.shift())\n yield x;\n else\n break;\n }\n}\nconst cap = (a, b) => a === b ? a\n : !a || !b ? null\n : (0, node_path_1.parse)(a).root !== (0, node_path_1.parse)(b).root ? null\n : [...commonArrayMembers((0, node_path_1.normalize)(a).split(node_path_1.sep), (0, node_path_1.normalize)(b).split(node_path_1.sep))].join(node_path_1.sep);\nconst commonAncestorPath = (...paths) => paths.reduce(cap);\nexports.commonAncestorPath = commonAncestorPath;\n//# sourceMappingURL=index.js.map","// mix-in implementing the loadActual method\n\nconst { dirname, join, normalize, relative, resolve, sep } = require('node:path')\n\nconst PackageJson = require('@npmcli/package-json')\nconst { readdirScoped } = require('@npmcli/fs')\nconst { walkUp } = require('walk-up-path')\nconst { commonAncestorPath } = require('common-ancestor-path')\nconst treeCheck = require('../tree-check.js')\n\nconst Shrinkwrap = require('../shrinkwrap.js')\nconst calcDepFlags = require('../calc-dep-flags.js')\nconst Node = require('../node.js')\nconst Link = require('../link.js')\nconst realpath = require('../realpath.js')\nconst PackageExtensions = require('../package-extensions.js')\nconst NpmExtension = require('../npm-extension.js')\n\n// public symbols\nconst _changePath = Symbol.for('_changePath')\nconst _setWorkspaces = Symbol.for('setWorkspaces')\nconst _rpcache = Symbol.for('realpathCache')\nconst _stcache = Symbol.for('statCache')\n\nmodule.exports = cls => class ActualLoader extends cls {\n #actualTree\n // ensure when walking the tree that we don't call loadTree on the same\n // actual node more than one time.\n #actualTreeLoaded = new Set()\n #actualTreePromise\n\n // cache of nodes when loading the actualTree, so that we avoid loaded the\n // same node multiple times when symlinks attack.\n #cache = new Map()\n #filter\n\n // cache of link targets for setting fsParent links\n // We don't do fsParent as a magic getter/setter, because it'd be too costly\n // to keep up to date along the walk.\n // And, we know that it can ONLY be relevant when the node is a target of a\n // link; otherwise, it'd be in a node_modules folder, so take advantage of\n // that to limit the scans later.\n #topNodes = new Set()\n #transplantFilter\n\n // public method\n // TODO remove options param in next semver major\n async loadActual (options = {}) {\n // In the past this.actualTree was set as a promise that eventually\n // resolved, and overwrite this.actualTree with the resolved value. This\n // was a problem because virtually no other code expects this.actualTree to\n // be a promise. Instead we only set it once resolved, and also return it\n // from the promise so that it is what's returned from this function when\n // awaited.\n if (this.actualTree) {\n return this.actualTree\n }\n if (!this.#actualTreePromise) {\n // allow the user to set options on the ctor as well.\n // XXX: deprecate separate method options objects.\n options = { ...this.options, ...options }\n\n this.#actualTreePromise = this.#loadActual(options)\n .then(tree => {\n // reset all deps to extraneous prior to recalc\n if (!options.root) {\n for (const node of tree.inventory.values()) {\n node.extraneous = true\n }\n }\n\n // only reset root flags if we're not re-rooting,\n // otherwise leave as-is\n calcDepFlags(tree, !options.root)\n this.#repropagateOverrides()\n this.actualTree = treeCheck(tree)\n return this.actualTree\n })\n }\n return this.#actualTreePromise\n }\n\n // return the promise so that we don't ever have more than one going at the\n // same time. This is so that buildIdealTree can default to the actualTree\n // if no shrinkwrap present, but reify() can still call buildIdealTree and\n // loadActual in parallel safely.\n\n async #loadActual (options) {\n // mostly realpath to throw if the root doesn't exist\n const {\n global,\n filter = () => true,\n root = null,\n transplantFilter = () => true,\n ignoreMissing = false,\n forceActual = false,\n } = options\n this.#filter = filter\n this.#transplantFilter = transplantFilter\n\n if (global) {\n const real = await realpath(this.path, this[_rpcache], this[_stcache])\n const params = {\n path: this.path,\n realpath: real,\n pkg: {},\n global,\n loadOverrides: true,\n }\n if (this.path === real) {\n this.#actualTree = this.#newNode(params)\n } else {\n this.#actualTree = await this.#newLink(params)\n }\n } else {\n // not in global mode, hidden lockfile is allowed, load root pkg too\n this.#actualTree = await this.#loadFSNode({\n path: this.path,\n real: await realpath(this.path, this[_rpcache], this[_stcache]),\n loadOverrides: true,\n })\n\n this.#actualTree.assertRootOverrides()\n\n // if forceActual is set, don't even try the hidden lockfile\n if (!forceActual) {\n // Note: hidden lockfile will be rejected if it's not the latest thing\n // in the folder, or if any of the entries in the hidden lockfile are\n // missing.\n const meta = await Shrinkwrap.load({\n path: this.#actualTree.path,\n hiddenLockfile: true,\n resolveOptions: this.options,\n })\n\n if (meta.loadedFromDisk) {\n this.#actualTree.meta = meta\n // have to load on a new Arborist object, so we don't assign\n // the virtualTree on this one! Also, the weird reference is because\n // we can't easily get a ref to Arborist in this module, without\n // creating a circular reference, since this class is a mixin used\n // to build up the Arborist class itself.\n await new this.constructor({ ...this.options }).loadVirtual({\n root: this.#actualTree,\n })\n await this[_setWorkspaces](this.#actualTree)\n this.#linkActualWorkspaces()\n\n this.#transplant(root)\n return this.#actualTree\n }\n }\n\n const meta = await Shrinkwrap.load({\n path: this.#actualTree.path,\n lockfileVersion: this.options.lockfileVersion,\n resolveOptions: this.options,\n })\n this.#actualTree.meta = meta\n }\n\n await this.#loadFSTree(this.#actualTree)\n await this[_setWorkspaces](this.#actualTree)\n\n // if there are workspace targets without Link nodes created, load\n // the targets, so that we know what they are.\n if (this.#actualTree.workspaces && this.#actualTree.workspaces.size) {\n const promises = []\n for (const path of this.#actualTree.workspaces.values()) {\n if (!this.#cache.has(path)) {\n // workspace overrides use the root overrides\n const p = this.#loadFSNode({ path, root: this.#actualTree, useRootOverrides: true })\n .then(node => this.#loadFSTree(node))\n promises.push(p)\n }\n }\n await Promise.all(promises)\n }\n\n this.#linkActualWorkspaces()\n\n // .npm-extension runs before packageExtensions, matching the ideal-tree resolution order\n await this.#applyNpmExtension()\n this.#applyPackageExtensions()\n\n if (!ignoreMissing) {\n await this.#findMissingEdges()\n }\n\n // try to find a node that is the parent in a fs tree sense, but not a\n // node_modules tree sense, of any link targets. this allows us to\n // resolve deps that node will find, but a legacy npm view of the\n // world would not have noticed.\n for (const path of this.#topNodes) {\n const node = this.#cache.get(path)\n if (node && !node.parent && !node.fsParent) {\n for (const p of walkUp(dirname(path))) {\n if (this.#cache.has(p)) {\n node.fsParent = this.#cache.get(p)\n break\n }\n }\n }\n }\n\n this.#transplant(root)\n\n if (global) {\n // need to depend on the children, or else all of them\n // will end up being flagged as extraneous, since the\n // global root isn't a \"real\" project\n const tree = this.#actualTree\n const actualRoot = tree.isLink ? tree.target : tree\n const { dependencies = {} } = actualRoot.package\n for (const [name, kid] of actualRoot.children.entries()) {\n const def = kid.isLink ? `file:${kid.realpath}` : '*'\n dependencies[name] = dependencies[name] || def\n }\n actualRoot.package = { ...actualRoot.package, dependencies }\n }\n return this.#actualTree\n }\n\n // Under the linked (isolated) strategy, workspaces the root does not depend on are not symlinked into the root node_modules, so neither the on-disk scan nor the hidden lockfile gives the root's workspace edges a node_modules/<ws> link to resolve to.\n // Synthesize those links from the authoritative workspaces map so npm ls and npm query surface the workspaces, matching hoisted and the logical package-lock.\n #linkActualWorkspaces () {\n const root = this.#actualTree\n if (this.options.installStrategy !== 'linked' || !root.workspaces) {\n return\n }\n // Declared workspaces ARE symlinked at root node_modules under linked, so a missing link there is a real problem that must surface as UNMET.\n // Only undeclared workspaces are intentionally absent from root node_modules and need a synthesized link so their root edges resolve.\n const pkg = root.package\n const declared = new Set(Object.keys(Object.assign({},\n pkg.dependencies,\n pkg.devDependencies,\n pkg.optionalDependencies,\n pkg.peerDependencies\n )))\n // index loaded workspace targets by both path and realpath, so a workspace reached through a symlinked dir still matches\n const byLoc = new Map()\n for (const node of root.fsChildren) {\n byLoc.set(node.path, node)\n byLoc.set(node.realpath, node)\n }\n for (const [name, path] of root.workspaces.entries()) {\n // declared workspaces, and any name already a root child, resolve their edge without a synthesized link\n if (declared.has(name) || root.children.has(name)) {\n continue\n }\n const target = byLoc.get(path)\n if (target) {\n // eslint-disable-next-line no-new\n new Link({\n name,\n path: resolve(root.path, 'node_modules', name),\n realpath: target.realpath,\n target,\n parent: root,\n root,\n })\n }\n }\n }\n\n #transplant (root) {\n if (!root || root === this.#actualTree) {\n return\n }\n\n this.#actualTree[_changePath](root.path)\n for (const node of this.#actualTree.children.values()) {\n if (!this.#transplantFilter(node)) {\n node.root = null\n }\n }\n\n root.replace(this.#actualTree)\n for (const node of this.#actualTree.fsChildren) {\n node.root = this.#transplantFilter(node) ? root : null\n }\n\n this.#actualTree = root\n }\n\n async #loadFSNode ({ path, parent, real, root, loadOverrides, useRootOverrides }) {\n if (!real) {\n try {\n real = await realpath(path, this[_rpcache], this[_stcache])\n } catch (error) {\n // if realpath fails, just provide a dummy error node\n return new Node({\n error,\n path,\n realpath: path,\n parent,\n root,\n loadOverrides,\n })\n }\n }\n\n const cached = this.#cache.get(path)\n let node\n // missing edges get a dummy node, assign the parent and return it\n if (cached && !cached.dummy) {\n cached.parent = parent\n return cached\n } else {\n const params = {\n installLinks: this.installLinks,\n legacyPeerDeps: this.legacyPeerDeps,\n path,\n realpath: real,\n parent,\n root,\n loadOverrides,\n // A package physically located in the linked strategy's store is a transitive dependency, not a real tree top, so it must not load its devDependencies.\n // Never flag the loaded root itself, even if its own path happens to sit under a .store directory.\n isInStore: path !== this.path && real.includes(`${sep}node_modules${sep}.store${sep}`),\n }\n\n try {\n const { content: pkg } = await PackageJson.normalize(real)\n params.pkg = pkg\n if (useRootOverrides && root.overrides) {\n params.overrides = root.overrides.getNodeRule({ name: pkg.name, version: pkg.version })\n }\n } catch (err) {\n if (err.code === 'EJSONPARSE') {\n // TODO @npmcli/package-json should be doing this\n err.path = join(real, 'package.json')\n }\n params.error = err\n }\n\n // soldier on if read-package-json raises an error, passing it to the\n // Node which will attach it to its errors array (Link passes it along to\n // its target node)\n if (normalize(path) === real) {\n node = this.#newNode(params)\n } else {\n node = await this.#newLink(params)\n }\n }\n this.#cache.set(path, node)\n return node\n }\n\n #newNode (options) {\n // check it for an fsParent if it's a tree top. there's a decent chance\n // it'll get parented later, making the fsParent scan a no-op, but better\n // safe than sorry, since it's cheap.\n const { parent, realpath } = options\n if (!parent) {\n this.#topNodes.add(realpath)\n }\n return new Node(options)\n }\n\n async #newLink (options) {\n const { realpath } = options\n this.#topNodes.add(realpath)\n const target = this.#cache.get(realpath)\n const link = new Link({ ...options, target })\n\n if (!target) {\n // Link set its target itself in this case\n this.#cache.set(realpath, link.target)\n // if a link target points at a node outside of the root tree's\n // node_modules hierarchy, then load that node as well.\n await this.#loadFSTree(link.target)\n }\n\n return link\n }\n\n async #loadFSTree (node) {\n const did = this.#actualTreeLoaded\n if (!node.isLink && !did.has(node.target.realpath)) {\n did.add(node.target.realpath)\n await this.#loadFSChildren(node.target)\n return Promise.all(\n [...node.target.children.entries()]\n .filter(([, kid]) => !did.has(kid.realpath))\n .map(([, kid]) => this.#loadFSTree(kid))\n )\n }\n }\n\n // create child nodes for all the entries in node_modules\n // and attach them to the node as a parent\n async #loadFSChildren (node) {\n const nm = resolve(node.realpath, 'node_modules')\n try {\n const kids = await readdirScoped(nm).then(paths => paths.map(p => p.replace(/\\\\/g, '/')))\n return Promise.all(\n // ignore . dirs and retired scoped package folders\n kids.filter(kid => !/^(@[^/]+\\/)?\\./.test(kid))\n .filter(kid => this.#filter(node, kid))\n .map(kid => this.#loadFSNode({\n parent: node,\n path: resolve(nm, kid),\n })))\n } catch {\n // error in the readdir is not fatal, just means no kids\n }\n }\n\n // packageExtensions never rewrite a package's package.json, so a filesystem-scanned actual tree lacks the extension-created edges and provenance.\n // Re-derive them from the root rule set, as buildIdealTree does.\n // This is always required under the linked strategy, whose store layout forces the filesystem-scan path.\n #applyPackageExtensions () {\n const rootPkg = this.#actualTree.target?.package\n const pe = new PackageExtensions(rootPkg?.packageExtensions)\n if (!pe.present || !pe.selectors.length) {\n return\n }\n for (const node of this.#actualTree.inventory.values()) {\n // only installed dependencies are extended, never the root or a workspace\n if (node.isLink || node.isProjectRoot || !node.name || !node.inNodeModules()) {\n continue\n }\n const res = pe.apply(node.package)\n if (res) {\n node.package = res.pkg\n node.packageExtensionsApplied = res.applied\n }\n }\n // mirror the provenance onto links so the logical tree location reports it too\n for (const node of this.#actualTree.inventory.values()) {\n if (node.isLink && node.target?.packageExtensionsApplied) {\n node.packageExtensionsApplied = node.target.packageExtensionsApplied\n }\n }\n }\n\n // Re-forward overrides through links once all edges are resolved, since a Link may forward before its subtree resolves and miss a transitive match (npm/cli#9619, #9659).\n #repropagateOverrides () {\n if (!this.#actualTree.overrides) {\n return\n }\n for (const node of this.#actualTree.inventory.values()) {\n if (node.isLink && node.overrides) {\n node.recalculateOutEdgesOverrides()\n }\n }\n }\n\n // .npm-extension transformManifest, like packageExtensions, never rewrites a package's package.json, so re-derive its edges and provenance on a filesystem-scanned actual tree.\n // This executes the root extension code; ignore-extension (and ignore-scripts via flatten) disables it.\n async #applyNpmExtension () {\n if (this.options.ignoreExtension) {\n return\n }\n const ext = new NpmExtension({\n root: this.#actualTree.realpath,\n extensionFile: this.options.extensionFile,\n })\n if (!ext.present) {\n return\n }\n await ext.load()\n for (const node of this.#actualTree.inventory.values()) {\n // only installed dependencies are transformed, never the root or a workspace\n if (node.isLink || node.isProjectRoot || !node.name || !node.inNodeModules()) {\n continue\n }\n const res = ext.apply(node.package)\n if (res) {\n node.package = res.pkg\n node.npmExtensionApplied = res.applied\n }\n }\n // mirror the provenance onto links so the logical tree location reports it too\n for (const node of this.#actualTree.inventory.values()) {\n if (node.isLink && node.target?.npmExtensionApplied) {\n node.npmExtensionApplied = node.target.npmExtensionApplied\n }\n }\n }\n\n async #findMissingEdges () {\n // try to resolve any missing edges by walking up the directory tree,\n // checking for the package in each node_modules folder. stop at the\n // root directory.\n // The tricky move here is that we load a \"dummy\" node for the folder\n // containing the node_modules folder, so that it can be assigned as\n // the fsParent. It's a bad idea to *actually* load that full node,\n // because people sometimes develop in ~/projects/node_modules/...\n // so we'd end up loading a massive tree with lots of unrelated junk.\n const nmContents = new Map()\n const tree = this.#actualTree\n for (const node of tree.inventory.values()) {\n const ancestor = commonAncestorPath(node.realpath, this.path)\n\n const depPromises = []\n for (const [name, edge] of node.edgesOut.entries()) {\n // An unresolved optional edge reports missing === false, so check the target directly.\n // Otherwise an installed optional dep that lives only as a store sibling is never loaded.\n const resolved = edge.to && !edge.to.dummy && edge.to.parent === node\n if (resolved) {\n continue\n }\n\n // start the walk from the dirname, because we would have found\n // the dep in the loadFSTree step already if it was local.\n for (const p of walkUp(dirname(node.realpath))) {\n // only walk as far as the nearest ancestor\n // this keeps us from going into completely unrelated\n // places when a project is just missing something, but\n // allows for finding the transitive deps of link targets.\n // ie, if it has to go up and back out to get to the path\n // from the nearest common ancestor, we've gone too far.\n if (ancestor && /^\\.\\.(?:[\\\\/]|$)/.test(relative(ancestor, p))) {\n break\n }\n\n let entries\n if (!nmContents.has(p)) {\n entries = await readdirScoped(p + '/node_modules')\n .catch(() => []).then(paths => paths.map(p => p.replace(/\\\\/g, '/')))\n nmContents.set(p, entries)\n } else {\n entries = nmContents.get(p)\n }\n\n if (!entries.includes(name)) {\n continue\n }\n\n let d\n if (!this.#cache.has(p)) {\n d = new Node({ path: p, root: node.root, dummy: true })\n this.#cache.set(p, d)\n } else {\n d = this.#cache.get(p)\n }\n if (d.dummy) {\n // it's a placeholder, so likely would not have loaded this dep,\n // unless another dep in the tree also needs it.\n const depPath = normalize(`${p}/node_modules/${name}`)\n const cached = this.#cache.get(depPath)\n if (!cached || cached.dummy) {\n depPromises.push(this.#loadFSNode({\n path: depPath,\n root: node.root,\n parent: d,\n }).then(node => this.#loadFSTree(node)))\n }\n }\n break\n }\n }\n await Promise.all(depPromises)\n }\n }\n}\n","const { resolve } = require('node:path')\n// mixin providing the loadVirtual method\nconst mapWorkspaces = require('@npmcli/map-workspaces')\nconst PackageJson = require('@npmcli/package-json')\nconst nameFromFolder = require('@npmcli/name-from-folder')\n\nconst consistentResolve = require('../consistent-resolve.js')\nconst Shrinkwrap = require('../shrinkwrap.js')\nconst Node = require('../node.js')\nconst Link = require('../link.js')\nconst relpath = require('../relpath.js')\nconst calcDepFlags = require('../calc-dep-flags.js')\nconst treeCheck = require('../tree-check.js')\n\nconst flagsSuspect = Symbol.for('flagsSuspect')\nconst setWorkspaces = Symbol.for('setWorkspaces')\n\nmodule.exports = cls => class VirtualLoader extends cls {\n #rootOptionProvided\n\n // public method\n async loadVirtual (options = {}) {\n if (this.virtualTree) {\n return this.virtualTree\n }\n\n // allow the user to set reify options on the ctor as well.\n // XXX: deprecate separate reify() options object.\n options = { ...this.options, ...options }\n\n if (options.root && options.root.meta) {\n await this.#loadFromShrinkwrap(options.root.meta, options.root)\n return treeCheck(this.virtualTree)\n }\n\n const s = await Shrinkwrap.load({\n path: this.path,\n lockfileVersion: this.options.lockfileVersion,\n resolveOptions: this.options,\n })\n if (!s.loadedFromDisk && !options.root) {\n const er = new Error('loadVirtual requires existing package-lock.json file')\n throw Object.assign(er, { code: 'ENOLOCK' })\n }\n\n // when building the ideal tree, we pass in a root node to this function\n // otherwise, load it from the root package json or the lockfile\n const pkg = await PackageJson.normalize(this.path).then(p => p.content).catch(() => s.data.packages[''] || {})\n // TODO clean this up\n const {\n root = await this[setWorkspaces](this.#loadNode('', pkg, true)),\n } = options\n this.#rootOptionProvided = options.root\n\n await this.#loadFromShrinkwrap(s, root)\n root.assertRootOverrides()\n return treeCheck(this.virtualTree)\n }\n\n async #loadFromShrinkwrap (s, root) {\n if (!this.#rootOptionProvided) {\n // root is never any of these things, but might be a brand new\n // baby Node object that never had its dep flags calculated.\n root.unsetDepFlags()\n } else {\n this[flagsSuspect] = true\n }\n\n this.#checkRootEdges(s, root)\n root.meta = s\n this.virtualTree = root\n // separate out link metadata, and create Node objects for nodes\n const links = new Map()\n const nodes = new Map([['', root]])\n for (const [location, meta] of Object.entries(s.data.packages)) {\n // skip the root because we already got it\n if (!location) {\n continue\n }\n\n if (meta.link) {\n links.set(location, meta)\n } else {\n nodes.set(location, this.#loadNode(location, meta))\n }\n }\n await this.#resolveLinks(links, nodes)\n if (!(s.originalLockfileVersion >= 2)) {\n this.#assignBundles(nodes)\n }\n if (this[flagsSuspect]) {\n // reset all dep flags\n // can't use inventory here, because virtualTree might not be root\n for (const node of nodes.values()) {\n if (node.isRoot || node === this.#rootOptionProvided) {\n continue\n }\n node.resetDepFlags()\n }\n calcDepFlags(this.virtualTree, !this.#rootOptionProvided)\n }\n return root\n }\n\n // check the lockfile deps, and see if they match. if they do not\n // then we have to reset dep flags at the end. for example, if the\n // user manually edits their package.json file, then we need to know\n // that the idealTree is no longer entirely trustworthy.\n #checkRootEdges (s, root) {\n // loaded virtually from tree, no chance of being out of sync\n // ancient lockfiles are critically damaged by this process,\n // so we need to just hope for the best in those cases.\n if (!s.loadedFromDisk || s.ancientLockfile) {\n return\n }\n\n const lock = s.get('')\n const prod = lock.dependencies || {}\n const dev = lock.devDependencies || {}\n const optional = lock.optionalDependencies || {}\n const peer = lock.peerDependencies || {}\n const peerOptional = {}\n\n if (lock.peerDependenciesMeta) {\n for (const [name, meta] of Object.entries(lock.peerDependenciesMeta)) {\n if (meta.optional && peer[name] !== undefined) {\n peerOptional[name] = peer[name]\n delete peer[name]\n }\n }\n }\n\n for (const name of Object.keys(optional)) {\n delete prod[name]\n }\n\n const lockWS = {}\n const workspaces = mapWorkspaces.virtual({\n cwd: this.path,\n lockfile: s.data,\n })\n\n for (const [name, path] of workspaces.entries()) {\n lockWS[name] = `file:${path}`\n }\n\n // Should rootNames exclude optional?\n const rootNames = new Set(root.edgesOut.keys())\n\n const lockByType = ({ dev, optional, peer, peerOptional, prod, workspace: lockWS })\n\n // Find anything in shrinkwrap deps that doesn't match root's type or spec\n for (const type in lockByType) {\n const deps = lockByType[type]\n for (const name in deps) {\n const edge = root.edgesOut.get(name)\n if (!edge || edge.type !== type || edge.spec !== deps[name]) {\n return this[flagsSuspect] = true\n }\n rootNames.delete(name)\n }\n }\n // Something was in root that's not accounted for in shrinkwrap\n if (rootNames.size) {\n return this[flagsSuspect] = true\n }\n }\n\n // links is the set of metadata, and nodes is the map of non-Link nodes\n // Set the targets to nodes in the set, if we have them (we might not)\n // XXX build-ideal-tree also has a #resolveLinks, is there overlap?\n async #resolveLinks (links, nodes) {\n for (const [location, meta] of links.entries()) {\n const targetPath = resolve(this.path, meta.resolved)\n const targetLoc = relpath(this.path, targetPath)\n const target = nodes.get(targetLoc)\n\n if (!target) {\n const err = new Error(\n`Missing target in lock file: \"${targetLoc}\" is referenced by \"${location}\" but does not exist.\nTo fix:\n1. rm package-lock.json\n2. npm install`\n )\n err.code = 'EMISSINGTARGET'\n throw err\n }\n\n const link = this.#loadLink(location, targetLoc, target, meta)\n nodes.set(location, link)\n nodes.set(targetLoc, link.target)\n\n // we always need to read the package.json for link targets\n // outside node_modules because they can be changed by the local user\n if (!link.target.parent) {\n await PackageJson.normalize(link.realpath).then(p => link.target.package = p.content).catch(() => null)\n }\n }\n }\n\n #assignBundles (nodes) {\n for (const [location, node] of nodes) {\n // Skip assignment of parentage for the root package\n if (!location || node.isLink && !node.target.location) {\n continue\n }\n const { name, parent, package: { inBundle } } = node\n\n if (!parent) {\n continue\n }\n\n // read inBundle from package because 'package' here is\n // actually a v2 lockfile metadata entry.\n // If the *parent* is also bundled, though, or if the parent has\n // no dependency on it, then we assume that it's being pulled in\n // just by virtue of its parent or a transitive dep being bundled.\n const { package: ppkg } = parent\n const { inBundle: parentBundled } = ppkg\n if (inBundle && !parentBundled && parent.edgesOut.has(node.name)) {\n if (!ppkg.bundleDependencies) {\n ppkg.bundleDependencies = [name]\n } else {\n ppkg.bundleDependencies.push(name)\n }\n }\n }\n }\n\n #loadNode (location, sw, loadOverrides) {\n const p = this.virtualTree ? this.virtualTree.realpath : this.path\n const path = resolve(p, location)\n // shrinkwrap doesn't include package name unless necessary\n if (!sw.name) {\n sw.name = nameFromFolder(path)\n }\n\n const node = new Node({\n installLinks: this.installLinks,\n legacyPeerDeps: this.legacyPeerDeps,\n root: this.virtualTree,\n path,\n realpath: path,\n integrity: sw.integrity,\n patched: sw.patched,\n packageExtensionsApplied: sw.packageExtensionsApplied,\n npmExtensionApplied: sw.npmExtensionApplied,\n resolved: consistentResolve(sw.resolved, this.path, path),\n pkg: sw,\n loadOverrides,\n // cast to boolean because they're undefined in the lock file when false\n extraneous: !!sw.extraneous,\n devOptional: !!(sw.devOptional || sw.dev || sw.optional),\n peer: !!sw.peer,\n optional: !!sw.optional,\n dev: !!sw.dev,\n })\n\n return node\n }\n\n #loadLink (location, targetLoc, target) {\n const path = resolve(this.path, location)\n const link = new Link({\n installLinks: this.installLinks,\n legacyPeerDeps: this.legacyPeerDeps,\n path,\n realpath: resolve(this.path, targetLoc),\n target,\n pkg: target && target.package,\n })\n link.extraneous = target.extraneous\n link.devOptional = target.devOptional\n link.peer = target.peer\n link.optional = target.optional\n link.dev = target.dev\n return link\n }\n}\n","const allSettled =\n Promise.allSettled ? promises => Promise.allSettled(promises)\n : promises => {\n const reflections = []\n for (let i = 0; i < promises.length; i++) {\n reflections[i] = Promise.resolve(promises[i]).then(value => ({\n status: 'fulfilled',\n value,\n }), reason => ({\n status: 'rejected',\n reason,\n }))\n }\n return Promise.all(reflections)\n }\n\nmodule.exports = promises => allSettled(promises).then(results => {\n let er = null\n const ret = new Array(results.length)\n results.forEach((result, i) => {\n if (result.status === 'rejected')\n throw result.reason\n else\n ret[i] = result.value\n })\n return ret\n})\n","const npa = require('npm-package-arg')\nconst semver = require('semver')\nconst versionFromTgz = require('./version-from-tgz.js')\n\n// Identity matcher for the allowScripts policy.\n//\n// Returns:\n// - true: at least one allow entry matches and no deny entry matches\n// - false: at least one deny entry matches (deny wins on conflict)\n// - null: no entry matches (unreviewed)\n//\n// `policy` is a flat object of `spec-key -> boolean`, where spec-key is\n// anything `npm-package-arg` can parse. `node` is an arborist Node.\n//\n// Identity rules (see RFC npm/rfcs#868):\n// - registry deps match by the name+version parsed from the lockfile's\n// resolved URL, NOT by `node.packageName` / `node.version`. Those two\n// getters return `node.package.name` / `node.package.version`, which\n// come from the tarball's own package.json and are therefore\n// attacker-controlled. A package can publish a tarball claiming any\n// name; the only trusted name is the one baked into the registry URL.\n// - tarball / file / link / remote: exact match on node.resolved\n// - git: match on hosted.ssh() plus a short-SHA prefix of the\n// resolved committish\n\nconst isScriptAllowed = (node, policy) => {\n // Bundled dependencies never run their install scripts and cannot be\n // allowlisted. Matching by name@version from the bundled tarball would\n // reintroduce manifest confusion (a bundled tarball can claim any name\n // and version). Returning null marks them as not-allowed regardless of\n // any policy entry, so their install scripts are blocked by the\n // install-time gate. A package that needs a bundled dep's script must\n // forward it as one of its own lifecycle scripts.\n if (node.inBundle) {\n return null\n }\n\n if (!policy || typeof policy !== 'object') {\n return null\n }\n\n let anyAllow = false\n let anyDeny = false\n\n for (const [key, value] of Object.entries(policy)) {\n // Pass deny intent so matchRegistry can fail closed on an unverifiable\n // version: a deny still blocks, an allow stays refused.\n if (!matches(node, key, value === false)) {\n continue\n }\n if (value === false) {\n anyDeny = true\n continue\n }\n /* istanbul ignore else: policy values are strictly true/false;\n defensive guard against unexpected coercions. */\n if (value === true) {\n anyAllow = true\n }\n }\n\n if (anyDeny) {\n return false\n }\n if (anyAllow) {\n return true\n }\n return null\n}\n\nconst matches = (node, key, failClosed) => {\n let parsed\n try {\n parsed = npa(key)\n } catch {\n return false\n }\n\n switch (parsed.type) {\n case 'tag':\n case 'range':\n case 'version':\n return matchRegistry(node, parsed, failClosed)\n case 'git':\n return matchGit(node, parsed)\n case 'file':\n case 'directory':\n return matchFileOrDir(node, parsed)\n case 'remote':\n return matchRemote(node, parsed)\n case 'alias':\n // Disallowed: aliases as policy keys do not match anything.\n // The user has to address the real package name.\n return false\n /* istanbul ignore next: switch above covers every npa type we expect;\n defensive fallback for future npa types. */\n default:\n return false\n }\n}\n\nconst resolvedSourceSpecs = (node) => {\n const specs = []\n const seen = new Set()\n const add = (spec) => {\n if (typeof spec !== 'string' || spec === '' || seen.has(spec)) {\n return\n }\n seen.add(spec)\n specs.push(spec)\n }\n\n add(node?.resolved)\n\n if (!node?.resolved && node?.linksIn && typeof node.linksIn[Symbol.iterator] === 'function') {\n let hasIncomingLink = false\n for (const link of node.linksIn) {\n hasIncomingLink = true\n add(link.resolved)\n }\n\n if (hasIncomingLink) {\n // Link targets for local directory deps are separate inventory nodes\n // whose own `resolved` is null. The incoming Link carries the saved spec\n // (for example `file:../pkg`, relative to node_modules), while policy\n // entries written by hand often use the dependency spec from package.json\n // (for example `file:pkg`, resolved by npa to this target path). Include\n // the real target paths so both forms can match the same local dep.\n add(node.realpath)\n add(node.path)\n }\n }\n\n return specs\n}\n\nconst matchRegistry = (node, parsed, failClosed) => {\n // If this node is not a registry dep, refuse the match. A registry-style\n // key (`pkg`, `pkg@1`, `pkg@1 || 2`) must not match a tarball or git node\n // even if their names happen to coincide.\n if (!isRegistryNode(node)) {\n return false\n }\n\n // Derive the trusted name+version from the lockfile's resolved URL.\n // Never use `node.packageName` / `node.version` here: those read from\n // the tarball's own package.json and can be forged by a malicious\n // publisher to bypass an allowScripts entry.\n const trusted = getTrustedRegistryIdentity(node)\n if (!trusted || trusted.name !== parsed.name) {\n return false\n }\n\n // `tag` covers `pkg@latest`. Rejected up front by validatePolicy in\n // resolve-allow-scripts.js because tags look like a pin but can't be\n // verified at install time. Defense-in-depth: if one slips through\n // (e.g. arborist invoked directly without the resolver), don't match.\n if (parsed.type === 'tag') {\n /* istanbul ignore next: validatePolicy filters this; defensive */\n return false\n }\n\n // `range` includes `pkg@^1`, `pkg@1 || 2`, `pkg@*`, `pkg@>=0`, and bare\n // names like `pkg` (npa parses these as range with fetchSpec='*'). The\n // RFC permits bare names (name-only allow) and exact versions joined by\n // `||`; ranges like ^/~/>=/< are rejected because they would silently\n // allow versions the user has never reviewed.\n if (parsed.type === 'range') {\n // Bare name or `pkg@*`: treat as name-only allow.\n if (parsed.fetchSpec === '*' || parsed.rawSpec === '' || parsed.rawSpec === '*') {\n return true\n }\n if (!isExactVersionDisjunction(parsed.fetchSpec)) {\n return false\n }\n // Unverifiable version (omit-lockfile-registry-resolved): a deny blocks,\n // an allow is refused.\n if (!trusted.version) {\n return failClosed\n }\n return semver.satisfies(trusted.version, parsed.fetchSpec, { loose: true })\n }\n\n // `version` is an exact pin like `pkg@1.2.3`.\n /* istanbul ignore else: parsed.type at this point is always 'version';\n the istanbul-ignored fallback below handles the impossible case. */\n if (parsed.type === 'version') {\n // Unverifiable version: a deny blocks, an allow is refused.\n if (!trusted.version) {\n return failClosed\n }\n return trusted.version === parsed.fetchSpec\n }\n\n /* istanbul ignore next: parsed.type is constrained to tag/range/version\n by the caller; this final fallback is defensive. */\n return false\n}\n\n// Derive a registry node's trusted name+version.\n//\n// Preferred source: the lockfile's resolved URL parsed via\n// versionFromTgz. arborist records the URL when it first adds the dep,\n// before any tarball is unpacked, so the URL cannot be forged by the\n// package's own package.json.\n//\n// Fallback for lockfiles produced with omit-lockfile-registry-resolved\n// (where the URL is absent): take the dep name from an incoming\n// dependency edge. The edge's spec was written by the consumer (or by an\n// upstream package.json), not by the installed tarball. For aliases like\n// `\"trusted\": \"npm:naughty@1.0.0\"`, the underlying registered package\n// name is parsed out of the alias `subSpec`. The install location\n// (`node_modules/trusted`) is deliberately not consulted because for\n// aliases it carries only the alias name, which would let a malicious\n// publisher bypass an allowScripts entry written for the real package.\n//\n// Version is left null in the fallback case because the only remaining\n// source for it (`node.version`) reads from the tarball.\n//\n// Returns `{ name, version }` or `null` if no trusted identity exists.\nconst getTrustedRegistryIdentity = (node) => {\n if (node.resolved && typeof node.resolved === 'string') {\n const parsed = versionFromTgz('', node.resolved)\n /* istanbul ignore else: versionFromTgz returns either a complete\n { name, version } or null; partial objects are not produced. */\n if (parsed && parsed.name && parsed.version) {\n return parsed\n }\n }\n const name = nameFromEdges(node)\n if (name) {\n return { name, version: null }\n }\n return null\n}\n\nconst nameFromEdges = (node) => {\n if (!node.edgesIn || typeof node.edgesIn[Symbol.iterator] !== 'function') {\n return null\n }\n for (const edge of node.edgesIn) {\n let parsed\n try {\n parsed = npa.resolve(edge.name, edge.spec)\n } catch {\n continue\n }\n // Aliases: trust the underlying registered package, not the alias.\n if (parsed.type === 'alias' && parsed.subSpec && parsed.subSpec.registry) {\n return parsed.subSpec.name\n }\n // Non-aliased registry edge: the edge name is the package name as\n // written by the consumer / upstream, which is trusted (it is not\n // read from the installed tarball).\n if (parsed.registry) {\n return parsed.name\n }\n }\n return null\n}\n\n// True if `rangeSpec` is one or more exact versions joined by `||`. Anything\n// containing comparator operators (^, ~, >=, <, *) returns false.\nconst isExactVersionDisjunction = (rangeSpec) => {\n /* istanbul ignore next: caller always passes parsed.fetchSpec, which\n npa guarantees to be a non-empty string for range specs. */\n if (typeof rangeSpec !== 'string' || rangeSpec.trim() === '') {\n return false\n }\n const parts = rangeSpec.split('||').map(p => p.trim())\n /* istanbul ignore next: String.prototype.split always returns at least\n one element; defensive guard only. */\n if (parts.length === 0) {\n return false\n }\n return parts.every(p => p !== '' && semver.valid(p) !== null)\n}\n\nconst matchGit = (node, parsed) => {\n if (!node.resolved || !node.resolved.startsWith('git')) {\n return false\n }\n\n let nodeParsed\n try {\n nodeParsed = npa(node.resolved)\n } catch {\n /* istanbul ignore next: npa parsing a git URL we already validated\n starts with `git` should not throw; defensive guard only. */\n return false\n }\n\n // Compare the host/repo. Both sides should resolve to the same canonical\n // ssh URL.\n const noCommittish = { noCommittish: true }\n const keyHost = parsed.hosted?.ssh(noCommittish)\n const nodeHost = nodeParsed.hosted?.ssh(noCommittish)\n if (keyHost && nodeHost) {\n if (keyHost !== nodeHost) {\n return false\n }\n } else if (parsed.fetchSpec && nodeParsed.fetchSpec) {\n // Non-hosted git URLs: fall back to fetch spec.\n if (parsed.fetchSpec !== nodeParsed.fetchSpec) {\n return false\n }\n } else {\n return false\n }\n\n // If the policy key has no committish, name-only match.\n const keyCommittish = parsed.gitCommittish || parsed.hosted?.committish\n if (!keyCommittish) {\n return true\n }\n\n // Match the resolved full SHA against the key's committish. Users\n // typically write short SHAs in the policy; the lockfile stores 40-char\n // SHAs. Direction matters: the lockfile's full SHA must START WITH the\n // key's short SHA, never the reverse. A longer key matching a shorter\n // resolved committish would let a malformed lockfile or a divergent\n // resolver allow scripts the user never approved.\n const nodeCommittish = nodeParsed.gitCommittish || nodeParsed.hosted?.committish || ''\n if (!nodeCommittish) {\n return false\n }\n return nodeCommittish.startsWith(keyCommittish)\n}\n\nconst matchFileOrDir = (node, parsed) => {\n return resolvedSourceSpecs(node)\n .some(resolved => resolved === parsed.saveSpec || resolved === parsed.fetchSpec)\n}\n\nconst matchRemote = (node, parsed) => {\n return resolvedSourceSpecs(node)\n .some(resolved => resolved === parsed.fetchSpec || resolved === parsed.saveSpec)\n}\n\nconst isRegistryNode = (node) => {\n // Prefer arborist's edge-based check when available (real Node objects).\n // It inspects the incoming edges' specs and only returns true if every\n // edge resolves to a registry spec, which is much harder to spoof than\n // the URL.\n if (typeof node.isRegistryDependency === 'boolean') {\n return node.isRegistryDependency\n }\n // Fall back to URL parsing for nodes without the arborist getter\n // (e.g. test fixtures, lockfiles with omit-lockfile-registry-resolved).\n // Treat the node as a registry dep when:\n // - resolved is missing entirely (omitLockfileRegistryResolved),\n // - resolved is an https/http URL pointing at a registry tarball, or\n // - resolved is undefined and the node has a version (defensive).\n if (!node.resolved) {\n return !!node.version\n }\n // Registry tarballs live at `<host>/<pkg-name>/-/<pkg-name>-<version>.tgz`.\n // Require a path segment before `/-/` so an attacker can't lift a\n // registry-style allow entry to a hostile URL like\n // `https://evil.com/-/trusted-1.0.0.tgz`.\n return /^https?:\\/\\/[^/]+\\/.+\\/-\\/[^/]+-\\d/.test(node.resolved)\n}\n\n// Trusted display identity for human-facing output (the `npm install`\n// blocked-scripts summary and `npm approve-scripts --allow-scripts-pending`).\n// Same as getTrustedRegistryIdentity, but for display only: version\n// falls back to node.version when the URL doesn't carry one. Do not\n// use for policy matching.\nconst trustedDisplay = (node) => {\n const trusted = getTrustedRegistryIdentity(node)\n /* istanbul ignore next: defensive fallbacks for nodes without name/version */\n return {\n name: (trusted && trusted.name) || node.name || null,\n version: (trusted && trusted.version) || node.version || null,\n }\n}\n\nmodule.exports = isScriptAllowed\nmodule.exports.isScriptAllowed = isScriptAllowed\nmodule.exports.matches = matches\nmodule.exports.isExactVersionDisjunction = isExactVersionDisjunction\nmodule.exports.getTrustedRegistryIdentity = getTrustedRegistryIdentity\nmodule.exports.resolvedSourceSpecs = resolvedSourceSpecs\nmodule.exports.trustedDisplay = trustedDisplay\n","// Arborist.rebuild({path = this.path}) will do all the binlinks and\n// bundle building needed. Called by reify, and by `npm rebuild`.\n\nconst PackageJson = require('@npmcli/package-json')\nconst binLinks = require('bin-links')\nconst localeCompare = require('@isaacs/string-locale-compare')('en')\nconst promiseAllRejectLate = require('promise-all-reject-late')\nconst runScript = require('@npmcli/run-script')\nconst { callLimit: promiseCallLimit } = require('promise-call-limit')\nconst { depth: dfwalk } = require('treeverse')\nconst { isNodeGypPackage, defaultGypInstallScript } = require('@npmcli/node-gyp')\nconst { promiseRetry } = require('@gar/promise-retry')\nconst { log, time } = require('proc-log')\nconst { resolve, delimiter } = require('node:path')\nconst { isScriptAllowed } = require('../script-allowed.js')\n\nconst boolEnv = b => b ? '1' : ''\nconst sortNodes = (a, b) => (a.depth - b.depth) || localeCompare(a.path, b.path)\n\nconst _checkBins = Symbol.for('checkBins')\n\n// defined by reify mixin\nconst _handleOptionalFailure = Symbol.for('handleOptionalFailure')\nconst _trashList = Symbol.for('trashList')\n\nmodule.exports = cls => class Builder extends cls {\n #doHandleOptionalFailure\n #oldMeta = null\n #queues = {\n preinstall: [],\n install: [],\n postinstall: [],\n prepare: [],\n bin: [],\n }\n\n async rebuild ({ nodes, handleOptionalFailure = false } = {}) {\n // nothing to do if we're not building anything!\n if (this.options.ignoreScripts && !this.options.binLinks) {\n return\n }\n\n // when building for the first time, as part of reify, we ignore\n // failures in optional nodes, and just delete them. however, when\n // running JUST a rebuild, we treat optional failures as real fails\n this.#doHandleOptionalFailure = handleOptionalFailure\n\n if (!nodes) {\n nodes = await this.#loadDefaultNodes()\n }\n\n // separates links nodes so that it can run\n // prepare scripts and link bins in the expected order\n const timeEnd = time.start('build')\n\n const {\n depNodes,\n linkNodes,\n } = this.#retrieveNodesByType(nodes)\n\n // build regular deps\n await this.#build(depNodes, {})\n\n // build link deps\n if (linkNodes.size) {\n this.#queues = {\n preinstall: [],\n install: [],\n postinstall: [],\n prepare: [],\n bin: [],\n }\n await this.#build(linkNodes, { type: 'links' })\n }\n\n timeEnd()\n }\n\n // if we don't have a set of nodes, then just rebuild\n // the actual tree on disk.\n async #loadDefaultNodes () {\n let nodes\n const tree = await this.loadActual()\n let filterSet\n if (!this.options.workspacesEnabled) {\n filterSet = this.excludeWorkspacesDependencySet(tree)\n nodes = tree.inventory.filter(node =>\n filterSet.has(node) || node.isProjectRoot\n )\n } else if (this.options.workspaces.length) {\n filterSet = this.workspaceDependencySet(\n tree,\n this.options.workspaces,\n this.options.includeWorkspaceRoot\n )\n nodes = tree.inventory.filter(node => filterSet.has(node))\n } else {\n nodes = tree.inventory.values()\n }\n return nodes\n }\n\n #retrieveNodesByType (nodes) {\n const depNodes = new Set()\n const linkNodes = new Set()\n const storeNodes = new Set()\n\n for (const node of nodes) {\n if (node.isStoreLink) {\n storeNodes.add(node)\n } else if (node.isLink) {\n linkNodes.add(node)\n } else {\n depNodes.add(node)\n }\n }\n // Make sure that store linked nodes are processed last.\n // We can't process store links separately or else lifecycle scripts on\n // standard nodes might not have bin links yet.\n for (const node of storeNodes) {\n depNodes.add(node)\n }\n\n // deduplicates link nodes and their targets, avoids\n // calling lifecycle scripts twice when running `npm rebuild`\n // ref: https://github.com/npm/cli/issues/2905\n //\n // we avoid doing so if global=true since `bin-links` relies\n // on having the target nodes available in global mode.\n if (!this.options.global) {\n for (const node of linkNodes) {\n depNodes.delete(node.target)\n }\n }\n\n return {\n depNodes,\n linkNodes,\n }\n }\n\n async #build (nodes, { type = 'deps' }) {\n const timeEnd = time.start(`build:${type}`)\n\n await this.#buildQueues(nodes)\n\n if (!this.options.ignoreScripts) {\n await this.#runScripts('preinstall')\n }\n\n // links should run prepare scripts and only link bins after that\n if (type === 'links') {\n if (!this.options.ignoreScripts) {\n await this.#runScripts('prepare')\n }\n }\n if (this.options.binLinks) {\n await this.#linkAllBins()\n }\n\n if (!this.options.ignoreScripts) {\n await this.#runScripts('install')\n await this.#runScripts('postinstall')\n }\n\n timeEnd()\n }\n\n async #buildQueues (nodes) {\n const timeEnd = time.start('build:queue')\n const set = new Set()\n\n const promises = []\n for (const node of nodes) {\n promises.push(this.#addToBuildSet(node, set))\n\n // if it has bundle deps, add those too, if rebuildBundle\n if (this.options.rebuildBundle !== false) {\n const bd = node.package.bundleDependencies\n if (bd && bd.length) {\n dfwalk({\n tree: node,\n leave: node => promises.push(this.#addToBuildSet(node, set)),\n getChildren: node => [...node.children.values()],\n filter: node => node.inBundle,\n })\n }\n }\n }\n await promiseAllRejectLate(promises)\n\n // now sort into the queues for the 4 things we have to do\n // run in the same predictable order that buildIdealTree uses\n // there's no particular reason for doing it in this order rather\n // than another, but sorting *somehow* makes it consistent.\n const queue = [...set].sort(sortNodes)\n\n for (const node of queue) {\n const { package: { bin, scripts = {} } } = node.target\n const { preinstall, install, postinstall, prepare } = scripts\n const tests = { bin, preinstall, install, postinstall, prepare }\n // allowScripts gate (RFC npm/rfcs#868): `true` runs lifecycle\n // scripts; `false` and `null` (unreviewed) block. Bypassed by\n // --dangerously-allow-all-scripts and workspaces (owner-managed).\n // --ignore-scripts still wins (in #build); bins are never gated.\n //\n // Checked on node.target, not the Link: a Link's `resolved` is\n // node_modules-relative (`file:../../dep`) so it can't match a\n // project-root-relative policy key; the target carries the realpath\n // and link specs that script-allowed.js matches on (npm/cli#9498).\n // For non-links node.target === node, so registry deps are unaffected.\n const scriptsAllowed =\n this.options.dangerouslyAllowAllScripts ||\n node.isWorkspace ||\n isScriptAllowed(node.target, this.options.allowScripts) === true\n for (const [key, has] of Object.entries(tests)) {\n if (!has) {\n continue\n }\n if (key !== 'bin' && !scriptsAllowed) {\n continue\n }\n this.#queues[key].push(node)\n }\n }\n timeEnd()\n }\n\n async [_checkBins] (node) {\n // if the node is a global top, and we're not in force mode, then\n // any existing bins need to either be missing, or a symlink into\n // the node path. Otherwise a package can have a preinstall script\n // that unlinks something, to allow them to silently overwrite system\n // binaries, which is unsafe and insecure.\n if (!node.globalTop || this.options.force) {\n return\n }\n const { path, package: pkg } = node\n await binLinks.checkBins({ pkg, path, top: true, global: true })\n }\n\n async #addToBuildSet (node, set, refreshed = false) {\n if (set.has(node)) {\n return\n }\n\n if (this.#oldMeta === null) {\n const { root: { meta } } = node\n this.#oldMeta = meta && meta.loadedFromDisk &&\n !(meta.originalLockfileVersion >= 2)\n }\n\n const { package: pkg, hasInstallScript } = node.target\n const { gypfile, bin, scripts = {} } = pkg\n\n const { preinstall, install, postinstall, prepare } = scripts\n const anyScript = preinstall || install || postinstall || prepare\n if (!refreshed && !anyScript && (hasInstallScript || this.#oldMeta)) {\n // we either have an old metadata (and thus might have scripts)\n // or we have an indication that there's install scripts (but\n // don't yet know what they are) so we have to load the package.json\n // from disk to see what the deal is. Failure here just means\n // no scripts to add, probably borked package.json.\n // add to the set then remove while we're reading the pj, so we\n // don't accidentally hit it multiple times.\n set.add(node)\n const { content: pkg } = await PackageJson.normalize(node.path).catch(() => {\n return { content: {} }\n })\n set.delete(node)\n\n const { scripts = {} } = pkg\n node.package.scripts = scripts\n return this.#addToBuildSet(node, set, true)\n }\n\n // Rebuild node-gyp dependencies lacking an install or preinstall script\n // note that 'scripts' might be missing entirely, and the package may\n // set gypfile:false to avoid this automatic detection.\n const isGyp = gypfile !== false &&\n !install &&\n !preinstall &&\n await isNodeGypPackage(node.path)\n\n if (bin || preinstall || install || postinstall || prepare || isGyp) {\n if (bin) {\n await this[_checkBins](node)\n }\n if (isGyp) {\n scripts.install = defaultGypInstallScript\n node.package.scripts = scripts\n }\n set.add(node)\n }\n }\n\n async #runScripts (event) {\n const queue = this.#queues[event]\n\n if (!queue.length) {\n return\n }\n\n const timeEnd = time.start(`build:run:${event}`)\n const stdio = this.options.foregroundScripts ? 'inherit' : 'pipe'\n const limit = this.options.foregroundScripts ? 1 : undefined\n await promiseCallLimit(queue.map(node => async () => {\n const {\n path,\n name,\n integrity,\n resolved,\n optional,\n peer,\n dev,\n devOptional,\n package: pkg,\n location,\n isInStore,\n } = node.target\n\n // skip any that we know we'll be deleting\n // or links to store entries (their scripts run on the store\n // entry itself, not through the link)\n if (this[_trashList].has(path) || (node.isLink && node.target?.isInStore)) {\n return\n }\n\n const timeEndLocation = time.start(`build:run:${event}:${location}`)\n log.info('run', pkg._id, event, location, pkg.scripts[event])\n const env = {\n npm_package_resolved: resolved,\n npm_package_integrity: integrity,\n npm_package_json: resolve(path, 'package.json'),\n npm_package_optional: boolEnv(optional),\n npm_package_dev: boolEnv(dev),\n npm_package_peer: boolEnv(peer),\n npm_package_dev_optional:\n boolEnv(devOptional && !dev && !optional),\n }\n // In the linked strategy a store package's dependencies are symlinked siblings in its store node_modules.\n // A separate bin invoked by the script (e.g. napi-postinstall) resolves modules from its own realpath in the store and cannot see those deps, so expose them via NODE_PATH.\n if (isInStore) {\n const storeNodeModules = resolve(path, ...name.split('/').map(() => '..'))\n env.NODE_PATH = [storeNodeModules, process.env.NODE_PATH].filter(Boolean).join(delimiter)\n }\n const runOpts = {\n event,\n path,\n pkg,\n stdio,\n env,\n scriptShell: this.options.scriptShell,\n }\n const p = runScript(runOpts).catch(er => {\n const { code, signal } = er\n log.info('run', pkg._id, event, { code, signal })\n throw er\n }).then(({ args, code, signal, stdout, stderr }) => {\n this.scriptsRun.add({\n pkg,\n path,\n event,\n // I do not know why this needs to be on THIS line but refactoring\n // this function would be quite a process\n // eslint-disable-next-line promise/always-return\n cmd: args && args[args.length - 1],\n env,\n code,\n signal,\n stdout,\n stderr,\n })\n log.info('run', pkg._id, event, { code, signal })\n })\n\n await (this.#doHandleOptionalFailure\n ? this[_handleOptionalFailure](node, p)\n : p)\n\n timeEndLocation()\n }), { limit })\n timeEnd()\n }\n\n async #linkAllBins () {\n const queue = this.#queues.bin\n if (!queue.length) {\n return\n }\n\n const timeEnd = time.start('build:link')\n const promises = []\n // sort the queue by node path, so that the module-local collision\n // detector in bin-links will always resolve the same way.\n for (const node of queue.sort(sortNodes)) {\n // TODO these run before they're awaited\n promises.push(this.#createBinLinks(node))\n }\n\n await promiseAllRejectLate(promises)\n timeEnd()\n }\n\n async #createBinLinks (node) {\n if (this[_trashList].has(node.path)) {\n return\n }\n\n const timeEnd = time.start(`build:link:${node.location}`)\n\n // On Windows, antivirus/indexer can transiently lock files, causing EPERM/EACCES/EBUSY on the rename inside write-file-atomic (used by bin-links/fix-bin.js), so, retry with backoff.\n const p = promiseRetry((retry) => binLinks({\n pkg: node.package,\n path: node.path,\n top: !!(node.isTop || node.globalTop),\n force: this.options.force,\n global: !!node.globalTop,\n }).catch(/* istanbul ignore next - Windows-only transient antivirus locks */ err => {\n if (process.platform === 'win32' &&\n (err.code === 'EPERM' || err.code === 'EACCES' || err.code === 'EBUSY')) {\n return retry(err)\n }\n throw err\n }), { retries: 5, minTimeout: 500 })\n\n await (this.#doHandleOptionalFailure\n ? this[_handleOptionalFailure](node, p)\n : p)\n\n timeEnd()\n }\n}\n","// a tree representing the difference between two trees\n// A Diff node's parent is not necessarily the parent of\n// the node location it refers to, but rather the highest level\n// node that needs to be either changed or removed.\n// Thus, the root Diff node is the shallowest change required\n// for a given branch of the tree being mutated.\n\nconst { depth } = require('treeverse')\nconst { existsSync } = require('node:fs')\n\nconst ssri = require('ssri')\n\nclass Diff {\n constructor ({ actual, ideal, filterSet, omit }) {\n this.omit = omit\n this.filterSet = filterSet\n this.children = []\n this.actual = actual\n this.ideal = ideal\n if (this.ideal) {\n this.resolved = this.ideal.resolved\n this.integrity = this.ideal.integrity\n }\n this.action = getAction(this)\n this.parent = null\n // the set of leaf nodes that we rake up to the top level\n this.leaves = []\n // the set of nodes that don't change in this branch of the tree\n this.unchanged = []\n // the set of nodes that will be removed in this branch of the tree\n this.removed = []\n }\n\n static calculate ({\n actual,\n ideal,\n filterNodes = [],\n omit = new Set(),\n }) {\n // if there's a filterNode, then:\n // - get the path from the root to the filterNode. The root or\n // root.target should have an edge either to the filterNode or\n // a link to the filterNode. If not, abort. Add the path to the\n // filterSet.\n // - Add set of Nodes depended on by the filterNode to filterSet.\n // - Anything outside of that set should be ignored by getChildren\n const filterSet = new Set()\n const extraneous = new Set()\n for (const filterNode of filterNodes) {\n const { root } = filterNode\n if (root !== ideal && root !== actual) {\n throw new Error('invalid filterNode: outside idealTree/actualTree')\n }\n const rootTarget = root.target\n const edge = [...rootTarget.edgesOut.values()].filter(e => {\n return e.to && (e.to === filterNode || e.to.target === filterNode)\n })[0]\n filterSet.add(root)\n filterSet.add(rootTarget)\n filterSet.add(ideal)\n filterSet.add(actual)\n if (edge && edge.to) {\n filterSet.add(edge.to)\n filterSet.add(edge.to.target)\n }\n filterSet.add(filterNode)\n\n depth({\n tree: filterNode,\n visit: node => filterSet.add(node),\n getChildren: node => {\n const orig = node\n node = node.target\n const loc = node.location\n const idealNode = ideal.inventory.get(loc)\n const ideals = !idealNode ? []\n : [...idealNode.edgesOut.values()].filter(e => e.to).map(e => e.to)\n const actualNode = actual.inventory.get(loc)\n const actuals = !actualNode ? []\n : [...actualNode.edgesOut.values()].filter(e => e.to).map(e => e.to)\n if (actualNode) {\n for (const child of actualNode.children.values()) {\n if (child.extraneous) {\n extraneous.add(child)\n }\n }\n }\n\n const result = ideals.concat(actuals)\n // Include link targets so store entries end up in filterSet\n if (orig.isLink) {\n result.push(node)\n }\n return result\n },\n })\n }\n for (const extra of extraneous) {\n filterSet.add(extra)\n }\n\n return depth({\n tree: new Diff({ actual, ideal, filterSet, omit }),\n getChildren,\n leave,\n })\n }\n}\n\nconst getAction = ({ actual, ideal }) => {\n if (!ideal) {\n return 'REMOVE'\n }\n\n // bundled meta-deps are copied over to the ideal tree when we visit it,\n // so they'll appear to be missing here. There's no need to handle them\n // in the diff, though, because they'll be replaced at reify time anyway\n // Otherwise, add the missing node.\n if (!actual) {\n return ideal.inDepBundle ? null : 'ADD'\n }\n\n // always ignore the root node\n if (ideal.isRoot && actual.isRoot) {\n return null\n }\n\n // if the versions don't match, it's a change no matter what\n if (ideal.version !== actual.version) {\n return 'CHANGE'\n }\n\n // a change in patch state requires re-extracting and re-applying\n if ((ideal.patched?.integrity || null) !== (actual.patched?.integrity || null)) {\n return 'CHANGE'\n }\n\n // a node whose patch was just removed must be re-extracted to revert the patched files\n if (ideal.patchRemoved) {\n return 'CHANGE'\n }\n\n const binsExist = ideal.binPaths.every((path) => existsSync(path))\n\n // top nodes, links, and git deps won't have integrity, but do have resolved\n // if neither node has integrity, the bins exist, and either (a) neither\n // node has a resolved value or (b) they both do and match, then we can\n // leave this one alone since we already know the versions match due to\n // the condition above. The \"neither has resolved\" case (a) cannot be\n // treated as a 'mark CHANGE and refetch', because shrinkwraps, bundles,\n // and link deps may lack this information, and we don't want to try to\n // go to the registry for something that isn't there.\n const noIntegrity = !ideal.integrity && !actual.integrity\n const noResolved = !ideal.resolved && !actual.resolved\n const resolvedMatch = ideal.resolved && ideal.resolved === actual.resolved\n if (noIntegrity && binsExist && (resolvedMatch || noResolved)) {\n return null\n }\n\n // otherwise, verify that it's the same bits\n // note that if ideal has integrity, and resolved doesn't, we treat\n // that as a 'change', so that it gets re-fetched and locked down.\n const integrityMismatch = !ideal.integrity || !actual.integrity ||\n !ssri.parse(ideal.integrity).match(actual.integrity)\n if (integrityMismatch || !binsExist) {\n return 'CHANGE'\n }\n\n return null\n}\n\nconst allChildren = node => {\n if (!node) {\n return new Map()\n }\n\n // if the node is root, and also a link, then what we really\n // want is to traverse the target's children\n if (node.isRoot && node.isLink) {\n return allChildren(node.target)\n }\n\n const kids = new Map()\n for (const n of [node, ...node.fsChildren]) {\n for (const kid of n.children.values()) {\n kids.set(kid.path, kid)\n }\n }\n return kids\n}\n\n// functions for the walk options when we traverse the trees\n// to create the diff tree\nconst getChildren = diff => {\n const children = []\n const {\n actual,\n ideal,\n unchanged,\n removed,\n filterSet,\n omit,\n } = diff\n\n // Note: we DON'T diff fsChildren themselves, because they are either\n // included in the package contents, or part of some other project.\n // But we _do_ include the child nodes of fsChildren, because those are\n // nodes that we are typically responsible for installing.\n const actualKids = allChildren(actual)\n const idealKids = allChildren(ideal)\n\n const paths = new Set([...actualKids.keys(), ...idealKids.keys()])\n for (const path of paths) {\n const actual = actualKids.get(path)\n const ideal = idealKids.get(path)\n diffNode({\n actual,\n ideal,\n children,\n unchanged,\n removed,\n filterSet,\n omit,\n })\n }\n\n if (diff.leaves && !children.length) {\n diff.leaves.push(diff)\n }\n\n return children\n}\n\nconst diffNode = ({\n actual,\n ideal,\n children,\n unchanged,\n removed,\n filterSet,\n omit,\n}) => {\n if (filterSet.size && !(filterSet.has(ideal) || filterSet.has(actual))) {\n return\n }\n\n if (ideal?.shouldOmit?.(omit)) {\n ideal.inert = true\n }\n\n // Treat inert nodes as undefined for the purposes of diffing.\n if (ideal?.inert) {\n ideal = undefined\n }\n if (!actual && !ideal) {\n return\n }\n\n const action = getAction({ actual, ideal })\n\n // if it's a match, then get its children\n // otherwise, this is the child diff node\n if (action) {\n if (action === 'REMOVE') {\n removed.push(actual)\n }\n children.push(new Diff({ actual, ideal, filterSet, omit }))\n } else {\n unchanged.push(ideal)\n // !*! Weird dirty hack warning !*!\n //\n // Bundled deps aren't loaded in the ideal tree, because we don't know\n // what they are going to be without unpacking. Swap them over now if\n // the bundling node isn't changing, so we don't prune them later.\n //\n // It's a little bit dirty to be doing this here, since it means that\n // diffing trees can mutate them, but otherwise we have to walk over\n // all unchanging bundlers and correct the diff later, so it's more\n // efficient to just fix it while we're passing through already.\n //\n // Note that moving over a bundled dep will break the links to other\n // deps under this parent, which may have been transitively bundled.\n // Breaking those links means that we'll no longer see the transitive\n // dependency, meaning that it won't appear as bundled any longer!\n // In order to not end up dropping transitively bundled deps, we have\n // to get the list of nodes to move, then move them all at once, rather\n // than moving them one at a time in the first loop.\n const bd = ideal.package.bundleDependencies\n if (actual && bd && bd.length) {\n const bundledChildren = []\n for (const node of actual.children.values()) {\n if (node.inBundle) {\n bundledChildren.push(node)\n }\n }\n for (const node of bundledChildren) {\n node.parent = ideal\n }\n }\n children.push(...getChildren({\n actual,\n ideal,\n unchanged,\n removed,\n filterSet,\n omit,\n }))\n }\n}\n\n// set the parentage in the leave step so that we aren't attaching\n// child nodes only to remove them later. also bubble up the unchanged\n// nodes so that we can move them out of staging in the reification step.\nconst leave = (diff, children) => {\n children.forEach(kid => {\n kid.parent = diff\n diff.leaves.push(...kid.leaves)\n diff.unchanged.push(...kid.unchanged)\n diff.removed.push(...kid.removed)\n })\n diff.children = children\n return diff\n}\n\nmodule.exports = Diff\n","// copied from signal-exit\n\n// This is not the set of all possible signals.\n//\n// It IS, however, the set of all signals that trigger\n// an exit on either Linux or BSD systems. Linux is a\n// superset of the signal names supported on BSD, and\n// the unknown signals just fail to register, so we can\n// catch that easily enough.\n//\n// Don't bother with SIGKILL. It's uncatchable, which\n// means that we can't fire any callbacks anyway.\n//\n// If a user does happen to register a handler on a non-\n// fatal signal like SIGWINCH or something, and then\n// exit, it'll end up firing `process.emit('exit')`, so\n// the handler will be fired anyway.\n//\n// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n// artificially, inherently leave the process in a\n// state from which it is not safe to try and enter JS\n// listeners.\n\nconst platform = global.__ARBORIST_FAKE_PLATFORM__ || process.platform\n\nmodule.exports = [\n 'SIGABRT',\n 'SIGALRM',\n 'SIGHUP',\n 'SIGINT',\n 'SIGTERM',\n]\n\nif (platform !== 'win32') {\n module.exports.push(\n 'SIGVTALRM',\n 'SIGXCPU',\n 'SIGXFSZ',\n 'SIGUSR2',\n 'SIGTRAP',\n 'SIGSYS',\n 'SIGQUIT',\n 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n )\n}\n\nif (platform === 'linux') {\n module.exports.push(\n 'SIGIO',\n 'SIGPOLL',\n 'SIGPWR',\n 'SIGSTKFLT',\n 'SIGUNUSED'\n )\n}\n","const signals = require('./signals.js')\n\n// for testing, expose the process being used\nmodule.exports = Object.assign(fn => setup(fn), { process })\n\n// do all of this in a setup function so that we can call it\n// multiple times for multiple reifies that might be going on.\n// Otherwise, Arborist.reify() is a global action, which is a\n// new constraint we'd be adding with this behavior.\nconst setup = fn => {\n const { process } = module.exports\n\n const sigListeners = { loaded: false }\n\n const unload = () => {\n if (!sigListeners.loaded) {\n return\n }\n for (const sig of signals) {\n try {\n process.removeListener(sig, sigListeners[sig])\n } catch {\n // ignore errors\n }\n }\n process.removeListener('beforeExit', onBeforeExit)\n sigListeners.loaded = false\n }\n\n const onBeforeExit = () => {\n // this trick ensures that we exit with the same signal we caught\n // Ie, if you press ^C and npm gets a SIGINT, we'll do the rollback\n // and then exit with a SIGINT signal once we've removed the handler.\n // The timeout is there because signals are asynchronous, so we need\n // the process to NOT exit on its own, which means we have to have\n // something keeping the event loop looping. Hence this hack.\n unload()\n process.kill(process.pid, signalReceived)\n setTimeout(() => {}, 500)\n }\n\n let signalReceived = null\n const listener = (sig, fn) => () => {\n signalReceived = sig\n\n // if we exit normally, but caught a signal which would have been fatal,\n // then re-send it once we're done with whatever cleanup we have to do.\n unload()\n if (process.listeners(sig).length < 1) {\n process.once('beforeExit', onBeforeExit)\n }\n\n fn({ signal: sig })\n }\n\n // do the actual loading here\n for (const sig of signals) {\n sigListeners[sig] = listener(sig, fn)\n const max = process.getMaxListeners()\n try {\n // if we call this a bunch of times, avoid triggering the warning\n const { length } = process.listeners(sig)\n if (length >= max) {\n process.setMaxListeners(length + 1)\n }\n process.on(sig, sigListeners[sig])\n } catch {\n // ignore errors\n }\n }\n sigListeners.loaded = true\n\n return unload\n}\n","const crypto = require('node:crypto')\nconst { dirname, basename, resolve } = require('node:path')\n\n// use sha1 because it's faster, and collisions extremely unlikely anyway\nconst pathSafeHash = s =>\n crypto.createHash('sha1')\n .update(s)\n .digest('base64')\n .replace(/[^a-zA-Z0-9]+/g, '')\n .slice(0, 8)\n\nconst retirePath = from => {\n const d = dirname(from)\n const b = basename(from)\n const hash = pathSafeHash(from)\n return resolve(d, `.${b}-${hash}`)\n}\n\nmodule.exports = retirePath\n","// Alternate versions of different classes that we use for isolated mode\nconst CaseInsensitiveMap = require('./case-insensitive-map.js')\nconst { resolve } = require('node:path')\n\n// fake lib/node.js\nclass IsolatedNode {\n binPaths = []\n children = new CaseInsensitiveMap()\n edgesIn = new Set()\n edgesOut = new CaseInsensitiveMap()\n fsChildren = new Set()\n integrity = null\n inventory = new Map()\n isInStore = false\n inBundle = false\n isRegistryDependency = false\n isRootDependency = false\n linksIn = new Set()\n meta = { loadedFromDisk: false }\n optional = false\n patched = null\n parent = null\n root = null\n tops = new Set()\n workspaces = new Map()\n\n constructor (options) {\n this.location = options.location\n this.name = options.name\n this.package = options.package\n this.path = options.path\n this.realpath = !this.isLink ? this.path : resolve(options.realpath)\n\n if (options.parent) {\n this.parent = options.parent\n }\n if (options.resolved) {\n this.resolved = options.resolved\n }\n if (options.root) {\n this.root = options.root\n }\n if (options.isInStore) {\n this.isInStore = true\n }\n if (options.inBundle) {\n this.inBundle = true\n }\n if (options.isRegistryDependency) {\n this.isRegistryDependency = true\n }\n if (options.isRootDependency) {\n this.isRootDependency = true\n }\n if (options.optional) {\n this.optional = true\n }\n if (options.patched) {\n this.patched = options.patched\n }\n }\n\n get isRoot () {\n return this === this.root\n }\n\n // The idealGraph is where this is set to true\n get isProjectRoot () {\n return false\n }\n\n get inDepBundle () {\n return false\n }\n\n get isLink () {\n return false\n }\n\n get isTop () {\n return !this.parent\n }\n\n /* istanbul ignore next -- emulate lib/node.js */\n get global () {\n return false\n }\n\n get globalTop () {\n return false\n }\n\n /* istanbul ignore next -- emulate lib/node.js */\n set target (t) {\n // nop\n // In the real lib/node.js this throws in debug mode\n }\n\n get target () {\n return this\n }\n\n /* istanbul ignore next -- emulate lib/node.js */\n getBundler () {\n return null\n }\n\n /* istanbul ignore next -- emulate lib/node.js */\n get hasInstallScript () {\n const { hasInstallScript, scripts } = this.package\n const { install, preinstall, postinstall } = scripts || {}\n return !!(hasInstallScript || install || preinstall || postinstall)\n }\n\n /* istanbul ignore next -- emulate lib/node.js */\n get packageName () {\n return this.package.name || null\n }\n\n get version () {\n return this.package.version\n }\n}\n\n// fake lib/link.js\nclass IsolatedLink extends IsolatedNode {\n #target\n isStoreLink = false\n\n constructor (options) {\n super(options)\n this.#target = options.target\n if (options.isStoreLink) {\n this.isStoreLink = true\n }\n }\n\n get isLink () {\n return true\n }\n\n set target (t) {\n this.#target = t\n }\n\n get target () {\n return this.#target\n }\n}\n\nmodule.exports = { IsolatedNode, IsolatedLink }\n","// mixin implementing the reify method\nconst PackageJson = require('@npmcli/package-json')\nconst hgi = require('hosted-git-info')\nconst npa = require('npm-package-arg')\nconst packageContents = require('@npmcli/installed-package-contents')\nconst pacote = require('pacote')\nconst { pickRegistry } = require('npm-registry-fetch')\nconst promiseAllRejectLate = require('promise-all-reject-late')\nconst runScript = require('@npmcli/run-script')\nconst { callLimit: promiseCallLimit } = require('promise-call-limit')\nconst { depth: dfwalk } = require('treeverse')\nconst { dirname, resolve, relative, join, sep } = require('node:path')\nconst { log, time } = require('proc-log')\nconst { existsSync, realpathSync } = require('node:fs')\nconst { lstat, mkdir, readdir, readlink, rm, symlink } = require('node:fs/promises')\nconst { moveFile } = require('@npmcli/fs')\nconst { subset, intersects } = require('semver')\nconst { walkUp } = require('walk-up-path')\n\nconst AuditReport = require('../audit-report.js')\nconst Diff = require('../diff.js')\nconst calcDepFlags = require('../calc-dep-flags.js')\nconst debug = require('../debug.js')\nconst onExit = require('../signal-handling.js')\nconst optionalSet = require('../optional-set.js')\nconst relpath = require('../relpath.js')\nconst { applyPatchToDir, patchIntegrity } = require('../patch.js')\nconst { readFile } = require('node:fs/promises')\nconst retirePath = require('../retire-path.js')\nconst treeCheck = require('../tree-check.js')\nconst Shrinkwrap = require('../shrinkwrap.js')\nconst { defaultLockfileVersion } = Shrinkwrap\nconst { saveTypeMap, hasSubKey } = require('../add-rm-pkg-deps.js')\nconst { IsolatedNode, IsolatedLink } = require('../isolated-classes.js')\n\n// Part of steps (steps need refactoring before we can do anything about these)\nconst _retireShallowNodes = Symbol.for('retireShallowNodes')\nconst _loadBundlesAndUpdateTrees = Symbol.for('loadBundlesAndUpdateTrees')\nconst _submitQuickAudit = Symbol('submitQuickAudit')\nconst _unpackNewModules = Symbol.for('unpackNewModules')\nconst _build = Symbol.for('build')\n\n// shared by rebuild mixin\nconst _trashList = Symbol.for('trashList')\nconst _handleOptionalFailure = Symbol.for('handleOptionalFailure')\nconst _loadTrees = Symbol.for('loadTrees')\n// defined by rebuild mixin\nconst _checkBins = Symbol.for('checkBins')\n\n// shared symbols for swapping out when testing\n// TODO tests should not be this deep into internals\nconst _diffTrees = Symbol.for('diffTrees')\nconst _createSparseTree = Symbol.for('createSparseTree')\nconst _reifyNode = Symbol.for('reifyNode')\nconst _updateAll = Symbol.for('updateAll')\nconst _updateNames = Symbol.for('updateNames')\nconst _moveContents = Symbol.for('moveContents')\nconst _moveBackRetiredUnchanged = Symbol.for('moveBackRetiredUnchanged')\nconst _removeTrash = Symbol.for('removeTrash')\nconst _renamePath = Symbol.for('renamePath')\nconst _rollbackRetireShallowNodes = Symbol.for('rollbackRetireShallowNodes')\nconst _rollbackCreateSparseTree = Symbol.for('rollbackCreateSparseTree')\nconst _rollbackMoveBackRetiredUnchanged = Symbol.for('rollbackMoveBackRetiredUnchanged')\nconst _saveIdealTree = Symbol.for('saveIdealTree')\n\n// defined by build-ideal-tree mixin\nconst _resolvedAdd = Symbol.for('resolvedAdd')\n// used by build-ideal-tree mixin\nconst _addNodeToTrashList = Symbol.for('addNodeToTrashList')\n\nmodule.exports = cls => class Reifier extends cls {\n #bundleMissing = new Set() // child nodes we'd EXPECT to be included in a bundle, but aren't\n #bundleUnpacked = new Set() // the nodes we unpack to read their bundles\n #nmValidated = new Set()\n #omit\n #retiredPaths = {}\n #retiredUnchanged = {}\n #sparseTreeDirs = new Set()\n #sparseTreeRoots = new Set()\n #linkedActualForDiff = null\n // Under the linked strategy the audit runs against this non-isolated ideal tree.\n // The isolated tree's inventory has no queryable indexes and its edges route through symlinks, so auditing it reports no vulnerabilities.\n #linkedIdealForAudit = null\n\n constructor (options) {\n super(options)\n\n this[_trashList] = new Set()\n }\n\n // public method\n async reify (options = {}) {\n // Global installs are normalized to the shallow strategy in the constructor; honor that here so a per-call installStrategy:'linked' can't re-engage the unsupported linked path.\n const linked = !this.options.global &&\n (options.installStrategy || this.options.installStrategy) === 'linked'\n\n if (this.options.packageLockOnly && this.options.global) {\n const er = new Error('cannot generate lockfile for global packages')\n er.code = 'ESHRINKWRAPGLOBAL'\n throw er\n }\n\n this.#omit = new Set(options.omit)\n\n // start tracker block\n this.addTracker('reify')\n const timeEnd = time.start('reify')\n // don't create missing dirs on dry runs\n if (!this.options.packageLockOnly && !this.options.dryRun) {\n // we do NOT want to set ownership on this folder, especially\n // recursively, because it can have other side effects to do that\n // in a project directory. We just want to make it if it's missing.\n await mkdir(resolve(this.path), { recursive: true })\n\n // do not allow the top-level node_modules to be a symlink\n await this.#validateNodeModules(resolve(this.path, 'node_modules'))\n }\n await this[_loadTrees](options)\n\n const oldTree = this.idealTree\n // Kept to serialize the hidden lockfile from the on-disk .store/symlink layout.\n let isolatedTree = null\n if (linked) {\n // swap out the tree with the isolated tree\n // this is currently technical debt which will be resolved in a refactor\n // of Node/Link trees\n this.idealTree = await this.createIsolatedTree()\n isolatedTree = this.idealTree\n if (this.actualTree) {\n this.#linkedActualForDiff = this.#buildLinkedActualForDiff(\n this.idealTree, this.actualTree\n )\n }\n // Keep the non-isolated tree so the quick audit can run against it.\n this.#linkedIdealForAudit = oldTree\n }\n try {\n await this[_diffTrees]()\n await this.#reifyPackages()\n if (linked) {\n // The sweep mutates node_modules on disk, so skip it for dry runs and lockfile-only installs (those modes also short-circuit #reifyPackages).\n // The sweep itself scopes to in-filter workspaces when a filter is active, so it's safe to run for filtered installs too.\n if (!this.options.dryRun && !this.options.packageLockOnly) {\n await this.#cleanOrphanedStoreEntries()\n }\n } else if (!this.options.dryRun && !this.options.packageLockOnly) {\n // The .store directory is exclusively a linked-strategy artifact, and load-actual ignores dot-directories, so the diff never sees it.\n // Remove it here when switching away from linked so it does not linger under hoisted/nested.\n // Only do this for a full-project install: a workspace-filtered or --workspaces=false install may leave out-of-scope workspaces with links still pointing into the store.\n const filtered = this.options.workspaces.length > 0 || !this.options.workspacesEnabled\n if (!filtered) {\n await this.#removeStaleStoreDir()\n }\n }\n } finally {\n // Restore the non-isolated tree so the lockfile is preserved and a reused Arborist never sees the isolated tree, even if reify throws.\n if (linked) {\n this.idealTree = oldTree\n }\n // The quick audit has captured its tree synchronously by now, so drop the stashed references even on throw.\n this.#linkedIdealForAudit = null\n this.#linkedActualForDiff = null\n }\n await this[_saveIdealTree](options)\n // clean inert\n for (const node of this.idealTree.inventory.values()) {\n if (node.inert) {\n node.parent = null\n }\n }\n // clean up any trash that is still in the tree\n for (const path of this[_trashList]) {\n const loc = relpath(this.idealTree.realpath, path)\n const node = this.idealTree.inventory.get(loc)\n if (node && node.root === this.idealTree) {\n node.parent = null\n }\n }\n\n // if we filtered to only certain nodes, then anything ELSE needs\n // to be untouched in the resulting actual tree, even if it differs\n // in the idealTree. Copy over anything that was in the actual and\n // was not changed, delete anything in the ideal and not actual.\n // Then we move the entire idealTree over to this.actualTree, and\n // save the hidden lockfile.\n if (this.diff && this.diff.filterSet.size && !linked) {\n const reroot = new Set()\n\n const { filterSet } = this.diff\n const seen = new Set()\n for (const [loc, ideal] of this.idealTree.inventory.entries()) {\n seen.add(loc)\n\n // if it's an ideal node from the filter set, then skip it\n // because we already made whatever changes were necessary\n if (filterSet.has(ideal)) {\n continue\n }\n\n // otherwise, if it's not in the actualTree, then it's not a thing\n // that we actually added. And if it IS in the actualTree, then\n // it's something that we left untouched, so we need to record\n // that.\n const actual = this.actualTree.inventory.get(loc)\n if (!actual) {\n ideal.root = null\n } else {\n if ([...actual.linksIn].some(link => filterSet.has(link))) {\n seen.add(actual.location)\n continue\n }\n const { realpath, isLink } = actual\n if (isLink && ideal.isLink && ideal.realpath === realpath) {\n continue\n } else {\n reroot.add(actual)\n }\n }\n }\n\n // now find any actual nodes that may not be present in the ideal\n // tree, but were left behind by virtue of not being in the filter\n for (const [loc, actual] of this.actualTree.inventory.entries()) {\n if (seen.has(loc)) {\n continue\n }\n seen.add(loc)\n\n // we know that this is something that ISN'T in the idealTree,\n // or else we will have addressed it in the previous loop.\n // If it's in the filterSet, that means we intentionally removed\n // it, so nothing to do here.\n if (filterSet.has(actual)) {\n continue\n }\n\n reroot.add(actual)\n }\n\n // go through the rerooted actual nodes, and move them over.\n for (const actual of reroot) {\n actual.root = this.idealTree\n }\n\n // prune out any tops that lack a linkIn, they are no longer relevant.\n for (const top of this.idealTree.tops) {\n if (top.linksIn.size === 0) {\n top.root = null\n }\n }\n\n // need to calculate dep flags, since nodes may have been marked\n // as extraneous or otherwise incorrect during transit.\n calcDepFlags(this.idealTree)\n }\n\n // save the ideal's meta as a hidden lockfile after we actualize it.\n // Under linked the logical tree is the hoisted layout, so the hidden lockfile is serialized from the isolated tree instead.\n if (!linked) {\n this.idealTree.meta.filename =\n this.idealTree.realpath + '/node_modules/.package-lock.json'\n this.idealTree.meta.hiddenLockfile = true\n this.idealTree.meta.lockfileVersion = defaultLockfileVersion\n }\n\n this.actualTree = this.idealTree\n this.idealTree = null\n\n if (!this.options.global && !this.options.dryRun) {\n if (linked) {\n await this.#saveLinkedHiddenLockfile(isolatedTree)\n } else {\n await this.actualTree.meta.save()\n }\n const ignoreScripts = !!this.options.ignoreScripts\n // if we aren't doing a dry run or ignoring scripts and we actually made changes to the dep\n // tree, then run the dependencies scripts\n if (!this.options.dryRun && !ignoreScripts && this.diff && this.diff.children.length) {\n const { path, package: pkg } = this.actualTree.target\n const stdio = this.options.foregroundScripts ? 'inherit' : 'pipe'\n const { scripts = {} } = pkg\n for (const event of ['predependencies', 'dependencies', 'postdependencies']) {\n if (Object.prototype.hasOwnProperty.call(scripts, event)) {\n log.info('run', pkg._id, event, scripts[event])\n await time.start(`reify:run:${event}`, () => runScript({\n event,\n path,\n pkg,\n stdio,\n scriptShell: this.options.scriptShell,\n }))\n }\n }\n }\n }\n // This is a very bad pattern and I can't wait to stop doing it\n this.auditReport = await this.auditReport\n\n this.finishTracker('reify')\n timeEnd()\n return treeCheck(this.actualTree)\n }\n\n async #reifyPackages () {\n // we don't submit the audit report or write to disk on dry runs\n if (this.options.dryRun) {\n return\n }\n\n if (this.options.packageLockOnly) {\n // we already have the complete tree, so just audit it now,\n // and that's all we have to do here.\n return this[_submitQuickAudit]()\n }\n\n // ok, we're about to start touching the fs. need to roll back\n // if we get an early termination.\n let reifyTerminated = null\n const removeHandler = onExit(({ signal }) => {\n // only call once. if signal hits twice, we just terminate\n removeHandler()\n reifyTerminated = Object.assign(new Error('process terminated'), {\n signal,\n })\n return false\n })\n\n // [rollbackfn, [...actions]]\n // after each step, if the process was terminated, execute the rollback\n // note that each rollback *also* calls the previous one when it's\n // finished, and then the first one throws the error, so we only need\n // a new rollback step when we have a new thing that must be done to\n // revert the install.\n const steps = [\n [_rollbackRetireShallowNodes, [\n _retireShallowNodes,\n ]],\n [_rollbackCreateSparseTree, [\n _createSparseTree,\n _loadBundlesAndUpdateTrees,\n _submitQuickAudit,\n _unpackNewModules,\n ]],\n [_rollbackMoveBackRetiredUnchanged, [\n _moveBackRetiredUnchanged,\n _build,\n ]],\n ]\n for (const [rollback, actions] of steps) {\n for (const action of actions) {\n try {\n await this[action]()\n if (reifyTerminated) {\n throw reifyTerminated\n }\n } catch (er) {\n // TODO rollbacks shouldn't be relied on to throw err\n await this[rollback](er)\n /* istanbul ignore next - rollback throws, should never hit this */\n throw er\n }\n }\n }\n\n // no rollback for this one, just exit with the error, since the\n // install completed and can't be safely recovered at this point.\n await this[_removeTrash]()\n if (reifyTerminated) {\n throw reifyTerminated\n }\n\n // done modifying the file system, no need to keep listening for sigs\n removeHandler()\n }\n\n // when doing a local install, we load everything and figure it all out.\n // when doing a global install, we *only* care about the explicit requests.\n [_loadTrees] (options) {\n const timeEnd = time.start('reify:loadTrees')\n const bitOpt = {\n ...options,\n complete: this.options.packageLockOnly || this.options.dryRun,\n }\n\n // if we're only writing a package lock, then it doesn't matter what's here\n if (this.options.packageLockOnly) {\n return this.buildIdealTree(bitOpt).then(timeEnd)\n }\n\n const actualOpt = this.options.global ? {\n ignoreMissing: true,\n global: true,\n filter: (node, kid) => {\n // if it's not the project root, and we have no explicit requests,\n // then we're already into a nested dep, so we keep it\n if (this.explicitRequests.size === 0 || !node.isProjectRoot) {\n return true\n }\n\n // if we added it as an edgeOut, then we want it\n if (this.idealTree.edgesOut.has(kid)) {\n return true\n }\n\n // if it's an explicit request, then we want it\n const hasExplicit = [...this.explicitRequests]\n .some(edge => edge.name === kid)\n if (hasExplicit) {\n return true\n }\n\n // ignore the rest of the global install folder\n return false\n },\n } : { ignoreMissing: true }\n\n if (!this.options.global) {\n return Promise.all([\n this.loadActual(actualOpt),\n this.buildIdealTree(bitOpt),\n ]).then(timeEnd)\n }\n\n // the global install space tends to have a lot of stuff in it. don't\n // load all of it, just what we care about. we won't be saving a\n // hidden lockfile in there anyway. Note that we have to load ideal\n // BEFORE loading actual, so that the actualOpt can use the\n // explicitRequests which is set during buildIdealTree\n return this.buildIdealTree(bitOpt)\n .then(() => this.loadActual(actualOpt))\n .then(timeEnd)\n }\n\n [_diffTrees] () {\n if (this.options.packageLockOnly) {\n return\n }\n\n const timeEnd = time.start('reify:diffTrees')\n // XXX if we have an existing diff already, there should be a way\n // to just invalidate the parts that changed, but avoid walking the\n // whole tree again.\n\n const includeWorkspaces = this.options.workspacesEnabled\n const includeRootDeps = !includeWorkspaces\n || this.options.includeWorkspaceRoot && this.options.workspaces.length > 0\n\n const filterNodes = []\n if (this.options.global && this.explicitRequests.size) {\n const idealTree = this.idealTree.target\n const actualTree = this.actualTree.target\n // we ONLY are allowed to make changes in the global top-level\n // children where there's an explicit request.\n for (const { name } of this.explicitRequests) {\n const ideal = idealTree.children.get(name)\n if (ideal) {\n filterNodes.push(ideal)\n }\n const actual = actualTree.children.get(name)\n if (actual) {\n filterNodes.push(actual)\n }\n }\n } else {\n if (includeWorkspaces) {\n // add all ws nodes to filterNodes\n for (const ws of this.options.workspaces) {\n const ideal = this.idealTree.children.get(ws)\n if (ideal) {\n filterNodes.push(ideal)\n }\n // Skip actual-side filterNodes when using the linked diff wrapper.\n // Those nodes have root===actualTree, not root===linkedActualForDiff, and Diff.calculate requires filterNode.root to match actual.\n // The ideal filterNode alone is sufficient to scope the workspace diff.\n if (!this.#linkedActualForDiff) {\n const actual = this.actualTree.children.get(ws)\n if (actual) {\n filterNodes.push(actual)\n }\n }\n }\n }\n if (includeRootDeps) {\n // add all non-workspace nodes to filterNodes\n // Skip the actual tree under the linked diff wrapper: its edge targets have root===actualTree, not the wrapper, which trips Diff.calculate's filterNode guard.\n // The ideal-side targets alone scope the diff.\n const trees = this.#linkedActualForDiff ? [this.idealTree] : [this.idealTree, this.actualTree]\n for (const tree of trees) {\n for (const { type, to } of tree.edgesOut.values()) {\n if (type !== 'workspace' && to) {\n filterNodes.push(to)\n }\n }\n }\n }\n }\n\n // find all the nodes that need to change between the actual\n // and ideal trees.\n this.diff = Diff.calculate({\n omit: this.#omit,\n filterNodes,\n actual: this.#linkedActualForDiff || this.actualTree,\n ideal: this.idealTree,\n })\n\n // we don't have to add 'removed' folders to the trashlist, because\n // they'll be moved aside to a retirement folder, and then the retired\n // folder will be deleted at the end. This is important when we have\n // a folder like FOO being \"removed\" in favor of a folder like \"foo\",\n // because if we remove node_modules/FOO on case-insensitive systems,\n // it will remove the dep that we *want* at node_modules/foo.\n\n timeEnd()\n }\n\n // add the node and all its bins to the list of things to be\n // removed later on in the process. optionally, also mark them\n // as a retired paths, so that we move them out of the way and\n // replace them when rolling back on failure.\n [_addNodeToTrashList] (node, retire = false) {\n const paths = [node.path, ...node.binPaths]\n const moves = this.#retiredPaths\n log.silly('reify', 'mark', retire ? 'retired' : 'deleted', paths)\n for (const path of paths) {\n if (retire) {\n const retired = retirePath(path)\n moves[path] = retired\n this[_trashList].add(retired)\n } else {\n this[_trashList].add(path)\n }\n }\n }\n\n // move aside the shallowest nodes in the tree that have to be\n // changed or removed, so that we can rollback if necessary.\n [_retireShallowNodes] () {\n const timeEnd = time.start('reify:retireShallow')\n const moves = this.#retiredPaths = {}\n for (const diff of this.diff.children) {\n if (diff.action === 'CHANGE' || diff.action === 'REMOVE') {\n // we'll have to clean these up at the end, so add them to the list\n this[_addNodeToTrashList](diff.actual, true)\n }\n }\n log.silly('reify', 'moves', moves)\n const movePromises = Object.entries(moves)\n .map(([from, to]) => this[_renamePath](from, to))\n return promiseAllRejectLate(movePromises).then(timeEnd)\n }\n\n [_renamePath] (from, to, didMkdirp = false) {\n return moveFile(from, to)\n .catch(er => {\n // Occasionally an expected bin file might not exist in the package,\n // or a shim/symlink might have been moved aside. If we've already\n // handled the most common cause of ENOENT (dir doesn't exist yet),\n // then just ignore any ENOENT.\n if (er.code === 'ENOENT') {\n return didMkdirp ? null : mkdir(dirname(to), { recursive: true }).then(() =>\n this[_renamePath](from, to, true))\n } else if (er.code === 'EEXIST' || er.code === 'ENOTEMPTY') {\n return rm(to, { recursive: true, force: true }).then(() => moveFile(from, to))\n } else {\n throw er\n }\n })\n }\n\n [_rollbackRetireShallowNodes] (er) {\n const timeEnd = time.start('reify:rollback:retireShallow')\n const moves = this.#retiredPaths\n const movePromises = Object.entries(moves)\n .map(([from, to]) => this[_renamePath](to, from))\n return promiseAllRejectLate(movePromises)\n // ignore subsequent rollback errors\n .catch(() => {})\n .then(timeEnd)\n .then(() => {\n throw er\n })\n }\n\n [_createSparseTree] () {\n const timeEnd = time.start('reify:createSparse')\n // if we call this fn again, we look for the previous list\n // so that we can avoid making the same directory multiple times\n const leaves = this.diff.leaves\n .filter(diff => {\n return (diff.action === 'ADD' || diff.action === 'CHANGE') &&\n !this.#sparseTreeDirs.has(diff.ideal.path) &&\n !diff.ideal.isLink\n })\n .map(diff => diff.ideal)\n\n // we check this in parallel, so guard against multiple attempts to\n // retire the same path at the same time.\n const dirsChecked = new Set()\n return promiseAllRejectLate(leaves.map(async node => {\n for (const d of walkUp(node.path)) {\n if (d === node.top.path) {\n break\n }\n if (dirsChecked.has(d)) {\n continue\n }\n dirsChecked.add(d)\n const st = await lstat(d).catch(() => null)\n // this can happen if we have a link to a package with a name\n // that the filesystem treats as if it is the same thing.\n // would be nice to have conditional istanbul ignores here...\n /* istanbul ignore next - defense in depth */\n if (st && !st.isDirectory()) {\n const retired = retirePath(d)\n this.#retiredPaths[d] = retired\n this[_trashList].add(retired)\n await this[_renamePath](d, retired)\n }\n }\n this.#sparseTreeDirs.add(node.path)\n const made = await mkdir(node.path, { recursive: true })\n // if the directory already exists, made will be undefined. if that's the case\n // we don't want to remove it because we aren't the ones who created it so we\n // omit it from the #sparseTreeRoots\n /* istanbul ignore next -- pre-existing: mkdir returns undefined when dir exists, covered in reify tests but lost in aggregate coverage merge */\n if (made) {\n this.#sparseTreeRoots.add(made)\n }\n })).then(timeEnd)\n }\n\n [_rollbackCreateSparseTree] (er) {\n const timeEnd = time.start('reify:rollback:createSparse')\n // cut the roots of the sparse tree that were created, not the leaves\n const roots = this.#sparseTreeRoots\n // also delete the moves that we retired, so that we can move them back\n const failures = []\n const targets = [...roots, ...Object.keys(this.#retiredPaths)]\n const unlinks = targets\n .map(path => rm(path, { recursive: true, force: true }).catch(er => failures.push([path, er])))\n return promiseAllRejectLate(unlinks).then(() => {\n // eslint-disable-next-line promise/always-return\n if (failures.length) {\n log.warn('cleanup', 'Failed to remove some directories', failures)\n }\n })\n .then(timeEnd)\n .then(() => this[_rollbackRetireShallowNodes](er))\n }\n\n // create a symlink for Links, extract for Nodes\n // return the node object, since we usually want that\n // handle optional dep failures here\n // If reifying fails, and the node is optional, add it and its optionalSet\n // to the trash list\n // Always return the node.\n [_reifyNode] (node) {\n const timeEnd = time.start(`reifyNode:${node.location}`)\n this.addTracker('reify', node.name, node.location)\n\n const p = Promise.resolve().then(async () => {\n await this[_checkBins](node)\n await this.#extractOrLink(node)\n const { _id, deprecated } = node.package\n // The .catch is in _handleOptionalFailure. Not ideal, this should be cleaned up.\n // eslint-disable-next-line promise/always-return\n if (deprecated) {\n log.warn('deprecated', `${_id}: ${deprecated}`)\n }\n })\n\n return this[_handleOptionalFailure](node, p)\n .then(() => {\n this.finishTracker('reify', node.name, node.location)\n timeEnd()\n return node\n })\n }\n\n // do not allow node_modules to be a symlink\n async #validateNodeModules (nm) {\n if (this.options.force || this.#nmValidated.has(nm)) {\n return\n }\n const st = await lstat(nm).catch(() => null)\n if (!st || st.isDirectory()) {\n this.#nmValidated.add(nm)\n return\n }\n log.warn('reify', 'Removing non-directory', nm)\n await rm(nm, { recursive: true, force: true })\n }\n\n async #extractOrLink (node) {\n const nm = resolve(node.parent.path, 'node_modules')\n await this.#validateNodeModules(nm)\n\n if (!node.isLink) {\n // in normal cases, node.resolved should *always* be set by now.\n // however, it is possible when a lockfile is damaged, or very old,\n // or in some other race condition bugs in npm v6, that a previously\n // bundled dependency will have just a version, but no resolved value,\n // and no 'bundled: true' setting.\n // Do the best with what we have, or else remove it from the tree\n // entirely, since we can't possibly reify it.\n let res = null\n if (node.resolved) {\n const registryResolved = this.#registryResolved(node.resolved)\n if (registryResolved) {\n res = `${node.name}@${registryResolved}`\n }\n } else if (node.package.name && node.version) {\n res = `${node.package.name}@${node.version}`\n }\n\n // no idea what this thing is. remove it from the tree.\n if (!res) {\n const warning = 'invalid or damaged lockfile detected\\n' +\n 'please re-try this operation once it completes\\n' +\n 'so that the damage can be corrected, or perform\\n' +\n 'a fresh install with no lockfile if the problem persists.'\n log.warn('reify', warning)\n log.verbose('reify', 'unrecognized node in tree', node.path)\n node.parent = null\n node.fsParent = null\n this[_addNodeToTrashList](node)\n return\n }\n await debug(async () => {\n const st = await lstat(node.path).catch(() => null)\n if (st && !st.isDirectory()) {\n debug.log('unpacking into a non-directory', node)\n throw Object.assign(new Error('ENOTDIR: not a directory'), {\n code: 'ENOTDIR',\n path: node.path,\n })\n }\n })\n await pacote.extract(res, node.path, {\n ...this.options,\n resolved: node.resolved,\n integrity: node.integrity,\n // A node counts as \"root\" for allow-* enforcement if it satisfies at least one valid dependency edge declared by the project root or a workspace.\n // node.parent is unsafe here: after hoisting, transitive packages can have the project root as their tree parent.\n // In the linked strategy the store node has no edgesIn, so isolated-reifier precomputes isRootDependency from the source node's edges.\n _isRoot: node.isRootDependency || [...node.edgesIn].some(e =>\n e.valid && (e.from?.isProjectRoot || e.from?.isWorkspace)\n ),\n // pacote's npa re-parses our `name@URL` spec as type=remote, so allowRemote would mis-fire on registry tarballs.\n // Override only when we can prove the URL is registry-mediated; see #isRegistryResolvedTarball.\n ...(this.#isRegistryResolvedTarball(node) ? { allowRemote: 'all' } : {}),\n })\n // store nodes don't use Node class so node.package doesn't get updated\n if (node.isInStore) {\n const { content: pkg } = await PackageJson.normalize(node.path)\n node.package.scripts = pkg.scripts\n }\n await this.#applyPatch(node)\n return\n }\n\n // node.isLink\n\n // Tree-only Link: present in the tree for diff/filter participation, never materialized on disk.\n if (node.isUndeclaredWorkspaceLink) {\n return\n }\n\n await rm(node.path, { recursive: true, force: true })\n\n // symlink\n const dir = dirname(node.path)\n const target = node.realpath\n\n let rel\n if (node.resolved?.startsWith('file:')) {\n rel = this.#calculateRelativePath(node, dir, target, nm)\n } else {\n rel = relative(dir, target)\n }\n\n await mkdir(dir, { recursive: true })\n return symlink(rel, node.path, 'junction')\n }\n\n // apply a registered patch to a freshly extracted node, after extract and before rebuild\n async #applyPatch (node) {\n if (!node.patched) {\n return\n }\n const { path: patchPath, integrity } = node.patched\n\n // validate the patch file here too, since reify can run on an ideal tree that skipped resolvePatchedDependencies\n let contents\n try {\n contents = await readFile(resolve(this.path, patchPath))\n } catch {\n throw Object.assign(\n new Error(`patch file not found: ${patchPath}`),\n { code: 'EPATCHNOTFOUND', path: patchPath, node: node.name }\n )\n }\n if (patchIntegrity(contents) !== integrity) {\n throw Object.assign(\n new Error(`patch file ${patchPath} does not match the recorded integrity`),\n { code: 'EPATCHINTEGRITY', path: patchPath, node: node.name }\n )\n }\n\n try {\n await applyPatchToDir({ patch: contents, cwd: node.path })\n } catch (er) {\n if (this.options.ignorePatchFailures) {\n // the linked side-store keys a package by its patch, so an unpatched package cannot be represented at a patched key and would be trusted on later installs\n if (node.isInStore) {\n throw Object.assign(\n new Error(`Cannot skip the failed patch for ${node.name} under install-strategy=linked. ` +\n `Fix the patch or install with a different strategy.`),\n { code: 'EPATCHFAILED', path: patchPath, node: node.name }\n )\n }\n log.warn('patch', `failed to apply ${patchPath} to ${node.name}: ${er.message}`)\n // the patch was not applied, so do not record it in the lockfile\n // the lockfile and package.json now disagree, so warn that npm ci will reject the tree\n log.warn('patch', `${node.name} was installed unpatched; package.json still declares this patch, so the lockfile is out of sync and \\`npm ci\\` will fail until the patch is fixed or its patchedDependencies entry is removed`)\n node.patched = null\n return\n }\n throw er\n }\n }\n\n // if the node is optional, then the failure of the promise is nonfatal\n // just add it and its optional set to the trash list.\n [_handleOptionalFailure] (node, p) {\n return (node.optional ? p.catch((er) => {\n // a declared patch must apply or fail loudly, even on an optional dep\n if (typeof er?.code === 'string' && er.code.startsWith('EPATCH')) {\n throw er\n }\n const set = optionalSet(node)\n for (const node of set) {\n log.verbose('reify', 'failed optional dependency', node.path)\n node.inert = true\n this[_addNodeToTrashList](node)\n }\n }) : p).then(() => node)\n }\n\n #calculateRelativePath (node, dir, target) {\n // Check if the node is affected by a root override\n let hasRootOverride = [...node.edgesIn].some(edge => edge.from.isRoot && edge.overrides)\n // If not set via edges, see if the root package.json explicitly lists an override\n if (!hasRootOverride && node.root) {\n const rootPackage = node.root.target\n hasRootOverride = !!(rootPackage &&\n rootPackage.package.overrides &&\n rootPackage.package.overrides[node.name])\n }\n if (!hasRootOverride) {\n return relative(dir, target)\n }\n // If an override is detected, attempt to retrieve the override spec from the root package.json\n const overrideSpec = node.root?.target?.package?.overrides?.[node.name]\n if (typeof overrideSpec === 'string' && overrideSpec.startsWith('file:')) {\n const overridePath = overrideSpec.replace(/^file:/, '')\n const rootDir = node.root.target.path\n return relative(dir, resolve(rootDir, overridePath))\n }\n\n // Fallback: derive the file path from node.resolved in a platform-agnostic way\n const filePath = node.resolved.replace(/^file:/, '')\n return join(filePath)\n }\n\n // Serialize the hidden lockfile from the isolated tree, which mirrors the on-disk .store/symlink layout.\n // Its children are every materialized node_modules entry: store package dirs and all symlinks.\n async #saveLinkedHiddenLockfile (isolatedTree) {\n const path = isolatedTree.realpath\n const meta = new Shrinkwrap({\n path,\n hiddenLockfile: true,\n lockfileVersion: defaultLockfileVersion,\n resolveOptions: this.options,\n })\n meta.reset()\n meta.filename = resolve(path, 'node_modules/.package-lock.json')\n const storeRe = /^(.*\\/\\.store\\/.+?)\\/node_modules\\//\n const containers = new Set()\n const nodes = new Set()\n for (const node of isolatedTree.children.values()) {\n // Tree-only undeclared workspace self-links aren't on disk.\n if (node.isUndeclaredWorkspaceLink) {\n continue\n }\n nodes.add(node)\n // Record the enclosing .store/<key> dir so loadVirtual can resolve a store package's sibling deps.\n // node.location uses the platform separator; lockfile keys are posix.\n const m = node.location.replace(/\\\\/g, '/').match(storeRe)\n if (m) {\n containers.add(m[1])\n }\n }\n // Workspace dirs hold their own dep symlinks; record them so the cache can validate those subtrees.\n for (const ws of isolatedTree.fsChildren) {\n nodes.add(ws)\n }\n for (const node of nodes) {\n meta.add(node)\n }\n for (const loc of containers) {\n meta.data.packages[loc] = {}\n }\n await meta.save()\n }\n\n // Build a flat actual tree wrapper for linked installs so the diff can correctly match store entries that already exist on disk.\n // The proxy tree from createIsolatedTree() is flat (all children on root), but loadActual() produces a nested tree where store entries are deep link targets.\n // This wrapper surfaces them at the root level for comparison.\n #buildLinkedActualForDiff (idealTree, actualTree) {\n // Combined Map keyed by path (how allChildren() in diff.js keys)\n const combined = new Map()\n\n // Create synthetic actual entries for ALL ideal children that exist on disk.\n // The isolated ideal tree is flat (all entries as root children), but loadActual() produces a nested tree where workspace deps are under fsChildren and store entries are deep link targets.\n // Synthetic entries ensure the diff compares matching resolved/integrity values (e.g. workspace links have resolved=undefined in the ideal tree but resolved=\"file:../packages/...\" in the actual tree).\n for (const child of idealTree.children.values()) {\n if (combined.has(child.path) || !existsSync(child.path)) {\n continue\n }\n // Skip store links whose ideal realpath doesn't exist on disk yet — the store hash changed and the symlink needs recreating via ADD.\n if (child.isLink && child.resolved?.startsWith('file:.store/') && !existsSync(child.realpath)) {\n continue\n }\n // Skip a link whose on-disk target is a valid-but-wrong store key (e.g. an interrupted update), so the diff repoints it via ADD.\n if (child.isLink && this.#linkTargetMismatch(child)) {\n continue\n }\n let entry\n if (child.isLink) {\n entry = new IsolatedLink(child)\n } else {\n entry = new IsolatedNode(child)\n }\n if (child.isLink && combined.has(child.realpath)) {\n entry.target = combined.get(child.realpath)\n }\n combined.set(child.path, entry)\n }\n\n // Proxy .get(name) to original actual tree for filterNodes compatibility\n // (scoped workspace installs use .get(name), allChildren uses .values())\n const origGet = actualTree.children.get.bind(actualTree.children)\n const combinedGet = combined.get.bind(combined)\n /* istanbul ignore next -- only reached during scoped workspace installs */\n combined.get = (key) => combinedGet(key) || origGet(key)\n\n let wrapper\n /* istanbul ignore next - untested! */\n if (actualTree.isLink) {\n wrapper = new IsolatedLink(actualTree)\n } else {\n wrapper = new IsolatedNode(actualTree)\n }\n wrapper.root = wrapper\n wrapper.binPaths = actualTree.binPaths\n wrapper.children = combined\n wrapper.edgesOut = actualTree.edgesOut\n // Use empty fsChildren so that allChildren() only picks up entries from the combined map.\n // The actual fsChildren have real children with different resolved values (e.g. file:../../../node_modules/.store/... vs file:.store/...) that would overwrite our synthetic entries in allChildren().\n wrapper.fsChildren = new Set()\n wrapper.integrity = actualTree.integrity\n wrapper.inventory = actualTree.inventory\n\n return wrapper\n }\n\n // True when the link's on-disk target resolves to a different path than its ideal target.\n // The caller only invokes this once both paths exist, so realpathSync won't throw.\n #linkTargetMismatch (child) {\n return realpathSync(child.path) !== realpathSync(child.realpath)\n }\n\n // When extracting a registry-resolved package, the spec we hand to pacote is name@URL.\n // pacote re-parses that with npa and gets spec.type === 'remote', so without an override the allow-remote gate would fire on every registry tarball (both =none and =root mis-fire).\n // Returns true only when we are confident this is a registry-mediated install.\n #isRegistryResolvedTarball (node) {\n if (!node.resolved || !node.isRegistryDependency) {\n return false\n }\n try {\n // Match the effective fetch URL, not the raw lockfile value.\n // #registryResolved applies replace-registry-host, rewriting a public-registry pin to the configured proxy/mirror so it matches.\n const resolvedURL = new URL(this.#registryResolved(node.resolved))\n // pickRegistry only consults spec.scope, so a bare-name (tag) parse is sufficient and avoids a node.version dependency.\n const registry = new URL(pickRegistry(npa(node.name), this.options))\n const registryPath = registry.pathname.replace(/\\/?$/, '/')\n return resolvedURL.origin === registry.origin &&\n (registryPath === '/' || resolvedURL.pathname.startsWith(registryPath))\n } catch {\n return false\n }\n }\n\n #registryResolved (resolved) {\n // the default registry url is a magic value meaning \"the currently\n // configured registry\".\n // `resolved` must never be falsey.\n //\n // XXX: use a magic string that isn't also a valid value, like\n // ${REGISTRY} or something. This has to be threaded through the\n // Shrinkwrap and Node classes carefully, so for now, just treat\n // the default reg as the magical animal that it has been.\n try {\n const resolvedURL = hgi.parseUrl(resolved)\n const registryURL = new URL(this.registry)\n const registryPath = registryURL.pathname.replace(/\\/$/, '')\n\n let matchURL = null\n try {\n matchURL = new URL(this.options.replaceRegistryHost)\n } catch {\n // keep matchURL null\n }\n\n const matchHost = matchURL?.hostname ?? this.options.replaceRegistryHost\n const matchPath = matchURL?.pathname.replace(/\\/$/, '') ?? null\n const hasPathPrefix = (pathname, prefix) =>\n pathname === prefix || pathname.startsWith(`${prefix}/`)\n\n const hostMatches = this.options.replaceRegistryHost === 'always' || matchHost === resolvedURL.hostname\n const pathMatches = !matchPath || hasPathPrefix(resolvedURL.pathname, matchPath)\n\n if (!hostMatches || !pathMatches) {\n return resolved\n }\n\n resolvedURL.protocol = registryURL.protocol\n resolvedURL.hostname = registryURL.hostname\n resolvedURL.port = registryURL.port\n\n if (matchPath) {\n // full-URL prefix: swap old path prefix for the registry path\n resolvedURL.pathname = registryPath + resolvedURL.pathname.slice(matchPath.length)\n } else if (registryPath && !hasPathPrefix(resolvedURL.pathname, registryPath)) {\n // host-only: prepend registry path if not already present\n resolvedURL.pathname = registryPath + resolvedURL.pathname\n }\n\n return resolvedURL.toString()\n } catch {\n // if we could not parse the url at all then returning nothing\n // here means it will get removed from the tree in the next step\n return undefined\n }\n }\n\n // bundles are *sort of* like shrinkwraps, in that the branch is defined\n // by the contents of the package. however, in their case, rather than\n // shipping a virtual tree that must be reified, they ship an entire\n // reified actual tree that must be unpacked and not modified.\n [_loadBundlesAndUpdateTrees] (depth = 0, bundlesByDepth) {\n let maxBundleDepth\n if (!bundlesByDepth) {\n bundlesByDepth = new Map()\n maxBundleDepth = -1\n dfwalk({\n tree: this.diff,\n visit: diff => {\n const node = diff.ideal\n if (!node) {\n return\n }\n if (node.isProjectRoot) {\n return\n }\n\n const { bundleDependencies } = node.package\n if (bundleDependencies && bundleDependencies.length) {\n maxBundleDepth = Math.max(maxBundleDepth, node.depth)\n if (!bundlesByDepth.has(node.depth)) {\n bundlesByDepth.set(node.depth, [node])\n } else {\n bundlesByDepth.get(node.depth).push(node)\n }\n }\n },\n getChildren: diff => diff.children,\n })\n\n bundlesByDepth.set('maxBundleDepth', maxBundleDepth)\n } else {\n maxBundleDepth = bundlesByDepth.get('maxBundleDepth')\n }\n\n if (depth === 0) {\n time.start('reify:loadBundles')\n }\n\n if (depth > maxBundleDepth) {\n // if we did something, then prune the tree and update the diffs\n if (maxBundleDepth !== -1) {\n this.#pruneBundledMetadeps(bundlesByDepth)\n this[_diffTrees]()\n }\n time.end('reify:loadBundles')\n return\n }\n\n // skip any that have since been removed from the tree, eg by a\n // shallower bundle overwriting them with a bundled meta-dep.\n const set = (bundlesByDepth.get(depth) || [])\n .filter(node => node.root === this.idealTree &&\n node.target !== node.root &&\n !this[_trashList].has(node.path))\n\n if (!set.length) {\n return this[_loadBundlesAndUpdateTrees](depth + 1, bundlesByDepth)\n }\n\n // extract all the nodes with bundles\n return promiseCallLimit(set.map(node => {\n return () => {\n this.#bundleUnpacked.add(node)\n return this[_reifyNode](node)\n }\n }), { rejectLate: true })\n // then load their unpacked children and move into the ideal tree\n .then(nodes =>\n promiseAllRejectLate(nodes.map(async node => {\n const arb = new this.constructor({\n ...this.options,\n path: node.path,\n })\n const notTransplanted = new Set(node.children.keys())\n await arb.loadActual({\n root: node,\n // don't transplant any sparse folders we created\n // loadActual will set node.package to {} for empty directories\n // if by chance there are some empty folders in the node_modules\n // tree for some other reason, then ok, ignore those too.\n transplantFilter: node => {\n if (node.package._id) {\n // it's actually in the bundle if it gets transplanted\n notTransplanted.delete(node.name)\n return true\n } else {\n return false\n }\n },\n })\n for (const name of notTransplanted) {\n this.#bundleMissing.add(node.children.get(name))\n }\n })))\n // move onto the next level of bundled items\n .then(() => this[_loadBundlesAndUpdateTrees](depth + 1, bundlesByDepth))\n }\n\n // https://github.com/npm/cli/issues/1597#issuecomment-667639545\n #pruneBundledMetadeps (bundlesByDepth) {\n const bundleShadowed = new Set()\n\n // Example dep graph:\n // root -> (a, c)\n // a -> BUNDLE(b)\n // b -> c\n // c -> b\n //\n // package tree:\n // root\n // +-- a\n // | +-- b(1)\n // | +-- c(1)\n // +-- b(2)\n // +-- c(2)\n // 1. mark everything that's shadowed by anything in the bundle. This\n // marks b(2) and c(2).\n // 2. anything with edgesIn from outside the set, mark not-extraneous,\n // remove from set. This unmarks c(2).\n // 3. continue until no change\n // 4. remove everything in the set from the tree. b(2) is pruned\n\n // create the list of nodes shadowed by children of bundlers\n for (const bundles of bundlesByDepth.values()) {\n // skip the 'maxBundleDepth' item\n if (!Array.isArray(bundles)) {\n continue\n }\n for (const node of bundles) {\n for (const name of node.children.keys()) {\n const shadow = node.parent.resolve(name)\n if (!shadow) {\n continue\n }\n bundleShadowed.add(shadow)\n shadow.extraneous = true\n }\n }\n }\n\n // lib -> (a@1.x) BUNDLE(a@1.2.3 (b@1.2.3))\n // a@1.2.3 -> (b@1.2.3)\n // a@1.3.0 -> (b@2)\n // b@1.2.3 -> ()\n // b@2 -> (c@2)\n //\n // root\n // +-- lib\n // | +-- a@1.2.3\n // | +-- b@1.2.3\n // +-- b@2 <-- shadowed, now extraneous\n // +-- c@2 <-- also shadowed, because only dependent is shadowed\n for (const shadow of bundleShadowed) {\n for (const shadDep of shadow.edgesOut.values()) {\n /* istanbul ignore else - pretty unusual situation, just being\n * defensive here. Would mean that a bundled dep has a dependency\n * that is unmet. which, weird, but if you bundle it, we take\n * whatever you put there and assume the publisher knows best. */\n if (shadDep.to) {\n bundleShadowed.add(shadDep.to)\n shadDep.to.extraneous = true\n }\n }\n }\n\n let changed\n do {\n changed = false\n for (const shadow of bundleShadowed) {\n for (const edge of shadow.edgesIn) {\n if (!bundleShadowed.has(edge.from)) {\n shadow.extraneous = false\n bundleShadowed.delete(shadow)\n changed = true\n break\n }\n }\n }\n } while (changed)\n\n for (const shadow of bundleShadowed) {\n this[_addNodeToTrashList](shadow)\n shadow.root = null\n }\n }\n\n async [_submitQuickAudit] () {\n if (this.options.audit === false) {\n this.auditReport = null\n return\n }\n\n // we submit the quick audit at this point in the process, as soon as\n // we have all the deps resolved, so that it can overlap with the other\n // actions as much as possible. Stash the promise, which we resolve\n // before finishing the reify() and returning the tree. Thus, we do\n // NOT return the promise, as the intent is for this to run in parallel\n // with the reification, and be resolved at a later time.\n const timeEnd = time.start('reify:audit')\n const options = { ...this.options }\n // Under the linked strategy idealTree is the isolated tree, which the audit cannot traverse; audit the non-isolated tree instead.\n const tree = this.#linkedIdealForAudit || this.idealTree\n\n // if we're operating on a workspace, only audit the workspace deps\n if (this.options.workspaces.length) {\n options.filterSet = this.workspaceDependencySet(\n tree,\n this.options.workspaces,\n this.options.includeWorkspaceRoot\n )\n }\n\n this.auditReport = AuditReport.load(tree, options).then(res => {\n timeEnd()\n return res\n })\n }\n\n // ok! actually unpack stuff into their target locations!\n // The sparse tree has already been created, so we walk the diff\n // kicking off each unpack job. If any fail, we rm the sparse\n // tree entirely and try to put everything back where it was.\n [_unpackNewModules] () {\n const timeEnd = time.start('reify:unpack')\n const unpacks = []\n dfwalk({\n tree: this.diff,\n visit: diff => {\n // no unpacking if we don't want to change this thing\n if (diff.action !== 'CHANGE' && diff.action !== 'ADD') {\n return\n }\n\n const node = diff.ideal\n const bd = this.#bundleUnpacked.has(node)\n const bundleMissing = this.#bundleMissing.has(node)\n\n // check whether we still need to unpack this one.\n // test the inDepBundle last, since that's potentially a tree walk.\n const doUnpack = node && // can't unpack if removed!\n // root node already exists\n !node.isRoot &&\n // already unpacked to read bundle\n !bd &&\n // already unpacked by another dep's bundle\n (bundleMissing || !node.inDepBundle)\n\n if (doUnpack) {\n unpacks.push(this[_reifyNode](node))\n }\n },\n getChildren: diff => diff.children,\n })\n return promiseAllRejectLate(unpacks).then(timeEnd)\n }\n\n // This is the part where we move back the unchanging nodes that were\n // the children of a node that did change. If this fails, the rollback\n // is a three-step process. First, we try to move the retired unchanged\n // nodes BACK to their retirement folders, then delete the sparse tree,\n // then move everything out of retirement.\n [_moveBackRetiredUnchanged] () {\n // get a list of all unchanging children of any shallow retired nodes\n // if they are not the ancestor of any node in the diff set, then the\n // directory won't already exist, so just rename it over.\n // This is sort of an inverse diff tree, of all the nodes where\n // the actualTree and idealTree _don't_ differ, starting from the\n // shallowest nodes that we moved aside in the first place.\n const timeEnd = time.start('reify:unretire')\n const moves = this.#retiredPaths\n this.#retiredUnchanged = {}\n return promiseAllRejectLate(this.diff.children.map(diff => {\n // skip if nothing was retired\n if (diff.action !== 'CHANGE' && diff.action !== 'REMOVE') {\n return\n }\n\n const { path: realFolder } = diff.actual\n const retireFolder = moves[realFolder]\n /* istanbul ignore next - should be impossible */\n debug(() => {\n if (!retireFolder) {\n const er = new Error('trying to un-retire but not retired')\n throw Object.assign(er, {\n realFolder,\n retireFolder,\n actual: diff.actual,\n ideal: diff.ideal,\n action: diff.action,\n })\n }\n })\n\n this.#retiredUnchanged[retireFolder] = []\n return promiseAllRejectLate(diff.unchanged.map(node => {\n // no need to roll back links, since we'll just delete them anyway\n if (node.isLink) {\n return mkdir(dirname(node.path), { recursive: true, force: true })\n .then(() => this[_reifyNode](node))\n }\n\n // will have been moved/unpacked along with bundler\n if (node.inDepBundle && !this.#bundleMissing.has(node)) {\n return\n }\n\n this.#retiredUnchanged[retireFolder].push(node)\n\n const rel = relative(realFolder, node.path)\n const fromPath = resolve(retireFolder, rel)\n // if it has bundleDependencies, then make node_modules. otherwise\n // skip it.\n const bd = node.package.bundleDependencies\n const dir = bd && bd.length ? node.path + '/node_modules' : node.path\n return mkdir(dir, { recursive: true }).then(() => this[_moveContents](node, fromPath))\n }))\n })).then(timeEnd)\n }\n\n // move the contents from the fromPath to the node.path\n [_moveContents] (node, fromPath) {\n return packageContents({\n path: fromPath,\n depth: 1,\n packageJsonCache: new Map([[fromPath + '/package.json', node.package]]),\n }).then(res => promiseAllRejectLate(res.map(path => {\n const rel = relative(fromPath, path)\n const to = resolve(node.path, rel)\n return this[_renamePath](path, to)\n })))\n }\n\n [_rollbackMoveBackRetiredUnchanged] (er) {\n const moves = this.#retiredPaths\n // flip the mapping around to go back\n const realFolders = new Map(Object.entries(moves).map(([k, v]) => [v, k]))\n const promises = Object.entries(this.#retiredUnchanged)\n .map(([retireFolder, nodes]) => promiseAllRejectLate(nodes.map(node => {\n const realFolder = realFolders.get(retireFolder)\n const rel = relative(realFolder, node.path)\n const fromPath = resolve(retireFolder, rel)\n return this[_moveContents]({ ...node, path: fromPath }, node.path)\n })))\n return promiseAllRejectLate(promises)\n .then(() => this[_rollbackCreateSparseTree](er))\n }\n\n [_build] () {\n const timeEnd = time.start('reify:build')\n\n // for all the things being installed, run their appropriate scripts\n // run in tip->root order, so as to be more likely to build a node's\n // deps before attempting to build it itself\n const nodes = []\n dfwalk({\n tree: this.diff,\n leave: diff => {\n if (!diff.ideal.isProjectRoot) {\n nodes.push(diff.ideal)\n }\n },\n // process adds before changes, ignore removals\n getChildren: diff => diff && diff.children,\n filter: diff => diff.action === 'ADD' || diff.action === 'CHANGE',\n })\n\n // pick up link nodes from the unchanged list as we want to run their\n // scripts in every install despite of having a diff status change\n for (const node of this.diff.unchanged) {\n const tree = node.root.target\n\n // skip links that only live within node_modules as they are most\n // likely managed by packages we installed, we only want to rebuild\n // unchanged links we directly manage\n const linkedFromRoot = (node.parent === tree && !node.inert) || node.target.fsTop === tree\n if (node.isLink && linkedFromRoot) {\n nodes.push(node)\n }\n }\n\n return this.rebuild({ nodes, handleOptionalFailure: true }).then(timeEnd)\n }\n\n // the tree is pretty much built now, so it's cleanup time.\n // remove the retired folders, and any deleted nodes\n // If this fails, there isn't much we can do but tell the user about it.\n // Thankfully, it's pretty unlikely that it'll fail, since rm is a node builtin.\n async [_removeTrash] () {\n const timeEnd = time.start('reify:trash')\n const promises = []\n const failures = []\n const _rm = path => rm(path, { recursive: true, force: true }).catch(er => failures.push([path, er]))\n\n for (const path of this[_trashList]) {\n promises.push(_rm(path))\n }\n\n await promiseAllRejectLate(promises)\n if (failures.length) {\n log.warn('cleanup', 'Failed to remove some directories', failures)\n }\n\n timeEnd()\n }\n\n // Remove the root .store left behind by a previous linked install when reifying under a non-linked strategy.\n async #removeStaleStoreDir () {\n const storeDir = resolve(this.path, 'node_modules', '.store')\n if (!existsSync(storeDir)) {\n return\n }\n log.silly('reify', 'removing stale .store from a previous linked install')\n await rm(storeDir, { recursive: true, force: true })\n .catch(/* istanbul ignore next -- rm with force rarely fails */\n er => log.warn('cleanup', 'Failed to remove stale .store directory', er))\n }\n\n // After a linked install, scan node_modules/.store/ and remove any directories that are not referenced by the current ideal tree.\n // Store entries become orphaned when dependencies are updated or removed, because the diff never sees the old store keys.\n // Then sweep the top-level node_modules/ for orphaned symlinks (e.g. an uninstalled dep whose store entry was just removed) so we don't leave dangling links.\n async #cleanOrphanedStoreEntries () {\n const nmDir = resolve(this.path, 'node_modules')\n const storeDir = resolve(nmDir, '.store')\n\n // Enumerate on-disk store entries as full keys, descending one level into each @scope directory because scoped keys nest as .store/@scope/pkg@version-hash.\n let entries\n try {\n const topLevel = await readdir(storeDir, { withFileTypes: true })\n entries = []\n for (const ent of topLevel) {\n if (ent.name.startsWith('@')) {\n let scoped\n try {\n scoped = await readdir(resolve(storeDir, ent.name))\n } catch {\n /* istanbul ignore next -- readdir of an entry we just listed should not fail */\n continue\n }\n for (const name of scoped) {\n entries.push(`${ent.name}/${name}`)\n }\n } else {\n entries.push(ent.name)\n }\n }\n } catch {\n entries = null\n }\n\n // Collect valid store keys and valid top-level links per node_modules directory.\n // Store entries have location node_modules/.store/{key}/node_modules/{pkg}.\n // Top-level links have location {prefix}/node_modules/{pkg} or {prefix}/node_modules/@scope/{pkg}, where {prefix} is empty for the root project and the workspace's localLocation for workspace deps.\n // Locations are normalized to forward slashes here because IsolatedNode/IsolatedLink locations are built with path.join, which uses backslashes on Windows.\n const validKeys = new Set()\n const nmDirs = new Map()\n // Valid bin shim names per node_modules dir, collected from each top-level entry's package.bin so the .bin sweep keeps only shims a still-installed package provides.\n const binsByDir = new Map()\n const NM_PREFIX = 'node_modules/'\n const STORE_MARKER = '/.store/'\n for (const child of this.idealTree.children.values()) {\n const loc = child.location.replace(/\\\\/g, '/')\n if (child.isInStore) {\n // Store location is node_modules/.store/{key}/node_modules/{pkg}.\n // For a scoped package the key is @scope/pkg@version-hash, which spans two path segments, so reconstruct both instead of taking only the scope.\n const parts = loc.split('/')\n const key = parts[2].startsWith('@') ? `${parts[2]}/${parts[3]}` : parts[2]\n validKeys.add(key)\n continue\n }\n // Tree-only Links never exist on disk; skipping them lets the sweep remove any stale self-link left by an older npm version.\n if (child.isLink && child.isUndeclaredWorkspaceLink) {\n continue\n }\n // Real top-level Nodes (e.g. the root's bundled deps) fall through here too, so they are recorded as valid and never swept as stale.\n const nmIdx = loc.lastIndexOf(NM_PREFIX)\n if (nmIdx === -1 || loc.includes(STORE_MARKER)) {\n continue\n }\n const prefix = loc.slice(0, nmIdx)\n const dir = resolve(this.path, prefix, 'node_modules')\n const rest = loc.slice(nmIdx + NM_PREFIX.length)\n let entry\n if (rest.startsWith('@')) {\n const [scope, name] = rest.split('/')\n entry = `${scope}${sep}${name}`\n } else {\n entry = rest.split('/')[0]\n }\n let set = nmDirs.get(dir)\n if (!set) {\n set = new Set()\n nmDirs.set(dir, set)\n }\n set.add(entry)\n\n // package.bin is normalized to an object keyed by bin name; shim names are unscoped even for scoped packages.\n const bin = child.package?.bin\n if (bin && typeof bin === 'object') {\n let binSet = binsByDir.get(dir)\n if (!binSet) {\n binSet = new Set()\n binsByDir.set(dir, binSet)\n }\n for (const bn of Object.keys(bin)) {\n binSet.add(bn)\n }\n }\n }\n\n // Determine which node_modules directories to sweep.\n // For an unfiltered install, sweep the project root and every workspace's node_modules even if no top-level links remain (e.g. last dep was just uninstalled).\n // For a filtered install (npm install -w <ws>), restrict the sweep to the in-scope workspaces so out-of-scope workspaces are left untouched, mirroring what the diff would do.\n // When --include-workspace-root is set, the filter scope pulls in root deps too, so the root node_modules is included in the sweep.\n const filteredNames = this.options.workspaces\n const isFiltered = Array.isArray(filteredNames) && filteredNames.length > 0\n if (isFiltered) {\n const allowedDirs = new Set()\n for (const ws of this.idealTree.fsChildren) {\n if (filteredNames.includes(ws.packageName) || filteredNames.includes(ws.name)) {\n allowedDirs.add(resolve(ws.path, 'node_modules'))\n }\n }\n if (this.options.includeWorkspaceRoot) {\n allowedDirs.add(nmDir)\n }\n for (const dir of [...nmDirs.keys()]) {\n if (!allowedDirs.has(dir)) {\n nmDirs.delete(dir)\n }\n }\n for (const dir of allowedDirs) {\n if (!nmDirs.has(dir)) {\n nmDirs.set(dir, new Set())\n }\n }\n } else {\n if (!nmDirs.has(nmDir)) {\n nmDirs.set(nmDir, new Set())\n }\n for (const ws of this.idealTree.fsChildren) {\n const wsNmDir = resolve(ws.path, 'node_modules')\n if (!nmDirs.has(wsNmDir)) {\n nmDirs.set(wsNmDir, new Set())\n }\n }\n }\n\n if (entries) {\n const orphaned = entries.filter(e => !validKeys.has(e))\n if (orphaned.length) {\n log.silly('reify', 'cleaning orphaned store entries', orphaned)\n await promiseAllRejectLate(\n orphaned.map(e =>\n rm(resolve(storeDir, e), { recursive: true, force: true })\n .catch(/* istanbul ignore next -- rm with force rarely fails */\n er => log.warn('cleanup', `Failed to remove orphaned store entry ${e}`, er))\n )\n )\n // Removing the last scoped orphan under a scope leaves an empty @scope directory behind, so prune any scope directory that is now empty.\n const scopes = new Set(\n orphaned.filter(e => e.startsWith('@')).map(e => e.split('/')[0])\n )\n await promiseAllRejectLate(\n [...scopes].map(async scope => {\n const scopeDir = resolve(storeDir, scope)\n try {\n const remaining = await readdir(scopeDir)\n if (!remaining.length) {\n await rm(scopeDir, { recursive: true, force: true })\n }\n } catch {\n /* istanbul ignore next -- readdir of a scope dir we just listed should not fail */\n }\n })\n )\n }\n }\n\n for (const [dir, valid] of nmDirs) {\n await this.#cleanOrphanedTopLevelLinks(dir, valid)\n await this.#cleanStaleBinLinks(dir, binsByDir.get(dir))\n }\n }\n\n // Remove stale bin shims left in node_modules/.bin after an uninstall under linked, where the diff never emits an action to drop them.\n // A shim is stale when no still-linked package provides its name, or when it is a dangling symlink; matching by name handles both POSIX symlinks and Windows .cmd/.ps1 shims.\n async #cleanStaleBinLinks (nmDir, validBins = new Set()) {\n const binDir = resolve(nmDir, '.bin')\n let names\n try {\n names = await readdir(binDir)\n } catch {\n return\n }\n\n const stale = names.filter(name => {\n const base = name.replace(/\\.(cmd|ps1)$/, '')\n return !validBins.has(base) || !existsSync(resolve(binDir, name))\n })\n\n if (!stale.length) {\n return\n }\n\n log.silly('reify', 'cleaning stale bin links', stale)\n await promiseAllRejectLate(\n stale.map(name =>\n rm(resolve(binDir, name), { force: true })\n .catch(/* istanbul ignore next -- rm with force rarely fails */\n er => log.warn('cleanup', `Failed to remove stale bin link ${name}`, er))\n )\n )\n }\n\n // Remove node_modules/ entries that aren't represented in the ideal tree.\n // Run for the project root and each workspace's node_modules.\n // The linked diff path can't see these because #buildLinkedActualForDiff derives the actual tree from the ideal, so removed deps are never compared.\n // Two kinds of stale entry are removed:\n // - symlinks whose target resolves inside the project root — store links (node_modules/.store/...) and workspace self-links (e.g. node_modules/<ws> -> ../packages/<ws>) that npm itself created.\n // - real package directories — hoisted-layout deps left behind when switching from the hoisted strategy to linked, where every valid top-level entry is a symlink.\n // Symlinks pointing outside the project (e.g. `npm link foo` without --save targeting the global prefix, or hand-made `ln -s` to an external path) and non-package real directories are preserved.\n async #cleanOrphanedTopLevelLinks (nmDir, validTopLevel) {\n const projectPrefix = resolve(this.path) + sep\n let dirents\n try {\n dirents = await readdir(nmDir, { withFileTypes: true })\n } catch {\n return\n }\n\n const isOurOrphan = async (linkPath) => {\n let target\n try {\n target = await readlink(linkPath)\n } catch {\n /* istanbul ignore next -- readlink of an entry we just listed as a symlink should not fail */\n return false\n }\n return resolve(dirname(linkPath), target).startsWith(projectPrefix)\n }\n\n // A real directory is stale only when it is an actual package (has a package.json), so unrelated user directories are never touched.\n const isStaleRealPkg = (dirent, entPath) =>\n dirent.isDirectory() && existsSync(resolve(entPath, 'package.json'))\n\n const isOrphan = async (dirent, entPath) =>\n (dirent.isSymbolicLink() && await isOurOrphan(entPath)) || isStaleRealPkg(dirent, entPath)\n\n const orphaned = []\n const scopes = new Set()\n for (const ent of dirents) {\n // skip npm-managed entries (.bin, .store, .package-lock.json, etc)\n if (ent.name.startsWith('.')) {\n continue\n }\n if (ent.name.startsWith('@')) {\n let scoped\n try {\n scoped = await readdir(resolve(nmDir, ent.name), { withFileTypes: true })\n } catch {\n /* istanbul ignore next -- readdir of an entry we just listed should not fail */\n continue\n }\n for (const pkgEnt of scoped) {\n const key = `${ent.name}${sep}${pkgEnt.name}`\n if (!validTopLevel.has(key) && await isOrphan(pkgEnt, resolve(nmDir, key))) {\n orphaned.push(key)\n scopes.add(ent.name)\n }\n }\n } else if (!validTopLevel.has(ent.name) && await isOrphan(ent, resolve(nmDir, ent.name))) {\n orphaned.push(ent.name)\n }\n }\n\n if (!orphaned.length) {\n return\n }\n\n log.silly('reify', 'cleaning orphaned top-level entries', orphaned)\n await promiseAllRejectLate(\n orphaned.map(name =>\n rm(resolve(nmDir, name), { recursive: true, force: true })\n .catch(/* istanbul ignore next -- rm with force rarely fails */\n er => log.warn('cleanup', `Failed to remove orphaned entry ${name}`, er))\n )\n )\n\n // Removing the last package under a scope leaves an empty @scope directory behind, so prune any scope directory that is now empty.\n await promiseAllRejectLate(\n [...scopes].map(async scope => {\n const scopeDir = resolve(nmDir, scope)\n try {\n const remaining = await readdir(scopeDir)\n if (!remaining.length) {\n await rm(scopeDir, { recursive: true, force: true })\n }\n } catch {\n /* istanbul ignore next -- readdir of a scope dir we just listed should not fail */\n }\n })\n )\n }\n\n // last but not least, we save the ideal tree metadata to the package-lock\n // or shrinkwrap file, and any additions or removals to package.json\n async [_saveIdealTree] (options) {\n // the ideal tree is actualized now, hooray!\n // it still contains all the references to optional nodes that were removed\n // for install failures. Those still end up in the shrinkwrap, so we\n // save it first, then prune out the optional trash, and then return it.\n\n const save = !(options.save === false)\n\n // we check for updates in order to make sure we run save ideal tree\n // even though save=false since we want `npm update` to be able to\n // write to package-lock files by default\n const hasUpdates = this[_updateAll] || this[_updateNames].length\n\n // we're going to completely skip save ideal tree in case of a global or\n // dry-run install and also if the save option is set to false, EXCEPT for\n // update since the expected behavior for npm7+ is for update to\n // NOT save to package.json, we make that exception since we still want\n // saveIdealTree to be able to write the lockfile by default.\n const saveIdealTree = !(\n (!save && !hasUpdates)\n || this.options.global\n || this.options.dryRun\n )\n\n if (!saveIdealTree) {\n return false\n }\n\n const timeEnd = time.start('reify:save')\n\n const updatedTrees = new Set()\n const updateNodes = nodes => {\n for (const { name, tree: addTree } of nodes) {\n // addTree either the root, or a workspace\n const edge = addTree.edgesOut.get(name)\n const pkg = addTree.package\n const req = npa.resolve(name, edge.spec, addTree.realpath)\n const { rawSpec, subSpec } = req\n\n const spec = subSpec ? subSpec.rawSpec : rawSpec\n const child = edge.to\n\n // if we tried to install an optional dep, but it was a version\n // that we couldn't resolve, this MAY be missing. if we haven't\n // blown up by now, it's because it was not a problem, though, so\n // just move on.\n if (!child || !addTree.isTop) {\n continue\n }\n\n let newSpec\n // True if the dependency is getting installed from a local file path\n // In this case it is not possible to do the normal version comparisons\n // as the new version will be a file path\n const isLocalDep = req.type === 'directory' || req.type === 'file'\n if (req.registry) {\n const version = child.version\n const prefixRange = version ? this.options.savePrefix + version : '*'\n // if we installed a range, then we save the range specified\n // if it is not a subset of the ^x.y.z. eg, installing a range\n // of `1.x <1.2.3` will not be saved as `^1.2.0`, because that\n // would allow versions outside the requested range. Tags and\n // specific versions save with the save-prefix.\n const isRange = (subSpec || req).type === 'range'\n\n let range = spec\n if (\n !isRange ||\n spec === '*' ||\n subset(prefixRange, spec, { loose: true })\n ) {\n range = prefixRange\n }\n\n const pname = child.packageName\n const alias = name !== pname\n newSpec = alias ? `npm:${pname}@${range}` : range\n } else if (req.hosted) {\n // save the git+https url if it has auth; otherwise, shortcut\n const h = req.hosted\n const opt = { noCommittish: false }\n if (h.https && (h.auth || h.default === 'https')) {\n newSpec = `git+${h.https(opt)}`\n } else {\n newSpec = h.shortcut(opt)\n }\n } else if (isLocalDep) {\n // when finding workspace nodes, make sure that\n // we save them using their version instead of\n // using their relative path\n if (edge.type === 'workspace') {\n const { version } = edge.to.target\n const prefixRange = version ? this.options.savePrefix + version : '*'\n newSpec = prefixRange\n } else {\n // save the relative path in package.json\n // Normally saveSpec is updated with the proper relative\n // path already, but it's possible to specify a full absolute\n // path initially, in which case we can end up with the wrong\n // thing, so just get the ultimate fetchSpec and relativize it.\n const p = req.fetchSpec.replace(/^file:/, '')\n const rel = relpath(addTree.realpath, p)\n newSpec = `file:${rel}`\n }\n } else {\n newSpec = req.saveSpec\n }\n\n if (options.saveType) {\n const depType = saveTypeMap.get(options.saveType)\n pkg[depType][name] = newSpec\n // PackageJson.normalize will have moved it here if it was in both, if it is empty it will be deleted later\n if (options.saveType === 'prod' && pkg.optionalDependencies) {\n delete pkg.optionalDependencies[name]\n }\n } else {\n if (hasSubKey(pkg, 'dependencies', name)) {\n pkg.dependencies[name] = newSpec\n }\n\n if (hasSubKey(pkg, 'devDependencies', name)) {\n pkg.devDependencies[name] = newSpec\n // don't update peer or optional if we don't have to\n if (hasSubKey(pkg, 'peerDependencies', name) && (isLocalDep || !intersects(newSpec, pkg.peerDependencies[name]))) {\n pkg.peerDependencies[name] = newSpec\n }\n\n if (hasSubKey(pkg, 'optionalDependencies', name) && (isLocalDep || !intersects(newSpec, pkg.optionalDependencies[name]))) {\n pkg.optionalDependencies[name] = newSpec\n }\n } else {\n if (hasSubKey(pkg, 'peerDependencies', name)) {\n pkg.peerDependencies[name] = newSpec\n }\n\n if (hasSubKey(pkg, 'optionalDependencies', name)) {\n pkg.optionalDependencies[name] = newSpec\n }\n }\n }\n\n updatedTrees.add(addTree)\n }\n }\n\n // Returns true if any of the edges from this node has a semver\n // range definition that is an exact match to the version installed\n // e.g: should return true if for a given and installed version 1.0.0,\n // range is either =1.0.0 or 1.0.0\n const exactVersion = node => {\n for (const edge of node.edgesIn) {\n try {\n if (subset(edge.spec, node.version)) {\n return false\n }\n } catch {\n // ignore errors\n }\n }\n return true\n }\n\n // helper that retrieves an array of nodes that were\n // potentially updated during the reify process, in order\n // to limit the number of nodes to check and update, only\n // select nodes from the inventory that are direct deps\n // of a given package.json (project root or a workspace)\n // and in ase of using a list of `names`, restrict nodes\n // to only names that are found in this list\n const retrieveUpdatedNodes = names => {\n const filterDirectDependencies = node =>\n !node.isRoot && node.resolveParent && node.resolveParent.isRoot\n && (!names || names.includes(node.name))\n && exactVersion(node) // skip update for exact ranges\n\n const directDeps = this.idealTree.inventory\n .filter(filterDirectDependencies)\n\n // traverses the list of direct dependencies and collect all nodes\n // to be updated, since any of them might have changed during reify\n const nodes = []\n for (const node of directDeps) {\n for (const edgeIn of node.edgesIn) {\n nodes.push({\n name: node.name,\n tree: edgeIn.from.target,\n })\n }\n }\n return nodes\n }\n\n if (save) {\n // when using update all alongside with save, we'll make\n // sure to refresh every dependency of the root idealTree\n if (this[_updateAll]) {\n const nodes = retrieveUpdatedNodes()\n updateNodes(nodes)\n } else {\n // resolvedAdd is the list of user add requests, but with names added\n // to things like git repos and tarball file/urls. However, if the\n // user requested 'foo@', and we have a foo@file:../foo, then we should\n // end up saving the spec we actually used, not whatever they gave us.\n if (this[_resolvedAdd].length) {\n updateNodes(this[_resolvedAdd])\n }\n\n // if updating given dependencies by name, restrict the list of\n // nodes to check to only those currently in _updateNames\n if (this[_updateNames].length) {\n const nodes = retrieveUpdatedNodes(this[_updateNames])\n updateNodes(nodes)\n }\n\n // grab any from explicitRequests that had deps removed\n for (const { from: tree } of this.explicitRequests) {\n updatedTrees.add(tree)\n }\n }\n }\n\n if (save) {\n for (const tree of updatedTrees) {\n // refresh the edges so they have the correct specs\n tree.package = tree.package\n const pkgJson = await PackageJson.load(tree.path, { create: true })\n const {\n dependencies = {},\n devDependencies = {},\n optionalDependencies = {},\n peerDependencies = {},\n // bundleDependencies is not required by PackageJson like the other\n // fields here PackageJson also doesn't omit an empty array for this\n // field so defaulting this to an empty array would add that field to\n // every package.json file.\n bundleDependencies,\n // resolvePatchedDependencies drops entries orphaned by uninstall; persist that removal\n patchedDependencies,\n } = tree.package\n\n pkgJson.update({\n dependencies,\n devDependencies,\n optionalDependencies,\n peerDependencies,\n bundleDependencies,\n patchedDependencies,\n })\n await pkgJson.save()\n }\n }\n\n // before now edge specs could be changing, affecting the `requires` field\n // in the package lock, so we hold off saving to the very last action\n if (this.options.usePackageLock) {\n // preserve indentation, if possible\n let format = this.idealTree.package[Symbol.for('indent')]\n if (format === undefined) {\n format = ' '\n }\n\n // TODO this ignores options.save\n await this.idealTree.meta.save({\n format: (this.options.formatPackageLock && format) ? format\n : this.options.formatPackageLock,\n })\n }\n\n timeEnd()\n return true\n }\n}\n","const { join } = require('node:path')\nconst { depth } = require('treeverse')\nconst crypto = require('node:crypto')\nconst { IsolatedNode, IsolatedLink } = require('../isolated-classes.js')\nconst nameFromFolder = require('@npmcli/name-from-folder')\n\n// generate short hash key based on the dependency tree starting at this node\nconst getKey = (startNode) => {\n const deps = []\n const branch = []\n depth({\n tree: startNode,\n getChildren: node => node.dependencies,\n visit: node => {\n branch.push(`${node.packageName}@${node.version}`)\n // a patch changes the materialized contents, so it must change the store key.\n // the patch segment is only appended when present, so unpatched keys are unchanged.\n const patch = node.patched ? `::patch:${node.patched.integrity}` : ''\n deps.push(`${branch.join('->')}::${node.resolved}${patch}`)\n },\n leave: () => {\n branch.pop()\n },\n })\n deps.sort()\n // TODO these replaces were originally to deal with node 14 not supporting base64url and likely don't need to happen anymore\n // Changing this is a pretty significant breaking change, but removing parts of the hash increases collision possibilities (even if slight).\n const hash = crypto.createHash('shake256', { outputLength: 16 })\n .update(deps.join(','))\n .digest('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=+$/m, '')\n // a patched entry gets a distinct, identifiable side-store key so unpatched consumers keep sharing the original\n const patchSuffix = startNode.patched ? '+patch' : ''\n return `${startNode.packageName}@${startNode.version}-${hash}${patchSuffix}`\n}\n\nmodule.exports = cls => class IsolatedReifier extends cls {\n #externalProxies = new Map()\n #omit = new Set()\n #rootDeclaredDeps = new Set()\n #processedEdges = new Set()\n #workspaceProxies = new Map()\n\n #generateChild (node, location, pkg, isInStore, root, inBundle = false) {\n const newChild = new IsolatedNode({\n isInStore,\n inBundle,\n isRegistryDependency: node.isRegistryDependency,\n isRootDependency: node.isRootDependency,\n location,\n name: node.packageName || node.name,\n optional: node.optional,\n package: pkg,\n parent: root,\n patched: node.patched,\n path: join(this.idealGraph.localPath, location),\n resolved: node.resolved,\n root,\n })\n // XXX top is from place-dep not lib/node.js\n newChild.top = { path: this.idealGraph.localPath }\n root.children.set(newChild.location, newChild)\n root.inventory.set(newChild.location, newChild)\n }\n\n /**\n * Create an ideal graph.\n *\n * An implementation of npm RFC-0042\n * https://github.com/npm/rfcs/blob/main/accepted/0042-isolated-mode.md\n *\n * This entire file should be considered technical debt that will be resolved with an Arborist refactor or rewrite.\n * Embedded logic in Nodes and Links, and the incremental state of building trees and reifying contains too many assumptions to do a linked mode properly.\n *\n * Instead, this approach takes a tree built from build-ideal-tree, and returns a new tree-like structure without the embedded logic of Node and Link classes.\n *\n * Since the RFC requires leaving the package-lock in place, this approach temporarily replaces the tree state for a couple of steps of reifying.\n *\n **/\n async makeIdealGraph () {\n const idealTree = this.idealTree\n this.#omit = new Set(this.options.omit)\n const omit = this.#omit\n\n // npm auto-creates 'workspace' edges from root to all workspaces.\n // For isolated/linked mode, only include workspaces that root explicitly declares as dependencies.\n // When omitting dep types, exclude those from the declared set so their workspaces aren't hoisted.\n const rootPkg = idealTree.package\n this.#rootDeclaredDeps = new Set(Object.keys(Object.assign({},\n rootPkg.dependencies,\n (!omit.has('dev') && rootPkg.devDependencies),\n (!omit.has('optional') && rootPkg.optionalDependencies),\n (!omit.has('peer') && rootPkg.peerDependencies)\n )))\n\n // XXX this sometimes acts like a node too\n this.idealGraph = {\n external: [],\n isProjectRoot: true,\n localLocation: idealTree.location,\n localPath: idealTree.path,\n path: idealTree.path,\n }\n this.counter = 0\n\n // Skip extraneous fsChildren: workspaces removed from the root manifest can linger in fsChildren via the lockfile, and re-materializing them here would re-create a directory the user just deleted.\n const fsChildren = Array.from(idealTree.fsChildren.values()).filter(w => !w.extraneous)\n this.idealGraph.workspaces = await Promise.all(fsChildren.map(w => this.#workspaceProxy(w)))\n const processed = new Set()\n const queue = [idealTree, ...idealTree.fsChildren]\n while (queue.length !== 0) {\n const next = queue.pop()\n if (processed.has(next.location)) {\n continue\n }\n processed.add(next.location)\n next.edgesOut.forEach(edge => {\n if (edge.to && !(next.package.bundleDependencies || next.package.bundledDependencies || []).includes(edge.to.name) && !edge.to.shouldOmit?.(omit)) {\n queue.push(edge.to)\n }\n })\n // local `file:` deps are in fsChildren but are not workspaces.\n // they are already handled as workspace-like proxies above and should not go through the external/store extraction path.\n // Links with file: resolved paths (from `npm link`) should also be treated as local dependencies and symlinked directly instead of being extracted into the store.\n const isLocalFileDep = next.isLink && next.resolved?.startsWith('file:')\n if (isLocalFileDep && !idealTree.fsChildren.has(next) && !idealTree.fsChildren.has(next.target)) {\n this.idealGraph.workspaces.push(await this.#workspaceProxy(next.target))\n } else if (!next.isProjectRoot && !next.isWorkspace && !next.inert && !idealTree.fsChildren.has(next) && !idealTree.fsChildren.has(next.target)) {\n this.idealGraph.external.push(await this.#externalProxy(next))\n }\n }\n\n await this.#assignCommonProperties(idealTree, this.idealGraph)\n }\n\n async #workspaceProxy (node) {\n if (this.#workspaceProxies.has(node)) {\n return this.#workspaceProxies.get(node)\n }\n const result = {}\n // XXX this goes recursive if we don't set here because assignCommonProperties also calls this.#workspaceProxy\n this.#workspaceProxies.set(node, result)\n result.localLocation = node.location\n result.localPath = node.path\n result.isWorkspace = true\n result.resolved = node.resolved\n await this.#assignCommonProperties(node, result)\n return result\n }\n\n async #externalProxy (node) {\n if (this.#externalProxies.has(node)) {\n return this.#externalProxies.get(node)\n }\n const result = {}\n // XXX this goes recursive if we don't set here because assignCommonProperties also calls this.#externalProxy\n this.#externalProxies.set(node, result)\n await this.#assignCommonProperties(node, result)\n result.optional = node.optional\n result.resolved = node.resolved\n result.version = node.version\n // Carry the source node's registry-dependency flag so the store node retains it.\n // IsolatedNode has no edges to recompute it from, and reify's registry-tarball allow-remote exemption depends on it.\n result.isRegistryDependency = node.isRegistryDependency\n // Same reasoning for allow-remote=root: the store node has no edgesIn, so capture from the source node whether it satisfies a valid edge from the project root or a workspace.\n result.isRootDependency = [...node.edgesIn].some(e =>\n e.valid && (e.from?.isProjectRoot || e.from?.isWorkspace)\n )\n return result\n }\n\n async #assignCommonProperties (node, result) {\n result.root = this.idealGraph\n // XXX does anything need this?\n result.id = this.counter++\n /* istanbul ignore next - packageName is always set for real packages */\n result.name = result.isWorkspace ? (node.packageName || node.name) : node.name\n // strip any path traversal from package.json name fields before they hit path.join below\n result.packageName = nameFromFolder(node.packageName || node.path)\n result.patched = node.patched\n result.package = { ...node.package }\n result.package.bundleDependencies = undefined\n\n let edges = [...node.edgesOut.values()].filter(edge =>\n edge.to?.target &&\n !(node.package.bundledDependencies || node.package.bundleDependencies)?.includes(edge.to.name)\n )\n\n // Only omit edge types for root and workspace nodes (matching shouldOmit scope)\n if ((node.isProjectRoot || node.isWorkspace) && this.#omit.size) {\n edges = edges.filter(edge => {\n if (edge.dev && this.#omit.has('dev')) {\n return false\n }\n if (edge.optional && this.#omit.has('optional')) {\n return false\n }\n if (edge.peer && this.#omit.has('peer')) {\n return false\n }\n return true\n })\n }\n\n let nonOptionalDeps = edges.filter(edge => !edge.optional).map(edge => edge.to.target)\n\n // npm auto-creates 'workspace' edges from root to all workspaces.\n // For isolated/linked mode, only include workspaces that root explicitly declares as dependencies.\n if (node.isProjectRoot) {\n nonOptionalDeps = nonOptionalDeps.filter(n => !n.isWorkspace || this.#rootDeclaredDeps.has(n.packageName))\n }\n\n // When legacyPeerDeps is enabled, peer dep edges are not created on the node.\n // Resolve them from the tree so they get symlinked in the store.\n const peerDeps = node.package.peerDependencies\n if (peerDeps && node.legacyPeerDeps) {\n const edgeNames = new Set(edges.map(edge => edge.name))\n for (const peerName in peerDeps) {\n if (!edgeNames.has(peerName)) {\n const resolved = node.resolve(peerName)\n if (resolved && resolved !== node && !resolved.inert) {\n nonOptionalDeps.push(resolved.target)\n }\n }\n }\n }\n\n // local `file:` deps (non-workspace fsChildren) should be treated as local dependencies, not external, so they get symlinked directly instead of being extracted into the store.\n // A file: dep surfaces as a Link edge whose resolved spec starts with file:; detect it from the edge so the target is treated as local even when it is absent from idealTree.fsChildren (a workspace consumer, or a target outside the repo root via npm link).\n const fileLinkTargets = new Set(edges.filter(e => e.to?.isLink && e.to.resolved?.startsWith('file:')).map(e => e.to.target))\n const isLocal = (n) => n.isWorkspace || node.fsChildren?.has(n) || fileLinkTargets.has(n)\n const optionalDeps = edges.filter(edge => edge.optional).map(edge => edge.to.target)\n\n // Optional peers declared only in peerDependenciesMeta (e.g. `@types/react`) have no edge, so the materialization above misses them.\n // Resolve each from the tree and link it; if nobody provides it, node.resolve finds nothing and it stays omitted.\n const peerMeta = node.package.peerDependenciesMeta\n if (peerMeta) {\n const resolvedNames = new Set([...nonOptionalDeps, ...optionalDeps].map(n => n.name))\n for (const peerName in peerMeta) {\n if (!peerMeta[peerName]?.optional || resolvedNames.has(peerName)) {\n continue\n }\n const resolved = node.resolve(peerName)?.target\n if (resolved && resolved !== node && !resolved.inert && !isLocal(resolved)) {\n optionalDeps.push(resolved)\n }\n }\n }\n result.localDependencies = await Promise.all(nonOptionalDeps.filter(isLocal).map(n => this.#workspaceProxy(n)))\n result.externalDependencies = await Promise.all(nonOptionalDeps.filter(n => !isLocal(n) && !n.inert).map(n => this.#externalProxy(n)))\n result.externalOptionalDependencies = await Promise.all(optionalDeps.filter(n => !n.inert).map(n => this.#externalProxy(n)))\n result.dependencies = [\n ...result.externalDependencies,\n ...result.localDependencies,\n ...result.externalOptionalDependencies,\n ]\n }\n\n async #createBundledTree () {\n // TODO: make sure that idealTree object exists\n const idealTree = this.idealTree\n // TODO: test workspaces having bundled deps\n const queue = []\n\n for (const [, edge] of idealTree.edgesOut) {\n if (edge.to && (idealTree.package.bundleDependencies || idealTree.package.bundledDependencies || []).includes(edge.to.name)) {\n queue.push({ from: idealTree, to: edge.to })\n }\n }\n for (const child of idealTree.fsChildren) {\n for (const [, edge] of child.edgesOut) {\n if (edge.to && (child.package.bundleDependencies || child.package.bundledDependencies || []).includes(edge.to.name)) {\n queue.push({ from: child, to: edge.to })\n }\n }\n }\n\n const processed = new Set()\n const nodes = new Map()\n const edges = []\n while (queue.length !== 0) {\n const nextEdge = queue.pop()\n const key = `${nextEdge.from.location}=>${nextEdge.to.location}`\n // should be impossible, unless bundled is duped\n /* istanbul ignore next */\n if (processed.has(key)) {\n continue\n }\n processed.add(key)\n const from = nextEdge.from\n if (!from.isRoot && !from.isWorkspace) {\n nodes.set(from.location, { location: from.location, resolved: from.resolved, name: from.name, optional: from.optional, pkg: { ...from.package, bundleDependencies: undefined } })\n }\n const to = nextEdge.to\n nodes.set(to.location, { location: to.location, resolved: to.resolved, name: to.name, optional: to.optional, pkg: { ...to.package, bundleDependencies: undefined } })\n edges.push({ from: from.isRoot ? 'root' : from.location, to: to.location })\n\n to.edgesOut.forEach(edge => {\n // an edge out should always have a to\n /* istanbul ignore else */\n if (edge.to) {\n queue.push({ from: edge.from, to: edge.to })\n }\n })\n }\n return { edges, nodes }\n }\n\n async createIsolatedTree () {\n await this.makeIdealGraph()\n const bundledTree = await this.#createBundledTree()\n\n const root = new IsolatedNode(this.idealGraph)\n root.root = root\n root.inventory.set('', root)\n const processed = new Set()\n for (const c of this.idealGraph.workspaces) {\n const wsName = c.packageName\n // XXX parent? root?\n const workspace = new IsolatedNode({\n location: c.localLocation,\n name: wsName,\n package: c.package,\n path: c.localPath,\n resolved: c.resolved,\n })\n root.fsChildren.add(workspace)\n root.inventory.set(workspace.location, workspace)\n root.workspaces.set(wsName, workspace.path)\n\n // Declared workspaces are symlinked at root node_modules/.\n // Undeclared workspaces get a tree-only Link kept for diff/filter participation but not materialized on disk.\n const isDeclared = this.#rootDeclaredDeps.has(wsName)\n const wsLink = new IsolatedLink({\n location: isDeclared ? join('node_modules', wsName) : join(c.localLocation, 'node_modules', wsName),\n name: wsName,\n package: workspace.package,\n parent: root,\n path: isDeclared ? join(root.path, 'node_modules', wsName) : join(root.path, c.localLocation, 'node_modules', wsName),\n realpath: workspace.path,\n root,\n target: workspace,\n })\n if (!isDeclared) {\n wsLink.isUndeclaredWorkspaceLink = true\n }\n root.children.set(wsName, wsLink)\n root.inventory.set(wsLink.location, wsLink)\n workspace.linksIn.add(wsLink)\n }\n\n this.idealGraph.external.forEach(c => {\n const key = getKey(c)\n if (processed.has(key)) {\n return\n }\n processed.add(key)\n const location = join('node_modules', '.store', key, 'node_modules', c.packageName)\n this.#generateChild(c, location, c.package, true, root)\n })\n\n bundledTree.nodes.forEach(node => {\n this.#generateChild(node, node.location, node.pkg, false, root, true)\n })\n\n bundledTree.edges.forEach(edge => {\n const from = edge.from === 'root' ? root : root.inventory.get(edge.from)\n const to = root.inventory.get(edge.to)\n // Maybe optional should be propagated from the original edge\n const newEdge = { optional: false, from, to }\n from.edgesOut.set(to.name, newEdge)\n to.edgesIn.add(newEdge)\n })\n\n this.#processEdges(this.idealGraph, false, root)\n for (const node of this.idealGraph.workspaces) {\n this.#processEdges(node, false, root)\n }\n return root\n }\n\n #processEdges (node, externalEdge, root) {\n const key = getKey(node)\n if (this.#processedEdges.has(key)) {\n return\n }\n this.#processedEdges.add(key)\n\n let from, nmFolder\n if (externalEdge) {\n const fromLocation = join('node_modules', '.store', key, 'node_modules', node.packageName)\n from = root.children.get(fromLocation)\n nmFolder = join('node_modules', '.store', key, 'node_modules')\n } else {\n from = node.isProjectRoot ? root : root.inventory.get(node.localLocation)\n nmFolder = join(node.localLocation, 'node_modules')\n }\n /* istanbul ignore next - strict-peer-deps can exclude nodes from the tree */\n if (!from) {\n return\n }\n\n for (const dep of node.localDependencies) {\n this.#processEdges(dep, false, root)\n // nonOptional, local\n this.#processDeps(dep, false, false, root, from, nmFolder)\n }\n for (const dep of node.externalDependencies) {\n this.#processEdges(dep, true, root)\n // nonOptional, external\n this.#processDeps(dep, false, true, root, from, nmFolder)\n }\n for (const dep of node.externalOptionalDependencies) {\n this.#processEdges(dep, true, root)\n // optional, external\n this.#processDeps(dep, true, true, root, from, nmFolder)\n }\n }\n\n #processDeps (dep, optional, external, root, from, nmFolder) {\n const toKey = getKey(dep)\n\n let target\n if (external) {\n const toLocation = join('node_modules', '.store', toKey, 'node_modules', dep.packageName)\n target = root.children.get(toLocation)\n } else {\n target = root.inventory.get(dep.localLocation)\n }\n // TODO: we should no-op is an edge has already been created with the same fromKey and toKey\n /* istanbul ignore next - strict-peer-deps can exclude nodes from the tree */\n if (!target) {\n return\n }\n\n if (dep.package.bin) {\n for (const bn in dep.package.bin) {\n target.binPaths.push(join(dep.root.localPath, nmFolder, '.bin', bn))\n }\n }\n\n const pkg = {\n _id: dep.package._id,\n bin: target.package.bin,\n bundleDependencies: undefined,\n deprecated: undefined,\n scripts: dep.package.scripts,\n version: dep.package.version,\n }\n const link = new IsolatedLink({\n isStoreLink: true,\n location: join(nmFolder, dep.name),\n name: toKey,\n optional,\n parent: root,\n package: pkg,\n path: join(dep.root.localPath, nmFolder, dep.name),\n realpath: target.path,\n resolved: external ? `file:.store/${toKey}/node_modules/${dep.packageName}` : dep.resolved,\n root,\n target,\n })\n // XXX top is from place-dep not lib/link.js\n link.top = { path: dep.root.localPath }\n const newEdge1 = { optional, from, to: link }\n from.edgesOut.set(dep.name, newEdge1)\n link.edgesIn.add(newEdge1)\n const newEdge2 = { optional: false, from: link, to: target }\n link.edgesOut.set(dep.name, newEdge2)\n target.edgesIn.add(newEdge2)\n root.children.set(link.location, link)\n }\n}\n","// The arborist manages three trees:\n// - actual\n// - virtual\n// - ideal\n//\n// The actual tree is what's present on disk in the node_modules tree\n// and elsewhere that links may extend.\n//\n// The virtual tree is loaded from metadata (package.json and lock files).\n//\n// The ideal tree is what we WANT that actual tree to become. This starts\n// with the virtual tree, and then applies the options requesting\n// add/remove/update actions.\n//\n// To reify a tree, we calculate a diff between the ideal and actual trees,\n// and then turn the actual tree into the ideal tree by taking the actions\n// required. At the end of the reification process, the actualTree is\n// updated to reflect the changes.\n//\n// Each tree has an Inventory at the root. Shrinkwrap is tracked by Arborist\n// instance. It always refers to the actual tree, but is updated (and written\n// to disk) on reification.\n\n// Each of the mixin \"classes\" adds functionality, but are not dependent on\n// constructor call order. So, we just load them in an array, and build up\n// the base class, so that the overall voltron class is easier to test and\n// cover, and separation of concerns can be maintained.\n\nconst { resolve } = require('node:path')\nconst { homedir } = require('node:os')\nconst { depth } = require('treeverse')\nconst mapWorkspaces = require('@npmcli/map-workspaces')\nconst { log, time } = require('proc-log')\nconst { saveTypeMap } = require('../add-rm-pkg-deps.js')\nconst AuditReport = require('../audit-report.js')\nconst relpath = require('../relpath.js')\nconst PackumentCache = require('../packument-cache.js')\n\nconst mixins = [\n require('../tracker.js'),\n require('./build-ideal-tree.js'),\n require('./load-actual.js'),\n require('./load-virtual.js'),\n require('./rebuild.js'),\n require('./reify.js'),\n require('./isolated-reifier.js'),\n]\n\nconst _setWorkspaces = Symbol.for('setWorkspaces')\nconst Base = mixins.reduce((a, b) => b(a), require('node:events'))\n\n// if it's 1, 2, or 3, set it explicitly that.\n// if undefined or null, set it null\n// otherwise, throw.\nconst lockfileVersion = lfv => {\n if (lfv === 1 || lfv === 2 || lfv === 3) {\n return lfv\n }\n\n if (lfv === undefined || lfv === null) {\n return null\n }\n\n throw new TypeError('Invalid lockfileVersion config: ' + lfv)\n}\n\nclass Arborist extends Base {\n constructor (options = {}) {\n const timeEnd = time.start('arborist:ctor')\n super(options)\n\n // normalize trailing slash\n const registry = options.registry || 'https://registry.npmjs.org'\n options.registry = this.registry = registry.replace(/(?<!\\/)\\/+$/, '') + '/'\n\n // TODO as we consolidate constructors it's more apparent that we are not parsing options and using this.options consistently\n const {\n actualTree,\n global,\n idealTree = null,\n installLinks = false,\n legacyPeerDeps = false,\n virtualTree,\n workspaces,\n } = options\n\n if (workspaces?.length && global) {\n throw new Error('Cannot operate on workspaces in global mode')\n }\n\n // the tree of nodes on disk\n this.actualTree = actualTree\n this.idealTree = idealTree\n this.installLinks = installLinks\n this.legacyPeerDeps = legacyPeerDeps\n // the virtual tree we load from a shrinkwrap\n this.virtualTree = virtualTree\n\n this.options = {\n nodeVersion: process.version,\n ...options,\n Arborist: this.constructor,\n allowScripts: options.allowScripts ?? null,\n binLinks: 'binLinks' in options ? !!options.binLinks : true,\n cache: options.cache || `${homedir()}/.npm/_cacache`,\n dangerouslyAllowAllScripts: !!options.dangerouslyAllowAllScripts,\n dryRun: !!options.dryRun,\n formatPackageLock: 'formatPackageLock' in options ? !!options.formatPackageLock : true,\n force: !!options.force,\n global: !!options.global,\n ignoreScripts: !!options.ignoreScripts,\n installStrategy: options.global ? 'shallow' : (options.installStrategy ? options.installStrategy : 'hoisted'),\n lockfileVersion: lockfileVersion(options.lockfileVersion),\n packageLockOnly: !!options.packageLockOnly,\n packumentCache: options.packumentCache || new PackumentCache(),\n path: options.path || '.',\n rebuildBundle: 'rebuildBundle' in options ? !!options.rebuildBundle : true,\n replaceRegistryHost: options.replaceRegistryHost,\n savePrefix: 'savePrefix' in options ? options.savePrefix : '^',\n scriptShell: options.scriptShell,\n usePackageLock: 'packageLock' in options ? options.packageLock : true,\n workspaces: options.workspaces || [],\n workspacesEnabled: options.workspacesEnabled !== false,\n }\n // TODO we only ever look at this.options.replaceRegistryHost, not\n // this.replaceRegistryHost. Defaulting needs to be written back to\n // this.options to work properly\n this.replaceRegistryHost = this.options.replaceRegistryHost =\n (!this.options.replaceRegistryHost || this.options.replaceRegistryHost === 'npmjs') ?\n 'registry.npmjs.org' : this.options.replaceRegistryHost\n\n if (options.saveType && !saveTypeMap.get(options.saveType)) {\n throw new Error(`Invalid saveType ${options.saveType}`)\n }\n this.cache = resolve(this.options.cache)\n this.diff = null\n this.path = resolve(this.options.path)\n this.scriptsRun = new Set()\n timeEnd()\n }\n\n // TODO: We should change these to static functions instead\n // of methods for the next major version\n\n // Get the actual nodes corresponding to a root node's child workspaces,\n // given a list of workspace names.\n workspaceNodes (tree, workspaces) {\n const wsMap = tree.workspaces\n if (!wsMap) {\n log.warn('workspaces', 'filter set, but no workspaces present')\n return []\n }\n\n const nodes = []\n for (const name of workspaces) {\n const path = wsMap.get(name)\n if (!path) {\n log.warn('workspaces', `${name} in filter set, but not in workspaces`)\n continue\n }\n\n const loc = relpath(tree.realpath, path)\n const node = tree.inventory.get(loc)\n\n if (!node) {\n log.warn('workspaces', `${name} in filter set, but no workspace folder present`)\n continue\n }\n\n nodes.push(node)\n }\n\n return nodes\n }\n\n // returns a set of workspace nodes and all their deps\n // TODO why is includeWorkspaceRoot a param?\n // TODO why is workspaces a param?\n workspaceDependencySet (tree, workspaces, includeWorkspaceRoot) {\n const wsNodes = this.workspaceNodes(tree, workspaces)\n if (includeWorkspaceRoot) {\n for (const edge of tree.edgesOut.values()) {\n if (edge.type !== 'workspace' && edge.to) {\n wsNodes.push(edge.to)\n }\n }\n }\n const wsDepSet = new Set(wsNodes)\n const extraneous = new Set()\n for (const node of wsDepSet) {\n for (const edge of node.edgesOut.values()) {\n const dep = edge.to\n if (dep) {\n wsDepSet.add(dep)\n if (dep.isLink) {\n wsDepSet.add(dep.target)\n }\n }\n }\n for (const child of node.children.values()) {\n if (child.extraneous) {\n extraneous.add(child)\n }\n }\n }\n for (const extra of extraneous) {\n wsDepSet.add(extra)\n }\n\n return wsDepSet\n }\n\n // returns a set of root dependencies, excluding dependencies that are\n // exclusively workspace dependencies\n excludeWorkspacesDependencySet (tree) {\n const rootDepSet = new Set()\n depth({\n tree,\n visit: node => {\n for (const { to } of node.edgesOut.values()) {\n if (!to || to.isWorkspace) {\n continue\n }\n for (const edgeIn of to.edgesIn.values()) {\n if (edgeIn.from.isRoot || rootDepSet.has(edgeIn.from)) {\n rootDepSet.add(to)\n }\n }\n }\n return node\n },\n filter: node => node,\n getChildren: (node, tree) =>\n [...tree.edgesOut.values()].map(edge => edge.to),\n })\n return rootDepSet\n }\n\n async [_setWorkspaces] (node) {\n const workspaces = await mapWorkspaces({\n cwd: node.path,\n pkg: node.package,\n })\n\n if (node && workspaces.size) {\n node.workspaces = workspaces\n }\n\n return node\n }\n\n async audit (options = {}) {\n this.addTracker('audit')\n if (this.options.global) {\n throw Object.assign(\n new Error('`npm audit` does not support testing globals'),\n { code: 'EAUDITGLOBAL' }\n )\n }\n\n // allow the user to set options on the ctor as well.\n // XXX: deprecate separate method options objects.\n options = { ...this.options, ...options }\n\n const timeEnd = time.start('audit')\n let tree\n if (options.packageLock === false) {\n // build ideal tree\n await this.loadActual(options)\n await this.buildIdealTree()\n tree = this.idealTree\n } else {\n tree = await this.loadVirtual()\n }\n if (this.options.workspaces.length) {\n options.filterSet = this.workspaceDependencySet(\n tree,\n this.options.workspaces,\n this.options.includeWorkspaceRoot\n )\n }\n if (!options.workspacesEnabled) {\n options.filterSet =\n this.excludeWorkspacesDependencySet(tree)\n }\n this.auditReport = await AuditReport.load(tree, options)\n const ret = options.fix ? this.reify(options) : this.auditReport\n timeEnd()\n this.finishTracker('audit')\n return ret\n }\n\n // Build an ideal tree (or reuse an already-built one) and return the\n // resulting lockfile contents as a string, without writing to disk.\n // Useful for callers that want to inspect, diff, or store a lockfile\n // somewhere other than the project's `package-lock.json`.\n async lockfileString (options = {}) {\n await this.buildIdealTree(options)\n\n return this.idealTree.meta.toString(options)\n }\n\n async dedupe (options = {}) {\n // allow the user to set options on the ctor as well.\n // XXX: deprecate separate method options objects.\n options = { ...this.options, ...options }\n const tree = await this.loadVirtual().catch(() => this.loadActual())\n const names = []\n for (const name of tree.inventory.query('name')) {\n if (tree.inventory.query('name', name).size > 1) {\n names.push(name)\n }\n }\n return this.reify({\n ...options,\n preferDedupe: true,\n update: { names },\n })\n }\n}\n\nmodule.exports = Arborist\n","module.exports = require('./arborist/index.js')\nmodule.exports.Arborist = module.exports\nmodule.exports.Node = require('./node.js')\nmodule.exports.Link = require('./link.js')\nmodule.exports.Edge = require('./edge.js')\nmodule.exports.Shrinkwrap = require('./shrinkwrap.js')\nmodule.exports.PackageExtensions = require('./package-extensions.js')\nmodule.exports.NpmExtension = require('./npm-extension.js')\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145],"mappings":";;;;;;CAUA,MAAM,WAAW,EACf,OACA,eAAe,MACf,aACA,WACI;EACJ,MAAM,QAAQ,CAAC;EACf,MAAM,uBAAO,IAAI,IAAI;EAErB,MAAM,aAAa;GACjB,OAAO,MAAM,QAAQ;IACnB,MAAM,OAAO,MAAM,MAAM;IACzB,MAAM,MAAM,UAAU,IAAI;IAC1B,IAAI,UAAU,GAAG,GACf,OAAO,IAAI,WAAW,KAAK,CAAC;GAEh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