-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
1.6.5-onboarding.min.js.download
1 lines (1 loc) · 11 KB
/
1.6.5-onboarding.min.js.download
1
!function(e){function a(t){if(s[t])return s[t].exports;var r=s[t]={exports:{},id:t,loaded:!1};return e[t].call(r.exports,r,r.exports,a),r.loaded=!0,r.exports}var s={};return a.m=e,a.c=s,a.p="",a(0)}({0:function(e,a,s){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}var r=s(147),i=t(r);document.addEventListener("DOMContentLoaded",function(){var e=window.location.host,a=new XMLHttpRequest;a.open("GET","https://"+e+"/jsConfig.json"),a.onload=function(){if(200===a.status){var s=JSON.parse(a.responseText),t=document.querySelector(".onboarding-iframe");if(null!==t){new i.default(s)}}else console.log("Request for https://"+e+"/jsConfig.json failed. Returned status of "+a.status)},a.send()},!1)},147:function(e,a){"use strict";function s(e){function a(e){for(var a=window.location.search.substring(1),s=a.split("&"),t=0;t<s.length;t++){var r=s[t].split("=");if(r[0]==e)return r[1]}return null}function s(e,a){a||(a=u),e=e.replace(/[\[\]]/g,"\\$&");var s=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)"),t=s.exec(a);return t?t[2]?decodeURIComponent(t[2].replace(/\+/g," ")):"":null}function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en",a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"CFD",t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"demo",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:w,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"false",l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",d=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"",c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,n={l:e,r:a,p:s,i:t,e:r,sc:i,iaid:l,d:d,lsrc:c},p="",o=0;for(var m in n)p+=(0===o?"?":"&")+m+"="+n[m],o++;return p}function r(e,a){var s=m+"/#/",t=s+a;e.src=t,e.classList.remove("hide"),f.classList.add("no-scroll")}function i(e){e.classList.add("hide"),e.src="",f.classList.remove("no-scroll")}function l(){for(var e=function(e){var a=b[e];a.addEventListener("click",function(e){e.preventDefault();var i=(navigator.userAgent.toLowerCase(),a.dataset.function),l=document.querySelector("iframe.onboarding-iframe"),d=e.target.hasAttribute("data-iframe-params"),c=e.target.hasAttribute("data-lsrc"),n=document.getElementsByTagName("body")[0],p=a.previousElementSibling,o=a.getAttribute("href"),m=A,f=void 0,u=s("iaid",o);if(u&&null!==u.length&&(g=u),window.location.href.indexOf("iaid=")!=-1&&(g=s("iaid"),null!=e.target.getAttribute("data-iframe-params")&&e.target.setAttribute("data-iframe-params",e.target.getAttribute("data-iframe-params").replace("iaid=null","iaid="+g))),"gb"!=F&&"ie"!=F||(m="SB"),o.includes("&ap=CFD_MT4")||(o.indexOf("mt4")>-1||o.indexOf("MT4")>-1)&&(m="MT4"),o.indexOf("zh-ca")>-1&&(F="zh-ca"),o.indexOf("fr-ca")>-1&&(F="fr-ca"),f=D[h][i][m.toLowerCase()],p&&p.value&&(w=p.value),n&&(T=n.dataset.language,F=n.dataset.region,j=n.dataset.domain),d){var b=e.target.getAttribute("data-iframe-params");z=b.length>3?b+"&e="+w:t(T,F,m,i,w,S,g,j,_)}else c&&(_=e.target.getAttribute("data-lsrc")),z=t(T,F,m,i,w,S,g,j,_),f&&(z=f+"&iaid="+g+"&e="+w);e.preventDefault(),r(l,z)})},a=0;a<v;a++)e(a)}function d(){var e=a("launchmodal"),s=a("modalproduct");e&&s&&("nb"===T&&(T="no"),r(M,t(T,F,s,e,w,S,g,j,_)))}function c(){var e=document.querySelectorAll("a.js-modal"),a=window.location.href.indexOf("hdev3")>-1,s=["de-at","es-es","fr-fr","it-it","nb-no","pl-pl","sv-se"],t=document.querySelector("html").getAttribute("lang").toLowerCase(),r=s.includes(t);e.forEach(function(e){return a&&(e.href=e.href.replace("https://signup.cmcmarkets","https://hdev3-signup.cmcmarkets")),"de-de"===t?(e.dataset.iframeParams&&!e.dataset.iframeParams.includes("&p=DPS&ap=CFD_DPS")&&e.dataset.iframeParams.includes("&p=CFD")&&e.setAttribute("data-iframe-params",e.dataset.iframeParams.replace("&p=CFD","&p=DPS&ap=CFD_DPS")),void(!e.href.includes("&p=DPS&ap=CFD_DPS")&&e.href.includes("&p=CFD")&&(e.href=e.href.replace("&p=CFD","&p=DPS&ap=CFD_DPS")))):r?(e.dataset.iframeParams&&!e.dataset.iframeParams.includes("&ap=CFD_MT4")&&e.dataset.iframeParams.includes("&p=CFD")&&(e.href=e.href+"&ap=CFD_MT4",e.setAttribute("data-iframe-params",e.dataset.iframeParams.replace("&p=CFD","&ap=CFD_MT4"))),void(e.href.includes("&p=CFD")&&!e.href.includes("&ap=CFD_MT4")&&(e.href=e.href+"&ap=CFD_MT4"))):void 0})}function n(e,a,s,t,r){var i=new Date;s=s||30,i.setTime(i.getTime()+24*s*60*60*1e3);var l="expires="+i.toUTCString();t&&r?document.cookie=e+"="+a+"; "+l+";domain="+t+";path="+r:document.cookie=e+"="+a+"; "+l}function p(e){for(var a=e+"=",s=document.cookie.split(";"),t=0;t<s.length;t++){for(var r=s[t];" "===r.charAt(0);)r=r.substring(1);if(0===r.indexOf(a))return r.substring(a.length,r.length)}return""}function o(){function e(e){var s=document.querySelectorAll("[data-iframe-params]"),t=document.querySelectorAll("a.js-modal");null===a&&(a=e),null!=s&&s.forEach(function(e){if(null!==e){var s=e.dataset.iframeParams.replace("iaid=null","iaid="+a),t=e.getAttribute("href"),r=t.replace("iaid=null","iaid="+a);e.setAttribute("href",r),e.setAttribute("data-iframe-params",s)}}),t.forEach(function(e){var s=e.getAttribute("href"),t=s.replace("iaid=null","iaid="+a);e.setAttribute("href",t)})}var a=s("iaid"),t=p("IAIDCookie");t&&e(t),window.location.href.indexOf("iaid=")!=-1&&(e(),n("IAIDCookie",a,365))}var m=e.signup,f=document.documentElement,u=window.location.href,b=document.querySelectorAll(".js-modal"),v=b.length,C=function(){return document.querySelector("#websiteUrl")?document.querySelector("#websiteUrl").value:document.querySelector("html").hasAttribute("lang")?document.querySelector("html").getAttribute("lang"):"en-gb"},h=C(),M=document.querySelector(".onboarding-iframe"),g=s("iaid"),D={en:{live:{cfd:"?l=en&p=CFD&i=live&inApp=0&ch=4&lsrc=0",sb:"",mt4:"?l=en&p=MT4&i=live&inApp=0&ch=4&lsrc=0",stb:""},demo:{cfd:"?l=en&p=CFD&i=demo&inApp=0&ch=4&lsrc=0",sb:"",mt4:"?l=en&p=MT4&i=demo&inApp=0&ch=4&lsrc=0",stb:""}},"en-de":{live:{cfd:"?l=en&p=CFD&i=live&inApp=0&ch=4&lsrc=0",sb:"",mt4:"?l=en&p=MT4&i=live&inApp=0&ch=4&lsrc=0",stb:""},demo:{cfd:"?l=en&p=CFD&i=demo&inApp=0&ch=4&lsrc=0",sb:"",mt4:"?l=en&p=MT4&i=demo&inApp=0&ch=4&lsrc=0",stb:""}},"en-gb":{live:{cfd:"?jid=gb1&lsrc=0",sb:"?jid=gb1&lsrc=0",mt4:"?jid=gb2&lsrc=0",stb:""},demo:{cfd:"?jid=gb3&lsrc=0",sb:"?jid=gb3&lsrc=0",mt4:"?jid=gb4&lsrc=0",stb:""}},"en-ie":{live:{cfd:"",sb:"",mt4:"?l=en&r=ie&p=MT4&ap=MT4&i=live&inApp=0&ch=4&lsrc=0",stb:""},demo:{cfd:"",sb:"",mt4:"?l=en&r=ie&p=MT4&ap=MT4&i=demo&inApp=0&ch=4&lsrc=0",stb:""}},de:{live:{cfd:"",sb:"",mt4:"?l=de&r=&p=MT4&ap=MT4&i=live&inApp=0&ch=4&lsrc=0",stb:""},demo:{cfd:"",sb:"",mt4:"?l=de&r=&p=MT4&ap=MT4&i=demo&inApp=0&ch=4&lsrc=0",stb:""}},"de-at":{live:{cfd:"?l=de&r=at&p=CFD&i=live&sc=false&d=CMC&lsrc=1&rp=false&ap=CFD_MT4",sb:"",mt4:"?l=de&r=at&p=MT4&ap=MT4&i=live&inApp=0&ch=4&lsrc=0",stb:""},demo:{cfd:"?l=de&r=at&p=CFD&i=demo&sc=false&d=CMC&lsrc=1&rp=false&ap=CFD_MT4",sb:"",mt4:"?l=de&r=at&p=MT4&ap=MT4&i=demo&inApp=0&ch=4&lsrc=0",stb:""}},"de-de":{live:{cfd:"?l=de&r=de&i=live&sc=false&d=CMC&lsrc=1&rp=false&p=DPS&ap=CFD_DPS",sb:"",mt4:"?l=de&r=de&p=MT4&ap=MT4&i=live&inApp=0&ch=4&lsrc=0",stb:""},demo:{cfd:"?l=de&r=de&i=demo&sc=false&d=CMC&lsrc=1&rp=false&p=DPS&ap=CFD_DPS",sb:"",mt4:"?l=de&r=de&p=MT4&ap=MT4&i=demo&inApp=0&ch=4&lsrc=0",stb:""}},"fr-fr":{live:{cfd:"?l=fr&r=fr&p=CFD&i=live&sc=false&d=CMC&lsrc=1&rp=false&ap=CFD_MT4",sb:"",mt4:"?l=fr&r=fr&p=MT4&i=live&sc=false&d=CMC&lsrc=1&rp=false",stb:""},demo:{cfd:"?l=fr&r=fr&p=CFD&i=demo&sc=false&d=CMC&lsrc=1&rp=false&ap=CFD_MT4",sb:"",mt4:"?l=fr&r=fr&p=MT4&i=demo&sc=false&d=CMC&lsrc=1&rp=false",stb:""}},"it-it":{live:{cfd:"?l=it&r=it&p=CFD&i=live&sc=false&d=CMC&lsrc=1&rp=false&ap=CFD_MT4",sb:"",mt4:"?l=it&r=it&p=MT4&i=live&sc=false&d=CMC&lsrc=1&rp=false",stb:""},demo:{cfd:"?l=it&r=it&p=CFD&i=demo&sc=false&d=CMC&lsrc=1&rp=false&ap=CFD_MT4",sb:"",mt4:"?l=it&r=it&p=MT4&i=demo&sc=false&d=CMC&lsrc=1&rp=false",stb:""}},"es-es":{live:{cfd:"?l=es&r=es&p=CFD&i=live&sc=false&d=CMC&lsrc=1&rp=false&ap=CFD_MT4",sb:"",mt4:"?l=es&r=es&p=MT4&ap=MT4&i=live&inApp=0&ch=4&lsrc=0",stb:""},demo:{cfd:"?l=es&r=es&p=CFD&i=demo&sc=false&d=CMC&lsrc=1&rp=false&ap=CFD_MT4",sb:"",mt4:"?l=es&r=es&p=MT4&ap=MT4&i=demo&inApp=0&ch=4&lsrc=0",stb:""}},"nb-no":{live:{cfd:"?l=no&r=no&p=CFD&i=live&sc=false&d=CMC&lsrc=1&rp=false&ap=CFD_MT4",sb:"",mt4:"?l=no&r=no&p=MT4&ap=MT4&i=live&inApp=0&ch=4&lsrc=0",stb:""},demo:{cfd:"?l=no&r=no&p=CFD&i=demo&sc=false&d=CMC&lsrc=1&rp=false&ap=CFD_MT4",sb:"",mt4:"?l=no&r=no&p=MT4&ap=MT4&i=demo&inApp=0&ch=4&lsrc=0",stb:""}},"sv-se":{live:{cfd:"?l=sv&r=se&p=CFD&i=live&sc=false&d=CMC&lsrc=1&rp=false&ap=CFD_MT4",sb:"",mt4:"?l=sv&r=se&p=MT4&ap=MT4&i=live&inApp=0&ch=4&lsrc=0",stb:""},demo:{cfd:"?l=sv&r=se&p=CFD&i=demo&sc=false&d=CMC&lsrc=1&rp=false&ap=CFD_MT4",sb:"",mt4:"?l=sv&r=se&p=MT4&ap=MT4&i=demo&inApp=0&ch=4&lsrc=0",stb:""}},"pl-pl":{live:{cfd:"?l=pl&r=pl&p=CFD&i=live&sc=false&d=CMC&lsrc=1&rp=false&ap=CFD_MT4",sb:"",mt4:"?l=pl&r=pl&p=MT4&ap=MT4&i=live&inApp=0&ch=4&lsrc=0",stb:""},demo:{cfd:"?l=pl&r=pl&p=CFD&i=demo&sc=false&d=CMC&lsrc=1&rp=false&ap=CFD_MT4",sb:"",mt4:"?l=pl&r=pl&p=MT4&ap=MT4&i=demo&inApp=0&ch=4&lsrc=0",stb:""}},"en-au":{live:{cfd:"?jid=au1&lsrc=",sb:"",mt4:"?jid=au3&lsrc=0",stb:""},demo:{cfd:"?jid=au5&lsrc=",sb:"",mt4:"?jid=au3&lsrc=0",stb:""}},"en-nz":{live:{cfd:"?jid=nz1&lsrc=",sb:"",mt4:"?jid=nz3&lsrc=0",stb:""},demo:{cfd:"?jid=nz5&lsrc=",sb:"",mt4:"?jid=nz5&lsrc=",stb:""}},"en-sg":{live:{cfd:"?jid=sg1&lsrc=",sb:"",mt4:"?jid=sg3&lsrc=0",stb:""},demo:{cfd:"?jid=sg5&lsrc=",sb:"",mt4:"?jid=sg5&lsrc=",stb:""}},"en-ca":{live:{cfd:"?jid=ca1&lsrc=0",sb:"",mt4:"?jid=ca4&lsrc=0",stb:""},demo:{cfd:"?jid=ca7&lsrc=0",sb:"",mt4:"?jid=ca10&lsrc=0",stb:""}},"fr-ca":{live:{cfd:"?jid=ca2&lsrc=0",sb:"",mt4:"?jid=ca5&lsrc=0",stb:""},demo:{cfd:"?jid=ca8&lsrc=0",sb:"",mt4:"?jid=ca11&lsrc=0",stb:""}},"zh-ca":{live:{cfd:"?jid=ca3&lsrc=0",sb:"",mt4:"?jid=ca6&lsrc=0",stb:""},demo:{cfd:"?jid=ca9&lsrc=0",sb:"",mt4:"?jid=ca12&lsrc=0",stb:""}},zh:{live:{cfd:"?l=zh&p=CFD&i=live&inApp=0&ch=4&lsrc=0",sb:"",mt4:"?l=zh&p=MT4&i=live&inApp=0&ch=4&lsrc=0",stb:""},demo:{cfd:"?l=zh&p=CFD&i=demo&inApp=0&ch=4&lsrc=0",sb:"",mt4:"?l=zh&p=MT4&i=demo&inApp=0&ch=4&lsrc=0",stb:""}},"zh-au":{live:{cfd:"?jid=au2&lsrc=",sb:"",mt4:"?jid=au4&lsrc=0",stb:""},demo:{cfd:"?jid=au6&lsrc=",sb:"",mt4:"?jid=au8&lsrc=",stb:""}},"zh-nz":{live:{cfd:"?jid=nz2&lsrc=",sb:"",mt4:"?jid=nz4&lsrc=0",stb:""},demo:{cfd:"?jid=nz6&lsrc=",sb:"",mt4:"?jid=nz8&lsrc=",stb:""}},"zh-sg":{live:{cfd:"?jid=sg2&lsrc=",sb:"",mt4:"?jid=sg4&lsrc=0",stb:""},demo:{cfd:"?jid=sg6&lsrc=",sb:"",mt4:"?jid=sg8&lsrc=",stb:""}}},T=h.substring(0,2),F=h.length>2?h.slice(-2):h.substring(0,2),A="CFD",j="CMC",_=1,w="",S=!1,P=["en-au"],z=void 0;P.map(function(e,a){e===h&&(S=!0)}),M&&(c(),l(),d(),o()),window.addEventListener("message",function(e){~e.origin.indexOf(m)&&(e.data.closeApplicationForm===!0?i(M):e.data.pushToDataLayer?window.dataLayer&&window.dataLayer.push(e.data.pushToDataLayer.data):e.data.url&&(window.location.href=e.data.url))})}Object.defineProperty(a,"__esModule",{value:!0}),a.default=s}});