@deck.gl-community/editable-layers 9.2.0-beta.4 → 9.2.0-beta.6
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/dist/edit-modes/draw-polygon-mode.d.ts +7 -3
- package/dist/edit-modes/draw-polygon-mode.d.ts.map +1 -1
- package/dist/edit-modes/draw-polygon-mode.js +226 -81
- package/dist/edit-modes/draw-polygon-mode.js.map +1 -1
- package/dist/index.cjs +184 -60
- package/dist/index.cjs.map +3 -3
- package/package.json +6 -2
- package/src/edit-modes/draw-polygon-mode.ts +303 -99
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { ClickEvent, PointerMoveEvent, ModeProps, GuideFeatureCollection, TentativeFeature, DoubleClickEvent } from "./types.js";
|
|
2
|
-
import { FeatureCollection } from "../utils/geojson-types.js";
|
|
2
|
+
import { Position, FeatureCollection } from "../utils/geojson-types.js";
|
|
3
3
|
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
4
4
|
export declare class DrawPolygonMode extends GeoJsonEditMode {
|
|
5
|
+
holeSequence: Position[];
|
|
6
|
+
isDrawingHole: boolean;
|
|
5
7
|
createTentativeFeature(props: ModeProps<FeatureCollection>): TentativeFeature;
|
|
6
8
|
getGuides(props: ModeProps<FeatureCollection>): GuideFeatureCollection;
|
|
7
|
-
finishDrawing(props: ModeProps<FeatureCollection>): void;
|
|
8
9
|
handleClick(event: ClickEvent, props: ModeProps<FeatureCollection>): void;
|
|
9
|
-
handleDoubleClick(
|
|
10
|
+
handleDoubleClick(_event: DoubleClickEvent, props: ModeProps<FeatureCollection>): void;
|
|
10
11
|
handleKeyUp(event: KeyboardEvent, props: ModeProps<FeatureCollection>): void;
|
|
11
12
|
handlePointerMove(event: PointerMoveEvent, props: ModeProps<FeatureCollection>): void;
|
|
13
|
+
finishDrawing(props: ModeProps<FeatureCollection>): void;
|
|
14
|
+
private tryAddHoleToExistingPolygon;
|
|
15
|
+
private validateAndCreateHole;
|
|
12
16
|
}
|
|
13
17
|
//# sourceMappingURL=draw-polygon-mode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draw-polygon-mode.d.ts","sourceRoot":"","sources":["../../src/edit-modes/draw-polygon-mode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"draw-polygon-mode.d.ts","sourceRoot":"","sources":["../../src/edit-modes/draw-polygon-mode.ts"],"names":[],"mappings":"AASA,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,sBAAsB,EACtB,gBAAgB,EAEhB,gBAAgB,EACjB,mBAAgB;AACjB,OAAO,EAAC,QAAQ,EAAE,iBAAiB,EAAW,kCAA+B;AAE7E,OAAO,EAAC,eAAe,EAAC,+BAA4B;AAIpD,qBAAa,eAAgB,SAAQ,eAAe;IAElD,YAAY,EAAE,QAAQ,EAAE,CAAM;IAC9B,aAAa,UAAS;IAEtB,sBAAsB,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,gBAAgB;IAuC7E,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,sBAAsB;IAgCtE,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IA2ElE,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAK/E,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAiBrE,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAM9E,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAyDjD,OAAO,CAAC,2BAA2B;IAiBnC,OAAO,CAAC,qBAAqB;CAuE9B"}
|
|
@@ -2,113 +2,130 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import lineIntersect from '@turf/line-intersect';
|
|
5
|
-
import {
|
|
5
|
+
import { polygon as turfPolygon } from '@turf/helpers';
|
|
6
|
+
import booleanWithin from "@turf/boolean-within";
|
|
6
7
|
import { getPickedEditHandle } from "./utils.js";
|
|
7
8
|
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
9
|
+
import { ImmutableFeatureCollection } from "./immutable-feature-collection.js";
|
|
8
10
|
export class DrawPolygonMode extends GeoJsonEditMode {
|
|
11
|
+
holeSequence = [];
|
|
12
|
+
isDrawingHole = false;
|
|
9
13
|
createTentativeFeature(props) {
|
|
10
14
|
const { lastPointerMoveEvent } = props;
|
|
11
15
|
const clickSequence = this.getClickSequence();
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
const holeSequence = this.holeSequence;
|
|
17
|
+
const lastCoords = lastPointerMoveEvent
|
|
18
|
+
? [lastPointerMoveEvent.mapCoords]
|
|
19
|
+
: [];
|
|
20
|
+
let geometry;
|
|
21
|
+
if (this.isDrawingHole && holeSequence.length > 1) {
|
|
22
|
+
geometry = {
|
|
23
|
+
type: "Polygon",
|
|
24
|
+
coordinates: [
|
|
25
|
+
[...clickSequence, clickSequence[0]],
|
|
26
|
+
[...holeSequence, ...lastCoords, holeSequence[0]],
|
|
27
|
+
],
|
|
24
28
|
};
|
|
25
29
|
}
|
|
26
30
|
else if (clickSequence.length > 2) {
|
|
27
|
-
|
|
28
|
-
type:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
geometry = {
|
|
32
|
+
type: "Polygon",
|
|
33
|
+
coordinates: [[...clickSequence, ...lastCoords, clickSequence[0]]],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
geometry = {
|
|
38
|
+
type: "LineString",
|
|
39
|
+
coordinates: [...clickSequence, ...lastCoords],
|
|
36
40
|
};
|
|
37
41
|
}
|
|
38
|
-
return
|
|
42
|
+
return {
|
|
43
|
+
type: "Feature",
|
|
44
|
+
properties: {
|
|
45
|
+
guideType: "tentative",
|
|
46
|
+
},
|
|
47
|
+
geometry,
|
|
48
|
+
};
|
|
39
49
|
}
|
|
40
50
|
getGuides(props) {
|
|
41
|
-
const clickSequence = this.getClickSequence();
|
|
42
51
|
const guides = {
|
|
43
|
-
type:
|
|
44
|
-
features: []
|
|
52
|
+
type: "FeatureCollection",
|
|
53
|
+
features: [],
|
|
45
54
|
};
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
-
guides.features.push(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
const tentative = this.createTentativeFeature(props);
|
|
56
|
+
if (tentative)
|
|
57
|
+
guides.features.push(tentative);
|
|
58
|
+
const sequence = this.isDrawingHole
|
|
59
|
+
? this.holeSequence
|
|
60
|
+
: this.getClickSequence();
|
|
61
|
+
const handles = sequence.map((coord, index) => ({
|
|
62
|
+
type: "Feature",
|
|
52
63
|
properties: {
|
|
53
|
-
guideType:
|
|
54
|
-
editHandleType:
|
|
64
|
+
guideType: "editHandle",
|
|
65
|
+
editHandleType: "existing",
|
|
55
66
|
featureIndex: -1,
|
|
56
|
-
positionIndexes: [index]
|
|
67
|
+
positionIndexes: [index],
|
|
57
68
|
},
|
|
58
69
|
geometry: {
|
|
59
|
-
type:
|
|
60
|
-
coordinates:
|
|
61
|
-
}
|
|
70
|
+
type: "Point",
|
|
71
|
+
coordinates: coord,
|
|
72
|
+
},
|
|
62
73
|
}));
|
|
63
|
-
guides.features.push(...
|
|
74
|
+
guides.features.push(...handles);
|
|
64
75
|
return guides;
|
|
65
76
|
}
|
|
66
|
-
|
|
67
|
-
const clickSequence = this.getClickSequence();
|
|
68
|
-
if (clickSequence.length > 2) {
|
|
69
|
-
const polygonToAdd = {
|
|
70
|
-
type: 'Polygon',
|
|
71
|
-
coordinates: [[...clickSequence, clickSequence[0]]]
|
|
72
|
-
};
|
|
73
|
-
this.resetClickSequence();
|
|
74
|
-
const editAction = this.getAddFeatureOrBooleanPolygonAction(polygonToAdd, props);
|
|
75
|
-
if (editAction) {
|
|
76
|
-
props.onEdit(editAction);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
// eslint-disable-next-line complexity
|
|
77
|
+
// eslint-disable-next-line complexity, max-statements
|
|
81
78
|
handleClick(event, props) {
|
|
82
79
|
const { picks } = event;
|
|
83
80
|
const clickedEditHandle = getPickedEditHandle(picks);
|
|
84
81
|
const clickSequence = this.getClickSequence();
|
|
85
|
-
|
|
86
|
-
if
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
event.mapCoords
|
|
90
|
-
]);
|
|
91
|
-
const otherLines = turfLineString([...clickSequence.slice(0, clickSequence.length - 1)]);
|
|
92
|
-
const intersectingPoints = lineIntersect(currentLine, otherLines);
|
|
93
|
-
if (intersectingPoints.features.length > 0) {
|
|
94
|
-
overlappingLines = true;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
let positionAdded = false;
|
|
98
|
-
if (!clickedEditHandle && !overlappingLines) {
|
|
99
|
-
// Don't add another point right next to an existing one
|
|
100
|
-
this.addClickSequence(event);
|
|
101
|
-
positionAdded = true;
|
|
102
|
-
}
|
|
103
|
-
if (clickSequence.length > 2 &&
|
|
82
|
+
const coords = event.mapCoords;
|
|
83
|
+
// Check if they clicked on an edit handle to complete the polygon
|
|
84
|
+
if (!this.isDrawingHole &&
|
|
85
|
+
clickSequence.length > 2 &&
|
|
104
86
|
clickedEditHandle &&
|
|
105
87
|
Array.isArray(clickedEditHandle.properties.positionIndexes) &&
|
|
106
88
|
(clickedEditHandle.properties.positionIndexes[0] === 0 ||
|
|
107
89
|
clickedEditHandle.properties.positionIndexes[0] === clickSequence.length - 1)) {
|
|
108
|
-
// They clicked the first or last point
|
|
90
|
+
// They clicked the first or last point, so complete the polygon
|
|
109
91
|
this.finishDrawing(props);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
// Check if they clicked near the first point to complete the polygon
|
|
95
|
+
if (!this.isDrawingHole && clickSequence.length > 2) {
|
|
96
|
+
if (isNearFirstPoint(coords, clickSequence[0])) {
|
|
97
|
+
this.finishDrawing(props);
|
|
98
|
+
this.resetClickSequence();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (this.isDrawingHole) {
|
|
103
|
+
const current = this.holeSequence;
|
|
104
|
+
current.push(coords);
|
|
105
|
+
if (current.length > 2) {
|
|
106
|
+
const poly = {
|
|
107
|
+
type: "Polygon",
|
|
108
|
+
coordinates: [
|
|
109
|
+
[...clickSequence, clickSequence[0]],
|
|
110
|
+
[...current, current[0]],
|
|
111
|
+
],
|
|
112
|
+
};
|
|
113
|
+
this.resetClickSequence();
|
|
114
|
+
this.holeSequence = [];
|
|
115
|
+
this.isDrawingHole = false;
|
|
116
|
+
const editAction = this.getAddFeatureOrBooleanPolygonAction(poly, props);
|
|
117
|
+
if (editAction)
|
|
118
|
+
props.onEdit(editAction);
|
|
119
|
+
}
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
// Add the click if we didn't click on a handle
|
|
123
|
+
let positionAdded = false;
|
|
124
|
+
if (!clickedEditHandle) {
|
|
125
|
+
this.addClickSequence(event);
|
|
126
|
+
positionAdded = true;
|
|
110
127
|
}
|
|
111
|
-
|
|
128
|
+
if (positionAdded) {
|
|
112
129
|
// new tentative point
|
|
113
130
|
props.onEdit({
|
|
114
131
|
// data is the same
|
|
@@ -120,20 +137,23 @@ export class DrawPolygonMode extends GeoJsonEditMode {
|
|
|
120
137
|
});
|
|
121
138
|
}
|
|
122
139
|
}
|
|
123
|
-
handleDoubleClick(
|
|
140
|
+
handleDoubleClick(_event, props) {
|
|
124
141
|
this.finishDrawing(props);
|
|
142
|
+
this.resetClickSequence();
|
|
125
143
|
}
|
|
126
144
|
handleKeyUp(event, props) {
|
|
127
|
-
if (event.key ===
|
|
145
|
+
if (event.key === "Enter") {
|
|
128
146
|
this.finishDrawing(props);
|
|
147
|
+
this.resetClickSequence();
|
|
129
148
|
}
|
|
130
|
-
else if (event.key ===
|
|
149
|
+
else if (event.key === "Escape") {
|
|
131
150
|
this.resetClickSequence();
|
|
151
|
+
this.holeSequence = [];
|
|
152
|
+
this.isDrawingHole = false;
|
|
132
153
|
props.onEdit({
|
|
133
|
-
// Because the new drawing feature is dropped, so the data will keep as the same.
|
|
134
154
|
updatedData: props.data,
|
|
135
|
-
editType:
|
|
136
|
-
editContext: {}
|
|
155
|
+
editType: "cancelFeature",
|
|
156
|
+
editContext: {},
|
|
137
157
|
});
|
|
138
158
|
}
|
|
139
159
|
}
|
|
@@ -141,5 +161,130 @@ export class DrawPolygonMode extends GeoJsonEditMode {
|
|
|
141
161
|
props.onUpdateCursor('cell');
|
|
142
162
|
super.handlePointerMove(event, props);
|
|
143
163
|
}
|
|
164
|
+
// eslint-disable-next-line max-statements, complexity
|
|
165
|
+
finishDrawing(props) {
|
|
166
|
+
const clickSequence = this.getClickSequence();
|
|
167
|
+
const polygon = [...clickSequence, clickSequence[0]];
|
|
168
|
+
const newPolygon = turfPolygon([polygon]);
|
|
169
|
+
const canAddHole = canAddHoleToPolygon(props);
|
|
170
|
+
const canOverlap = canPolygonOverlap(props);
|
|
171
|
+
// Check if the polygon intersects itself (excluding shared start/end point)
|
|
172
|
+
if (!canOverlap) {
|
|
173
|
+
const overlapping = lineIntersect(newPolygon, newPolygon).features.filter((intersection) => !newPolygon.geometry.coordinates[0].some((coord) => coord[0] === intersection.geometry.coordinates[0] &&
|
|
174
|
+
coord[1] === intersection.geometry.coordinates[1]));
|
|
175
|
+
if (overlapping.length > 0) {
|
|
176
|
+
// ❌ Invalid polygon: overlaps
|
|
177
|
+
props.onEdit({
|
|
178
|
+
updatedData: props.data,
|
|
179
|
+
editType: "invalidPolygon",
|
|
180
|
+
editContext: { reason: "overlaps" },
|
|
181
|
+
});
|
|
182
|
+
this.resetClickSequence();
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (canAddHole) {
|
|
187
|
+
const holeResult = this.tryAddHoleToExistingPolygon(newPolygon, polygon, props);
|
|
188
|
+
if (holeResult.handled) {
|
|
189
|
+
this.resetClickSequence();
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
// If no valid hole was found, add the polygon as a new feature
|
|
194
|
+
const editAction = this.getAddFeatureOrBooleanPolygonAction({
|
|
195
|
+
type: "Polygon",
|
|
196
|
+
coordinates: [[...this.getClickSequence(), this.getClickSequence()[0]]],
|
|
197
|
+
}, props);
|
|
198
|
+
if (editAction)
|
|
199
|
+
props.onEdit(editAction);
|
|
200
|
+
this.resetClickSequence();
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
tryAddHoleToExistingPolygon(newPolygon, polygon, props) {
|
|
204
|
+
for (const [featureIndex, feature] of props.data.features.entries()) {
|
|
205
|
+
if (feature.geometry.type === "Polygon") {
|
|
206
|
+
const result = this.validateAndCreateHole(feature, featureIndex, newPolygon, polygon, props);
|
|
207
|
+
if (result.handled) {
|
|
208
|
+
return result;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return { handled: false };
|
|
213
|
+
}
|
|
214
|
+
validateAndCreateHole(feature, featureIndex, newPolygon, polygon, props) {
|
|
215
|
+
const outer = turfPolygon(feature.geometry.coordinates);
|
|
216
|
+
// Check existing holes for conflicts
|
|
217
|
+
for (let i = 1; i < feature.geometry.coordinates.length; i++) {
|
|
218
|
+
const hole = turfPolygon([feature.geometry.coordinates[i]]);
|
|
219
|
+
const intersection = lineIntersect(hole, newPolygon);
|
|
220
|
+
if (intersection.features.length > 0) {
|
|
221
|
+
props.onEdit({
|
|
222
|
+
updatedData: props.data,
|
|
223
|
+
editType: "invalidHole",
|
|
224
|
+
editContext: { reason: "intersects-existing-hole" },
|
|
225
|
+
});
|
|
226
|
+
return { handled: true };
|
|
227
|
+
}
|
|
228
|
+
if (booleanWithin(hole, newPolygon) || booleanWithin(newPolygon, hole)) {
|
|
229
|
+
props.onEdit({
|
|
230
|
+
updatedData: props.data,
|
|
231
|
+
editType: "invalidHole",
|
|
232
|
+
editContext: { reason: "contains-or-contained-by-existing-hole" },
|
|
233
|
+
});
|
|
234
|
+
return { handled: true };
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
// Check outer polygon conflicts
|
|
238
|
+
const intersectionWithOuter = lineIntersect(outer, newPolygon);
|
|
239
|
+
if (intersectionWithOuter.features.length > 0) {
|
|
240
|
+
props.onEdit({
|
|
241
|
+
updatedData: props.data,
|
|
242
|
+
editType: "invalidPolygon",
|
|
243
|
+
editContext: { reason: "intersects-existing-polygon" },
|
|
244
|
+
});
|
|
245
|
+
return { handled: true };
|
|
246
|
+
}
|
|
247
|
+
if (booleanWithin(outer, newPolygon)) {
|
|
248
|
+
props.onEdit({
|
|
249
|
+
updatedData: props.data,
|
|
250
|
+
editType: "invalidPolygon",
|
|
251
|
+
editContext: { reason: "contains-existing-polygon" },
|
|
252
|
+
});
|
|
253
|
+
return { handled: true };
|
|
254
|
+
}
|
|
255
|
+
// Check if new polygon is within outer polygon (valid hole)
|
|
256
|
+
if (booleanWithin(newPolygon, outer)) {
|
|
257
|
+
const updatedData = new ImmutableFeatureCollection(props.data)
|
|
258
|
+
.replaceGeometry(featureIndex, {
|
|
259
|
+
...feature.geometry,
|
|
260
|
+
coordinates: [...feature.geometry.coordinates, polygon],
|
|
261
|
+
})
|
|
262
|
+
.getObject();
|
|
263
|
+
props.onEdit({
|
|
264
|
+
updatedData,
|
|
265
|
+
editType: "addHole",
|
|
266
|
+
editContext: { hole: newPolygon.geometry },
|
|
267
|
+
});
|
|
268
|
+
return { handled: true };
|
|
269
|
+
}
|
|
270
|
+
return { handled: false };
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
// Helper function to check if a point is near the first point in the sequence
|
|
274
|
+
function isNearFirstPoint(click, first, threshold = 1e-4) {
|
|
275
|
+
const dx = click[0] - first[0];
|
|
276
|
+
const dy = click[1] - first[1];
|
|
277
|
+
return dx * dx + dy * dy < threshold * threshold;
|
|
278
|
+
}
|
|
279
|
+
// Helper function to determine if a hole can be added to a polygon
|
|
280
|
+
function canAddHoleToPolygon(props) {
|
|
281
|
+
// For simplicity, always return true in this example.
|
|
282
|
+
// Implement your own logic based on application requirements.
|
|
283
|
+
return props.modeConfig?.allowHoles ?? false;
|
|
284
|
+
}
|
|
285
|
+
// Helper function to determine if a polygon can intersect itself
|
|
286
|
+
function canPolygonOverlap(props) {
|
|
287
|
+
// Return the value of allowSelfIntersection (defaults to false for safety)
|
|
288
|
+
return props.modeConfig?.allowSelfIntersection ?? false;
|
|
144
289
|
}
|
|
145
290
|
//# sourceMappingURL=draw-polygon-mode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draw-polygon-mode.js","sourceRoot":"","sources":["../../src/edit-modes/draw-polygon-mode.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,aAAa,MAAM,sBAAsB,CAAC;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"draw-polygon-mode.js","sourceRoot":"","sources":["../../src/edit-modes/draw-polygon-mode.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,aAAa,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAC,MAAM,eAAe,CAAC;AACtD,OAAO,aAAa,MAAM,sBAAsB,CAAC;AAajD,OAAO,EAAC,mBAAmB,EAAC,mBAAgB;AAC5C,OAAO,EAAC,eAA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