From 9af8d342e4188ae583ab30c560d15f7d4e30f60a Mon Sep 17 00:00:00 2001 From: Krasimir Tsonev Date: Fri, 26 Mar 2021 07:56:19 +0200 Subject: [PATCH] Export to es5. A webpack config change. #284 --- CHANGELOG.md | 4 ++ lib/navigo.amd.js | 148 +++++++++++++++++++------------------- lib/navigo.amd.js.map | 2 +- lib/navigo.amd.min.js | 2 +- lib/navigo.amd.min.js.map | 2 +- lib/navigo.js | 146 ++++++++++++++++++------------------- lib/navigo.js.map | 2 +- lib/navigo.min.js | 2 +- lib/navigo.min.js.map | 2 +- package.json | 2 +- 10 files changed, 158 insertions(+), 154 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bf6d040..6eff97ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 8.11.0 + +Export to es5. A webpack config change. + ## 8.10.1 Fixing a hash routing bug introduced in 8.10.0 diff --git a/lib/navigo.amd.js b/lib/navigo.amd.js index 59c77a2b..0e16c589 100644 --- a/lib/navigo.amd.js +++ b/lib/navigo.amd.js @@ -1,4 +1,4 @@ -define("Navigo.amd", [], () => /******/ (() => { // webpackBootstrap +define("Navigo.amd", [], function() { return /******/ (function() { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ @@ -6,11 +6,11 @@ define("Navigo.amd", [], () => /******/ (() => { // webpackBootstrap /*!******************!*\ !*** ./src/Q.ts ***! \******************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ Q +/* harmony export */ "default": function() { return /* binding */ Q; } /* harmony export */ }); function Q(funcs, c, done) { var context = c || {}; @@ -55,18 +55,18 @@ Q.if = function (condition, one, two) { /*!**************************!*\ !*** ./src/constants.ts ***! \**************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "PARAMETER_REGEXP": () => /* binding */ PARAMETER_REGEXP, -/* harmony export */ "REPLACE_VARIABLE_REGEXP": () => /* binding */ REPLACE_VARIABLE_REGEXP, -/* harmony export */ "WILDCARD_REGEXP": () => /* binding */ WILDCARD_REGEXP, -/* harmony export */ "REPLACE_WILDCARD": () => /* binding */ REPLACE_WILDCARD, -/* harmony export */ "NOT_SURE_REGEXP": () => /* binding */ NOT_SURE_REGEXP, -/* harmony export */ "REPLACE_NOT_SURE": () => /* binding */ REPLACE_NOT_SURE, -/* harmony export */ "START_BY_SLASH_REGEXP": () => /* binding */ START_BY_SLASH_REGEXP, -/* harmony export */ "MATCH_REGEXP_FLAGS": () => /* binding */ MATCH_REGEXP_FLAGS +/* harmony export */ "PARAMETER_REGEXP": function() { return /* binding */ PARAMETER_REGEXP; }, +/* harmony export */ "REPLACE_VARIABLE_REGEXP": function() { return /* binding */ REPLACE_VARIABLE_REGEXP; }, +/* harmony export */ "WILDCARD_REGEXP": function() { return /* binding */ WILDCARD_REGEXP; }, +/* harmony export */ "REPLACE_WILDCARD": function() { return /* binding */ REPLACE_WILDCARD; }, +/* harmony export */ "NOT_SURE_REGEXP": function() { return /* binding */ NOT_SURE_REGEXP; }, +/* harmony export */ "REPLACE_NOT_SURE": function() { return /* binding */ REPLACE_NOT_SURE; }, +/* harmony export */ "START_BY_SLASH_REGEXP": function() { return /* binding */ START_BY_SLASH_REGEXP; }, +/* harmony export */ "MATCH_REGEXP_FLAGS": function() { return /* binding */ MATCH_REGEXP_FLAGS; } /* harmony export */ }); var PARAMETER_REGEXP = /([:*])(\w+)/g; var REPLACE_VARIABLE_REGEXP = "([^/]+)"; @@ -83,11 +83,11 @@ var MATCH_REGEXP_FLAGS = ""; /*!**********************!*\ !*** ./src/index.ts ***! \**********************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ Navigo +/* harmony export */ "default": function() { return /* binding */ Navigo; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./src/utils.ts"); /* harmony import */ var _Q__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Q */ "./src/Q.ts"); @@ -540,12 +540,12 @@ function Navigo(appRoute, options) { /*!***************************!*\ !*** ./src/lifecycles.ts ***! \***************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "foundLifecycle": () => /* binding */ foundLifecycle, -/* harmony export */ "notFoundLifeCycle": () => /* binding */ notFoundLifeCycle +/* harmony export */ "foundLifecycle": function() { return /* binding */ foundLifecycle; }, +/* harmony export */ "notFoundLifeCycle": function() { return /* binding */ notFoundLifeCycle; } /* harmony export */ }); /* harmony import */ var _Q__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Q */ "./src/Q.ts"); /* harmony import */ var _middlewares_checkForLeaveHook__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./middlewares/checkForLeaveHook */ "./src/middlewares/checkForLeaveHook.ts"); @@ -579,11 +579,11 @@ var notFoundLifeCycle = [_middlewares_checkForLeaveHook__WEBPACK_IMPORTED_MODULE /*!****************************************!*\ !*** ./src/middlewares/callHandler.ts ***! \****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ callHandler +/* harmony export */ "default": function() { return /* binding */ callHandler; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -602,11 +602,11 @@ function callHandler(context, done) { /*!**********************************************!*\ !*** ./src/middlewares/checkForAfterHook.ts ***! \**********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ checkForAfterHook +/* harmony export */ "default": function() { return /* binding */ checkForAfterHook; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -626,11 +626,11 @@ function checkForAfterHook(context, done) { /*!************************************************!*\ !*** ./src/middlewares/checkForAlreadyHook.ts ***! \************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ checkForAlreadyHook +/* harmony export */ "default": function() { return /* binding */ checkForAlreadyHook; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -660,11 +660,11 @@ function checkForAlreadyHook(context, done) { /*!***********************************************!*\ !*** ./src/middlewares/checkForBeforeHook.ts ***! \***********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ checkForBeforeHook +/* harmony export */ "default": function() { return /* binding */ checkForBeforeHook; } /* harmony export */ }); /* harmony import */ var _Q__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Q */ "./src/Q.ts"); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -697,11 +697,11 @@ function checkForBeforeHook(context, done) { /*!*******************************************************!*\ !*** ./src/middlewares/checkForDeprecationMethods.ts ***! \*******************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ checkForDeprecationMethods +/* harmony export */ "default": function() { return /* binding */ checkForDeprecationMethods; } /* harmony export */ }); function checkForDeprecationMethods(context, done) { if (context.navigateOptions) { @@ -723,11 +723,11 @@ function checkForDeprecationMethods(context, done) { /*!********************************************!*\ !*** ./src/middlewares/checkForForceOp.ts ***! \********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ checkForForceOp +/* harmony export */ "default": function() { return /* binding */ checkForForceOp; } /* harmony export */ }); function checkForForceOp(context, done) { if (context.navigateOptions.force === true) { @@ -745,11 +745,11 @@ function checkForForceOp(context, done) { /*!**********************************************!*\ !*** ./src/middlewares/checkForLeaveHook.ts ***! \**********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ checkForLeaveHook +/* harmony export */ "default": function() { return /* binding */ checkForLeaveHook; } /* harmony export */ }); /* harmony import */ var _Q__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Q */ "./src/Q.ts"); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -814,11 +814,11 @@ function checkForLeaveHook(context, done) { /*!****************************************************!*\ !*** ./src/middlewares/checkForNotFoundHandler.ts ***! \****************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ checkForNotFoundHandler +/* harmony export */ "default": function() { return /* binding */ checkForNotFoundHandler; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -855,11 +855,11 @@ function checkForNotFoundHandler(context, done) { /*!*************************************!*\ !*** ./src/middlewares/errorOut.ts ***! \*************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ errorOut +/* harmony export */ "default": function() { return /* binding */ errorOut; } /* harmony export */ }); function errorOut(context, done) { if (!context.resolveOptions || context.resolveOptions.noMatchWarning === false || typeof context.resolveOptions.noMatchWarning === "undefined") console.warn("Navigo: \"" + context.currentLocationPath + "\" didn't match any of the registered routes."); @@ -872,11 +872,11 @@ function errorOut(context, done) { /*!*****************************************!*\ !*** ./src/middlewares/flushCurrent.ts ***! \*****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ flushCurrent +/* harmony export */ "default": function() { return /* binding */ flushCurrent; } /* harmony export */ }); function flushCurrent(context, done) { context.instance._setCurrent(null); @@ -890,11 +890,11 @@ function flushCurrent(context, done) { /*!********************************************************!*\ !*** ./src/middlewares/matchPathToRegisteredRoutes.ts ***! \********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ matchPathToRegisteredRoutes +/* harmony export */ "default": function() { return /* binding */ matchPathToRegisteredRoutes; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -923,11 +923,11 @@ function matchPathToRegisteredRoutes(context, done) { /*!*******************************************!*\ !*** ./src/middlewares/processMatches.ts ***! \*******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ processMatches +/* harmony export */ "default": function() { return /* binding */ processMatches; } /* harmony export */ }); /* harmony import */ var _Q__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Q */ "./src/Q.ts"); /* harmony import */ var _lifecycles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lifecycles */ "./src/lifecycles.ts"); @@ -965,11 +965,11 @@ function processMatches(context, done) { /*!********************************************!*\ !*** ./src/middlewares/setLocationPath.ts ***! \********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ setLocationPath +/* harmony export */ "default": function() { return /* binding */ setLocationPath; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -988,11 +988,11 @@ function setLocationPath(context, done) { /*!*********************************************!*\ !*** ./src/middlewares/updateBrowserURL.ts ***! \*********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ updateBrowserURL +/* harmony export */ "default": function() { return /* binding */ updateBrowserURL; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -1031,11 +1031,11 @@ function updateBrowserURL(context, done) { /*!****************************************!*\ !*** ./src/middlewares/updateState.ts ***! \****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ updateState +/* harmony export */ "default": function() { return /* binding */ updateState; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -1053,11 +1053,11 @@ function updateState(context, done) { /*!****************************************!*\ !*** ./src/middlewares/waitingList.ts ***! \****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ waitingList +/* harmony export */ "default": function() { return /* binding */ waitingList; } /* harmony export */ }); function waitingList(context) { context.instance.__markAsClean(context); @@ -1069,24 +1069,24 @@ function waitingList(context) { /*!**********************!*\ !*** ./src/utils.ts ***! \**********************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "getCurrentEnvURL": () => /* binding */ getCurrentEnvURL, -/* harmony export */ "clean": () => /* binding */ clean, -/* harmony export */ "isString": () => /* binding */ isString, -/* harmony export */ "isFunction": () => /* binding */ isFunction, -/* harmony export */ "extractHashFromURL": () => /* binding */ extractHashFromURL, -/* harmony export */ "regExpResultToParams": () => /* binding */ regExpResultToParams, -/* harmony export */ "extractGETParameters": () => /* binding */ extractGETParameters, -/* harmony export */ "parseQuery": () => /* binding */ parseQuery, -/* harmony export */ "matchRoute": () => /* binding */ matchRoute, -/* harmony export */ "pushStateAvailable": () => /* binding */ pushStateAvailable, -/* harmony export */ "undefinedOrTrue": () => /* binding */ undefinedOrTrue, -/* harmony export */ "parseNavigateOptions": () => /* binding */ parseNavigateOptions, -/* harmony export */ "windowAvailable": () => /* binding */ windowAvailable, -/* harmony export */ "accumulateHooks": () => /* binding */ accumulateHooks +/* harmony export */ "getCurrentEnvURL": function() { return /* binding */ getCurrentEnvURL; }, +/* harmony export */ "clean": function() { return /* binding */ clean; }, +/* harmony export */ "isString": function() { return /* binding */ isString; }, +/* harmony export */ "isFunction": function() { return /* binding */ isFunction; }, +/* harmony export */ "extractHashFromURL": function() { return /* binding */ extractHashFromURL; }, +/* harmony export */ "regExpResultToParams": function() { return /* binding */ regExpResultToParams; }, +/* harmony export */ "extractGETParameters": function() { return /* binding */ extractGETParameters; }, +/* harmony export */ "parseQuery": function() { return /* binding */ parseQuery; }, +/* harmony export */ "matchRoute": function() { return /* binding */ matchRoute; }, +/* harmony export */ "pushStateAvailable": function() { return /* binding */ pushStateAvailable; }, +/* harmony export */ "undefinedOrTrue": function() { return /* binding */ undefinedOrTrue; }, +/* harmony export */ "parseNavigateOptions": function() { return /* binding */ parseNavigateOptions; }, +/* harmony export */ "windowAvailable": function() { return /* binding */ windowAvailable; }, +/* harmony export */ "accumulateHooks": function() { return /* binding */ accumulateHooks; } /* harmony export */ }); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./src/constants.ts"); @@ -1299,32 +1299,32 @@ function accumulateHooks(hooks, result) { /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ -/******/ (() => { +/******/ !function() { /******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { +/******/ __webpack_require__.d = function(exports, definition) { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; -/******/ })(); +/******/ }(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) -/******/ })(); +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); /******/ /******/ /* webpack/runtime/make namespace object */ -/******/ (() => { +/******/ !function() { /******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { +/******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; -/******/ })(); +/******/ }(); /******/ /************************************************************************/ /******/ // module exports must be returned from runtime so entry inlining is disabled @@ -1332,5 +1332,5 @@ function accumulateHooks(hooks, result) { /******/ // Load entry module and return exports /******/ return __webpack_require__("./src/index.ts"); /******/ })() -.default);; +.default});; //# sourceMappingURL=navigo.amd.js.map \ No newline at end of file diff --git a/lib/navigo.amd.js.map b/lib/navigo.amd.js.map index dba5acc4..82e9430c 100644 --- a/lib/navigo.amd.js.map +++ b/lib/navigo.amd.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://Navigo.amd/./src/Q.ts","webpack://Navigo.amd/./src/constants.ts","webpack://Navigo.amd/./src/index.ts","webpack://Navigo.amd/./src/lifecycles.ts","webpack://Navigo.amd/./src/middlewares/callHandler.ts","webpack://Navigo.amd/./src/middlewares/checkForAfterHook.ts","webpack://Navigo.amd/./src/middlewares/checkForAlreadyHook.ts","webpack://Navigo.amd/./src/middlewares/checkForBeforeHook.ts","webpack://Navigo.amd/./src/middlewares/checkForDeprecationMethods.ts","webpack://Navigo.amd/./src/middlewares/checkForForceOp.ts","webpack://Navigo.amd/./src/middlewares/checkForLeaveHook.ts","webpack://Navigo.amd/./src/middlewares/checkForNotFoundHandler.ts","webpack://Navigo.amd/./src/middlewares/errorOut.ts","webpack://Navigo.amd/./src/middlewares/flushCurrent.ts","webpack://Navigo.amd/./src/middlewares/matchPathToRegisteredRoutes.ts","webpack://Navigo.amd/./src/middlewares/processMatches.ts","webpack://Navigo.amd/./src/middlewares/setLocationPath.ts","webpack://Navigo.amd/./src/middlewares/updateBrowserURL.ts","webpack://Navigo.amd/./src/middlewares/updateState.ts","webpack://Navigo.amd/./src/middlewares/waitingList.ts","webpack://Navigo.amd/./src/utils.ts","webpack://Navigo.amd/webpack/bootstrap","webpack://Navigo.amd/webpack/runtime/define property getters","webpack://Navigo.amd/webpack/runtime/hasOwnProperty shorthand","webpack://Navigo.amd/webpack/runtime/make namespace object","webpack://Navigo.amd/webpack/startup"],"names":["Q","funcs","c","done","context","idx","next","Array","isArray","splice","moveForward","if","condition","one","two","PARAMETER_REGEXP","REPLACE_VARIABLE_REGEXP","WILDCARD_REGEXP","REPLACE_WILDCARD","NOT_SURE_REGEXP","REPLACE_NOT_SURE","START_BY_SLASH_REGEXP","MATCH_REGEXP_FLAGS","DEFAULT_LINK_SELECTOR","Navigo","appRoute","options","DEFAULT_RESOLVE_OPTIONS","strategy","hash","noMatchWarning","linksSelector","self","root","current","routes","destroyed","genericHooks","isPushStateAvailable","pushStateAvailable","isWindowAvailable","windowAvailable","console","warn","clean","_checkForAHash","url","indexOf","split","composePathWithRoot","path","createRoute","handler","hooks","name","isString","String","accumulateHooks","on","RegExp","Object","keys","forEach","p","uses","as","push","resolve","to","__dirty","__waiting","undefined","instance","currentLocationPath","navigateOptions","resolveOptions","setLocationPath","matchPathToRegisteredRoutes","matches","length","processMatches","notFoundLifeCycle","waitingList","navigate","checkForDeprecationMethods","checkForForceOp","updateBrowserURL","navigateByName","data","generate","replace","off","what","filter","r","isFunction","listen","__popstateListener","__freezeListening","window","addEventListener","destroy","removeEventListener","notFound","_notFoundRoute","updatePageLinks","findLinks","link","getAttribute","hasListenerAttached","navigoHandler","e","ctrlKey","metaKey","target","tagName","toLowerCase","location","match","URL","u","pathname","search","err","parseNavigateOptions","preventDefault","stopPropagation","slice","call","document","querySelectorAll","setGenericHooks","lastResolved","route","find","result","key","includeRoot","getLinkPath","pathToMatchObject","extractGETParameters","queryString","params","parseQuery","hashString","extractHashFromURL","getCurrentLocation","getCurrentEnvURL","directMatchWithRegisteredRoutes","directMatchWithLocation","currentLocation","annotatePathWithRoot","matchRoute","addHook","type","func","getRoute","f","nameOrHandler","__markAsClean","shift","matchLocation","addBeforeHook","bind","addAfterHook","addAlreadyHook","addLeaveHook","_pathToMatchObject","_clean","_setCurrent","foundLifecycle","checkForAlreadyHook","checkForBeforeHook","callHandler","checkForAfterHook","checkForLeaveHook","checkForNotFoundHandler","notFoundHandled","concat","updateState","errorOut","flushCurrent","undefinedOrTrue","after","already","before","map","beforeHookInternal","_","d","shouldStop","force","oldMatch","leaveLoopDone","leave","runHook","newLocationVSOldMatch","someOfTheLastOnesMatch","notFoundRoute","notFoundMatch","i","nextMatch","end","value","isItUsingHash","history","historyAPIMethod","stateObj","title","setTimeout","tmp","href","fallback","s","pop","regExpResultToParams","names","reduce","index","decodeURIComponent","join","query","pairs","pair","GETParams","paramNames","pattern","full","dots","regexp","groups","pushState","obj","source","str","temp","v","h"],"mappings":";;;;;;;;;;;;;;AAKe,SAASA,CAAT,CACbC,KADa,EAEbC,CAFa,EAGbC,IAHa,EAIb;AACA,MAAMC,OAAO,GAAGF,CAAC,IAAI,EAArB;AACA,MAAIG,GAAG,GAAG,CAAV;;AAEA,GAAC,SAASC,IAAT,GAAgB;AACf,QAAI,CAACL,KAAK,CAACI,GAAD,CAAV,EAAiB;AACf,UAAIF,IAAJ,EAAU;AACRA,YAAI,CAACC,OAAD,CAAJ;AACD;;AACD;AACD;;AACD,QAAIG,KAAK,CAACC,OAAN,CAAcP,KAAK,CAACI,GAAD,CAAnB,CAAJ,EAA+B;AAC7BJ,WAAK,CAACQ,MAAN,OAAAR,KAAK,GACHI,GADG,EAEH,CAFG,SAGCJ,KAAK,CAACI,GAAD,CAAL,CAAW,CAAX,EAAcD,OAAd,IAAyBH,KAAK,CAACI,GAAD,CAAL,CAAW,CAAX,CAAzB,GAAyCJ,KAAK,CAACI,GAAD,CAAL,CAAW,CAAX,CAH1C,EAAL;AAKAC,UAAI;AACL,KAPD,MAOO;AACL;AACA;AACCL,WAAK,CAACI,GAAD,CAAN,CAAyBD,OAAzB,EAAkC,UAACM,WAAD,EAAiB;AACjD,YAAI,OAAOA,WAAP,KAAuB,WAAvB,IAAsCA,WAAW,KAAK,IAA1D,EAAgE;AAC9DL,aAAG,IAAI,CAAP;AACAC,cAAI;AACL,SAHD,MAGO,IAAIH,IAAJ,EAAU;AACfA,cAAI,CAACC,OAAD,CAAJ;AACD;AACF,OAPD;AAQD;AACF,GA1BD;AA2BD;;AAEDJ,CAAC,CAACW,EAAF,GAAO,UAAUC,SAAV,EAA+BC,GAA/B,EAAoCC,GAApC,EAAyC;AAC9C,MAAI,CAACP,KAAK,CAACC,OAAN,CAAcK,GAAd,CAAL,EAAyBA,GAAG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;AACD,SAAOjD,OAAP;AACD;AACM,SAASe,eAAT,GAA2B;AAChC,SAAO,OAAO0D,MAAP,KAAkB,WAAzB;AACD;AACM,SAAS1C,eAAT,CACLJ,KADK,EAELkF,MAFK,EAGc;AAAA,MAFnBlF,KAEmB;AAFnBA,SAEmB,GAFX,EAEW;AAAA;;AAAA,MADnBkF,MACmB;AADnBA,UACmB,GADS,EACT;AAAA;;AACnBlF,OAAK,CACFwC,MADH,CACU,UAACgJ,CAAD;AAAA,WAAOA,CAAP;AAAA,GADV,EAEG/K,OAFH,CAEW,UAAC+K,CAAD,EAAO;AACd,KAAC,QAAD,EAAW,OAAX,EAAoB,SAApB,EAA+B,OAA/B,EAAwC/K,OAAxC,CAAgD,UAAC4F,IAAD,EAAU;AACxD,UAAImF,CAAC,CAACnF,IAAD,CAAL,EAAa;AACX,YAAI,CAACnB,MAAM,CAACmB,IAAD,CAAX,EAAmBnB,MAAM,CAACmB,IAAD,CAAN,GAAe,EAAf;AACnBnB,cAAM,CAACmB,IAAD,CAAN,CAAaxF,IAAb,CAAkB2K,CAAC,CAACnF,IAAD,CAAnB;AACD;AACF,KALD;AAMD,GATH;AAUA,SAAOnB,MAAP;AACD,C;;;;;;UC1LD;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCrBA;WACA;WACA;WACA;WACA,wCAAwC,yCAAyC;WACjF;WACA;WACA,E;;;;;WCPA,sF;;;;;WCAA;WACA;WACA;WACA,sDAAsD,kBAAkB;WACxE;WACA,+CAA+C,cAAc;WAC7D,E;;;;UCNA;UACA;UACA;UACA","file":"navigo.amd.js","sourcesContent":["type QChild = {\n type: \"child\";\n funcs: Array | QChild>;\n};\n\nexport default function Q(\n funcs: Array | QChild>,\n c?: any,\n done?: Function\n) {\n const context = c || {};\n let idx = 0;\n\n (function next() {\n if (!funcs[idx]) {\n if (done) {\n done(context);\n }\n return;\n }\n if (Array.isArray(funcs[idx])) {\n funcs.splice(\n idx,\n 1,\n ...(funcs[idx][0](context) ? funcs[idx][1] : funcs[idx][2])\n );\n next();\n } else {\n // console.log(funcs[idx].name + \" / \" + JSON.stringify(context));\n // console.log(funcs[idx].name);\n (funcs[idx] as Function)(context, (moveForward) => {\n if (typeof moveForward === \"undefined\" || moveForward === true) {\n idx += 1;\n next();\n } else if (done) {\n done(context);\n }\n });\n }\n })();\n}\n\nQ.if = function (condition: Function, one, two) {\n if (!Array.isArray(one)) one = [one];\n if (!Array.isArray(two)) two = [two];\n return [condition, one, two];\n};\n","export const PARAMETER_REGEXP = /([:*])(\\w+)/g;\nexport const REPLACE_VARIABLE_REGEXP = \"([^/]+)\";\nexport const WILDCARD_REGEXP = /\\*/g;\nexport const REPLACE_WILDCARD = \"?(?:.*)\";\nexport const NOT_SURE_REGEXP = /\\/\\?/g;\nexport const REPLACE_NOT_SURE = \"/?([^/]+|)\";\nexport const START_BY_SLASH_REGEXP = \"(?:/^|^)\";\nexport const MATCH_REGEXP_FLAGS = \"\";\n","import {\n Match,\n Route,\n RouteHooks,\n QContext,\n NavigateOptions,\n ResolveOptions,\n GenerateOptions,\n Handler,\n RouterOptions,\n} from \"../index\";\nimport NavigoRouter from \"../index\";\nimport {\n pushStateAvailable,\n matchRoute,\n parseQuery,\n extractGETParameters,\n isFunction,\n isString,\n clean,\n parseNavigateOptions,\n windowAvailable,\n getCurrentEnvURL,\n accumulateHooks,\n extractHashFromURL,\n} from \"./utils\";\nimport Q from \"./Q\";\nimport setLocationPath from \"./middlewares/setLocationPath\";\nimport matchPathToRegisteredRoutes from \"./middlewares/matchPathToRegisteredRoutes\";\nimport checkForDeprecationMethods from \"./middlewares/checkForDeprecationMethods\";\nimport checkForForceOp from \"./middlewares/checkForForceOp\";\nimport updateBrowserURL from \"./middlewares/updateBrowserURL\";\nimport processMatches from \"./middlewares/processMatches\";\nimport waitingList from \"./middlewares/waitingList\";\n\nimport { notFoundLifeCycle } from \"./lifecycles\";\n\nconst DEFAULT_LINK_SELECTOR = \"[data-navigo]\";\n\nexport default function Navigo(appRoute?: string, options?: RouterOptions) {\n let DEFAULT_RESOLVE_OPTIONS: RouterOptions = options || {\n strategy: \"ONE\",\n hash: false,\n noMatchWarning: false,\n linksSelector: DEFAULT_LINK_SELECTOR,\n };\n let self: NavigoRouter = this;\n let root = \"/\";\n let current: Match[] = null;\n let routes: Route[] = [];\n let destroyed = false;\n let genericHooks: RouteHooks;\n\n const isPushStateAvailable = pushStateAvailable();\n const isWindowAvailable = windowAvailable();\n\n if (!appRoute) {\n console.warn(\n 'Navigo requires a root path in its constructor. If not provided will use \"/\" as default.'\n );\n } else {\n root = clean(appRoute);\n }\n\n function _checkForAHash(url: string): string {\n if (url.indexOf(\"#\") >= 0) {\n if (DEFAULT_RESOLVE_OPTIONS.hash === true) {\n url = url.split(\"#\")[1] || \"/\";\n } else {\n url = url.split(\"#\")[0];\n }\n }\n return url;\n }\n function composePathWithRoot(path: string) {\n return clean(`${root}/${clean(path)}`);\n }\n function createRoute(\n path: string | RegExp,\n handler: Handler,\n hooks: RouteHooks[],\n name?: string\n ): Route {\n path = isString(path) ? composePathWithRoot(path as string) : path;\n return {\n name: name || clean(String(path)),\n path,\n handler,\n hooks: accumulateHooks(hooks),\n };\n }\n\n // public APIs\n function on(\n path: string | Function | Object | RegExp,\n handler?: Handler,\n hooks?: RouteHooks\n ) {\n if (typeof path === \"object\" && !(path instanceof RegExp)) {\n Object.keys(path).forEach((p) => {\n if (typeof path[p] === \"function\") {\n this.on(p, path[p]);\n } else {\n const { uses: handler, as: name, hooks } = path[p];\n routes.push(createRoute(p, handler, [genericHooks, hooks], name));\n }\n });\n return this;\n } else if (typeof path === \"function\") {\n hooks = handler as RouteHooks;\n handler = path as Handler;\n path = root;\n }\n routes.push(\n createRoute(path as string | RegExp, handler, [genericHooks, hooks])\n );\n return this;\n }\n function resolve(to?: string, options?: ResolveOptions): false | Match[] {\n if (self.__dirty) {\n self.__waiting.push(() => self.resolve(to, options));\n return;\n } else {\n self.__dirty = true;\n }\n to = to ? `${clean(root)}/${clean(to)}` : undefined;\n // console.log(\"-- resolve --> \" + to, self.__dirty);\n const context: QContext = {\n instance: self,\n to,\n currentLocationPath: to,\n navigateOptions: {},\n resolveOptions: { ...DEFAULT_RESOLVE_OPTIONS, ...options },\n };\n Q(\n [\n setLocationPath,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n ],\n context,\n waitingList\n );\n\n return context.matches ? context.matches : false;\n }\n function navigate(to: string, navigateOptions?: NavigateOptions): void {\n // console.log(\"-- navigate --> \" + to, self.__dirty);\n if (self.__dirty) {\n self.__waiting.push(() => self.navigate(to, navigateOptions));\n return;\n } else {\n self.__dirty = true;\n }\n to = `${clean(root)}/${clean(to)}`;\n const context: QContext = {\n instance: self,\n to,\n navigateOptions: navigateOptions || {},\n resolveOptions:\n navigateOptions && navigateOptions.resolveOptions\n ? navigateOptions.resolveOptions\n : DEFAULT_RESOLVE_OPTIONS,\n currentLocationPath: _checkForAHash(to),\n };\n Q(\n [\n checkForDeprecationMethods,\n checkForForceOp,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n updateBrowserURL,\n waitingList,\n ],\n context,\n waitingList\n );\n }\n function navigateByName(\n name: string,\n data?: Object,\n options?: NavigateOptions\n ): boolean {\n const url = generate(name, data);\n if (url !== null) {\n navigate(url.replace(new RegExp(`^\\/?${root}`), \"\"), options);\n return true;\n }\n return false;\n }\n function off(what: string | RegExp | Function) {\n this.routes = routes = routes.filter((r) => {\n if (isString(what)) {\n return clean(r.path as string) !== clean(what as string);\n } else if (isFunction(what)) {\n return what !== r.handler;\n }\n return String(r.path) !== String(what);\n });\n return this;\n }\n function listen() {\n if (isPushStateAvailable) {\n this.__popstateListener = () => {\n if (!self.__freezeListening) {\n resolve();\n }\n };\n window.addEventListener(\"popstate\", this.__popstateListener);\n }\n }\n function destroy() {\n this.routes = routes = [];\n if (isPushStateAvailable) {\n window.removeEventListener(\"popstate\", this.__popstateListener);\n }\n this.destroyed = destroyed = true;\n }\n function notFound(handler, hooks?: RouteHooks) {\n self._notFoundRoute = createRoute(\n \"*\",\n handler,\n [genericHooks, hooks],\n \"__NOT_FOUND__\"\n );\n return this;\n }\n function updatePageLinks() {\n if (!isWindowAvailable) return;\n findLinks().forEach((link) => {\n if (\n \"false\" === link.getAttribute(\"data-navigo\") ||\n \"_blank\" === link.getAttribute(\"target\")\n ) {\n if (link.hasListenerAttached) {\n link.removeEventListener(\"click\", link.navigoHandler);\n }\n return;\n }\n if (!link.hasListenerAttached) {\n link.hasListenerAttached = true;\n link.navigoHandler = function (e) {\n if (\n (e.ctrlKey || e.metaKey) &&\n e.target.tagName.toLowerCase() === \"a\"\n ) {\n return false;\n }\n let location = link.getAttribute(\"href\");\n if (typeof location === \"undefined\" || location === null) {\n return false;\n }\n // handling absolute paths\n if (location.match(/^(http|https)/) && typeof URL !== \"undefined\") {\n try {\n const u = new URL(location);\n location = u.pathname + u.search;\n } catch (err) {}\n }\n const options = parseNavigateOptions(\n link.getAttribute(\"data-navigo-options\")\n );\n\n if (!destroyed) {\n e.preventDefault();\n e.stopPropagation();\n self.navigate(clean(location), options);\n }\n };\n link.addEventListener(\"click\", link.navigoHandler);\n }\n });\n return self;\n }\n function findLinks() {\n if (isWindowAvailable) {\n return [].slice.call(\n document.querySelectorAll(\n DEFAULT_RESOLVE_OPTIONS.linksSelector || DEFAULT_LINK_SELECTOR\n )\n );\n }\n return [];\n }\n function link(path: string) {\n return `/${root}/${clean(path)}`;\n }\n function setGenericHooks(hooks: RouteHooks) {\n genericHooks = hooks;\n return this;\n }\n function lastResolved(): Match[] | null {\n return current;\n }\n function generate(\n name: string,\n data?: Object,\n options?: GenerateOptions\n ): string {\n const route = routes.find((r) => r.name === name);\n let result = null;\n if (route) {\n result = route.path as string;\n if (data) {\n for (let key in data) {\n result = result.replace(\":\" + key, data[key]);\n }\n }\n result = !result.match(/^\\//) ? `/${result}` : result;\n }\n if (result && options && !options.includeRoot) {\n result = result.replace(new RegExp(`^/${root}`), \"\");\n }\n return result;\n }\n function getLinkPath(link) {\n return link.getAttribute(\"href\");\n }\n function pathToMatchObject(path: string): Match {\n const [url, queryString] = extractGETParameters(clean(path));\n const params = queryString === \"\" ? null : parseQuery(queryString);\n const hashString = extractHashFromURL(path);\n const route = createRoute(url, () => {}, [genericHooks], url);\n return {\n url,\n queryString,\n hashString,\n route,\n data: null,\n params: params,\n };\n }\n function getCurrentLocation(): Match {\n return pathToMatchObject(\n clean(getCurrentEnvURL(root)).replace(new RegExp(`^${root}`), \"\")\n );\n }\n function directMatchWithRegisteredRoutes(path: string): false | Match[] {\n const context: QContext = {\n instance: self,\n currentLocationPath: path,\n to: path,\n navigateOptions: {},\n resolveOptions: DEFAULT_RESOLVE_OPTIONS,\n };\n matchPathToRegisteredRoutes(context, () => {});\n return context.matches ? context.matches : false;\n }\n function directMatchWithLocation(\n path: string | RegExp,\n currentLocation?: string,\n annotatePathWithRoot?: boolean\n ): false | Match {\n if (\n typeof currentLocation !== \"undefined\" &&\n (typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot)\n ) {\n currentLocation = composePathWithRoot(currentLocation);\n }\n const context: QContext = {\n instance: self,\n to: currentLocation,\n currentLocationPath: currentLocation,\n };\n setLocationPath(context, () => {});\n if (typeof path === \"string\") {\n path =\n typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot\n ? composePathWithRoot(path)\n : path;\n }\n const match = matchRoute(context, {\n name: String(path),\n path,\n handler: () => {},\n hooks: {},\n });\n return match ? match : false;\n }\n function addHook(\n type: string,\n route: Route | string,\n func: Function\n ): Function {\n if (typeof route === \"string\") {\n route = getRoute(route);\n }\n if (route) {\n if (!route.hooks[type]) route.hooks[type] = [];\n route.hooks[type].push(func);\n return () => {\n (route as Route).hooks[type] = (route as Route).hooks[type].filter(\n (f) => f !== func\n );\n };\n } else {\n console.warn(`Route doesn't exists: ${route}`);\n }\n return () => {};\n }\n function getRoute(nameOrHandler: string | Function): Route | undefined {\n if (typeof nameOrHandler === \"string\") {\n return routes.find((r) => r.name === composePathWithRoot(nameOrHandler));\n }\n return routes.find((r) => r.handler === nameOrHandler);\n }\n function __markAsClean(context: QContext) {\n context.instance.__dirty = false;\n if (context.instance.__waiting.length > 0) {\n context.instance.__waiting.shift()();\n }\n }\n\n this.root = root;\n this.routes = routes;\n this.destroyed = destroyed;\n this.current = current;\n this.__freezeListening = false;\n this.__waiting = [];\n this.__dirty = false;\n this.__markAsClean = __markAsClean;\n\n this.on = on;\n this.off = off;\n this.resolve = resolve;\n this.navigate = navigate;\n this.navigateByName = navigateByName;\n this.destroy = destroy;\n this.notFound = notFound;\n this.updatePageLinks = updatePageLinks;\n this.link = link;\n this.hooks = setGenericHooks;\n this.extractGETParameters = (url) =>\n extractGETParameters(_checkForAHash(url));\n this.lastResolved = lastResolved;\n this.generate = generate;\n this.getLinkPath = getLinkPath;\n this.match = directMatchWithRegisteredRoutes;\n this.matchLocation = directMatchWithLocation;\n this.getCurrentLocation = getCurrentLocation;\n this.addBeforeHook = addHook.bind(this, \"before\");\n this.addAfterHook = addHook.bind(this, \"after\");\n this.addAlreadyHook = addHook.bind(this, \"already\");\n this.addLeaveHook = addHook.bind(this, \"leave\");\n this.getRoute = getRoute;\n this._pathToMatchObject = pathToMatchObject;\n this._clean = clean;\n this._checkForAHash = _checkForAHash;\n this._setCurrent = (c) => (current = self.current = c);\n\n listen.call(this);\n updatePageLinks.call(this);\n}\n","import { QContext } from \"../index\";\nimport Q from \"./Q\";\nimport checkForLeaveHook from \"./middlewares/checkForLeaveHook\";\nimport checkForBeforeHook from \"./middlewares/checkForBeforeHook\";\nimport callHandler from \"./middlewares/callHandler\";\nimport checkForAfterHook from \"./middlewares/checkForAfterHook\";\nimport checkForAlreadyHook from \"./middlewares/checkForAlreadyHook\";\nimport checkForNotFoundHandler from \"./middlewares/checkForNotFoundHandler\";\nimport errorOut from \"./middlewares/errorOut\";\nimport flushCurrent from \"./middlewares/flushCurrent\";\nimport updateState from \"./middlewares/updateState\";\n\nexport const foundLifecycle = [\n checkForAlreadyHook,\n checkForBeforeHook,\n callHandler,\n checkForAfterHook,\n];\n\nexport const notFoundLifeCycle = [\n checkForLeaveHook,\n checkForNotFoundHandler,\n Q.if(\n ({ notFoundHandled }: QContext) => notFoundHandled,\n foundLifecycle.concat([updateState]),\n [errorOut, flushCurrent]\n ),\n];\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function callHandler(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"callHandler\")) {\n context.match.route.handler(context.match);\n }\n context.instance.updatePageLinks();\n done();\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAfterHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.after &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n context.match.route.hooks.after.forEach((f) => f(context.match));\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAlreadyHook(context: QContext, done) {\n const current = context.instance.lastResolved();\n if (\n current &&\n current[0] &&\n current[0].route === context.match.route &&\n current[0].url === context.match.url &&\n current[0].queryString === context.match.queryString\n ) {\n current.forEach((c) => {\n if (c.route.hooks && c.route.hooks.already) {\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\")) {\n c.route.hooks.already.forEach((f) => f(context.match));\n }\n }\n });\n done(false);\n return;\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForBeforeHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.before &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n Q(\n context.match.route.hooks.before\n .map((f) => {\n // just so we match the Q interface\n return function beforeHookInternal(_, d) {\n return f((shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n }, context.match);\n };\n })\n .concat([() => done()])\n );\n } else {\n done();\n }\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForDeprecationMethods(context: QContext, done) {\n if (context.navigateOptions) {\n if (typeof context.navigateOptions[\"shouldResolve\"] !== \"undefined\") {\n console.warn(\n `\"shouldResolve\" is deprecated. Please check the documentation.`\n );\n }\n if (typeof context.navigateOptions[\"silent\"] !== \"undefined\") {\n console.warn(`\"silent\" is deprecated. Please check the documentation.`);\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForForceOp(context: QContext, done) {\n if (context.navigateOptions.force === true) {\n context.instance._setCurrent([\n context.instance._pathToMatchObject(context.to),\n ]);\n done(false);\n } else {\n done();\n }\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForLeaveHook(context: QContext, done) {\n const instance = context.instance;\n if (!instance.lastResolved()) {\n done();\n return;\n }\n Q(\n instance.lastResolved().map((oldMatch) => {\n return (_, leaveLoopDone) => {\n // no leave hook\n if (!oldMatch.route.hooks || !oldMatch.route.hooks.leave) {\n leaveLoopDone();\n return;\n }\n let runHook = false;\n const newLocationVSOldMatch = context.instance.matchLocation(\n oldMatch.route.path,\n context.currentLocationPath,\n false\n );\n if (oldMatch.route.path !== \"*\") {\n runHook = !newLocationVSOldMatch;\n } else {\n const someOfTheLastOnesMatch = context.matches\n ? context.matches.find((match) => {\n return oldMatch.route.path === match.route.path;\n })\n : false;\n runHook = !someOfTheLastOnesMatch;\n }\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\") && runHook) {\n Q(\n oldMatch.route.hooks.leave\n .map((f) => {\n // just so we match the Q interface\n return (_, d) =>\n f(\n (shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n },\n context.matches && context.matches.length > 0\n ? context.matches.length === 1\n ? context.matches[0]\n : context.matches\n : undefined\n );\n })\n .concat([() => leaveLoopDone()])\n );\n return;\n } else {\n leaveLoopDone();\n }\n };\n }),\n {},\n () => done()\n );\n}\n","import { QContext, Match } from \"../../index\";\nimport {\n parseQuery,\n extractGETParameters,\n clean,\n extractHashFromURL,\n} from \"../utils\";\n\nexport default function checkForNotFoundHandler(context: QContext, done) {\n const notFoundRoute = context.instance._notFoundRoute;\n if (notFoundRoute) {\n context.notFoundHandled = true;\n const [url, queryString] = extractGETParameters(\n context.currentLocationPath\n );\n const hashString = extractHashFromURL(context.to);\n notFoundRoute.path = clean(url);\n const notFoundMatch: Match = {\n url: notFoundRoute.path,\n queryString,\n hashString,\n data: null,\n route: notFoundRoute,\n params: queryString !== \"\" ? parseQuery(queryString) : null,\n };\n context.matches = [notFoundMatch];\n context.match = notFoundMatch;\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function errorOut(context: QContext, done) {\n if (\n !context.resolveOptions ||\n context.resolveOptions.noMatchWarning === false ||\n typeof context.resolveOptions.noMatchWarning === \"undefined\"\n )\n console.warn(\n `Navigo: \"${context.currentLocationPath}\" didn't match any of the registered routes.`\n );\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function flushCurrent(context: QContext, done) {\n context.instance._setCurrent(null);\n done();\n}\n","import { matchRoute } from \"../utils\";\nimport { QContext, Match } from \"../../index\";\n\nexport default function matchPathToRegisteredRoutes(context: QContext, done) {\n for (let i = 0; i < context.instance.routes.length; i++) {\n const route = context.instance.routes[i];\n const match: false | Match = matchRoute(context, route);\n if (match) {\n if (!context.matches) context.matches = [];\n context.matches.push(match);\n if (context.resolveOptions.strategy === \"ONE\") {\n done();\n return;\n }\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { foundLifecycle } from \"../lifecycles\";\nimport updateState from \"./updateState\";\nimport checkForLeaveHook from \"./checkForLeaveHook\";\n\nexport default function processMatches(context: QContext, done) {\n let idx = 0;\n function nextMatch() {\n if (idx === context.matches.length) {\n updateState(context, done);\n return;\n }\n Q(\n foundLifecycle,\n { ...context, match: context.matches[idx] },\n function end() {\n idx += 1;\n nextMatch();\n }\n );\n }\n checkForLeaveHook(context, nextMatch);\n}\n","import { QContext } from \"../../index\";\nimport { getCurrentEnvURL } from \"../utils\";\n\nexport default function setLocationPath(context: QContext, done) {\n if (typeof context.currentLocationPath === \"undefined\") {\n context.currentLocationPath = context.to = getCurrentEnvURL(\n context.instance.root\n );\n }\n context.currentLocationPath = context.instance._checkForAHash(\n context.currentLocationPath\n );\n done();\n}\n","import { undefinedOrTrue, pushStateAvailable, windowAvailable } from \"../utils\";\nimport { QContext } from \"../../index\";\n\nconst isWindowAvailable = windowAvailable();\nconst isPushStateAvailable = pushStateAvailable();\n\nexport default function updateBrowserURL(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateBrowserURL\")) {\n const value = `/${context.to}`.replace(/\\/\\//g, \"/\"); // making sure that we don't have two slashes\n const isItUsingHash =\n isWindowAvailable &&\n context.resolveOptions &&\n context.resolveOptions.hash === true;\n if (isPushStateAvailable) {\n history[context.navigateOptions.historyAPIMethod || \"pushState\"](\n context.navigateOptions.stateObj || {},\n context.navigateOptions.title || \"\",\n isItUsingHash ? `#${value}` : value\n );\n // This is to solve a nasty bug where the page doesn't scroll to the anchor.\n // We set a microtask to update the hash only.\n if (location && location.hash) {\n context.instance.__freezeListening = true;\n setTimeout(() => {\n let tmp = location.hash;\n location.hash = \"\";\n location.hash = tmp;\n context.instance.__freezeListening = false;\n }, 1);\n }\n } else if (isWindowAvailable) {\n window.location.href = context.to;\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function updateState(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateState\")) {\n context.instance._setCurrent(context.matches);\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function waitingList(context: QContext) {\n context.instance.__markAsClean(context);\n}\n","import {\n RouteHooksStorage,\n Match,\n Route,\n NavigateOptions,\n ResolveOptions,\n QContext,\n ResolveStrategy,\n} from \"../index\";\n\nimport {\n PARAMETER_REGEXP,\n WILDCARD_REGEXP,\n REPLACE_VARIABLE_REGEXP,\n REPLACE_WILDCARD,\n START_BY_SLASH_REGEXP,\n MATCH_REGEXP_FLAGS,\n REPLACE_NOT_SURE,\n NOT_SURE_REGEXP,\n} from \"./constants\";\n\nexport function getCurrentEnvURL(fallback = \"/\"): string {\n if (windowAvailable()) {\n return location.pathname + location.search + location.hash;\n }\n return fallback;\n}\nexport function clean(s: string) {\n return s.replace(/\\/+$/, \"\").replace(/^\\/+/, \"\");\n}\nexport function isString(s: any): boolean {\n return typeof s === \"string\";\n}\nexport function isFunction(s: any): boolean {\n return typeof s === \"function\";\n}\nexport function extractHashFromURL(url: string) {\n if (url && url.indexOf(\"#\") >= 0) {\n return url.split(\"#\").pop() || \"\";\n }\n return \"\";\n}\nexport function regExpResultToParams(match, names: string[]) {\n if (names.length === 0) return null;\n if (!match) return null;\n return match.slice(1, match.length).reduce((params, value, index) => {\n if (params === null) params = {};\n params[names[index]] = decodeURIComponent(value);\n return params;\n }, null);\n}\nexport function extractGETParameters(url: string) {\n const tmp = clean(url).split(/\\?(.*)?$/);\n return [clean(tmp[0]), tmp.slice(1).join(\"\")];\n}\nexport function parseQuery(queryString: string): Object {\n var query = {};\n var pairs = queryString.split(\"&\");\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i].split(\"=\");\n if (pair[0] !== \"\") {\n let key = decodeURIComponent(pair[0]);\n if (!query[key]) {\n query[key] = decodeURIComponent(pair[1] || \"\");\n } else {\n if (!Array.isArray(query[key])) query[key] = [query[key]];\n query[key].push(decodeURIComponent(pair[1] || \"\"));\n }\n }\n }\n return query;\n}\nexport function matchRoute(context: QContext, route: Route): false | Match {\n const [current, GETParams] = extractGETParameters(\n clean(context.currentLocationPath)\n );\n const params = GETParams === \"\" ? null : parseQuery(GETParams);\n const paramNames = [];\n let pattern;\n if (isString(route.path)) {\n pattern =\n START_BY_SLASH_REGEXP +\n clean(route.path as string)\n .replace(PARAMETER_REGEXP, function (full, dots, name) {\n paramNames.push(name);\n return REPLACE_VARIABLE_REGEXP;\n })\n .replace(WILDCARD_REGEXP, REPLACE_WILDCARD)\n .replace(NOT_SURE_REGEXP, REPLACE_NOT_SURE) +\n \"$\";\n if (clean(route.path as string) === \"\") {\n if (clean(current) === \"\") {\n return {\n url: current,\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data: null,\n params,\n };\n }\n }\n } else {\n pattern = route.path;\n }\n const regexp = new RegExp(pattern, MATCH_REGEXP_FLAGS);\n const match = current.match(regexp);\n\n if (match) {\n const data = isString(route.path)\n ? regExpResultToParams(match, paramNames)\n : match.groups\n ? match.groups\n : match.slice(1);\n return {\n url: clean(current.replace(new RegExp(`^${context.instance.root}`), \"\")),\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data,\n params,\n };\n }\n return false;\n}\nexport function pushStateAvailable(): boolean {\n return !!(\n typeof window !== \"undefined\" &&\n window.history &&\n window.history.pushState\n );\n}\nexport function undefinedOrTrue(obj, key: string): boolean {\n return typeof obj[key] === \"undefined\" || obj[key] === true;\n}\nexport function parseNavigateOptions(source?: string): NavigateOptions {\n if (!source) return {};\n const pairs = source.split(\",\");\n const options: NavigateOptions = {};\n let resolveOptions: ResolveOptions;\n\n pairs.forEach((str) => {\n const temp = str.split(\":\").map((v) => v.replace(/(^ +| +$)/g, \"\"));\n switch (temp[0]) {\n case \"historyAPIMethod\":\n options.historyAPIMethod = temp[1];\n break;\n case \"resolveOptionsStrategy\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.strategy = temp[1] as ResolveStrategy;\n break;\n case \"resolveOptionsHash\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.hash = temp[1] === \"true\";\n break;\n case \"updateBrowserURL\":\n case \"callHandler\":\n case \"updateState\":\n case \"force\":\n options[temp[0]] = temp[1] === \"true\";\n break;\n }\n });\n if (resolveOptions) {\n options.resolveOptions = resolveOptions;\n }\n return options;\n}\nexport function windowAvailable() {\n return typeof window !== \"undefined\";\n}\nexport function accumulateHooks(\n hooks = [],\n result: RouteHooksStorage = {}\n): RouteHooksStorage {\n hooks\n .filter((h) => h)\n .forEach((h) => {\n [\"before\", \"after\", \"already\", \"leave\"].forEach((type) => {\n if (h[type]) {\n if (!result[type]) result[type] = [];\n result[type].push(h[type]);\n }\n });\n });\n return result as RouteHooksStorage;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// module exports must be returned from runtime so entry inlining is disabled\n// startup\n// Load entry module and return exports\nreturn __webpack_require__(\"./src/index.ts\");\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://Navigo.amd/./src/Q.ts","webpack://Navigo.amd/./src/constants.ts","webpack://Navigo.amd/./src/index.ts","webpack://Navigo.amd/./src/lifecycles.ts","webpack://Navigo.amd/./src/middlewares/callHandler.ts","webpack://Navigo.amd/./src/middlewares/checkForAfterHook.ts","webpack://Navigo.amd/./src/middlewares/checkForAlreadyHook.ts","webpack://Navigo.amd/./src/middlewares/checkForBeforeHook.ts","webpack://Navigo.amd/./src/middlewares/checkForDeprecationMethods.ts","webpack://Navigo.amd/./src/middlewares/checkForForceOp.ts","webpack://Navigo.amd/./src/middlewares/checkForLeaveHook.ts","webpack://Navigo.amd/./src/middlewares/checkForNotFoundHandler.ts","webpack://Navigo.amd/./src/middlewares/errorOut.ts","webpack://Navigo.amd/./src/middlewares/flushCurrent.ts","webpack://Navigo.amd/./src/middlewares/matchPathToRegisteredRoutes.ts","webpack://Navigo.amd/./src/middlewares/processMatches.ts","webpack://Navigo.amd/./src/middlewares/setLocationPath.ts","webpack://Navigo.amd/./src/middlewares/updateBrowserURL.ts","webpack://Navigo.amd/./src/middlewares/updateState.ts","webpack://Navigo.amd/./src/middlewares/waitingList.ts","webpack://Navigo.amd/./src/utils.ts","webpack://Navigo.amd/webpack/bootstrap","webpack://Navigo.amd/webpack/runtime/define property getters","webpack://Navigo.amd/webpack/runtime/hasOwnProperty shorthand","webpack://Navigo.amd/webpack/runtime/make namespace object","webpack://Navigo.amd/webpack/startup"],"names":["Q","funcs","c","done","context","idx","next","Array","isArray","splice","moveForward","if","condition","one","two","PARAMETER_REGEXP","REPLACE_VARIABLE_REGEXP","WILDCARD_REGEXP","REPLACE_WILDCARD","NOT_SURE_REGEXP","REPLACE_NOT_SURE","START_BY_SLASH_REGEXP","MATCH_REGEXP_FLAGS","DEFAULT_LINK_SELECTOR","Navigo","appRoute","options","DEFAULT_RESOLVE_OPTIONS","strategy","hash","noMatchWarning","linksSelector","self","root","current","routes","destroyed","genericHooks","isPushStateAvailable","pushStateAvailable","isWindowAvailable","windowAvailable","console","warn","clean","_checkForAHash","url","indexOf","split","composePathWithRoot","path","createRoute","handler","hooks","name","isString","String","accumulateHooks","on","RegExp","Object","keys","forEach","p","uses","as","push","resolve","to","__dirty","__waiting","undefined","instance","currentLocationPath","navigateOptions","resolveOptions","setLocationPath","matchPathToRegisteredRoutes","matches","length","processMatches","notFoundLifeCycle","waitingList","navigate","checkForDeprecationMethods","checkForForceOp","updateBrowserURL","navigateByName","data","generate","replace","off","what","filter","r","isFunction","listen","__popstateListener","__freezeListening","window","addEventListener","destroy","removeEventListener","notFound","_notFoundRoute","updatePageLinks","findLinks","link","getAttribute","hasListenerAttached","navigoHandler","e","ctrlKey","metaKey","target","tagName","toLowerCase","location","match","URL","u","pathname","search","err","parseNavigateOptions","preventDefault","stopPropagation","slice","call","document","querySelectorAll","setGenericHooks","lastResolved","route","find","result","key","includeRoot","getLinkPath","pathToMatchObject","extractGETParameters","queryString","params","parseQuery","hashString","extractHashFromURL","getCurrentLocation","getCurrentEnvURL","directMatchWithRegisteredRoutes","directMatchWithLocation","currentLocation","annotatePathWithRoot","matchRoute","addHook","type","func","getRoute","f","nameOrHandler","__markAsClean","shift","matchLocation","addBeforeHook","bind","addAfterHook","addAlreadyHook","addLeaveHook","_pathToMatchObject","_clean","_setCurrent","foundLifecycle","checkForAlreadyHook","checkForBeforeHook","callHandler","checkForAfterHook","checkForLeaveHook","checkForNotFoundHandler","notFoundHandled","concat","updateState","errorOut","flushCurrent","undefinedOrTrue","after","already","before","map","beforeHookInternal","_","d","shouldStop","force","oldMatch","leaveLoopDone","leave","runHook","newLocationVSOldMatch","someOfTheLastOnesMatch","notFoundRoute","notFoundMatch","i","nextMatch","end","value","isItUsingHash","history","historyAPIMethod","stateObj","title","setTimeout","tmp","href","fallback","s","pop","regExpResultToParams","names","reduce","index","decodeURIComponent","join","query","pairs","pair","GETParams","paramNames","pattern","full","dots","regexp","groups","pushState","obj","source","str","temp","v","h"],"mappings":";;;;;;;;;;;;;;A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AAAA,MAFnBlF,KAEmB;AAFnBA,SAEmB,GAFX,EAEW;AAAA;;AAAA,MADnBkF,MACmB;AADnBA,UACmB,GADS,EACT;AAAA;;AACnBlF,OAAK,CACFwC,MADH,CACU,UAACgJ,CAAD;AAAA,WAAOA,CAAP;AAAA,GADV,EAEG/K,OAFH,CAEW,UAAC+K,CAAD,EAAO;AACd,KAAC,QAAD,EAAW,OAAX,EAAoB,SAApB,EAA+B,OAA/B,EAAwC/K,OAAxC,CAAgD,UAAC4F,IAAD,EAAU;AACxD,UAAImF,CAAC,CAACnF,IAAD,CAAL,EAAa;AACX,YAAI,CAACnB,MAAM,CAACmB,IAAD,CAAX,EAAmBnB,MAAM,CAACmB,IAAD,CAAN,GAAe,EAAf;AACnBnB,cAAM,CAACmB,IAAD,CAAN,CAAaxF,IAAb,CAAkB2K,CAAC,CAACnF,IAAD,CAAnB;AACD;AACF,KALD;AAMD,GATH;AAUA,SAAOnB,MAAP;AACD,C;;;;;;UC1LD;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCrBA;WACA;WACA;WACA;WACA,wCAAwC,yCAAyC;WACjF;WACA;WACA,E;;;;;WCPA,6CAA6C,wDAAwD,E;;;;;WCArG;WACA;WACA;WACA,sDAAsD,kBAAkB;WACxE;WACA,+CAA+C,cAAc;WAC7D,E;;;;UCNA;UACA;UACA;UACA","file":"navigo.amd.js","sourcesContent":["type QChild = {\n type: \"child\";\n funcs: Array | QChild>;\n};\n\nexport default function Q(\n funcs: Array | QChild>,\n c?: any,\n done?: Function\n) {\n const context = c || {};\n let idx = 0;\n\n (function next() {\n if (!funcs[idx]) {\n if (done) {\n done(context);\n }\n return;\n }\n if (Array.isArray(funcs[idx])) {\n funcs.splice(\n idx,\n 1,\n ...(funcs[idx][0](context) ? funcs[idx][1] : funcs[idx][2])\n );\n next();\n } else {\n // console.log(funcs[idx].name + \" / \" + JSON.stringify(context));\n // console.log(funcs[idx].name);\n (funcs[idx] as Function)(context, (moveForward) => {\n if (typeof moveForward === \"undefined\" || moveForward === true) {\n idx += 1;\n next();\n } else if (done) {\n done(context);\n }\n });\n }\n })();\n}\n\nQ.if = function (condition: Function, one, two) {\n if (!Array.isArray(one)) one = [one];\n if (!Array.isArray(two)) two = [two];\n return [condition, one, two];\n};\n","export const PARAMETER_REGEXP = /([:*])(\\w+)/g;\nexport const REPLACE_VARIABLE_REGEXP = \"([^/]+)\";\nexport const WILDCARD_REGEXP = /\\*/g;\nexport const REPLACE_WILDCARD = \"?(?:.*)\";\nexport const NOT_SURE_REGEXP = /\\/\\?/g;\nexport const REPLACE_NOT_SURE = \"/?([^/]+|)\";\nexport const START_BY_SLASH_REGEXP = \"(?:/^|^)\";\nexport const MATCH_REGEXP_FLAGS = \"\";\n","import {\n Match,\n Route,\n RouteHooks,\n QContext,\n NavigateOptions,\n ResolveOptions,\n GenerateOptions,\n Handler,\n RouterOptions,\n} from \"../index\";\nimport NavigoRouter from \"../index\";\nimport {\n pushStateAvailable,\n matchRoute,\n parseQuery,\n extractGETParameters,\n isFunction,\n isString,\n clean,\n parseNavigateOptions,\n windowAvailable,\n getCurrentEnvURL,\n accumulateHooks,\n extractHashFromURL,\n} from \"./utils\";\nimport Q from \"./Q\";\nimport setLocationPath from \"./middlewares/setLocationPath\";\nimport matchPathToRegisteredRoutes from \"./middlewares/matchPathToRegisteredRoutes\";\nimport checkForDeprecationMethods from \"./middlewares/checkForDeprecationMethods\";\nimport checkForForceOp from \"./middlewares/checkForForceOp\";\nimport updateBrowserURL from \"./middlewares/updateBrowserURL\";\nimport processMatches from \"./middlewares/processMatches\";\nimport waitingList from \"./middlewares/waitingList\";\n\nimport { notFoundLifeCycle } from \"./lifecycles\";\n\nconst DEFAULT_LINK_SELECTOR = \"[data-navigo]\";\n\nexport default function Navigo(appRoute?: string, options?: RouterOptions) {\n let DEFAULT_RESOLVE_OPTIONS: RouterOptions = options || {\n strategy: \"ONE\",\n hash: false,\n noMatchWarning: false,\n linksSelector: DEFAULT_LINK_SELECTOR,\n };\n let self: NavigoRouter = this;\n let root = \"/\";\n let current: Match[] = null;\n let routes: Route[] = [];\n let destroyed = false;\n let genericHooks: RouteHooks;\n\n const isPushStateAvailable = pushStateAvailable();\n const isWindowAvailable = windowAvailable();\n\n if (!appRoute) {\n console.warn(\n 'Navigo requires a root path in its constructor. If not provided will use \"/\" as default.'\n );\n } else {\n root = clean(appRoute);\n }\n\n function _checkForAHash(url: string): string {\n if (url.indexOf(\"#\") >= 0) {\n if (DEFAULT_RESOLVE_OPTIONS.hash === true) {\n url = url.split(\"#\")[1] || \"/\";\n } else {\n url = url.split(\"#\")[0];\n }\n }\n return url;\n }\n function composePathWithRoot(path: string) {\n return clean(`${root}/${clean(path)}`);\n }\n function createRoute(\n path: string | RegExp,\n handler: Handler,\n hooks: RouteHooks[],\n name?: string\n ): Route {\n path = isString(path) ? composePathWithRoot(path as string) : path;\n return {\n name: name || clean(String(path)),\n path,\n handler,\n hooks: accumulateHooks(hooks),\n };\n }\n\n // public APIs\n function on(\n path: string | Function | Object | RegExp,\n handler?: Handler,\n hooks?: RouteHooks\n ) {\n if (typeof path === \"object\" && !(path instanceof RegExp)) {\n Object.keys(path).forEach((p) => {\n if (typeof path[p] === \"function\") {\n this.on(p, path[p]);\n } else {\n const { uses: handler, as: name, hooks } = path[p];\n routes.push(createRoute(p, handler, [genericHooks, hooks], name));\n }\n });\n return this;\n } else if (typeof path === \"function\") {\n hooks = handler as RouteHooks;\n handler = path as Handler;\n path = root;\n }\n routes.push(\n createRoute(path as string | RegExp, handler, [genericHooks, hooks])\n );\n return this;\n }\n function resolve(to?: string, options?: ResolveOptions): false | Match[] {\n if (self.__dirty) {\n self.__waiting.push(() => self.resolve(to, options));\n return;\n } else {\n self.__dirty = true;\n }\n to = to ? `${clean(root)}/${clean(to)}` : undefined;\n // console.log(\"-- resolve --> \" + to, self.__dirty);\n const context: QContext = {\n instance: self,\n to,\n currentLocationPath: to,\n navigateOptions: {},\n resolveOptions: { ...DEFAULT_RESOLVE_OPTIONS, ...options },\n };\n Q(\n [\n setLocationPath,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n ],\n context,\n waitingList\n );\n\n return context.matches ? context.matches : false;\n }\n function navigate(to: string, navigateOptions?: NavigateOptions): void {\n // console.log(\"-- navigate --> \" + to, self.__dirty);\n if (self.__dirty) {\n self.__waiting.push(() => self.navigate(to, navigateOptions));\n return;\n } else {\n self.__dirty = true;\n }\n to = `${clean(root)}/${clean(to)}`;\n const context: QContext = {\n instance: self,\n to,\n navigateOptions: navigateOptions || {},\n resolveOptions:\n navigateOptions && navigateOptions.resolveOptions\n ? navigateOptions.resolveOptions\n : DEFAULT_RESOLVE_OPTIONS,\n currentLocationPath: _checkForAHash(to),\n };\n Q(\n [\n checkForDeprecationMethods,\n checkForForceOp,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n updateBrowserURL,\n waitingList,\n ],\n context,\n waitingList\n );\n }\n function navigateByName(\n name: string,\n data?: Object,\n options?: NavigateOptions\n ): boolean {\n const url = generate(name, data);\n if (url !== null) {\n navigate(url.replace(new RegExp(`^\\/?${root}`), \"\"), options);\n return true;\n }\n return false;\n }\n function off(what: string | RegExp | Function) {\n this.routes = routes = routes.filter((r) => {\n if (isString(what)) {\n return clean(r.path as string) !== clean(what as string);\n } else if (isFunction(what)) {\n return what !== r.handler;\n }\n return String(r.path) !== String(what);\n });\n return this;\n }\n function listen() {\n if (isPushStateAvailable) {\n this.__popstateListener = () => {\n if (!self.__freezeListening) {\n resolve();\n }\n };\n window.addEventListener(\"popstate\", this.__popstateListener);\n }\n }\n function destroy() {\n this.routes = routes = [];\n if (isPushStateAvailable) {\n window.removeEventListener(\"popstate\", this.__popstateListener);\n }\n this.destroyed = destroyed = true;\n }\n function notFound(handler, hooks?: RouteHooks) {\n self._notFoundRoute = createRoute(\n \"*\",\n handler,\n [genericHooks, hooks],\n \"__NOT_FOUND__\"\n );\n return this;\n }\n function updatePageLinks() {\n if (!isWindowAvailable) return;\n findLinks().forEach((link) => {\n if (\n \"false\" === link.getAttribute(\"data-navigo\") ||\n \"_blank\" === link.getAttribute(\"target\")\n ) {\n if (link.hasListenerAttached) {\n link.removeEventListener(\"click\", link.navigoHandler);\n }\n return;\n }\n if (!link.hasListenerAttached) {\n link.hasListenerAttached = true;\n link.navigoHandler = function (e) {\n if (\n (e.ctrlKey || e.metaKey) &&\n e.target.tagName.toLowerCase() === \"a\"\n ) {\n return false;\n }\n let location = link.getAttribute(\"href\");\n if (typeof location === \"undefined\" || location === null) {\n return false;\n }\n // handling absolute paths\n if (location.match(/^(http|https)/) && typeof URL !== \"undefined\") {\n try {\n const u = new URL(location);\n location = u.pathname + u.search;\n } catch (err) {}\n }\n const options = parseNavigateOptions(\n link.getAttribute(\"data-navigo-options\")\n );\n\n if (!destroyed) {\n e.preventDefault();\n e.stopPropagation();\n self.navigate(clean(location), options);\n }\n };\n link.addEventListener(\"click\", link.navigoHandler);\n }\n });\n return self;\n }\n function findLinks() {\n if (isWindowAvailable) {\n return [].slice.call(\n document.querySelectorAll(\n DEFAULT_RESOLVE_OPTIONS.linksSelector || DEFAULT_LINK_SELECTOR\n )\n );\n }\n return [];\n }\n function link(path: string) {\n return `/${root}/${clean(path)}`;\n }\n function setGenericHooks(hooks: RouteHooks) {\n genericHooks = hooks;\n return this;\n }\n function lastResolved(): Match[] | null {\n return current;\n }\n function generate(\n name: string,\n data?: Object,\n options?: GenerateOptions\n ): string {\n const route = routes.find((r) => r.name === name);\n let result = null;\n if (route) {\n result = route.path as string;\n if (data) {\n for (let key in data) {\n result = result.replace(\":\" + key, data[key]);\n }\n }\n result = !result.match(/^\\//) ? `/${result}` : result;\n }\n if (result && options && !options.includeRoot) {\n result = result.replace(new RegExp(`^/${root}`), \"\");\n }\n return result;\n }\n function getLinkPath(link) {\n return link.getAttribute(\"href\");\n }\n function pathToMatchObject(path: string): Match {\n const [url, queryString] = extractGETParameters(clean(path));\n const params = queryString === \"\" ? null : parseQuery(queryString);\n const hashString = extractHashFromURL(path);\n const route = createRoute(url, () => {}, [genericHooks], url);\n return {\n url,\n queryString,\n hashString,\n route,\n data: null,\n params: params,\n };\n }\n function getCurrentLocation(): Match {\n return pathToMatchObject(\n clean(getCurrentEnvURL(root)).replace(new RegExp(`^${root}`), \"\")\n );\n }\n function directMatchWithRegisteredRoutes(path: string): false | Match[] {\n const context: QContext = {\n instance: self,\n currentLocationPath: path,\n to: path,\n navigateOptions: {},\n resolveOptions: DEFAULT_RESOLVE_OPTIONS,\n };\n matchPathToRegisteredRoutes(context, () => {});\n return context.matches ? context.matches : false;\n }\n function directMatchWithLocation(\n path: string | RegExp,\n currentLocation?: string,\n annotatePathWithRoot?: boolean\n ): false | Match {\n if (\n typeof currentLocation !== \"undefined\" &&\n (typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot)\n ) {\n currentLocation = composePathWithRoot(currentLocation);\n }\n const context: QContext = {\n instance: self,\n to: currentLocation,\n currentLocationPath: currentLocation,\n };\n setLocationPath(context, () => {});\n if (typeof path === \"string\") {\n path =\n typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot\n ? composePathWithRoot(path)\n : path;\n }\n const match = matchRoute(context, {\n name: String(path),\n path,\n handler: () => {},\n hooks: {},\n });\n return match ? match : false;\n }\n function addHook(\n type: string,\n route: Route | string,\n func: Function\n ): Function {\n if (typeof route === \"string\") {\n route = getRoute(route);\n }\n if (route) {\n if (!route.hooks[type]) route.hooks[type] = [];\n route.hooks[type].push(func);\n return () => {\n (route as Route).hooks[type] = (route as Route).hooks[type].filter(\n (f) => f !== func\n );\n };\n } else {\n console.warn(`Route doesn't exists: ${route}`);\n }\n return () => {};\n }\n function getRoute(nameOrHandler: string | Function): Route | undefined {\n if (typeof nameOrHandler === \"string\") {\n return routes.find((r) => r.name === composePathWithRoot(nameOrHandler));\n }\n return routes.find((r) => r.handler === nameOrHandler);\n }\n function __markAsClean(context: QContext) {\n context.instance.__dirty = false;\n if (context.instance.__waiting.length > 0) {\n context.instance.__waiting.shift()();\n }\n }\n\n this.root = root;\n this.routes = routes;\n this.destroyed = destroyed;\n this.current = current;\n this.__freezeListening = false;\n this.__waiting = [];\n this.__dirty = false;\n this.__markAsClean = __markAsClean;\n\n this.on = on;\n this.off = off;\n this.resolve = resolve;\n this.navigate = navigate;\n this.navigateByName = navigateByName;\n this.destroy = destroy;\n this.notFound = notFound;\n this.updatePageLinks = updatePageLinks;\n this.link = link;\n this.hooks = setGenericHooks;\n this.extractGETParameters = (url) =>\n extractGETParameters(_checkForAHash(url));\n this.lastResolved = lastResolved;\n this.generate = generate;\n this.getLinkPath = getLinkPath;\n this.match = directMatchWithRegisteredRoutes;\n this.matchLocation = directMatchWithLocation;\n this.getCurrentLocation = getCurrentLocation;\n this.addBeforeHook = addHook.bind(this, \"before\");\n this.addAfterHook = addHook.bind(this, \"after\");\n this.addAlreadyHook = addHook.bind(this, \"already\");\n this.addLeaveHook = addHook.bind(this, \"leave\");\n this.getRoute = getRoute;\n this._pathToMatchObject = pathToMatchObject;\n this._clean = clean;\n this._checkForAHash = _checkForAHash;\n this._setCurrent = (c) => (current = self.current = c);\n\n listen.call(this);\n updatePageLinks.call(this);\n}\n","import { QContext } from \"../index\";\nimport Q from \"./Q\";\nimport checkForLeaveHook from \"./middlewares/checkForLeaveHook\";\nimport checkForBeforeHook from \"./middlewares/checkForBeforeHook\";\nimport callHandler from \"./middlewares/callHandler\";\nimport checkForAfterHook from \"./middlewares/checkForAfterHook\";\nimport checkForAlreadyHook from \"./middlewares/checkForAlreadyHook\";\nimport checkForNotFoundHandler from \"./middlewares/checkForNotFoundHandler\";\nimport errorOut from \"./middlewares/errorOut\";\nimport flushCurrent from \"./middlewares/flushCurrent\";\nimport updateState from \"./middlewares/updateState\";\n\nexport const foundLifecycle = [\n checkForAlreadyHook,\n checkForBeforeHook,\n callHandler,\n checkForAfterHook,\n];\n\nexport const notFoundLifeCycle = [\n checkForLeaveHook,\n checkForNotFoundHandler,\n Q.if(\n ({ notFoundHandled }: QContext) => notFoundHandled,\n foundLifecycle.concat([updateState]),\n [errorOut, flushCurrent]\n ),\n];\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function callHandler(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"callHandler\")) {\n context.match.route.handler(context.match);\n }\n context.instance.updatePageLinks();\n done();\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAfterHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.after &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n context.match.route.hooks.after.forEach((f) => f(context.match));\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAlreadyHook(context: QContext, done) {\n const current = context.instance.lastResolved();\n if (\n current &&\n current[0] &&\n current[0].route === context.match.route &&\n current[0].url === context.match.url &&\n current[0].queryString === context.match.queryString\n ) {\n current.forEach((c) => {\n if (c.route.hooks && c.route.hooks.already) {\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\")) {\n c.route.hooks.already.forEach((f) => f(context.match));\n }\n }\n });\n done(false);\n return;\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForBeforeHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.before &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n Q(\n context.match.route.hooks.before\n .map((f) => {\n // just so we match the Q interface\n return function beforeHookInternal(_, d) {\n return f((shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n }, context.match);\n };\n })\n .concat([() => done()])\n );\n } else {\n done();\n }\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForDeprecationMethods(context: QContext, done) {\n if (context.navigateOptions) {\n if (typeof context.navigateOptions[\"shouldResolve\"] !== \"undefined\") {\n console.warn(\n `\"shouldResolve\" is deprecated. Please check the documentation.`\n );\n }\n if (typeof context.navigateOptions[\"silent\"] !== \"undefined\") {\n console.warn(`\"silent\" is deprecated. Please check the documentation.`);\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForForceOp(context: QContext, done) {\n if (context.navigateOptions.force === true) {\n context.instance._setCurrent([\n context.instance._pathToMatchObject(context.to),\n ]);\n done(false);\n } else {\n done();\n }\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForLeaveHook(context: QContext, done) {\n const instance = context.instance;\n if (!instance.lastResolved()) {\n done();\n return;\n }\n Q(\n instance.lastResolved().map((oldMatch) => {\n return (_, leaveLoopDone) => {\n // no leave hook\n if (!oldMatch.route.hooks || !oldMatch.route.hooks.leave) {\n leaveLoopDone();\n return;\n }\n let runHook = false;\n const newLocationVSOldMatch = context.instance.matchLocation(\n oldMatch.route.path,\n context.currentLocationPath,\n false\n );\n if (oldMatch.route.path !== \"*\") {\n runHook = !newLocationVSOldMatch;\n } else {\n const someOfTheLastOnesMatch = context.matches\n ? context.matches.find((match) => {\n return oldMatch.route.path === match.route.path;\n })\n : false;\n runHook = !someOfTheLastOnesMatch;\n }\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\") && runHook) {\n Q(\n oldMatch.route.hooks.leave\n .map((f) => {\n // just so we match the Q interface\n return (_, d) =>\n f(\n (shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n },\n context.matches && context.matches.length > 0\n ? context.matches.length === 1\n ? context.matches[0]\n : context.matches\n : undefined\n );\n })\n .concat([() => leaveLoopDone()])\n );\n return;\n } else {\n leaveLoopDone();\n }\n };\n }),\n {},\n () => done()\n );\n}\n","import { QContext, Match } from \"../../index\";\nimport {\n parseQuery,\n extractGETParameters,\n clean,\n extractHashFromURL,\n} from \"../utils\";\n\nexport default function checkForNotFoundHandler(context: QContext, done) {\n const notFoundRoute = context.instance._notFoundRoute;\n if (notFoundRoute) {\n context.notFoundHandled = true;\n const [url, queryString] = extractGETParameters(\n context.currentLocationPath\n );\n const hashString = extractHashFromURL(context.to);\n notFoundRoute.path = clean(url);\n const notFoundMatch: Match = {\n url: notFoundRoute.path,\n queryString,\n hashString,\n data: null,\n route: notFoundRoute,\n params: queryString !== \"\" ? parseQuery(queryString) : null,\n };\n context.matches = [notFoundMatch];\n context.match = notFoundMatch;\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function errorOut(context: QContext, done) {\n if (\n !context.resolveOptions ||\n context.resolveOptions.noMatchWarning === false ||\n typeof context.resolveOptions.noMatchWarning === \"undefined\"\n )\n console.warn(\n `Navigo: \"${context.currentLocationPath}\" didn't match any of the registered routes.`\n );\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function flushCurrent(context: QContext, done) {\n context.instance._setCurrent(null);\n done();\n}\n","import { matchRoute } from \"../utils\";\nimport { QContext, Match } from \"../../index\";\n\nexport default function matchPathToRegisteredRoutes(context: QContext, done) {\n for (let i = 0; i < context.instance.routes.length; i++) {\n const route = context.instance.routes[i];\n const match: false | Match = matchRoute(context, route);\n if (match) {\n if (!context.matches) context.matches = [];\n context.matches.push(match);\n if (context.resolveOptions.strategy === \"ONE\") {\n done();\n return;\n }\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { foundLifecycle } from \"../lifecycles\";\nimport updateState from \"./updateState\";\nimport checkForLeaveHook from \"./checkForLeaveHook\";\n\nexport default function processMatches(context: QContext, done) {\n let idx = 0;\n function nextMatch() {\n if (idx === context.matches.length) {\n updateState(context, done);\n return;\n }\n Q(\n foundLifecycle,\n { ...context, match: context.matches[idx] },\n function end() {\n idx += 1;\n nextMatch();\n }\n );\n }\n checkForLeaveHook(context, nextMatch);\n}\n","import { QContext } from \"../../index\";\nimport { getCurrentEnvURL } from \"../utils\";\n\nexport default function setLocationPath(context: QContext, done) {\n if (typeof context.currentLocationPath === \"undefined\") {\n context.currentLocationPath = context.to = getCurrentEnvURL(\n context.instance.root\n );\n }\n context.currentLocationPath = context.instance._checkForAHash(\n context.currentLocationPath\n );\n done();\n}\n","import { undefinedOrTrue, pushStateAvailable, windowAvailable } from \"../utils\";\nimport { QContext } from \"../../index\";\n\nconst isWindowAvailable = windowAvailable();\nconst isPushStateAvailable = pushStateAvailable();\n\nexport default function updateBrowserURL(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateBrowserURL\")) {\n const value = `/${context.to}`.replace(/\\/\\//g, \"/\"); // making sure that we don't have two slashes\n const isItUsingHash =\n isWindowAvailable &&\n context.resolveOptions &&\n context.resolveOptions.hash === true;\n if (isPushStateAvailable) {\n history[context.navigateOptions.historyAPIMethod || \"pushState\"](\n context.navigateOptions.stateObj || {},\n context.navigateOptions.title || \"\",\n isItUsingHash ? `#${value}` : value\n );\n // This is to solve a nasty bug where the page doesn't scroll to the anchor.\n // We set a microtask to update the hash only.\n if (location && location.hash) {\n context.instance.__freezeListening = true;\n setTimeout(() => {\n let tmp = location.hash;\n location.hash = \"\";\n location.hash = tmp;\n context.instance.__freezeListening = false;\n }, 1);\n }\n } else if (isWindowAvailable) {\n window.location.href = context.to;\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function updateState(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateState\")) {\n context.instance._setCurrent(context.matches);\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function waitingList(context: QContext) {\n context.instance.__markAsClean(context);\n}\n","import {\n RouteHooksStorage,\n Match,\n Route,\n NavigateOptions,\n ResolveOptions,\n QContext,\n ResolveStrategy,\n} from \"../index\";\n\nimport {\n PARAMETER_REGEXP,\n WILDCARD_REGEXP,\n REPLACE_VARIABLE_REGEXP,\n REPLACE_WILDCARD,\n START_BY_SLASH_REGEXP,\n MATCH_REGEXP_FLAGS,\n REPLACE_NOT_SURE,\n NOT_SURE_REGEXP,\n} from \"./constants\";\n\nexport function getCurrentEnvURL(fallback = \"/\"): string {\n if (windowAvailable()) {\n return location.pathname + location.search + location.hash;\n }\n return fallback;\n}\nexport function clean(s: string) {\n return s.replace(/\\/+$/, \"\").replace(/^\\/+/, \"\");\n}\nexport function isString(s: any): boolean {\n return typeof s === \"string\";\n}\nexport function isFunction(s: any): boolean {\n return typeof s === \"function\";\n}\nexport function extractHashFromURL(url: string) {\n if (url && url.indexOf(\"#\") >= 0) {\n return url.split(\"#\").pop() || \"\";\n }\n return \"\";\n}\nexport function regExpResultToParams(match, names: string[]) {\n if (names.length === 0) return null;\n if (!match) return null;\n return match.slice(1, match.length).reduce((params, value, index) => {\n if (params === null) params = {};\n params[names[index]] = decodeURIComponent(value);\n return params;\n }, null);\n}\nexport function extractGETParameters(url: string) {\n const tmp = clean(url).split(/\\?(.*)?$/);\n return [clean(tmp[0]), tmp.slice(1).join(\"\")];\n}\nexport function parseQuery(queryString: string): Object {\n var query = {};\n var pairs = queryString.split(\"&\");\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i].split(\"=\");\n if (pair[0] !== \"\") {\n let key = decodeURIComponent(pair[0]);\n if (!query[key]) {\n query[key] = decodeURIComponent(pair[1] || \"\");\n } else {\n if (!Array.isArray(query[key])) query[key] = [query[key]];\n query[key].push(decodeURIComponent(pair[1] || \"\"));\n }\n }\n }\n return query;\n}\nexport function matchRoute(context: QContext, route: Route): false | Match {\n const [current, GETParams] = extractGETParameters(\n clean(context.currentLocationPath)\n );\n const params = GETParams === \"\" ? null : parseQuery(GETParams);\n const paramNames = [];\n let pattern;\n if (isString(route.path)) {\n pattern =\n START_BY_SLASH_REGEXP +\n clean(route.path as string)\n .replace(PARAMETER_REGEXP, function (full, dots, name) {\n paramNames.push(name);\n return REPLACE_VARIABLE_REGEXP;\n })\n .replace(WILDCARD_REGEXP, REPLACE_WILDCARD)\n .replace(NOT_SURE_REGEXP, REPLACE_NOT_SURE) +\n \"$\";\n if (clean(route.path as string) === \"\") {\n if (clean(current) === \"\") {\n return {\n url: current,\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data: null,\n params,\n };\n }\n }\n } else {\n pattern = route.path;\n }\n const regexp = new RegExp(pattern, MATCH_REGEXP_FLAGS);\n const match = current.match(regexp);\n\n if (match) {\n const data = isString(route.path)\n ? regExpResultToParams(match, paramNames)\n : match.groups\n ? match.groups\n : match.slice(1);\n return {\n url: clean(current.replace(new RegExp(`^${context.instance.root}`), \"\")),\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data,\n params,\n };\n }\n return false;\n}\nexport function pushStateAvailable(): boolean {\n return !!(\n typeof window !== \"undefined\" &&\n window.history &&\n window.history.pushState\n );\n}\nexport function undefinedOrTrue(obj, key: string): boolean {\n return typeof obj[key] === \"undefined\" || obj[key] === true;\n}\nexport function parseNavigateOptions(source?: string): NavigateOptions {\n if (!source) return {};\n const pairs = source.split(\",\");\n const options: NavigateOptions = {};\n let resolveOptions: ResolveOptions;\n\n pairs.forEach((str) => {\n const temp = str.split(\":\").map((v) => v.replace(/(^ +| +$)/g, \"\"));\n switch (temp[0]) {\n case \"historyAPIMethod\":\n options.historyAPIMethod = temp[1];\n break;\n case \"resolveOptionsStrategy\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.strategy = temp[1] as ResolveStrategy;\n break;\n case \"resolveOptionsHash\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.hash = temp[1] === \"true\";\n break;\n case \"updateBrowserURL\":\n case \"callHandler\":\n case \"updateState\":\n case \"force\":\n options[temp[0]] = temp[1] === \"true\";\n break;\n }\n });\n if (resolveOptions) {\n options.resolveOptions = resolveOptions;\n }\n return options;\n}\nexport function windowAvailable() {\n return typeof window !== \"undefined\";\n}\nexport function accumulateHooks(\n hooks = [],\n result: RouteHooksStorage = {}\n): RouteHooksStorage {\n hooks\n .filter((h) => h)\n .forEach((h) => {\n [\"before\", \"after\", \"already\", \"leave\"].forEach((type) => {\n if (h[type]) {\n if (!result[type]) result[type] = [];\n result[type].push(h[type]);\n }\n });\n });\n return result as RouteHooksStorage;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// module exports must be returned from runtime so entry inlining is disabled\n// startup\n// Load entry module and return exports\nreturn __webpack_require__(\"./src/index.ts\");\n"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/navigo.amd.min.js b/lib/navigo.amd.min.js index 57df52d3..00ee858c 100644 --- a/lib/navigo.amd.min.js +++ b/lib/navigo.amd.min.js @@ -1,2 +1,2 @@ -define("Navigo.amd",[],(()=>(()=>{"use strict";var t={407:(t,n,e)=>{e.d(n,{default:()=>N});var r=/([:*])(\w+)/g,o=/\*/g,a=/\/\?/g;function i(t){return void 0===t&&(t="/"),v()?location.pathname+location.search+location.hash:t}function s(t){return t.replace(/\/+$/,"").replace(/^\/+/,"")}function c(t){return"string"==typeof t}function u(t){return t&&t.indexOf("#")>=0&&t.split("#").pop()||""}function h(t){var n=s(t).split(/\?(.*)?$/);return[s(n[0]),n.slice(1).join("")]}function f(t){for(var n={},e=t.split("&"),r=0;r0?1===t.matches.length?t.matches[0]:t.matches:void 0)}})).concat([function(){return r()}])):r()}else r()}})),{},(function(){return n()})):n()}function P(t,n){d(t.navigateOptions,"updateState")&&t.instance._setCurrent(t.matches),n()}var R=[function(t,n){var e=t.instance.lastResolved();if(e&&e[0]&&e[0].route===t.match.route&&e[0].url===t.match.url&&e[0].queryString===t.match.queryString)return e.forEach((function(n){n.route.hooks&&n.route.hooks.already&&d(t.navigateOptions,"callHooks")&&n.route.hooks.already.forEach((function(n){return n(t.match)}))})),void n(!1);n()},function(t,n){t.match.route.hooks&&t.match.route.hooks.before&&d(t.navigateOptions,"callHooks")?m(t.match.route.hooks.before.map((function(n){return function(e,r){return n((function(n){!1===n?t.instance.__markAsClean(t):r()}),t.match)}})).concat([function(){return n()}])):n()},function(t,n){d(t.navigateOptions,"callHandler")&&t.match.route.handler(t.match),t.instance.updatePageLinks(),n()},function(t,n){t.match.route.hooks&&t.match.route.hooks.after&&d(t.navigateOptions,"callHooks")&&t.match.route.hooks.after.forEach((function(n){return n(t.match)})),n()}],S=[A,function(t,n){var e=t.instance._notFoundRoute;if(e){t.notFoundHandled=!0;var r=h(t.currentLocationPath),o=r[0],a=r[1],i=u(t.to);e.path=s(o);var c={url:e.path,queryString:a,hashString:i,data:null,route:e,params:""!==a?f(a):null};t.matches=[c],t.match=c}n()},m.if((function(t){return t.notFoundHandled}),R.concat([P]),[function(t,n){t.resolveOptions&&!1!==t.resolveOptions.noMatchWarning&&void 0!==t.resolveOptions.noMatchWarning||console.warn('Navigo: "'+t.currentLocationPath+"\" didn't match any of the registered routes."),n()},function(t,n){t.instance._setCurrent(null),n()}])];function E(){return(E=Object.assign||function(t){for(var n=1;n=0&&(t=!0===r.hash?t.split("#")[1]||"/":t.split("#")[0]),t}function E(t){return s(a+"/"+s(t))}function N(t,n,e,r){return t=c(t)?E(t):t,{name:r||s(String(t)),path:t,handler:n,hooks:g(e)}}function U(t,n){if(!o.__dirty){o.__dirty=!0,t=t?s(a)+"/"+s(t):void 0;var e={instance:o,to:t,currentLocationPath:t,navigateOptions:{},resolveOptions:C({},r,n)};return m([y,_,m.if((function(t){var n=t.matches;return n&&n.length>0}),H,S)],e,x),!!e.matches&&e.matches}o.__waiting.push((function(){return o.resolve(t,n)}))}function q(t,n){if(o.__dirty)o.__waiting.push((function(){return o.navigate(t,n)}));else{o.__dirty=!0,t=s(a)+"/"+s(t);var e={instance:o,to:t,navigateOptions:n||{},resolveOptions:n&&n.resolveOptions?n.resolveOptions:r,currentLocationPath:R(t)};m([k,O,_,m.if((function(t){var n=t.matches;return n&&n.length>0}),H,S),b,x],e,x)}}function F(){if(P)return(P?[].slice.call(document.querySelectorAll(r.linksSelector||j)):[]).forEach((function(t){"false"!==t.getAttribute("data-navigo")&&"_blank"!==t.getAttribute("target")?t.hasListenerAttached||(t.hasListenerAttached=!0,t.navigoHandler=function(n){if((n.ctrlKey||n.metaKey)&&"a"===n.target.tagName.toLowerCase())return!1;var e=t.getAttribute("href");if(null==e)return!1;if(e.match(/^(http|https)/)&&"undefined"!=typeof URL)try{var r=new URL(e);e=r.pathname+r.search}catch(t){}var a=function(t){if(!t)return{};var n,e=t.split(","),r={};return e.forEach((function(t){var e=t.split(":").map((function(t){return t.replace(/(^ +| +$)/g,"")}));switch(e[0]){case"historyAPIMethod":r.historyAPIMethod=e[1];break;case"resolveOptionsStrategy":n||(n={}),n.strategy=e[1];break;case"resolveOptionsHash":n||(n={}),n.hash="true"===e[1];break;case"updateBrowserURL":case"callHandler":case"updateState":case"force":r[e[0]]="true"===e[1]}})),n&&(r.resolveOptions=n),r}(t.getAttribute("data-navigo-options"));L||(n.preventDefault(),n.stopPropagation(),o.navigate(s(e),a))},t.addEventListener("click",t.navigoHandler)):t.hasListenerAttached&&t.removeEventListener("click",t.navigoHandler)})),o}function I(t,n,e){var r=w.find((function(n){return n.name===t})),o=null;if(r){if(o=r.path,n)for(var i in n)o=o.replace(":"+i,n[i]);o=o.match(/^\//)?o:"/"+o}return o&&e&&!e.includeRoot&&(o=o.replace(new RegExp("^/"+a),"")),o}function M(t){var n=h(s(t)),r=n[0],o=n[1],a=""===o?null:f(o);return{url:r,queryString:o,hashString:u(t),route:N(r,(function(){}),[e],r),data:null,params:a}}function T(t,n,e){return"string"==typeof n&&(n=z(n)),n?(n.hooks[t]||(n.hooks[t]=[]),n.hooks[t].push(e),function(){n.hooks[t]=n.hooks[t].filter((function(t){return t!==e}))}):(console.warn("Route doesn't exists: "+n),function(){})}function z(t){return"string"==typeof t?w.find((function(n){return n.name===E(t)})):w.find((function(n){return n.handler===t}))}t?a=s(t):console.warn('Navigo requires a root path in its constructor. If not provided will use "/" as default.'),this.root=a,this.routes=w,this.destroyed=L,this.current=d,this.__freezeListening=!1,this.__waiting=[],this.__dirty=!1,this.__markAsClean=function(t){t.instance.__dirty=!1,t.instance.__waiting.length>0&&t.instance.__waiting.shift()()},this.on=function(t,n,r){var o=this;return"object"!=typeof t||t instanceof RegExp?("function"==typeof t&&(r=n,n=t,t=a),w.push(N(t,n,[e,r])),this):(Object.keys(t).forEach((function(n){if("function"==typeof t[n])o.on(n,t[n]);else{var r=t[n],a=r.uses,i=r.as,s=r.hooks;w.push(N(n,a,[e,s],i))}})),this)},this.off=function(t){return this.routes=w=w.filter((function(n){return c(t)?s(n.path)!==s(t):"function"==typeof t?t!==n.handler:String(n.path)!==String(t)})),this},this.resolve=U,this.navigate=q,this.navigateByName=function(t,n,e){var r=I(t,n);return null!==r&&(q(r.replace(new RegExp("^/?"+a),""),e),!0)},this.destroy=function(){this.routes=w=[],A&&window.removeEventListener("popstate",this.__popstateListener),this.destroyed=L=!0},this.notFound=function(t,n){return o._notFoundRoute=N("*",t,[e,n],"__NOT_FOUND__"),this},this.updatePageLinks=F,this.link=function(t){return"/"+a+"/"+s(t)},this.hooks=function(t){return e=t,this},this.extractGETParameters=function(t){return h(R(t))},this.lastResolved=function(){return d},this.generate=I,this.getLinkPath=function(t){return t.getAttribute("href")},this.match=function(t){var n={instance:o,currentLocationPath:t,to:t,navigateOptions:{},resolveOptions:r};return _(n,(function(){})),!!n.matches&&n.matches},this.matchLocation=function(t,n,e){void 0===n||void 0!==e&&!e||(n=E(n));var r={instance:o,to:n,currentLocationPath:n};return y(r,(function(){})),"string"==typeof t&&(t=void 0===e||e?E(t):t),l(r,{name:String(t),path:t,handler:function(){},hooks:{}})||!1},this.getCurrentLocation=function(){return M(s(i(a)).replace(new RegExp("^"+a),""))},this.addBeforeHook=T.bind(this,"before"),this.addAfterHook=T.bind(this,"after"),this.addAlreadyHook=T.bind(this,"already"),this.addLeaveHook=T.bind(this,"leave"),this.getRoute=z,this._pathToMatchObject=M,this._clean=s,this._checkForAHash=R,this._setCurrent=function(t){return d=o.current=t},function(){A&&(this.__popstateListener=function(){o.__freezeListening||U()},window.addEventListener("popstate",this.__popstateListener))}.call(this),F.call(this)}}},n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}return e.d=(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},e.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),e(407)})().default)); +define("Navigo.amd",[],(function(){return function(){"use strict";var t={407:function(t,n,e){e.d(n,{default:function(){return N}});var r=/([:*])(\w+)/g,o=/\*/g,i=/\/\?/g;function a(t){return void 0===t&&(t="/"),v()?location.pathname+location.search+location.hash:t}function s(t){return t.replace(/\/+$/,"").replace(/^\/+/,"")}function c(t){return"string"==typeof t}function u(t){return t&&t.indexOf("#")>=0&&t.split("#").pop()||""}function h(t){var n=s(t).split(/\?(.*)?$/);return[s(n[0]),n.slice(1).join("")]}function f(t){for(var n={},e=t.split("&"),r=0;r0?1===t.matches.length?t.matches[0]:t.matches:void 0)}})).concat([function(){return r()}])):r()}else r()}})),{},(function(){return n()})):n()}function P(t,n){d(t.navigateOptions,"updateState")&&t.instance._setCurrent(t.matches),n()}var R=[function(t,n){var e=t.instance.lastResolved();if(e&&e[0]&&e[0].route===t.match.route&&e[0].url===t.match.url&&e[0].queryString===t.match.queryString)return e.forEach((function(n){n.route.hooks&&n.route.hooks.already&&d(t.navigateOptions,"callHooks")&&n.route.hooks.already.forEach((function(n){return n(t.match)}))})),void n(!1);n()},function(t,n){t.match.route.hooks&&t.match.route.hooks.before&&d(t.navigateOptions,"callHooks")?m(t.match.route.hooks.before.map((function(n){return function(e,r){return n((function(n){!1===n?t.instance.__markAsClean(t):r()}),t.match)}})).concat([function(){return n()}])):n()},function(t,n){d(t.navigateOptions,"callHandler")&&t.match.route.handler(t.match),t.instance.updatePageLinks(),n()},function(t,n){t.match.route.hooks&&t.match.route.hooks.after&&d(t.navigateOptions,"callHooks")&&t.match.route.hooks.after.forEach((function(n){return n(t.match)})),n()}],S=[A,function(t,n){var e=t.instance._notFoundRoute;if(e){t.notFoundHandled=!0;var r=h(t.currentLocationPath),o=r[0],i=r[1],a=u(t.to);e.path=s(o);var c={url:e.path,queryString:i,hashString:a,data:null,route:e,params:""!==i?f(i):null};t.matches=[c],t.match=c}n()},m.if((function(t){return t.notFoundHandled}),R.concat([P]),[function(t,n){t.resolveOptions&&!1!==t.resolveOptions.noMatchWarning&&void 0!==t.resolveOptions.noMatchWarning||console.warn('Navigo: "'+t.currentLocationPath+"\" didn't match any of the registered routes."),n()},function(t,n){t.instance._setCurrent(null),n()}])];function E(){return(E=Object.assign||function(t){for(var n=1;n=0&&(t=!0===r.hash?t.split("#")[1]||"/":t.split("#")[0]),t}function E(t){return s(i+"/"+s(t))}function N(t,n,e,r){return t=c(t)?E(t):t,{name:r||s(String(t)),path:t,handler:n,hooks:g(e)}}function U(t,n){if(!o.__dirty){o.__dirty=!0,t=t?s(i)+"/"+s(t):void 0;var e={instance:o,to:t,currentLocationPath:t,navigateOptions:{},resolveOptions:C({},r,n)};return m([y,_,m.if((function(t){var n=t.matches;return n&&n.length>0}),H,S)],e,x),!!e.matches&&e.matches}o.__waiting.push((function(){return o.resolve(t,n)}))}function q(t,n){if(o.__dirty)o.__waiting.push((function(){return o.navigate(t,n)}));else{o.__dirty=!0,t=s(i)+"/"+s(t);var e={instance:o,to:t,navigateOptions:n||{},resolveOptions:n&&n.resolveOptions?n.resolveOptions:r,currentLocationPath:R(t)};m([k,O,_,m.if((function(t){var n=t.matches;return n&&n.length>0}),H,S),b,x],e,x)}}function F(){if(P)return(P?[].slice.call(document.querySelectorAll(r.linksSelector||j)):[]).forEach((function(t){"false"!==t.getAttribute("data-navigo")&&"_blank"!==t.getAttribute("target")?t.hasListenerAttached||(t.hasListenerAttached=!0,t.navigoHandler=function(n){if((n.ctrlKey||n.metaKey)&&"a"===n.target.tagName.toLowerCase())return!1;var e=t.getAttribute("href");if(null==e)return!1;if(e.match(/^(http|https)/)&&"undefined"!=typeof URL)try{var r=new URL(e);e=r.pathname+r.search}catch(t){}var i=function(t){if(!t)return{};var n,e=t.split(","),r={};return e.forEach((function(t){var e=t.split(":").map((function(t){return t.replace(/(^ +| +$)/g,"")}));switch(e[0]){case"historyAPIMethod":r.historyAPIMethod=e[1];break;case"resolveOptionsStrategy":n||(n={}),n.strategy=e[1];break;case"resolveOptionsHash":n||(n={}),n.hash="true"===e[1];break;case"updateBrowserURL":case"callHandler":case"updateState":case"force":r[e[0]]="true"===e[1]}})),n&&(r.resolveOptions=n),r}(t.getAttribute("data-navigo-options"));L||(n.preventDefault(),n.stopPropagation(),o.navigate(s(e),i))},t.addEventListener("click",t.navigoHandler)):t.hasListenerAttached&&t.removeEventListener("click",t.navigoHandler)})),o}function I(t,n,e){var r=w.find((function(n){return n.name===t})),o=null;if(r){if(o=r.path,n)for(var a in n)o=o.replace(":"+a,n[a]);o=o.match(/^\//)?o:"/"+o}return o&&e&&!e.includeRoot&&(o=o.replace(new RegExp("^/"+i),"")),o}function M(t){var n=h(s(t)),r=n[0],o=n[1],i=""===o?null:f(o);return{url:r,queryString:o,hashString:u(t),route:N(r,(function(){}),[e],r),data:null,params:i}}function T(t,n,e){return"string"==typeof n&&(n=z(n)),n?(n.hooks[t]||(n.hooks[t]=[]),n.hooks[t].push(e),function(){n.hooks[t]=n.hooks[t].filter((function(t){return t!==e}))}):(console.warn("Route doesn't exists: "+n),function(){})}function z(t){return"string"==typeof t?w.find((function(n){return n.name===E(t)})):w.find((function(n){return n.handler===t}))}t?i=s(t):console.warn('Navigo requires a root path in its constructor. If not provided will use "/" as default.'),this.root=i,this.routes=w,this.destroyed=L,this.current=d,this.__freezeListening=!1,this.__waiting=[],this.__dirty=!1,this.__markAsClean=function(t){t.instance.__dirty=!1,t.instance.__waiting.length>0&&t.instance.__waiting.shift()()},this.on=function(t,n,r){var o=this;return"object"!=typeof t||t instanceof RegExp?("function"==typeof t&&(r=n,n=t,t=i),w.push(N(t,n,[e,r])),this):(Object.keys(t).forEach((function(n){if("function"==typeof t[n])o.on(n,t[n]);else{var r=t[n],i=r.uses,a=r.as,s=r.hooks;w.push(N(n,i,[e,s],a))}})),this)},this.off=function(t){return this.routes=w=w.filter((function(n){return c(t)?s(n.path)!==s(t):"function"==typeof t?t!==n.handler:String(n.path)!==String(t)})),this},this.resolve=U,this.navigate=q,this.navigateByName=function(t,n,e){var r=I(t,n);return null!==r&&(q(r.replace(new RegExp("^/?"+i),""),e),!0)},this.destroy=function(){this.routes=w=[],A&&window.removeEventListener("popstate",this.__popstateListener),this.destroyed=L=!0},this.notFound=function(t,n){return o._notFoundRoute=N("*",t,[e,n],"__NOT_FOUND__"),this},this.updatePageLinks=F,this.link=function(t){return"/"+i+"/"+s(t)},this.hooks=function(t){return e=t,this},this.extractGETParameters=function(t){return h(R(t))},this.lastResolved=function(){return d},this.generate=I,this.getLinkPath=function(t){return t.getAttribute("href")},this.match=function(t){var n={instance:o,currentLocationPath:t,to:t,navigateOptions:{},resolveOptions:r};return _(n,(function(){})),!!n.matches&&n.matches},this.matchLocation=function(t,n,e){void 0===n||void 0!==e&&!e||(n=E(n));var r={instance:o,to:n,currentLocationPath:n};return y(r,(function(){})),"string"==typeof t&&(t=void 0===e||e?E(t):t),l(r,{name:String(t),path:t,handler:function(){},hooks:{}})||!1},this.getCurrentLocation=function(){return M(s(a(i)).replace(new RegExp("^"+i),""))},this.addBeforeHook=T.bind(this,"before"),this.addAfterHook=T.bind(this,"after"),this.addAlreadyHook=T.bind(this,"already"),this.addLeaveHook=T.bind(this,"leave"),this.getRoute=z,this._pathToMatchObject=M,this._clean=s,this._checkForAHash=R,this._setCurrent=function(t){return d=o.current=t},function(){A&&(this.__popstateListener=function(){o.__freezeListening||U()},window.addEventListener("popstate",this.__popstateListener))}.call(this),F.call(this)}}},n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}return e.d=function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e(407)}().default})); //# sourceMappingURL=navigo.amd.min.js.map \ No newline at end of file diff --git a/lib/navigo.amd.min.js.map b/lib/navigo.amd.min.js.map index 9e038624..0ff28eb9 100644 --- a/lib/navigo.amd.min.js.map +++ b/lib/navigo.amd.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://Navigo.amd/./src/constants.ts","webpack://Navigo.amd/./src/utils.ts","webpack://Navigo.amd/./src/Q.ts","webpack://Navigo.amd/./src/middlewares/setLocationPath.ts","webpack://Navigo.amd/./src/middlewares/matchPathToRegisteredRoutes.ts","webpack://Navigo.amd/./src/middlewares/checkForDeprecationMethods.ts","webpack://Navigo.amd/./src/middlewares/checkForForceOp.ts","webpack://Navigo.amd/./src/middlewares/updateBrowserURL.ts","webpack://Navigo.amd/./src/middlewares/checkForLeaveHook.ts","webpack://Navigo.amd/./src/middlewares/updateState.ts","webpack://Navigo.amd/./src/lifecycles.ts","webpack://Navigo.amd/./src/middlewares/checkForAlreadyHook.ts","webpack://Navigo.amd/./src/middlewares/checkForBeforeHook.ts","webpack://Navigo.amd/./src/middlewares/callHandler.ts","webpack://Navigo.amd/./src/middlewares/checkForAfterHook.ts","webpack://Navigo.amd/./src/middlewares/checkForNotFoundHandler.ts","webpack://Navigo.amd/./src/middlewares/errorOut.ts","webpack://Navigo.amd/./src/middlewares/flushCurrent.ts","webpack://Navigo.amd/./src/middlewares/processMatches.ts","webpack://Navigo.amd/./src/middlewares/waitingList.ts","webpack://Navigo.amd/./src/index.ts","webpack://Navigo.amd/webpack/bootstrap","webpack://Navigo.amd/webpack/startup","webpack://Navigo.amd/webpack/runtime/define property getters","webpack://Navigo.amd/webpack/runtime/hasOwnProperty shorthand"],"names":["PARAMETER_REGEXP","WILDCARD_REGEXP","NOT_SURE_REGEXP","getCurrentEnvURL","fallback","windowAvailable","location","pathname","search","hash","clean","s","replace","isString","extractHashFromURL","url","indexOf","split","pop","extractGETParameters","tmp","slice","join","parseQuery","queryString","query","pairs","i","length","pair","key","decodeURIComponent","Array","isArray","push","matchRoute","context","route","pattern","currentLocationPath","current","GETParams","params","paramNames","path","full","dots","name","hashString","to","data","regexp","RegExp","match","names","reduce","value","index","regExpResultToParams","groups","instance","root","pushStateAvailable","window","history","pushState","undefinedOrTrue","obj","accumulateHooks","hooks","result","filter","h","forEach","type","Q","funcs","c","done","idx","next","splice","moveForward","setLocationPath","_checkForAHash","matchPathToRegisteredRoutes","routes","matches","resolveOptions","strategy","checkForDeprecationMethods","navigateOptions","console","warn","checkForForceOp","force","_setCurrent","_pathToMatchObject","if","condition","one","two","isWindowAvailable","isPushStateAvailable","updateBrowserURL","isItUsingHash","historyAPIMethod","stateObj","title","__freezeListening","setTimeout","href","checkForLeaveHook","lastResolved","map","oldMatch","_","leaveLoopDone","leave","runHook","newLocationVSOldMatch","matchLocation","find","f","d","shouldStop","__markAsClean","undefined","concat","updateState","foundLifecycle","already","before","handler","updatePageLinks","after","notFoundLifeCycle","notFoundRoute","_notFoundRoute","notFoundHandled","notFoundMatch","noMatchWarning","processMatches","nextMatch","waitingList","DEFAULT_LINK_SELECTOR","Navigo","appRoute","options","genericHooks","DEFAULT_RESOLVE_OPTIONS","linksSelector","self","this","destroyed","composePathWithRoot","createRoute","String","resolve","__dirty","__waiting","navigate","call","document","querySelectorAll","link","getAttribute","hasListenerAttached","navigoHandler","e","ctrlKey","metaKey","target","tagName","toLowerCase","URL","u","err","source","str","temp","v","parseNavigateOptions","preventDefault","stopPropagation","addEventListener","removeEventListener","generate","r","includeRoot","pathToMatchObject","addHook","func","getRoute","nameOrHandler","shift","on","Object","keys","p","uses","as","off","what","navigateByName","destroy","__popstateListener","notFound","getLinkPath","currentLocation","annotatePathWithRoot","getCurrentLocation","addBeforeHook","bind","addAfterHook","addAlreadyHook","addLeaveHook","_clean","__webpack_module_cache__","__webpack_require__","moduleId","exports","module","__webpack_modules__","definition","o","defineProperty","enumerable","get","prop","prototype","hasOwnProperty"],"mappings":"2FAAO,IAAMA,EAAmB,eAEnBC,EAAkB,MAElBC,EAAkB,QCiBxB,SAASC,EAAiBC,GAC/B,YADuD,IAAxBA,MAAW,KACtCC,IACKC,SAASC,SAAWD,SAASE,OAASF,SAASG,KAEjDL,EAEF,SAASM,EAAMC,GACpB,OAAOA,EAAEC,QAAQ,OAAQ,IAAIA,QAAQ,OAAQ,IAExC,SAASC,EAASF,GACvB,MAAoB,iBAANA,EAKT,SAASG,EAAmBC,GACjC,OAAIA,GAAOA,EAAIC,QAAQ,MAAQ,GACtBD,EAAIE,MAAM,KAAKC,OAEjB,GAWF,SAASC,EAAqBJ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ACRiD,KAGJ/F,OAAO0H,iBAAiB,WAAYhC,KAAKqD,sBAkPtC5C,KAAKT,MACZnB,EAAgB4B,KAAKT,SC1cnBiE,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAUC,QAG3C,IAAIC,EAASJ,EAAyBE,GAAY,CAGjDC,QAAS,IAOV,OAHAE,EAAoBH,GAAUE,EAAQA,EAAOD,QAASF,GAG/CG,EAAOD,QCjBf,OCFAF,EAAoB/F,EAAI,CAACiG,EAASG,KACjC,IAAI,IAAIlM,KAAOkM,EACXL,EAAoBM,EAAED,EAAYlM,KAAS6L,EAAoBM,EAAEJ,EAAS/L,IAC5EuK,OAAO6B,eAAeL,EAAS/L,EAAK,CAAEqM,YAAY,EAAMC,IAAKJ,EAAWlM,MCJ3E6L,EAAoBM,EAAI,CAAC9J,EAAKkK,IAAShC,OAAOiC,UAAUC,eAAerE,KAAK/F,EAAKkK,GFG1EV,EAAoB,M","file":"navigo.amd.min.js","sourcesContent":["export const PARAMETER_REGEXP = /([:*])(\\w+)/g;\nexport const REPLACE_VARIABLE_REGEXP = \"([^/]+)\";\nexport const WILDCARD_REGEXP = /\\*/g;\nexport const REPLACE_WILDCARD = \"?(?:.*)\";\nexport const NOT_SURE_REGEXP = /\\/\\?/g;\nexport const REPLACE_NOT_SURE = \"/?([^/]+|)\";\nexport const START_BY_SLASH_REGEXP = \"(?:/^|^)\";\nexport const MATCH_REGEXP_FLAGS = \"\";\n","import {\n RouteHooksStorage,\n Match,\n Route,\n NavigateOptions,\n ResolveOptions,\n QContext,\n ResolveStrategy,\n} from \"../index\";\n\nimport {\n PARAMETER_REGEXP,\n WILDCARD_REGEXP,\n REPLACE_VARIABLE_REGEXP,\n REPLACE_WILDCARD,\n START_BY_SLASH_REGEXP,\n MATCH_REGEXP_FLAGS,\n REPLACE_NOT_SURE,\n NOT_SURE_REGEXP,\n} from \"./constants\";\n\nexport function getCurrentEnvURL(fallback = \"/\"): string {\n if (windowAvailable()) {\n return location.pathname + location.search + location.hash;\n }\n return fallback;\n}\nexport function clean(s: string) {\n return s.replace(/\\/+$/, \"\").replace(/^\\/+/, \"\");\n}\nexport function isString(s: any): boolean {\n return typeof s === \"string\";\n}\nexport function isFunction(s: any): boolean {\n return typeof s === \"function\";\n}\nexport function extractHashFromURL(url: string) {\n if (url && url.indexOf(\"#\") >= 0) {\n return url.split(\"#\").pop() || \"\";\n }\n return \"\";\n}\nexport function regExpResultToParams(match, names: string[]) {\n if (names.length === 0) return null;\n if (!match) return null;\n return match.slice(1, match.length).reduce((params, value, index) => {\n if (params === null) params = {};\n params[names[index]] = decodeURIComponent(value);\n return params;\n }, null);\n}\nexport function extractGETParameters(url: string) {\n const tmp = clean(url).split(/\\?(.*)?$/);\n return [clean(tmp[0]), tmp.slice(1).join(\"\")];\n}\nexport function parseQuery(queryString: string): Object {\n var query = {};\n var pairs = queryString.split(\"&\");\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i].split(\"=\");\n if (pair[0] !== \"\") {\n let key = decodeURIComponent(pair[0]);\n if (!query[key]) {\n query[key] = decodeURIComponent(pair[1] || \"\");\n } else {\n if (!Array.isArray(query[key])) query[key] = [query[key]];\n query[key].push(decodeURIComponent(pair[1] || \"\"));\n }\n }\n }\n return query;\n}\nexport function matchRoute(context: QContext, route: Route): false | Match {\n const [current, GETParams] = extractGETParameters(\n clean(context.currentLocationPath)\n );\n const params = GETParams === \"\" ? null : parseQuery(GETParams);\n const paramNames = [];\n let pattern;\n if (isString(route.path)) {\n pattern =\n START_BY_SLASH_REGEXP +\n clean(route.path as string)\n .replace(PARAMETER_REGEXP, function (full, dots, name) {\n paramNames.push(name);\n return REPLACE_VARIABLE_REGEXP;\n })\n .replace(WILDCARD_REGEXP, REPLACE_WILDCARD)\n .replace(NOT_SURE_REGEXP, REPLACE_NOT_SURE) +\n \"$\";\n if (clean(route.path as string) === \"\") {\n if (clean(current) === \"\") {\n return {\n url: current,\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data: null,\n params,\n };\n }\n }\n } else {\n pattern = route.path;\n }\n const regexp = new RegExp(pattern, MATCH_REGEXP_FLAGS);\n const match = current.match(regexp);\n\n if (match) {\n const data = isString(route.path)\n ? regExpResultToParams(match, paramNames)\n : match.groups\n ? match.groups\n : match.slice(1);\n return {\n url: clean(current.replace(new RegExp(`^${context.instance.root}`), \"\")),\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data,\n params,\n };\n }\n return false;\n}\nexport function pushStateAvailable(): boolean {\n return !!(\n typeof window !== \"undefined\" &&\n window.history &&\n window.history.pushState\n );\n}\nexport function undefinedOrTrue(obj, key: string): boolean {\n return typeof obj[key] === \"undefined\" || obj[key] === true;\n}\nexport function parseNavigateOptions(source?: string): NavigateOptions {\n if (!source) return {};\n const pairs = source.split(\",\");\n const options: NavigateOptions = {};\n let resolveOptions: ResolveOptions;\n\n pairs.forEach((str) => {\n const temp = str.split(\":\").map((v) => v.replace(/(^ +| +$)/g, \"\"));\n switch (temp[0]) {\n case \"historyAPIMethod\":\n options.historyAPIMethod = temp[1];\n break;\n case \"resolveOptionsStrategy\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.strategy = temp[1] as ResolveStrategy;\n break;\n case \"resolveOptionsHash\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.hash = temp[1] === \"true\";\n break;\n case \"updateBrowserURL\":\n case \"callHandler\":\n case \"updateState\":\n case \"force\":\n options[temp[0]] = temp[1] === \"true\";\n break;\n }\n });\n if (resolveOptions) {\n options.resolveOptions = resolveOptions;\n }\n return options;\n}\nexport function windowAvailable() {\n return typeof window !== \"undefined\";\n}\nexport function accumulateHooks(\n hooks = [],\n result: RouteHooksStorage = {}\n): RouteHooksStorage {\n hooks\n .filter((h) => h)\n .forEach((h) => {\n [\"before\", \"after\", \"already\", \"leave\"].forEach((type) => {\n if (h[type]) {\n if (!result[type]) result[type] = [];\n result[type].push(h[type]);\n }\n });\n });\n return result as RouteHooksStorage;\n}\n","type QChild = {\n type: \"child\";\n funcs: Array | QChild>;\n};\n\nexport default function Q(\n funcs: Array | QChild>,\n c?: any,\n done?: Function\n) {\n const context = c || {};\n let idx = 0;\n\n (function next() {\n if (!funcs[idx]) {\n if (done) {\n done(context);\n }\n return;\n }\n if (Array.isArray(funcs[idx])) {\n funcs.splice(\n idx,\n 1,\n ...(funcs[idx][0](context) ? funcs[idx][1] : funcs[idx][2])\n );\n next();\n } else {\n // console.log(funcs[idx].name + \" / \" + JSON.stringify(context));\n // console.log(funcs[idx].name);\n (funcs[idx] as Function)(context, (moveForward) => {\n if (typeof moveForward === \"undefined\" || moveForward === true) {\n idx += 1;\n next();\n } else if (done) {\n done(context);\n }\n });\n }\n })();\n}\n\nQ.if = function (condition: Function, one, two) {\n if (!Array.isArray(one)) one = [one];\n if (!Array.isArray(two)) two = [two];\n return [condition, one, two];\n};\n","import { QContext } from \"../../index\";\nimport { getCurrentEnvURL } from \"../utils\";\n\nexport default function setLocationPath(context: QContext, done) {\n if (typeof context.currentLocationPath === \"undefined\") {\n context.currentLocationPath = context.to = getCurrentEnvURL(\n context.instance.root\n );\n }\n context.currentLocationPath = context.instance._checkForAHash(\n context.currentLocationPath\n );\n done();\n}\n","import { matchRoute } from \"../utils\";\nimport { QContext, Match } from \"../../index\";\n\nexport default function matchPathToRegisteredRoutes(context: QContext, done) {\n for (let i = 0; i < context.instance.routes.length; i++) {\n const route = context.instance.routes[i];\n const match: false | Match = matchRoute(context, route);\n if (match) {\n if (!context.matches) context.matches = [];\n context.matches.push(match);\n if (context.resolveOptions.strategy === \"ONE\") {\n done();\n return;\n }\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForDeprecationMethods(context: QContext, done) {\n if (context.navigateOptions) {\n if (typeof context.navigateOptions[\"shouldResolve\"] !== \"undefined\") {\n console.warn(\n `\"shouldResolve\" is deprecated. Please check the documentation.`\n );\n }\n if (typeof context.navigateOptions[\"silent\"] !== \"undefined\") {\n console.warn(`\"silent\" is deprecated. Please check the documentation.`);\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForForceOp(context: QContext, done) {\n if (context.navigateOptions.force === true) {\n context.instance._setCurrent([\n context.instance._pathToMatchObject(context.to),\n ]);\n done(false);\n } else {\n done();\n }\n}\n","import { undefinedOrTrue, pushStateAvailable, windowAvailable } from \"../utils\";\nimport { QContext } from \"../../index\";\n\nconst isWindowAvailable = windowAvailable();\nconst isPushStateAvailable = pushStateAvailable();\n\nexport default function updateBrowserURL(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateBrowserURL\")) {\n const value = `/${context.to}`.replace(/\\/\\//g, \"/\"); // making sure that we don't have two slashes\n const isItUsingHash =\n isWindowAvailable &&\n context.resolveOptions &&\n context.resolveOptions.hash === true;\n if (isPushStateAvailable) {\n history[context.navigateOptions.historyAPIMethod || \"pushState\"](\n context.navigateOptions.stateObj || {},\n context.navigateOptions.title || \"\",\n isItUsingHash ? `#${value}` : value\n );\n // This is to solve a nasty bug where the page doesn't scroll to the anchor.\n // We set a microtask to update the hash only.\n if (location && location.hash) {\n context.instance.__freezeListening = true;\n setTimeout(() => {\n let tmp = location.hash;\n location.hash = \"\";\n location.hash = tmp;\n context.instance.__freezeListening = false;\n }, 1);\n }\n } else if (isWindowAvailable) {\n window.location.href = context.to;\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForLeaveHook(context: QContext, done) {\n const instance = context.instance;\n if (!instance.lastResolved()) {\n done();\n return;\n }\n Q(\n instance.lastResolved().map((oldMatch) => {\n return (_, leaveLoopDone) => {\n // no leave hook\n if (!oldMatch.route.hooks || !oldMatch.route.hooks.leave) {\n leaveLoopDone();\n return;\n }\n let runHook = false;\n const newLocationVSOldMatch = context.instance.matchLocation(\n oldMatch.route.path,\n context.currentLocationPath,\n false\n );\n if (oldMatch.route.path !== \"*\") {\n runHook = !newLocationVSOldMatch;\n } else {\n const someOfTheLastOnesMatch = context.matches\n ? context.matches.find((match) => {\n return oldMatch.route.path === match.route.path;\n })\n : false;\n runHook = !someOfTheLastOnesMatch;\n }\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\") && runHook) {\n Q(\n oldMatch.route.hooks.leave\n .map((f) => {\n // just so we match the Q interface\n return (_, d) =>\n f(\n (shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n },\n context.matches && context.matches.length > 0\n ? context.matches.length === 1\n ? context.matches[0]\n : context.matches\n : undefined\n );\n })\n .concat([() => leaveLoopDone()])\n );\n return;\n } else {\n leaveLoopDone();\n }\n };\n }),\n {},\n () => done()\n );\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function updateState(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateState\")) {\n context.instance._setCurrent(context.matches);\n }\n done();\n}\n","import { QContext } from \"../index\";\nimport Q from \"./Q\";\nimport checkForLeaveHook from \"./middlewares/checkForLeaveHook\";\nimport checkForBeforeHook from \"./middlewares/checkForBeforeHook\";\nimport callHandler from \"./middlewares/callHandler\";\nimport checkForAfterHook from \"./middlewares/checkForAfterHook\";\nimport checkForAlreadyHook from \"./middlewares/checkForAlreadyHook\";\nimport checkForNotFoundHandler from \"./middlewares/checkForNotFoundHandler\";\nimport errorOut from \"./middlewares/errorOut\";\nimport flushCurrent from \"./middlewares/flushCurrent\";\nimport updateState from \"./middlewares/updateState\";\n\nexport const foundLifecycle = [\n checkForAlreadyHook,\n checkForBeforeHook,\n callHandler,\n checkForAfterHook,\n];\n\nexport const notFoundLifeCycle = [\n checkForLeaveHook,\n checkForNotFoundHandler,\n Q.if(\n ({ notFoundHandled }: QContext) => notFoundHandled,\n foundLifecycle.concat([updateState]),\n [errorOut, flushCurrent]\n ),\n];\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAlreadyHook(context: QContext, done) {\n const current = context.instance.lastResolved();\n if (\n current &&\n current[0] &&\n current[0].route === context.match.route &&\n current[0].url === context.match.url &&\n current[0].queryString === context.match.queryString\n ) {\n current.forEach((c) => {\n if (c.route.hooks && c.route.hooks.already) {\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\")) {\n c.route.hooks.already.forEach((f) => f(context.match));\n }\n }\n });\n done(false);\n return;\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForBeforeHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.before &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n Q(\n context.match.route.hooks.before\n .map((f) => {\n // just so we match the Q interface\n return function beforeHookInternal(_, d) {\n return f((shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n }, context.match);\n };\n })\n .concat([() => done()])\n );\n } else {\n done();\n }\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function callHandler(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"callHandler\")) {\n context.match.route.handler(context.match);\n }\n context.instance.updatePageLinks();\n done();\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAfterHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.after &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n context.match.route.hooks.after.forEach((f) => f(context.match));\n }\n done();\n}\n","import { QContext, Match } from \"../../index\";\nimport {\n parseQuery,\n extractGETParameters,\n clean,\n extractHashFromURL,\n} from \"../utils\";\n\nexport default function checkForNotFoundHandler(context: QContext, done) {\n const notFoundRoute = context.instance._notFoundRoute;\n if (notFoundRoute) {\n context.notFoundHandled = true;\n const [url, queryString] = extractGETParameters(\n context.currentLocationPath\n );\n const hashString = extractHashFromURL(context.to);\n notFoundRoute.path = clean(url);\n const notFoundMatch: Match = {\n url: notFoundRoute.path,\n queryString,\n hashString,\n data: null,\n route: notFoundRoute,\n params: queryString !== \"\" ? parseQuery(queryString) : null,\n };\n context.matches = [notFoundMatch];\n context.match = notFoundMatch;\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function errorOut(context: QContext, done) {\n if (\n !context.resolveOptions ||\n context.resolveOptions.noMatchWarning === false ||\n typeof context.resolveOptions.noMatchWarning === \"undefined\"\n )\n console.warn(\n `Navigo: \"${context.currentLocationPath}\" didn't match any of the registered routes.`\n );\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function flushCurrent(context: QContext, done) {\n context.instance._setCurrent(null);\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { foundLifecycle } from \"../lifecycles\";\nimport updateState from \"./updateState\";\nimport checkForLeaveHook from \"./checkForLeaveHook\";\n\nexport default function processMatches(context: QContext, done) {\n let idx = 0;\n function nextMatch() {\n if (idx === context.matches.length) {\n updateState(context, done);\n return;\n }\n Q(\n foundLifecycle,\n { ...context, match: context.matches[idx] },\n function end() {\n idx += 1;\n nextMatch();\n }\n );\n }\n checkForLeaveHook(context, nextMatch);\n}\n","import { QContext } from \"../../index\";\n\nexport default function waitingList(context: QContext) {\n context.instance.__markAsClean(context);\n}\n","import {\n Match,\n Route,\n RouteHooks,\n QContext,\n NavigateOptions,\n ResolveOptions,\n GenerateOptions,\n Handler,\n RouterOptions,\n} from \"../index\";\nimport NavigoRouter from \"../index\";\nimport {\n pushStateAvailable,\n matchRoute,\n parseQuery,\n extractGETParameters,\n isFunction,\n isString,\n clean,\n parseNavigateOptions,\n windowAvailable,\n getCurrentEnvURL,\n accumulateHooks,\n extractHashFromURL,\n} from \"./utils\";\nimport Q from \"./Q\";\nimport setLocationPath from \"./middlewares/setLocationPath\";\nimport matchPathToRegisteredRoutes from \"./middlewares/matchPathToRegisteredRoutes\";\nimport checkForDeprecationMethods from \"./middlewares/checkForDeprecationMethods\";\nimport checkForForceOp from \"./middlewares/checkForForceOp\";\nimport updateBrowserURL from \"./middlewares/updateBrowserURL\";\nimport processMatches from \"./middlewares/processMatches\";\nimport waitingList from \"./middlewares/waitingList\";\n\nimport { notFoundLifeCycle } from \"./lifecycles\";\n\nconst DEFAULT_LINK_SELECTOR = \"[data-navigo]\";\n\nexport default function Navigo(appRoute?: string, options?: RouterOptions) {\n let DEFAULT_RESOLVE_OPTIONS: RouterOptions = options || {\n strategy: \"ONE\",\n hash: false,\n noMatchWarning: false,\n linksSelector: DEFAULT_LINK_SELECTOR,\n };\n let self: NavigoRouter = this;\n let root = \"/\";\n let current: Match[] = null;\n let routes: Route[] = [];\n let destroyed = false;\n let genericHooks: RouteHooks;\n\n const isPushStateAvailable = pushStateAvailable();\n const isWindowAvailable = windowAvailable();\n\n if (!appRoute) {\n console.warn(\n 'Navigo requires a root path in its constructor. If not provided will use \"/\" as default.'\n );\n } else {\n root = clean(appRoute);\n }\n\n function _checkForAHash(url: string): string {\n if (url.indexOf(\"#\") >= 0) {\n if (DEFAULT_RESOLVE_OPTIONS.hash === true) {\n url = url.split(\"#\")[1] || \"/\";\n } else {\n url = url.split(\"#\")[0];\n }\n }\n return url;\n }\n function composePathWithRoot(path: string) {\n return clean(`${root}/${clean(path)}`);\n }\n function createRoute(\n path: string | RegExp,\n handler: Handler,\n hooks: RouteHooks[],\n name?: string\n ): Route {\n path = isString(path) ? composePathWithRoot(path as string) : path;\n return {\n name: name || clean(String(path)),\n path,\n handler,\n hooks: accumulateHooks(hooks),\n };\n }\n\n // public APIs\n function on(\n path: string | Function | Object | RegExp,\n handler?: Handler,\n hooks?: RouteHooks\n ) {\n if (typeof path === \"object\" && !(path instanceof RegExp)) {\n Object.keys(path).forEach((p) => {\n if (typeof path[p] === \"function\") {\n this.on(p, path[p]);\n } else {\n const { uses: handler, as: name, hooks } = path[p];\n routes.push(createRoute(p, handler, [genericHooks, hooks], name));\n }\n });\n return this;\n } else if (typeof path === \"function\") {\n hooks = handler as RouteHooks;\n handler = path as Handler;\n path = root;\n }\n routes.push(\n createRoute(path as string | RegExp, handler, [genericHooks, hooks])\n );\n return this;\n }\n function resolve(to?: string, options?: ResolveOptions): false | Match[] {\n if (self.__dirty) {\n self.__waiting.push(() => self.resolve(to, options));\n return;\n } else {\n self.__dirty = true;\n }\n to = to ? `${clean(root)}/${clean(to)}` : undefined;\n // console.log(\"-- resolve --> \" + to, self.__dirty);\n const context: QContext = {\n instance: self,\n to,\n currentLocationPath: to,\n navigateOptions: {},\n resolveOptions: { ...DEFAULT_RESOLVE_OPTIONS, ...options },\n };\n Q(\n [\n setLocationPath,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n ],\n context,\n waitingList\n );\n\n return context.matches ? context.matches : false;\n }\n function navigate(to: string, navigateOptions?: NavigateOptions): void {\n // console.log(\"-- navigate --> \" + to, self.__dirty);\n if (self.__dirty) {\n self.__waiting.push(() => self.navigate(to, navigateOptions));\n return;\n } else {\n self.__dirty = true;\n }\n to = `${clean(root)}/${clean(to)}`;\n const context: QContext = {\n instance: self,\n to,\n navigateOptions: navigateOptions || {},\n resolveOptions:\n navigateOptions && navigateOptions.resolveOptions\n ? navigateOptions.resolveOptions\n : DEFAULT_RESOLVE_OPTIONS,\n currentLocationPath: _checkForAHash(to),\n };\n Q(\n [\n checkForDeprecationMethods,\n checkForForceOp,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n updateBrowserURL,\n waitingList,\n ],\n context,\n waitingList\n );\n }\n function navigateByName(\n name: string,\n data?: Object,\n options?: NavigateOptions\n ): boolean {\n const url = generate(name, data);\n if (url !== null) {\n navigate(url.replace(new RegExp(`^\\/?${root}`), \"\"), options);\n return true;\n }\n return false;\n }\n function off(what: string | RegExp | Function) {\n this.routes = routes = routes.filter((r) => {\n if (isString(what)) {\n return clean(r.path as string) !== clean(what as string);\n } else if (isFunction(what)) {\n return what !== r.handler;\n }\n return String(r.path) !== String(what);\n });\n return this;\n }\n function listen() {\n if (isPushStateAvailable) {\n this.__popstateListener = () => {\n if (!self.__freezeListening) {\n resolve();\n }\n };\n window.addEventListener(\"popstate\", this.__popstateListener);\n }\n }\n function destroy() {\n this.routes = routes = [];\n if (isPushStateAvailable) {\n window.removeEventListener(\"popstate\", this.__popstateListener);\n }\n this.destroyed = destroyed = true;\n }\n function notFound(handler, hooks?: RouteHooks) {\n self._notFoundRoute = createRoute(\n \"*\",\n handler,\n [genericHooks, hooks],\n \"__NOT_FOUND__\"\n );\n return this;\n }\n function updatePageLinks() {\n if (!isWindowAvailable) return;\n findLinks().forEach((link) => {\n if (\n \"false\" === link.getAttribute(\"data-navigo\") ||\n \"_blank\" === link.getAttribute(\"target\")\n ) {\n if (link.hasListenerAttached) {\n link.removeEventListener(\"click\", link.navigoHandler);\n }\n return;\n }\n if (!link.hasListenerAttached) {\n link.hasListenerAttached = true;\n link.navigoHandler = function (e) {\n if (\n (e.ctrlKey || e.metaKey) &&\n e.target.tagName.toLowerCase() === \"a\"\n ) {\n return false;\n }\n let location = link.getAttribute(\"href\");\n if (typeof location === \"undefined\" || location === null) {\n return false;\n }\n // handling absolute paths\n if (location.match(/^(http|https)/) && typeof URL !== \"undefined\") {\n try {\n const u = new URL(location);\n location = u.pathname + u.search;\n } catch (err) {}\n }\n const options = parseNavigateOptions(\n link.getAttribute(\"data-navigo-options\")\n );\n\n if (!destroyed) {\n e.preventDefault();\n e.stopPropagation();\n self.navigate(clean(location), options);\n }\n };\n link.addEventListener(\"click\", link.navigoHandler);\n }\n });\n return self;\n }\n function findLinks() {\n if (isWindowAvailable) {\n return [].slice.call(\n document.querySelectorAll(\n DEFAULT_RESOLVE_OPTIONS.linksSelector || DEFAULT_LINK_SELECTOR\n )\n );\n }\n return [];\n }\n function link(path: string) {\n return `/${root}/${clean(path)}`;\n }\n function setGenericHooks(hooks: RouteHooks) {\n genericHooks = hooks;\n return this;\n }\n function lastResolved(): Match[] | null {\n return current;\n }\n function generate(\n name: string,\n data?: Object,\n options?: GenerateOptions\n ): string {\n const route = routes.find((r) => r.name === name);\n let result = null;\n if (route) {\n result = route.path as string;\n if (data) {\n for (let key in data) {\n result = result.replace(\":\" + key, data[key]);\n }\n }\n result = !result.match(/^\\//) ? `/${result}` : result;\n }\n if (result && options && !options.includeRoot) {\n result = result.replace(new RegExp(`^/${root}`), \"\");\n }\n return result;\n }\n function getLinkPath(link) {\n return link.getAttribute(\"href\");\n }\n function pathToMatchObject(path: string): Match {\n const [url, queryString] = extractGETParameters(clean(path));\n const params = queryString === \"\" ? null : parseQuery(queryString);\n const hashString = extractHashFromURL(path);\n const route = createRoute(url, () => {}, [genericHooks], url);\n return {\n url,\n queryString,\n hashString,\n route,\n data: null,\n params: params,\n };\n }\n function getCurrentLocation(): Match {\n return pathToMatchObject(\n clean(getCurrentEnvURL(root)).replace(new RegExp(`^${root}`), \"\")\n );\n }\n function directMatchWithRegisteredRoutes(path: string): false | Match[] {\n const context: QContext = {\n instance: self,\n currentLocationPath: path,\n to: path,\n navigateOptions: {},\n resolveOptions: DEFAULT_RESOLVE_OPTIONS,\n };\n matchPathToRegisteredRoutes(context, () => {});\n return context.matches ? context.matches : false;\n }\n function directMatchWithLocation(\n path: string | RegExp,\n currentLocation?: string,\n annotatePathWithRoot?: boolean\n ): false | Match {\n if (\n typeof currentLocation !== \"undefined\" &&\n (typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot)\n ) {\n currentLocation = composePathWithRoot(currentLocation);\n }\n const context: QContext = {\n instance: self,\n to: currentLocation,\n currentLocationPath: currentLocation,\n };\n setLocationPath(context, () => {});\n if (typeof path === \"string\") {\n path =\n typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot\n ? composePathWithRoot(path)\n : path;\n }\n const match = matchRoute(context, {\n name: String(path),\n path,\n handler: () => {},\n hooks: {},\n });\n return match ? match : false;\n }\n function addHook(\n type: string,\n route: Route | string,\n func: Function\n ): Function {\n if (typeof route === \"string\") {\n route = getRoute(route);\n }\n if (route) {\n if (!route.hooks[type]) route.hooks[type] = [];\n route.hooks[type].push(func);\n return () => {\n (route as Route).hooks[type] = (route as Route).hooks[type].filter(\n (f) => f !== func\n );\n };\n } else {\n console.warn(`Route doesn't exists: ${route}`);\n }\n return () => {};\n }\n function getRoute(nameOrHandler: string | Function): Route | undefined {\n if (typeof nameOrHandler === \"string\") {\n return routes.find((r) => r.name === composePathWithRoot(nameOrHandler));\n }\n return routes.find((r) => r.handler === nameOrHandler);\n }\n function __markAsClean(context: QContext) {\n context.instance.__dirty = false;\n if (context.instance.__waiting.length > 0) {\n context.instance.__waiting.shift()();\n }\n }\n\n this.root = root;\n this.routes = routes;\n this.destroyed = destroyed;\n this.current = current;\n this.__freezeListening = false;\n this.__waiting = [];\n this.__dirty = false;\n this.__markAsClean = __markAsClean;\n\n this.on = on;\n this.off = off;\n this.resolve = resolve;\n this.navigate = navigate;\n this.navigateByName = navigateByName;\n this.destroy = destroy;\n this.notFound = notFound;\n this.updatePageLinks = updatePageLinks;\n this.link = link;\n this.hooks = setGenericHooks;\n this.extractGETParameters = (url) =>\n extractGETParameters(_checkForAHash(url));\n this.lastResolved = lastResolved;\n this.generate = generate;\n this.getLinkPath = getLinkPath;\n this.match = directMatchWithRegisteredRoutes;\n this.matchLocation = directMatchWithLocation;\n this.getCurrentLocation = getCurrentLocation;\n this.addBeforeHook = addHook.bind(this, \"before\");\n this.addAfterHook = addHook.bind(this, \"after\");\n this.addAlreadyHook = addHook.bind(this, \"already\");\n this.addLeaveHook = addHook.bind(this, \"leave\");\n this.getRoute = getRoute;\n this._pathToMatchObject = pathToMatchObject;\n this._clean = clean;\n this._checkForAHash = _checkForAHash;\n this._setCurrent = (c) => (current = self.current = c);\n\n listen.call(this);\n updatePageLinks.call(this);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// module exports must be returned from runtime so entry inlining is disabled\n// startup\n// Load entry module and return exports\nreturn __webpack_require__(407);\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://Navigo.amd/./src/constants.ts","webpack://Navigo.amd/./src/utils.ts","webpack://Navigo.amd/./src/Q.ts","webpack://Navigo.amd/./src/middlewares/setLocationPath.ts","webpack://Navigo.amd/./src/middlewares/matchPathToRegisteredRoutes.ts","webpack://Navigo.amd/./src/middlewares/checkForDeprecationMethods.ts","webpack://Navigo.amd/./src/middlewares/checkForForceOp.ts","webpack://Navigo.amd/./src/middlewares/updateBrowserURL.ts","webpack://Navigo.amd/./src/middlewares/checkForLeaveHook.ts","webpack://Navigo.amd/./src/middlewares/updateState.ts","webpack://Navigo.amd/./src/lifecycles.ts","webpack://Navigo.amd/./src/middlewares/checkForAlreadyHook.ts","webpack://Navigo.amd/./src/middlewares/checkForBeforeHook.ts","webpack://Navigo.amd/./src/middlewares/callHandler.ts","webpack://Navigo.amd/./src/middlewares/checkForAfterHook.ts","webpack://Navigo.amd/./src/middlewares/checkForNotFoundHandler.ts","webpack://Navigo.amd/./src/middlewares/errorOut.ts","webpack://Navigo.amd/./src/middlewares/flushCurrent.ts","webpack://Navigo.amd/./src/middlewares/processMatches.ts","webpack://Navigo.amd/./src/middlewares/waitingList.ts","webpack://Navigo.amd/./src/index.ts","webpack://Navigo.amd/webpack/bootstrap","webpack://Navigo.amd/webpack/startup","webpack://Navigo.amd/webpack/runtime/define property getters","webpack://Navigo.amd/webpack/runtime/hasOwnProperty shorthand"],"names":["PARAMETER_REGEXP","WILDCARD_REGEXP","NOT_SURE_REGEXP","getCurrentEnvURL","fallback","windowAvailable","location","pathname","search","hash","clean","s","replace","isString","extractHashFromURL","url","indexOf","split","pop","extractGETParameters","tmp","slice","join","parseQuery","queryString","query","pairs","i","length","pair","key","decodeURIComponent","Array","isArray","push","matchRoute","context","route","pattern","currentLocationPath","current","GETParams","params","paramNames","path","full","dots","name","hashString","to","data","regexp","RegExp","match","names","reduce","value","index","regExpResultToParams","groups","instance","root","pushStateAvailable","window","history","pushState","undefinedOrTrue","obj","accumulateHooks","hooks","result","filter","h","forEach","type","Q","funcs","c","done","idx","next","splice","moveForward","setLocationPath","_checkForAHash","matchPathToRegisteredRoutes","routes","matches","resolveOptions","strategy","checkForDeprecationMethods","navigateOptions","console","warn","checkForForceOp","force","_setCurrent","_pathToMatchObject","if","condition","one","two","isWindowAvailable","isPushStateAvailable","updateBrowserURL","isItUsingHash","historyAPIMethod","stateObj","title","__freezeListening","setTimeout","href","checkForLeaveHook","lastResolved","map","oldMatch","_","leaveLoopDone","leave","runHook","newLocationVSOldMatch","matchLocation","find","f","d","shouldStop","__markAsClean","undefined","concat","updateState","foundLifecycle","already","before","handler","updatePageLinks","after","notFoundLifeCycle","notFoundRoute","_notFoundRoute","notFoundHandled","notFoundMatch","noMatchWarning","processMatches","nextMatch","waitingList","DEFAULT_LINK_SELECTOR","Navigo","appRoute","options","genericHooks","DEFAULT_RESOLVE_OPTIONS","linksSelector","self","this","destroyed","composePathWithRoot","createRoute","String","resolve","__dirty","__waiting","navigate","call","document","querySelectorAll","link","getAttribute","hasListenerAttached","navigoHandler","e","ctrlKey","metaKey","target","tagName","toLowerCase","URL","u","err","source","str","temp","v","parseNavigateOptions","preventDefault","stopPropagation","addEventListener","removeEventListener","generate","r","includeRoot","pathToMatchObject","addHook","func","getRoute","nameOrHandler","shift","on","Object","keys","p","uses","as","off","what","navigateByName","destroy","__popstateListener","notFound","getLinkPath","currentLocation","annotatePathWithRoot","getCurrentLocation","addBeforeHook","bind","addAfterHook","addAlreadyHook","addLeaveHook","_clean","__webpack_module_cache__","__webpack_require__","moduleId","exports","module","__webpack_modules__","definition","o","defineProperty","enumerable","get","prop","prototype","hasOwnProperty"],"mappings":"mIAAO,IAAMA,EAAmB,eAEnBC,EAAkB,MAElBC,EAAkB,QCiBxB,SAASC,EAAiBC,GAC/B,YADuD,IAAxBA,MAAW,KACtCC,IACKC,SAASC,SAAWD,SAASE,OAASF,SAASG,KAEjDL,EAEF,SAASM,EAAMC,GACpB,OAAOA,EAAEC,QAAQ,OAAQ,IAAIA,QAAQ,OAAQ,IAExC,SAASC,EAASF,GACvB,MAAoB,iBAANA,EAKT,SAASG,EAAmBC,GACjC,OAAIA,GAAOA,EAAIC,QAAQ,MAAQ,GACtBD,EAAIE,MAAM,KAAKC,OAEjB,GAWF,SAASC,EAAqBJ,GACnC,IAAMK,EAAMV,EAAMK,GAAKE,MAAM,YAC7B,MAAO,CAACP,EAAMU,EAAI,IAAKA,EAAIC,MAAM,GAAGC,KAAK,KAEpC,SAASC,EAAWC,GAGzB,IAFA,IAAIC,EAAQ,GACRC,EAAQF,EAAYP,MAAM,KACrBU,EAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,CACrC,IAAIE,EAAOH,EAAMC,GAAGV,MAAM,KAC1B,GAAgB,KAAZY,EAAK,GAAW,CAClB,IAAIC,EAAMC,mBAAmBF,EAAK,IAC7BJ,EAAMK,IAGJE,MAAMC,QAAQR,EAAMK,MAAOL,EAAMK,GAAO,C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6L,EAAoBM,EAAEJ,EAAS/L,IAC5EuK,OAAO6B,eAAeL,EAAS/L,EAAK,CAAEqM,YAAY,EAAMC,IAAKJ,EAAWlM,MCJ3E6L,EAAoBM,EAAI,SAAS9J,EAAKkK,GAAQ,OAAOhC,OAAOiC,UAAUC,eAAerE,KAAK/F,EAAKkK,IFGxFV,EAAoB,K","file":"navigo.amd.min.js","sourcesContent":["export const PARAMETER_REGEXP = /([:*])(\\w+)/g;\nexport const REPLACE_VARIABLE_REGEXP = \"([^/]+)\";\nexport const WILDCARD_REGEXP = /\\*/g;\nexport const REPLACE_WILDCARD = \"?(?:.*)\";\nexport const NOT_SURE_REGEXP = /\\/\\?/g;\nexport const REPLACE_NOT_SURE = \"/?([^/]+|)\";\nexport const START_BY_SLASH_REGEXP = \"(?:/^|^)\";\nexport const MATCH_REGEXP_FLAGS = \"\";\n","import {\n RouteHooksStorage,\n Match,\n Route,\n NavigateOptions,\n ResolveOptions,\n QContext,\n ResolveStrategy,\n} from \"../index\";\n\nimport {\n PARAMETER_REGEXP,\n WILDCARD_REGEXP,\n REPLACE_VARIABLE_REGEXP,\n REPLACE_WILDCARD,\n START_BY_SLASH_REGEXP,\n MATCH_REGEXP_FLAGS,\n REPLACE_NOT_SURE,\n NOT_SURE_REGEXP,\n} from \"./constants\";\n\nexport function getCurrentEnvURL(fallback = \"/\"): string {\n if (windowAvailable()) {\n return location.pathname + location.search + location.hash;\n }\n return fallback;\n}\nexport function clean(s: string) {\n return s.replace(/\\/+$/, \"\").replace(/^\\/+/, \"\");\n}\nexport function isString(s: any): boolean {\n return typeof s === \"string\";\n}\nexport function isFunction(s: any): boolean {\n return typeof s === \"function\";\n}\nexport function extractHashFromURL(url: string) {\n if (url && url.indexOf(\"#\") >= 0) {\n return url.split(\"#\").pop() || \"\";\n }\n return \"\";\n}\nexport function regExpResultToParams(match, names: string[]) {\n if (names.length === 0) return null;\n if (!match) return null;\n return match.slice(1, match.length).reduce((params, value, index) => {\n if (params === null) params = {};\n params[names[index]] = decodeURIComponent(value);\n return params;\n }, null);\n}\nexport function extractGETParameters(url: string) {\n const tmp = clean(url).split(/\\?(.*)?$/);\n return [clean(tmp[0]), tmp.slice(1).join(\"\")];\n}\nexport function parseQuery(queryString: string): Object {\n var query = {};\n var pairs = queryString.split(\"&\");\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i].split(\"=\");\n if (pair[0] !== \"\") {\n let key = decodeURIComponent(pair[0]);\n if (!query[key]) {\n query[key] = decodeURIComponent(pair[1] || \"\");\n } else {\n if (!Array.isArray(query[key])) query[key] = [query[key]];\n query[key].push(decodeURIComponent(pair[1] || \"\"));\n }\n }\n }\n return query;\n}\nexport function matchRoute(context: QContext, route: Route): false | Match {\n const [current, GETParams] = extractGETParameters(\n clean(context.currentLocationPath)\n );\n const params = GETParams === \"\" ? null : parseQuery(GETParams);\n const paramNames = [];\n let pattern;\n if (isString(route.path)) {\n pattern =\n START_BY_SLASH_REGEXP +\n clean(route.path as string)\n .replace(PARAMETER_REGEXP, function (full, dots, name) {\n paramNames.push(name);\n return REPLACE_VARIABLE_REGEXP;\n })\n .replace(WILDCARD_REGEXP, REPLACE_WILDCARD)\n .replace(NOT_SURE_REGEXP, REPLACE_NOT_SURE) +\n \"$\";\n if (clean(route.path as string) === \"\") {\n if (clean(current) === \"\") {\n return {\n url: current,\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data: null,\n params,\n };\n }\n }\n } else {\n pattern = route.path;\n }\n const regexp = new RegExp(pattern, MATCH_REGEXP_FLAGS);\n const match = current.match(regexp);\n\n if (match) {\n const data = isString(route.path)\n ? regExpResultToParams(match, paramNames)\n : match.groups\n ? match.groups\n : match.slice(1);\n return {\n url: clean(current.replace(new RegExp(`^${context.instance.root}`), \"\")),\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data,\n params,\n };\n }\n return false;\n}\nexport function pushStateAvailable(): boolean {\n return !!(\n typeof window !== \"undefined\" &&\n window.history &&\n window.history.pushState\n );\n}\nexport function undefinedOrTrue(obj, key: string): boolean {\n return typeof obj[key] === \"undefined\" || obj[key] === true;\n}\nexport function parseNavigateOptions(source?: string): NavigateOptions {\n if (!source) return {};\n const pairs = source.split(\",\");\n const options: NavigateOptions = {};\n let resolveOptions: ResolveOptions;\n\n pairs.forEach((str) => {\n const temp = str.split(\":\").map((v) => v.replace(/(^ +| +$)/g, \"\"));\n switch (temp[0]) {\n case \"historyAPIMethod\":\n options.historyAPIMethod = temp[1];\n break;\n case \"resolveOptionsStrategy\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.strategy = temp[1] as ResolveStrategy;\n break;\n case \"resolveOptionsHash\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.hash = temp[1] === \"true\";\n break;\n case \"updateBrowserURL\":\n case \"callHandler\":\n case \"updateState\":\n case \"force\":\n options[temp[0]] = temp[1] === \"true\";\n break;\n }\n });\n if (resolveOptions) {\n options.resolveOptions = resolveOptions;\n }\n return options;\n}\nexport function windowAvailable() {\n return typeof window !== \"undefined\";\n}\nexport function accumulateHooks(\n hooks = [],\n result: RouteHooksStorage = {}\n): RouteHooksStorage {\n hooks\n .filter((h) => h)\n .forEach((h) => {\n [\"before\", \"after\", \"already\", \"leave\"].forEach((type) => {\n if (h[type]) {\n if (!result[type]) result[type] = [];\n result[type].push(h[type]);\n }\n });\n });\n return result as RouteHooksStorage;\n}\n","type QChild = {\n type: \"child\";\n funcs: Array | QChild>;\n};\n\nexport default function Q(\n funcs: Array | QChild>,\n c?: any,\n done?: Function\n) {\n const context = c || {};\n let idx = 0;\n\n (function next() {\n if (!funcs[idx]) {\n if (done) {\n done(context);\n }\n return;\n }\n if (Array.isArray(funcs[idx])) {\n funcs.splice(\n idx,\n 1,\n ...(funcs[idx][0](context) ? funcs[idx][1] : funcs[idx][2])\n );\n next();\n } else {\n // console.log(funcs[idx].name + \" / \" + JSON.stringify(context));\n // console.log(funcs[idx].name);\n (funcs[idx] as Function)(context, (moveForward) => {\n if (typeof moveForward === \"undefined\" || moveForward === true) {\n idx += 1;\n next();\n } else if (done) {\n done(context);\n }\n });\n }\n })();\n}\n\nQ.if = function (condition: Function, one, two) {\n if (!Array.isArray(one)) one = [one];\n if (!Array.isArray(two)) two = [two];\n return [condition, one, two];\n};\n","import { QContext } from \"../../index\";\nimport { getCurrentEnvURL } from \"../utils\";\n\nexport default function setLocationPath(context: QContext, done) {\n if (typeof context.currentLocationPath === \"undefined\") {\n context.currentLocationPath = context.to = getCurrentEnvURL(\n context.instance.root\n );\n }\n context.currentLocationPath = context.instance._checkForAHash(\n context.currentLocationPath\n );\n done();\n}\n","import { matchRoute } from \"../utils\";\nimport { QContext, Match } from \"../../index\";\n\nexport default function matchPathToRegisteredRoutes(context: QContext, done) {\n for (let i = 0; i < context.instance.routes.length; i++) {\n const route = context.instance.routes[i];\n const match: false | Match = matchRoute(context, route);\n if (match) {\n if (!context.matches) context.matches = [];\n context.matches.push(match);\n if (context.resolveOptions.strategy === \"ONE\") {\n done();\n return;\n }\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForDeprecationMethods(context: QContext, done) {\n if (context.navigateOptions) {\n if (typeof context.navigateOptions[\"shouldResolve\"] !== \"undefined\") {\n console.warn(\n `\"shouldResolve\" is deprecated. Please check the documentation.`\n );\n }\n if (typeof context.navigateOptions[\"silent\"] !== \"undefined\") {\n console.warn(`\"silent\" is deprecated. Please check the documentation.`);\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForForceOp(context: QContext, done) {\n if (context.navigateOptions.force === true) {\n context.instance._setCurrent([\n context.instance._pathToMatchObject(context.to),\n ]);\n done(false);\n } else {\n done();\n }\n}\n","import { undefinedOrTrue, pushStateAvailable, windowAvailable } from \"../utils\";\nimport { QContext } from \"../../index\";\n\nconst isWindowAvailable = windowAvailable();\nconst isPushStateAvailable = pushStateAvailable();\n\nexport default function updateBrowserURL(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateBrowserURL\")) {\n const value = `/${context.to}`.replace(/\\/\\//g, \"/\"); // making sure that we don't have two slashes\n const isItUsingHash =\n isWindowAvailable &&\n context.resolveOptions &&\n context.resolveOptions.hash === true;\n if (isPushStateAvailable) {\n history[context.navigateOptions.historyAPIMethod || \"pushState\"](\n context.navigateOptions.stateObj || {},\n context.navigateOptions.title || \"\",\n isItUsingHash ? `#${value}` : value\n );\n // This is to solve a nasty bug where the page doesn't scroll to the anchor.\n // We set a microtask to update the hash only.\n if (location && location.hash) {\n context.instance.__freezeListening = true;\n setTimeout(() => {\n let tmp = location.hash;\n location.hash = \"\";\n location.hash = tmp;\n context.instance.__freezeListening = false;\n }, 1);\n }\n } else if (isWindowAvailable) {\n window.location.href = context.to;\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForLeaveHook(context: QContext, done) {\n const instance = context.instance;\n if (!instance.lastResolved()) {\n done();\n return;\n }\n Q(\n instance.lastResolved().map((oldMatch) => {\n return (_, leaveLoopDone) => {\n // no leave hook\n if (!oldMatch.route.hooks || !oldMatch.route.hooks.leave) {\n leaveLoopDone();\n return;\n }\n let runHook = false;\n const newLocationVSOldMatch = context.instance.matchLocation(\n oldMatch.route.path,\n context.currentLocationPath,\n false\n );\n if (oldMatch.route.path !== \"*\") {\n runHook = !newLocationVSOldMatch;\n } else {\n const someOfTheLastOnesMatch = context.matches\n ? context.matches.find((match) => {\n return oldMatch.route.path === match.route.path;\n })\n : false;\n runHook = !someOfTheLastOnesMatch;\n }\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\") && runHook) {\n Q(\n oldMatch.route.hooks.leave\n .map((f) => {\n // just so we match the Q interface\n return (_, d) =>\n f(\n (shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n },\n context.matches && context.matches.length > 0\n ? context.matches.length === 1\n ? context.matches[0]\n : context.matches\n : undefined\n );\n })\n .concat([() => leaveLoopDone()])\n );\n return;\n } else {\n leaveLoopDone();\n }\n };\n }),\n {},\n () => done()\n );\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function updateState(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateState\")) {\n context.instance._setCurrent(context.matches);\n }\n done();\n}\n","import { QContext } from \"../index\";\nimport Q from \"./Q\";\nimport checkForLeaveHook from \"./middlewares/checkForLeaveHook\";\nimport checkForBeforeHook from \"./middlewares/checkForBeforeHook\";\nimport callHandler from \"./middlewares/callHandler\";\nimport checkForAfterHook from \"./middlewares/checkForAfterHook\";\nimport checkForAlreadyHook from \"./middlewares/checkForAlreadyHook\";\nimport checkForNotFoundHandler from \"./middlewares/checkForNotFoundHandler\";\nimport errorOut from \"./middlewares/errorOut\";\nimport flushCurrent from \"./middlewares/flushCurrent\";\nimport updateState from \"./middlewares/updateState\";\n\nexport const foundLifecycle = [\n checkForAlreadyHook,\n checkForBeforeHook,\n callHandler,\n checkForAfterHook,\n];\n\nexport const notFoundLifeCycle = [\n checkForLeaveHook,\n checkForNotFoundHandler,\n Q.if(\n ({ notFoundHandled }: QContext) => notFoundHandled,\n foundLifecycle.concat([updateState]),\n [errorOut, flushCurrent]\n ),\n];\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAlreadyHook(context: QContext, done) {\n const current = context.instance.lastResolved();\n if (\n current &&\n current[0] &&\n current[0].route === context.match.route &&\n current[0].url === context.match.url &&\n current[0].queryString === context.match.queryString\n ) {\n current.forEach((c) => {\n if (c.route.hooks && c.route.hooks.already) {\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\")) {\n c.route.hooks.already.forEach((f) => f(context.match));\n }\n }\n });\n done(false);\n return;\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForBeforeHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.before &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n Q(\n context.match.route.hooks.before\n .map((f) => {\n // just so we match the Q interface\n return function beforeHookInternal(_, d) {\n return f((shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n }, context.match);\n };\n })\n .concat([() => done()])\n );\n } else {\n done();\n }\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function callHandler(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"callHandler\")) {\n context.match.route.handler(context.match);\n }\n context.instance.updatePageLinks();\n done();\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAfterHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.after &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n context.match.route.hooks.after.forEach((f) => f(context.match));\n }\n done();\n}\n","import { QContext, Match } from \"../../index\";\nimport {\n parseQuery,\n extractGETParameters,\n clean,\n extractHashFromURL,\n} from \"../utils\";\n\nexport default function checkForNotFoundHandler(context: QContext, done) {\n const notFoundRoute = context.instance._notFoundRoute;\n if (notFoundRoute) {\n context.notFoundHandled = true;\n const [url, queryString] = extractGETParameters(\n context.currentLocationPath\n );\n const hashString = extractHashFromURL(context.to);\n notFoundRoute.path = clean(url);\n const notFoundMatch: Match = {\n url: notFoundRoute.path,\n queryString,\n hashString,\n data: null,\n route: notFoundRoute,\n params: queryString !== \"\" ? parseQuery(queryString) : null,\n };\n context.matches = [notFoundMatch];\n context.match = notFoundMatch;\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function errorOut(context: QContext, done) {\n if (\n !context.resolveOptions ||\n context.resolveOptions.noMatchWarning === false ||\n typeof context.resolveOptions.noMatchWarning === \"undefined\"\n )\n console.warn(\n `Navigo: \"${context.currentLocationPath}\" didn't match any of the registered routes.`\n );\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function flushCurrent(context: QContext, done) {\n context.instance._setCurrent(null);\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { foundLifecycle } from \"../lifecycles\";\nimport updateState from \"./updateState\";\nimport checkForLeaveHook from \"./checkForLeaveHook\";\n\nexport default function processMatches(context: QContext, done) {\n let idx = 0;\n function nextMatch() {\n if (idx === context.matches.length) {\n updateState(context, done);\n return;\n }\n Q(\n foundLifecycle,\n { ...context, match: context.matches[idx] },\n function end() {\n idx += 1;\n nextMatch();\n }\n );\n }\n checkForLeaveHook(context, nextMatch);\n}\n","import { QContext } from \"../../index\";\n\nexport default function waitingList(context: QContext) {\n context.instance.__markAsClean(context);\n}\n","import {\n Match,\n Route,\n RouteHooks,\n QContext,\n NavigateOptions,\n ResolveOptions,\n GenerateOptions,\n Handler,\n RouterOptions,\n} from \"../index\";\nimport NavigoRouter from \"../index\";\nimport {\n pushStateAvailable,\n matchRoute,\n parseQuery,\n extractGETParameters,\n isFunction,\n isString,\n clean,\n parseNavigateOptions,\n windowAvailable,\n getCurrentEnvURL,\n accumulateHooks,\n extractHashFromURL,\n} from \"./utils\";\nimport Q from \"./Q\";\nimport setLocationPath from \"./middlewares/setLocationPath\";\nimport matchPathToRegisteredRoutes from \"./middlewares/matchPathToRegisteredRoutes\";\nimport checkForDeprecationMethods from \"./middlewares/checkForDeprecationMethods\";\nimport checkForForceOp from \"./middlewares/checkForForceOp\";\nimport updateBrowserURL from \"./middlewares/updateBrowserURL\";\nimport processMatches from \"./middlewares/processMatches\";\nimport waitingList from \"./middlewares/waitingList\";\n\nimport { notFoundLifeCycle } from \"./lifecycles\";\n\nconst DEFAULT_LINK_SELECTOR = \"[data-navigo]\";\n\nexport default function Navigo(appRoute?: string, options?: RouterOptions) {\n let DEFAULT_RESOLVE_OPTIONS: RouterOptions = options || {\n strategy: \"ONE\",\n hash: false,\n noMatchWarning: false,\n linksSelector: DEFAULT_LINK_SELECTOR,\n };\n let self: NavigoRouter = this;\n let root = \"/\";\n let current: Match[] = null;\n let routes: Route[] = [];\n let destroyed = false;\n let genericHooks: RouteHooks;\n\n const isPushStateAvailable = pushStateAvailable();\n const isWindowAvailable = windowAvailable();\n\n if (!appRoute) {\n console.warn(\n 'Navigo requires a root path in its constructor. If not provided will use \"/\" as default.'\n );\n } else {\n root = clean(appRoute);\n }\n\n function _checkForAHash(url: string): string {\n if (url.indexOf(\"#\") >= 0) {\n if (DEFAULT_RESOLVE_OPTIONS.hash === true) {\n url = url.split(\"#\")[1] || \"/\";\n } else {\n url = url.split(\"#\")[0];\n }\n }\n return url;\n }\n function composePathWithRoot(path: string) {\n return clean(`${root}/${clean(path)}`);\n }\n function createRoute(\n path: string | RegExp,\n handler: Handler,\n hooks: RouteHooks[],\n name?: string\n ): Route {\n path = isString(path) ? composePathWithRoot(path as string) : path;\n return {\n name: name || clean(String(path)),\n path,\n handler,\n hooks: accumulateHooks(hooks),\n };\n }\n\n // public APIs\n function on(\n path: string | Function | Object | RegExp,\n handler?: Handler,\n hooks?: RouteHooks\n ) {\n if (typeof path === \"object\" && !(path instanceof RegExp)) {\n Object.keys(path).forEach((p) => {\n if (typeof path[p] === \"function\") {\n this.on(p, path[p]);\n } else {\n const { uses: handler, as: name, hooks } = path[p];\n routes.push(createRoute(p, handler, [genericHooks, hooks], name));\n }\n });\n return this;\n } else if (typeof path === \"function\") {\n hooks = handler as RouteHooks;\n handler = path as Handler;\n path = root;\n }\n routes.push(\n createRoute(path as string | RegExp, handler, [genericHooks, hooks])\n );\n return this;\n }\n function resolve(to?: string, options?: ResolveOptions): false | Match[] {\n if (self.__dirty) {\n self.__waiting.push(() => self.resolve(to, options));\n return;\n } else {\n self.__dirty = true;\n }\n to = to ? `${clean(root)}/${clean(to)}` : undefined;\n // console.log(\"-- resolve --> \" + to, self.__dirty);\n const context: QContext = {\n instance: self,\n to,\n currentLocationPath: to,\n navigateOptions: {},\n resolveOptions: { ...DEFAULT_RESOLVE_OPTIONS, ...options },\n };\n Q(\n [\n setLocationPath,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n ],\n context,\n waitingList\n );\n\n return context.matches ? context.matches : false;\n }\n function navigate(to: string, navigateOptions?: NavigateOptions): void {\n // console.log(\"-- navigate --> \" + to, self.__dirty);\n if (self.__dirty) {\n self.__waiting.push(() => self.navigate(to, navigateOptions));\n return;\n } else {\n self.__dirty = true;\n }\n to = `${clean(root)}/${clean(to)}`;\n const context: QContext = {\n instance: self,\n to,\n navigateOptions: navigateOptions || {},\n resolveOptions:\n navigateOptions && navigateOptions.resolveOptions\n ? navigateOptions.resolveOptions\n : DEFAULT_RESOLVE_OPTIONS,\n currentLocationPath: _checkForAHash(to),\n };\n Q(\n [\n checkForDeprecationMethods,\n checkForForceOp,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n updateBrowserURL,\n waitingList,\n ],\n context,\n waitingList\n );\n }\n function navigateByName(\n name: string,\n data?: Object,\n options?: NavigateOptions\n ): boolean {\n const url = generate(name, data);\n if (url !== null) {\n navigate(url.replace(new RegExp(`^\\/?${root}`), \"\"), options);\n return true;\n }\n return false;\n }\n function off(what: string | RegExp | Function) {\n this.routes = routes = routes.filter((r) => {\n if (isString(what)) {\n return clean(r.path as string) !== clean(what as string);\n } else if (isFunction(what)) {\n return what !== r.handler;\n }\n return String(r.path) !== String(what);\n });\n return this;\n }\n function listen() {\n if (isPushStateAvailable) {\n this.__popstateListener = () => {\n if (!self.__freezeListening) {\n resolve();\n }\n };\n window.addEventListener(\"popstate\", this.__popstateListener);\n }\n }\n function destroy() {\n this.routes = routes = [];\n if (isPushStateAvailable) {\n window.removeEventListener(\"popstate\", this.__popstateListener);\n }\n this.destroyed = destroyed = true;\n }\n function notFound(handler, hooks?: RouteHooks) {\n self._notFoundRoute = createRoute(\n \"*\",\n handler,\n [genericHooks, hooks],\n \"__NOT_FOUND__\"\n );\n return this;\n }\n function updatePageLinks() {\n if (!isWindowAvailable) return;\n findLinks().forEach((link) => {\n if (\n \"false\" === link.getAttribute(\"data-navigo\") ||\n \"_blank\" === link.getAttribute(\"target\")\n ) {\n if (link.hasListenerAttached) {\n link.removeEventListener(\"click\", link.navigoHandler);\n }\n return;\n }\n if (!link.hasListenerAttached) {\n link.hasListenerAttached = true;\n link.navigoHandler = function (e) {\n if (\n (e.ctrlKey || e.metaKey) &&\n e.target.tagName.toLowerCase() === \"a\"\n ) {\n return false;\n }\n let location = link.getAttribute(\"href\");\n if (typeof location === \"undefined\" || location === null) {\n return false;\n }\n // handling absolute paths\n if (location.match(/^(http|https)/) && typeof URL !== \"undefined\") {\n try {\n const u = new URL(location);\n location = u.pathname + u.search;\n } catch (err) {}\n }\n const options = parseNavigateOptions(\n link.getAttribute(\"data-navigo-options\")\n );\n\n if (!destroyed) {\n e.preventDefault();\n e.stopPropagation();\n self.navigate(clean(location), options);\n }\n };\n link.addEventListener(\"click\", link.navigoHandler);\n }\n });\n return self;\n }\n function findLinks() {\n if (isWindowAvailable) {\n return [].slice.call(\n document.querySelectorAll(\n DEFAULT_RESOLVE_OPTIONS.linksSelector || DEFAULT_LINK_SELECTOR\n )\n );\n }\n return [];\n }\n function link(path: string) {\n return `/${root}/${clean(path)}`;\n }\n function setGenericHooks(hooks: RouteHooks) {\n genericHooks = hooks;\n return this;\n }\n function lastResolved(): Match[] | null {\n return current;\n }\n function generate(\n name: string,\n data?: Object,\n options?: GenerateOptions\n ): string {\n const route = routes.find((r) => r.name === name);\n let result = null;\n if (route) {\n result = route.path as string;\n if (data) {\n for (let key in data) {\n result = result.replace(\":\" + key, data[key]);\n }\n }\n result = !result.match(/^\\//) ? `/${result}` : result;\n }\n if (result && options && !options.includeRoot) {\n result = result.replace(new RegExp(`^/${root}`), \"\");\n }\n return result;\n }\n function getLinkPath(link) {\n return link.getAttribute(\"href\");\n }\n function pathToMatchObject(path: string): Match {\n const [url, queryString] = extractGETParameters(clean(path));\n const params = queryString === \"\" ? null : parseQuery(queryString);\n const hashString = extractHashFromURL(path);\n const route = createRoute(url, () => {}, [genericHooks], url);\n return {\n url,\n queryString,\n hashString,\n route,\n data: null,\n params: params,\n };\n }\n function getCurrentLocation(): Match {\n return pathToMatchObject(\n clean(getCurrentEnvURL(root)).replace(new RegExp(`^${root}`), \"\")\n );\n }\n function directMatchWithRegisteredRoutes(path: string): false | Match[] {\n const context: QContext = {\n instance: self,\n currentLocationPath: path,\n to: path,\n navigateOptions: {},\n resolveOptions: DEFAULT_RESOLVE_OPTIONS,\n };\n matchPathToRegisteredRoutes(context, () => {});\n return context.matches ? context.matches : false;\n }\n function directMatchWithLocation(\n path: string | RegExp,\n currentLocation?: string,\n annotatePathWithRoot?: boolean\n ): false | Match {\n if (\n typeof currentLocation !== \"undefined\" &&\n (typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot)\n ) {\n currentLocation = composePathWithRoot(currentLocation);\n }\n const context: QContext = {\n instance: self,\n to: currentLocation,\n currentLocationPath: currentLocation,\n };\n setLocationPath(context, () => {});\n if (typeof path === \"string\") {\n path =\n typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot\n ? composePathWithRoot(path)\n : path;\n }\n const match = matchRoute(context, {\n name: String(path),\n path,\n handler: () => {},\n hooks: {},\n });\n return match ? match : false;\n }\n function addHook(\n type: string,\n route: Route | string,\n func: Function\n ): Function {\n if (typeof route === \"string\") {\n route = getRoute(route);\n }\n if (route) {\n if (!route.hooks[type]) route.hooks[type] = [];\n route.hooks[type].push(func);\n return () => {\n (route as Route).hooks[type] = (route as Route).hooks[type].filter(\n (f) => f !== func\n );\n };\n } else {\n console.warn(`Route doesn't exists: ${route}`);\n }\n return () => {};\n }\n function getRoute(nameOrHandler: string | Function): Route | undefined {\n if (typeof nameOrHandler === \"string\") {\n return routes.find((r) => r.name === composePathWithRoot(nameOrHandler));\n }\n return routes.find((r) => r.handler === nameOrHandler);\n }\n function __markAsClean(context: QContext) {\n context.instance.__dirty = false;\n if (context.instance.__waiting.length > 0) {\n context.instance.__waiting.shift()();\n }\n }\n\n this.root = root;\n this.routes = routes;\n this.destroyed = destroyed;\n this.current = current;\n this.__freezeListening = false;\n this.__waiting = [];\n this.__dirty = false;\n this.__markAsClean = __markAsClean;\n\n this.on = on;\n this.off = off;\n this.resolve = resolve;\n this.navigate = navigate;\n this.navigateByName = navigateByName;\n this.destroy = destroy;\n this.notFound = notFound;\n this.updatePageLinks = updatePageLinks;\n this.link = link;\n this.hooks = setGenericHooks;\n this.extractGETParameters = (url) =>\n extractGETParameters(_checkForAHash(url));\n this.lastResolved = lastResolved;\n this.generate = generate;\n this.getLinkPath = getLinkPath;\n this.match = directMatchWithRegisteredRoutes;\n this.matchLocation = directMatchWithLocation;\n this.getCurrentLocation = getCurrentLocation;\n this.addBeforeHook = addHook.bind(this, \"before\");\n this.addAfterHook = addHook.bind(this, \"after\");\n this.addAlreadyHook = addHook.bind(this, \"already\");\n this.addLeaveHook = addHook.bind(this, \"leave\");\n this.getRoute = getRoute;\n this._pathToMatchObject = pathToMatchObject;\n this._clean = clean;\n this._checkForAHash = _checkForAHash;\n this._setCurrent = (c) => (current = self.current = c);\n\n listen.call(this);\n updatePageLinks.call(this);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// module exports must be returned from runtime so entry inlining is disabled\n// startup\n// Load entry module and return exports\nreturn __webpack_require__(407);\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/navigo.js b/lib/navigo.js index 11752f0f..d24b0826 100644 --- a/lib/navigo.js +++ b/lib/navigo.js @@ -8,7 +8,7 @@ else root["Navigo"] = factory(); })(typeof self !== 'undefined' ? self : this, function() { -return /******/ (() => { // webpackBootstrap +return /******/ (function() { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ @@ -16,11 +16,11 @@ return /******/ (() => { // webpackBootstrap /*!******************!*\ !*** ./src/Q.ts ***! \******************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ Q +/* harmony export */ "default": function() { return /* binding */ Q; } /* harmony export */ }); function Q(funcs, c, done) { var context = c || {}; @@ -65,18 +65,18 @@ Q.if = function (condition, one, two) { /*!**************************!*\ !*** ./src/constants.ts ***! \**************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "PARAMETER_REGEXP": () => /* binding */ PARAMETER_REGEXP, -/* harmony export */ "REPLACE_VARIABLE_REGEXP": () => /* binding */ REPLACE_VARIABLE_REGEXP, -/* harmony export */ "WILDCARD_REGEXP": () => /* binding */ WILDCARD_REGEXP, -/* harmony export */ "REPLACE_WILDCARD": () => /* binding */ REPLACE_WILDCARD, -/* harmony export */ "NOT_SURE_REGEXP": () => /* binding */ NOT_SURE_REGEXP, -/* harmony export */ "REPLACE_NOT_SURE": () => /* binding */ REPLACE_NOT_SURE, -/* harmony export */ "START_BY_SLASH_REGEXP": () => /* binding */ START_BY_SLASH_REGEXP, -/* harmony export */ "MATCH_REGEXP_FLAGS": () => /* binding */ MATCH_REGEXP_FLAGS +/* harmony export */ "PARAMETER_REGEXP": function() { return /* binding */ PARAMETER_REGEXP; }, +/* harmony export */ "REPLACE_VARIABLE_REGEXP": function() { return /* binding */ REPLACE_VARIABLE_REGEXP; }, +/* harmony export */ "WILDCARD_REGEXP": function() { return /* binding */ WILDCARD_REGEXP; }, +/* harmony export */ "REPLACE_WILDCARD": function() { return /* binding */ REPLACE_WILDCARD; }, +/* harmony export */ "NOT_SURE_REGEXP": function() { return /* binding */ NOT_SURE_REGEXP; }, +/* harmony export */ "REPLACE_NOT_SURE": function() { return /* binding */ REPLACE_NOT_SURE; }, +/* harmony export */ "START_BY_SLASH_REGEXP": function() { return /* binding */ START_BY_SLASH_REGEXP; }, +/* harmony export */ "MATCH_REGEXP_FLAGS": function() { return /* binding */ MATCH_REGEXP_FLAGS; } /* harmony export */ }); var PARAMETER_REGEXP = /([:*])(\w+)/g; var REPLACE_VARIABLE_REGEXP = "([^/]+)"; @@ -93,11 +93,11 @@ var MATCH_REGEXP_FLAGS = ""; /*!**********************!*\ !*** ./src/index.ts ***! \**********************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ Navigo +/* harmony export */ "default": function() { return /* binding */ Navigo; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./src/utils.ts"); /* harmony import */ var _Q__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Q */ "./src/Q.ts"); @@ -550,12 +550,12 @@ function Navigo(appRoute, options) { /*!***************************!*\ !*** ./src/lifecycles.ts ***! \***************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "foundLifecycle": () => /* binding */ foundLifecycle, -/* harmony export */ "notFoundLifeCycle": () => /* binding */ notFoundLifeCycle +/* harmony export */ "foundLifecycle": function() { return /* binding */ foundLifecycle; }, +/* harmony export */ "notFoundLifeCycle": function() { return /* binding */ notFoundLifeCycle; } /* harmony export */ }); /* harmony import */ var _Q__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Q */ "./src/Q.ts"); /* harmony import */ var _middlewares_checkForLeaveHook__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./middlewares/checkForLeaveHook */ "./src/middlewares/checkForLeaveHook.ts"); @@ -589,11 +589,11 @@ var notFoundLifeCycle = [_middlewares_checkForLeaveHook__WEBPACK_IMPORTED_MODULE /*!****************************************!*\ !*** ./src/middlewares/callHandler.ts ***! \****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ callHandler +/* harmony export */ "default": function() { return /* binding */ callHandler; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -612,11 +612,11 @@ function callHandler(context, done) { /*!**********************************************!*\ !*** ./src/middlewares/checkForAfterHook.ts ***! \**********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ checkForAfterHook +/* harmony export */ "default": function() { return /* binding */ checkForAfterHook; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -636,11 +636,11 @@ function checkForAfterHook(context, done) { /*!************************************************!*\ !*** ./src/middlewares/checkForAlreadyHook.ts ***! \************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ checkForAlreadyHook +/* harmony export */ "default": function() { return /* binding */ checkForAlreadyHook; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -670,11 +670,11 @@ function checkForAlreadyHook(context, done) { /*!***********************************************!*\ !*** ./src/middlewares/checkForBeforeHook.ts ***! \***********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ checkForBeforeHook +/* harmony export */ "default": function() { return /* binding */ checkForBeforeHook; } /* harmony export */ }); /* harmony import */ var _Q__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Q */ "./src/Q.ts"); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -707,11 +707,11 @@ function checkForBeforeHook(context, done) { /*!*******************************************************!*\ !*** ./src/middlewares/checkForDeprecationMethods.ts ***! \*******************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ checkForDeprecationMethods +/* harmony export */ "default": function() { return /* binding */ checkForDeprecationMethods; } /* harmony export */ }); function checkForDeprecationMethods(context, done) { if (context.navigateOptions) { @@ -733,11 +733,11 @@ function checkForDeprecationMethods(context, done) { /*!********************************************!*\ !*** ./src/middlewares/checkForForceOp.ts ***! \********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ checkForForceOp +/* harmony export */ "default": function() { return /* binding */ checkForForceOp; } /* harmony export */ }); function checkForForceOp(context, done) { if (context.navigateOptions.force === true) { @@ -755,11 +755,11 @@ function checkForForceOp(context, done) { /*!**********************************************!*\ !*** ./src/middlewares/checkForLeaveHook.ts ***! \**********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ checkForLeaveHook +/* harmony export */ "default": function() { return /* binding */ checkForLeaveHook; } /* harmony export */ }); /* harmony import */ var _Q__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Q */ "./src/Q.ts"); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -824,11 +824,11 @@ function checkForLeaveHook(context, done) { /*!****************************************************!*\ !*** ./src/middlewares/checkForNotFoundHandler.ts ***! \****************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ checkForNotFoundHandler +/* harmony export */ "default": function() { return /* binding */ checkForNotFoundHandler; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -865,11 +865,11 @@ function checkForNotFoundHandler(context, done) { /*!*************************************!*\ !*** ./src/middlewares/errorOut.ts ***! \*************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ errorOut +/* harmony export */ "default": function() { return /* binding */ errorOut; } /* harmony export */ }); function errorOut(context, done) { if (!context.resolveOptions || context.resolveOptions.noMatchWarning === false || typeof context.resolveOptions.noMatchWarning === "undefined") console.warn("Navigo: \"" + context.currentLocationPath + "\" didn't match any of the registered routes."); @@ -882,11 +882,11 @@ function errorOut(context, done) { /*!*****************************************!*\ !*** ./src/middlewares/flushCurrent.ts ***! \*****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ flushCurrent +/* harmony export */ "default": function() { return /* binding */ flushCurrent; } /* harmony export */ }); function flushCurrent(context, done) { context.instance._setCurrent(null); @@ -900,11 +900,11 @@ function flushCurrent(context, done) { /*!********************************************************!*\ !*** ./src/middlewares/matchPathToRegisteredRoutes.ts ***! \********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ matchPathToRegisteredRoutes +/* harmony export */ "default": function() { return /* binding */ matchPathToRegisteredRoutes; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -933,11 +933,11 @@ function matchPathToRegisteredRoutes(context, done) { /*!*******************************************!*\ !*** ./src/middlewares/processMatches.ts ***! \*******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ processMatches +/* harmony export */ "default": function() { return /* binding */ processMatches; } /* harmony export */ }); /* harmony import */ var _Q__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Q */ "./src/Q.ts"); /* harmony import */ var _lifecycles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lifecycles */ "./src/lifecycles.ts"); @@ -975,11 +975,11 @@ function processMatches(context, done) { /*!********************************************!*\ !*** ./src/middlewares/setLocationPath.ts ***! \********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ setLocationPath +/* harmony export */ "default": function() { return /* binding */ setLocationPath; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -998,11 +998,11 @@ function setLocationPath(context, done) { /*!*********************************************!*\ !*** ./src/middlewares/updateBrowserURL.ts ***! \*********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ updateBrowserURL +/* harmony export */ "default": function() { return /* binding */ updateBrowserURL; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -1041,11 +1041,11 @@ function updateBrowserURL(context, done) { /*!****************************************!*\ !*** ./src/middlewares/updateState.ts ***! \****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ updateState +/* harmony export */ "default": function() { return /* binding */ updateState; } /* harmony export */ }); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); @@ -1063,11 +1063,11 @@ function updateState(context, done) { /*!****************************************!*\ !*** ./src/middlewares/waitingList.ts ***! \****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => /* binding */ waitingList +/* harmony export */ "default": function() { return /* binding */ waitingList; } /* harmony export */ }); function waitingList(context) { context.instance.__markAsClean(context); @@ -1079,24 +1079,24 @@ function waitingList(context) { /*!**********************!*\ !*** ./src/utils.ts ***! \**********************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "getCurrentEnvURL": () => /* binding */ getCurrentEnvURL, -/* harmony export */ "clean": () => /* binding */ clean, -/* harmony export */ "isString": () => /* binding */ isString, -/* harmony export */ "isFunction": () => /* binding */ isFunction, -/* harmony export */ "extractHashFromURL": () => /* binding */ extractHashFromURL, -/* harmony export */ "regExpResultToParams": () => /* binding */ regExpResultToParams, -/* harmony export */ "extractGETParameters": () => /* binding */ extractGETParameters, -/* harmony export */ "parseQuery": () => /* binding */ parseQuery, -/* harmony export */ "matchRoute": () => /* binding */ matchRoute, -/* harmony export */ "pushStateAvailable": () => /* binding */ pushStateAvailable, -/* harmony export */ "undefinedOrTrue": () => /* binding */ undefinedOrTrue, -/* harmony export */ "parseNavigateOptions": () => /* binding */ parseNavigateOptions, -/* harmony export */ "windowAvailable": () => /* binding */ windowAvailable, -/* harmony export */ "accumulateHooks": () => /* binding */ accumulateHooks +/* harmony export */ "getCurrentEnvURL": function() { return /* binding */ getCurrentEnvURL; }, +/* harmony export */ "clean": function() { return /* binding */ clean; }, +/* harmony export */ "isString": function() { return /* binding */ isString; }, +/* harmony export */ "isFunction": function() { return /* binding */ isFunction; }, +/* harmony export */ "extractHashFromURL": function() { return /* binding */ extractHashFromURL; }, +/* harmony export */ "regExpResultToParams": function() { return /* binding */ regExpResultToParams; }, +/* harmony export */ "extractGETParameters": function() { return /* binding */ extractGETParameters; }, +/* harmony export */ "parseQuery": function() { return /* binding */ parseQuery; }, +/* harmony export */ "matchRoute": function() { return /* binding */ matchRoute; }, +/* harmony export */ "pushStateAvailable": function() { return /* binding */ pushStateAvailable; }, +/* harmony export */ "undefinedOrTrue": function() { return /* binding */ undefinedOrTrue; }, +/* harmony export */ "parseNavigateOptions": function() { return /* binding */ parseNavigateOptions; }, +/* harmony export */ "windowAvailable": function() { return /* binding */ windowAvailable; }, +/* harmony export */ "accumulateHooks": function() { return /* binding */ accumulateHooks; } /* harmony export */ }); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./src/constants.ts"); @@ -1309,32 +1309,32 @@ function accumulateHooks(hooks, result) { /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ -/******/ (() => { +/******/ !function() { /******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { +/******/ __webpack_require__.d = function(exports, definition) { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; -/******/ })(); +/******/ }(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) -/******/ })(); +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); /******/ /******/ /* webpack/runtime/make namespace object */ -/******/ (() => { +/******/ !function() { /******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { +/******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; -/******/ })(); +/******/ }(); /******/ /************************************************************************/ /******/ // module exports must be returned from runtime so entry inlining is disabled diff --git a/lib/navigo.js.map b/lib/navigo.js.map index 181e4568..3a4da424 100644 --- a/lib/navigo.js.map +++ b/lib/navigo.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://Navigo/webpack/universalModuleDefinition","webpack://Navigo/./src/Q.ts","webpack://Navigo/./src/constants.ts","webpack://Navigo/./src/index.ts","webpack://Navigo/./src/lifecycles.ts","webpack://Navigo/./src/middlewares/callHandler.ts","webpack://Navigo/./src/middlewares/checkForAfterHook.ts","webpack://Navigo/./src/middlewares/checkForAlreadyHook.ts","webpack://Navigo/./src/middlewares/checkForBeforeHook.ts","webpack://Navigo/./src/middlewares/checkForDeprecationMethods.ts","webpack://Navigo/./src/middlewares/checkForForceOp.ts","webpack://Navigo/./src/middlewares/checkForLeaveHook.ts","webpack://Navigo/./src/middlewares/checkForNotFoundHandler.ts","webpack://Navigo/./src/middlewares/errorOut.ts","webpack://Navigo/./src/middlewares/flushCurrent.ts","webpack://Navigo/./src/middlewares/matchPathToRegisteredRoutes.ts","webpack://Navigo/./src/middlewares/processMatches.ts","webpack://Navigo/./src/middlewares/setLocationPath.ts","webpack://Navigo/./src/middlewares/updateBrowserURL.ts","webpack://Navigo/./src/middlewares/updateState.ts","webpack://Navigo/./src/middlewares/waitingList.ts","webpack://Navigo/./src/utils.ts","webpack://Navigo/webpack/bootstrap","webpack://Navigo/webpack/runtime/define property getters","webpack://Navigo/webpack/runtime/hasOwnProperty shorthand","webpack://Navigo/webpack/runtime/make namespace object","webpack://Navigo/webpack/startup"],"names":["Q","funcs","c","done","context","idx","next","Array","isArray","splice","moveForward","if","condition","one","two","PARAMETER_REGEXP","REPLACE_VARIABLE_REGEXP","WILDCARD_REGEXP","REPLACE_WILDCARD","NOT_SURE_REGEXP","REPLACE_NOT_SURE","START_BY_SLASH_REGEXP","MATCH_REGEXP_FLAGS","DEFAULT_LINK_SELECTOR","Navigo","appRoute","options","DEFAULT_RESOLVE_OPTIONS","strategy","hash","noMatchWarning","linksSelector","self","root","current","routes","destroyed","genericHooks","isPushStateAvailable","pushStateAvailable","isWindowAvailable","windowAvailable","console","warn","clean","_checkForAHash","url","indexOf","split","composePathWithRoot","path","createRoute","handler","hooks","name","isString","String","accumulateHooks","on","RegExp","Object","keys","forEach","p","uses","as","push","resolve","to","__dirty","__waiting","undefined","instance","currentLocationPath","navigateOptions","resolveOptions","setLocationPath","matchPathToRegisteredRoutes","matches","length","processMatches","notFoundLifeCycle","waitingList","navigate","checkForDeprecationMethods","checkForForceOp","updateBrowserURL","navigateByName","data","generate","replace","off","what","filter","r","isFunction","listen","__popstateListener","__freezeListening","window","addEventListener","destroy","removeEventListener","notFound","_notFoundRoute","updatePageLinks","findLinks","link","getAttribute","hasListenerAttached","navigoHandler","e","ctrlKey","metaKey","target","tagName","toLowerCase","location","match","URL","u","pathname","search","err","parseNavigateOptions","preventDefault","stopPropagation","slice","call","document","querySelectorAll","setGenericHooks","lastResolved","route","find","result","key","includeRoot","getLinkPath","pathToMatchObject","extractGETParameters","queryString","params","parseQuery","hashString","extractHashFromURL","getCurrentLocation","getCurrentEnvURL","directMatchWithRegisteredRoutes","directMatchWithLocation","currentLocation","annotatePathWithRoot","matchRoute","addHook","type","func","getRoute","f","nameOrHandler","__markAsClean","shift","matchLocation","addBeforeHook","bind","addAfterHook","addAlreadyHook","addLeaveHook","_pathToMatchObject","_clean","_setCurrent","foundLifecycle","checkForAlreadyHook","checkForBeforeHook","callHandler","checkForAfterHook","checkForLeaveHook","checkForNotFoundHandler","notFoundHandled","concat","updateState","errorOut","flushCurrent","undefinedOrTrue","after","already","before","map","beforeHookInternal","_","d","shouldStop","force","oldMatch","leaveLoopDone","leave","runHook","newLocationVSOldMatch","someOfTheLastOnesMatch","notFoundRoute","notFoundMatch","i","nextMatch","end","value","isItUsingHash","history","historyAPIMethod","stateObj","title","setTimeout","tmp","href","fallback","s","pop","regExpResultToParams","names","reduce","index","decodeURIComponent","join","query","pairs","pair","GETParams","paramNames","pattern","full","dots","regexp","groups","pushState","obj","source","str","temp","v","h"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;ACLe,SAASA,CAAT,CACbC,KADa,EAEbC,CAFa,EAGbC,IAHa,EAIb;AACA,MAAMC,OAAO,GAAGF,CAAC,IAAI,EAArB;AACA,MAAIG,GAAG,GAAG,CAAV;;AAEA,GAAC,SAASC,IAAT,GAAgB;AACf,QAAI,CAACL,KAAK,CAACI,GAAD,CAAV,EAAiB;AACf,UAAIF,IAAJ,EAAU;AACRA,YAAI,CAACC,OAAD,CAAJ;AACD;;AACD;AACD;;AACD,QAAIG,KAAK,CAACC,OAAN,CAAcP,KAAK,CAACI,GAAD,CA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CAACnF,IAAD,CAAL,EAAa;AACX,YAAI,CAACnB,MAAM,CAACmB,IAAD,CAAX,EAAmBnB,MAAM,CAACmB,IAAD,CAAN,GAAe,EAAf;AACnBnB,cAAM,CAACmB,IAAD,CAAN,CAAaxF,IAAb,CAAkB2K,CAAC,CAACnF,IAAD,CAAnB;AACD;AACF,KALD;AAMD,GATH;AAUA,SAAOnB,MAAP;AACD,C;;;;;;UC1LD;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCrBA;WACA;WACA;WACA;WACA,wCAAwC,yCAAyC;WACjF;WACA;WACA,E;;;;;WCPA,sF;;;;;WCAA;WACA;WACA;WACA,sDAAsD,kBAAkB;WACxE;WACA,+CAA+C,cAAc;WAC7D,E;;;;UCNA;UACA;UACA;UACA","file":"navigo.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Navigo\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Navigo\"] = factory();\n\telse\n\t\troot[\"Navigo\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn ","type QChild = {\n type: \"child\";\n funcs: Array | QChild>;\n};\n\nexport default function Q(\n funcs: Array | QChild>,\n c?: any,\n done?: Function\n) {\n const context = c || {};\n let idx = 0;\n\n (function next() {\n if (!funcs[idx]) {\n if (done) {\n done(context);\n }\n return;\n }\n if (Array.isArray(funcs[idx])) {\n funcs.splice(\n idx,\n 1,\n ...(funcs[idx][0](context) ? funcs[idx][1] : funcs[idx][2])\n );\n next();\n } else {\n // console.log(funcs[idx].name + \" / \" + JSON.stringify(context));\n // console.log(funcs[idx].name);\n (funcs[idx] as Function)(context, (moveForward) => {\n if (typeof moveForward === \"undefined\" || moveForward === true) {\n idx += 1;\n next();\n } else if (done) {\n done(context);\n }\n });\n }\n })();\n}\n\nQ.if = function (condition: Function, one, two) {\n if (!Array.isArray(one)) one = [one];\n if (!Array.isArray(two)) two = [two];\n return [condition, one, two];\n};\n","export const PARAMETER_REGEXP = /([:*])(\\w+)/g;\nexport const REPLACE_VARIABLE_REGEXP = \"([^/]+)\";\nexport const WILDCARD_REGEXP = /\\*/g;\nexport const REPLACE_WILDCARD = \"?(?:.*)\";\nexport const NOT_SURE_REGEXP = /\\/\\?/g;\nexport const REPLACE_NOT_SURE = \"/?([^/]+|)\";\nexport const START_BY_SLASH_REGEXP = \"(?:/^|^)\";\nexport const MATCH_REGEXP_FLAGS = \"\";\n","import {\n Match,\n Route,\n RouteHooks,\n QContext,\n NavigateOptions,\n ResolveOptions,\n GenerateOptions,\n Handler,\n RouterOptions,\n} from \"../index\";\nimport NavigoRouter from \"../index\";\nimport {\n pushStateAvailable,\n matchRoute,\n parseQuery,\n extractGETParameters,\n isFunction,\n isString,\n clean,\n parseNavigateOptions,\n windowAvailable,\n getCurrentEnvURL,\n accumulateHooks,\n extractHashFromURL,\n} from \"./utils\";\nimport Q from \"./Q\";\nimport setLocationPath from \"./middlewares/setLocationPath\";\nimport matchPathToRegisteredRoutes from \"./middlewares/matchPathToRegisteredRoutes\";\nimport checkForDeprecationMethods from \"./middlewares/checkForDeprecationMethods\";\nimport checkForForceOp from \"./middlewares/checkForForceOp\";\nimport updateBrowserURL from \"./middlewares/updateBrowserURL\";\nimport processMatches from \"./middlewares/processMatches\";\nimport waitingList from \"./middlewares/waitingList\";\n\nimport { notFoundLifeCycle } from \"./lifecycles\";\n\nconst DEFAULT_LINK_SELECTOR = \"[data-navigo]\";\n\nexport default function Navigo(appRoute?: string, options?: RouterOptions) {\n let DEFAULT_RESOLVE_OPTIONS: RouterOptions = options || {\n strategy: \"ONE\",\n hash: false,\n noMatchWarning: false,\n linksSelector: DEFAULT_LINK_SELECTOR,\n };\n let self: NavigoRouter = this;\n let root = \"/\";\n let current: Match[] = null;\n let routes: Route[] = [];\n let destroyed = false;\n let genericHooks: RouteHooks;\n\n const isPushStateAvailable = pushStateAvailable();\n const isWindowAvailable = windowAvailable();\n\n if (!appRoute) {\n console.warn(\n 'Navigo requires a root path in its constructor. If not provided will use \"/\" as default.'\n );\n } else {\n root = clean(appRoute);\n }\n\n function _checkForAHash(url: string): string {\n if (url.indexOf(\"#\") >= 0) {\n if (DEFAULT_RESOLVE_OPTIONS.hash === true) {\n url = url.split(\"#\")[1] || \"/\";\n } else {\n url = url.split(\"#\")[0];\n }\n }\n return url;\n }\n function composePathWithRoot(path: string) {\n return clean(`${root}/${clean(path)}`);\n }\n function createRoute(\n path: string | RegExp,\n handler: Handler,\n hooks: RouteHooks[],\n name?: string\n ): Route {\n path = isString(path) ? composePathWithRoot(path as string) : path;\n return {\n name: name || clean(String(path)),\n path,\n handler,\n hooks: accumulateHooks(hooks),\n };\n }\n\n // public APIs\n function on(\n path: string | Function | Object | RegExp,\n handler?: Handler,\n hooks?: RouteHooks\n ) {\n if (typeof path === \"object\" && !(path instanceof RegExp)) {\n Object.keys(path).forEach((p) => {\n if (typeof path[p] === \"function\") {\n this.on(p, path[p]);\n } else {\n const { uses: handler, as: name, hooks } = path[p];\n routes.push(createRoute(p, handler, [genericHooks, hooks], name));\n }\n });\n return this;\n } else if (typeof path === \"function\") {\n hooks = handler as RouteHooks;\n handler = path as Handler;\n path = root;\n }\n routes.push(\n createRoute(path as string | RegExp, handler, [genericHooks, hooks])\n );\n return this;\n }\n function resolve(to?: string, options?: ResolveOptions): false | Match[] {\n if (self.__dirty) {\n self.__waiting.push(() => self.resolve(to, options));\n return;\n } else {\n self.__dirty = true;\n }\n to = to ? `${clean(root)}/${clean(to)}` : undefined;\n // console.log(\"-- resolve --> \" + to, self.__dirty);\n const context: QContext = {\n instance: self,\n to,\n currentLocationPath: to,\n navigateOptions: {},\n resolveOptions: { ...DEFAULT_RESOLVE_OPTIONS, ...options },\n };\n Q(\n [\n setLocationPath,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n ],\n context,\n waitingList\n );\n\n return context.matches ? context.matches : false;\n }\n function navigate(to: string, navigateOptions?: NavigateOptions): void {\n // console.log(\"-- navigate --> \" + to, self.__dirty);\n if (self.__dirty) {\n self.__waiting.push(() => self.navigate(to, navigateOptions));\n return;\n } else {\n self.__dirty = true;\n }\n to = `${clean(root)}/${clean(to)}`;\n const context: QContext = {\n instance: self,\n to,\n navigateOptions: navigateOptions || {},\n resolveOptions:\n navigateOptions && navigateOptions.resolveOptions\n ? navigateOptions.resolveOptions\n : DEFAULT_RESOLVE_OPTIONS,\n currentLocationPath: _checkForAHash(to),\n };\n Q(\n [\n checkForDeprecationMethods,\n checkForForceOp,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n updateBrowserURL,\n waitingList,\n ],\n context,\n waitingList\n );\n }\n function navigateByName(\n name: string,\n data?: Object,\n options?: NavigateOptions\n ): boolean {\n const url = generate(name, data);\n if (url !== null) {\n navigate(url.replace(new RegExp(`^\\/?${root}`), \"\"), options);\n return true;\n }\n return false;\n }\n function off(what: string | RegExp | Function) {\n this.routes = routes = routes.filter((r) => {\n if (isString(what)) {\n return clean(r.path as string) !== clean(what as string);\n } else if (isFunction(what)) {\n return what !== r.handler;\n }\n return String(r.path) !== String(what);\n });\n return this;\n }\n function listen() {\n if (isPushStateAvailable) {\n this.__popstateListener = () => {\n if (!self.__freezeListening) {\n resolve();\n }\n };\n window.addEventListener(\"popstate\", this.__popstateListener);\n }\n }\n function destroy() {\n this.routes = routes = [];\n if (isPushStateAvailable) {\n window.removeEventListener(\"popstate\", this.__popstateListener);\n }\n this.destroyed = destroyed = true;\n }\n function notFound(handler, hooks?: RouteHooks) {\n self._notFoundRoute = createRoute(\n \"*\",\n handler,\n [genericHooks, hooks],\n \"__NOT_FOUND__\"\n );\n return this;\n }\n function updatePageLinks() {\n if (!isWindowAvailable) return;\n findLinks().forEach((link) => {\n if (\n \"false\" === link.getAttribute(\"data-navigo\") ||\n \"_blank\" === link.getAttribute(\"target\")\n ) {\n if (link.hasListenerAttached) {\n link.removeEventListener(\"click\", link.navigoHandler);\n }\n return;\n }\n if (!link.hasListenerAttached) {\n link.hasListenerAttached = true;\n link.navigoHandler = function (e) {\n if (\n (e.ctrlKey || e.metaKey) &&\n e.target.tagName.toLowerCase() === \"a\"\n ) {\n return false;\n }\n let location = link.getAttribute(\"href\");\n if (typeof location === \"undefined\" || location === null) {\n return false;\n }\n // handling absolute paths\n if (location.match(/^(http|https)/) && typeof URL !== \"undefined\") {\n try {\n const u = new URL(location);\n location = u.pathname + u.search;\n } catch (err) {}\n }\n const options = parseNavigateOptions(\n link.getAttribute(\"data-navigo-options\")\n );\n\n if (!destroyed) {\n e.preventDefault();\n e.stopPropagation();\n self.navigate(clean(location), options);\n }\n };\n link.addEventListener(\"click\", link.navigoHandler);\n }\n });\n return self;\n }\n function findLinks() {\n if (isWindowAvailable) {\n return [].slice.call(\n document.querySelectorAll(\n DEFAULT_RESOLVE_OPTIONS.linksSelector || DEFAULT_LINK_SELECTOR\n )\n );\n }\n return [];\n }\n function link(path: string) {\n return `/${root}/${clean(path)}`;\n }\n function setGenericHooks(hooks: RouteHooks) {\n genericHooks = hooks;\n return this;\n }\n function lastResolved(): Match[] | null {\n return current;\n }\n function generate(\n name: string,\n data?: Object,\n options?: GenerateOptions\n ): string {\n const route = routes.find((r) => r.name === name);\n let result = null;\n if (route) {\n result = route.path as string;\n if (data) {\n for (let key in data) {\n result = result.replace(\":\" + key, data[key]);\n }\n }\n result = !result.match(/^\\//) ? `/${result}` : result;\n }\n if (result && options && !options.includeRoot) {\n result = result.replace(new RegExp(`^/${root}`), \"\");\n }\n return result;\n }\n function getLinkPath(link) {\n return link.getAttribute(\"href\");\n }\n function pathToMatchObject(path: string): Match {\n const [url, queryString] = extractGETParameters(clean(path));\n const params = queryString === \"\" ? null : parseQuery(queryString);\n const hashString = extractHashFromURL(path);\n const route = createRoute(url, () => {}, [genericHooks], url);\n return {\n url,\n queryString,\n hashString,\n route,\n data: null,\n params: params,\n };\n }\n function getCurrentLocation(): Match {\n return pathToMatchObject(\n clean(getCurrentEnvURL(root)).replace(new RegExp(`^${root}`), \"\")\n );\n }\n function directMatchWithRegisteredRoutes(path: string): false | Match[] {\n const context: QContext = {\n instance: self,\n currentLocationPath: path,\n to: path,\n navigateOptions: {},\n resolveOptions: DEFAULT_RESOLVE_OPTIONS,\n };\n matchPathToRegisteredRoutes(context, () => {});\n return context.matches ? context.matches : false;\n }\n function directMatchWithLocation(\n path: string | RegExp,\n currentLocation?: string,\n annotatePathWithRoot?: boolean\n ): false | Match {\n if (\n typeof currentLocation !== \"undefined\" &&\n (typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot)\n ) {\n currentLocation = composePathWithRoot(currentLocation);\n }\n const context: QContext = {\n instance: self,\n to: currentLocation,\n currentLocationPath: currentLocation,\n };\n setLocationPath(context, () => {});\n if (typeof path === \"string\") {\n path =\n typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot\n ? composePathWithRoot(path)\n : path;\n }\n const match = matchRoute(context, {\n name: String(path),\n path,\n handler: () => {},\n hooks: {},\n });\n return match ? match : false;\n }\n function addHook(\n type: string,\n route: Route | string,\n func: Function\n ): Function {\n if (typeof route === \"string\") {\n route = getRoute(route);\n }\n if (route) {\n if (!route.hooks[type]) route.hooks[type] = [];\n route.hooks[type].push(func);\n return () => {\n (route as Route).hooks[type] = (route as Route).hooks[type].filter(\n (f) => f !== func\n );\n };\n } else {\n console.warn(`Route doesn't exists: ${route}`);\n }\n return () => {};\n }\n function getRoute(nameOrHandler: string | Function): Route | undefined {\n if (typeof nameOrHandler === \"string\") {\n return routes.find((r) => r.name === composePathWithRoot(nameOrHandler));\n }\n return routes.find((r) => r.handler === nameOrHandler);\n }\n function __markAsClean(context: QContext) {\n context.instance.__dirty = false;\n if (context.instance.__waiting.length > 0) {\n context.instance.__waiting.shift()();\n }\n }\n\n this.root = root;\n this.routes = routes;\n this.destroyed = destroyed;\n this.current = current;\n this.__freezeListening = false;\n this.__waiting = [];\n this.__dirty = false;\n this.__markAsClean = __markAsClean;\n\n this.on = on;\n this.off = off;\n this.resolve = resolve;\n this.navigate = navigate;\n this.navigateByName = navigateByName;\n this.destroy = destroy;\n this.notFound = notFound;\n this.updatePageLinks = updatePageLinks;\n this.link = link;\n this.hooks = setGenericHooks;\n this.extractGETParameters = (url) =>\n extractGETParameters(_checkForAHash(url));\n this.lastResolved = lastResolved;\n this.generate = generate;\n this.getLinkPath = getLinkPath;\n this.match = directMatchWithRegisteredRoutes;\n this.matchLocation = directMatchWithLocation;\n this.getCurrentLocation = getCurrentLocation;\n this.addBeforeHook = addHook.bind(this, \"before\");\n this.addAfterHook = addHook.bind(this, \"after\");\n this.addAlreadyHook = addHook.bind(this, \"already\");\n this.addLeaveHook = addHook.bind(this, \"leave\");\n this.getRoute = getRoute;\n this._pathToMatchObject = pathToMatchObject;\n this._clean = clean;\n this._checkForAHash = _checkForAHash;\n this._setCurrent = (c) => (current = self.current = c);\n\n listen.call(this);\n updatePageLinks.call(this);\n}\n","import { QContext } from \"../index\";\nimport Q from \"./Q\";\nimport checkForLeaveHook from \"./middlewares/checkForLeaveHook\";\nimport checkForBeforeHook from \"./middlewares/checkForBeforeHook\";\nimport callHandler from \"./middlewares/callHandler\";\nimport checkForAfterHook from \"./middlewares/checkForAfterHook\";\nimport checkForAlreadyHook from \"./middlewares/checkForAlreadyHook\";\nimport checkForNotFoundHandler from \"./middlewares/checkForNotFoundHandler\";\nimport errorOut from \"./middlewares/errorOut\";\nimport flushCurrent from \"./middlewares/flushCurrent\";\nimport updateState from \"./middlewares/updateState\";\n\nexport const foundLifecycle = [\n checkForAlreadyHook,\n checkForBeforeHook,\n callHandler,\n checkForAfterHook,\n];\n\nexport const notFoundLifeCycle = [\n checkForLeaveHook,\n checkForNotFoundHandler,\n Q.if(\n ({ notFoundHandled }: QContext) => notFoundHandled,\n foundLifecycle.concat([updateState]),\n [errorOut, flushCurrent]\n ),\n];\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function callHandler(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"callHandler\")) {\n context.match.route.handler(context.match);\n }\n context.instance.updatePageLinks();\n done();\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAfterHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.after &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n context.match.route.hooks.after.forEach((f) => f(context.match));\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAlreadyHook(context: QContext, done) {\n const current = context.instance.lastResolved();\n if (\n current &&\n current[0] &&\n current[0].route === context.match.route &&\n current[0].url === context.match.url &&\n current[0].queryString === context.match.queryString\n ) {\n current.forEach((c) => {\n if (c.route.hooks && c.route.hooks.already) {\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\")) {\n c.route.hooks.already.forEach((f) => f(context.match));\n }\n }\n });\n done(false);\n return;\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForBeforeHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.before &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n Q(\n context.match.route.hooks.before\n .map((f) => {\n // just so we match the Q interface\n return function beforeHookInternal(_, d) {\n return f((shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n }, context.match);\n };\n })\n .concat([() => done()])\n );\n } else {\n done();\n }\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForDeprecationMethods(context: QContext, done) {\n if (context.navigateOptions) {\n if (typeof context.navigateOptions[\"shouldResolve\"] !== \"undefined\") {\n console.warn(\n `\"shouldResolve\" is deprecated. Please check the documentation.`\n );\n }\n if (typeof context.navigateOptions[\"silent\"] !== \"undefined\") {\n console.warn(`\"silent\" is deprecated. Please check the documentation.`);\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForForceOp(context: QContext, done) {\n if (context.navigateOptions.force === true) {\n context.instance._setCurrent([\n context.instance._pathToMatchObject(context.to),\n ]);\n done(false);\n } else {\n done();\n }\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForLeaveHook(context: QContext, done) {\n const instance = context.instance;\n if (!instance.lastResolved()) {\n done();\n return;\n }\n Q(\n instance.lastResolved().map((oldMatch) => {\n return (_, leaveLoopDone) => {\n // no leave hook\n if (!oldMatch.route.hooks || !oldMatch.route.hooks.leave) {\n leaveLoopDone();\n return;\n }\n let runHook = false;\n const newLocationVSOldMatch = context.instance.matchLocation(\n oldMatch.route.path,\n context.currentLocationPath,\n false\n );\n if (oldMatch.route.path !== \"*\") {\n runHook = !newLocationVSOldMatch;\n } else {\n const someOfTheLastOnesMatch = context.matches\n ? context.matches.find((match) => {\n return oldMatch.route.path === match.route.path;\n })\n : false;\n runHook = !someOfTheLastOnesMatch;\n }\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\") && runHook) {\n Q(\n oldMatch.route.hooks.leave\n .map((f) => {\n // just so we match the Q interface\n return (_, d) =>\n f(\n (shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n },\n context.matches && context.matches.length > 0\n ? context.matches.length === 1\n ? context.matches[0]\n : context.matches\n : undefined\n );\n })\n .concat([() => leaveLoopDone()])\n );\n return;\n } else {\n leaveLoopDone();\n }\n };\n }),\n {},\n () => done()\n );\n}\n","import { QContext, Match } from \"../../index\";\nimport {\n parseQuery,\n extractGETParameters,\n clean,\n extractHashFromURL,\n} from \"../utils\";\n\nexport default function checkForNotFoundHandler(context: QContext, done) {\n const notFoundRoute = context.instance._notFoundRoute;\n if (notFoundRoute) {\n context.notFoundHandled = true;\n const [url, queryString] = extractGETParameters(\n context.currentLocationPath\n );\n const hashString = extractHashFromURL(context.to);\n notFoundRoute.path = clean(url);\n const notFoundMatch: Match = {\n url: notFoundRoute.path,\n queryString,\n hashString,\n data: null,\n route: notFoundRoute,\n params: queryString !== \"\" ? parseQuery(queryString) : null,\n };\n context.matches = [notFoundMatch];\n context.match = notFoundMatch;\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function errorOut(context: QContext, done) {\n if (\n !context.resolveOptions ||\n context.resolveOptions.noMatchWarning === false ||\n typeof context.resolveOptions.noMatchWarning === \"undefined\"\n )\n console.warn(\n `Navigo: \"${context.currentLocationPath}\" didn't match any of the registered routes.`\n );\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function flushCurrent(context: QContext, done) {\n context.instance._setCurrent(null);\n done();\n}\n","import { matchRoute } from \"../utils\";\nimport { QContext, Match } from \"../../index\";\n\nexport default function matchPathToRegisteredRoutes(context: QContext, done) {\n for (let i = 0; i < context.instance.routes.length; i++) {\n const route = context.instance.routes[i];\n const match: false | Match = matchRoute(context, route);\n if (match) {\n if (!context.matches) context.matches = [];\n context.matches.push(match);\n if (context.resolveOptions.strategy === \"ONE\") {\n done();\n return;\n }\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { foundLifecycle } from \"../lifecycles\";\nimport updateState from \"./updateState\";\nimport checkForLeaveHook from \"./checkForLeaveHook\";\n\nexport default function processMatches(context: QContext, done) {\n let idx = 0;\n function nextMatch() {\n if (idx === context.matches.length) {\n updateState(context, done);\n return;\n }\n Q(\n foundLifecycle,\n { ...context, match: context.matches[idx] },\n function end() {\n idx += 1;\n nextMatch();\n }\n );\n }\n checkForLeaveHook(context, nextMatch);\n}\n","import { QContext } from \"../../index\";\nimport { getCurrentEnvURL } from \"../utils\";\n\nexport default function setLocationPath(context: QContext, done) {\n if (typeof context.currentLocationPath === \"undefined\") {\n context.currentLocationPath = context.to = getCurrentEnvURL(\n context.instance.root\n );\n }\n context.currentLocationPath = context.instance._checkForAHash(\n context.currentLocationPath\n );\n done();\n}\n","import { undefinedOrTrue, pushStateAvailable, windowAvailable } from \"../utils\";\nimport { QContext } from \"../../index\";\n\nconst isWindowAvailable = windowAvailable();\nconst isPushStateAvailable = pushStateAvailable();\n\nexport default function updateBrowserURL(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateBrowserURL\")) {\n const value = `/${context.to}`.replace(/\\/\\//g, \"/\"); // making sure that we don't have two slashes\n const isItUsingHash =\n isWindowAvailable &&\n context.resolveOptions &&\n context.resolveOptions.hash === true;\n if (isPushStateAvailable) {\n history[context.navigateOptions.historyAPIMethod || \"pushState\"](\n context.navigateOptions.stateObj || {},\n context.navigateOptions.title || \"\",\n isItUsingHash ? `#${value}` : value\n );\n // This is to solve a nasty bug where the page doesn't scroll to the anchor.\n // We set a microtask to update the hash only.\n if (location && location.hash) {\n context.instance.__freezeListening = true;\n setTimeout(() => {\n let tmp = location.hash;\n location.hash = \"\";\n location.hash = tmp;\n context.instance.__freezeListening = false;\n }, 1);\n }\n } else if (isWindowAvailable) {\n window.location.href = context.to;\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function updateState(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateState\")) {\n context.instance._setCurrent(context.matches);\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function waitingList(context: QContext) {\n context.instance.__markAsClean(context);\n}\n","import {\n RouteHooksStorage,\n Match,\n Route,\n NavigateOptions,\n ResolveOptions,\n QContext,\n ResolveStrategy,\n} from \"../index\";\n\nimport {\n PARAMETER_REGEXP,\n WILDCARD_REGEXP,\n REPLACE_VARIABLE_REGEXP,\n REPLACE_WILDCARD,\n START_BY_SLASH_REGEXP,\n MATCH_REGEXP_FLAGS,\n REPLACE_NOT_SURE,\n NOT_SURE_REGEXP,\n} from \"./constants\";\n\nexport function getCurrentEnvURL(fallback = \"/\"): string {\n if (windowAvailable()) {\n return location.pathname + location.search + location.hash;\n }\n return fallback;\n}\nexport function clean(s: string) {\n return s.replace(/\\/+$/, \"\").replace(/^\\/+/, \"\");\n}\nexport function isString(s: any): boolean {\n return typeof s === \"string\";\n}\nexport function isFunction(s: any): boolean {\n return typeof s === \"function\";\n}\nexport function extractHashFromURL(url: string) {\n if (url && url.indexOf(\"#\") >= 0) {\n return url.split(\"#\").pop() || \"\";\n }\n return \"\";\n}\nexport function regExpResultToParams(match, names: string[]) {\n if (names.length === 0) return null;\n if (!match) return null;\n return match.slice(1, match.length).reduce((params, value, index) => {\n if (params === null) params = {};\n params[names[index]] = decodeURIComponent(value);\n return params;\n }, null);\n}\nexport function extractGETParameters(url: string) {\n const tmp = clean(url).split(/\\?(.*)?$/);\n return [clean(tmp[0]), tmp.slice(1).join(\"\")];\n}\nexport function parseQuery(queryString: string): Object {\n var query = {};\n var pairs = queryString.split(\"&\");\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i].split(\"=\");\n if (pair[0] !== \"\") {\n let key = decodeURIComponent(pair[0]);\n if (!query[key]) {\n query[key] = decodeURIComponent(pair[1] || \"\");\n } else {\n if (!Array.isArray(query[key])) query[key] = [query[key]];\n query[key].push(decodeURIComponent(pair[1] || \"\"));\n }\n }\n }\n return query;\n}\nexport function matchRoute(context: QContext, route: Route): false | Match {\n const [current, GETParams] = extractGETParameters(\n clean(context.currentLocationPath)\n );\n const params = GETParams === \"\" ? null : parseQuery(GETParams);\n const paramNames = [];\n let pattern;\n if (isString(route.path)) {\n pattern =\n START_BY_SLASH_REGEXP +\n clean(route.path as string)\n .replace(PARAMETER_REGEXP, function (full, dots, name) {\n paramNames.push(name);\n return REPLACE_VARIABLE_REGEXP;\n })\n .replace(WILDCARD_REGEXP, REPLACE_WILDCARD)\n .replace(NOT_SURE_REGEXP, REPLACE_NOT_SURE) +\n \"$\";\n if (clean(route.path as string) === \"\") {\n if (clean(current) === \"\") {\n return {\n url: current,\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data: null,\n params,\n };\n }\n }\n } else {\n pattern = route.path;\n }\n const regexp = new RegExp(pattern, MATCH_REGEXP_FLAGS);\n const match = current.match(regexp);\n\n if (match) {\n const data = isString(route.path)\n ? regExpResultToParams(match, paramNames)\n : match.groups\n ? match.groups\n : match.slice(1);\n return {\n url: clean(current.replace(new RegExp(`^${context.instance.root}`), \"\")),\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data,\n params,\n };\n }\n return false;\n}\nexport function pushStateAvailable(): boolean {\n return !!(\n typeof window !== \"undefined\" &&\n window.history &&\n window.history.pushState\n );\n}\nexport function undefinedOrTrue(obj, key: string): boolean {\n return typeof obj[key] === \"undefined\" || obj[key] === true;\n}\nexport function parseNavigateOptions(source?: string): NavigateOptions {\n if (!source) return {};\n const pairs = source.split(\",\");\n const options: NavigateOptions = {};\n let resolveOptions: ResolveOptions;\n\n pairs.forEach((str) => {\n const temp = str.split(\":\").map((v) => v.replace(/(^ +| +$)/g, \"\"));\n switch (temp[0]) {\n case \"historyAPIMethod\":\n options.historyAPIMethod = temp[1];\n break;\n case \"resolveOptionsStrategy\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.strategy = temp[1] as ResolveStrategy;\n break;\n case \"resolveOptionsHash\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.hash = temp[1] === \"true\";\n break;\n case \"updateBrowserURL\":\n case \"callHandler\":\n case \"updateState\":\n case \"force\":\n options[temp[0]] = temp[1] === \"true\";\n break;\n }\n });\n if (resolveOptions) {\n options.resolveOptions = resolveOptions;\n }\n return options;\n}\nexport function windowAvailable() {\n return typeof window !== \"undefined\";\n}\nexport function accumulateHooks(\n hooks = [],\n result: RouteHooksStorage = {}\n): RouteHooksStorage {\n hooks\n .filter((h) => h)\n .forEach((h) => {\n [\"before\", \"after\", \"already\", \"leave\"].forEach((type) => {\n if (h[type]) {\n if (!result[type]) result[type] = [];\n result[type].push(h[type]);\n }\n });\n });\n return result as RouteHooksStorage;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// module exports must be returned from runtime so entry inlining is disabled\n// startup\n// Load entry module and return exports\nreturn __webpack_require__(\"./src/index.ts\");\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://Navigo/webpack/universalModuleDefinition","webpack://Navigo/./src/Q.ts","webpack://Navigo/./src/constants.ts","webpack://Navigo/./src/index.ts","webpack://Navigo/./src/lifecycles.ts","webpack://Navigo/./src/middlewares/callHandler.ts","webpack://Navigo/./src/middlewares/checkForAfterHook.ts","webpack://Navigo/./src/middlewares/checkForAlreadyHook.ts","webpack://Navigo/./src/middlewares/checkForBeforeHook.ts","webpack://Navigo/./src/middlewares/checkForDeprecationMethods.ts","webpack://Navigo/./src/middlewares/checkForForceOp.ts","webpack://Navigo/./src/middlewares/checkForLeaveHook.ts","webpack://Navigo/./src/middlewares/checkForNotFoundHandler.ts","webpack://Navigo/./src/middlewares/errorOut.ts","webpack://Navigo/./src/middlewares/flushCurrent.ts","webpack://Navigo/./src/middlewares/matchPathToRegisteredRoutes.ts","webpack://Navigo/./src/middlewares/processMatches.ts","webpack://Navigo/./src/middlewares/setLocationPath.ts","webpack://Navigo/./src/middlewares/updateBrowserURL.ts","webpack://Navigo/./src/middlewares/updateState.ts","webpack://Navigo/./src/middlewares/waitingList.ts","webpack://Navigo/./src/utils.ts","webpack://Navigo/webpack/bootstrap","webpack://Navigo/webpack/runtime/define property getters","webpack://Navigo/webpack/runtime/hasOwnProperty shorthand","webpack://Navigo/webpack/runtime/make namespace object","webpack://Navigo/webpack/startup"],"names":["Q","funcs","c","done","context","idx","next","Array","isArray","splice","moveForward","if","condition","one","two","PARAMETER_REGEXP","REPLACE_VARIABLE_REGEXP","WILDCARD_REGEXP","REPLACE_WILDCARD","NOT_SURE_REGEXP","REPLACE_NOT_SURE","START_BY_SLASH_REGEXP","MATCH_REGEXP_FLAGS","DEFAULT_LINK_SELECTOR","Navigo","appRoute","options","DEFAULT_RESOLVE_OPTIONS","strategy","hash","noMatchWarning","linksSelector","self","root","current","routes","destroyed","genericHooks","isPushStateAvailable","pushStateAvailable","isWindowAvailable","windowAvailable","console","warn","clean","_checkForAHash","url","indexOf","split","composePathWithRoot","path","createRoute","handler","hooks","name","isString","String","accumulateHooks","on","RegExp","Object","keys","forEach","p","uses","as","push","resolve","to","__dirty","__waiting","undefined","instance","currentLocationPath","navigateOptions","resolveOptions","setLocationPath","matchPathToRegisteredRoutes","matches","length","processMatches","notFoundLifeCycle","waitingList","navigate","checkForDeprecationMethods","checkForForceOp","updateBrowserURL","navigateByName","data","generate","replace","off","what","filter","r","isFunction","listen","__popstateListener","__freezeListening","window","addEventListener","destroy","removeEventListener","notFound","_notFoundRoute","updatePageLinks","findLinks","link","getAttribute","hasListenerAttached","navigoHandler","e","ctrlKey","metaKey","target","tagName","toLowerCase","location","match","URL","u","pathname","search","err","parseNavigateOptions","preventDefault","stopPropagation","slice","call","document","querySelectorAll","setGenericHooks","lastResolved","route","find","result","key","includeRoot","getLinkPath","pathToMatchObject","extractGETParameters","queryString","params","parseQuery","hashString","extractHashFromURL","getCurrentLocation","getCurrentEnvURL","directMatchWithRegisteredRoutes","directMatchWithLocation","currentLocation","annotatePathWithRoot","matchRoute","addHook","type","func","getRoute","f","nameOrHandler","__markAsClean","shift","matchLocation","addBeforeHook","bind","addAfterHook","addAlreadyHook","addLeaveHook","_pathToMatchObject","_clean","_setCurrent","foundLifecycle","checkForAlreadyHook","checkForBeforeHook","callHandler","checkForAfterHook","checkForLeaveHook","checkForNotFoundHandler","notFoundHandled","concat","updateState","errorOut","flushCurrent","undefinedOrTrue","after","already","before","map","beforeHookInternal","_","d","shouldStop","force","oldMatch","leaveLoopDone","leave","runHook","newLocationVSOldMatch","someOfTheLastOnesMatch","notFoundRoute","notFoundMatch","i","nextMatch","end","value","isItUsingHash","history","historyAPIMethod","stateObj","title","setTimeout","tmp","href","fallback","s","pop","regExpResultToParams","names","reduce","index","decodeURIComponent","join","query","pairs","pair","GETParams","paramNames","pattern","full","dots","regexp","groups","pushState","obj","source","str","temp","v","h"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;ACLe,SAASA,CAAT,CACbC,KADa,EAEbC,CAFa,EAGbC,IAHa,EAIb;AACA,MAAMC,OAAO,GAAGF,CAAC,IAAI,EAArB;AACA,MAAIG,GAAG,GAAG,CAAV;;AAEA,GAAC,SAASC,IAAT,GAAgB;AACf,QAAI,CAACL,KAAK,CAACI,GAAD,CAAV,EAAiB;AACf,UAAIF,IAAJ,EAAU;AACRA,YAAI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AX,EAAoB,SAApB,EAA+B,OAA/B,EAAwC/K,OAAxC,CAAgD,UAAC4F,IAAD,EAAU;AACxD,UAAImF,CAAC,CAACnF,IAAD,CAAL,EAAa;AACX,YAAI,CAACnB,MAAM,CAACmB,IAAD,CAAX,EAAmBnB,MAAM,CAACmB,IAAD,CAAN,GAAe,EAAf;AACnBnB,cAAM,CAACmB,IAAD,CAAN,CAAaxF,IAAb,CAAkB2K,CAAC,CAACnF,IAAD,CAAnB;AACD;AACF,KALD;AAMD,GATH;AAUA,SAAOnB,MAAP;AACD,C;;;;;;UC1LD;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCrBA;WACA;WACA;WACA;WACA,wCAAwC,yCAAyC;WACjF;WACA;WACA,E;;;;;WCPA,6CAA6C,wDAAwD,E;;;;;WCArG;WACA;WACA;WACA,sDAAsD,kBAAkB;WACxE;WACA,+CAA+C,cAAc;WAC7D,E;;;;UCNA;UACA;UACA;UACA","file":"navigo.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Navigo\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Navigo\"] = factory();\n\telse\n\t\troot[\"Navigo\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn ","type QChild = {\n type: \"child\";\n funcs: Array | QChild>;\n};\n\nexport default function Q(\n funcs: Array | QChild>,\n c?: any,\n done?: Function\n) {\n const context = c || {};\n let idx = 0;\n\n (function next() {\n if (!funcs[idx]) {\n if (done) {\n done(context);\n }\n return;\n }\n if (Array.isArray(funcs[idx])) {\n funcs.splice(\n idx,\n 1,\n ...(funcs[idx][0](context) ? funcs[idx][1] : funcs[idx][2])\n );\n next();\n } else {\n // console.log(funcs[idx].name + \" / \" + JSON.stringify(context));\n // console.log(funcs[idx].name);\n (funcs[idx] as Function)(context, (moveForward) => {\n if (typeof moveForward === \"undefined\" || moveForward === true) {\n idx += 1;\n next();\n } else if (done) {\n done(context);\n }\n });\n }\n })();\n}\n\nQ.if = function (condition: Function, one, two) {\n if (!Array.isArray(one)) one = [one];\n if (!Array.isArray(two)) two = [two];\n return [condition, one, two];\n};\n","export const PARAMETER_REGEXP = /([:*])(\\w+)/g;\nexport const REPLACE_VARIABLE_REGEXP = \"([^/]+)\";\nexport const WILDCARD_REGEXP = /\\*/g;\nexport const REPLACE_WILDCARD = \"?(?:.*)\";\nexport const NOT_SURE_REGEXP = /\\/\\?/g;\nexport const REPLACE_NOT_SURE = \"/?([^/]+|)\";\nexport const START_BY_SLASH_REGEXP = \"(?:/^|^)\";\nexport const MATCH_REGEXP_FLAGS = \"\";\n","import {\n Match,\n Route,\n RouteHooks,\n QContext,\n NavigateOptions,\n ResolveOptions,\n GenerateOptions,\n Handler,\n RouterOptions,\n} from \"../index\";\nimport NavigoRouter from \"../index\";\nimport {\n pushStateAvailable,\n matchRoute,\n parseQuery,\n extractGETParameters,\n isFunction,\n isString,\n clean,\n parseNavigateOptions,\n windowAvailable,\n getCurrentEnvURL,\n accumulateHooks,\n extractHashFromURL,\n} from \"./utils\";\nimport Q from \"./Q\";\nimport setLocationPath from \"./middlewares/setLocationPath\";\nimport matchPathToRegisteredRoutes from \"./middlewares/matchPathToRegisteredRoutes\";\nimport checkForDeprecationMethods from \"./middlewares/checkForDeprecationMethods\";\nimport checkForForceOp from \"./middlewares/checkForForceOp\";\nimport updateBrowserURL from \"./middlewares/updateBrowserURL\";\nimport processMatches from \"./middlewares/processMatches\";\nimport waitingList from \"./middlewares/waitingList\";\n\nimport { notFoundLifeCycle } from \"./lifecycles\";\n\nconst DEFAULT_LINK_SELECTOR = \"[data-navigo]\";\n\nexport default function Navigo(appRoute?: string, options?: RouterOptions) {\n let DEFAULT_RESOLVE_OPTIONS: RouterOptions = options || {\n strategy: \"ONE\",\n hash: false,\n noMatchWarning: false,\n linksSelector: DEFAULT_LINK_SELECTOR,\n };\n let self: NavigoRouter = this;\n let root = \"/\";\n let current: Match[] = null;\n let routes: Route[] = [];\n let destroyed = false;\n let genericHooks: RouteHooks;\n\n const isPushStateAvailable = pushStateAvailable();\n const isWindowAvailable = windowAvailable();\n\n if (!appRoute) {\n console.warn(\n 'Navigo requires a root path in its constructor. If not provided will use \"/\" as default.'\n );\n } else {\n root = clean(appRoute);\n }\n\n function _checkForAHash(url: string): string {\n if (url.indexOf(\"#\") >= 0) {\n if (DEFAULT_RESOLVE_OPTIONS.hash === true) {\n url = url.split(\"#\")[1] || \"/\";\n } else {\n url = url.split(\"#\")[0];\n }\n }\n return url;\n }\n function composePathWithRoot(path: string) {\n return clean(`${root}/${clean(path)}`);\n }\n function createRoute(\n path: string | RegExp,\n handler: Handler,\n hooks: RouteHooks[],\n name?: string\n ): Route {\n path = isString(path) ? composePathWithRoot(path as string) : path;\n return {\n name: name || clean(String(path)),\n path,\n handler,\n hooks: accumulateHooks(hooks),\n };\n }\n\n // public APIs\n function on(\n path: string | Function | Object | RegExp,\n handler?: Handler,\n hooks?: RouteHooks\n ) {\n if (typeof path === \"object\" && !(path instanceof RegExp)) {\n Object.keys(path).forEach((p) => {\n if (typeof path[p] === \"function\") {\n this.on(p, path[p]);\n } else {\n const { uses: handler, as: name, hooks } = path[p];\n routes.push(createRoute(p, handler, [genericHooks, hooks], name));\n }\n });\n return this;\n } else if (typeof path === \"function\") {\n hooks = handler as RouteHooks;\n handler = path as Handler;\n path = root;\n }\n routes.push(\n createRoute(path as string | RegExp, handler, [genericHooks, hooks])\n );\n return this;\n }\n function resolve(to?: string, options?: ResolveOptions): false | Match[] {\n if (self.__dirty) {\n self.__waiting.push(() => self.resolve(to, options));\n return;\n } else {\n self.__dirty = true;\n }\n to = to ? `${clean(root)}/${clean(to)}` : undefined;\n // console.log(\"-- resolve --> \" + to, self.__dirty);\n const context: QContext = {\n instance: self,\n to,\n currentLocationPath: to,\n navigateOptions: {},\n resolveOptions: { ...DEFAULT_RESOLVE_OPTIONS, ...options },\n };\n Q(\n [\n setLocationPath,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n ],\n context,\n waitingList\n );\n\n return context.matches ? context.matches : false;\n }\n function navigate(to: string, navigateOptions?: NavigateOptions): void {\n // console.log(\"-- navigate --> \" + to, self.__dirty);\n if (self.__dirty) {\n self.__waiting.push(() => self.navigate(to, navigateOptions));\n return;\n } else {\n self.__dirty = true;\n }\n to = `${clean(root)}/${clean(to)}`;\n const context: QContext = {\n instance: self,\n to,\n navigateOptions: navigateOptions || {},\n resolveOptions:\n navigateOptions && navigateOptions.resolveOptions\n ? navigateOptions.resolveOptions\n : DEFAULT_RESOLVE_OPTIONS,\n currentLocationPath: _checkForAHash(to),\n };\n Q(\n [\n checkForDeprecationMethods,\n checkForForceOp,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n updateBrowserURL,\n waitingList,\n ],\n context,\n waitingList\n );\n }\n function navigateByName(\n name: string,\n data?: Object,\n options?: NavigateOptions\n ): boolean {\n const url = generate(name, data);\n if (url !== null) {\n navigate(url.replace(new RegExp(`^\\/?${root}`), \"\"), options);\n return true;\n }\n return false;\n }\n function off(what: string | RegExp | Function) {\n this.routes = routes = routes.filter((r) => {\n if (isString(what)) {\n return clean(r.path as string) !== clean(what as string);\n } else if (isFunction(what)) {\n return what !== r.handler;\n }\n return String(r.path) !== String(what);\n });\n return this;\n }\n function listen() {\n if (isPushStateAvailable) {\n this.__popstateListener = () => {\n if (!self.__freezeListening) {\n resolve();\n }\n };\n window.addEventListener(\"popstate\", this.__popstateListener);\n }\n }\n function destroy() {\n this.routes = routes = [];\n if (isPushStateAvailable) {\n window.removeEventListener(\"popstate\", this.__popstateListener);\n }\n this.destroyed = destroyed = true;\n }\n function notFound(handler, hooks?: RouteHooks) {\n self._notFoundRoute = createRoute(\n \"*\",\n handler,\n [genericHooks, hooks],\n \"__NOT_FOUND__\"\n );\n return this;\n }\n function updatePageLinks() {\n if (!isWindowAvailable) return;\n findLinks().forEach((link) => {\n if (\n \"false\" === link.getAttribute(\"data-navigo\") ||\n \"_blank\" === link.getAttribute(\"target\")\n ) {\n if (link.hasListenerAttached) {\n link.removeEventListener(\"click\", link.navigoHandler);\n }\n return;\n }\n if (!link.hasListenerAttached) {\n link.hasListenerAttached = true;\n link.navigoHandler = function (e) {\n if (\n (e.ctrlKey || e.metaKey) &&\n e.target.tagName.toLowerCase() === \"a\"\n ) {\n return false;\n }\n let location = link.getAttribute(\"href\");\n if (typeof location === \"undefined\" || location === null) {\n return false;\n }\n // handling absolute paths\n if (location.match(/^(http|https)/) && typeof URL !== \"undefined\") {\n try {\n const u = new URL(location);\n location = u.pathname + u.search;\n } catch (err) {}\n }\n const options = parseNavigateOptions(\n link.getAttribute(\"data-navigo-options\")\n );\n\n if (!destroyed) {\n e.preventDefault();\n e.stopPropagation();\n self.navigate(clean(location), options);\n }\n };\n link.addEventListener(\"click\", link.navigoHandler);\n }\n });\n return self;\n }\n function findLinks() {\n if (isWindowAvailable) {\n return [].slice.call(\n document.querySelectorAll(\n DEFAULT_RESOLVE_OPTIONS.linksSelector || DEFAULT_LINK_SELECTOR\n )\n );\n }\n return [];\n }\n function link(path: string) {\n return `/${root}/${clean(path)}`;\n }\n function setGenericHooks(hooks: RouteHooks) {\n genericHooks = hooks;\n return this;\n }\n function lastResolved(): Match[] | null {\n return current;\n }\n function generate(\n name: string,\n data?: Object,\n options?: GenerateOptions\n ): string {\n const route = routes.find((r) => r.name === name);\n let result = null;\n if (route) {\n result = route.path as string;\n if (data) {\n for (let key in data) {\n result = result.replace(\":\" + key, data[key]);\n }\n }\n result = !result.match(/^\\//) ? `/${result}` : result;\n }\n if (result && options && !options.includeRoot) {\n result = result.replace(new RegExp(`^/${root}`), \"\");\n }\n return result;\n }\n function getLinkPath(link) {\n return link.getAttribute(\"href\");\n }\n function pathToMatchObject(path: string): Match {\n const [url, queryString] = extractGETParameters(clean(path));\n const params = queryString === \"\" ? null : parseQuery(queryString);\n const hashString = extractHashFromURL(path);\n const route = createRoute(url, () => {}, [genericHooks], url);\n return {\n url,\n queryString,\n hashString,\n route,\n data: null,\n params: params,\n };\n }\n function getCurrentLocation(): Match {\n return pathToMatchObject(\n clean(getCurrentEnvURL(root)).replace(new RegExp(`^${root}`), \"\")\n );\n }\n function directMatchWithRegisteredRoutes(path: string): false | Match[] {\n const context: QContext = {\n instance: self,\n currentLocationPath: path,\n to: path,\n navigateOptions: {},\n resolveOptions: DEFAULT_RESOLVE_OPTIONS,\n };\n matchPathToRegisteredRoutes(context, () => {});\n return context.matches ? context.matches : false;\n }\n function directMatchWithLocation(\n path: string | RegExp,\n currentLocation?: string,\n annotatePathWithRoot?: boolean\n ): false | Match {\n if (\n typeof currentLocation !== \"undefined\" &&\n (typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot)\n ) {\n currentLocation = composePathWithRoot(currentLocation);\n }\n const context: QContext = {\n instance: self,\n to: currentLocation,\n currentLocationPath: currentLocation,\n };\n setLocationPath(context, () => {});\n if (typeof path === \"string\") {\n path =\n typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot\n ? composePathWithRoot(path)\n : path;\n }\n const match = matchRoute(context, {\n name: String(path),\n path,\n handler: () => {},\n hooks: {},\n });\n return match ? match : false;\n }\n function addHook(\n type: string,\n route: Route | string,\n func: Function\n ): Function {\n if (typeof route === \"string\") {\n route = getRoute(route);\n }\n if (route) {\n if (!route.hooks[type]) route.hooks[type] = [];\n route.hooks[type].push(func);\n return () => {\n (route as Route).hooks[type] = (route as Route).hooks[type].filter(\n (f) => f !== func\n );\n };\n } else {\n console.warn(`Route doesn't exists: ${route}`);\n }\n return () => {};\n }\n function getRoute(nameOrHandler: string | Function): Route | undefined {\n if (typeof nameOrHandler === \"string\") {\n return routes.find((r) => r.name === composePathWithRoot(nameOrHandler));\n }\n return routes.find((r) => r.handler === nameOrHandler);\n }\n function __markAsClean(context: QContext) {\n context.instance.__dirty = false;\n if (context.instance.__waiting.length > 0) {\n context.instance.__waiting.shift()();\n }\n }\n\n this.root = root;\n this.routes = routes;\n this.destroyed = destroyed;\n this.current = current;\n this.__freezeListening = false;\n this.__waiting = [];\n this.__dirty = false;\n this.__markAsClean = __markAsClean;\n\n this.on = on;\n this.off = off;\n this.resolve = resolve;\n this.navigate = navigate;\n this.navigateByName = navigateByName;\n this.destroy = destroy;\n this.notFound = notFound;\n this.updatePageLinks = updatePageLinks;\n this.link = link;\n this.hooks = setGenericHooks;\n this.extractGETParameters = (url) =>\n extractGETParameters(_checkForAHash(url));\n this.lastResolved = lastResolved;\n this.generate = generate;\n this.getLinkPath = getLinkPath;\n this.match = directMatchWithRegisteredRoutes;\n this.matchLocation = directMatchWithLocation;\n this.getCurrentLocation = getCurrentLocation;\n this.addBeforeHook = addHook.bind(this, \"before\");\n this.addAfterHook = addHook.bind(this, \"after\");\n this.addAlreadyHook = addHook.bind(this, \"already\");\n this.addLeaveHook = addHook.bind(this, \"leave\");\n this.getRoute = getRoute;\n this._pathToMatchObject = pathToMatchObject;\n this._clean = clean;\n this._checkForAHash = _checkForAHash;\n this._setCurrent = (c) => (current = self.current = c);\n\n listen.call(this);\n updatePageLinks.call(this);\n}\n","import { QContext } from \"../index\";\nimport Q from \"./Q\";\nimport checkForLeaveHook from \"./middlewares/checkForLeaveHook\";\nimport checkForBeforeHook from \"./middlewares/checkForBeforeHook\";\nimport callHandler from \"./middlewares/callHandler\";\nimport checkForAfterHook from \"./middlewares/checkForAfterHook\";\nimport checkForAlreadyHook from \"./middlewares/checkForAlreadyHook\";\nimport checkForNotFoundHandler from \"./middlewares/checkForNotFoundHandler\";\nimport errorOut from \"./middlewares/errorOut\";\nimport flushCurrent from \"./middlewares/flushCurrent\";\nimport updateState from \"./middlewares/updateState\";\n\nexport const foundLifecycle = [\n checkForAlreadyHook,\n checkForBeforeHook,\n callHandler,\n checkForAfterHook,\n];\n\nexport const notFoundLifeCycle = [\n checkForLeaveHook,\n checkForNotFoundHandler,\n Q.if(\n ({ notFoundHandled }: QContext) => notFoundHandled,\n foundLifecycle.concat([updateState]),\n [errorOut, flushCurrent]\n ),\n];\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function callHandler(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"callHandler\")) {\n context.match.route.handler(context.match);\n }\n context.instance.updatePageLinks();\n done();\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAfterHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.after &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n context.match.route.hooks.after.forEach((f) => f(context.match));\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAlreadyHook(context: QContext, done) {\n const current = context.instance.lastResolved();\n if (\n current &&\n current[0] &&\n current[0].route === context.match.route &&\n current[0].url === context.match.url &&\n current[0].queryString === context.match.queryString\n ) {\n current.forEach((c) => {\n if (c.route.hooks && c.route.hooks.already) {\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\")) {\n c.route.hooks.already.forEach((f) => f(context.match));\n }\n }\n });\n done(false);\n return;\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForBeforeHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.before &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n Q(\n context.match.route.hooks.before\n .map((f) => {\n // just so we match the Q interface\n return function beforeHookInternal(_, d) {\n return f((shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n }, context.match);\n };\n })\n .concat([() => done()])\n );\n } else {\n done();\n }\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForDeprecationMethods(context: QContext, done) {\n if (context.navigateOptions) {\n if (typeof context.navigateOptions[\"shouldResolve\"] !== \"undefined\") {\n console.warn(\n `\"shouldResolve\" is deprecated. Please check the documentation.`\n );\n }\n if (typeof context.navigateOptions[\"silent\"] !== \"undefined\") {\n console.warn(`\"silent\" is deprecated. Please check the documentation.`);\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForForceOp(context: QContext, done) {\n if (context.navigateOptions.force === true) {\n context.instance._setCurrent([\n context.instance._pathToMatchObject(context.to),\n ]);\n done(false);\n } else {\n done();\n }\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForLeaveHook(context: QContext, done) {\n const instance = context.instance;\n if (!instance.lastResolved()) {\n done();\n return;\n }\n Q(\n instance.lastResolved().map((oldMatch) => {\n return (_, leaveLoopDone) => {\n // no leave hook\n if (!oldMatch.route.hooks || !oldMatch.route.hooks.leave) {\n leaveLoopDone();\n return;\n }\n let runHook = false;\n const newLocationVSOldMatch = context.instance.matchLocation(\n oldMatch.route.path,\n context.currentLocationPath,\n false\n );\n if (oldMatch.route.path !== \"*\") {\n runHook = !newLocationVSOldMatch;\n } else {\n const someOfTheLastOnesMatch = context.matches\n ? context.matches.find((match) => {\n return oldMatch.route.path === match.route.path;\n })\n : false;\n runHook = !someOfTheLastOnesMatch;\n }\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\") && runHook) {\n Q(\n oldMatch.route.hooks.leave\n .map((f) => {\n // just so we match the Q interface\n return (_, d) =>\n f(\n (shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n },\n context.matches && context.matches.length > 0\n ? context.matches.length === 1\n ? context.matches[0]\n : context.matches\n : undefined\n );\n })\n .concat([() => leaveLoopDone()])\n );\n return;\n } else {\n leaveLoopDone();\n }\n };\n }),\n {},\n () => done()\n );\n}\n","import { QContext, Match } from \"../../index\";\nimport {\n parseQuery,\n extractGETParameters,\n clean,\n extractHashFromURL,\n} from \"../utils\";\n\nexport default function checkForNotFoundHandler(context: QContext, done) {\n const notFoundRoute = context.instance._notFoundRoute;\n if (notFoundRoute) {\n context.notFoundHandled = true;\n const [url, queryString] = extractGETParameters(\n context.currentLocationPath\n );\n const hashString = extractHashFromURL(context.to);\n notFoundRoute.path = clean(url);\n const notFoundMatch: Match = {\n url: notFoundRoute.path,\n queryString,\n hashString,\n data: null,\n route: notFoundRoute,\n params: queryString !== \"\" ? parseQuery(queryString) : null,\n };\n context.matches = [notFoundMatch];\n context.match = notFoundMatch;\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function errorOut(context: QContext, done) {\n if (\n !context.resolveOptions ||\n context.resolveOptions.noMatchWarning === false ||\n typeof context.resolveOptions.noMatchWarning === \"undefined\"\n )\n console.warn(\n `Navigo: \"${context.currentLocationPath}\" didn't match any of the registered routes.`\n );\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function flushCurrent(context: QContext, done) {\n context.instance._setCurrent(null);\n done();\n}\n","import { matchRoute } from \"../utils\";\nimport { QContext, Match } from \"../../index\";\n\nexport default function matchPathToRegisteredRoutes(context: QContext, done) {\n for (let i = 0; i < context.instance.routes.length; i++) {\n const route = context.instance.routes[i];\n const match: false | Match = matchRoute(context, route);\n if (match) {\n if (!context.matches) context.matches = [];\n context.matches.push(match);\n if (context.resolveOptions.strategy === \"ONE\") {\n done();\n return;\n }\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { foundLifecycle } from \"../lifecycles\";\nimport updateState from \"./updateState\";\nimport checkForLeaveHook from \"./checkForLeaveHook\";\n\nexport default function processMatches(context: QContext, done) {\n let idx = 0;\n function nextMatch() {\n if (idx === context.matches.length) {\n updateState(context, done);\n return;\n }\n Q(\n foundLifecycle,\n { ...context, match: context.matches[idx] },\n function end() {\n idx += 1;\n nextMatch();\n }\n );\n }\n checkForLeaveHook(context, nextMatch);\n}\n","import { QContext } from \"../../index\";\nimport { getCurrentEnvURL } from \"../utils\";\n\nexport default function setLocationPath(context: QContext, done) {\n if (typeof context.currentLocationPath === \"undefined\") {\n context.currentLocationPath = context.to = getCurrentEnvURL(\n context.instance.root\n );\n }\n context.currentLocationPath = context.instance._checkForAHash(\n context.currentLocationPath\n );\n done();\n}\n","import { undefinedOrTrue, pushStateAvailable, windowAvailable } from \"../utils\";\nimport { QContext } from \"../../index\";\n\nconst isWindowAvailable = windowAvailable();\nconst isPushStateAvailable = pushStateAvailable();\n\nexport default function updateBrowserURL(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateBrowserURL\")) {\n const value = `/${context.to}`.replace(/\\/\\//g, \"/\"); // making sure that we don't have two slashes\n const isItUsingHash =\n isWindowAvailable &&\n context.resolveOptions &&\n context.resolveOptions.hash === true;\n if (isPushStateAvailable) {\n history[context.navigateOptions.historyAPIMethod || \"pushState\"](\n context.navigateOptions.stateObj || {},\n context.navigateOptions.title || \"\",\n isItUsingHash ? `#${value}` : value\n );\n // This is to solve a nasty bug where the page doesn't scroll to the anchor.\n // We set a microtask to update the hash only.\n if (location && location.hash) {\n context.instance.__freezeListening = true;\n setTimeout(() => {\n let tmp = location.hash;\n location.hash = \"\";\n location.hash = tmp;\n context.instance.__freezeListening = false;\n }, 1);\n }\n } else if (isWindowAvailable) {\n window.location.href = context.to;\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function updateState(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateState\")) {\n context.instance._setCurrent(context.matches);\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function waitingList(context: QContext) {\n context.instance.__markAsClean(context);\n}\n","import {\n RouteHooksStorage,\n Match,\n Route,\n NavigateOptions,\n ResolveOptions,\n QContext,\n ResolveStrategy,\n} from \"../index\";\n\nimport {\n PARAMETER_REGEXP,\n WILDCARD_REGEXP,\n REPLACE_VARIABLE_REGEXP,\n REPLACE_WILDCARD,\n START_BY_SLASH_REGEXP,\n MATCH_REGEXP_FLAGS,\n REPLACE_NOT_SURE,\n NOT_SURE_REGEXP,\n} from \"./constants\";\n\nexport function getCurrentEnvURL(fallback = \"/\"): string {\n if (windowAvailable()) {\n return location.pathname + location.search + location.hash;\n }\n return fallback;\n}\nexport function clean(s: string) {\n return s.replace(/\\/+$/, \"\").replace(/^\\/+/, \"\");\n}\nexport function isString(s: any): boolean {\n return typeof s === \"string\";\n}\nexport function isFunction(s: any): boolean {\n return typeof s === \"function\";\n}\nexport function extractHashFromURL(url: string) {\n if (url && url.indexOf(\"#\") >= 0) {\n return url.split(\"#\").pop() || \"\";\n }\n return \"\";\n}\nexport function regExpResultToParams(match, names: string[]) {\n if (names.length === 0) return null;\n if (!match) return null;\n return match.slice(1, match.length).reduce((params, value, index) => {\n if (params === null) params = {};\n params[names[index]] = decodeURIComponent(value);\n return params;\n }, null);\n}\nexport function extractGETParameters(url: string) {\n const tmp = clean(url).split(/\\?(.*)?$/);\n return [clean(tmp[0]), tmp.slice(1).join(\"\")];\n}\nexport function parseQuery(queryString: string): Object {\n var query = {};\n var pairs = queryString.split(\"&\");\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i].split(\"=\");\n if (pair[0] !== \"\") {\n let key = decodeURIComponent(pair[0]);\n if (!query[key]) {\n query[key] = decodeURIComponent(pair[1] || \"\");\n } else {\n if (!Array.isArray(query[key])) query[key] = [query[key]];\n query[key].push(decodeURIComponent(pair[1] || \"\"));\n }\n }\n }\n return query;\n}\nexport function matchRoute(context: QContext, route: Route): false | Match {\n const [current, GETParams] = extractGETParameters(\n clean(context.currentLocationPath)\n );\n const params = GETParams === \"\" ? null : parseQuery(GETParams);\n const paramNames = [];\n let pattern;\n if (isString(route.path)) {\n pattern =\n START_BY_SLASH_REGEXP +\n clean(route.path as string)\n .replace(PARAMETER_REGEXP, function (full, dots, name) {\n paramNames.push(name);\n return REPLACE_VARIABLE_REGEXP;\n })\n .replace(WILDCARD_REGEXP, REPLACE_WILDCARD)\n .replace(NOT_SURE_REGEXP, REPLACE_NOT_SURE) +\n \"$\";\n if (clean(route.path as string) === \"\") {\n if (clean(current) === \"\") {\n return {\n url: current,\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data: null,\n params,\n };\n }\n }\n } else {\n pattern = route.path;\n }\n const regexp = new RegExp(pattern, MATCH_REGEXP_FLAGS);\n const match = current.match(regexp);\n\n if (match) {\n const data = isString(route.path)\n ? regExpResultToParams(match, paramNames)\n : match.groups\n ? match.groups\n : match.slice(1);\n return {\n url: clean(current.replace(new RegExp(`^${context.instance.root}`), \"\")),\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data,\n params,\n };\n }\n return false;\n}\nexport function pushStateAvailable(): boolean {\n return !!(\n typeof window !== \"undefined\" &&\n window.history &&\n window.history.pushState\n );\n}\nexport function undefinedOrTrue(obj, key: string): boolean {\n return typeof obj[key] === \"undefined\" || obj[key] === true;\n}\nexport function parseNavigateOptions(source?: string): NavigateOptions {\n if (!source) return {};\n const pairs = source.split(\",\");\n const options: NavigateOptions = {};\n let resolveOptions: ResolveOptions;\n\n pairs.forEach((str) => {\n const temp = str.split(\":\").map((v) => v.replace(/(^ +| +$)/g, \"\"));\n switch (temp[0]) {\n case \"historyAPIMethod\":\n options.historyAPIMethod = temp[1];\n break;\n case \"resolveOptionsStrategy\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.strategy = temp[1] as ResolveStrategy;\n break;\n case \"resolveOptionsHash\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.hash = temp[1] === \"true\";\n break;\n case \"updateBrowserURL\":\n case \"callHandler\":\n case \"updateState\":\n case \"force\":\n options[temp[0]] = temp[1] === \"true\";\n break;\n }\n });\n if (resolveOptions) {\n options.resolveOptions = resolveOptions;\n }\n return options;\n}\nexport function windowAvailable() {\n return typeof window !== \"undefined\";\n}\nexport function accumulateHooks(\n hooks = [],\n result: RouteHooksStorage = {}\n): RouteHooksStorage {\n hooks\n .filter((h) => h)\n .forEach((h) => {\n [\"before\", \"after\", \"already\", \"leave\"].forEach((type) => {\n if (h[type]) {\n if (!result[type]) result[type] = [];\n result[type].push(h[type]);\n }\n });\n });\n return result as RouteHooksStorage;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// module exports must be returned from runtime so entry inlining is disabled\n// startup\n// Load entry module and return exports\nreturn __webpack_require__(\"./src/index.ts\");\n"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/navigo.min.js b/lib/navigo.min.js index a151d84d..bd554f5f 100644 --- a/lib/navigo.min.js +++ b/lib/navigo.min.js @@ -1,2 +1,2 @@ -!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("Navigo",[],n):"object"==typeof exports?exports.Navigo=n():t.Navigo=n()}("undefined"!=typeof self?self:this,(function(){return(()=>{"use strict";var t={407:(t,n,e)=>{e.d(n,{default:()=>N});var o=/([:*])(\w+)/g,r=/\*/g,i=/\/\?/g;function a(t){return void 0===t&&(t="/"),v()?location.pathname+location.search+location.hash:t}function s(t){return t.replace(/\/+$/,"").replace(/^\/+/,"")}function c(t){return"string"==typeof t}function u(t){return t&&t.indexOf("#")>=0&&t.split("#").pop()||""}function h(t){var n=s(t).split(/\?(.*)?$/);return[s(n[0]),n.slice(1).join("")]}function f(t){for(var n={},e=t.split("&"),o=0;o0?1===t.matches.length?t.matches[0]:t.matches:void 0)}})).concat([function(){return o()}])):o()}else o()}})),{},(function(){return n()})):n()}function P(t,n){d(t.navigateOptions,"updateState")&&t.instance._setCurrent(t.matches),n()}var R=[function(t,n){var e=t.instance.lastResolved();if(e&&e[0]&&e[0].route===t.match.route&&e[0].url===t.match.url&&e[0].queryString===t.match.queryString)return e.forEach((function(n){n.route.hooks&&n.route.hooks.already&&d(t.navigateOptions,"callHooks")&&n.route.hooks.already.forEach((function(n){return n(t.match)}))})),void n(!1);n()},function(t,n){t.match.route.hooks&&t.match.route.hooks.before&&d(t.navigateOptions,"callHooks")?m(t.match.route.hooks.before.map((function(n){return function(e,o){return n((function(n){!1===n?t.instance.__markAsClean(t):o()}),t.match)}})).concat([function(){return n()}])):n()},function(t,n){d(t.navigateOptions,"callHandler")&&t.match.route.handler(t.match),t.instance.updatePageLinks(),n()},function(t,n){t.match.route.hooks&&t.match.route.hooks.after&&d(t.navigateOptions,"callHooks")&&t.match.route.hooks.after.forEach((function(n){return n(t.match)})),n()}],S=[A,function(t,n){var e=t.instance._notFoundRoute;if(e){t.notFoundHandled=!0;var o=h(t.currentLocationPath),r=o[0],i=o[1],a=u(t.to);e.path=s(r);var c={url:e.path,queryString:i,hashString:a,data:null,route:e,params:""!==i?f(i):null};t.matches=[c],t.match=c}n()},m.if((function(t){return t.notFoundHandled}),R.concat([P]),[function(t,n){t.resolveOptions&&!1!==t.resolveOptions.noMatchWarning&&void 0!==t.resolveOptions.noMatchWarning||console.warn('Navigo: "'+t.currentLocationPath+"\" didn't match any of the registered routes."),n()},function(t,n){t.instance._setCurrent(null),n()}])];function E(){return(E=Object.assign||function(t){for(var n=1;n=0&&(t=!0===o.hash?t.split("#")[1]||"/":t.split("#")[0]),t}function E(t){return s(i+"/"+s(t))}function N(t,n,e,o){return t=c(t)?E(t):t,{name:o||s(String(t)),path:t,handler:n,hooks:g(e)}}function U(t,n){if(!r.__dirty){r.__dirty=!0,t=t?s(i)+"/"+s(t):void 0;var e={instance:r,to:t,currentLocationPath:t,navigateOptions:{},resolveOptions:j({},o,n)};return m([y,_,m.if((function(t){var n=t.matches;return n&&n.length>0}),x,S)],e,H),!!e.matches&&e.matches}r.__waiting.push((function(){return r.resolve(t,n)}))}function q(t,n){if(r.__dirty)r.__waiting.push((function(){return r.navigate(t,n)}));else{r.__dirty=!0,t=s(i)+"/"+s(t);var e={instance:r,to:t,navigateOptions:n||{},resolveOptions:n&&n.resolveOptions?n.resolveOptions:o,currentLocationPath:R(t)};m([k,O,_,m.if((function(t){var n=t.matches;return n&&n.length>0}),x,S),b,H],e,H)}}function F(){if(P)return(P?[].slice.call(document.querySelectorAll(o.linksSelector||C)):[]).forEach((function(t){"false"!==t.getAttribute("data-navigo")&&"_blank"!==t.getAttribute("target")?t.hasListenerAttached||(t.hasListenerAttached=!0,t.navigoHandler=function(n){if((n.ctrlKey||n.metaKey)&&"a"===n.target.tagName.toLowerCase())return!1;var e=t.getAttribute("href");if(null==e)return!1;if(e.match(/^(http|https)/)&&"undefined"!=typeof URL)try{var o=new URL(e);e=o.pathname+o.search}catch(t){}var i=function(t){if(!t)return{};var n,e=t.split(","),o={};return e.forEach((function(t){var e=t.split(":").map((function(t){return t.replace(/(^ +| +$)/g,"")}));switch(e[0]){case"historyAPIMethod":o.historyAPIMethod=e[1];break;case"resolveOptionsStrategy":n||(n={}),n.strategy=e[1];break;case"resolveOptionsHash":n||(n={}),n.hash="true"===e[1];break;case"updateBrowserURL":case"callHandler":case"updateState":case"force":o[e[0]]="true"===e[1]}})),n&&(o.resolveOptions=n),o}(t.getAttribute("data-navigo-options"));L||(n.preventDefault(),n.stopPropagation(),r.navigate(s(e),i))},t.addEventListener("click",t.navigoHandler)):t.hasListenerAttached&&t.removeEventListener("click",t.navigoHandler)})),r}function I(t,n,e){var o=w.find((function(n){return n.name===t})),r=null;if(o){if(r=o.path,n)for(var a in n)r=r.replace(":"+a,n[a]);r=r.match(/^\//)?r:"/"+r}return r&&e&&!e.includeRoot&&(r=r.replace(new RegExp("^/"+i),"")),r}function M(t){var n=h(s(t)),o=n[0],r=n[1],i=""===r?null:f(r);return{url:o,queryString:r,hashString:u(t),route:N(o,(function(){}),[e],o),data:null,params:i}}function T(t,n,e){return"string"==typeof n&&(n=z(n)),n?(n.hooks[t]||(n.hooks[t]=[]),n.hooks[t].push(e),function(){n.hooks[t]=n.hooks[t].filter((function(t){return t!==e}))}):(console.warn("Route doesn't exists: "+n),function(){})}function z(t){return"string"==typeof t?w.find((function(n){return n.name===E(t)})):w.find((function(n){return n.handler===t}))}t?i=s(t):console.warn('Navigo requires a root path in its constructor. If not provided will use "/" as default.'),this.root=i,this.routes=w,this.destroyed=L,this.current=d,this.__freezeListening=!1,this.__waiting=[],this.__dirty=!1,this.__markAsClean=function(t){t.instance.__dirty=!1,t.instance.__waiting.length>0&&t.instance.__waiting.shift()()},this.on=function(t,n,o){var r=this;return"object"!=typeof t||t instanceof RegExp?("function"==typeof t&&(o=n,n=t,t=i),w.push(N(t,n,[e,o])),this):(Object.keys(t).forEach((function(n){if("function"==typeof t[n])r.on(n,t[n]);else{var o=t[n],i=o.uses,a=o.as,s=o.hooks;w.push(N(n,i,[e,s],a))}})),this)},this.off=function(t){return this.routes=w=w.filter((function(n){return c(t)?s(n.path)!==s(t):"function"==typeof t?t!==n.handler:String(n.path)!==String(t)})),this},this.resolve=U,this.navigate=q,this.navigateByName=function(t,n,e){var o=I(t,n);return null!==o&&(q(o.replace(new RegExp("^/?"+i),""),e),!0)},this.destroy=function(){this.routes=w=[],A&&window.removeEventListener("popstate",this.__popstateListener),this.destroyed=L=!0},this.notFound=function(t,n){return r._notFoundRoute=N("*",t,[e,n],"__NOT_FOUND__"),this},this.updatePageLinks=F,this.link=function(t){return"/"+i+"/"+s(t)},this.hooks=function(t){return e=t,this},this.extractGETParameters=function(t){return h(R(t))},this.lastResolved=function(){return d},this.generate=I,this.getLinkPath=function(t){return t.getAttribute("href")},this.match=function(t){var n={instance:r,currentLocationPath:t,to:t,navigateOptions:{},resolveOptions:o};return _(n,(function(){})),!!n.matches&&n.matches},this.matchLocation=function(t,n,e){void 0===n||void 0!==e&&!e||(n=E(n));var o={instance:r,to:n,currentLocationPath:n};return y(o,(function(){})),"string"==typeof t&&(t=void 0===e||e?E(t):t),l(o,{name:String(t),path:t,handler:function(){},hooks:{}})||!1},this.getCurrentLocation=function(){return M(s(a(i)).replace(new RegExp("^"+i),""))},this.addBeforeHook=T.bind(this,"before"),this.addAfterHook=T.bind(this,"after"),this.addAlreadyHook=T.bind(this,"already"),this.addLeaveHook=T.bind(this,"leave"),this.getRoute=z,this._pathToMatchObject=M,this._clean=s,this._checkForAHash=R,this._setCurrent=function(t){return d=r.current=t},function(){A&&(this.__popstateListener=function(){r.__freezeListening||U()},window.addEventListener("popstate",this.__popstateListener))}.call(this),F.call(this)}}},n={};function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{}};return t[o](r,r.exports,e),r.exports}return e.d=(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},e.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),e(407)})().default})); +!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("Navigo",[],n):"object"==typeof exports?exports.Navigo=n():t.Navigo=n()}("undefined"!=typeof self?self:this,(function(){return function(){"use strict";var t={407:function(t,n,e){e.d(n,{default:function(){return N}});var o=/([:*])(\w+)/g,r=/\*/g,i=/\/\?/g;function a(t){return void 0===t&&(t="/"),v()?location.pathname+location.search+location.hash:t}function s(t){return t.replace(/\/+$/,"").replace(/^\/+/,"")}function c(t){return"string"==typeof t}function u(t){return t&&t.indexOf("#")>=0&&t.split("#").pop()||""}function h(t){var n=s(t).split(/\?(.*)?$/);return[s(n[0]),n.slice(1).join("")]}function f(t){for(var n={},e=t.split("&"),o=0;o0?1===t.matches.length?t.matches[0]:t.matches:void 0)}})).concat([function(){return o()}])):o()}else o()}})),{},(function(){return n()})):n()}function P(t,n){d(t.navigateOptions,"updateState")&&t.instance._setCurrent(t.matches),n()}var R=[function(t,n){var e=t.instance.lastResolved();if(e&&e[0]&&e[0].route===t.match.route&&e[0].url===t.match.url&&e[0].queryString===t.match.queryString)return e.forEach((function(n){n.route.hooks&&n.route.hooks.already&&d(t.navigateOptions,"callHooks")&&n.route.hooks.already.forEach((function(n){return n(t.match)}))})),void n(!1);n()},function(t,n){t.match.route.hooks&&t.match.route.hooks.before&&d(t.navigateOptions,"callHooks")?m(t.match.route.hooks.before.map((function(n){return function(e,o){return n((function(n){!1===n?t.instance.__markAsClean(t):o()}),t.match)}})).concat([function(){return n()}])):n()},function(t,n){d(t.navigateOptions,"callHandler")&&t.match.route.handler(t.match),t.instance.updatePageLinks(),n()},function(t,n){t.match.route.hooks&&t.match.route.hooks.after&&d(t.navigateOptions,"callHooks")&&t.match.route.hooks.after.forEach((function(n){return n(t.match)})),n()}],S=[A,function(t,n){var e=t.instance._notFoundRoute;if(e){t.notFoundHandled=!0;var o=h(t.currentLocationPath),r=o[0],i=o[1],a=u(t.to);e.path=s(r);var c={url:e.path,queryString:i,hashString:a,data:null,route:e,params:""!==i?f(i):null};t.matches=[c],t.match=c}n()},m.if((function(t){return t.notFoundHandled}),R.concat([P]),[function(t,n){t.resolveOptions&&!1!==t.resolveOptions.noMatchWarning&&void 0!==t.resolveOptions.noMatchWarning||console.warn('Navigo: "'+t.currentLocationPath+"\" didn't match any of the registered routes."),n()},function(t,n){t.instance._setCurrent(null),n()}])];function E(){return(E=Object.assign||function(t){for(var n=1;n=0&&(t=!0===o.hash?t.split("#")[1]||"/":t.split("#")[0]),t}function E(t){return s(i+"/"+s(t))}function N(t,n,e,o){return t=c(t)?E(t):t,{name:o||s(String(t)),path:t,handler:n,hooks:g(e)}}function U(t,n){if(!r.__dirty){r.__dirty=!0,t=t?s(i)+"/"+s(t):void 0;var e={instance:r,to:t,currentLocationPath:t,navigateOptions:{},resolveOptions:j({},o,n)};return m([y,_,m.if((function(t){var n=t.matches;return n&&n.length>0}),x,S)],e,H),!!e.matches&&e.matches}r.__waiting.push((function(){return r.resolve(t,n)}))}function q(t,n){if(r.__dirty)r.__waiting.push((function(){return r.navigate(t,n)}));else{r.__dirty=!0,t=s(i)+"/"+s(t);var e={instance:r,to:t,navigateOptions:n||{},resolveOptions:n&&n.resolveOptions?n.resolveOptions:o,currentLocationPath:R(t)};m([k,O,_,m.if((function(t){var n=t.matches;return n&&n.length>0}),x,S),b,H],e,H)}}function F(){if(P)return(P?[].slice.call(document.querySelectorAll(o.linksSelector||C)):[]).forEach((function(t){"false"!==t.getAttribute("data-navigo")&&"_blank"!==t.getAttribute("target")?t.hasListenerAttached||(t.hasListenerAttached=!0,t.navigoHandler=function(n){if((n.ctrlKey||n.metaKey)&&"a"===n.target.tagName.toLowerCase())return!1;var e=t.getAttribute("href");if(null==e)return!1;if(e.match(/^(http|https)/)&&"undefined"!=typeof URL)try{var o=new URL(e);e=o.pathname+o.search}catch(t){}var i=function(t){if(!t)return{};var n,e=t.split(","),o={};return e.forEach((function(t){var e=t.split(":").map((function(t){return t.replace(/(^ +| +$)/g,"")}));switch(e[0]){case"historyAPIMethod":o.historyAPIMethod=e[1];break;case"resolveOptionsStrategy":n||(n={}),n.strategy=e[1];break;case"resolveOptionsHash":n||(n={}),n.hash="true"===e[1];break;case"updateBrowserURL":case"callHandler":case"updateState":case"force":o[e[0]]="true"===e[1]}})),n&&(o.resolveOptions=n),o}(t.getAttribute("data-navigo-options"));L||(n.preventDefault(),n.stopPropagation(),r.navigate(s(e),i))},t.addEventListener("click",t.navigoHandler)):t.hasListenerAttached&&t.removeEventListener("click",t.navigoHandler)})),r}function I(t,n,e){var o=w.find((function(n){return n.name===t})),r=null;if(o){if(r=o.path,n)for(var a in n)r=r.replace(":"+a,n[a]);r=r.match(/^\//)?r:"/"+r}return r&&e&&!e.includeRoot&&(r=r.replace(new RegExp("^/"+i),"")),r}function M(t){var n=h(s(t)),o=n[0],r=n[1],i=""===r?null:f(r);return{url:o,queryString:r,hashString:u(t),route:N(o,(function(){}),[e],o),data:null,params:i}}function T(t,n,e){return"string"==typeof n&&(n=z(n)),n?(n.hooks[t]||(n.hooks[t]=[]),n.hooks[t].push(e),function(){n.hooks[t]=n.hooks[t].filter((function(t){return t!==e}))}):(console.warn("Route doesn't exists: "+n),function(){})}function z(t){return"string"==typeof t?w.find((function(n){return n.name===E(t)})):w.find((function(n){return n.handler===t}))}t?i=s(t):console.warn('Navigo requires a root path in its constructor. If not provided will use "/" as default.'),this.root=i,this.routes=w,this.destroyed=L,this.current=d,this.__freezeListening=!1,this.__waiting=[],this.__dirty=!1,this.__markAsClean=function(t){t.instance.__dirty=!1,t.instance.__waiting.length>0&&t.instance.__waiting.shift()()},this.on=function(t,n,o){var r=this;return"object"!=typeof t||t instanceof RegExp?("function"==typeof t&&(o=n,n=t,t=i),w.push(N(t,n,[e,o])),this):(Object.keys(t).forEach((function(n){if("function"==typeof t[n])r.on(n,t[n]);else{var o=t[n],i=o.uses,a=o.as,s=o.hooks;w.push(N(n,i,[e,s],a))}})),this)},this.off=function(t){return this.routes=w=w.filter((function(n){return c(t)?s(n.path)!==s(t):"function"==typeof t?t!==n.handler:String(n.path)!==String(t)})),this},this.resolve=U,this.navigate=q,this.navigateByName=function(t,n,e){var o=I(t,n);return null!==o&&(q(o.replace(new RegExp("^/?"+i),""),e),!0)},this.destroy=function(){this.routes=w=[],A&&window.removeEventListener("popstate",this.__popstateListener),this.destroyed=L=!0},this.notFound=function(t,n){return r._notFoundRoute=N("*",t,[e,n],"__NOT_FOUND__"),this},this.updatePageLinks=F,this.link=function(t){return"/"+i+"/"+s(t)},this.hooks=function(t){return e=t,this},this.extractGETParameters=function(t){return h(R(t))},this.lastResolved=function(){return d},this.generate=I,this.getLinkPath=function(t){return t.getAttribute("href")},this.match=function(t){var n={instance:r,currentLocationPath:t,to:t,navigateOptions:{},resolveOptions:o};return _(n,(function(){})),!!n.matches&&n.matches},this.matchLocation=function(t,n,e){void 0===n||void 0!==e&&!e||(n=E(n));var o={instance:r,to:n,currentLocationPath:n};return y(o,(function(){})),"string"==typeof t&&(t=void 0===e||e?E(t):t),l(o,{name:String(t),path:t,handler:function(){},hooks:{}})||!1},this.getCurrentLocation=function(){return M(s(a(i)).replace(new RegExp("^"+i),""))},this.addBeforeHook=T.bind(this,"before"),this.addAfterHook=T.bind(this,"after"),this.addAlreadyHook=T.bind(this,"already"),this.addLeaveHook=T.bind(this,"leave"),this.getRoute=z,this._pathToMatchObject=M,this._clean=s,this._checkForAHash=R,this._setCurrent=function(t){return d=r.current=t},function(){A&&(this.__popstateListener=function(){r.__freezeListening||U()},window.addEventListener("popstate",this.__popstateListener))}.call(this),F.call(this)}}},n={};function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{}};return t[o](r,r.exports,e),r.exports}return e.d=function(t,n){for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e(407)}().default})); //# sourceMappingURL=navigo.min.js.map \ No newline at end of file diff --git a/lib/navigo.min.js.map b/lib/navigo.min.js.map index b89cc78a..4e0d73ba 100644 --- a/lib/navigo.min.js.map +++ b/lib/navigo.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://Navigo/webpack/universalModuleDefinition","webpack://Navigo/./src/constants.ts","webpack://Navigo/./src/utils.ts","webpack://Navigo/./src/Q.ts","webpack://Navigo/./src/middlewares/setLocationPath.ts","webpack://Navigo/./src/middlewares/matchPathToRegisteredRoutes.ts","webpack://Navigo/./src/middlewares/checkForDeprecationMethods.ts","webpack://Navigo/./src/middlewares/checkForForceOp.ts","webpack://Navigo/./src/middlewares/updateBrowserURL.ts","webpack://Navigo/./src/middlewares/checkForLeaveHook.ts","webpack://Navigo/./src/middlewares/updateState.ts","webpack://Navigo/./src/lifecycles.ts","webpack://Navigo/./src/middlewares/checkForAlreadyHook.ts","webpack://Navigo/./src/middlewares/checkForBeforeHook.ts","webpack://Navigo/./src/middlewares/callHandler.ts","webpack://Navigo/./src/middlewares/checkForAfterHook.ts","webpack://Navigo/./src/middlewares/checkForNotFoundHandler.ts","webpack://Navigo/./src/middlewares/errorOut.ts","webpack://Navigo/./src/middlewares/flushCurrent.ts","webpack://Navigo/./src/middlewares/processMatches.ts","webpack://Navigo/./src/middlewares/waitingList.ts","webpack://Navigo/./src/index.ts","webpack://Navigo/webpack/bootstrap","webpack://Navigo/webpack/startup","webpack://Navigo/webpack/runtime/define property getters","webpack://Navigo/webpack/runtime/hasOwnProperty shorthand"],"names":["root","factory","exports","module","define","amd","self","this","PARAMETER_REGEXP","WILDCARD_REGEXP","NOT_SURE_REGEXP","getCurrentEnvURL","fallback","windowAvailable","location","pathname","search","hash","clean","s","replace","isString","extractHashFromURL","url","indexOf","split","pop","extractGETParameters","tmp","slice","join","parseQuery","queryString","query","pairs","i","length","pair","key","decodeURIComponent","Array","isArray","push","matchRoute","context","route","pattern","currentLocationPath","current","GETParams","params","paramNames","path","full","dots","name","hashString","to","data","regexp","RegExp","match","names","reduce","value","index","regExpResultToParams","groups","instance","pushStateAvailable","window","history","pushState","undefinedOrTrue","obj","accumulateHooks","hooks","result","filter","h","forEach","type","Q","funcs","c","done","idx","next","splice","moveForward","setLocationPath","_checkForAHash","matchPathToRegisteredRoutes","routes","matches","resolveOptions","strategy","checkForDeprecationMethods","navigateOptions","console","warn","checkForForceOp","force","_setCurrent","_pathToMatchObject","if","condition","one","two","isWindowAvailable","isPushStateAvailable","updateBrowserURL","isItUsingHash","historyAPIMethod","stateObj","title","__freezeListening","setTimeout","href","checkForLeaveHook","lastResolved","map","oldMatch","_","leaveLoopDone","leave","runHook","newLocationVSOldMatch","matchLocation","find","f","d","shouldStop","__markAsClean","undefined","concat","updateState","foundLifecycle","already","before","handler","updatePageLinks","after","notFoundLifeCycle","notFoundRoute","_notFoundRoute","notFoundHandled","notFoundMatch","noMatchWarning","processMatches","nextMatch","waitingList","DEFAULT_LINK_SELECTOR","Navigo","appRoute","options","genericHooks","DEFAULT_RESOLVE_OPTIONS","linksSelector","destroyed","composePathWithRoot","createRoute","String","resolve","__dirty","__waiting","navigate","call","document","querySelectorAll","link","getAttribute","hasListenerAttached","navigoHandler","e","ctrlKey","metaKey","target","tagName","toLowerCase","URL","u","err","source","str","temp","v","parseNavigateOptions","preventDefault","stopPropagation","addEventListener","removeEventListener","generate","r","includeRoot","pathToMatchObject","addHook","func","getRoute","nameOrHandler","shift","on","Object","keys","p","uses","as","off","what","navigateByName","destroy","__popstateListener","notFound","getLinkPath","currentLocation","annotatePathWithRoot","getCurrentLocation","addBeforeHook","bind","addAfterHook","addAlreadyHook","addLeaveHook","_clean","__webpack_module_cache__","__webpack_require__","moduleId","__webpack_modules__","definition","o","defineProperty","enumerable","get","prop","prototype","hasOwnProperty"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,SAAU,GAAIH,GACK,iBAAZC,QACdA,QAAgB,OAAID,IAEpBD,EAAa,OAAIC,IARnB,CASmB,oBAATK,KAAuBA,KAAOC,MAAM,WAC9C,M,+DCVO,IAAMC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B,KAAKnN,KAAM,UACxCA,KAAKoN,aAAevB,EAAQsB,KAAKnN,KAAM,SACvCA,KAAKqN,eAAiBxB,EAAQsB,KAAKnN,KAAM,WACzCA,KAAKsN,aAAezB,EAAQsB,KAAKnN,KAAM,SACvCA,KAAK+L,SAAWA,EAChB/L,KAAKiG,mBAAqB2F,EAC1B5L,KAAKuN,OAAS5M,EACdX,KAAKoF,eAAiBA,EACtBpF,KAAKgG,YAAc,SAACnB,GAAD,OAAQpC,EAAU1C,EAAK0C,QAAUoC,GAvPpD,WACM0B,IACFvG,KAAK4M,mBAAqB,WACnB7M,EAAK8G,mBACR+C,KAGJ7F,OAAOwH,iBAAiB,WAAYvL,KAAK4M,sBAkPtC5C,KAAKhK,MACZsI,EAAgB0B,KAAKhK,SC1cnBwN,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAU/N,QAG3C,IAAIC,EAAS4N,EAAyBE,GAAY,CAGjD/N,QAAS,IAOV,OAHAgO,EAAoBD,GAAU9N,EAAQA,EAAOD,QAAS8N,GAG/C7N,EAAOD,QCjBf,OCFA8N,EAAoB7F,EAAI,CAACjI,EAASiO,KACjC,IAAI,IAAI7L,KAAO6L,EACXH,EAAoBI,EAAED,EAAY7L,KAAS0L,EAAoBI,EAAElO,EAASoC,IAC5EoK,OAAO2B,eAAenO,EAASoC,EAAK,CAAEgM,YAAY,EAAMC,IAAKJ,EAAW7L,MCJ3E0L,EAAoBI,EAAI,CAAC1J,EAAK8J,IAAS9B,OAAO+B,UAAUC,eAAenE,KAAK7F,EAAK8J,GFG1ER,EAAoB,M","file":"navigo.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Navigo\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Navigo\"] = factory();\n\telse\n\t\troot[\"Navigo\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn ","export const PARAMETER_REGEXP = /([:*])(\\w+)/g;\nexport const REPLACE_VARIABLE_REGEXP = \"([^/]+)\";\nexport const WILDCARD_REGEXP = /\\*/g;\nexport const REPLACE_WILDCARD = \"?(?:.*)\";\nexport const NOT_SURE_REGEXP = /\\/\\?/g;\nexport const REPLACE_NOT_SURE = \"/?([^/]+|)\";\nexport const START_BY_SLASH_REGEXP = \"(?:/^|^)\";\nexport const MATCH_REGEXP_FLAGS = \"\";\n","import {\n RouteHooksStorage,\n Match,\n Route,\n NavigateOptions,\n ResolveOptions,\n QContext,\n ResolveStrategy,\n} from \"../index\";\n\nimport {\n PARAMETER_REGEXP,\n WILDCARD_REGEXP,\n REPLACE_VARIABLE_REGEXP,\n REPLACE_WILDCARD,\n START_BY_SLASH_REGEXP,\n MATCH_REGEXP_FLAGS,\n REPLACE_NOT_SURE,\n NOT_SURE_REGEXP,\n} from \"./constants\";\n\nexport function getCurrentEnvURL(fallback = \"/\"): string {\n if (windowAvailable()) {\n return location.pathname + location.search + location.hash;\n }\n return fallback;\n}\nexport function clean(s: string) {\n return s.replace(/\\/+$/, \"\").replace(/^\\/+/, \"\");\n}\nexport function isString(s: any): boolean {\n return typeof s === \"string\";\n}\nexport function isFunction(s: any): boolean {\n return typeof s === \"function\";\n}\nexport function extractHashFromURL(url: string) {\n if (url && url.indexOf(\"#\") >= 0) {\n return url.split(\"#\").pop() || \"\";\n }\n return \"\";\n}\nexport function regExpResultToParams(match, names: string[]) {\n if (names.length === 0) return null;\n if (!match) return null;\n return match.slice(1, match.length).reduce((params, value, index) => {\n if (params === null) params = {};\n params[names[index]] = decodeURIComponent(value);\n return params;\n }, null);\n}\nexport function extractGETParameters(url: string) {\n const tmp = clean(url).split(/\\?(.*)?$/);\n return [clean(tmp[0]), tmp.slice(1).join(\"\")];\n}\nexport function parseQuery(queryString: string): Object {\n var query = {};\n var pairs = queryString.split(\"&\");\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i].split(\"=\");\n if (pair[0] !== \"\") {\n let key = decodeURIComponent(pair[0]);\n if (!query[key]) {\n query[key] = decodeURIComponent(pair[1] || \"\");\n } else {\n if (!Array.isArray(query[key])) query[key] = [query[key]];\n query[key].push(decodeURIComponent(pair[1] || \"\"));\n }\n }\n }\n return query;\n}\nexport function matchRoute(context: QContext, route: Route): false | Match {\n const [current, GETParams] = extractGETParameters(\n clean(context.currentLocationPath)\n );\n const params = GETParams === \"\" ? null : parseQuery(GETParams);\n const paramNames = [];\n let pattern;\n if (isString(route.path)) {\n pattern =\n START_BY_SLASH_REGEXP +\n clean(route.path as string)\n .replace(PARAMETER_REGEXP, function (full, dots, name) {\n paramNames.push(name);\n return REPLACE_VARIABLE_REGEXP;\n })\n .replace(WILDCARD_REGEXP, REPLACE_WILDCARD)\n .replace(NOT_SURE_REGEXP, REPLACE_NOT_SURE) +\n \"$\";\n if (clean(route.path as string) === \"\") {\n if (clean(current) === \"\") {\n return {\n url: current,\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data: null,\n params,\n };\n }\n }\n } else {\n pattern = route.path;\n }\n const regexp = new RegExp(pattern, MATCH_REGEXP_FLAGS);\n const match = current.match(regexp);\n\n if (match) {\n const data = isString(route.path)\n ? regExpResultToParams(match, paramNames)\n : match.groups\n ? match.groups\n : match.slice(1);\n return {\n url: clean(current.replace(new RegExp(`^${context.instance.root}`), \"\")),\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data,\n params,\n };\n }\n return false;\n}\nexport function pushStateAvailable(): boolean {\n return !!(\n typeof window !== \"undefined\" &&\n window.history &&\n window.history.pushState\n );\n}\nexport function undefinedOrTrue(obj, key: string): boolean {\n return typeof obj[key] === \"undefined\" || obj[key] === true;\n}\nexport function parseNavigateOptions(source?: string): NavigateOptions {\n if (!source) return {};\n const pairs = source.split(\",\");\n const options: NavigateOptions = {};\n let resolveOptions: ResolveOptions;\n\n pairs.forEach((str) => {\n const temp = str.split(\":\").map((v) => v.replace(/(^ +| +$)/g, \"\"));\n switch (temp[0]) {\n case \"historyAPIMethod\":\n options.historyAPIMethod = temp[1];\n break;\n case \"resolveOptionsStrategy\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.strategy = temp[1] as ResolveStrategy;\n break;\n case \"resolveOptionsHash\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.hash = temp[1] === \"true\";\n break;\n case \"updateBrowserURL\":\n case \"callHandler\":\n case \"updateState\":\n case \"force\":\n options[temp[0]] = temp[1] === \"true\";\n break;\n }\n });\n if (resolveOptions) {\n options.resolveOptions = resolveOptions;\n }\n return options;\n}\nexport function windowAvailable() {\n return typeof window !== \"undefined\";\n}\nexport function accumulateHooks(\n hooks = [],\n result: RouteHooksStorage = {}\n): RouteHooksStorage {\n hooks\n .filter((h) => h)\n .forEach((h) => {\n [\"before\", \"after\", \"already\", \"leave\"].forEach((type) => {\n if (h[type]) {\n if (!result[type]) result[type] = [];\n result[type].push(h[type]);\n }\n });\n });\n return result as RouteHooksStorage;\n}\n","type QChild = {\n type: \"child\";\n funcs: Array | QChild>;\n};\n\nexport default function Q(\n funcs: Array | QChild>,\n c?: any,\n done?: Function\n) {\n const context = c || {};\n let idx = 0;\n\n (function next() {\n if (!funcs[idx]) {\n if (done) {\n done(context);\n }\n return;\n }\n if (Array.isArray(funcs[idx])) {\n funcs.splice(\n idx,\n 1,\n ...(funcs[idx][0](context) ? funcs[idx][1] : funcs[idx][2])\n );\n next();\n } else {\n // console.log(funcs[idx].name + \" / \" + JSON.stringify(context));\n // console.log(funcs[idx].name);\n (funcs[idx] as Function)(context, (moveForward) => {\n if (typeof moveForward === \"undefined\" || moveForward === true) {\n idx += 1;\n next();\n } else if (done) {\n done(context);\n }\n });\n }\n })();\n}\n\nQ.if = function (condition: Function, one, two) {\n if (!Array.isArray(one)) one = [one];\n if (!Array.isArray(two)) two = [two];\n return [condition, one, two];\n};\n","import { QContext } from \"../../index\";\nimport { getCurrentEnvURL } from \"../utils\";\n\nexport default function setLocationPath(context: QContext, done) {\n if (typeof context.currentLocationPath === \"undefined\") {\n context.currentLocationPath = context.to = getCurrentEnvURL(\n context.instance.root\n );\n }\n context.currentLocationPath = context.instance._checkForAHash(\n context.currentLocationPath\n );\n done();\n}\n","import { matchRoute } from \"../utils\";\nimport { QContext, Match } from \"../../index\";\n\nexport default function matchPathToRegisteredRoutes(context: QContext, done) {\n for (let i = 0; i < context.instance.routes.length; i++) {\n const route = context.instance.routes[i];\n const match: false | Match = matchRoute(context, route);\n if (match) {\n if (!context.matches) context.matches = [];\n context.matches.push(match);\n if (context.resolveOptions.strategy === \"ONE\") {\n done();\n return;\n }\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForDeprecationMethods(context: QContext, done) {\n if (context.navigateOptions) {\n if (typeof context.navigateOptions[\"shouldResolve\"] !== \"undefined\") {\n console.warn(\n `\"shouldResolve\" is deprecated. Please check the documentation.`\n );\n }\n if (typeof context.navigateOptions[\"silent\"] !== \"undefined\") {\n console.warn(`\"silent\" is deprecated. Please check the documentation.`);\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForForceOp(context: QContext, done) {\n if (context.navigateOptions.force === true) {\n context.instance._setCurrent([\n context.instance._pathToMatchObject(context.to),\n ]);\n done(false);\n } else {\n done();\n }\n}\n","import { undefinedOrTrue, pushStateAvailable, windowAvailable } from \"../utils\";\nimport { QContext } from \"../../index\";\n\nconst isWindowAvailable = windowAvailable();\nconst isPushStateAvailable = pushStateAvailable();\n\nexport default function updateBrowserURL(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateBrowserURL\")) {\n const value = `/${context.to}`.replace(/\\/\\//g, \"/\"); // making sure that we don't have two slashes\n const isItUsingHash =\n isWindowAvailable &&\n context.resolveOptions &&\n context.resolveOptions.hash === true;\n if (isPushStateAvailable) {\n history[context.navigateOptions.historyAPIMethod || \"pushState\"](\n context.navigateOptions.stateObj || {},\n context.navigateOptions.title || \"\",\n isItUsingHash ? `#${value}` : value\n );\n // This is to solve a nasty bug where the page doesn't scroll to the anchor.\n // We set a microtask to update the hash only.\n if (location && location.hash) {\n context.instance.__freezeListening = true;\n setTimeout(() => {\n let tmp = location.hash;\n location.hash = \"\";\n location.hash = tmp;\n context.instance.__freezeListening = false;\n }, 1);\n }\n } else if (isWindowAvailable) {\n window.location.href = context.to;\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForLeaveHook(context: QContext, done) {\n const instance = context.instance;\n if (!instance.lastResolved()) {\n done();\n return;\n }\n Q(\n instance.lastResolved().map((oldMatch) => {\n return (_, leaveLoopDone) => {\n // no leave hook\n if (!oldMatch.route.hooks || !oldMatch.route.hooks.leave) {\n leaveLoopDone();\n return;\n }\n let runHook = false;\n const newLocationVSOldMatch = context.instance.matchLocation(\n oldMatch.route.path,\n context.currentLocationPath,\n false\n );\n if (oldMatch.route.path !== \"*\") {\n runHook = !newLocationVSOldMatch;\n } else {\n const someOfTheLastOnesMatch = context.matches\n ? context.matches.find((match) => {\n return oldMatch.route.path === match.route.path;\n })\n : false;\n runHook = !someOfTheLastOnesMatch;\n }\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\") && runHook) {\n Q(\n oldMatch.route.hooks.leave\n .map((f) => {\n // just so we match the Q interface\n return (_, d) =>\n f(\n (shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n },\n context.matches && context.matches.length > 0\n ? context.matches.length === 1\n ? context.matches[0]\n : context.matches\n : undefined\n );\n })\n .concat([() => leaveLoopDone()])\n );\n return;\n } else {\n leaveLoopDone();\n }\n };\n }),\n {},\n () => done()\n );\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function updateState(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateState\")) {\n context.instance._setCurrent(context.matches);\n }\n done();\n}\n","import { QContext } from \"../index\";\nimport Q from \"./Q\";\nimport checkForLeaveHook from \"./middlewares/checkForLeaveHook\";\nimport checkForBeforeHook from \"./middlewares/checkForBeforeHook\";\nimport callHandler from \"./middlewares/callHandler\";\nimport checkForAfterHook from \"./middlewares/checkForAfterHook\";\nimport checkForAlreadyHook from \"./middlewares/checkForAlreadyHook\";\nimport checkForNotFoundHandler from \"./middlewares/checkForNotFoundHandler\";\nimport errorOut from \"./middlewares/errorOut\";\nimport flushCurrent from \"./middlewares/flushCurrent\";\nimport updateState from \"./middlewares/updateState\";\n\nexport const foundLifecycle = [\n checkForAlreadyHook,\n checkForBeforeHook,\n callHandler,\n checkForAfterHook,\n];\n\nexport const notFoundLifeCycle = [\n checkForLeaveHook,\n checkForNotFoundHandler,\n Q.if(\n ({ notFoundHandled }: QContext) => notFoundHandled,\n foundLifecycle.concat([updateState]),\n [errorOut, flushCurrent]\n ),\n];\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAlreadyHook(context: QContext, done) {\n const current = context.instance.lastResolved();\n if (\n current &&\n current[0] &&\n current[0].route === context.match.route &&\n current[0].url === context.match.url &&\n current[0].queryString === context.match.queryString\n ) {\n current.forEach((c) => {\n if (c.route.hooks && c.route.hooks.already) {\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\")) {\n c.route.hooks.already.forEach((f) => f(context.match));\n }\n }\n });\n done(false);\n return;\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForBeforeHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.before &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n Q(\n context.match.route.hooks.before\n .map((f) => {\n // just so we match the Q interface\n return function beforeHookInternal(_, d) {\n return f((shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n }, context.match);\n };\n })\n .concat([() => done()])\n );\n } else {\n done();\n }\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function callHandler(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"callHandler\")) {\n context.match.route.handler(context.match);\n }\n context.instance.updatePageLinks();\n done();\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAfterHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.after &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n context.match.route.hooks.after.forEach((f) => f(context.match));\n }\n done();\n}\n","import { QContext, Match } from \"../../index\";\nimport {\n parseQuery,\n extractGETParameters,\n clean,\n extractHashFromURL,\n} from \"../utils\";\n\nexport default function checkForNotFoundHandler(context: QContext, done) {\n const notFoundRoute = context.instance._notFoundRoute;\n if (notFoundRoute) {\n context.notFoundHandled = true;\n const [url, queryString] = extractGETParameters(\n context.currentLocationPath\n );\n const hashString = extractHashFromURL(context.to);\n notFoundRoute.path = clean(url);\n const notFoundMatch: Match = {\n url: notFoundRoute.path,\n queryString,\n hashString,\n data: null,\n route: notFoundRoute,\n params: queryString !== \"\" ? parseQuery(queryString) : null,\n };\n context.matches = [notFoundMatch];\n context.match = notFoundMatch;\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function errorOut(context: QContext, done) {\n if (\n !context.resolveOptions ||\n context.resolveOptions.noMatchWarning === false ||\n typeof context.resolveOptions.noMatchWarning === \"undefined\"\n )\n console.warn(\n `Navigo: \"${context.currentLocationPath}\" didn't match any of the registered routes.`\n );\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function flushCurrent(context: QContext, done) {\n context.instance._setCurrent(null);\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { foundLifecycle } from \"../lifecycles\";\nimport updateState from \"./updateState\";\nimport checkForLeaveHook from \"./checkForLeaveHook\";\n\nexport default function processMatches(context: QContext, done) {\n let idx = 0;\n function nextMatch() {\n if (idx === context.matches.length) {\n updateState(context, done);\n return;\n }\n Q(\n foundLifecycle,\n { ...context, match: context.matches[idx] },\n function end() {\n idx += 1;\n nextMatch();\n }\n );\n }\n checkForLeaveHook(context, nextMatch);\n}\n","import { QContext } from \"../../index\";\n\nexport default function waitingList(context: QContext) {\n context.instance.__markAsClean(context);\n}\n","import {\n Match,\n Route,\n RouteHooks,\n QContext,\n NavigateOptions,\n ResolveOptions,\n GenerateOptions,\n Handler,\n RouterOptions,\n} from \"../index\";\nimport NavigoRouter from \"../index\";\nimport {\n pushStateAvailable,\n matchRoute,\n parseQuery,\n extractGETParameters,\n isFunction,\n isString,\n clean,\n parseNavigateOptions,\n windowAvailable,\n getCurrentEnvURL,\n accumulateHooks,\n extractHashFromURL,\n} from \"./utils\";\nimport Q from \"./Q\";\nimport setLocationPath from \"./middlewares/setLocationPath\";\nimport matchPathToRegisteredRoutes from \"./middlewares/matchPathToRegisteredRoutes\";\nimport checkForDeprecationMethods from \"./middlewares/checkForDeprecationMethods\";\nimport checkForForceOp from \"./middlewares/checkForForceOp\";\nimport updateBrowserURL from \"./middlewares/updateBrowserURL\";\nimport processMatches from \"./middlewares/processMatches\";\nimport waitingList from \"./middlewares/waitingList\";\n\nimport { notFoundLifeCycle } from \"./lifecycles\";\n\nconst DEFAULT_LINK_SELECTOR = \"[data-navigo]\";\n\nexport default function Navigo(appRoute?: string, options?: RouterOptions) {\n let DEFAULT_RESOLVE_OPTIONS: RouterOptions = options || {\n strategy: \"ONE\",\n hash: false,\n noMatchWarning: false,\n linksSelector: DEFAULT_LINK_SELECTOR,\n };\n let self: NavigoRouter = this;\n let root = \"/\";\n let current: Match[] = null;\n let routes: Route[] = [];\n let destroyed = false;\n let genericHooks: RouteHooks;\n\n const isPushStateAvailable = pushStateAvailable();\n const isWindowAvailable = windowAvailable();\n\n if (!appRoute) {\n console.warn(\n 'Navigo requires a root path in its constructor. If not provided will use \"/\" as default.'\n );\n } else {\n root = clean(appRoute);\n }\n\n function _checkForAHash(url: string): string {\n if (url.indexOf(\"#\") >= 0) {\n if (DEFAULT_RESOLVE_OPTIONS.hash === true) {\n url = url.split(\"#\")[1] || \"/\";\n } else {\n url = url.split(\"#\")[0];\n }\n }\n return url;\n }\n function composePathWithRoot(path: string) {\n return clean(`${root}/${clean(path)}`);\n }\n function createRoute(\n path: string | RegExp,\n handler: Handler,\n hooks: RouteHooks[],\n name?: string\n ): Route {\n path = isString(path) ? composePathWithRoot(path as string) : path;\n return {\n name: name || clean(String(path)),\n path,\n handler,\n hooks: accumulateHooks(hooks),\n };\n }\n\n // public APIs\n function on(\n path: string | Function | Object | RegExp,\n handler?: Handler,\n hooks?: RouteHooks\n ) {\n if (typeof path === \"object\" && !(path instanceof RegExp)) {\n Object.keys(path).forEach((p) => {\n if (typeof path[p] === \"function\") {\n this.on(p, path[p]);\n } else {\n const { uses: handler, as: name, hooks } = path[p];\n routes.push(createRoute(p, handler, [genericHooks, hooks], name));\n }\n });\n return this;\n } else if (typeof path === \"function\") {\n hooks = handler as RouteHooks;\n handler = path as Handler;\n path = root;\n }\n routes.push(\n createRoute(path as string | RegExp, handler, [genericHooks, hooks])\n );\n return this;\n }\n function resolve(to?: string, options?: ResolveOptions): false | Match[] {\n if (self.__dirty) {\n self.__waiting.push(() => self.resolve(to, options));\n return;\n } else {\n self.__dirty = true;\n }\n to = to ? `${clean(root)}/${clean(to)}` : undefined;\n // console.log(\"-- resolve --> \" + to, self.__dirty);\n const context: QContext = {\n instance: self,\n to,\n currentLocationPath: to,\n navigateOptions: {},\n resolveOptions: { ...DEFAULT_RESOLVE_OPTIONS, ...options },\n };\n Q(\n [\n setLocationPath,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n ],\n context,\n waitingList\n );\n\n return context.matches ? context.matches : false;\n }\n function navigate(to: string, navigateOptions?: NavigateOptions): void {\n // console.log(\"-- navigate --> \" + to, self.__dirty);\n if (self.__dirty) {\n self.__waiting.push(() => self.navigate(to, navigateOptions));\n return;\n } else {\n self.__dirty = true;\n }\n to = `${clean(root)}/${clean(to)}`;\n const context: QContext = {\n instance: self,\n to,\n navigateOptions: navigateOptions || {},\n resolveOptions:\n navigateOptions && navigateOptions.resolveOptions\n ? navigateOptions.resolveOptions\n : DEFAULT_RESOLVE_OPTIONS,\n currentLocationPath: _checkForAHash(to),\n };\n Q(\n [\n checkForDeprecationMethods,\n checkForForceOp,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n updateBrowserURL,\n waitingList,\n ],\n context,\n waitingList\n );\n }\n function navigateByName(\n name: string,\n data?: Object,\n options?: NavigateOptions\n ): boolean {\n const url = generate(name, data);\n if (url !== null) {\n navigate(url.replace(new RegExp(`^\\/?${root}`), \"\"), options);\n return true;\n }\n return false;\n }\n function off(what: string | RegExp | Function) {\n this.routes = routes = routes.filter((r) => {\n if (isString(what)) {\n return clean(r.path as string) !== clean(what as string);\n } else if (isFunction(what)) {\n return what !== r.handler;\n }\n return String(r.path) !== String(what);\n });\n return this;\n }\n function listen() {\n if (isPushStateAvailable) {\n this.__popstateListener = () => {\n if (!self.__freezeListening) {\n resolve();\n }\n };\n window.addEventListener(\"popstate\", this.__popstateListener);\n }\n }\n function destroy() {\n this.routes = routes = [];\n if (isPushStateAvailable) {\n window.removeEventListener(\"popstate\", this.__popstateListener);\n }\n this.destroyed = destroyed = true;\n }\n function notFound(handler, hooks?: RouteHooks) {\n self._notFoundRoute = createRoute(\n \"*\",\n handler,\n [genericHooks, hooks],\n \"__NOT_FOUND__\"\n );\n return this;\n }\n function updatePageLinks() {\n if (!isWindowAvailable) return;\n findLinks().forEach((link) => {\n if (\n \"false\" === link.getAttribute(\"data-navigo\") ||\n \"_blank\" === link.getAttribute(\"target\")\n ) {\n if (link.hasListenerAttached) {\n link.removeEventListener(\"click\", link.navigoHandler);\n }\n return;\n }\n if (!link.hasListenerAttached) {\n link.hasListenerAttached = true;\n link.navigoHandler = function (e) {\n if (\n (e.ctrlKey || e.metaKey) &&\n e.target.tagName.toLowerCase() === \"a\"\n ) {\n return false;\n }\n let location = link.getAttribute(\"href\");\n if (typeof location === \"undefined\" || location === null) {\n return false;\n }\n // handling absolute paths\n if (location.match(/^(http|https)/) && typeof URL !== \"undefined\") {\n try {\n const u = new URL(location);\n location = u.pathname + u.search;\n } catch (err) {}\n }\n const options = parseNavigateOptions(\n link.getAttribute(\"data-navigo-options\")\n );\n\n if (!destroyed) {\n e.preventDefault();\n e.stopPropagation();\n self.navigate(clean(location), options);\n }\n };\n link.addEventListener(\"click\", link.navigoHandler);\n }\n });\n return self;\n }\n function findLinks() {\n if (isWindowAvailable) {\n return [].slice.call(\n document.querySelectorAll(\n DEFAULT_RESOLVE_OPTIONS.linksSelector || DEFAULT_LINK_SELECTOR\n )\n );\n }\n return [];\n }\n function link(path: string) {\n return `/${root}/${clean(path)}`;\n }\n function setGenericHooks(hooks: RouteHooks) {\n genericHooks = hooks;\n return this;\n }\n function lastResolved(): Match[] | null {\n return current;\n }\n function generate(\n name: string,\n data?: Object,\n options?: GenerateOptions\n ): string {\n const route = routes.find((r) => r.name === name);\n let result = null;\n if (route) {\n result = route.path as string;\n if (data) {\n for (let key in data) {\n result = result.replace(\":\" + key, data[key]);\n }\n }\n result = !result.match(/^\\//) ? `/${result}` : result;\n }\n if (result && options && !options.includeRoot) {\n result = result.replace(new RegExp(`^/${root}`), \"\");\n }\n return result;\n }\n function getLinkPath(link) {\n return link.getAttribute(\"href\");\n }\n function pathToMatchObject(path: string): Match {\n const [url, queryString] = extractGETParameters(clean(path));\n const params = queryString === \"\" ? null : parseQuery(queryString);\n const hashString = extractHashFromURL(path);\n const route = createRoute(url, () => {}, [genericHooks], url);\n return {\n url,\n queryString,\n hashString,\n route,\n data: null,\n params: params,\n };\n }\n function getCurrentLocation(): Match {\n return pathToMatchObject(\n clean(getCurrentEnvURL(root)).replace(new RegExp(`^${root}`), \"\")\n );\n }\n function directMatchWithRegisteredRoutes(path: string): false | Match[] {\n const context: QContext = {\n instance: self,\n currentLocationPath: path,\n to: path,\n navigateOptions: {},\n resolveOptions: DEFAULT_RESOLVE_OPTIONS,\n };\n matchPathToRegisteredRoutes(context, () => {});\n return context.matches ? context.matches : false;\n }\n function directMatchWithLocation(\n path: string | RegExp,\n currentLocation?: string,\n annotatePathWithRoot?: boolean\n ): false | Match {\n if (\n typeof currentLocation !== \"undefined\" &&\n (typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot)\n ) {\n currentLocation = composePathWithRoot(currentLocation);\n }\n const context: QContext = {\n instance: self,\n to: currentLocation,\n currentLocationPath: currentLocation,\n };\n setLocationPath(context, () => {});\n if (typeof path === \"string\") {\n path =\n typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot\n ? composePathWithRoot(path)\n : path;\n }\n const match = matchRoute(context, {\n name: String(path),\n path,\n handler: () => {},\n hooks: {},\n });\n return match ? match : false;\n }\n function addHook(\n type: string,\n route: Route | string,\n func: Function\n ): Function {\n if (typeof route === \"string\") {\n route = getRoute(route);\n }\n if (route) {\n if (!route.hooks[type]) route.hooks[type] = [];\n route.hooks[type].push(func);\n return () => {\n (route as Route).hooks[type] = (route as Route).hooks[type].filter(\n (f) => f !== func\n );\n };\n } else {\n console.warn(`Route doesn't exists: ${route}`);\n }\n return () => {};\n }\n function getRoute(nameOrHandler: string | Function): Route | undefined {\n if (typeof nameOrHandler === \"string\") {\n return routes.find((r) => r.name === composePathWithRoot(nameOrHandler));\n }\n return routes.find((r) => r.handler === nameOrHandler);\n }\n function __markAsClean(context: QContext) {\n context.instance.__dirty = false;\n if (context.instance.__waiting.length > 0) {\n context.instance.__waiting.shift()();\n }\n }\n\n this.root = root;\n this.routes = routes;\n this.destroyed = destroyed;\n this.current = current;\n this.__freezeListening = false;\n this.__waiting = [];\n this.__dirty = false;\n this.__markAsClean = __markAsClean;\n\n this.on = on;\n this.off = off;\n this.resolve = resolve;\n this.navigate = navigate;\n this.navigateByName = navigateByName;\n this.destroy = destroy;\n this.notFound = notFound;\n this.updatePageLinks = updatePageLinks;\n this.link = link;\n this.hooks = setGenericHooks;\n this.extractGETParameters = (url) =>\n extractGETParameters(_checkForAHash(url));\n this.lastResolved = lastResolved;\n this.generate = generate;\n this.getLinkPath = getLinkPath;\n this.match = directMatchWithRegisteredRoutes;\n this.matchLocation = directMatchWithLocation;\n this.getCurrentLocation = getCurrentLocation;\n this.addBeforeHook = addHook.bind(this, \"before\");\n this.addAfterHook = addHook.bind(this, \"after\");\n this.addAlreadyHook = addHook.bind(this, \"already\");\n this.addLeaveHook = addHook.bind(this, \"leave\");\n this.getRoute = getRoute;\n this._pathToMatchObject = pathToMatchObject;\n this._clean = clean;\n this._checkForAHash = _checkForAHash;\n this._setCurrent = (c) => (current = self.current = c);\n\n listen.call(this);\n updatePageLinks.call(this);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// module exports must be returned from runtime so entry inlining is disabled\n// startup\n// Load entry module and return exports\nreturn __webpack_require__(407);\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://Navigo/webpack/universalModuleDefinition","webpack://Navigo/./src/constants.ts","webpack://Navigo/./src/utils.ts","webpack://Navigo/./src/Q.ts","webpack://Navigo/./src/middlewares/setLocationPath.ts","webpack://Navigo/./src/middlewares/matchPathToRegisteredRoutes.ts","webpack://Navigo/./src/middlewares/checkForDeprecationMethods.ts","webpack://Navigo/./src/middlewares/checkForForceOp.ts","webpack://Navigo/./src/middlewares/updateBrowserURL.ts","webpack://Navigo/./src/middlewares/checkForLeaveHook.ts","webpack://Navigo/./src/middlewares/updateState.ts","webpack://Navigo/./src/lifecycles.ts","webpack://Navigo/./src/middlewares/checkForAlreadyHook.ts","webpack://Navigo/./src/middlewares/checkForBeforeHook.ts","webpack://Navigo/./src/middlewares/callHandler.ts","webpack://Navigo/./src/middlewares/checkForAfterHook.ts","webpack://Navigo/./src/middlewares/checkForNotFoundHandler.ts","webpack://Navigo/./src/middlewares/errorOut.ts","webpack://Navigo/./src/middlewares/flushCurrent.ts","webpack://Navigo/./src/middlewares/processMatches.ts","webpack://Navigo/./src/middlewares/waitingList.ts","webpack://Navigo/./src/index.ts","webpack://Navigo/webpack/bootstrap","webpack://Navigo/webpack/startup","webpack://Navigo/webpack/runtime/define property getters","webpack://Navigo/webpack/runtime/hasOwnProperty shorthand"],"names":["root","factory","exports","module","define","amd","self","this","PARAMETER_REGEXP","WILDCARD_REGEXP","NOT_SURE_REGEXP","getCurrentEnvURL","fallback","windowAvailable","location","pathname","search","hash","clean","s","replace","isString","extractHashFromURL","url","indexOf","split","pop","extractGETParameters","tmp","slice","join","parseQuery","queryString","query","pairs","i","length","pair","key","decodeURIComponent","Array","isArray","push","matchRoute","context","route","pattern","currentLocationPath","current","GETParams","params","paramNames","path","full","dots","name","hashString","to","data","regexp","RegExp","match","names","reduce","value","index","regExpResultToParams","groups","instance","pushStateAvailable","window","history","pushState","undefinedOrTrue","obj","accumulateHooks","hooks","result","filter","h","forEach","type","Q","funcs","c","done","idx","next","splice","moveForward","setLocationPath","_checkForAHash","matchPathToRegisteredRoutes","routes","matches","resolveOptions","strategy","checkForDeprecationMethods","navigateOptions","console","warn","checkForForceOp","force","_setCurrent","_pathToMatchObject","if","condition","one","two","isWindowAvailable","isPushStateAvailable","updateBrowserURL","isItUsingHash","historyAPIMethod","stateObj","title","__freezeListening","setTimeout","href","checkForLeaveHook","lastResolved","map","oldMatch","_","leaveLoopDone","leave","runHook","newLocationVSOldMatch","matchLocation","find","f","d","shouldStop","__markAsClean","undefined","concat","updateState","foundLifecycle","already","before","handler","updatePageLinks","after","notFoundLifeCycle","notFoundRoute","_notFoundRoute","notFoundHandled","notFoundMatch","noMatchWarning","processMatches","nextMatch","waitingList","DEFAULT_LINK_SELECTOR","Navigo","appRoute","options","genericHooks","DEFAULT_RESOLVE_OPTIONS","linksSelector","destroyed","composePathWithRoot","createRoute","String","resolve","__dirty","__waiting","navigate","call","document","querySelectorAll","link","getAttribute","hasListenerAttached","navigoHandler","e","ctrlKey","metaKey","target","tagName","toLowerCase","URL","u","err","source","str","temp","v","parseNavigateOptions","preventDefault","stopPropagation","addEventListener","removeEventListener","generate","r","includeRoot","pathToMatchObject","addHook","func","getRoute","nameOrHandler","shift","on","Object","keys","p","uses","as","off","what","navigateByName","destroy","__popstateListener","notFound","getLinkPath","currentLocation","annotatePathWithRoot","getCurrentLocation","addBeforeHook","bind","addAfterHook","addAlreadyHook","addLeaveHook","_clean","__webpack_module_cache__","__webpack_require__","moduleId","__webpack_modules__","definition","o","defineProperty","enumerable","get","prop","prototype","hasOwnProperty"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,SAAU,GAAIH,GACK,iBAAZC,QACdA,QAAgB,OAAID,IAEpBD,EAAa,OAAIC,IARnB,CASmB,oBAATK,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e5D,GAAS,MA0GlEO,KAAKkN,cAAgBrB,EAAQsB,KAAKnN,KAAM,UACxCA,KAAKoN,aAAevB,EAAQsB,KAAKnN,KAAM,SACvCA,KAAKqN,eAAiBxB,EAAQsB,KAAKnN,KAAM,WACzCA,KAAKsN,aAAezB,EAAQsB,KAAKnN,KAAM,SACvCA,KAAK+L,SAAWA,EAChB/L,KAAKiG,mBAAqB2F,EAC1B5L,KAAKuN,OAAS5M,EACdX,KAAKoF,eAAiBA,EACtBpF,KAAKgG,YAAc,SAACnB,GAAD,OAAQpC,EAAU1C,EAAK0C,QAAUoC,GAvPpD,WACM0B,IACFvG,KAAK4M,mBAAqB,WACnB7M,EAAK8G,mBACR+C,KAGJ7F,OAAOwH,iBAAiB,WAAYvL,KAAK4M,sBAkPtC5C,KAAKhK,MACZsI,EAAgB0B,KAAKhK,SC1cnBwN,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAU/N,QAG3C,IAAIC,EAAS4N,EAAyBE,GAAY,CAGjD/N,QAAS,IAOV,OAHAgO,EAAoBD,GAAU9N,EAAQA,EAAOD,QAAS8N,GAG/C7N,EAAOD,QCjBf,OCFA8N,EAAoB7F,EAAI,SAASjI,EAASiO,GACzC,IAAI,IAAI7L,KAAO6L,EACXH,EAAoBI,EAAED,EAAY7L,KAAS0L,EAAoBI,EAAElO,EAASoC,IAC5EoK,OAAO2B,eAAenO,EAASoC,EAAK,CAAEgM,YAAY,EAAMC,IAAKJ,EAAW7L,MCJ3E0L,EAAoBI,EAAI,SAAS1J,EAAK8J,GAAQ,OAAO9B,OAAO+B,UAAUC,eAAenE,KAAK7F,EAAK8J,IFGxFR,EAAoB,K","file":"navigo.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Navigo\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Navigo\"] = factory();\n\telse\n\t\troot[\"Navigo\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn ","export const PARAMETER_REGEXP = /([:*])(\\w+)/g;\nexport const REPLACE_VARIABLE_REGEXP = \"([^/]+)\";\nexport const WILDCARD_REGEXP = /\\*/g;\nexport const REPLACE_WILDCARD = \"?(?:.*)\";\nexport const NOT_SURE_REGEXP = /\\/\\?/g;\nexport const REPLACE_NOT_SURE = \"/?([^/]+|)\";\nexport const START_BY_SLASH_REGEXP = \"(?:/^|^)\";\nexport const MATCH_REGEXP_FLAGS = \"\";\n","import {\n RouteHooksStorage,\n Match,\n Route,\n NavigateOptions,\n ResolveOptions,\n QContext,\n ResolveStrategy,\n} from \"../index\";\n\nimport {\n PARAMETER_REGEXP,\n WILDCARD_REGEXP,\n REPLACE_VARIABLE_REGEXP,\n REPLACE_WILDCARD,\n START_BY_SLASH_REGEXP,\n MATCH_REGEXP_FLAGS,\n REPLACE_NOT_SURE,\n NOT_SURE_REGEXP,\n} from \"./constants\";\n\nexport function getCurrentEnvURL(fallback = \"/\"): string {\n if (windowAvailable()) {\n return location.pathname + location.search + location.hash;\n }\n return fallback;\n}\nexport function clean(s: string) {\n return s.replace(/\\/+$/, \"\").replace(/^\\/+/, \"\");\n}\nexport function isString(s: any): boolean {\n return typeof s === \"string\";\n}\nexport function isFunction(s: any): boolean {\n return typeof s === \"function\";\n}\nexport function extractHashFromURL(url: string) {\n if (url && url.indexOf(\"#\") >= 0) {\n return url.split(\"#\").pop() || \"\";\n }\n return \"\";\n}\nexport function regExpResultToParams(match, names: string[]) {\n if (names.length === 0) return null;\n if (!match) return null;\n return match.slice(1, match.length).reduce((params, value, index) => {\n if (params === null) params = {};\n params[names[index]] = decodeURIComponent(value);\n return params;\n }, null);\n}\nexport function extractGETParameters(url: string) {\n const tmp = clean(url).split(/\\?(.*)?$/);\n return [clean(tmp[0]), tmp.slice(1).join(\"\")];\n}\nexport function parseQuery(queryString: string): Object {\n var query = {};\n var pairs = queryString.split(\"&\");\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i].split(\"=\");\n if (pair[0] !== \"\") {\n let key = decodeURIComponent(pair[0]);\n if (!query[key]) {\n query[key] = decodeURIComponent(pair[1] || \"\");\n } else {\n if (!Array.isArray(query[key])) query[key] = [query[key]];\n query[key].push(decodeURIComponent(pair[1] || \"\"));\n }\n }\n }\n return query;\n}\nexport function matchRoute(context: QContext, route: Route): false | Match {\n const [current, GETParams] = extractGETParameters(\n clean(context.currentLocationPath)\n );\n const params = GETParams === \"\" ? null : parseQuery(GETParams);\n const paramNames = [];\n let pattern;\n if (isString(route.path)) {\n pattern =\n START_BY_SLASH_REGEXP +\n clean(route.path as string)\n .replace(PARAMETER_REGEXP, function (full, dots, name) {\n paramNames.push(name);\n return REPLACE_VARIABLE_REGEXP;\n })\n .replace(WILDCARD_REGEXP, REPLACE_WILDCARD)\n .replace(NOT_SURE_REGEXP, REPLACE_NOT_SURE) +\n \"$\";\n if (clean(route.path as string) === \"\") {\n if (clean(current) === \"\") {\n return {\n url: current,\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data: null,\n params,\n };\n }\n }\n } else {\n pattern = route.path;\n }\n const regexp = new RegExp(pattern, MATCH_REGEXP_FLAGS);\n const match = current.match(regexp);\n\n if (match) {\n const data = isString(route.path)\n ? regExpResultToParams(match, paramNames)\n : match.groups\n ? match.groups\n : match.slice(1);\n return {\n url: clean(current.replace(new RegExp(`^${context.instance.root}`), \"\")),\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data,\n params,\n };\n }\n return false;\n}\nexport function pushStateAvailable(): boolean {\n return !!(\n typeof window !== \"undefined\" &&\n window.history &&\n window.history.pushState\n );\n}\nexport function undefinedOrTrue(obj, key: string): boolean {\n return typeof obj[key] === \"undefined\" || obj[key] === true;\n}\nexport function parseNavigateOptions(source?: string): NavigateOptions {\n if (!source) return {};\n const pairs = source.split(\",\");\n const options: NavigateOptions = {};\n let resolveOptions: ResolveOptions;\n\n pairs.forEach((str) => {\n const temp = str.split(\":\").map((v) => v.replace(/(^ +| +$)/g, \"\"));\n switch (temp[0]) {\n case \"historyAPIMethod\":\n options.historyAPIMethod = temp[1];\n break;\n case \"resolveOptionsStrategy\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.strategy = temp[1] as ResolveStrategy;\n break;\n case \"resolveOptionsHash\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.hash = temp[1] === \"true\";\n break;\n case \"updateBrowserURL\":\n case \"callHandler\":\n case \"updateState\":\n case \"force\":\n options[temp[0]] = temp[1] === \"true\";\n break;\n }\n });\n if (resolveOptions) {\n options.resolveOptions = resolveOptions;\n }\n return options;\n}\nexport function windowAvailable() {\n return typeof window !== \"undefined\";\n}\nexport function accumulateHooks(\n hooks = [],\n result: RouteHooksStorage = {}\n): RouteHooksStorage {\n hooks\n .filter((h) => h)\n .forEach((h) => {\n [\"before\", \"after\", \"already\", \"leave\"].forEach((type) => {\n if (h[type]) {\n if (!result[type]) result[type] = [];\n result[type].push(h[type]);\n }\n });\n });\n return result as RouteHooksStorage;\n}\n","type QChild = {\n type: \"child\";\n funcs: Array | QChild>;\n};\n\nexport default function Q(\n funcs: Array | QChild>,\n c?: any,\n done?: Function\n) {\n const context = c || {};\n let idx = 0;\n\n (function next() {\n if (!funcs[idx]) {\n if (done) {\n done(context);\n }\n return;\n }\n if (Array.isArray(funcs[idx])) {\n funcs.splice(\n idx,\n 1,\n ...(funcs[idx][0](context) ? funcs[idx][1] : funcs[idx][2])\n );\n next();\n } else {\n // console.log(funcs[idx].name + \" / \" + JSON.stringify(context));\n // console.log(funcs[idx].name);\n (funcs[idx] as Function)(context, (moveForward) => {\n if (typeof moveForward === \"undefined\" || moveForward === true) {\n idx += 1;\n next();\n } else if (done) {\n done(context);\n }\n });\n }\n })();\n}\n\nQ.if = function (condition: Function, one, two) {\n if (!Array.isArray(one)) one = [one];\n if (!Array.isArray(two)) two = [two];\n return [condition, one, two];\n};\n","import { QContext } from \"../../index\";\nimport { getCurrentEnvURL } from \"../utils\";\n\nexport default function setLocationPath(context: QContext, done) {\n if (typeof context.currentLocationPath === \"undefined\") {\n context.currentLocationPath = context.to = getCurrentEnvURL(\n context.instance.root\n );\n }\n context.currentLocationPath = context.instance._checkForAHash(\n context.currentLocationPath\n );\n done();\n}\n","import { matchRoute } from \"../utils\";\nimport { QContext, Match } from \"../../index\";\n\nexport default function matchPathToRegisteredRoutes(context: QContext, done) {\n for (let i = 0; i < context.instance.routes.length; i++) {\n const route = context.instance.routes[i];\n const match: false | Match = matchRoute(context, route);\n if (match) {\n if (!context.matches) context.matches = [];\n context.matches.push(match);\n if (context.resolveOptions.strategy === \"ONE\") {\n done();\n return;\n }\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForDeprecationMethods(context: QContext, done) {\n if (context.navigateOptions) {\n if (typeof context.navigateOptions[\"shouldResolve\"] !== \"undefined\") {\n console.warn(\n `\"shouldResolve\" is deprecated. Please check the documentation.`\n );\n }\n if (typeof context.navigateOptions[\"silent\"] !== \"undefined\") {\n console.warn(`\"silent\" is deprecated. Please check the documentation.`);\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForForceOp(context: QContext, done) {\n if (context.navigateOptions.force === true) {\n context.instance._setCurrent([\n context.instance._pathToMatchObject(context.to),\n ]);\n done(false);\n } else {\n done();\n }\n}\n","import { undefinedOrTrue, pushStateAvailable, windowAvailable } from \"../utils\";\nimport { QContext } from \"../../index\";\n\nconst isWindowAvailable = windowAvailable();\nconst isPushStateAvailable = pushStateAvailable();\n\nexport default function updateBrowserURL(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateBrowserURL\")) {\n const value = `/${context.to}`.replace(/\\/\\//g, \"/\"); // making sure that we don't have two slashes\n const isItUsingHash =\n isWindowAvailable &&\n context.resolveOptions &&\n context.resolveOptions.hash === true;\n if (isPushStateAvailable) {\n history[context.navigateOptions.historyAPIMethod || \"pushState\"](\n context.navigateOptions.stateObj || {},\n context.navigateOptions.title || \"\",\n isItUsingHash ? `#${value}` : value\n );\n // This is to solve a nasty bug where the page doesn't scroll to the anchor.\n // We set a microtask to update the hash only.\n if (location && location.hash) {\n context.instance.__freezeListening = true;\n setTimeout(() => {\n let tmp = location.hash;\n location.hash = \"\";\n location.hash = tmp;\n context.instance.__freezeListening = false;\n }, 1);\n }\n } else if (isWindowAvailable) {\n window.location.href = context.to;\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForLeaveHook(context: QContext, done) {\n const instance = context.instance;\n if (!instance.lastResolved()) {\n done();\n return;\n }\n Q(\n instance.lastResolved().map((oldMatch) => {\n return (_, leaveLoopDone) => {\n // no leave hook\n if (!oldMatch.route.hooks || !oldMatch.route.hooks.leave) {\n leaveLoopDone();\n return;\n }\n let runHook = false;\n const newLocationVSOldMatch = context.instance.matchLocation(\n oldMatch.route.path,\n context.currentLocationPath,\n false\n );\n if (oldMatch.route.path !== \"*\") {\n runHook = !newLocationVSOldMatch;\n } else {\n const someOfTheLastOnesMatch = context.matches\n ? context.matches.find((match) => {\n return oldMatch.route.path === match.route.path;\n })\n : false;\n runHook = !someOfTheLastOnesMatch;\n }\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\") && runHook) {\n Q(\n oldMatch.route.hooks.leave\n .map((f) => {\n // just so we match the Q interface\n return (_, d) =>\n f(\n (shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n },\n context.matches && context.matches.length > 0\n ? context.matches.length === 1\n ? context.matches[0]\n : context.matches\n : undefined\n );\n })\n .concat([() => leaveLoopDone()])\n );\n return;\n } else {\n leaveLoopDone();\n }\n };\n }),\n {},\n () => done()\n );\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function updateState(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateState\")) {\n context.instance._setCurrent(context.matches);\n }\n done();\n}\n","import { QContext } from \"../index\";\nimport Q from \"./Q\";\nimport checkForLeaveHook from \"./middlewares/checkForLeaveHook\";\nimport checkForBeforeHook from \"./middlewares/checkForBeforeHook\";\nimport callHandler from \"./middlewares/callHandler\";\nimport checkForAfterHook from \"./middlewares/checkForAfterHook\";\nimport checkForAlreadyHook from \"./middlewares/checkForAlreadyHook\";\nimport checkForNotFoundHandler from \"./middlewares/checkForNotFoundHandler\";\nimport errorOut from \"./middlewares/errorOut\";\nimport flushCurrent from \"./middlewares/flushCurrent\";\nimport updateState from \"./middlewares/updateState\";\n\nexport const foundLifecycle = [\n checkForAlreadyHook,\n checkForBeforeHook,\n callHandler,\n checkForAfterHook,\n];\n\nexport const notFoundLifeCycle = [\n checkForLeaveHook,\n checkForNotFoundHandler,\n Q.if(\n ({ notFoundHandled }: QContext) => notFoundHandled,\n foundLifecycle.concat([updateState]),\n [errorOut, flushCurrent]\n ),\n];\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAlreadyHook(context: QContext, done) {\n const current = context.instance.lastResolved();\n if (\n current &&\n current[0] &&\n current[0].route === context.match.route &&\n current[0].url === context.match.url &&\n current[0].queryString === context.match.queryString\n ) {\n current.forEach((c) => {\n if (c.route.hooks && c.route.hooks.already) {\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\")) {\n c.route.hooks.already.forEach((f) => f(context.match));\n }\n }\n });\n done(false);\n return;\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForBeforeHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.before &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n Q(\n context.match.route.hooks.before\n .map((f) => {\n // just so we match the Q interface\n return function beforeHookInternal(_, d) {\n return f((shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n }, context.match);\n };\n })\n .concat([() => done()])\n );\n } else {\n done();\n }\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function callHandler(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"callHandler\")) {\n context.match.route.handler(context.match);\n }\n context.instance.updatePageLinks();\n done();\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAfterHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.after &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n context.match.route.hooks.after.forEach((f) => f(context.match));\n }\n done();\n}\n","import { QContext, Match } from \"../../index\";\nimport {\n parseQuery,\n extractGETParameters,\n clean,\n extractHashFromURL,\n} from \"../utils\";\n\nexport default function checkForNotFoundHandler(context: QContext, done) {\n const notFoundRoute = context.instance._notFoundRoute;\n if (notFoundRoute) {\n context.notFoundHandled = true;\n const [url, queryString] = extractGETParameters(\n context.currentLocationPath\n );\n const hashString = extractHashFromURL(context.to);\n notFoundRoute.path = clean(url);\n const notFoundMatch: Match = {\n url: notFoundRoute.path,\n queryString,\n hashString,\n data: null,\n route: notFoundRoute,\n params: queryString !== \"\" ? parseQuery(queryString) : null,\n };\n context.matches = [notFoundMatch];\n context.match = notFoundMatch;\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function errorOut(context: QContext, done) {\n if (\n !context.resolveOptions ||\n context.resolveOptions.noMatchWarning === false ||\n typeof context.resolveOptions.noMatchWarning === \"undefined\"\n )\n console.warn(\n `Navigo: \"${context.currentLocationPath}\" didn't match any of the registered routes.`\n );\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function flushCurrent(context: QContext, done) {\n context.instance._setCurrent(null);\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { foundLifecycle } from \"../lifecycles\";\nimport updateState from \"./updateState\";\nimport checkForLeaveHook from \"./checkForLeaveHook\";\n\nexport default function processMatches(context: QContext, done) {\n let idx = 0;\n function nextMatch() {\n if (idx === context.matches.length) {\n updateState(context, done);\n return;\n }\n Q(\n foundLifecycle,\n { ...context, match: context.matches[idx] },\n function end() {\n idx += 1;\n nextMatch();\n }\n );\n }\n checkForLeaveHook(context, nextMatch);\n}\n","import { QContext } from \"../../index\";\n\nexport default function waitingList(context: QContext) {\n context.instance.__markAsClean(context);\n}\n","import {\n Match,\n Route,\n RouteHooks,\n QContext,\n NavigateOptions,\n ResolveOptions,\n GenerateOptions,\n Handler,\n RouterOptions,\n} from \"../index\";\nimport NavigoRouter from \"../index\";\nimport {\n pushStateAvailable,\n matchRoute,\n parseQuery,\n extractGETParameters,\n isFunction,\n isString,\n clean,\n parseNavigateOptions,\n windowAvailable,\n getCurrentEnvURL,\n accumulateHooks,\n extractHashFromURL,\n} from \"./utils\";\nimport Q from \"./Q\";\nimport setLocationPath from \"./middlewares/setLocationPath\";\nimport matchPathToRegisteredRoutes from \"./middlewares/matchPathToRegisteredRoutes\";\nimport checkForDeprecationMethods from \"./middlewares/checkForDeprecationMethods\";\nimport checkForForceOp from \"./middlewares/checkForForceOp\";\nimport updateBrowserURL from \"./middlewares/updateBrowserURL\";\nimport processMatches from \"./middlewares/processMatches\";\nimport waitingList from \"./middlewares/waitingList\";\n\nimport { notFoundLifeCycle } from \"./lifecycles\";\n\nconst DEFAULT_LINK_SELECTOR = \"[data-navigo]\";\n\nexport default function Navigo(appRoute?: string, options?: RouterOptions) {\n let DEFAULT_RESOLVE_OPTIONS: RouterOptions = options || {\n strategy: \"ONE\",\n hash: false,\n noMatchWarning: false,\n linksSelector: DEFAULT_LINK_SELECTOR,\n };\n let self: NavigoRouter = this;\n let root = \"/\";\n let current: Match[] = null;\n let routes: Route[] = [];\n let destroyed = false;\n let genericHooks: RouteHooks;\n\n const isPushStateAvailable = pushStateAvailable();\n const isWindowAvailable = windowAvailable();\n\n if (!appRoute) {\n console.warn(\n 'Navigo requires a root path in its constructor. If not provided will use \"/\" as default.'\n );\n } else {\n root = clean(appRoute);\n }\n\n function _checkForAHash(url: string): string {\n if (url.indexOf(\"#\") >= 0) {\n if (DEFAULT_RESOLVE_OPTIONS.hash === true) {\n url = url.split(\"#\")[1] || \"/\";\n } else {\n url = url.split(\"#\")[0];\n }\n }\n return url;\n }\n function composePathWithRoot(path: string) {\n return clean(`${root}/${clean(path)}`);\n }\n function createRoute(\n path: string | RegExp,\n handler: Handler,\n hooks: RouteHooks[],\n name?: string\n ): Route {\n path = isString(path) ? composePathWithRoot(path as string) : path;\n return {\n name: name || clean(String(path)),\n path,\n handler,\n hooks: accumulateHooks(hooks),\n };\n }\n\n // public APIs\n function on(\n path: string | Function | Object | RegExp,\n handler?: Handler,\n hooks?: RouteHooks\n ) {\n if (typeof path === \"object\" && !(path instanceof RegExp)) {\n Object.keys(path).forEach((p) => {\n if (typeof path[p] === \"function\") {\n this.on(p, path[p]);\n } else {\n const { uses: handler, as: name, hooks } = path[p];\n routes.push(createRoute(p, handler, [genericHooks, hooks], name));\n }\n });\n return this;\n } else if (typeof path === \"function\") {\n hooks = handler as RouteHooks;\n handler = path as Handler;\n path = root;\n }\n routes.push(\n createRoute(path as string | RegExp, handler, [genericHooks, hooks])\n );\n return this;\n }\n function resolve(to?: string, options?: ResolveOptions): false | Match[] {\n if (self.__dirty) {\n self.__waiting.push(() => self.resolve(to, options));\n return;\n } else {\n self.__dirty = true;\n }\n to = to ? `${clean(root)}/${clean(to)}` : undefined;\n // console.log(\"-- resolve --> \" + to, self.__dirty);\n const context: QContext = {\n instance: self,\n to,\n currentLocationPath: to,\n navigateOptions: {},\n resolveOptions: { ...DEFAULT_RESOLVE_OPTIONS, ...options },\n };\n Q(\n [\n setLocationPath,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n ],\n context,\n waitingList\n );\n\n return context.matches ? context.matches : false;\n }\n function navigate(to: string, navigateOptions?: NavigateOptions): void {\n // console.log(\"-- navigate --> \" + to, self.__dirty);\n if (self.__dirty) {\n self.__waiting.push(() => self.navigate(to, navigateOptions));\n return;\n } else {\n self.__dirty = true;\n }\n to = `${clean(root)}/${clean(to)}`;\n const context: QContext = {\n instance: self,\n to,\n navigateOptions: navigateOptions || {},\n resolveOptions:\n navigateOptions && navigateOptions.resolveOptions\n ? navigateOptions.resolveOptions\n : DEFAULT_RESOLVE_OPTIONS,\n currentLocationPath: _checkForAHash(to),\n };\n Q(\n [\n checkForDeprecationMethods,\n checkForForceOp,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n updateBrowserURL,\n waitingList,\n ],\n context,\n waitingList\n );\n }\n function navigateByName(\n name: string,\n data?: Object,\n options?: NavigateOptions\n ): boolean {\n const url = generate(name, data);\n if (url !== null) {\n navigate(url.replace(new RegExp(`^\\/?${root}`), \"\"), options);\n return true;\n }\n return false;\n }\n function off(what: string | RegExp | Function) {\n this.routes = routes = routes.filter((r) => {\n if (isString(what)) {\n return clean(r.path as string) !== clean(what as string);\n } else if (isFunction(what)) {\n return what !== r.handler;\n }\n return String(r.path) !== String(what);\n });\n return this;\n }\n function listen() {\n if (isPushStateAvailable) {\n this.__popstateListener = () => {\n if (!self.__freezeListening) {\n resolve();\n }\n };\n window.addEventListener(\"popstate\", this.__popstateListener);\n }\n }\n function destroy() {\n this.routes = routes = [];\n if (isPushStateAvailable) {\n window.removeEventListener(\"popstate\", this.__popstateListener);\n }\n this.destroyed = destroyed = true;\n }\n function notFound(handler, hooks?: RouteHooks) {\n self._notFoundRoute = createRoute(\n \"*\",\n handler,\n [genericHooks, hooks],\n \"__NOT_FOUND__\"\n );\n return this;\n }\n function updatePageLinks() {\n if (!isWindowAvailable) return;\n findLinks().forEach((link) => {\n if (\n \"false\" === link.getAttribute(\"data-navigo\") ||\n \"_blank\" === link.getAttribute(\"target\")\n ) {\n if (link.hasListenerAttached) {\n link.removeEventListener(\"click\", link.navigoHandler);\n }\n return;\n }\n if (!link.hasListenerAttached) {\n link.hasListenerAttached = true;\n link.navigoHandler = function (e) {\n if (\n (e.ctrlKey || e.metaKey) &&\n e.target.tagName.toLowerCase() === \"a\"\n ) {\n return false;\n }\n let location = link.getAttribute(\"href\");\n if (typeof location === \"undefined\" || location === null) {\n return false;\n }\n // handling absolute paths\n if (location.match(/^(http|https)/) && typeof URL !== \"undefined\") {\n try {\n const u = new URL(location);\n location = u.pathname + u.search;\n } catch (err) {}\n }\n const options = parseNavigateOptions(\n link.getAttribute(\"data-navigo-options\")\n );\n\n if (!destroyed) {\n e.preventDefault();\n e.stopPropagation();\n self.navigate(clean(location), options);\n }\n };\n link.addEventListener(\"click\", link.navigoHandler);\n }\n });\n return self;\n }\n function findLinks() {\n if (isWindowAvailable) {\n return [].slice.call(\n document.querySelectorAll(\n DEFAULT_RESOLVE_OPTIONS.linksSelector || DEFAULT_LINK_SELECTOR\n )\n );\n }\n return [];\n }\n function link(path: string) {\n return `/${root}/${clean(path)}`;\n }\n function setGenericHooks(hooks: RouteHooks) {\n genericHooks = hooks;\n return this;\n }\n function lastResolved(): Match[] | null {\n return current;\n }\n function generate(\n name: string,\n data?: Object,\n options?: GenerateOptions\n ): string {\n const route = routes.find((r) => r.name === name);\n let result = null;\n if (route) {\n result = route.path as string;\n if (data) {\n for (let key in data) {\n result = result.replace(\":\" + key, data[key]);\n }\n }\n result = !result.match(/^\\//) ? `/${result}` : result;\n }\n if (result && options && !options.includeRoot) {\n result = result.replace(new RegExp(`^/${root}`), \"\");\n }\n return result;\n }\n function getLinkPath(link) {\n return link.getAttribute(\"href\");\n }\n function pathToMatchObject(path: string): Match {\n const [url, queryString] = extractGETParameters(clean(path));\n const params = queryString === \"\" ? null : parseQuery(queryString);\n const hashString = extractHashFromURL(path);\n const route = createRoute(url, () => {}, [genericHooks], url);\n return {\n url,\n queryString,\n hashString,\n route,\n data: null,\n params: params,\n };\n }\n function getCurrentLocation(): Match {\n return pathToMatchObject(\n clean(getCurrentEnvURL(root)).replace(new RegExp(`^${root}`), \"\")\n );\n }\n function directMatchWithRegisteredRoutes(path: string): false | Match[] {\n const context: QContext = {\n instance: self,\n currentLocationPath: path,\n to: path,\n navigateOptions: {},\n resolveOptions: DEFAULT_RESOLVE_OPTIONS,\n };\n matchPathToRegisteredRoutes(context, () => {});\n return context.matches ? context.matches : false;\n }\n function directMatchWithLocation(\n path: string | RegExp,\n currentLocation?: string,\n annotatePathWithRoot?: boolean\n ): false | Match {\n if (\n typeof currentLocation !== \"undefined\" &&\n (typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot)\n ) {\n currentLocation = composePathWithRoot(currentLocation);\n }\n const context: QContext = {\n instance: self,\n to: currentLocation,\n currentLocationPath: currentLocation,\n };\n setLocationPath(context, () => {});\n if (typeof path === \"string\") {\n path =\n typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot\n ? composePathWithRoot(path)\n : path;\n }\n const match = matchRoute(context, {\n name: String(path),\n path,\n handler: () => {},\n hooks: {},\n });\n return match ? match : false;\n }\n function addHook(\n type: string,\n route: Route | string,\n func: Function\n ): Function {\n if (typeof route === \"string\") {\n route = getRoute(route);\n }\n if (route) {\n if (!route.hooks[type]) route.hooks[type] = [];\n route.hooks[type].push(func);\n return () => {\n (route as Route).hooks[type] = (route as Route).hooks[type].filter(\n (f) => f !== func\n );\n };\n } else {\n console.warn(`Route doesn't exists: ${route}`);\n }\n return () => {};\n }\n function getRoute(nameOrHandler: string | Function): Route | undefined {\n if (typeof nameOrHandler === \"string\") {\n return routes.find((r) => r.name === composePathWithRoot(nameOrHandler));\n }\n return routes.find((r) => r.handler === nameOrHandler);\n }\n function __markAsClean(context: QContext) {\n context.instance.__dirty = false;\n if (context.instance.__waiting.length > 0) {\n context.instance.__waiting.shift()();\n }\n }\n\n this.root = root;\n this.routes = routes;\n this.destroyed = destroyed;\n this.current = current;\n this.__freezeListening = false;\n this.__waiting = [];\n this.__dirty = false;\n this.__markAsClean = __markAsClean;\n\n this.on = on;\n this.off = off;\n this.resolve = resolve;\n this.navigate = navigate;\n this.navigateByName = navigateByName;\n this.destroy = destroy;\n this.notFound = notFound;\n this.updatePageLinks = updatePageLinks;\n this.link = link;\n this.hooks = setGenericHooks;\n this.extractGETParameters = (url) =>\n extractGETParameters(_checkForAHash(url));\n this.lastResolved = lastResolved;\n this.generate = generate;\n this.getLinkPath = getLinkPath;\n this.match = directMatchWithRegisteredRoutes;\n this.matchLocation = directMatchWithLocation;\n this.getCurrentLocation = getCurrentLocation;\n this.addBeforeHook = addHook.bind(this, \"before\");\n this.addAfterHook = addHook.bind(this, \"after\");\n this.addAlreadyHook = addHook.bind(this, \"already\");\n this.addLeaveHook = addHook.bind(this, \"leave\");\n this.getRoute = getRoute;\n this._pathToMatchObject = pathToMatchObject;\n this._clean = clean;\n this._checkForAHash = _checkForAHash;\n this._setCurrent = (c) => (current = self.current = c);\n\n listen.call(this);\n updatePageLinks.call(this);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// module exports must be returned from runtime so entry inlining is disabled\n// startup\n// Load entry module and return exports\nreturn __webpack_require__(407);\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index b8e8d8c2..2a4d3569 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "navigo", - "version": "8.10.1", + "version": "8.11.0", "description": "A simple vanilla JavaScript router", "main": "lib/navigo.js", "browser": "lib/navigo.min.js",