{"version":3,"file":"siteMetadata.DFnZqBe3.mjs","names":[],"sources":["https:/framerusercontent.com/modules/fkacFTJOQlMUuzw2H7kQ/4NnTPBOnU9nfjOqTE5T7/siteMetadata.js"],"sourcesContent":["// Generated by Framer (53c1d35)\nconst valuesByLocaleId={t5OYcePQn:{v0:\" Data Science Institute Singapore\",v1:\"Accredited Master's programmes in Data Science and Artificial Intelligence Singapore\"}};function getLocalizedValue(key,locale){while(locale){const values=valuesByLocaleId[locale.id];if(values){const value=values[key];if(value)return value;}locale=locale.fallback;}}export default function metadata(params,activeLocale){return{customHTMLBodyEnd:'<!-- Google Tag Manager (noscript) -->\\n<noscript><iframe src=\"https://www.googletagmanager.com/ns.html?id=GTM-N3R8V622\" height=\"0\" width=\"0\" style=\"display:none;visibility:hidden\"></iframe></noscript>\\n<!-- End Google Tag Manager (noscript) -->\\n\\n\\n\\n',customHTMLHeadEnd:\"<link rel=\\\"canonical\\\" href=\\\"https://www.datascienceinstitute.net\\\">\\n\\n<!-- Google Tag Manager -->\\n<script>\\n  (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\\n  new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\\n  j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\\n  'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\\n  })(window,document,'script','dataLayer','GTM-N3R8V622');\\n</script>\\n<!-- End Google Tag Manager -->\\n\\n<!-- Start of HubSpot Embed Code -->\\n<script type=\\\"text/javascript\\\" id=\\\"hs-script-loader\\\" async=\\\"\\\" defer=\\\"\\\" src=\\\"//js-eu1.hs-scripts.com/25727595.js\\\"></script>\\n<!-- End of HubSpot Embed Code -->\\n\\n<!-- G-TEGC7S4F6X (comment only; safe to leave or delete) -->\\n\\n<script>\\n(function () {\\n  /* --------------------------------------------------------------------------\\n   * 1.  HELPERS: fixLinks, stripIe, stripZa, onDiplomaPage, geo lookup\\n   * ------------------------------------------------------------------------*/\\n  function fixLinks () {\\n    console.log('[links fixed]');\\n    document.querySelectorAll('a[href]').forEach(a => {\\n      const h = a.getAttribute('href');\\n      if (!h) return;\\n\\n      /* strip same-origin absolute URLs that contain /za  (keep DS diploma) */\\n      if (h.startsWith(location.origin + '/za') &&\\n          h !== location.origin + '/za/postgraduate-diploma-in-data-science') {\\n        a.setAttribute('href', h.replace(location.origin + '/za', '') || '/');\\n      }\\n      /* strip same-origin absolute URLs that contain /ie  (keep AI/ML diploma) */\\n      else if (h.startsWith(location.origin + '/ie') &&\\n               h !== location.origin + '/ie/postgraduate-diploma-in-computer-science-ai-machine-learning') {\\n        a.setAttribute('href', h.replace(location.origin + '/ie', '') || '/');\\n      }\\n      /* strip root-relative /za paths (keep DS diploma) */\\n      else if (h.startsWith('/za') && h !== '/za/postgraduate-diploma-in-data-science') {\\n        a.setAttribute('href', h.replace(/^\\\\/za/, '') || '/');\\n      }\\n      /* strip root-relative /ie paths (keep AI/ML diploma) */\\n      else if (h.startsWith('/ie') && h !== '/ie/postgraduate-diploma-in-computer-science-ai-machine-learning') {\\n        a.setAttribute('href', h.replace(/^\\\\/ie/, '') || '/');\\n      }\\n      /* add leading “/” to plain slugs */\\n      else if (!h.startsWith('/') && !h.startsWith('#') && !h.startsWith('http')) {\\n        a.setAttribute('href', '/' + h.replace(/^\\\\/+/, ''));\\n      }\\n    });\\n  }\\n  window.fixLinks = fixLinks;\\n\\n  /* remove unwanted /ie prefix */\\n  function stripIe () {\\n    const p = window.location.pathname;\\n    if (p.startsWith('/ie') &&\\n        p !== '/ie/postgraduate-diploma-in-computer-science-ai-machine-learning') {\\n      history.replaceState({}, '', p.replace(/^\\\\/ie/, '') || '/');\\n    }\\n  }\\n\\n  /* remove unwanted /za prefix */\\n  function stripZa () {\\n    const p = window.location.pathname;\\n    if (p.startsWith('/za') && p !== '/za/postgraduate-diploma-in-data-science') {\\n      history.replaceState({}, '', p.replace(/^\\\\/za/, '') || '/');\\n    }\\n  }\\n\\n  function onDiplomaPage () {\\n    const p = window.location.pathname;\\n    return [\\n      '/postgraduate-diploma-in-data-science',\\n      '/za/postgraduate-diploma-in-data-science',\\n      '/postgraduate-diploma-in-computer-science-ai-machine-learning',\\n      '/ie/postgraduate-diploma-in-computer-science-ai-machine-learning'\\n    ].includes(p);\\n  }\\n\\n  /* Geo-IP helper --------------------------------------------------------- */\\n  function getCountry () {\\n    const cached = sessionStorage.getItem('geoCode');\\n    if (cached) return Promise.resolve(cached);\\n\\n    const ipapi  = 'https://ipapi.co/json/';\\n    const backup = 'https://api.country.is/';\\n\\n    return fetch(ipapi)\\n      .then(r => r.ok ? r.json() : Promise.reject())\\n      .catch(() => fetch(backup).then(r => r.json()))\\n      .then(d => {\\n        const code = (d.country_code || d.country || '').toLowerCase();\\n        sessionStorage.setItem('geoCode', code);\\n        return code;\\n      });\\n  }\\n\\n  /* --------------------------------------------------------------------------\\n   * 2.  REDIRECT LOGIC\\n   * ------------------------------------------------------------------------*/\\n  function handleRedirect () {\\n    stripIe();   // clean /ie first\\n    stripZa();   // then clean /za\\n\\n    if (!onDiplomaPage()) { fixLinks(); return; }\\n    if (window.location.hostname.includes('framer')) { fixLinks(); return; }\\n    if (window.location.hash) { fixLinks(); return; }   // keep anchor scrolls\\n\\n    setTimeout(() => {\\n      const allowed = {\\n        za  : '/za/postgraduate-diploma-in-data-science',\\n        ie  : '/ie/postgraduate-diploma-in-computer-science-ai-machine-learning',\\n        intl: '/postgraduate-diploma-in-data-science'\\n      };\\n\\n      /* Lookup tables (fast O(1) checks) */\\n      const africa = 'dz eg ly ma sd tn bj bf cv gm gh gn gw ci lr ml mr ne ng sn sl tg bi cm cf td cg cd gq ga st ao bw sz ls na mw mz za zm zw ke et dj er so ss tz ug rw km mg mu sc'\\n                     .split(' ')\\n                     .reduce((o,c)=>(o[c]=1,o),{});\\n      const ireland = { ie: 1 };\\n\\n      getCountry()\\n        .then(code => {\\n          let target = null;\\n\\n          /* ---------------- Rule set ---------------- */\\n          /* 1) Irish visitor on *plain* AI/ML path → /ie/ version */\\n          if (\\n            ireland[code] &&\\n            location.pathname === '/postgraduate-diploma-in-computer-science-ai-machine-learning'\\n          ) {\\n            target = allowed.ie;\\n          }\\n          /* 2) African visitor NOT on AI/ML page and NOT already on /ie/ → /za/ page */\\n          else if (\\n            africa[code] &&\\n            !location.pathname.startsWith('/ie') &&\\n            location.pathname !== '/postgraduate-diploma-in-computer-science-ai-machine-learning'\\n          ) {\\n            target = allowed.za;\\n          }\\n          /* 3) Everyone else: stay put */\\n\\n          if (target && window.location.pathname !== target) {\\n            console.log(`🌍 User from ${code.toUpperCase()}, redirecting → ${target}`);\\n            window.location.replace(target);\\n          } else {\\n            console.log('✅ No redirect needed.');\\n          }\\n        })\\n        .catch(err => {\\n          console.error('🌐 Geo-IP failed:', err);\\n          /* Fallback: stay on current page */\\n        })\\n        .finally(fixLinks);\\n    }, 100);\\n  }\\n\\n  /* --------------------------------------------------------------------------\\n   * 3.  INITIALISE + SPA PATCHES\\n   * ------------------------------------------------------------------------*/\\n  handleRedirect();\\n  fixLinks();   // run once at load\\n\\n  /* Patch SPA navigation */\\n  const p = history.pushState, r = history.replaceState;\\n  history.pushState    = function () { p.apply(history, arguments); handleRedirect(); fixLinks(); };\\n  history.replaceState = function () { r.apply(history, arguments); handleRedirect(); fixLinks(); };\\n  window.addEventListener('popstate', () => { handleRedirect(); fixLinks(); });\\n\\n  /* Intercept clicks that still point at /za… or /ie… */\\n  document.addEventListener('click', e => {\\n    const a = e.target.closest('a[href]');\\n    if (!a) return;\\n    const h = (a.dataset.framerPage || a.getAttribute('href')) ?? '';\\n\\n    /* Clean /za links */\\n    if (h.startsWith('/za') && h !== '/za/postgraduate-diploma-in-data-science') {\\n      e.preventDefault();\\n      history.pushState({}, '', h.replace(/^\\\\/za/, '') || '/');\\n      handleRedirect(); fixLinks();\\n    }\\n    /* Clean /ie links */\\n    else if (h.startsWith('/ie') && h !== '/ie/postgraduate-diploma-in-computer-science-ai-machine-learning') {\\n      e.preventDefault();\\n      history.pushState({}, '', h.replace(/^\\\\/ie/, '') || '/');\\n      handleRedirect(); fixLinks();\\n    }\\n  }, true);   // capture phase – runs BEFORE Framer’s router\\n})();\\n</script>\\n\",description:getLocalizedValue(\"v1\",activeLocale)??\"The Data Science Institute offers accredited postgraduate courses and professional certifications in Data Science and AI. Gain industry-focused qualifications through flexible online learning\",favicon:\"https://framerusercontent.com/assets/Y2MMnnLpszXPluHFyx5XTpOs.svg\",robots:\"max-image-preview:large\",title:getLocalizedValue(\"v0\",activeLocale)??\"Data Science Institute\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"oDACsK,SAAS,EAAkB,EAAI,EAAO,CAAC,KAAM,GAAO,CAAC,IAAM,EAAO,EAAiB,EAAO,IAAI,GAAG,EAAO,CAAC,IAAM,EAAM,EAAO,GAAK,GAAG,EAAM,OAAO,EAAO,EAAO,EAAO,UAAW,SAAwB,EAAS,EAAO,EAAa,CAAC,MAAM,CAAC,kBAAkB;;;;;;EAAgQ,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA43P,YAAY,EAAkB,KAAK,EAAa,EAAE,kMAAkM,QAAQ,oEAAoE,OAAO,0BAA0B,MAAM,EAAkB,KAAK,EAAa,EAAE,yBAAyB,iBAAp9R,EAAiB,CAAC,UAAU,CAAC,GAAG,oCAAoC,GAAG,uFAAuF,CAAC"}