{
  "version": 3,
  "sources": [
    "../tollan-gulp/node_modules/browserify/node_modules/browser-pack/_prelude.js",
    "/home/paul/tollan/2/kingfish/build/lib/kingfish.js",
    "/home/paul/tollan/2/kingfish/demo/browser.js",
    "/home/paul/tollan/2/kingfish/demo/routes.js"
  ],
  "names": [],
  "mappings": "AAAA;ACAA,YAAY,CAAC;;AAEb,IAAI,YAAY,GAAG,CAAC,YAAY;AAAE,UAAS,gBAAgB,CAAC,MAAM,EAAE,KAAK,EAAE;AAAE,OAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAAE,OAAI,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,AAAC,UAAU,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,IAAI,KAAK,CAAC,AAAC,UAAU,CAAC,YAAY,GAAG,IAAI,CAAC,AAAC,IAAI,OAAO,IAAI,UAAU,EAAE,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,AAAC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;GAAE;EAAE,AAAC,OAAO,UAAU,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE;AAAE,MAAI,UAAU,EAAE,gBAAgB,CAAC,WAAW,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,AAAC,IAAI,WAAW,EAAE,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,AAAC,OAAO,WAAW,CAAC;EAAE,CAAC;CAAE,CAAA,EAAG,CAAC;;AAEtjB,SAAS,eAAe,CAAC,QAAQ,EAAE,WAAW,EAAE;AAAE,KAAI,EAAE,QAAQ,YAAY,WAAW,CAAA,AAAC,EAAE;AAAE,QAAM,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAC;EAAE;CAAE;;;;AAIzJ,IAAI,MAAM,GAAG,CAAC,YAAY;;;;AAIzB,UAAS,MAA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"sourceRoot": "",
  "sourcesContent": [
    "(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})",
    "'use strict';\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\n// Router object, used on both server and browser\n\nvar router = (function () {\n\n\t// Initialize the router\n\n\tfunction router(routes, element) {\n\t\t_classCallCheck(this, router);\n\n\t\tthis.routes = routes;\n\t\tthis.element = element;\n\t\tthis.currentRoute = undefined;\n\n\t\t// Determine which click event to use (lifted from page.js)\n\t\tthis.clickEvent = typeof document !== 'undefined' && document.ontouchstart ? 'touchstart' : 'click';\n\n\t\t// Process the routes\n\t\tfor (var path in routes) {\n\t\t\tvar route = this.routes[path];\n\t\t\troute.prototype.path = path;\n\t\t\tvar regexp = path;\n\t\t\tregexp = regexp.replace('/?', '/([^/]*)'); // Numerical parameters\n\t\t\tregexp = regexp.replace('/*', '(.*)'); // Catch-all parameter\n\t\t\tregexp = '^' + regexp + '$'; // Match the entire string\n\t\t\troute.regexp = new RegExp(regexp, 'i'); // Make the case-insensitive regular expression object\n\t\t}\n\t}\n\n\t_createClass(router, [{\n\t\tkey: 'renderString',\n\n\t\t// Route a given path and render to a string\n\t\t// Mainly used for server-side rendering\n\t\tvalue: function renderString(url) {\n\t\t\tif (process.browser) {\n\t\t\t\t// Lol no stahp\n\t\t\t\tif (process.env.NODE_ENV !== 'production') console.log('Do not use renderString on the client.');\n\t\t\t} else {\n\t\t\t\tvar startTime = Date.now();\n\t\t\t\tvar params = {};\n\t\t\t\tvar matchedRoute;\n\n\t\t\t\t// Search for a route matching the given path\n\t\t\t\tfor (var path in this.routes) {\n\t\t\t\t\tvar route = this.routes[path];\n\t\t\t\t\tvar result = url.match(route.regexp);\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\tmatchedRoute = route;\n\t\t\t\t\t\tparams = result.slice(1, result.length);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!matchedRoute) {\n\n\t\t\t\t\t// Oh no we couldn't find a route, do a 404\n\t\t\t\t\t// For a custom 404, create a \"/*\" handler\n\t\t\t\t\tif (process.env.NODE_ENV !== 'production') console.log('No route found for url: ' + url);\n\t\t\t\t\treturn [404, '404'];\n\t\t\t\t} else {\n\n\t\t\t\t\t// We found the route, render it\n\t\t\t\t\t// On the server there is no concept of mounting or having a previous route\n\t\t\t\t\tvar handler = new matchedRoute();\n\t\t\t\t\thandler.params = params;\n\t\t\t\t\tvar string = handler.renderString();\n\t\t\t\t\tif (process.env.NODE_ENV !== 'production') console.log('Rendered ' + handler.path + ' in ' + (Date.now() - startTime) + 'ms');\n\t\t\t\t\treturn string;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'render',\n\n\t\t// Route a given path and mount the handler on the client\n\t\t// Do not use on the server\n\t\tvalue: function render(url) {\n\t\t\tvar startTime = Date.now();\n\t\t\tvar params = {};\n\t\t\tvar matchedRoute;\n\t\t\t// Search for a route matching the given path\n\t\t\tfor (var r in this.routes) {\n\t\t\t\tvar route = this.routes[r];\n\t\t\t\tvar result = url.match(route.regexp);\n\t\t\t\tif (result) {\n\t\t\t\t\tmatchedRoute = route;\n\t\t\t\t\tparams = result.slice(1, result.length);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!matchedRoute) {\n\n\t\t\t\t// Oh no we couldn't find a route, do a 404\n\t\t\t\t// For a custom 404, create a \"/*\" handler\n\t\t\t\tif (process.env.NODE_ENV !== 'production') console.log('No route found for url: ' + url + ' in ' + (Date.now() - startTime) + 'ms');\n\t\t\t\tthis.element.innerHTML = '404';\n\t\t\t\treturn;\n\t\t\t} else if (typeof this.currentRoute !== 'undefined' && matchedRoute.prototype.path === this.currentRoute.path) {\n\n\t\t\t\t// We found the route, and it's the same as the current one\n\t\t\t\t// Update the params for the handler\n\t\t\t\tif (typeof this.currentRoute.setParams === 'function') {\n\t\t\t\t\tthis.currentRoute.setParams(params);\n\t\t\t\t} else if (process.env.NODE_ENV !== 'production') {\n\t\t\t\t\tvar s = 'No setParams method found for route ' + this.currentRoute.path + '. This is necessary to update when the URL changes.';\n\t\t\t\t\tconsole.log(s);\n\t\t\t\t\tthis.element.innerHTML = s;\n\t\t\t\t}\n\n\t\t\t\tif (process.env.NODE_ENV !== 'production') console.log('Updated ' + this.currentRoute.path + ' in ' + (Date.now() - startTime) + 'ms');\n\t\t\t} else {\n\n\t\t\t\t// We found the route, and it's different from the current one\n\t\t\t\t// Unmount the current handler\n\t\t\t\tif (typeof this.currentRoute !== 'undefined' && typeof this.currentRoute.unmount === 'function') {\n\t\t\t\t\tthis.currentRoute.unmount();\n\t\t\t\t\tif (process.env.NODE_ENV !== 'production') console.log('Unmounted ' + this.currentRoute.path);\n\t\t\t\t}\n\n\t\t\t\t// Create the new handler\n\t\t\t\tvar handler = new matchedRoute();\n\t\t\t\thandler.params = params;\n\t\t\t\thandler.element = this.element;\n\t\t\t\tthis.currentRoute = handler;\n\n\t\t\t\t// Finally mount or render the handler\n\t\t\t\tif (typeof handler.mount === 'function') {\n\t\t\t\t\thandler.mount(this.element);\n\t\t\t\t} else if (typeof handler.renderString === 'function') {\n\t\t\t\t\tthis.element.innerHTML = handler.renderString();\n\t\t\t\t} else if (process.env.NODE_ENV !== 'production') {\n\t\t\t\t\tvar s = 'No mount or renderString method present for route ' + this.currentRoute.path + '. This is necessary to display anything.';\n\t\t\t\t\tconsole.log(s);\n\t\t\t\t\tthis.element.innerHTML = s;\n\t\t\t\t}\n\n\t\t\t\tif (process.env.NODE_ENV !== 'production') console.log('Mounted ' + this.currentRoute.path + ' in ' + (Date.now() - startTime) + 'ms');\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'onpopstate',\n\n\t\t// Event handler for back/forward buttons\n\t\tvalue: function onpopstate(e) {\n\t\t\te.preventDefault();\n\t\t\tthis.render(location.pathname + location.hash);\n\t\t}\n\t}, {\n\t\tkey: 'isSameOrigin',\n\n\t\t// Helper functions for onclick\n\t\tvalue: function isSameOrigin(href) {\n\t\t\t// Checks if a href is on the same origin as us, taken from page.js\n\t\t\t// https://github.com/visionmedia/page.js\n\t\t\tvar origin = location.protocol + '//' + location.hostname;\n\t\t\tif (location.port) {\n\t\t\t\torigin += ':' + location.port;\n\t\t\t}\n\t\t\treturn href && href.indexOf(origin) === 0;\n\t\t}\n\t}, {\n\t\tkey: 'which',\n\t\tvalue: function which(e) {\n\t\t\t// Something to do which checking for a mouse event of some sort, not completely sure.\n\t\t\t// Lifted directly from page.js\n\t\t\t// https://github.com/visionmedia/page.js\n\t\t\te = e || window.event;\n\t\t\treturn e.which === null ? e.button : e.which;\n\t\t}\n\t}, {\n\t\tkey: 'onclick',\n\n\t\t// Click handler for the entire document\n\t\tvalue: function onclick(e) {\n\t\t\t// Some checks to make sure it's a link we want to hijack, mostly lifed from page.js\n\t\t\t// https://github.com/visionmedia/page.js\n\n\t\t\t// Not entirely sure what this checks but page.js had it so it's probably useful somewhere\n\t\t\tif (this.which(e) !== 1) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check if we're holding a special key down, that changes the default\n\t\t\t// link behavior.\n\t\t\tif (e.metaKey || e.ctrlKey || e.shiftKey) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check if some other event handler has already called preventDefault\n\t\t\tif (e.defaultPrevented) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Ensure we clicked on a link and not something else\n\t\t\t// Necessary because we're listening to clicks on the entire document\n\t\t\tvar el = e.target;\n\t\t\twhile (el && el.nodeName !== 'A') {\n\t\t\t\tel = el.parentNode;\n\t\t\t}\n\t\t\tif (!el || el.nodeName !== 'A') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Ignore if tag has\n\t\t\t// 1. \"download\" attribute\n\t\t\t// 2. rel=\"external\" attribute\n\t\t\tif (el.hasAttribute('download') || el.getAttribute('rel') === 'external') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Get the URL we're going to for the remaining checks\n\t\t\tvar link = el.getAttribute('href');\n\n\t\t\t// Check if the target is set, if so it's doing something different, usually\n\t\t\t// opening in a new tab.\n\t\t\tif (el.target) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check the x-origin, if it's different we're going to another website\n\t\t\t// Also checks if the protocol changed, like going from http to https or mailto\n\t\t\tif (!this.isSameOrigin(el.href)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\te.preventDefault();\n\n\t\t\thistory.pushState(undefined, '', link);\n\t\t\tthis.render(link);\n\t\t}\n\t}, {\n\t\tkey: 'start',\n\n\t\t// Start the router\n\t\t// Hijack link clicks and the back button\n\t\tvalue: function start() {\n\t\t\twindow.addEventListener('popstate', this.onpopstate.bind(this), false);\n\t\t\twindow.addEventListener(this.clickEvent, this.onclick.bind(this), false);\n\t\t\tthis.render(location.pathname + location.hash);\n\t\t}\n\t}, {\n\t\tkey: 'stop',\n\n\t\t// Cleans up event listeners created by start\n\t\tvalue: function stop() {\n\t\t\twindow.removeEventListener('popstate', this.onpopstate, false);\n\t\t\twindow.removeEventListener(this.clickEvent, this.onclick, false);\n\t\t}\n\t}]);\n\n\treturn router;\n})();\n\nmodule.exports = router;",
    "'use strict';\n\n// Browser-side code for kingfish demo\n\n// Create the router\nvar router = require('kingfish');\nvar routes = require('./routes');\nvar r = new router(routes, document.getElementById('content'));\n\n// Handle the current URL and start listening to link clicks and back/forward buttons\nr.start();\n",
    "'use strict';\n\n// Routes definitions for kingfish demo.\n\nvar router = require('kingfish');\n\n// Routes for blog module\nvar blogRoutes = {\n\n\t// Display a single post\n\t'/post/?': class {\n\n\t\t// Render a simple string with the page contents\n\t\trenderString() {\n\t\t\treturn 'This is the post with ID ' + this.params[0];\n\t\t}\n\n\t\t// Here we do not have comments or any other dynamic content--post pages\n\t\t// are completely static. So, we will just re-use the renderString method.\n\t\t// This mount method is technically optional in this case, as this is the\n\t\t// default behavior.\n\t\tmount() {\n\t\t\tthis.element.innerHTML = this.renderString();\n\t\t}\n\n\t\t// This is called when moving from one blog post to another. This method\n\t\t// is optional when the parameters never change, however most of the time\n\t\t// this will not be the case.\n\t\tsetParams(newParams) {\n\t\t\tthis.params = newParams;\n\t\t\tthis.mount();\n\t\t}\n\t},\n\n\t// Blog homepage\n\t// This handler is written completely in ES5 for demonstrative purposes.\n\t// You can use ES5 or ES6, but ES6 will be much easier to read.\n\t'/': (function() {\n\t\tvar handler = function() {};\n\t\thandler.prototype.renderString = function() {\n\t\t\treturn 'List of all the blog posts would go here';\n\t\t};\n\t\treturn handler;\n\t})(),\n\n\t// 404 handler, /* means match everything\n\t// This must be defined last as routes are searched in the order they are defined,\n\t// if it's first it will always be a match and the other routes would never be used\n\t'/*': class {\n\t\trenderString() {\n\t\t\treturn 'Could not find that page in the blog';\n\t\t}\n\t}\n};\n\n// Routes for the main application\nmodule.exports = {\n\n\t// Display the blog module at /blog\n\t// We have /* at the end to match everything after /blog, this will be set\n\t// as a parameter which we will give to the blog module.\n\t'/blog/*': class {\n\t\t// Render the page contents as a string\n\t\t// We create a router to handle the post contents here. For slightly better\n\t\t// performance we could also create the router when this module is loaded,\n\t\t// so it is only done once.\n\t\trenderString() {\n\t\t\tvar r = new router(blogRoutes);\n\t\t\tvar child = r.renderString(this.params[0]);\n\t\t\treturn 'Blog<div class=\"childContainer\">' + child + '</div>';\n\t\t}\n\n\t\t// Render the page contents into the DOM element and start whatever the blog\n\t\t// module requires to work, in this case just the router.\n\t\t// A better API for modules would be to expose mount, unmount, and setParams methods\n\t\t// only, so they could be used anywhere.\n\t\t// We do not use an id on the element as we have no knowledge of the rest\n\t\t// of the page, and cannot guarantee that an id will ever be unique.\n\t\tmount() {\n\t\t\t// Render our own HTML with a container for the blog\n\t\t\tthis.element.innerHTML = 'Blog<div class=\"childContainer\"></div>';\n\t\t\t// Retreive the blog's container, this is going to cause a layout+paint so don't do it too often\n\t\t\tvar childElement = this.element.getElementsByClassName('childContainer')[0];\n\t\t\t// Start a router for the blog\n\t\t\tthis.childRouter = new router(blogRoutes, childElement);\n\t\t\t// Re-use the setParams method to display the blog contents, it knows how to do it\n\t\t\tthis.setParams(this.params);\n\t\t}\n\n\n\t\t// Called when navigating away from /blog completely, destroy any event handlers\n\t\t// and objects created. This is actually not required as the childRouter was\n\t\t// never started, but is included for demonstration purposes.\n\t\tunmount() {\n\t\t\tthis.childRouter.stop();\n\t\t}\n\n\t\t// Navigating to a new URL within /blog, send the rest of the URL to the\n\t\t// blog's route handler so it can deal with it.\n\t\t// We receive the new params as an argument so we could compare with the\n\t\t// old ones and decide what to update.\n\t\tsetParams(newParams) {\n\t\t\tthis.params = newParams;\n\t\t\tthis.childRouter.render(this.params[0]);\n\t\t}\n\t},\n\n\t// Display the home page, it's just a static string and there are no URL parameters\n\t// so only the renderString method is needed.\n\t'/': class {\n\t\trenderString() {\n\t\t\treturn `\n\t\t\t\t<p>This is the home page.</p>\n\t\t\t\t<p>Pages are rendered on the server and client. Disable Javascript and everything will continue to work. With Javascript enabled only the parts of pages that change will be repainted for super fast performance.</p>\n\t\t\t\t<p>Opening pages in a new window works properly as well.</p>\n\t\t\t\t<p>The size of all Javascript on this page is less than 10 kB minified, including this text.</p>\n\t\t\t\t`;\n\t\t}\n\t}\n\n\t// No 404 handler as there is a default one we are using\n};\n"
  ]
}