@webcomponents/shadycss
Advanced tools
Comparing version 1.5.2 to 1.6.0
@@ -10,23 +10,24 @@ (function(){/* | ||
*/ | ||
'use strict';var k=!(window.ShadyDOM&&window.ShadyDOM.inUse),n;function r(a){n=a&&a.shimcssproperties?!1:k||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)"))}window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?n=window.ShadyCSS.nativeCss:window.ShadyCSS?(r(window.ShadyCSS),window.ShadyCSS=void 0):r(window.WebComponents&&window.WebComponents.flags);var t=n;function u(){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 v(a){a=a.replace(aa,"").replace(ba,"");var b=w,c=a,e=new u;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 u;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 w(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=ca(c),c=c.replace(x," "),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=y:c.match(da)&&(a.type=z,a.keyframesName=a.selector.split(x).pop()):a.type=0===c.indexOf("--")?A:B);if(c=a.rules)for(var e=0,d=c.length,f;e<d&&(f=c[e]);e++)w(f,b);return a} | ||
function ca(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 C(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;f<g&&(h=d[f]);f++)e=C(h,b,e)}else b?b=a.cssText:(b=a.cssText,b=b.replace(ea,"").replace(fa,""),b=b.replace(ha,"").replace(ia,"")),(e=b.trim())&&(e=" "+e+"\n")}e&&(a.selector&&(c+=a.selector+" {\n"),c+=e,a.selector&&(c+="}\n\n"));return c} | ||
var B=1,z=7,y=4,A=1E3,aa=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,ba=/@import[^;]*;/gim,ea=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,fa=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,ha=/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,ia=/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,da=/^@[^\s]*keyframes/,x=/\s+/g;var D=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,F=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,ja=/@media\s(.*)/;var G=new Set;function H(a){if(!a)return"";"string"===typeof a&&(a=v(a));return C(a,t)}function I(a){!a.__cssRules&&a.textContent&&(a.__cssRules=v(a.textContent));return a.__cssRules||null}function J(a,b,c,e){if(a){var d=!1,f=a.type;if(e&&f===y){var g=a.selector.match(ja);g&&(window.matchMedia(g[1]).matches||(d=!0))}f===B?b(a):c&&f===z?c(a):f===A&&(d=!0);if((a=a.rules)&&!d){d=0;f=a.length;for(var h;d<f&&(h=a[d]);d++)J(h,b,c,e)}}} | ||
function K(a,b){var c=a.indexOf("var(");if(-1===c)return b(a,"","","");a:{var e=0;var d=c+3;for(var f=a.length;d<f;d++)if("("===a[d])e++;else if(")"===a[d]&&0===--e)break a;d=-1}e=a.substring(c+4,d);c=a.substring(0,c);a=K(a.substring(d+1),b);d=e.indexOf(",");return-1===d?b(c,e.trim(),"",a):b(c,e.substring(0,d).trim(),e.substring(d+1).trim(),a)} | ||
function L(a){if(void 0===a.a){var b=a.getAttribute("css-build");if(b)a.a=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.a=b}}return a.a||""};var ka=/;\s*/m,la=/^\s*(initial)|(inherit)\s*$/,M=/\s*!important/;function N(){this.a={}}N.prototype.set=function(a,b){a=a.trim();this.a[a]={h:b,i:{}}};N.prototype.get=function(a){a=a.trim();return this.a[a]||null};var O=null;function P(){this.b=this.c=null;this.a=new N}P.prototype.o=function(a){a=F.test(a)||D.test(a);F.lastIndex=0;D.lastIndex=0;return a}; | ||
P.prototype.m=function(a,b){if(void 0===a.b){var c=[];for(var e=a.content.querySelectorAll("style"),d=0;d<e.length;d++){var f=e[d];if(f.hasAttribute("shady-unscoped")){if(!k){var g=f.textContent;G.has(g)||(G.add(g),g=f.cloneNode(!0),document.head.appendChild(g));f.parentNode.removeChild(f)}}else c.push(f.textContent),f.parentNode.removeChild(f)}(c=c.join("").trim())?(e=document.createElement("style"),e.textContent=c,a.content.insertBefore(e,a.content.firstChild),c=e):c=null;a.b=c}return(a=a.b)?this.j(a, | ||
b):null};P.prototype.j=function(a,b){b=void 0===b?"":b;var c=I(a);this.l(c,b);a.textContent=H(c);return c};P.prototype.f=function(a){var b=this,c=I(a);J(c,function(a){":root"===a.selector&&(a.selector="html");b.g(a)});a.textContent=H(c);return c};P.prototype.l=function(a,b){var c=this;this.c=b;J(a,function(a){c.g(a)});this.c=null};P.prototype.g=function(a){a.cssText=ma(this,a.parsedCssText,a);":root"===a.selector&&(a.selector=":host > *")}; | ||
function ma(a,b,c){b=b.replace(D,function(b,d,f,g){return na(a,b,d,f,g,c)});return Q(a,b,c)}function oa(a,b){for(var c=b;c.parent;)c=c.parent;var e={},d=!1;J(c,function(c){(d=d||c===b)||c.selector===b.selector&&Object.assign(e,R(a,c.parsedCssText))});return e} | ||
function Q(a,b,c){for(var e;e=F.exec(b);){var d=e[0],f=e[1];e=e.index;var g=b.slice(0,e+d.indexOf("@apply"));b=b.slice(e+d.length);var h=c?oa(a,c):{};Object.assign(h,R(a,g));d=void 0;var l=a;f=f.replace(ka,"");var p=[];var m=l.a.get(f);m||(l.a.set(f,{}),m=l.a.get(f));if(m){l.c&&(m.i[l.c]=!0);var q=m.h;for(d in q)l=h&&h[d],m=[d,": var(",f,"_-_",d],l&&m.push(",",l.replace(M,"")),m.push(")"),M.test(q[d])&&m.push(" !important"),p.push(m.join(""))}d=p.join("; ");b=g+d+b;F.lastIndex=e+d.length}return b} | ||
function R(a,b){b=b.split(";");for(var c,e,d={},f=0,g;f<b.length;f++)if(c=b[f])if(g=c.split(":"),1<g.length){c=g[0].trim();var h=a;e=c;g=g.slice(1).join(":");var l=la.exec(g);l&&(l[1]?(h.b||(h.b=document.createElement("meta"),h.b.setAttribute("apply-shim-measure",""),h.b.style.all="initial",document.head.appendChild(h.b)),e=window.getComputedStyle(h.b).getPropertyValue(e)):e="apply-shim-inherit",g=e);e=g;d[c]=e}return d}function pa(a,b){if(O)for(var c in b.i)c!==a.c&&O(c)} | ||
function na(a,b,c,e,d,f){e&&K(e,function(b,c){c&&a.a.get(c)&&(d="@apply "+c+";")});if(!d)return b;var g=Q(a,""+d,f);f=b.slice(0,b.indexOf("--"));var h=g=R(a,g),l=a.a.get(c),p=l&&l.h;p?h=Object.assign(Object.create(p),g):a.a.set(c,h);var m=[],q,X=!1;for(q in h){var E=g[q];void 0===E&&(E="initial");!p||q in p||(X=!0);m.push(c+"_-_"+q+": "+E)}X&&pa(a,l);l&&(l.h=h);e&&(f=b+";"+f);return f+m.join("; ")+";"}P.prototype.detectMixin=P.prototype.o;P.prototype.transformStyle=P.prototype.j; | ||
P.prototype.transformCustomStyle=P.prototype.f;P.prototype.transformRules=P.prototype.l;P.prototype.transformRule=P.prototype.g;P.prototype.transformTemplate=P.prototype.m;P.prototype._separator="_-_";Object.defineProperty(P.prototype,"invalidCallback",{get:function(){return O},set:function(a){O=a}});var S={};var qa=Promise.resolve();function ra(a){if(a=S[a])a._applyShimCurrentVersion=a._applyShimCurrentVersion||0,a._applyShimValidatingVersion=a._applyShimValidatingVersion||0,a._applyShimNextVersion=(a._applyShimNextVersion||0)+1}function T(a){return a._applyShimCurrentVersion===a._applyShimNextVersion}function sa(a){a._applyShimValidatingVersion=a._applyShimNextVersion;a.c||(a.c=!0,qa.then(function(){a._applyShimCurrentVersion=a._applyShimNextVersion;a.c=!1}))};var U=new P;function V(){this.a=null;U.invalidCallback=ra}function W(a){a.a||(a.a=window.ShadyCSS.CustomStyleInterface,a.a&&(a.a.transformCallback=function(a){U.f(a)},a.a.validateCallback=function(){requestAnimationFrame(function(){a.a.enqueued&&a.flushCustomStyles()})}))}V.prototype.prepareTemplate=function(a,b){W(this);""===L(a)&&(S[b]=a,b=U.m(a,b),a._styleAst=b)}; | ||
V.prototype.flushCustomStyles=function(){W(this);if(this.a){var a=this.a.processStyles();if(this.a.enqueued){for(var b=0;b<a.length;b++){var c=this.a.getStyleForCustomStyle(a[b]);c&&U.f(c)}this.a.enqueued=!1}}}; | ||
V.prototype.styleSubtree=function(a,b){W(this);if(b)for(var c in b)null===c?a.style.removeProperty(c):a.style.setProperty(c,b[c]);if(a.shadowRoot)for(this.styleElement(a),a=a.shadowRoot.children||a.shadowRoot.childNodes,b=0;b<a.length;b++)this.styleSubtree(a[b]);else for(a=a.children||a.childNodes,b=0;b<a.length;b++)this.styleSubtree(a[b])}; | ||
V.prototype.styleElement=function(a){W(this);var b=a.localName,c;b?-1<b.indexOf("-")?c=b:c=a.getAttribute&&a.getAttribute("is")||"":c=a.is;b=S[c];if(!(b&&""!==L(b)||!b||T(b))){if(T(b)||b._applyShimValidatingVersion!==b._applyShimNextVersion)this.prepareTemplate(b,c),sa(b);if(a=a.shadowRoot)if(a=a.querySelector("style"))a.__cssRules=b._styleAst,a.textContent=H(b._styleAst)}};V.prototype.styleDocument=function(a){W(this);this.styleSubtree(document.body,a)}; | ||
if(!window.ShadyCSS||!window.ShadyCSS.ScopingShim){var Y=new V,Z=window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface;window.ShadyCSS={prepareTemplate:function(a,b){Y.flushCustomStyles();Y.prepareTemplate(a,b)},prepareTemplateStyles:function(a,b,c){this.prepareTemplate(a,b,c)},prepareTemplateDom:function(){},styleSubtree:function(a,b){Y.flushCustomStyles();Y.styleSubtree(a,b)},styleElement:function(a){Y.flushCustomStyles();Y.styleElement(a)},styleDocument:function(a){Y.flushCustomStyles();Y.styleDocument(a)}, | ||
getComputedStyleValue:function(a,b){return(a=window.getComputedStyle(a).getPropertyValue(b))?a.trim():""},flushCustomStyles:function(){Y.flushCustomStyles()},nativeCss:t,nativeShadow:k};Z&&(window.ShadyCSS.CustomStyleInterface=Z)}window.ShadyCSS.ApplyShim=U;}).call(this); | ||
'use strict';var l=!(window.ShadyDOM&&window.ShadyDOM.inUse),p;function r(a){p=a&&a.shimcssproperties?!1:l||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)"))}var t;window.ShadyCSS&&void 0!==window.ShadyCSS.cssBuild&&(t=window.ShadyCSS.cssBuild);window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?p=window.ShadyCSS.nativeCss:window.ShadyCSS?(r(window.ShadyCSS),window.ShadyCSS=void 0):r(window.WebComponents&&window.WebComponents.flags); | ||
var u=p,v=t;function w(){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 x(a){a=a.replace(aa,"").replace(ba,"");var b=y,c=a,e=new w;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,k=h.rules[h.rules.length-1]||null;d=new w;d.start=f+1;d.parent=h;d.previous=k;h.rules.push(d)}else"}"===c[f]&&(d.end=f+1,d=d.parent||e);return b(e,a)} | ||
function y(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=ca(c),c=c.replace(z," "),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=A:c.match(da)&&(a.type=B,a.keyframesName=a.selector.split(z).pop()):a.type=0===c.indexOf("--")?C:D);if(c=a.rules)for(var e=0,d=c.length,f=void 0;e<d&&(f=c[e]);e++)y(f,b); | ||
return a}function ca(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 E(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=E(h,b,e)}else b?b=a.cssText:(b=a.cssText,b=b.replace(ea,"").replace(fa,""),b=b.replace(ha,"").replace(ia,"")),(e=b.trim())&&(e=" "+e+"\n")}e&&(a.selector&&(c+=a.selector+" {\n"),c+=e,a.selector&&(c+="}\n\n"));return c} | ||
var D=1,B=7,A=4,C=1E3,aa=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,ba=/@import[^;]*;/gim,ea=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,fa=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,ha=/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,ia=/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,da=/^@[^\s]*keyframes/,z=/\s+/g;var G=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,H=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,ja=/@media\s(.*)/;var I=new Set;function J(a){if(!a)return"";"string"===typeof a&&(a=x(a));return E(a,u)}function K(a){!a.__cssRules&&a.textContent&&(a.__cssRules=x(a.textContent));return a.__cssRules||null}function L(a,b,c,e){if(a){var d=!1,f=a.type;if(e&&f===A){var g=a.selector.match(ja);g&&(window.matchMedia(g[1]).matches||(d=!0))}f===D?b(a):c&&f===B?c(a):f===C&&(d=!0);if((a=a.rules)&&!d)for(d=0,f=a.length,g=void 0;d<f&&(g=a[d]);d++)L(g,b,c,e)}} | ||
function M(a,b){var c=a.indexOf("var(");if(-1===c)return b(a,"","","");a:{var e=0;var d=c+3;for(var f=a.length;d<f;d++)if("("===a[d])e++;else if(")"===a[d]&&0===--e)break a;d=-1}e=a.substring(c+4,d);c=a.substring(0,c);a=M(a.substring(d+1),b);d=e.indexOf(",");return-1===d?b(c,e.trim(),"",a):b(c,e.substring(0,d).trim(),e.substring(d+1).trim(),a)} | ||
function N(a){if(void 0!==v)return v;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||""};var ka=/;\s*/m,la=/^\s*(initial)|(inherit)\s*$/,O=/\s*!important/;function P(){this.a={}}P.prototype.set=function(a,b){a=a.trim();this.a[a]={h:b,i:{}}};P.prototype.get=function(a){a=a.trim();return this.a[a]||null};var Q=null;function R(){this.b=this.c=null;this.a=new P}R.prototype.o=function(a){a=H.test(a)||G.test(a);H.lastIndex=0;G.lastIndex=0;return a}; | ||
R.prototype.m=function(a,b){if(void 0===a._gatheredStyle){var c=[];for(var e=a.content.querySelectorAll("style"),d=0;d<e.length;d++){var f=e[d];if(f.hasAttribute("shady-unscoped")){if(!l){var g=f.textContent;I.has(g)||(I.add(g),g=f.cloneNode(!0),document.head.appendChild(g));f.parentNode.removeChild(f)}}else c.push(f.textContent),f.parentNode.removeChild(f)}(c=c.join("").trim())?(e=document.createElement("style"),e.textContent=c,a.content.insertBefore(e,a.content.firstChild),c=e):c=null;a._gatheredStyle= | ||
c}return(a=a._gatheredStyle)?this.j(a,b):null};R.prototype.j=function(a,b){b=void 0===b?"":b;var c=K(a);this.l(c,b);a.textContent=J(c);return c};R.prototype.f=function(a){var b=this,c=K(a);L(c,function(a){":root"===a.selector&&(a.selector="html");b.g(a)});a.textContent=J(c);return c};R.prototype.l=function(a,b){var c=this;this.c=b;L(a,function(a){c.g(a)});this.c=null};R.prototype.g=function(a){a.cssText=ma(this,a.parsedCssText,a);":root"===a.selector&&(a.selector=":host > *")}; | ||
function ma(a,b,c){b=b.replace(G,function(b,d,f,g){return na(a,b,d,f,g,c)});return S(a,b,c)}function oa(a,b){for(var c=b;c.parent;)c=c.parent;var e={},d=!1;L(c,function(c){(d=d||c===b)||c.selector===b.selector&&Object.assign(e,T(a,c.parsedCssText))});return e} | ||
function S(a,b,c){for(var e;e=H.exec(b);){var d=e[0],f=e[1];e=e.index;var g=b.slice(0,e+d.indexOf("@apply"));b=b.slice(e+d.length);var h=c?oa(a,c):{};Object.assign(h,T(a,g));d=void 0;var k=a;f=f.replace(ka,"");var n=[];var m=k.a.get(f);m||(k.a.set(f,{}),m=k.a.get(f));if(m){k.c&&(m.i[k.c]=!0);var q=m.h;for(d in q)k=h&&h[d],m=[d,": var(",f,"_-_",d],k&&m.push(",",k.replace(O,"")),m.push(")"),O.test(q[d])&&m.push(" !important"),n.push(m.join(""))}d=n.join("; ");b=g+d+b;H.lastIndex=e+d.length}return b} | ||
function T(a,b,c){c=void 0===c?!1:c;b=b.split(";");for(var e,d,f={},g=0,h;g<b.length;g++)if(e=b[g])if(h=e.split(":"),1<h.length){e=h[0].trim();d=h.slice(1).join(":");if(c){var k=a;h=e;var n=la.exec(d);n&&(n[1]?(k.b||(k.b=document.createElement("meta"),k.b.setAttribute("apply-shim-measure",""),k.b.style.all="initial",document.head.appendChild(k.b)),h=window.getComputedStyle(k.b).getPropertyValue(h)):h="apply-shim-inherit",d=h)}f[e]=d}return f}function pa(a,b){if(Q)for(var c in b.i)c!==a.c&&Q(c)} | ||
function na(a,b,c,e,d,f){e&&M(e,function(b,c){c&&a.a.get(c)&&(d="@apply "+c+";")});if(!d)return b;var g=S(a,""+d,f);f=b.slice(0,b.indexOf("--"));var h=g=T(a,g,!0),k=a.a.get(c),n=k&&k.h;n?h=Object.assign(Object.create(n),g):a.a.set(c,h);var m=[],q,Z=!1;for(q in h){var F=g[q];void 0===F&&(F="initial");!n||q in n||(Z=!0);m.push(c+"_-_"+q+": "+F)}Z&&pa(a,k);k&&(k.h=h);e&&(f=b+";"+f);return f+m.join("; ")+";"}R.prototype.detectMixin=R.prototype.o;R.prototype.transformStyle=R.prototype.j; | ||
R.prototype.transformCustomStyle=R.prototype.f;R.prototype.transformRules=R.prototype.l;R.prototype.transformRule=R.prototype.g;R.prototype.transformTemplate=R.prototype.m;R.prototype._separator="_-_";Object.defineProperty(R.prototype,"invalidCallback",{get:function(){return Q},set:function(a){Q=a}});var U={};var qa=Promise.resolve();function ra(a){if(a=U[a])a._applyShimCurrentVersion=a._applyShimCurrentVersion||0,a._applyShimValidatingVersion=a._applyShimValidatingVersion||0,a._applyShimNextVersion=(a._applyShimNextVersion||0)+1}function sa(a){return a._applyShimCurrentVersion===a._applyShimNextVersion}function ta(a){a._applyShimValidatingVersion=a._applyShimNextVersion;a._validating||(a._validating=!0,qa.then(function(){a._applyShimCurrentVersion=a._applyShimNextVersion;a._validating=!1}))};var V=new R;function W(){this.a=null;V.invalidCallback=ra}function X(a){!a.a&&window.ShadyCSS.CustomStyleInterface&&(a.a=window.ShadyCSS.CustomStyleInterface,a.a.transformCallback=function(a){V.f(a)},a.a.validateCallback=function(){requestAnimationFrame(function(){a.a.enqueued&&a.flushCustomStyles()})})}W.prototype.prepareTemplate=function(a,b){X(this);""===N(a)&&(U[b]=a,b=V.m(a,b),a._styleAst=b)}; | ||
W.prototype.flushCustomStyles=function(){X(this);if(this.a){var a=this.a.processStyles();if(this.a.enqueued){for(var b=0;b<a.length;b++){var c=this.a.getStyleForCustomStyle(a[b]);c&&V.f(c)}this.a.enqueued=!1}}}; | ||
W.prototype.styleSubtree=function(a,b){X(this);if(b)for(var c in b)null===c?a.style.removeProperty(c):a.style.setProperty(c,b[c]);if(a.shadowRoot)for(this.styleElement(a),a=a.shadowRoot.children||a.shadowRoot.childNodes,b=0;b<a.length;b++)this.styleSubtree(a[b]);else for(a=a.children||a.childNodes,b=0;b<a.length;b++)this.styleSubtree(a[b])}; | ||
W.prototype.styleElement=function(a){X(this);var b=a.localName,c;b?-1<b.indexOf("-")?c=b:c=a.getAttribute&&a.getAttribute("is")||"":c=a.is;b=U[c];if(!(b&&""!==N(b)||!b||sa(b))){if(sa(b)||b._applyShimValidatingVersion!==b._applyShimNextVersion)this.prepareTemplate(b,c),ta(b);if(a=a.shadowRoot)if(a=a.querySelector("style"))a.__cssRules=b._styleAst,a.textContent=J(b._styleAst)}};W.prototype.styleDocument=function(a){X(this);this.styleSubtree(document.body,a)}; | ||
if(!window.ShadyCSS||!window.ShadyCSS.ScopingShim){var Y=new W,ua=window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface;window.ShadyCSS={prepareTemplate:function(a,b){Y.flushCustomStyles();Y.prepareTemplate(a,b)},prepareTemplateStyles:function(a,b,c){window.ShadyCSS.prepareTemplate(a,b,c)},prepareTemplateDom:function(){},styleSubtree:function(a,b){Y.flushCustomStyles();Y.styleSubtree(a,b)},styleElement:function(a){Y.flushCustomStyles();Y.styleElement(a)},styleDocument:function(a){Y.flushCustomStyles(); | ||
Y.styleDocument(a)},getComputedStyleValue:function(a,b){return(a=window.getComputedStyle(a).getPropertyValue(b))?a.trim():""},flushCustomStyles:function(){Y.flushCustomStyles()},nativeCss:u,nativeShadow:l,cssBuild:v};ua&&(window.ShadyCSS.CustomStyleInterface=ua)}window.ShadyCSS.ApplyShim=V;}).call(this); | ||
//# sourceMappingURL=apply-shim.min.js.map |
@@ -12,4 +12,5 @@ (function(){/* | ||
m.prototype.a=function(){for(var a=this.customStyles,b=0;b<a.length;b++){var d=a[b];if(!d.__shadyCSSCachedStyle){var e=this.b(d);e&&(e=e.__appliedElement||e,k&&k(e),d.__shadyCSSCachedStyle=e)}}return a};m.prototype.addCustomStyle=m.prototype.c;m.prototype.getStyleForCustomStyle=m.prototype.b;m.prototype.processStyles=m.prototype.a; | ||
Object.defineProperties(m.prototype,{transformCallback:{get:function(){return k},set:function(a){k=a}},validateCallback:{get:function(){return l},set:function(a){var b=!1;l||(b=!0);l=a;b&&n(this)}}});function p(a,b){for(var d in b)null===d?a.style.removeProperty(d):a.style.setProperty(d,b[d])};var q=!(window.ShadyDOM&&window.ShadyDOM.inUse),r;function t(a){r=a&&a.shimcssproperties?!1:q||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)"))}window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?r=window.ShadyCSS.nativeCss:window.ShadyCSS?(t(window.ShadyCSS),window.ShadyCSS=void 0):t(window.WebComponents&&window.WebComponents.flags);var u=r;var v=new m;window.ShadyCSS||(window.ShadyCSS={prepareTemplate:function(){},prepareTemplateDom:function(){},prepareTemplateStyles:function(){},styleSubtree:function(a,b){v.a();p(a,b)},styleElement:function(){v.a()},styleDocument:function(a){v.a();p(document.body,a)},getComputedStyleValue:function(a,b){return(a=window.getComputedStyle(a).getPropertyValue(b))?a.trim():""},flushCustomStyles:function(){},nativeCss:u,nativeShadow:q});window.ShadyCSS.CustomStyleInterface=v;}).call(this); | ||
Object.defineProperties(m.prototype,{transformCallback:{get:function(){return k},set:function(a){k=a}},validateCallback:{get:function(){return l},set:function(a){var b=!1;l||(b=!0);l=a;b&&n(this)}}});function p(a,b){for(var d in b)null===d?a.style.removeProperty(d):a.style.setProperty(d,b[d])};var q=!(window.ShadyDOM&&window.ShadyDOM.inUse),r;function t(a){r=a&&a.shimcssproperties?!1:q||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)"))}var u;window.ShadyCSS&&void 0!==window.ShadyCSS.cssBuild&&(u=window.ShadyCSS.cssBuild);window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?r=window.ShadyCSS.nativeCss:window.ShadyCSS?(t(window.ShadyCSS),window.ShadyCSS=void 0):t(window.WebComponents&&window.WebComponents.flags); | ||
var v=r,w=u;var x=new m;window.ShadyCSS||(window.ShadyCSS={prepareTemplate:function(){},prepareTemplateDom:function(){},prepareTemplateStyles:function(){},styleSubtree:function(a,b){x.a();p(a,b)},styleElement:function(){x.a()},styleDocument:function(a){x.a();p(document.body,a)},getComputedStyleValue:function(a,b){return(a=window.getComputedStyle(a).getPropertyValue(b))?a.trim():""},flushCustomStyles:function(){},nativeCss:v,nativeShadow:q,cssBuild:w});window.ShadyCSS.CustomStyleInterface=x;}).call(this); | ||
//# sourceMappingURL=custom-style-interface.min.js.map |
@@ -19,3 +19,3 @@ /** | ||
import {CustomStyleInterfaceInterface} from '../src/custom-style-interface.js'; // eslint-disable-line no-unused-vars | ||
import {nativeCssVariables, nativeShadow} from '../src/style-settings.js'; | ||
import {nativeCssVariables, nativeShadow, cssBuild} from '../src/style-settings.js'; | ||
@@ -35,4 +35,6 @@ /** @const {ApplyShim} */ | ||
} | ||
this.customStyleInterface = window.ShadyCSS.CustomStyleInterface; | ||
if (this.customStyleInterface) { | ||
if (window.ShadyCSS.CustomStyleInterface) { | ||
this.customStyleInterface = | ||
/** @type {!CustomStyleInterfaceInterface} */ ( | ||
window.ShadyCSS.CustomStyleInterface); | ||
this.customStyleInterface['transformCallback'] = (style) => { | ||
@@ -93,3 +95,5 @@ applyShim.transformCustomStyle(style); | ||
this.styleElement(element); | ||
let shadowChildren = element.shadowRoot.children || element.shadowRoot.childNodes; | ||
let shadowChildren = | ||
/** @type {!ParentNode} */ (element.shadowRoot).children || | ||
element.shadowRoot.childNodes; | ||
for (let i = 0; i < shadowChildren.length; i++) { | ||
@@ -164,3 +168,3 @@ this.styleSubtree(/** @type {HTMLElement} */(shadowChildren[i])); | ||
prepareTemplateStyles(template, elementName, elementExtends) { | ||
this.prepareTemplate(template, elementName, elementExtends); | ||
window.ShadyCSS.prepareTemplate(template, elementName, elementExtends); | ||
}, | ||
@@ -213,3 +217,4 @@ | ||
nativeCss: nativeCssVariables, | ||
nativeShadow: nativeShadow | ||
nativeShadow: nativeShadow, | ||
cssBuild: cssBuild | ||
}; | ||
@@ -216,0 +221,0 @@ |
@@ -15,3 +15,3 @@ /** | ||
import {getComputedStyleValue, updateNativeProperties} from '../src/common-utils.js'; | ||
import {nativeCssVariables, nativeShadow} from '../src/style-settings.js'; | ||
import {nativeCssVariables, nativeShadow, cssBuild} from '../src/style-settings.js'; | ||
@@ -77,3 +77,4 @@ const customStyleInterface = new CustomStyleInterface(); | ||
nativeCss: nativeCssVariables, | ||
nativeShadow: nativeShadow | ||
nativeShadow: nativeShadow, | ||
cssBuild: cssBuild | ||
} | ||
@@ -80,0 +81,0 @@ } |
@@ -14,3 +14,3 @@ /** | ||
import ScopingShim from '../src/scoping-shim.js'; | ||
import {nativeCssVariables, nativeShadow} from '../src/style-settings.js'; | ||
import {nativeCssVariables, nativeShadow, cssBuild} from '../src/style-settings.js'; | ||
@@ -96,3 +96,5 @@ /** @const {ScopingShim} */ | ||
nativeShadow: nativeShadow | ||
nativeShadow: nativeShadow, | ||
cssBuild: cssBuild | ||
}; | ||
@@ -99,0 +101,0 @@ |
@@ -17,2 +17,3 @@ /** @externs */ | ||
* nativeShadow: boolean, | ||
* cssBuild: (string | undefined), | ||
* }} | ||
@@ -25,3 +26,4 @@ */ | ||
* shimcssproperties: (boolean | undefined), | ||
* shimshadow: (boolean | undefined) | ||
* shimshadow: (boolean | undefined), | ||
* cssBuild: (string | undefined), | ||
* }} | ||
@@ -33,1 +35,33 @@ */ | ||
window.ShadyCSS; | ||
/** @type {string|undefined} */ | ||
Element.prototype.extends; | ||
/** @type {?Element|undefined} */ | ||
Element.prototype._element; | ||
/** @type {string|undefined} */ | ||
Element.prototype.__cssBuild; | ||
/** @type {boolean|undefined} */ | ||
HTMLTemplateElement.prototype._validating; | ||
/** @type {boolean|undefined} */ | ||
HTMLTemplateElement.prototype._prepared; | ||
/** @type {boolean|undefined} */ | ||
HTMLTemplateElement.prototype._domPrepared; | ||
/** @type {?DocumentFragment|undefined} */ | ||
HTMLTemplateElement.prototype._content; | ||
/** @type {?HTMLStyleElement|undefined} */ | ||
HTMLTemplateElement.prototype._gatheredStyle; | ||
/** @type {?HTMLStyleElement|undefined} */ | ||
HTMLTemplateElement.prototype._style; | ||
/** | ||
* @type {string | undefined} | ||
*/ | ||
DOMTokenList.prototype.value; |
{ | ||
"name": "@webcomponents/shadycss", | ||
"version": "1.5.2", | ||
"version": "1.6.0", | ||
"description": "Styling helpers for ShadyDOM", | ||
@@ -31,3 +31,3 @@ "main": "shadycss.min.js", | ||
"debug": "gulp debug", | ||
"lint": "eslint src test entrypoints", | ||
"lint": "eslint src tests entrypoints", | ||
"test": "npm run lint && gulp && wct", | ||
@@ -48,15 +48,15 @@ "prepack": "gulp closure" | ||
"devDependencies": { | ||
"@webcomponents/custom-elements": "^1.1.3", | ||
"@webcomponents/custom-elements": "^1.2.1", | ||
"@webcomponents/html-imports": "^1.2.0", | ||
"@webcomponents/shadydom": "^1.1.2", | ||
"@webcomponents/template": "^1.3.1", | ||
"@webcomponents/shadydom": "1.1.2", | ||
"@webcomponents/template": "^1.4.0", | ||
"@webcomponents/webcomponents-platform": "^1.0.0", | ||
"del": "^3.0.0", | ||
"es6-promise": "^4.2.4", | ||
"eslint": "^4.19.1", | ||
"eslint-plugin-html": "^4.0.5", | ||
"google-closure-compiler": "^20180506.0.0", | ||
"gulp": "^3.8.8", | ||
"es6-promise": "^4.2.5", | ||
"eslint": "^5.7.0", | ||
"eslint-plugin-html": "^4.0.6", | ||
"google-closure-compiler": "^20180805.0.0", | ||
"gulp": "^4.0.0", | ||
"gulp-rename": "^1.4.0", | ||
"gulp-size": "^2.1.0", | ||
"gulp-size": "^3.0.0", | ||
"gulp-sourcemaps": "^2.6.4", | ||
@@ -66,5 +66,5 @@ "rollup-stream": "=1.23.1", | ||
"vinyl-buffer": "^1.0.1", | ||
"vinyl-source-stream": "^1.1.2", | ||
"wct-browser-legacy": "^1.0.1", | ||
"web-component-tester": "^6.7.1" | ||
"vinyl-source-stream": "^2.0.0", | ||
"wct-browser-legacy": "^1.0.2", | ||
"web-component-tester": "^6.9.0" | ||
}, | ||
@@ -71,0 +71,0 @@ "publishConfig": { |
@@ -352,7 +352,32 @@ # ShadyCSS | ||
You must have a selector for ascendants of the `<slot>` element when using the `::slotted` | ||
pseudo-element. | ||
To use the `::slotted` pseudo-element, you must select it as a descendant of some context element. | ||
```css | ||
/* Bad */ | ||
::slotted() {} | ||
You cannot use any selector for the `<slot>` element. Rules like `.foo .bar::slotted(*)` are not supported. | ||
/* Good */ | ||
.context ::slotted() {} | ||
``` | ||
Since ShadyCSS removes all `<slot>` elements, you cannot select them directly or use any other selectors along with the `::slotted` pseudo-element selector. | ||
```html | ||
<!-- Bad --> | ||
<style> | ||
.foo .bar::slotted(*) {} | ||
</style> | ||
<span class="foo"> | ||
<slot class="bar"></slot> | ||
</span> | ||
``` | ||
```html | ||
<!-- Good --> | ||
<style> | ||
.foo ::slotted(*) {} | ||
</style> | ||
<span class="foo"> | ||
<slot></slot> | ||
</span> | ||
``` | ||
### Custom properties and `@apply` | ||
@@ -359,0 +384,0 @@ |
@@ -10,47 +10,49 @@ (function(){/* | ||
*/ | ||
'use strict';var l,aa="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;function m(){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 n(a){a=a.replace(ba,"").replace(ca,"");var b=da,c=a,e=new m;e.start=0;e.end=c.length;for(var d=e,f=0,h=c.length;f<h;f++)if("{"===c[f]){d.rules||(d.rules=[]);var g=d,k=g.rules[g.rules.length-1]||null;d=new m;d.start=f+1;d.parent=g;d.previous=k;g.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=p,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;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 h=d.length,g;f<h&&(g=d[f]);f++)e=la(g,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,p=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 q=!(window.ShadyDOM&&window.ShadyDOM.inUse),r;function qa(a){r=a&&a.shimcssproperties?!1:q||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)"))}window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?r=window.ShadyCSS.nativeCss:window.ShadyCSS?(qa(window.ShadyCSS),window.ShadyCSS=void 0):qa(window.WebComponents&&window.WebComponents.flags);var v=r;var w=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,x=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,ra=/(--[\w-]+)\s*([:,;)]|$)/gi,sa=/(animation\s*:)|(animation-name\s*:)/,ta=/@media\s(.*)/,ua=/\{[^}]*\}/g;var va=new Set;function y(a,b){if(!a)return"";"string"===typeof a&&(a=n(a));b&&z(a,b);return la(a,v)}function A(a){!a.__cssRules&&a.textContent&&(a.__cssRules=n(a.textContent));return a.__cssRules||null}function wa(a){return!!a.parent&&a.parent.type===p}function z(a,b,c,e){if(a){var d=!1,f=a.type;if(e&&f===ha){var h=a.selector.match(ta);h&&(window.matchMedia(h[1]).matches||(d=!0))}f===ka?b(a):c&&f===p?c(a):f===ja&&(d=!0);if((a=a.rules)&&!d){d=0;f=a.length;for(var g;d<f&&(g=a[d]);d++)z(g,b,c,e)}}} | ||
function B(a,b,c,e){var d=document.createElement("style");b&&d.setAttribute("scope",b);d.textContent=a;xa(d,c,e);return d}var C=null;function ya(a){a=document.createComment(" Shady DOM styles for "+a+" ");var b=document.head;b.insertBefore(a,(C?C.nextSibling:null)||b.firstChild);return C=a}function xa(a,b,c){b=b||document.head;b.insertBefore(a,c&&c.nextSibling||b.firstChild);C?a.compareDocumentPosition(C)===Node.DOCUMENT_POSITION_PRECEDING&&(C=a):C=a} | ||
function D(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 za(a,b){var c=a.indexOf("var(");if(-1===c)return b(a,"","","");var e=D(a,c+3),d=a.substring(c+4,e);c=a.substring(0,c);a=za(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){q?a.setAttribute("class",b):window.ShadyDOM.nativeMethods.setAttribute.call(a,"class",b)} | ||
function F(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,u:c}}function Aa(a){for(var b=[],c="",e=0;0<=e&&e<a.length;e++)if("("===a[e]){var d=D(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 G(a){if(void 0===a.a){var b=a.getAttribute("css-build");if(b)a.a=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.a=b}}return a.a||""};function H(){}function Ba(a,b){I(J,a,function(a){K(a,b||"")})}function I(a,b,c){b.nodeType===Node.ELEMENT_NODE&&c(b);if(b="template"===b.localName?(b.content||b.S||b).childNodes:b.children||b.childNodes)for(var e=0;e<b.length;e++)I(a,b[e],c)} | ||
function K(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(Ca);c?e&&(b=e.replace("style-scope","").replace(b,""),E(a,b)):E(a,(e?e+" ":"")+"style-scope "+b)}}function Da(a,b,c){I(J,a,function(a){K(a,b,!0);K(a,c)})}function Ea(a,b){I(J,a,function(a){K(a,b||"",!0)})} | ||
function L(a,b,c,e){var d=J;q||"shady"===(void 0===e?"":e)?b=y(b,c):(a=F(a),b=Fa(d,b,a.is,a.u,c)+"\n\n");return b.trim()}function Fa(a,b,c,e,d){var f=Ga(c,e);c=c?Ha+c:"";return y(b,function(b){b.c||(b.selector=b.h=Ia(a,b,a.b,c,f),b.c=!0);d&&d(b,c,f)})}function Ga(a,b){return b?"[is="+a+"]":a}function Ia(a,b,c,e,d){var f=Aa(b.selector);if(!wa(b)){b=0;for(var h=f.length,g;b<h&&(g=f[b]);b++)f[b]=c.call(a,g,e,d)}return f.filter(function(a){return!!a}).join(Ja)} | ||
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=D(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{B: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])} | ||
H.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 h=Ma(a);a=h.B;h=h.matches}a=a.replace(Pa,M+" $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,h));d&&(a=Ka(a));return a}; | ||
function Ra(a,b,c,e){var d=a.indexOf(Sa);0<=a.indexOf(M)?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}))}a=a.replace(Wa,function(a,b,c){return'[dir="'+c+'"] '+b+", "+b+'[dir="'+c+'"]'});return{value:a,G:b,stop:f}}function Ua(a,b){a=a.split(Xa);a[0]+=b;return a.join(Xa)} | ||
function Ta(a,b){var c=a.match(Ya);return(c=c&&c[2].trim()||"")?c[0].match(Za)?a.replace(Ya,function(a,c,f){return b+f}):c.split(Za)[0]===b?c:$a:a.replace(M,b)}function ab(a){a.selector===bb&&(a.selector="html")}H.prototype.c=function(a){return a.match(M)?"":a.match(Sa)?this.b(a,cb):Ua(a.trim(),cb)};aa.Object.defineProperties(H.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"style-scope"}}}); | ||
var La=/:(nth[-\w]+)\(([^)]+)\)/,cb=":not(.style-scope)",Ja=",",Qa=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g,Za=/[[.:#*]/,M=":host",bb=":root",Sa="::slotted",Pa=new RegExp("^("+Sa+")"),Ya=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Va=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Wa=/(.*):dir\((?:(ltr|rtl))\)/,Ha=".",Xa=":",Ca="class",$a="should_not_match",Na=/:(?:matches|any|-(?:webkit|moz)-any)/,J=new H;function N(a,b,c,e,d){this.l=a||null;this.b=b||null;this.c=c||[];this.o=null;this.v=d||"";this.u=e||"";this.a=this.i=this.m=null}function O(a){return a?a.__styleInfo:null}function db(a,b){return a.__styleInfo=b}N.prototype.g=function(){return this.l};N.prototype._getStyleRules=N.prototype.g;function eb(a){var b=this.matches||this.matchesSelector||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector;return b&&b.call(this,a)}var fb=navigator.userAgent.match("Trident");function gb(){}function hb(a){var b={},c=[],e=0;z(a,function(a){P(a);a.index=e++;a=a.f.cssText;for(var c;c=ra.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.j=c,a.rules=null);b.cssText=a.parsedCssText.replace(ua,"").replace(w,"");a.f=b}}function R(a,b){var c=a.f;if(c){if(c.j)return Object.assign(b,c.j),!0}else{c=a.parsedCssText;for(var e;a=w.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(";")?ib(a,b,c):za(b,function(b,d,f,h){if(!d)return b+h;(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||"")+h}));return b&&b.trim()||""} | ||
function ib(a,b,c){b=b.split(";");for(var e=0,d,f;e<b.length;e++)if(d=b[e]){x.lastIndex=0;if(f=x.exec(d))d=S(a,c[f[1]],c);else if(f=d.indexOf(":"),-1!==f){var h=d.substring(f);h=h.trim();h=S(a,h,c)||h;d=d.substring(0,f)+h}b[e]=d&&d.lastIndexOf(";")===d.length-1?d.slice(0,-1):d||""}return b.join(";")} | ||
function jb(a,b){var c={},e=[];z(a,function(a){a.f||P(a);var d=a.h||a.parsedSelector;b&&a.f.j&&d&&eb.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{j:c,key:e}} | ||
function kb(a,b,c,e){b.f||P(b);if(b.f.j){var d=F(a);a=d.is;d=d.u;d=a?Ga(a,d):"html";var f=b.parsedSelector,h=":host > *"===f||"html"===f,g=0===f.indexOf(":host")&&!h;"shady"===c&&(h=f===d+" > *."+d||-1!==f.indexOf("html"),g=!h&&0===f.indexOf(d));if(h||g)c=d,g&&(b.h||(b.h=Ia(J,b,J.b,a?Ha+a:"",d)),c=b.h||d),e({B:c,K:g,T:h})}}function lb(a,b,c){var e={},d={};z(b,function(b){kb(a,b,c,function(c){eb.call(a.U||a,c.B)&&(c.K?R(b,e):R(b,d))})},null,!0);return{L:d,J:e}} | ||
function mb(a,b,c,e){var d=F(b),f=Ga(d.is,d.u),h=new RegExp("(?:^|[^.#[:])"+(b.extends?"\\"+f.slice(0,-1)+"\\]":f)+"($|[.:[\\s>+~])"),g=O(b);d=g.l;g=g.v;var k=nb(d,e);return L(b,d,function(b){var d="";b.f||P(b);b.f.cssText&&(d=ib(a,b.f.cssText,c));b.cssText=d;if(!q&&!wa(b)&&b.cssText){var g=d=b.cssText;null==b.C&&(b.C=sa.test(d));if(b.C)if(null==b.A){b.A=[];for(var t in k)g=k[t],g=g(d),d!==g&&(d=g,b.A.push(t))}else{for(t=0;t<b.A.length;++t)g=k[b.A[t]],d=g(d);g=d}b.cssText=g;b.h=b.h||b.selector;d= | ||
"."+e;t=Aa(b.h);g=0;for(var u=t.length,Q;g<u&&(Q=t[g]);g++)t[g]=Q.match(h)?Q.replace(f,d):d+" "+Q;b.selector=t.join(",")}},g)}function nb(a,b){a=a.b;var c={};if(!q&&a)for(var e=0,d=a[e];e<a.length;d=a[++e]){var f=d,h=b;f.g=new RegExp("\\b"+f.keyframesName+"(?!\\B|-)","g");f.a=f.keyframesName+"-"+h;f.h=f.h||f.selector;f.selector=f.h.replace(f.keyframesName,f.a);c[d.keyframesName]=ob(d)}return c}function ob(a){return function(b){return b.replace(a.g,a.a)}} | ||
function pb(a,b){var c=T,e=A(a);a.textContent=y(e,function(a){var d=a.cssText=a.parsedCssText;a.f&&a.f.cssText&&(d=d.replace(ma,"").replace(na,""),a.cssText=ib(c,d,b))})}aa.Object.defineProperties(gb.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"x-scope"}}});var T=new gb;var U={},V=window.customElements;if(V&&!q){var qb=V.define;V.define=function(a,b,c){U[a]||(U[a]=ya(a));qb.call(V,a,b,c)}};function rb(){this.cache={}}rb.prototype.store=function(a,b,c,e){var d=this.cache[a]||[];d.push({j:b,styleElement:c,i:e});100<d.length&&d.shift();this.cache[a]=d};function sb(){}function tb(a){var b=[];a.classList?b=Array.from(a.classList):a instanceof window.SVGElement&&a.hasAttribute("class")&&(b=a.getAttribute("class").split(/\s+/));a=b;b=a.indexOf(J.a);return-1<b?a[b+1]:""}function ub(a){var b=a.getRootNode();return b===a||b===a.ownerDocument?"":(a=b.host)?F(a).is:""} | ||
function vb(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(),h=tb(d);if(h&&f===d.ownerDocument&&("style"!==d.localName&&"template"!==d.localName||""===G(d)))Ea(d,h);else if(f instanceof ShadowRoot)for(f=ub(d),f!==h&&Da(d,h,f),d=window.ShadyDOM.nativeMethods.querySelectorAll.call(d,":not(."+J.a+")"),h=0;h<d.length;h++){f=d[h]; | ||
var g=ub(f);g&&K(f,g)}}}}} | ||
if(!(q||window.ShadyDOM&&window.ShadyDOM.handlesDynamicScoping)){var wb=new MutationObserver(vb),xb=function(a){wb.observe(a,{childList:!0,subtree:!0})};if(window.customElements&&!window.customElements.polyfillWrapFlushCallback)xb(document);else{var yb=function(){xb(document.body)};window.HTMLImports?window.HTMLImports.whenReady(yb):requestAnimationFrame(function(){if("loading"===document.readyState){var a=function(){yb();document.removeEventListener("readystatechange",a)};document.addEventListener("readystatechange", | ||
a)}else yb()})}sb=function(){vb(wb.takeRecords())}}var zb=sb;var W={};var Ab=Promise.resolve();function Bb(a){if(a=W[a])a._applyShimCurrentVersion=a._applyShimCurrentVersion||0,a._applyShimValidatingVersion=a._applyShimValidatingVersion||0,a._applyShimNextVersion=(a._applyShimNextVersion||0)+1}function Cb(a){return a._applyShimCurrentVersion===a._applyShimNextVersion}function Db(a){a._applyShimValidatingVersion=a._applyShimNextVersion;a.c||(a.c=!0,Ab.then(function(){a._applyShimCurrentVersion=a._applyShimNextVersion;a.c=!1}))};var Eb=new rb;function X(){this.w={};this.c=document.documentElement;var a=new m;a.rules=[];this.g=db(this.c,new N(a));this.s=!1;this.b=this.a=null}l=X.prototype;l.flush=function(){zb()};l.I=function(a){return A(a)};l.P=function(a){return y(a)};l.prepareTemplate=function(a,b,c){this.prepareTemplateDom(a,b);this.prepareTemplateStyles(a,b,c)}; | ||
l.prepareTemplateStyles=function(a,b,c){if(!a.w){q||U[b]||(U[b]=ya(b));a.w=!0;a.name=b;a.extends=c;W[b]=a;var e=G(a);var d=[];for(var f=a.content.querySelectorAll("style"),h=0;h<f.length;h++){var g=f[h];if(g.hasAttribute("shady-unscoped")){if(!q){var k=g.textContent;va.has(k)||(va.add(k),k=g.cloneNode(!0),document.head.appendChild(k));g.parentNode.removeChild(g)}}else d.push(g.textContent),g.parentNode.removeChild(g)}d=d.join("").trim();c={is:b,extends:c};Y(this);if(f=""===G(a))f=x.test(d)||w.test(d), | ||
x.lastIndex=0,w.lastIndex=0;d=n(d);f&&v&&this.a&&this.a.transformRules(d,b);a._styleAst=d;d=[];v||(d=hb(a._styleAst));if(!d.length||v)f=q?a.content:null,b=U[b]||null,e=L(c,a._styleAst,null,e),e=e.length?B(e,c.is,f,b):void 0,a.b=e;a.s=d}};l.prepareTemplateDom=function(a,b){var c=G(a);q||"shady"===c||a.g||(a.g=!0,Ba(a.content,b))}; | ||
function Fb(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.s)&&a.flushCustomStyles()})})}function Y(a){!a.a&&window.ShadyCSS&&window.ShadyCSS.ApplyShim&&(a.a=window.ShadyCSS.ApplyShim,a.a.invalidCallback=Bb);Fb(a)} | ||
l.flushCustomStyles=function(){Y(this);if(this.b){var a=this.b.processStyles();if(this.b.enqueued){if(v)for(var b=0;b<a.length;b++){var c=this.b.getStyleForCustomStyle(a[b]);if(c&&v&&this.a){var e=A(c);Y(this);this.a.transformRules(e);c.textContent=y(e)}}else for(Gb(this,this.c,this.g),b=0;b<a.length;b++)(c=this.b.getStyleForCustomStyle(a[b]))&&pb(c,this.g.m);this.b.enqueued=!1;this.s&&!v&&this.styleDocument()}}}; | ||
l.styleElement=function(a,b){var c=O(a);if(!c){var e=F(a);c=e.is;e=e.u;var d=U[c]||null;c=W[c];if(c){var f=c._styleAst;var h=c.s;var g=G(c)}f=new N(f,d,h,e,g);c&&db(a,f);c=f}a!==this.c&&(this.s=!0);b&&(c.o=c.o||{},Object.assign(c.o,b));if(v){b=c;f=F(a).is;if(b.o){h=b.o;for(var k in h)null===k?a.style.removeProperty(k):a.style.setProperty(k,h[k])}if(!(!(k=W[f])&&a!==this.c||k&&""!==G(k))&&k&&k.b&&!Cb(k)){if(Cb(k)||k._applyShimValidatingVersion!==k._applyShimNextVersion)Y(this),this.a&&this.a.transformRules(k._styleAst, | ||
f),k.b.textContent=L(a,b.l),Db(k);q&&(f=a.shadowRoot)&&(f=f.querySelector("style"))&&(f.textContent=L(a,b.l));b.l=k._styleAst}}else if(k=c,this.flush(),Gb(this,a,k),k.c&&k.c.length){b=F(a).is;a:{if(f=Eb.cache[b])for(h=f.length-1;0<=h;h--){g=f[h];b:{c=k.c;for(e=0;e<c.length;e++)if(d=c[e],g.j[d]!==k.m[d]){c=!1;break b}c=!0}if(c){f=g;break a}}f=void 0}c=f?f.styleElement:null;h=k.i;(g=f&&f.i)||(g=this.w[b]=(this.w[b]||0)+1,g=b+"-"+g);k.i=g;g=k.i;e=T;e=c?c.textContent||"":mb(e,a,k.m,g);d=O(a);var u=d.a; | ||
u&&!q&&u!==c&&(u._useCount--,0>=u._useCount&&u.parentNode&&u.parentNode.removeChild(u));q?d.a?(d.a.textContent=e,c=d.a):e&&(c=B(e,g,a.shadowRoot,d.b)):c?c.parentNode||(fb&&-1<e.indexOf("@media")&&(c.textContent=e),xa(c,null,d.b)):e&&(c=B(e,g,null,d.b));c&&(c._useCount=c._useCount||0,d.a!=c&&c._useCount++,d.a=c);g=c;q||(c=k.i,d=e=a.getAttribute("class")||"",h&&(d=e.replace(new RegExp("\\s*x-scope\\s*"+h+"\\s*","g")," ")),d+=(d?" ":"")+"x-scope "+c,e!==d&&E(a,d));f||Eb.store(b,k.m,g,k.i)}}; | ||
function Hb(a,b){return(b=b.getRootNode().host)?O(b)?b:Hb(a,b):a.c}function Gb(a,b,c){a=Hb(a,b);var e=O(a);a=Object.create(e.m||null);var d=lb(b,c.l,c.v);b=jb(e.l,b).j;Object.assign(a,d.J,b,d.L);b=c.o;for(var f in b)if((d=b[f])||0===d)a[f]=d;f=T;b=Object.getOwnPropertyNames(a);for(d=0;d<b.length;d++)e=b[d],a[e]=S(f,a[e],a);c.m=a}l.styleDocument=function(a){this.styleSubtree(this.c,a)}; | ||
'use strict';var l,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,k=h.rules[h.rules.length-1]||null;d=new n;d.start=f+1;d.parent=h;d.previous=k;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);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 u=t,v=ra;var w=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,x=/(?:^|\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 y(a,b){if(!a)return"";"string"===typeof a&&(a=p(a));b&&z(a,b);return la(a,u)}function A(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 z(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++)z(g,b,c,e)}} | ||
function B(a,b,c,e){var d=document.createElement("style");b&&d.setAttribute("scope",b);d.textContent=a;ya(d,c,e);return d}var C=null;function za(a){a=document.createComment(" Shady DOM styles for "+a+" ");var b=document.head;b.insertBefore(a,(C?C.nextSibling:null)||b.firstChild);return C=a}function ya(a,b,c){b=b||document.head;b.insertBefore(a,c&&c.nextSibling||b.firstChild);C?a.compareDocumentPosition(C)===Node.DOCUMENT_POSITION_PRECEDING&&(C=a):C=a} | ||
function D(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 Aa(a,b){var c=a.indexOf("var(");if(-1===c)return b(a,"","","");var e=D(a,c+3),d=a.substring(c+4,e);c=a.substring(0,c);a=Aa(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)} | ||
function F(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 Ba(a){for(var b=[],c="",e=0;0<=e&&e<a.length;e++)if("("===a[e]){var d=D(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 G(a){if(void 0!==v)return v;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 H(a){a=void 0===a?"":a;return""!==a&&u?r?"shadow"===a:"shady"===a:!1};function I(){}function Ca(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 Da(a,b,c){J(K,a,function(a){L(a,b,!0);L(a,c)})}function Ea(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=y(b,c):(a=F(a),d=Fa(f,b,a.is,a.s,c)+"\n\n"));return d.trim()}function Fa(a,b,c,e,d){var f=Ga(c,e);c=c?"."+c:"";return y(b,function(b){b.c||(b.selector=b.h=Ha(a,b,a.b,c,f),b.c=!0);d&&d(b,c,f)})}function Ga(a,b){return b?"[is="+a+"]":a}function Ha(a,b,c,e,d){var f=Ba(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 Ia(a){return a.replace(Ja,function(a,c,e){-1<e.indexOf("+")?e=e.replace(/\+/g,"___"):-1<e.indexOf("___")&&(e=e.replace(/___/g,"+"));return":"+c+"("+e+")"})}function Ka(a){for(var b=[],c;c=a.match(La);){var e=c.index,d=D(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{w:a,matches:b}}function Ma(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=Ja.test(a);d&&(a=a.replace(Ja,function(a,b,c){return":"+b+"("+c.replace(/\s/g,"")+")"}),a=Ia(a));var f=La.test(a);if(f){var g=Ka(a);a=g.w;g=g.matches}a=a.replace(Na,":host $1");a=a.replace(Oa,function(a,d,f){e||(a=Pa(f,d,b,c),e=e||a.stop,d=a.F,f=a.value);return d+f});f&&(a=Ma(a,g));d&&(a=Ia(a));return a}; | ||
function Pa(a,b,c,e){var d=a.indexOf("::slotted");0<=a.indexOf(":host")?a=Qa(a,e):0!==d&&(a=c?Ra(a,c):a);c=!1;0<=d&&(b="",c=!0);if(c){var f=!0;c&&(a=a.replace(Sa,function(a,b){return" > "+b}))}a=a.replace(Ta,function(a,b,c){return'[dir="'+c+'"] '+b+", "+b+'[dir="'+c+'"]'});return{value:a,F:b,stop:f}}function Ra(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 Qa(a,b){var c=a.match(Ua);return(c=c&&c[2].trim()||"")?c[0].match(Va)?a.replace(Ua,function(a,c,f){return b+f}):c.split(Va)[0]===b?c:"should_not_match":a.replace(":host",b)}function Wa(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)"):Ra(a.trim(),":not(.style-scope)")};aa.Object.defineProperties(I.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"style-scope"}}}); | ||
var Ja=/:(nth[-\w]+)\(([^)]+)\)/,Oa=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g,Va=/[[.:#*]/,Na=/^(::slotted)/,Ua=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Sa=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Ta=/(.*):dir\((?:(ltr|rtl))\)/,La=/:(?:matches|any|-(?:webkit|moz)-any)/,K=new I;function N(a,b,c,e,d){this.l=a||null;this.b=b||null;this.c=c||[];this.o=null;this.cssBuild=d||"";this.s=e||"";this.a=this.i=this.m=null}function P(a){return a?a.__styleInfo:null}function Xa(a,b){return a.__styleInfo=b}N.prototype.g=function(){return this.l};N.prototype._getStyleRules=N.prototype.g;function Ya(a){var b=this.matches||this.matchesSelector||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector;return b&&b.call(this,a)}var Za=navigator.userAgent.match("Trident");function $a(){}function ab(a){var b={},c=[],e=0;z(a,function(a){Q(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 Q(a){if(!a.f){var b={},c={};R(a,c)&&(b.j=c,a.rules=null);b.cssText=a.parsedCssText.replace(va,"").replace(w,"");a.f=b}}function R(a,b){var c=a.f;if(c){if(c.j)return Object.assign(b,c.j),!0}else{c=a.parsedCssText;for(var e;a=w.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(";")?bb(a,b,c):Aa(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 bb(a,b,c){b=b.split(";");for(var e=0,d,f;e<b.length;e++)if(d=b[e]){x.lastIndex=0;if(f=x.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 cb(a,b){var c={},e=[];z(a,function(a){a.f||Q(a);var d=a.h||a.parsedSelector;b&&a.f.j&&d&&Ya.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{j:c,key:e}} | ||
function db(a,b,c,e){b.f||Q(b);if(b.f.j){var d=F(a);a=d.is;d=d.s;d=a?Ga(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.h||(b.h=Ha(K,b,K.b,a?"."+a:"",d)),c=b.h||d),e({w:c,J:h,R:g})}}function eb(a,b,c){var e={},d={};z(b,function(b){db(a,b,c,function(c){Ya.call(a._element||a,c.w)&&(c.J?R(b,e):R(b,d))})},null,!0);return{K:d,I:e}} | ||
function fb(a,b,c,e){var d=F(b),f=Ga(d.is,d.s),g=new RegExp("(?:^|[^.#[:])"+(b.extends?"\\"+f.slice(0,-1)+"\\]":f)+"($|[.:[\\s>+~])"),h=P(b);d=h.l;h=h.cssBuild;var k=gb(d,e);return M(b,d,function(b){var d="";b.f||Q(b);b.f.cssText&&(d=bb(a,b.f.cssText,c));b.cssText=d;if(!r&&!xa(b)&&b.cssText){var h=d=b.cssText;null==b.B&&(b.B=ta.test(d));if(b.B)if(null==b.u){b.u=[];for(var m in k)h=k[m],h=h(d),d!==h&&(d=h,b.u.push(m))}else{for(m=0;m<b.u.length;++m)h=k[b.u[m]],d=h(d);h=d}b.cssText=h;b.h=b.h||b.selector; | ||
d="."+e;m=Ba(b.h);h=0;for(var vb=m.length,O=void 0;h<vb&&(O=m[h]);h++)m[h]=O.match(g)?O.replace(f,d):d+" "+O;b.selector=m.join(",")}},h)}function gb(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.g=new RegExp("\\b"+f.keyframesName+"(?!\\B|-)","g");f.a=f.keyframesName+"-"+g;f.h=f.h||f.selector;f.selector=f.h.replace(f.keyframesName,f.a);c[d.keyframesName]=hb(d)}return c}function hb(a){return function(b){return b.replace(a.g,a.a)}} | ||
function ib(a,b){var c=T,e=A(a);a.textContent=y(e,function(a){var d=a.cssText=a.parsedCssText;a.f&&a.f.cssText&&(d=d.replace(ma,"").replace(na,""),a.cssText=bb(c,d,b))})}aa.Object.defineProperties($a.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"x-scope"}}});var T=new $a;var U={},V=window.customElements;if(V&&!r){var jb=V.define;V.define=function(a,b,c){U[a]||(U[a]=za(a));jb.call(V,a,b,c)}};function kb(){this.cache={}}kb.prototype.store=function(a,b,c,e){var d=this.cache[a]||[];d.push({j:b,styleElement:c,i:e});100<d.length&&d.shift();this.cache[a]=d};function lb(){}var mb=new RegExp(K.a+"\\s*([^\\s]*)");function nb(a){return(a=(a.classList&&a.classList.value?a.classList.value:a.getAttribute("class")||"").match(mb))?a[1]:""}function ob(a){var b=a.getRootNode();return b===a||b===a.ownerDocument?"":(a=b.host)?F(a).is:""} | ||
function pb(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=nb(d);if(g&&f===d.ownerDocument&&("style"!==d.localName&&"template"!==d.localName||""===G(d)))Ea(d,g);else if(f instanceof ShadowRoot)for(f=ob(d),f!==g&&Da(d,g,f),d=window.ShadyDOM.nativeMethods.querySelectorAll.call(d,":not(."+K.a+")"),g=0;g<d.length;g++){f=d[g]; | ||
var h=ob(f);h&&L(f,h)}}}}} | ||
if(!(r||window.ShadyDOM&&window.ShadyDOM.handlesDynamicScoping)){var qb=new MutationObserver(pb),rb=function(a){qb.observe(a,{childList:!0,subtree:!0})};if(window.customElements&&!window.customElements.polyfillWrapFlushCallback)rb(document);else{var sb=function(){rb(document.body)};window.HTMLImports?window.HTMLImports.whenReady(sb):requestAnimationFrame(function(){if("loading"===document.readyState){var a=function(){sb();document.removeEventListener("readystatechange",a)};document.addEventListener("readystatechange", | ||
a)}else sb()})}lb=function(){pb(qb.takeRecords())}}var tb=lb;var W={};var ub=Promise.resolve();function wb(a){if(a=W[a])a._applyShimCurrentVersion=a._applyShimCurrentVersion||0,a._applyShimValidatingVersion=a._applyShimValidatingVersion||0,a._applyShimNextVersion=(a._applyShimNextVersion||0)+1}function xb(a){return a._applyShimCurrentVersion===a._applyShimNextVersion}function yb(a){a._applyShimValidatingVersion=a._applyShimNextVersion;a._validating||(a._validating=!0,ub.then(function(){a._applyShimCurrentVersion=a._applyShimNextVersion;a._validating=!1}))};var zb=new kb;function X(){this.A={};this.c=document.documentElement;var a=new n;a.rules=[];this.g=Xa(this.c,new N(a));this.v=!1;this.b=this.a=null}l=X.prototype;l.flush=function(){tb()};l.H=function(a){return A(a)};l.O=function(a){return y(a)};l.prepareTemplate=function(a,b,c){this.prepareTemplateDom(a,b);this.prepareTemplateStyles(a,b,c)}; | ||
l.prepareTemplateStyles=function(a,b,c){if(!a._prepared){r||U[b]||(U[b]=za(b));a._prepared=!0;a.name=b;a.extends=c;W[b]=a;var e=G(a),d=H(e);c={is:b,extends:c};var f=[];for(var g=a.content.querySelectorAll("style"),h=0;h<g.length;h++){var k=g[h];if(k.hasAttribute("shady-unscoped")){if(!r){var m=k.textContent;wa.has(m)||(wa.add(m),m=k.cloneNode(!0),document.head.appendChild(m));k.parentNode.removeChild(k)}}else f.push(k.textContent),k.parentNode.removeChild(k)}f=f.join("").trim();Y(this);if(!d){if(g= | ||
!e)g=x.test(f)||w.test(f),x.lastIndex=0,w.lastIndex=0;h=p(f);g&&u&&this.a&&this.a.transformRules(h,b);a._styleAst=h}g=[];u||(g=ab(a._styleAst));if(!g.length||u)h=r?a.content:null,b=U[b]||null,e=M(c,a._styleAst,null,e,d?f:""),e=e.length?B(e,c.is,h,b):null,a._style=e;a.a=g}};l.prepareTemplateDom=function(a,b){var c=G(a);r||"shady"===c||a._domPrepared||(a._domPrepared=!0,Ca(a.content,b))}; | ||
function Ab(a){!a.b&&window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface&&(a.b=window.ShadyCSS.CustomStyleInterface,a.b.transformCallback=function(b){a.C(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=wb);Ab(a)} | ||
l.flushCustomStyles=function(){Y(this);if(this.b){var a=this.b.processStyles();if(this.b.enqueued&&!H(this.g.cssBuild)){if(u){if(!this.g.cssBuild)for(var b=0;b<a.length;b++){var c=this.b.getStyleForCustomStyle(a[b]);if(c&&u&&this.a){var e=A(c);Y(this);this.a.transformRules(e);c.textContent=y(e)}}}else{Bb(this,this.c,this.g);for(b=0;b<a.length;b++)(c=this.b.getStyleForCustomStyle(a[b]))&&ib(c,this.g.m);this.v&&this.styleDocument()}this.b.enqueued=!1}}}; | ||
l.styleElement=function(a,b){var c=P(a);if(!c){var e=F(a);c=e.is;e=e.s;var d=U[c]||null;c=W[c];if(c){var f=c._styleAst;var g=c.a;var h=G(c)}f=new N(f,d,g,e,h);c&&Xa(a,f);c=f}a!==this.c&&(this.v=!0);b&&(c.o=c.o||{},Object.assign(c.o,b));if(u){b=c;f=F(a).is;if(b.o){g=b.o;for(var k in g)null===k?a.style.removeProperty(k):a.style.setProperty(k,g[k])}if(!(!(k=W[f])&&a!==this.c||k&&""!==G(k))&&k&&k._style&&!xb(k)){if(xb(k)||k._applyShimValidatingVersion!==k._applyShimNextVersion)Y(this),this.a&&this.a.transformRules(k._styleAst, | ||
f),k._style.textContent=M(a,b.l),yb(k);r&&(f=a.shadowRoot)&&(f=f.querySelector("style"))&&(f.textContent=M(a,b.l));b.l=k._styleAst}}else if(k=c,this.flush(),Bb(this,a,k),k.c&&k.c.length){b=F(a).is;a:{if(f=zb.cache[b])for(g=f.length-1;0<=g;g--){h=f[g];b:{c=k.c;for(e=0;e<c.length;e++)if(d=c[e],h.j[d]!==k.m[d]){c=!1;break b}c=!0}if(c){f=h;break a}}f=void 0}c=f?f.styleElement:null;g=k.i;(h=f&&f.i)||(h=this.A[b]=(this.A[b]||0)+1,h=b+"-"+h);k.i=h;h=k.i;e=T;e=c?c.textContent||"":fb(e,a,k.m,h);d=P(a);var m= | ||
d.a;m&&!r&&m!==c&&(m._useCount--,0>=m._useCount&&m.parentNode&&m.parentNode.removeChild(m));r?d.a?(d.a.textContent=e,c=d.a):e&&(c=B(e,h,a.shadowRoot,d.b)):c?c.parentNode||(Za&&-1<e.indexOf("@media")&&(c.textContent=e),ya(c,null,d.b)):e&&(c=B(e,h,null,d.b));c&&(c._useCount=c._useCount||0,d.a!=c&&c._useCount++,d.a=c);h=c;r||(c=k.i,d=e=a.getAttribute("class")||"",g&&(d=e.replace(new RegExp("\\s*x-scope\\s*"+g+"\\s*","g")," ")),d+=(d?" ":"")+"x-scope "+c,e!==d&&E(a,d));f||zb.store(b,k.m,h,k.i)}}; | ||
function Cb(a,b){return(b=b.getRootNode().host)?P(b)?b:Cb(a,b):a.c}function Bb(a,b,c){a=Cb(a,b);var e=P(a);a=Object.create(e.m||null);var d=eb(b,c.l,c.cssBuild);b=cb(e.l,b).j;Object.assign(a,d.I,b,d.K);b=c.o;for(var f in b)if((d=b[f])||0===d)a[f]=d;f=T;b=Object.getOwnPropertyNames(a);for(d=0;d<b.length;d++)e=b[d],a[e]=S(f,a[e],a);c.m=a}l.styleDocument=function(a){this.styleSubtree(this.c,a)}; | ||
l.styleSubtree=function(a,b){var c=a.shadowRoot;(c||a===this.c)&&this.styleElement(a,b);if(b=c&&(c.children||c.childNodes))for(a=0;a<b.length;a++)this.styleSubtree(b[a]);else if(a=a.children||a.childNodes)for(b=0;b<a.length;b++)this.styleSubtree(a[b])}; | ||
l.D=function(a){var b=this,c=A(a),e=G(a);e!==this.g.v&&(this.g.v=e);z(c,function(a){if(q)ab(a);else{var c=J;a.selector=a.parsedSelector;ab(a);a.selector=a.h=Ia(c,a,c.c,void 0,void 0)}v&&""===e&&(Y(b),b.a&&b.a.transformRule(a))});v?a.textContent=y(c):this.g.l.rules.push(c)};l.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():""}; | ||
l.O=function(a,b){var c=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]===J.a){c=e[d+1];break}}}c&&b.push(J.a,c);v||(c=O(a))&&c.i&&b.push(T.a,c.i);E(a,b.join(" "))};l.F=function(a){return O(a)};l.N=function(a,b){K(a,b)};l.R=function(a,b){K(a,b,!0)};l.M=function(a){return ub(a)};l.H=function(a){return tb(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.O;X.prototype._styleInfoForNode=X.prototype.F;X.prototype.transformCustomStyleForDocument=X.prototype.D;X.prototype.getStyleAst=X.prototype.I;X.prototype.styleAstToString=X.prototype.P;X.prototype.flushCustomStyles=X.prototype.flushCustomStyles; | ||
X.prototype.scopeNode=X.prototype.N;X.prototype.unscopeNode=X.prototype.R;X.prototype.scopeForNode=X.prototype.M;X.prototype.currentScopeForNode=X.prototype.H;Object.defineProperties(X.prototype,{nativeShadow:{get:function(){return q}},nativeCss:{get:function(){return v}}});var Z=new X,Ib,Jb;window.ShadyCSS&&(Ib=window.ShadyCSS.ApplyShim,Jb=window.ShadyCSS.CustomStyleInterface); | ||
l.C=function(a){var b=this,c=G(a);c!==this.g.cssBuild&&(this.g.cssBuild=c);if(!H(c)){var e=A(a);z(e,function(a){if(r)Wa(a);else{var d=K;a.selector=a.parsedSelector;Wa(a);a.selector=a.h=Ha(d,a,d.c,void 0,void 0)}u&&""===c&&(Y(b),b.a&&b.a.transformRule(a))});u?a.textContent=y(e):this.g.l.rules.push(e)}};l.getComputedStyleValue=function(a,b){var c;u||(c=(P(a)||P(Cb(this,a))).m[b]);return(c=c||window.getComputedStyle(a).getPropertyValue(b))?c.trim():""}; | ||
l.N=function(a,b){var c=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);u||(c=P(a))&&c.i&&b.push(T.a,c.i);E(a,b.join(" "))};l.D=function(a){return P(a)};l.M=function(a,b){L(a,b)};l.P=function(a,b){L(a,b,!0)};l.L=function(a){return ob(a)};l.G=function(a){return nb(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.N;X.prototype._styleInfoForNode=X.prototype.D;X.prototype.transformCustomStyleForDocument=X.prototype.C;X.prototype.getStyleAst=X.prototype.H;X.prototype.styleAstToString=X.prototype.O;X.prototype.flushCustomStyles=X.prototype.flushCustomStyles; | ||
X.prototype.scopeNode=X.prototype.M;X.prototype.unscopeNode=X.prototype.P;X.prototype.scopeForNode=X.prototype.L;X.prototype.currentScopeForNode=X.prototype.G;Object.defineProperties(X.prototype,{nativeShadow:{get:function(){return r}},nativeCss:{get:function(){return u}}});var Z=new X,Db,Eb;window.ShadyCSS&&(Db=window.ShadyCSS.ApplyShim,Eb=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:q};Ib&&(window.ShadyCSS.ApplyShim=Ib);Jb&&(window.ShadyCSS.CustomStyleInterface=Jb);}).call(this); | ||
getComputedStyleValue:function(a,b){return Z.getComputedStyleValue(a,b)},nativeCss:u,nativeShadow:r,cssBuild:v};Db&&(window.ShadyCSS.ApplyShim=Db);Eb&&(window.ShadyCSS.CustomStyleInterface=Eb);}).call(this); | ||
//# sourceMappingURL=scoping-shim.min.js.map |
@@ -149,2 +149,2 @@ /** | ||
return false; | ||
} | ||
} |
@@ -389,5 +389,6 @@ /** | ||
* @param {string} text | ||
* @param {boolean=} replaceInitialOrInherit | ||
* @return {!Object<string, string>} | ||
*/ | ||
_cssTextToMap(text) { | ||
_cssTextToMap(text, replaceInitialOrInherit = false) { | ||
let props = text.split(';'); | ||
@@ -404,3 +405,6 @@ let property, value; | ||
// some properties may have ':' in the value, like data urls | ||
value = this._replaceInitialOrInherit(property, sp.slice(1).join(':')); | ||
value = sp.slice(1).join(':'); | ||
if (replaceInitialOrInherit) { | ||
value = this._replaceInitialOrInherit(property, value); | ||
} | ||
out[property] = value; | ||
@@ -450,3 +454,6 @@ } | ||
let prefix = matchText.slice(0, matchText.indexOf('--')); | ||
let mixinValues = this._cssTextToMap(mixinAsProperties); | ||
// `initial` and `inherit` as properties in a map should be replaced because | ||
// these keywords are eagerly evaluated when the mixin becomes CSS Custom Properties, | ||
// and would set the variable value, rather than carry the keyword to the `var()` usage. | ||
let mixinValues = this._cssTextToMap(mixinAsProperties, true); | ||
let combinedProps = mixinValues; | ||
@@ -501,2 +508,3 @@ let mixinEntry = this._map.get(propertyName); | ||
/* exports */ | ||
/* eslint-disable no-self-assign */ | ||
ApplyShim.prototype['detectMixin'] = ApplyShim.prototype.detectMixin; | ||
@@ -509,2 +517,3 @@ ApplyShim.prototype['transformStyle'] = ApplyShim.prototype.transformStyle; | ||
ApplyShim.prototype['_separator'] = MIXIN_VAR_SEP; | ||
/* eslint-enable no-self-assign */ | ||
Object.defineProperty(ApplyShim.prototype, 'invalidCallback', { | ||
@@ -511,0 +520,0 @@ /** @return {?function(string)} */ |
@@ -116,5 +116,7 @@ /** | ||
/* eslint-disable no-self-assign */ | ||
CustomStyleInterface.prototype['addCustomStyle'] = CustomStyleInterface.prototype.addCustomStyle; | ||
CustomStyleInterface.prototype['getStyleForCustomStyle'] = CustomStyleInterface.prototype.getStyleForCustomStyle; | ||
CustomStyleInterface.prototype['processStyles'] = CustomStyleInterface.prototype.processStyles; | ||
/* eslint-enable no-self-assign */ | ||
@@ -163,2 +165,2 @@ Object.defineProperties(CustomStyleInterface.prototype, { | ||
*/ | ||
export let CustomStyleInterfaceInterface; | ||
export const CustomStyleInterfaceInterface = {}; |
@@ -21,14 +21,16 @@ /** | ||
* @param {!Element} element | ||
* @return {!Array<string>} | ||
* @return {string} | ||
*/ | ||
function getClasses(element) { | ||
let classes = []; | ||
if (element.classList) { | ||
classes = Array.from(element.classList); | ||
} else if (element instanceof window['SVGElement'] && element.hasAttribute('class')) { | ||
classes = element.getAttribute('class').split(/\s+/); | ||
if (element.classList && element.classList.value) { | ||
return element.classList.value; | ||
} else { | ||
// NOTE: className is patched to remove scoping classes in ShadyDOM | ||
// use getAttribute('class') instead, which is unpatched | ||
return element.getAttribute('class') || ''; | ||
} | ||
return classes; | ||
} | ||
const scopeRegExp = new RegExp(`${StyleTransformer.SCOPE_NAME}\\s*([^\\s]*)`); | ||
/** | ||
@@ -39,8 +41,8 @@ * @param {!Element} element | ||
export function getCurrentScope(element) { | ||
let classes = getClasses(element); | ||
let idx = classes.indexOf(StyleTransformer.SCOPE_NAME); | ||
if (idx > -1) { | ||
return classes[idx + 1]; | ||
const match = getClasses(element).match(scopeRegExp); | ||
if (match) { | ||
return match[1]; | ||
} else { | ||
return ''; | ||
} | ||
return ''; | ||
} | ||
@@ -47,0 +49,0 @@ |
@@ -40,2 +40,3 @@ /** | ||
this._elementsHaveApplied = false; | ||
/** @type {?Object} */ | ||
this._applyShim = null; | ||
@@ -91,3 +92,3 @@ /** @type {?CustomStyleInterfaceInterface} */ | ||
let cssBuild = StyleUtil.getCssBuild(template); | ||
let cssText = this._gatherStyles(template); | ||
const optimalBuild = StyleUtil.isOptimalCssBuild(cssBuild); | ||
let info = { | ||
@@ -97,12 +98,14 @@ is: elementName, | ||
}; | ||
let cssText = this._gatherStyles(template); | ||
// check if the styling has mixin definitions or uses | ||
this._ensure(); | ||
let hasMixins = !StyleUtil.elementHasBuiltCss(template) && detectMixin(cssText); | ||
let ast = parse(cssText); | ||
// only run the applyshim transforms if there is a mixin involved | ||
if (hasMixins && nativeCssVariables && this._applyShim) { | ||
this._applyShim['transformRules'](ast, elementName); | ||
if (!optimalBuild) { | ||
let hasMixins = !cssBuild && detectMixin(cssText); | ||
let ast = parse(cssText); | ||
// only run the applyshim transforms if there is a mixin involved | ||
if (hasMixins && nativeCssVariables && this._applyShim) { | ||
this._applyShim['transformRules'](ast, elementName); | ||
} | ||
template['_styleAst'] = ast; | ||
} | ||
template['_styleAst'] = ast; | ||
let ownPropertyNames = []; | ||
@@ -115,3 +118,3 @@ if (!nativeCssVariables) { | ||
let placeholder = getStylePlaceholder(elementName); | ||
let style = this._generateStaticStyle(info, template['_styleAst'], root, placeholder, cssBuild); | ||
let style = this._generateStaticStyle(info, template['_styleAst'], root, placeholder, cssBuild, optimalBuild ? cssText : ''); | ||
template._style = style; | ||
@@ -139,8 +142,11 @@ } | ||
* @param {string} cssBuild | ||
* @param {string=} cssText | ||
* @return {?HTMLStyleElement} | ||
*/ | ||
_generateStaticStyle(info, rules, shadowroot, placeholder, cssBuild) { | ||
let cssText = StyleTransformer.elementStyles(info, rules, null, cssBuild); | ||
_generateStaticStyle(info, rules, shadowroot, placeholder, cssBuild, cssText) { | ||
cssText = StyleTransformer.elementStyles(info, rules, null, cssBuild, cssText); | ||
if (cssText.length) { | ||
return StyleUtil.applyCss(cssText, info.is, shadowroot, placeholder); | ||
} | ||
return null; | ||
} | ||
@@ -177,3 +183,3 @@ _prepareHost(host) { | ||
} else if (window.ShadyCSS && window.ShadyCSS.ApplyShim) { | ||
this._applyShim = window.ShadyCSS.ApplyShim; | ||
this._applyShim = /** @type {!Object} */ (window.ShadyCSS.ApplyShim); | ||
this._applyShim['invalidCallback'] = ApplyShimUtils.invalidate; | ||
@@ -215,13 +221,17 @@ } | ||
} | ||
// bail if custom styles are built optimally | ||
if (StyleUtil.isOptimalCssBuild(this._documentOwnerStyleInfo.cssBuild)) { | ||
return; | ||
} | ||
if (!nativeCssVariables) { | ||
this._updateProperties(this._documentOwner, this._documentOwnerStyleInfo); | ||
this._applyCustomStyles(customStyles); | ||
} else { | ||
if (this._elementsHaveApplied) { | ||
// if custom elements have upgraded and there are no native css variables, we must recalculate the whole tree | ||
this.styleDocument(); | ||
} | ||
} else if (!this._documentOwnerStyleInfo.cssBuild) { | ||
this._revalidateCustomStyleApplyShim(customStyles); | ||
} | ||
this._customStyleInterface['enqueued'] = false; | ||
// if custom elements have upgraded and there are no native css variables, we must recalculate the whole tree | ||
if (this._elementsHaveApplied && !nativeCssVariables) { | ||
this.styleDocument(); | ||
} | ||
} | ||
@@ -384,3 +394,4 @@ /** | ||
// process the shadowdom children of `host` | ||
let shadowChildren = root && (root.children || root.childNodes); | ||
let shadowChildren = | ||
root && (/** @type {!ParentNode} */ (root).children || root.childNodes); | ||
if (shadowChildren) { | ||
@@ -422,3 +433,2 @@ for (let i = 0; i < shadowChildren.length; i++) { | ||
transformCustomStyleForDocument(style) { | ||
let ast = StyleUtil.rulesForStyle(style); | ||
const cssBuild = StyleUtil.getCssBuild(style); | ||
@@ -428,2 +438,6 @@ if (cssBuild !== this._documentOwnerStyleInfo.cssBuild) { | ||
} | ||
if (StyleUtil.isOptimalCssBuild(cssBuild)) { | ||
return; | ||
} | ||
let ast = StyleUtil.rulesForStyle(style); | ||
StyleUtil.forEachRule(ast, (rule) => { | ||
@@ -534,2 +548,3 @@ if (nativeShadow) { | ||
/* exports */ | ||
/* eslint-disable no-self-assign */ | ||
ScopingShim.prototype['flush'] = ScopingShim.prototype.flush; | ||
@@ -551,2 +566,3 @@ ScopingShim.prototype['prepareTemplate'] = ScopingShim.prototype.prepareTemplate; | ||
ScopingShim.prototype['currentScopeForNode'] = ScopingShim.prototype.currentScopeForNode; | ||
/* eslint-enable no-self-assign */ | ||
Object.defineProperties(ScopingShim.prototype, { | ||
@@ -553,0 +569,0 @@ 'nativeShadow': { |
@@ -16,2 +16,3 @@ /** | ||
this.cache = {}; | ||
/** @type {number} */ | ||
this.typeMax = typeMax; | ||
@@ -18,0 +19,0 @@ } |
@@ -74,2 +74,3 @@ /** | ||
StyleInfo.prototype['_getStyleRules'] = StyleInfo.prototype._getStyleRules; | ||
/* eslint-disable-next-line no-self-assign */ | ||
StyleInfo.prototype['_getStyleRules'] = StyleInfo.prototype._getStyleRules; |
@@ -34,2 +34,8 @@ /** | ||
/** @type {string | undefined} */ | ||
export let cssBuild; | ||
if (window.ShadyCSS && window.ShadyCSS.cssBuild !== undefined) { | ||
cssBuild = window.ShadyCSS.cssBuild; | ||
} | ||
if (window.ShadyCSS && window.ShadyCSS.nativeCss !== undefined) { | ||
@@ -48,2 +54,2 @@ nativeCssVariables_ = window.ShadyCSS.nativeCss; | ||
// `function(): ?` instead of `boolean`. | ||
export const nativeCssVariables = /** @type {boolean} */(nativeCssVariables_); | ||
export const nativeCssVariables = /** @type {boolean} */(nativeCssVariables_); |
@@ -78,9 +78,14 @@ /** | ||
} | ||
let c$ = (startNode.localName === 'template') ? | ||
let c$; | ||
if (startNode.localName === 'template') { | ||
const template = /** @type {!HTMLTemplateElement} */ (startNode); | ||
// In case the template is in svg context, fall back to the node | ||
// since it won't be an HTMLTemplateElement with a .content property | ||
(startNode.content || startNode._content || startNode).childNodes : | ||
startNode.children || startNode.childNodes; | ||
c$ = (template.content || template._content || template).childNodes; | ||
} else { | ||
c$ = /** @type {!ParentNode} */ (startNode).children || | ||
startNode.childNodes; | ||
} | ||
if (c$) { | ||
for (let i=0; i<c$.length; i++) { | ||
for (let i = 0; i < c$.length; i++) { | ||
this._transformDom(c$[i], transformer); | ||
@@ -155,4 +160,6 @@ } | ||
* @param {string=} cssBuild | ||
* @param {string=} cssText | ||
* @return {string} | ||
*/ | ||
elementStyles(element, styleRules, callback, cssBuild = '') { | ||
elementStyles(element, styleRules, callback, cssBuild = '', cssText = '') { | ||
// no need to shim selectors if settings.useNativeShadow, also | ||
@@ -164,8 +171,9 @@ // a shady css build will already have transformed selectors | ||
// static shimming work when a proper build exists. | ||
let cssText = ''; | ||
if (nativeShadow || cssBuild === 'shady') { | ||
cssText = StyleUtil.toCssText(styleRules, callback); | ||
} else { | ||
let {is, typeExtension} = StyleUtil.getIsExtends(element); | ||
cssText = this.css(styleRules, is, typeExtension, callback) + '\n\n'; | ||
if (cssText === '') { | ||
if (nativeShadow || cssBuild === 'shady') { | ||
cssText = StyleUtil.toCssText(styleRules, callback); | ||
} else { | ||
let {is, typeExtension} = StyleUtil.getIsExtends(element); | ||
cssText = this.css(styleRules, is, typeExtension, callback) + '\n\n'; | ||
} | ||
} | ||
@@ -371,5 +379,21 @@ return cssText.trim(); | ||
_transformSimpleSelector(selector, scope) { | ||
let p$ = selector.split(PSEUDO_PREFIX); | ||
p$[0] += scope; | ||
return p$.join(PSEUDO_PREFIX); | ||
const attributes = selector.split(/(\[.+?\])/); | ||
const output = []; | ||
for (let i = 0; i < attributes.length; i++) { | ||
// Do not attempt to transform any attribute selector content | ||
if ((i % 2) === 1) { | ||
output.push(attributes[i]); | ||
} else { | ||
const part = attributes[i]; | ||
if (!(part === '' && i === attributes.length - 1)) { | ||
let p$ = part.split(PSEUDO_PREFIX); | ||
p$[0] += scope; | ||
output.push(p$.join(PSEUDO_PREFIX)); | ||
} | ||
} | ||
} | ||
return output.join(''); | ||
} | ||
@@ -444,22 +468,22 @@ | ||
let NTH = /:(nth[-\w]+)\(([^)]+)\)/; | ||
let SCOPE_DOC_SELECTOR = `:not(.${SCOPE_NAME})`; | ||
let COMPLEX_SELECTOR_SEP = ','; | ||
let SIMPLE_SELECTOR_SEP = /(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g; | ||
let SIMPLE_SELECTOR_PREFIX = /[[.:#*]/; | ||
let HOST = ':host'; | ||
let ROOT = ':root'; | ||
let SLOTTED = '::slotted'; | ||
let SLOTTED_START = new RegExp(`^(${SLOTTED})`); | ||
const NTH = /:(nth[-\w]+)\(([^)]+)\)/; | ||
const SCOPE_DOC_SELECTOR = `:not(.${SCOPE_NAME})`; | ||
const COMPLEX_SELECTOR_SEP = ','; | ||
const SIMPLE_SELECTOR_SEP = /(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g; | ||
const SIMPLE_SELECTOR_PREFIX = /[[.:#*]/; | ||
const HOST = ':host'; | ||
const ROOT = ':root'; | ||
const SLOTTED = '::slotted'; | ||
const SLOTTED_START = new RegExp(`^(${SLOTTED})`); | ||
// NOTE: this supports 1 nested () pair for things like | ||
// :host(:not([selected]), more general support requires | ||
// parsing which seems like overkill | ||
let HOST_PAREN = /(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/; | ||
const HOST_PAREN = /(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/; | ||
// similar to HOST_PAREN | ||
let SLOTTED_PAREN = /(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/; | ||
let DIR_PAREN = /(.*):dir\((?:(ltr|rtl))\)/; | ||
let CSS_CLASS_PREFIX = '.'; | ||
let PSEUDO_PREFIX = ':'; | ||
let CLASS = 'class'; | ||
let SELECTOR_NO_MATCH = 'should_not_match'; | ||
const SLOTTED_PAREN = /(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/; | ||
const DIR_PAREN = /(.*):dir\((?:(ltr|rtl))\)/; | ||
const CSS_CLASS_PREFIX = '.'; | ||
const PSEUDO_PREFIX = ':'; | ||
const CLASS = 'class'; | ||
const SELECTOR_NO_MATCH = 'should_not_match'; | ||
const MATCHES = /:(?:matches|any|-(?:webkit|moz)-any)/; | ||
@@ -466,0 +490,0 @@ const MATCHES_REPLACEMENT = '\u{e000}'; |
@@ -13,3 +13,3 @@ /** | ||
import {nativeShadow, nativeCssVariables} from './style-settings.js'; | ||
import {nativeShadow, nativeCssVariables, cssBuild} from './style-settings.js'; | ||
import {parse, stringify, types, StyleNode} from './css-parse.js'; // eslint-disable-line no-unused-vars | ||
@@ -329,2 +329,5 @@ import {MEDIA_MATCH} from './common-regex.js'; | ||
export function getCssBuild(element) { | ||
if (cssBuild !== undefined) { | ||
return /** @type {string} */(cssBuild); | ||
} | ||
if (element.__cssBuild === undefined) { | ||
@@ -374,3 +377,5 @@ // try attribute first, as it is the common case | ||
export function getBuildComment(element) { | ||
const buildComment = element.localName === 'template' ? element.content.firstChild : element.firstChild; | ||
const buildComment = element.localName === 'template' ? | ||
/** @type {!HTMLTemplateElement} */ (element).content.firstChild : | ||
element.firstChild; | ||
if (buildComment instanceof Comment) { | ||
@@ -386,7 +391,23 @@ const commentParts = buildComment.textContent.trim().split(':'); | ||
/** | ||
* Check if the css build status is optimal, and do no unneeded work. | ||
* | ||
* @param {string=} cssBuild CSS build status | ||
* @return {boolean} css build is optimal or not | ||
*/ | ||
export function isOptimalCssBuild(cssBuild = '') { | ||
// CSS custom property shim always requires work | ||
if (cssBuild === '' || !nativeCssVariables) { | ||
return false; | ||
} | ||
return nativeShadow ? cssBuild === 'shadow' : cssBuild === 'shady'; | ||
} | ||
/** | ||
* @param {!HTMLElement} element | ||
*/ | ||
function removeBuildComment(element) { | ||
const buildComment = element.localName === 'template' ? element.content.firstChild : element.firstChild; | ||
const buildComment = element.localName === 'template' ? | ||
/** @type {!HTMLTemplateElement} */ (element).content.firstChild : | ||
element.firstChild; | ||
buildComment.parentNode.removeChild(buildComment); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
456388
4161
429