Files
webcomponentsjs/webcomponents-hi.js
Steven Orvell 815741654e update builds
2017-03-01 15:07:57 -08:00

47 lines
11 KiB
JavaScript

(function(){
/*
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
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';(function(q){function n(a,b){if("function"===typeof window.CustomEvent)return new CustomEvent(a,b);var c=document.createEvent("CustomEvent");c.initCustomEvent(a,!!b.bubbles,!!b.cancelable,b.detail);return c}function p(a){if(v)return a.ownerDocument!==document?a.ownerDocument:null;var b=a.__importDoc;if(!b&&a.parentNode){b=a.parentNode;if("function"===typeof b.closest)b=b.closest("link[rel=import]");else for(;!w(b)&&(b=b.parentNode););a.__importDoc=b}return b}function m(a){var b=document.querySelectorAll("link[rel=import]:not(import-dependency)"),
c=b.length;if(c)for(var e=0,d=b.length,l;e<d&&(l=b[e]);e++)t(l,function(){0===--c&&a()});else a()}function A(a){if("loading"!==document.readyState)a();else{var b=function(){"loading"!==document.readyState&&(document.removeEventListener("readystatechange",b),a())};document.addEventListener("readystatechange",b)}}function B(a){A(function(){return m(function(){return a&&a()})})}function t(a,b){if(a.__loaded)b&&b();else if("script"!==a.localName||a.src){var c=function(e){a.removeEventListener(e.type,
c);a.__loaded=!0;b&&b()};a.addEventListener("load",c);x&&"style"===a.localName||a.addEventListener("error",c)}else a.__loaded=!0,b&&b()}function w(a){return a.nodeType===Node.ELEMENT_NODE&&"link"===a.localName&&"import"===a.rel}function k(){var a=this;this.documents={};this.inflight=0;this.dynamicImportsMO=new MutationObserver(function(b){return a.handleMutations(b)});A(function(){a.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0});a.loadImports(document)})}var v="import"in document.createElement("link"),
y=null;!1==="currentScript"in document&&Object.defineProperty(document,"currentScript",{get:function(){return y||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null)},configurable:!0});var F=/(^\/)|(^#)|(^[\w-\d]*:)/,G=/(url\()([^)]*)(\))/g,H=/(@import[\s]+(?!url\())([^;]*)(;)/g,I=/(<link[^>]*)(rel=['|"]?stylesheet['|"]?[^>]*>)/g,f={fixUrls:function(a,b){a.href&&a.setAttribute("href",f.replaceAttrUrl(a.getAttribute("href"),b));a.src&&a.setAttribute("src",f.replaceAttrUrl(a.getAttribute("src"),
b));"style"===a.localName&&f.resolveUrlsInStyle(a,b)},fixUrlAttributes:function(a,b){for(var c=["action","src","href","url","style"],e=0,d;e<c.length&&(d=c[e]);e++){var l=a.attributes[d],g=l&&l.value;g&&0>g.search(/({{|\[\[)/)&&(l.value="style"===d?f.resolveUrlsInCssText(g,b):f.replaceAttrUrl(g,b))}},fixUrlsInTemplates:function(a,b){a=a.querySelectorAll("template");for(var c=0;c<a.length;c++)f.fixUrlsInTemplate(a[c],b)},fixUrlsInTemplate:function(a,b){a=a.content||a;for(var c=a.querySelectorAll("style, form[action], [src], [href], [url], [style]"),
e=0;e<c.length;e++){var d=c[e];"style"==d.localName?f.resolveUrlsInStyle(d,b):f.fixUrlAttributes(d,b)}f.fixUrlsInTemplates(a,b)},resolveUrlsInStyle:function(a,b){a.textContent=f.resolveUrlsInCssText(a.textContent,b)},resolveUrlsInCssText:function(a,b){a=f.replaceUrls(a,b,G);return a=f.replaceUrls(a,b,H)},replaceUrls:function(a,b,c){return a.replace(c,function(a,c,l,g){a=l.replace(/["']/g,"");b&&(a=f.resolveUrl(a,b));return c+"'"+a+"'"+g})},replaceAttrUrl:function(a,b){return a&&F.test(a)?a:f.resolveUrl(a,
b)},resolveUrl:function(a,b){if(void 0===f.__workingURL){f.__workingURL=!1;try{var c=new URL("b","http://a");c.pathname="c%20d";f.__workingURL="http://a/c%20d"===c.href}catch(e){}}if(f.__workingURL)return(new URL(a,b)).href;c=f.__tempDoc;c||(c=document.implementation.createHTMLDocument("temp"),f.__tempDoc=c,c.__base=c.createElement("base"),c.head.appendChild(c.__base),c.__anchor=c.createElement("a"));c.__base.href=b;c.__anchor.href=a;return c.__anchor.href||a}},C={async:!0,load:function(a,b,c){if(a)if(a.match(/^data:/)){a=
a.split(",");var e=a[1],e=-1<a[0].indexOf(";base64")?atob(e):decodeURIComponent(e);b(e)}else{var d=new XMLHttpRequest;d.open("GET",a,C.async);d.onload=function(){var a=d.getResponseHeader("Location");a&&0===a.indexOf("/")&&(a=(location.origin||location.protocol+"//"+location.host)+a);var e=d.response||d.responseText;304===d.status||0===d.status||200<=d.status&&300>d.status?b(e,a):c(e)};d.send()}else c("error: href must be specified")}},x=/Trident/.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent);
k.prototype.loadImports=function(a){a=a.querySelectorAll("link[rel=import]");for(var b=0,c=a.length;b<c;b++)this.loadImport(a[b])};k.prototype.loadImport=function(a){var b=this,c=a.href;if(void 0!==this.documents[c]){var e=this.documents[c];e&&e.__loaded&&(a.import=e,this.fireEventIfNeeded(a))}else this.inflight++,this.documents[c]="pending",C.load(c,function(a,e){a=b.makeDocument(a,e||c);b.documents[c]=a;b.inflight--;b.loadImports(a);b.processImportsIfLoadingDone()},function(){b.documents[c]=null;
b.inflight--;b.processImportsIfLoadingDone()})};k.prototype.makeDocument=function(a,b){if(!a)return document.createDocumentFragment();x&&(a=a.replace(I,function(a,b,c){return-1===a.indexOf("type=")?b+" type=import-disable "+c:a}));var c=document.createElement("template");c.innerHTML=a;if(c.content)a=c.content;else for(a=document.createDocumentFragment();c.firstChild;)a.appendChild(c.firstChild);if(c=a.querySelector("base"))b=f.replaceAttrUrl(c.getAttribute("href"),b),c.removeAttribute("href");for(var c=
a.querySelectorAll('link[rel=import], link[rel=stylesheet][href][type=import-disable],\n style:not([type]), link[rel=stylesheet][href]:not([type]),\n script:not([type]), script[type="application/javascript"],\n script[type="text/javascript"]'),e=0,d=0,l=c.length,g;d<l&&(g=c[d]);d++)t(g),f.fixUrls(g,b),g.setAttribute("import-dependency",""),"script"===g.localName&&!g.src&&g.textContent&&(g.setAttribute("src","data:text/javascript;charset=utf-8,"+encodeURIComponent(g.textContent+("\n//# sourceURL="+
b+(e?"-"+e:"")+".js\n"))),g.textContent="",e++);f.fixUrlsInTemplates(a,b);return a};k.prototype.processImportsIfLoadingDone=function(){var a=this;if(!this.inflight){this.dynamicImportsMO.disconnect();this.flatten(document);var b=!1,c=!1,e=function(){c&&b&&(a.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0}),a.fireEvents())};this.waitForStyles(function(){c=!0;e()});this.runScripts(function(){b=!0;e()})}};k.prototype.flatten=function(a){a=a.querySelectorAll("link[rel=import]");for(var b=
{},c=0,e=a.length;c<e&&(b.n=a[c]);b={n:b.n},c++){var d=this.documents[b.n.href];(b.n.import=d)&&d.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(this.documents[b.n.href]=b.n,b.n.readyState="loading",b.n.import=b.n,Object.defineProperty(b.n,"baseURI",{get:function(a){return function(){return a.n.href}}(b),configurable:!0,enumerable:!0}),this.flatten(d),b.n.appendChild(d))}};k.prototype.runScripts=function(a){function b(d){if(d<e){var f=c[d],g=document.createElement("script");f.removeAttribute("import-dependency");
for(var h=0,k=f.attributes.length;h<k;h++)g.setAttribute(f.attributes[h].name,f.attributes[h].value);y=g;f.parentNode.replaceChild(g,f);t(g,function(){y=null;b(d+1)})}else a()}var c=document.querySelectorAll("script[import-dependency]"),e=c.length;b(0)};k.prototype.waitForStyles=function(a){var b=document.querySelectorAll("style[import-dependency],\n link[rel=stylesheet][import-dependency]"),c=b.length;if(c)for(var e=x&&!!document.querySelector("link[rel=stylesheet][href][type=import-disable]"),
d={},f=0,g=b.length;f<g&&(d.s=b[f]);d={s:d.s},f++){if(t(d.s,function(b){return function(){b.s.removeAttribute("import-dependency");0===--c&&a()}}(d)),e&&d.s.parentNode!==document.head){var h=document.createElement(d.s.localName);h.__appliedElement=d.s;h.setAttribute("type","import-placeholder");d.s.parentNode.insertBefore(h,d.s.nextSibling);for(h=p(d.s);h&&p(h);)h=p(h);h.parentNode!==document.head&&(h=null);document.head.insertBefore(d.s,h);d.s.removeAttribute("type")}}else a()};k.prototype.fireEvents=
function(){for(var a=document.querySelectorAll("link[rel=import]"),b=a.length-1,c;0<=b&&(c=a[b]);b--)this.fireEventIfNeeded(c)};k.prototype.fireEventIfNeeded=function(a){a.__loaded||(a.__loaded=!0,a.import&&(a.import.readyState="complete"),a.dispatchEvent(n(a.import?"load":"error",{bubbles:!1,cancelable:!1,detail:void 0})))};k.prototype.handleMutations=function(a){for(var b=0;b<a.length;b++){var c=a[b];if(c.addedNodes)for(var e=0;e<c.addedNodes.length;e++){var d=c.addedNodes[e];d&&d.nodeType===Node.ELEMENT_NODE&&
(w(d)?this.loadImport(d):this.loadImports(d))}}};if(v){for(var r=document.querySelectorAll("link[rel=import]"),z=0,J=r.length,u;z<J&&(u=r[z]);z++)u.import&&"loading"===u.import.readyState||(u.__loaded=!0);r=function(a){a=a.target;w(a)&&(a.__loaded=!0)};document.addEventListener("load",r,!0);document.addEventListener("error",r,!0)}else new k;B(function(){return document.dispatchEvent(n("HTMLImportsLoaded",{cancelable:!0,bubbles:!0,detail:void 0}))});q.useNative=v;q.whenReady=B;q.importForElement=p})(window.HTMLImports=
window.HTMLImports||{});(function(){if(customElements&&customElements.polyfillWrapFlushCallback){var q=function(){if(n){var m=n;n=null;m();return!0}},n,p=HTMLImports.whenReady;customElements.polyfillWrapFlushCallback(function(m){n=m;p(q)});HTMLImports.whenReady=function(m){p(function(){q()?HTMLImports.whenReady(m):m()})}}HTMLImports.whenReady(function(){requestAnimationFrame(function(){window.dispatchEvent(new CustomEvent("WebComponentsReady"))})})})(window.WebComponents);var D=document.createElement("style");
D.textContent="body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n";var E=document.querySelector("head");E.insertBefore(D,E.firstChild);
}).call(self)
//# sourceMappingURL=webcomponents-hi.js.map