blob: 36d0290657b10cc3612d2d6a8a9c474b1c3177fa [file] [log] [blame]
(function(){/*
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
*/
'use strict';var k,aa="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;function n(){this.end=this.start=0;this.rules=this.parent=this.previous=null;this.cssText=this.parsedCssText="";this.atRule=!1;this.type=0;this.parsedSelector=this.selector=this.keyframesName=""}
function p(a){a=a.replace(ba,"").replace(ca,"");var b=da,c=a,e=new n;e.start=0;e.end=c.length;for(var d=e,f=0,g=c.length;f<g;f++)if("{"===c[f]){d.rules||(d.rules=[]);var h=d,l=h.rules[h.rules.length-1]||null;d=new n;d.start=f+1;d.parent=h;d.previous=l;h.rules.push(d)}else"}"===c[f]&&(d.end=f+1,d=d.parent||e);return b(e,a)}
function da(a,b){var c=b.substring(a.start,a.end-1);a.parsedCssText=a.cssText=c.trim();a.parent&&(c=b.substring(a.previous?a.previous.end:a.parent.start,a.start-1),c=ea(c),c=c.replace(fa," "),c=c.substring(c.lastIndexOf(";")+1),c=a.parsedSelector=a.selector=c.trim(),a.atRule=0===c.indexOf("@"),a.atRule?0===c.indexOf("@media")?a.type=ha:c.match(ia)&&(a.type=q,a.keyframesName=a.selector.split(fa).pop()):a.type=0===c.indexOf("--")?ja:ka);if(c=a.rules)for(var e=0,d=c.length,f=void 0;e<d&&(f=c[e]);e++)da(f,
b);return a}function ea(a){return a.replace(/\\([0-9a-f]{1,6})\s/gi,function(a,c){a=c;for(c=6-a.length;c--;)a="0"+a;return"\\"+a})}
function la(a,b,c){c=void 0===c?"":c;var e="";if(a.cssText||a.rules){var d=a.rules,f;if(f=d)f=d[0],f=!(f&&f.selector&&0===f.selector.indexOf("--"));if(f){f=0;for(var g=d.length,h=void 0;f<g&&(h=d[f]);f++)e=la(h,b,e)}else b?b=a.cssText:(b=a.cssText,b=b.replace(ma,"").replace(na,""),b=b.replace(oa,"").replace(pa,"")),(e=b.trim())&&(e=" "+e+"\n")}e&&(a.selector&&(c+=a.selector+" {\n"),c+=e,a.selector&&(c+="}\n\n"));return c}
var ka=1,q=7,ha=4,ja=1E3,ba=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,ca=/@import[^;]*;/gim,ma=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,na=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,oa=/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,pa=/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,ia=/^@[^\s]*keyframes/,fa=/\s+/g;var r=!(window.ShadyDOM&&window.ShadyDOM.inUse),t;function qa(a){t=a&&a.shimcssproperties?!1:r||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)"))}var ra;window.ShadyCSS&&void 0!==window.ShadyCSS.cssBuild&&(ra=window.ShadyCSS.cssBuild);var u=!(!window.ShadyCSS||!window.ShadyCSS.disableRuntime);
window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?t=window.ShadyCSS.nativeCss:window.ShadyCSS?(qa(window.ShadyCSS),window.ShadyCSS=void 0):qa(window.WebComponents&&window.WebComponents.flags);var v=t,w=ra;var x=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,y=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,sa=/(--[\w-]+)\s*([:,;)]|$)/gi,ta=/(animation\s*:)|(animation-name\s*:)/,ua=/@media\s(.*)/,va=/\{[^}]*\}/g;var wa=new Set;function z(a,b){if(!a)return"";"string"===typeof a&&(a=p(a));b&&A(a,b);return la(a,v)}function B(a){!a.__cssRules&&a.textContent&&(a.__cssRules=p(a.textContent));return a.__cssRules||null}function xa(a){return!!a.parent&&a.parent.type===q}function A(a,b,c,e){if(a){var d=!1,f=a.type;if(e&&f===ha){var g=a.selector.match(ua);g&&(window.matchMedia(g[1]).matches||(d=!0))}f===ka?b(a):c&&f===q?c(a):f===ja&&(d=!0);if((a=a.rules)&&!d)for(d=0,f=a.length,g=void 0;d<f&&(g=a[d]);d++)A(g,b,c,e)}}
function C(a,b,c,e){var d=document.createElement("style");b&&d.setAttribute("scope",b);d.textContent=a;ya(d,c,e);return d}var D=null;function za(a){a=document.createComment(" Shady DOM styles for "+a+" ");var b=document.head;b.insertBefore(a,(D?D.nextSibling:null)||b.firstChild);return D=a}function ya(a,b,c){b=b||document.head;b.insertBefore(a,c&&c.nextSibling||b.firstChild);D?a.compareDocumentPosition(D)===Node.DOCUMENT_POSITION_PRECEDING&&(D=a):D=a}
function Aa(a,b){for(var c=0,e=a.length;b<e;b++)if("("===a[b])c++;else if(")"===a[b]&&0===--c)return b;return-1}function Ba(a,b){var c=a.indexOf("var(");if(-1===c)return b(a,"","","");var e=Aa(a,c+3),d=a.substring(c+4,e);c=a.substring(0,c);a=Ba(a.substring(e+1),b);e=d.indexOf(",");return-1===e?b(c,d.trim(),"",a):b(c,d.substring(0,e).trim(),d.substring(e+1).trim(),a)}function E(a,b){r?a.setAttribute("class",b):window.ShadyDOM.nativeMethods.setAttribute.call(a,"class",b)}
var F=window.ShadyDOM&&window.ShadyDOM.wrap||function(a){return a};function G(a){var b=a.localName,c="";b?-1<b.indexOf("-")||(c=b,b=a.getAttribute&&a.getAttribute("is")||""):(b=a.is,c=a.extends);return{is:b,s:c}}function Ca(a){for(var b=[],c="",e=0;0<=e&&e<a.length;e++)if("("===a[e]){var d=Aa(a,e);c+=a.slice(e,d+1);e=d}else","===a[e]?(b.push(c),c=""):c+=a[e];c&&b.push(c);return b}
function H(a){if(void 0!==w)return w;if(void 0===a.__cssBuild){var b=a.getAttribute("css-build");if(b)a.__cssBuild=b;else{a:{b="template"===a.localName?a.content.firstChild:a.firstChild;if(b instanceof Comment&&(b=b.textContent.trim().split(":"),"css-build"===b[0])){b=b[1];break a}b=""}if(""!==b){var c="template"===a.localName?a.content.firstChild:a.firstChild;c.parentNode.removeChild(c)}a.__cssBuild=b}}return a.__cssBuild||""}
function Da(a){a=void 0===a?"":a;return""!==a&&v?r?"shadow"===a:"shady"===a:!1};function I(){}function Ea(a,b){J(K,a,function(a){L(a,b||"")})}function J(a,b,c){b.nodeType===Node.ELEMENT_NODE&&c(b);var e;"template"===b.localName?e=(b.content||b._content||b).childNodes:e=b.children||b.childNodes;if(e)for(b=0;b<e.length;b++)J(a,e[b],c)}
function L(a,b,c){if(b)if(a.classList)c?(a.classList.remove("style-scope"),a.classList.remove(b)):(a.classList.add("style-scope"),a.classList.add(b));else if(a.getAttribute){var e=a.getAttribute("class");c?e&&(b=e.replace("style-scope","").replace(b,""),E(a,b)):E(a,(e?e+" ":"")+"style-scope "+b)}}function Fa(a,b,c){J(K,a,function(a){L(a,b,!0);L(a,c)})}function Ga(a,b){J(K,a,function(a){L(a,b||"",!0)})}
function M(a,b,c,e,d){var f=K;d=void 0===d?"":d;""===d&&(r||"shady"===(void 0===e?"":e)?d=z(b,c):(a=G(a),d=Ha(f,b,a.is,a.s,c)+"\n\n"));return d.trim()}function Ha(a,b,c,e,d){var f=Ia(c,e);c=c?"."+c:"";return z(b,function(b){b.c||(b.selector=b.g=Ja(a,b,a.b,c,f),b.c=!0);d&&d(b,c,f)})}function Ia(a,b){return b?"[is="+a+"]":a}function Ja(a,b,c,e,d){var f=Ca(b.selector);if(!xa(b)){b=0;for(var g=f.length,h=void 0;b<g&&(h=f[b]);b++)f[b]=c.call(a,h,e,d)}return f.filter(function(a){return!!a}).join(",")}
function Ka(a){return a.replace(La,function(a,c,e){-1<e.indexOf("+")?e=e.replace(/\+/g,"___"):-1<e.indexOf("___")&&(e=e.replace(/___/g,"+"));return":"+c+"("+e+")"})}function Ma(a){for(var b=[],c;c=a.match(Na);){var e=c.index,d=Aa(a,e);if(-1===d)throw Error(c.input+" selector missing ')'");c=a.slice(e,d+1);a=a.replace(c,"\ue000");b.push(c)}return{A:a,matches:b}}function Oa(a,b){var c=a.split("\ue000");return b.reduce(function(a,b,f){return a+b+c[f+1]},c[0])}
I.prototype.b=function(a,b,c){var e=!1;a=a.trim();var d=La.test(a);d&&(a=a.replace(La,function(a,b,c){return":"+b+"("+c.replace(/\s/g,"")+")"}),a=Ka(a));var f=Na.test(a);if(f){var g=Ma(a);a=g.A;g=g.matches}a=a.replace(Pa,":host $1");a=a.replace(Qa,function(a,d,f){e||(a=Ra(f,d,b,c),e=e||a.stop,d=a.G,f=a.value);return d+f});f&&(a=Oa(a,g));d&&(a=Ka(a));return a=a.replace(Sa,function(a,b,c,d){return'[dir="'+c+'"] '+b+d+", "+b+'[dir="'+c+'"]'+d})};
function Ra(a,b,c,e){var d=a.indexOf("::slotted");0<=a.indexOf(":host")?a=Ta(a,e):0!==d&&(a=c?Ua(a,c):a);c=!1;0<=d&&(b="",c=!0);if(c){var f=!0;c&&(a=a.replace(Va,function(a,b){return" > "+b}))}return{value:a,G:b,stop:f}}function Ua(a,b){a=a.split(/(\[.+?\])/);for(var c=[],e=0;e<a.length;e++)if(1===e%2)c.push(a[e]);else{var d=a[e];if(""!==d||e!==a.length-1)d=d.split(":"),d[0]+=b,c.push(d.join(":"))}return c.join("")}
function Ta(a,b){var c=a.match(Wa);return(c=c&&c[2].trim()||"")?c[0].match(Xa)?a.replace(Wa,function(a,c,f){return b+f}):c.split(Xa)[0]===b?c:"should_not_match":a.replace(":host",b)}function Ya(a){":root"===a.selector&&(a.selector="html")}I.prototype.c=function(a){return a.match(":host")?"":a.match("::slotted")?this.b(a,":not(.style-scope)"):Ua(a.trim(),":not(.style-scope)")};aa.Object.defineProperties(I.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"style-scope"}}});
var La=/:(nth[-\w]+)\(([^)]+)\)/,Qa=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g,Xa=/[[.:#*]/,Pa=/^(::slotted)/,Wa=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Va=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Sa=/(.*):dir\((?:(ltr|rtl))\)(.*)/,Na=/:(?:matches|any|-(?:webkit|moz)-any)/,K=new I;function N(a,b,c,e,d){this.o=a||null;this.b=b||null;this.w=c||[];this.i=null;this.cssBuild=d||"";this.s=e||"";this.a=this.j=this.m=null}function O(a){return a?a.__styleInfo:null}function Za(a,b){return a.__styleInfo=b}N.prototype.c=function(){return this.o};N.prototype._getStyleRules=N.prototype.c;function $a(a){var b=this.matches||this.matchesSelector||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector;return b&&b.call(this,a)}var ab=navigator.userAgent.match("Trident");function bb(){}function cb(a){var b={},c=[],e=0;A(a,function(a){P(a);a.index=e++;a=a.f.cssText;for(var c;c=sa.exec(a);){var d=c[1];":"!==c[2]&&(b[d]=!0)}},function(a){c.push(a)});a.b=c;a=[];for(var d in b)a.push(d);return a}
function P(a){if(!a.f){var b={},c={};R(a,c)&&(b.l=c,a.rules=null);b.cssText=a.parsedCssText.replace(va,"").replace(x,"");a.f=b}}function R(a,b){var c=a.f;if(c){if(c.l)return Object.assign(b,c.l),!0}else{c=a.parsedCssText;for(var e;a=x.exec(c);){e=(a[2]||a[3]).trim();if("inherit"!==e||"unset"!==e)b[a[1].trim()]=e;e=!0}return e}}
function S(a,b,c){b&&(b=0<=b.indexOf(";")?db(a,b,c):Ba(b,function(b,d,f,g){if(!d)return b+g;(d=S(a,c[d],c))&&"initial"!==d?"apply-shim-inherit"===d&&(d="inherit"):d=S(a,c[f]||f,c)||f;return b+(d||"")+g}));return b&&b.trim()||""}
function db(a,b,c){b=b.split(";");for(var e=0,d,f;e<b.length;e++)if(d=b[e]){y.lastIndex=0;if(f=y.exec(d))d=S(a,c[f[1]],c);else if(f=d.indexOf(":"),-1!==f){var g=d.substring(f);g=g.trim();g=S(a,g,c)||g;d=d.substring(0,f)+g}b[e]=d&&d.lastIndexOf(";")===d.length-1?d.slice(0,-1):d||""}return b.join(";")}
function eb(a,b){var c={},e=[];A(a,function(a){a.f||P(a);var d=a.g||a.parsedSelector;b&&a.f.l&&d&&$a.call(b,d)&&(R(a,c),a=a.index,d=parseInt(a/32,10),e[d]=(e[d]||0)|1<<a%32)},null,!0);return{l:c,key:e}}
function fb(a,b,c,e){b.f||P(b);if(b.f.l){var d=G(a);a=d.is;d=d.s;d=a?Ia(a,d):"html";var f=b.parsedSelector,g=":host > *"===f||"html"===f,h=0===f.indexOf(":host")&&!g;"shady"===c&&(g=f===d+" > *."+d||-1!==f.indexOf("html"),h=!g&&0===f.indexOf(d));if(g||h)c=d,h&&(b.g||(b.g=Ja(K,b,K.b,a?"."+a:"",d)),c=b.g||d),e({A:c,K:h,T:g})}}function gb(a,b,c){var e={},d={};A(b,function(b){fb(a,b,c,function(c){$a.call(a._element||a,c.A)&&(c.K?R(b,e):R(b,d))})},null,!0);return{M:d,J:e}}
function hb(a,b,c,e){var d=G(b),f=Ia(d.is,d.s),g=new RegExp("(?:^|[^.#[:])"+(b.extends?"\\"+f.slice(0,-1)+"\\]":f)+"($|[.:[\\s>+~])"),h=O(b);d=h.o;h=h.cssBuild;var l=ib(d,e);return M(b,d,function(b){var d="";b.f||P(b);b.f.cssText&&(d=db(a,b.f.cssText,c));b.cssText=d;if(!r&&!xa(b)&&b.cssText){var h=d=b.cssText;null==b.C&&(b.C=ta.test(d));if(b.C)if(null==b.u){b.u=[];for(var m in l)h=l[m],h=h(d),d!==h&&(d=h,b.u.push(m))}else{for(m=0;m<b.u.length;++m)h=l[b.u[m]],d=h(d);h=d}b.cssText=h;b.g=b.g||b.selector;
d="."+e;m=Ca(b.g);h=0;for(var Ab=m.length,Q=void 0;h<Ab&&(Q=m[h]);h++)m[h]=Q.match(g)?Q.replace(f,d):d+" "+Q;b.selector=m.join(",")}},h)}function ib(a,b){a=a.b;var c={};if(!r&&a)for(var e=0,d=a[e];e<a.length;d=a[++e]){var f=d,g=b;f.h=new RegExp("\\b"+f.keyframesName+"(?!\\B|-)","g");f.a=f.keyframesName+"-"+g;f.g=f.g||f.selector;f.selector=f.g.replace(f.keyframesName,f.a);c[d.keyframesName]=jb(d)}return c}function jb(a){return function(b){return b.replace(a.h,a.a)}}
function kb(a,b){var c=T,e=B(a);a.textContent=z(e,function(a){var d=a.cssText=a.parsedCssText;a.f&&a.f.cssText&&(d=d.replace(ma,"").replace(na,""),a.cssText=db(c,d,b))})}aa.Object.defineProperties(bb.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"x-scope"}}});var T=new bb;var U={},V=window.customElements;if(V&&!r&&!u){var lb=V.define;V.define=function(a,b,c){U[a]||(U[a]=za(a));lb.call(V,a,b,c)}};function mb(){this.cache={}}mb.prototype.store=function(a,b,c,e){var d=this.cache[a]||[];d.push({l:b,styleElement:c,j:e});100<d.length&&d.shift();this.cache[a]=d};function nb(){}var ob=new RegExp(K.a+"\\s*([^\\s]*)");function pb(a){return(a=(a.classList&&a.classList.value?a.classList.value:a.getAttribute("class")||"").match(ob))?a[1]:""}function qb(a){var b=F(a).getRootNode();return b===a||b===a.ownerDocument?"":(a=b.host)?G(a).is:""}
function rb(a){for(var b=0;b<a.length;b++){var c=a[b];if(c.target!==document.documentElement&&c.target!==document.head)for(var e=0;e<c.addedNodes.length;e++){var d=c.addedNodes[e];if(d.nodeType===Node.ELEMENT_NODE){var f=d.getRootNode(),g=pb(d);if(g&&f===d.ownerDocument&&("style"!==d.localName&&"template"!==d.localName||""===H(d)))Ga(d,g);else if(f instanceof ShadowRoot)for(f=qb(d),f!==g&&Fa(d,g,f),d=window.ShadyDOM.nativeMethods.querySelectorAll.call(d,":not(."+K.a+")"),g=0;g<d.length;g++){f=d[g];
var h=qb(f);h&&L(f,h)}}}}}
if(!(r||window.ShadyDOM&&window.ShadyDOM.handlesDynamicScoping)){var sb=new MutationObserver(rb),tb=function(a){sb.observe(a,{childList:!0,subtree:!0})};if(window.customElements&&!window.customElements.polyfillWrapFlushCallback)tb(document);else{var ub=function(){tb(document.body)};window.HTMLImports?window.HTMLImports.whenReady(ub):requestAnimationFrame(function(){if("loading"===document.readyState){var a=function(){ub();document.removeEventListener("readystatechange",a)};document.addEventListener("readystatechange",
a)}else ub()})}nb=function(){rb(sb.takeRecords())}}var vb=nb;var W={};var wb=Promise.resolve();function xb(a){if(a=W[a])a._applyShimCurrentVersion=a._applyShimCurrentVersion||0,a._applyShimValidatingVersion=a._applyShimValidatingVersion||0,a._applyShimNextVersion=(a._applyShimNextVersion||0)+1}function yb(a){return a._applyShimCurrentVersion===a._applyShimNextVersion}function zb(a){a._applyShimValidatingVersion=a._applyShimNextVersion;a._validating||(a._validating=!0,wb.then(function(){a._applyShimCurrentVersion=a._applyShimNextVersion;a._validating=!1}))};var Bb={},Cb=new mb;function X(){this.B={};this.c=document.documentElement;var a=new n;a.rules=[];this.h=Za(this.c,new N(a));this.v=!1;this.b=this.a=null}k=X.prototype;k.flush=function(){vb()};k.I=function(a){return B(a)};k.R=function(a){return z(a)};k.prepareTemplate=function(a,b,c){this.prepareTemplateDom(a,b);this.prepareTemplateStyles(a,b,c)};
k.prepareTemplateStyles=function(a,b,c){if(!a._prepared&&!u){r||U[b]||(U[b]=za(b));a._prepared=!0;a.name=b;a.extends=c;W[b]=a;var e=H(a),d=Da(e);c={is:b,extends:c};for(var f=[],g=a.content.querySelectorAll("style"),h=0;h<g.length;h++){var l=g[h];if(l.hasAttribute("shady-unscoped")){if(!r){var m=l.textContent;wa.has(m)||(wa.add(m),m=l.cloneNode(!0),document.head.appendChild(m));l.parentNode.removeChild(l)}}else f.push(l.textContent),l.parentNode.removeChild(l)}f=f.join("").trim()+(Bb[b]||"");Y(this);
if(!d){if(g=!e)g=y.test(f)||x.test(f),y.lastIndex=0,x.lastIndex=0;h=p(f);g&&v&&this.a&&this.a.transformRules(h,b);a._styleAst=h}g=[];v||(g=cb(a._styleAst));if(!g.length||v)h=r?a.content:null,b=U[b]||null,e=M(c,a._styleAst,null,e,d?f:""),e=e.length?C(e,c.is,h,b):null,a._style=e;a.a=g}};k.L=function(a,b){Bb[b]=a.join(" ")};k.prepareTemplateDom=function(a,b){if(!u){var c=H(a);r||"shady"===c||a._domPrepared||(a._domPrepared=!0,Ea(a.content,b))}};
function Db(a){var b=G(a),c=b.is;b=b.s;var e=U[c]||null,d=W[c];if(d){c=d._styleAst;var f=d.a;d=H(d);b=new N(c,e,f,b,d);Za(a,b);return b}}function Eb(a){!a.b&&window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface&&(a.b=window.ShadyCSS.CustomStyleInterface,a.b.transformCallback=function(b){a.D(b)},a.b.validateCallback=function(){requestAnimationFrame(function(){(a.b.enqueued||a.v)&&a.flushCustomStyles()})})}
function Y(a){!a.a&&window.ShadyCSS&&window.ShadyCSS.ApplyShim&&(a.a=window.ShadyCSS.ApplyShim,a.a.invalidCallback=xb);Eb(a)}
k.flushCustomStyles=function(){if(!u&&(Y(this),this.b)){var a=this.b.processStyles();if(this.b.enqueued&&!Da(this.h.cssBuild)){if(v){if(!this.h.cssBuild)for(var b=0;b<a.length;b++){var c=this.b.getStyleForCustomStyle(a[b]);if(c&&v&&this.a){var e=B(c);Y(this);this.a.transformRules(e);c.textContent=z(e)}}}else{Fb(this,this.c,this.h);for(b=0;b<a.length;b++)(c=this.b.getStyleForCustomStyle(a[b]))&&kb(c,this.h.m);this.v&&this.styleDocument()}this.b.enqueued=!1}}};
k.styleElement=function(a,b){if(u){if(b){O(a)||Za(a,new N(null));var c=O(a);c.i=c.i||{};Object.assign(c.i,b);Gb(this,a,c)}}else if(c=O(a)||Db(a))if(a!==this.c&&(this.v=!0),b&&(c.i=c.i||{},Object.assign(c.i,b)),v)Gb(this,a,c);else if(this.flush(),Fb(this,a,c),c.w&&c.w.length){b=G(a).is;var e;a:{if(e=Cb.cache[b])for(var d=e.length-1;0<=d;d--){var f=e[d];b:{var g=c.w;for(var h=0;h<g.length;h++){var l=g[h];if(f.l[l]!==c.m[l]){g=!1;break b}}g=!0}if(g){e=f;break a}}e=void 0}g=e?e.styleElement:null;d=c.j;
(f=e&&e.j)||(f=this.B[b]=(this.B[b]||0)+1,f=b+"-"+f);c.j=f;f=c.j;h=T;h=g?g.textContent||"":hb(h,a,c.m,f);l=O(a);var m=l.a;m&&!r&&m!==g&&(m._useCount--,0>=m._useCount&&m.parentNode&&m.parentNode.removeChild(m));r?l.a?(l.a.textContent=h,g=l.a):h&&(g=C(h,f,a.shadowRoot,l.b)):g?g.parentNode||(ab&&-1<h.indexOf("@media")&&(g.textContent=h),ya(g,null,l.b)):h&&(g=C(h,f,null,l.b));g&&(g._useCount=g._useCount||0,l.a!=g&&g._useCount++,l.a=g);f=g;r||(g=c.j,l=h=a.getAttribute("class")||"",d&&(l=h.replace(new RegExp("\\s*x-scope\\s*"+
d+"\\s*","g")," ")),l+=(l?" ":"")+"x-scope "+g,h!==l&&E(a,l));e||Cb.store(b,c.m,f,c.j)}};
function Gb(a,b,c){var e=G(b).is;if(c.i){var d=c.i,f;for(f in d)null===f?b.style.removeProperty(f):b.style.setProperty(f,d[f])}d=W[e];if(!(!d&&b!==a.c||d&&""!==H(d))&&d&&d._style&&!yb(d)){if(yb(d)||d._applyShimValidatingVersion!==d._applyShimNextVersion)Y(a),a.a&&a.a.transformRules(d._styleAst,e),d._style.textContent=M(b,c.o),zb(d);r&&(a=b.shadowRoot)&&(a=a.querySelector("style"))&&(a.textContent=M(b,c.o));c.o=d._styleAst}}
function Hb(a,b){return(b=F(b).getRootNode().host)?O(b)||Db(b)?b:Hb(a,b):a.c}function Fb(a,b,c){var e=Hb(a,b),d=O(e),f=d.m;e===a.c||f||(Fb(a,e,d),f=d.m);a=Object.create(f||null);e=gb(b,c.o,c.cssBuild);b=eb(d.o,b).l;Object.assign(a,e.J,b,e.M);b=c.i;for(var g in b)if((d=b[g])||0===d)a[g]=d;g=T;b=Object.getOwnPropertyNames(a);for(d=0;d<b.length;d++)e=b[d],a[e]=S(g,a[e],a);c.m=a}k.styleDocument=function(a){this.styleSubtree(this.c,a)};
k.styleSubtree=function(a,b){var c=F(a),e=c.shadowRoot;(e||a===this.c)&&this.styleElement(a,b);if(a=e&&(e.children||e.childNodes))for(c=0;c<a.length;c++)this.styleSubtree(a[c]);else if(c=c.children||c.childNodes)for(a=0;a<c.length;a++)this.styleSubtree(c[a])};
k.D=function(a){var b=this,c=H(a);c!==this.h.cssBuild&&(this.h.cssBuild=c);if(!Da(c)){var e=B(a);A(e,function(a){if(r)Ya(a);else{var d=K;a.selector=a.parsedSelector;Ya(a);a.selector=a.g=Ja(d,a,d.c,void 0,void 0)}v&&""===c&&(Y(b),b.a&&b.a.transformRule(a))});v?a.textContent=z(e):this.h.o.rules.push(e)}};k.getComputedStyleValue=function(a,b){var c;v||(c=(O(a)||O(Hb(this,a))).m[b]);return(c=c||window.getComputedStyle(a).getPropertyValue(b))?c.trim():""};
k.P=function(a,b){var c=F(a).getRootNode();b=b?b.split(/\s/):[];c=c.host&&c.host.localName;if(!c){var e=a.getAttribute("class");if(e){e=e.split(/\s/);for(var d=0;d<e.length;d++)if(e[d]===K.a){c=e[d+1];break}}}c&&b.push(K.a,c);v||(c=O(a))&&c.j&&b.push(T.a,c.j);E(a,b.join(" "))};k.F=function(a){return O(a)};k.O=function(a,b){L(a,b)};k.S=function(a,b){L(a,b,!0)};k.N=function(a){return qb(a)};k.H=function(a){return pb(a)};X.prototype.flush=X.prototype.flush;X.prototype.prepareTemplate=X.prototype.prepareTemplate;
X.prototype.styleElement=X.prototype.styleElement;X.prototype.styleDocument=X.prototype.styleDocument;X.prototype.styleSubtree=X.prototype.styleSubtree;X.prototype.getComputedStyleValue=X.prototype.getComputedStyleValue;X.prototype.setElementClass=X.prototype.P;X.prototype._styleInfoForNode=X.prototype.F;X.prototype.transformCustomStyleForDocument=X.prototype.D;X.prototype.getStyleAst=X.prototype.I;X.prototype.styleAstToString=X.prototype.R;X.prototype.flushCustomStyles=X.prototype.flushCustomStyles;
X.prototype.scopeNode=X.prototype.O;X.prototype.unscopeNode=X.prototype.S;X.prototype.scopeForNode=X.prototype.N;X.prototype.currentScopeForNode=X.prototype.H;X.prototype.prepareAdoptedCssText=X.prototype.L;Object.defineProperties(X.prototype,{nativeShadow:{get:function(){return r}},nativeCss:{get:function(){return v}}});var Z=new X,Ib,Jb;window.ShadyCSS&&(Ib=window.ShadyCSS.ApplyShim,Jb=window.ShadyCSS.CustomStyleInterface);
window.ShadyCSS={ScopingShim:Z,prepareTemplate:function(a,b,c){Z.flushCustomStyles();Z.prepareTemplate(a,b,c)},prepareTemplateDom:function(a,b){Z.prepareTemplateDom(a,b)},prepareTemplateStyles:function(a,b,c){Z.flushCustomStyles();Z.prepareTemplateStyles(a,b,c)},styleSubtree:function(a,b){Z.flushCustomStyles();Z.styleSubtree(a,b)},styleElement:function(a){Z.flushCustomStyles();Z.styleElement(a)},styleDocument:function(a){Z.flushCustomStyles();Z.styleDocument(a)},flushCustomStyles:function(){Z.flushCustomStyles()},
getComputedStyleValue:function(a,b){return Z.getComputedStyleValue(a,b)},nativeCss:v,nativeShadow:r,cssBuild:w,disableRuntime:u};Ib&&(window.ShadyCSS.ApplyShim=Ib);Jb&&(window.ShadyCSS.CustomStyleInterface=Jb);}).call(this);
//# sourceMappingURL=scoping-shim.min.js.map