├── .gitignore ├── README.md ├── bower_components └── webcomponentsjs │ ├── .bower.json │ ├── CustomElements.js │ ├── CustomElements.min.js │ ├── HTMLImports.js │ ├── HTMLImports.min.js │ ├── MutationObserver.js │ ├── MutationObserver.min.js │ ├── README.md │ ├── ShadowDOM.js │ ├── ShadowDOM.min.js │ ├── bower.json │ ├── build.log │ ├── package.json │ ├── webcomponents-lite.js │ ├── webcomponents-lite.min.js │ ├── webcomponents.js │ └── webcomponents.min.js ├── demo ├── index.html └── sizing.html ├── package.json └── src └── multiselect.html /.gitignore: -------------------------------------------------------------------------------- 1 | .idea -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Multiselect Web Component 2 | 3 | A multiselect widget created using [Web Components](https://www.w3.org/TR/components-intro/). 4 | 5 | ![multiselect web component](http://tabalinas.github.io/multiselect-web-component/images/demo.png) 6 | 7 | 8 | ## Demo 9 | 10 | [Multiselect Demo](http://tabalinas.github.io/multiselect-web-component) 11 | 12 | 13 | ## Usage 14 | 15 | Import `multiselect.html` and use `` element. Define items with `
  • ` elements. To make an item selected add `selected` attribute. 16 | 17 | ```html 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
  • Item 1
  • 27 |
  • Item 2
  • 28 |
  • Item 3
  • 29 |
  • Item 4
  • 30 |
    31 | 32 | 33 | ``` 34 | 35 | 36 | ## API 37 | 38 | ### Attribute `placeholder` 39 | 40 | Add attribure `placeholder` to set multiselect placeholder (text to be displayed when no items are selected). 41 | 42 | ```html 43 | 44 | ... 45 | 46 | ``` 47 | 48 | ### Method `selectedItems()` 49 | 50 | Returns selected item values as an Array. 51 | 52 | ```js 53 | // returns an array of values, e.g. [1, 3] 54 | var selectedItems = multiselect.selectedItems(); 55 | ``` 56 | 57 | ### Event `change` 58 | 59 | Is fired each time selected items are changes. 60 | 61 | ```js 62 | multiselect.addEventListener('change', function() { 63 | // print selected items to console 64 | console.log('Selected items:', this.selectedItems()); 65 | }); 66 | ``` 67 | 68 | ## Browser Support 69 | 70 | Browser support is limited by support of [Web Components](http://caniuse.com/#search=components). 71 | 72 | Add [webcomponentjs](https://github.com/webcomponents/webcomponentsjs) polyfill to be able to use the component in all modern browsers. 73 | 74 | ## License 75 | 76 | The MIT License (MIT) 77 | 78 | Copyright (c) 2016 SitePoint 79 | 80 | 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: 81 | 82 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 83 | 84 | 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. 85 | -------------------------------------------------------------------------------- /bower_components/webcomponentsjs/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webcomponentsjs", 3 | "main": "webcomponents.js", 4 | "version": "0.7.18", 5 | "homepage": "http://webcomponents.org", 6 | "authors": [ 7 | "The Polymer Authors" 8 | ], 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/webcomponents/webcomponentsjs.git" 12 | }, 13 | "keywords": [ 14 | "webcomponents" 15 | ], 16 | "license": "BSD", 17 | "ignore": [], 18 | "devDependencies": { 19 | "web-component-tester": "~3.3.10" 20 | }, 21 | "_release": "0.7.18", 22 | "_resolution": { 23 | "type": "version", 24 | "tag": "v0.7.18", 25 | "commit": "acdd43ad41c15e1834458da01d228ab22a224051" 26 | }, 27 | "_source": "git://github.com/Polymer/webcomponentsjs.git", 28 | "_target": "~0.7.18", 29 | "_originalSource": "webcomponentsjs", 30 | "_direct": true 31 | } -------------------------------------------------------------------------------- /bower_components/webcomponentsjs/CustomElements.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | * Code distributed by Google as part of the polymer project is also 8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | // @version 0.7.18 11 | if (typeof WeakMap === "undefined") { 12 | (function() { 13 | var defineProperty = Object.defineProperty; 14 | var counter = Date.now() % 1e9; 15 | var WeakMap = function() { 16 | this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__"); 17 | }; 18 | WeakMap.prototype = { 19 | set: function(key, value) { 20 | var entry = key[this.name]; 21 | if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, { 22 | value: [ key, value ], 23 | writable: true 24 | }); 25 | return this; 26 | }, 27 | get: function(key) { 28 | var entry; 29 | return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined; 30 | }, 31 | "delete": function(key) { 32 | var entry = key[this.name]; 33 | if (!entry || entry[0] !== key) return false; 34 | entry[0] = entry[1] = undefined; 35 | return true; 36 | }, 37 | has: function(key) { 38 | var entry = key[this.name]; 39 | if (!entry) return false; 40 | return entry[0] === key; 41 | } 42 | }; 43 | window.WeakMap = WeakMap; 44 | })(); 45 | } 46 | 47 | (function(global) { 48 | if (global.JsMutationObserver) { 49 | return; 50 | } 51 | var registrationsTable = new WeakMap(); 52 | var setImmediate; 53 | if (/Trident|Edge/.test(navigator.userAgent)) { 54 | setImmediate = setTimeout; 55 | } else if (window.setImmediate) { 56 | setImmediate = window.setImmediate; 57 | } else { 58 | var setImmediateQueue = []; 59 | var sentinel = String(Math.random()); 60 | window.addEventListener("message", function(e) { 61 | if (e.data === sentinel) { 62 | var queue = setImmediateQueue; 63 | setImmediateQueue = []; 64 | queue.forEach(function(func) { 65 | func(); 66 | }); 67 | } 68 | }); 69 | setImmediate = function(func) { 70 | setImmediateQueue.push(func); 71 | window.postMessage(sentinel, "*"); 72 | }; 73 | } 74 | var isScheduled = false; 75 | var scheduledObservers = []; 76 | function scheduleCallback(observer) { 77 | scheduledObservers.push(observer); 78 | if (!isScheduled) { 79 | isScheduled = true; 80 | setImmediate(dispatchCallbacks); 81 | } 82 | } 83 | function wrapIfNeeded(node) { 84 | return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node; 85 | } 86 | function dispatchCallbacks() { 87 | isScheduled = false; 88 | var observers = scheduledObservers; 89 | scheduledObservers = []; 90 | observers.sort(function(o1, o2) { 91 | return o1.uid_ - o2.uid_; 92 | }); 93 | var anyNonEmpty = false; 94 | observers.forEach(function(observer) { 95 | var queue = observer.takeRecords(); 96 | removeTransientObserversFor(observer); 97 | if (queue.length) { 98 | observer.callback_(queue, observer); 99 | anyNonEmpty = true; 100 | } 101 | }); 102 | if (anyNonEmpty) dispatchCallbacks(); 103 | } 104 | function removeTransientObserversFor(observer) { 105 | observer.nodes_.forEach(function(node) { 106 | var registrations = registrationsTable.get(node); 107 | if (!registrations) return; 108 | registrations.forEach(function(registration) { 109 | if (registration.observer === observer) registration.removeTransientObservers(); 110 | }); 111 | }); 112 | } 113 | function forEachAncestorAndObserverEnqueueRecord(target, callback) { 114 | for (var node = target; node; node = node.parentNode) { 115 | var registrations = registrationsTable.get(node); 116 | if (registrations) { 117 | for (var j = 0; j < registrations.length; j++) { 118 | var registration = registrations[j]; 119 | var options = registration.options; 120 | if (node !== target && !options.subtree) continue; 121 | var record = callback(options); 122 | if (record) registration.enqueue(record); 123 | } 124 | } 125 | } 126 | } 127 | var uidCounter = 0; 128 | function JsMutationObserver(callback) { 129 | this.callback_ = callback; 130 | this.nodes_ = []; 131 | this.records_ = []; 132 | this.uid_ = ++uidCounter; 133 | } 134 | JsMutationObserver.prototype = { 135 | observe: function(target, options) { 136 | target = wrapIfNeeded(target); 137 | if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) { 138 | throw new SyntaxError(); 139 | } 140 | var registrations = registrationsTable.get(target); 141 | if (!registrations) registrationsTable.set(target, registrations = []); 142 | var registration; 143 | for (var i = 0; i < registrations.length; i++) { 144 | if (registrations[i].observer === this) { 145 | registration = registrations[i]; 146 | registration.removeListeners(); 147 | registration.options = options; 148 | break; 149 | } 150 | } 151 | if (!registration) { 152 | registration = new Registration(this, target, options); 153 | registrations.push(registration); 154 | this.nodes_.push(target); 155 | } 156 | registration.addListeners(); 157 | }, 158 | disconnect: function() { 159 | this.nodes_.forEach(function(node) { 160 | var registrations = registrationsTable.get(node); 161 | for (var i = 0; i < registrations.length; i++) { 162 | var registration = registrations[i]; 163 | if (registration.observer === this) { 164 | registration.removeListeners(); 165 | registrations.splice(i, 1); 166 | break; 167 | } 168 | } 169 | }, this); 170 | this.records_ = []; 171 | }, 172 | takeRecords: function() { 173 | var copyOfRecords = this.records_; 174 | this.records_ = []; 175 | return copyOfRecords; 176 | } 177 | }; 178 | function MutationRecord(type, target) { 179 | this.type = type; 180 | this.target = target; 181 | this.addedNodes = []; 182 | this.removedNodes = []; 183 | this.previousSibling = null; 184 | this.nextSibling = null; 185 | this.attributeName = null; 186 | this.attributeNamespace = null; 187 | this.oldValue = null; 188 | } 189 | function copyMutationRecord(original) { 190 | var record = new MutationRecord(original.type, original.target); 191 | record.addedNodes = original.addedNodes.slice(); 192 | record.removedNodes = original.removedNodes.slice(); 193 | record.previousSibling = original.previousSibling; 194 | record.nextSibling = original.nextSibling; 195 | record.attributeName = original.attributeName; 196 | record.attributeNamespace = original.attributeNamespace; 197 | record.oldValue = original.oldValue; 198 | return record; 199 | } 200 | var currentRecord, recordWithOldValue; 201 | function getRecord(type, target) { 202 | return currentRecord = new MutationRecord(type, target); 203 | } 204 | function getRecordWithOldValue(oldValue) { 205 | if (recordWithOldValue) return recordWithOldValue; 206 | recordWithOldValue = copyMutationRecord(currentRecord); 207 | recordWithOldValue.oldValue = oldValue; 208 | return recordWithOldValue; 209 | } 210 | function clearRecords() { 211 | currentRecord = recordWithOldValue = undefined; 212 | } 213 | function recordRepresentsCurrentMutation(record) { 214 | return record === recordWithOldValue || record === currentRecord; 215 | } 216 | function selectRecord(lastRecord, newRecord) { 217 | if (lastRecord === newRecord) return lastRecord; 218 | if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue; 219 | return null; 220 | } 221 | function Registration(observer, target, options) { 222 | this.observer = observer; 223 | this.target = target; 224 | this.options = options; 225 | this.transientObservedNodes = []; 226 | } 227 | Registration.prototype = { 228 | enqueue: function(record) { 229 | var records = this.observer.records_; 230 | var length = records.length; 231 | if (records.length > 0) { 232 | var lastRecord = records[length - 1]; 233 | var recordToReplaceLast = selectRecord(lastRecord, record); 234 | if (recordToReplaceLast) { 235 | records[length - 1] = recordToReplaceLast; 236 | return; 237 | } 238 | } else { 239 | scheduleCallback(this.observer); 240 | } 241 | records[length] = record; 242 | }, 243 | addListeners: function() { 244 | this.addListeners_(this.target); 245 | }, 246 | addListeners_: function(node) { 247 | var options = this.options; 248 | if (options.attributes) node.addEventListener("DOMAttrModified", this, true); 249 | if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true); 250 | if (options.childList) node.addEventListener("DOMNodeInserted", this, true); 251 | if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true); 252 | }, 253 | removeListeners: function() { 254 | this.removeListeners_(this.target); 255 | }, 256 | removeListeners_: function(node) { 257 | var options = this.options; 258 | if (options.attributes) node.removeEventListener("DOMAttrModified", this, true); 259 | if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true); 260 | if (options.childList) node.removeEventListener("DOMNodeInserted", this, true); 261 | if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true); 262 | }, 263 | addTransientObserver: function(node) { 264 | if (node === this.target) return; 265 | this.addListeners_(node); 266 | this.transientObservedNodes.push(node); 267 | var registrations = registrationsTable.get(node); 268 | if (!registrations) registrationsTable.set(node, registrations = []); 269 | registrations.push(this); 270 | }, 271 | removeTransientObservers: function() { 272 | var transientObservedNodes = this.transientObservedNodes; 273 | this.transientObservedNodes = []; 274 | transientObservedNodes.forEach(function(node) { 275 | this.removeListeners_(node); 276 | var registrations = registrationsTable.get(node); 277 | for (var i = 0; i < registrations.length; i++) { 278 | if (registrations[i] === this) { 279 | registrations.splice(i, 1); 280 | break; 281 | } 282 | } 283 | }, this); 284 | }, 285 | handleEvent: function(e) { 286 | e.stopImmediatePropagation(); 287 | switch (e.type) { 288 | case "DOMAttrModified": 289 | var name = e.attrName; 290 | var namespace = e.relatedNode.namespaceURI; 291 | var target = e.target; 292 | var record = new getRecord("attributes", target); 293 | record.attributeName = name; 294 | record.attributeNamespace = namespace; 295 | var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue; 296 | forEachAncestorAndObserverEnqueueRecord(target, function(options) { 297 | if (!options.attributes) return; 298 | if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) { 299 | return; 300 | } 301 | if (options.attributeOldValue) return getRecordWithOldValue(oldValue); 302 | return record; 303 | }); 304 | break; 305 | 306 | case "DOMCharacterDataModified": 307 | var target = e.target; 308 | var record = getRecord("characterData", target); 309 | var oldValue = e.prevValue; 310 | forEachAncestorAndObserverEnqueueRecord(target, function(options) { 311 | if (!options.characterData) return; 312 | if (options.characterDataOldValue) return getRecordWithOldValue(oldValue); 313 | return record; 314 | }); 315 | break; 316 | 317 | case "DOMNodeRemoved": 318 | this.addTransientObserver(e.target); 319 | 320 | case "DOMNodeInserted": 321 | var changedNode = e.target; 322 | var addedNodes, removedNodes; 323 | if (e.type === "DOMNodeInserted") { 324 | addedNodes = [ changedNode ]; 325 | removedNodes = []; 326 | } else { 327 | addedNodes = []; 328 | removedNodes = [ changedNode ]; 329 | } 330 | var previousSibling = changedNode.previousSibling; 331 | var nextSibling = changedNode.nextSibling; 332 | var record = getRecord("childList", e.target.parentNode); 333 | record.addedNodes = addedNodes; 334 | record.removedNodes = removedNodes; 335 | record.previousSibling = previousSibling; 336 | record.nextSibling = nextSibling; 337 | forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) { 338 | if (!options.childList) return; 339 | return record; 340 | }); 341 | } 342 | clearRecords(); 343 | } 344 | }; 345 | global.JsMutationObserver = JsMutationObserver; 346 | if (!global.MutationObserver) { 347 | global.MutationObserver = JsMutationObserver; 348 | JsMutationObserver._isPolyfilled = true; 349 | } 350 | })(self); 351 | 352 | (function(scope) { 353 | "use strict"; 354 | if (!window.performance) { 355 | var start = Date.now(); 356 | window.performance = { 357 | now: function() { 358 | return Date.now() - start; 359 | } 360 | }; 361 | } 362 | if (!window.requestAnimationFrame) { 363 | window.requestAnimationFrame = function() { 364 | var nativeRaf = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame; 365 | return nativeRaf ? function(callback) { 366 | return nativeRaf(function() { 367 | callback(performance.now()); 368 | }); 369 | } : function(callback) { 370 | return window.setTimeout(callback, 1e3 / 60); 371 | }; 372 | }(); 373 | } 374 | if (!window.cancelAnimationFrame) { 375 | window.cancelAnimationFrame = function() { 376 | return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function(id) { 377 | clearTimeout(id); 378 | }; 379 | }(); 380 | } 381 | var workingDefaultPrevented = function() { 382 | var e = document.createEvent("Event"); 383 | e.initEvent("foo", true, true); 384 | e.preventDefault(); 385 | return e.defaultPrevented; 386 | }(); 387 | if (!workingDefaultPrevented) { 388 | var origPreventDefault = Event.prototype.preventDefault; 389 | Event.prototype.preventDefault = function() { 390 | if (!this.cancelable) { 391 | return; 392 | } 393 | origPreventDefault.call(this); 394 | Object.defineProperty(this, "defaultPrevented", { 395 | get: function() { 396 | return true; 397 | }, 398 | configurable: true 399 | }); 400 | }; 401 | } 402 | var isIE = /Trident/.test(navigator.userAgent); 403 | if (!window.CustomEvent || isIE && typeof window.CustomEvent !== "function") { 404 | window.CustomEvent = function(inType, params) { 405 | params = params || {}; 406 | var e = document.createEvent("CustomEvent"); 407 | e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail); 408 | return e; 409 | }; 410 | window.CustomEvent.prototype = window.Event.prototype; 411 | } 412 | if (!window.Event || isIE && typeof window.Event !== "function") { 413 | var origEvent = window.Event; 414 | window.Event = function(inType, params) { 415 | params = params || {}; 416 | var e = document.createEvent("Event"); 417 | e.initEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable)); 418 | return e; 419 | }; 420 | window.Event.prototype = origEvent.prototype; 421 | } 422 | })(window.WebComponents); 423 | 424 | window.CustomElements = window.CustomElements || { 425 | flags: {} 426 | }; 427 | 428 | (function(scope) { 429 | var flags = scope.flags; 430 | var modules = []; 431 | var addModule = function(module) { 432 | modules.push(module); 433 | }; 434 | var initializeModules = function() { 435 | modules.forEach(function(module) { 436 | module(scope); 437 | }); 438 | }; 439 | scope.addModule = addModule; 440 | scope.initializeModules = initializeModules; 441 | scope.hasNative = Boolean(document.registerElement); 442 | scope.isIE = /Trident/.test(navigator.userAgent); 443 | scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative); 444 | })(window.CustomElements); 445 | 446 | window.CustomElements.addModule(function(scope) { 447 | var IMPORT_LINK_TYPE = window.HTMLImports ? window.HTMLImports.IMPORT_LINK_TYPE : "none"; 448 | function forSubtree(node, cb) { 449 | findAllElements(node, function(e) { 450 | if (cb(e)) { 451 | return true; 452 | } 453 | forRoots(e, cb); 454 | }); 455 | forRoots(node, cb); 456 | } 457 | function findAllElements(node, find, data) { 458 | var e = node.firstElementChild; 459 | if (!e) { 460 | e = node.firstChild; 461 | while (e && e.nodeType !== Node.ELEMENT_NODE) { 462 | e = e.nextSibling; 463 | } 464 | } 465 | while (e) { 466 | if (find(e, data) !== true) { 467 | findAllElements(e, find, data); 468 | } 469 | e = e.nextElementSibling; 470 | } 471 | return null; 472 | } 473 | function forRoots(node, cb) { 474 | var root = node.shadowRoot; 475 | while (root) { 476 | forSubtree(root, cb); 477 | root = root.olderShadowRoot; 478 | } 479 | } 480 | function forDocumentTree(doc, cb) { 481 | _forDocumentTree(doc, cb, []); 482 | } 483 | function _forDocumentTree(doc, cb, processingDocuments) { 484 | doc = window.wrap(doc); 485 | if (processingDocuments.indexOf(doc) >= 0) { 486 | return; 487 | } 488 | processingDocuments.push(doc); 489 | var imports = doc.querySelectorAll("link[rel=" + IMPORT_LINK_TYPE + "]"); 490 | for (var i = 0, l = imports.length, n; i < l && (n = imports[i]); i++) { 491 | if (n.import) { 492 | _forDocumentTree(n.import, cb, processingDocuments); 493 | } 494 | } 495 | cb(doc); 496 | } 497 | scope.forDocumentTree = forDocumentTree; 498 | scope.forSubtree = forSubtree; 499 | }); 500 | 501 | window.CustomElements.addModule(function(scope) { 502 | var flags = scope.flags; 503 | var forSubtree = scope.forSubtree; 504 | var forDocumentTree = scope.forDocumentTree; 505 | function addedNode(node, isAttached) { 506 | return added(node, isAttached) || addedSubtree(node, isAttached); 507 | } 508 | function added(node, isAttached) { 509 | if (scope.upgrade(node, isAttached)) { 510 | return true; 511 | } 512 | if (isAttached) { 513 | attached(node); 514 | } 515 | } 516 | function addedSubtree(node, isAttached) { 517 | forSubtree(node, function(e) { 518 | if (added(e, isAttached)) { 519 | return true; 520 | } 521 | }); 522 | } 523 | var hasThrottledAttached = window.MutationObserver._isPolyfilled && flags["throttle-attached"]; 524 | scope.hasPolyfillMutations = hasThrottledAttached; 525 | scope.hasThrottledAttached = hasThrottledAttached; 526 | var isPendingMutations = false; 527 | var pendingMutations = []; 528 | function deferMutation(fn) { 529 | pendingMutations.push(fn); 530 | if (!isPendingMutations) { 531 | isPendingMutations = true; 532 | setTimeout(takeMutations); 533 | } 534 | } 535 | function takeMutations() { 536 | isPendingMutations = false; 537 | var $p = pendingMutations; 538 | for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) { 539 | p(); 540 | } 541 | pendingMutations = []; 542 | } 543 | function attached(element) { 544 | if (hasThrottledAttached) { 545 | deferMutation(function() { 546 | _attached(element); 547 | }); 548 | } else { 549 | _attached(element); 550 | } 551 | } 552 | function _attached(element) { 553 | if (element.__upgraded__ && !element.__attached) { 554 | element.__attached = true; 555 | if (element.attachedCallback) { 556 | element.attachedCallback(); 557 | } 558 | } 559 | } 560 | function detachedNode(node) { 561 | detached(node); 562 | forSubtree(node, function(e) { 563 | detached(e); 564 | }); 565 | } 566 | function detached(element) { 567 | if (hasThrottledAttached) { 568 | deferMutation(function() { 569 | _detached(element); 570 | }); 571 | } else { 572 | _detached(element); 573 | } 574 | } 575 | function _detached(element) { 576 | if (element.__upgraded__ && element.__attached) { 577 | element.__attached = false; 578 | if (element.detachedCallback) { 579 | element.detachedCallback(); 580 | } 581 | } 582 | } 583 | function inDocument(element) { 584 | var p = element; 585 | var doc = window.wrap(document); 586 | while (p) { 587 | if (p == doc) { 588 | return true; 589 | } 590 | p = p.parentNode || p.nodeType === Node.DOCUMENT_FRAGMENT_NODE && p.host; 591 | } 592 | } 593 | function watchShadow(node) { 594 | if (node.shadowRoot && !node.shadowRoot.__watched) { 595 | flags.dom && console.log("watching shadow-root for: ", node.localName); 596 | var root = node.shadowRoot; 597 | while (root) { 598 | observe(root); 599 | root = root.olderShadowRoot; 600 | } 601 | } 602 | } 603 | function handler(root, mutations) { 604 | if (flags.dom) { 605 | var mx = mutations[0]; 606 | if (mx && mx.type === "childList" && mx.addedNodes) { 607 | if (mx.addedNodes) { 608 | var d = mx.addedNodes[0]; 609 | while (d && d !== document && !d.host) { 610 | d = d.parentNode; 611 | } 612 | var u = d && (d.URL || d._URL || d.host && d.host.localName) || ""; 613 | u = u.split("/?").shift().split("/").pop(); 614 | } 615 | } 616 | console.group("mutations (%d) [%s]", mutations.length, u || ""); 617 | } 618 | var isAttached = inDocument(root); 619 | mutations.forEach(function(mx) { 620 | if (mx.type === "childList") { 621 | forEach(mx.addedNodes, function(n) { 622 | if (!n.localName) { 623 | return; 624 | } 625 | addedNode(n, isAttached); 626 | }); 627 | forEach(mx.removedNodes, function(n) { 628 | if (!n.localName) { 629 | return; 630 | } 631 | detachedNode(n); 632 | }); 633 | } 634 | }); 635 | flags.dom && console.groupEnd(); 636 | } 637 | function takeRecords(node) { 638 | node = window.wrap(node); 639 | if (!node) { 640 | node = window.wrap(document); 641 | } 642 | while (node.parentNode) { 643 | node = node.parentNode; 644 | } 645 | var observer = node.__observer; 646 | if (observer) { 647 | handler(node, observer.takeRecords()); 648 | takeMutations(); 649 | } 650 | } 651 | var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach); 652 | function observe(inRoot) { 653 | if (inRoot.__observer) { 654 | return; 655 | } 656 | var observer = new MutationObserver(handler.bind(this, inRoot)); 657 | observer.observe(inRoot, { 658 | childList: true, 659 | subtree: true 660 | }); 661 | inRoot.__observer = observer; 662 | } 663 | function upgradeDocument(doc) { 664 | doc = window.wrap(doc); 665 | flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop()); 666 | var isMainDocument = doc === window.wrap(document); 667 | addedNode(doc, isMainDocument); 668 | observe(doc); 669 | flags.dom && console.groupEnd(); 670 | } 671 | function upgradeDocumentTree(doc) { 672 | forDocumentTree(doc, upgradeDocument); 673 | } 674 | var originalCreateShadowRoot = Element.prototype.createShadowRoot; 675 | if (originalCreateShadowRoot) { 676 | Element.prototype.createShadowRoot = function() { 677 | var root = originalCreateShadowRoot.call(this); 678 | window.CustomElements.watchShadow(this); 679 | return root; 680 | }; 681 | } 682 | scope.watchShadow = watchShadow; 683 | scope.upgradeDocumentTree = upgradeDocumentTree; 684 | scope.upgradeDocument = upgradeDocument; 685 | scope.upgradeSubtree = addedSubtree; 686 | scope.upgradeAll = addedNode; 687 | scope.attached = attached; 688 | scope.takeRecords = takeRecords; 689 | }); 690 | 691 | window.CustomElements.addModule(function(scope) { 692 | var flags = scope.flags; 693 | function upgrade(node, isAttached) { 694 | if (node.localName === "template") { 695 | if (window.HTMLTemplateElement && HTMLTemplateElement.decorate) { 696 | HTMLTemplateElement.decorate(node); 697 | } 698 | } 699 | if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) { 700 | var is = node.getAttribute("is"); 701 | var definition = scope.getRegisteredDefinition(node.localName) || scope.getRegisteredDefinition(is); 702 | if (definition) { 703 | if (is && definition.tag == node.localName || !is && !definition.extends) { 704 | return upgradeWithDefinition(node, definition, isAttached); 705 | } 706 | } 707 | } 708 | } 709 | function upgradeWithDefinition(element, definition, isAttached) { 710 | flags.upgrade && console.group("upgrade:", element.localName); 711 | if (definition.is) { 712 | element.setAttribute("is", definition.is); 713 | } 714 | implementPrototype(element, definition); 715 | element.__upgraded__ = true; 716 | created(element); 717 | if (isAttached) { 718 | scope.attached(element); 719 | } 720 | scope.upgradeSubtree(element, isAttached); 721 | flags.upgrade && console.groupEnd(); 722 | return element; 723 | } 724 | function implementPrototype(element, definition) { 725 | if (Object.__proto__) { 726 | element.__proto__ = definition.prototype; 727 | } else { 728 | customMixin(element, definition.prototype, definition.native); 729 | element.__proto__ = definition.prototype; 730 | } 731 | } 732 | function customMixin(inTarget, inSrc, inNative) { 733 | var used = {}; 734 | var p = inSrc; 735 | while (p !== inNative && p !== HTMLElement.prototype) { 736 | var keys = Object.getOwnPropertyNames(p); 737 | for (var i = 0, k; k = keys[i]; i++) { 738 | if (!used[k]) { 739 | Object.defineProperty(inTarget, k, Object.getOwnPropertyDescriptor(p, k)); 740 | used[k] = 1; 741 | } 742 | } 743 | p = Object.getPrototypeOf(p); 744 | } 745 | } 746 | function created(element) { 747 | if (element.createdCallback) { 748 | element.createdCallback(); 749 | } 750 | } 751 | scope.upgrade = upgrade; 752 | scope.upgradeWithDefinition = upgradeWithDefinition; 753 | scope.implementPrototype = implementPrototype; 754 | }); 755 | 756 | window.CustomElements.addModule(function(scope) { 757 | var isIE = scope.isIE; 758 | var upgradeDocumentTree = scope.upgradeDocumentTree; 759 | var upgradeAll = scope.upgradeAll; 760 | var upgradeWithDefinition = scope.upgradeWithDefinition; 761 | var implementPrototype = scope.implementPrototype; 762 | var useNative = scope.useNative; 763 | function register(name, options) { 764 | var definition = options || {}; 765 | if (!name) { 766 | throw new Error("document.registerElement: first argument `name` must not be empty"); 767 | } 768 | if (name.indexOf("-") < 0) { 769 | throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '" + String(name) + "'."); 770 | } 771 | if (isReservedTag(name)) { 772 | throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '" + String(name) + "'. The type name is invalid."); 773 | } 774 | if (getRegisteredDefinition(name)) { 775 | throw new Error("DuplicateDefinitionError: a type with name '" + String(name) + "' is already registered"); 776 | } 777 | if (!definition.prototype) { 778 | definition.prototype = Object.create(HTMLElement.prototype); 779 | } 780 | definition.__name = name.toLowerCase(); 781 | definition.lifecycle = definition.lifecycle || {}; 782 | definition.ancestry = ancestry(definition.extends); 783 | resolveTagName(definition); 784 | resolvePrototypeChain(definition); 785 | overrideAttributeApi(definition.prototype); 786 | registerDefinition(definition.__name, definition); 787 | definition.ctor = generateConstructor(definition); 788 | definition.ctor.prototype = definition.prototype; 789 | definition.prototype.constructor = definition.ctor; 790 | if (scope.ready) { 791 | upgradeDocumentTree(document); 792 | } 793 | return definition.ctor; 794 | } 795 | function overrideAttributeApi(prototype) { 796 | if (prototype.setAttribute._polyfilled) { 797 | return; 798 | } 799 | var setAttribute = prototype.setAttribute; 800 | prototype.setAttribute = function(name, value) { 801 | changeAttribute.call(this, name, value, setAttribute); 802 | }; 803 | var removeAttribute = prototype.removeAttribute; 804 | prototype.removeAttribute = function(name) { 805 | changeAttribute.call(this, name, null, removeAttribute); 806 | }; 807 | prototype.setAttribute._polyfilled = true; 808 | } 809 | function changeAttribute(name, value, operation) { 810 | name = name.toLowerCase(); 811 | var oldValue = this.getAttribute(name); 812 | operation.apply(this, arguments); 813 | var newValue = this.getAttribute(name); 814 | if (this.attributeChangedCallback && newValue !== oldValue) { 815 | this.attributeChangedCallback(name, oldValue, newValue); 816 | } 817 | } 818 | function isReservedTag(name) { 819 | for (var i = 0; i < reservedTagList.length; i++) { 820 | if (name === reservedTagList[i]) { 821 | return true; 822 | } 823 | } 824 | } 825 | var reservedTagList = [ "annotation-xml", "color-profile", "font-face", "font-face-src", "font-face-uri", "font-face-format", "font-face-name", "missing-glyph" ]; 826 | function ancestry(extnds) { 827 | var extendee = getRegisteredDefinition(extnds); 828 | if (extendee) { 829 | return ancestry(extendee.extends).concat([ extendee ]); 830 | } 831 | return []; 832 | } 833 | function resolveTagName(definition) { 834 | var baseTag = definition.extends; 835 | for (var i = 0, a; a = definition.ancestry[i]; i++) { 836 | baseTag = a.is && a.tag; 837 | } 838 | definition.tag = baseTag || definition.__name; 839 | if (baseTag) { 840 | definition.is = definition.__name; 841 | } 842 | } 843 | function resolvePrototypeChain(definition) { 844 | if (!Object.__proto__) { 845 | var nativePrototype = HTMLElement.prototype; 846 | if (definition.is) { 847 | var inst = document.createElement(definition.tag); 848 | nativePrototype = Object.getPrototypeOf(inst); 849 | } 850 | var proto = definition.prototype, ancestor; 851 | var foundPrototype = false; 852 | while (proto) { 853 | if (proto == nativePrototype) { 854 | foundPrototype = true; 855 | } 856 | ancestor = Object.getPrototypeOf(proto); 857 | if (ancestor) { 858 | proto.__proto__ = ancestor; 859 | } 860 | proto = ancestor; 861 | } 862 | if (!foundPrototype) { 863 | console.warn(definition.tag + " prototype not found in prototype chain for " + definition.is); 864 | } 865 | definition.native = nativePrototype; 866 | } 867 | } 868 | function instantiate(definition) { 869 | return upgradeWithDefinition(domCreateElement(definition.tag), definition); 870 | } 871 | var registry = {}; 872 | function getRegisteredDefinition(name) { 873 | if (name) { 874 | return registry[name.toLowerCase()]; 875 | } 876 | } 877 | function registerDefinition(name, definition) { 878 | registry[name] = definition; 879 | } 880 | function generateConstructor(definition) { 881 | return function() { 882 | return instantiate(definition); 883 | }; 884 | } 885 | var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; 886 | function createElementNS(namespace, tag, typeExtension) { 887 | if (namespace === HTML_NAMESPACE) { 888 | return createElement(tag, typeExtension); 889 | } else { 890 | return domCreateElementNS(namespace, tag); 891 | } 892 | } 893 | function createElement(tag, typeExtension) { 894 | if (tag) { 895 | tag = tag.toLowerCase(); 896 | } 897 | if (typeExtension) { 898 | typeExtension = typeExtension.toLowerCase(); 899 | } 900 | var definition = getRegisteredDefinition(typeExtension || tag); 901 | if (definition) { 902 | if (tag == definition.tag && typeExtension == definition.is) { 903 | return new definition.ctor(); 904 | } 905 | if (!typeExtension && !definition.is) { 906 | return new definition.ctor(); 907 | } 908 | } 909 | var element; 910 | if (typeExtension) { 911 | element = createElement(tag); 912 | element.setAttribute("is", typeExtension); 913 | return element; 914 | } 915 | element = domCreateElement(tag); 916 | if (tag.indexOf("-") >= 0) { 917 | implementPrototype(element, HTMLElement); 918 | } 919 | return element; 920 | } 921 | var domCreateElement = document.createElement.bind(document); 922 | var domCreateElementNS = document.createElementNS.bind(document); 923 | var isInstance; 924 | if (!Object.__proto__ && !useNative) { 925 | isInstance = function(obj, ctor) { 926 | if (obj instanceof ctor) { 927 | return true; 928 | } 929 | var p = obj; 930 | while (p) { 931 | if (p === ctor.prototype) { 932 | return true; 933 | } 934 | p = p.__proto__; 935 | } 936 | return false; 937 | }; 938 | } else { 939 | isInstance = function(obj, base) { 940 | return obj instanceof base; 941 | }; 942 | } 943 | function wrapDomMethodToForceUpgrade(obj, methodName) { 944 | var orig = obj[methodName]; 945 | obj[methodName] = function() { 946 | var n = orig.apply(this, arguments); 947 | upgradeAll(n); 948 | return n; 949 | }; 950 | } 951 | wrapDomMethodToForceUpgrade(Node.prototype, "cloneNode"); 952 | wrapDomMethodToForceUpgrade(document, "importNode"); 953 | if (isIE) { 954 | (function() { 955 | var importNode = document.importNode; 956 | document.importNode = function() { 957 | var n = importNode.apply(document, arguments); 958 | if (n.nodeType == n.DOCUMENT_FRAGMENT_NODE) { 959 | var f = document.createDocumentFragment(); 960 | f.appendChild(n); 961 | return f; 962 | } else { 963 | return n; 964 | } 965 | }; 966 | })(); 967 | } 968 | document.registerElement = register; 969 | document.createElement = createElement; 970 | document.createElementNS = createElementNS; 971 | scope.registry = registry; 972 | scope.instanceof = isInstance; 973 | scope.reservedTagList = reservedTagList; 974 | scope.getRegisteredDefinition = getRegisteredDefinition; 975 | document.register = document.registerElement; 976 | }); 977 | 978 | (function(scope) { 979 | var useNative = scope.useNative; 980 | var initializeModules = scope.initializeModules; 981 | var isIE = scope.isIE; 982 | if (useNative) { 983 | var nop = function() {}; 984 | scope.watchShadow = nop; 985 | scope.upgrade = nop; 986 | scope.upgradeAll = nop; 987 | scope.upgradeDocumentTree = nop; 988 | scope.upgradeSubtree = nop; 989 | scope.takeRecords = nop; 990 | scope.instanceof = function(obj, base) { 991 | return obj instanceof base; 992 | }; 993 | } else { 994 | initializeModules(); 995 | } 996 | var upgradeDocumentTree = scope.upgradeDocumentTree; 997 | var upgradeDocument = scope.upgradeDocument; 998 | if (!window.wrap) { 999 | if (window.ShadowDOMPolyfill) { 1000 | window.wrap = window.ShadowDOMPolyfill.wrapIfNeeded; 1001 | window.unwrap = window.ShadowDOMPolyfill.unwrapIfNeeded; 1002 | } else { 1003 | window.wrap = window.unwrap = function(node) { 1004 | return node; 1005 | }; 1006 | } 1007 | } 1008 | if (window.HTMLImports) { 1009 | window.HTMLImports.__importsParsingHook = function(elt) { 1010 | if (elt.import) { 1011 | upgradeDocument(wrap(elt.import)); 1012 | } 1013 | }; 1014 | } 1015 | function bootstrap() { 1016 | upgradeDocumentTree(window.wrap(document)); 1017 | window.CustomElements.ready = true; 1018 | var requestAnimationFrame = window.requestAnimationFrame || function(f) { 1019 | setTimeout(f, 16); 1020 | }; 1021 | requestAnimationFrame(function() { 1022 | setTimeout(function() { 1023 | window.CustomElements.readyTime = Date.now(); 1024 | if (window.HTMLImports) { 1025 | window.CustomElements.elapsed = window.CustomElements.readyTime - window.HTMLImports.readyTime; 1026 | } 1027 | document.dispatchEvent(new CustomEvent("WebComponentsReady", { 1028 | bubbles: true 1029 | })); 1030 | }); 1031 | }); 1032 | } 1033 | if (document.readyState === "complete" || scope.flags.eager) { 1034 | bootstrap(); 1035 | } else if (document.readyState === "interactive" && !window.attachEvent && (!window.HTMLImports || window.HTMLImports.ready)) { 1036 | bootstrap(); 1037 | } else { 1038 | var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded"; 1039 | window.addEventListener(loadEvent, bootstrap); 1040 | } 1041 | })(window.CustomElements); -------------------------------------------------------------------------------- /bower_components/webcomponentsjs/CustomElements.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | * Code distributed by Google as part of the polymer project is also 8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | // @version 0.7.18 11 | "undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};n.prototype={set:function(t,n){var o=t[this.name];return o&&o[0]===t?o[1]=n:e(t,this.name,{value:[t,n],writable:!0}),this},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){var t=e[this.name];return t&&t[0]===e?(t[0]=t[1]=void 0,!0):!1},has:function(e){var t=e[this.name];return t?t[0]===e:!1}},window.WeakMap=n}(),function(e){function t(e){E.push(e),b||(b=!0,w(o))}function n(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function o(){b=!1;var e=E;E=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var n=e.takeRecords();r(e),n.length&&(e.callback_(n,e),t=!0)}),t&&o()}function r(e){e.nodes_.forEach(function(t){var n=v.get(t);n&&n.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function i(e,t){for(var n=e;n;n=n.parentNode){var o=v.get(n);if(o)for(var r=0;r0){var r=n[o-1],i=m(r,e);if(i)return void(n[o-1]=i)}else t(this.observer);n[o]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=v.get(e);t||v.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=v.get(e),n=0;n=0)){n.push(e);for(var o,r=e.querySelectorAll("link[rel="+a+"]"),d=0,s=r.length;s>d&&(o=r[d]);d++)o["import"]&&i(o["import"],t,n);t(e)}}var a=window.HTMLImports?window.HTMLImports.IMPORT_LINK_TYPE:"none";e.forDocumentTree=r,e.forSubtree=t}),window.CustomElements.addModule(function(e){function t(e,t){return n(e,t)||o(e,t)}function n(t,n){return e.upgrade(t,n)?!0:void(n&&a(t))}function o(e,t){b(e,function(e){return n(e,t)?!0:void 0})}function r(e){N.push(e),y||(y=!0,setTimeout(i))}function i(){y=!1;for(var e,t=N,n=0,o=t.length;o>n&&(e=t[n]);n++)e();N=[]}function a(e){_?r(function(){d(e)}):d(e)}function d(e){e.__upgraded__&&!e.__attached&&(e.__attached=!0,e.attachedCallback&&e.attachedCallback())}function s(e){u(e),b(e,function(e){u(e)})}function u(e){_?r(function(){c(e)}):c(e)}function c(e){e.__upgraded__&&e.__attached&&(e.__attached=!1,e.detachedCallback&&e.detachedCallback())}function l(e){for(var t=e,n=window.wrap(document);t;){if(t==n)return!0;t=t.parentNode||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host}}function f(e){if(e.shadowRoot&&!e.shadowRoot.__watched){g.dom&&console.log("watching shadow-root for: ",e.localName);for(var t=e.shadowRoot;t;)w(t),t=t.olderShadowRoot}}function m(e,n){if(g.dom){var o=n[0];if(o&&"childList"===o.type&&o.addedNodes&&o.addedNodes){for(var r=o.addedNodes[0];r&&r!==document&&!r.host;)r=r.parentNode;var i=r&&(r.URL||r._URL||r.host&&r.host.localName)||"";i=i.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",n.length,i||"")}var a=l(e);n.forEach(function(e){"childList"===e.type&&(M(e.addedNodes,function(e){e.localName&&t(e,a)}),M(e.removedNodes,function(e){e.localName&&s(e)}))}),g.dom&&console.groupEnd()}function p(e){for(e=window.wrap(e),e||(e=window.wrap(document));e.parentNode;)e=e.parentNode;var t=e.__observer;t&&(m(e,t.takeRecords()),i())}function w(e){if(!e.__observer){var t=new MutationObserver(m.bind(this,e));t.observe(e,{childList:!0,subtree:!0}),e.__observer=t}}function v(e){e=window.wrap(e),g.dom&&console.group("upgradeDocument: ",e.baseURI.split("/").pop());var n=e===window.wrap(document);t(e,n),w(e),g.dom&&console.groupEnd()}function h(e){E(e,v)}var g=e.flags,b=e.forSubtree,E=e.forDocumentTree,_=window.MutationObserver._isPolyfilled&&g["throttle-attached"];e.hasPolyfillMutations=_,e.hasThrottledAttached=_;var y=!1,N=[],M=Array.prototype.forEach.call.bind(Array.prototype.forEach),O=Element.prototype.createShadowRoot;O&&(Element.prototype.createShadowRoot=function(){var e=O.call(this);return window.CustomElements.watchShadow(this),e}),e.watchShadow=f,e.upgradeDocumentTree=h,e.upgradeDocument=v,e.upgradeSubtree=o,e.upgradeAll=t,e.attached=a,e.takeRecords=p}),window.CustomElements.addModule(function(e){function t(t,o){if("template"===t.localName&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(t),!t.__upgraded__&&t.nodeType===Node.ELEMENT_NODE){var r=t.getAttribute("is"),i=e.getRegisteredDefinition(t.localName)||e.getRegisteredDefinition(r);if(i&&(r&&i.tag==t.localName||!r&&!i["extends"]))return n(t,i,o)}}function n(t,n,r){return a.upgrade&&console.group("upgrade:",t.localName),n.is&&t.setAttribute("is",n.is),o(t,n),t.__upgraded__=!0,i(t),r&&e.attached(t),e.upgradeSubtree(t,r),a.upgrade&&console.groupEnd(),t}function o(e,t){Object.__proto__?e.__proto__=t.prototype:(r(e,t.prototype,t["native"]),e.__proto__=t.prototype)}function r(e,t,n){for(var o={},r=t;r!==n&&r!==HTMLElement.prototype;){for(var i,a=Object.getOwnPropertyNames(r),d=0;i=a[d];d++)o[i]||(Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i)),o[i]=1);r=Object.getPrototypeOf(r)}}function i(e){e.createdCallback&&e.createdCallback()}var a=e.flags;e.upgrade=t,e.upgradeWithDefinition=n,e.implementPrototype=o}),window.CustomElements.addModule(function(e){function t(t,o){var s=o||{};if(!t)throw new Error("document.registerElement: first argument `name` must not be empty");if(t.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(t)+"'.");if(r(t))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(t)+"'. The type name is invalid.");if(u(t))throw new Error("DuplicateDefinitionError: a type with name '"+String(t)+"' is already registered");return s.prototype||(s.prototype=Object.create(HTMLElement.prototype)),s.__name=t.toLowerCase(),s.lifecycle=s.lifecycle||{},s.ancestry=i(s["extends"]),a(s),d(s),n(s.prototype),c(s.__name,s),s.ctor=l(s),s.ctor.prototype=s.prototype,s.prototype.constructor=s.ctor,e.ready&&h(document),s.ctor}function n(e){if(!e.setAttribute._polyfilled){var t=e.setAttribute;e.setAttribute=function(e,n){o.call(this,e,n,t)};var n=e.removeAttribute;e.removeAttribute=function(e){o.call(this,e,null,n)},e.setAttribute._polyfilled=!0}}function o(e,t,n){e=e.toLowerCase();var o=this.getAttribute(e);n.apply(this,arguments);var r=this.getAttribute(e);this.attributeChangedCallback&&r!==o&&this.attributeChangedCallback(e,o,r)}function r(e){for(var t=0;t=0&&E(o,HTMLElement),o)}function p(e,t){var n=e[t];e[t]=function(){var e=n.apply(this,arguments);return g(e),e}}var w,v=e.isIE,h=e.upgradeDocumentTree,g=e.upgradeAll,b=e.upgradeWithDefinition,E=e.implementPrototype,_=e.useNative,y=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],N={},M="http://www.w3.org/1999/xhtml",O=document.createElement.bind(document),D=document.createElementNS.bind(document);w=Object.__proto__||_?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;for(var n=e;n;){if(n===t.prototype)return!0;n=n.__proto__}return!1},p(Node.prototype,"cloneNode"),p(document,"importNode"),v&&!function(){var e=document.importNode;document.importNode=function(){var t=e.apply(document,arguments);if(t.nodeType==t.DOCUMENT_FRAGMENT_NODE){var n=document.createDocumentFragment();return n.appendChild(t),n}return t}}(),document.registerElement=t,document.createElement=m,document.createElementNS=f,e.registry=N,e["instanceof"]=w,e.reservedTagList=y,e.getRegisteredDefinition=u,document.register=document.registerElement}),function(e){function t(){i(window.wrap(document)),window.CustomElements.ready=!0;var e=window.requestAnimationFrame||function(e){setTimeout(e,16)};e(function(){setTimeout(function(){window.CustomElements.readyTime=Date.now(),window.HTMLImports&&(window.CustomElements.elapsed=window.CustomElements.readyTime-window.HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})})}var n=e.useNative,o=e.initializeModules;e.isIE;if(n){var r=function(){};e.watchShadow=r,e.upgrade=r,e.upgradeAll=r,e.upgradeDocumentTree=r,e.upgradeSubtree=r,e.takeRecords=r,e["instanceof"]=function(e,t){return e instanceof t}}else o();var i=e.upgradeDocumentTree,a=e.upgradeDocument;if(window.wrap||(window.ShadowDOMPolyfill?(window.wrap=window.ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=window.ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(e){return e}),window.HTMLImports&&(window.HTMLImports.__importsParsingHook=function(e){e["import"]&&a(wrap(e["import"]))}),"complete"===document.readyState||e.flags.eager)t();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var d=window.HTMLImports&&!window.HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(d,t)}else t()}(window.CustomElements); -------------------------------------------------------------------------------- /bower_components/webcomponentsjs/HTMLImports.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | * Code distributed by Google as part of the polymer project is also 8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | // @version 0.7.18 11 | if (typeof WeakMap === "undefined") { 12 | (function() { 13 | var defineProperty = Object.defineProperty; 14 | var counter = Date.now() % 1e9; 15 | var WeakMap = function() { 16 | this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__"); 17 | }; 18 | WeakMap.prototype = { 19 | set: function(key, value) { 20 | var entry = key[this.name]; 21 | if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, { 22 | value: [ key, value ], 23 | writable: true 24 | }); 25 | return this; 26 | }, 27 | get: function(key) { 28 | var entry; 29 | return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined; 30 | }, 31 | "delete": function(key) { 32 | var entry = key[this.name]; 33 | if (!entry || entry[0] !== key) return false; 34 | entry[0] = entry[1] = undefined; 35 | return true; 36 | }, 37 | has: function(key) { 38 | var entry = key[this.name]; 39 | if (!entry) return false; 40 | return entry[0] === key; 41 | } 42 | }; 43 | window.WeakMap = WeakMap; 44 | })(); 45 | } 46 | 47 | (function(global) { 48 | if (global.JsMutationObserver) { 49 | return; 50 | } 51 | var registrationsTable = new WeakMap(); 52 | var setImmediate; 53 | if (/Trident|Edge/.test(navigator.userAgent)) { 54 | setImmediate = setTimeout; 55 | } else if (window.setImmediate) { 56 | setImmediate = window.setImmediate; 57 | } else { 58 | var setImmediateQueue = []; 59 | var sentinel = String(Math.random()); 60 | window.addEventListener("message", function(e) { 61 | if (e.data === sentinel) { 62 | var queue = setImmediateQueue; 63 | setImmediateQueue = []; 64 | queue.forEach(function(func) { 65 | func(); 66 | }); 67 | } 68 | }); 69 | setImmediate = function(func) { 70 | setImmediateQueue.push(func); 71 | window.postMessage(sentinel, "*"); 72 | }; 73 | } 74 | var isScheduled = false; 75 | var scheduledObservers = []; 76 | function scheduleCallback(observer) { 77 | scheduledObservers.push(observer); 78 | if (!isScheduled) { 79 | isScheduled = true; 80 | setImmediate(dispatchCallbacks); 81 | } 82 | } 83 | function wrapIfNeeded(node) { 84 | return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node; 85 | } 86 | function dispatchCallbacks() { 87 | isScheduled = false; 88 | var observers = scheduledObservers; 89 | scheduledObservers = []; 90 | observers.sort(function(o1, o2) { 91 | return o1.uid_ - o2.uid_; 92 | }); 93 | var anyNonEmpty = false; 94 | observers.forEach(function(observer) { 95 | var queue = observer.takeRecords(); 96 | removeTransientObserversFor(observer); 97 | if (queue.length) { 98 | observer.callback_(queue, observer); 99 | anyNonEmpty = true; 100 | } 101 | }); 102 | if (anyNonEmpty) dispatchCallbacks(); 103 | } 104 | function removeTransientObserversFor(observer) { 105 | observer.nodes_.forEach(function(node) { 106 | var registrations = registrationsTable.get(node); 107 | if (!registrations) return; 108 | registrations.forEach(function(registration) { 109 | if (registration.observer === observer) registration.removeTransientObservers(); 110 | }); 111 | }); 112 | } 113 | function forEachAncestorAndObserverEnqueueRecord(target, callback) { 114 | for (var node = target; node; node = node.parentNode) { 115 | var registrations = registrationsTable.get(node); 116 | if (registrations) { 117 | for (var j = 0; j < registrations.length; j++) { 118 | var registration = registrations[j]; 119 | var options = registration.options; 120 | if (node !== target && !options.subtree) continue; 121 | var record = callback(options); 122 | if (record) registration.enqueue(record); 123 | } 124 | } 125 | } 126 | } 127 | var uidCounter = 0; 128 | function JsMutationObserver(callback) { 129 | this.callback_ = callback; 130 | this.nodes_ = []; 131 | this.records_ = []; 132 | this.uid_ = ++uidCounter; 133 | } 134 | JsMutationObserver.prototype = { 135 | observe: function(target, options) { 136 | target = wrapIfNeeded(target); 137 | if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) { 138 | throw new SyntaxError(); 139 | } 140 | var registrations = registrationsTable.get(target); 141 | if (!registrations) registrationsTable.set(target, registrations = []); 142 | var registration; 143 | for (var i = 0; i < registrations.length; i++) { 144 | if (registrations[i].observer === this) { 145 | registration = registrations[i]; 146 | registration.removeListeners(); 147 | registration.options = options; 148 | break; 149 | } 150 | } 151 | if (!registration) { 152 | registration = new Registration(this, target, options); 153 | registrations.push(registration); 154 | this.nodes_.push(target); 155 | } 156 | registration.addListeners(); 157 | }, 158 | disconnect: function() { 159 | this.nodes_.forEach(function(node) { 160 | var registrations = registrationsTable.get(node); 161 | for (var i = 0; i < registrations.length; i++) { 162 | var registration = registrations[i]; 163 | if (registration.observer === this) { 164 | registration.removeListeners(); 165 | registrations.splice(i, 1); 166 | break; 167 | } 168 | } 169 | }, this); 170 | this.records_ = []; 171 | }, 172 | takeRecords: function() { 173 | var copyOfRecords = this.records_; 174 | this.records_ = []; 175 | return copyOfRecords; 176 | } 177 | }; 178 | function MutationRecord(type, target) { 179 | this.type = type; 180 | this.target = target; 181 | this.addedNodes = []; 182 | this.removedNodes = []; 183 | this.previousSibling = null; 184 | this.nextSibling = null; 185 | this.attributeName = null; 186 | this.attributeNamespace = null; 187 | this.oldValue = null; 188 | } 189 | function copyMutationRecord(original) { 190 | var record = new MutationRecord(original.type, original.target); 191 | record.addedNodes = original.addedNodes.slice(); 192 | record.removedNodes = original.removedNodes.slice(); 193 | record.previousSibling = original.previousSibling; 194 | record.nextSibling = original.nextSibling; 195 | record.attributeName = original.attributeName; 196 | record.attributeNamespace = original.attributeNamespace; 197 | record.oldValue = original.oldValue; 198 | return record; 199 | } 200 | var currentRecord, recordWithOldValue; 201 | function getRecord(type, target) { 202 | return currentRecord = new MutationRecord(type, target); 203 | } 204 | function getRecordWithOldValue(oldValue) { 205 | if (recordWithOldValue) return recordWithOldValue; 206 | recordWithOldValue = copyMutationRecord(currentRecord); 207 | recordWithOldValue.oldValue = oldValue; 208 | return recordWithOldValue; 209 | } 210 | function clearRecords() { 211 | currentRecord = recordWithOldValue = undefined; 212 | } 213 | function recordRepresentsCurrentMutation(record) { 214 | return record === recordWithOldValue || record === currentRecord; 215 | } 216 | function selectRecord(lastRecord, newRecord) { 217 | if (lastRecord === newRecord) return lastRecord; 218 | if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue; 219 | return null; 220 | } 221 | function Registration(observer, target, options) { 222 | this.observer = observer; 223 | this.target = target; 224 | this.options = options; 225 | this.transientObservedNodes = []; 226 | } 227 | Registration.prototype = { 228 | enqueue: function(record) { 229 | var records = this.observer.records_; 230 | var length = records.length; 231 | if (records.length > 0) { 232 | var lastRecord = records[length - 1]; 233 | var recordToReplaceLast = selectRecord(lastRecord, record); 234 | if (recordToReplaceLast) { 235 | records[length - 1] = recordToReplaceLast; 236 | return; 237 | } 238 | } else { 239 | scheduleCallback(this.observer); 240 | } 241 | records[length] = record; 242 | }, 243 | addListeners: function() { 244 | this.addListeners_(this.target); 245 | }, 246 | addListeners_: function(node) { 247 | var options = this.options; 248 | if (options.attributes) node.addEventListener("DOMAttrModified", this, true); 249 | if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true); 250 | if (options.childList) node.addEventListener("DOMNodeInserted", this, true); 251 | if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true); 252 | }, 253 | removeListeners: function() { 254 | this.removeListeners_(this.target); 255 | }, 256 | removeListeners_: function(node) { 257 | var options = this.options; 258 | if (options.attributes) node.removeEventListener("DOMAttrModified", this, true); 259 | if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true); 260 | if (options.childList) node.removeEventListener("DOMNodeInserted", this, true); 261 | if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true); 262 | }, 263 | addTransientObserver: function(node) { 264 | if (node === this.target) return; 265 | this.addListeners_(node); 266 | this.transientObservedNodes.push(node); 267 | var registrations = registrationsTable.get(node); 268 | if (!registrations) registrationsTable.set(node, registrations = []); 269 | registrations.push(this); 270 | }, 271 | removeTransientObservers: function() { 272 | var transientObservedNodes = this.transientObservedNodes; 273 | this.transientObservedNodes = []; 274 | transientObservedNodes.forEach(function(node) { 275 | this.removeListeners_(node); 276 | var registrations = registrationsTable.get(node); 277 | for (var i = 0; i < registrations.length; i++) { 278 | if (registrations[i] === this) { 279 | registrations.splice(i, 1); 280 | break; 281 | } 282 | } 283 | }, this); 284 | }, 285 | handleEvent: function(e) { 286 | e.stopImmediatePropagation(); 287 | switch (e.type) { 288 | case "DOMAttrModified": 289 | var name = e.attrName; 290 | var namespace = e.relatedNode.namespaceURI; 291 | var target = e.target; 292 | var record = new getRecord("attributes", target); 293 | record.attributeName = name; 294 | record.attributeNamespace = namespace; 295 | var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue; 296 | forEachAncestorAndObserverEnqueueRecord(target, function(options) { 297 | if (!options.attributes) return; 298 | if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) { 299 | return; 300 | } 301 | if (options.attributeOldValue) return getRecordWithOldValue(oldValue); 302 | return record; 303 | }); 304 | break; 305 | 306 | case "DOMCharacterDataModified": 307 | var target = e.target; 308 | var record = getRecord("characterData", target); 309 | var oldValue = e.prevValue; 310 | forEachAncestorAndObserverEnqueueRecord(target, function(options) { 311 | if (!options.characterData) return; 312 | if (options.characterDataOldValue) return getRecordWithOldValue(oldValue); 313 | return record; 314 | }); 315 | break; 316 | 317 | case "DOMNodeRemoved": 318 | this.addTransientObserver(e.target); 319 | 320 | case "DOMNodeInserted": 321 | var changedNode = e.target; 322 | var addedNodes, removedNodes; 323 | if (e.type === "DOMNodeInserted") { 324 | addedNodes = [ changedNode ]; 325 | removedNodes = []; 326 | } else { 327 | addedNodes = []; 328 | removedNodes = [ changedNode ]; 329 | } 330 | var previousSibling = changedNode.previousSibling; 331 | var nextSibling = changedNode.nextSibling; 332 | var record = getRecord("childList", e.target.parentNode); 333 | record.addedNodes = addedNodes; 334 | record.removedNodes = removedNodes; 335 | record.previousSibling = previousSibling; 336 | record.nextSibling = nextSibling; 337 | forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) { 338 | if (!options.childList) return; 339 | return record; 340 | }); 341 | } 342 | clearRecords(); 343 | } 344 | }; 345 | global.JsMutationObserver = JsMutationObserver; 346 | if (!global.MutationObserver) { 347 | global.MutationObserver = JsMutationObserver; 348 | JsMutationObserver._isPolyfilled = true; 349 | } 350 | })(self); 351 | 352 | (function(scope) { 353 | "use strict"; 354 | if (!window.performance) { 355 | var start = Date.now(); 356 | window.performance = { 357 | now: function() { 358 | return Date.now() - start; 359 | } 360 | }; 361 | } 362 | if (!window.requestAnimationFrame) { 363 | window.requestAnimationFrame = function() { 364 | var nativeRaf = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame; 365 | return nativeRaf ? function(callback) { 366 | return nativeRaf(function() { 367 | callback(performance.now()); 368 | }); 369 | } : function(callback) { 370 | return window.setTimeout(callback, 1e3 / 60); 371 | }; 372 | }(); 373 | } 374 | if (!window.cancelAnimationFrame) { 375 | window.cancelAnimationFrame = function() { 376 | return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function(id) { 377 | clearTimeout(id); 378 | }; 379 | }(); 380 | } 381 | var workingDefaultPrevented = function() { 382 | var e = document.createEvent("Event"); 383 | e.initEvent("foo", true, true); 384 | e.preventDefault(); 385 | return e.defaultPrevented; 386 | }(); 387 | if (!workingDefaultPrevented) { 388 | var origPreventDefault = Event.prototype.preventDefault; 389 | Event.prototype.preventDefault = function() { 390 | if (!this.cancelable) { 391 | return; 392 | } 393 | origPreventDefault.call(this); 394 | Object.defineProperty(this, "defaultPrevented", { 395 | get: function() { 396 | return true; 397 | }, 398 | configurable: true 399 | }); 400 | }; 401 | } 402 | var isIE = /Trident/.test(navigator.userAgent); 403 | if (!window.CustomEvent || isIE && typeof window.CustomEvent !== "function") { 404 | window.CustomEvent = function(inType, params) { 405 | params = params || {}; 406 | var e = document.createEvent("CustomEvent"); 407 | e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail); 408 | return e; 409 | }; 410 | window.CustomEvent.prototype = window.Event.prototype; 411 | } 412 | if (!window.Event || isIE && typeof window.Event !== "function") { 413 | var origEvent = window.Event; 414 | window.Event = function(inType, params) { 415 | params = params || {}; 416 | var e = document.createEvent("Event"); 417 | e.initEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable)); 418 | return e; 419 | }; 420 | window.Event.prototype = origEvent.prototype; 421 | } 422 | })(window.WebComponents); 423 | 424 | window.HTMLImports = window.HTMLImports || { 425 | flags: {} 426 | }; 427 | 428 | (function(scope) { 429 | var IMPORT_LINK_TYPE = "import"; 430 | var useNative = Boolean(IMPORT_LINK_TYPE in document.createElement("link")); 431 | var hasShadowDOMPolyfill = Boolean(window.ShadowDOMPolyfill); 432 | var wrap = function(node) { 433 | return hasShadowDOMPolyfill ? window.ShadowDOMPolyfill.wrapIfNeeded(node) : node; 434 | }; 435 | var rootDocument = wrap(document); 436 | var currentScriptDescriptor = { 437 | get: function() { 438 | var script = window.HTMLImports.currentScript || document.currentScript || (document.readyState !== "complete" ? document.scripts[document.scripts.length - 1] : null); 439 | return wrap(script); 440 | }, 441 | configurable: true 442 | }; 443 | Object.defineProperty(document, "_currentScript", currentScriptDescriptor); 444 | Object.defineProperty(rootDocument, "_currentScript", currentScriptDescriptor); 445 | var isIE = /Trident/.test(navigator.userAgent); 446 | function whenReady(callback, doc) { 447 | doc = doc || rootDocument; 448 | whenDocumentReady(function() { 449 | watchImportsLoad(callback, doc); 450 | }, doc); 451 | } 452 | var requiredReadyState = isIE ? "complete" : "interactive"; 453 | var READY_EVENT = "readystatechange"; 454 | function isDocumentReady(doc) { 455 | return doc.readyState === "complete" || doc.readyState === requiredReadyState; 456 | } 457 | function whenDocumentReady(callback, doc) { 458 | if (!isDocumentReady(doc)) { 459 | var checkReady = function() { 460 | if (doc.readyState === "complete" || doc.readyState === requiredReadyState) { 461 | doc.removeEventListener(READY_EVENT, checkReady); 462 | whenDocumentReady(callback, doc); 463 | } 464 | }; 465 | doc.addEventListener(READY_EVENT, checkReady); 466 | } else if (callback) { 467 | callback(); 468 | } 469 | } 470 | function markTargetLoaded(event) { 471 | event.target.__loaded = true; 472 | } 473 | function watchImportsLoad(callback, doc) { 474 | var imports = doc.querySelectorAll("link[rel=import]"); 475 | var parsedCount = 0, importCount = imports.length, newImports = [], errorImports = []; 476 | function checkDone() { 477 | if (parsedCount == importCount && callback) { 478 | callback({ 479 | allImports: imports, 480 | loadedImports: newImports, 481 | errorImports: errorImports 482 | }); 483 | } 484 | } 485 | function loadedImport(e) { 486 | markTargetLoaded(e); 487 | newImports.push(this); 488 | parsedCount++; 489 | checkDone(); 490 | } 491 | function errorLoadingImport(e) { 492 | errorImports.push(this); 493 | parsedCount++; 494 | checkDone(); 495 | } 496 | if (importCount) { 497 | for (var i = 0, imp; i < importCount && (imp = imports[i]); i++) { 498 | if (isImportLoaded(imp)) { 499 | parsedCount++; 500 | checkDone(); 501 | } else { 502 | imp.addEventListener("load", loadedImport); 503 | imp.addEventListener("error", errorLoadingImport); 504 | } 505 | } 506 | } else { 507 | checkDone(); 508 | } 509 | } 510 | function isImportLoaded(link) { 511 | return useNative ? link.__loaded || link.import && link.import.readyState !== "loading" : link.__importParsed; 512 | } 513 | if (useNative) { 514 | new MutationObserver(function(mxns) { 515 | for (var i = 0, l = mxns.length, m; i < l && (m = mxns[i]); i++) { 516 | if (m.addedNodes) { 517 | handleImports(m.addedNodes); 518 | } 519 | } 520 | }).observe(document.head, { 521 | childList: true 522 | }); 523 | function handleImports(nodes) { 524 | for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) { 525 | if (isImport(n)) { 526 | handleImport(n); 527 | } 528 | } 529 | } 530 | function isImport(element) { 531 | return element.localName === "link" && element.rel === "import"; 532 | } 533 | function handleImport(element) { 534 | var loaded = element.import; 535 | if (loaded) { 536 | markTargetLoaded({ 537 | target: element 538 | }); 539 | } else { 540 | element.addEventListener("load", markTargetLoaded); 541 | element.addEventListener("error", markTargetLoaded); 542 | } 543 | } 544 | (function() { 545 | if (document.readyState === "loading") { 546 | var imports = document.querySelectorAll("link[rel=import]"); 547 | for (var i = 0, l = imports.length, imp; i < l && (imp = imports[i]); i++) { 548 | handleImport(imp); 549 | } 550 | } 551 | })(); 552 | } 553 | whenReady(function(detail) { 554 | window.HTMLImports.ready = true; 555 | window.HTMLImports.readyTime = new Date().getTime(); 556 | var evt = rootDocument.createEvent("CustomEvent"); 557 | evt.initCustomEvent("HTMLImportsLoaded", true, true, detail); 558 | rootDocument.dispatchEvent(evt); 559 | }); 560 | scope.IMPORT_LINK_TYPE = IMPORT_LINK_TYPE; 561 | scope.useNative = useNative; 562 | scope.rootDocument = rootDocument; 563 | scope.whenReady = whenReady; 564 | scope.isIE = isIE; 565 | })(window.HTMLImports); 566 | 567 | (function(scope) { 568 | var modules = []; 569 | var addModule = function(module) { 570 | modules.push(module); 571 | }; 572 | var initializeModules = function() { 573 | modules.forEach(function(module) { 574 | module(scope); 575 | }); 576 | }; 577 | scope.addModule = addModule; 578 | scope.initializeModules = initializeModules; 579 | })(window.HTMLImports); 580 | 581 | window.HTMLImports.addModule(function(scope) { 582 | var CSS_URL_REGEXP = /(url\()([^)]*)(\))/g; 583 | var CSS_IMPORT_REGEXP = /(@import[\s]+(?!url\())([^;]*)(;)/g; 584 | var path = { 585 | resolveUrlsInStyle: function(style, linkUrl) { 586 | var doc = style.ownerDocument; 587 | var resolver = doc.createElement("a"); 588 | style.textContent = this.resolveUrlsInCssText(style.textContent, linkUrl, resolver); 589 | return style; 590 | }, 591 | resolveUrlsInCssText: function(cssText, linkUrl, urlObj) { 592 | var r = this.replaceUrls(cssText, urlObj, linkUrl, CSS_URL_REGEXP); 593 | r = this.replaceUrls(r, urlObj, linkUrl, CSS_IMPORT_REGEXP); 594 | return r; 595 | }, 596 | replaceUrls: function(text, urlObj, linkUrl, regexp) { 597 | return text.replace(regexp, function(m, pre, url, post) { 598 | var urlPath = url.replace(/["']/g, ""); 599 | if (linkUrl) { 600 | urlPath = new URL(urlPath, linkUrl).href; 601 | } 602 | urlObj.href = urlPath; 603 | urlPath = urlObj.href; 604 | return pre + "'" + urlPath + "'" + post; 605 | }); 606 | } 607 | }; 608 | scope.path = path; 609 | }); 610 | 611 | window.HTMLImports.addModule(function(scope) { 612 | var xhr = { 613 | async: true, 614 | ok: function(request) { 615 | return request.status >= 200 && request.status < 300 || request.status === 304 || request.status === 0; 616 | }, 617 | load: function(url, next, nextContext) { 618 | var request = new XMLHttpRequest(); 619 | if (scope.flags.debug || scope.flags.bust) { 620 | url += "?" + Math.random(); 621 | } 622 | request.open("GET", url, xhr.async); 623 | request.addEventListener("readystatechange", function(e) { 624 | if (request.readyState === 4) { 625 | var redirectedUrl = null; 626 | try { 627 | var locationHeader = request.getResponseHeader("Location"); 628 | if (locationHeader) { 629 | redirectedUrl = locationHeader.substr(0, 1) === "/" ? location.origin + locationHeader : locationHeader; 630 | } 631 | } catch (e) { 632 | console.error(e.message); 633 | } 634 | next.call(nextContext, !xhr.ok(request) && request, request.response || request.responseText, redirectedUrl); 635 | } 636 | }); 637 | request.send(); 638 | return request; 639 | }, 640 | loadDocument: function(url, next, nextContext) { 641 | this.load(url, next, nextContext).responseType = "document"; 642 | } 643 | }; 644 | scope.xhr = xhr; 645 | }); 646 | 647 | window.HTMLImports.addModule(function(scope) { 648 | var xhr = scope.xhr; 649 | var flags = scope.flags; 650 | var Loader = function(onLoad, onComplete) { 651 | this.cache = {}; 652 | this.onload = onLoad; 653 | this.oncomplete = onComplete; 654 | this.inflight = 0; 655 | this.pending = {}; 656 | }; 657 | Loader.prototype = { 658 | addNodes: function(nodes) { 659 | this.inflight += nodes.length; 660 | for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) { 661 | this.require(n); 662 | } 663 | this.checkDone(); 664 | }, 665 | addNode: function(node) { 666 | this.inflight++; 667 | this.require(node); 668 | this.checkDone(); 669 | }, 670 | require: function(elt) { 671 | var url = elt.src || elt.href; 672 | elt.__nodeUrl = url; 673 | if (!this.dedupe(url, elt)) { 674 | this.fetch(url, elt); 675 | } 676 | }, 677 | dedupe: function(url, elt) { 678 | if (this.pending[url]) { 679 | this.pending[url].push(elt); 680 | return true; 681 | } 682 | var resource; 683 | if (this.cache[url]) { 684 | this.onload(url, elt, this.cache[url]); 685 | this.tail(); 686 | return true; 687 | } 688 | this.pending[url] = [ elt ]; 689 | return false; 690 | }, 691 | fetch: function(url, elt) { 692 | flags.load && console.log("fetch", url, elt); 693 | if (!url) { 694 | setTimeout(function() { 695 | this.receive(url, elt, { 696 | error: "href must be specified" 697 | }, null); 698 | }.bind(this), 0); 699 | } else if (url.match(/^data:/)) { 700 | var pieces = url.split(","); 701 | var header = pieces[0]; 702 | var body = pieces[1]; 703 | if (header.indexOf(";base64") > -1) { 704 | body = atob(body); 705 | } else { 706 | body = decodeURIComponent(body); 707 | } 708 | setTimeout(function() { 709 | this.receive(url, elt, null, body); 710 | }.bind(this), 0); 711 | } else { 712 | var receiveXhr = function(err, resource, redirectedUrl) { 713 | this.receive(url, elt, err, resource, redirectedUrl); 714 | }.bind(this); 715 | xhr.load(url, receiveXhr); 716 | } 717 | }, 718 | receive: function(url, elt, err, resource, redirectedUrl) { 719 | this.cache[url] = resource; 720 | var $p = this.pending[url]; 721 | for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) { 722 | this.onload(url, p, resource, err, redirectedUrl); 723 | this.tail(); 724 | } 725 | this.pending[url] = null; 726 | }, 727 | tail: function() { 728 | --this.inflight; 729 | this.checkDone(); 730 | }, 731 | checkDone: function() { 732 | if (!this.inflight) { 733 | this.oncomplete(); 734 | } 735 | } 736 | }; 737 | scope.Loader = Loader; 738 | }); 739 | 740 | window.HTMLImports.addModule(function(scope) { 741 | var Observer = function(addCallback) { 742 | this.addCallback = addCallback; 743 | this.mo = new MutationObserver(this.handler.bind(this)); 744 | }; 745 | Observer.prototype = { 746 | handler: function(mutations) { 747 | for (var i = 0, l = mutations.length, m; i < l && (m = mutations[i]); i++) { 748 | if (m.type === "childList" && m.addedNodes.length) { 749 | this.addedNodes(m.addedNodes); 750 | } 751 | } 752 | }, 753 | addedNodes: function(nodes) { 754 | if (this.addCallback) { 755 | this.addCallback(nodes); 756 | } 757 | for (var i = 0, l = nodes.length, n, loading; i < l && (n = nodes[i]); i++) { 758 | if (n.children && n.children.length) { 759 | this.addedNodes(n.children); 760 | } 761 | } 762 | }, 763 | observe: function(root) { 764 | this.mo.observe(root, { 765 | childList: true, 766 | subtree: true 767 | }); 768 | } 769 | }; 770 | scope.Observer = Observer; 771 | }); 772 | 773 | window.HTMLImports.addModule(function(scope) { 774 | var path = scope.path; 775 | var rootDocument = scope.rootDocument; 776 | var flags = scope.flags; 777 | var isIE = scope.isIE; 778 | var IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE; 779 | var IMPORT_SELECTOR = "link[rel=" + IMPORT_LINK_TYPE + "]"; 780 | var importParser = { 781 | documentSelectors: IMPORT_SELECTOR, 782 | importsSelectors: [ IMPORT_SELECTOR, "link[rel=stylesheet]:not([type])", "style:not([type])", "script:not([type])", 'script[type="application/javascript"]', 'script[type="text/javascript"]' ].join(","), 783 | map: { 784 | link: "parseLink", 785 | script: "parseScript", 786 | style: "parseStyle" 787 | }, 788 | dynamicElements: [], 789 | parseNext: function() { 790 | var next = this.nextToParse(); 791 | if (next) { 792 | this.parse(next); 793 | } 794 | }, 795 | parse: function(elt) { 796 | if (this.isParsed(elt)) { 797 | flags.parse && console.log("[%s] is already parsed", elt.localName); 798 | return; 799 | } 800 | var fn = this[this.map[elt.localName]]; 801 | if (fn) { 802 | this.markParsing(elt); 803 | fn.call(this, elt); 804 | } 805 | }, 806 | parseDynamic: function(elt, quiet) { 807 | this.dynamicElements.push(elt); 808 | if (!quiet) { 809 | this.parseNext(); 810 | } 811 | }, 812 | markParsing: function(elt) { 813 | flags.parse && console.log("parsing", elt); 814 | this.parsingElement = elt; 815 | }, 816 | markParsingComplete: function(elt) { 817 | elt.__importParsed = true; 818 | this.markDynamicParsingComplete(elt); 819 | if (elt.__importElement) { 820 | elt.__importElement.__importParsed = true; 821 | this.markDynamicParsingComplete(elt.__importElement); 822 | } 823 | this.parsingElement = null; 824 | flags.parse && console.log("completed", elt); 825 | }, 826 | markDynamicParsingComplete: function(elt) { 827 | var i = this.dynamicElements.indexOf(elt); 828 | if (i >= 0) { 829 | this.dynamicElements.splice(i, 1); 830 | } 831 | }, 832 | parseImport: function(elt) { 833 | elt.import = elt.__doc; 834 | if (window.HTMLImports.__importsParsingHook) { 835 | window.HTMLImports.__importsParsingHook(elt); 836 | } 837 | if (elt.import) { 838 | elt.import.__importParsed = true; 839 | } 840 | this.markParsingComplete(elt); 841 | if (elt.__resource && !elt.__error) { 842 | elt.dispatchEvent(new CustomEvent("load", { 843 | bubbles: false 844 | })); 845 | } else { 846 | elt.dispatchEvent(new CustomEvent("error", { 847 | bubbles: false 848 | })); 849 | } 850 | if (elt.__pending) { 851 | var fn; 852 | while (elt.__pending.length) { 853 | fn = elt.__pending.shift(); 854 | if (fn) { 855 | fn({ 856 | target: elt 857 | }); 858 | } 859 | } 860 | } 861 | this.parseNext(); 862 | }, 863 | parseLink: function(linkElt) { 864 | if (nodeIsImport(linkElt)) { 865 | this.parseImport(linkElt); 866 | } else { 867 | linkElt.href = linkElt.href; 868 | this.parseGeneric(linkElt); 869 | } 870 | }, 871 | parseStyle: function(elt) { 872 | var src = elt; 873 | elt = cloneStyle(elt); 874 | src.__appliedElement = elt; 875 | elt.__importElement = src; 876 | this.parseGeneric(elt); 877 | }, 878 | parseGeneric: function(elt) { 879 | this.trackElement(elt); 880 | this.addElementToDocument(elt); 881 | }, 882 | rootImportForElement: function(elt) { 883 | var n = elt; 884 | while (n.ownerDocument.__importLink) { 885 | n = n.ownerDocument.__importLink; 886 | } 887 | return n; 888 | }, 889 | addElementToDocument: function(elt) { 890 | var port = this.rootImportForElement(elt.__importElement || elt); 891 | port.parentNode.insertBefore(elt, port); 892 | }, 893 | trackElement: function(elt, callback) { 894 | var self = this; 895 | var done = function(e) { 896 | elt.removeEventListener("load", done); 897 | elt.removeEventListener("error", done); 898 | if (callback) { 899 | callback(e); 900 | } 901 | self.markParsingComplete(elt); 902 | self.parseNext(); 903 | }; 904 | elt.addEventListener("load", done); 905 | elt.addEventListener("error", done); 906 | if (isIE && elt.localName === "style") { 907 | var fakeLoad = false; 908 | if (elt.textContent.indexOf("@import") == -1) { 909 | fakeLoad = true; 910 | } else if (elt.sheet) { 911 | fakeLoad = true; 912 | var csr = elt.sheet.cssRules; 913 | var len = csr ? csr.length : 0; 914 | for (var i = 0, r; i < len && (r = csr[i]); i++) { 915 | if (r.type === CSSRule.IMPORT_RULE) { 916 | fakeLoad = fakeLoad && Boolean(r.styleSheet); 917 | } 918 | } 919 | } 920 | if (fakeLoad) { 921 | setTimeout(function() { 922 | elt.dispatchEvent(new CustomEvent("load", { 923 | bubbles: false 924 | })); 925 | }); 926 | } 927 | } 928 | }, 929 | parseScript: function(scriptElt) { 930 | var script = document.createElement("script"); 931 | script.__importElement = scriptElt; 932 | script.src = scriptElt.src ? scriptElt.src : generateScriptDataUrl(scriptElt); 933 | scope.currentScript = scriptElt; 934 | this.trackElement(script, function(e) { 935 | if (script.parentNode) { 936 | script.parentNode.removeChild(script); 937 | } 938 | scope.currentScript = null; 939 | }); 940 | this.addElementToDocument(script); 941 | }, 942 | nextToParse: function() { 943 | this._mayParse = []; 944 | return !this.parsingElement && (this.nextToParseInDoc(rootDocument) || this.nextToParseDynamic()); 945 | }, 946 | nextToParseInDoc: function(doc, link) { 947 | if (doc && this._mayParse.indexOf(doc) < 0) { 948 | this._mayParse.push(doc); 949 | var nodes = doc.querySelectorAll(this.parseSelectorsForNode(doc)); 950 | for (var i = 0, l = nodes.length, p = 0, n; i < l && (n = nodes[i]); i++) { 951 | if (!this.isParsed(n)) { 952 | if (this.hasResource(n)) { 953 | return nodeIsImport(n) ? this.nextToParseInDoc(n.__doc, n) : n; 954 | } else { 955 | return; 956 | } 957 | } 958 | } 959 | } 960 | return link; 961 | }, 962 | nextToParseDynamic: function() { 963 | return this.dynamicElements[0]; 964 | }, 965 | parseSelectorsForNode: function(node) { 966 | var doc = node.ownerDocument || node; 967 | return doc === rootDocument ? this.documentSelectors : this.importsSelectors; 968 | }, 969 | isParsed: function(node) { 970 | return node.__importParsed; 971 | }, 972 | needsDynamicParsing: function(elt) { 973 | return this.dynamicElements.indexOf(elt) >= 0; 974 | }, 975 | hasResource: function(node) { 976 | if (nodeIsImport(node) && node.__doc === undefined) { 977 | return false; 978 | } 979 | return true; 980 | } 981 | }; 982 | function nodeIsImport(elt) { 983 | return elt.localName === "link" && elt.rel === IMPORT_LINK_TYPE; 984 | } 985 | function generateScriptDataUrl(script) { 986 | var scriptContent = generateScriptContent(script); 987 | return "data:text/javascript;charset=utf-8," + encodeURIComponent(scriptContent); 988 | } 989 | function generateScriptContent(script) { 990 | return script.textContent + generateSourceMapHint(script); 991 | } 992 | function generateSourceMapHint(script) { 993 | var owner = script.ownerDocument; 994 | owner.__importedScripts = owner.__importedScripts || 0; 995 | var moniker = script.ownerDocument.baseURI; 996 | var num = owner.__importedScripts ? "-" + owner.__importedScripts : ""; 997 | owner.__importedScripts++; 998 | return "\n//# sourceURL=" + moniker + num + ".js\n"; 999 | } 1000 | function cloneStyle(style) { 1001 | var clone = style.ownerDocument.createElement("style"); 1002 | clone.textContent = style.textContent; 1003 | path.resolveUrlsInStyle(clone); 1004 | return clone; 1005 | } 1006 | scope.parser = importParser; 1007 | scope.IMPORT_SELECTOR = IMPORT_SELECTOR; 1008 | }); 1009 | 1010 | window.HTMLImports.addModule(function(scope) { 1011 | var flags = scope.flags; 1012 | var IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE; 1013 | var IMPORT_SELECTOR = scope.IMPORT_SELECTOR; 1014 | var rootDocument = scope.rootDocument; 1015 | var Loader = scope.Loader; 1016 | var Observer = scope.Observer; 1017 | var parser = scope.parser; 1018 | var importer = { 1019 | documents: {}, 1020 | documentPreloadSelectors: IMPORT_SELECTOR, 1021 | importsPreloadSelectors: [ IMPORT_SELECTOR ].join(","), 1022 | loadNode: function(node) { 1023 | importLoader.addNode(node); 1024 | }, 1025 | loadSubtree: function(parent) { 1026 | var nodes = this.marshalNodes(parent); 1027 | importLoader.addNodes(nodes); 1028 | }, 1029 | marshalNodes: function(parent) { 1030 | return parent.querySelectorAll(this.loadSelectorsForNode(parent)); 1031 | }, 1032 | loadSelectorsForNode: function(node) { 1033 | var doc = node.ownerDocument || node; 1034 | return doc === rootDocument ? this.documentPreloadSelectors : this.importsPreloadSelectors; 1035 | }, 1036 | loaded: function(url, elt, resource, err, redirectedUrl) { 1037 | flags.load && console.log("loaded", url, elt); 1038 | elt.__resource = resource; 1039 | elt.__error = err; 1040 | if (isImportLink(elt)) { 1041 | var doc = this.documents[url]; 1042 | if (doc === undefined) { 1043 | doc = err ? null : makeDocument(resource, redirectedUrl || url); 1044 | if (doc) { 1045 | doc.__importLink = elt; 1046 | this.bootDocument(doc); 1047 | } 1048 | this.documents[url] = doc; 1049 | } 1050 | elt.__doc = doc; 1051 | } 1052 | parser.parseNext(); 1053 | }, 1054 | bootDocument: function(doc) { 1055 | this.loadSubtree(doc); 1056 | this.observer.observe(doc); 1057 | parser.parseNext(); 1058 | }, 1059 | loadedAll: function() { 1060 | parser.parseNext(); 1061 | } 1062 | }; 1063 | var importLoader = new Loader(importer.loaded.bind(importer), importer.loadedAll.bind(importer)); 1064 | importer.observer = new Observer(); 1065 | function isImportLink(elt) { 1066 | return isLinkRel(elt, IMPORT_LINK_TYPE); 1067 | } 1068 | function isLinkRel(elt, rel) { 1069 | return elt.localName === "link" && elt.getAttribute("rel") === rel; 1070 | } 1071 | function hasBaseURIAccessor(doc) { 1072 | return !!Object.getOwnPropertyDescriptor(doc, "baseURI"); 1073 | } 1074 | function makeDocument(resource, url) { 1075 | var doc = document.implementation.createHTMLDocument(IMPORT_LINK_TYPE); 1076 | doc._URL = url; 1077 | var base = doc.createElement("base"); 1078 | base.setAttribute("href", url); 1079 | if (!doc.baseURI && !hasBaseURIAccessor(doc)) { 1080 | Object.defineProperty(doc, "baseURI", { 1081 | value: url 1082 | }); 1083 | } 1084 | var meta = doc.createElement("meta"); 1085 | meta.setAttribute("charset", "utf-8"); 1086 | doc.head.appendChild(meta); 1087 | doc.head.appendChild(base); 1088 | doc.body.innerHTML = resource; 1089 | if (window.HTMLTemplateElement && HTMLTemplateElement.bootstrap) { 1090 | HTMLTemplateElement.bootstrap(doc); 1091 | } 1092 | return doc; 1093 | } 1094 | if (!document.baseURI) { 1095 | var baseURIDescriptor = { 1096 | get: function() { 1097 | var base = document.querySelector("base"); 1098 | return base ? base.href : window.location.href; 1099 | }, 1100 | configurable: true 1101 | }; 1102 | Object.defineProperty(document, "baseURI", baseURIDescriptor); 1103 | Object.defineProperty(rootDocument, "baseURI", baseURIDescriptor); 1104 | } 1105 | scope.importer = importer; 1106 | scope.importLoader = importLoader; 1107 | }); 1108 | 1109 | window.HTMLImports.addModule(function(scope) { 1110 | var parser = scope.parser; 1111 | var importer = scope.importer; 1112 | var dynamic = { 1113 | added: function(nodes) { 1114 | var owner, parsed, loading; 1115 | for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) { 1116 | if (!owner) { 1117 | owner = n.ownerDocument; 1118 | parsed = parser.isParsed(owner); 1119 | } 1120 | loading = this.shouldLoadNode(n); 1121 | if (loading) { 1122 | importer.loadNode(n); 1123 | } 1124 | if (this.shouldParseNode(n) && parsed) { 1125 | parser.parseDynamic(n, loading); 1126 | } 1127 | } 1128 | }, 1129 | shouldLoadNode: function(node) { 1130 | return node.nodeType === 1 && matches.call(node, importer.loadSelectorsForNode(node)); 1131 | }, 1132 | shouldParseNode: function(node) { 1133 | return node.nodeType === 1 && matches.call(node, parser.parseSelectorsForNode(node)); 1134 | } 1135 | }; 1136 | importer.observer.addCallback = dynamic.added.bind(dynamic); 1137 | var matches = HTMLElement.prototype.matches || HTMLElement.prototype.matchesSelector || HTMLElement.prototype.webkitMatchesSelector || HTMLElement.prototype.mozMatchesSelector || HTMLElement.prototype.msMatchesSelector; 1138 | }); 1139 | 1140 | (function(scope) { 1141 | var initializeModules = scope.initializeModules; 1142 | var isIE = scope.isIE; 1143 | if (scope.useNative) { 1144 | return; 1145 | } 1146 | initializeModules(); 1147 | var rootDocument = scope.rootDocument; 1148 | function bootstrap() { 1149 | window.HTMLImports.importer.bootDocument(rootDocument); 1150 | } 1151 | if (document.readyState === "complete" || document.readyState === "interactive" && !window.attachEvent) { 1152 | bootstrap(); 1153 | } else { 1154 | document.addEventListener("DOMContentLoaded", bootstrap); 1155 | } 1156 | })(window.HTMLImports); -------------------------------------------------------------------------------- /bower_components/webcomponentsjs/HTMLImports.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | * Code distributed by Google as part of the polymer project is also 8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | // @version 0.7.18 11 | "undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};n.prototype={set:function(t,n){var r=t[this.name];return r&&r[0]===t?r[1]=n:e(t,this.name,{value:[t,n],writable:!0}),this},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){var t=e[this.name];return t&&t[0]===e?(t[0]=t[1]=void 0,!0):!1},has:function(e){var t=e[this.name];return t?t[0]===e:!1}},window.WeakMap=n}(),function(e){function t(e){E.push(e),g||(g=!0,f(r))}function n(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function r(){g=!1;var e=E;E=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var n=e.takeRecords();o(e),n.length&&(e.callback_(n,e),t=!0)}),t&&r()}function o(e){e.nodes_.forEach(function(t){var n=v.get(t);n&&n.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function i(e,t){for(var n=e;n;n=n.parentNode){var r=v.get(n);if(r)for(var o=0;o0){var o=n[r-1],i=m(o,e);if(i)return void(n[r-1]=i)}else t(this.observer);n[r]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=v.get(e);t||v.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=v.get(e),n=0;nm&&(h=s[m]);m++)a(h)?(d++,n()):(h.addEventListener("load",r),h.addEventListener("error",i));else n()}function a(e){return l?e.__loaded||e["import"]&&"loading"!==e["import"].readyState:e.__importParsed}function s(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)d(t)&&c(t)}function d(e){return"link"===e.localName&&"import"===e.rel}function c(e){var t=e["import"];t?o({target:e}):(e.addEventListener("load",o),e.addEventListener("error",o))}var u="import",l=Boolean(u in document.createElement("link")),h=Boolean(window.ShadowDOMPolyfill),m=function(e){return h?window.ShadowDOMPolyfill.wrapIfNeeded(e):e},p=m(document),f={get:function(){var e=window.HTMLImports.currentScript||document.currentScript||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null);return m(e)},configurable:!0};Object.defineProperty(document,"_currentScript",f),Object.defineProperty(p,"_currentScript",f);var v=/Trident/.test(navigator.userAgent),w=v?"complete":"interactive",b="readystatechange";l&&(new MutationObserver(function(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)t.addedNodes&&s(t.addedNodes)}).observe(document.head,{childList:!0}),function(){if("loading"===document.readyState)for(var e,t=document.querySelectorAll("link[rel=import]"),n=0,r=t.length;r>n&&(e=t[n]);n++)c(e)}()),t(function(e){window.HTMLImports.ready=!0,window.HTMLImports.readyTime=(new Date).getTime();var t=p.createEvent("CustomEvent");t.initCustomEvent("HTMLImportsLoaded",!0,!0,e),p.dispatchEvent(t)}),e.IMPORT_LINK_TYPE=u,e.useNative=l,e.rootDocument=p,e.whenReady=t,e.isIE=v}(window.HTMLImports),function(e){var t=[],n=function(e){t.push(e)},r=function(){t.forEach(function(t){t(e)})};e.addModule=n,e.initializeModules=r}(window.HTMLImports),window.HTMLImports.addModule(function(e){var t=/(url\()([^)]*)(\))/g,n=/(@import[\s]+(?!url\())([^;]*)(;)/g,r={resolveUrlsInStyle:function(e,t){var n=e.ownerDocument,r=n.createElement("a");return e.textContent=this.resolveUrlsInCssText(e.textContent,t,r),e},resolveUrlsInCssText:function(e,r,o){var i=this.replaceUrls(e,o,r,t);return i=this.replaceUrls(i,o,r,n)},replaceUrls:function(e,t,n,r){return e.replace(r,function(e,r,o,i){var a=o.replace(/["']/g,"");return n&&(a=new URL(a,n).href),t.href=a,a=t.href,r+"'"+a+"'"+i})}};e.path=r}),window.HTMLImports.addModule(function(e){var t={async:!0,ok:function(e){return e.status>=200&&e.status<300||304===e.status||0===e.status},load:function(n,r,o){var i=new XMLHttpRequest;return(e.flags.debug||e.flags.bust)&&(n+="?"+Math.random()),i.open("GET",n,t.async),i.addEventListener("readystatechange",function(e){if(4===i.readyState){var n=null;try{var a=i.getResponseHeader("Location");a&&(n="/"===a.substr(0,1)?location.origin+a:a)}catch(e){console.error(e.message)}r.call(o,!t.ok(i)&&i,i.response||i.responseText,n)}}),i.send(),i},loadDocument:function(e,t,n){this.load(e,t,n).responseType="document"}};e.xhr=t}),window.HTMLImports.addModule(function(e){var t=e.xhr,n=e.flags,r=function(e,t){this.cache={},this.onload=e,this.oncomplete=t,this.inflight=0,this.pending={}};r.prototype={addNodes:function(e){this.inflight+=e.length;for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)this.require(t);this.checkDone()},addNode:function(e){this.inflight++,this.require(e),this.checkDone()},require:function(e){var t=e.src||e.href;e.__nodeUrl=t,this.dedupe(t,e)||this.fetch(t,e)},dedupe:function(e,t){if(this.pending[e])return this.pending[e].push(t),!0;return this.cache[e]?(this.onload(e,t,this.cache[e]),this.tail(),!0):(this.pending[e]=[t],!1)},fetch:function(e,r){if(n.load&&console.log("fetch",e,r),e)if(e.match(/^data:/)){var o=e.split(","),i=o[0],a=o[1];a=i.indexOf(";base64")>-1?atob(a):decodeURIComponent(a),setTimeout(function(){this.receive(e,r,null,a)}.bind(this),0)}else{var s=function(t,n,o){this.receive(e,r,t,n,o)}.bind(this);t.load(e,s)}else setTimeout(function(){this.receive(e,r,{error:"href must be specified"},null)}.bind(this),0)},receive:function(e,t,n,r,o){this.cache[e]=r;for(var i,a=this.pending[e],s=0,d=a.length;d>s&&(i=a[s]);s++)this.onload(e,i,r,n,o),this.tail();this.pending[e]=null},tail:function(){--this.inflight,this.checkDone()},checkDone:function(){this.inflight||this.oncomplete()}},e.Loader=r}),window.HTMLImports.addModule(function(e){var t=function(e){this.addCallback=e,this.mo=new MutationObserver(this.handler.bind(this))};t.prototype={handler:function(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)"childList"===t.type&&t.addedNodes.length&&this.addedNodes(t.addedNodes)},addedNodes:function(e){this.addCallback&&this.addCallback(e);for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)t.children&&t.children.length&&this.addedNodes(t.children)},observe:function(e){this.mo.observe(e,{childList:!0,subtree:!0})}},e.Observer=t}),window.HTMLImports.addModule(function(e){function t(e){return"link"===e.localName&&e.rel===u}function n(e){var t=r(e);return"data:text/javascript;charset=utf-8,"+encodeURIComponent(t)}function r(e){return e.textContent+o(e)}function o(e){var t=e.ownerDocument;t.__importedScripts=t.__importedScripts||0;var n=e.ownerDocument.baseURI,r=t.__importedScripts?"-"+t.__importedScripts:"";return t.__importedScripts++,"\n//# sourceURL="+n+r+".js\n"}function i(e){var t=e.ownerDocument.createElement("style");return t.textContent=e.textContent,a.resolveUrlsInStyle(t),t}var a=e.path,s=e.rootDocument,d=e.flags,c=e.isIE,u=e.IMPORT_LINK_TYPE,l="link[rel="+u+"]",h={documentSelectors:l,importsSelectors:[l,"link[rel=stylesheet]:not([type])","style:not([type])","script:not([type])",'script[type="application/javascript"]','script[type="text/javascript"]'].join(","),map:{link:"parseLink",script:"parseScript",style:"parseStyle"},dynamicElements:[],parseNext:function(){var e=this.nextToParse();e&&this.parse(e)},parse:function(e){if(this.isParsed(e))return void(d.parse&&console.log("[%s] is already parsed",e.localName));var t=this[this.map[e.localName]];t&&(this.markParsing(e),t.call(this,e))},parseDynamic:function(e,t){this.dynamicElements.push(e),t||this.parseNext()},markParsing:function(e){d.parse&&console.log("parsing",e),this.parsingElement=e},markParsingComplete:function(e){e.__importParsed=!0,this.markDynamicParsingComplete(e),e.__importElement&&(e.__importElement.__importParsed=!0,this.markDynamicParsingComplete(e.__importElement)),this.parsingElement=null,d.parse&&console.log("completed",e)},markDynamicParsingComplete:function(e){var t=this.dynamicElements.indexOf(e);t>=0&&this.dynamicElements.splice(t,1)},parseImport:function(e){if(e["import"]=e.__doc,window.HTMLImports.__importsParsingHook&&window.HTMLImports.__importsParsingHook(e),e["import"]&&(e["import"].__importParsed=!0),this.markParsingComplete(e),e.__resource&&!e.__error?e.dispatchEvent(new CustomEvent("load",{bubbles:!1})):e.dispatchEvent(new CustomEvent("error",{bubbles:!1})),e.__pending)for(var t;e.__pending.length;)t=e.__pending.shift(),t&&t({target:e});this.parseNext()},parseLink:function(e){t(e)?this.parseImport(e):(e.href=e.href,this.parseGeneric(e))},parseStyle:function(e){var t=e;e=i(e),t.__appliedElement=e,e.__importElement=t,this.parseGeneric(e)},parseGeneric:function(e){this.trackElement(e),this.addElementToDocument(e)},rootImportForElement:function(e){for(var t=e;t.ownerDocument.__importLink;)t=t.ownerDocument.__importLink;return t},addElementToDocument:function(e){var t=this.rootImportForElement(e.__importElement||e);t.parentNode.insertBefore(e,t)},trackElement:function(e,t){var n=this,r=function(o){e.removeEventListener("load",r),e.removeEventListener("error",r),t&&t(o),n.markParsingComplete(e),n.parseNext()};if(e.addEventListener("load",r),e.addEventListener("error",r),c&&"style"===e.localName){var o=!1;if(-1==e.textContent.indexOf("@import"))o=!0;else if(e.sheet){o=!0;for(var i,a=e.sheet.cssRules,s=a?a.length:0,d=0;s>d&&(i=a[d]);d++)i.type===CSSRule.IMPORT_RULE&&(o=o&&Boolean(i.styleSheet))}o&&setTimeout(function(){e.dispatchEvent(new CustomEvent("load",{bubbles:!1}))})}},parseScript:function(t){var r=document.createElement("script");r.__importElement=t,r.src=t.src?t.src:n(t),e.currentScript=t,this.trackElement(r,function(t){r.parentNode&&r.parentNode.removeChild(r),e.currentScript=null}),this.addElementToDocument(r)},nextToParse:function(){return this._mayParse=[],!this.parsingElement&&(this.nextToParseInDoc(s)||this.nextToParseDynamic())},nextToParseInDoc:function(e,n){if(e&&this._mayParse.indexOf(e)<0){this._mayParse.push(e);for(var r,o=e.querySelectorAll(this.parseSelectorsForNode(e)),i=0,a=o.length;a>i&&(r=o[i]);i++)if(!this.isParsed(r))return this.hasResource(r)?t(r)?this.nextToParseInDoc(r.__doc,r):r:void 0}return n},nextToParseDynamic:function(){return this.dynamicElements[0]},parseSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===s?this.documentSelectors:this.importsSelectors},isParsed:function(e){return e.__importParsed},needsDynamicParsing:function(e){return this.dynamicElements.indexOf(e)>=0},hasResource:function(e){return t(e)&&void 0===e.__doc?!1:!0}};e.parser=h,e.IMPORT_SELECTOR=l}),window.HTMLImports.addModule(function(e){function t(e){return n(e,a)}function n(e,t){return"link"===e.localName&&e.getAttribute("rel")===t}function r(e){return!!Object.getOwnPropertyDescriptor(e,"baseURI")}function o(e,t){var n=document.implementation.createHTMLDocument(a);n._URL=t;var o=n.createElement("base");o.setAttribute("href",t),n.baseURI||r(n)||Object.defineProperty(n,"baseURI",{value:t});var i=n.createElement("meta");return i.setAttribute("charset","utf-8"),n.head.appendChild(i),n.head.appendChild(o),n.body.innerHTML=e,window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(n),n}var i=e.flags,a=e.IMPORT_LINK_TYPE,s=e.IMPORT_SELECTOR,d=e.rootDocument,c=e.Loader,u=e.Observer,l=e.parser,h={documents:{},documentPreloadSelectors:s,importsPreloadSelectors:[s].join(","),loadNode:function(e){m.addNode(e)},loadSubtree:function(e){var t=this.marshalNodes(e);m.addNodes(t)},marshalNodes:function(e){return e.querySelectorAll(this.loadSelectorsForNode(e))},loadSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===d?this.documentPreloadSelectors:this.importsPreloadSelectors},loaded:function(e,n,r,a,s){if(i.load&&console.log("loaded",e,n),n.__resource=r,n.__error=a,t(n)){var d=this.documents[e];void 0===d&&(d=a?null:o(r,s||e),d&&(d.__importLink=n,this.bootDocument(d)),this.documents[e]=d),n.__doc=d}l.parseNext()},bootDocument:function(e){this.loadSubtree(e),this.observer.observe(e),l.parseNext()},loadedAll:function(){l.parseNext()}},m=new c(h.loaded.bind(h),h.loadedAll.bind(h));if(h.observer=new u,!document.baseURI){var p={get:function(){var e=document.querySelector("base");return e?e.href:window.location.href},configurable:!0};Object.defineProperty(document,"baseURI",p),Object.defineProperty(d,"baseURI",p)}e.importer=h,e.importLoader=m}),window.HTMLImports.addModule(function(e){var t=e.parser,n=e.importer,r={added:function(e){for(var r,o,i,a,s=0,d=e.length;d>s&&(a=e[s]);s++)r||(r=a.ownerDocument,o=t.isParsed(r)),i=this.shouldLoadNode(a),i&&n.loadNode(a),this.shouldParseNode(a)&&o&&t.parseDynamic(a,i)},shouldLoadNode:function(e){return 1===e.nodeType&&o.call(e,n.loadSelectorsForNode(e))},shouldParseNode:function(e){return 1===e.nodeType&&o.call(e,t.parseSelectorsForNode(e))}};n.observer.addCallback=r.added.bind(r);var o=HTMLElement.prototype.matches||HTMLElement.prototype.matchesSelector||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector}),function(e){function t(){window.HTMLImports.importer.bootDocument(r)}var n=e.initializeModules;e.isIE;if(!e.useNative){n();var r=e.rootDocument;"complete"===document.readyState||"interactive"===document.readyState&&!window.attachEvent?t():document.addEventListener("DOMContentLoaded",t)}}(window.HTMLImports); -------------------------------------------------------------------------------- /bower_components/webcomponentsjs/MutationObserver.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | * Code distributed by Google as part of the polymer project is also 8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | // @version 0.7.18 11 | if (typeof WeakMap === "undefined") { 12 | (function() { 13 | var defineProperty = Object.defineProperty; 14 | var counter = Date.now() % 1e9; 15 | var WeakMap = function() { 16 | this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__"); 17 | }; 18 | WeakMap.prototype = { 19 | set: function(key, value) { 20 | var entry = key[this.name]; 21 | if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, { 22 | value: [ key, value ], 23 | writable: true 24 | }); 25 | return this; 26 | }, 27 | get: function(key) { 28 | var entry; 29 | return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined; 30 | }, 31 | "delete": function(key) { 32 | var entry = key[this.name]; 33 | if (!entry || entry[0] !== key) return false; 34 | entry[0] = entry[1] = undefined; 35 | return true; 36 | }, 37 | has: function(key) { 38 | var entry = key[this.name]; 39 | if (!entry) return false; 40 | return entry[0] === key; 41 | } 42 | }; 43 | window.WeakMap = WeakMap; 44 | })(); 45 | } 46 | 47 | (function(global) { 48 | if (global.JsMutationObserver) { 49 | return; 50 | } 51 | var registrationsTable = new WeakMap(); 52 | var setImmediate; 53 | if (/Trident|Edge/.test(navigator.userAgent)) { 54 | setImmediate = setTimeout; 55 | } else if (window.setImmediate) { 56 | setImmediate = window.setImmediate; 57 | } else { 58 | var setImmediateQueue = []; 59 | var sentinel = String(Math.random()); 60 | window.addEventListener("message", function(e) { 61 | if (e.data === sentinel) { 62 | var queue = setImmediateQueue; 63 | setImmediateQueue = []; 64 | queue.forEach(function(func) { 65 | func(); 66 | }); 67 | } 68 | }); 69 | setImmediate = function(func) { 70 | setImmediateQueue.push(func); 71 | window.postMessage(sentinel, "*"); 72 | }; 73 | } 74 | var isScheduled = false; 75 | var scheduledObservers = []; 76 | function scheduleCallback(observer) { 77 | scheduledObservers.push(observer); 78 | if (!isScheduled) { 79 | isScheduled = true; 80 | setImmediate(dispatchCallbacks); 81 | } 82 | } 83 | function wrapIfNeeded(node) { 84 | return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node; 85 | } 86 | function dispatchCallbacks() { 87 | isScheduled = false; 88 | var observers = scheduledObservers; 89 | scheduledObservers = []; 90 | observers.sort(function(o1, o2) { 91 | return o1.uid_ - o2.uid_; 92 | }); 93 | var anyNonEmpty = false; 94 | observers.forEach(function(observer) { 95 | var queue = observer.takeRecords(); 96 | removeTransientObserversFor(observer); 97 | if (queue.length) { 98 | observer.callback_(queue, observer); 99 | anyNonEmpty = true; 100 | } 101 | }); 102 | if (anyNonEmpty) dispatchCallbacks(); 103 | } 104 | function removeTransientObserversFor(observer) { 105 | observer.nodes_.forEach(function(node) { 106 | var registrations = registrationsTable.get(node); 107 | if (!registrations) return; 108 | registrations.forEach(function(registration) { 109 | if (registration.observer === observer) registration.removeTransientObservers(); 110 | }); 111 | }); 112 | } 113 | function forEachAncestorAndObserverEnqueueRecord(target, callback) { 114 | for (var node = target; node; node = node.parentNode) { 115 | var registrations = registrationsTable.get(node); 116 | if (registrations) { 117 | for (var j = 0; j < registrations.length; j++) { 118 | var registration = registrations[j]; 119 | var options = registration.options; 120 | if (node !== target && !options.subtree) continue; 121 | var record = callback(options); 122 | if (record) registration.enqueue(record); 123 | } 124 | } 125 | } 126 | } 127 | var uidCounter = 0; 128 | function JsMutationObserver(callback) { 129 | this.callback_ = callback; 130 | this.nodes_ = []; 131 | this.records_ = []; 132 | this.uid_ = ++uidCounter; 133 | } 134 | JsMutationObserver.prototype = { 135 | observe: function(target, options) { 136 | target = wrapIfNeeded(target); 137 | if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) { 138 | throw new SyntaxError(); 139 | } 140 | var registrations = registrationsTable.get(target); 141 | if (!registrations) registrationsTable.set(target, registrations = []); 142 | var registration; 143 | for (var i = 0; i < registrations.length; i++) { 144 | if (registrations[i].observer === this) { 145 | registration = registrations[i]; 146 | registration.removeListeners(); 147 | registration.options = options; 148 | break; 149 | } 150 | } 151 | if (!registration) { 152 | registration = new Registration(this, target, options); 153 | registrations.push(registration); 154 | this.nodes_.push(target); 155 | } 156 | registration.addListeners(); 157 | }, 158 | disconnect: function() { 159 | this.nodes_.forEach(function(node) { 160 | var registrations = registrationsTable.get(node); 161 | for (var i = 0; i < registrations.length; i++) { 162 | var registration = registrations[i]; 163 | if (registration.observer === this) { 164 | registration.removeListeners(); 165 | registrations.splice(i, 1); 166 | break; 167 | } 168 | } 169 | }, this); 170 | this.records_ = []; 171 | }, 172 | takeRecords: function() { 173 | var copyOfRecords = this.records_; 174 | this.records_ = []; 175 | return copyOfRecords; 176 | } 177 | }; 178 | function MutationRecord(type, target) { 179 | this.type = type; 180 | this.target = target; 181 | this.addedNodes = []; 182 | this.removedNodes = []; 183 | this.previousSibling = null; 184 | this.nextSibling = null; 185 | this.attributeName = null; 186 | this.attributeNamespace = null; 187 | this.oldValue = null; 188 | } 189 | function copyMutationRecord(original) { 190 | var record = new MutationRecord(original.type, original.target); 191 | record.addedNodes = original.addedNodes.slice(); 192 | record.removedNodes = original.removedNodes.slice(); 193 | record.previousSibling = original.previousSibling; 194 | record.nextSibling = original.nextSibling; 195 | record.attributeName = original.attributeName; 196 | record.attributeNamespace = original.attributeNamespace; 197 | record.oldValue = original.oldValue; 198 | return record; 199 | } 200 | var currentRecord, recordWithOldValue; 201 | function getRecord(type, target) { 202 | return currentRecord = new MutationRecord(type, target); 203 | } 204 | function getRecordWithOldValue(oldValue) { 205 | if (recordWithOldValue) return recordWithOldValue; 206 | recordWithOldValue = copyMutationRecord(currentRecord); 207 | recordWithOldValue.oldValue = oldValue; 208 | return recordWithOldValue; 209 | } 210 | function clearRecords() { 211 | currentRecord = recordWithOldValue = undefined; 212 | } 213 | function recordRepresentsCurrentMutation(record) { 214 | return record === recordWithOldValue || record === currentRecord; 215 | } 216 | function selectRecord(lastRecord, newRecord) { 217 | if (lastRecord === newRecord) return lastRecord; 218 | if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue; 219 | return null; 220 | } 221 | function Registration(observer, target, options) { 222 | this.observer = observer; 223 | this.target = target; 224 | this.options = options; 225 | this.transientObservedNodes = []; 226 | } 227 | Registration.prototype = { 228 | enqueue: function(record) { 229 | var records = this.observer.records_; 230 | var length = records.length; 231 | if (records.length > 0) { 232 | var lastRecord = records[length - 1]; 233 | var recordToReplaceLast = selectRecord(lastRecord, record); 234 | if (recordToReplaceLast) { 235 | records[length - 1] = recordToReplaceLast; 236 | return; 237 | } 238 | } else { 239 | scheduleCallback(this.observer); 240 | } 241 | records[length] = record; 242 | }, 243 | addListeners: function() { 244 | this.addListeners_(this.target); 245 | }, 246 | addListeners_: function(node) { 247 | var options = this.options; 248 | if (options.attributes) node.addEventListener("DOMAttrModified", this, true); 249 | if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true); 250 | if (options.childList) node.addEventListener("DOMNodeInserted", this, true); 251 | if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true); 252 | }, 253 | removeListeners: function() { 254 | this.removeListeners_(this.target); 255 | }, 256 | removeListeners_: function(node) { 257 | var options = this.options; 258 | if (options.attributes) node.removeEventListener("DOMAttrModified", this, true); 259 | if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true); 260 | if (options.childList) node.removeEventListener("DOMNodeInserted", this, true); 261 | if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true); 262 | }, 263 | addTransientObserver: function(node) { 264 | if (node === this.target) return; 265 | this.addListeners_(node); 266 | this.transientObservedNodes.push(node); 267 | var registrations = registrationsTable.get(node); 268 | if (!registrations) registrationsTable.set(node, registrations = []); 269 | registrations.push(this); 270 | }, 271 | removeTransientObservers: function() { 272 | var transientObservedNodes = this.transientObservedNodes; 273 | this.transientObservedNodes = []; 274 | transientObservedNodes.forEach(function(node) { 275 | this.removeListeners_(node); 276 | var registrations = registrationsTable.get(node); 277 | for (var i = 0; i < registrations.length; i++) { 278 | if (registrations[i] === this) { 279 | registrations.splice(i, 1); 280 | break; 281 | } 282 | } 283 | }, this); 284 | }, 285 | handleEvent: function(e) { 286 | e.stopImmediatePropagation(); 287 | switch (e.type) { 288 | case "DOMAttrModified": 289 | var name = e.attrName; 290 | var namespace = e.relatedNode.namespaceURI; 291 | var target = e.target; 292 | var record = new getRecord("attributes", target); 293 | record.attributeName = name; 294 | record.attributeNamespace = namespace; 295 | var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue; 296 | forEachAncestorAndObserverEnqueueRecord(target, function(options) { 297 | if (!options.attributes) return; 298 | if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) { 299 | return; 300 | } 301 | if (options.attributeOldValue) return getRecordWithOldValue(oldValue); 302 | return record; 303 | }); 304 | break; 305 | 306 | case "DOMCharacterDataModified": 307 | var target = e.target; 308 | var record = getRecord("characterData", target); 309 | var oldValue = e.prevValue; 310 | forEachAncestorAndObserverEnqueueRecord(target, function(options) { 311 | if (!options.characterData) return; 312 | if (options.characterDataOldValue) return getRecordWithOldValue(oldValue); 313 | return record; 314 | }); 315 | break; 316 | 317 | case "DOMNodeRemoved": 318 | this.addTransientObserver(e.target); 319 | 320 | case "DOMNodeInserted": 321 | var changedNode = e.target; 322 | var addedNodes, removedNodes; 323 | if (e.type === "DOMNodeInserted") { 324 | addedNodes = [ changedNode ]; 325 | removedNodes = []; 326 | } else { 327 | addedNodes = []; 328 | removedNodes = [ changedNode ]; 329 | } 330 | var previousSibling = changedNode.previousSibling; 331 | var nextSibling = changedNode.nextSibling; 332 | var record = getRecord("childList", e.target.parentNode); 333 | record.addedNodes = addedNodes; 334 | record.removedNodes = removedNodes; 335 | record.previousSibling = previousSibling; 336 | record.nextSibling = nextSibling; 337 | forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) { 338 | if (!options.childList) return; 339 | return record; 340 | }); 341 | } 342 | clearRecords(); 343 | } 344 | }; 345 | global.JsMutationObserver = JsMutationObserver; 346 | if (!global.MutationObserver) { 347 | global.MutationObserver = JsMutationObserver; 348 | JsMutationObserver._isPolyfilled = true; 349 | } 350 | })(self); -------------------------------------------------------------------------------- /bower_components/webcomponentsjs/MutationObserver.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | * Code distributed by Google as part of the polymer project is also 8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | // @version 0.7.18 11 | "undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,r=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};r.prototype={set:function(t,r){var i=t[this.name];return i&&i[0]===t?i[1]=r:e(t,this.name,{value:[t,r],writable:!0}),this},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){var t=e[this.name];return t&&t[0]===e?(t[0]=t[1]=void 0,!0):!1},has:function(e){var t=e[this.name];return t?t[0]===e:!1}},window.WeakMap=r}(),function(e){function t(e){N.push(e),O||(O=!0,b(i))}function r(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function i(){O=!1;var e=N;N=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var r=e.takeRecords();n(e),r.length&&(e.callback_(r,e),t=!0)}),t&&i()}function n(e){e.nodes_.forEach(function(t){var r=p.get(t);r&&r.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function a(e,t){for(var r=e;r;r=r.parentNode){var i=p.get(r);if(i)for(var n=0;n0){var n=r[i-1],a=l(n,e);if(a)return void(r[i-1]=a)}else t(this.observer);r[i]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=p.get(e);t||p.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=p.get(e),r=0;r` tags in the main document block the loading of such imports. This is to ensure the imports have loaded and any registered elements in them have been upgraded. 79 | 80 | The webcomponents.js and webcomponents-lite.js polyfills parse element definitions and handle their upgrade asynchronously. If prematurely fetching the element from the DOM before it has an opportunity to upgrade, you'll be working with an `HTMLUnknownElement`. 81 | 82 | For these situations (or when you need an approximate replacement for the Polymer 0.5 `polymer-ready` behavior), you can use the `WebComponentsReady` event as a signal before interacting with the element. The criteria for this event to fire is all Custom Elements with definitions registered by the time HTML Imports available at load time have loaded have upgraded. 83 | 84 | ```js 85 | window.addEventListener('WebComponentsReady', function(e) { 86 | // imports are loaded and elements have been registered 87 | console.log('Components are ready'); 88 | }); 89 | ``` 90 | 91 | ## Known Issues 92 | 93 | * [Custom element's constructor property is unreliable](#constructor) 94 | * [Contenteditable elements do not trigger MutationObserver](#contentedit) 95 | * [ShadowCSS: :host-context(...):host(...) doesn't work](#hostcontext) 96 | * [execCommand isn't supported under Shadow DOM](#execcommand) 97 | 98 | ### Custom element's constructor property is unreliable 99 | See [#215](https://github.com/webcomponents/webcomponentsjs/issues/215) for background. 100 | 101 | In Safari and IE, instances of Custom Elements have a `constructor` property of `HTMLUnknownElementConstructor` and `HTMLUnknownElement`, respectively. It's unsafe to rely on this property for checking element types. 102 | 103 | It's worth noting that `customElement.__proto__.__proto__.constructor` is `HTMLElementPrototype` and that the prototype chain isn't modified by the polyfills(onto `ElementPrototype`, etc.) 104 | 105 | ### Contenteditable elements do not trigger MutationObserver 106 | Using the MutationObserver polyfill, it isn't possible to monitor mutations of an element marked `contenteditable`. 107 | See [the mailing list](https://groups.google.com/forum/#!msg/polymer-dev/LHdtRVXXVsA/v1sGoiTYWUkJ) 108 | 109 | ### ShadowCSS: :host-context(...):host(...) doesn't work 110 | See [#16](https://github.com/webcomponents/webcomponentsjs/issues/16) for background. 111 | 112 | Under the shadow DOM polyfill, rules like: 113 | ``` 114 | :host-context(.foo):host(.bar) {...} 115 | ``` 116 | don't work, despite working under native Shadow DOM. The solution is to use `polyfill-next-selector` like: 117 | 118 | ``` 119 | polyfill-next-selector { content: '.foo :host.bar, :host.foo.bar'; } 120 | ``` 121 | 122 | ### execCommand and contenteditable isn't supported under Shadow DOM 123 | See [#212](https://github.com/webcomponents/webcomponentsjs/issues/212) 124 | 125 | `execCommand`, and `contenteditable` aren't supported under the ShadowDOM polyfill, with commands that insert or remove nodes being especially prone to failure. 126 | -------------------------------------------------------------------------------- /bower_components/webcomponentsjs/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webcomponentsjs", 3 | "main": "webcomponents.js", 4 | "version": "0.7.18", 5 | "homepage": "http://webcomponents.org", 6 | "authors": [ 7 | "The Polymer Authors" 8 | ], 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/webcomponents/webcomponentsjs.git" 12 | }, 13 | "keywords": [ 14 | "webcomponents" 15 | ], 16 | "license": "BSD", 17 | "ignore": [], 18 | "devDependencies": { 19 | "web-component-tester": "~3.3.10" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /bower_components/webcomponentsjs/build.log: -------------------------------------------------------------------------------- 1 | BUILD LOG 2 | --------- 3 | Build Time: 2015-11-16T15:17:15-0800 4 | 5 | NODEJS INFORMATION 6 | ================== 7 | nodejs: v5.0.0 8 | accepts: 1.2.13 9 | adm-zip: 0.4.7 10 | after: 0.8.1 11 | align-text: 0.1.3 12 | ansi-regex: 2.0.0 13 | ansi-styles: 2.1.0 14 | archiver: 0.14.4 15 | archy: 1.0.0 16 | array-differ: 1.0.0 17 | array-flatten: 1.1.1 18 | array-uniq: 1.0.2 19 | arraybuffer.slice: 0.0.6 20 | asap: 2.0.3 21 | asn1: 0.1.11 22 | assert-plus: 0.1.5 23 | async: 0.9.2 24 | aws-sign2: 0.5.0 25 | backo2: 1.0.2 26 | backoff: 2.4.1 27 | balanced-match: 0.2.1 28 | base64-arraybuffer: 0.1.2 29 | base64-js: 0.0.8 30 | base64id: 0.1.0 31 | beeper: 1.1.0 32 | benchmark: 1.0.0 33 | better-assert: 1.0.2 34 | binary: 0.3.0 35 | bindings: 1.2.1 36 | bl: 0.9.4 37 | blob: 0.0.4 38 | bluebird: 2.10.2 39 | boom: 0.4.2 40 | bower: 1.6.5 41 | brace-expansion: 1.1.1 42 | browserstack: 1.2.0 43 | buffer-crc32: 0.2.5 44 | buffers: 0.1.1 45 | bufferutil: 1.2.1 46 | builtin-modules: 1.1.0 47 | bunyan: 1.5.1 48 | callsite: 1.0.0 49 | camelcase: 2.0.0 50 | camelcase-keys: 2.0.0 51 | caseless: 0.8.0 52 | center-align: 0.1.2 53 | chainsaw: 0.1.0 54 | cliui: 2.1.0 55 | cleankill: 1.0.2 56 | clone: 1.0.2 57 | clone-stats: 0.0.1 58 | combined-stream: 0.0.7 59 | commander: 2.6.0 60 | chalk: 1.1.1 61 | component-bind: 1.0.0 62 | component-emitter: 1.1.2 63 | component-inherit: 0.0.3 64 | compress-commons: 0.2.9 65 | concat-map: 0.0.1 66 | concat-with-sourcemaps: 1.0.4 67 | configstore: 1.3.0 68 | content-disposition: 0.5.0 69 | content-type: 1.0.1 70 | cookie: 0.1.3 71 | cookie-signature: 1.0.6 72 | core-util-is: 1.0.1 73 | crc: 3.2.1 74 | crc32-stream: 0.3.4 75 | cryptiles: 0.2.2 76 | csv: 0.4.6 77 | csv-generate: 0.0.6 78 | csv-parse: 1.0.0 79 | csv-stringify: 0.0.8 80 | ctype: 0.5.3 81 | dateformat: 1.0.11 82 | deap: 1.0.0 83 | debug: 2.2.0 84 | debuglog: 1.0.1 85 | decamelize: 1.1.1 86 | deep-extend: 0.4.0 87 | defaults: 1.0.3 88 | delayed-stream: 0.0.5 89 | depd: 1.0.1 90 | deprecated: 0.0.1 91 | destroy: 1.0.3 92 | dezalgo: 1.0.3 93 | dtrace-provider: 0.6.0 94 | duplexer2: 0.0.2 95 | duplexify: 3.4.2 96 | ee-first: 1.1.1 97 | end-of-stream: 0.1.5 98 | engine.io: 1.5.4 99 | engine.io-client: 1.5.4 100 | engine.io-parser: 1.2.2 101 | error-ex: 1.3.0 102 | escape-html: 1.0.2 103 | escape-regexp-component: 1.0.2 104 | escape-string-regexp: 1.0.3 105 | etag: 1.7.0 106 | express: 4.13.3 107 | extend: 2.0.1 108 | extsprintf: 1.2.0 109 | fancy-log: 1.1.0 110 | finalhandler: 0.4.0 111 | find-index: 0.1.1 112 | find-up: 1.1.0 113 | findup-sync: 0.3.0 114 | first-chunk-stream: 1.0.0 115 | flagged-respawn: 0.3.1 116 | forever-agent: 0.5.2 117 | form-data: 0.2.0 118 | formidable: 1.0.17 119 | forwarded: 0.1.0 120 | freeport: 1.0.5 121 | fresh: 0.3.0 122 | fstream: 0.1.31 123 | gaze: 0.5.2 124 | generate-function: 2.0.0 125 | generate-object-property: 1.2.0 126 | get-stdin: 5.0.1 127 | github-url-from-git: 1.4.0 128 | github-url-from-username-repo: 1.0.2 129 | glob: 5.0.15 130 | glob-stream: 3.1.18 131 | glob-watcher: 0.0.6 132 | glob2base: 0.0.12 133 | global: 2.0.1 134 | globule: 0.1.0 135 | glogg: 1.0.0 136 | got: 3.3.1 137 | graceful-fs: 4.1.2 138 | graceful-readlink: 1.0.1 139 | gulp-audit: 1.0.0 140 | gulp-concat: 2.6.0 141 | gulp: 3.9.0 142 | gulp-header: 1.7.1 143 | gulp-uglify: 1.5.1 144 | gulp-util: 3.0.7 145 | gulplog: 1.0.0 146 | har-validator: 2.0.2 147 | has-ansi: 2.0.0 148 | has-binary: 0.1.6 149 | has-binary-data: 0.1.3 150 | has-color: 0.1.7 151 | has-cors: 1.0.3 152 | has-gulplog: 0.1.0 153 | hawk: 1.1.1 154 | hoek: 0.9.1 155 | hosted-git-info: 2.1.4 156 | http-errors: 1.3.1 157 | http-signature: 0.11.0 158 | indent-string: 2.1.0 159 | infinity-agent: 2.0.3 160 | inherits: 2.0.1 161 | inflight: 1.0.4 162 | indexof: 0.0.1 163 | ini: 1.3.4 164 | interpret: 0.6.6 165 | ipaddr.js: 1.0.1 166 | is-absolute: 0.1.7 167 | is-arrayish: 0.2.1 168 | is-buffer: 1.1.0 169 | is-builtin-module: 1.0.0 170 | is-finite: 1.0.1 171 | is-my-json-valid: 2.12.3 172 | is-npm: 1.0.0 173 | is-property: 1.0.2 174 | is-redirect: 1.0.0 175 | is-relative: 0.1.3 176 | is-stream: 1.0.1 177 | is-utf8: 0.2.0 178 | isarray: 0.0.1 179 | isobject: 2.0.0 180 | isstream: 0.1.2 181 | jju: 1.2.1 182 | json-parse-helpfulerror: 1.0.3 183 | json-stringify-safe: 5.0.1 184 | json3: 3.2.6 185 | jsonpointer: 2.0.0 186 | keep-alive-agent: 0.0.1 187 | kind-of: 2.0.1 188 | latest-version: 1.0.1 189 | launchpad: 0.4.9 190 | lazy-cache: 0.2.4 191 | lazystream: 0.1.0 192 | liftoff: 2.2.0 193 | load-json-file: 1.1.0 194 | lodash: 1.0.2 195 | lodash._basecopy: 3.0.1 196 | lodash._basetostring: 3.0.1 197 | lodash._basevalues: 3.0.0 198 | lodash._getnative: 3.9.1 199 | lodash._isiterateecall: 3.0.9 200 | lodash._reescape: 3.0.0 201 | lodash._reevaluate: 3.0.0 202 | lodash._reinterpolate: 3.0.0 203 | lodash.escape: 3.0.0 204 | lodash.isarguments: 3.0.4 205 | lodash.isarray: 3.0.4 206 | lodash.keys: 3.1.2 207 | lodash.restparam: 3.6.1 208 | lodash.template: 3.6.2 209 | lodash.templatesettings: 3.1.0 210 | longest: 1.0.1 211 | loud-rejection: 1.2.0 212 | lowercase-keys: 1.0.0 213 | lru-cache: 2.7.0 214 | map-obj: 1.0.1 215 | match-stream: 0.0.2 216 | media-typer: 0.3.0 217 | meow: 3.6.0 218 | merge-descriptors: 1.0.0 219 | methods: 1.1.1 220 | mime: 1.3.4 221 | mime-db: 1.19.0 222 | mime-types: 2.1.7 223 | minimatch: 3.0.0 224 | minimist: 1.2.0 225 | mkdirp: 0.5.1 226 | ms: 0.7.1 227 | multipipe: 0.1.2 228 | mv: 2.1.1 229 | nan: 2.1.0 230 | ncp: 2.0.0 231 | negotiator: 0.5.3 232 | nested-error-stacks: 1.0.1 233 | node-int64: 0.3.3 234 | node-uuid: 1.4.7 235 | nomnom: 1.8.1 236 | normalize-package-data: 2.3.5 237 | number-is-nan: 1.0.0 238 | oauth-sign: 0.5.0 239 | object-assign: 3.0.0 240 | object-component: 0.0.3 241 | object-keys: 1.0.1 242 | on-finished: 2.3.0 243 | once: 1.3.2 244 | options: 0.0.6 245 | orchestrator: 0.3.7 246 | ordered-read-streams: 0.1.0 247 | os-homedir: 1.0.1 248 | os-tmpdir: 1.0.1 249 | osenv: 0.1.3 250 | over: 0.0.5 251 | package-json: 1.2.0 252 | parse-json: 2.2.0 253 | parseqs: 0.0.2 254 | parseuri: 0.0.2 255 | parsejson: 0.0.1 256 | parseurl: 1.3.0 257 | path-exists: 2.1.0 258 | path-is-absolute: 1.0.0 259 | path-to-regexp: 0.1.7 260 | path-type: 1.1.0 261 | pify: 2.3.0 262 | pinkie: 2.0.0 263 | pinkie-promise: 2.0.0 264 | plist: 1.2.0 265 | precond: 0.2.3 266 | prepend-http: 1.0.3 267 | pretty-hrtime: 1.0.1 268 | process-nextick-args: 1.0.3 269 | progress: 1.1.8 270 | proxy-addr: 1.0.8 271 | pullstream: 0.4.1 272 | q: 1.4.1 273 | qs: 4.0.0 274 | range-parser: 1.0.3 275 | rc: 1.1.5 276 | read-all-stream: 3.0.1 277 | read-installed: 3.1.5 278 | read-package-json: 1.3.3 279 | read-pkg: 1.1.0 280 | read-pkg-up: 1.0.1 281 | readable-stream: 1.1.13 282 | readdir-scoped-modules: 1.0.2 283 | rechoir: 0.6.2 284 | redent: 1.0.0 285 | registry-url: 3.0.3 286 | repeat-string: 1.5.2 287 | repeating: 2.0.0 288 | replace-ext: 0.0.1 289 | request: 2.51.0 290 | resolve: 1.1.6 291 | restify: 4.0.3 292 | right-align: 0.1.3 293 | rimraf: 2.4.3 294 | run-sequence: 1.1.4 295 | safe-json-stringify: 1.0.3 296 | sauce-connect-launcher: 0.12.0 297 | selenium-standalone: 4.7.1 298 | semver: 4.3.6 299 | semver-diff: 2.1.0 300 | send: 0.11.1 301 | sequencify: 0.0.7 302 | serve-static: 1.10.0 303 | serve-waterfall: 1.1.1 304 | server-destroy: 1.0.1 305 | setimmediate: 1.0.4 306 | sigmund: 1.0.1 307 | signal-exit: 2.1.2 308 | slice-stream: 1.0.0 309 | slide: 1.1.6 310 | sntp: 0.2.4 311 | socket.io: 1.3.7 312 | socket.io-adapter: 0.3.1 313 | socket.io-client: 1.3.7 314 | socket.io-parser: 2.2.4 315 | source-map: 0.5.3 316 | sparkles: 1.0.0 317 | spdx-correct: 1.0.2 318 | spdx-expression-parse: 1.0.1 319 | spdx-license-ids: 1.1.0 320 | spdx-exceptions: 1.0.4 321 | spdy: 1.32.5 322 | stacky: 1.2.3 323 | statuses: 1.2.1 324 | stream-consume: 0.1.0 325 | stream-transform: 0.1.1 326 | string-length: 1.0.1 327 | string_decoder: 0.10.31 328 | stringstream: 0.0.5 329 | strip-ansi: 3.0.0 330 | strip-bom: 2.0.0 331 | strip-indent: 1.0.1 332 | strip-json-comments: 1.0.4 333 | supports-color: 2.0.0 334 | tar-stream: 1.1.5 335 | temp: 0.8.3 336 | through2: 2.0.0 337 | tildify: 1.1.2 338 | timed-out: 2.0.0 339 | to-array: 0.1.3 340 | tough-cookie: 2.2.1 341 | traverse: 0.3.9 342 | trim-newlines: 1.0.0 343 | tunnel-agent: 0.4.1 344 | type-is: 1.6.9 345 | uglify-js: 2.6.0 346 | uglify-save-license: 0.4.1 347 | uglify-to-browserify: 1.0.2 348 | ultron: 1.0.2 349 | underscore: 1.6.0 350 | underscore.string: 3.0.3 351 | unique-stream: 1.0.0 352 | unpipe: 1.0.0 353 | unzip: 0.1.11 354 | update-notifier: 0.5.0 355 | urijs: 1.16.1 356 | user-home: 1.1.1 357 | utf-8-validate: 1.2.1 358 | utf8: 2.1.0 359 | util-deprecate: 1.0.2 360 | util-extend: 1.0.1 361 | utils-merge: 1.0.0 362 | uuid: 2.0.1 363 | v8flags: 2.0.10 364 | validate-npm-package-license: 3.0.1 365 | vargs: 0.1.0 366 | vary: 1.0.1 367 | vasync: 1.6.3 368 | verror: 1.6.0 369 | vinyl: 0.5.3 370 | vinyl-fs: 0.3.14 371 | vinyl-sourcemaps-apply: 0.2.0 372 | wct-local: 1.7.0 373 | wct-sauce: 1.7.1 374 | wd: 0.3.12 375 | which: 1.2.0 376 | window-size: 0.1.0 377 | wordwrap: 0.0.2 378 | wrappy: 1.0.1 379 | write-file-atomic: 1.1.3 380 | ws: 0.8.0 381 | xdg-basedir: 2.0.0 382 | xmlbuilder: 4.0.0 383 | xmldom: 0.1.19 384 | xmlhttprequest: 1.5.0 385 | xtend: 4.0.1 386 | web-component-tester: 3.4.0 387 | yargs: 3.10.0 388 | zip-stream: 0.5.2 389 | 390 | REPO REVISIONS 391 | ============== 392 | webcomponentsjs: fedfe0210aa853a9531bd976f6d161d585cc22fb 393 | 394 | BUILD HASHES 395 | ============ 396 | CustomElements.js: b23d0448b615b6df2a5cefc8c90f835e3d3be965 397 | CustomElements.min.js: cc749903e377b79bae921f8286416bd2586ada76 398 | HTMLImports.js: 6e250868d6cc88e452bc26cb178a12d7aa4826e1 399 | HTMLImports.min.js: 3e6d874686f137a40bbf1ed691117f51f07ad8ae 400 | MutationObserver.js: 35911430e16d00bce530358c38d0e5daebba1b40 401 | MutationObserver.min.js: 267e43dce099284f0d321c09b7420e213ed57b37 402 | ShadowDOM.js: 3100eb0a7bacc9d136797d091ccfcdfc91825230 403 | ShadowDOM.min.js: 67b57a37d7e9a2cb138950c4f547955f465177bf 404 | webcomponents-lite.js: 61374e535ea2e772b7061a4a64ee651ae9a7c5ed 405 | webcomponents-lite.min.js: 01242ae0712471abc28838e1afab47984f264553 406 | webcomponents.js: 6b5322a80af55ddc1a461e993afa83033f27889e 407 | webcomponents.min.js: 1242a14b965dbd7195104333cc3c21e35ad86601 -------------------------------------------------------------------------------- /bower_components/webcomponentsjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webcomponents.js", 3 | "version": "0.7.18", 4 | "description": "webcomponents.js", 5 | "main": "webcomponents.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/webcomponents/webcomponentsjs.git" 12 | }, 13 | "author": "The Polymer Authors", 14 | "license": "BSD-3-Clause", 15 | "bugs": { 16 | "url": "https://github.com/webcomponents/webcomponentsjs/issues" 17 | }, 18 | "homepage": "http://webcomponents.org", 19 | "devDependencies": { 20 | "gulp": "^3.8.8", 21 | "gulp-audit": "^1.0.0", 22 | "gulp-concat": "^2.4.1", 23 | "gulp-header": "^1.1.1", 24 | "gulp-uglify": "^1.0.1", 25 | "run-sequence": "^1.0.1", 26 | "web-component-tester": "^3" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /bower_components/webcomponentsjs/webcomponents-lite.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | * Code distributed by Google as part of the polymer project is also 8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | // @version 0.7.18 11 | !function(){window.WebComponents=window.WebComponents||{flags:{}};var e="webcomponents-lite.js",t=document.querySelector('script[src*="'+e+'"]'),n={};if(!n.noOpts){if(location.search.slice(1).split("&").forEach(function(e){var t,r=e.split("=");r[0]&&(t=r[0].match(/wc-(.+)/))&&(n[t[1]]=r[1]||!0)}),t)for(var r,o=0;r=t.attributes[o];o++)"src"!==r.name&&(n[r.name]=r.value||!0);if(n.log&&n.log.split){var i=n.log.split(",");n.log={},i.forEach(function(e){n.log[e]=!0})}else n.log={}}n.register&&(window.CustomElements=window.CustomElements||{flags:{}},window.CustomElements.flags.register=n.register),WebComponents.flags=n}(),function(e){"use strict";function t(e){return void 0!==h[e]}function n(){s.call(this),this._isInvalid=!0}function r(e){return""==e&&n.call(this),e.toLowerCase()}function o(e){var t=e.charCodeAt(0);return t>32&&127>t&&-1==[34,35,60,62,63,96].indexOf(t)?e:encodeURIComponent(e)}function i(e){var t=e.charCodeAt(0);return t>32&&127>t&&-1==[34,35,60,62,96].indexOf(t)?e:encodeURIComponent(e)}function a(e,a,s){function c(e){g.push(e)}var d=a||"scheme start",u=0,l="",w=!1,_=!1,g=[];e:for(;(e[u-1]!=p||0==u)&&!this._isInvalid;){var b=e[u];switch(d){case"scheme start":if(!b||!m.test(b)){if(a){c("Invalid scheme.");break e}l="",d="no scheme";continue}l+=b.toLowerCase(),d="scheme";break;case"scheme":if(b&&v.test(b))l+=b.toLowerCase();else{if(":"!=b){if(a){if(p==b)break e;c("Code point not allowed in scheme: "+b);break e}l="",u=0,d="no scheme";continue}if(this._scheme=l,l="",a)break e;t(this._scheme)&&(this._isRelative=!0),d="file"==this._scheme?"relative":this._isRelative&&s&&s._scheme==this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":"?"==b?(this._query="?",d="query"):"#"==b?(this._fragment="#",d="fragment"):p!=b&&" "!=b&&"\n"!=b&&"\r"!=b&&(this._schemeData+=o(b));break;case"no scheme":if(s&&t(s._scheme)){d="relative";continue}c("Missing scheme."),n.call(this);break;case"relative or authority":if("/"!=b||"/"!=e[u+1]){c("Expected /, got: "+b),d="relative";continue}d="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!=this._scheme&&(this._scheme=s._scheme),p==b){this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query=s._query,this._username=s._username,this._password=s._password;break e}if("/"==b||"\\"==b)"\\"==b&&c("\\ is an invalid code point."),d="relative slash";else if("?"==b)this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query="?",this._username=s._username,this._password=s._password,d="query";else{if("#"!=b){var y=e[u+1],E=e[u+2];("file"!=this._scheme||!m.test(b)||":"!=y&&"|"!=y||p!=E&&"/"!=E&&"\\"!=E&&"?"!=E&&"#"!=E)&&(this._host=s._host,this._port=s._port,this._username=s._username,this._password=s._password,this._path=s._path.slice(),this._path.pop()),d="relative path";continue}this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query=s._query,this._fragment="#",this._username=s._username,this._password=s._password,d="fragment"}break;case"relative slash":if("/"!=b&&"\\"!=b){"file"!=this._scheme&&(this._host=s._host,this._port=s._port,this._username=s._username,this._password=s._password),d="relative path";continue}"\\"==b&&c("\\ is an invalid code point."),d="file"==this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!=b){c("Expected '/', got: "+b),d="authority ignore slashes";continue}d="authority second slash";break;case"authority second slash":if(d="authority ignore slashes","/"!=b){c("Expected '/', got: "+b);continue}break;case"authority ignore slashes":if("/"!=b&&"\\"!=b){d="authority";continue}c("Expected authority, got: "+b);break;case"authority":if("@"==b){w&&(c("@ already seen."),l+="%40"),w=!0;for(var L=0;L>>0)+(t++ +"__")};n.prototype={set:function(t,n){var r=t[this.name];return r&&r[0]===t?r[1]=n:e(t,this.name,{value:[t,n],writable:!0}),this},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){var t=e[this.name];return t&&t[0]===e?(t[0]=t[1]=void 0,!0):!1},has:function(e){var t=e[this.name];return t?t[0]===e:!1}},window.WeakMap=n}(),function(e){function t(e){b.push(e),g||(g=!0,m(r))}function n(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function r(){g=!1;var e=b;b=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var n=e.takeRecords();o(e),n.length&&(e.callback_(n,e),t=!0)}),t&&r()}function o(e){e.nodes_.forEach(function(t){var n=v.get(t);n&&n.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function i(e,t){for(var n=e;n;n=n.parentNode){var r=v.get(n);if(r)for(var o=0;o0){var o=n[r-1],i=f(o,e);if(i)return void(n[r-1]=i)}else t(this.observer);n[r]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=v.get(e);t||v.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=v.get(e),n=0;n":return">";case" ":return" "}}function t(t){return t.replace(a,e)}var n="template",r=document.implementation.createHTMLDocument("template"),o=!0;HTMLTemplateElement=function(){},HTMLTemplateElement.prototype=Object.create(HTMLElement.prototype),HTMLTemplateElement.decorate=function(e){if(!e.content){e.content=r.createDocumentFragment();for(var n;n=e.firstChild;)e.content.appendChild(n);if(o)try{Object.defineProperty(e,"innerHTML",{get:function(){for(var e="",n=this.content.firstChild;n;n=n.nextSibling)e+=n.outerHTML||t(n.data);return e},set:function(e){for(r.body.innerHTML=e,HTMLTemplateElement.bootstrap(r);this.content.firstChild;)this.content.removeChild(this.content.firstChild);for(;r.body.firstChild;)this.content.appendChild(r.body.firstChild)},configurable:!0})}catch(i){o=!1}HTMLTemplateElement.bootstrap(e.content)}},HTMLTemplateElement.bootstrap=function(e){for(var t,r=e.querySelectorAll(n),o=0,i=r.length;i>o&&(t=r[o]);o++)HTMLTemplateElement.decorate(t)},document.addEventListener("DOMContentLoaded",function(){HTMLTemplateElement.bootstrap(document)});var i=document.createElement;document.createElement=function(){"use strict";var e=i.apply(document,arguments);return"template"==e.localName&&HTMLTemplateElement.decorate(e),e};var a=/[&\u00A0<>]/g}(),function(e){"use strict";if(!window.performance){var t=Date.now();window.performance={now:function(){return Date.now()-t}}}window.requestAnimationFrame||(window.requestAnimationFrame=function(){var e=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;return e?function(t){return e(function(){t(performance.now())})}:function(e){return window.setTimeout(e,1e3/60)}}()),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(){return window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}}());var n=function(){var e=document.createEvent("Event");return e.initEvent("foo",!0,!0),e.preventDefault(),e.defaultPrevented}();if(!n){var r=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){this.cancelable&&(r.call(this),Object.defineProperty(this,"defaultPrevented",{get:function(){return!0},configurable:!0}))}}var o=/Trident/.test(navigator.userAgent);if((!window.CustomEvent||o&&"function"!=typeof window.CustomEvent)&&(window.CustomEvent=function(e,t){t=t||{};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,Boolean(t.bubbles),Boolean(t.cancelable),t.detail),n},window.CustomEvent.prototype=window.Event.prototype),!window.Event||o&&"function"!=typeof window.Event){var i=window.Event;window.Event=function(e,t){t=t||{};var n=document.createEvent("Event");return n.initEvent(e,Boolean(t.bubbles),Boolean(t.cancelable)),n},window.Event.prototype=i.prototype}}(window.WebComponents),window.HTMLImports=window.HTMLImports||{flags:{}},function(e){function t(e,t){t=t||p,r(function(){i(e,t)},t)}function n(e){return"complete"===e.readyState||e.readyState===w}function r(e,t){if(n(t))e&&e();else{var o=function(){("complete"===t.readyState||t.readyState===w)&&(t.removeEventListener(_,o),r(e,t))};t.addEventListener(_,o)}}function o(e){e.target.__loaded=!0}function i(e,t){function n(){c==d&&e&&e({allImports:s,loadedImports:u,errorImports:l})}function r(e){o(e),u.push(this),c++,n()}function i(e){l.push(this),c++,n()}var s=t.querySelectorAll("link[rel=import]"),c=0,d=s.length,u=[],l=[];if(d)for(var h,f=0;d>f&&(h=s[f]);f++)a(h)?(c++,n()):(h.addEventListener("load",r),h.addEventListener("error",i));else n()}function a(e){return l?e.__loaded||e["import"]&&"loading"!==e["import"].readyState:e.__importParsed}function s(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)c(t)&&d(t)}function c(e){return"link"===e.localName&&"import"===e.rel}function d(e){var t=e["import"];t?o({target:e}):(e.addEventListener("load",o),e.addEventListener("error",o))}var u="import",l=Boolean(u in document.createElement("link")),h=Boolean(window.ShadowDOMPolyfill),f=function(e){return h?window.ShadowDOMPolyfill.wrapIfNeeded(e):e},p=f(document),m={get:function(){var e=window.HTMLImports.currentScript||document.currentScript||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null);return f(e)},configurable:!0};Object.defineProperty(document,"_currentScript",m),Object.defineProperty(p,"_currentScript",m);var v=/Trident/.test(navigator.userAgent),w=v?"complete":"interactive",_="readystatechange";l&&(new MutationObserver(function(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)t.addedNodes&&s(t.addedNodes)}).observe(document.head,{childList:!0}),function(){if("loading"===document.readyState)for(var e,t=document.querySelectorAll("link[rel=import]"),n=0,r=t.length;r>n&&(e=t[n]);n++)d(e)}()),t(function(e){window.HTMLImports.ready=!0,window.HTMLImports.readyTime=(new Date).getTime();var t=p.createEvent("CustomEvent");t.initCustomEvent("HTMLImportsLoaded",!0,!0,e),p.dispatchEvent(t)}),e.IMPORT_LINK_TYPE=u,e.useNative=l,e.rootDocument=p,e.whenReady=t,e.isIE=v}(window.HTMLImports),function(e){var t=[],n=function(e){t.push(e)},r=function(){t.forEach(function(t){t(e)})};e.addModule=n,e.initializeModules=r}(window.HTMLImports),window.HTMLImports.addModule(function(e){var t=/(url\()([^)]*)(\))/g,n=/(@import[\s]+(?!url\())([^;]*)(;)/g,r={resolveUrlsInStyle:function(e,t){var n=e.ownerDocument,r=n.createElement("a");return e.textContent=this.resolveUrlsInCssText(e.textContent,t,r),e},resolveUrlsInCssText:function(e,r,o){var i=this.replaceUrls(e,o,r,t);return i=this.replaceUrls(i,o,r,n)},replaceUrls:function(e,t,n,r){return e.replace(r,function(e,r,o,i){var a=o.replace(/["']/g,"");return n&&(a=new URL(a,n).href),t.href=a,a=t.href,r+"'"+a+"'"+i})}};e.path=r}),window.HTMLImports.addModule(function(e){var t={async:!0,ok:function(e){return e.status>=200&&e.status<300||304===e.status||0===e.status},load:function(n,r,o){var i=new XMLHttpRequest;return(e.flags.debug||e.flags.bust)&&(n+="?"+Math.random()),i.open("GET",n,t.async),i.addEventListener("readystatechange",function(e){if(4===i.readyState){var n=null;try{var a=i.getResponseHeader("Location");a&&(n="/"===a.substr(0,1)?location.origin+a:a)}catch(e){console.error(e.message)}r.call(o,!t.ok(i)&&i,i.response||i.responseText,n)}}),i.send(),i},loadDocument:function(e,t,n){this.load(e,t,n).responseType="document"}};e.xhr=t}),window.HTMLImports.addModule(function(e){var t=e.xhr,n=e.flags,r=function(e,t){this.cache={},this.onload=e,this.oncomplete=t,this.inflight=0,this.pending={}};r.prototype={addNodes:function(e){this.inflight+=e.length;for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)this.require(t);this.checkDone()},addNode:function(e){this.inflight++,this.require(e),this.checkDone()},require:function(e){var t=e.src||e.href;e.__nodeUrl=t,this.dedupe(t,e)||this.fetch(t,e)},dedupe:function(e,t){if(this.pending[e])return this.pending[e].push(t),!0;return this.cache[e]?(this.onload(e,t,this.cache[e]),this.tail(),!0):(this.pending[e]=[t],!1)},fetch:function(e,r){if(n.load&&console.log("fetch",e,r),e)if(e.match(/^data:/)){var o=e.split(","),i=o[0],a=o[1];a=i.indexOf(";base64")>-1?atob(a):decodeURIComponent(a),setTimeout(function(){this.receive(e,r,null,a)}.bind(this),0)}else{var s=function(t,n,o){this.receive(e,r,t,n,o)}.bind(this);t.load(e,s)}else setTimeout(function(){this.receive(e,r,{error:"href must be specified"},null)}.bind(this),0)},receive:function(e,t,n,r,o){this.cache[e]=r;for(var i,a=this.pending[e],s=0,c=a.length;c>s&&(i=a[s]);s++)this.onload(e,i,r,n,o),this.tail();this.pending[e]=null},tail:function(){--this.inflight,this.checkDone()},checkDone:function(){this.inflight||this.oncomplete()}},e.Loader=r}),window.HTMLImports.addModule(function(e){var t=function(e){this.addCallback=e,this.mo=new MutationObserver(this.handler.bind(this))};t.prototype={handler:function(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)"childList"===t.type&&t.addedNodes.length&&this.addedNodes(t.addedNodes)},addedNodes:function(e){this.addCallback&&this.addCallback(e);for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)t.children&&t.children.length&&this.addedNodes(t.children)},observe:function(e){this.mo.observe(e,{childList:!0,subtree:!0})}},e.Observer=t}),window.HTMLImports.addModule(function(e){function t(e){return"link"===e.localName&&e.rel===u}function n(e){var t=r(e);return"data:text/javascript;charset=utf-8,"+encodeURIComponent(t)}function r(e){return e.textContent+o(e)}function o(e){var t=e.ownerDocument;t.__importedScripts=t.__importedScripts||0;var n=e.ownerDocument.baseURI,r=t.__importedScripts?"-"+t.__importedScripts:"";return t.__importedScripts++,"\n//# sourceURL="+n+r+".js\n"}function i(e){var t=e.ownerDocument.createElement("style");return t.textContent=e.textContent,a.resolveUrlsInStyle(t),t}var a=e.path,s=e.rootDocument,c=e.flags,d=e.isIE,u=e.IMPORT_LINK_TYPE,l="link[rel="+u+"]",h={documentSelectors:l,importsSelectors:[l,"link[rel=stylesheet]:not([type])","style:not([type])","script:not([type])",'script[type="application/javascript"]','script[type="text/javascript"]'].join(","),map:{link:"parseLink",script:"parseScript",style:"parseStyle"},dynamicElements:[],parseNext:function(){var e=this.nextToParse();e&&this.parse(e)},parse:function(e){if(this.isParsed(e))return void(c.parse&&console.log("[%s] is already parsed",e.localName));var t=this[this.map[e.localName]];t&&(this.markParsing(e),t.call(this,e))},parseDynamic:function(e,t){this.dynamicElements.push(e),t||this.parseNext()},markParsing:function(e){c.parse&&console.log("parsing",e),this.parsingElement=e},markParsingComplete:function(e){e.__importParsed=!0,this.markDynamicParsingComplete(e),e.__importElement&&(e.__importElement.__importParsed=!0,this.markDynamicParsingComplete(e.__importElement)),this.parsingElement=null,c.parse&&console.log("completed",e)},markDynamicParsingComplete:function(e){var t=this.dynamicElements.indexOf(e);t>=0&&this.dynamicElements.splice(t,1)},parseImport:function(e){if(e["import"]=e.__doc,window.HTMLImports.__importsParsingHook&&window.HTMLImports.__importsParsingHook(e),e["import"]&&(e["import"].__importParsed=!0),this.markParsingComplete(e),e.__resource&&!e.__error?e.dispatchEvent(new CustomEvent("load",{bubbles:!1})):e.dispatchEvent(new CustomEvent("error",{bubbles:!1})),e.__pending)for(var t;e.__pending.length;)t=e.__pending.shift(),t&&t({target:e});this.parseNext()},parseLink:function(e){t(e)?this.parseImport(e):(e.href=e.href,this.parseGeneric(e))},parseStyle:function(e){var t=e;e=i(e),t.__appliedElement=e,e.__importElement=t,this.parseGeneric(e)},parseGeneric:function(e){this.trackElement(e),this.addElementToDocument(e)},rootImportForElement:function(e){for(var t=e;t.ownerDocument.__importLink;)t=t.ownerDocument.__importLink;return t},addElementToDocument:function(e){var t=this.rootImportForElement(e.__importElement||e);t.parentNode.insertBefore(e,t)},trackElement:function(e,t){var n=this,r=function(o){e.removeEventListener("load",r),e.removeEventListener("error",r),t&&t(o),n.markParsingComplete(e),n.parseNext()};if(e.addEventListener("load",r),e.addEventListener("error",r),d&&"style"===e.localName){var o=!1;if(-1==e.textContent.indexOf("@import"))o=!0;else if(e.sheet){o=!0;for(var i,a=e.sheet.cssRules,s=a?a.length:0,c=0;s>c&&(i=a[c]);c++)i.type===CSSRule.IMPORT_RULE&&(o=o&&Boolean(i.styleSheet))}o&&setTimeout(function(){e.dispatchEvent(new CustomEvent("load",{bubbles:!1}))})}},parseScript:function(t){var r=document.createElement("script");r.__importElement=t,r.src=t.src?t.src:n(t),e.currentScript=t,this.trackElement(r,function(t){r.parentNode&&r.parentNode.removeChild(r),e.currentScript=null}),this.addElementToDocument(r)},nextToParse:function(){return this._mayParse=[],!this.parsingElement&&(this.nextToParseInDoc(s)||this.nextToParseDynamic())},nextToParseInDoc:function(e,n){if(e&&this._mayParse.indexOf(e)<0){this._mayParse.push(e);for(var r,o=e.querySelectorAll(this.parseSelectorsForNode(e)),i=0,a=o.length;a>i&&(r=o[i]);i++)if(!this.isParsed(r))return this.hasResource(r)?t(r)?this.nextToParseInDoc(r.__doc,r):r:void 0}return n},nextToParseDynamic:function(){return this.dynamicElements[0]},parseSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===s?this.documentSelectors:this.importsSelectors},isParsed:function(e){return e.__importParsed},needsDynamicParsing:function(e){return this.dynamicElements.indexOf(e)>=0},hasResource:function(e){return t(e)&&void 0===e.__doc?!1:!0}};e.parser=h,e.IMPORT_SELECTOR=l}),window.HTMLImports.addModule(function(e){function t(e){return n(e,a)}function n(e,t){return"link"===e.localName&&e.getAttribute("rel")===t}function r(e){return!!Object.getOwnPropertyDescriptor(e,"baseURI")}function o(e,t){var n=document.implementation.createHTMLDocument(a);n._URL=t;var o=n.createElement("base");o.setAttribute("href",t),n.baseURI||r(n)||Object.defineProperty(n,"baseURI",{value:t});var i=n.createElement("meta");return i.setAttribute("charset","utf-8"),n.head.appendChild(i),n.head.appendChild(o),n.body.innerHTML=e,window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(n),n}var i=e.flags,a=e.IMPORT_LINK_TYPE,s=e.IMPORT_SELECTOR,c=e.rootDocument,d=e.Loader,u=e.Observer,l=e.parser,h={documents:{},documentPreloadSelectors:s,importsPreloadSelectors:[s].join(","),loadNode:function(e){f.addNode(e)},loadSubtree:function(e){var t=this.marshalNodes(e);f.addNodes(t)},marshalNodes:function(e){return e.querySelectorAll(this.loadSelectorsForNode(e))},loadSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===c?this.documentPreloadSelectors:this.importsPreloadSelectors},loaded:function(e,n,r,a,s){if(i.load&&console.log("loaded",e,n),n.__resource=r,n.__error=a,t(n)){var c=this.documents[e];void 0===c&&(c=a?null:o(r,s||e),c&&(c.__importLink=n,this.bootDocument(c)),this.documents[e]=c),n.__doc=c}l.parseNext()},bootDocument:function(e){this.loadSubtree(e),this.observer.observe(e),l.parseNext()},loadedAll:function(){l.parseNext()}},f=new d(h.loaded.bind(h),h.loadedAll.bind(h));if(h.observer=new u,!document.baseURI){var p={get:function(){var e=document.querySelector("base");return e?e.href:window.location.href},configurable:!0};Object.defineProperty(document,"baseURI",p),Object.defineProperty(c,"baseURI",p)}e.importer=h,e.importLoader=f}),window.HTMLImports.addModule(function(e){var t=e.parser,n=e.importer,r={added:function(e){for(var r,o,i,a,s=0,c=e.length;c>s&&(a=e[s]);s++)r||(r=a.ownerDocument,o=t.isParsed(r)),i=this.shouldLoadNode(a),i&&n.loadNode(a),this.shouldParseNode(a)&&o&&t.parseDynamic(a,i)},shouldLoadNode:function(e){return 1===e.nodeType&&o.call(e,n.loadSelectorsForNode(e))},shouldParseNode:function(e){return 1===e.nodeType&&o.call(e,t.parseSelectorsForNode(e))}};n.observer.addCallback=r.added.bind(r);var o=HTMLElement.prototype.matches||HTMLElement.prototype.matchesSelector||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector}),function(e){function t(){window.HTMLImports.importer.bootDocument(r)}var n=e.initializeModules;e.isIE;if(!e.useNative){n();var r=e.rootDocument;"complete"===document.readyState||"interactive"===document.readyState&&!window.attachEvent?t():document.addEventListener("DOMContentLoaded",t)}}(window.HTMLImports),window.CustomElements=window.CustomElements||{flags:{}},function(e){var t=e.flags,n=[],r=function(e){n.push(e)},o=function(){n.forEach(function(t){t(e)})};e.addModule=r,e.initializeModules=o,e.hasNative=Boolean(document.registerElement),e.isIE=/Trident/.test(navigator.userAgent),e.useNative=!t.register&&e.hasNative&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||window.HTMLImports.useNative)}(window.CustomElements),window.CustomElements.addModule(function(e){function t(e,t){n(e,function(e){return t(e)?!0:void r(e,t)}),r(e,t)}function n(e,t,r){var o=e.firstElementChild;if(!o)for(o=e.firstChild;o&&o.nodeType!==Node.ELEMENT_NODE;)o=o.nextSibling;for(;o;)t(o,r)!==!0&&n(o,t,r),o=o.nextElementSibling;return null}function r(e,n){for(var r=e.shadowRoot;r;)t(r,n),r=r.olderShadowRoot}function o(e,t){i(e,t,[])}function i(e,t,n){if(e=window.wrap(e),!(n.indexOf(e)>=0)){n.push(e);for(var r,o=e.querySelectorAll("link[rel="+a+"]"),s=0,c=o.length;c>s&&(r=o[s]);s++)r["import"]&&i(r["import"],t,n);t(e)}}var a=window.HTMLImports?window.HTMLImports.IMPORT_LINK_TYPE:"none";e.forDocumentTree=o,e.forSubtree=t}),window.CustomElements.addModule(function(e){function t(e,t){return n(e,t)||r(e,t)}function n(t,n){return e.upgrade(t,n)?!0:void(n&&a(t))}function r(e,t){g(e,function(e){return n(e,t)?!0:void 0})}function o(e){L.push(e),E||(E=!0,setTimeout(i))}function i(){E=!1;for(var e,t=L,n=0,r=t.length;r>n&&(e=t[n]);n++)e();L=[]}function a(e){y?o(function(){s(e)}):s(e)}function s(e){e.__upgraded__&&!e.__attached&&(e.__attached=!0,e.attachedCallback&&e.attachedCallback())}function c(e){d(e),g(e,function(e){d(e)})}function d(e){y?o(function(){u(e)}):u(e)}function u(e){e.__upgraded__&&e.__attached&&(e.__attached=!1,e.detachedCallback&&e.detachedCallback())}function l(e){for(var t=e,n=window.wrap(document);t;){if(t==n)return!0;t=t.parentNode||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host}}function h(e){if(e.shadowRoot&&!e.shadowRoot.__watched){_.dom&&console.log("watching shadow-root for: ",e.localName);for(var t=e.shadowRoot;t;)m(t),t=t.olderShadowRoot}}function f(e,n){if(_.dom){var r=n[0];if(r&&"childList"===r.type&&r.addedNodes&&r.addedNodes){for(var o=r.addedNodes[0];o&&o!==document&&!o.host;)o=o.parentNode;var i=o&&(o.URL||o._URL||o.host&&o.host.localName)||"";i=i.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",n.length,i||"")}var a=l(e);n.forEach(function(e){"childList"===e.type&&(T(e.addedNodes,function(e){e.localName&&t(e,a)}),T(e.removedNodes,function(e){e.localName&&c(e)}))}),_.dom&&console.groupEnd()}function p(e){for(e=window.wrap(e),e||(e=window.wrap(document));e.parentNode;)e=e.parentNode;var t=e.__observer;t&&(f(e,t.takeRecords()),i())}function m(e){if(!e.__observer){var t=new MutationObserver(f.bind(this,e));t.observe(e,{childList:!0,subtree:!0}),e.__observer=t}}function v(e){e=window.wrap(e),_.dom&&console.group("upgradeDocument: ",e.baseURI.split("/").pop()); 12 | var n=e===window.wrap(document);t(e,n),m(e),_.dom&&console.groupEnd()}function w(e){b(e,v)}var _=e.flags,g=e.forSubtree,b=e.forDocumentTree,y=window.MutationObserver._isPolyfilled&&_["throttle-attached"];e.hasPolyfillMutations=y,e.hasThrottledAttached=y;var E=!1,L=[],T=Array.prototype.forEach.call.bind(Array.prototype.forEach),M=Element.prototype.createShadowRoot;M&&(Element.prototype.createShadowRoot=function(){var e=M.call(this);return window.CustomElements.watchShadow(this),e}),e.watchShadow=h,e.upgradeDocumentTree=w,e.upgradeDocument=v,e.upgradeSubtree=r,e.upgradeAll=t,e.attached=a,e.takeRecords=p}),window.CustomElements.addModule(function(e){function t(t,r){if("template"===t.localName&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(t),!t.__upgraded__&&t.nodeType===Node.ELEMENT_NODE){var o=t.getAttribute("is"),i=e.getRegisteredDefinition(t.localName)||e.getRegisteredDefinition(o);if(i&&(o&&i.tag==t.localName||!o&&!i["extends"]))return n(t,i,r)}}function n(t,n,o){return a.upgrade&&console.group("upgrade:",t.localName),n.is&&t.setAttribute("is",n.is),r(t,n),t.__upgraded__=!0,i(t),o&&e.attached(t),e.upgradeSubtree(t,o),a.upgrade&&console.groupEnd(),t}function r(e,t){Object.__proto__?e.__proto__=t.prototype:(o(e,t.prototype,t["native"]),e.__proto__=t.prototype)}function o(e,t,n){for(var r={},o=t;o!==n&&o!==HTMLElement.prototype;){for(var i,a=Object.getOwnPropertyNames(o),s=0;i=a[s];s++)r[i]||(Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(o,i)),r[i]=1);o=Object.getPrototypeOf(o)}}function i(e){e.createdCallback&&e.createdCallback()}var a=e.flags;e.upgrade=t,e.upgradeWithDefinition=n,e.implementPrototype=r}),window.CustomElements.addModule(function(e){function t(t,r){var c=r||{};if(!t)throw new Error("document.registerElement: first argument `name` must not be empty");if(t.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(t)+"'.");if(o(t))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(t)+"'. The type name is invalid.");if(d(t))throw new Error("DuplicateDefinitionError: a type with name '"+String(t)+"' is already registered");return c.prototype||(c.prototype=Object.create(HTMLElement.prototype)),c.__name=t.toLowerCase(),c.lifecycle=c.lifecycle||{},c.ancestry=i(c["extends"]),a(c),s(c),n(c.prototype),u(c.__name,c),c.ctor=l(c),c.ctor.prototype=c.prototype,c.prototype.constructor=c.ctor,e.ready&&w(document),c.ctor}function n(e){if(!e.setAttribute._polyfilled){var t=e.setAttribute;e.setAttribute=function(e,n){r.call(this,e,n,t)};var n=e.removeAttribute;e.removeAttribute=function(e){r.call(this,e,null,n)},e.setAttribute._polyfilled=!0}}function r(e,t,n){e=e.toLowerCase();var r=this.getAttribute(e);n.apply(this,arguments);var o=this.getAttribute(e);this.attributeChangedCallback&&o!==r&&this.attributeChangedCallback(e,r,o)}function o(e){for(var t=0;t=0&&b(r,HTMLElement),r)}function p(e,t){var n=e[t];e[t]=function(){var e=n.apply(this,arguments);return _(e),e}}var m,v=e.isIE,w=e.upgradeDocumentTree,_=e.upgradeAll,g=e.upgradeWithDefinition,b=e.implementPrototype,y=e.useNative,E=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],L={},T="http://www.w3.org/1999/xhtml",M=document.createElement.bind(document),N=document.createElementNS.bind(document);m=Object.__proto__||y?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;for(var n=e;n;){if(n===t.prototype)return!0;n=n.__proto__}return!1},p(Node.prototype,"cloneNode"),p(document,"importNode"),v&&!function(){var e=document.importNode;document.importNode=function(){var t=e.apply(document,arguments);if(t.nodeType==t.DOCUMENT_FRAGMENT_NODE){var n=document.createDocumentFragment();return n.appendChild(t),n}return t}}(),document.registerElement=t,document.createElement=f,document.createElementNS=h,e.registry=L,e["instanceof"]=m,e.reservedTagList=E,e.getRegisteredDefinition=d,document.register=document.registerElement}),function(e){function t(){i(window.wrap(document)),window.CustomElements.ready=!0;var e=window.requestAnimationFrame||function(e){setTimeout(e,16)};e(function(){setTimeout(function(){window.CustomElements.readyTime=Date.now(),window.HTMLImports&&(window.CustomElements.elapsed=window.CustomElements.readyTime-window.HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})})}var n=e.useNative,r=e.initializeModules;e.isIE;if(n){var o=function(){};e.watchShadow=o,e.upgrade=o,e.upgradeAll=o,e.upgradeDocumentTree=o,e.upgradeSubtree=o,e.takeRecords=o,e["instanceof"]=function(e,t){return e instanceof t}}else r();var i=e.upgradeDocumentTree,a=e.upgradeDocument;if(window.wrap||(window.ShadowDOMPolyfill?(window.wrap=window.ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=window.ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(e){return e}),window.HTMLImports&&(window.HTMLImports.__importsParsingHook=function(e){e["import"]&&a(wrap(e["import"]))}),"complete"===document.readyState||e.flags.eager)t();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var s=window.HTMLImports&&!window.HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(s,t)}else t()}(window.CustomElements),function(e){var t=document.createElement("style");t.textContent="body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n";var n=document.querySelector("head");n.insertBefore(t,n.firstChild)}(window.WebComponents); -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 | 12 |
  • Item 1
  • 13 |
  • Item 2
  • 14 |
  • Item 3
  • 15 |
  • Item 2
  • 16 |
  • Item 3
  • 17 |
  • Long Item
  • 18 |
  • Long Long Items
  • 19 |
    20 |
    21 | 27 | 28 | -------------------------------------------------------------------------------- /demo/sizing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 24 | 25 |
    26 |

    font-size: 12px

    27 | 28 |
  • Item 1
  • 29 |
  • Item 2
  • 30 |
  • Item 3
  • 31 |
  • Item 4
  • 32 |
  • Item 5
  • 33 |
  • Item 6
  • 34 |
  • Item 7
  • 35 |
    36 |
    37 |
    38 |

    font-size: 14px

    39 | 40 |
  • Item 1
  • 41 |
  • Item 2
  • 42 |
  • Item 3
  • 43 |
  • Item 4
  • 44 |
  • Item 5
  • 45 |
  • Item 6
  • 46 |
  • Item 7
  • 47 |
    48 |
    49 |
    50 |

    font-size: 16px

    51 | 52 |
  • Item 1
  • 53 |
  • Item 2
  • 54 |
  • Item 3
  • 55 |
  • Item 4
  • 56 |
  • Item 5
  • 57 |
  • Item 6
  • 58 |
  • Item 7
  • 59 |
    60 |
    61 | 62 | 68 | 69 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "multiselect-web-component", 3 | "version": "0.1.0", 4 | "description": "Multiselect Web Component ", 5 | "repository": { 6 | "type": "git", 7 | "url": "git+https://github.com/tabalinas/multiselect-web-component.git" 8 | }, 9 | "keywords": [ 10 | "webcomponents", 11 | "multiselect" 12 | ], 13 | "author": "Artem Tabalin (http://tabalin.net/)", 14 | "license": "MIT", 15 | "bugs": { 16 | "url": "https://github.com/tabalinas/multiselect-web-component/issues" 17 | }, 18 | "homepage": "https://github.com/tabalinas/multiselect-web-component#readme" 19 | } 20 | -------------------------------------------------------------------------------- /src/multiselect.html: -------------------------------------------------------------------------------- 1 | 129 | 130 | --------------------------------------------------------------------------------