| 1 {"version":3,"sources":["node_modules/browserify/node_modules/browser-pack/_prel
ude.js","lib/router.js","lib/sw-toolbox.js","lib/helpers.js","lib/options.js","l
ib/strategies/index.js","lib/route.js","lib/strategies/networkOnly.js","lib/stra
tegies/networkFirst.js","lib/strategies/cacheOnly.js","lib/strategies/cacheFirst
.js","lib/strategies/fastest.js","node_modules/serviceworker-cache-polyfill/inde
x.js","node_modules/path-to-regexp/index.js","node_modules/path-to-regexp/node_m
odules/isarray/index.js"],"names":["cache","url","options","helpers","openCache"
,"then","add","uncache","precache","items","Array","isArray","preCacheItems","co
ncat","require","router","strategies","debug","self","addEventListener","event",
"inactiveCache","cacheName","join","waitUntil","Promise","all","addAll","bind","
renameCache","handler","match","request","respondWith","module","exports","netwo
rkOnly","networkFirst","cacheOnly","cacheFirst","fastest","message","flag","glob
alOptions","console","log","caches","open","fetchAndCache","successResponses","f
etch","clone","response","method","test","status","put","source","destination","
results","sourceCache","destCache","keys","requests","map","scope","registration
","URL","location","href","basePath","pathname","pathRegexp","Route","path","ind
exOf","this","regexp","prototype","makeHandler","exec","values","forEach","key",
"index","name","cacheResponse","error","rejected","reasons","maybeReject","reaso
n","push","toString","reject","Error","resolve","Cache","NetworkError","code","O
bject","create","arguments","length","TypeError","Request","String","scheme","pr
otocol","responses","i","undefined","parse","str","res","tokens","PATH_REGEXP","
m","escaped","offset","slice","prefix","capture","group","suffix","asterisk","re
peat","optional","delimiter","pattern","escapeGroup","substr","compile","tokensT
oFunction","matches","RegExp","obj","value","isarray","j","encodeURIComponent","
escapeString","replace","attachKeys","re","flags","sensitive","regexpToRegexp","
groups","arrayToRegexp","parts","pathToRegexp","stringToRegexp","tokensToRegExp"
,"strict","end","route","lastToken","endsWithSlash","token","arr","call"],"mappi
ngs":"AAAA;AEeA,YA8CA,SAASA,OAAMC,EAAKC,GAClB,MAAOC,SAAQC,UAAUF,GAASG,KAAK,SAASL
,GAC9C,MAAOA,GAAMM,IAAIL,KAIrB,QAASM,SAAQN,EAAK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AAK,SAASwG,GAGf,MAAOpF,SAAQC,IACbmF,EAAU7C,IAAI,SAASZ,
EAAU0D,GAC/B,MAAO9G,GAAMwD,IAAIO,EAAS+C,GAAI1D,QAGjC/C,KAAK,WACN,MAAO0G","file":
"bundle.js","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)r
eturn i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"M
ODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){v
ar 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})","/*\n Copyright 2014 Google Inc. All Rights Reserved.\n\n Licensed under
the Apache License, Version 2.0 (the \"License\");\n you may not use this file
except in compliance with the License.\n You may obtain a copy of the License a
t\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by ap
plicable law or agreed to in writing, software\n distributed under the License
is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.\n See the License for the specific language g
overning permissions and\n limitations under the License.\n*/\n'use strict';\n\
nvar Route = require('./route');\n\nfunction regexEscape(s) {\n return s.replac
e(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n}\n\nvar keyMatch = function(map, st
ring) {\n for (var item of map) {\n var pattern = new RegExp(item[0]), value
= item[1];\n if (pattern.test(string)) {\n return value;\n }\n }\n
return null;\n};\n\nvar Router = function() {\n this.routes = new Map();\n th
is.default = null;\n};\n\n['get', 'post', 'put', 'delete', 'head', 'any'].forEac
h(function(method) {\n Router.prototype[method] = function(path, handler, optio
ns) {\n return this.add(method, path, handler, options);\n };\n});\n\nRouter
.prototype.add = function(method, path, handler, options) {\n options = options
|| {};\n var origin = options.origin || self.location.origin;\n if (origin in
stanceof RegExp) {\n origin = origin.source;\n } else {\n origin = regexE
scape(origin);\n }\n method = method.toLowerCase();\n\n var route = new Route
(method, path, handler, options);\n\n if (!this.routes.has(origin)) {\n this
.routes.set(origin, new Map());\n }\n\n var methodMap = this.routes.get(origin
);\n if (!methodMap.has(method)) {\n methodMap.set(method, new Map());\n }\
n\n var routeMap = methodMap.get(method);\n routeMap.set(route.regexp.source,
route);\n};\n\nRouter.prototype.matchMethod = function(method, url) {\n url = n
ew URL(url);\n var origin = url.origin;\n var path = url.pathname;\n method =
method.toLowerCase();\n\n var methods = keyMatch(this.routes, origin);\n if (
!methods) {\n return null;\n }\n\n var routes = methods.get(method);\n if
(!routes) {\n return null;\n }\n\n var route = keyMatch(routes, path);\n\n
if (route) {\n return route.makeHandler(path);\n }\n\n return null;\n};\n\
nRouter.prototype.match = function(request) {\n return this.matchMethod(request
.method, request.url) || this.matchMethod('any', request.url);\n};\n\nmodule.exp
orts = new Router();\n","/*\n Copyright 2014 Google Inc. All Rights Reserved.\n
\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may
not use this file except in compliance with the License.\n You may obtain a co
py of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Un
less required by applicable law or agreed to in writing, software\n distributed
under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES O
R CONDITIONS OF ANY KIND, either express or implied.\n See the License for the
specific language governing permissions and\n limitations under the License.\n*
/\n'use strict';\n\nrequire('serviceworker-cache-polyfill');\nvar options = requ
ire('./options');\nvar router = require('./router');\nvar helpers = require('./h
elpers');\nvar strategies = require('./strategies');\n\nhelpers.debug('Service W
orker Toolbox is loading');\n\n// Install\n\nself.addEventListener('install', fu
nction(event) {\n var inactiveCache = options.cacheName + '$$$inactive$$$';\n
helpers.debug('install event fired');\n helpers.debug('creating cache [' + inac
tiveCache + ']');\n helpers.debug('preCache list: ' + (options.preCacheItems.jo
in(', ') || '(none)'));\n event.waitUntil(\n helpers.openCache({cacheName: i
nactiveCache}).then(function(cache) {\n return Promise.all(options.preCache
Items).then(cache.addAll.bind(cache));\n })\n );\n});\n\n// Activate\n\nself
.addEventListener('activate', function(event) {\n helpers.debug('activate event
fired');\n var inactiveCache = options.cacheName + '$$$inactive$$$';\n event.
waitUntil(helpers.renameCache(inactiveCache, options.cacheName));\n});\n\n// Fet
ch\n\nself.addEventListener('fetch', function(event) {\n var handler = router.m
atch(event.request);\n\n if (handler) {\n event.respondWith(handler(event.re
quest));\n } else if (router.default) {\n event.respondWith(router.default(e
vent.request));\n }\n});\n\n// Caching\n\nfunction cache(url, options) {\n ret
urn helpers.openCache(options).then(function(cache) {\n return cache.add(url)
;\n });\n}\n\nfunction uncache(url, options) {\n return helpers.openCache(opti
ons).then(function(cache) {\n return cache.delete(url);\n });\n}\n\nfunction
precache(items) {\n if (!Array.isArray(items)) {\n items = [items];\n }\n
options.preCacheItems = options.preCacheItems.concat(items);\n}\n\nmodule.expor
ts = {\n networkOnly: strategies.networkOnly,\n networkFirst: strategies.netwo
rkFirst,\n cacheOnly: strategies.cacheOnly,\n cacheFirst: strategies.cacheFirs
t,\n fastest: strategies.fastest,\n router: router,\n options: options,\n ca
che: cache,\n uncache: uncache,\n precache: precache\n};\n","/*\n Copyright 2
014 Google Inc. All Rights Reserved.\n\n Licensed under the Apache License, Ver
sion 2.0 (the \"License\");\n you may not use this file except in compliance wi
th the License.\n You may obtain a copy of the License at\n\n http://www.a
pache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed
to in writing, software\n distributed under the License is distributed on an \"
AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express o
r implied.\n See the License for the specific language governing permissions an
d\n limitations under the License.\n*/\n'use strict';\n\nvar globalOptions = re
quire('./options');\n\nfunction debug(message, options) {\n options = options |
| {};\n var flag = options.debug || globalOptions.debug;\n if (flag) {\n co
nsole.log('[sw-toolbox] ' + message);\n }\n}\n\nfunction openCache(options) {\n
options = options || {};\n var cacheName = options.cacheName || globalOptions
.cacheName;\n debug('Opening cache \"' + cacheName + '\"', options);\n return
caches.open(cacheName);\n}\n\nfunction fetchAndCache(request, options) {\n opti
ons = options || {};\n var successResponses = options.successResponses || globa
lOptions.successResponses;\n return fetch(request.clone()).then(function(respon
se) {\n\n // Only cache GET requests with successful responses\n if (reque
st.method === 'GET' && successResponses.test(response.status)) {\n openCach
e(options).then(function(cache) {\n cache.put(request, response);\n
});\n }\n\n return response.clone();\n });\n}\n\nfunction renameCache(sou
rce, destination, options) {\n debug('Renaming cache: [' + source + '] to [' +
destination + ']', options);\n return caches.delete(destination).then(function(
) {\n return Promise.all([\n caches.open(source),\n caches.open(des
tination)\n ]).then(function(results) {\n var sourceCache = results[0];\
n var destCache = results[1];\n\n return sourceCache.keys().then(funct
ion(requests) {\n return Promise.all(requests.map(function(request) {\n
return sourceCache.match(request).then(function(response) {\n
return destCache.put(request, response);\n });\n }));\n })
.then(function() {\n return caches.delete(source);\n });\n });\n
});\n}\n\nmodule.exports = {\n debug: debug,\n fetchAndCache: fetchAndCache,\
n openCache: openCache,\n renameCache: renameCache\n};\n","/*\n\tCopyright 201
4 Google Inc. All Rights Reserved.\n\n\tLicensed under the Apache License, Versi
on 2.0 (the \"License\");\n\tyou may not use this file except in compliance with
the License.\n\tYou may obtain a copy of the License at\n\n\t http://www.apa
che.org/licenses/LICENSE-2.0\n\n\tUnless required by applicable law or agreed to
in writing, software\n\tdistributed under the License is distributed on an \"AS
IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.\n\tSee the License for the specific language governing permissions and\
n\tlimitations under the License.\n*/\n'use strict';\n\n// TODO: This is necessa
ry to handle different implementations in the wild\n// The spec defines self.reg
istration, but it was not implemented in Chrome 40.\nvar scope;\nif (self.regist
ration) {\n scope = self.registration.scope;\n} else {\n scope = self.scope ||
new URL('./', self.location).href;\n}\n\nmodule.exports = {\n\tcacheName: '$$$t
oolbox-cache$$$' + scope + '$$$',\n\tdebug: false,\n\tpreCacheItems: [],\n\t// A
regular expression to apply to HTTP response codes. Codes that match\n\t// will
be considered successes, while others will not, and will not be\n\t// cached.\n
\tsuccessResponses: /^0|([123]\\d\\d)|(40[14567])|410$/,\n};\n","/*\n\tCopyright
2014 Google Inc. All Rights Reserved.\n\n\tLicensed under the Apache License, V
ersion 2.0 (the \"License\");\n\tyou may not use this file except in compliance
with the License.\n\tYou may obtain a copy of the License at\n\n\t http://www
.apache.org/licenses/LICENSE-2.0\n\n\tUnless required by applicable law or agree
d to in writing, software\n\tdistributed under the License is distributed on an
\"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied.\n\tSee the License for the specific language governing permissions
and\n\tlimitations under the License.\n*/\nmodule.exports = {\n networkOnly: re
quire('./networkOnly'),\n networkFirst: require('./networkFirst'),\n cacheOnly
: require('./cacheOnly'),\n cacheFirst: require('./cacheFirst'),\n fastest: re
quire('./fastest')\t\n};","/*\n Copyright 2014 Google Inc. All Rights Reserved.
\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you m
ay not use this file except in compliance with the License.\n You may obtain a
copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n
Unless required by applicable law or agreed to in writing, software\n distribut
ed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES
OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for th
e specific language governing permissions and\n limitations under the License.\
n*/\n'use strict';\n\n//TODO: Use self.registration.scope instead of self.locati
on\nvar url = new URL('./', self.location);\nvar basePath = url.pathname;\nvar p
athRegexp = require('path-to-regexp');\n\n\nvar Route = function(method, path, h
andler, options) {\n // The URL() constructor can't parse express-style routes
as they are not\n // valid urls. This means we have to manually manipulate rela
tive urls into\n // absolute ones. This check is extremely naive but implementi
ng a tweaked\n // version of the full algorithm seems like overkill\n // (http
s://url.spec.whatwg.org/#concept-basic-url-parser)\n if (path.indexOf('/') !==
0) {\n path = basePath + path;\n }\n\n this.method = method;\n this.keys =
[];\n this.regexp = pathRegexp(path, this.keys);\n this.options = options;\n
this.handler = handler;\n};\n\nRoute.prototype.makeHandler = function(url) {\n
var match = this.regexp.exec(url);\n var values = {};\n this.keys.forEach(fun
ction(key, index) {\n values[key.name] = match[index + 1];\n });\n return f
unction(request) {\n return this.handler(request, values, this.options);\n }
.bind(this);\n};\n\nmodule.exports = Route;\n","/*\n\tCopyright 2014 Google Inc.
All Rights Reserved.\n\n\tLicensed under the Apache License, Version 2.0 (the \
"License\");\n\tyou may not use this file except in compliance with the License.
\n\tYou may obtain a copy of the License at\n\n\t http://www.apache.org/licen
ses/LICENSE-2.0\n\n\tUnless required by applicable law or agreed to in writing,
software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\
n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tS
ee the License for the specific language governing permissions and\n\tlimitation
s under the License.\n*/\n'use strict';\nvar helpers = require('../helpers');\n\
nfunction networkOnly(request, values, options) {\n helpers.debug('Strategy: ne
twork only [' + request.url + ']', options);\n return fetch(request);\n}\n\nmod
ule.exports = networkOnly;","/*\n Copyright 2014 Google Inc. All Rights Reserve
d.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you
may not use this file except in compliance with the License.\n You may obtain
a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n
Unless required by applicable law or agreed to in writing, software\n distrib
uted under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTI
ES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for
the specific language governing permissions and\n limitations under the License
.\n*/\n'use strict';\nvar globalOptions = require('../options');\nvar helpers =
require('../helpers');\n\nfunction networkFirst(request, values, options) {\n o
ptions = options || {};\n var successResponses = options.successResponses || gl
obalOptions.successResponses;\n helpers.debug('Strategy: network first [' + req
uest.url + ']', options);\n return helpers.openCache(options).then(function(cac
he) {\n return helpers.fetchAndCache(request, options).then(function(response
) {\n if (successResponses.test(response.status)) {\n return respons
e;\n }\n\n return cache.match(request).then(function(cacheResponse) {\
n helpers.debug('Response was an HTTP error', options);\n if (cach
eResponse) {\n helpers.debug('Resolving with cached response instead',
options);\n return cacheResponse;\n } else {\n // If we
didn't have anything in the cache, it's better to return the\n // erro
r page than to return nothing\n helpers.debug('No cached result, resolv
ing with HTTP error response from network', options);\n return response
;\n }\n });\n }).catch(function(error) {\n helpers.debug('Ne
twork error, fallback to cache [' + request.url + ']', options);\n return c
ache.match(request);\n });\n });\n}\n\nmodule.exports = networkFirst;","/*\n
\tCopyright 2014 Google Inc. All Rights Reserved.\n\n\tLicensed under the Apache
License, Version 2.0 (the \"License\");\n\tyou may not use this file except in
compliance with the License.\n\tYou may obtain a copy of the License at\n\n\t
http://www.apache.org/licenses/LICENSE-2.0\n\n\tUnless required by applicable l
aw or agreed to in writing, software\n\tdistributed under the License is distrib
uted on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eit
her express or implied.\n\tSee the License for the specific language governing p
ermissions and\n\tlimitations under the License.\n*/\n'use strict';\nvar helpers
= require('../helpers');\n\nfunction cacheOnly(request, values, options) {\n h
elpers.debug('Strategy: cache only [' + request.url + ']', options);\n return h
elpers.openCache(options).then(function(cache) {\n return cache.match(request
);\n });\n}\n\nmodule.exports = cacheOnly;\n","/*\n\tCopyright 2014 Google Inc.
All Rights Reserved.\n\n\tLicensed under the Apache License, Version 2.0 (the \
"License\");\n\tyou may not use this file except in compliance with the License.
\n\tYou may obtain a copy of the License at\n\n\t http://www.apache.org/licen
ses/LICENSE-2.0\n\n\tUnless required by applicable law or agreed to in writing,
software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\
n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tS
ee the License for the specific language governing permissions and\n\tlimitation
s under the License.\n*/\n'use strict';\nvar helpers = require('../helpers');\n\
nfunction cacheFirst(request, values, options) {\n helpers.debug('Strategy: cac
he first [' + request.url + ']', options);\n return helpers.openCache(options).
then(function(cache) {\n return cache.match(request).then(function (response)
{\n if (response) {\n return response;\n }\n\n return hel
pers.fetchAndCache(request, options);\n });\n });\n}\n\nmodule.exports = cac
heFirst;","/*\n Copyright 2014 Google Inc. All Rights Reserved.\n\n Licensed u
nder the Apache License, Version 2.0 (the \"License\");\n you may not use this
file except in compliance with the License.\n You may obtain a copy of the Lice
nse at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required
by applicable law or agreed to in writing, software\n distributed under the Lic
ense is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS O
F ANY KIND, either express or implied.\n See the License for the specific langu
age governing permissions and\n limitations under the License.\n*/\n'use strict
';\nvar helpers = require('../helpers');\nvar cacheOnly = require('./cacheOnly')
;\n\nfunction fastest(request, values, options) {\n helpers.debug('Strategy: fa
stest [' + request.url + ']', options);\n var rejected = false;\n var reasons
= [];\n\n var maybeReject = function(reason) {\n reasons.push(reason.toStrin
g());\n if (rejected) {\n return Promise.reject(new Error('Both cache an
d network failed: \"' + reasons.join('\", \"') + '\"'));\n }\n rejected =
true;\n };\n\n return new Promise(function(resolve, reject) {\n helpers.fet
chAndCache(request.clone(), options).then(resolve, maybeReject);\n cacheOnly(
request, options).then(resolve, maybeReject);\n });\n}\n\nmodule.exports = fast
est;","if (!Cache.prototype.add) {\n Cache.prototype.add = function add(request
) {\n return this.addAll([request]);\n };\n}\n\nif (!Cache.prototype.addAll)
{\n Cache.prototype.addAll = function addAll(requests) {\n var cache = this
;\n\n // Since DOMExceptions are not constructable:\n function NetworkErro
r(message) {\n this.name = 'NetworkError';\n this.code = 19;\n th
is.message = message;\n }\n NetworkError.prototype = Object.create(Error.p
rototype);\n\n return Promise.resolve().then(function() {\n if (argument
s.length < 1) throw new TypeError();\n \n // Simulate sequence<(Reques
t or USVString)> binding:\n var sequence = [];\n\n requests = requests
.map(function(request) {\n if (request instanceof Request) {\n r
eturn request;\n }\n else {\n return String(request); //
may throw TypeError\n }\n });\n\n return Promise.all(\n
requests.map(function(request) {\n if (typeof request === 'string') {\n
request = new Request(request);\n }\n\n var scheme
= new URL(request.url).protocol;\n\n if (scheme !== 'http:' && scheme
!== 'https:') {\n throw new NetworkError(\"Invalid scheme\");\n
}\n\n return fetch(request.clone());\n })\n );\n }).
then(function(responses) {\n // TODO: check that requests don't overwrite o
ne another\n // (don't think this is possible to polyfill due to opaque res
ponses)\n return Promise.all(\n responses.map(function(response, i)
{\n return cache.put(requests[i], response);\n })\n );\n
}).then(function() {\n return undefined;\n });\n };\n}\n","var isarray
= require('isarray')\n\n/**\n * Expose `pathToRegexp`.\n */\nmodule.exports = p
athToRegexp\nmodule.exports.parse = parse\nmodule.exports.compile = compile\nmod
ule.exports.tokensToFunction = tokensToFunction\nmodule.exports.tokensToRegExp =
tokensToRegExp\n\n/**\n * The main path matching regexp utility.\n *\n * @type
{RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n // Match escaped characters tha
t would otherwise appear in future matches.\n // This allows the user to escape
special characters that won't transform.\n '(\\\\\\\\.)',\n // Match Express-
style parameters and un-named parameters with a prefix\n // and optional suffix
es. Matches appear as:\n //\n // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\
d+\", undefined, \"?\", undefined]\n // \"/route(\\\\d+)\" => [undefined, unde
fined, undefined, \"\\d+\", undefined, undefined]\n // \"/*\" => [\"
/\", undefined, undefined, undefined, undefined, \"*\"]\n '([\\\\/.])?(?:(?:\\\
\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^()])+)\\\\)
)([+*?])?|(\\\\*))'\n].join('|'), 'g')\n\n/**\n * Parse a string for the raw tok
ens.\n *\n * @param {String} str\n * @return {Array}\n */\nfunction parse (str)
{\n var tokens = []\n var key = 0\n var index = 0\n var path = ''\n var re
s\n\n while ((res = PATH_REGEXP.exec(str)) != null) {\n var m = res[0]\n
var escaped = res[1]\n var offset = res.index\n path += str.slice(index, o
ffset)\n index = offset + m.length\n\n // Ignore already escaped sequences
.\n if (escaped) {\n path += escaped[1]\n continue\n }\n\n //
Push the current path onto the tokens.\n if (path) {\n tokens.push(path
)\n path = ''\n }\n\n var prefix = res[2]\n var name = res[3]\n
var capture = res[4]\n var group = res[5]\n var suffix = res[6]\n var
asterisk = res[7]\n\n var repeat = suffix === '+' || suffix === '*'\n var
optional = suffix === '?' || suffix === '*'\n var delimiter = prefix || '/'\n
var pattern = capture || group || (asterisk ? '.*' : '[^' + delimiter + ']+?
')\n\n tokens.push({\n name: name || key++,\n prefix: prefix || '',
\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\
n pattern: escapeGroup(pattern)\n })\n }\n\n // Match any characters s
till remaining.\n if (index < str.length) {\n path += str.substr(index)\n }
\n\n // If the path exists, push it onto the end.\n if (path) {\n tokens.pu
sh(path)\n }\n\n return tokens\n}\n\n/**\n * Compile a string to a template fu
nction for the path.\n *\n * @param {String} str\n * @return {Function}\n */\
nfunction compile (str) {\n return tokensToFunction(parse(str))\n}\n\n/**\n * E
xpose a method for transforming tokens into the path function.\n */\nfunction to
kensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matc
hes = new Array(tokens.length)\n\n // Compile all the patterns before compilati
on.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === '
object') {\n matches[i] = new RegExp('^' + tokens[i].pattern + '$')\n }\
n }\n\n return function (obj) {\n var path = ''\n\n obj = obj || {}\n\n
for (var i = 0; i < tokens.length; i++) {\n var key = tokens[i]\n\n
if (typeof key === 'string') {\n path += key\n\n continue\n
}\n\n var value = obj[key.name]\n\n if (value == null) {\n if (
key.optional) {\n continue\n } else {\n throw new TypeE
rror('Expected \"' + key.name + '\" to be defined')\n }\n }\n\n
if (isarray(value)) {\n if (!key.repeat) {\n throw new TypeErro
r('Expected \"' + key.name + '\" to not repeat')\n }\n\n if (value
.length === 0) {\n if (key.optional) {\n continue\n
} else {\n throw new TypeError('Expected \"' + key.name + '\" to not
be empty')\n }\n }\n\n for (var j = 0; j < value.length;
j++) {\n if (!matches[i].test(value[j])) {\n throw new Type
Error('Expected all \"' + key.name + '\" to match \"' + key.pattern + '\"')\n
}\n\n path += (j === 0 ? key.prefix : key.delimiter) + encodeURI
Component(value[j])\n }\n\n continue\n }\n\n if (!matche
s[i].test(value)) {\n throw new TypeError('Expected \"' + key.name + '\"
to match \"' + key.pattern + '\"')\n }\n\n path += key.prefix + encode
URIComponent(value)\n }\n\n return path\n }\n}\n\n/**\n * Escape a regula
r expression string.\n *\n * @param {String} str\n * @return {String}\n */\nfun
ction escapeString (str) {\n return str.replace(/([.+*?=^!:${}()[\\]|\\/])/g, '
\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters
and meaning.\n *\n * @param {String} group\n * @return {String}\n */\nfunction
escapeGroup (group) {\n return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\
n/**\n * Attach the keys as a property of the regexp.\n *\n * @param {RegExp} r
e\n * @param {Array} keys\n * @return {RegExp}\n */\nfunction attachKeys (re,
keys) {\n re.keys = keys\n return re\n}\n\n/**\n * Get the flags for a regexp
from the options.\n *\n * @param {Object} options\n * @return {String}\n */\nfu
nction flags (options) {\n return options.sensitive ? '' : 'i'\n}\n\n/**\n * Pu
ll out keys from a regexp.\n *\n * @param {RegExp} path\n * @param {Array} ke
ys\n * @return {RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n // Use a
negative lookahead to match only capturing groups.\n var groups = path.source.
match(/\\((?!\\?)/g)\n\n if (groups) {\n for (var i = 0; i < groups.length;
i++) {\n keys.push({\n name: i,\n prefix: null,\n deli
miter: null,\n optional: false,\n repeat: false,\n pattern:
null\n })\n }\n }\n\n return attachKeys(path, keys)\n}\n\n/**\n * Tra
nsform an array into a regexp.\n *\n * @param {Array} path\n * @param {Array}
keys\n * @param {Object} options\n * @return {RegExp}\n */\nfunction arrayToR
egexp (path, keys, options) {\n var parts = []\n\n for (var i = 0; i < path.le
ngth; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source)\n }\n
\n var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))\n\n
return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string i
nput.\n *\n * @param {String} path\n * @param {Array} keys\n * @param {Objec
t} options\n * @return {RegExp}\n */\nfunction stringToRegexp (path, keys, optio
ns) {\n var tokens = parse(path)\n var re = tokensToRegExp(tokens, options)\n\
n // Attach keys back to the regexp.\n for (var i = 0; i < tokens.length; i++)
{\n if (typeof tokens[i] !== 'string') {\n keys.push(tokens[i])\n }\
n }\n\n return attachKeys(re, keys)\n}\n\n/**\n * Expose a function for taking
tokens and returning a RegExp.\n *\n * @param {Array} tokens\n * @param {Arr
ay} keys\n * @param {Object} options\n * @return {RegExp}\n */\nfunction token
sToRegExp (tokens, options) {\n options = options || {}\n\n var strict = optio
ns.strict\n var end = options.end !== false\n var route = ''\n var lastToken
= tokens[tokens.length - 1]\n var endsWithSlash = typeof lastToken === 'string'
&& /\\/$/.test(lastToken)\n\n // Iterate over the tokens and create our regexp
string.\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]
\n\n if (typeof token === 'string') {\n route += escapeString(token)\n
} else {\n var prefix = escapeString(token.prefix)\n var capture = t
oken.pattern\n\n if (token.repeat) {\n capture += '(?:' + prefix + c
apture + ')*'\n }\n\n if (token.optional) {\n if (prefix) {\n
capture = '(?:' + prefix + '(' + capture + '))?'\n } else {\n
capture = '(' + capture + ')?'\n }\n } else {\n capture
= prefix + '(' + capture + ')'\n }\n\n route += capture\n }\n }\n
\n // In non-strict mode we allow a slash at the end of match. If the path to\n
// match already ends with a slash, we remove it for consistency. The slash\n
// is valid at the end of a path match, not in the middle. This is important\n
// in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n if
(!strict) {\n route = (endsWithSlash ? route.slice(0, -2) : route) + '(?:\\\
\/(?=$))?'\n }\n\n if (end) {\n route += '$'\n } else {\n // In non-end
ing mode, we need the capturing groups to match as much as\n // possible by u
sing a positive lookahead to the end or next path segment.\n route += strict
&& endsWithSlash ? '' : '(?=\\\\/|$)'\n }\n\n return new RegExp('^' + route, f
lags(options))\n}\n\n/**\n * Normalize the given path string, returning a regula
r expression.\n *\n * An empty array can be passed in for the keys, which will h
old the\n * placeholder key descriptions. For example, using `/user/:id`, `keys`
will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false
}]`.\n *\n * @param {(String|RegExp|Array)} path\n * @param {Array}
[keys]\n * @param {Object} [options]\n * @return {RegExp}
\n */\nfunction pathToRegexp (path, keys, options) {\n keys = keys || []\n\n i
f (!isarray(keys)) {\n options = keys\n keys = []\n } else if (!options)
{\n options = {}\n }\n\n if (path instanceof RegExp) {\n return regexpTo
Regexp(path, keys, options)\n }\n\n if (isarray(path)) {\n return arrayToRe
gexp(path, keys, options)\n }\n\n return stringToRegexp(path, keys, options)\n
}\n","module.exports = Array.isArray || function (arr) {\n return Object.protot
ype.toString.call(arr) == '[object Array]';\n};\n"]} |