(()=>{var a;(a=jQuery)(document).ready(function(){var e,t;if("undefined"==typeof wholesalexPriceTableData)return;const n=a("[name=quantity]"),i=(null===(e=wholesalexPriceTableData)||void 0===e?void 0:e.quantityPrices)||[],r=(null===(t=wholesalexPriceTableData)||void 0===t?void 0:t.cartQuantity)||0;n.length&&n.on("input change",function(){const e=parseInt(r)+parseInt(n.val())||1;let t=null,l=0;i.forEach(a=>{const n=parseInt(null==a?void 0:a._min_quantity);e>=n&&n>=l&&(t=n,l=n)}),a(".wsx-price-table-row").removeClass("active"),t&&a('.wsx-price-table-row[data-min="'+t+'"]').addClass("active")}).trigger("change"),a(".wopb-builder-cart-minus").on("click",function(a){a.preventDefault(),a.stopPropagation();const e=parseInt(n.val())||1;e>1&&n.val(e-1).trigger("change")}),a(".wopb-builder-cart-plus").on("click",function(a){a.preventDefault(),a.stopPropagation();const e=parseInt(n.val())||1;n.val(e+1).trigger("change")})})})();
//# sourceMappingURL=wholesalex-price-table.js.map