1const showPassIcon = BASE_URL + "web_assets/frontend/img/show_pass.svg"; 2const hidePassIcon = BASE_URL + "web_assets/frontend/img/hide_pass.svg"; 3let inProgress = false; 4$(document).ready(function () { 5 $('.resErr').html('').hide(); 6 // Register Page Subscribe Button 7 $(".plan-card-new").on('click', function () { 8 $('.plan-card-new').removeClass('active'); 9 $(this).addClass('active'); 10 const queries = ['10,000', '50,000', '100,000']; 11 $(".search_queries").text(queries[$(this).index()] || ''); 12 }) 13 $('.planSubscribeBtn').on('click', function (e) { 14 e.preventDefault(); 15 const planBox = $('.plan-card-new.active').find('.plan__details'); 16 if (!planBox.length) { 17 alertBox('warning', 'No Plan Selected', 'Please choose a plan before proceeding.'); 18 return; 19 } 20 const url = planBox.attr('data-url'); 21 if (url && url !== '#') { 22 window.location.href = url; 23 return; 24 } 25 const plan_id = parseInt(planBox.attr('data-pid')) || 0 26 const plan_code = parseInt(planBox.attr('data-code')) || 0 27 const coupon_code = planBox.attr('data-coupon') 28 $(".loginRegisterPopUP").removeClass("hidden"); 29 $(".plan_id").val(plan_id); 30 $(".plan_code").val(plan_code); 31 $(".coupon_code").val(coupon_code); 32 $(".premium_login").val(1); 33 $.ajax({ 34 type: "POST", 35 url: BASE_URL + "ajax/set-payment-cookie", 36 data: { 37 plan_id, 38 plan_code, 39 // coupon_code //Add this line if you want to use coupon code 40 } 41 }); 42 }); 43 // Plan Page Subscribe Button 44 $('.planSubscribe').on('click', (e) => { 45 closePremiumPopup() 46 e.preventDefault(); 47 const _this = $(e.currentTarget); 48 const plan_id = parseInt(_this.attr('data-pid')) || 0 49 const plan_code = parseInt(_this.attr('data-code')) || 0 50 const coupon_code = _this.attr('data-coupon') 51 $(".loginRegisterPopUP").removeClass("hidden"); 52 $(".plan_id").val(plan_id); 53 $(".plan_code").val(plan_code); 54 $(".coupon_code").val(coupon_code); 55 $(".premium_login").val(1); 56 $.ajax({ 57 type: "POST", 58 url: BASE_URL + "ajax/set-payment-cookie", 59 data: { 60 plan_id, 61 plan_code, 62 // coupon_code //Add this line if you want to use coupon code 63 } 64 }); 65 }); 66 $('.regForm, .loginForm').on('keyup keypress', function (e) { 67 var keyCode = e.keyCode || e.which; 68 69 if (keyCode === 13) { 70 e.preventDefault(); 71 72 if ($(this).hasClass('loginForm')) { 73 $('.loginBtn').click(); 74 } else if ($(this).hasClass('regForm')) { 75 $('.registerBtn').click(); 76 } 77 } 78 }); 79 80 $(".regForm").on('submit', (e) => { 81 e.preventDefault(); 82 const _this = $(e.currentTarget); 83 const serializeData = _this.serializeArray(); 84 const data = {}; 85 serializeData.forEach(item => { 86 data[item.name] = item.value; 87 }); 88 const email = data.email; 89 const name = data.name; 90 const password = data.password; 91 if (name == "") { 92 validationError("#name_error", "Name is required"); 93 $("#name").addClass('!ring-red-500'); 94 return 95 } else if (!isValidName(name)) { 96 validationError("#name_error", "Please enter a valid name. Only letters, spaces, hyphens (-), and apostrophes (') are allowed. URLs or links are not permitted."); 97 $("#name").addClass('!ring-red-500'); 98 return 99 } else if (email === "") { 100 validationError("#reg_email_error", "Please enter the email"); 101 return 102 } else if (!isValidEmail(email)) { 103 validationError("#reg_email_error", "Please enter valid email"); 104 return 105 } else if (password == "") { 106 validationError("#reg_password_error", "Password is required"); 107 return 108 } else { 109 $(".validation").empty().prev().find('input').removeClass('!ring-red-500'); 110 $('.registerBtn,#regBtn').prop('disabled', true); 111 $("#regBtn").text('Redirecting...'); 112 with_cloudflare_captcha(false, (Date.now() / 1000), registerForm, 'light', "#cloudflare_register_container", data); 113 } 114 }); 115 $(".loginForm").on('submit', (e) => { 116 e.preventDefault(); 117 const _this = $(e.currentTarget); 118 const serializeData = _this.serializeArray(); 119 const data = {}; 120 serializeData.forEach(item => { 121 data[item.name] = item.value; 122 }); 123 const email = data.email; 124 const password = data.password; 125 if (email == '') { 126 validationError("#email_error", "Please enter email"); 127 } else if (!isValidEmail(email)) { 128 validationError("#email_error", "Please enter valid email"); 129 } else if (password.length < 3) { 130 validationError("#email_error", "Please enter the Password"); 131 } else { 132 $(".validation").empty().prev().find('input').removeClass('!ring-red-500'); 133 $('.loginBtn').prop('disabled', true); 134 $(".loginBtn").text('Redirecting...'); 135 with_cloudflare_captcha(false, (Date.now() / 1000), loginFormAjax, 'light', '#login_cloudflare_container', data); 136 } 137 }); 138 139 $('.loginForm').on('keyup keypress', function (e) { 140 var keyCode = e.keyCode || e.which; 141 if (keyCode === 13) { 142 e.preventDefault(); 143 $("#checkBtn2").click(); 144 } 145 }); 146 $('.regForm').on('keyup keypress', function (e) { 147 var keyCode = e.keyCode || e.which; 148 if (keyCode === 13) { 149 e.preventDefault(); 150 $("#regBtn").click(); 151 } 152 }); 153 // POPUP Handling Script 154 $(".plan-action-btn").on('click', function () { 155 $('.premium_login').val(0); 156 closePremiumPopup() 157 $(".loginRegisterPopUP").removeClass("hidden") 158 $.ajax({ 159 type: "POST", 160 url: BASE_URL + "ajax/set-payment-cookie", 161 data: { 162 payment: 'false' 163 } 164 }); 165 }) 166 $(".closeLoginRegister").on("click", closePopUp); 167 $(".loginRegisterPopUP").on('click', function (event) { 168 if (!$(event.target).closest(".signUpForm, .signInForm").length) closePopUp(); 169 }); 170 $(".showLogin, .showSignUp").on('click', function () { 171 $(".validation").empty().prev().find('input').removeClass('!ring-red-500'); 172 $(".signUpForm, .signInForm").toggleClass("hidden"); 173 }); 174 $('.togglePassShow').on('click', function () { 175 const icon = $(this); 176 const input = icon.siblings('input'); 177 const isPassword = input.attr('type') === 'password'; 178 input.attr('type', isPassword ? 'text' : 'password'); 179 icon.attr('src', isPassword ? hidePassIcon : showPassIcon) 180 }); 181}); 182 183const isValidEmail = (email) => { 184 const re = /^[^@\s+]+@[^@\s]+\.[^@\s]+$/; 185 return re.test(String(email).toLowerCase()); 186}; 187const loginFormAjax = (captcha_1, captcha_2, body) => { 188 let data = addDefaultData(body, captcha_1, captcha_2) 189 $.ajax({ 190 type: "POST", 191 url: BASE_URL + "emd/login/web", 192 data, 193 beforeSend: () => { 194 $('.loginBtn').prop('disabled', false); 195 }, 196 success: function (response) { 197 if (response.status) { 198 if (response?.checkout) { 199 window.location.href = response.checkout; 200 return; 201 } 202 window.location.href = BASE_URL + "account"; 203 } else { 204 validationError("#login_error", response.mess); 205 $(".loginBtn").text('Login'); 206 return; 207 } 208 }, 209 error: function (jqXHR) { 210 const response = jqXHR.responseJSON; 211 const message = response?.mess || response?.message || 'An error occurred.'; 212 validationError("#login_error", message); 213 $(".loginBtn").text('Login'); 214 if (response.verify_require) { 215 window.location.href = BASE_URL + "verify-email?email=" + btoa(body.email); 216 } 217 }, 218 complete: () => { 219 $('.loginBtn').prop('disabled', false); 220 } 221 }); 222} 223const registerForm = (captcha_1, captcha_2, body) => { 224 let data = addDefaultData(body, captcha_1, captcha_2) 225 $.ajax({ 226 type: "POST", 227 url: BASE_URL + "emd/register/web", 228 data, 229 beforeSend: () => { 230 $('.registerBtn,#regBtn').prop('disabled', true); 231 }, 232 success: function (response) { 233 if (response.status) { 234 if (response?.checkout) { 235 window.location.href = response.checkout; 236 return; 237 } 238 window.location.href = BASE_URL + "account"; 239 } else { 240 validationError("#register_error", response.mess); 241 return; 242 } 243 }, 244 error: function (jqXHR) { 245 const response = jqXHR.responseJSON; 246 const message = response?.mess || response?.message || 'An error occurred.'; 247 validationError("#register_error", message); 248 if (response.verify_require) { 249 window.location.href = BASE_URL + "verify-email?email=" + btoa(body.email); 250 } 251 }, 252 complete: () => { 253 $(".registerBtn").text('Sign Up'); 254 $('.registerBtn,#regBtn').prop('disabled', false); 255 } 256 }); 257} 258 259const validationError = (selector, message) => { 260 let html = `<span id="email_error" 261 class="mt-0 flex pt-1.5 gap-1"> 262 <svg width="16" height="17" viewBox="0 0 16 17" fill="none" 263 xmlns="http://www.w3.org/2000/svg"> 264 <path 265 d="M8 6.36663V8.49996M8 10.6333H8.00533M13.3333 8.49996C13.3333 11.4455 10.9455 13.8333 8 13.8333C5.05448 13.8333 2.66667 11.4455 2.66667 8.49996C2.66667 5.55444 5.05448 3.16663 8 3.16663C10.9455 3.16663 13.3333 5.55444 13.3333 8.49996Z" 266 stroke="#EF4444" stroke-width="1.5" stroke-linecap="round" 267 stroke-linejoin="round" /> 268 </svg> 269 <p class="text-xs font-normal text-[#64748B]">${message}</p> 270 </span>`;
271 $(".validation").empty().prev().find('input').removeClass('!ring-red-500'); 272 $(selector).html(html).prev().find('input').addClass('!ring-red-500'); 273} 274const closePopUp = () => { 275 $('#regForm')[0].reset() 276 $('.loginForm')[0].reset() 277 $(".loginRegisterPopUP").addClass("hidden"); 278 $(".validation").empty().prev().find("input").removeClass("!ring-red-500") 279}
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.