diff --git a/entrypoints/webcomponents-hi-ce-index.js b/entrypoints/webcomponents-hi-ce-index.js index 5cae1df..98c6c39 100644 --- a/entrypoints/webcomponents-hi-ce-index.js +++ b/entrypoints/webcomponents-hi-ce-index.js @@ -17,9 +17,5 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN import '../bower_components/html-imports/src/html-imports.js' import '../bower_components/custom-elements/custom-elements.min.js' -// TODO(notwaldorf): Remove after this is addressed: -// https://github.com/webcomponents/shadycss/issues/46 -import '../bower_components/shadycss/entrypoints/scoping-shim.js' - import '../src/post-polyfill.js' import '../src/unresolved.js' diff --git a/entrypoints/webcomponents-hi-index.js b/entrypoints/webcomponents-hi-index.js index 2be3ddb..d02073c 100644 --- a/entrypoints/webcomponents-hi-index.js +++ b/entrypoints/webcomponents-hi-index.js @@ -16,9 +16,5 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN import '../bower_components/html-imports/src/html-imports.js' -// TODO(notwaldorf): Remove after this is addressed: -// https://github.com/webcomponents/shadycss/issues/46 -import '../bower_components/shadycss/entrypoints/scoping-shim.js' - import '../src/post-polyfill.js' import '../src/unresolved.js' diff --git a/entrypoints/webcomponents-none-index.js b/entrypoints/webcomponents-none-index.js deleted file mode 100644 index 11e3c5f..0000000 --- a/entrypoints/webcomponents-none-index.js +++ /dev/null @@ -1,21 +0,0 @@ -/** -@license -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'; - -/* - * Polyfills loaded: None - * Used in: Chrome - */ - -// TODO: This needs to not exist at all. - -// TODO(notwaldorf): Remove after this is addressed: -// https://github.com/webcomponents/shadycss/issues/46 -import '../bower_components/shadycss/entrypoints/scoping-shim.js' diff --git a/gulpfile.js b/gulpfile.js index b243f2e..9d7723f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -63,10 +63,6 @@ function minify(sourceName, fileName, needsContext) { .pipe(gulp.dest('./')) } -gulp.task('minify-none', () => { - return minify('webcomponents-none') -}); - gulp.task('minify-hi', () => { return minify('webcomponents-hi') }); @@ -100,4 +96,4 @@ gulp.task('default', (cb) => { runseq('refresh-bower', 'build', cb); }); -gulp.task('build', ['minify-none', 'minify-hi', 'minify-hi-ce', 'minify-hi-sd-ce', 'minify-hi-sd-ce-pf', 'minify-sd-ce']); +gulp.task('build', ['minify-hi', 'minify-hi-ce', 'minify-hi-sd-ce', 'minify-hi-sd-ce-pf', 'minify-sd-ce']); diff --git a/webcomponents-hi-ce.js b/webcomponents-hi-ce.js index d59a9c2..50724b8 100644 --- a/webcomponents-hi-ce.js +++ b/webcomponents-hi-ce.js @@ -1,6 +1,6 @@ -(function(){'use strict';function _(jt){return jt=$(jt),te(ee(jt),jt)}function $(jt){return jt.replace(Oe.comments,'').replace(Oe.port,'')}function ee(jt){let Kt=new ke;Kt.start=0,Kt.end=jt.length;let Bt=Kt;for(let Wt=0,Vt=jt.length;Wt{kt=Kt}),'complete'===document.readyState?kt():document.addEventListener('readystatechange',()=>{'complete'===document.readyState&&kt()})),Tt.then(function(){jt&&jt()}))}function Ie(jt,Kt){for(let Bt in Kt)null===Bt?jt.style.removeProperty(Bt):jt.style.setProperty(Bt,Kt[Bt])}(jt=>{const Kt=!!('import'in document.createElement('link'));let Bt=null;!1=='currentScript'in document&&Object.defineProperty(document,'currentScript',{get(){return Bt||('complete'===document.readyState?null:document.scripts[document.scripts.length-1])},configurable:!0});const Wt=/(^\/)|(^#)|(^[\w-\d]*:)/,Vt=/(url\()([^)]*)(\))/g,Yt=/(@import[\s]+(?!url\())([^;]*)(;)/g,Xt=/(]*)(rel=['|"]?stylesheet['|"]?[^>]*>)/g,Gt={fixUrls(mr,yr){mr.href&&mr.setAttribute('href',Gt.replaceAttrUrl(mr.getAttribute('href'),yr)),mr.src&&mr.setAttribute('src',Gt.replaceAttrUrl(mr.getAttribute('src'),yr)),'style'===mr.localName&&Gt.resolveUrlsInStyle(mr,yr)},fixUrlAttributes(mr,yr){const fr=['action','src','href','url','style'];for(let _r,hr=0;hrgr.search(/({{|\[\[)/)&&(Sr.value='style'===_r?Gt.resolveUrlsInCssText(gr,yr):Gt.replaceAttrUrl(gr,yr))}},fixUrlsInTemplates(mr,yr){const fr=mr.querySelectorAll('template');for(let hr=0;hr{let Cr=Sr.replace(/["']/g,'');return yr&&(Cr=Gt.resolveUrl(Cr,yr)),_r+'\''+Cr+'\''+gr})},replaceAttrUrl(mr,yr){return mr&&Wt.test(mr)?mr:Gt.resolveUrl(mr,yr)},resolveUrl(mr,yr){if(void 0===Gt.__workingURL){Gt.__workingURL=!1;try{const hr=new URL('b','http://a');hr.pathname='c%20d',Gt.__workingURL='http://a/c%20d'===hr.href}catch(hr){}}if(Gt.__workingURL)return new URL(mr,yr).href;let fr=Gt.__tempDoc;return fr||(fr=document.implementation.createHTMLDocument('temp'),Gt.__tempDoc=fr,fr.__base=fr.createElement('base'),fr.head.appendChild(fr.__base),fr.__anchor=fr.createElement('a')),fr.__base.href=yr,fr.__anchor.href=mr,fr.__anchor.href||mr}},zt={async:!0,load(mr,yr,fr){if(!mr)fr('error: href must be specified');else if(mr.match(/^data:/)){const hr=mr.split(','),_r=hr[0];let Sr=hr[1];Sr=-1<_r.indexOf(';base64')?atob(Sr):decodeURIComponent(Sr),yr(Sr)}else{const hr=new XMLHttpRequest;hr.open('GET',mr,zt.async),hr.onload=()=>{let _r=hr.getResponseHeader('Location');if(_r&&0===_r.indexOf('/')){const gr=location.origin||location.protocol+'//'+location.host;_r=gr+_r}const Sr=hr.response||hr.responseText;304===hr.status||0===hr.status||200<=hr.status&&300>hr.status?yr(Sr,_r):fr(Sr)},hr.send()}}},$t=/Trident/.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent),Jt='link[rel=import]',Zt='import-disable',Qt=`link[rel=stylesheet][href][type=${Zt}]`,er=`${Jt}, ${Qt}, +(function(){'use strict';(o=>{const $=!!('import'in document.createElement('link'));let _=null;!1=='currentScript'in document&&Object.defineProperty(document,'currentScript',{get(){return _||('complete'===document.readyState?null:document.scripts[document.scripts.length-1])},configurable:!0});const wa=/(^\/)|(^#)|(^[\w-\d]*:)/,xa=/(url\()([^)]*)(\))/g,ya=/(@import[\s]+(?!url\())([^;]*)(;)/g,za=/(]*)(rel=['|"]?stylesheet['|"]?[^>]*>)/g,Aa={fixUrls(Ta,Ua){Ta.href&&Ta.setAttribute('href',Aa.replaceAttrUrl(Ta.getAttribute('href'),Ua)),Ta.src&&Ta.setAttribute('src',Aa.replaceAttrUrl(Ta.getAttribute('src'),Ua)),'style'===Ta.localName&&Aa.resolveUrlsInStyle(Ta,Ua)},fixUrlAttributes(Ta,Ua){const Va=['action','src','href','url','style'];for(let Xa,Wa=0;WaZa.search(/({{|\[\[)/)&&(Ya.value='style'===Xa?Aa.resolveUrlsInCssText(Za,Ua):Aa.replaceAttrUrl(Za,Ua))}},fixUrlsInTemplates(Ta,Ua){const Va=Ta.querySelectorAll('template');for(let Wa=0;Wa{let $a=Ya.replace(/["']/g,'');return Ua&&($a=Aa.resolveUrl($a,Ua)),Xa+'\''+$a+'\''+Za})},replaceAttrUrl(Ta,Ua){return Ta&&wa.test(Ta)?Ta:Aa.resolveUrl(Ta,Ua)},resolveUrl(Ta,Ua){if(void 0===Aa.__workingURL){Aa.__workingURL=!1;try{const Wa=new URL('b','http://a');Wa.pathname='c%20d',Aa.__workingURL='http://a/c%20d'===Wa.href}catch(Wa){}}if(Aa.__workingURL)return new URL(Ta,Ua).href;let Va=Aa.__tempDoc;return Va||(Va=document.implementation.createHTMLDocument('temp'),Aa.__tempDoc=Va,Va.__base=Va.createElement('base'),Va.head.appendChild(Va.__base),Va.__anchor=Va.createElement('a')),Va.__base.href=Ua,Va.__anchor.href=Ta,Va.__anchor.href||Ta}},Ba={async:!0,load(Ta,Ua,Va){if(!Ta)Va('error: href must be specified');else if(Ta.match(/^data:/)){const Wa=Ta.split(','),Xa=Wa[0];let Ya=Wa[1];Ya=-1{let Xa=Wa.getResponseHeader('Location');if(Xa&&0===Xa.indexOf('/')){const Za=location.origin||location.protocol+'//'+location.host;Xa=Za+Xa}const Ya=Wa.response||Wa.responseText;304===Wa.status||0===Wa.status||200<=Wa.status&&300>Wa.status?Ua(Ya,Xa):Va(Ya)},Wa.send()}}},Ca=/Trident/.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent),Da='link[rel=import]',Ea='import-disable',Fa=`link[rel=stylesheet][href][type=${Ea}]`,Ga=`${Da}, ${Fa}, style:not([type]), link[rel=stylesheet][href]:not([type]), script:not([type]), script[type="application/javascript"], - script[type="text/javascript"]`,tr='import-dependency',rr=`${Jt}:not(${tr})`,or=`script[${tr}]`,lr=`style[${tr}], - link[rel=stylesheet][${tr}]`;const sr=mr=>{return mr.nodeType===Node.ELEMENT_NODE&&'link'===mr.localName&&'import'===mr.rel},ar=(mr,yr)=>{if(mr.__loaded)yr&&yr();else if('script'===mr.localName&&!mr.src)mr.__loaded=!0,yr&&yr();else{const fr=hr=>{mr.removeEventListener(hr.type,fr),mr.__loaded=!0,yr&&yr()};mr.addEventListener('load',fr),$t&&'style'===mr.localName||mr.addEventListener('error',fr)}},ir=mr=>{pr(()=>dr(()=>mr&&mr()))},pr=mr=>{if('loading'!==document.readyState)mr();else{const yr=()=>{'loading'!==document.readyState&&(document.removeEventListener('readystatechange',yr),mr())};document.addEventListener('readystatechange',yr)}},dr=mr=>{let yr=document.querySelectorAll(rr),fr=yr.length;if(!fr)return void mr();for(let Sr,hr=0,_r=yr.length;hr<_r&&(Sr=yr[hr]);hr++)ar(Sr,()=>{0==--fr&&mr()})},cr=mr=>{if(Kt)return mr.ownerDocument===document?null:mr.ownerDocument;let yr=mr.__importDoc;if(!yr&&mr.parentNode){if(yr=mr.parentNode,'function'==typeof yr.closest)yr=yr.closest(Jt);else for(;!sr(yr)&&(yr=yr.parentNode););mr.__importDoc=yr}return yr},ur=(mr,yr)=>{if('function'==typeof window.CustomEvent)return new CustomEvent(mr,yr);const fr=document.createEvent('CustomEvent');return fr.initCustomEvent(mr,!!yr.bubbles,!!yr.cancelable,yr.detail),fr};if(Kt){const mr=document.querySelectorAll(Jt);for(let _r,fr=0,hr=mr.length;fr{const hr=fr.target;sr(hr)&&(hr.__loaded=!0)};document.addEventListener('load',yr,!0),document.addEventListener('error',yr,!0)}else new class{constructor(){this.documents={},this.inflight=0,this.dynamicImportsMO=new MutationObserver(mr=>this.handleMutations(mr)),pr(()=>{this.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0}),this.loadImports(document)})}loadImports(mr){const yr=mr.querySelectorAll(Jt);for(let fr=0,hr=yr.length;fr{const _r=this.makeDocument(fr,hr||yr);this.documents[yr]=_r,this.inflight--,this.loadImports(_r),this.processImportsIfLoadingDone()},()=>{this.documents[yr]=null,this.inflight--,this.processImportsIfLoadingDone()})}makeDocument(mr,yr){if(!mr)return document.createDocumentFragment();$t&&(mr=mr.replace(Xt,(Cr,br,Er)=>{return-1===Cr.indexOf('type=')?`${br} type=${Zt} ${Er}`:Cr}));let fr;const hr=document.createElement('template');if(hr.innerHTML=mr,hr.content)fr=hr.content;else for(fr=document.createDocumentFragment();hr.firstChild;)fr.appendChild(hr.firstChild);const _r=fr.querySelector('base');_r&&(yr=Gt.replaceAttrUrl(_r.getAttribute('href'),yr),_r.removeAttribute('href'));const Sr=fr.querySelectorAll(er);let gr=0;for(let Er,Cr=0,br=Sr.length;Cr{yr&&mr&&(this.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0}),this.fireEvents())};this.waitForStyles(()=>{yr=!0,fr()}),this.runScripts(()=>{mr=!0,fr()})}}flatten(mr){const yr=mr.querySelectorAll(Jt);for(let _r,fr=0,hr=yr.length;fr_r.href,configurable:!0,enumerable:!0}),this.flatten(Sr),_r.appendChild(Sr))}}runScripts(mr){const yr=document.querySelectorAll(or),fr=yr.length,hr=_r=>{if(_r{Bt=null,hr(_r+1)})}else mr()};hr(0)}waitForStyles(mr){const yr=document.querySelectorAll(lr);let fr=yr.length;if(!fr)return void mr();const hr=$t&&!!document.querySelector(Qt);for(let gr,_r=0,Sr=yr.length;_r{gr.removeAttribute(tr),0==--fr&&mr()}),hr&&gr.parentNode!==document.head){const Cr=document.createElement(gr.localName);Cr.__appliedElement=gr,Cr.setAttribute('type','import-placeholder'),gr.parentNode.insertBefore(Cr,gr.nextSibling);let br=cr(gr);for(;br&&cr(br);)br=cr(br);br.parentNode!==document.head&&(br=null),document.head.insertBefore(gr,br),gr.removeAttribute('type')}}fireEvents(){const mr=document.querySelectorAll(Jt);for(let fr,yr=mr.length-1;0<=yr&&(fr=mr[yr]);yr--)this.fireEventIfNeeded(fr)}fireEventIfNeeded(mr){if(!mr.__loaded){mr.__loaded=!0,mr.import&&(mr.import.readyState='complete');const yr=mr.import?'load':'error';mr.dispatchEvent(ur(yr,{bubbles:!1,cancelable:!1,detail:void 0}))}}handleMutations(mr){for(let yr=0;yrdocument.dispatchEvent(ur('HTMLImportsLoaded',{cancelable:!0,bubbles:!0,detail:void 0}))),jt.useNative=Kt,jt.whenReady=ir,jt.importForElement=cr})(window.HTMLImports=window.HTMLImports||{}),function(){'use strict';function jt(Yr){var Xr=mr.has(Yr);return Yr=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(Yr),!Xr&&Yr}function Kt(Yr){var Xr=Yr.isConnected;if(void 0!==Xr)return Xr;for(;Yr&&!(Yr.__CE_isImportDocument||Yr instanceof Document);)Yr=Yr.parentNode||(window.ShadowRoot&&Yr instanceof ShadowRoot?Yr.host:void 0);return Yr&&(Yr.__CE_isImportDocument||Yr instanceof Document)}function Bt(Yr,Xr){for(;Xr&&Xr!==Yr&&!Xr.nextSibling;)Xr=Xr.parentNode;return Xr&&Xr!==Yr?Xr.nextSibling:null}function Wt(Yr,Xr,Gr){Gr=Gr?Gr:new Set;for(var zr=Yr;zr;){if(zr.nodeType===Node.ELEMENT_NODE){var $r=zr;Xr($r);var Jr=$r.localName;if('link'===Jr&&'import'===$r.getAttribute('rel')){if(zr=$r.import,zr instanceof Node&&!Gr.has(zr))for(Gr.add(zr),zr=zr.firstChild;zr;zr=zr.nextSibling)Wt(zr,Xr,Gr);zr=Bt(Yr,$r);continue}else if('template'===Jr){zr=Bt(Yr,$r);continue}if($r=$r.__CE_shadowRoot)for($r=$r.firstChild;$r;$r=$r.nextSibling)Wt($r,Xr,Gr)}zr=zr.firstChild?zr.firstChild:Bt(Yr,zr)}}function Vt(Yr,Xr,Gr){Yr[Xr]=Gr}function Yt(){this.a=new Map,this.f=new Map,this.c=[],this.b=!1}function Xt(Yr,Xr,Gr){Yr.a.set(Xr,Gr),Yr.f.set(Gr.constructor,Gr)}function Gt(Yr,Xr){Yr.b=!0,Yr.c.push(Xr)}function zt(Yr,Xr){Yr.b&&Wt(Xr,function(Gr){return $t(Yr,Gr)})}function $t(Yr,Xr){if(Yr.b&&!Xr.__CE_patched){Xr.__CE_patched=!0;for(var Gr=0;Gr`:${Yt}(${Xt.replace(/\s/g,'')})`),jt=jt.replace(nt,`${rt} $1`),jt=jt.replace(et,(Vt,Yt,Xt)=>{if(!Wt){let Gt=this._transformCompoundSelector(Xt,Yt,Kt,Bt);Wt=Wt||Gt.stop,Yt=Gt.combinator,Xt=Gt.value}return Yt+Xt}),jt}_transformCompoundSelector(jt,Kt,Bt,Wt){let Vt=jt.indexOf(lt);0<=jt.indexOf(rt)?jt=this._transformHostSelector(jt,Wt):0!==Vt&&(jt=Bt?this._transformSimpleSelector(jt,Bt):jt);let Yt=!1;0<=Vt&&(Kt='',Yt=!0);let Xt;return Yt&&(Xt=!0,Yt&&(jt=jt.replace(it,(Gt,zt)=>` > ${zt}`))),jt=jt.replace(pt,(Gt,zt,$t)=>`[dir="${$t}"] ${zt}, ${zt}[dir="${$t}"]`),{value:jt,combinator:Kt,stop:Xt}}_transformSimpleSelector(jt,Kt){let Bt=jt.split(ct);return Bt[0]+=Kt,Bt.join(ct)}_transformHostSelector(jt,Kt){let Bt=jt.match(st),Wt=Bt&&Bt[2].trim()||'';if(Wt){if(!Wt[0].match(tt)){let Vt=Wt.split(tt)[0];return Vt===Kt?Wt:'should_not_match'}return jt.replace(st,function(Vt,Yt,Xt){return Kt+Xt})}return jt.replace(rt,Kt)}documentRule(jt){jt.selector=jt.parsedSelector,this.normalizeRootSelector(jt),this._transformRule(jt,this._transformDocumentSelector)}normalizeRootSelector(jt){jt.selector===':root'&&(jt.selector='html')}_transformDocumentSelector(jt){return jt.match(lt)?this._transformComplexSelector(jt,Ze):this._transformSimpleSelector(jt.trim(),Ze)}}let Je=/:(nth[-\w]+)\(([^)]+)\)/,Ze=`:not(.${ze})`,Qe=',',et=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=\[])+)/g,tt=/[[.:#*]/,rt=':host',lt='::slotted',nt=/^(::slotted)/,st=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,it=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,pt=/(.*):dir\((?:(ltr|rtl))\)/,ct=':';var yt=new $e;const ft='__styleInfo';class ht{static get(jt){return jt?jt[ft]:null}static set(jt,Kt){return jt[ft]=Kt,Kt}constructor(jt,Kt,Bt,Wt,Vt,Yt){this.styleRules=jt||null,this.placeholder=Kt||null,this.ownStylePropertyNames=Bt||[],this.overrideStyleProperties=null,this.elementName=Wt||'',this.cssBuild=Yt||'',this.typeExtension=Vt||'',this.styleProperties=null,this.scopeSelector=null,this.customStyle=null}_getStyleRules(){return this.styleRules}}ht.prototype._getStyleRules=ht.prototype._getStyleRules;const _t=(jt=>jt.matches||jt.matchesSelector||jt.mozMatchesSelector||jt.msMatchesSelector||jt.oMatchesSelector||jt.webkitMatchesSelector)(window.Element.prototype),St=navigator.userAgent.match('Trident'),gt='x-scope';class Ct{get XSCOPE_NAME(){return gt}decorateStyles(jt){let Kt=this,Bt={},Wt=[],Vt=0;me(jt,function(Xt){Kt.decorateRule(Xt),Xt.index=Vt++,Kt.collectPropertiesInCssText(Xt.propertyInfo.cssText,Bt)},function(Gt){Wt.push(Gt)}),jt._keyframes=Wt;let Yt=[];for(let Xt in Bt)Yt.push(Xt);return Yt}decorateRule(jt){if(jt.propertyInfo)return jt.propertyInfo;let Kt={},Bt={},Wt=this.collectProperties(jt,Bt);return Wt&&(Kt.properties=Bt,jt.rules=null),Kt.cssText=this.collectCssText(jt),jt.propertyInfo=Kt,Kt}collectProperties(jt,Kt){let Bt=jt.propertyInfo;if(!Bt){let Wt,Yt=jt.parsedCssText,Xt,Gt;for(;Wt=qe.exec(Yt);)Xt=(Wt[2]||Wt[3]).trim(),('inherit'!==Xt||'unset'!==Xt)&&(Kt[Wt[1].trim()]=Xt),Gt=!0;return Gt}else if(Bt.properties)return Object.assign(Kt,Bt.properties),!0}collectCssText(jt){return this.collectConsumingCssText(jt.parsedCssText)}collectConsumingCssText(jt){return jt.replace(Ve,'').replace(qe,'')}collectPropertiesInCssText(jt,Kt){for(let Bt,Wt;Bt=Ke.exec(jt);)Wt=Bt[1],':'!==Bt[2]&&(Kt[Wt]=!0)}reify(jt){let Kt=Object.getOwnPropertyNames(jt);for(let Wt,Bt=0;Bt *'===Xt||'html'===Xt,zt=0===Xt.indexOf(':host')&&!Gt;if('shady'===Bt&&(Gt=Xt===Yt+' > *.'+Yt||-1!==Xt.indexOf('html'),zt=!Gt&&0===Xt.indexOf(Yt)),'shadow'===Bt&&(Gt=':host > *'===Xt||'html'===Xt,zt=zt&&!Gt),Gt||zt){let $t=Yt;zt&&(Fe&&!Kt.transformedSelector&&(Kt.transformedSelector=yt._transformRuleCss(Kt,yt._transformComplexSelector,yt._calcElementScope(Vt.is),Yt)),$t=Kt.transformedSelector||Yt),Wt({selector:$t,isHost:zt,isRoot:Gt})}}}hostAndRootPropertiesForScope(jt,Kt){let Bt={},Wt={},Vt=this,Yt=Kt&&Kt.__cssBuild;return me(Kt,function(Xt){Vt.whenHostOrRootRule(jt,Xt,Yt,function(Gt){let zt=jt._element||jt;_t.call(zt,Gt.selector)&&(Gt.isHost?Vt.collectProperties(Xt,Bt):Vt.collectProperties(Xt,Wt))})},null,!0),{rootProps:Wt,hostProps:Bt}}transformStyles(jt,Kt,Bt){let Wt=this,Vt=be(jt),Yt=yt._calcHostScope(Vt.is,Vt.extends),Xt=jt.extends?'\\'+Yt.slice(0,-1)+'\\]':Yt,Gt=new RegExp('(?:^|[^.#[:])'+Xt+'($|[.:[\\s>+~])'),zt=ht.get(jt).styleRules,$t=this._elementKeyframeTransforms(jt,zt,Bt);return yt.elementStyles(jt,zt,function(Jt){Wt.applyProperties(Jt,Kt),Fe||ue(Jt)||!Jt.cssText||(Wt.applyKeyframeTransforms(Jt,$t),Wt._scopeSelector(Jt,Gt,Yt,Bt))})}_elementKeyframeTransforms(jt,Kt,Bt){let Wt=Kt._keyframes,Vt={};if(!Fe&&Wt)for(let Yt=0,Xt=Wt[Yt];Yt=Xt._useCount&&Xt.parentNode&&Xt.parentNode.removeChild(Xt)),Fe?Yt.customStyle?(Yt.customStyle.textContent=Vt,Wt=Yt.customStyle):Vt&&(Wt=ye(Vt,Bt,jt.shadowRoot,Yt.placeholder)):Wt?!Wt.parentNode&&fe(Wt,null,Yt.placeholder):Vt&&(Wt=ye(Vt,Bt,null,Yt.placeholder)),Wt&&(Wt._useCount=Wt._useCount||0,Yt.customStyle!=Wt&&Wt._useCount++,Yt.customStyle=Wt),St&&(Wt.textContent=Wt.textContent),Wt}applyCustomStyle(jt,Kt){let Bt=de(jt),Wt=this;jt.textContent=pe(Bt,function(Vt){let Yt=Vt.cssText=Vt.parsedCssText;Vt.propertyInfo&&Vt.propertyInfo.cssText&&(Yt=se(Yt),Vt.cssText=Wt.valueForProperties(Yt,Kt))})}}var bt=new Ct;let Et={};const Nt=window.customElements;if(Nt&&!Fe){const jt=Nt.define;Nt.define=function(Kt,Bt,Wt){return Et[Kt]=_e(Kt),jt.call(Nt,Kt,Bt,Wt)}}let xt=function(){};if(!Fe){let jt=Yt=>{return Yt.classList&&!Yt.classList.contains(yt.SCOPE_NAME)||Yt instanceof window.SVGElement&&(!Yt.hasAttribute('class')||0>Yt.getAttribute('class').indexOf(yt.SCOPE_NAME))},Kt=Yt=>{for(let Gt,Xt=0;Xt{Bt.observe(Yt,{childList:!0,subtree:!0})},Vt=window.customElements&&!window.customElements.flush;if(Vt)Wt(document);else{let Yt=()=>{Wt(document.body)};window.HTMLImports?window.HTMLImports.whenReady(Yt):requestAnimationFrame(function(){if('loading'===document.readyState){let Xt=function(){Yt(),document.removeEventListener('readystatechange',Xt)};document.addEventListener('readystatechange',Xt)}else Yt()})}xt=function(){Kt(Bt.takeRecords())}}const At={},Rt=Promise.resolve();let Tt=null,It=window.HTMLImports&&window.HTMLImports.whenReady||null,kt;const Lt='__processedByShadyCSS',wt='__seenByShadyCSS';let Pt=null,Ot=null;class Mt{constructor(){this.customStyles=[],this.enqueued=!1}enqueueDocumentValidation(){this.enqueued||!Ot||(this.enqueued=!0,Te(Ot))}addCustomStyle(jt){jt[wt]||(jt[wt]=!0,this.customStyles.push(jt),this.enqueueDocumentValidation())}getStyleForCustomStyle(jt){let Kt;return Kt=jt.getStyle?jt.getStyle():jt,Kt}findStyles(){let jt=this.customStyles;for(let Bt,Kt=0;Ktthis.typeMax&&Vt.shift(),this.cache[jt]=Vt}fetch(jt,Kt,Bt){let Wt=this.cache[jt];if(Wt)for(let Yt,Vt=Wt.length-1;0<=Vt;Vt--)if(Yt=Wt[Vt],this._validate(Yt,Kt,Bt))return Yt}};class Ut{constructor(){this._scopeCounter={},this._documentOwner=document.documentElement;let jt=new ke;jt.rules=[],this._documentOwnerStyleInfo=ht.set(document.documentElement,new ht(jt)),this._elementsHaveApplied=!1,this._applyShim=null,this._customStyleInterface=null,Te(()=>{this._ensure()})}flush(){xt()}_generateScopeSelector(jt){let Kt=this._scopeCounter[jt]=(this._scopeCounter[jt]||0)+1;return`${jt}-${Kt}`}getStyleAst(jt){return de(jt)}styleAstToString(jt){return pe(jt)}_gatherStyles(jt){let Kt=jt.content.querySelectorAll('style'),Bt=[];for(let Vt,Wt=0;Wt{this.transformCustomStyleForDocument(jt)},this._customStyleInterface.validateCallback=()=>{requestAnimationFrame(()=>{(this._customStyleInterface.enqueued||this._elementsHaveApplied)&&this.flushCustomStyles()})}):this._customStyleInterface={['findStyles'](){},enqueued:!1,['getStyleForCustomStyle'](){return null}})}_ensure(){this._ensureApplyShim(),this._ensureCustomStyleInterface()}flushCustomStyles(){if(this._ensure(),this._customStyleInterface.findStyles(),!!this._customStyleInterface.enqueued){let jt=this._customStyleInterface.customStyles;He?this._revalidateCustomStyleApplyShim(jt):(this._updateProperties(this._documentOwner,this._documentOwnerStyleInfo),this._applyCustomStyles(jt)),this._customStyleInterface.enqueued=!1,this._elementsHaveApplied&&!He&&this.styleDocument()}}styleElement(jt,Kt){let{is:Bt}=be(jt),Wt=ht.get(jt);if(Wt||(Wt=this._prepareHost(jt)),this._isRootOwner(jt)||(this._elementsHaveApplied=!0),Kt&&(Wt.overrideStyleProperties=Wt.overrideStyleProperties||{},Object.assign(Wt.overrideStyleProperties,Kt)),!He)this._updateProperties(jt,Wt),Wt.ownStylePropertyNames&&Wt.ownStylePropertyNames.length&&this._applyStyleProperties(jt,Wt);else{Wt.overrideStyleProperties&&Ie(jt,Wt.overrideStyleProperties);let Vt=At[Bt];if(!Vt&&!this._isRootOwner(jt))return;if(Vt&&Vt._style&&!xe(Vt)){if(Ae(Vt)||(this._ensure(),this._applyShim.transformRules(Vt._styleAst,Bt),Vt._style.textContent=yt.elementStyles(jt,Wt.styleRules),Re(Vt)),Fe){let Yt=jt.shadowRoot;if(Yt){let Xt=Yt.querySelector('style');Xt.textContent=yt.elementStyles(jt,Wt.styleRules)}}Wt.styleRules=Vt._styleAst}}}_styleOwnerForNode(jt){let Kt=jt.getRootNode(),Bt=Kt.host;return Bt?ht.get(Bt)?Bt:this._styleOwnerForNode(Bt):this._documentOwner}_isRootOwner(jt){return jt===this._documentOwner}_applyStyleProperties(jt,Kt){let Bt=be(jt).is,Wt=Dt.fetch(Bt,Kt.styleProperties,Kt.ownStylePropertyNames),Vt=Wt&&Wt.scopeSelector,Yt=Wt?Wt.styleElement:null,Xt=Kt.scopeSelector;Kt.scopeSelector=Vt||this._generateScopeSelector(Bt);let Gt=bt.applyElementStyle(jt,Kt.styleProperties,Kt.scopeSelector,Yt);return Fe||bt.applyElementScopeSelector(jt,Kt.scopeSelector,Xt),Wt||Dt.store(Bt,Kt.styleProperties,Gt,Kt.scopeSelector),Gt}_updateProperties(jt,Kt){let Bt=this._styleOwnerForNode(jt),Wt=ht.get(Bt),Vt=Wt.styleProperties,Yt=Object.create(Vt||null),Xt=bt.hostAndRootPropertiesForScope(jt,Kt.styleRules),Gt=bt.propertyDataFromStyles(Wt.styleRules,jt),zt=Gt.properties;Object.assign(Yt,Xt.hostProps,zt,Xt.rootProps),this._mixinOverrideStyles(Yt,Kt.overrideStyleProperties),bt.reify(Yt),Kt.styleProperties=Yt}_mixinOverrideStyles(jt,Kt){for(let Bt in Kt){let Wt=Kt[Bt];(Wt||0===Wt)&&(jt[Bt]=Wt)}}styleDocument(jt){this.styleSubtree(this._documentOwner,jt)}styleSubtree(jt,Kt){(jt.shadowRoot||this._isRootOwner(jt))&&this.styleElement(jt,Kt);let Bt=jt.shadowRoot,Wt=Bt&&(Bt.children||Bt.childNodes);if(Wt)for(let Xt,Yt=0;Yt{Fe?yt.normalizeRootSelector(Bt):yt.documentRule(Bt),He&&(this._ensure(),this._applyShim.transformRule(Bt))}),He?jt.textContent=pe(Kt):this._documentOwnerStyleInfo.styleRules.rules.push(Kt)}_revalidateApplyShim(jt){if(He){let Kt=de(jt);this._ensure(),this._applyShim.transformRules(Kt),jt.textContent=pe(Kt)}}getComputedStyleValue(jt,Kt){let Bt;if(!He){let Wt=ht.get(jt)||ht.get(this._styleOwnerForNode(jt));Bt=Wt.styleProperties[Kt]}return Bt=Bt||window.getComputedStyle(jt).getPropertyValue(Kt),Bt.trim()}setElementClass(jt,Kt){let Bt=jt.getRootNode(),Wt=Kt?Kt.split(/\s/):[],Vt=Bt.host&&Bt.host.localName;if(!Vt){var Yt=jt.getAttribute('class');if(Yt){let Xt=Yt.split(/\s/);for(let Gt=0;Gt{return Ta.nodeType===Node.ELEMENT_NODE&&'link'===Ta.localName&&'import'===Ta.rel},Na=(Ta,Ua)=>{if(Ta.__loaded)Ua&&Ua();else if('script'===Ta.localName&&!Ta.src)Ta.__loaded=!0,Ua&&Ua();else{const Va=Wa=>{Ta.removeEventListener(Wa.type,Va),Ta.__loaded=!0,Ua&&Ua()};Ta.addEventListener('load',Va),Ca&&'style'===Ta.localName||Ta.addEventListener('error',Va)}},Oa=Ta=>{Pa(()=>Qa(()=>Ta&&Ta()))},Pa=Ta=>{if('loading'!==document.readyState)Ta();else{const Ua=()=>{'loading'!==document.readyState&&(document.removeEventListener('readystatechange',Ua),Ta())};document.addEventListener('readystatechange',Ua)}},Qa=Ta=>{let Ua=document.querySelectorAll(Ia),Va=Ua.length;if(!Va)return void Ta();for(let Ya,Wa=0,Xa=Ua.length;Wa{0==--Va&&Ta()})},Ra=Ta=>{if($)return Ta.ownerDocument===document?null:Ta.ownerDocument;let Ua=Ta.__importDoc;if(!Ua&&Ta.parentNode){if(Ua=Ta.parentNode,'function'==typeof Ua.closest)Ua=Ua.closest(Da);else for(;!Ma(Ua)&&(Ua=Ua.parentNode););Ta.__importDoc=Ua}return Ua},Sa=(Ta,Ua)=>{if('function'==typeof window.CustomEvent)return new CustomEvent(Ta,Ua);const Va=document.createEvent('CustomEvent');return Va.initCustomEvent(Ta,!!Ua.bubbles,!!Ua.cancelable,Ua.detail),Va};if($){const Ta=document.querySelectorAll(Da);for(let Xa,Va=0,Wa=Ta.length;Va{const Wa=Va.target;Ma(Wa)&&(Wa.__loaded=!0)};document.addEventListener('load',Ua,!0),document.addEventListener('error',Ua,!0)}else new class{constructor(){this.documents={},this.inflight=0,this.dynamicImportsMO=new MutationObserver(Ta=>this.handleMutations(Ta)),Pa(()=>{this.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0}),this.loadImports(document)})}loadImports(Ta){const Ua=Ta.querySelectorAll(Da);for(let Va=0,Wa=Ua.length;Va{const Xa=this.makeDocument(Va,Wa||Ua);this.documents[Ua]=Xa,this.inflight--,this.loadImports(Xa),this.processImportsIfLoadingDone()},()=>{this.documents[Ua]=null,this.inflight--,this.processImportsIfLoadingDone()})}makeDocument(Ta,Ua){if(!Ta)return document.createDocumentFragment();Ca&&(Ta=Ta.replace(za,($a,_a,ab)=>{return-1===$a.indexOf('type=')?`${_a} type=${Ea} ${ab}`:$a}));let Va;const Wa=document.createElement('template');if(Wa.innerHTML=Ta,Wa.content)Va=Wa.content;else for(Va=document.createDocumentFragment();Wa.firstChild;)Va.appendChild(Wa.firstChild);const Xa=Va.querySelector('base');Xa&&(Ua=Aa.replaceAttrUrl(Xa.getAttribute('href'),Ua),Xa.removeAttribute('href'));const Ya=Va.querySelectorAll(Ga);let Za=0;for(let ab,$a=0,_a=Ya.length;$a<_a&&(ab=Ya[$a]);$a++)if(Na(ab),Aa.fixUrls(ab,Ua),ab.setAttribute(Ha,''),'script'===ab.localName&&!ab.src&&ab.textContent){const bb=Za?`-${Za}`:'',db=ab.textContent+`\n//# sourceURL=${Ua}${bb}.js\n`;ab.setAttribute('src','data:text/javascript;charset=utf-8,'+encodeURIComponent(db)),ab.textContent='',Za++}return Aa.fixUrlsInTemplates(Va,Ua),Va}processImportsIfLoadingDone(){if(!this.inflight){this.dynamicImportsMO.disconnect(),this.flatten(document);let Ta=!1,Ua=!1;const Va=()=>{Ua&&Ta&&(this.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0}),this.fireEvents())};this.waitForStyles(()=>{Ua=!0,Va()}),this.runScripts(()=>{Ta=!0,Va()})}}flatten(Ta){const Ua=Ta.querySelectorAll(Da);for(let Xa,Va=0,Wa=Ua.length;VaXa.href,configurable:!0,enumerable:!0}),this.flatten(Ya),Xa.appendChild(Ya))}}runScripts(Ta){const Ua=document.querySelectorAll(Ja),Va=Ua.length,Wa=Xa=>{if(Xa{_=null,Wa(Xa+1)})}else Ta()};Wa(0)}waitForStyles(Ta){const Ua=document.querySelectorAll(Ka);let Va=Ua.length;if(!Va)return void Ta();const Wa=Ca&&!!document.querySelector(Fa);for(let Za,Xa=0,Ya=Ua.length;Xa{Za.removeAttribute(Ha),0==--Va&&Ta()}),Wa&&Za.parentNode!==document.head){const $a=document.createElement(Za.localName);$a.__appliedElement=Za,$a.setAttribute('type','import-placeholder'),Za.parentNode.insertBefore($a,Za.nextSibling);let _a=Ra(Za);for(;_a&&Ra(_a);)_a=Ra(_a);_a.parentNode!==document.head&&(_a=null),document.head.insertBefore(Za,_a),Za.removeAttribute('type')}}fireEvents(){const Ta=document.querySelectorAll(Da);for(let Va,Ua=Ta.length-1;0<=Ua&&(Va=Ta[Ua]);Ua--)this.fireEventIfNeeded(Va)}fireEventIfNeeded(Ta){if(!Ta.__loaded){Ta.__loaded=!0,Ta.import&&(Ta.import.readyState='complete');const Ua=Ta.import?'load':'error';Ta.dispatchEvent(Sa(Ua,{bubbles:!1,cancelable:!1,detail:void 0}))}}handleMutations(Ta){for(let Ua=0;Uadocument.dispatchEvent(Sa('HTMLImportsLoaded',{cancelable:!0,bubbles:!0,detail:void 0}))),o.useNative=$,o.whenReady=Oa,o.importForElement=Ra})(window.HTMLImports=window.HTMLImports||{}),function(){'use strict';function o(zb){var Ab=Ta.has(zb);return zb=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(zb),!Ab&&zb}function $(zb){var Ab=zb.isConnected;if(void 0!==Ab)return Ab;for(;zb&&!(zb.__CE_isImportDocument||zb instanceof Document);)zb=zb.parentNode||(window.ShadowRoot&&zb instanceof ShadowRoot?zb.host:void 0);return zb&&(zb.__CE_isImportDocument||zb instanceof Document)}function _(zb,Ab){for(;Ab&&Ab!==zb&&!Ab.nextSibling;)Ab=Ab.parentNode;return Ab&&Ab!==zb?Ab.nextSibling:null}function wa(zb,Ab,Bb){Bb=Bb?Bb:new Set;for(var Cb=zb;Cb;){if(Cb.nodeType===Node.ELEMENT_NODE){var Db=Cb;Ab(Db);var Eb=Db.localName;if('link'===Eb&&'import'===Db.getAttribute('rel')){if(Cb=Db.import,Cb instanceof Node&&!Bb.has(Cb))for(Bb.add(Cb),Cb=Cb.firstChild;Cb;Cb=Cb.nextSibling)wa(Cb,Ab,Bb);Cb=_(zb,Db);continue}else if('template'===Eb){Cb=_(zb,Db);continue}if(Db=Db.__CE_shadowRoot)for(Db=Db.firstChild;Db;Db=Db.nextSibling)wa(Db,Ab,Bb)}Cb=Cb.firstChild?Cb.firstChild:_(zb,Cb)}}function xa(zb,Ab,Bb){zb[Ab]=Bb}function ya(){this.a=new Map,this.f=new Map,this.c=[],this.b=!1}function za(zb,Ab,Bb){zb.a.set(Ab,Bb),zb.f.set(Bb.constructor,Bb)}function Aa(zb,Ab){zb.b=!0,zb.c.push(Ab)}function Ba(zb,Ab){zb.b&&wa(Ab,function(Bb){return Ca(zb,Bb)})}function Ca(zb,Ab){if(zb.b&&!Ab.__CE_patched){Ab.__CE_patched=!0;for(var Bb=0;Bb {\n\n /********************* base setup *********************/\n const useNative = Boolean('import' in document.createElement('link'));\n\n // Polyfill `currentScript` for browsers without it.\n let currentScript = null;\n if ('currentScript' in document === false) {\n Object.defineProperty(document, 'currentScript', {\n get() {\n return currentScript ||\n // NOTE: only works when called in synchronously executing code.\n // readyState should check if `loading` but IE10 is\n // interactive when scripts run so we cheat. This is not needed by\n // html-imports polyfill but helps generally polyfill `currentScript`.\n (document.readyState !== 'complete' ?\n document.scripts[document.scripts.length - 1] : null);\n },\n configurable: true\n });\n }\n\n /********************* path fixup *********************/\n const ABS_URL_TEST = /(^\\/)|(^#)|(^[\\w-\\d]*:)/;\n const CSS_URL_REGEXP = /(url\\()([^)]*)(\\))/g;\n const CSS_IMPORT_REGEXP = /(@import[\\s]+(?!url\\())([^;]*)(;)/g;\n const STYLESHEET_REGEXP = /(]*)(rel=['|\"]?stylesheet['|\"]?[^>]*>)/g;\n\n // path fixup: style elements in imports must be made relative to the main\n // document. We fixup url's in url() and @import.\n const Path = {\n\n fixUrls(element, base) {\n if (element.href) {\n element.setAttribute('href',\n Path.replaceAttrUrl(element.getAttribute('href'), base));\n }\n if (element.src) {\n element.setAttribute('src',\n Path.replaceAttrUrl(element.getAttribute('src'), base));\n }\n if (element.localName === 'style') {\n Path.resolveUrlsInStyle(element, base);\n }\n },\n\n fixUrlAttributes(element, base) {\n const attrs = ['action', 'src', 'href', 'url', 'style'];\n for (let i = 0, a; i < attrs.length && (a = attrs[i]); i++) {\n const at = element.attributes[a];\n const v = at && at.value;\n // Skip bound attribute values (assume binding is done via {} and []).\n // TODO(valdrin) consider exposing a library-implementable hook.\n if (v && (v.search(/({{|\\[\\[)/) < 0)) {\n at.value = (a === 'style') ?\n Path.resolveUrlsInCssText(v, base) :\n Path.replaceAttrUrl(v, base);\n }\n }\n },\n\n fixUrlsInTemplates(element, base) {\n const t$ = element.querySelectorAll('template');\n for (let i = 0; i < t$.length; i++) {\n Path.fixUrlsInTemplate(t$[i], base);\n }\n },\n\n fixUrlsInTemplate(template, base) {\n // If template is not supported, still resolve urls within it.\n const content = template.content || template;\n const n$ = content.querySelectorAll(\n 'style, form[action], [src], [href], [url], [style]');\n for (let i = 0; i < n$.length; i++) {\n const n = n$[i];\n if (n.localName == 'style') {\n Path.resolveUrlsInStyle(n, base);\n } else {\n Path.fixUrlAttributes(n, base);\n }\n }\n Path.fixUrlsInTemplates(content, base);\n },\n\n resolveUrlsInStyle(style, linkUrl) {\n style.textContent = Path.resolveUrlsInCssText(style.textContent, linkUrl);\n },\n\n resolveUrlsInCssText(cssText, linkUrl) {\n let r = Path.replaceUrls(cssText, linkUrl, CSS_URL_REGEXP);\n r = Path.replaceUrls(r, linkUrl, CSS_IMPORT_REGEXP);\n return r;\n },\n\n replaceUrls(text, linkUrl, regexp) {\n return text.replace(regexp, (m, pre, url, post) => {\n let urlPath = url.replace(/[\"']/g, '');\n if (linkUrl) {\n urlPath = Path.resolveUrl(urlPath, linkUrl);\n }\n return pre + '\\'' + urlPath + '\\'' + post;\n });\n },\n\n replaceAttrUrl(text, linkUrl) {\n if (text && ABS_URL_TEST.test(text)) {\n return text;\n } else {\n return Path.resolveUrl(text, linkUrl);\n }\n },\n\n resolveUrl(url, base) {\n // Lazy feature detection.\n if (Path.__workingURL === undefined) {\n Path.__workingURL = false;\n try {\n const u = new URL('b', 'http://a');\n u.pathname = 'c%20d';\n Path.__workingURL = (u.href === 'http://a/c%20d');\n } catch (e) {}\n }\n\n if (Path.__workingURL) {\n return (new URL(url, base)).href;\n }\n\n // Fallback to creating an anchor into a disconnected document.\n let doc = Path.__tempDoc;\n if (!doc) {\n doc = document.implementation.createHTMLDocument('temp');\n Path.__tempDoc = doc;\n doc.__base = doc.createElement('base');\n doc.head.appendChild(doc.__base);\n doc.__anchor = doc.createElement('a');\n }\n doc.__base.href = base;\n doc.__anchor.href = url;\n return doc.__anchor.href || url;\n }\n };\n\n /********************* Xhr processor *********************/\n const Xhr = {\n\n async: true,\n\n /**\n * @param {!string} url\n * @param {!function(!string, string=)} success\n * @param {!function(!string)} fail\n */\n load(url, success, fail) {\n if (!url) {\n fail('error: href must be specified');\n } else if (url.match(/^data:/)) {\n // Handle Data URI Scheme\n const pieces = url.split(',');\n const header = pieces[0];\n let resource = pieces[1];\n if (header.indexOf(';base64') > -1) {\n resource = atob(resource);\n } else {\n resource = decodeURIComponent(resource);\n }\n success(resource);\n } else {\n const request = new XMLHttpRequest();\n request.open('GET', url, Xhr.async);\n request.onload = () => {\n // Servers redirecting an import can add a Location header to help us\n // polyfill correctly. Handle relative and full paths.\n let redirectedUrl = request.getResponseHeader('Location');\n if (redirectedUrl && redirectedUrl.indexOf('/') === 0) {\n // In IE location.origin might not work\n // https://connect.microsoft.com/IE/feedback/details/1763802/location-origin-is-undefined-in-ie-11-on-windows-10-but-works-on-windows-7\n const origin = (location.origin || location.protocol + '//' + location.host);\n redirectedUrl = origin + redirectedUrl;\n }\n const resource = /** @type {string} */ (request.response || request.responseText);\n if (request.status === 304 || request.status === 0 ||\n request.status >= 200 && request.status < 300) {\n success(resource, redirectedUrl);\n } else {\n fail(resource);\n }\n };\n request.send();\n }\n }\n };\n\n /********************* importer *********************/\n\n const isIE = /Trident/.test(navigator.userAgent) ||\n /Edge\\/\\d./i.test(navigator.userAgent);\n\n const importSelector = 'link[rel=import]';\n\n // Used to disable loading of resources.\n const importDisableType = 'import-disable';\n\n const disabledLinkSelector = `link[rel=stylesheet][href][type=${importDisableType}]`;\n\n const importDependenciesSelector = `${importSelector}, ${disabledLinkSelector},\n style:not([type]), link[rel=stylesheet][href]:not([type]),\n script:not([type]), script[type=\"application/javascript\"],\n script[type=\"text/javascript\"]`;\n\n const importDependencyAttr = 'import-dependency';\n\n const rootImportSelector = `${importSelector}:not(${importDependencyAttr})`;\n\n const pendingScriptsSelector = `script[${importDependencyAttr}]`;\n\n const pendingStylesSelector = `style[${importDependencyAttr}],\n link[rel=stylesheet][${importDependencyAttr}]`;\n\n /**\n * Importer will:\n * - load any linked import documents (with deduping)\n * - whenever an import is loaded, prompt the parser to try to parse\n * - observe imported documents for new elements (these are handled via the\n * dynamic importer)\n */\n class Importer {\n constructor() {\n this.documents = {};\n // Used to keep track of pending loads, so that flattening and firing of\n // events can be done when all resources are ready.\n this.inflight = 0;\n this.dynamicImportsMO = new MutationObserver(m => this.handleMutations(m));\n // 1. Load imports contents\n // 2. Assign them to first import links on the document\n // 3. Wait for import styles & scripts to be done loading/running\n // 4. Fire load/error events\n whenDocumentReady(() => {\n // Observe changes on .\n this.dynamicImportsMO.observe(document.head, {\n childList: true,\n subtree: true\n });\n this.loadImports(document);\n });\n }\n\n /**\n * @param {!(HTMLDocument|DocumentFragment|Element)} doc\n */\n loadImports(doc) {\n const links = /** @type {!NodeList} */\n (doc.querySelectorAll(importSelector));\n for (let i = 0, l = links.length; i < l; i++) {\n this.loadImport(links[i]);\n }\n }\n\n /**\n * @param {!HTMLLinkElement} link\n */\n loadImport(link) {\n const url = link.href;\n // This resource is already being handled by another import.\n if (this.documents[url] !== undefined) {\n // If import is already loaded, we can safely associate it to the link\n // and fire the load/error event.\n const imp = this.documents[url];\n if (imp && imp['__loaded']) {\n link.import = imp;\n this.fireEventIfNeeded(link);\n }\n return;\n }\n this.inflight++;\n // Mark it as pending to notify others this url is being loaded.\n this.documents[url] = 'pending';\n Xhr.load(url, (resource, redirectedUrl) => {\n const doc = this.makeDocument(resource, redirectedUrl || url);\n this.documents[url] = doc;\n this.inflight--;\n // Load subtree.\n this.loadImports(doc);\n this.processImportsIfLoadingDone();\n }, () => {\n // If load fails, handle error.\n this.documents[url] = null;\n this.inflight--;\n this.processImportsIfLoadingDone();\n });\n }\n\n /**\n * Creates a new document containing resource and normalizes urls accordingly.\n * @param {string=} resource\n * @param {string=} url\n * @return {!DocumentFragment}\n */\n makeDocument(resource, url) {\n if (!resource) {\n return document.createDocumentFragment();\n }\n\n if (isIE) {\n // should be appended to . Not doing so\n // in IE/Edge breaks the cascading order. We disable the loading by\n // setting the type before setting innerHTML to avoid loading\n // resources twice.\n resource = resource.replace(STYLESHEET_REGEXP, (match, p1, p2) => {\n if (match.indexOf('type=') === -1) {\n return `${p1} type=${importDisableType} ${p2}`;\n }\n return match;\n });\n }\n\n let content;\n const template = /** @type {!HTMLTemplateElement} */\n (document.createElement('template'));\n template.innerHTML = resource;\n if (template.content) {\n // This creates issues in Safari10 when used with shadydom (see #12).\n content = template.content;\n } else {\n //