@mapvx/web-js 3.5.0-dev.1 → 3.5.0-dev.3
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/cjs/controllers/routeController.js +221 -47
- package/dist/cjs/controllers/routeController.js.map +1 -1
- package/dist/cjs/domain/models/animation.js.map +1 -1
- package/dist/cjs/domain/models/marker.js +31 -0
- package/dist/cjs/domain/models/marker.js.map +1 -1
- package/dist/cjs/domain/models/routeInstance.js.map +1 -1
- package/dist/cjs/logger/sentry.js +1 -1
- package/dist/cjs/map/map.js +18 -10
- package/dist/cjs/map/map.js.map +1 -1
- package/dist/cjs/utils/loadGlb.js +55 -20
- package/dist/cjs/utils/loadGlb.js.map +1 -1
- package/dist/cjs/utils/three.js +70 -34
- package/dist/cjs/utils/three.js.map +1 -1
- package/dist/es/controllers/routeController.d.ts +14 -0
- package/dist/es/controllers/routeController.d.ts.map +1 -1
- package/dist/es/controllers/routeController.js +221 -47
- package/dist/es/controllers/routeController.js.map +1 -1
- package/dist/es/domain/models/animation.d.ts +19 -0
- package/dist/es/domain/models/animation.d.ts.map +1 -1
- package/dist/es/domain/models/animation.js.map +1 -1
- package/dist/es/domain/models/marker.d.ts +27 -0
- package/dist/es/domain/models/marker.d.ts.map +1 -1
- package/dist/es/domain/models/marker.js +31 -0
- package/dist/es/domain/models/marker.js.map +1 -1
- package/dist/es/domain/models/routeInstance.d.ts +11 -0
- package/dist/es/domain/models/routeInstance.d.ts.map +1 -1
- package/dist/es/domain/models/routeInstance.js.map +1 -1
- package/dist/es/logger/sentry.js +1 -1
- package/dist/es/map/map.d.ts +9 -0
- package/dist/es/map/map.d.ts.map +1 -1
- package/dist/es/map/map.js +18 -10
- package/dist/es/map/map.js.map +1 -1
- package/dist/es/utils/loadGlb.d.ts +41 -0
- package/dist/es/utils/loadGlb.d.ts.map +1 -1
- package/dist/es/utils/loadGlb.js +55 -21
- package/dist/es/utils/loadGlb.js.map +1 -1
- package/dist/es/utils/three.d.ts +37 -8
- package/dist/es/utils/three.d.ts.map +1 -1
- package/dist/es/utils/three.js +68 -32
- package/dist/es/utils/three.js.map +1 -1
- package/dist/umd/index.js +548 -205
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,35 +1,70 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEFAULT_GLB_LOAD_TIMEOUT_MS = void 0;
|
|
4
|
+
exports.createLazyMeshoptDecoder = createLazyMeshoptDecoder;
|
|
4
5
|
exports.loadGlbRoot = loadGlbRoot;
|
|
5
6
|
const draco_1 = require("../config/draco");
|
|
6
7
|
const three_1 = require("./three");
|
|
8
|
+
/**
|
|
9
|
+
* Builds a stand-in meshopt decoder that defers importing the real module (and instantiating its
|
|
10
|
+
* WASM) until the first `EXT_meshopt_compression` buffer actually needs decoding. GLBs without the
|
|
11
|
+
* extension never trigger the import, so the decoder stays off the critical path of the first 3D
|
|
12
|
+
* frame — it used to be part of the eager three.js import chain, delaying every scene load.
|
|
13
|
+
*
|
|
14
|
+
* `supported` mirrors the real module's own gate — it returns a bare `{ supported: false }` when
|
|
15
|
+
* `typeof WebAssembly !== "object"` — so the answer is reproduced synchronously here without
|
|
16
|
+
* importing anything. Reporting a flat `true` instead would break the platforms it claims to
|
|
17
|
+
* support: `GLTFLoader` reads `supported` before deciding to decode, and on `false` with meshopt
|
|
18
|
+
* merely OPTIONAL it returns `null` and falls back to the GLB's uncompressed buffer
|
|
19
|
+
* (`GLTFLoader.js` `GLTFMeshoptCompression.loadBufferView`). Claiming support on a WASM-less
|
|
20
|
+
* platform discards that fallback and fails the whole asset with a `TypeError` from this shim,
|
|
21
|
+
* since `decodeGltfBufferAsync` does not exist on the real module there.
|
|
22
|
+
*
|
|
23
|
+
* @param load Injectable module loader, for tests. Defaults to the cached {@link loadMeshoptDecoder}.
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
function createLazyMeshoptDecoder(load = three_1.loadMeshoptDecoder) {
|
|
27
|
+
return {
|
|
28
|
+
// Same condition the real decoder uses, evaluated without loading it.
|
|
29
|
+
supported: typeof WebAssembly === "object",
|
|
30
|
+
decodeGltfBufferAsync: async (count, size, source, mode, filter) => {
|
|
31
|
+
const decoder = await load();
|
|
32
|
+
await decoder.ready;
|
|
33
|
+
return decoder.decodeGltfBufferAsync(count, size, source, mode, filter);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
7
37
|
/**
|
|
8
38
|
* Lazily-initialized, cached GLTF loader configured with Draco + KTX2 support.
|
|
9
39
|
*
|
|
10
40
|
* The loaders (and their WebGLRenderer for KTX2 support detection) are heavy and pull in Three.js,
|
|
11
41
|
* so they are created on first use inside the dynamic-import boundary rather than at module load.
|
|
42
|
+
*
|
|
43
|
+
* Memoized through {@link memoizeImport} for the same reason the loaders in `three.ts` are: a plain
|
|
44
|
+
* `cached ??=` also caches a rejection. Fixing the three loaders was not enough, because this is a
|
|
45
|
+
* SECOND cache wrapped around `loadThree()` — so a transient failure was evicted there and then
|
|
46
|
+
* replayed from here forever, and `loadGlbRoot` awaits both, meaning every GLB kept failing with
|
|
47
|
+
* the stale error long after `loadThree()` had recovered. Not only network: the `.then` below
|
|
48
|
+
* constructs a `WebGLRenderer` for KTX2 support detection, and a failed context creation was
|
|
49
|
+
* cached just the same.
|
|
12
50
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}));
|
|
31
|
-
return gltfLoaderPromise;
|
|
32
|
-
}
|
|
51
|
+
const getGltfLoader = (0, three_1.memoizeImport)(() => (0, three_1.loadThree)().then((mod) => {
|
|
52
|
+
const dracoLoader = new mod.DRACOLoader();
|
|
53
|
+
dracoLoader.setDecoderPath(draco_1.DEFAULT_DRACO_DECODER_PATH);
|
|
54
|
+
const gltfLoader = new mod.GLTFLoader();
|
|
55
|
+
gltfLoader.setDRACOLoader(dracoLoader);
|
|
56
|
+
const ktx2Loader = new mod.KTX2Loader();
|
|
57
|
+
ktx2Loader.setTranscoderPath(draco_1.DEFAULT_KTX2_TRANSCODER_PATH);
|
|
58
|
+
gltfLoader.setKTX2Loader(ktx2Loader);
|
|
59
|
+
ktx2Loader.detectSupport(new mod.THREE.WebGLRenderer({ antialias: true }));
|
|
60
|
+
// Enable EXT_meshopt_compression so meshopt-compressed GLBs decode, without paying for the
|
|
61
|
+
// decoder module up front: the lazy stand-in imports it (and instantiates its WASM) only when
|
|
62
|
+
// the first meshopt-compressed buffer is actually decoded. Assets that don't use the extension
|
|
63
|
+
// never load it. The cast is safe — with `decodeGltfBufferAsync` present, GLTFLoader touches
|
|
64
|
+
// only `supported` and `decodeGltfBufferAsync` (see LazyMeshoptDecoder).
|
|
65
|
+
gltfLoader.setMeshoptDecoder(createLazyMeshoptDecoder());
|
|
66
|
+
return gltfLoader;
|
|
67
|
+
}));
|
|
33
68
|
/**
|
|
34
69
|
* Default per-asset timeout for {@link loadGlbRoot}.
|
|
35
70
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadGlb.js","sourceRoot":"","sources":["../../../src/utils/loadGlb.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"loadGlb.js","sourceRoot":"","sources":["../../../src/utils/loadGlb.ts"],"names":[],"mappings":";;;AA8CA,4DAkBC;AAyHD,kCA4EC;AAlQD,2CAA0F;AAC1F,mCAAsE;AAwBtE;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,wBAAwB,CACtC,OAA6C,0BAAkB;IAE/D,OAAO;QACL,sEAAsE;QACtE,SAAS,EAAE,OAAO,WAAW,KAAK,QAAQ;QAC1C,qBAAqB,EAAE,KAAK,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AAE,MAAM,EAAE,EAAE;QACtD,KAAK,GAAG,UAAU,CAChB,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,+BAA+B,SAAS,OAAO,GAAG,EAAE,CAAC,CAAC,EAC7E,SAAS,CACV,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA;IAC5C,CAAC;YAAS,CAAC;QACT,OAAO,GAAG,IAAI,CAAA;QACd,YAAY,CAAC,KAAK,CAAC,CAAA;QACnB,4FAA4F;QAC5F,6FAA6F;QAC7F,4FAA4F;QAC5F,4EAA4E;QAC5E,UAAU,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;AACH,CAAC"}
|
package/dist/cjs/utils/three.js
CHANGED
|
@@ -33,45 +33,81 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.loadThree =
|
|
37
|
-
exports.
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
exports.loadDeck = exports.loadMeshoptDecoder = exports.loadThree = void 0;
|
|
37
|
+
exports.memoizeImport = memoizeImport;
|
|
38
|
+
/**
|
|
39
|
+
* Memoizes a dynamic-import chain, caching only a FULFILLED result.
|
|
40
|
+
*
|
|
41
|
+
* A plain `cached ??= import(...)` also memoizes a *rejection*, so one transient chunk-fetch
|
|
42
|
+
* failure (a dropped connection, a cache-busted deploy mid-session) permanently disables the
|
|
43
|
+
* feature for the rest of the page's life: every retry receives the same rejected promise and
|
|
44
|
+
* fails identically. The 3D scene retries on its own — `reloadScene3DModelsForLod` reloads GLB
|
|
45
|
+
* templates on every zoom-in past the LOD threshold — so a sticky rejection turns a blip into
|
|
46
|
+
* models that never come back until the user reloads.
|
|
47
|
+
*
|
|
48
|
+
* Concurrent callers still share one in-flight import (that is the point of the cache); only the
|
|
49
|
+
* rejected promise is evicted, and the error is re-thrown so every current caller still sees it.
|
|
50
|
+
*
|
|
51
|
+
* Exported only so the eviction behaviour can be tested directly — the loaders below wrap real
|
|
52
|
+
* dynamic `import()` calls, which a unit test cannot fail on demand.
|
|
53
|
+
*
|
|
54
|
+
* @param load Builds the import promise. Called again on the first retry after a failure.
|
|
55
|
+
* @returns An accessor that imports at most once per successful load.
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
function memoizeImport(load) {
|
|
59
|
+
let cached;
|
|
60
|
+
return () => {
|
|
61
|
+
cached !== null && cached !== void 0 ? cached : (cached = load().catch((error) => {
|
|
62
|
+
// Evict BEFORE re-throwing so the next call starts a fresh import. Safe to assign here:
|
|
63
|
+
// a promise never settles synchronously, so `cached` is already assigned by now.
|
|
64
|
+
cached = undefined;
|
|
65
|
+
throw error;
|
|
66
|
+
}));
|
|
67
|
+
return cached;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
40
70
|
/**
|
|
41
71
|
* Dynamically imports Three.js and the GLTF/DRACO/KTX2 loaders once and caches the result.
|
|
42
72
|
* Subsequent calls return the same promise, so a single Three.js instance is shared.
|
|
73
|
+
* A failed import is not cached — see {@link memoizeImport}.
|
|
43
74
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
75
|
+
exports.loadThree = memoizeImport(() => Promise.all([
|
|
76
|
+
Promise.resolve().then(() => __importStar(require("three"))),
|
|
77
|
+
Promise.resolve().then(() => __importStar(require("three/addons/loaders/GLTFLoader.js"))),
|
|
78
|
+
Promise.resolve().then(() => __importStar(require("three/addons/loaders/DRACOLoader.js"))),
|
|
79
|
+
Promise.resolve().then(() => __importStar(require("three/addons/loaders/KTX2Loader.js"))),
|
|
80
|
+
]).then(([three, gltf, draco, ktx2]) => ({
|
|
81
|
+
THREE: three,
|
|
82
|
+
GLTFLoader: gltf.GLTFLoader,
|
|
83
|
+
DRACOLoader: draco.DRACOLoader,
|
|
84
|
+
KTX2Loader: ktx2.KTX2Loader,
|
|
85
|
+
})));
|
|
86
|
+
/**
|
|
87
|
+
* Dynamically imports the singleton meshopt decoder once and caches the result.
|
|
88
|
+
*
|
|
89
|
+
* Deliberately NOT part of {@link loadThree}'s import chain: only GLBs compressed with
|
|
90
|
+
* `EXT_meshopt_compression` need it, so keeping it out of the eager `Promise.all` keeps the
|
|
91
|
+
* decoder module (and its WASM instantiation) off the critical path of the first 3D frame.
|
|
92
|
+
* It is fetched on the first meshopt buffer decode instead — see the lazy wrapper in
|
|
93
|
+
* `loadGlb.ts`. That moves the fetch inside `parse()`, competing with hundreds of MB of GLB
|
|
94
|
+
* downloads, so not caching a failed import (see {@link memoizeImport}) matters more here than
|
|
95
|
+
* for the eager loaders.
|
|
96
|
+
*/
|
|
97
|
+
exports.loadMeshoptDecoder = memoizeImport(() => Promise.resolve().then(() => __importStar(require("three/addons/libs/meshopt_decoder.module.js"))).then((meshopt) => meshopt.MeshoptDecoder));
|
|
60
98
|
/**
|
|
61
99
|
* Dynamically imports the deck.gl overlay and layer classes once and caches the result.
|
|
100
|
+
* A failed import is not cached — see {@link memoizeImport}.
|
|
62
101
|
*/
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
})));
|
|
75
|
-
return deckPromise;
|
|
76
|
-
}
|
|
102
|
+
exports.loadDeck = memoizeImport(() => Promise.all([
|
|
103
|
+
Promise.resolve().then(() => __importStar(require("@deck.gl/mapbox"))),
|
|
104
|
+
Promise.resolve().then(() => __importStar(require("@deck.gl/geo-layers"))),
|
|
105
|
+
Promise.resolve().then(() => __importStar(require("@deck.gl/layers"))),
|
|
106
|
+
]).then(([mapbox, geoLayers, layers]) => ({
|
|
107
|
+
MapboxOverlay: mapbox.MapboxOverlay,
|
|
108
|
+
MVTLayer: geoLayers.MVTLayer,
|
|
109
|
+
IconLayer: layers.IconLayer,
|
|
110
|
+
PathLayer: layers.PathLayer,
|
|
111
|
+
TextLayer: layers.TextLayer,
|
|
112
|
+
})));
|
|
77
113
|
//# sourceMappingURL=three.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"three.js","sourceRoot":"","sources":["../../../src/utils/three.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"three.js","sourceRoot":"","sources":["../../../src/utils/three.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,sCAWC;AA/BD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,aAAa,CAAI,IAAsB;IACrD,IAAI,MAA8B,CAAA;IAClC,OAAO,GAAG,EAAE;QACV,MAAM,aAAN,MAAM,cAAN,MAAM,IAAN,MAAM,GAAK,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;YACzC,wFAAwF;YACxF,iFAAiF;YACjF,MAAM,GAAG,SAAS,CAAA;YAClB,MAAM,KAAK,CAAA;QACb,CAAC,CAAC,EAAA;QACF,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;AACH,CAAC;AAED;;;;GAIG;AACU,QAAA,SAAS,GAA+B,aAAa,CAAC,GAAG,EAAE,CACtE,OAAO,CAAC,GAAG,CAAC;sDACH,OAAO;sDACP,oCAAoC;sDACpC,qCAAqC;sDACrC,oCAAoC;CAC5C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IACvC,KAAK,EAAE,KAAK;IACZ,UAAU,EAAE,IAAI,CAAC,UAAU;IAC3B,WAAW,EAAE,KAAK,CAAC,WAAW;IAC9B,UAAU,EAAE,IAAI,CAAC,UAAU;CAC5B,CAAC,CAAC,CACJ,CAAA;AAED;;;;;;;;;;GAUG;AACU,QAAA,kBAAkB,GAAyC,aAAa,CAAC,GAAG,EAAE,CACzF,kDAAO,6CAA6C,IAAE,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,CAChG,CAAA;AAED;;;GAGG;AACU,QAAA,QAAQ,GAA8B,aAAa,CAAC,GAAG,EAAE,CACpE,OAAO,CAAC,GAAG,CAAC;sDACH,iBAAiB;sDACjB,qBAAqB;sDACrB,iBAAiB;CACzB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IACxC,aAAa,EAAE,MAAM,CAAC,aAAa;IACnC,QAAQ,EAAE,SAAS,CAAC,QAAQ;IAC5B,SAAS,EAAE,MAAM,CAAC,SAAS;IAC3B,SAAS,EAAE,MAAM,CAAC,SAAS;IAC3B,SAAS,EAAE,MAAM,CAAC,SAAS;CAC5B,CAAC,CAAC,CACJ,CAAA"}
|
|
@@ -22,6 +22,11 @@ export declare class RouteController {
|
|
|
22
22
|
private resolveInstance;
|
|
23
23
|
/**
|
|
24
24
|
* Add MapLibre sources and layers for a single route instance.
|
|
25
|
+
*
|
|
26
|
+
* All three sources set `lineMetrics`: maplibre computes `line-progress` only
|
|
27
|
+
* when a source asks it to, and `preparePaintForLayer` emits a
|
|
28
|
+
* `line-progress` gradient for a GradientStyle. Without it, a consumer
|
|
29
|
+
* setting a gradient route style silently got no gradient at all.
|
|
25
30
|
*/
|
|
26
31
|
private addSourcesAndLayersForRoute;
|
|
27
32
|
/**
|
|
@@ -168,6 +173,15 @@ export declare class RouteController {
|
|
|
168
173
|
centerOnCurrentStep(routeId?: string): void;
|
|
169
174
|
private prepareForNextStep;
|
|
170
175
|
private animateStep;
|
|
176
|
+
/**
|
|
177
|
+
* Pushes the in-progress segment's geometry to its map source.
|
|
178
|
+
*
|
|
179
|
+
* Called once per frame rather than once per vertex crossed: `setData`
|
|
180
|
+
* rebuilds the whole geojson-vt index and reloads every in-view tile, so its
|
|
181
|
+
* cost is a large fixed one per call and is worth paying only once, with the
|
|
182
|
+
* frame's final geometry.
|
|
183
|
+
*/
|
|
184
|
+
private flushCurrentSourceData;
|
|
171
185
|
private setMarkerLngLat;
|
|
172
186
|
private setMarkerRotation;
|
|
173
187
|
setMarkerFloor(floorId?: string, routeId?: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routeController.d.ts","sourceRoot":"","sources":["../../../src/controllers/routeController.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAClD,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,8BAA8B,EACpC,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,wBAAwB,CAAA;AACzE,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,qCAAqC,CAAA;
|
|
1
|
+
{"version":3,"file":"routeController.d.ts","sourceRoot":"","sources":["../../../src/controllers/routeController.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAClD,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,8BAA8B,EACpC,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,wBAAwB,CAAA;AACzE,OAAO,EAAE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