diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-29 10:46:47 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-11-02 12:02:10 +0000 |
commit | 99677208ff3b216fdfec551fbe548da5520cd6fb (patch) | |
tree | 476a4865c10320249360e859d8fdd3e01833b03a /chromium/third_party/polymer | |
parent | c30a6232df03e1efbd9f3b226777b07e087a1122 (diff) | |
download | qtwebengine-chromium-99677208ff3b216fdfec551fbe548da5520cd6fb.tar.gz |
BASELINE: Update Chromium to 86.0.4240.124
Change-Id: Ide0ff151e94cd665ae6521a446995d34a9d1d644
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/polymer')
16 files changed, 39 insertions, 8681 deletions
diff --git a/chromium/third_party/polymer/v1_0/bower.json b/chromium/third_party/polymer/v1_0/bower.json index 90f1138a79f..f00f6d39572 100644 --- a/chromium/third_party/polymer/v1_0/bower.json +++ b/chromium/third_party/polymer/v1_0/bower.json @@ -34,7 +34,6 @@ "paper-styles": "PolymerElements/paper-styles#2.1.0", "paper-tooltip": "PolymerElements/paper-tooltip#2.1.1", "polymer2": "Polymer/polymer#2.7.0", - "polymer": "Polymer/polymer#1.11.2", "shadycss": "webcomponents/shadycss#1.6.0", "web-animations-js": "web-animations/web-animations-js#2.2.2" } diff --git a/chromium/third_party/polymer/v1_0/components-chromium/polymer/LICENSE.txt b/chromium/third_party/polymer/v1_0/components-chromium/polymer/LICENSE.txt deleted file mode 100644 index 95987bac868..00000000000 --- a/chromium/third_party/polymer/v1_0/components-chromium/polymer/LICENSE.txt +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2014 The Polymer Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/chromium/third_party/polymer/v1_0/components-chromium/polymer/bower.json b/chromium/third_party/polymer/v1_0/components-chromium/polymer/bower.json deleted file mode 100644 index 1ad66dcc4bf..00000000000 --- a/chromium/third_party/polymer/v1_0/components-chromium/polymer/bower.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "polymer", - "version": "1.11.2", - "main": [ - "polymer.html", - "polymer-mini.html", - "polymer-micro.html" - ], - "license": "http://polymer.github.io/LICENSE.txt", - "ignore": [ - "/.*", - "/test/", - "/util/", - "/explainer/", - "gulpfile.js", - "PRIMER.md", - "CONTRIBUTING.md", - "CHANGELOG.md" - ], - "authors": [ - "The Polymer Authors (http://polymer.github.io/AUTHORS.txt)" - ], - "repository": { - "type": "git", - "url": "https://github.com/Polymer/polymer.git" - }, - "dependencies": { - "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.24" - }, - "devDependencies": { - "web-component-tester": "*", - "iron-component-page": "polymerElements/iron-component-page#^1.1.6" - }, - "private": true -} diff --git a/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js b/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js deleted file mode 100644 index 1fcacd73d0f..00000000000 --- a/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js +++ /dev/null @@ -1,5528 +0,0 @@ -(function () { -Polymer.nar = []; -var disableUpgradeEnabled = Polymer.Settings.disableUpgradeEnabled; -Polymer.Annotations = { -parseAnnotations: function (template, stripWhiteSpace) { -var list = []; -var content = template._content || template.content; -this._parseNodeAnnotations(content, list, stripWhiteSpace || template.hasAttribute('strip-whitespace')); -return list; -}, -_parseNodeAnnotations: function (node, list, stripWhiteSpace) { -return node.nodeType === Node.TEXT_NODE ? this._parseTextNodeAnnotation(node, list) : this._parseElementAnnotations(node, list, stripWhiteSpace); -}, -_bindingRegex: function () { -var IDENT = '(?:' + '[a-zA-Z_$][\\w.:$\\-*]*' + ')'; -var NUMBER = '(?:' + '[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?' + ')'; -var SQUOTE_STRING = '(?:' + '\'(?:[^\'\\\\]|\\\\.)*\'' + ')'; -var DQUOTE_STRING = '(?:' + '"(?:[^"\\\\]|\\\\.)*"' + ')'; -var STRING = '(?:' + SQUOTE_STRING + '|' + DQUOTE_STRING + ')'; -var ARGUMENT = '(?:' + IDENT + '|' + NUMBER + '|' + STRING + '\\s*' + ')'; -var ARGUMENTS = '(?:' + ARGUMENT + '(?:,\\s*' + ARGUMENT + ')*' + ')'; -var ARGUMENT_LIST = '(?:' + '\\(\\s*' + '(?:' + ARGUMENTS + '?' + ')' + '\\)\\s*' + ')'; -var BINDING = '(' + IDENT + '\\s*' + ARGUMENT_LIST + '?' + ')'; -var OPEN_BRACKET = '(\\[\\[|{{)' + '\\s*'; -var CLOSE_BRACKET = '(?:]]|}})'; -var NEGATE = '(?:(!)\\s*)?'; -var EXPRESSION = OPEN_BRACKET + NEGATE + BINDING + CLOSE_BRACKET; -return new RegExp(EXPRESSION, 'g'); -}(), -_parseBindings: function (text) { -var re = this._bindingRegex; -var parts = []; -var lastIndex = 0; -var m; -while ((m = re.exec(text)) !== null) { -if (m.index > lastIndex) { -parts.push({ literal: text.slice(lastIndex, m.index) }); -} -var mode = m[1][0]; -var negate = Boolean(m[2]); -var value = m[3].trim(); -var customEvent, notifyEvent, colon; -if (mode == '{' && (colon = value.indexOf('::')) > 0) { -notifyEvent = value.substring(colon + 2); -value = value.substring(0, colon); -customEvent = true; -} -parts.push({ -compoundIndex: parts.length, -value: value, -mode: mode, -negate: negate, -event: notifyEvent, -customEvent: customEvent -}); -lastIndex = re.lastIndex; -} -if (lastIndex && lastIndex < text.length) { -var literal = text.substring(lastIndex); -if (literal) { -parts.push({ literal: literal }); -} -} -if (parts.length) { -return parts; -} -}, -_literalFromParts: function (parts) { -var s = ''; -for (var i = 0; i < parts.length; i++) { -var literal = parts[i].literal; -s += literal || ''; -} -return s; -}, -_parseTextNodeAnnotation: function (node, list) { -var parts = this._parseBindings(node.textContent); -if (parts) { -node.textContent = this._literalFromParts(parts) || ' '; -var annote = { -bindings: [{ -kind: 'text', -name: 'textContent', -parts: parts, -isCompound: parts.length !== 1 -}] -}; -list.push(annote); -return annote; -} -}, -_parseElementAnnotations: function (element, list, stripWhiteSpace) { -var annote = { -bindings: [], -events: [] -}; -if (element.localName === 'content') { -list._hasContent = true; -} -this._parseChildNodesAnnotations(element, annote, list, stripWhiteSpace); -if (element.attributes) { -this._parseNodeAttributeAnnotations(element, annote, list); -if (this.prepElement) { -this.prepElement(element); -} -} -if (annote.bindings.length || annote.events.length || annote.id) { -list.push(annote); -} -return annote; -}, -_parseChildNodesAnnotations: function (root, annote, list, stripWhiteSpace) { -if (root.firstChild) { -var node = root.firstChild; -var i = 0; -while (node) { -var next = node.nextSibling; -if (node.localName === 'template' && !node.hasAttribute('preserve-content')) { -this._parseTemplate(node, i, list, annote, stripWhiteSpace); -} -if (node.localName == 'slot') { -node = this._replaceSlotWithContent(node); -} -if (node.nodeType === Node.TEXT_NODE) { -var n = next; -while (n && n.nodeType === Node.TEXT_NODE) { -node.textContent += n.textContent; -next = n.nextSibling; -root.removeChild(n); -n = next; -} -if (stripWhiteSpace && !node.textContent.trim()) { -root.removeChild(node); -i--; -} -} -if (node.parentNode) { -var childAnnotation = this._parseNodeAnnotations(node, list, stripWhiteSpace); -if (childAnnotation) { -childAnnotation.parent = annote; -childAnnotation.index = i; -} -} -node = next; -i++; -} -} -}, -_replaceSlotWithContent: function (slot) { -var content = slot.ownerDocument.createElement('content'); -while (slot.firstChild) { -content.appendChild(slot.firstChild); -} -var attrs = slot.attributes; -for (var i = 0; i < attrs.length; i++) { -var attr = attrs[i]; -content.setAttribute(attr.name, attr.value); -} -var name = slot.getAttribute('name'); -if (name) { -content.setAttribute('select', '[slot=\'' + name + '\']'); -} -slot.parentNode.replaceChild(content, slot); -return content; -}, -_parseTemplate: function (node, index, list, parent, stripWhiteSpace) { -var content = document.createDocumentFragment(); -content._notes = this.parseAnnotations(node, stripWhiteSpace); -content.appendChild(node.content); -list.push({ -bindings: Polymer.nar, -events: Polymer.nar, -templateContent: content, -parent: parent, -index: index -}); -}, -_parseNodeAttributeAnnotations: function (node, annotation) { -var attrs = Array.prototype.slice.call(node.attributes); -for (var i = attrs.length - 1, a; a = attrs[i]; i--) { -var n = a.name; -var v = a.value; -var b; -if (n.slice(0, 3) === 'on-') { -node.removeAttribute(n); -annotation.events.push({ -name: n.slice(3), -value: v -}); -} else if (b = this._parseNodeAttributeAnnotation(node, n, v)) { -annotation.bindings.push(b); -} else if (n === 'id') { -annotation.id = v; -} -} -}, -_parseNodeAttributeAnnotation: function (node, name, value) { -var parts = this._parseBindings(value); -if (parts) { -var origName = name; -var kind = 'property'; -if (name[name.length - 1] == '$') { -name = name.slice(0, -1); -kind = 'attribute'; -} -var literal = this._literalFromParts(parts); -if (literal && kind == 'attribute') { -node.setAttribute(name, literal); -} -if (node.localName === 'input' && origName === 'value') { -node.setAttribute(origName, ''); -} -if (disableUpgradeEnabled && origName === 'disable-upgrade$') { -node.setAttribute(name, ''); -} -node.removeAttribute(origName); -var propertyName = Polymer.CaseMap.dashToCamelCase(name); -if (kind === 'property') { -name = propertyName; -} -return { -kind: kind, -name: name, -propertyName: propertyName, -parts: parts, -literal: literal, -isCompound: parts.length !== 1 -}; -} -}, -findAnnotatedNode: function (root, annote) { -var parent = annote.parent && Polymer.Annotations.findAnnotatedNode(root, annote.parent); -if (parent) { -for (var n = parent.firstChild, i = 0; n; n = n.nextSibling) { -if (annote.index === i++) { -return n; -} -} -} else { -return root; -} -} -}; -}());Polymer.Path = { -root: function (path) { -var dotIndex = path.indexOf('.'); -if (dotIndex === -1) { -return path; -} -return path.slice(0, dotIndex); -}, -isDeep: function (path) { -return path.indexOf('.') !== -1; -}, -isAncestor: function (base, path) { -return base.indexOf(path + '.') === 0; -}, -isDescendant: function (base, path) { -return path.indexOf(base + '.') === 0; -}, -translate: function (base, newBase, path) { -return newBase + path.slice(base.length); -}, -matches: function (base, wildcard, path) { -return base === path || this.isAncestor(base, path) || Boolean(wildcard) && this.isDescendant(base, path); -} -};Polymer.Base._addFeature({ -_prepAnnotations: function () { -if (!this._template) { -this._notes = []; -} else { -var self = this; -Polymer.Annotations.prepElement = function (element) { -self._prepElement(element); -}; -if (this._template._content && this._template._content._notes) { -this._notes = this._template._content._notes; -} else { -this._notes = Polymer.Annotations.parseAnnotations(this._template); -this._processAnnotations(this._notes); -} -Polymer.Annotations.prepElement = null; -} -}, -_processAnnotations: function (notes) { -for (var i = 0; i < notes.length; i++) { -var note = notes[i]; -for (var j = 0; j < note.bindings.length; j++) { -var b = note.bindings[j]; -for (var k = 0; k < b.parts.length; k++) { -var p = b.parts[k]; -if (!p.literal) { -var signature = this._parseMethod(p.value); -if (signature) { -p.signature = signature; -} else { -p.model = Polymer.Path.root(p.value); -} -} -} -} -if (note.templateContent) { -this._processAnnotations(note.templateContent._notes); -var pp = note.templateContent._parentProps = this._discoverTemplateParentProps(note.templateContent._notes); -var bindings = []; -for (var prop in pp) { -var name = '_parent_' + prop; -bindings.push({ -index: note.index, -kind: 'property', -name: name, -propertyName: name, -parts: [{ -mode: '{', -model: prop, -value: prop -}] -}); -} -note.bindings = note.bindings.concat(bindings); -} -} -}, -_discoverTemplateParentProps: function (notes) { -var pp = {}; -for (var i = 0, n; i < notes.length && (n = notes[i]); i++) { -for (var j = 0, b$ = n.bindings, b; j < b$.length && (b = b$[j]); j++) { -for (var k = 0, p$ = b.parts, p; k < p$.length && (p = p$[k]); k++) { -if (p.signature) { -var args = p.signature.args; -for (var kk = 0; kk < args.length; kk++) { -var model = args[kk].model; -if (model) { -pp[model] = true; -} -} -if (p.signature.dynamicFn) { -pp[p.signature.method] = true; -} -} else { -if (p.model) { -pp[p.model] = true; -} -} -} -} -if (n.templateContent) { -var tpp = n.templateContent._parentProps; -Polymer.Base.mixin(pp, tpp); -} -} -return pp; -}, -_prepElement: function (element) { -Polymer.ResolveUrl.resolveAttrs(element, this._template.ownerDocument); -}, -_findAnnotatedNode: Polymer.Annotations.findAnnotatedNode, -_marshalAnnotationReferences: function () { -if (this._template) { -this._marshalIdNodes(); -this._marshalAnnotatedNodes(); -this._marshalAnnotatedListeners(); -} -}, -_configureAnnotationReferences: function () { -var notes = this._notes; -var nodes = this._nodes; -for (var i = 0; i < notes.length; i++) { -var note = notes[i]; -var node = nodes[i]; -this._configureTemplateContent(note, node); -this._configureCompoundBindings(note, node); -} -}, -_configureTemplateContent: function (note, node) { -if (note.templateContent) { -node._content = note.templateContent; -} -}, -_configureCompoundBindings: function (note, node) { -var bindings = note.bindings; -for (var i = 0; i < bindings.length; i++) { -var binding = bindings[i]; -if (binding.isCompound) { -var storage = node.__compoundStorage__ || (node.__compoundStorage__ = {}); -var parts = binding.parts; -var literals = new Array(parts.length); -for (var j = 0; j < parts.length; j++) { -literals[j] = parts[j].literal; -} -var name = binding.name; -storage[name] = literals; -if (binding.literal && binding.kind == 'property') { -if (node._configValue) { -node._configValue(name, binding.literal); -} else { -node[name] = binding.literal; -} -} -} -} -}, -_marshalIdNodes: function () { -this.$ = {}; -for (var i = 0, l = this._notes.length, a; i < l && (a = this._notes[i]); i++) { -if (a.id) { -this.$[a.id] = this._findAnnotatedNode(this.root, a); -} -} -}, -_marshalAnnotatedNodes: function () { -if (this._notes && this._notes.length) { -var r = new Array(this._notes.length); -for (var i = 0; i < this._notes.length; i++) { -r[i] = this._findAnnotatedNode(this.root, this._notes[i]); -} -this._nodes = r; -} -}, -_marshalAnnotatedListeners: function () { -for (var i = 0, l = this._notes.length, a; i < l && (a = this._notes[i]); i++) { -if (a.events && a.events.length) { -var node = this._findAnnotatedNode(this.root, a); -for (var j = 0, e$ = a.events, e; j < e$.length && (e = e$[j]); j++) { -this.listen(node, e.name, e.value); -} -} -} -} -});Polymer.Base._addFeature({ -listeners: {}, -_listenListeners: function (listeners) { -var node, name, eventName; -for (eventName in listeners) { -if (eventName.indexOf('.') < 0) { -node = this; -name = eventName; -} else { -name = eventName.split('.'); -node = this.$[name[0]]; -name = name[1]; -} -this.listen(node, name, listeners[eventName]); -} -}, -listen: function (node, eventName, methodName) { -var handler = this._recallEventHandler(this, eventName, node, methodName); -if (!handler) { -handler = this._createEventHandler(node, eventName, methodName); -} -if (handler._listening) { -return; -} -this._listen(node, eventName, handler); -handler._listening = true; -}, -_boundListenerKey: function (eventName, methodName) { -return eventName + ':' + methodName; -}, -_recordEventHandler: function (host, eventName, target, methodName, handler) { -var hbl = host.__boundListeners; -if (!hbl) { -hbl = host.__boundListeners = new WeakMap(); -} -var bl = hbl.get(target); -if (!bl) { -bl = {}; -if (!Polymer.Settings.isIE || target != window) { -hbl.set(target, bl); -} -} -var key = this._boundListenerKey(eventName, methodName); -bl[key] = handler; -}, -_recallEventHandler: function (host, eventName, target, methodName) { -var hbl = host.__boundListeners; -if (!hbl) { -return; -} -var bl = hbl.get(target); -if (!bl) { -return; -} -var key = this._boundListenerKey(eventName, methodName); -return bl[key]; -}, -_createEventHandler: function (node, eventName, methodName) { -var host = this; -var handler = function (e) { -if (host[methodName]) { -host[methodName](e, e.detail); -} else { -host._warn(host._logf('_createEventHandler', 'listener method `' + methodName + '` not defined')); -} -}; -handler._listening = false; -this._recordEventHandler(host, eventName, node, methodName, handler); -return handler; -}, -unlisten: function (node, eventName, methodName) { -var handler = this._recallEventHandler(this, eventName, node, methodName); -if (handler) { -this._unlisten(node, eventName, handler); -handler._listening = false; -} -}, -_listen: function (node, eventName, handler) { -node.addEventListener(eventName, handler); -}, -_unlisten: function (node, eventName, handler) { -node.removeEventListener(eventName, handler); -} -});(function () { -'use strict'; -var wrap = Polymer.DomApi.wrap; -var HAS_NATIVE_TA = typeof document.head.style.touchAction === 'string'; -var GESTURE_KEY = '__polymerGestures'; -var HANDLED_OBJ = '__polymerGesturesHandled'; -var TOUCH_ACTION = '__polymerGesturesTouchAction'; -var TAP_DISTANCE = 25; -var TRACK_DISTANCE = 5; -var TRACK_LENGTH = 2; -var MOUSE_TIMEOUT = 2500; -var MOUSE_EVENTS = [ -'mousedown', -'mousemove', -'mouseup', -'click' -]; -var MOUSE_WHICH_TO_BUTTONS = [ -0, -1, -4, -2 -]; -var MOUSE_HAS_BUTTONS = function () { -try { -return new MouseEvent('test', { buttons: 1 }).buttons === 1; -} catch (e) { -return false; -} -}(); -function isMouseEvent(name) { -return MOUSE_EVENTS.indexOf(name) > -1; -} -var SUPPORTS_PASSIVE = false; -(function () { -try { -var opts = Object.defineProperty({}, 'passive', { -get: function () { -SUPPORTS_PASSIVE = true; -} -}); -window.addEventListener('test', null, opts); -window.removeEventListener('test', null, opts); -} catch (e) { -} -}()); -function PASSIVE_TOUCH(eventName) { -if (isMouseEvent(eventName) || eventName === 'touchend') { -return; -} -if (HAS_NATIVE_TA && SUPPORTS_PASSIVE && Polymer.Settings.passiveTouchGestures) { -return { passive: true }; -} -} -var IS_TOUCH_ONLY = navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/); -var mouseCanceller = function (mouseEvent) { -var sc = mouseEvent.sourceCapabilities; -if (sc && !sc.firesTouchEvents) { -return; -} -mouseEvent[HANDLED_OBJ] = { skip: true }; -if (mouseEvent.type === 'click') { -var path = Polymer.dom(mouseEvent).path; -for (var i = 0; i < path.length; i++) { -if (path[i] === POINTERSTATE.mouse.target) { -return; -} -} -mouseEvent.preventDefault(); -mouseEvent.stopPropagation(); -} -}; -function setupTeardownMouseCanceller(setup) { -var events = IS_TOUCH_ONLY ? ['click'] : MOUSE_EVENTS; -for (var i = 0, en; i < events.length; i++) { -en = events[i]; -if (setup) { -document.addEventListener(en, mouseCanceller, true); -} else { -document.removeEventListener(en, mouseCanceller, true); -} -} -} -function ignoreMouse(ev) { -if (!POINTERSTATE.mouse.mouseIgnoreJob) { -setupTeardownMouseCanceller(true); -} -var unset = function () { -setupTeardownMouseCanceller(); -POINTERSTATE.mouse.target = null; -POINTERSTATE.mouse.mouseIgnoreJob = null; -}; -POINTERSTATE.mouse.target = Polymer.dom(ev).rootTarget; -POINTERSTATE.mouse.mouseIgnoreJob = Polymer.Debounce(POINTERSTATE.mouse.mouseIgnoreJob, unset, MOUSE_TIMEOUT); -} -function hasLeftMouseButton(ev) { -var type = ev.type; -if (!isMouseEvent(type)) { -return false; -} -if (type === 'mousemove') { -var buttons = ev.buttons === undefined ? 1 : ev.buttons; -if (ev instanceof window.MouseEvent && !MOUSE_HAS_BUTTONS) { -buttons = MOUSE_WHICH_TO_BUTTONS[ev.which] || 0; -} -return Boolean(buttons & 1); -} else { -var button = ev.button === undefined ? 0 : ev.button; -return button === 0; -} -} -function isSyntheticClick(ev) { -if (ev.type === 'click') { -if (ev.detail === 0) { -return true; -} -var t = Gestures.findOriginalTarget(ev); -var bcr = t.getBoundingClientRect(); -var x = ev.pageX, y = ev.pageY; -return !(x >= bcr.left && x <= bcr.right && (y >= bcr.top && y <= bcr.bottom)); -} -return false; -} -var POINTERSTATE = { -mouse: { -target: null, -mouseIgnoreJob: null -}, -touch: { -x: 0, -y: 0, -id: -1, -scrollDecided: false -} -}; -function firstTouchAction(ev) { -var path = Polymer.dom(ev).path; -var ta = 'auto'; -for (var i = 0, n; i < path.length; i++) { -n = path[i]; -if (n[TOUCH_ACTION]) { -ta = n[TOUCH_ACTION]; -break; -} -} -return ta; -} -function trackDocument(stateObj, movefn, upfn) { -stateObj.movefn = movefn; -stateObj.upfn = upfn; -document.addEventListener('mousemove', movefn); -document.addEventListener('mouseup', upfn); -} -function untrackDocument(stateObj) { -document.removeEventListener('mousemove', stateObj.movefn); -document.removeEventListener('mouseup', stateObj.upfn); -stateObj.movefn = null; -stateObj.upfn = null; -} -document.addEventListener('touchend', ignoreMouse, SUPPORTS_PASSIVE ? { passive: true } : false); -var Gestures = { -gestures: {}, -recognizers: [], -deepTargetFind: function (x, y) { -var node = document.elementFromPoint(x, y); -var next = node; -while (next && next.shadowRoot) { -next = next.shadowRoot.elementFromPoint(x, y); -if (next) { -node = next; -} -} -return node; -}, -findOriginalTarget: function (ev) { -if (ev.path) { -return ev.path[0]; -} -return ev.target; -}, -handleNative: function (ev) { -var handled; -var type = ev.type; -var node = wrap(ev.currentTarget); -var gobj = node[GESTURE_KEY]; -if (!gobj) { -return; -} -var gs = gobj[type]; -if (!gs) { -return; -} -if (!ev[HANDLED_OBJ]) { -ev[HANDLED_OBJ] = {}; -if (type.slice(0, 5) === 'touch') { -var t = ev.changedTouches[0]; -if (type === 'touchstart') { -if (ev.touches.length === 1) { -POINTERSTATE.touch.id = t.identifier; -} -} -if (POINTERSTATE.touch.id !== t.identifier) { -return; -} -if (!HAS_NATIVE_TA) { -if (type === 'touchstart' || type === 'touchmove') { -Gestures.handleTouchAction(ev); -} -} -} -} -handled = ev[HANDLED_OBJ]; -if (handled.skip) { -return; -} -var recognizers = Gestures.recognizers; -for (var i = 0, r; i < recognizers.length; i++) { -r = recognizers[i]; -if (gs[r.name] && !handled[r.name]) { -if (r.flow && r.flow.start.indexOf(ev.type) > -1 && r.reset) { -r.reset(); -} -} -} -for (i = 0, r; i < recognizers.length; i++) { -r = recognizers[i]; -if (gs[r.name] && !handled[r.name]) { -handled[r.name] = true; -r[type](ev); -} -} -}, -handleTouchAction: function (ev) { -var t = ev.changedTouches[0]; -var type = ev.type; -if (type === 'touchstart') { -POINTERSTATE.touch.x = t.clientX; -POINTERSTATE.touch.y = t.clientY; -POINTERSTATE.touch.scrollDecided = false; -} else if (type === 'touchmove') { -if (POINTERSTATE.touch.scrollDecided) { -return; -} -POINTERSTATE.touch.scrollDecided = true; -var ta = firstTouchAction(ev); -var prevent = false; -var dx = Math.abs(POINTERSTATE.touch.x - t.clientX); -var dy = Math.abs(POINTERSTATE.touch.y - t.clientY); -if (!ev.cancelable) { -} else if (ta === 'none') { -prevent = true; -} else if (ta === 'pan-x') { -prevent = dy > dx; -} else if (ta === 'pan-y') { -prevent = dx > dy; -} -if (prevent) { -ev.preventDefault(); -} else { -Gestures.prevent('track'); -} -} -}, -add: function (node, evType, handler) { -node = wrap(node); -var recognizer = this.gestures[evType]; -var deps = recognizer.deps; -var name = recognizer.name; -var gobj = node[GESTURE_KEY]; -if (!gobj) { -node[GESTURE_KEY] = gobj = {}; -} -for (var i = 0, dep, gd; i < deps.length; i++) { -dep = deps[i]; -if (IS_TOUCH_ONLY && isMouseEvent(dep) && dep !== 'click') { -continue; -} -gd = gobj[dep]; -if (!gd) { -gobj[dep] = gd = { _count: 0 }; -} -if (gd._count === 0) { -node.addEventListener(dep, this.handleNative, PASSIVE_TOUCH(dep)); -} -gd[name] = (gd[name] || 0) + 1; -gd._count = (gd._count || 0) + 1; -} -node.addEventListener(evType, handler); -if (recognizer.touchAction) { -this.setTouchAction(node, recognizer.touchAction); -} -}, -remove: function (node, evType, handler) { -node = wrap(node); -var recognizer = this.gestures[evType]; -var deps = recognizer.deps; -var name = recognizer.name; -var gobj = node[GESTURE_KEY]; -if (gobj) { -for (var i = 0, dep, gd; i < deps.length; i++) { -dep = deps[i]; -gd = gobj[dep]; -if (gd && gd[name]) { -gd[name] = (gd[name] || 1) - 1; -gd._count = (gd._count || 1) - 1; -if (gd._count === 0) { -node.removeEventListener(dep, this.handleNative, PASSIVE_TOUCH(dep)); -} -} -} -} -node.removeEventListener(evType, handler); -}, -register: function (recog) { -this.recognizers.push(recog); -for (var i = 0; i < recog.emits.length; i++) { -this.gestures[recog.emits[i]] = recog; -} -}, -findRecognizerByEvent: function (evName) { -for (var i = 0, r; i < this.recognizers.length; i++) { -r = this.recognizers[i]; -for (var j = 0, n; j < r.emits.length; j++) { -n = r.emits[j]; -if (n === evName) { -return r; -} -} -} -return null; -}, -setTouchAction: function (node, value) { -if (HAS_NATIVE_TA) { -node.style.touchAction = value; -} -node[TOUCH_ACTION] = value; -}, -fire: function (target, type, detail) { -var ev = Polymer.Base.fire(type, detail, { -node: target, -bubbles: true, -cancelable: true -}); -if (ev.defaultPrevented) { -var preventer = detail.preventer || detail.sourceEvent; -if (preventer && preventer.preventDefault) { -preventer.preventDefault(); -} -} -}, -prevent: function (evName) { -var recognizer = this.findRecognizerByEvent(evName); -if (recognizer.info) { -recognizer.info.prevent = true; -} -}, -resetMouseCanceller: function () { -if (POINTERSTATE.mouse.mouseIgnoreJob) { -POINTERSTATE.mouse.mouseIgnoreJob.complete(); -} -} -}; -Gestures.register({ -name: 'downup', -deps: [ -'mousedown', -'touchstart', -'touchend' -], -flow: { -start: [ -'mousedown', -'touchstart' -], -end: [ -'mouseup', -'touchend' -] -}, -emits: [ -'down', -'up' -], -info: { -movefn: null, -upfn: null -}, -reset: function () { -untrackDocument(this.info); -}, -mousedown: function (e) { -if (!hasLeftMouseButton(e)) { -return; -} -var t = Gestures.findOriginalTarget(e); -var self = this; -var movefn = function movefn(e) { -if (!hasLeftMouseButton(e)) { -self.fire('up', t, e); -untrackDocument(self.info); -} -}; -var upfn = function upfn(e) { -if (hasLeftMouseButton(e)) { -self.fire('up', t, e); -} -untrackDocument(self.info); -}; -trackDocument(this.info, movefn, upfn); -this.fire('down', t, e); -}, -touchstart: function (e) { -this.fire('down', Gestures.findOriginalTarget(e), e.changedTouches[0], e); -}, -touchend: function (e) { -this.fire('up', Gestures.findOriginalTarget(e), e.changedTouches[0], e); -}, -fire: function (type, target, event, preventer) { -Gestures.fire(target, type, { -x: event.clientX, -y: event.clientY, -sourceEvent: event, -preventer: preventer, -prevent: function (e) { -return Gestures.prevent(e); -} -}); -} -}); -Gestures.register({ -name: 'track', -touchAction: 'none', -deps: [ -'mousedown', -'touchstart', -'touchmove', -'touchend' -], -flow: { -start: [ -'mousedown', -'touchstart' -], -end: [ -'mouseup', -'touchend' -] -}, -emits: ['track'], -info: { -x: 0, -y: 0, -state: 'start', -started: false, -moves: [], -addMove: function (move) { -if (this.moves.length > TRACK_LENGTH) { -this.moves.shift(); -} -this.moves.push(move); -}, -movefn: null, -upfn: null, -prevent: false -}, -reset: function () { -this.info.state = 'start'; -this.info.started = false; -this.info.moves = []; -this.info.x = 0; -this.info.y = 0; -this.info.prevent = false; -untrackDocument(this.info); -}, -hasMovedEnough: function (x, y) { -if (this.info.prevent) { -return false; -} -if (this.info.started) { -return true; -} -var dx = Math.abs(this.info.x - x); -var dy = Math.abs(this.info.y - y); -return dx >= TRACK_DISTANCE || dy >= TRACK_DISTANCE; -}, -mousedown: function (e) { -if (!hasLeftMouseButton(e)) { -return; -} -var t = Gestures.findOriginalTarget(e); -var self = this; -var movefn = function movefn(e) { -var x = e.clientX, y = e.clientY; -if (self.hasMovedEnough(x, y)) { -self.info.state = self.info.started ? e.type === 'mouseup' ? 'end' : 'track' : 'start'; -if (self.info.state === 'start') { -Gestures.prevent('tap'); -} -self.info.addMove({ -x: x, -y: y -}); -if (!hasLeftMouseButton(e)) { -self.info.state = 'end'; -untrackDocument(self.info); -} -self.fire(t, e); -self.info.started = true; -} -}; -var upfn = function upfn(e) { -if (self.info.started) { -movefn(e); -} -untrackDocument(self.info); -}; -trackDocument(this.info, movefn, upfn); -this.info.x = e.clientX; -this.info.y = e.clientY; -}, -touchstart: function (e) { -var ct = e.changedTouches[0]; -this.info.x = ct.clientX; -this.info.y = ct.clientY; -}, -touchmove: function (e) { -var t = Gestures.findOriginalTarget(e); -var ct = e.changedTouches[0]; -var x = ct.clientX, y = ct.clientY; -if (this.hasMovedEnough(x, y)) { -if (this.info.state === 'start') { -Gestures.prevent('tap'); -} -this.info.addMove({ -x: x, -y: y -}); -this.fire(t, ct); -this.info.state = 'track'; -this.info.started = true; -} -}, -touchend: function (e) { -var t = Gestures.findOriginalTarget(e); -var ct = e.changedTouches[0]; -if (this.info.started) { -this.info.state = 'end'; -this.info.addMove({ -x: ct.clientX, -y: ct.clientY -}); -this.fire(t, ct, e); -} -}, -fire: function (target, touch, preventer) { -var secondlast = this.info.moves[this.info.moves.length - 2]; -var lastmove = this.info.moves[this.info.moves.length - 1]; -var dx = lastmove.x - this.info.x; -var dy = lastmove.y - this.info.y; -var ddx, ddy = 0; -if (secondlast) { -ddx = lastmove.x - secondlast.x; -ddy = lastmove.y - secondlast.y; -} -return Gestures.fire(target, 'track', { -state: this.info.state, -x: touch.clientX, -y: touch.clientY, -dx: dx, -dy: dy, -ddx: ddx, -ddy: ddy, -sourceEvent: touch, -preventer: preventer, -hover: function () { -return Gestures.deepTargetFind(touch.clientX, touch.clientY); -} -}); -} -}); -Gestures.register({ -name: 'tap', -deps: [ -'mousedown', -'click', -'touchstart', -'touchend' -], -flow: { -start: [ -'mousedown', -'touchstart' -], -end: [ -'click', -'touchend' -] -}, -emits: ['tap'], -info: { -x: NaN, -y: NaN, -prevent: false -}, -reset: function () { -this.info.x = NaN; -this.info.y = NaN; -this.info.prevent = false; -}, -save: function (e) { -this.info.x = e.clientX; -this.info.y = e.clientY; -}, -mousedown: function (e) { -if (hasLeftMouseButton(e)) { -this.save(e); -} -}, -click: function (e) { -if (hasLeftMouseButton(e)) { -this.forward(e); -} -}, -touchstart: function (e) { -this.save(e.changedTouches[0], e); -}, -touchend: function (e) { -this.forward(e.changedTouches[0], e); -}, -forward: function (e, preventer) { -var dx = Math.abs(e.clientX - this.info.x); -var dy = Math.abs(e.clientY - this.info.y); -var t = Gestures.findOriginalTarget(e); -if (isNaN(dx) || isNaN(dy) || dx <= TAP_DISTANCE && dy <= TAP_DISTANCE || isSyntheticClick(e)) { -if (!this.info.prevent) { -Gestures.fire(t, 'tap', { -x: e.clientX, -y: e.clientY, -sourceEvent: e, -preventer: preventer -}); -} -} -} -}); -var DIRECTION_MAP = { -x: 'pan-x', -y: 'pan-y', -none: 'none', -all: 'auto' -}; -Polymer.Base._addFeature({ -_setupGestures: function () { -this.__polymerGestures = null; -}, -_listen: function (node, eventName, handler) { -if (Gestures.gestures[eventName]) { -Gestures.add(node, eventName, handler); -} else { -node.addEventListener(eventName, handler); -} -}, -_unlisten: function (node, eventName, handler) { -if (Gestures.gestures[eventName]) { -Gestures.remove(node, eventName, handler); -} else { -node.removeEventListener(eventName, handler); -} -}, -setScrollDirection: function (direction, node) { -node = node || this; -Gestures.setTouchAction(node, DIRECTION_MAP[direction] || 'auto'); -} -}); -Polymer.Gestures = Gestures; -}());(function () { -'use strict'; -Polymer.Base._addFeature({ -$$: function (slctr) { -return Polymer.dom(this.root).querySelector(slctr); -}, -toggleClass: function (name, bool, node) { -node = node || this; -if (arguments.length == 1) { -bool = !node.classList.contains(name); -} -if (bool) { -Polymer.dom(node).classList.add(name); -} else { -Polymer.dom(node).classList.remove(name); -} -}, -toggleAttribute: function (name, bool, node) { -node = node || this; -if (arguments.length == 1) { -bool = !node.hasAttribute(name); -} -if (bool) { -Polymer.dom(node).setAttribute(name, ''); -} else { -Polymer.dom(node).removeAttribute(name); -} -}, -classFollows: function (name, toElement, fromElement) { -if (fromElement) { -Polymer.dom(fromElement).classList.remove(name); -} -if (toElement) { -Polymer.dom(toElement).classList.add(name); -} -}, -attributeFollows: function (name, toElement, fromElement) { -if (fromElement) { -Polymer.dom(fromElement).removeAttribute(name); -} -if (toElement) { -Polymer.dom(toElement).setAttribute(name, ''); -} -}, -getEffectiveChildNodes: function () { -return Polymer.dom(this).getEffectiveChildNodes(); -}, -getEffectiveChildren: function () { -var list = Polymer.dom(this).getEffectiveChildNodes(); -return list.filter(function (n) { -return n.nodeType === Node.ELEMENT_NODE; -}); -}, -getEffectiveTextContent: function () { -var cn = this.getEffectiveChildNodes(); -var tc = []; -for (var i = 0, c; c = cn[i]; i++) { -if (c.nodeType !== Node.COMMENT_NODE) { -tc.push(Polymer.dom(c).textContent); -} -} -return tc.join(''); -}, -queryEffectiveChildren: function (slctr) { -var e$ = Polymer.dom(this).queryDistributedElements(slctr); -return e$ && e$[0]; -}, -queryAllEffectiveChildren: function (slctr) { -return Polymer.dom(this).queryDistributedElements(slctr); -}, -getContentChildNodes: function (slctr) { -var content = Polymer.dom(this.root).querySelector(slctr || 'content'); -return content ? Polymer.dom(content).getDistributedNodes() : []; -}, -getContentChildren: function (slctr) { -return this.getContentChildNodes(slctr).filter(function (n) { -return n.nodeType === Node.ELEMENT_NODE; -}); -}, -fire: function (type, detail, options) { -options = options || Polymer.nob; -var node = options.node || this; -detail = detail === null || detail === undefined ? {} : detail; -var bubbles = options.bubbles === undefined ? true : options.bubbles; -var cancelable = Boolean(options.cancelable); -var useCache = options._useCache; -var event = this._getEvent(type, bubbles, cancelable, useCache); -event.detail = detail; -if (useCache) { -this.__eventCache[type] = null; -} -node.dispatchEvent(event); -if (useCache) { -this.__eventCache[type] = event; -} -return event; -}, -__eventCache: {}, -_getEvent: function (type, bubbles, cancelable, useCache) { -var event = useCache && this.__eventCache[type]; -if (!event || (event.bubbles != bubbles || event.cancelable != cancelable)) { -event = new Event(type, { -bubbles: Boolean(bubbles), -cancelable: cancelable -}); -} -return event; -}, -async: function (callback, waitTime) { -var self = this; -return Polymer.Async.run(function () { -callback.call(self); -}, waitTime); -}, -cancelAsync: function (handle) { -Polymer.Async.cancel(handle); -}, -arrayDelete: function (path, item) { -var index; -if (Array.isArray(path)) { -index = path.indexOf(item); -if (index >= 0) { -return path.splice(index, 1); -} -} else { -var arr = this._get(path); -index = arr.indexOf(item); -if (index >= 0) { -return this.splice(path, index, 1); -} -} -}, -transform: function (transform, node) { -node = node || this; -node.style.webkitTransform = transform; -node.style.transform = transform; -}, -translate3d: function (x, y, z, node) { -node = node || this; -this.transform('translate3d(' + x + ',' + y + ',' + z + ')', node); -}, -importHref: function (href, onload, onerror, optAsync) { -var link = document.createElement('link'); -link.rel = 'import'; -link.href = href; -var list = Polymer.Base.importHref.imported = Polymer.Base.importHref.imported || {}; -var cached = list[link.href]; -var imprt = cached || link; -var self = this; -var loadListener = function (e) { -e.target.__firedLoad = true; -e.target.removeEventListener('load', loadListener); -e.target.removeEventListener('error', errorListener); -return onload.call(self, e); -}; -var errorListener = function (e) { -e.target.__firedError = true; -e.target.removeEventListener('load', loadListener); -e.target.removeEventListener('error', errorListener); -return onerror.call(self, e); -}; -if (onload) { -imprt.addEventListener('load', loadListener); -} -if (onerror) { -imprt.addEventListener('error', errorListener); -} -if (cached) { -if (cached.__firedLoad) { -cached.dispatchEvent(new Event('load')); -} -if (cached.__firedError) { -cached.dispatchEvent(new Event('error')); -} -} else { -list[link.href] = link; -optAsync = Boolean(optAsync); -if (optAsync) { -link.setAttribute('async', ''); -} -document.head.appendChild(link); -} -return imprt; -}, -create: function (tag, props) { -var elt = document.createElement(tag); -if (props) { -for (var n in props) { -elt[n] = props[n]; -} -} -return elt; -}, -isLightDescendant: function (node) { -return this !== node && this.contains(node) && Polymer.dom(this).getOwnerRoot() === Polymer.dom(node).getOwnerRoot(); -}, -isLocalDescendant: function (node) { -return this.root === Polymer.dom(node).getOwnerRoot(); -} -}); -if (!Polymer.Settings.useNativeCustomElements) { -var importHref = Polymer.Base.importHref; -Polymer.Base.importHref = function (href, onload, onerror, optAsync) { -CustomElements.ready = false; -var loadFn = function (e) { -CustomElements.upgradeDocumentTree(document); -CustomElements.ready = true; -if (onload) { -return onload.call(this, e); -} -}; -return importHref.call(this, href, loadFn, onerror, optAsync); -}; -} -}());Polymer.Bind = { -prepareModel: function (model) { -Polymer.Base.mixin(model, this._modelApi); -}, -_modelApi: { -_notifyChange: function (source, event, value) { -value = value === undefined ? this[source] : value; -event = event || Polymer.CaseMap.camelToDashCase(source) + '-changed'; -this.fire(event, { value: value }, { -bubbles: false, -cancelable: false, -_useCache: Polymer.Settings.eventDataCache || !Polymer.Settings.isIE -}); -}, -_propertySetter: function (property, value, effects, fromAbove) { -var old = this.__data__[property]; -if (old !== value && (old === old || value === value)) { -this.__data__[property] = value; -if (typeof value == 'object') { -this._clearPath(property); -} -if (this._propertyChanged) { -this._propertyChanged(property, value, old); -} -if (effects) { -this._effectEffects(property, value, effects, old, fromAbove); -} -} -return old; -}, -__setProperty: function (property, value, quiet, node) { -node = node || this; -var effects = node._propertyEffects && node._propertyEffects[property]; -if (effects) { -node._propertySetter(property, value, effects, quiet); -} else if (node[property] !== value) { -node[property] = value; -} -}, -_effectEffects: function (property, value, effects, old, fromAbove) { -for (var i = 0, l = effects.length, fx; i < l && (fx = effects[i]); i++) { -fx.fn.call(this, property, this[property], fx.effect, old, fromAbove); -} -}, -_clearPath: function (path) { -for (var prop in this.__data__) { -if (Polymer.Path.isDescendant(path, prop)) { -this.__data__[prop] = undefined; -} -} -} -}, -ensurePropertyEffects: function (model, property) { -if (!model._propertyEffects) { -model._propertyEffects = {}; -} -var fx = model._propertyEffects[property]; -if (!fx) { -fx = model._propertyEffects[property] = []; -} -return fx; -}, -addPropertyEffect: function (model, property, kind, effect) { -var fx = this.ensurePropertyEffects(model, property); -var propEffect = { -kind: kind, -effect: effect, -fn: Polymer.Bind['_' + kind + 'Effect'] -}; -fx.push(propEffect); -return propEffect; -}, -createBindings: function (model) { -var fx$ = model._propertyEffects; -if (fx$) { -for (var n in fx$) { -var fx = fx$[n]; -fx.sort(this._sortPropertyEffects); -this._createAccessors(model, n, fx); -} -} -}, -_sortPropertyEffects: function () { -var EFFECT_ORDER = { -'compute': 0, -'annotation': 1, -'annotatedComputation': 2, -'reflect': 3, -'notify': 4, -'observer': 5, -'complexObserver': 6, -'function': 7 -}; -return function (a, b) { -return EFFECT_ORDER[a.kind] - EFFECT_ORDER[b.kind]; -}; -}(), -_createAccessors: function (model, property, effects) { -var defun = { -get: function () { -return this.__data__[property]; -} -}; -var setter = function (value) { -this._propertySetter(property, value, effects); -}; -var info = model.getPropertyInfo && model.getPropertyInfo(property); -if (info && info.readOnly) { -if (!info.computed) { -model['_set' + this.upper(property)] = setter; -} -} else { -defun.set = setter; -} -Object.defineProperty(model, property, defun); -}, -upper: function (name) { -return name[0].toUpperCase() + name.substring(1); -}, -_addAnnotatedListener: function (model, index, property, path, event, negated) { -if (!model._bindListeners) { -model._bindListeners = []; -} -var fn = this._notedListenerFactory(property, path, Polymer.Path.isDeep(path), negated); -var eventName = event || Polymer.CaseMap.camelToDashCase(property) + '-changed'; -model._bindListeners.push({ -index: index, -property: property, -path: path, -changedFn: fn, -event: eventName -}); -}, -_isEventBogus: function (e, target) { -return e.path && e.path[0] !== target; -}, -_notedListenerFactory: function (property, path, isStructured, negated) { -return function (target, value, targetPath) { -if (targetPath) { -var newPath = Polymer.Path.translate(property, path, targetPath); -this._notifyPath(newPath, value); -} else { -value = target[property]; -if (negated) { -value = !value; -} -if (!isStructured) { -this[path] = value; -} else { -if (this.__data__[path] != value) { -this.set(path, value); -} -} -} -}; -}, -prepareInstance: function (inst) { -inst.__data__ = Object.create(null); -}, -setupBindListeners: function (inst) { -var b$ = inst._bindListeners; -for (var i = 0, l = b$.length, info; i < l && (info = b$[i]); i++) { -var node = inst._nodes[info.index]; -this._addNotifyListener(node, inst, info.event, info.changedFn); -} -}, -_addNotifyListener: function (element, context, event, changedFn) { -element.addEventListener(event, function (e) { -return context._notifyListener(changedFn, e); -}); -} -};Polymer.Base.mixin(Polymer.Bind, { -_shouldAddListener: function (effect) { -return effect.name && effect.kind != 'attribute' && effect.kind != 'text' && !effect.isCompound && effect.parts[0].mode === '{'; -}, -_annotationEffect: function (source, value, effect) { -if (source != effect.value) { -value = this._get(effect.value); -this.__data__[effect.value] = value; -} -this._applyEffectValue(effect, value); -}, -_reflectEffect: function (source, value, effect) { -this.reflectPropertyToAttribute(source, effect.attribute, value); -}, -_notifyEffect: function (source, value, effect, old, fromAbove) { -if (!fromAbove) { -this._notifyChange(source, effect.event, value); -} -}, -_functionEffect: function (source, value, fn, old, fromAbove) { -fn.call(this, source, value, old, fromAbove); -}, -_observerEffect: function (source, value, effect, old) { -var fn = this[effect.method]; -if (fn) { -fn.call(this, value, old); -} else { -this._warn(this._logf('_observerEffect', 'observer method `' + effect.method + '` not defined')); -} -}, -_complexObserverEffect: function (source, value, effect) { -var fn = this[effect.method]; -if (fn) { -var args = Polymer.Bind._marshalArgs(this.__data__, effect, source, value); -if (args) { -fn.apply(this, args); -} -} else if (effect.dynamicFn) { -} else { -this._warn(this._logf('_complexObserverEffect', 'observer method `' + effect.method + '` not defined')); -} -}, -_computeEffect: function (source, value, effect) { -var fn = this[effect.method]; -if (fn) { -var args = Polymer.Bind._marshalArgs(this.__data__, effect, source, value); -if (args) { -var computedvalue = fn.apply(this, args); -this.__setProperty(effect.name, computedvalue); -} -} else if (effect.dynamicFn) { -} else { -this._warn(this._logf('_computeEffect', 'compute method `' + effect.method + '` not defined')); -} -}, -_annotatedComputationEffect: function (source, value, effect) { -var computedHost = this._rootDataHost || this; -var fn = computedHost[effect.method]; -if (fn) { -var args = Polymer.Bind._marshalArgs(this.__data__, effect, source, value); -if (args) { -var computedvalue = fn.apply(computedHost, args); -this._applyEffectValue(effect, computedvalue); -} -} else if (effect.dynamicFn) { -} else { -computedHost._warn(computedHost._logf('_annotatedComputationEffect', 'compute method `' + effect.method + '` not defined')); -} -}, -_marshalArgs: function (model, effect, path, value) { -var values = []; -var args = effect.args; -var bailoutEarly = args.length > 1 || effect.dynamicFn; -for (var i = 0, l = args.length; i < l; i++) { -var arg = args[i]; -var name = arg.name; -var v; -if (arg.literal) { -v = arg.value; -} else if (path === name) { -v = value; -} else { -v = model[name]; -if (v === undefined && arg.structured) { -v = Polymer.Base._get(name, model); -} -} -if (bailoutEarly && v === undefined) { -return; -} -if (arg.wildcard) { -var matches = Polymer.Path.isAncestor(path, name); -values[i] = { -path: matches ? path : name, -value: matches ? value : v, -base: v -}; -} else { -values[i] = v; -} -} -return values; -} -});Polymer.Base._addFeature({ -_addPropertyEffect: function (property, kind, effect) { -var prop = Polymer.Bind.addPropertyEffect(this, property, kind, effect); -prop.pathFn = this['_' + prop.kind + 'PathEffect']; -}, -_prepEffects: function () { -Polymer.Bind.prepareModel(this); -this._addAnnotationEffects(this._notes); -}, -_prepBindings: function () { -Polymer.Bind.createBindings(this); -}, -_addPropertyEffects: function (properties) { -if (properties) { -for (var p in properties) { -var prop = properties[p]; -if (prop.observer) { -this._addObserverEffect(p, prop.observer); -} -if (prop.computed) { -prop.readOnly = true; -this._addComputedEffect(p, prop.computed); -} -if (prop.notify) { -this._addPropertyEffect(p, 'notify', { event: Polymer.CaseMap.camelToDashCase(p) + '-changed' }); -} -if (prop.reflectToAttribute) { -var attr = Polymer.CaseMap.camelToDashCase(p); -if (attr[0] === '-') { -this._warn(this._logf('_addPropertyEffects', 'Property ' + p + ' cannot be reflected to attribute ' + attr + ' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.')); -} else { -this._addPropertyEffect(p, 'reflect', { attribute: attr }); -} -} -if (prop.readOnly) { -Polymer.Bind.ensurePropertyEffects(this, p); -} -} -} -}, -_addComputedEffect: function (name, expression) { -var sig = this._parseMethod(expression); -var dynamicFn = sig.dynamicFn; -for (var i = 0, arg; i < sig.args.length && (arg = sig.args[i]); i++) { -this._addPropertyEffect(arg.model, 'compute', { -method: sig.method, -args: sig.args, -trigger: arg, -name: name, -dynamicFn: dynamicFn -}); -} -if (dynamicFn) { -this._addPropertyEffect(sig.method, 'compute', { -method: sig.method, -args: sig.args, -trigger: null, -name: name, -dynamicFn: dynamicFn -}); -} -}, -_addObserverEffect: function (property, observer) { -this._addPropertyEffect(property, 'observer', { -method: observer, -property: property -}); -}, -_addComplexObserverEffects: function (observers) { -if (observers) { -for (var i = 0, o; i < observers.length && (o = observers[i]); i++) { -this._addComplexObserverEffect(o); -} -} -}, -_addComplexObserverEffect: function (observer) { -var sig = this._parseMethod(observer); -if (!sig) { -throw new Error('Malformed observer expression \'' + observer + '\''); -} -var dynamicFn = sig.dynamicFn; -for (var i = 0, arg; i < sig.args.length && (arg = sig.args[i]); i++) { -this._addPropertyEffect(arg.model, 'complexObserver', { -method: sig.method, -args: sig.args, -trigger: arg, -dynamicFn: dynamicFn -}); -} -if (dynamicFn) { -this._addPropertyEffect(sig.method, 'complexObserver', { -method: sig.method, -args: sig.args, -trigger: null, -dynamicFn: dynamicFn -}); -} -}, -_addAnnotationEffects: function (notes) { -for (var i = 0, note; i < notes.length && (note = notes[i]); i++) { -var b$ = note.bindings; -for (var j = 0, binding; j < b$.length && (binding = b$[j]); j++) { -this._addAnnotationEffect(binding, i); -} -} -}, -_addAnnotationEffect: function (note, index) { -if (Polymer.Bind._shouldAddListener(note)) { -Polymer.Bind._addAnnotatedListener(this, index, note.name, note.parts[0].value, note.parts[0].event, note.parts[0].negate); -} -for (var i = 0; i < note.parts.length; i++) { -var part = note.parts[i]; -if (part.signature) { -this._addAnnotatedComputationEffect(note, part, index); -} else if (!part.literal) { -if (note.kind === 'attribute' && note.name[0] === '-') { -this._warn(this._logf('_addAnnotationEffect', 'Cannot set attribute ' + note.name + ' because "-" is not a valid attribute starting character')); -} else { -this._addPropertyEffect(part.model, 'annotation', { -kind: note.kind, -index: index, -name: note.name, -propertyName: note.propertyName, -value: part.value, -isCompound: note.isCompound, -compoundIndex: part.compoundIndex, -event: part.event, -customEvent: part.customEvent, -negate: part.negate -}); -} -} -} -}, -_addAnnotatedComputationEffect: function (note, part, index) { -var sig = part.signature; -if (sig.static) { -this.__addAnnotatedComputationEffect('__static__', index, note, part, null); -} else { -for (var i = 0, arg; i < sig.args.length && (arg = sig.args[i]); i++) { -if (!arg.literal) { -this.__addAnnotatedComputationEffect(arg.model, index, note, part, arg); -} -} -if (sig.dynamicFn) { -this.__addAnnotatedComputationEffect(sig.method, index, note, part, null); -} -} -}, -__addAnnotatedComputationEffect: function (property, index, note, part, trigger) { -this._addPropertyEffect(property, 'annotatedComputation', { -index: index, -isCompound: note.isCompound, -compoundIndex: part.compoundIndex, -kind: note.kind, -name: note.name, -negate: part.negate, -method: part.signature.method, -args: part.signature.args, -trigger: trigger, -dynamicFn: part.signature.dynamicFn -}); -}, -_parseMethod: function (expression) { -var m = expression.match(/([^\s]+?)\(([\s\S]*)\)/); -if (m) { -var sig = { -method: m[1], -static: true -}; -if (this.getPropertyInfo(sig.method) !== Polymer.nob) { -sig.static = false; -sig.dynamicFn = true; -} -if (m[2].trim()) { -var args = m[2].replace(/\\,/g, ',').split(','); -return this._parseArgs(args, sig); -} else { -sig.args = Polymer.nar; -return sig; -} -} -}, -_parseArgs: function (argList, sig) { -sig.args = argList.map(function (rawArg) { -var arg = this._parseArg(rawArg); -if (!arg.literal) { -sig.static = false; -} -return arg; -}, this); -return sig; -}, -_parseArg: function (rawArg) { -var arg = rawArg.trim().replace(/,/g, ',').replace(/\\(.)/g, '$1'); -var a = { name: arg }; -var fc = arg[0]; -if (fc === '-') { -fc = arg[1]; -} -if (fc >= '0' && fc <= '9') { -fc = '#'; -} -switch (fc) { -case '\'': -case '"': -a.value = arg.slice(1, -1); -a.literal = true; -break; -case '#': -a.value = Number(arg); -a.literal = true; -break; -} -if (!a.literal) { -a.model = Polymer.Path.root(arg); -a.structured = Polymer.Path.isDeep(arg); -if (a.structured) { -a.wildcard = arg.slice(-2) == '.*'; -if (a.wildcard) { -a.name = arg.slice(0, -2); -} -} -} -return a; -}, -_marshalInstanceEffects: function () { -Polymer.Bind.prepareInstance(this); -if (this._bindListeners) { -Polymer.Bind.setupBindListeners(this); -} -}, -_applyEffectValue: function (info, value) { -var node = this._nodes[info.index]; -var property = info.name; -value = this._computeFinalAnnotationValue(node, property, value, info); -if (info.kind == 'attribute') { -this.serializeValueToAttribute(value, property, node); -} else { -var pinfo = node._propertyInfo && node._propertyInfo[property]; -if (pinfo && pinfo.readOnly) { -return; -} -this.__setProperty(property, value, Polymer.Settings.suppressBindingNotifications, node); -} -}, -_computeFinalAnnotationValue: function (node, property, value, info) { -if (info.negate) { -value = !value; -} -if (info.isCompound) { -var storage = node.__compoundStorage__[property]; -storage[info.compoundIndex] = value; -value = storage.join(''); -} -if (info.kind !== 'attribute') { -if (property === 'className') { -value = this._scopeElementClass(node, value); -} -if (property === 'textContent' || node.localName == 'input' && property == 'value') { -value = value == undefined ? '' : value; -} -} -return value; -}, -_executeStaticEffects: function () { -if (this._propertyEffects && this._propertyEffects.__static__) { -this._effectEffects('__static__', null, this._propertyEffects.__static__); -} -} -});(function () { -var usePolyfillProto = Polymer.Settings.usePolyfillProto; -var avoidInstanceProperties = Boolean(Object.getOwnPropertyDescriptor(document.documentElement, 'properties')); -Polymer.Base._addFeature({ -_setupConfigure: function (initialConfig) { -this._config = {}; -this._handlers = []; -this._aboveConfig = null; -if (initialConfig) { -for (var i in initialConfig) { -if (initialConfig[i] !== undefined) { -this._config[i] = initialConfig[i]; -} -} -} -}, -_marshalAttributes: function () { -this._takeAttributesToModel(this._config); -}, -_attributeChangedImpl: function (name) { -var model = this._clientsReadied ? this : this._config; -this._setAttributeToProperty(model, name); -}, -_configValue: function (name, value) { -var info = this._propertyInfo[name]; -if (!info || !info.readOnly) { -this._config[name] = value; -} -}, -_beforeClientsReady: function () { -this._configure(); -}, -_configure: function () { -this._configureAnnotationReferences(); -this._configureInstanceProperties(); -this._aboveConfig = this.mixin({}, this._config); -var config = {}; -for (var i = 0; i < this.behaviors.length; i++) { -this._configureProperties(this.behaviors[i].properties, config); -} -this._configureProperties(avoidInstanceProperties ? this.__proto__.properties : this.properties, config); -this.mixin(config, this._aboveConfig); -this._config = config; -if (this._clients && this._clients.length) { -this._distributeConfig(this._config); -} -}, -_configureInstanceProperties: function () { -for (var i in this._propertyEffects) { -if (!usePolyfillProto && this.hasOwnProperty(i)) { -this._configValue(i, this[i]); -delete this[i]; -} -} -}, -_configureProperties: function (properties, config) { -for (var i in properties) { -var c = properties[i]; -if (c.value !== undefined) { -var value = c.value; -if (typeof value == 'function') { -value = value.call(this, this._config); -} -config[i] = value; -} -} -}, -_distributeConfig: function (config) { -var fx$ = this._propertyEffects; -if (fx$) { -for (var p in config) { -var fx = fx$[p]; -if (fx) { -for (var i = 0, l = fx.length, x; i < l && (x = fx[i]); i++) { -if (x.kind === 'annotation') { -var node = this._nodes[x.effect.index]; -var name = x.effect.propertyName; -var isAttr = x.effect.kind == 'attribute'; -var hasEffect = node._propertyEffects && node._propertyEffects[name]; -if (node._configValue && (hasEffect || !isAttr)) { -var value = p === x.effect.value ? config[p] : this._get(x.effect.value, config); -value = this._computeFinalAnnotationValue(node, name, value, x.effect); -if (isAttr) { -value = node.deserialize(this.serialize(value), node._propertyInfo[name].type); -} -node._configValue(name, value); -} -} -} -} -} -} -}, -_afterClientsReady: function () { -this.importPath = this._importPath; -this.rootPath = Polymer.rootPath; -this._executeStaticEffects(); -this._applyConfig(this._config, this._aboveConfig); -this._flushHandlers(); -}, -_applyConfig: function (config, aboveConfig) { -for (var n in config) { -if (this[n] === undefined) { -this.__setProperty(n, config[n], n in aboveConfig); -} -} -}, -_notifyListener: function (fn, e) { -if (!Polymer.Bind._isEventBogus(e, e.target)) { -var value, path; -if (e.detail) { -value = e.detail.value; -path = e.detail.path; -} -if (!this._clientsReadied) { -this._queueHandler([ -fn, -e.target, -value, -path -]); -} else { -return fn.call(this, e.target, value, path); -} -} -}, -_queueHandler: function (args) { -this._handlers.push(args); -}, -_flushHandlers: function () { -var h$ = this._handlers; -for (var i = 0, l = h$.length, h; i < l && (h = h$[i]); i++) { -h[0].call(this, h[1], h[2], h[3]); -} -this._handlers = []; -} -}); -}());(function () { -'use strict'; -var Path = Polymer.Path; -Polymer.Base._addFeature({ -notifyPath: function (path, value, fromAbove) { -var info = {}; -var v = this._get(path, this, info); -if (arguments.length === 1) { -value = v; -} -if (info.path) { -this._notifyPath(info.path, value, fromAbove); -} -}, -_notifyPath: function (path, value, fromAbove) { -var old = this._propertySetter(path, value); -if (old !== value && (old === old || value === value)) { -this._pathEffector(path, value); -if (!fromAbove) { -this._notifyPathUp(path, value); -} -return true; -} -}, -_getPathParts: function (path) { -if (Array.isArray(path)) { -var parts = []; -for (var i = 0; i < path.length; i++) { -var args = path[i].toString().split('.'); -for (var j = 0; j < args.length; j++) { -parts.push(args[j]); -} -} -return parts; -} else { -return path.toString().split('.'); -} -}, -set: function (path, value, root) { -var prop = root || this; -var parts = this._getPathParts(path); -var array; -var last = parts[parts.length - 1]; -if (parts.length > 1) { -for (var i = 0; i < parts.length - 1; i++) { -var part = parts[i]; -if (array && part[0] == '#') { -prop = Polymer.Collection.get(array).getItem(part); -} else { -prop = prop[part]; -if (array && parseInt(part, 10) == part) { -parts[i] = Polymer.Collection.get(array).getKey(prop); -} -} -if (!prop) { -return; -} -array = Array.isArray(prop) ? prop : null; -} -if (array) { -var coll = Polymer.Collection.get(array); -var old, key; -if (last[0] == '#') { -key = last; -old = coll.getItem(key); -last = array.indexOf(old); -coll.setItem(key, value); -} else if (parseInt(last, 10) == last) { -old = prop[last]; -key = coll.getKey(old); -parts[i] = key; -coll.setItem(key, value); -} -} -prop[last] = value; -if (!root) { -this._notifyPath(parts.join('.'), value); -} -} else { -prop[path] = value; -} -}, -get: function (path, root) { -return this._get(path, root); -}, -_get: function (path, root, info) { -var prop = root || this; -var parts = this._getPathParts(path); -var array; -for (var i = 0; i < parts.length; i++) { -if (!prop) { -return; -} -var part = parts[i]; -if (array && part[0] == '#') { -prop = Polymer.Collection.get(array).getItem(part); -} else { -prop = prop[part]; -if (info && array && parseInt(part, 10) == part) { -parts[i] = Polymer.Collection.get(array).getKey(prop); -} -} -array = Array.isArray(prop) ? prop : null; -} -if (info) { -info.path = parts.join('.'); -} -return prop; -}, -_pathEffector: function (path, value) { -var model = Path.root(path); -var fx$ = this._propertyEffects && this._propertyEffects[model]; -if (fx$) { -for (var i = 0, fx; i < fx$.length && (fx = fx$[i]); i++) { -var fxFn = fx.pathFn; -if (fxFn) { -fxFn.call(this, path, value, fx.effect); -} -} -} -if (this._boundPaths) { -this._notifyBoundPaths(path, value); -} -}, -_annotationPathEffect: function (path, value, effect) { -if (Path.matches(effect.value, false, path)) { -Polymer.Bind._annotationEffect.call(this, path, value, effect); -} else if (!effect.negate && Path.isDescendant(effect.value, path)) { -var node = this._nodes[effect.index]; -if (node && node._notifyPath) { -var newPath = Path.translate(effect.value, effect.name, path); -node._notifyPath(newPath, value, true); -} -} -}, -_complexObserverPathEffect: function (path, value, effect) { -if (Path.matches(effect.trigger.name, effect.trigger.wildcard, path)) { -Polymer.Bind._complexObserverEffect.call(this, path, value, effect); -} -}, -_computePathEffect: function (path, value, effect) { -if (Path.matches(effect.trigger.name, effect.trigger.wildcard, path)) { -Polymer.Bind._computeEffect.call(this, path, value, effect); -} -}, -_annotatedComputationPathEffect: function (path, value, effect) { -if (Path.matches(effect.trigger.name, effect.trigger.wildcard, path)) { -Polymer.Bind._annotatedComputationEffect.call(this, path, value, effect); -} -}, -linkPaths: function (to, from) { -this._boundPaths = this._boundPaths || {}; -if (from) { -this._boundPaths[to] = from; -} else { -this.unlinkPaths(to); -} -}, -unlinkPaths: function (path) { -if (this._boundPaths) { -delete this._boundPaths[path]; -} -}, -_notifyBoundPaths: function (path, value) { -for (var a in this._boundPaths) { -var b = this._boundPaths[a]; -if (Path.isDescendant(a, path)) { -this._notifyPath(Path.translate(a, b, path), value); -} else if (Path.isDescendant(b, path)) { -this._notifyPath(Path.translate(b, a, path), value); -} -} -}, -_notifyPathUp: function (path, value) { -var rootName = Path.root(path); -var dashCaseName = Polymer.CaseMap.camelToDashCase(rootName); -var eventName = dashCaseName + this._EVENT_CHANGED; -this.fire(eventName, { -path: path, -value: value -}, { -bubbles: false, -_useCache: Polymer.Settings.eventDataCache || !Polymer.Settings.isIE -}); -}, -_EVENT_CHANGED: '-changed', -notifySplices: function (path, splices) { -var info = {}; -var array = this._get(path, this, info); -this._notifySplices(array, info.path, splices); -}, -_notifySplices: function (array, path, splices) { -var change = { -keySplices: Polymer.Collection.applySplices(array, splices), -indexSplices: splices -}; -var splicesPath = path + '.splices'; -this._notifyPath(splicesPath, change); -this._notifyPath(path + '.length', array.length); -this.__data__[splicesPath] = { -keySplices: null, -indexSplices: null -}; -}, -_notifySplice: function (array, path, index, added, removed) { -this._notifySplices(array, path, [{ -index: index, -addedCount: added, -removed: removed, -object: array, -type: 'splice' -}]); -}, -push: function (path) { -var info = {}; -var array = this._get(path, this, info); -var args = Array.prototype.slice.call(arguments, 1); -var len = array.length; -var ret = array.push.apply(array, args); -if (args.length) { -this._notifySplice(array, info.path, len, args.length, []); -} -return ret; -}, -pop: function (path) { -var info = {}; -var array = this._get(path, this, info); -var hadLength = Boolean(array.length); -var args = Array.prototype.slice.call(arguments, 1); -var ret = array.pop.apply(array, args); -if (hadLength) { -this._notifySplice(array, info.path, array.length, 0, [ret]); -} -return ret; -}, -splice: function (path, start) { -var info = {}; -var array = this._get(path, this, info); -if (start < 0) { -start = array.length - Math.floor(-start); -} else { -start = Math.floor(start); -} -if (!start) { -start = 0; -} -var args = Array.prototype.slice.call(arguments, 1); -var ret = array.splice.apply(array, args); -var addedCount = Math.max(args.length - 2, 0); -if (addedCount || ret.length) { -this._notifySplice(array, info.path, start, addedCount, ret); -} -return ret; -}, -shift: function (path) { -var info = {}; -var array = this._get(path, this, info); -var hadLength = Boolean(array.length); -var args = Array.prototype.slice.call(arguments, 1); -var ret = array.shift.apply(array, args); -if (hadLength) { -this._notifySplice(array, info.path, 0, 0, [ret]); -} -return ret; -}, -unshift: function (path) { -var info = {}; -var array = this._get(path, this, info); -var args = Array.prototype.slice.call(arguments, 1); -var ret = array.unshift.apply(array, args); -if (args.length) { -this._notifySplice(array, info.path, 0, args.length, []); -} -return ret; -}, -prepareModelNotifyPath: function (model) { -this.mixin(model, { -fire: Polymer.Base.fire, -_getEvent: Polymer.Base._getEvent, -__eventCache: Polymer.Base.__eventCache, -notifyPath: Polymer.Base.notifyPath, -_get: Polymer.Base._get, -_EVENT_CHANGED: Polymer.Base._EVENT_CHANGED, -_notifyPath: Polymer.Base._notifyPath, -_notifyPathUp: Polymer.Base._notifyPathUp, -_pathEffector: Polymer.Base._pathEffector, -_annotationPathEffect: Polymer.Base._annotationPathEffect, -_complexObserverPathEffect: Polymer.Base._complexObserverPathEffect, -_annotatedComputationPathEffect: Polymer.Base._annotatedComputationPathEffect, -_computePathEffect: Polymer.Base._computePathEffect, -_notifyBoundPaths: Polymer.Base._notifyBoundPaths, -_getPathParts: Polymer.Base._getPathParts -}); -} -}); -}());Polymer.Base._addFeature({ -resolveUrl: function (url) { -return Polymer.ResolveUrl.resolveUrl(url, this._importPath); -} -});Polymer.CssParse = function () { -return { -parse: function (text) { -text = this._clean(text); -return this._parseCss(this._lex(text), text); -}, -_clean: function (cssText) { -return cssText.replace(this._rx.comments, '').replace(this._rx.port, ''); -}, -_lex: function (text) { -var root = { -start: 0, -end: text.length -}; -var n = root; -for (var i = 0, l = text.length; i < l; i++) { -switch (text[i]) { -case this.OPEN_BRACE: -if (!n.rules) { -n.rules = []; -} -var p = n; -var previous = p.rules[p.rules.length - 1]; -n = { -start: i + 1, -parent: p, -previous: previous -}; -p.rules.push(n); -break; -case this.CLOSE_BRACE: -n.end = i + 1; -n = n.parent || root; -break; -} -} -return root; -}, -_parseCss: function (node, text) { -var t = text.substring(node.start, node.end - 1); -node.parsedCssText = node.cssText = t.trim(); -if (node.parent) { -var ss = node.previous ? node.previous.end : node.parent.start; -t = text.substring(ss, node.start - 1); -t = this._expandUnicodeEscapes(t); -t = t.replace(this._rx.multipleSpaces, ' '); -t = t.substring(t.lastIndexOf(';') + 1); -var s = node.parsedSelector = node.selector = t.trim(); -node.atRule = s.indexOf(this.AT_START) === 0; -if (node.atRule) { -if (s.indexOf(this.MEDIA_START) === 0) { -node.type = this.types.MEDIA_RULE; -} else if (s.match(this._rx.keyframesRule)) { -node.type = this.types.KEYFRAMES_RULE; -node.keyframesName = node.selector.split(this._rx.multipleSpaces).pop(); -} -} else { -if (s.indexOf(this.VAR_START) === 0) { -node.type = this.types.MIXIN_RULE; -} else { -node.type = this.types.STYLE_RULE; -} -} -} -var r$ = node.rules; -if (r$) { -for (var i = 0, l = r$.length, r; i < l && (r = r$[i]); i++) { -this._parseCss(r, text); -} -} -return node; -}, -_expandUnicodeEscapes: function (s) { -return s.replace(/\\([0-9a-f]{1,6})\s/gi, function () { -var code = arguments[1], repeat = 6 - code.length; -while (repeat--) { -code = '0' + code; -} -return '\\' + code; -}); -}, -stringify: function (node, preserveProperties, text) { -text = text || ''; -var cssText = ''; -if (node.cssText || node.rules) { -var r$ = node.rules; -if (r$ && !this._hasMixinRules(r$)) { -for (var i = 0, l = r$.length, r; i < l && (r = r$[i]); i++) { -cssText = this.stringify(r, preserveProperties, cssText); -} -} else { -cssText = preserveProperties ? node.cssText : this.removeCustomProps(node.cssText); -cssText = cssText.trim(); -if (cssText) { -cssText = ' ' + cssText + '\n'; -} -} -} -if (cssText) { -if (node.selector) { -text += node.selector + ' ' + this.OPEN_BRACE + '\n'; -} -text += cssText; -if (node.selector) { -text += this.CLOSE_BRACE + '\n\n'; -} -} -return text; -}, -_hasMixinRules: function (rules) { -return rules[0].selector.indexOf(this.VAR_START) === 0; -}, -removeCustomProps: function (cssText) { -cssText = this.removeCustomPropAssignment(cssText); -return this.removeCustomPropApply(cssText); -}, -removeCustomPropAssignment: function (cssText) { -return cssText.replace(this._rx.customProp, '').replace(this._rx.mixinProp, ''); -}, -removeCustomPropApply: function (cssText) { -return cssText.replace(this._rx.mixinApply, '').replace(this._rx.varApply, ''); -}, -types: { -STYLE_RULE: 1, -KEYFRAMES_RULE: 7, -MEDIA_RULE: 4, -MIXIN_RULE: 1000 -}, -OPEN_BRACE: '{', -CLOSE_BRACE: '}', -_rx: { -comments: /\/\*[^*]*\*+([^\/*][^*]*\*+)*\//gim, -port: /@import[^;]*;/gim, -customProp: /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim, -mixinProp: /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim, -mixinApply: /@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim, -varApply: /[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim, -keyframesRule: /^@[^\s]*keyframes/, -multipleSpaces: /\s+/g -}, -VAR_START: '--', -MEDIA_START: '@media', -AT_START: '@' -}; -}();Polymer.StyleUtil = function () { -var settings = Polymer.Settings; -return { -unscopedStyleImports: new WeakMap(), -SHADY_UNSCOPED_ATTR: 'shady-unscoped', -NATIVE_VARIABLES: Polymer.Settings.useNativeCSSProperties, -MODULE_STYLES_SELECTOR: 'style, link[rel=import][type~=css], template', -INCLUDE_ATTR: 'include', -toCssText: function (rules, callback) { -if (typeof rules === 'string') { -rules = this.parser.parse(rules); -} -if (callback) { -this.forEachRule(rules, callback); -} -return this.parser.stringify(rules, this.NATIVE_VARIABLES); -}, -forRulesInStyles: function (styles, styleRuleCallback, keyframesRuleCallback) { -if (styles) { -for (var i = 0, l = styles.length, s; i < l && (s = styles[i]); i++) { -this.forEachRuleInStyle(s, styleRuleCallback, keyframesRuleCallback); -} -} -}, -forActiveRulesInStyles: function (styles, styleRuleCallback, keyframesRuleCallback) { -if (styles) { -for (var i = 0, l = styles.length, s; i < l && (s = styles[i]); i++) { -this.forEachRuleInStyle(s, styleRuleCallback, keyframesRuleCallback, true); -} -} -}, -rulesForStyle: function (style) { -if (!style.__cssRules && style.textContent) { -style.__cssRules = this.parser.parse(style.textContent); -} -return style.__cssRules; -}, -isKeyframesSelector: function (rule) { -return rule.parent && rule.parent.type === this.ruleTypes.KEYFRAMES_RULE; -}, -forEachRuleInStyle: function (style, styleRuleCallback, keyframesRuleCallback, onlyActiveRules) { -var rules = this.rulesForStyle(style); -var styleCallback, keyframeCallback; -if (styleRuleCallback) { -styleCallback = function (rule) { -styleRuleCallback(rule, style); -}; -} -if (keyframesRuleCallback) { -keyframeCallback = function (rule) { -keyframesRuleCallback(rule, style); -}; -} -this.forEachRule(rules, styleCallback, keyframeCallback, onlyActiveRules); -}, -forEachRule: function (node, styleRuleCallback, keyframesRuleCallback, onlyActiveRules) { -if (!node) { -return; -} -var skipRules = false; -if (onlyActiveRules) { -if (node.type === this.ruleTypes.MEDIA_RULE) { -var matchMedia = node.selector.match(this.rx.MEDIA_MATCH); -if (matchMedia) { -if (!window.matchMedia(matchMedia[1]).matches) { -skipRules = true; -} -} -} -} -if (node.type === this.ruleTypes.STYLE_RULE) { -styleRuleCallback(node); -} else if (keyframesRuleCallback && node.type === this.ruleTypes.KEYFRAMES_RULE) { -keyframesRuleCallback(node); -} else if (node.type === this.ruleTypes.MIXIN_RULE) { -skipRules = true; -} -var r$ = node.rules; -if (r$ && !skipRules) { -for (var i = 0, l = r$.length, r; i < l && (r = r$[i]); i++) { -this.forEachRule(r, styleRuleCallback, keyframesRuleCallback, onlyActiveRules); -} -} -}, -applyCss: function (cssText, moniker, target, contextNode) { -var style = this.createScopeStyle(cssText, moniker); -return this.applyStyle(style, target, contextNode); -}, -applyStyle: function (style, target, contextNode) { -target = target || document.head; -var after = contextNode && contextNode.nextSibling || target.firstChild; -this.__lastHeadApplyNode = style; -return target.insertBefore(style, after); -}, -createScopeStyle: function (cssText, moniker) { -var style = document.createElement('style'); -if (moniker) { -style.setAttribute('scope', moniker); -} -style.textContent = cssText; -return style; -}, -__lastHeadApplyNode: null, -applyStylePlaceHolder: function (moniker) { -var placeHolder = document.createComment(' Shady DOM styles for ' + moniker + ' '); -var after = this.__lastHeadApplyNode ? this.__lastHeadApplyNode.nextSibling : null; -var scope = document.head; -scope.insertBefore(placeHolder, after || scope.firstChild); -this.__lastHeadApplyNode = placeHolder; -return placeHolder; -}, -cssFromModules: function (moduleIds, warnIfNotFound) { -var modules = moduleIds.trim().split(/\s+/); -var cssText = ''; -for (var i = 0; i < modules.length; i++) { -cssText += this.cssFromModule(modules[i], warnIfNotFound); -} -return cssText; -}, -cssFromModule: function (moduleId, warnIfNotFound) { -var m = Polymer.DomModule.import(moduleId); -if (m && !m._cssText) { -m._cssText = this.cssFromElement(m); -} -if (!m && warnIfNotFound) { -console.warn('Could not find style data in module named', moduleId); -} -return m && m._cssText || ''; -}, -cssFromElement: function (element) { -var cssText = ''; -var content = element.content || element; -var e$ = Polymer.TreeApi.arrayCopy(content.querySelectorAll(this.MODULE_STYLES_SELECTOR)); -for (var i = 0, e; i < e$.length; i++) { -e = e$[i]; -if (e.localName === 'template') { -if (!e.hasAttribute('preserve-content')) { -cssText += this.cssFromElement(e); -} -} else { -if (e.localName === 'style') { -var include = e.getAttribute(this.INCLUDE_ATTR); -if (include) { -cssText += this.cssFromModules(include, true); -} -e = e.__appliedElement || e; -e.parentNode.removeChild(e); -var css = this.resolveCss(e.textContent, element.ownerDocument); -if (!settings.useNativeShadow && e.hasAttribute(this.SHADY_UNSCOPED_ATTR)) { -e.textContent = css; -document.head.insertBefore(e, document.head.firstChild); -} else { -cssText += css; -} -} else if (e.import && e.import.body) { -var importCss = this.resolveCss(e.import.body.textContent, e.import); -if (!settings.useNativeShadow && e.hasAttribute(this.SHADY_UNSCOPED_ATTR)) { -if (!this.unscopedStyleImports.has(e.import)) { -this.unscopedStyleImports.set(e.import, true); -var importStyle = document.createElement('style'); -importStyle.setAttribute(this.SHADY_UNSCOPED_ATTR, ''); -importStyle.textContent = importCss; -document.head.insertBefore(importStyle, document.head.firstChild); -} -} else { -cssText += importCss; -} -} -} -} -return cssText; -}, -styleIncludesToTemplate: function (targetTemplate) { -var styles = targetTemplate.content.querySelectorAll('style[include]'); -for (var i = 0, s; i < styles.length; i++) { -s = styles[i]; -s.parentNode.insertBefore(this._includesToFragment(s.getAttribute('include')), s); -} -}, -_includesToFragment: function (styleIncludes) { -var includeArray = styleIncludes.trim().split(' '); -var frag = document.createDocumentFragment(); -for (var i = 0; i < includeArray.length; i++) { -var t = Polymer.DomModule.import(includeArray[i], 'template'); -if (t) { -this._addStylesToFragment(frag, t.content); -} -} -return frag; -}, -_addStylesToFragment: function (frag, source) { -var s$ = source.querySelectorAll('style'); -for (var i = 0, s; i < s$.length; i++) { -s = s$[i]; -var include = s.getAttribute('include'); -if (include) { -frag.appendChild(this._includesToFragment(include)); -} -if (s.textContent) { -frag.appendChild(s.cloneNode(true)); -} -} -}, -isTargetedBuild: function (buildType) { -return settings.useNativeShadow ? buildType === 'shadow' : buildType === 'shady'; -}, -cssBuildTypeForModule: function (module) { -var dm = Polymer.DomModule.import(module); -if (dm) { -return this.getCssBuildType(dm); -} -}, -getCssBuildType: function (element) { -return element.getAttribute('css-build'); -}, -_findMatchingParen: function (text, start) { -var level = 0; -for (var i = start, l = text.length; i < l; i++) { -switch (text[i]) { -case '(': -level++; -break; -case ')': -if (--level === 0) { -return i; -} -break; -} -} -return -1; -}, -processVariableAndFallback: function (str, callback) { -var start = str.indexOf('var('); -if (start === -1) { -return callback(str, '', '', ''); -} -var end = this._findMatchingParen(str, start + 3); -var inner = str.substring(start + 4, end); -var prefix = str.substring(0, start); -var suffix = this.processVariableAndFallback(str.substring(end + 1), callback); -var comma = inner.indexOf(','); -if (comma === -1) { -return callback(prefix, inner.trim(), '', suffix); -} -var value = inner.substring(0, comma).trim(); -var fallback = inner.substring(comma + 1).trim(); -return callback(prefix, value, fallback, suffix); -}, -rx: { -VAR_ASSIGN: /(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:([^;{]*)|{([^}]*)})(?:(?=[;\s}])|$)/gi, -MIXIN_MATCH: /(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi, -VAR_CONSUMED: /(--[\w-]+)\s*([:,;)]|$)/gi, -ANIMATION_MATCH: /(animation\s*:)|(animation-name\s*:)/, -MEDIA_MATCH: /@media[^(]*(\([^)]*\))/, -IS_VAR: /^--/, -BRACKETED: /\{[^}]*\}/g, -HOST_PREFIX: '(?:^|[^.#[:])', -HOST_SUFFIX: '($|[.:[\\s>+~])' -}, -resolveCss: Polymer.ResolveUrl.resolveCss, -parser: Polymer.CssParse, -ruleTypes: Polymer.CssParse.types -}; -}();Polymer.StyleTransformer = function () { -var styleUtil = Polymer.StyleUtil; -var settings = Polymer.Settings; -var api = { -dom: function (node, scope, useAttr, shouldRemoveScope) { -this._transformDom(node, scope || '', useAttr, shouldRemoveScope); -}, -_transformDom: function (node, selector, useAttr, shouldRemoveScope) { -if (node.setAttribute) { -this.element(node, selector, useAttr, shouldRemoveScope); -} -var c$ = Polymer.dom(node).childNodes; -for (var i = 0; i < c$.length; i++) { -this._transformDom(c$[i], selector, useAttr, shouldRemoveScope); -} -}, -element: function (element, scope, useAttr, shouldRemoveScope) { -if (useAttr) { -if (shouldRemoveScope) { -element.removeAttribute(SCOPE_NAME); -} else { -element.setAttribute(SCOPE_NAME, scope); -} -} else { -if (scope) { -if (element.classList) { -if (shouldRemoveScope) { -element.classList.remove(SCOPE_NAME); -element.classList.remove(scope); -} else { -element.classList.add(SCOPE_NAME); -element.classList.add(scope); -} -} else if (element.getAttribute) { -var c = element.getAttribute(CLASS); -if (shouldRemoveScope) { -if (c) { -element.setAttribute(CLASS, c.replace(SCOPE_NAME, '').replace(scope, '')); -} -} else { -element.setAttribute(CLASS, (c ? c + ' ' : '') + SCOPE_NAME + ' ' + scope); -} -} -} -} -}, -elementStyles: function (element, callback) { -var styles = element._styles; -var cssText = ''; -var cssBuildType = element.__cssBuild; -var passthrough = settings.useNativeShadow || cssBuildType === 'shady'; -var cb; -if (passthrough) { -var self = this; -cb = function (rule) { -rule.selector = self._slottedToContent(rule.selector); -rule.selector = rule.selector.replace(ROOT, ':host > *'); -rule.selector = self._dirShadowTransform(rule.selector); -if (callback) { -callback(rule); -} -}; -} -for (var i = 0, l = styles.length, s; i < l && (s = styles[i]); i++) { -var rules = styleUtil.rulesForStyle(s); -cssText += passthrough ? styleUtil.toCssText(rules, cb) : this.css(rules, element.is, element.extends, callback, element._scopeCssViaAttr) + '\n\n'; -} -return cssText.trim(); -}, -css: function (rules, scope, ext, callback, useAttr) { -var hostScope = this._calcHostScope(scope, ext); -scope = this._calcElementScope(scope, useAttr); -var self = this; -return styleUtil.toCssText(rules, function (rule) { -if (!rule.isScoped) { -self.rule(rule, scope, hostScope); -rule.isScoped = true; -} -if (callback) { -callback(rule, scope, hostScope); -} -}); -}, -_calcElementScope: function (scope, useAttr) { -if (scope) { -return useAttr ? CSS_ATTR_PREFIX + scope + CSS_ATTR_SUFFIX : CSS_CLASS_PREFIX + scope; -} else { -return ''; -} -}, -_calcHostScope: function (scope, ext) { -return ext ? '[is=' + scope + ']' : scope; -}, -rule: function (rule, scope, hostScope) { -this._transformRule(rule, this._transformComplexSelector, scope, hostScope); -}, -_transformRule: function (rule, transformer, scope, hostScope) { -rule.selector = rule.transformedSelector = this._transformRuleCss(rule, transformer, scope, hostScope); -}, -_splitSelectorList: function (selector) { -var parts = []; -var part = ''; -for (var i = 0; i >= 0 && i < selector.length; i++) { -if (selector[i] === '(') { -var end = styleUtil._findMatchingParen(selector, i); -part += selector.slice(i, end + 1); -i = end; -} else if (selector[i] === COMPLEX_SELECTOR_SEP) { -parts.push(part); -part = ''; -} else { -part += selector[i]; -} -} -if (part) { -parts.push(part); -} -if (parts.length === 0) { -parts.push(selector); -} -return parts; -}, -_transformRuleCss: function (rule, transformer, scope, hostScope) { -var p$ = this._splitSelectorList(rule.selector); -if (!styleUtil.isKeyframesSelector(rule)) { -for (var i = 0, l = p$.length, p; i < l && (p = p$[i]); i++) { -p$[i] = transformer.call(this, p, scope, hostScope); -} -} -return p$.join(COMPLEX_SELECTOR_SEP); -}, -_ensureScopedDir: function (s) { -var m = s.match(DIR_PAREN); -if (m && m[1] === '' && m[0].length === s.length) { -s = '*' + s; -} -return s; -}, -_additionalDirSelectors: function (dir, after, prefix) { -if (!dir || !after) { -return ''; -} -prefix = prefix || ''; -return COMPLEX_SELECTOR_SEP + prefix + ' ' + dir + ' ' + after; -}, -_transformComplexSelector: function (selector, scope, hostScope) { -var stop = false; -var hostContext = false; -var dir = false; -var self = this; -selector = selector.trim(); -selector = this._slottedToContent(selector); -selector = selector.replace(ROOT, ':host > *'); -selector = selector.replace(CONTENT_START, HOST + ' $1'); -selector = this._ensureScopedDir(selector); -selector = selector.replace(SIMPLE_SELECTOR_SEP, function (m, c, s) { -if (!stop) { -var info = self._transformCompoundSelector(s, c, scope, hostScope); -stop = stop || info.stop; -hostContext = hostContext || info.hostContext; -dir = dir || info.dir; -c = info.combinator; -s = info.value; -} else { -s = s.replace(SCOPE_JUMP, ' '); -} -return c + s; -}); -if (hostContext) { -selector = selector.replace(HOST_CONTEXT_PAREN, function (m, pre, paren, post) { -var replacement = pre + paren + ' ' + hostScope + post + COMPLEX_SELECTOR_SEP + ' ' + pre + hostScope + paren + post; -if (dir) { -replacement += self._additionalDirSelectors(paren, post, hostScope); -} -return replacement; -}); -} -return selector; -}, -_transformDir: function (s) { -s = s.replace(HOST_DIR, HOST_DIR_REPLACE); -s = s.replace(DIR_PAREN, DIR_REPLACE); -return s; -}, -_transformCompoundSelector: function (selector, combinator, scope, hostScope) { -var jumpIndex = selector.search(SCOPE_JUMP); -var hostContext = false; -var dir = false; -if (selector.match(DIR_PAREN)) { -selector = this._transformDir(selector); -dir = true; -} -if (selector.indexOf(HOST_CONTEXT) >= 0) { -hostContext = true; -} else if (selector.indexOf(HOST) >= 0) { -selector = this._transformHostSelector(selector, hostScope); -} else if (jumpIndex !== 0) { -selector = scope ? this._transformSimpleSelector(selector, scope) : selector; -} -if (selector.indexOf(CONTENT) >= 0) { -combinator = ''; -} -var stop; -if (jumpIndex >= 0) { -selector = selector.replace(SCOPE_JUMP, ' '); -stop = true; -} -return { -value: selector, -combinator: combinator, -stop: stop, -hostContext: hostContext, -dir: dir -}; -}, -_transformSimpleSelector: function (selector, scope) { -var p$ = selector.split(PSEUDO_PREFIX); -p$[0] += scope; -return p$.join(PSEUDO_PREFIX); -}, -_transformHostSelector: function (selector, hostScope) { -var m = selector.match(HOST_PAREN); -var paren = m && m[2].trim() || ''; -if (paren) { -if (!paren[0].match(SIMPLE_SELECTOR_PREFIX)) { -var typeSelector = paren.split(SIMPLE_SELECTOR_PREFIX)[0]; -if (typeSelector === hostScope) { -return paren; -} else { -return SELECTOR_NO_MATCH; -} -} else { -return selector.replace(HOST_PAREN, function (m, host, paren) { -return hostScope + paren; -}); -} -} else { -return selector.replace(HOST, hostScope); -} -}, -documentRule: function (rule) { -rule.selector = rule.parsedSelector; -this.normalizeRootSelector(rule); -if (!settings.useNativeShadow) { -this._transformRule(rule, this._transformDocumentSelector); -} -}, -normalizeRootSelector: function (rule) { -rule.selector = rule.selector.replace(ROOT, 'html'); -var parts = this._splitSelectorList(rule.selector); -parts = parts.filter(function (part) { -return !part.match(HOST_OR_HOST_GT_STAR); -}); -rule.selector = parts.join(COMPLEX_SELECTOR_SEP); -}, -_transformDocumentSelector: function (selector) { -return this._transformComplexSelector(selector, SCOPE_DOC_SELECTOR); -}, -_slottedToContent: function (cssText) { -return cssText.replace(SLOTTED_PAREN, CONTENT + '> $1'); -}, -_dirShadowTransform: function (selector) { -if (!selector.match(/:dir\(/)) { -return selector; -} -return this._splitSelectorList(selector).map(function (s) { -s = this._ensureScopedDir(s); -s = this._transformDir(s); -var m = HOST_CONTEXT_PAREN.exec(s); -if (m) { -s += this._additionalDirSelectors(m[2], m[3], ''); -} -return s; -}, this).join(COMPLEX_SELECTOR_SEP); -}, -SCOPE_NAME: 'style-scope' -}; -var SCOPE_NAME = api.SCOPE_NAME; -var SCOPE_DOC_SELECTOR = ':not([' + SCOPE_NAME + '])' + ':not(.' + SCOPE_NAME + ')'; -var COMPLEX_SELECTOR_SEP = ','; -var SIMPLE_SELECTOR_SEP = /(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=\[])+)/g; -var SIMPLE_SELECTOR_PREFIX = /[[.:#*]/; -var HOST = ':host'; -var ROOT = ':root'; -var HOST_PAREN = /(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/; -var HOST_CONTEXT = ':host-context'; -var HOST_CONTEXT_PAREN = /(.*)(?::host-context)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))(.*)/; -var CONTENT = '::content'; -var SCOPE_JUMP = /::content|::shadow|\/deep\//; -var CSS_CLASS_PREFIX = '.'; -var CSS_ATTR_PREFIX = '[' + SCOPE_NAME + '~='; -var CSS_ATTR_SUFFIX = ']'; -var PSEUDO_PREFIX = ':'; -var CLASS = 'class'; -var CONTENT_START = new RegExp('^(' + CONTENT + ')'); -var SELECTOR_NO_MATCH = 'should_not_match'; -var SLOTTED_PAREN = /(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/g; -var HOST_OR_HOST_GT_STAR = /:host(?:\s*>\s*\*)?/; -var DIR_PAREN = /(.*):dir\((ltr|rtl)\)/; -var DIR_REPLACE = ':host-context([dir="$2"]) $1'; -var HOST_DIR = /:host\(:dir\((rtl|ltr)\)\)/g; -var HOST_DIR_REPLACE = ':host-context([dir="$1"])'; -return api; -}();Polymer.StyleExtends = function () { -var styleUtil = Polymer.StyleUtil; -return { -hasExtends: function (cssText) { -return Boolean(cssText.match(this.rx.EXTEND)); -}, -transform: function (style) { -var rules = styleUtil.rulesForStyle(style); -var self = this; -styleUtil.forEachRule(rules, function (rule) { -self._mapRuleOntoParent(rule); -if (rule.parent) { -var m; -while (m = self.rx.EXTEND.exec(rule.cssText)) { -var extend = m[1]; -var extendor = self._findExtendor(extend, rule); -if (extendor) { -self._extendRule(rule, extendor); -} -} -} -rule.cssText = rule.cssText.replace(self.rx.EXTEND, ''); -}); -return styleUtil.toCssText(rules, function (rule) { -if (rule.selector.match(self.rx.STRIP)) { -rule.cssText = ''; -} -}, true); -}, -_mapRuleOntoParent: function (rule) { -if (rule.parent) { -var map = rule.parent.map || (rule.parent.map = {}); -var parts = rule.selector.split(','); -for (var i = 0, p; i < parts.length; i++) { -p = parts[i]; -map[p.trim()] = rule; -} -return map; -} -}, -_findExtendor: function (extend, rule) { -return rule.parent && rule.parent.map && rule.parent.map[extend] || this._findExtendor(extend, rule.parent); -}, -_extendRule: function (target, source) { -if (target.parent !== source.parent) { -this._cloneAndAddRuleToParent(source, target.parent); -} -target.extends = target.extends || []; -target.extends.push(source); -source.selector = source.selector.replace(this.rx.STRIP, ''); -source.selector = (source.selector && source.selector + ',\n') + target.selector; -if (source.extends) { -source.extends.forEach(function (e) { -this._extendRule(target, e); -}, this); -} -}, -_cloneAndAddRuleToParent: function (rule, parent) { -rule = Object.create(rule); -rule.parent = parent; -if (rule.extends) { -rule.extends = rule.extends.slice(); -} -parent.rules.push(rule); -}, -rx: { -EXTEND: /@extends\(([^)]*)\)\s*?;/gim, -STRIP: /%[^,]*$/ -} -}; -}();Polymer.ApplyShim = function () { -'use strict'; -var styleUtil = Polymer.StyleUtil; -var MIXIN_MATCH = styleUtil.rx.MIXIN_MATCH; -var VAR_ASSIGN = styleUtil.rx.VAR_ASSIGN; -var BAD_VAR = /var\(\s*(--[^,]*),\s*(--[^)]*)\)/g; -var APPLY_NAME_CLEAN = /;\s*/m; -var INITIAL_INHERIT = /^\s*(initial)|(inherit)\s*$/; -var MIXIN_VAR_SEP = '_-_'; -var mixinMap = {}; -function mapSet(name, props) { -name = name.trim(); -mixinMap[name] = { -properties: props, -dependants: {} -}; -} -function mapGet(name) { -name = name.trim(); -return mixinMap[name]; -} -function replaceInitialOrInherit(property, value) { -var match = INITIAL_INHERIT.exec(value); -if (match) { -if (match[1]) { -value = ApplyShim._getInitialValueForProperty(property); -} else { -value = 'apply-shim-inherit'; -} -} -return value; -} -function cssTextToMap(text) { -var props = text.split(';'); -var property, value; -var out = {}; -for (var i = 0, p, sp; i < props.length; i++) { -p = props[i]; -if (p) { -sp = p.split(':'); -if (sp.length > 1) { -property = sp[0].trim(); -value = replaceInitialOrInherit(property, sp.slice(1).join(':')); -out[property] = value; -} -} -} -return out; -} -function invalidateMixinEntry(mixinEntry) { -var currentProto = ApplyShim.__currentElementProto; -var currentElementName = currentProto && currentProto.is; -for (var elementName in mixinEntry.dependants) { -if (elementName !== currentElementName) { -mixinEntry.dependants[elementName].__applyShimInvalid = true; -} -} -} -function produceCssProperties(matchText, propertyName, valueProperty, valueMixin) { -if (valueProperty) { -styleUtil.processVariableAndFallback(valueProperty, function (prefix, value) { -if (value && mapGet(value)) { -valueMixin = '@apply ' + value + ';'; -} -}); -} -if (!valueMixin) { -return matchText; -} -var mixinAsProperties = consumeCssProperties(valueMixin); -var prefix = matchText.slice(0, matchText.indexOf('--')); -var mixinValues = cssTextToMap(mixinAsProperties); -var combinedProps = mixinValues; -var mixinEntry = mapGet(propertyName); -var oldProps = mixinEntry && mixinEntry.properties; -if (oldProps) { -combinedProps = Object.create(oldProps); -combinedProps = Polymer.Base.mixin(combinedProps, mixinValues); -} else { -mapSet(propertyName, combinedProps); -} -var out = []; -var p, v; -var needToInvalidate = false; -for (p in combinedProps) { -v = mixinValues[p]; -if (v === undefined) { -v = 'initial'; -} -if (oldProps && !(p in oldProps)) { -needToInvalidate = true; -} -out.push(propertyName + MIXIN_VAR_SEP + p + ': ' + v); -} -if (needToInvalidate) { -invalidateMixinEntry(mixinEntry); -} -if (mixinEntry) { -mixinEntry.properties = combinedProps; -} -if (valueProperty) { -prefix = matchText + ';' + prefix; -} -return prefix + out.join('; ') + ';'; -} -function fixVars(matchText, varA, varB) { -return 'var(' + varA + ',' + 'var(' + varB + '))'; -} -function atApplyToCssProperties(mixinName, fallbacks) { -mixinName = mixinName.replace(APPLY_NAME_CLEAN, ''); -var vars = []; -var mixinEntry = mapGet(mixinName); -if (!mixinEntry) { -mapSet(mixinName, {}); -mixinEntry = mapGet(mixinName); -} -if (mixinEntry) { -var currentProto = ApplyShim.__currentElementProto; -if (currentProto) { -mixinEntry.dependants[currentProto.is] = currentProto; -} -var p, parts, f; -for (p in mixinEntry.properties) { -f = fallbacks && fallbacks[p]; -parts = [ -p, -': var(', -mixinName, -MIXIN_VAR_SEP, -p -]; -if (f) { -parts.push(',', f); -} -parts.push(')'); -vars.push(parts.join('')); -} -} -return vars.join('; '); -} -function consumeCssProperties(text) { -var m; -while (m = MIXIN_MATCH.exec(text)) { -var matchText = m[0]; -var mixinName = m[1]; -var idx = m.index; -var applyPos = idx + matchText.indexOf('@apply'); -var afterApplyPos = idx + matchText.length; -var textBeforeApply = text.slice(0, applyPos); -var textAfterApply = text.slice(afterApplyPos); -var defaults = cssTextToMap(textBeforeApply); -var replacement = atApplyToCssProperties(mixinName, defaults); -text = [ -textBeforeApply, -replacement, -textAfterApply -].join(''); -MIXIN_MATCH.lastIndex = idx + replacement.length; -} -return text; -} -var ApplyShim = { -_measureElement: null, -_map: mixinMap, -_separator: MIXIN_VAR_SEP, -transform: function (styles, elementProto) { -this.__currentElementProto = elementProto; -styleUtil.forRulesInStyles(styles, this._boundFindDefinitions); -styleUtil.forRulesInStyles(styles, this._boundFindApplications); -if (elementProto) { -elementProto.__applyShimInvalid = false; -} -this.__currentElementProto = null; -}, -_findDefinitions: function (rule) { -var cssText = rule.parsedCssText; -cssText = cssText.replace(BAD_VAR, fixVars); -cssText = cssText.replace(VAR_ASSIGN, produceCssProperties); -rule.cssText = cssText; -if (rule.selector === ':root') { -rule.selector = ':host > *'; -} -}, -_findApplications: function (rule) { -rule.cssText = consumeCssProperties(rule.cssText); -}, -transformRule: function (rule) { -this._findDefinitions(rule); -this._findApplications(rule); -}, -_getInitialValueForProperty: function (property) { -if (!this._measureElement) { -this._measureElement = document.createElement('meta'); -this._measureElement.style.all = 'initial'; -document.head.appendChild(this._measureElement); -} -return window.getComputedStyle(this._measureElement).getPropertyValue(property); -} -}; -ApplyShim._boundTransformRule = ApplyShim.transformRule.bind(ApplyShim); -ApplyShim._boundFindDefinitions = ApplyShim._findDefinitions.bind(ApplyShim); -ApplyShim._boundFindApplications = ApplyShim._findApplications.bind(ApplyShim); -return ApplyShim; -}();(function () { -var prepElement = Polymer.Base._prepElement; -var nativeShadow = Polymer.Settings.useNativeShadow; -var styleUtil = Polymer.StyleUtil; -var styleTransformer = Polymer.StyleTransformer; -var styleExtends = Polymer.StyleExtends; -var applyShim = Polymer.ApplyShim; -var settings = Polymer.Settings; -Polymer.Base._addFeature({ -_prepElement: function (element) { -if (this._encapsulateStyle && this.__cssBuild !== 'shady') { -styleTransformer.element(element, this.is, this._scopeCssViaAttr); -} -prepElement.call(this, element); -}, -_prepStyles: function () { -if (this._encapsulateStyle === undefined) { -this._encapsulateStyle = !nativeShadow; -} -if (!nativeShadow) { -this._scopeStyle = styleUtil.applyStylePlaceHolder(this.is); -} -this.__cssBuild = styleUtil.cssBuildTypeForModule(this.is); -}, -_prepShimStyles: function () { -if (this._template) { -var hasTargetedCssBuild = styleUtil.isTargetedBuild(this.__cssBuild); -if (settings.useNativeCSSProperties && this.__cssBuild === 'shadow' && hasTargetedCssBuild) { -if (settings.preserveStyleIncludes) { -styleUtil.styleIncludesToTemplate(this._template); -} -return; -} -this._styles = this._styles || this._collectStyles(); -if (settings.useNativeCSSProperties && !this.__cssBuild) { -applyShim.transform(this._styles, this); -} -var cssText = settings.useNativeCSSProperties && hasTargetedCssBuild ? this._styles.length && this._styles[0].textContent.trim() : styleTransformer.elementStyles(this); -this._prepStyleProperties(); -if (!this._needsStyleProperties() && cssText) { -styleUtil.applyCss(cssText, this.is, nativeShadow ? this._template.content : null, this._scopeStyle); -} -} else { -this._styles = []; -} -}, -_collectStyles: function () { -var styles = []; -var cssText = '', m$ = this.styleModules; -if (m$) { -for (var i = 0, l = m$.length, m; i < l && (m = m$[i]); i++) { -cssText += styleUtil.cssFromModule(m); -} -} -cssText += styleUtil.cssFromModule(this.is); -var p = this._template && this._template.parentNode; -if (this._template && (!p || p.id.toLowerCase() !== this.is)) { -cssText += styleUtil.cssFromElement(this._template); -} -if (cssText) { -var style = document.createElement('style'); -style.textContent = cssText; -if (styleExtends.hasExtends(style.textContent)) { -cssText = styleExtends.transform(style); -} -styles.push(style); -} -return styles; -}, -_elementAdd: function (node) { -if (this._encapsulateStyle) { -if (node.__styleScoped) { -node.__styleScoped = false; -} else { -styleTransformer.dom(node, this.is, this._scopeCssViaAttr); -} -} -}, -_elementRemove: function (node) { -if (this._encapsulateStyle) { -styleTransformer.dom(node, this.is, this._scopeCssViaAttr, true); -} -}, -scopeSubtree: function (container, shouldObserve) { -if (nativeShadow) { -return; -} -var self = this; -var scopify = function (node) { -if (node.nodeType === Node.ELEMENT_NODE) { -var className = node.getAttribute('class'); -node.setAttribute('class', self._scopeElementClass(node, className)); -var n$ = node.querySelectorAll('*'); -for (var i = 0, n; i < n$.length && (n = n$[i]); i++) { -className = n.getAttribute('class'); -n.setAttribute('class', self._scopeElementClass(n, className)); -} -} -}; -scopify(container); -if (shouldObserve) { -var mo = new MutationObserver(function (mxns) { -for (var i = 0, m; i < mxns.length && (m = mxns[i]); i++) { -if (m.addedNodes) { -for (var j = 0; j < m.addedNodes.length; j++) { -scopify(m.addedNodes[j]); -} -} -} -}); -mo.observe(container, { -childList: true, -subtree: true -}); -return mo; -} -} -}); -}());Polymer.StyleProperties = function () { -'use strict'; -var matchesSelector = Polymer.DomApi.matchesSelector; -var styleUtil = Polymer.StyleUtil; -var styleTransformer = Polymer.StyleTransformer; -var IS_IE = navigator.userAgent.match('Trident'); -var settings = Polymer.Settings; -return { -decorateStyles: function (styles, scope) { -var self = this, props = {}, keyframes = [], ruleIndex = 0; -var scopeSelector = styleTransformer._calcHostScope(scope.is, scope.extends); -styleUtil.forRulesInStyles(styles, function (rule, style) { -self.decorateRule(rule); -rule.index = ruleIndex++; -self.whenHostOrRootRule(scope, rule, style, function (info) { -if (rule.parent.type === styleUtil.ruleTypes.MEDIA_RULE) { -scope.__notStyleScopeCacheable = true; -} -if (info.isHost) { -var hostContextOrFunction = info.selector.split(' ').some(function (s) { -return s.indexOf(scopeSelector) === 0 && s.length !== scopeSelector.length; -}); -scope.__notStyleScopeCacheable = scope.__notStyleScopeCacheable || hostContextOrFunction; -} -}); -self.collectPropertiesInCssText(rule.propertyInfo.cssText, props); -}, function onKeyframesRule(rule) { -keyframes.push(rule); -}); -styles._keyframes = keyframes; -var names = []; -for (var i in props) { -names.push(i); -} -return names; -}, -decorateRule: function (rule) { -if (rule.propertyInfo) { -return rule.propertyInfo; -} -var info = {}, properties = {}; -var hasProperties = this.collectProperties(rule, properties); -if (hasProperties) { -info.properties = properties; -rule.rules = null; -} -info.cssText = this.collectCssText(rule); -rule.propertyInfo = info; -return info; -}, -collectProperties: function (rule, properties) { -var info = rule.propertyInfo; -if (info) { -if (info.properties) { -Polymer.Base.mixin(properties, info.properties); -return true; -} -} else { -var m, rx = this.rx.VAR_ASSIGN; -var cssText = rule.parsedCssText; -var value; -var any; -while (m = rx.exec(cssText)) { -value = (m[2] || m[3]).trim(); -if (value !== 'inherit') { -properties[m[1].trim()] = value; -} -any = true; -} -return any; -} -}, -collectCssText: function (rule) { -return this.collectConsumingCssText(rule.parsedCssText); -}, -collectConsumingCssText: function (cssText) { -return cssText.replace(this.rx.BRACKETED, '').replace(this.rx.VAR_ASSIGN, ''); -}, -collectPropertiesInCssText: function (cssText, props) { -var m; -while (m = this.rx.VAR_CONSUMED.exec(cssText)) { -var name = m[1]; -if (m[2] !== ':') { -props[name] = true; -} -} -}, -reify: function (props) { -var names = Object.getOwnPropertyNames(props); -for (var i = 0, n; i < names.length; i++) { -n = names[i]; -props[n] = this.valueForProperty(props[n], props); -} -}, -valueForProperty: function (property, props) { -if (property) { -if (property.indexOf(';') >= 0) { -property = this.valueForProperties(property, props); -} else { -var self = this; -var fn = function (prefix, value, fallback, suffix) { -var propertyValue = self.valueForProperty(props[value], props); -if (!propertyValue || propertyValue === 'initial') { -propertyValue = self.valueForProperty(props[fallback] || fallback, props) || fallback; -} else if (propertyValue === 'apply-shim-inherit') { -propertyValue = 'inherit'; -} -return prefix + (propertyValue || '') + suffix; -}; -property = styleUtil.processVariableAndFallback(property, fn); -} -} -return property && property.trim() || ''; -}, -valueForProperties: function (property, props) { -var parts = property.split(';'); -for (var i = 0, p, m; i < parts.length; i++) { -if (p = parts[i]) { -this.rx.MIXIN_MATCH.lastIndex = 0; -m = this.rx.MIXIN_MATCH.exec(p); -if (m) { -p = this.valueForProperty(props[m[1]], props); -} else { -var colon = p.indexOf(':'); -if (colon !== -1) { -var pp = p.substring(colon); -pp = pp.trim(); -pp = this.valueForProperty(pp, props) || pp; -p = p.substring(0, colon) + pp; -} -} -parts[i] = p && p.lastIndexOf(';') === p.length - 1 ? p.slice(0, -1) : p || ''; -} -} -return parts.join(';'); -}, -applyProperties: function (rule, props) { -var output = ''; -if (!rule.propertyInfo) { -this.decorateRule(rule); -} -if (rule.propertyInfo.cssText) { -output = this.valueForProperties(rule.propertyInfo.cssText, props); -} -rule.cssText = output; -}, -applyKeyframeTransforms: function (rule, keyframeTransforms) { -var input = rule.cssText; -var output = rule.cssText; -if (rule.hasAnimations == null) { -rule.hasAnimations = this.rx.ANIMATION_MATCH.test(input); -} -if (rule.hasAnimations) { -var transform; -if (rule.keyframeNamesToTransform == null) { -rule.keyframeNamesToTransform = []; -for (var keyframe in keyframeTransforms) { -transform = keyframeTransforms[keyframe]; -output = transform(input); -if (input !== output) { -input = output; -rule.keyframeNamesToTransform.push(keyframe); -} -} -} else { -for (var i = 0; i < rule.keyframeNamesToTransform.length; ++i) { -transform = keyframeTransforms[rule.keyframeNamesToTransform[i]]; -input = transform(input); -} -output = input; -} -} -rule.cssText = output; -}, -propertyDataFromStyles: function (styles, element) { -var props = {}, self = this; -var o = []; -styleUtil.forActiveRulesInStyles(styles, function (rule) { -if (!rule.propertyInfo) { -self.decorateRule(rule); -} -var selectorToMatch = rule.transformedSelector || rule.parsedSelector; -if (element && rule.propertyInfo.properties && selectorToMatch) { -if (matchesSelector.call(element, selectorToMatch)) { -self.collectProperties(rule, props); -addToBitMask(rule.index, o); -} -} -}); -return { -properties: props, -key: o -}; -}, -_rootSelector: /:root|:host\s*>\s*\*/, -_checkRoot: function (hostScope, selector) { -return Boolean(selector.match(this._rootSelector)) || hostScope === 'html' && selector.indexOf('html') > -1; -}, -whenHostOrRootRule: function (scope, rule, style, callback) { -if (!rule.propertyInfo) { -self.decorateRule(rule); -} -if (!rule.propertyInfo.properties) { -return; -} -var hostScope = scope.is ? styleTransformer._calcHostScope(scope.is, scope.extends) : 'html'; -var parsedSelector = rule.parsedSelector; -var isRoot = this._checkRoot(hostScope, parsedSelector); -var isHost = !isRoot && parsedSelector.indexOf(':host') === 0; -var cssBuild = scope.__cssBuild || style.__cssBuild; -if (cssBuild === 'shady') { -isRoot = parsedSelector === hostScope + ' > *.' + hostScope || parsedSelector.indexOf('html') > -1; -isHost = !isRoot && parsedSelector.indexOf(hostScope) === 0; -} -if (!isRoot && !isHost) { -return; -} -var selectorToMatch = hostScope; -if (isHost) { -if (settings.useNativeShadow && !rule.transformedSelector) { -rule.transformedSelector = styleTransformer._transformRuleCss(rule, styleTransformer._transformComplexSelector, scope.is, hostScope); -} -selectorToMatch = rule.transformedSelector || rule.parsedSelector; -} -if (isRoot && hostScope === 'html') { -selectorToMatch = rule.transformedSelector || rule.parsedSelector; -} -callback({ -selector: selectorToMatch, -isHost: isHost, -isRoot: isRoot -}); -}, -hostAndRootPropertiesForScope: function (scope) { -var hostProps = {}, rootProps = {}, self = this; -styleUtil.forActiveRulesInStyles(scope._styles, function (rule, style) { -self.whenHostOrRootRule(scope, rule, style, function (info) { -var element = scope._element || scope; -if (matchesSelector.call(element, info.selector)) { -if (info.isHost) { -self.collectProperties(rule, hostProps); -} else { -self.collectProperties(rule, rootProps); -} -} -}); -}); -return { -rootProps: rootProps, -hostProps: hostProps -}; -}, -transformStyles: function (element, properties, scopeSelector) { -var self = this; -var hostSelector = styleTransformer._calcHostScope(element.is, element.extends); -var rxHostSelector = element.extends ? '\\' + hostSelector.slice(0, -1) + '\\]' : hostSelector; -var hostRx = new RegExp(this.rx.HOST_PREFIX + rxHostSelector + this.rx.HOST_SUFFIX); -var keyframeTransforms = this._elementKeyframeTransforms(element, scopeSelector); -return styleTransformer.elementStyles(element, function (rule) { -self.applyProperties(rule, properties); -if (!settings.useNativeShadow && !Polymer.StyleUtil.isKeyframesSelector(rule) && rule.cssText) { -self.applyKeyframeTransforms(rule, keyframeTransforms); -self._scopeSelector(rule, hostRx, hostSelector, element._scopeCssViaAttr, scopeSelector); -} -}); -}, -_elementKeyframeTransforms: function (element, scopeSelector) { -var keyframesRules = element._styles._keyframes; -var keyframeTransforms = {}; -if (!settings.useNativeShadow && keyframesRules) { -for (var i = 0, keyframesRule = keyframesRules[i]; i < keyframesRules.length; keyframesRule = keyframesRules[++i]) { -this._scopeKeyframes(keyframesRule, scopeSelector); -keyframeTransforms[keyframesRule.keyframesName] = this._keyframesRuleTransformer(keyframesRule); -} -} -return keyframeTransforms; -}, -_keyframesRuleTransformer: function (keyframesRule) { -return function (cssText) { -return cssText.replace(keyframesRule.keyframesNameRx, keyframesRule.transformedKeyframesName); -}; -}, -_scopeKeyframes: function (rule, scopeId) { -rule.keyframesNameRx = new RegExp(rule.keyframesName, 'g'); -rule.transformedKeyframesName = rule.keyframesName + '-' + scopeId; -rule.transformedSelector = rule.transformedSelector || rule.selector; -rule.selector = rule.transformedSelector.replace(rule.keyframesName, rule.transformedKeyframesName); -}, -_hasDirOrHostContext: function (parsedSelector) { -return /:host-context|:dir/.test(parsedSelector); -}, -_scopeSelector: function (rule, hostRx, hostSelector, viaAttr, scopeId) { -rule.transformedSelector = rule.transformedSelector || rule.selector; -var selector = rule.transformedSelector; -var scope = styleTransformer._calcElementScope(scopeId, viaAttr); -var hostScope = styleTransformer._calcElementScope(hostSelector, viaAttr); -var parts = selector.split(','); -var isDirOrHostContextSelector = this._hasDirOrHostContext(rule.parsedSelector); -for (var i = 0, l = parts.length, p; i < l && (p = parts[i]); i++) { -parts[i] = p.match(hostRx) ? p.replace(hostSelector, scope) : isDirOrHostContextSelector ? p.replace(hostScope, scope + ' ' + hostScope) : scope + ' ' + p; -} -rule.selector = parts.join(','); -}, -applyElementScopeSelector: function (element, selector, old, viaAttr) { -var c = viaAttr ? element.getAttribute(styleTransformer.SCOPE_NAME) : element.getAttribute('class') || ''; -var v = old ? c.replace(old, selector) : (c ? c + ' ' : '') + this.XSCOPE_NAME + ' ' + selector; -if (c !== v) { -if (viaAttr) { -element.setAttribute(styleTransformer.SCOPE_NAME, v); -} else { -element.setAttribute('class', v); -} -} -}, -applyElementStyle: function (element, properties, selector, style) { -var cssText = style ? style.textContent || '' : this.transformStyles(element, properties, selector); -var s = element._customStyle; -if (s && !settings.useNativeShadow && s !== style) { -s._useCount--; -if (s._useCount <= 0 && s.parentNode) { -s.parentNode.removeChild(s); -} -} -if (settings.useNativeShadow) { -if (element._customStyle) { -element._customStyle.textContent = cssText; -style = element._customStyle; -} else if (cssText) { -style = styleUtil.applyCss(cssText, selector, element.root, element._scopeStyle); -} -} else { -if (!style) { -if (cssText) { -style = styleUtil.applyCss(cssText, selector, null, element._scopeStyle); -} -} else if (!style.parentNode) { -if (IS_IE && cssText.indexOf('@media') > -1) { -style.textContent = cssText; -} -styleUtil.applyStyle(style, null, element._scopeStyle); -} -} -if (style) { -style._useCount = style._useCount || 0; -if (element._customStyle != style) { -style._useCount++; -} -element._customStyle = style; -} -return style; -}, -mixinCustomStyle: function (props, customStyle) { -var v; -for (var i in customStyle) { -v = customStyle[i]; -if (v || v === 0) { -props[i] = v; -} -} -}, -updateNativeStyleProperties: function (element, properties) { -var oldPropertyNames = element.__customStyleProperties; -if (oldPropertyNames) { -for (var i = 0; i < oldPropertyNames.length; i++) { -element.style.removeProperty(oldPropertyNames[i]); -} -} -var propertyNames = []; -for (var p in properties) { -if (properties[p] !== null) { -element.style.setProperty(p, properties[p]); -propertyNames.push(p); -} -} -element.__customStyleProperties = propertyNames; -}, -rx: styleUtil.rx, -XSCOPE_NAME: 'x-scope' -}; -function addToBitMask(n, bits) { -var o = parseInt(n / 32); -var v = 1 << n % 32; -bits[o] = (bits[o] || 0) | v; -} -}();(function () { -Polymer.StyleCache = function () { -this.cache = {}; -}; -Polymer.StyleCache.prototype = { -MAX: 100, -store: function (is, data, keyValues, keyStyles) { -data.keyValues = keyValues; -data.styles = keyStyles; -var s$ = this.cache[is] = this.cache[is] || []; -s$.push(data); -if (s$.length > this.MAX) { -s$.shift(); -} -}, -retrieve: function (is, keyValues, keyStyles) { -var cache = this.cache[is]; -if (cache) { -for (var i = cache.length - 1, data; i >= 0; i--) { -data = cache[i]; -if (keyStyles === data.styles && this._objectsEqual(keyValues, data.keyValues)) { -return data; -} -} -} -}, -clear: function () { -this.cache = {}; -}, -_objectsEqual: function (target, source) { -var t, s; -for (var i in target) { -t = target[i], s = source[i]; -if (!(typeof t === 'object' && t ? this._objectsStrictlyEqual(t, s) : t === s)) { -return false; -} -} -if (Array.isArray(target)) { -return target.length === source.length; -} -return true; -}, -_objectsStrictlyEqual: function (target, source) { -return this._objectsEqual(target, source) && this._objectsEqual(source, target); -} -}; -}());Polymer.StyleDefaults = function () { -var styleProperties = Polymer.StyleProperties; -var StyleCache = Polymer.StyleCache; -var nativeVariables = Polymer.Settings.useNativeCSSProperties; -var api = { -_styles: [], -_properties: null, -customStyle: {}, -_styleCache: new StyleCache(), -_element: Polymer.DomApi.wrap(document.documentElement), -addStyle: function (style) { -this._styles.push(style); -this._properties = null; -}, -get _styleProperties() { -if (!this._properties) { -styleProperties.decorateStyles(this._styles, this); -this._styles._scopeStyleProperties = null; -this._properties = styleProperties.hostAndRootPropertiesForScope(this).rootProps; -styleProperties.mixinCustomStyle(this._properties, this.customStyle); -styleProperties.reify(this._properties); -} -return this._properties; -}, -hasStyleProperties: function () { -return Boolean(this._properties); -}, -_needsStyleProperties: function () { -}, -_computeStyleProperties: function () { -return this._styleProperties; -}, -updateStyles: function (properties) { -this._properties = null; -if (properties) { -Polymer.Base.mixin(this.customStyle, properties); -} -this._styleCache.clear(); -for (var i = 0, s; i < this._styles.length; i++) { -s = this._styles[i]; -s = s.__importElement || s; -s._apply(); -} -if (nativeVariables) { -styleProperties.updateNativeStyleProperties(document.documentElement, this.customStyle); -} -} -}; -return api; -}();(function () { -'use strict'; -var serializeValueToAttribute = Polymer.Base.serializeValueToAttribute; -var propertyUtils = Polymer.StyleProperties; -var styleTransformer = Polymer.StyleTransformer; -var styleDefaults = Polymer.StyleDefaults; -var nativeShadow = Polymer.Settings.useNativeShadow; -var nativeVariables = Polymer.Settings.useNativeCSSProperties; -Polymer.Base._addFeature({ -_prepStyleProperties: function () { -if (!nativeVariables) { -this._ownStylePropertyNames = this._styles && this._styles.length ? propertyUtils.decorateStyles(this._styles, this) : null; -} -}, -customStyle: null, -getComputedStyleValue: function (property) { -if (!nativeVariables && !this._styleProperties) { -this._computeStyleProperties(); -} -return !nativeVariables && this._styleProperties && this._styleProperties[property] || getComputedStyle(this).getPropertyValue(property); -}, -_setupStyleProperties: function () { -this.customStyle = {}; -this._styleCache = null; -this._styleProperties = null; -this._scopeSelector = null; -this._ownStyleProperties = null; -this._customStyle = null; -}, -_needsStyleProperties: function () { -return Boolean(!nativeVariables && this._ownStylePropertyNames && this._ownStylePropertyNames.length); -}, -_validateApplyShim: function () { -if (this.__applyShimInvalid) { -Polymer.ApplyShim.transform(this._styles, this.__proto__); -var cssText = styleTransformer.elementStyles(this); -if (nativeShadow) { -var templateStyle = this._template.content.querySelector('style'); -if (templateStyle) { -templateStyle.textContent = cssText; -} -} else { -var shadyStyle = this._scopeStyle && this._scopeStyle.nextSibling; -if (shadyStyle) { -shadyStyle.textContent = cssText; -} -} -} -}, -_beforeAttached: function () { -if ((!this._scopeSelector || this.__stylePropertiesInvalid) && this._needsStyleProperties()) { -this.__stylePropertiesInvalid = false; -this._updateStyleProperties(); -} -}, -_findStyleHost: function () { -var e = this, root; -while (root = Polymer.dom(e).getOwnerRoot()) { -if (Polymer.isInstance(root.host)) { -return root.host; -} -e = root.host; -} -return styleDefaults; -}, -_updateStyleProperties: function () { -var info, scope = this._findStyleHost(); -if (!scope._styleProperties) { -scope._computeStyleProperties(); -} -if (!scope._styleCache) { -scope._styleCache = new Polymer.StyleCache(); -} -var scopeData = propertyUtils.propertyDataFromStyles(scope._styles, this); -var scopeCacheable = !this.__notStyleScopeCacheable; -if (scopeCacheable) { -scopeData.key.customStyle = this.customStyle; -info = scope._styleCache.retrieve(this.is, scopeData.key, this._styles); -} -var scopeCached = Boolean(info); -if (scopeCached) { -this._styleProperties = info._styleProperties; -} else { -this._computeStyleProperties(scopeData.properties); -} -this._computeOwnStyleProperties(); -if (!scopeCached) { -info = styleCache.retrieve(this.is, this._ownStyleProperties, this._styles); -} -var globalCached = Boolean(info) && !scopeCached; -var style = this._applyStyleProperties(info); -if (!scopeCached) { -style = style && nativeShadow ? style.cloneNode(true) : style; -info = { -style: style, -_scopeSelector: this._scopeSelector, -_styleProperties: this._styleProperties -}; -if (scopeCacheable) { -scopeData.key.customStyle = {}; -this.mixin(scopeData.key.customStyle, this.customStyle); -scope._styleCache.store(this.is, info, scopeData.key, this._styles); -} -if (!globalCached) { -styleCache.store(this.is, Object.create(info), this._ownStyleProperties, this._styles); -} -} -}, -_computeStyleProperties: function (scopeProps) { -var scope = this._findStyleHost(); -if (!scope._styleProperties) { -scope._computeStyleProperties(); -} -var props = Object.create(scope._styleProperties); -var hostAndRootProps = propertyUtils.hostAndRootPropertiesForScope(this); -this.mixin(props, hostAndRootProps.hostProps); -scopeProps = scopeProps || propertyUtils.propertyDataFromStyles(scope._styles, this).properties; -this.mixin(props, scopeProps); -this.mixin(props, hostAndRootProps.rootProps); -propertyUtils.mixinCustomStyle(props, this.customStyle); -propertyUtils.reify(props); -this._styleProperties = props; -}, -_computeOwnStyleProperties: function () { -var props = {}; -for (var i = 0, n; i < this._ownStylePropertyNames.length; i++) { -n = this._ownStylePropertyNames[i]; -props[n] = this._styleProperties[n]; -} -this._ownStyleProperties = props; -}, -_scopeCount: 0, -_applyStyleProperties: function (info) { -var oldScopeSelector = this._scopeSelector; -this._scopeSelector = info ? info._scopeSelector : this.is + '-' + this.__proto__._scopeCount++; -var style = propertyUtils.applyElementStyle(this, this._styleProperties, this._scopeSelector, info && info.style); -if (!nativeShadow) { -propertyUtils.applyElementScopeSelector(this, this._scopeSelector, oldScopeSelector, this._scopeCssViaAttr); -} -return style; -}, -serializeValueToAttribute: function (value, attribute, node) { -node = node || this; -if (attribute === 'class' && !nativeShadow) { -var host = node === this ? this.domHost || this.dataHost : this; -if (host) { -value = host._scopeElementClass(node, value); -} -} -node = this.shadyRoot && this.shadyRoot._hasDistributed ? Polymer.dom(node) : node; -serializeValueToAttribute.call(this, value, attribute, node); -}, -_scopeElementClass: function (element, selector) { -if (!nativeShadow && !this._scopeCssViaAttr) { -selector = (selector ? selector + ' ' : '') + SCOPE_NAME + ' ' + this.is + (element._scopeSelector ? ' ' + XSCOPE_NAME + ' ' + element._scopeSelector : ''); -} -return selector; -}, -updateStyles: function (properties) { -if (properties) { -this.mixin(this.customStyle, properties); -} -if (nativeVariables) { -propertyUtils.updateNativeStyleProperties(this, this.customStyle); -} else { -if (this.isAttached) { -if (this._needsStyleProperties()) { -this._updateStyleProperties(); -} else { -this._styleProperties = null; -} -} else { -this.__stylePropertiesInvalid = true; -} -if (this._styleCache) { -this._styleCache.clear(); -} -this._updateRootStyles(); -} -}, -_updateRootStyles: function (root) { -root = root || this.root; -var c$ = Polymer.dom(root)._query(function (e) { -return e.shadyRoot || e.shadowRoot; -}); -for (var i = 0, l = c$.length, c; i < l && (c = c$[i]); i++) { -if (c.updateStyles) { -c.updateStyles(); -} -} -} -}); -Polymer.updateStyles = function (properties) { -styleDefaults.updateStyles(properties); -Polymer.Base._updateRootStyles(document); -}; -var styleCache = new Polymer.StyleCache(); -Polymer.customStyleCache = styleCache; -var SCOPE_NAME = styleTransformer.SCOPE_NAME; -var XSCOPE_NAME = propertyUtils.XSCOPE_NAME; -}());Polymer.Base._addFeature({ -_registerFeatures: function () { -this._prepIs(); -if (this.factoryImpl) { -this._prepConstructor(); -} -this._prepStyles(); -}, -_finishRegisterFeatures: function () { -this._prepTemplate(); -this._prepShimStyles(); -this._prepAnnotations(); -this._prepEffects(); -this._prepBehaviors(); -this._prepPropertyInfo(); -this._prepBindings(); -this._prepShady(); -}, -_prepBehavior: function (b) { -this._addPropertyEffects(b.properties); -this._addComplexObserverEffects(b.observers); -this._addHostAttributes(b.hostAttributes); -}, -_initFeatures: function () { -this._setupGestures(); -this._setupConfigure(this.__data__); -this._setupStyleProperties(); -this._setupDebouncers(); -this._setupShady(); -this._registerHost(); -if (this._template) { -this._validateApplyShim(); -this._poolContent(); -this._beginHosting(); -this._stampTemplate(); -this._endHosting(); -this._marshalAnnotationReferences(); -} -this._marshalInstanceEffects(); -this._marshalBehaviors(); -this._marshalHostAttributes(); -this._marshalAttributes(); -this._tryReady(); -}, -_marshalBehavior: function (b) { -if (b.listeners) { -this._listenListeners(b.listeners); -} -} -});(function () { -var propertyUtils = Polymer.StyleProperties; -var styleUtil = Polymer.StyleUtil; -var cssParse = Polymer.CssParse; -var styleDefaults = Polymer.StyleDefaults; -var styleTransformer = Polymer.StyleTransformer; -var applyShim = Polymer.ApplyShim; -var debounce = Polymer.Debounce; -var settings = Polymer.Settings; -var updateDebouncer; -Polymer({ -is: 'custom-style', -extends: 'style', -_template: null, -properties: { include: String }, -ready: function () { -this.__appliedElement = this.__appliedElement || this; -this.__cssBuild = styleUtil.getCssBuildType(this); -if (this.__appliedElement !== this) { -this.__appliedElement.__cssBuild = this.__cssBuild; -} -if (this.ownerDocument !== window.document && this.__appliedElement === this) { -document.head.appendChild(this); -} -this._tryApply(); -}, -attached: function () { -this._tryApply(); -}, -_tryApply: function () { -if (!this._appliesToDocument) { -if (this.parentNode && this.parentNode.localName !== 'dom-module') { -this._appliesToDocument = true; -var e = this.__appliedElement; -if (!settings.useNativeCSSProperties) { -this.__needsUpdateStyles = styleDefaults.hasStyleProperties(); -styleDefaults.addStyle(e); -} -if (e.textContent || this.include) { -this._apply(true); -} else { -var self = this; -var observer = new MutationObserver(function () { -observer.disconnect(); -self._apply(true); -}); -observer.observe(e, { childList: true }); -} -} -} -}, -_updateStyles: function () { -Polymer.updateStyles(); -}, -_apply: function (initialApply) { -var e = this.__appliedElement; -if (this.include) { -e.textContent = styleUtil.cssFromModules(this.include, true) + e.textContent; -} -if (!e.textContent) { -return; -} -var buildType = this.__cssBuild; -var targetedBuild = styleUtil.isTargetedBuild(buildType); -if (settings.useNativeCSSProperties && targetedBuild) { -return; -} -var styleRules = styleUtil.rulesForStyle(e); -if (!targetedBuild) { -styleUtil.forEachRule(styleRules, function (rule) { -styleTransformer.documentRule(rule); -}); -if (settings.useNativeCSSProperties && !buildType) { -applyShim.transform([e]); -} -} -if (settings.useNativeCSSProperties) { -e.textContent = styleUtil.toCssText(styleRules); -} else { -var self = this; -var fn = function fn() { -self._flushCustomProperties(); -}; -if (initialApply) { -Polymer.RenderStatus.whenReady(fn); -} else { -fn(); -} -} -}, -_flushCustomProperties: function () { -if (this.__needsUpdateStyles) { -this.__needsUpdateStyles = false; -updateDebouncer = debounce(updateDebouncer, this._updateStyles); -} else { -this._applyCustomProperties(); -} -}, -_applyCustomProperties: function () { -var element = this.__appliedElement; -this._computeStyleProperties(); -var props = this._styleProperties; -var rules = styleUtil.rulesForStyle(element); -if (!rules) { -return; -} -element.textContent = styleUtil.toCssText(rules, function (rule) { -var css = rule.cssText = rule.parsedCssText; -if (rule.propertyInfo && rule.propertyInfo.cssText) { -css = cssParse.removeCustomPropAssignment(css); -rule.cssText = propertyUtils.valueForProperties(css, props); -} -}); -} -}); -}());Polymer.Templatizer = { -properties: { __hideTemplateChildren__: { observer: '_showHideChildren' } }, -_instanceProps: Polymer.nob, -_parentPropPrefix: '_parent_', -templatize: function (template) { -this._templatized = template; -if (!template._content) { -template._content = template.content; -} -if (template._content._ctor) { -this.ctor = template._content._ctor; -this._prepParentProperties(this.ctor.prototype, template); -return; -} -var archetype = Object.create(Polymer.Base); -this._customPrepAnnotations(archetype, template); -this._prepParentProperties(archetype, template); -archetype._prepEffects(); -this._customPrepEffects(archetype); -archetype._prepBehaviors(); -archetype._prepPropertyInfo(); -archetype._prepBindings(); -archetype._notifyPathUp = this._notifyPathUpImpl; -archetype._scopeElementClass = this._scopeElementClassImpl; -archetype.listen = this._listenImpl; -archetype._showHideChildren = this._showHideChildrenImpl; -archetype.__setPropertyOrig = this.__setProperty; -archetype.__setProperty = this.__setPropertyImpl; -var _constructor = this._constructorImpl; -var ctor = function TemplateInstance(model, host) { -_constructor.call(this, model, host); -}; -ctor.prototype = archetype; -archetype.constructor = ctor; -template._content._ctor = ctor; -this.ctor = ctor; -}, -_getRootDataHost: function () { -return this.dataHost && this.dataHost._rootDataHost || this.dataHost; -}, -_showHideChildrenImpl: function (hide) { -var c = this._children; -for (var i = 0; i < c.length; i++) { -var n = c[i]; -if (Boolean(hide) != Boolean(n.__hideTemplateChildren__)) { -if (n.nodeType === Node.TEXT_NODE) { -if (hide) { -n.__polymerTextContent__ = n.textContent; -n.textContent = ''; -} else { -n.textContent = n.__polymerTextContent__; -} -} else if (n.style) { -if (hide) { -n.__polymerDisplay__ = n.style.display; -n.style.display = 'none'; -} else { -n.style.display = n.__polymerDisplay__; -} -} -} -n.__hideTemplateChildren__ = hide; -} -}, -__setPropertyImpl: function (property, value, fromAbove, node) { -if (node && node.__hideTemplateChildren__ && property == 'textContent') { -property = '__polymerTextContent__'; -} -this.__setPropertyOrig(property, value, fromAbove, node); -}, -_debounceTemplate: function (fn) { -Polymer.dom.addDebouncer(this.debounce('_debounceTemplate', fn)); -}, -_flushTemplates: function () { -Polymer.dom.flush(); -}, -_customPrepEffects: function (archetype) { -var parentProps = archetype._parentProps; -for (var prop in parentProps) { -archetype._addPropertyEffect(prop, 'function', this._createHostPropEffector(prop)); -} -for (prop in this._instanceProps) { -archetype._addPropertyEffect(prop, 'function', this._createInstancePropEffector(prop)); -} -}, -_customPrepAnnotations: function (archetype, template) { -archetype._template = template; -var c = template._content; -if (!c._notes) { -var rootDataHost = archetype._rootDataHost; -if (rootDataHost) { -Polymer.Annotations.prepElement = function () { -rootDataHost._prepElement(); -}; -} -c._notes = Polymer.Annotations.parseAnnotations(template); -Polymer.Annotations.prepElement = null; -this._processAnnotations(c._notes); -} -archetype._notes = c._notes; -archetype._parentProps = c._parentProps; -}, -_prepParentProperties: function (archetype, template) { -var parentProps = this._parentProps = archetype._parentProps; -if (this._forwardParentProp && parentProps) { -var proto = archetype._parentPropProto; -var prop; -if (!proto) { -for (prop in this._instanceProps) { -delete parentProps[prop]; -} -proto = archetype._parentPropProto = Object.create(null); -if (template != this) { -Polymer.Bind.prepareModel(proto); -Polymer.Base.prepareModelNotifyPath(proto); -} -for (prop in parentProps) { -var parentProp = this._parentPropPrefix + prop; -var effects = [ -{ -kind: 'function', -effect: this._createForwardPropEffector(prop), -fn: Polymer.Bind._functionEffect -}, -{ -kind: 'notify', -fn: Polymer.Bind._notifyEffect, -effect: { event: Polymer.CaseMap.camelToDashCase(parentProp) + '-changed' } -} -]; -proto._propertyEffects = proto._propertyEffects || {}; -proto._propertyEffects[parentProp] = effects; -Polymer.Bind._createAccessors(proto, parentProp, effects); -} -} -var self = this; -if (template != this) { -Polymer.Bind.prepareInstance(template); -template._forwardParentProp = function (source, value) { -self._forwardParentProp(source, value); -}; -} -this._extendTemplate(template, proto); -template._pathEffector = function (path, value, fromAbove) { -return self._pathEffectorImpl(path, value, fromAbove); -}; -} -}, -_createForwardPropEffector: function (prop) { -return function (source, value) { -this._forwardParentProp(prop, value); -}; -}, -_createHostPropEffector: function (prop) { -var prefix = this._parentPropPrefix; -return function (source, value) { -this.dataHost._templatized[prefix + prop] = value; -}; -}, -_createInstancePropEffector: function (prop) { -return function (source, value, old, fromAbove) { -if (!fromAbove) { -this.dataHost._forwardInstanceProp(this, prop, value); -} -}; -}, -_extendTemplate: function (template, proto) { -var n$ = Object.getOwnPropertyNames(proto); -if (proto._propertySetter) { -template._propertySetter = proto._propertySetter; -} -for (var i = 0, n; i < n$.length && (n = n$[i]); i++) { -var val = template[n]; -if (val && n == '_propertyEffects') { -var pe = Polymer.Base.mixin({}, val); -template._propertyEffects = Polymer.Base.mixin(pe, proto._propertyEffects); -} else { -var pd = Object.getOwnPropertyDescriptor(proto, n); -Object.defineProperty(template, n, pd); -if (val !== undefined) { -template._propertySetter(n, val); -} -} -} -}, -_showHideChildren: function (hidden) { -}, -_forwardInstancePath: function (inst, path, value) { -}, -_forwardInstanceProp: function (inst, prop, value) { -}, -_notifyPathUpImpl: function (path, value) { -var dataHost = this.dataHost; -var root = Polymer.Path.root(path); -dataHost._forwardInstancePath.call(dataHost, this, path, value); -if (root in dataHost._parentProps) { -dataHost._templatized._notifyPath(dataHost._parentPropPrefix + path, value); -} -}, -_pathEffectorImpl: function (path, value, fromAbove) { -if (this._forwardParentPath) { -if (path.indexOf(this._parentPropPrefix) === 0) { -var subPath = path.substring(this._parentPropPrefix.length); -var model = Polymer.Path.root(subPath); -if (model in this._parentProps) { -this._forwardParentPath(subPath, value); -} -} -} -Polymer.Base._pathEffector.call(this._templatized, path, value, fromAbove); -}, -_constructorImpl: function (model, host) { -this._rootDataHost = host._getRootDataHost(); -this._setupConfigure(model); -this._registerHost(host); -this._beginHosting(); -this.root = this.instanceTemplate(this._template); -this.root.__noContent = !this._notes._hasContent; -this.root.__styleScoped = true; -this._endHosting(); -this._marshalAnnotatedNodes(); -this._marshalInstanceEffects(); -this._marshalAnnotatedListeners(); -var children = []; -for (var n = this.root.firstChild; n; n = n.nextSibling) { -children.push(n); -n._templateInstance = this; -} -this._children = children; -if (host.__hideTemplateChildren__) { -this._showHideChildren(true); -} -this._tryReady(); -}, -_listenImpl: function (node, eventName, methodName) { -var model = this; -var host = this._rootDataHost; -var handler = host._createEventHandler(node, eventName, methodName); -var decorated = function (e) { -e.model = model; -handler(e); -}; -host._listen(node, eventName, decorated); -}, -_scopeElementClassImpl: function (node, value) { -var host = this._rootDataHost; -if (host) { -return host._scopeElementClass(node, value); -} -return value; -}, -stamp: function (model) { -model = model || {}; -if (this._parentProps) { -var templatized = this._templatized; -for (var prop in this._parentProps) { -if (model[prop] === undefined) { -model[prop] = templatized[this._parentPropPrefix + prop]; -} -} -} -return new this.ctor(model, this); -}, -modelForElement: function (el) { -var model; -while (el) { -if (model = el._templateInstance) { -if (model.dataHost != this) { -el = model.dataHost; -} else { -return model; -} -} else { -el = el.parentNode; -} -} -} -};Polymer({ -is: 'dom-template', -extends: 'template', -_template: null, -behaviors: [Polymer.Templatizer], -ready: function () { -this.templatize(this); -} -});Polymer._collections = new WeakMap(); -Polymer.Collection = function (userArray) { -Polymer._collections.set(userArray, this); -this.userArray = userArray; -this.store = userArray.slice(); -this.initMap(); -}; -Polymer.Collection.prototype = { -constructor: Polymer.Collection, -initMap: function () { -var omap = this.omap = new WeakMap(); -var pmap = this.pmap = {}; -var s = this.store; -for (var i = 0; i < s.length; i++) { -var item = s[i]; -if (item && typeof item == 'object') { -omap.set(item, i); -} else { -pmap[item] = i; -} -} -}, -add: function (item) { -var key = this.store.push(item) - 1; -if (item && typeof item == 'object') { -this.omap.set(item, key); -} else { -this.pmap[item] = key; -} -return '#' + key; -}, -removeKey: function (key) { -if (key = this._parseKey(key)) { -this._removeFromMap(this.store[key]); -delete this.store[key]; -} -}, -_removeFromMap: function (item) { -if (item && typeof item == 'object') { -this.omap.delete(item); -} else { -delete this.pmap[item]; -} -}, -remove: function (item) { -var key = this.getKey(item); -this.removeKey(key); -return key; -}, -getKey: function (item) { -var key; -if (item && typeof item == 'object') { -key = this.omap.get(item); -} else { -key = this.pmap[item]; -} -if (key != undefined) { -return '#' + key; -} -}, -getKeys: function () { -return Object.keys(this.store).map(function (key) { -return '#' + key; -}); -}, -_parseKey: function (key) { -if (key && key[0] == '#') { -return key.slice(1); -} -}, -setItem: function (key, item) { -if (key = this._parseKey(key)) { -var old = this.store[key]; -if (old) { -this._removeFromMap(old); -} -if (item && typeof item == 'object') { -this.omap.set(item, key); -} else { -this.pmap[item] = key; -} -this.store[key] = item; -} -}, -getItem: function (key) { -if (key = this._parseKey(key)) { -return this.store[key]; -} -}, -getItems: function () { -var items = [], store = this.store; -for (var key in store) { -items.push(store[key]); -} -return items; -}, -_applySplices: function (splices) { -var keyMap = {}, key; -for (var i = 0, s; i < splices.length && (s = splices[i]); i++) { -s.addedKeys = []; -for (var j = 0; j < s.removed.length; j++) { -key = this.getKey(s.removed[j]); -keyMap[key] = keyMap[key] ? null : -1; -} -for (j = 0; j < s.addedCount; j++) { -var item = this.userArray[s.index + j]; -key = this.getKey(item); -key = key === undefined ? this.add(item) : key; -keyMap[key] = keyMap[key] ? null : 1; -s.addedKeys.push(key); -} -} -var removed = []; -var added = []; -for (key in keyMap) { -if (keyMap[key] < 0) { -this.removeKey(key); -removed.push(key); -} -if (keyMap[key] > 0) { -added.push(key); -} -} -return [{ -removed: removed, -added: added -}]; -} -}; -Polymer.Collection.get = function (userArray) { -return Polymer._collections.get(userArray) || new Polymer.Collection(userArray); -}; -Polymer.Collection.applySplices = function (userArray, splices) { -var coll = Polymer._collections.get(userArray); -return coll ? coll._applySplices(splices) : null; -};Polymer({ -is: 'dom-repeat', -extends: 'template', -_template: null, -properties: { -items: { type: Array }, -as: { -type: String, -value: 'item' -}, -indexAs: { -type: String, -value: 'index' -}, -sort: { -type: Function, -observer: '_sortChanged' -}, -filter: { -type: Function, -observer: '_filterChanged' -}, -observe: { -type: String, -observer: '_observeChanged' -}, -delay: Number, -renderedItemCount: { -type: Number, -notify: !Polymer.Settings.suppressTemplateNotifications, -readOnly: true -}, -initialCount: { -type: Number, -observer: '_initializeChunking' -}, -targetFramerate: { -type: Number, -value: 20 -}, -notifyDomChange: { type: Boolean }, -_targetFrameTime: { -type: Number, -computed: '_computeFrameTime(targetFramerate)' -} -}, -behaviors: [Polymer.Templatizer], -observers: ['_itemsChanged(items.*)'], -created: function () { -this._instances = []; -this._pool = []; -this._limit = Infinity; -var self = this; -this._boundRenderChunk = function () { -self._renderChunk(); -}; -}, -detached: function () { -this.__isDetached = true; -for (var i = 0; i < this._instances.length; i++) { -this._detachInstance(i); -} -}, -attached: function () { -if (this.__isDetached) { -this.__isDetached = false; -var refNode; -var parentNode = Polymer.dom(this).parentNode; -if (parentNode.localName == this.is) { -refNode = parentNode; -parentNode = Polymer.dom(parentNode).parentNode; -} else { -refNode = this; -} -var parent = Polymer.dom(parentNode); -for (var i = 0; i < this._instances.length; i++) { -this._attachInstance(i, parent, refNode); -} -} -}, -ready: function () { -this._instanceProps = { __key__: true }; -this._instanceProps[this.as] = true; -this._instanceProps[this.indexAs] = true; -if (!this.ctor) { -this.templatize(this); -} -}, -_sortChanged: function (sort) { -var dataHost = this._getRootDataHost(); -this._sortFn = sort && (typeof sort == 'function' ? sort : function () { -return dataHost[sort].apply(dataHost, arguments); -}); -this._needFullRefresh = true; -if (this.items) { -this._debounceTemplate(this._render); -} -}, -_filterChanged: function (filter) { -var dataHost = this._getRootDataHost(); -this._filterFn = filter && (typeof filter == 'function' ? filter : function () { -return dataHost[filter].apply(dataHost, arguments); -}); -this._needFullRefresh = true; -if (this.items) { -this._debounceTemplate(this._render); -} -}, -_computeFrameTime: function (rate) { -return Math.ceil(1000 / rate); -}, -_initializeChunking: function () { -if (this.initialCount) { -this._limit = this.initialCount; -this._chunkCount = this.initialCount; -this._lastChunkTime = performance.now(); -} -}, -_tryRenderChunk: function () { -if (this.items && this._limit < this.items.length) { -this.debounce('renderChunk', this._requestRenderChunk); -} -}, -_requestRenderChunk: function () { -requestAnimationFrame(this._boundRenderChunk); -}, -_renderChunk: function () { -var currChunkTime = performance.now(); -var ratio = this._targetFrameTime / (currChunkTime - this._lastChunkTime); -this._chunkCount = Math.round(this._chunkCount * ratio) || 1; -this._limit += this._chunkCount; -this._lastChunkTime = currChunkTime; -this._debounceTemplate(this._render); -}, -_observeChanged: function () { -this._observePaths = this.observe && this.observe.replace('.*', '.').split(' '); -}, -_itemsChanged: function (change) { -if (change.path == 'items') { -if (Array.isArray(this.items)) { -this.collection = Polymer.Collection.get(this.items); -} else if (!this.items) { -this.collection = null; -} else { -this._error(this._logf('dom-repeat', 'expected array for `items`,' + ' found', this.items)); -} -this._keySplices = []; -this._indexSplices = []; -this._needFullRefresh = true; -this._initializeChunking(); -this._debounceTemplate(this._render); -} else if (change.path == 'items.splices') { -this._keySplices = this._keySplices.concat(change.value.keySplices); -this._indexSplices = this._indexSplices.concat(change.value.indexSplices); -this._debounceTemplate(this._render); -} else { -var subpath = change.path.slice(6); -this._forwardItemPath(subpath, change.value); -this._checkObservedPaths(subpath); -} -}, -_checkObservedPaths: function (path) { -if (this._observePaths) { -path = path.substring(path.indexOf('.') + 1); -var paths = this._observePaths; -for (var i = 0; i < paths.length; i++) { -if (path.indexOf(paths[i]) === 0) { -this._needFullRefresh = true; -if (this.delay) { -this.debounce('render', this._render, this.delay); -} else { -this._debounceTemplate(this._render); -} -return; -} -} -} -}, -render: function () { -this._needFullRefresh = true; -this._debounceTemplate(this._render); -this._flushTemplates(); -}, -_render: function () { -if (this._needFullRefresh) { -this._applyFullRefresh(); -this._needFullRefresh = false; -} else if (this._keySplices.length) { -if (this._sortFn) { -this._applySplicesUserSort(this._keySplices); -} else { -if (this._filterFn) { -this._applyFullRefresh(); -} else { -this._applySplicesArrayOrder(this._indexSplices); -} -} -} else { -} -this._keySplices = []; -this._indexSplices = []; -var keyToIdx = this._keyToInstIdx = {}; -for (var i = this._instances.length - 1; i >= 0; i--) { -var inst = this._instances[i]; -if (inst.isPlaceholder && i < this._limit) { -inst = this._insertInstance(i, inst.__key__); -} else if (!inst.isPlaceholder && i >= this._limit) { -inst = this._downgradeInstance(i, inst.__key__); -} -keyToIdx[inst.__key__] = i; -if (!inst.isPlaceholder) { -inst.__setProperty(this.indexAs, i, true); -} -} -this._pool.length = 0; -this._setRenderedItemCount(this._instances.length); -if (!Polymer.Settings.suppressTemplateNotifications || this.notifyDomChange) { -this.fire('dom-change'); -} -this._tryRenderChunk(); -}, -_applyFullRefresh: function () { -var c = this.collection; -var keys; -if (this._sortFn) { -keys = c ? c.getKeys() : []; -} else { -keys = []; -var items = this.items; -if (items) { -for (var i = 0; i < items.length; i++) { -keys.push(c.getKey(items[i])); -} -} -} -var self = this; -if (this._filterFn) { -keys = keys.filter(function (a) { -return self._filterFn(c.getItem(a)); -}); -} -if (this._sortFn) { -keys.sort(function (a, b) { -return self._sortFn(c.getItem(a), c.getItem(b)); -}); -} -for (i = 0; i < keys.length; i++) { -var key = keys[i]; -var inst = this._instances[i]; -if (inst) { -inst.__key__ = key; -if (!inst.isPlaceholder && i < this._limit) { -inst.__setProperty(this.as, c.getItem(key), true); -} -} else if (i < this._limit) { -this._insertInstance(i, key); -} else { -this._insertPlaceholder(i, key); -} -} -for (var j = this._instances.length - 1; j >= i; j--) { -this._detachAndRemoveInstance(j); -} -}, -_numericSort: function (a, b) { -return a - b; -}, -_applySplicesUserSort: function (splices) { -var c = this.collection; -var keyMap = {}; -var key; -for (var i = 0, s; i < splices.length && (s = splices[i]); i++) { -for (var j = 0; j < s.removed.length; j++) { -key = s.removed[j]; -keyMap[key] = keyMap[key] ? null : -1; -} -for (j = 0; j < s.added.length; j++) { -key = s.added[j]; -keyMap[key] = keyMap[key] ? null : 1; -} -} -var removedIdxs = []; -var addedKeys = []; -for (key in keyMap) { -if (keyMap[key] === -1) { -removedIdxs.push(this._keyToInstIdx[key]); -} -if (keyMap[key] === 1) { -addedKeys.push(key); -} -} -if (removedIdxs.length) { -removedIdxs.sort(this._numericSort); -for (i = removedIdxs.length - 1; i >= 0; i--) { -var idx = removedIdxs[i]; -if (idx !== undefined) { -this._detachAndRemoveInstance(idx); -} -} -} -var self = this; -if (addedKeys.length) { -if (this._filterFn) { -addedKeys = addedKeys.filter(function (a) { -return self._filterFn(c.getItem(a)); -}); -} -addedKeys.sort(function (a, b) { -return self._sortFn(c.getItem(a), c.getItem(b)); -}); -var start = 0; -for (i = 0; i < addedKeys.length; i++) { -start = this._insertRowUserSort(start, addedKeys[i]); -} -} -}, -_insertRowUserSort: function (start, key) { -var c = this.collection; -var item = c.getItem(key); -var end = this._instances.length - 1; -var idx = -1; -while (start <= end) { -var mid = start + end >> 1; -var midKey = this._instances[mid].__key__; -var cmp = this._sortFn(c.getItem(midKey), item); -if (cmp < 0) { -start = mid + 1; -} else if (cmp > 0) { -end = mid - 1; -} else { -idx = mid; -break; -} -} -if (idx < 0) { -idx = end + 1; -} -this._insertPlaceholder(idx, key); -return idx; -}, -_applySplicesArrayOrder: function (splices) { -for (var i = 0, s; i < splices.length && (s = splices[i]); i++) { -for (var j = 0; j < s.removed.length; j++) { -this._detachAndRemoveInstance(s.index); -} -for (j = 0; j < s.addedKeys.length; j++) { -this._insertPlaceholder(s.index + j, s.addedKeys[j]); -} -} -}, -_detachInstance: function (idx) { -var inst = this._instances[idx]; -if (!inst.isPlaceholder) { -for (var i = 0; i < inst._children.length; i++) { -var el = inst._children[i]; -Polymer.dom(inst.root).appendChild(el); -} -return inst; -} -}, -_attachInstance: function (idx, parent, refNode) { -var inst = this._instances[idx]; -if (!inst.isPlaceholder) { -parent.insertBefore(inst.root, refNode); -} -}, -_detachAndRemoveInstance: function (idx) { -var inst = this._detachInstance(idx); -if (inst) { -this._pool.push(inst); -} -this._instances.splice(idx, 1); -}, -_insertPlaceholder: function (idx, key) { -this._instances.splice(idx, 0, { -isPlaceholder: true, -__key__: key -}); -}, -_stampInstance: function (idx, key) { -var model = { __key__: key }; -model[this.as] = this.collection.getItem(key); -model[this.indexAs] = idx; -return this.stamp(model); -}, -_insertInstance: function (idx, key) { -var inst = this._pool.pop(); -if (inst) { -inst.__setProperty(this.as, this.collection.getItem(key), true); -inst.__setProperty('__key__', key, true); -} else { -inst = this._stampInstance(idx, key); -} -var beforeRow = this._instances[idx + 1]; -var beforeNode = beforeRow && !beforeRow.isPlaceholder ? beforeRow._children[0] : this; -var parentNode = Polymer.dom(this).parentNode; -if (parentNode.localName == this.is) { -if (beforeNode == this) { -beforeNode = parentNode; -} -parentNode = Polymer.dom(parentNode).parentNode; -} -Polymer.dom(parentNode).insertBefore(inst.root, beforeNode); -this._instances[idx] = inst; -return inst; -}, -_downgradeInstance: function (idx, key) { -var inst = this._detachInstance(idx); -if (inst) { -this._pool.push(inst); -} -inst = { -isPlaceholder: true, -__key__: key -}; -this._instances[idx] = inst; -return inst; -}, -_showHideChildren: function (hidden) { -for (var i = 0; i < this._instances.length; i++) { -if (!this._instances[i].isPlaceholder) -this._instances[i]._showHideChildren(hidden); -} -}, -_forwardInstanceProp: function (inst, prop, value) { -if (prop == this.as) { -var idx; -if (this._sortFn || this._filterFn) { -idx = this.items.indexOf(this.collection.getItem(inst.__key__)); -} else { -idx = inst[this.indexAs]; -} -this.set('items.' + idx, value); -} -}, -_forwardInstancePath: function (inst, path, value) { -if (path.indexOf(this.as + '.') === 0) { -this._notifyPath('items.' + inst.__key__ + '.' + path.slice(this.as.length + 1), value); -} -}, -_forwardParentProp: function (prop, value) { -var i$ = this._instances; -for (var i = 0, inst; i < i$.length && (inst = i$[i]); i++) { -if (!inst.isPlaceholder) { -inst.__setProperty(prop, value, true); -} -} -}, -_forwardParentPath: function (path, value) { -var i$ = this._instances; -for (var i = 0, inst; i < i$.length && (inst = i$[i]); i++) { -if (!inst.isPlaceholder) { -inst._notifyPath(path, value, true); -} -} -}, -_forwardItemPath: function (path, value) { -if (this._keyToInstIdx) { -var dot = path.indexOf('.'); -var key = path.substring(0, dot < 0 ? path.length : dot); -var idx = this._keyToInstIdx[key]; -var inst = this._instances[idx]; -if (inst && !inst.isPlaceholder) { -if (dot >= 0) { -path = this.as + '.' + path.substring(dot + 1); -inst._notifyPath(path, value, true); -} else { -inst.__setProperty(this.as, value, true); -} -} -} -}, -itemForElement: function (el) { -var instance = this.modelForElement(el); -return instance && instance[this.as]; -}, -keyForElement: function (el) { -var instance = this.modelForElement(el); -return instance && instance.__key__; -}, -indexForElement: function (el) { -var instance = this.modelForElement(el); -return instance && instance[this.indexAs]; -} -});Polymer({ -is: 'array-selector', -_template: null, -properties: { -items: { -type: Array, -observer: 'clearSelection' -}, -multi: { -type: Boolean, -value: false, -observer: 'clearSelection' -}, -selected: { -type: Object, -notify: true -}, -selectedItem: { -type: Object, -notify: true -}, -toggle: { -type: Boolean, -value: false -} -}, -clearSelection: function () { -if (Array.isArray(this.selected)) { -for (var i = 0; i < this.selected.length; i++) { -this.unlinkPaths('selected.' + i); -} -} else { -this.unlinkPaths('selected'); -this.unlinkPaths('selectedItem'); -} -if (this.multi) { -if (!this.selected || this.selected.length) { -this.selected = []; -this._selectedColl = Polymer.Collection.get(this.selected); -} -} else { -this.selected = null; -this._selectedColl = null; -} -this.selectedItem = null; -}, -isSelected: function (item) { -if (this.multi) { -return this._selectedColl.getKey(item) !== undefined; -} else { -return this.selected == item; -} -}, -deselect: function (item) { -if (this.multi) { -if (this.isSelected(item)) { -var skey = this._selectedColl.getKey(item); -this.arrayDelete('selected', item); -this.unlinkPaths('selected.' + skey); -} -} else { -this.selected = null; -this.selectedItem = null; -this.unlinkPaths('selected'); -this.unlinkPaths('selectedItem'); -} -}, -select: function (item) { -var icol = Polymer.Collection.get(this.items); -var key = icol.getKey(item); -if (this.multi) { -if (this.isSelected(item)) { -if (this.toggle) { -this.deselect(item); -} -} else { -this.push('selected', item); -var skey = this._selectedColl.getKey(item); -this.linkPaths('selected.' + skey, 'items.' + key); -} -} else { -if (this.toggle && item == this.selected) { -this.deselect(); -} else { -this.selected = item; -this.selectedItem = item; -this.linkPaths('selected', 'items.' + key); -this.linkPaths('selectedItem', 'items.' + key); -} -} -} -});Polymer({ -is: 'dom-if', -extends: 'template', -_template: null, -properties: { -'if': { -type: Boolean, -value: false, -observer: '_queueRender' -}, -restamp: { -type: Boolean, -value: false, -observer: '_queueRender' -}, -notifyDomChange: { type: Boolean } -}, -behaviors: [Polymer.Templatizer], -_queueRender: function () { -this._debounceTemplate(this._render); -}, -detached: function () { -var parentNode = this.parentNode; -if (parentNode && parentNode.localName == this.is) { -parentNode = Polymer.dom(parentNode).parentNode; -} -if (!parentNode || parentNode.nodeType == Node.DOCUMENT_FRAGMENT_NODE && (!Polymer.Settings.hasShadow || !(parentNode instanceof ShadowRoot))) { -this._teardownInstance(); -} -}, -attached: function () { -if (this.if && this.ctor) { -this.async(this._ensureInstance); -} -}, -render: function () { -this._flushTemplates(); -}, -_render: function () { -if (this.if) { -if (!this.ctor) { -this.templatize(this); -} -this._ensureInstance(); -this._showHideChildren(); -} else if (this.restamp) { -this._teardownInstance(); -} -if (!this.restamp && this._instance) { -this._showHideChildren(); -} -if (this.if != this._lastIf) { -if (!Polymer.Settings.suppressTemplateNotifications || this.notifyDomChange) { -this.fire('dom-change'); -} -this._lastIf = this.if; -} -}, -_ensureInstance: function () { -var refNode; -var parentNode = Polymer.dom(this).parentNode; -if (parentNode && parentNode.localName == this.is) { -refNode = parentNode; -parentNode = Polymer.dom(parentNode).parentNode; -} else { -refNode = this; -} -if (parentNode) { -if (!this._instance) { -this._instance = this.stamp(); -var root = this._instance.root; -Polymer.dom(parentNode).insertBefore(root, refNode); -} else { -var c$ = this._instance._children; -if (c$ && c$.length) { -var lastChild = Polymer.dom(refNode).previousSibling; -if (lastChild !== c$[c$.length - 1]) { -for (var i = 0, n; i < c$.length && (n = c$[i]); i++) { -Polymer.dom(parentNode).insertBefore(n, refNode); -} -} -} -} -} -}, -_teardownInstance: function () { -if (this._instance) { -var c$ = this._instance._children; -if (c$ && c$.length) { -var parent = Polymer.dom(Polymer.dom(c$[0]).parentNode); -for (var i = 0, n; i < c$.length && (n = c$[i]); i++) { -parent.removeChild(n); -} -} -this._instance = null; -} -}, -_showHideChildren: function () { -var hidden = this.__hideTemplateChildren__ || !this.if; -if (this._instance) { -this._instance._showHideChildren(hidden); -} -}, -_forwardParentProp: function (prop, value) { -if (this._instance) { -this._instance.__setProperty(prop, value, true); -} -}, -_forwardParentPath: function (path, value) { -if (this._instance) { -this._instance._notifyPath(path, value, true); -} -} -});Polymer({ -is: 'dom-bind', -properties: { notifyDomChange: { type: Boolean } }, -extends: 'template', -_template: null, -created: function () { -var self = this; -Polymer.RenderStatus.whenReady(function () { -if (document.readyState == 'loading') { -document.addEventListener('DOMContentLoaded', function () { -self._markImportsReady(); -}); -} else { -self._markImportsReady(); -} -}); -}, -_ensureReady: function () { -if (!this._readied) { -this._readySelf(); -} -}, -_markImportsReady: function () { -this._importsReady = true; -this._ensureReady(); -}, -_registerFeatures: function () { -this._prepConstructor(); -}, -_insertChildren: function () { -var refNode; -var parentNode = Polymer.dom(this).parentNode; -if (parentNode.localName == this.is) { -refNode = parentNode; -parentNode = Polymer.dom(parentNode).parentNode; -} else { -refNode = this; -} -Polymer.dom(parentNode).insertBefore(this.root, refNode); -}, -_removeChildren: function () { -if (this._children) { -for (var i = 0; i < this._children.length; i++) { -this.root.appendChild(this._children[i]); -} -} -}, -_initFeatures: function () { -}, -_scopeElementClass: function (element, selector) { -if (this.dataHost) { -return this.dataHost._scopeElementClass(element, selector); -} else { -return selector; -} -}, -_configureInstanceProperties: function () { -}, -_prepConfigure: function () { -var config = {}; -for (var prop in this._propertyEffects) { -config[prop] = this[prop]; -} -var setupConfigure = this._setupConfigure; -this._setupConfigure = function () { -setupConfigure.call(this, config); -}; -}, -attached: function () { -if (this._importsReady) { -this.render(); -} -}, -detached: function () { -this._removeChildren(); -}, -render: function () { -this._ensureReady(); -if (!this._children) { -this._template = this; -this._prepAnnotations(); -this._prepEffects(); -this._prepBehaviors(); -this._prepConfigure(); -this._prepBindings(); -this._prepPropertyInfo(); -Polymer.Base._initFeatures.call(this); -this._children = Polymer.TreeApi.arrayCopyChildNodes(this.root); -} -this._insertChildren(); -if (!Polymer.Settings.suppressTemplateNotifications || this.notifyDomChange) { -this.fire('dom-change'); -} -} -});
\ No newline at end of file diff --git a/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer-micro-extracted.js b/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer-micro-extracted.js deleted file mode 100644 index 9babb83cee8..00000000000 --- a/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer-micro-extracted.js +++ /dev/null @@ -1,802 +0,0 @@ -(function () { -function resolve() { -document.body.removeAttribute('unresolved'); -} -if (window.WebComponents) { -addEventListener('WebComponentsReady', resolve); -} else { -if (document.readyState === 'interactive' || document.readyState === 'complete') { -resolve(); -} else { -addEventListener('DOMContentLoaded', resolve); -} -} -}());window.Polymer = { -Settings: function () { -var settings = window.Polymer || {}; -if (!settings.noUrlSettings) { -var parts = location.search.slice(1).split('&'); -for (var i = 0, o; i < parts.length && (o = parts[i]); i++) { -o = o.split('='); -o[0] && (settings[o[0]] = o[1] || true); -} -} -settings.wantShadow = settings.dom === 'shadow'; -settings.hasShadow = Boolean(Element.prototype.createShadowRoot); -settings.nativeShadow = settings.hasShadow && !window.ShadowDOMPolyfill; -settings.useShadow = settings.wantShadow && settings.hasShadow; -settings.hasNativeImports = Boolean('import' in document.createElement('link')); -settings.useNativeImports = settings.hasNativeImports; -settings.useNativeCustomElements = !window.CustomElements || window.CustomElements.useNative; -settings.useNativeShadow = settings.useShadow && settings.nativeShadow; -settings.usePolyfillProto = !settings.useNativeCustomElements && !Object.__proto__; -settings.hasNativeCSSProperties = !navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/) && window.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)'); -settings.useNativeCSSProperties = settings.hasNativeCSSProperties && settings.lazyRegister && settings.useNativeCSSProperties; -settings.isIE = navigator.userAgent.match('Trident'); -settings.passiveTouchGestures = settings.passiveTouchGestures || false; -return settings; -}() -};(function () { -var userPolymer = window.Polymer; -window.Polymer = function (prototype) { -if (typeof prototype === 'function') { -prototype = prototype.prototype; -} -if (!prototype) { -prototype = {}; -} -prototype = desugar(prototype); -var customCtor = prototype === prototype.constructor.prototype ? prototype.constructor : null; -var options = { prototype: prototype }; -if (prototype.extends) { -options.extends = prototype.extends; -} -Polymer.telemetry._registrate(prototype); -var ctor = document.registerElement(prototype.is, options); -return customCtor || ctor; -}; -var desugar = function (prototype) { -var base = Polymer.Base; -if (prototype.extends) { -base = Polymer.Base._getExtendedPrototype(prototype.extends); -} -prototype = Polymer.Base.chainObject(prototype, base); -prototype.registerCallback(); -return prototype; -}; -if (userPolymer) { -for (var i in userPolymer) { -Polymer[i] = userPolymer[i]; -} -} -Polymer.Class = function (prototype) { -if (!prototype.factoryImpl) { -prototype.factoryImpl = function () { -}; -} -return desugar(prototype).constructor; -}; -}()); -Polymer.telemetry = { -registrations: [], -_regLog: function (prototype) { -console.log('[' + prototype.is + ']: registered'); -}, -_registrate: function (prototype) { -this.registrations.push(prototype); -Polymer.log && this._regLog(prototype); -}, -dumpRegistrations: function () { -this.registrations.forEach(this._regLog); -} -};Object.defineProperty(window, 'currentImport', { -enumerable: true, -configurable: true, -get: function () { -return (document._currentScript || document.currentScript || {}).ownerDocument; -} -});Polymer.RenderStatus = { -_ready: false, -_callbacks: [], -whenReady: function (cb) { -if (this._ready) { -cb(); -} else { -this._callbacks.push(cb); -} -}, -_makeReady: function () { -this._ready = true; -for (var i = 0; i < this._callbacks.length; i++) { -this._callbacks[i](); -} -this._callbacks = []; -}, -_catchFirstRender: function () { -requestAnimationFrame(function () { -Polymer.RenderStatus._makeReady(); -}); -}, -_afterNextRenderQueue: [], -_waitingNextRender: false, -afterNextRender: function (element, fn, args) { -this._watchNextRender(); -this._afterNextRenderQueue.push([ -element, -fn, -args -]); -}, -hasRendered: function () { -return this._ready; -}, -_watchNextRender: function () { -if (!this._waitingNextRender) { -this._waitingNextRender = true; -var fn = function () { -Polymer.RenderStatus._flushNextRender(); -}; -if (!this._ready) { -this.whenReady(fn); -} else { -requestAnimationFrame(fn); -} -} -}, -_flushNextRender: function () { -var self = this; -setTimeout(function () { -self._flushRenderCallbacks(self._afterNextRenderQueue); -self._afterNextRenderQueue = []; -self._waitingNextRender = false; -}); -}, -_flushRenderCallbacks: function (callbacks) { -for (var i = 0, h; i < callbacks.length; i++) { -h = callbacks[i]; -h[1].apply(h[0], h[2] || Polymer.nar); -} -} -}; -if (window.HTMLImports) { -HTMLImports.whenReady(function () { -Polymer.RenderStatus._catchFirstRender(); -}); -} else { -Polymer.RenderStatus._catchFirstRender(); -} -Polymer.ImportStatus = Polymer.RenderStatus; -Polymer.ImportStatus.whenLoaded = Polymer.ImportStatus.whenReady;(function () { -'use strict'; -var settings = Polymer.Settings; -Polymer.Base = { -__isPolymerInstance__: true, -_addFeature: function (feature) { -this.mixin(this, feature); -}, -registerCallback: function () { -if (settings.lazyRegister === 'max') { -if (this.beforeRegister) { -this.beforeRegister(); -} -} else { -this._desugarBehaviors(); -for (var i = 0, b; i < this.behaviors.length; i++) { -b = this.behaviors[i]; -if (b.beforeRegister) { -b.beforeRegister.call(this); -} -} -if (this.beforeRegister) { -this.beforeRegister(); -} -} -this._registerFeatures(); -if (!settings.lazyRegister) { -this.ensureRegisterFinished(); -} -}, -createdCallback: function () { -if (settings.disableUpgradeEnabled) { -if (this.hasAttribute('disable-upgrade')) { -this._propertySetter = disableUpgradePropertySetter; -this._configValue = null; -this.__data__ = {}; -return; -} else { -this.__hasInitialized = true; -} -} -this.__initialize(); -}, -__initialize: function () { -if (!this.__hasRegisterFinished) { -this._ensureRegisterFinished(this.__proto__); -} -Polymer.telemetry.instanceCount++; -this.root = this; -for (var i = 0, b; i < this.behaviors.length; i++) { -b = this.behaviors[i]; -if (b.created) { -b.created.call(this); -} -} -if (this.created) { -this.created(); -} -this._initFeatures(); -}, -ensureRegisterFinished: function () { -this._ensureRegisterFinished(this); -}, -_ensureRegisterFinished: function (proto) { -if (proto.__hasRegisterFinished !== proto.is || !proto.is) { -if (settings.lazyRegister === 'max') { -proto._desugarBehaviors(); -for (var i = 0, b; i < proto.behaviors.length; i++) { -b = proto.behaviors[i]; -if (b.beforeRegister) { -b.beforeRegister.call(proto); -} -} -} -proto.__hasRegisterFinished = proto.is; -if (proto._finishRegisterFeatures) { -proto._finishRegisterFeatures(); -} -for (var j = 0, pb; j < proto.behaviors.length; j++) { -pb = proto.behaviors[j]; -if (pb.registered) { -pb.registered.call(proto); -} -} -if (proto.registered) { -proto.registered(); -} -if (settings.usePolyfillProto && proto !== this) { -proto.extend(this, proto); -} -} -}, -attachedCallback: function () { -var self = this; -Polymer.RenderStatus.whenReady(function () { -self.isAttached = true; -for (var i = 0, b; i < self.behaviors.length; i++) { -b = self.behaviors[i]; -if (b.attached) { -b.attached.call(self); -} -} -if (self.attached) { -self.attached(); -} -}); -}, -detachedCallback: function () { -var self = this; -Polymer.RenderStatus.whenReady(function () { -self.isAttached = false; -for (var i = 0, b; i < self.behaviors.length; i++) { -b = self.behaviors[i]; -if (b.detached) { -b.detached.call(self); -} -} -if (self.detached) { -self.detached(); -} -}); -}, -attributeChangedCallback: function (name, oldValue, newValue) { -this._attributeChangedImpl(name); -for (var i = 0, b; i < this.behaviors.length; i++) { -b = this.behaviors[i]; -if (b.attributeChanged) { -b.attributeChanged.call(this, name, oldValue, newValue); -} -} -if (this.attributeChanged) { -this.attributeChanged(name, oldValue, newValue); -} -}, -_attributeChangedImpl: function (name) { -this._setAttributeToProperty(this, name); -}, -extend: function (target, source) { -if (target && source) { -var n$ = Object.getOwnPropertyNames(source); -for (var i = 0, n; i < n$.length && (n = n$[i]); i++) { -this.copyOwnProperty(n, source, target); -} -} -return target || source; -}, -mixin: function (target, source) { -for (var i in source) { -target[i] = source[i]; -} -return target; -}, -copyOwnProperty: function (name, source, target) { -var pd = Object.getOwnPropertyDescriptor(source, name); -if (pd) { -Object.defineProperty(target, name, pd); -} -}, -_logger: function (level, args) { -if (args.length === 1 && Array.isArray(args[0])) { -args = args[0]; -} -switch (level) { -case 'log': -case 'warn': -case 'error': -console[level].apply(console, args); -break; -} -}, -_log: function () { -var args = Array.prototype.slice.call(arguments, 0); -this._logger('log', args); -}, -_warn: function () { -var args = Array.prototype.slice.call(arguments, 0); -this._logger('warn', args); -}, -_error: function () { -var args = Array.prototype.slice.call(arguments, 0); -this._logger('error', args); -}, -_logf: function () { -return this._logPrefix.concat(this.is).concat(Array.prototype.slice.call(arguments, 0)); -} -}; -Polymer.Base._logPrefix = function () { -var color = window.chrome && !/edge/i.test(navigator.userAgent) || /firefox/i.test(navigator.userAgent); -return color ? [ -'%c[%s::%s]:', -'font-weight: bold; background-color:#EEEE00;' -] : ['[%s::%s]:']; -}(); -Polymer.Base.chainObject = function (object, inherited) { -if (object && inherited && object !== inherited) { -if (!Object.__proto__) { -object = Polymer.Base.extend(Object.create(inherited), object); -} -object.__proto__ = inherited; -} -return object; -}; -Polymer.Base = Polymer.Base.chainObject(Polymer.Base, HTMLElement.prototype); -Polymer.BaseDescriptors = {}; -var disableUpgradePropertySetter; -if (settings.disableUpgradeEnabled) { -disableUpgradePropertySetter = function (property, value) { -this.__data__[property] = value; -}; -var origAttributeChangedCallback = Polymer.Base.attributeChangedCallback; -Polymer.Base.attributeChangedCallback = function (name, oldValue, newValue) { -if (!this.__hasInitialized && name === 'disable-upgrade') { -this.__hasInitialized = true; -this._propertySetter = Polymer.Bind._modelApi._propertySetter; -this._configValue = Polymer.Base._configValue; -this.__initialize(); -} -origAttributeChangedCallback.call(this, name, oldValue, newValue); -}; -} -if (window.CustomElements) { -Polymer.instanceof = CustomElements.instanceof; -} else { -Polymer.instanceof = function (obj, ctor) { -return obj instanceof ctor; -}; -} -Polymer.isInstance = function (obj) { -return Boolean(obj && obj.__isPolymerInstance__); -}; -Polymer.telemetry.instanceCount = 0; -}());(function () { -var modules = {}; -var lcModules = {}; -var findModule = function (id) { -return modules[id] || lcModules[id.toLowerCase()]; -}; -var DomModule = function () { -return document.createElement('dom-module'); -}; -DomModule.prototype = Object.create(HTMLElement.prototype); -Polymer.Base.mixin(DomModule.prototype, { -createdCallback: function () { -this.register(); -}, -register: function (id) { -id = id || this.id || this.getAttribute('name') || this.getAttribute('is'); -if (id) { -this.id = id; -modules[id] = this; -lcModules[id.toLowerCase()] = this; -} -}, -import: function (id, selector) { -if (id) { -var m = findModule(id); -if (!m) { -forceDomModulesUpgrade(); -m = findModule(id); -} -if (m && selector) { -m = m.querySelector(selector); -} -return m; -} -} -}); -Object.defineProperty(DomModule.prototype, 'constructor', { -value: DomModule, -configurable: true, -writable: true -}); -var cePolyfill = window.CustomElements && !CustomElements.useNative; -document.registerElement('dom-module', DomModule); -function forceDomModulesUpgrade() { -if (cePolyfill) { -var script = document._currentScript || document.currentScript; -var doc = script && script.ownerDocument || document; -var modules = doc.querySelectorAll('dom-module'); -for (var i = modules.length - 1, m; i >= 0 && (m = modules[i]); i--) { -if (m.__upgraded__) { -return; -} else { -CustomElements.upgrade(m); -} -} -} -} -}());Polymer.Base._addFeature({ -_prepIs: function () { -if (!this.is) { -var module = (document._currentScript || document.currentScript).parentNode; -if (module.localName === 'dom-module') { -var id = module.id || module.getAttribute('name') || module.getAttribute('is'); -this.is = id; -} -} -if (this.is) { -this.is = this.is.toLowerCase(); -} -} -});Polymer.Base._addFeature({ -behaviors: [], -_desugarBehaviors: function () { -if (this.behaviors.length) { -this.behaviors = this._desugarSomeBehaviors(this.behaviors); -} -}, -_desugarSomeBehaviors: function (behaviors) { -var behaviorSet = []; -behaviors = this._flattenBehaviorsList(behaviors); -for (var i = behaviors.length - 1; i >= 0; i--) { -var b = behaviors[i]; -if (behaviorSet.indexOf(b) === -1) { -this._mixinBehavior(b); -behaviorSet.unshift(b); -} -} -return behaviorSet; -}, -_flattenBehaviorsList: function (behaviors) { -var flat = []; -for (var i = 0; i < behaviors.length; i++) { -var b = behaviors[i]; -if (b instanceof Array) { -flat = flat.concat(this._flattenBehaviorsList(b)); -} else if (b) { -flat.push(b); -} else { -this._warn(this._logf('_flattenBehaviorsList', 'behavior is null, check for missing or 404 import')); -} -} -return flat; -}, -_mixinBehavior: function (b) { -var n$ = Object.getOwnPropertyNames(b); -var useAssignment = b._noAccessors; -for (var i = 0, n; i < n$.length && (n = n$[i]); i++) { -if (!Polymer.Base._behaviorProperties[n] && !this.hasOwnProperty(n)) { -if (useAssignment) { -this[n] = b[n]; -} else { -this.copyOwnProperty(n, b, this); -} -} -} -}, -_prepBehaviors: function () { -this._prepFlattenedBehaviors(this.behaviors); -}, -_prepFlattenedBehaviors: function (behaviors) { -for (var i = 0, l = behaviors.length; i < l; i++) { -this._prepBehavior(behaviors[i]); -} -this._prepBehavior(this); -}, -_marshalBehaviors: function () { -for (var i = 0; i < this.behaviors.length; i++) { -this._marshalBehavior(this.behaviors[i]); -} -this._marshalBehavior(this); -} -}); -Polymer.Base._behaviorProperties = { -hostAttributes: true, -beforeRegister: true, -registered: true, -properties: true, -observers: true, -listeners: true, -created: true, -attached: true, -detached: true, -attributeChanged: true, -ready: true, -_noAccessors: true -};Polymer.Base._addFeature({ -_getExtendedPrototype: function (tag) { -return this._getExtendedNativePrototype(tag); -}, -_nativePrototypes: {}, -_getExtendedNativePrototype: function (tag) { -var p = this._nativePrototypes[tag]; -if (!p) { -p = Object.create(this.getNativePrototype(tag)); -var p$ = Object.getOwnPropertyNames(Polymer.Base); -for (var i = 0, n; i < p$.length && (n = p$[i]); i++) { -if (!Polymer.BaseDescriptors[n]) { -p[n] = Polymer.Base[n]; -} -} -Object.defineProperties(p, Polymer.BaseDescriptors); -this._nativePrototypes[tag] = p; -} -return p; -}, -getNativePrototype: function (tag) { -return Object.getPrototypeOf(document.createElement(tag)); -} -});Polymer.Base._addFeature({ -_prepConstructor: function () { -this._factoryArgs = this.extends ? [ -this.extends, -this.is -] : [this.is]; -var ctor = function () { -return this._factory(arguments); -}; -if (this.hasOwnProperty('extends')) { -ctor.extends = this.extends; -} -Object.defineProperty(this, 'constructor', { -value: ctor, -writable: true, -configurable: true -}); -ctor.prototype = this; -}, -_factory: function (args) { -var elt = document.createElement.apply(document, this._factoryArgs); -if (this.factoryImpl) { -this.factoryImpl.apply(elt, args); -} -return elt; -} -});Polymer.nob = Object.create(null); -Polymer.Base._addFeature({ -getPropertyInfo: function (property) { -var info = this._getPropertyInfo(property, this.properties); -if (!info) { -for (var i = 0; i < this.behaviors.length; i++) { -info = this._getPropertyInfo(property, this.behaviors[i].properties); -if (info) { -return info; -} -} -} -return info || Polymer.nob; -}, -_getPropertyInfo: function (property, properties) { -var p = properties && properties[property]; -if (typeof p === 'function') { -p = properties[property] = { type: p }; -} -if (p) { -p.defined = true; -} -return p; -}, -_prepPropertyInfo: function () { -this._propertyInfo = {}; -for (var i = 0; i < this.behaviors.length; i++) { -this._addPropertyInfo(this._propertyInfo, this.behaviors[i].properties); -} -this._addPropertyInfo(this._propertyInfo, this.properties); -this._addPropertyInfo(this._propertyInfo, this._propertyEffects); -}, -_addPropertyInfo: function (target, source) { -if (source) { -var t, s; -for (var i in source) { -t = target[i]; -s = source[i]; -if (i[0] === '_' && !s.readOnly) { -continue; -} -if (!target[i]) { -target[i] = { -type: typeof s === 'function' ? s : s.type, -readOnly: s.readOnly, -attribute: Polymer.CaseMap.camelToDashCase(i) -}; -} else { -if (!t.type) { -t.type = s.type; -} -if (!t.readOnly) { -t.readOnly = s.readOnly; -} -} -} -} -} -}); -(function () { -var propertiesDesc = { -configurable: true, -writable: true, -enumerable: true, -value: {} -}; -Polymer.BaseDescriptors.properties = propertiesDesc; -Object.defineProperty(Polymer.Base, 'properties', propertiesDesc); -}());Polymer.CaseMap = { -_caseMap: {}, -_rx: { -dashToCamel: /-[a-z]/g, -camelToDash: /([A-Z])/g -}, -dashToCamelCase: function (dash) { -return this._caseMap[dash] || (this._caseMap[dash] = dash.indexOf('-') < 0 ? dash : dash.replace(this._rx.dashToCamel, function (m) { -return m[1].toUpperCase(); -})); -}, -camelToDashCase: function (camel) { -return this._caseMap[camel] || (this._caseMap[camel] = camel.replace(this._rx.camelToDash, '-$1').toLowerCase()); -} -};Polymer.Base._addFeature({ -_addHostAttributes: function (attributes) { -if (!this._aggregatedAttributes) { -this._aggregatedAttributes = {}; -} -if (attributes) { -this.mixin(this._aggregatedAttributes, attributes); -} -}, -_marshalHostAttributes: function () { -if (this._aggregatedAttributes) { -this._applyAttributes(this, this._aggregatedAttributes); -} -}, -_applyAttributes: function (node, attr$) { -for (var n in attr$) { -if (!this.hasAttribute(n) && n !== 'class') { -var v = attr$[n]; -this.serializeValueToAttribute(v, n, this); -} -} -}, -_marshalAttributes: function () { -this._takeAttributesToModel(this); -}, -_takeAttributesToModel: function (model) { -if (this.hasAttributes()) { -for (var i in this._propertyInfo) { -var info = this._propertyInfo[i]; -if (this.hasAttribute(info.attribute)) { -this._setAttributeToProperty(model, info.attribute, i, info); -} -} -} -}, -_setAttributeToProperty: function (model, attribute, property, info) { -if (!this._serializing) { -property = property || Polymer.CaseMap.dashToCamelCase(attribute); -info = info || this._propertyInfo && this._propertyInfo[property]; -if (info && !info.readOnly) { -var v = this.getAttribute(attribute); -model[property] = this.deserialize(v, info.type); -} -} -}, -_serializing: false, -reflectPropertyToAttribute: function (property, attribute, value) { -this._serializing = true; -value = value === undefined ? this[property] : value; -this.serializeValueToAttribute(value, attribute || Polymer.CaseMap.camelToDashCase(property)); -this._serializing = false; -}, -serializeValueToAttribute: function (value, attribute, node) { -var str = this.serialize(value); -node = node || this; -if (str === undefined) { -node.removeAttribute(attribute); -} else { -node.setAttribute(attribute, str); -} -}, -deserialize: function (value, type) { -switch (type) { -case Number: -value = Number(value); -break; -case Boolean: -value = value != null; -break; -case Object: -try { -value = JSON.parse(value); -} catch (x) { -} -break; -case Array: -try { -value = JSON.parse(value); -} catch (x) { -value = null; -console.warn('Polymer::Attributes: couldn`t decode Array as JSON'); -} -break; -case Date: -value = new Date(value); -break; -case String: -default: -break; -} -return value; -}, -serialize: function (value) { -switch (typeof value) { -case 'boolean': -return value ? '' : undefined; -case 'object': -if (value instanceof Date) { -return value.toString(); -} else if (value) { -try { -return JSON.stringify(value); -} catch (x) { -return ''; -} -} -default: -return value != null ? value : undefined; -} -} -});Polymer.version = "1.11.2";Polymer.Base._addFeature({ -_registerFeatures: function () { -this._prepIs(); -this._prepBehaviors(); -this._prepConstructor(); -this._prepPropertyInfo(); -}, -_prepBehavior: function (b) { -this._addHostAttributes(b.hostAttributes); -}, -_marshalBehavior: function (b) { -}, -_initFeatures: function () { -this._marshalHostAttributes(); -this._marshalBehaviors(); -} -});
\ No newline at end of file diff --git a/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer-micro.html b/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer-micro.html deleted file mode 100644 index 4b776ae1529..00000000000 --- a/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer-micro.html +++ /dev/null @@ -1,9 +0,0 @@ -<!-- -@license -Copyright (c) 2014 The Polymer Project Authors. All rights reserved. -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt -Code distributed by Google as part of the polymer project is also -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt ---><html><head></head><body><script src="polymer-micro-extracted.js"></script></body></html>
\ No newline at end of file diff --git a/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer-mini-extracted.js b/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer-mini-extracted.js deleted file mode 100644 index f92a9120407..00000000000 --- a/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer-mini-extracted.js +++ /dev/null @@ -1,2232 +0,0 @@ -(function () { -function resolveCss(cssText, ownerDocument) { -return cssText.replace(CSS_URL_RX, function (m, pre, url, post) { -return pre + '\'' + resolve(url.replace(/["']/g, ''), ownerDocument) + '\'' + post; -}); -} -function resolveAttrs(element, ownerDocument) { -for (var name in URL_ATTRS) { -var a$ = URL_ATTRS[name]; -for (var i = 0, l = a$.length, a, at, v; i < l && (a = a$[i]); i++) { -if (name === '*' || element.localName === name) { -at = element.attributes[a]; -v = at && at.value; -if (v && v.search(BINDING_RX) < 0) { -at.value = a === 'style' ? resolveCss(v, ownerDocument) : resolve(v, ownerDocument); -} -} -} -} -} -function resolve(url, ownerDocument) { -if (url && ABS_URL.test(url)) { -return url; -} -var resolver = getUrlResolver(ownerDocument); -resolver.href = url; -return resolver.href || url; -} -var tempDoc; -var tempDocBase; -function resolveUrl(url, baseUri) { -if (!tempDoc) { -tempDoc = document.implementation.createHTMLDocument('temp'); -tempDocBase = tempDoc.createElement('base'); -tempDoc.head.appendChild(tempDocBase); -} -tempDocBase.href = baseUri; -return resolve(url, tempDoc); -} -function getUrlResolver(ownerDocument) { -return ownerDocument.body.__urlResolver || (ownerDocument.body.__urlResolver = ownerDocument.createElement('a')); -} -function pathFromUrl(url) { -return url.substring(0, url.lastIndexOf('/') + 1); -} -var CSS_URL_RX = /(url\()([^)]*)(\))/g; -var URL_ATTRS = { -'*': [ -'href', -'src', -'style', -'url' -], -form: ['action'] -}; -var ABS_URL = /(^\/)|(^#)|(^[\w-\d]*:)/; -var BINDING_RX = /\{\{|\[\[/; -Polymer.ResolveUrl = { -resolveCss: resolveCss, -resolveAttrs: resolveAttrs, -resolveUrl: resolveUrl, -pathFromUrl: pathFromUrl -}; -Polymer.rootPath = Polymer.Settings.rootPath || pathFromUrl(document.baseURI || window.location.href); -}());Polymer.Base._addFeature({ -_prepTemplate: function () { -var module; -if (this._template === undefined) { -module = Polymer.DomModule.import(this.is); -this._template = module && module.querySelector('template'); -} -if (module) { -var assetPath = module.getAttribute('assetpath') || ''; -var importURL = Polymer.ResolveUrl.resolveUrl(assetPath, module.ownerDocument.baseURI); -this._importPath = Polymer.ResolveUrl.pathFromUrl(importURL); -} else { -this._importPath = ''; -} -if (this._template && this._template.hasAttribute('is')) { -this._warn(this._logf('_prepTemplate', 'top-level Polymer template ' + 'must not be a type-extension, found', this._template, 'Move inside simple <template>.')); -} -if (this._template && !this._template.content && window.HTMLTemplateElement && HTMLTemplateElement.decorate) { -HTMLTemplateElement.decorate(this._template); -} -}, -_stampTemplate: function () { -if (this._template) { -this.root = this.instanceTemplate(this._template); -} -}, -instanceTemplate: function (template) { -var dom = document.importNode(template._content || template.content, true); -return dom; -} -});(function () { -var baseAttachedCallback = Polymer.Base.attachedCallback; -var baseDetachedCallback = Polymer.Base.detachedCallback; -Polymer.Base._addFeature({ -_hostStack: [], -ready: function () { -}, -_registerHost: function (host) { -this.dataHost = host = host || Polymer.Base._hostStack[Polymer.Base._hostStack.length - 1]; -if (host && host._clients) { -host._clients.push(this); -} -this._clients = null; -this._clientsReadied = false; -}, -_beginHosting: function () { -Polymer.Base._hostStack.push(this); -if (!this._clients) { -this._clients = []; -} -}, -_endHosting: function () { -Polymer.Base._hostStack.pop(); -}, -_tryReady: function () { -this._readied = false; -if (this._canReady()) { -this._ready(); -} -}, -_canReady: function () { -return !this.dataHost || this.dataHost._clientsReadied; -}, -_ready: function () { -this._beforeClientsReady(); -if (this._template) { -this._setupRoot(); -this._readyClients(); -} -this._clientsReadied = true; -this._clients = null; -this._afterClientsReady(); -this._readySelf(); -}, -_readyClients: function () { -this._beginDistribute(); -var c$ = this._clients; -if (c$) { -for (var i = 0, l = c$.length, c; i < l && (c = c$[i]); i++) { -c._ready(); -} -} -this._finishDistribute(); -}, -_readySelf: function () { -for (var i = 0, b; i < this.behaviors.length; i++) { -b = this.behaviors[i]; -if (b.ready) { -b.ready.call(this); -} -} -if (this.ready) { -this.ready(); -} -this._readied = true; -if (this._attachedPending) { -this._attachedPending = false; -this.attachedCallback(); -} -}, -_beforeClientsReady: function () { -}, -_afterClientsReady: function () { -}, -_beforeAttached: function () { -}, -attachedCallback: function () { -if (this._readied) { -this._beforeAttached(); -baseAttachedCallback.call(this); -} else { -this._attachedPending = true; -} -}, -detachedCallback: function () { -if (this._readied) { -baseDetachedCallback.call(this); -} else { -this._attachedPending = false; -} -} -}); -}());Polymer.ArraySplice = function () { -function newSplice(index, removed, addedCount) { -return { -index: index, -removed: removed, -addedCount: addedCount -}; -} -var EDIT_LEAVE = 0; -var EDIT_UPDATE = 1; -var EDIT_ADD = 2; -var EDIT_DELETE = 3; -function ArraySplice() { -} -ArraySplice.prototype = { -calcEditDistances: function (current, currentStart, currentEnd, old, oldStart, oldEnd) { -var rowCount = oldEnd - oldStart + 1; -var columnCount = currentEnd - currentStart + 1; -var distances = new Array(rowCount); -for (var i = 0; i < rowCount; i++) { -distances[i] = new Array(columnCount); -distances[i][0] = i; -} -for (var j = 0; j < columnCount; j++) -distances[0][j] = j; -for (i = 1; i < rowCount; i++) { -for (j = 1; j < columnCount; j++) { -if (this.equals(current[currentStart + j - 1], old[oldStart + i - 1])) -distances[i][j] = distances[i - 1][j - 1]; -else { -var north = distances[i - 1][j] + 1; -var west = distances[i][j - 1] + 1; -distances[i][j] = north < west ? north : west; -} -} -} -return distances; -}, -spliceOperationsFromEditDistances: function (distances) { -var i = distances.length - 1; -var j = distances[0].length - 1; -var current = distances[i][j]; -var edits = []; -while (i > 0 || j > 0) { -if (i == 0) { -edits.push(EDIT_ADD); -j--; -continue; -} -if (j == 0) { -edits.push(EDIT_DELETE); -i--; -continue; -} -var northWest = distances[i - 1][j - 1]; -var west = distances[i - 1][j]; -var north = distances[i][j - 1]; -var min; -if (west < north) -min = west < northWest ? west : northWest; -else -min = north < northWest ? north : northWest; -if (min == northWest) { -if (northWest == current) { -edits.push(EDIT_LEAVE); -} else { -edits.push(EDIT_UPDATE); -current = northWest; -} -i--; -j--; -} else if (min == west) { -edits.push(EDIT_DELETE); -i--; -current = west; -} else { -edits.push(EDIT_ADD); -j--; -current = north; -} -} -edits.reverse(); -return edits; -}, -calcSplices: function (current, currentStart, currentEnd, old, oldStart, oldEnd) { -var prefixCount = 0; -var suffixCount = 0; -var minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart); -if (currentStart == 0 && oldStart == 0) -prefixCount = this.sharedPrefix(current, old, minLength); -if (currentEnd == current.length && oldEnd == old.length) -suffixCount = this.sharedSuffix(current, old, minLength - prefixCount); -currentStart += prefixCount; -oldStart += prefixCount; -currentEnd -= suffixCount; -oldEnd -= suffixCount; -if (currentEnd - currentStart == 0 && oldEnd - oldStart == 0) -return []; -if (currentStart == currentEnd) { -var splice = newSplice(currentStart, [], 0); -while (oldStart < oldEnd) -splice.removed.push(old[oldStart++]); -return [splice]; -} else if (oldStart == oldEnd) -return [newSplice(currentStart, [], currentEnd - currentStart)]; -var ops = this.spliceOperationsFromEditDistances(this.calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd)); -splice = undefined; -var splices = []; -var index = currentStart; -var oldIndex = oldStart; -for (var i = 0; i < ops.length; i++) { -switch (ops[i]) { -case EDIT_LEAVE: -if (splice) { -splices.push(splice); -splice = undefined; -} -index++; -oldIndex++; -break; -case EDIT_UPDATE: -if (!splice) -splice = newSplice(index, [], 0); -splice.addedCount++; -index++; -splice.removed.push(old[oldIndex]); -oldIndex++; -break; -case EDIT_ADD: -if (!splice) -splice = newSplice(index, [], 0); -splice.addedCount++; -index++; -break; -case EDIT_DELETE: -if (!splice) -splice = newSplice(index, [], 0); -splice.removed.push(old[oldIndex]); -oldIndex++; -break; -} -} -if (splice) { -splices.push(splice); -} -return splices; -}, -sharedPrefix: function (current, old, searchLength) { -for (var i = 0; i < searchLength; i++) -if (!this.equals(current[i], old[i])) -return i; -return searchLength; -}, -sharedSuffix: function (current, old, searchLength) { -var index1 = current.length; -var index2 = old.length; -var count = 0; -while (count < searchLength && this.equals(current[--index1], old[--index2])) -count++; -return count; -}, -calculateSplices: function (current, previous) { -return this.calcSplices(current, 0, current.length, previous, 0, previous.length); -}, -equals: function (currentValue, previousValue) { -return currentValue === previousValue; -} -}; -return new ArraySplice(); -}();Polymer.domInnerHTML = function () { -var escapeAttrRegExp = /[&\u00A0"]/g; -var escapeDataRegExp = /[&\u00A0<>]/g; -function escapeReplace(c) { -switch (c) { -case '&': -return '&'; -case '<': -return '<'; -case '>': -return '>'; -case '"': -return '"'; -case '\xA0': -return ' '; -} -} -function escapeAttr(s) { -return s.replace(escapeAttrRegExp, escapeReplace); -} -function escapeData(s) { -return s.replace(escapeDataRegExp, escapeReplace); -} -function makeSet(arr) { -var set = {}; -for (var i = 0; i < arr.length; i++) { -set[arr[i]] = true; -} -return set; -} -var voidElements = makeSet([ -'area', -'base', -'br', -'col', -'command', -'embed', -'hr', -'img', -'input', -'keygen', -'link', -'meta', -'param', -'source', -'track', -'wbr' -]); -var plaintextParents = makeSet([ -'style', -'script', -'xmp', -'iframe', -'noembed', -'noframes', -'plaintext', -'noscript' -]); -function getOuterHTML(node, parentNode, composed) { -switch (node.nodeType) { -case Node.ELEMENT_NODE: -var tagName = node.localName; -var s = '<' + tagName; -var attrs = node.attributes; -for (var i = 0, attr; attr = attrs[i]; i++) { -s += ' ' + attr.name + '="' + escapeAttr(attr.value) + '"'; -} -s += '>'; -if (voidElements[tagName]) { -return s; -} -return s + getInnerHTML(node, composed) + '</' + tagName + '>'; -case Node.TEXT_NODE: -var data = node.data; -if (parentNode && plaintextParents[parentNode.localName]) { -return data; -} -return escapeData(data); -case Node.COMMENT_NODE: -return '<!--' + node.data + '-->'; -default: -console.error(node); -throw new Error('not implemented'); -} -} -function getInnerHTML(node, composed) { -if (node instanceof HTMLTemplateElement) -node = node.content; -var s = ''; -var c$ = Polymer.dom(node).childNodes; -for (var i = 0, l = c$.length, child; i < l && (child = c$[i]); i++) { -s += getOuterHTML(child, node, composed); -} -return s; -} -return { getInnerHTML: getInnerHTML }; -}();(function () { -'use strict'; -var nativeInsertBefore = Element.prototype.insertBefore; -var nativeAppendChild = Element.prototype.appendChild; -var nativeRemoveChild = Element.prototype.removeChild; -Polymer.TreeApi = { -arrayCopyChildNodes: function (parent) { -var copy = [], i = 0; -for (var n = parent.firstChild; n; n = n.nextSibling) { -copy[i++] = n; -} -return copy; -}, -arrayCopyChildren: function (parent) { -var copy = [], i = 0; -for (var n = parent.firstElementChild; n; n = n.nextElementSibling) { -copy[i++] = n; -} -return copy; -}, -arrayCopy: function (a$) { -var l = a$.length; -var copy = new Array(l); -for (var i = 0; i < l; i++) { -copy[i] = a$[i]; -} -return copy; -} -}; -Polymer.TreeApi.Logical = { -hasParentNode: function (node) { -return Boolean(node.__dom && node.__dom.parentNode); -}, -hasChildNodes: function (node) { -return Boolean(node.__dom && node.__dom.childNodes !== undefined); -}, -getChildNodes: function (node) { -return this.hasChildNodes(node) ? this._getChildNodes(node) : node.childNodes; -}, -_getChildNodes: function (node) { -if (!node.__dom.childNodes) { -node.__dom.childNodes = []; -for (var n = node.__dom.firstChild; n; n = n.__dom.nextSibling) { -node.__dom.childNodes.push(n); -} -} -return node.__dom.childNodes; -}, -getParentNode: function (node) { -return node.__dom && node.__dom.parentNode !== undefined ? node.__dom.parentNode : node.parentNode; -}, -getFirstChild: function (node) { -return node.__dom && node.__dom.firstChild !== undefined ? node.__dom.firstChild : node.firstChild; -}, -getLastChild: function (node) { -return node.__dom && node.__dom.lastChild !== undefined ? node.__dom.lastChild : node.lastChild; -}, -getNextSibling: function (node) { -return node.__dom && node.__dom.nextSibling !== undefined ? node.__dom.nextSibling : node.nextSibling; -}, -getPreviousSibling: function (node) { -return node.__dom && node.__dom.previousSibling !== undefined ? node.__dom.previousSibling : node.previousSibling; -}, -getFirstElementChild: function (node) { -return node.__dom && node.__dom.firstChild !== undefined ? this._getFirstElementChild(node) : node.firstElementChild; -}, -_getFirstElementChild: function (node) { -var n = node.__dom.firstChild; -while (n && n.nodeType !== Node.ELEMENT_NODE) { -n = n.__dom.nextSibling; -} -return n; -}, -getLastElementChild: function (node) { -return node.__dom && node.__dom.lastChild !== undefined ? this._getLastElementChild(node) : node.lastElementChild; -}, -_getLastElementChild: function (node) { -var n = node.__dom.lastChild; -while (n && n.nodeType !== Node.ELEMENT_NODE) { -n = n.__dom.previousSibling; -} -return n; -}, -getNextElementSibling: function (node) { -return node.__dom && node.__dom.nextSibling !== undefined ? this._getNextElementSibling(node) : node.nextElementSibling; -}, -_getNextElementSibling: function (node) { -var n = node.__dom.nextSibling; -while (n && n.nodeType !== Node.ELEMENT_NODE) { -n = n.__dom.nextSibling; -} -return n; -}, -getPreviousElementSibling: function (node) { -return node.__dom && node.__dom.previousSibling !== undefined ? this._getPreviousElementSibling(node) : node.previousElementSibling; -}, -_getPreviousElementSibling: function (node) { -var n = node.__dom.previousSibling; -while (n && n.nodeType !== Node.ELEMENT_NODE) { -n = n.__dom.previousSibling; -} -return n; -}, -saveChildNodes: function (node) { -if (!this.hasChildNodes(node)) { -node.__dom = node.__dom || {}; -node.__dom.firstChild = node.firstChild; -node.__dom.lastChild = node.lastChild; -node.__dom.childNodes = []; -for (var n = node.firstChild; n; n = n.nextSibling) { -n.__dom = n.__dom || {}; -n.__dom.parentNode = node; -node.__dom.childNodes.push(n); -n.__dom.nextSibling = n.nextSibling; -n.__dom.previousSibling = n.previousSibling; -} -} -}, -recordInsertBefore: function (node, container, ref_node) { -container.__dom.childNodes = null; -if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { -for (var n = node.firstChild; n; n = n.nextSibling) { -this._linkNode(n, container, ref_node); -} -} else { -this._linkNode(node, container, ref_node); -} -}, -_linkNode: function (node, container, ref_node) { -node.__dom = node.__dom || {}; -container.__dom = container.__dom || {}; -if (ref_node) { -ref_node.__dom = ref_node.__dom || {}; -} -node.__dom.previousSibling = ref_node ? ref_node.__dom.previousSibling : container.__dom.lastChild; -if (node.__dom.previousSibling) { -node.__dom.previousSibling.__dom.nextSibling = node; -} -node.__dom.nextSibling = ref_node || null; -if (node.__dom.nextSibling) { -node.__dom.nextSibling.__dom.previousSibling = node; -} -node.__dom.parentNode = container; -if (ref_node) { -if (ref_node === container.__dom.firstChild) { -container.__dom.firstChild = node; -} -} else { -container.__dom.lastChild = node; -if (!container.__dom.firstChild) { -container.__dom.firstChild = node; -} -} -container.__dom.childNodes = null; -}, -recordRemoveChild: function (node, container) { -node.__dom = node.__dom || {}; -container.__dom = container.__dom || {}; -if (node === container.__dom.firstChild) { -container.__dom.firstChild = node.__dom.nextSibling; -} -if (node === container.__dom.lastChild) { -container.__dom.lastChild = node.__dom.previousSibling; -} -var p = node.__dom.previousSibling; -var n = node.__dom.nextSibling; -if (p) { -p.__dom.nextSibling = n; -} -if (n) { -n.__dom.previousSibling = p; -} -node.__dom.parentNode = node.__dom.previousSibling = node.__dom.nextSibling = undefined; -container.__dom.childNodes = null; -} -}; -Polymer.TreeApi.Composed = { -getChildNodes: function (node) { -return Polymer.TreeApi.arrayCopyChildNodes(node); -}, -getParentNode: function (node) { -return node.parentNode; -}, -clearChildNodes: function (node) { -node.textContent = ''; -}, -insertBefore: function (parentNode, newChild, refChild) { -return nativeInsertBefore.call(parentNode, newChild, refChild || null); -}, -appendChild: function (parentNode, newChild) { -return nativeAppendChild.call(parentNode, newChild); -}, -removeChild: function (parentNode, node) { -return nativeRemoveChild.call(parentNode, node); -} -}; -}());Polymer.DomApi = function () { -'use strict'; -var Settings = Polymer.Settings; -var TreeApi = Polymer.TreeApi; -var DomApi = function (node) { -this.node = needsToWrap ? DomApi.wrap(node) : node; -}; -var needsToWrap = Settings.hasShadow && !Settings.nativeShadow; -DomApi.wrap = window.wrap ? window.wrap : function (node) { -return node; -}; -DomApi.prototype = { -flush: function () { -Polymer.dom.flush(); -}, -deepContains: function (node) { -if (this.node.contains(node)) { -return true; -} -var n = node; -var doc = node.ownerDocument; -while (n && n !== doc && n !== this.node) { -n = Polymer.dom(n).parentNode || n.host; -} -return n === this.node; -}, -queryDistributedElements: function (selector) { -var c$ = this.getEffectiveChildNodes(); -var list = []; -for (var i = 0, l = c$.length, c; i < l && (c = c$[i]); i++) { -if (c.nodeType === Node.ELEMENT_NODE && DomApi.matchesSelector.call(c, selector)) { -list.push(c); -} -} -return list; -}, -getEffectiveChildNodes: function () { -var list = []; -var c$ = this.childNodes; -for (var i = 0, l = c$.length, c; i < l && (c = c$[i]); i++) { -if (c.localName === CONTENT) { -var d$ = dom(c).getDistributedNodes(); -for (var j = 0; j < d$.length; j++) { -list.push(d$[j]); -} -} else { -list.push(c); -} -} -return list; -}, -observeNodes: function (callback) { -if (callback) { -if (!this.observer) { -this.observer = this.node.localName === CONTENT ? new DomApi.DistributedNodesObserver(this) : new DomApi.EffectiveNodesObserver(this); -} -return this.observer.addListener(callback); -} -}, -unobserveNodes: function (handle) { -if (this.observer) { -this.observer.removeListener(handle); -} -}, -notifyObserver: function () { -if (this.observer) { -this.observer.notify(); -} -}, -_query: function (matcher, node, halter) { -node = node || this.node; -var list = []; -this._queryElements(TreeApi.Logical.getChildNodes(node), matcher, halter, list); -return list; -}, -_queryElements: function (elements, matcher, halter, list) { -for (var i = 0, l = elements.length, c; i < l && (c = elements[i]); i++) { -if (c.nodeType === Node.ELEMENT_NODE) { -if (this._queryElement(c, matcher, halter, list)) { -return true; -} -} -} -}, -_queryElement: function (node, matcher, halter, list) { -var result = matcher(node); -if (result) { -list.push(node); -} -if (halter && halter(result)) { -return result; -} -this._queryElements(TreeApi.Logical.getChildNodes(node), matcher, halter, list); -} -}; -var CONTENT = DomApi.CONTENT = 'content'; -var dom = DomApi.factory = function (node) { -node = node || document; -if (!node.__domApi) { -node.__domApi = new DomApi.ctor(node); -} -return node.__domApi; -}; -DomApi.hasApi = function (node) { -return Boolean(node.__domApi); -}; -DomApi.ctor = DomApi; -Polymer.dom = function (obj, patch) { -if (obj instanceof Event) { -return Polymer.EventApi.factory(obj); -} else { -return DomApi.factory(obj, patch); -} -}; -var p = Element.prototype; -DomApi.matchesSelector = p.matches || p.matchesSelector || p.mozMatchesSelector || p.msMatchesSelector || p.oMatchesSelector || p.webkitMatchesSelector; -return DomApi; -}();(function () { -'use strict'; -var Settings = Polymer.Settings; -var DomApi = Polymer.DomApi; -var dom = DomApi.factory; -var TreeApi = Polymer.TreeApi; -var getInnerHTML = Polymer.domInnerHTML.getInnerHTML; -var CONTENT = DomApi.CONTENT; -if (Settings.useShadow) { -return; -} -var nativeCloneNode = Element.prototype.cloneNode; -var nativeImportNode = Document.prototype.importNode; -Polymer.Base.mixin(DomApi.prototype, { -_lazyDistribute: function (host) { -if (host.shadyRoot && host.shadyRoot._distributionClean) { -host.shadyRoot._distributionClean = false; -Polymer.dom.addDebouncer(host.debounce('_distribute', host._distributeContent)); -} -}, -appendChild: function (node) { -return this.insertBefore(node); -}, -insertBefore: function (node, ref_node) { -if (ref_node && TreeApi.Logical.getParentNode(ref_node) !== this.node) { -throw Error('The ref_node to be inserted before is not a child ' + 'of this node'); -} -if (node.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) { -var parent = TreeApi.Logical.getParentNode(node); -if (parent) { -if (DomApi.hasApi(parent)) { -dom(parent).notifyObserver(); -} -this._removeNode(node); -} else { -this._removeOwnerShadyRoot(node); -} -} -if (!this._addNode(node, ref_node)) { -if (ref_node) { -ref_node = ref_node.localName === CONTENT ? this._firstComposedNode(ref_node) : ref_node; -} -var container = this.node._isShadyRoot ? this.node.host : this.node; -if (ref_node) { -TreeApi.Composed.insertBefore(container, node, ref_node); -} else { -TreeApi.Composed.appendChild(container, node); -} -} -this.notifyObserver(); -return node; -}, -_addNode: function (node, ref_node) { -var root = this.getOwnerRoot(); -if (root) { -var ipAdded = this._maybeAddInsertionPoint(node, this.node); -if (!root._invalidInsertionPoints) { -root._invalidInsertionPoints = ipAdded; -} -this._addNodeToHost(root.host, node); -} -if (TreeApi.Logical.hasChildNodes(this.node)) { -TreeApi.Logical.recordInsertBefore(node, this.node, ref_node); -} -var handled = this._maybeDistribute(node) || this.node.shadyRoot; -if (handled) { -if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { -while (node.firstChild) { -TreeApi.Composed.removeChild(node, node.firstChild); -} -} else { -var parent = TreeApi.Composed.getParentNode(node); -if (parent) { -TreeApi.Composed.removeChild(parent, node); -} -} -} -return handled; -}, -removeChild: function (node) { -if (TreeApi.Logical.getParentNode(node) !== this.node) { -throw Error('The node to be removed is not a child of this node: ' + node); -} -if (!this._removeNode(node)) { -var container = this.node._isShadyRoot ? this.node.host : this.node; -var parent = TreeApi.Composed.getParentNode(node); -if (container === parent) { -TreeApi.Composed.removeChild(container, node); -} -} -this.notifyObserver(); -return node; -}, -_removeNode: function (node) { -var logicalParent = TreeApi.Logical.hasParentNode(node) && TreeApi.Logical.getParentNode(node); -var distributed; -var root = this._ownerShadyRootForNode(node); -if (logicalParent) { -distributed = dom(node)._maybeDistributeParent(); -TreeApi.Logical.recordRemoveChild(node, logicalParent); -if (root && this._removeDistributedChildren(root, node)) { -root._invalidInsertionPoints = true; -this._lazyDistribute(root.host); -} -} -this._removeOwnerShadyRoot(node); -if (root) { -this._removeNodeFromHost(root.host, node); -} -return distributed; -}, -replaceChild: function (node, ref_node) { -this.insertBefore(node, ref_node); -this.removeChild(ref_node); -return node; -}, -_hasCachedOwnerRoot: function (node) { -return Boolean(node._ownerShadyRoot !== undefined); -}, -getOwnerRoot: function () { -return this._ownerShadyRootForNode(this.node); -}, -_ownerShadyRootForNode: function (node) { -if (!node) { -return; -} -var root = node._ownerShadyRoot; -if (root === undefined) { -if (node._isShadyRoot) { -root = node; -} else { -var parent = TreeApi.Logical.getParentNode(node); -if (parent) { -root = parent._isShadyRoot ? parent : this._ownerShadyRootForNode(parent); -} else { -root = null; -} -} -if (root || document.documentElement.contains(node)) { -node._ownerShadyRoot = root; -} -} -return root; -}, -_maybeDistribute: function (node) { -var fragContent = node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && !node.__noContent && dom(node).querySelector(CONTENT); -var wrappedContent = fragContent && TreeApi.Logical.getParentNode(fragContent).nodeType !== Node.DOCUMENT_FRAGMENT_NODE; -var hasContent = fragContent || node.localName === CONTENT; -if (hasContent) { -var root = this.getOwnerRoot(); -if (root) { -this._lazyDistribute(root.host); -} -} -var needsDist = this._nodeNeedsDistribution(this.node); -if (needsDist) { -this._lazyDistribute(this.node); -} -return needsDist || hasContent && !wrappedContent; -}, -_maybeAddInsertionPoint: function (node, parent) { -var added; -if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && !node.__noContent) { -var c$ = dom(node).querySelectorAll(CONTENT); -for (var i = 0, n, np, na; i < c$.length && (n = c$[i]); i++) { -np = TreeApi.Logical.getParentNode(n); -if (np === node) { -np = parent; -} -na = this._maybeAddInsertionPoint(n, np); -added = added || na; -} -} else if (node.localName === CONTENT) { -TreeApi.Logical.saveChildNodes(parent); -TreeApi.Logical.saveChildNodes(node); -added = true; -} -return added; -}, -_updateInsertionPoints: function (host) { -var i$ = host.shadyRoot._insertionPoints = dom(host.shadyRoot).querySelectorAll(CONTENT); -for (var i = 0, c; i < i$.length; i++) { -c = i$[i]; -TreeApi.Logical.saveChildNodes(c); -TreeApi.Logical.saveChildNodes(TreeApi.Logical.getParentNode(c)); -} -}, -_nodeNeedsDistribution: function (node) { -return node && node.shadyRoot && DomApi.hasInsertionPoint(node.shadyRoot); -}, -_addNodeToHost: function (host, node) { -if (host._elementAdd) { -host._elementAdd(node); -} -}, -_removeNodeFromHost: function (host, node) { -if (host._elementRemove) { -host._elementRemove(node); -} -}, -_removeDistributedChildren: function (root, container) { -var hostNeedsDist; -var ip$ = root._insertionPoints; -for (var i = 0; i < ip$.length; i++) { -var content = ip$[i]; -if (this._contains(container, content)) { -var dc$ = dom(content).getDistributedNodes(); -for (var j = 0; j < dc$.length; j++) { -hostNeedsDist = true; -var node = dc$[j]; -var parent = TreeApi.Composed.getParentNode(node); -if (parent) { -TreeApi.Composed.removeChild(parent, node); -} -} -} -} -return hostNeedsDist; -}, -_contains: function (container, node) { -while (node) { -if (node == container) { -return true; -} -node = TreeApi.Logical.getParentNode(node); -} -}, -_removeOwnerShadyRoot: function (node) { -if (this._hasCachedOwnerRoot(node)) { -var c$ = TreeApi.Logical.getChildNodes(node); -for (var i = 0, l = c$.length, n; i < l && (n = c$[i]); i++) { -this._removeOwnerShadyRoot(n); -} -} -node._ownerShadyRoot = undefined; -}, -_firstComposedNode: function (content) { -var n$ = dom(content).getDistributedNodes(); -for (var i = 0, l = n$.length, n, p$; i < l && (n = n$[i]); i++) { -p$ = dom(n).getDestinationInsertionPoints(); -if (p$[p$.length - 1] === content) { -return n; -} -} -}, -querySelector: function (selector) { -var result = this._query(function (n) { -return DomApi.matchesSelector.call(n, selector); -}, this.node, function (n) { -return Boolean(n); -})[0]; -return result || null; -}, -querySelectorAll: function (selector) { -return this._query(function (n) { -return DomApi.matchesSelector.call(n, selector); -}, this.node); -}, -getDestinationInsertionPoints: function () { -return this.node._destinationInsertionPoints || []; -}, -getDistributedNodes: function () { -return this.node._distributedNodes || []; -}, -_clear: function () { -while (this.childNodes.length) { -this.removeChild(this.childNodes[0]); -} -}, -setAttribute: function (name, value) { -this.node.setAttribute(name, value); -this._maybeDistributeParent(); -}, -removeAttribute: function (name) { -this.node.removeAttribute(name); -this._maybeDistributeParent(); -}, -_maybeDistributeParent: function () { -if (this._nodeNeedsDistribution(this.parentNode)) { -this._lazyDistribute(this.parentNode); -return true; -} -}, -cloneNode: function (deep) { -var n = nativeCloneNode.call(this.node, false); -if (deep) { -var c$ = this.childNodes; -var d = dom(n); -for (var i = 0, nc; i < c$.length; i++) { -nc = dom(c$[i]).cloneNode(true); -d.appendChild(nc); -} -} -return n; -}, -importNode: function (externalNode, deep) { -var doc = this.node instanceof Document ? this.node : this.node.ownerDocument; -var n = nativeImportNode.call(doc, externalNode, false); -if (deep) { -var c$ = TreeApi.Logical.getChildNodes(externalNode); -var d = dom(n); -for (var i = 0, nc; i < c$.length; i++) { -nc = dom(doc).importNode(c$[i], true); -d.appendChild(nc); -} -} -return n; -}, -_getComposedInnerHTML: function () { -return getInnerHTML(this.node, true); -} -}); -Object.defineProperties(DomApi.prototype, { -activeElement: { -get: function () { -var active = document.activeElement; -if (!active) { -return null; -} -var isShadyRoot = !!this.node._isShadyRoot; -if (this.node !== document) { -if (!isShadyRoot) { -return null; -} -if (this.node.host === active || !this.node.host.contains(active)) { -return null; -} -} -var activeRoot = dom(active).getOwnerRoot(); -while (activeRoot && activeRoot !== this.node) { -active = activeRoot.host; -activeRoot = dom(active).getOwnerRoot(); -} -if (this.node === document) { -return activeRoot ? null : active; -} else { -return activeRoot === this.node ? active : null; -} -}, -configurable: true -}, -childNodes: { -get: function () { -var c$ = TreeApi.Logical.getChildNodes(this.node); -return Array.isArray(c$) ? c$ : TreeApi.arrayCopyChildNodes(this.node); -}, -configurable: true -}, -children: { -get: function () { -if (TreeApi.Logical.hasChildNodes(this.node)) { -return Array.prototype.filter.call(this.childNodes, function (n) { -return n.nodeType === Node.ELEMENT_NODE; -}); -} else { -return TreeApi.arrayCopyChildren(this.node); -} -}, -configurable: true -}, -parentNode: { -get: function () { -return TreeApi.Logical.getParentNode(this.node); -}, -configurable: true -}, -firstChild: { -get: function () { -return TreeApi.Logical.getFirstChild(this.node); -}, -configurable: true -}, -lastChild: { -get: function () { -return TreeApi.Logical.getLastChild(this.node); -}, -configurable: true -}, -nextSibling: { -get: function () { -return TreeApi.Logical.getNextSibling(this.node); -}, -configurable: true -}, -previousSibling: { -get: function () { -return TreeApi.Logical.getPreviousSibling(this.node); -}, -configurable: true -}, -firstElementChild: { -get: function () { -return TreeApi.Logical.getFirstElementChild(this.node); -}, -configurable: true -}, -lastElementChild: { -get: function () { -return TreeApi.Logical.getLastElementChild(this.node); -}, -configurable: true -}, -nextElementSibling: { -get: function () { -return TreeApi.Logical.getNextElementSibling(this.node); -}, -configurable: true -}, -previousElementSibling: { -get: function () { -return TreeApi.Logical.getPreviousElementSibling(this.node); -}, -configurable: true -}, -textContent: { -get: function () { -var nt = this.node.nodeType; -if (nt === Node.TEXT_NODE || nt === Node.COMMENT_NODE) { -return this.node.textContent; -} else { -var tc = []; -for (var i = 0, cn = this.childNodes, c; c = cn[i]; i++) { -if (c.nodeType !== Node.COMMENT_NODE) { -tc.push(c.textContent); -} -} -return tc.join(''); -} -}, -set: function (text) { -var nt = this.node.nodeType; -if (nt === Node.TEXT_NODE || nt === Node.COMMENT_NODE) { -this.node.textContent = text; -} else { -this._clear(); -if (text) { -this.appendChild(document.createTextNode(text)); -} -} -}, -configurable: true -}, -innerHTML: { -get: function () { -var nt = this.node.nodeType; -if (nt === Node.TEXT_NODE || nt === Node.COMMENT_NODE) { -return null; -} else { -return getInnerHTML(this.node); -} -}, -set: function (text) { -var nt = this.node.nodeType; -if (nt !== Node.TEXT_NODE || nt !== Node.COMMENT_NODE) { -this._clear(); -var d = document.createElement('div'); -d.innerHTML = text; -var c$ = TreeApi.arrayCopyChildNodes(d); -for (var i = 0; i < c$.length; i++) { -this.appendChild(c$[i]); -} -} -}, -configurable: true -} -}); -DomApi.hasInsertionPoint = function (root) { -return Boolean(root && root._insertionPoints.length); -}; -}());(function () { -'use strict'; -var Settings = Polymer.Settings; -var TreeApi = Polymer.TreeApi; -var DomApi = Polymer.DomApi; -if (!Settings.useShadow) { -return; -} -Polymer.Base.mixin(DomApi.prototype, { -querySelectorAll: function (selector) { -return TreeApi.arrayCopy(this.node.querySelectorAll(selector)); -}, -getOwnerRoot: function () { -var n = this.node; -while (n) { -if (n.nodeType === Node.DOCUMENT_FRAGMENT_NODE && n.host) { -return n; -} -n = n.parentNode; -} -}, -importNode: function (externalNode, deep) { -var doc = this.node instanceof Document ? this.node : this.node.ownerDocument; -return doc.importNode(externalNode, deep); -}, -getDestinationInsertionPoints: function () { -var n$ = this.node.getDestinationInsertionPoints && this.node.getDestinationInsertionPoints(); -return n$ ? TreeApi.arrayCopy(n$) : []; -}, -getDistributedNodes: function () { -var n$ = this.node.getDistributedNodes && this.node.getDistributedNodes(); -return n$ ? TreeApi.arrayCopy(n$) : []; -} -}); -Object.defineProperties(DomApi.prototype, { -activeElement: { -get: function () { -var node = DomApi.wrap(this.node); -var activeElement = node.activeElement; -return node.contains(activeElement) ? activeElement : null; -}, -configurable: true -}, -childNodes: { -get: function () { -return TreeApi.arrayCopyChildNodes(this.node); -}, -configurable: true -}, -children: { -get: function () { -return TreeApi.arrayCopyChildren(this.node); -}, -configurable: true -}, -textContent: { -get: function () { -return this.node.textContent; -}, -set: function (value) { -return this.node.textContent = value; -}, -configurable: true -}, -innerHTML: { -get: function () { -return this.node.innerHTML; -}, -set: function (value) { -return this.node.innerHTML = value; -}, -configurable: true -} -}); -var forwardMethods = function (m$) { -for (var i = 0; i < m$.length; i++) { -forwardMethod(m$[i]); -} -}; -var forwardMethod = function (method) { -DomApi.prototype[method] = function () { -return this.node[method].apply(this.node, arguments); -}; -}; -forwardMethods([ -'cloneNode', -'appendChild', -'insertBefore', -'removeChild', -'replaceChild', -'setAttribute', -'removeAttribute', -'querySelector' -]); -var forwardProperties = function (f$) { -for (var i = 0; i < f$.length; i++) { -forwardProperty(f$[i]); -} -}; -var forwardProperty = function (name) { -Object.defineProperty(DomApi.prototype, name, { -get: function () { -return this.node[name]; -}, -configurable: true -}); -}; -forwardProperties([ -'parentNode', -'firstChild', -'lastChild', -'nextSibling', -'previousSibling', -'firstElementChild', -'lastElementChild', -'nextElementSibling', -'previousElementSibling' -]); -}());Polymer.Base.mixin(Polymer.dom, { -_flushGuard: 0, -_FLUSH_MAX: 100, -_needsTakeRecords: !Polymer.Settings.useNativeCustomElements, -_debouncers: [], -_staticFlushList: [], -_finishDebouncer: null, -flush: function () { -this._flushGuard = 0; -this._prepareFlush(); -while (this._debouncers.length && this._flushGuard < this._FLUSH_MAX) { -while (this._debouncers.length) { -this._debouncers.shift().complete(); -} -if (this._finishDebouncer) { -this._finishDebouncer.complete(); -} -this._prepareFlush(); -this._flushGuard++; -} -if (this._flushGuard >= this._FLUSH_MAX) { -console.warn('Polymer.dom.flush aborted. Flush may not be complete.'); -} -}, -_prepareFlush: function () { -if (this._needsTakeRecords) { -CustomElements.takeRecords(); -} -for (var i = 0; i < this._staticFlushList.length; i++) { -this._staticFlushList[i](); -} -}, -addStaticFlush: function (fn) { -this._staticFlushList.push(fn); -}, -removeStaticFlush: function (fn) { -var i = this._staticFlushList.indexOf(fn); -if (i >= 0) { -this._staticFlushList.splice(i, 1); -} -}, -addDebouncer: function (debouncer) { -this._debouncers.push(debouncer); -this._finishDebouncer = Polymer.Debounce(this._finishDebouncer, this._finishFlush); -}, -_finishFlush: function () { -Polymer.dom._debouncers = []; -} -});Polymer.EventApi = function () { -'use strict'; -var DomApi = Polymer.DomApi.ctor; -var Settings = Polymer.Settings; -DomApi.Event = function (event) { -this.event = event; -}; -if (Settings.useShadow) { -DomApi.Event.prototype = { -get rootTarget() { -return this.event.path[0]; -}, -get localTarget() { -return this.event.target; -}, -get path() { -var path = this.event.path; -if (!Array.isArray(path)) { -path = Array.prototype.slice.call(path); -} -return path; -} -}; -} else { -DomApi.Event.prototype = { -get rootTarget() { -return this.event.target; -}, -get localTarget() { -var current = this.event.currentTarget; -var currentRoot = current && Polymer.dom(current).getOwnerRoot(); -var p$ = this.path; -for (var i = 0; i < p$.length; i++) { -if (Polymer.dom(p$[i]).getOwnerRoot() === currentRoot) { -return p$[i]; -} -} -}, -get path() { -if (!this.event._path) { -var path = []; -var current = this.rootTarget; -while (current) { -path.push(current); -var insertionPoints = Polymer.dom(current).getDestinationInsertionPoints(); -if (insertionPoints.length) { -for (var i = 0; i < insertionPoints.length - 1; i++) { -path.push(insertionPoints[i]); -} -current = insertionPoints[insertionPoints.length - 1]; -} else { -current = Polymer.dom(current).parentNode || current.host; -} -} -path.push(window); -this.event._path = path; -} -return this.event._path; -} -}; -} -var factory = function (event) { -if (!event.__eventApi) { -event.__eventApi = new DomApi.Event(event); -} -return event.__eventApi; -}; -return { factory: factory }; -}();(function () { -'use strict'; -var DomApi = Polymer.DomApi.ctor; -var useShadow = Polymer.Settings.useShadow; -Object.defineProperty(DomApi.prototype, 'classList', { -get: function () { -if (!this._classList) { -this._classList = new DomApi.ClassList(this); -} -return this._classList; -}, -configurable: true -}); -DomApi.ClassList = function (host) { -this.domApi = host; -this.node = host.node; -}; -DomApi.ClassList.prototype = { -add: function () { -this.node.classList.add.apply(this.node.classList, arguments); -this._distributeParent(); -}, -remove: function () { -this.node.classList.remove.apply(this.node.classList, arguments); -this._distributeParent(); -}, -toggle: function () { -this.node.classList.toggle.apply(this.node.classList, arguments); -this._distributeParent(); -}, -_distributeParent: function () { -if (!useShadow) { -this.domApi._maybeDistributeParent(); -} -}, -contains: function () { -return this.node.classList.contains.apply(this.node.classList, arguments); -} -}; -}());(function () { -'use strict'; -var DomApi = Polymer.DomApi.ctor; -var Settings = Polymer.Settings; -DomApi.EffectiveNodesObserver = function (domApi) { -this.domApi = domApi; -this.node = this.domApi.node; -this._listeners = []; -}; -DomApi.EffectiveNodesObserver.prototype = { -addListener: function (callback) { -if (!this._isSetup) { -this._setup(); -this._isSetup = true; -} -var listener = { -fn: callback, -_nodes: [] -}; -this._listeners.push(listener); -this._scheduleNotify(); -return listener; -}, -removeListener: function (handle) { -var i = this._listeners.indexOf(handle); -if (i >= 0) { -this._listeners.splice(i, 1); -handle._nodes = []; -} -if (!this._hasListeners()) { -this._cleanup(); -this._isSetup = false; -} -}, -_setup: function () { -this._observeContentElements(this.domApi.childNodes); -}, -_cleanup: function () { -this._unobserveContentElements(this.domApi.childNodes); -}, -_hasListeners: function () { -return Boolean(this._listeners.length); -}, -_scheduleNotify: function () { -if (this._debouncer) { -this._debouncer.stop(); -} -this._debouncer = Polymer.Debounce(this._debouncer, this._notify); -this._debouncer.context = this; -Polymer.dom.addDebouncer(this._debouncer); -}, -notify: function () { -if (this._hasListeners()) { -this._scheduleNotify(); -} -}, -_notify: function () { -this._beforeCallListeners(); -this._callListeners(); -}, -_beforeCallListeners: function () { -this._updateContentElements(); -}, -_updateContentElements: function () { -this._observeContentElements(this.domApi.childNodes); -}, -_observeContentElements: function (elements) { -for (var i = 0, n; i < elements.length && (n = elements[i]); i++) { -if (this._isContent(n)) { -n.__observeNodesMap = n.__observeNodesMap || new WeakMap(); -if (!n.__observeNodesMap.has(this)) { -n.__observeNodesMap.set(this, this._observeContent(n)); -} -} -} -}, -_observeContent: function (content) { -var self = this; -var h = Polymer.dom(content).observeNodes(function () { -self._scheduleNotify(); -}); -h._avoidChangeCalculation = true; -return h; -}, -_unobserveContentElements: function (elements) { -for (var i = 0, n, h; i < elements.length && (n = elements[i]); i++) { -if (this._isContent(n)) { -h = n.__observeNodesMap.get(this); -if (h) { -Polymer.dom(n).unobserveNodes(h); -n.__observeNodesMap.delete(this); -} -} -} -}, -_isContent: function (node) { -return node.localName === 'content'; -}, -_callListeners: function () { -var o$ = this._listeners; -var nodes = this._getEffectiveNodes(); -for (var i = 0, o; i < o$.length && (o = o$[i]); i++) { -var info = this._generateListenerInfo(o, nodes); -if (info || o._alwaysNotify) { -this._callListener(o, info); -} -} -}, -_getEffectiveNodes: function () { -return this.domApi.getEffectiveChildNodes(); -}, -_generateListenerInfo: function (listener, newNodes) { -if (listener._avoidChangeCalculation) { -return true; -} -var oldNodes = listener._nodes; -var info = { -target: this.node, -addedNodes: [], -removedNodes: [] -}; -var splices = Polymer.ArraySplice.calculateSplices(newNodes, oldNodes); -for (var i = 0, s; i < splices.length && (s = splices[i]); i++) { -for (var j = 0, n; j < s.removed.length && (n = s.removed[j]); j++) { -info.removedNodes.push(n); -} -} -for (i = 0, s; i < splices.length && (s = splices[i]); i++) { -for (j = s.index; j < s.index + s.addedCount; j++) { -info.addedNodes.push(newNodes[j]); -} -} -listener._nodes = newNodes; -if (info.addedNodes.length || info.removedNodes.length) { -return info; -} -}, -_callListener: function (listener, info) { -return listener.fn.call(this.node, info); -}, -enableShadowAttributeTracking: function () { -} -}; -if (Settings.useShadow) { -var baseSetup = DomApi.EffectiveNodesObserver.prototype._setup; -var baseCleanup = DomApi.EffectiveNodesObserver.prototype._cleanup; -Polymer.Base.mixin(DomApi.EffectiveNodesObserver.prototype, { -_setup: function () { -if (!this._observer) { -var self = this; -this._mutationHandler = function (mxns) { -if (mxns && mxns.length) { -self._scheduleNotify(); -} -}; -this._observer = new MutationObserver(this._mutationHandler); -this._boundFlush = function () { -self._flush(); -}; -Polymer.dom.addStaticFlush(this._boundFlush); -this._observer.observe(this.node, { childList: true }); -} -baseSetup.call(this); -}, -_cleanup: function () { -this._observer.disconnect(); -this._observer = null; -this._mutationHandler = null; -Polymer.dom.removeStaticFlush(this._boundFlush); -baseCleanup.call(this); -}, -_flush: function () { -if (this._observer) { -this._mutationHandler(this._observer.takeRecords()); -} -}, -enableShadowAttributeTracking: function () { -if (this._observer) { -this._makeContentListenersAlwaysNotify(); -this._observer.disconnect(); -this._observer.observe(this.node, { -childList: true, -attributes: true, -subtree: true -}); -var root = this.domApi.getOwnerRoot(); -var host = root && root.host; -if (host && Polymer.dom(host).observer) { -Polymer.dom(host).observer.enableShadowAttributeTracking(); -} -} -}, -_makeContentListenersAlwaysNotify: function () { -for (var i = 0, h; i < this._listeners.length; i++) { -h = this._listeners[i]; -h._alwaysNotify = h._isContentListener; -} -} -}); -} -}());(function () { -'use strict'; -var DomApi = Polymer.DomApi.ctor; -var Settings = Polymer.Settings; -DomApi.DistributedNodesObserver = function (domApi) { -DomApi.EffectiveNodesObserver.call(this, domApi); -}; -DomApi.DistributedNodesObserver.prototype = Object.create(DomApi.EffectiveNodesObserver.prototype); -Polymer.Base.mixin(DomApi.DistributedNodesObserver.prototype, { -_setup: function () { -}, -_cleanup: function () { -}, -_beforeCallListeners: function () { -}, -_getEffectiveNodes: function () { -return this.domApi.getDistributedNodes(); -} -}); -if (Settings.useShadow) { -Polymer.Base.mixin(DomApi.DistributedNodesObserver.prototype, { -_setup: function () { -if (!this._observer) { -var root = this.domApi.getOwnerRoot(); -var host = root && root.host; -if (host) { -var self = this; -this._observer = Polymer.dom(host).observeNodes(function () { -self._scheduleNotify(); -}); -this._observer._isContentListener = true; -if (this._hasAttrSelect()) { -Polymer.dom(host).observer.enableShadowAttributeTracking(); -} -} -} -}, -_hasAttrSelect: function () { -var select = this.node.getAttribute('select'); -return select && select.match(/[[.]+/); -}, -_cleanup: function () { -var root = this.domApi.getOwnerRoot(); -var host = root && root.host; -if (host) { -Polymer.dom(host).unobserveNodes(this._observer); -} -this._observer = null; -} -}); -} -}());(function () { -var DomApi = Polymer.DomApi; -var TreeApi = Polymer.TreeApi; -Polymer.Base._addFeature({ -_prepShady: function () { -this._useContent = this._useContent || Boolean(this._template); -}, -_setupShady: function () { -this.shadyRoot = null; -if (!this.__domApi) { -this.__domApi = null; -} -if (!this.__dom) { -this.__dom = null; -} -if (!this._ownerShadyRoot) { -this._ownerShadyRoot = undefined; -} -}, -_poolContent: function () { -if (this._useContent) { -TreeApi.Logical.saveChildNodes(this); -} -}, -_setupRoot: function () { -if (this._useContent) { -this._createLocalRoot(); -if (!this.dataHost) { -upgradeLogicalChildren(TreeApi.Logical.getChildNodes(this)); -} -} -}, -_createLocalRoot: function () { -this.shadyRoot = this.root; -this.shadyRoot._distributionClean = false; -this.shadyRoot._hasDistributed = false; -this.shadyRoot._isShadyRoot = true; -this.shadyRoot._dirtyRoots = []; -var i$ = this.shadyRoot._insertionPoints = !this._notes || this._notes._hasContent ? this.shadyRoot.querySelectorAll('content') : []; -TreeApi.Logical.saveChildNodes(this.shadyRoot); -for (var i = 0, c; i < i$.length; i++) { -c = i$[i]; -TreeApi.Logical.saveChildNodes(c); -TreeApi.Logical.saveChildNodes(c.parentNode); -} -this.shadyRoot.host = this; -}, -distributeContent: function (updateInsertionPoints) { -if (this.shadyRoot) { -this.shadyRoot._invalidInsertionPoints = this.shadyRoot._invalidInsertionPoints || updateInsertionPoints; -var host = getTopDistributingHost(this); -Polymer.dom(this)._lazyDistribute(host); -} -}, -_distributeContent: function () { -if (this._useContent && !this.shadyRoot._distributionClean) { -if (this.shadyRoot._invalidInsertionPoints) { -Polymer.dom(this)._updateInsertionPoints(this); -this.shadyRoot._invalidInsertionPoints = false; -} -this._beginDistribute(); -this._distributeDirtyRoots(); -this._finishDistribute(); -} -}, -_beginDistribute: function () { -if (this._useContent && DomApi.hasInsertionPoint(this.shadyRoot)) { -this._resetDistribution(); -this._distributePool(this.shadyRoot, this._collectPool()); -} -}, -_distributeDirtyRoots: function () { -var c$ = this.shadyRoot._dirtyRoots; -for (var i = 0, l = c$.length, c; i < l && (c = c$[i]); i++) { -c._distributeContent(); -} -this.shadyRoot._dirtyRoots = []; -}, -_finishDistribute: function () { -if (this._useContent) { -this.shadyRoot._distributionClean = true; -if (DomApi.hasInsertionPoint(this.shadyRoot)) { -this._composeTree(); -notifyContentObservers(this.shadyRoot); -} else { -if (!this.shadyRoot._hasDistributed) { -TreeApi.Composed.clearChildNodes(this); -this.appendChild(this.shadyRoot); -} else { -var children = this._composeNode(this); -this._updateChildNodes(this, children); -} -} -if (!this.shadyRoot._hasDistributed) { -notifyInitialDistribution(this); -} -this.shadyRoot._hasDistributed = true; -} -}, -elementMatches: function (selector, node) { -node = node || this; -return DomApi.matchesSelector.call(node, selector); -}, -_resetDistribution: function () { -var children = TreeApi.Logical.getChildNodes(this); -for (var i = 0; i < children.length; i++) { -var child = children[i]; -if (child._destinationInsertionPoints) { -child._destinationInsertionPoints = undefined; -} -if (isInsertionPoint(child)) { -clearDistributedDestinationInsertionPoints(child); -} -} -var root = this.shadyRoot; -var p$ = root._insertionPoints; -for (var j = 0; j < p$.length; j++) { -p$[j]._distributedNodes = []; -} -}, -_collectPool: function () { -var pool = []; -var children = TreeApi.Logical.getChildNodes(this); -for (var i = 0; i < children.length; i++) { -var child = children[i]; -if (isInsertionPoint(child)) { -pool.push.apply(pool, child._distributedNodes); -} else { -pool.push(child); -} -} -return pool; -}, -_distributePool: function (node, pool) { -var p$ = node._insertionPoints; -for (var i = 0, l = p$.length, p; i < l && (p = p$[i]); i++) { -this._distributeInsertionPoint(p, pool); -maybeRedistributeParent(p, this); -} -}, -_distributeInsertionPoint: function (content, pool) { -var anyDistributed = false; -for (var i = 0, l = pool.length, node; i < l; i++) { -node = pool[i]; -if (!node) { -continue; -} -if (this._matchesContentSelect(node, content)) { -distributeNodeInto(node, content); -pool[i] = undefined; -anyDistributed = true; -} -} -if (!anyDistributed) { -var children = TreeApi.Logical.getChildNodes(content); -for (var j = 0; j < children.length; j++) { -distributeNodeInto(children[j], content); -} -} -}, -_composeTree: function () { -this._updateChildNodes(this, this._composeNode(this)); -var p$ = this.shadyRoot._insertionPoints; -for (var i = 0, l = p$.length, p, parent; i < l && (p = p$[i]); i++) { -parent = TreeApi.Logical.getParentNode(p); -if (!parent._useContent && parent !== this && parent !== this.shadyRoot) { -this._updateChildNodes(parent, this._composeNode(parent)); -} -} -}, -_composeNode: function (node) { -var children = []; -var c$ = TreeApi.Logical.getChildNodes(node.shadyRoot || node); -for (var i = 0; i < c$.length; i++) { -var child = c$[i]; -if (isInsertionPoint(child)) { -var distributedNodes = child._distributedNodes; -for (var j = 0; j < distributedNodes.length; j++) { -var distributedNode = distributedNodes[j]; -if (isFinalDestination(child, distributedNode)) { -children.push(distributedNode); -} -} -} else { -children.push(child); -} -} -return children; -}, -_updateChildNodes: function (container, children) { -var composed = TreeApi.Composed.getChildNodes(container); -var splices = Polymer.ArraySplice.calculateSplices(children, composed); -for (var i = 0, d = 0, s; i < splices.length && (s = splices[i]); i++) { -for (var j = 0, n; j < s.removed.length && (n = s.removed[j]); j++) { -if (TreeApi.Composed.getParentNode(n) === container) { -TreeApi.Composed.removeChild(container, n); -} -composed.splice(s.index + d, 1); -} -d -= s.addedCount; -} -for (var i = 0, s, next; i < splices.length && (s = splices[i]); i++) { -next = composed[s.index]; -for (j = s.index, n; j < s.index + s.addedCount; j++) { -n = children[j]; -TreeApi.Composed.insertBefore(container, n, next); -composed.splice(j, 0, n); -} -} -}, -_matchesContentSelect: function (node, contentElement) { -var select = contentElement.getAttribute('select'); -if (!select) { -return true; -} -select = select.trim(); -if (!select) { -return true; -} -if (!(node instanceof Element)) { -return false; -} -var validSelectors = /^(:not\()?[*.#[a-zA-Z_|]/; -if (!validSelectors.test(select)) { -return false; -} -return this.elementMatches(select, node); -}, -_elementAdd: function () { -}, -_elementRemove: function () { -} -}); -var domHostDesc = { -get: function () { -var root = Polymer.dom(this).getOwnerRoot(); -return root && root.host; -}, -configurable: true -}; -Object.defineProperty(Polymer.Base, 'domHost', domHostDesc); -Polymer.BaseDescriptors.domHost = domHostDesc; -function distributeNodeInto(child, insertionPoint) { -insertionPoint._distributedNodes.push(child); -var points = child._destinationInsertionPoints; -if (!points) { -child._destinationInsertionPoints = [insertionPoint]; -} else { -points.push(insertionPoint); -} -} -function clearDistributedDestinationInsertionPoints(content) { -var e$ = content._distributedNodes; -if (e$) { -for (var i = 0; i < e$.length; i++) { -var d = e$[i]._destinationInsertionPoints; -if (d) { -d.splice(d.indexOf(content) + 1, d.length); -} -} -} -} -function maybeRedistributeParent(content, host) { -var parent = TreeApi.Logical.getParentNode(content); -if (parent && parent.shadyRoot && DomApi.hasInsertionPoint(parent.shadyRoot) && parent.shadyRoot._distributionClean) { -parent.shadyRoot._distributionClean = false; -host.shadyRoot._dirtyRoots.push(parent); -} -} -function isFinalDestination(insertionPoint, node) { -var points = node._destinationInsertionPoints; -return points && points[points.length - 1] === insertionPoint; -} -function isInsertionPoint(node) { -return node.localName == 'content'; -} -function getTopDistributingHost(host) { -while (host && hostNeedsRedistribution(host)) { -host = host.domHost; -} -return host; -} -function hostNeedsRedistribution(host) { -var c$ = TreeApi.Logical.getChildNodes(host); -for (var i = 0, c; i < c$.length; i++) { -c = c$[i]; -if (c.localName && c.localName === 'content') { -return host.domHost; -} -} -} -function notifyContentObservers(root) { -for (var i = 0, c; i < root._insertionPoints.length; i++) { -c = root._insertionPoints[i]; -if (DomApi.hasApi(c)) { -Polymer.dom(c).notifyObserver(); -} -} -} -function notifyInitialDistribution(host) { -if (DomApi.hasApi(host)) { -Polymer.dom(host).notifyObserver(); -} -} -var needsUpgrade = window.CustomElements && !CustomElements.useNative; -function upgradeLogicalChildren(children) { -if (needsUpgrade && children) { -for (var i = 0; i < children.length; i++) { -CustomElements.upgrade(children[i]); -} -} -} -}());if (Polymer.Settings.useShadow) { -Polymer.Base._addFeature({ -_poolContent: function () { -}, -_beginDistribute: function () { -}, -distributeContent: function () { -}, -_distributeContent: function () { -}, -_finishDistribute: function () { -}, -_createLocalRoot: function () { -this.createShadowRoot(); -this.shadowRoot.appendChild(this.root); -this.root = this.shadowRoot; -} -}); -}Polymer.Async = { -_currVal: 0, -_lastVal: 0, -_callbacks: [], -_twiddleContent: 0, -_twiddle: document.createTextNode(''), -run: function (callback, waitTime) { -if (waitTime > 0) { -return ~setTimeout(callback, waitTime); -} else { -this._twiddle.textContent = this._twiddleContent++; -this._callbacks.push(callback); -return this._currVal++; -} -}, -cancel: function (handle) { -if (handle < 0) { -clearTimeout(~handle); -} else { -var idx = handle - this._lastVal; -if (idx >= 0) { -if (!this._callbacks[idx]) { -throw 'invalid async handle: ' + handle; -} -this._callbacks[idx] = null; -} -} -}, -_atEndOfMicrotask: function () { -var len = this._callbacks.length; -for (var i = 0; i < len; i++) { -var cb = this._callbacks[i]; -if (cb) { -try { -cb(); -} catch (e) { -i++; -this._callbacks.splice(0, i); -this._lastVal += i; -this._twiddle.textContent = this._twiddleContent++; -throw e; -} -} -} -this._callbacks.splice(0, len); -this._lastVal += len; -} -}; -new window.MutationObserver(function () { -Polymer.Async._atEndOfMicrotask(); -}).observe(Polymer.Async._twiddle, { characterData: true });Polymer.Debounce = function () { -var Async = Polymer.Async; -var Debouncer = function (context) { -this.context = context; -var self = this; -this.boundComplete = function () { -self.complete(); -}; -}; -Debouncer.prototype = { -go: function (callback, wait) { -var h; -this.finish = function () { -Async.cancel(h); -}; -h = Async.run(this.boundComplete, wait); -this.callback = callback; -}, -stop: function () { -if (this.finish) { -this.finish(); -this.finish = null; -this.callback = null; -} -}, -complete: function () { -if (this.finish) { -var callback = this.callback; -this.stop(); -callback.call(this.context); -} -} -}; -function debounce(debouncer, callback, wait) { -if (debouncer) { -debouncer.stop(); -} else { -debouncer = new Debouncer(this); -} -debouncer.go(callback, wait); -return debouncer; -} -return debounce; -}();Polymer.Base._addFeature({ -_setupDebouncers: function () { -this._debouncers = {}; -}, -debounce: function (jobName, callback, wait) { -return this._debouncers[jobName] = Polymer.Debounce.call(this, this._debouncers[jobName], callback, wait); -}, -isDebouncerActive: function (jobName) { -var debouncer = this._debouncers[jobName]; -return !!(debouncer && debouncer.finish); -}, -flushDebouncer: function (jobName) { -var debouncer = this._debouncers[jobName]; -if (debouncer) { -debouncer.complete(); -} -}, -cancelDebouncer: function (jobName) { -var debouncer = this._debouncers[jobName]; -if (debouncer) { -debouncer.stop(); -} -} -});Polymer.DomModule = document.createElement('dom-module'); -Polymer.Base._addFeature({ -_registerFeatures: function () { -this._prepIs(); -this._prepBehaviors(); -this._prepConstructor(); -this._prepTemplate(); -this._prepShady(); -this._prepPropertyInfo(); -}, -_prepBehavior: function (b) { -this._addHostAttributes(b.hostAttributes); -}, -_initFeatures: function () { -this._registerHost(); -if (this._template) { -this._poolContent(); -this._beginHosting(); -this._stampTemplate(); -this._endHosting(); -} -this._marshalHostAttributes(); -this._setupDebouncers(); -this._marshalBehaviors(); -this._tryReady(); -}, -_marshalBehavior: function (b) { -} -});
\ No newline at end of file diff --git a/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer-mini.html b/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer-mini.html deleted file mode 100644 index d54c449387a..00000000000 --- a/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer-mini.html +++ /dev/null @@ -1,9 +0,0 @@ -<!-- -@license -Copyright (c) 2014 The Polymer Project Authors. All rights reserved. -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt -Code distributed by Google as part of the polymer project is also -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt ---><html><head><link rel="import" href="polymer-micro.html"></head><body><script src="polymer-mini-extracted.js"></script></body></html>
\ No newline at end of file diff --git a/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer.html b/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer.html deleted file mode 100644 index 9b7a70e890e..00000000000 --- a/chromium/third_party/polymer/v1_0/components-chromium/polymer/polymer.html +++ /dev/null @@ -1,17 +0,0 @@ -<!-- -@license -Copyright (c) 2015 The Polymer Project Authors. All rights reserved. -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt -Code distributed by Google as part of the polymer project is also -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt ---><!-- -@license -Copyright (c) 2014 The Polymer Project Authors. All rights reserved. -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt -Code distributed by Google as part of the polymer project is also -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt ---><html><head><link rel="import" href="polymer-mini.html"></head><body><script src="polymer-extracted.js"></script></body></html>
\ No newline at end of file diff --git a/chromium/third_party/polymer/v1_0/components_summary.txt b/chromium/third_party/polymer/v1_0/components_summary.txt index 81dccb122b0..c46d392cf4d 100644 --- a/chromium/third_party/polymer/v1_0/components_summary.txt +++ b/chromium/third_party/polymer/v1_0/components_summary.txt @@ -186,12 +186,6 @@ Tree link: https://github.com/PolymerElements/paper-tooltip/tree/v2.1.1 Name: polymer Repository: https://github.com/Polymer/polymer.git -Tree: v1.11.2 -Revision: 1dcf3839b3ce058d2d87737674a25ecdd7343f9a -Tree link: https://github.com/Polymer/polymer/tree/v1.11.2 - -Name: polymer -Repository: https://github.com/Polymer/polymer.git Tree: v2.7.0 Revision: 176bc8fb41da317b1b2fa647227e6b1fd47ced11 Tree link: https://github.com/Polymer/polymer/tree/v2.7.0 diff --git a/chromium/third_party/polymer/v1_0/minify_polymer.py b/chromium/third_party/polymer/v1_0/minify_polymer.py index cb4ebb9728f..69c38a979a2 100644 --- a/chromium/third_party/polymer/v1_0/minify_polymer.py +++ b/chromium/third_party/polymer/v1_0/minify_polymer.py @@ -55,7 +55,7 @@ def main(): extracted_js = os.path.join(tmp_out_dir, 'polymer-extracted.js') node.RunNode([ node_modules.PathToUglify(), extracted_js, - '--comments', '"/Copyright|license|LICENSE/"', + '--comments', '/Copyright|license|LICENSE/', '--output', extracted_js]) # Copy generated bundled JS/HTML files back to the original location. diff --git a/chromium/third_party/polymer/v1_0/rsync_exclude.txt b/chromium/third_party/polymer/v1_0/rsync_exclude.txt index 22cad71988c..d7222351c03 100644 --- a/chromium/third_party/polymer/v1_0/rsync_exclude.txt +++ b/chromium/third_party/polymer/v1_0/rsync_exclude.txt @@ -60,6 +60,9 @@ paper-styles/element-styles/paper-item-styles.html paper-styles/paper-styles-classes.html paper-styles/paper-styles.html +# Polymer 1 +polymer/* + # neon-animations neon-animation/animations/cascaded-animation.html neon-animation/animations/hero-animation.html diff --git a/chromium/third_party/polymer/v3_0/components-chromium/polymer/polymer_bundled.js b/chromium/third_party/polymer/v3_0/components-chromium/polymer/polymer_bundled.js index 9ca420cbd1e..e0444afb826 100644 --- a/chromium/third_party/polymer/v3_0/components-chromium/polymer/polymer_bundled.js +++ b/chromium/third_party/polymer/v3_0/components-chromium/polymer/polymer_bundled.js @@ -11647,6 +11647,25 @@ function copyProperties(source, target, excludeProps) { } } +/** + * Applies a "legacy" behavior or array of behaviors to the provided class. + * + * Note: this method will automatically also apply the `LegacyElementMixin` + * to ensure that any legacy behaviors can rely on legacy Polymer API on + * the underlying element. + * + * @function + * @template T + * @param {!Object|!Array<!Object>} behaviors Behavior object or array of behaviors. + * @param {function(new:T)} klass Element class. + * @return {?} Returns a new Element class extended by the + * passed in `behaviors` and also by `LegacyElementMixin`. + * @suppress {invalidCasts, checkTypes} + */ +function mixinBehaviors(behaviors, klass) { + return GenerateClassFromInfo({}, LegacyElementMixin(klass), behaviors); +} + // NOTE: // 1.x // Behaviors were mixed in *in reverse order* and de-duped on the fly. @@ -15020,4 +15039,4 @@ Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ -export { Base, Debouncer, DomIf, OptionalMutableDataBehavior, Polymer, PolymerElement, TemplateInstanceBase, Templatizer, afterNextRender, animationFrame, beforeNextRender, calculateSplices, dashToCamelCase, dom, enqueueDebouncer, flush, gestures$1 as gestures, html, idlePeriod, matches, microTask, templatize, translate, useShadow }; +export { Base, Debouncer, DomIf, OptionalMutableDataBehavior, Polymer, PolymerElement, TemplateInstanceBase, Templatizer, afterNextRender, animationFrame, beforeNextRender, calculateSplices, dashToCamelCase, dom, enqueueDebouncer, flush, gestures$1 as gestures, html, idlePeriod, matches, microTask, mixinBehaviors, templatize, translate, useShadow }; diff --git a/chromium/third_party/polymer/v3_0/components-chromium/polymer/polymer_bundled.min.js b/chromium/third_party/polymer/v3_0/components-chromium/polymer/polymer_bundled.min.js index a9d42d0ab89..ae9e2a31f84 100644 --- a/chromium/third_party/polymer/v3_0/components-chromium/polymer/polymer_bundled.min.js +++ b/chromium/third_party/polymer/v3_0/components-chromium/polymer/polymer_bundled.min.js @@ -1 +1 @@ -window.JSCompiler_renameProperty=function(prop,obj){return prop};let scheduled=false;let beforeRenderQueue=[];let afterRenderQueue=[];function schedule(){scheduled=true;requestAnimationFrame(function(){scheduled=false;flushQueue(beforeRenderQueue);setTimeout(function(){runQueue(afterRenderQueue)})})}function flushQueue(queue){while(queue.length){callMethod(queue.shift())}}function runQueue(queue){for(let i=0,l=queue.length;i<l;i++){callMethod(queue.shift())}}function callMethod(info){const context=info[0];const callback=info[1];const args=info[2];try{callback.apply(context,args)}catch(e){setTimeout(()=>{throw e})}}function beforeNextRender(context,callback,args){if(!scheduled){schedule()}beforeRenderQueue.push([context,callback,args])}function afterNextRender(context,callback,args){if(!scheduled){schedule()}afterRenderQueue.push([context,callback,args])}let microtaskCurrHandle=0;let microtaskLastHandle=0;let microtaskCallbacks=[];let microtaskNodeContent=0;let microtaskNode=document.createTextNode("");new window.MutationObserver(microtaskFlush).observe(microtaskNode,{characterData:true});function microtaskFlush(){const len=microtaskCallbacks.length;for(let i=0;i<len;i++){let cb=microtaskCallbacks[i];if(cb){try{cb()}catch(e){setTimeout(()=>{throw e})}}}microtaskCallbacks.splice(0,len);microtaskLastHandle+=len}const timeOut={after(delay){return{run(fn){return window.setTimeout(fn,delay)},cancel(handle){window.clearTimeout(handle)}}},run(fn,delay){return window.setTimeout(fn,delay)},cancel(handle){window.clearTimeout(handle)}};const animationFrame={run(fn){return window.requestAnimationFrame(fn)},cancel(handle){window.cancelAnimationFrame(handle)}};const idlePeriod={run(fn){return window.requestIdleCallback?window.requestIdleCallback(fn):window.setTimeout(fn,16)},cancel(handle){window.cancelIdleCallback?window.cancelIdleCallback(handle):window.clearTimeout(handle)}};const microTask={run(callback){microtaskNode.textContent=microtaskNodeContent++;microtaskCallbacks.push(callback);return microtaskCurrHandle++},cancel(handle){const idx=handle-microtaskLastHandle;if(idx>=0){if(!microtaskCallbacks[idx]){throw new Error("invalid async handle: "+handle)}microtaskCallbacks[idx]=null}}};let dedupeId=0;const dedupingMixin=function(mixin){let mixinApplications=mixin.__mixinApplications;if(!mixinApplications){mixinApplications=new WeakMap;mixin.__mixinApplications=mixinApplications}let mixinDedupeId=dedupeId++;function dedupingMixin(base){let baseSet=base.__mixinSet;if(baseSet&&baseSet[mixinDedupeId]){return base}let map=mixinApplications;let extended=map.get(base);if(!extended){extended=mixin(base);map.set(base,extended)}let mixinSet=Object.create(extended.__mixinSet||baseSet||null);mixinSet[mixinDedupeId]=true;extended.__mixinSet=mixinSet;return extended}return dedupingMixin};class Debouncer{constructor(){this._asyncModule=null;this._callback=null;this._timer=null}setConfig(asyncModule,callback){this._asyncModule=asyncModule;this._callback=callback;this._timer=this._asyncModule.run(()=>{this._timer=null;debouncerQueue.delete(this);this._callback()})}cancel(){if(this.isActive()){this._cancelAsync();debouncerQueue.delete(this)}}_cancelAsync(){if(this.isActive()){this._asyncModule.cancel(this._timer);this._timer=null}}flush(){if(this.isActive()){this.cancel();this._callback()}}isActive(){return this._timer!=null}static debounce(debouncer,asyncModule,callback){if(debouncer instanceof Debouncer){debouncer._cancelAsync()}else{debouncer=new Debouncer}debouncer.setConfig(asyncModule,callback);return debouncer}}let debouncerQueue=new Set;const enqueueDebouncer=function(debouncer){debouncerQueue.add(debouncer)};const flushDebouncers=function(){const didFlush=Boolean(debouncerQueue.size);debouncerQueue.forEach(debouncer=>{try{debouncer.flush()}catch(e){setTimeout(()=>{throw e})}});return didFlush};let CSS_URL_RX=/(url\()([^)]*)(\))/g;let ABS_URL=/(^\/)|(^#)|(^[\w-\d]*:)/;let workingURL;let resolveDoc;function resolveUrl(url,baseURI){if(url&&ABS_URL.test(url)){return url}if(workingURL===undefined){workingURL=false;try{const u=new URL("b","http://a");u.pathname="c%20d";workingURL=u.href==="http://a/c%20d"}catch(e){}}if(!baseURI){baseURI=document.baseURI||window.location.href}if(workingURL){return new URL(url,baseURI).href}if(!resolveDoc){resolveDoc=document.implementation.createHTMLDocument("temp");resolveDoc.base=resolveDoc.createElement("base");resolveDoc.head.appendChild(resolveDoc.base);resolveDoc.anchor=resolveDoc.createElement("a");resolveDoc.body.appendChild(resolveDoc.anchor)}resolveDoc.base.href=baseURI;resolveDoc.anchor.href=url;return resolveDoc.anchor.href||url}function resolveCss(cssText,baseURI){return cssText.replace(CSS_URL_RX,function(m,pre,url,post){return pre+"'"+resolveUrl(url.replace(/["']/g,""),baseURI)+"'"+post})}function pathFromUrl(url){return url.substring(0,url.lastIndexOf("/")+1)}const useShadow=!window.ShadyDOM;const useNativeCSSProperties=Boolean(!window.ShadyCSS||window.ShadyCSS.nativeCss);const useNativeCustomElements=!window.customElements.polyfillWrapFlushCallback;let rootPath=pathFromUrl(document.baseURI||window.location.href);let sanitizeDOMValue=window.Polymer&&window.Polymer.sanitizeDOMValue||undefined;let passiveTouchGestures=false;let strictTemplatePolicy=false;let allowTemplateFromDomModule=false;let legacyOptimizations=false;let syncInitialRender=false;const wrap=window["ShadyDOM"]&&window["ShadyDOM"]["noPatch"]&&window["ShadyDOM"]["wrap"]?window["ShadyDOM"]["wrap"]:n=>n;let HAS_NATIVE_TA=typeof document.head.style.touchAction==="string";let GESTURE_KEY="__polymerGestures";let HANDLED_OBJ="__polymerGesturesHandled";let TOUCH_ACTION="__polymerGesturesTouchAction";let TAP_DISTANCE=25;let TRACK_DISTANCE=5;let TRACK_LENGTH=2;let MOUSE_TIMEOUT=2500;let MOUSE_EVENTS=["mousedown","mousemove","mouseup","click"];let MOUSE_WHICH_TO_BUTTONS=[0,1,4,2];let MOUSE_HAS_BUTTONS=function(){try{return new MouseEvent("test",{buttons:1}).buttons===1}catch(e){return false}}();function isMouseEvent(name){return MOUSE_EVENTS.indexOf(name)>-1}let SUPPORTS_PASSIVE=false;(function(){try{let opts=Object.defineProperty({},"passive",{get(){SUPPORTS_PASSIVE=true}});window.addEventListener("test",null,opts);window.removeEventListener("test",null,opts)}catch(e){}})();function PASSIVE_TOUCH(eventName){if(isMouseEvent(eventName)||eventName==="touchend"){return}if(HAS_NATIVE_TA&&SUPPORTS_PASSIVE&&passiveTouchGestures){return{passive:true}}else{return}}let IS_TOUCH_ONLY=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/);const clickedLabels=[];const labellable={button:true,input:true,keygen:true,meter:true,output:true,textarea:true,progress:true,select:true};const canBeDisabled={button:true,command:true,fieldset:true,input:true,keygen:true,optgroup:true,option:true,select:true,textarea:true};function canBeLabelled(el){return labellable[el.localName]||false}function matchingLabels(el){let labels=Array.prototype.slice.call(el.labels||[]);if(!labels.length){labels=[];let root=el.getRootNode();if(el.id){let matching=root.querySelectorAll(`label[for = ${el.id}]`);for(let i=0;i<matching.length;i++){labels.push(matching[i])}}}return labels}let mouseCanceller=function(mouseEvent){let sc=mouseEvent.sourceCapabilities;if(sc&&!sc.firesTouchEvents){return}mouseEvent[HANDLED_OBJ]={skip:true};if(mouseEvent.type==="click"){let clickFromLabel=false;let path=getComposedPath(mouseEvent);for(let i=0;i<path.length;i++){if(path[i].nodeType===Node.ELEMENT_NODE){if(path[i].localName==="label"){clickedLabels.push(path[i])}else if(canBeLabelled(path[i])){let ownerLabels=matchingLabels(path[i]);for(let j=0;j<ownerLabels.length;j++){clickFromLabel=clickFromLabel||clickedLabels.indexOf(ownerLabels[j])>-1}}}if(path[i]===POINTERSTATE.mouse.target){return}}if(clickFromLabel){return}mouseEvent.preventDefault();mouseEvent.stopPropagation()}};function setupTeardownMouseCanceller(setup){let events=IS_TOUCH_ONLY?["click"]:MOUSE_EVENTS;for(let i=0,en;i<events.length;i++){en=events[i];if(setup){clickedLabels.length=0;document.addEventListener(en,mouseCanceller,true)}else{document.removeEventListener(en,mouseCanceller,true)}}}function ignoreMouse(e){if(!POINTERSTATE.mouse.mouseIgnoreJob){setupTeardownMouseCanceller(true)}let unset=function(){setupTeardownMouseCanceller();POINTERSTATE.mouse.target=null;POINTERSTATE.mouse.mouseIgnoreJob=null};POINTERSTATE.mouse.target=getComposedPath(e)[0];POINTERSTATE.mouse.mouseIgnoreJob=Debouncer.debounce(POINTERSTATE.mouse.mouseIgnoreJob,timeOut.after(MOUSE_TIMEOUT),unset)}function hasLeftMouseButton(ev){let type=ev.type;if(!isMouseEvent(type)){return false}if(type==="mousemove"){let buttons=ev.buttons===undefined?1:ev.buttons;if(ev instanceof window.MouseEvent&&!MOUSE_HAS_BUTTONS){buttons=MOUSE_WHICH_TO_BUTTONS[ev.which]||0}return Boolean(buttons&1)}else{let button=ev.button===undefined?0:ev.button;return button===0}}function isSyntheticClick(ev){if(ev.type==="click"){if(ev.detail===0){return true}let t=_findOriginalTarget(ev);if(!t.nodeType||t.nodeType!==Node.ELEMENT_NODE){return true}let bcr=t.getBoundingClientRect();let x=ev.pageX,y=ev.pageY;return!(x>=bcr.left&&x<=bcr.right&&(y>=bcr.top&&y<=bcr.bottom))}return false}let POINTERSTATE={mouse:{target:null,mouseIgnoreJob:null},touch:{x:0,y:0,id:-1,scrollDecided:false}};function firstTouchAction(ev){let ta="auto";let path=getComposedPath(ev);for(let i=0,n;i<path.length;i++){n=path[i];if(n[TOUCH_ACTION]){ta=n[TOUCH_ACTION];break}}return ta}function trackDocument(stateObj,movefn,upfn){stateObj.movefn=movefn;stateObj.upfn=upfn;document.addEventListener("mousemove",movefn);document.addEventListener("mouseup",upfn)}function untrackDocument(stateObj){document.removeEventListener("mousemove",stateObj.movefn);document.removeEventListener("mouseup",stateObj.upfn);stateObj.movefn=null;stateObj.upfn=null}document.addEventListener("touchend",ignoreMouse,SUPPORTS_PASSIVE?{passive:true}:false);const getComposedPath=window.ShadyDOM&&window.ShadyDOM.noPatch?window.ShadyDOM.composedPath:event=>event.composedPath&&event.composedPath()||[];const gestures={};const recognizers=[];function deepTargetFind(x,y){let node=document.elementFromPoint(x,y);let next=node;while(next&&next.shadowRoot&&!window.ShadyDOM){let oldNext=next;next=next.shadowRoot.elementFromPoint(x,y);if(oldNext===next){break}if(next){node=next}}return node}function _findOriginalTarget(ev){const path=getComposedPath(ev);return path.length>0?path[0]:ev.target}function _handleNative(ev){let handled;let type=ev.type;let node=ev.currentTarget;let gobj=node[GESTURE_KEY];if(!gobj){return}let gs=gobj[type];if(!gs){return}if(!ev[HANDLED_OBJ]){ev[HANDLED_OBJ]={};if(type.slice(0,5)==="touch"){ev=ev;let t=ev.changedTouches[0];if(type==="touchstart"){if(ev.touches.length===1){POINTERSTATE.touch.id=t.identifier}}if(POINTERSTATE.touch.id!==t.identifier){return}if(!HAS_NATIVE_TA){if(type==="touchstart"||type==="touchmove"){_handleTouchAction(ev)}}}}handled=ev[HANDLED_OBJ];if(handled.skip){return}for(let i=0,r;i<recognizers.length;i++){r=recognizers[i];if(gs[r.name]&&!handled[r.name]){if(r.flow&&r.flow.start.indexOf(ev.type)>-1&&r.reset){r.reset()}}}for(let i=0,r;i<recognizers.length;i++){r=recognizers[i];if(gs[r.name]&&!handled[r.name]){handled[r.name]=true;r[type](ev)}}}function _handleTouchAction(ev){let t=ev.changedTouches[0];let type=ev.type;if(type==="touchstart"){POINTERSTATE.touch.x=t.clientX;POINTERSTATE.touch.y=t.clientY;POINTERSTATE.touch.scrollDecided=false}else if(type==="touchmove"){if(POINTERSTATE.touch.scrollDecided){return}POINTERSTATE.touch.scrollDecided=true;let ta=firstTouchAction(ev);let shouldPrevent=false;let dx=Math.abs(POINTERSTATE.touch.x-t.clientX);let dy=Math.abs(POINTERSTATE.touch.y-t.clientY);if(!ev.cancelable);else if(ta==="none"){shouldPrevent=true}else if(ta==="pan-x"){shouldPrevent=dy>dx}else if(ta==="pan-y"){shouldPrevent=dx>dy}if(shouldPrevent){ev.preventDefault()}else{prevent("track")}}}function addListener(node,evType,handler){if(gestures[evType]){_add(node,evType,handler);return true}return false}function removeListener(node,evType,handler){if(gestures[evType]){_remove(node,evType,handler);return true}return false}function _add(node,evType,handler){let recognizer=gestures[evType];let deps=recognizer.deps;let name=recognizer.name;let gobj=node[GESTURE_KEY];if(!gobj){node[GESTURE_KEY]=gobj={}}for(let i=0,dep,gd;i<deps.length;i++){dep=deps[i];if(IS_TOUCH_ONLY&&isMouseEvent(dep)&&dep!=="click"){continue}gd=gobj[dep];if(!gd){gobj[dep]=gd={_count:0}}if(gd._count===0){node.addEventListener(dep,_handleNative,PASSIVE_TOUCH(dep))}gd[name]=(gd[name]||0)+1;gd._count=(gd._count||0)+1}node.addEventListener(evType,handler);if(recognizer.touchAction){setTouchAction(node,recognizer.touchAction)}}function _remove(node,evType,handler){let recognizer=gestures[evType];let deps=recognizer.deps;let name=recognizer.name;let gobj=node[GESTURE_KEY];if(gobj){for(let i=0,dep,gd;i<deps.length;i++){dep=deps[i];gd=gobj[dep];if(gd&&gd[name]){gd[name]=(gd[name]||1)-1;gd._count=(gd._count||1)-1;if(gd._count===0){node.removeEventListener(dep,_handleNative,PASSIVE_TOUCH(dep))}}}}node.removeEventListener(evType,handler)}function register(recog){recognizers.push(recog);for(let i=0;i<recog.emits.length;i++){gestures[recog.emits[i]]=recog}}function _findRecognizerByEvent(evName){for(let i=0,r;i<recognizers.length;i++){r=recognizers[i];for(let j=0,n;j<r.emits.length;j++){n=r.emits[j];if(n===evName){return r}}}return null}function setTouchAction(node,value){if(HAS_NATIVE_TA&&node instanceof HTMLElement){microTask.run(()=>{node.style.touchAction=value})}node[TOUCH_ACTION]=value}function _fire(target,type,detail){let ev=new Event(type,{bubbles:true,cancelable:true,composed:true});ev.detail=detail;wrap(target).dispatchEvent(ev);if(ev.defaultPrevented){let preventer=detail.preventer||detail.sourceEvent;if(preventer&&preventer.preventDefault){preventer.preventDefault()}}}function prevent(evName){let recognizer=_findRecognizerByEvent(evName);if(recognizer.info){recognizer.info.prevent=true}}function resetMouseCanceller(){if(POINTERSTATE.mouse.mouseIgnoreJob){POINTERSTATE.mouse.mouseIgnoreJob.flush()}}register({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset:function(){untrackDocument(this.info)},mousedown:function(e){if(!hasLeftMouseButton(e)){return}let t=_findOriginalTarget(e);let self=this;let movefn=function movefn(e){if(!hasLeftMouseButton(e)){downupFire("up",t,e);untrackDocument(self.info)}};let upfn=function upfn(e){if(hasLeftMouseButton(e)){downupFire("up",t,e)}untrackDocument(self.info)};trackDocument(this.info,movefn,upfn);downupFire("down",t,e)},touchstart:function(e){downupFire("down",_findOriginalTarget(e),e.changedTouches[0],e)},touchend:function(e){downupFire("up",_findOriginalTarget(e),e.changedTouches[0],e)}});function downupFire(type,target,event,preventer){if(!target){return}_fire(target,type,{x:event.clientX,y:event.clientY,sourceEvent:event,preventer:preventer,prevent:function(e){return prevent(e)}})}register({name:"track",touchAction:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start",started:false,moves:[],addMove:function(move){if(this.moves.length>TRACK_LENGTH){this.moves.shift()}this.moves.push(move)},movefn:null,upfn:null,prevent:false},reset:function(){this.info.state="start";this.info.started=false;this.info.moves=[];this.info.x=0;this.info.y=0;this.info.prevent=false;untrackDocument(this.info)},mousedown:function(e){if(!hasLeftMouseButton(e)){return}let t=_findOriginalTarget(e);let self=this;let movefn=function movefn(e){let x=e.clientX,y=e.clientY;if(trackHasMovedEnough(self.info,x,y)){self.info.state=self.info.started?e.type==="mouseup"?"end":"track":"start";if(self.info.state==="start"){prevent("tap")}self.info.addMove({x:x,y:y});if(!hasLeftMouseButton(e)){self.info.state="end";untrackDocument(self.info)}if(t){trackFire(self.info,t,e)}self.info.started=true}};let upfn=function upfn(e){if(self.info.started){movefn(e)}untrackDocument(self.info)};trackDocument(this.info,movefn,upfn);this.info.x=e.clientX;this.info.y=e.clientY},touchstart:function(e){let ct=e.changedTouches[0];this.info.x=ct.clientX;this.info.y=ct.clientY},touchmove:function(e){let t=_findOriginalTarget(e);let ct=e.changedTouches[0];let x=ct.clientX,y=ct.clientY;if(trackHasMovedEnough(this.info,x,y)){if(this.info.state==="start"){prevent("tap")}this.info.addMove({x:x,y:y});trackFire(this.info,t,ct);this.info.state="track";this.info.started=true}},touchend:function(e){let t=_findOriginalTarget(e);let ct=e.changedTouches[0];if(this.info.started){this.info.state="end";this.info.addMove({x:ct.clientX,y:ct.clientY});trackFire(this.info,t,ct)}}});function trackHasMovedEnough(info,x,y){if(info.prevent){return false}if(info.started){return true}let dx=Math.abs(info.x-x);let dy=Math.abs(info.y-y);return dx>=TRACK_DISTANCE||dy>=TRACK_DISTANCE}function trackFire(info,target,touch){if(!target){return}let secondlast=info.moves[info.moves.length-2];let lastmove=info.moves[info.moves.length-1];let dx=lastmove.x-info.x;let dy=lastmove.y-info.y;let ddx,ddy=0;if(secondlast){ddx=lastmove.x-secondlast.x;ddy=lastmove.y-secondlast.y}_fire(target,"track",{state:info.state,x:touch.clientX,y:touch.clientY,dx:dx,dy:dy,ddx:ddx,ddy:ddy,sourceEvent:touch,hover:function(){return deepTargetFind(touch.clientX,touch.clientY)}})}register({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:false},reset:function(){this.info.x=NaN;this.info.y=NaN;this.info.prevent=false},mousedown:function(e){if(hasLeftMouseButton(e)){this.info.x=e.clientX;this.info.y=e.clientY}},click:function(e){if(hasLeftMouseButton(e)){trackForward(this.info,e)}},touchstart:function(e){const touch=e.changedTouches[0];this.info.x=touch.clientX;this.info.y=touch.clientY},touchend:function(e){trackForward(this.info,e.changedTouches[0],e)}});function trackForward(info,e,preventer){let dx=Math.abs(e.clientX-info.x);let dy=Math.abs(e.clientY-info.y);let t=_findOriginalTarget(preventer||e);if(!t||canBeDisabled[t.localName]&&t.hasAttribute("disabled")){return}if(isNaN(dx)||isNaN(dy)||dx<=TAP_DISTANCE&&dy<=TAP_DISTANCE||isSyntheticClick(e)){if(!info.prevent){_fire(t,"tap",{x:e.clientX,y:e.clientY,sourceEvent:e,preventer:preventer})}}}const findOriginalTarget=_findOriginalTarget;const add=addListener;const remove=removeListener;var gestures$1=Object.freeze({gestures:gestures,recognizers:recognizers,deepTargetFind:deepTargetFind,addListener:addListener,removeListener:removeListener,register:register,setTouchAction:setTouchAction,prevent:prevent,resetMouseCanceller:resetMouseCanceller,findOriginalTarget:findOriginalTarget,add:add,remove:remove});const nativeShadow=!(window["ShadyDOM"]&&window["ShadyDOM"]["inUse"]);let nativeCssVariables_;function calcCssVariables(settings){if(settings&&settings["shimcssproperties"]){nativeCssVariables_=false}else{nativeCssVariables_=nativeShadow||Boolean(!navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)&&window.CSS&&CSS.supports&&CSS.supports("box-shadow","0 0 0 var(--foo)"))}}let cssBuild;if(window.ShadyCSS&&window.ShadyCSS.cssBuild!==undefined){cssBuild=window.ShadyCSS.cssBuild}const disableRuntime=Boolean(window.ShadyCSS&&window.ShadyCSS.disableRuntime);if(window.ShadyCSS&&window.ShadyCSS.nativeCss!==undefined){nativeCssVariables_=window.ShadyCSS.nativeCss}else if(window.ShadyCSS){calcCssVariables(window.ShadyCSS);window.ShadyCSS=undefined}else{calcCssVariables(window["WebComponents"]&&window["WebComponents"]["flags"])}const nativeCssVariables=nativeCssVariables_;class StyleNode{constructor(){this["start"]=0;this["end"]=0;this["previous"]=null;this["parent"]=null;this["rules"]=null;this["parsedCssText"]="";this["cssText"]="";this["atRule"]=false;this["type"]=0;this["keyframesName"]="";this["selector"]="";this["parsedSelector"]=""}}function parse(text){text=clean(text);return parseCss(lex(text),text)}function clean(cssText){return cssText.replace(RX.comments,"").replace(RX.port,"")}function lex(text){let root=new StyleNode;root["start"]=0;root["end"]=text.length;let n=root;for(let i=0,l=text.length;i<l;i++){if(text[i]===OPEN_BRACE){if(!n["rules"]){n["rules"]=[]}let p=n;let previous=p["rules"][p["rules"].length-1]||null;n=new StyleNode;n["start"]=i+1;n["parent"]=p;n["previous"]=previous;p["rules"].push(n)}else if(text[i]===CLOSE_BRACE){n["end"]=i+1;n=n["parent"]||root}}return root}function parseCss(node,text){let t=text.substring(node["start"],node["end"]-1);node["parsedCssText"]=node["cssText"]=t.trim();if(node["parent"]){let ss=node["previous"]?node["previous"]["end"]:node["parent"]["start"];t=text.substring(ss,node["start"]-1);t=_expandUnicodeEscapes(t);t=t.replace(RX.multipleSpaces," ");t=t.substring(t.lastIndexOf(";")+1);let s=node["parsedSelector"]=node["selector"]=t.trim();node["atRule"]=s.indexOf(AT_START)===0;if(node["atRule"]){if(s.indexOf(MEDIA_START)===0){node["type"]=types.MEDIA_RULE}else if(s.match(RX.keyframesRule)){node["type"]=types.KEYFRAMES_RULE;node["keyframesName"]=node["selector"].split(RX.multipleSpaces).pop()}}else{if(s.indexOf(VAR_START)===0){node["type"]=types.MIXIN_RULE}else{node["type"]=types.STYLE_RULE}}}let r$=node["rules"];if(r$){for(let i=0,l=r$.length,r;i<l&&(r=r$[i]);i++){parseCss(r,text)}}return node}function _expandUnicodeEscapes(s){return s.replace(/\\([0-9a-f]{1,6})\s/gi,function(){let code=arguments[1],repeat=6-code.length;while(repeat--){code="0"+code}return"\\"+code})}function stringify(node,preserveProperties,text=""){let cssText="";if(node["cssText"]||node["rules"]){let r$=node["rules"];if(r$&&!_hasMixinRules(r$)){for(let i=0,l=r$.length,r;i<l&&(r=r$[i]);i++){cssText=stringify(r,preserveProperties,cssText)}}else{cssText=preserveProperties?node["cssText"]:removeCustomProps(node["cssText"]);cssText=cssText.trim();if(cssText){cssText=" "+cssText+"\n"}}}if(cssText){if(node["selector"]){text+=node["selector"]+" "+OPEN_BRACE+"\n"}text+=cssText;if(node["selector"]){text+=CLOSE_BRACE+"\n\n"}}return text}function _hasMixinRules(rules){let r=rules[0];return Boolean(r)&&Boolean(r["selector"])&&r["selector"].indexOf(VAR_START)===0}function removeCustomProps(cssText){cssText=removeCustomPropAssignment(cssText);return removeCustomPropApply(cssText)}function removeCustomPropAssignment(cssText){return cssText.replace(RX.customProp,"").replace(RX.mixinProp,"")}function removeCustomPropApply(cssText){return cssText.replace(RX.mixinApply,"").replace(RX.varApply,"")}const types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3};const OPEN_BRACE="{";const CLOSE_BRACE="}";const RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g};const VAR_START="--";const MEDIA_START="@media";const AT_START="@";const VAR_ASSIGN=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi;const MIXIN_MATCH=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi;const MEDIA_MATCH=/@media\s(.*)/;const styleTextSet=new Set;const scopingAttribute="shady-unscoped";function processUnscopedStyle(style){const text=style.textContent;if(!styleTextSet.has(text)){styleTextSet.add(text);const newStyle=style.cloneNode(true);document.head.appendChild(newStyle)}}function isUnscopedStyle(style){return style.hasAttribute(scopingAttribute)}function toCssText(rules,callback){if(!rules){return""}if(typeof rules==="string"){rules=parse(rules)}if(callback){forEachRule(rules,callback)}return stringify(rules,nativeCssVariables)}function rulesForStyle(style){if(!style["__cssRules"]&&style.textContent){style["__cssRules"]=parse(style.textContent)}return style["__cssRules"]||null}function forEachRule(node,styleRuleCallback,keyframesRuleCallback,onlyActiveRules){if(!node){return}let skipRules=false;let type=node["type"];if(onlyActiveRules){if(type===types.MEDIA_RULE){let matchMedia=node["selector"].match(MEDIA_MATCH);if(matchMedia){if(!window.matchMedia(matchMedia[1]).matches){skipRules=true}}}}if(type===types.STYLE_RULE){styleRuleCallback(node)}else if(keyframesRuleCallback&&type===types.KEYFRAMES_RULE){keyframesRuleCallback(node)}else if(type===types.MIXIN_RULE){skipRules=true}let r$=node["rules"];if(r$&&!skipRules){for(let i=0,l=r$.length,r;i<l&&(r=r$[i]);i++){forEachRule(r,styleRuleCallback,keyframesRuleCallback,onlyActiveRules)}}}function findMatchingParen(text,start){let level=0;for(let i=start,l=text.length;i<l;i++){if(text[i]==="("){level++}else if(text[i]===")"){if(--level===0){return i}}}return-1}function processVariableAndFallback(str,callback){let start=str.indexOf("var(");if(start===-1){return callback(str,"","","")}let end=findMatchingParen(str,start+3);let inner=str.substring(start+4,end);let prefix=str.substring(0,start);let suffix=processVariableAndFallback(str.substring(end+1),callback);let comma=inner.indexOf(",");if(comma===-1){return callback(prefix,inner.trim(),"",suffix)}let value=inner.substring(0,comma).trim();let fallback=inner.substring(comma+1).trim();return callback(prefix,value,fallback,suffix)}const wrap$1=window["ShadyDOM"]&&window["ShadyDOM"]["wrap"]||(node=>node);function getIsExtends(element){let localName=element["localName"];let is="",typeExtension="";if(localName){if(localName.indexOf("-")>-1){is=localName}else{typeExtension=localName;is=element.getAttribute&&element.getAttribute("is")||""}}else{is=element.is;typeExtension=element.extends}return{is:is,typeExtension:typeExtension}}function gatherStyleText(element){const styleTextParts=[];const styles=element.querySelectorAll("style");for(let i=0;i<styles.length;i++){const style=styles[i];if(isUnscopedStyle(style)){if(!nativeShadow){processUnscopedStyle(style);style.parentNode.removeChild(style)}}else{styleTextParts.push(style.textContent);style.parentNode.removeChild(style)}}return styleTextParts.join("").trim()}const CSS_BUILD_ATTR="css-build";function getCssBuild(element){if(cssBuild!==undefined){return cssBuild}if(element.__cssBuild===undefined){const attrValue=element.getAttribute(CSS_BUILD_ATTR);if(attrValue){element.__cssBuild=attrValue}else{const buildComment=getBuildComment(element);if(buildComment!==""){removeBuildComment(element)}element.__cssBuild=buildComment}}return element.__cssBuild||""}function elementHasBuiltCss(element){return getCssBuild(element)!==""}function getBuildComment(element){const buildComment=element.localName==="template"?element.content.firstChild:element.firstChild;if(buildComment instanceof Comment){const commentParts=buildComment.textContent.trim().split(":");if(commentParts[0]===CSS_BUILD_ATTR){return commentParts[1]}}return""}function removeBuildComment(element){const buildComment=element.localName==="template"?element.content.firstChild:element.firstChild;buildComment.parentNode.removeChild(buildComment)}function updateNativeProperties(element,properties){for(let p in properties){if(p===null){element.style.removeProperty(p)}else{element.style.setProperty(p,properties[p])}}}function getComputedStyleValue(element,property){const value=window.getComputedStyle(element).getPropertyValue(property);if(!value){return""}else{return value.trim()}}function detectMixin(cssText){const has=MIXIN_MATCH.test(cssText)||VAR_ASSIGN.test(cssText);MIXIN_MATCH.lastIndex=0;VAR_ASSIGN.lastIndex=0;return has}const APPLY_NAME_CLEAN=/;\s*/m;const INITIAL_INHERIT=/^\s*(initial)|(inherit)\s*$/;const IMPORTANT=/\s*!important/;const MIXIN_VAR_SEP="_-_";class MixinMap{constructor(){this._map={}}set(name,props){name=name.trim();this._map[name]={properties:props,dependants:{}}}get(name){name=name.trim();return this._map[name]||null}}let invalidCallback=null;class ApplyShim{constructor(){this._currentElement=null;this._measureElement=null;this._map=new MixinMap}detectMixin(cssText){return detectMixin(cssText)}gatherStyles(template){const styleText=gatherStyleText(template.content);if(styleText){const style=document.createElement("style");style.textContent=styleText;template.content.insertBefore(style,template.content.firstChild);return style}return null}transformTemplate(template,elementName){if(template._gatheredStyle===undefined){template._gatheredStyle=this.gatherStyles(template)}const style=template._gatheredStyle;return style?this.transformStyle(style,elementName):null}transformStyle(style,elementName=""){let ast=rulesForStyle(style);this.transformRules(ast,elementName);style.textContent=toCssText(ast);return ast}transformCustomStyle(style){let ast=rulesForStyle(style);forEachRule(ast,rule=>{if(rule["selector"]===":root"){rule["selector"]="html"}this.transformRule(rule)});style.textContent=toCssText(ast);return ast}transformRules(rules,elementName){this._currentElement=elementName;forEachRule(rules,r=>{this.transformRule(r)});this._currentElement=null}transformRule(rule){rule["cssText"]=this.transformCssText(rule["parsedCssText"],rule);if(rule["selector"]===":root"){rule["selector"]=":host > *"}}transformCssText(cssText,rule){cssText=cssText.replace(VAR_ASSIGN,(matchText,propertyName,valueProperty,valueMixin)=>this._produceCssProperties(matchText,propertyName,valueProperty,valueMixin,rule));return this._consumeCssProperties(cssText,rule)}_getInitialValueForProperty(property){if(!this._measureElement){this._measureElement=document.createElement("meta");this._measureElement.setAttribute("apply-shim-measure","");this._measureElement.style.all="initial";document.head.appendChild(this._measureElement)}return window.getComputedStyle(this._measureElement).getPropertyValue(property)}_fallbacksFromPreviousRules(startRule){let topRule=startRule;while(topRule["parent"]){topRule=topRule["parent"]}const fallbacks={};let seenStartRule=false;forEachRule(topRule,r=>{seenStartRule=seenStartRule||r===startRule;if(seenStartRule){return}if(r["selector"]===startRule["selector"]){Object.assign(fallbacks,this._cssTextToMap(r["parsedCssText"]))}});return fallbacks}_consumeCssProperties(text,rule){let m=null;while(m=MIXIN_MATCH.exec(text)){let matchText=m[0];let mixinName=m[1];let idx=m.index;let applyPos=idx+matchText.indexOf("@apply");let afterApplyPos=idx+matchText.length;let textBeforeApply=text.slice(0,applyPos);let textAfterApply=text.slice(afterApplyPos);let defaults=rule?this._fallbacksFromPreviousRules(rule):{};Object.assign(defaults,this._cssTextToMap(textBeforeApply));let replacement=this._atApplyToCssProperties(mixinName,defaults);text=`${textBeforeApply}${replacement}${textAfterApply}`;MIXIN_MATCH.lastIndex=idx+replacement.length}return text}_atApplyToCssProperties(mixinName,fallbacks){mixinName=mixinName.replace(APPLY_NAME_CLEAN,"");let vars=[];let mixinEntry=this._map.get(mixinName);if(!mixinEntry){this._map.set(mixinName,{});mixinEntry=this._map.get(mixinName)}if(mixinEntry){if(this._currentElement){mixinEntry.dependants[this._currentElement]=true}let p,parts,f;const properties=mixinEntry.properties;for(p in properties){f=fallbacks&&fallbacks[p];parts=[p,": var(",mixinName,MIXIN_VAR_SEP,p];if(f){parts.push(",",f.replace(IMPORTANT,""))}parts.push(")");if(IMPORTANT.test(properties[p])){parts.push(" !important")}vars.push(parts.join(""))}}return vars.join("; ")}_replaceInitialOrInherit(property,value){let match=INITIAL_INHERIT.exec(value);if(match){if(match[1]){value=this._getInitialValueForProperty(property)}else{value="apply-shim-inherit"}}return value}_cssTextToMap(text,replaceInitialOrInherit=false){let props=text.split(";");let property,value;let out={};for(let i=0,p,sp;i<props.length;i++){p=props[i];if(p){sp=p.split(":");if(sp.length>1){property=sp[0].trim();value=sp.slice(1).join(":");if(replaceInitialOrInherit){value=this._replaceInitialOrInherit(property,value)}out[property]=value}}}return out}_invalidateMixinEntry(mixinEntry){if(!invalidCallback){return}for(let elementName in mixinEntry.dependants){if(elementName!==this._currentElement){invalidCallback(elementName)}}}_produceCssProperties(matchText,propertyName,valueProperty,valueMixin,rule){if(valueProperty){processVariableAndFallback(valueProperty,(prefix,value)=>{if(value&&this._map.get(value)){valueMixin=`@apply ${value};`}})}if(!valueMixin){return matchText}let mixinAsProperties=this._consumeCssProperties(""+valueMixin,rule);let prefix=matchText.slice(0,matchText.indexOf("--"));let mixinValues=this._cssTextToMap(mixinAsProperties,true);let combinedProps=mixinValues;let mixinEntry=this._map.get(propertyName);let oldProps=mixinEntry&&mixinEntry.properties;if(oldProps){combinedProps=Object.assign(Object.create(oldProps),mixinValues)}else{this._map.set(propertyName,combinedProps)}let out=[];let p,v;let needToInvalidate=false;for(p in combinedProps){v=mixinValues[p];if(v===undefined){v="initial"}if(oldProps&&!(p in oldProps)){needToInvalidate=true}out.push(`${propertyName}${MIXIN_VAR_SEP}${p}: ${v}`)}if(needToInvalidate){this._invalidateMixinEntry(mixinEntry)}if(mixinEntry){mixinEntry.properties=combinedProps}if(valueProperty){prefix=`${matchText};${prefix}`}return`${prefix}${out.join("; ")};`}}ApplyShim.prototype["detectMixin"]=ApplyShim.prototype.detectMixin;ApplyShim.prototype["transformStyle"]=ApplyShim.prototype.transformStyle;ApplyShim.prototype["transformCustomStyle"]=ApplyShim.prototype.transformCustomStyle;ApplyShim.prototype["transformRules"]=ApplyShim.prototype.transformRules;ApplyShim.prototype["transformRule"]=ApplyShim.prototype.transformRule;ApplyShim.prototype["transformTemplate"]=ApplyShim.prototype.transformTemplate;ApplyShim.prototype["_separator"]=MIXIN_VAR_SEP;Object.defineProperty(ApplyShim.prototype,"invalidCallback",{get(){return invalidCallback},set(cb){invalidCallback=cb}});const templateMap={};const CURRENT_VERSION="_applyShimCurrentVersion";const NEXT_VERSION="_applyShimNextVersion";const VALIDATING_VERSION="_applyShimValidatingVersion";const promise=Promise.resolve();function invalidate(elementName){let template=templateMap[elementName];if(template){invalidateTemplate(template)}}function invalidateTemplate(template){template[CURRENT_VERSION]=template[CURRENT_VERSION]||0;template[VALIDATING_VERSION]=template[VALIDATING_VERSION]||0;template[NEXT_VERSION]=(template[NEXT_VERSION]||0)+1}function templateIsValid(template){return template[CURRENT_VERSION]===template[NEXT_VERSION]}function templateIsValidating(template){return!templateIsValid(template)&&template[VALIDATING_VERSION]===template[NEXT_VERSION]}function startValidatingTemplate(template){template[VALIDATING_VERSION]=template[NEXT_VERSION];if(!template._validating){template._validating=true;promise.then(function(){template[CURRENT_VERSION]=template[NEXT_VERSION];template._validating=false})}}let readyPromise=null;let whenReady=window["HTMLImports"]&&window["HTMLImports"]["whenReady"]||null;let resolveFn;function documentWait(callback){requestAnimationFrame(function(){if(whenReady){whenReady(callback)}else{if(!readyPromise){readyPromise=new Promise(resolve=>{resolveFn=resolve});if(document.readyState==="complete"){resolveFn()}else{document.addEventListener("readystatechange",()=>{if(document.readyState==="complete"){resolveFn()}})}}readyPromise.then(function(){callback&&callback()})}})}const SEEN_MARKER="__seenByShadyCSS";const CACHED_STYLE="__shadyCSSCachedStyle";let transformFn=null;let validateFn=null;class CustomStyleInterface{constructor(){this["customStyles"]=[];this["enqueued"]=false;documentWait(()=>{if(window["ShadyCSS"]["flushCustomStyles"]){window["ShadyCSS"]["flushCustomStyles"]()}})}enqueueDocumentValidation(){if(this["enqueued"]||!validateFn){return}this["enqueued"]=true;documentWait(validateFn)}addCustomStyle(style){if(!style[SEEN_MARKER]){style[SEEN_MARKER]=true;this["customStyles"].push(style);this.enqueueDocumentValidation()}}getStyleForCustomStyle(customStyle){if(customStyle[CACHED_STYLE]){return customStyle[CACHED_STYLE]}let style;if(customStyle["getStyle"]){style=customStyle["getStyle"]()}else{style=customStyle}return style}processStyles(){const cs=this["customStyles"];for(let i=0;i<cs.length;i++){const customStyle=cs[i];if(customStyle[CACHED_STYLE]){continue}const style=this.getStyleForCustomStyle(customStyle);if(style){const styleToTransform=style["__appliedElement"]||style;if(transformFn){transformFn(styleToTransform)}customStyle[CACHED_STYLE]=styleToTransform}}return cs}}CustomStyleInterface.prototype["addCustomStyle"]=CustomStyleInterface.prototype.addCustomStyle;CustomStyleInterface.prototype["getStyleForCustomStyle"]=CustomStyleInterface.prototype.getStyleForCustomStyle;CustomStyleInterface.prototype["processStyles"]=CustomStyleInterface.prototype.processStyles;Object.defineProperties(CustomStyleInterface.prototype,{transformCallback:{get(){return transformFn},set(fn){transformFn=fn}},validateCallback:{get(){return validateFn},set(fn){let needsEnqueue=false;if(!validateFn){needsEnqueue=true}validateFn=fn;if(needsEnqueue){this.enqueueDocumentValidation()}}}});const applyShim=new ApplyShim;class ApplyShimInterface{constructor(){this.customStyleInterface=null;applyShim["invalidCallback"]=invalidate}ensure(){if(this.customStyleInterface){return}if(window.ShadyCSS.CustomStyleInterface){this.customStyleInterface=window.ShadyCSS.CustomStyleInterface;this.customStyleInterface["transformCallback"]=(style=>{applyShim.transformCustomStyle(style)});this.customStyleInterface["validateCallback"]=(()=>{requestAnimationFrame(()=>{if(this.customStyleInterface["enqueued"]){this.flushCustomStyles()}})})}}prepareTemplate(template,elementName){this.ensure();if(elementHasBuiltCss(template)){return}templateMap[elementName]=template;let ast=applyShim.transformTemplate(template,elementName);template["_styleAst"]=ast}flushCustomStyles(){this.ensure();if(!this.customStyleInterface){return}let styles=this.customStyleInterface["processStyles"]();if(!this.customStyleInterface["enqueued"]){return}for(let i=0;i<styles.length;i++){let cs=styles[i];let style=this.customStyleInterface["getStyleForCustomStyle"](cs);if(style){applyShim.transformCustomStyle(style)}}this.customStyleInterface["enqueued"]=false}styleSubtree(element,properties){this.ensure();if(properties){updateNativeProperties(element,properties)}if(element.shadowRoot){this.styleElement(element);let shadowChildren=element.shadowRoot.children||element.shadowRoot.childNodes;for(let i=0;i<shadowChildren.length;i++){this.styleSubtree(shadowChildren[i])}}else{let children=element.children||element.childNodes;for(let i=0;i<children.length;i++){this.styleSubtree(children[i])}}}styleElement(element){this.ensure();let{is:is}=getIsExtends(element);let template=templateMap[is];if(template&&elementHasBuiltCss(template)){return}if(template&&!templateIsValid(template)){if(!templateIsValidating(template)){this.prepareTemplate(template,is);startValidatingTemplate(template)}let root=element.shadowRoot;if(root){let style=root.querySelector("style");if(style){style["__cssRules"]=template["_styleAst"];style.textContent=toCssText(template["_styleAst"])}}}}styleDocument(properties){this.ensure();this.styleSubtree(document.body,properties)}}if(!window.ShadyCSS||!window.ShadyCSS.ScopingShim){const applyShimInterface=new ApplyShimInterface;let CustomStyleInterface=window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface;window.ShadyCSS={prepareTemplate(template,elementName,elementExtends){applyShimInterface.flushCustomStyles();applyShimInterface.prepareTemplate(template,elementName)},prepareTemplateStyles(template,elementName,elementExtends){window.ShadyCSS.prepareTemplate(template,elementName,elementExtends)},prepareTemplateDom(template,elementName){},styleSubtree(element,properties){applyShimInterface.flushCustomStyles();applyShimInterface.styleSubtree(element,properties)},styleElement(element){applyShimInterface.flushCustomStyles();applyShimInterface.styleElement(element)},styleDocument(properties){applyShimInterface.flushCustomStyles();applyShimInterface.styleDocument(properties)},getComputedStyleValue(element,property){return getComputedStyleValue(element,property)},flushCustomStyles(){applyShimInterface.flushCustomStyles()},nativeCss:nativeCssVariables,nativeShadow:nativeShadow,cssBuild:cssBuild,disableRuntime:disableRuntime};if(CustomStyleInterface){window.ShadyCSS.CustomStyleInterface=CustomStyleInterface}}window.ShadyCSS.ApplyShim=applyShim;let modules={};let lcModules={};function setModule(id,module){modules[id]=lcModules[id.toLowerCase()]=module}function findModule(id){return modules[id]||lcModules[id.toLowerCase()]}function styleOutsideTemplateCheck(inst){if(inst.querySelector("style")){console.warn("dom-module %s has style outside template",inst.id)}}class DomModule extends HTMLElement{static get observedAttributes(){return["id"]}static import(id,selector){if(id){let m=findModule(id);if(m&&selector){return m.querySelector(selector)}return m}return null}attributeChangedCallback(name,old,value,namespace){if(old!==value){this.register()}}get assetpath(){if(!this.__assetpath){const owner=window.HTMLImports&&HTMLImports.importForElement?HTMLImports.importForElement(this)||document:this.ownerDocument;const url=resolveUrl(this.getAttribute("assetpath")||"",owner.baseURI);this.__assetpath=pathFromUrl(url)}return this.__assetpath}register(id){id=id||this.id;if(id){if(strictTemplatePolicy&&findModule(id)!==undefined){setModule(id,null);throw new Error(`strictTemplatePolicy: dom-module ${id} re-registered`)}this.id=id;setModule(id,this);styleOutsideTemplateCheck(this)}}}DomModule.prototype["modules"]=modules;customElements.define("dom-module",DomModule);const MODULE_STYLE_LINK_SELECTOR="link[rel=import][type~=css]";const INCLUDE_ATTR="include";const SHADY_UNSCOPED_ATTR="shady-unscoped";function importModule(moduleId){return DomModule.import(moduleId)}function styleForImport(importDoc){let container=importDoc.body?importDoc.body:importDoc;const importCss=resolveCss(container.textContent,importDoc.baseURI);const style=document.createElement("style");style.textContent=importCss;return style}function stylesFromModules(moduleIds){const modules=moduleIds.trim().split(/\s+/);const styles=[];for(let i=0;i<modules.length;i++){styles.push(...stylesFromModule(modules[i]))}return styles}function stylesFromModule(moduleId){const m=importModule(moduleId);if(!m){console.warn("Could not find style data in module named",moduleId);return[]}if(m._styles===undefined){const styles=[];styles.push(..._stylesFromModuleImports(m));const template=m.querySelector("template");if(template){styles.push(...stylesFromTemplate(template,m.assetpath))}m._styles=styles}return m._styles}function stylesFromTemplate(template,baseURI){if(!template._styles){const styles=[];const e$=template.content.querySelectorAll("style");for(let i=0;i<e$.length;i++){let e=e$[i];let include=e.getAttribute(INCLUDE_ATTR);if(include){styles.push(...stylesFromModules(include).filter(function(item,index,self){return self.indexOf(item)===index}))}if(baseURI){e.textContent=resolveCss(e.textContent,baseURI)}styles.push(e)}template._styles=styles}return template._styles}function stylesFromModuleImports(moduleId){let m=importModule(moduleId);return m?_stylesFromModuleImports(m):[]}function _stylesFromModuleImports(module){const styles=[];const p$=module.querySelectorAll(MODULE_STYLE_LINK_SELECTOR);for(let i=0;i<p$.length;i++){let p=p$[i];if(p.import){const importDoc=p.import;const unscoped=p.hasAttribute(SHADY_UNSCOPED_ATTR);if(unscoped&&!importDoc._unscopedStyle){const style=styleForImport(importDoc);style.setAttribute(SHADY_UNSCOPED_ATTR,"");importDoc._unscopedStyle=style}else if(!importDoc._style){importDoc._style=styleForImport(importDoc)}styles.push(unscoped?importDoc._unscopedStyle:importDoc._style)}}return styles}function cssFromModules(moduleIds){let modules=moduleIds.trim().split(/\s+/);let cssText="";for(let i=0;i<modules.length;i++){cssText+=cssFromModule(modules[i])}return cssText}function cssFromModule(moduleId){let m=importModule(moduleId);if(m&&m._cssText===undefined){let cssText=_cssFromModuleImports(m);let t=m.querySelector("template");if(t){cssText+=cssFromTemplate(t,m.assetpath)}m._cssText=cssText||null}if(!m){console.warn("Could not find style data in module named",moduleId)}return m&&m._cssText||""}function cssFromTemplate(template,baseURI){let cssText="";const e$=stylesFromTemplate(template,baseURI);for(let i=0;i<e$.length;i++){let e=e$[i];if(e.parentNode){e.parentNode.removeChild(e)}cssText+=e.textContent}return cssText}function _cssFromModuleImports(module){let cssText="";let styles=_stylesFromModuleImports(module);for(let i=0;i<styles.length;i++){cssText+=styles[i].textContent}return cssText}function isPath(path){return path.indexOf(".")>=0}function root(path){let dotIndex=path.indexOf(".");if(dotIndex===-1){return path}return path.slice(0,dotIndex)}function isAncestor(base,path){return base.indexOf(path+".")===0}function isDescendant(base,path){return path.indexOf(base+".")===0}function translate(base,newBase,path){return newBase+path.slice(base.length)}function matches(base,path){return base===path||isAncestor(base,path)||isDescendant(base,path)}function normalize(path){if(Array.isArray(path)){let parts=[];for(let i=0;i<path.length;i++){let args=path[i].toString().split(".");for(let j=0;j<args.length;j++){parts.push(args[j])}}return parts.join(".")}else{return path}}function split(path){if(Array.isArray(path)){return normalize(path).split(".")}return path.toString().split(".")}function get(root,path,info){let prop=root;let parts=split(path);for(let i=0;i<parts.length;i++){if(!prop){return}let part=parts[i];prop=prop[part]}if(info){info.path=parts.join(".")}return prop}function set(root,path,value){let prop=root;let parts=split(path);let last=parts[parts.length-1];if(parts.length>1){for(let i=0;i<parts.length-1;i++){let part=parts[i];prop=prop[part];if(!prop){return}}prop[last]=value}else{prop[path]=value}return parts.join(".")}const caseMap={};const DASH_TO_CAMEL=/-[a-z]/g;const CAMEL_TO_DASH=/([A-Z])/g;function dashToCamelCase(dash){return caseMap[dash]||(caseMap[dash]=dash.indexOf("-")<0?dash:dash.replace(DASH_TO_CAMEL,m=>m[1].toUpperCase()))}function camelToDashCase(camel){return caseMap[camel]||(caseMap[camel]=camel.replace(CAMEL_TO_DASH,"-$1").toLowerCase())}const microtask=microTask;const PropertiesChanged=dedupingMixin(superClass=>{class PropertiesChanged extends superClass{static createProperties(props){const proto=this.prototype;for(let prop in props){if(!(prop in proto)){proto._createPropertyAccessor(prop)}}}static attributeNameForProperty(property){return property.toLowerCase()}static typeForProperty(name){}_createPropertyAccessor(property,readOnly){this._addPropertyToAttributeMap(property);if(!this.hasOwnProperty("__dataHasAccessor")){this.__dataHasAccessor=Object.assign({},this.__dataHasAccessor)}if(!this.__dataHasAccessor[property]){this.__dataHasAccessor[property]=true;this._definePropertyAccessor(property,readOnly)}}_addPropertyToAttributeMap(property){if(!this.hasOwnProperty("__dataAttributes")){this.__dataAttributes=Object.assign({},this.__dataAttributes)}if(!this.__dataAttributes[property]){const attr=this.constructor.attributeNameForProperty(property);this.__dataAttributes[attr]=property}}_definePropertyAccessor(property,readOnly){Object.defineProperty(this,property,{get(){return this._getProperty(property)},set:readOnly?function(){}:function(value){this._setProperty(property,value)}})}constructor(){super();this.__dataEnabled=false;this.__dataReady=false;this.__dataInvalid=false;this.__data={};this.__dataPending=null;this.__dataOld=null;this.__dataInstanceProps=null;this.__serializing=false;this._initializeProperties()}ready(){this.__dataReady=true;this._flushProperties()}_initializeProperties(){for(let p in this.__dataHasAccessor){if(this.hasOwnProperty(p)){this.__dataInstanceProps=this.__dataInstanceProps||{};this.__dataInstanceProps[p]=this[p];delete this[p]}}}_initializeInstanceProperties(props){Object.assign(this,props)}_setProperty(property,value){if(this._setPendingProperty(property,value)){this._invalidateProperties()}}_getProperty(property){return this.__data[property]}_setPendingProperty(property,value,ext){let old=this.__data[property];let changed=this._shouldPropertyChange(property,value,old);if(changed){if(!this.__dataPending){this.__dataPending={};this.__dataOld={}}if(this.__dataOld&&!(property in this.__dataOld)){this.__dataOld[property]=old}this.__data[property]=value;this.__dataPending[property]=value}return changed}_invalidateProperties(){if(!this.__dataInvalid&&this.__dataReady){this.__dataInvalid=true;microtask.run(()=>{if(this.__dataInvalid){this.__dataInvalid=false;this._flushProperties()}})}}_enableProperties(){if(!this.__dataEnabled){this.__dataEnabled=true;if(this.__dataInstanceProps){this._initializeInstanceProperties(this.__dataInstanceProps);this.__dataInstanceProps=null}this.ready()}}_flushProperties(){const props=this.__data;const changedProps=this.__dataPending;const old=this.__dataOld;if(this._shouldPropertiesChange(props,changedProps,old)){this.__dataPending=null;this.__dataOld=null;this._propertiesChanged(props,changedProps,old)}}_shouldPropertiesChange(currentProps,changedProps,oldProps){return Boolean(changedProps)}_propertiesChanged(currentProps,changedProps,oldProps){}_shouldPropertyChange(property,value,old){return old!==value&&(old===old||value===value)}attributeChangedCallback(name,old,value,namespace){if(old!==value){this._attributeToProperty(name,value)}if(super.attributeChangedCallback){super.attributeChangedCallback(name,old,value,namespace)}}_attributeToProperty(attribute,value,type){if(!this.__serializing){const map=this.__dataAttributes;const property=map&&map[attribute]||attribute;this[property]=this._deserializeValue(value,type||this.constructor.typeForProperty(property))}}_propertyToAttribute(property,attribute,value){this.__serializing=true;value=arguments.length<3?this[property]:value;this._valueToNodeAttribute(this,value,attribute||this.constructor.attributeNameForProperty(property));this.__serializing=false}_valueToNodeAttribute(node,value,attribute){const str=this._serializeValue(value);if(str===undefined){node.removeAttribute(attribute)}else{if(attribute==="class"||attribute==="name"||attribute==="slot"){node=wrap(node)}node.setAttribute(attribute,str)}}_serializeValue(value){switch(typeof value){case"boolean":return value?"":undefined;default:return value!=null?value.toString():undefined}}_deserializeValue(value,type){switch(type){case Boolean:return value!==null;case Number:return Number(value);default:return value}}}return PropertiesChanged});const nativeProperties={};let proto=HTMLElement.prototype;while(proto){let props=Object.getOwnPropertyNames(proto);for(let i=0;i<props.length;i++){nativeProperties[props[i]]=true}proto=Object.getPrototypeOf(proto)}function saveAccessorValue(model,property){if(!nativeProperties[property]){let value=model[property];if(value!==undefined){if(model.__data){model._setPendingProperty(property,value)}else{if(!model.__dataProto){model.__dataProto={}}else if(!model.hasOwnProperty(JSCompiler_renameProperty("__dataProto",model))){model.__dataProto=Object.create(model.__dataProto)}model.__dataProto[property]=value}}}}const PropertyAccessors=dedupingMixin(superClass=>{const base=PropertiesChanged(superClass);class PropertyAccessors extends base{static createPropertiesForAttributes(){let a$=this.observedAttributes;for(let i=0;i<a$.length;i++){this.prototype._createPropertyAccessor(dashToCamelCase(a$[i]))}}static attributeNameForProperty(property){return camelToDashCase(property)}_initializeProperties(){if(this.__dataProto){this._initializeProtoProperties(this.__dataProto);this.__dataProto=null}super._initializeProperties()}_initializeProtoProperties(props){for(let p in props){this._setProperty(p,props[p])}}_ensureAttribute(attribute,value){const el=this;if(!el.hasAttribute(attribute)){this._valueToNodeAttribute(el,value,attribute)}}_serializeValue(value){switch(typeof value){case"object":if(value instanceof Date){return value.toString()}else if(value){try{return JSON.stringify(value)}catch(x){return""}}default:return super._serializeValue(value)}}_deserializeValue(value,type){let outValue;switch(type){case Object:try{outValue=JSON.parse(value)}catch(x){outValue=value}break;case Array:try{outValue=JSON.parse(value)}catch(x){outValue=null;console.warn(`Polymer::Attributes: couldn't decode Array as JSON: ${value}`)}break;case Date:outValue=isNaN(value)?String(value):Number(value);outValue=new Date(outValue);break;default:outValue=super._deserializeValue(value,type);break}return outValue}_definePropertyAccessor(property,readOnly){saveAccessorValue(this,property);super._definePropertyAccessor(property,readOnly)}_hasAccessor(property){return this.__dataHasAccessor&&this.__dataHasAccessor[property]}_isPropertyPending(prop){return Boolean(this.__dataPending&&prop in this.__dataPending)}}return PropertyAccessors});const walker=document.createTreeWalker(document,NodeFilter.SHOW_ALL,null,false);const templateExtensions={"dom-if":true,"dom-repeat":true};function wrapTemplateExtension(node){let is=node.getAttribute("is");if(is&&templateExtensions[is]){let t=node;t.removeAttribute("is");node=t.ownerDocument.createElement(is);t.parentNode.replaceChild(node,t);node.appendChild(t);while(t.attributes.length){node.setAttribute(t.attributes[0].name,t.attributes[0].value);t.removeAttribute(t.attributes[0].name)}}return node}function findTemplateNode(root,nodeInfo){let parent=nodeInfo.parentInfo&&findTemplateNode(root,nodeInfo.parentInfo);if(parent){walker.currentNode=parent;for(let n=walker.firstChild(),i=0;n;n=walker.nextSibling()){if(nodeInfo.parentIndex===i++){return n}}}else{return root}}function applyIdToMap(inst,map,node,nodeInfo){if(nodeInfo.id){map[nodeInfo.id]=node}}function applyEventListener(inst,node,nodeInfo){if(nodeInfo.events&&nodeInfo.events.length){for(let j=0,e$=nodeInfo.events,e;j<e$.length&&(e=e$[j]);j++){inst._addMethodEventListenerToNode(node,e.name,e.value,inst)}}}function applyTemplateContent(inst,node,nodeInfo){if(nodeInfo.templateInfo){node._templateInfo=nodeInfo.templateInfo}}function createNodeEventHandler(context,eventName,methodName){context=context._methodHost||context;let handler=function(e){if(context[methodName]){context[methodName](e,e.detail)}else{console.warn("listener method `"+methodName+"` not defined")}};return handler}const TemplateStamp=dedupingMixin(superClass=>{class TemplateStamp extends superClass{static _parseTemplate(template,outerTemplateInfo){if(!template._templateInfo){let templateInfo=template._templateInfo={};templateInfo.nodeInfoList=[];templateInfo.stripWhiteSpace=true;this._parseTemplateContent(template,templateInfo,{parent:null})}return template._templateInfo}static _parseTemplateContent(template,templateInfo,nodeInfo){return this._parseTemplateNode(template.content,templateInfo,nodeInfo)}static _parseTemplateNode(node,templateInfo,nodeInfo){let noted;let element=node;if(element.localName=="template"&&!element.hasAttribute("preserve-content")){noted=this._parseTemplateNestedTemplate(element,templateInfo,nodeInfo)||noted}else if(element.localName==="slot"){templateInfo.hasInsertionPoint=true}walker.currentNode=element;if(walker.firstChild()){noted=this._parseTemplateChildNodes(element,templateInfo,nodeInfo)||noted}if(element.hasAttributes&&element.hasAttributes()){noted=this._parseTemplateNodeAttributes(element,templateInfo,nodeInfo)||noted}return noted}static _parseTemplateChildNodes(root,templateInfo,nodeInfo){if(root.localName==="script"||root.localName==="style"){return}walker.currentNode=root;for(let node=walker.firstChild(),parentIndex=0,next;node;node=next){if(node.localName=="template"){node=wrapTemplateExtension(node)}walker.currentNode=node;next=walker.nextSibling();if(node.nodeType===Node.TEXT_NODE){let n=next;while(n&&n.nodeType===Node.TEXT_NODE){node.textContent+=n.textContent;next=walker.nextSibling();root.removeChild(n);n=next}if(templateInfo.stripWhiteSpace&&!node.textContent.trim()){root.removeChild(node);continue}}let childInfo={parentIndex:parentIndex,parentInfo:nodeInfo};if(this._parseTemplateNode(node,templateInfo,childInfo)){childInfo.infoIndex=templateInfo.nodeInfoList.push(childInfo)-1}walker.currentNode=node;if(walker.parentNode()){parentIndex++}}}static _parseTemplateNestedTemplate(node,outerTemplateInfo,nodeInfo){let templateInfo=this._parseTemplate(node,outerTemplateInfo);let content=templateInfo.content=node.content.ownerDocument.createDocumentFragment();content.appendChild(node.content);nodeInfo.templateInfo=templateInfo;return true}static _parseTemplateNodeAttributes(node,templateInfo,nodeInfo){let noted=false;let attrs=Array.from(node.attributes);for(let i=attrs.length-1,a;a=attrs[i];i--){noted=this._parseTemplateNodeAttribute(node,templateInfo,nodeInfo,a.name,a.value)||noted}return noted}static _parseTemplateNodeAttribute(node,templateInfo,nodeInfo,name,value){if(name.slice(0,3)==="on-"){node.removeAttribute(name);nodeInfo.events=nodeInfo.events||[];nodeInfo.events.push({name:name.slice(3),value:value});return true}else if(name==="id"){nodeInfo.id=value;return true}return false}static _contentForTemplate(template){let templateInfo=template._templateInfo;return templateInfo&&templateInfo.content||template.content}_stampTemplate(template){if(template&&!template.content&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate){HTMLTemplateElement.decorate(template)}let templateInfo=this.constructor._parseTemplate(template);let nodeInfo=templateInfo.nodeInfoList;let content=templateInfo.content||template.content;let dom=document.importNode(content,true);dom.__noInsertionPoint=!templateInfo.hasInsertionPoint;let nodes=dom.nodeList=new Array(nodeInfo.length);dom.$={};for(let i=0,l=nodeInfo.length,info;i<l&&(info=nodeInfo[i]);i++){let node=nodes[i]=findTemplateNode(dom,info);applyIdToMap(this,dom.$,node,info);applyTemplateContent(this,node,info);applyEventListener(this,node,info)}dom=dom;return dom}_addMethodEventListenerToNode(node,eventName,methodName,context){context=context||node;let handler=createNodeEventHandler(context,eventName,methodName);this._addEventListenerToNode(node,eventName,handler);return handler}_addEventListenerToNode(node,eventName,handler){node.addEventListener(eventName,handler)}_removeEventListenerFromNode(node,eventName,handler){node.removeEventListener(eventName,handler)}}return TemplateStamp});let dedupeId$1=0;const TYPES={COMPUTE:"__computeEffects",REFLECT:"__reflectEffects",NOTIFY:"__notifyEffects",PROPAGATE:"__propagateEffects",OBSERVE:"__observeEffects",READ_ONLY:"__readOnly"};const capitalAttributeRegex=/[A-Z]/;function ensureOwnEffectMap(model,type){let effects=model[type];if(!effects){effects=model[type]={}}else if(!model.hasOwnProperty(type)){effects=model[type]=Object.create(model[type]);for(let p in effects){let protoFx=effects[p];let instFx=effects[p]=Array(protoFx.length);for(let i=0;i<protoFx.length;i++){instFx[i]=protoFx[i]}}}return effects}function runEffects(inst,effects,props,oldProps,hasPaths,extraArgs){if(effects){let ran=false;let id=dedupeId$1++;for(let prop in props){if(runEffectsForProperty(inst,effects,id,prop,props,oldProps,hasPaths,extraArgs)){ran=true}}return ran}return false}function runEffectsForProperty(inst,effects,dedupeId,prop,props,oldProps,hasPaths,extraArgs){let ran=false;let rootProperty=hasPaths?root(prop):prop;let fxs=effects[rootProperty];if(fxs){for(let i=0,l=fxs.length,fx;i<l&&(fx=fxs[i]);i++){if((!fx.info||fx.info.lastRun!==dedupeId)&&(!hasPaths||pathMatchesTrigger(prop,fx.trigger))){if(fx.info){fx.info.lastRun=dedupeId}fx.fn(inst,prop,props,oldProps,fx.info,hasPaths,extraArgs);ran=true}}}return ran}function pathMatchesTrigger(path,trigger){if(trigger){let triggerPath=trigger.name;return triggerPath==path||!!(trigger.structured&&isAncestor(triggerPath,path))||!!(trigger.wildcard&&isDescendant(triggerPath,path))}else{return true}}function runObserverEffect(inst,property,props,oldProps,info){let fn=typeof info.method==="string"?inst[info.method]:info.method;let changedProp=info.property;if(fn){fn.call(inst,inst.__data[changedProp],oldProps[changedProp])}else if(!info.dynamicFn){console.warn("observer method `"+info.method+"` not defined")}}function runNotifyEffects(inst,notifyProps,props,oldProps,hasPaths){let fxs=inst[TYPES.NOTIFY];let notified;let id=dedupeId$1++;for(let prop in notifyProps){if(notifyProps[prop]){if(fxs&&runEffectsForProperty(inst,fxs,id,prop,props,oldProps,hasPaths)){notified=true}else if(hasPaths&¬ifyPath(inst,prop,props)){notified=true}}}let host;if(notified&&(host=inst.__dataHost)&&host._invalidateProperties){host._invalidateProperties()}}function notifyPath(inst,path,props){let rootProperty=root(path);if(rootProperty!==path){let eventName=camelToDashCase(rootProperty)+"-changed";dispatchNotifyEvent(inst,eventName,props[path],path);return true}return false}function dispatchNotifyEvent(inst,eventName,value,path){let detail={value:value,queueProperty:true};if(path){detail.path=path}wrap(inst).dispatchEvent(new CustomEvent(eventName,{detail:detail}))}function runNotifyEffect(inst,property,props,oldProps,info,hasPaths){let rootProperty=hasPaths?root(property):property;let path=rootProperty!=property?property:null;let value=path?get(inst,path):inst.__data[property];if(path&&value===undefined){value=props[property]}dispatchNotifyEvent(inst,info.eventName,value,path)}function handleNotification(event,inst,fromProp,toPath,negate){let value;let detail=event.detail;let fromPath=detail&&detail.path;if(fromPath){toPath=translate(fromProp,toPath,fromPath);value=detail&&detail.value}else{value=event.currentTarget[fromProp]}value=negate?!value:value;if(!inst[TYPES.READ_ONLY]||!inst[TYPES.READ_ONLY][toPath]){if(inst._setPendingPropertyOrPath(toPath,value,true,Boolean(fromPath))&&(!detail||!detail.queueProperty)){inst._invalidateProperties()}}}function runReflectEffect(inst,property,props,oldProps,info){let value=inst.__data[property];if(sanitizeDOMValue){value=sanitizeDOMValue(value,info.attrName,"attribute",inst)}inst._propertyToAttribute(property,info.attrName,value)}function runComputedEffects(inst,changedProps,oldProps,hasPaths){let computeEffects=inst[TYPES.COMPUTE];if(computeEffects){let inputProps=changedProps;while(runEffects(inst,computeEffects,inputProps,oldProps,hasPaths)){Object.assign(oldProps,inst.__dataOld);Object.assign(changedProps,inst.__dataPending);inputProps=inst.__dataPending;inst.__dataPending=null}}}function runComputedEffect(inst,property,props,oldProps,info){let result=runMethodEffect(inst,property,props,oldProps,info);let computedProp=info.methodInfo;if(inst.__dataHasAccessor&&inst.__dataHasAccessor[computedProp]){inst._setPendingProperty(computedProp,result,true)}else{inst[computedProp]=result}}function computeLinkedPaths(inst,path,value){let links=inst.__dataLinkedPaths;if(links){let link;for(let a in links){let b=links[a];if(isDescendant(a,path)){link=translate(a,b,path);inst._setPendingPropertyOrPath(link,value,true,true)}else if(isDescendant(b,path)){link=translate(b,a,path);inst._setPendingPropertyOrPath(link,value,true,true)}}}}function addBinding(constructor,templateInfo,nodeInfo,kind,target,parts,literal){nodeInfo.bindings=nodeInfo.bindings||[];let binding={kind:kind,target:target,parts:parts,literal:literal,isCompound:parts.length!==1};nodeInfo.bindings.push(binding);if(shouldAddListener(binding)){let{event:event,negate:negate}=binding.parts[0];binding.listenerEvent=event||camelToDashCase(target)+"-changed";binding.listenerNegate=negate}let index=templateInfo.nodeInfoList.length;for(let i=0;i<binding.parts.length;i++){let part=binding.parts[i];part.compoundIndex=i;addEffectForBindingPart(constructor,templateInfo,binding,part,index)}}function addEffectForBindingPart(constructor,templateInfo,binding,part,index){if(!part.literal){if(binding.kind==="attribute"&&binding.target[0]==="-"){console.warn("Cannot set attribute "+binding.target+' because "-" is not a valid attribute starting character')}else{let dependencies=part.dependencies;let info={index:index,binding:binding,part:part,evaluator:constructor};for(let j=0;j<dependencies.length;j++){let trigger=dependencies[j];if(typeof trigger=="string"){trigger=parseArg(trigger);trigger.wildcard=true}constructor._addTemplatePropertyEffect(templateInfo,trigger.rootProperty,{fn:runBindingEffect,info:info,trigger:trigger})}}}}function runBindingEffect(inst,path,props,oldProps,info,hasPaths,nodeList){let node=nodeList[info.index];let binding=info.binding;let part=info.part;if(hasPaths&&part.source&&path.length>part.source.length&&binding.kind=="property"&&!binding.isCompound&&node.__isPropertyEffectsClient&&node.__dataHasAccessor&&node.__dataHasAccessor[binding.target]){let value=props[path];path=translate(part.source,binding.target,path);if(node._setPendingPropertyOrPath(path,value,false,true)){inst._enqueueClient(node)}}else{let value=info.evaluator._evaluateBinding(inst,part,path,props,oldProps,hasPaths);applyBindingValue(inst,node,binding,part,value)}}function applyBindingValue(inst,node,binding,part,value){value=computeBindingValue(node,value,binding,part);if(sanitizeDOMValue){value=sanitizeDOMValue(value,binding.target,binding.kind,node)}if(binding.kind=="attribute"){inst._valueToNodeAttribute(node,value,binding.target)}else{let prop=binding.target;if(node.__isPropertyEffectsClient&&node.__dataHasAccessor&&node.__dataHasAccessor[prop]){if(!node[TYPES.READ_ONLY]||!node[TYPES.READ_ONLY][prop]){if(node._setPendingProperty(prop,value)){inst._enqueueClient(node)}}}else{inst._setUnmanagedPropertyToNode(node,prop,value)}}}function computeBindingValue(node,value,binding,part){if(binding.isCompound){let storage=node.__dataCompoundStorage[binding.target];storage[part.compoundIndex]=value;value=storage.join("")}if(binding.kind!=="attribute"){if(binding.target==="textContent"||binding.target==="value"&&(node.localName==="input"||node.localName==="textarea")){value=value==undefined?"":value}}return value}function shouldAddListener(binding){return Boolean(binding.target)&&binding.kind!="attribute"&&binding.kind!="text"&&!binding.isCompound&&binding.parts[0].mode==="{"}function setupBindings(inst,templateInfo){let{nodeList:nodeList,nodeInfoList:nodeInfoList}=templateInfo;if(nodeInfoList.length){for(let i=0;i<nodeInfoList.length;i++){let info=nodeInfoList[i];let node=nodeList[i];let bindings=info.bindings;if(bindings){for(let i=0;i<bindings.length;i++){let binding=bindings[i];setupCompoundStorage(node,binding);addNotifyListener(node,inst,binding)}}node.__dataHost=inst}}}function setupCompoundStorage(node,binding){if(binding.isCompound){let storage=node.__dataCompoundStorage||(node.__dataCompoundStorage={});let parts=binding.parts;let literals=new Array(parts.length);for(let j=0;j<parts.length;j++){literals[j]=parts[j].literal}let target=binding.target;storage[target]=literals;if(binding.literal&&binding.kind=="property"){node[target]=binding.literal}}}function addNotifyListener(node,inst,binding){if(binding.listenerEvent){let part=binding.parts[0];node.addEventListener(binding.listenerEvent,function(e){handleNotification(e,inst,binding.target,part.source,part.negate)})}}function createMethodEffect(model,sig,type,effectFn,methodInfo,dynamicFn){dynamicFn=sig.static||dynamicFn&&(typeof dynamicFn!=="object"||dynamicFn[sig.methodName]);let info={methodName:sig.methodName,args:sig.args,methodInfo:methodInfo,dynamicFn:dynamicFn};for(let i=0,arg;i<sig.args.length&&(arg=sig.args[i]);i++){if(!arg.literal){model._addPropertyEffect(arg.rootProperty,type,{fn:effectFn,info:info,trigger:arg})}}if(dynamicFn){model._addPropertyEffect(sig.methodName,type,{fn:effectFn,info:info})}}function runMethodEffect(inst,property,props,oldProps,info){let context=inst._methodHost||inst;let fn=context[info.methodName];if(fn){let args=inst._marshalArgs(info.args,property,props);return fn.apply(context,args)}else if(!info.dynamicFn){console.warn("method `"+info.methodName+"` not defined")}}const emptyArray=[];const IDENT="(?:"+"[a-zA-Z_$][\\w.:$\\-*]*"+")";const NUMBER="(?:"+"[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?"+")";const SQUOTE_STRING="(?:"+"'(?:[^'\\\\]|\\\\.)*'"+")";const DQUOTE_STRING="(?:"+'"(?:[^"\\\\]|\\\\.)*"'+")";const STRING="(?:"+SQUOTE_STRING+"|"+DQUOTE_STRING+")";const ARGUMENT="(?:("+IDENT+"|"+NUMBER+"|"+STRING+")\\s*"+")";const ARGUMENTS="(?:"+ARGUMENT+"(?:,\\s*"+ARGUMENT+")*"+")";const ARGUMENT_LIST="(?:"+"\\(\\s*"+"(?:"+ARGUMENTS+"?"+")"+"\\)\\s*"+")";const BINDING="("+IDENT+"\\s*"+ARGUMENT_LIST+"?"+")";const OPEN_BRACKET="(\\[\\[|{{)"+"\\s*";const CLOSE_BRACKET="(?:]]|}})";const NEGATE="(?:(!)\\s*)?";const EXPRESSION=OPEN_BRACKET+NEGATE+BINDING+CLOSE_BRACKET;const bindingRegex=new RegExp(EXPRESSION,"g");function literalFromParts(parts){let s="";for(let i=0;i<parts.length;i++){let literal=parts[i].literal;s+=literal||""}return s}function parseMethod(expression){let m=expression.match(/([^\s]+?)\(([\s\S]*)\)/);if(m){let methodName=m[1];let sig={methodName:methodName,static:true,args:emptyArray};if(m[2].trim()){let args=m[2].replace(/\\,/g,",").split(",");return parseArgs(args,sig)}else{return sig}}return null}function parseArgs(argList,sig){sig.args=argList.map(function(rawArg){let arg=parseArg(rawArg);if(!arg.literal){sig.static=false}return arg},this);return sig}function parseArg(rawArg){let arg=rawArg.trim().replace(/,/g,",").replace(/\\(.)/g,"$1");let a={name:arg,value:"",literal:false};let fc=arg[0];if(fc==="-"){fc=arg[1]}if(fc>="0"&&fc<="9"){fc="#"}switch(fc){case"'":case'"':a.value=arg.slice(1,-1);a.literal=true;break;case"#":a.value=Number(arg);a.literal=true;break}if(!a.literal){a.rootProperty=root(arg);a.structured=isPath(arg);if(a.structured){a.wildcard=arg.slice(-2)==".*";if(a.wildcard){a.name=arg.slice(0,-2)}}}return a}function getArgValue(data,props,path){let value=get(data,path);if(value===undefined){value=props[path]}return value}function notifySplices(inst,array,path,splices){inst.notifyPath(path+".splices",{indexSplices:splices});inst.notifyPath(path+".length",array.length)}function notifySplice(inst,array,path,index,addedCount,removed){notifySplices(inst,array,path,[{index:index,addedCount:addedCount,removed:removed,object:array,type:"splice"}])}function upper(name){return name[0].toUpperCase()+name.substring(1)}const PropertyEffects=dedupingMixin(superClass=>{const propertyEffectsBase=TemplateStamp(PropertyAccessors(superClass));class PropertyEffects extends propertyEffectsBase{constructor(){super();this.__isPropertyEffectsClient=true;this.__dataCounter=0;this.__dataClientsReady;this.__dataPendingClients;this.__dataToNotify;this.__dataLinkedPaths;this.__dataHasPaths;this.__dataCompoundStorage;this.__dataHost;this.__dataTemp;this.__dataClientsInitialized;this.__data;this.__dataPending;this.__dataOld;this.__computeEffects;this.__reflectEffects;this.__notifyEffects;this.__propagateEffects;this.__observeEffects;this.__readOnly;this.__templateInfo}get PROPERTY_EFFECT_TYPES(){return TYPES}_initializeProperties(){super._initializeProperties();hostStack.registerHost(this);this.__dataClientsReady=false;this.__dataPendingClients=null;this.__dataToNotify=null;this.__dataLinkedPaths=null;this.__dataHasPaths=false;this.__dataCompoundStorage=this.__dataCompoundStorage||null;this.__dataHost=this.__dataHost||null;this.__dataTemp={};this.__dataClientsInitialized=false}_initializeProtoProperties(props){this.__data=Object.create(props);this.__dataPending=Object.create(props);this.__dataOld={}}_initializeInstanceProperties(props){let readOnly=this[TYPES.READ_ONLY];for(let prop in props){if(!readOnly||!readOnly[prop]){this.__dataPending=this.__dataPending||{};this.__dataOld=this.__dataOld||{};this.__data[prop]=this.__dataPending[prop]=props[prop]}}}_addPropertyEffect(property,type,effect){this._createPropertyAccessor(property,type==TYPES.READ_ONLY);let effects=ensureOwnEffectMap(this,type)[property];if(!effects){effects=this[type][property]=[]}effects.push(effect)}_removePropertyEffect(property,type,effect){let effects=ensureOwnEffectMap(this,type)[property];let idx=effects.indexOf(effect);if(idx>=0){effects.splice(idx,1)}}_hasPropertyEffect(property,type){let effects=this[type];return Boolean(effects&&effects[property])}_hasReadOnlyEffect(property){return this._hasPropertyEffect(property,TYPES.READ_ONLY)}_hasNotifyEffect(property){return this._hasPropertyEffect(property,TYPES.NOTIFY)}_hasReflectEffect(property){return this._hasPropertyEffect(property,TYPES.REFLECT)}_hasComputedEffect(property){return this._hasPropertyEffect(property,TYPES.COMPUTE)}_setPendingPropertyOrPath(path,value,shouldNotify,isPathNotification){if(isPathNotification||root(Array.isArray(path)?path[0]:path)!==path){if(!isPathNotification){let old=get(this,path);path=set(this,path,value);if(!path||!super._shouldPropertyChange(path,value,old)){return false}}this.__dataHasPaths=true;if(this._setPendingProperty(path,value,shouldNotify)){computeLinkedPaths(this,path,value);return true}}else{if(this.__dataHasAccessor&&this.__dataHasAccessor[path]){return this._setPendingProperty(path,value,shouldNotify)}else{this[path]=value}}return false}_setUnmanagedPropertyToNode(node,prop,value){if(value!==node[prop]||typeof value=="object"){node[prop]=value}}_setPendingProperty(property,value,shouldNotify){let propIsPath=this.__dataHasPaths&&isPath(property);let prevProps=propIsPath?this.__dataTemp:this.__data;if(this._shouldPropertyChange(property,value,prevProps[property])){if(!this.__dataPending){this.__dataPending={};this.__dataOld={}}if(!(property in this.__dataOld)){this.__dataOld[property]=this.__data[property]}if(propIsPath){this.__dataTemp[property]=value}else{this.__data[property]=value}this.__dataPending[property]=value;if(propIsPath||this[TYPES.NOTIFY]&&this[TYPES.NOTIFY][property]){this.__dataToNotify=this.__dataToNotify||{};this.__dataToNotify[property]=shouldNotify}return true}return false}_setProperty(property,value){if(this._setPendingProperty(property,value,true)){this._invalidateProperties()}}_invalidateProperties(){if(this.__dataReady){this._flushProperties()}}_enqueueClient(client){this.__dataPendingClients=this.__dataPendingClients||[];if(client!==this){this.__dataPendingClients.push(client)}}_flushProperties(){this.__dataCounter++;super._flushProperties();this.__dataCounter--}_flushClients(){if(!this.__dataClientsReady){this.__dataClientsReady=true;this._readyClients();this.__dataReady=true}else{this.__enableOrFlushClients()}}__enableOrFlushClients(){let clients=this.__dataPendingClients;if(clients){this.__dataPendingClients=null;for(let i=0;i<clients.length;i++){let client=clients[i];if(!client.__dataEnabled){client._enableProperties()}else if(client.__dataPending){client._flushProperties()}}}}_readyClients(){this.__enableOrFlushClients()}setProperties(props,setReadOnly){for(let path in props){if(setReadOnly||!this[TYPES.READ_ONLY]||!this[TYPES.READ_ONLY][path]){this._setPendingPropertyOrPath(path,props[path],true)}}this._invalidateProperties()}ready(){this._flushProperties();if(!this.__dataClientsReady){this._flushClients()}if(this.__dataPending){this._flushProperties()}}_propertiesChanged(currentProps,changedProps,oldProps){let hasPaths=this.__dataHasPaths;this.__dataHasPaths=false;runComputedEffects(this,changedProps,oldProps,hasPaths);let notifyProps=this.__dataToNotify;this.__dataToNotify=null;this._propagatePropertyChanges(changedProps,oldProps,hasPaths);this._flushClients();runEffects(this,this[TYPES.REFLECT],changedProps,oldProps,hasPaths);runEffects(this,this[TYPES.OBSERVE],changedProps,oldProps,hasPaths);if(notifyProps){runNotifyEffects(this,notifyProps,changedProps,oldProps,hasPaths)}if(this.__dataCounter==1){this.__dataTemp={}}}_propagatePropertyChanges(changedProps,oldProps,hasPaths){if(this[TYPES.PROPAGATE]){runEffects(this,this[TYPES.PROPAGATE],changedProps,oldProps,hasPaths)}let templateInfo=this.__templateInfo;while(templateInfo){runEffects(this,templateInfo.propertyEffects,changedProps,oldProps,hasPaths,templateInfo.nodeList);templateInfo=templateInfo.nextTemplateInfo}}linkPaths(to,from){to=normalize(to);from=normalize(from);this.__dataLinkedPaths=this.__dataLinkedPaths||{};this.__dataLinkedPaths[to]=from}unlinkPaths(path){path=normalize(path);if(this.__dataLinkedPaths){delete this.__dataLinkedPaths[path]}}notifySplices(path,splices){let info={path:""};let array=get(this,path,info);notifySplices(this,array,info.path,splices)}get(path,root){return get(root||this,path)}set(path,value,root){if(root){set(root,path,value)}else{if(!this[TYPES.READ_ONLY]||!this[TYPES.READ_ONLY][path]){if(this._setPendingPropertyOrPath(path,value,true)){this._invalidateProperties()}}}}push(path,...items){let info={path:""};let array=get(this,path,info);let len=array.length;let ret=array.push(...items);if(items.length){notifySplice(this,array,info.path,len,items.length,[])}return ret}pop(path){let info={path:""};let array=get(this,path,info);let hadLength=Boolean(array.length);let ret=array.pop();if(hadLength){notifySplice(this,array,info.path,array.length,0,[ret])}return ret}splice(path,start,deleteCount,...items){let info={path:""};let array=get(this,path,info);if(start<0){start=array.length-Math.floor(-start)}else if(start){start=Math.floor(start)}let ret;if(arguments.length===2){ret=array.splice(start)}else{ret=array.splice(start,deleteCount,...items)}if(items.length||ret.length){notifySplice(this,array,info.path,start,items.length,ret)}return ret}shift(path){let info={path:""};let array=get(this,path,info);let hadLength=Boolean(array.length);let ret=array.shift();if(hadLength){notifySplice(this,array,info.path,0,0,[ret])}return ret}unshift(path,...items){let info={path:""};let array=get(this,path,info);let ret=array.unshift(...items);if(items.length){notifySplice(this,array,info.path,0,items.length,[])}return ret}notifyPath(path,value){let propPath;if(arguments.length==1){let info={path:""};value=get(this,path,info);propPath=info.path}else if(Array.isArray(path)){propPath=normalize(path)}else{propPath=path}if(this._setPendingPropertyOrPath(propPath,value,true,true)){this._invalidateProperties()}}_createReadOnlyProperty(property,protectedSetter){this._addPropertyEffect(property,TYPES.READ_ONLY);if(protectedSetter){this["_set"+upper(property)]=function(value){this._setProperty(property,value)}}}_createPropertyObserver(property,method,dynamicFn){let info={property:property,method:method,dynamicFn:Boolean(dynamicFn)};this._addPropertyEffect(property,TYPES.OBSERVE,{fn:runObserverEffect,info:info,trigger:{name:property}});if(dynamicFn){this._addPropertyEffect(method,TYPES.OBSERVE,{fn:runObserverEffect,info:info,trigger:{name:method}})}}_createMethodObserver(expression,dynamicFn){let sig=parseMethod(expression);if(!sig){throw new Error("Malformed observer expression '"+expression+"'")}createMethodEffect(this,sig,TYPES.OBSERVE,runMethodEffect,null,dynamicFn)}_createNotifyingProperty(property){this._addPropertyEffect(property,TYPES.NOTIFY,{fn:runNotifyEffect,info:{eventName:camelToDashCase(property)+"-changed",property:property}})}_createReflectedProperty(property){let attr=this.constructor.attributeNameForProperty(property);if(attr[0]==="-"){console.warn("Property "+property+" cannot be reflected to attribute "+attr+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.')}else{this._addPropertyEffect(property,TYPES.REFLECT,{fn:runReflectEffect,info:{attrName:attr}})}}_createComputedProperty(property,expression,dynamicFn){let sig=parseMethod(expression);if(!sig){throw new Error("Malformed computed expression '"+expression+"'")}createMethodEffect(this,sig,TYPES.COMPUTE,runComputedEffect,property,dynamicFn)}_marshalArgs(args,path,props){const data=this.__data;const values=[];for(let i=0,l=args.length;i<l;i++){let{name:name,structured:structured,wildcard:wildcard,value:value,literal:literal}=args[i];if(!literal){if(wildcard){const matches=isDescendant(name,path);const pathValue=getArgValue(data,props,matches?path:name);value={path:matches?path:name,value:pathValue,base:matches?get(data,name):pathValue}}else{value=structured?getArgValue(data,props,name):data[name]}}values[i]=value}return values}static addPropertyEffect(property,type,effect){this.prototype._addPropertyEffect(property,type,effect)}static createPropertyObserver(property,method,dynamicFn){this.prototype._createPropertyObserver(property,method,dynamicFn)}static createMethodObserver(expression,dynamicFn){this.prototype._createMethodObserver(expression,dynamicFn)}static createNotifyingProperty(property){this.prototype._createNotifyingProperty(property)}static createReadOnlyProperty(property,protectedSetter){this.prototype._createReadOnlyProperty(property,protectedSetter)}static createReflectedProperty(property){this.prototype._createReflectedProperty(property)}static createComputedProperty(property,expression,dynamicFn){this.prototype._createComputedProperty(property,expression,dynamicFn)}static bindTemplate(template){return this.prototype._bindTemplate(template)}_bindTemplate(template,instanceBinding){let templateInfo=this.constructor._parseTemplate(template);let wasPreBound=this.__templateInfo==templateInfo;if(!wasPreBound){for(let prop in templateInfo.propertyEffects){this._createPropertyAccessor(prop)}}if(instanceBinding){templateInfo=Object.create(templateInfo);templateInfo.wasPreBound=wasPreBound;if(!wasPreBound&&this.__templateInfo){let last=this.__templateInfoLast||this.__templateInfo;this.__templateInfoLast=last.nextTemplateInfo=templateInfo;templateInfo.previousTemplateInfo=last;return templateInfo}}return this.__templateInfo=templateInfo}static _addTemplatePropertyEffect(templateInfo,prop,effect){let hostProps=templateInfo.hostProps=templateInfo.hostProps||{};hostProps[prop]=true;let effects=templateInfo.propertyEffects=templateInfo.propertyEffects||{};let propEffects=effects[prop]=effects[prop]||[];propEffects.push(effect)}_stampTemplate(template){hostStack.beginHosting(this);let dom=super._stampTemplate(template);hostStack.endHosting(this);let templateInfo=this._bindTemplate(template,true);templateInfo.nodeList=dom.nodeList;if(!templateInfo.wasPreBound){let nodes=templateInfo.childNodes=[];for(let n=dom.firstChild;n;n=n.nextSibling){nodes.push(n)}}dom.templateInfo=templateInfo;setupBindings(this,templateInfo);if(this.__dataReady){runEffects(this,templateInfo.propertyEffects,this.__data,null,false,templateInfo.nodeList)}return dom}_removeBoundDom(dom){let templateInfo=dom.templateInfo;if(templateInfo.previousTemplateInfo){templateInfo.previousTemplateInfo.nextTemplateInfo=templateInfo.nextTemplateInfo}if(templateInfo.nextTemplateInfo){templateInfo.nextTemplateInfo.previousTemplateInfo=templateInfo.previousTemplateInfo}if(this.__templateInfoLast==templateInfo){this.__templateInfoLast=templateInfo.previousTemplateInfo}templateInfo.previousTemplateInfo=templateInfo.nextTemplateInfo=null;let nodes=templateInfo.childNodes;for(let i=0;i<nodes.length;i++){let node=nodes[i];node.parentNode.removeChild(node)}}static _parseTemplateNode(node,templateInfo,nodeInfo){let noted=super._parseTemplateNode(node,templateInfo,nodeInfo);if(node.nodeType===Node.TEXT_NODE){let parts=this._parseBindings(node.textContent,templateInfo);if(parts){node.textContent=literalFromParts(parts)||" ";addBinding(this,templateInfo,nodeInfo,"text","textContent",parts);noted=true}}return noted}static _parseTemplateNodeAttribute(node,templateInfo,nodeInfo,name,value){let parts=this._parseBindings(value,templateInfo);if(parts){let origName=name;let kind="property";if(capitalAttributeRegex.test(name)){kind="attribute"}else if(name[name.length-1]=="$"){name=name.slice(0,-1);kind="attribute"}let literal=literalFromParts(parts);if(literal&&kind=="attribute"){if(name=="class"&&node.hasAttribute("class")){literal+=" "+node.getAttribute(name)}node.setAttribute(name,literal)}if(node.localName==="input"&&origName==="value"){node.setAttribute(origName,"")}node.removeAttribute(origName);if(kind==="property"){name=dashToCamelCase(name)}addBinding(this,templateInfo,nodeInfo,kind,name,parts,literal);return true}else{return super._parseTemplateNodeAttribute(node,templateInfo,nodeInfo,name,value)}}static _parseTemplateNestedTemplate(node,templateInfo,nodeInfo){let noted=super._parseTemplateNestedTemplate(node,templateInfo,nodeInfo);let hostProps=nodeInfo.templateInfo.hostProps;let mode="{";for(let source in hostProps){let parts=[{mode:mode,source:source,dependencies:[source]}];addBinding(this,templateInfo,nodeInfo,"property","_host_"+source,parts)}return noted}static _parseBindings(text,templateInfo){let parts=[];let lastIndex=0;let m;while((m=bindingRegex.exec(text))!==null){if(m.index>lastIndex){parts.push({literal:text.slice(lastIndex,m.index)})}let mode=m[1][0];let negate=Boolean(m[2]);let source=m[3].trim();let customEvent=false,notifyEvent="",colon=-1;if(mode=="{"&&(colon=source.indexOf("::"))>0){notifyEvent=source.substring(colon+2);source=source.substring(0,colon);customEvent=true}let signature=parseMethod(source);let dependencies=[];if(signature){let{args:args,methodName:methodName}=signature;for(let i=0;i<args.length;i++){let arg=args[i];if(!arg.literal){dependencies.push(arg)}}let dynamicFns=templateInfo.dynamicFns;if(dynamicFns&&dynamicFns[methodName]||signature.static){dependencies.push(methodName);signature.dynamicFn=true}}else{dependencies.push(source)}parts.push({source:source,mode:mode,negate:negate,customEvent:customEvent,signature:signature,dependencies:dependencies,event:notifyEvent});lastIndex=bindingRegex.lastIndex}if(lastIndex&&lastIndex<text.length){let literal=text.substring(lastIndex);if(literal){parts.push({literal:literal})}}if(parts.length){return parts}else{return null}}static _evaluateBinding(inst,part,path,props,oldProps,hasPaths){let value;if(part.signature){value=runMethodEffect(inst,path,props,oldProps,part.signature)}else if(path!=part.source){value=get(inst,part.source)}else{if(hasPaths&&isPath(path)){value=get(inst,path)}else{value=inst.__data[path]}}if(part.negate){value=!value}return value}}return PropertyEffects});class HostStack{constructor(){this.stack=[]}registerHost(inst){if(this.stack.length){let host=this.stack[this.stack.length-1];host._enqueueClient(inst)}}beginHosting(inst){this.stack.push(inst)}endHosting(inst){let stackLen=this.stack.length;if(stackLen&&this.stack[stackLen-1]==inst){this.stack.pop()}}}const hostStack=new HostStack;function register$1(prototype){}function normalizeProperties(props){const output={};for(let p in props){const o=props[p];output[p]=typeof o==="function"?{type:o}:o}return output}const PropertiesMixin=dedupingMixin(superClass=>{const base=PropertiesChanged(superClass);function superPropertiesClass(constructor){const superCtor=Object.getPrototypeOf(constructor);return superCtor.prototype instanceof PropertiesMixin?superCtor:null}function ownProperties(constructor){if(!constructor.hasOwnProperty(JSCompiler_renameProperty("__ownProperties",constructor))){let props=null;if(constructor.hasOwnProperty(JSCompiler_renameProperty("properties",constructor))){const properties=constructor.properties;if(properties){props=normalizeProperties(properties)}}constructor.__ownProperties=props}return constructor.__ownProperties}class PropertiesMixin extends base{static get observedAttributes(){if(!this.hasOwnProperty("__observedAttributes")){register$1(this.prototype);const props=this._properties;this.__observedAttributes=props?Object.keys(props).map(p=>this.attributeNameForProperty(p)):[]}return this.__observedAttributes}static finalize(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__finalized",this))){const superCtor=superPropertiesClass(this);if(superCtor){superCtor.finalize()}this.__finalized=true;this._finalizeClass()}}static _finalizeClass(){const props=ownProperties(this);if(props){this.createProperties(props)}}static get _properties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__properties",this))){const superCtor=superPropertiesClass(this);this.__properties=Object.assign({},superCtor&&superCtor._properties,ownProperties(this))}return this.__properties}static typeForProperty(name){const info=this._properties[name];return info&&info.type}_initializeProperties(){this.constructor.finalize();super._initializeProperties()}connectedCallback(){if(super.connectedCallback){super.connectedCallback()}this._enableProperties()}disconnectedCallback(){if(super.disconnectedCallback){super.disconnectedCallback()}}}return PropertiesMixin});const version="3.2.0";const builtCSS=window.ShadyCSS&&window.ShadyCSS["cssBuild"];const ElementMixin=dedupingMixin(base=>{const polymerElementBase=PropertiesMixin(PropertyEffects(base));function propertyDefaults(constructor){if(!constructor.hasOwnProperty(JSCompiler_renameProperty("__propertyDefaults",constructor))){constructor.__propertyDefaults=null;let props=constructor._properties;for(let p in props){let info=props[p];if("value"in info){constructor.__propertyDefaults=constructor.__propertyDefaults||{};constructor.__propertyDefaults[p]=info}}}return constructor.__propertyDefaults}function ownObservers(constructor){if(!constructor.hasOwnProperty(JSCompiler_renameProperty("__ownObservers",constructor))){constructor.__ownObservers=constructor.hasOwnProperty(JSCompiler_renameProperty("observers",constructor))?constructor.observers:null}return constructor.__ownObservers}function createPropertyFromConfig(proto,name,info,allProps){if(info.computed){info.readOnly=true}if(info.computed){if(proto._hasReadOnlyEffect(name)){console.warn(`Cannot redefine computed property '${name}'.`)}else{proto._createComputedProperty(name,info.computed,allProps)}}if(info.readOnly&&!proto._hasReadOnlyEffect(name)){proto._createReadOnlyProperty(name,!info.computed)}else if(info.readOnly===false&&proto._hasReadOnlyEffect(name)){console.warn(`Cannot make readOnly property '${name}' non-readOnly.`)}if(info.reflectToAttribute&&!proto._hasReflectEffect(name)){proto._createReflectedProperty(name)}else if(info.reflectToAttribute===false&&proto._hasReflectEffect(name)){console.warn(`Cannot make reflected property '${name}' non-reflected.`)}if(info.notify&&!proto._hasNotifyEffect(name)){proto._createNotifyingProperty(name)}else if(info.notify===false&&proto._hasNotifyEffect(name)){console.warn(`Cannot make notify property '${name}' non-notify.`)}if(info.observer){proto._createPropertyObserver(name,info.observer,allProps[info.observer])}proto._addPropertyToAttributeMap(name)}function processElementStyles(klass,template,is,baseURI){if(!builtCSS){const templateStyles=template.content.querySelectorAll("style");const stylesWithImports=stylesFromTemplate(template);const linkedStyles=stylesFromModuleImports(is);const firstTemplateChild=template.content.firstElementChild;for(let idx=0;idx<linkedStyles.length;idx++){let s=linkedStyles[idx];s.textContent=klass._processStyleText(s.textContent,baseURI);template.content.insertBefore(s,firstTemplateChild)}let templateStyleIndex=0;for(let i=0;i<stylesWithImports.length;i++){let s=stylesWithImports[i];let templateStyle=templateStyles[templateStyleIndex];if(templateStyle!==s){s=s.cloneNode(true);templateStyle.parentNode.insertBefore(s,templateStyle)}else{templateStyleIndex++}s.textContent=klass._processStyleText(s.textContent,baseURI)}}if(window.ShadyCSS){window.ShadyCSS.prepareTemplate(template,is)}}function getTemplateFromDomModule(is){let template=null;if(is&&(!strictTemplatePolicy||allowTemplateFromDomModule)){template=DomModule.import(is,"template");if(strictTemplatePolicy&&!template){throw new Error(`strictTemplatePolicy: expecting dom-module or null template for ${is}`)}}return template}class PolymerElement extends polymerElementBase{static get polymerElementVersion(){return version}static _finalizeClass(){super._finalizeClass();const observers=ownObservers(this);if(observers){this.createObservers(observers,this._properties)}this._prepareTemplate()}static _prepareTemplate(){let template=this.template;if(template){if(typeof template==="string"){console.error("template getter must return HTMLTemplateElement");template=null}else if(!legacyOptimizations){template=template.cloneNode(true)}}this.prototype._template=template}static createProperties(props){for(let p in props){createPropertyFromConfig(this.prototype,p,props[p],props)}}static createObservers(observers,dynamicFns){const proto=this.prototype;for(let i=0;i<observers.length;i++){proto._createMethodObserver(observers[i],dynamicFns)}}static get template(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_template",this))){this._template=this.prototype.hasOwnProperty(JSCompiler_renameProperty("_template",this.prototype))?this.prototype._template:getTemplateFromDomModule(this.is)||Object.getPrototypeOf(this.prototype).constructor.template}return this._template}static set template(value){this._template=value}static get importPath(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_importPath",this))){const meta=this.importMeta;if(meta){this._importPath=pathFromUrl(meta.url)}else{const module=DomModule.import(this.is);this._importPath=module&&module.assetpath||Object.getPrototypeOf(this.prototype).constructor.importPath}}return this._importPath}constructor(){super();this._template;this._importPath;this.rootPath;this.importPath;this.root;this.$}_initializeProperties(){this.constructor.finalize();this.constructor._finalizeTemplate(this.localName);super._initializeProperties();this.rootPath=rootPath;this.importPath=this.constructor.importPath;let p$=propertyDefaults(this.constructor);if(!p$){return}for(let p in p$){let info=p$[p];if(!this.hasOwnProperty(p)){let value=typeof info.value=="function"?info.value.call(this):info.value;if(this._hasAccessor(p)){this._setPendingProperty(p,value,true)}else{this[p]=value}}}}static _processStyleText(cssText,baseURI){return resolveCss(cssText,baseURI)}static _finalizeTemplate(is){const template=this.prototype._template;if(template&&!template.__polymerFinalized){template.__polymerFinalized=true;const importPath=this.importPath;const baseURI=importPath?resolveUrl(importPath):"";processElementStyles(this,template,is,baseURI);this.prototype._bindTemplate(template)}}connectedCallback(){if(window.ShadyCSS&&this._template){window.ShadyCSS.styleElement(this)}super.connectedCallback()}ready(){if(this._template){this.root=this._stampTemplate(this._template);this.$=this.root.$}super.ready()}_readyClients(){if(this._template){this.root=this._attachDom(this.root)}super._readyClients()}_attachDom(dom){const n=wrap(this);if(n.attachShadow){if(dom){if(!n.shadowRoot){n.attachShadow({mode:"open"})}n.shadowRoot.appendChild(dom);if(syncInitialRender&&window.ShadyDOM){ShadyDOM.flushInitial(n.shadowRoot)}return n.shadowRoot}return null}else{throw new Error("ShadowDOM not available. "+"PolymerElement can create dom as children instead of in "+"ShadowDOM by setting `this.root = this;` before `ready`.")}}updateStyles(properties){if(window.ShadyCSS){window.ShadyCSS.styleSubtree(this,properties)}}resolveUrl(url,base){if(!base&&this.importPath){base=resolveUrl(this.importPath)}return resolveUrl(url,base)}static _parseTemplateContent(template,templateInfo,nodeInfo){templateInfo.dynamicFns=templateInfo.dynamicFns||this._properties;return super._parseTemplateContent(template,templateInfo,nodeInfo)}static _addTemplatePropertyEffect(templateInfo,prop,effect){if(legacyOptimizations&&!(prop in this._properties)){console.warn(`Property '${prop}' used in template but not declared in 'properties'; `+`attribute will not be observed.`)}return super._addTemplatePropertyEffect(templateInfo,prop,effect)}}return PolymerElement});const GestureEventListeners=dedupingMixin(superClass=>{class GestureEventListeners extends superClass{_addEventListenerToNode(node,eventName,handler){if(!addListener(node,eventName,handler)){super._addEventListenerToNode(node,eventName,handler)}}_removeEventListenerFromNode(node,eventName,handler){if(!removeListener(node,eventName,handler)){super._removeEventListenerFromNode(node,eventName,handler)}}}return GestureEventListeners});function resolve(){document.body.removeAttribute("unresolved")}if(document.readyState==="interactive"||document.readyState==="complete"){resolve()}else{window.addEventListener("DOMContentLoaded",resolve)}function newSplice(index,removed,addedCount){return{index:index,removed:removed,addedCount:addedCount}}const EDIT_LEAVE=0;const EDIT_UPDATE=1;const EDIT_ADD=2;const EDIT_DELETE=3;function calcEditDistances(current,currentStart,currentEnd,old,oldStart,oldEnd){let rowCount=oldEnd-oldStart+1;let columnCount=currentEnd-currentStart+1;let distances=new Array(rowCount);for(let i=0;i<rowCount;i++){distances[i]=new Array(columnCount);distances[i][0]=i}for(let j=0;j<columnCount;j++)distances[0][j]=j;for(let i=1;i<rowCount;i++){for(let j=1;j<columnCount;j++){if(equals(current[currentStart+j-1],old[oldStart+i-1]))distances[i][j]=distances[i-1][j-1];else{let north=distances[i-1][j]+1;let west=distances[i][j-1]+1;distances[i][j]=north<west?north:west}}}return distances}function spliceOperationsFromEditDistances(distances){let i=distances.length-1;let j=distances[0].length-1;let current=distances[i][j];let edits=[];while(i>0||j>0){if(i==0){edits.push(EDIT_ADD);j--;continue}if(j==0){edits.push(EDIT_DELETE);i--;continue}let northWest=distances[i-1][j-1];let west=distances[i-1][j];let north=distances[i][j-1];let min;if(west<north)min=west<northWest?west:northWest;else min=north<northWest?north:northWest;if(min==northWest){if(northWest==current){edits.push(EDIT_LEAVE)}else{edits.push(EDIT_UPDATE);current=northWest}i--;j--}else if(min==west){edits.push(EDIT_DELETE);i--;current=west}else{edits.push(EDIT_ADD);j--;current=north}}edits.reverse();return edits}function calcSplices(current,currentStart,currentEnd,old,oldStart,oldEnd){let prefixCount=0;let suffixCount=0;let splice;let minLength=Math.min(currentEnd-currentStart,oldEnd-oldStart);if(currentStart==0&&oldStart==0)prefixCount=sharedPrefix(current,old,minLength);if(currentEnd==current.length&&oldEnd==old.length)suffixCount=sharedSuffix(current,old,minLength-prefixCount);currentStart+=prefixCount;oldStart+=prefixCount;currentEnd-=suffixCount;oldEnd-=suffixCount;if(currentEnd-currentStart==0&&oldEnd-oldStart==0)return[];if(currentStart==currentEnd){splice=newSplice(currentStart,[],0);while(oldStart<oldEnd)splice.removed.push(old[oldStart++]);return[splice]}else if(oldStart==oldEnd)return[newSplice(currentStart,[],currentEnd-currentStart)];let ops=spliceOperationsFromEditDistances(calcEditDistances(current,currentStart,currentEnd,old,oldStart,oldEnd));splice=undefined;let splices=[];let index=currentStart;let oldIndex=oldStart;for(let i=0;i<ops.length;i++){switch(ops[i]){case EDIT_LEAVE:if(splice){splices.push(splice);splice=undefined}index++;oldIndex++;break;case EDIT_UPDATE:if(!splice)splice=newSplice(index,[],0);splice.addedCount++;index++;splice.removed.push(old[oldIndex]);oldIndex++;break;case EDIT_ADD:if(!splice)splice=newSplice(index,[],0);splice.addedCount++;index++;break;case EDIT_DELETE:if(!splice)splice=newSplice(index,[],0);splice.removed.push(old[oldIndex]);oldIndex++;break}}if(splice){splices.push(splice)}return splices}function sharedPrefix(current,old,searchLength){for(let i=0;i<searchLength;i++)if(!equals(current[i],old[i]))return i;return searchLength}function sharedSuffix(current,old,searchLength){let index1=current.length;let index2=old.length;let count=0;while(count<searchLength&&equals(current[--index1],old[--index2]))count++;return count}function calculateSplices(current,previous){return calcSplices(current,0,current.length,previous,0,previous.length)}function equals(currentValue,previousValue){return currentValue===previousValue}function isSlot(node){return node.localName==="slot"}let FlattenedNodesObserver=class{static getFlattenedNodes(node){const wrapped=wrap(node);if(isSlot(node)){node=node;return wrapped.assignedNodes({flatten:true})}else{return Array.from(wrapped.childNodes).map(node=>{if(isSlot(node)){node=node;return wrap(node).assignedNodes({flatten:true})}else{return[node]}}).reduce((a,b)=>a.concat(b),[])}}constructor(target,callback){this._shadyChildrenObserver=null;this._nativeChildrenObserver=null;this._connected=false;this._target=target;this.callback=callback;this._effectiveNodes=[];this._observer=null;this._scheduled=false;this._boundSchedule=(()=>{this._schedule()});this.connect();this._schedule()}connect(){if(isSlot(this._target)){this._listenSlots([this._target])}else if(wrap(this._target).children){this._listenSlots(wrap(this._target).children);if(window.ShadyDOM){this._shadyChildrenObserver=ShadyDOM.observeChildren(this._target,mutations=>{this._processMutations(mutations)})}else{this._nativeChildrenObserver=new MutationObserver(mutations=>{this._processMutations(mutations)});this._nativeChildrenObserver.observe(this._target,{childList:true})}}this._connected=true}disconnect(){if(isSlot(this._target)){this._unlistenSlots([this._target])}else if(wrap(this._target).children){this._unlistenSlots(wrap(this._target).children);if(window.ShadyDOM&&this._shadyChildrenObserver){ShadyDOM.unobserveChildren(this._shadyChildrenObserver);this._shadyChildrenObserver=null}else if(this._nativeChildrenObserver){this._nativeChildrenObserver.disconnect();this._nativeChildrenObserver=null}}this._connected=false}_schedule(){if(!this._scheduled){this._scheduled=true;microTask.run(()=>this.flush())}}_processMutations(mutations){this._processSlotMutations(mutations);this.flush()}_processSlotMutations(mutations){if(mutations){for(let i=0;i<mutations.length;i++){let mutation=mutations[i];if(mutation.addedNodes){this._listenSlots(mutation.addedNodes)}if(mutation.removedNodes){this._unlistenSlots(mutation.removedNodes)}}}}flush(){if(!this._connected){return false}if(window.ShadyDOM){ShadyDOM.flush()}if(this._nativeChildrenObserver){this._processSlotMutations(this._nativeChildrenObserver.takeRecords())}else if(this._shadyChildrenObserver){this._processSlotMutations(this._shadyChildrenObserver.takeRecords())}this._scheduled=false;let info={target:this._target,addedNodes:[],removedNodes:[]};let newNodes=this.constructor.getFlattenedNodes(this._target);let splices=calculateSplices(newNodes,this._effectiveNodes);for(let i=0,s;i<splices.length&&(s=splices[i]);i++){for(let j=0,n;j<s.removed.length&&(n=s.removed[j]);j++){info.removedNodes.push(n)}}for(let i=0,s;i<splices.length&&(s=splices[i]);i++){for(let j=s.index;j<s.index+s.addedCount;j++){info.addedNodes.push(newNodes[j])}}this._effectiveNodes=newNodes;let didFlush=false;if(info.addedNodes.length||info.removedNodes.length){didFlush=true;this.callback.call(this._target,info)}return didFlush}_listenSlots(nodeList){for(let i=0;i<nodeList.length;i++){let n=nodeList[i];if(isSlot(n)){n.addEventListener("slotchange",this._boundSchedule)}}}_unlistenSlots(nodeList){for(let i=0;i<nodeList.length;i++){let n=nodeList[i];if(isSlot(n)){n.removeEventListener("slotchange",this._boundSchedule)}}}};const flush=function(){let shadyDOM,debouncers;do{shadyDOM=window.ShadyDOM&&ShadyDOM.flush();if(window.ShadyCSS&&window.ShadyCSS.ScopingShim){window.ShadyCSS.ScopingShim.flush()}debouncers=flushDebouncers()}while(shadyDOM||debouncers)};const p=Element.prototype;const normalizedMatchesSelector=p.matches||p.matchesSelector||p.mozMatchesSelector||p.msMatchesSelector||p.oMatchesSelector||p.webkitMatchesSelector;const matchesSelector=function(node,selector){return normalizedMatchesSelector.call(node,selector)};class DomApiNative{constructor(node){this.node=node}observeNodes(callback){return new FlattenedNodesObserver(this.node,callback)}unobserveNodes(observerHandle){observerHandle.disconnect()}notifyObserver(){}deepContains(node){if(wrap(this.node).contains(node)){return true}let n=node;let doc=node.ownerDocument;while(n&&n!==doc&&n!==this.node){n=wrap(n).parentNode||wrap(n).host}return n===this.node}getOwnerRoot(){return wrap(this.node).getRootNode()}getDistributedNodes(){return this.node.localName==="slot"?wrap(this.node).assignedNodes({flatten:true}):[]}getDestinationInsertionPoints(){let ip$=[];let n=wrap(this.node).assignedSlot;while(n){ip$.push(n);n=wrap(n).assignedSlot}return ip$}importNode(node,deep){let doc=this.node instanceof Document?this.node:this.node.ownerDocument;return wrap(doc).importNode(node,deep)}getEffectiveChildNodes(){return FlattenedNodesObserver.getFlattenedNodes(this.node)}queryDistributedElements(selector){let c$=this.getEffectiveChildNodes();let list=[];for(let i=0,l=c$.length,c;i<l&&(c=c$[i]);i++){if(c.nodeType===Node.ELEMENT_NODE&&matchesSelector(c,selector)){list.push(c)}}return list}get activeElement(){let node=this.node;return node._activeElement!==undefined?node._activeElement:node.activeElement}}function forwardMethods(proto,methods){for(let i=0;i<methods.length;i++){let method=methods[i];proto[method]=function(){return this.node[method].apply(this.node,arguments)}}}function forwardReadOnlyProperties(proto,properties){for(let i=0;i<properties.length;i++){let name=properties[i];Object.defineProperty(proto,name,{get:function(){const domApi=this;return domApi.node[name]},configurable:true})}}function forwardProperties(proto,properties){for(let i=0;i<properties.length;i++){let name=properties[i];Object.defineProperty(proto,name,{get:function(){return this.node[name]},set:function(value){this.node[name]=value},configurable:true})}}class EventApi{constructor(event){this.event=event}get rootTarget(){return this.path[0]}get localTarget(){return this.event.target}get path(){return this.event.composedPath()}}DomApiNative.prototype.cloneNode;DomApiNative.prototype.appendChild;DomApiNative.prototype.insertBefore;DomApiNative.prototype.removeChild;DomApiNative.prototype.replaceChild;DomApiNative.prototype.setAttribute;DomApiNative.prototype.removeAttribute;DomApiNative.prototype.querySelector;DomApiNative.prototype.querySelectorAll;DomApiNative.prototype.parentNode;DomApiNative.prototype.firstChild;DomApiNative.prototype.lastChild;DomApiNative.prototype.nextSibling;DomApiNative.prototype.previousSibling;DomApiNative.prototype.firstElementChild;DomApiNative.prototype.lastElementChild;DomApiNative.prototype.nextElementSibling;DomApiNative.prototype.previousElementSibling;DomApiNative.prototype.childNodes;DomApiNative.prototype.children;DomApiNative.prototype.classList;DomApiNative.prototype.textContent;DomApiNative.prototype.innerHTML;let DomApiImpl=DomApiNative;if(window["ShadyDOM"]&&window["ShadyDOM"]["inUse"]&&window["ShadyDOM"]["noPatch"]&&window["ShadyDOM"]["Wrapper"]){class Wrapper extends window["ShadyDOM"]["Wrapper"]{}Object.getOwnPropertyNames(DomApiNative.prototype).forEach(prop=>{if(prop!="activeElement"){Wrapper.prototype[prop]=DomApiNative.prototype[prop]}});forwardReadOnlyProperties(Wrapper.prototype,["classList"]);DomApiImpl=Wrapper;Object.defineProperties(EventApi.prototype,{localTarget:{get(){return this.event.currentTarget},configurable:true},path:{get(){return window["ShadyDOM"]["composedPath"](this.event)},configurable:true}})}else{forwardMethods(DomApiNative.prototype,["cloneNode","appendChild","insertBefore","removeChild","replaceChild","setAttribute","removeAttribute","querySelector","querySelectorAll"]);forwardReadOnlyProperties(DomApiNative.prototype,["parentNode","firstChild","lastChild","nextSibling","previousSibling","firstElementChild","lastElementChild","nextElementSibling","previousElementSibling","childNodes","children","classList"]);forwardProperties(DomApiNative.prototype,["textContent","innerHTML"])}const dom=function(obj){obj=obj||document;if(obj instanceof DomApiImpl){return obj}if(obj instanceof EventApi){return obj}let helper=obj["__domApi"];if(!helper){if(obj instanceof Event){helper=new EventApi(obj)}else{helper=new DomApiImpl(obj)}obj["__domApi"]=helper}return helper};let styleInterface=window.ShadyCSS;const LegacyElementMixin=dedupingMixin(base=>{const legacyElementBase=GestureEventListeners(ElementMixin(base));const DIRECTION_MAP={x:"pan-x",y:"pan-y",none:"none",all:"auto"};class LegacyElement extends legacyElementBase{constructor(){super();this.isAttached;this.__boundListeners;this._debouncers}static get importMeta(){return this.prototype.importMeta}created(){}connectedCallback(){super.connectedCallback();this.isAttached=true;this.attached()}attached(){}disconnectedCallback(){super.disconnectedCallback();this.isAttached=false;this.detached()}detached(){}attributeChangedCallback(name,old,value,namespace){if(old!==value){super.attributeChangedCallback(name,old,value,namespace);this.attributeChanged(name,old,value)}}attributeChanged(name,old,value){}_initializeProperties(){let proto=Object.getPrototypeOf(this);if(!proto.hasOwnProperty("__hasRegisterFinished")){this._registered();proto.__hasRegisterFinished=true}super._initializeProperties();this.root=this;this.created();this._applyListeners()}_registered(){}ready(){this._ensureAttributes();super.ready()}_ensureAttributes(){}_applyListeners(){}serialize(value){return this._serializeValue(value)}deserialize(value,type){return this._deserializeValue(value,type)}reflectPropertyToAttribute(property,attribute,value){this._propertyToAttribute(property,attribute,value)}serializeValueToAttribute(value,attribute,node){this._valueToNodeAttribute(node||this,value,attribute)}extend(prototype,api){if(!(prototype&&api)){return prototype||api}let n$=Object.getOwnPropertyNames(api);for(let i=0,n;i<n$.length&&(n=n$[i]);i++){let pd=Object.getOwnPropertyDescriptor(api,n);if(pd){Object.defineProperty(prototype,n,pd)}}return prototype}mixin(target,source){for(let i in source){target[i]=source[i]}return target}chainObject(object,prototype){if(object&&prototype&&object!==prototype){object.__proto__=prototype}return object}instanceTemplate(template){let content=this.constructor._contentForTemplate(template);let dom=document.importNode(content,true);return dom}fire(type,detail,options){options=options||{};detail=detail===null||detail===undefined?{}:detail;let event=new Event(type,{bubbles:options.bubbles===undefined?true:options.bubbles,cancelable:Boolean(options.cancelable),composed:options.composed===undefined?true:options.composed});event.detail=detail;let node=options.node||this;wrap(node).dispatchEvent(event);return event}listen(node,eventName,methodName){node=node||this;let hbl=this.__boundListeners||(this.__boundListeners=new WeakMap);let bl=hbl.get(node);if(!bl){bl={};hbl.set(node,bl)}let key=eventName+methodName;if(!bl[key]){bl[key]=this._addMethodEventListenerToNode(node,eventName,methodName,this)}}unlisten(node,eventName,methodName){node=node||this;let bl=this.__boundListeners&&this.__boundListeners.get(node);let key=eventName+methodName;let handler=bl&&bl[key];if(handler){this._removeEventListenerFromNode(node,eventName,handler);bl[key]=null}}setScrollDirection(direction,node){setTouchAction(node||this,DIRECTION_MAP[direction]||"auto")}$$(slctr){return this.root.querySelector(slctr)}get domHost(){let root=wrap(this).getRootNode();return root instanceof DocumentFragment?root.host:root}distributeContent(){const thisEl=this;const domApi=dom(thisEl);if(window.ShadyDOM&&domApi.shadowRoot){ShadyDOM.flush()}}getEffectiveChildNodes(){const thisEl=this;const domApi=dom(thisEl);return domApi.getEffectiveChildNodes()}queryDistributedElements(selector){const thisEl=this;const domApi=dom(thisEl);return domApi.queryDistributedElements(selector)}getEffectiveChildren(){let list=this.getEffectiveChildNodes();return list.filter(function(n){return n.nodeType===Node.ELEMENT_NODE})}getEffectiveTextContent(){let cn=this.getEffectiveChildNodes();let tc=[];for(let i=0,c;c=cn[i];i++){if(c.nodeType!==Node.COMMENT_NODE){tc.push(c.textContent)}}return tc.join("")}queryEffectiveChildren(selector){let e$=this.queryDistributedElements(selector);return e$&&e$[0]}queryAllEffectiveChildren(selector){return this.queryDistributedElements(selector)}getContentChildNodes(slctr){let content=this.root.querySelector(slctr||"slot");return content?dom(content).getDistributedNodes():[]}getContentChildren(slctr){let children=this.getContentChildNodes(slctr).filter(function(n){return n.nodeType===Node.ELEMENT_NODE});return children}isLightDescendant(node){const thisNode=this;return thisNode!==node&&wrap(thisNode).contains(node)&&wrap(thisNode).getRootNode()===wrap(node).getRootNode()}isLocalDescendant(node){return this.root===wrap(node).getRootNode()}scopeSubtree(container,shouldObserve){}getComputedStyleValue(property){return styleInterface.getComputedStyleValue(this,property)}debounce(jobName,callback,wait){this._debouncers=this._debouncers||{};return this._debouncers[jobName]=Debouncer.debounce(this._debouncers[jobName],wait>0?timeOut.after(wait):microTask,callback.bind(this))}isDebouncerActive(jobName){this._debouncers=this._debouncers||{};let debouncer=this._debouncers[jobName];return!!(debouncer&&debouncer.isActive())}flushDebouncer(jobName){this._debouncers=this._debouncers||{};let debouncer=this._debouncers[jobName];if(debouncer){debouncer.flush()}}cancelDebouncer(jobName){this._debouncers=this._debouncers||{};let debouncer=this._debouncers[jobName];if(debouncer){debouncer.cancel()}}async(callback,waitTime){return waitTime>0?timeOut.run(callback.bind(this),waitTime):~microTask.run(callback.bind(this))}cancelAsync(handle){handle<0?microTask.cancel(~handle):timeOut.cancel(handle)}create(tag,props){let elt=document.createElement(tag);if(props){if(elt.setProperties){elt.setProperties(props)}else{for(let n in props){elt[n]=props[n]}}}return elt}elementMatches(selector,node){return matchesSelector(node||this,selector)}toggleAttribute(name,bool){let node=this;if(arguments.length===3){node=arguments[2]}if(arguments.length==1){bool=!node.hasAttribute(name)}if(bool){wrap(node).setAttribute(name,"");return true}else{wrap(node).removeAttribute(name);return false}}toggleClass(name,bool,node){node=node||this;if(arguments.length==1){bool=!node.classList.contains(name)}if(bool){node.classList.add(name)}else{node.classList.remove(name)}}transform(transformText,node){node=node||this;node.style.webkitTransform=transformText;node.style.transform=transformText}translate3d(x,y,z,node){node=node||this;this.transform("translate3d("+x+","+y+","+z+")",node)}arrayDelete(arrayOrPath,item){let index;if(Array.isArray(arrayOrPath)){index=arrayOrPath.indexOf(item);if(index>=0){return arrayOrPath.splice(index,1)}}else{let arr=get(this,arrayOrPath);index=arr.indexOf(item);if(index>=0){return this.splice(arrayOrPath,index,1)}}return null}_logger(level,args){if(Array.isArray(args)&&args.length===1&&Array.isArray(args[0])){args=args[0]}switch(level){case"log":case"warn":case"error":console[level](...args)}}_log(...args){this._logger("log",args)}_warn(...args){this._logger("warn",args)}_error(...args){this._logger("error",args)}_logf(methodName,...args){return["[%s::%s]",this.is,methodName,...args]}}LegacyElement.prototype.is="";return LegacyElement});const lifecycleProps={attached:true,detached:true,ready:true,created:true,beforeRegister:true,registered:true,attributeChanged:true,listeners:true,hostAttributes:true};const excludeOnInfo={attached:true,detached:true,ready:true,created:true,beforeRegister:true,registered:true,attributeChanged:true,behaviors:true,_noAccessors:true};const excludeOnBehaviors=Object.assign({listeners:true,hostAttributes:true,properties:true,observers:true},excludeOnInfo);function copyProperties(source,target,excludeProps){const noAccessors=source._noAccessors;const propertyNames=Object.getOwnPropertyNames(source);for(let i=0;i<propertyNames.length;i++){let p=propertyNames[i];if(p in excludeProps){continue}if(noAccessors){target[p]=source[p]}else{let pd=Object.getOwnPropertyDescriptor(source,p);if(pd){pd.configurable=true;Object.defineProperty(target,p,pd)}}}}function applyBehaviors(proto,behaviors,lifecycle){for(let i=0;i<behaviors.length;i++){applyInfo(proto,behaviors[i],lifecycle,excludeOnBehaviors)}}function applyInfo(proto,info,lifecycle,excludeProps){copyProperties(info,proto,excludeProps);for(let p in lifecycleProps){if(info[p]){lifecycle[p]=lifecycle[p]||[];lifecycle[p].push(info[p])}}}function flattenBehaviors(behaviors,list,exclude){list=list||[];for(let i=behaviors.length-1;i>=0;i--){let b=behaviors[i];if(b){if(Array.isArray(b)){flattenBehaviors(b,list)}else{if(list.indexOf(b)<0&&(!exclude||exclude.indexOf(b)<0)){list.unshift(b)}}}else{console.warn("behavior is null, check for missing or 404 import")}}return list}function mergeProperties(target,source){for(const p in source){const targetInfo=target[p];const sourceInfo=source[p];if(!("value"in sourceInfo)&&targetInfo&&"value"in targetInfo){target[p]=Object.assign({value:targetInfo.value},sourceInfo)}else{target[p]=sourceInfo}}}function GenerateClassFromInfo(info,Base,behaviors){let behaviorList;const lifecycle={};class PolymerGenerated extends Base{static _finalizeClass(){if(!this.hasOwnProperty(JSCompiler_renameProperty("generatedFrom",this))){super._finalizeClass()}else{if(behaviorList){for(let i=0,b;i<behaviorList.length;i++){b=behaviorList[i];if(b.properties){this.createProperties(b.properties)}if(b.observers){this.createObservers(b.observers,b.properties)}}}if(info.properties){this.createProperties(info.properties)}if(info.observers){this.createObservers(info.observers,info.properties)}this._prepareTemplate()}}static get properties(){const properties={};if(behaviorList){for(let i=0;i<behaviorList.length;i++){mergeProperties(properties,behaviorList[i].properties)}}mergeProperties(properties,info.properties);return properties}static get observers(){let observers=[];if(behaviorList){for(let i=0,b;i<behaviorList.length;i++){b=behaviorList[i];if(b.observers){observers=observers.concat(b.observers)}}}if(info.observers){observers=observers.concat(info.observers)}return observers}created(){super.created();const list=lifecycle.created;if(list){for(let i=0;i<list.length;i++){list[i].call(this)}}}_registered(){const generatedProto=PolymerGenerated.prototype;if(!generatedProto.hasOwnProperty("__hasRegisterFinished")){generatedProto.__hasRegisterFinished=true;super._registered();if(legacyOptimizations){copyPropertiesToProto(generatedProto)}const proto=Object.getPrototypeOf(this);let list=lifecycle.beforeRegister;if(list){for(let i=0;i<list.length;i++){list[i].call(proto)}}list=lifecycle.registered;if(list){for(let i=0;i<list.length;i++){list[i].call(proto)}}}}_applyListeners(){super._applyListeners();const list=lifecycle.listeners;if(list){for(let i=0;i<list.length;i++){const listeners=list[i];if(listeners){for(let l in listeners){this._addMethodEventListenerToNode(this,l,listeners[l])}}}}}_ensureAttributes(){const list=lifecycle.hostAttributes;if(list){for(let i=list.length-1;i>=0;i--){const hostAttributes=list[i];for(let a in hostAttributes){this._ensureAttribute(a,hostAttributes[a])}}}super._ensureAttributes()}ready(){super.ready();let list=lifecycle.ready;if(list){for(let i=0;i<list.length;i++){list[i].call(this)}}}attached(){super.attached();let list=lifecycle.attached;if(list){for(let i=0;i<list.length;i++){list[i].call(this)}}}detached(){super.detached();let list=lifecycle.detached;if(list){for(let i=0;i<list.length;i++){list[i].call(this)}}}attributeChanged(name,old,value){super.attributeChanged();let list=lifecycle.attributeChanged;if(list){for(let i=0;i<list.length;i++){list[i].call(this,name,old,value)}}}}if(behaviors){if(!Array.isArray(behaviors)){behaviors=[behaviors]}let superBehaviors=Base.prototype.behaviors;behaviorList=flattenBehaviors(behaviors,null,superBehaviors);PolymerGenerated.prototype.behaviors=superBehaviors?superBehaviors.concat(behaviors):behaviorList}const copyPropertiesToProto=proto=>{if(behaviorList){applyBehaviors(proto,behaviorList,lifecycle)}applyInfo(proto,info,lifecycle,excludeOnInfo)};if(!legacyOptimizations){copyPropertiesToProto(PolymerGenerated.prototype)}PolymerGenerated.generatedFrom=info;return PolymerGenerated}const Class=function(info,mixin){if(!info){console.warn("Polymer.Class requires `info` argument")}let klass=mixin?mixin(LegacyElementMixin(HTMLElement)):LegacyElementMixin(HTMLElement);klass=GenerateClassFromInfo(info,klass,info.behaviors);klass.is=klass.prototype.is=info.is;return klass};const Polymer=function(info){let klass;if(typeof info==="function"){klass=info}else{klass=Polymer.Class(info)}customElements.define(klass.is,klass);return klass};Polymer.Class=Class;function mutablePropertyChange(inst,property,value,old,mutableData){let isObject;if(mutableData){isObject=typeof value==="object"&&value!==null;if(isObject){old=inst.__dataTemp[property]}}let shouldChange=old!==value&&(old===old||value===value);if(isObject&&shouldChange){inst.__dataTemp[property]=value}return shouldChange}const MutableData=dedupingMixin(superClass=>{class MutableData extends superClass{_shouldPropertyChange(property,value,old){return mutablePropertyChange(this,property,value,old,true)}}return MutableData});const OptionalMutableData=dedupingMixin(superClass=>{class OptionalMutableData extends superClass{static get properties(){return{mutableData:Boolean}}_shouldPropertyChange(property,value,old){return mutablePropertyChange(this,property,value,old,this.mutableData)}}return OptionalMutableData});MutableData._mutablePropertyChange=mutablePropertyChange;let newInstance=null;function HTMLTemplateElementExtension(){return newInstance}HTMLTemplateElementExtension.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:HTMLTemplateElementExtension,writable:true}});const DataTemplate=PropertyEffects(HTMLTemplateElementExtension);const MutableDataTemplate=MutableData(DataTemplate);function upgradeTemplate(template,constructor){newInstance=template;Object.setPrototypeOf(template,constructor.prototype);new constructor;newInstance=null}const templateInstanceBase=PropertyEffects(class{});class TemplateInstanceBase extends templateInstanceBase{constructor(props){super();this._configureProperties(props);this.root=this._stampTemplate(this.__dataHost);let children=this.children=[];for(let n=this.root.firstChild;n;n=n.nextSibling){children.push(n);n.__templatizeInstance=this}if(this.__templatizeOwner&&this.__templatizeOwner.__hideTemplateChildren__){this._showHideChildren(true)}let options=this.__templatizeOptions;if(props&&options.instanceProps||!options.instanceProps){this._enableProperties()}}_configureProperties(props){let options=this.__templatizeOptions;if(options.forwardHostProp){for(let hprop in this.__hostProps){this._setPendingProperty(hprop,this.__dataHost["_host_"+hprop])}}for(let iprop in props){this._setPendingProperty(iprop,props[iprop])}}forwardHostProp(prop,value){if(this._setPendingPropertyOrPath(prop,value,false,true)){this.__dataHost._enqueueClient(this)}}_addEventListenerToNode(node,eventName,handler){if(this._methodHost&&this.__templatizeOptions.parentModel){this._methodHost._addEventListenerToNode(node,eventName,e=>{e.model=this;handler(e)})}else{let templateHost=this.__dataHost.__dataHost;if(templateHost){templateHost._addEventListenerToNode(node,eventName,handler)}}}_showHideChildren(hide){let c=this.children;for(let i=0;i<c.length;i++){let n=c[i];if(Boolean(hide)!=Boolean(n.__hideTemplateChildren__)){if(n.nodeType===Node.TEXT_NODE){if(hide){n.__polymerTextContent__=n.textContent;n.textContent=""}else{n.textContent=n.__polymerTextContent__}}else if(n.localName==="slot"){if(hide){n.__polymerReplaced__=document.createComment("hidden-slot");wrap(wrap(n).parentNode).replaceChild(n.__polymerReplaced__,n)}else{const replace=n.__polymerReplaced__;if(replace){wrap(wrap(replace).parentNode).replaceChild(n,replace)}}}else if(n.style){if(hide){n.__polymerDisplay__=n.style.display;n.style.display="none"}else{n.style.display=n.__polymerDisplay__}}}n.__hideTemplateChildren__=hide;if(n._showHideChildren){n._showHideChildren(hide)}}}_setUnmanagedPropertyToNode(node,prop,value){if(node.__hideTemplateChildren__&&node.nodeType==Node.TEXT_NODE&&prop=="textContent"){node.__polymerTextContent__=value}else{super._setUnmanagedPropertyToNode(node,prop,value)}}get parentModel(){let model=this.__parentModel;if(!model){let options;model=this;do{model=model.__dataHost.__dataHost}while((options=model.__templatizeOptions)&&!options.parentModel);this.__parentModel=model}return model}dispatchEvent(event){return true}}TemplateInstanceBase.prototype.__dataHost;TemplateInstanceBase.prototype.__templatizeOptions;TemplateInstanceBase.prototype._methodHost;TemplateInstanceBase.prototype.__templatizeOwner;TemplateInstanceBase.prototype.__hostProps;const MutableTemplateInstanceBase=MutableData(TemplateInstanceBase);function findMethodHost(template){let templateHost=template.__dataHost;return templateHost&&templateHost._methodHost||templateHost}function createTemplatizerClass(template,templateInfo,options){let templatizerBase=options.mutableData?MutableTemplateInstanceBase:TemplateInstanceBase;if(templatize.mixin){templatizerBase=templatize.mixin(templatizerBase)}let klass=class extends templatizerBase{};klass.prototype.__templatizeOptions=options;klass.prototype._bindTemplate(template);addNotifyEffects(klass,template,templateInfo,options);return klass}function addPropagateEffects(template,templateInfo,options){let userForwardHostProp=options.forwardHostProp;if(userForwardHostProp){let klass=templateInfo.templatizeTemplateClass;if(!klass){let templatizedBase=options.mutableData?MutableDataTemplate:DataTemplate;klass=templateInfo.templatizeTemplateClass=class TemplatizedTemplate extends templatizedBase{};let hostProps=templateInfo.hostProps;for(let prop in hostProps){klass.prototype._addPropertyEffect("_host_"+prop,klass.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,{fn:createForwardHostPropEffect(prop,userForwardHostProp)});klass.prototype._createNotifyingProperty("_host_"+prop)}}upgradeTemplate(template,klass);if(template.__dataProto){Object.assign(template.__data,template.__dataProto)}template.__dataTemp={};template.__dataPending=null;template.__dataOld=null;template._enableProperties()}}function createForwardHostPropEffect(hostProp,userForwardHostProp){return function forwardHostProp(template,prop,props){userForwardHostProp.call(template.__templatizeOwner,prop.substring("_host_".length),props[prop])}}function addNotifyEffects(klass,template,templateInfo,options){let hostProps=templateInfo.hostProps||{};for(let iprop in options.instanceProps){delete hostProps[iprop];let userNotifyInstanceProp=options.notifyInstanceProp;if(userNotifyInstanceProp){klass.prototype._addPropertyEffect(iprop,klass.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:createNotifyInstancePropEffect(iprop,userNotifyInstanceProp)})}}if(options.forwardHostProp&&template.__dataHost){for(let hprop in hostProps){klass.prototype._addPropertyEffect(hprop,klass.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:createNotifyHostPropEffect()})}}}function createNotifyInstancePropEffect(instProp,userNotifyInstanceProp){return function notifyInstanceProp(inst,prop,props){userNotifyInstanceProp.call(inst.__templatizeOwner,inst,prop,props[prop])}}function createNotifyHostPropEffect(){return function notifyHostProp(inst,prop,props){inst.__dataHost._setPendingPropertyOrPath("_host_"+prop,props[prop],true,true)}}function templatize(template,owner,options){if(strictTemplatePolicy&&!findMethodHost(template)){throw new Error("strictTemplatePolicy: template owner not trusted")}options=options||{};if(template.__templatizeOwner){throw new Error("A <template> can only be templatized once")}template.__templatizeOwner=owner;const ctor=owner?owner.constructor:TemplateInstanceBase;let templateInfo=ctor._parseTemplate(template);let baseClass=templateInfo.templatizeInstanceClass;if(!baseClass){baseClass=createTemplatizerClass(template,templateInfo,options);templateInfo.templatizeInstanceClass=baseClass}addPropagateEffects(template,templateInfo,options);let klass=class TemplateInstance extends baseClass{};klass.prototype._methodHost=findMethodHost(template);klass.prototype.__dataHost=template;klass.prototype.__templatizeOwner=owner;klass.prototype.__hostProps=templateInfo.hostProps;klass=klass;return klass}function modelForElement(template,node){let model;while(node){if(model=node.__templatizeInstance){if(model.__dataHost!=template){node=model.__dataHost}else{return model}}else{node=wrap(node).parentNode}}return null}const Templatizer={templatize(template,mutableData){this._templatizerTemplate=template;this.ctor=templatize(template,this,{mutableData:Boolean(mutableData),parentModel:this._parentModel,instanceProps:this._instanceProps,forwardHostProp:this._forwardHostPropV2,notifyInstanceProp:this._notifyInstancePropV2})},stamp(model){return new this.ctor(model)},modelForElement(el){return modelForElement(this._templatizerTemplate,el)}};const domBindBase=GestureEventListeners(OptionalMutableData(PropertyEffects(HTMLElement)));class DomBind extends domBindBase{static get observedAttributes(){return["mutable-data"]}constructor(){super();if(strictTemplatePolicy){throw new Error(`strictTemplatePolicy: dom-bind not allowed`)}this.root=null;this.$=null;this.__children=null}attributeChangedCallback(){this.mutableData=true}connectedCallback(){this.style.display="none";this.render()}disconnectedCallback(){this.__removeChildren()}__insertChildren(){wrap(wrap(this).parentNode).insertBefore(this.root,this)}__removeChildren(){if(this.__children){for(let i=0;i<this.__children.length;i++){this.root.appendChild(this.__children[i])}}}render(){let template;if(!this.__children){template=template||this.querySelector("template");if(!template){let observer=new MutationObserver(()=>{template=this.querySelector("template");if(template){observer.disconnect();this.render()}else{throw new Error("dom-bind requires a <template> child")}});observer.observe(this,{childList:true});return}this.root=this._stampTemplate(template);this.$=this.root.$;this.__children=[];for(let n=this.root.firstChild;n;n=n.nextSibling){this.__children[this.__children.length]=n}this._enableProperties()}this.__insertChildren();this.dispatchEvent(new CustomEvent("dom-change",{bubbles:true,composed:true}))}}customElements.define("dom-bind",DomBind);class LiteralString{constructor(string){this.value=string.toString()}toString(){return this.value}}function literalValue(value){if(value instanceof LiteralString){return value.value}else{throw new Error(`non-literal value passed to Polymer's htmlLiteral function: ${value}`)}}function htmlValue(value){if(value instanceof HTMLTemplateElement){return value.innerHTML}else if(value instanceof LiteralString){return literalValue(value)}else{throw new Error(`non-template value passed to Polymer's html function: ${value}`)}}const html=function html(strings,...values){const template=document.createElement("template");template.innerHTML=values.reduce((acc,v,idx)=>acc+htmlValue(v)+strings[idx+1],strings[0]);return template};const PolymerElement=ElementMixin(HTMLElement);const domRepeatBase=OptionalMutableData(PolymerElement);class DomRepeat extends domRepeatBase{static get is(){return"dom-repeat"}static get template(){return null}static get properties(){return{items:{type:Array},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},itemsIndexAs:{type:String,value:"itemsIndex"},sort:{type:Function,observer:"__sortChanged"},filter:{type:Function,observer:"__filterChanged"},observe:{type:String,observer:"__observeChanged"},delay:Number,renderedItemCount:{type:Number,notify:true,readOnly:true},initialCount:{type:Number,observer:"__initializeChunking"},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Number,computed:"__computeFrameTime(targetFramerate)"}}}static get observers(){return["__itemsChanged(items.*)"]}constructor(){super();this.__instances=[];this.__limit=Infinity;this.__pool=[];this.__renderDebouncer=null;this.__itemsIdxToInstIdx={};this.__chunkCount=null;this.__lastChunkTime=null;this.__sortFn=null;this.__filterFn=null;this.__observePaths=null;this.__ctor=null;this.__isDetached=true;this.template=null}disconnectedCallback(){super.disconnectedCallback();this.__isDetached=true;for(let i=0;i<this.__instances.length;i++){this.__detachInstance(i)}}connectedCallback(){super.connectedCallback();this.style.display="none";if(this.__isDetached){this.__isDetached=false;let wrappedParent=wrap(wrap(this).parentNode);for(let i=0;i<this.__instances.length;i++){this.__attachInstance(i,wrappedParent)}}}__ensureTemplatized(){if(!this.__ctor){let template=this.template=this.querySelector("template");if(!template){let observer=new MutationObserver(()=>{if(this.querySelector("template")){observer.disconnect();this.__render()}else{throw new Error("dom-repeat requires a <template> child")}});observer.observe(this,{childList:true});return false}let instanceProps={};instanceProps[this.as]=true;instanceProps[this.indexAs]=true;instanceProps[this.itemsIndexAs]=true;this.__ctor=templatize(template,this,{mutableData:this.mutableData,parentModel:true,instanceProps:instanceProps,forwardHostProp:function(prop,value){let i$=this.__instances;for(let i=0,inst;i<i$.length&&(inst=i$[i]);i++){inst.forwardHostProp(prop,value)}},notifyInstanceProp:function(inst,prop,value){if(matches(this.as,prop)){let idx=inst[this.itemsIndexAs];if(prop==this.as){this.items[idx]=value}let path=translate(this.as,`${JSCompiler_renameProperty("items",this)}.${idx}`,prop);this.notifyPath(path,value)}}})}return true}__getMethodHost(){return this.__dataHost._methodHost||this.__dataHost}__functionFromPropertyValue(functionOrMethodName){if(typeof functionOrMethodName==="string"){let methodName=functionOrMethodName;let obj=this.__getMethodHost();return function(){return obj[methodName].apply(obj,arguments)}}return functionOrMethodName}__sortChanged(sort){this.__sortFn=this.__functionFromPropertyValue(sort);if(this.items){this.__debounceRender(this.__render)}}__filterChanged(filter){this.__filterFn=this.__functionFromPropertyValue(filter);if(this.items){this.__debounceRender(this.__render)}}__computeFrameTime(rate){return Math.ceil(1e3/rate)}__initializeChunking(){if(this.initialCount){this.__limit=this.initialCount;this.__chunkCount=this.initialCount;this.__lastChunkTime=performance.now()}}__tryRenderChunk(){if(this.items&&this.__limit<this.items.length){this.__debounceRender(this.__requestRenderChunk)}}__requestRenderChunk(){requestAnimationFrame(()=>this.__renderChunk())}__renderChunk(){let currChunkTime=performance.now();let ratio=this._targetFrameTime/(currChunkTime-this.__lastChunkTime);this.__chunkCount=Math.round(this.__chunkCount*ratio)||1;this.__limit+=this.__chunkCount;this.__lastChunkTime=currChunkTime;this.__debounceRender(this.__render)}__observeChanged(){this.__observePaths=this.observe&&this.observe.replace(".*",".").split(" ")}__itemsChanged(change){if(this.items&&!Array.isArray(this.items)){console.warn("dom-repeat expected array for `items`, found",this.items)}if(!this.__handleItemPath(change.path,change.value)){this.__initializeChunking();this.__debounceRender(this.__render)}}__handleObservedPaths(path){if(this.__sortFn||this.__filterFn){if(!path){this.__debounceRender(this.__render,this.delay)}else if(this.__observePaths){let paths=this.__observePaths;for(let i=0;i<paths.length;i++){if(path.indexOf(paths[i])===0){this.__debounceRender(this.__render,this.delay)}}}}}__debounceRender(fn,delay=0){this.__renderDebouncer=Debouncer.debounce(this.__renderDebouncer,delay>0?timeOut.after(delay):microTask,fn.bind(this));enqueueDebouncer(this.__renderDebouncer)}render(){this.__debounceRender(this.__render);flush()}__render(){if(!this.__ensureTemplatized()){return}this.__applyFullRefresh();this.__pool.length=0;this._setRenderedItemCount(this.__instances.length);this.dispatchEvent(new CustomEvent("dom-change",{bubbles:true,composed:true}));this.__tryRenderChunk()}__applyFullRefresh(){let items=this.items||[];let isntIdxToItemsIdx=new Array(items.length);for(let i=0;i<items.length;i++){isntIdxToItemsIdx[i]=i}if(this.__filterFn){isntIdxToItemsIdx=isntIdxToItemsIdx.filter((i,idx,array)=>this.__filterFn(items[i],idx,array))}if(this.__sortFn){isntIdxToItemsIdx.sort((a,b)=>this.__sortFn(items[a],items[b]))}const itemsIdxToInstIdx=this.__itemsIdxToInstIdx={};let instIdx=0;const limit=Math.min(isntIdxToItemsIdx.length,this.__limit);for(;instIdx<limit;instIdx++){let inst=this.__instances[instIdx];let itemIdx=isntIdxToItemsIdx[instIdx];let item=items[itemIdx];itemsIdxToInstIdx[itemIdx]=instIdx;if(inst){inst._setPendingProperty(this.as,item);inst._setPendingProperty(this.indexAs,instIdx);inst._setPendingProperty(this.itemsIndexAs,itemIdx);inst._flushProperties()}else{this.__insertInstance(item,instIdx,itemIdx)}}for(let i=this.__instances.length-1;i>=instIdx;i--){this.__detachAndRemoveInstance(i)}}__detachInstance(idx){let inst=this.__instances[idx];const wrappedRoot=wrap(inst.root);for(let i=0;i<inst.children.length;i++){let el=inst.children[i];wrappedRoot.appendChild(el)}return inst}__attachInstance(idx,parent){let inst=this.__instances[idx];parent.insertBefore(inst.root,this)}__detachAndRemoveInstance(idx){let inst=this.__detachInstance(idx);if(inst){this.__pool.push(inst)}this.__instances.splice(idx,1)}__stampInstance(item,instIdx,itemIdx){let model={};model[this.as]=item;model[this.indexAs]=instIdx;model[this.itemsIndexAs]=itemIdx;return new this.__ctor(model)}__insertInstance(item,instIdx,itemIdx){let inst=this.__pool.pop();if(inst){inst._setPendingProperty(this.as,item);inst._setPendingProperty(this.indexAs,instIdx);inst._setPendingProperty(this.itemsIndexAs,itemIdx);inst._flushProperties()}else{inst=this.__stampInstance(item,instIdx,itemIdx)}let beforeRow=this.__instances[instIdx+1];let beforeNode=beforeRow?beforeRow.children[0]:this;wrap(wrap(this).parentNode).insertBefore(inst.root,beforeNode);this.__instances[instIdx]=inst;return inst}_showHideChildren(hidden){for(let i=0;i<this.__instances.length;i++){this.__instances[i]._showHideChildren(hidden)}}__handleItemPath(path,value){let itemsPath=path.slice(6);let dot=itemsPath.indexOf(".");let itemsIdx=dot<0?itemsPath:itemsPath.substring(0,dot);if(itemsIdx==parseInt(itemsIdx,10)){let itemSubPath=dot<0?"":itemsPath.substring(dot+1);this.__handleObservedPaths(itemSubPath);let instIdx=this.__itemsIdxToInstIdx[itemsIdx];let inst=this.__instances[instIdx];if(inst){let itemPath=this.as+(itemSubPath?"."+itemSubPath:"");inst._setPendingPropertyOrPath(itemPath,value,false,true);inst._flushProperties()}return true}}itemForElement(el){let instance=this.modelForElement(el);return instance&&instance[this.as]}indexForElement(el){let instance=this.modelForElement(el);return instance&&instance[this.indexAs]}modelForElement(el){return modelForElement(this.template,el)}}customElements.define(DomRepeat.is,DomRepeat);class DomIf extends PolymerElement{static get is(){return"dom-if"}static get template(){return null}static get properties(){return{if:{type:Boolean,observer:"__debounceRender"},restamp:{type:Boolean,observer:"__debounceRender"}}}constructor(){super();this.__renderDebouncer=null;this.__invalidProps=null;this.__instance=null;this._lastIf=false;this.__ctor=null;this.__hideTemplateChildren__=false}__debounceRender(){this.__renderDebouncer=Debouncer.debounce(this.__renderDebouncer,microTask,()=>this.__render());enqueueDebouncer(this.__renderDebouncer)}disconnectedCallback(){super.disconnectedCallback();const parent=wrap(this).parentNode;if(!parent||parent.nodeType==Node.DOCUMENT_FRAGMENT_NODE&&!wrap(parent).host){this.__teardownInstance()}}connectedCallback(){super.connectedCallback();this.style.display="none";if(this.if){this.__debounceRender()}}render(){flush()}__render(){if(this.if){if(!this.__ensureInstance()){return}this._showHideChildren()}else if(this.restamp){this.__teardownInstance()}if(!this.restamp&&this.__instance){this._showHideChildren()}if(this.if!=this._lastIf){this.dispatchEvent(new CustomEvent("dom-change",{bubbles:true,composed:true}));this._lastIf=this.if}}__ensureInstance(){let parentNode=wrap(this).parentNode;if(parentNode){if(!this.__ctor){let template=wrap(this).querySelector("template");if(!template){let observer=new MutationObserver(()=>{if(wrap(this).querySelector("template")){observer.disconnect();this.__render()}else{throw new Error("dom-if requires a <template> child")}});observer.observe(this,{childList:true});return false}this.__ctor=templatize(template,this,{mutableData:true,forwardHostProp:function(prop,value){if(this.__instance){if(this.if){this.__instance.forwardHostProp(prop,value)}else{this.__invalidProps=this.__invalidProps||Object.create(null);this.__invalidProps[root(prop)]=true}}}})}if(!this.__instance){this.__instance=new this.__ctor;wrap(parentNode).insertBefore(this.__instance.root,this)}else{this.__syncHostProperties();let c$=this.__instance.children;if(c$&&c$.length){let lastChild=wrap(this).previousSibling;if(lastChild!==c$[c$.length-1]){for(let i=0,n;i<c$.length&&(n=c$[i]);i++){wrap(parentNode).insertBefore(n,this)}}}}}return true}__syncHostProperties(){let props=this.__invalidProps;if(props){for(let prop in props){this.__instance._setPendingProperty(prop,this.__dataHost[prop])}this.__invalidProps=null;this.__instance._flushProperties()}}__teardownInstance(){if(this.__instance){let c$=this.__instance.children;if(c$&&c$.length){let parent=wrap(c$[0]).parentNode;if(parent){parent=wrap(parent);for(let i=0,n;i<c$.length&&(n=c$[i]);i++){parent.removeChild(n)}}}this.__instance=null;this.__invalidProps=null}}_showHideChildren(){let hidden=this.__hideTemplateChildren__||!this.if;if(this.__instance){this.__instance._showHideChildren(hidden)}}}customElements.define(DomIf.is,DomIf);let ArraySelectorMixin=dedupingMixin(superClass=>{let elementBase=ElementMixin(superClass);class ArraySelectorMixin extends elementBase{static get properties(){return{items:{type:Array},multi:{type:Boolean,value:false},selected:{type:Object,notify:true},selectedItem:{type:Object,notify:true},toggle:{type:Boolean,value:false}}}static get observers(){return["__updateSelection(multi, items.*)"]}constructor(){super();this.__lastItems=null;this.__lastMulti=null;this.__selectedMap=null}__updateSelection(multi,itemsInfo){let path=itemsInfo.path;if(path==JSCompiler_renameProperty("items",this)){let newItems=itemsInfo.base||[];let lastItems=this.__lastItems;let lastMulti=this.__lastMulti;if(multi!==lastMulti){this.clearSelection()}if(lastItems){let splices=calculateSplices(newItems,lastItems);this.__applySplices(splices)}this.__lastItems=newItems;this.__lastMulti=multi}else if(itemsInfo.path==`${JSCompiler_renameProperty("items",this)}.splices`){this.__applySplices(itemsInfo.value.indexSplices)}else{let part=path.slice(`${JSCompiler_renameProperty("items",this)}.`.length);let idx=parseInt(part,10);if(part.indexOf(".")<0&&part==idx){this.__deselectChangedIdx(idx)}}}__applySplices(splices){let selected=this.__selectedMap;for(let i=0;i<splices.length;i++){let s=splices[i];selected.forEach((idx,item)=>{if(idx<s.index);else if(idx>=s.index+s.removed.length){selected.set(item,idx+s.addedCount-s.removed.length)}else{selected.set(item,-1)}});for(let j=0;j<s.addedCount;j++){let idx=s.index+j;if(selected.has(this.items[idx])){selected.set(this.items[idx],idx)}}}this.__updateLinks();let sidx=0;selected.forEach((idx,item)=>{if(idx<0){if(this.multi){this.splice(JSCompiler_renameProperty("selected",this),sidx,1)}else{this.selected=this.selectedItem=null}selected.delete(item)}else{sidx++}})}__updateLinks(){this.__dataLinkedPaths={};if(this.multi){let sidx=0;this.__selectedMap.forEach(idx=>{if(idx>=0){this.linkPaths(`${JSCompiler_renameProperty("items",this)}.${idx}`,`${JSCompiler_renameProperty("selected",this)}.${sidx++}`)}})}else{this.__selectedMap.forEach(idx=>{this.linkPaths(JSCompiler_renameProperty("selected",this),`${JSCompiler_renameProperty("items",this)}.${idx}`);this.linkPaths(JSCompiler_renameProperty("selectedItem",this),`${JSCompiler_renameProperty("items",this)}.${idx}`)})}}clearSelection(){this.__dataLinkedPaths={};this.__selectedMap=new Map;this.selected=this.multi?[]:null;this.selectedItem=null}isSelected(item){return this.__selectedMap.has(item)}isIndexSelected(idx){return this.isSelected(this.items[idx])}__deselectChangedIdx(idx){let sidx=this.__selectedIndexForItemIndex(idx);if(sidx>=0){let i=0;this.__selectedMap.forEach((idx,item)=>{if(sidx==i++){this.deselect(item)}})}}__selectedIndexForItemIndex(idx){let selected=this.__dataLinkedPaths[`${JSCompiler_renameProperty("items",this)}.${idx}`];if(selected){return parseInt(selected.slice(`${JSCompiler_renameProperty("selected",this)}.`.length),10)}}deselect(item){let idx=this.__selectedMap.get(item);if(idx>=0){this.__selectedMap.delete(item);let sidx;if(this.multi){sidx=this.__selectedIndexForItemIndex(idx)}this.__updateLinks();if(this.multi){this.splice(JSCompiler_renameProperty("selected",this),sidx,1)}else{this.selected=this.selectedItem=null}}}deselectIndex(idx){this.deselect(this.items[idx])}select(item){this.selectIndex(this.items.indexOf(item))}selectIndex(idx){let item=this.items[idx];if(!this.isSelected(item)){if(!this.multi){this.__selectedMap.clear()}this.__selectedMap.set(item,idx);this.__updateLinks();if(this.multi){this.push(JSCompiler_renameProperty("selected",this),item)}else{this.selected=this.selectedItem=item}}else if(this.toggle){this.deselectIndex(idx)}}}return ArraySelectorMixin});let baseArraySelector=ArraySelectorMixin(PolymerElement);class ArraySelector extends baseArraySelector{static get is(){return"array-selector"}static get template(){return null}}customElements.define(ArraySelector.is,ArraySelector);const customStyleInterface=new CustomStyleInterface;if(!window.ShadyCSS){window.ShadyCSS={prepareTemplate(template,elementName,elementExtends){},prepareTemplateDom(template,elementName){},prepareTemplateStyles(template,elementName,elementExtends){},styleSubtree(element,properties){customStyleInterface.processStyles();updateNativeProperties(element,properties)},styleElement(element){customStyleInterface.processStyles()},styleDocument(properties){customStyleInterface.processStyles();updateNativeProperties(document.body,properties)},getComputedStyleValue(element,property){return getComputedStyleValue(element,property)},flushCustomStyles(){},nativeCss:nativeCssVariables,nativeShadow:nativeShadow,cssBuild:cssBuild,disableRuntime:disableRuntime}}window.ShadyCSS.CustomStyleInterface=customStyleInterface;const attr="include";const CustomStyleInterface$1=window.ShadyCSS.CustomStyleInterface;class CustomStyle extends HTMLElement{constructor(){super();this._style=null;CustomStyleInterface$1.addCustomStyle(this)}getStyle(){if(this._style){return this._style}const style=this.querySelector("style");if(!style){return null}this._style=style;const include=style.getAttribute(attr);if(include){style.removeAttribute(attr);style.textContent=cssFromModules(include)+style.textContent}if(this.ownerDocument!==window.document){window.document.head.appendChild(this)}return this._style}}window.customElements.define("custom-style",CustomStyle);let mutablePropertyChange$1;(()=>{mutablePropertyChange$1=MutableData._mutablePropertyChange})();const OptionalMutableDataBehavior={properties:{mutableData:Boolean},_shouldPropertyChange(property,value,old){return mutablePropertyChange$1(this,property,value,old,this.mutableData)}};const Base=LegacyElementMixin(HTMLElement).prototype;export{Base,Debouncer,DomIf,OptionalMutableDataBehavior,Polymer,PolymerElement,TemplateInstanceBase,Templatizer,afterNextRender,animationFrame,beforeNextRender,calculateSplices,dashToCamelCase,dom,enqueueDebouncer,flush,gestures$1 as gestures,html,idlePeriod,matches,microTask,templatize,translate,useShadow};
\ No newline at end of file +window.JSCompiler_renameProperty=function(prop,obj){return prop};let scheduled=false;let beforeRenderQueue=[];let afterRenderQueue=[];function schedule(){scheduled=true;requestAnimationFrame(function(){scheduled=false;flushQueue(beforeRenderQueue);setTimeout(function(){runQueue(afterRenderQueue)})})}function flushQueue(queue){while(queue.length){callMethod(queue.shift())}}function runQueue(queue){for(let i=0,l=queue.length;i<l;i++){callMethod(queue.shift())}}function callMethod(info){const context=info[0];const callback=info[1];const args=info[2];try{callback.apply(context,args)}catch(e){setTimeout(()=>{throw e})}}function beforeNextRender(context,callback,args){if(!scheduled){schedule()}beforeRenderQueue.push([context,callback,args])}function afterNextRender(context,callback,args){if(!scheduled){schedule()}afterRenderQueue.push([context,callback,args])}let microtaskCurrHandle=0;let microtaskLastHandle=0;let microtaskCallbacks=[];let microtaskNodeContent=0;let microtaskNode=document.createTextNode("");new window.MutationObserver(microtaskFlush).observe(microtaskNode,{characterData:true});function microtaskFlush(){const len=microtaskCallbacks.length;for(let i=0;i<len;i++){let cb=microtaskCallbacks[i];if(cb){try{cb()}catch(e){setTimeout(()=>{throw e})}}}microtaskCallbacks.splice(0,len);microtaskLastHandle+=len}const timeOut={after(delay){return{run(fn){return window.setTimeout(fn,delay)},cancel(handle){window.clearTimeout(handle)}}},run(fn,delay){return window.setTimeout(fn,delay)},cancel(handle){window.clearTimeout(handle)}};const animationFrame={run(fn){return window.requestAnimationFrame(fn)},cancel(handle){window.cancelAnimationFrame(handle)}};const idlePeriod={run(fn){return window.requestIdleCallback?window.requestIdleCallback(fn):window.setTimeout(fn,16)},cancel(handle){window.cancelIdleCallback?window.cancelIdleCallback(handle):window.clearTimeout(handle)}};const microTask={run(callback){microtaskNode.textContent=microtaskNodeContent++;microtaskCallbacks.push(callback);return microtaskCurrHandle++},cancel(handle){const idx=handle-microtaskLastHandle;if(idx>=0){if(!microtaskCallbacks[idx]){throw new Error("invalid async handle: "+handle)}microtaskCallbacks[idx]=null}}};let dedupeId=0;const dedupingMixin=function(mixin){let mixinApplications=mixin.__mixinApplications;if(!mixinApplications){mixinApplications=new WeakMap;mixin.__mixinApplications=mixinApplications}let mixinDedupeId=dedupeId++;function dedupingMixin(base){let baseSet=base.__mixinSet;if(baseSet&&baseSet[mixinDedupeId]){return base}let map=mixinApplications;let extended=map.get(base);if(!extended){extended=mixin(base);map.set(base,extended)}let mixinSet=Object.create(extended.__mixinSet||baseSet||null);mixinSet[mixinDedupeId]=true;extended.__mixinSet=mixinSet;return extended}return dedupingMixin};class Debouncer{constructor(){this._asyncModule=null;this._callback=null;this._timer=null}setConfig(asyncModule,callback){this._asyncModule=asyncModule;this._callback=callback;this._timer=this._asyncModule.run(()=>{this._timer=null;debouncerQueue.delete(this);this._callback()})}cancel(){if(this.isActive()){this._cancelAsync();debouncerQueue.delete(this)}}_cancelAsync(){if(this.isActive()){this._asyncModule.cancel(this._timer);this._timer=null}}flush(){if(this.isActive()){this.cancel();this._callback()}}isActive(){return this._timer!=null}static debounce(debouncer,asyncModule,callback){if(debouncer instanceof Debouncer){debouncer._cancelAsync()}else{debouncer=new Debouncer}debouncer.setConfig(asyncModule,callback);return debouncer}}let debouncerQueue=new Set;const enqueueDebouncer=function(debouncer){debouncerQueue.add(debouncer)};const flushDebouncers=function(){const didFlush=Boolean(debouncerQueue.size);debouncerQueue.forEach(debouncer=>{try{debouncer.flush()}catch(e){setTimeout(()=>{throw e})}});return didFlush};let CSS_URL_RX=/(url\()([^)]*)(\))/g;let ABS_URL=/(^\/)|(^#)|(^[\w-\d]*:)/;let workingURL;let resolveDoc;function resolveUrl(url,baseURI){if(url&&ABS_URL.test(url)){return url}if(workingURL===undefined){workingURL=false;try{const u=new URL("b","http://a");u.pathname="c%20d";workingURL=u.href==="http://a/c%20d"}catch(e){}}if(!baseURI){baseURI=document.baseURI||window.location.href}if(workingURL){return new URL(url,baseURI).href}if(!resolveDoc){resolveDoc=document.implementation.createHTMLDocument("temp");resolveDoc.base=resolveDoc.createElement("base");resolveDoc.head.appendChild(resolveDoc.base);resolveDoc.anchor=resolveDoc.createElement("a");resolveDoc.body.appendChild(resolveDoc.anchor)}resolveDoc.base.href=baseURI;resolveDoc.anchor.href=url;return resolveDoc.anchor.href||url}function resolveCss(cssText,baseURI){return cssText.replace(CSS_URL_RX,function(m,pre,url,post){return pre+"'"+resolveUrl(url.replace(/["']/g,""),baseURI)+"'"+post})}function pathFromUrl(url){return url.substring(0,url.lastIndexOf("/")+1)}const useShadow=!window.ShadyDOM;const useNativeCSSProperties=Boolean(!window.ShadyCSS||window.ShadyCSS.nativeCss);const useNativeCustomElements=!window.customElements.polyfillWrapFlushCallback;let rootPath=pathFromUrl(document.baseURI||window.location.href);let sanitizeDOMValue=window.Polymer&&window.Polymer.sanitizeDOMValue||undefined;let passiveTouchGestures=false;let strictTemplatePolicy=false;let allowTemplateFromDomModule=false;let legacyOptimizations=false;let syncInitialRender=false;const wrap=window["ShadyDOM"]&&window["ShadyDOM"]["noPatch"]&&window["ShadyDOM"]["wrap"]?window["ShadyDOM"]["wrap"]:n=>n;let HAS_NATIVE_TA=typeof document.head.style.touchAction==="string";let GESTURE_KEY="__polymerGestures";let HANDLED_OBJ="__polymerGesturesHandled";let TOUCH_ACTION="__polymerGesturesTouchAction";let TAP_DISTANCE=25;let TRACK_DISTANCE=5;let TRACK_LENGTH=2;let MOUSE_TIMEOUT=2500;let MOUSE_EVENTS=["mousedown","mousemove","mouseup","click"];let MOUSE_WHICH_TO_BUTTONS=[0,1,4,2];let MOUSE_HAS_BUTTONS=function(){try{return new MouseEvent("test",{buttons:1}).buttons===1}catch(e){return false}}();function isMouseEvent(name){return MOUSE_EVENTS.indexOf(name)>-1}let SUPPORTS_PASSIVE=false;(function(){try{let opts=Object.defineProperty({},"passive",{get(){SUPPORTS_PASSIVE=true}});window.addEventListener("test",null,opts);window.removeEventListener("test",null,opts)}catch(e){}})();function PASSIVE_TOUCH(eventName){if(isMouseEvent(eventName)||eventName==="touchend"){return}if(HAS_NATIVE_TA&&SUPPORTS_PASSIVE&&passiveTouchGestures){return{passive:true}}else{return}}let IS_TOUCH_ONLY=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/);const clickedLabels=[];const labellable={button:true,input:true,keygen:true,meter:true,output:true,textarea:true,progress:true,select:true};const canBeDisabled={button:true,command:true,fieldset:true,input:true,keygen:true,optgroup:true,option:true,select:true,textarea:true};function canBeLabelled(el){return labellable[el.localName]||false}function matchingLabels(el){let labels=Array.prototype.slice.call(el.labels||[]);if(!labels.length){labels=[];let root=el.getRootNode();if(el.id){let matching=root.querySelectorAll(`label[for = ${el.id}]`);for(let i=0;i<matching.length;i++){labels.push(matching[i])}}}return labels}let mouseCanceller=function(mouseEvent){let sc=mouseEvent.sourceCapabilities;if(sc&&!sc.firesTouchEvents){return}mouseEvent[HANDLED_OBJ]={skip:true};if(mouseEvent.type==="click"){let clickFromLabel=false;let path=getComposedPath(mouseEvent);for(let i=0;i<path.length;i++){if(path[i].nodeType===Node.ELEMENT_NODE){if(path[i].localName==="label"){clickedLabels.push(path[i])}else if(canBeLabelled(path[i])){let ownerLabels=matchingLabels(path[i]);for(let j=0;j<ownerLabels.length;j++){clickFromLabel=clickFromLabel||clickedLabels.indexOf(ownerLabels[j])>-1}}}if(path[i]===POINTERSTATE.mouse.target){return}}if(clickFromLabel){return}mouseEvent.preventDefault();mouseEvent.stopPropagation()}};function setupTeardownMouseCanceller(setup){let events=IS_TOUCH_ONLY?["click"]:MOUSE_EVENTS;for(let i=0,en;i<events.length;i++){en=events[i];if(setup){clickedLabels.length=0;document.addEventListener(en,mouseCanceller,true)}else{document.removeEventListener(en,mouseCanceller,true)}}}function ignoreMouse(e){if(!POINTERSTATE.mouse.mouseIgnoreJob){setupTeardownMouseCanceller(true)}let unset=function(){setupTeardownMouseCanceller();POINTERSTATE.mouse.target=null;POINTERSTATE.mouse.mouseIgnoreJob=null};POINTERSTATE.mouse.target=getComposedPath(e)[0];POINTERSTATE.mouse.mouseIgnoreJob=Debouncer.debounce(POINTERSTATE.mouse.mouseIgnoreJob,timeOut.after(MOUSE_TIMEOUT),unset)}function hasLeftMouseButton(ev){let type=ev.type;if(!isMouseEvent(type)){return false}if(type==="mousemove"){let buttons=ev.buttons===undefined?1:ev.buttons;if(ev instanceof window.MouseEvent&&!MOUSE_HAS_BUTTONS){buttons=MOUSE_WHICH_TO_BUTTONS[ev.which]||0}return Boolean(buttons&1)}else{let button=ev.button===undefined?0:ev.button;return button===0}}function isSyntheticClick(ev){if(ev.type==="click"){if(ev.detail===0){return true}let t=_findOriginalTarget(ev);if(!t.nodeType||t.nodeType!==Node.ELEMENT_NODE){return true}let bcr=t.getBoundingClientRect();let x=ev.pageX,y=ev.pageY;return!(x>=bcr.left&&x<=bcr.right&&(y>=bcr.top&&y<=bcr.bottom))}return false}let POINTERSTATE={mouse:{target:null,mouseIgnoreJob:null},touch:{x:0,y:0,id:-1,scrollDecided:false}};function firstTouchAction(ev){let ta="auto";let path=getComposedPath(ev);for(let i=0,n;i<path.length;i++){n=path[i];if(n[TOUCH_ACTION]){ta=n[TOUCH_ACTION];break}}return ta}function trackDocument(stateObj,movefn,upfn){stateObj.movefn=movefn;stateObj.upfn=upfn;document.addEventListener("mousemove",movefn);document.addEventListener("mouseup",upfn)}function untrackDocument(stateObj){document.removeEventListener("mousemove",stateObj.movefn);document.removeEventListener("mouseup",stateObj.upfn);stateObj.movefn=null;stateObj.upfn=null}document.addEventListener("touchend",ignoreMouse,SUPPORTS_PASSIVE?{passive:true}:false);const getComposedPath=window.ShadyDOM&&window.ShadyDOM.noPatch?window.ShadyDOM.composedPath:event=>event.composedPath&&event.composedPath()||[];const gestures={};const recognizers=[];function deepTargetFind(x,y){let node=document.elementFromPoint(x,y);let next=node;while(next&&next.shadowRoot&&!window.ShadyDOM){let oldNext=next;next=next.shadowRoot.elementFromPoint(x,y);if(oldNext===next){break}if(next){node=next}}return node}function _findOriginalTarget(ev){const path=getComposedPath(ev);return path.length>0?path[0]:ev.target}function _handleNative(ev){let handled;let type=ev.type;let node=ev.currentTarget;let gobj=node[GESTURE_KEY];if(!gobj){return}let gs=gobj[type];if(!gs){return}if(!ev[HANDLED_OBJ]){ev[HANDLED_OBJ]={};if(type.slice(0,5)==="touch"){ev=ev;let t=ev.changedTouches[0];if(type==="touchstart"){if(ev.touches.length===1){POINTERSTATE.touch.id=t.identifier}}if(POINTERSTATE.touch.id!==t.identifier){return}if(!HAS_NATIVE_TA){if(type==="touchstart"||type==="touchmove"){_handleTouchAction(ev)}}}}handled=ev[HANDLED_OBJ];if(handled.skip){return}for(let i=0,r;i<recognizers.length;i++){r=recognizers[i];if(gs[r.name]&&!handled[r.name]){if(r.flow&&r.flow.start.indexOf(ev.type)>-1&&r.reset){r.reset()}}}for(let i=0,r;i<recognizers.length;i++){r=recognizers[i];if(gs[r.name]&&!handled[r.name]){handled[r.name]=true;r[type](ev)}}}function _handleTouchAction(ev){let t=ev.changedTouches[0];let type=ev.type;if(type==="touchstart"){POINTERSTATE.touch.x=t.clientX;POINTERSTATE.touch.y=t.clientY;POINTERSTATE.touch.scrollDecided=false}else if(type==="touchmove"){if(POINTERSTATE.touch.scrollDecided){return}POINTERSTATE.touch.scrollDecided=true;let ta=firstTouchAction(ev);let shouldPrevent=false;let dx=Math.abs(POINTERSTATE.touch.x-t.clientX);let dy=Math.abs(POINTERSTATE.touch.y-t.clientY);if(!ev.cancelable);else if(ta==="none"){shouldPrevent=true}else if(ta==="pan-x"){shouldPrevent=dy>dx}else if(ta==="pan-y"){shouldPrevent=dx>dy}if(shouldPrevent){ev.preventDefault()}else{prevent("track")}}}function addListener(node,evType,handler){if(gestures[evType]){_add(node,evType,handler);return true}return false}function removeListener(node,evType,handler){if(gestures[evType]){_remove(node,evType,handler);return true}return false}function _add(node,evType,handler){let recognizer=gestures[evType];let deps=recognizer.deps;let name=recognizer.name;let gobj=node[GESTURE_KEY];if(!gobj){node[GESTURE_KEY]=gobj={}}for(let i=0,dep,gd;i<deps.length;i++){dep=deps[i];if(IS_TOUCH_ONLY&&isMouseEvent(dep)&&dep!=="click"){continue}gd=gobj[dep];if(!gd){gobj[dep]=gd={_count:0}}if(gd._count===0){node.addEventListener(dep,_handleNative,PASSIVE_TOUCH(dep))}gd[name]=(gd[name]||0)+1;gd._count=(gd._count||0)+1}node.addEventListener(evType,handler);if(recognizer.touchAction){setTouchAction(node,recognizer.touchAction)}}function _remove(node,evType,handler){let recognizer=gestures[evType];let deps=recognizer.deps;let name=recognizer.name;let gobj=node[GESTURE_KEY];if(gobj){for(let i=0,dep,gd;i<deps.length;i++){dep=deps[i];gd=gobj[dep];if(gd&&gd[name]){gd[name]=(gd[name]||1)-1;gd._count=(gd._count||1)-1;if(gd._count===0){node.removeEventListener(dep,_handleNative,PASSIVE_TOUCH(dep))}}}}node.removeEventListener(evType,handler)}function register(recog){recognizers.push(recog);for(let i=0;i<recog.emits.length;i++){gestures[recog.emits[i]]=recog}}function _findRecognizerByEvent(evName){for(let i=0,r;i<recognizers.length;i++){r=recognizers[i];for(let j=0,n;j<r.emits.length;j++){n=r.emits[j];if(n===evName){return r}}}return null}function setTouchAction(node,value){if(HAS_NATIVE_TA&&node instanceof HTMLElement){microTask.run(()=>{node.style.touchAction=value})}node[TOUCH_ACTION]=value}function _fire(target,type,detail){let ev=new Event(type,{bubbles:true,cancelable:true,composed:true});ev.detail=detail;wrap(target).dispatchEvent(ev);if(ev.defaultPrevented){let preventer=detail.preventer||detail.sourceEvent;if(preventer&&preventer.preventDefault){preventer.preventDefault()}}}function prevent(evName){let recognizer=_findRecognizerByEvent(evName);if(recognizer.info){recognizer.info.prevent=true}}function resetMouseCanceller(){if(POINTERSTATE.mouse.mouseIgnoreJob){POINTERSTATE.mouse.mouseIgnoreJob.flush()}}register({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset:function(){untrackDocument(this.info)},mousedown:function(e){if(!hasLeftMouseButton(e)){return}let t=_findOriginalTarget(e);let self=this;let movefn=function movefn(e){if(!hasLeftMouseButton(e)){downupFire("up",t,e);untrackDocument(self.info)}};let upfn=function upfn(e){if(hasLeftMouseButton(e)){downupFire("up",t,e)}untrackDocument(self.info)};trackDocument(this.info,movefn,upfn);downupFire("down",t,e)},touchstart:function(e){downupFire("down",_findOriginalTarget(e),e.changedTouches[0],e)},touchend:function(e){downupFire("up",_findOriginalTarget(e),e.changedTouches[0],e)}});function downupFire(type,target,event,preventer){if(!target){return}_fire(target,type,{x:event.clientX,y:event.clientY,sourceEvent:event,preventer:preventer,prevent:function(e){return prevent(e)}})}register({name:"track",touchAction:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start",started:false,moves:[],addMove:function(move){if(this.moves.length>TRACK_LENGTH){this.moves.shift()}this.moves.push(move)},movefn:null,upfn:null,prevent:false},reset:function(){this.info.state="start";this.info.started=false;this.info.moves=[];this.info.x=0;this.info.y=0;this.info.prevent=false;untrackDocument(this.info)},mousedown:function(e){if(!hasLeftMouseButton(e)){return}let t=_findOriginalTarget(e);let self=this;let movefn=function movefn(e){let x=e.clientX,y=e.clientY;if(trackHasMovedEnough(self.info,x,y)){self.info.state=self.info.started?e.type==="mouseup"?"end":"track":"start";if(self.info.state==="start"){prevent("tap")}self.info.addMove({x:x,y:y});if(!hasLeftMouseButton(e)){self.info.state="end";untrackDocument(self.info)}if(t){trackFire(self.info,t,e)}self.info.started=true}};let upfn=function upfn(e){if(self.info.started){movefn(e)}untrackDocument(self.info)};trackDocument(this.info,movefn,upfn);this.info.x=e.clientX;this.info.y=e.clientY},touchstart:function(e){let ct=e.changedTouches[0];this.info.x=ct.clientX;this.info.y=ct.clientY},touchmove:function(e){let t=_findOriginalTarget(e);let ct=e.changedTouches[0];let x=ct.clientX,y=ct.clientY;if(trackHasMovedEnough(this.info,x,y)){if(this.info.state==="start"){prevent("tap")}this.info.addMove({x:x,y:y});trackFire(this.info,t,ct);this.info.state="track";this.info.started=true}},touchend:function(e){let t=_findOriginalTarget(e);let ct=e.changedTouches[0];if(this.info.started){this.info.state="end";this.info.addMove({x:ct.clientX,y:ct.clientY});trackFire(this.info,t,ct)}}});function trackHasMovedEnough(info,x,y){if(info.prevent){return false}if(info.started){return true}let dx=Math.abs(info.x-x);let dy=Math.abs(info.y-y);return dx>=TRACK_DISTANCE||dy>=TRACK_DISTANCE}function trackFire(info,target,touch){if(!target){return}let secondlast=info.moves[info.moves.length-2];let lastmove=info.moves[info.moves.length-1];let dx=lastmove.x-info.x;let dy=lastmove.y-info.y;let ddx,ddy=0;if(secondlast){ddx=lastmove.x-secondlast.x;ddy=lastmove.y-secondlast.y}_fire(target,"track",{state:info.state,x:touch.clientX,y:touch.clientY,dx:dx,dy:dy,ddx:ddx,ddy:ddy,sourceEvent:touch,hover:function(){return deepTargetFind(touch.clientX,touch.clientY)}})}register({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:false},reset:function(){this.info.x=NaN;this.info.y=NaN;this.info.prevent=false},mousedown:function(e){if(hasLeftMouseButton(e)){this.info.x=e.clientX;this.info.y=e.clientY}},click:function(e){if(hasLeftMouseButton(e)){trackForward(this.info,e)}},touchstart:function(e){const touch=e.changedTouches[0];this.info.x=touch.clientX;this.info.y=touch.clientY},touchend:function(e){trackForward(this.info,e.changedTouches[0],e)}});function trackForward(info,e,preventer){let dx=Math.abs(e.clientX-info.x);let dy=Math.abs(e.clientY-info.y);let t=_findOriginalTarget(preventer||e);if(!t||canBeDisabled[t.localName]&&t.hasAttribute("disabled")){return}if(isNaN(dx)||isNaN(dy)||dx<=TAP_DISTANCE&&dy<=TAP_DISTANCE||isSyntheticClick(e)){if(!info.prevent){_fire(t,"tap",{x:e.clientX,y:e.clientY,sourceEvent:e,preventer:preventer})}}}const findOriginalTarget=_findOriginalTarget;const add=addListener;const remove=removeListener;var gestures$1=Object.freeze({gestures:gestures,recognizers:recognizers,deepTargetFind:deepTargetFind,addListener:addListener,removeListener:removeListener,register:register,setTouchAction:setTouchAction,prevent:prevent,resetMouseCanceller:resetMouseCanceller,findOriginalTarget:findOriginalTarget,add:add,remove:remove});const nativeShadow=!(window["ShadyDOM"]&&window["ShadyDOM"]["inUse"]);let nativeCssVariables_;function calcCssVariables(settings){if(settings&&settings["shimcssproperties"]){nativeCssVariables_=false}else{nativeCssVariables_=nativeShadow||Boolean(!navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)&&window.CSS&&CSS.supports&&CSS.supports("box-shadow","0 0 0 var(--foo)"))}}let cssBuild;if(window.ShadyCSS&&window.ShadyCSS.cssBuild!==undefined){cssBuild=window.ShadyCSS.cssBuild}const disableRuntime=Boolean(window.ShadyCSS&&window.ShadyCSS.disableRuntime);if(window.ShadyCSS&&window.ShadyCSS.nativeCss!==undefined){nativeCssVariables_=window.ShadyCSS.nativeCss}else if(window.ShadyCSS){calcCssVariables(window.ShadyCSS);window.ShadyCSS=undefined}else{calcCssVariables(window["WebComponents"]&&window["WebComponents"]["flags"])}const nativeCssVariables=nativeCssVariables_;class StyleNode{constructor(){this["start"]=0;this["end"]=0;this["previous"]=null;this["parent"]=null;this["rules"]=null;this["parsedCssText"]="";this["cssText"]="";this["atRule"]=false;this["type"]=0;this["keyframesName"]="";this["selector"]="";this["parsedSelector"]=""}}function parse(text){text=clean(text);return parseCss(lex(text),text)}function clean(cssText){return cssText.replace(RX.comments,"").replace(RX.port,"")}function lex(text){let root=new StyleNode;root["start"]=0;root["end"]=text.length;let n=root;for(let i=0,l=text.length;i<l;i++){if(text[i]===OPEN_BRACE){if(!n["rules"]){n["rules"]=[]}let p=n;let previous=p["rules"][p["rules"].length-1]||null;n=new StyleNode;n["start"]=i+1;n["parent"]=p;n["previous"]=previous;p["rules"].push(n)}else if(text[i]===CLOSE_BRACE){n["end"]=i+1;n=n["parent"]||root}}return root}function parseCss(node,text){let t=text.substring(node["start"],node["end"]-1);node["parsedCssText"]=node["cssText"]=t.trim();if(node["parent"]){let ss=node["previous"]?node["previous"]["end"]:node["parent"]["start"];t=text.substring(ss,node["start"]-1);t=_expandUnicodeEscapes(t);t=t.replace(RX.multipleSpaces," ");t=t.substring(t.lastIndexOf(";")+1);let s=node["parsedSelector"]=node["selector"]=t.trim();node["atRule"]=s.indexOf(AT_START)===0;if(node["atRule"]){if(s.indexOf(MEDIA_START)===0){node["type"]=types.MEDIA_RULE}else if(s.match(RX.keyframesRule)){node["type"]=types.KEYFRAMES_RULE;node["keyframesName"]=node["selector"].split(RX.multipleSpaces).pop()}}else{if(s.indexOf(VAR_START)===0){node["type"]=types.MIXIN_RULE}else{node["type"]=types.STYLE_RULE}}}let r$=node["rules"];if(r$){for(let i=0,l=r$.length,r;i<l&&(r=r$[i]);i++){parseCss(r,text)}}return node}function _expandUnicodeEscapes(s){return s.replace(/\\([0-9a-f]{1,6})\s/gi,function(){let code=arguments[1],repeat=6-code.length;while(repeat--){code="0"+code}return"\\"+code})}function stringify(node,preserveProperties,text=""){let cssText="";if(node["cssText"]||node["rules"]){let r$=node["rules"];if(r$&&!_hasMixinRules(r$)){for(let i=0,l=r$.length,r;i<l&&(r=r$[i]);i++){cssText=stringify(r,preserveProperties,cssText)}}else{cssText=preserveProperties?node["cssText"]:removeCustomProps(node["cssText"]);cssText=cssText.trim();if(cssText){cssText=" "+cssText+"\n"}}}if(cssText){if(node["selector"]){text+=node["selector"]+" "+OPEN_BRACE+"\n"}text+=cssText;if(node["selector"]){text+=CLOSE_BRACE+"\n\n"}}return text}function _hasMixinRules(rules){let r=rules[0];return Boolean(r)&&Boolean(r["selector"])&&r["selector"].indexOf(VAR_START)===0}function removeCustomProps(cssText){cssText=removeCustomPropAssignment(cssText);return removeCustomPropApply(cssText)}function removeCustomPropAssignment(cssText){return cssText.replace(RX.customProp,"").replace(RX.mixinProp,"")}function removeCustomPropApply(cssText){return cssText.replace(RX.mixinApply,"").replace(RX.varApply,"")}const types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3};const OPEN_BRACE="{";const CLOSE_BRACE="}";const RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g};const VAR_START="--";const MEDIA_START="@media";const AT_START="@";const VAR_ASSIGN=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi;const MIXIN_MATCH=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi;const MEDIA_MATCH=/@media\s(.*)/;const styleTextSet=new Set;const scopingAttribute="shady-unscoped";function processUnscopedStyle(style){const text=style.textContent;if(!styleTextSet.has(text)){styleTextSet.add(text);const newStyle=style.cloneNode(true);document.head.appendChild(newStyle)}}function isUnscopedStyle(style){return style.hasAttribute(scopingAttribute)}function toCssText(rules,callback){if(!rules){return""}if(typeof rules==="string"){rules=parse(rules)}if(callback){forEachRule(rules,callback)}return stringify(rules,nativeCssVariables)}function rulesForStyle(style){if(!style["__cssRules"]&&style.textContent){style["__cssRules"]=parse(style.textContent)}return style["__cssRules"]||null}function forEachRule(node,styleRuleCallback,keyframesRuleCallback,onlyActiveRules){if(!node){return}let skipRules=false;let type=node["type"];if(onlyActiveRules){if(type===types.MEDIA_RULE){let matchMedia=node["selector"].match(MEDIA_MATCH);if(matchMedia){if(!window.matchMedia(matchMedia[1]).matches){skipRules=true}}}}if(type===types.STYLE_RULE){styleRuleCallback(node)}else if(keyframesRuleCallback&&type===types.KEYFRAMES_RULE){keyframesRuleCallback(node)}else if(type===types.MIXIN_RULE){skipRules=true}let r$=node["rules"];if(r$&&!skipRules){for(let i=0,l=r$.length,r;i<l&&(r=r$[i]);i++){forEachRule(r,styleRuleCallback,keyframesRuleCallback,onlyActiveRules)}}}function findMatchingParen(text,start){let level=0;for(let i=start,l=text.length;i<l;i++){if(text[i]==="("){level++}else if(text[i]===")"){if(--level===0){return i}}}return-1}function processVariableAndFallback(str,callback){let start=str.indexOf("var(");if(start===-1){return callback(str,"","","")}let end=findMatchingParen(str,start+3);let inner=str.substring(start+4,end);let prefix=str.substring(0,start);let suffix=processVariableAndFallback(str.substring(end+1),callback);let comma=inner.indexOf(",");if(comma===-1){return callback(prefix,inner.trim(),"",suffix)}let value=inner.substring(0,comma).trim();let fallback=inner.substring(comma+1).trim();return callback(prefix,value,fallback,suffix)}const wrap$1=window["ShadyDOM"]&&window["ShadyDOM"]["wrap"]||(node=>node);function getIsExtends(element){let localName=element["localName"];let is="",typeExtension="";if(localName){if(localName.indexOf("-")>-1){is=localName}else{typeExtension=localName;is=element.getAttribute&&element.getAttribute("is")||""}}else{is=element.is;typeExtension=element.extends}return{is:is,typeExtension:typeExtension}}function gatherStyleText(element){const styleTextParts=[];const styles=element.querySelectorAll("style");for(let i=0;i<styles.length;i++){const style=styles[i];if(isUnscopedStyle(style)){if(!nativeShadow){processUnscopedStyle(style);style.parentNode.removeChild(style)}}else{styleTextParts.push(style.textContent);style.parentNode.removeChild(style)}}return styleTextParts.join("").trim()}const CSS_BUILD_ATTR="css-build";function getCssBuild(element){if(cssBuild!==undefined){return cssBuild}if(element.__cssBuild===undefined){const attrValue=element.getAttribute(CSS_BUILD_ATTR);if(attrValue){element.__cssBuild=attrValue}else{const buildComment=getBuildComment(element);if(buildComment!==""){removeBuildComment(element)}element.__cssBuild=buildComment}}return element.__cssBuild||""}function elementHasBuiltCss(element){return getCssBuild(element)!==""}function getBuildComment(element){const buildComment=element.localName==="template"?element.content.firstChild:element.firstChild;if(buildComment instanceof Comment){const commentParts=buildComment.textContent.trim().split(":");if(commentParts[0]===CSS_BUILD_ATTR){return commentParts[1]}}return""}function removeBuildComment(element){const buildComment=element.localName==="template"?element.content.firstChild:element.firstChild;buildComment.parentNode.removeChild(buildComment)}function updateNativeProperties(element,properties){for(let p in properties){if(p===null){element.style.removeProperty(p)}else{element.style.setProperty(p,properties[p])}}}function getComputedStyleValue(element,property){const value=window.getComputedStyle(element).getPropertyValue(property);if(!value){return""}else{return value.trim()}}function detectMixin(cssText){const has=MIXIN_MATCH.test(cssText)||VAR_ASSIGN.test(cssText);MIXIN_MATCH.lastIndex=0;VAR_ASSIGN.lastIndex=0;return has}const APPLY_NAME_CLEAN=/;\s*/m;const INITIAL_INHERIT=/^\s*(initial)|(inherit)\s*$/;const IMPORTANT=/\s*!important/;const MIXIN_VAR_SEP="_-_";class MixinMap{constructor(){this._map={}}set(name,props){name=name.trim();this._map[name]={properties:props,dependants:{}}}get(name){name=name.trim();return this._map[name]||null}}let invalidCallback=null;class ApplyShim{constructor(){this._currentElement=null;this._measureElement=null;this._map=new MixinMap}detectMixin(cssText){return detectMixin(cssText)}gatherStyles(template){const styleText=gatherStyleText(template.content);if(styleText){const style=document.createElement("style");style.textContent=styleText;template.content.insertBefore(style,template.content.firstChild);return style}return null}transformTemplate(template,elementName){if(template._gatheredStyle===undefined){template._gatheredStyle=this.gatherStyles(template)}const style=template._gatheredStyle;return style?this.transformStyle(style,elementName):null}transformStyle(style,elementName=""){let ast=rulesForStyle(style);this.transformRules(ast,elementName);style.textContent=toCssText(ast);return ast}transformCustomStyle(style){let ast=rulesForStyle(style);forEachRule(ast,rule=>{if(rule["selector"]===":root"){rule["selector"]="html"}this.transformRule(rule)});style.textContent=toCssText(ast);return ast}transformRules(rules,elementName){this._currentElement=elementName;forEachRule(rules,r=>{this.transformRule(r)});this._currentElement=null}transformRule(rule){rule["cssText"]=this.transformCssText(rule["parsedCssText"],rule);if(rule["selector"]===":root"){rule["selector"]=":host > *"}}transformCssText(cssText,rule){cssText=cssText.replace(VAR_ASSIGN,(matchText,propertyName,valueProperty,valueMixin)=>this._produceCssProperties(matchText,propertyName,valueProperty,valueMixin,rule));return this._consumeCssProperties(cssText,rule)}_getInitialValueForProperty(property){if(!this._measureElement){this._measureElement=document.createElement("meta");this._measureElement.setAttribute("apply-shim-measure","");this._measureElement.style.all="initial";document.head.appendChild(this._measureElement)}return window.getComputedStyle(this._measureElement).getPropertyValue(property)}_fallbacksFromPreviousRules(startRule){let topRule=startRule;while(topRule["parent"]){topRule=topRule["parent"]}const fallbacks={};let seenStartRule=false;forEachRule(topRule,r=>{seenStartRule=seenStartRule||r===startRule;if(seenStartRule){return}if(r["selector"]===startRule["selector"]){Object.assign(fallbacks,this._cssTextToMap(r["parsedCssText"]))}});return fallbacks}_consumeCssProperties(text,rule){let m=null;while(m=MIXIN_MATCH.exec(text)){let matchText=m[0];let mixinName=m[1];let idx=m.index;let applyPos=idx+matchText.indexOf("@apply");let afterApplyPos=idx+matchText.length;let textBeforeApply=text.slice(0,applyPos);let textAfterApply=text.slice(afterApplyPos);let defaults=rule?this._fallbacksFromPreviousRules(rule):{};Object.assign(defaults,this._cssTextToMap(textBeforeApply));let replacement=this._atApplyToCssProperties(mixinName,defaults);text=`${textBeforeApply}${replacement}${textAfterApply}`;MIXIN_MATCH.lastIndex=idx+replacement.length}return text}_atApplyToCssProperties(mixinName,fallbacks){mixinName=mixinName.replace(APPLY_NAME_CLEAN,"");let vars=[];let mixinEntry=this._map.get(mixinName);if(!mixinEntry){this._map.set(mixinName,{});mixinEntry=this._map.get(mixinName)}if(mixinEntry){if(this._currentElement){mixinEntry.dependants[this._currentElement]=true}let p,parts,f;const properties=mixinEntry.properties;for(p in properties){f=fallbacks&&fallbacks[p];parts=[p,": var(",mixinName,MIXIN_VAR_SEP,p];if(f){parts.push(",",f.replace(IMPORTANT,""))}parts.push(")");if(IMPORTANT.test(properties[p])){parts.push(" !important")}vars.push(parts.join(""))}}return vars.join("; ")}_replaceInitialOrInherit(property,value){let match=INITIAL_INHERIT.exec(value);if(match){if(match[1]){value=this._getInitialValueForProperty(property)}else{value="apply-shim-inherit"}}return value}_cssTextToMap(text,replaceInitialOrInherit=false){let props=text.split(";");let property,value;let out={};for(let i=0,p,sp;i<props.length;i++){p=props[i];if(p){sp=p.split(":");if(sp.length>1){property=sp[0].trim();value=sp.slice(1).join(":");if(replaceInitialOrInherit){value=this._replaceInitialOrInherit(property,value)}out[property]=value}}}return out}_invalidateMixinEntry(mixinEntry){if(!invalidCallback){return}for(let elementName in mixinEntry.dependants){if(elementName!==this._currentElement){invalidCallback(elementName)}}}_produceCssProperties(matchText,propertyName,valueProperty,valueMixin,rule){if(valueProperty){processVariableAndFallback(valueProperty,(prefix,value)=>{if(value&&this._map.get(value)){valueMixin=`@apply ${value};`}})}if(!valueMixin){return matchText}let mixinAsProperties=this._consumeCssProperties(""+valueMixin,rule);let prefix=matchText.slice(0,matchText.indexOf("--"));let mixinValues=this._cssTextToMap(mixinAsProperties,true);let combinedProps=mixinValues;let mixinEntry=this._map.get(propertyName);let oldProps=mixinEntry&&mixinEntry.properties;if(oldProps){combinedProps=Object.assign(Object.create(oldProps),mixinValues)}else{this._map.set(propertyName,combinedProps)}let out=[];let p,v;let needToInvalidate=false;for(p in combinedProps){v=mixinValues[p];if(v===undefined){v="initial"}if(oldProps&&!(p in oldProps)){needToInvalidate=true}out.push(`${propertyName}${MIXIN_VAR_SEP}${p}: ${v}`)}if(needToInvalidate){this._invalidateMixinEntry(mixinEntry)}if(mixinEntry){mixinEntry.properties=combinedProps}if(valueProperty){prefix=`${matchText};${prefix}`}return`${prefix}${out.join("; ")};`}}ApplyShim.prototype["detectMixin"]=ApplyShim.prototype.detectMixin;ApplyShim.prototype["transformStyle"]=ApplyShim.prototype.transformStyle;ApplyShim.prototype["transformCustomStyle"]=ApplyShim.prototype.transformCustomStyle;ApplyShim.prototype["transformRules"]=ApplyShim.prototype.transformRules;ApplyShim.prototype["transformRule"]=ApplyShim.prototype.transformRule;ApplyShim.prototype["transformTemplate"]=ApplyShim.prototype.transformTemplate;ApplyShim.prototype["_separator"]=MIXIN_VAR_SEP;Object.defineProperty(ApplyShim.prototype,"invalidCallback",{get(){return invalidCallback},set(cb){invalidCallback=cb}});const templateMap={};const CURRENT_VERSION="_applyShimCurrentVersion";const NEXT_VERSION="_applyShimNextVersion";const VALIDATING_VERSION="_applyShimValidatingVersion";const promise=Promise.resolve();function invalidate(elementName){let template=templateMap[elementName];if(template){invalidateTemplate(template)}}function invalidateTemplate(template){template[CURRENT_VERSION]=template[CURRENT_VERSION]||0;template[VALIDATING_VERSION]=template[VALIDATING_VERSION]||0;template[NEXT_VERSION]=(template[NEXT_VERSION]||0)+1}function templateIsValid(template){return template[CURRENT_VERSION]===template[NEXT_VERSION]}function templateIsValidating(template){return!templateIsValid(template)&&template[VALIDATING_VERSION]===template[NEXT_VERSION]}function startValidatingTemplate(template){template[VALIDATING_VERSION]=template[NEXT_VERSION];if(!template._validating){template._validating=true;promise.then(function(){template[CURRENT_VERSION]=template[NEXT_VERSION];template._validating=false})}}let readyPromise=null;let whenReady=window["HTMLImports"]&&window["HTMLImports"]["whenReady"]||null;let resolveFn;function documentWait(callback){requestAnimationFrame(function(){if(whenReady){whenReady(callback)}else{if(!readyPromise){readyPromise=new Promise(resolve=>{resolveFn=resolve});if(document.readyState==="complete"){resolveFn()}else{document.addEventListener("readystatechange",()=>{if(document.readyState==="complete"){resolveFn()}})}}readyPromise.then(function(){callback&&callback()})}})}const SEEN_MARKER="__seenByShadyCSS";const CACHED_STYLE="__shadyCSSCachedStyle";let transformFn=null;let validateFn=null;class CustomStyleInterface{constructor(){this["customStyles"]=[];this["enqueued"]=false;documentWait(()=>{if(window["ShadyCSS"]["flushCustomStyles"]){window["ShadyCSS"]["flushCustomStyles"]()}})}enqueueDocumentValidation(){if(this["enqueued"]||!validateFn){return}this["enqueued"]=true;documentWait(validateFn)}addCustomStyle(style){if(!style[SEEN_MARKER]){style[SEEN_MARKER]=true;this["customStyles"].push(style);this.enqueueDocumentValidation()}}getStyleForCustomStyle(customStyle){if(customStyle[CACHED_STYLE]){return customStyle[CACHED_STYLE]}let style;if(customStyle["getStyle"]){style=customStyle["getStyle"]()}else{style=customStyle}return style}processStyles(){const cs=this["customStyles"];for(let i=0;i<cs.length;i++){const customStyle=cs[i];if(customStyle[CACHED_STYLE]){continue}const style=this.getStyleForCustomStyle(customStyle);if(style){const styleToTransform=style["__appliedElement"]||style;if(transformFn){transformFn(styleToTransform)}customStyle[CACHED_STYLE]=styleToTransform}}return cs}}CustomStyleInterface.prototype["addCustomStyle"]=CustomStyleInterface.prototype.addCustomStyle;CustomStyleInterface.prototype["getStyleForCustomStyle"]=CustomStyleInterface.prototype.getStyleForCustomStyle;CustomStyleInterface.prototype["processStyles"]=CustomStyleInterface.prototype.processStyles;Object.defineProperties(CustomStyleInterface.prototype,{transformCallback:{get(){return transformFn},set(fn){transformFn=fn}},validateCallback:{get(){return validateFn},set(fn){let needsEnqueue=false;if(!validateFn){needsEnqueue=true}validateFn=fn;if(needsEnqueue){this.enqueueDocumentValidation()}}}});const applyShim=new ApplyShim;class ApplyShimInterface{constructor(){this.customStyleInterface=null;applyShim["invalidCallback"]=invalidate}ensure(){if(this.customStyleInterface){return}if(window.ShadyCSS.CustomStyleInterface){this.customStyleInterface=window.ShadyCSS.CustomStyleInterface;this.customStyleInterface["transformCallback"]=(style=>{applyShim.transformCustomStyle(style)});this.customStyleInterface["validateCallback"]=(()=>{requestAnimationFrame(()=>{if(this.customStyleInterface["enqueued"]){this.flushCustomStyles()}})})}}prepareTemplate(template,elementName){this.ensure();if(elementHasBuiltCss(template)){return}templateMap[elementName]=template;let ast=applyShim.transformTemplate(template,elementName);template["_styleAst"]=ast}flushCustomStyles(){this.ensure();if(!this.customStyleInterface){return}let styles=this.customStyleInterface["processStyles"]();if(!this.customStyleInterface["enqueued"]){return}for(let i=0;i<styles.length;i++){let cs=styles[i];let style=this.customStyleInterface["getStyleForCustomStyle"](cs);if(style){applyShim.transformCustomStyle(style)}}this.customStyleInterface["enqueued"]=false}styleSubtree(element,properties){this.ensure();if(properties){updateNativeProperties(element,properties)}if(element.shadowRoot){this.styleElement(element);let shadowChildren=element.shadowRoot.children||element.shadowRoot.childNodes;for(let i=0;i<shadowChildren.length;i++){this.styleSubtree(shadowChildren[i])}}else{let children=element.children||element.childNodes;for(let i=0;i<children.length;i++){this.styleSubtree(children[i])}}}styleElement(element){this.ensure();let{is:is}=getIsExtends(element);let template=templateMap[is];if(template&&elementHasBuiltCss(template)){return}if(template&&!templateIsValid(template)){if(!templateIsValidating(template)){this.prepareTemplate(template,is);startValidatingTemplate(template)}let root=element.shadowRoot;if(root){let style=root.querySelector("style");if(style){style["__cssRules"]=template["_styleAst"];style.textContent=toCssText(template["_styleAst"])}}}}styleDocument(properties){this.ensure();this.styleSubtree(document.body,properties)}}if(!window.ShadyCSS||!window.ShadyCSS.ScopingShim){const applyShimInterface=new ApplyShimInterface;let CustomStyleInterface=window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface;window.ShadyCSS={prepareTemplate(template,elementName,elementExtends){applyShimInterface.flushCustomStyles();applyShimInterface.prepareTemplate(template,elementName)},prepareTemplateStyles(template,elementName,elementExtends){window.ShadyCSS.prepareTemplate(template,elementName,elementExtends)},prepareTemplateDom(template,elementName){},styleSubtree(element,properties){applyShimInterface.flushCustomStyles();applyShimInterface.styleSubtree(element,properties)},styleElement(element){applyShimInterface.flushCustomStyles();applyShimInterface.styleElement(element)},styleDocument(properties){applyShimInterface.flushCustomStyles();applyShimInterface.styleDocument(properties)},getComputedStyleValue(element,property){return getComputedStyleValue(element,property)},flushCustomStyles(){applyShimInterface.flushCustomStyles()},nativeCss:nativeCssVariables,nativeShadow:nativeShadow,cssBuild:cssBuild,disableRuntime:disableRuntime};if(CustomStyleInterface){window.ShadyCSS.CustomStyleInterface=CustomStyleInterface}}window.ShadyCSS.ApplyShim=applyShim;let modules={};let lcModules={};function setModule(id,module){modules[id]=lcModules[id.toLowerCase()]=module}function findModule(id){return modules[id]||lcModules[id.toLowerCase()]}function styleOutsideTemplateCheck(inst){if(inst.querySelector("style")){console.warn("dom-module %s has style outside template",inst.id)}}class DomModule extends HTMLElement{static get observedAttributes(){return["id"]}static import(id,selector){if(id){let m=findModule(id);if(m&&selector){return m.querySelector(selector)}return m}return null}attributeChangedCallback(name,old,value,namespace){if(old!==value){this.register()}}get assetpath(){if(!this.__assetpath){const owner=window.HTMLImports&&HTMLImports.importForElement?HTMLImports.importForElement(this)||document:this.ownerDocument;const url=resolveUrl(this.getAttribute("assetpath")||"",owner.baseURI);this.__assetpath=pathFromUrl(url)}return this.__assetpath}register(id){id=id||this.id;if(id){if(strictTemplatePolicy&&findModule(id)!==undefined){setModule(id,null);throw new Error(`strictTemplatePolicy: dom-module ${id} re-registered`)}this.id=id;setModule(id,this);styleOutsideTemplateCheck(this)}}}DomModule.prototype["modules"]=modules;customElements.define("dom-module",DomModule);const MODULE_STYLE_LINK_SELECTOR="link[rel=import][type~=css]";const INCLUDE_ATTR="include";const SHADY_UNSCOPED_ATTR="shady-unscoped";function importModule(moduleId){return DomModule.import(moduleId)}function styleForImport(importDoc){let container=importDoc.body?importDoc.body:importDoc;const importCss=resolveCss(container.textContent,importDoc.baseURI);const style=document.createElement("style");style.textContent=importCss;return style}function stylesFromModules(moduleIds){const modules=moduleIds.trim().split(/\s+/);const styles=[];for(let i=0;i<modules.length;i++){styles.push(...stylesFromModule(modules[i]))}return styles}function stylesFromModule(moduleId){const m=importModule(moduleId);if(!m){console.warn("Could not find style data in module named",moduleId);return[]}if(m._styles===undefined){const styles=[];styles.push(..._stylesFromModuleImports(m));const template=m.querySelector("template");if(template){styles.push(...stylesFromTemplate(template,m.assetpath))}m._styles=styles}return m._styles}function stylesFromTemplate(template,baseURI){if(!template._styles){const styles=[];const e$=template.content.querySelectorAll("style");for(let i=0;i<e$.length;i++){let e=e$[i];let include=e.getAttribute(INCLUDE_ATTR);if(include){styles.push(...stylesFromModules(include).filter(function(item,index,self){return self.indexOf(item)===index}))}if(baseURI){e.textContent=resolveCss(e.textContent,baseURI)}styles.push(e)}template._styles=styles}return template._styles}function stylesFromModuleImports(moduleId){let m=importModule(moduleId);return m?_stylesFromModuleImports(m):[]}function _stylesFromModuleImports(module){const styles=[];const p$=module.querySelectorAll(MODULE_STYLE_LINK_SELECTOR);for(let i=0;i<p$.length;i++){let p=p$[i];if(p.import){const importDoc=p.import;const unscoped=p.hasAttribute(SHADY_UNSCOPED_ATTR);if(unscoped&&!importDoc._unscopedStyle){const style=styleForImport(importDoc);style.setAttribute(SHADY_UNSCOPED_ATTR,"");importDoc._unscopedStyle=style}else if(!importDoc._style){importDoc._style=styleForImport(importDoc)}styles.push(unscoped?importDoc._unscopedStyle:importDoc._style)}}return styles}function cssFromModules(moduleIds){let modules=moduleIds.trim().split(/\s+/);let cssText="";for(let i=0;i<modules.length;i++){cssText+=cssFromModule(modules[i])}return cssText}function cssFromModule(moduleId){let m=importModule(moduleId);if(m&&m._cssText===undefined){let cssText=_cssFromModuleImports(m);let t=m.querySelector("template");if(t){cssText+=cssFromTemplate(t,m.assetpath)}m._cssText=cssText||null}if(!m){console.warn("Could not find style data in module named",moduleId)}return m&&m._cssText||""}function cssFromTemplate(template,baseURI){let cssText="";const e$=stylesFromTemplate(template,baseURI);for(let i=0;i<e$.length;i++){let e=e$[i];if(e.parentNode){e.parentNode.removeChild(e)}cssText+=e.textContent}return cssText}function _cssFromModuleImports(module){let cssText="";let styles=_stylesFromModuleImports(module);for(let i=0;i<styles.length;i++){cssText+=styles[i].textContent}return cssText}function isPath(path){return path.indexOf(".")>=0}function root(path){let dotIndex=path.indexOf(".");if(dotIndex===-1){return path}return path.slice(0,dotIndex)}function isAncestor(base,path){return base.indexOf(path+".")===0}function isDescendant(base,path){return path.indexOf(base+".")===0}function translate(base,newBase,path){return newBase+path.slice(base.length)}function matches(base,path){return base===path||isAncestor(base,path)||isDescendant(base,path)}function normalize(path){if(Array.isArray(path)){let parts=[];for(let i=0;i<path.length;i++){let args=path[i].toString().split(".");for(let j=0;j<args.length;j++){parts.push(args[j])}}return parts.join(".")}else{return path}}function split(path){if(Array.isArray(path)){return normalize(path).split(".")}return path.toString().split(".")}function get(root,path,info){let prop=root;let parts=split(path);for(let i=0;i<parts.length;i++){if(!prop){return}let part=parts[i];prop=prop[part]}if(info){info.path=parts.join(".")}return prop}function set(root,path,value){let prop=root;let parts=split(path);let last=parts[parts.length-1];if(parts.length>1){for(let i=0;i<parts.length-1;i++){let part=parts[i];prop=prop[part];if(!prop){return}}prop[last]=value}else{prop[path]=value}return parts.join(".")}const caseMap={};const DASH_TO_CAMEL=/-[a-z]/g;const CAMEL_TO_DASH=/([A-Z])/g;function dashToCamelCase(dash){return caseMap[dash]||(caseMap[dash]=dash.indexOf("-")<0?dash:dash.replace(DASH_TO_CAMEL,m=>m[1].toUpperCase()))}function camelToDashCase(camel){return caseMap[camel]||(caseMap[camel]=camel.replace(CAMEL_TO_DASH,"-$1").toLowerCase())}const microtask=microTask;const PropertiesChanged=dedupingMixin(superClass=>{class PropertiesChanged extends superClass{static createProperties(props){const proto=this.prototype;for(let prop in props){if(!(prop in proto)){proto._createPropertyAccessor(prop)}}}static attributeNameForProperty(property){return property.toLowerCase()}static typeForProperty(name){}_createPropertyAccessor(property,readOnly){this._addPropertyToAttributeMap(property);if(!this.hasOwnProperty("__dataHasAccessor")){this.__dataHasAccessor=Object.assign({},this.__dataHasAccessor)}if(!this.__dataHasAccessor[property]){this.__dataHasAccessor[property]=true;this._definePropertyAccessor(property,readOnly)}}_addPropertyToAttributeMap(property){if(!this.hasOwnProperty("__dataAttributes")){this.__dataAttributes=Object.assign({},this.__dataAttributes)}if(!this.__dataAttributes[property]){const attr=this.constructor.attributeNameForProperty(property);this.__dataAttributes[attr]=property}}_definePropertyAccessor(property,readOnly){Object.defineProperty(this,property,{get(){return this._getProperty(property)},set:readOnly?function(){}:function(value){this._setProperty(property,value)}})}constructor(){super();this.__dataEnabled=false;this.__dataReady=false;this.__dataInvalid=false;this.__data={};this.__dataPending=null;this.__dataOld=null;this.__dataInstanceProps=null;this.__serializing=false;this._initializeProperties()}ready(){this.__dataReady=true;this._flushProperties()}_initializeProperties(){for(let p in this.__dataHasAccessor){if(this.hasOwnProperty(p)){this.__dataInstanceProps=this.__dataInstanceProps||{};this.__dataInstanceProps[p]=this[p];delete this[p]}}}_initializeInstanceProperties(props){Object.assign(this,props)}_setProperty(property,value){if(this._setPendingProperty(property,value)){this._invalidateProperties()}}_getProperty(property){return this.__data[property]}_setPendingProperty(property,value,ext){let old=this.__data[property];let changed=this._shouldPropertyChange(property,value,old);if(changed){if(!this.__dataPending){this.__dataPending={};this.__dataOld={}}if(this.__dataOld&&!(property in this.__dataOld)){this.__dataOld[property]=old}this.__data[property]=value;this.__dataPending[property]=value}return changed}_invalidateProperties(){if(!this.__dataInvalid&&this.__dataReady){this.__dataInvalid=true;microtask.run(()=>{if(this.__dataInvalid){this.__dataInvalid=false;this._flushProperties()}})}}_enableProperties(){if(!this.__dataEnabled){this.__dataEnabled=true;if(this.__dataInstanceProps){this._initializeInstanceProperties(this.__dataInstanceProps);this.__dataInstanceProps=null}this.ready()}}_flushProperties(){const props=this.__data;const changedProps=this.__dataPending;const old=this.__dataOld;if(this._shouldPropertiesChange(props,changedProps,old)){this.__dataPending=null;this.__dataOld=null;this._propertiesChanged(props,changedProps,old)}}_shouldPropertiesChange(currentProps,changedProps,oldProps){return Boolean(changedProps)}_propertiesChanged(currentProps,changedProps,oldProps){}_shouldPropertyChange(property,value,old){return old!==value&&(old===old||value===value)}attributeChangedCallback(name,old,value,namespace){if(old!==value){this._attributeToProperty(name,value)}if(super.attributeChangedCallback){super.attributeChangedCallback(name,old,value,namespace)}}_attributeToProperty(attribute,value,type){if(!this.__serializing){const map=this.__dataAttributes;const property=map&&map[attribute]||attribute;this[property]=this._deserializeValue(value,type||this.constructor.typeForProperty(property))}}_propertyToAttribute(property,attribute,value){this.__serializing=true;value=arguments.length<3?this[property]:value;this._valueToNodeAttribute(this,value,attribute||this.constructor.attributeNameForProperty(property));this.__serializing=false}_valueToNodeAttribute(node,value,attribute){const str=this._serializeValue(value);if(str===undefined){node.removeAttribute(attribute)}else{if(attribute==="class"||attribute==="name"||attribute==="slot"){node=wrap(node)}node.setAttribute(attribute,str)}}_serializeValue(value){switch(typeof value){case"boolean":return value?"":undefined;default:return value!=null?value.toString():undefined}}_deserializeValue(value,type){switch(type){case Boolean:return value!==null;case Number:return Number(value);default:return value}}}return PropertiesChanged});const nativeProperties={};let proto=HTMLElement.prototype;while(proto){let props=Object.getOwnPropertyNames(proto);for(let i=0;i<props.length;i++){nativeProperties[props[i]]=true}proto=Object.getPrototypeOf(proto)}function saveAccessorValue(model,property){if(!nativeProperties[property]){let value=model[property];if(value!==undefined){if(model.__data){model._setPendingProperty(property,value)}else{if(!model.__dataProto){model.__dataProto={}}else if(!model.hasOwnProperty(JSCompiler_renameProperty("__dataProto",model))){model.__dataProto=Object.create(model.__dataProto)}model.__dataProto[property]=value}}}}const PropertyAccessors=dedupingMixin(superClass=>{const base=PropertiesChanged(superClass);class PropertyAccessors extends base{static createPropertiesForAttributes(){let a$=this.observedAttributes;for(let i=0;i<a$.length;i++){this.prototype._createPropertyAccessor(dashToCamelCase(a$[i]))}}static attributeNameForProperty(property){return camelToDashCase(property)}_initializeProperties(){if(this.__dataProto){this._initializeProtoProperties(this.__dataProto);this.__dataProto=null}super._initializeProperties()}_initializeProtoProperties(props){for(let p in props){this._setProperty(p,props[p])}}_ensureAttribute(attribute,value){const el=this;if(!el.hasAttribute(attribute)){this._valueToNodeAttribute(el,value,attribute)}}_serializeValue(value){switch(typeof value){case"object":if(value instanceof Date){return value.toString()}else if(value){try{return JSON.stringify(value)}catch(x){return""}}default:return super._serializeValue(value)}}_deserializeValue(value,type){let outValue;switch(type){case Object:try{outValue=JSON.parse(value)}catch(x){outValue=value}break;case Array:try{outValue=JSON.parse(value)}catch(x){outValue=null;console.warn(`Polymer::Attributes: couldn't decode Array as JSON: ${value}`)}break;case Date:outValue=isNaN(value)?String(value):Number(value);outValue=new Date(outValue);break;default:outValue=super._deserializeValue(value,type);break}return outValue}_definePropertyAccessor(property,readOnly){saveAccessorValue(this,property);super._definePropertyAccessor(property,readOnly)}_hasAccessor(property){return this.__dataHasAccessor&&this.__dataHasAccessor[property]}_isPropertyPending(prop){return Boolean(this.__dataPending&&prop in this.__dataPending)}}return PropertyAccessors});const walker=document.createTreeWalker(document,NodeFilter.SHOW_ALL,null,false);const templateExtensions={"dom-if":true,"dom-repeat":true};function wrapTemplateExtension(node){let is=node.getAttribute("is");if(is&&templateExtensions[is]){let t=node;t.removeAttribute("is");node=t.ownerDocument.createElement(is);t.parentNode.replaceChild(node,t);node.appendChild(t);while(t.attributes.length){node.setAttribute(t.attributes[0].name,t.attributes[0].value);t.removeAttribute(t.attributes[0].name)}}return node}function findTemplateNode(root,nodeInfo){let parent=nodeInfo.parentInfo&&findTemplateNode(root,nodeInfo.parentInfo);if(parent){walker.currentNode=parent;for(let n=walker.firstChild(),i=0;n;n=walker.nextSibling()){if(nodeInfo.parentIndex===i++){return n}}}else{return root}}function applyIdToMap(inst,map,node,nodeInfo){if(nodeInfo.id){map[nodeInfo.id]=node}}function applyEventListener(inst,node,nodeInfo){if(nodeInfo.events&&nodeInfo.events.length){for(let j=0,e$=nodeInfo.events,e;j<e$.length&&(e=e$[j]);j++){inst._addMethodEventListenerToNode(node,e.name,e.value,inst)}}}function applyTemplateContent(inst,node,nodeInfo){if(nodeInfo.templateInfo){node._templateInfo=nodeInfo.templateInfo}}function createNodeEventHandler(context,eventName,methodName){context=context._methodHost||context;let handler=function(e){if(context[methodName]){context[methodName](e,e.detail)}else{console.warn("listener method `"+methodName+"` not defined")}};return handler}const TemplateStamp=dedupingMixin(superClass=>{class TemplateStamp extends superClass{static _parseTemplate(template,outerTemplateInfo){if(!template._templateInfo){let templateInfo=template._templateInfo={};templateInfo.nodeInfoList=[];templateInfo.stripWhiteSpace=true;this._parseTemplateContent(template,templateInfo,{parent:null})}return template._templateInfo}static _parseTemplateContent(template,templateInfo,nodeInfo){return this._parseTemplateNode(template.content,templateInfo,nodeInfo)}static _parseTemplateNode(node,templateInfo,nodeInfo){let noted;let element=node;if(element.localName=="template"&&!element.hasAttribute("preserve-content")){noted=this._parseTemplateNestedTemplate(element,templateInfo,nodeInfo)||noted}else if(element.localName==="slot"){templateInfo.hasInsertionPoint=true}walker.currentNode=element;if(walker.firstChild()){noted=this._parseTemplateChildNodes(element,templateInfo,nodeInfo)||noted}if(element.hasAttributes&&element.hasAttributes()){noted=this._parseTemplateNodeAttributes(element,templateInfo,nodeInfo)||noted}return noted}static _parseTemplateChildNodes(root,templateInfo,nodeInfo){if(root.localName==="script"||root.localName==="style"){return}walker.currentNode=root;for(let node=walker.firstChild(),parentIndex=0,next;node;node=next){if(node.localName=="template"){node=wrapTemplateExtension(node)}walker.currentNode=node;next=walker.nextSibling();if(node.nodeType===Node.TEXT_NODE){let n=next;while(n&&n.nodeType===Node.TEXT_NODE){node.textContent+=n.textContent;next=walker.nextSibling();root.removeChild(n);n=next}if(templateInfo.stripWhiteSpace&&!node.textContent.trim()){root.removeChild(node);continue}}let childInfo={parentIndex:parentIndex,parentInfo:nodeInfo};if(this._parseTemplateNode(node,templateInfo,childInfo)){childInfo.infoIndex=templateInfo.nodeInfoList.push(childInfo)-1}walker.currentNode=node;if(walker.parentNode()){parentIndex++}}}static _parseTemplateNestedTemplate(node,outerTemplateInfo,nodeInfo){let templateInfo=this._parseTemplate(node,outerTemplateInfo);let content=templateInfo.content=node.content.ownerDocument.createDocumentFragment();content.appendChild(node.content);nodeInfo.templateInfo=templateInfo;return true}static _parseTemplateNodeAttributes(node,templateInfo,nodeInfo){let noted=false;let attrs=Array.from(node.attributes);for(let i=attrs.length-1,a;a=attrs[i];i--){noted=this._parseTemplateNodeAttribute(node,templateInfo,nodeInfo,a.name,a.value)||noted}return noted}static _parseTemplateNodeAttribute(node,templateInfo,nodeInfo,name,value){if(name.slice(0,3)==="on-"){node.removeAttribute(name);nodeInfo.events=nodeInfo.events||[];nodeInfo.events.push({name:name.slice(3),value:value});return true}else if(name==="id"){nodeInfo.id=value;return true}return false}static _contentForTemplate(template){let templateInfo=template._templateInfo;return templateInfo&&templateInfo.content||template.content}_stampTemplate(template){if(template&&!template.content&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate){HTMLTemplateElement.decorate(template)}let templateInfo=this.constructor._parseTemplate(template);let nodeInfo=templateInfo.nodeInfoList;let content=templateInfo.content||template.content;let dom=document.importNode(content,true);dom.__noInsertionPoint=!templateInfo.hasInsertionPoint;let nodes=dom.nodeList=new Array(nodeInfo.length);dom.$={};for(let i=0,l=nodeInfo.length,info;i<l&&(info=nodeInfo[i]);i++){let node=nodes[i]=findTemplateNode(dom,info);applyIdToMap(this,dom.$,node,info);applyTemplateContent(this,node,info);applyEventListener(this,node,info)}dom=dom;return dom}_addMethodEventListenerToNode(node,eventName,methodName,context){context=context||node;let handler=createNodeEventHandler(context,eventName,methodName);this._addEventListenerToNode(node,eventName,handler);return handler}_addEventListenerToNode(node,eventName,handler){node.addEventListener(eventName,handler)}_removeEventListenerFromNode(node,eventName,handler){node.removeEventListener(eventName,handler)}}return TemplateStamp});let dedupeId$1=0;const TYPES={COMPUTE:"__computeEffects",REFLECT:"__reflectEffects",NOTIFY:"__notifyEffects",PROPAGATE:"__propagateEffects",OBSERVE:"__observeEffects",READ_ONLY:"__readOnly"};const capitalAttributeRegex=/[A-Z]/;function ensureOwnEffectMap(model,type){let effects=model[type];if(!effects){effects=model[type]={}}else if(!model.hasOwnProperty(type)){effects=model[type]=Object.create(model[type]);for(let p in effects){let protoFx=effects[p];let instFx=effects[p]=Array(protoFx.length);for(let i=0;i<protoFx.length;i++){instFx[i]=protoFx[i]}}}return effects}function runEffects(inst,effects,props,oldProps,hasPaths,extraArgs){if(effects){let ran=false;let id=dedupeId$1++;for(let prop in props){if(runEffectsForProperty(inst,effects,id,prop,props,oldProps,hasPaths,extraArgs)){ran=true}}return ran}return false}function runEffectsForProperty(inst,effects,dedupeId,prop,props,oldProps,hasPaths,extraArgs){let ran=false;let rootProperty=hasPaths?root(prop):prop;let fxs=effects[rootProperty];if(fxs){for(let i=0,l=fxs.length,fx;i<l&&(fx=fxs[i]);i++){if((!fx.info||fx.info.lastRun!==dedupeId)&&(!hasPaths||pathMatchesTrigger(prop,fx.trigger))){if(fx.info){fx.info.lastRun=dedupeId}fx.fn(inst,prop,props,oldProps,fx.info,hasPaths,extraArgs);ran=true}}}return ran}function pathMatchesTrigger(path,trigger){if(trigger){let triggerPath=trigger.name;return triggerPath==path||!!(trigger.structured&&isAncestor(triggerPath,path))||!!(trigger.wildcard&&isDescendant(triggerPath,path))}else{return true}}function runObserverEffect(inst,property,props,oldProps,info){let fn=typeof info.method==="string"?inst[info.method]:info.method;let changedProp=info.property;if(fn){fn.call(inst,inst.__data[changedProp],oldProps[changedProp])}else if(!info.dynamicFn){console.warn("observer method `"+info.method+"` not defined")}}function runNotifyEffects(inst,notifyProps,props,oldProps,hasPaths){let fxs=inst[TYPES.NOTIFY];let notified;let id=dedupeId$1++;for(let prop in notifyProps){if(notifyProps[prop]){if(fxs&&runEffectsForProperty(inst,fxs,id,prop,props,oldProps,hasPaths)){notified=true}else if(hasPaths&¬ifyPath(inst,prop,props)){notified=true}}}let host;if(notified&&(host=inst.__dataHost)&&host._invalidateProperties){host._invalidateProperties()}}function notifyPath(inst,path,props){let rootProperty=root(path);if(rootProperty!==path){let eventName=camelToDashCase(rootProperty)+"-changed";dispatchNotifyEvent(inst,eventName,props[path],path);return true}return false}function dispatchNotifyEvent(inst,eventName,value,path){let detail={value:value,queueProperty:true};if(path){detail.path=path}wrap(inst).dispatchEvent(new CustomEvent(eventName,{detail:detail}))}function runNotifyEffect(inst,property,props,oldProps,info,hasPaths){let rootProperty=hasPaths?root(property):property;let path=rootProperty!=property?property:null;let value=path?get(inst,path):inst.__data[property];if(path&&value===undefined){value=props[property]}dispatchNotifyEvent(inst,info.eventName,value,path)}function handleNotification(event,inst,fromProp,toPath,negate){let value;let detail=event.detail;let fromPath=detail&&detail.path;if(fromPath){toPath=translate(fromProp,toPath,fromPath);value=detail&&detail.value}else{value=event.currentTarget[fromProp]}value=negate?!value:value;if(!inst[TYPES.READ_ONLY]||!inst[TYPES.READ_ONLY][toPath]){if(inst._setPendingPropertyOrPath(toPath,value,true,Boolean(fromPath))&&(!detail||!detail.queueProperty)){inst._invalidateProperties()}}}function runReflectEffect(inst,property,props,oldProps,info){let value=inst.__data[property];if(sanitizeDOMValue){value=sanitizeDOMValue(value,info.attrName,"attribute",inst)}inst._propertyToAttribute(property,info.attrName,value)}function runComputedEffects(inst,changedProps,oldProps,hasPaths){let computeEffects=inst[TYPES.COMPUTE];if(computeEffects){let inputProps=changedProps;while(runEffects(inst,computeEffects,inputProps,oldProps,hasPaths)){Object.assign(oldProps,inst.__dataOld);Object.assign(changedProps,inst.__dataPending);inputProps=inst.__dataPending;inst.__dataPending=null}}}function runComputedEffect(inst,property,props,oldProps,info){let result=runMethodEffect(inst,property,props,oldProps,info);let computedProp=info.methodInfo;if(inst.__dataHasAccessor&&inst.__dataHasAccessor[computedProp]){inst._setPendingProperty(computedProp,result,true)}else{inst[computedProp]=result}}function computeLinkedPaths(inst,path,value){let links=inst.__dataLinkedPaths;if(links){let link;for(let a in links){let b=links[a];if(isDescendant(a,path)){link=translate(a,b,path);inst._setPendingPropertyOrPath(link,value,true,true)}else if(isDescendant(b,path)){link=translate(b,a,path);inst._setPendingPropertyOrPath(link,value,true,true)}}}}function addBinding(constructor,templateInfo,nodeInfo,kind,target,parts,literal){nodeInfo.bindings=nodeInfo.bindings||[];let binding={kind:kind,target:target,parts:parts,literal:literal,isCompound:parts.length!==1};nodeInfo.bindings.push(binding);if(shouldAddListener(binding)){let{event:event,negate:negate}=binding.parts[0];binding.listenerEvent=event||camelToDashCase(target)+"-changed";binding.listenerNegate=negate}let index=templateInfo.nodeInfoList.length;for(let i=0;i<binding.parts.length;i++){let part=binding.parts[i];part.compoundIndex=i;addEffectForBindingPart(constructor,templateInfo,binding,part,index)}}function addEffectForBindingPart(constructor,templateInfo,binding,part,index){if(!part.literal){if(binding.kind==="attribute"&&binding.target[0]==="-"){console.warn("Cannot set attribute "+binding.target+' because "-" is not a valid attribute starting character')}else{let dependencies=part.dependencies;let info={index:index,binding:binding,part:part,evaluator:constructor};for(let j=0;j<dependencies.length;j++){let trigger=dependencies[j];if(typeof trigger=="string"){trigger=parseArg(trigger);trigger.wildcard=true}constructor._addTemplatePropertyEffect(templateInfo,trigger.rootProperty,{fn:runBindingEffect,info:info,trigger:trigger})}}}}function runBindingEffect(inst,path,props,oldProps,info,hasPaths,nodeList){let node=nodeList[info.index];let binding=info.binding;let part=info.part;if(hasPaths&&part.source&&path.length>part.source.length&&binding.kind=="property"&&!binding.isCompound&&node.__isPropertyEffectsClient&&node.__dataHasAccessor&&node.__dataHasAccessor[binding.target]){let value=props[path];path=translate(part.source,binding.target,path);if(node._setPendingPropertyOrPath(path,value,false,true)){inst._enqueueClient(node)}}else{let value=info.evaluator._evaluateBinding(inst,part,path,props,oldProps,hasPaths);applyBindingValue(inst,node,binding,part,value)}}function applyBindingValue(inst,node,binding,part,value){value=computeBindingValue(node,value,binding,part);if(sanitizeDOMValue){value=sanitizeDOMValue(value,binding.target,binding.kind,node)}if(binding.kind=="attribute"){inst._valueToNodeAttribute(node,value,binding.target)}else{let prop=binding.target;if(node.__isPropertyEffectsClient&&node.__dataHasAccessor&&node.__dataHasAccessor[prop]){if(!node[TYPES.READ_ONLY]||!node[TYPES.READ_ONLY][prop]){if(node._setPendingProperty(prop,value)){inst._enqueueClient(node)}}}else{inst._setUnmanagedPropertyToNode(node,prop,value)}}}function computeBindingValue(node,value,binding,part){if(binding.isCompound){let storage=node.__dataCompoundStorage[binding.target];storage[part.compoundIndex]=value;value=storage.join("")}if(binding.kind!=="attribute"){if(binding.target==="textContent"||binding.target==="value"&&(node.localName==="input"||node.localName==="textarea")){value=value==undefined?"":value}}return value}function shouldAddListener(binding){return Boolean(binding.target)&&binding.kind!="attribute"&&binding.kind!="text"&&!binding.isCompound&&binding.parts[0].mode==="{"}function setupBindings(inst,templateInfo){let{nodeList:nodeList,nodeInfoList:nodeInfoList}=templateInfo;if(nodeInfoList.length){for(let i=0;i<nodeInfoList.length;i++){let info=nodeInfoList[i];let node=nodeList[i];let bindings=info.bindings;if(bindings){for(let i=0;i<bindings.length;i++){let binding=bindings[i];setupCompoundStorage(node,binding);addNotifyListener(node,inst,binding)}}node.__dataHost=inst}}}function setupCompoundStorage(node,binding){if(binding.isCompound){let storage=node.__dataCompoundStorage||(node.__dataCompoundStorage={});let parts=binding.parts;let literals=new Array(parts.length);for(let j=0;j<parts.length;j++){literals[j]=parts[j].literal}let target=binding.target;storage[target]=literals;if(binding.literal&&binding.kind=="property"){node[target]=binding.literal}}}function addNotifyListener(node,inst,binding){if(binding.listenerEvent){let part=binding.parts[0];node.addEventListener(binding.listenerEvent,function(e){handleNotification(e,inst,binding.target,part.source,part.negate)})}}function createMethodEffect(model,sig,type,effectFn,methodInfo,dynamicFn){dynamicFn=sig.static||dynamicFn&&(typeof dynamicFn!=="object"||dynamicFn[sig.methodName]);let info={methodName:sig.methodName,args:sig.args,methodInfo:methodInfo,dynamicFn:dynamicFn};for(let i=0,arg;i<sig.args.length&&(arg=sig.args[i]);i++){if(!arg.literal){model._addPropertyEffect(arg.rootProperty,type,{fn:effectFn,info:info,trigger:arg})}}if(dynamicFn){model._addPropertyEffect(sig.methodName,type,{fn:effectFn,info:info})}}function runMethodEffect(inst,property,props,oldProps,info){let context=inst._methodHost||inst;let fn=context[info.methodName];if(fn){let args=inst._marshalArgs(info.args,property,props);return fn.apply(context,args)}else if(!info.dynamicFn){console.warn("method `"+info.methodName+"` not defined")}}const emptyArray=[];const IDENT="(?:"+"[a-zA-Z_$][\\w.:$\\-*]*"+")";const NUMBER="(?:"+"[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?"+")";const SQUOTE_STRING="(?:"+"'(?:[^'\\\\]|\\\\.)*'"+")";const DQUOTE_STRING="(?:"+'"(?:[^"\\\\]|\\\\.)*"'+")";const STRING="(?:"+SQUOTE_STRING+"|"+DQUOTE_STRING+")";const ARGUMENT="(?:("+IDENT+"|"+NUMBER+"|"+STRING+")\\s*"+")";const ARGUMENTS="(?:"+ARGUMENT+"(?:,\\s*"+ARGUMENT+")*"+")";const ARGUMENT_LIST="(?:"+"\\(\\s*"+"(?:"+ARGUMENTS+"?"+")"+"\\)\\s*"+")";const BINDING="("+IDENT+"\\s*"+ARGUMENT_LIST+"?"+")";const OPEN_BRACKET="(\\[\\[|{{)"+"\\s*";const CLOSE_BRACKET="(?:]]|}})";const NEGATE="(?:(!)\\s*)?";const EXPRESSION=OPEN_BRACKET+NEGATE+BINDING+CLOSE_BRACKET;const bindingRegex=new RegExp(EXPRESSION,"g");function literalFromParts(parts){let s="";for(let i=0;i<parts.length;i++){let literal=parts[i].literal;s+=literal||""}return s}function parseMethod(expression){let m=expression.match(/([^\s]+?)\(([\s\S]*)\)/);if(m){let methodName=m[1];let sig={methodName:methodName,static:true,args:emptyArray};if(m[2].trim()){let args=m[2].replace(/\\,/g,",").split(",");return parseArgs(args,sig)}else{return sig}}return null}function parseArgs(argList,sig){sig.args=argList.map(function(rawArg){let arg=parseArg(rawArg);if(!arg.literal){sig.static=false}return arg},this);return sig}function parseArg(rawArg){let arg=rawArg.trim().replace(/,/g,",").replace(/\\(.)/g,"$1");let a={name:arg,value:"",literal:false};let fc=arg[0];if(fc==="-"){fc=arg[1]}if(fc>="0"&&fc<="9"){fc="#"}switch(fc){case"'":case'"':a.value=arg.slice(1,-1);a.literal=true;break;case"#":a.value=Number(arg);a.literal=true;break}if(!a.literal){a.rootProperty=root(arg);a.structured=isPath(arg);if(a.structured){a.wildcard=arg.slice(-2)==".*";if(a.wildcard){a.name=arg.slice(0,-2)}}}return a}function getArgValue(data,props,path){let value=get(data,path);if(value===undefined){value=props[path]}return value}function notifySplices(inst,array,path,splices){inst.notifyPath(path+".splices",{indexSplices:splices});inst.notifyPath(path+".length",array.length)}function notifySplice(inst,array,path,index,addedCount,removed){notifySplices(inst,array,path,[{index:index,addedCount:addedCount,removed:removed,object:array,type:"splice"}])}function upper(name){return name[0].toUpperCase()+name.substring(1)}const PropertyEffects=dedupingMixin(superClass=>{const propertyEffectsBase=TemplateStamp(PropertyAccessors(superClass));class PropertyEffects extends propertyEffectsBase{constructor(){super();this.__isPropertyEffectsClient=true;this.__dataCounter=0;this.__dataClientsReady;this.__dataPendingClients;this.__dataToNotify;this.__dataLinkedPaths;this.__dataHasPaths;this.__dataCompoundStorage;this.__dataHost;this.__dataTemp;this.__dataClientsInitialized;this.__data;this.__dataPending;this.__dataOld;this.__computeEffects;this.__reflectEffects;this.__notifyEffects;this.__propagateEffects;this.__observeEffects;this.__readOnly;this.__templateInfo}get PROPERTY_EFFECT_TYPES(){return TYPES}_initializeProperties(){super._initializeProperties();hostStack.registerHost(this);this.__dataClientsReady=false;this.__dataPendingClients=null;this.__dataToNotify=null;this.__dataLinkedPaths=null;this.__dataHasPaths=false;this.__dataCompoundStorage=this.__dataCompoundStorage||null;this.__dataHost=this.__dataHost||null;this.__dataTemp={};this.__dataClientsInitialized=false}_initializeProtoProperties(props){this.__data=Object.create(props);this.__dataPending=Object.create(props);this.__dataOld={}}_initializeInstanceProperties(props){let readOnly=this[TYPES.READ_ONLY];for(let prop in props){if(!readOnly||!readOnly[prop]){this.__dataPending=this.__dataPending||{};this.__dataOld=this.__dataOld||{};this.__data[prop]=this.__dataPending[prop]=props[prop]}}}_addPropertyEffect(property,type,effect){this._createPropertyAccessor(property,type==TYPES.READ_ONLY);let effects=ensureOwnEffectMap(this,type)[property];if(!effects){effects=this[type][property]=[]}effects.push(effect)}_removePropertyEffect(property,type,effect){let effects=ensureOwnEffectMap(this,type)[property];let idx=effects.indexOf(effect);if(idx>=0){effects.splice(idx,1)}}_hasPropertyEffect(property,type){let effects=this[type];return Boolean(effects&&effects[property])}_hasReadOnlyEffect(property){return this._hasPropertyEffect(property,TYPES.READ_ONLY)}_hasNotifyEffect(property){return this._hasPropertyEffect(property,TYPES.NOTIFY)}_hasReflectEffect(property){return this._hasPropertyEffect(property,TYPES.REFLECT)}_hasComputedEffect(property){return this._hasPropertyEffect(property,TYPES.COMPUTE)}_setPendingPropertyOrPath(path,value,shouldNotify,isPathNotification){if(isPathNotification||root(Array.isArray(path)?path[0]:path)!==path){if(!isPathNotification){let old=get(this,path);path=set(this,path,value);if(!path||!super._shouldPropertyChange(path,value,old)){return false}}this.__dataHasPaths=true;if(this._setPendingProperty(path,value,shouldNotify)){computeLinkedPaths(this,path,value);return true}}else{if(this.__dataHasAccessor&&this.__dataHasAccessor[path]){return this._setPendingProperty(path,value,shouldNotify)}else{this[path]=value}}return false}_setUnmanagedPropertyToNode(node,prop,value){if(value!==node[prop]||typeof value=="object"){node[prop]=value}}_setPendingProperty(property,value,shouldNotify){let propIsPath=this.__dataHasPaths&&isPath(property);let prevProps=propIsPath?this.__dataTemp:this.__data;if(this._shouldPropertyChange(property,value,prevProps[property])){if(!this.__dataPending){this.__dataPending={};this.__dataOld={}}if(!(property in this.__dataOld)){this.__dataOld[property]=this.__data[property]}if(propIsPath){this.__dataTemp[property]=value}else{this.__data[property]=value}this.__dataPending[property]=value;if(propIsPath||this[TYPES.NOTIFY]&&this[TYPES.NOTIFY][property]){this.__dataToNotify=this.__dataToNotify||{};this.__dataToNotify[property]=shouldNotify}return true}return false}_setProperty(property,value){if(this._setPendingProperty(property,value,true)){this._invalidateProperties()}}_invalidateProperties(){if(this.__dataReady){this._flushProperties()}}_enqueueClient(client){this.__dataPendingClients=this.__dataPendingClients||[];if(client!==this){this.__dataPendingClients.push(client)}}_flushProperties(){this.__dataCounter++;super._flushProperties();this.__dataCounter--}_flushClients(){if(!this.__dataClientsReady){this.__dataClientsReady=true;this._readyClients();this.__dataReady=true}else{this.__enableOrFlushClients()}}__enableOrFlushClients(){let clients=this.__dataPendingClients;if(clients){this.__dataPendingClients=null;for(let i=0;i<clients.length;i++){let client=clients[i];if(!client.__dataEnabled){client._enableProperties()}else if(client.__dataPending){client._flushProperties()}}}}_readyClients(){this.__enableOrFlushClients()}setProperties(props,setReadOnly){for(let path in props){if(setReadOnly||!this[TYPES.READ_ONLY]||!this[TYPES.READ_ONLY][path]){this._setPendingPropertyOrPath(path,props[path],true)}}this._invalidateProperties()}ready(){this._flushProperties();if(!this.__dataClientsReady){this._flushClients()}if(this.__dataPending){this._flushProperties()}}_propertiesChanged(currentProps,changedProps,oldProps){let hasPaths=this.__dataHasPaths;this.__dataHasPaths=false;runComputedEffects(this,changedProps,oldProps,hasPaths);let notifyProps=this.__dataToNotify;this.__dataToNotify=null;this._propagatePropertyChanges(changedProps,oldProps,hasPaths);this._flushClients();runEffects(this,this[TYPES.REFLECT],changedProps,oldProps,hasPaths);runEffects(this,this[TYPES.OBSERVE],changedProps,oldProps,hasPaths);if(notifyProps){runNotifyEffects(this,notifyProps,changedProps,oldProps,hasPaths)}if(this.__dataCounter==1){this.__dataTemp={}}}_propagatePropertyChanges(changedProps,oldProps,hasPaths){if(this[TYPES.PROPAGATE]){runEffects(this,this[TYPES.PROPAGATE],changedProps,oldProps,hasPaths)}let templateInfo=this.__templateInfo;while(templateInfo){runEffects(this,templateInfo.propertyEffects,changedProps,oldProps,hasPaths,templateInfo.nodeList);templateInfo=templateInfo.nextTemplateInfo}}linkPaths(to,from){to=normalize(to);from=normalize(from);this.__dataLinkedPaths=this.__dataLinkedPaths||{};this.__dataLinkedPaths[to]=from}unlinkPaths(path){path=normalize(path);if(this.__dataLinkedPaths){delete this.__dataLinkedPaths[path]}}notifySplices(path,splices){let info={path:""};let array=get(this,path,info);notifySplices(this,array,info.path,splices)}get(path,root){return get(root||this,path)}set(path,value,root){if(root){set(root,path,value)}else{if(!this[TYPES.READ_ONLY]||!this[TYPES.READ_ONLY][path]){if(this._setPendingPropertyOrPath(path,value,true)){this._invalidateProperties()}}}}push(path,...items){let info={path:""};let array=get(this,path,info);let len=array.length;let ret=array.push(...items);if(items.length){notifySplice(this,array,info.path,len,items.length,[])}return ret}pop(path){let info={path:""};let array=get(this,path,info);let hadLength=Boolean(array.length);let ret=array.pop();if(hadLength){notifySplice(this,array,info.path,array.length,0,[ret])}return ret}splice(path,start,deleteCount,...items){let info={path:""};let array=get(this,path,info);if(start<0){start=array.length-Math.floor(-start)}else if(start){start=Math.floor(start)}let ret;if(arguments.length===2){ret=array.splice(start)}else{ret=array.splice(start,deleteCount,...items)}if(items.length||ret.length){notifySplice(this,array,info.path,start,items.length,ret)}return ret}shift(path){let info={path:""};let array=get(this,path,info);let hadLength=Boolean(array.length);let ret=array.shift();if(hadLength){notifySplice(this,array,info.path,0,0,[ret])}return ret}unshift(path,...items){let info={path:""};let array=get(this,path,info);let ret=array.unshift(...items);if(items.length){notifySplice(this,array,info.path,0,items.length,[])}return ret}notifyPath(path,value){let propPath;if(arguments.length==1){let info={path:""};value=get(this,path,info);propPath=info.path}else if(Array.isArray(path)){propPath=normalize(path)}else{propPath=path}if(this._setPendingPropertyOrPath(propPath,value,true,true)){this._invalidateProperties()}}_createReadOnlyProperty(property,protectedSetter){this._addPropertyEffect(property,TYPES.READ_ONLY);if(protectedSetter){this["_set"+upper(property)]=function(value){this._setProperty(property,value)}}}_createPropertyObserver(property,method,dynamicFn){let info={property:property,method:method,dynamicFn:Boolean(dynamicFn)};this._addPropertyEffect(property,TYPES.OBSERVE,{fn:runObserverEffect,info:info,trigger:{name:property}});if(dynamicFn){this._addPropertyEffect(method,TYPES.OBSERVE,{fn:runObserverEffect,info:info,trigger:{name:method}})}}_createMethodObserver(expression,dynamicFn){let sig=parseMethod(expression);if(!sig){throw new Error("Malformed observer expression '"+expression+"'")}createMethodEffect(this,sig,TYPES.OBSERVE,runMethodEffect,null,dynamicFn)}_createNotifyingProperty(property){this._addPropertyEffect(property,TYPES.NOTIFY,{fn:runNotifyEffect,info:{eventName:camelToDashCase(property)+"-changed",property:property}})}_createReflectedProperty(property){let attr=this.constructor.attributeNameForProperty(property);if(attr[0]==="-"){console.warn("Property "+property+" cannot be reflected to attribute "+attr+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.')}else{this._addPropertyEffect(property,TYPES.REFLECT,{fn:runReflectEffect,info:{attrName:attr}})}}_createComputedProperty(property,expression,dynamicFn){let sig=parseMethod(expression);if(!sig){throw new Error("Malformed computed expression '"+expression+"'")}createMethodEffect(this,sig,TYPES.COMPUTE,runComputedEffect,property,dynamicFn)}_marshalArgs(args,path,props){const data=this.__data;const values=[];for(let i=0,l=args.length;i<l;i++){let{name:name,structured:structured,wildcard:wildcard,value:value,literal:literal}=args[i];if(!literal){if(wildcard){const matches=isDescendant(name,path);const pathValue=getArgValue(data,props,matches?path:name);value={path:matches?path:name,value:pathValue,base:matches?get(data,name):pathValue}}else{value=structured?getArgValue(data,props,name):data[name]}}values[i]=value}return values}static addPropertyEffect(property,type,effect){this.prototype._addPropertyEffect(property,type,effect)}static createPropertyObserver(property,method,dynamicFn){this.prototype._createPropertyObserver(property,method,dynamicFn)}static createMethodObserver(expression,dynamicFn){this.prototype._createMethodObserver(expression,dynamicFn)}static createNotifyingProperty(property){this.prototype._createNotifyingProperty(property)}static createReadOnlyProperty(property,protectedSetter){this.prototype._createReadOnlyProperty(property,protectedSetter)}static createReflectedProperty(property){this.prototype._createReflectedProperty(property)}static createComputedProperty(property,expression,dynamicFn){this.prototype._createComputedProperty(property,expression,dynamicFn)}static bindTemplate(template){return this.prototype._bindTemplate(template)}_bindTemplate(template,instanceBinding){let templateInfo=this.constructor._parseTemplate(template);let wasPreBound=this.__templateInfo==templateInfo;if(!wasPreBound){for(let prop in templateInfo.propertyEffects){this._createPropertyAccessor(prop)}}if(instanceBinding){templateInfo=Object.create(templateInfo);templateInfo.wasPreBound=wasPreBound;if(!wasPreBound&&this.__templateInfo){let last=this.__templateInfoLast||this.__templateInfo;this.__templateInfoLast=last.nextTemplateInfo=templateInfo;templateInfo.previousTemplateInfo=last;return templateInfo}}return this.__templateInfo=templateInfo}static _addTemplatePropertyEffect(templateInfo,prop,effect){let hostProps=templateInfo.hostProps=templateInfo.hostProps||{};hostProps[prop]=true;let effects=templateInfo.propertyEffects=templateInfo.propertyEffects||{};let propEffects=effects[prop]=effects[prop]||[];propEffects.push(effect)}_stampTemplate(template){hostStack.beginHosting(this);let dom=super._stampTemplate(template);hostStack.endHosting(this);let templateInfo=this._bindTemplate(template,true);templateInfo.nodeList=dom.nodeList;if(!templateInfo.wasPreBound){let nodes=templateInfo.childNodes=[];for(let n=dom.firstChild;n;n=n.nextSibling){nodes.push(n)}}dom.templateInfo=templateInfo;setupBindings(this,templateInfo);if(this.__dataReady){runEffects(this,templateInfo.propertyEffects,this.__data,null,false,templateInfo.nodeList)}return dom}_removeBoundDom(dom){let templateInfo=dom.templateInfo;if(templateInfo.previousTemplateInfo){templateInfo.previousTemplateInfo.nextTemplateInfo=templateInfo.nextTemplateInfo}if(templateInfo.nextTemplateInfo){templateInfo.nextTemplateInfo.previousTemplateInfo=templateInfo.previousTemplateInfo}if(this.__templateInfoLast==templateInfo){this.__templateInfoLast=templateInfo.previousTemplateInfo}templateInfo.previousTemplateInfo=templateInfo.nextTemplateInfo=null;let nodes=templateInfo.childNodes;for(let i=0;i<nodes.length;i++){let node=nodes[i];node.parentNode.removeChild(node)}}static _parseTemplateNode(node,templateInfo,nodeInfo){let noted=super._parseTemplateNode(node,templateInfo,nodeInfo);if(node.nodeType===Node.TEXT_NODE){let parts=this._parseBindings(node.textContent,templateInfo);if(parts){node.textContent=literalFromParts(parts)||" ";addBinding(this,templateInfo,nodeInfo,"text","textContent",parts);noted=true}}return noted}static _parseTemplateNodeAttribute(node,templateInfo,nodeInfo,name,value){let parts=this._parseBindings(value,templateInfo);if(parts){let origName=name;let kind="property";if(capitalAttributeRegex.test(name)){kind="attribute"}else if(name[name.length-1]=="$"){name=name.slice(0,-1);kind="attribute"}let literal=literalFromParts(parts);if(literal&&kind=="attribute"){if(name=="class"&&node.hasAttribute("class")){literal+=" "+node.getAttribute(name)}node.setAttribute(name,literal)}if(node.localName==="input"&&origName==="value"){node.setAttribute(origName,"")}node.removeAttribute(origName);if(kind==="property"){name=dashToCamelCase(name)}addBinding(this,templateInfo,nodeInfo,kind,name,parts,literal);return true}else{return super._parseTemplateNodeAttribute(node,templateInfo,nodeInfo,name,value)}}static _parseTemplateNestedTemplate(node,templateInfo,nodeInfo){let noted=super._parseTemplateNestedTemplate(node,templateInfo,nodeInfo);let hostProps=nodeInfo.templateInfo.hostProps;let mode="{";for(let source in hostProps){let parts=[{mode:mode,source:source,dependencies:[source]}];addBinding(this,templateInfo,nodeInfo,"property","_host_"+source,parts)}return noted}static _parseBindings(text,templateInfo){let parts=[];let lastIndex=0;let m;while((m=bindingRegex.exec(text))!==null){if(m.index>lastIndex){parts.push({literal:text.slice(lastIndex,m.index)})}let mode=m[1][0];let negate=Boolean(m[2]);let source=m[3].trim();let customEvent=false,notifyEvent="",colon=-1;if(mode=="{"&&(colon=source.indexOf("::"))>0){notifyEvent=source.substring(colon+2);source=source.substring(0,colon);customEvent=true}let signature=parseMethod(source);let dependencies=[];if(signature){let{args:args,methodName:methodName}=signature;for(let i=0;i<args.length;i++){let arg=args[i];if(!arg.literal){dependencies.push(arg)}}let dynamicFns=templateInfo.dynamicFns;if(dynamicFns&&dynamicFns[methodName]||signature.static){dependencies.push(methodName);signature.dynamicFn=true}}else{dependencies.push(source)}parts.push({source:source,mode:mode,negate:negate,customEvent:customEvent,signature:signature,dependencies:dependencies,event:notifyEvent});lastIndex=bindingRegex.lastIndex}if(lastIndex&&lastIndex<text.length){let literal=text.substring(lastIndex);if(literal){parts.push({literal:literal})}}if(parts.length){return parts}else{return null}}static _evaluateBinding(inst,part,path,props,oldProps,hasPaths){let value;if(part.signature){value=runMethodEffect(inst,path,props,oldProps,part.signature)}else if(path!=part.source){value=get(inst,part.source)}else{if(hasPaths&&isPath(path)){value=get(inst,path)}else{value=inst.__data[path]}}if(part.negate){value=!value}return value}}return PropertyEffects});class HostStack{constructor(){this.stack=[]}registerHost(inst){if(this.stack.length){let host=this.stack[this.stack.length-1];host._enqueueClient(inst)}}beginHosting(inst){this.stack.push(inst)}endHosting(inst){let stackLen=this.stack.length;if(stackLen&&this.stack[stackLen-1]==inst){this.stack.pop()}}}const hostStack=new HostStack;function register$1(prototype){}function normalizeProperties(props){const output={};for(let p in props){const o=props[p];output[p]=typeof o==="function"?{type:o}:o}return output}const PropertiesMixin=dedupingMixin(superClass=>{const base=PropertiesChanged(superClass);function superPropertiesClass(constructor){const superCtor=Object.getPrototypeOf(constructor);return superCtor.prototype instanceof PropertiesMixin?superCtor:null}function ownProperties(constructor){if(!constructor.hasOwnProperty(JSCompiler_renameProperty("__ownProperties",constructor))){let props=null;if(constructor.hasOwnProperty(JSCompiler_renameProperty("properties",constructor))){const properties=constructor.properties;if(properties){props=normalizeProperties(properties)}}constructor.__ownProperties=props}return constructor.__ownProperties}class PropertiesMixin extends base{static get observedAttributes(){if(!this.hasOwnProperty("__observedAttributes")){register$1(this.prototype);const props=this._properties;this.__observedAttributes=props?Object.keys(props).map(p=>this.attributeNameForProperty(p)):[]}return this.__observedAttributes}static finalize(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__finalized",this))){const superCtor=superPropertiesClass(this);if(superCtor){superCtor.finalize()}this.__finalized=true;this._finalizeClass()}}static _finalizeClass(){const props=ownProperties(this);if(props){this.createProperties(props)}}static get _properties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__properties",this))){const superCtor=superPropertiesClass(this);this.__properties=Object.assign({},superCtor&&superCtor._properties,ownProperties(this))}return this.__properties}static typeForProperty(name){const info=this._properties[name];return info&&info.type}_initializeProperties(){this.constructor.finalize();super._initializeProperties()}connectedCallback(){if(super.connectedCallback){super.connectedCallback()}this._enableProperties()}disconnectedCallback(){if(super.disconnectedCallback){super.disconnectedCallback()}}}return PropertiesMixin});const version="3.2.0";const builtCSS=window.ShadyCSS&&window.ShadyCSS["cssBuild"];const ElementMixin=dedupingMixin(base=>{const polymerElementBase=PropertiesMixin(PropertyEffects(base));function propertyDefaults(constructor){if(!constructor.hasOwnProperty(JSCompiler_renameProperty("__propertyDefaults",constructor))){constructor.__propertyDefaults=null;let props=constructor._properties;for(let p in props){let info=props[p];if("value"in info){constructor.__propertyDefaults=constructor.__propertyDefaults||{};constructor.__propertyDefaults[p]=info}}}return constructor.__propertyDefaults}function ownObservers(constructor){if(!constructor.hasOwnProperty(JSCompiler_renameProperty("__ownObservers",constructor))){constructor.__ownObservers=constructor.hasOwnProperty(JSCompiler_renameProperty("observers",constructor))?constructor.observers:null}return constructor.__ownObservers}function createPropertyFromConfig(proto,name,info,allProps){if(info.computed){info.readOnly=true}if(info.computed){if(proto._hasReadOnlyEffect(name)){console.warn(`Cannot redefine computed property '${name}'.`)}else{proto._createComputedProperty(name,info.computed,allProps)}}if(info.readOnly&&!proto._hasReadOnlyEffect(name)){proto._createReadOnlyProperty(name,!info.computed)}else if(info.readOnly===false&&proto._hasReadOnlyEffect(name)){console.warn(`Cannot make readOnly property '${name}' non-readOnly.`)}if(info.reflectToAttribute&&!proto._hasReflectEffect(name)){proto._createReflectedProperty(name)}else if(info.reflectToAttribute===false&&proto._hasReflectEffect(name)){console.warn(`Cannot make reflected property '${name}' non-reflected.`)}if(info.notify&&!proto._hasNotifyEffect(name)){proto._createNotifyingProperty(name)}else if(info.notify===false&&proto._hasNotifyEffect(name)){console.warn(`Cannot make notify property '${name}' non-notify.`)}if(info.observer){proto._createPropertyObserver(name,info.observer,allProps[info.observer])}proto._addPropertyToAttributeMap(name)}function processElementStyles(klass,template,is,baseURI){if(!builtCSS){const templateStyles=template.content.querySelectorAll("style");const stylesWithImports=stylesFromTemplate(template);const linkedStyles=stylesFromModuleImports(is);const firstTemplateChild=template.content.firstElementChild;for(let idx=0;idx<linkedStyles.length;idx++){let s=linkedStyles[idx];s.textContent=klass._processStyleText(s.textContent,baseURI);template.content.insertBefore(s,firstTemplateChild)}let templateStyleIndex=0;for(let i=0;i<stylesWithImports.length;i++){let s=stylesWithImports[i];let templateStyle=templateStyles[templateStyleIndex];if(templateStyle!==s){s=s.cloneNode(true);templateStyle.parentNode.insertBefore(s,templateStyle)}else{templateStyleIndex++}s.textContent=klass._processStyleText(s.textContent,baseURI)}}if(window.ShadyCSS){window.ShadyCSS.prepareTemplate(template,is)}}function getTemplateFromDomModule(is){let template=null;if(is&&(!strictTemplatePolicy||allowTemplateFromDomModule)){template=DomModule.import(is,"template");if(strictTemplatePolicy&&!template){throw new Error(`strictTemplatePolicy: expecting dom-module or null template for ${is}`)}}return template}class PolymerElement extends polymerElementBase{static get polymerElementVersion(){return version}static _finalizeClass(){super._finalizeClass();const observers=ownObservers(this);if(observers){this.createObservers(observers,this._properties)}this._prepareTemplate()}static _prepareTemplate(){let template=this.template;if(template){if(typeof template==="string"){console.error("template getter must return HTMLTemplateElement");template=null}else if(!legacyOptimizations){template=template.cloneNode(true)}}this.prototype._template=template}static createProperties(props){for(let p in props){createPropertyFromConfig(this.prototype,p,props[p],props)}}static createObservers(observers,dynamicFns){const proto=this.prototype;for(let i=0;i<observers.length;i++){proto._createMethodObserver(observers[i],dynamicFns)}}static get template(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_template",this))){this._template=this.prototype.hasOwnProperty(JSCompiler_renameProperty("_template",this.prototype))?this.prototype._template:getTemplateFromDomModule(this.is)||Object.getPrototypeOf(this.prototype).constructor.template}return this._template}static set template(value){this._template=value}static get importPath(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_importPath",this))){const meta=this.importMeta;if(meta){this._importPath=pathFromUrl(meta.url)}else{const module=DomModule.import(this.is);this._importPath=module&&module.assetpath||Object.getPrototypeOf(this.prototype).constructor.importPath}}return this._importPath}constructor(){super();this._template;this._importPath;this.rootPath;this.importPath;this.root;this.$}_initializeProperties(){this.constructor.finalize();this.constructor._finalizeTemplate(this.localName);super._initializeProperties();this.rootPath=rootPath;this.importPath=this.constructor.importPath;let p$=propertyDefaults(this.constructor);if(!p$){return}for(let p in p$){let info=p$[p];if(!this.hasOwnProperty(p)){let value=typeof info.value=="function"?info.value.call(this):info.value;if(this._hasAccessor(p)){this._setPendingProperty(p,value,true)}else{this[p]=value}}}}static _processStyleText(cssText,baseURI){return resolveCss(cssText,baseURI)}static _finalizeTemplate(is){const template=this.prototype._template;if(template&&!template.__polymerFinalized){template.__polymerFinalized=true;const importPath=this.importPath;const baseURI=importPath?resolveUrl(importPath):"";processElementStyles(this,template,is,baseURI);this.prototype._bindTemplate(template)}}connectedCallback(){if(window.ShadyCSS&&this._template){window.ShadyCSS.styleElement(this)}super.connectedCallback()}ready(){if(this._template){this.root=this._stampTemplate(this._template);this.$=this.root.$}super.ready()}_readyClients(){if(this._template){this.root=this._attachDom(this.root)}super._readyClients()}_attachDom(dom){const n=wrap(this);if(n.attachShadow){if(dom){if(!n.shadowRoot){n.attachShadow({mode:"open"})}n.shadowRoot.appendChild(dom);if(syncInitialRender&&window.ShadyDOM){ShadyDOM.flushInitial(n.shadowRoot)}return n.shadowRoot}return null}else{throw new Error("ShadowDOM not available. "+"PolymerElement can create dom as children instead of in "+"ShadowDOM by setting `this.root = this;` before `ready`.")}}updateStyles(properties){if(window.ShadyCSS){window.ShadyCSS.styleSubtree(this,properties)}}resolveUrl(url,base){if(!base&&this.importPath){base=resolveUrl(this.importPath)}return resolveUrl(url,base)}static _parseTemplateContent(template,templateInfo,nodeInfo){templateInfo.dynamicFns=templateInfo.dynamicFns||this._properties;return super._parseTemplateContent(template,templateInfo,nodeInfo)}static _addTemplatePropertyEffect(templateInfo,prop,effect){if(legacyOptimizations&&!(prop in this._properties)){console.warn(`Property '${prop}' used in template but not declared in 'properties'; `+`attribute will not be observed.`)}return super._addTemplatePropertyEffect(templateInfo,prop,effect)}}return PolymerElement});const GestureEventListeners=dedupingMixin(superClass=>{class GestureEventListeners extends superClass{_addEventListenerToNode(node,eventName,handler){if(!addListener(node,eventName,handler)){super._addEventListenerToNode(node,eventName,handler)}}_removeEventListenerFromNode(node,eventName,handler){if(!removeListener(node,eventName,handler)){super._removeEventListenerFromNode(node,eventName,handler)}}}return GestureEventListeners});function resolve(){document.body.removeAttribute("unresolved")}if(document.readyState==="interactive"||document.readyState==="complete"){resolve()}else{window.addEventListener("DOMContentLoaded",resolve)}function newSplice(index,removed,addedCount){return{index:index,removed:removed,addedCount:addedCount}}const EDIT_LEAVE=0;const EDIT_UPDATE=1;const EDIT_ADD=2;const EDIT_DELETE=3;function calcEditDistances(current,currentStart,currentEnd,old,oldStart,oldEnd){let rowCount=oldEnd-oldStart+1;let columnCount=currentEnd-currentStart+1;let distances=new Array(rowCount);for(let i=0;i<rowCount;i++){distances[i]=new Array(columnCount);distances[i][0]=i}for(let j=0;j<columnCount;j++)distances[0][j]=j;for(let i=1;i<rowCount;i++){for(let j=1;j<columnCount;j++){if(equals(current[currentStart+j-1],old[oldStart+i-1]))distances[i][j]=distances[i-1][j-1];else{let north=distances[i-1][j]+1;let west=distances[i][j-1]+1;distances[i][j]=north<west?north:west}}}return distances}function spliceOperationsFromEditDistances(distances){let i=distances.length-1;let j=distances[0].length-1;let current=distances[i][j];let edits=[];while(i>0||j>0){if(i==0){edits.push(EDIT_ADD);j--;continue}if(j==0){edits.push(EDIT_DELETE);i--;continue}let northWest=distances[i-1][j-1];let west=distances[i-1][j];let north=distances[i][j-1];let min;if(west<north)min=west<northWest?west:northWest;else min=north<northWest?north:northWest;if(min==northWest){if(northWest==current){edits.push(EDIT_LEAVE)}else{edits.push(EDIT_UPDATE);current=northWest}i--;j--}else if(min==west){edits.push(EDIT_DELETE);i--;current=west}else{edits.push(EDIT_ADD);j--;current=north}}edits.reverse();return edits}function calcSplices(current,currentStart,currentEnd,old,oldStart,oldEnd){let prefixCount=0;let suffixCount=0;let splice;let minLength=Math.min(currentEnd-currentStart,oldEnd-oldStart);if(currentStart==0&&oldStart==0)prefixCount=sharedPrefix(current,old,minLength);if(currentEnd==current.length&&oldEnd==old.length)suffixCount=sharedSuffix(current,old,minLength-prefixCount);currentStart+=prefixCount;oldStart+=prefixCount;currentEnd-=suffixCount;oldEnd-=suffixCount;if(currentEnd-currentStart==0&&oldEnd-oldStart==0)return[];if(currentStart==currentEnd){splice=newSplice(currentStart,[],0);while(oldStart<oldEnd)splice.removed.push(old[oldStart++]);return[splice]}else if(oldStart==oldEnd)return[newSplice(currentStart,[],currentEnd-currentStart)];let ops=spliceOperationsFromEditDistances(calcEditDistances(current,currentStart,currentEnd,old,oldStart,oldEnd));splice=undefined;let splices=[];let index=currentStart;let oldIndex=oldStart;for(let i=0;i<ops.length;i++){switch(ops[i]){case EDIT_LEAVE:if(splice){splices.push(splice);splice=undefined}index++;oldIndex++;break;case EDIT_UPDATE:if(!splice)splice=newSplice(index,[],0);splice.addedCount++;index++;splice.removed.push(old[oldIndex]);oldIndex++;break;case EDIT_ADD:if(!splice)splice=newSplice(index,[],0);splice.addedCount++;index++;break;case EDIT_DELETE:if(!splice)splice=newSplice(index,[],0);splice.removed.push(old[oldIndex]);oldIndex++;break}}if(splice){splices.push(splice)}return splices}function sharedPrefix(current,old,searchLength){for(let i=0;i<searchLength;i++)if(!equals(current[i],old[i]))return i;return searchLength}function sharedSuffix(current,old,searchLength){let index1=current.length;let index2=old.length;let count=0;while(count<searchLength&&equals(current[--index1],old[--index2]))count++;return count}function calculateSplices(current,previous){return calcSplices(current,0,current.length,previous,0,previous.length)}function equals(currentValue,previousValue){return currentValue===previousValue}function isSlot(node){return node.localName==="slot"}let FlattenedNodesObserver=class{static getFlattenedNodes(node){const wrapped=wrap(node);if(isSlot(node)){node=node;return wrapped.assignedNodes({flatten:true})}else{return Array.from(wrapped.childNodes).map(node=>{if(isSlot(node)){node=node;return wrap(node).assignedNodes({flatten:true})}else{return[node]}}).reduce((a,b)=>a.concat(b),[])}}constructor(target,callback){this._shadyChildrenObserver=null;this._nativeChildrenObserver=null;this._connected=false;this._target=target;this.callback=callback;this._effectiveNodes=[];this._observer=null;this._scheduled=false;this._boundSchedule=(()=>{this._schedule()});this.connect();this._schedule()}connect(){if(isSlot(this._target)){this._listenSlots([this._target])}else if(wrap(this._target).children){this._listenSlots(wrap(this._target).children);if(window.ShadyDOM){this._shadyChildrenObserver=ShadyDOM.observeChildren(this._target,mutations=>{this._processMutations(mutations)})}else{this._nativeChildrenObserver=new MutationObserver(mutations=>{this._processMutations(mutations)});this._nativeChildrenObserver.observe(this._target,{childList:true})}}this._connected=true}disconnect(){if(isSlot(this._target)){this._unlistenSlots([this._target])}else if(wrap(this._target).children){this._unlistenSlots(wrap(this._target).children);if(window.ShadyDOM&&this._shadyChildrenObserver){ShadyDOM.unobserveChildren(this._shadyChildrenObserver);this._shadyChildrenObserver=null}else if(this._nativeChildrenObserver){this._nativeChildrenObserver.disconnect();this._nativeChildrenObserver=null}}this._connected=false}_schedule(){if(!this._scheduled){this._scheduled=true;microTask.run(()=>this.flush())}}_processMutations(mutations){this._processSlotMutations(mutations);this.flush()}_processSlotMutations(mutations){if(mutations){for(let i=0;i<mutations.length;i++){let mutation=mutations[i];if(mutation.addedNodes){this._listenSlots(mutation.addedNodes)}if(mutation.removedNodes){this._unlistenSlots(mutation.removedNodes)}}}}flush(){if(!this._connected){return false}if(window.ShadyDOM){ShadyDOM.flush()}if(this._nativeChildrenObserver){this._processSlotMutations(this._nativeChildrenObserver.takeRecords())}else if(this._shadyChildrenObserver){this._processSlotMutations(this._shadyChildrenObserver.takeRecords())}this._scheduled=false;let info={target:this._target,addedNodes:[],removedNodes:[]};let newNodes=this.constructor.getFlattenedNodes(this._target);let splices=calculateSplices(newNodes,this._effectiveNodes);for(let i=0,s;i<splices.length&&(s=splices[i]);i++){for(let j=0,n;j<s.removed.length&&(n=s.removed[j]);j++){info.removedNodes.push(n)}}for(let i=0,s;i<splices.length&&(s=splices[i]);i++){for(let j=s.index;j<s.index+s.addedCount;j++){info.addedNodes.push(newNodes[j])}}this._effectiveNodes=newNodes;let didFlush=false;if(info.addedNodes.length||info.removedNodes.length){didFlush=true;this.callback.call(this._target,info)}return didFlush}_listenSlots(nodeList){for(let i=0;i<nodeList.length;i++){let n=nodeList[i];if(isSlot(n)){n.addEventListener("slotchange",this._boundSchedule)}}}_unlistenSlots(nodeList){for(let i=0;i<nodeList.length;i++){let n=nodeList[i];if(isSlot(n)){n.removeEventListener("slotchange",this._boundSchedule)}}}};const flush=function(){let shadyDOM,debouncers;do{shadyDOM=window.ShadyDOM&&ShadyDOM.flush();if(window.ShadyCSS&&window.ShadyCSS.ScopingShim){window.ShadyCSS.ScopingShim.flush()}debouncers=flushDebouncers()}while(shadyDOM||debouncers)};const p=Element.prototype;const normalizedMatchesSelector=p.matches||p.matchesSelector||p.mozMatchesSelector||p.msMatchesSelector||p.oMatchesSelector||p.webkitMatchesSelector;const matchesSelector=function(node,selector){return normalizedMatchesSelector.call(node,selector)};class DomApiNative{constructor(node){this.node=node}observeNodes(callback){return new FlattenedNodesObserver(this.node,callback)}unobserveNodes(observerHandle){observerHandle.disconnect()}notifyObserver(){}deepContains(node){if(wrap(this.node).contains(node)){return true}let n=node;let doc=node.ownerDocument;while(n&&n!==doc&&n!==this.node){n=wrap(n).parentNode||wrap(n).host}return n===this.node}getOwnerRoot(){return wrap(this.node).getRootNode()}getDistributedNodes(){return this.node.localName==="slot"?wrap(this.node).assignedNodes({flatten:true}):[]}getDestinationInsertionPoints(){let ip$=[];let n=wrap(this.node).assignedSlot;while(n){ip$.push(n);n=wrap(n).assignedSlot}return ip$}importNode(node,deep){let doc=this.node instanceof Document?this.node:this.node.ownerDocument;return wrap(doc).importNode(node,deep)}getEffectiveChildNodes(){return FlattenedNodesObserver.getFlattenedNodes(this.node)}queryDistributedElements(selector){let c$=this.getEffectiveChildNodes();let list=[];for(let i=0,l=c$.length,c;i<l&&(c=c$[i]);i++){if(c.nodeType===Node.ELEMENT_NODE&&matchesSelector(c,selector)){list.push(c)}}return list}get activeElement(){let node=this.node;return node._activeElement!==undefined?node._activeElement:node.activeElement}}function forwardMethods(proto,methods){for(let i=0;i<methods.length;i++){let method=methods[i];proto[method]=function(){return this.node[method].apply(this.node,arguments)}}}function forwardReadOnlyProperties(proto,properties){for(let i=0;i<properties.length;i++){let name=properties[i];Object.defineProperty(proto,name,{get:function(){const domApi=this;return domApi.node[name]},configurable:true})}}function forwardProperties(proto,properties){for(let i=0;i<properties.length;i++){let name=properties[i];Object.defineProperty(proto,name,{get:function(){return this.node[name]},set:function(value){this.node[name]=value},configurable:true})}}class EventApi{constructor(event){this.event=event}get rootTarget(){return this.path[0]}get localTarget(){return this.event.target}get path(){return this.event.composedPath()}}DomApiNative.prototype.cloneNode;DomApiNative.prototype.appendChild;DomApiNative.prototype.insertBefore;DomApiNative.prototype.removeChild;DomApiNative.prototype.replaceChild;DomApiNative.prototype.setAttribute;DomApiNative.prototype.removeAttribute;DomApiNative.prototype.querySelector;DomApiNative.prototype.querySelectorAll;DomApiNative.prototype.parentNode;DomApiNative.prototype.firstChild;DomApiNative.prototype.lastChild;DomApiNative.prototype.nextSibling;DomApiNative.prototype.previousSibling;DomApiNative.prototype.firstElementChild;DomApiNative.prototype.lastElementChild;DomApiNative.prototype.nextElementSibling;DomApiNative.prototype.previousElementSibling;DomApiNative.prototype.childNodes;DomApiNative.prototype.children;DomApiNative.prototype.classList;DomApiNative.prototype.textContent;DomApiNative.prototype.innerHTML;let DomApiImpl=DomApiNative;if(window["ShadyDOM"]&&window["ShadyDOM"]["inUse"]&&window["ShadyDOM"]["noPatch"]&&window["ShadyDOM"]["Wrapper"]){class Wrapper extends window["ShadyDOM"]["Wrapper"]{}Object.getOwnPropertyNames(DomApiNative.prototype).forEach(prop=>{if(prop!="activeElement"){Wrapper.prototype[prop]=DomApiNative.prototype[prop]}});forwardReadOnlyProperties(Wrapper.prototype,["classList"]);DomApiImpl=Wrapper;Object.defineProperties(EventApi.prototype,{localTarget:{get(){return this.event.currentTarget},configurable:true},path:{get(){return window["ShadyDOM"]["composedPath"](this.event)},configurable:true}})}else{forwardMethods(DomApiNative.prototype,["cloneNode","appendChild","insertBefore","removeChild","replaceChild","setAttribute","removeAttribute","querySelector","querySelectorAll"]);forwardReadOnlyProperties(DomApiNative.prototype,["parentNode","firstChild","lastChild","nextSibling","previousSibling","firstElementChild","lastElementChild","nextElementSibling","previousElementSibling","childNodes","children","classList"]);forwardProperties(DomApiNative.prototype,["textContent","innerHTML"])}const dom=function(obj){obj=obj||document;if(obj instanceof DomApiImpl){return obj}if(obj instanceof EventApi){return obj}let helper=obj["__domApi"];if(!helper){if(obj instanceof Event){helper=new EventApi(obj)}else{helper=new DomApiImpl(obj)}obj["__domApi"]=helper}return helper};let styleInterface=window.ShadyCSS;const LegacyElementMixin=dedupingMixin(base=>{const legacyElementBase=GestureEventListeners(ElementMixin(base));const DIRECTION_MAP={x:"pan-x",y:"pan-y",none:"none",all:"auto"};class LegacyElement extends legacyElementBase{constructor(){super();this.isAttached;this.__boundListeners;this._debouncers}static get importMeta(){return this.prototype.importMeta}created(){}connectedCallback(){super.connectedCallback();this.isAttached=true;this.attached()}attached(){}disconnectedCallback(){super.disconnectedCallback();this.isAttached=false;this.detached()}detached(){}attributeChangedCallback(name,old,value,namespace){if(old!==value){super.attributeChangedCallback(name,old,value,namespace);this.attributeChanged(name,old,value)}}attributeChanged(name,old,value){}_initializeProperties(){let proto=Object.getPrototypeOf(this);if(!proto.hasOwnProperty("__hasRegisterFinished")){this._registered();proto.__hasRegisterFinished=true}super._initializeProperties();this.root=this;this.created();this._applyListeners()}_registered(){}ready(){this._ensureAttributes();super.ready()}_ensureAttributes(){}_applyListeners(){}serialize(value){return this._serializeValue(value)}deserialize(value,type){return this._deserializeValue(value,type)}reflectPropertyToAttribute(property,attribute,value){this._propertyToAttribute(property,attribute,value)}serializeValueToAttribute(value,attribute,node){this._valueToNodeAttribute(node||this,value,attribute)}extend(prototype,api){if(!(prototype&&api)){return prototype||api}let n$=Object.getOwnPropertyNames(api);for(let i=0,n;i<n$.length&&(n=n$[i]);i++){let pd=Object.getOwnPropertyDescriptor(api,n);if(pd){Object.defineProperty(prototype,n,pd)}}return prototype}mixin(target,source){for(let i in source){target[i]=source[i]}return target}chainObject(object,prototype){if(object&&prototype&&object!==prototype){object.__proto__=prototype}return object}instanceTemplate(template){let content=this.constructor._contentForTemplate(template);let dom=document.importNode(content,true);return dom}fire(type,detail,options){options=options||{};detail=detail===null||detail===undefined?{}:detail;let event=new Event(type,{bubbles:options.bubbles===undefined?true:options.bubbles,cancelable:Boolean(options.cancelable),composed:options.composed===undefined?true:options.composed});event.detail=detail;let node=options.node||this;wrap(node).dispatchEvent(event);return event}listen(node,eventName,methodName){node=node||this;let hbl=this.__boundListeners||(this.__boundListeners=new WeakMap);let bl=hbl.get(node);if(!bl){bl={};hbl.set(node,bl)}let key=eventName+methodName;if(!bl[key]){bl[key]=this._addMethodEventListenerToNode(node,eventName,methodName,this)}}unlisten(node,eventName,methodName){node=node||this;let bl=this.__boundListeners&&this.__boundListeners.get(node);let key=eventName+methodName;let handler=bl&&bl[key];if(handler){this._removeEventListenerFromNode(node,eventName,handler);bl[key]=null}}setScrollDirection(direction,node){setTouchAction(node||this,DIRECTION_MAP[direction]||"auto")}$$(slctr){return this.root.querySelector(slctr)}get domHost(){let root=wrap(this).getRootNode();return root instanceof DocumentFragment?root.host:root}distributeContent(){const thisEl=this;const domApi=dom(thisEl);if(window.ShadyDOM&&domApi.shadowRoot){ShadyDOM.flush()}}getEffectiveChildNodes(){const thisEl=this;const domApi=dom(thisEl);return domApi.getEffectiveChildNodes()}queryDistributedElements(selector){const thisEl=this;const domApi=dom(thisEl);return domApi.queryDistributedElements(selector)}getEffectiveChildren(){let list=this.getEffectiveChildNodes();return list.filter(function(n){return n.nodeType===Node.ELEMENT_NODE})}getEffectiveTextContent(){let cn=this.getEffectiveChildNodes();let tc=[];for(let i=0,c;c=cn[i];i++){if(c.nodeType!==Node.COMMENT_NODE){tc.push(c.textContent)}}return tc.join("")}queryEffectiveChildren(selector){let e$=this.queryDistributedElements(selector);return e$&&e$[0]}queryAllEffectiveChildren(selector){return this.queryDistributedElements(selector)}getContentChildNodes(slctr){let content=this.root.querySelector(slctr||"slot");return content?dom(content).getDistributedNodes():[]}getContentChildren(slctr){let children=this.getContentChildNodes(slctr).filter(function(n){return n.nodeType===Node.ELEMENT_NODE});return children}isLightDescendant(node){const thisNode=this;return thisNode!==node&&wrap(thisNode).contains(node)&&wrap(thisNode).getRootNode()===wrap(node).getRootNode()}isLocalDescendant(node){return this.root===wrap(node).getRootNode()}scopeSubtree(container,shouldObserve){}getComputedStyleValue(property){return styleInterface.getComputedStyleValue(this,property)}debounce(jobName,callback,wait){this._debouncers=this._debouncers||{};return this._debouncers[jobName]=Debouncer.debounce(this._debouncers[jobName],wait>0?timeOut.after(wait):microTask,callback.bind(this))}isDebouncerActive(jobName){this._debouncers=this._debouncers||{};let debouncer=this._debouncers[jobName];return!!(debouncer&&debouncer.isActive())}flushDebouncer(jobName){this._debouncers=this._debouncers||{};let debouncer=this._debouncers[jobName];if(debouncer){debouncer.flush()}}cancelDebouncer(jobName){this._debouncers=this._debouncers||{};let debouncer=this._debouncers[jobName];if(debouncer){debouncer.cancel()}}async(callback,waitTime){return waitTime>0?timeOut.run(callback.bind(this),waitTime):~microTask.run(callback.bind(this))}cancelAsync(handle){handle<0?microTask.cancel(~handle):timeOut.cancel(handle)}create(tag,props){let elt=document.createElement(tag);if(props){if(elt.setProperties){elt.setProperties(props)}else{for(let n in props){elt[n]=props[n]}}}return elt}elementMatches(selector,node){return matchesSelector(node||this,selector)}toggleAttribute(name,bool){let node=this;if(arguments.length===3){node=arguments[2]}if(arguments.length==1){bool=!node.hasAttribute(name)}if(bool){wrap(node).setAttribute(name,"");return true}else{wrap(node).removeAttribute(name);return false}}toggleClass(name,bool,node){node=node||this;if(arguments.length==1){bool=!node.classList.contains(name)}if(bool){node.classList.add(name)}else{node.classList.remove(name)}}transform(transformText,node){node=node||this;node.style.webkitTransform=transformText;node.style.transform=transformText}translate3d(x,y,z,node){node=node||this;this.transform("translate3d("+x+","+y+","+z+")",node)}arrayDelete(arrayOrPath,item){let index;if(Array.isArray(arrayOrPath)){index=arrayOrPath.indexOf(item);if(index>=0){return arrayOrPath.splice(index,1)}}else{let arr=get(this,arrayOrPath);index=arr.indexOf(item);if(index>=0){return this.splice(arrayOrPath,index,1)}}return null}_logger(level,args){if(Array.isArray(args)&&args.length===1&&Array.isArray(args[0])){args=args[0]}switch(level){case"log":case"warn":case"error":console[level](...args)}}_log(...args){this._logger("log",args)}_warn(...args){this._logger("warn",args)}_error(...args){this._logger("error",args)}_logf(methodName,...args){return["[%s::%s]",this.is,methodName,...args]}}LegacyElement.prototype.is="";return LegacyElement});const lifecycleProps={attached:true,detached:true,ready:true,created:true,beforeRegister:true,registered:true,attributeChanged:true,listeners:true,hostAttributes:true};const excludeOnInfo={attached:true,detached:true,ready:true,created:true,beforeRegister:true,registered:true,attributeChanged:true,behaviors:true,_noAccessors:true};const excludeOnBehaviors=Object.assign({listeners:true,hostAttributes:true,properties:true,observers:true},excludeOnInfo);function copyProperties(source,target,excludeProps){const noAccessors=source._noAccessors;const propertyNames=Object.getOwnPropertyNames(source);for(let i=0;i<propertyNames.length;i++){let p=propertyNames[i];if(p in excludeProps){continue}if(noAccessors){target[p]=source[p]}else{let pd=Object.getOwnPropertyDescriptor(source,p);if(pd){pd.configurable=true;Object.defineProperty(target,p,pd)}}}}function mixinBehaviors(behaviors,klass){return GenerateClassFromInfo({},LegacyElementMixin(klass),behaviors)}function applyBehaviors(proto,behaviors,lifecycle){for(let i=0;i<behaviors.length;i++){applyInfo(proto,behaviors[i],lifecycle,excludeOnBehaviors)}}function applyInfo(proto,info,lifecycle,excludeProps){copyProperties(info,proto,excludeProps);for(let p in lifecycleProps){if(info[p]){lifecycle[p]=lifecycle[p]||[];lifecycle[p].push(info[p])}}}function flattenBehaviors(behaviors,list,exclude){list=list||[];for(let i=behaviors.length-1;i>=0;i--){let b=behaviors[i];if(b){if(Array.isArray(b)){flattenBehaviors(b,list)}else{if(list.indexOf(b)<0&&(!exclude||exclude.indexOf(b)<0)){list.unshift(b)}}}else{console.warn("behavior is null, check for missing or 404 import")}}return list}function mergeProperties(target,source){for(const p in source){const targetInfo=target[p];const sourceInfo=source[p];if(!("value"in sourceInfo)&&targetInfo&&"value"in targetInfo){target[p]=Object.assign({value:targetInfo.value},sourceInfo)}else{target[p]=sourceInfo}}}function GenerateClassFromInfo(info,Base,behaviors){let behaviorList;const lifecycle={};class PolymerGenerated extends Base{static _finalizeClass(){if(!this.hasOwnProperty(JSCompiler_renameProperty("generatedFrom",this))){super._finalizeClass()}else{if(behaviorList){for(let i=0,b;i<behaviorList.length;i++){b=behaviorList[i];if(b.properties){this.createProperties(b.properties)}if(b.observers){this.createObservers(b.observers,b.properties)}}}if(info.properties){this.createProperties(info.properties)}if(info.observers){this.createObservers(info.observers,info.properties)}this._prepareTemplate()}}static get properties(){const properties={};if(behaviorList){for(let i=0;i<behaviorList.length;i++){mergeProperties(properties,behaviorList[i].properties)}}mergeProperties(properties,info.properties);return properties}static get observers(){let observers=[];if(behaviorList){for(let i=0,b;i<behaviorList.length;i++){b=behaviorList[i];if(b.observers){observers=observers.concat(b.observers)}}}if(info.observers){observers=observers.concat(info.observers)}return observers}created(){super.created();const list=lifecycle.created;if(list){for(let i=0;i<list.length;i++){list[i].call(this)}}}_registered(){const generatedProto=PolymerGenerated.prototype;if(!generatedProto.hasOwnProperty("__hasRegisterFinished")){generatedProto.__hasRegisterFinished=true;super._registered();if(legacyOptimizations){copyPropertiesToProto(generatedProto)}const proto=Object.getPrototypeOf(this);let list=lifecycle.beforeRegister;if(list){for(let i=0;i<list.length;i++){list[i].call(proto)}}list=lifecycle.registered;if(list){for(let i=0;i<list.length;i++){list[i].call(proto)}}}}_applyListeners(){super._applyListeners();const list=lifecycle.listeners;if(list){for(let i=0;i<list.length;i++){const listeners=list[i];if(listeners){for(let l in listeners){this._addMethodEventListenerToNode(this,l,listeners[l])}}}}}_ensureAttributes(){const list=lifecycle.hostAttributes;if(list){for(let i=list.length-1;i>=0;i--){const hostAttributes=list[i];for(let a in hostAttributes){this._ensureAttribute(a,hostAttributes[a])}}}super._ensureAttributes()}ready(){super.ready();let list=lifecycle.ready;if(list){for(let i=0;i<list.length;i++){list[i].call(this)}}}attached(){super.attached();let list=lifecycle.attached;if(list){for(let i=0;i<list.length;i++){list[i].call(this)}}}detached(){super.detached();let list=lifecycle.detached;if(list){for(let i=0;i<list.length;i++){list[i].call(this)}}}attributeChanged(name,old,value){super.attributeChanged();let list=lifecycle.attributeChanged;if(list){for(let i=0;i<list.length;i++){list[i].call(this,name,old,value)}}}}if(behaviors){if(!Array.isArray(behaviors)){behaviors=[behaviors]}let superBehaviors=Base.prototype.behaviors;behaviorList=flattenBehaviors(behaviors,null,superBehaviors);PolymerGenerated.prototype.behaviors=superBehaviors?superBehaviors.concat(behaviors):behaviorList}const copyPropertiesToProto=proto=>{if(behaviorList){applyBehaviors(proto,behaviorList,lifecycle)}applyInfo(proto,info,lifecycle,excludeOnInfo)};if(!legacyOptimizations){copyPropertiesToProto(PolymerGenerated.prototype)}PolymerGenerated.generatedFrom=info;return PolymerGenerated}const Class=function(info,mixin){if(!info){console.warn("Polymer.Class requires `info` argument")}let klass=mixin?mixin(LegacyElementMixin(HTMLElement)):LegacyElementMixin(HTMLElement);klass=GenerateClassFromInfo(info,klass,info.behaviors);klass.is=klass.prototype.is=info.is;return klass};const Polymer=function(info){let klass;if(typeof info==="function"){klass=info}else{klass=Polymer.Class(info)}customElements.define(klass.is,klass);return klass};Polymer.Class=Class;function mutablePropertyChange(inst,property,value,old,mutableData){let isObject;if(mutableData){isObject=typeof value==="object"&&value!==null;if(isObject){old=inst.__dataTemp[property]}}let shouldChange=old!==value&&(old===old||value===value);if(isObject&&shouldChange){inst.__dataTemp[property]=value}return shouldChange}const MutableData=dedupingMixin(superClass=>{class MutableData extends superClass{_shouldPropertyChange(property,value,old){return mutablePropertyChange(this,property,value,old,true)}}return MutableData});const OptionalMutableData=dedupingMixin(superClass=>{class OptionalMutableData extends superClass{static get properties(){return{mutableData:Boolean}}_shouldPropertyChange(property,value,old){return mutablePropertyChange(this,property,value,old,this.mutableData)}}return OptionalMutableData});MutableData._mutablePropertyChange=mutablePropertyChange;let newInstance=null;function HTMLTemplateElementExtension(){return newInstance}HTMLTemplateElementExtension.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:HTMLTemplateElementExtension,writable:true}});const DataTemplate=PropertyEffects(HTMLTemplateElementExtension);const MutableDataTemplate=MutableData(DataTemplate);function upgradeTemplate(template,constructor){newInstance=template;Object.setPrototypeOf(template,constructor.prototype);new constructor;newInstance=null}const templateInstanceBase=PropertyEffects(class{});class TemplateInstanceBase extends templateInstanceBase{constructor(props){super();this._configureProperties(props);this.root=this._stampTemplate(this.__dataHost);let children=this.children=[];for(let n=this.root.firstChild;n;n=n.nextSibling){children.push(n);n.__templatizeInstance=this}if(this.__templatizeOwner&&this.__templatizeOwner.__hideTemplateChildren__){this._showHideChildren(true)}let options=this.__templatizeOptions;if(props&&options.instanceProps||!options.instanceProps){this._enableProperties()}}_configureProperties(props){let options=this.__templatizeOptions;if(options.forwardHostProp){for(let hprop in this.__hostProps){this._setPendingProperty(hprop,this.__dataHost["_host_"+hprop])}}for(let iprop in props){this._setPendingProperty(iprop,props[iprop])}}forwardHostProp(prop,value){if(this._setPendingPropertyOrPath(prop,value,false,true)){this.__dataHost._enqueueClient(this)}}_addEventListenerToNode(node,eventName,handler){if(this._methodHost&&this.__templatizeOptions.parentModel){this._methodHost._addEventListenerToNode(node,eventName,e=>{e.model=this;handler(e)})}else{let templateHost=this.__dataHost.__dataHost;if(templateHost){templateHost._addEventListenerToNode(node,eventName,handler)}}}_showHideChildren(hide){let c=this.children;for(let i=0;i<c.length;i++){let n=c[i];if(Boolean(hide)!=Boolean(n.__hideTemplateChildren__)){if(n.nodeType===Node.TEXT_NODE){if(hide){n.__polymerTextContent__=n.textContent;n.textContent=""}else{n.textContent=n.__polymerTextContent__}}else if(n.localName==="slot"){if(hide){n.__polymerReplaced__=document.createComment("hidden-slot");wrap(wrap(n).parentNode).replaceChild(n.__polymerReplaced__,n)}else{const replace=n.__polymerReplaced__;if(replace){wrap(wrap(replace).parentNode).replaceChild(n,replace)}}}else if(n.style){if(hide){n.__polymerDisplay__=n.style.display;n.style.display="none"}else{n.style.display=n.__polymerDisplay__}}}n.__hideTemplateChildren__=hide;if(n._showHideChildren){n._showHideChildren(hide)}}}_setUnmanagedPropertyToNode(node,prop,value){if(node.__hideTemplateChildren__&&node.nodeType==Node.TEXT_NODE&&prop=="textContent"){node.__polymerTextContent__=value}else{super._setUnmanagedPropertyToNode(node,prop,value)}}get parentModel(){let model=this.__parentModel;if(!model){let options;model=this;do{model=model.__dataHost.__dataHost}while((options=model.__templatizeOptions)&&!options.parentModel);this.__parentModel=model}return model}dispatchEvent(event){return true}}TemplateInstanceBase.prototype.__dataHost;TemplateInstanceBase.prototype.__templatizeOptions;TemplateInstanceBase.prototype._methodHost;TemplateInstanceBase.prototype.__templatizeOwner;TemplateInstanceBase.prototype.__hostProps;const MutableTemplateInstanceBase=MutableData(TemplateInstanceBase);function findMethodHost(template){let templateHost=template.__dataHost;return templateHost&&templateHost._methodHost||templateHost}function createTemplatizerClass(template,templateInfo,options){let templatizerBase=options.mutableData?MutableTemplateInstanceBase:TemplateInstanceBase;if(templatize.mixin){templatizerBase=templatize.mixin(templatizerBase)}let klass=class extends templatizerBase{};klass.prototype.__templatizeOptions=options;klass.prototype._bindTemplate(template);addNotifyEffects(klass,template,templateInfo,options);return klass}function addPropagateEffects(template,templateInfo,options){let userForwardHostProp=options.forwardHostProp;if(userForwardHostProp){let klass=templateInfo.templatizeTemplateClass;if(!klass){let templatizedBase=options.mutableData?MutableDataTemplate:DataTemplate;klass=templateInfo.templatizeTemplateClass=class TemplatizedTemplate extends templatizedBase{};let hostProps=templateInfo.hostProps;for(let prop in hostProps){klass.prototype._addPropertyEffect("_host_"+prop,klass.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,{fn:createForwardHostPropEffect(prop,userForwardHostProp)});klass.prototype._createNotifyingProperty("_host_"+prop)}}upgradeTemplate(template,klass);if(template.__dataProto){Object.assign(template.__data,template.__dataProto)}template.__dataTemp={};template.__dataPending=null;template.__dataOld=null;template._enableProperties()}}function createForwardHostPropEffect(hostProp,userForwardHostProp){return function forwardHostProp(template,prop,props){userForwardHostProp.call(template.__templatizeOwner,prop.substring("_host_".length),props[prop])}}function addNotifyEffects(klass,template,templateInfo,options){let hostProps=templateInfo.hostProps||{};for(let iprop in options.instanceProps){delete hostProps[iprop];let userNotifyInstanceProp=options.notifyInstanceProp;if(userNotifyInstanceProp){klass.prototype._addPropertyEffect(iprop,klass.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:createNotifyInstancePropEffect(iprop,userNotifyInstanceProp)})}}if(options.forwardHostProp&&template.__dataHost){for(let hprop in hostProps){klass.prototype._addPropertyEffect(hprop,klass.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:createNotifyHostPropEffect()})}}}function createNotifyInstancePropEffect(instProp,userNotifyInstanceProp){return function notifyInstanceProp(inst,prop,props){userNotifyInstanceProp.call(inst.__templatizeOwner,inst,prop,props[prop])}}function createNotifyHostPropEffect(){return function notifyHostProp(inst,prop,props){inst.__dataHost._setPendingPropertyOrPath("_host_"+prop,props[prop],true,true)}}function templatize(template,owner,options){if(strictTemplatePolicy&&!findMethodHost(template)){throw new Error("strictTemplatePolicy: template owner not trusted")}options=options||{};if(template.__templatizeOwner){throw new Error("A <template> can only be templatized once")}template.__templatizeOwner=owner;const ctor=owner?owner.constructor:TemplateInstanceBase;let templateInfo=ctor._parseTemplate(template);let baseClass=templateInfo.templatizeInstanceClass;if(!baseClass){baseClass=createTemplatizerClass(template,templateInfo,options);templateInfo.templatizeInstanceClass=baseClass}addPropagateEffects(template,templateInfo,options);let klass=class TemplateInstance extends baseClass{};klass.prototype._methodHost=findMethodHost(template);klass.prototype.__dataHost=template;klass.prototype.__templatizeOwner=owner;klass.prototype.__hostProps=templateInfo.hostProps;klass=klass;return klass}function modelForElement(template,node){let model;while(node){if(model=node.__templatizeInstance){if(model.__dataHost!=template){node=model.__dataHost}else{return model}}else{node=wrap(node).parentNode}}return null}const Templatizer={templatize(template,mutableData){this._templatizerTemplate=template;this.ctor=templatize(template,this,{mutableData:Boolean(mutableData),parentModel:this._parentModel,instanceProps:this._instanceProps,forwardHostProp:this._forwardHostPropV2,notifyInstanceProp:this._notifyInstancePropV2})},stamp(model){return new this.ctor(model)},modelForElement(el){return modelForElement(this._templatizerTemplate,el)}};const domBindBase=GestureEventListeners(OptionalMutableData(PropertyEffects(HTMLElement)));class DomBind extends domBindBase{static get observedAttributes(){return["mutable-data"]}constructor(){super();if(strictTemplatePolicy){throw new Error(`strictTemplatePolicy: dom-bind not allowed`)}this.root=null;this.$=null;this.__children=null}attributeChangedCallback(){this.mutableData=true}connectedCallback(){this.style.display="none";this.render()}disconnectedCallback(){this.__removeChildren()}__insertChildren(){wrap(wrap(this).parentNode).insertBefore(this.root,this)}__removeChildren(){if(this.__children){for(let i=0;i<this.__children.length;i++){this.root.appendChild(this.__children[i])}}}render(){let template;if(!this.__children){template=template||this.querySelector("template");if(!template){let observer=new MutationObserver(()=>{template=this.querySelector("template");if(template){observer.disconnect();this.render()}else{throw new Error("dom-bind requires a <template> child")}});observer.observe(this,{childList:true});return}this.root=this._stampTemplate(template);this.$=this.root.$;this.__children=[];for(let n=this.root.firstChild;n;n=n.nextSibling){this.__children[this.__children.length]=n}this._enableProperties()}this.__insertChildren();this.dispatchEvent(new CustomEvent("dom-change",{bubbles:true,composed:true}))}}customElements.define("dom-bind",DomBind);class LiteralString{constructor(string){this.value=string.toString()}toString(){return this.value}}function literalValue(value){if(value instanceof LiteralString){return value.value}else{throw new Error(`non-literal value passed to Polymer's htmlLiteral function: ${value}`)}}function htmlValue(value){if(value instanceof HTMLTemplateElement){return value.innerHTML}else if(value instanceof LiteralString){return literalValue(value)}else{throw new Error(`non-template value passed to Polymer's html function: ${value}`)}}const html=function html(strings,...values){const template=document.createElement("template");template.innerHTML=values.reduce((acc,v,idx)=>acc+htmlValue(v)+strings[idx+1],strings[0]);return template};const PolymerElement=ElementMixin(HTMLElement);const domRepeatBase=OptionalMutableData(PolymerElement);class DomRepeat extends domRepeatBase{static get is(){return"dom-repeat"}static get template(){return null}static get properties(){return{items:{type:Array},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},itemsIndexAs:{type:String,value:"itemsIndex"},sort:{type:Function,observer:"__sortChanged"},filter:{type:Function,observer:"__filterChanged"},observe:{type:String,observer:"__observeChanged"},delay:Number,renderedItemCount:{type:Number,notify:true,readOnly:true},initialCount:{type:Number,observer:"__initializeChunking"},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Number,computed:"__computeFrameTime(targetFramerate)"}}}static get observers(){return["__itemsChanged(items.*)"]}constructor(){super();this.__instances=[];this.__limit=Infinity;this.__pool=[];this.__renderDebouncer=null;this.__itemsIdxToInstIdx={};this.__chunkCount=null;this.__lastChunkTime=null;this.__sortFn=null;this.__filterFn=null;this.__observePaths=null;this.__ctor=null;this.__isDetached=true;this.template=null}disconnectedCallback(){super.disconnectedCallback();this.__isDetached=true;for(let i=0;i<this.__instances.length;i++){this.__detachInstance(i)}}connectedCallback(){super.connectedCallback();this.style.display="none";if(this.__isDetached){this.__isDetached=false;let wrappedParent=wrap(wrap(this).parentNode);for(let i=0;i<this.__instances.length;i++){this.__attachInstance(i,wrappedParent)}}}__ensureTemplatized(){if(!this.__ctor){let template=this.template=this.querySelector("template");if(!template){let observer=new MutationObserver(()=>{if(this.querySelector("template")){observer.disconnect();this.__render()}else{throw new Error("dom-repeat requires a <template> child")}});observer.observe(this,{childList:true});return false}let instanceProps={};instanceProps[this.as]=true;instanceProps[this.indexAs]=true;instanceProps[this.itemsIndexAs]=true;this.__ctor=templatize(template,this,{mutableData:this.mutableData,parentModel:true,instanceProps:instanceProps,forwardHostProp:function(prop,value){let i$=this.__instances;for(let i=0,inst;i<i$.length&&(inst=i$[i]);i++){inst.forwardHostProp(prop,value)}},notifyInstanceProp:function(inst,prop,value){if(matches(this.as,prop)){let idx=inst[this.itemsIndexAs];if(prop==this.as){this.items[idx]=value}let path=translate(this.as,`${JSCompiler_renameProperty("items",this)}.${idx}`,prop);this.notifyPath(path,value)}}})}return true}__getMethodHost(){return this.__dataHost._methodHost||this.__dataHost}__functionFromPropertyValue(functionOrMethodName){if(typeof functionOrMethodName==="string"){let methodName=functionOrMethodName;let obj=this.__getMethodHost();return function(){return obj[methodName].apply(obj,arguments)}}return functionOrMethodName}__sortChanged(sort){this.__sortFn=this.__functionFromPropertyValue(sort);if(this.items){this.__debounceRender(this.__render)}}__filterChanged(filter){this.__filterFn=this.__functionFromPropertyValue(filter);if(this.items){this.__debounceRender(this.__render)}}__computeFrameTime(rate){return Math.ceil(1e3/rate)}__initializeChunking(){if(this.initialCount){this.__limit=this.initialCount;this.__chunkCount=this.initialCount;this.__lastChunkTime=performance.now()}}__tryRenderChunk(){if(this.items&&this.__limit<this.items.length){this.__debounceRender(this.__requestRenderChunk)}}__requestRenderChunk(){requestAnimationFrame(()=>this.__renderChunk())}__renderChunk(){let currChunkTime=performance.now();let ratio=this._targetFrameTime/(currChunkTime-this.__lastChunkTime);this.__chunkCount=Math.round(this.__chunkCount*ratio)||1;this.__limit+=this.__chunkCount;this.__lastChunkTime=currChunkTime;this.__debounceRender(this.__render)}__observeChanged(){this.__observePaths=this.observe&&this.observe.replace(".*",".").split(" ")}__itemsChanged(change){if(this.items&&!Array.isArray(this.items)){console.warn("dom-repeat expected array for `items`, found",this.items)}if(!this.__handleItemPath(change.path,change.value)){this.__initializeChunking();this.__debounceRender(this.__render)}}__handleObservedPaths(path){if(this.__sortFn||this.__filterFn){if(!path){this.__debounceRender(this.__render,this.delay)}else if(this.__observePaths){let paths=this.__observePaths;for(let i=0;i<paths.length;i++){if(path.indexOf(paths[i])===0){this.__debounceRender(this.__render,this.delay)}}}}}__debounceRender(fn,delay=0){this.__renderDebouncer=Debouncer.debounce(this.__renderDebouncer,delay>0?timeOut.after(delay):microTask,fn.bind(this));enqueueDebouncer(this.__renderDebouncer)}render(){this.__debounceRender(this.__render);flush()}__render(){if(!this.__ensureTemplatized()){return}this.__applyFullRefresh();this.__pool.length=0;this._setRenderedItemCount(this.__instances.length);this.dispatchEvent(new CustomEvent("dom-change",{bubbles:true,composed:true}));this.__tryRenderChunk()}__applyFullRefresh(){let items=this.items||[];let isntIdxToItemsIdx=new Array(items.length);for(let i=0;i<items.length;i++){isntIdxToItemsIdx[i]=i}if(this.__filterFn){isntIdxToItemsIdx=isntIdxToItemsIdx.filter((i,idx,array)=>this.__filterFn(items[i],idx,array))}if(this.__sortFn){isntIdxToItemsIdx.sort((a,b)=>this.__sortFn(items[a],items[b]))}const itemsIdxToInstIdx=this.__itemsIdxToInstIdx={};let instIdx=0;const limit=Math.min(isntIdxToItemsIdx.length,this.__limit);for(;instIdx<limit;instIdx++){let inst=this.__instances[instIdx];let itemIdx=isntIdxToItemsIdx[instIdx];let item=items[itemIdx];itemsIdxToInstIdx[itemIdx]=instIdx;if(inst){inst._setPendingProperty(this.as,item);inst._setPendingProperty(this.indexAs,instIdx);inst._setPendingProperty(this.itemsIndexAs,itemIdx);inst._flushProperties()}else{this.__insertInstance(item,instIdx,itemIdx)}}for(let i=this.__instances.length-1;i>=instIdx;i--){this.__detachAndRemoveInstance(i)}}__detachInstance(idx){let inst=this.__instances[idx];const wrappedRoot=wrap(inst.root);for(let i=0;i<inst.children.length;i++){let el=inst.children[i];wrappedRoot.appendChild(el)}return inst}__attachInstance(idx,parent){let inst=this.__instances[idx];parent.insertBefore(inst.root,this)}__detachAndRemoveInstance(idx){let inst=this.__detachInstance(idx);if(inst){this.__pool.push(inst)}this.__instances.splice(idx,1)}__stampInstance(item,instIdx,itemIdx){let model={};model[this.as]=item;model[this.indexAs]=instIdx;model[this.itemsIndexAs]=itemIdx;return new this.__ctor(model)}__insertInstance(item,instIdx,itemIdx){let inst=this.__pool.pop();if(inst){inst._setPendingProperty(this.as,item);inst._setPendingProperty(this.indexAs,instIdx);inst._setPendingProperty(this.itemsIndexAs,itemIdx);inst._flushProperties()}else{inst=this.__stampInstance(item,instIdx,itemIdx)}let beforeRow=this.__instances[instIdx+1];let beforeNode=beforeRow?beforeRow.children[0]:this;wrap(wrap(this).parentNode).insertBefore(inst.root,beforeNode);this.__instances[instIdx]=inst;return inst}_showHideChildren(hidden){for(let i=0;i<this.__instances.length;i++){this.__instances[i]._showHideChildren(hidden)}}__handleItemPath(path,value){let itemsPath=path.slice(6);let dot=itemsPath.indexOf(".");let itemsIdx=dot<0?itemsPath:itemsPath.substring(0,dot);if(itemsIdx==parseInt(itemsIdx,10)){let itemSubPath=dot<0?"":itemsPath.substring(dot+1);this.__handleObservedPaths(itemSubPath);let instIdx=this.__itemsIdxToInstIdx[itemsIdx];let inst=this.__instances[instIdx];if(inst){let itemPath=this.as+(itemSubPath?"."+itemSubPath:"");inst._setPendingPropertyOrPath(itemPath,value,false,true);inst._flushProperties()}return true}}itemForElement(el){let instance=this.modelForElement(el);return instance&&instance[this.as]}indexForElement(el){let instance=this.modelForElement(el);return instance&&instance[this.indexAs]}modelForElement(el){return modelForElement(this.template,el)}}customElements.define(DomRepeat.is,DomRepeat);class DomIf extends PolymerElement{static get is(){return"dom-if"}static get template(){return null}static get properties(){return{if:{type:Boolean,observer:"__debounceRender"},restamp:{type:Boolean,observer:"__debounceRender"}}}constructor(){super();this.__renderDebouncer=null;this.__invalidProps=null;this.__instance=null;this._lastIf=false;this.__ctor=null;this.__hideTemplateChildren__=false}__debounceRender(){this.__renderDebouncer=Debouncer.debounce(this.__renderDebouncer,microTask,()=>this.__render());enqueueDebouncer(this.__renderDebouncer)}disconnectedCallback(){super.disconnectedCallback();const parent=wrap(this).parentNode;if(!parent||parent.nodeType==Node.DOCUMENT_FRAGMENT_NODE&&!wrap(parent).host){this.__teardownInstance()}}connectedCallback(){super.connectedCallback();this.style.display="none";if(this.if){this.__debounceRender()}}render(){flush()}__render(){if(this.if){if(!this.__ensureInstance()){return}this._showHideChildren()}else if(this.restamp){this.__teardownInstance()}if(!this.restamp&&this.__instance){this._showHideChildren()}if(this.if!=this._lastIf){this.dispatchEvent(new CustomEvent("dom-change",{bubbles:true,composed:true}));this._lastIf=this.if}}__ensureInstance(){let parentNode=wrap(this).parentNode;if(parentNode){if(!this.__ctor){let template=wrap(this).querySelector("template");if(!template){let observer=new MutationObserver(()=>{if(wrap(this).querySelector("template")){observer.disconnect();this.__render()}else{throw new Error("dom-if requires a <template> child")}});observer.observe(this,{childList:true});return false}this.__ctor=templatize(template,this,{mutableData:true,forwardHostProp:function(prop,value){if(this.__instance){if(this.if){this.__instance.forwardHostProp(prop,value)}else{this.__invalidProps=this.__invalidProps||Object.create(null);this.__invalidProps[root(prop)]=true}}}})}if(!this.__instance){this.__instance=new this.__ctor;wrap(parentNode).insertBefore(this.__instance.root,this)}else{this.__syncHostProperties();let c$=this.__instance.children;if(c$&&c$.length){let lastChild=wrap(this).previousSibling;if(lastChild!==c$[c$.length-1]){for(let i=0,n;i<c$.length&&(n=c$[i]);i++){wrap(parentNode).insertBefore(n,this)}}}}}return true}__syncHostProperties(){let props=this.__invalidProps;if(props){for(let prop in props){this.__instance._setPendingProperty(prop,this.__dataHost[prop])}this.__invalidProps=null;this.__instance._flushProperties()}}__teardownInstance(){if(this.__instance){let c$=this.__instance.children;if(c$&&c$.length){let parent=wrap(c$[0]).parentNode;if(parent){parent=wrap(parent);for(let i=0,n;i<c$.length&&(n=c$[i]);i++){parent.removeChild(n)}}}this.__instance=null;this.__invalidProps=null}}_showHideChildren(){let hidden=this.__hideTemplateChildren__||!this.if;if(this.__instance){this.__instance._showHideChildren(hidden)}}}customElements.define(DomIf.is,DomIf);let ArraySelectorMixin=dedupingMixin(superClass=>{let elementBase=ElementMixin(superClass);class ArraySelectorMixin extends elementBase{static get properties(){return{items:{type:Array},multi:{type:Boolean,value:false},selected:{type:Object,notify:true},selectedItem:{type:Object,notify:true},toggle:{type:Boolean,value:false}}}static get observers(){return["__updateSelection(multi, items.*)"]}constructor(){super();this.__lastItems=null;this.__lastMulti=null;this.__selectedMap=null}__updateSelection(multi,itemsInfo){let path=itemsInfo.path;if(path==JSCompiler_renameProperty("items",this)){let newItems=itemsInfo.base||[];let lastItems=this.__lastItems;let lastMulti=this.__lastMulti;if(multi!==lastMulti){this.clearSelection()}if(lastItems){let splices=calculateSplices(newItems,lastItems);this.__applySplices(splices)}this.__lastItems=newItems;this.__lastMulti=multi}else if(itemsInfo.path==`${JSCompiler_renameProperty("items",this)}.splices`){this.__applySplices(itemsInfo.value.indexSplices)}else{let part=path.slice(`${JSCompiler_renameProperty("items",this)}.`.length);let idx=parseInt(part,10);if(part.indexOf(".")<0&&part==idx){this.__deselectChangedIdx(idx)}}}__applySplices(splices){let selected=this.__selectedMap;for(let i=0;i<splices.length;i++){let s=splices[i];selected.forEach((idx,item)=>{if(idx<s.index);else if(idx>=s.index+s.removed.length){selected.set(item,idx+s.addedCount-s.removed.length)}else{selected.set(item,-1)}});for(let j=0;j<s.addedCount;j++){let idx=s.index+j;if(selected.has(this.items[idx])){selected.set(this.items[idx],idx)}}}this.__updateLinks();let sidx=0;selected.forEach((idx,item)=>{if(idx<0){if(this.multi){this.splice(JSCompiler_renameProperty("selected",this),sidx,1)}else{this.selected=this.selectedItem=null}selected.delete(item)}else{sidx++}})}__updateLinks(){this.__dataLinkedPaths={};if(this.multi){let sidx=0;this.__selectedMap.forEach(idx=>{if(idx>=0){this.linkPaths(`${JSCompiler_renameProperty("items",this)}.${idx}`,`${JSCompiler_renameProperty("selected",this)}.${sidx++}`)}})}else{this.__selectedMap.forEach(idx=>{this.linkPaths(JSCompiler_renameProperty("selected",this),`${JSCompiler_renameProperty("items",this)}.${idx}`);this.linkPaths(JSCompiler_renameProperty("selectedItem",this),`${JSCompiler_renameProperty("items",this)}.${idx}`)})}}clearSelection(){this.__dataLinkedPaths={};this.__selectedMap=new Map;this.selected=this.multi?[]:null;this.selectedItem=null}isSelected(item){return this.__selectedMap.has(item)}isIndexSelected(idx){return this.isSelected(this.items[idx])}__deselectChangedIdx(idx){let sidx=this.__selectedIndexForItemIndex(idx);if(sidx>=0){let i=0;this.__selectedMap.forEach((idx,item)=>{if(sidx==i++){this.deselect(item)}})}}__selectedIndexForItemIndex(idx){let selected=this.__dataLinkedPaths[`${JSCompiler_renameProperty("items",this)}.${idx}`];if(selected){return parseInt(selected.slice(`${JSCompiler_renameProperty("selected",this)}.`.length),10)}}deselect(item){let idx=this.__selectedMap.get(item);if(idx>=0){this.__selectedMap.delete(item);let sidx;if(this.multi){sidx=this.__selectedIndexForItemIndex(idx)}this.__updateLinks();if(this.multi){this.splice(JSCompiler_renameProperty("selected",this),sidx,1)}else{this.selected=this.selectedItem=null}}}deselectIndex(idx){this.deselect(this.items[idx])}select(item){this.selectIndex(this.items.indexOf(item))}selectIndex(idx){let item=this.items[idx];if(!this.isSelected(item)){if(!this.multi){this.__selectedMap.clear()}this.__selectedMap.set(item,idx);this.__updateLinks();if(this.multi){this.push(JSCompiler_renameProperty("selected",this),item)}else{this.selected=this.selectedItem=item}}else if(this.toggle){this.deselectIndex(idx)}}}return ArraySelectorMixin});let baseArraySelector=ArraySelectorMixin(PolymerElement);class ArraySelector extends baseArraySelector{static get is(){return"array-selector"}static get template(){return null}}customElements.define(ArraySelector.is,ArraySelector);const customStyleInterface=new CustomStyleInterface;if(!window.ShadyCSS){window.ShadyCSS={prepareTemplate(template,elementName,elementExtends){},prepareTemplateDom(template,elementName){},prepareTemplateStyles(template,elementName,elementExtends){},styleSubtree(element,properties){customStyleInterface.processStyles();updateNativeProperties(element,properties)},styleElement(element){customStyleInterface.processStyles()},styleDocument(properties){customStyleInterface.processStyles();updateNativeProperties(document.body,properties)},getComputedStyleValue(element,property){return getComputedStyleValue(element,property)},flushCustomStyles(){},nativeCss:nativeCssVariables,nativeShadow:nativeShadow,cssBuild:cssBuild,disableRuntime:disableRuntime}}window.ShadyCSS.CustomStyleInterface=customStyleInterface;const attr="include";const CustomStyleInterface$1=window.ShadyCSS.CustomStyleInterface;class CustomStyle extends HTMLElement{constructor(){super();this._style=null;CustomStyleInterface$1.addCustomStyle(this)}getStyle(){if(this._style){return this._style}const style=this.querySelector("style");if(!style){return null}this._style=style;const include=style.getAttribute(attr);if(include){style.removeAttribute(attr);style.textContent=cssFromModules(include)+style.textContent}if(this.ownerDocument!==window.document){window.document.head.appendChild(this)}return this._style}}window.customElements.define("custom-style",CustomStyle);let mutablePropertyChange$1;(()=>{mutablePropertyChange$1=MutableData._mutablePropertyChange})();const OptionalMutableDataBehavior={properties:{mutableData:Boolean},_shouldPropertyChange(property,value,old){return mutablePropertyChange$1(this,property,value,old,this.mutableData)}};const Base=LegacyElementMixin(HTMLElement).prototype;export{Base,Debouncer,DomIf,OptionalMutableDataBehavior,Polymer,PolymerElement,TemplateInstanceBase,Templatizer,afterNextRender,animationFrame,beforeNextRender,calculateSplices,dashToCamelCase,dom,enqueueDebouncer,flush,gestures$1 as gestures,html,idlePeriod,matches,microTask,mixinBehaviors,templatize,translate,useShadow};
\ No newline at end of file diff --git a/chromium/third_party/polymer/v3_0/minify_polymer.py b/chromium/third_party/polymer/v3_0/minify_polymer.py index e4bd37b6458..33c0cbabf39 100644 --- a/chromium/third_party/polymer/v3_0/minify_polymer.py +++ b/chromium/third_party/polymer/v3_0/minify_polymer.py @@ -53,7 +53,7 @@ def main(): node.RunNode([ node_modules.PathToUglify(), bundled_js, # TODO(dpapad): Figure out a way to deduplicate LICENSE headers. - #'--comments', '"/Copyright|license|LICENSE/"', + #'--comments', '/Copyright|license|LICENSE/', '--output', minified_js]) # Copy generated JS bundle back to the original location. diff --git a/chromium/third_party/polymer/v3_0/polymer.js b/chromium/third_party/polymer/v3_0/polymer.js index 8d22041562c..dbe980b4f33 100644 --- a/chromium/third_party/polymer/v3_0/polymer.js +++ b/chromium/third_party/polymer/v3_0/polymer.js @@ -8,21 +8,23 @@ Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ -export {afterNextRender, beforeNextRender} from './lib/utils/render-status.js'; -export {animationFrame, idlePeriod, microTask} from './lib/utils/async.js'; import * as gestures from './lib/utils/gestures.js'; -export {gestures}; -export {Base} from './polymer-legacy.js'; -export {dashToCamelCase} from './lib/utils/case-map.js'; -export {Debouncer, enqueueDebouncer} from './lib/utils/debounce.js'; -export {dom, flush} from './lib/legacy/polymer.dom.js'; + export {DomIf} from './lib/elements/dom-if.js'; -export {html} from './lib/utils/html-tag.js'; -export {matches, translate} from './lib/utils/path.js'; +export {mixinBehaviors} from './lib/legacy/class.js'; export {OptionalMutableDataBehavior} from './lib/legacy/mutable-data-behavior.js'; export {Polymer} from './lib/legacy/polymer-fn.js'; -export {PolymerElement} from './polymer-element.js'; -export {TemplateInstanceBase, templatize} from './lib/utils/templatize.js'; +export {dom, flush} from './lib/legacy/polymer.dom.js'; export {Templatizer} from './lib/legacy/templatizer-behavior.js'; export {calculateSplices} from './lib/utils/array-splice.js'; +export {animationFrame, idlePeriod, microTask} from './lib/utils/async.js'; +export {dashToCamelCase} from './lib/utils/case-map.js'; +export {Debouncer, enqueueDebouncer} from './lib/utils/debounce.js'; +export {html} from './lib/utils/html-tag.js'; +export {matches, translate} from './lib/utils/path.js'; +export {afterNextRender, beforeNextRender} from './lib/utils/render-status.js'; export {useShadow} from './lib/utils/settings.js'; +export {TemplateInstanceBase, templatize} from './lib/utils/templatize.js'; +export {PolymerElement} from './polymer-element.js'; +export {Base} from './polymer-legacy.js'; +export {gestures}; |