{"version":3,"file":"CustomNavigationClient.mjs","names":["NavigationClient","CustomNavigationClient","constructor","history","navigateInternal","url","options","relativePath","replace","window","location","origin","noHistory","push"],"sources":["../../src/utilities/CustomNavigationClient.js"],"sourcesContent":["import { NavigationClient } from '@azure/msal-browser';\n\n/**\n * Extending the default NavigationClient allows you to overwrite just navigateInternal while continuing to use the default navigateExternal function\n * If you would like to overwrite both you can implement INavigationClient directly instead\n */\nclass CustomNavigationClient extends NavigationClient {\n  constructor(history) {\n    super();\n    this.history = history; // Passed in from useHistory hook provided by react-router-dom;\n  }\n\n  // This function will be called anytime msal needs to navigate from one page in your application to another\n  async navigateInternal(url, options) {\n    // url will be absolute, you will need to parse out the relative path to provide to the history API\n    const relativePath = url.replace(window.location.origin, '');\n    if (options.noHistory) {\n      this.history.replace(relativePath);\n    } else {\n      this.history.push(relativePath);\n    }\n\n    return false;\n  }\n}\n\nexport default CustomNavigationClient;\n"],"mappings":";;;;;;AAMA,IAAMC,yBAAN,cAAqCD,iBAAiB;CACpDE,YAAYC,SAAS;AACnB,SAAO;AACP,OAAKA,UAAUA;;CAIjB,MAAMC,iBAAiBC,KAAKC,SAAS;EAEnC,MAAMC,eAAeF,IAAIG,QAAQC,OAAOC,SAASC,QAAQ,GAAG;AAC5D,MAAIL,QAAQM,UACV,MAAKT,QAAQK,QAAQD,aAAa;MAElC,MAAKJ,QAAQU,KAAKN,aAAa;AAGjC,SAAO"}