1var initCaptcha = function(initCaptchaCallback, site_key) { 2 $('body').append('<div id="yandex-captcha-container" style="display: none !important;"></div>'); 3 loadJS('https://smartcaptcha.yandexcloud.net/captcha.js?render=onload&onload=' + initCaptchaCallback); 4} 5 6var renderCaptcha = function(site_key, callback) { 7 if (!window.smartCaptcha) return; 8 9 smartCaptcha.render('yandex-captcha-container', { 10 sitekey: site_key || GLOBAL.locale.smartcaptcha.site_key, 11 invisible: true, 12 hideShield: true, 13 callback: callback || function(token) {} 14 }); 15 16 smartCaptcha.execute(); 17} 18 19var checkCaptchaToken = function(options) { 20 const type = options.type || 'form'; 21 const site_key_name = type === 'chat' ? 'site_key_chat' : 'site_key'; 22 const token_name = type === 'chat' ? 'token_chat' : 'token'; 23 const captcha = 'smartcaptcha'; 24 25 if (!GLOBAL.locale[captcha][token_name]) { 26 const funcName = 'smartcaptcha' + Date.now(); 27 28 window[ funcName ] = function() { 29 renderCaptcha(GLOBAL.locale[captcha][site_key_name], function(token) { 30 GLOBAL.locale[captcha][token_name] = token; 31 options.callback(token); 32 }); 33 }; 34 35 initCaptcha(funcName, GLOBAL.locale[captcha][site_key_name]) 36 } else { 37 options.callback(GLOBAL.locale[captcha][token_name]); 38 } 39}
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.