@mailwoman/corpus 10.5.0 → 10.7.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.
- package/data/PROVENANCE.md +24 -0
- package/data/address-source-register.json +18948 -8757
- package/data/corpus-source-inputs.json +4756 -0
- package/data/license-decisions.json +7260 -0
- package/data/licenses/whosonfirst-licenses.md +3 -2
- package/data/reviewed-ve-postcode-tuples.json +5 -72
- package/data/source-additions.json +2450 -0
- package/data/source-resolutions.json +87 -0
- package/data/training-manifests/v0.7.10-gb-county.effective.json +2335 -0
- package/data/training-manifests/v0.7.10-gb-county.json +1132 -0
- package/data/training-manifests/v0.7.2-address-systems.effective.json +3 -2
- package/data/training-manifests/v0.7.7-no-ppd.json +550 -0
- package/data/training-manifests/v0.7.8-rights-clean.json +538 -0
- package/data/training-manifests/v0.7.9-country-gap.json +1132 -0
- package/data/us-situs-sources.json +128 -0
- package/lib/adapters/cordis/adapter.ts +1 -1
- package/lib/adapters/libpostal-dictionary.ts +23 -3
- package/lib/adapters/osm/adapter.ts +42 -11
- package/lib/adapters.ts +14 -0
- package/lib/az/adapters/opendata/adapter.ts +389 -0
- package/lib/bs/adapters/gbpa/adapter.ts +248 -0
- package/lib/build/types.ts +16 -0
- package/lib/build.ts +21 -0
- package/lib/ee/adapters/ads/adapter.ts +18 -0
- package/lib/fo/adapters/adressur/adapter.ts +242 -0
- package/lib/gb/adapters/os-open/adapter.ts +14 -2
- package/lib/gb/county.ts +59 -0
- package/lib/gb/os-open/{open-names.ts → open/names.ts} +41 -0
- package/lib/gu/adapters/bsp/adapter.ts +434 -0
- package/lib/im/adapters/land-registry/adapter.ts +340 -0
- package/lib/international/recipes/locale.ts +164 -19
- package/lib/li/adapters/llv/adapter.ts +246 -0
- package/lib/recipes/bare/postcode.ts +10 -34
- package/lib/recipes/country-balanced.ts +95 -78
- package/lib/recipes/intersection.ts +22 -30
- package/lib/recipes/po/box/cedex/recipe.ts +8 -5
- package/lib/recipes/po/box/cedex/sources.ts +2 -23
- package/lib/recipes/scaffold.ts +28 -3
- package/lib/recipes/sources.ts +112 -1
- package/lib/recipes/street/affix.ts +17 -29
- package/lib/recipes/sub/venue/context.ts +33 -9
- package/lib/recipes/sub/venue/sources.ts +54 -13
- package/lib/recipes/sub/venue.ts +68 -23
- package/lib/recipes/unit.ts +20 -7
- package/lib/registers.ts +33 -0
- package/lib/source-register/corpus-inputs.ts +528 -0
- package/lib/source-register/effective-manifest.ts +37 -5
- package/lib/source-register/types.ts +20 -0
- package/lib/south-asia/recipes/register.ts +1 -1
- package/lib/tools/overlay/manifest.ts +109 -1
- package/lib/tools/source-register/build.ts +47 -1
- package/lib/tools/variety-sample.ts +633 -0
- package/lib/us/adapters/usgov/nad/adapter.ts +39 -10
- package/lib/us/recipes/skeleton-sources.ts +156 -0
- package/lib/us/tools/nad-skeletons.ts +395 -0
- package/lib/uy/adapters/ide/adapter.ts +275 -0
- package/lib/ve/recipes/reviewed-postcode-tail.ts +29 -6
- package/out/adapters/cordis/adapter.d.ts +1 -1
- package/out/adapters/cordis/adapter.js +1 -1
- package/out/adapters/libpostal-dictionary.d.ts +9 -0
- package/out/adapters/libpostal-dictionary.d.ts.map +1 -1
- package/out/adapters/libpostal-dictionary.js +19 -3
- package/out/adapters/libpostal-dictionary.js.map +1 -1
- package/out/adapters/osm/adapter.d.ts +12 -1
- package/out/adapters/osm/adapter.d.ts.map +1 -1
- package/out/adapters/osm/adapter.js +30 -13
- package/out/adapters/osm/adapter.js.map +1 -1
- package/out/adapters.d.ts.map +1 -1
- package/out/adapters.js +14 -0
- package/out/adapters.js.map +1 -1
- package/out/az/adapters/opendata/adapter.d.ts +88 -0
- package/out/az/adapters/opendata/adapter.d.ts.map +1 -0
- package/out/az/adapters/opendata/adapter.js +282 -0
- package/out/az/adapters/opendata/adapter.js.map +1 -0
- package/out/bs/adapters/gbpa/adapter.d.ts +64 -0
- package/out/bs/adapters/gbpa/adapter.d.ts.map +1 -0
- package/out/bs/adapters/gbpa/adapter.js +187 -0
- package/out/bs/adapters/gbpa/adapter.js.map +1 -0
- package/out/build/types.d.ts +15 -0
- package/out/build/types.d.ts.map +1 -1
- package/out/build/types.js.map +1 -1
- package/out/build.d.ts.map +1 -1
- package/out/build.js +17 -0
- package/out/build.js.map +1 -1
- package/out/ee/adapters/ads/adapter.d.ts +6 -0
- package/out/ee/adapters/ads/adapter.d.ts.map +1 -1
- package/out/ee/adapters/ads/adapter.js +16 -0
- package/out/ee/adapters/ads/adapter.js.map +1 -1
- package/out/fo/adapters/adressur/adapter.d.ts +63 -0
- package/out/fo/adapters/adressur/adapter.d.ts.map +1 -0
- package/out/fo/adapters/adressur/adapter.js +177 -0
- package/out/fo/adapters/adressur/adapter.js.map +1 -0
- package/out/gb/adapters/os-open/adapter.d.ts +10 -2
- package/out/gb/adapters/os-open/adapter.d.ts.map +1 -1
- package/out/gb/adapters/os-open/adapter.js +13 -2
- package/out/gb/adapters/os-open/adapter.js.map +1 -1
- package/out/gb/county.d.ts +30 -0
- package/out/gb/county.d.ts.map +1 -0
- package/out/gb/county.js +51 -0
- package/out/gb/county.js.map +1 -0
- package/out/gb/os-open/{open-names.d.ts → open/names.d.ts} +18 -1
- package/out/gb/os-open/open/names.d.ts.map +1 -0
- package/out/gb/os-open/{open-names.js → open/names.js} +20 -1
- package/out/gb/os-open/open/names.js.map +1 -0
- package/out/gb/os-open/{open-roads.d.ts → open/roads.d.ts} +1 -1
- package/out/gb/os-open/open/roads.d.ts.map +1 -0
- package/out/gb/os-open/{open-roads.js → open/roads.js} +1 -1
- package/out/gb/os-open/open/roads.js.map +1 -0
- package/out/gu/adapters/bsp/adapter.d.ts +83 -0
- package/out/gu/adapters/bsp/adapter.d.ts.map +1 -0
- package/out/gu/adapters/bsp/adapter.js +346 -0
- package/out/gu/adapters/bsp/adapter.js.map +1 -0
- package/out/im/adapters/land-registry/adapter.d.ts +68 -0
- package/out/im/adapters/land-registry/adapter.d.ts.map +1 -0
- package/out/im/adapters/land-registry/adapter.js +261 -0
- package/out/im/adapters/land-registry/adapter.js.map +1 -0
- package/out/international/recipes/locale.d.ts +24 -4
- package/out/international/recipes/locale.d.ts.map +1 -1
- package/out/international/recipes/locale.js +107 -15
- package/out/international/recipes/locale.js.map +1 -1
- package/out/li/adapters/llv/adapter.d.ts +69 -0
- package/out/li/adapters/llv/adapter.d.ts.map +1 -0
- package/out/li/adapters/llv/adapter.js +181 -0
- package/out/li/adapters/llv/adapter.js.map +1 -0
- package/out/recipes/bare/postcode.d.ts.map +1 -1
- package/out/recipes/bare/postcode.js +9 -30
- package/out/recipes/bare/postcode.js.map +1 -1
- package/out/recipes/country-balanced.d.ts.map +1 -1
- package/out/recipes/country-balanced.js +82 -73
- package/out/recipes/country-balanced.js.map +1 -1
- package/out/recipes/intersection.d.ts +3 -2
- package/out/recipes/intersection.d.ts.map +1 -1
- package/out/recipes/intersection.js +20 -26
- package/out/recipes/intersection.js.map +1 -1
- package/out/recipes/po/box/cedex/recipe.d.ts.map +1 -1
- package/out/recipes/po/box/cedex/recipe.js +5 -4
- package/out/recipes/po/box/cedex/recipe.js.map +1 -1
- package/out/recipes/po/box/cedex/sources.d.ts +2 -45
- package/out/recipes/po/box/cedex/sources.d.ts.map +1 -1
- package/out/recipes/po/box/cedex/sources.js +0 -20
- package/out/recipes/po/box/cedex/sources.js.map +1 -1
- package/out/recipes/scaffold.d.ts +15 -2
- package/out/recipes/scaffold.d.ts.map +1 -1
- package/out/recipes/scaffold.js +21 -1
- package/out/recipes/scaffold.js.map +1 -1
- package/out/recipes/sources.d.ts.map +1 -1
- package/out/recipes/sources.js +112 -1
- package/out/recipes/sources.js.map +1 -1
- package/out/recipes/street/affix.d.ts.map +1 -1
- package/out/recipes/street/affix.js +8 -20
- package/out/recipes/street/affix.js.map +1 -1
- package/out/recipes/sub/venue/context.d.ts +14 -3
- package/out/recipes/sub/venue/context.d.ts.map +1 -1
- package/out/recipes/sub/venue/context.js +29 -9
- package/out/recipes/sub/venue/context.js.map +1 -1
- package/out/recipes/sub/venue/sources.d.ts +41 -8
- package/out/recipes/sub/venue/sources.d.ts.map +1 -1
- package/out/recipes/sub/venue/sources.js +26 -7
- package/out/recipes/sub/venue/sources.js.map +1 -1
- package/out/recipes/sub/venue.d.ts.map +1 -1
- package/out/recipes/sub/venue.js +35 -14
- package/out/recipes/sub/venue.js.map +1 -1
- package/out/recipes/unit.d.ts +4 -0
- package/out/recipes/unit.d.ts.map +1 -1
- package/out/recipes/unit.js +7 -6
- package/out/recipes/unit.js.map +1 -1
- package/out/registers.d.ts +33 -0
- package/out/registers.d.ts.map +1 -1
- package/out/registers.js +33 -0
- package/out/registers.js.map +1 -1
- package/out/source-register/corpus-inputs.d.ts +240 -0
- package/out/source-register/corpus-inputs.d.ts.map +1 -0
- package/out/source-register/corpus-inputs.js +275 -0
- package/out/source-register/corpus-inputs.js.map +1 -0
- package/out/source-register/effective-manifest.d.ts +2 -0
- package/out/source-register/effective-manifest.d.ts.map +1 -1
- package/out/source-register/effective-manifest.js +33 -4
- package/out/source-register/effective-manifest.js.map +1 -1
- package/out/source-register/types.d.ts +21 -1
- package/out/source-register/types.d.ts.map +1 -1
- package/out/source-register/types.js +20 -0
- package/out/source-register/types.js.map +1 -1
- package/out/south-asia/recipes/register.js +1 -1
- package/out/south-asia/recipes/register.js.map +1 -1
- package/out/tools/overlay/manifest.d.ts +7 -0
- package/out/tools/overlay/manifest.d.ts.map +1 -1
- package/out/tools/overlay/manifest.js +72 -1
- package/out/tools/overlay/manifest.js.map +1 -1
- package/out/tools/source-register/build.d.ts +9 -0
- package/out/tools/source-register/build.d.ts.map +1 -1
- package/out/tools/source-register/build.js +25 -3
- package/out/tools/source-register/build.js.map +1 -1
- package/out/tools/variety-sample.d.ts +196 -0
- package/out/tools/variety-sample.d.ts.map +1 -0
- package/out/tools/variety-sample.js +417 -0
- package/out/tools/variety-sample.js.map +1 -0
- package/out/us/adapters/usgov/nad/adapter.d.ts +80 -0
- package/out/us/adapters/usgov/nad/adapter.d.ts.map +1 -1
- package/out/us/adapters/usgov/nad/adapter.js +27 -8
- package/out/us/adapters/usgov/nad/adapter.js.map +1 -1
- package/out/us/recipes/skeleton-sources.d.ts +92 -0
- package/out/us/recipes/skeleton-sources.d.ts.map +1 -0
- package/out/us/recipes/skeleton-sources.js +121 -0
- package/out/us/recipes/skeleton-sources.js.map +1 -0
- package/out/us/tools/nad-skeletons.d.ts +120 -0
- package/out/us/tools/nad-skeletons.d.ts.map +1 -0
- package/out/us/tools/nad-skeletons.js +262 -0
- package/out/us/tools/nad-skeletons.js.map +1 -0
- package/out/uy/adapters/ide/adapter.d.ts +64 -0
- package/out/uy/adapters/ide/adapter.d.ts.map +1 -0
- package/out/uy/adapters/ide/adapter.js +206 -0
- package/out/uy/adapters/ide/adapter.js.map +1 -0
- package/out/ve/recipes/reviewed-postcode-tail.d.ts +6 -2
- package/out/ve/recipes/reviewed-postcode-tail.d.ts.map +1 -1
- package/out/ve/recipes/reviewed-postcode-tail.js +16 -5
- package/out/ve/recipes/reviewed-postcode-tail.js.map +1 -1
- package/package.json +14 -14
- package/lib/recipes/unit/sources.ts +0 -44
- package/lib/tools/fetch/ppd.ts +0 -121
- package/out/gb/os-open/open-names.d.ts.map +0 -1
- package/out/gb/os-open/open-names.js.map +0 -1
- package/out/gb/os-open/open-roads.d.ts.map +0 -1
- package/out/gb/os-open/open-roads.js.map +0 -1
- package/out/recipes/unit/sources.d.ts +0 -28
- package/out/recipes/unit/sources.d.ts.map +0 -1
- package/out/recipes/unit/sources.js +0 -30
- package/out/recipes/unit/sources.js.map +0 -1
- package/out/tools/fetch/ppd.d.ts +0 -15
- package/out/tools/fetch/ppd.d.ts.map +0 -1
- package/out/tools/fetch/ppd.js +0 -86
- package/out/tools/fetch/ppd.js.map +0 -1
- /package/lib/gb/os-open/{open-roads.ts → open/roads.ts} +0 -0
package/out/adapters.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapters.js","sourceRoot":"","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AE,yBAAyB,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAEjH,OAAO,EACN,sBAAsB,EACtB,2BAA2B,EAC3B,iBAAiB,GACjB,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EACN,uBAAuB,EACvB,4BAA4B,EAC5B,kCAAkC,GAClC,MAAM,qDAAqD,CAAA;AAE5D,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACxF,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `opendata-az`: `Azərbaycanda obyektlər və məkanlar` (objects and places in Azerbaijan), a GeoJSON of
|
|
7
|
+
* 11,807 points of interest in Baku, Sumgayit and Absheron that the Ministry of Ecology and Natural
|
|
8
|
+
* Resources publishes on opendata.az.
|
|
9
|
+
*
|
|
10
|
+
* Each point holds a place's name (`NAME`) and its address in English transliteration: `STRT_NAME` and
|
|
11
|
+
* `STRT_ADDR` for the street and number, `STATE` for the city district or settlement and `CITY` for the
|
|
12
|
+
* city. The adapter reads `NAME` as the venue, `STRT_NAME` as the street, `STRT_ADDR` as the house
|
|
13
|
+
* number, the last comma part of `STATE` (`Sabunchu,Zabrat` names the settlement Zabrat) as the dependent
|
|
14
|
+
* locality and `CITY` as the locality. Absheron is a district rather than a city, so an Absheron row
|
|
15
|
+
* takes its settlement (`Khirdalan`, `Masazir`) as the locality.
|
|
16
|
+
*
|
|
17
|
+
* `STRT_ADDR` writes `0` where the point has no number. Some street values carry the number after a
|
|
18
|
+
* comma (`Zarifa Aliyeva,38`) or a building's name in parentheses (`Azadlig Avenue(Hilton Baku)`): the
|
|
19
|
+
* number is read from the street when `STRT_ADDR` has none, and the parenthetical is removed. A block
|
|
20
|
+
* code (`558-ci0mehelle030`) is not a house number. A row with neither a number nor a venue is refused.
|
|
21
|
+
*
|
|
22
|
+
* `NAME` names a point of interest of the type `TYPE` states (`Cafe Gorush`, `School 93`, `Library by
|
|
23
|
+
* A. P. Chekhov`). No value in the 2025-08-05 file is a person's given name and surname alone: of the
|
|
24
|
+
* three that read `<Word> <surname-ending>`, each is a category word and a name (`Cafe Beyzade`,
|
|
25
|
+
* `Monument Rahimov`). A value with no run of three letters is a code and is dropped.
|
|
26
|
+
*
|
|
27
|
+
* Ninety-two points also carry their street in Azerbaijani spelling (`STRT_N_AZ`); each of those
|
|
28
|
+
* emits a second row in that spelling, with `NAME_AZ`, `STATE_AZ` and `CITY_AZ` where present
|
|
29
|
+
* (`Bakı` for `Baku`), when it renders differently from the first.
|
|
30
|
+
*
|
|
31
|
+
* The file holds no postcode. The CKAN record states `license_id: cc-by`, `Creative Commons Attribution`,
|
|
32
|
+
* with no version, so the rows carry a LicenseRef rather than an SPDX id that would assert a version.
|
|
33
|
+
*/
|
|
34
|
+
import { type AdapterOptions, type CanonicalRow, type CorpusAdapter } from "#types";
|
|
35
|
+
/**
|
|
36
|
+
* Registry id for this adapter, stamped into every row it emits.
|
|
37
|
+
*/
|
|
38
|
+
export declare const OPENDATA_AZ_ADAPTER_ID = "opendata-az";
|
|
39
|
+
/**
|
|
40
|
+
* The publisher's license, Creative Commons Attribution, whose version the record leaves unstated.
|
|
41
|
+
*/
|
|
42
|
+
export declare const OPENDATA_AZ_LICENSE = "LicenseRef-CC-BY-unstated-version";
|
|
43
|
+
/**
|
|
44
|
+
* Every jurisdiction this adapter emits, checked against a caller's `--country`.
|
|
45
|
+
*/
|
|
46
|
+
export declare const OPENDATA_AZ_COUNTRIES: readonly string[];
|
|
47
|
+
/**
|
|
48
|
+
* The feature properties the adapter reads.
|
|
49
|
+
*/
|
|
50
|
+
export interface AzerbaijanPlaceRecord {
|
|
51
|
+
OBJECTID?: number | null;
|
|
52
|
+
CITY?: string | null;
|
|
53
|
+
STATE?: string | null;
|
|
54
|
+
STRT_NAME?: string | null;
|
|
55
|
+
STRT_ADDR?: string | null;
|
|
56
|
+
NAME?: string | null;
|
|
57
|
+
NAME_AZ?: string | null;
|
|
58
|
+
STATE_AZ?: string | null;
|
|
59
|
+
STRT_N_AZ?: string | null;
|
|
60
|
+
CITY_AZ?: string | null;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The spelling a row is rendered in.
|
|
64
|
+
*/
|
|
65
|
+
export declare const AzerbaijanSpelling: {
|
|
66
|
+
/**
|
|
67
|
+
* `STRT_NAME`, `NAME`, `STATE` and `CITY`: English transliteration.
|
|
68
|
+
*/
|
|
69
|
+
readonly Transliterated: "transliterated";
|
|
70
|
+
/**
|
|
71
|
+
* `STRT_N_AZ`, `NAME_AZ`, `STATE_AZ` and `CITY_AZ`: Azerbaijani.
|
|
72
|
+
*/
|
|
73
|
+
readonly Azerbaijani: "azerbaijani";
|
|
74
|
+
};
|
|
75
|
+
export type AzerbaijanSpelling = (typeof AzerbaijanSpelling)[keyof typeof AzerbaijanSpelling];
|
|
76
|
+
/**
|
|
77
|
+
* Maps one record onto the components the corpus asserts in one spelling,
|
|
78
|
+
* or returns null when the row is refused.
|
|
79
|
+
*
|
|
80
|
+
* Each refusal and each dropped component increments its reason in `dropped`.
|
|
81
|
+
*/
|
|
82
|
+
export declare function componentsForAzerbaijanRecord(record: AzerbaijanPlaceRecord, dropped?: Pick<AdapterOptions, "dropped">, spelling?: AzerbaijanSpelling): CanonicalRow["components"] | null;
|
|
83
|
+
export declare function createAzerbaijanPlacesAdapter(): CorpusAdapter;
|
|
84
|
+
/**
|
|
85
|
+
* The configured adapter instance registered with the corpus builder.
|
|
86
|
+
*/
|
|
87
|
+
export declare const azerbaijanPlacesAdapter: CorpusAdapter;
|
|
88
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources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AE,SAAS,CAAC,EACzC,QAAQ,GAAE,kBAAsD,GAC9D,YAAY,CAAC,YAAY,CAAC,GAAG,IAAI,CA6EnC;AAED,wBAAgB,6BAA6B,IAAI,aAAa,CA2G7D;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,eAAkC,CAAA"}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `opendata-az`: `Azərbaycanda obyektlər və məkanlar` (objects and places in Azerbaijan), a GeoJSON of
|
|
7
|
+
* 11,807 points of interest in Baku, Sumgayit and Absheron that the Ministry of Ecology and Natural
|
|
8
|
+
* Resources publishes on opendata.az.
|
|
9
|
+
*
|
|
10
|
+
* Each point holds a place's name (`NAME`) and its address in English transliteration: `STRT_NAME` and
|
|
11
|
+
* `STRT_ADDR` for the street and number, `STATE` for the city district or settlement and `CITY` for the
|
|
12
|
+
* city. The adapter reads `NAME` as the venue, `STRT_NAME` as the street, `STRT_ADDR` as the house
|
|
13
|
+
* number, the last comma part of `STATE` (`Sabunchu,Zabrat` names the settlement Zabrat) as the dependent
|
|
14
|
+
* locality and `CITY` as the locality. Absheron is a district rather than a city, so an Absheron row
|
|
15
|
+
* takes its settlement (`Khirdalan`, `Masazir`) as the locality.
|
|
16
|
+
*
|
|
17
|
+
* `STRT_ADDR` writes `0` where the point has no number. Some street values carry the number after a
|
|
18
|
+
* comma (`Zarifa Aliyeva,38`) or a building's name in parentheses (`Azadlig Avenue(Hilton Baku)`): the
|
|
19
|
+
* number is read from the street when `STRT_ADDR` has none, and the parenthetical is removed. A block
|
|
20
|
+
* code (`558-ci0mehelle030`) is not a house number. A row with neither a number nor a venue is refused.
|
|
21
|
+
*
|
|
22
|
+
* `NAME` names a point of interest of the type `TYPE` states (`Cafe Gorush`, `School 93`, `Library by
|
|
23
|
+
* A. P. Chekhov`). No value in the 2025-08-05 file is a person's given name and surname alone: of the
|
|
24
|
+
* three that read `<Word> <surname-ending>`, each is a category word and a name (`Cafe Beyzade`,
|
|
25
|
+
* `Monument Rahimov`). A value with no run of three letters is a code and is dropped.
|
|
26
|
+
*
|
|
27
|
+
* Ninety-two points also carry their street in Azerbaijani spelling (`STRT_N_AZ`); each of those
|
|
28
|
+
* emits a second row in that spelling, with `NAME_AZ`, `STATE_AZ` and `CITY_AZ` where present
|
|
29
|
+
* (`Bakı` for `Baku`), when it renders differently from the first.
|
|
30
|
+
*
|
|
31
|
+
* The file holds no postcode. The CKAN record states `license_id: cc-by`, `Creative Commons Attribution`,
|
|
32
|
+
* with no version, so the rows carry a LicenseRef rather than an SPDX id that would assert a version.
|
|
33
|
+
*/
|
|
34
|
+
import { formatAddressRow } from "@mailwoman/codex/address/format";
|
|
35
|
+
import { readLocalTextFile } from "@mailwoman/core/fs/readers";
|
|
36
|
+
import { parseJSONStrict } from "@mailwoman/core/json";
|
|
37
|
+
import { resolvePath } from "path-ts";
|
|
38
|
+
import { UnsupportedCountryError } from "#adapters/errors";
|
|
39
|
+
import { stableSourceIDFromParts } from "#adapters/source-id";
|
|
40
|
+
import { SourceRegister } from "#registers";
|
|
41
|
+
import { AddressRole, countDropped, SurfaceOrigin, } from "#types";
|
|
42
|
+
/**
|
|
43
|
+
* Registry id for this adapter, stamped into every row it emits.
|
|
44
|
+
*/
|
|
45
|
+
export const OPENDATA_AZ_ADAPTER_ID = "opendata-az";
|
|
46
|
+
/**
|
|
47
|
+
* The publisher's license, Creative Commons Attribution, whose version the record leaves unstated.
|
|
48
|
+
*/
|
|
49
|
+
export const OPENDATA_AZ_LICENSE = "LicenseRef-CC-BY-unstated-version";
|
|
50
|
+
/**
|
|
51
|
+
* Every jurisdiction this adapter emits, checked against a caller's `--country`.
|
|
52
|
+
*/
|
|
53
|
+
export const OPENDATA_AZ_COUNTRIES = ["AZ"];
|
|
54
|
+
/**
|
|
55
|
+
* The spelling a row is rendered in.
|
|
56
|
+
*/
|
|
57
|
+
export const AzerbaijanSpelling = {
|
|
58
|
+
/**
|
|
59
|
+
* `STRT_NAME`, `NAME`, `STATE` and `CITY`: English transliteration.
|
|
60
|
+
*/
|
|
61
|
+
Transliterated: "transliterated",
|
|
62
|
+
/**
|
|
63
|
+
* `STRT_N_AZ`, `NAME_AZ`, `STATE_AZ` and `CITY_AZ`: Azerbaijani.
|
|
64
|
+
*/
|
|
65
|
+
Azerbaijani: "azerbaijani",
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* A value with its whitespace collapsed, or null when the file leaves it blank (a single space).
|
|
69
|
+
*/
|
|
70
|
+
function present(value) {
|
|
71
|
+
const collapsed = value == null ? "" : String(value).replaceAll(/\s+/gu, " ").trim();
|
|
72
|
+
return collapsed || null;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A house number: digits with an optional letter, and an optional second number
|
|
76
|
+
* after a slash, backslash or hyphen (`4/66`, `23-33`, `20\116`, `8/5A`).
|
|
77
|
+
*/
|
|
78
|
+
const HOUSE_NUMBER = /^\d+\p{L}?(?:[/\\-]\d+\p{L}?)?$/u;
|
|
79
|
+
/**
|
|
80
|
+
* A street value that carries the house number after a comma, as `Zarifa Aliyeva,38`.
|
|
81
|
+
*/
|
|
82
|
+
const STREET_WITH_NUMBER = /^(.+?),\s*(\d+\p{L}?(?:\/\d+\p{L}?)?)$/u;
|
|
83
|
+
/**
|
|
84
|
+
* A block (`məhəllə`) code in the number column, as `558-ci0mehelle030`.
|
|
85
|
+
*/
|
|
86
|
+
const BLOCK_CODE = /mehelle/iu;
|
|
87
|
+
/**
|
|
88
|
+
* The house number `STRT_ADDR` states, with a backslash read as the slash it stands for,
|
|
89
|
+
* or null when the value is absent, `0`, or not a house number.
|
|
90
|
+
*/
|
|
91
|
+
function houseNumberFrom(value, tally) {
|
|
92
|
+
if (!value || value === "0")
|
|
93
|
+
return null;
|
|
94
|
+
if (BLOCK_CODE.test(value)) {
|
|
95
|
+
countDropped(tally, "component:house_number:block-code");
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
if (!HOUSE_NUMBER.test(value)) {
|
|
99
|
+
countDropped(tally, "component:house_number:not-a-number");
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
return value.replaceAll("\\", "/");
|
|
103
|
+
}
|
|
104
|
+
function fieldsFor(record, spelling) {
|
|
105
|
+
if (spelling === AzerbaijanSpelling.Azerbaijani) {
|
|
106
|
+
return {
|
|
107
|
+
street: present(record.STRT_N_AZ),
|
|
108
|
+
venue: present(record.NAME_AZ),
|
|
109
|
+
state: present(record.STATE_AZ) ?? present(record.STATE),
|
|
110
|
+
city: present(record.CITY_AZ) ?? present(record.CITY),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
street: present(record.STRT_NAME),
|
|
115
|
+
venue: present(record.NAME),
|
|
116
|
+
state: present(record.STATE),
|
|
117
|
+
city: present(record.CITY),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Whether a city value is the Absheron district, in either spelling.
|
|
122
|
+
*/
|
|
123
|
+
function isAbsheron(city) {
|
|
124
|
+
return /^Ab(?:sh|ş)eron$/iu.test(city);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Maps one record onto the components the corpus asserts in one spelling,
|
|
128
|
+
* or returns null when the row is refused.
|
|
129
|
+
*
|
|
130
|
+
* Each refusal and each dropped component increments its reason in `dropped`.
|
|
131
|
+
*/
|
|
132
|
+
export function componentsForAzerbaijanRecord(record, dropped, spelling = AzerbaijanSpelling.Transliterated) {
|
|
133
|
+
const tally = dropped ?? {};
|
|
134
|
+
const fields = fieldsFor(record, spelling);
|
|
135
|
+
let street = fields.street;
|
|
136
|
+
if (!street) {
|
|
137
|
+
countDropped(tally, "row:no-street");
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
if (/[{@]/u.test(street)) {
|
|
141
|
+
countDropped(tally, "row:street-markup");
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
let houseNumber = houseNumberFrom(present(record.STRT_ADDR), tally);
|
|
145
|
+
const carried = STREET_WITH_NUMBER.exec(street);
|
|
146
|
+
if (carried) {
|
|
147
|
+
street = carried[1].trim();
|
|
148
|
+
houseNumber ??= carried[2];
|
|
149
|
+
}
|
|
150
|
+
if (/\(/u.test(street)) {
|
|
151
|
+
street = street.replaceAll(/\s*\([^)]*\)\s*/gu, " ").trim();
|
|
152
|
+
countDropped(tally, "component:street:parenthetical-removed");
|
|
153
|
+
}
|
|
154
|
+
if (!street || street.includes(",")) {
|
|
155
|
+
countDropped(tally, "row:street-holds-several-parts");
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
const components = { street };
|
|
159
|
+
if (houseNumber) {
|
|
160
|
+
components.house_number = houseNumber;
|
|
161
|
+
}
|
|
162
|
+
const venue = fields.venue;
|
|
163
|
+
// A value with no run of three letters (`555`, `SM`, `T T`) is a code rather than a name.
|
|
164
|
+
if (venue && !/\p{L}{3}/u.test(venue)) {
|
|
165
|
+
countDropped(tally, "component:venue:code");
|
|
166
|
+
}
|
|
167
|
+
else if (venue) {
|
|
168
|
+
components.venue = venue;
|
|
169
|
+
}
|
|
170
|
+
if (!components.house_number && !components.venue) {
|
|
171
|
+
countDropped(tally, "row:no-house-number-or-venue");
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
const city = fields.city;
|
|
175
|
+
const district = fields.state?.split(",").pop()?.trim() || null;
|
|
176
|
+
if (!city) {
|
|
177
|
+
countDropped(tally, "row:no-city");
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
if (isAbsheron(city)) {
|
|
181
|
+
components.locality = district ?? city;
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
components.locality = city;
|
|
185
|
+
if (district && district.toLowerCase() !== city.toLowerCase() && !/^Sum[gq]ayit$/iu.test(district)) {
|
|
186
|
+
components.dependent_locality = district;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return components;
|
|
190
|
+
}
|
|
191
|
+
export function createAzerbaijanPlacesAdapter() {
|
|
192
|
+
return {
|
|
193
|
+
id: OPENDATA_AZ_ADAPTER_ID,
|
|
194
|
+
defaultLicense: OPENDATA_AZ_LICENSE,
|
|
195
|
+
addressRole: AddressRole.Premise,
|
|
196
|
+
register: SourceRegister.AzerbaijanObjectsAndPlaces,
|
|
197
|
+
surface: SurfaceOrigin.Rendered,
|
|
198
|
+
description: "Azərbaycanda obyektlər və məkanlar (Ministry of Ecology and Natural Resources, opendata.az): addressed places in Baku, Sumgayit and Absheron.",
|
|
199
|
+
async *rows(opts) {
|
|
200
|
+
if (opts.country && !OPENDATA_AZ_COUNTRIES.includes(opts.country)) {
|
|
201
|
+
throw new UnsupportedCountryError(OPENDATA_AZ_ADAPTER_ID, OPENDATA_AZ_COUNTRIES, opts.country);
|
|
202
|
+
}
|
|
203
|
+
// The publication is one 5 MB file, so it is parsed whole.
|
|
204
|
+
const path = resolvePath(opts.inputPath);
|
|
205
|
+
const collection = parseJSONStrict(await readLocalTextFile(path));
|
|
206
|
+
if (!Array.isArray(collection.features)) {
|
|
207
|
+
throw new TypeError(`${OPENDATA_AZ_ADAPTER_ID} adapter: ${path} holds no GeoJSON features array`);
|
|
208
|
+
}
|
|
209
|
+
let emitted = 0;
|
|
210
|
+
for (const feature of collection.features) {
|
|
211
|
+
const record = feature.properties;
|
|
212
|
+
if (!record) {
|
|
213
|
+
countDropped(opts, "row:no-properties");
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
const [lon, lat] = feature.geometry?.coordinates ?? [];
|
|
217
|
+
let transliterated = null;
|
|
218
|
+
const spellings = present(record.STRT_N_AZ)
|
|
219
|
+
? [AzerbaijanSpelling.Transliterated, AzerbaijanSpelling.Azerbaijani]
|
|
220
|
+
: [AzerbaijanSpelling.Transliterated];
|
|
221
|
+
for (const spelling of spellings) {
|
|
222
|
+
if (opts.signal?.aborted)
|
|
223
|
+
return;
|
|
224
|
+
if (opts.limit !== undefined && emitted >= opts.limit)
|
|
225
|
+
return;
|
|
226
|
+
// The Azerbaijani row is counted under its own prefix, so its refusals
|
|
227
|
+
// do not read as refusals of records.
|
|
228
|
+
const tally = spelling === AzerbaijanSpelling.Azerbaijani ? { dropped: new Map() } : opts;
|
|
229
|
+
const components = componentsForAzerbaijanRecord(record, tally, spelling);
|
|
230
|
+
if (spelling === AzerbaijanSpelling.Azerbaijani) {
|
|
231
|
+
for (const [reason, count] of tally.dropped ?? []) {
|
|
232
|
+
const key = `azerbaijani-spelling:${reason}`;
|
|
233
|
+
opts.dropped?.set(key, (opts.dropped.get(key) ?? 0) + count);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
if (!components)
|
|
237
|
+
continue;
|
|
238
|
+
const rendered = formatAddressRow(components, "AZ", { singleLine: true });
|
|
239
|
+
if (!rendered) {
|
|
240
|
+
countDropped(opts, "row:render-failed");
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
for (const tag of rendered.unplaced) {
|
|
244
|
+
countDropped(opts, `component:${tag}:not-rendered`);
|
|
245
|
+
}
|
|
246
|
+
const { raw, components: aligned } = rendered;
|
|
247
|
+
if (spelling === AzerbaijanSpelling.Transliterated) {
|
|
248
|
+
transliterated = raw;
|
|
249
|
+
}
|
|
250
|
+
else if (raw === transliterated) {
|
|
251
|
+
countDropped(opts, "azerbaijani-spelling:row:renders-as-transliterated");
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
yield {
|
|
255
|
+
raw,
|
|
256
|
+
components: aligned,
|
|
257
|
+
country: "AZ",
|
|
258
|
+
locale: spelling === AzerbaijanSpelling.Azerbaijani ? "az-AZ" : "en-AZ",
|
|
259
|
+
source: OPENDATA_AZ_ADAPTER_ID,
|
|
260
|
+
// `OBJECTID` is unique per feature.
|
|
261
|
+
// The spelling separates a feature's two rows.
|
|
262
|
+
source_id: stableSourceIDFromParts(OPENDATA_AZ_ADAPTER_ID, {
|
|
263
|
+
...aligned,
|
|
264
|
+
objectid: present(record.OBJECTID) ?? "",
|
|
265
|
+
spelling,
|
|
266
|
+
lat: typeof lat === "number" ? String(lat) : "",
|
|
267
|
+
lon: typeof lon === "number" ? String(lon) : "",
|
|
268
|
+
}),
|
|
269
|
+
corpus_version: "",
|
|
270
|
+
license: OPENDATA_AZ_LICENSE,
|
|
271
|
+
};
|
|
272
|
+
emitted++;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* The configured adapter instance registered with the corpus builder.
|
|
280
|
+
*/
|
|
281
|
+
export const azerbaijanPlacesAdapter = createAzerbaijanPlacesAdapter();
|
|
282
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../../lib/az/adapters/opendata/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EACN,WAAW,EAIX,YAAY,EACZ,aAAa,GACb,MAAM,QAAQ,CAAA;AAEf;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAA;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB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AI,GAAG,KAAK,cAAc,EAAE,CAAC;wBACnC,YAAY,CAAC,IAAI,EAAE,oDAAoD,CAAC,CAAA;wBAExE,SAAQ;oBACT,CAAC;oBAED,MAAM;wBACL,GAAG;wBACH,UAAU,EAAE,OAAO;wBACnB,OAAO,EAAE,IAAI;wBACb,MAAM,EAAE,QAAQ,KAAK,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;wBACvE,MAAM,EAAE,sBAAsB;wBAC9B,oCAAoC;wBACpC,+CAA+C;wBAC/C,SAAS,EAAE,uBAAuB,CAAC,sBAAsB,EAAE;4BAC1D,GAAG,OAAO;4BACV,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;4BACxC,QAAQ;4BACR,GAAG,EAAE,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;4BAC/C,GAAG,EAAE,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;yBAC/C,CAAC;wBACF,cAAc,EAAE,EAAE;wBAClB,OAAO,EAAE,mBAAmB;qBAC5B,CAAA;oBAED,OAAO,EAAE,CAAA;gBACV,CAAC;YACF,CAAC;QACF,CAAC;KACD,CAAA;AACF,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,6BAA6B,EAAE,CAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `gbpa-bs`: the address points of the Grand Bahama Port Authority (GBPA), covering the City of Freeport
|
|
7
|
+
* and Lucaya on Grand Bahama, which the GBPA publishes in its `GBPA/gis-datafiles` repository on GitHub.
|
|
8
|
+
* The adapter reads the CSV export, `CSV/addresses.csv`.
|
|
9
|
+
*
|
|
10
|
+
* A Freeport address number is a block and a parcel joined by a hyphen (`8-29 Seagull Drive`), and either
|
|
11
|
+
* part may be lettered (`UU-3`, `13-43C`, `W-A-10`). The adapter reads `AddressNum` as the house number,
|
|
12
|
+
* `FullStName` as the street, `City` as the locality, `Island` as the region and `AltName` as a venue
|
|
13
|
+
* (`Lucayan International School`, `Shoreline`). The export truncates some parcel ids to five characters and
|
|
14
|
+
* a star (`Minis*`), and those numbers are dropped.
|
|
15
|
+
*
|
|
16
|
+
* The export repeats the street's name in a few records (`Rippindale Rippindale`, and across an embedded
|
|
17
|
+
* line break `Santa Maria \r\nSanta Maria Avenue`). The adapter collapses the repeat and counts it.
|
|
18
|
+
*
|
|
19
|
+
* The GBPA licenses the data under CC BY 4.0 and asks for the statement "Data Provided by The Grand Bahama
|
|
20
|
+
* Port Authority". Every row records that license.
|
|
21
|
+
*/
|
|
22
|
+
import { type AdapterOptions, type CanonicalRow, type CorpusAdapter } from "#types";
|
|
23
|
+
/**
|
|
24
|
+
* Registry id for this adapter, stamped into every row it emits.
|
|
25
|
+
*/
|
|
26
|
+
export declare const GBPA_BS_ADAPTER_ID = "gbpa-bs";
|
|
27
|
+
/**
|
|
28
|
+
* The license the GBPA publishes the repository's data under.
|
|
29
|
+
*/
|
|
30
|
+
export declare const GBPA_BS_LICENSE = "CC-BY-4.0";
|
|
31
|
+
/**
|
|
32
|
+
* The attribution statement the GBPA asks for.
|
|
33
|
+
*/
|
|
34
|
+
export declare const GBPA_BS_ATTRIBUTION = "Data Provided by The Grand Bahama Port Authority";
|
|
35
|
+
/**
|
|
36
|
+
* Every jurisdiction this adapter emits, checked against a caller's `--country`.
|
|
37
|
+
*/
|
|
38
|
+
export declare const GBPA_BS_COUNTRIES: readonly string[];
|
|
39
|
+
/**
|
|
40
|
+
* The columns the adapter reads from `CSV/addresses.csv`.
|
|
41
|
+
*/
|
|
42
|
+
export interface GBPAAddressRecord {
|
|
43
|
+
Y: string;
|
|
44
|
+
X: string;
|
|
45
|
+
AddID: string;
|
|
46
|
+
AltName: string;
|
|
47
|
+
Suffix: string;
|
|
48
|
+
FullStName: string;
|
|
49
|
+
AddressNum: string;
|
|
50
|
+
City: string;
|
|
51
|
+
Island: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Maps one record onto the components the corpus asserts, or returns null when the row is refused.
|
|
55
|
+
*
|
|
56
|
+
* Each refusal and each dropped or repaired component increments its reason in `dropped`.
|
|
57
|
+
*/
|
|
58
|
+
export declare function componentsForGBPARecord(record: GBPAAddressRecord, dropped?: Pick<AdapterOptions, "dropped">): CanonicalRow["components"] | null;
|
|
59
|
+
export declare function createGBPAAdapter(): CorpusAdapter;
|
|
60
|
+
/**
|
|
61
|
+
* The configured adapter instance registered with the corpus builder.
|
|
62
|
+
*/
|
|
63
|
+
export declare const gbpaAdapter: CorpusAdapter;
|
|
64
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../lib/bs/adapters/gbpa/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAUH,OAAO,EAEN,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,aAAa,EAGlB,MAAM,QAAQ,CAAA;AAEf;;GAEG;AACH,eAAO,MAAM,kBAAkB,YAAY,CAAA;AAE3C;;GAEG;AACH,eAAO,MAAM,eAAe,cAAc,CAAA;AAE1C;;GAEG;AACH,eAAO,MAAM,mBAAmB,qDAAqD,CAAA;AAErF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAAW,CAAA;AAE1D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACd;AAgCD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACtC,MAAM,EAAE,iBAAiB,EACzB,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,GACvC,YAAY,CAAC,YAAY,CAAC,GAAG,IAAI,CAqEnC;AAED,wBAAgB,iBAAiB,IAAI,aAAa,CA2DjD;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,eAAsB,CAAA"}
|