{"version":3,"sources":["jsdelivr-header.js","/npm/vuex-router-sync-previous@4.0.2/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,QAAQ,KAAO,SAAU,EAAO,GAC9B,EAAM,eAAe,gBAAiB,CACpC,MAAO,CAAC,IAGV,EAAM,eAAe,QAAS,CAC5B,MAAO,CAAC,EACR,UAAW,CACT,uBAAwB,SAAU,EAAO,GACvC,EAAM,MAAM,cAAgB,OAAO,OAAO,EAAM,MAAM,OACtD,EAAM,MAAM,MAAQ,OAAO,OAAO,CAChC,KAAM,EAAG,KACT,KAAM,EAAG,KACT,KAAM,EAAG,KACT,MAAO,EAAG,MACV,OAAQ,EAAG,OACX,SAAU,EAAG,UAEjB,KAIJ,IACI,EADA,GAAkB,EAItB,EAAM,OACJ,SAAU,GAAS,OAAO,EAAM,KAAM,IACtC,SAAU,GACJ,EAAM,WAAa,IAGvB,GAAkB,EAClB,EAAc,EAAM,SACpB,EAAO,KAAK,GACd,GACA,CAAE,MAAM,IAIV,EAAO,WAAU,SAAU,GACrB,EACF,GAAkB,GAGpB,EAAc,EAAG,SACjB,EAAM,OAAO,uBAAwB,GACvC,GACF","file":"/npm/vuex-router-sync-previous@4.0.2/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/vuex-router-sync-previous@4.0.2/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","exports.sync = function (store, router) {\n  store.registerModule('previousRoute', {\n    state: {}\n  })\n\n  store.registerModule('route', {\n    state: {},\n    mutations: {\n      'router/ROUTE_CHANGED': function (state, to) {\n        store.state.previousRoute = Object.freeze(store.state.route)\n        store.state.route = Object.freeze({\n          name: to.name,\n          path: to.path,\n          hash: to.hash,\n          query: to.query,\n          params: to.params,\n          fullPath: to.fullPath\n        })\n      }\n    }\n  })\n\n  var isTimeTraveling = false\n  var currentPath\n\n  // sync router on store change\n  store.watch(\n    function (state) { return state.route },\n    function (route) {\n      if (route.fullPath === currentPath) {\n        return\n      }\n      isTimeTraveling = true\n      currentPath = route.fullPath\n      router.push(route)\n    },\n    { sync: true }\n  )\n\n  // sync store on router navigation\n  router.afterEach(function (to) {\n    if (isTimeTraveling) {\n      isTimeTraveling = false\n      return\n    }\n    currentPath = to.fullPath\n    store.commit('router/ROUTE_CHANGED', to)\n  })\n}\n"]}