( function() {  var mapping = [{"appname":"", "appid":"BOOTLOADER_APPS_OTA_INTRODUCTION", "path":"GUID-D3602325-EE26-4349-B13C-9A4F4648DC3D.html"},{"appname":"", "appid":"BOOTLOADER_APPS_OTA_DUAL_BANK", "path":"GUID-A82B7725-71FC-4D92-9B03-5FF66C2FAD9E.html"},{"appname":"", "appid":"BOOTLOADER_APPS_OTA_PIC32MK_MCM_CURIOSITY_PRO", "path":"GUID-32E7C792-B846-4055-ACFF-5493AD1CF015.html"},{"appname":"", "appid":"BOOTLOADER_APPS_OTA_PIC32MZ_EF_CURIOSITY", "path":"GUID-F3ED85E5-AEE1-4FFE-BDC4-745C11F4731B.html"},{"appname":"", "appid":"BOOTLOADER_APPS_OTA_SAM_E54_CULT", "path":"GUID-AF4E5EA9-1680-4C2A-A355-7AB2E0ACC4C6.html"},{"appname":"", "appid":"BOOTLOADER_APPS_OTA_SAM_E54_XPRO", "path":"GUID-6FA87DBD-BC1E-405A-9B05-9ADF83B20595.html"},{"appname":"", "appid":"BOOTLOADER_APPS_OTA_EXTERNAL_MEMORY", "path":"GUID-BDF2405C-B905-4252-AEB3-07922B1A4748.html"},{"appname":"", "appid":"BOOTLOADER_APPS_OTA_EM_SAM_PIC32CK_GC01_CULT", "path":"GUID-BA95010B-1031-4F03-A5AF-F0270FFBF07B.html"},{"appname":"", "appid":"BOOTLOADER_APPS_OTA_EM_pic32cm_gc00_cpro", "path":"GUID-0CF70509-93AD-4DCC-83C0-02FA6EAFAFDF.html"},{"appname":"", "appid":"BOOTLOADER_APPS_OTA_EM_PIC32CX_MTSH_DB", "path":"GUID-995E29B3-5396-4FCF-A9C4-926588C3C677.html"},{"appname":"", "appid":"BOOTLOADER_APPS_OTA_EM_PIC32CZ_CA70_CULT", "path":"GUID-45FC923B-D2EF-450D-BBD4-E21E1EAC281D.html"},{"appname":"", "appid":"BOOTLOADER_APPS_OTA_EM_SAM_D21_XPRO", "path":"GUID-2D290CA4-9AFB-4E39-9BDF-DE6D1728E96F.html"},{"appname":"", "appid":"BOOTLOADER_APPS_OTA_EM_SAM_E54_CULT", "path":"GUID-D948268A-DE06-480D-98D5-B63D263617EB.html"},{"appname":"", "appid":"BOOTLOADER_APPS_OTA_EM_SAM_E70_XULT", "path":"GUID-72B4F744-78F4-43B3-80EB-ACCB334811B8.html"},{"appname":"", "appid":"BOOTLOADER_APPS_OTA_OTA_APP", "path":"GUID-B3F7BD29-9883-431D-B682-F405F22C1BE0.html"},{"appname":"", "appid":"BOOTLOADER_APPS_OTA_HOST_SCRIPT_HELP", "path":"GUID-ECC16920-EE69-48DB-9B32-F774CEB2D079.html"}];
            var mchp = (function (mchp) {
                var mchp = mchp || {};
                var mapping = [];
        
                mchp.utils = {};
        
                mchp.utils.getQueryParam = function (name, url = window.location.href) {
                  name = name.replace(/[\[\]]/g, "\\$&");
                  var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
                    results = regex.exec(url);
                  if (!results) return null;
                  if (!results[2]) return "";
                  return decodeURIComponent(results[2].replace(/\+/g, " "));
                };

                mchp.utils.isFirefox = typeof InstallTrigger !== 'undefined';
        
                mchp.init = function (options) {
                  mchp.mapping = options.mapping || [];
                  mchp.bindEvents();
                };
        
                mchp.bindEvents = function () {
                    if (mchp.utils.isFirefox) {
                      window.onload = mchp.checkRedirect;
                    } else {
                      document.onreadystatechange = mchp.checkRedirect;
                    }
                };

                mchp.checkRedirect = function() {
                  var contextId = mchp.utils.getQueryParam("contextId") || "";
                  if (contextId && contextId != undefined) {
                    var record = mchp.mapping.find(function(x){
                      return x.appid && x.appid.toLowerCase() == contextId.toLowerCase();
                    });
                    if (record && record.path) {
                      window.stop();
                      window.location = record.path;
                    }
                  }
                };
        
                return {
                  init: mchp.init,
                };
              })();
        
              mchp.init({
                mapping: mapping
              });

        })();