From 8244b34ee6d3459b9b4daea9e07f6862d55df3de Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Tue, 14 Feb 2017 16:58:28 -0800 Subject: [PATCH] Test with html-imports#fix-30 --- webcomponents-hi-ce.js | 6 +++--- webcomponents-hi-ce.js.map | 2 +- webcomponents-hi-sd-ce.js | 6 +++--- webcomponents-hi-sd-ce.js.map | 2 +- webcomponents-hi.js | 6 +++--- webcomponents-hi.js.map | 2 +- webcomponents-lite.js | 6 +++--- webcomponents-lite.js.map | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/webcomponents-hi-ce.js b/webcomponents-hi-ce.js index 127461f..251616c 100644 --- a/webcomponents-hi-ce.js +++ b/webcomponents-hi-ce.js @@ -1,6 +1,6 @@ -(function(){'use strict';function _(Ot){return Ot=$(Ot),te(ee(Ot),Ot)}function $(Ot){return Ot.replace(Re.comments,'').replace(Re.port,'')}function ee(Ot){let Pt={start:0,end:Ot.length},Lt=Pt;for(let wt=0,kt=Ot.length;wt{'complete'===document.readyState&&Ae()}))}function Ae(){requestAnimationFrame(()=>{(Tt||xt._elementsHaveApplied)&&xt.updateStyles(),Tt=!1})}(Ot=>{const Pt=!!('import'in document.createElement('link'));let Lt=null;!1=='currentScript'in document&&Object.defineProperty(document,'currentScript',{get(){return Lt||('complete'===document.readyState?null:document.scripts[document.scripts.length-1])},configurable:!0});const wt=/(^\/)|(^#)|(^[\w-\d]*:)/,kt=/(url\()([^)]*)(\))/g,Dt=/(@import[\s]+(?!url\())([^;]*)(;)/g,Ht=/(]*)(rel=['|"]?stylesheet['|"]?[^>]*>)/g,Ut={fixUrls(lr,sr){lr.href&&lr.setAttribute('href',Ut.replaceAttrUrl(lr.getAttribute('href'),sr)),lr.src&&lr.setAttribute('src',Ut.replaceAttrUrl(lr.getAttribute('src'),sr)),'style'===lr.localName&&Ut.resolveUrlsInStyle(lr,sr)},fixUrlAttributes(lr,sr){const ar=['action','src','href','url','style'];for(let pr,ir=0;ircr.search(/({{|\[\[)/)&&(dr.value='style'===pr?Ut.resolveUrlsInCssText(cr,sr):Ut.replaceAttrUrl(cr,sr))}},fixUrlsInTemplates(lr,sr){const ar=lr.querySelectorAll('template');for(let ir=0;ir{let mr=dr.replace(/["']/g,'');return sr&&(mr=Ut.resolveUrl(mr,sr)),pr+'\''+mr+'\''+cr})},replaceAttrUrl(lr,sr){return lr&&wt.test(lr)?lr:Ut.resolveUrl(lr,sr)},resolveUrl(lr,sr){if(void 0===Ut.__workingURL){Ut.__workingURL=!1;try{const ir=new URL('b','http://a');ir.pathname='c%20d',Ut.__workingURL='http://a/c%20d'===ir.href}catch(ir){}}if(Ut.__workingURL)return new URL(lr,sr).href;let ar=Ut.__tempDoc;return ar||(ar=document.implementation.createHTMLDocument('temp'),Ut.__tempDoc=ar,ar.__base=ar.createElement('base'),ar.head.appendChild(ar.__base),ar.__anchor=ar.createElement('a')),ar.__base.href=sr,ar.__anchor.href=lr,ar.__anchor.href||lr}},Ft={async:!0,load(lr,sr,ar){if(!lr)ar('error: href must be specified');else if(lr.match(/^data:/)){const ir=lr.split(','),pr=ir[0];let dr=ir[1];dr=-1{let pr=ir.getResponseHeader('Location');if(pr&&0===pr.indexOf('/')){const cr=location.origin||location.protocol+'//'+location.host;pr=cr+pr}const dr=ir.response||ir.responseText;304===ir.status||0===ir.status||200<=ir.status&&300>ir.status?sr(dr,pr):ar(dr)},ir.send()}}},jt=/Trident/.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent),qt='link[rel=import]',Bt='import-disable',Kt=`link[rel=stylesheet][href][type=${Bt}]`,Xt=`${qt}, ${Kt}, +(function(){'use strict';function _(Mt){return Mt=$(Mt),te(ee(Mt),Mt)}function $(Mt){return Mt.replace(Re.comments,'').replace(Re.port,'')}function ee(Mt){let Ot={start:0,end:Mt.length},Pt=Ot;for(let Lt=0,wt=Mt.length;Lt{'complete'===document.readyState&&Ae()}))}function Ae(){requestAnimationFrame(()=>{(xt||vt._elementsHaveApplied)&&vt.updateStyles(),xt=!1})}(Mt=>{const Ot=!!('import'in document.createElement('link'));let Pt=null;!1=='currentScript'in document&&Object.defineProperty(document,'currentScript',{get(){return Pt||('complete'===document.readyState?null:document.scripts[document.scripts.length-1])},configurable:!0});const Lt=/(^\/)|(^#)|(^[\w-\d]*:)/,wt=/(url\()([^)]*)(\))/g,kt=/(@import[\s]+(?!url\())([^;]*)(;)/g,Dt=/(]*)(rel=['|"]?stylesheet['|"]?[^>]*>)/g,Ht={fixUrls(rr,or){if(rr.href&&rr.setAttribute('href',Ht.replaceAttrUrl(rr.getAttribute('href'),or)),rr.src&&rr.setAttribute('src',Ht.replaceAttrUrl(rr.getAttribute('src'),or)),'style'===rr.localName){let nr=Ht.replaceUrls(rr.textContent,or,wt);nr=Ht.replaceUrls(nr,or,kt),rr.textContent=nr}},replaceUrls(rr,or,nr){return rr.replace(nr,(lr,sr,ar,ir)=>{let pr=ar.replace(/["']/g,'');return or&&(pr=Ht.resolveUrl(pr,or)),sr+'\''+pr+'\''+ir})},replaceAttrUrl(rr,or){return rr&&Lt.test(rr)?rr:Ht.resolveUrl(rr,or)},resolveUrl(rr,or){if(void 0===Ht.__workingURL){Ht.__workingURL=!1;try{const lr=new URL('b','http://a');lr.pathname='c%20d',Ht.__workingURL='http://a/c%20d'===lr.href}catch(lr){}}if(Ht.__workingURL)return new URL(rr,or).href;let nr=Ht.__tempDoc;return nr||(nr=document.implementation.createHTMLDocument('temp'),Ht.__tempDoc=nr,nr.__base=nr.createElement('base'),nr.head.appendChild(nr.__base),nr.__anchor=nr.createElement('a')),nr.__base.href=or,nr.__anchor.href=rr,nr.__anchor.href||rr}},Ft={async:!0,load(rr,or,nr){if(!rr)nr('error: href must be specified');else if(rr.match(/^data:/)){const lr=rr.split(','),sr=lr[0];let ar=lr[1];ar=-1{let sr=lr.getResponseHeader('Location');if(sr&&0===sr.indexOf('/')){const ir=location.origin||location.protocol+'//'+location.host;sr=ir+sr}const ar=lr.response||lr.responseText;304===lr.status||0===lr.status||200<=lr.status&&300>lr.status?or(ar,sr):nr(ar)},lr.send()}}},Ut=/Trident/.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent),jt='link[rel=import]',qt='import-disable',Bt=`link[rel=stylesheet][href][type=${qt}]`,Kt=`${jt}, ${Bt}, style:not([type]), link[rel=stylesheet][href]:not([type]), script:not([type]), script[type="application/javascript"], - script[type="text/javascript"]`,Wt='import-dependency',Vt=`${qt}:not(${Wt})`,Gt=`script[${Wt}]`,Yt=`style[${Wt}], - link[rel=stylesheet][${Wt}]`,zt=Symbol('loaded'),$t=Symbol('importDoc');const Zt=lr=>{return lr.nodeType===Node.ELEMENT_NODE&&'link'===lr.localName&&'import'===lr.rel},Qt=(lr,sr)=>{if(lr[zt])sr&&sr();else if('script'===lr.localName&&!lr.src)lr[zt]=!0,sr&&sr();else{const ar=ir=>{lr.removeEventListener(ir.type,ar),lr[zt]=!0,sr&&sr()};lr.addEventListener('load',ar),jt&&'style'===lr.localName||lr.addEventListener('error',ar)}},er=lr=>{tr(()=>rr(()=>lr&&lr()))},tr=lr=>{if('loading'!==document.readyState)lr();else{const sr=()=>{'loading'!==document.readyState&&(document.removeEventListener('readystatechange',sr),lr())};document.addEventListener('readystatechange',sr)}},rr=lr=>{let sr=document.querySelectorAll(Vt),ar=sr.length;if(!ar)return void lr();for(let dr,ir=0,pr=sr.length;ir{0==--ar&&lr()})},or=lr=>{if(Pt)return lr.ownerDocument===document?null:lr.ownerDocument;let sr=lr[$t];if(!sr&&lr.parentNode){if(sr=lr.parentNode,'function'==typeof sr.closest)sr=sr.closest(qt);else for(;!Zt(sr)&&(sr=sr.parentNode););lr[$t]=sr}return sr},nr=(lr,sr)=>{if('function'==typeof window.CustomEvent)return new CustomEvent(lr,sr);const ar=document.createEvent('CustomEvent');return ar.initCustomEvent(lr,!!sr.bubbles,!!sr.cancelable,sr.detail),ar};if(Pt){const lr=document.querySelectorAll(qt);for(let pr,ar=0,ir=lr.length;ar{const ir=ar.target;Zt(ir)&&(ir[zt]=!0)};document.addEventListener('load',sr,!0),document.addEventListener('error',sr,!0)}else new class{constructor(){this.documents={},this.inflight=0,this.dynamicImportsMO=new MutationObserver(lr=>this.handleMutations(lr)),tr(()=>{this.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0}),this.loadImports(document)})}loadImports(lr){const sr=lr.querySelectorAll(qt);for(let ar=0,ir=sr.length;ar{const pr=this.makeDocument(ar,ir||sr);this.documents[sr]=pr,this.inflight--,this.loadImports(pr)},()=>{this.documents[sr]=null,this.inflight--,this.processImportsIfLoadingDone()})}makeDocument(lr,sr){if(!lr)return document.createDocumentFragment();jt&&(lr=lr.replace(Ht,(mr,ur,yr)=>{return-1===mr.indexOf('type=')?`${ur} type=${Bt} ${yr}`:mr}));let ar;const ir=document.createElement('template');if(ir.innerHTML=lr,ir.content)ar=ir.content;else for(ar=document.createDocumentFragment();ir.firstChild;)ar.appendChild(ir.firstChild);const pr=ar.querySelector('base');pr&&(sr=Ut.replaceAttrUrl(pr.getAttribute('href'),sr),pr.removeAttribute('href'));const dr=ar.querySelectorAll(Xt);let cr=0;for(let yr,mr=0,ur=dr.length;mr{sr&&lr&&(this.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0}),this.fireEvents())};this.waitForStyles(()=>{sr=!0,ar()}),this.runScripts(()=>{lr=!0,ar()})}}flatten(lr){const sr=lr.querySelectorAll(qt);for(let pr,ar=0,ir=sr.length;arpr.href,configurable:!0,enumerable:!0}),this.flatten(dr),pr.appendChild(dr))}}runScripts(lr){const sr=document.querySelectorAll(Gt),ar=sr.length,ir=pr=>{if(pr{Lt=null,ir(pr+1)})}else lr()};ir(0)}waitForStyles(lr){const sr=document.querySelectorAll(Yt);let ar=sr.length;if(!ar)return void lr();const ir=jt&&!!document.querySelector(Kt);for(let cr,pr=0,dr=sr.length;pr{cr.removeAttribute(Wt),0==--ar&&lr()}),ir&&cr.parentNode!==document.head){const mr=document.createElement(cr.localName);mr.__appliedElement=cr,mr.setAttribute('type','import-placeholder'),cr.parentNode.insertBefore(mr,cr.nextSibling);let ur=or(cr);for(;ur&&or(ur);)ur=or(ur);ur.parentNode!==document.head&&(ur=null),document.head.insertBefore(cr,ur),cr.removeAttribute('type')}}fireEvents(){const lr=document.querySelectorAll(qt);for(let ar,sr=lr.length-1;0<=sr&&(ar=lr[sr]);sr--)this.fireEventIfNeeded(ar)}fireEventIfNeeded(lr){if(!lr[zt]){lr[zt]=!0,lr.import&&(lr.import.readyState='complete');const sr=lr.import?'load':'error';lr.dispatchEvent(nr(sr,{bubbles:!1,cancelable:!1,detail:void 0}))}}handleMutations(lr){for(let sr=0;srdocument.dispatchEvent(nr('HTMLImportsLoaded',{cancelable:!0,bubbles:!0,detail:void 0}))),Ot.useNative=Pt,Ot.whenReady=er,Ot.importForElement=or})(window.HTMLImports=window.HTMLImports||{}),function(){'use strict';function Ot(Dr){var Hr=or.has(Dr);return Dr=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(Dr),!Hr&&Dr}function Pt(Dr){var Hr=Dr.isConnected;if(void 0!==Hr)return Hr;for(;Dr&&!(Dr.__CE_isImportDocument||Dr instanceof Document);)Dr=Dr.parentNode||(window.ShadowRoot&&Dr instanceof ShadowRoot?Dr.host:void 0);return Dr&&(Dr.__CE_isImportDocument||Dr instanceof Document)}function Lt(Dr,Hr){for(;Hr&&Hr!==Dr&&!Hr.nextSibling;)Hr=Hr.parentNode;return Hr&&Hr!==Dr?Hr.nextSibling:null}function wt(Dr,Hr,Ur){Ur=Ur?Ur:new Set;for(var Fr=Dr;Fr;){if(Fr.nodeType===Node.ELEMENT_NODE){var jr=Fr;Hr(jr);var qr=jr.localName;if('link'===qr&&'import'===jr.getAttribute('rel')){if(Fr=jr.import,Fr instanceof Node&&!Ur.has(Fr))for(Ur.add(Fr),Fr=Fr.firstChild;Fr;Fr=Fr.nextSibling)wt(Fr,Hr,Ur);Fr=Lt(Dr,jr);continue}else if('template'===qr){Fr=Lt(Dr,jr);continue}if(jr=jr.__CE_shadowRoot)for(jr=jr.firstChild;jr;jr=jr.nextSibling)wt(jr,Hr,Ur)}Fr=Fr.firstChild?Fr.firstChild:Lt(Dr,Fr)}}function kt(Dr,Hr,Ur){Dr[Hr]=Ur}function Dt(){this.a=new Map,this.f=new Map,this.c=[],this.b=!1}function Ht(Dr,Hr,Ur){Dr.a.set(Hr,Ur),Dr.f.set(Ur.constructor,Ur)}function Ut(Dr,Hr){Dr.b=!0,Dr.c.push(Hr)}function Ft(Dr,Hr){Dr.b&&wt(Hr,function(Ur){return jt(Dr,Ur)})}function jt(Dr,Hr){if(Dr.b&&!Hr.__CE_patched){Hr.__CE_patched=!0;for(var Ur=0;Ur+~])'};const He='style-scope';class Ue{get SCOPE_NAME(){return He}dom(Ot,Pt,Lt){Ot.__styleScoped?Ot.__styleScoped=null:this._transformDom(Ot,Pt||'',Lt)}_transformDom(Ot,Pt,Lt){Ot.nodeType===Node.ELEMENT_NODE&&this.element(Ot,Pt,Lt);let wt='template'===Ot.localName?(Ot.content||Ot._content).childNodes:Ot.children||Ot.childNodes;if(wt)for(let kt=0;kt`:${Dt}(${Ht.replace(/\s/g,'')})`),Ot=Ot.replace(Ge,`${Xe} $1`),Ot=Ot.replace(Be,(kt,Dt,Ht)=>{if(!wt){let Ut=this._transformCompoundSelector(Ht,Dt,Pt,Lt);wt=wt||Ut.stop,Dt=Ut.combinator,Ht=Ut.value}return Dt+Ht}),Ot}_transformCompoundSelector(Ot,Pt,Lt,wt){let kt=Ot.indexOf(Ve);0<=Ot.indexOf(Xe)?Ot=this._transformHostSelector(Ot,wt):0!==kt&&(Ot=Lt?this._transformSimpleSelector(Ot,Lt):Ot);let Dt=!1;0<=kt&&(Pt='',Dt=!0);let Ht;return Dt&&(Ht=!0,Dt&&(Ot=Ot.replace(ze,(Ut,Ft)=>` > ${Ft}`))),Ot=Ot.replace($e,(Ut,Ft,jt)=>`[dir="${jt}"] ${Ft}, ${Ft}[dir="${jt}"]`),{value:Ot,combinator:Pt,stop:Ht}}_transformSimpleSelector(Ot,Pt){let Lt=Ot.split(Ze);return Lt[0]+=Pt,Lt.join(Ze)}_transformHostSelector(Ot,Pt){let Lt=Ot.match(Ye),wt=Lt&&Lt[2].trim()||'';if(wt){if(!wt[0].match(Ke)){let kt=wt.split(Ke)[0];return kt===Pt?wt:'should_not_match'}return Ot.replace(Ye,function(kt,Dt,Ht){return Pt+Ht})}return Ot.replace(Xe,Pt)}documentRule(Ot){Ot.selector=Ot.parsedSelector,this.normalizeRootSelector(Ot),this._transformRule(Ot,this._transformDocumentSelector)}normalizeRootSelector(Ot){Ot.selector===':root'&&(Ot.selector='html')}_transformDocumentSelector(Ot){return Ot.match(Ve)?this._transformComplexSelector(Ot,je):this._transformSimpleSelector(Ot.trim(),je)}}let Fe=/:(nth[-\w]+)\(([^)]+)\)/,je=`:not(.${He})`,qe=',',Be=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=\[])+)/g,Ke=/[[.:#*]/,Xe=':host',Ve='::slotted',Ge=/^(::slotted)/,Ye=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,ze=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,$e=/(.*):dir\((?:(ltr|rtl))\)/,Ze=':';var tt=new Ue,rt={};const ot=Promise.resolve();class nt{static get(Ot){return Ot.__styleInfo}static set(Ot,Pt){return Ot.__styleInfo=Pt,Pt}static invalidate(Ot){rt[Ot]&&(rt[Ot]._applyShimInvalid=!0)}static startValidating(Ot){const Pt=rt[Ot];Pt._validating||(Pt._validating=!0,ot.then(()=>{Pt._applyShimInvalid=!1,Pt._validating=!1}))}constructor(Ot,Pt,Lt,wt,kt,Dt){this.styleRules=Ot||null,this.placeholder=Pt||null,this.ownStylePropertyNames=Lt||[],this.overrideStyleProperties=null,this.elementName=wt||'',this.cssBuild=Dt||'',this.typeExtension=kt||'',this.styleProperties=null,this.scopeSelector=null,this.customStyle=null}}const lt=window.Element.prototype,st=lt.matches||lt.matchesSelector||lt.mozMatchesSelector||lt.msMatchesSelector||lt.oMatchesSelector||lt.webkitMatchesSelector,it=navigator.userAgent.match('Trident'),pt='x-scope';class dt{get XSCOPE_NAME(){return pt}decorateStyles(Ot){let Pt=this,Lt={},wt=[],kt=0;ye(Ot,function(Ht){Pt.decorateRule(Ht),Ht.index=kt++,Pt.collectPropertiesInCssText(Ht.propertyInfo.cssText,Lt)},function(Ut){wt.push(Ut)}),Ot._keyframes=wt;let Dt=[];for(let Ht in Lt)Dt.push(Ht);return Dt}decorateRule(Ot){if(Ot.propertyInfo)return Ot.propertyInfo;let Pt={},Lt={},wt=this.collectProperties(Ot,Lt);return wt&&(Pt.properties=Lt,Ot.rules=null),Pt.cssText=this.collectCssText(Ot),Ot.propertyInfo=Pt,Pt}collectProperties(Ot,Pt){let Lt=Ot.propertyInfo;if(!Lt){let wt,kt=De.VAR_ASSIGN,Dt=Ot.parsedCssText,Ht,Ut;for(;wt=kt.exec(Dt);)Ht=(wt[2]||wt[3]).trim(),('inherit'!==Ht||'unset'!==Ht)&&(Pt[wt[1].trim()]=Ht),Ut=!0;return Ut}else if(Lt.properties)return Object.assign(Pt,Lt.properties),!0}collectCssText(Ot){return this.collectConsumingCssText(Ot.parsedCssText)}collectConsumingCssText(Ot){return Ot.replace(De.BRACKETED,'').replace(De.VAR_ASSIGN,'')}collectPropertiesInCssText(Ot,Pt){for(let Lt,wt;Lt=De.VAR_CONSUMED.exec(Ot);)wt=Lt[1],':'!==Lt[2]&&(Pt[wt]=!0)}reify(Ot){let Pt=Object.getOwnPropertyNames(Ot);for(let wt,Lt=0;Lt *'===Dt||'html'===Dt,Ut=0===Dt.indexOf(':host')&&!Ht;if('shady'===Lt&&(Ht=Dt===kt+' > *.'+kt||-1!==Dt.indexOf('html'),Ut=!Ht&&0===Dt.indexOf(kt)),'shadow'===Lt&&(Ht=':host > *'===Dt||'html'===Dt,Ut=Ut&&!Ht),Ht||Ut){let Ft=kt;Ut&&(Pe&&!Pt.transformedSelector&&(Pt.transformedSelector=tt._transformRuleCss(Pt,tt._transformComplexSelector,tt._calcElementScope(Ot.is),kt)),Ft=Pt.transformedSelector||kt),wt({selector:Ft,isHost:Ut,isRoot:Ht})}}}hostAndRootPropertiesForScope(Ot,Pt){let Lt={},wt={},kt=this,Dt=Pt&&Pt.__cssBuild;return ye(Pt,function(Ht){kt.whenHostOrRootRule(Ot,Ht,Dt,function(Ut){let Ft=Ot._element||Ot;st.call(Ft,Ut.selector)&&(Ut.isHost?kt.collectProperties(Ht,Lt):kt.collectProperties(Ht,wt))})},null,!0),{rootProps:wt,hostProps:Lt}}transformStyles(Ot,Pt,Lt){let wt=this,kt=tt._calcHostScope(Ot.is,Ot.extends),Dt=Ot.extends?'\\'+kt.slice(0,-1)+'\\]':kt,Ht=new RegExp(De.HOST_PREFIX+Dt+De.HOST_SUFFIX),Ut=nt.get(Ot).styleRules,Ft=this._elementKeyframeTransforms(Ot,Ut,Lt);return tt.elementStyles(Ot,Ut,function(jt){wt.applyProperties(jt,Pt),Pe||ue(jt)||!jt.cssText||(wt.applyKeyframeTransforms(jt,Ft),wt._scopeSelector(jt,Ht,kt,Lt))})}_elementKeyframeTransforms(Ot,Pt,Lt){let wt=Pt._keyframes,kt={};if(!Pe&&wt)for(let Dt=0,Ht=wt[Dt];Dt=Ht._useCount&&Ht.parentNode&&Ht.parentNode.removeChild(Ht)),Pe?Dt.customStyle?(Dt.customStyle.textContent=kt,wt=Dt.customStyle):kt&&(wt=he(kt,Lt,Ot.shadowRoot,Dt.placeholder)):wt?!wt.parentNode&&fe(wt,null,Dt.placeholder):kt&&(wt=he(kt,Lt,null,Dt.placeholder)),wt&&(wt._useCount=wt._useCount||0,Dt.customStyle!=wt&&wt._useCount++,Dt.customStyle=wt),it&&(wt.textContent=wt.textContent),wt}applyCustomStyle(Ot,Pt){let Lt=me(Ot),wt=this;Ot.textContent=de(Lt,function(kt){let Dt=kt.cssText=kt.parsedCssText;kt.propertyInfo&&kt.propertyInfo.cssText&&(Dt=se(Dt),kt.cssText=wt.valueForProperties(Dt,Pt))})}}var ct=new dt;let mt={};const ut=window.customElements;if(ut&&!Pe){const Ot=ut.define;ut.define=function(Pt,Lt,wt){return mt[Pt]=ge(Pt),Ot.call(ut,Pt,Lt,wt)}}let ht=De.MIXIN_MATCH,ft=De.VAR_ASSIGN,_t=/;\s*/m,gt=/^\s*(initial)|(inherit)\s*$/,St='_-_';class Ct{constructor(){this._map={}}set(Ot,Pt){Ot=Ot.trim(),this._map[Ot]={properties:Pt,dependants:{}}}get(Ot){return Ot=Ot.trim(),this._map[Ot]}}class bt{constructor(){this._currentTemplate=null,this._measureElement=null,this._map=new Ct,this._separator=St,this._boundProduceCssProperties=(Ot,Pt,Lt,wt)=>this._produceCssProperties(Ot,Pt,Lt,wt)}detectMixin(Ot){const Pt=ht.test(Ot)||ft.test(Ot);return ht.lastIndex=0,ft.lastIndex=0,Pt}transformStyle(Ot,Pt){let Lt=me(Ot);return this.transformRules(Lt,Pt),Lt}transformRules(Ot,Pt){this._currentTemplate=rt[Pt],ye(Ot,Lt=>{this.transformRule(Lt)}),this._currentTemplate=null}transformRule(Ot){Ot.cssText=this.transformCssText(Ot.parsedCssText),':root'===Ot.selector&&(Ot.selector=':host > *')}transformCssText(Ot){return Ot=Ot.replace(ft,this._boundProduceCssProperties),this._consumeCssProperties(Ot)}_getInitialValueForProperty(Ot){return this._measureElement||(this._measureElement=document.createElement('meta'),this._measureElement.style.all='initial',document.head.appendChild(this._measureElement)),window.getComputedStyle(this._measureElement).getPropertyValue(Ot)}_consumeCssProperties(Ot){for(let Pt;Pt=ht.exec(Ot);){let Lt=Pt[0],wt=Pt[1],kt=Pt.index,Dt=kt+Lt.indexOf('@apply'),Ht=kt+Lt.length,Ut=Ot.slice(0,Dt),Ft=Ot.slice(Ht),jt=this._cssTextToMap(Ut),qt=this._atApplyToCssProperties(wt,jt);Ot=[Ut,qt,Ft].join(''),ht.lastIndex=kt+qt.length}return Ot}_atApplyToCssProperties(Ot,Pt){Ot=Ot.replace(_t,'');let Lt=[],wt=this._map.get(Ot);if(wt||(this._map.set(Ot,{}),wt=this._map.get(Ot)),wt){this._currentTemplate&&(wt.dependants[this._currentTemplate.name]=this._currentTemplate);let kt,Dt,Ht;for(kt in wt.properties)Ht=Pt&&Pt[kt],Dt=[kt,': var(',Ot,St,kt],Ht&&Dt.push(',',Ht),Dt.push(')'),Lt.push(Dt.join(''))}return Lt.join('; ')}_replaceInitialOrInherit(Ot,Pt){let Lt=gt.exec(Pt);return Lt&&(Lt[1]?Pt=bt._getInitialValueForProperty(Ot):Pt='apply-shim-inherit'),Pt}_cssTextToMap(Ot){let Pt=Ot.split(';'),Lt,wt,kt={};for(let Ht,Ut,Dt=0;Dt{Vt&&this._map.get(Vt)&&(wt='@apply '+Vt+';')}),!wt)return Ot;let kt=this._consumeCssProperties(wt),Dt=Ot.slice(0,Ot.indexOf('--')),Ht=this._cssTextToMap(kt),Ut=Ht,Ft=this._map.get(Pt),jt=Ft&&Ft.properties;jt?Ut=Object.assign(Object.create(jt),Ht):this._map.set(Pt,Ut);let Bt,Kt,qt=[],Xt=!1;for(Bt in Ut)Kt=Ht[Bt],void 0==Kt&&(Kt='initial'),jt&&!(Bt in jt)&&(Xt=!0),qt.push(Pt+St+Bt+': '+Kt);return Xt&&this._invalidateMixinEntry(Ft),Ft&&(Ft.properties=Ut),Lt&&(Dt=Ot+';'+Dt),Dt+qt.join('; ')+';'}}let Et=new bt;window.ApplyShim=Et;let Nt=function(){};if(!Pe){let Ot=Dt=>{return Dt.classList&&!Dt.classList.contains(tt.SCOPE_NAME)||Dt instanceof SVGElement&&(!Dt.hasAttribute('class')||0>Dt.getAttribute('class').indexOf(tt.SCOPE_NAME))},Pt=Dt=>{for(let Ut,Ht=0;Ht{Lt.observe(Dt,{childList:!0,subtree:!0})},kt=window.customElements&&!window.customElements.flush;if(kt)wt(document);else{let Dt=()=>{wt(document.body)};window.HTMLImports?window.HTMLImports.whenReady(Dt):requestAnimationFrame(function(){if('loading'===document.readyState){let Ht=function(){Dt(),document.removeEventListener('readystatechange',Ht)};document.addEventListener('readystatechange',Ht)}else Dt()})}Nt=function(){Pt(Lt.takeRecords())}}let At=new class{constructor(Ot=100){this.cache={},this.typeMax=Ot}_validate(Ot,Pt,Lt){for(let kt,wt=0;wtthis.typeMax&&kt.shift(),this.cache[Ot]=kt}fetch(Ot,Pt,Lt){let wt=this.cache[Ot];if(wt)for(let Dt,kt=wt.length-1;0<=kt;kt--)if(Dt=wt[kt],this._validate(Dt,Pt,Lt))return Dt}};class vt{constructor(){this._scopeCounter={},this._documentOwner=document.documentElement,this._documentOwnerStyleInfo=nt.set(document.documentElement,new nt({rules:[]})),this._elementsHaveApplied=!1}get nativeShadow(){return Pe}get nativeCss(){return Le}get nativeCssApply(){return!1}flush(){Nt()}_generateScopeSelector(Ot){let Pt=this._scopeCounter[Ot]=(this._scopeCounter[Ot]||0)+1;return`${Ot}-${Pt}`}getStyleAst(Ot){return me(Ot)}styleAstToString(Ot){return de(Ot)}_gatherStyles(Ot){let Pt=Ot.content.querySelectorAll('style'),Lt=[];for(let kt,wt=0;wt{Pe?tt.normalizeRootSelector(Lt):tt.documentRule(Lt),this.nativeCss&&!this.nativeCssApply&&Et.transformRule(Lt)}),this.nativeCss?Ot.textContent=de(Pt):this._documentOwnerStyleInfo.styleRules.rules.push(Pt)}_revalidateApplyShim(Ot){if(this.nativeCss&&!this.nativeCssApply){let Pt=me(Ot);Et.transformRules(Pt),Ot.textContent=de(Pt)}}_applyCustomStyleToDocument(Ot){this.nativeCss||ct.applyCustomStyle(Ot,this._documentOwnerStyleInfo.styleProperties)}getComputedStyleValue(Ot,Pt){let Lt;if(!this.nativeCss){let wt=nt.get(Ot)||nt.get(this._styleOwnerForNode(Ot));Lt=wt.styleProperties[Pt]}return Lt=Lt||window.getComputedStyle(Ot).getPropertyValue(Pt),Lt.trim()}setElementClass(Ot,Pt){let Lt=Ot.getRootNode(),wt=Pt?Pt.split(/\s/):[],kt=Lt.host&&Lt.host.localName;if(!kt){var Dt=Ot.getAttribute('class');if(Dt){let Ht=Dt.split(/\s/);for(let Ut=0;Ut{return rr.nodeType===Node.ELEMENT_NODE&&'link'===rr.localName&&'import'===rr.rel},$t=(rr,or)=>{if(rr.__loaded)or&&or();else if('script'===rr.localName&&!rr.src)rr.__loaded=!0,or&&or();else{const nr=lr=>{rr.removeEventListener(lr.type,nr),rr.__loaded=!0,or&&or()};rr.addEventListener('load',nr),Ut&&'style'===rr.localName||rr.addEventListener('error',nr)}},Zt=rr=>{Qt(()=>Jt(()=>rr&&rr()))},Qt=rr=>{if('loading'!==document.readyState)rr();else{const or=()=>{'loading'!==document.readyState&&(document.removeEventListener('readystatechange',or),rr())};document.addEventListener('readystatechange',or)}},Jt=rr=>{let or=document.querySelectorAll(Wt),nr=or.length;if(!nr)return void rr();for(let ar,lr=0,sr=or.length;lr{0==--nr&&rr()})},er=rr=>{if(Ot)return rr.ownerDocument===document?null:rr.ownerDocument;let or=rr.__importDoc;if(!or&&rr.parentNode){if(or=rr.parentNode,'function'==typeof or.closest)or=or.closest(jt);else for(;!zt(or)&&(or=or.parentNode););rr.__importDoc=or}return or},tr=(rr,or)=>{if('function'==typeof window.CustomEvent)return new CustomEvent(rr,or);const nr=document.createEvent('CustomEvent');return nr.initCustomEvent(rr,!!or.bubbles,!!or.cancelable,or.detail),nr};if(Ot){const rr=document.querySelectorAll(jt);for(let sr,nr=0,lr=rr.length;nr{const lr=nr.target;zt(lr)&&(lr.__loaded=!0)};document.addEventListener('load',or,!0),document.addEventListener('error',or,!0)}else new class{constructor(){this.documents={},this.inflight=0,this.dynamicImportsMO=new MutationObserver(rr=>this.handleMutations(rr)),Qt(()=>{this.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0}),this.loadImports(document)})}loadImports(rr){const or=rr.querySelectorAll(jt);for(let nr=0,lr=or.length;nr{const sr=this.makeDocument(nr,lr||or);this.documents[or]=sr,this.inflight--,this.loadImports(sr)},()=>{this.documents[or]=null,this.inflight--,this.processImportsIfLoadingDone()})}makeDocument(rr,or){if(!rr)return document.createDocumentFragment();Ut&&(rr=rr.replace(Dt,(pr,dr,cr)=>{return-1===pr.indexOf('type=')?`${dr} type=${qt} ${cr}`:pr}));let nr;const lr=document.createElement('template');if(lr.innerHTML=rr,lr.content)nr=lr.content;else for(nr=document.createDocumentFragment();lr.firstChild;)nr.appendChild(lr.firstChild);const sr=nr.querySelector('base');sr&&(or=Ht.replaceAttrUrl(sr.getAttribute('href'),or),sr.removeAttribute('href'));const ar=nr.querySelectorAll(Kt);let ir=0;for(let cr,pr=0,dr=ar.length;pr{or&&rr&&(this.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0}),this.fireEvents())};this.waitForStyles(()=>{or=!0,nr()}),this.runScripts(()=>{rr=!0,nr()})}}flatten(rr){const or=rr.querySelectorAll(jt);for(let sr,nr=0,lr=or.length;nrsr.href,configurable:!0,enumerable:!0}),this.flatten(ar),sr.appendChild(ar))}}runScripts(rr){const or=document.querySelectorAll(Vt),nr=or.length,lr=sr=>{if(sr{Pt=null,lr(sr+1)})}else rr()};lr(0)}waitForStyles(rr){const or=document.querySelectorAll(Gt);let nr=or.length;if(!nr)return void rr();const lr=Ut&&!!document.querySelector(Bt);for(let ir,sr=0,ar=or.length;sr{ir.removeAttribute(Xt),0==--nr&&rr()}),lr&&ir.parentNode!==document.head){const pr=document.createElement(ir.localName);pr.__appliedElement=ir,pr.setAttribute('type','import-placeholder'),ir.parentNode.insertBefore(pr,ir.nextSibling);let dr=er(ir);for(;dr&&er(dr);)dr=er(dr);dr.parentNode!==document.head&&(dr=null),document.head.insertBefore(ir,dr),ir.removeAttribute('type')}}fireEvents(){const rr=document.querySelectorAll(jt);for(let nr,or=rr.length-1;0<=or&&(nr=rr[or]);or--)this.fireEventIfNeeded(nr)}fireEventIfNeeded(rr){if(!rr.__loaded){rr.__loaded=!0,rr.import&&(rr.import.readyState='complete');const or=rr.import?'load':'error';rr.dispatchEvent(tr(or,{bubbles:!1,cancelable:!1,detail:void 0}))}}handleMutations(rr){for(let or=0;ordocument.dispatchEvent(tr('HTMLImportsLoaded',{cancelable:!0,bubbles:!0,detail:void 0}))),Mt.useNative=Ot,Mt.whenReady=Zt,Mt.importForElement=er})(window.HTMLImports=window.HTMLImports||{}),function(){'use strict';function Mt(kr){var Dr=rr.has(kr);return kr=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(kr),!Dr&&kr}function Ot(kr){var Dr=kr.isConnected;if(void 0!==Dr)return Dr;for(;kr&&!(kr.__CE_isImportDocument||kr instanceof Document);)kr=kr.parentNode||(window.ShadowRoot&&kr instanceof ShadowRoot?kr.host:void 0);return kr&&(kr.__CE_isImportDocument||kr instanceof Document)}function Pt(kr,Dr){for(;Dr&&Dr!==kr&&!Dr.nextSibling;)Dr=Dr.parentNode;return Dr&&Dr!==kr?Dr.nextSibling:null}function Lt(kr,Dr,Hr){Hr=Hr?Hr:new Set;for(var Fr=kr;Fr;){if(Fr.nodeType===Node.ELEMENT_NODE){var Ur=Fr;Dr(Ur);var jr=Ur.localName;if('link'===jr&&'import'===Ur.getAttribute('rel')){if(Fr=Ur.import,Fr instanceof Node&&!Hr.has(Fr))for(Hr.add(Fr),Fr=Fr.firstChild;Fr;Fr=Fr.nextSibling)Lt(Fr,Dr,Hr);Fr=Pt(kr,Ur);continue}else if('template'===jr){Fr=Pt(kr,Ur);continue}if(Ur=Ur.__CE_shadowRoot)for(Ur=Ur.firstChild;Ur;Ur=Ur.nextSibling)Lt(Ur,Dr,Hr)}Fr=Fr.firstChild?Fr.firstChild:Pt(kr,Fr)}}function wt(kr,Dr,Hr){kr[Dr]=Hr}function kt(){this.a=new Map,this.f=new Map,this.c=[],this.b=!1}function Dt(kr,Dr,Hr){kr.a.set(Dr,Hr),kr.f.set(Hr.constructor,Hr)}function Ht(kr,Dr){kr.b=!0,kr.c.push(Dr)}function Ft(kr,Dr){kr.b&&Lt(Dr,function(Hr){return Ut(kr,Hr)})}function Ut(kr,Dr){if(kr.b&&!Dr.__CE_patched){Dr.__CE_patched=!0;for(var Hr=0;Hr+~])'};const He='style-scope';class Fe{get SCOPE_NAME(){return He}dom(Mt,Ot,Pt){Mt.__styleScoped?Mt.__styleScoped=null:this._transformDom(Mt,Ot||'',Pt)}_transformDom(Mt,Ot,Pt){Mt.nodeType===Node.ELEMENT_NODE&&this.element(Mt,Ot,Pt);let Lt='template'===Mt.localName?(Mt.content||Mt._content).childNodes:Mt.children||Mt.childNodes;if(Lt)for(let wt=0;wt`:${kt}(${Dt.replace(/\s/g,'')})`),Mt=Mt.replace(Ge,`${Xe} $1`),Mt=Mt.replace(Be,(wt,kt,Dt)=>{if(!Lt){let Ht=this._transformCompoundSelector(Dt,kt,Ot,Pt);Lt=Lt||Ht.stop,kt=Ht.combinator,Dt=Ht.value}return kt+Dt}),Mt}_transformCompoundSelector(Mt,Ot,Pt,Lt){let wt=Mt.indexOf(Ve);0<=Mt.indexOf(Xe)?Mt=this._transformHostSelector(Mt,Lt):0!==wt&&(Mt=Pt?this._transformSimpleSelector(Mt,Pt):Mt);let kt=!1;0<=wt&&(Ot='',kt=!0);let Dt;return kt&&(Dt=!0,kt&&(Mt=Mt.replace(ze,(Ht,Ft)=>` > ${Ft}`))),Mt=Mt.replace($e,(Ht,Ft,Ut)=>`[dir="${Ut}"] ${Ft}, ${Ft}[dir="${Ut}"]`),{value:Mt,combinator:Ot,stop:Dt}}_transformSimpleSelector(Mt,Ot){let Pt=Mt.split(Qe);return Pt[0]+=Ot,Pt.join(Qe)}_transformHostSelector(Mt,Ot){let Pt=Mt.match(Ye),Lt=Pt&&Pt[2].trim()||'';if(Lt){if(!Lt[0].match(Ke)){let wt=Lt.split(Ke)[0];return wt===Ot?Lt:'should_not_match'}return Mt.replace(Ye,function(wt,kt,Dt){return Ot+Dt})}return Mt.replace(Xe,Ot)}documentRule(Mt){Mt.selector=Mt.parsedSelector,this.normalizeRootSelector(Mt),this._transformRule(Mt,this._transformDocumentSelector)}normalizeRootSelector(Mt){Mt.selector===':root'&&(Mt.selector='html')}_transformDocumentSelector(Mt){return Mt.match(Ve)?this._transformComplexSelector(Mt,je):this._transformSimpleSelector(Mt.trim(),je)}}let Ue=/:(nth[-\w]+)\(([^)]+)\)/,je=`:not(.${He})`,qe=',',Be=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=\[])+)/g,Ke=/[[.:#*]/,Xe=':host',Ve='::slotted',Ge=/^(::slotted)/,Ye=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,ze=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,$e=/(.*):dir\((?:(ltr|rtl))\)/,Qe=':';var tt=new Fe,rt={};const ot=Promise.resolve();class nt{static get(Mt){return Mt.__styleInfo}static set(Mt,Ot){return Mt.__styleInfo=Ot,Ot}static invalidate(Mt){rt[Mt]&&(rt[Mt]._applyShimInvalid=!0)}static startValidating(Mt){const Ot=rt[Mt];Ot._validating||(Ot._validating=!0,ot.then(()=>{Ot._applyShimInvalid=!1,Ot._validating=!1}))}constructor(Mt,Ot,Pt,Lt,wt,kt){this.styleRules=Mt||null,this.placeholder=Ot||null,this.ownStylePropertyNames=Pt||[],this.overrideStyleProperties=null,this.elementName=Lt||'',this.cssBuild=kt||'',this.typeExtension=wt||'',this.styleProperties=null,this.scopeSelector=null,this.customStyle=null}}const lt=window.Element.prototype,st=lt.matches||lt.matchesSelector||lt.mozMatchesSelector||lt.msMatchesSelector||lt.oMatchesSelector||lt.webkitMatchesSelector,at=navigator.userAgent.match('Trident'),it='x-scope';class pt{get XSCOPE_NAME(){return it}decorateStyles(Mt){let Ot=this,Pt={},Lt=[],wt=0;ye(Mt,function(Dt){Ot.decorateRule(Dt),Dt.index=wt++,Ot.collectPropertiesInCssText(Dt.propertyInfo.cssText,Pt)},function(Ht){Lt.push(Ht)}),Mt._keyframes=Lt;let kt=[];for(let Dt in Pt)kt.push(Dt);return kt}decorateRule(Mt){if(Mt.propertyInfo)return Mt.propertyInfo;let Ot={},Pt={},Lt=this.collectProperties(Mt,Pt);return Lt&&(Ot.properties=Pt,Mt.rules=null),Ot.cssText=this.collectCssText(Mt),Mt.propertyInfo=Ot,Ot}collectProperties(Mt,Ot){let Pt=Mt.propertyInfo;if(!Pt){let Lt,wt=De.VAR_ASSIGN,kt=Mt.parsedCssText,Dt,Ht;for(;Lt=wt.exec(kt);)Dt=(Lt[2]||Lt[3]).trim(),('inherit'!==Dt||'unset'!==Dt)&&(Ot[Lt[1].trim()]=Dt),Ht=!0;return Ht}else if(Pt.properties)return Object.assign(Ot,Pt.properties),!0}collectCssText(Mt){return this.collectConsumingCssText(Mt.parsedCssText)}collectConsumingCssText(Mt){return Mt.replace(De.BRACKETED,'').replace(De.VAR_ASSIGN,'')}collectPropertiesInCssText(Mt,Ot){for(let Pt,Lt;Pt=De.VAR_CONSUMED.exec(Mt);)Lt=Pt[1],':'!==Pt[2]&&(Ot[Lt]=!0)}reify(Mt){let Ot=Object.getOwnPropertyNames(Mt);for(let Lt,Pt=0;Pt *'===kt||'html'===kt,Ht=0===kt.indexOf(':host')&&!Dt;if('shady'===Pt&&(Dt=kt===wt+' > *.'+wt||-1!==kt.indexOf('html'),Ht=!Dt&&0===kt.indexOf(wt)),'shadow'===Pt&&(Dt=':host > *'===kt||'html'===kt,Ht=Ht&&!Dt),Dt||Ht){let Ft=wt;Ht&&(Pe&&!Ot.transformedSelector&&(Ot.transformedSelector=tt._transformRuleCss(Ot,tt._transformComplexSelector,tt._calcElementScope(Mt.is),wt)),Ft=Ot.transformedSelector||wt),Lt({selector:Ft,isHost:Ht,isRoot:Dt})}}}hostAndRootPropertiesForScope(Mt,Ot){let Pt={},Lt={},wt=this,kt=Ot&&Ot.__cssBuild;return ye(Ot,function(Dt){wt.whenHostOrRootRule(Mt,Dt,kt,function(Ht){let Ft=Mt._element||Mt;st.call(Ft,Ht.selector)&&(Ht.isHost?wt.collectProperties(Dt,Pt):wt.collectProperties(Dt,Lt))})},null,!0),{rootProps:Lt,hostProps:Pt}}transformStyles(Mt,Ot,Pt){let Lt=this,wt=tt._calcHostScope(Mt.is,Mt.extends),kt=Mt.extends?'\\'+wt.slice(0,-1)+'\\]':wt,Dt=new RegExp(De.HOST_PREFIX+kt+De.HOST_SUFFIX),Ht=nt.get(Mt).styleRules,Ft=this._elementKeyframeTransforms(Mt,Ht,Pt);return tt.elementStyles(Mt,Ht,function(Ut){Lt.applyProperties(Ut,Ot),Pe||ue(Ut)||!Ut.cssText||(Lt.applyKeyframeTransforms(Ut,Ft),Lt._scopeSelector(Ut,Dt,wt,Pt))})}_elementKeyframeTransforms(Mt,Ot,Pt){let Lt=Ot._keyframes,wt={};if(!Pe&&Lt)for(let kt=0,Dt=Lt[kt];kt=Dt._useCount&&Dt.parentNode&&Dt.parentNode.removeChild(Dt)),Pe?kt.customStyle?(kt.customStyle.textContent=wt,Lt=kt.customStyle):wt&&(Lt=he(wt,Pt,Mt.shadowRoot,kt.placeholder)):Lt?!Lt.parentNode&&_e(Lt,null,kt.placeholder):wt&&(Lt=he(wt,Pt,null,kt.placeholder)),Lt&&(Lt._useCount=Lt._useCount||0,kt.customStyle!=Lt&&Lt._useCount++,kt.customStyle=Lt),at&&(Lt.textContent=Lt.textContent),Lt}applyCustomStyle(Mt,Ot){let Pt=me(Mt),Lt=this;Mt.textContent=de(Pt,function(wt){let kt=wt.cssText=wt.parsedCssText;wt.propertyInfo&&wt.propertyInfo.cssText&&(kt=se(kt),wt.cssText=Lt.valueForProperties(kt,Ot))})}}var dt=new pt;let ct={};const mt=window.customElements;if(mt&&!Pe){const Mt=mt.define;mt.define=function(Ot,Pt,Lt){return ct[Ot]=ge(Ot),Mt.call(mt,Ot,Pt,Lt)}}let yt=De.MIXIN_MATCH,ht=De.VAR_ASSIGN,_t=/;\s*/m,ft=/^\s*(initial)|(inherit)\s*$/,gt='_-_';class St{constructor(){this._map={}}set(Mt,Ot){Mt=Mt.trim(),this._map[Mt]={properties:Ot,dependants:{}}}get(Mt){return Mt=Mt.trim(),this._map[Mt]}}class Ct{constructor(){this._currentTemplate=null,this._measureElement=null,this._map=new St,this._separator=gt,this._boundProduceCssProperties=(Mt,Ot,Pt,Lt)=>this._produceCssProperties(Mt,Ot,Pt,Lt)}detectMixin(Mt){const Ot=yt.test(Mt)||ht.test(Mt);return yt.lastIndex=0,ht.lastIndex=0,Ot}transformStyle(Mt,Ot){let Pt=me(Mt);return this.transformRules(Pt,Ot),Pt}transformRules(Mt,Ot){this._currentTemplate=rt[Ot],ye(Mt,Pt=>{this.transformRule(Pt)}),this._currentTemplate=null}transformRule(Mt){Mt.cssText=this.transformCssText(Mt.parsedCssText),':root'===Mt.selector&&(Mt.selector=':host > *')}transformCssText(Mt){return Mt=Mt.replace(ht,this._boundProduceCssProperties),this._consumeCssProperties(Mt)}_getInitialValueForProperty(Mt){return this._measureElement||(this._measureElement=document.createElement('meta'),this._measureElement.style.all='initial',document.head.appendChild(this._measureElement)),window.getComputedStyle(this._measureElement).getPropertyValue(Mt)}_consumeCssProperties(Mt){for(let Ot;Ot=yt.exec(Mt);){let Pt=Ot[0],Lt=Ot[1],wt=Ot.index,kt=wt+Pt.indexOf('@apply'),Dt=wt+Pt.length,Ht=Mt.slice(0,kt),Ft=Mt.slice(Dt),Ut=this._cssTextToMap(Ht),jt=this._atApplyToCssProperties(Lt,Ut);Mt=[Ht,jt,Ft].join(''),yt.lastIndex=wt+jt.length}return Mt}_atApplyToCssProperties(Mt,Ot){Mt=Mt.replace(_t,'');let Pt=[],Lt=this._map.get(Mt);if(Lt||(this._map.set(Mt,{}),Lt=this._map.get(Mt)),Lt){this._currentTemplate&&(Lt.dependants[this._currentTemplate.name]=this._currentTemplate);let wt,kt,Dt;for(wt in Lt.properties)Dt=Ot&&Ot[wt],kt=[wt,': var(',Mt,gt,wt],Dt&&kt.push(',',Dt),kt.push(')'),Pt.push(kt.join(''))}return Pt.join('; ')}_replaceInitialOrInherit(Mt,Ot){let Pt=ft.exec(Ot);return Pt&&(Pt[1]?Ot=Ct._getInitialValueForProperty(Mt):Ot='apply-shim-inherit'),Ot}_cssTextToMap(Mt){let Ot=Mt.split(';'),Pt,Lt,wt={};for(let Dt,Ht,kt=0;kt{Wt&&this._map.get(Wt)&&(Lt='@apply '+Wt+';')}),!Lt)return Mt;let wt=this._consumeCssProperties(Lt),kt=Mt.slice(0,Mt.indexOf('--')),Dt=this._cssTextToMap(wt),Ht=Dt,Ft=this._map.get(Ot),Ut=Ft&&Ft.properties;Ut?Ht=Object.assign(Object.create(Ut),Dt):this._map.set(Ot,Ht);let qt,Bt,jt=[],Kt=!1;for(qt in Ht)Bt=Dt[qt],void 0==Bt&&(Bt='initial'),Ut&&!(qt in Ut)&&(Kt=!0),jt.push(Ot+gt+qt+': '+Bt);return Kt&&this._invalidateMixinEntry(Ft),Ft&&(Ft.properties=Ht),Pt&&(kt=Mt+';'+kt),kt+jt.join('; ')+';'}}let bt=new Ct;window.ApplyShim=bt;let Et=function(){};if(!Pe){let Mt=kt=>{return kt.classList&&!kt.classList.contains(tt.SCOPE_NAME)||kt instanceof SVGElement&&(!kt.hasAttribute('class')||0>kt.getAttribute('class').indexOf(tt.SCOPE_NAME))},Ot=kt=>{for(let Ht,Dt=0;Dt{Pt.observe(kt,{childList:!0,subtree:!0})},wt=window.customElements&&!window.customElements.flush;if(wt)Lt(document);else{let kt=()=>{Lt(document.body)};window.HTMLImports?window.HTMLImports.whenReady(kt):requestAnimationFrame(function(){if('loading'===document.readyState){let Dt=function(){kt(),document.removeEventListener('readystatechange',Dt)};document.addEventListener('readystatechange',Dt)}else kt()})}Et=function(){Ot(Pt.takeRecords())}}let Nt=new class{constructor(Mt=100){this.cache={},this.typeMax=Mt}_validate(Mt,Ot,Pt){for(let wt,Lt=0;Ltthis.typeMax&&wt.shift(),this.cache[Mt]=wt}fetch(Mt,Ot,Pt){let Lt=this.cache[Mt];if(Lt)for(let kt,wt=Lt.length-1;0<=wt;wt--)if(kt=Lt[wt],this._validate(kt,Ot,Pt))return kt}};class At{constructor(){this._scopeCounter={},this._documentOwner=document.documentElement,this._documentOwnerStyleInfo=nt.set(document.documentElement,new nt({rules:[]})),this._elementsHaveApplied=!1}get nativeShadow(){return Pe}get nativeCss(){return Le}get nativeCssApply(){return!1}flush(){Et()}_generateScopeSelector(Mt){let Ot=this._scopeCounter[Mt]=(this._scopeCounter[Mt]||0)+1;return`${Mt}-${Ot}`}getStyleAst(Mt){return me(Mt)}styleAstToString(Mt){return de(Mt)}_gatherStyles(Mt){let Ot=Mt.content.querySelectorAll('style'),Pt=[];for(let wt,Lt=0;Lt{Pe?tt.normalizeRootSelector(Pt):tt.documentRule(Pt),this.nativeCss&&!this.nativeCssApply&&bt.transformRule(Pt)}),this.nativeCss?Mt.textContent=de(Ot):this._documentOwnerStyleInfo.styleRules.rules.push(Ot)}_revalidateApplyShim(Mt){if(this.nativeCss&&!this.nativeCssApply){let Ot=me(Mt);bt.transformRules(Ot),Mt.textContent=de(Ot)}}_applyCustomStyleToDocument(Mt){this.nativeCss||dt.applyCustomStyle(Mt,this._documentOwnerStyleInfo.styleProperties)}getComputedStyleValue(Mt,Ot){let Pt;if(!this.nativeCss){let Lt=nt.get(Mt)||nt.get(this._styleOwnerForNode(Mt));Pt=Lt.styleProperties[Ot]}return Pt=Pt||window.getComputedStyle(Mt).getPropertyValue(Ot),Pt.trim()}setElementClass(Mt,Ot){let Pt=Mt.getRootNode(),Lt=Ot?Ot.split(/\s/):[],wt=Pt.host&&Pt.host.localName;if(!wt){var kt=Mt.getAttribute('class');if(kt){let Dt=kt.split(/\s/);for(let Ht=0;Ht {\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 /** @type {!Symbol} */\n const loaded = Symbol('loaded');\n\n /** @type {!Symbol} */\n const importDoc = Symbol('importDoc');\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 this.processImportsIfLoadingDone();\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 }, () => {\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 //