8501'uid',8502'img',8503'externalid',8504'externalids',8505'pack_x',8506'pack_y',8507'pack_z',8508'pack_m',8509];8510var allProps = {}; // hash map8511// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)8512// @ts-expect-error ST-2949_2
var editionOptions = []; // @ts-expect-error ST-2949_2 editions.forEach(function (edition) { Object.keys(edition).forEach(function (key) { // @ts-expect-error ST-2949_2 if (defaultProps.indexOf(key) === -1 && !allProps[key]) { // @ts-expect-error ST-2949_2 allProps[key] = true; } }); }); Object.keys(allProps).forEach(function (p) { var propEl = { name: p, id: t_catalog_combineOptionIdByName(p), params: t_catalog_product_getEditionOptionsArr_getParams(p, product, optionsData), values: t_catalog_product_getEditionOptionsArr_getValues(p, editions), // Store all option images for proper render later imagesObj: t_catalog_product_getEditionOptionsArr_getImgValues(p, editions), valuesObj: optionsData && optionsData[p] ? optionsData[p].values : {}, }; editionOptions.push(propEl); }); // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) // @ts-expect-error ST-2949_2 return editionOptions;}// @ts-expect-error ST-2949_2function t_catalog_product_getFirstAvailableEditionData(editions) { // iterate editions and return first available for (var i = 0; i < editions.length; i++) { var curEdition = editions[i]; if (parseInt(curEdition.quantity, 10) !== 0) { return curEdition; } } return editions[0];}// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)// @ts-expect-error ST-2949_2function t_catalog_product_getEditionOptionsArr_getValues(prop, editions) { // @ts-expect-error ST-2949_2 var values = []; // iterate all editions and collect unique property values // @ts-expect-error ST-2949_2 editions.forEach(function (curEdition) { var val = curEdition[prop]; // @ts-expect-error ST-2949_2 if (val !== undefined && values.indexOf(val) === -1) { values.push(val); } }); // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) // @ts-expect-error ST-2949_2 values = t_catalog_product_sortValues(values); return values;}/** * Sorts an array of values based on a specific order. * * @param {Array<*>} result - An array of values to sort. * @param {string} type - The type of the values in the array. Can be either 'filter' or 'product'. * @param {Array<*>} order - An array of strings representing the order to sort the values by. * @return {Array<*>} The sorted array of values. */function t_catalog_product_sortValuesByOrder(result, type, order) { return result.sort(function (a, b) { var valueA = type === 'filter' ? a.value : a; var valueB = type === 'filter' ? b.value : b; valueA = valueA.toString().toUpperCase(); valueB = valueB.toString().toUpperCase(); return order.indexOf(valueA) - order.indexOf(valueB); });}/**