PageSourceSearch

https://myindustry.ir/wp-content/cache/wpo-minify/1789545727/asset…-footer-cfturnstile-woo-js1789545707.min.js

js myindustry.ir collected 2026-09-24 21:21:41 UTC 3,802 bytes, 32 lines download raw bytes

1
2(function(){var WIDGET_ID='cf-turnstile-woo-checkout';function cfturnstileWooWidget(){return document.querySelector('form.checkout #'+WIDGET_ID)||document.getElementById(WIDGET_ID)}
3function cfturnstileWooOnReady(fn){if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',fn)}else{fn()}}
4function cfturnstileWooClicked(e,selector){return!!(e.target&&e.target.closest&&e.target.closest(selector))}
5function cfturnstileWooOpts(target){return(typeof window.cfturnstileOpts==='function')?window.cfturnstileOpts(target):{}}
6function turnstileWooCheckoutReset(){if(typeof turnstile==='undefined'){return}
7var el=cfturnstileWooWidget();if(!el){return}
8if(!el.firstElementChild){try{turnstile.render(el,cfturnstileWooOpts(el))}catch(e){}
9return}
10try{turnstile.reset(el);return}catch(e){}
11try{turnstile.remove(el)}catch(e){}
12try{turnstile.render(el,cfturnstileWooOpts(el))}catch(e){}}
13document.addEventListener('click',function(e){if(!cfturnstileWooClicked(e,'.showlogin, .show-login, .e-show-login, .woocommerce-form-login-toggle a')){return}
14setTimeout(function(){if(typeof turnstile==='undefined'){return}
15try{turnstile.remove('.sct-woocommerce-login')}catch(err){}
16try{turnstile.render('.sct-woocommerce-login',cfturnstileWooOpts('.sct-woocommerce-login'))}catch(err){}},250)});function cfturnstileWooRun(){var $=window.jQuery;$(document).ready(function(){var attempted=!1;function hasCheckoutError(){return!!document.querySelector('.woocommerce-error')}
17$(document.body).on('submit','form.checkout',function(){attempted=!0});if(hasCheckoutError()){setTimeout(turnstileWooCheckoutReset,50)}
18$(document.body).on('update_checkout updated_checkout applied_coupon_in_checkout removed_coupon_in_checkout',function(){var el=cfturnstileWooWidget();if(!el||!el.firstElementChild){setTimeout(turnstileWooCheckoutReset,300);return}
19if(attempted&&hasCheckoutError()){setTimeout(turnstileWooCheckoutReset,300);attempted=!1}});$(document.body).on('checkout_error',function(){setTimeout(turnstileWooCheckoutReset,500);attempted=!1})})}
20function cfturnstileWooBlockRun(){if(!document.querySelector('.wp-block-woocommerce-checkout, .wc-block-checkout')||typeof wp==='undefined'||!wp.data){return}
21function setExtensionData(token){var dispatch=wp.data.dispatch('wc/store/checkout');if(!dispatch){return}
22if(typeof dispatch.setExtensionData==='function'){dispatch.setExtensionData('simple-cloudflare-turnstile',{token:token})}else if(typeof dispatch.__internalSetExtensionData==='function'){dispatch.__internalSetExtensionData('simple-cloudflare-turnstile',{token:token})}}
23function renderBlockWidget(){if(typeof turnstile==='undefined'){return}
24var el=cfturnstileWooWidget();if(!el){return}
25if(el.getAttribute('data-sct-init')==='true'&&el.firstElementChild){try{turnstile.reset(el);setExtensionData('');return}catch(e){}}
26try{turnstile.remove(el)}catch(e){}
27try{turnstile.render(el,{sitekey:el.dataset.sitekey,appearance:el.dataset.appearance||'always',callback:setExtensionData,'expired-callback':function(){setExtensionData('')}});el.setAttribute('data-sct-init','true')}catch(e){}}
28var clickTimer=null;document.addEventListener('click',function(e){if(!cfturnstileWooClicked(e,'.wc-block-components-checkout-place-order-button')){return}
29clearTimeout(clickTimer);clickTimer=setTimeout(renderBlockWidget,2000)});wp.data.subscribe(function(){var el=cfturnstileWooWidget();if(el&&(!el.firstElementChild||el.getAttribute('data-sct-init')!=='true')){renderBlockWidget()}},'wc/store/cart');renderBlockWidget()}
30cfturnstileWooOnReady(cfturnstileWooBlockRun);if(typeof window.jQuery!=='undefined'){cfturnstileWooRun()}else{var tries=0;var wait=setInterval(function(){if(typeof window.jQuery!=='undefined'){clearInterval(wait);cfturnstileWooRun()}else if(++tries>1200){clearInterval(wait)}},50)}})();
31
32

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.