# HG changeset patch # User Marcin Lulek # Date 2018-07-29 12:47:23 # Node ID 59bfd308b7bce682e4b0d6f9a2c605cb3b882f67 # Parent 57425d448c6f6758eff99be5d3f7c455f2970761 frontend: Use Polymer 2.0 diff --git a/bower.json b/bower.json --- a/bower.json +++ b/bower.json @@ -3,15 +3,15 @@ "description": "User interface for elements for rhodecode", "main": "index.html", "dependencies": { - "webcomponentsjs": "^0.7.22", - "polymer": "Polymer/polymer#^1.6.1", - "paper-button": "PolymerElements/paper-button#^1.0.13", - "paper-spinner": "PolymerElements/paper-spinner#^1.2.0", - "paper-tooltip": "PolymerElements/paper-tooltip#^1.1.2", - "paper-toast": "PolymerElements/paper-toast#^1.3.0", - "paper-toggle-button": "PolymerElements/paper-toggle-button#^1.2.0", - "iron-ajax": "PolymerElements/iron-ajax#^1.4.4", - "iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^1.0.13", - "iron-a11y-keys": "PolymerElements/iron-a11y-keys#^1.0.6" + "webcomponentsjs": "^1.2.3", + "polymer": "Polymer/polymer#^2.6.0", + "paper-button": "PolymerElements/paper-button#^2.1.2", + "paper-spinner": "PolymerElements/paper-spinner#^2.1.0", + "paper-tooltip": "PolymerElements/paper-tooltip#^2.1.1", + "paper-toast": "PolymerElements/paper-toast#^2.1.2", + "paper-toggle-button": "PolymerElements/paper-toggle-button#^2.1.1", + "iron-ajax": "PolymerElements/iron-ajax#^2.1.3", + "iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^2.2.0", + "iron-a11y-keys": "PolymerElements/iron-a11y-keys#^2.1.2" } } diff --git a/package.json b/package.json --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "grunt-contrib-jshint": "^0.12.0", "grunt-contrib-less": "^1.1.0", "grunt-contrib-watch": "^0.6.1", - "crisper": "^2.0.2", - "vulcanize": "^1.14.8", + "crisper": "^2.1.1", + "vulcanize": "^1.16.0", "grunt-crisper": "^1.0.1", "grunt-vulcanize": "^1.0.0", "node2nix": "^1.0.0", diff --git a/rhodecode/public/js/src/components/rhodecode-app/rhodecode-app.js b/rhodecode/public/js/src/components/rhodecode-app/rhodecode-app.js --- a/rhodecode/public/js/src/components/rhodecode-app/rhodecode-app.js +++ b/rhodecode/public/js/src/components/rhodecode-app/rhodecode-app.js @@ -33,7 +33,7 @@ var rhodeCodeApp = Polymer({ }, faviconUpdate: function (data) { - this.$$('rhodecode-favicon').counter = data.count; + this.shadowRoot.querySelector('rhodecode-favicon').counter = data.count; }, /** opens connection to ws server */ diff --git a/rhodecode/public/js/src/components/rhodecode-toast/rhodecode-toast.html b/rhodecode/public/js/src/components/rhodecode-toast/rhodecode-toast.html --- a/rhodecode/public/js/src/components/rhodecode-toast/rhodecode-toast.html +++ b/rhodecode/public/js/src/components/rhodecode-toast/rhodecode-toast.html @@ -1,5 +1,4 @@ - diff --git a/rhodecode/public/js/src/components/rhodecode-unsafe-html/rhodecode-unsafe-html.html b/rhodecode/public/js/src/components/rhodecode-unsafe-html/rhodecode-unsafe-html.html --- a/rhodecode/public/js/src/components/rhodecode-unsafe-html/rhodecode-unsafe-html.html +++ b/rhodecode/public/js/src/components/rhodecode-unsafe-html/rhodecode-unsafe-html.html @@ -3,7 +3,7 @@ diff --git a/rhodecode/public/js/vendors/webcomponentsjs/webcomponents-lite.js b/rhodecode/public/js/vendors/webcomponentsjs/webcomponents-lite.js --- a/rhodecode/public/js/vendors/webcomponentsjs/webcomponents-lite.js +++ b/rhodecode/public/js/vendors/webcomponentsjs/webcomponents-lite.js @@ -1,2505 +1,230 @@ /** - * @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 - */ -// @version 0.7.24 -(function() { - window.WebComponents = window.WebComponents || { - flags: {} - }; - var file = "webcomponents-lite.js"; - var script = document.querySelector('script[src*="' + file + '"]'); - var flags = {}; - if (!flags.noOpts) { - location.search.slice(1).split("&").forEach(function(option) { - var parts = option.split("="); - var match; - if (parts[0] && (match = parts[0].match(/wc-(.+)/))) { - flags[match[1]] = parts[1] || true; - } - }); - if (script) { - for (var i = 0, a; a = script.attributes[i]; i++) { - if (a.name !== "src") { - flags[a.name] = a.value || true; - } - } - } - if (flags.log && flags.log.split) { - var parts = flags.log.split(","); - flags.log = {}; - parts.forEach(function(f) { - flags.log[f] = true; - }); - } else { - flags.log = {}; - } - } - if (flags.register) { - window.CustomElements = window.CustomElements || { - flags: {} - }; - window.CustomElements.flags.register = flags.register; - } - WebComponents.flags = flags; -})(); - -(function(scope) { - "use strict"; - var hasWorkingUrl = false; - if (!scope.forceJURL) { - try { - var u = new URL("b", "http://a"); - u.pathname = "c%20d"; - hasWorkingUrl = u.href === "http://a/c%20d"; - } catch (e) {} - } - if (hasWorkingUrl) return; - var relative = Object.create(null); - relative["ftp"] = 21; - relative["file"] = 0; - relative["gopher"] = 70; - relative["http"] = 80; - relative["https"] = 443; - relative["ws"] = 80; - relative["wss"] = 443; - var relativePathDotMapping = Object.create(null); - relativePathDotMapping["%2e"] = "."; - relativePathDotMapping[".%2e"] = ".."; - relativePathDotMapping["%2e."] = ".."; - relativePathDotMapping["%2e%2e"] = ".."; - function isRelativeScheme(scheme) { - return relative[scheme] !== undefined; - } - function invalid() { - clear.call(this); - this._isInvalid = true; - } - function IDNAToASCII(h) { - if ("" == h) { - invalid.call(this); - } - return h.toLowerCase(); - } - function percentEscape(c) { - var unicode = c.charCodeAt(0); - if (unicode > 32 && unicode < 127 && [ 34, 35, 60, 62, 63, 96 ].indexOf(unicode) == -1) { - return c; - } - return encodeURIComponent(c); - } - function percentEscapeQuery(c) { - var unicode = c.charCodeAt(0); - if (unicode > 32 && unicode < 127 && [ 34, 35, 60, 62, 96 ].indexOf(unicode) == -1) { - return c; - } - return encodeURIComponent(c); - } - var EOF = undefined, ALPHA = /[a-zA-Z]/, ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/; - function parse(input, stateOverride, base) { - function err(message) { - errors.push(message); - } - var state = stateOverride || "scheme start", cursor = 0, buffer = "", seenAt = false, seenBracket = false, errors = []; - loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this._isInvalid) { - var c = input[cursor]; - switch (state) { - case "scheme start": - if (c && ALPHA.test(c)) { - buffer += c.toLowerCase(); - state = "scheme"; - } else if (!stateOverride) { - buffer = ""; - state = "no scheme"; - continue; - } else { - err("Invalid scheme."); - break loop; - } - break; - - case "scheme": - if (c && ALPHANUMERIC.test(c)) { - buffer += c.toLowerCase(); - } else if (":" == c) { - this._scheme = buffer; - buffer = ""; - if (stateOverride) { - break loop; - } - if (isRelativeScheme(this._scheme)) { - this._isRelative = true; - } - if ("file" == this._scheme) { - state = "relative"; - } else if (this._isRelative && base && base._scheme == this._scheme) { - state = "relative or authority"; - } else if (this._isRelative) { - state = "authority first slash"; - } else { - state = "scheme data"; - } - } else if (!stateOverride) { - buffer = ""; - cursor = 0; - state = "no scheme"; - continue; - } else if (EOF == c) { - break loop; - } else { - err("Code point not allowed in scheme: " + c); - break loop; - } - break; - - case "scheme data": - if ("?" == c) { - this._query = "?"; - state = "query"; - } else if ("#" == c) { - this._fragment = "#"; - state = "fragment"; - } else { - if (EOF != c && "\t" != c && "\n" != c && "\r" != c) { - this._schemeData += percentEscape(c); - } - } - break; - - case "no scheme": - if (!base || !isRelativeScheme(base._scheme)) { - err("Missing scheme."); - invalid.call(this); - } else { - state = "relative"; - continue; - } - break; - - case "relative or authority": - if ("/" == c && "/" == input[cursor + 1]) { - state = "authority ignore slashes"; - } else { - err("Expected /, got: " + c); - state = "relative"; - continue; - } - break; - - case "relative": - this._isRelative = true; - if ("file" != this._scheme) this._scheme = base._scheme; - if (EOF == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._username = base._username; - this._password = base._password; - break loop; - } else if ("/" == c || "\\" == c) { - if ("\\" == c) err("\\ is an invalid code point."); - state = "relative slash"; - } else if ("?" == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = "?"; - this._username = base._username; - this._password = base._password; - state = "query"; - } else if ("#" == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._fragment = "#"; - this._username = base._username; - this._password = base._password; - state = "fragment"; - } else { - var nextC = input[cursor + 1]; - var nextNextC = input[cursor + 2]; - if ("file" != this._scheme || !ALPHA.test(c) || nextC != ":" && nextC != "|" || EOF != nextNextC && "/" != nextNextC && "\\" != nextNextC && "?" != nextNextC && "#" != nextNextC) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - this._path = base._path.slice(); - this._path.pop(); - } - state = "relative path"; - continue; - } - break; - - case "relative slash": - if ("/" == c || "\\" == c) { - if ("\\" == c) { - err("\\ is an invalid code point."); - } - if ("file" == this._scheme) { - state = "file host"; - } else { - state = "authority ignore slashes"; - } - } else { - if ("file" != this._scheme) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - } - state = "relative path"; - continue; - } - break; - - case "authority first slash": - if ("/" == c) { - state = "authority second slash"; - } else { - err("Expected '/', got: " + c); - state = "authority ignore slashes"; - continue; - } - break; - - case "authority second slash": - state = "authority ignore slashes"; - if ("/" != c) { - err("Expected '/', got: " + c); - continue; - } - break; - - case "authority ignore slashes": - if ("/" != c && "\\" != c) { - state = "authority"; - continue; - } else { - err("Expected authority, got: " + c); - } - break; - - case "authority": - if ("@" == c) { - if (seenAt) { - err("@ already seen."); - buffer += "%40"; - } - seenAt = true; - for (var i = 0; i < buffer.length; i++) { - var cp = buffer[i]; - if ("\t" == cp || "\n" == cp || "\r" == cp) { - err("Invalid whitespace in authority."); - continue; - } - if (":" == cp && null === this._password) { - this._password = ""; - continue; - } - var tempC = percentEscape(cp); - null !== this._password ? this._password += tempC : this._username += tempC; - } - buffer = ""; - } else if (EOF == c || "/" == c || "\\" == c || "?" == c || "#" == c) { - cursor -= buffer.length; - buffer = ""; - state = "host"; - continue; - } else { - buffer += c; - } - break; - - case "file host": - if (EOF == c || "/" == c || "\\" == c || "?" == c || "#" == c) { - if (buffer.length == 2 && ALPHA.test(buffer[0]) && (buffer[1] == ":" || buffer[1] == "|")) { - state = "relative path"; - } else if (buffer.length == 0) { - state = "relative path start"; - } else { - this._host = IDNAToASCII.call(this, buffer); - buffer = ""; - state = "relative path start"; - } - continue; - } else if ("\t" == c || "\n" == c || "\r" == c) { - err("Invalid whitespace in file host."); - } else { - buffer += c; - } - break; - - case "host": - case "hostname": - if (":" == c && !seenBracket) { - this._host = IDNAToASCII.call(this, buffer); - buffer = ""; - state = "port"; - if ("hostname" == stateOverride) { - break loop; - } - } else if (EOF == c || "/" == c || "\\" == c || "?" == c || "#" == c) { - this._host = IDNAToASCII.call(this, buffer); - buffer = ""; - state = "relative path start"; - if (stateOverride) { - break loop; - } - continue; - } else if ("\t" != c && "\n" != c && "\r" != c) { - if ("[" == c) { - seenBracket = true; - } else if ("]" == c) { - seenBracket = false; - } - buffer += c; - } else { - err("Invalid code point in host/hostname: " + c); - } - break; - - case "port": - if (/[0-9]/.test(c)) { - buffer += c; - } else if (EOF == c || "/" == c || "\\" == c || "?" == c || "#" == c || stateOverride) { - if ("" != buffer) { - var temp = parseInt(buffer, 10); - if (temp != relative[this._scheme]) { - this._port = temp + ""; - } - buffer = ""; - } - if (stateOverride) { - break loop; - } - state = "relative path start"; - continue; - } else if ("\t" == c || "\n" == c || "\r" == c) { - err("Invalid code point in port: " + c); - } else { - invalid.call(this); - } - break; - - case "relative path start": - if ("\\" == c) err("'\\' not allowed in path."); - state = "relative path"; - if ("/" != c && "\\" != c) { - continue; - } - break; - - case "relative path": - if (EOF == c || "/" == c || "\\" == c || !stateOverride && ("?" == c || "#" == c)) { - if ("\\" == c) { - err("\\ not allowed in relative path."); - } - var tmp; - if (tmp = relativePathDotMapping[buffer.toLowerCase()]) { - buffer = tmp; - } - if (".." == buffer) { - this._path.pop(); - if ("/" != c && "\\" != c) { - this._path.push(""); - } - } else if ("." == buffer && "/" != c && "\\" != c) { - this._path.push(""); - } else if ("." != buffer) { - if ("file" == this._scheme && this._path.length == 0 && buffer.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == "|") { - buffer = buffer[0] + ":"; - } - this._path.push(buffer); - } - buffer = ""; - if ("?" == c) { - this._query = "?"; - state = "query"; - } else if ("#" == c) { - this._fragment = "#"; - state = "fragment"; - } - } else if ("\t" != c && "\n" != c && "\r" != c) { - buffer += percentEscape(c); - } - break; - - case "query": - if (!stateOverride && "#" == c) { - this._fragment = "#"; - state = "fragment"; - } else if (EOF != c && "\t" != c && "\n" != c && "\r" != c) { - this._query += percentEscapeQuery(c); - } - break; - - case "fragment": - if (EOF != c && "\t" != c && "\n" != c && "\r" != c) { - this._fragment += c; - } - break; - } - cursor++; - } - } - function clear() { - this._scheme = ""; - this._schemeData = ""; - this._username = ""; - this._password = null; - this._host = ""; - this._port = ""; - this._path = []; - this._query = ""; - this._fragment = ""; - this._isInvalid = false; - this._isRelative = false; - } - function jURL(url, base) { - if (base !== undefined && !(base instanceof jURL)) base = new jURL(String(base)); - this._url = url; - clear.call(this); - var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, ""); - parse.call(this, input, null, base); - } - jURL.prototype = { - toString: function() { - return this.href; - }, - get href() { - if (this._isInvalid) return this._url; - var authority = ""; - if ("" != this._username || null != this._password) { - authority = this._username + (null != this._password ? ":" + this._password : "") + "@"; - } - return this.protocol + (this._isRelative ? "//" + authority + this.host : "") + this.pathname + this._query + this._fragment; - }, - set href(href) { - clear.call(this); - parse.call(this, href); - }, - get protocol() { - return this._scheme + ":"; - }, - set protocol(protocol) { - if (this._isInvalid) return; - parse.call(this, protocol + ":", "scheme start"); - }, - get host() { - return this._isInvalid ? "" : this._port ? this._host + ":" + this._port : this._host; - }, - set host(host) { - if (this._isInvalid || !this._isRelative) return; - parse.call(this, host, "host"); - }, - get hostname() { - return this._host; - }, - set hostname(hostname) { - if (this._isInvalid || !this._isRelative) return; - parse.call(this, hostname, "hostname"); - }, - get port() { - return this._port; - }, - set port(port) { - if (this._isInvalid || !this._isRelative) return; - parse.call(this, port, "port"); - }, - get pathname() { - return this._isInvalid ? "" : this._isRelative ? "/" + this._path.join("/") : this._schemeData; - }, - set pathname(pathname) { - if (this._isInvalid || !this._isRelative) return; - this._path = []; - parse.call(this, pathname, "relative path start"); - }, - get search() { - return this._isInvalid || !this._query || "?" == this._query ? "" : this._query; - }, - set search(search) { - if (this._isInvalid || !this._isRelative) return; - this._query = "?"; - if ("?" == search[0]) search = search.slice(1); - parse.call(this, search, "query"); - }, - get hash() { - return this._isInvalid || !this._fragment || "#" == this._fragment ? "" : this._fragment; - }, - set hash(hash) { - if (this._isInvalid) return; - this._fragment = "#"; - if ("#" == hash[0]) hash = hash.slice(1); - parse.call(this, hash, "fragment"); - }, - get origin() { - var host; - if (this._isInvalid || !this._scheme) { - return ""; - } - switch (this._scheme) { - case "data": - case "file": - case "javascript": - case "mailto": - return "null"; - } - host = this.host; - if (!host) { - return ""; - } - return this._scheme + "://" + host; - } - }; - var OriginalURL = scope.URL; - if (OriginalURL) { - jURL.createObjectURL = function(blob) { - return OriginalURL.createObjectURL.apply(OriginalURL, arguments); - }; - jURL.revokeObjectURL = function(url) { - OriginalURL.revokeObjectURL(url); - }; - } - scope.URL = jURL; -})(self); +@license @nocompile +Copyright (c) 2018 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 +*/ +(function(){/* -if (typeof WeakMap === "undefined") { - (function() { - var defineProperty = Object.defineProperty; - var counter = Date.now() % 1e9; - var WeakMap = function() { - this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__"); - }; - WeakMap.prototype = { - set: function(key, value) { - var entry = key[this.name]; - if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, { - value: [ key, value ], - writable: true - }); - return this; - }, - get: function(key) { - var entry; - return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined; - }, - "delete": function(key) { - var entry = key[this.name]; - if (!entry || entry[0] !== key) return false; - entry[0] = entry[1] = undefined; - return true; - }, - has: function(key) { - var entry = key[this.name]; - if (!entry) return false; - return entry[0] === key; - } - }; - window.WeakMap = WeakMap; - })(); -} + Copyright (c) 2016 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 +*/ +'use strict';var p,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ea="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;function ha(){ha=function(){};ea.Symbol||(ea.Symbol=ia)}var ia=function(){var a=0;return function(b){return"jscomp_symbol_"+(b||"")+a++}}(); +function ja(){ha();var a=ea.Symbol.iterator;a||(a=ea.Symbol.iterator=ea.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ka(this)}});ja=function(){}}function ka(a){var b=0;return la(function(){return b\x20\t\r\n\f]+)/i.exec(b)||["",""])[1].toLowerCase()];if(c)for(var d= +0;d"+b+"";V.body.innerHTML=b;for(a.C(V);this.content.firstChild;)k.call(this.content,this.content.firstChild);b=V.body;if(c)for(d=0;d"+this.innerHTML+""},set:function(a){if(this.parentNode){V.body.innerHTML=a;for(a=this.ownerDocument.createDocumentFragment();V.body.firstChild;)l.call(a, +V.body.firstChild);m.call(this.parentNode,a,this)}else throw Error("Failed to set the 'outerHTML' property on 'Element': This element has no parent node.");},configurable:!0})};T(a.prototype);da(a.prototype);a.C=function(c){c=b(c,"template");for(var d=0,e=c.length,f;d]/g,Lc=function(a){switch(a){case "&":return"&";case "<":return"<";case ">":return">";case '"':return""";case "\u00a0":return" "}};ca=function(a){for(var b={},c=0;c";break a;case Node.TEXT_NODE:g=g.data;g=k&&uf[k.localName]?g:g.replace(Kc,Lc); +break a;case Node.COMMENT_NODE:g="\x3c!--"+g.data+"--\x3e";break a;default:throw window.console.error(g),Error("not implemented");}}c+=g}return c}}if(c||rb){a.a=function(a,b){var c=f.call(a,!1);this.I&&this.I(c);b&&(l.call(c.content,f.call(a.content,!0)),tb(c.content,a.content));return c};var tb=function(c,d){if(d.querySelectorAll&&(d=b(d,"template"),0!==d.length)){c=b(c,"template");for(var e=0,f=c.length,h,g;e 0) { - var lastRecord = records[length - 1]; - var recordToReplaceLast = selectRecord(lastRecord, record); - if (recordToReplaceLast) { - records[length - 1] = recordToReplaceLast; - return; - } - } else { - scheduleCallback(this.observer); - } - records[length] = record; - }, - addListeners: function() { - this.addListeners_(this.target); - }, - addListeners_: function(node) { - var options = this.options; - if (options.attributes) node.addEventListener("DOMAttrModified", this, true); - if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true); - if (options.childList) node.addEventListener("DOMNodeInserted", this, true); - if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true); - }, - removeListeners: function() { - this.removeListeners_(this.target); - }, - removeListeners_: function(node) { - var options = this.options; - if (options.attributes) node.removeEventListener("DOMAttrModified", this, true); - if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true); - if (options.childList) node.removeEventListener("DOMNodeInserted", this, true); - if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true); - }, - addTransientObserver: function(node) { - if (node === this.target) return; - this.addListeners_(node); - this.transientObservedNodes.push(node); - var registrations = registrationsTable.get(node); - if (!registrations) registrationsTable.set(node, registrations = []); - registrations.push(this); - }, - removeTransientObservers: function() { - var transientObservedNodes = this.transientObservedNodes; - this.transientObservedNodes = []; - transientObservedNodes.forEach(function(node) { - this.removeListeners_(node); - var registrations = registrationsTable.get(node); - for (var i = 0; i < registrations.length; i++) { - if (registrations[i] === this) { - registrations.splice(i, 1); - break; - } - } - }, this); - }, - handleEvent: function(e) { - e.stopImmediatePropagation(); - switch (e.type) { - case "DOMAttrModified": - var name = e.attrName; - var namespace = e.relatedNode.namespaceURI; - var target = e.target; - var record = new getRecord("attributes", target); - record.attributeName = name; - record.attributeNamespace = namespace; - var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue; - forEachAncestorAndObserverEnqueueRecord(target, function(options) { - if (!options.attributes) return; - if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) { - return; - } - if (options.attributeOldValue) return getRecordWithOldValue(oldValue); - return record; - }); - break; - - case "DOMCharacterDataModified": - var target = e.target; - var record = getRecord("characterData", target); - var oldValue = e.prevValue; - forEachAncestorAndObserverEnqueueRecord(target, function(options) { - if (!options.characterData) return; - if (options.characterDataOldValue) return getRecordWithOldValue(oldValue); - return record; - }); - break; - - case "DOMNodeRemoved": - this.addTransientObserver(e.target); +Copyright (c) 2017 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 +*/ +window.Promise||(window.Promise=u,u.prototype["catch"]=u.prototype.a,u.prototype.then=u.prototype.then,u.all=jb,u.race=kb,u.resolve=Sa,u.reject=lb);(function(a){function b(a,b){if("function"===typeof window.CustomEvent)return new CustomEvent(a,b);var c=document.createEvent("CustomEvent");c.initCustomEvent(a,!!b.bubbles,!!b.cancelable,b.detail);return c}function c(a){if(C)return a.ownerDocument!==document?a.ownerDocument:null;var b=a.__importDoc;if(!b&&a.parentNode){b=a.parentNode;if("function"===typeof b.closest)b=b.closest("link[rel=import]");else for(;!g(b)&&(b=b.parentNode););a.__importDoc=b}return b}function d(a){var b=m(document,"link[rel=import]:not([import-dependency])"), +c=b.length;c?n(b,function(b){return h(b,function(){0===--c&&a()})}):a()}function e(a){function b(){"loading"!==document.readyState&&document.body&&(document.removeEventListener("readystatechange",b),a())}document.addEventListener("readystatechange",b);b()}function f(a){e(function(){return d(function(){return a&&a()})})}function h(a,b){if(a.__loaded)b&&b();else if("script"===a.localName&&!a.src||"style"===a.localName&&!a.firstChild)a.__loaded=!0,b&&b();else{var c=function(d){a.removeEventListener(d.type, +c);a.__loaded=!0;b&&b()};a.addEventListener("load",c);oa&&"style"===a.localName||a.addEventListener("error",c)}}function g(a){return a.nodeType===Node.ELEMENT_NODE&&"link"===a.localName&&"import"===a.rel}function k(){var a=this;this.a={};this.b=0;this.c=new MutationObserver(function(b){return a.Va(b)});this.c.observe(document.head,{childList:!0,subtree:!0});this.loadImports(document)}function l(a){n(m(a,"template"),function(a){n(m(a.content,'script:not([type]),script[type="application/javascript"],script[type="text/javascript"],script[type="module"]'), +function(a){var b=document.createElement("script");n(a.attributes,function(a){return b.setAttribute(a.name,a.value)});b.textContent=a.textContent;a.parentNode.replaceChild(b,a)});l(a.content)})}function m(a,b){return a.childNodes.length?a.querySelectorAll(b):ba}function n(a,b,c){var d=a?a.length:0,e=c?-1:1;for(c=c?d-1:0;c]*)(rel=['|"]?stylesheet['|"]?[^>]*>)/g,D={Pa:function(a,b){a.href&&a.setAttribute("href",D.ba(a.getAttribute("href"),b));a.src&&a.setAttribute("src",D.ba(a.getAttribute("src"),b));if("style"===a.localName){var c=D.za(a.textContent,b,qb);a.textContent=D.za(c,b,rb)}},za:function(a,b,c){return a.replace(c, +function(a,c,d,e){a=d.replace(/["']/g,"");b&&(a=D.ba(a,b));return c+"'"+a+"'"+e})},ba:function(a,b){if(void 0===D.ha){D.ha=!1;try{var c=new URL("b","http://a");c.pathname="c%20d";D.ha="http://a/c%20d"===c.href}catch(Kc){}}if(D.ha)return(new URL(a,b)).href;c=D.Ha;c||(c=document.implementation.createHTMLDocument("temp"),D.Ha=c,c.ra=c.createElement("base"),c.head.appendChild(c.ra),c.qa=c.createElement("a"));c.ra.href=b;c.qa.href=a;return c.qa.href||a}},ca={async:!0,load:function(a,b,c){if(a)if(a.match(/^data:/)){a= +a.split(",");var d=a[1];d=-1e.status?b(d,a):c(d)};e.send()}else c("error: href must be specified")}},oa=/Trident/.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent); +k.prototype.loadImports=function(a){var b=this;a=m(a,"link[rel=import]");n(a,function(a){return b.o(a)})};k.prototype.o=function(a){var b=this,c=a.href;if(void 0!==this.a[c]){var d=this.a[c];d&&d.__loaded&&(a.__import=d,this.i(a))}else this.b++,this.a[c]="pending",ca.load(c,function(a,d){a=b.Wa(a,d||c);b.a[c]=a;b.b--;b.loadImports(a);b.J()},function(){b.a[c]=null;b.b--;b.J()})};k.prototype.Wa=function(a,b){if(!a)return document.createDocumentFragment();oa&&(a=a.replace(V,function(a,b,c){return-1=== +a.indexOf("type=")?b+" type=import-disable "+c:a}));var c=document.createElement("template");c.innerHTML=a;if(c.content)a=c.content,l(a);else for(a=document.createDocumentFragment();c.firstChild;)a.appendChild(c.firstChild);if(c=a.querySelector("base"))b=D.ba(c.getAttribute("href"),b),c.removeAttribute("href");c=m(a,'link[rel=import],link[rel=stylesheet][href][type=import-disable],style:not([type]),link[rel=stylesheet][href]:not([type]),script:not([type]),script[type="application/javascript"],script[type="text/javascript"],script[type="module"]'); +var d=0;n(c,function(a){h(a);D.Pa(a,b);a.setAttribute("import-dependency","");if("script"===a.localName&&!a.src&&a.textContent){if("module"===a.type)throw Error("Inline module scripts are not supported in HTML Imports.");a.setAttribute("src","data:text/javascript;charset=utf-8,"+encodeURIComponent(a.textContent+("\n//# sourceURL="+b+(d?"-"+d:"")+".js\n")));a.textContent="";d++}});return a};k.prototype.J=function(){var a=this;if(!this.b){this.c.disconnect();this.flatten(document);var b=!1,c=!1,d=function(){c&& +b&&(a.loadImports(document),a.b||(a.c.observe(document.head,{childList:!0,subtree:!0}),a.Ta()))};this.Ya(function(){c=!0;d()});this.Xa(function(){b=!0;d()})}};k.prototype.flatten=function(a){var b=this;a=m(a,"link[rel=import]");n(a,function(a){var c=b.a[a.href];(a.__import=c)&&c.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(b.a[a.href]=a,a.readyState="loading",a.__import=a,b.flatten(c),a.appendChild(c))})};k.prototype.Xa=function(a){function b(e){if(e]/g; - function escapeReplace(c) { - switch (c) { - case "&": - return "&"; - - case "<": - return "<"; - - case ">": - return ">"; - - case " ": - return " "; - } - } - function escapeData(s) { - return s.replace(escapeDataRegExp, escapeReplace); - } - } - if (needsTemplate || needsCloning) { - var nativeCloneNode = Node.prototype.cloneNode; - TemplateImpl.cloneNode = function(template, deep) { - var clone = nativeCloneNode.call(template, false); - if (this.decorate) { - this.decorate(clone); - } - if (deep) { - clone.content.appendChild(nativeCloneNode.call(template.content, true)); - this.fixClonedDom(clone.content, template.content); - } - return clone; - }; - TemplateImpl.fixClonedDom = function(clone, source) { - if (!source.querySelectorAll) return; - var s$ = source.querySelectorAll(TEMPLATE_TAG); - var t$ = clone.querySelectorAll(TEMPLATE_TAG); - for (var i = 0, l = t$.length, t, s; i < l; i++) { - s = s$[i]; - t = t$[i]; - if (this.decorate) { - this.decorate(s); - } - t.parentNode.replaceChild(s.cloneNode(true), t); - } - }; - var originalImportNode = document.importNode; - Node.prototype.cloneNode = function(deep) { - var dom = nativeCloneNode.call(this, deep); - if (deep) { - TemplateImpl.fixClonedDom(dom, this); - } - return dom; - }; - document.importNode = function(element, deep) { - if (element.localName === TEMPLATE_TAG) { - return TemplateImpl.cloneNode(element, deep); - } else { - var dom = originalImportNode.call(document, element, deep); - if (deep) { - TemplateImpl.fixClonedDom(dom, element); - } - return dom; - } - }; - if (needsCloning) { - HTMLTemplateElement.prototype.cloneNode = function(deep) { - return TemplateImpl.cloneNode(this, deep); - }; - } - } - if (needsTemplate) { - window.HTMLTemplateElement = TemplateImpl; - } -})(); - -(function(scope) { - "use strict"; - if (!(window.performance && window.performance.now)) { - var start = Date.now(); - window.performance = { - now: function() { - return Date.now() - start; - } - }; - } - if (!window.requestAnimationFrame) { - window.requestAnimationFrame = function() { - var nativeRaf = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame; - return nativeRaf ? function(callback) { - return nativeRaf(function() { - callback(performance.now()); - }); - } : function(callback) { - return window.setTimeout(callback, 1e3 / 60); - }; - }(); - } - if (!window.cancelAnimationFrame) { - window.cancelAnimationFrame = function() { - return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function(id) { - clearTimeout(id); - }; - }(); - } - var workingDefaultPrevented = function() { - var e = document.createEvent("Event"); - e.initEvent("foo", true, true); - e.preventDefault(); - return e.defaultPrevented; - }(); - if (!workingDefaultPrevented) { - var origPreventDefault = Event.prototype.preventDefault; - Event.prototype.preventDefault = function() { - if (!this.cancelable) { - return; - } - origPreventDefault.call(this); - Object.defineProperty(this, "defaultPrevented", { - get: function() { - return true; - }, - configurable: true - }); - }; - } - var isIE = /Trident/.test(navigator.userAgent); - if (!window.CustomEvent || isIE && typeof window.CustomEvent !== "function") { - window.CustomEvent = function(inType, params) { - params = params || {}; - var e = document.createEvent("CustomEvent"); - e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail); - return e; - }; - window.CustomEvent.prototype = window.Event.prototype; - } - if (!window.Event || isIE && typeof window.Event !== "function") { - var origEvent = window.Event; - window.Event = function(inType, params) { - params = params || {}; - var e = document.createEvent("Event"); - e.initEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable)); - return e; - }; - window.Event.prototype = origEvent.prototype; - } -})(window.WebComponents); - -window.HTMLImports = window.HTMLImports || { - flags: {} -}; + 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 +*/ +window.WebComponents=window.WebComponents||{flags:{}};var mb=document.querySelector('script[src*="webcomponents-lite.js"]'),nb=/wc-(.+)/,v={};if(!v.noOpts){location.search.slice(1).split("&").forEach(function(a){a=a.split("=");var b;a[0]&&(b=a[0].match(nb))&&(v[b[1]]=a[1]||!0)});if(mb)for(var ob=0,pb;pb=mb.attributes[ob];ob++)"src"!==pb.name&&(v[pb.name]=pb.value||!0);if(v.log&&v.log.split){var ub=v.log.split(",");v.log={};ub.forEach(function(a){v.log[a]=!0})}else v.log={}} +window.WebComponents.flags=v;var vb=v.shadydom;vb&&(window.ShadyDOM=window.ShadyDOM||{},window.ShadyDOM.force=vb);var wb=v.register||v.ce;wb&&window.customElements&&(window.customElements.forcePolyfill=wb);/* -(function(scope) { - var IMPORT_LINK_TYPE = "import"; - var useNative = Boolean(IMPORT_LINK_TYPE in document.createElement("link")); - var hasShadowDOMPolyfill = Boolean(window.ShadowDOMPolyfill); - var wrap = function(node) { - return hasShadowDOMPolyfill ? window.ShadowDOMPolyfill.wrapIfNeeded(node) : node; - }; - var rootDocument = wrap(document); - var currentScriptDescriptor = { - get: function() { - var script = window.HTMLImports.currentScript || document.currentScript || (document.readyState !== "complete" ? document.scripts[document.scripts.length - 1] : null); - return wrap(script); - }, - configurable: true - }; - Object.defineProperty(document, "_currentScript", currentScriptDescriptor); - Object.defineProperty(rootDocument, "_currentScript", currentScriptDescriptor); - var isIE = /Trident/.test(navigator.userAgent); - function whenReady(callback, doc) { - doc = doc || rootDocument; - whenDocumentReady(function() { - watchImportsLoad(callback, doc); - }, doc); - } - var requiredReadyState = isIE ? "complete" : "interactive"; - var READY_EVENT = "readystatechange"; - function isDocumentReady(doc) { - return doc.readyState === "complete" || doc.readyState === requiredReadyState; - } - function whenDocumentReady(callback, doc) { - if (!isDocumentReady(doc)) { - var checkReady = function() { - if (doc.readyState === "complete" || doc.readyState === requiredReadyState) { - doc.removeEventListener(READY_EVENT, checkReady); - whenDocumentReady(callback, doc); - } - }; - doc.addEventListener(READY_EVENT, checkReady); - } else if (callback) { - callback(); - } - } - function markTargetLoaded(event) { - event.target.__loaded = true; - } - function watchImportsLoad(callback, doc) { - var imports = doc.querySelectorAll("link[rel=import]"); - var parsedCount = 0, importCount = imports.length, newImports = [], errorImports = []; - function checkDone() { - if (parsedCount == importCount && callback) { - callback({ - allImports: imports, - loadedImports: newImports, - errorImports: errorImports - }); - } - } - function loadedImport(e) { - markTargetLoaded(e); - newImports.push(this); - parsedCount++; - checkDone(); - } - function errorLoadingImport(e) { - errorImports.push(this); - parsedCount++; - checkDone(); - } - if (importCount) { - for (var i = 0, imp; i < importCount && (imp = imports[i]); i++) { - if (isImportLoaded(imp)) { - newImports.push(this); - parsedCount++; - checkDone(); - } else { - imp.addEventListener("load", loadedImport); - imp.addEventListener("error", errorLoadingImport); - } - } - } else { - checkDone(); - } - } - function isImportLoaded(link) { - return useNative ? link.__loaded || link.import && link.import.readyState !== "loading" : link.__importParsed; - } - if (useNative) { - new MutationObserver(function(mxns) { - for (var i = 0, l = mxns.length, m; i < l && (m = mxns[i]); i++) { - if (m.addedNodes) { - handleImports(m.addedNodes); - } - } - }).observe(document.head, { - childList: true - }); - function handleImports(nodes) { - for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) { - if (isImport(n)) { - handleImport(n); - } - } - } - function isImport(element) { - return element.localName === "link" && element.rel === "import"; - } - function handleImport(element) { - var loaded = element.import; - if (loaded) { - markTargetLoaded({ - target: element - }); - } else { - element.addEventListener("load", markTargetLoaded); - element.addEventListener("error", markTargetLoaded); - } - } - (function() { - if (document.readyState === "loading") { - var imports = document.querySelectorAll("link[rel=import]"); - for (var i = 0, l = imports.length, imp; i < l && (imp = imports[i]); i++) { - handleImport(imp); - } - } - })(); - } - whenReady(function(detail) { - window.HTMLImports.ready = true; - window.HTMLImports.readyTime = new Date().getTime(); - var evt = rootDocument.createEvent("CustomEvent"); - evt.initCustomEvent("HTMLImportsLoaded", true, true, detail); - rootDocument.dispatchEvent(evt); - }); - scope.IMPORT_LINK_TYPE = IMPORT_LINK_TYPE; - scope.useNative = useNative; - scope.rootDocument = rootDocument; - scope.whenReady = whenReady; - scope.isIE = isIE; -})(window.HTMLImports); - -(function(scope) { - var modules = []; - var addModule = function(module) { - modules.push(module); - }; - var initializeModules = function() { - modules.forEach(function(module) { - module(scope); - }); - }; - scope.addModule = addModule; - scope.initializeModules = initializeModules; -})(window.HTMLImports); - -window.HTMLImports.addModule(function(scope) { - var CSS_URL_REGEXP = /(url\()([^)]*)(\))/g; - var CSS_IMPORT_REGEXP = /(@import[\s]+(?!url\())([^;]*)(;)/g; - var path = { - resolveUrlsInStyle: function(style, linkUrl) { - var doc = style.ownerDocument; - var resolver = doc.createElement("a"); - style.textContent = this.resolveUrlsInCssText(style.textContent, linkUrl, resolver); - return style; - }, - resolveUrlsInCssText: function(cssText, linkUrl, urlObj) { - var r = this.replaceUrls(cssText, urlObj, linkUrl, CSS_URL_REGEXP); - r = this.replaceUrls(r, urlObj, linkUrl, CSS_IMPORT_REGEXP); - return r; - }, - replaceUrls: function(text, urlObj, linkUrl, regexp) { - return text.replace(regexp, function(m, pre, url, post) { - var urlPath = url.replace(/["']/g, ""); - if (linkUrl) { - urlPath = new URL(urlPath, linkUrl).href; - } - urlObj.href = urlPath; - urlPath = urlObj.href; - return pre + "'" + urlPath + "'" + post; - }); - } - }; - scope.path = path; -}); - -window.HTMLImports.addModule(function(scope) { - var xhr = { - async: true, - ok: function(request) { - return request.status >= 200 && request.status < 300 || request.status === 304 || request.status === 0; - }, - load: function(url, next, nextContext) { - var request = new XMLHttpRequest(); - if (scope.flags.debug || scope.flags.bust) { - url += "?" + Math.random(); - } - request.open("GET", url, xhr.async); - request.addEventListener("readystatechange", function(e) { - if (request.readyState === 4) { - var redirectedUrl = null; - try { - var locationHeader = request.getResponseHeader("Location"); - if (locationHeader) { - redirectedUrl = locationHeader.substr(0, 1) === "/" ? location.origin + locationHeader : locationHeader; - } - } catch (e) { - console.error(e.message); - } - next.call(nextContext, !xhr.ok(request) && request, request.response || request.responseText, redirectedUrl); - } - }); - request.send(); - return request; - }, - loadDocument: function(url, next, nextContext) { - this.load(url, next, nextContext).responseType = "document"; - } - }; - scope.xhr = xhr; -}); - -window.HTMLImports.addModule(function(scope) { - var xhr = scope.xhr; - var flags = scope.flags; - var Loader = function(onLoad, onComplete) { - this.cache = {}; - this.onload = onLoad; - this.oncomplete = onComplete; - this.inflight = 0; - this.pending = {}; - }; - Loader.prototype = { - addNodes: function(nodes) { - this.inflight += nodes.length; - for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) { - this.require(n); - } - this.checkDone(); - }, - addNode: function(node) { - this.inflight++; - this.require(node); - this.checkDone(); - }, - require: function(elt) { - var url = elt.src || elt.href; - elt.__nodeUrl = url; - if (!this.dedupe(url, elt)) { - this.fetch(url, elt); - } - }, - dedupe: function(url, elt) { - if (this.pending[url]) { - this.pending[url].push(elt); - return true; - } - var resource; - if (this.cache[url]) { - this.onload(url, elt, this.cache[url]); - this.tail(); - return true; - } - this.pending[url] = [ elt ]; - return false; - }, - fetch: function(url, elt) { - flags.load && console.log("fetch", url, elt); - if (!url) { - setTimeout(function() { - this.receive(url, elt, { - error: "href must be specified" - }, null); - }.bind(this), 0); - } else if (url.match(/^data:/)) { - var pieces = url.split(","); - var header = pieces[0]; - var body = pieces[1]; - if (header.indexOf(";base64") > -1) { - body = atob(body); - } else { - body = decodeURIComponent(body); - } - setTimeout(function() { - this.receive(url, elt, null, body); - }.bind(this), 0); - } else { - var receiveXhr = function(err, resource, redirectedUrl) { - this.receive(url, elt, err, resource, redirectedUrl); - }.bind(this); - xhr.load(url, receiveXhr); - } - }, - receive: function(url, elt, err, resource, redirectedUrl) { - this.cache[url] = resource; - var $p = this.pending[url]; - for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) { - this.onload(url, p, resource, err, redirectedUrl); - this.tail(); - } - this.pending[url] = null; - }, - tail: function() { - --this.inflight; - this.checkDone(); - }, - checkDone: function() { - if (!this.inflight) { - this.oncomplete(); - } - } - }; - scope.Loader = Loader; -}); - -window.HTMLImports.addModule(function(scope) { - var Observer = function(addCallback) { - this.addCallback = addCallback; - this.mo = new MutationObserver(this.handler.bind(this)); - }; - Observer.prototype = { - handler: function(mutations) { - for (var i = 0, l = mutations.length, m; i < l && (m = mutations[i]); i++) { - if (m.type === "childList" && m.addedNodes.length) { - this.addedNodes(m.addedNodes); - } - } - }, - addedNodes: function(nodes) { - if (this.addCallback) { - this.addCallback(nodes); - } - for (var i = 0, l = nodes.length, n, loading; i < l && (n = nodes[i]); i++) { - if (n.children && n.children.length) { - this.addedNodes(n.children); - } - } - }, - observe: function(root) { - this.mo.observe(root, { - childList: true, - subtree: true - }); - } - }; - scope.Observer = Observer; -}); - -window.HTMLImports.addModule(function(scope) { - var path = scope.path; - var rootDocument = scope.rootDocument; - var flags = scope.flags; - var isIE = scope.isIE; - var IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE; - var IMPORT_SELECTOR = "link[rel=" + IMPORT_LINK_TYPE + "]"; - var importParser = { - documentSelectors: IMPORT_SELECTOR, - importsSelectors: [ IMPORT_SELECTOR, "link[rel=stylesheet]:not([type])", "style:not([type])", "script:not([type])", 'script[type="application/javascript"]', 'script[type="text/javascript"]' ].join(","), - map: { - link: "parseLink", - script: "parseScript", - style: "parseStyle" - }, - dynamicElements: [], - parseNext: function() { - var next = this.nextToParse(); - if (next) { - this.parse(next); - } - }, - parse: function(elt) { - if (this.isParsed(elt)) { - flags.parse && console.log("[%s] is already parsed", elt.localName); - return; - } - var fn = this[this.map[elt.localName]]; - if (fn) { - this.markParsing(elt); - fn.call(this, elt); - } - }, - parseDynamic: function(elt, quiet) { - this.dynamicElements.push(elt); - if (!quiet) { - this.parseNext(); - } - }, - markParsing: function(elt) { - flags.parse && console.log("parsing", elt); - this.parsingElement = elt; - }, - markParsingComplete: function(elt) { - elt.__importParsed = true; - this.markDynamicParsingComplete(elt); - if (elt.__importElement) { - elt.__importElement.__importParsed = true; - this.markDynamicParsingComplete(elt.__importElement); - } - this.parsingElement = null; - flags.parse && console.log("completed", elt); - }, - markDynamicParsingComplete: function(elt) { - var i = this.dynamicElements.indexOf(elt); - if (i >= 0) { - this.dynamicElements.splice(i, 1); - } - }, - parseImport: function(elt) { - elt.import = elt.__doc; - if (window.HTMLImports.__importsParsingHook) { - window.HTMLImports.__importsParsingHook(elt); - } - if (elt.import) { - elt.import.__importParsed = true; - } - this.markParsingComplete(elt); - if (elt.__resource && !elt.__error) { - elt.dispatchEvent(new CustomEvent("load", { - bubbles: false - })); - } else { - elt.dispatchEvent(new CustomEvent("error", { - bubbles: false - })); - } - if (elt.__pending) { - var fn; - while (elt.__pending.length) { - fn = elt.__pending.shift(); - if (fn) { - fn({ - target: elt - }); - } - } - } - this.parseNext(); - }, - parseLink: function(linkElt) { - if (nodeIsImport(linkElt)) { - this.parseImport(linkElt); - } else { - linkElt.href = linkElt.href; - this.parseGeneric(linkElt); - } - }, - parseStyle: function(elt) { - var src = elt; - elt = cloneStyle(elt); - src.__appliedElement = elt; - elt.__importElement = src; - this.parseGeneric(elt); - }, - parseGeneric: function(elt) { - this.trackElement(elt); - this.addElementToDocument(elt); - }, - rootImportForElement: function(elt) { - var n = elt; - while (n.ownerDocument.__importLink) { - n = n.ownerDocument.__importLink; - } - return n; - }, - addElementToDocument: function(elt) { - var port = this.rootImportForElement(elt.__importElement || elt); - port.parentNode.insertBefore(elt, port); - }, - trackElement: function(elt, callback) { - var self = this; - var done = function(e) { - elt.removeEventListener("load", done); - elt.removeEventListener("error", done); - if (callback) { - callback(e); - } - self.markParsingComplete(elt); - self.parseNext(); - }; - elt.addEventListener("load", done); - elt.addEventListener("error", done); - if (isIE && elt.localName === "style") { - var fakeLoad = false; - if (elt.textContent.indexOf("@import") == -1) { - fakeLoad = true; - } else if (elt.sheet) { - fakeLoad = true; - var csr = elt.sheet.cssRules; - var len = csr ? csr.length : 0; - for (var i = 0, r; i < len && (r = csr[i]); i++) { - if (r.type === CSSRule.IMPORT_RULE) { - fakeLoad = fakeLoad && Boolean(r.styleSheet); - } - } - } - if (fakeLoad) { - setTimeout(function() { - elt.dispatchEvent(new CustomEvent("load", { - bubbles: false - })); - }); - } - } - }, - parseScript: function(scriptElt) { - var script = document.createElement("script"); - script.__importElement = scriptElt; - script.src = scriptElt.src ? scriptElt.src : generateScriptDataUrl(scriptElt); - scope.currentScript = scriptElt; - this.trackElement(script, function(e) { - if (script.parentNode) { - script.parentNode.removeChild(script); - } - scope.currentScript = null; - }); - this.addElementToDocument(script); - }, - nextToParse: function() { - this._mayParse = []; - return !this.parsingElement && (this.nextToParseInDoc(rootDocument) || this.nextToParseDynamic()); - }, - nextToParseInDoc: function(doc, link) { - if (doc && this._mayParse.indexOf(doc) < 0) { - this._mayParse.push(doc); - var nodes = doc.querySelectorAll(this.parseSelectorsForNode(doc)); - for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) { - if (!this.isParsed(n)) { - if (this.hasResource(n)) { - return nodeIsImport(n) ? this.nextToParseInDoc(n.__doc, n) : n; - } else { - return; - } - } - } - } - return link; - }, - nextToParseDynamic: function() { - return this.dynamicElements[0]; - }, - parseSelectorsForNode: function(node) { - var doc = node.ownerDocument || node; - return doc === rootDocument ? this.documentSelectors : this.importsSelectors; - }, - isParsed: function(node) { - return node.__importParsed; - }, - needsDynamicParsing: function(elt) { - return this.dynamicElements.indexOf(elt) >= 0; - }, - hasResource: function(node) { - if (nodeIsImport(node) && node.__doc === undefined) { - return false; - } - return true; - } - }; - function nodeIsImport(elt) { - return elt.localName === "link" && elt.rel === IMPORT_LINK_TYPE; - } - function generateScriptDataUrl(script) { - var scriptContent = generateScriptContent(script); - return "data:text/javascript;charset=utf-8," + encodeURIComponent(scriptContent); - } - function generateScriptContent(script) { - return script.textContent + generateSourceMapHint(script); - } - function generateSourceMapHint(script) { - var owner = script.ownerDocument; - owner.__importedScripts = owner.__importedScripts || 0; - var moniker = script.ownerDocument.baseURI; - var num = owner.__importedScripts ? "-" + owner.__importedScripts : ""; - owner.__importedScripts++; - return "\n//# sourceURL=" + moniker + num + ".js\n"; - } - function cloneStyle(style) { - var clone = style.ownerDocument.createElement("style"); - clone.textContent = style.textContent; - path.resolveUrlsInStyle(clone); - return clone; - } - scope.parser = importParser; - scope.IMPORT_SELECTOR = IMPORT_SELECTOR; -}); +Copyright (c) 2016 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 +*/ +function xb(){this.ya=this.root=null;this.Z=!1;this.D=this.U=this.la=this.assignedSlot=this.assignedNodes=this.K=null;this.childNodes=this.nextSibling=this.previousSibling=this.lastChild=this.firstChild=this.parentNode=this.N=void 0;this.Da=this.ta=!1;this.S={}}xb.prototype.toJSON=function(){return{}};function w(a){a.fa||(a.fa=new xb);return a.fa}function x(a){return a&&a.fa};var y=window.ShadyDOM||{};y.Ra=!(!Element.prototype.attachShadow||!Node.prototype.getRootNode);var yb=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild");y.w=!!(yb&&yb.configurable&&yb.get);y.na=y.force||!y.Ra;var zb=navigator.userAgent.match("Trident"),Ab=navigator.userAgent.match("Edge");void 0===y.Ba&&(y.Ba=y.w&&(zb||Ab));function Bb(a){return(a=x(a))&&void 0!==a.firstChild}function z(a){return"ShadyRoot"===a.La}function Cb(a){a=a.getRootNode();if(z(a))return a} +var Db=Element.prototype,Eb=Db.matches||Db.matchesSelector||Db.mozMatchesSelector||Db.msMatchesSelector||Db.oMatchesSelector||Db.webkitMatchesSelector;function Fb(a,b){if(a&&b)for(var c=Object.getOwnPropertyNames(b),d=0,e;d]/g;function uc(a){switch(a){case "&":return"&";case "<":return"<";case ">":return">";case '"':return""";case "\u00a0":return" "}}function vc(a){for(var b={},c=0;c";break a;case Node.TEXT_NODE:g=g.data;g=k&&xc[k.localName]?g:g.replace(tc,uc);break a;case Node.COMMENT_NODE:g="\x3c!--"+g.data+"--\x3e";break a;default:throw window.console.error(g), +Error("not implemented");}}c+=g}return c};var B={},E=document.createTreeWalker(document,NodeFilter.SHOW_ALL,null,!1),F=document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT,null,!1);function zc(a){var b=[];E.currentNode=a;for(a=E.firstChild();a;)b.push(a),a=E.nextSibling();return b}B.parentNode=function(a){E.currentNode=a;return E.parentNode()};B.firstChild=function(a){E.currentNode=a;return E.firstChild()};B.lastChild=function(a){E.currentNode=a;return E.lastChild()};B.previousSibling=function(a){E.currentNode=a;return E.previousSibling()}; +B.nextSibling=function(a){E.currentNode=a;return E.nextSibling()};B.childNodes=zc;B.parentElement=function(a){F.currentNode=a;return F.parentNode()};B.firstElementChild=function(a){F.currentNode=a;return F.firstChild()};B.lastElementChild=function(a){F.currentNode=a;return F.lastChild()};B.previousElementSibling=function(a){F.currentNode=a;return F.previousSibling()};B.nextElementSibling=function(a){F.currentNode=a;return F.nextSibling()}; +B.children=function(a){var b=[];F.currentNode=a;for(a=F.firstChild();a;)b.push(a),a=F.nextSibling();return Ob(b)};B.innerHTML=function(a){return yc(a,function(a){return zc(a)})};B.textContent=function(a){switch(a.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:a=document.createTreeWalker(a,NodeFilter.SHOW_TEXT,null,!1);for(var b="",c;c=a.nextNode();)b+=c.nodeValue;return b;default:return a.nodeValue}};var G={},Ac=y.w,Bc=[Node.prototype,Element.prototype,HTMLElement.prototype];function H(a){var b;a:{for(b=0;be.assignedNodes.length&&(e.Z=!0)}e.Z&&(e.Z=!1,Yd(this,c))}b=this.g;c=[];for(e=0;ec.indexOf(d))||c.push(d);for(b=0;b "+b}))}a=a.replace(Dg,function(a,b,c){return'[dir="'+c+'"] '+b+", "+b+'[dir="'+c+'"]'});return{value:a,Oa:b,stop:f}}function Bg(a,b){a=a.split(Eg);a[0]+=b;return a.join(Eg)} +function Ag(a,b){var c=a.match(Fg);return(c=c&&c[2].trim()||"")?c[0].match(Gg)?a.replace(Fg,function(a,c,f){return b+f}):c.split(Gg)[0]===b?c:Hg:a.replace(wg,b)}function Ig(a){a.selector===Jg&&(a.selector="html")}gg.prototype.c=function(a){return a.match(zg)?this.b(a,Kg):Bg(a.trim(),Kg)};ea.Object.defineProperties(gg.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"style-scope"}}}); +var ug=/:(nth[-\w]+)\(([^)]+)\)/,Kg=":not(.style-scope)",sg=",",xg=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g,Gg=/[[.:#*]/,wg=":host",Jg=":root",zg="::slotted",vg=new RegExp("^("+zg+")"),Fg=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Cg=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Dg=/(.*):dir\((?:(ltr|rtl))\)/,qg=".",Eg=":",kg="class",Hg="should_not_match",W=new gg;function Lg(a,b,c,d){this.B=a||null;this.b=b||null;this.oa=c||[];this.L=null;this.P=d||"";this.a=this.v=this.G=null}function X(a){return a?a.__styleInfo:null}function Mg(a,b){return a.__styleInfo=b}Lg.prototype.c=function(){return this.B};Lg.prototype._getStyleRules=Lg.prototype.c;function Ng(a){var b=this.matches||this.matchesSelector||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector;return b&&b.call(this,a)}var Og=navigator.userAgent.match("Trident");function Pg(){}function Qg(a){var b={},c=[],d=0;Yf(a,function(a){Rg(a);a.index=d++;a=a.m.cssText;for(var c;c=Sf.exec(a);){var e=c[1];":"!==c[2]&&(b[e]=!0)}},function(a){c.push(a)});a.b=c;a=[];for(var e in b)a.push(e);return a} +function Rg(a){if(!a.m){var b={},c={};Sg(a,c)&&(b.A=c,a.rules=null);b.cssText=a.parsedCssText.replace(Vf,"").replace(Qf,"");a.m=b}}function Sg(a,b){var c=a.m;if(c){if(c.A)return Object.assign(b,c.A),!0}else{c=a.parsedCssText;for(var d;a=Qf.exec(c);){d=(a[2]||a[3]).trim();if("inherit"!==d||"unset"!==d)b[a[1].trim()]=d;d=!0}return d}} +function Tg(a,b,c){b&&(b=0<=b.indexOf(";")?Ug(a,b,c):dg(b,function(b,e,f,h){if(!e)return b+h;(e=Tg(a,c[e],c))&&"initial"!==e?"apply-shim-inherit"===e&&(e="inherit"):e=Tg(a,c[f]||f,c)||f;return b+(e||"")+h}));return b&&b.trim()||""} +function Ug(a,b,c){b=b.split(";");for(var d=0,e,f;d *"===f||"html"===f,g=0===f.indexOf(":host")&&!h;"shady"===c&&(h=f===e+" > *."+e||-1!==f.indexOf("html"),g=!h&&0===f.indexOf(e));"shadow"===c&&(h=":host > *"===f||"html"===f,g=g&&!h);if(h||g)c=e,g&&(b.s||(b.s=rg(W,b,W.b,a?qg+a:"",e)),c=b.s||e),d({ab:c,Ua:g,ub:h})}} +function Xg(a,b){var c={},d={},e=b&&b.__cssBuild;Yf(b,function(b){Wg(a,b,e,function(e){Ng.call(a.lb||a,e.ab)&&(e.Ua?Sg(b,c):Sg(b,d))})},null,!0);return{$a:d,Sa:c}} +function Yg(a,b,c,d){var e=fg(b),f=pg(e.is,e.P),h=new RegExp("(?:^|[^.#[:])"+(b.extends?"\\"+f.slice(0,-1)+"\\]":f)+"($|[.:[\\s>+~])");e=X(b).B;var g=Zg(e,d);return ng(b,e,function(b){var e="";b.m||Rg(b);b.m.cssText&&(e=Ug(a,b.m.cssText,c));b.cssText=e;if(!S&&!$f(b)&&b.cssText){var k=e=b.cssText;null==b.wa&&(b.wa=Tf.test(e));if(b.wa)if(null==b.$){b.$=[];for(var n in g)k=g[n],k=k(e),e!==k&&(e=k,b.$.push(n))}else{for(n=0;n=l._useCount&&l.parentNode&&l.parentNode.removeChild(l));S?f.a?(f.a.textContent=e,d=f.a):e&&(d=ag(e,g,a.shadowRoot,f.b)):d?d.parentNode|| +(Og&&-1= 0) { - return; - } - processingDocuments.push(doc); - var imports = doc.querySelectorAll("link[rel=" + IMPORT_LINK_TYPE + "]"); - for (var i = 0, l = imports.length, n; i < l && (n = imports[i]); i++) { - if (n.import) { - _forDocumentTree(n.import, cb, processingDocuments); - } - } - cb(doc); - } - scope.forDocumentTree = forDocumentTree; - scope.forSubtree = forSubtree; -}); - -window.CustomElements.addModule(function(scope) { - var flags = scope.flags; - var forSubtree = scope.forSubtree; - var forDocumentTree = scope.forDocumentTree; - function addedNode(node, isAttached) { - return added(node, isAttached) || addedSubtree(node, isAttached); - } - function added(node, isAttached) { - if (scope.upgrade(node, isAttached)) { - return true; - } - if (isAttached) { - attached(node); - } - } - function addedSubtree(node, isAttached) { - forSubtree(node, function(e) { - if (added(e, isAttached)) { - return true; - } - }); - } - var hasThrottledAttached = window.MutationObserver._isPolyfilled && flags["throttle-attached"]; - scope.hasPolyfillMutations = hasThrottledAttached; - scope.hasThrottledAttached = hasThrottledAttached; - var isPendingMutations = false; - var pendingMutations = []; - function deferMutation(fn) { - pendingMutations.push(fn); - if (!isPendingMutations) { - isPendingMutations = true; - setTimeout(takeMutations); - } - } - function takeMutations() { - isPendingMutations = false; - var $p = pendingMutations; - for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) { - p(); - } - pendingMutations = []; - } - function attached(element) { - if (hasThrottledAttached) { - deferMutation(function() { - _attached(element); - }); - } else { - _attached(element); - } - } - function _attached(element) { - if (element.__upgraded__ && !element.__attached) { - element.__attached = true; - if (element.attachedCallback) { - element.attachedCallback(); - } - } - } - function detachedNode(node) { - detached(node); - forSubtree(node, function(e) { - detached(e); - }); - } - function detached(element) { - if (hasThrottledAttached) { - deferMutation(function() { - _detached(element); - }); - } else { - _detached(element); - } - } - function _detached(element) { - if (element.__upgraded__ && element.__attached) { - element.__attached = false; - if (element.detachedCallback) { - element.detachedCallback(); - } - } - } - function inDocument(element) { - var p = element; - var doc = window.wrap(document); - while (p) { - if (p == doc) { - return true; - } - p = p.parentNode || p.nodeType === Node.DOCUMENT_FRAGMENT_NODE && p.host; - } - } - function watchShadow(node) { - if (node.shadowRoot && !node.shadowRoot.__watched) { - flags.dom && console.log("watching shadow-root for: ", node.localName); - var root = node.shadowRoot; - while (root) { - observe(root); - root = root.olderShadowRoot; - } - } - } - function handler(root, mutations) { - if (flags.dom) { - var mx = mutations[0]; - if (mx && mx.type === "childList" && mx.addedNodes) { - if (mx.addedNodes) { - var d = mx.addedNodes[0]; - while (d && d !== document && !d.host) { - d = d.parentNode; - } - var u = d && (d.URL || d._URL || d.host && d.host.localName) || ""; - u = u.split("/?").shift().split("/").pop(); - } - } - console.group("mutations (%d) [%s]", mutations.length, u || ""); - } - var isAttached = inDocument(root); - mutations.forEach(function(mx) { - if (mx.type === "childList") { - forEach(mx.addedNodes, function(n) { - if (!n.localName) { - return; - } - addedNode(n, isAttached); - }); - forEach(mx.removedNodes, function(n) { - if (!n.localName) { - return; - } - detachedNode(n); - }); - } - }); - flags.dom && console.groupEnd(); - } - function takeRecords(node) { - node = window.wrap(node); - if (!node) { - node = window.wrap(document); - } - while (node.parentNode) { - node = node.parentNode; - } - var observer = node.__observer; - if (observer) { - handler(node, observer.takeRecords()); - takeMutations(); - } - } - var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach); - function observe(inRoot) { - if (inRoot.__observer) { - return; - } - var observer = new MutationObserver(handler.bind(this, inRoot)); - observer.observe(inRoot, { - childList: true, - subtree: true - }); - inRoot.__observer = observer; - } - function upgradeDocument(doc) { - doc = window.wrap(doc); - flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop()); - var isMainDocument = doc === window.wrap(document); - addedNode(doc, isMainDocument); - observe(doc); - flags.dom && console.groupEnd(); - } - function upgradeDocumentTree(doc) { - forDocumentTree(doc, upgradeDocument); - } - var originalCreateShadowRoot = Element.prototype.createShadowRoot; - if (originalCreateShadowRoot) { - Element.prototype.createShadowRoot = function() { - var root = originalCreateShadowRoot.call(this); - window.CustomElements.watchShadow(this); - return root; - }; - } - scope.watchShadow = watchShadow; - scope.upgradeDocumentTree = upgradeDocumentTree; - scope.upgradeDocument = upgradeDocument; - scope.upgradeSubtree = addedSubtree; - scope.upgradeAll = addedNode; - scope.attached = attached; - scope.takeRecords = takeRecords; -}); - -window.CustomElements.addModule(function(scope) { - var flags = scope.flags; - function upgrade(node, isAttached) { - if (node.localName === "template") { - if (window.HTMLTemplateElement && HTMLTemplateElement.decorate) { - HTMLTemplateElement.decorate(node); - } - } - if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) { - var is = node.getAttribute("is"); - var definition = scope.getRegisteredDefinition(node.localName) || scope.getRegisteredDefinition(is); - if (definition) { - if (is && definition.tag == node.localName || !is && !definition.extends) { - return upgradeWithDefinition(node, definition, isAttached); - } - } - } - } - function upgradeWithDefinition(element, definition, isAttached) { - flags.upgrade && console.group("upgrade:", element.localName); - if (definition.is) { - element.setAttribute("is", definition.is); - } - implementPrototype(element, definition); - element.__upgraded__ = true; - created(element); - if (isAttached) { - scope.attached(element); - } - scope.upgradeSubtree(element, isAttached); - flags.upgrade && console.groupEnd(); - return element; - } - function implementPrototype(element, definition) { - if (Object.__proto__) { - element.__proto__ = definition.prototype; - } else { - customMixin(element, definition.prototype, definition.native); - element.__proto__ = definition.prototype; - } - } - function customMixin(inTarget, inSrc, inNative) { - var used = {}; - var p = inSrc; - while (p !== inNative && p !== HTMLElement.prototype) { - var keys = Object.getOwnPropertyNames(p); - for (var i = 0, k; k = keys[i]; i++) { - if (!used[k]) { - Object.defineProperty(inTarget, k, Object.getOwnPropertyDescriptor(p, k)); - used[k] = 1; - } - } - p = Object.getPrototypeOf(p); - } - } - function created(element) { - if (element.createdCallback) { - element.createdCallback(); - } - } - scope.upgrade = upgrade; - scope.upgradeWithDefinition = upgradeWithDefinition; - scope.implementPrototype = implementPrototype; -}); - -window.CustomElements.addModule(function(scope) { - var isIE = scope.isIE; - var upgradeDocumentTree = scope.upgradeDocumentTree; - var upgradeAll = scope.upgradeAll; - var upgradeWithDefinition = scope.upgradeWithDefinition; - var implementPrototype = scope.implementPrototype; - var useNative = scope.useNative; - function register(name, options) { - var definition = options || {}; - if (!name) { - throw new Error("document.registerElement: first argument `name` must not be empty"); - } - if (name.indexOf("-") < 0) { - throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '" + String(name) + "'."); - } - if (isReservedTag(name)) { - throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '" + String(name) + "'. The type name is invalid."); - } - if (getRegisteredDefinition(name)) { - throw new Error("DuplicateDefinitionError: a type with name '" + String(name) + "' is already registered"); - } - if (!definition.prototype) { - definition.prototype = Object.create(HTMLElement.prototype); - } - definition.__name = name.toLowerCase(); - if (definition.extends) { - definition.extends = definition.extends.toLowerCase(); - } - definition.lifecycle = definition.lifecycle || {}; - definition.ancestry = ancestry(definition.extends); - resolveTagName(definition); - resolvePrototypeChain(definition); - overrideAttributeApi(definition.prototype); - registerDefinition(definition.__name, definition); - definition.ctor = generateConstructor(definition); - definition.ctor.prototype = definition.prototype; - definition.prototype.constructor = definition.ctor; - if (scope.ready) { - upgradeDocumentTree(document); - } - return definition.ctor; - } - function overrideAttributeApi(prototype) { - if (prototype.setAttribute._polyfilled) { - return; - } - var setAttribute = prototype.setAttribute; - prototype.setAttribute = function(name, value) { - changeAttribute.call(this, name, value, setAttribute); - }; - var removeAttribute = prototype.removeAttribute; - prototype.removeAttribute = function(name) { - changeAttribute.call(this, name, null, removeAttribute); - }; - prototype.setAttribute._polyfilled = true; - } - function changeAttribute(name, value, operation) { - name = name.toLowerCase(); - var oldValue = this.getAttribute(name); - operation.apply(this, arguments); - var newValue = this.getAttribute(name); - if (this.attributeChangedCallback && newValue !== oldValue) { - this.attributeChangedCallback(name, oldValue, newValue); - } - } - function isReservedTag(name) { - for (var i = 0; i < reservedTagList.length; i++) { - if (name === reservedTagList[i]) { - return true; - } - } - } - var reservedTagList = [ "annotation-xml", "color-profile", "font-face", "font-face-src", "font-face-uri", "font-face-format", "font-face-name", "missing-glyph" ]; - function ancestry(extnds) { - var extendee = getRegisteredDefinition(extnds); - if (extendee) { - return ancestry(extendee.extends).concat([ extendee ]); - } - return []; - } - function resolveTagName(definition) { - var baseTag = definition.extends; - for (var i = 0, a; a = definition.ancestry[i]; i++) { - baseTag = a.is && a.tag; - } - definition.tag = baseTag || definition.__name; - if (baseTag) { - definition.is = definition.__name; - } - } - function resolvePrototypeChain(definition) { - if (!Object.__proto__) { - var nativePrototype = HTMLElement.prototype; - if (definition.is) { - var inst = document.createElement(definition.tag); - nativePrototype = Object.getPrototypeOf(inst); - } - var proto = definition.prototype, ancestor; - var foundPrototype = false; - while (proto) { - if (proto == nativePrototype) { - foundPrototype = true; - } - ancestor = Object.getPrototypeOf(proto); - if (ancestor) { - proto.__proto__ = ancestor; - } - proto = ancestor; - } - if (!foundPrototype) { - console.warn(definition.tag + " prototype not found in prototype chain for " + definition.is); - } - definition.native = nativePrototype; - } - } - function instantiate(definition) { - return upgradeWithDefinition(domCreateElement(definition.tag), definition); - } - var registry = {}; - function getRegisteredDefinition(name) { - if (name) { - return registry[name.toLowerCase()]; - } - } - function registerDefinition(name, definition) { - registry[name] = definition; - } - function generateConstructor(definition) { - return function() { - return instantiate(definition); - }; - } - var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; - function createElementNS(namespace, tag, typeExtension) { - if (namespace === HTML_NAMESPACE) { - return createElement(tag, typeExtension); - } else { - return domCreateElementNS(namespace, tag); - } - } - function createElement(tag, typeExtension) { - if (tag) { - tag = tag.toLowerCase(); - } - if (typeExtension) { - typeExtension = typeExtension.toLowerCase(); - } - var definition = getRegisteredDefinition(typeExtension || tag); - if (definition) { - if (tag == definition.tag && typeExtension == definition.is) { - return new definition.ctor(); - } - if (!typeExtension && !definition.is) { - return new definition.ctor(); - } - } - var element; - if (typeExtension) { - element = createElement(tag); - element.setAttribute("is", typeExtension); - return element; - } - element = domCreateElement(tag); - if (tag.indexOf("-") >= 0) { - implementPrototype(element, HTMLElement); - } - return element; - } - var domCreateElement = document.createElement.bind(document); - var domCreateElementNS = document.createElementNS.bind(document); - var isInstance; - if (!Object.__proto__ && !useNative) { - isInstance = function(obj, ctor) { - if (obj instanceof ctor) { - return true; - } - var p = obj; - while (p) { - if (p === ctor.prototype) { - return true; - } - p = p.__proto__; - } - return false; - }; - } else { - isInstance = function(obj, base) { - return obj instanceof base; - }; - } - function wrapDomMethodToForceUpgrade(obj, methodName) { - var orig = obj[methodName]; - obj[methodName] = function() { - var n = orig.apply(this, arguments); - upgradeAll(n); - return n; - }; - } - wrapDomMethodToForceUpgrade(Node.prototype, "cloneNode"); - wrapDomMethodToForceUpgrade(document, "importNode"); - document.registerElement = register; - document.createElement = createElement; - document.createElementNS = createElementNS; - scope.registry = registry; - scope.instanceof = isInstance; - scope.reservedTagList = reservedTagList; - scope.getRegisteredDefinition = getRegisteredDefinition; - document.register = document.registerElement; -}); - -(function(scope) { - var useNative = scope.useNative; - var initializeModules = scope.initializeModules; - var isIE = scope.isIE; - if (useNative) { - var nop = function() {}; - scope.watchShadow = nop; - scope.upgrade = nop; - scope.upgradeAll = nop; - scope.upgradeDocumentTree = nop; - scope.upgradeSubtree = nop; - scope.takeRecords = nop; - scope.instanceof = function(obj, base) { - return obj instanceof base; - }; - } else { - initializeModules(); - } - var upgradeDocumentTree = scope.upgradeDocumentTree; - var upgradeDocument = scope.upgradeDocument; - if (!window.wrap) { - if (window.ShadowDOMPolyfill) { - window.wrap = window.ShadowDOMPolyfill.wrapIfNeeded; - window.unwrap = window.ShadowDOMPolyfill.unwrapIfNeeded; - } else { - window.wrap = window.unwrap = function(node) { - return node; - }; - } - } - if (window.HTMLImports) { - window.HTMLImports.__importsParsingHook = function(elt) { - if (elt.import) { - upgradeDocument(wrap(elt.import)); - } - }; - } - function bootstrap() { - upgradeDocumentTree(window.wrap(document)); - window.CustomElements.ready = true; - var requestAnimationFrame = window.requestAnimationFrame || function(f) { - setTimeout(f, 16); - }; - requestAnimationFrame(function() { - setTimeout(function() { - window.CustomElements.readyTime = Date.now(); - if (window.HTMLImports) { - window.CustomElements.elapsed = window.CustomElements.readyTime - window.HTMLImports.readyTime; - } - document.dispatchEvent(new CustomEvent("WebComponentsReady", { - bubbles: true - })); - }); - }); - } - if (document.readyState === "complete" || scope.flags.eager) { - bootstrap(); - } else if (document.readyState === "interactive" && !window.attachEvent && (!window.HTMLImports || window.HTMLImports.ready)) { - bootstrap(); - } else { - var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded"; - window.addEventListener(loadEvent, bootstrap); - } -})(window.CustomElements); - -(function(scope) { - var style = document.createElement("style"); - style.textContent = "" + "body {" + "transition: opacity ease-in 0.2s;" + " } \n" + "body[unresolved] {" + "opacity: 0; display: block; overflow: hidden; position: relative;" + " } \n"; - var head = document.querySelector("head"); - head.insertBefore(style, head.firstChild); -})(window.WebComponents); \ No newline at end of file +//# sourceMappingURL=webcomponents-lite.js.map diff --git a/rhodecode/templates/admin/my_account/my_account_notifications.mako b/rhodecode/templates/admin/my_account/my_account_notifications.mako --- a/rhodecode/templates/admin/my_account/my_account_notifications.mako +++ b/rhodecode/templates/admin/my_account/my_account_notifications.mako @@ -1,4 +1,5 @@ - diff --git a/rhodecode/templates/base/root.mako b/rhodecode/templates/base/root.mako --- a/rhodecode/templates/base/root.mako +++ b/rhodecode/templates/base/root.mako @@ -27,7 +27,7 @@ c.template_context['default_user'] = { %> - + ${self.title()} @@ -63,33 +63,6 @@ c.template_context['default_user'] = { ## JAVASCRIPT <%def name="js()"> -