@mailwoman/registry 10.0.0 → 10.2.0

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 (231) hide show
  1. package/README.md +11 -14
  2. package/lib/address-key.ts +14 -10
  3. package/lib/geocode-handler.ts +7 -5
  4. package/lib/geojson.ts +13 -7
  5. package/lib/ingest.ts +70 -92
  6. package/lib/learned-scorer.ts +38 -44
  7. package/lib/map-html.ts +26 -72
  8. package/lib/models/crosssource-gbt-en-us.ts +9 -7
  9. package/lib/models/dedup-gbt-en-us.ts +9 -8
  10. package/lib/models/org-crosssource-gbt-en-us.ts +10 -8
  11. package/lib/reconcile.ts +45 -54
  12. package/lib/resolve.ts +187 -130
  13. package/lib/types.ts +35 -29
  14. package/out/address-key.d.ts +14 -10
  15. package/out/address-key.d.ts.map +1 -1
  16. package/out/address-key.js +14 -10
  17. package/out/address-key.js.map +1 -1
  18. package/out/geocode-handler.d.ts +6 -4
  19. package/out/geocode-handler.d.ts.map +1 -1
  20. package/out/geocode-handler.js +7 -5
  21. package/out/geocode-handler.js.map +1 -1
  22. package/out/geojson.d.ts +9 -5
  23. package/out/geojson.d.ts.map +1 -1
  24. package/out/geojson.js +13 -7
  25. package/out/geojson.js.map +1 -1
  26. package/out/ingest.d.ts +49 -76
  27. package/out/ingest.d.ts.map +1 -1
  28. package/out/ingest.js +37 -62
  29. package/out/ingest.js.map +1 -1
  30. package/out/learned-scorer.d.ts +29 -26
  31. package/out/learned-scorer.d.ts.map +1 -1
  32. package/out/learned-scorer.js +31 -39
  33. package/out/learned-scorer.js.map +1 -1
  34. package/out/map-html.d.ts +13 -32
  35. package/out/map-html.d.ts.map +1 -1
  36. package/out/map-html.js +11 -64
  37. package/out/map-html.js.map +1 -1
  38. package/out/models/crosssource-gbt-en-us.d.ts +9 -7
  39. package/out/models/crosssource-gbt-en-us.d.ts.map +1 -1
  40. package/out/models/crosssource-gbt-en-us.js +9 -7
  41. package/out/models/crosssource-gbt-en-us.js.map +1 -1
  42. package/out/models/dedup-gbt-en-us.d.ts +9 -8
  43. package/out/models/dedup-gbt-en-us.d.ts.map +1 -1
  44. package/out/models/dedup-gbt-en-us.js +9 -8
  45. package/out/models/dedup-gbt-en-us.js.map +1 -1
  46. package/out/models/org-crosssource-gbt-en-us.d.ts +10 -8
  47. package/out/models/org-crosssource-gbt-en-us.d.ts.map +1 -1
  48. package/out/models/org-crosssource-gbt-en-us.js +10 -8
  49. package/out/models/org-crosssource-gbt-en-us.js.map +1 -1
  50. package/out/reconcile.d.ts +36 -50
  51. package/out/reconcile.d.ts.map +1 -1
  52. package/out/reconcile.js +18 -42
  53. package/out/reconcile.js.map +1 -1
  54. package/out/resolve.d.ts +152 -91
  55. package/out/resolve.d.ts.map +1 -1
  56. package/out/resolve.js +67 -68
  57. package/out/resolve.js.map +1 -1
  58. package/out/tools/coverage-reconciliation.d.ts +23 -23
  59. package/out/tools/coverage-reconciliation.d.ts.map +1 -1
  60. package/out/tools/coverage-reconciliation.js +15 -26
  61. package/out/tools/coverage-reconciliation.js.map +1 -1
  62. package/out/tools/cross/dataset-correlation.d.ts +23 -27
  63. package/out/tools/cross/dataset-correlation.d.ts.map +1 -1
  64. package/out/tools/cross/dataset-correlation.js +9 -61
  65. package/out/tools/cross/dataset-correlation.js.map +1 -1
  66. package/out/tools/cross/source-threshold-sweep.d.ts +20 -26
  67. package/out/tools/cross/source-threshold-sweep.d.ts.map +1 -1
  68. package/out/tools/cross/source-threshold-sweep.js +14 -40
  69. package/out/tools/cross/source-threshold-sweep.js.map +1 -1
  70. package/out/tools/dedup-ceiling.d.ts +23 -26
  71. package/out/tools/dedup-ceiling.d.ts.map +1 -1
  72. package/out/tools/dedup-ceiling.js +22 -41
  73. package/out/tools/dedup-ceiling.js.map +1 -1
  74. package/out/tools/eval-geocoder.d.ts +25 -16
  75. package/out/tools/eval-geocoder.d.ts.map +1 -1
  76. package/out/tools/eval-geocoder.js +5 -6
  77. package/out/tools/eval-geocoder.js.map +1 -1
  78. package/out/tools/geocoder/namesake-probe.d.ts +9 -8
  79. package/out/tools/geocoder/namesake-probe.d.ts.map +1 -1
  80. package/out/tools/geocoder/namesake-probe.js +6 -7
  81. package/out/tools/geocoder/namesake-probe.js.map +1 -1
  82. package/out/tools/geocoder/vs-provided-coords.d.ts +18 -15
  83. package/out/tools/geocoder/vs-provided-coords.d.ts.map +1 -1
  84. package/out/tools/geocoder/vs-provided-coords.js +30 -27
  85. package/out/tools/geocoder/vs-provided-coords.js.map +1 -1
  86. package/out/tools/gold-set-sample.d.ts +27 -18
  87. package/out/tools/gold-set-sample.d.ts.map +1 -1
  88. package/out/tools/gold-set-sample.js +18 -22
  89. package/out/tools/gold-set-sample.js.map +1 -1
  90. package/out/tools/learned/scorer/clustering-eval.d.ts +30 -27
  91. package/out/tools/learned/scorer/clustering-eval.d.ts.map +1 -1
  92. package/out/tools/learned/scorer/clustering-eval.js +28 -38
  93. package/out/tools/learned/scorer/clustering-eval.js.map +1 -1
  94. package/out/tools/learned/scorer/crossstate-eval.d.ts +24 -18
  95. package/out/tools/learned/scorer/crossstate-eval.d.ts.map +1 -1
  96. package/out/tools/learned/scorer/crossstate-eval.js +19 -25
  97. package/out/tools/learned/scorer/crossstate-eval.js.map +1 -1
  98. package/out/tools/learned/scorer/eval.d.ts +26 -39
  99. package/out/tools/learned/scorer/eval.d.ts.map +1 -1
  100. package/out/tools/learned/scorer/eval.js +11 -71
  101. package/out/tools/learned/scorer/eval.js.map +1 -1
  102. package/out/tools/matcher-scale.d.ts +12 -17
  103. package/out/tools/matcher-scale.d.ts.map +1 -1
  104. package/out/tools/matcher-scale.js +11 -29
  105. package/out/tools/matcher-scale.js.map +1 -1
  106. package/out/tools/nppes/dedup-benchmark.d.ts +22 -41
  107. package/out/tools/nppes/dedup-benchmark.d.ts.map +1 -1
  108. package/out/tools/nppes/dedup-benchmark.js +21 -67
  109. package/out/tools/nppes/dedup-benchmark.js.map +1 -1
  110. package/out/tools/nppes/org-name.d.ts +5 -11
  111. package/out/tools/nppes/org-name.d.ts.map +1 -1
  112. package/out/tools/nppes/org-name.js +2 -9
  113. package/out/tools/nppes/org-name.js.map +1 -1
  114. package/out/tools/nppes/overmerge-packet.d.ts +15 -11
  115. package/out/tools/nppes/overmerge-packet.d.ts.map +1 -1
  116. package/out/tools/nppes/overmerge-packet.js +6 -7
  117. package/out/tools/nppes/overmerge-packet.js.map +1 -1
  118. package/out/tools/nppes/report.d.ts +17 -13
  119. package/out/tools/nppes/report.d.ts.map +1 -1
  120. package/out/tools/nppes/report.js +6 -14
  121. package/out/tools/nppes/report.js.map +1 -1
  122. package/out/tools/nppes/sample.d.ts +29 -18
  123. package/out/tools/nppes/sample.d.ts.map +1 -1
  124. package/out/tools/nppes/sample.js +24 -28
  125. package/out/tools/nppes/sample.js.map +1 -1
  126. package/out/tools/nppes/scoring.d.ts +7 -6
  127. package/out/tools/nppes/scoring.d.ts.map +1 -1
  128. package/out/tools/nppes/scoring.js +6 -5
  129. package/out/tools/nppes/scoring.js.map +1 -1
  130. package/out/tools/nppes/settings.d.ts +10 -7
  131. package/out/tools/nppes/settings.d.ts.map +1 -1
  132. package/out/tools/nppes/settings.js +16 -16
  133. package/out/tools/nppes/settings.js.map +1 -1
  134. package/out/tools/nppes/truth-grains.d.ts +36 -23
  135. package/out/tools/nppes/truth-grains.d.ts.map +1 -1
  136. package/out/tools/nppes/truth-grains.js +36 -20
  137. package/out/tools/nppes/truth-grains.js.map +1 -1
  138. package/out/tools/shared.d.ts +68 -72
  139. package/out/tools/shared.d.ts.map +1 -1
  140. package/out/tools/shared.js +50 -67
  141. package/out/tools/shared.js.map +1 -1
  142. package/out/tools/train/cross-gbt.d.ts +37 -26
  143. package/out/tools/train/cross-gbt.d.ts.map +1 -1
  144. package/out/tools/train/cross-gbt.js +14 -25
  145. package/out/tools/train/cross-gbt.js.map +1 -1
  146. package/out/tools/train/gbt.d.ts +36 -20
  147. package/out/tools/train/gbt.d.ts.map +1 -1
  148. package/out/tools/train/gbt.js +27 -31
  149. package/out/tools/train/gbt.js.map +1 -1
  150. package/out/tools/train/org-cross-gbt.d.ts +38 -24
  151. package/out/tools/train/org-cross-gbt.d.ts.map +1 -1
  152. package/out/tools/train/org-cross-gbt.js +18 -22
  153. package/out/tools/train/org-cross-gbt.js.map +1 -1
  154. package/out/tools/txhhsc-to-oarow.d.ts +14 -9
  155. package/out/tools/txhhsc-to-oarow.d.ts.map +1 -1
  156. package/out/tools/txhhsc-to-oarow.js +16 -15
  157. package/out/tools/txhhsc-to-oarow.js.map +1 -1
  158. package/out/tools/viz/browser.d.ts +6 -5
  159. package/out/tools/viz/browser.d.ts.map +1 -1
  160. package/out/tools/viz/browser.js +6 -5
  161. package/out/tools/viz/browser.js.map +1 -1
  162. package/out/tools/viz/cross-dataset-map.d.ts +7 -4
  163. package/out/tools/viz/cross-dataset-map.d.ts.map +1 -1
  164. package/out/tools/viz/cross-dataset-map.js +9 -6
  165. package/out/tools/viz/cross-dataset-map.js.map +1 -1
  166. package/out/tools/viz/geocode-first-surface.d.ts +11 -5
  167. package/out/tools/viz/geocode-first-surface.d.ts.map +1 -1
  168. package/out/tools/viz/geocode-first-surface.js +16 -11
  169. package/out/tools/viz/geocode-first-surface.js.map +1 -1
  170. package/out/tools/viz/render/map.d.ts +5 -5
  171. package/out/tools/viz/render/map.d.ts.map +1 -1
  172. package/out/tools/viz/render/map.js +6 -5
  173. package/out/tools/viz/render/map.js.map +1 -1
  174. package/out/tools/viz/{render/index.d.ts → render.d.ts} +13 -9
  175. package/out/tools/viz/render.d.ts.map +1 -0
  176. package/out/tools/viz/{render/index.js → render.js} +9 -8
  177. package/out/tools/viz/render.js.map +1 -0
  178. package/out/tools/viz/source-provenance-map.d.ts +19 -7
  179. package/out/tools/viz/source-provenance-map.d.ts.map +1 -1
  180. package/out/tools/viz/source-provenance-map.js +11 -8
  181. package/out/tools/viz/source-provenance-map.js.map +1 -1
  182. package/out/tools/viz/yardstick-figure.d.ts +2 -21
  183. package/out/tools/viz/yardstick-figure.d.ts.map +1 -1
  184. package/out/tools/viz/yardstick-figure.js +3 -39
  185. package/out/tools/viz/yardstick-figure.js.map +1 -1
  186. package/out/types.d.ts +35 -29
  187. package/out/types.d.ts.map +1 -1
  188. package/out/types.js +2 -2
  189. package/out/types.js.map +1 -1
  190. package/package.json +42 -185
  191. package/{lib/tools → tools}/coverage-reconciliation.ts +27 -30
  192. package/{lib/tools → tools}/cross/dataset-correlation.ts +35 -73
  193. package/{lib/tools → tools}/cross/source-threshold-sweep.ts +29 -46
  194. package/{lib/tools → tools}/dedup-ceiling.ts +34 -45
  195. package/tools/eval-geocoder.ts +77 -0
  196. package/{lib/tools → tools}/geocoder/namesake-probe.ts +9 -8
  197. package/{lib/tools → tools}/geocoder/vs-provided-coords.ts +40 -31
  198. package/{lib/tools → tools}/gold-set-sample.ts +35 -29
  199. package/{lib/tools → tools}/learned/scorer/clustering-eval.ts +49 -45
  200. package/{lib/tools → tools}/learned/scorer/crossstate-eval.ts +34 -30
  201. package/{lib/tools → tools}/learned/scorer/eval.ts +39 -78
  202. package/{lib/tools → tools}/matcher-scale.ts +21 -33
  203. package/{lib/tools → tools}/nppes/dedup-benchmark.ts +39 -83
  204. package/tools/nppes/org-name.ts +15 -0
  205. package/{lib/tools → tools}/nppes/overmerge-packet.ts +16 -12
  206. package/{lib/tools → tools}/nppes/report.ts +32 -25
  207. package/{lib/tools → tools}/nppes/sample.ts +43 -38
  208. package/{lib/tools → tools}/nppes/scoring.ts +7 -6
  209. package/{lib/tools → tools}/nppes/settings.ts +16 -16
  210. package/{lib/tools → tools}/nppes/truth-grains.ts +46 -26
  211. package/{lib/tools → tools}/shared.ts +79 -98
  212. package/{lib/tools → tools}/train/cross-gbt.ts +39 -34
  213. package/{lib/tools → tools}/train/gbt.ts +55 -41
  214. package/{lib/tools → tools}/train/org-cross-gbt.ts +40 -30
  215. package/{lib/tools → tools}/txhhsc-to-oarow.ts +24 -18
  216. package/{lib/tools → tools}/viz/browser.ts +6 -5
  217. package/{lib/tools → tools}/viz/cross-dataset-map.ts +15 -9
  218. package/{lib/tools → tools}/viz/geocode-first-surface.ts +29 -17
  219. package/{lib/tools → tools}/viz/render/map.ts +7 -6
  220. package/{lib/tools/viz/render/index.ts → tools/viz/render.ts} +16 -11
  221. package/{lib/tools → tools}/viz/source-provenance-map.ts +30 -15
  222. package/{lib/tools → tools}/viz/yardstick-figure.ts +6 -43
  223. package/lib/tools/eval-geocoder.ts +0 -67
  224. package/lib/tools/index.ts +0 -31
  225. package/lib/tools/nppes/org-name.ts +0 -23
  226. package/out/tools/index.d.ts +0 -31
  227. package/out/tools/index.d.ts.map +0 -1
  228. package/out/tools/index.js +0 -31
  229. package/out/tools/index.js.map +0 -1
  230. package/out/tools/viz/render/index.d.ts.map +0 -1
  231. package/out/tools/viz/render/index.js.map +0 -1
@@ -2,10 +2,10 @@
2
2
  * @copyright Sister Software
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
- * @file The org-name entity-truth grains: union-find labellings that collapse co-located same-org NPIs, keyed three
6
- * ways — the address string, a haversine co-location radius, and an H3 cell.
5
+ * @file Defines union-find truth labels that group co-located NPIs for one organization.
6
+ * One label uses address strings. Another uses a haversine radius. The third uses H3 cells.
7
7
  */
8
- import { type LatLon } from "@mailwoman/match";
8
+ import type { GeoCoordinate } from "@mailwoman/spatial";
9
9
  import type { SourceRecord } from "#index";
10
10
  import { type NPIPrimary } from "#tools/nppes/org-name";
11
11
  /**
@@ -13,38 +13,51 @@ import { type NPIPrimary } from "#tools/nppes/org-name";
13
13
  */
14
14
  export declare const COLOCATION_KM = 0.05;
15
15
  /**
16
- * A truth labelling: the entity class a record belongs to.
16
+ * A truth labeling: the entity class a record belongs to.
17
17
  */
18
18
  export type TruthLabel = (rec: SourceRecord) => string;
19
19
  /**
20
- * An NPI's primary practice coordinate — the FIRST geocoded record it owns, which is its primary row because the sample
21
- * builder pushes that row before the alternate-name and mailing variants.
20
+ * An NPI's primary practice coordinate.
21
+ *
22
+ * Returns the first geocoded record for the NPI.
23
+ * The sample builder adds this primary row before alternate-name and mailing variants.
22
24
  */
23
- export declare function collectPrimaryCoordinates(records: readonly SourceRecord[]): Map<string, LatLon>;
25
+ export declare function collectPrimaryCoordinates(records: readonly SourceRecord[]): Map<string, GeoCoordinate>;
24
26
  /**
25
- * The string-keyed org-name truth: same NPI ⇒ same entity (so an NPI's records stay together and recall is preserved),
26
- * PLUS union two NPIs at the same address KEY whose primary org names agree.
27
+ * The string-keyed org-name truth: same NPI ⇒ same entity
28
+ * (so an NPI's records stay together and recall is preserved), plus union two NPIs
29
+ * at the same address KEY whose primary org names agree.
30
+ *
31
+ * The address-string block provides a conservative lower bound.
32
+ * `1504 Taub loop` and `1504 Taub LP STE 100` key apart even though they are one building,
33
+ * so a correct merge across them is still charged as an error.
34
+ * The coordinate grain below is the tighter reading.
27
35
  *
28
- * Blocking on the address string is a conservative LOWER bound — `1504 Taub LOOP` and `1504 Taub LP STE 100` key apart
29
- * even though they are one building, so a correct merge across them is still charged as an error. The coordinate grain
30
- * below is the tighter reading. Neither relies on the NPPES subpart flag, which the gold set showed misses 37%.
36
+ * Neither method uses the NPPES subpart flag.
37
+ * The gold set misses 37% of cases when grouped by that flag.
31
38
  */
32
39
  export declare function buildOrgNameGrain(npiPrimary: Map<string, NPIPrimary>): TruthLabel;
33
40
  /**
34
- * The coordinate-keyed org-name truth: union same-org NPIs whose primary practice coordinates fall within
35
- * {@linkcode COLOCATION_KM}. Blocking by the GEOCODED BUILDING catches the same-building pairs the address string keys
36
- * apart, so this F1 is at or above the string grain's; the Jaccard test still blocks distinct co-located orgs.
41
+ * The coordinate-keyed org-name truth: union same-org NPIs whose primary practice
42
+ * coordinates fall within {@linkcode COLOCATION_KM}.
37
43
  *
38
- * Brute-force pairwise over the sampled NPIs — trivial at this scale, and unlike a cell key it has no boundary
39
- * artifact.
44
+ * A geocoded-building block catches same-building pairs that the address string keys apart,
45
+ * so this F1 is at or above the string grain's.
46
+ * The Jaccard test still blocks distinct co-located orgs.
47
+ *
48
+ * Compares every sampled NPI pair.
49
+ * This is small enough for the sample and has no cell-boundary artifact.
40
50
  */
41
- export declare function buildOrgNameCoordGrain(npiPrimary: Map<string, NPIPrimary>, npiCoord: Map<string, LatLon>): TruthLabel;
51
+ export declare function buildOrgNameCoordGrain(npiPrimary: Map<string, NPIPrimary>, npiCoord: Map<string, GeoCoordinate>): TruthLabel;
42
52
  /**
43
- * The H3-cell org-name truth — the same building grain keyed on a cell instead of a radius, so co-location blocking is
44
- * O(n) rather than O(n²).
53
+ * The H3-cell org-name truth.
54
+ *
55
+ * The same building grain keyed on a cell instead of a radius, so co-location
56
+ * blocking is O(n) rather than O(n²).
45
57
  *
46
- * A robustness check on the coordinate grain, not a replacement: a hard cell boundary can split a same-building pair
47
- * into adjacent cells, so this slightly UNDER-counts relative to the radius. Coarser resolutions absorb more of that.
58
+ * A robustness check on the coordinate grain rather than a replacement: a hard cell boundary can split
59
+ * a same-building pair into adjacent cells, so this slightly under-counts relative to the radius.
60
+ * Coarser resolutions absorb more of that.
48
61
  */
49
- export declare function buildOrgNameH3Grain(npiPrimary: Map<string, NPIPrimary>, npiCoord: Map<string, LatLon>, h3Res: number): TruthLabel;
62
+ export declare function buildOrgNameH3Grain(npiPrimary: Map<string, NPIPrimary>, npiCoord: Map<string, GeoCoordinate>, h3Res: number): TruthLabel;
50
63
  //# sourceMappingURL=truth-grains.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"truth-grains.d.ts","sourceRoot":"","sources":["../../../lib/tools/nppes/truth-grains.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAwB,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAGpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,EAAW,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEhE;;GAEG;AACH,eAAO,MAAM,aAAa,OAAO,CA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;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,UAAU,CAoBjF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACrC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACnC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,GAClC,UAAU,CAuBZ;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAClC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACnC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,EACpC,KAAK,EAAE,MAAM,GACX,UAAU,CAqBZ"}
@@ -2,8 +2,8 @@
2
2
  * @copyright Sister Software
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
- * @file The org-name entity-truth grains: union-find labellings that collapse co-located same-org NPIs, keyed three
6
- * ways — the address string, a haversine co-location radius, and an H3 cell.
5
+ * @file Defines union-find truth labels that group co-located NPIs for one organization.
6
+ * One label uses address strings. Another uses a haversine radius. The third uses H3 cells.
7
7
  */
8
8
  import { createUnionFind } from "@mailwoman/core/utils";
9
9
  import { haversineKm, jaccard } from "@mailwoman/match";
@@ -16,8 +16,11 @@ export const COLOCATION_KM = 0.05;
16
16
  /**
17
17
  * Union every pair in each block whose org names agree.
18
18
  *
19
- * Quadratic within a block, which is what keeps the test honest: the Jaccard test is per PAIR, so a chain of
20
- * near-matches cannot transitively fuse two genuinely distinct co-located orgs unless some pair actually agrees.
19
+ * Checks every pair within a block.
20
+ * This preserves the per-pair Jaccard test.
21
+ *
22
+ * Therefore, a chain of near-matches cannot transitively fuse two genuinely distinct
23
+ * co-located orgs unless some pair actually agrees.
21
24
  */
22
25
  function unionAgreeingPairs(blocks, npiPrimary, uf) {
23
26
  for (const group of blocks) {
@@ -31,8 +34,10 @@ function unionAgreeingPairs(blocks, npiPrimary, uf) {
31
34
  }
32
35
  }
33
36
  /**
34
- * An NPI's primary practice coordinate — the FIRST geocoded record it owns, which is its primary row because the sample
35
- * builder pushes that row before the alternate-name and mailing variants.
37
+ * An NPI's primary practice coordinate.
38
+ *
39
+ * Returns the first geocoded record for the NPI.
40
+ * The sample builder adds this primary row before alternate-name and mailing variants.
36
41
  */
37
42
  export function collectPrimaryCoordinates(records) {
38
43
  const npiCoord = new Map();
@@ -45,12 +50,17 @@ export function collectPrimaryCoordinates(records) {
45
50
  return npiCoord;
46
51
  }
47
52
  /**
48
- * The string-keyed org-name truth: same NPI ⇒ same entity (so an NPI's records stay together and recall is preserved),
49
- * PLUS union two NPIs at the same address KEY whose primary org names agree.
53
+ * The string-keyed org-name truth: same NPI ⇒ same entity
54
+ * (so an NPI's records stay together and recall is preserved), plus union two NPIs
55
+ * at the same address KEY whose primary org names agree.
56
+ *
57
+ * The address-string block provides a conservative lower bound.
58
+ * `1504 Taub loop` and `1504 Taub LP STE 100` key apart even though they are one building,
59
+ * so a correct merge across them is still charged as an error.
60
+ * The coordinate grain below is the tighter reading.
50
61
  *
51
- * Blocking on the address string is a conservative LOWER bound — `1504 Taub LOOP` and `1504 Taub LP STE 100` key apart
52
- * even though they are one building, so a correct merge across them is still charged as an error. The coordinate grain
53
- * below is the tighter reading. Neither relies on the NPPES subpart flag, which the gold set showed misses 37%.
62
+ * Neither method uses the NPPES subpart flag.
63
+ * The gold set misses 37% of cases when grouped by that flag.
54
64
  */
55
65
  export function buildOrgNameGrain(npiPrimary) {
56
66
  const uf = createUnionFind();
@@ -69,12 +79,15 @@ export function buildOrgNameGrain(npiPrimary) {
69
79
  return (rec) => (npiPrimary.has(rec.id) ? uf.find(rec.id) : rec.id);
70
80
  }
71
81
  /**
72
- * The coordinate-keyed org-name truth: union same-org NPIs whose primary practice coordinates fall within
73
- * {@linkcode COLOCATION_KM}. Blocking by the GEOCODED BUILDING catches the same-building pairs the address string keys
74
- * apart, so this F1 is at or above the string grain's; the Jaccard test still blocks distinct co-located orgs.
82
+ * The coordinate-keyed org-name truth: union same-org NPIs whose primary practice
83
+ * coordinates fall within {@linkcode COLOCATION_KM}.
75
84
  *
76
- * Brute-force pairwise over the sampled NPIs — trivial at this scale, and unlike a cell key it has no boundary
77
- * artifact.
85
+ * A geocoded-building block catches same-building pairs that the address string keys apart,
86
+ * so this F1 is at or above the string grain's.
87
+ * The Jaccard test still blocks distinct co-located orgs.
88
+ *
89
+ * Compares every sampled NPI pair.
90
+ * This is small enough for the sample and has no cell-boundary artifact.
78
91
  */
79
92
  export function buildOrgNameCoordGrain(npiPrimary, npiCoord) {
80
93
  const uf = createUnionFind();
@@ -97,11 +110,14 @@ export function buildOrgNameCoordGrain(npiPrimary, npiCoord) {
97
110
  return (rec) => (npiPrimary.has(rec.id) ? uf.find(rec.id) : rec.id);
98
111
  }
99
112
  /**
100
- * The H3-cell org-name truth — the same building grain keyed on a cell instead of a radius, so co-location blocking is
101
- * O(n) rather than O(n²).
113
+ * The H3-cell org-name truth.
114
+ *
115
+ * The same building grain keyed on a cell instead of a radius, so co-location
116
+ * blocking is O(n) rather than O(n²).
102
117
  *
103
- * A robustness check on the coordinate grain, not a replacement: a hard cell boundary can split a same-building pair
104
- * into adjacent cells, so this slightly UNDER-counts relative to the radius. Coarser resolutions absorb more of that.
118
+ * A robustness check on the coordinate grain rather than a replacement: a hard cell boundary can split
119
+ * a same-building pair into adjacent cells, so this slightly under-counts relative to the radius.
120
+ * Coarser resolutions absorb more of that.
105
121
  */
106
122
  export function buildOrgNameH3Grain(npiPrimary, npiCoord, h3Res) {
107
123
  const uf = createUnionFind();
@@ -1 +1 @@
1
- {"version":3,"file":"truth-grains.js","sourceRoot":"","sources":["../../../lib/tools/nppes/truth-grains.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAkB,MAAM,uBAAuB,CAAA;AACvE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAe,MAAM,kBAAk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,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC;QACnC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA,CAAC,oDAAoD;QAC/D,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QAEzB,IAAI,CAAC,CAAC;YAAE,SAAQ;QAChB,MAAM,IAAI,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QAEzD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;QACrB,CAAC;QAED,MAAM,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC1B,CAAC;IAED,kBAAkB,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,EAAE,CAAC,CAAA;IAEnD,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;AACpE,CAAC"}
@@ -3,17 +3,17 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Shared helpers for the `registry/tools` probe battery.
7
- *
8
- * The rule: anything reused by two or more probes belongs here; anything a single probe needs
9
- * stays with that probe.
6
+ * Shared helpers used by two or more probes in the `registry/tools` probe battery.
10
7
  */
11
- import { type TermFrequencyTable } from "@mailwoman/match";
8
+ import { type GBTOpts, type TermFrequencyTable } from "@mailwoman/match";
12
9
  import { type ColumnMapping } from "#index";
13
10
  import type { EvalGeocoderFactory } from "#tools/eval-geocoder";
14
11
  import type { Score } from "#tools/nppes/scoring";
15
12
  /**
16
- * One source a cross-source probe ingests: where it lives, the column mapping, and an in-state filter.
13
+ * One source a cross-source probe ingests.
14
+ *
15
+ * Its spec gives the path and column mapping.
16
+ * The spec also provides an in-state filter.
17
17
  */
18
18
  export interface SourceSpec {
19
19
  source: string;
@@ -24,20 +24,19 @@ export interface SourceSpec {
24
24
  */
25
25
  inState: (row: Record<string, string>) => boolean;
26
26
  /**
27
- * Optional: a row carries ≥1 addressable entity — yield each as its own row. Default identity.
27
+ * Optional: a row carrying ≥1 addressable entity yields each as its own row.
28
+ *
29
+ * @defaultValue identity.
28
30
  */
29
31
  explode?: (row: Record<string, string>) => Record<string, string>[];
30
32
  }
31
33
  /**
32
- * Trim, treating `undefined` as empty — the shape every probe's raw CSV columns arrive in.
34
+ * Trim, treating `null` or `undefined` as empty — the shape every probe's raw CSV columns arrive in.
33
35
  */
34
- export declare const norm: (s: string | undefined) => string;
36
+ export declare const norm: (s: string | null | undefined) => string;
35
37
  /**
36
- * The token set of an organization name: lower-cased, non-alphanumerics folded to spaces, stop words removed.
37
- *
38
- * NOT a canonical form — `@mailwoman/record`'s `canonicalizeOrganizationName` is the stronger canonical key
39
- * (jurisdiction-aware designation stripping, a DBA split). This set serves the probes' cheap Jaccard overlap over raw
40
- * registry names, never blocking or display.
38
+ * The token set of an organization name for the probes' cheap Jaccard overlap,
39
+ * never blocking or display — not a canonical form.
41
40
  */
42
41
  export declare function orgTokens(s: string): Set<string>;
43
42
  /**
@@ -45,17 +44,23 @@ export declare function orgTokens(s: string): Set<string>;
45
44
  */
46
45
  export declare const addr: (line: string, city: string, st: string, zip: string) => string;
47
46
  /**
48
- * Population standard deviation; `0` on an empty sample, because these feed report tables that print a number per row.
47
+ * Population standard deviation; `0` on an empty sample, because these feed
48
+ * report tables that print a number per row.
49
49
  */
50
50
  export declare const std: (xs: readonly number[]) => number;
51
+ /**
52
+ * Takes a fraction and omits the percent sign, unlike core `formatPercent`'s
53
+ * numerator/denominator interface.
54
+ * Call sites append their own `%`.
55
+ */
51
56
  export declare const pct: (x: number) => string;
52
57
  /**
53
- * Sign prefix for a signed delta — `"+"` for a non-negative value (a negative one carries its own sign).
58
+ * Sign prefix for a signed delta: `"+"` for a non-negative value, since a negative one includes its sign.
54
59
  */
55
60
  export declare const sgn: (x: number) => string;
56
61
  /**
57
- * Logistic function with the input clamped to +/-30 — past that `Math.exp` underflows to 0 and the gradient step
58
- * silently becomes a no-op.
62
+ * Logistic function with the input clamped to ±30, past which `Math.exp` underflows to 0
63
+ * and the gradient step silently becomes a no-op.
59
64
  */
60
65
  export declare const sigmoid: (z: number) => number;
61
66
  /**
@@ -78,14 +83,8 @@ export declare const TX_BBOX: {
78
83
  */
79
84
  export declare const inTXBBOX: (lat: number, lon: number) => boolean;
80
85
  /**
81
- * NPPES registry column headers, by the short name the probes read them under.
82
- *
83
- * The NPI registry export is a ~330-column TSV with headers this long, so every probe that touches it needs this map,
84
- * and five of them had grown their own copy. The copies were a NESTED SUPERSET chain, not a disagreement -- each new
85
- * probe took the previous one's map and appended what it additionally read -- so this is the widest of the five, and no
86
- * consumer loses a column. Reading extra keys costs nothing: they are inert strings, and nothing enumerates this object
87
- * (checked: no `Object.keys`/`values`/`entries`/spread over it anywhere in `tools/`), so adding a column can never
88
- * change a probe's behavior.
86
+ * NPPES registry column headers, by the short name the probes read them under. no code
87
+ * enumerates this object, so adding a column cannot change a probe's behavior.
89
88
  */
90
89
  export declare const NPPES_COLUMNS: {
91
90
  npi: string;
@@ -115,12 +114,13 @@ export declare const NPPES_COLUMNS: {
115
114
  */
116
115
  export declare const MIN_GROUP_SIZE = 5;
117
116
  /**
118
- * Gradient-descent epochs for {@link trainLogisticRegression}. Fixed rather than early-stopped so seeds stay comparable.
117
+ * Gradient-descent epochs for {@link trainLogisticRegression}, fixed
118
+ * rather than early-stopped so seeds stay comparable.
119
119
  */
120
120
  export declare const TRAINING_EPOCHS = 400;
121
121
  /**
122
- * Smallest mean F1 gap counted as a real difference between models rather than seed noise. Verdicts inside ±this are
123
- * reported as a tie.
122
+ * Smallest mean F1 gap counted as a real difference between models rather than seed
123
+ * noise. verdicts inside ±this are reported as a tie.
124
124
  */
125
125
  export declare const MIN_MEANINGFUL_F1_DELTA = 0.02;
126
126
  /**
@@ -132,20 +132,22 @@ export declare const LR_LEARNING_RATE = 0.1;
132
132
  */
133
133
  export declare const LR_L2 = 0.001;
134
134
  /**
135
- * L2-regularized logistic regression by batch gradient descent ({@link TRAINING_EPOCHS} epochs) — the probes' linear
136
- * arm. `w` carries the per-sample class weights (the caller up-weights the rare class). Returns the linear scorer: the
137
- * logit, not the probability, threshold-comparable across a fixed feature layout.
135
+ * L2-regularized logistic regression by batch gradient descent over {@link TRAINING_EPOCHS}
136
+ * epochs, where `w` stores per-sample class weights, returning the logit rather than
137
+ * the probability so it is threshold-comparable across a fixed feature layout.
138
138
  */
139
139
  export declare function trainLogisticRegression(X: readonly (readonly number[])[], y: readonly number[], w: readonly number[], dim: number): (x: readonly number[]) => number;
140
140
  /**
141
- * `n + 1` evenly-spaced order statistics of an already-sorted sample, de-duplicated — the candidate split thresholds a
142
- * GBT node considers. `[0]` for an empty sample so a degenerate feature still yields one (useless but well-formed)
143
- * threshold rather than an empty split set.
141
+ * `n + 1` evenly-spaced order statistics of an already-sorted sample, de-duplicated,
142
+ * that a GBT node considers as candidate splits.
143
+ *
144
+ * An empty sample yields `[0]` so a degenerate feature still yields one threshold
145
+ * rather than an empty split set.
144
146
  */
145
147
  export declare function uniqueQuantiles(sorted: readonly number[], n: number): number[];
146
148
  /**
147
- * Link-threshold candidates for a learned scorer: de-duplicated quantiles of the scorer's own eval-pair score
148
- * distribution across the 0.2–0.999 quantile band — fine enough that a coarse grid can't understate an arm.
149
+ * Link-threshold candidates for a learned scorer: de-duplicated quantiles of the
150
+ * scorer's own eval-pair score distribution across the 0.2–0.999 band.
149
151
  */
150
152
  export declare const quantileThresholds: (scores: readonly number[]) => number[];
151
153
  /**
@@ -166,19 +168,18 @@ export declare const toArmScore: (s: Score) => ArmScore;
166
168
  */
167
169
  export declare function bestOver(thresholds: readonly number[], scoreAt: (threshold: number) => ArmScore): ArmScore;
168
170
  /**
169
- * One organization provider at its practice address, as the geocode-free co-location probes read it — the union of what
170
- * `dedup-ceiling` and `gold-set-sample` each collect.
171
+ * One organization provider at its practice address, as the geocode-free co-location probes read it.
171
172
  */
172
173
  export interface ColocatedProvider {
173
174
  npi: string;
174
175
  org: string;
175
176
  tokens: Set<string>;
176
177
  /**
177
- * The composed practice address ({@link addr}), the string the adjudication packets carry.
178
+ * The composed practice address ({@link addr}).
178
179
  */
179
180
  address: string;
180
181
  /**
181
- * Strict last-10-digit phone key; `""` when the column carries fewer than 10 digits.
182
+ * Strict last-10-digit phone key; `""` when the column contains fewer than 10 digits.
182
183
  */
183
184
  phone: string;
184
185
  /**
@@ -191,7 +192,7 @@ export interface ColocatedProvider {
191
192
  taxonomy: string;
192
193
  subpart: boolean;
193
194
  /**
194
- * `parentLBN|parentTIN`, lowercased — `"|"` when both are blank.
195
+ * `parentLBN|parentTIN`, lowercased; `"|"` when both are blank.
195
196
  */
196
197
  parent: string;
197
198
  }
@@ -207,8 +208,9 @@ export interface ColocatedScan {
207
208
  scanned: number;
208
209
  }
209
210
  /**
210
- * Stream in-state type-2 (organization) providers from the registry — one record per row at its practice address,
211
- * grouped by `addressFrequencyKey`. Geocode-free on purpose, so it runs at large caps in seconds.
211
+ * Stream in-state type-2 (organization) providers from the registry,
212
+ * one record per row at its practice address, grouped by `addressFrequencyKey`;
213
+ * geocode-free on purpose so it runs at large caps in seconds.
212
214
  */
213
215
  export declare function scanColocatedProviders(options: {
214
216
  registryPath: string;
@@ -222,33 +224,25 @@ export interface ColocatedPair {
222
224
  a: ColocatedProvider;
223
225
  b: ColocatedProvider;
224
226
  /**
225
- * The distinct-NPI providers at the shared address, length ≥ 2. One array reference per group, so a consumer tracking
226
- * group-level tallies can detect the group boundary by identity.
227
+ * The distinct-NPI providers at the shared address, length ≥ 2, one array reference
228
+ * per group so a consumer can detect the group boundary by identity.
227
229
  */
228
230
  group: readonly ColocatedProvider[];
229
231
  }
230
232
  /**
231
- * Every unordered pair of DISTINCT NPIs sharing a practice-address key — the over-merge population. Providers are
232
- * de-duplicated per address by NPI (first record wins); single-NPI addresses yield nothing.
233
+ * Every unordered pair of distinct NPIs sharing a practice-address key, de-duplicated
234
+ * per address by NPI (first record wins) so single-NPI addresses yield no pair.
233
235
  */
234
236
  export declare function colocatedDistinctPairs(byAddr: ReadonlyMap<string, readonly ColocatedProvider[]>): Generator<ColocatedPair>;
235
237
  /**
236
- * The TX facility source specs the cross-source probes share. `cross-dataset-correlation` composes these with its own
237
- * commitments spec (the exploded two-entity-per-row source).
238
+ * The TX facility source specs the cross-source probes share.
238
239
  */
239
240
  export declare const buildSpecs: (S: string, STATE: string) => SourceSpec[];
240
241
  /**
241
- * The GBT hyperparameter shape the trainers stamp into their model meta.
242
- */
243
- export interface GBTHyperparameters {
244
- rounds: number;
245
- depth: number;
246
- lr: number;
247
- minLeaf: number;
248
- }
249
- /**
250
- * One assembled input row for a cross-source trainer. `npi` carries the cross-system join key (an NPI or a CCN) — it
251
- * rides `record.id` as the held-out label.
242
+ * One assembled input row for a cross-source trainer.
243
+ *
244
+ * Its `npi` field contains the cross-system join key (an NPI or a CCN).
245
+ * The trainer copies that key into `record.id` as the held-out label.
252
246
  */
253
247
  export interface CrossSourceRow extends Record<string, string> {
254
248
  npi: string;
@@ -258,7 +252,7 @@ export interface CrossSourceRow extends Record<string, string> {
258
252
  source: string;
259
253
  }
260
254
  /**
261
- * Every figure Phases D–F compute — what {@link TrainCrossSourceModelOptions.meta} receives.
255
+ * Every figure passed to {@link TrainCrossSourceModelOptions.meta}.
262
256
  */
263
257
  export interface CrossSourceTrainingFigures {
264
258
  records: number;
@@ -268,7 +262,7 @@ export interface CrossSourceTrainingFigures {
268
262
  f1Max: number;
269
263
  recommendedThreshold: number;
270
264
  features: number;
271
- hyperparams: GBTHyperparameters;
265
+ hyperparams: GBTOpts;
272
266
  }
273
267
  /**
274
268
  * Options for {@linkcode trainCrossSourceModel}.
@@ -279,11 +273,12 @@ export interface TrainCrossSourceModelOptions {
279
273
  */
280
274
  createGeocoder: EvalGeocoderFactory;
281
275
  /**
282
- * The assembled two-source rows — the caller's source-loading phases stay with the caller.
276
+ * The assembled two-source rows.
277
+ * The caller owns source loading.
283
278
  */
284
279
  rows: readonly CrossSourceRow[];
285
280
  /**
286
- * The join keys present in BOTH sources.
281
+ * The join keys present in both sources.
287
282
  */
288
283
  joined: ReadonlySet<string>;
289
284
  addressFrequency: TermFrequencyTable;
@@ -292,7 +287,7 @@ export interface TrainCrossSourceModelOptions {
292
287
  */
293
288
  sources: readonly [string, string];
294
289
  /**
295
- * #655 threshold rule: max cross-source recall subject to this held-out pairwise precision.
290
+ * Max cross-source recall subject to this held-out pairwise precision.
296
291
  */
297
292
  precisionBar: number;
298
293
  /**
@@ -308,17 +303,18 @@ export interface TrainCrossSourceModelOptions {
308
303
  */
309
304
  exportPrefix: string;
310
305
  /**
311
- * Assemble the emitted `<prefix>_META` object. The caller owns field names and order so a retrain diffs cleanly
312
- * against its committed module.
306
+ * Assemble the emitted `<prefix>_META` object.
307
+ *
308
+ * The caller owns field names and order so a retrain diffs cleanly against its committed module.
313
309
  */
314
310
  meta: (figures: CrossSourceTrainingFigures) => Record<string, unknown>;
315
311
  report?: (line: string) => void;
316
312
  }
317
313
  /**
318
- * Phases C–F shared by the cross-source trainers: geocode + ingest each source under its own provenance label, block
319
- * the union and keep only CROSS-source candidate pairs, featurize with the SHARED `createMatchFeaturizer` (train ≡
320
- * inference), calibrate the #655 threshold on a held-out split of the join keys, train the shipped model on ALL pairs,
321
- * and emit it as a committed TS module.
314
+ * Geocode and ingest each source under its own provenance label, block the union,
315
+ * keep only cross-source candidate pairs, featurize with `createMatchFeaturizer` so train
316
+ * and inference agree, calibrate the threshold on a held-out split of the join keys,
317
+ * then train and emit the shipped model as a committed TS module.
322
318
  */
323
319
  export declare function trainCrossSourceModel(options: TrainCrossSourceModelOptions): Promise<{
324
320
  out: string;
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../lib/tools/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAA6B,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAGrF,OAAO,EAQN,KAAK,aAAa,EAElB,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAEjD;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,aAAa,CAAA;IACtB;;OAEG;IACH,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,OAAO,CAAA;IACjD;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;CACnE;AAED;;GAEG;AACH,eAAO,MAAM,IAAI,MAAO,MAAM,GAAG,SAAS,KAAG,MAA0B,CAAA;AAwBvE;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAQhD;AAED;;GAEG;AACH,eAAO,MAAM,IAAI,SAAU,MAAM,QAAQ,MAAM,MAAM,MAAM,OAAO,MAAM,KAAG,MACA,CAAA;AAE3E;;GAEG;AACH,eAAO,MAAM,GAAG,OAAQ,SAAS,MAAM,EAAE,KAAG,MAI3C,CAAA;AAID,eAAO,MAAM,GAAG,MAAO,MAAM,KAAG,MAA8B,CAAA;AAE9D;;GAEG;AACH,eAAO,MAAM,GAAG,MAAO,MAAM,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