PageSourceSearch

https://magicport.ai/front/js/modules/trial.js?v=1790156842

js magicport.ai collected 2026-09-24 12:09:36 UTC 13,608 bytes, 2 lines download raw bytes

1!function(){"use strict";const{checkVisible:e,isVisible:t,isHidden:a,parents:o,scrollingProgress:r,getRandomChartColor:i,getColor:n,formatNumber:l,unformatNumber:s,sleep:c,hasJSLoaded:m,setJSLoaded:d}=class{parents(e){let t=e,a=[];for(;null!=t.parentNode&&t.parentNode!==document.documentElement;)a.push(t.parentNode),t=t.parentNode;return a}isVisible(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}isHidden(e){const t=window.getComputedStyle(e);return"none"===t.display||"hidden"===t.visibility}checkVisible(e){const t=e.getBoundingClientRect(),a=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(t.bottom<0||t.top-a>=0)}scrollingProgress(){return(document.body.scrollTop||document.documentElement.scrollTop)/(document.documentElement.scrollHeight-document.documentElement.clientHeight)*100}getRandomChartColor(e,t=!1){const a=["#1abc9c","#e74c3c","#f1c40f","#3498db","#f39c12","#2ecc71","#8e44ad","#27ae60","#e67e22","#a29bfe","#ff7675","#d35400","#2980b9","#16a085","#c0392b","#9b59b6","#34495e","#55efc4","#81ecec","#74b9ff","#00b894","#00cec9","#0984e3","#6c5ce7","#ffeaa7","#fab1a0","#fd79a8","#fdcb6e","#e17055"],o=[];if(t)for(let t=0;t<e;t++)0===t?o.push("#FFFFFF"):t===e-1?o.push("#808080"):o.push(a[t]);else for(let t=0;t<e;t++)o.push(a[t]);return o}getColor(e){return{primary:"#2bace2",border:"#e8e8ee","neutral-100":"#f5f7f9","neutral-200":"#eceff3","neutral-300":"#dadee6","neutral-400":"#c0c7d3","neutral-500":"#959fb2","neutral-600":"#636d7e","neutral-700":"#394456","neutral-800":"#1c2536","neutral-900":"#00041a"}[e]||!1}formatNumber(e){return e.toLocaleString()}unformatNumber(e){return e.replace(/,/g,"")}sleep(e){return new Promise((t=>{setTimeout(t,e)}))}hasJSLoaded(e,t){const a=e.getAttribute("data-js-loaded");if(!a)return!1;const o=a.split(",").map((e=>e.trim()));return Array.isArray(t)?t.every((e=>o.includes(e))):o.includes(t)}setJSLoaded(e,t){const a=e.getAttribute("data-js-loaded");let o=a?a.split(",").map((e=>e.trim())):[];(Array.isArray(t)?t:[t]).forEach((e=>{o.includes(e)||o.push(e)})),e.setAttribute("data-js-loaded",o.join(","))}}.prototype,u=["tempmail.com","guerrillamail.com","mailinator.com","10minutemail.com","throwaway.email","temp-mail.org","fakeinbox.com","maildrop.cc","trashmail.com","getairmail.com","yopmail.com","mohmal.com","sharklasers.com","getnada.com","emailondeck.com"],p=["gmail.com","googlemail.com","outlook.com","hotmail.com","hotmail.co.uk","live.com","live.co.uk","msn.com","windowslive.com","yahoo.com","yahoo.co.uk","yahoo.co.in","yahoo.fr","yahoo.de","ymail.com","rocketmail.com","icloud.com","me.com","mac.com","aol.com","proton.me","protonmail.com","pm.me","gmx.com","gmx.de","gmx.net","mail.com","zoho.com","zohomail.com","yandex.com","yandex.ru","mail.ru","bk.ru","inbox.ru","list.ru","hey.com","fastmail.com","tutanota.com","tuta.io","hushmail.com","web.de","t-online.de","libero.it","orange.fr","free.fr","laposte.net","qq.com","163.com","126.com","naver.com","daum.net","hanmail.net"],f="#form-trial",g='button[type="submit"]',h=".modal",b="#email",y="[data-badge-email]",v="[data-modal-result]",k="[button-type]",S=".form__error",_=".form__error-label",A="#loginButton",L="#recaptcha-v2",C="button--processing",P="d-none",w="d-flex",I="is-error",T="started a trial",q="has a subscription",x='<svg class="form__error-icon icon"><use xlink:href="#icon-warning"></use></svg>',E=[{names:["gmail.com","googlemail.com"],label:"Gmail",url:"https://mail.google.com/",mobileUrl:"googlegmail://",androidIntent:"intent://mail.google.com/mail/#Intent;scheme=https;package=com.google.android.gm;end"},{names:["outlook.com","hotmail.com","live.com","msn.com"],label:"Outlook",url:"https://outlook.live.com/mail/",mobileUrl:"ms-outlook://",androidIntent:"intent://outlook.live.com/mail/#Intent;scheme=https;package=com.microsoft.office.outlook;end"},{names:["office.com","outlook.office.com","microsoft.com"],label:"Outlook",url:"https://outlook.office.com/mail/",mobileUrl:"ms-outlook://",androidIntent:"intent://outlook.office.com/mail/#Intent;scheme=https;package=com.microsoft.office.outlook;end"},{names:["yahoo.com","ymail.com","rocketmail.com"],label:"Yahoo Mail",url:"https://mail.yahoo.com/",mobileUrl:"ymail:
1//",androidIntent:"intent://mail.yahoo.com/#Intent;scheme=https;package=com.yahoo.mobile.client.android.mail;end"},{names:["icloud.com","me.com","mac.com"],label:"iCloud Mail",url:"https://www.icloud.com/mail/",mobileUrl:"message://"},{names:["proton.me","protonmail.com"],label:"Proton Mail",url:"https://mail.proton.me/",mobileUrl:"protonmail://"},{names:["zoho.com","zohomail.com"],label:"Zoho Mail",url:"https://mail.zoho.com/"},{names:["aol.com"],label:"AOL Mail",url:"https://mail.aol.com/"},{names:["yandex.com","yandex.ru"],label:"Yandex Mail",url:"https://mail.yandex.com/",mobileUrl:"yandexmail://",androidIntent:"intent://mail.yandex.com/#Intent;scheme=https;package=ru.yandex.mail;end"},{names:["gmx.com","gmx.de"],label:"GMX Mail",url:"https://navigator.gmx.net/mail"}];let V=!1,M=null;const H=()=>document.querySelector(f),O=e=>e?.querySelector(g),R=e=>e?.closest(h),N=e=>e?.querySelector(b),$=e=>e?.querySelectorAll(y),F=e=>e?.querySelectorAll(v),j=e=>e?.querySelectorAll(k),U=e=>e?.parentElement.querySelector(S),X=e=>e?.querySelector(_),B=e=>e?.querySelector(A),z=e=>e?.dataset.recaptchaV3Key,J=e=>.7,K=e=>e?.dataset.recaptchaV3Route,D=e=>e?.dataset.recaptchaV2Key,W=e=>e?.querySelector(L),Y=(e,t)=>{e&&(e.classList.toggle(C,t),e.disabled=t)},G=(e,t,a=null)=>{if("success"===t&&a&&(ae(a),re(a)),F(e)?.forEach((e=>{e.classList.add(P),e.classList.remove(w)})),t){const a=e?.querySelector(`[data-modal-result="${t}"]`);a&&(a.classList.remove(P),a.classList.add(w))}},Z=(e,t=!1)=>{j(e)?.forEach((e=>{const a="start-free-trial"===e.getAttribute("button-type");e.classList.toggle(P,t?a:!a),e.classList.toggle(w,t?!a:a)}))},Q=e=>{if(!e||"string"!=typeof e)return{isValid:!1,message:"Please enter a valid email address."};const t=e.toLowerCase().trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))return{isValid:!1,message:"Please enter a valid email address."};const[a,o]=t.split("@"),r=(a.match(/\./g)||[]).length;if(r>=4)return{isValid:!1,message:"This email address appears to be invalid. Please use a valid email."};if(a.includes("+"))return{isValid:!1,message:"Email addresses with + character are not allowed. Please use a different email."};const i=o.split(".")[0];if(/(.)\1{3,}/.test(i))return{isValid:!1,message:"This email domain appears to be invalid. Please use a valid email."};if((e=>{for(let t=2;t<=4;t+=1)for(let a=0;a<=e.length-2*t;a+=1){const o=e.substring(a,a+t);if(o===e.substring(a+t,a+2*t)){if(new RegExp(`(${o}){3,}`).test(e))return!0}}return!1})(i))return{isValid:!1,message:"This email domain appears to be invalid. Please use a valid email."};if(u.includes(o)||u.some((e=>o.endsWith(e))))return{isValid:!1,message:"Temporary email addresses are not allowed. Please use a permanent email."};if(p.includes(o))return{isValid:!1,message:"MagicPort doesn't accept personal email addresses. Please use your company email."};const n=(a.match(/\d/g)||[]).length,l=a.length;if(n/l>.6)return{isValid:!1,message:"This email address appears to be suspicious. Please use a valid email."};if(r>=3&&l>15){const e=a.split(".");if(e.reduce(((e,t)=>e+t.length),0)/e.length<3)return{isValid:!1,message:"This email address appears to be invalid. Please use a valid email."}}return{isValid:!0,message:""}},ee=(e,t)=>{if(!e)return;const a=U(e),o=X(a);a&&(o&&(o.innerHTML=`${x} ${t}`),a.classList.remove(P)),e.classList.add(I)},te=e=>{if(!e)return;const t=U(e);t&&t.classList.add(P),e.classList.remove(I)},ae=e=>{const t=R(H()),a=t?.querySelector("[data-button-dynamic-provider]"),o=t?.querySelector("[data-button-dynamic-provider-title]");if(!a)return;const r=(e=>{const t=e.split("@")[1]?.toLowerCase();if(!t)return null;for(const e of E)if(e.names.includes(t))return e;return null})(e);if(r){let e=r.url;/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(/Android/i.test(navigator.userAgent)&&r.androidIntent?e=r.androidIntent:/iPhone|iPad|iPod/i.test(navigator.userAgent)&&r.mobileUrl&&(e=r.mobileUrl)),a.href=e,o&&(o.textContent=r.label)}else a.href=`mailto:${e}`,o&&(o.textContent="Mail App")},oe=async(e,t)=>{e.preventDefault();const{form:a,submitButton:o,modal:r,modalInstance:i,emailInput:n,previewBadges:l,recaptchaV2Loaded:s}=t,c=n.value.trim(),m=Q(c);if(!m.isValid)return void ee(n,m.message);Y(o,!0),l?.forEach((e=>{e.textContent=n.value.trim()}));const d=new FormData(a);let u=null;if(s){if(u=grecaptcha.getResponse(M),!u){console.error("reCAPTCHA v2 response is missing."),Y(o,!1);let e=W(a).querySelector(".form__error");
1if(e){const t=e.querySelector(".form__error-label");t&&(t.textContent="Please verify reCAPTCHA.")}else e=document.createElement("div"),e.className="form__error",e.innerHTML='<span class="form__error-label">Please verify reCAPTCHA.</span>',W(a).appendChild(e);return}d.append("g-recaptcha-response",u)}try{const e=await fetch(a.getAttribute("action"),{method:"POST",body:d,headers:{"X-Requested-With":"XMLHttpRequest","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")}});if(G(r,null),!e.ok){const t=e.status;let o=await e.json(),r=o.errors||o;return 400!==t||"user_already_signed_in"!==r.key&&"user_already_signed_and_has_trial_redirect_to_mi"!==r.key?(400!==t||"user_already_registered"!==r.key&&"user_already_registered_and_has_trial_redirect_to_login"!==r.key||(B(a)?.setAttribute("href",r.url),r={email:["You already have an account. Please log in."]},Z(a,!0)),400===t&&"user_already_registered_and_has_trial_redirect_to_mi"===r.key&&(B(a)?.setAttribute("href",r.url),r={email:["You already have an account. Please log in."]},Z(a,!0)),void((e,t)=>{Object.entries(t).forEach((([t,a])=>{const o=e.querySelector(`[name="${t}"]`);if(!o)return;const r=U(o);if(!r)return;const i=X(r);if(!i)return;r.classList.remove(P);const n=Array.isArray(a)?a.join(", "):a;i.innerHTML=`${x} ${n}`,o.classList.add(I),(n.includes(T)||n.includes(q))&&Z(e,!0)}))})(a,r)):void(window.location.href=r.url)}switch((await e.json()).flow){case 1:G(r,"success",n.value.trim());break;case 2:G(r,"pending");break;case 3:G(r,"ending")}i&&i.setStep(2),(e=>{e.querySelectorAll(S).forEach((e=>{e.classList.add(P);const t=X(e);t&&(t.textContent="")})),e.querySelectorAll(`.${I}`).forEach((e=>e.classList.remove(I)))})(a),a.reset()}catch(e){i&&i.setStep(1)}finally{ie(),Y(o,!1)}},re=e=>{const t=R(H()),a=t?.querySelector("[data-resend-link]");if(!a)return;if("true"===a.dataset.initialized)return;a.dataset.initialized="true";const o=parseInt(a.dataset.resendLink,10)||60;let r=0,i=null;const n=t?.querySelector("[data-resend-text]"),l=n?.querySelector("[data-resend-remaining]"),s=()=>{r>0?(a.disabled=!0,l&&(l.textContent=(e=>{if(e<=0)return"0s";if(e<60)return`${e}s`;const t=Math.floor(e/60),a=e%60;return 0===a?`${t}m`:`${t}m ${a}s`})(r)),r--):(i&&(clearInterval(i),i=null),a.disabled=!1,n&&n.classList.add("d-none"))},m=async(e,t)=>{if(e.preventDefault(),e.stopPropagation(),a.disabled)return;a.classList.add("button--processing"),a.disabled=!0,await c(2e3),a.classList.remove("button--processing"),r=o,n&&n.classList.remove("d-none"),s(),i&&clearInterval(i),i=setInterval(s,1e3);const l=new FormData;l.append("email",t),l.append("fromResend","on"),await fetch(H().getAttribute("action"),{method:"POST",body:l,headers:{"X-Requested-With":"XMLHttpRequest","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")}})};a.addEventListener("click",(function(t){m(t,e)}))},ie=()=>{V&&grecaptcha.reset(M)};document.addEventListener("DOMContentLoaded",(()=>{const e=H();if(!e)return;const t={form:e,submitButton:O(e),modal:R(e),modalInstance:e.closest(h)?._modal,emailInput:N(e),previewBadges:$(e),recaptchaV2Loaded:V},a=(e=!1)=>{const a=t.emailInput?.value?.toString()?.trim()||"";if(0===a.length)return void te(t.emailInput);if(!(a.includes("@")&&a.split("@")[1]?.includes("."))&&!e)return;const o=Q(a);o.isValid?te(t.emailInput):ee(t.emailInput,o.message)};t.emailInput&&(t.emailInput.addEventListener("blur",(()=>a(!0))),t.emailInput.addEventListener("input",(()=>{(t.emailInput?.value?.toString()?.trim()||"").length>0?(clearTimeout(t.emailInput.validationTimeout),t.emailInput.validationTimeout=setTimeout(a,500)):a()}))),e.addEventListener("submit",(function(a){const o=t.emailInput?.value?.toString()?.trim()||"",r=Q(o);r.isValid?grecaptcha.execute(z(e),{action:"submit"}).then((function(o){fetch(K(e),{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")},body:JSON.stringify({token:o})}).then((e=>e.json())).then((o=>{o.success&&o.score>=J(e)||V?(t.recaptchaV2Loaded=V,oe(a,t)):((e=>{D(e)&&!V&&grecaptcha.ready((function(){M=grecaptcha.render(W(e),{sitekey:D(e),callback:function(e){V=!0},"error-callback":function(){console.error("reCAPTCHA v2 error occurred.")},"expired-callback":function(){console.warn("reCAPTCHA v2 expired. Please complete it again.")}})}))})(e),((e,t,a)=>
1{fetch("/log-recaptcha-issue",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")},body:JSON.stringify({message:e,details:t,email:a})}).catch((e=>{console.log("Error logging to server:",e)}))})("reCAPTCHA v3 verification failed or low score.",o,t.emailInput.value.trim()))})).catch((e=>{console.log(e)}))})):ee(t.emailInput,r.message)}))}))}();
2//# sourceMappingURL=trial.js.map

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.