( function() {  var mapping = [{"appname":"", "appid":"REFERENCE_APPLICATIONS_FOR_PIC32M_MCUS_OVERVIEW", "path":"GUID-FE46A4EF-FF25-46E7-BE99-3DC0681EE28A.html"},{"appname":"", "appid":"REFERENCE_APPLICATIONS_FOR_PIC32M_MCUS_RELEASE_NOTES", "path":"GUID-A02C888B-8F22-4F56-BFA4-723F4E7D858E.html"},{"appname":"", "appid":"REFERENCE_APPLICATIONS_FOR_PIC32M_MCUS", "path":"GUID-8A63BA10-E39D-4BED-B99E-3A300D2B2037.html"},{"appname":"", "appid":"PIC32MK_MCM_CURIOSITY_PRO_DEVELOPMENT_BOARD", "path":"GUID-17C93DD8-2F2D-488F-9E30-898CF80EABB0.html"},{"appname":"", "appid":"PIC32MZ_DA_CURIOSITY_DEVELOPMENT_KIT", "path":"GUID-7CEFA40B-01C0-41F3-A0B6-04D2FF11467D.html"},{"appname":"", "appid":"CURIOSITY_PIC32MZ_EF_2_DEVELOPMENT_BOARD", "path":"GUID-EE2A0D47-703A-4294-87A1-9FB3E27A1E1E.html"},{"appname":"", "appid":"CURIOSITY_PIC32MX470_DEVELOPMENT_BOARD", "path":"GUID-7444DE20-06DB-4A11-A81B-CD2C37B42760.html"},{"appname":"", "appid":"PIC32MZ_EMBEDDED_CONNECTIVITY_WITH_FPU_EF_STARTER_KIT", "path":"GUID-B6D601EA-D274-4446-B0C8-173A19E43AB1.html"},{"appname":"", "appid":"PIC32MK_MCM_CURIOSITY_PRO_GETTING_STARTED", "path":"GUID-EF4E6CC2-4B7F-4E8F-8087-543B56A6BE95.html"},{"appname":"", "appid":"PIC32MK_MCM_CURIOSITY_PRO_GETTING_STARTED_EXT", "path":"GUID-CBAC0853-2F56-48AA-909C-B2EA460A3542.html"},{"appname":"", "appid":"PIC32MZ_DA_CURIOSITY_GETTING_STARTED", "path":"GUID-A3E3DE58-CD89-4A2F-8AC0-9EBFCA7B0423.html"},{"appname":"", "appid":"PIC32MZ_DA_CURIOSITY_WEB_PHOTO_FRAME", "path":"GUID-CD686B5E-757B-4D1A-A3A9-E97CDB94EEF3.html"},{"appname":"", "appid":"PIC32MZ_EF_CURIOSITY_V2_GETTING_STARTED", "path":"GUID-901B2A39-990A-4E35-9C8B-7520EB98741C.html"},{"appname":"", "appid":"PIC32MZ_EF_CURIOSITY_V2_GETTING_STARTED_EXT", "path":"GUID-952A84E5-D9DF-466A-AAFA-6C51BA04DEEC.html"},{"appname":"", "appid":"PIC32MZ_EF_CURIOSITY_V2_GETTING_STARTED_MIDDLEWARE", "path":"GUID-8EE79126-2F7E-4F63-80DF-EBD24874DA1D.html"},{"appname":"", "appid":"PIC32MZ_EF_CURIOSITY_V2_WIFI_RGB_EASY_CONFIGURATION", "path":"GUID-F0A77EE5-5FD1-4202-A89B-8718C7B5C401.html"},{"appname":"", "appid":"PIC32MZ_EF_CURIOSITY_V2_THERMAL_CAMERA_HEAT_MAP", "path":"GUID-5D3DC50B-AE5E-43DD-9C9B-3B2C62211445.html"},{"appname":"", "appid":"PIC32MZ_EF_CURIOSITY_V2_WEB_PHOTO_FRAME", "path":"GUID-D2985DC8-AEB4-4B3F-B9AF-34FE314C44A4.html"},{"appname":"", "appid":"PIC32MZ_EF_CURIOSITY_V2_MOTION_SURVEILLANCE", "path":"GUID-5D91A020-50E2-4E64-914A-558A8B85E720.html"},{"appname":"", "appid":"PIC32MX470_CURIOSITY_GETTING_STARTED", "path":"GUID-081E5423-9E38-482B-AE56-C9638B435308.html"},{"appname":"", "appid":"PIC32MZ_EF_SK_UART_LIVE_UPDATE", "path":"GUID-E5DE5DCC-2E4E-4EA7-A136-F4107A598C30.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
              });

        })();