(function(a){if(awdr_params.refresh_order_review=="1"){a(document).on("change",'input[name="payment_method"],input[name="billing_city"],input[name="billing_postcode"]',function(){t()});a(document).on("blur",'input[name="billing_email"], select#billing_state',function(){t()})}function t(){a("body").trigger("update_checkout")}a(document).ready(function(a){function t(){if(awdr_params.enable_update_price_with_qty=="show_dynamically"){function t(t,r,i){let e="";if(t.find(r).length){e=t.find(r).first();if(i===true){if(!t.find(r+" .price").length){e.html("
")}e=t.find(r+" .price").first()}}else{e=a(r).first();if(i===true){if(!a(r+" .price").length){e.html("")}e=a(r+" .price").first()}}return e}a(document).on("change",'[name="quantity"]',function(){var r=a(this);setTimeout(function(){var i=r.val();var e=0;var _="";var d=r.closest("form");if(d.find('button[name="add-to-cart"]').length){e=d.find('button[name="add-to-cart"]').first().val();var n="div.product p.price";if(awdr_params.custom_target_simple_product!=undefined){if(awdr_params.custom_target_simple_product!=""){n=awdr_params.custom_target_simple_product}}_=t(d,n,false)}else if(d.find('input[name="variation_id"]').length){e=d.find('input[name="variation_id"]').val();var n="div.product .woocommerce-variation-price";if(awdr_params.custom_target_variable_product!=undefined){if(awdr_params.custom_target_variable_product!=""){n=awdr_params.custom_target_variable_product}}_=t(d,n,true)}else if(d.find('input[name="add-to-cart"]').length){e=d.find('input[name="add-to-cart"]').first().val();var n="div.product p.price";if(awdr_params.custom_target_simple_product!=undefined){if(awdr_params.custom_target_simple_product!=""){n=awdr_params.custom_target_simple_product}}_=t(d,n,false)}if(!e||e==0){if(awdr_params.custom_simple_product_id_selector!=undefined){if(awdr_params.custom_simple_product_id_selector!=""){let r=awdr_params.custom_simple_product_id_selector;e=a(r).val();let i="div.product p.price";if(awdr_params.custom_target_simple_product!=undefined){if(awdr_params.custom_target_simple_product!=""){i=awdr_params.custom_target_simple_product}}_=t(d,i,false)}}if(awdr_params.custom_variable_product_id_selector!=undefined){if(awdr_params.custom_variable_product_id_selector!=""){let r=awdr_params.custom_variable_product_id_selector;e=a(r).val();let i="div.product .woocommerce-variation-price";if(awdr_params.custom_target_variable_product!=undefined){if(awdr_params.custom_target_variable_product!=""){i=awdr_params.custom_target_variable_product}}_=t(d,i,true)}}}if(!e||!_||e==0){return}var o={action:"wdr_ajax",method:"get_price_html",product_id:e,qty:i,awdr_nonce:awdr_params.nonce};a.ajax({url:awdr_params.ajaxurl,data:o,type:"POST",success:function(a){if(a.price_html){_.html(a.price_html)}else{if(a.original_price_html!=undefined){_.html(a.original_price_html)}}},error:function(a){_.html("")}})},0)})}}if(awdr_params.js_init_trigger){a(document).on(awdr_params.js_init_trigger,function(){t()})}t();if(awdr_params.awdr_dynamic_bulk_table_status=="1"){if(awdr_params.awdr_dynamic_bulk_table_off=="on"){function r(t){setTimeout(function(){if(t!=""&&t!="0"){var r={action:"wdr_ajax",method:"get_variable_product_bulk_table",product_id:t,awdr_nonce:awdr_params.nonce};let i="div.awdr-bulk-customizable-table";if(awdr_params.awdr_opacity_to_bulk_table!=undefined){if(awdr_params.awdr_opacity_to_bulk_table!=""){i=awdr_params.awdr_opacity_to_bulk_table}}a.ajax({url:awdr_params.ajaxurl,data:r,type:"POST",beforeSend:function(){a(i).css("opacity","0.5")},complete:function(){a(i).css("opacity","1")},success:function(t){if(t.bulk_table){a(".awdr-bulk-customizable-table").html(t.bulk_table)}},error:function(t){a(".awdr-bulk-customizable-table").html("")}})}},100)}a(".single_variation_wrap").on("hide_variation",function(t){let i=a(this).closest("form").find('input[name="product_id"]').val();r(i)});a(".single_variation_wrap").on("show_variation",function(a,t,i){let e=t.variation_id;if(t.is_bundled!=undefined){if(t.is_bundled==true){return}}r(e)})}}})})(jQuery);