@deriv-com/custom-scripts 1.26.50 → 1.26.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{initializeApp as e}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as t,ref as o,onValue as n}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function i(e,t,o,n){let i="";if(o){let e=new Date;e.setTime(e.getTime()+24*o*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=n?e+"="+(t||"")+i+`;domain=${n};path=/`:e+"="+(t||"")+i+";path=/"}function r(e,t){const o={};return e.split(";").forEach(e=>{const[t,n]=e.split("=").map(e=>e.trim());o[t]=decodeURIComponent(n)}),o[t]}function c(e){i("webflow-user-language",e,30),i("webflow-user-language",e,30,`.${window.location.hostname}`)}function s(e){document.cookie=e+"=; Max-Age=-99999999;"}const a="green.derivws.com";window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,t)=>{t?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const t=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(t)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,t=new URL(e).hostname,o=["deriv.com","deriv.be","deriv.me"].find(e=>t.endsWith(e));return o?`https://oauth.${o}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const t=r(document.cookie,"test_im_country"),o=r(document.cookie,"clients_country"),n=r(document.cookie,"client_information");return n?(null==(e=JSON.parse(n))?void 0:e.residence)||o:t||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"61554",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"53503"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),t=new URLSearchParams(window.location.search||"").get("app_id");if(t)return t;const o=localStorage.getItem("config.app_id");if(o)return o;const n={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return n[e]?n[e]:window.domain_list_app_id[window.deriv_com_url]};const d=()=>{try{return localStorage.getItem("config.server_url")||a}catch(e){return a}},l=()=>{const e=d(),t=r(document.cookie,"webflow-user-language");let o=window.getAppId(),n=(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})();if("function"==typeof window.useGrowthbookFeatureFlag&&(window.isTHLogin=window.useGrowthbookFeatureFlag({featureFlag:"trigger_login_for_hub"}),"boolean"==typeof window.isTHLogin&&window.isTHLogin)){"staging.deriv.com"===new URL(window.location.href).host?(o=53503,n=53503):(o=61554,n=61554)}let i=t?t.toLowerCase():"en";"zh-cn"!==i&&"zh-tw"!==i||(i=i.replace("-","_"));const c=(e=>{let t="";return e&&Object.keys(e).forEach(o=>{t+=`&${o}=${e[o]}`}),t})((()=>{const e=r(document.cookie,"utm_data");if(e){const t=JSON.parse(e),o={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach(e=>{t.hasOwnProperty(e)&&(o[e]=t[e])}),o}return null})()),s=r(document.cookie,"affiliate_tracking"),a=s?`&affiliate_token=${s}`:"",l=void["mt5","bot","derivx"].filter(e=>window.location.pathname.includes(e)&&e)||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${o}&l=${i}&brand=deriv${a}${c}&platform=${l}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${n}&l=${i}&brand=deriv${a}${c}&platform=${l}`};window.establishWebSocketConnection=()=>new Promise((e,t)=>{const o=r(document.cookie,"webflow-user-language"),n=o?o.toLowerCase():"en",i=d();window.websocket=new WebSocket(`wss://${i}/websockets/v3?app_id=${window.getAppId()}&l=${n||"en"}&brand=deriv`),window.websocket.addEventListener("open",t=>{window.websocket.addEventListener("close",()=>{window.websocket.close()}),window.websocket.addEventListener("message",e=>{JSON.parse(e.data)}),e(window.websocket)}),window.websocket.addEventListener("error",e=>{var o;null==(o=null==window?void 0:window.websocket)||o.close(),t(e)})}),window.socketMessageSend=async(e,t)=>{var o;try{return(null==window?void 0:window.websocket)&&(null==(o=null==window?void 0:window.websocket)?void 0:o.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise((e,o)=>{window.websocket.addEventListener("message",n=>{const i=JSON.parse(n.data);t===i.msg_type&&(i.error?o(i.error):e(i))})})):establishWebSocketConnection().then(()=>(websocket.send(e),new Promise((e,o)=>{websocket.addEventListener("message",n=>{const i=JSON.parse(n.data);t===i.msg_type&&(i.error?o(i.error):e(i))})}))).catch(e=>Promise.reject(e))}catch(n){return Promise.reject(n)}};const u=[{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],w=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],m=()=>{const e=window.getClientCountry();u.forEach(t=>{const o="hideDiel"===t.id?!t.countries.includes(e):t.countries.includes(e);if(e&&o)return t.selectors.forEach(e=>{document.querySelectorAll(e).forEach(e=>{if(e)if("w-dyn-item-p2p"===t.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"})});if(!o){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}}),w.forEach(t=>{e&&t.countries.includes(e)?t.selectors.forEach(e=>{document.querySelectorAll(e).forEach(t=>{if(t){const o=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(o.classList.add("disclaimer-show"),t.classList.remove("hide-element")):t.style.display="block"}})}):t.selectors.forEach(e=>{document.querySelectorAll(e).forEach(t=>{t&&(".banner_disclaimer"===e?t.classList.add("hide-element"):t.style.display="none")})})})};document.addEventListener("DOMContentLoaded",function(){const e=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://deriv.com/cdn-cgi/trace"),t=await e.text(),o=Object.fromEntries(t.split("\n").map(e=>e.split("=",2))).loc.toLowerCase();o!==r(document.cookie,"clients_country")&&(s("clients_country"),i("clients_country",o,30)),m()}catch(e){m()}}();r(document.cookie,"clients_country")||window.socketMessageSend(e,"website_status").then(e=>{r(document.cookie,"clients_country")!==e.website_status.clients_country&&(s("clients_country"),i("clients_country",e.website_status.clients_country,30)),m()}).catch(e=>{})});const h=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];function p(){let e,t=!1,o=!1;const n=()=>{o=!0,t=!!r(document.cookie,"client_information"),t&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return n(),e=setInterval(n,800),{getLoggedInStatus:()=>t,getAuthCheckedStatus:()=>o,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}document.addEventListener("DOMContentLoaded",function(){(()=>{var e;const t=window.location.pathname,o=window.location.hash,n=window.location.search,i=t.split("/"),s=i[1],a=h.includes(s||""),d=i.includes("careers")||i.includes("locations")||i.includes("derivtech")||i.includes("derivlife")||i.includes("trading-terms-glossary")||i.includes("product-explorer")||i.includes("eu-careers")||i.includes("our-locations")||i.includes("academy")||i.includes("trading-specifications");a&&c(s);const l=(null==(e=r(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",u=a?s:l;if((a||"en"!==l)&&s!==l)if(a&&s!==l)c(u);else if(!d){const e=(a?i.map(e=>e===s?u:e).join("/"):u+i.join("/"))+n+o;window.location.href="/"+e}})()}),document.addEventListener("DOMContentLoaded",()=>{const e=p();e.onAuthStatusChange(()=>{if(e.getAuthCheckedStatus()&&e.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach(e=>{e.classList.remove("hide-element")});document.querySelectorAll(".logged-out-btn").forEach(e=>{e.classList.add("hide-element")})}else if(e.getAuthCheckedStatus()&&!e.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach(e=>{e.classList.remove("hide-element")});document.querySelectorAll(".logged-in-btn").forEach(e=>{e.classList.add("hide-element")})}})});const g=document.querySelector(".banner_disclaimer"),f=document.querySelector(".main-wrapper");if(g){new ResizeObserver(e=>{for(let t of e)if(t.target===g){let e=t.target.getBoundingClientRect();f&&(f.style.paddingTop=e.height+"px")}}).observe(g)}window.addEventListener("pageshow",function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}});const v=t(e({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let b=!1,_=!1;!function(){var e;const t=document.getElementById("live_chat-wrapper");try{const e=o(v,"remote_config/deriv-com/chat");n(e,e=>{const o=e.val();b=o.live_chat,_=o.whatsapp_chat;const n=document.querySelector(".whatsapp_chat"),i=document.querySelector(".livechatbtn");n&&(n.style.visibility=_?"visible":"hidden"),i&&(i.style.visibility=b?"visible":"hidden");const r=window.location.pathname.includes("/help-centre");if(window.location.pathname.includes("/deriv-prime")){t.style.flexDirection="column-reverse";document.querySelectorAll(".whatsapp_chat").forEach(e=>{e.style.visibility="hidden"})}if(r){const e=document.querySelectorAll(".livechatbtn");b?e.forEach(e=>{e.style.visibility="visible"}):e.forEach(e=>{e.style.visibility="hidden"});const t=document.querySelectorAll(".whatsapp_chat");_?t.forEach(e=>{e.style.visibility="visible"}):t.forEach(e=>{e.style.visibility="hidden"})}window.addEventListener("scroll",function(){var e,o;(b||_)&&(null==(e=null==t?void 0:t.classList)||e.remove("hide-element")),b||_||null==(o=null==t?void 0:t.classList)||o.add("hide-element")})},e=>{var o;null==(o=null==t?void 0:t.classList)||o.remove("hide-element")})}catch(i){null==(e=null==t?void 0:t.classList)||e.remove("hide-element")}}();new MutationObserver(function(e){for(const t of e)if(t.addedNodes.length)for(const e of t.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")}).observe(document.body,{childList:!0,subtree:!0});const y=document.querySelector(".redirection_background-wrapper"),k=document.getElementById("cancel-redirect"),L=document.getElementById("proceed-redirect"),E=window.dataLayer,S=r(document.cookie,"client_information"),q=!!S;if(document.addEventListener("DOMContentLoaded",()=>{E&&window.dataLayer.push({loggedIn:q,language:r(document.cookie,"webflow-user-language")||"en",...q&&{visitorId:null==S?void 0:S.loginid,currency:null==S?void 0:S.currency,email:null==S?void 0:S.email}})}),window.isEuRegion(window.location.pathname)&&y&&k&&L){let e=function(){document.querySelectorAll("a").forEach(function(e){const n=new URL(e.href,window.location.href),i=new URL(window.location.href);o.includes(n.host)||n.host===i.host||(e.removeEventListener("click",t),e.addEventListener("click",t))})},t=function(e){e.preventDefault(),n=this.href,i=this.target||"_self",y.classList.remove("hide-element"),document.body.style.overflow="hidden"};const o=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com","hub.deriv.com"];let n="",i="_self";e();const r=document.querySelector(".w-pagination-wrapper");r&&r.addEventListener("click",t=>{const o=t.target;(o.closest(".blogs_page")||o.closest(".blogs_prev-button")||o.closest(".blogs_next-button"))&&setTimeout(()=>{e()},300)}),k.addEventListener("click",function(){y.classList.add("hide-element"),document.body.style.overflow="auto",n=""}),L.addEventListener("click",function(){n&&(window.open(n,i),n="",y.classList.add("hide-element"),document.body.style.overflow="auto")})}document.addEventListener("DOMContentLoaded",function(){document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible")});const $=document.querySelectorAll(".navbar_accordion-item");function A(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}$.forEach(e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const t=e.querySelector(".navbar_accordion-content");t.classList.remove("open"),t.style.maxHeight="0px",t.style.overflow="hidden",t.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",t.style.opacity="0"}),$.forEach(e=>{const t=e.querySelector(".navbar_accordion-trigger");t.addEventListener("click",function(){const e=t.classList.contains("open");if($.forEach(e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const t=e.querySelector(".navbar_accordion-content");t.classList.remove("open"),t.style.maxHeight="0px",t.style.opacity="0"}),!e){t.classList.add("open");const e=t.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}})});document.querySelectorAll(".navbar_accordion-trigger").forEach(e=>{e.addEventListener("click",function(){setTimeout(A,300)})});const C=new MutationObserver(e=>{e.forEach(e=>{if("class"===e.attributeName){const t=e.target;t.classList.contains("open")&&t.scrollIntoView({behavior:"smooth",block:"start"})}})});document.querySelectorAll(".navbar_accordion-item").forEach(e=>{C.observe(e,{attributes:!0})});const x=new URL(window.location.href),O=new URLSearchParams(x.search),z=O.get("t");if(O.has("referrer")&&null!=z){r(document.cookie,"referrer_token")!==z&&(s("referrer_token"),i("referrer_token",z,365,".deriv.com"))}const D=document.getElementById("navbar-home_login");D&&D.addEventListener("click",function(e){e.preventDefault(),window.location.href=l()});const I=document.getElementById("res-navbar-home_login");I&&I.addEventListener("click",function(e){e.preventDefault(),window.location.href=l()});const U=document.getElementById("white-navbar_login");U&&U.addEventListener("click",function(e){e.preventDefault(),window.location.href=l()});const j=document.getElementById("res-white-navbar_login");j&&j.addEventListener("click",function(e){e.preventDefault(),window.location.href=l()}),document.addEventListener("DOMContentLoaded",function(){let e=document.querySelectorAll(".navbar_accordion-trigger"),t=document.querySelector(".navbar_menu-button");if(document.querySelector(".new-navbar_component")){const e=document.querySelector(".new-navbar_component");e.addEventListener("mouseenter",()=>{window.innerWidth>991&&document.body.classList.add("disable-scroll")}),e.addEventListener("mouseleave",()=>{window.innerWidth>991&&document.body.classList.remove("disable-scroll")})}t&&t.addEventListener("click",function(){let e=window.innerHeight,t=document.querySelector(".new-navbar_main-wrapper");if(t){let o=e-t.offsetHeight,n=document.querySelector(".new-navbar_menu");n&&(n.style.height=`${o}px`)}}),e.forEach(t=>{t.addEventListener("click",function(){e.forEach(e=>e.classList.remove("current")),this.classList.add("current")})});let o=document.querySelector(".navbar_accordion-link.w--current");if(o){let e=o.closest(".navbar_accordion-item");if(e){let t=e.querySelector(".navbar_accordion-trigger");t&&t.classList.add("current")}}}),document.addEventListener("DOMContentLoaded",()=>{var e=window.location.pathname;["/careers","/locations","/derivtech","/derivlife","/eu-careers","/our-locations","/product-explorer","/academy","/trading-terms-glossary"].some(t=>e.includes(t))&&document.head.querySelectorAll("link").forEach(function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()})}),document.addEventListener("DOMContentLoaded",function(){let e=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(e){let t=e.getAttribute("hreflang"),o=document.querySelectorAll(".current-locale-iso-code");if(t&&o.length)for(let e of o)e.innerText=t}});let M=document.querySelectorAll(".w-locales-items");if(M.length>0){M.forEach(function(e){e.querySelectorAll("a").forEach(function(e){e.addEventListener("click",function(t){t.preventDefault(),c(e.getAttribute("hreflang")),window.location.href=e.href})})}),function(e){let t=document.cookie.split(";");for(let o=0;o<t.length;o++){let n=t[o].trim();if(n.startsWith(e+"="))return n.substring(e.length+1)}}("webflow-user-language");let e=["/careers","/locations","/derivtech","/derivlife","/eu-careers","/our-locations","/product-explorer","/academy","/trading-terms-glossary"],t=window.location.pathname;e.some(e=>t.includes(e))}document.addEventListener("DOMContentLoaded",function(){let e=document.querySelector(".lang-mob");e&&e.addEventListener("click",function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})})}),document.addEventListener("DOMContentLoaded",function(){const e=window.location.pathname.split("/")[1],t=["en","fr","ar","pt","es","ru","vi","bn","si","tr","sw","zh-cn","zh-tw","ko","it","de","pl","uz"].includes(e)?e:"en",o={"staging.deriv.com":{selectorUrl:"https://staging.deriv.com",replaceUrl:"https://staging-hub.deriv.com"},"deriv.com":{selectorUrl:"https://deriv.com",replaceUrl:"https://hub.deriv.com"},"deriv.be":{selectorUrl:"https://deriv.be",replaceUrl:"https://hub.deriv.be"},"deriv.me":{selectorUrl:"https://deriv.me",replaceUrl:"https://hub.deriv.me"}}[window.location.hostname];var n,i;o&&(n=o.selectorUrl,i=o.replaceUrl,Array.from(document.querySelectorAll("a")).filter(e=>e.href===`${n}/signup`||e.href===`${n}/${t}/signup`||e.href===`${n}/landing/signup`||e.href===`${n}/${t}/landing/signup`).forEach(e=>{let o=t;"zh-tw"===o&&(o="zh_tw"),"zh-cn"===o&&(o="zh_cn"),e.href=`${i}/tradershub/signup?lang=${o}`}))}),document.addEventListener("DOMContentLoaded",function(){const e=window.location.hostname.split(".").slice(-2).join("."),t=()=>{const t=`https://hub.${e}/partnershub/`;document.querySelectorAll('a[href^="https://login.deriv."]').forEach(e=>{/https:\/\/login\.deriv\.(com|me|be)\/signin\.php/.test(e.href)&&(e.href=t)})},o=setInterval(()=>{var n;(null==(n=null==window?void 0:window.getClientCountry)?void 0:n.call(window))&&(t(),(()=>{let t="https://hub.deriv.com/partnershub/signup";"deriv.me"===e?t="https://hub.deriv.me/partnershub/signup":"deriv.be"===e&&(t="https://hub.deriv.be/partnershub/signup"),document.querySelectorAll('a[href="https://hub.deriv.com/partnershub/signup"]').forEach(e=>{e.href=t})})(),clearInterval(o))},300)}),document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll('a[href="https://app.deriv.com/cashier/account-transfer"]').forEach(e=>{e.href="https://app.deriv.com/redirect?action=ctrader_account_transfer"})});let R=null,N=null,T=null;const B=()=>{const e="staging.deriv.com"===window.location.hostname?"https://staging-hub.deriv.com/tradershub/wallets":"https://hub.deriv.com/tradershub/wallets",t="staging.deriv.com"===window.location.hostname?"staging.deriv.com":"deriv.com";if(R&&N===e&&T===t)return R;const o={"https://deriv.com/cashier":e,"/cashier/withdrawal":`${e}/withdrawal`,"https://deriv.com/cashier/withdrawal":`${e}/withdrawal`,"https://deriv.com/cashier/account-transfer":`${e}/transfer`,"https://staging.deriv.com/cashier":e,"https://staging.deriv.com/cashier/withdrawal":`${e}/withdrawal`,"https://staging.deriv.com/cashier/account-transfer":`${e}/transfer`,"https://app.deriv.com/cashier":e,"https://app.deriv.com/cashier/withdrawal":`${e}/withdrawal`,"https://app.deriv.com/cashier/account-transfer":`${e}/transfer`,"https://app.deriv.com/wallet/withdrawal":`${e}/withdrawal`};return R=o,N=e,T=t,o},P=e=>{try{const t=e.getAttribute("href");if(!t)return;const o=B(),n=Object.entries(o).sort(([e],[t])=>t.length-e.length).find(([e])=>t.startsWith(e));if(n){const[o,i]=n,r=t.includes("?")?t.substring(t.indexOf("?")):"";e.setAttribute("href",i+r)}}catch(t){}};document.addEventListener("DOMContentLoaded",()=>{(()=>{try{const e=r(document.cookie,"client_information"),t=r(document.cookie,"wallet_account"),o=window.location.hostname.split(".").slice(-2).join(".");return e&&"true"===t&&"deriv.com"===o}catch(e){return!1}})()&&(()=>{try{document.querySelectorAll("a[href]").forEach(P)}catch(e){}})()});
1
+ import{initializeApp as e}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as t,ref as n,onValue as o}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function i(e,t,n,o){let i="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=o?e+"="+(t||"")+i+`;domain=${o};path=/`:e+"="+(t||"")+i+";path=/"}function r(e){let t=document.cookie.split(";");for(let n=0;n<t.length;n++){let o=t[n].trim();if(o.startsWith(e+"="))return o.substring(e.length+1)}return null}function c(e,t){const n={};return e.split(";").forEach(e=>{const[t,o]=e.split("=").map(e=>e.trim());n[t]=decodeURIComponent(o)}),n[t]}function s(e){i("webflow-user-language",e,30),i("webflow-user-language",e,30,`.${window.location.hostname}`)}function a(e){document.cookie=e+"=; Max-Age=-99999999;"}const d="green.derivws.com";window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,t)=>{t?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const t=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(t)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,t=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find(e=>t.endsWith(e));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const t=c(document.cookie,"test_im_country"),n=c(document.cookie,"clients_country"),o=c(document.cookie,"client_information");return o?(null==(e=JSON.parse(o))?void 0:e.residence)||n:t||n},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"61554",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"53503"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),t=new URLSearchParams(window.location.search||"").get("app_id");if(t)return t;const n=localStorage.getItem("config.app_id");if(n)return n;const o={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return o[e]?o[e]:window.domain_list_app_id[window.deriv_com_url]};const l=()=>{try{return localStorage.getItem("config.server_url")||d}catch(e){return d}},u=()=>{const e=l(),t=c(document.cookie,"webflow-user-language");let n=window.getAppId(),o=(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})();if("function"==typeof window.useGrowthbookFeatureFlag&&(window.isTHLogin=window.useGrowthbookFeatureFlag({featureFlag:"trigger_login_for_hub"}),"boolean"==typeof window.isTHLogin&&window.isTHLogin)){"staging.deriv.com"===new URL(window.location.href).host?(n=53503,o=53503):(n=61554,o=61554)}let i=t?t.toLowerCase():"en";"zh-cn"!==i&&"zh-tw"!==i||(i=i.replace("-","_"));const r=(e=>{let t="";return e&&Object.keys(e).forEach(n=>{t+=`&${n}=${e[n]}`}),t})((()=>{const e=c(document.cookie,"utm_data");if(e){const t=JSON.parse(e),n={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach(e=>{t.hasOwnProperty(e)&&(n[e]=t[e])}),n}return null})()),s=c(document.cookie,"affiliate_tracking"),a=s?`&affiliate_token=${s}`:"",d=void["mt5","bot","derivx"].filter(e=>window.location.pathname.includes(e)&&e)||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${n}&l=${i}&brand=deriv${a}${r}&platform=${d}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${o}&l=${i}&brand=deriv${a}${r}&platform=${d}`};window.establishWebSocketConnection=()=>new Promise((e,t)=>{const n=c(document.cookie,"webflow-user-language"),o=n?n.toLowerCase():"en",i=l();window.websocket=new WebSocket(`wss://${i}/websockets/v3?app_id=${window.getAppId()}&l=${o||"en"}&brand=deriv`),window.websocket.addEventListener("open",t=>{window.websocket.addEventListener("close",()=>{window.websocket.close()}),window.websocket.addEventListener("message",e=>{JSON.parse(e.data)}),e(window.websocket)}),window.websocket.addEventListener("error",e=>{var n;null==(n=null==window?void 0:window.websocket)||n.close(),t(e)})}),window.socketMessageSend=async(e,t)=>{var n;try{return(null==window?void 0:window.websocket)&&(null==(n=null==window?void 0:window.websocket)?void 0:n.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise((e,n)=>{window.websocket.addEventListener("message",o=>{const i=JSON.parse(o.data);t===i.msg_type&&(i.error?n(i.error):e(i))})})):establishWebSocketConnection().then(()=>(websocket.send(e),new Promise((e,n)=>{websocket.addEventListener("message",o=>{const i=JSON.parse(o.data);t===i.msg_type&&(i.error?n(i.error):e(i))})}))).catch(e=>Promise.reject(e))}catch(o){return Promise.reject(o)}};const m=[{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],w=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],h=()=>{const e=window.getClientCountry();m.forEach(t=>{const n="hideDiel"===t.id?!t.countries.includes(e):t.countries.includes(e);if(e&&n)return t.selectors.forEach(e=>{document.querySelectorAll(e).forEach(e=>{if(e)if("w-dyn-item-p2p"===t.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"})});if(!n){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}}),w.forEach(t=>{e&&t.countries.includes(e)?t.selectors.forEach(e=>{document.querySelectorAll(e).forEach(t=>{if(t){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),t.classList.remove("hide-element")):t.style.display="block"}})}):t.selectors.forEach(e=>{document.querySelectorAll(e).forEach(t=>{t&&(".banner_disclaimer"===e?t.classList.add("hide-element"):t.style.display="none")})})})};document.addEventListener("DOMContentLoaded",function(){const e=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://deriv.com/cdn-cgi/trace"),t=await e.text(),n=Object.fromEntries(t.split("\n").map(e=>e.split("=",2))).loc.toLowerCase();n!==c(document.cookie,"clients_country")&&(a("clients_country"),i("clients_country",n,30)),h()}catch(e){h()}}();c(document.cookie,"clients_country")||window.socketMessageSend(e,"website_status").then(e=>{c(document.cookie,"clients_country")!==e.website_status.clients_country&&(a("clients_country"),i("clients_country",e.website_status.clients_country,30)),h()}).catch(e=>{})});const p=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];function g(){let e,t=!1,n=!1;const o=()=>{n=!0,t=!!c(document.cookie,"client_information"),t&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return o(),e=setInterval(o,800),{getLoggedInStatus:()=>t,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}document.addEventListener("DOMContentLoaded",function(){(()=>{var e;const t=window.location.pathname,n=window.location.hash,o=window.location.search,i=t.split("/"),r=i[1],a=p.includes(r||""),d=i.includes("careers")||i.includes("locations")||i.includes("derivtech")||i.includes("derivlife")||i.includes("trading-terms-glossary")||i.includes("product-explorer")||i.includes("eu-careers")||i.includes("our-locations")||i.includes("academy")||i.includes("trading-specifications");a&&s(r);const l=(null==(e=c(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",u=a?r:l;if((a||"en"!==l)&&r!==l)if(a&&r!==l)s(u);else if(!d){const e=(a?i.map(e=>e===r?u:e).join("/"):u+i.join("/"))+o+n;window.location.href="/"+e}})()}),document.addEventListener("DOMContentLoaded",()=>{const e=g();e.onAuthStatusChange(()=>{if(e.getAuthCheckedStatus()&&e.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach(e=>{e.classList.remove("hide-element")});document.querySelectorAll(".logged-out-btn").forEach(e=>{e.classList.add("hide-element")})}else if(e.getAuthCheckedStatus()&&!e.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach(e=>{e.classList.remove("hide-element")});document.querySelectorAll(".logged-in-btn").forEach(e=>{e.classList.add("hide-element")})}})});const f=document.querySelector(".banner_disclaimer"),v=document.querySelector(".main-wrapper");if(f){new ResizeObserver(e=>{for(let t of e)if(t.target===f){let e=t.target.getBoundingClientRect();v&&(v.style.paddingTop=e.height+"px")}}).observe(f)}window.addEventListener("pageshow",function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}});const b=t(e({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let _=!1,y=!1;!function(){var e;const t=document.getElementById("live_chat-wrapper");try{const e=n(b,"remote_config/deriv-com/chat");o(e,e=>{const n=e.val();_=n.live_chat,y=n.whatsapp_chat;const o=document.querySelector(".whatsapp_chat"),i=document.querySelector(".livechatbtn");o&&(o.style.visibility=y?"visible":"hidden"),i&&(i.style.visibility=_?"visible":"hidden");const r=window.location.pathname.includes("/help-centre");if(window.location.pathname.includes("/deriv-prime")){t.style.flexDirection="column-reverse";document.querySelectorAll(".whatsapp_chat").forEach(e=>{e.style.visibility="hidden"})}if(r){const e=document.querySelectorAll(".livechatbtn");_?e.forEach(e=>{e.style.visibility="visible"}):e.forEach(e=>{e.style.visibility="hidden"});const t=document.querySelectorAll(".whatsapp_chat");y?t.forEach(e=>{e.style.visibility="visible"}):t.forEach(e=>{e.style.visibility="hidden"})}window.addEventListener("scroll",function(){var e,n;(_||y)&&(null==(e=null==t?void 0:t.classList)||e.remove("hide-element")),_||y||null==(n=null==t?void 0:t.classList)||n.add("hide-element")})},e=>{var n;null==(n=null==t?void 0:t.classList)||n.remove("hide-element")})}catch(i){null==(e=null==t?void 0:t.classList)||e.remove("hide-element")}}();new MutationObserver(function(e){for(const t of e)if(t.addedNodes.length)for(const e of t.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")}).observe(document.body,{childList:!0,subtree:!0});const k=document.querySelector(".redirection_background-wrapper"),L=document.getElementById("cancel-redirect"),E=document.getElementById("proceed-redirect"),S=window.dataLayer,q=c(document.cookie,"client_information"),$=!!q;if(document.addEventListener("DOMContentLoaded",()=>{S&&window.dataLayer.push({loggedIn:$,language:c(document.cookie,"webflow-user-language")||"en",...$&&{visitorId:null==q?void 0:q.loginid,currency:null==q?void 0:q.currency,email:null==q?void 0:q.email}})}),window.isEuRegion(window.location.pathname)&&k&&L&&E){let e=function(){document.querySelectorAll("a").forEach(function(e){const o=new URL(e.href,window.location.href),i=new URL(window.location.href);n.includes(o.host)||o.host===i.host||(e.removeEventListener("click",t),e.addEventListener("click",t))})},t=function(e){e.preventDefault(),o=this.href,i=this.target||"_self",k.classList.remove("hide-element"),document.body.style.overflow="hidden"};const n=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com","hub.deriv.com"];let o="",i="_self";e();const r=document.querySelector(".w-pagination-wrapper");r&&r.addEventListener("click",t=>{const n=t.target;(n.closest(".blogs_page")||n.closest(".blogs_prev-button")||n.closest(".blogs_next-button"))&&setTimeout(()=>{e()},300)}),L.addEventListener("click",function(){k.classList.add("hide-element"),document.body.style.overflow="auto",o=""}),E.addEventListener("click",function(){o&&(window.open(o,i),o="",k.classList.add("hide-element"),document.body.style.overflow="auto")})}document.addEventListener("DOMContentLoaded",function(){document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible")});const C=document.querySelectorAll(".navbar_accordion-item");function A(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}C.forEach(e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const t=e.querySelector(".navbar_accordion-content");t.classList.remove("open"),t.style.maxHeight="0px",t.style.overflow="hidden",t.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",t.style.opacity="0"}),C.forEach(e=>{const t=e.querySelector(".navbar_accordion-trigger");t.addEventListener("click",function(){const e=t.classList.contains("open");if(C.forEach(e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const t=e.querySelector(".navbar_accordion-content");t.classList.remove("open"),t.style.maxHeight="0px",t.style.opacity="0"}),!e){t.classList.add("open");const e=t.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}})});document.querySelectorAll(".navbar_accordion-trigger").forEach(e=>{e.addEventListener("click",function(){setTimeout(A,300)})});const x=new MutationObserver(e=>{e.forEach(e=>{if("class"===e.attributeName){const t=e.target;t.classList.contains("open")&&t.scrollIntoView({behavior:"smooth",block:"start"})}})});document.querySelectorAll(".navbar_accordion-item").forEach(e=>{x.observe(e,{attributes:!0})});const O=new URL(window.location.href),z=new URLSearchParams(O.search),D=z.get("t");if(z.has("referrer")&&null!=D){c(document.cookie,"referrer_token")!==D&&(a("referrer_token"),i("referrer_token",D,365,".deriv.com"))}const I=document.getElementById("navbar-home_login");I&&I.addEventListener("click",function(e){e.preventDefault(),window.location.href=u()});const U=document.getElementById("res-navbar-home_login");U&&U.addEventListener("click",function(e){e.preventDefault(),window.location.href=u()});const j=document.getElementById("white-navbar_login");j&&j.addEventListener("click",function(e){e.preventDefault(),window.location.href=u()});const M=document.getElementById("res-white-navbar_login");M&&M.addEventListener("click",function(e){e.preventDefault(),window.location.href=u()}),document.addEventListener("DOMContentLoaded",function(){let e=document.querySelectorAll(".navbar_accordion-trigger"),t=document.querySelector(".navbar_menu-button");if(document.querySelector(".new-navbar_component")){const e=document.querySelector(".new-navbar_component");e.addEventListener("mouseenter",()=>{window.innerWidth>991&&document.body.classList.add("disable-scroll")}),e.addEventListener("mouseleave",()=>{window.innerWidth>991&&document.body.classList.remove("disable-scroll")})}t&&t.addEventListener("click",function(){let e=window.innerHeight,t=document.querySelector(".new-navbar_main-wrapper");if(t){let n=e-t.offsetHeight,o=document.querySelector(".new-navbar_menu");o&&(o.style.height=`${n}px`)}}),e.forEach(t=>{t.addEventListener("click",function(){e.forEach(e=>e.classList.remove("current")),this.classList.add("current")})});let n=document.querySelector(".navbar_accordion-link.w--current");if(n){let e=n.closest(".navbar_accordion-item");if(e){let t=e.querySelector(".navbar_accordion-trigger");t&&t.classList.add("current")}}}),document.addEventListener("DOMContentLoaded",()=>{var e=window.location.pathname;["/careers","/locations","/derivtech","/derivlife","/eu-careers","/our-locations","/product-explorer","/academy","/trading-terms-glossary"].some(t=>e.includes(t))&&document.head.querySelectorAll("link").forEach(function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()})}),document.addEventListener("DOMContentLoaded",function(){let e=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(e){let t=e.getAttribute("hreflang"),n=document.querySelectorAll(".current-locale-iso-code");if(t&&n.length)for(let e of n)e.innerText=t}});let R=document.querySelectorAll(".w-locales-items");if(R.length>0){R.forEach(function(e){e.querySelectorAll("a").forEach(function(e){e.addEventListener("click",function(t){t.preventDefault(),s(e.getAttribute("hreflang")),window.location.href=e.href})})}),r("webflow-user-language");let e=["/careers","/locations","/derivtech","/derivlife","/eu-careers","/our-locations","/product-explorer","/academy","/trading-terms-glossary"],t=window.location.pathname;e.some(e=>t.includes(e))}document.addEventListener("DOMContentLoaded",function(){let e=document.querySelector(".lang-mob");e&&e.addEventListener("click",function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})})}),document.addEventListener("DOMContentLoaded",function(){const e=window.location.pathname.split("/")[1],t=["en","fr","ar","pt","es","ru","vi","bn","si","tr","sw","zh-cn","zh-tw","ko","it","de","pl","uz"].includes(e)?e:"en",n={"staging.deriv.com":{selectorUrl:"https://staging.deriv.com",replaceUrl:"https://staging-hub.deriv.com"},"deriv.com":{selectorUrl:"https://deriv.com",replaceUrl:"https://hub.deriv.com"},"deriv.be":{selectorUrl:"https://deriv.be",replaceUrl:"https://hub.deriv.be"},"deriv.me":{selectorUrl:"https://deriv.me",replaceUrl:"https://hub.deriv.me"}}[window.location.hostname];var o,i;n&&(o=n.selectorUrl,i=n.replaceUrl,Array.from(document.querySelectorAll("a")).filter(e=>e.href===`${o}/signup`||e.href===`${o}/${t}/signup`||e.href===`${o}/landing/signup`||e.href===`${o}/${t}/landing/signup`).forEach(e=>{let n=t;"zh-tw"===n&&(n="zh_tw"),"zh-cn"===n&&(n="zh_cn"),e.href=`${i}/tradershub/signup?lang=${n}`}))}),document.addEventListener("DOMContentLoaded",function(){const e=window.location.hostname.split(".").slice(-2).join("."),t=()=>{const t=`https://hub.${e}/partnershub/`;document.querySelectorAll('a[href^="https://login.deriv."]').forEach(e=>{/https:\/\/login\.deriv\.(com|me|be)\/signin\.php/.test(e.href)&&(e.href=t)})},n=setInterval(()=>{var o;(null==(o=null==window?void 0:window.getClientCountry)?void 0:o.call(window))&&(t(),(()=>{let t="https://hub.deriv.com/partnershub/signup";"deriv.me"===e?t="https://hub.deriv.me/partnershub/signup":"deriv.be"===e&&(t="https://hub.deriv.be/partnershub/signup"),document.querySelectorAll('a[href="https://hub.deriv.com/partnershub/signup"]').forEach(e=>{e.href=t})})(),clearInterval(n))},300)}),document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll('a[href="https://app.deriv.com/cashier/account-transfer"]').forEach(e=>{e.href="https://app.deriv.com/redirect?action=ctrader_account_transfer"})});let N=null,T=null,B=null;const W=()=>{const e="staging.deriv.com"===window.location.hostname?"https://staging-hub.deriv.com/tradershub/wallets":"https://hub.deriv.com/tradershub/wallets",t="staging.deriv.com"===window.location.hostname?"staging.deriv.com":"deriv.com";if(N&&T===e&&B===t)return N;const n={"https://deriv.com/cashier":e,"/cashier/withdrawal":`${e}/withdrawal`,"https://deriv.com/cashier/withdrawal":`${e}/withdrawal`,"https://deriv.com/cashier/account-transfer":`${e}/transfer`,"https://staging.deriv.com/cashier":e,"https://staging.deriv.com/cashier/withdrawal":`${e}/withdrawal`,"https://staging.deriv.com/cashier/account-transfer":`${e}/transfer`,"https://app.deriv.com/cashier":e,"https://app.deriv.com/cashier/withdrawal":`${e}/withdrawal`,"https://app.deriv.com/cashier/account-transfer":`${e}/transfer`,"https://app.deriv.com/wallet/withdrawal":`${e}/withdrawal`};return N=n,T=e,B=t,n},P=e=>{try{const t=e.getAttribute("href");if(!t)return;const n=W(),o=Object.entries(n).sort(([e],[t])=>t.length-e.length).find(([e])=>t.startsWith(e));if(o){const[n,i]=o,r=t.includes("?")?t.substring(t.indexOf("?")):"";e.setAttribute("href",i+r)}}catch(t){}};document.addEventListener("DOMContentLoaded",()=>{(()=>{try{const e=c(document.cookie,"client_information"),t=c(document.cookie,"wallet_account"),n=window.location.hostname.split(".").slice(-2).join(".");return e&&"true"===t&&"deriv.com"===n}catch(e){return!1}})()&&(()=>{try{document.querySelectorAll("a[href]").forEach(P)}catch(e){}})()});const H=["/trade/options","/markets/derived-indices/synthetic-indices","/tradingview","/mt5-trading-signals#signal-subscriber","/economic-calendar","/market-buzz","/trading-central","/trading-platforms/deriv-ctrader","/trading-platforms/deriv-x","/trading-platforms/deriv-trader","/trading-platforms/deriv-go","/trading-platforms/deriv-bot","/p2p","/blog","/trading-terms-glossary","/partners","/fraud-prevention","/partners-help-centre","/locations","/terms-and-conditions/deriv-mauritius-ltd-additional-terms","/terms-and-conditions/deriv-fx-ltd-additional-terms","/terms-and-conditions/deriv-bvi-ltd-additional-terms","/terms-and-conditions/deriv-v-ltd-additional-terms","/terms-and-conditions/business-partners-general-terms","/terms-and-conditions/affiliates-introducing-brokers-ibs","/terms-and-conditions/payment-agents","/terms-and-conditions/api-users","/terms-and-conditions/bug-bounty-program","/trading-specifications#forex","/trading-specifications#derived-indices","/trading-specifications#stocks","/trading-specifications#stock-indices","/trading-specifications#commodities","/trading-specifications#cryptocurrencies","/trading-specifications#etfs","/payment-methods"],F=["https://deriv.com","https://staging.deriv.com"].flatMap(e=>H.map(t=>`${e}${t}`));function J(e){try{const t=new URL(e);let n=t.pathname.replace(/\/$/,"");return`${t.origin}${n}`.toLowerCase()}catch{return e.toLowerCase()}}document.addEventListener("DOMContentLoaded",function(){if("true"===r("internal"))return;const e=document.querySelector("#geomodal"),t=setInterval(()=>{const n=window.getClientCountry();n&&(clearInterval(t),"ae"===n.toLowerCase()&&function(){const e=J(window.location.origin+window.location.pathname);return F.some(t=>{const n=J(t);return e===n||e.startsWith(n+"/")})}()?e&&e.classList.contains("hide-element")&&(e.classList.remove("hide-element"),document.body.style.overflow="hidden"):e&&!e.classList.contains("hide-element")&&(e.classList.add("hide-element"),document.body.style.overflow=""))},100)});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deriv-com/custom-scripts",
3
- "version": "1.26.50",
3
+ "version": "1.26.51",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"