diff --git a/architecture-examples/polymer/bower_components/director/.bower.json b/architecture-examples/polymer/bower_components/director/.bower.json deleted file mode 100644 index 6a6f639f7c..0000000000 --- a/architecture-examples/polymer/bower_components/director/.bower.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "director", - "homepage": "https://github.com/flatiron/director", - "version": "1.2.0", - "_release": "1.2.0", - "_resolution": { - "type": "version", - "tag": "v1.2.0", - "commit": "538dee97b0d57163d682a397de674f36af4d16a1" - }, - "_source": "git://github.com/flatiron/director.git", - "_target": "*" -} \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/.gitignore b/architecture-examples/polymer/bower_components/director/.gitignore deleted file mode 100644 index ff1a80c4eb..0000000000 --- a/architecture-examples/polymer/bower_components/director/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/.idea/ -node_modules -npm-debug.log -.DS_Store - -/test/browser/browserified-bundle.js diff --git a/architecture-examples/polymer/bower_components/director/.travis.yml b/architecture-examples/polymer/bower_components/director/.travis.yml deleted file mode 100644 index 2f3b02ef69..0000000000 --- a/architecture-examples/polymer/bower_components/director/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js - -node_js: - - 0.6 - - 0.8 - - "0.10" - -notifications: - email: - - travis@nodejitsu.com - irc: "irc.freenode.org#nodejitsu" - diff --git a/architecture-examples/polymer/bower_components/director/LICENSE b/architecture-examples/polymer/bower_components/director/LICENSE deleted file mode 100644 index 1f01e2b36c..0000000000 --- a/architecture-examples/polymer/bower_components/director/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Nodejitsu Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/README.md b/architecture-examples/polymer/bower_components/director/README.md deleted file mode 100644 index 522d146c47..0000000000 --- a/architecture-examples/polymer/bower_components/director/README.md +++ /dev/null @@ -1,822 +0,0 @@ - - -# Synopsis -Director is a router. Routing is the process of determining what code to run when a URL is requested. - -# Motivation -A routing library that works in both the browser and node.js environments with as few differences as possible. Simplifies the development of Single Page Apps and Node.js applications. Dependency free (doesn't require jQuery or Express, etc). - -# Status -[![Build Status](https://secure.travis-ci.org/flatiron/director.png?branch=master)](http://travis-ci.org/flatiron/director) - -# Features -* [Client-Side Routing](#client-side) -* [Server-Side HTTP Routing](#http-routing) -* [Server-Side CLI Routing](#cli-routing) - - -# Usage -* [API Documentation](#api-documentation) -* [Frequently Asked Questions](#faq) - - -## Client-side Routing -It simply watches the hash of the URL to determine what to do, for example: - -``` -http://foo.com/#/bar -``` - -Client-side routing (aka hash-routing) allows you to specify some information about the state of the application using the URL. So that when the user visits a specific URL, the application can be transformed accordingly. - - - -Here is a simple example: - -```html - - - - - A Gentle Introduction - - - - - - - -``` - -Director works great with your favorite DOM library, such as jQuery. - -```html - - - - - A Gentle Introduction 2 - - - - - -
Author Name
-
Book1, Book2, Book3
- - - -``` - -You can find a browser-specific build of `director` [here][1] which has all of the server code stripped away. - - -## Server-Side HTTP Routing - -Director handles routing for HTTP requests similar to `journey` or `express`: - -```js - // - // require the native http module, as well as director. - // - var http = require('http'), - director = require('director'); - - // - // create some logic to be routed to. - // - function helloWorld() { - this.res.writeHead(200, { 'Content-Type': 'text/plain' }) - this.res.end('hello world'); - } - - // - // define a routing table. - // - var router = new director.http.Router({ - '/hello': { - get: helloWorld - } - }); - - // - // setup a server and when there is a request, dispatch the - // route that was requested in the request object. - // - var server = http.createServer(function (req, res) { - router.dispatch(req, res, function (err) { - if (err) { - res.writeHead(404); - res.end(); - } - }); - }); - - // - // You can also do ad-hoc routing, similar to `journey` or `express`. - // This can be done with a string or a regexp. - // - router.get('/bonjour', helloWorld); - router.get(/hola/, helloWorld); - - // - // set the server to listen on port `8080`. - // - server.listen(8080); -``` - -### See Also: - - - Auto-generated Node.js API Clients for routers using [Director-Reflector](http://github.com/flatiron/director-reflector) - - RESTful Resource routing using [restful](http://github.com/flatiron/restful) - - HTML / Plain Text views of routers using [Director-Explorer](http://github.com/flatiron/director-explorer) - - -## CLI Routing - -Director supports Command Line Interface routing. Routes for cli options are based on command line input (i.e. `process.argv`) instead of a URL. - -``` js - var director = require('director'); - - var router = new director.cli.Router(); - - router.on('create', function () { - console.log('create something'); - }); - - router.on(/destroy/, function () { - console.log('destroy something'); - }); - - // You will need to dispatch the cli arguments yourself - router.dispatch('on', process.argv.slice(2).join(' ')); -``` - -Using the cli router, you can dispatch commands by passing them as a string. For example, if this example is in a file called `foo.js`: - -``` bash -$ node foo.js create -create something -$ node foo.js destroy -destroy something -``` - - -# API Documentation - -* [Constructor](#constructor) -* [Routing Table](#routing-table) -* [Adhoc Routing](#adhoc-routing) -* [Scoped Routing](#scoped-routing) -* [Routing Events](#routing-events) -* [Configuration](#configuration) -* [URL Matching](#url-matching) -* [URL Params](#url-params) -* [Route Recursion](#route-recursion) -* [Async Routing](#async-routing) -* [Resources](#resources) -* [History API](#history-api) -* [Instance Methods](#instance-methods) -* [Attach Properties to `this`](#attach-to-this) -* [HTTP Streaming and Body Parsing](#http-streaming-body-parsing) - - -## Constructor - -``` js - var router = Router(routes); -``` - - -## Routing Table - -An object literal that contains nested route definitions. A potentially nested set of key/value pairs. The keys in the object literal represent each potential part of the URL. The values in the object literal contain references to the functions that should be associated with them. *bark* and *meow* are two functions that you have defined in your code. - -``` js - // - // Assign routes to an object literal. - // - var routes = { - // - // a route which assigns the function `bark`. - // - '/dog': bark, - // - // a route which assigns the functions `meow` and `scratch`. - // - '/cat': [meow, scratch] - }; - - // - // Instantiate the router. - // - var router = Router(routes); -``` - - -## Adhoc Routing - -When developing large client-side or server-side applications it is not always possible to define routes in one location. Usually individual decoupled components register their own routes with the application router. We refer to this as _Adhoc Routing._ Lets take a look at the API `director` exposes for adhoc routing: - -**Client-side Routing** - -``` js - var router = new Router().init(); - - router.on('/some/resource', function () { - // - // Do something on `/#/some/resource` - // - }); -``` - -**HTTP Routing** - -``` js - var router = new director.http.Router(); - - router.get(/\/some\/resource/, function () { - // - // Do something on an GET to `/some/resource` - // - }); -``` - - -## Scoped Routing - -In large web appliations, both [Client-side](#client-side) and [Server-side](#http-routing), routes are often scoped within a few individual resources. Director exposes a simple way to do this for [Adhoc Routing](#adhoc-routing) scenarios: - -``` js - var router = new director.http.Router(); - - // - // Create routes inside the `/users` scope. - // - router.path(/\/users\/(\w+)/, function () { - // - // The `this` context of the function passed to `.path()` - // is the Router itself. - // - - this.post(function (id) { - // - // Create the user with the specified `id`. - // - }); - - this.get(function (id) { - // - // Retreive the user with the specified `id`. - // - }); - - this.get(/\/friends/, function (id) { - // - // Get the friends for the user with the specified `id`. - // - }); - }); -``` - - -## Routing Events - -In `director`, a "routing event" is a named property in the [Routing Table](#routing-table) which can be assigned to a function or an Array of functions to be called when a route is matched in a call to `router.dispatch()`. - -* **on:** A function or Array of functions to execute when the route is matched. -* **before:** A function or Array of functions to execute before calling the `on` method(s). - -**Client-side only** - -* **after:** A function or Array of functions to execute when leaving a particular route. -* **once:** A function or Array of functions to execute only once for a particular route. - - -## Configuration - -Given the flexible nature of `director` there are several options available for both the [Client-side](#client-side) and [Server-side](#http-routing). These options can be set using the `.configure()` method: - -``` js - var router = new director.Router(routes).configure(options); -``` - -The `options` are: - -* **recurse:** Controls [route recursion](#route-recursion). Use `forward`, `backward`, or `false`. Default is `false` Client-side, and `backward` Server-side. -* **strict:** If set to `false`, then trailing slashes (or other delimiters) are allowed in routes. Default is `true`. -* **async:** Controls [async routing](#async-routing). Use `true` or `false`. Default is `false`. -* **delimiter:** Character separator between route fragments. Default is `/`. -* **notfound:** A function to call if no route is found on a call to `router.dispatch()`. -* **on:** A function (or list of functions) to call on every call to `router.dispatch()` when a route is found. -* **before:** A function (or list of functions) to call before every call to `router.dispatch()` when a route is found. - -**Client-side only** - -* **resource:** An object to which string-based routes will be bound. This can be especially useful for late-binding to route functions (such as async client-side requires). -* **after:** A function (or list of functions) to call when a given route is no longer the active route. -* **html5history:** If set to `true` and client supports `pushState()`, then uses HTML5 History API instead of hash fragments. See [History API](#history-api) for more information. -* **run_handler_in_init:** If `html5history` is enabled, the route handler by default is executed upon `Router.init()` since with real URIs the router can not know if it should call a route handler or not. Setting this to `false` disables the route handler initial execution. - - -## URL Matching - -``` js - var router = Router({ - // - // given the route '/dog/yella'. - // - '/dog': { - '/:color': { - // - // this function will return the value 'yella'. - // - on: function (color) { console.log(color) } - } - } - }); -``` - -Routes can sometimes become very complex, `simple/:tokens` don't always suffice. Director supports regular expressions inside the route names. The values captured from the regular expressions are passed to your listener function. - -``` js - var router = Router({ - // - // given the route '/hello/world'. - // - '/hello': { - '/(\\w+)': { - // - // this function will return the value 'world'. - // - on: function (who) { console.log(who) } - } - } - }); -``` - -``` js - var router = Router({ - // - // given the route '/hello/world/johny/appleseed'. - // - '/hello': { - '/world/?([^\/]*)\/([^\/]*)/?': function (a, b) { - console.log(a, b); - } - } - }); -``` - - -## URL Parameters - -When you are using the same route fragments it is more descriptive to define these fragments by name and then use them in your [Routing Table](#routing-table) or [Adhoc Routes](#adhoc-routing). Consider a simple example where a `userId` is used repeatedly. - -``` js - // - // Create a router. This could also be director.cli.Router() or - // director.http.Router(). - // - var router = new director.Router(); - - // - // A route could be defined using the `userId` explicitly. - // - router.on(/([\w-_]+)/, function (userId) { }); - - // - // Define a shorthand for this fragment called `userId`. - // - router.param('userId', /([\\w\\-]+)/); - - // - // Now multiple routes can be defined with the same - // regular expression. - // - router.on('/anything/:userId', function (userId) { }); - router.on('/something-else/:userId', function (userId) { }); -``` - - -## Route Recursion - -Can be assigned the value of `forward` or `backward`. The recurse option will determine the order in which to fire the listeners that are associated with your routes. If this option is NOT specified or set to null, then only the listeners associated with an exact match will be fired. - -### No recursion, with the URL /dog/angry - -``` js - var routes = { - '/dog': { - '/angry': { - // - // Only this method will be fired. - // - on: growl - }, - on: bark - } - }; - - var router = Router(routes); -``` - -### Recursion set to `backward`, with the URL /dog/angry - -``` js - var routes = { - '/dog': { - '/angry': { - // - // This method will be fired first. - // - on: growl - }, - // - // This method will be fired second. - // - on: bark - } - }; - - var router = Router(routes).configure({ recurse: 'backward' }); -``` - -### Recursion set to `forward`, with the URL /dog/angry - -``` js - var routes = { - '/dog': { - '/angry': { - // - // This method will be fired second. - // - on: growl - }, - // - // This method will be fired first. - // - on: bark - } - }; - - var router = Router(routes).configure({ recurse: 'forward' }); -``` - -### Breaking out of recursion, with the URL /dog/angry - -``` js - var routes = { - '/dog': { - '/angry': { - // - // This method will be fired first. - // - on: function() { return false; } - }, - // - // This method will not be fired. - // - on: bark - } - }; - - // - // This feature works in reverse with recursion set to true. - // - var router = Router(routes).configure({ recurse: 'backward' }); -``` - - -## Async Routing - -Before diving into how Director exposes async routing, you should understand [Route Recursion](#route-recursion). At it's core route recursion is about evaluating a series of functions gathered when traversing the [Routing Table](#routing-table). - -Normally this series of functions is evaluated synchronously. In async routing, these functions are evaluated asynchronously. Async routing can be extremely useful both on the client-side and the server-side: - -* **Client-side:** To ensure an animation or other async operations (such as HTTP requests for authentication) have completed before continuing evaluation of a route. -* **Server-side:** To ensure arbitrary async operations (such as performing authentication) have completed before continuing the evaluation of a route. - -The method signatures for route functions in synchronous and asynchronous evaluation are different: async route functions take an additional `next()` callback. - -### Synchronous route functions - -``` js - var router = new director.Router(); - - router.on('/:foo/:bar/:bazz', function (foo, bar, bazz) { - // - // Do something asynchronous with `foo`, `bar`, and `bazz`. - // - }); -``` - -### Asynchronous route functions - -``` js - var router = new director.http.Router().configure({ async: true }); - - router.on('/:foo/:bar/:bazz', function (foo, bar, bazz, next) { - // - // Go do something async, and determine that routing should stop - // - next(false); - }); -``` - - -## Resources - -**Available on the Client-side only.** An object literal containing functions. If a host object is specified, your route definitions can provide string literals that represent the function names inside the host object. A host object can provide the means for better encapsulation and design. - -``` js - - var router = Router({ - - '/hello': { - '/usa': 'americas', - '/china': 'asia' - } - - }).configure({ resource: container }).init(); - - var container = { - americas: function() { return true; }, - china: function() { return true; } - }; - -``` - - -## History API - -**Available on the Client-side only.** Director supports using HTML5 History API instead of hash fragments for navigation. To use the API, pass `{html5history: true}` to `configure()`. Use of the API is enabled only if the client supports `pushState()`. - -Using the API gives you cleaner URIs but they come with a cost. Unlike with hash fragments your route URIs must exist. When the client enters a page, say http://foo.com/bar/baz, the web server must respond with something meaningful. Usually this means that your web server checks the URI points to something that, in a sense, exists, and then serves the client the JavaScript application. - -If you're after a single-page application you can not use plain old `` tags for navigation anymore. When such link is clicked, web browsers try to ask for the resource from server which is not of course desired for a single-page application. Instead you need to use e.g. click handlers and call the `setRoute()` method yourself. - - -## Attach Properties To `this` - -Generally, the `this` object bound to route handlers, will contain the request in `this.req` and the response in `this.res`. One may attach additional properties to `this` with the `router.attach` method: - -```js - var director = require('director'); - - var router = new director.http.Router().configure(options); - - // - // Attach properties to `this` - // - router.attach(function () { - this.data = [1,2,3]; - }); - - // - // Access properties attached to `this` in your routes! - // - router.get('/hello', function () { - this.res.writeHead(200, { 'content-type': 'text/plain' }); - - // - // Response will be `[1,2,3]`! - // - this.res.end(this.data); - }); -``` - -This API may be used to attach convenience methods to the `this` context of route handlers. - - -## HTTP Streaming and Body Parsing - -When you are performing HTTP routing there are two common scenarios: - -* Buffer the request body and parse it according to the `Content-Type` header (usually `application/json` or `application/x-www-form-urlencoded`). -* Stream the request body by manually calling `.pipe` or listening to the `data` and `end` events. - -By default `director.http.Router()` will attempt to parse either the `.chunks` or `.body` properties set on the request parameter passed to `router.dispatch(request, response, callback)`. The router instance will also wait for the `end` event before firing any routes. - -**Default Behavior** - -``` js - var director = require('director'); - - var router = new director.http.Router(); - - router.get('/', function () { - // - // This will not work, because all of the data - // events and the end event have already fired. - // - this.req.on('data', function (chunk) { - console.log(chunk) - }); - }); -``` - -In [flatiron][2], `director` is used in conjunction with [union][3] which uses a `BufferedStream` proxy to the raw `http.Request` instance. [union][3] will set the `req.chunks` property for you and director will automatically parse the body. If you wish to perform this buffering yourself directly with `director` you can use a simple request handler in your http server: - -``` js - var http = require('http'), - director = require('director'); - - var router = new director.http.Router(); - - var server = http.createServer(function (req, res) { - req.chunks = []; - req.on('data', function (chunk) { - req.chunks.push(chunk.toString()); - }); - - router.dispatch(req, res, function (err) { - if (err) { - res.writeHead(404); - res.end(); - } - - console.log('Served ' + req.url); - }); - }); - - router.post('/', function () { - this.res.writeHead(200, { 'Content-Type': 'application/json' }) - this.res.end(JSON.stringify(this.req.body)); - }); -``` - -**Streaming Support** - -If you wish to get access to the request stream before the `end` event is fired, you can pass the `{ stream: true }` options to the route. - -``` js - var director = require('director'); - - var router = new director.http.Router(); - - router.get('/', { stream: true }, function () { - // - // This will work because the route handler is invoked - // immediately without waiting for the `end` event. - // - this.req.on('data', function (chunk) { - console.log(chunk); - }); - }); -``` - - -## Instance methods - -### configure(options) -* `options` {Object}: Options to configure this instance with. - -Configures the Router instance with the specified `options`. See [Configuration](#configuration) for more documentation. - -### param(token, matcher) -* token {string}: Named parameter token to set to the specified `matcher` -* matcher {string|Regexp}: Matcher for the specified `token`. - -Adds a route fragment for the given string `token` to the specified regex `matcher` to this Router instance. See [URL Parameters](#url-params) for more documentation. - -### on(method, path, route) -* `method` {string}: Method to insert within the Routing Table (e.g. `on`, `get`, etc.). -* `path` {string}: Path within the Routing Table to set the `route` to. -* `route` {function|Array}: Route handler to invoke for the `method` and `path`. - -Adds the `route` handler for the specified `method` and `path` within the [Routing Table](#routing-table). - -### path(path, routesFn) -* `path` {string|Regexp}: Scope within the Routing Table to invoke the `routesFn` within. -* `routesFn` {function}: Adhoc Routing function with calls to `this.on()`, `this.get()` etc. - -Invokes the `routesFn` within the scope of the specified `path` for this Router instance. - -### dispatch(method, path[, callback]) -* method {string}: Method to invoke handlers for within the Routing Table -* path {string}: Path within the Routing Table to match -* callback {function}: Invoked once all route handlers have been called. - -Dispatches the route handlers matched within the [Routing Table](#routing-table) for this instance for the specified `method` and `path`. - -### mount(routes, path) -* routes {object}: Partial routing table to insert into this instance. -* path {string|Regexp}: Path within the Routing Table to insert the `routes` into. - -Inserts the partial [Routing Table](#routing-table), `routes`, into the Routing Table for this Router instance at the specified `path`. - -## Instance methods (Client-side only) - -### init([redirect]) -* `redirect` {String}: This value will be used if '/#/' is not found in the URL. (e.g., init('/') will resolve to '/#/', init('foo') will resolve to '/#foo'). - -Initialize the router, start listening for changes to the URL. - -### getRoute([index]) -* `index` {Number}: The hash value is divided by forward slashes, each section then has an index, if this is provided, only that section of the route will be returned. - -Returns the entire route or just a section of it. - -### setRoute(route) -* `route` {String}: Supply a route value, such as `home/stats`. - -Set the current route. - -### setRoute(start, length) -* `start` {Number} - The position at which to start removing items. -* `length` {Number} - The number of items to remove from the route. - -Remove a segment from the current route. - -### setRoute(index, value) -* `index` {Number} - The hash value is divided by forward slashes, each section then has an index. -* `value` {String} - The new value to assign the the position indicated by the first parameter. - -Set a segment of the current route. - - -# Frequently Asked Questions - -## What About SEO? - -Is using a Client-side router a problem for SEO? Yes. If advertising is a requirement, you are probably building a "Web Page" and not a "Web Application". Director on the client is meant for script-heavy Web Applications. - -# Licence - -(The MIT License) - -Copyright (c) 2010 Nodejitsu Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -[0]: http://github.com/flatiron/director -[1]: https://github.com/flatiron/director/blob/master/build/director.min.js -[2]: http://github.com/flatiron/flatiron -[3]: http://github.com/flatiron/union diff --git a/architecture-examples/polymer/bower_components/director/bin/build b/architecture-examples/polymer/bower_components/director/bin/build deleted file mode 100755 index 23e8ecff77..0000000000 --- a/architecture-examples/polymer/bower_components/director/bin/build +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env node - -var Codesurgeon = require('codesurgeon').Codesurgeon; -var surgeon = new Codesurgeon; - -var path = require('path'); - -var root = path.join(__dirname, '..'); -var lib = path.join(root, 'lib', 'director'); - -// -// Distill and package the browser version. -// -surgeon - // - .configure({ - package: root + '/package.json', - owner: 'Nodejitsu, Inc (Using Codesurgeon).', - noVersion: true - }) - .read( - path.join(lib, 'browser.js') - ) - // - // we want everything so far. specify extract with no - // parameters to get everything into the output buffer. - // - .extract() - // - // clear the input so far, but don't clear the output. - // - .clear('inputs') - // - // read the `router.js` file - // - .read( - path.join(lib, 'router.js') - ) - // - // the current input buffer contains stuff that we dont - // want in the browser build, so let's cherry pick from - // the buffer. - // - .extract( - '_every', - '_flatten', - '_asyncEverySeries', - 'paramifyString', - 'regifyString', - 'terminator', - 'Router.prototype.configure', - 'Router.prototype.param', - 'Router.prototype.on', - 'Router.prototype.dispatch', - 'Router.prototype.invoke', - 'Router.prototype.traverse', - 'Router.prototype.insert', - 'Router.prototype.insertEx', - 'Router.prototype.extend', - 'Router.prototype.runlist', - 'Router.prototype.mount' - ) - // - // wrap everything that is in the current buffer with a - // closure so that we dont get any collisions with other - // libraries - // - .wrap() - // - // write the debuggable version of the file. This file will - // get renamed to include the version from the package.json - // - .write(root + '/build/director.js') - // - // now lets make a minified version for production use. - // - .uglify() - .write(root + '/build/director.min.js') -; diff --git a/architecture-examples/polymer/bower_components/director/examples/http.js b/architecture-examples/polymer/bower_components/director/examples/http.js deleted file mode 100644 index 4e7a1d7208..0000000000 --- a/architecture-examples/polymer/bower_components/director/examples/http.js +++ /dev/null @@ -1,33 +0,0 @@ -var http = require('http'), - director = require('../lib/director'); - -var router = new director.http.Router(); - -var server = http.createServer(function (req, res) { - req.chunks = []; - req.on('data', function (chunk) { - req.chunks.push(chunk.toString()); - }); - - router.dispatch(req, res, function (err) { - if (err) { - res.writeHead(404); - res.end(); - } - - console.log('Served ' + req.url); - }); -}); - -router.get(/foo/, function () { - this.res.writeHead(200, { 'Content-Type': 'text/plain' }); - this.res.end('hello world\n'); -}); - -router.post(/foo/, function () { - this.res.writeHead(200, { 'Content-Type': 'application/json' }); - this.res.end(JSON.stringify(this.req.body)); -}); - -server.listen(8080); -console.log('vanilla http server with director running on 8080'); diff --git a/architecture-examples/polymer/bower_components/director/img/director.png b/architecture-examples/polymer/bower_components/director/img/director.png deleted file mode 100644 index ce1a92ae5c..0000000000 Binary files a/architecture-examples/polymer/bower_components/director/img/director.png and /dev/null differ diff --git a/architecture-examples/polymer/bower_components/director/img/hashRoute.png b/architecture-examples/polymer/bower_components/director/img/hashRoute.png deleted file mode 100644 index f8b29b63e7..0000000000 Binary files a/architecture-examples/polymer/bower_components/director/img/hashRoute.png and /dev/null differ diff --git a/architecture-examples/polymer/bower_components/director/lib/director.js b/architecture-examples/polymer/bower_components/director/lib/director.js deleted file mode 100644 index f43ae82750..0000000000 --- a/architecture-examples/polymer/bower_components/director/lib/director.js +++ /dev/null @@ -1,6 +0,0 @@ - - - -exports.Router = require('./director/router').Router; -exports.http = require('./director/http'); -exports.cli = require('./director/cli'); diff --git a/architecture-examples/polymer/bower_components/director/lib/director/browser.js b/architecture-examples/polymer/bower_components/director/lib/director/browser.js deleted file mode 100644 index d5709979e1..0000000000 --- a/architecture-examples/polymer/bower_components/director/lib/director/browser.js +++ /dev/null @@ -1,297 +0,0 @@ - -/* - * browser.js: Browser specific functionality for director. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -if (!Array.prototype.filter) { - Array.prototype.filter = function(filter, that) { - var other = [], v; - for (var i = 0, n = this.length; i < n; i++) { - if (i in this && filter.call(that, v = this[i], i, this)) { - other.push(v); - } - } - return other; - }; -} - -if (!Array.isArray){ - Array.isArray = function(obj) { - return Object.prototype.toString.call(obj) === '[object Array]'; - }; -} - -var dloc = document.location; - -function dlocHashEmpty() { - // Non-IE browsers return '' when the address bar shows '#'; Director's logic - // assumes both mean empty. - return dloc.hash === '' || dloc.hash === '#'; -} - -var listener = { - mode: 'modern', - hash: dloc.hash, - history: false, - - check: function () { - var h = dloc.hash; - if (h != this.hash) { - this.hash = h; - this.onHashChanged(); - } - }, - - fire: function () { - if (this.mode === 'modern') { - this.history === true ? window.onpopstate() : window.onhashchange(); - } - else { - this.onHashChanged(); - } - }, - - init: function (fn, history) { - var self = this; - this.history = history; - - if (!Router.listeners) { - Router.listeners = []; - } - - function onchange(onChangeEvent) { - for (var i = 0, l = Router.listeners.length; i < l; i++) { - Router.listeners[i](onChangeEvent); - } - } - - //note IE8 is being counted as 'modern' because it has the hashchange event - if ('onhashchange' in window && (document.documentMode === undefined - || document.documentMode > 7)) { - // At least for now HTML5 history is available for 'modern' browsers only - if (this.history === true) { - // There is an old bug in Chrome that causes onpopstate to fire even - // upon initial page load. Since the handler is run manually in init(), - // this would cause Chrome to run it twise. Currently the only - // workaround seems to be to set the handler after the initial page load - // http://code.google.com/p/chromium/issues/detail?id=63040 - setTimeout(function() { - window.onpopstate = onchange; - }, 500); - } - else { - window.onhashchange = onchange; - } - this.mode = 'modern'; - } - else { - // - // IE support, based on a concept by Erik Arvidson ... - // - var frame = document.createElement('iframe'); - frame.id = 'state-frame'; - frame.style.display = 'none'; - document.body.appendChild(frame); - this.writeFrame(''); - - if ('onpropertychange' in document && 'attachEvent' in document) { - document.attachEvent('onpropertychange', function () { - if (event.propertyName === 'location') { - self.check(); - } - }); - } - - window.setInterval(function () { self.check(); }, 50); - - this.onHashChanged = onchange; - this.mode = 'legacy'; - } - - Router.listeners.push(fn); - - return this.mode; - }, - - destroy: function (fn) { - if (!Router || !Router.listeners) { - return; - } - - var listeners = Router.listeners; - - for (var i = listeners.length - 1; i >= 0; i--) { - if (listeners[i] === fn) { - listeners.splice(i, 1); - } - } - }, - - setHash: function (s) { - // Mozilla always adds an entry to the history - if (this.mode === 'legacy') { - this.writeFrame(s); - } - - if (this.history === true) { - window.history.pushState({}, document.title, s); - // Fire an onpopstate event manually since pushing does not obviously - // trigger the pop event. - this.fire(); - } else { - dloc.hash = (s[0] === '/') ? s : '/' + s; - } - return this; - }, - - writeFrame: function (s) { - // IE support... - var f = document.getElementById('state-frame'); - var d = f.contentDocument || f.contentWindow.document; - d.open(); - d.write(" - - - - - - - diff --git a/architecture-examples/polymer/bower_components/director/test/browser/helpers/api.js b/architecture-examples/polymer/bower_components/director/test/browser/helpers/api.js deleted file mode 100644 index d784700aa0..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/browser/helpers/api.js +++ /dev/null @@ -1,77 +0,0 @@ -module("Director.js", { - setup: function() { - window.location.hash = ""; - shared = {}; - // Init needed keys earlier because of in HTML5 mode the route handler - // is executed upon Router.init() and due to that setting shared.fired - // in the param test of createTest is too late - if (HTML5TEST) { - shared.fired = []; - shared.fired_count = 0; - } - }, - teardown: function() { - window.location.hash = ""; - shared = {}; - } -}); - -var shared; - -function createTest(name, config, use, test, initialRoute) { - // We rename to `RouterAlias` for the browserify tests, since we want to be - // sure that no code is depending on `window.Router` being available. - var Router = window.Router || window.RouterAlias; - - if (typeof use === 'function') { - test = use; - use = undefined; - } - - if (HTML5TEST) { - if (use === undefined) { - use = {}; - } - - if (use.run_handler_in_init === undefined) { - use.run_handler_in_init = false; - } - use.html5history = true; - } - - // Because of the use of setTimeout when defining onpopstate - var innerTimeout = HTML5TEST === true ? 500 : 0; - - asyncTest(name, function() { - setTimeout(function() { - var router = new Router(config), - context; - - if (use !== undefined) { - router.configure(use); - } - - router.init(initialRoute); - - setTimeout(function() { - test.call(context = { - router: router, - navigate: function(url, callback) { - if (HTML5TEST) { - router.setRoute(url); - } else { - window.location.hash = url; - } - setTimeout(function() { - callback.call(context); - }, 14); - }, - finish: function() { - router.destroy(); - start(); - } - }) - }, innerTimeout); - }, 14); - }); -}; diff --git a/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-harness.html b/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-harness.html deleted file mode 100644 index eaf8ffc24b..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-harness.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Director HTML5 Tests - - - -

Note: in order to execute HTML5 mode test this file needs to be served with provided nodejs backend. Start the server from director/test/browser/backend and go to http://localhost:8080/ to launch the tests.

- -
-
- - - - - - - - - diff --git a/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-test.js b/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-test.js deleted file mode 100644 index 628d3c9700..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/browser/html5-routes-test.js +++ /dev/null @@ -1,660 +0,0 @@ -var browser_history_support = (window.history != null ? window.history.pushState : null) != null; - -createTest('Nested route with the many children as a tokens, callbacks should yield historic params', { - '/a': { - '/:id': { - '/:id': function(a, b) { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, ''), a, b); - } else { - shared.fired.push(location.pathname, a, b); - } - } - } - } -}, function() { - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['/a/b/c', 'b', 'c']); - this.finish(); - }); -}); - -createTest('Nested route with the first child as a token, callback should yield a param', { - '/foo': { - '/:id': { - on: function(id) { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, ''), id); - } else { - shared.fired.push(location.pathname, id); - } - } - } - } -}, function() { - this.navigate('/foo/a', function() { - this.navigate('/foo/b/c', function() { - deepEqual(shared.fired, ['/foo/a', 'a']); - this.finish(); - }); - }); -}); - -createTest('Nested route with the first child as a regexp, callback should yield a param', { - '/foo': { - '/(\\w+)': { - on: function(value) { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, ''), value); - } else { - shared.fired.push(location.pathname, value); - } - } - } - } -}, function() { - this.navigate('/foo/a', function() { - this.navigate('/foo/b/c', function() { - deepEqual(shared.fired, ['/foo/a', 'a']); - this.finish(); - }); - }); -}); - -createTest('Nested route with the several regular expressions, callback should yield a param', { - '/a': { - '/(\\w+)': { - '/(\\w+)': function(a, b) { - shared.fired.push(a, b); - } - } - } -}, function() { - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['b', 'c']); - this.finish(); - }); -}); - -createTest('Single nested route with on member containing function value', { - '/a': { - '/b': { - on: function() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - } - } - } -}, function() { - this.navigate('/a/b', function() { - deepEqual(shared.fired, ['/a/b']); - this.finish(); - }); -}); - -createTest('Single non-nested route with on member containing function value', { - '/a/b': { - on: function() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - } - } -}, function() { - this.navigate('/a/b', function() { - deepEqual(shared.fired, ['/a/b']); - this.finish(); - }); -}); - -createTest('Single nested route with on member containing array of function values', { - '/a': { - '/b': { - on: [function() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - }, - function() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - }] - } - } -}, function() { - this.navigate('/a/b', function() { - deepEqual(shared.fired, ['/a/b', '/a/b']); - this.finish(); - }); -}); - -createTest('method should only fire once on the route.', { - '/a': { - '/b': { - once: function() { - shared.fired_count++; - } - } - } -}, function() { - this.navigate('/a/b', function() { - this.navigate('/a/b', function() { - this.navigate('/a/b', function() { - deepEqual(shared.fired_count, 1); - this.finish(); - }); - }); - }); -}); - -createTest('method should only fire once on the route, multiple nesting.', { - '/a': { - on: function() { shared.fired_count++; }, - once: function() { shared.fired_count++; } - }, - '/b': { - on: function() { shared.fired_count++; }, - once: function() { shared.fired_count++; } - } -}, function() { - this.navigate('/a', function() { - this.navigate('/b', function() { - this.navigate('/a', function() { - this.navigate('/b', function() { - deepEqual(shared.fired_count, 6); - this.finish(); - }); - }); - }); - }); -}); - -createTest('overlapping routes with tokens.', { - '/a/:b/c' : function() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - }, - '/a/:b/c/:d' : function() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - } -}, function() { - this.navigate('/a/b/c', function() { - - this.navigate('/a/b/c/d', function() { - deepEqual(shared.fired, ['/a/b/c', '/a/b/c/d']); - this.finish(); - }); - }); -}); - -// // // -// // // Recursion features -// // // ---------------------------------------------------------- - -createTest('Nested routes with no recursion', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, function() { - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['c']); - this.finish(); - }); -}); - -createTest('Nested routes with backward recursion', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'backward' -}, function() { - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['c', 'b', 'a']); - this.finish(); - }); -}); - -createTest('Breaking out of nested routes with backward recursion', { - '/a': { - '/:b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - return false; - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'backward' -}, function() { - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['c', 'b']); - this.finish(); - }); -}); - -createTest('Nested routes with forward recursion', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'forward' -}, function() { - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['a', 'b', 'c']); - this.finish(); - }); -}); - -createTest('Nested routes with forward recursion, single route with an after event.', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - }, - after: function() { - shared.fired.push('c-after'); - } - }, - on: function b() { - shared.fired.push('b'); - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'forward' -}, function() { - this.navigate('/a/b/c', function() { - this.navigate('/a/b', function() { - deepEqual(shared.fired, ['a', 'b', 'c', 'c-after', 'a', 'b']); - this.finish(); - }); - }); -}); - -createTest('Breaking out of nested routes with forward recursion', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - return false; - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'forward' -}, function() { - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['a', 'b']); - this.finish(); - }); -}); - -// -// ABOVE IS WORKING -// - -// // -// // Special Events -// // ---------------------------------------------------------- - -createTest('All global event should fire after every route', { - '/a': { - on: function a() { - shared.fired.push('a'); - } - }, - '/b': { - '/c': { - on: function a() { - shared.fired.push('a'); - } - } - }, - '/d': { - '/:e': { - on: function a() { - shared.fired.push('a'); - } - } - } -}, { - after: function() { - shared.fired.push('b'); - } -}, function() { - this.navigate('/a', function() { - this.navigate('/b/c', function() { - this.navigate('/d/e', function() { - deepEqual(shared.fired, ['a', 'b', 'a', 'b', 'a']); - this.finish(); - }); - }); - }); - -}); - -createTest('Not found.', { - '/a': { - on: function a() { - shared.fired.push('a'); - } - }, - '/b': { - on: function a() { - shared.fired.push('b'); - } - } -}, { - notfound: function() { - shared.fired.push('notfound'); - } -}, function() { - this.navigate('/c', function() { - this.navigate('/d', function() { - deepEqual(shared.fired, ['notfound', 'notfound']); - this.finish(); - }); - }); -}); - -createTest('On all.', { - '/a': { - on: function a() { - shared.fired.push('a'); - } - }, - '/b': { - on: function a() { - shared.fired.push('b'); - } - } -}, { - on: function() { - shared.fired.push('c'); - } -}, function() { - this.navigate('/a', function() { - this.navigate('/b', function() { - deepEqual(shared.fired, ['a', 'c', 'b', 'c']); - this.finish(); - }); - }); -}); - - -createTest('After all.', { - '/a': { - on: function a() { - shared.fired.push('a'); - } - }, - '/b': { - on: function a() { - shared.fired.push('b'); - } - } -}, { - after: function() { - shared.fired.push('c'); - } -}, function() { - this.navigate('/a', function() { - this.navigate('/b', function() { - deepEqual(shared.fired, ['a', 'c', 'b']); - this.finish(); - }); - }); -}); - -createTest('resource object.', { - '/a': { - '/b/:c': { - on: 'f1' - }, - on: 'f2' - }, - '/d': { - on: ['f1', 'f2'] - } -}, -{ - resource: { - f1: function (name){ - shared.fired.push("f1-" + name); - }, - f2: function (name){ - shared.fired.push("f2"); - } - } -}, function() { - this.navigate('/a/b/c', function() { - this.navigate('/d', function() { - deepEqual(shared.fired, ['f1-c', 'f1-undefined', 'f2']); - this.finish(); - }); - }); -}); - -createTest('argument matching should be case agnostic', { - '/fooBar/:name': { - on: function(name) { - shared.fired.push("fooBar-" + name); - } - } -}, function() { - this.navigate('/fooBar/tesTing', function() { - deepEqual(shared.fired, ['fooBar-tesTing']); - this.finish(); - }); -}); - -createTest('sanity test', { - '/is/:this/:sane': { - on: function(a, b) { - shared.fired.push('yes ' + a + ' is ' + b); - } - }, - '/': { - on: function() { - shared.fired.push('is there sanity?'); - } - } -}, function() { - this.navigate('/is/there/sanity', function() { - deepEqual(shared.fired, ['yes there is sanity']); - this.finish(); - }); -}); - -createTest('`/` route should be navigable from the routing table', { - '/': { - on: function root() { - shared.fired.push('/'); - } - }, - '/:username': { - on: function afunc(username) { - shared.fired.push('/' + username); - } - } -}, function() { - this.navigate('/', function root() { - deepEqual(shared.fired, ['/']); - this.finish(); - }); -}); - -createTest('`/` route should not override a `/:token` route', { - '/': { - on: function root() { - shared.fired.push('/'); - } - }, - '/:username': { - on: function afunc(username) { - shared.fired.push('/' + username); - } - } -}, function() { - this.navigate('/a', function afunc() { - deepEqual(shared.fired, ['/a']); - this.finish(); - }); -}); - -createTest('should accept the root as a token.', { - '/:a': { - on: function root() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - } - } -}, function() { - this.navigate('/a', function root() { - deepEqual(shared.fired, ['/a']); - this.finish(); - }); -}); - -createTest('routes should allow wildcards.', { - '/:a/b*d': { - on: function() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - } - } -}, function() { - this.navigate('/a/bcd', function root() { - deepEqual(shared.fired, ['/a/bcd']); - this.finish(); - }); -}); - -createTest('functions should have |this| context of the router instance.', { - '/': { - on: function root() { - shared.fired.push(!!this.routes); - } - } -}, function() { - this.navigate('/', function root() { - deepEqual(shared.fired, [true]); - this.finish(); - }); -}); - -createTest('setRoute with a single parameter should change location correctly', { - '/bonk': { - on: function() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(window.location.pathname); - } - } - } -}, function() { - var self = this; - this.router.setRoute('/bonk'); - setTimeout(function() { - deepEqual(shared.fired, ['/bonk']); - self.finish(); - }, 14) -}); - -createTest('route should accept _ and . within parameters', { - '/:a': { - on: function root() { - if (!browser_history_support) { - shared.fired.push(location.hash.replace(/^#/, '')); - } else { - shared.fired.push(location.pathname); - } - } - } -}, function() { - this.navigate('/a_complex_route.co.uk', function root() { - deepEqual(shared.fired, ['/a_complex_route.co.uk']); - this.finish(); - }); -}); diff --git a/architecture-examples/polymer/bower_components/director/test/browser/routes-harness.html b/architecture-examples/polymer/bower_components/director/test/browser/routes-harness.html deleted file mode 100644 index c97c82667a..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/browser/routes-harness.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Director Tests - - - -
-
- - - - - - - - - diff --git a/architecture-examples/polymer/bower_components/director/test/browser/routes-test.js b/architecture-examples/polymer/bower_components/director/test/browser/routes-test.js deleted file mode 100644 index 1cb8d9528d..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/browser/routes-test.js +++ /dev/null @@ -1,694 +0,0 @@ - -createTest('Nested route with the many children as a tokens, callbacks should yield historic params', { - '/a': { - '/:id': { - '/:id': function(a, b) { - shared.fired.push(location.hash, a, b); - } - } - } -}, function() { - shared.fired = []; - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['#/a/b/c', 'b', 'c']); - this.finish(); - }); -}); - -createTest('Nested route with the first child as a token, callback should yield a param', { - '/foo': { - '/:id': { - on: function(id) { - shared.fired.push(location.hash, id); - } - } - } -}, function() { - shared.fired = []; - this.navigate('/foo/a', function() { - this.navigate('/foo/b/c', function() { - deepEqual(shared.fired, ['#/foo/a', 'a']); - this.finish(); - }); - }); -}); - -createTest('Nested route with the first child as a regexp, callback should yield a param', { - '/foo': { - '/(\\w+)': { - on: function(value) { - shared.fired.push(location.hash, value); - } - } - } -}, function() { - shared.fired = []; - this.navigate('/foo/a', function() { - this.navigate('/foo/b/c', function() { - deepEqual(shared.fired, ['#/foo/a', 'a']); - this.finish(); - }); - }); -}); - -createTest('Nested route with the several regular expressions, callback should yield a param', { - '/a': { - '/(\\w+)': { - '/(\\w+)': function(a, b) { - shared.fired.push(a, b); - } - } - } -}, function() { - shared.fired = []; - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['b', 'c']); - this.finish(); - }); -}); - - - -createTest('Single nested route with on member containing function value', { - '/a': { - '/b': { - on: function() { - shared.fired.push(location.hash); - } - } - } -}, function() { - shared.fired = []; - this.navigate('/a/b', function() { - deepEqual(shared.fired, ['#/a/b']); - this.finish(); - }); -}); - -createTest('Single non-nested route with on member containing function value', { - '/a/b': { - on: function() { - shared.fired.push(location.hash); - } - } -}, function() { - shared.fired = []; - this.navigate('/a/b', function() { - deepEqual(shared.fired, ['#/a/b']); - this.finish(); - }); -}); - -createTest('Single nested route with on member containing array of function values', { - '/a': { - '/b': { - on: [function() { shared.fired.push(location.hash); }, - function() { shared.fired.push(location.hash); }] - } - } -}, function() { - shared.fired = []; - this.navigate('/a/b', function() { - deepEqual(shared.fired, ['#/a/b', '#/a/b']); - this.finish(); - }); -}); - -createTest('method should only fire once on the route.', { - '/a': { - '/b': { - once: function() { - shared.fired++; - } - } - } -}, function() { - shared.fired = 0; - this.navigate('/a/b', function() { - this.navigate('/a/b', function() { - this.navigate('/a/b', function() { - deepEqual(shared.fired, 1); - this.finish(); - }); - }); - }); -}); - -createTest('method should only fire once on the route, multiple nesting.', { - '/a': { - on: function() { shared.fired++; }, - once: function() { shared.fired++; } - }, - '/b': { - on: function() { shared.fired++; }, - once: function() { shared.fired++; } - } -}, function() { - shared.fired = 0; - this.navigate('/a', function() { - this.navigate('/b', function() { - this.navigate('/a', function() { - this.navigate('/b', function() { - deepEqual(shared.fired, 6); - this.finish(); - }); - }); - }); - }); -}); - -createTest('overlapping routes with tokens.', { - '/a/:b/c' : function() { - shared.fired.push(location.hash); - }, - '/a/:b/c/:d' : function() { - shared.fired.push(location.hash); - } -}, function() { - shared.fired = []; - this.navigate('/a/b/c', function() { - - this.navigate('/a/b/c/d', function() { - deepEqual(shared.fired, ['#/a/b/c', '#/a/b/c/d']); - this.finish(); - }); - }); -}); - -// // // -// // // Recursion features -// // // ---------------------------------------------------------- - -createTest('Nested routes with no recursion', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, function() { - shared.fired = []; - - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['c']); - this.finish(); - }); -}); - -createTest('Nested routes with backward recursion', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'backward' -}, function() { - shared.fired = []; - - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['c', 'b', 'a']); - this.finish(); - }); -}); - -createTest('Breaking out of nested routes with backward recursion', { - '/a': { - '/:b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - return false; - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'backward' -}, function() { - shared.fired = []; - - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['c', 'b']); - this.finish(); - }); -}); - -createTest('Nested routes with forward recursion', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'forward' -}, function() { - shared.fired = []; - - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['a', 'b', 'c']); - this.finish(); - }); -}); - -createTest('Nested routes with forward recursion, single route with an after event.', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - }, - after: function() { - shared.fired.push('c-after'); - } - }, - on: function b() { - shared.fired.push('b'); - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'forward' -}, function() { - shared.fired = []; - - this.navigate('/a/b/c', function() { - this.navigate('/a/b', function() { - deepEqual(shared.fired, ['a', 'b', 'c', 'c-after', 'a', 'b']); - this.finish(); - }); - }); -}); - -createTest('Breaking out of nested routes with forward recursion', { - '/a': { - '/b': { - '/c': { - on: function c() { - shared.fired.push('c'); - } - }, - on: function b() { - shared.fired.push('b'); - return false; - } - }, - on: function a() { - shared.fired.push('a'); - } - } -}, { - recurse: 'forward' -}, function() { - shared.fired = []; - - this.navigate('/a/b/c', function() { - deepEqual(shared.fired, ['a', 'b']); - this.finish(); - }); -}); - -// -// ABOVE IS WORKING -// - -// // -// // Special Events -// // ---------------------------------------------------------- - -createTest('All global event should fire after every route', { - '/a': { - on: function a() { - shared.fired.push('a'); - } - }, - '/b': { - '/c': { - on: function a() { - shared.fired.push('a'); - } - } - }, - '/d': { - '/:e': { - on: function a() { - shared.fired.push('a'); - } - } - } -}, { - after: function() { - shared.fired.push('b'); - } -}, function() { - shared.fired = []; - - this.navigate('/a', function() { - this.navigate('/b/c', function() { - this.navigate('/d/e', function() { - deepEqual(shared.fired, ['a', 'b', 'a', 'b', 'a']); - this.finish(); - }); - }); - }); - -}); - -createTest('Not found.', { - '/a': { - on: function a() { - shared.fired.push('a'); - } - }, - '/b': { - on: function a() { - shared.fired.push('b'); - } - } -}, { - notfound: function() { - shared.fired.push('notfound'); - } -}, function() { - shared.fired = []; - - this.navigate('/c', function() { - this.navigate('/d', function() { - deepEqual(shared.fired, ['notfound', 'notfound']); - this.finish(); - }); - }); -}); - -createTest('On all.', { - '/a': { - on: function a() { - shared.fired.push('a'); - } - }, - '/b': { - on: function a() { - shared.fired.push('b'); - } - } -}, { - on: function() { - shared.fired.push('c'); - } -}, function() { - shared.fired = []; - - this.navigate('/a', function() { - this.navigate('/b', function() { - deepEqual(shared.fired, ['a', 'c', 'b', 'c']); - this.finish(); - }); - }); -}); - - -createTest('After all.', { - '/a': { - on: function a() { - shared.fired.push('a'); - } - }, - '/b': { - on: function a() { - shared.fired.push('b'); - } - } -}, { - after: function() { - shared.fired.push('c'); - } -}, function() { - shared.fired = []; - - this.navigate('/a', function() { - this.navigate('/b', function() { - deepEqual(shared.fired, ['a', 'c', 'b']); - this.finish(); - }); - }); -}); - -createTest('resource object.', { - '/a': { - '/b/:c': { - on: 'f1' - }, - on: 'f2' - }, - '/d': { - on: ['f1', 'f2'] - } -}, -{ - resource: { - f1: function (name){ - shared.fired.push("f1-" + name); - }, - f2: function (name){ - shared.fired.push("f2"); - } - } -}, function() { - shared.fired = []; - - this.navigate('/a/b/c', function() { - this.navigate('/d', function() { - deepEqual(shared.fired, ['f1-c', 'f1-undefined', 'f2']); - this.finish(); - }); - }); -}); - -createTest('argument matching should be case agnostic', { - '/fooBar/:name': { - on: function(name) { - shared.fired.push("fooBar-" + name); - } - } -}, function() { - shared.fired = []; - this.navigate('/fooBar/tesTing', function() { - deepEqual(shared.fired, ['fooBar-tesTing']); - this.finish(); - }); -}); - -createTest('sanity test', { - '/is/:this/:sane': { - on: function(a, b) { - shared.fired.push('yes ' + a + ' is ' + b); - } - }, - '/': { - on: function() { - shared.fired.push('is there sanity?'); - } - } -}, function() { - shared.fired = []; - this.navigate('/is/there/sanity', function() { - deepEqual(shared.fired, ['yes there is sanity']); - this.finish(); - }); -}); - -createTest('`/` route should be navigable from the routing table', { - '/': { - on: function root() { - shared.fired.push('/'); - } - }, - '/:username': { - on: function afunc(username) { - shared.fired.push('/' + username); - } - } -}, function() { - shared.fired = []; - this.navigate('/', function root() { - deepEqual(shared.fired, ['/']); - this.finish(); - }); -}); - -createTest('`/` route should not override a `/:token` route', { - '/': { - on: function root() { - shared.fired.push('/'); - } - }, - '/:username': { - on: function afunc(username) { - shared.fired.push('/' + username); - } - } -}, function() { - shared.fired = []; - this.navigate('/a', function afunc() { - deepEqual(shared.fired, ['/a']); - this.finish(); - }); -}); - -createTest('should accept the root as a token.', { - '/:a': { - on: function root() { - shared.fired.push(location.hash); - } - } -}, function() { - shared.fired = []; - this.navigate('/a', function root() { - deepEqual(shared.fired, ['#/a']); - this.finish(); - }); -}); - -createTest('routes should allow wildcards.', { - '/:a/b*d': { - on: function() { - shared.fired.push(location.hash); - } - } -}, function() { - shared.fired = []; - this.navigate('/a/bcd', function root() { - deepEqual(shared.fired, ['#/a/bcd']); - this.finish(); - }); -}); - -createTest('functions should have |this| context of the router instance.', { - '/': { - on: function root() { - shared.fired.push(!!this.routes); - } - } -}, function() { - shared.fired = []; - this.navigate('/', function root() { - deepEqual(shared.fired, [true]); - this.finish(); - }); -}); - -createTest('setRoute with a single parameter should change location correctly', { - '/bonk': { - on: function() { - shared.fired.push(window.location.hash); - } - } -}, function() { - var self = this; - shared.fired = []; - this.router.setRoute('/bonk'); - setTimeout(function() { - deepEqual(shared.fired, ['#/bonk']); - self.finish(); - }, 14) -}); - -createTest('route should accept _ and . within parameters', { - '/:a': { - on: function root() { - shared.fired.push(location.hash); - } - } -}, function() { - shared.fired = []; - this.navigate('/a_complex_route.co.uk', function root() { - deepEqual(shared.fired, ['#/a_complex_route.co.uk']); - this.finish(); - }); -}); - -createTest('initializing with a default route should only result in one route handling', { - '/': { - on: function root() { - if (!shared.init){ - shared.init = 0; - } - shared.init++; - } - }, - '/test': { - on: function root() { - if (!shared.test){ - shared.test = 0; - } - shared.test++; - } - } - }, function() { - this.navigate('/test', function root() { - equal(shared.init, 1); - equal(shared.test, 1); - this.finish(); - }); - }, - null, - '/'); - -createTest('changing the hash twice should call each route once', { - '/hash1': { - on: function root() { - shared.fired.push('hash1'); - } - }, - '/hash2': { - on: function root() { - shared.fired.push('hash2'); - } - } - }, function() { - shared.fired = []; - this.navigate('/hash1', function(){}); - this.navigate('/hash2', function(){ - deepEqual(shared.fired, ['hash1', 'hash2']); - this.finish(); - }); - } -); diff --git a/architecture-examples/polymer/bower_components/director/test/server/cli/dispatch-test.js b/architecture-examples/polymer/bower_components/director/test/server/cli/dispatch-test.js deleted file mode 100644 index 89a88ce262..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/cli/dispatch-test.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * dispatch-test.js: Tests for the core dispatch method. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/cli/dispatch').addBatch({ - "An instance of director.cli.Router": { - topic: function () { - var router = new director.cli.Router(), - that = this; - - that.matched = {}; - that.matched['users'] = []; - that.matched['apps'] = [] - - router.on('users create', function () { - that.matched['users'].push('on users create'); - }); - - router.on(/apps (\w+\s\w+)/, function () { - assert.equal(arguments.length, 1); - that.matched['apps'].push('on apps (\\w+\\s\\w+)'); - }); - - return router; - }, - "should have the correct routing table": function (router) { - assert.isObject(router.routes.users); - assert.isObject(router.routes.users.create); - }, - "the dispatch() method": { - "users create": function (router) { - assert.isTrue(router.dispatch('on', 'users create')); - assert.equal(this.matched.users[0], 'on users create'); - }, - "apps foo bar": function (router) { - assert.isTrue(router.dispatch('on', 'apps foo bar')); - assert.equal(this.matched['apps'][0], 'on apps (\\w+\\s\\w+)'); - }, - "not here": function (router) { - assert.isFalse(router.dispatch('on', 'not here')); - }, - "still not here": function (router) { - assert.isFalse(router.dispatch('on', 'still not here')); - } - } - } -}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/cli/mount-test.js b/architecture-examples/polymer/bower_components/director/test/server/cli/mount-test.js deleted file mode 100644 index 366aefd06f..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/cli/mount-test.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * mount-test.js: Tests for the core mount method. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/cli/path').addBatch({ - "An instance of director.cli.Router with routes": { - topic: new director.cli.Router({ - 'apps': function () { - console.log('apps'); - }, - ' users': function () { - console.log('users'); - } - }), - "should create the correct nested routing table": function (router) { - assert.isObject(router.routes.apps); - assert.isFunction(router.routes.apps.on); - assert.isObject(router.routes.users); - assert.isFunction(router.routes.users.on); - } - } -}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/cli/path-test.js b/architecture-examples/polymer/bower_components/director/test/server/cli/path-test.js deleted file mode 100644 index 8cce0595c7..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/cli/path-test.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * dispatch-test.js: Tests for the core dispatch method. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/cli/path').addBatch({ - "An instance of director.cli.Router": { - topic: new director.cli.Router(), - "the path() method": { - "should create the correct nested routing table": function (router) { - function noop () {} - - router.path(/apps/, function () { - router.path(/foo/, function () { - router.on(/bar/, noop); - }); - - router.on(/list/, noop); - }); - - router.on(/users/, noop); - - assert.isObject(router.routes.apps); - assert.isFunction(router.routes.apps.list.on); - assert.isObject(router.routes.apps.foo); - assert.isFunction(router.routes.apps.foo.bar.on); - assert.isFunction(router.routes.users.on); - } - } - } -}).export(module); - diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/dispatch-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/dispatch-test.js deleted file mode 100644 index e21fd1a36e..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/core/dispatch-test.js +++ /dev/null @@ -1,113 +0,0 @@ -/* - * dispatch-test.js: Tests for the core dispatch method. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/core/dispatch').addBatch({ - "An instance of director.Router": { - topic: function () { - var that = this; - that.matched = {}; - that.matched['/'] = []; - that.matched['foo'] = []; - that.matched['f*'] = [] - - var router = new director.Router({ - '/': { - before: function () { that.matched['/'].push('before /') }, - on: function () { that.matched['/'].push('on /') }, - after: function () { that.matched['/'].push('after /') } - }, - '/foo': { - before: function () { that.matched.foo.push('before foo') }, - on: function () { that.matched.foo.push('on foo') }, - after: function () { that.matched.foo.push('after foo') }, - '/bar': { - before: function () { that.matched.foo.push('before foo bar') }, - on: function () { that.matched.foo.push('foo bar') }, - after: function () { that.matched.foo.push('after foo bar') }, - '/buzz': function () { that.matched.foo.push('foo bar buzz') } - } - }, - '/f*': { - '/barbie': function () { that.matched['f*'].push('f* barbie') } - } - }); - - router.configure({ - recurse: 'backward' - }); - - return router; - }, - "should have the correct routing table": function (router) { - assert.isObject(router.routes.foo); - assert.isObject(router.routes.foo.bar); - assert.isObject(router.routes.foo.bar.buzz); - assert.isFunction(router.routes.foo.bar.buzz.on); - }, - "the dispatch() method": { - "/": function (router) { - assert.isTrue(router.dispatch('on', '/')); - assert.isTrue(router.dispatch('on', '/')); - - assert.equal(this.matched['/'][0], 'before /'); - assert.equal(this.matched['/'][1], 'on /'); - assert.equal(this.matched['/'][2], 'after /'); - }, - "/foo/bar/buzz": function (router) { - assert.isTrue(router.dispatch('on', '/foo/bar/buzz')); - - assert.equal(this.matched.foo[0], 'foo bar buzz'); - assert.equal(this.matched.foo[1], 'before foo bar'); - assert.equal(this.matched.foo[2], 'foo bar'); - assert.equal(this.matched.foo[3], 'before foo'); - assert.equal(this.matched.foo[4], 'on foo'); - }, - "/foo/barbie": function (router) { - assert.isTrue(router.dispatch('on', '/foo/barbie')); - assert.equal(this.matched['f*'][0], 'f* barbie'); - }, - "/foo/barbie/": function (router) { - assert.isFalse(router.dispatch('on', '/foo/barbie/')); - }, - "/foo/BAD": function (router) { - assert.isFalse(router.dispatch('on', '/foo/BAD')); - }, - "/bar/bar": function (router) { - assert.isFalse(router.dispatch('on', '/bar/bar')); - }, - "with the strict option disabled": { - topic: function (router) { - return router.configure({ - recurse: 'backward', - strict: false - }); - }, - "should have the proper configuration set": function (router) { - assert.isFalse(router.strict); - }, - "/foo/barbie/": function (router) { - assert.isTrue(router.dispatch('on', '/foo/barbie/')); - assert.equal(this.matched['f*'][0], 'f* barbie'); - }, - "/foo/bar/buzz": function (router) { - assert.isTrue(router.dispatch('on', '/foo/bar/buzz')); - - assert.equal(this.matched.foo[0], 'foo bar buzz'); - assert.equal(this.matched.foo[1], 'before foo bar'); - assert.equal(this.matched.foo[2], 'foo bar'); - assert.equal(this.matched.foo[3], 'before foo'); - assert.equal(this.matched.foo[4], 'on foo'); - }, - } - } - } -}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/insert-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/insert-test.js deleted file mode 100644 index 29dcbb3577..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/core/insert-test.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * insert-test.js: Tests for inserting routes into a normalized routing table. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/core/insert').addBatch({ - "An instance of director.Router": { - topic: new director.Router(), - "the insert() method": { - "'on', ['foo', 'bar']": function (router) { - function route () { } - - router.insert('on', ['foo', 'bar'], route); - assert.strictEqual(router.routes.foo.bar.on, route); - }, - "'on', ['foo', 'bar'] again": function (router) { - function route () { } - - router.insert('on', ['foo', 'bar'], route); - assert.isArray(router.routes.foo.bar.on); - assert.strictEqual(router.routes.foo.bar.on.length, 2); - }, - "'on', ['foo', 'bar'] a third time": function (router) { - function route () { } - - router.insert('on', ['foo', 'bar'], route); - assert.isArray(router.routes.foo.bar.on); - assert.strictEqual(router.routes.foo.bar.on.length, 3); - }, - "'get', ['fizz', 'buzz']": function (router) { - function route () { } - - router.insert('get', ['fizz', 'buzz'], route); - assert.strictEqual(router.routes.fizz.buzz.get, route); - } - } - } -}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/mount-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/mount-test.js deleted file mode 100644 index 44fd29cc8a..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/core/mount-test.js +++ /dev/null @@ -1,117 +0,0 @@ -/* - * mount-test.js: Tests for mounting and normalizing routes into a Router instance. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -function assertRoute (fn, path, route) { - if (path.length === 1) { - return assert.strictEqual(route[path.shift()], fn); - } - - route = route[path.shift()]; - assert.isObject(route); - assertRoute(fn, path, route); -} - -vows.describe('director/core/mount').addBatch({ - "An instance of director.Router": { - "with no preconfigured params": { - topic: new director.Router(), - "the mount() method": { - "should sanitize the routes correctly": function (router) { - function foobar () { } - function foostar () { } - function foobazzbuzz () { } - function foodog () { } - function root () {} - var fnArray = [foobar, foostar]; - - router.mount({ - '/': { - before: root, - on: root, - after: root, - '/nesting': { - on: foobar, - '/deep': foostar - } - }, - '/foo': { - '/bar': foobar, - '/*': foostar, - '/jitsu/then': { - before: foobar - } - }, - '/foo/bazz': { - '/buzz': foobazzbuzz - }, - '/foo/jitsu': { - '/then': fnArray - }, - '/foo/jitsu/then/now': foostar, - '/foo/:dog': foodog - }); - - assertRoute(root, ['on'], router.routes); - assertRoute(root, ['after'], router.routes); - assertRoute(root, ['before'], router.routes); - assertRoute(foobar, ['nesting', 'on'], router.routes); - assertRoute(foostar, ['nesting', 'deep', 'on'], router.routes); - assertRoute(foobar, [ 'foo', 'bar', 'on'], router.routes); - assertRoute(foostar, ['foo', '([_.()!\\ %@&a-zA-Z0-9-]+)', 'on'], router.routes); - assertRoute(fnArray, ['foo', 'jitsu', 'then', 'on'], router.routes); - assertRoute(foobar, ['foo', 'jitsu', 'then', 'before'], router.routes); - assertRoute(foobazzbuzz, ['foo', 'bazz', 'buzz', 'on'], router.routes); - assertRoute(foostar, ['foo', 'jitsu', 'then', 'now', 'on'], router.routes); - assertRoute(foodog, ['foo', '([._a-zA-Z0-9-]+)', 'on'], router.routes); - }, - - "should accept string path": function(router) { - function dogs () { } - - router.mount({ - '/dogs': { - on: dogs - } - }, - '/api'); - - assertRoute(dogs, ['api', 'dogs', 'on'], router.routes); - } - } - }, - "with preconfigured params": { - topic: function () { - var router = new director.Router(); - router.param('city', '([\\w\\-]+)'); - router.param(':country', /([A-Z][A-Za-z]+)/); - router.param(':zip', /([\d]{5})/); - return router; - }, - "should sanitize the routes correctly": function (router) { - function usaCityZip () { } - function countryCityZip () { } - - router.mount({ - '/usa/:city/:zip': usaCityZip, - '/world': { - '/:country': { - '/:city/:zip': countryCityZip - } - } - }); - - assertRoute(usaCityZip, ['usa', '([\\w\\-]+)', '([\\d]{5})', 'on'], router.routes); - assertRoute(countryCityZip, ['world', '([A-Z][A-Za-z]+)', '([\\w\\-]+)', '([\\d]{5})', 'on'], router.routes); - } - } - } -}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/on-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/on-test.js deleted file mode 100644 index 329ee8dfa2..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/core/on-test.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * on-test.js: Tests for the on/route method. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/core/insert').addBatch({ - "An instance of director.Router": { - topic: new director.Router(), - "the on() method": { - "['foo', 'bar']": function (router) { - function noop () { } - - router.on(['foo', 'bar'], noop); - assert.strictEqual(router.routes.foo.on, noop); - assert.strictEqual(router.routes.bar.on, noop); - }, - "'baz'": function (router) { - function noop () { } - - router.on('baz', noop); - assert.strictEqual(router.routes.baz.on, noop); - }, - "'after', 'baz'": function (router) { - function noop () { } - - router.on('after', 'boo', noop); - assert.strictEqual(router.routes.boo.after, noop); - } - } - } -}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/path-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/path-test.js deleted file mode 100644 index e038e3c8ed..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/core/path-test.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * path-test.js: Tests for the core `.path()` method. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/core/path').addBatch({ - "An instance of director.Router": { - topic: function () { - var that = this; - that.matched = {}; - that.matched['foo'] = []; - that.matched['newyork'] = []; - - var router = new director.Router({ - '/foo': function () { that.matched['foo'].push('foo'); } - }); - return router; - }, - "the path() method": { - "should create the correct nested routing table": function (router) { - var that = this; - router.path('/regions', function () { - this.on('/:state', function(country) { - that.matched['newyork'].push('new york'); - }); - }); - - assert.isFunction(router.routes.foo.on); - assert.isObject(router.routes.regions); - assert.isFunction(router.routes.regions['([._a-zA-Z0-9-]+)'].on); - }, - "should dispatch the function correctly": function (router) { - router.dispatch('on', '/regions/newyork') - router.dispatch('on', '/foo'); - assert.equal(this.matched['foo'].length, 1); - assert.equal(this.matched['newyork'].length, 1); - assert.equal(this.matched['foo'][0], 'foo'); - assert.equal(this.matched['newyork'][0], 'new york'); - } - } - } -}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/core/regifystring-test.js b/architecture-examples/polymer/bower_components/director/test/server/core/regifystring-test.js deleted file mode 100644 index 24cb38facb..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/core/regifystring-test.js +++ /dev/null @@ -1,103 +0,0 @@ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -var callback = function() { - return true; -}; - -var testRoute = function(route, callback) { - var router = new director.Router(); - router.on(route, callback); - - return function(value) { - return router.dispatch('on', value); - }; -}; - -vows.describe('director/core/regifyString').addBatch({ - - 'When using "/home(.*)"': { - topic: function() { - return testRoute('/home(.*)', callback); - }, - - 'Should match "/homepage"': function(result) { - assert.isTrue(result('/homepage')); - }, - - 'Should match "/home/page"': function(result) { - assert.isTrue(result('/home/page')); - }, - - 'Should not match "/foo-bar"': function(result) { - assert.isFalse(result('/foo-bar')); - } - }, - - 'When using "/home.*"': { - topic: function() { - return testRoute('/home.*', callback); - }, - - 'Should match "/homepage"': function(result) { - assert.isTrue(result('/homepage')); - }, - - 'Should match "/home/page"': function(result) { - assert.isTrue(result('/home/page')); - }, - - 'Should not match "/foo-bar"': function(result) { - assert.isFalse(result('/foo-bar')); - } - }, - - 'When using "/home(page[0-9])*"': { - topic: function() { - return testRoute('/home(page[0-9])*', callback); - }, - - 'Should match "/home"': function(result) { - assert.isTrue(result('/home')); - }, - - 'Should match "/homepage0", "/homepage1", etc.': function(result) { - for (i = 0; i < 10; i++) { - assert.isTrue(result('/homepage' + i)); - } - }, - - 'Should not match "/home_page"': function(result) { - assert.isFalse(result('/home_page')); - }, - - 'Should not match "/home/page"': function(result) { - assert.isFalse(result('/home/page')); - } - }, - - 'When using "/home*"': { - topic: function() { - return testRoute('/home*', callback); - }, - - 'Should match "/homepage"': function(result) { - assert.isTrue(result('/homepage')); - }, - - 'Should match "/home_page"': function(result) { - assert.isTrue(result('/home_page')); - }, - - 'Should match "/home-page"': function(result) { - assert.isTrue(result('/home-page')); - }, - - 'Should not match "/home/page"': function(result) { - assert.isFalse(result('/home/page')); - } - } - -}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/helpers/index.js b/architecture-examples/polymer/bower_components/director/test/server/helpers/index.js deleted file mode 100644 index 25630a1e32..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/helpers/index.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * index.js: Test helpers for director. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var http = require('http'); - -exports.createServer = function (router) { - return http.createServer(function (req, res) { - router.dispatch(req, res, function (err) { - if (err) { - res.writeHead(404); - res.end(); - } - }); - }); -}; - -exports.handlers = { - respondWithId: function (id) { - this.res.writeHead(200, { 'Content-Type': 'text/plain' }) - this.res.end('hello from (' + id + ')'); - }, - respondWithData: function () { - this.res.writeHead(200, { 'Content-Type': 'application/json' }) - this.res.end(JSON.stringify(this.data)); - }, - respondWithOk: function () { - return function () { - this.res.writeHead(200); - this.res.end('ok'); - }; - }, - streamBody: function () { - var body = '', - res = this.res; - - this.req.on('data', function (chunk) { - body += chunk; - }); - - this.req.on('end', function () { - res.writeHead(200, { 'Content-Type': 'application/json' }); - res.end(body); - }); - } -}; - -exports.macros = require('./macros'); diff --git a/architecture-examples/polymer/bower_components/director/test/server/helpers/macros.js b/architecture-examples/polymer/bower_components/director/test/server/helpers/macros.js deleted file mode 100644 index 3dc18f2e31..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/helpers/macros.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * macros.js: Test macros for director tests. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - request = require('request'); - -exports.assertGet = function(port, uri, expected) { - var context = { - topic: function () { - request({ uri: 'http://localhost:' + port + '/' + uri }, this.callback); - } - }; - - context['should respond with `' + expected + '`'] = function (err, res, body) { - assert.isNull(err); - assert.equal(res.statusCode, 200); - assert.equal(body, expected); - }; - - return context; -}; - -exports.assert404 = function (port, uri) { - return { - topic: function () { - request({ uri: 'http://localhost:' + port + '/' + uri }, this.callback); - }, - "should respond with 404": function (err, res, body) { - assert.isNull(err); - assert.equal(res.statusCode, 404); - } - }; -}; - -exports.assertPost = function(port, uri, expected) { - return { - topic: function () { - request({ - method: 'POST', - uri: 'http://localhost:' + port + '/' + uri, - body: JSON.stringify(expected) - }, this.callback); - }, - "should respond with the POST body": function (err, res, body) { - assert.isNull(err); - assert.equal(res.statusCode, 200); - assert.deepEqual(JSON.parse(body), expected); - } - }; -}; diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/accept-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/accept-test.js deleted file mode 100644 index 564301fe0c..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/http/accept-test.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * accept-test.js: Tests for `content-type`-based routing - * - * (C) 2012, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - apiEasy = require('api-easy'), - director = require('../../../lib/director'), - helpers = require('../helpers'), - macros = helpers.macros, - handlers = helpers.handlers; - -var PORT = 9067; - -apiEasy.describe('director/http/accept') - .addBatch({ - "An instance of `director.http.Router`": { - "with routes set up": { - topic: function () { - var router = new director.http.Router(); - router.get('/json', { accept: 'application/json' }, handlers.respondWithOk()); - router.get('/txt', { accept: 'text/plain' }, handlers.respondWithOk()); - router.get('/both', { accept: ['text/plain', 'application/json'] }, handlers.respondWithOk()); - router.get('/regex', { accept: /.+\/x\-.+/ }, handlers.respondWithOk()); - - router.get('/weird', { accept: 'application/json' }, function () { - this.res.writeHead(400); - this.res.end(); - }); - - router.get('/weird', handlers.respondWithOk()); - - helpers.createServer(router).listen(PORT, this.callback); - }, - "should be created": function (err) { - assert(!err); - } - } - } - }) - .use('localhost', PORT) - .discuss('with `content-type: application/json`') - .setHeader('content-type', 'application/json') - .get('/json') - .expect(200) - .get('/txt') - .expect(404) - .get('/both') - .expect(200) - .get('/regex') - .expect(404) - .get('/weird') - .expect(400) - .undiscuss() - .next() - .discuss('with `content-type: text/plain`') - .setHeader('content-type', 'text/plain') - .get('/json') - .expect(404) - .get('/txt') - .expect(200) - .get('/both') - .expect(200) - .get('/regex') - .expect(404) - .get('/weird') - .expect(200) - .undiscuss() - .next() - .discuss('with `content-type: application/x-tar-gz`') - .setHeader('content-type', 'application/x-tar-gz`') - .get('/json') - .get('/json') - .expect(404) - .get('/txt') - .expect(404) - .get('/both') - .expect(404) - .get('/regex') - .expect(200) - .get('/weird') - .expect(200) - .undiscuss() - .export(module); - diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/attach-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/attach-test.js deleted file mode 100644 index 1859b30648..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/http/attach-test.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * attach-test.js: Tests 'router.attach' functionality. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - http = require('http'), - vows = require('vows'), - request = require('request'), - director = require('../../../lib/director'), - helpers = require('../helpers'), - handlers = helpers.handlers, - macros = helpers.macros; - -function assertData(uri) { - return macros.assertGet( - 9091, - uri, - JSON.stringify([1,2,3]) - ); -} - -vows.describe('director/http/attach').addBatch({ - "An instance of director.http.Router": { - "instantiated with a Routing table": { - topic: new director.http.Router({ - '/hello': { - get: handlers.respondWithData - } - }), - "should have the correct routes defined": function (router) { - assert.isObject(router.routes.hello); - assert.isFunction(router.routes.hello.get); - }, - "when passed to an http.Server instance": { - topic: function (router) { - router.attach(function () { - this.data = [1,2,3]; - }); - - helpers.createServer(router) - .listen(9091, this.callback); - }, - "a request to hello": assertData('hello'), - } - } - } -}).export(module); diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/before-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/before-test.js deleted file mode 100644 index 824edc00fe..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/http/before-test.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * before-test.js: Tests for running before methods on HTTP server(s). - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - http = require('http'), - vows = require('vows'), - request = require('request'), - director = require('../../../lib/director'), - helpers = require('../helpers'), - handlers = helpers.handlers, - macros = helpers.macros; - -vows.describe('director/http/before').addBatch({ - "An instance of director.http.Router": { - "with ad-hoc routes including .before()": { - topic: function () { - var router = new director.http.Router(); - - router.before('/hello', function () { }); - router.after('/hello', function () { }); - router.get('/hello', handlers.respondWithId); - - return router; - }, - "should have the correct routes defined": function (router) { - assert.isObject(router.routes.hello); - assert.isFunction(router.routes.hello.before); - assert.isFunction(router.routes.hello.after); - assert.isFunction(router.routes.hello.get); - } - } - } -}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/http-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/http-test.js deleted file mode 100644 index e318fbd7e2..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/http/http-test.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * http-test.js: Tests for basic HTTP server(s). - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - http = require('http'), - vows = require('vows'), - request = require('request'), - director = require('../../../lib/director'), - helpers = require('../helpers'), - handlers = helpers.handlers, - macros = helpers.macros; - -function assertBark(uri) { - return macros.assertGet( - 9090, - uri, - 'hello from (bark)' - ); -} - -vows.describe('director/http').addBatch({ - "An instance of director.http.Router": { - "instantiated with a Routing table": { - topic: new director.http.Router({ - '/hello': { - get: handlers.respondWithId - } - }), - "should have the correct routes defined": function (router) { - assert.isObject(router.routes.hello); - assert.isFunction(router.routes.hello.get); - }, - "when passed to an http.Server instance": { - topic: function (router) { - router.get(/foo\/bar\/(\w+)/, handlers.respondWithId); - router.get(/foo\/update\/(\w+)/, handlers.respondWithId); - router.path(/bar\/bazz\//, function () { - this.get(/(\w+)/, handlers.respondWithId); - }); - router.get(/\/foo\/wild\/(.*)/, handlers.respondWithId); - router.get(/(\/v2)?\/somepath/, handlers.respondWithId); - - helpers.createServer(router) - .listen(9090, this.callback); - }, - "a request to foo/bar/bark": assertBark('foo/bar/bark'), - "a request to foo/update/bark": assertBark('foo/update/bark'), - "a request to bar/bazz/bark": assertBark('bar/bazz/bark'), - "a request to foo/bar/bark?test=test": assertBark('foo/bar/bark?test=test'), - "a request to foo/wild/bark": assertBark('foo/wild/bark'), - "a request to foo/%RT": macros.assert404(9090, 'foo/%RT'), - "a request to /v2/somepath": macros.assertGet( - 9090, - '/v2/somepath', - 'hello from (/v2)' - ) - } - } - } -}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/methods-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/methods-test.js deleted file mode 100644 index 28758a0b9d..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/http/methods-test.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * methods-test.js: Tests for HTTP methods. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/http/methods').addBatch({ - "When using director": { - "an instance of director.http.Router should have all relevant RFC methods": function () { - var router = new director.http.Router(); - director.http.methods.forEach(function (method) { - assert.isFunction(router[method.toLowerCase()]); - }); - }, - "the path() method": { - topic: new director.http.Router(), - "/resource": { - "should insert nested routes correct": function (router) { - function getResource() {} - function modifyResource() {} - - router.path(/\/resource/, function () { - this.get(getResource); - - this.put(/\/update/, modifyResource); - this.post(/create/, modifyResource); - }); - - assert.equal(router.routes.resource.get, getResource); - assert.equal(router.routes.resource.update.put, modifyResource); - assert.equal(router.routes.resource.create.post, modifyResource); - } - } - } - } -}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/responses-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/responses-test.js deleted file mode 100644 index 589ce595ce..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/http/responses-test.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * responses-test.js: Tests for HTTP responses. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - vows = require('vows'), - director = require('../../../lib/director'); - -vows.describe('director/http/responses').addBatch({ - "When using director.http": { - "it should have the relevant responses defined": function () { - Object.keys(require('../../../lib/director/http/responses')).forEach(function (name) { - assert.isFunction(director.http[name]); - }); - } - } -}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/director/test/server/http/stream-test.js b/architecture-examples/polymer/bower_components/director/test/server/http/stream-test.js deleted file mode 100644 index 29835391ae..0000000000 --- a/architecture-examples/polymer/bower_components/director/test/server/http/stream-test.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * stream-test.js: Tests for streaming HTTP in director. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var assert = require('assert'), - http = require('http'), - vows = require('vows'), - request = require('request'), - director = require('../../../lib/director'), - helpers = require('../helpers'), - macros = helpers.macros, - handlers = helpers.handlers - -vows.describe('director/http/stream').addBatch({ - "An instance of director.http.Router": { - "with streaming routes": { - topic: function () { - var router = new director.http.Router(); - router.post(/foo\/bar/, { stream: true }, handlers.streamBody); - router.path('/a-path', function () { - this.post({ stream: true }, handlers.streamBody); - }); - - return router; - }, - "when passed to an http.Server instance": { - topic: function (router) { - helpers.createServer(router) - .listen(9092, this.callback); - }, - "a POST request to /foo/bar": macros.assertPost(9092, 'foo/bar', { - foo: 'foo', - bar: 'bar' - }), - "a POST request to /a-path": macros.assertPost(9092, 'a-path', { - foo: 'foo', - bar: 'bar' - }) - } - } - } -}).export(module); \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/.bower.json b/architecture-examples/polymer/bower_components/polymer/.bower.json deleted file mode 100644 index 74d0474034..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/.bower.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "polymer", - "description": "Leverage the future of the web platform today.", - "homepage": "http://www.polymer-project.org/", - "keywords": [ - "util", - "client", - "browser" - ], - "author": "Polymer Authors ", - "version": "0.0.20130801", - "main": [ - "polymer.min.js" - ], - "_release": "0.0.20130801", - "_resolution": { - "type": "version", - "tag": "0.0.20130801", - "commit": "79ca6036d943d77335c273a742f9ce649a8bedac" - }, - "_source": "git://github.com/components/polymer.git", - "_target": "*" -} \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/LICENSE b/architecture-examples/polymer/bower_components/polymer/LICENSE deleted file mode 100644 index 92d60b019f..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2012 The Polymer Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/architecture-examples/polymer/bower_components/polymer/README.md b/architecture-examples/polymer/bower_components/polymer/README.md deleted file mode 100644 index d608dbdf32..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/README.md +++ /dev/null @@ -1,7 +0,0 @@ -Polymer is a new type of library for the web, built on top of Web Components, and designed to leverage the evolving web platform on modern browsers. - -For Docs, License, Tests, and pre-packed downloads, see: -http://www.polymer-project.org/ - -Many thanks to our contributors: -https://github.com/Polymer/platform/contributors diff --git a/architecture-examples/polymer/bower_components/polymer/bower.json b/architecture-examples/polymer/bower_components/polymer/bower.json deleted file mode 100644 index ec43433231..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/bower.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "polymer", - "description": "Leverage the future of the web platform today.", - "homepage": "http://www.polymer-project.org/", - "keywords": [ - "util", - "client", - "browser" - ], - "author": "Polymer Authors ", - "version": "0.0.20130801", - "main": [ - "polymer.min.js" - ] -} diff --git a/architecture-examples/polymer/bower_components/polymer/build.log b/architecture-examples/polymer/bower_components/polymer/build.log deleted file mode 100644 index 00d605dc2f..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/build.log +++ /dev/null @@ -1,42 +0,0 @@ -BUILD LOG ---------- -Build Time: 2013-08-01T14:19:08 - -NODEJS INFORMATION -================== -nodejs: v0.10.4 -chai: 1.7.2 -grunt: 0.4.1 -grunt-audit: 0.0.1 -grunt-contrib-uglify: 0.2.2 -grunt-contrib-yuidoc: 0.4.0 -grunt-karma: 0.5.0 -karma: 0.9.7 -karma-chrome-launcher: 0.0.2 -karma-coffee-preprocessor: 0.0.3 -karma-crbot-reporter: 0.0.3 -karma-firefox-launcher: 0.0.3 -karma-html2js-preprocessor: 0.0.2 -karma-jasmine: 0.0.3 -karma-mocha: 0.0.4 -karma-phantomjs-launcher: 0.0.2 -karma-requirejs: 0.0.3 -karma-script-launcher: 0.0.2 -mocha: 1.12.0 - -REPO REVISIONS -============== -polymer: 9c8068f25dbe1cc218079dec1480a716b2f5e816 -platform: 92b34ea333ec8cae2c7fcd395602d949117dc4e1 -ShadowDOM: fd48678e24442ae1b64d9ea7af3977e86c33b0bb -HTMLImports: 26739666016e855f9f5a569203015b081f9f7755 -CustomElements: a800e8ea471d99e38f5f99818566a0cb3cd17daf -PointerEvents: ffafaa3fce93c927f604999f58d61f4e2209e20c -PointerGestures: 84b7b698953dec5d6cfd12f78f220c18fd255eaf -mdv: c126ab89c5b39b8a088d0afac126310d5e8b3e20 - -BUILD HASHES -============ -polymer.min.js: 61432cfb0ca707a10a6708285801dcb321a8f6b9 -polymer.native.min.js: fa292dace6678f6b6f634de512c3e788318300d7 -polymer.sandbox.min.js: 4b62561d01ecb23c9a2325b7b882227fa3f9ff6d \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/component.json b/architecture-examples/polymer/bower_components/polymer/component.json deleted file mode 100644 index fe25c22aee..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/component.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "platform", - "repo": "components/platform", - "description": "Leverage the future of the web platform today.", - "homepage": "http://www.polymer-project.org/", - "keywords": [ - "util", - "client", - "browser" - ], - "author": "Polymer Authors ", - "version": "0.0.20130801", - "main": "polymer.min.js", - "scripts": [ - "polymer.min.js" - ] -} diff --git a/architecture-examples/polymer/bower_components/polymer/composer.json b/architecture-examples/polymer/bower_components/polymer/composer.json deleted file mode 100644 index d1d73948d3..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "components/platform", - "description": "Leverage the future of the web platform today.", - "keywords": ["util", "client", "browser"], - "type": "component", - "homepage": "http://www.polymer-project.org/", - "support": { - "issues": "https://github.com/Polymer/platform/issues", - "source": "https://github.com/Polymer/platform" - }, - "authors": [ - { - "name": "Polymer Authors", - "email": "polymer-dev@googlegroups.com" - } - ], - "extra": { - "component": { - "name": "polymer", - "scripts": [ - "polymer.min.js" - ], - "files": [ - "src/**", - "platform/**", - "polymer.min.js", - "polymer.min.js.map", - "polymer.native.min.js", - "polymer.native.min.js.map" - ], - "shim": { - "exports": "Platform" - } - } - } -} diff --git a/architecture-examples/polymer/bower_components/polymer/package.json b/architecture-examples/polymer/bower_components/polymer/package.json deleted file mode 100644 index 5a9ee5c25d..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "components-polymer", - "description": "Leverage the future of the web platform today.", - "homepage": "http://www.polymer-project.org/", - "keywords": [ - "util", - "client", - "browser" - ], - "author": "Polymer Authors ", - "repository": { - "type": "git", - "url": "git://github.com/Polymer/platform.git" - }, - "main": "polymer.min.js", - "version": "0.0.1", - "devDependencies": { - "mocha": "*", - "chai": "*", - "grunt": "*", - "grunt-contrib-concat": "*", - "grunt-contrib-uglify": "*", - "grunt-contrib-yuidoc": "~0.4.0", - "grunt-karma-0.9.1": "~0.4.3", - "karma-mocha": "*", - "karma-script-launcher": "*", - "karma-crbot-reporter": "*" - } -} diff --git a/architecture-examples/polymer/bower_components/polymer/polymer.native.min.js b/architecture-examples/polymer/bower_components/polymer/polymer.native.min.js deleted file mode 100644 index 95cf31ab53..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/polymer.native.min.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2012 The Polymer Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -function PointerGestureEvent(a,b){var c=b||{},d=document.createEvent("Event"),e={bubbles:!0,cancelable:!0};return Object.keys(e).forEach(function(a){a in c&&(e[a]=c[a])}),d.initEvent(a,e.bubbles,e.cancelable),Object.keys(c).forEach(function(a){d[a]=b[a]}),d.preventTap=this.preventTap,d}var SideTable;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0?SideTable=WeakMap:function(){var a=Object.defineProperty,b=Object.hasOwnProperty,c=(new Date).getTime()%1e9;SideTable=function(){this.name="__st"+(1e9*Math.random()>>>0)+(c++ +"__")},SideTable.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}(),function(){window.templateContent=window.templateContent||function(a){return a.content},window.wrap=window.unwrap=function(a){return a};var a=HTMLElement.prototype.webkitCreateShadowRoot;HTMLElement.prototype.webkitCreateShadowRoot=function(){var b=this.webkitShadowRoot,c=a.call(this);return c.olderShadowRoot=b,c.host=this,CustomElements.watchShadow(this),c},Object.defineProperties(HTMLElement.prototype,{shadowRoot:{get:function(){return this.webkitShadowRoot}},createShadowRoot:{value:function(){return this.webkitCreateShadowRoot()}}}),window.templateContent=function(a){if(window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(a),!a.content&&!a._content){for(var b=document.createDocumentFragment();a.firstChild;)b.appendChild(a.firstChild);a._content=b}return a.content||a._content}}(),function(a){function b(a){for(var b=a||{},d=1;d",""," "," ShadowDOM Inspector"," "," "," ",'
    ',"
",'
'," ",""].join("\n"),d=[],e=function(){var a=b.document,c=a.querySelector("#crumbs");c.textContent="";for(var e,g=0;e=d[g];g++){var h=a.createElement("a");h.href="#",h.textContent=e.localName,h.idx=g,h.onclick=function(a){for(var b;d.length>this.idx;)b=d.pop();f(b.shadow||b,b),a.preventDefault()},c.appendChild(a.createElement("li")).appendChild(h)}},f=function(a,c){var f=b.document;k=[];var g=c||a;d.push(g),e(),f.body.querySelector("#tree").innerHTML="
"+j(a,a.childNodes)+"
"},g=Array.prototype.forEach.call.bind(Array.prototype.forEach),h={STYLE:1,SCRIPT:1,"#comment":1,TEMPLATE:1},i=function(a){return h[a.nodeName]},j=function(a,b,c){if(i(a))return"";var d=c||"";if(a.localName||11==a.nodeType){var e=a.localName||"shadow-root",f=d+l(a);"content"==e&&(b=a.getDistributedNodes()),f+="
";var h=d+"  ";g(b,function(a){f+=j(a,a.childNodes,h)}),f+=d,{br:1}[e]||(f+="</"+e+">",f+="
")}else{var k=a.textContent.trim();f=k?d+'"'+k+'"'+"
":""}return f},k=[],l=function(a){var b="<",c=a.localName||"shadow-root";return a.webkitShadowRoot||a.shadowRoot?(b+=' ",k.push(a)):b+=c||"shadow-root",a.attributes&&g(a.attributes,function(a){b+=" "+a.name+(a.value?'="'+a.value+'"':"")}),b+=">"};shadowize=function(){var a=Number(this.attributes.idx.value),b=k[a];b?f(b.webkitShadowRoot||b.shadowRoot,b):(console.log("bad shadowize node"),console.dir(this))},a.output=j}(window.Inspector),function(a){"use strict";function b(){function a(a){"splice"===a[0].type&&"splice"===a[1].type&&(b=!0)}if("function"!=typeof Object.observe||"function"!=typeof Array.observe)return!1;var b=!1,c=[0];return Array.observe(c,a),c[1]=1,c.length=0,Object.deliverChangeRecords(a),b}function c(a){return+a===a>>>0}function d(a){return+a}function e(a){return a===Object(a)}function f(a,b){return a===b?0!==a||1/a===1/b:K(a)&&K(b)?!0:a!==a&&b!==b}function g(a){return"string"!=typeof a?!1:(a=a.replace(/\s/g,""),""==a?!0:"."==a[0]?!1:S.test(a))}function h(a){var b=T[a];if(b)return b;if(g(a)){var b=new i(a);return T[a]=b,b}}function i(a){return""==a.trim()?this:c(a)?(this.push(String(a)),this):(a.split(/\./).filter(function(a){return a}).forEach(function(a){this.push(a)},this),H&&this.length&&(this.getValueFrom=this.compiledGetValueFromFn()),void 0)}function j(a){for(var b=0;U>b&&a.check();)a.report(),b++}function k(a){for(var b in a)return!1;return!0}function l(a){return k(a.added)&&k(a.removed)&&k(a.changed)}function m(a,b){var c={},d={},e={};for(var f in b){var g=a[f];(void 0===g||g!==b[f])&&(f in a?g!==b[f]&&(e[f]=g):d[f]=void 0)}for(var f in a)f in b||(c[f]=a[f]);return Array.isArray(a)&&a.length!==b.length&&(e.length=a.length),{added:c,removed:d,changed:e}}function n(a,b){var c=b||(Array.isArray(a)?[]:{});for(var d in a)c[d]=a[d];return Array.isArray(a)&&(c.length=a.length),c}function o(a,b,c,d){if(this.closed=!1,this.object=a,this.callback=b,this.target=c,this.token=d,this.reporting=!0,G){var e=this;this.boundInternalCallback=function(a){e.internalCallback(a)}}p(this),this.connect(),this.sync(!0)}function p(a){W&&(V.push(a),o._allObserversCount++)}function q(a,b,c,d){o.call(this,a,b,c,d)}function r(a,b,c,d){if(!Array.isArray(a))throw Error("Provided object is not an Array");o.call(this,a,b,c,d)}function s(a){this.arr=[],this.callback=a,this.isObserved=!0}function t(a,b,c,d,f){this.value=void 0;var g=h(b);return g?g.length?e(a)?(this.path=g,o.call(this,a,c,d,f),void 0):(this.closed=!0,this.value=void 0,void 0):(this.closed=!0,this.value=a,void 0):(this.closed=!0,this.value=void 0,void 0)}function u(a,b){if("function"==typeof Object.observe){var c=Object.getNotifier(a);return function(d,e){var f={object:a,type:d,name:b};2===arguments.length&&(f.oldValue=e),c.notify(f)}}}function v(a,b,c){for(var d={},e={},f=0;fj;j++)i[j]=new Array(h),i[j][0]=j;for(var k=0;h>k;k++)i[0][k]=k;for(var j=1;g>j;j++)for(var k=1;h>k;k++)if(d[e+j-1]===a[b+k-1])i[j][k]=i[j-1][k-1];else{var l=i[j-1][k]+1,m=i[j][k-1]+1;i[j][k]=m>l?l:m}return i}function x(a){for(var b=a.length-1,c=a[0].length-1,d=a[b][c],e=[];b>0||c>0;)if(0!=b)if(0!=c){var f,g=a[b-1][c-1],h=a[b-1][c],i=a[b][c-1];f=i>h?g>h?h:g:g>i?i:g,f==g?(g==d?e.push(ab):(e.push(bb),d=g),b--,c--):f==h?(e.push(db),b--,d=h):(e.push(cb),c--,d=i)}else e.push(db),b--;else e.push(cb),c--;return e.reverse(),e}function y(a,b,c){for(var d=0;c>d;d++)if(a[d]!==b[d])return d;return c}function z(a,b,c){for(var d=a.length,e=b.length,f=0;c>f&&a[--d]===b[--e];)f++;return f}function A(a,b,c){return{index:a,removed:b,addedCount:c}}function B(a,b,c,d,e,f){var g=0,h=0,i=Math.min(c-b,f-e);if(0==b&&0==e&&(g=y(a,d,i)),c==a.length&&f==d.length&&(h=z(a,d,i-g)),b+=g,e+=g,c-=h,f-=h,0==c-b&&0==f-e)return[];if(b==c){for(var j=A(b,[],0);f>e;)j.removed.push(d[e++]);return[j]}if(e==f)return[A(b,[],c-b)];for(var k=x(w(a,b,c,d,e,f)),j=void 0,l=[],m=b,n=e,o=0;ob||a>d?-1:b==c||d==a?0:c>a?d>b?b-c:d-c:b>d?d-a:b-a}function D(a,b,c,d){for(var e=A(b,c,d),f=!1,g=0,h=0;h=0){a.splice(h,1),h--,g-=i.addedCount-i.removed.length,e.addedCount+=i.addedCount-j;var k=e.removed.length+i.removed.length-j;if(e.addedCount||k){var c=i.removed;if(e.indexi.index+i.addedCount){var m=e.removed.slice(i.index+i.addedCount-e.index);Array.prototype.push.apply(c,m)}e.removed=c,i.indexh)continue;D(e,h,[g.oldValue],1);break;default:console.error("Unexpected record type: "+JSON.stringify(g))}}return e}function F(a,b){var c=[];return E(a,b).forEach(function(b){return 1==b.addedCount&&1==b.removed.length?(b.removed[0]!==a[b.index]&&c.push(b),void 0):(c=c.concat(B(a,b.index,b.index+b.addedCount,b.removed,0,b.removed.length)),void 0)}),c}var G=b(),H=!1;try{var I=new Function("","return true;");H=I()}catch(J){}var K=a.Number.isNaN||function(b){return"number"==typeof b&&a.isNaN(b)},L="__proto__"in{}?function(a){return a}:function(a){var b=a.__proto__;if(!b)return a;var c=Object.create(b);return Object.getOwnPropertyNames(a).forEach(function(b){Object.defineProperty(c,b,Object.getOwnPropertyDescriptor(a,b))}),c},M="[$_a-zA-Z]",N="[$_a-zA-Z0-9]",O=M+"+"+N+"*",P="(?:[0-9]|[1-9]+[0-9]+)",Q="(?:"+O+"|"+P+")",R="(?:"+Q+")(?:\\."+Q+")*",S=new RegExp("^"+R+"$"),T={};i.prototype=L({__proto__:[],toString:function(){return this.join(".")},getValueFrom:function(a){for(var b=0;ba&&b.anyChanged);o._allObserversCount=V.length,X=!1}}},W&&(a.Platform.clearObservers=function(){V=[]}),q.prototype=L({__proto__:o.prototype,connect:function(){G&&Object.observe(this.object,this.boundInternalCallback)},sync:function(){G||(this.oldObject=n(this.object))},check:function(a){var b,c;if(G){if(!a)return!1;c={},b=v(this.object,a,c)}else c=this.oldObject,b=m(this.object,this.oldObject);return l(b)?!1:(this.reportArgs=[b.added||{},b.removed||{},b.changed||{}],this.reportArgs.push(function(a){return c[a]}),!0)},disconnect:function(){G?this.object&&Object.unobserve(this.object,this.boundInternalCallback):this.oldObject=void 0}}),r.prototype=L({__proto__:q.prototype,connect:function(){G&&Array.observe(this.object,this.boundInternalCallback)},sync:function(){G||(this.oldObject=this.object.slice())},check:function(a){var b;if(G){if(!a)return!1;b=F(this.object,a)}else b=B(this.object,0,this.object.length,this.oldObject,0,this.oldObject.length);return b&&b.length?(this.reportArgs=[b],!0):!1}}),r.applySplices=function(a,b,c){c.forEach(function(c){for(var d=[c.index,c.removed.length],e=c.index;e=0&&this.arr[b+1]===this.isObserved||(0>b&&(b=this.arr.length,this.arr[b]=a,Object.observe(a,this.callback)),this.arr[b+1]=this.isObserved,this.observe(Object.getPrototypeOf(a)))}},cleanup:function(){for(var a=0,b=0,c=this.isObserved;ba&&(this.arr[a]=d,this.arr[a+1]=c),a+=2):Object.unobserve(d,this.callback),b+=2}this.arr.length=a}},t.prototype=L({__proto__:o.prototype,connect:function(){G&&(this.observedSet=new s(this.boundInternalCallback))},disconnect:function(){this.value=void 0,G&&(this.observedSet.reset(),this.observedSet.cleanup(),this.observedSet=void 0)},check:function(){return this.value=G?this.path.getValueFromObserved(this.object,this.observedSet):this.path.getValueFrom(this.object),f(this.value,this.oldValue)?!1:(this.reportArgs=[this.value,this.oldValue],!0)},sync:function(a){a&&(this.value=G?this.path.getValueFromObserved(this.object,this.observedSet):this.path.getValueFrom(this.object)),this.oldValue=this.value}}),t.getValueAtPath=function(a,b){var c=h(b);return c?c.getValueFrom(a):void 0},t.setValueAtPath=function(a,b,c){var d=h(b);d&&d.setValueFrom(a,c)};var _={"new":!0,updated:!0,deleted:!0};t.defineProperty=function(a,b,c){var d=c.object,e=h(c.path),f=u(a,b),g=new t(d,c.path,function(a,b){f&&f("updated",b)});return Object.defineProperty(a,b,{get:function(){return e.getValueFrom(d)},set:function(a){e.setValueFrom(d,a)},configurable:!0}),{close:function(){var c=e.getValueFrom(d);f&&g.deliver(),g.close(),Object.defineProperty(a,b,{value:c,writable:!0,configurable:!0})}}};var ab=0,bb=1,cb=2,db=3;a.Observer=o,a.Observer.hasObjectObserve=G,a.ArrayObserver=r,a.ArrayObserver.calculateSplices=function(a,b){return B(a,0,a.length,b,0,b.length)},a.ObjectObserver=q,a.PathObserver=t,a.Path=i}("undefined"!=typeof global&&global?global:this),function(a){"use strict";function b(a){if(!a)throw new Error("Assertion failed")}function c(a){for(;a.parentNode;)a=a.parentNode;return"function"==typeof a.getElementById?a:null}function d(a){return a.ownerDocument.contains(a)}function e(a,b,c,d){this.closed=!1,this.node=a,this.property=b,this.model=c,this.path=d,this.observer=new PathObserver(c,d,this.boundValueChanged,this),this.boundValueChanged(this.value)}function f(a,b,c,d){this.conditional="?"==b[b.length-1],this.conditional&&(a.removeAttribute(b),b=b.slice(0,-1)),e.call(this,a,b,c,d)}function g(a){switch(a.type){case"checkbox":return T;case"radio":case"select-multiple":case"select-one":return"change";default:return"input"}}function h(a,b,c,d){e.call(this,a,b,c,d),this.eventType=g(this.node),this.boundNodeValueToModel=this.nodeValueChanged.bind(this),this.node.addEventListener(this.eventType,this.boundNodeValueToModel,!0)}function i(a){if(!d(a))return[];if(a.form)return Q(a.form.elements,function(b){return b!=a&&"INPUT"==b.tagName&&"radio"==b.type&&b.name==a.name});var b=a.ownerDocument.querySelectorAll('input[type="radio"][name="'+a.name+'"]');return Q(b,function(b){return b!=a&&!b.form})}function j(a,b,c){h.call(this,a,"checked",b,c)}function k(a,b,c){h.call(this,a,"selectedIndex",b,c)}function l(a){return $[a.tagName]&&a.hasAttribute("template")}function m(a){return"TEMPLATE"==a.tagName||l(a)}function n(a){return _&&"TEMPLATE"==a.tagName}function o(a,b){var c=a.querySelectorAll(ab);m(a)&&b(a),P(c,b)}function p(a){function b(a){HTMLTemplateElement.decorate(a)||p(a.content)}o(a,b)}function q(a,b){Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))})}function r(a){if(!a.defaultView)return a;var b=eb.get(a);if(!b){for(b=a.implementation.createHTMLDocument("");b.lastChild;)b.removeChild(b.lastChild);eb.set(a,b)}return b}function s(a){var b=a.ownerDocument.createElement("template");a.parentNode.insertBefore(b,a);for(var c=a.attributes,d=c.length;d-->0;){var e=c[d];Z[e.name]&&("template"!==e.name&&b.setAttribute(e.name,e.value),a.removeAttribute(e.name))}return b}function t(a,b,c){var d=a.content;if(c)return d.appendChild(b),void 0;for(var e;e=b.firstChild;)d.appendChild(e)}function u(a){"TEMPLATE"===a.tagName?_||(cb?a.__proto__=HTMLTemplateElement.prototype:q(a,HTMLTemplateElement.prototype)):(q(a,HTMLTemplateElement.prototype),Object.defineProperty(a,"content",ib))}function v(a){var b=lb.get(a);b||(b=function(){H(a,a.model,a.bindingDelegate)},lb.set(a,b)),bb(b)}function w(a,b,c,d){this.closed=!1,this.node=a,this.property=b,this.model=c,this.path=d,this.node.inputs.bind(this.property,c,d||"")}function x(a){return 3==a.length&&0==a[0].length&&0==a[2].length}function y(a){if(a&&a.length){for(var b,c=a.length,d=0,e=0,f=0;c>e;){if(d=a.indexOf("{{",e),f=0>d?-1:a.indexOf("}}",d+2),0>f){if(!b)return;b.push(a.slice(e));break}b=b||[],b.push(a.slice(e,d)),b.push(a.slice(d+2,f).trim()),e=f+2}return e===c&&b.push(""),b}}function z(a,b,c,d,e){var f,g=e&&e[X];return g&&"function"==typeof g&&(f=g(c,d,b,a),f&&(c=f,d="value")),a.bind(b,c,d)}function A(a,b,c,d,e){for(var f=0;fc?(this.keys.push(a),this.values.push(b)):this.values[c]=b},get:function(a){var b=this.keys.indexOf(a);return 0>b?void 0:this.values[b]},"delete":function(a){var b=this.keys.indexOf(a);return 0>b?!1:(this.keys.splice(b,1),this.values.splice(b,1),!0)},forEach:function(a,b){for(var c=0;c>>0)+(c++ +"__")},S.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}(),Node.prototype.bind=function(a,b,c){this.bindings=this.bindings||{};var d=this.bindings[a];return d&&d.close(),d=this.createBinding(a,b,c),this.bindings[a]=d,d?d:(console.error("Unhandled binding to Node: ",this,a,b,c),void 0)},Node.prototype.createBinding=function(){},Node.prototype.unbind=function(a){if(this.bindings){var b=this.bindings[a];b&&(b.close(),delete this.bindings[a])}},Node.prototype.unbindAll=function(){if(this.bindings){for(var a=Object.keys(this.bindings),b=0;be.node.length&&d--?bb(b):e.node[e.property]=c}var c=Number(a);if(c<=this.node.length)return this.node[this.property]=c,void 0;var d=2,e=this;bb(b)}}),HTMLSelectElement.prototype.createBinding=function(a,b,c){return"selectedindex"===a.toLowerCase()?(this.removeAttribute(a),new k(this,b,c)):HTMLElement.prototype.createBinding.call(this,a,b,c)};var U="bind",V="repeat",W="if",X="getBinding",Y="getInstanceModel",Z={template:!0,repeat:!0,bind:!0,ref:!0},$={THEAD:!0,TBODY:!0,TFOOT:!0,TH:!0,TR:!0,TD:!0,COLGROUP:!0,COL:!0,CAPTION:!0,OPTION:!0,OPTGROUP:!0},_="undefined"!=typeof HTMLTemplateElement,ab="template, "+Object.keys($).map(function(a){return a.toLowerCase()+"[template]"}).join(", "),bb=function(){function a(a){this.nextRunner=a,this.value=!1,this.lastValue=this.value,this.scheduled=[],this.scheduledIds=[],this.running=!1,this.observer=new PathObserver(this,"value",this.run,this)}function b(a){var b=a[e];a[e]||(b=d++,a[e]=b),c.schedule(a,b)}a.prototype={schedule:function(a,b){if(!this.scheduledIds[b]){if(this.running)return this.nextRunner.schedule(a,b);this.scheduledIds[b]=!0,this.scheduled.push(a),this.lastValue===this.value&&(this.value=!this.value)}},run:function(){this.running=!0;for(var a=0;a=48&&57>=a}function d(a){return 32===a||9===a||11===a||12===a||160===a||a>=5760&&" ᠎              ".indexOf(String.fromCharCode(a))>0}function e(a){return 10===a||13===a||8232===a||8233===a}function f(a){return 36===a||95===a||a>=65&&90>=a||a>=97&&122>=a}function g(a){return 36===a||95===a||a>=65&&90>=a||a>=97&&122>=a||a>=48&&57>=a}function h(a){return"this"===a}function i(){for(;bb>ab&&d(_.charCodeAt(ab));)++ab}function j(){var a,b;for(a=ab++;bb>ab&&(b=_.charCodeAt(ab),g(b));)++ab;return _.slice(a,ab)}function k(){var a,b,c;return a=ab,b=j(),c=1===b.length?X.Identifier:h(b)?X.Keyword:"null"===b?X.NullLiteral:"true"===b||"false"===b?X.BooleanLiteral:X.Identifier,{type:c,value:b,range:[a,ab]}}function l(){var a,b,c,d,e=ab,f=_.charCodeAt(ab),g=_[ab];switch(f){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++ab,{type:X.Punctuator,value:String.fromCharCode(f),range:[e,ab]};default:if(a=_.charCodeAt(ab+1),61===a)switch(f){case 37:case 38:case 42:case 43:case 45:case 47:case 60:case 62:case 94:case 124:return ab+=2,{type:X.Punctuator,value:String.fromCharCode(f)+String.fromCharCode(a),range:[e,ab]};case 33:case 61:return ab+=2,61===_.charCodeAt(ab)&&++ab,{type:X.Punctuator,value:_.slice(e,ab),range:[e,ab]}}}return b=_[ab+1],c=_[ab+2],d=_[ab+3],">"===g&&">"===b&&">"===c&&"="===d?(ab+=4,{type:X.Punctuator,value:">>>=",range:[e,ab]}):">"===g&&">"===b&&">"===c?(ab+=3,{type:X.Punctuator,value:">>>",range:[e,ab]}):"<"===g&&"<"===b&&"="===c?(ab+=3,{type:X.Punctuator,value:"<<=",range:[e,ab]}):">"===g&&">"===b&&"="===c?(ab+=3,{type:X.Punctuator,value:">>=",range:[e,ab]}):g===b&&"+-<>&|".indexOf(g)>=0?(ab+=2,{type:X.Punctuator,value:g+b,range:[e,ab]}):"<>=!+-*%&|^/".indexOf(g)>=0?(++ab,{type:X.Punctuator,value:g,range:[e,ab]}):(s({},$.UnexpectedToken,"ILLEGAL"),void 0)}function m(){var a,d,e;if(e=_[ab],b(c(e.charCodeAt(0))||"."===e,"Numeric literal must start with a decimal digit or a decimal point"),d=ab,a="","."!==e){for(a=_[ab++],e=_[ab],"0"===a&&e&&c(e.charCodeAt(0))&&s({},$.UnexpectedToken,"ILLEGAL");c(_.charCodeAt(ab));)a+=_[ab++];e=_[ab]}if("."===e){for(a+=_[ab++];c(_.charCodeAt(ab));)a+=_[ab++];e=_[ab]}if("e"===e||"E"===e)if(a+=_[ab++],e=_[ab],("+"===e||"-"===e)&&(a+=_[ab++]),c(_.charCodeAt(ab)))for(;c(_.charCodeAt(ab));)a+=_[ab++];else s({},$.UnexpectedToken,"ILLEGAL");return f(_.charCodeAt(ab))&&s({},$.UnexpectedToken,"ILLEGAL"),{type:X.NumericLiteral,value:parseFloat(a),range:[d,ab]}}function n(){var a,c,d,f="",g=!1;for(a=_[ab],b("'"===a||'"'===a,"String literal must starts with a quote"),c=ab,++ab;bb>ab;){if(d=_[ab++],d===a){a="";break}if("\\"===d)if(d=_[ab++],d&&e(d.charCodeAt(0)))"\r"===d&&"\n"===_[ab]&&++ab;else switch(d){case"n":f+="\n";break;case"r":f+="\r";break;case"t":f+=" ";break;case"b":f+="\b";break;case"f":f+="\f";break;case"v":f+=" ";break;default:f+=d}else{if(e(d.charCodeAt(0)))break;f+=d}}return""!==a&&s({},$.UnexpectedToken,"ILLEGAL"),{type:X.StringLiteral,value:f,octal:g,range:[c,ab]}}function o(a){return a.type===X.Identifier||a.type===X.Keyword||a.type===X.BooleanLiteral||a.type===X.NullLiteral}function p(){var a;return i(),ab>=bb?{type:X.EOF,range:[ab,ab]}:(a=_.charCodeAt(ab),40===a||41===a||58===a?l():39===a||34===a?n():f(a)?k():46===a?c(_.charCodeAt(ab+1))?m():l():c(a)?m():l())}function q(){var a;return a=db,ab=a.range[1],db=p(),ab=a.range[1],a}function r(){var a;a=ab,db=p(),ab=a}function s(a,c){var d,e=Array.prototype.slice.call(arguments,2),f=c.replace(/%(\d)/g,function(a,c){return b(cab&&(a.push(O()),!v(")"));)u(",");return u(")"),a}function F(){var a;return a=q(),o(a)||t(a),cb.createIdentifier(a.value)}function G(){return u("."),F()}function H(){var a;return u("["),a=P(),u("]"),a}function I(){var a,b,c;for(a=D();v(".")||v("[")||v("(");)v("(")?(b=E(),a=cb.createCallExpression(a,b)):v("[")?(c=H(),a=cb.createMemberExpression("[",a,c)):(c=G(),a=cb.createMemberExpression(".",a,c));return a}function J(){var a;return a=I(),db.type===X.Punctuator&&(v("++")||v("--"))&&s({},$.UnexpectedToken),a}function K(){var a,b;return db.type!==X.Punctuator&&db.type!==X.Keyword?b=J():v("++")||v("--")?s({},$.UnexpectedToken):v("+")||v("-")||v("~")||v("!")?(a=q(),b=K(),b=cb.createUnaryExpression(a.value,b)):w("delete")||w("void")||w("typeof")?s({},$.UnexpectedToken):b=J(),b}function L(a,b){var c=0;if(a.type!==X.Punctuator&&a.type!==X.Keyword)return 0;switch(a.value){case"||":c=1;break;case"&&":c=2;break;case"|":c=3;break;case"^":c=4;break;case"&":c=5;break;case"==":case"!=":case"===":case"!==":c=6;break;case"<":case">":case"<=":case">=":case"instanceof":c=7;break;case"in":c=b?7:0;break;case"<<":case">>":case">>>":c=8;break;case"+":case"-":c=9;break;case"*":case"/":case"%":c=11}return c}function M(){var a,b,c,d,e,f,g,h,i;if(d=eb.allowIn,eb.allowIn=!0,h=K(),b=db,c=L(b,d),0===c)return h;for(b.prec=c,q(),f=K(),e=[h,b,f];(c=L(db,d))>0;){for(;e.length>2&&c<=e[e.length-2].prec;)f=e.pop(),g=e.pop().value,h=e.pop(),a=cb.createBinaryExpression(g,h,f),e.push(a);b=q(),b.prec=c,e.push(b),a=K(),e.push(a)}for(eb.allowIn=d,i=e.length-1,a=e[i];i>1;)a=cb.createBinaryExpression(e[i-1].value,e[i-2],a),i-=2;return a}function N(){var a,b,c,d;return a=M(),v("?")&&(q(),b=eb.allowIn,eb.allowIn=!0,c=O(),eb.allowIn=b,u(":"),d=O(),a=cb.createConditionalExpression(a,c,d)),a}function O(){var a,b,c;return a=db,c=b=N()}function P(){var a;return a=O()}function Q(){return u(";"),cb.createEmptyStatement()}function R(){var a=P();return x(),cb.createExpressionStatement(a)}function S(){var a,b,c,d=db.type;if(d===X.EOF&&t(db),i(),d===X.Punctuator)switch(db.value){case";":return Q();case"(":return R()}return a=P(),a.type===Z.Identifier&&v(":")?(q(),c="$"+a.name,Object.prototype.hasOwnProperty.call(eb.labelSet,c)&&s({},$.Redeclaration,"Label",a.name),eb.labelSet[c]=!0,b=S(),delete eb.labelSet[c],cb.createLabeledStatement(a,b)):(x(),cb.createExpressionStatement(a))}function T(){return db.type===X.Keyword?S():db.type!==X.EOF?S():void 0}function U(){for(var a,b=[];bb>ab&&(a=T(),"undefined"!=typeof a);)b.push(a);return b}function V(){var a;return i(),r(),a=U(),cb.createProgram(a)}function W(a,b){var c;return c=String,"string"==typeof a||a instanceof String||(a=c(a)),cb=b,_=a,ab=0,bb=_.length,db=null,eb={allowIn:!0,labelSet:{}},bb>0&&"undefined"==typeof _[0]&&a instanceof String&&(_=a.valueOf()),V()}var X,Y,Z,$,_,ab,bb,cb,db,eb;X={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},Y={},Y[X.BooleanLiteral]="Boolean",Y[X.EOF]="",Y[X.Identifier]="Identifier",Y[X.Keyword]="Keyword",Y[X.NullLiteral]="Null",Y[X.NumericLiteral]="Numeric",Y[X.Punctuator]="Punctuator",Y[X.StringLiteral]="String",Z={ArrayExpression:"ArrayExpression",BinaryExpression:"BinaryExpression",CallExpression:"CallExpression",ConditionalExpression:"ConditionalExpression",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",Identifier:"Identifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ThisExpression:"ThisExpression",UnaryExpression:"UnaryExpression"},$={UnexpectedToken:"Unexpected token %0",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared"},a.esprima={parse:W}}(this),function(a){"use strict";function b(a,b,d,e){if(e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.tagName&&("bind"===d||"repeat"===d)){var f,g,h=b.match(r);if(h?(f=h[1],g=h[2]):(h=b.match(s),h&&(f=h[2],g=h[1])),h){var i;if(g=g.trim(),g.match(q))i=new CompoundBinding(function(a){return a.path}),i.bind("path",a,g);else try{i=c(a,g)}catch(j){console.error("Invalid expression syntax: "+g,j)}if(i)return t.set(e,f),i}}}function c(a,b){try{var c=new f;if(esprima.parse(b,c),!c.statements.length&&!c.labeledStatements.length)return;if(!c.labeledStatements.length&&c.statements.length>1)throw Error("Multiple unlabelled statements are not allowed.");var e=c.labeledStatements.length?d(c.labeledStatements):e=c.statements[0],g=[];for(var h in c.deps)g.push(h);if(!g.length)return{value:e({})};for(var i=new CompoundBinding(e),j=0;j>>0)+(c++ +"__")},i.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}();var j="[$_a-zA-Z]",k="[$_a-zA-Z0-9]",l=j+"+"+k+"*",m="("+l+")",n="(?:[0-9]|[1-9]+[0-9]+)",o="(?:"+l+"|"+n+")",p="(?:"+o+")(?:\\."+o+")*",q=new RegExp("^"+p+"$"),r=new RegExp("^"+m+"\\s* in (.*)$"),s=new RegExp("^(.*) as \\s*"+m+"$"),t=new i;e.prototype={getPath:function(){return this.last?this.last.getPath()+"."+this.name:this.name},valueFn:function(){var a=this.getPath();return this.deps[a]=!0,function(b){return b[a]}}};var u={"+":function(a){return+a},"-":function(a){return-a},"!":function(a){return!a}},v={"+":function(a,b){return a+b},"-":function(a,b){return a-b},"*":function(a,b){return a*b},"/":function(a,b){return a/b},"%":function(a,b){return a%b},"<":function(a,b){return b>a},">":function(a,b){return a>b},"<=":function(a,b){return b>=a},">=":function(a,b){return a>=b},"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"===":function(a,b){return a===b},"!==":function(a,b){return a!==b},"&&":function(a,b){return a&&b},"||":function(a,b){return a||b}};f.prototype={getFn:function(a){return a instanceof e?a.valueFn():a},createProgram:function(){},createExpressionStatement:function(a){return this.statements.push(a),a},createLabeledStatement:function(a,b){return this.labeledStatements.push({label:a.getPath(),body:b instanceof e?b.valueFn():b}),b},createUnaryExpression:function(a,b){if(!u[a])throw Error("Disallowed operator: "+a);return b=this.getFn(b),function(c){return u[a](b(c))}},createBinaryExpression:function(a,b,c){if(!v[a])throw Error("Disallowed operator: "+a);return b=this.getFn(b),c=this.getFn(c),function(d){return v[a](b(d),c(d))}},createConditionalExpression:function(a,b,c){return a=this.getFn(a),b=this.getFn(b),c=this.getFn(c),function(d){return a(d)?b(d):c(d)}},createIdentifier:function(a){var b=new e(this.deps,a);return b.type="Identifier",b},createMemberExpression:function(a,b,c){return new e(this.deps,c.name,b)},createLiteral:function(a){return function(){return a.value}},createArrayExpression:function(a){for(var b=0;be;e++)d.unshift("..");var g=d.join("/");return g},resolvePathsInHTML:function(a,b){b=b||p.documentUrlFromNode(a),p.resolveAttributes(a,b),p.resolveStyleElts(a,b);var c=a.querySelectorAll("template");c&&q(c,function(a){a.content&&p.resolvePathsInHTML(a.content,b)})},resolvePathsInStylesheet:function(a){var b=p.nodeUrl(a);a.__resource=p.resolveCssText(a.__resource,b)},resolveStyleElts:function(a,b){var c=a.querySelectorAll("style");c&&q(c,function(a){a.textContent=p.resolveCssText(a.textContent,b)})},resolveCssText:function(a,b){return a.replace(/url\([^)]*\)/g,function(a){var c=a.replace(/["']/g,"").slice(4,-1);return c=p.resolveUrl(b,c,!0),"url("+c+")"})},resolveAttributes:function(a,b){var c=a&&a.querySelectorAll(n);c&&q(c,function(a){this.resolveNodeAttributes(a,b)},this)},resolveNodeAttributes:function(a,b){m.forEach(function(c){var d=a.attributes[c];if(d&&d.value&&d.value.search(o)<0){var e=p.resolveUrl(b,d.value,!0);d.value=e}})}};h=h||{async:!0,ok:function(a){return a.status>=200&&a.status<300||304===a.status||0===a.status},load:function(b,c,d){var e=new XMLHttpRequest;return(a.flags.debug||a.flags.bust)&&(b+="?"+Math.random()),e.open("GET",b,h.async),e.addEventListener("readystatechange",function(){4===e.readyState&&c.call(d,!h.ok(e)&&e,e.response,b)}),e.send(),e},loadDocument:function(a,b,c){this.load(a,b,c).responseType="document"}};var q=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.path=p,a.xhr=h,a.importer=k,a.getDocumentUrl=p.getDocumentUrl,a.IMPORT_LINK_TYPE=i}(window.HTMLImports),function(a){function b(a){return"link"===a.localName&&a.getAttribute("rel")===f}function c(a){return a.parentNode&&!d(a)&&!e(a)}function d(a){return a.ownerDocument===document||a.ownerDocument.impl===document}function e(a){return a.parentNode&&"element"===a.parentNode.localName}var f="import",g={selectors:["link[rel="+f+"]","link[rel=stylesheet]","style","script:not([type])",'script[type="text/javascript"]'],map:{link:"parseLink",script:"parseScript",style:"parseGeneric"},parse:function(a){if(!a.__importParsed){a.__importParsed=!0;var b=a.querySelectorAll(g.selectors);h(b,function(a){g[g.map[a.localName]](a)})}},parseLink:function(a){b(a)?a.content&&g.parse(a.content):this.parseGeneric(a)},parseGeneric:function(a){c(a)&&document.head.appendChild(a)},parseScript:function(b){if(c(b)){var d=(b.__resource||b.textContent).trim();if(d){var e=b.__nodeUrl;if(!e){var e=a.path.documentUrlFromNode(b),f="["+Math.floor(1e3*(Math.random()+1))+"]",g=d.match(/Polymer\(['"]([^'"]*)/);f=g&&g[1]||f,e+="/"+f+".js"}d+="\n//# sourceURL="+e+"\n",eval.call(window,d)}}}},h=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.parser=g}(HTMLImports),function(){function a(){HTMLImports.importer.load(document,function(){HTMLImports.parser.parse(document),HTMLImports.readyTime=(new Date).getTime(),document.dispatchEvent(new CustomEvent("HTMLImportsLoaded",{bubbles:!0}))})}"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(a){var b=document.createEvent("HTMLEvents");return b.initEvent(a,!0,!0),b}),"complete"===document.readyState?a():window.addEventListener("DOMContentLoaded",a)}(),function(a){function b(a){u.push(a),t||(t=!0,q(d))}function c(a){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(a)||a}function d(){t=!1;var a=u;u=[],a.sort(function(a,b){return a.uid_-b.uid_});var b=!1;a.forEach(function(a){var c=a.takeRecords();e(a),c.length&&(a.callback_(c,a),b=!0)}),b&&d()}function e(a){a.nodes_.forEach(function(b){var c=p.get(b);c&&c.forEach(function(b){b.observer===a&&b.removeTransientObservers()})})}function f(a,b){for(var c=a;c;c=c.parentNode){var d=p.get(c);if(d)for(var e=0;e0){var e=c[d-1],f=n(e,a);if(f)return c[d-1]=f,void 0}else b(this.observer);c[d]=a},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(a){var b=this.options;b.attributes&&a.addEventListener("DOMAttrModified",this,!0),b.characterData&&a.addEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.addEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(a){var b=this.options;b.attributes&&a.removeEventListener("DOMAttrModified",this,!0),b.characterData&&a.removeEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.removeEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(a){if(a!==this.target){this.addListeners_(a),this.transientObservedNodes.push(a);var b=p.get(a);b||p.set(a,b=[]),b.push(this)}},removeTransientObservers:function(){var a=this.transientObservedNodes;this.transientObservedNodes=[],a.forEach(function(a){this.removeListeners_(a);for(var b=p.get(a),c=0;c1?logFlags.dom&&console.warn("inserted:",a.localName,"insert/remove count:",a.__inserted):a.insertedCallback&&(logFlags.dom&&console.log("inserted:",a.localName),a.insertedCallback())),logFlags.dom&&console.groupEnd())}function k(a){l(a),d(a,function(a){l(a)})}function l(a){(a.removedCallback||a.__upgraded__&&logFlags.dom)&&(logFlags.dom&&console.log("removed:",a.localName),m(a)||(a.__inserted=(a.__inserted||0)-1,a.__inserted>0&&(a.__inserted=0),a.__inserted<0?logFlags.dom&&console.warn("removed:",a.localName,"insert/remove count:",a.__inserted):a.removedCallback&&a.removedCallback()))}function m(a){for(var b=a;b;){if(b==a.ownerDocument)return!0;b=b.parentNode||b.host}}function n(a){if(a.webkitShadowRoot&&!a.webkitShadowRoot.__watched){logFlags.dom&&console.log("watching shadow-root for: ",a.localName);for(var b=a.webkitShadowRoot;b;)o(b),b=b.olderShadowRoot}}function o(a){a.__watched||(t(a),a.__watched=!0)}function p(a){n(a),d(a,function(){n(a)})}function q(a){switch(a.localName){case"style":case"script":case"template":case void 0:return!0 -}}function r(a){if(logFlags.dom){var b=a[0];if(b&&"childList"===b.type&&b.addedNodes&&b.addedNodes){for(var c=b.addedNodes[0];c&&c!==document&&!c.host;)c=c.parentNode;var d=c&&(c.URL||c._URL||c.host&&c.host.localName)||"";d=d.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",a.length,d||"")}a.forEach(function(a){"childList"===a.type&&(x(a.addedNodes,function(a){q(a)||g(a)}),x(a.removedNodes,function(a){q(a)||k(a)}))}),logFlags.dom&&console.groupEnd()}function s(){r(w.takeRecords())}function t(a){w.observe(a,{childList:!0,subtree:!0})}function u(a){t(a)}function v(a){logFlags.dom&&console.group("upgradeDocument: ",(a.URL||a._URL||"").split("/").pop()),g(a),logFlags.dom&&console.groupEnd()}var w=new MutationObserver(r),x=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.watchShadow=n,a.watchAllShadows=p,a.upgradeAll=g,a.upgradeSubtree=f,a.observeDocument=u,a.upgradeDocument=v,a.takeRecords=s}(window.CustomElements),function(){function parseElementElement(a){var b={name:"","extends":null};takeAttributes(a,b);var c=HTMLElement.prototype;if(b.extends){var d=document.createElement(b.extends);c=d.__proto__||Object.getPrototypeOf(d)}b.prototype=Object.create(c),a.options=b;var e=a.querySelector('script:not([type]),script[type="text/javascript"],scripts');e&&executeComponentScript(e.textContent,a,b.name);var f=document.register(b.name,b);a.ctor=f;var g=a.getAttribute("constructor");g&&(window[g]=f)}function takeAttributes(a,b){for(var c in b){var d=a.attributes[c];d&&(b[c]=d.value)}}function executeComponentScript(inScript,inContext,inName){context=inContext;var owner=context.ownerDocument,url=owner._URL||owner.URL||owner.impl&&(owner.impl._URL||owner.impl.URL),match=url.match(/.*\/([^.]*)[.]?.*$/);if(match){var name=match[1];url+=name!=inName?":"+inName:""}var code="__componentScript('"+inName+"', function(){"+inScript+"});"+"\n//# sourceURL="+url+"\n";eval(code)}function mixin(a,b){a=a||{};try{Object.getOwnPropertyNames(b).forEach(function(c){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)})}catch(c){}return a}var HTMLElementElement=function(a){return a.register=HTMLElementElement.prototype.register,parseElementElement(a),a};HTMLElementElement.prototype={register:function(a){a&&(this.options.lifecycle=a.lifecycle,a.prototype&&mixin(this.options.prototype,a.prototype))}};var context;window.__componentScript=function(a,b){b.call(context)},window.HTMLElementElement=HTMLElementElement}(),function(){function a(a){return"link"===a.localName&&a.getAttribute("rel")===b}var b=window.HTMLImports?HTMLImports.IMPORT_LINK_TYPE:"none",c={selectors:["link[rel="+b+"]","element"],map:{link:"parseLink",element:"parseElement"},parse:function(a){if(!a.__parsed){a.__parsed=!0;var b=a.querySelectorAll(c.selectors);d(b,function(a){c[c.map[a.localName]](a)}),CustomElements.upgradeDocument(a),CustomElements.observeDocument(a)}},parseLink:function(b){a(b)&&this.parseImport(b)},parseImport:function(a){a.content&&c.parse(a.content)},parseElement:function(a){new HTMLElementElement(a)}},d=Array.prototype.forEach.call.bind(Array.prototype.forEach);CustomElements.parser=c}(),function(){function a(){setTimeout(function(){CustomElements.parser.parse(document),CustomElements.upgradeDocument(document),CustomElements.ready=!0,CustomElements.readyTime=Date.now(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.body.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))},0)}if("function"!=typeof window.CustomEvent&&(window.CustomEvent=function(a){var b=document.createEvent("HTMLEvents");return b.initEvent(a,!0,!0),b}),"complete"===document.readyState)a();else{var b=window.HTMLImports?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(b,a)}}(),function(){function a(){}var b=document.createElement("style");b.textContent="element {display: none !important;} /* injected by platform.js */";var c=document.querySelector("head");if(c.insertBefore(b,c.firstChild),window.ShadowDOMPolyfill){CustomElements.watchShadow=a,CustomElements.watchAllShadows=a;var d=["upgradeAll","upgradeSubtree","observeDocument","upgradeDocument"],e={};d.forEach(function(a){e[a]=CustomElements[a]}),d.forEach(function(a){CustomElements[a]=function(b){return e[a](wrap(b))}})}}(),function(a){a=a||{};var b={shadow:function(a){return a?a.shadowRoot||a.webkitShadowRoot:void 0},canTarget:function(a){return a&&Boolean(a.elementFromPoint)},targetingShadow:function(a){var b=this.shadow(a);return this.canTarget(b)?b:void 0},olderShadow:function(a){var b=a.olderShadowRoot;if(!b){var c=a.querySelector("shadow");c&&(b=c.olderShadowRoot)}return b},allShadows:function(a){for(var b=[],c=this.shadow(a);c;)b.push(c),c=this.olderShadow(c);return b},searchRoot:function(a,b,c){if(a){var d,e,f=a.elementFromPoint(b,c);for(e=this.targetingShadow(f);e;){if(d=e.elementFromPoint(b,c)){var g=this.targetingShadow(d);return this.searchRoot(g,b,c)||d}e=this.olderShadow(e)}return f}},owner:function(a){for(var b=a;b.parentNode;)b=b.parentNode;return b},findTarget:function(a){var b=a.clientX,c=a.clientY,d=this.owner(a.target);return d.elementFromPoint(b,c)||(d=document),this.searchRoot(document,b,c)}};a.targetFinding=b,a.findTarget=b.findTarget.bind(b),window.PointerEventsPolyfill=a}(window.PointerEventsPolyfill),function(){function a(a){return'[touch-action="'+a+'"]'}function b(a){return"{ -ms-touch-action: "+a+"; touch-action: "+a+"; }"}var c=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],d="";c.forEach(function(c){d+=String(c)===c?a(c)+b(c):c.selectors.map(a)+b(c.rule)});var e=document.createElement("style");e.textContent=d;var f=document.querySelector("head");f.insertBefore(e,f.firstChild)}(),function(a){function b(a,b){var b=b||{},e=b.buttons;if(void 0===e)switch(b.which){case 1:e=1;break;case 2:e=4;break;case 3:e=2;break;default:e=0}var f;if(c)f=new MouseEvent(a,b);else{f=document.createEvent("MouseEvent");var g={bubbles:!1,cancelable:!1,view:null,detail:null,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null};Object.keys(g).forEach(function(a){a in b&&(g[a]=b[a])}),f.initMouseEvent(a,g.bubbles,g.cancelable,g.view,g.detail,g.screenX,g.screenY,g.clientX,g.clientY,g.ctrlKey,g.altKey,g.shiftKey,g.metaKey,g.button,g.relatedTarget)}d||Object.defineProperty(f,"buttons",{get:function(){return e},enumerable:!0});var h=0;return h=b.pressure?b.pressure:e?.5:0,Object.defineProperties(f,{pointerId:{value:b.pointerId||0,enumerable:!0},width:{value:b.width||0,enumerable:!0},height:{value:b.height||0,enumerable:!0},pressure:{value:h,enumerable:!0},tiltX:{value:b.tiltX||0,enumerable:!0},tiltY:{value:b.tiltY||0,enumerable:!0},pointerType:{value:b.pointerType||"",enumerable:!0},hwTimestamp:{value:b.hwTimestamp||0,enumerable:!0},isPrimary:{value:b.isPrimary||!1,enumerable:!0}}),f}var c=!1,d=!1;try{var e=new MouseEvent("click",{buttons:1});c=!0,d=1===e.buttons}catch(f){}a.PointerEvent||(a.PointerEvent=b)}(window),function(a){function b(){this.ids=[],this.pointers=[]}b.prototype={set:function(a,b){var c=this.ids.indexOf(a);c>-1?this.pointers[c]=b:(this.ids.push(a),this.pointers.push(b))},has:function(a){return this.ids.indexOf(a)>-1},"delete":function(a){var b=this.ids.indexOf(a);b>-1&&(this.ids.splice(b,1),this.pointers.splice(b,1))},get:function(a){var b=this.ids.indexOf(a);return this.pointers[b]},get size(){return this.pointers.length},clear:function(){this.ids.length=0,this.pointers.length=0},forEach:function(a,b){this.ids.forEach(function(c,d){a.call(b,c,this.pointers[d],this)},this)}},a.PointerMap=window.Map&&Map.prototype.forEach?Map:b}(window.PointerEventsPolyfill),function(a){var b;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0)b=WeakMap;else{var c=Object.defineProperty,d=Object.hasOwnProperty,e=(new Date).getTime()%1e9;b=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")},b.prototype={set:function(a,b){c(a,this.name,{value:b,writable:!0})},get:function(a){return d.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}a.SideTable=b}(window.PointerEventsPolyfill),function(a){var b={targets:new a.SideTable,handledEvents:new a.SideTable,pointermap:new a.PointerMap,eventMap:{},eventSources:{},eventSourceList:[],registerSource:function(a,b){var c=b,d=c.events;d&&(d.forEach(function(a){c[a]&&(this.eventMap[a]=c[a].bind(c))},this),this.eventSources[a]=c,this.eventSourceList.push(c))},register:function(a){for(var b,c=this.eventSourceList.length,d=0;c>d&&(b=this.eventSourceList[d]);d++)b.register.call(b,a)},unregister:function(a){for(var b,c=this.eventSourceList.length,d=0;c>d&&(b=this.eventSourceList[d]);d++)b.unregister.call(b,a)},down:function(a){this.fireEvent("pointerdown",a)},move:function(a){this.fireEvent("pointermove",a)},up:function(a){this.fireEvent("pointerup",a)},enter:function(a){a.bubbles=!1,this.fireEvent("pointerenter",a)},leave:function(a){a.bubbles=!1,this.fireEvent("pointerleave",a)},over:function(a){a.bubbles=!0,this.fireEvent("pointerover",a)},out:function(a){a.bubbles=!0,this.fireEvent("pointerout",a)},cancel:function(a){this.fireEvent("pointercancel",a)},leaveOut:function(a){a.target.contains(a.relatedTarget)||this.leave(a),this.out(a)},enterOver:function(a){a.target.contains(a.relatedTarget)||this.enter(a),this.over(a)},eventHandler:function(a){if(!this.handledEvents.get(a)){var b=a.type,c=this.eventMap&&this.eventMap[b];c&&c(a),this.handledEvents.set(a,!0)}},listen:function(a,b){b.forEach(function(b){this.addEvent(a,b)},this)},unlisten:function(a,b){b.forEach(function(b){this.removeEvent(a,b)},this)},addEvent:function(a,b){a.addEventListener(b,this.boundHandler)},removeEvent:function(a,b){a.removeEventListener(b,this.boundHandler)},makeEvent:function(a,b){var c=new PointerEvent(a,b);return this.targets.set(c,this.targets.get(b)||b.target),c},fireEvent:function(a,b){var c=this.makeEvent(a,b);return this.dispatchEvent(c)},cloneEvent:function(a){var b={};for(var c in a)b[c]=a[c];return b},getTarget:function(a){return this.captureInfo&&this.captureInfo.id===a.pointerId?this.captureInfo.target:this.targets.get(a)},setCapture:function(a,b){this.captureInfo&&this.releaseCapture(this.captureInfo.id),this.captureInfo={id:a,target:b};var c=new PointerEvent("gotpointercapture",{bubbles:!0});this.implicitRelease=this.releaseCapture.bind(this,a),document.addEventListener("pointerup",this.implicitRelease),document.addEventListener("pointercancel",this.implicitRelease),this.targets.set(c,b),this.asyncDispatchEvent(c)},releaseCapture:function(a){if(this.captureInfo&&this.captureInfo.id===a){var b=new PointerEvent("lostpointercapture",{bubbles:!0}),c=this.captureInfo.target;this.captureInfo=null,document.removeEventListener("pointerup",this.implicitRelease),document.removeEventListener("pointercancel",this.implicitRelease),this.targets.set(b,c),this.asyncDispatchEvent(b)}},dispatchEvent:function(a){var b=this.getTarget(a);return b?b.dispatchEvent(a):void 0},asyncDispatchEvent:function(a){setTimeout(this.dispatchEvent.bind(this,a),0)}};b.boundHandler=b.eventHandler.bind(b),a.dispatcher=b,a.register=b.register.bind(b),a.unregister=b.unregister.bind(b)}(window.PointerEventsPolyfill),function(a){function b(a,b,c,d){this.addCallback=a.bind(d),this.removeCallback=b.bind(d),this.changedCallback=c.bind(d),g&&(this.observer=new g(this.mutationWatcher.bind(this)))}var c=Array.prototype.forEach.call.bind(Array.prototype.forEach),d=Array.prototype.map.call.bind(Array.prototype.map),e=Array.prototype.slice.call.bind(Array.prototype.slice),f=Array.prototype.filter.call.bind(Array.prototype.filter),g=window.MutationObserver||window.WebKitMutationObserver,h="[touch-action]",i={subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["touch-action"]};b.prototype={watchSubtree:function(b){a.targetFinding.canTarget(b)&&this.observer.observe(b,i)},enableOnSubtree:function(a){this.watchSubtree(a),a===document&&"complete"!==document.readyState?this.installOnLoad():this.installNewSubtree(a)},installNewSubtree:function(a){c(this.findElements(a),this.addElement,this)},findElements:function(a){return a.querySelectorAll?a.querySelectorAll(h):[]},removeElement:function(a){this.removeCallback(a)},addElement:function(a){this.addCallback(a)},elementChanged:function(a,b){this.changedCallback(a,b)},concatLists:function(a,b){return a.concat(e(b))},installOnLoad:function(){document.addEventListener("DOMContentLoaded",this.installNewSubtree.bind(this,document))},isElement:function(a){return a.nodeType===Node.ELEMENT_NODE},flattenMutationTree:function(a){var b=d(a,this.findElements,this);return b.push(f(a,this.isElement)),b.reduce(this.concatLists,[])},mutationWatcher:function(a){a.forEach(this.mutationHandler,this)},mutationHandler:function(a){if("childList"===a.type){var b=this.flattenMutationTree(a.addedNodes);b.forEach(this.addElement,this);var c=this.flattenMutationTree(a.removedNodes);c.forEach(this.removeElement,this)}else"attributes"===a.type&&this.elementChanged(a.target,a.oldValue)}},g||(b.prototype.watchSubtree=function(){console.warn("PointerEventsPolyfill: MutationObservers not found, touch-action will not be dynamically detected")}),a.Installer=b}(window.PointerEventsPolyfill),function(a){var b=a.dispatcher,c=b.pointermap,d=25,e={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup","mouseover","mouseout"],register:function(a){b.listen(a,this.events)},unregister:function(a){b.unlisten(a,this.events)},lastTouches:[],isEventSimulatedFromTouch:function(a){for(var b,c=this.lastTouches,e=a.clientX,f=a.clientY,g=0,h=c.length;h>g&&(b=c[g]);g++){var i=Math.abs(e-b.x),j=Math.abs(f-b.y);if(d>=i&&d>=j)return!0}},prepareEvent:function(a){var c=b.cloneEvent(a);return c.pointerId=this.POINTER_ID,c.isPrimary=!0,c.pointerType=this.POINTER_TYPE,c},mousedown:function(a){if(!this.isEventSimulatedFromTouch(a)){var d=c.has(this.POINTER_ID);d&&this.cancel(a);var e=this.prepareEvent(a);c.set(this.POINTER_ID,a),b.down(e)}},mousemove:function(a){if(!this.isEventSimulatedFromTouch(a)){var c=this.prepareEvent(a);b.move(c)}},mouseup:function(a){if(!this.isEventSimulatedFromTouch(a)){var d=c.get(this.POINTER_ID);if(d&&d.button===a.button){var e=this.prepareEvent(a);b.up(e),this.cleanupMouse()}}},mouseover:function(a){if(!this.isEventSimulatedFromTouch(a)){var c=this.prepareEvent(a);b.enterOver(c)}},mouseout:function(a){if(!this.isEventSimulatedFromTouch(a)){var c=this.prepareEvent(a);b.leaveOut(c)}},cancel:function(a){var c=this.prepareEvent(a);b.cancel(c),this.cleanupMouse()},cleanupMouse:function(){c.delete(this.POINTER_ID)}};a.mouseEvents=e}(window.PointerEventsPolyfill),function(a){var b,c=a.dispatcher,d=a.findTarget,e=a.targetFinding.allShadows.bind(a.targetFinding),f=c.pointermap,g=Array.prototype.map.call.bind(Array.prototype.map),h=2500,i=200,j="touch-action",k="string"==typeof document.head.style.touchAction,l={scrollType:new a.SideTable,events:["touchstart","touchmove","touchend","touchcancel"],register:function(a){k?c.listen(a,this.events):b.enableOnSubtree(a)},unregister:function(a){k&&c.unlisten(a,this.events)},elementAdded:function(a){var b=a.getAttribute(j),d=this.touchActionToScrollType(b);d&&(this.scrollType.set(a,d),c.listen(a,this.events),e(a).forEach(function(a){this.scrollType.set(a,d),c.listen(a,this.events)},this))},elementRemoved:function(a){this.scrollType.delete(a),c.unlisten(a,this.events),e(a).forEach(function(a){this.scrollType.delete(a),c.unlisten(a,this.events)},this)},elementChanged:function(a,b){var c=a.getAttribute(j),d=this.touchActionToScrollType(c),f=this.touchActionToScrollType(b);d&&f?(this.scrollType.set(a,d),e(a).forEach(function(a){this.scrollType.set(a,d)},this)):f?this.elementRemoved(a):d&&this.elementAdded(a)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(a){var b=a,c=this.scrollTypes;return"none"===b?"none":b===c.XSCROLLER?"X":b===c.YSCROLLER?"Y":c.SCROLLER.exec(b)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(a){return this.firstTouch===a.identifier},setPrimaryTouch:function(a){null===this.firstTouch&&(this.firstTouch=a.identifier,this.firstXY={X:a.clientX,Y:a.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryTouch:function(a){this.isPrimaryTouch(a)&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var a=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(a,i)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},touchToPointer:function(a){var b=c.cloneEvent(a);return b.pointerId=a.identifier+2,b.target=d(b),b.bubbles=!0,b.cancelable=!0,b.detail=this.clickCount,b.button=0,b.buttons=1,b.width=a.webkitRadiusX||a.radiusX||0,b.height=a.webkitRadiusY||a.radiusY||0,b.pressure=a.webkitForce||a.force||.5,b.isPrimary=this.isPrimaryTouch(a),b.pointerType=this.POINTER_TYPE,b},processTouches:function(a,b){var c=a.changedTouches,d=g(c,this.touchToPointer,this);d.forEach(b,this)},shouldScroll:function(a){if(this.firstXY){var b,c=this.scrollType.get(a.currentTarget);if("none"===c)b=!1;else if("XY"===c)b=!0;else{var d=a.changedTouches[0],e=c,f="Y"===c?"X":"Y",g=Math.abs(d["client"+e]-this.firstXY[e]),h=Math.abs(d["client"+f]-this.firstXY[f]);b=g>=h}return this.firstXY=null,b}},findTouch:function(a,b){for(var c,d=0,e=a.length;e>d&&(c=a[d]);d++)if(c.identifier===b)return!0},vacuumTouches:function(a){var b=a.touches;if(f.size>=b.length){var c=[];f.forEach(function(a,d){if(1!==a&&!this.findTouch(b,a-2)){var e=d.out;c.push(this.touchToPointer(e))}},this),c.forEach(this.cancelOut,this)}},touchstart:function(a){this.vacuumTouches(a),this.setPrimaryTouch(a.changedTouches[0]),this.dedupSynthMouse(a),this.scrolling||(this.clickCount++,this.processTouches(a,this.overDown))},overDown:function(a){f.set(a.pointerId,{target:a.target,out:a,outTarget:a.target}),c.over(a),c.down(a)},touchmove:function(a){this.scrolling||(this.shouldScroll(a)?(this.scrolling=!0,this.touchcancel(a)):(a.preventDefault(),this.processTouches(a,this.moveOverOut)))},moveOverOut:function(a){var b=a,d=f.get(b.pointerId);if(d){var e=d.out,g=d.outTarget;c.move(b),e&&g!==b.target&&(e.relatedTarget=b.target,b.relatedTarget=g,e.target=g,b.target?(c.leaveOut(e),c.enterOver(b)):(b.target=g,b.relatedTarget=null,this.cancelOut(b))),d.out=b,d.outTarget=b.target}},touchend:function(a){this.dedupSynthMouse(a),this.processTouches(a,this.upOut)},upOut:function(a){this.scrolling||(c.up(a),c.out(a)),this.cleanUpPointer(a)},touchcancel:function(a){this.processTouches(a,this.cancelOut)},cancelOut:function(a){c.cancel(a),c.out(a),this.cleanUpPointer(a)},cleanUpPointer:function(a){f.delete(a.pointerId),this.removePrimaryTouch(a)},dedupSynthMouse:function(b){var c=a.mouseEvents.lastTouches,d=b.changedTouches[0];if(this.isPrimaryTouch(d)){var e={x:d.clientX,y:d.clientY};c.push(e);var f=function(a,b){var c=a.indexOf(b);c>-1&&a.splice(c,1)}.bind(null,c,e);setTimeout(f,h)}}};k||(b=new a.Installer(l.elementAdded,l.elementRemoved,l.elementChanged,l)),a.touchEvents=l}(window.PointerEventsPolyfill),function(a){var b=a.dispatcher,c=b.pointermap,d=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,e={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(a){b.listen(a,this.events)},unregister:function(a){b.unlisten(a,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(a){var c=a;return d&&(c=b.cloneEvent(a),c.pointerType=this.POINTER_TYPES[a.pointerType]),c},cleanup:function(a){c.delete(a)},MSPointerDown:function(a){c.set(a.pointerId,a);var d=this.prepareEvent(a);b.down(d)},MSPointerMove:function(a){var c=this.prepareEvent(a);b.move(c)},MSPointerUp:function(a){var c=this.prepareEvent(a);b.up(c),this.cleanup(a.pointerId)},MSPointerOut:function(a){var c=this.prepareEvent(a);b.leaveOut(c)},MSPointerOver:function(a){var c=this.prepareEvent(a);b.enterOver(c)},MSPointerCancel:function(a){var c=this.prepareEvent(a);b.cancel(c),this.cleanup(a.pointerId)},MSLostPointerCapture:function(a){var c=b.makeEvent("lostpointercapture",a);b.dispatchEvent(c)},MSGotPointerCapture:function(a){var c=b.makeEvent("gotpointercapture",a);b.dispatchEvent(c)}};a.msEvents=e}(window.PointerEventsPolyfill),function(a){var b=a.dispatcher;if(void 0===window.navigator.pointerEnabled){if(Object.defineProperty(window.navigator,"pointerEnabled",{value:!0,enumerable:!0}),window.navigator.msPointerEnabled){var c=window.navigator.msMaxTouchPoints;Object.defineProperty(window.navigator,"maxTouchPoints",{value:c,enumerable:!0}),b.registerSource("ms",a.msEvents)}else b.registerSource("mouse",a.mouseEvents),void 0!==window.ontouchstart&&b.registerSource("touch",a.touchEvents);b.register(document)}}(window.PointerEventsPolyfill),function(a){function b(a){if(!e.pointermap.has(a))throw new Error("InvalidPointerId")}var c,d,e=a.dispatcher,f=window.navigator;f.msPointerEnabled?(c=function(a){b(a),this.msSetPointerCapture(a)},d=function(a){b(a),this.msReleasePointerCapture(a)}):(c=function(a){b(a),e.setCapture(a,this)},d=function(a){b(a),e.releaseCapture(a,this)}),Element.prototype.setPointerCapture||Object.defineProperties(Element.prototype,{setPointerCapture:{value:c},releasePointerCapture:{value:d}})}(window.PointerEventsPolyfill),PointerGestureEvent.prototype.preventTap=function(){this.tapPrevented=!0},function(a){a=a||{},a.utils={LCA:{find:function(a,b){if(a===b)return a;if(a.contains){if(a.contains(b))return a;if(b.contains(a))return b}var c=this.depth(a),d=this.depth(b),e=c-d;for(e>0?a=this.walk(a,e):b=this.walk(b,-e);a&&b&&a!==b;)a=this.walk(a,1),b=this.walk(b,1);return a},walk:function(a,b){for(var c=0;b>c;c++)a=a.parentNode;return a},depth:function(a){for(var b=0;a;)b++,a=a.parentNode;return b}}},a.findLCA=function(b,c){return a.utils.LCA.find(b,c)},window.PointerGestures=a}(window.PointerGestures),function(a){var b;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0)b=WeakMap;else{var c=Object.defineProperty,d=Object.hasOwnProperty,e=(new Date).getTime()%1e9;b=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")},b.prototype={set:function(a,b){c(a,this.name,{value:b,writable:!0})},get:function(a){return d.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}a.SideTable=b}(window.PointerGestures),function(a){function b(){this.ids=[],this.pointers=[]}b.prototype={set:function(a,b){var c=this.ids.indexOf(a);c>-1?this.pointers[c]=b:(this.ids.push(a),this.pointers.push(b))},has:function(a){return this.ids.indexOf(a)>-1},"delete":function(a){var b=this.ids.indexOf(a);b>-1&&(this.ids.splice(b,1),this.pointers.splice(b,1))},get:function(a){var b=this.ids.indexOf(a);return this.pointers[b]},get size(){return this.pointers.length},clear:function(){this.ids.length=0,this.pointers.length=0}},window.Map&&(b=window.Map),a.PointerMap=b}(window.PointerGestures),function(a){var b={handledEvents:new a.SideTable,targets:new a.SideTable,handlers:{},recognizers:{},events:["pointerdown","pointermove","pointerup","pointerover","pointerout","pointercancel"],registerRecognizer:function(a,b){var c=b;this.recognizers[a]=c,this.events.forEach(function(a){if(c[a]){var b=c[a].bind(c);this.addHandler(a,b)}},this)},addHandler:function(a,b){var c=a;this.handlers[c]||(this.handlers[c]=[]),this.handlers[c].push(b)},registerTarget:function(a){this.listen(this.events,a)},unregisterTarget:function(a){this.unlisten(this.events,a)},eventHandler:function(a){if(!this.handledEvents.get(a)){var b,c=a.type;(b=this.handlers[c])&&this.makeQueue(b,a),this.handledEvents.set(a,!0)}},makeQueue:function(a,b){var c=this.cloneEvent(b);setTimeout(this.runQueue.bind(this,a,c),0)},runQueue:function(a,b){this.currentPointerId=b.pointerId;for(var c,d=0,e=a.length;e>d&&(c=a[d]);d++)c(b);this.currentPointerId=0},listen:function(a,b){a.forEach(function(a){this.addEvent(a,this.boundHandler,!1,b)},this)},unlisten:function(a){a.forEach(function(a){this.removeEvent(a,this.boundHandler,!1,inTarget)},this)},addEvent:function(a,b,c,d){d.addEventListener(a,b,c)},removeEvent:function(a,b,c,d){d.removeEventListener(a,b,c)},makeEvent:function(a,b){return new PointerGestureEvent(a,b)},cloneEvent:function(a){var b={};for(var c in a)b[c]=a[c];return b},dispatchEvent:function(a,b){var c=b||this.targets.get(a);c&&(c.dispatchEvent(a),a.tapPrevented&&this.preventTap(this.currentPointerId))},asyncDispatchEvent:function(a,b){var c=function(){this.dispatchEvent(a,b)}.bind(this);setTimeout(c,0)},preventTap:function(a){var b=this.recognizers.tap;b&&b.preventTap(a)}};b.boundHandler=b.eventHandler.bind(b),a.dispatcher=b,a.register=function(b){var c=window.PointerEventsPolyfill;c&&c.register(b),a.dispatcher.registerTarget(b)},b.registerTarget(document)}(window.PointerGestures),function(a){var b=a.dispatcher,c={HOLD_DELAY:200,WIGGLE_THRESHOLD:16,events:["pointerdown","pointermove","pointerup","pointercancel"],heldPointer:null,holdJob:null,pulse:function(){var a=Date.now()-this.heldPointer.timeStamp,b=this.held?"holdpulse":"hold";this.fireHold(b,a),this.held=!0},cancel:function(){clearInterval(this.holdJob),this.held&&this.fireHold("release"),this.held=!1,this.heldPointer=null,this.target=null,this.holdJob=null},pointerdown:function(a){a.isPrimary&&!this.heldPointer&&(this.heldPointer=a,this.target=a.target,this.holdJob=setInterval(this.pulse.bind(this),this.HOLD_DELAY))},pointerup:function(a){this.heldPointer&&this.heldPointer.pointerId===a.pointerId&&this.cancel()},pointercancel:function(){this.cancel()},pointermove:function(a){if(this.heldPointer&&this.heldPointer.pointerId===a.pointerId){var b=a.clientX-this.heldPointer.clientX,c=a.clientY-this.heldPointer.clientY;b*b+c*c>this.WIGGLE_THRESHOLD&&this.cancel()}},fireHold:function(a,c){var d={pointerType:this.heldPointer.pointerType};c&&(d.holdTime=c);var e=b.makeEvent(a,d);b.dispatchEvent(e,this.target),e.tapPrevented&&b.preventTap(this.heldPointer.pointerId)}};b.registerRecognizer("hold",c)}(window.PointerGestures),function(a){var b=a.dispatcher,c=new a.PointerMap,d={events:["pointerdown","pointermove","pointerup","pointercancel"],WIGGLE_THRESHOLD:4,clampDir:function(a){return a>0?1:-1},calcPositionDelta:function(a,b){var c=0,d=0;return a&&b&&(c=b.pageX-a.pageX,d=b.pageY-a.pageY),{x:c,y:d}},fireTrack:function(a,c,d){var e=d,f=this.calcPositionDelta(e.downEvent,c),g=this.calcPositionDelta(e.lastMoveEvent,c);g.x&&(e.xDirection=this.clampDir(g.x)),g.y&&(e.yDirection=this.clampDir(g.y));var h={dx:f.x,dy:f.y,ddx:g.x,ddy:g.y,clientX:c.clientX,clientY:c.clientY,pageX:c.pageX,pageY:c.pageY,screenX:c.screenX,screenY:c.screenY,xDirection:e.xDirection,yDirection:e.yDirection,trackInfo:e.trackInfo,pointerType:c.pointerType};"trackend"===a&&(h._releaseTarget=c.target);var i=b.makeEvent(a,h);e.lastMoveEvent=c,b.dispatchEvent(i,e.downTarget)},pointerdown:function(a){if(a.isPrimary&&("mouse"===a.pointerType?1===a.buttons:!0)){var b={downEvent:a,downTarget:a.target,trackInfo:{},lastMoveEvent:null,xDirection:0,yDirection:0,tracking:!1};c.set(a.pointerId,b)}},pointermove:function(a){var b=c.get(a.pointerId);if(b)if(b.tracking)this.fireTrack("track",a,b);else{var d=this.calcPositionDelta(b.downEvent,a),e=d.x*d.x+d.y*d.y;e>this.WIGGLE_THRESHOLD&&(b.tracking=!0,this.fireTrack("trackstart",b.downEvent,b),this.fireTrack("track",a,b))}},pointerup:function(a){var b=c.get(a.pointerId);b&&(b.tracking&&this.fireTrack("trackend",a,b),c.delete(a.pointerId))},pointercancel:function(a){this.pointerup(a)}};b.registerRecognizer("track",d)}(window.PointerGestures),function(a){var b=a.dispatcher,c={MIN_VELOCITY:.5,MAX_QUEUE:4,moveQueue:[],target:null,pointerId:null,events:["pointerdown","pointermove","pointerup","pointercancel"],pointerdown:function(a){a.isPrimary&&!this.pointerId&&(this.pointerId=a.pointerId,this.target=a.target,this.addMove(a))},pointermove:function(a){a.pointerId===this.pointerId&&this.addMove(a)},pointerup:function(a){a.pointerId===this.pointerId&&this.fireFlick(a),this.cleanup()},pointercancel:function(){this.cleanup()},cleanup:function(){this.moveQueue=[],this.target=null,this.pointerId=null},addMove:function(a){this.moveQueue.length>=this.MAX_QUEUE&&this.moveQueue.shift(),this.moveQueue.push(a)},fireFlick:function(a){for(var c,d,e,f,g,h,i,j=a,k=this.moveQueue.length,l=0,m=0,n=0,o=0;k>o&&(i=this.moveQueue[o]);o++)c=j.timeStamp-i.timeStamp,d=j.clientX-i.clientX,e=j.clientY-i.clientY,f=d/c,g=e/c,h=Math.sqrt(f*f+g*g),h>n&&(l=f,m=g,n=h);var p=Math.abs(l)>Math.abs(m)?"x":"y",q=this.calcAngle(l,m);if(Math.abs(n)>=this.MIN_VELOCITY){var r=b.makeEvent("flick",{xVelocity:l,yVelocity:m,velocity:n,angle:q,majorAxis:p,pointerType:a.pointerType});b.dispatchEvent(r,this.target)}},calcAngle:function(a,b){return 180*Math.atan2(b,a)/Math.PI}};b.registerRecognizer("flick",c)}(window.PointerGestures),function(a){var b=a.dispatcher,c=new a.PointerMap,d={events:["pointerdown","pointermove","pointerup","pointercancel"],pointerdown:function(a){a.isPrimary&&!a.tapPrevented&&c.set(a.pointerId,{target:a.target,x:a.clientX,y:a.clientY})},pointermove:function(a){if(a.isPrimary){var b=c.get(a.pointerId);b&&a.tapPrevented&&c.delete(a.pointerId)}},pointerup:function(d){var e=c.get(d.pointerId);if(e&&!d.tapPrevented){var f=a.findLCA(e.target,d.target);if(f){var g=b.makeEvent("tap",{x:d.clientX,y:d.clientY,detail:d.detail,pointerType:d.pointerType});b.dispatchEvent(g,f)}}c.delete(d.pointerId)},pointercancel:function(a){c.delete(a.pointerId)},preventTap:function(a){c.delete(a)}};b.registerRecognizer("tap",d)}(window.PointerGestures),Polymer={},function(){var a=document.createElement("style");a.textContent="body {opacity: 0;}";var b=document.querySelector("head");b.insertBefore(a,b.firstChild),window.addEventListener("WebComponentsReady",function(){document.body.style.webkitTransition="opacity 0.3s",document.body.style.opacity=1})}(Polymer),function(a){function b(a,b){return a&&b&&Object.getOwnPropertyNames(b).forEach(function(c){var d=Object.getOwnPropertyDescriptor(b,c);d&&(Object.defineProperty(a,c,d),"function"==typeof d.value&&(a[c].nom=c))}),a}a.extend=b}(Polymer),function(a){function b(a,b,d){return a?a.stop():a=new c(this),a.go(b,d),a}var c=function(a){this.context=a};c.prototype={go:function(a,b){this.callback=a,this.handle=setTimeout(this.complete.bind(this),b)},stop:function(){this.handle&&(clearTimeout(this.handle),this.handle=null)},complete:function(){this.handle&&(this.stop(),this.callback.call(this.context))}},a.job=b}(Polymer),function(){var a={};HTMLElement.register=function(b,c){a[b]=c},HTMLElement.getPrototypeForTag=function(b){var c=b?a[b]:HTMLElement.prototype;return c||Object.getPrototypeOf(document.createElement(b))};var b=Event.prototype.stopPropagation;Event.prototype.stopPropagation=function(){this.cancelBubble=!0,b.apply(this,arguments)},HTMLImports.importer.preloadSelectors+=", polymer-element link[rel=stylesheet]"}(Polymer),function(a){function b(a){var c=b.caller,g=c.nom;"_super"in c||(g||(g=e.call(this,c)),g||console.warn("called super() on a method not installed declaratively (has no .nom property)"),d(c,g,f(this)));var h=c._super;if(h){var i=h[g];return"_super"in i||d(i,g,h),i.apply(this,a||[])}}function c(a,b,c){for(;a&&(!a.hasOwnProperty(b)||a[b]===c);)a=f(a);return a}function d(a,b,d){return a._super=c(d,b,a),a._super&&(a._super[b].nom=b),a._super}function e(a){console.warn("nameInThis called");for(var b=this;b&&b!==HTMLElement.prototype;){for(var c,d=Object.getOwnPropertyNames(b),e=0,f=d.length;f>e&&(c=d[e]);e++){var g=Object.getOwnPropertyDescriptor(b,c);if(g.value==a)return c}b=b.__proto__}}function f(a){return a.__proto__}a.super=b}(Polymer),function(a){function b(a,b){var d=typeof b;return b instanceof Date&&(d="date"),c[d](a,b) -}var c={string:function(a){return a},date:function(a){return new Date(Date.parse(a)||Date.now())},"boolean":function(a){return""===a?!0:"false"===a?!1:!!a},number:function(a){var b=parseFloat(a);return String(b)===a?b:a},object:function(a,b){if(null===b)return a;try{return JSON.parse(a.replace(/'/g,'"'))}catch(c){return a}}};a.deserializeValue=b}(Polymer),function(a){var b={};b.declaration={},b.instance={},a.api=b}(Polymer),function(a){var b={async:function(a,b,c){Platform.flush(),b=b&&b.length?b:[b];var d=function(){(this[a]||a).apply(this,b)}.bind(this);return c?setTimeout(d,c):requestAnimationFrame(d)},fire:function(a,b,c,d){var e=c||this;return e.dispatchEvent(new CustomEvent(a,{bubbles:void 0!==d?!1:!0,detail:b})),b},asyncFire:function(){this.asyncMethod("fire",arguments)},classFollows:function(a,b,c){b&&b.classList.remove(c),a&&a.classList.add(c)}};b.asyncMethod=b.async,a.api.instance.utils=b}(Polymer),function(a){function b(a,b){b.cancelBubble||(b.on=i+b.type,h.events&&console.group("[%s]: listenLocal [%s]",a.localName,b.on),!b.path||window.ShadowDOMPolyfill?d(a,b):c(a,b),h.events&&console.groupEnd())}function c(a,b){var c=null;Array.prototype.some.call(b.path,function(d){return d===a?!0:(c=c===a?c:e(d),c&&f(c,d,b)?!0:void 0)},this)}function d(a,b){h.events&&console.log("event.path() not supported for",b.type);for(var c=b.target,d=null;c&&c!=a;){if(d=d===a?d:e(c),d&&f(d,c,b))return!0;c=c.parentNode}}function e(a){for(;a.parentNode;)a=a.parentNode;return a.host}function f(a,b,c){var d=b.getAttribute&&b.getAttribute(c.on);return d&&g(b,c)&&(h.events&&console.log("[%s] found handler name [%s]",a.localName,d),a.dispatchMethod(b,d,[c,c.detail,b])),c.cancelBubble}function g(a,b){var c=l.get(b);return c||l.set(b,c=[]),c.indexOf(a)<0?(c.push(a),!0):void 0}var h=window.logFlags||{},i="on-",j="eventDelegates",k={EVENT_PREFIX:i,DELEGATES:j,addHostListeners:function(){var a=this[j];h.events&&Object.keys(a).length>0&&console.log("[%s] addHostListeners:",this.localName,a),this.addNodeListeners(this,a,this.hostEventListener)},addInstanceListeners:function(a,b){var c=b.delegates;c&&(h.events&&Object.keys(c).length>0&&console.log("[%s:root] addInstanceListeners:",this.localName,c),this.addNodeListeners(a,c,this.instanceEventListener))},addNodeListeners:function(a,b,c){var d;for(var e in b)d||(d=c.bind(this)),a.addEventListener(e,d)},hostEventListener:function(a){if(!a.cancelBubble){h.events&&console.group("[%s]: hostEventListener(%s)",this.localName,a.type);var b=this.findEventDelegate(a);b&&(h.events&&console.log("[%s] found host handler name [%s]",this.localName,b),this.dispatchMethod(this,b,[a,a.detail,this])),h.events&&console.groupEnd()}},findEventDelegate:function(a){return this[j][a.type]},dispatchMethod:function(a,b,c){if(a){h.events&&console.group("[%s] dispatch [%s]",a.localName,b);var d=this[b];d&&d[c?"apply":"call"](this,c),h.events&&console.groupEnd()}},instanceEventListener:function(a){b(this,a)}},l=new SideTable("handledList");a.api.instance.events=k}(Polymer),function(a){var b="__published",c="__instance_attributes",d={PUBLISHED:b,INSTANCE_ATTRIBUTES:c,copyInstanceAttributes:function(){var a=this[c];for(var b in a)this.setAttribute(b,a[b])},takeAttributes:function(){for(var a,b=0,c=this.attributes,d=c.length;(a=c[b])&&d>b;b++)this.attributeToProperty(a.name,a.value)},attributeToProperty:function(b,c){var b=this.propertyForAttribute(b);if(b){if(c.search(a.bindPattern)>=0)return;var d=this[b],c=this.deserializeValue(c,d);c!==d&&(this[b]=c)}},propertyForAttribute:function(a){var c=Object.keys(this[b]);return c[c.map(e).indexOf(a.toLowerCase())]},deserializeValue:function(b,c){return a.deserializeValue(b,c)},serializeValue:function(a){return"object"!=typeof a&&void 0!==a?a:void 0},propertyToAttribute:function(a){if(Object.keys(this[b]).indexOf(a)>=0){var c=this.serializeValue(this[a]);void 0!==c&&this.setAttribute(a,c)}}},e=String.prototype.toLowerCase.call.bind(String.prototype.toLowerCase);a.api.instance.attributes=d}(Polymer),function(a){function b(a,b){var c=this[a]||a;"function"==typeof c&&c.apply(this,b)}function c(a,b,c,d){h.bind&&console.log(o,c.localName||"object",d,a.localName,b);var e=PathObserver.getValueAtPath(c,d);return(null===e||void 0===e)&&PathObserver.setValueAtPath(c,d,a[b]),PathObserver.defineProperty(a,b,{object:c,path:d})}function d(a,b,c){var d=g(a);d[b]=c}function e(a,b){var c=g(a);return c&&c[b]?(c[b].close(),c[b]=null,!0):void 0}function f(a){var b=g(a);Object.keys(b).forEach(function(a){b[a].close(),b[a]=null})}function g(a){var b=l.get(a);return b||l.set(a,b={}),b}var h=window.logFlags||{},i="Changed",j=a.api.instance.attributes.PUBLISHED,k={observeProperties:function(){for(var a,b=this.getCustomPropertyNames(),c=0,d=b.length;d>c&&(a=b[c]);c++)this.observeProperty(a)},getCustomPropertyNames:function(){return this.customPropertyNames},observeProperty:function(a){if(this.shouldObserveProperty(a)){h.watch&&console.log(m,this.localName,a);var b=function(b,c){h.watch&&console.log(n,this.localName,this.id||"",a,this[a],c),this.dispatchPropertyChange(a,c)}.bind(this),c=new PathObserver(this,a,b);d(this,a,c)}},bindProperty:function(a,b,d){return c(this,a,b,d)},unbindProperty:function(a,b){return e(this,a,b)},unbindAllProperties:function(){f(this)},shouldObserveProperty:function(a){return Boolean(this[a+i]||Object.keys(this[j]).indexOf(a)>=0)},dispatchPropertyChange:function(a,c){this.propertyToAttribute(a),b.call(this,a+i,[c])}},l=new SideTable,m="[%s] watching [%s]",n="[%s#%s] watch: [%s] now [%s] was [%s]",o="[%s]: bindProperties: [%s] to [%s].[%s]";a.api.instance.properties=k}(Polymer),function(a){function b(a){d(a,c)}function c(a){a.unbindAll()}function d(a,b){if(a){b(a);for(var c=a.firstChild;c;c=c.nextSibling)d(c,b)}}var e=window.logFlags||0,f=new ExpressionSyntax,g={instanceTemplate:function(a){return a.createInstance(this,f)},createBinding:function(a,b,c){var d=this.propertyForAttribute(a);if(d){var e=this.bindProperty(d,b,c);return e.path=c,e}return this.super(arguments)},asyncUnbindAll:function(){this._unbound||(e.unbind&&console.log("[%s] asyncUnbindAll",this.localName),this._unbindAllJob=this.job(this._unbindAllJob,this.unbindAll,0))},unbindAll:function(){this._unbound||(this.unbindAllProperties(),this.super(),b(this.shadowRoot),this._unbound=!0)},cancelUnbindAll:function(a){return this._unbound?(e.unbind&&console.warn("[%s] already unbound, cannot cancel unbindAll",this.localName),void 0):(e.unbind&&console.log("[%s] cancelUnbindAll",this.localName),this._unbindAllJob&&(this._unbindAllJob=this._unbindAllJob.stop()),a||d(this.shadowRoot,function(a){a.cancelUnbindAll&&a.cancelUnbindAll()}),void 0)}},h=/\{\{([^{}]*)}}/;a.bindPattern=h,a.api.instance.mdv=g}(Polymer),function(a){function b(a){return a.hasOwnProperty("PolymerBase")}function c(){}var d={PolymerBase:!0,job:Polymer.job,"super":Polymer.super,ready:function(){},readyCallback:function(){this._createdCallback()},createdCallback:function(){this._createdCallback()},_createdCallback:function(){this.observeProperties(),this.copyInstanceAttributes(),this.takeAttributes(),this.addHostListeners(),this.parseElements(this.__proto__),this.ready()},insertedCallback:function(){this._enteredDocumentCallback()},enteredDocumentCallback:function(){this._enteredDocumentCallback()},_enteredDocumentCallback:function(){this.cancelUnbindAll(!0),this.inserted&&this.inserted(),this.enteredDocument&&this.enteredDocument()},removedCallback:function(){this._leftDocumentCallback()},leftDocumentCallback:function(){this._leftDocumentCallback()},_leftDocumentCallback:function(){this.asyncUnbindAll(),this.removed&&this.removed(),this.leftDocument&&this.leftDocument()},parseElements:function(a){a&&a.element&&(this.parseElements(a.__proto__),a.parseElement.call(this,a.element))},parseElement:function(a){this.shadowFromTemplate(this.fetchTemplate(a))},fetchTemplate:function(a){return a.querySelector("template")},shadowFromTemplate:function(a){if(a){this.shadowRoot;var b=this.createShadowRoot();b.applyAuthorStyles=this.applyAuthorStyles,b.resetStyleInheritance=this.resetStyleInheritance;var c=this.instanceTemplate(a);return b.appendChild(c),this.shadowRootReady(b,a),b}},shadowRootReady:function(a,b){this.marshalNodeReferences(a),this.addInstanceListeners(a,b),PointerGestures.register(a)},marshalNodeReferences:function(a){var b=this.$=this.$||{};if(a)for(var c,d=a.querySelectorAll("[id]"),e=0,f=d.length;f>e&&(c=d[e]);e++)b[c.id]=c},attributeChangedCallback:function(a){this.attributeToProperty(a,this.getAttribute(a)),this.attributeChanged&&this.attributeChanged.apply(this,arguments)}};c.prototype=d,d.constructor=c,a.Base=c,a.isBase=b,a.api.instance.base=d}(Polymer),function(a){function b(a){return a.__proto__}window.logFlags||{};var c="element",d="controller",e={STYLE_SCOPE_ATTRIBUTE:c,installControllerStyles:function(){var a=this.findStyleController();if(a&&!this.scopeHasElementStyle(a,d)){for(var c=b(this),e="";c&&c.element;)e+=c.element.cssTextForScope(d),c=b(c);if(e){var f=this.element.cssTextToScopeStyle(e,d);window.ShadowDOMPolyfill&&Platform.ShadowCSS.shimPolyfillDirectives([f],this.localName),Polymer.applyStyleToScope(f,a)}}},scopeHasElementStyle:function(a,b){var d=c+"="+this.localName+"-"+b;return a.querySelector("style["+d+"]")},findStyleController:function(){if(window.ShadowDOMPolyfill)return wrap(document.head);for(var a=this;a.parentNode;)a=a.parentNode;return a===document?document.head:a}};a.api.instance.styles=e}(Polymer),function(a){var b={addResolvePathApi:function(){var a=this.elementPath();this.prototype.resolvePath=function(b){return a+b}},elementPath:function(){return this.urlToPath(HTMLImports.getDocumentUrl(this.ownerDocument))},urlToPath:function(a){if(a){var b=a.split("/");return b.pop(),b.push(""),b.join("/")}return""}};a.api.declaration.path=b}(Polymer),function(a){function b(a,b){if(a){var d=c(a.textContent),e=a.getAttribute(g);e&&d.setAttribute(g,e),b.appendChild(d)}}function c(a){var b=document.createElement("style");return b.textContent=a,b}function d(a){return a&&a.__resource||""}function e(a,b){return n?n.call(a,b):void 0}window.logFlags||{};var f=a.api.instance.styles,g=f.STYLE_SCOPE_ATTRIBUTE,h="style",i="[rel=stylesheet]",j="global",k="polymer-scope",l={installSheets:function(){this.cacheSheets(),this.installLocalSheets(),this.installGlobalStyles()},cacheSheets:function(){this.sheets=this.findNodes(i),this.sheets.forEach(function(a){a.parentNode&&a.parentNode.removeChild(a)})},installLocalSheets:function(){var a=this.sheets.filter(function(a){return!a.hasAttribute(k)}),b=this.templateContent();if(b){var e="";a.forEach(function(a){e+=d(a)+"\n"}),e&&b.insertBefore(c(e),b.firstChild)}},findNodes:function(a,b){var c=this.querySelectorAll(a).array(),d=this.templateContent();if(d){var e=d.querySelectorAll(a).array();c=c.concat(e)}return b?c.filter(b):c},templateContent:function(){var a=this.querySelector("template");return a&&templateContent(a)},installGlobalStyles:function(){var a=this.styleForScope(j);b(a,document.head)},cssTextForScope:function(a){var b="",c="["+k+"="+a+"]",f=function(a){return e(a,c)},g=this.sheets.filter(f);g.forEach(function(a){b+=d(a)+"\n\n"});var i=this.findNodes(h,f);return i.forEach(function(a){a.parentNode.removeChild(a),b+=a.textContent+"\n\n"}),b},styleForScope:function(a){var b=this.cssTextForScope(a);return this.cssTextToScopeStyle(b,a)},cssTextToScopeStyle:function(a,b){if(a){var d=c(a);return d.setAttribute(g,this.getAttribute("name")+"-"+b),d}}},m=HTMLElement.prototype,n=m.matches||m.matchesSelector||m.webkitMatchesSelector||m.mozMatchesSelector;a.api.declaration.styles=l,a.applyStyleToScope=b}(Polymer),function(a){function b(a){return a.slice(0,k)==g}function c(a){return a.slice(k)}function d(a){return a.ref?a.ref.content:a.content}var e=a.api.instance.events,f=e.DELEGATES,g=e.EVENT_PREFIX,h=window.logFlags||{},i={inheritDelegates:function(a){this.inheritObject(a,f)},parseHostEvents:function(){var a=this.prototype[f];this.addAttributeDelegates(a)},addAttributeDelegates:function(a){for(var d,e=0;d=this.attributes[e];e++)b(d.name)&&(a[c(d.name)]=d.value)},parseLocalEvents:function(){this.querySelectorAll("template").forEach(function(a){a.delegates={},this.accumulateTemplatedEvents(a,a.delegates),h.events&&console.log("[%s] parseLocalEvents:",this.attributes.name.value,a.delegates)},this)},accumulateTemplatedEvents:function(a,b){if("template"===a.localName){var c=d(a);c&&this.accumulateChildEvents(c,b)}},accumulateChildEvents:function(a,b){a.childNodes.forEach(function(a){this.accumulateEvents(a,b)},this)},accumulateEvents:function(a,b){return this.accumulateAttributeEvents(a,b),this.accumulateChildEvents(a,b),this.accumulateTemplatedEvents(a,b),b},accumulateAttributeEvents:function(a,d){a.attributes&&a.attributes.forEach(function(a){b(a.name)&&this.accumulateEvent(c(a.name),d)},this)},accumulateEvent:function(a,b){a=j[a]||a,b[a]=b[a]||1}},j={webkitanimationstart:"webkitAnimationStart",webkitanimationend:"webkitAnimationEnd",webkittransitionend:"webkitTransitionEnd",domfocusout:"DOMFocusOut",domfocusin:"DOMFocusIn"},k=g.length;i.event_translations=j,a.api.declaration.events=i}(Polymer),function(a){var b=[],c={cacheProperties:function(){this.prototype.customPropertyNames=this.getCustomPropertyNames(this.prototype)},getCustomPropertyNames:function(c){for(var d,e={};c&&!a.isBase(c);){for(var f,g=Object.getOwnPropertyNames(c),h=0,i=g.length;i>h&&(f=g[h]);h++)e[f]=!0,d=!0;c=c.__proto__}return d?Object.keys(e):b}};a.api.declaration.properties=c}(Polymer),function(a){var b=a.api.instance.attributes,c=b.PUBLISHED,d=b.INSTANCE_ATTRIBUTES,e="publish",f="attributes",g={inheritAttributesObjects:function(a){this.inheritObject(a,c),this.inheritObject(a,d)},parseAttributes:function(){this.publishAttributes(this.prototype),this.publishProperties(this.prototype),this.accumulateInstanceAttributes()},publishAttributes:function(a){var b=a[c],d=this.getAttribute(f);if(d){var e=d.split(d.indexOf(",")>=0?",":" ");e.forEach(function(a){a=a.trim(),!a||a in b||(b[a]=null)})}Object.keys(b).forEach(function(c){c in a||(a[c]=b[c])})},publishProperties:function(a){this.publishPublish(a)},publishPublish:function(a){if(a.hasOwnProperty(e)){var b=a[e];b&&(Object.keys(b).forEach(function(c){a[c]=b[c]}),Platform.mixin(a[c],b))}},accumulateInstanceAttributes:function(){var a=this.prototype[d];this.attributes.forEach(function(b){this.isInstanceAttribute(b.name)&&(a[b.name]=b.value)},this)},isInstanceAttribute:function(a){return!this.blackList[a]&&"on-"!==a.slice(0,3)},blackList:{name:1,"extends":1,constructor:1,noscript:1}};g.blackList[f]=1,a.api.declaration.attributes=g}(Polymer),function(a){function b(a,b){h[a]=b||{},g[a]&&g[a].define()}function c(a){return Object.create(HTMLElement.getPrototypeForTag(a))}function d(b){if(!Object.__proto__){var c=Object.getPrototypeOf(b);b.__proto__=c,a.isBase(c)&&(c.__proto__=Object.getPrototypeOf(c))}}var e=Polymer.extend,f=a.api.declaration,g={},h={},i=c();e(i,{readyCallback:function(){this._createdCallback()},createdCallback:function(){this._createdCallback()},_createdCallback:function(){var a=this.getAttribute("name");h[a]?this.define():g[a]=this},define:function(){var a=this.getAttribute("name"),b=this.getAttribute("extends");this.prototype=this.generateCustomPrototype(a,b),this.prototype.element=this,this.addResolvePathApi(),d(this.prototype),this.desugar(),window.ShadowDOMPolyfill&&Platform.ShadowCSS.shimStyling(this.templateContent(),a,b),this.register(a),this.publishConstructor()},desugar:function(){this.parseAttributes(),this.parseHostEvents(),this.parseLocalEvents(),this.installSheets(),this.prototype.registerCallback&&this.prototype.registerCallback(this),this.cacheProperties()},generateCustomPrototype:function(a,b){var c=this.generateBasePrototype(b);return this.addNamedApi(c,a)},generateBasePrototype:function(a){var b=c(a);return this.ensureBaseApi(b)},ensureBaseApi:function(b){return b.PolymerBase||(Object.keys(a.api.instance).forEach(function(c){e(b,a.api.instance[c])}),b=Object.create(b)),this.inheritAttributesObjects(b),this.inheritDelegates(b),b},addNamedApi:function(a,b){return e(a,h[b])},inheritObject:function(a,b){a[b]=e({},Object.getPrototypeOf(a)[b])},register:function(a){this.ctor=document.register(a,{prototype:this.prototype}),this.prototype.constructor=this.ctor,HTMLElement.register(a,this.prototype)},publishConstructor:function(){var a=this.getAttribute("constructor");a&&(window[a]=this.ctor)}}),Object.keys(f).forEach(function(a){e(i,f[a])}),document.register("polymer-element",{prototype:i}),e(b,window.Polymer),window.Polymer=b}(Polymer),Polymer.register=function(a){if(a!=window){var b=a.getAttribute("name");throw new Error("Polymer.register is deprecated in declaration of "+b+". Please see http://www.polymer-project.org/getting-started.html")}}; -/* -//@ sourceMappingURL=polymer.native.min.js.map -*/ \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/polymer/polymer.sandbox.min.js b/architecture-examples/polymer/bower_components/polymer/polymer.sandbox.min.js deleted file mode 100644 index 387e843dc8..0000000000 --- a/architecture-examples/polymer/bower_components/polymer/polymer.sandbox.min.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2012 The Polymer Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -function PointerGestureEvent(a,b){var c=b||{},d=document.createEvent("Event"),e={bubbles:!0,cancelable:!0};return Object.keys(e).forEach(function(a){a in c&&(e[a]=c[a])}),d.initEvent(a,e.bubbles,e.cancelable),Object.keys(c).forEach(function(a){d[a]=b[a]}),d.preventTap=this.preventTap,d}if(window.Platform=window.Platform||{},window.logFlags=window.logFlags||{},function(a){var b=a.flags||{};location.search.slice(1).split("&").forEach(function(a){a=a.split("="),a[0]&&(b[a[0]]=a[1]||!0)}),b.shadow=(b.shadowdom||b.shadow||b.polyfill||!HTMLElement.prototype.webkitCreateShadowRoot)&&"polyfill",a.flags=b}(Platform),"polyfill"===Platform.flags.shadow){var SideTable;"undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0?SideTable=WeakMap:function(){var a=Object.defineProperty,b=Object.hasOwnProperty,c=(new Date).getTime()%1e9;SideTable=function(){this.name="__st"+(1e9*Math.random()>>>0)+(c++ +"__")},SideTable.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}();var ShadowDOMPolyfill={};!function(a){"use strict";function b(a){if(!a)throw new Error("Assertion failed")}function c(a,b){return Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))}),a}function d(a,b){return Object.getOwnPropertyNames(b).forEach(function(c){switch(c){case"arguments":case"caller":case"length":case"name":case"prototype":case"toString":return}Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))}),a}function e(a){var b=a.__proto__||Object.getPrototypeOf(a),c=z.get(b);if(c)return c;var d=e(b),f=n(d);return k(b,f,a),f}function f(a,b){i(a,b,!0)}function g(a,b){i(b,a,!1)}function h(a){return/^on[a-z]+$/.test(a)}function i(b,c,d){Object.getOwnPropertyNames(b).forEach(function(e){if(!(e in c)){B&&b.__lookupGetter__(e);var f;try{f=Object.getOwnPropertyDescriptor(b,e)}catch(g){f=C}var i,j;if(d&&"function"==typeof f.value)return c[e]=function(){return this.impl[e].apply(this.impl,arguments)},void 0;var k=h(e);i=k?a.getEventHandlerGetter(e):function(){return this.impl[e]},(f.writable||f.set)&&(j=k?a.getEventHandlerSetter(e):function(a){this.impl[e]=a}),Object.defineProperty(c,e,{get:i,set:j,configurable:f.configurable,enumerable:f.enumerable})}})}function j(a,b,c){var e=a.prototype;k(e,b,c),d(b,a)}function k(a,c,d){var e=c.prototype;b(void 0===z.get(a)),z.set(a,c),f(a,e),d&&g(e,d)}function l(a,b){return z.get(b.prototype)===a}function m(a){var b=Object.getPrototypeOf(a),c=e(b),d=n(c);return k(b,d,a),d}function n(a){function b(b){a.call(this,b)}return b.prototype=Object.create(a.prototype),b.prototype.constructor=b,b}function o(a){return a instanceof A.EventTarget||a instanceof A.Event||a instanceof A.DOMImplementation}function p(a){return a instanceof F||a instanceof E||a instanceof G||a instanceof D}function q(a){if(null===a)return null;b(p(a));var c=y.get(a);if(!c){var d=e(a);c=new d(a),y.set(a,c)}return c}function r(a){return null===a?null:(b(o(a)),a.impl)}function s(a){return a&&o(a)?r(a):a}function t(a){return a&&!o(a)?q(a):a}function u(a,c){null!==c&&(b(p(a)),b(void 0===c||o(c)),y.set(a,c))}function v(a,b,c){Object.defineProperty(a.prototype,b,{get:c,configurable:!0,enumerable:!0})}function w(a,b){v(a,b,function(){return q(this.impl[b])})}function x(a,b){a.forEach(function(a){b.forEach(function(b){a.prototype[b]=function(){var a=q(this);return a[b].apply(a,arguments)}})})}var y=new SideTable,z=new SideTable,A=Object.create(null);Object.getOwnPropertyNames(window);var B=/Firefox/.test(navigator.userAgent),C={get:function(){},set:function(){},configurable:!0,enumerable:!0},D=DOMImplementation,E=Event,F=Node,G=Window;a.assert=b,a.defineGetter=v,a.defineWrapGetter=w,a.forwardMethodsToWrapper=x,a.isWrapperFor=l,a.mixin=c,a.registerObject=m,a.registerWrapper=j,a.rewrap=u,a.unwrap=r,a.unwrapIfNeeded=s,a.wrap=q,a.wrapIfNeeded=t,a.wrappers=A}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){return a instanceof N.ShadowRoot}function c(a){var b=a.localName;return"content"===b||"shadow"===b}function d(a){return!!a.shadowRoot}function e(a){var b;return a.parentNode||(b=a.defaultView)&&M(b)||null}function f(f,g,h){if(h.length)return h.shift();if(b(f))return j(f)||a.getHostForShadowRoot(f);var i=a.eventParentsTable.get(f);if(i){for(var k=1;k=0;b--)if(!c(a[b]))return a[b];return null}function i(d,e){for(var g=[];d;){for(var i=[],j=e,l=void 0;j;){var n=null;if(i.length){if(c(j)&&(n=h(i),k(l))){var o=i[i.length-1];i.push(o)}}else i.push(j);if(m(j,d))return i[i.length-1];b(j)&&i.pop(),l=j,j=f(j,n,g)}d=b(d)?a.getHostForShadowRoot(d):d.parentNode}}function j(b){return a.insertionParentTable.get(b)}function k(a){return j(a)}function l(a){for(var b;b=a.parentNode;)a=b;return a}function m(a,b){return l(a)===l(b)}function n(b,c){if(b===c)return!0;if(b instanceof N.ShadowRoot){var d=a.getHostForShadowRoot(b);return d?n(l(d),c):!1}return!1}function o(a){switch(a){case"DOMAttrModified":case"DOMAttributeNameChanged":case"DOMCharacterDataModified":case"DOMElementNameChanged":case"DOMNodeInserted":case"DOMNodeInsertedIntoDocument":case"DOMNodeRemoved":case"DOMNodeRemovedFromDocument":case"DOMSubtreeModified":return!0}return!1}function p(b){if(!P.get(b)){P.set(b,!0),o(b.type)||a.renderAllPending();var c=M(b.target),d=M(b);return q(d,c)}}function q(a,b){var c=g(b);return"load"===a.type&&2===c.length&&c[0].target instanceof N.Document&&c.shift(),X.set(a,c),r(a,c)&&s(a,c)&&t(a,c),T.set(a,w.NONE),R.set(a,null),a.defaultPrevented}function r(a,b){for(var c,d=b.length-1;d>0;d--){var e=b[d].target,f=b[d].currentTarget;if(e!==f&&(c=w.CAPTURING_PHASE,!u(b[d],a,c)))return!1}return!0}function s(a,b){var c=w.AT_TARGET;return u(b[0],a,c)}function t(a,b){for(var c,d=a.bubbles,e=1;e=f;f++){var g=b[f].currentTarget,h=l(g);n(e,h)&&(f!==d||g instanceof N.Node)&&(a[c++]=g)}a.length=c}return a},stopPropagation:function(){U.set(this,!0)},stopImmediatePropagation:function(){U.set(this,!0),V.set(this,!0)}},K(Y,w,document.createEvent("Event"));var Z=y("UIEvent",w),$=y("CustomEvent",w),_={get relatedTarget(){return S.get(this)||M(L(this).relatedTarget)}},ab=J({initMouseEvent:z("initMouseEvent",14)},_),bb=J({initFocusEvent:z("initFocusEvent",5)},_),cb=y("MouseEvent",Z,ab),db=y("FocusEvent",Z,bb),eb=y("MutationEvent",w,{initMutationEvent:z("initMutationEvent",3),get relatedNode(){return M(this.impl.relatedNode)}}),fb=Object.create(null),gb=function(){try{new window.MouseEvent("click")}catch(a){return!1}return!0}();if(!gb){var hb=function(a,b,c){if(c){var d=fb[c];b=J(J({},d),b)}fb[a]=b};hb("Event",{bubbles:!1,cancelable:!1}),hb("CustomEvent",{detail:null},"Event"),hb("UIEvent",{view:null,detail:0},"Event"),hb("MouseEvent",{screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null},"UIEvent"),hb("FocusEvent",{relatedTarget:null},"UIEvent")}var ib=window.EventTarget,jb=["addEventListener","removeEventListener","dispatchEvent"];[Node,Window].forEach(function(a){var b=a.prototype;jb.forEach(function(a){Object.defineProperty(b,a+"_",{value:b[a]})})}),C.prototype={addEventListener:function(a,b,c){if(B(b)){var d=new v(a,b,c),e=O.get(this);if(e){for(var f=0;fd;d++)b[d]=f(a[d]);return b.length=e,b}function e(a,b){a.prototype[b]=function(){return d(this.impl[b].apply(this.impl,arguments))}}var f=a.wrap;c.prototype={item:function(a){return this[a]}},b(c.prototype,"item"),a.wrappers.NodeList=c,a.addWrapNodeListMethod=e,a.wrapNodeList=d}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){j(a instanceof f)}function c(a,b,c,d){if(a.nodeType!==f.DOCUMENT_FRAGMENT_NODE)return a.parentNode&&a.parentNode.removeChild(a),a.parentNode_=b,a.previousSibling_=c,a.nextSibling_=d,c&&(c.nextSibling_=a),d&&(d.previousSibling_=a),[a];for(var e,g=[];e=a.firstChild;)a.removeChild(e),g.push(e),e.parentNode_=b;for(var h=0;he;e++)d.appendChild(m(b[e]));return d}function e(a){for(var b=a.firstChild;b;){j(b.parentNode===a);var c=b.nextSibling,d=m(b),e=d.parentNode;e&&s.call(e,d),b.previousSibling_=b.nextSibling_=b.parentNode_=null,b=c}a.firstChild_=a.lastChild_=null}function f(a){j(a instanceof o),g.call(this,a),this.parentNode_=void 0,this.firstChild_=void 0,this.lastChild_=void 0,this.nextSibling_=void 0,this.previousSibling_=void 0}var g=a.wrappers.EventTarget,h=a.wrappers.NodeList,i=a.defineWrapGetter,j=a.assert,k=a.mixin,l=a.registerWrapper,m=a.unwrap,n=a.wrap,o=window.Node,p=o.prototype.appendChild,q=o.prototype.insertBefore,r=o.prototype.replaceChild,s=o.prototype.removeChild,t=o.prototype.compareDocumentPosition;f.prototype=Object.create(g.prototype),k(f.prototype,{appendChild:function(a){b(a),this.invalidateShadowRenderer();var e=this.lastChild,f=null,g=c(a,this,e,f);return this.lastChild_=g[g.length-1],e||(this.firstChild_=g[0]),p.call(this.impl,d(this,g)),a},insertBefore:function(a,e){if(!e)return this.appendChild(a);b(a),b(e),j(e.parentNode===this),this.invalidateShadowRenderer();var f=e.previousSibling,g=e,h=c(a,this,f,g);this.firstChild===e&&(this.firstChild_=h[0]);var i=m(e),k=i.parentNode;return k&&q.call(k,d(this,h),i),a},removeChild:function(a){if(b(a),a.parentNode!==this)throw new Error("NotFoundError");this.invalidateShadowRenderer();var c=this.firstChild,d=this.lastChild,e=a.nextSibling,f=a.previousSibling,g=m(a),h=g.parentNode;return h&&s.call(h,g),c===a&&(this.firstChild_=e),d===a&&(this.lastChild_=f),f&&(f.nextSibling_=e),e&&(e.previousSibling_=f),a.previousSibling_=a.nextSibling_=a.parentNode_=null,a},replaceChild:function(a,e){if(b(a),b(e),e.parentNode!==this)throw new Error("NotFoundError");this.invalidateShadowRenderer();var f=e.previousSibling,g=e.nextSibling;g===a&&(g=a.nextSibling);var h=c(a,this,f,g);this.firstChild===e&&(this.firstChild_=h[0]),this.lastChild===e&&(this.lastChild_=h[h.length-1]),e.previousSibling_=null,e.nextSibling_=null,e.parentNode_=null;var i=m(e);return i.parentNode&&r.call(i.parentNode,d(this,h),i),e},hasChildNodes:function(){return null===this.firstChild},get parentNode(){return void 0!==this.parentNode_?this.parentNode_:n(this.impl.parentNode)},get firstChild(){return void 0!==this.firstChild_?this.firstChild_:n(this.impl.firstChild)},get lastChild(){return void 0!==this.lastChild_?this.lastChild_:n(this.impl.lastChild)},get nextSibling(){return void 0!==this.nextSibling_?this.nextSibling_:n(this.impl.nextSibling)},get previousSibling(){return void 0!==this.previousSibling_?this.previousSibling_:n(this.impl.previousSibling)},get parentElement(){for(var a=this.parentNode;a&&a.nodeType!==f.ELEMENT_NODE;)a=a.parentNode;return a},get textContent(){for(var a="",b=this.firstChild;b;b=b.nextSibling)a+=b.textContent;return a},set textContent(a){if(e(this),this.invalidateShadowRenderer(),""!==a){var b=this.impl.ownerDocument.createTextNode(a);this.appendChild(b)}},get childNodes(){for(var a=new h,b=0,c=this.firstChild;c;c=c.nextSibling)a[b++]=c;return a.length=b,a},cloneNode:function(a){if(!this.invalidateShadowRenderer())return n(this.impl.cloneNode(a));var b=n(this.impl.cloneNode(!1));if(a)for(var c=this.firstChild;c;c=c.nextSibling)b.appendChild(c.cloneNode(!0));return b},contains:function(a){if(!a)return!1;if(a===this)return!0;var b=a.parentNode;return b?this.contains(b):!1},compareDocumentPosition:function(a){return t.call(this.impl,m(a))}}),i(f,"ownerDocument"),l(o,f,document.createDocumentFragment()),delete f.prototype.querySelector,delete f.prototype.querySelectorAll,f.prototype=k(Object.create(g.prototype),f.prototype),a.wrappers.Node=f}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a,c){for(var d,e=a.firstElementChild;e;){if(e.matches(c))return e;if(d=b(e,c))return d;e=e.nextElementSibling}return null}function c(a,b,d){for(var e=a.firstElementChild;e;)e.matches(b)&&(d[d.length++]=e),c(e,b,d),e=e.nextElementSibling;return d}var d={querySelector:function(a){return b(this,a)},querySelectorAll:function(a){return c(this,a,new NodeList)}},e={getElementsByTagName:function(a){return this.querySelectorAll(a)},getElementsByClassName:function(a){return this.querySelectorAll("."+a)},getElementsByTagNameNS:function(a,b){if("*"===a)return this.getElementsByTagName(b);for(var c=new NodeList,d=this.getElementsByTagName(b),e=0,f=0;e";case Node.TEXT_NODE:return c(a.nodeValue);case Node.COMMENT_NODE:return"";default:throw console.error(a),new Error("not implemented")}}function e(a){for(var b="",c=a.firstChild;c;c=c.nextSibling)b+=d(c);return b}function f(a,b,c){var d=c||"div";a.textContent="";var e=n(a.ownerDocument.createElement(d));e.innerHTML=b;for(var f;f=e.firstChild;)a.appendChild(o(f))}function g(a){j.call(this,a)}function h(b){k(g,b,function(){return a.renderAllPending(),this.impl[b]})}function i(b){Object.defineProperty(g.prototype,b,{value:function(){return a.renderAllPending(),this.impl[b].apply(this.impl,arguments)},configurable:!0,enumerable:!0})}var j=a.wrappers.Element,k=a.defineGetter,l=a.mixin,m=a.registerWrapper,n=a.unwrap,o=a.wrap,p=/&|<|"/g,q={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},r=window.HTMLElement;g.prototype=Object.create(j.prototype),l(g.prototype,{get innerHTML(){return e(this)},set innerHTML(a){f(this,a,this.tagName)},get outerHTML(){return d(this)},set outerHTML(a){if(this.invalidateShadowRenderer())throw new Error("not implemented");this.impl.outerHTML=a}}),["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetTop","offsetWidth","scrollHeight","scrollLeft","scrollTop","scrollWidth"].forEach(h),["getBoundingClientRect","getClientRects","scrollIntoView"].forEach(i),m(r,g,document.createElement("b")),a.wrappers.HTMLElement=g,a.getInnerHTML=e,a.setInnerHTML=f}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=window.HTMLContentElement;b.prototype=Object.create(c.prototype),d(b.prototype,{get select(){return this.getAttribute("select")},set select(a){this.setAttribute("select",a)},setAttribute:function(a,b){c.prototype.setAttribute.call(this,a,b),"select"===String(a).toLowerCase()&&this.invalidateShadowRenderer(!0)}}),f&&e(f,b),a.wrappers.HTMLContentElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=window.HTMLShadowElement;b.prototype=Object.create(c.prototype),d(b.prototype,{invalidateShadowRenderer:function(){c.prototype.invalidateShadowRenderer.call(this,!0)}}),f&&e(f,b),a.wrappers.HTMLShadowElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){if(!a.defaultView)return a;var b=l.get(a);if(!b){for(b=a.implementation.createHTMLDocument("");b.lastChild;)b.removeChild(b.lastChild);l.set(a,b)}return b}function c(a){for(var c,d=b(a.ownerDocument),e=d.createDocumentFragment();c=a.firstChild;)e.appendChild(c);return e}function d(a){e.call(this,a)}var e=a.wrappers.HTMLElement,f=a.getInnerHTML,g=a.mixin,h=a.registerWrapper,i=a.setInnerHTML,j=a.wrap,k=new SideTable,l=new SideTable,m=window.HTMLTemplateElement;d.prototype=Object.create(e.prototype),g(d.prototype,{get content(){if(m)return j(this.impl.content);var a=k.get(this);return a||(a=c(this),k.set(this,a)),a},get innerHTML(){return f(this.content)},set innerHTML(a){i(this.content,a),this.invalidateShadowRenderer()}}),m&&h(m,d),a.wrappers.HTMLTemplateElement=d}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){switch(a.localName){case"content":return new c(a);case"shadow":return new e(a);case"template":return new f(a)}d.call(this,a)}var c=a.wrappers.HTMLContentElement,d=a.wrappers.HTMLElement,e=a.wrappers.HTMLShadowElement,f=a.wrappers.HTMLTemplateElement;a.mixin;var g=a.registerWrapper,h=window.HTMLUnknownElement;b.prototype=Object.create(d.prototype),g(h,b),a.wrappers.HTMLUnknownElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";var b=a.GetElementsByInterface,c=a.ParentNodeInterface,d=a.SelectorsInterface,e=a.mixin,f=a.registerObject,g=f(document.createDocumentFragment());e(g.prototype,c),e(g.prototype,d),e(g.prototype,b);var h=f(document.createTextNode("")),i=f(document.createComment(""));a.wrappers.Comment=i,a.wrappers.DocumentFragment=g,a.wrappers.Text=h}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){var b=i(a.impl.ownerDocument.createDocumentFragment());c.call(this,b),g(b,this);var d=a.shadowRoot;k.set(this,d),j.set(this,a)}var c=a.wrappers.DocumentFragment,d=a.elementFromPoint,e=a.getInnerHTML,f=a.mixin,g=a.rewrap,h=a.setInnerHTML,i=a.unwrap,j=new SideTable,k=new SideTable;b.prototype=Object.create(c.prototype),f(b.prototype,{get innerHTML(){return e(this)},set innerHTML(a){h(this,a),this.invalidateShadowRenderer()},get olderShadowRoot(){return k.get(this)||null},invalidateShadowRenderer:function(){return j.get(this).invalidateShadowRenderer()},elementFromPoint:function(a,b){return d(this,this.ownerDocument,a,b)},getElementById:function(a){return this.querySelector("#"+a)}}),a.wrappers.ShadowRoot=b,a.getHostForShadowRoot=function(a){return j.get(a)}}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){a.previousSibling_=a.previousSibling,a.nextSibling_=a.nextSibling,a.parentNode_=a.parentNode}function c(a){a.firstChild_=a.firstChild,a.lastChild_=a.lastChild}function d(a){D(a instanceof C);for(var d=a.firstChild;d;d=d.nextSibling)b(d);c(a)}function e(a){var b=F(a);d(a),b.textContent=""}function f(a,c){var e=F(a),f=F(c);f.nodeType===C.DOCUMENT_FRAGMENT_NODE?d(c):(h(c),b(c)),a.lastChild_=a.lastChild,a.lastChild===a.firstChild&&(a.firstChild_=a.firstChild);var g=G(e.lastChild);g&&(g.nextSibling_=g.nextSibling),e.appendChild(f)}function g(a,c){var d=F(a),e=F(c);b(c),c.previousSibling&&(c.previousSibling.nextSibling_=c),c.nextSibling&&(c.nextSibling.previousSibling_=c),a.lastChild===c&&(a.lastChild_=c),a.firstChild===c&&(a.firstChild_=c),d.removeChild(e)}function h(a){var b=F(a),c=b.parentNode;c&&g(G(c),a)}function i(a,b){k(b).push(a),z(a,b);var c=I.get(a);c||I.set(a,c=[]),c.push(b)}function j(a){H.set(a,[])}function k(a){return H.get(a)}function l(a){for(var b=[],c=0,d=a.firstChild;d;d=d.nextSibling)b[c++]=d;return b}function m(a,b,c){for(var d=l(a),e=0;e","+","~"],d=a,e="["+b+"]";return c.forEach(function(a){var b=d.split(a);d=b.map(function(a){var b=a.trim();return b&&c.indexOf(b)<0&&b.indexOf(e)<0&&(a=b.replace(/([^:]*)(:*)(.*)/,"$1"+e+"$2$3")),a}).join(a)}),d},propertiesFromRule:function(a){var b=a.style.cssText;return a.style.content&&!a.style.content.match(/['"]+/)&&(b="content: '"+a.style.content+"';\n"+a.style.cssText.replace(/content:[^;]*;/g,"")),b}},i=/@host[^{]*{(([^}]*?{[^{]*?}[\s\S]*?)+)}/gim,j=/([^{]*)({[\s\S]*?})/gim,k=/(.*)((?:\*)|(?:\:scope))(.*)/,l=/^[.\[:]/,m=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,n=/\/\*\s*@polyfill ([^*]*\*+([^/*][^*]*\*+)*\/)([^{]*?){/gim,o=/::(x-[^\s{,(]*)/gim,p="([>\\s~+[.,{:][\\s\\S]*)?$",q=/@host/gim;if(window.ShadowDOMPolyfill){e("style { display: none !important; }\n");var r=document.querySelector("head");r.insertBefore(f(),r.childNodes[0])}a.ShadowCSS=h}(window.Platform)}else{var SideTable;"undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0?SideTable=WeakMap:function(){var a=Object.defineProperty,b=Object.hasOwnProperty,c=(new Date).getTime()%1e9;SideTable=function(){this.name="__st"+(1e9*Math.random()>>>0)+(c++ +"__")},SideTable.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}(),function(){window.templateContent=window.templateContent||function(a){return a.content},window.wrap=window.unwrap=function(a){return a};var a=HTMLElement.prototype.webkitCreateShadowRoot;HTMLElement.prototype.webkitCreateShadowRoot=function(){var b=this.webkitShadowRoot,c=a.call(this);return c.olderShadowRoot=b,c.host=this,CustomElements.watchShadow(this),c},Object.defineProperties(HTMLElement.prototype,{shadowRoot:{get:function(){return this.webkitShadowRoot}},createShadowRoot:{value:function(){return this.webkitCreateShadowRoot()}}}),window.templateContent=function(a){if(window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(a),!a.content&&!a._content){for(var b=document.createDocumentFragment();a.firstChild;)b.appendChild(a.firstChild);a._content=b}return a.content||a._content}}()}if(function(a){function b(a){for(var b=a||{},d=1;d",""," "," ShadowDOM Inspector"," "," "," ",'
    ',"
",'
'," ",""].join("\n"),d=[],e=function(){var a=b.document,c=a.querySelector("#crumbs");c.textContent="";for(var e,g=0;e=d[g];g++){var h=a.createElement("a");h.href="#",h.textContent=e.localName,h.idx=g,h.onclick=function(a){for(var b;d.length>this.idx;)b=d.pop();f(b.shadow||b,b),a.preventDefault()},c.appendChild(a.createElement("li")).appendChild(h)}},f=function(a,c){var f=b.document;k=[];var g=c||a;d.push(g),e(),f.body.querySelector("#tree").innerHTML="
"+j(a,a.childNodes)+"
"},g=Array.prototype.forEach.call.bind(Array.prototype.forEach),h={STYLE:1,SCRIPT:1,"#comment":1,TEMPLATE:1},i=function(a){return h[a.nodeName]},j=function(a,b,c){if(i(a))return"";var d=c||"";if(a.localName||11==a.nodeType){var e=a.localName||"shadow-root",f=d+l(a);"content"==e&&(b=a.getDistributedNodes()),f+="
";var h=d+"  ";g(b,function(a){f+=j(a,a.childNodes,h)}),f+=d,{br:1}[e]||(f+="</"+e+">",f+="
")}else{var k=a.textContent.trim();f=k?d+'"'+k+'"'+"
":""}return f},k=[],l=function(a){var b="<",c=a.localName||"shadow-root";return a.webkitShadowRoot||a.shadowRoot?(b+=' ",k.push(a)):b+=c||"shadow-root",a.attributes&&g(a.attributes,function(a){b+=" "+a.name+(a.value?'="'+a.value+'"':"")}),b+=">"};shadowize=function(){var a=Number(this.attributes.idx.value),b=k[a];b?f(b.webkitShadowRoot||b.shadowRoot,b):(console.log("bad shadowize node"),console.dir(this))},a.output=j}(window.Inspector),function(a){"use strict";function b(){function a(a){"splice"===a[0].type&&"splice"===a[1].type&&(b=!0)}if("function"!=typeof Object.observe||"function"!=typeof Array.observe)return!1;var b=!1,c=[0];return Array.observe(c,a),c[1]=1,c.length=0,Object.deliverChangeRecords(a),b}function c(a){return+a===a>>>0}function d(a){return+a}function e(a){return a===Object(a)}function f(a,b){return a===b?0!==a||1/a===1/b:K(a)&&K(b)?!0:a!==a&&b!==b}function g(a){return"string"!=typeof a?!1:(a=a.replace(/\s/g,""),""==a?!0:"."==a[0]?!1:S.test(a))}function h(a){var b=T[a];if(b)return b;if(g(a)){var b=new i(a);return T[a]=b,b}}function i(a){return""==a.trim()?this:c(a)?(this.push(String(a)),this):(a.split(/\./).filter(function(a){return a}).forEach(function(a){this.push(a)},this),H&&this.length&&(this.getValueFrom=this.compiledGetValueFromFn()),void 0)}function j(a){for(var b=0;U>b&&a.check();)a.report(),b++}function k(a){for(var b in a)return!1;return!0}function l(a){return k(a.added)&&k(a.removed)&&k(a.changed)}function m(a,b){var c={},d={},e={};for(var f in b){var g=a[f];(void 0===g||g!==b[f])&&(f in a?g!==b[f]&&(e[f]=g):d[f]=void 0)}for(var f in a)f in b||(c[f]=a[f]);return Array.isArray(a)&&a.length!==b.length&&(e.length=a.length),{added:c,removed:d,changed:e}}function n(a,b){var c=b||(Array.isArray(a)?[]:{});for(var d in a)c[d]=a[d];return Array.isArray(a)&&(c.length=a.length),c}function o(a,b,c,d){if(this.closed=!1,this.object=a,this.callback=b,this.target=c,this.token=d,this.reporting=!0,G){var e=this;this.boundInternalCallback=function(a){e.internalCallback(a)}}p(this),this.connect(),this.sync(!0)}function p(a){W&&(V.push(a),o._allObserversCount++)}function q(a,b,c,d){o.call(this,a,b,c,d)}function r(a,b,c,d){if(!Array.isArray(a))throw Error("Provided object is not an Array");o.call(this,a,b,c,d)}function s(a){this.arr=[],this.callback=a,this.isObserved=!0}function t(a,b,c,d,f){this.value=void 0;var g=h(b);return g?g.length?e(a)?(this.path=g,o.call(this,a,c,d,f),void 0):(this.closed=!0,this.value=void 0,void 0):(this.closed=!0,this.value=a,void 0):(this.closed=!0,this.value=void 0,void 0)}function u(a,b){if("function"==typeof Object.observe){var c=Object.getNotifier(a);return function(d,e){var f={object:a,type:d,name:b};2===arguments.length&&(f.oldValue=e),c.notify(f)}}}function v(a,b,c){for(var d={},e={},f=0;fj;j++)i[j]=new Array(h),i[j][0]=j;for(var k=0;h>k;k++)i[0][k]=k;for(var j=1;g>j;j++)for(var k=1;h>k;k++)if(d[e+j-1]===a[b+k-1])i[j][k]=i[j-1][k-1];else{var l=i[j-1][k]+1,m=i[j][k-1]+1;i[j][k]=m>l?l:m}return i}function x(a){for(var b=a.length-1,c=a[0].length-1,d=a[b][c],e=[];b>0||c>0;)if(0!=b)if(0!=c){var f,g=a[b-1][c-1],h=a[b-1][c],i=a[b][c-1];f=i>h?g>h?h:g:g>i?i:g,f==g?(g==d?e.push(ab):(e.push(bb),d=g),b--,c--):f==h?(e.push(db),b--,d=h):(e.push(cb),c--,d=i)}else e.push(db),b--;else e.push(cb),c--;return e.reverse(),e}function y(a,b,c){for(var d=0;c>d;d++)if(a[d]!==b[d])return d;return c}function z(a,b,c){for(var d=a.length,e=b.length,f=0;c>f&&a[--d]===b[--e];)f++;return f}function A(a,b,c){return{index:a,removed:b,addedCount:c}}function B(a,b,c,d,e,f){var g=0,h=0,i=Math.min(c-b,f-e);if(0==b&&0==e&&(g=y(a,d,i)),c==a.length&&f==d.length&&(h=z(a,d,i-g)),b+=g,e+=g,c-=h,f-=h,0==c-b&&0==f-e)return[];if(b==c){for(var j=A(b,[],0);f>e;)j.removed.push(d[e++]);return[j]}if(e==f)return[A(b,[],c-b)];for(var k=x(w(a,b,c,d,e,f)),j=void 0,l=[],m=b,n=e,o=0;ob||a>d?-1:b==c||d==a?0:c>a?d>b?b-c:d-c:b>d?d-a:b-a}function D(a,b,c,d){for(var e=A(b,c,d),f=!1,g=0,h=0;h=0){a.splice(h,1),h--,g-=i.addedCount-i.removed.length,e.addedCount+=i.addedCount-j;var k=e.removed.length+i.removed.length-j;if(e.addedCount||k){var c=i.removed;if(e.indexi.index+i.addedCount){var m=e.removed.slice(i.index+i.addedCount-e.index);Array.prototype.push.apply(c,m)}e.removed=c,i.indexh)continue;D(e,h,[g.oldValue],1);break;default:console.error("Unexpected record type: "+JSON.stringify(g))}}return e}function F(a,b){var c=[];return E(a,b).forEach(function(b){return 1==b.addedCount&&1==b.removed.length?(b.removed[0]!==a[b.index]&&c.push(b),void 0):(c=c.concat(B(a,b.index,b.index+b.addedCount,b.removed,0,b.removed.length)),void 0)}),c}var G=b(),H=!1;try{var I=new Function("","return true;");H=I()}catch(J){}var K=a.Number.isNaN||function(b){return"number"==typeof b&&a.isNaN(b)},L="__proto__"in{}?function(a){return a}:function(a){var b=a.__proto__;if(!b)return a;var c=Object.create(b);return Object.getOwnPropertyNames(a).forEach(function(b){Object.defineProperty(c,b,Object.getOwnPropertyDescriptor(a,b))}),c},M="[$_a-zA-Z]",N="[$_a-zA-Z0-9]",O=M+"+"+N+"*",P="(?:[0-9]|[1-9]+[0-9]+)",Q="(?:"+O+"|"+P+")",R="(?:"+Q+")(?:\\."+Q+")*",S=new RegExp("^"+R+"$"),T={};i.prototype=L({__proto__:[],toString:function(){return this.join(".")},getValueFrom:function(a){for(var b=0;ba&&b.anyChanged);o._allObserversCount=V.length,X=!1}}},W&&(a.Platform.clearObservers=function(){V=[]}),q.prototype=L({__proto__:o.prototype,connect:function(){G&&Object.observe(this.object,this.boundInternalCallback)},sync:function(){G||(this.oldObject=n(this.object))},check:function(a){var b,c;if(G){if(!a)return!1;c={},b=v(this.object,a,c)}else c=this.oldObject,b=m(this.object,this.oldObject);return l(b)?!1:(this.reportArgs=[b.added||{},b.removed||{},b.changed||{}],this.reportArgs.push(function(a){return c[a]}),!0)},disconnect:function(){G?this.object&&Object.unobserve(this.object,this.boundInternalCallback):this.oldObject=void 0}}),r.prototype=L({__proto__:q.prototype,connect:function(){G&&Array.observe(this.object,this.boundInternalCallback)},sync:function(){G||(this.oldObject=this.object.slice())},check:function(a){var b;if(G){if(!a)return!1;b=F(this.object,a)}else b=B(this.object,0,this.object.length,this.oldObject,0,this.oldObject.length);return b&&b.length?(this.reportArgs=[b],!0):!1}}),r.applySplices=function(a,b,c){c.forEach(function(c){for(var d=[c.index,c.removed.length],e=c.index;e=0&&this.arr[b+1]===this.isObserved||(0>b&&(b=this.arr.length,this.arr[b]=a,Object.observe(a,this.callback)),this.arr[b+1]=this.isObserved,this.observe(Object.getPrototypeOf(a)))}},cleanup:function(){for(var a=0,b=0,c=this.isObserved;ba&&(this.arr[a]=d,this.arr[a+1]=c),a+=2):Object.unobserve(d,this.callback),b+=2}this.arr.length=a}},t.prototype=L({__proto__:o.prototype,connect:function(){G&&(this.observedSet=new s(this.boundInternalCallback))},disconnect:function(){this.value=void 0,G&&(this.observedSet.reset(),this.observedSet.cleanup(),this.observedSet=void 0)},check:function(){return this.value=G?this.path.getValueFromObserved(this.object,this.observedSet):this.path.getValueFrom(this.object),f(this.value,this.oldValue)?!1:(this.reportArgs=[this.value,this.oldValue],!0)},sync:function(a){a&&(this.value=G?this.path.getValueFromObserved(this.object,this.observedSet):this.path.getValueFrom(this.object)),this.oldValue=this.value}}),t.getValueAtPath=function(a,b){var c=h(b);return c?c.getValueFrom(a):void 0},t.setValueAtPath=function(a,b,c){var d=h(b);d&&d.setValueFrom(a,c)};var _={"new":!0,updated:!0,deleted:!0};t.defineProperty=function(a,b,c){var d=c.object,e=h(c.path),f=u(a,b),g=new t(d,c.path,function(a,b){f&&f("updated",b)});return Object.defineProperty(a,b,{get:function(){return e.getValueFrom(d)},set:function(a){e.setValueFrom(d,a)},configurable:!0}),{close:function(){var c=e.getValueFrom(d);f&&g.deliver(),g.close(),Object.defineProperty(a,b,{value:c,writable:!0,configurable:!0})}}};var ab=0,bb=1,cb=2,db=3;a.Observer=o,a.Observer.hasObjectObserve=G,a.ArrayObserver=r,a.ArrayObserver.calculateSplices=function(a,b){return B(a,0,a.length,b,0,b.length)},a.ObjectObserver=q,a.PathObserver=t,a.Path=i}("undefined"!=typeof global&&global?global:this),function(a){"use strict";function b(a){if(!a)throw new Error("Assertion failed")}function c(a){for(;a.parentNode;)a=a.parentNode;return"function"==typeof a.getElementById?a:null}function d(a){return a.ownerDocument.contains(a)}function e(a,b,c,d){this.closed=!1,this.node=a,this.property=b,this.model=c,this.path=d,this.observer=new PathObserver(c,d,this.boundValueChanged,this),this.boundValueChanged(this.value)}function f(a,b,c,d){this.conditional="?"==b[b.length-1],this.conditional&&(a.removeAttribute(b),b=b.slice(0,-1)),e.call(this,a,b,c,d)}function g(a){switch(a.type){case"checkbox":return T;case"radio":case"select-multiple":case"select-one":return"change";default:return"input"}}function h(a,b,c,d){e.call(this,a,b,c,d),this.eventType=g(this.node),this.boundNodeValueToModel=this.nodeValueChanged.bind(this),this.node.addEventListener(this.eventType,this.boundNodeValueToModel,!0)}function i(a){if(!d(a))return[];if(a.form)return Q(a.form.elements,function(b){return b!=a&&"INPUT"==b.tagName&&"radio"==b.type&&b.name==a.name});var b=a.ownerDocument.querySelectorAll('input[type="radio"][name="'+a.name+'"]');return Q(b,function(b){return b!=a&&!b.form})}function j(a,b,c){h.call(this,a,"checked",b,c)}function k(a,b,c){h.call(this,a,"selectedIndex",b,c)}function l(a){return $[a.tagName]&&a.hasAttribute("template")}function m(a){return"TEMPLATE"==a.tagName||l(a)}function n(a){return _&&"TEMPLATE"==a.tagName}function o(a,b){var c=a.querySelectorAll(ab);m(a)&&b(a),P(c,b)}function p(a){function b(a){HTMLTemplateElement.decorate(a)||p(a.content)}o(a,b)}function q(a,b){Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))})}function r(a){if(!a.defaultView)return a;var b=eb.get(a);if(!b){for(b=a.implementation.createHTMLDocument("");b.lastChild;)b.removeChild(b.lastChild);eb.set(a,b)}return b}function s(a){var b=a.ownerDocument.createElement("template");a.parentNode.insertBefore(b,a);for(var c=a.attributes,d=c.length;d-->0;){var e=c[d];Z[e.name]&&("template"!==e.name&&b.setAttribute(e.name,e.value),a.removeAttribute(e.name))}return b}function t(a,b,c){var d=a.content;if(c)return d.appendChild(b),void 0;for(var e;e=b.firstChild;)d.appendChild(e)}function u(a){"TEMPLATE"===a.tagName?_||(cb?a.__proto__=HTMLTemplateElement.prototype:q(a,HTMLTemplateElement.prototype)):(q(a,HTMLTemplateElement.prototype),Object.defineProperty(a,"content",ib))}function v(a){var b=lb.get(a);b||(b=function(){H(a,a.model,a.bindingDelegate)},lb.set(a,b)),bb(b)}function w(a,b,c,d){this.closed=!1,this.node=a,this.property=b,this.model=c,this.path=d,this.node.inputs.bind(this.property,c,d||"")}function x(a){return 3==a.length&&0==a[0].length&&0==a[2].length}function y(a){if(a&&a.length){for(var b,c=a.length,d=0,e=0,f=0;c>e;){if(d=a.indexOf("{{",e),f=0>d?-1:a.indexOf("}}",d+2),0>f){if(!b)return;b.push(a.slice(e));break}b=b||[],b.push(a.slice(e,d)),b.push(a.slice(d+2,f).trim()),e=f+2}return e===c&&b.push(""),b}}function z(a,b,c,d,e){var f,g=e&&e[X];return g&&"function"==typeof g&&(f=g(c,d,b,a),f&&(c=f,d="value")),a.bind(b,c,d)}function A(a,b,c,d,e){for(var f=0;fc?(this.keys.push(a),this.values.push(b)):this.values[c]=b},get:function(a){var b=this.keys.indexOf(a);return 0>b?void 0:this.values[b]},"delete":function(a){var b=this.keys.indexOf(a);return 0>b?!1:(this.keys.splice(b,1),this.values.splice(b,1),!0)},forEach:function(a,b){for(var c=0;c>>0)+(c++ +"__")},S.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}(),Node.prototype.bind=function(a,b,c){this.bindings=this.bindings||{};var d=this.bindings[a];return d&&d.close(),d=this.createBinding(a,b,c),this.bindings[a]=d,d?d:(console.error("Unhandled binding to Node: ",this,a,b,c),void 0)},Node.prototype.createBinding=function(){},Node.prototype.unbind=function(a){if(this.bindings){var b=this.bindings[a];b&&(b.close(),delete this.bindings[a])}},Node.prototype.unbindAll=function(){if(this.bindings){for(var a=Object.keys(this.bindings),b=0;be.node.length&&d--?bb(b):e.node[e.property]=c}var c=Number(a);if(c<=this.node.length)return this.node[this.property]=c,void 0;var d=2,e=this;bb(b)}}),HTMLSelectElement.prototype.createBinding=function(a,b,c){return"selectedindex"===a.toLowerCase()?(this.removeAttribute(a),new k(this,b,c)):HTMLElement.prototype.createBinding.call(this,a,b,c)};var U="bind",V="repeat",W="if",X="getBinding",Y="getInstanceModel",Z={template:!0,repeat:!0,bind:!0,ref:!0},$={THEAD:!0,TBODY:!0,TFOOT:!0,TH:!0,TR:!0,TD:!0,COLGROUP:!0,COL:!0,CAPTION:!0,OPTION:!0,OPTGROUP:!0},_="undefined"!=typeof HTMLTemplateElement,ab="template, "+Object.keys($).map(function(a){return a.toLowerCase()+"[template]"}).join(", "),bb=function(){function a(a){this.nextRunner=a,this.value=!1,this.lastValue=this.value,this.scheduled=[],this.scheduledIds=[],this.running=!1,this.observer=new PathObserver(this,"value",this.run,this)}function b(a){var b=a[e];a[e]||(b=d++,a[e]=b),c.schedule(a,b)}a.prototype={schedule:function(a,b){if(!this.scheduledIds[b]){if(this.running)return this.nextRunner.schedule(a,b);this.scheduledIds[b]=!0,this.scheduled.push(a),this.lastValue===this.value&&(this.value=!this.value)}},run:function(){this.running=!0;for(var a=0;a=48&&57>=a}function d(a){return 32===a||9===a||11===a||12===a||160===a||a>=5760&&" ᠎              ".indexOf(String.fromCharCode(a))>0}function e(a){return 10===a||13===a||8232===a||8233===a}function f(a){return 36===a||95===a||a>=65&&90>=a||a>=97&&122>=a}function g(a){return 36===a||95===a||a>=65&&90>=a||a>=97&&122>=a||a>=48&&57>=a}function h(a){return"this"===a}function i(){for(;bb>ab&&d(_.charCodeAt(ab));)++ab}function j(){var a,b;for(a=ab++;bb>ab&&(b=_.charCodeAt(ab),g(b));)++ab;return _.slice(a,ab)}function k(){var a,b,c;return a=ab,b=j(),c=1===b.length?X.Identifier:h(b)?X.Keyword:"null"===b?X.NullLiteral:"true"===b||"false"===b?X.BooleanLiteral:X.Identifier,{type:c,value:b,range:[a,ab]}}function l(){var a,b,c,d,e=ab,f=_.charCodeAt(ab),g=_[ab];switch(f){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++ab,{type:X.Punctuator,value:String.fromCharCode(f),range:[e,ab]};default:if(a=_.charCodeAt(ab+1),61===a)switch(f){case 37:case 38:case 42:case 43:case 45:case 47:case 60:case 62:case 94:case 124:return ab+=2,{type:X.Punctuator,value:String.fromCharCode(f)+String.fromCharCode(a),range:[e,ab]};case 33:case 61:return ab+=2,61===_.charCodeAt(ab)&&++ab,{type:X.Punctuator,value:_.slice(e,ab),range:[e,ab]}}}return b=_[ab+1],c=_[ab+2],d=_[ab+3],">"===g&&">"===b&&">"===c&&"="===d?(ab+=4,{type:X.Punctuator,value:">>>=",range:[e,ab]}):">"===g&&">"===b&&">"===c?(ab+=3,{type:X.Punctuator,value:">>>",range:[e,ab]}):"<"===g&&"<"===b&&"="===c?(ab+=3,{type:X.Punctuator,value:"<<=",range:[e,ab]}):">"===g&&">"===b&&"="===c?(ab+=3,{type:X.Punctuator,value:">>=",range:[e,ab]}):g===b&&"+-<>&|".indexOf(g)>=0?(ab+=2,{type:X.Punctuator,value:g+b,range:[e,ab]}):"<>=!+-*%&|^/".indexOf(g)>=0?(++ab,{type:X.Punctuator,value:g,range:[e,ab]}):(s({},$.UnexpectedToken,"ILLEGAL"),void 0)}function m(){var a,d,e;if(e=_[ab],b(c(e.charCodeAt(0))||"."===e,"Numeric literal must start with a decimal digit or a decimal point"),d=ab,a="","."!==e){for(a=_[ab++],e=_[ab],"0"===a&&e&&c(e.charCodeAt(0))&&s({},$.UnexpectedToken,"ILLEGAL");c(_.charCodeAt(ab));)a+=_[ab++];e=_[ab]}if("."===e){for(a+=_[ab++];c(_.charCodeAt(ab));)a+=_[ab++];e=_[ab]}if("e"===e||"E"===e)if(a+=_[ab++],e=_[ab],("+"===e||"-"===e)&&(a+=_[ab++]),c(_.charCodeAt(ab)))for(;c(_.charCodeAt(ab));)a+=_[ab++];else s({},$.UnexpectedToken,"ILLEGAL");return f(_.charCodeAt(ab))&&s({},$.UnexpectedToken,"ILLEGAL"),{type:X.NumericLiteral,value:parseFloat(a),range:[d,ab]}}function n(){var a,c,d,f="",g=!1;for(a=_[ab],b("'"===a||'"'===a,"String literal must starts with a quote"),c=ab,++ab;bb>ab;){if(d=_[ab++],d===a){a="";break}if("\\"===d)if(d=_[ab++],d&&e(d.charCodeAt(0)))"\r"===d&&"\n"===_[ab]&&++ab;else switch(d){case"n":f+="\n";break;case"r":f+="\r";break;case"t":f+=" ";break;case"b":f+="\b";break;case"f":f+="\f";break;case"v":f+=" ";break;default:f+=d}else{if(e(d.charCodeAt(0)))break;f+=d}}return""!==a&&s({},$.UnexpectedToken,"ILLEGAL"),{type:X.StringLiteral,value:f,octal:g,range:[c,ab]}}function o(a){return a.type===X.Identifier||a.type===X.Keyword||a.type===X.BooleanLiteral||a.type===X.NullLiteral}function p(){var a;return i(),ab>=bb?{type:X.EOF,range:[ab,ab]}:(a=_.charCodeAt(ab),40===a||41===a||58===a?l():39===a||34===a?n():f(a)?k():46===a?c(_.charCodeAt(ab+1))?m():l():c(a)?m():l())}function q(){var a;return a=db,ab=a.range[1],db=p(),ab=a.range[1],a}function r(){var a;a=ab,db=p(),ab=a}function s(a,c){var d,e=Array.prototype.slice.call(arguments,2),f=c.replace(/%(\d)/g,function(a,c){return b(cab&&(a.push(O()),!v(")"));)u(",");return u(")"),a}function F(){var a;return a=q(),o(a)||t(a),cb.createIdentifier(a.value)}function G(){return u("."),F()}function H(){var a;return u("["),a=P(),u("]"),a}function I(){var a,b,c;for(a=D();v(".")||v("[")||v("(");)v("(")?(b=E(),a=cb.createCallExpression(a,b)):v("[")?(c=H(),a=cb.createMemberExpression("[",a,c)):(c=G(),a=cb.createMemberExpression(".",a,c));return a}function J(){var a;return a=I(),db.type===X.Punctuator&&(v("++")||v("--"))&&s({},$.UnexpectedToken),a}function K(){var a,b;return db.type!==X.Punctuator&&db.type!==X.Keyword?b=J():v("++")||v("--")?s({},$.UnexpectedToken):v("+")||v("-")||v("~")||v("!")?(a=q(),b=K(),b=cb.createUnaryExpression(a.value,b)):w("delete")||w("void")||w("typeof")?s({},$.UnexpectedToken):b=J(),b}function L(a,b){var c=0;if(a.type!==X.Punctuator&&a.type!==X.Keyword)return 0;switch(a.value){case"||":c=1;break;case"&&":c=2;break;case"|":c=3;break;case"^":c=4;break;case"&":c=5;break;case"==":case"!=":case"===":case"!==":c=6;break;case"<":case">":case"<=":case">=":case"instanceof":c=7;break;case"in":c=b?7:0;break;case"<<":case">>":case">>>":c=8;break;case"+":case"-":c=9;break;case"*":case"/":case"%":c=11}return c}function M(){var a,b,c,d,e,f,g,h,i;if(d=eb.allowIn,eb.allowIn=!0,h=K(),b=db,c=L(b,d),0===c)return h;for(b.prec=c,q(),f=K(),e=[h,b,f];(c=L(db,d))>0;){for(;e.length>2&&c<=e[e.length-2].prec;)f=e.pop(),g=e.pop().value,h=e.pop(),a=cb.createBinaryExpression(g,h,f),e.push(a);b=q(),b.prec=c,e.push(b),a=K(),e.push(a)}for(eb.allowIn=d,i=e.length-1,a=e[i];i>1;)a=cb.createBinaryExpression(e[i-1].value,e[i-2],a),i-=2;return a}function N(){var a,b,c,d;return a=M(),v("?")&&(q(),b=eb.allowIn,eb.allowIn=!0,c=O(),eb.allowIn=b,u(":"),d=O(),a=cb.createConditionalExpression(a,c,d)),a}function O(){var a,b,c;return a=db,c=b=N()}function P(){var a;return a=O()}function Q(){return u(";"),cb.createEmptyStatement()}function R(){var a=P();return x(),cb.createExpressionStatement(a)}function S(){var a,b,c,d=db.type;if(d===X.EOF&&t(db),i(),d===X.Punctuator)switch(db.value){case";":return Q();case"(":return R()}return a=P(),a.type===Z.Identifier&&v(":")?(q(),c="$"+a.name,Object.prototype.hasOwnProperty.call(eb.labelSet,c)&&s({},$.Redeclaration,"Label",a.name),eb.labelSet[c]=!0,b=S(),delete eb.labelSet[c],cb.createLabeledStatement(a,b)):(x(),cb.createExpressionStatement(a))}function T(){return db.type===X.Keyword?S():db.type!==X.EOF?S():void 0}function U(){for(var a,b=[];bb>ab&&(a=T(),"undefined"!=typeof a);)b.push(a);return b}function V(){var a;return i(),r(),a=U(),cb.createProgram(a)}function W(a,b){var c;return c=String,"string"==typeof a||a instanceof String||(a=c(a)),cb=b,_=a,ab=0,bb=_.length,db=null,eb={allowIn:!0,labelSet:{}},bb>0&&"undefined"==typeof _[0]&&a instanceof String&&(_=a.valueOf()),V()}var X,Y,Z,$,_,ab,bb,cb,db,eb;X={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},Y={},Y[X.BooleanLiteral]="Boolean",Y[X.EOF]="",Y[X.Identifier]="Identifier",Y[X.Keyword]="Keyword",Y[X.NullLiteral]="Null",Y[X.NumericLiteral]="Numeric",Y[X.Punctuator]="Punctuator",Y[X.StringLiteral]="String",Z={ArrayExpression:"ArrayExpression",BinaryExpression:"BinaryExpression",CallExpression:"CallExpression",ConditionalExpression:"ConditionalExpression",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",Identifier:"Identifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ThisExpression:"ThisExpression",UnaryExpression:"UnaryExpression"},$={UnexpectedToken:"Unexpected token %0",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared"},a.esprima={parse:W}}(this),function(a){"use strict";function b(a,b,d,e){if(e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.tagName&&("bind"===d||"repeat"===d)){var f,g,h=b.match(r);if(h?(f=h[1],g=h[2]):(h=b.match(s),h&&(f=h[2],g=h[1])),h){var i;if(g=g.trim(),g.match(q))i=new CompoundBinding(function(a){return a.path}),i.bind("path",a,g);else try{i=c(a,g)}catch(j){console.error("Invalid expression syntax: "+g,j)}if(i)return t.set(e,f),i}}}function c(a,b){try{var c=new f;if(esprima.parse(b,c),!c.statements.length&&!c.labeledStatements.length)return;if(!c.labeledStatements.length&&c.statements.length>1)throw Error("Multiple unlabelled statements are not allowed.");var e=c.labeledStatements.length?d(c.labeledStatements):e=c.statements[0],g=[];for(var h in c.deps)g.push(h);if(!g.length)return{value:e({})};for(var i=new CompoundBinding(e),j=0;j>>0)+(c++ +"__")},i.prototype={set:function(b,c){a(b,this.name,{value:c,writable:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}();var j="[$_a-zA-Z]",k="[$_a-zA-Z0-9]",l=j+"+"+k+"*",m="("+l+")",n="(?:[0-9]|[1-9]+[0-9]+)",o="(?:"+l+"|"+n+")",p="(?:"+o+")(?:\\."+o+")*",q=new RegExp("^"+p+"$"),r=new RegExp("^"+m+"\\s* in (.*)$"),s=new RegExp("^(.*) as \\s*"+m+"$"),t=new i;e.prototype={getPath:function(){return this.last?this.last.getPath()+"."+this.name:this.name},valueFn:function(){var a=this.getPath();return this.deps[a]=!0,function(b){return b[a]}}};var u={"+":function(a){return+a},"-":function(a){return-a},"!":function(a){return!a}},v={"+":function(a,b){return a+b},"-":function(a,b){return a-b},"*":function(a,b){return a*b},"/":function(a,b){return a/b},"%":function(a,b){return a%b},"<":function(a,b){return b>a},">":function(a,b){return a>b},"<=":function(a,b){return b>=a},">=":function(a,b){return a>=b},"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"===":function(a,b){return a===b},"!==":function(a,b){return a!==b},"&&":function(a,b){return a&&b},"||":function(a,b){return a||b}};f.prototype={getFn:function(a){return a instanceof e?a.valueFn():a},createProgram:function(){},createExpressionStatement:function(a){return this.statements.push(a),a},createLabeledStatement:function(a,b){return this.labeledStatements.push({label:a.getPath(),body:b instanceof e?b.valueFn():b}),b},createUnaryExpression:function(a,b){if(!u[a])throw Error("Disallowed operator: "+a);return b=this.getFn(b),function(c){return u[a](b(c))}},createBinaryExpression:function(a,b,c){if(!v[a])throw Error("Disallowed operator: "+a);return b=this.getFn(b),c=this.getFn(c),function(d){return v[a](b(d),c(d))}},createConditionalExpression:function(a,b,c){return a=this.getFn(a),b=this.getFn(b),c=this.getFn(c),function(d){return a(d)?b(d):c(d)}},createIdentifier:function(a){var b=new e(this.deps,a);return b.type="Identifier",b},createMemberExpression:function(a,b,c){return new e(this.deps,c.name,b)},createLiteral:function(a){return function(){return a.value}},createArrayExpression:function(a){for(var b=0;be;e++)d.unshift("..");var g=d.join("/");return g},resolvePathsInHTML:function(a,b){b=b||p.documentUrlFromNode(a),p.resolveAttributes(a,b),p.resolveStyleElts(a,b);var c=a.querySelectorAll("template");c&&q(c,function(a){a.content&&p.resolvePathsInHTML(a.content,b)})},resolvePathsInStylesheet:function(a){var b=p.nodeUrl(a);a.__resource=p.resolveCssText(a.__resource,b)},resolveStyleElts:function(a,b){var c=a.querySelectorAll("style");c&&q(c,function(a){a.textContent=p.resolveCssText(a.textContent,b)})},resolveCssText:function(a,b){return a.replace(/url\([^)]*\)/g,function(a){var c=a.replace(/["']/g,"").slice(4,-1);return c=p.resolveUrl(b,c,!0),"url("+c+")"})},resolveAttributes:function(a,b){var c=a&&a.querySelectorAll(n);c&&q(c,function(a){this.resolveNodeAttributes(a,b)},this)},resolveNodeAttributes:function(a,b){m.forEach(function(c){var d=a.attributes[c];if(d&&d.value&&d.value.search(o)<0){var e=p.resolveUrl(b,d.value,!0);d.value=e}})}};h=h||{async:!0,ok:function(a){return a.status>=200&&a.status<300||304===a.status||0===a.status},load:function(b,c,d){var e=new XMLHttpRequest;return(a.flags.debug||a.flags.bust)&&(b+="?"+Math.random()),e.open("GET",b,h.async),e.addEventListener("readystatechange",function(){4===e.readyState&&c.call(d,!h.ok(e)&&e,e.response,b)}),e.send(),e},loadDocument:function(a,b,c){this.load(a,b,c).responseType="document"}};var q=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.path=p,a.xhr=h,a.importer=k,a.getDocumentUrl=p.getDocumentUrl,a.IMPORT_LINK_TYPE=i}(window.HTMLImports),function(a){function b(a){return"link"===a.localName&&a.getAttribute("rel")===f}function c(a){return a.parentNode&&!d(a)&&!e(a)}function d(a){return a.ownerDocument===document||a.ownerDocument.impl===document}function e(a){return a.parentNode&&"element"===a.parentNode.localName}var f="import",g={selectors:["link[rel="+f+"]","link[rel=stylesheet]","style","script:not([type])",'script[type="text/javascript"]'],map:{link:"parseLink",script:"parseScript",style:"parseGeneric"},parse:function(a){if(!a.__importParsed){a.__importParsed=!0;var b=a.querySelectorAll(g.selectors);h(b,function(a){g[g.map[a.localName]](a)})}},parseLink:function(a){b(a)?a.content&&g.parse(a.content):this.parseGeneric(a)},parseGeneric:function(a){c(a)&&document.head.appendChild(a)},parseScript:function(b){if(c(b)){var d=(b.__resource||b.textContent).trim();if(d){var e=b.__nodeUrl;if(!e){var e=a.path.documentUrlFromNode(b),f="["+Math.floor(1e3*(Math.random()+1))+"]",g=d.match(/Polymer\(['"]([^'"]*)/);f=g&&g[1]||f,e+="/"+f+".js"}d+="\n//# sourceURL="+e+"\n",eval.call(window,d)}}}},h=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.parser=g}(HTMLImports),function(){function a(){HTMLImports.importer.load(document,function(){HTMLImports.parser.parse(document),HTMLImports.readyTime=(new Date).getTime(),document.dispatchEvent(new CustomEvent("HTMLImportsLoaded",{bubbles:!0}))})}"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(a){var b=document.createEvent("HTMLEvents");return b.initEvent(a,!0,!0),b}),"complete"===document.readyState?a():window.addEventListener("DOMContentLoaded",a)}(),function(a){function b(a){u.push(a),t||(t=!0,q(d))}function c(a){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(a)||a}function d(){t=!1;var a=u;u=[],a.sort(function(a,b){return a.uid_-b.uid_});var b=!1;a.forEach(function(a){var c=a.takeRecords();e(a),c.length&&(a.callback_(c,a),b=!0)}),b&&d()}function e(a){a.nodes_.forEach(function(b){var c=p.get(b); -c&&c.forEach(function(b){b.observer===a&&b.removeTransientObservers()})})}function f(a,b){for(var c=a;c;c=c.parentNode){var d=p.get(c);if(d)for(var e=0;e0){var e=c[d-1],f=n(e,a);if(f)return c[d-1]=f,void 0}else b(this.observer);c[d]=a},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(a){var b=this.options;b.attributes&&a.addEventListener("DOMAttrModified",this,!0),b.characterData&&a.addEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.addEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(a){var b=this.options;b.attributes&&a.removeEventListener("DOMAttrModified",this,!0),b.characterData&&a.removeEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.removeEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(a){if(a!==this.target){this.addListeners_(a),this.transientObservedNodes.push(a);var b=p.get(a);b||p.set(a,b=[]),b.push(this)}},removeTransientObservers:function(){var a=this.transientObservedNodes;this.transientObservedNodes=[],a.forEach(function(a){this.removeListeners_(a);for(var b=p.get(a),c=0;c1?logFlags.dom&&console.warn("inserted:",a.localName,"insert/remove count:",a.__inserted):a.insertedCallback&&(logFlags.dom&&console.log("inserted:",a.localName),a.insertedCallback())),logFlags.dom&&console.groupEnd())}function k(a){l(a),d(a,function(a){l(a)})}function l(a){(a.removedCallback||a.__upgraded__&&logFlags.dom)&&(logFlags.dom&&console.log("removed:",a.localName),m(a)||(a.__inserted=(a.__inserted||0)-1,a.__inserted>0&&(a.__inserted=0),a.__inserted<0?logFlags.dom&&console.warn("removed:",a.localName,"insert/remove count:",a.__inserted):a.removedCallback&&a.removedCallback()))}function m(a){for(var b=a;b;){if(b==a.ownerDocument)return!0;b=b.parentNode||b.host}}function n(a){if(a.webkitShadowRoot&&!a.webkitShadowRoot.__watched){logFlags.dom&&console.log("watching shadow-root for: ",a.localName);for(var b=a.webkitShadowRoot;b;)o(b),b=b.olderShadowRoot}}function o(a){a.__watched||(t(a),a.__watched=!0)}function p(a){n(a),d(a,function(){n(a)})}function q(a){switch(a.localName){case"style":case"script":case"template":case void 0:return!0}}function r(a){if(logFlags.dom){var b=a[0];if(b&&"childList"===b.type&&b.addedNodes&&b.addedNodes){for(var c=b.addedNodes[0];c&&c!==document&&!c.host;)c=c.parentNode;var d=c&&(c.URL||c._URL||c.host&&c.host.localName)||"";d=d.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",a.length,d||"")}a.forEach(function(a){"childList"===a.type&&(x(a.addedNodes,function(a){q(a)||g(a)}),x(a.removedNodes,function(a){q(a)||k(a)}))}),logFlags.dom&&console.groupEnd()}function s(){r(w.takeRecords())}function t(a){w.observe(a,{childList:!0,subtree:!0})}function u(a){t(a)}function v(a){logFlags.dom&&console.group("upgradeDocument: ",(a.URL||a._URL||"").split("/").pop()),g(a),logFlags.dom&&console.groupEnd()}var w=new MutationObserver(r),x=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.watchShadow=n,a.watchAllShadows=p,a.upgradeAll=g,a.upgradeSubtree=f,a.observeDocument=u,a.upgradeDocument=v,a.takeRecords=s}(window.CustomElements),function(){function parseElementElement(a){var b={name:"","extends":null};takeAttributes(a,b);var c=HTMLElement.prototype;if(b.extends){var d=document.createElement(b.extends);c=d.__proto__||Object.getPrototypeOf(d)}b.prototype=Object.create(c),a.options=b;var e=a.querySelector('script:not([type]),script[type="text/javascript"],scripts');e&&executeComponentScript(e.textContent,a,b.name);var f=document.register(b.name,b);a.ctor=f;var g=a.getAttribute("constructor");g&&(window[g]=f)}function takeAttributes(a,b){for(var c in b){var d=a.attributes[c];d&&(b[c]=d.value)}}function executeComponentScript(inScript,inContext,inName){context=inContext;var owner=context.ownerDocument,url=owner._URL||owner.URL||owner.impl&&(owner.impl._URL||owner.impl.URL),match=url.match(/.*\/([^.]*)[.]?.*$/);if(match){var name=match[1];url+=name!=inName?":"+inName:""}var code="__componentScript('"+inName+"', function(){"+inScript+"});"+"\n//# sourceURL="+url+"\n";eval(code)}function mixin(a,b){a=a||{};try{Object.getOwnPropertyNames(b).forEach(function(c){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)})}catch(c){}return a}var HTMLElementElement=function(a){return a.register=HTMLElementElement.prototype.register,parseElementElement(a),a};HTMLElementElement.prototype={register:function(a){a&&(this.options.lifecycle=a.lifecycle,a.prototype&&mixin(this.options.prototype,a.prototype))}};var context;window.__componentScript=function(a,b){b.call(context)},window.HTMLElementElement=HTMLElementElement}(),function(){function a(a){return"link"===a.localName&&a.getAttribute("rel")===b}var b=window.HTMLImports?HTMLImports.IMPORT_LINK_TYPE:"none",c={selectors:["link[rel="+b+"]","element"],map:{link:"parseLink",element:"parseElement"},parse:function(a){if(!a.__parsed){a.__parsed=!0;var b=a.querySelectorAll(c.selectors);d(b,function(a){c[c.map[a.localName]](a)}),CustomElements.upgradeDocument(a),CustomElements.observeDocument(a)}},parseLink:function(b){a(b)&&this.parseImport(b)},parseImport:function(a){a.content&&c.parse(a.content)},parseElement:function(a){new HTMLElementElement(a)}},d=Array.prototype.forEach.call.bind(Array.prototype.forEach);CustomElements.parser=c}(),function(){function a(){setTimeout(function(){CustomElements.parser.parse(document),CustomElements.upgradeDocument(document),CustomElements.ready=!0,CustomElements.readyTime=Date.now(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.body.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))},0)}if("function"!=typeof window.CustomEvent&&(window.CustomEvent=function(a){var b=document.createEvent("HTMLEvents");return b.initEvent(a,!0,!0),b}),"complete"===document.readyState)a();else{var b=window.HTMLImports?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(b,a)}}(),function(){function a(){}var b=document.createElement("style");b.textContent="element {display: none !important;} /* injected by platform.js */";var c=document.querySelector("head");if(c.insertBefore(b,c.firstChild),window.ShadowDOMPolyfill){CustomElements.watchShadow=a,CustomElements.watchAllShadows=a;var d=["upgradeAll","upgradeSubtree","observeDocument","upgradeDocument"],e={};d.forEach(function(a){e[a]=CustomElements[a]}),d.forEach(function(a){CustomElements[a]=function(b){return e[a](wrap(b))}})}}(),function(a){a=a||{};var b={shadow:function(a){return a?a.shadowRoot||a.webkitShadowRoot:void 0},canTarget:function(a){return a&&Boolean(a.elementFromPoint)},targetingShadow:function(a){var b=this.shadow(a);return this.canTarget(b)?b:void 0},olderShadow:function(a){var b=a.olderShadowRoot;if(!b){var c=a.querySelector("shadow");c&&(b=c.olderShadowRoot)}return b},allShadows:function(a){for(var b=[],c=this.shadow(a);c;)b.push(c),c=this.olderShadow(c);return b},searchRoot:function(a,b,c){if(a){var d,e,f=a.elementFromPoint(b,c);for(e=this.targetingShadow(f);e;){if(d=e.elementFromPoint(b,c)){var g=this.targetingShadow(d);return this.searchRoot(g,b,c)||d}e=this.olderShadow(e)}return f}},owner:function(a){for(var b=a;b.parentNode;)b=b.parentNode;return b},findTarget:function(a){var b=a.clientX,c=a.clientY,d=this.owner(a.target);return d.elementFromPoint(b,c)||(d=document),this.searchRoot(document,b,c)}};a.targetFinding=b,a.findTarget=b.findTarget.bind(b),window.PointerEventsPolyfill=a}(window.PointerEventsPolyfill),function(){function a(a){return'[touch-action="'+a+'"]'}function b(a){return"{ -ms-touch-action: "+a+"; touch-action: "+a+"; }"}var c=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],d="";c.forEach(function(c){d+=String(c)===c?a(c)+b(c):c.selectors.map(a)+b(c.rule)});var e=document.createElement("style");e.textContent=d;var f=document.querySelector("head");f.insertBefore(e,f.firstChild)}(),function(a){function b(a,b){var b=b||{},e=b.buttons;if(void 0===e)switch(b.which){case 1:e=1;break;case 2:e=4;break;case 3:e=2;break;default:e=0}var f;if(c)f=new MouseEvent(a,b);else{f=document.createEvent("MouseEvent");var g={bubbles:!1,cancelable:!1,view:null,detail:null,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null};Object.keys(g).forEach(function(a){a in b&&(g[a]=b[a])}),f.initMouseEvent(a,g.bubbles,g.cancelable,g.view,g.detail,g.screenX,g.screenY,g.clientX,g.clientY,g.ctrlKey,g.altKey,g.shiftKey,g.metaKey,g.button,g.relatedTarget)}d||Object.defineProperty(f,"buttons",{get:function(){return e},enumerable:!0});var h=0;return h=b.pressure?b.pressure:e?.5:0,Object.defineProperties(f,{pointerId:{value:b.pointerId||0,enumerable:!0},width:{value:b.width||0,enumerable:!0},height:{value:b.height||0,enumerable:!0},pressure:{value:h,enumerable:!0},tiltX:{value:b.tiltX||0,enumerable:!0},tiltY:{value:b.tiltY||0,enumerable:!0},pointerType:{value:b.pointerType||"",enumerable:!0},hwTimestamp:{value:b.hwTimestamp||0,enumerable:!0},isPrimary:{value:b.isPrimary||!1,enumerable:!0}}),f}var c=!1,d=!1;try{var e=new MouseEvent("click",{buttons:1});c=!0,d=1===e.buttons}catch(f){}a.PointerEvent||(a.PointerEvent=b)}(window),function(a){function b(){this.ids=[],this.pointers=[]}b.prototype={set:function(a,b){var c=this.ids.indexOf(a);c>-1?this.pointers[c]=b:(this.ids.push(a),this.pointers.push(b))},has:function(a){return this.ids.indexOf(a)>-1},"delete":function(a){var b=this.ids.indexOf(a);b>-1&&(this.ids.splice(b,1),this.pointers.splice(b,1))},get:function(a){var b=this.ids.indexOf(a);return this.pointers[b]},get size(){return this.pointers.length},clear:function(){this.ids.length=0,this.pointers.length=0},forEach:function(a,b){this.ids.forEach(function(c,d){a.call(b,c,this.pointers[d],this)},this)}},a.PointerMap=window.Map&&Map.prototype.forEach?Map:b}(window.PointerEventsPolyfill),function(a){var b;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0)b=WeakMap;else{var c=Object.defineProperty,d=Object.hasOwnProperty,e=(new Date).getTime()%1e9;b=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")},b.prototype={set:function(a,b){c(a,this.name,{value:b,writable:!0})},get:function(a){return d.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}a.SideTable=b}(window.PointerEventsPolyfill),function(a){var b={targets:new a.SideTable,handledEvents:new a.SideTable,pointermap:new a.PointerMap,eventMap:{},eventSources:{},eventSourceList:[],registerSource:function(a,b){var c=b,d=c.events;d&&(d.forEach(function(a){c[a]&&(this.eventMap[a]=c[a].bind(c))},this),this.eventSources[a]=c,this.eventSourceList.push(c))},register:function(a){for(var b,c=this.eventSourceList.length,d=0;c>d&&(b=this.eventSourceList[d]);d++)b.register.call(b,a)},unregister:function(a){for(var b,c=this.eventSourceList.length,d=0;c>d&&(b=this.eventSourceList[d]);d++)b.unregister.call(b,a)},down:function(a){this.fireEvent("pointerdown",a)},move:function(a){this.fireEvent("pointermove",a)},up:function(a){this.fireEvent("pointerup",a)},enter:function(a){a.bubbles=!1,this.fireEvent("pointerenter",a)},leave:function(a){a.bubbles=!1,this.fireEvent("pointerleave",a)},over:function(a){a.bubbles=!0,this.fireEvent("pointerover",a)},out:function(a){a.bubbles=!0,this.fireEvent("pointerout",a)},cancel:function(a){this.fireEvent("pointercancel",a)},leaveOut:function(a){a.target.contains(a.relatedTarget)||this.leave(a),this.out(a)},enterOver:function(a){a.target.contains(a.relatedTarget)||this.enter(a),this.over(a)},eventHandler:function(a){if(!this.handledEvents.get(a)){var b=a.type,c=this.eventMap&&this.eventMap[b];c&&c(a),this.handledEvents.set(a,!0)}},listen:function(a,b){b.forEach(function(b){this.addEvent(a,b)},this)},unlisten:function(a,b){b.forEach(function(b){this.removeEvent(a,b)},this)},addEvent:function(a,b){a.addEventListener(b,this.boundHandler)},removeEvent:function(a,b){a.removeEventListener(b,this.boundHandler)},makeEvent:function(a,b){var c=new PointerEvent(a,b);return this.targets.set(c,this.targets.get(b)||b.target),c},fireEvent:function(a,b){var c=this.makeEvent(a,b);return this.dispatchEvent(c)},cloneEvent:function(a){var b={};for(var c in a)b[c]=a[c];return b},getTarget:function(a){return this.captureInfo&&this.captureInfo.id===a.pointerId?this.captureInfo.target:this.targets.get(a)},setCapture:function(a,b){this.captureInfo&&this.releaseCapture(this.captureInfo.id),this.captureInfo={id:a,target:b};var c=new PointerEvent("gotpointercapture",{bubbles:!0});this.implicitRelease=this.releaseCapture.bind(this,a),document.addEventListener("pointerup",this.implicitRelease),document.addEventListener("pointercancel",this.implicitRelease),this.targets.set(c,b),this.asyncDispatchEvent(c)},releaseCapture:function(a){if(this.captureInfo&&this.captureInfo.id===a){var b=new PointerEvent("lostpointercapture",{bubbles:!0}),c=this.captureInfo.target;this.captureInfo=null,document.removeEventListener("pointerup",this.implicitRelease),document.removeEventListener("pointercancel",this.implicitRelease),this.targets.set(b,c),this.asyncDispatchEvent(b)}},dispatchEvent:function(a){var b=this.getTarget(a);return b?b.dispatchEvent(a):void 0},asyncDispatchEvent:function(a){setTimeout(this.dispatchEvent.bind(this,a),0)}};b.boundHandler=b.eventHandler.bind(b),a.dispatcher=b,a.register=b.register.bind(b),a.unregister=b.unregister.bind(b)}(window.PointerEventsPolyfill),function(a){function b(a,b,c,d){this.addCallback=a.bind(d),this.removeCallback=b.bind(d),this.changedCallback=c.bind(d),g&&(this.observer=new g(this.mutationWatcher.bind(this)))}var c=Array.prototype.forEach.call.bind(Array.prototype.forEach),d=Array.prototype.map.call.bind(Array.prototype.map),e=Array.prototype.slice.call.bind(Array.prototype.slice),f=Array.prototype.filter.call.bind(Array.prototype.filter),g=window.MutationObserver||window.WebKitMutationObserver,h="[touch-action]",i={subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["touch-action"]};b.prototype={watchSubtree:function(b){a.targetFinding.canTarget(b)&&this.observer.observe(b,i)},enableOnSubtree:function(a){this.watchSubtree(a),a===document&&"complete"!==document.readyState?this.installOnLoad():this.installNewSubtree(a)},installNewSubtree:function(a){c(this.findElements(a),this.addElement,this)},findElements:function(a){return a.querySelectorAll?a.querySelectorAll(h):[]},removeElement:function(a){this.removeCallback(a)},addElement:function(a){this.addCallback(a)},elementChanged:function(a,b){this.changedCallback(a,b)},concatLists:function(a,b){return a.concat(e(b))},installOnLoad:function(){document.addEventListener("DOMContentLoaded",this.installNewSubtree.bind(this,document))},isElement:function(a){return a.nodeType===Node.ELEMENT_NODE},flattenMutationTree:function(a){var b=d(a,this.findElements,this);return b.push(f(a,this.isElement)),b.reduce(this.concatLists,[])},mutationWatcher:function(a){a.forEach(this.mutationHandler,this)},mutationHandler:function(a){if("childList"===a.type){var b=this.flattenMutationTree(a.addedNodes);b.forEach(this.addElement,this);var c=this.flattenMutationTree(a.removedNodes);c.forEach(this.removeElement,this)}else"attributes"===a.type&&this.elementChanged(a.target,a.oldValue)}},g||(b.prototype.watchSubtree=function(){console.warn("PointerEventsPolyfill: MutationObservers not found, touch-action will not be dynamically detected")}),a.Installer=b}(window.PointerEventsPolyfill),function(a){var b=a.dispatcher,c=b.pointermap,d=25,e={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup","mouseover","mouseout"],register:function(a){b.listen(a,this.events)},unregister:function(a){b.unlisten(a,this.events)},lastTouches:[],isEventSimulatedFromTouch:function(a){for(var b,c=this.lastTouches,e=a.clientX,f=a.clientY,g=0,h=c.length;h>g&&(b=c[g]);g++){var i=Math.abs(e-b.x),j=Math.abs(f-b.y);if(d>=i&&d>=j)return!0}},prepareEvent:function(a){var c=b.cloneEvent(a);return c.pointerId=this.POINTER_ID,c.isPrimary=!0,c.pointerType=this.POINTER_TYPE,c},mousedown:function(a){if(!this.isEventSimulatedFromTouch(a)){var d=c.has(this.POINTER_ID);d&&this.cancel(a);var e=this.prepareEvent(a);c.set(this.POINTER_ID,a),b.down(e)}},mousemove:function(a){if(!this.isEventSimulatedFromTouch(a)){var c=this.prepareEvent(a);b.move(c)}},mouseup:function(a){if(!this.isEventSimulatedFromTouch(a)){var d=c.get(this.POINTER_ID);if(d&&d.button===a.button){var e=this.prepareEvent(a);b.up(e),this.cleanupMouse()}}},mouseover:function(a){if(!this.isEventSimulatedFromTouch(a)){var c=this.prepareEvent(a);b.enterOver(c)}},mouseout:function(a){if(!this.isEventSimulatedFromTouch(a)){var c=this.prepareEvent(a);b.leaveOut(c)}},cancel:function(a){var c=this.prepareEvent(a);b.cancel(c),this.cleanupMouse()},cleanupMouse:function(){c.delete(this.POINTER_ID)}};a.mouseEvents=e}(window.PointerEventsPolyfill),function(a){var b,c=a.dispatcher,d=a.findTarget,e=a.targetFinding.allShadows.bind(a.targetFinding),f=c.pointermap,g=Array.prototype.map.call.bind(Array.prototype.map),h=2500,i=200,j="touch-action",k="string"==typeof document.head.style.touchAction,l={scrollType:new a.SideTable,events:["touchstart","touchmove","touchend","touchcancel"],register:function(a){k?c.listen(a,this.events):b.enableOnSubtree(a)},unregister:function(a){k&&c.unlisten(a,this.events)},elementAdded:function(a){var b=a.getAttribute(j),d=this.touchActionToScrollType(b);d&&(this.scrollType.set(a,d),c.listen(a,this.events),e(a).forEach(function(a){this.scrollType.set(a,d),c.listen(a,this.events)},this))},elementRemoved:function(a){this.scrollType.delete(a),c.unlisten(a,this.events),e(a).forEach(function(a){this.scrollType.delete(a),c.unlisten(a,this.events)},this)},elementChanged:function(a,b){var c=a.getAttribute(j),d=this.touchActionToScrollType(c),f=this.touchActionToScrollType(b);d&&f?(this.scrollType.set(a,d),e(a).forEach(function(a){this.scrollType.set(a,d)},this)):f?this.elementRemoved(a):d&&this.elementAdded(a)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(a){var b=a,c=this.scrollTypes;return"none"===b?"none":b===c.XSCROLLER?"X":b===c.YSCROLLER?"Y":c.SCROLLER.exec(b)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(a){return this.firstTouch===a.identifier},setPrimaryTouch:function(a){null===this.firstTouch&&(this.firstTouch=a.identifier,this.firstXY={X:a.clientX,Y:a.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryTouch:function(a){this.isPrimaryTouch(a)&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var a=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(a,i)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},touchToPointer:function(a){var b=c.cloneEvent(a);return b.pointerId=a.identifier+2,b.target=d(b),b.bubbles=!0,b.cancelable=!0,b.detail=this.clickCount,b.button=0,b.buttons=1,b.width=a.webkitRadiusX||a.radiusX||0,b.height=a.webkitRadiusY||a.radiusY||0,b.pressure=a.webkitForce||a.force||.5,b.isPrimary=this.isPrimaryTouch(a),b.pointerType=this.POINTER_TYPE,b},processTouches:function(a,b){var c=a.changedTouches,d=g(c,this.touchToPointer,this);d.forEach(b,this)},shouldScroll:function(a){if(this.firstXY){var b,c=this.scrollType.get(a.currentTarget);if("none"===c)b=!1;else if("XY"===c)b=!0;else{var d=a.changedTouches[0],e=c,f="Y"===c?"X":"Y",g=Math.abs(d["client"+e]-this.firstXY[e]),h=Math.abs(d["client"+f]-this.firstXY[f]);b=g>=h}return this.firstXY=null,b}},findTouch:function(a,b){for(var c,d=0,e=a.length;e>d&&(c=a[d]);d++)if(c.identifier===b)return!0},vacuumTouches:function(a){var b=a.touches;if(f.size>=b.length){var c=[];f.forEach(function(a,d){if(1!==a&&!this.findTouch(b,a-2)){var e=d.out;c.push(this.touchToPointer(e))}},this),c.forEach(this.cancelOut,this)}},touchstart:function(a){this.vacuumTouches(a),this.setPrimaryTouch(a.changedTouches[0]),this.dedupSynthMouse(a),this.scrolling||(this.clickCount++,this.processTouches(a,this.overDown))},overDown:function(a){f.set(a.pointerId,{target:a.target,out:a,outTarget:a.target}),c.over(a),c.down(a)},touchmove:function(a){this.scrolling||(this.shouldScroll(a)?(this.scrolling=!0,this.touchcancel(a)):(a.preventDefault(),this.processTouches(a,this.moveOverOut)))},moveOverOut:function(a){var b=a,d=f.get(b.pointerId);if(d){var e=d.out,g=d.outTarget;c.move(b),e&&g!==b.target&&(e.relatedTarget=b.target,b.relatedTarget=g,e.target=g,b.target?(c.leaveOut(e),c.enterOver(b)):(b.target=g,b.relatedTarget=null,this.cancelOut(b))),d.out=b,d.outTarget=b.target}},touchend:function(a){this.dedupSynthMouse(a),this.processTouches(a,this.upOut)},upOut:function(a){this.scrolling||(c.up(a),c.out(a)),this.cleanUpPointer(a)},touchcancel:function(a){this.processTouches(a,this.cancelOut)},cancelOut:function(a){c.cancel(a),c.out(a),this.cleanUpPointer(a)},cleanUpPointer:function(a){f.delete(a.pointerId),this.removePrimaryTouch(a)},dedupSynthMouse:function(b){var c=a.mouseEvents.lastTouches,d=b.changedTouches[0];if(this.isPrimaryTouch(d)){var e={x:d.clientX,y:d.clientY};c.push(e);var f=function(a,b){var c=a.indexOf(b);c>-1&&a.splice(c,1)}.bind(null,c,e);setTimeout(f,h)}}};k||(b=new a.Installer(l.elementAdded,l.elementRemoved,l.elementChanged,l)),a.touchEvents=l}(window.PointerEventsPolyfill),function(a){var b=a.dispatcher,c=b.pointermap,d=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,e={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(a){b.listen(a,this.events)},unregister:function(a){b.unlisten(a,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(a){var c=a;return d&&(c=b.cloneEvent(a),c.pointerType=this.POINTER_TYPES[a.pointerType]),c},cleanup:function(a){c.delete(a)},MSPointerDown:function(a){c.set(a.pointerId,a);var d=this.prepareEvent(a);b.down(d)},MSPointerMove:function(a){var c=this.prepareEvent(a);b.move(c)},MSPointerUp:function(a){var c=this.prepareEvent(a);b.up(c),this.cleanup(a.pointerId)},MSPointerOut:function(a){var c=this.prepareEvent(a);b.leaveOut(c)},MSPointerOver:function(a){var c=this.prepareEvent(a);b.enterOver(c)},MSPointerCancel:function(a){var c=this.prepareEvent(a);b.cancel(c),this.cleanup(a.pointerId)},MSLostPointerCapture:function(a){var c=b.makeEvent("lostpointercapture",a);b.dispatchEvent(c)},MSGotPointerCapture:function(a){var c=b.makeEvent("gotpointercapture",a);b.dispatchEvent(c)}};a.msEvents=e}(window.PointerEventsPolyfill),function(a){var b=a.dispatcher;if(void 0===window.navigator.pointerEnabled){if(Object.defineProperty(window.navigator,"pointerEnabled",{value:!0,enumerable:!0}),window.navigator.msPointerEnabled){var c=window.navigator.msMaxTouchPoints;Object.defineProperty(window.navigator,"maxTouchPoints",{value:c,enumerable:!0}),b.registerSource("ms",a.msEvents)}else b.registerSource("mouse",a.mouseEvents),void 0!==window.ontouchstart&&b.registerSource("touch",a.touchEvents);b.register(document)}}(window.PointerEventsPolyfill),function(a){function b(a){if(!e.pointermap.has(a))throw new Error("InvalidPointerId")}var c,d,e=a.dispatcher,f=window.navigator;f.msPointerEnabled?(c=function(a){b(a),this.msSetPointerCapture(a)},d=function(a){b(a),this.msReleasePointerCapture(a)}):(c=function(a){b(a),e.setCapture(a,this)},d=function(a){b(a),e.releaseCapture(a,this)}),Element.prototype.setPointerCapture||Object.defineProperties(Element.prototype,{setPointerCapture:{value:c},releasePointerCapture:{value:d}})}(window.PointerEventsPolyfill),PointerGestureEvent.prototype.preventTap=function(){this.tapPrevented=!0},function(a){a=a||{},a.utils={LCA:{find:function(a,b){if(a===b)return a;if(a.contains){if(a.contains(b))return a;if(b.contains(a))return b}var c=this.depth(a),d=this.depth(b),e=c-d;for(e>0?a=this.walk(a,e):b=this.walk(b,-e);a&&b&&a!==b;)a=this.walk(a,1),b=this.walk(b,1);return a},walk:function(a,b){for(var c=0;b>c;c++)a=a.parentNode;return a},depth:function(a){for(var b=0;a;)b++,a=a.parentNode;return b}}},a.findLCA=function(b,c){return a.utils.LCA.find(b,c)},window.PointerGestures=a}(window.PointerGestures),function(a){var b;if("undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0)b=WeakMap;else{var c=Object.defineProperty,d=Object.hasOwnProperty,e=(new Date).getTime()%1e9;b=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")},b.prototype={set:function(a,b){c(a,this.name,{value:b,writable:!0})},get:function(a){return d.call(a,this.name)?a[this.name]:void 0},"delete":function(a){this.set(a,void 0)}}}a.SideTable=b}(window.PointerGestures),function(a){function b(){this.ids=[],this.pointers=[]}b.prototype={set:function(a,b){var c=this.ids.indexOf(a);c>-1?this.pointers[c]=b:(this.ids.push(a),this.pointers.push(b))},has:function(a){return this.ids.indexOf(a)>-1},"delete":function(a){var b=this.ids.indexOf(a); -b>-1&&(this.ids.splice(b,1),this.pointers.splice(b,1))},get:function(a){var b=this.ids.indexOf(a);return this.pointers[b]},get size(){return this.pointers.length},clear:function(){this.ids.length=0,this.pointers.length=0}},window.Map&&(b=window.Map),a.PointerMap=b}(window.PointerGestures),function(a){var b={handledEvents:new a.SideTable,targets:new a.SideTable,handlers:{},recognizers:{},events:["pointerdown","pointermove","pointerup","pointerover","pointerout","pointercancel"],registerRecognizer:function(a,b){var c=b;this.recognizers[a]=c,this.events.forEach(function(a){if(c[a]){var b=c[a].bind(c);this.addHandler(a,b)}},this)},addHandler:function(a,b){var c=a;this.handlers[c]||(this.handlers[c]=[]),this.handlers[c].push(b)},registerTarget:function(a){this.listen(this.events,a)},unregisterTarget:function(a){this.unlisten(this.events,a)},eventHandler:function(a){if(!this.handledEvents.get(a)){var b,c=a.type;(b=this.handlers[c])&&this.makeQueue(b,a),this.handledEvents.set(a,!0)}},makeQueue:function(a,b){var c=this.cloneEvent(b);setTimeout(this.runQueue.bind(this,a,c),0)},runQueue:function(a,b){this.currentPointerId=b.pointerId;for(var c,d=0,e=a.length;e>d&&(c=a[d]);d++)c(b);this.currentPointerId=0},listen:function(a,b){a.forEach(function(a){this.addEvent(a,this.boundHandler,!1,b)},this)},unlisten:function(a){a.forEach(function(a){this.removeEvent(a,this.boundHandler,!1,inTarget)},this)},addEvent:function(a,b,c,d){d.addEventListener(a,b,c)},removeEvent:function(a,b,c,d){d.removeEventListener(a,b,c)},makeEvent:function(a,b){return new PointerGestureEvent(a,b)},cloneEvent:function(a){var b={};for(var c in a)b[c]=a[c];return b},dispatchEvent:function(a,b){var c=b||this.targets.get(a);c&&(c.dispatchEvent(a),a.tapPrevented&&this.preventTap(this.currentPointerId))},asyncDispatchEvent:function(a,b){var c=function(){this.dispatchEvent(a,b)}.bind(this);setTimeout(c,0)},preventTap:function(a){var b=this.recognizers.tap;b&&b.preventTap(a)}};b.boundHandler=b.eventHandler.bind(b),a.dispatcher=b,a.register=function(b){var c=window.PointerEventsPolyfill;c&&c.register(b),a.dispatcher.registerTarget(b)},b.registerTarget(document)}(window.PointerGestures),function(a){var b=a.dispatcher,c={HOLD_DELAY:200,WIGGLE_THRESHOLD:16,events:["pointerdown","pointermove","pointerup","pointercancel"],heldPointer:null,holdJob:null,pulse:function(){var a=Date.now()-this.heldPointer.timeStamp,b=this.held?"holdpulse":"hold";this.fireHold(b,a),this.held=!0},cancel:function(){clearInterval(this.holdJob),this.held&&this.fireHold("release"),this.held=!1,this.heldPointer=null,this.target=null,this.holdJob=null},pointerdown:function(a){a.isPrimary&&!this.heldPointer&&(this.heldPointer=a,this.target=a.target,this.holdJob=setInterval(this.pulse.bind(this),this.HOLD_DELAY))},pointerup:function(a){this.heldPointer&&this.heldPointer.pointerId===a.pointerId&&this.cancel()},pointercancel:function(){this.cancel()},pointermove:function(a){if(this.heldPointer&&this.heldPointer.pointerId===a.pointerId){var b=a.clientX-this.heldPointer.clientX,c=a.clientY-this.heldPointer.clientY;b*b+c*c>this.WIGGLE_THRESHOLD&&this.cancel()}},fireHold:function(a,c){var d={pointerType:this.heldPointer.pointerType};c&&(d.holdTime=c);var e=b.makeEvent(a,d);b.dispatchEvent(e,this.target),e.tapPrevented&&b.preventTap(this.heldPointer.pointerId)}};b.registerRecognizer("hold",c)}(window.PointerGestures),function(a){var b=a.dispatcher,c=new a.PointerMap,d={events:["pointerdown","pointermove","pointerup","pointercancel"],WIGGLE_THRESHOLD:4,clampDir:function(a){return a>0?1:-1},calcPositionDelta:function(a,b){var c=0,d=0;return a&&b&&(c=b.pageX-a.pageX,d=b.pageY-a.pageY),{x:c,y:d}},fireTrack:function(a,c,d){var e=d,f=this.calcPositionDelta(e.downEvent,c),g=this.calcPositionDelta(e.lastMoveEvent,c);g.x&&(e.xDirection=this.clampDir(g.x)),g.y&&(e.yDirection=this.clampDir(g.y));var h={dx:f.x,dy:f.y,ddx:g.x,ddy:g.y,clientX:c.clientX,clientY:c.clientY,pageX:c.pageX,pageY:c.pageY,screenX:c.screenX,screenY:c.screenY,xDirection:e.xDirection,yDirection:e.yDirection,trackInfo:e.trackInfo,pointerType:c.pointerType};"trackend"===a&&(h._releaseTarget=c.target);var i=b.makeEvent(a,h);e.lastMoveEvent=c,b.dispatchEvent(i,e.downTarget)},pointerdown:function(a){if(a.isPrimary&&("mouse"===a.pointerType?1===a.buttons:!0)){var b={downEvent:a,downTarget:a.target,trackInfo:{},lastMoveEvent:null,xDirection:0,yDirection:0,tracking:!1};c.set(a.pointerId,b)}},pointermove:function(a){var b=c.get(a.pointerId);if(b)if(b.tracking)this.fireTrack("track",a,b);else{var d=this.calcPositionDelta(b.downEvent,a),e=d.x*d.x+d.y*d.y;e>this.WIGGLE_THRESHOLD&&(b.tracking=!0,this.fireTrack("trackstart",b.downEvent,b),this.fireTrack("track",a,b))}},pointerup:function(a){var b=c.get(a.pointerId);b&&(b.tracking&&this.fireTrack("trackend",a,b),c.delete(a.pointerId))},pointercancel:function(a){this.pointerup(a)}};b.registerRecognizer("track",d)}(window.PointerGestures),function(a){var b=a.dispatcher,c={MIN_VELOCITY:.5,MAX_QUEUE:4,moveQueue:[],target:null,pointerId:null,events:["pointerdown","pointermove","pointerup","pointercancel"],pointerdown:function(a){a.isPrimary&&!this.pointerId&&(this.pointerId=a.pointerId,this.target=a.target,this.addMove(a))},pointermove:function(a){a.pointerId===this.pointerId&&this.addMove(a)},pointerup:function(a){a.pointerId===this.pointerId&&this.fireFlick(a),this.cleanup()},pointercancel:function(){this.cleanup()},cleanup:function(){this.moveQueue=[],this.target=null,this.pointerId=null},addMove:function(a){this.moveQueue.length>=this.MAX_QUEUE&&this.moveQueue.shift(),this.moveQueue.push(a)},fireFlick:function(a){for(var c,d,e,f,g,h,i,j=a,k=this.moveQueue.length,l=0,m=0,n=0,o=0;k>o&&(i=this.moveQueue[o]);o++)c=j.timeStamp-i.timeStamp,d=j.clientX-i.clientX,e=j.clientY-i.clientY,f=d/c,g=e/c,h=Math.sqrt(f*f+g*g),h>n&&(l=f,m=g,n=h);var p=Math.abs(l)>Math.abs(m)?"x":"y",q=this.calcAngle(l,m);if(Math.abs(n)>=this.MIN_VELOCITY){var r=b.makeEvent("flick",{xVelocity:l,yVelocity:m,velocity:n,angle:q,majorAxis:p,pointerType:a.pointerType});b.dispatchEvent(r,this.target)}},calcAngle:function(a,b){return 180*Math.atan2(b,a)/Math.PI}};b.registerRecognizer("flick",c)}(window.PointerGestures),function(a){var b=a.dispatcher,c=new a.PointerMap,d={events:["pointerdown","pointermove","pointerup","pointercancel"],pointerdown:function(a){a.isPrimary&&!a.tapPrevented&&c.set(a.pointerId,{target:a.target,x:a.clientX,y:a.clientY})},pointermove:function(a){if(a.isPrimary){var b=c.get(a.pointerId);b&&a.tapPrevented&&c.delete(a.pointerId)}},pointerup:function(d){var e=c.get(d.pointerId);if(e&&!d.tapPrevented){var f=a.findLCA(e.target,d.target);if(f){var g=b.makeEvent("tap",{x:d.clientX,y:d.clientY,detail:d.detail,pointerType:d.pointerType});b.dispatchEvent(g,f)}}c.delete(d.pointerId)},pointercancel:function(a){c.delete(a.pointerId)},preventTap:function(a){c.delete(a)}};b.registerRecognizer("tap",d)}(window.PointerGestures),Polymer={},function(){var a=document.createElement("style");a.textContent="body {opacity: 0;}";var b=document.querySelector("head");b.insertBefore(a,b.firstChild),window.addEventListener("WebComponentsReady",function(){document.body.style.webkitTransition="opacity 0.3s",document.body.style.opacity=1})}(Polymer),function(a){function b(a,b){return a&&b&&Object.getOwnPropertyNames(b).forEach(function(c){var d=Object.getOwnPropertyDescriptor(b,c);d&&(Object.defineProperty(a,c,d),"function"==typeof d.value&&(a[c].nom=c))}),a}a.extend=b}(Polymer),function(a){function b(a,b,d){return a?a.stop():a=new c(this),a.go(b,d),a}var c=function(a){this.context=a};c.prototype={go:function(a,b){this.callback=a,this.handle=setTimeout(this.complete.bind(this),b)},stop:function(){this.handle&&(clearTimeout(this.handle),this.handle=null)},complete:function(){this.handle&&(this.stop(),this.callback.call(this.context))}},a.job=b}(Polymer),function(){var a={};HTMLElement.register=function(b,c){a[b]=c},HTMLElement.getPrototypeForTag=function(b){var c=b?a[b]:HTMLElement.prototype;return c||Object.getPrototypeOf(document.createElement(b))};var b=Event.prototype.stopPropagation;Event.prototype.stopPropagation=function(){this.cancelBubble=!0,b.apply(this,arguments)},HTMLImports.importer.preloadSelectors+=", polymer-element link[rel=stylesheet]"}(Polymer),function(a){function b(a){var c=b.caller,g=c.nom;"_super"in c||(g||(g=e.call(this,c)),g||console.warn("called super() on a method not installed declaratively (has no .nom property)"),d(c,g,f(this)));var h=c._super;if(h){var i=h[g];return"_super"in i||d(i,g,h),i.apply(this,a||[])}}function c(a,b,c){for(;a&&(!a.hasOwnProperty(b)||a[b]===c);)a=f(a);return a}function d(a,b,d){return a._super=c(d,b,a),a._super&&(a._super[b].nom=b),a._super}function e(a){console.warn("nameInThis called");for(var b=this;b&&b!==HTMLElement.prototype;){for(var c,d=Object.getOwnPropertyNames(b),e=0,f=d.length;f>e&&(c=d[e]);e++){var g=Object.getOwnPropertyDescriptor(b,c);if(g.value==a)return c}b=b.__proto__}}function f(a){return a.__proto__}a.super=b}(Polymer),function(a){function b(a,b){var d=typeof b;return b instanceof Date&&(d="date"),c[d](a,b)}var c={string:function(a){return a},date:function(a){return new Date(Date.parse(a)||Date.now())},"boolean":function(a){return""===a?!0:"false"===a?!1:!!a},number:function(a){var b=parseFloat(a);return String(b)===a?b:a},object:function(a,b){if(null===b)return a;try{return JSON.parse(a.replace(/'/g,'"'))}catch(c){return a}}};a.deserializeValue=b}(Polymer),function(a){var b={};b.declaration={},b.instance={},a.api=b}(Polymer),function(a){var b={async:function(a,b,c){Platform.flush(),b=b&&b.length?b:[b];var d=function(){(this[a]||a).apply(this,b)}.bind(this);return c?setTimeout(d,c):requestAnimationFrame(d)},fire:function(a,b,c,d){var e=c||this;return e.dispatchEvent(new CustomEvent(a,{bubbles:void 0!==d?!1:!0,detail:b})),b},asyncFire:function(){this.asyncMethod("fire",arguments)},classFollows:function(a,b,c){b&&b.classList.remove(c),a&&a.classList.add(c)}};b.asyncMethod=b.async,a.api.instance.utils=b}(Polymer),function(a){function b(a,b){b.cancelBubble||(b.on=i+b.type,h.events&&console.group("[%s]: listenLocal [%s]",a.localName,b.on),!b.path||window.ShadowDOMPolyfill?d(a,b):c(a,b),h.events&&console.groupEnd())}function c(a,b){var c=null;Array.prototype.some.call(b.path,function(d){return d===a?!0:(c=c===a?c:e(d),c&&f(c,d,b)?!0:void 0)},this)}function d(a,b){h.events&&console.log("event.path() not supported for",b.type);for(var c=b.target,d=null;c&&c!=a;){if(d=d===a?d:e(c),d&&f(d,c,b))return!0;c=c.parentNode}}function e(a){for(;a.parentNode;)a=a.parentNode;return a.host}function f(a,b,c){var d=b.getAttribute&&b.getAttribute(c.on);return d&&g(b,c)&&(h.events&&console.log("[%s] found handler name [%s]",a.localName,d),a.dispatchMethod(b,d,[c,c.detail,b])),c.cancelBubble}function g(a,b){var c=l.get(b);return c||l.set(b,c=[]),c.indexOf(a)<0?(c.push(a),!0):void 0}var h=window.logFlags||{},i="on-",j="eventDelegates",k={EVENT_PREFIX:i,DELEGATES:j,addHostListeners:function(){var a=this[j];h.events&&Object.keys(a).length>0&&console.log("[%s] addHostListeners:",this.localName,a),this.addNodeListeners(this,a,this.hostEventListener)},addInstanceListeners:function(a,b){var c=b.delegates;c&&(h.events&&Object.keys(c).length>0&&console.log("[%s:root] addInstanceListeners:",this.localName,c),this.addNodeListeners(a,c,this.instanceEventListener))},addNodeListeners:function(a,b,c){var d;for(var e in b)d||(d=c.bind(this)),a.addEventListener(e,d)},hostEventListener:function(a){if(!a.cancelBubble){h.events&&console.group("[%s]: hostEventListener(%s)",this.localName,a.type);var b=this.findEventDelegate(a);b&&(h.events&&console.log("[%s] found host handler name [%s]",this.localName,b),this.dispatchMethod(this,b,[a,a.detail,this])),h.events&&console.groupEnd()}},findEventDelegate:function(a){return this[j][a.type]},dispatchMethod:function(a,b,c){if(a){h.events&&console.group("[%s] dispatch [%s]",a.localName,b);var d=this[b];d&&d[c?"apply":"call"](this,c),h.events&&console.groupEnd()}},instanceEventListener:function(a){b(this,a)}},l=new SideTable("handledList");a.api.instance.events=k}(Polymer),function(a){var b="__published",c="__instance_attributes",d={PUBLISHED:b,INSTANCE_ATTRIBUTES:c,copyInstanceAttributes:function(){var a=this[c];for(var b in a)this.setAttribute(b,a[b])},takeAttributes:function(){for(var a,b=0,c=this.attributes,d=c.length;(a=c[b])&&d>b;b++)this.attributeToProperty(a.name,a.value)},attributeToProperty:function(b,c){var b=this.propertyForAttribute(b);if(b){if(c.search(a.bindPattern)>=0)return;var d=this[b],c=this.deserializeValue(c,d);c!==d&&(this[b]=c)}},propertyForAttribute:function(a){var c=Object.keys(this[b]);return c[c.map(e).indexOf(a.toLowerCase())]},deserializeValue:function(b,c){return a.deserializeValue(b,c)},serializeValue:function(a){return"object"!=typeof a&&void 0!==a?a:void 0},propertyToAttribute:function(a){if(Object.keys(this[b]).indexOf(a)>=0){var c=this.serializeValue(this[a]);void 0!==c&&this.setAttribute(a,c)}}},e=String.prototype.toLowerCase.call.bind(String.prototype.toLowerCase);a.api.instance.attributes=d}(Polymer),function(a){function b(a,b){var c=this[a]||a;"function"==typeof c&&c.apply(this,b)}function c(a,b,c,d){h.bind&&console.log(o,c.localName||"object",d,a.localName,b);var e=PathObserver.getValueAtPath(c,d);return(null===e||void 0===e)&&PathObserver.setValueAtPath(c,d,a[b]),PathObserver.defineProperty(a,b,{object:c,path:d})}function d(a,b,c){var d=g(a);d[b]=c}function e(a,b){var c=g(a);return c&&c[b]?(c[b].close(),c[b]=null,!0):void 0}function f(a){var b=g(a);Object.keys(b).forEach(function(a){b[a].close(),b[a]=null})}function g(a){var b=l.get(a);return b||l.set(a,b={}),b}var h=window.logFlags||{},i="Changed",j=a.api.instance.attributes.PUBLISHED,k={observeProperties:function(){for(var a,b=this.getCustomPropertyNames(),c=0,d=b.length;d>c&&(a=b[c]);c++)this.observeProperty(a)},getCustomPropertyNames:function(){return this.customPropertyNames},observeProperty:function(a){if(this.shouldObserveProperty(a)){h.watch&&console.log(m,this.localName,a);var b=function(b,c){h.watch&&console.log(n,this.localName,this.id||"",a,this[a],c),this.dispatchPropertyChange(a,c)}.bind(this),c=new PathObserver(this,a,b);d(this,a,c)}},bindProperty:function(a,b,d){return c(this,a,b,d)},unbindProperty:function(a,b){return e(this,a,b)},unbindAllProperties:function(){f(this)},shouldObserveProperty:function(a){return Boolean(this[a+i]||Object.keys(this[j]).indexOf(a)>=0)},dispatchPropertyChange:function(a,c){this.propertyToAttribute(a),b.call(this,a+i,[c])}},l=new SideTable,m="[%s] watching [%s]",n="[%s#%s] watch: [%s] now [%s] was [%s]",o="[%s]: bindProperties: [%s] to [%s].[%s]";a.api.instance.properties=k}(Polymer),function(a){function b(a){d(a,c)}function c(a){a.unbindAll()}function d(a,b){if(a){b(a);for(var c=a.firstChild;c;c=c.nextSibling)d(c,b)}}var e=window.logFlags||0,f=new ExpressionSyntax,g={instanceTemplate:function(a){return a.createInstance(this,f)},createBinding:function(a,b,c){var d=this.propertyForAttribute(a);if(d){var e=this.bindProperty(d,b,c);return e.path=c,e}return this.super(arguments)},asyncUnbindAll:function(){this._unbound||(e.unbind&&console.log("[%s] asyncUnbindAll",this.localName),this._unbindAllJob=this.job(this._unbindAllJob,this.unbindAll,0))},unbindAll:function(){this._unbound||(this.unbindAllProperties(),this.super(),b(this.shadowRoot),this._unbound=!0)},cancelUnbindAll:function(a){return this._unbound?(e.unbind&&console.warn("[%s] already unbound, cannot cancel unbindAll",this.localName),void 0):(e.unbind&&console.log("[%s] cancelUnbindAll",this.localName),this._unbindAllJob&&(this._unbindAllJob=this._unbindAllJob.stop()),a||d(this.shadowRoot,function(a){a.cancelUnbindAll&&a.cancelUnbindAll()}),void 0)}},h=/\{\{([^{}]*)}}/;a.bindPattern=h,a.api.instance.mdv=g}(Polymer),function(a){function b(a){return a.hasOwnProperty("PolymerBase")}function c(){}var d={PolymerBase:!0,job:Polymer.job,"super":Polymer.super,ready:function(){},readyCallback:function(){this._createdCallback()},createdCallback:function(){this._createdCallback()},_createdCallback:function(){this.observeProperties(),this.copyInstanceAttributes(),this.takeAttributes(),this.addHostListeners(),this.parseElements(this.__proto__),this.ready()},insertedCallback:function(){this._enteredDocumentCallback()},enteredDocumentCallback:function(){this._enteredDocumentCallback()},_enteredDocumentCallback:function(){this.cancelUnbindAll(!0),this.inserted&&this.inserted(),this.enteredDocument&&this.enteredDocument()},removedCallback:function(){this._leftDocumentCallback()},leftDocumentCallback:function(){this._leftDocumentCallback()},_leftDocumentCallback:function(){this.asyncUnbindAll(),this.removed&&this.removed(),this.leftDocument&&this.leftDocument()},parseElements:function(a){a&&a.element&&(this.parseElements(a.__proto__),a.parseElement.call(this,a.element))},parseElement:function(a){this.shadowFromTemplate(this.fetchTemplate(a))},fetchTemplate:function(a){return a.querySelector("template")},shadowFromTemplate:function(a){if(a){this.shadowRoot;var b=this.createShadowRoot();b.applyAuthorStyles=this.applyAuthorStyles,b.resetStyleInheritance=this.resetStyleInheritance;var c=this.instanceTemplate(a);return b.appendChild(c),this.shadowRootReady(b,a),b}},shadowRootReady:function(a,b){this.marshalNodeReferences(a),this.addInstanceListeners(a,b),PointerGestures.register(a)},marshalNodeReferences:function(a){var b=this.$=this.$||{};if(a)for(var c,d=a.querySelectorAll("[id]"),e=0,f=d.length;f>e&&(c=d[e]);e++)b[c.id]=c},attributeChangedCallback:function(a){this.attributeToProperty(a,this.getAttribute(a)),this.attributeChanged&&this.attributeChanged.apply(this,arguments)}};c.prototype=d,d.constructor=c,a.Base=c,a.isBase=b,a.api.instance.base=d}(Polymer),function(a){function b(a){return a.__proto__}window.logFlags||{};var c="element",d="controller",e={STYLE_SCOPE_ATTRIBUTE:c,installControllerStyles:function(){var a=this.findStyleController();if(a&&!this.scopeHasElementStyle(a,d)){for(var c=b(this),e="";c&&c.element;)e+=c.element.cssTextForScope(d),c=b(c);if(e){var f=this.element.cssTextToScopeStyle(e,d);window.ShadowDOMPolyfill&&Platform.ShadowCSS.shimPolyfillDirectives([f],this.localName),Polymer.applyStyleToScope(f,a)}}},scopeHasElementStyle:function(a,b){var d=c+"="+this.localName+"-"+b;return a.querySelector("style["+d+"]")},findStyleController:function(){if(window.ShadowDOMPolyfill)return wrap(document.head);for(var a=this;a.parentNode;)a=a.parentNode;return a===document?document.head:a}};a.api.instance.styles=e}(Polymer),function(a){var b={addResolvePathApi:function(){var a=this.elementPath();this.prototype.resolvePath=function(b){return a+b}},elementPath:function(){return this.urlToPath(HTMLImports.getDocumentUrl(this.ownerDocument))},urlToPath:function(a){if(a){var b=a.split("/");return b.pop(),b.push(""),b.join("/")}return""}};a.api.declaration.path=b}(Polymer),function(a){function b(a,b){if(a){var d=c(a.textContent),e=a.getAttribute(g);e&&d.setAttribute(g,e),b.appendChild(d)}}function c(a){var b=document.createElement("style");return b.textContent=a,b}function d(a){return a&&a.__resource||""}function e(a,b){return n?n.call(a,b):void 0}window.logFlags||{};var f=a.api.instance.styles,g=f.STYLE_SCOPE_ATTRIBUTE,h="style",i="[rel=stylesheet]",j="global",k="polymer-scope",l={installSheets:function(){this.cacheSheets(),this.installLocalSheets(),this.installGlobalStyles()},cacheSheets:function(){this.sheets=this.findNodes(i),this.sheets.forEach(function(a){a.parentNode&&a.parentNode.removeChild(a)})},installLocalSheets:function(){var a=this.sheets.filter(function(a){return!a.hasAttribute(k)}),b=this.templateContent();if(b){var e="";a.forEach(function(a){e+=d(a)+"\n"}),e&&b.insertBefore(c(e),b.firstChild)}},findNodes:function(a,b){var c=this.querySelectorAll(a).array(),d=this.templateContent();if(d){var e=d.querySelectorAll(a).array();c=c.concat(e)}return b?c.filter(b):c},templateContent:function(){var a=this.querySelector("template");return a&&templateContent(a)},installGlobalStyles:function(){var a=this.styleForScope(j);b(a,document.head)},cssTextForScope:function(a){var b="",c="["+k+"="+a+"]",f=function(a){return e(a,c)},g=this.sheets.filter(f);g.forEach(function(a){b+=d(a)+"\n\n"});var i=this.findNodes(h,f);return i.forEach(function(a){a.parentNode.removeChild(a),b+=a.textContent+"\n\n"}),b},styleForScope:function(a){var b=this.cssTextForScope(a);return this.cssTextToScopeStyle(b,a)},cssTextToScopeStyle:function(a,b){if(a){var d=c(a);return d.setAttribute(g,this.getAttribute("name")+"-"+b),d}}},m=HTMLElement.prototype,n=m.matches||m.matchesSelector||m.webkitMatchesSelector||m.mozMatchesSelector;a.api.declaration.styles=l,a.applyStyleToScope=b}(Polymer),function(a){function b(a){return a.slice(0,k)==g}function c(a){return a.slice(k)}function d(a){return a.ref?a.ref.content:a.content}var e=a.api.instance.events,f=e.DELEGATES,g=e.EVENT_PREFIX,h=window.logFlags||{},i={inheritDelegates:function(a){this.inheritObject(a,f)},parseHostEvents:function(){var a=this.prototype[f];this.addAttributeDelegates(a)},addAttributeDelegates:function(a){for(var d,e=0;d=this.attributes[e];e++)b(d.name)&&(a[c(d.name)]=d.value)},parseLocalEvents:function(){this.querySelectorAll("template").forEach(function(a){a.delegates={},this.accumulateTemplatedEvents(a,a.delegates),h.events&&console.log("[%s] parseLocalEvents:",this.attributes.name.value,a.delegates)},this)},accumulateTemplatedEvents:function(a,b){if("template"===a.localName){var c=d(a);c&&this.accumulateChildEvents(c,b)}},accumulateChildEvents:function(a,b){a.childNodes.forEach(function(a){this.accumulateEvents(a,b)},this)},accumulateEvents:function(a,b){return this.accumulateAttributeEvents(a,b),this.accumulateChildEvents(a,b),this.accumulateTemplatedEvents(a,b),b},accumulateAttributeEvents:function(a,d){a.attributes&&a.attributes.forEach(function(a){b(a.name)&&this.accumulateEvent(c(a.name),d)},this)},accumulateEvent:function(a,b){a=j[a]||a,b[a]=b[a]||1}},j={webkitanimationstart:"webkitAnimationStart",webkitanimationend:"webkitAnimationEnd",webkittransitionend:"webkitTransitionEnd",domfocusout:"DOMFocusOut",domfocusin:"DOMFocusIn"},k=g.length;i.event_translations=j,a.api.declaration.events=i}(Polymer),function(a){var b=[],c={cacheProperties:function(){this.prototype.customPropertyNames=this.getCustomPropertyNames(this.prototype)},getCustomPropertyNames:function(c){for(var d,e={};c&&!a.isBase(c);){for(var f,g=Object.getOwnPropertyNames(c),h=0,i=g.length;i>h&&(f=g[h]);h++)e[f]=!0,d=!0;c=c.__proto__}return d?Object.keys(e):b}};a.api.declaration.properties=c}(Polymer),function(a){var b=a.api.instance.attributes,c=b.PUBLISHED,d=b.INSTANCE_ATTRIBUTES,e="publish",f="attributes",g={inheritAttributesObjects:function(a){this.inheritObject(a,c),this.inheritObject(a,d)},parseAttributes:function(){this.publishAttributes(this.prototype),this.publishProperties(this.prototype),this.accumulateInstanceAttributes()},publishAttributes:function(a){var b=a[c],d=this.getAttribute(f);if(d){var e=d.split(d.indexOf(",")>=0?",":" ");e.forEach(function(a){a=a.trim(),!a||a in b||(b[a]=null)})}Object.keys(b).forEach(function(c){c in a||(a[c]=b[c])})},publishProperties:function(a){this.publishPublish(a)},publishPublish:function(a){if(a.hasOwnProperty(e)){var b=a[e];b&&(Object.keys(b).forEach(function(c){a[c]=b[c]}),Platform.mixin(a[c],b))}},accumulateInstanceAttributes:function(){var a=this.prototype[d];this.attributes.forEach(function(b){this.isInstanceAttribute(b.name)&&(a[b.name]=b.value)},this)},isInstanceAttribute:function(a){return!this.blackList[a]&&"on-"!==a.slice(0,3)},blackList:{name:1,"extends":1,constructor:1,noscript:1}};g.blackList[f]=1,a.api.declaration.attributes=g}(Polymer),function(a){function b(a,b){h[a]=b||{},g[a]&&g[a].define()}function c(a){return Object.create(HTMLElement.getPrototypeForTag(a))}function d(b){if(!Object.__proto__){var c=Object.getPrototypeOf(b);b.__proto__=c,a.isBase(c)&&(c.__proto__=Object.getPrototypeOf(c))}}var e=Polymer.extend,f=a.api.declaration,g={},h={},i=c();e(i,{readyCallback:function(){this._createdCallback()},createdCallback:function(){this._createdCallback()},_createdCallback:function(){var a=this.getAttribute("name");h[a]?this.define():g[a]=this},define:function(){var a=this.getAttribute("name"),b=this.getAttribute("extends");this.prototype=this.generateCustomPrototype(a,b),this.prototype.element=this,this.addResolvePathApi(),d(this.prototype),this.desugar(),window.ShadowDOMPolyfill&&Platform.ShadowCSS.shimStyling(this.templateContent(),a,b),this.register(a),this.publishConstructor()},desugar:function(){this.parseAttributes(),this.parseHostEvents(),this.parseLocalEvents(),this.installSheets(),this.prototype.registerCallback&&this.prototype.registerCallback(this),this.cacheProperties()},generateCustomPrototype:function(a,b){var c=this.generateBasePrototype(b);return this.addNamedApi(c,a)},generateBasePrototype:function(a){var b=c(a);return this.ensureBaseApi(b)},ensureBaseApi:function(b){return b.PolymerBase||(Object.keys(a.api.instance).forEach(function(c){e(b,a.api.instance[c])}),b=Object.create(b)),this.inheritAttributesObjects(b),this.inheritDelegates(b),b},addNamedApi:function(a,b){return e(a,h[b])},inheritObject:function(a,b){a[b]=e({},Object.getPrototypeOf(a)[b])},register:function(a){this.ctor=document.register(a,{prototype:this.prototype}),this.prototype.constructor=this.ctor,HTMLElement.register(a,this.prototype)},publishConstructor:function(){var a=this.getAttribute("constructor");a&&(window[a]=this.ctor)}}),Object.keys(f).forEach(function(a){e(i,f[a])}),document.register("polymer-element",{prototype:i}),e(b,window.Polymer),window.Polymer=b}(Polymer),Polymer.register=function(a){if(a!=window){var b=a.getAttribute("name");throw new Error("Polymer.register is deprecated in declaration of "+b+". Please see http://www.polymer-project.org/getting-started.html")}}; -/* -//@ sourceMappingURL=polymer.sandbox.min.js.map -*/ \ No newline at end of file diff --git a/architecture-examples/polymer/bower_components/todomvc-common/.bower.json b/architecture-examples/polymer/bower_components/todomvc-common/.bower.json deleted file mode 100644 index 5f7f85b354..0000000000 --- a/architecture-examples/polymer/bower_components/todomvc-common/.bower.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "todomvc-common", - "version": "0.1.7", - "homepage": "https://github.com/tastejs/todomvc-common", - "_release": "0.1.7", - "_resolution": { - "type": "version", - "tag": "v0.1.7", - "commit": "e5b3251c95f29d872636b761e32a2296dc97c3e0" - }, - "_source": "git://github.com/tastejs/todomvc-common.git", - "_target": "~0.1.4" -} \ No newline at end of file