summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/catapult/third_party/polymer2/bower_components/shadycss/apply-shim.min.js
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/catapult/third_party/polymer2/bower_components/shadycss/apply-shim.min.js')
-rw-r--r--chromium/third_party/catapult/third_party/polymer2/bower_components/shadycss/apply-shim.min.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/chromium/third_party/catapult/third_party/polymer2/bower_components/shadycss/apply-shim.min.js b/chromium/third_party/catapult/third_party/polymer2/bower_components/shadycss/apply-shim.min.js
new file mode 100644
index 00000000000..8bfb6328a3b
--- /dev/null
+++ b/chromium/third_party/catapult/third_party/polymer2/bower_components/shadycss/apply-shim.min.js
@@ -0,0 +1,30 @@
+(function(){/*
+
+Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+Code distributed by Google as part of the polymer project is also
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+*/
+'use strict';var k={};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(r,"").replace(aa,"");var c=t,b=a,d=new n;d.start=0;d.end=b.length;for(var e=d,f=0,h=b.length;f<h;f++)if("{"===b[f]){e.rules||(e.rules=[]);var g=e,m=g.rules[g.rules.length-1]||null;e=new n;e.start=f+1;e.parent=g;e.previous=m;g.rules.push(e)}else"}"===b[f]&&(e.end=f+1,e=e.parent||d);return c(d,a)}
+function t(a,c){var b=c.substring(a.start,a.end-1);a.parsedCssText=a.cssText=b.trim();a.parent&&(b=c.substring(a.previous?a.previous.end:a.parent.start,a.start-1),b=ba(b),b=b.replace(u," "),b=b.substring(b.lastIndexOf(";")+1),b=a.parsedSelector=a.selector=b.trim(),a.atRule=0===b.indexOf("@"),a.atRule?0===b.indexOf("@media")?a.type=v:b.match(ca)&&(a.type=x,a.keyframesName=a.selector.split(u).pop()):a.type=0===b.indexOf("--")?y:z);if(b=a.rules)for(var d=0,e=b.length,f;d<e&&(f=b[d]);d++)t(f,c);return a}
+function ba(a){return a.replace(/\\([0-9a-f]{1,6})\s/gi,function(a,b){a=b;for(b=6-a.length;b--;)a="0"+a;return"\\"+a})}
+function A(a,c,b){b=void 0===b?"":b;var d="";if(a.cssText||a.rules){var e=a.rules,f;if(f=e)f=e[0],f=!(f&&f.selector&&0===f.selector.indexOf("--"));if(f){f=0;for(var h=e.length,g;f<h&&(g=e[f]);f++)d=A(g,c,d)}else c?c=a.cssText:(c=a.cssText,c=c.replace(da,"").replace(ea,""),c=c.replace(fa,"").replace(ha,"")),(d=c.trim())&&(d=" "+d+"\n")}d&&(a.selector&&(b+=a.selector+" {\n"),b+=d,a.selector&&(b+="}\n\n"));return b}
+var z=1,x=7,v=4,y=1E3,r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,aa=/@import[^;]*;/gim,da=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,ea=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,fa=/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,ha=/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,ca=/^@[^\s]*keyframes/,u=/\s+/g;var ia=Promise.resolve();function ja(a){if(a=k[a])a._applyShimCurrentVersion=a._applyShimCurrentVersion||0,a._applyShimValidatingVersion=a._applyShimValidatingVersion||0,a._applyShimNextVersion=(a._applyShimNextVersion||0)+1}function B(a){return a._applyShimCurrentVersion===a._applyShimNextVersion}function ka(a){a._applyShimValidatingVersion=a._applyShimNextVersion;a.b||(a.b=!0,ia.then(function(){a._applyShimCurrentVersion=a._applyShimNextVersion;a.b=!1}))};var C=!(window.ShadyDOM&&window.ShadyDOM.inUse),D;function F(a){D=a&&a.shimcssproperties?!1:C||!(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?D=window.ShadyCSS.nativeCss:window.ShadyCSS?(F(window.ShadyCSS),window.ShadyCSS=void 0):F(window.WebComponents&&window.WebComponents.flags);var G=D;var H=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,I=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,la=/@media\s(.*)/;var J=new Set;function K(a){if(!a)return"";"string"===typeof a&&(a=p(a));return A(a,G)}function L(a){!a.__cssRules&&a.textContent&&(a.__cssRules=p(a.textContent));return a.__cssRules||null}function M(a,c,b,d){if(a){var e=!1,f=a.type;if(d&&f===v){var h=a.selector.match(la);h&&(window.matchMedia(h[1]).matches||(e=!0))}f===z?c(a):b&&f===x?b(a):f===y&&(e=!0);if((a=a.rules)&&!e){e=0;f=a.length;for(var g;e<f&&(g=a[e]);e++)M(g,c,b,d)}}}
+function N(a,c){var b=a.indexOf("var(");if(-1===b)return c(a,"","","");a:{var d=0;var e=b+3;for(var f=a.length;e<f;e++)if("("===a[e])d++;else if(")"===a[e]&&0===--d)break a;e=-1}d=a.substring(b+4,e);b=a.substring(0,b);a=N(a.substring(e+1),c);e=d.indexOf(",");return-1===e?c(b,d.trim(),"",a):c(b,d.substring(0,e).trim(),d.substring(e+1).trim(),a)};var ma=/;\s*/m,na=/^\s*(initial)|(inherit)\s*$/,O=/\s*!important/;function P(){this.a={}}P.prototype.set=function(a,c){a=a.trim();this.a[a]={h:c,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=I.test(a)||H.test(a);I.lastIndex=0;H.lastIndex=0;return a};
+R.prototype.m=function(a,c){if(void 0===a.a){var b=[];for(var d=a.content.querySelectorAll("style"),e=0;e<d.length;e++){var f=d[e];if(f.hasAttribute("shady-unscoped")){if(!C){var h=f.textContent;J.has(h)||(J.add(h),h=f.cloneNode(!0),document.head.appendChild(h));f.parentNode.removeChild(f)}}else b.push(f.textContent),f.parentNode.removeChild(f)}(b=b.join("").trim())?(d=document.createElement("style"),d.textContent=b,a.content.insertBefore(d,a.content.firstChild),b=d):b=null;a.a=b}return(a=a.a)?this.j(a,
+c):null};R.prototype.j=function(a,c){c=void 0===c?"":c;var b=L(a);this.l(b,c);a.textContent=K(b);return b};R.prototype.f=function(a){var c=this,b=L(a);M(b,function(a){":root"===a.selector&&(a.selector="html");c.g(a)});a.textContent=K(b);return b};R.prototype.l=function(a,c){var b=this;this.c=c;M(a,function(a){b.g(a)});this.c=null};R.prototype.g=function(a){a.cssText=oa(this,a.parsedCssText);":root"===a.selector&&(a.selector=":host > *")};
+function oa(a,c){c=c.replace(H,function(b,c,e,f){return pa(a,b,c,e,f)});return S(a,c)}
+function S(a,c){for(var b;b=I.exec(c);){var d=b[0],e=b[1];b=b.index;var f=c.slice(0,b+d.indexOf("@apply"));c=c.slice(b+d.length);var h=T(a,f);d=void 0;var g=a;e=e.replace(ma,"");var m=[];var l=g.a.get(e);l||(g.a.set(e,{}),l=g.a.get(e));if(l){g.c&&(l.i[g.c]=!0);var q=l.h;for(d in q)g=h&&h[d],l=[d,": var(",e,"_-_",d],g&&l.push(",",g.replace(O,"")),l.push(")"),O.test(q[d])&&l.push(" !important"),m.push(l.join(""))}d=m.join("; ");c=""+f+d+c;I.lastIndex=b+d.length}return c}
+function T(a,c){c=c.split(";");for(var b,d,e={},f=0,h;f<c.length;f++)if(b=c[f])if(h=b.split(":"),1<h.length){b=h[0].trim();var g=a;d=b;h=h.slice(1).join(":");var m=na.exec(h);m&&(m[1]?(g.b||(g.b=document.createElement("meta"),g.b.setAttribute("apply-shim-measure",""),g.b.style.all="initial",document.head.appendChild(g.b)),d=window.getComputedStyle(g.b).getPropertyValue(d)):d="apply-shim-inherit",h=d);d=h;e[b]=d}return e}function qa(a,c){if(Q)for(var b in c.i)b!==a.c&&Q(b)}
+function pa(a,c,b,d,e){d&&N(d,function(c,b){b&&a.a.get(b)&&(e="@apply "+b+";")});if(!e)return c;var f=S(a,""+e),h=c.slice(0,c.indexOf("--")),g=f=T(a,f),m=a.a.get(b),l=m&&m.h;l?g=Object.assign(Object.create(l),f):a.a.set(b,g);var q=[],w,X=!1;for(w in g){var E=f[w];void 0===E&&(E="initial");!l||w in l||(X=!0);q.push(""+b+"_-_"+w+": "+E)}X&&qa(a,m);m&&(m.h=g);d&&(h=c+";"+h);return""+h+q.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=new R;function V(){this.a=null;U.invalidCallback=ja}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,c){W(this);k[c]=a;c=U.m(a,c);a._styleAst=c};
+V.prototype.flushCustomStyles=function(){W(this);if(this.a){var a=this.a.processStyles();if(this.a.enqueued){for(var c=0;c<a.length;c++){var b=this.a.getStyleForCustomStyle(a[c]);b&&U.f(b)}this.a.enqueued=!1}}};
+V.prototype.styleSubtree=function(a,c){W(this);if(c)for(var b in c)null===b?a.style.removeProperty(b):a.style.setProperty(b,c[b]);if(a.shadowRoot)for(this.styleElement(a),a=a.shadowRoot.children||a.shadowRoot.childNodes,c=0;c<a.length;c++)this.styleSubtree(a[c]);else for(a=a.children||a.childNodes,c=0;c<a.length;c++)this.styleSubtree(a[c])};
+V.prototype.styleElement=function(a){W(this);var c=a.localName,b;c?-1<c.indexOf("-")?b=c:b=a.getAttribute&&a.getAttribute("is")||"":b=a.is;if((c=k[b])&&!B(c)){if(B(c)||c._applyShimValidatingVersion!==c._applyShimNextVersion)this.prepareTemplate(c,b),ka(c);if(a=a.shadowRoot)if(a=a.querySelector("style"))a.__cssRules=c._styleAst,a.textContent=K(c._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,c){Y.flushCustomStyles();Y.prepareTemplate(a,c)},styleSubtree:function(a,c){Y.flushCustomStyles();Y.styleSubtree(a,c)},styleElement:function(a){Y.flushCustomStyles();Y.styleElement(a)},styleDocument:function(a){Y.flushCustomStyles();Y.styleDocument(a)},getComputedStyleValue:function(a,c){return(a=window.getComputedStyle(a).getPropertyValue(c))?
+a.trim():""},flushCustomStyles:function(){Y.flushCustomStyles()},nativeCss:G,nativeShadow:C};Z&&(window.ShadyCSS.CustomStyleInterface=Z)}window.ShadyCSS.ApplyShim=U;}).call(this);
+
+//# sourceMappingURL=apply-shim.min.js.map