PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
Notice: ob_end_clean(): Failed to delete buffer. No buffer to delete in /home/telusvwg/public_html/da754d/index.php on line 8
$#$#$#

Dir : /home/telusvwg/alwatnitraders.com/wp-content/themes/woodmart/js/scripts/wc/
Server: Linux premium279.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
IP: 66.29.132.192
Choose File :

Url:
Dir : /home/telusvwg/alwatnitraders.com/wp-content/themes/woodmart/js/scripts/wc/ptSubscribeForm.min.js

woodmartThemeModule.ptSubscribeForm=function(){var d=[];function c(e){var t=m();t.variationId&&d.includes(t.variationId)&&e.classList.remove("wd-hide")}function s(e,t){var r=_(),a=f();r&&(a&&v(t.variation_id),i(t.variation_id),t.is_in_stock?r.classList.remove("wd-hide"):r.classList.add("wd-hide"),h())}function u(){_().classList.add("wd-hide"),h()}function l(e){var t,r;this.classList.contains("wd-pt-remove")||(e.preventDefault(),f()&&!function(){var e=f();if(!e)return;var t=e.querySelector('[name="wd-pt-policy-check"]'),r=e.querySelector('[name="wd-pt-desired-price-check"]'),e=e.querySelector('[name="wd-pt-user-desired-price"]'),a=g();if(t&&!t.checked&&a)return void w(a,woodmart_settings.pt_policy_check_msg,"warning");if(r&&e&&r.checked&&!parseFloat(e.value))return void w(a,woodmart_settings.pt_desired_price_check_msg,"warning");return 1}())||(e=m(),t=function(){var e="",t=document.querySelector('[name="wd-pt-user-subscribe-email"]');t&&(e=t.value);return e}(),r=function(){var e="",t=document.querySelector('[name="wd-pt-user-desired-price"]');t&&(e=t.value);return e}(),a({action:"woodmart_add_to_price_tracker",security:woodmart_settings.pt_add_button_nonce,user_email:t,product_id:e.productId,variation_id:e.variationId,desired_price:r}))}function p(e){var t;this.classList.contains("wd-pt-remove")&&(e.preventDefault(),e=m(),t=parseInt(e.productId),e=parseInt(e.variationId),a({action:"woodmart_remove_from_price_tracker",security:woodmart_settings.pt_remove_button_nonce,product_id:t,variation_id:e}))}function i(e){var t=_(),r=f(),a=t.querySelector("a"),n=a.querySelector(".wd-action-text");d.includes(e)?(n.innerText=woodmart_settings.pt_button_text_stop_tracking,a.href="#",a.classList.remove("added"),t.classList.add("wd-pt-remove"),t.classList.remove("wd-pt-add"),t.addEventListener("click",p),a.classList.remove("wd-open-popup")):(n.innerText=woodmart_settings.pt_button_text_not_tracking,t.classList.remove("wd-pt-remove"),a.classList.remove("wd-open-popup"),a.classList.remove("added"),r?(a.href="#wd-popup-pt",a.classList.add("wd-open-popup")):(a.href="#",t.classList.add("wd-pt-add"),t.addEventListener("click",l)))}function v(e){var t=f();d.includes(e)?(t.querySelector(".wd-pt-signed").classList.remove("wd-hide"),t.querySelector(".wd-pt-not-signed").classList.add("wd-hide")):(t.querySelector(".wd-pt-signed").classList.add("wd-hide"),t.querySelector(".wd-pt-not-signed").classList.remove("wd-hide"))}function a(e){var a=f(),n=g(),t=_().querySelector("a"),r=m(),o=r.variationId||r.productId;h(),a&&a.querySelector(".wd-loader-overlay").classList.add("wd-loading"),t.classList.add("loading"),jQuery.ajax({url:woodmart_settings.ajaxurl,data:e,method:"POST",success:function(e){var t,r;e&&e.hasOwnProperty("data")&&(e.data.notice&&n&&(t=e.data.success?"success":"warning",w(n,e.data.notice,t)),e.data.state&&(t=e.data.state,r=o,"signed"===t?d.includes(r)||d.push(r):"not-signed"===t&&d.includes(r)&&(d=d.filter(function(e){return e!==r}))),a&&v(o),i(o))},error:function(){console.error("ajax adding to price tracker error")},complete:function(){a&&a.querySelector(".wd-loader-overlay").classList.remove("wd-loading"),t.classList.remove("loading")}})}function m(){var t=!1,e=(document.querySelector('body[class*="postid-"]').classList.forEach(function(e){e.includes("postid-")&&(t=e.replace("postid-",""))}),y()),r=0;return e&&(r=(e=e.querySelector("input.variation_id")).value?parseInt(e.value):0),{productId:parseInt(t),variationId:parseInt(r)}}function w(e,t,r){var a;e&&(h(),(a=document.createElement("div")).classList.add("wd-notice","wd-"+r),a.append(t),e.append(a))}function _(){return document.querySelector(".wd-pt-btn")}function f(){return document.querySelector("#wd-popup-pt")}function y(){return document.querySelector(".variations_form")}function g(){var e=f();return e&&e.closest(".mfp-ready")?e:document.querySelector(".woocommerce-notices-wrapper")}function h(t=""){var e=g();e&&0!==(e=e.querySelectorAll(".wd-notice")).length&&e.forEach(e=>{t&&!e.innerText.includes(t)||e.remove()})}!async function(){var e,t,r,a,n,o,i=_();i&&("yes"===woodmart_settings.pt_fragments_enable?(n=await async function(e){try{return await jQuery.ajax({url:woodmart_settings.ajaxurl,data:{action:"woodmart_update_price_tracker_form",product_id:e},dataType:"json",method:"GET"})}catch(e){console.error("Error updating form data:",e)}}((o=m()).productId))&&(n.signed_variations&&0<n.signed_variations.length?d=n.signed_variations:n.is_signed&&d.push(o.productId),i.classList.remove("wd-disabled")):y()&&(d=JSON.parse(i.dataset.signedVariations||"[]")),c(i),n=_(),o=f(),i=y(),n)&&(n.classList.contains("wd-pt-remove")&&n.addEventListener("click",p),o?(e=o.querySelector(".wd-pt-add"),t=o.querySelector('[name="wd-pt-policy-check"]'),r=o.querySelector('[name="wd-pt-desired-price-check"]'),a=o.querySelector('[name="wd-pt-user-desired-price"]'),o=o.querySelector(".wd-close-popup"),e.addEventListener("click",l),jQuery(document).one("mfpClose",function(){h()}),t&&t.addEventListener("change",function(){t.checked&&h(woodmart_settings.pt_policy_check_msg)}),r&&a&&(a.addEventListener("click",function(){r.checked=!0}),r.addEventListener("change",function(){r.checked?a.focus():a.value=""})),o.addEventListener("click",function(e){e.preventDefault(),jQuery.magnificPopup.close()})):n.classList.contains("wd-pt-add")&&n.addEventListener("click",l),i)&&jQuery(".variations_form").off("show_variation",s).on("show_variation",s).off("click",".reset_variations",u).on("click",".reset_variations",u)}()},window.addEventListener("load",function(){woodmartThemeModule.ptSubscribeForm()});