;(()=>{"use strict";(t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})})({}),function(t){const e=(t,e=1)=>{const a=parseFloat(t);return isNaN(a)?e:a},a=a=>{a.preventDefault(),a.stopPropagation(),console.log("handleQuantityTrigger");const n=t(a.currentTarget),r=n.closest(".eaw-product-card-wrapper, .eaw-wishlist-item"),o=r.find("input.eaw-custom-quantity-input");if(!o.length)return void console.warn("Quantity input not found for element:",r);let i=e(o.val(),1);const u=e(o.attr("step"),1),c=e(o.attr("min"),0),s=e(o.attr("max"),1/0);if(n.hasClass("eaw-plus")?i+=u:i-=u,i=Math.max(c,Math.min(s,Math.round(i/u)*u)),o.val(i).trigger("change"),r.closest(".woocommerce-cart-form").length){const e=t('.woocommerce-cart-form button[name="update_cart"]');e.length&&e.prop("disabled",!1).trigger("click")}},n=a=>{a.preventDefault(),a.stopPropagation();const n=t(a.currentTarget);let r=e(n.val(),1);const o=e(n.attr("min"),0),i=e(n.attr("max"),1/0),u=e(n.attr("step"),1);r=Math.max(o,Math.min(i,Math.round(r/u)*u)),n.val(r)};t(document).ready(()=>{t(document).on("click",".eaw-product-card-wrapper .quantity-trigger, .eaw-wishlist-item .quantity-trigger",a),t(document).on("change",".eaw-product-card-wrapper input.eaw-custom-quantity-input, .eaw-wishlist-item input.eaw-custom-quantity-input",n),t("input.variation_id").length&&t(document).on("change","input.variation_id",e=>{const a=t(e.currentTarget).closest("form"),n=a.find("#eaw-custom-quantity"),r=n.find("input.eaw-custom-quantity-input");n.length&&r.length?n.toggleClass("eaw-disabled","hidden"===r.attr("type")):console.warn("Quantity wrapper or input not found for variable product form:",a)})})}(jQuery)})();