@honua/app-platform 0.1.0-beta.0 → 0.1.1-beta.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/contract/discovery.d.ts +231 -0
- package/contract/discovery.d.ts.map +1 -0
- package/contract/discovery.js +554 -0
- package/contract/edit-sketch.d.ts +8 -0
- package/contract/edit-sketch.d.ts.map +1 -1
- package/contract/edit-sketch.js +15 -0
- package/contract/edit-snapping.d.ts +160 -0
- package/contract/edit-snapping.d.ts.map +1 -0
- package/contract/edit-snapping.js +675 -0
- package/contract/generated/projjson-v0.7-crs-validator.d.ts +35 -0
- package/contract/generated/projjson-v0.7-crs-validator.d.ts.map +1 -0
- package/contract/generated/projjson-v0.7-crs-validator.js +3941 -0
- package/contract/index.d.ts +11 -2
- package/contract/index.d.ts.map +1 -1
- package/contract/index.js +4 -1
- package/contract/pmtiles.d.ts +31 -0
- package/contract/pmtiles.d.ts.map +1 -1
- package/contract/pmtiles.js +60 -20
- package/contract/protocol-module.d.ts +70 -0
- package/contract/protocol-module.d.ts.map +1 -0
- package/contract/protocol-module.js +1 -0
- package/contract/schema-envelope.d.ts +26 -0
- package/contract/schema-envelope.d.ts.map +1 -0
- package/contract/schema-envelope.js +25 -0
- package/contract/schema.d.ts +582 -0
- package/contract/schema.d.ts.map +1 -0
- package/contract/schema.js +2483 -0
- package/contract/source-capability-support.d.ts +6 -0
- package/contract/source-capability-support.d.ts.map +1 -0
- package/contract/source-capability-support.js +154 -0
- package/contract/source.d.ts +35 -17
- package/contract/source.d.ts.map +1 -1
- package/contract/source.js +267 -71
- package/contract/types.d.ts +140 -4
- package/contract/types.d.ts.map +1 -1
- package/contract/types.js +6 -14
- package/core/bounded-json.d.ts +4 -0
- package/core/bounded-json.d.ts.map +1 -0
- package/core/bounded-json.js +38 -0
- package/core/cache-state.d.ts +9 -0
- package/core/cache-state.d.ts.map +1 -1
- package/core/cache-state.js +10 -0
- package/core/capabilities-xml.d.ts +33 -0
- package/core/capabilities-xml.d.ts.map +1 -0
- package/core/capabilities-xml.js +331 -0
- package/core/client.d.ts +4 -1
- package/core/client.d.ts.map +1 -1
- package/core/client.js +115 -29
- package/core/error-classifications.d.ts +153 -0
- package/core/error-classifications.d.ts.map +1 -0
- package/core/error-classifications.js +140 -0
- package/core/error-code-registry.d.ts +158 -0
- package/core/error-code-registry.d.ts.map +1 -0
- package/core/error-code-registry.js +143 -0
- package/core/error-envelope.d.ts +68 -0
- package/core/error-envelope.d.ts.map +1 -0
- package/core/error-envelope.js +357 -0
- package/core/errors.d.ts +45 -29
- package/core/errors.d.ts.map +1 -1
- package/core/errors.js +97 -50
- package/core/geoparquet-sql.d.ts +30 -2
- package/core/geoparquet-sql.d.ts.map +1 -1
- package/core/geoparquet-sql.js +38 -3
- package/core/odata-key-path.d.ts +12 -0
- package/core/odata-key-path.d.ts.map +1 -0
- package/core/odata-key-path.js +28 -0
- package/core/odata-write-codec.d.ts +66 -0
- package/core/odata-write-codec.d.ts.map +1 -0
- package/core/odata-write-codec.js +1083 -0
- package/core/odata.d.ts +59 -7
- package/core/odata.d.ts.map +1 -1
- package/core/odata.js +431 -99
- package/core/ogc-features.d.ts.map +1 -1
- package/core/ogc-features.js +3 -0
- package/core/ogc-maps.d.ts +7 -0
- package/core/ogc-maps.d.ts.map +1 -1
- package/core/ogc-maps.js +46 -7
- package/core/ogc-processes.d.ts +2 -1
- package/core/ogc-processes.d.ts.map +1 -1
- package/core/ogc-processes.js +33 -5
- package/core/ogc-records.d.ts +9 -0
- package/core/ogc-records.d.ts.map +1 -1
- package/core/ogc-records.js +78 -29
- package/core/ogc-tiles.d.ts +10 -1
- package/core/ogc-tiles.d.ts.map +1 -1
- package/core/ogc-tiles.js +56 -17
- package/core/path-utils.d.ts +9 -0
- package/core/path-utils.d.ts.map +1 -1
- package/core/path-utils.js +19 -0
- package/core/protocol-transport.d.ts +1 -0
- package/core/protocol-transport.d.ts.map +1 -1
- package/core/request-pipeline.d.ts.map +1 -1
- package/core/request-pipeline.js +1 -1
- package/core/spatial-filter.d.ts +8 -4
- package/core/spatial-filter.d.ts.map +1 -1
- package/core/spatial-filter.js +206 -16
- package/core/stac-static.d.ts +6 -2
- package/core/stac-static.d.ts.map +1 -1
- package/core/stac-static.js +260 -69
- package/core/surfaces.d.ts.map +1 -1
- package/core/surfaces.js +69 -5
- package/core/types.d.ts +125 -7
- package/core/types.d.ts.map +1 -1
- package/core/wfs-capabilities.d.ts +2 -0
- package/core/wfs-capabilities.d.ts.map +1 -1
- package/core/wfs-capabilities.js +8 -1
- package/core/wfs.d.ts.map +1 -1
- package/core/wfs.js +10 -0
- package/core/wms-capabilities.d.ts +56 -84
- package/core/wms-capabilities.d.ts.map +1 -1
- package/core/wms-capabilities.js +212 -509
- package/core/wmts-capabilities.d.ts +62 -62
- package/core/wmts-capabilities.d.ts.map +1 -1
- package/core/wmts-capabilities.js +224 -371
- package/esri-compat/editor.d.ts +8 -0
- package/esri-compat/editor.d.ts.map +1 -1
- package/esri-compat/editor.js +13 -0
- package/esri-compat/feature-layer.d.ts +2 -0
- package/esri-compat/feature-layer.d.ts.map +1 -1
- package/esri-compat/feature-layer.js +1 -0
- package/esri-compat/layer-list.d.ts +11 -0
- package/esri-compat/layer-list.d.ts.map +1 -1
- package/esri-compat/layer-list.js +49 -0
- package/esri-compat/legend.d.ts +10 -0
- package/esri-compat/legend.d.ts.map +1 -1
- package/esri-compat/legend.js +27 -0
- package/esri-compat/portal.d.ts +197 -0
- package/esri-compat/portal.d.ts.map +1 -0
- package/esri-compat/portal.js +251 -0
- package/esri-compat/renderer-objects.d.ts +40 -0
- package/esri-compat/renderer-objects.d.ts.map +1 -0
- package/esri-compat/renderer-objects.js +62 -0
- package/esri-compat/sketch.d.ts +43 -0
- package/esri-compat/sketch.d.ts.map +1 -1
- package/esri-compat/sketch.js +46 -0
- package/esri-compat/snapping.d.ts +43 -0
- package/esri-compat/snapping.d.ts.map +1 -0
- package/esri-compat/snapping.js +45 -0
- package/esri-compat/url.d.ts.map +1 -1
- package/esri-compat/url.js +1 -1
- package/esri-compat/widget-host.d.ts +84 -0
- package/esri-compat/widget-host.d.ts.map +1 -0
- package/esri-compat/widget-host.js +159 -0
- package/generated-app/errors.d.ts +18 -2
- package/generated-app/errors.d.ts.map +1 -1
- package/generated-app/errors.js +44 -11
- package/geocoding/index.d.ts +7 -0
- package/geocoding/index.d.ts.map +1 -1
- package/geocoding/index.js +5 -0
- package/geocoding/provider-http.d.ts +37 -0
- package/geocoding/provider-http.d.ts.map +1 -0
- package/geocoding/provider-http.js +91 -0
- package/geocoding/provider.d.ts +145 -0
- package/geocoding/provider.d.ts.map +1 -0
- package/geocoding/provider.js +41 -0
- package/geocoding/providers/honua.d.ts +28 -0
- package/geocoding/providers/honua.d.ts.map +1 -0
- package/geocoding/providers/honua.js +68 -0
- package/geocoding/providers/nominatim.d.ts +47 -0
- package/geocoding/providers/nominatim.d.ts.map +1 -0
- package/geocoding/providers/nominatim.js +105 -0
- package/geocoding/providers/pelias.d.ts +40 -0
- package/geocoding/providers/pelias.d.ts.map +1 -0
- package/geocoding/providers/pelias.js +115 -0
- package/geocoding/providers/photon.d.ts +39 -0
- package/geocoding/providers/photon.d.ts.map +1 -0
- package/geocoding/providers/photon.js +107 -0
- package/geometry/convert.d.ts +13 -0
- package/geometry/convert.d.ts.map +1 -0
- package/geometry/convert.js +12 -0
- package/geometry/index.d.ts +17 -0
- package/geometry/index.d.ts.map +1 -0
- package/geometry/index.js +15 -0
- package/geometry/internal.d.ts +25 -0
- package/geometry/internal.d.ts.map +1 -0
- package/geometry/internal.js +40 -0
- package/geometry/ops.d.ts +71 -0
- package/geometry/ops.d.ts.map +1 -0
- package/geometry/ops.js +147 -0
- package/geometry/project.d.ts +40 -0
- package/geometry/project.d.ts.map +1 -0
- package/geometry/project.js +88 -0
- package/geometry/types.d.ts +36 -0
- package/geometry/types.d.ts.map +1 -0
- package/geometry/types.js +12 -0
- package/map/automatic-mount-integration.d.ts +134 -0
- package/map/automatic-mount-integration.d.ts.map +1 -0
- package/map/automatic-mount-integration.js +305 -0
- package/map/automatic-source-strategy.d.ts +125 -0
- package/map/automatic-source-strategy.d.ts.map +1 -0
- package/map/automatic-source-strategy.js +494 -0
- package/map/data-to-map-bridge.d.ts +293 -0
- package/map/data-to-map-bridge.d.ts.map +1 -0
- package/map/data-to-map-bridge.js +817 -0
- package/map/geojson-projection.d.ts +33 -0
- package/map/geojson-projection.d.ts.map +1 -0
- package/map/geojson-projection.js +118 -0
- package/map/index.d.ts +14 -0
- package/map/index.d.ts.map +1 -1
- package/map/index.js +8 -0
- package/map/raster-source-spec.d.ts +30 -0
- package/map/raster-source-spec.d.ts.map +1 -0
- package/map/raster-source-spec.js +190 -0
- package/map/raster-source-strategy.d.ts +65 -0
- package/map/raster-source-strategy.d.ts.map +1 -0
- package/map/raster-source-strategy.js +232 -0
- package/map/source-to-maplibre.d.ts +91 -0
- package/map/source-to-maplibre.d.ts.map +1 -0
- package/map/source-to-maplibre.js +454 -0
- package/map/temporal-playback.d.ts +139 -0
- package/map/temporal-playback.d.ts.map +1 -0
- package/map/temporal-playback.js +247 -0
- package/package.json +28 -2
- package/query-planner/canonical.d.ts +7 -0
- package/query-planner/canonical.d.ts.map +1 -0
- package/query-planner/canonical.js +145 -0
- package/query-planner/cql2-json.d.ts +17 -0
- package/query-planner/cql2-json.d.ts.map +1 -0
- package/query-planner/cql2-json.js +646 -0
- package/query-planner/diagnostics.d.ts +35 -0
- package/query-planner/diagnostics.d.ts.map +1 -0
- package/query-planner/diagnostics.js +373 -0
- package/query-planner/duckdb.d.ts +79 -0
- package/query-planner/duckdb.d.ts.map +1 -0
- package/query-planner/duckdb.js +758 -0
- package/query-planner/execution-context.d.ts +5 -0
- package/query-planner/execution-context.d.ts.map +1 -0
- package/query-planner/execution-context.js +50 -0
- package/query-planner/executor.d.ts +5 -0
- package/query-planner/executor.d.ts.map +1 -0
- package/query-planner/executor.js +223 -0
- package/query-planner/geoservices.d.ts +91 -0
- package/query-planner/geoservices.d.ts.map +1 -0
- package/query-planner/geoservices.js +667 -0
- package/query-planner/grpc.d.ts +100 -0
- package/query-planner/grpc.d.ts.map +1 -0
- package/query-planner/grpc.js +736 -0
- package/query-planner/index.d.ts +44 -0
- package/query-planner/index.d.ts.map +1 -0
- package/query-planner/index.js +30 -0
- package/query-planner/ir.d.ts +20 -0
- package/query-planner/ir.d.ts.map +1 -0
- package/query-planner/ir.js +417 -0
- package/query-planner/local-aggregate.d.ts +5 -0
- package/query-planner/local-aggregate.d.ts.map +1 -0
- package/query-planner/local-aggregate.js +126 -0
- package/query-planner/odata.d.ts +48 -0
- package/query-planner/odata.d.ts.map +1 -0
- package/query-planner/odata.js +662 -0
- package/query-planner/ogc-compiler.d.ts +55 -0
- package/query-planner/ogc-compiler.d.ts.map +1 -0
- package/query-planner/ogc-compiler.js +480 -0
- package/query-planner/ogc-features.d.ts +53 -0
- package/query-planner/ogc-features.d.ts.map +1 -0
- package/query-planner/ogc-features.js +617 -0
- package/query-planner/planner.d.ts +17 -0
- package/query-planner/planner.d.ts.map +1 -0
- package/query-planner/planner.js +818 -0
- package/query-planner/resource.d.ts +94 -0
- package/query-planner/resource.d.ts.map +1 -0
- package/query-planner/resource.js +526 -0
- package/query-planner/semantic-canonical.d.ts +15 -0
- package/query-planner/semantic-canonical.d.ts.map +1 -0
- package/query-planner/semantic-canonical.js +62 -0
- package/query-planner/semantic-compat.d.ts +10 -0
- package/query-planner/semantic-compat.d.ts.map +1 -0
- package/query-planner/semantic-compat.js +35 -0
- package/query-planner/semantic-compiler.d.ts +64 -0
- package/query-planner/semantic-compiler.d.ts.map +1 -0
- package/query-planner/semantic-compiler.js +81 -0
- package/query-planner/semantic-literals.d.ts +30 -0
- package/query-planner/semantic-literals.d.ts.map +1 -0
- package/query-planner/semantic-literals.js +133 -0
- package/query-planner/semantic-types.d.ts +265 -0
- package/query-planner/semantic-types.d.ts.map +1 -0
- package/query-planner/semantic-types.js +1 -0
- package/query-planner/semantic.d.ts +54 -0
- package/query-planner/semantic.d.ts.map +1 -0
- package/query-planner/semantic.js +1421 -0
- package/query-planner/types.d.ts +560 -0
- package/query-planner/types.d.ts.map +1 -0
- package/query-planner/types.js +49 -0
- package/query-planner/wfs-semantic.d.ts +58 -0
- package/query-planner/wfs-semantic.d.ts.map +1 -0
- package/query-planner/wfs-semantic.js +547 -0
- package/query-planner/wfs.d.ts +6 -0
- package/query-planner/wfs.d.ts.map +1 -0
- package/query-planner/wfs.js +71 -0
- package/realtime/contract.d.ts +142 -0
- package/realtime/contract.d.ts.map +1 -0
- package/realtime/contract.js +154 -0
- package/realtime/honua-server.d.ts.map +1 -1
- package/realtime/honua-server.js +13 -8
- package/realtime/index.d.ts +19 -4
- package/realtime/index.d.ts.map +1 -1
- package/realtime/index.js +14 -4
- package/realtime/odata-delta.d.ts +114 -0
- package/realtime/odata-delta.d.ts.map +1 -0
- package/realtime/odata-delta.js +483 -0
- package/realtime/resumable-transport.d.ts +111 -0
- package/realtime/resumable-transport.d.ts.map +1 -0
- package/realtime/resumable-transport.js +406 -0
- package/realtime/resumable.d.ts +104 -0
- package/realtime/resumable.d.ts.map +1 -0
- package/realtime/resumable.js +632 -0
- package/realtime/sse.d.ts.map +1 -1
- package/realtime/sse.js +27 -23
- package/realtime/websocket.d.ts +60 -0
- package/realtime/websocket.d.ts.map +1 -0
- package/realtime/websocket.js +157 -0
- package/realtime/wire.d.ts +27 -0
- package/realtime/wire.d.ts.map +1 -0
- package/realtime/wire.js +57 -0
- package/replica-sync/errors.d.ts +2 -1
- package/replica-sync/errors.d.ts.map +1 -1
- package/replica-sync/errors.js +33 -2
- package/runtime/edit-snapping.d.ts +107 -0
- package/runtime/edit-snapping.d.ts.map +1 -0
- package/runtime/edit-snapping.js +190 -0
- package/runtime/errors.d.ts +3 -2
- package/runtime/errors.d.ts.map +1 -1
- package/runtime/errors.js +19 -2
- package/runtime/index.d.ts +6 -0
- package/runtime/index.d.ts.map +1 -1
- package/runtime/index.js +3 -0
- package/runtime/maplibre-renderer.d.ts +41 -0
- package/runtime/maplibre-renderer.d.ts.map +1 -0
- package/runtime/maplibre-renderer.js +322 -0
- package/runtime/query-tiles.d.ts +2 -1
- package/runtime/query-tiles.d.ts.map +1 -1
- package/runtime/query-tiles.js +6 -2
- package/runtime/source-bridge.d.ts +4 -4
- package/runtime/source-bridge.d.ts.map +1 -1
- package/runtime/source-bridge.js +9 -56
- package/runtime/style-interactions.d.ts +3 -2
- package/runtime/style-interactions.d.ts.map +1 -1
- package/runtime/style-interactions.js +11 -3
- package/runtime/terra-draw-sketch.d.ts +275 -0
- package/runtime/terra-draw-sketch.d.ts.map +1 -0
- package/runtime/terra-draw-sketch.js +404 -0
- package/scene-workspace/index.d.ts +4 -0
- package/scene-workspace/index.d.ts.map +1 -1
- package/scene-workspace/index.js +2 -0
- package/scene-workspace/source-to-cesium.d.ts +116 -0
- package/scene-workspace/source-to-cesium.d.ts.map +1 -0
- package/scene-workspace/source-to-cesium.js +791 -0
- package/scene-workspace/state-sync.d.ts +147 -0
- package/scene-workspace/state-sync.d.ts.map +1 -0
- package/scene-workspace/state-sync.js +1123 -0
- package/source-capability-registry.d.ts +1 -0
- package/source-capability-registry.js +1 -0
- package/source-capability-types.d.ts +186 -0
- package/source-capability-types.js +7 -0
- package/style/index.d.ts +2 -0
- package/style/index.d.ts.map +1 -1
- package/style/index.js +2 -0
- package/style/renderers.d.ts +326 -0
- package/style/renderers.d.ts.map +1 -0
- package/style/renderers.js +517 -0
- package/web-components/controller.d.ts +2 -0
- package/web-components/controller.d.ts.map +1 -1
- package/web-components/controller.js +49 -8
- package/web-components/elements.d.ts +95 -1
- package/web-components/elements.d.ts.map +1 -1
- package/web-components/elements.js +458 -19
- package/web-components/index.d.ts +8 -1
- package/web-components/index.d.ts.map +1 -1
- package/web-components/index.js +7 -0
- package/web-components/maplibre-renderer.d.ts.map +1 -1
- package/web-components/maplibre-renderer.js +87 -0
- package/web-components/measurement.d.ts +69 -0
- package/web-components/measurement.d.ts.map +1 -0
- package/web-components/measurement.js +523 -0
- package/web-components/types.d.ts +109 -0
- package/web-components/types.d.ts.map +1 -1
- package/webmap/convert-renderer.d.ts +24 -3
- package/webmap/convert-renderer.d.ts.map +1 -1
- package/webmap/convert-renderer.js +93 -112
- package/webmap/index.d.ts +1 -1
- package/webmap/index.d.ts.map +1 -1
- package/webmap/index.js +1 -1
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MapLibre runtime binding for edit-sketch snapping.
|
|
3
|
+
*
|
|
4
|
+
* Wires pointer-move on a MapLibre-shaped map to the renderer-neutral
|
|
5
|
+
* snapping engine in `contract/edit-snapping.ts`, applies snapped
|
|
6
|
+
* coordinates to an `EditSketchWorkflowModel`, surfaces snapped / unsnapped
|
|
7
|
+
* events, and maintains a default visual indicator via a lightweight GeoJSON
|
|
8
|
+
* circle layer.
|
|
9
|
+
*
|
|
10
|
+
* The map interfaces are duck-typed (same pattern as
|
|
11
|
+
* `interactions/feature-state.ts`) so the SDK carries no hard runtime
|
|
12
|
+
* dependency on `maplibre-gl`.
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
16
|
+
import { resolveSnapCandidate, resolveSnappingConfig, withSnappedActiveVertex, } from "../contract/edit-snapping.js";
|
|
17
|
+
const DEFAULT_INDICATOR_ID = "honua-snap-indicator";
|
|
18
|
+
const DEFAULT_INDICATOR_PAINT = Object.freeze({
|
|
19
|
+
"circle-radius": 6,
|
|
20
|
+
"circle-color": ["match", ["get", "kind"], "vertex", "#2563eb", "edge", "#0891b2", "#64748b"],
|
|
21
|
+
"circle-opacity": 0.9,
|
|
22
|
+
"circle-stroke-color": "#ffffff",
|
|
23
|
+
"circle-stroke-width": 2,
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* Bind edit-sketch snapping to a MapLibre-shaped map.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const index = createSnapIndex();
|
|
31
|
+
* index.setSourceFeatures("parcels", parcels);
|
|
32
|
+
* const snapping = bindEditSketchSnapping(map, {
|
|
33
|
+
* index,
|
|
34
|
+
* model: workflow,
|
|
35
|
+
* onSnap: ({ candidate }) => showGuide(candidate),
|
|
36
|
+
* });
|
|
37
|
+
* map.on("click", (e) => {
|
|
38
|
+
* snapping.applySketchGeometry("point", { type: "Point", coordinates: [e.lngLat.lng, e.lngLat.lat] });
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export function bindEditSketchSnapping(map, options) {
|
|
43
|
+
const { index, model } = options;
|
|
44
|
+
let localConfig = resolveSnappingConfig(options.config);
|
|
45
|
+
const effectiveConfig = () => (model && !options.config ? model.snappingConfig() : localConfig);
|
|
46
|
+
const pointerEvent = options.pointerEvent ?? "mousemove";
|
|
47
|
+
const indicator = normalizeIndicatorOptions(options.indicator);
|
|
48
|
+
const indicatorInstalled = indicator.enabled ? installIndicator(map, indicator) : false;
|
|
49
|
+
let current;
|
|
50
|
+
const project = (position) => {
|
|
51
|
+
const projected = map.project([position[0], position[1]]);
|
|
52
|
+
return { x: projected.x, y: projected.y };
|
|
53
|
+
};
|
|
54
|
+
const resolve = (input) => resolveSnapCandidate(index, { point: input.point, position: input.position, project }, effectiveConfig());
|
|
55
|
+
const applyResolution = (resolution) => {
|
|
56
|
+
const previous = current;
|
|
57
|
+
current = resolution.candidate;
|
|
58
|
+
if (indicatorInstalled)
|
|
59
|
+
updateIndicator(map, indicator.id, current);
|
|
60
|
+
if (current) {
|
|
61
|
+
if (!previous || !sameCandidate(previous, current))
|
|
62
|
+
options.onSnap?.(resolution);
|
|
63
|
+
}
|
|
64
|
+
else if (previous) {
|
|
65
|
+
options.onUnsnap?.(previous);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const onPointerMove = (...args) => {
|
|
69
|
+
const input = pointerInput(args[0]);
|
|
70
|
+
if (!input)
|
|
71
|
+
return;
|
|
72
|
+
applyResolution(resolve(input));
|
|
73
|
+
};
|
|
74
|
+
map.on(pointerEvent, onPointerMove);
|
|
75
|
+
return {
|
|
76
|
+
get current() {
|
|
77
|
+
return current;
|
|
78
|
+
},
|
|
79
|
+
resolve(input) {
|
|
80
|
+
const resolution = resolve(input);
|
|
81
|
+
applyResolution(resolution);
|
|
82
|
+
return resolution;
|
|
83
|
+
},
|
|
84
|
+
snapPosition(position) {
|
|
85
|
+
const resolution = resolve({ point: project(position), position });
|
|
86
|
+
return resolution.candidate ? resolution.candidate.position : position;
|
|
87
|
+
},
|
|
88
|
+
config() {
|
|
89
|
+
return effectiveConfig();
|
|
90
|
+
},
|
|
91
|
+
setConfig(config) {
|
|
92
|
+
if (model)
|
|
93
|
+
model.setSnapping(config);
|
|
94
|
+
localConfig = resolveSnappingConfig({ ...localConfig, ...config });
|
|
95
|
+
// Disabling snapping must not leave a stale snap target behind: clear
|
|
96
|
+
// the current candidate, indicator, and fire onUnsnap.
|
|
97
|
+
if (!effectiveConfig().enabled && current) {
|
|
98
|
+
applyResolution({ snapped: false, candidates: [] });
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
applySketchGeometry(tool, geometry) {
|
|
102
|
+
if (!model)
|
|
103
|
+
return false;
|
|
104
|
+
// Gate on the effective config so a snap acquired before snapping was
|
|
105
|
+
// disabled (e.g. directly via model.setSnapping) is never applied.
|
|
106
|
+
const active = effectiveConfig().enabled ? current : undefined;
|
|
107
|
+
const snapped = active ? withSnappedActiveVertex(geometry, active.position) : geometry;
|
|
108
|
+
const capability = model.setSketchGeometry(tool, snapped).toolCapability(tool);
|
|
109
|
+
return capability.state === "supported";
|
|
110
|
+
},
|
|
111
|
+
remove() {
|
|
112
|
+
map.off(pointerEvent, onPointerMove);
|
|
113
|
+
if (indicatorInstalled)
|
|
114
|
+
removeIndicator(map, indicator.id);
|
|
115
|
+
current = undefined;
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function normalizeIndicatorOptions(input) {
|
|
120
|
+
const options = typeof input === "object" ? input : {};
|
|
121
|
+
return {
|
|
122
|
+
enabled: input === false ? false : (options.enabled ?? true),
|
|
123
|
+
id: options.id ?? DEFAULT_INDICATOR_ID,
|
|
124
|
+
paint: { ...DEFAULT_INDICATOR_PAINT, ...(options.paint ?? {}) },
|
|
125
|
+
...(options.beforeId ? { beforeId: options.beforeId } : {}),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function installIndicator(map, options) {
|
|
129
|
+
if (!map.addSource || !map.addLayer)
|
|
130
|
+
return false;
|
|
131
|
+
if (!map.getSource?.(options.id)) {
|
|
132
|
+
map.addSource(options.id, { type: "geojson", data: emptyIndicatorData() });
|
|
133
|
+
}
|
|
134
|
+
if (!map.getLayer?.(options.id)) {
|
|
135
|
+
map.addLayer({ id: options.id, type: "circle", source: options.id, paint: options.paint }, options.beforeId);
|
|
136
|
+
}
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
function updateIndicator(map, id, candidate) {
|
|
140
|
+
const source = map.getSource?.(id);
|
|
141
|
+
source?.setData?.(candidate ? indicatorData(candidate) : emptyIndicatorData());
|
|
142
|
+
}
|
|
143
|
+
function removeIndicator(map, id) {
|
|
144
|
+
if (map.getLayer?.(id))
|
|
145
|
+
map.removeLayer?.(id);
|
|
146
|
+
if (map.getSource?.(id))
|
|
147
|
+
map.removeSource?.(id);
|
|
148
|
+
}
|
|
149
|
+
function emptyIndicatorData() {
|
|
150
|
+
return { type: "FeatureCollection", features: [] };
|
|
151
|
+
}
|
|
152
|
+
function indicatorData(candidate) {
|
|
153
|
+
return {
|
|
154
|
+
type: "FeatureCollection",
|
|
155
|
+
features: [
|
|
156
|
+
{
|
|
157
|
+
type: "Feature",
|
|
158
|
+
geometry: { type: "Point", coordinates: [candidate.position[0], candidate.position[1]] },
|
|
159
|
+
properties: {
|
|
160
|
+
kind: candidate.kind,
|
|
161
|
+
sourceId: candidate.sourceId,
|
|
162
|
+
featureId: candidate.featureId,
|
|
163
|
+
...(candidate.vertexIndex !== undefined ? { vertexIndex: candidate.vertexIndex } : {}),
|
|
164
|
+
...(candidate.segmentIndex !== undefined ? { segmentIndex: candidate.segmentIndex } : {}),
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function sameCandidate(a, b) {
|
|
171
|
+
return (a.kind === b.kind &&
|
|
172
|
+
a.sourceId === b.sourceId &&
|
|
173
|
+
a.featureId === b.featureId &&
|
|
174
|
+
a.vertexIndex === b.vertexIndex &&
|
|
175
|
+
a.segmentIndex === b.segmentIndex &&
|
|
176
|
+
a.position[0] === b.position[0] &&
|
|
177
|
+
a.position[1] === b.position[1]);
|
|
178
|
+
}
|
|
179
|
+
function pointerInput(event) {
|
|
180
|
+
if (!event || typeof event !== "object")
|
|
181
|
+
return undefined;
|
|
182
|
+
const candidate = event;
|
|
183
|
+
const point = candidate.point;
|
|
184
|
+
const lngLat = candidate.lngLat;
|
|
185
|
+
if (typeof point?.x !== "number" || typeof point.y !== "number")
|
|
186
|
+
return undefined;
|
|
187
|
+
if (typeof lngLat?.lng !== "number" || typeof lngLat.lat !== "number")
|
|
188
|
+
return undefined;
|
|
189
|
+
return { point: { x: point.x, y: point.y }, position: [lngLat.lng, lngLat.lat] };
|
|
190
|
+
}
|
package/runtime/errors.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
|
+
import { type HonuaErrorMetadata, HonuaSdkError } from "../core/error-envelope.js";
|
|
9
10
|
/**
|
|
10
11
|
* Stage of the runtime pipeline a failure occurred in. Keeping this as a
|
|
11
12
|
* string union lets callers switch on it without a dependency on the
|
|
@@ -25,7 +26,7 @@ export type HonuaMapPackageErrorStage = "fetch" | "load" | "validate" | "update"
|
|
|
25
26
|
* query-time rejections forwarded by mixed-source consumers — see
|
|
26
27
|
* `docs/composition.md`.
|
|
27
28
|
*/
|
|
28
|
-
export declare class HonuaMapPackageError extends
|
|
29
|
+
export declare class HonuaMapPackageError extends HonuaSdkError {
|
|
29
30
|
readonly packageId: string | undefined;
|
|
30
31
|
readonly stage: HonuaMapPackageErrorStage;
|
|
31
32
|
readonly detail: unknown;
|
|
@@ -35,6 +36,6 @@ export declare class HonuaMapPackageError extends Error {
|
|
|
35
36
|
stage: HonuaMapPackageErrorStage;
|
|
36
37
|
detail?: unknown;
|
|
37
38
|
cause?: unknown;
|
|
38
|
-
});
|
|
39
|
+
} & HonuaErrorMetadata);
|
|
39
40
|
}
|
|
40
41
|
//# sourceMappingURL=errors.d.ts.map
|
package/runtime/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/runtime/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GACjC,OAAO,GACP,MAAM,GACN,UAAU,GACV,QAAQ,GACR,eAAe,GACf,aAAa,GACb,MAAM,GACN,OAAO,GACP,SAAS,CAAC;AAEd;;;;;;;;;;;;GAYG;AACH,qBAAa,oBAAqB,SAAQ,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/runtime/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,kBAAkB,EAAE,aAAa,EAA0B,MAAM,2BAA2B,CAAC;AAE3G;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GACjC,OAAO,GACP,MAAM,GACN,UAAU,GACV,QAAQ,GACR,eAAe,GACf,aAAa,GACb,MAAM,GACN,OAAO,GACP,SAAS,CAAC;AAEd;;;;;;;;;;;;GAYG;AACH,qBAAa,oBAAqB,SAAQ,aAAa;IACrD,SAAgB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C,SAAgB,KAAK,EAAE,yBAAyB,CAAC;IACjD,SAAgB,MAAM,EAAE,OAAO,CAAC;IAChC,SAAyB,KAAK,EAAE,OAAO,CAAC;gBAGtC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,yBAAyB,CAAC;QACjC,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB,GAAG,kBAAkB;CAczB"}
|
package/runtime/errors.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
|
+
import { HonuaSdkError, mergeHonuaErrorContext } from "../core/error-envelope.js";
|
|
9
10
|
/**
|
|
10
11
|
* Thrown for runtime-level binding failures. Per-source / per-request
|
|
11
12
|
* protocol failures keep their existing error classes
|
|
@@ -19,13 +20,18 @@
|
|
|
19
20
|
* query-time rejections forwarded by mixed-source consumers — see
|
|
20
21
|
* `docs/composition.md`.
|
|
21
22
|
*/
|
|
22
|
-
export class HonuaMapPackageError extends
|
|
23
|
+
export class HonuaMapPackageError extends HonuaSdkError {
|
|
23
24
|
packageId;
|
|
24
25
|
stage;
|
|
25
26
|
detail;
|
|
26
27
|
cause;
|
|
27
28
|
constructor(message, options) {
|
|
28
|
-
super(message
|
|
29
|
+
super(MAP_PACKAGE_ERROR_CODES[options.stage], message, {
|
|
30
|
+
cause: options.cause,
|
|
31
|
+
operationId: options.operationId,
|
|
32
|
+
requestId: options.requestId,
|
|
33
|
+
context: mergeHonuaErrorContext(options.context, { packageId: options.packageId, stage: options.stage }),
|
|
34
|
+
});
|
|
29
35
|
this.name = "HonuaMapPackageError";
|
|
30
36
|
this.packageId = options.packageId;
|
|
31
37
|
this.stage = options.stage;
|
|
@@ -33,3 +39,14 @@ export class HonuaMapPackageError extends Error {
|
|
|
33
39
|
this.cause = options.cause;
|
|
34
40
|
}
|
|
35
41
|
}
|
|
42
|
+
const MAP_PACKAGE_ERROR_CODES = {
|
|
43
|
+
fetch: "runtime.map-package.fetch",
|
|
44
|
+
load: "runtime.map-package.load",
|
|
45
|
+
validate: "runtime.map-package.validate",
|
|
46
|
+
update: "runtime.map-package.update",
|
|
47
|
+
"style-compose": "runtime.map-package.style-compose",
|
|
48
|
+
"source-bind": "runtime.map-package.source-bind",
|
|
49
|
+
view: "runtime.map-package.view",
|
|
50
|
+
popup: "runtime.map-package.popup",
|
|
51
|
+
dispose: "runtime.map-package.dispose",
|
|
52
|
+
};
|
package/runtime/index.d.ts
CHANGED
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
*/
|
|
23
23
|
export { loadMapPackage } from "./load-package.js";
|
|
24
24
|
export type { LoadMapPackageOptions, SourceErrorPolicy } from "./load-package.js";
|
|
25
|
+
export { maplibreRenderer } from "./maplibre-renderer.js";
|
|
26
|
+
export type { MapLibreRendererFactoryOptions, MapLibreRendererMap, MapLibreRendererOptions, MapLibreRendererPeer, } from "./maplibre-renderer.js";
|
|
25
27
|
export { BoundedMapPackageFetchCache, DEFAULT_MAP_PACKAGE_CACHE_LIMIT, DEFAULT_MAP_PACKAGE_PATH_PREFIX, defaultMapPackagePath, fetchMapPackage, loadMapPackageFromId, mapPackageFingerprint, resolveMapPackagePath, } from "./map-package-fetch.js";
|
|
26
28
|
export type { FetchMapPackageOptions, FetchMapPackageResult, LoadMapPackageFromIdOptions, LoadMapPackageFromIdResult, MapPackageFetchCache, MapPackageFetchCacheEntry, MapPackageFetchCacheState, MapPackageFetchCacheStatus, MapPackageLocator, MapPackagePathResolver, } from "./map-package-fetch.js";
|
|
27
29
|
export { MAP_PACKAGE_REALTIME_CHANNEL_V1, createMapPackageServerSentEventsTransport, decodeMapPackageRealtimeMessage, encodeMapPackageRealtimeUrl, readMapPackageRealtimeAdvertisement, } from "./map-package-realtime.js";
|
|
@@ -56,4 +58,8 @@ export { diffPackages } from "./diff.js";
|
|
|
56
58
|
export type { MapPackageDiff } from "./diff.js";
|
|
57
59
|
export { HonuaRuntimeDiagnosticError, featureStateTargetFromSelection, featureStateTargetKey, featureTargetForLayer, materializeRuntimeLayer, materializeRuntimeSource, materializeStyleValue, protocolForSource, rendererRuntimeDiagnosticError, resolveFeatureIdFromEventFeature, resolveRuntimeBeforeId, selectionTargetForLayer, sourceContextForLayer, throwRuntimeDiagnostics, validateRuntimeFilterExpression, validateRuntimeLayer, validateRuntimeSource, validateRuntimeStyleExpression, } from "./style-interactions.js";
|
|
58
60
|
export type { HonuaRuntimeDiagnostic, HonuaRuntimeDiagnosticSeverity, NativeMapLibreSourceSpecification, RuntimeClickInteractionHandler, RuntimeClickInteractionOptions, RuntimeExplorationSelectionOptions, RuntimeFeatureInteractionEvent, RuntimeFeatureStateTarget, RuntimeFilterExpression, RuntimeHoverInteractionOptions, RuntimeLayerOrder, RuntimeLayerOrderOptions, RuntimeLayerSpecification, RuntimeLayerUpdate, RuntimeLayoutSpecification, RuntimePaintSpecification, RuntimeSelectionInteractionOptions, RuntimeSourceSpecification, RuntimeStyleValue, } from "./style-interactions.js";
|
|
61
|
+
export { bindEditSketchSnapping } from "./edit-snapping.js";
|
|
62
|
+
export type { BindEditSketchSnappingOptions, EditSketchSnapIndicatorOptions, EditSketchSnappingEvents, EditSketchSnappingHandle, SnappingMap, } from "./edit-snapping.js";
|
|
63
|
+
export { TERRA_DRAW_SKETCH_TOOL_MODES, bindTerraDrawSketch, createTerraDrawSketch, createTerraDrawSnapping, editSketchToolForTerraDrawMode, terraDrawSketchToolCapabilities, } from "./terra-draw-sketch.js";
|
|
64
|
+
export type { BindTerraDrawSketchOptions, CreateTerraDrawSketchOptions, CreateTerraDrawSnappingOptions, TerraDrawSketchController, TerraDrawSketchFeature, TerraDrawSketchFeatureId, TerraDrawSketchFinishContext, TerraDrawSketchFinishEvent, TerraDrawSketchHandle, TerraDrawSketchInstance, TerraDrawSnapContext, TerraDrawSnapEvent, } from "./terra-draw-sketch.js";
|
|
59
65
|
//# sourceMappingURL=index.d.ts.map
|
package/runtime/index.d.ts.map
CHANG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,EACvB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC"}
|
package/runtime/index.js
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* @packageDocumentation
|
|
22
22
|
*/
|
|
23
23
|
export { loadMapPackage } from "./load-package.js";
|
|
24
|
+
export { maplibreRenderer } from "./maplibre-renderer.js";
|
|
24
25
|
export { BoundedMapPackageFetchCache, DEFAULT_MAP_PACKAGE_CACHE_LIMIT, DEFAULT_MAP_PACKAGE_PATH_PREFIX, defaultMapPackagePath, fetchMapPackage, loadMapPackageFromId, mapPackageFingerprint, resolveMapPackagePath, } from "./map-package-fetch.js";
|
|
25
26
|
export { MAP_PACKAGE_REALTIME_CHANNEL_V1, createMapPackageServerSentEventsTransport, decodeMapPackageRealtimeMessage, encodeMapPackageRealtimeUrl, readMapPackageRealtimeAdvertisement, } from "./map-package-realtime.js";
|
|
26
27
|
export { watchMapPackage } from "./map-package-watch.js";
|
|
@@ -38,3 +39,5 @@ export { buildWmsRasterSourceSpec, buildWmtsRasterSourceSpec, projectSourceBindi
|
|
|
38
39
|
export { QueryTileRequestController, buildMapLibreQueryTileSourceSpec, buildQueryTileJson, buildQueryTileUrl, buildQueryTileUrlTemplate, createQueryTileRequestController, diagnoseQueryTileSourceSupport, fetchQueryTileFeatureDetail, fetchQueryTileJson, queryTilesForViewport, QueryTileServerResponseError, } from "./query-tiles.js";
|
|
39
40
|
export { diffPackages } from "./diff.js";
|
|
40
41
|
export { HonuaRuntimeDiagnosticError, featureStateTargetFromSelection, featureStateTargetKey, featureTargetForLayer, materializeRuntimeLayer, materializeRuntimeSource, materializeStyleValue, protocolForSource, rendererRuntimeDiagnosticError, resolveFeatureIdFromEventFeature, resolveRuntimeBeforeId, selectionTargetForLayer, sourceContextForLayer, throwRuntimeDiagnostics, validateRuntimeFilterExpression, validateRuntimeLayer, validateRuntimeSource, validateRuntimeStyleExpression, } from "./style-interactions.js";
|
|
42
|
+
export { bindEditSketchSnapping } from "./edit-snapping.js";
|
|
43
|
+
export { TERRA_DRAW_SKETCH_TOOL_MODES, bindTerraDrawSketch, createTerraDrawSketch, createTerraDrawSnapping, editSketchToolForTerraDrawMode, terraDrawSketchToolCapabilities, } from "./terra-draw-sketch.js";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { RendererAdapter } from "../kernel/renderer.js";
|
|
2
|
+
import { type ExplainAutomaticMapLibreOptions, type SourceToMapLibreMap } from "../map/index.js";
|
|
3
|
+
import type { PmtilesProtocolModuleLike } from "./pmtiles-protocol.js";
|
|
4
|
+
/** MapLibre module slice consumed from the caller-injected optional peer. */
|
|
5
|
+
export interface MapLibreRendererPeer {
|
|
6
|
+
/** Runtime-validated so the real MapLibre constructor remains structurally injectable. */
|
|
7
|
+
readonly Map?: unknown;
|
|
8
|
+
readonly addProtocol?: unknown;
|
|
9
|
+
readonly removeProtocol?: unknown;
|
|
10
|
+
readonly default?: unknown;
|
|
11
|
+
}
|
|
12
|
+
/** Host slice added to the existing source-mutation contract for lifecycle readiness. */
|
|
13
|
+
export interface MapLibreRendererMap extends SourceToMapLibreMap {
|
|
14
|
+
loaded?(): boolean;
|
|
15
|
+
/** Mirrors MapLibre v5, which returns void after the style has been destroyed. */
|
|
16
|
+
isStyleLoaded?(): boolean | void;
|
|
17
|
+
getStyle?(): unknown;
|
|
18
|
+
once?(event: string, listener: () => void): unknown;
|
|
19
|
+
off?(event: string, listener: () => void): unknown;
|
|
20
|
+
triggerRepaint?(): void;
|
|
21
|
+
remove?(): void;
|
|
22
|
+
}
|
|
23
|
+
export interface MapLibreRendererFactoryOptions {
|
|
24
|
+
/** Inject PMTiles only when PMTiles sources are expected; no package is loaded implicitly. */
|
|
25
|
+
readonly pmtiles?: PmtilesProtocolModuleLike;
|
|
26
|
+
}
|
|
27
|
+
/** Adapter-specific construction and automatic-strategy controls. */
|
|
28
|
+
export interface MapLibreRendererOptions extends Omit<ExplainAutomaticMapLibreOptions, "queryPlan"> {
|
|
29
|
+
/** Map-constructor options for an owned selector/element target; invalid for an existing map host. */
|
|
30
|
+
readonly mapOptions?: Readonly<Record<string, unknown>>;
|
|
31
|
+
/** Defaults to `render`, the first frame that can contain the mounted layer. */
|
|
32
|
+
readonly firstFrameEvent?: "render" | "idle";
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Create an executable MapLibre adapter without importing `maplibre-gl`.
|
|
36
|
+
* The supplied module is retained only on this adapter instance. `style` and
|
|
37
|
+
* `rendererOptions.mapOptions` configure owned map construction; an existing
|
|
38
|
+
* map must already carry its caller-owned construction state.
|
|
39
|
+
*/
|
|
40
|
+
export declare function maplibreRenderer(peer: MapLibreRendererPeer, options?: MapLibreRendererFactoryOptions): RendererAdapter<"maplibre", MapLibreRendererMap, MapLibreRendererOptions>;
|
|
41
|
+
//# sourceMappingURL=maplibre-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maplibre-renderer.d.ts","sourceRoot":"","sources":["../../../src/runtime/maplibre-renderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EAKhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,+BAA+B,EAEpC,KAAK,mBAAmB,EAGzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAGvE,6EAA6E;AAC7E,MAAM,WAAW,oBAAoB;IACnC,0FAA0F;IAC1F,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAQD,yFAAyF;AACzF,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC9D,MAAM,CAAC,IAAI,OAAO,CAAC;IACnB,kFAAkF;IAClF,aA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