@deriv-com/custom-scripts 1.21.6 → 1.23.0

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 o,ref as n,onValue as a}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function i(e,o,n,a){let i="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=a?e+"="+(o||"")+i+`;domain=${a};path=/`:e+"="+(o||"")+i+";path=/"}function t(e){let o=document.cookie.split(";");for(let n=0;n<o.length;n++){let a=o[n].trim();if(a.startsWith(e+"="))return a.substring(e.length+1)}return null}function r(e,o){const n={};return e.split(";").forEach((e=>{const[o,a]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(a)})),n[o]}function d(e){i("webflow-user-language",e,30)}function s(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?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 o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=r(document.cookie,"clients_country"),n=r(document.cookie,"client_information");return n&&(null==(e=JSON.parse(n))?void 0:e.residence)||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]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const n=localStorage.getItem("config.app_id");if(n)return n;const a={[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 a[e]?a[e]:window.domain_list_app_id[window.deriv_com_url]};const c=()=>{const e=localStorage.getItem("config.server_url"),o=r(document.cookie,"webflow-user-language");let n=o?o.toLowerCase():"en";"zh-cn"!==n&&"zh-tw"!==n||(n=n.replace("-","_"));const a=(e=>{let o="";return e&&Object.keys(e).forEach((n=>{o+=`&${n}=${e[n]}`})),o})((()=>{const e=r(document.cookie,"utm_data");if(e){const o=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=>{o.hasOwnProperty(e)&&(n[e]=o[e])})),n}return null})()),i=r(document.cookie,"affiliate_tracking"),t=i?`&affiliate_token=${i}`:"",d=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${n}&brand=deriv${t}${a}&platform=${d}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{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]})()}&l=${n}&brand=deriv${t}${a}&platform=${d}`};window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const n=r(document.cookie,"webflow-user-language"),a=n?n.toLowerCase():"en",i=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${i}/websockets/v3?app_id=${window.getAppId()}&l=${a||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{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(),o(e)}))})),window.socketMessageSend=async(e,o)=>{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",(a=>{const i=JSON.parse(a.data);o===i.msg_type&&(i.error?n(i.error):e(i))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,n)=>{websocket.addEventListener("message",(a=>{const i=JSON.parse(a.data);o===i.msg_type&&(i.error?n(i.error):e(i))}))}))))).catch((e=>Promise.reject(e)))}catch(a){return Promise.reject(a)}};const u=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{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","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:"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"]}],l=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],p=()=>{const e=window.getClientCountry();u.forEach((o=>{const n="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&n)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.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")}})),l.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))};document.addEventListener("DOMContentLoaded",(function(){const e=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),n=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();n!==r(document.cookie,"clients_country")&&(s("clients_country"),i("clients_country",n,30)),p()}catch(e){p()}}();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)),p()})).catch((e=>{}))}));const w=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];function h(){let e,o=!1,n=!1;const a=()=>{n=!0,o=!!r(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return a(),e=setInterval(a,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}document.addEventListener("DOMContentLoaded",(function(){(()=>{var e;const o=window.location.pathname,n=window.location.hash,a=window.location.search,i=o.split("/"),t=i[1],s=w.includes(t||""),c=i.includes("careers")||i.includes("locations")||i.includes("derivtech")||i.includes("derivlife")||i.includes("trading-terms-glossary")||i.includes("eu-careers")||i.includes("our-locations")||i.includes("academy");s&&d(t);const u=(null==(e=r(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",l=s?t:u;if((s||"en"!==u)&&t!==u)if(s&&t!==u)d(l);else if(!c){const e=(s?i.map((e=>e===t?l:e)).join("/"):l+i.join("/"))+a+n;window.location.href="/"+e}})()})),document.addEventListener("DOMContentLoaded",(()=>{const e=h();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")}))}}))})),document.addEventListener("DOMContentLoaded",(()=>{const e=window.location.href;if(["help-centre"].some((o=>e.includes(o)))){const n=new URL(e).searchParams;n.has("platform")&&"derivgo"===n.get("platform")&&(o=".derivgo-query-element",document.querySelectorAll(o).forEach((e=>{e.style.display="none"})))}var o}));const y=document.querySelector(".banner_disclaimer"),m=document.querySelector(".main-wrapper");if(y){new ResizeObserver((e=>{for(let o of e)if(o.target===y){let e=o.target.getBoundingClientRect();m&&(m.style.paddingTop=e.height+"px")}})).observe(y)}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 N=o(e({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let Y=!1,g=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=n(N,"remote_config/deriv-com/chat");a(e,(e=>{const n=e.val();Y=n.live_chat,g=n.whatsapp_chat;const a=document.querySelector(".whatsapp_chat"),i=document.querySelector(".livechatbtn");a&&(a.style.visibility=g?"visible":"hidden"),i&&(i.style.visibility=Y?"visible":"hidden");const t=window.location.pathname.includes("/help-centre");if(window.location.pathname.includes("/deriv-prime")){o.style.flexDirection="column-reverse";document.querySelectorAll(".whatsapp_chat").forEach((e=>{e.style.visibility="hidden"}))}if(t){const e=document.querySelectorAll(".livechatbtn");Y?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");g?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,n;(Y||g)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),Y||g||null==(n=null==o?void 0:o.classList)||n.add("hide-element")}))}),(e=>{var n;null==(n=null==o?void 0:o.classList)||n.remove("hide-element")}))}catch(i){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const f=window.getClientCountry();const v=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===f)),A=v?function(e){const{apple:o,android:n,huawei:a}=e;return"Yes"===o&&"Yes"===n&&"Yes"===a?"Android, iOS & Huawei":"Yes"===o&&"Yes"===n&&"Yes"!==a?"Android, and iOS":"Yes"===o&&"Yes"===a&&"Yes"!==n?"iOS, and Huawei":"Yes"===n&&"Yes"!==o&&"Yes"!==a?"Android":"Yes"===o&&"Yes"===a&&"Yes"!==n?"iOS, and Huawei":"Yes"===o&&"Yes"!==n&&"Yes"!==a?"iOS":"Yes"!==o&&"Yes"!==n&&"Yes"===a?"Huawei":""}(v):"",b=document.getElementById("app-download-heading");b&&(b.innerText=A);const _=document.querySelector(".redirection_background-wrapper"),k=document.getElementById("cancel-redirect"),L=document.getElementById("proceed-redirect"),E="tracking_status",S="tracking_status_decline",q=window.dataLayer,z=r(document.cookie,"client_information"),x=!!z,j=document.getElementById("accept-cookie"),C=document.getElementById("dont-accept-cookie"),O=document.querySelector(".cookies_background-wrapper");if(document.addEventListener("DOMContentLoaded",(()=>{q&&window.dataLayer.push({loggedIn:x,language:r(document.cookie,"webflow-user-language")||"en",...x&&{visitorId:null==z?void 0:z.loginid,currency:null==z?void 0:z.currency,email:null==z?void 0:z.email}}),!window.location.pathname.includes("eu")||t(E)||t(S)||(O.classList.remove("hide-element"),document.body.classList.add("show-cookie")),null==j||j.addEventListener("click",(()=>{i(E,!0),O.classList.add("hide-element"),document.body.classList.remove("show-cookie")})),null==C||C.addEventListener("click",(()=>{i(S,!0),i(E,!1),O.classList.add("hide-element"),document.body.classList.remove("show-cookie")}))})),window.isEuRegion(window.location.pathname)&&_&&k&&L){const e=["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"];let o="",n="_self";document.querySelectorAll("a").forEach((function(a){const i=new URL(a.href,window.location.href),t=new URL(window.location.href);e.includes(i.host)||i.host===t.host||a.addEventListener("click",(function(e){e.preventDefault(),o=i.href,n=a.target||"_self",_.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),k.addEventListener("click",(function(){_.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),L.addEventListener("click",(function(){o&&(window.open(o,n),o="",_.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 I=document.querySelectorAll(".navbar_accordion-item");function D(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}I.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),I.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(I.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.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(D,300)}))}));const $=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{$.observe(e,{attributes:!0})}));const M=new URL(window.location.href),R=new URLSearchParams(M.search),B=R.get("t");if(R.has("referrer")&&null!=B){r(document.cookie,"referrer_token")!==B&&(s("referrer_token"),i("referrer_token",B,365,".deriv.com"))}const U=document.getElementById("navbar-home_login");U&&U.addEventListener("click",(function(e){e.preventDefault(),window.location.href=c()}));const P=document.getElementById("res-navbar-home_login");P&&P.addEventListener("click",(function(e){e.preventDefault(),window.location.href=c()}));const W=document.getElementById("white-navbar_login");W&&W.addEventListener("click",(function(e){e.preventDefault(),window.location.href=c()}));const H=document.getElementById("res-white-navbar_login");H&&H.addEventListener("click",(function(e){e.preventDefault(),window.location.href=c()})),document.addEventListener("DOMContentLoaded",(function(){let e=document.querySelectorAll(".navbar_accordion-trigger"),o=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")}))}o&&o.addEventListener("click",(function(){let e=window.innerHeight,o=document.querySelector(".new-navbar_main-wrapper");if(o){let n=e-o.offsetHeight,a=document.querySelector(".new-navbar_menu");a&&(a.style.height=`${n}px`)}})),e.forEach((o=>{o.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 o=e.querySelector(".navbar_accordion-trigger");o&&o.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((o=>e.includes(o)))&&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 o=e.getAttribute("hreflang"),n=document.querySelectorAll(".current-locale-iso-code");if(o&&n.length)for(let e of n)e.innerText=o}}));let T=document.querySelectorAll(".w-locales-items");if(T.length>0){T.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(o){o.preventDefault(),i("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))}));const e=e=>{let o=document.querySelector('a[hreflang="'+e+'"]');o&&window.location.pathname!==o.getAttribute("href")&&o.click()};window.setLanguageCookie=e=>{i("webflow-user-language",e,30)};let o=t("webflow-user-language"),n=["/careers","/locations","/derivtech","/derivlife","/eu-careers","/our-locations","/product-explorer","/academy","/trading-terms-glossary"],a=window.location.pathname,r=!1;n.some((e=>a.includes(e))),o&&r&&e(o)}document.addEventListener("DOMContentLoaded",(function(){const e=r(document.cookie,"webflow-user-language"),o=["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"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const n=window.getClientCountry();n&&o.includes(n)&&("en"===e?window.location.replace("/404"):window.location.replace(`/${e}/404`))}})),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})}))}));
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){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)}return null}function c(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 a(e){i("webflow-user-language",e,30)}function s(e){document.cookie=e+"=; Max-Age=-99999999;"}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=c(document.cookie,"clients_country"),o=c(document.cookie,"client_information");return o&&(null==(e=JSON.parse(o))?void 0:e.residence)||t},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]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},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=()=>{const e=localStorage.getItem("config.server_url"),t=c(document.cookie,"webflow-user-language");let o=t?t.toLowerCase():"en";"zh-cn"!==o&&"zh-tw"!==o||(o=o.replace("-","_"));const n=(e=>{let t="";return e&&Object.keys(e).forEach((o=>{t+=`&${o}=${e[o]}`})),t})((()=>{const e=c(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})()),i=c(document.cookie,"affiliate_tracking"),r=i?`&affiliate_token=${i}`:"",a=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${o}&brand=deriv${r}${n}&platform=${a}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{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]})()}&l=${o}&brand=deriv${r}${n}&platform=${a}`};window.establishWebSocketConnection=()=>new Promise(((e,t)=>{const o=c(document.cookie,"webflow-user-language"),n=o?o.toLowerCase():"en",i=localStorage.getItem("config.server_url")||"green.derivws.com";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 l=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{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","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:"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"]}],u=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],m=()=>{const e=window.getClientCountry();l.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")}})),u.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://www.cloudflare.com/cdn-cgi/trace"),t=await e.text(),o=Object.fromEntries(t.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();o!==c(document.cookie,"clients_country")&&(s("clients_country"),i("clients_country",o,30)),m()}catch(e){m()}}();c(document.cookie,"clients_country")||window.socketMessageSend(e,"website_status").then((e=>{c(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 w=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];function g(){let e,t=!1,o=!1;const n=()=>{o=!0,t=!!c(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("/"),r=i[1],s=w.includes(r||""),d=i.includes("careers")||i.includes("locations")||i.includes("derivtech")||i.includes("derivlife")||i.includes("trading-terms-glossary")||i.includes("eu-careers")||i.includes("our-locations")||i.includes("academy");s&&a(r);const l=(null==(e=c(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",u=s?r:l;if((s||"en"!==l)&&r!==l)if(s&&r!==l)a(u);else if(!d){const e=(s?i.map((e=>e===r?u:e)).join("/"):u+i.join("/"))+n+o;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 p=document.querySelector(".banner_disclaimer"),f=document.querySelector(".main-wrapper");if(p){new ResizeObserver((e=>{for(let t of e)if(t.target===p){let e=t.target.getBoundingClientRect();f&&(f.style.paddingTop=e.height+"px")}})).observe(p)}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 h=t(e({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let v=!1,b=!1;!function(){var e;const t=document.getElementById("live_chat-wrapper");try{const e=o(h,"remote_config/deriv-com/chat");n(e,(e=>{const o=e.val();v=o.live_chat,b=o.whatsapp_chat;const n=document.querySelector(".whatsapp_chat"),i=document.querySelector(".livechatbtn");n&&(n.style.visibility=b?"visible":"hidden"),i&&(i.style.visibility=v?"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");v?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const t=document.querySelectorAll(".whatsapp_chat");b?t.forEach((e=>{e.style.visibility="visible"})):t.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,o;(v||b)&&(null==(e=null==t?void 0:t.classList)||e.remove("hide-element")),v||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"),_=document.getElementById("cancel-redirect"),k=document.getElementById("proceed-redirect"),L="tracking_status",E="tracking_status_decline",S=window.dataLayer,q=c(document.cookie,"client_information"),x=!!q,z=document.getElementById("accept-cookie"),A=document.getElementById("dont-accept-cookie"),C=document.querySelector(".cookies_background-wrapper");if(document.addEventListener("DOMContentLoaded",(()=>{S&&window.dataLayer.push({loggedIn:x,language:c(document.cookie,"webflow-user-language")||"en",...x&&{visitorId:null==q?void 0:q.loginid,currency:null==q?void 0:q.currency,email:null==q?void 0:q.email}}),!window.location.pathname.includes("eu")||r(L)||r(E)||(C.classList.remove("hide-element"),document.body.classList.add("show-cookie")),null==z||z.addEventListener("click",(()=>{i(L,!0),C.classList.add("hide-element"),document.body.classList.remove("show-cookie")})),null==A||A.addEventListener("click",(()=>{i(E,!0),i(L,!1),C.classList.add("hide-element"),document.body.classList.remove("show-cookie")}))})),window.isEuRegion(window.location.pathname)&&y&&_&&k){const e=["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"];let t="",o="_self";document.querySelectorAll("a").forEach((function(n){const i=new URL(n.href,window.location.href),r=new URL(window.location.href);e.includes(i.host)||i.host===r.host||n.addEventListener("click",(function(e){e.preventDefault(),t=i.href,o=n.target||"_self",y.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),_.addEventListener("click",(function(){y.classList.add("hide-element"),document.body.style.overflow="auto",t=""})),k.addEventListener("click",(function(){t&&(window.open(t,o),t="",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 j=document.querySelectorAll(".navbar_accordion-item");function O(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}j.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"})),j.forEach((e=>{const t=e.querySelector(".navbar_accordion-trigger");t.addEventListener("click",(function(){const e=t.classList.contains("open");if(j.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(O,300)}))}));const I=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=>{I.observe(e,{attributes:!0})}));const $=new URL(window.location.href),D=new URLSearchParams($.search),M=D.get("t");if(D.has("referrer")&&null!=M){c(document.cookie,"referrer_token")!==M&&(s("referrer_token"),i("referrer_token",M,365,".deriv.com"))}const R=document.getElementById("navbar-home_login");R&&R.addEventListener("click",(function(e){e.preventDefault(),window.location.href=d()}));const B=document.getElementById("res-navbar-home_login");B&&B.addEventListener("click",(function(e){e.preventDefault(),window.location.href=d()}));const N=document.getElementById("white-navbar_login");N&&N.addEventListener("click",(function(e){e.preventDefault(),window.location.href=d()}));const U=document.getElementById("res-white-navbar_login");U&&U.addEventListener("click",(function(e){e.preventDefault(),window.location.href=d()})),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 W=document.querySelectorAll(".w-locales-items");if(W.length>0){W.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(t){t.preventDefault(),i("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))}));const e=e=>{let t=document.querySelector('a[hreflang="'+e+'"]');t&&window.location.pathname!==t.getAttribute("href")&&t.click()};window.setLanguageCookie=e=>{i("webflow-user-language",e,30)};let t=r("webflow-user-language"),o=["/careers","/locations","/derivtech","/derivlife","/eu-careers","/our-locations","/product-explorer","/academy","/trading-terms-glossary"],n=window.location.pathname,c=!1;o.some((e=>n.includes(e))),t&&c&&e(t)}document.addEventListener("DOMContentLoaded",(function(){const e=c(document.cookie,"webflow-user-language"),t=["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"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const o=window.getClientCountry();o&&t.includes(o)&&("en"===e?window.location.replace("/404"):window.location.replace(`/${e}/404`))}})),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})}))}));
@@ -0,0 +1,8 @@
1
+ var e,n,i=Object.getOwnPropertyNames,t=(e={"js/trading_central_scripts.min.js"(e,n){
2
+ /*! iFrame Resizer (iframeSizer.min.js ) - v4.2.10 - 2020-02-04
3
+ * Desc: Force cross domain iframes to size to content.
4
+ * Requires: iframeResizer.contentWindow.min.js to be loaded into the target frame.
5
+ * Copyright: (c) 2020 David J. Bradshaw - dave@bradshaw.net
6
+ * License: MIT
7
+ */
8
+ !function(e){if("undefined"!=typeof window){var i,t=0,o=!1,r=!1,a=7,s="[iFrameSizer]",d=s.length,c=null,u=window.requestAnimationFrame,f={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},l={},m=null,g={autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){M("onMessage function not defined")},onResized:function(){},onScroll:function(){return!0}},h={};window.jQuery&&((i=window.jQuery).fn?i.fn.iFrameResize||(i.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,i){H(i,e)})).end()}):x("","Unable to bind to jQuery, it is not fully loaded.")),"function"==typeof define&&define.amd?define([],L):"object"==typeof n&&"object"==typeof n.exports&&(n.exports=L()),window.iFrameResize=window.iFrameResize||L()}function p(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,i){e.addEventListener(n,i,!1)}function b(e,n,i){e.removeEventListener(n,i,!1)}function y(e){return l[e]?l[e].log:o}function v(e,n){k(0,0,0,y(e))}function x(e,n){k(0,0,0,y(e))}function M(e,n){k(0,0,0,!0)}function k(e,n,i,t){!0===t&&window.console}function z(e){function n(){i("Height"),i("Width"),N((function(){C(L),T(q),m("onResized",L)}),L,"init")}function i(e){var n=Number(l[q]["max"+e]),i=Number(l[q]["min"+e]),t=e.toLowerCase(),o=Number(L[t]);v(q,"Checking "+t+" is in range "+i+"-"+n),o<i&&(o=i,v(q,"Set "+t+" to min value")),n<o&&(o=n,v(q,"Set "+t+" to max value")),L[t]=""+o}function t(e){return B.substr(B.indexOf(":")+a+e)}function o(e,n){var i;h[i=n]||(h[i]=setTimeout((function(){h[i]=null,S("Send Page Info","pageInfo:"+function(){var e=document.body.getBoundingClientRect(),n=L.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(n.top-e.top,10),offsetLeft:parseInt(n.left-e.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}(),e,n)}),32))}function r(e){var n=e.getBoundingClientRect();return R(q),{x:Math.floor(Number(n.left)+Number(c.x)),y:Math.floor(Number(n.top)+Number(c.y))}}function u(e){var n=e?r(L.iframe):{x:0,y:0},i={x:Number(L.width)+n.x,y:Number(L.height)+n.y};v(q,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top!==window.self?window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](i.x,i.y):M(q,"Unable to scroll to requested position, window.parentIFrame not found"):(c=i,f(),v(q,"--"))}function f(){!1!==m("onScroll",c)?T(q):E()}function m(e,n){return I(q,e,n)}var g,p,y,k,z,F,H,P,A,B=e.data,L={},q=null;"[iFrameResizerChild]Ready"===B?function(){for(var e in l)S("iFrame requested init",j(e),l[e].iframe,e)}():s===(""+B).substr(0,d)&&B.substr(d).split(":")[0]in l?(F=(z=B.substr(d).split(":"))[1]?parseInt(z[1],10):0,H=l[z[0]]&&l[z[0]].iframe,P=getComputedStyle(H),L={iframe:H,id:z[0],height:F+(A=P,"border-box"!==A.boxSizing?0:(A.paddingTop?parseInt(A.paddingTop,10):0)+(A.paddingBottom?parseInt(A.paddingBottom,10):0))+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(P),width:z[2],type:z[3]},q=L.id,l[q]&&(l[q].loaded=!0),(k=L.type in{true:1,false:1,undefined:1})&&v(q,"Ignoring init message from meta parent page"),!k&&(y=!0,l[p=q]||(y=!1,M(L.type+" No settings for "+p+". Message was: "+B)),y)&&(v(q,"Received: "+B),g=!0,null===L.iframe&&(M(q,"IFrame ("+L.id+") not found"),g=!1),g&&function(){var n,i=e.origin,t=l[q]&&l[q].checkOrigin;if(t&&""+i!="null"&&!(t.constructor===Array?function(){var e=0,n=!1;for(v(q,"Checking connection is from allowed list of origins: "+t);e<t.length;e++)if(t[e]===i){n=!0;break}return n}():(n=l[q]&&l[q].remoteHost,v(q,"Checking connection is from: "+n),i===n)))throw new Error("Unexpected message received from: "+i+" for "+L.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(l[q]&&l[q].firstRun&&l[q]&&(l[q].firstRun=!1),L.type){case"close":O(L.iframe);break;case"message":!function(e){v(q,"onMessage passed: {iframe: "+L.iframe.id+", message: "+e+"}"),m("onMessage",{iframe:L.iframe,message:JSON.parse(e)}),v(q,"--")}(t(6));break;case"autoResize":l[q].autoResize=JSON.parse(t(9));break;case"scrollTo":u(!1);break;case"scrollToOffset":u(!0);break;case"pageInfo":o(l[q]&&l[q].iframe,q),function(){function e(e,t){function r(){l[i]?o(l[i].iframe,i):n()}["scroll","resize"].forEach((function(n){v(i,e+n+" listener for sendPageInfo"),t(window,n,r)}))}function n(){e("Remove ",b)}var i=q;e("Add ",w),l[i]&&(l[i].stopPageInfo=n)}();break;case"pageInfoStop":l[q]&&l[q].stopPageInfo&&(l[q].stopPageInfo(),delete l[q].stopPageInfo);break;case"inPageLink":!function(e){var n,i=e.split("#")[1]||"",t=decodeURIComponent(i),o=document.getElementById(t)||document.getElementsByName(t)[0];o?(n=r(o),v(q,"Moving to in page link (#"+i+") at x: "+n.x+" y: "+n.y),c={x:n.x,y:n.y},f(),v(q,"--")):window.top!==window.self?window.parentIFrame?window.parentIFrame.moveToAnchor(i):v(q,"In page link #"+i+" not found and window.parentIFrame not found"):v(q,"In page link #"+i+" not found")}(t(9));break;case"reset":W(L);break;case"init":n(),m("onInit",L.iframe);break;default:n()}}())):x(q,"Ignored: "+B)}function I(e,n,i){var t=null,o=null;if(l[e]){if("function"!=typeof(t=l[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=t(i)}return o}function F(e){var n=e.id;delete l[n]}function O(e){var n=e.id;if(!1!==I(n,"onClose",n)){v(n,"Removing iFrame: "+n);try{e.parentNode&&e.parentNode.removeChild(e)}catch(i){M(i)}I(n,"onClosed",n),v(n,"--"),F(e)}else v(n,"Close iframe cancelled by onClose event")}function R(n){null===c&&v(n,"Get page position: "+(c={x:window.pageXOffset!==e?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==e?window.pageYOffset:document.documentElement.scrollTop}).x+","+c.y)}function T(e){null!==c&&(window.scrollTo(c.x,c.y),v(e,"Set page position: "+c.x+","+c.y),E())}function E(){c=null}function W(e){v(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),R(e.id),N((function(){C(e),S("reset","reset",e.iframe,e.id)}),e,"reset")}function C(e){function n(n){var t;t=n,e.id?(e.iframe.style[t]=e[t]+"px",v(e.id,"IFrame ("+i+") "+t+" set to "+e[t]+"px")):v("undefined","messageData id not set"),function(n){r||"0"!==e[n]||(r=!0,v(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(l).forEach((function(e){!function(e){function n(n){return"0px"===(l[e]&&l[e].iframe.style[n])}l[e]&&null!==l[e].iframe.offsetParent&&(n("height")||n("width"))&&S("Visibility change","resize",l[e].iframe,e)}(e)}))}function n(n){v("window","Mutation observed: "+n[0].target+" "+n[0].type),P(e,16)}var i,t=p();t&&(i=document.querySelector("body"),new t(n).observe(i,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}(n)}var i=e.iframe.id;l[i]&&(l[i].sizeHeight&&n("height"),l[i].sizeWidth&&n("width"))}function N(e,n,i){i!==n.type&&u&&!window.jasmine?(v(n.id,"Requesting animation frame"),u(e)):e()}function S(e,n,i,t,o){var r,a=!1;t=t||i.id,l[t]&&(i&&"contentWindow"in i&&null!==i.contentWindow?(r=l[t]&&l[t].targetOrigin,v(t,"["+e+"] Sending msg to iframe["+t+"] ("+n+") targetOrigin: "+r),i.contentWindow.postMessage(s+n,r)):M(t,"["+e+"] IFrame("+t+") not found"),o&&l[t]&&l[t].warningTimeout&&(l[t].msgTimeout=setTimeout((function(){!l[t]||l[t].loaded||a||(a=!0,M(t,"IFrame has not responded within "+l[t].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),l[t].warningTimeout)))}function j(e){return e+":"+l[e].bodyMarginV1+":"+l[e].sizeWidth+":"+l[e].log+":"+l[e].interval+":"+l[e].enablePublicMethods+":"+l[e].autoResize+":"+l[e].bodyMargin+":"+l[e].heightCalculationMethod+":"+l[e].bodyBackground+":"+l[e].bodyPadding+":"+l[e].tolerance+":"+l[e].inPageLinks+":"+l[e].resizeFrom+":"+l[e].widthCalculationMethod}function H(n,i){var r,a,s,d,c,u,m,h=(""===(a=n.id)&&(n.id=(r=i&&i.id||g.id+t++,null!==document.getElementById(r)&&(r+=t++),a=r),o=(i||{}).log,v(a,"Added missing iframe ID: "+a+" ("+n.src+")")),a);function b(e){1/0!==l[h][e]&&0!==l[h][e]&&(n.style[e]=l[h][e]+"px",v(h,"Set "+e+" = "+l[h][e]+"px"))}function y(e){if(l[h]["min"+e]>l[h]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}h in l&&"iFrameResizer"in n?M(h,"Ignored iFrame, already setup."):(u=(u=i)||{},l[h]={firstRun:!0,iframe:n,remoteHost:n.src&&n.src.split("/").slice(0,3).join("/")},function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(u),Object.keys(u).forEach((function(e){var n=e.split("Callback");if(2===n.length){var i="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[i]=this[e],delete this[e],M(h,"Deprecated: '"+e+"' has been renamed '"+i+"'. The old method will be removed in the next major version.")}}),u),function(e){for(var n in g)Object.prototype.hasOwnProperty.call(g,n)&&(l[h][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:g[n])}(u),l[h]&&(l[h].targetOrigin=!0===l[h].checkOrigin?""===(m=l[h].remoteHost)||null!==m.match(/^(about:blank|javascript:|file:\/\/)/)?"*":m:"*"),function(){switch(v(h,"IFrame scrolling "+(l[h]&&l[h].scrolling?"enabled":"disabled")+" for "+h),n.style.overflow=!1===(l[h]&&l[h].scrolling)?"hidden":"auto",l[h]&&l[h].scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=l[h]?l[h].scrolling:"no"}}(),y("Height"),y("Width"),b("maxHeight"),b("minHeight"),b("maxWidth"),b("minWidth"),"number"!=typeof(l[h]&&l[h].bodyMargin)&&"0"!==(l[h]&&l[h].bodyMargin)||(l[h].bodyMarginV1=l[h].bodyMargin,l[h].bodyMargin=l[h].bodyMargin+"px"),s=j(h),(c=p())&&(d=c,n.parentNode&&new d((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===n&&O(n)}))}))})).observe(n.parentNode,{childList:!0})),w(n,"load",(function(){S("iFrame.onload",s,n,e,!0),function(){var e=l[h]&&l[h].firstRun,i=l[h]&&l[h].heightCalculationMethod in f;!e&&i&&W({iframe:n,height:0,width:0,type:"init"})}()})),S("init",s,n,e,!0),l[h]&&(l[h].iframe.iFrameResizer={close:O.bind(null,l[h].iframe),removeListeners:F.bind(null,l[h].iframe),resize:S.bind(null,"Window resize","resize",l[h].iframe),moveToAnchor:function(e){S("Move to anchor","moveToAnchor:"+e,l[h].iframe,h)},sendMessage:function(e){S("Send Message","message:"+(e=JSON.stringify(e)),l[h].iframe,h)}}))}function P(e,n){null===m&&(m=setTimeout((function(){m=null,e()}),n))}function A(){"hidden"!==document.visibilityState&&(v("document","Trigger event: Visiblity change"),P((function(){B("Tab Visable","resize")}),16))}function B(e,n){Object.keys(l).forEach((function(i){var t;!l[t=i]||"parent"!==l[t].resizeFrom||!l[t].autoResize||l[t].firstRun||S(e,n,l[i].iframe,i)}))}function L(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),H(n,e),i.push(n))}var i;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!u;e+=1)u=window[n[e]+"RequestAnimationFrame"];u?u=u.bind(window):v("setup","RequestAnimationFrame not supported")}(),w(window,"message",z),w(window,"resize",(function(){var e;v("window","Trigger event: "+(e="resize")),P((function(){B("Window "+e,"resize")}),16)})),w(document,"visibilitychange",A),w(document,"-webkit-visibilitychange",A),function(t,o){switch(i=[],(r=t)&&r.enablePublicMethods&&M("enablePublicMethods option has been removed, public methods are now always available in the iFrame"),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,t));break;case"object":n(t,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}var r;return i}}}()}},function(){return n||(0,e[i(e)[0]])((n={exports:{}}).exports,n),n.exports});export default t();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deriv-com/custom-scripts",
3
- "version": "1.21.6",
3
+ "version": "1.23.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"