@kent-tokyo/chematic 1.2.1 → 1.2.2

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/chematic_wasm.js CHANGED
@@ -183,9 +183,10 @@ export class DepictOptions {
183
183
  * @param {string} color
184
184
  */
185
185
  set_atom_color(idx, color) {
186
+ const val2 = +idx;
186
187
  const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
187
188
  const len0 = WASM_VECTOR_LEN;
188
- wasm.depictoptions_set_atom_color(this.__wbg_ptr, idx, ptr0, len0);
189
+ wasm.depictoptions_set_atom_color(this.__wbg_ptr, val2, ptr0, len0);
189
190
  }
190
191
  /**
191
192
  * @param {boolean} v
@@ -214,7 +215,7 @@ export class DepictOptions {
214
215
  wasm.depictoptions_set_height(this.__wbg_ptr, h);
215
216
  }
216
217
  /**
217
- * @param {Uint32Array} atoms
218
+ * @param {Uint32Array | number[]} atoms
218
219
  */
219
220
  set_highlight_atoms(atoms) {
220
221
  const ptr0 = passArray32ToWasm0(atoms, wasm.__wbindgen_malloc);
@@ -222,7 +223,7 @@ export class DepictOptions {
222
223
  wasm.depictoptions_set_highlight_atoms(this.__wbg_ptr, ptr0, len0);
223
224
  }
224
225
  /**
225
- * @param {Uint32Array} bonds
226
+ * @param {Uint32Array | number[]} bonds
226
227
  */
227
228
  set_highlight_bonds(bonds) {
228
229
  const ptr0 = passArray32ToWasm0(bonds, wasm.__wbindgen_malloc);
@@ -327,23 +328,24 @@ export class MhfpLshHandle {
327
328
  * @returns {string}
328
329
  */
329
330
  query_json(query_smiles, threshold) {
330
- let deferred3_0;
331
- let deferred3_1;
331
+ let deferred4_0;
332
+ let deferred4_1;
332
333
  try {
334
+ const val2 = +threshold;
333
335
  const ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
334
336
  const len0 = WASM_VECTOR_LEN;
335
- const ret = wasm.mhfplshhandle_query_json(this.__wbg_ptr, ptr0, len0, threshold);
336
- var ptr2 = ret[0];
337
- var len2 = ret[1];
337
+ const ret = wasm.mhfplshhandle_query_json(this.__wbg_ptr, ptr0, len0, val2);
338
+ var ptr3 = ret[0];
339
+ var len3 = ret[1];
338
340
  if (ret[3]) {
339
- ptr2 = 0; len2 = 0;
341
+ ptr3 = 0; len3 = 0;
340
342
  throw takeFromExternrefTable0(ret[2]);
341
343
  }
342
- deferred3_0 = ptr2;
343
- deferred3_1 = len2;
344
- return getStringFromWasm0(ptr2, len2);
344
+ deferred4_0 = ptr3;
345
+ deferred4_1 = len3;
346
+ return getStringFromWasm0(ptr3, len3);
345
347
  } finally {
346
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
348
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
347
349
  }
348
350
  }
349
351
  }
@@ -694,6 +696,23 @@ export class MolHandle {
694
696
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
695
697
  }
696
698
  }
699
+ /**
700
+ * Total formula with explicit isotope labels, hydrogens and net charge.
701
+ * D/T use [2H]/[3H]; maps/stereo and isotope locations are not encoded.
702
+ * @returns {string}
703
+ */
704
+ formula_with_isotopes() {
705
+ let deferred1_0;
706
+ let deferred1_1;
707
+ try {
708
+ const ret = wasm.molhandle_formula_with_isotopes(this.__wbg_ptr);
709
+ deferred1_0 = ret[0];
710
+ deferred1_1 = ret[1];
711
+ return getStringFromWasm0(ret[0], ret[1]);
712
+ } finally {
713
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
714
+ }
715
+ }
697
716
  /**
698
717
  * Fraction of sp3 carbons (Fsp3).
699
718
  * @returns {number}
@@ -1067,29 +1086,40 @@ export class MolHandle {
1067
1086
  * @returns {string}
1068
1087
  */
1069
1088
  rdkit_align_json(probe_coords_json, reference_coords_json, atom_map_json, weights_json, reflect, max_iterations) {
1070
- let deferred6_0;
1071
- let deferred6_1;
1089
+ let deferred8_0;
1090
+ let deferred8_1;
1072
1091
  try {
1073
- const ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1074
- const len0 = WASM_VECTOR_LEN;
1075
- const ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1076
- const len1 = WASM_VECTOR_LEN;
1077
- var ptr2 = isLikeNone(atom_map_json) ? 0 : passStringToWasm0(atom_map_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1078
- var len2 = WASM_VECTOR_LEN;
1079
- var ptr3 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1080
- var len3 = WASM_VECTOR_LEN;
1081
- const ret = wasm.molhandle_rdkit_align_json(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, reflect, max_iterations);
1082
- var ptr5 = ret[0];
1083
- var len5 = ret[1];
1092
+ const val5 = +reflect;
1093
+ const val6 = +max_iterations;
1094
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
1095
+ try {
1096
+ ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1097
+ len0 = WASM_VECTOR_LEN;
1098
+ ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1099
+ len1 = WASM_VECTOR_LEN;
1100
+ ptr2 = isLikeNone(atom_map_json) ? 0 : passStringToWasm0(atom_map_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1101
+ len2 = WASM_VECTOR_LEN;
1102
+ ptr3 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1103
+ len3 = WASM_VECTOR_LEN;
1104
+ } catch (e) {
1105
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
1106
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
1107
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
1108
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
1109
+ throw e;
1110
+ }
1111
+ const ret = wasm.molhandle_rdkit_align_json(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, val5, val6);
1112
+ var ptr7 = ret[0];
1113
+ var len7 = ret[1];
1084
1114
  if (ret[3]) {
1085
- ptr5 = 0; len5 = 0;
1115
+ ptr7 = 0; len7 = 0;
1086
1116
  throw takeFromExternrefTable0(ret[2]);
1087
1117
  }
1088
- deferred6_0 = ptr5;
1089
- deferred6_1 = len5;
1090
- return getStringFromWasm0(ptr5, len5);
1118
+ deferred8_0 = ptr7;
1119
+ deferred8_1 = len7;
1120
+ return getStringFromWasm0(ptr7, len7);
1091
1121
  } finally {
1092
- wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
1122
+ wasm.__wbindgen_free(deferred8_0, deferred8_1, 1);
1093
1123
  }
1094
1124
  }
1095
1125
  /**
@@ -1103,25 +1133,34 @@ export class MolHandle {
1103
1133
  * @returns {string}
1104
1134
  */
1105
1135
  rdkit_all_conformer_best_rms_json(conformers_json, max_matches, symmetrize, weights_json) {
1106
- let deferred4_0;
1107
- let deferred4_1;
1136
+ let deferred6_0;
1137
+ let deferred6_1;
1108
1138
  try {
1109
- const ptr0 = passStringToWasm0(conformers_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1110
- const len0 = WASM_VECTOR_LEN;
1111
- var ptr1 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1112
- var len1 = WASM_VECTOR_LEN;
1113
- const ret = wasm.molhandle_rdkit_all_conformer_best_rms_json(this.__wbg_ptr, ptr0, len0, max_matches, symmetrize, ptr1, len1);
1114
- var ptr3 = ret[0];
1115
- var len3 = ret[1];
1139
+ const val3 = +max_matches;
1140
+ const val4 = +symmetrize;
1141
+ let ptr0, len0, ptr1, len1;
1142
+ try {
1143
+ ptr0 = passStringToWasm0(conformers_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1144
+ len0 = WASM_VECTOR_LEN;
1145
+ ptr1 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1146
+ len1 = WASM_VECTOR_LEN;
1147
+ } catch (e) {
1148
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
1149
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
1150
+ throw e;
1151
+ }
1152
+ const ret = wasm.molhandle_rdkit_all_conformer_best_rms_json(this.__wbg_ptr, ptr0, len0, val3, val4, ptr1, len1);
1153
+ var ptr5 = ret[0];
1154
+ var len5 = ret[1];
1116
1155
  if (ret[3]) {
1117
- ptr3 = 0; len3 = 0;
1156
+ ptr5 = 0; len5 = 0;
1118
1157
  throw takeFromExternrefTable0(ret[2]);
1119
1158
  }
1120
- deferred4_0 = ptr3;
1121
- deferred4_1 = len3;
1122
- return getStringFromWasm0(ptr3, len3);
1159
+ deferred6_0 = ptr5;
1160
+ deferred6_1 = len5;
1161
+ return getStringFromWasm0(ptr5, len5);
1123
1162
  } finally {
1124
- wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1163
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
1125
1164
  }
1126
1165
  }
1127
1166
  /**
@@ -1137,28 +1176,38 @@ export class MolHandle {
1137
1176
  * @returns {string}
1138
1177
  */
1139
1178
  rdkit_all_conformer_best_rms_to_reference_json(reference, probe_conformers_json, reference_conformers_json, max_matches, symmetrize, weights_json) {
1140
- let deferred5_0;
1141
- let deferred5_1;
1179
+ let deferred7_0;
1180
+ let deferred7_1;
1142
1181
  try {
1143
1182
  _assertClass(reference, MolHandle);
1144
- const ptr0 = passStringToWasm0(probe_conformers_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1145
- const len0 = WASM_VECTOR_LEN;
1146
- const ptr1 = passStringToWasm0(reference_conformers_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1147
- const len1 = WASM_VECTOR_LEN;
1148
- var ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1149
- var len2 = WASM_VECTOR_LEN;
1150
- const ret = wasm.molhandle_rdkit_all_conformer_best_rms_to_reference_json(this.__wbg_ptr, reference.__wbg_ptr, ptr0, len0, ptr1, len1, max_matches, symmetrize, ptr2, len2);
1151
- var ptr4 = ret[0];
1152
- var len4 = ret[1];
1183
+ const val4 = +max_matches;
1184
+ const val5 = +symmetrize;
1185
+ let ptr0, len0, ptr1, len1, ptr2, len2;
1186
+ try {
1187
+ ptr0 = passStringToWasm0(probe_conformers_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1188
+ len0 = WASM_VECTOR_LEN;
1189
+ ptr1 = passStringToWasm0(reference_conformers_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1190
+ len1 = WASM_VECTOR_LEN;
1191
+ ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1192
+ len2 = WASM_VECTOR_LEN;
1193
+ } catch (e) {
1194
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
1195
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
1196
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
1197
+ throw e;
1198
+ }
1199
+ const ret = wasm.molhandle_rdkit_all_conformer_best_rms_to_reference_json(this.__wbg_ptr, reference.__wbg_ptr, ptr0, len0, ptr1, len1, val4, val5, ptr2, len2);
1200
+ var ptr6 = ret[0];
1201
+ var len6 = ret[1];
1153
1202
  if (ret[3]) {
1154
- ptr4 = 0; len4 = 0;
1203
+ ptr6 = 0; len6 = 0;
1155
1204
  throw takeFromExternrefTable0(ret[2]);
1156
1205
  }
1157
- deferred5_0 = ptr4;
1158
- deferred5_1 = len4;
1159
- return getStringFromWasm0(ptr4, len4);
1206
+ deferred7_0 = ptr6;
1207
+ deferred7_1 = len6;
1208
+ return getStringFromWasm0(ptr6, len6);
1160
1209
  } finally {
1161
- wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
1210
+ wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
1162
1211
  }
1163
1212
  }
1164
1213
  /**
@@ -1171,27 +1220,37 @@ export class MolHandle {
1171
1220
  * @returns {string}
1172
1221
  */
1173
1222
  rdkit_best_alignment_json(probe_coords_json, reference_coords_json, max_matches, symmetrize, weights_json) {
1174
- let deferred5_0;
1175
- let deferred5_1;
1223
+ let deferred7_0;
1224
+ let deferred7_1;
1176
1225
  try {
1177
- const ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1178
- const len0 = WASM_VECTOR_LEN;
1179
- const ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1180
- const len1 = WASM_VECTOR_LEN;
1181
- var ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1182
- var len2 = WASM_VECTOR_LEN;
1183
- const ret = wasm.molhandle_rdkit_best_alignment_json(this.__wbg_ptr, ptr0, len0, ptr1, len1, max_matches, symmetrize, ptr2, len2);
1184
- var ptr4 = ret[0];
1185
- var len4 = ret[1];
1226
+ const val4 = +max_matches;
1227
+ const val5 = +symmetrize;
1228
+ let ptr0, len0, ptr1, len1, ptr2, len2;
1229
+ try {
1230
+ ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1231
+ len0 = WASM_VECTOR_LEN;
1232
+ ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1233
+ len1 = WASM_VECTOR_LEN;
1234
+ ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1235
+ len2 = WASM_VECTOR_LEN;
1236
+ } catch (e) {
1237
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
1238
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
1239
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
1240
+ throw e;
1241
+ }
1242
+ const ret = wasm.molhandle_rdkit_best_alignment_json(this.__wbg_ptr, ptr0, len0, ptr1, len1, val4, val5, ptr2, len2);
1243
+ var ptr6 = ret[0];
1244
+ var len6 = ret[1];
1186
1245
  if (ret[3]) {
1187
- ptr4 = 0; len4 = 0;
1246
+ ptr6 = 0; len6 = 0;
1188
1247
  throw takeFromExternrefTable0(ret[2]);
1189
1248
  }
1190
- deferred5_0 = ptr4;
1191
- deferred5_1 = len4;
1192
- return getStringFromWasm0(ptr4, len4);
1249
+ deferred7_0 = ptr6;
1250
+ deferred7_1 = len6;
1251
+ return getStringFromWasm0(ptr6, len6);
1193
1252
  } finally {
1194
- wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
1253
+ wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
1195
1254
  }
1196
1255
  }
1197
1256
  /**
@@ -1204,13 +1263,23 @@ export class MolHandle {
1204
1263
  * @returns {number}
1205
1264
  */
1206
1265
  rdkit_best_rms(probe_coords_json, reference_coords_json, max_matches, symmetrize, weights_json) {
1207
- const ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1208
- const len0 = WASM_VECTOR_LEN;
1209
- const ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1210
- const len1 = WASM_VECTOR_LEN;
1211
- var ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1212
- var len2 = WASM_VECTOR_LEN;
1213
- const ret = wasm.molhandle_rdkit_best_rms(this.__wbg_ptr, ptr0, len0, ptr1, len1, max_matches, symmetrize, ptr2, len2);
1266
+ const val4 = +max_matches;
1267
+ const val5 = +symmetrize;
1268
+ let ptr0, len0, ptr1, len1, ptr2, len2;
1269
+ try {
1270
+ ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1271
+ len0 = WASM_VECTOR_LEN;
1272
+ ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1273
+ len1 = WASM_VECTOR_LEN;
1274
+ ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1275
+ len2 = WASM_VECTOR_LEN;
1276
+ } catch (e) {
1277
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
1278
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
1279
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
1280
+ throw e;
1281
+ }
1282
+ const ret = wasm.molhandle_rdkit_best_rms(this.__wbg_ptr, ptr0, len0, ptr1, len1, val4, val5, ptr2, len2);
1214
1283
  if (ret[2]) {
1215
1284
  throw takeFromExternrefTable0(ret[1]);
1216
1285
  }
@@ -1257,23 +1326,26 @@ export class MolHandle {
1257
1326
  * @returns {string}
1258
1327
  */
1259
1328
  rdkit_bounds_matrix_with_constraints_json(constraints_json, set15bounds, do_triangle_smoothing, use_macrocycle_14_config) {
1260
- let deferred3_0;
1261
- let deferred3_1;
1329
+ let deferred6_0;
1330
+ let deferred6_1;
1262
1331
  try {
1332
+ const val2 = +set15bounds;
1333
+ const val3 = +do_triangle_smoothing;
1334
+ const val4 = +use_macrocycle_14_config;
1263
1335
  const ptr0 = passStringToWasm0(constraints_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1264
1336
  const len0 = WASM_VECTOR_LEN;
1265
- const ret = wasm.molhandle_rdkit_bounds_matrix_with_constraints_json(this.__wbg_ptr, ptr0, len0, set15bounds, do_triangle_smoothing, use_macrocycle_14_config);
1266
- var ptr2 = ret[0];
1267
- var len2 = ret[1];
1337
+ const ret = wasm.molhandle_rdkit_bounds_matrix_with_constraints_json(this.__wbg_ptr, ptr0, len0, val2, val3, val4);
1338
+ var ptr5 = ret[0];
1339
+ var len5 = ret[1];
1268
1340
  if (ret[3]) {
1269
- ptr2 = 0; len2 = 0;
1341
+ ptr5 = 0; len5 = 0;
1270
1342
  throw takeFromExternrefTable0(ret[2]);
1271
1343
  }
1272
- deferred3_0 = ptr2;
1273
- deferred3_1 = len2;
1274
- return getStringFromWasm0(ptr2, len2);
1344
+ deferred6_0 = ptr5;
1345
+ deferred6_1 = len5;
1346
+ return getStringFromWasm0(ptr5, len5);
1275
1347
  } finally {
1276
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1348
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
1277
1349
  }
1278
1350
  }
1279
1351
  /**
@@ -1286,13 +1358,23 @@ export class MolHandle {
1286
1358
  * @returns {number}
1287
1359
  */
1288
1360
  rdkit_calc_rms(probe_coords_json, reference_coords_json, max_matches, symmetrize, weights_json) {
1289
- const ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1290
- const len0 = WASM_VECTOR_LEN;
1291
- const ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1292
- const len1 = WASM_VECTOR_LEN;
1293
- var ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1294
- var len2 = WASM_VECTOR_LEN;
1295
- const ret = wasm.molhandle_rdkit_calc_rms(this.__wbg_ptr, ptr0, len0, ptr1, len1, max_matches, symmetrize, ptr2, len2);
1361
+ const val4 = +max_matches;
1362
+ const val5 = +symmetrize;
1363
+ let ptr0, len0, ptr1, len1, ptr2, len2;
1364
+ try {
1365
+ ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1366
+ len0 = WASM_VECTOR_LEN;
1367
+ ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1368
+ len1 = WASM_VECTOR_LEN;
1369
+ ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1370
+ len2 = WASM_VECTOR_LEN;
1371
+ } catch (e) {
1372
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
1373
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
1374
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
1375
+ throw e;
1376
+ }
1377
+ const ret = wasm.molhandle_rdkit_calc_rms(this.__wbg_ptr, ptr0, len0, ptr1, len1, val4, val5, ptr2, len2);
1296
1378
  if (ret[2]) {
1297
1379
  throw takeFromExternrefTable0(ret[1]);
1298
1380
  }
@@ -1351,23 +1433,24 @@ export class MolHandle {
1351
1433
  * @returns {string}
1352
1434
  */
1353
1435
  rdkit_distance_matrix_3d_checked_json(coords_json, use_atom_wts) {
1354
- let deferred3_0;
1355
- let deferred3_1;
1436
+ let deferred4_0;
1437
+ let deferred4_1;
1356
1438
  try {
1439
+ const val2 = +use_atom_wts;
1357
1440
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1358
1441
  const len0 = WASM_VECTOR_LEN;
1359
- const ret = wasm.molhandle_rdkit_distance_matrix_3d_checked_json(this.__wbg_ptr, ptr0, len0, use_atom_wts);
1360
- var ptr2 = ret[0];
1361
- var len2 = ret[1];
1442
+ const ret = wasm.molhandle_rdkit_distance_matrix_3d_checked_json(this.__wbg_ptr, ptr0, len0, val2);
1443
+ var ptr3 = ret[0];
1444
+ var len3 = ret[1];
1362
1445
  if (ret[3]) {
1363
- ptr2 = 0; len2 = 0;
1446
+ ptr3 = 0; len3 = 0;
1364
1447
  throw takeFromExternrefTable0(ret[2]);
1365
1448
  }
1366
- deferred3_0 = ptr2;
1367
- deferred3_1 = len2;
1368
- return getStringFromWasm0(ptr2, len2);
1449
+ deferred4_0 = ptr3;
1450
+ deferred4_1 = len3;
1451
+ return getStringFromWasm0(ptr3, len3);
1369
1452
  } finally {
1370
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1453
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1371
1454
  }
1372
1455
  }
1373
1456
  /**
@@ -1404,23 +1487,25 @@ export class MolHandle {
1404
1487
  * @returns {string}
1405
1488
  */
1406
1489
  rdkit_embed_with_constraints_json(constraints_json, random_seed, max_iterations) {
1407
- let deferred3_0;
1408
- let deferred3_1;
1490
+ let deferred5_0;
1491
+ let deferred5_1;
1409
1492
  try {
1493
+ const val2 = +random_seed;
1494
+ const val3 = +max_iterations;
1410
1495
  const ptr0 = passStringToWasm0(constraints_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1411
1496
  const len0 = WASM_VECTOR_LEN;
1412
- const ret = wasm.molhandle_rdkit_embed_with_constraints_json(this.__wbg_ptr, ptr0, len0, random_seed, max_iterations);
1413
- var ptr2 = ret[0];
1414
- var len2 = ret[1];
1497
+ const ret = wasm.molhandle_rdkit_embed_with_constraints_json(this.__wbg_ptr, ptr0, len0, val2, val3);
1498
+ var ptr4 = ret[0];
1499
+ var len4 = ret[1];
1415
1500
  if (ret[3]) {
1416
- ptr2 = 0; len2 = 0;
1501
+ ptr4 = 0; len4 = 0;
1417
1502
  throw takeFromExternrefTable0(ret[2]);
1418
1503
  }
1419
- deferred3_0 = ptr2;
1420
- deferred3_1 = len2;
1421
- return getStringFromWasm0(ptr2, len2);
1504
+ deferred5_0 = ptr4;
1505
+ deferred5_1 = len4;
1506
+ return getStringFromWasm0(ptr4, len4);
1422
1507
  } finally {
1423
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1508
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
1424
1509
  }
1425
1510
  }
1426
1511
  /**
@@ -1430,23 +1515,24 @@ export class MolHandle {
1430
1515
  * @returns {string}
1431
1516
  */
1432
1517
  rdkit_mol_hash(_function, use_cx_smiles) {
1433
- let deferred3_0;
1434
- let deferred3_1;
1518
+ let deferred4_0;
1519
+ let deferred4_1;
1435
1520
  try {
1521
+ const val2 = +use_cx_smiles;
1436
1522
  const ptr0 = passStringToWasm0(_function, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1437
1523
  const len0 = WASM_VECTOR_LEN;
1438
- const ret = wasm.molhandle_rdkit_mol_hash(this.__wbg_ptr, ptr0, len0, use_cx_smiles);
1439
- var ptr2 = ret[0];
1440
- var len2 = ret[1];
1524
+ const ret = wasm.molhandle_rdkit_mol_hash(this.__wbg_ptr, ptr0, len0, val2);
1525
+ var ptr3 = ret[0];
1526
+ var len3 = ret[1];
1441
1527
  if (ret[3]) {
1442
- ptr2 = 0; len2 = 0;
1528
+ ptr3 = 0; len3 = 0;
1443
1529
  throw takeFromExternrefTable0(ret[2]);
1444
1530
  }
1445
- deferred3_0 = ptr2;
1446
- deferred3_1 = len2;
1447
- return getStringFromWasm0(ptr2, len2);
1531
+ deferred4_0 = ptr3;
1532
+ deferred4_1 = len3;
1533
+ return getStringFromWasm0(ptr3, len3);
1448
1534
  } finally {
1449
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1535
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1450
1536
  }
1451
1537
  }
1452
1538
  /**
@@ -1496,6 +1582,19 @@ export class MolHandle {
1496
1582
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1497
1583
  }
1498
1584
  }
1585
+ /**
1586
+ * Copy the molecule with RDKit's SMILES reader conventions, including
1587
+ * its stereo tags and hydrogen suppression. Throws when conversion
1588
+ * cannot represent the input.
1589
+ * @returns {MolHandle}
1590
+ */
1591
+ rdkit_parsed() {
1592
+ const ret = wasm.molhandle_rdkit_parsed(this.__wbg_ptr);
1593
+ if (ret[2]) {
1594
+ throw takeFromExternrefTable0(ret[1]);
1595
+ }
1596
+ return MolHandle.__wrap(ret[0]);
1597
+ }
1499
1598
  /**
1500
1599
  * RDKit-compatible PDB block. Optional coordinates are a JSON array in
1501
1600
  * zero-based molecule atom order; omit them to write zero coordinates.
@@ -1906,17 +2005,18 @@ export class RdkitSearchIndex {
1906
2005
  * @returns {string}
1907
2006
  */
1908
2007
  search_json(query_smiles, k) {
1909
- let deferred2_0;
1910
- let deferred2_1;
2008
+ let deferred3_0;
2009
+ let deferred3_1;
1911
2010
  try {
2011
+ const val2 = +k;
1912
2012
  const ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1913
2013
  const len0 = WASM_VECTOR_LEN;
1914
- const ret = wasm.rdkitsearchindex_search_json(this.__wbg_ptr, ptr0, len0, k);
1915
- deferred2_0 = ret[0];
1916
- deferred2_1 = ret[1];
2014
+ const ret = wasm.rdkitsearchindex_search_json(this.__wbg_ptr, ptr0, len0, val2);
2015
+ deferred3_0 = ret[0];
2016
+ deferred3_1 = ret[1];
1917
2017
  return getStringFromWasm0(ret[0], ret[1]);
1918
2018
  } finally {
1919
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
2019
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1920
2020
  }
1921
2021
  }
1922
2022
  /**
@@ -1930,17 +2030,18 @@ export class RdkitSearchIndex {
1930
2030
  * @returns {string}
1931
2031
  */
1932
2032
  search_json_precise(query_smiles, k) {
1933
- let deferred2_0;
1934
- let deferred2_1;
2033
+ let deferred3_0;
2034
+ let deferred3_1;
1935
2035
  try {
2036
+ const val2 = +k;
1936
2037
  const ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1937
2038
  const len0 = WASM_VECTOR_LEN;
1938
- const ret = wasm.rdkitsearchindex_search_json_precise(this.__wbg_ptr, ptr0, len0, k);
1939
- deferred2_0 = ret[0];
1940
- deferred2_1 = ret[1];
2039
+ const ret = wasm.rdkitsearchindex_search_json_precise(this.__wbg_ptr, ptr0, len0, val2);
2040
+ deferred3_0 = ret[0];
2041
+ deferred3_1 = ret[1];
1941
2042
  return getStringFromWasm0(ret[0], ret[1]);
1942
2043
  } finally {
1943
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
2044
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1944
2045
  }
1945
2046
  }
1946
2047
  /**
@@ -1952,17 +2053,19 @@ export class RdkitSearchIndex {
1952
2053
  * @returns {string}
1953
2054
  */
1954
2055
  search_json_threshold_precise(query_smiles, threshold, k) {
1955
- let deferred2_0;
1956
- let deferred2_1;
2056
+ let deferred4_0;
2057
+ let deferred4_1;
1957
2058
  try {
2059
+ const val2 = +threshold;
2060
+ const val3 = +k;
1958
2061
  const ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1959
2062
  const len0 = WASM_VECTOR_LEN;
1960
- const ret = wasm.rdkitsearchindex_search_json_threshold_precise(this.__wbg_ptr, ptr0, len0, threshold, k);
1961
- deferred2_0 = ret[0];
1962
- deferred2_1 = ret[1];
2063
+ const ret = wasm.rdkitsearchindex_search_json_threshold_precise(this.__wbg_ptr, ptr0, len0, val2, val3);
2064
+ deferred4_0 = ret[0];
2065
+ deferred4_1 = ret[1];
1963
2066
  return getStringFromWasm0(ret[0], ret[1]);
1964
2067
  } finally {
1965
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
2068
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1966
2069
  }
1967
2070
  }
1968
2071
  }
@@ -2304,6 +2407,56 @@ export function batch_report_html(smiles_lines) {
2304
2407
  }
2305
2408
  }
2306
2409
 
2410
+ /**
2411
+ * @param {string} json
2412
+ * @returns {string}
2413
+ */
2414
+ export function bgf_from_record_json(json) {
2415
+ let deferred3_0;
2416
+ let deferred3_1;
2417
+ try {
2418
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2419
+ const len0 = WASM_VECTOR_LEN;
2420
+ const ret = wasm.bgf_from_record_json(ptr0, len0);
2421
+ var ptr2 = ret[0];
2422
+ var len2 = ret[1];
2423
+ if (ret[3]) {
2424
+ ptr2 = 0; len2 = 0;
2425
+ throw takeFromExternrefTable0(ret[2]);
2426
+ }
2427
+ deferred3_0 = ptr2;
2428
+ deferred3_1 = len2;
2429
+ return getStringFromWasm0(ptr2, len2);
2430
+ } finally {
2431
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2432
+ }
2433
+ }
2434
+
2435
+ /**
2436
+ * @param {string} text
2437
+ * @returns {string}
2438
+ */
2439
+ export function bgf_record_json(text) {
2440
+ let deferred3_0;
2441
+ let deferred3_1;
2442
+ try {
2443
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2444
+ const len0 = WASM_VECTOR_LEN;
2445
+ const ret = wasm.bgf_record_json(ptr0, len0);
2446
+ var ptr2 = ret[0];
2447
+ var len2 = ret[1];
2448
+ if (ret[3]) {
2449
+ ptr2 = 0; len2 = 0;
2450
+ throw takeFromExternrefTable0(ret[2]);
2451
+ }
2452
+ deferred3_0 = ptr2;
2453
+ deferred3_1 = len2;
2454
+ return getStringFromWasm0(ptr2, len2);
2455
+ } finally {
2456
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2457
+ }
2458
+ }
2459
+
2307
2460
  /**
2308
2461
  * Predict GI absorption and BBB penetration using the BOILED-Egg method
2309
2462
  * (Daina & Zoete 2016).
@@ -2431,23 +2584,24 @@ export function brics_fragments_json(mol) {
2431
2584
  * @returns {string}
2432
2585
  */
2433
2586
  export function butina_cluster_ecfp4_json(smiles_json, cutoff) {
2434
- let deferred3_0;
2435
- let deferred3_1;
2587
+ let deferred4_0;
2588
+ let deferred4_1;
2436
2589
  try {
2590
+ const val2 = +cutoff;
2437
2591
  const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2438
2592
  const len0 = WASM_VECTOR_LEN;
2439
- const ret = wasm.butina_cluster_ecfp4_json(ptr0, len0, cutoff);
2440
- var ptr2 = ret[0];
2441
- var len2 = ret[1];
2593
+ const ret = wasm.butina_cluster_ecfp4_json(ptr0, len0, val2);
2594
+ var ptr3 = ret[0];
2595
+ var len3 = ret[1];
2442
2596
  if (ret[3]) {
2443
- ptr2 = 0; len2 = 0;
2597
+ ptr3 = 0; len3 = 0;
2444
2598
  throw takeFromExternrefTable0(ret[2]);
2445
2599
  }
2446
- deferred3_0 = ptr2;
2447
- deferred3_1 = len2;
2448
- return getStringFromWasm0(ptr2, len2);
2600
+ deferred4_0 = ptr3;
2601
+ deferred4_1 = len3;
2602
+ return getStringFromWasm0(ptr3, len3);
2449
2603
  } finally {
2450
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2604
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2451
2605
  }
2452
2606
  }
2453
2607
 
@@ -2503,26 +2657,35 @@ export function canonical_tautomer_with_blocked_atoms_json(mol, blocked_atom_ind
2503
2657
  * @returns {string}
2504
2658
  */
2505
2659
  export function canonicalize_conformer_from_coords_json(mol, coords_json, center_json, normalize_covar, ignore_hs) {
2506
- let deferred4_0;
2507
- let deferred4_1;
2660
+ let deferred6_0;
2661
+ let deferred6_1;
2508
2662
  try {
2509
2663
  _assertClass(mol, MolHandle);
2510
- const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2511
- const len0 = WASM_VECTOR_LEN;
2512
- var ptr1 = isLikeNone(center_json) ? 0 : passStringToWasm0(center_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2513
- var len1 = WASM_VECTOR_LEN;
2514
- const ret = wasm.canonicalize_conformer_from_coords_json(mol.__wbg_ptr, ptr0, len0, ptr1, len1, normalize_covar, ignore_hs);
2515
- var ptr3 = ret[0];
2516
- var len3 = ret[1];
2664
+ const val3 = +normalize_covar;
2665
+ const val4 = +ignore_hs;
2666
+ let ptr0, len0, ptr1, len1;
2667
+ try {
2668
+ ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2669
+ len0 = WASM_VECTOR_LEN;
2670
+ ptr1 = isLikeNone(center_json) ? 0 : passStringToWasm0(center_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2671
+ len1 = WASM_VECTOR_LEN;
2672
+ } catch (e) {
2673
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
2674
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
2675
+ throw e;
2676
+ }
2677
+ const ret = wasm.canonicalize_conformer_from_coords_json(mol.__wbg_ptr, ptr0, len0, ptr1, len1, val3, val4);
2678
+ var ptr5 = ret[0];
2679
+ var len5 = ret[1];
2517
2680
  if (ret[3]) {
2518
- ptr3 = 0; len3 = 0;
2681
+ ptr5 = 0; len5 = 0;
2519
2682
  throw takeFromExternrefTable0(ret[2]);
2520
2683
  }
2521
- deferred4_0 = ptr3;
2522
- deferred4_1 = len3;
2523
- return getStringFromWasm0(ptr3, len3);
2684
+ deferred6_0 = ptr5;
2685
+ deferred6_1 = len5;
2686
+ return getStringFromWasm0(ptr5, len5);
2524
2687
  } finally {
2525
- wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2688
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
2526
2689
  }
2527
2690
  }
2528
2691
 
@@ -2542,10 +2705,17 @@ export function canonicalize_smiles_batch_json(smiles_batch, delimiter) {
2542
2705
  let deferred4_0;
2543
2706
  let deferred4_1;
2544
2707
  try {
2545
- const ptr0 = passStringToWasm0(smiles_batch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2546
- const len0 = WASM_VECTOR_LEN;
2547
- const ptr1 = passStringToWasm0(delimiter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2548
- const len1 = WASM_VECTOR_LEN;
2708
+ let ptr0, len0, ptr1, len1;
2709
+ try {
2710
+ ptr0 = passStringToWasm0(smiles_batch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2711
+ len0 = WASM_VECTOR_LEN;
2712
+ ptr1 = passStringToWasm0(delimiter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2713
+ len1 = WASM_VECTOR_LEN;
2714
+ } catch (e) {
2715
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
2716
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
2717
+ throw e;
2718
+ }
2549
2719
  const ret = wasm.canonicalize_smiles_batch_json(ptr0, len0, ptr1, len1);
2550
2720
  var ptr3 = ret[0];
2551
2721
  var len3 = ret[1];
@@ -2713,23 +2883,24 @@ export function cdxml_to_smiles_json(cdxml) {
2713
2883
  * @returns {string}
2714
2884
  */
2715
2885
  export function cdxml_to_smiles_json_with_options(cdxml, infer_nondirectional_stereo) {
2716
- let deferred3_0;
2717
- let deferred3_1;
2886
+ let deferred4_0;
2887
+ let deferred4_1;
2718
2888
  try {
2889
+ const val2 = +infer_nondirectional_stereo;
2719
2890
  const ptr0 = passStringToWasm0(cdxml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2720
2891
  const len0 = WASM_VECTOR_LEN;
2721
- const ret = wasm.cdxml_to_smiles_json_with_options(ptr0, len0, infer_nondirectional_stereo);
2722
- var ptr2 = ret[0];
2723
- var len2 = ret[1];
2892
+ const ret = wasm.cdxml_to_smiles_json_with_options(ptr0, len0, val2);
2893
+ var ptr3 = ret[0];
2894
+ var len3 = ret[1];
2724
2895
  if (ret[3]) {
2725
- ptr2 = 0; len2 = 0;
2896
+ ptr3 = 0; len3 = 0;
2726
2897
  throw takeFromExternrefTable0(ret[2]);
2727
2898
  }
2728
- deferred3_0 = ptr2;
2729
- deferred3_1 = len2;
2730
- return getStringFromWasm0(ptr2, len2);
2899
+ deferred4_0 = ptr3;
2900
+ deferred4_1 = len3;
2901
+ return getStringFromWasm0(ptr3, len3);
2731
2902
  } finally {
2732
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2903
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2733
2904
  }
2734
2905
  }
2735
2906
 
@@ -2776,31 +2947,39 @@ export function chematic_version() {
2776
2947
  /**
2777
2948
  * Exact source bytes, projected XML, fragment coordinates and CDX omission tags.
2778
2949
  * CDXML uses the existing graph projection; omissions lists CDX tags only.
2779
- * @param {Uint8Array} data
2950
+ * @param {Uint8Array | number[]} data
2780
2951
  * @param {string} format
2781
2952
  * @param {boolean} allow_metadata_loss
2782
2953
  * @returns {string}
2783
2954
  */
2784
2955
  export function chemdraw_block_report_json(data, format, allow_metadata_loss) {
2785
- let deferred4_0;
2786
- let deferred4_1;
2956
+ let deferred5_0;
2957
+ let deferred5_1;
2787
2958
  try {
2788
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
2789
- const len0 = WASM_VECTOR_LEN;
2790
- const ptr1 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2791
- const len1 = WASM_VECTOR_LEN;
2792
- const ret = wasm.chemdraw_block_report_json(ptr0, len0, ptr1, len1, allow_metadata_loss);
2793
- var ptr3 = ret[0];
2794
- var len3 = ret[1];
2959
+ const val3 = +allow_metadata_loss;
2960
+ let ptr0, len0, ptr1, len1;
2961
+ try {
2962
+ ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
2963
+ len0 = WASM_VECTOR_LEN;
2964
+ ptr1 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2965
+ len1 = WASM_VECTOR_LEN;
2966
+ } catch (e) {
2967
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
2968
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
2969
+ throw e;
2970
+ }
2971
+ const ret = wasm.chemdraw_block_report_json(ptr0, len0, ptr1, len1, val3);
2972
+ var ptr4 = ret[0];
2973
+ var len4 = ret[1];
2795
2974
  if (ret[3]) {
2796
- ptr3 = 0; len3 = 0;
2975
+ ptr4 = 0; len4 = 0;
2797
2976
  throw takeFromExternrefTable0(ret[2]);
2798
2977
  }
2799
- deferred4_0 = ptr3;
2800
- deferred4_1 = len3;
2801
- return getStringFromWasm0(ptr3, len3);
2978
+ deferred5_0 = ptr4;
2979
+ deferred5_1 = len4;
2980
+ return getStringFromWasm0(ptr4, len4);
2802
2981
  } finally {
2803
- wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2982
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
2804
2983
  }
2805
2984
  }
2806
2985
 
@@ -2813,9 +2992,9 @@ export function chemdraw_block_report_json(data, format, allow_metadata_loss) {
2813
2992
  * [`cip_unresolved_json`] -- never a silently-guessed label. A phosphorus on an
2814
2993
  * unsaturated ring (cyclophosphazene) gets RDKit's CIPLabeler label, which flips
2815
2994
  * with the ring's Kekulé spelling; its object carries `"kekuleDependent": true`.
2816
- * A ring centre with three single bonds and a lone pair (bridgehead amine)
2817
- * gets RDKit's label for the parsed SMILES spelling and carries
2818
- * `"spellingDependent": true`.
2995
+ * `seqCis` and `seqTrans` entries carry `bondIdx` and `bondAtoms`.
2996
+ * Configured odd cumulenes carry the full path as `cumuleneAtoms`, from `atomIdx`.
2997
+ * Saturated ring lone-pair centres use the molecule's recorded ligand order.
2819
2998
  * Returns `"null"` on an internal engine error (budget-independent computations
2820
2999
  * should not normally hit this).
2821
3000
  * @param {MolHandle} mol
@@ -2880,6 +3059,17 @@ export function cip_unresolved_json(mol) {
2880
3059
  }
2881
3060
  }
2882
3061
 
3062
+ /**
3063
+ * Apply Cleanup and return a new molecule with all fragments retained.
3064
+ * @param {MolHandle} mol
3065
+ * @returns {MolHandle}
3066
+ */
3067
+ export function cleanup_mol(mol) {
3068
+ _assertClass(mol, MolHandle);
3069
+ const ret = wasm.cleanup_mol(mol.__wbg_ptr);
3070
+ return MolHandle.__wrap(ret);
3071
+ }
3072
+
2883
3073
  /**
2884
3074
  * Compare multiple SMILES strings (up to 256 by default).
2885
3075
  * Accepts a delimiter-separated list (e.g., newline or comma).
@@ -2900,10 +3090,17 @@ export function compare_molecules_batch_json(smiles_batch, delimiter) {
2900
3090
  let deferred4_0;
2901
3091
  let deferred4_1;
2902
3092
  try {
2903
- const ptr0 = passStringToWasm0(smiles_batch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2904
- const len0 = WASM_VECTOR_LEN;
2905
- const ptr1 = passStringToWasm0(delimiter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2906
- const len1 = WASM_VECTOR_LEN;
3093
+ let ptr0, len0, ptr1, len1;
3094
+ try {
3095
+ ptr0 = passStringToWasm0(smiles_batch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3096
+ len0 = WASM_VECTOR_LEN;
3097
+ ptr1 = passStringToWasm0(delimiter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3098
+ len1 = WASM_VECTOR_LEN;
3099
+ } catch (e) {
3100
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3101
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3102
+ throw e;
3103
+ }
2907
3104
  const ret = wasm.compare_molecules_batch_json(ptr0, len0, ptr1, len1);
2908
3105
  var ptr3 = ret[0];
2909
3106
  var len3 = ret[1];
@@ -2937,10 +3134,17 @@ export function compare_molecules_json(smiles1, smiles2) {
2937
3134
  let deferred4_0;
2938
3135
  let deferred4_1;
2939
3136
  try {
2940
- const ptr0 = passStringToWasm0(smiles1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2941
- const len0 = WASM_VECTOR_LEN;
2942
- const ptr1 = passStringToWasm0(smiles2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2943
- const len1 = WASM_VECTOR_LEN;
3137
+ let ptr0, len0, ptr1, len1;
3138
+ try {
3139
+ ptr0 = passStringToWasm0(smiles1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3140
+ len0 = WASM_VECTOR_LEN;
3141
+ ptr1 = passStringToWasm0(smiles2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3142
+ len1 = WASM_VECTOR_LEN;
3143
+ } catch (e) {
3144
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3145
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3146
+ throw e;
3147
+ }
2944
3148
  const ret = wasm.compare_molecules_json(ptr0, len0, ptr1, len1);
2945
3149
  var ptr3 = ret[0];
2946
3150
  var len3 = ret[1];
@@ -2969,26 +3173,35 @@ export function compare_molecules_json(smiles1, smiles2) {
2969
3173
  * @returns {string}
2970
3174
  */
2971
3175
  export function compute_canonical_transform_from_coords_json(mol, coords_json, center_json, normalize_covar, ignore_hs) {
2972
- let deferred4_0;
2973
- let deferred4_1;
3176
+ let deferred6_0;
3177
+ let deferred6_1;
2974
3178
  try {
2975
3179
  _assertClass(mol, MolHandle);
2976
- const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2977
- const len0 = WASM_VECTOR_LEN;
2978
- var ptr1 = isLikeNone(center_json) ? 0 : passStringToWasm0(center_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2979
- var len1 = WASM_VECTOR_LEN;
2980
- const ret = wasm.compute_canonical_transform_from_coords_json(mol.__wbg_ptr, ptr0, len0, ptr1, len1, normalize_covar, ignore_hs);
2981
- var ptr3 = ret[0];
2982
- var len3 = ret[1];
3180
+ const val3 = +normalize_covar;
3181
+ const val4 = +ignore_hs;
3182
+ let ptr0, len0, ptr1, len1;
3183
+ try {
3184
+ ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3185
+ len0 = WASM_VECTOR_LEN;
3186
+ ptr1 = isLikeNone(center_json) ? 0 : passStringToWasm0(center_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3187
+ len1 = WASM_VECTOR_LEN;
3188
+ } catch (e) {
3189
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3190
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3191
+ throw e;
3192
+ }
3193
+ const ret = wasm.compute_canonical_transform_from_coords_json(mol.__wbg_ptr, ptr0, len0, ptr1, len1, val3, val4);
3194
+ var ptr5 = ret[0];
3195
+ var len5 = ret[1];
2983
3196
  if (ret[3]) {
2984
- ptr3 = 0; len3 = 0;
3197
+ ptr5 = 0; len5 = 0;
2985
3198
  throw takeFromExternrefTable0(ret[2]);
2986
3199
  }
2987
- deferred4_0 = ptr3;
2988
- deferred4_1 = len3;
2989
- return getStringFromWasm0(ptr3, len3);
3200
+ deferred6_0 = ptr5;
3201
+ deferred6_1 = len5;
3202
+ return getStringFromWasm0(ptr5, len5);
2990
3203
  } finally {
2991
- wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
3204
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
2992
3205
  }
2993
3206
  }
2994
3207
 
@@ -3023,7 +3236,11 @@ export function conformer_ensemble_json(mol, n, rmsd_threshold) {
3023
3236
  * GJF/COM supports only
3024
3237
  * same-format retention of a bounded single Cartesian job, including opaque
3025
3238
  * job sections (not a Gaussian job validator).
3026
- * V3000-to-CJSON also
3239
+ * V2000/V3000-to-CJSON also
3240
+ * CJSON-to-CML retains the local indexed graph, source XYZ and name after reparse;
3241
+ * opaque fields/stereo/unit cells, partial charges and conflicting names throw.
3242
+ * Source chemistry and coordinate-derived stereo are not validated.
3243
+ * V2000/V3000-to-CJSON also
3027
3244
  * carries source-order x/y/z values; it does not retain opaque metadata or
3028
3245
  * verify cross-format stereo.
3029
3246
  * MOL2-to-CJSON checks
@@ -3033,10 +3250,17 @@ export function conformer_ensemble_json(mol, n, rmsd_threshold) {
3033
3250
  * NO_CHARGES zero placeholders are omitted as explicitly unassigned values.
3034
3251
  * Other conversions use
3035
3252
  * the topology-only bridge and do not carry format-specific metadata.
3253
+ * CML-to-CML retains one bounded XML 1.0 CML-namespace molecule document exactly;
3254
+ * chemistry/references/stereo remain opaque, with no edits or validation promised.
3036
3255
  * SDF-to-SDF retains every validated source record. Other MOL/SDF input routes
3037
3256
  * require exactly one CTAB and omit SD fields; SDF output is one framed record.
3038
- * CML-to-CJSON carries complete source Cartesian coordinates, leaving absent
3039
- * 3D geometry absent and refusing partial/nonfinite data and multiple molecules.
3257
+ * CML-to-CJSON verifies a bounded graph/Cartesian/name profile on reparse,
3258
+ * including inferred H counts, and refuses unrepresented payload (2D, stereo,
3259
+ * aromatic/query/zero bonds, unknown attributes/elements).
3260
+ * Molecule/atom/bond IDs are document-local references; their spelling and
3261
+ * lexical XML are omitted.
3262
+ * Graph-projected CJSON output refuses in-memory properties outside the local
3263
+ * profile. MOL2 projection and exact CJSON retention keep separate contracts.
3040
3264
  * @param {string} text
3041
3265
  * @param {string} input_format
3042
3266
  * @param {string} output_format
@@ -3046,12 +3270,20 @@ export function convert_common_format(text, input_format, output_format) {
3046
3270
  let deferred5_0;
3047
3271
  let deferred5_1;
3048
3272
  try {
3049
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3050
- const len0 = WASM_VECTOR_LEN;
3051
- const ptr1 = passStringToWasm0(input_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3052
- const len1 = WASM_VECTOR_LEN;
3053
- const ptr2 = passStringToWasm0(output_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3054
- const len2 = WASM_VECTOR_LEN;
3273
+ let ptr0, len0, ptr1, len1, ptr2, len2;
3274
+ try {
3275
+ ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3276
+ len0 = WASM_VECTOR_LEN;
3277
+ ptr1 = passStringToWasm0(input_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3278
+ len1 = WASM_VECTOR_LEN;
3279
+ ptr2 = passStringToWasm0(output_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3280
+ len2 = WASM_VECTOR_LEN;
3281
+ } catch (e) {
3282
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
3283
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3284
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3285
+ throw e;
3286
+ }
3055
3287
  const ret = wasm.convert_common_format(ptr0, len0, ptr1, len1, ptr2, len2);
3056
3288
  var ptr4 = ret[0];
3057
3289
  var len4 = ret[1];
@@ -3079,14 +3311,23 @@ export function convert_with_report_json(text, input_format, output_format, poli
3079
3311
  let deferred6_0;
3080
3312
  let deferred6_1;
3081
3313
  try {
3082
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3083
- const len0 = WASM_VECTOR_LEN;
3084
- const ptr1 = passStringToWasm0(input_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3085
- const len1 = WASM_VECTOR_LEN;
3086
- const ptr2 = passStringToWasm0(output_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3087
- const len2 = WASM_VECTOR_LEN;
3088
- const ptr3 = passStringToWasm0(policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3089
- const len3 = WASM_VECTOR_LEN;
3314
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
3315
+ try {
3316
+ ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3317
+ len0 = WASM_VECTOR_LEN;
3318
+ ptr1 = passStringToWasm0(input_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3319
+ len1 = WASM_VECTOR_LEN;
3320
+ ptr2 = passStringToWasm0(output_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3321
+ len2 = WASM_VECTOR_LEN;
3322
+ ptr3 = passStringToWasm0(policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3323
+ len3 = WASM_VECTOR_LEN;
3324
+ } catch (e) {
3325
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
3326
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
3327
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3328
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3329
+ throw e;
3330
+ }
3090
3331
  const ret = wasm.convert_with_report_json(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
3091
3332
  var ptr5 = ret[0];
3092
3333
  var len5 = ret[1];
@@ -3294,17 +3535,18 @@ export function depict_reaction_svg(rxn_smiles) {
3294
3535
  * @returns {string}
3295
3536
  */
3296
3537
  export function depict_svg_grid(smiles_block, cols) {
3297
- let deferred2_0;
3298
- let deferred2_1;
3538
+ let deferred3_0;
3539
+ let deferred3_1;
3299
3540
  try {
3541
+ const val2 = +cols;
3300
3542
  const ptr0 = passStringToWasm0(smiles_block, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3301
3543
  const len0 = WASM_VECTOR_LEN;
3302
- const ret = wasm.depict_svg_grid(ptr0, len0, cols);
3303
- deferred2_0 = ret[0];
3304
- deferred2_1 = ret[1];
3544
+ const ret = wasm.depict_svg_grid(ptr0, len0, val2);
3545
+ deferred3_0 = ret[0];
3546
+ deferred3_1 = ret[1];
3305
3547
  return getStringFromWasm0(ret[0], ret[1]);
3306
3548
  } finally {
3307
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
3549
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
3308
3550
  }
3309
3551
  }
3310
3552
 
@@ -3327,19 +3569,27 @@ export function depict_svg_grid(smiles_block, cols) {
3327
3569
  * @returns {string}
3328
3570
  */
3329
3571
  export function depict_svg_grid_highlighted(smiles_block, cols, match_smarts) {
3330
- let deferred3_0;
3331
- let deferred3_1;
3572
+ let deferred4_0;
3573
+ let deferred4_1;
3332
3574
  try {
3333
- const ptr0 = passStringToWasm0(smiles_block, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3334
- const len0 = WASM_VECTOR_LEN;
3335
- const ptr1 = passStringToWasm0(match_smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3336
- const len1 = WASM_VECTOR_LEN;
3337
- const ret = wasm.depict_svg_grid_highlighted(ptr0, len0, cols, ptr1, len1);
3338
- deferred3_0 = ret[0];
3339
- deferred3_1 = ret[1];
3575
+ const val3 = +cols;
3576
+ let ptr0, len0, ptr1, len1;
3577
+ try {
3578
+ ptr0 = passStringToWasm0(smiles_block, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3579
+ len0 = WASM_VECTOR_LEN;
3580
+ ptr1 = passStringToWasm0(match_smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3581
+ len1 = WASM_VECTOR_LEN;
3582
+ } catch (e) {
3583
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3584
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3585
+ throw e;
3586
+ }
3587
+ const ret = wasm.depict_svg_grid_highlighted(ptr0, len0, val3, ptr1, len1);
3588
+ deferred4_0 = ret[0];
3589
+ deferred4_1 = ret[1];
3340
3590
  return getStringFromWasm0(ret[0], ret[1]);
3341
3591
  } finally {
3342
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
3592
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
3343
3593
  }
3344
3594
  }
3345
3595
 
@@ -3406,6 +3656,106 @@ export function dice_maccs(a, b) {
3406
3656
  return ret;
3407
3657
  }
3408
3658
 
3659
+ /**
3660
+ * @param {string} json
3661
+ * @returns {string}
3662
+ */
3663
+ export function dlpoly_config_from_record_json(json) {
3664
+ let deferred3_0;
3665
+ let deferred3_1;
3666
+ try {
3667
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3668
+ const len0 = WASM_VECTOR_LEN;
3669
+ const ret = wasm.dlpoly_config_from_record_json(ptr0, len0);
3670
+ var ptr2 = ret[0];
3671
+ var len2 = ret[1];
3672
+ if (ret[3]) {
3673
+ ptr2 = 0; len2 = 0;
3674
+ throw takeFromExternrefTable0(ret[2]);
3675
+ }
3676
+ deferred3_0 = ptr2;
3677
+ deferred3_1 = len2;
3678
+ return getStringFromWasm0(ptr2, len2);
3679
+ } finally {
3680
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
3681
+ }
3682
+ }
3683
+
3684
+ /**
3685
+ * @param {string} text
3686
+ * @returns {string}
3687
+ */
3688
+ export function dlpoly_config_record_json(text) {
3689
+ let deferred3_0;
3690
+ let deferred3_1;
3691
+ try {
3692
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3693
+ const len0 = WASM_VECTOR_LEN;
3694
+ const ret = wasm.dlpoly_config_record_json(ptr0, len0);
3695
+ var ptr2 = ret[0];
3696
+ var len2 = ret[1];
3697
+ if (ret[3]) {
3698
+ ptr2 = 0; len2 = 0;
3699
+ throw takeFromExternrefTable0(ret[2]);
3700
+ }
3701
+ deferred3_0 = ptr2;
3702
+ deferred3_1 = len2;
3703
+ return getStringFromWasm0(ptr2, len2);
3704
+ } finally {
3705
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
3706
+ }
3707
+ }
3708
+
3709
+ /**
3710
+ * @param {string} json
3711
+ * @returns {string}
3712
+ */
3713
+ export function dlpoly_history_from_json(json) {
3714
+ let deferred3_0;
3715
+ let deferred3_1;
3716
+ try {
3717
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3718
+ const len0 = WASM_VECTOR_LEN;
3719
+ const ret = wasm.dlpoly_history_from_json(ptr0, len0);
3720
+ var ptr2 = ret[0];
3721
+ var len2 = ret[1];
3722
+ if (ret[3]) {
3723
+ ptr2 = 0; len2 = 0;
3724
+ throw takeFromExternrefTable0(ret[2]);
3725
+ }
3726
+ deferred3_0 = ptr2;
3727
+ deferred3_1 = len2;
3728
+ return getStringFromWasm0(ptr2, len2);
3729
+ } finally {
3730
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
3731
+ }
3732
+ }
3733
+
3734
+ /**
3735
+ * @param {string} text
3736
+ * @returns {string}
3737
+ */
3738
+ export function dlpoly_history_json(text) {
3739
+ let deferred3_0;
3740
+ let deferred3_1;
3741
+ try {
3742
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3743
+ const len0 = WASM_VECTOR_LEN;
3744
+ const ret = wasm.dlpoly_history_json(ptr0, len0);
3745
+ var ptr2 = ret[0];
3746
+ var len2 = ret[1];
3747
+ if (ret[3]) {
3748
+ ptr2 = 0; len2 = 0;
3749
+ throw takeFromExternrefTable0(ret[2]);
3750
+ }
3751
+ deferred3_0 = ptr2;
3752
+ deferred3_1 = len2;
3753
+ return getStringFromWasm0(ptr2, len2);
3754
+ } finally {
3755
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
3756
+ }
3757
+ }
3758
+
3409
3759
  /**
3410
3760
  * Compute the ECFP4 fingerprint as a bit-packed byte vector (256 bytes = 2048 bits).
3411
3761
  * @param {MolHandle} mol
@@ -3507,10 +3857,17 @@ export function edit_cdxml_document_json(cdxml, edit_json) {
3507
3857
  let deferred4_0;
3508
3858
  let deferred4_1;
3509
3859
  try {
3510
- const ptr0 = passStringToWasm0(cdxml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3511
- const len0 = WASM_VECTOR_LEN;
3512
- const ptr1 = passStringToWasm0(edit_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3513
- const len1 = WASM_VECTOR_LEN;
3860
+ let ptr0, len0, ptr1, len1;
3861
+ try {
3862
+ ptr0 = passStringToWasm0(cdxml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3863
+ len0 = WASM_VECTOR_LEN;
3864
+ ptr1 = passStringToWasm0(edit_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3865
+ len1 = WASM_VECTOR_LEN;
3866
+ } catch (e) {
3867
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3868
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3869
+ throw e;
3870
+ }
3514
3871
  const ret = wasm.edit_cdxml_document_json(ptr0, len0, ptr1, len1);
3515
3872
  var ptr3 = ret[0];
3516
3873
  var len3 = ret[1];
@@ -3538,10 +3895,17 @@ export function edit_cdxml_document_json_v1(document_json, edit_json) {
3538
3895
  let deferred4_0;
3539
3896
  let deferred4_1;
3540
3897
  try {
3541
- const ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3542
- const len0 = WASM_VECTOR_LEN;
3543
- const ptr1 = passStringToWasm0(edit_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3544
- const len1 = WASM_VECTOR_LEN;
3898
+ let ptr0, len0, ptr1, len1;
3899
+ try {
3900
+ ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3901
+ len0 = WASM_VECTOR_LEN;
3902
+ ptr1 = passStringToWasm0(edit_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3903
+ len1 = WASM_VECTOR_LEN;
3904
+ } catch (e) {
3905
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3906
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3907
+ throw e;
3908
+ }
3545
3909
  const ret = wasm.edit_cdxml_document_json_v1(ptr0, len0, ptr1, len1);
3546
3910
  var ptr3 = ret[0];
3547
3911
  var len3 = ret[1];
@@ -3567,10 +3931,17 @@ export function edit_reaction_document_json_v1(document_json, edit_json) {
3567
3931
  let deferred4_0;
3568
3932
  let deferred4_1;
3569
3933
  try {
3570
- const ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3571
- const len0 = WASM_VECTOR_LEN;
3572
- const ptr1 = passStringToWasm0(edit_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3573
- const len1 = WASM_VECTOR_LEN;
3934
+ let ptr0, len0, ptr1, len1;
3935
+ try {
3936
+ ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3937
+ len0 = WASM_VECTOR_LEN;
3938
+ ptr1 = passStringToWasm0(edit_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3939
+ len1 = WASM_VECTOR_LEN;
3940
+ } catch (e) {
3941
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3942
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3943
+ throw e;
3944
+ }
3574
3945
  const ret = wasm.edit_reaction_document_json_v1(ptr0, len0, ptr1, len1);
3575
3946
  var ptr3 = ret[0];
3576
3947
  var len3 = ret[1];
@@ -3702,12 +4073,20 @@ export function enumerate_library_2way(template, scaffolds_smiles, building_bloc
3702
4073
  let deferred5_0;
3703
4074
  let deferred5_1;
3704
4075
  try {
3705
- const ptr0 = passStringToWasm0(template, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3706
- const len0 = WASM_VECTOR_LEN;
3707
- const ptr1 = passStringToWasm0(scaffolds_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3708
- const len1 = WASM_VECTOR_LEN;
3709
- const ptr2 = passStringToWasm0(building_blocks_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3710
- const len2 = WASM_VECTOR_LEN;
4076
+ let ptr0, len0, ptr1, len1, ptr2, len2;
4077
+ try {
4078
+ ptr0 = passStringToWasm0(template, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4079
+ len0 = WASM_VECTOR_LEN;
4080
+ ptr1 = passStringToWasm0(scaffolds_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4081
+ len1 = WASM_VECTOR_LEN;
4082
+ ptr2 = passStringToWasm0(building_blocks_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4083
+ len2 = WASM_VECTOR_LEN;
4084
+ } catch (e) {
4085
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
4086
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
4087
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
4088
+ throw e;
4089
+ }
3711
4090
  const ret = wasm.enumerate_library_2way(ptr0, len0, ptr1, len1, ptr2, len2);
3712
4091
  var ptr4 = ret[0];
3713
4092
  var len4 = ret[1];
@@ -3847,23 +4226,24 @@ export function explain_rdkit_atom_code_json(code) {
3847
4226
  * @returns {string}
3848
4227
  */
3849
4228
  export function explain_rdkit_topological_torsion_code_json(code_decimal, size) {
3850
- let deferred3_0;
3851
- let deferred3_1;
4229
+ let deferred4_0;
4230
+ let deferred4_1;
3852
4231
  try {
4232
+ const val2 = +size;
3853
4233
  const ptr0 = passStringToWasm0(code_decimal, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3854
4234
  const len0 = WASM_VECTOR_LEN;
3855
- const ret = wasm.explain_rdkit_topological_torsion_code_json(ptr0, len0, size);
3856
- var ptr2 = ret[0];
3857
- var len2 = ret[1];
4235
+ const ret = wasm.explain_rdkit_topological_torsion_code_json(ptr0, len0, val2);
4236
+ var ptr3 = ret[0];
4237
+ var len3 = ret[1];
3858
4238
  if (ret[3]) {
3859
- ptr2 = 0; len2 = 0;
4239
+ ptr3 = 0; len3 = 0;
3860
4240
  throw takeFromExternrefTable0(ret[2]);
3861
4241
  }
3862
- deferred3_0 = ptr2;
3863
- deferred3_1 = len2;
3864
- return getStringFromWasm0(ptr2, len2);
4242
+ deferred4_0 = ptr3;
4243
+ deferred4_1 = len3;
4244
+ return getStringFromWasm0(ptr3, len3);
3865
4245
  } finally {
3866
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
4246
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
3867
4247
  }
3868
4248
  }
3869
4249
 
@@ -3880,7 +4260,8 @@ export function explain_rdkit_topological_torsion_code_json(code_decimal, size)
3880
4260
  * "info":{"key":"value", ...}}`.
3881
4261
  *
3882
4262
  * Returns a JS error on parse failure or if the frame exceeds the WASM
3883
- * atom-count limit.
4263
+ * atom-count limit. Coordinates, cell entries and R atom data must be finite;
4264
+ * nonzero decimals that round to binary64 zero are refused.
3884
4265
  * @param {string} text
3885
4266
  * @returns {string}
3886
4267
  */
@@ -3914,23 +4295,25 @@ export function extxyz_frame_json(text) {
3914
4295
  * @returns {string}
3915
4296
  */
3916
4297
  export function extxyz_frames_batch_json(text, offset, batch_size) {
3917
- let deferred3_0;
3918
- let deferred3_1;
3919
- try {
4298
+ let deferred5_0;
4299
+ let deferred5_1;
4300
+ try {
4301
+ const val2 = +offset;
4302
+ const val3 = +batch_size;
3920
4303
  const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3921
4304
  const len0 = WASM_VECTOR_LEN;
3922
- const ret = wasm.extxyz_frames_batch_json(ptr0, len0, offset, batch_size);
3923
- var ptr2 = ret[0];
3924
- var len2 = ret[1];
4305
+ const ret = wasm.extxyz_frames_batch_json(ptr0, len0, val2, val3);
4306
+ var ptr4 = ret[0];
4307
+ var len4 = ret[1];
3925
4308
  if (ret[3]) {
3926
- ptr2 = 0; len2 = 0;
4309
+ ptr4 = 0; len4 = 0;
3927
4310
  throw takeFromExternrefTable0(ret[2]);
3928
4311
  }
3929
- deferred3_0 = ptr2;
3930
- deferred3_1 = len2;
3931
- return getStringFromWasm0(ptr2, len2);
4312
+ deferred5_0 = ptr4;
4313
+ deferred5_1 = len4;
4314
+ return getStringFromWasm0(ptr4, len4);
3932
4315
  } finally {
3933
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
4316
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
3934
4317
  }
3935
4318
  }
3936
4319
 
@@ -4270,9 +4653,12 @@ export function get_atom_info(mol, idx) {
4270
4653
  */
4271
4654
  export function get_bond_angle_from_coords_json(mol, coords_json, i, j, k) {
4272
4655
  _assertClass(mol, MolHandle);
4656
+ const val2 = +i;
4657
+ const val3 = +j;
4658
+ const val4 = +k;
4273
4659
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4274
4660
  const len0 = WASM_VECTOR_LEN;
4275
- const ret = wasm.get_bond_angle_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j, k);
4661
+ const ret = wasm.get_bond_angle_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3, val4);
4276
4662
  if (ret[2]) {
4277
4663
  throw takeFromExternrefTable0(ret[1]);
4278
4664
  }
@@ -4345,9 +4731,11 @@ export function get_bond_info(mol, idx) {
4345
4731
  */
4346
4732
  export function get_bond_length_from_coords_json(mol, coords_json, i, j) {
4347
4733
  _assertClass(mol, MolHandle);
4734
+ const val2 = +i;
4735
+ const val3 = +j;
4348
4736
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4349
4737
  const len0 = WASM_VECTOR_LEN;
4350
- const ret = wasm.get_bond_length_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j);
4738
+ const ret = wasm.get_bond_length_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3);
4351
4739
  if (ret[2]) {
4352
4740
  throw takeFromExternrefTable0(ret[1]);
4353
4741
  }
@@ -4373,9 +4761,11 @@ export function get_bond_length_from_coords_json(mol, coords_json, i, j) {
4373
4761
  * @returns {number}
4374
4762
  */
4375
4763
  export function get_bond_length_json(smiles, a, b) {
4764
+ const val2 = +a;
4765
+ const val3 = +b;
4376
4766
  const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4377
4767
  const len0 = WASM_VECTOR_LEN;
4378
- const ret = wasm.get_bond_length_json(ptr0, len0, a, b);
4768
+ const ret = wasm.get_bond_length_json(ptr0, len0, val2, val3);
4379
4769
  return ret;
4380
4770
  }
4381
4771
 
@@ -4413,9 +4803,13 @@ export function get_descriptors_json(mol) {
4413
4803
  */
4414
4804
  export function get_dihedral_from_coords_json(mol, coords_json, i, j, k, l) {
4415
4805
  _assertClass(mol, MolHandle);
4806
+ const val2 = +i;
4807
+ const val3 = +j;
4808
+ const val4 = +k;
4809
+ const val5 = +l;
4416
4810
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4417
4811
  const len0 = WASM_VECTOR_LEN;
4418
- const ret = wasm.get_dihedral_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j, k, l);
4812
+ const ret = wasm.get_dihedral_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3, val4, val5);
4419
4813
  if (ret[2]) {
4420
4814
  throw takeFromExternrefTable0(ret[1]);
4421
4815
  }
@@ -4442,9 +4836,13 @@ export function get_dihedral_from_coords_json(mol, coords_json, i, j, k, l) {
4442
4836
  * @returns {any}
4443
4837
  */
4444
4838
  export function get_dihedral_json(smiles, a, b, c, d) {
4839
+ const val2 = +a;
4840
+ const val3 = +b;
4841
+ const val4 = +c;
4842
+ const val5 = +d;
4445
4843
  const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4446
4844
  const len0 = WASM_VECTOR_LEN;
4447
- const ret = wasm.get_dihedral_json(ptr0, len0, a, b, c, d);
4845
+ const ret = wasm.get_dihedral_json(ptr0, len0, val2, val3, val4, val5);
4448
4846
  return ret;
4449
4847
  }
4450
4848
 
@@ -4500,6 +4898,32 @@ export function getaway_descriptors_json(mol) {
4500
4898
  }
4501
4899
  }
4502
4900
 
4901
+ /**
4902
+ * Explicit checked binary64 Angstrom positions; raw parse/write is independent.
4903
+ * @param {string} text
4904
+ * @returns {string}
4905
+ */
4906
+ export function gromos96_geometry_angstrom_json(text) {
4907
+ let deferred3_0;
4908
+ let deferred3_1;
4909
+ try {
4910
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4911
+ const len0 = WASM_VECTOR_LEN;
4912
+ const ret = wasm.gromos96_geometry_angstrom_json(ptr0, len0);
4913
+ var ptr2 = ret[0];
4914
+ var len2 = ret[1];
4915
+ if (ret[3]) {
4916
+ ptr2 = 0; len2 = 0;
4917
+ throw takeFromExternrefTable0(ret[2]);
4918
+ }
4919
+ deferred3_0 = ptr2;
4920
+ deferred3_1 = len2;
4921
+ return getStringFromWasm0(ptr2, len2);
4922
+ } finally {
4923
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
4924
+ }
4925
+ }
4926
+
4503
4927
  /**
4504
4928
  * Parse a ChemDraw XML (CDXML) string into a `MolHandle`.
4505
4929
  *
@@ -4722,10 +5146,17 @@ export function lammps_data_to_json(text, atom_style) {
4722
5146
  let deferred4_0;
4723
5147
  let deferred4_1;
4724
5148
  try {
4725
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4726
- const len0 = WASM_VECTOR_LEN;
4727
- const ptr1 = passStringToWasm0(atom_style, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4728
- const len1 = WASM_VECTOR_LEN;
5149
+ let ptr0, len0, ptr1, len1;
5150
+ try {
5151
+ ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5152
+ len0 = WASM_VECTOR_LEN;
5153
+ ptr1 = passStringToWasm0(atom_style, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5154
+ len1 = WASM_VECTOR_LEN;
5155
+ } catch (e) {
5156
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
5157
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
5158
+ throw e;
5159
+ }
4729
5160
  const ret = wasm.lammps_data_to_json(ptr0, len0, ptr1, len1);
4730
5161
  var ptr3 = ret[0];
4731
5162
  var len3 = ret[1];
@@ -4943,6 +5374,32 @@ export function logp_per_atom_json(mol) {
4943
5374
  }
4944
5375
  }
4945
5376
 
5377
+ /**
5378
+ * Explicit checked binary64 Angstrom positions; raw parse/write is independent.
5379
+ * @param {string} text
5380
+ * @returns {string}
5381
+ */
5382
+ export function lpmd_positions_angstrom_json(text) {
5383
+ let deferred3_0;
5384
+ let deferred3_1;
5385
+ try {
5386
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5387
+ const len0 = WASM_VECTOR_LEN;
5388
+ const ret = wasm.lpmd_positions_angstrom_json(ptr0, len0);
5389
+ var ptr2 = ret[0];
5390
+ var len2 = ret[1];
5391
+ if (ret[3]) {
5392
+ ptr2 = 0; len2 = 0;
5393
+ throw takeFromExternrefTable0(ret[2]);
5394
+ }
5395
+ deferred3_0 = ptr2;
5396
+ deferred3_1 = len2;
5397
+ return getStringFromWasm0(ptr2, len2);
5398
+ } finally {
5399
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
5400
+ }
5401
+ }
5402
+
4946
5403
  /**
4947
5404
  * MACCS 166-bit structural keys fingerprint as a byte array (21 bytes, LSB-first).
4948
5405
  *
@@ -4972,10 +5429,17 @@ export function match_smarts_smiles(smiles, smarts) {
4972
5429
  let deferred4_0;
4973
5430
  let deferred4_1;
4974
5431
  try {
4975
- const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4976
- const len0 = WASM_VECTOR_LEN;
4977
- const ptr1 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4978
- const len1 = WASM_VECTOR_LEN;
5432
+ let ptr0, len0, ptr1, len1;
5433
+ try {
5434
+ ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5435
+ len0 = WASM_VECTOR_LEN;
5436
+ ptr1 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5437
+ len1 = WASM_VECTOR_LEN;
5438
+ } catch (e) {
5439
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
5440
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
5441
+ throw e;
5442
+ }
4979
5443
  const ret = wasm.match_smarts_smiles(ptr0, len0, ptr1, len1);
4980
5444
  var ptr3 = ret[0];
4981
5445
  var len3 = ret[1];
@@ -5002,23 +5466,66 @@ export function match_smarts_smiles(smiles, smarts) {
5002
5466
  * @returns {string}
5003
5467
  */
5004
5468
  export function maxmin_picks_ecfp4_json(smiles_json, n) {
5005
- let deferred3_0;
5006
- let deferred3_1;
5469
+ let deferred4_0;
5470
+ let deferred4_1;
5007
5471
  try {
5472
+ const val2 = +n;
5008
5473
  const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5009
5474
  const len0 = WASM_VECTOR_LEN;
5010
- const ret = wasm.maxmin_picks_ecfp4_json(ptr0, len0, n);
5011
- var ptr2 = ret[0];
5012
- var len2 = ret[1];
5475
+ const ret = wasm.maxmin_picks_ecfp4_json(ptr0, len0, val2);
5476
+ var ptr3 = ret[0];
5477
+ var len3 = ret[1];
5013
5478
  if (ret[3]) {
5014
- ptr2 = 0; len2 = 0;
5479
+ ptr3 = 0; len3 = 0;
5015
5480
  throw takeFromExternrefTable0(ret[2]);
5016
5481
  }
5017
- deferred3_0 = ptr2;
5018
- deferred3_1 = len2;
5019
- return getStringFromWasm0(ptr2, len2);
5482
+ deferred4_0 = ptr3;
5483
+ deferred4_1 = len3;
5484
+ return getStringFromWasm0(ptr3, len3);
5020
5485
  } finally {
5021
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
5486
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
5487
+ }
5488
+ }
5489
+
5490
+ /**
5491
+ * MCS SMARTS with status, preserving atom and bond query alternatives.
5492
+ *
5493
+ * Uses the same JSON input and configuration as `mcs_smiles_json_with_config`.
5494
+ * Set `bondCountFirst` to maximize bonds first, then atoms.
5495
+ * Charge and isotope predicates are preserved. `matchChiralTag` retains
5496
+ * absolute tetrahedral orientation with at least three common bonds and
5497
+ * chirality presence on smaller frames. Other stereo raises a serialization error.
5498
+ * @param {string} smiles_json
5499
+ * @param {string} config_json
5500
+ * @returns {string}
5501
+ */
5502
+ export function mcs_smarts_json_with_config(smiles_json, config_json) {
5503
+ let deferred4_0;
5504
+ let deferred4_1;
5505
+ try {
5506
+ let ptr0, len0, ptr1, len1;
5507
+ try {
5508
+ ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5509
+ len0 = WASM_VECTOR_LEN;
5510
+ ptr1 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5511
+ len1 = WASM_VECTOR_LEN;
5512
+ } catch (e) {
5513
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
5514
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
5515
+ throw e;
5516
+ }
5517
+ const ret = wasm.mcs_smarts_json_with_config(ptr0, len0, ptr1, len1);
5518
+ var ptr3 = ret[0];
5519
+ var len3 = ret[1];
5520
+ if (ret[3]) {
5521
+ ptr3 = 0; len3 = 0;
5522
+ throw takeFromExternrefTable0(ret[2]);
5523
+ }
5524
+ deferred4_0 = ptr3;
5525
+ deferred4_1 = len3;
5526
+ return getStringFromWasm0(ptr3, len3);
5527
+ } finally {
5528
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
5022
5529
  }
5023
5530
  }
5024
5531
 
@@ -5078,10 +5585,17 @@ export function mcs_smiles_json_with_config(smiles_json, config_json) {
5078
5585
  let deferred4_0;
5079
5586
  let deferred4_1;
5080
5587
  try {
5081
- const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5082
- const len0 = WASM_VECTOR_LEN;
5083
- const ptr1 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5084
- const len1 = WASM_VECTOR_LEN;
5588
+ let ptr0, len0, ptr1, len1;
5589
+ try {
5590
+ ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5591
+ len0 = WASM_VECTOR_LEN;
5592
+ ptr1 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5593
+ len1 = WASM_VECTOR_LEN;
5594
+ } catch (e) {
5595
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
5596
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
5597
+ throw e;
5598
+ }
5085
5599
  const ret = wasm.mcs_smiles_json_with_config(ptr0, len0, ptr1, len1);
5086
5600
  var ptr3 = ret[0];
5087
5601
  var len3 = ret[1];
@@ -5110,23 +5624,25 @@ export function mcs_smiles_json_with_config(smiles_json, config_json) {
5110
5624
  * @returns {string}
5111
5625
  */
5112
5626
  export function mcs_smiles_json_with_ring_config(smiles_json, ring_matches_ring_only, complete_rings_only) {
5113
- let deferred3_0;
5114
- let deferred3_1;
5627
+ let deferred5_0;
5628
+ let deferred5_1;
5115
5629
  try {
5630
+ const val2 = +ring_matches_ring_only;
5631
+ const val3 = +complete_rings_only;
5116
5632
  const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5117
5633
  const len0 = WASM_VECTOR_LEN;
5118
- const ret = wasm.mcs_smiles_json_with_ring_config(ptr0, len0, ring_matches_ring_only, complete_rings_only);
5119
- var ptr2 = ret[0];
5120
- var len2 = ret[1];
5634
+ const ret = wasm.mcs_smiles_json_with_ring_config(ptr0, len0, val2, val3);
5635
+ var ptr4 = ret[0];
5636
+ var len4 = ret[1];
5121
5637
  if (ret[3]) {
5122
- ptr2 = 0; len2 = 0;
5638
+ ptr4 = 0; len4 = 0;
5123
5639
  throw takeFromExternrefTable0(ret[2]);
5124
5640
  }
5125
- deferred3_0 = ptr2;
5126
- deferred3_1 = len2;
5127
- return getStringFromWasm0(ptr2, len2);
5641
+ deferred5_0 = ptr4;
5642
+ deferred5_1 = len4;
5643
+ return getStringFromWasm0(ptr4, len4);
5128
5644
  } finally {
5129
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
5645
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
5130
5646
  }
5131
5647
  }
5132
5648
 
@@ -5242,19 +5758,27 @@ export function minimize_mmff94_lbfgs_json(mol, max_iter) {
5242
5758
  * @returns {string}
5243
5759
  */
5244
5760
  export function minimize_uff_json(smiles, coords_json, max_iter) {
5245
- let deferred3_0;
5246
- let deferred3_1;
5761
+ let deferred4_0;
5762
+ let deferred4_1;
5247
5763
  try {
5248
- const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5249
- const len0 = WASM_VECTOR_LEN;
5250
- const ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5251
- const len1 = WASM_VECTOR_LEN;
5252
- const ret = wasm.minimize_uff_json(ptr0, len0, ptr1, len1, max_iter);
5253
- deferred3_0 = ret[0];
5254
- deferred3_1 = ret[1];
5764
+ const val3 = +max_iter;
5765
+ let ptr0, len0, ptr1, len1;
5766
+ try {
5767
+ ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5768
+ len0 = WASM_VECTOR_LEN;
5769
+ ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5770
+ len1 = WASM_VECTOR_LEN;
5771
+ } catch (e) {
5772
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
5773
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
5774
+ throw e;
5775
+ }
5776
+ const ret = wasm.minimize_uff_json(ptr0, len0, ptr1, len1, val3);
5777
+ deferred4_0 = ret[0];
5778
+ deferred4_1 = ret[1];
5255
5779
  return getStringFromWasm0(ret[0], ret[1]);
5256
5780
  } finally {
5257
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
5781
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
5258
5782
  }
5259
5783
  }
5260
5784
 
@@ -5435,18 +5959,19 @@ export function mmff94_energy_breakdown_from_coords_json(mol, coords_json) {
5435
5959
  * @returns {string}
5436
5960
  */
5437
5961
  export function mmff94_energy_breakdown_from_coords_json_with_options(mol, coords_json, ignore_interfrag_interactions) {
5438
- let deferred2_0;
5439
- let deferred2_1;
5962
+ let deferred3_0;
5963
+ let deferred3_1;
5440
5964
  try {
5441
5965
  _assertClass(mol, MolHandle);
5966
+ const val2 = +ignore_interfrag_interactions;
5442
5967
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5443
5968
  const len0 = WASM_VECTOR_LEN;
5444
- const ret = wasm.mmff94_energy_breakdown_from_coords_json_with_options(mol.__wbg_ptr, ptr0, len0, ignore_interfrag_interactions);
5445
- deferred2_0 = ret[0];
5446
- deferred2_1 = ret[1];
5969
+ const ret = wasm.mmff94_energy_breakdown_from_coords_json_with_options(mol.__wbg_ptr, ptr0, len0, val2);
5970
+ deferred3_0 = ret[0];
5971
+ deferred3_1 = ret[1];
5447
5972
  return getStringFromWasm0(ret[0], ret[1]);
5448
5973
  } finally {
5449
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
5974
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
5450
5975
  }
5451
5976
  }
5452
5977
 
@@ -5680,9 +6205,10 @@ export function mol_block_stereo_loss_json(mol) {
5680
6205
  * @returns {MolHandle}
5681
6206
  */
5682
6207
  export function mol_from_ccd(text, allow_stereo_loss) {
6208
+ const val2 = +allow_stereo_loss;
5683
6209
  const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5684
6210
  const len0 = WASM_VECTOR_LEN;
5685
- const ret = wasm.mol_from_ccd(ptr0, len0, allow_stereo_loss);
6211
+ const ret = wasm.mol_from_ccd(ptr0, len0, val2);
5686
6212
  if (ret[2]) {
5687
6213
  throw takeFromExternrefTable0(ret[1]);
5688
6214
  }
@@ -5714,9 +6240,10 @@ export function mol_from_cdxml(cdxml) {
5714
6240
  * @returns {MolHandle}
5715
6241
  */
5716
6242
  export function mol_from_cdxml_with_options(cdxml, infer_nondirectional_stereo) {
6243
+ const val2 = +infer_nondirectional_stereo;
5717
6244
  const ptr0 = passStringToWasm0(cdxml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5718
6245
  const len0 = WASM_VECTOR_LEN;
5719
- const ret = wasm.mol_from_cdxml_with_options(ptr0, len0, infer_nondirectional_stereo);
6246
+ const ret = wasm.mol_from_cdxml_with_options(ptr0, len0, val2);
5720
6247
  if (ret[2]) {
5721
6248
  throw takeFromExternrefTable0(ret[1]);
5722
6249
  }
@@ -5804,7 +6331,8 @@ export function mol_from_cube(text) {
5804
6331
  * too. Only the first frame of a multi-frame file is read.
5805
6332
  *
5806
6333
  * Returns a JS error on parse failure or if the frame exceeds the WASM
5807
- * atom-count limit.
6334
+ * atom-count limit. Coordinates, cell entries and R atom data must be finite;
6335
+ * nonzero decimals that round to binary64 zero are refused.
5808
6336
  * @param {string} text
5809
6337
  * @returns {MolHandle}
5810
6338
  */
@@ -5838,10 +6366,10 @@ export function mol_from_mmcif(text) {
5838
6366
  }
5839
6367
 
5840
6368
  /**
5841
- * Parse a MolJSON string into a `MolHandle`.
5842
- *
5843
- * MolJSON is a JSON-based molecular representation designed for LLM
5844
- * (large language model) compatibility. Returns a JS error on invalid input.
6369
+ * Parse chematic's atom-record MolJSON graph dialect, not oxpig MolJSON.
6370
+ * Range/type checks, exact bond orders (4 = quadruple), unique keys/IDs and
6371
+ * valid nonduplicate bonds are enforced. Throws on invalid input; source
6372
+ * metadata and stereochemistry are outside this graph profile.
5845
6373
  * @param {string} json
5846
6374
  * @returns {MolHandle}
5847
6375
  */
@@ -5903,9 +6431,10 @@ export function mol_from_pdb(pdb) {
5903
6431
  * @returns {MolHandle}
5904
6432
  */
5905
6433
  export function mol_from_pdb_conect(input, allow_extended_targets) {
6434
+ const val2 = +allow_extended_targets;
5906
6435
  const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5907
6436
  const len0 = WASM_VECTOR_LEN;
5908
- const ret = wasm.mol_from_pdb_conect(ptr0, len0, allow_extended_targets);
6437
+ const ret = wasm.mol_from_pdb_conect(ptr0, len0, val2);
5909
6438
  if (ret[2]) {
5910
6439
  throw takeFromExternrefTable0(ret[1]);
5911
6440
  }
@@ -6022,7 +6551,9 @@ export function mol_from_v3000_block(block) {
6022
6551
  /**
6023
6552
  * Parse an XYZ file and return a `MolHandle` (topology only; coordinates are discarded).
6024
6553
  *
6025
- * Returns a JS error on parse failure.
6554
+ * Returns a JS error on parse failure, nonfinite coordinates or a nonzero
6555
+ * decimal coordinate that rounds to binary64 zero. Literal signed zero and
6556
+ * finite subnormals remain valid.
6026
6557
  * @param {string} xyz
6027
6558
  * @returns {MolHandle}
6028
6559
  */
@@ -6124,9 +6655,10 @@ export function mol_with_atom_charge(mol, idx, charge) {
6124
6655
  */
6125
6656
  export function mol_with_atom_element(mol, idx, element_symbol) {
6126
6657
  _assertClass(mol, MolHandle);
6658
+ const val2 = +idx;
6127
6659
  const ptr0 = passStringToWasm0(element_symbol, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6128
6660
  const len0 = WASM_VECTOR_LEN;
6129
- const ret = wasm.mol_with_atom_element(mol.__wbg_ptr, idx, ptr0, len0);
6661
+ const ret = wasm.mol_with_atom_element(mol.__wbg_ptr, val2, ptr0, len0);
6130
6662
  if (ret[2]) {
6131
6663
  throw takeFromExternrefTable0(ret[1]);
6132
6664
  }
@@ -6142,9 +6674,10 @@ export function mol_with_atom_element(mol, idx, element_symbol) {
6142
6674
  */
6143
6675
  export function mol_with_atom_pseudo_label(mol, idx, label) {
6144
6676
  _assertClass(mol, MolHandle);
6677
+ const val2 = +idx;
6145
6678
  const ptr0 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6146
6679
  const len0 = WASM_VECTOR_LEN;
6147
- const ret = wasm.mol_with_atom_pseudo_label(mol.__wbg_ptr, idx, ptr0, len0);
6680
+ const ret = wasm.mol_with_atom_pseudo_label(mol.__wbg_ptr, val2, ptr0, len0);
6148
6681
  if (ret[2]) {
6149
6682
  throw takeFromExternrefTable0(ret[1]);
6150
6683
  }
@@ -6207,6 +6740,56 @@ export function mol_with_bond_removed(mol, idx) {
6207
6740
  return MolHandle.__wrap(ret[0]);
6208
6741
  }
6209
6742
 
6743
+ /**
6744
+ * @param {string} json
6745
+ * @returns {string}
6746
+ */
6747
+ export function molden_from_record_json(json) {
6748
+ let deferred3_0;
6749
+ let deferred3_1;
6750
+ try {
6751
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6752
+ const len0 = WASM_VECTOR_LEN;
6753
+ const ret = wasm.molden_from_record_json(ptr0, len0);
6754
+ var ptr2 = ret[0];
6755
+ var len2 = ret[1];
6756
+ if (ret[3]) {
6757
+ ptr2 = 0; len2 = 0;
6758
+ throw takeFromExternrefTable0(ret[2]);
6759
+ }
6760
+ deferred3_0 = ptr2;
6761
+ deferred3_1 = len2;
6762
+ return getStringFromWasm0(ptr2, len2);
6763
+ } finally {
6764
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
6765
+ }
6766
+ }
6767
+
6768
+ /**
6769
+ * @param {string} text
6770
+ * @returns {string}
6771
+ */
6772
+ export function molden_record_json(text) {
6773
+ let deferred3_0;
6774
+ let deferred3_1;
6775
+ try {
6776
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6777
+ const len0 = WASM_VECTOR_LEN;
6778
+ const ret = wasm.molden_record_json(ptr0, len0);
6779
+ var ptr2 = ret[0];
6780
+ var len2 = ret[1];
6781
+ if (ret[3]) {
6782
+ ptr2 = 0; len2 = 0;
6783
+ throw takeFromExternrefTable0(ret[2]);
6784
+ }
6785
+ deferred3_0 = ptr2;
6786
+ deferred3_1 = len2;
6787
+ return getStringFromWasm0(ptr2, len2);
6788
+ } finally {
6789
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
6790
+ }
6791
+ }
6792
+
6210
6793
  /**
6211
6794
  * Generate a complete molecular report (JSON string) from a SMILES.
6212
6795
  * Returns the JSON representation of a `MoleculeReport` struct.
@@ -6243,23 +6826,31 @@ export function molecule_report_json(smiles) {
6243
6826
 
6244
6827
  /**
6245
6828
  * Concrete CDX/CDXML fragment handles, in source fragment order.
6246
- * @param {Uint8Array} data
6829
+ * @param {Uint8Array | number[]} data
6247
6830
  * @param {string} format
6248
6831
  * @param {boolean} allow_metadata_loss
6249
6832
  * @returns {MolHandle[]}
6250
6833
  */
6251
6834
  export function mols_from_chemdraw_block(data, format, allow_metadata_loss) {
6252
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
6253
- const len0 = WASM_VECTOR_LEN;
6254
- const ptr1 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6255
- const len1 = WASM_VECTOR_LEN;
6256
- const ret = wasm.mols_from_chemdraw_block(ptr0, len0, ptr1, len1, allow_metadata_loss);
6835
+ const val3 = +allow_metadata_loss;
6836
+ let ptr0, len0, ptr1, len1;
6837
+ try {
6838
+ ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
6839
+ len0 = WASM_VECTOR_LEN;
6840
+ ptr1 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6841
+ len1 = WASM_VECTOR_LEN;
6842
+ } catch (e) {
6843
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
6844
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
6845
+ throw e;
6846
+ }
6847
+ const ret = wasm.mols_from_chemdraw_block(ptr0, len0, ptr1, len1, val3);
6257
6848
  if (ret[3]) {
6258
6849
  throw takeFromExternrefTable0(ret[2]);
6259
6850
  }
6260
- var v3 = getArrayJsValueFromWasm0(ret[0], ret[1]);
6851
+ var v4 = getArrayJsValueFromWasm0(ret[0], ret[1]);
6261
6852
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
6262
- return v3;
6853
+ return v4;
6263
6854
  }
6264
6855
 
6265
6856
  /**
@@ -6325,19 +6916,27 @@ export function murcko_scaffold(mol) {
6325
6916
  * @returns {string}
6326
6917
  */
6327
6918
  export function nearest_neighbors_json(query_smiles, db_smiles_json, k) {
6328
- let deferred3_0;
6329
- let deferred3_1;
6919
+ let deferred4_0;
6920
+ let deferred4_1;
6330
6921
  try {
6331
- const ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6332
- const len0 = WASM_VECTOR_LEN;
6333
- const ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6334
- const len1 = WASM_VECTOR_LEN;
6335
- const ret = wasm.nearest_neighbors_json(ptr0, len0, ptr1, len1, k);
6336
- deferred3_0 = ret[0];
6337
- deferred3_1 = ret[1];
6922
+ const val3 = +k;
6923
+ let ptr0, len0, ptr1, len1;
6924
+ try {
6925
+ ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6926
+ len0 = WASM_VECTOR_LEN;
6927
+ ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6928
+ len1 = WASM_VECTOR_LEN;
6929
+ } catch (e) {
6930
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
6931
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
6932
+ throw e;
6933
+ }
6934
+ const ret = wasm.nearest_neighbors_json(ptr0, len0, ptr1, len1, val3);
6935
+ deferred4_0 = ret[0];
6936
+ deferred4_1 = ret[1];
6338
6937
  return getStringFromWasm0(ret[0], ret[1]);
6339
6938
  } finally {
6340
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
6939
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
6341
6940
  }
6342
6941
  }
6343
6942
 
@@ -6381,6 +6980,35 @@ export function normalize_cxsmiles(s) {
6381
6980
  }
6382
6981
  }
6383
6982
 
6983
+ /**
6984
+ * Enhanced-atom-stereo reaction CXSMILES with group indices remapped after
6985
+ * component/atom ordering (RDKit #9732). Other CX fields are rejected.
6986
+ * @param {string} text
6987
+ * @param {boolean} canonical
6988
+ * @returns {string}
6989
+ */
6990
+ export function normalize_reaction_cxsmiles(text, canonical) {
6991
+ let deferred4_0;
6992
+ let deferred4_1;
6993
+ try {
6994
+ const val2 = +canonical;
6995
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6996
+ const len0 = WASM_VECTOR_LEN;
6997
+ const ret = wasm.normalize_reaction_cxsmiles(ptr0, len0, val2);
6998
+ var ptr3 = ret[0];
6999
+ var len3 = ret[1];
7000
+ if (ret[3]) {
7001
+ ptr3 = 0; len3 = 0;
7002
+ throw takeFromExternrefTable0(ret[2]);
7003
+ }
7004
+ deferred4_0 = ptr3;
7005
+ deferred4_1 = len3;
7006
+ return getStringFromWasm0(ptr3, len3);
7007
+ } finally {
7008
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
7009
+ }
7010
+ }
7011
+
6384
7012
  /**
6385
7013
  * Parse and re-serialise a reaction SMILES string, returning the normalised form.
6386
7014
  *
@@ -6421,10 +7049,17 @@ export function nucleic_acid_apply_json_command(document_json, command_json) {
6421
7049
  let deferred3_0;
6422
7050
  let deferred3_1;
6423
7051
  try {
6424
- const ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6425
- const len0 = WASM_VECTOR_LEN;
6426
- const ptr1 = passStringToWasm0(command_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6427
- const len1 = WASM_VECTOR_LEN;
7052
+ let ptr0, len0, ptr1, len1;
7053
+ try {
7054
+ ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7055
+ len0 = WASM_VECTOR_LEN;
7056
+ ptr1 = passStringToWasm0(command_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7057
+ len1 = WASM_VECTOR_LEN;
7058
+ } catch (e) {
7059
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
7060
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
7061
+ throw e;
7062
+ }
6428
7063
  const ret = wasm.nucleic_acid_apply_json_command(ptr0, len0, ptr1, len1);
6429
7064
  deferred3_0 = ret[0];
6430
7065
  deferred3_1 = ret[1];
@@ -6470,22 +7105,16 @@ export function num_hydrogens(mol) {
6470
7105
  }
6471
7106
 
6472
7107
  /**
6473
- * Parse an OpenDX (APBS scalar-field subset) file and return its full
6474
- * [`chematic_mol::VolumetricGrid`] as JSON (same shape as
6475
- * [`cube_grid_json`]; `atoms` is always empty -- OpenDX has no atom
6476
- * section). No `mol_from_opendx` is provided: an OpenDX grid never carries
6477
- * atoms, so a `MolHandle` from one would always be empty and is not a
6478
- * useful binding.
6479
- * @param {string} text
7108
+ * @param {string} json
6480
7109
  * @returns {string}
6481
7110
  */
6482
- export function opendx_grid_json(text) {
7111
+ export function nwchem_geometry_from_json(json) {
6483
7112
  let deferred3_0;
6484
7113
  let deferred3_1;
6485
7114
  try {
6486
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7115
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6487
7116
  const len0 = WASM_VECTOR_LEN;
6488
- const ret = wasm.opendx_grid_json(ptr0, len0);
7117
+ const ret = wasm.nwchem_geometry_from_json(ptr0, len0);
6489
7118
  var ptr2 = ret[0];
6490
7119
  var len2 = ret[1];
6491
7120
  if (ret[3]) {
@@ -6501,7 +7130,63 @@ export function opendx_grid_json(text) {
6501
7130
  }
6502
7131
 
6503
7132
  /**
6504
- * `[nx, ny, nz]` for an OpenDX file's grid, as a `Uint32Array`.
7133
+ * @param {string} text
7134
+ * @returns {string}
7135
+ */
7136
+ export function nwchem_geometry_json(text) {
7137
+ let deferred3_0;
7138
+ let deferred3_1;
7139
+ try {
7140
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7141
+ const len0 = WASM_VECTOR_LEN;
7142
+ const ret = wasm.nwchem_geometry_json(ptr0, len0);
7143
+ var ptr2 = ret[0];
7144
+ var len2 = ret[1];
7145
+ if (ret[3]) {
7146
+ ptr2 = 0; len2 = 0;
7147
+ throw takeFromExternrefTable0(ret[2]);
7148
+ }
7149
+ deferred3_0 = ptr2;
7150
+ deferred3_1 = len2;
7151
+ return getStringFromWasm0(ptr2, len2);
7152
+ } finally {
7153
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
7154
+ }
7155
+ }
7156
+
7157
+ /**
7158
+ * Parse an OpenDX (APBS scalar-field subset) file and return its full
7159
+ * [`chematic_mol::VolumetricGrid`] as JSON (same shape as
7160
+ * [`cube_grid_json`]; `atoms` is always empty -- OpenDX has no atom
7161
+ * section). No `mol_from_opendx` is provided: an OpenDX grid never carries
7162
+ * atoms, so a `MolHandle` from one would always be empty and is not a
7163
+ * useful binding.
7164
+ * @param {string} text
7165
+ * @returns {string}
7166
+ */
7167
+ export function opendx_grid_json(text) {
7168
+ let deferred3_0;
7169
+ let deferred3_1;
7170
+ try {
7171
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7172
+ const len0 = WASM_VECTOR_LEN;
7173
+ const ret = wasm.opendx_grid_json(ptr0, len0);
7174
+ var ptr2 = ret[0];
7175
+ var len2 = ret[1];
7176
+ if (ret[3]) {
7177
+ ptr2 = 0; len2 = 0;
7178
+ throw takeFromExternrefTable0(ret[2]);
7179
+ }
7180
+ deferred3_0 = ptr2;
7181
+ deferred3_1 = len2;
7182
+ return getStringFromWasm0(ptr2, len2);
7183
+ } finally {
7184
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
7185
+ }
7186
+ }
7187
+
7188
+ /**
7189
+ * `[nx, ny, nz]` for an OpenDX file's grid, as a `Uint32Array`.
6505
7190
  * @param {string} text
6506
7191
  * @returns {Uint32Array}
6507
7192
  */
@@ -6788,6 +7473,33 @@ export function parse_cxsmiles_json(s) {
6788
7473
  }
6789
7474
  }
6790
7475
 
7476
+ /**
7477
+ * Read a bounded fract record as editable JSON. All numeric fields are strings
7478
+ * retaining nominal precision and optional opaque uncertainty digits.
7479
+ * @param {string} text
7480
+ * @returns {string}
7481
+ */
7482
+ export function parse_fract_json(text) {
7483
+ let deferred3_0;
7484
+ let deferred3_1;
7485
+ try {
7486
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7487
+ const len0 = WASM_VECTOR_LEN;
7488
+ const ret = wasm.parse_fract_json(ptr0, len0);
7489
+ var ptr2 = ret[0];
7490
+ var len2 = ret[1];
7491
+ if (ret[3]) {
7492
+ ptr2 = 0; len2 = 0;
7493
+ throw takeFromExternrefTable0(ret[2]);
7494
+ }
7495
+ deferred3_0 = ptr2;
7496
+ deferred3_1 = len2;
7497
+ return getStringFromWasm0(ptr2, len2);
7498
+ } finally {
7499
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
7500
+ }
7501
+ }
7502
+
6791
7503
  /**
6792
7504
  * Inspect every ordered Cartesian job with UTF-8 byte ranges in the original source.
6793
7505
  * Coordinate units are unchanged; no inferred bonds or external resource reads.
@@ -6815,6 +7527,69 @@ export function parse_gjf_document_json(text) {
6815
7527
  }
6816
7528
  }
6817
7529
 
7530
+ /**
7531
+ * Read gpr 100 / one coordinate set as editable JSON. Coordinates stay in nm;
7532
+ * partial charges and all decimal tokens retain source representation.
7533
+ * @param {string} text
7534
+ * @returns {string}
7535
+ */
7536
+ export function parse_gpr_json(text) {
7537
+ let deferred3_0;
7538
+ let deferred3_1;
7539
+ try {
7540
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7541
+ const len0 = WASM_VECTOR_LEN;
7542
+ const ret = wasm.parse_gpr_json(ptr0, len0);
7543
+ var ptr2 = ret[0];
7544
+ var len2 = ret[1];
7545
+ if (ret[3]) {
7546
+ ptr2 = 0; len2 = 0;
7547
+ throw takeFromExternrefTable0(ret[2]);
7548
+ }
7549
+ deferred3_0 = ptr2;
7550
+ deferred3_1 = len2;
7551
+ return getStringFromWasm0(ptr2, len2);
7552
+ } finally {
7553
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
7554
+ }
7555
+ }
7556
+
7557
+ /**
7558
+ * Read geometry as editable JSON, with all blocks, fixed-width payload and caller-owned length-unit context.
7559
+ * @param {string} text
7560
+ * @param {string} length_unit
7561
+ * @returns {string}
7562
+ */
7563
+ export function parse_gromos96_json(text, length_unit) {
7564
+ let deferred4_0;
7565
+ let deferred4_1;
7566
+ try {
7567
+ let ptr0, len0, ptr1, len1;
7568
+ try {
7569
+ ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7570
+ len0 = WASM_VECTOR_LEN;
7571
+ ptr1 = passStringToWasm0(length_unit, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7572
+ len1 = WASM_VECTOR_LEN;
7573
+ } catch (e) {
7574
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
7575
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
7576
+ throw e;
7577
+ }
7578
+ const ret = wasm.parse_gromos96_json(ptr0, len0, ptr1, len1);
7579
+ var ptr3 = ret[0];
7580
+ var len3 = ret[1];
7581
+ if (ret[3]) {
7582
+ ptr3 = 0; len3 = 0;
7583
+ throw takeFromExternrefTable0(ret[2]);
7584
+ }
7585
+ deferred4_0 = ptr3;
7586
+ deferred4_1 = len3;
7587
+ return getStringFromWasm0(ptr3, len3);
7588
+ } finally {
7589
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
7590
+ }
7591
+ }
7592
+
6818
7593
  /**
6819
7594
  * Inspect the bounded HIN record, including literal aromatic bonds and charges.
6820
7595
  * @param {string} text
@@ -6841,6 +7616,32 @@ export function parse_hin_record_json(text) {
6841
7616
  }
6842
7617
  }
6843
7618
 
7619
+ /**
7620
+ * Read geometry as editable JSON, with raw decimal fields, all frames and column order.
7621
+ * @param {string} text
7622
+ * @returns {string}
7623
+ */
7624
+ export function parse_lpmd_json(text) {
7625
+ let deferred3_0;
7626
+ let deferred3_1;
7627
+ try {
7628
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7629
+ const len0 = WASM_VECTOR_LEN;
7630
+ const ret = wasm.parse_lpmd_json(ptr0, len0);
7631
+ var ptr2 = ret[0];
7632
+ var len2 = ret[1];
7633
+ if (ret[3]) {
7634
+ ptr2 = 0; len2 = 0;
7635
+ throw takeFromExternrefTable0(ret[2]);
7636
+ }
7637
+ deferred3_0 = ptr2;
7638
+ deferred3_1 = len2;
7639
+ return getStringFromWasm0(ptr2, len2);
7640
+ } finally {
7641
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
7642
+ }
7643
+ }
7644
+
6844
7645
  /**
6845
7646
  * Inspect partial charges, atom types and source retention for MOL2.
6846
7647
  * @param {string} text
@@ -6885,19 +7686,18 @@ export function parse_smiles(s) {
6885
7686
  }
6886
7687
 
6887
7688
  /**
6888
- * Indexed atoms/charges, bonds, coordinates and source serials for the same
6889
- * explicit CONECT projection. Molecular identity and coordinate order agree.
6890
- * @param {string} input
6891
- * @param {boolean} allow_extended_targets
7689
+ * Read a bounded UniChem XYZ record as editable JSON. Coordinate fields are decimal strings
7690
+ * retaining precision and signed zero in Angstrom.
7691
+ * @param {string} text
6892
7692
  * @returns {string}
6893
7693
  */
6894
- export function pdb_conect_frame_json(input, allow_extended_targets) {
7694
+ export function parse_unixyz_json(text) {
6895
7695
  let deferred3_0;
6896
7696
  let deferred3_1;
6897
7697
  try {
6898
- const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7698
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6899
7699
  const len0 = WASM_VECTOR_LEN;
6900
- const ret = wasm.pdb_conect_frame_json(ptr0, len0, allow_extended_targets);
7700
+ const ret = wasm.parse_unixyz_json(ptr0, len0);
6901
7701
  var ptr2 = ret[0];
6902
7702
  var len2 = ret[1];
6903
7703
  if (ret[3]) {
@@ -6912,6 +7712,61 @@ export function pdb_conect_frame_json(input, allow_extended_targets) {
6912
7712
  }
6913
7713
  }
6914
7714
 
7715
+ /**
7716
+ * Read geometry as editable JSON, with raw factor/coordinate strings and fixed axes.
7717
+ * @param {string} text
7718
+ * @returns {string}
7719
+ */
7720
+ export function parse_viewmol_json(text) {
7721
+ let deferred3_0;
7722
+ let deferred3_1;
7723
+ try {
7724
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7725
+ const len0 = WASM_VECTOR_LEN;
7726
+ const ret = wasm.parse_viewmol_json(ptr0, len0);
7727
+ var ptr2 = ret[0];
7728
+ var len2 = ret[1];
7729
+ if (ret[3]) {
7730
+ ptr2 = 0; len2 = 0;
7731
+ throw takeFromExternrefTable0(ret[2]);
7732
+ }
7733
+ deferred3_0 = ptr2;
7734
+ deferred3_1 = len2;
7735
+ return getStringFromWasm0(ptr2, len2);
7736
+ } finally {
7737
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
7738
+ }
7739
+ }
7740
+
7741
+ /**
7742
+ * Indexed atoms/charges, bonds, coordinates and source serials for the same
7743
+ * explicit CONECT projection. Molecular identity and coordinate order agree.
7744
+ * @param {string} input
7745
+ * @param {boolean} allow_extended_targets
7746
+ * @returns {string}
7747
+ */
7748
+ export function pdb_conect_frame_json(input, allow_extended_targets) {
7749
+ let deferred4_0;
7750
+ let deferred4_1;
7751
+ try {
7752
+ const val2 = +allow_extended_targets;
7753
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7754
+ const len0 = WASM_VECTOR_LEN;
7755
+ const ret = wasm.pdb_conect_frame_json(ptr0, len0, val2);
7756
+ var ptr3 = ret[0];
7757
+ var len3 = ret[1];
7758
+ if (ret[3]) {
7759
+ ptr3 = 0; len3 = 0;
7760
+ throw takeFromExternrefTable0(ret[2]);
7761
+ }
7762
+ deferred4_0 = ptr3;
7763
+ deferred4_1 = len3;
7764
+ return getStringFromWasm0(ptr3, len3);
7765
+ } finally {
7766
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
7767
+ }
7768
+ }
7769
+
6915
7770
  /**
6916
7771
  * Extract the atomic coordinates from a PDB block, in the SAME atom order
6917
7772
  * `mol_from_pdb` returns topology for (both read the identical underlying
@@ -7001,10 +7856,17 @@ export function periodic_structure_fingerprint_json(json, source) {
7001
7856
  let deferred3_0;
7002
7857
  let deferred3_1;
7003
7858
  try {
7004
- const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7005
- const len0 = WASM_VECTOR_LEN;
7006
- const ptr1 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7007
- const len1 = WASM_VECTOR_LEN;
7859
+ let ptr0, len0, ptr1, len1;
7860
+ try {
7861
+ ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7862
+ len0 = WASM_VECTOR_LEN;
7863
+ ptr1 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7864
+ len1 = WASM_VECTOR_LEN;
7865
+ } catch (e) {
7866
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
7867
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
7868
+ throw e;
7869
+ }
7008
7870
  const ret = wasm.periodic_structure_fingerprint_json(ptr0, len0, ptr1, len1);
7009
7871
  deferred3_0 = ret[0];
7010
7872
  deferred3_1 = ret[1];
@@ -7103,10 +7965,17 @@ export function pipeline_v2_stereo_safe_config_json(force_field, ring_torsion_po
7103
7965
  let deferred3_0;
7104
7966
  let deferred3_1;
7105
7967
  try {
7106
- const ptr0 = passStringToWasm0(force_field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7107
- const len0 = WASM_VECTOR_LEN;
7108
- const ptr1 = passStringToWasm0(ring_torsion_policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7109
- const len1 = WASM_VECTOR_LEN;
7968
+ let ptr0, len0, ptr1, len1;
7969
+ try {
7970
+ ptr0 = passStringToWasm0(force_field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7971
+ len0 = WASM_VECTOR_LEN;
7972
+ ptr1 = passStringToWasm0(ring_torsion_policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7973
+ len1 = WASM_VECTOR_LEN;
7974
+ } catch (e) {
7975
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
7976
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
7977
+ throw e;
7978
+ }
7110
7979
  const ret = wasm.pipeline_v2_stereo_safe_config_json(ptr0, len0, ptr1, len1);
7111
7980
  deferred3_0 = ret[0];
7112
7981
  deferred3_1 = ret[1];
@@ -7153,12 +8022,20 @@ export function pqr_coords_json(text) {
7153
8022
  * @returns {string | undefined}
7154
8023
  */
7155
8024
  export function pqr_infer_element(group_pdb, res_name, atom_name) {
7156
- const ptr0 = passStringToWasm0(group_pdb, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7157
- const len0 = WASM_VECTOR_LEN;
7158
- const ptr1 = passStringToWasm0(res_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7159
- const len1 = WASM_VECTOR_LEN;
7160
- const ptr2 = passStringToWasm0(atom_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7161
- const len2 = WASM_VECTOR_LEN;
8025
+ let ptr0, len0, ptr1, len1, ptr2, len2;
8026
+ try {
8027
+ ptr0 = passStringToWasm0(group_pdb, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8028
+ len0 = WASM_VECTOR_LEN;
8029
+ ptr1 = passStringToWasm0(res_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8030
+ len1 = WASM_VECTOR_LEN;
8031
+ ptr2 = passStringToWasm0(atom_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8032
+ len2 = WASM_VECTOR_LEN;
8033
+ } catch (e) {
8034
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
8035
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
8036
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
8037
+ throw e;
8038
+ }
7162
8039
  const ret = wasm.pqr_infer_element(ptr0, len0, ptr1, len1, ptr2, len2);
7163
8040
  let v4;
7164
8041
  if (ret[0] !== 0) {
@@ -7233,17 +8110,19 @@ export function predict_pka_json(smiles) {
7233
8110
  * @returns {string}
7234
8111
  */
7235
8112
  export function preflight_smiles_json(smiles, width, height) {
7236
- let deferred2_0;
7237
- let deferred2_1;
8113
+ let deferred4_0;
8114
+ let deferred4_1;
7238
8115
  try {
8116
+ const val2 = +width;
8117
+ const val3 = +height;
7239
8118
  const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7240
8119
  const len0 = WASM_VECTOR_LEN;
7241
- const ret = wasm.preflight_smiles_json(ptr0, len0, width, height);
7242
- deferred2_0 = ret[0];
7243
- deferred2_1 = ret[1];
8120
+ const ret = wasm.preflight_smiles_json(ptr0, len0, val2, val3);
8121
+ deferred4_0 = ret[0];
8122
+ deferred4_1 = ret[1];
7244
8123
  return getStringFromWasm0(ret[0], ret[1]);
7245
8124
  } finally {
7246
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
8125
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
7247
8126
  }
7248
8127
  }
7249
8128
 
@@ -7265,6 +8144,59 @@ export function prepare_rdkit_ecfp4(mol) {
7265
8144
  return PreparedRdkitEcfp4Handle.__wrap(ret[0]);
7266
8145
  }
7267
8146
 
8147
+ /**
8148
+ * Checked local CJSON graph/Cartesian/name projection; throws on opaque
8149
+ * fields, partial charges or conflicting names. No source chemistry validation.
8150
+ * @param {string} text
8151
+ * @returns {string}
8152
+ */
8153
+ export function project_cjson_to_cml(text) {
8154
+ let deferred3_0;
8155
+ let deferred3_1;
8156
+ try {
8157
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8158
+ const len0 = WASM_VECTOR_LEN;
8159
+ const ret = wasm.project_cjson_to_cml(ptr0, len0);
8160
+ var ptr2 = ret[0];
8161
+ var len2 = ret[1];
8162
+ if (ret[3]) {
8163
+ ptr2 = 0; len2 = 0;
8164
+ throw takeFromExternrefTable0(ret[2]);
8165
+ }
8166
+ deferred3_0 = ptr2;
8167
+ deferred3_1 = len2;
8168
+ return getStringFromWasm0(ptr2, len2);
8169
+ } finally {
8170
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8171
+ }
8172
+ }
8173
+
8174
+ /**
8175
+ * Checked CML graph/Cartesian/name profile; refuses unrepresented payload.
8176
+ * @param {string} text
8177
+ * @returns {string}
8178
+ */
8179
+ export function project_cml_to_cjson(text) {
8180
+ let deferred3_0;
8181
+ let deferred3_1;
8182
+ try {
8183
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8184
+ const len0 = WASM_VECTOR_LEN;
8185
+ const ret = wasm.project_cml_to_cjson(ptr0, len0);
8186
+ var ptr2 = ret[0];
8187
+ var len2 = ret[1];
8188
+ if (ret[3]) {
8189
+ ptr2 = 0; len2 = 0;
8190
+ throw takeFromExternrefTable0(ret[2]);
8191
+ }
8192
+ deferred3_0 = ptr2;
8193
+ deferred3_1 = len2;
8194
+ return getStringFromWasm0(ptr2, len2);
8195
+ } finally {
8196
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8197
+ }
8198
+ }
8199
+
7268
8200
  /**
7269
8201
  * Amino-acid-only mmCIF projection in the same schema as
7270
8202
  * [`protein_from_pdb_json`].
@@ -7430,23 +8362,25 @@ export function qcschema_validate_atomic_result(json) {
7430
8362
  * @returns {string}
7431
8363
  */
7432
8364
  export function random_smiles_json(smiles, count, seed) {
7433
- let deferred3_0;
7434
- let deferred3_1;
8365
+ let deferred5_0;
8366
+ let deferred5_1;
7435
8367
  try {
8368
+ const val2 = +count;
8369
+ const val3 = BigInt.asIntN(64, seed);
7436
8370
  const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7437
8371
  const len0 = WASM_VECTOR_LEN;
7438
- const ret = wasm.random_smiles_json(ptr0, len0, count, seed);
7439
- var ptr2 = ret[0];
7440
- var len2 = ret[1];
8372
+ const ret = wasm.random_smiles_json(ptr0, len0, val2, val3);
8373
+ var ptr4 = ret[0];
8374
+ var len4 = ret[1];
7441
8375
  if (ret[3]) {
7442
- ptr2 = 0; len2 = 0;
8376
+ ptr4 = 0; len4 = 0;
7443
8377
  throw takeFromExternrefTable0(ret[2]);
7444
8378
  }
7445
- deferred3_0 = ptr2;
7446
- deferred3_1 = len2;
7447
- return getStringFromWasm0(ptr2, len2);
8379
+ deferred5_0 = ptr4;
8380
+ deferred5_1 = len4;
8381
+ return getStringFromWasm0(ptr4, len4);
7448
8382
  } finally {
7449
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8383
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
7450
8384
  }
7451
8385
  }
7452
8386
 
@@ -7469,6 +8403,36 @@ export function rdkit_atom_code(mol, atom_index, branch_subtract) {
7469
8403
  return ret[0] >>> 0;
7470
8404
  }
7471
8405
 
8406
+ /**
8407
+ * Return packed bits, folded counts and unhashed counts for 2D Atom Pair.
8408
+ * The JSON options are optional. Set `countBounds` to null to disable count
8409
+ * simulation. Counts are returned as sorted [identifier, count] arrays.
8410
+ * @param {MolHandle} mol
8411
+ * @param {string} options_json
8412
+ * @returns {string}
8413
+ */
8414
+ export function rdkit_atom_pair_config_detail_json(mol, options_json) {
8415
+ let deferred3_0;
8416
+ let deferred3_1;
8417
+ try {
8418
+ _assertClass(mol, MolHandle);
8419
+ const ptr0 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8420
+ const len0 = WASM_VECTOR_LEN;
8421
+ const ret = wasm.rdkit_atom_pair_config_detail_json(mol.__wbg_ptr, ptr0, len0);
8422
+ var ptr2 = ret[0];
8423
+ var len2 = ret[1];
8424
+ if (ret[3]) {
8425
+ ptr2 = 0; len2 = 0;
8426
+ throw takeFromExternrefTable0(ret[2]);
8427
+ }
8428
+ deferred3_0 = ptr2;
8429
+ deferred3_1 = len2;
8430
+ return getStringFromWasm0(ptr2, len2);
8431
+ } finally {
8432
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8433
+ }
8434
+ }
8435
+
7472
8436
  /**
7473
8437
  * RDKit-bit-exact ECFP4 (radius=2, 2048 bits, `useChirality=false`, `useBondTypes=true`,
7474
8438
  * RDKit's default atom invariant) as a bit-packed byte vector (256 bytes = 2048 bits).
@@ -7638,9 +8602,12 @@ export function rdkit_ecfp_config_detail_json(mol, radius, nbits) {
7638
8602
  * @returns {RdkitReadResult}
7639
8603
  */
7640
8604
  export function rdkit_from_mol2_block(text, sanitize, remove_hs, cleanup_substructures) {
8605
+ const val2 = +sanitize;
8606
+ const val3 = +remove_hs;
8607
+ const val4 = +cleanup_substructures;
7641
8608
  const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7642
8609
  const len0 = WASM_VECTOR_LEN;
7643
- const ret = wasm.rdkit_from_mol2_block(ptr0, len0, sanitize, remove_hs, cleanup_substructures);
8610
+ const ret = wasm.rdkit_from_mol2_block(ptr0, len0, val2, val3, val4);
7644
8611
  if (ret[2]) {
7645
8612
  throw takeFromExternrefTable0(ret[1]);
7646
8613
  }
@@ -7657,9 +8624,13 @@ export function rdkit_from_mol2_block(text, sanitize, remove_hs, cleanup_substru
7657
8624
  * @returns {RdkitReadResult}
7658
8625
  */
7659
8626
  export function rdkit_from_pdb_block(text, sanitize, remove_hs, flavor, proximity_bonding) {
8627
+ const val2 = +sanitize;
8628
+ const val3 = +remove_hs;
8629
+ const val4 = +flavor;
8630
+ const val5 = +proximity_bonding;
7660
8631
  const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7661
8632
  const len0 = WASM_VECTOR_LEN;
7662
- const ret = wasm.rdkit_from_pdb_block(ptr0, len0, sanitize, remove_hs, flavor, proximity_bonding);
8633
+ const ret = wasm.rdkit_from_pdb_block(ptr0, len0, val2, val3, val4, val5);
7663
8634
  if (ret[2]) {
7664
8635
  throw takeFromExternrefTable0(ret[1]);
7665
8636
  }
@@ -7681,6 +8652,36 @@ export function rdkit_from_xyz_block(text) {
7681
8652
  return RdkitReadResult.__wrap(ret[0]);
7682
8653
  }
7683
8654
 
8655
+ /**
8656
+ * Return the configured RDKit Layered fingerprint and per-atom counters as JSON.
8657
+ * Pass `{}` for defaults. `setOnlyBits` is an optional LSB-first packed byte
8658
+ * array, and `atomCounts` optionally seeds the returned u32 counters.
8659
+ * @param {MolHandle} mol
8660
+ * @param {string} options_json
8661
+ * @returns {string}
8662
+ */
8663
+ export function rdkit_layered_config_detail_json(mol, options_json) {
8664
+ let deferred3_0;
8665
+ let deferred3_1;
8666
+ try {
8667
+ _assertClass(mol, MolHandle);
8668
+ const ptr0 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8669
+ const len0 = WASM_VECTOR_LEN;
8670
+ const ret = wasm.rdkit_layered_config_detail_json(mol.__wbg_ptr, ptr0, len0);
8671
+ var ptr2 = ret[0];
8672
+ var len2 = ret[1];
8673
+ if (ret[3]) {
8674
+ ptr2 = 0; len2 = 0;
8675
+ throw takeFromExternrefTable0(ret[2]);
8676
+ }
8677
+ deferred3_0 = ptr2;
8678
+ deferred3_1 = len2;
8679
+ return getStringFromWasm0(ptr2, len2);
8680
+ } finally {
8681
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8682
+ }
8683
+ }
8684
+
7684
8685
  /**
7685
8686
  * Find the k nearest neighbours using the RDKit-compatible Morgan/ECFP4
7686
8687
  * profile. This is intentionally separate from [`nearest_neighbors_json`],
@@ -7695,19 +8696,27 @@ export function rdkit_from_xyz_block(text) {
7695
8696
  * @returns {string}
7696
8697
  */
7697
8698
  export function rdkit_nearest_neighbors_json(query_smiles, db_smiles_json, k) {
7698
- let deferred3_0;
7699
- let deferred3_1;
8699
+ let deferred4_0;
8700
+ let deferred4_1;
7700
8701
  try {
7701
- const ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7702
- const len0 = WASM_VECTOR_LEN;
7703
- const ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7704
- const len1 = WASM_VECTOR_LEN;
7705
- const ret = wasm.rdkit_nearest_neighbors_json(ptr0, len0, ptr1, len1, k);
7706
- deferred3_0 = ret[0];
7707
- deferred3_1 = ret[1];
8702
+ const val3 = +k;
8703
+ let ptr0, len0, ptr1, len1;
8704
+ try {
8705
+ ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8706
+ len0 = WASM_VECTOR_LEN;
8707
+ ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8708
+ len1 = WASM_VECTOR_LEN;
8709
+ } catch (e) {
8710
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
8711
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
8712
+ throw e;
8713
+ }
8714
+ const ret = wasm.rdkit_nearest_neighbors_json(ptr0, len0, ptr1, len1, val3);
8715
+ deferred4_0 = ret[0];
8716
+ deferred4_1 = ret[1];
7708
8717
  return getStringFromWasm0(ret[0], ret[1]);
7709
8718
  } finally {
7710
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8719
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
7711
8720
  }
7712
8721
  }
7713
8722
 
@@ -7747,7 +8756,7 @@ export function rdkit_rdk_bitvec(mol) {
7747
8756
  * containing one of `ignored_atoms` is excluded. Invalid indices return a JS
7748
8757
  * error; an empty list is bit-identical to [`rdkit_rdk_bitvec`].
7749
8758
  * @param {MolHandle} mol
7750
- * @param {Uint32Array} ignored_atoms
8759
+ * @param {Uint32Array | number[]} ignored_atoms
7751
8760
  * @returns {Uint8Array}
7752
8761
  */
7753
8762
  export function rdkit_rdk_bitvec_ignoring_atoms(mol, ignored_atoms) {
@@ -7763,6 +8772,36 @@ export function rdkit_rdk_bitvec_ignoring_atoms(mol, ignored_atoms) {
7763
8772
  return v2;
7764
8773
  }
7765
8774
 
8775
+ /**
8776
+ * Packed RDK bits and folded and sparse counts, using input atom indices.
8777
+ * A supplied `countBounds` array enables count simulation for the bit vector.
8778
+ * Packed bytes are LSB-first and counts are sorted [identifier, count] pairs.
8779
+ * @param {MolHandle} mol
8780
+ * @param {string} options_json
8781
+ * @returns {string}
8782
+ */
8783
+ export function rdkit_rdk_config_detail_json(mol, options_json) {
8784
+ let deferred3_0;
8785
+ let deferred3_1;
8786
+ try {
8787
+ _assertClass(mol, MolHandle);
8788
+ const ptr0 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8789
+ const len0 = WASM_VECTOR_LEN;
8790
+ const ret = wasm.rdkit_rdk_config_detail_json(mol.__wbg_ptr, ptr0, len0);
8791
+ var ptr2 = ret[0];
8792
+ var len2 = ret[1];
8793
+ if (ret[3]) {
8794
+ ptr2 = 0; len2 = 0;
8795
+ throw takeFromExternrefTable0(ret[2]);
8796
+ }
8797
+ deferred3_0 = ptr2;
8798
+ deferred3_1 = len2;
8799
+ return getStringFromWasm0(ptr2, len2);
8800
+ } finally {
8801
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8802
+ }
8803
+ }
8804
+
7766
8805
  /**
7767
8806
  * Pack a JSON array of atom indices into RDKit's legacy torsion code.
7768
8807
  *
@@ -7809,6 +8848,36 @@ export function rdkit_torsion_bitvec(mol) {
7809
8848
  return v1;
7810
8849
  }
7811
8850
 
8851
+ /**
8852
+ * Return packed bits, folded counts and unhashed Topological Torsion counts.
8853
+ * Pass JSON options or `{}` for defaults. A null `countBounds` disables
8854
+ * simulation. Sparse identifiers are decimal strings to retain all 64 bits.
8855
+ * @param {MolHandle} mol
8856
+ * @param {string} options_json
8857
+ * @returns {string}
8858
+ */
8859
+ export function rdkit_torsion_config_detail_json(mol, options_json) {
8860
+ let deferred3_0;
8861
+ let deferred3_1;
8862
+ try {
8863
+ _assertClass(mol, MolHandle);
8864
+ const ptr0 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8865
+ const len0 = WASM_VECTOR_LEN;
8866
+ const ret = wasm.rdkit_torsion_config_detail_json(mol.__wbg_ptr, ptr0, len0);
8867
+ var ptr2 = ret[0];
8868
+ var len2 = ret[1];
8869
+ if (ret[3]) {
8870
+ ptr2 = 0; len2 = 0;
8871
+ throw takeFromExternrefTable0(ret[2]);
8872
+ }
8873
+ deferred3_0 = ptr2;
8874
+ deferred3_1 = len2;
8875
+ return getStringFromWasm0(ptr2, len2);
8876
+ } finally {
8877
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8878
+ }
8879
+ }
8880
+
7812
8881
  /**
7813
8882
  * Validate and deterministically serialize a rich reaction document JSON.
7814
8883
  *
@@ -7878,10 +8947,17 @@ export function reaction_document_to_rxn_v1(document_json) {
7878
8947
  * @returns {boolean}
7879
8948
  */
7880
8949
  export function reaction_smarts_match(smarts, reaction_smiles) {
7881
- const ptr0 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7882
- const len0 = WASM_VECTOR_LEN;
7883
- const ptr1 = passStringToWasm0(reaction_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7884
- const len1 = WASM_VECTOR_LEN;
8950
+ let ptr0, len0, ptr1, len1;
8951
+ try {
8952
+ ptr0 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8953
+ len0 = WASM_VECTOR_LEN;
8954
+ ptr1 = passStringToWasm0(reaction_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8955
+ len1 = WASM_VECTOR_LEN;
8956
+ } catch (e) {
8957
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
8958
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
8959
+ throw e;
8960
+ }
7885
8961
  const ret = wasm.reaction_smarts_match(ptr0, len0, ptr1, len1);
7886
8962
  if (ret[2]) {
7887
8963
  throw takeFromExternrefTable0(ret[1]);
@@ -7947,24 +9023,25 @@ export function remove_redundant_tetrahedral_stereo(mol, atom_index, max_visits)
7947
9023
  * @returns {string}
7948
9024
  */
7949
9025
  export function retro_disconnect_json(mol, max_results, reaction_class) {
7950
- let deferred3_0;
7951
- let deferred3_1;
9026
+ let deferred4_0;
9027
+ let deferred4_1;
7952
9028
  try {
7953
9029
  _assertClass(mol, MolHandle);
9030
+ const val2 = +max_results;
7954
9031
  const ptr0 = passStringToWasm0(reaction_class, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7955
9032
  const len0 = WASM_VECTOR_LEN;
7956
- const ret = wasm.retro_disconnect_json(mol.__wbg_ptr, max_results, ptr0, len0);
7957
- var ptr2 = ret[0];
7958
- var len2 = ret[1];
9033
+ const ret = wasm.retro_disconnect_json(mol.__wbg_ptr, val2, ptr0, len0);
9034
+ var ptr3 = ret[0];
9035
+ var len3 = ret[1];
7959
9036
  if (ret[3]) {
7960
- ptr2 = 0; len2 = 0;
9037
+ ptr3 = 0; len3 = 0;
7961
9038
  throw takeFromExternrefTable0(ret[2]);
7962
9039
  }
7963
- deferred3_0 = ptr2;
7964
- deferred3_1 = len2;
7965
- return getStringFromWasm0(ptr2, len2);
9040
+ deferred4_0 = ptr3;
9041
+ deferred4_1 = len3;
9042
+ return getStringFromWasm0(ptr3, len3);
7966
9043
  } finally {
7967
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
9044
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
7968
9045
  }
7969
9046
  }
7970
9047
 
@@ -7985,10 +9062,17 @@ export function rgroup_decompose_columns_json(smiles_json, core_smarts) {
7985
9062
  let deferred4_0;
7986
9063
  let deferred4_1;
7987
9064
  try {
7988
- const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7989
- const len0 = WASM_VECTOR_LEN;
7990
- const ptr1 = passStringToWasm0(core_smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7991
- const len1 = WASM_VECTOR_LEN;
9065
+ let ptr0, len0, ptr1, len1;
9066
+ try {
9067
+ ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9068
+ len0 = WASM_VECTOR_LEN;
9069
+ ptr1 = passStringToWasm0(core_smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9070
+ len1 = WASM_VECTOR_LEN;
9071
+ } catch (e) {
9072
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9073
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9074
+ throw e;
9075
+ }
7992
9076
  const ret = wasm.rgroup_decompose_columns_json(ptr0, len0, ptr1, len1);
7993
9077
  var ptr3 = ret[0];
7994
9078
  var len3 = ret[1];
@@ -8032,10 +9116,17 @@ export function rgroup_decompose_json(smiles_json, core_smarts) {
8032
9116
  let deferred4_0;
8033
9117
  let deferred4_1;
8034
9118
  try {
8035
- const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8036
- const len0 = WASM_VECTOR_LEN;
8037
- const ptr1 = passStringToWasm0(core_smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8038
- const len1 = WASM_VECTOR_LEN;
9119
+ let ptr0, len0, ptr1, len1;
9120
+ try {
9121
+ ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9122
+ len0 = WASM_VECTOR_LEN;
9123
+ ptr1 = passStringToWasm0(core_smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9124
+ len1 = WASM_VECTOR_LEN;
9125
+ } catch (e) {
9126
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9127
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9128
+ throw e;
9129
+ }
8039
9130
  const ret = wasm.rgroup_decompose_json(ptr0, len0, ptr1, len1);
8040
9131
  var ptr3 = ret[0];
8041
9132
  var len3 = ret[1];
@@ -8066,29 +9157,57 @@ export function ring_families_json(mol) {
8066
9157
  var ptr1 = ret[0];
8067
9158
  var len1 = ret[1];
8068
9159
  if (ret[3]) {
8069
- ptr1 = 0; len1 = 0;
9160
+ ptr1 = 0; len1 = 0;
9161
+ throw takeFromExternrefTable0(ret[2]);
9162
+ }
9163
+ deferred2_0 = ptr1;
9164
+ deferred2_1 = len1;
9165
+ return getStringFromWasm0(ptr1, len1);
9166
+ } finally {
9167
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
9168
+ }
9169
+ }
9170
+
9171
+ /**
9172
+ * Validate the local CJSON profile and retain the exact UTF-8 source.
9173
+ * @param {string} text
9174
+ * @returns {string}
9175
+ */
9176
+ export function roundtrip_cjson_record(text) {
9177
+ let deferred3_0;
9178
+ let deferred3_1;
9179
+ try {
9180
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9181
+ const len0 = WASM_VECTOR_LEN;
9182
+ const ret = wasm.roundtrip_cjson_record(ptr0, len0);
9183
+ var ptr2 = ret[0];
9184
+ var len2 = ret[1];
9185
+ if (ret[3]) {
9186
+ ptr2 = 0; len2 = 0;
8070
9187
  throw takeFromExternrefTable0(ret[2]);
8071
9188
  }
8072
- deferred2_0 = ptr1;
8073
- deferred2_1 = len1;
8074
- return getStringFromWasm0(ptr1, len1);
9189
+ deferred3_0 = ptr2;
9190
+ deferred3_1 = len2;
9191
+ return getStringFromWasm0(ptr2, len2);
8075
9192
  } finally {
8076
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
9193
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8077
9194
  }
8078
9195
  }
8079
9196
 
8080
9197
  /**
8081
- * Validate the local CJSON profile and retain the exact UTF-8 source.
9198
+ * Exact bounded XML 1.0 CML source retention. Requires one CML-namespace
9199
+ * molecule root; rejects nested molecules/DTDs. Chemistry, references and
9200
+ * stereo remain opaque, with no interpretation or schema validation promised.
8082
9201
  * @param {string} text
8083
9202
  * @returns {string}
8084
9203
  */
8085
- export function roundtrip_cjson_record(text) {
9204
+ export function roundtrip_cml_source(text) {
8086
9205
  let deferred3_0;
8087
9206
  let deferred3_1;
8088
9207
  try {
8089
9208
  const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8090
9209
  const len0 = WASM_VECTOR_LEN;
8091
- const ret = wasm.roundtrip_cjson_record(ptr0, len0);
9210
+ const ret = wasm.roundtrip_cml_source(ptr0, len0);
8092
9211
  var ptr2 = ret[0];
8093
9212
  var len2 = ret[1];
8094
9213
  if (ret[3]) {
@@ -8285,10 +9404,17 @@ export function run_reactants(smirks, reactants_smiles) {
8285
9404
  let deferred4_0;
8286
9405
  let deferred4_1;
8287
9406
  try {
8288
- const ptr0 = passStringToWasm0(smirks, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8289
- const len0 = WASM_VECTOR_LEN;
8290
- const ptr1 = passStringToWasm0(reactants_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8291
- const len1 = WASM_VECTOR_LEN;
9407
+ let ptr0, len0, ptr1, len1;
9408
+ try {
9409
+ ptr0 = passStringToWasm0(smirks, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9410
+ len0 = WASM_VECTOR_LEN;
9411
+ ptr1 = passStringToWasm0(reactants_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9412
+ len1 = WASM_VECTOR_LEN;
9413
+ } catch (e) {
9414
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9415
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9416
+ throw e;
9417
+ }
8292
9418
  const ret = wasm.run_reactants(ptr0, len0, ptr1, len1);
8293
9419
  var ptr3 = ret[0];
8294
9420
  var len3 = ret[1];
@@ -8328,19 +9454,27 @@ export function run_reactants(smirks, reactants_smiles) {
8328
9454
  * @returns {string}
8329
9455
  */
8330
9456
  export function run_reactants_checked(smirks, reactants_smiles, rdkit_compat) {
8331
- let deferred3_0;
8332
- let deferred3_1;
9457
+ let deferred4_0;
9458
+ let deferred4_1;
8333
9459
  try {
8334
- const ptr0 = passStringToWasm0(smirks, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8335
- const len0 = WASM_VECTOR_LEN;
8336
- const ptr1 = passStringToWasm0(reactants_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8337
- const len1 = WASM_VECTOR_LEN;
8338
- const ret = wasm.run_reactants_checked(ptr0, len0, ptr1, len1, rdkit_compat);
8339
- deferred3_0 = ret[0];
8340
- deferred3_1 = ret[1];
9460
+ const val3 = +rdkit_compat;
9461
+ let ptr0, len0, ptr1, len1;
9462
+ try {
9463
+ ptr0 = passStringToWasm0(smirks, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9464
+ len0 = WASM_VECTOR_LEN;
9465
+ ptr1 = passStringToWasm0(reactants_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9466
+ len1 = WASM_VECTOR_LEN;
9467
+ } catch (e) {
9468
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9469
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9470
+ throw e;
9471
+ }
9472
+ const ret = wasm.run_reactants_checked(ptr0, len0, ptr1, len1, val3);
9473
+ deferred4_0 = ret[0];
9474
+ deferred4_1 = ret[1];
8341
9475
  return getStringFromWasm0(ret[0], ret[1]);
8342
9476
  } finally {
8343
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
9477
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
8344
9478
  }
8345
9479
  }
8346
9480
 
@@ -8433,10 +9567,17 @@ export function screen_smiles_json(smiles_batch, delimiter) {
8433
9567
  let deferred3_0;
8434
9568
  let deferred3_1;
8435
9569
  try {
8436
- const ptr0 = passStringToWasm0(smiles_batch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8437
- const len0 = WASM_VECTOR_LEN;
8438
- const ptr1 = passStringToWasm0(delimiter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8439
- const len1 = WASM_VECTOR_LEN;
9570
+ let ptr0, len0, ptr1, len1;
9571
+ try {
9572
+ ptr0 = passStringToWasm0(smiles_batch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9573
+ len0 = WASM_VECTOR_LEN;
9574
+ ptr1 = passStringToWasm0(delimiter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9575
+ len1 = WASM_VECTOR_LEN;
9576
+ } catch (e) {
9577
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9578
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9579
+ throw e;
9580
+ }
8440
9581
  const ret = wasm.screen_smiles_json(ptr0, len0, ptr1, len1);
8441
9582
  deferred3_0 = ret[0];
8442
9583
  deferred3_1 = ret[1];
@@ -8470,12 +9611,20 @@ export function sdf_from_records_json(smiles_json, names_json, props_json) {
8470
9611
  let deferred5_0;
8471
9612
  let deferred5_1;
8472
9613
  try {
8473
- const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8474
- const len0 = WASM_VECTOR_LEN;
8475
- const ptr1 = passStringToWasm0(names_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8476
- const len1 = WASM_VECTOR_LEN;
8477
- const ptr2 = passStringToWasm0(props_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8478
- const len2 = WASM_VECTOR_LEN;
9614
+ let ptr0, len0, ptr1, len1, ptr2, len2;
9615
+ try {
9616
+ ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9617
+ len0 = WASM_VECTOR_LEN;
9618
+ ptr1 = passStringToWasm0(names_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9619
+ len1 = WASM_VECTOR_LEN;
9620
+ ptr2 = passStringToWasm0(props_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9621
+ len2 = WASM_VECTOR_LEN;
9622
+ } catch (e) {
9623
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
9624
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9625
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9626
+ throw e;
9627
+ }
8479
9628
  const ret = wasm.sdf_from_records_json(ptr0, len0, ptr1, len1, ptr2, len2);
8480
9629
  var ptr4 = ret[0];
8481
9630
  var len4 = ret[1];
@@ -8504,23 +9653,25 @@ export function sdf_from_records_json(smiles_json, names_json, props_json) {
8504
9653
  * @returns {string}
8505
9654
  */
8506
9655
  export function sdf_records_batch_json(sdf, offset, batch_size) {
8507
- let deferred3_0;
8508
- let deferred3_1;
9656
+ let deferred5_0;
9657
+ let deferred5_1;
8509
9658
  try {
9659
+ const val2 = +offset;
9660
+ const val3 = +batch_size;
8510
9661
  const ptr0 = passStringToWasm0(sdf, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8511
9662
  const len0 = WASM_VECTOR_LEN;
8512
- const ret = wasm.sdf_records_batch_json(ptr0, len0, offset, batch_size);
8513
- var ptr2 = ret[0];
8514
- var len2 = ret[1];
9663
+ const ret = wasm.sdf_records_batch_json(ptr0, len0, val2, val3);
9664
+ var ptr4 = ret[0];
9665
+ var len4 = ret[1];
8515
9666
  if (ret[3]) {
8516
- ptr2 = 0; len2 = 0;
9667
+ ptr4 = 0; len4 = 0;
8517
9668
  throw takeFromExternrefTable0(ret[2]);
8518
9669
  }
8519
- deferred3_0 = ptr2;
8520
- deferred3_1 = len2;
8521
- return getStringFromWasm0(ptr2, len2);
9670
+ deferred5_0 = ptr4;
9671
+ deferred5_1 = len4;
9672
+ return getStringFromWasm0(ptr4, len4);
8522
9673
  } finally {
8523
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
9674
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
8524
9675
  }
8525
9676
  }
8526
9677
 
@@ -8588,10 +9739,17 @@ export function semantic_apply_json_command(model_json, command_json) {
8588
9739
  let deferred4_0;
8589
9740
  let deferred4_1;
8590
9741
  try {
8591
- const ptr0 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8592
- const len0 = WASM_VECTOR_LEN;
8593
- const ptr1 = passStringToWasm0(command_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8594
- const len1 = WASM_VECTOR_LEN;
9742
+ let ptr0, len0, ptr1, len1;
9743
+ try {
9744
+ ptr0 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9745
+ len0 = WASM_VECTOR_LEN;
9746
+ ptr1 = passStringToWasm0(command_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9747
+ len1 = WASM_VECTOR_LEN;
9748
+ } catch (e) {
9749
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9750
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9751
+ throw e;
9752
+ }
8595
9753
  const ret = wasm.semantic_apply_json_command(ptr0, len0, ptr1, len1);
8596
9754
  var ptr3 = ret[0];
8597
9755
  var len3 = ret[1];
@@ -8618,10 +9776,17 @@ export function semantic_expand_json(base_smiles, model_json) {
8618
9776
  let deferred4_0;
8619
9777
  let deferred4_1;
8620
9778
  try {
8621
- const ptr0 = passStringToWasm0(base_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8622
- const len0 = WASM_VECTOR_LEN;
8623
- const ptr1 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8624
- const len1 = WASM_VECTOR_LEN;
9779
+ let ptr0, len0, ptr1, len1;
9780
+ try {
9781
+ ptr0 = passStringToWasm0(base_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9782
+ len0 = WASM_VECTOR_LEN;
9783
+ ptr1 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9784
+ len1 = WASM_VECTOR_LEN;
9785
+ } catch (e) {
9786
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9787
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9788
+ throw e;
9789
+ }
8625
9790
  const ret = wasm.semantic_expand_json(ptr0, len0, ptr1, len1);
8626
9791
  var ptr3 = ret[0];
8627
9792
  var len3 = ret[1];
@@ -8646,25 +9811,34 @@ export function semantic_expand_json(base_smiles, model_json) {
8646
9811
  * @returns {string}
8647
9812
  */
8648
9813
  export function semantic_expand_json_with_limits(base_smiles, model_json, max_atoms, max_repeat_count) {
8649
- let deferred4_0;
8650
- let deferred4_1;
9814
+ let deferred6_0;
9815
+ let deferred6_1;
8651
9816
  try {
8652
- const ptr0 = passStringToWasm0(base_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8653
- const len0 = WASM_VECTOR_LEN;
8654
- const ptr1 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8655
- const len1 = WASM_VECTOR_LEN;
8656
- const ret = wasm.semantic_expand_json_with_limits(ptr0, len0, ptr1, len1, max_atoms, max_repeat_count);
8657
- var ptr3 = ret[0];
8658
- var len3 = ret[1];
9817
+ const val3 = +max_atoms;
9818
+ const val4 = +max_repeat_count;
9819
+ let ptr0, len0, ptr1, len1;
9820
+ try {
9821
+ ptr0 = passStringToWasm0(base_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9822
+ len0 = WASM_VECTOR_LEN;
9823
+ ptr1 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9824
+ len1 = WASM_VECTOR_LEN;
9825
+ } catch (e) {
9826
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9827
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9828
+ throw e;
9829
+ }
9830
+ const ret = wasm.semantic_expand_json_with_limits(ptr0, len0, ptr1, len1, val3, val4);
9831
+ var ptr5 = ret[0];
9832
+ var len5 = ret[1];
8659
9833
  if (ret[3]) {
8660
- ptr3 = 0; len3 = 0;
9834
+ ptr5 = 0; len5 = 0;
8661
9835
  throw takeFromExternrefTable0(ret[2]);
8662
9836
  }
8663
- deferred4_0 = ptr3;
8664
- deferred4_1 = len3;
8665
- return getStringFromWasm0(ptr3, len3);
9837
+ deferred6_0 = ptr5;
9838
+ deferred6_1 = len5;
9839
+ return getStringFromWasm0(ptr5, len5);
8666
9840
  } finally {
8667
- wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
9841
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
8668
9842
  }
8669
9843
  }
8670
9844
 
@@ -8708,24 +9882,28 @@ export function semantic_model_json(model_json) {
8708
9882
  * @returns {string}
8709
9883
  */
8710
9884
  export function set_bond_angle_from_coords_json(mol, coords_json, i, j, k, angle_deg) {
8711
- let deferred3_0;
8712
- let deferred3_1;
9885
+ let deferred7_0;
9886
+ let deferred7_1;
8713
9887
  try {
8714
9888
  _assertClass(mol, MolHandle);
9889
+ const val2 = +i;
9890
+ const val3 = +j;
9891
+ const val4 = +k;
9892
+ const val5 = +angle_deg;
8715
9893
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8716
9894
  const len0 = WASM_VECTOR_LEN;
8717
- const ret = wasm.set_bond_angle_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j, k, angle_deg);
8718
- var ptr2 = ret[0];
8719
- var len2 = ret[1];
9895
+ const ret = wasm.set_bond_angle_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3, val4, val5);
9896
+ var ptr6 = ret[0];
9897
+ var len6 = ret[1];
8720
9898
  if (ret[3]) {
8721
- ptr2 = 0; len2 = 0;
9899
+ ptr6 = 0; len6 = 0;
8722
9900
  throw takeFromExternrefTable0(ret[2]);
8723
9901
  }
8724
- deferred3_0 = ptr2;
8725
- deferred3_1 = len2;
8726
- return getStringFromWasm0(ptr2, len2);
9902
+ deferred7_0 = ptr6;
9903
+ deferred7_1 = len6;
9904
+ return getStringFromWasm0(ptr6, len6);
8727
9905
  } finally {
8728
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
9906
+ wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
8729
9907
  }
8730
9908
  }
8731
9909
 
@@ -8742,24 +9920,27 @@ export function set_bond_angle_from_coords_json(mol, coords_json, i, j, k, angle
8742
9920
  * @returns {string}
8743
9921
  */
8744
9922
  export function set_bond_length_from_coords_json(mol, coords_json, i, j, length) {
8745
- let deferred3_0;
8746
- let deferred3_1;
9923
+ let deferred6_0;
9924
+ let deferred6_1;
8747
9925
  try {
8748
9926
  _assertClass(mol, MolHandle);
9927
+ const val2 = +i;
9928
+ const val3 = +j;
9929
+ const val4 = +length;
8749
9930
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8750
9931
  const len0 = WASM_VECTOR_LEN;
8751
- const ret = wasm.set_bond_length_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j, length);
8752
- var ptr2 = ret[0];
8753
- var len2 = ret[1];
9932
+ const ret = wasm.set_bond_length_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3, val4);
9933
+ var ptr5 = ret[0];
9934
+ var len5 = ret[1];
8754
9935
  if (ret[3]) {
8755
- ptr2 = 0; len2 = 0;
9936
+ ptr5 = 0; len5 = 0;
8756
9937
  throw takeFromExternrefTable0(ret[2]);
8757
9938
  }
8758
- deferred3_0 = ptr2;
8759
- deferred3_1 = len2;
8760
- return getStringFromWasm0(ptr2, len2);
9939
+ deferred6_0 = ptr5;
9940
+ deferred6_1 = len5;
9941
+ return getStringFromWasm0(ptr5, len5);
8761
9942
  } finally {
8762
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
9943
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
8763
9944
  }
8764
9945
  }
8765
9946
 
@@ -8777,24 +9958,29 @@ export function set_bond_length_from_coords_json(mol, coords_json, i, j, length)
8777
9958
  * @returns {string}
8778
9959
  */
8779
9960
  export function set_dihedral_from_coords_json(mol, coords_json, i, j, k, l, angle_deg) {
8780
- let deferred3_0;
8781
- let deferred3_1;
9961
+ let deferred8_0;
9962
+ let deferred8_1;
8782
9963
  try {
8783
9964
  _assertClass(mol, MolHandle);
9965
+ const val2 = +i;
9966
+ const val3 = +j;
9967
+ const val4 = +k;
9968
+ const val5 = +l;
9969
+ const val6 = +angle_deg;
8784
9970
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8785
9971
  const len0 = WASM_VECTOR_LEN;
8786
- const ret = wasm.set_dihedral_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j, k, l, angle_deg);
8787
- var ptr2 = ret[0];
8788
- var len2 = ret[1];
9972
+ const ret = wasm.set_dihedral_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3, val4, val5, val6);
9973
+ var ptr7 = ret[0];
9974
+ var len7 = ret[1];
8789
9975
  if (ret[3]) {
8790
- ptr2 = 0; len2 = 0;
9976
+ ptr7 = 0; len7 = 0;
8791
9977
  throw takeFromExternrefTable0(ret[2]);
8792
9978
  }
8793
- deferred3_0 = ptr2;
8794
- deferred3_1 = len2;
8795
- return getStringFromWasm0(ptr2, len2);
9979
+ deferred8_0 = ptr7;
9980
+ deferred8_1 = len7;
9981
+ return getStringFromWasm0(ptr7, len7);
8796
9982
  } finally {
8797
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
9983
+ wasm.__wbindgen_free(deferred8_0, deferred8_1, 1);
8798
9984
  }
8799
9985
  }
8800
9986
 
@@ -8821,23 +10007,28 @@ export function set_dihedral_from_coords_json(mol, coords_json, i, j, k, l, angl
8821
10007
  * @returns {string}
8822
10008
  */
8823
10009
  export function set_dihedral_json(smiles, a, b, c, d, angle_deg) {
8824
- let deferred3_0;
8825
- let deferred3_1;
8826
- try {
10010
+ let deferred8_0;
10011
+ let deferred8_1;
10012
+ try {
10013
+ const val2 = +a;
10014
+ const val3 = +b;
10015
+ const val4 = +c;
10016
+ const val5 = +d;
10017
+ const val6 = +angle_deg;
8827
10018
  const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8828
10019
  const len0 = WASM_VECTOR_LEN;
8829
- const ret = wasm.set_dihedral_json(ptr0, len0, a, b, c, d, angle_deg);
8830
- var ptr2 = ret[0];
8831
- var len2 = ret[1];
10020
+ const ret = wasm.set_dihedral_json(ptr0, len0, val2, val3, val4, val5, val6);
10021
+ var ptr7 = ret[0];
10022
+ var len7 = ret[1];
8832
10023
  if (ret[3]) {
8833
- ptr2 = 0; len2 = 0;
10024
+ ptr7 = 0; len7 = 0;
8834
10025
  throw takeFromExternrefTable0(ret[2]);
8835
10026
  }
8836
- deferred3_0 = ptr2;
8837
- deferred3_1 = len2;
8838
- return getStringFromWasm0(ptr2, len2);
10027
+ deferred8_0 = ptr7;
10028
+ deferred8_1 = len7;
10029
+ return getStringFromWasm0(ptr7, len7);
8839
10030
  } finally {
8840
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
10031
+ wasm.__wbindgen_free(deferred8_0, deferred8_1, 1);
8841
10032
  }
8842
10033
  }
8843
10034
 
@@ -8897,9 +10088,9 @@ export function smarts_match_atoms(smarts, mol) {
8897
10088
  let deferred3_0;
8898
10089
  let deferred3_1;
8899
10090
  try {
10091
+ _assertClass(mol, MolHandle);
8900
10092
  const ptr0 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8901
10093
  const len0 = WASM_VECTOR_LEN;
8902
- _assertClass(mol, MolHandle);
8903
10094
  const ret = wasm.smarts_match_atoms(ptr0, len0, mol.__wbg_ptr);
8904
10095
  var ptr2 = ret[0];
8905
10096
  var len2 = ret[1];
@@ -8927,24 +10118,65 @@ export function smarts_match_atoms(smarts, mol) {
8927
10118
  * @returns {string}
8928
10119
  */
8929
10120
  export function smarts_match_atoms_with_chirality(smarts, mol, use_chirality) {
8930
- let deferred3_0;
8931
- let deferred3_1;
10121
+ let deferred4_0;
10122
+ let deferred4_1;
8932
10123
  try {
10124
+ _assertClass(mol, MolHandle);
10125
+ const val2 = +use_chirality;
8933
10126
  const ptr0 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8934
10127
  const len0 = WASM_VECTOR_LEN;
10128
+ const ret = wasm.smarts_match_atoms_with_chirality(ptr0, len0, mol.__wbg_ptr, val2);
10129
+ var ptr3 = ret[0];
10130
+ var len3 = ret[1];
10131
+ if (ret[3]) {
10132
+ ptr3 = 0; len3 = 0;
10133
+ throw takeFromExternrefTable0(ret[2]);
10134
+ }
10135
+ deferred4_0 = ptr3;
10136
+ deferred4_1 = len3;
10137
+ return getStringFromWasm0(ptr3, len3);
10138
+ } finally {
10139
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
10140
+ }
10141
+ }
10142
+
10143
+ /**
10144
+ * Match SMARTS with optional `useChirality` and `useIsotopes` JSON flags.
10145
+ * Returns sorted atom indices for each hit. The existing WASM match and visit
10146
+ * limits apply. Pass `{}` to use the default settings.
10147
+ * @param {string} smarts
10148
+ * @param {MolHandle} mol
10149
+ * @param {string} config_json
10150
+ * @returns {string}
10151
+ */
10152
+ export function smarts_match_atoms_with_config(smarts, mol, config_json) {
10153
+ let deferred4_0;
10154
+ let deferred4_1;
10155
+ try {
8935
10156
  _assertClass(mol, MolHandle);
8936
- const ret = wasm.smarts_match_atoms_with_chirality(ptr0, len0, mol.__wbg_ptr, use_chirality);
8937
- var ptr2 = ret[0];
8938
- var len2 = ret[1];
10157
+ let ptr0, len0, ptr1, len1;
10158
+ try {
10159
+ ptr0 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10160
+ len0 = WASM_VECTOR_LEN;
10161
+ ptr1 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10162
+ len1 = WASM_VECTOR_LEN;
10163
+ } catch (e) {
10164
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
10165
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10166
+ throw e;
10167
+ }
10168
+ const ret = wasm.smarts_match_atoms_with_config(ptr0, len0, mol.__wbg_ptr, ptr1, len1);
10169
+ var ptr3 = ret[0];
10170
+ var len3 = ret[1];
8939
10171
  if (ret[3]) {
8940
- ptr2 = 0; len2 = 0;
10172
+ ptr3 = 0; len3 = 0;
8941
10173
  throw takeFromExternrefTable0(ret[2]);
8942
10174
  }
8943
- deferred3_0 = ptr2;
8944
- deferred3_1 = len2;
8945
- return getStringFromWasm0(ptr2, len2);
10175
+ deferred4_0 = ptr3;
10176
+ deferred4_1 = len3;
10177
+ return getStringFromWasm0(ptr3, len3);
8946
10178
  } finally {
8947
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
10179
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
8948
10180
  }
8949
10181
  }
8950
10182
 
@@ -9020,14 +10252,23 @@ export function smiles_to_pdbqt(smiles, coords_json, charges_json, name) {
9020
10252
  let deferred5_0;
9021
10253
  let deferred5_1;
9022
10254
  try {
9023
- const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9024
- const len0 = WASM_VECTOR_LEN;
9025
- const ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9026
- const len1 = WASM_VECTOR_LEN;
9027
- const ptr2 = passStringToWasm0(charges_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9028
- const len2 = WASM_VECTOR_LEN;
9029
- const ptr3 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9030
- const len3 = WASM_VECTOR_LEN;
10255
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
10256
+ try {
10257
+ ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10258
+ len0 = WASM_VECTOR_LEN;
10259
+ ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10260
+ len1 = WASM_VECTOR_LEN;
10261
+ ptr2 = passStringToWasm0(charges_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10262
+ len2 = WASM_VECTOR_LEN;
10263
+ ptr3 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10264
+ len3 = WASM_VECTOR_LEN;
10265
+ } catch (e) {
10266
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
10267
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
10268
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
10269
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10270
+ throw e;
10271
+ }
9031
10272
  const ret = wasm.smiles_to_pdbqt(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
9032
10273
  deferred5_0 = ret[0];
9033
10274
  deferred5_1 = ret[1];
@@ -9043,6 +10284,7 @@ export function smiles_to_pdbqt(smiles, coords_json, charges_json, name) {
9043
10284
  * contain exactly one value per graph atom, including explicit H. No defaults,
9044
10285
  * charge calculation, atom removal or ligand torsion preparation are applied.
9045
10286
  * AutoDock types retain the legacy heuristic, with unknown `X` types rejected.
10287
+ * Isotopes are refused; smiles_to_pdbqt_isotope_projection records their omission.
9046
10288
  * @param {string} smiles
9047
10289
  * @param {string} coords_json
9048
10290
  * @param {string} charges_json
@@ -9053,14 +10295,23 @@ export function smiles_to_pdbqt_checked(smiles, coords_json, charges_json, name)
9053
10295
  let deferred6_0;
9054
10296
  let deferred6_1;
9055
10297
  try {
9056
- const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9057
- const len0 = WASM_VECTOR_LEN;
9058
- const ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9059
- const len1 = WASM_VECTOR_LEN;
9060
- const ptr2 = passStringToWasm0(charges_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9061
- const len2 = WASM_VECTOR_LEN;
9062
- const ptr3 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9063
- const len3 = WASM_VECTOR_LEN;
10298
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
10299
+ try {
10300
+ ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10301
+ len0 = WASM_VECTOR_LEN;
10302
+ ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10303
+ len1 = WASM_VECTOR_LEN;
10304
+ ptr2 = passStringToWasm0(charges_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10305
+ len2 = WASM_VECTOR_LEN;
10306
+ ptr3 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10307
+ len3 = WASM_VECTOR_LEN;
10308
+ } catch (e) {
10309
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
10310
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
10311
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
10312
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10313
+ throw e;
10314
+ }
9064
10315
  const ret = wasm.smiles_to_pdbqt_checked(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
9065
10316
  var ptr5 = ret[0];
9066
10317
  var len5 = ret[1];
@@ -9076,6 +10327,53 @@ export function smiles_to_pdbqt_checked(smiles, coords_json, charges_json, name)
9076
10327
  }
9077
10328
  }
9078
10329
 
10330
+ /**
10331
+ * Explicit isotope projection. Returns JSON {pdbqt, isotopes_omitted} with
10332
+ * zero-based source_atom_index, one-based pdbqt_serial, atomic_number and
10333
+ * mass_number for each label omitted from PDBQT. Retains all explicit atoms,
10334
+ * without H merging, charge recalculation or ligand torsion preparation.
10335
+ * @param {string} smiles
10336
+ * @param {string} coords_json
10337
+ * @param {string} charges_json
10338
+ * @param {string} name
10339
+ * @returns {string}
10340
+ */
10341
+ export function smiles_to_pdbqt_isotope_projection(smiles, coords_json, charges_json, name) {
10342
+ let deferred6_0;
10343
+ let deferred6_1;
10344
+ try {
10345
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
10346
+ try {
10347
+ ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10348
+ len0 = WASM_VECTOR_LEN;
10349
+ ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10350
+ len1 = WASM_VECTOR_LEN;
10351
+ ptr2 = passStringToWasm0(charges_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10352
+ len2 = WASM_VECTOR_LEN;
10353
+ ptr3 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10354
+ len3 = WASM_VECTOR_LEN;
10355
+ } catch (e) {
10356
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
10357
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
10358
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
10359
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10360
+ throw e;
10361
+ }
10362
+ const ret = wasm.smiles_to_pdbqt_isotope_projection(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
10363
+ var ptr5 = ret[0];
10364
+ var len5 = ret[1];
10365
+ if (ret[3]) {
10366
+ ptr5 = 0; len5 = 0;
10367
+ throw takeFromExternrefTable0(ret[2]);
10368
+ }
10369
+ deferred6_0 = ptr5;
10370
+ deferred6_1 = len5;
10371
+ return getStringFromWasm0(ptr5, len5);
10372
+ } finally {
10373
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
10374
+ }
10375
+ }
10376
+
9079
10377
  /**
9080
10378
  * Render a highlighted SVG from a SMILES string in one call.
9081
10379
  *
@@ -9085,8 +10383,8 @@ export function smiles_to_pdbqt_checked(smiles, coords_json, charges_json, name)
9085
10383
  *
9086
10384
  * Returns a JS error on SMILES parse failure.
9087
10385
  * @param {string} smiles
9088
- * @param {Uint32Array} atoms
9089
- * @param {Uint32Array} bonds
10386
+ * @param {Uint32Array | number[]} atoms
10387
+ * @param {Uint32Array | number[]} bonds
9090
10388
  * @param {string} color
9091
10389
  * @returns {string}
9092
10390
  */
@@ -9094,14 +10392,23 @@ export function smiles_to_svg_highlighted(smiles, atoms, bonds, color) {
9094
10392
  let deferred6_0;
9095
10393
  let deferred6_1;
9096
10394
  try {
9097
- const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9098
- const len0 = WASM_VECTOR_LEN;
9099
- const ptr1 = passArray32ToWasm0(atoms, wasm.__wbindgen_malloc);
9100
- const len1 = WASM_VECTOR_LEN;
9101
- const ptr2 = passArray32ToWasm0(bonds, wasm.__wbindgen_malloc);
9102
- const len2 = WASM_VECTOR_LEN;
9103
- const ptr3 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9104
- const len3 = WASM_VECTOR_LEN;
10395
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
10396
+ try {
10397
+ ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10398
+ len0 = WASM_VECTOR_LEN;
10399
+ ptr1 = passArray32ToWasm0(atoms, wasm.__wbindgen_malloc);
10400
+ len1 = WASM_VECTOR_LEN;
10401
+ ptr2 = passArray32ToWasm0(bonds, wasm.__wbindgen_malloc);
10402
+ len2 = WASM_VECTOR_LEN;
10403
+ ptr3 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10404
+ len3 = WASM_VECTOR_LEN;
10405
+ } catch (e) {
10406
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
10407
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 4, 4); }
10408
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 4, 4); }
10409
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10410
+ throw e;
10411
+ }
9105
10412
  const ret = wasm.smiles_to_svg_highlighted(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
9106
10413
  var ptr5 = ret[0];
9107
10414
  var len5 = ret[1];
@@ -9194,17 +10501,21 @@ export function standardize_smiles(smiles) {
9194
10501
  * @returns {string}
9195
10502
  */
9196
10503
  export function standardize_smiles_report_json(smiles, largest_fragment_only, neutralize_charges, remove_explicit_h, canonical_tautomer) {
9197
- let deferred2_0;
9198
- let deferred2_1;
10504
+ let deferred6_0;
10505
+ let deferred6_1;
9199
10506
  try {
10507
+ const val2 = +largest_fragment_only;
10508
+ const val3 = +neutralize_charges;
10509
+ const val4 = +remove_explicit_h;
10510
+ const val5 = +canonical_tautomer;
9200
10511
  const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9201
10512
  const len0 = WASM_VECTOR_LEN;
9202
- const ret = wasm.standardize_smiles_report_json(ptr0, len0, largest_fragment_only, neutralize_charges, remove_explicit_h, canonical_tautomer);
9203
- deferred2_0 = ret[0];
9204
- deferred2_1 = ret[1];
10513
+ const ret = wasm.standardize_smiles_report_json(ptr0, len0, val2, val3, val4, val5);
10514
+ deferred6_0 = ret[0];
10515
+ deferred6_1 = ret[1];
9205
10516
  return getStringFromWasm0(ret[0], ret[1]);
9206
10517
  } finally {
9207
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
10518
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
9208
10519
  }
9209
10520
  }
9210
10521
 
@@ -9383,10 +10694,17 @@ export function tanimoto_maccs(a, b) {
9383
10694
  * @returns {number}
9384
10695
  */
9385
10696
  export function tanimoto_mhfp_smiles(smi1, smi2) {
9386
- const ptr0 = passStringToWasm0(smi1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9387
- const len0 = WASM_VECTOR_LEN;
9388
- const ptr1 = passStringToWasm0(smi2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9389
- const len1 = WASM_VECTOR_LEN;
10697
+ let ptr0, len0, ptr1, len1;
10698
+ try {
10699
+ ptr0 = passStringToWasm0(smi1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10700
+ len0 = WASM_VECTOR_LEN;
10701
+ ptr1 = passStringToWasm0(smi2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10702
+ len1 = WASM_VECTOR_LEN;
10703
+ } catch (e) {
10704
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
10705
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10706
+ throw e;
10707
+ }
9390
10708
  const ret = wasm.tanimoto_mhfp_smiles(ptr0, len0, ptr1, len1);
9391
10709
  if (ret[2]) {
9392
10710
  throw takeFromExternrefTable0(ret[1]);
@@ -9410,10 +10728,17 @@ export function tanimoto_row_json(query_smi, db_smiles_json) {
9410
10728
  let deferred3_0;
9411
10729
  let deferred3_1;
9412
10730
  try {
9413
- const ptr0 = passStringToWasm0(query_smi, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9414
- const len0 = WASM_VECTOR_LEN;
9415
- const ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9416
- const len1 = WASM_VECTOR_LEN;
10731
+ let ptr0, len0, ptr1, len1;
10732
+ try {
10733
+ ptr0 = passStringToWasm0(query_smi, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10734
+ len0 = WASM_VECTOR_LEN;
10735
+ ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10736
+ len1 = WASM_VECTOR_LEN;
10737
+ } catch (e) {
10738
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
10739
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10740
+ throw e;
10741
+ }
9417
10742
  const ret = wasm.tanimoto_row_json(ptr0, len0, ptr1, len1);
9418
10743
  deferred3_0 = ret[0];
9419
10744
  deferred3_1 = ret[1];
@@ -9432,10 +10757,17 @@ export function tanimoto_row_json(query_smi, db_smiles_json) {
9432
10757
  * @returns {number}
9433
10758
  */
9434
10759
  export function tanimoto_smiles(smiles1, smiles2) {
9435
- const ptr0 = passStringToWasm0(smiles1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9436
- const len0 = WASM_VECTOR_LEN;
9437
- const ptr1 = passStringToWasm0(smiles2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9438
- const len1 = WASM_VECTOR_LEN;
10760
+ let ptr0, len0, ptr1, len1;
10761
+ try {
10762
+ ptr0 = passStringToWasm0(smiles1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10763
+ len0 = WASM_VECTOR_LEN;
10764
+ ptr1 = passStringToWasm0(smiles2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10765
+ len1 = WASM_VECTOR_LEN;
10766
+ } catch (e) {
10767
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
10768
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10769
+ throw e;
10770
+ }
9439
10771
  const ret = wasm.tanimoto_smiles(ptr0, len0, ptr1, len1);
9440
10772
  if (ret[2]) {
9441
10773
  throw takeFromExternrefTable0(ret[1]);
@@ -9490,7 +10822,59 @@ export function tautomer_parent_json(mol, max_transforms, max_tautomers, timeout
9490
10822
  deferred1_1 = ret[1];
9491
10823
  return getStringFromWasm0(ret[0], ret[1]);
9492
10824
  } finally {
9493
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
10825
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
10826
+ }
10827
+ }
10828
+
10829
+ /**
10830
+ * Write an edited record, refusing unsupported keys rather than dropping them.
10831
+ * @param {string} json
10832
+ * @returns {string}
10833
+ */
10834
+ export function tinker_xyz_from_record_json(json) {
10835
+ let deferred3_0;
10836
+ let deferred3_1;
10837
+ try {
10838
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10839
+ const len0 = WASM_VECTOR_LEN;
10840
+ const ret = wasm.tinker_xyz_from_record_json(ptr0, len0);
10841
+ var ptr2 = ret[0];
10842
+ var len2 = ret[1];
10843
+ if (ret[3]) {
10844
+ ptr2 = 0; len2 = 0;
10845
+ throw takeFromExternrefTable0(ret[2]);
10846
+ }
10847
+ deferred3_0 = ptr2;
10848
+ deferred3_1 = len2;
10849
+ return getStringFromWasm0(ptr2, len2);
10850
+ } finally {
10851
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
10852
+ }
10853
+ }
10854
+
10855
+ /**
10856
+ * Read one Tinker XYZ frame. Names/types and declared adjacency remain opaque.
10857
+ * @param {string} text
10858
+ * @returns {string}
10859
+ */
10860
+ export function tinker_xyz_record_json(text) {
10861
+ let deferred3_0;
10862
+ let deferred3_1;
10863
+ try {
10864
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10865
+ const len0 = WASM_VECTOR_LEN;
10866
+ const ret = wasm.tinker_xyz_record_json(ptr0, len0);
10867
+ var ptr2 = ret[0];
10868
+ var len2 = ret[1];
10869
+ if (ret[3]) {
10870
+ ptr2 = 0; len2 = 0;
10871
+ throw takeFromExternrefTable0(ret[2]);
10872
+ }
10873
+ deferred3_0 = ptr2;
10874
+ deferred3_1 = len2;
10875
+ return getStringFromWasm0(ptr2, len2);
10876
+ } finally {
10877
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
9494
10878
  }
9495
10879
  }
9496
10880
 
@@ -9531,7 +10915,11 @@ export function to_cml(mol) {
9531
10915
  *
9532
10916
  * Returns a JS error if `coords_json`/`options_json` are malformed, if
9533
10917
  * `coords_json`'s length doesn't match `mol`'s atom count, or if a
9534
- * `properties` column's row count doesn't match it.
10918
+ * `properties` column's row count doesn't match it. Options must be an object
10919
+ * with only lattice/properties/info; duplicate keys and malformed values fail.
10920
+ * Nonfinite values, ambiguous/reserved names and invalid frame data fail before
10921
+ * output. Bare empty info values require explicit typed metadata encoding.
10922
+ * Molecular bonds, formal charges, isotope and stereo are not projected.
9535
10923
  * @param {MolHandle} mol
9536
10924
  * @param {string} coords_json
9537
10925
  * @param {string} options_json
@@ -9542,10 +10930,17 @@ export function to_extxyz_json(mol, coords_json, options_json) {
9542
10930
  let deferred4_1;
9543
10931
  try {
9544
10932
  _assertClass(mol, MolHandle);
9545
- const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9546
- const len0 = WASM_VECTOR_LEN;
9547
- const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9548
- const len1 = WASM_VECTOR_LEN;
10933
+ let ptr0, len0, ptr1, len1;
10934
+ try {
10935
+ ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10936
+ len0 = WASM_VECTOR_LEN;
10937
+ ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10938
+ len1 = WASM_VECTOR_LEN;
10939
+ } catch (e) {
10940
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
10941
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10942
+ throw e;
10943
+ }
9549
10944
  const ret = wasm.to_extxyz_json(mol.__wbg_ptr, ptr0, len0, ptr1, len1);
9550
10945
  var ptr3 = ret[0];
9551
10946
  var len3 = ret[1];
@@ -9669,24 +11064,26 @@ export function to_moljson(mol) {
9669
11064
  * @returns {string}
9670
11065
  */
9671
11066
  export function to_qcschema_molecule_json(mol, coords_json, charge, multiplicity) {
9672
- let deferred3_0;
9673
- let deferred3_1;
11067
+ let deferred5_0;
11068
+ let deferred5_1;
9674
11069
  try {
9675
11070
  _assertClass(mol, MolHandle);
11071
+ const val2 = +charge;
11072
+ const val3 = BigInt.asIntN(64, multiplicity);
9676
11073
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9677
11074
  const len0 = WASM_VECTOR_LEN;
9678
- const ret = wasm.to_qcschema_molecule_json(mol.__wbg_ptr, ptr0, len0, charge, multiplicity);
9679
- var ptr2 = ret[0];
9680
- var len2 = ret[1];
11075
+ const ret = wasm.to_qcschema_molecule_json(mol.__wbg_ptr, ptr0, len0, val2, val3);
11076
+ var ptr4 = ret[0];
11077
+ var len4 = ret[1];
9681
11078
  if (ret[3]) {
9682
- ptr2 = 0; len2 = 0;
11079
+ ptr4 = 0; len4 = 0;
9683
11080
  throw takeFromExternrefTable0(ret[2]);
9684
11081
  }
9685
- deferred3_0 = ptr2;
9686
- deferred3_1 = len2;
9687
- return getStringFromWasm0(ptr2, len2);
11082
+ deferred5_0 = ptr4;
11083
+ deferred5_1 = len4;
11084
+ return getStringFromWasm0(ptr4, len4);
9688
11085
  } finally {
9689
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11086
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
9690
11087
  }
9691
11088
  }
9692
11089
 
@@ -9815,6 +11212,32 @@ export function validate_nmr_spectrum_json(json) {
9815
11212
  }
9816
11213
  }
9817
11214
 
11215
+ /**
11216
+ * Explicit checked binary64 Angstrom positions; raw parse/write is independent.
11217
+ * @param {string} text
11218
+ * @returns {string}
11219
+ */
11220
+ export function viewmol_positions_angstrom_json(text) {
11221
+ let deferred3_0;
11222
+ let deferred3_1;
11223
+ try {
11224
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11225
+ const len0 = WASM_VECTOR_LEN;
11226
+ const ret = wasm.viewmol_positions_angstrom_json(ptr0, len0);
11227
+ var ptr2 = ret[0];
11228
+ var len2 = ret[1];
11229
+ if (ret[3]) {
11230
+ ptr2 = 0; len2 = 0;
11231
+ throw takeFromExternrefTable0(ret[2]);
11232
+ }
11233
+ deferred3_0 = ptr2;
11234
+ deferred3_1 = len2;
11235
+ return getStringFromWasm0(ptr2, len2);
11236
+ } finally {
11237
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11238
+ }
11239
+ }
11240
+
9818
11241
  /**
9819
11242
  * Virtual screen a query SMILES against a database of SMILES using ECFP4 Tanimoto.
9820
11243
  *
@@ -9829,19 +11252,27 @@ export function validate_nmr_spectrum_json(json) {
9829
11252
  * @returns {string}
9830
11253
  */
9831
11254
  export function virtual_screen_ecfp4_json(query_smi, db_smiles_json, k) {
9832
- let deferred3_0;
9833
- let deferred3_1;
11255
+ let deferred4_0;
11256
+ let deferred4_1;
9834
11257
  try {
9835
- const ptr0 = passStringToWasm0(query_smi, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9836
- const len0 = WASM_VECTOR_LEN;
9837
- const ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9838
- const len1 = WASM_VECTOR_LEN;
9839
- const ret = wasm.virtual_screen_ecfp4_json(ptr0, len0, ptr1, len1, k);
9840
- deferred3_0 = ret[0];
9841
- deferred3_1 = ret[1];
11258
+ const val3 = +k;
11259
+ let ptr0, len0, ptr1, len1;
11260
+ try {
11261
+ ptr0 = passStringToWasm0(query_smi, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11262
+ len0 = WASM_VECTOR_LEN;
11263
+ ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11264
+ len1 = WASM_VECTOR_LEN;
11265
+ } catch (e) {
11266
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
11267
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
11268
+ throw e;
11269
+ }
11270
+ const ret = wasm.virtual_screen_ecfp4_json(ptr0, len0, ptr1, len1, val3);
11271
+ deferred4_0 = ret[0];
11272
+ deferred4_1 = ret[1];
9842
11273
  return getStringFromWasm0(ret[0], ret[1]);
9843
11274
  } finally {
9844
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11275
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
9845
11276
  }
9846
11277
  }
9847
11278
 
@@ -9929,6 +11360,84 @@ export function write_cube_json(grid_json) {
9929
11360
  }
9930
11361
  }
9931
11362
 
11363
+ /**
11364
+ * Serialize validated edited fields; duplicate/unknown JSON keys refuse.
11365
+ * @param {string} json
11366
+ * @returns {string}
11367
+ */
11368
+ export function write_fract_from_json(json) {
11369
+ let deferred3_0;
11370
+ let deferred3_1;
11371
+ try {
11372
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11373
+ const len0 = WASM_VECTOR_LEN;
11374
+ const ret = wasm.write_fract_from_json(ptr0, len0);
11375
+ var ptr2 = ret[0];
11376
+ var len2 = ret[1];
11377
+ if (ret[3]) {
11378
+ ptr2 = 0; len2 = 0;
11379
+ throw takeFromExternrefTable0(ret[2]);
11380
+ }
11381
+ deferred3_0 = ptr2;
11382
+ deferred3_1 = len2;
11383
+ return getStringFromWasm0(ptr2, len2);
11384
+ } finally {
11385
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11386
+ }
11387
+ }
11388
+
11389
+ /**
11390
+ * Write current fields. Duplicate/unknown keys and unsupported semantics refuse.
11391
+ * @param {string} json
11392
+ * @returns {string}
11393
+ */
11394
+ export function write_gpr_from_json(json) {
11395
+ let deferred3_0;
11396
+ let deferred3_1;
11397
+ try {
11398
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11399
+ const len0 = WASM_VECTOR_LEN;
11400
+ const ret = wasm.write_gpr_from_json(ptr0, len0);
11401
+ var ptr2 = ret[0];
11402
+ var len2 = ret[1];
11403
+ if (ret[3]) {
11404
+ ptr2 = 0; len2 = 0;
11405
+ throw takeFromExternrefTable0(ret[2]);
11406
+ }
11407
+ deferred3_0 = ptr2;
11408
+ deferred3_1 = len2;
11409
+ return getStringFromWasm0(ptr2, len2);
11410
+ } finally {
11411
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11412
+ }
11413
+ }
11414
+
11415
+ /**
11416
+ * Write current fields without rescaling; unknown or duplicate keys refuse.
11417
+ * @param {string} text
11418
+ * @returns {string}
11419
+ */
11420
+ export function write_gromos96_from_json(text) {
11421
+ let deferred3_0;
11422
+ let deferred3_1;
11423
+ try {
11424
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11425
+ const len0 = WASM_VECTOR_LEN;
11426
+ const ret = wasm.write_gromos96_from_json(ptr0, len0);
11427
+ var ptr2 = ret[0];
11428
+ var len2 = ret[1];
11429
+ if (ret[3]) {
11430
+ ptr2 = 0; len2 = 0;
11431
+ throw takeFromExternrefTable0(ret[2]);
11432
+ }
11433
+ deferred3_0 = ptr2;
11434
+ deferred3_1 = len2;
11435
+ return getStringFromWasm0(ptr2, len2);
11436
+ } finally {
11437
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11438
+ }
11439
+ }
11440
+
9932
11441
  /**
9933
11442
  * Write a LAMMPS data file from the JSON shape [`lammps_data_to_json`]
9934
11443
  * returns.
@@ -10011,6 +11520,32 @@ export function write_lammps_trajectory_json(json) {
10011
11520
  }
10012
11521
  }
10013
11522
 
11523
+ /**
11524
+ * Write current fields without rescaling; unknown or duplicate keys refuse.
11525
+ * @param {string} text
11526
+ * @returns {string}
11527
+ */
11528
+ export function write_lpmd_from_json(text) {
11529
+ let deferred3_0;
11530
+ let deferred3_1;
11531
+ try {
11532
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11533
+ const len0 = WASM_VECTOR_LEN;
11534
+ const ret = wasm.write_lpmd_from_json(ptr0, len0);
11535
+ var ptr2 = ret[0];
11536
+ var len2 = ret[1];
11537
+ if (ret[3]) {
11538
+ ptr2 = 0; len2 = 0;
11539
+ throw takeFromExternrefTable0(ret[2]);
11540
+ }
11541
+ deferred3_0 = ptr2;
11542
+ deferred3_1 = len2;
11543
+ return getStringFromWasm0(ptr2, len2);
11544
+ } finally {
11545
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11546
+ }
11547
+ }
11548
+
10014
11549
  /**
10015
11550
  * Write an mmCIF file from atom records in the JSON shape
10016
11551
  * [`mmcif_to_json`]'s `"atoms"` array uses (a full record per atom, not
@@ -10020,6 +11555,8 @@ export function write_lammps_trajectory_json(json) {
10020
11555
  *
10021
11556
  * `cell_json`: `"null"` or `{"a":...,"b":...,"c":...,"alpha":...,"beta":...,"gamma":...}`.
10022
11557
  * `space_group`: pass `""` for none.
11558
+ * Finite numeric fields retain their binary64 values without fixed decimal
11559
+ * rounding. This does not retain original spelling or uncertainty suffixes.
10023
11560
  * @param {string} records_json
10024
11561
  * @param {string} cell_json
10025
11562
  * @param {string} space_group
@@ -10030,14 +11567,23 @@ export function write_mmcif_json(records_json, cell_json, space_group, data_bloc
10030
11567
  let deferred6_0;
10031
11568
  let deferred6_1;
10032
11569
  try {
10033
- const ptr0 = passStringToWasm0(records_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10034
- const len0 = WASM_VECTOR_LEN;
10035
- const ptr1 = passStringToWasm0(cell_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10036
- const len1 = WASM_VECTOR_LEN;
10037
- const ptr2 = passStringToWasm0(space_group, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10038
- const len2 = WASM_VECTOR_LEN;
10039
- const ptr3 = passStringToWasm0(data_block_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10040
- const len3 = WASM_VECTOR_LEN;
11570
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
11571
+ try {
11572
+ ptr0 = passStringToWasm0(records_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11573
+ len0 = WASM_VECTOR_LEN;
11574
+ ptr1 = passStringToWasm0(cell_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11575
+ len1 = WASM_VECTOR_LEN;
11576
+ ptr2 = passStringToWasm0(space_group, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11577
+ len2 = WASM_VECTOR_LEN;
11578
+ ptr3 = passStringToWasm0(data_block_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11579
+ len3 = WASM_VECTOR_LEN;
11580
+ } catch (e) {
11581
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
11582
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
11583
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
11584
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
11585
+ throw e;
11586
+ }
10041
11587
  const ret = wasm.write_mmcif_json(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
10042
11588
  var ptr5 = ret[0];
10043
11589
  var len5 = ret[1];
@@ -10141,6 +11687,35 @@ export function write_orca_input_json(json) {
10141
11687
  }
10142
11688
  }
10143
11689
 
11690
+ /**
11691
+ * Write represented ORCA input fields with exact finite Cartesian values.
11692
+ * Requires explicit fields, rejects unknown/duplicate JSON fields, unit
11693
+ * conflicts, %coords and any metadata that would change on structured reparse.
11694
+ * Accepts either kind or type coordinate tags, never both. No job validation.
11695
+ * @param {string} input_json
11696
+ * @returns {string}
11697
+ */
11698
+ export function write_orca_input_json_checked(input_json) {
11699
+ let deferred3_0;
11700
+ let deferred3_1;
11701
+ try {
11702
+ const ptr0 = passStringToWasm0(input_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11703
+ const len0 = WASM_VECTOR_LEN;
11704
+ const ret = wasm.write_orca_input_json_checked(ptr0, len0);
11705
+ var ptr2 = ret[0];
11706
+ var len2 = ret[1];
11707
+ if (ret[3]) {
11708
+ ptr2 = 0; len2 = 0;
11709
+ throw takeFromExternrefTable0(ret[2]);
11710
+ }
11711
+ deferred3_0 = ptr2;
11712
+ deferred3_1 = len2;
11713
+ return getStringFromWasm0(ptr2, len2);
11714
+ } finally {
11715
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11716
+ }
11717
+ }
11718
+
10144
11719
  /**
10145
11720
  * Write a PQR file from atom records in the JSON shape [`pqr_to_json`]'s
10146
11721
  * `"atoms"` array uses. Each atom's `chain_id` independently controls
@@ -10221,6 +11796,58 @@ export function write_smiles(mol) {
10221
11796
  }
10222
11797
  }
10223
11798
 
11799
+ /**
11800
+ * Serialize validated edited fields; duplicate/unknown JSON keys refuse.
11801
+ * @param {string} json
11802
+ * @returns {string}
11803
+ */
11804
+ export function write_unixyz_from_json(json) {
11805
+ let deferred3_0;
11806
+ let deferred3_1;
11807
+ try {
11808
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11809
+ const len0 = WASM_VECTOR_LEN;
11810
+ const ret = wasm.write_unixyz_from_json(ptr0, len0);
11811
+ var ptr2 = ret[0];
11812
+ var len2 = ret[1];
11813
+ if (ret[3]) {
11814
+ ptr2 = 0; len2 = 0;
11815
+ throw takeFromExternrefTable0(ret[2]);
11816
+ }
11817
+ deferred3_0 = ptr2;
11818
+ deferred3_1 = len2;
11819
+ return getStringFromWasm0(ptr2, len2);
11820
+ } finally {
11821
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11822
+ }
11823
+ }
11824
+
11825
+ /**
11826
+ * Write current fields without rescaling; unknown or duplicate keys refuse.
11827
+ * @param {string} text
11828
+ * @returns {string}
11829
+ */
11830
+ export function write_viewmol_from_json(text) {
11831
+ let deferred3_0;
11832
+ let deferred3_1;
11833
+ try {
11834
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11835
+ const len0 = WASM_VECTOR_LEN;
11836
+ const ret = wasm.write_viewmol_from_json(ptr0, len0);
11837
+ var ptr2 = ret[0];
11838
+ var len2 = ret[1];
11839
+ if (ret[3]) {
11840
+ ptr2 = 0; len2 = 0;
11841
+ throw takeFromExternrefTable0(ret[2]);
11842
+ }
11843
+ deferred3_0 = ptr2;
11844
+ deferred3_1 = len2;
11845
+ return getStringFromWasm0(ptr2, len2);
11846
+ } finally {
11847
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11848
+ }
11849
+ }
11850
+
10224
11851
  /**
10225
11852
  * XLogP3 partition coefficient (alternative to Crippen LogP).
10226
11853
  * Returns JSON: `{"xlogp3": float}`.
@@ -10270,61 +11897,63 @@ export function xlogp3_per_atom_json(mol) {
10270
11897
  * @returns {string}
10271
11898
  */
10272
11899
  export function xyz_frames_batch_json(text, offset, batch_size) {
10273
- let deferred3_0;
10274
- let deferred3_1;
11900
+ let deferred5_0;
11901
+ let deferred5_1;
10275
11902
  try {
11903
+ const val2 = +offset;
11904
+ const val3 = +batch_size;
10276
11905
  const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10277
11906
  const len0 = WASM_VECTOR_LEN;
10278
- const ret = wasm.xyz_frames_batch_json(ptr0, len0, offset, batch_size);
10279
- var ptr2 = ret[0];
10280
- var len2 = ret[1];
11907
+ const ret = wasm.xyz_frames_batch_json(ptr0, len0, val2, val3);
11908
+ var ptr4 = ret[0];
11909
+ var len4 = ret[1];
10281
11910
  if (ret[3]) {
10282
- ptr2 = 0; len2 = 0;
11911
+ ptr4 = 0; len4 = 0;
10283
11912
  throw takeFromExternrefTable0(ret[2]);
10284
11913
  }
10285
- deferred3_0 = ptr2;
10286
- deferred3_1 = len2;
10287
- return getStringFromWasm0(ptr2, len2);
11914
+ deferred5_0 = ptr4;
11915
+ deferred5_1 = len4;
11916
+ return getStringFromWasm0(ptr4, len4);
10288
11917
  } finally {
10289
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11918
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
10290
11919
  }
10291
11920
  }
10292
11921
  function __wbg_get_imports() {
10293
11922
  const import0 = {
10294
11923
  __proto__: null,
10295
- __wbg___wbindgen_is_undefined_8865fb403f8fe9d8: function(arg0) {
11924
+ __wbg___wbindgen_is_undefined_be5b34249ff1fc15: function(arg0) {
10296
11925
  const ret = arg0 === undefined;
10297
11926
  return ret;
10298
11927
  },
10299
- __wbg___wbindgen_number_get_2e0e7dee9f701a71: function(arg0, arg1) {
11928
+ __wbg___wbindgen_number_get_934b640d0889af78: function(arg0, arg1) {
10300
11929
  const obj = arg1;
10301
11930
  const ret = typeof(obj) === 'number' ? obj : undefined;
10302
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
10303
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
11931
+ getDataViewMemory0().setFloat64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
11932
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
10304
11933
  },
10305
- __wbg___wbindgen_string_get_0380ccaa2f57f0d9: function(arg0, arg1) {
11934
+ __wbg___wbindgen_string_get_7ce8eee7fd327545: function(arg0, arg1) {
10306
11935
  const obj = arg1;
10307
11936
  const ret = typeof(obj) === 'string' ? obj : undefined;
10308
11937
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10309
11938
  var len1 = WASM_VECTOR_LEN;
10310
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
10311
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
11939
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
11940
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
10312
11941
  },
10313
- __wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
11942
+ __wbg___wbindgen_throw_4c88d8bf264fd984: function(arg0, arg1) {
10314
11943
  throw new Error(getStringFromWasm0(arg0, arg1));
10315
11944
  },
10316
- __wbg_error_c9cf3fc2064683a9: function(arg0) {
11945
+ __wbg_error_d1fc0193610e0e39: function(arg0) {
10317
11946
  console.error(arg0);
10318
11947
  },
10319
11948
  __wbg_molhandle_new: function(arg0) {
10320
11949
  const ret = MolHandle.__wrap(arg0);
10321
11950
  return ret;
10322
11951
  },
10323
- __wbg_new_from_slice_37a3c3a194266cb8: function(arg0, arg1) {
11952
+ __wbg_new_from_slice_3512352010266e02: function(arg0, arg1) {
10324
11953
  const ret = new Uint32Array(getArrayU32FromWasm0(arg0, arg1));
10325
11954
  return ret;
10326
11955
  },
10327
- __wbg_new_from_slice_f545fd22ddc142b8: function(arg0, arg1) {
11956
+ __wbg_new_from_slice_aaf85a9746711968: function(arg0, arg1) {
10328
11957
  const ret = new Float64Array(getArrayF64FromWasm0(arg0, arg1));
10329
11958
  return ret;
10330
11959
  },
@@ -10332,24 +11961,24 @@ function __wbg_get_imports() {
10332
11961
  const ret = arg0.now();
10333
11962
  return ret;
10334
11963
  },
10335
- __wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
11964
+ __wbg_performance_7e4e4494fdc9d07a: function(arg0) {
10336
11965
  const ret = arg0.performance;
10337
11966
  return ret;
10338
11967
  },
10339
- __wbg_static_accessor_GLOBAL_266715b9d96ba635: function() {
10340
- const ret = typeof global === 'undefined' ? null : global;
11968
+ __wbg_static_accessor_GLOBAL_THIS_003ee833af9699fc: function() {
11969
+ const ret = typeof globalThis === 'undefined' ? undefined : globalThis;
10341
11970
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
10342
11971
  },
10343
- __wbg_static_accessor_GLOBAL_THIS_10fb7dc1ae063179: function() {
10344
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
11972
+ __wbg_static_accessor_GLOBAL_e4293fb22cbe77da: function() {
11973
+ const ret = typeof global === 'undefined' ? undefined : global;
10345
11974
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
10346
11975
  },
10347
- __wbg_static_accessor_SELF_0b583911f537483a: function() {
10348
- const ret = typeof self === 'undefined' ? null : self;
11976
+ __wbg_static_accessor_SELF_53bb20457401453d: function() {
11977
+ const ret = typeof self === 'undefined' ? undefined : self;
10349
11978
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
10350
11979
  },
10351
- __wbg_static_accessor_WINDOW_d7f903d1508cbdc4: function() {
10352
- const ret = typeof window === 'undefined' ? null : window;
11980
+ __wbg_static_accessor_WINDOW_b5e0810bfecb7feb: function() {
11981
+ const ret = typeof window === 'undefined' ? undefined : window;
10353
11982
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
10354
11983
  },
10355
11984
  __wbindgen_generic_0000000000000001: function(arg0) {
@@ -10364,12 +11993,11 @@ function __wbg_get_imports() {
10364
11993
  },
10365
11994
  __wbindgen_init_externref_table: function() {
10366
11995
  const table = wasm.__wbindgen_externrefs;
10367
- const offset = table.grow(4);
10368
11996
  table.set(0, undefined);
10369
- table.set(offset + 0, undefined);
10370
- table.set(offset + 1, null);
10371
- table.set(offset + 2, true);
10372
- table.set(offset + 3, false);
11997
+ table.set(1024, undefined);
11998
+ table.set(1025, null);
11999
+ table.set(1026, true);
12000
+ table.set(1027, false);
10373
12001
  },
10374
12002
  };
10375
12003
  return {
@@ -10461,7 +12089,8 @@ function getFloat64ArrayMemory0() {
10461
12089
  }
10462
12090
 
10463
12091
  function getStringFromWasm0(ptr, len) {
10464
- return decodeText(ptr >>> 0, len);
12092
+ ptr = ptr >>> 0;
12093
+ return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
10465
12094
  }
10466
12095
 
10467
12096
  let cachedUint32ArrayMemory0 = null;
@@ -10541,18 +12170,18 @@ function takeFromExternrefTable0(idx) {
10541
12170
  return value;
10542
12171
  }
10543
12172
 
10544
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
12173
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
10545
12174
  cachedTextDecoder.decode();
10546
12175
  const MAX_SAFARI_DECODE_BYTES = 2146435072;
10547
12176
  let numBytesDecoded = 0;
10548
- function decodeText(ptr, len) {
10549
- numBytesDecoded += len;
12177
+ function decodeText(bytes) {
12178
+ numBytesDecoded += bytes.length;
10550
12179
  if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
10551
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
12180
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
10552
12181
  cachedTextDecoder.decode();
10553
- numBytesDecoded = len;
12182
+ numBytesDecoded = bytes.length;
10554
12183
  }
10555
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
12184
+ return cachedTextDecoder.decode(bytes);
10556
12185
  }
10557
12186
 
10558
12187
  const cachedTextEncoder = new TextEncoder();
@@ -10642,9 +12271,17 @@ function initSync(module) {
10642
12271
  return __wbg_finalize_init(instance, module);
10643
12272
  }
10644
12273
 
12274
+ let __wbg_init_promise;
10645
12275
  async function __wbg_init(module_or_path) {
10646
12276
  if (wasm !== undefined) return wasm;
12277
+ if (__wbg_init_promise === undefined) {
12278
+ __wbg_init_promise = __wbg_init_once(module_or_path);
12279
+ __wbg_init_promise.catch(() => { __wbg_init_promise = undefined; });
12280
+ }
12281
+ return __wbg_init_promise;
12282
+ }
10647
12283
 
12284
+ async function __wbg_init_once(module_or_path) {
10648
12285
 
10649
12286
  if (module_or_path !== undefined) {
10650
12287
  if (Object.getPrototypeOf(module_or_path) === Object.prototype) {