Advertisement
watsdesign

BI-III isRussia mini

Mar 31st, 2023 (edited)
674
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import {
  2.     g as t
  3. } from "./p-5aa8a2e9.js";
  4. import "./p-4f1b6cc7.js";
  5. class e {
  6.     static getJobUrl(t, e) {
  7.         return "taleo" === t.sourceSystem ? e + "/job/" + encodeURIComponent(t.title.toLowerCase().replace(/\s/g, "-").replace(/[^\w-]/g, "")) + "-" + t.country + "/" + t.jobId : t.link
  8.     }
  9.     static getJobId() {
  10.         return window.location.pathname.indexOf("/job/") > -1 ? window.location.pathname.split("/").pop() : void 0
  11.     }
  12.     static getCountry() {
  13.         const t = window.location.pathname.split("/");
  14.         let e = "";
  15.         return t.length > 2 && 2 === t[1].length && (e = t[1].toUpperCase(), "DE" === e ? e = "1057" : "MX" === e ? e = "1136" : "IN" === e ? e = "1100" : "JP" === e ? e = "1110" : "AU" === e ? e = "1015" : "NL" === e ? e = "1009" : "BR" === e && (e = "1031")), e
  16.     }
  17.     static async isRussia(e) {
  18.         let n = t().production ? "https://boehringer.talentsys.ru" : "https://test-boehringer.talentsys.ru",
  19.             o = function() {
  20.                 let t = !1;
  21.                 const n = function() {
  22.                     let t = {};
  23.                     return document.cookie.split("; ").forEach((function(e) {
  24.                         let n = e.replace(" ", "").split("=");
  25.                         t[n[0]] = n[1]
  26.                     })), t.currentCountry || null
  27.                 }();
  28.                 return ["росси", "russia"].forEach((n => {
  29.                     ((null == e ? void 0 : e.country) || "").toLowerCase().includes(n) && (t = !0)
  30.                 })), t || (console.log("Country Source: Cookies, country is:", n), t = "RU" === n), t
  31.             }(),
  32.             r = o ? "RU" : "";
  33.         return console.log("---= Dr.Watson is here BI-III:230331:1551 =---"), window.location.search.includes('fromTS') ? document.cookie = "currentCountry=; expires= Thu, 01 Jan 1970 00:00:01 GMT; path=/"
  34.             : o ? i("RU") : await new Promise(((t, e) => {
  35.                 let n = Date.now();
  36.                 try {
  37.                     ! function() {
  38.                         var e;
  39.                         try {
  40.                             e = new XMLHttpRequest
  41.                         } catch (t) {
  42.                             return alert("Your browser does not support Ajax."), !1
  43.                         }
  44.                         e.onreadystatechange = function() {
  45.                             4 == e.readyState && function(e) {
  46.                                 r = e && e.responseText && JSON.parse(e.responseText) ? JSON.parse(e.responseText).country_code : "ipInfoFail", console.log("currentLocation::: ", r), r && "ipInfoFail" !== r && (document.cookie = "currentCountry=" + r + "; expires=" + new Date((new Date).getFullYear() + 1, (new Date).getMonth(), (new Date).getDate()).toUTCString() + "; path=/"), t(i(r)), console.log("Country Source: ipInfo, country is:", r), console.log("|| ipInfo timing:", (Date.now() - n).toString() + "ms ||")
  47.                             }(e)
  48.                         }, e.open("get", "https://ipgeolocation.abstractapi.com/v1/?api_key=4f98016a1ba14957a42d89074099f781", !0), e.send(null)
  49.                     }()
  50.                 } catch (t) {
  51.                     e(t)
  52.                 }
  53.             }));
  54.  
  55.         function i(t) {
  56.             if ("RU" === t) {
  57.                 const t = encodeURIComponent(`https://api012.successfactors.eu/career?company=BoehringerQA&career_job_req_id=${null==e?void 0:e.jobIdNoLocale}&career_ns=job_application&lang=ru_RU&fromTS`);
  58.                 return {
  59.                     status: !0,
  60.                     applyBtnUrl: encodeURI(n + "/gateway.html?recTitle=" + (null == e ? void 0 : e.title) + "&requisition=" + (null == e ? void 0 : e.jobIdNoLocale) + "&redirect=" + t),
  61.                     profileBtnUrl: encodeURI(n + "/login")
  62.                 }
  63.             }
  64.             return {
  65.                 status: !1
  66.             }
  67.         }
  68.     }
  69. }
  70. export {
  71.     e as B
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement