@powerlines/plugin-automd 0.1.253 → 0.1.255

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 (139) hide show
  1. package/dist/{chunk-BrXtsOCC.cjs → _virtual/rolldown_runtime.cjs} +2 -12
  2. package/dist/{chunk-CS8OKu3y.mjs → _virtual/rolldown_runtime.mjs} +1 -1
  3. package/dist/index.cjs +7 -9656
  4. package/dist/index.d.cts +3 -3
  5. package/dist/index.d.mts +3 -3
  6. package/dist/index.mjs +2 -9646
  7. package/dist/index.mjs.map +1 -1
  8. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs +78 -0
  9. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +78 -0
  10. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +1 -0
  11. package/dist/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.cjs +5032 -0
  12. package/dist/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.mjs +5032 -0
  13. package/dist/node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.mjs.map +1 -0
  14. package/dist/node_modules/.pnpm/automd@0.4.3_patch_hash_0fe864a2d6fa1461e144747e5f0fbc0a5fb51435ec6b3217ffb18ff2d7058778_magicast@0.5.1/node_modules/automd/dist/index.cjs +650 -0
  15. package/dist/node_modules/.pnpm/automd@0.4.3_patch_hash_0fe864a2d6fa1461e144747e5f0fbc0a5fb51435ec6b3217ffb18ff2d7058778_magicast@0.5.1/node_modules/automd/dist/index.mjs +648 -0
  16. package/dist/node_modules/.pnpm/automd@0.4.3_patch_hash_0fe864a2d6fa1461e144747e5f0fbc0a5fb51435ec6b3217ffb18ff2d7058778_magicast@0.5.1/node_modules/automd/dist/index.mjs.map +1 -0
  17. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.cjs +23 -0
  18. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.mjs +23 -0
  19. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.mjs.map +1 -0
  20. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.cjs +405 -0
  21. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.mjs +405 -0
  22. package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.mjs.map +1 -0
  23. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.cjs +46 -0
  24. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs +46 -0
  25. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs.map +1 -0
  26. package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.cjs +204 -0
  27. package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs +203 -0
  28. package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs.map +1 -0
  29. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +1013 -0
  30. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +1008 -0
  31. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs.map +1 -0
  32. package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.cjs +128 -0
  33. package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.mjs +124 -0
  34. package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.mjs.map +1 -0
  35. package/dist/{loader-DNEbMIIe.cjs → node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.cjs} +41337 -58245
  36. package/dist/{loader-BRhKFmUn.mjs → node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.mjs} +41334 -58245
  37. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.mjs.map +1 -0
  38. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.cjs +4387 -0
  39. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.mjs +4385 -0
  40. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.mjs.map +1 -0
  41. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.cjs +26 -0
  42. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.mjs +27 -0
  43. package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.mjs.map +1 -0
  44. package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.cjs +370 -0
  45. package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.mjs +368 -0
  46. package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.mjs.map +1 -0
  47. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.cjs +939 -0
  48. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +940 -0
  49. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs.map +1 -0
  50. package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.cjs +67 -0
  51. package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.mjs +65 -0
  52. package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.mjs.map +1 -0
  53. package/dist/node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.cjs +1292 -0
  54. package/dist/node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.mjs +1285 -0
  55. package/dist/node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.mjs.map +1 -0
  56. package/dist/{multipart-parser-C_EjwsED.cjs → node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs} +2 -1
  57. package/dist/{multipart-parser-Dtmz_axo.mjs → node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs} +3 -2
  58. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs.map +1 -0
  59. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +20 -0
  60. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +17 -0
  61. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs.map +1 -0
  62. package/dist/{node-DapIDpAC.cjs → node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs} +808 -857
  63. package/dist/{node-FGT1CWpL.mjs → node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs} +794 -806
  64. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs.map +1 -0
  65. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.cjs +16 -0
  66. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +15 -0
  67. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs.map +1 -0
  68. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.cjs +36 -0
  69. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs +34 -0
  70. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs.map +1 -0
  71. package/dist/{node-CsMhpAoX.cjs → node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.cjs} +24 -66
  72. package/dist/{node-D8lz5B3d.mjs → node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs} +20 -59
  73. package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs.map +1 -0
  74. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs +139 -0
  75. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +134 -0
  76. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs.map +1 -0
  77. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +77 -0
  78. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +77 -0
  79. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs.map +1 -0
  80. package/dist/{dist-PRh64A_O.mjs → node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.cjs} +4 -2
  81. package/dist/{dist-DVv98dZY.cjs → node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs} +2 -19
  82. package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs.map +1 -0
  83. package/dist/{dist-Jfd0GR_C.mjs → node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.cjs} +4 -46
  84. package/dist/{dist-8g8frrZv.cjs → node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs} +2 -69
  85. package/dist/node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs.map +1 -0
  86. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.cjs +12337 -0
  87. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.mjs +12338 -0
  88. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.mjs.map +1 -0
  89. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.cjs +19 -0
  90. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.mjs +19 -0
  91. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.mjs.map +1 -0
  92. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.cjs +71 -0
  93. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.mjs +72 -0
  94. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.mjs.map +1 -0
  95. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.cjs +110 -0
  96. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.mjs +101 -0
  97. package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.mjs.map +1 -0
  98. package/dist/types/index.cjs +0 -3
  99. package/dist/types/index.d.cts +2 -3
  100. package/dist/types/index.d.mts +2 -3
  101. package/dist/types/index.mjs +0 -4
  102. package/dist/types/plugin.cjs +0 -1
  103. package/dist/types/plugin.d.cts +52 -3
  104. package/dist/types/plugin.d.cts.map +1 -0
  105. package/dist/types/plugin.d.mts +52 -3
  106. package/dist/types/plugin.d.mts.map +1 -0
  107. package/dist/types/plugin.mjs +0 -2
  108. package/dist/types/toc.cjs +0 -1
  109. package/dist/types/toc.d.cts +35 -2
  110. package/dist/types/toc.d.cts.map +1 -0
  111. package/dist/types/toc.d.mts +35 -2
  112. package/dist/types/toc.d.mts.map +1 -0
  113. package/dist/types/toc.mjs +0 -2
  114. package/package.json +4 -4
  115. package/dist/dist-BavrV299.cjs +0 -682
  116. package/dist/dist-Jfd0GR_C.mjs.map +0 -1
  117. package/dist/dist-PRh64A_O.mjs.map +0 -1
  118. package/dist/dist-PXnBmevt.mjs +0 -681
  119. package/dist/dist-PXnBmevt.mjs.map +0 -1
  120. package/dist/index-B8OHl-c_.d.mts +0 -1
  121. package/dist/index-CmCelmEL.d.cts +0 -1
  122. package/dist/loader-BRhKFmUn.mjs.map +0 -1
  123. package/dist/multipart-parser-Dtmz_axo.mjs.map +0 -1
  124. package/dist/node-D8lz5B3d.mjs.map +0 -1
  125. package/dist/node-FGT1CWpL.mjs.map +0 -1
  126. package/dist/plugin-BVD0UMjp.d.cts +0 -52
  127. package/dist/plugin-BVD0UMjp.d.cts.map +0 -1
  128. package/dist/plugin-C6jB5e_j.d.mts +0 -52
  129. package/dist/plugin-C6jB5e_j.d.mts.map +0 -1
  130. package/dist/plugin-Ckx8qAq8.cjs +0 -0
  131. package/dist/plugin-jZ9N9Mz-.mjs +0 -1
  132. package/dist/toc-BN2Ji9Yo.d.mts +0 -35
  133. package/dist/toc-BN2Ji9Yo.d.mts.map +0 -1
  134. package/dist/toc-BQgoCyR1.cjs +0 -0
  135. package/dist/toc-BrayIFG6.d.cts +0 -35
  136. package/dist/toc-BrayIFG6.d.cts.map +0 -1
  137. package/dist/toc-CBjybXug.mjs +0 -1
  138. package/dist/types--fVOUYBq.mjs +0 -1
  139. package/dist/types-D208vOSb.cjs +0 -0
@@ -0,0 +1,204 @@
1
+ const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
2
+ const require_mod = require('../../../../fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.cjs');
3
+ const require_index = require('../../../../lodash.deburr@4.1.0/node_modules/lodash.deburr/index.cjs');
4
+
5
+ //#region ../../node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs
6
+ var import_fastest_levenshtein = require_mod.default;
7
+ var import_lodash = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_index.default, 1);
8
+ let ReturnTypeEnums = /* @__PURE__ */ function(ReturnTypeEnums$1) {
9
+ ReturnTypeEnums$1["ALL_CLOSEST_MATCHES"] = "all-closest-matches";
10
+ ReturnTypeEnums$1["ALL_MATCHES"] = "all-matches";
11
+ ReturnTypeEnums$1["ALL_SORTED_MATCHES"] = "all-sorted-matches";
12
+ ReturnTypeEnums$1["FIRST_CLOSEST_MATCH"] = "first-closest-match";
13
+ ReturnTypeEnums$1["FIRST_MATCH"] = "first-match";
14
+ return ReturnTypeEnums$1;
15
+ }({});
16
+ let ThresholdTypeEnums = /* @__PURE__ */ function(ThresholdTypeEnums$1) {
17
+ ThresholdTypeEnums$1["EDIT_DISTANCE"] = "edit-distance";
18
+ ThresholdTypeEnums$1["SIMILARITY"] = "similarity";
19
+ return ThresholdTypeEnums$1;
20
+ }({});
21
+ const fillDefaultOptions = (options) => {
22
+ const optionsWithDefaultValues = {
23
+ caseSensitive: false,
24
+ deburr: true,
25
+ matchPath: [],
26
+ returnType: ReturnTypeEnums.FIRST_CLOSEST_MATCH,
27
+ thresholdType: ThresholdTypeEnums.SIMILARITY,
28
+ trimSpaces: true,
29
+ ...options
30
+ };
31
+ if (!Object.values(ReturnTypeEnums).includes(optionsWithDefaultValues.returnType)) throw new TypeError("unknown returnType");
32
+ if (!Object.values(ThresholdTypeEnums).includes(optionsWithDefaultValues.thresholdType)) throw new TypeError("unknown thresholdType");
33
+ switch (optionsWithDefaultValues.thresholdType) {
34
+ case ThresholdTypeEnums.EDIT_DISTANCE: return {
35
+ threshold: 20,
36
+ ...optionsWithDefaultValues
37
+ };
38
+ case ThresholdTypeEnums.SIMILARITY: return {
39
+ threshold: .4,
40
+ ...optionsWithDefaultValues
41
+ };
42
+ }
43
+ };
44
+ /**
45
+ * Using edit distance between `a` and `b` to calculate similarity
46
+ *
47
+ * @param {string} a - `input`
48
+ * @param {string} b - String from `matchList`
49
+ * @returns {number} similarity between `a` and `b`
50
+ */
51
+ const getSimilarity = (a, b) => {
52
+ if (!a || !b) return 0;
53
+ if (a === b) return 1;
54
+ const editDistance = (0, import_fastest_levenshtein.distance)(a, b);
55
+ const longestLength = Math.max(a.length, b.length);
56
+ return (longestLength - editDistance) / longestLength;
57
+ };
58
+ /**
59
+ * Normalize a string
60
+ *
61
+ * @param {string} str - any string
62
+ * @param {object} options - options that allows you to modify the behavior
63
+ * @returns {string} - normalized string
64
+ */
65
+ const normalizeString = (str, options) => {
66
+ let s = str;
67
+ if (options.trimSpaces) s = s.trim().replaceAll(/\s+/gu, " ");
68
+ if (options.deburr) s = (0, import_lodash.default)(s);
69
+ if (!options.caseSensitive) s = s.toLowerCase();
70
+ return s;
71
+ };
72
+ const getMatchItemStr = (matchItem, matchPath) => {
73
+ const matchItemStr = matchPath.length > 0 ? matchPath.reduce((acc, prop) => {
74
+ return acc?.[prop];
75
+ }, matchItem) : matchItem;
76
+ if (typeof matchItemStr !== "string") return "";
77
+ return matchItemStr;
78
+ };
79
+ /**
80
+ * Process matchItem according to options
81
+ *
82
+ * @param {object | string} matchItem - Item for matching with `input`
83
+ * @param {object} options - options that allows you to modify the behavior
84
+ * @returns {string} - processed matchItem
85
+ */
86
+ const matchItemProcessor = (matchItem, options) => {
87
+ const { matchPath } = options;
88
+ return normalizeString(getMatchItemStr(matchItem, matchPath), options);
89
+ };
90
+ /**
91
+ * Generate result
92
+ *
93
+ * @param {object[] | string[]} matchList - List for matching with `input`
94
+ * @param {number[]} matchedIndexes - indexes of matchList that need to be returned as result
95
+ * @param {ReturnTypeEnums} returnType - how the result will response to user
96
+ * @returns {Array | null | object | string} - matched result(s), return object if `match` is `{Object[]}`
97
+ */
98
+ const resultProcessor = (matchList, matchedIndexes, returnType) => {
99
+ switch (returnType) {
100
+ case ReturnTypeEnums.ALL_CLOSEST_MATCHES:
101
+ case ReturnTypeEnums.ALL_MATCHES:
102
+ case ReturnTypeEnums.ALL_SORTED_MATCHES: return matchedIndexes.map((matchedIndex) => matchList[matchedIndex]);
103
+ case ReturnTypeEnums.FIRST_CLOSEST_MATCH:
104
+ case ReturnTypeEnums.FIRST_MATCH: {
105
+ const matchedIndex = matchedIndexes[0];
106
+ if (matchedIndex === void 0) return null;
107
+ return matchList[matchedIndex];
108
+ }
109
+ }
110
+ };
111
+ /**
112
+ * Main function for didyoumean2
113
+ *
114
+ * @param {string} input - string that you are not sure and want to match with `matchList`
115
+ * @param {object[] | string[]} matchList - List for matching with `input`
116
+ * @param {null | object | undefined} options - options that allows you to modify the behavior
117
+ * @returns {Array | null | object | string} - matched result(s), return object if `match` is `{Object[]}`
118
+ */
119
+ function didYouMean(input, matchList, options) {
120
+ const optionsWithDefaults = fillDefaultOptions(options);
121
+ const { returnType, threshold, thresholdType } = optionsWithDefaults;
122
+ const normalizedInput = normalizeString(input, optionsWithDefaults);
123
+ let checkIfMatched;
124
+ let scoreProcessor;
125
+ switch (thresholdType) {
126
+ case ThresholdTypeEnums.EDIT_DISTANCE:
127
+ checkIfMatched = (score) => score <= threshold;
128
+ scoreProcessor = (matchItem) => (0, import_fastest_levenshtein.distance)(normalizedInput, matchItemProcessor(matchItem, optionsWithDefaults));
129
+ break;
130
+ case ThresholdTypeEnums.SIMILARITY:
131
+ checkIfMatched = (score) => score >= threshold;
132
+ scoreProcessor = (matchItem) => getSimilarity(normalizedInput, matchItemProcessor(matchItem, optionsWithDefaults));
133
+ break;
134
+ }
135
+ const matchedIndexes = [];
136
+ switch (returnType) {
137
+ case ReturnTypeEnums.ALL_CLOSEST_MATCHES:
138
+ case ReturnTypeEnums.FIRST_CLOSEST_MATCH: {
139
+ const scores = [];
140
+ let marginValue;
141
+ switch (thresholdType) {
142
+ case ThresholdTypeEnums.EDIT_DISTANCE:
143
+ marginValue = Number.POSITIVE_INFINITY;
144
+ for (const matchItem of matchList) {
145
+ const score = scoreProcessor(matchItem);
146
+ if (marginValue > score) marginValue = score;
147
+ scores.push(score);
148
+ }
149
+ break;
150
+ case ThresholdTypeEnums.SIMILARITY:
151
+ marginValue = 0;
152
+ for (const matchItem of matchList) {
153
+ const score = scoreProcessor(matchItem);
154
+ if (marginValue < score) marginValue = score;
155
+ scores.push(score);
156
+ }
157
+ break;
158
+ }
159
+ for (const [i, score] of scores.entries()) if (checkIfMatched(score) && score === marginValue) matchedIndexes.push(i);
160
+ break;
161
+ }
162
+ case ReturnTypeEnums.ALL_MATCHES:
163
+ for (const [i, matchItem] of matchList.entries()) {
164
+ const score = scoreProcessor(matchItem);
165
+ if (checkIfMatched(score)) matchedIndexes.push(i);
166
+ }
167
+ break;
168
+ case ReturnTypeEnums.ALL_SORTED_MATCHES: {
169
+ const unsortedResults = [];
170
+ for (const [i, matchItem] of matchList.entries()) {
171
+ const score = scoreProcessor(matchItem);
172
+ if (checkIfMatched(score)) unsortedResults.push({
173
+ score,
174
+ index: i
175
+ });
176
+ }
177
+ switch (thresholdType) {
178
+ case ThresholdTypeEnums.EDIT_DISTANCE:
179
+ unsortedResults.sort((a, b) => a.score - b.score);
180
+ break;
181
+ case ThresholdTypeEnums.SIMILARITY:
182
+ unsortedResults.sort((a, b) => b.score - a.score);
183
+ break;
184
+ }
185
+ for (const unsortedResult of unsortedResults) matchedIndexes.push(unsortedResult.index);
186
+ break;
187
+ }
188
+ case ReturnTypeEnums.FIRST_MATCH:
189
+ for (const [i, matchItem] of matchList.entries()) {
190
+ const score = scoreProcessor(matchItem);
191
+ if (checkIfMatched(score)) {
192
+ matchedIndexes.push(i);
193
+ break;
194
+ }
195
+ }
196
+ break;
197
+ }
198
+ return resultProcessor(matchList, matchedIndexes, returnType);
199
+ }
200
+
201
+ //#endregion
202
+ exports.ReturnTypeEnums = ReturnTypeEnums;
203
+ exports.ThresholdTypeEnums = ThresholdTypeEnums;
204
+ exports.default = didYouMean;
@@ -0,0 +1,203 @@
1
+ import { __toESM } from "../../../../../../_virtual/rolldown_runtime.mjs";
2
+ import { require_fastest_levenshtein } from "../../../../fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.mjs";
3
+ import { require_lodash } from "../../../../lodash.deburr@4.1.0/node_modules/lodash.deburr/index.mjs";
4
+
5
+ //#region ../../node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs
6
+ var import_fastest_levenshtein = require_fastest_levenshtein();
7
+ var import_lodash = /* @__PURE__ */ __toESM(require_lodash(), 1);
8
+ let ReturnTypeEnums = /* @__PURE__ */ function(ReturnTypeEnums$1) {
9
+ ReturnTypeEnums$1["ALL_CLOSEST_MATCHES"] = "all-closest-matches";
10
+ ReturnTypeEnums$1["ALL_MATCHES"] = "all-matches";
11
+ ReturnTypeEnums$1["ALL_SORTED_MATCHES"] = "all-sorted-matches";
12
+ ReturnTypeEnums$1["FIRST_CLOSEST_MATCH"] = "first-closest-match";
13
+ ReturnTypeEnums$1["FIRST_MATCH"] = "first-match";
14
+ return ReturnTypeEnums$1;
15
+ }({});
16
+ let ThresholdTypeEnums = /* @__PURE__ */ function(ThresholdTypeEnums$1) {
17
+ ThresholdTypeEnums$1["EDIT_DISTANCE"] = "edit-distance";
18
+ ThresholdTypeEnums$1["SIMILARITY"] = "similarity";
19
+ return ThresholdTypeEnums$1;
20
+ }({});
21
+ const fillDefaultOptions = (options) => {
22
+ const optionsWithDefaultValues = {
23
+ caseSensitive: false,
24
+ deburr: true,
25
+ matchPath: [],
26
+ returnType: ReturnTypeEnums.FIRST_CLOSEST_MATCH,
27
+ thresholdType: ThresholdTypeEnums.SIMILARITY,
28
+ trimSpaces: true,
29
+ ...options
30
+ };
31
+ if (!Object.values(ReturnTypeEnums).includes(optionsWithDefaultValues.returnType)) throw new TypeError("unknown returnType");
32
+ if (!Object.values(ThresholdTypeEnums).includes(optionsWithDefaultValues.thresholdType)) throw new TypeError("unknown thresholdType");
33
+ switch (optionsWithDefaultValues.thresholdType) {
34
+ case ThresholdTypeEnums.EDIT_DISTANCE: return {
35
+ threshold: 20,
36
+ ...optionsWithDefaultValues
37
+ };
38
+ case ThresholdTypeEnums.SIMILARITY: return {
39
+ threshold: .4,
40
+ ...optionsWithDefaultValues
41
+ };
42
+ }
43
+ };
44
+ /**
45
+ * Using edit distance between `a` and `b` to calculate similarity
46
+ *
47
+ * @param {string} a - `input`
48
+ * @param {string} b - String from `matchList`
49
+ * @returns {number} similarity between `a` and `b`
50
+ */
51
+ const getSimilarity = (a, b) => {
52
+ if (!a || !b) return 0;
53
+ if (a === b) return 1;
54
+ const editDistance = (0, import_fastest_levenshtein.distance)(a, b);
55
+ const longestLength = Math.max(a.length, b.length);
56
+ return (longestLength - editDistance) / longestLength;
57
+ };
58
+ /**
59
+ * Normalize a string
60
+ *
61
+ * @param {string} str - any string
62
+ * @param {object} options - options that allows you to modify the behavior
63
+ * @returns {string} - normalized string
64
+ */
65
+ const normalizeString = (str, options) => {
66
+ let s = str;
67
+ if (options.trimSpaces) s = s.trim().replaceAll(/\s+/gu, " ");
68
+ if (options.deburr) s = (0, import_lodash.default)(s);
69
+ if (!options.caseSensitive) s = s.toLowerCase();
70
+ return s;
71
+ };
72
+ const getMatchItemStr = (matchItem, matchPath) => {
73
+ const matchItemStr = matchPath.length > 0 ? matchPath.reduce((acc, prop) => {
74
+ return acc?.[prop];
75
+ }, matchItem) : matchItem;
76
+ if (typeof matchItemStr !== "string") return "";
77
+ return matchItemStr;
78
+ };
79
+ /**
80
+ * Process matchItem according to options
81
+ *
82
+ * @param {object | string} matchItem - Item for matching with `input`
83
+ * @param {object} options - options that allows you to modify the behavior
84
+ * @returns {string} - processed matchItem
85
+ */
86
+ const matchItemProcessor = (matchItem, options) => {
87
+ const { matchPath } = options;
88
+ return normalizeString(getMatchItemStr(matchItem, matchPath), options);
89
+ };
90
+ /**
91
+ * Generate result
92
+ *
93
+ * @param {object[] | string[]} matchList - List for matching with `input`
94
+ * @param {number[]} matchedIndexes - indexes of matchList that need to be returned as result
95
+ * @param {ReturnTypeEnums} returnType - how the result will response to user
96
+ * @returns {Array | null | object | string} - matched result(s), return object if `match` is `{Object[]}`
97
+ */
98
+ const resultProcessor = (matchList, matchedIndexes, returnType) => {
99
+ switch (returnType) {
100
+ case ReturnTypeEnums.ALL_CLOSEST_MATCHES:
101
+ case ReturnTypeEnums.ALL_MATCHES:
102
+ case ReturnTypeEnums.ALL_SORTED_MATCHES: return matchedIndexes.map((matchedIndex) => matchList[matchedIndex]);
103
+ case ReturnTypeEnums.FIRST_CLOSEST_MATCH:
104
+ case ReturnTypeEnums.FIRST_MATCH: {
105
+ const matchedIndex = matchedIndexes[0];
106
+ if (matchedIndex === void 0) return null;
107
+ return matchList[matchedIndex];
108
+ }
109
+ }
110
+ };
111
+ /**
112
+ * Main function for didyoumean2
113
+ *
114
+ * @param {string} input - string that you are not sure and want to match with `matchList`
115
+ * @param {object[] | string[]} matchList - List for matching with `input`
116
+ * @param {null | object | undefined} options - options that allows you to modify the behavior
117
+ * @returns {Array | null | object | string} - matched result(s), return object if `match` is `{Object[]}`
118
+ */
119
+ function didYouMean(input, matchList, options) {
120
+ const optionsWithDefaults = fillDefaultOptions(options);
121
+ const { returnType, threshold, thresholdType } = optionsWithDefaults;
122
+ const normalizedInput = normalizeString(input, optionsWithDefaults);
123
+ let checkIfMatched;
124
+ let scoreProcessor;
125
+ switch (thresholdType) {
126
+ case ThresholdTypeEnums.EDIT_DISTANCE:
127
+ checkIfMatched = (score) => score <= threshold;
128
+ scoreProcessor = (matchItem) => (0, import_fastest_levenshtein.distance)(normalizedInput, matchItemProcessor(matchItem, optionsWithDefaults));
129
+ break;
130
+ case ThresholdTypeEnums.SIMILARITY:
131
+ checkIfMatched = (score) => score >= threshold;
132
+ scoreProcessor = (matchItem) => getSimilarity(normalizedInput, matchItemProcessor(matchItem, optionsWithDefaults));
133
+ break;
134
+ }
135
+ const matchedIndexes = [];
136
+ switch (returnType) {
137
+ case ReturnTypeEnums.ALL_CLOSEST_MATCHES:
138
+ case ReturnTypeEnums.FIRST_CLOSEST_MATCH: {
139
+ const scores = [];
140
+ let marginValue;
141
+ switch (thresholdType) {
142
+ case ThresholdTypeEnums.EDIT_DISTANCE:
143
+ marginValue = Number.POSITIVE_INFINITY;
144
+ for (const matchItem of matchList) {
145
+ const score = scoreProcessor(matchItem);
146
+ if (marginValue > score) marginValue = score;
147
+ scores.push(score);
148
+ }
149
+ break;
150
+ case ThresholdTypeEnums.SIMILARITY:
151
+ marginValue = 0;
152
+ for (const matchItem of matchList) {
153
+ const score = scoreProcessor(matchItem);
154
+ if (marginValue < score) marginValue = score;
155
+ scores.push(score);
156
+ }
157
+ break;
158
+ }
159
+ for (const [i, score] of scores.entries()) if (checkIfMatched(score) && score === marginValue) matchedIndexes.push(i);
160
+ break;
161
+ }
162
+ case ReturnTypeEnums.ALL_MATCHES:
163
+ for (const [i, matchItem] of matchList.entries()) {
164
+ const score = scoreProcessor(matchItem);
165
+ if (checkIfMatched(score)) matchedIndexes.push(i);
166
+ }
167
+ break;
168
+ case ReturnTypeEnums.ALL_SORTED_MATCHES: {
169
+ const unsortedResults = [];
170
+ for (const [i, matchItem] of matchList.entries()) {
171
+ const score = scoreProcessor(matchItem);
172
+ if (checkIfMatched(score)) unsortedResults.push({
173
+ score,
174
+ index: i
175
+ });
176
+ }
177
+ switch (thresholdType) {
178
+ case ThresholdTypeEnums.EDIT_DISTANCE:
179
+ unsortedResults.sort((a, b) => a.score - b.score);
180
+ break;
181
+ case ThresholdTypeEnums.SIMILARITY:
182
+ unsortedResults.sort((a, b) => b.score - a.score);
183
+ break;
184
+ }
185
+ for (const unsortedResult of unsortedResults) matchedIndexes.push(unsortedResult.index);
186
+ break;
187
+ }
188
+ case ReturnTypeEnums.FIRST_MATCH:
189
+ for (const [i, matchItem] of matchList.entries()) {
190
+ const score = scoreProcessor(matchItem);
191
+ if (checkIfMatched(score)) {
192
+ matchedIndexes.push(i);
193
+ break;
194
+ }
195
+ }
196
+ break;
197
+ }
198
+ return resultProcessor(matchList, matchedIndexes, returnType);
199
+ }
200
+
201
+ //#endregion
202
+ export { ReturnTypeEnums, ThresholdTypeEnums, didYouMean as default };
203
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["ReturnTypeEnums","ThresholdTypeEnums"],"sources":["../../../../../../../../../node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs"],"sourcesContent":["import { distance } from 'fastest-levenshtein';\nimport deburr from 'lodash.deburr';\n\nlet ReturnTypeEnums = /*#__PURE__*/function (ReturnTypeEnums) {\n ReturnTypeEnums[\"ALL_CLOSEST_MATCHES\"] = \"all-closest-matches\";\n ReturnTypeEnums[\"ALL_MATCHES\"] = \"all-matches\";\n ReturnTypeEnums[\"ALL_SORTED_MATCHES\"] = \"all-sorted-matches\";\n ReturnTypeEnums[\"FIRST_CLOSEST_MATCH\"] = \"first-closest-match\";\n ReturnTypeEnums[\"FIRST_MATCH\"] = \"first-match\";\n return ReturnTypeEnums;\n}({});\n\nlet ThresholdTypeEnums = /*#__PURE__*/function (ThresholdTypeEnums) {\n ThresholdTypeEnums[\"EDIT_DISTANCE\"] = \"edit-distance\";\n ThresholdTypeEnums[\"SIMILARITY\"] = \"similarity\";\n return ThresholdTypeEnums;\n}({});\n\nconst fillDefaultOptions = options => {\n const optionsWithDefaultValues = {\n caseSensitive: false,\n deburr: true,\n matchPath: [],\n returnType: ReturnTypeEnums.FIRST_CLOSEST_MATCH,\n thresholdType: ThresholdTypeEnums.SIMILARITY,\n trimSpaces: true,\n ...options\n };\n if (!Object.values(ReturnTypeEnums).includes(optionsWithDefaultValues.returnType)) {\n throw new TypeError('unknown returnType');\n }\n if (!Object.values(ThresholdTypeEnums).includes(optionsWithDefaultValues.thresholdType)) {\n throw new TypeError('unknown thresholdType');\n }\n switch (optionsWithDefaultValues.thresholdType) {\n case ThresholdTypeEnums.EDIT_DISTANCE:\n return {\n threshold: 20,\n ...optionsWithDefaultValues\n };\n case ThresholdTypeEnums.SIMILARITY:\n return {\n threshold: 0.4,\n ...optionsWithDefaultValues\n };\n }\n};\n\n/**\n * Using edit distance between `a` and `b` to calculate similarity\n *\n * @param {string} a - `input`\n * @param {string} b - String from `matchList`\n * @returns {number} similarity between `a` and `b`\n */\nconst getSimilarity = (a, b) => {\n if (!a || !b) return 0;\n if (a === b) return 1;\n const editDistance = distance(a, b);\n const longestLength = Math.max(a.length, b.length);\n return (longestLength - editDistance) / longestLength;\n};\n\n/**\n * Normalize a string\n *\n * @param {string} str - any string\n * @param {object} options - options that allows you to modify the behavior\n * @returns {string} - normalized string\n */\nconst normalizeString = (str, options) => {\n let s = str;\n if (options.trimSpaces) {\n s = s.trim().replaceAll(/\\s+/gu, ' ');\n }\n if (options.deburr) {\n s = deburr(s);\n }\n if (!options.caseSensitive) {\n s = s.toLowerCase();\n }\n return s;\n};\n\nconst getMatchItemStr = (matchItem, matchPath) => {\n const matchItemStr = matchPath.length > 0 ? matchPath.reduce((acc, prop) => {\n // @ts-expect-error skip redundant type check\n return acc?.[prop];\n }, matchItem) : matchItem;\n if (typeof matchItemStr !== 'string') return '';\n return matchItemStr;\n};\n\n/**\n * Process matchItem according to options\n *\n * @param {object | string} matchItem - Item for matching with `input`\n * @param {object} options - options that allows you to modify the behavior\n * @returns {string} - processed matchItem\n */\nconst matchItemProcessor = (matchItem, options) => {\n const {\n matchPath\n } = options;\n const matchItemStr = getMatchItemStr(matchItem, matchPath);\n return normalizeString(matchItemStr, options);\n};\n\n/**\n * Generate result\n *\n * @param {object[] | string[]} matchList - List for matching with `input`\n * @param {number[]} matchedIndexes - indexes of matchList that need to be returned as result\n * @param {ReturnTypeEnums} returnType - how the result will response to user\n * @returns {Array | null | object | string} - matched result(s), return object if `match` is `{Object[]}`\n */\nconst resultProcessor = (matchList, matchedIndexes, returnType\n// eslint-disable-next-line functional/prefer-immutable-types\n) => {\n switch (returnType) {\n case ReturnTypeEnums.ALL_CLOSEST_MATCHES:\n case ReturnTypeEnums.ALL_MATCHES:\n case ReturnTypeEnums.ALL_SORTED_MATCHES:\n return matchedIndexes.map(matchedIndex => matchList[matchedIndex]);\n case ReturnTypeEnums.FIRST_CLOSEST_MATCH:\n case ReturnTypeEnums.FIRST_MATCH:\n {\n const matchedIndex = matchedIndexes[0];\n if (matchedIndex === undefined) return null;\n return matchList[matchedIndex];\n }\n }\n};\n\n/**\n * Main function for didyoumean2\n *\n * @param {string} input - string that you are not sure and want to match with `matchList`\n * @param {object[] | string[]} matchList - List for matching with `input`\n * @param {null | object | undefined} options - options that allows you to modify the behavior\n * @returns {Array | null | object | string} - matched result(s), return object if `match` is `{Object[]}`\n */\nfunction didYouMean(input, matchList, options\n// eslint-disable-next-line functional/prefer-immutable-types\n) {\n /*+++++++++++++++++++\n + Initiate options +\n +++++++++++++++++++*/\n\n const optionsWithDefaults = fillDefaultOptions(options);\n const {\n returnType,\n threshold,\n thresholdType\n } = optionsWithDefaults;\n\n /*++++++++++++++++++++\n + Deal with options +\n ++++++++++++++++++++*/\n\n const normalizedInput = normalizeString(input, optionsWithDefaults);\n let checkIfMatched; // Validate if score is matched\n let scoreProcessor; // Get score\n switch (thresholdType) {\n case ThresholdTypeEnums.EDIT_DISTANCE:\n checkIfMatched = score => score <= threshold;\n scoreProcessor = matchItem => distance(normalizedInput, matchItemProcessor(matchItem, optionsWithDefaults));\n break;\n case ThresholdTypeEnums.SIMILARITY:\n checkIfMatched = score => score >= threshold;\n scoreProcessor = matchItem => getSimilarity(normalizedInput, matchItemProcessor(matchItem, optionsWithDefaults));\n break;\n }\n\n /*+++++++++++\n + Matching +\n +++++++++++*/\n\n // eslint-disable-next-line functional/prefer-immutable-types\n const matchedIndexes = [];\n switch (returnType) {\n case ReturnTypeEnums.ALL_CLOSEST_MATCHES:\n case ReturnTypeEnums.FIRST_CLOSEST_MATCH:\n {\n // eslint-disable-next-line functional/prefer-immutable-types\n const scores = [];\n let marginValue;\n switch (thresholdType) {\n case ThresholdTypeEnums.EDIT_DISTANCE:\n // Process score and save the smallest score\n marginValue = Number.POSITIVE_INFINITY;\n for (const matchItem of matchList) {\n const score = scoreProcessor(matchItem);\n if (marginValue > score) marginValue = score;\n scores.push(score);\n }\n break;\n case ThresholdTypeEnums.SIMILARITY:\n // Process score and save the largest score\n marginValue = 0;\n for (const matchItem of matchList) {\n const score = scoreProcessor(matchItem);\n if (marginValue < score) marginValue = score;\n scores.push(score);\n }\n break;\n }\n for (const [i, score] of scores.entries()) {\n if (checkIfMatched(score) && score === marginValue) {\n matchedIndexes.push(i);\n }\n }\n break;\n }\n case ReturnTypeEnums.ALL_MATCHES:\n for (const [i, matchItem] of matchList.entries()) {\n const score = scoreProcessor(matchItem);\n\n // save all indexes of matched scores\n if (checkIfMatched(score)) {\n matchedIndexes.push(i);\n }\n }\n break;\n case ReturnTypeEnums.ALL_SORTED_MATCHES:\n {\n // eslint-disable-next-line functional/prefer-immutable-types\n const unsortedResults = [];\n for (const [i, matchItem] of matchList.entries()) {\n const score = scoreProcessor(matchItem);\n\n // save all indexes of matched scores\n if (checkIfMatched(score)) {\n unsortedResults.push({\n score,\n index: i\n });\n }\n }\n switch (thresholdType) {\n case ThresholdTypeEnums.EDIT_DISTANCE:\n unsortedResults.sort((a, b) => a.score - b.score);\n break;\n case ThresholdTypeEnums.SIMILARITY:\n unsortedResults.sort((a, b) => b.score - a.score);\n break;\n }\n for (const unsortedResult of unsortedResults) {\n matchedIndexes.push(unsortedResult.index);\n }\n break;\n }\n case ReturnTypeEnums.FIRST_MATCH:\n for (const [i, matchItem] of matchList.entries()) {\n const score = scoreProcessor(matchItem);\n\n // Return once matched, performance is main target in this returnType\n if (checkIfMatched(score)) {\n matchedIndexes.push(i);\n break;\n }\n }\n break;\n }\n\n /*+++++++++++++++++++++++\n + Process return value +\n +++++++++++++++++++++++*/\n\n return resultProcessor(matchList, matchedIndexes, returnType);\n}\n\nexport { ReturnTypeEnums, ThresholdTypeEnums, didYouMean as default };\n//# sourceMappingURL=index.mjs.map\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAGA,IAAI,kBAA+B,yBAAU,mBAAiB;AAC5D,mBAAgB,yBAAyB;AACzC,mBAAgB,iBAAiB;AACjC,mBAAgB,wBAAwB;AACxC,mBAAgB,yBAAyB;AACzC,mBAAgB,iBAAiB;AACjC,QAAOA;EACP,EAAE,CAAC;AAEL,IAAI,qBAAkC,yBAAU,sBAAoB;AAClE,sBAAmB,mBAAmB;AACtC,sBAAmB,gBAAgB;AACnC,QAAOC;EACP,EAAE,CAAC;AAEL,MAAM,sBAAqB,YAAW;CACpC,MAAM,2BAA2B;EAC/B,eAAe;EACf,QAAQ;EACR,WAAW,EAAE;EACb,YAAY,gBAAgB;EAC5B,eAAe,mBAAmB;EAClC,YAAY;EACZ,GAAG;EACJ;AACD,KAAI,CAAC,OAAO,OAAO,gBAAgB,CAAC,SAAS,yBAAyB,WAAW,CAC/E,OAAM,IAAI,UAAU,qBAAqB;AAE3C,KAAI,CAAC,OAAO,OAAO,mBAAmB,CAAC,SAAS,yBAAyB,cAAc,CACrF,OAAM,IAAI,UAAU,wBAAwB;AAE9C,SAAQ,yBAAyB,eAAjC;EACE,KAAK,mBAAmB,cACtB,QAAO;GACL,WAAW;GACX,GAAG;GACJ;EACH,KAAK,mBAAmB,WACtB,QAAO;GACL,WAAW;GACX,GAAG;GACJ;;;;;;;;;;AAWP,MAAM,iBAAiB,GAAG,MAAM;AAC9B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