Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@unseenco/taxi

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unseenco/taxi - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

2

dist/taxi.esm.js

@@ -1,2 +0,2 @@

import t from"@unseenco/e";function e(){return e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},e.apply(this,arguments)}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function r(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i=new DOMParser;function o(t){var e=new URL(t,window.location.origin),n=null;return e.hash.length&&(n=t.replace(e.hash,"")),{hasHash:e.hash.length>0,pathname:e.pathname,raw:t,href:n||e.href}}function a(t){"HEAD"===t.parentNode.tagName?document.head.appendChild(c(t)):document.body.appendChild(c(t))}function c(t){for(var e=document.createElement("SCRIPT"),n=0;n<t.attributes.length;n++){var r=t.attributes[n];e.setAttribute(r.nodeName,r.nodeValue)}return t.innerHTML&&(e.innerHTML=t.innerHTML),e}var s=/*#__PURE__*/function(){function t(){this.data=new Map,this.regexCache=new Map}var e=t.prototype;return e.add=function(t,e,n){this.data.has(t)||(this.data.set(t,new Map),this.regexCache.set(t,new RegExp("^"+t+"$"))),this.data.get(t).set(e,n),this.regexCache.set(e,new RegExp("^"+e+"$"))},e.findMatch=function(t,e){for(var n,i=r(this.data);!(n=i()).done;){var o=n.value,a=o[1];if(t.pathname.match(this.regexCache.get(o[0]))){for(var c,s=r(a);!(c=s()).done;){var h=c.value,u=h[1];if(e.pathname.match(this.regexCache.get(h[0])))return u}break}}return null},t}(),h=/*#__PURE__*/function(){function e(t){var e=this;void 0===t&&(t={}),this.isTransitioning=!1,this.currentView=null,this.cache=new Map,this.onClick=function(t){if(!t.metaKey&&!t.ctrlKey){var n=o(t.currentTarget.href);if(e.currentLocation=o(window.location.href),e.currentLocation.href!==n.href||e.currentLocation.hasHash&&!n.hasHash)return t.preventDefault(),void e.navigate(n.raw,t.currentTarget.dataset.taxiTransition||!1,t.currentTarget);e.currentLocation.hasHash||n.hasHash||t.preventDefault()}},this.onPopstate=function(){return window.location.pathname!==e.currentLocation.pathname&&(e.isTransitioning?(window.history.pushState({},"",e.currentLocation.href),!1):void e.navigate(window.location.href,!1,"popstate"))};var n=t.links,r=void 0===n?"a:not([target]):not([href^=\\#]):not([data-taxi-ignore])":n,i=t.views,a=t.transitions,c=void 0===a?{default:f}:a,s=t.reloadJsFilter,h=void 0===s?function(t){return!("__bs_script__"===(null==t?void 0:t.id)||null!=t&&t.src.includes("browser-sync-client.js"))}:s;this.views=void 0===i?{default:l}:i,this.transitions=c,this.defaultView=this.views.default||l,this.defaultTransition=this.transitions.default||f,this.wrapper=document.querySelector("[data-taxi]"),this.reloadJsFilter=h,this.cache=new Map,this.attachEvents(r),this.currentLocation=o(window.location.href),this.cache.set(this.currentLocation.href,this.createCacheEntry(document.cloneNode(!0))),this.currentView=this.cache.get(this.currentLocation.href),this.currentView.view.initialLoad()}var n=e.prototype;return n.setDefaultView=function(t){this.defaultView=this.views[t]},n.setDefaultTransition=function(t){this.defaultTransition=this.transitions[t]},n.addRoute=function(t,e,n){this.router||(this.router=new s),this.router.add(t,e,n)},n.preload=function(t){var e=this;return t=o(t).href,this.cache.has(t)||this.fetch(t).then(function(n){try{return e.cache.set(t,e.createCacheEntry(n)),Promise.resolve()}catch(t){return Promise.reject(t)}}),this},n.navigate=function(t,e,n){var r=this;return void 0===e&&(e=!1),void 0===n&&(n=!1),this.targetLocation=o(t),new Promise(function(t,i){if(r.isTransitioning)i(new Error("A transition is currently in progress"));else{var o=new(r.chooseTransition(e))({wrapper:r.wrapper});r.beforeFetch(r.targetLocation,o,n).then(function(){try{return r.cache.has(r.targetLocation.href)?Promise.resolve(r.afterFetch(r.targetLocation,o,r.cache.get(r.targetLocation.href),n)):Promise.resolve(r.fetch(r.targetLocation.raw).then(function(t){try{return Promise.resolve(r.afterFetch(r.targetLocation,o,r.createCacheEntry(t),n))}catch(t){return Promise.reject(t)}}))}catch(t){return Promise.reject(t)}}).then(function(){t()})}})},n.beforeFetch=function(e,n,r){var i=this;return this.isTransitioning=!0,console.log("NAVIGATE_OUT"),t.emit("NAVIGATE_OUT",{from:this.currentView,trigger:r}),new Promise(function(t){i.currentView.view.leave(n,r).then(function(){"popstate"!==r&&window.history.pushState({},"",e.raw),t()})})},n.afterFetch=function(e,n,r,i){var o=this;return this.cache.has(e.href)||this.cache.set(e.href,r),this.currentLocation=e,console.log("NAVIGATE_IN"),t.emit("NAVIGATE_IN",{from:this.currentView,to:r,trigger:i}),new Promise(function(e){r.view.update(),o.loadScripts(r.scripts),r.view.enter(n,i).then(function(){console.log("NAVIGATE_COMPLETE",o.cache),t.emit("NAVIGATE_COMPLETE",{from:o.currentView,to:r,trigger:i}),o.currentView=r,o.isTransitioning=!1,e()})})},n.loadScripts=function(t){for(var e,n=[].concat(t),i=[].concat(document.querySelectorAll("script:not([data-no-reload])")).filter(this.reloadJsFilter),o=0;o<i.length;o++)for(var s=0;s<n.length;s++)if(i[o].outerHTML===n[s].outerHTML){(e=i[o]).parentNode.replaceChild(c(e),e),n.splice(s,1);break}for(var h,u=r(n);!(h=u()).done;)a(h.value)},n.attachEvents=function(e){t.delegate("click",e,this.onClick),t.on("popstate",window,this.onPopstate)},n.fetch=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t){return new Promise(function(e){fetch(t,{mode:"same-origin",method:"GET",headers:{"X-Requested-With":"Taxi"},credentials:"same-origin"}).then(function(e){return e.ok||(console.warn("Taxi encountered a non 2xx HTTP status code"),window.location.href=t),e.text()}).then(function(t){var n;e("string"==typeof(n=t)?i.parseFromString(n,"text/html"):n)}).catch(function(e){console.warn(e),window.location.href=t})})}),n.chooseTransition=function(t){var e;if(t)return this.transitions[t];var n=null==(e=this.router)?void 0:e.findMatch(this.currentLocation,this.targetLocation);return n?this.transitions[n]:this.defaultTransition},n.createCacheEntry=function(t){var e=t.querySelector("[data-taxi-view]"),n=e.dataset.taxiView.length?this.views[e.dataset.taxiView]:this.defaultView;return{page:t,content:e,scripts:[].concat(t.querySelectorAll("script:not([data-no-reload])")).filter(this.reloadJsFilter),title:t.title,view:new n({wrapper:this.wrapper,title:t.title,content:e,page:t})}},e}(),u={__proto__:null,default:h},f=/*#__PURE__*/function(){function t(t){this.wrapper=t.wrapper}var n=t.prototype;return n.leave=function(t){var n=this;return new Promise(function(r){n.onLeave(e({},t,{done:r}))})},n.enter=function(t){var n=this;return new Promise(function(r){n.onEnter(e({},t,{done:r}))})},n.onLeave=function(t){(0,t.done)()},n.onEnter=function(t){(0,t.done)()},t}(),l=/*#__PURE__*/function(){function t(t){var e=t.page,n=t.title,r=t.wrapper;this.content=t.content,this.page=e,this.title=n,this.wrapper=r}var e=t.prototype;return e.onEnter=function(){},e.onEnterCompleted=function(){},e.onLeave=function(){},e.onLeaveCompleted=function(){},e.initialLoad=function(){this.onEnter(),this.onEnterCompleted()},e.update=function(){document.title=this.title,this.wrapper.insertAdjacentHTML("beforeend",this.content.outerHTML)},e.remove=function(){this.wrapper.firstElementChild.remove()},e.enter=function(t,e){var n=this;return new Promise(function(r){n.onEnter(),t.enter({trigger:e,to:n.content}).then(function(){n.onEnterCompleted(),r()})})},e.leave=function(t,e){var n=this;return new Promise(function(r){n.onLeave(),t.leave({trigger:e,from:n.content}).then(function(){n.remove(),n.onLeaveCompleted(),r()})})},t}();export{u as Taxi,f as Transition,l as View};
import t from"@unseenco/e";function e(){return e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},e.apply(this,arguments)}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function r(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i=new DOMParser;function o(t){var e=new URL(t,window.location.origin),n=null;return e.hash.length&&(n=t.replace(e.hash,"")),{hasHash:e.hash.length>0,pathname:e.pathname,raw:t,href:n||e.href}}function a(t){"HEAD"===t.parentNode.tagName?document.head.appendChild(c(t)):document.body.appendChild(c(t))}function c(t){for(var e=document.createElement("SCRIPT"),n=0;n<t.attributes.length;n++){var r=t.attributes[n];e.setAttribute(r.nodeName,r.nodeValue)}return t.innerHTML&&(e.innerHTML=t.innerHTML),e}var s=/*#__PURE__*/function(){function t(){this.data=new Map,this.regexCache=new Map}var e=t.prototype;return e.add=function(t,e,n){this.data.has(t)||(this.data.set(t,new Map),this.regexCache.set(t,new RegExp("^"+t+"$"))),this.data.get(t).set(e,n),this.regexCache.set(e,new RegExp("^"+e+"$"))},e.findMatch=function(t,e){for(var n,i=r(this.data);!(n=i()).done;){var o=n.value,a=o[1];if(t.pathname.match(this.regexCache.get(o[0]))){for(var c,s=r(a);!(c=s()).done;){var h=c.value,u=h[1];if(e.pathname.match(this.regexCache.get(h[0])))return u}break}}return null},t}(),h=/*#__PURE__*/function(){function e(t){var e=this;void 0===t&&(t={}),this.isTransitioning=!1,this.currentView=null,this.cache=new Map,this.onClick=function(t){if(!t.metaKey&&!t.ctrlKey){var n=o(t.currentTarget.href);if(e.currentLocation=o(window.location.href),e.currentLocation.href!==n.href||e.currentLocation.hasHash&&!n.hasHash)return t.preventDefault(),void e.navigate(n.raw,t.currentTarget.dataset.taxiTransition||!1,t.currentTarget);e.currentLocation.hasHash||n.hasHash||t.preventDefault()}},this.onPopstate=function(){return window.location.pathname!==e.currentLocation.pathname&&(e.isTransitioning?(window.history.pushState({},"",e.currentLocation.href),!1):void e.navigate(window.location.href,!1,"popstate"))};var n=t.links,r=void 0===n?"a:not([target]):not([href^=\\#]):not([data-taxi-ignore])":n,i=t.views,a=t.transitions,c=void 0===a?{default:u}:a,s=t.reloadJsFilter,h=void 0===s?function(t){return!("__bs_script__"===(null==t?void 0:t.id)||null!=t&&t.src.includes("browser-sync-client.js"))}:s;this.views=void 0===i?{default:f}:i,this.transitions=c,this.defaultView=this.views.default||f,this.defaultTransition=this.transitions.default||u,this.wrapper=document.querySelector("[data-taxi]"),this.reloadJsFilter=h,this.cache=new Map,this.attachEvents(r),this.currentLocation=o(window.location.href),this.cache.set(this.currentLocation.href,this.createCacheEntry(document.cloneNode(!0))),this.currentView=this.cache.get(this.currentLocation.href),this.currentView.view.initialLoad()}var n=e.prototype;return n.setDefaultView=function(t){this.defaultView=this.views[t]},n.setDefaultTransition=function(t){this.defaultTransition=this.transitions[t]},n.addRoute=function(t,e,n){this.router||(this.router=new s),this.router.add(t,e,n)},n.preload=function(t){var e=this;return t=o(t).href,this.cache.has(t)||this.fetch(t).then(function(n){try{return e.cache.set(t,e.createCacheEntry(n)),Promise.resolve()}catch(t){return Promise.reject(t)}}),this},n.navigate=function(t,e,n){var r=this;return void 0===e&&(e=!1),void 0===n&&(n=!1),this.targetLocation=o(t),new Promise(function(t,i){if(r.isTransitioning)i(new Error("A transition is currently in progress"));else{var o=new(r.chooseTransition(e))({wrapper:r.wrapper});r.beforeFetch(r.targetLocation,o,n).then(function(){try{return r.cache.has(r.targetLocation.href)?Promise.resolve(r.afterFetch(r.targetLocation,o,r.cache.get(r.targetLocation.href),n)):Promise.resolve(r.fetch(r.targetLocation.raw).then(function(t){try{return Promise.resolve(r.afterFetch(r.targetLocation,o,r.createCacheEntry(t),n))}catch(t){return Promise.reject(t)}}))}catch(t){return Promise.reject(t)}}).then(function(){t()})}})},n.beforeFetch=function(e,n,r){var i=this;return this.isTransitioning=!0,console.log("NAVIGATE_OUT"),t.emit("NAVIGATE_OUT",{from:this.currentView,trigger:r}),new Promise(function(t){i.currentView.view.leave(n,r).then(function(){"popstate"!==r&&window.history.pushState({},"",e.raw),t()})})},n.afterFetch=function(e,n,r,i){var o=this;return this.cache.has(e.href)||this.cache.set(e.href,r),this.currentLocation=e,console.log("NAVIGATE_IN"),t.emit("NAVIGATE_IN",{from:this.currentView,to:r,trigger:i}),new Promise(function(e){r.view.update(),o.loadScripts(r.scripts),r.view.enter(n,i).then(function(){console.log("NAVIGATE_COMPLETE",o.cache),t.emit("NAVIGATE_COMPLETE",{from:o.currentView,to:r,trigger:i}),o.currentView=r,o.isTransitioning=!1,e()})})},n.loadScripts=function(t){for(var e,n=[].concat(t),i=[].concat(document.querySelectorAll("script:not([data-no-reload])")).filter(this.reloadJsFilter),o=0;o<i.length;o++)for(var s=0;s<n.length;s++)if(i[o].outerHTML===n[s].outerHTML){(e=i[o]).parentNode.replaceChild(c(e),e),n.splice(s,1);break}for(var h,u=r(n);!(h=u()).done;)a(h.value)},n.attachEvents=function(e){t.delegate("click",e,this.onClick),t.on("popstate",window,this.onPopstate)},n.fetch=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t){return new Promise(function(e){fetch(t,{mode:"same-origin",method:"GET",headers:{"X-Requested-With":"Taxi"},credentials:"same-origin"}).then(function(e){return e.ok||(console.warn("Taxi encountered a non 2xx HTTP status code"),window.location.href=t),e.text()}).then(function(t){var n;e("string"==typeof(n=t)?i.parseFromString(n,"text/html"):n)}).catch(function(e){console.warn(e),window.location.href=t})})}),n.chooseTransition=function(t){var e;if(t)return this.transitions[t];var n=null==(e=this.router)?void 0:e.findMatch(this.currentLocation,this.targetLocation);return n?this.transitions[n]:this.defaultTransition},n.createCacheEntry=function(t){var e=t.querySelector("[data-taxi-view]"),n=e.dataset.taxiView.length?this.views[e.dataset.taxiView]:this.defaultView;return{page:t,content:e,scripts:[].concat(t.querySelectorAll("script:not([data-no-reload])")).filter(this.reloadJsFilter),title:t.title,view:new n({wrapper:this.wrapper,title:t.title,content:e,page:t})}},e}(),u=/*#__PURE__*/function(){function t(t){this.wrapper=t.wrapper}var n=t.prototype;return n.leave=function(t){var n=this;return new Promise(function(r){n.onLeave(e({},t,{done:r}))})},n.enter=function(t){var n=this;return new Promise(function(r){n.onEnter(e({},t,{done:r}))})},n.onLeave=function(t){(0,t.done)()},n.onEnter=function(t){(0,t.done)()},t}(),f=/*#__PURE__*/function(){function t(t){var e=t.page,n=t.title,r=t.wrapper;this.content=t.content,this.page=e,this.title=n,this.wrapper=r}var e=t.prototype;return e.onEnter=function(){},e.onEnterCompleted=function(){},e.onLeave=function(){},e.onLeaveCompleted=function(){},e.initialLoad=function(){this.onEnter(),this.onEnterCompleted()},e.update=function(){document.title=this.title,this.wrapper.insertAdjacentHTML("beforeend",this.content.outerHTML)},e.remove=function(){this.wrapper.firstElementChild.remove()},e.enter=function(t,e){var n=this;return new Promise(function(r){n.onEnter(),t.enter({trigger:e,to:n.content}).then(function(){n.onEnterCompleted(),r()})})},e.leave=function(t,e){var n=this;return new Promise(function(r){n.onLeave(),t.leave({trigger:e,from:n.content}).then(function(){n.remove(),n.onLeaveCompleted(),r()})})},t}();export{h as Core,u as Transition,f as View};
//# sourceMappingURL=taxi.esm.js.map

@@ -1,2 +0,2 @@

function t(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var e=/*#__PURE__*/t(require("@unseenco/e"));function n(){return n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},n.apply(this,arguments)}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function i(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o=new DOMParser;function a(t){var e=new URL(t,window.location.origin),n=null;return e.hash.length&&(n=t.replace(e.hash,"")),{hasHash:e.hash.length>0,pathname:e.pathname,raw:t,href:n||e.href}}function c(t){"HEAD"===t.parentNode.tagName?document.head.appendChild(s(t)):document.body.appendChild(s(t))}function s(t){for(var e=document.createElement("SCRIPT"),n=0;n<t.attributes.length;n++){var r=t.attributes[n];e.setAttribute(r.nodeName,r.nodeValue)}return t.innerHTML&&(e.innerHTML=t.innerHTML),e}var h=/*#__PURE__*/function(){function t(){this.data=new Map,this.regexCache=new Map}var e=t.prototype;return e.add=function(t,e,n){this.data.has(t)||(this.data.set(t,new Map),this.regexCache.set(t,new RegExp("^"+t+"$"))),this.data.get(t).set(e,n),this.regexCache.set(e,new RegExp("^"+e+"$"))},e.findMatch=function(t,e){for(var n,r=i(this.data);!(n=r()).done;){var o=n.value,a=o[1];if(t.pathname.match(this.regexCache.get(o[0]))){for(var c,s=i(a);!(c=s()).done;){var h=c.value,u=h[1];if(e.pathname.match(this.regexCache.get(h[0])))return u}break}}return null},t}(),u=/*#__PURE__*/function(){function t(t){var e=this;void 0===t&&(t={}),this.isTransitioning=!1,this.currentView=null,this.cache=new Map,this.onClick=function(t){if(!t.metaKey&&!t.ctrlKey){var n=a(t.currentTarget.href);if(e.currentLocation=a(window.location.href),e.currentLocation.href!==n.href||e.currentLocation.hasHash&&!n.hasHash)return t.preventDefault(),void e.navigate(n.raw,t.currentTarget.dataset.taxiTransition||!1,t.currentTarget);e.currentLocation.hasHash||n.hasHash||t.preventDefault()}},this.onPopstate=function(){return window.location.pathname!==e.currentLocation.pathname&&(e.isTransitioning?(window.history.pushState({},"",e.currentLocation.href),!1):void e.navigate(window.location.href,!1,"popstate"))};var n=t.links,r=void 0===n?"a:not([target]):not([href^=\\#]):not([data-taxi-ignore])":n,i=t.views,o=t.transitions,c=void 0===o?{default:l}:o,s=t.reloadJsFilter,h=void 0===s?function(t){return!("__bs_script__"===(null==t?void 0:t.id)||null!=t&&t.src.includes("browser-sync-client.js"))}:s;this.views=void 0===i?{default:d}:i,this.transitions=c,this.defaultView=this.views.default||d,this.defaultTransition=this.transitions.default||l,this.wrapper=document.querySelector("[data-taxi]"),this.reloadJsFilter=h,this.cache=new Map,this.attachEvents(r),this.currentLocation=a(window.location.href),this.cache.set(this.currentLocation.href,this.createCacheEntry(document.cloneNode(!0))),this.currentView=this.cache.get(this.currentLocation.href),this.currentView.view.initialLoad()}var n=t.prototype;return n.setDefaultView=function(t){this.defaultView=this.views[t]},n.setDefaultTransition=function(t){this.defaultTransition=this.transitions[t]},n.addRoute=function(t,e,n){this.router||(this.router=new h),this.router.add(t,e,n)},n.preload=function(t){var e=this;return t=a(t).href,this.cache.has(t)||this.fetch(t).then(function(n){try{return e.cache.set(t,e.createCacheEntry(n)),Promise.resolve()}catch(t){return Promise.reject(t)}}),this},n.navigate=function(t,e,n){var r=this;return void 0===e&&(e=!1),void 0===n&&(n=!1),this.targetLocation=a(t),new Promise(function(t,i){if(r.isTransitioning)i(new Error("A transition is currently in progress"));else{var o=new(r.chooseTransition(e))({wrapper:r.wrapper});r.beforeFetch(r.targetLocation,o,n).then(function(){try{return r.cache.has(r.targetLocation.href)?Promise.resolve(r.afterFetch(r.targetLocation,o,r.cache.get(r.targetLocation.href),n)):Promise.resolve(r.fetch(r.targetLocation.raw).then(function(t){try{return Promise.resolve(r.afterFetch(r.targetLocation,o,r.createCacheEntry(t),n))}catch(t){return Promise.reject(t)}}))}catch(t){return Promise.reject(t)}}).then(function(){t()})}})},n.beforeFetch=function(t,n,r){var i=this;return this.isTransitioning=!0,console.log("NAVIGATE_OUT"),e.default.emit("NAVIGATE_OUT",{from:this.currentView,trigger:r}),new Promise(function(e){i.currentView.view.leave(n,r).then(function(){"popstate"!==r&&window.history.pushState({},"",t.raw),e()})})},n.afterFetch=function(t,n,r,i){var o=this;return this.cache.has(t.href)||this.cache.set(t.href,r),this.currentLocation=t,console.log("NAVIGATE_IN"),e.default.emit("NAVIGATE_IN",{from:this.currentView,to:r,trigger:i}),new Promise(function(t){r.view.update(),o.loadScripts(r.scripts),r.view.enter(n,i).then(function(){console.log("NAVIGATE_COMPLETE",o.cache),e.default.emit("NAVIGATE_COMPLETE",{from:o.currentView,to:r,trigger:i}),o.currentView=r,o.isTransitioning=!1,t()})})},n.loadScripts=function(t){for(var e,n=[].concat(t),r=[].concat(document.querySelectorAll("script:not([data-no-reload])")).filter(this.reloadJsFilter),o=0;o<r.length;o++)for(var a=0;a<n.length;a++)if(r[o].outerHTML===n[a].outerHTML){(e=r[o]).parentNode.replaceChild(s(e),e),n.splice(a,1);break}for(var h,u=i(n);!(h=u()).done;)c(h.value)},n.attachEvents=function(t){e.default.delegate("click",t,this.onClick),e.default.on("popstate",window,this.onPopstate)},n.fetch=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t){return new Promise(function(e){fetch(t,{mode:"same-origin",method:"GET",headers:{"X-Requested-With":"Taxi"},credentials:"same-origin"}).then(function(e){return e.ok||(console.warn("Taxi encountered a non 2xx HTTP status code"),window.location.href=t),e.text()}).then(function(t){var n;e("string"==typeof(n=t)?o.parseFromString(n,"text/html"):n)}).catch(function(e){console.warn(e),window.location.href=t})})}),n.chooseTransition=function(t){var e;if(t)return this.transitions[t];var n=null==(e=this.router)?void 0:e.findMatch(this.currentLocation,this.targetLocation);return n?this.transitions[n]:this.defaultTransition},n.createCacheEntry=function(t){var e=t.querySelector("[data-taxi-view]"),n=e.dataset.taxiView.length?this.views[e.dataset.taxiView]:this.defaultView;return{page:t,content:e,scripts:[].concat(t.querySelectorAll("script:not([data-no-reload])")).filter(this.reloadJsFilter),title:t.title,view:new n({wrapper:this.wrapper,title:t.title,content:e,page:t})}},t}(),f={__proto__:null,default:u},l=/*#__PURE__*/function(){function t(t){this.wrapper=t.wrapper}var e=t.prototype;return e.leave=function(t){var e=this;return new Promise(function(r){e.onLeave(n({},t,{done:r}))})},e.enter=function(t){var e=this;return new Promise(function(r){e.onEnter(n({},t,{done:r}))})},e.onLeave=function(t){(0,t.done)()},e.onEnter=function(t){(0,t.done)()},t}(),d=/*#__PURE__*/function(){function t(t){var e=t.page,n=t.title,r=t.wrapper;this.content=t.content,this.page=e,this.title=n,this.wrapper=r}var e=t.prototype;return e.onEnter=function(){},e.onEnterCompleted=function(){},e.onLeave=function(){},e.onLeaveCompleted=function(){},e.initialLoad=function(){this.onEnter(),this.onEnterCompleted()},e.update=function(){document.title=this.title,this.wrapper.insertAdjacentHTML("beforeend",this.content.outerHTML)},e.remove=function(){this.wrapper.firstElementChild.remove()},e.enter=function(t,e){var n=this;return new Promise(function(r){n.onEnter(),t.enter({trigger:e,to:n.content}).then(function(){n.onEnterCompleted(),r()})})},e.leave=function(t,e){var n=this;return new Promise(function(r){n.onLeave(),t.leave({trigger:e,from:n.content}).then(function(){n.remove(),n.onLeaveCompleted(),r()})})},t}();exports.Taxi=f,exports.Transition=l,exports.View=d;
function t(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var e=/*#__PURE__*/t(require("@unseenco/e"));function n(){return n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},n.apply(this,arguments)}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function i(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o=new DOMParser;function a(t){var e=new URL(t,window.location.origin),n=null;return e.hash.length&&(n=t.replace(e.hash,"")),{hasHash:e.hash.length>0,pathname:e.pathname,raw:t,href:n||e.href}}function c(t){"HEAD"===t.parentNode.tagName?document.head.appendChild(s(t)):document.body.appendChild(s(t))}function s(t){for(var e=document.createElement("SCRIPT"),n=0;n<t.attributes.length;n++){var r=t.attributes[n];e.setAttribute(r.nodeName,r.nodeValue)}return t.innerHTML&&(e.innerHTML=t.innerHTML),e}var h=/*#__PURE__*/function(){function t(){this.data=new Map,this.regexCache=new Map}var e=t.prototype;return e.add=function(t,e,n){this.data.has(t)||(this.data.set(t,new Map),this.regexCache.set(t,new RegExp("^"+t+"$"))),this.data.get(t).set(e,n),this.regexCache.set(e,new RegExp("^"+e+"$"))},e.findMatch=function(t,e){for(var n,r=i(this.data);!(n=r()).done;){var o=n.value,a=o[1];if(t.pathname.match(this.regexCache.get(o[0]))){for(var c,s=i(a);!(c=s()).done;){var h=c.value,u=h[1];if(e.pathname.match(this.regexCache.get(h[0])))return u}break}}return null},t}(),u=/*#__PURE__*/function(){function t(t){var e=this;void 0===t&&(t={}),this.isTransitioning=!1,this.currentView=null,this.cache=new Map,this.onClick=function(t){if(!t.metaKey&&!t.ctrlKey){var n=a(t.currentTarget.href);if(e.currentLocation=a(window.location.href),e.currentLocation.href!==n.href||e.currentLocation.hasHash&&!n.hasHash)return t.preventDefault(),void e.navigate(n.raw,t.currentTarget.dataset.taxiTransition||!1,t.currentTarget);e.currentLocation.hasHash||n.hasHash||t.preventDefault()}},this.onPopstate=function(){return window.location.pathname!==e.currentLocation.pathname&&(e.isTransitioning?(window.history.pushState({},"",e.currentLocation.href),!1):void e.navigate(window.location.href,!1,"popstate"))};var n=t.links,r=void 0===n?"a:not([target]):not([href^=\\#]):not([data-taxi-ignore])":n,i=t.views,o=t.transitions,c=void 0===o?{default:f}:o,s=t.reloadJsFilter,h=void 0===s?function(t){return!("__bs_script__"===(null==t?void 0:t.id)||null!=t&&t.src.includes("browser-sync-client.js"))}:s;this.views=void 0===i?{default:l}:i,this.transitions=c,this.defaultView=this.views.default||l,this.defaultTransition=this.transitions.default||f,this.wrapper=document.querySelector("[data-taxi]"),this.reloadJsFilter=h,this.cache=new Map,this.attachEvents(r),this.currentLocation=a(window.location.href),this.cache.set(this.currentLocation.href,this.createCacheEntry(document.cloneNode(!0))),this.currentView=this.cache.get(this.currentLocation.href),this.currentView.view.initialLoad()}var n=t.prototype;return n.setDefaultView=function(t){this.defaultView=this.views[t]},n.setDefaultTransition=function(t){this.defaultTransition=this.transitions[t]},n.addRoute=function(t,e,n){this.router||(this.router=new h),this.router.add(t,e,n)},n.preload=function(t){var e=this;return t=a(t).href,this.cache.has(t)||this.fetch(t).then(function(n){try{return e.cache.set(t,e.createCacheEntry(n)),Promise.resolve()}catch(t){return Promise.reject(t)}}),this},n.navigate=function(t,e,n){var r=this;return void 0===e&&(e=!1),void 0===n&&(n=!1),this.targetLocation=a(t),new Promise(function(t,i){if(r.isTransitioning)i(new Error("A transition is currently in progress"));else{var o=new(r.chooseTransition(e))({wrapper:r.wrapper});r.beforeFetch(r.targetLocation,o,n).then(function(){try{return r.cache.has(r.targetLocation.href)?Promise.resolve(r.afterFetch(r.targetLocation,o,r.cache.get(r.targetLocation.href),n)):Promise.resolve(r.fetch(r.targetLocation.raw).then(function(t){try{return Promise.resolve(r.afterFetch(r.targetLocation,o,r.createCacheEntry(t),n))}catch(t){return Promise.reject(t)}}))}catch(t){return Promise.reject(t)}}).then(function(){t()})}})},n.beforeFetch=function(t,n,r){var i=this;return this.isTransitioning=!0,console.log("NAVIGATE_OUT"),e.default.emit("NAVIGATE_OUT",{from:this.currentView,trigger:r}),new Promise(function(e){i.currentView.view.leave(n,r).then(function(){"popstate"!==r&&window.history.pushState({},"",t.raw),e()})})},n.afterFetch=function(t,n,r,i){var o=this;return this.cache.has(t.href)||this.cache.set(t.href,r),this.currentLocation=t,console.log("NAVIGATE_IN"),e.default.emit("NAVIGATE_IN",{from:this.currentView,to:r,trigger:i}),new Promise(function(t){r.view.update(),o.loadScripts(r.scripts),r.view.enter(n,i).then(function(){console.log("NAVIGATE_COMPLETE",o.cache),e.default.emit("NAVIGATE_COMPLETE",{from:o.currentView,to:r,trigger:i}),o.currentView=r,o.isTransitioning=!1,t()})})},n.loadScripts=function(t){for(var e,n=[].concat(t),r=[].concat(document.querySelectorAll("script:not([data-no-reload])")).filter(this.reloadJsFilter),o=0;o<r.length;o++)for(var a=0;a<n.length;a++)if(r[o].outerHTML===n[a].outerHTML){(e=r[o]).parentNode.replaceChild(s(e),e),n.splice(a,1);break}for(var h,u=i(n);!(h=u()).done;)c(h.value)},n.attachEvents=function(t){e.default.delegate("click",t,this.onClick),e.default.on("popstate",window,this.onPopstate)},n.fetch=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t){return new Promise(function(e){fetch(t,{mode:"same-origin",method:"GET",headers:{"X-Requested-With":"Taxi"},credentials:"same-origin"}).then(function(e){return e.ok||(console.warn("Taxi encountered a non 2xx HTTP status code"),window.location.href=t),e.text()}).then(function(t){var n;e("string"==typeof(n=t)?o.parseFromString(n,"text/html"):n)}).catch(function(e){console.warn(e),window.location.href=t})})}),n.chooseTransition=function(t){var e;if(t)return this.transitions[t];var n=null==(e=this.router)?void 0:e.findMatch(this.currentLocation,this.targetLocation);return n?this.transitions[n]:this.defaultTransition},n.createCacheEntry=function(t){var e=t.querySelector("[data-taxi-view]"),n=e.dataset.taxiView.length?this.views[e.dataset.taxiView]:this.defaultView;return{page:t,content:e,scripts:[].concat(t.querySelectorAll("script:not([data-no-reload])")).filter(this.reloadJsFilter),title:t.title,view:new n({wrapper:this.wrapper,title:t.title,content:e,page:t})}},t}(),f=/*#__PURE__*/function(){function t(t){this.wrapper=t.wrapper}var e=t.prototype;return e.leave=function(t){var e=this;return new Promise(function(r){e.onLeave(n({},t,{done:r}))})},e.enter=function(t){var e=this;return new Promise(function(r){e.onEnter(n({},t,{done:r}))})},e.onLeave=function(t){(0,t.done)()},e.onEnter=function(t){(0,t.done)()},t}(),l=/*#__PURE__*/function(){function t(t){var e=t.page,n=t.title,r=t.wrapper;this.content=t.content,this.page=e,this.title=n,this.wrapper=r}var e=t.prototype;return e.onEnter=function(){},e.onEnterCompleted=function(){},e.onLeave=function(){},e.onLeaveCompleted=function(){},e.initialLoad=function(){this.onEnter(),this.onEnterCompleted()},e.update=function(){document.title=this.title,this.wrapper.insertAdjacentHTML("beforeend",this.content.outerHTML)},e.remove=function(){this.wrapper.firstElementChild.remove()},e.enter=function(t,e){var n=this;return new Promise(function(r){n.onEnter(),t.enter({trigger:e,to:n.content}).then(function(){n.onEnterCompleted(),r()})})},e.leave=function(t,e){var n=this;return new Promise(function(r){n.onLeave(),t.leave({trigger:e,from:n.content}).then(function(){n.remove(),n.onLeaveCompleted(),r()})})},t}();exports.Core=u,exports.Transition=f,exports.View=l;
//# sourceMappingURL=taxi.js.map

@@ -1,2 +0,2 @@

import t from"@unseenco/e";const e=new DOMParser;function n(t){const e=new URL(t,window.location.origin);let n=null;return e.hash.length&&(n=t.replace(e.hash,"")),{hasHash:e.hash.length>0,pathname:e.pathname,raw:t,href:n||e.href}}function r(t){"HEAD"===t.parentNode.tagName?document.head.appendChild(i(t)):document.body.appendChild(i(t))}function i(t){const e=document.createElement("SCRIPT");for(let n=0;n<t.attributes.length;n++){const r=t.attributes[n];e.setAttribute(r.nodeName,r.nodeValue)}return t.innerHTML&&(e.innerHTML=t.innerHTML),e}class a{constructor(){this.data=new Map,this.regexCache=new Map}add(t,e,n){this.data.has(t)||(this.data.set(t,new Map),this.regexCache.set(t,new RegExp(`^${t}$`))),this.data.get(t).set(e,n),this.regexCache.set(e,new RegExp(`^${e}$`))}findMatch(t,e){for(const[n,r]of this.data)if(t.pathname.match(this.regexCache.get(n))){for(const[t,n]of r)if(e.pathname.match(this.regexCache.get(t)))return n;break}return null}}var o={__proto__:null,default:class{constructor(t={}){this.isTransitioning=!1,this.currentView=null,this.cache=new Map,this.onClick=t=>{if(!t.metaKey&&!t.ctrlKey){const e=n(t.currentTarget.href);if(this.currentLocation=n(window.location.href),this.currentLocation.href!==e.href||this.currentLocation.hasHash&&!e.hasHash)return t.preventDefault(),void this.navigate(e.raw,t.currentTarget.dataset.taxiTransition||!1,t.currentTarget);this.currentLocation.hasHash||e.hasHash||t.preventDefault()}},this.onPopstate=()=>window.location.pathname!==this.currentLocation.pathname&&(this.isTransitioning?(window.history.pushState({},"",this.currentLocation.href),!1):void this.navigate(window.location.href,!1,"popstate"));const{links:e="a:not([target]):not([href^=\\#]):not([data-taxi-ignore])",views:r={default:c},transitions:i={default:h},reloadJsFilter:a=function(t){return!("__bs_script__"===(null==t?void 0:t.id)||null!=t&&t.src.includes("browser-sync-client.js"))}}=t;this.views=r,this.transitions=i,this.defaultView=this.views.default||c,this.defaultTransition=this.transitions.default||h,this.wrapper=document.querySelector("[data-taxi]"),this.reloadJsFilter=a,this.cache=new Map,this.attachEvents(e),this.currentLocation=n(window.location.href),this.cache.set(this.currentLocation.href,this.createCacheEntry(document.cloneNode(!0))),this.currentView=this.cache.get(this.currentLocation.href),this.currentView.view.initialLoad()}setDefaultView(t){this.defaultView=this.views[t]}setDefaultTransition(t){this.defaultTransition=this.transitions[t]}addRoute(t,e,n){this.router||(this.router=new a),this.router.add(t,e,n)}preload(t){var e=this;return t=n(t).href,this.cache.has(t)||this.fetch(t).then(async function(n){e.cache.set(t,e.createCacheEntry(n))}),this}navigate(t,e=!1,r=!1){var i=this;return this.targetLocation=n(t),new Promise((t,n)=>{if(this.isTransitioning)return void n(new Error("A transition is currently in progress"));const a=new(this.chooseTransition(e))({wrapper:this.wrapper});this.beforeFetch(this.targetLocation,a,r).then(async function(){return i.cache.has(i.targetLocation.href)?await i.afterFetch(i.targetLocation,a,i.cache.get(i.targetLocation.href),r):i.fetch(i.targetLocation.raw).then(async function(t){return await i.afterFetch(i.targetLocation,a,i.createCacheEntry(t),r)})}).then(()=>{t()})})}beforeFetch(e,n,r){return this.isTransitioning=!0,console.log("NAVIGATE_OUT"),t.emit("NAVIGATE_OUT",{from:this.currentView,trigger:r}),new Promise(t=>{this.currentView.view.leave(n,r).then(()=>{"popstate"!==r&&window.history.pushState({},"",e.raw),t()})})}afterFetch(e,n,r,i){return this.cache.has(e.href)||this.cache.set(e.href,r),this.currentLocation=e,console.log("NAVIGATE_IN"),t.emit("NAVIGATE_IN",{from:this.currentView,to:r,trigger:i}),new Promise(e=>{r.view.update(),this.loadScripts(r.scripts),r.view.enter(n,i).then(()=>{console.log("NAVIGATE_COMPLETE",this.cache),t.emit("NAVIGATE_COMPLETE",{from:this.currentView,to:r,trigger:i}),this.currentView=r,this.isTransitioning=!1,e()})})}loadScripts(t){const e=[...t],n=[...document.querySelectorAll("script:not([data-no-reload])")].filter(this.reloadJsFilter);for(let t=0;t<n.length;t++)for(let r=0;r<e.length;r++)if(n[t].outerHTML===e[r].outerHTML){(a=n[t]).parentNode.replaceChild(i(a),a),e.splice(r,1);break}var a;for(const t of e)r(t)}attachEvents(e){t.delegate("click",e,this.onClick),t.on("popstate",window,this.onPopstate)}fetch(t){return new Promise(n=>{fetch(t,{mode:"same-origin",method:"GET",headers:{"X-Requested-With":"Taxi"},credentials:"same-origin"}).then(e=>(e.ok||(console.warn("Taxi encountered a non 2xx HTTP status code"),window.location.href=t),e.text())).then(t=>{var r;n("string"==typeof(r=t)?e.parseFromString(r,"text/html"):r)}).catch(e=>{console.warn(e),window.location.href=t})})}chooseTransition(t){var e;if(t)return this.transitions[t];const n=null==(e=this.router)?void 0:e.findMatch(this.currentLocation,this.targetLocation);return n?this.transitions[n]:this.defaultTransition}createCacheEntry(t){const e=t.querySelector("[data-taxi-view]"),n=e.dataset.taxiView.length?this.views[e.dataset.taxiView]:this.defaultView;return{page:t,content:e,scripts:[...t.querySelectorAll("script:not([data-no-reload])")].filter(this.reloadJsFilter),title:t.title,view:new n({wrapper:this.wrapper,title:t.title,content:e,page:t})}}}};function s(){return s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},s.apply(this,arguments)}class h{constructor({wrapper:t}){this.wrapper=t}leave(t){return new Promise(e=>{this.onLeave(s({},t,{done:e}))})}enter(t){return new Promise(e=>{this.onEnter(s({},t,{done:e}))})}onLeave({done:t}){t()}onEnter({done:t}){t()}}class c{constructor({content:t,page:e,title:n,wrapper:r}){this.content=t,this.page=e,this.title=n,this.wrapper=r}onEnter(){}onEnterCompleted(){}onLeave(){}onLeaveCompleted(){}initialLoad(){this.onEnter(),this.onEnterCompleted()}update(){document.title=this.title,this.wrapper.insertAdjacentHTML("beforeend",this.content.outerHTML)}remove(){this.wrapper.firstElementChild.remove()}enter(t,e){return new Promise(n=>{this.onEnter(),t.enter({trigger:e,to:this.content}).then(()=>{this.onEnterCompleted(),n()})})}leave(t,e){return new Promise(n=>{this.onLeave(),t.leave({trigger:e,from:this.content}).then(()=>{this.remove(),this.onLeaveCompleted(),n()})})}}export{o as Taxi,h as Transition,c as View};
import t from"@unseenco/e";const e=new DOMParser;function n(t){const e=new URL(t,window.location.origin);let n=null;return e.hash.length&&(n=t.replace(e.hash,"")),{hasHash:e.hash.length>0,pathname:e.pathname,raw:t,href:n||e.href}}function r(t){"HEAD"===t.parentNode.tagName?document.head.appendChild(i(t)):document.body.appendChild(i(t))}function i(t){const e=document.createElement("SCRIPT");for(let n=0;n<t.attributes.length;n++){const r=t.attributes[n];e.setAttribute(r.nodeName,r.nodeValue)}return t.innerHTML&&(e.innerHTML=t.innerHTML),e}class a{constructor(){this.data=new Map,this.regexCache=new Map}add(t,e,n){this.data.has(t)||(this.data.set(t,new Map),this.regexCache.set(t,new RegExp(`^${t}$`))),this.data.get(t).set(e,n),this.regexCache.set(e,new RegExp(`^${e}$`))}findMatch(t,e){for(const[n,r]of this.data)if(t.pathname.match(this.regexCache.get(n))){for(const[t,n]of r)if(e.pathname.match(this.regexCache.get(t)))return n;break}return null}}class o{constructor(t={}){this.isTransitioning=!1,this.currentView=null,this.cache=new Map,this.onClick=t=>{if(!t.metaKey&&!t.ctrlKey){const e=n(t.currentTarget.href);if(this.currentLocation=n(window.location.href),this.currentLocation.href!==e.href||this.currentLocation.hasHash&&!e.hasHash)return t.preventDefault(),void this.navigate(e.raw,t.currentTarget.dataset.taxiTransition||!1,t.currentTarget);this.currentLocation.hasHash||e.hasHash||t.preventDefault()}},this.onPopstate=()=>window.location.pathname!==this.currentLocation.pathname&&(this.isTransitioning?(window.history.pushState({},"",this.currentLocation.href),!1):void this.navigate(window.location.href,!1,"popstate"));const{links:e="a:not([target]):not([href^=\\#]):not([data-taxi-ignore])",views:r={default:c},transitions:i={default:h},reloadJsFilter:a=function(t){return!("__bs_script__"===(null==t?void 0:t.id)||null!=t&&t.src.includes("browser-sync-client.js"))}}=t;this.views=r,this.transitions=i,this.defaultView=this.views.default||c,this.defaultTransition=this.transitions.default||h,this.wrapper=document.querySelector("[data-taxi]"),this.reloadJsFilter=a,this.cache=new Map,this.attachEvents(e),this.currentLocation=n(window.location.href),this.cache.set(this.currentLocation.href,this.createCacheEntry(document.cloneNode(!0))),this.currentView=this.cache.get(this.currentLocation.href),this.currentView.view.initialLoad()}setDefaultView(t){this.defaultView=this.views[t]}setDefaultTransition(t){this.defaultTransition=this.transitions[t]}addRoute(t,e,n){this.router||(this.router=new a),this.router.add(t,e,n)}preload(t){var e=this;return t=n(t).href,this.cache.has(t)||this.fetch(t).then(async function(n){e.cache.set(t,e.createCacheEntry(n))}),this}navigate(t,e=!1,r=!1){var i=this;return this.targetLocation=n(t),new Promise((t,n)=>{if(this.isTransitioning)return void n(new Error("A transition is currently in progress"));const a=new(this.chooseTransition(e))({wrapper:this.wrapper});this.beforeFetch(this.targetLocation,a,r).then(async function(){return i.cache.has(i.targetLocation.href)?await i.afterFetch(i.targetLocation,a,i.cache.get(i.targetLocation.href),r):i.fetch(i.targetLocation.raw).then(async function(t){return await i.afterFetch(i.targetLocation,a,i.createCacheEntry(t),r)})}).then(()=>{t()})})}beforeFetch(e,n,r){return this.isTransitioning=!0,console.log("NAVIGATE_OUT"),t.emit("NAVIGATE_OUT",{from:this.currentView,trigger:r}),new Promise(t=>{this.currentView.view.leave(n,r).then(()=>{"popstate"!==r&&window.history.pushState({},"",e.raw),t()})})}afterFetch(e,n,r,i){return this.cache.has(e.href)||this.cache.set(e.href,r),this.currentLocation=e,console.log("NAVIGATE_IN"),t.emit("NAVIGATE_IN",{from:this.currentView,to:r,trigger:i}),new Promise(e=>{r.view.update(),this.loadScripts(r.scripts),r.view.enter(n,i).then(()=>{console.log("NAVIGATE_COMPLETE",this.cache),t.emit("NAVIGATE_COMPLETE",{from:this.currentView,to:r,trigger:i}),this.currentView=r,this.isTransitioning=!1,e()})})}loadScripts(t){const e=[...t],n=[...document.querySelectorAll("script:not([data-no-reload])")].filter(this.reloadJsFilter);for(let t=0;t<n.length;t++)for(let r=0;r<e.length;r++)if(n[t].outerHTML===e[r].outerHTML){(a=n[t]).parentNode.replaceChild(i(a),a),e.splice(r,1);break}var a;for(const t of e)r(t)}attachEvents(e){t.delegate("click",e,this.onClick),t.on("popstate",window,this.onPopstate)}fetch(t){return new Promise(n=>{fetch(t,{mode:"same-origin",method:"GET",headers:{"X-Requested-With":"Taxi"},credentials:"same-origin"}).then(e=>(e.ok||(console.warn("Taxi encountered a non 2xx HTTP status code"),window.location.href=t),e.text())).then(t=>{var r;n("string"==typeof(r=t)?e.parseFromString(r,"text/html"):r)}).catch(e=>{console.warn(e),window.location.href=t})})}chooseTransition(t){var e;if(t)return this.transitions[t];const n=null==(e=this.router)?void 0:e.findMatch(this.currentLocation,this.targetLocation);return n?this.transitions[n]:this.defaultTransition}createCacheEntry(t){const e=t.querySelector("[data-taxi-view]"),n=e.dataset.taxiView.length?this.views[e.dataset.taxiView]:this.defaultView;return{page:t,content:e,scripts:[...t.querySelectorAll("script:not([data-no-reload])")].filter(this.reloadJsFilter),title:t.title,view:new n({wrapper:this.wrapper,title:t.title,content:e,page:t})}}}function s(){return s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},s.apply(this,arguments)}class h{constructor({wrapper:t}){this.wrapper=t}leave(t){return new Promise(e=>{this.onLeave(s({},t,{done:e}))})}enter(t){return new Promise(e=>{this.onEnter(s({},t,{done:e}))})}onLeave({done:t}){t()}onEnter({done:t}){t()}}class c{constructor({content:t,page:e,title:n,wrapper:r}){this.content=t,this.page=e,this.title=n,this.wrapper=r}onEnter(){}onEnterCompleted(){}onLeave(){}onLeaveCompleted(){}initialLoad(){this.onEnter(),this.onEnterCompleted()}update(){document.title=this.title,this.wrapper.insertAdjacentHTML("beforeend",this.content.outerHTML)}remove(){this.wrapper.firstElementChild.remove()}enter(t,e){return new Promise(n=>{this.onEnter(),t.enter({trigger:e,to:this.content}).then(()=>{this.onEnterCompleted(),n()})})}leave(t,e){return new Promise(n=>{this.onLeave(),t.leave({trigger:e,from:this.content}).then(()=>{this.remove(),this.onLeaveCompleted(),n()})})}}export{o as Core,h as Transition,c as View};
//# sourceMappingURL=taxi.modern.js.map

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@unseenco/e")):"function"==typeof define&&define.amd?define(["exports","@unseenco/e"],e):e((t||self).taxi={},t.E)}(this,function(t,e){function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=/*#__PURE__*/n(e);function i(){return i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i.apply(this,arguments)}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function a(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c=new DOMParser;function s(t){var e=new URL(t,window.location.origin),n=null;return e.hash.length&&(n=t.replace(e.hash,"")),{hasHash:e.hash.length>0,pathname:e.pathname,raw:t,href:n||e.href}}function u(t){"HEAD"===t.parentNode.tagName?document.head.appendChild(h(t)):document.body.appendChild(h(t))}function h(t){for(var e=document.createElement("SCRIPT"),n=0;n<t.attributes.length;n++){var r=t.attributes[n];e.setAttribute(r.nodeName,r.nodeValue)}return t.innerHTML&&(e.innerHTML=t.innerHTML),e}var f=/*#__PURE__*/function(){function t(){this.data=new Map,this.regexCache=new Map}var e=t.prototype;return e.add=function(t,e,n){this.data.has(t)||(this.data.set(t,new Map),this.regexCache.set(t,new RegExp("^"+t+"$"))),this.data.get(t).set(e,n),this.regexCache.set(e,new RegExp("^"+e+"$"))},e.findMatch=function(t,e){for(var n,r=a(this.data);!(n=r()).done;){var i=n.value,o=i[1];if(t.pathname.match(this.regexCache.get(i[0]))){for(var c,s=a(o);!(c=s()).done;){var u=c.value,h=u[1];if(e.pathname.match(this.regexCache.get(u[0])))return h}break}}return null},t}(),l=/*#__PURE__*/function(){function t(t){var e=this;void 0===t&&(t={}),this.isTransitioning=!1,this.currentView=null,this.cache=new Map,this.onClick=function(t){if(!t.metaKey&&!t.ctrlKey){var n=s(t.currentTarget.href);if(e.currentLocation=s(window.location.href),e.currentLocation.href!==n.href||e.currentLocation.hasHash&&!n.hasHash)return t.preventDefault(),void e.navigate(n.raw,t.currentTarget.dataset.taxiTransition||!1,t.currentTarget);e.currentLocation.hasHash||n.hasHash||t.preventDefault()}},this.onPopstate=function(){return window.location.pathname!==e.currentLocation.pathname&&(e.isTransitioning?(window.history.pushState({},"",e.currentLocation.href),!1):void e.navigate(window.location.href,!1,"popstate"))};var n=t.links,r=void 0===n?"a:not([target]):not([href^=\\#]):not([data-taxi-ignore])":n,i=t.views,o=t.transitions,a=void 0===o?{default:p}:o,c=t.reloadJsFilter,u=void 0===c?function(t){return!("__bs_script__"===(null==t?void 0:t.id)||null!=t&&t.src.includes("browser-sync-client.js"))}:c;this.views=void 0===i?{default:v}:i,this.transitions=a,this.defaultView=this.views.default||v,this.defaultTransition=this.transitions.default||p,this.wrapper=document.querySelector("[data-taxi]"),this.reloadJsFilter=u,this.cache=new Map,this.attachEvents(r),this.currentLocation=s(window.location.href),this.cache.set(this.currentLocation.href,this.createCacheEntry(document.cloneNode(!0))),this.currentView=this.cache.get(this.currentLocation.href),this.currentView.view.initialLoad()}var e=t.prototype;return e.setDefaultView=function(t){this.defaultView=this.views[t]},e.setDefaultTransition=function(t){this.defaultTransition=this.transitions[t]},e.addRoute=function(t,e,n){this.router||(this.router=new f),this.router.add(t,e,n)},e.preload=function(t){var e=this;return t=s(t).href,this.cache.has(t)||this.fetch(t).then(function(n){try{return e.cache.set(t,e.createCacheEntry(n)),Promise.resolve()}catch(t){return Promise.reject(t)}}),this},e.navigate=function(t,e,n){var r=this;return void 0===e&&(e=!1),void 0===n&&(n=!1),this.targetLocation=s(t),new Promise(function(t,i){if(r.isTransitioning)i(new Error("A transition is currently in progress"));else{var o=new(r.chooseTransition(e))({wrapper:r.wrapper});r.beforeFetch(r.targetLocation,o,n).then(function(){try{return r.cache.has(r.targetLocation.href)?Promise.resolve(r.afterFetch(r.targetLocation,o,r.cache.get(r.targetLocation.href),n)):Promise.resolve(r.fetch(r.targetLocation.raw).then(function(t){try{return Promise.resolve(r.afterFetch(r.targetLocation,o,r.createCacheEntry(t),n))}catch(t){return Promise.reject(t)}}))}catch(t){return Promise.reject(t)}}).then(function(){t()})}})},e.beforeFetch=function(t,e,n){var i=this;return this.isTransitioning=!0,console.log("NAVIGATE_OUT"),r.default.emit("NAVIGATE_OUT",{from:this.currentView,trigger:n}),new Promise(function(r){i.currentView.view.leave(e,n).then(function(){"popstate"!==n&&window.history.pushState({},"",t.raw),r()})})},e.afterFetch=function(t,e,n,i){var o=this;return this.cache.has(t.href)||this.cache.set(t.href,n),this.currentLocation=t,console.log("NAVIGATE_IN"),r.default.emit("NAVIGATE_IN",{from:this.currentView,to:n,trigger:i}),new Promise(function(t){n.view.update(),o.loadScripts(n.scripts),n.view.enter(e,i).then(function(){console.log("NAVIGATE_COMPLETE",o.cache),r.default.emit("NAVIGATE_COMPLETE",{from:o.currentView,to:n,trigger:i}),o.currentView=n,o.isTransitioning=!1,t()})})},e.loadScripts=function(t){for(var e,n=[].concat(t),r=[].concat(document.querySelectorAll("script:not([data-no-reload])")).filter(this.reloadJsFilter),i=0;i<r.length;i++)for(var o=0;o<n.length;o++)if(r[i].outerHTML===n[o].outerHTML){(e=r[i]).parentNode.replaceChild(h(e),e),n.splice(o,1);break}for(var c,s=a(n);!(c=s()).done;)u(c.value)},e.attachEvents=function(t){r.default.delegate("click",t,this.onClick),r.default.on("popstate",window,this.onPopstate)},e.fetch=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t){return new Promise(function(e){fetch(t,{mode:"same-origin",method:"GET",headers:{"X-Requested-With":"Taxi"},credentials:"same-origin"}).then(function(e){return e.ok||(console.warn("Taxi encountered a non 2xx HTTP status code"),window.location.href=t),e.text()}).then(function(t){var n;e("string"==typeof(n=t)?c.parseFromString(n,"text/html"):n)}).catch(function(e){console.warn(e),window.location.href=t})})}),e.chooseTransition=function(t){var e;if(t)return this.transitions[t];var n=null==(e=this.router)?void 0:e.findMatch(this.currentLocation,this.targetLocation);return n?this.transitions[n]:this.defaultTransition},e.createCacheEntry=function(t){var e=t.querySelector("[data-taxi-view]"),n=e.dataset.taxiView.length?this.views[e.dataset.taxiView]:this.defaultView;return{page:t,content:e,scripts:[].concat(t.querySelectorAll("script:not([data-no-reload])")).filter(this.reloadJsFilter),title:t.title,view:new n({wrapper:this.wrapper,title:t.title,content:e,page:t})}},t}(),d={__proto__:null,default:l},p=/*#__PURE__*/function(){function t(t){this.wrapper=t.wrapper}var e=t.prototype;return e.leave=function(t){var e=this;return new Promise(function(n){e.onLeave(i({},t,{done:n}))})},e.enter=function(t){var e=this;return new Promise(function(n){e.onEnter(i({},t,{done:n}))})},e.onLeave=function(t){(0,t.done)()},e.onEnter=function(t){(0,t.done)()},t}(),v=/*#__PURE__*/function(){function t(t){var e=t.page,n=t.title,r=t.wrapper;this.content=t.content,this.page=e,this.title=n,this.wrapper=r}var e=t.prototype;return e.onEnter=function(){},e.onEnterCompleted=function(){},e.onLeave=function(){},e.onLeaveCompleted=function(){},e.initialLoad=function(){this.onEnter(),this.onEnterCompleted()},e.update=function(){document.title=this.title,this.wrapper.insertAdjacentHTML("beforeend",this.content.outerHTML)},e.remove=function(){this.wrapper.firstElementChild.remove()},e.enter=function(t,e){var n=this;return new Promise(function(r){n.onEnter(),t.enter({trigger:e,to:n.content}).then(function(){n.onEnterCompleted(),r()})})},e.leave=function(t,e){var n=this;return new Promise(function(r){n.onLeave(),t.leave({trigger:e,from:n.content}).then(function(){n.remove(),n.onLeaveCompleted(),r()})})},t}();t.Taxi=d,t.Transition=p,t.View=v});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@unseenco/e")):"function"==typeof define&&define.amd?define(["exports","@unseenco/e"],e):e((t||self).taxi={},t.E)}(this,function(t,e){function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=/*#__PURE__*/n(e);function i(){return i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i.apply(this,arguments)}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function a(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c=new DOMParser;function s(t){var e=new URL(t,window.location.origin),n=null;return e.hash.length&&(n=t.replace(e.hash,"")),{hasHash:e.hash.length>0,pathname:e.pathname,raw:t,href:n||e.href}}function u(t){"HEAD"===t.parentNode.tagName?document.head.appendChild(h(t)):document.body.appendChild(h(t))}function h(t){for(var e=document.createElement("SCRIPT"),n=0;n<t.attributes.length;n++){var r=t.attributes[n];e.setAttribute(r.nodeName,r.nodeValue)}return t.innerHTML&&(e.innerHTML=t.innerHTML),e}var f=/*#__PURE__*/function(){function t(){this.data=new Map,this.regexCache=new Map}var e=t.prototype;return e.add=function(t,e,n){this.data.has(t)||(this.data.set(t,new Map),this.regexCache.set(t,new RegExp("^"+t+"$"))),this.data.get(t).set(e,n),this.regexCache.set(e,new RegExp("^"+e+"$"))},e.findMatch=function(t,e){for(var n,r=a(this.data);!(n=r()).done;){var i=n.value,o=i[1];if(t.pathname.match(this.regexCache.get(i[0]))){for(var c,s=a(o);!(c=s()).done;){var u=c.value,h=u[1];if(e.pathname.match(this.regexCache.get(u[0])))return h}break}}return null},t}(),l=/*#__PURE__*/function(){function t(t){var e=this;void 0===t&&(t={}),this.isTransitioning=!1,this.currentView=null,this.cache=new Map,this.onClick=function(t){if(!t.metaKey&&!t.ctrlKey){var n=s(t.currentTarget.href);if(e.currentLocation=s(window.location.href),e.currentLocation.href!==n.href||e.currentLocation.hasHash&&!n.hasHash)return t.preventDefault(),void e.navigate(n.raw,t.currentTarget.dataset.taxiTransition||!1,t.currentTarget);e.currentLocation.hasHash||n.hasHash||t.preventDefault()}},this.onPopstate=function(){return window.location.pathname!==e.currentLocation.pathname&&(e.isTransitioning?(window.history.pushState({},"",e.currentLocation.href),!1):void e.navigate(window.location.href,!1,"popstate"))};var n=t.links,r=void 0===n?"a:not([target]):not([href^=\\#]):not([data-taxi-ignore])":n,i=t.views,o=t.transitions,a=void 0===o?{default:d}:o,c=t.reloadJsFilter,u=void 0===c?function(t){return!("__bs_script__"===(null==t?void 0:t.id)||null!=t&&t.src.includes("browser-sync-client.js"))}:c;this.views=void 0===i?{default:p}:i,this.transitions=a,this.defaultView=this.views.default||p,this.defaultTransition=this.transitions.default||d,this.wrapper=document.querySelector("[data-taxi]"),this.reloadJsFilter=u,this.cache=new Map,this.attachEvents(r),this.currentLocation=s(window.location.href),this.cache.set(this.currentLocation.href,this.createCacheEntry(document.cloneNode(!0))),this.currentView=this.cache.get(this.currentLocation.href),this.currentView.view.initialLoad()}var e=t.prototype;return e.setDefaultView=function(t){this.defaultView=this.views[t]},e.setDefaultTransition=function(t){this.defaultTransition=this.transitions[t]},e.addRoute=function(t,e,n){this.router||(this.router=new f),this.router.add(t,e,n)},e.preload=function(t){var e=this;return t=s(t).href,this.cache.has(t)||this.fetch(t).then(function(n){try{return e.cache.set(t,e.createCacheEntry(n)),Promise.resolve()}catch(t){return Promise.reject(t)}}),this},e.navigate=function(t,e,n){var r=this;return void 0===e&&(e=!1),void 0===n&&(n=!1),this.targetLocation=s(t),new Promise(function(t,i){if(r.isTransitioning)i(new Error("A transition is currently in progress"));else{var o=new(r.chooseTransition(e))({wrapper:r.wrapper});r.beforeFetch(r.targetLocation,o,n).then(function(){try{return r.cache.has(r.targetLocation.href)?Promise.resolve(r.afterFetch(r.targetLocation,o,r.cache.get(r.targetLocation.href),n)):Promise.resolve(r.fetch(r.targetLocation.raw).then(function(t){try{return Promise.resolve(r.afterFetch(r.targetLocation,o,r.createCacheEntry(t),n))}catch(t){return Promise.reject(t)}}))}catch(t){return Promise.reject(t)}}).then(function(){t()})}})},e.beforeFetch=function(t,e,n){var i=this;return this.isTransitioning=!0,console.log("NAVIGATE_OUT"),r.default.emit("NAVIGATE_OUT",{from:this.currentView,trigger:n}),new Promise(function(r){i.currentView.view.leave(e,n).then(function(){"popstate"!==n&&window.history.pushState({},"",t.raw),r()})})},e.afterFetch=function(t,e,n,i){var o=this;return this.cache.has(t.href)||this.cache.set(t.href,n),this.currentLocation=t,console.log("NAVIGATE_IN"),r.default.emit("NAVIGATE_IN",{from:this.currentView,to:n,trigger:i}),new Promise(function(t){n.view.update(),o.loadScripts(n.scripts),n.view.enter(e,i).then(function(){console.log("NAVIGATE_COMPLETE",o.cache),r.default.emit("NAVIGATE_COMPLETE",{from:o.currentView,to:n,trigger:i}),o.currentView=n,o.isTransitioning=!1,t()})})},e.loadScripts=function(t){for(var e,n=[].concat(t),r=[].concat(document.querySelectorAll("script:not([data-no-reload])")).filter(this.reloadJsFilter),i=0;i<r.length;i++)for(var o=0;o<n.length;o++)if(r[i].outerHTML===n[o].outerHTML){(e=r[i]).parentNode.replaceChild(h(e),e),n.splice(o,1);break}for(var c,s=a(n);!(c=s()).done;)u(c.value)},e.attachEvents=function(t){r.default.delegate("click",t,this.onClick),r.default.on("popstate",window,this.onPopstate)},e.fetch=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t){return new Promise(function(e){fetch(t,{mode:"same-origin",method:"GET",headers:{"X-Requested-With":"Taxi"},credentials:"same-origin"}).then(function(e){return e.ok||(console.warn("Taxi encountered a non 2xx HTTP status code"),window.location.href=t),e.text()}).then(function(t){var n;e("string"==typeof(n=t)?c.parseFromString(n,"text/html"):n)}).catch(function(e){console.warn(e),window.location.href=t})})}),e.chooseTransition=function(t){var e;if(t)return this.transitions[t];var n=null==(e=this.router)?void 0:e.findMatch(this.currentLocation,this.targetLocation);return n?this.transitions[n]:this.defaultTransition},e.createCacheEntry=function(t){var e=t.querySelector("[data-taxi-view]"),n=e.dataset.taxiView.length?this.views[e.dataset.taxiView]:this.defaultView;return{page:t,content:e,scripts:[].concat(t.querySelectorAll("script:not([data-no-reload])")).filter(this.reloadJsFilter),title:t.title,view:new n({wrapper:this.wrapper,title:t.title,content:e,page:t})}},t}(),d=/*#__PURE__*/function(){function t(t){this.wrapper=t.wrapper}var e=t.prototype;return e.leave=function(t){var e=this;return new Promise(function(n){e.onLeave(i({},t,{done:n}))})},e.enter=function(t){var e=this;return new Promise(function(n){e.onEnter(i({},t,{done:n}))})},e.onLeave=function(t){(0,t.done)()},e.onEnter=function(t){(0,t.done)()},t}(),p=/*#__PURE__*/function(){function t(t){var e=t.page,n=t.title,r=t.wrapper;this.content=t.content,this.page=e,this.title=n,this.wrapper=r}var e=t.prototype;return e.onEnter=function(){},e.onEnterCompleted=function(){},e.onLeave=function(){},e.onLeaveCompleted=function(){},e.initialLoad=function(){this.onEnter(),this.onEnterCompleted()},e.update=function(){document.title=this.title,this.wrapper.insertAdjacentHTML("beforeend",this.content.outerHTML)},e.remove=function(){this.wrapper.firstElementChild.remove()},e.enter=function(t,e){var n=this;return new Promise(function(r){n.onEnter(),t.enter({trigger:e,to:n.content}).then(function(){n.onEnterCompleted(),r()})})},e.leave=function(t,e){var n=this;return new Promise(function(r){n.onLeave(),t.leave({trigger:e,from:n.content}).then(function(){n.remove(),n.onLeaveCompleted(),r()})})},t}();t.Core=l,t.Transition=d,t.View=p});
//# sourceMappingURL=taxi.umd.js.map
{
"name": "@unseenco/taxi",
"description": "A modern page transition library which supports routing, preloading, and additional script reloading.",
"version": "0.1.7",
"version": "0.1.8",
"license": "GPL-3.0-or-later",

@@ -6,0 +6,0 @@ "source": "src/taxi.js",

@@ -1,4 +0,4 @@

import * as Taxi from "./Core";
import Core from "./Core";
import View from "./View";
import Transition from "./Transition";
export { Taxi, View, Transition };
export { Core, View, Transition };

@@ -1,2 +0,2 @@

import * as Taxi from "./Core"
import Core from "./Core"
import View from "./View"

@@ -6,5 +6,5 @@ import Transition from "./Transition"

export {
Taxi,
Core,
View,
Transition
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc