geo-polygonize 0.34.0 → 0.35.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +68 -18
  2. package/dist/geo_polygonize.wasm +0 -0
  3. package/dist/geo_polygonize_simd.wasm +0 -0
  4. package/dist/slim/cjs/index_slim.d.ts +1 -1
  5. package/dist/slim/cjs/index_slim.js +19 -850
  6. package/dist/slim/es/index_slim.d.ts +1 -1
  7. package/dist/slim/es/index_slim.js +11 -842
  8. package/dist/slim/pkg-scalar/geo_polygonize.d.ts +119 -0
  9. package/dist/slim/pkg-scalar/geo_polygonize_bg.wasm.d.ts +37 -0
  10. package/dist/slim/pkg-wrapper/bindings/ContainmentOptions.d.ts +6 -0
  11. package/dist/slim/pkg-wrapper/bindings/DedupPolicy.d.ts +1 -0
  12. package/dist/slim/pkg-wrapper/bindings/DeterminismOptions.d.ts +5 -0
  13. package/dist/slim/pkg-wrapper/bindings/DiagnosticsOptions.d.ts +4 -0
  14. package/dist/slim/pkg-wrapper/bindings/IndexBackend.d.ts +1 -0
  15. package/dist/slim/pkg-wrapper/bindings/NodingBackend.d.ts +1 -0
  16. package/dist/slim/pkg-wrapper/bindings/NodingOptions.d.ts +6 -0
  17. package/dist/slim/pkg-wrapper/bindings/PolygonizerOptions.d.ts +92 -0
  18. package/dist/slim/pkg-wrapper/bindings/ProvenanceOptions.d.ts +4 -0
  19. package/dist/slim/pkg-wrapper/bindings/SnapMode.d.ts +1 -0
  20. package/dist/slim/pkg-wrapper/bindings/SnapStrategy.d.ts +25 -0
  21. package/dist/slim/pkg-wrapper/bindings/TargetProfile.d.ts +1 -0
  22. package/dist/slim/pkg-wrapper/bindings/TileOwnershipPolicy.d.ts +1 -0
  23. package/dist/slim/pkg-wrapper/bindings/TilingOptions.d.ts +6 -0
  24. package/dist/slim/pkg-wrapper/bindings/TouchPolicy.d.ts +1 -0
  25. package/dist/slim/pkg-wrapper/bindings/ZOptions.d.ts +4 -0
  26. package/dist/slim/pkg-wrapper/bindings/ZPolicy.d.ts +5 -0
  27. package/dist/standard/cjs/index.js +3 -3
  28. package/dist/standard/cjs/index_slim.d.ts +1 -1
  29. package/dist/standard/es/index.js +3 -3
  30. package/dist/standard/es/index_slim.d.ts +1 -1
  31. package/dist/standard/pkg-scalar/geo_polygonize.d.ts +119 -0
  32. package/dist/standard/pkg-scalar/geo_polygonize_bg.wasm.d.ts +37 -0
  33. package/dist/standard/pkg-wrapper/bindings/ContainmentOptions.d.ts +6 -0
  34. package/dist/standard/pkg-wrapper/bindings/DedupPolicy.d.ts +1 -0
  35. package/dist/standard/pkg-wrapper/bindings/DeterminismOptions.d.ts +5 -0
  36. package/dist/standard/pkg-wrapper/bindings/DiagnosticsOptions.d.ts +4 -0
  37. package/dist/standard/pkg-wrapper/bindings/IndexBackend.d.ts +1 -0
  38. package/dist/standard/pkg-wrapper/bindings/NodingBackend.d.ts +1 -0
  39. package/dist/standard/pkg-wrapper/bindings/NodingOptions.d.ts +6 -0
  40. package/dist/standard/pkg-wrapper/bindings/PolygonizerOptions.d.ts +92 -0
  41. package/dist/standard/pkg-wrapper/bindings/ProvenanceOptions.d.ts +4 -0
  42. package/dist/standard/pkg-wrapper/bindings/SnapMode.d.ts +1 -0
  43. package/dist/standard/pkg-wrapper/bindings/SnapStrategy.d.ts +25 -0
  44. package/dist/standard/pkg-wrapper/bindings/TargetProfile.d.ts +1 -0
  45. package/dist/standard/pkg-wrapper/bindings/TileOwnershipPolicy.d.ts +1 -0
  46. package/dist/standard/pkg-wrapper/bindings/TilingOptions.d.ts +6 -0
  47. package/dist/standard/pkg-wrapper/bindings/TouchPolicy.d.ts +1 -0
  48. package/dist/standard/pkg-wrapper/bindings/ZOptions.d.ts +4 -0
  49. package/dist/standard/pkg-wrapper/bindings/ZPolicy.d.ts +5 -0
  50. package/dist/threads/es/index.js +1 -1
  51. package/dist/threads/es/index_slim.d.ts +1 -1
  52. package/dist/threads/pkg-threads/geo_polygonize.d.ts +139 -0
  53. package/dist/threads/pkg-threads/geo_polygonize_bg.wasm.d.ts +44 -0
  54. package/dist/threads/pkg-wrapper/bindings/ContainmentOptions.d.ts +6 -0
  55. package/dist/threads/pkg-wrapper/bindings/DedupPolicy.d.ts +1 -0
  56. package/dist/threads/pkg-wrapper/bindings/DeterminismOptions.d.ts +5 -0
  57. package/dist/threads/pkg-wrapper/bindings/DiagnosticsOptions.d.ts +4 -0
  58. package/dist/threads/pkg-wrapper/bindings/IndexBackend.d.ts +1 -0
  59. package/dist/threads/pkg-wrapper/bindings/NodingBackend.d.ts +1 -0
  60. package/dist/threads/pkg-wrapper/bindings/NodingOptions.d.ts +6 -0
  61. package/dist/threads/pkg-wrapper/bindings/PolygonizerOptions.d.ts +92 -0
  62. package/dist/threads/pkg-wrapper/bindings/ProvenanceOptions.d.ts +4 -0
  63. package/dist/threads/pkg-wrapper/bindings/SnapMode.d.ts +1 -0
  64. package/dist/threads/pkg-wrapper/bindings/SnapStrategy.d.ts +25 -0
  65. package/dist/threads/pkg-wrapper/bindings/TargetProfile.d.ts +1 -0
  66. package/dist/threads/pkg-wrapper/bindings/TileOwnershipPolicy.d.ts +1 -0
  67. package/dist/threads/pkg-wrapper/bindings/TilingOptions.d.ts +6 -0
  68. package/dist/threads/pkg-wrapper/bindings/TouchPolicy.d.ts +1 -0
  69. package/dist/threads/pkg-wrapper/bindings/ZOptions.d.ts +4 -0
  70. package/dist/threads/pkg-wrapper/bindings/ZPolicy.d.ts +5 -0
  71. package/package.json +1 -1
@@ -1,836 +1,5 @@
1
1
  /* @ts-self-types="./geo_polygonize.d.ts" */
2
2
 
3
- let PolygonizerWasmError$1 = class PolygonizerWasmError {
4
- static __wrap(ptr) {
5
- ptr = ptr >>> 0;
6
- const obj = Object.create(PolygonizerWasmError.prototype);
7
- obj.__wbg_ptr = ptr;
8
- PolygonizerWasmErrorFinalization$1.register(obj, obj.__wbg_ptr, obj);
9
- return obj;
10
- }
11
- __destroy_into_raw() {
12
- const ptr = this.__wbg_ptr;
13
- this.__wbg_ptr = 0;
14
- PolygonizerWasmErrorFinalization$1.unregister(this);
15
- return ptr;
16
- }
17
- free() {
18
- const ptr = this.__destroy_into_raw();
19
- wasm$1.__wbg_polygonizerwasmerror_free(ptr, 0);
20
- }
21
- /**
22
- * @returns {string}
23
- */
24
- get message() {
25
- let deferred1_0;
26
- let deferred1_1;
27
- try {
28
- const ret = wasm$1.polygonizerwasmerror_message(this.__wbg_ptr);
29
- deferred1_0 = ret[0];
30
- deferred1_1 = ret[1];
31
- return getStringFromWasm0$1(ret[0], ret[1]);
32
- } finally {
33
- wasm$1.__wbindgen_free(deferred1_0, deferred1_1, 1);
34
- }
35
- }
36
- /**
37
- * @returns {string}
38
- */
39
- get name() {
40
- let deferred1_0;
41
- let deferred1_1;
42
- try {
43
- const ret = wasm$1.polygonizerwasmerror_name(this.__wbg_ptr);
44
- deferred1_0 = ret[0];
45
- deferred1_1 = ret[1];
46
- return getStringFromWasm0$1(ret[0], ret[1]);
47
- } finally {
48
- wasm$1.__wbindgen_free(deferred1_0, deferred1_1, 1);
49
- }
50
- }
51
- /**
52
- * @param {string} name
53
- * @param {string} message
54
- */
55
- constructor(name, message) {
56
- const ptr0 = passStringToWasm0$1(name, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
57
- const len0 = WASM_VECTOR_LEN$1;
58
- const ptr1 = passStringToWasm0$1(message, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
59
- const len1 = WASM_VECTOR_LEN$1;
60
- const ret = wasm$1.polygonizerwasmerror_new(ptr0, len0, ptr1, len1);
61
- this.__wbg_ptr = ret >>> 0;
62
- PolygonizerWasmErrorFinalization$1.register(this, this.__wbg_ptr, this);
63
- return this;
64
- }
65
- };
66
- if (Symbol.dispose) PolygonizerWasmError$1.prototype[Symbol.dispose] = PolygonizerWasmError$1.prototype.free;
67
-
68
- let WasmPolygonResult$1 = class WasmPolygonResult {
69
- static __wrap(ptr) {
70
- ptr = ptr >>> 0;
71
- const obj = Object.create(WasmPolygonResult.prototype);
72
- obj.__wbg_ptr = ptr;
73
- WasmPolygonResultFinalization$1.register(obj, obj.__wbg_ptr, obj);
74
- return obj;
75
- }
76
- __destroy_into_raw() {
77
- const ptr = this.__wbg_ptr;
78
- this.__wbg_ptr = 0;
79
- WasmPolygonResultFinalization$1.unregister(this);
80
- return ptr;
81
- }
82
- free() {
83
- const ptr = this.__destroy_into_raw();
84
- wasm$1.__wbg_wasmpolygonresult_free(ptr, 0);
85
- }
86
- /**
87
- * @returns {number}
88
- */
89
- coords_len() {
90
- const ret = wasm$1.wasmpolygonresult_coords_len(this.__wbg_ptr);
91
- return ret >>> 0;
92
- }
93
- /**
94
- * @returns {number}
95
- */
96
- coords_ptr() {
97
- const ret = wasm$1.wasmpolygonresult_coords_ptr(this.__wbg_ptr);
98
- return ret >>> 0;
99
- }
100
- /**
101
- * @returns {any}
102
- */
103
- get cut_edges() {
104
- const ret = wasm$1.wasmpolygonresult_cut_edges(this.__wbg_ptr);
105
- return ret;
106
- }
107
- /**
108
- * @returns {any}
109
- */
110
- get dangles() {
111
- const ret = wasm$1.wasmpolygonresult_dangles(this.__wbg_ptr);
112
- return ret;
113
- }
114
- /**
115
- * @returns {any}
116
- */
117
- get diagnostics() {
118
- const ret = wasm$1.wasmpolygonresult_diagnostics(this.__wbg_ptr);
119
- return ret;
120
- }
121
- /**
122
- * @returns {number}
123
- */
124
- flat_line_ids_len() {
125
- const ret = wasm$1.wasmpolygonresult_flat_line_ids_len(this.__wbg_ptr);
126
- return ret >>> 0;
127
- }
128
- /**
129
- * @returns {number}
130
- */
131
- flat_line_ids_ptr() {
132
- const ret = wasm$1.wasmpolygonresult_flat_line_ids_ptr(this.__wbg_ptr);
133
- return ret >>> 0;
134
- }
135
- /**
136
- * @returns {any}
137
- */
138
- get invalid_rings() {
139
- const ret = wasm$1.wasmpolygonresult_invalid_rings(this.__wbg_ptr);
140
- return ret;
141
- }
142
- /**
143
- * @returns {number}
144
- */
145
- polygon_offsets_len() {
146
- const ret = wasm$1.wasmpolygonresult_polygon_offsets_len(this.__wbg_ptr);
147
- return ret >>> 0;
148
- }
149
- /**
150
- * @returns {number}
151
- */
152
- polygon_offsets_ptr() {
153
- const ret = wasm$1.wasmpolygonresult_polygon_offsets_ptr(this.__wbg_ptr);
154
- return ret >>> 0;
155
- }
156
- /**
157
- * @returns {any}
158
- */
159
- get provenance() {
160
- const ret = wasm$1.wasmpolygonresult_provenance(this.__wbg_ptr);
161
- return ret;
162
- }
163
- /**
164
- * @returns {number}
165
- */
166
- ring_offsets_len() {
167
- const ret = wasm$1.wasmpolygonresult_ring_offsets_len(this.__wbg_ptr);
168
- return ret >>> 0;
169
- }
170
- /**
171
- * @returns {number}
172
- */
173
- ring_offsets_ptr() {
174
- const ret = wasm$1.wasmpolygonresult_ring_offsets_ptr(this.__wbg_ptr);
175
- return ret >>> 0;
176
- }
177
- /**
178
- * @returns {number}
179
- */
180
- stride() {
181
- const ret = wasm$1.wasmpolygonresult_stride(this.__wbg_ptr);
182
- return ret;
183
- }
184
- };
185
- if (Symbol.dispose) WasmPolygonResult$1.prototype[Symbol.dispose] = WasmPolygonResult$1.prototype.free;
186
-
187
- /**
188
- * @param {string} geojson_str
189
- * @param {boolean | null} [node_input]
190
- * @param {number | null} [snap_grid_size]
191
- * @param {boolean | null} [extract_only_polygonal]
192
- * @param {boolean | null} [report_mode]
193
- * @returns {string}
194
- */
195
- function polygonize$1(geojson_str, node_input, snap_grid_size, extract_only_polygonal, report_mode) {
196
- let deferred3_0;
197
- let deferred3_1;
198
- try {
199
- const ptr0 = passStringToWasm0$1(geojson_str, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
200
- const len0 = WASM_VECTOR_LEN$1;
201
- const ret = wasm$1.polygonize(ptr0, len0, isLikeNone$1(node_input) ? 0xFFFFFF : node_input ? 1 : 0, !isLikeNone$1(snap_grid_size), isLikeNone$1(snap_grid_size) ? 0 : snap_grid_size, isLikeNone$1(extract_only_polygonal) ? 0xFFFFFF : extract_only_polygonal ? 1 : 0, isLikeNone$1(report_mode) ? 0xFFFFFF : report_mode ? 1 : 0);
202
- var ptr2 = ret[0];
203
- var len2 = ret[1];
204
- if (ret[3]) {
205
- ptr2 = 0; len2 = 0;
206
- throw takeFromExternrefTable0$1(ret[2]);
207
- }
208
- deferred3_0 = ptr2;
209
- deferred3_1 = len2;
210
- return getStringFromWasm0$1(ptr2, len2);
211
- } finally {
212
- wasm$1.__wbindgen_free(deferred3_0, deferred3_1, 1);
213
- }
214
- }
215
-
216
- /**
217
- * Polygonizes an Arrow IPC stream containing a GeoArrow LineString array.
218
- *
219
- * This zero-copy path avoids JSON serialization overhead and returns a binary
220
- * Arrow IPC stream containing a GeoArrow Polygon array. Requires the options
221
- * to be passed as a parsed JS object.
222
- * @param {Uint8Array} ipc_bytes
223
- * @param {any} options_val
224
- * @returns {Uint8Array}
225
- */
226
- function polygonizeGeoArrowWithOptions$1(ipc_bytes, options_val) {
227
- const ptr0 = passArray8ToWasm0$1(ipc_bytes, wasm$1.__wbindgen_malloc);
228
- const len0 = WASM_VECTOR_LEN$1;
229
- const ret = wasm$1.polygonizeGeoArrowWithOptions(ptr0, len0, options_val);
230
- if (ret[3]) {
231
- throw takeFromExternrefTable0$1(ret[2]);
232
- }
233
- var v2 = getArrayU8FromWasm0$1(ret[0], ret[1]).slice();
234
- wasm$1.__wbindgen_free(ret[0], ret[1] * 1, 1);
235
- return v2;
236
- }
237
-
238
- /**
239
- * Polygonizes a GeoJSON FeatureCollection using the canonical `PolygonizerOptions`.
240
- *
241
- * This is the primary entry point for JavaScript users. It accepts a JSON string
242
- * of options and returns a JSON string representing the result, including faces,
243
- * dangles, cut-lines, and (optionally) provenance/diagnostics.
244
- * @param {string} geojson_str
245
- * @param {any} options_val
246
- * @returns {string}
247
- */
248
- function polygonizeWithOptions$1(geojson_str, options_val) {
249
- let deferred3_0;
250
- let deferred3_1;
251
- try {
252
- const ptr0 = passStringToWasm0$1(geojson_str, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
253
- const len0 = WASM_VECTOR_LEN$1;
254
- const ret = wasm$1.polygonizeWithOptions(ptr0, len0, options_val);
255
- var ptr2 = ret[0];
256
- var len2 = ret[1];
257
- if (ret[3]) {
258
- ptr2 = 0; len2 = 0;
259
- throw takeFromExternrefTable0$1(ret[2]);
260
- }
261
- deferred3_0 = ptr2;
262
- deferred3_1 = len2;
263
- return getStringFromWasm0$1(ptr2, len2);
264
- } finally {
265
- wasm$1.__wbindgen_free(deferred3_0, deferred3_1, 1);
266
- }
267
- }
268
-
269
- /**
270
- * @param {Float64Array} coords
271
- * @param {Uint32Array} offsets
272
- * @param {number} stride
273
- * @param {any} options_val
274
- * @param {Uint32Array | null} [line_ids]
275
- * @returns {WasmPolygonResult}
276
- */
277
- function polygonizeWithOptionsBuffer$1(coords, offsets, stride, options_val, line_ids) {
278
- const ptr0 = passArrayF64ToWasm0$1(coords, wasm$1.__wbindgen_malloc);
279
- const len0 = WASM_VECTOR_LEN$1;
280
- const ptr1 = passArray32ToWasm0$1(offsets, wasm$1.__wbindgen_malloc);
281
- const len1 = WASM_VECTOR_LEN$1;
282
- var ptr2 = isLikeNone$1(line_ids) ? 0 : passArray32ToWasm0$1(line_ids, wasm$1.__wbindgen_malloc);
283
- var len2 = WASM_VECTOR_LEN$1;
284
- const ret = wasm$1.polygonizeWithOptionsBuffer(ptr0, len0, ptr1, len1, stride, options_val, ptr2, len2);
285
- if (ret[2]) {
286
- throw takeFromExternrefTable0$1(ret[1]);
287
- }
288
- return WasmPolygonResult$1.__wrap(ret[0]);
289
- }
290
-
291
- /**
292
- * @param {Float64Array} coords
293
- * @param {Uint32Array} offsets
294
- * @param {number} stride
295
- * @param {boolean} node_input
296
- * @param {number} snap_grid_size
297
- * @param {Uint32Array | null} [line_ids]
298
- * @returns {WasmPolygonResult}
299
- */
300
- function polygonize_buffers$1(coords, offsets, stride, node_input, snap_grid_size, line_ids) {
301
- const ptr0 = passArrayF64ToWasm0$1(coords, wasm$1.__wbindgen_malloc);
302
- const len0 = WASM_VECTOR_LEN$1;
303
- const ptr1 = passArray32ToWasm0$1(offsets, wasm$1.__wbindgen_malloc);
304
- const len1 = WASM_VECTOR_LEN$1;
305
- var ptr2 = isLikeNone$1(line_ids) ? 0 : passArray32ToWasm0$1(line_ids, wasm$1.__wbindgen_malloc);
306
- var len2 = WASM_VECTOR_LEN$1;
307
- const ret = wasm$1.polygonize_buffers(ptr0, len0, ptr1, len1, stride, node_input, snap_grid_size, ptr2, len2);
308
- if (ret[2]) {
309
- throw takeFromExternrefTable0$1(ret[1]);
310
- }
311
- return WasmPolygonResult$1.__wrap(ret[0]);
312
- }
313
-
314
- /**
315
- * @param {Uint8Array} ipc_bytes
316
- * @param {boolean} node_input
317
- * @param {number} snap_grid_size
318
- * @param {boolean} extract_only_polygonal
319
- * @returns {Uint8Array}
320
- */
321
- function polygonize_geoarrow$1(ipc_bytes, node_input, snap_grid_size, extract_only_polygonal) {
322
- const ptr0 = passArray8ToWasm0$1(ipc_bytes, wasm$1.__wbindgen_malloc);
323
- const len0 = WASM_VECTOR_LEN$1;
324
- const ret = wasm$1.polygonize_geoarrow(ptr0, len0, node_input, snap_grid_size, extract_only_polygonal);
325
- if (ret[3]) {
326
- throw takeFromExternrefTable0$1(ret[2]);
327
- }
328
- var v2 = getArrayU8FromWasm0$1(ret[0], ret[1]).slice();
329
- wasm$1.__wbindgen_free(ret[0], ret[1] * 1, 1);
330
- return v2;
331
- }
332
-
333
- function __wbg_get_imports$1() {
334
- const import0 = {
335
- __proto__: null,
336
- __wbg_Error_83742b46f01ce22d: function(arg0, arg1) {
337
- const ret = Error(getStringFromWasm0$1(arg0, arg1));
338
- return ret;
339
- },
340
- __wbg_String_8564e559799eccda: function(arg0, arg1) {
341
- const ret = String(arg1);
342
- const ptr1 = passStringToWasm0$1(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
343
- const len1 = WASM_VECTOR_LEN$1;
344
- getDataViewMemory0$1().setInt32(arg0 + 4 * 1, len1, true);
345
- getDataViewMemory0$1().setInt32(arg0 + 4 * 0, ptr1, true);
346
- },
347
- __wbg___wbindgen_boolean_get_c0f3f60bac5a78d1: function(arg0) {
348
- const v = arg0;
349
- const ret = typeof(v) === 'boolean' ? v : undefined;
350
- return isLikeNone$1(ret) ? 0xFFFFFF : ret ? 1 : 0;
351
- },
352
- __wbg___wbindgen_debug_string_5398f5bb970e0daa: function(arg0, arg1) {
353
- const ret = debugString$1(arg1);
354
- const ptr1 = passStringToWasm0$1(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
355
- const len1 = WASM_VECTOR_LEN$1;
356
- getDataViewMemory0$1().setInt32(arg0 + 4 * 1, len1, true);
357
- getDataViewMemory0$1().setInt32(arg0 + 4 * 0, ptr1, true);
358
- },
359
- __wbg___wbindgen_in_41dbb8413020e076: function(arg0, arg1) {
360
- const ret = arg0 in arg1;
361
- return ret;
362
- },
363
- __wbg___wbindgen_is_object_781bc9f159099513: function(arg0) {
364
- const val = arg0;
365
- const ret = typeof(val) === 'object' && val !== null;
366
- return ret;
367
- },
368
- __wbg___wbindgen_is_string_7ef6b97b02428fae: function(arg0) {
369
- const ret = typeof(arg0) === 'string';
370
- return ret;
371
- },
372
- __wbg___wbindgen_is_undefined_52709e72fb9f179c: function(arg0) {
373
- const ret = arg0 === undefined;
374
- return ret;
375
- },
376
- __wbg___wbindgen_jsval_loose_eq_5bcc3bed3c69e72b: function(arg0, arg1) {
377
- const ret = arg0 == arg1;
378
- return ret;
379
- },
380
- __wbg___wbindgen_number_get_34bb9d9dcfa21373: function(arg0, arg1) {
381
- const obj = arg1;
382
- const ret = typeof(obj) === 'number' ? obj : undefined;
383
- getDataViewMemory0$1().setFloat64(arg0 + 8 * 1, isLikeNone$1(ret) ? 0 : ret, true);
384
- getDataViewMemory0$1().setInt32(arg0 + 4 * 0, !isLikeNone$1(ret), true);
385
- },
386
- __wbg___wbindgen_string_get_395e606bd0ee4427: function(arg0, arg1) {
387
- const obj = arg1;
388
- const ret = typeof(obj) === 'string' ? obj : undefined;
389
- var ptr1 = isLikeNone$1(ret) ? 0 : passStringToWasm0$1(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
390
- var len1 = WASM_VECTOR_LEN$1;
391
- getDataViewMemory0$1().setInt32(arg0 + 4 * 1, len1, true);
392
- getDataViewMemory0$1().setInt32(arg0 + 4 * 0, ptr1, true);
393
- },
394
- __wbg___wbindgen_throw_6ddd609b62940d55: function(arg0, arg1) {
395
- throw new Error(getStringFromWasm0$1(arg0, arg1));
396
- },
397
- __wbg_entries_e8a20ff8c9757101: function(arg0) {
398
- const ret = Object.entries(arg0);
399
- return ret;
400
- },
401
- __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
402
- let deferred0_0;
403
- let deferred0_1;
404
- try {
405
- deferred0_0 = arg0;
406
- deferred0_1 = arg1;
407
- console.error(getStringFromWasm0$1(arg0, arg1));
408
- } finally {
409
- wasm$1.__wbindgen_free(deferred0_0, deferred0_1, 1);
410
- }
411
- },
412
- __wbg_get_a8ee5c45dabc1b3b: function(arg0, arg1) {
413
- const ret = arg0[arg1 >>> 0];
414
- return ret;
415
- },
416
- __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
417
- const ret = arg0[arg1];
418
- return ret;
419
- },
420
- __wbg_instanceof_ArrayBuffer_101e2bf31071a9f6: function(arg0) {
421
- let result;
422
- try {
423
- result = arg0 instanceof ArrayBuffer;
424
- } catch (_) {
425
- result = false;
426
- }
427
- const ret = result;
428
- return ret;
429
- },
430
- __wbg_instanceof_Uint8Array_740438561a5b956d: function(arg0) {
431
- let result;
432
- try {
433
- result = arg0 instanceof Uint8Array;
434
- } catch (_) {
435
- result = false;
436
- }
437
- const ret = result;
438
- return ret;
439
- },
440
- __wbg_length_b3416cf66a5452c8: function(arg0) {
441
- const ret = arg0.length;
442
- return ret;
443
- },
444
- __wbg_length_ea16607d7b61445b: function(arg0) {
445
- const ret = arg0.length;
446
- return ret;
447
- },
448
- __wbg_new_227d7c05414eb861: function() {
449
- const ret = new Error();
450
- return ret;
451
- },
452
- __wbg_new_5f486cdf45a04d78: function(arg0) {
453
- const ret = new Uint8Array(arg0);
454
- return ret;
455
- },
456
- __wbg_new_a70fbab9066b301f: function() {
457
- const ret = new Array();
458
- return ret;
459
- },
460
- __wbg_new_ab79df5bd7c26067: function() {
461
- const ret = new Object();
462
- return ret;
463
- },
464
- __wbg_polygonizerwasmerror_new: function(arg0) {
465
- const ret = PolygonizerWasmError$1.__wrap(arg0);
466
- return ret;
467
- },
468
- __wbg_prototypesetcall_d62e5099504357e6: function(arg0, arg1, arg2) {
469
- Uint8Array.prototype.set.call(getArrayU8FromWasm0$1(arg0, arg1), arg2);
470
- },
471
- __wbg_set_282384002438957f: function(arg0, arg1, arg2) {
472
- arg0[arg1 >>> 0] = arg2;
473
- },
474
- __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
475
- arg0[arg1] = arg2;
476
- },
477
- __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
478
- const ret = arg1.stack;
479
- const ptr1 = passStringToWasm0$1(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
480
- const len1 = WASM_VECTOR_LEN$1;
481
- getDataViewMemory0$1().setInt32(arg0 + 4 * 1, len1, true);
482
- getDataViewMemory0$1().setInt32(arg0 + 4 * 0, ptr1, true);
483
- },
484
- __wbindgen_cast_0000000000000001: function(arg0) {
485
- // Cast intrinsic for `F64 -> Externref`.
486
- const ret = arg0;
487
- return ret;
488
- },
489
- __wbindgen_cast_0000000000000002: function(arg0, arg1) {
490
- // Cast intrinsic for `Ref(String) -> Externref`.
491
- const ret = getStringFromWasm0$1(arg0, arg1);
492
- return ret;
493
- },
494
- __wbindgen_cast_0000000000000003: function(arg0) {
495
- // Cast intrinsic for `U64 -> Externref`.
496
- const ret = BigInt.asUintN(64, arg0);
497
- return ret;
498
- },
499
- __wbindgen_init_externref_table: function() {
500
- const table = wasm$1.__wbindgen_externrefs;
501
- const offset = table.grow(4);
502
- table.set(0, undefined);
503
- table.set(offset + 0, undefined);
504
- table.set(offset + 1, null);
505
- table.set(offset + 2, true);
506
- table.set(offset + 3, false);
507
- },
508
- };
509
- return {
510
- __proto__: null,
511
- "./geo_polygonize_bg.js": import0,
512
- };
513
- }
514
-
515
- const PolygonizerWasmErrorFinalization$1 = (typeof FinalizationRegistry === 'undefined')
516
- ? { register: () => {}, unregister: () => {} }
517
- : new FinalizationRegistry(ptr => wasm$1.__wbg_polygonizerwasmerror_free(ptr >>> 0, 1));
518
- const WasmPolygonResultFinalization$1 = (typeof FinalizationRegistry === 'undefined')
519
- ? { register: () => {}, unregister: () => {} }
520
- : new FinalizationRegistry(ptr => wasm$1.__wbg_wasmpolygonresult_free(ptr >>> 0, 1));
521
-
522
- function debugString$1(val) {
523
- // primitive types
524
- const type = typeof val;
525
- if (type == 'number' || type == 'boolean' || val == null) {
526
- return `${val}`;
527
- }
528
- if (type == 'string') {
529
- return `"${val}"`;
530
- }
531
- if (type == 'symbol') {
532
- const description = val.description;
533
- if (description == null) {
534
- return 'Symbol';
535
- } else {
536
- return `Symbol(${description})`;
537
- }
538
- }
539
- if (type == 'function') {
540
- const name = val.name;
541
- if (typeof name == 'string' && name.length > 0) {
542
- return `Function(${name})`;
543
- } else {
544
- return 'Function';
545
- }
546
- }
547
- // objects
548
- if (Array.isArray(val)) {
549
- const length = val.length;
550
- let debug = '[';
551
- if (length > 0) {
552
- debug += debugString$1(val[0]);
553
- }
554
- for(let i = 1; i < length; i++) {
555
- debug += ', ' + debugString$1(val[i]);
556
- }
557
- debug += ']';
558
- return debug;
559
- }
560
- // Test for built-in
561
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
562
- let className;
563
- if (builtInMatches && builtInMatches.length > 1) {
564
- className = builtInMatches[1];
565
- } else {
566
- // Failed to match the standard '[object ClassName]'
567
- return toString.call(val);
568
- }
569
- if (className == 'Object') {
570
- // we're a user defined class or Object
571
- // JSON.stringify avoids problems with cycles, and is generally much
572
- // easier than looping through ownProperties of `val`.
573
- try {
574
- return 'Object(' + JSON.stringify(val) + ')';
575
- } catch (_) {
576
- return 'Object';
577
- }
578
- }
579
- // errors
580
- if (val instanceof Error) {
581
- return `${val.name}: ${val.message}\n${val.stack}`;
582
- }
583
- // TODO we could test for more things here, like `Set`s and `Map`s.
584
- return className;
585
- }
586
-
587
- function getArrayU8FromWasm0$1(ptr, len) {
588
- ptr = ptr >>> 0;
589
- return getUint8ArrayMemory0$1().subarray(ptr / 1, ptr / 1 + len);
590
- }
591
-
592
- let cachedDataViewMemory0$1 = null;
593
- function getDataViewMemory0$1() {
594
- if (cachedDataViewMemory0$1 === null || cachedDataViewMemory0$1.buffer.detached === true || (cachedDataViewMemory0$1.buffer.detached === undefined && cachedDataViewMemory0$1.buffer !== wasm$1.memory.buffer)) {
595
- cachedDataViewMemory0$1 = new DataView(wasm$1.memory.buffer);
596
- }
597
- return cachedDataViewMemory0$1;
598
- }
599
-
600
- let cachedFloat64ArrayMemory0$1 = null;
601
- function getFloat64ArrayMemory0$1() {
602
- if (cachedFloat64ArrayMemory0$1 === null || cachedFloat64ArrayMemory0$1.byteLength === 0) {
603
- cachedFloat64ArrayMemory0$1 = new Float64Array(wasm$1.memory.buffer);
604
- }
605
- return cachedFloat64ArrayMemory0$1;
606
- }
607
-
608
- function getStringFromWasm0$1(ptr, len) {
609
- ptr = ptr >>> 0;
610
- return decodeText$1(ptr, len);
611
- }
612
-
613
- let cachedUint32ArrayMemory0$1 = null;
614
- function getUint32ArrayMemory0$1() {
615
- if (cachedUint32ArrayMemory0$1 === null || cachedUint32ArrayMemory0$1.byteLength === 0) {
616
- cachedUint32ArrayMemory0$1 = new Uint32Array(wasm$1.memory.buffer);
617
- }
618
- return cachedUint32ArrayMemory0$1;
619
- }
620
-
621
- let cachedUint8ArrayMemory0$1 = null;
622
- function getUint8ArrayMemory0$1() {
623
- if (cachedUint8ArrayMemory0$1 === null || cachedUint8ArrayMemory0$1.byteLength === 0) {
624
- cachedUint8ArrayMemory0$1 = new Uint8Array(wasm$1.memory.buffer);
625
- }
626
- return cachedUint8ArrayMemory0$1;
627
- }
628
-
629
- function isLikeNone$1(x) {
630
- return x === undefined || x === null;
631
- }
632
-
633
- function passArray32ToWasm0$1(arg, malloc) {
634
- const ptr = malloc(arg.length * 4, 4) >>> 0;
635
- getUint32ArrayMemory0$1().set(arg, ptr / 4);
636
- WASM_VECTOR_LEN$1 = arg.length;
637
- return ptr;
638
- }
639
-
640
- function passArray8ToWasm0$1(arg, malloc) {
641
- const ptr = malloc(arg.length * 1, 1) >>> 0;
642
- getUint8ArrayMemory0$1().set(arg, ptr / 1);
643
- WASM_VECTOR_LEN$1 = arg.length;
644
- return ptr;
645
- }
646
-
647
- function passArrayF64ToWasm0$1(arg, malloc) {
648
- const ptr = malloc(arg.length * 8, 8) >>> 0;
649
- getFloat64ArrayMemory0$1().set(arg, ptr / 8);
650
- WASM_VECTOR_LEN$1 = arg.length;
651
- return ptr;
652
- }
653
-
654
- function passStringToWasm0$1(arg, malloc, realloc) {
655
- if (realloc === undefined) {
656
- const buf = cachedTextEncoder$1.encode(arg);
657
- const ptr = malloc(buf.length, 1) >>> 0;
658
- getUint8ArrayMemory0$1().subarray(ptr, ptr + buf.length).set(buf);
659
- WASM_VECTOR_LEN$1 = buf.length;
660
- return ptr;
661
- }
662
-
663
- let len = arg.length;
664
- let ptr = malloc(len, 1) >>> 0;
665
-
666
- const mem = getUint8ArrayMemory0$1();
667
-
668
- let offset = 0;
669
-
670
- for (; offset < len; offset++) {
671
- const code = arg.charCodeAt(offset);
672
- if (code > 0x7F) break;
673
- mem[ptr + offset] = code;
674
- }
675
- if (offset !== len) {
676
- if (offset !== 0) {
677
- arg = arg.slice(offset);
678
- }
679
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
680
- const view = getUint8ArrayMemory0$1().subarray(ptr + offset, ptr + len);
681
- const ret = cachedTextEncoder$1.encodeInto(arg, view);
682
-
683
- offset += ret.written;
684
- ptr = realloc(ptr, len, offset, 1) >>> 0;
685
- }
686
-
687
- WASM_VECTOR_LEN$1 = offset;
688
- return ptr;
689
- }
690
-
691
- function takeFromExternrefTable0$1(idx) {
692
- const value = wasm$1.__wbindgen_externrefs.get(idx);
693
- wasm$1.__externref_table_dealloc(idx);
694
- return value;
695
- }
696
-
697
- let cachedTextDecoder$1 = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
698
- cachedTextDecoder$1.decode();
699
- const MAX_SAFARI_DECODE_BYTES$1 = 2146435072;
700
- let numBytesDecoded$1 = 0;
701
- function decodeText$1(ptr, len) {
702
- numBytesDecoded$1 += len;
703
- if (numBytesDecoded$1 >= MAX_SAFARI_DECODE_BYTES$1) {
704
- cachedTextDecoder$1 = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
705
- cachedTextDecoder$1.decode();
706
- numBytesDecoded$1 = len;
707
- }
708
- return cachedTextDecoder$1.decode(getUint8ArrayMemory0$1().subarray(ptr, ptr + len));
709
- }
710
-
711
- const cachedTextEncoder$1 = new TextEncoder();
712
-
713
- if (!('encodeInto' in cachedTextEncoder$1)) {
714
- cachedTextEncoder$1.encodeInto = function (arg, view) {
715
- const buf = cachedTextEncoder$1.encode(arg);
716
- view.set(buf);
717
- return {
718
- read: arg.length,
719
- written: buf.length
720
- };
721
- };
722
- }
723
-
724
- let WASM_VECTOR_LEN$1 = 0;
725
-
726
- let wasm$1;
727
- function __wbg_finalize_init$1(instance, module) {
728
- wasm$1 = instance.exports;
729
- cachedDataViewMemory0$1 = null;
730
- cachedFloat64ArrayMemory0$1 = null;
731
- cachedUint32ArrayMemory0$1 = null;
732
- cachedUint8ArrayMemory0$1 = null;
733
- wasm$1.__wbindgen_start();
734
- return wasm$1;
735
- }
736
-
737
- async function __wbg_load$1(module, imports) {
738
- if (typeof Response === 'function' && module instanceof Response) {
739
- if (typeof WebAssembly.instantiateStreaming === 'function') {
740
- try {
741
- return await WebAssembly.instantiateStreaming(module, imports);
742
- } catch (e) {
743
- const validResponse = module.ok && expectedResponseType(module.type);
744
-
745
- if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
746
- console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
747
-
748
- } else { throw e; }
749
- }
750
- }
751
-
752
- const bytes = await module.arrayBuffer();
753
- return await WebAssembly.instantiate(bytes, imports);
754
- } else {
755
- const instance = await WebAssembly.instantiate(module, imports);
756
-
757
- if (instance instanceof WebAssembly.Instance) {
758
- return { instance, module };
759
- } else {
760
- return instance;
761
- }
762
- }
763
-
764
- function expectedResponseType(type) {
765
- switch (type) {
766
- case 'basic': case 'cors': case 'default': return true;
767
- }
768
- return false;
769
- }
770
- }
771
-
772
- function initSync$1(module) {
773
- if (wasm$1 !== undefined) return wasm$1;
774
-
775
-
776
- if (module !== undefined) {
777
- if (Object.getPrototypeOf(module) === Object.prototype) {
778
- ({module} = module);
779
- } else {
780
- console.warn('using deprecated parameters for `initSync()`; pass a single object instead');
781
- }
782
- }
783
-
784
- const imports = __wbg_get_imports$1();
785
- if (!(module instanceof WebAssembly.Module)) {
786
- module = new WebAssembly.Module(module);
787
- }
788
- const instance = new WebAssembly.Instance(module, imports);
789
- return __wbg_finalize_init$1(instance);
790
- }
791
-
792
- async function __wbg_init$1(module_or_path) {
793
- if (wasm$1 !== undefined) return wasm$1;
794
-
795
-
796
- if (module_or_path !== undefined) {
797
- if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
798
- ({module_or_path} = module_or_path);
799
- } else {
800
- console.warn('using deprecated parameters for the initialization function; pass a single object instead');
801
- }
802
- }
803
-
804
- if (module_or_path === undefined) {
805
- module_or_path = new URL('geo_polygonize_bg.wasm', import.meta.url);
806
- }
807
- const imports = __wbg_get_imports$1();
808
-
809
- if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
810
- module_or_path = fetch(module_or_path);
811
- }
812
-
813
- const { instance, module } = await __wbg_load$1(await module_or_path, imports);
814
-
815
- return __wbg_finalize_init$1(instance);
816
- }
817
-
818
- var scalarExports = /*#__PURE__*/Object.freeze({
819
- __proto__: null,
820
- PolygonizerWasmError: PolygonizerWasmError$1,
821
- WasmPolygonResult: WasmPolygonResult$1,
822
- default: __wbg_init$1,
823
- initSync: initSync$1,
824
- polygonize: polygonize$1,
825
- polygonizeGeoArrowWithOptions: polygonizeGeoArrowWithOptions$1,
826
- polygonizeWithOptions: polygonizeWithOptions$1,
827
- polygonizeWithOptionsBuffer: polygonizeWithOptionsBuffer$1,
828
- polygonize_buffers: polygonize_buffers$1,
829
- polygonize_geoarrow: polygonize_geoarrow$1
830
- });
831
-
832
- /* @ts-self-types="./geo_polygonize.d.ts" */
833
-
834
3
  class PolygonizerWasmError {
835
4
  static __wrap(ptr) {
836
5
  ptr = ptr >>> 0;
@@ -1633,7 +802,7 @@ async function __wbg_init(module_or_path) {
1633
802
  }
1634
803
 
1635
804
  if (module_or_path === undefined) {
1636
- module_or_path = new URL('geo_polygonize_bg.wasm', import.meta.url);
805
+ module_or_path = new URL(/* @vite-ignore */ 'geo_polygonize_bg.wasm', import.meta.url);
1637
806
  }
1638
807
  const imports = __wbg_get_imports();
1639
808
 
@@ -1646,7 +815,7 @@ async function __wbg_init(module_or_path) {
1646
815
  return __wbg_finalize_init(instance);
1647
816
  }
1648
817
 
1649
- var simdExports = /*#__PURE__*/Object.freeze({
818
+ var scalarExports = /*#__PURE__*/Object.freeze({
1650
819
  __proto__: null,
1651
820
  PolygonizerWasmError: PolygonizerWasmError,
1652
821
  WasmPolygonResult: WasmPolygonResult,
@@ -1696,6 +865,12 @@ const cfbRobustOptions = {
1696
865
  // We provide a helper to choose based on feature detection if the user wants to use it
1697
866
  let isSimdSupported;
1698
867
  const SIMD_TEST_BYTES = new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 10, 1, 8, 0, 65, 0, 253, 15, 253, 98, 11]);
868
+ function normalizeInitInput(input) {
869
+ if (input && typeof input === "object" && "module" in input && !("module_or_path" in input)) {
870
+ return { ...input, module_or_path: input.module };
871
+ }
872
+ return input;
873
+ }
1699
874
  async function initBest(scalarModule, simdModule) {
1700
875
  if (isSimdSupported === undefined) {
1701
876
  try {
@@ -1705,14 +880,8 @@ async function initBest(scalarModule, simdModule) {
1705
880
  isSimdSupported = false;
1706
881
  }
1707
882
  }
1708
- if (isSimdSupported && simdModule) {
1709
- await __wbg_init(simdModule);
1710
- return simdExports;
1711
- }
1712
- else {
1713
- await __wbg_init$1(scalarModule);
1714
- return scalarExports;
1715
- }
883
+ await __wbg_init(normalizeInitInput(isSimdSupported && simdModule ? simdModule : scalarModule));
884
+ return scalarExports;
1716
885
  }
1717
886
 
1718
- export { PolygonizerWasmError$1 as PolygonizerWasmError, WasmPolygonResult$1 as WasmPolygonResult, cfbRobustOptions, initBest, initSync$1 as initSync, polygonize$1 as polygonize, polygonizeGeoArrowWithOptions$1 as polygonizeGeoArrowWithOptions, polygonizeWithOptions$1 as polygonizeWithOptions, polygonizeWithOptionsBuffer$1 as polygonizeWithOptionsBuffer, polygonize_buffers$1 as polygonize_buffers, polygonize_geoarrow$1 as polygonize_geoarrow };
887
+ export { PolygonizerWasmError, WasmPolygonResult, cfbRobustOptions, initBest, initSync, polygonize, polygonizeGeoArrowWithOptions, polygonizeWithOptions, polygonizeWithOptionsBuffer, polygonize_buffers, polygonize_geoarrow };