timepiece/node_modules/@webcomponents/shadycss/scoping-shim.min.js

62 lines
22 KiB
JavaScript

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