forked from RevillWeb/img-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebcomponents-sd-ce.js.map
1 lines (1 loc) · 424 KB
/
webcomponents-sd-ce.js.map
1
{"version":3,"sources":["node_modules/@webcomponents/shadydom/src/shady-data.js"," [synthetic:util/global] "," [synthetic:util/defineproperty] "," [synthetic:es6/symbol] "," [synthetic:es6/util/makeiterator] "," [synthetic:es6/util/arrayfromiterator] ","node_modules/@webcomponents/shadydom/src/utils.js","node_modules/@webcomponents/shadydom/src/flush.js","node_modules/@webcomponents/shadydom/src/observe-changes.js","node_modules/@webcomponents/shadydom/src/native-methods.js","node_modules/@webcomponents/shadydom/src/innerHTML.js","node_modules/@webcomponents/shadydom/src/native-tree-walker.js","node_modules/@webcomponents/shadydom/src/native-tree-accessors.js","node_modules/@webcomponents/shadydom/src/native-tree.js","node_modules/@webcomponents/shadydom/src/patch-accessors.js","node_modules/@webcomponents/shadydom/src/attach-shadow.js","node_modules/@webcomponents/shadydom/src/patch-builtins.js","node_modules/@webcomponents/shadydom/src/logical-tree.js","node_modules/@webcomponents/shadydom/src/logical-mutation.js"," [synthetic:es6/util/arrayfromiterable] ","node_modules/@webcomponents/shadydom/src/patch-events.js","node_modules/@webcomponents/shadydom/src/array-splice.js","node_modules/@webcomponents/shadydom/src/shadydom.js","node_modules/@webcomponents/custom-elements/src/Utilities.js","node_modules/@webcomponents/custom-elements/src/CustomElementInternals.js","node_modules/@webcomponents/custom-elements/src/CustomElementState.js","node_modules/@webcomponents/custom-elements/src/DocumentConstructionObserver.js","node_modules/@webcomponents/custom-elements/src/CustomElementRegistry.js","node_modules/@webcomponents/custom-elements/src/Deferred.js","node_modules/@webcomponents/custom-elements/src/Patch/Native.js","node_modules/@webcomponents/custom-elements/src/AlreadyConstructedMarker.js","node_modules/@webcomponents/custom-elements/src/Patch/HTMLElement.js","node_modules/@webcomponents/custom-elements/src/custom-elements.js","node_modules/@webcomponents/custom-elements/src/Patch/Interface/ParentNode.js","node_modules/@webcomponents/custom-elements/src/Patch/Document.js","node_modules/@webcomponents/custom-elements/src/Patch/Node.js","node_modules/@webcomponents/custom-elements/src/Patch/Interface/ChildNode.js","node_modules/@webcomponents/custom-elements/src/Patch/Element.js","node_modules/@webcomponents/custom-elements/src/Patch/DocumentFragment.js","node_modules/@webcomponents/shadycss/src/css-parse.js","node_modules/@webcomponents/shadycss/src/style-settings.js","node_modules/@webcomponents/shadycss/src/common-regex.js","node_modules/@webcomponents/shadycss/src/unscoped-style-handler.js","node_modules/@webcomponents/shadycss/src/style-util.js","node_modules/@webcomponents/shadycss/src/style-transformer.js","node_modules/@webcomponents/shadycss/src/style-info.js","node_modules/@webcomponents/shadycss/src/style-properties.js","node_modules/@webcomponents/shadycss/src/style-placeholder.js","node_modules/@webcomponents/shadycss/src/style-cache.js","node_modules/@webcomponents/shadycss/src/document-watcher.js","node_modules/@webcomponents/shadycss/src/template-map.js","node_modules/@webcomponents/shadycss/src/apply-shim-utils.js","node_modules/@webcomponents/shadycss/src/document-wait.js","node_modules/@webcomponents/shadycss/src/scoping-shim.js","node_modules/@webcomponents/shadycss/src/common-utils.js","node_modules/@webcomponents/shadycss/entrypoints/scoping-shim.js","entrypoints/webcomponents-sd-ce-index.js"],"names":["$jscomp.global","$jscomp.defineProperty","$jscomp.initSymbol","$jscomp.Symbol","$jscomp.SYMBOL_PREFIX","$jscomp.arrayIterator","$jscomp.initSymbolIterator","$jscomp.iteratorPrototype","constructor","ShadyData","publicRoot","root","dirty","flattenedNodes","_prevAssignedSlot","_previouslyAssignedNodes","assignedSlot","assignedNodes","observer","childNodes","nextSibling","previousSibling","lastChild","firstChild","parentNode","ownerShadyRoot","undefined","__insideAccessors","__outsideAccessors","ensureShadyDataForNode","node","__shady","shadyDataForNode","settings","window","hasNativeShadowDOM","attachShadow","Element","prototype","getRootNode","Node","desc","Object","getOwnPropertyDescriptor","hasDescriptors","configurable","get","inUse","IS_IE","navigator","userAgent","match","IS_EDGE","useNativeAccessors","isTrackingLogicalChildNodes","nodeData","isShadyRoot","obj","_localName","ownerShadyRootForNode","p","matches","matchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector","extend","target","source","n$","getOwnPropertyNames","i","n","length","pd","defineProperty","extendAll","sources","mixin","twiddle","document","createTextNode","content","queue","observe","MutationObserver","shift","e","textContent","characterData","microtask","callback","push","hasDocumentContains","contains","container","flushList","scheduled","enqueue","flush","didFlush","AsyncObserver","_scheduled","addedNodes","removedNodes","callbacks","Set","schedule","mutations","takeRecords","forEach","cb","observeChildren","sd","add","_callback","_observer","_node","unobserveChildren","handle","delete","size","filterMutations","targetRootNode","map","mutation","mutationInScope","nodes","Array","from","filter","create","value","m","insertBefore","replaceChild","removeChild","setAttribute","removeAttribute","cloneNode","importNode","Document","addEventListener","removeEventListener","windowAddEventListener","Window","windowRemoveEventListener","dispatchEvent","HTMLElement","elementQuerySelector","querySelector","fragmentQuerySelector","DocumentFragment","documentQuerySelector","elementQuerySelectorAll","querySelectorAll","fragmentQuerySelectorAll","documentQuerySelectorAll","appendChild","selector","nodeType","ELEMENT_NODE","call","DOCUMENT_NODE","escapeAttrRegExp","escapeDataRegExp","escapeReplace","c","makeSet","arr","set","voidElements","plaintextParents","getInnerHTML","localName","s","c$","l","child","tagName","attrs","attributes","attr","name","replace","TEXT_NODE","data","COMMENT_NODE","console","error","Error","nodeWalker","createTreeWalker","NodeFilter","SHOW_ALL","elementWalker","SHOW_ELEMENT","currentNode","parentElement","firstElementChild","lastElementChild","previousElementSibling","nextElementSibling","children","innerHTML","DOCUMENT_FRAGMENT_NODE","textWalker","SHOW_TEXT","nextNode","nodeValue","nativeProtos","findNodeDescriptor","proto","hasOwnProperty","nodeAccessors","fragmentAccessors","documentAccessors","slice","accessors","nativeTreeAccessors","nativeTreeWalker","clearNode","inertDoc","implementation","createHTMLDocument","nativeIsConnectedAccessors","nativeIsConnected","nativeActiveElementDescriptor","OutsideAccessors","ClassNameAccessor","className","getAttribute","InsideAccessors","item","childNodes.item","index","childElementCount","tc","cn","join","text","nativeAccessors","children.item","containerName","htmlContainer","createElement","ShadowRootAccessor","shadowRoot","ActiveElementAccessor","activeElement","active","host","nativeContains","activeRoot","patchAccessorGroup","descriptors","force","objDesc","warn","patchAccessors","patchShadowRootAccessors","ShadyRoot","__proto__","defineProperties","nodeName","prop","patchOutsideElementAccessors","element","patchInsideElementAccessors","linkNode","ref_node","containerData","ref_nodeData","psd","nsd","recordChildNodes","parent","refData","ownerRoot","slotsAdded","slots","_ensureSlotData","_pendingSlots","_slotList","_slotMap","$jscomp.arrayFromIterator","$jscomp.makeIterator","_asyncRender","resetTo","parentData","hasShadowRootWithSlot","preventNativeInsert","firstComposedNode","nativeMethods","scheduleObserver","preventNativeRemove","removeOwnerShadyRoot","changeSlotContent","_validateSlots","slot","splice","x","indexOf","didRemove","removingInsertionPoint","composed","flattened","_hasInsertionPoint","distributeAttributeChange","oldName","__slotName","_nameForSlot","list","_sortSlots","addedNode","removedNode","documentElement","query","matcher","halter","queryElements","elements","result","scopingShim","deep","ownerDocument","nc","eventWrappersName","Date","now","alwaysComposed","pathComposer","startNode","composedPath","current","startRoot","retarget","refNode","path","refNodePath","ancestor","lastRoot","rootIdx","eventMixin","isTrusted","__composed","type","__composedPath","currentTarget","relatedTarget","__relatedTarget","__relatedTargetComposedPath","stopPropagation","Event","__propagationStopped","stopImmediatePropagation","__immediatePropagationStopped","mixinComposedFlag","Base","klazz","options","event","nonBubblingEventsToRetarget","hasRetargeted","fireHandlers","phase","hs","__handlers","fn","retargetNonBubblingEvent","AT_TARGET","lastFiredRoot","findListener","wrappers","capture","once","passive","savedType","savedListener","savedCapture","savedOnce","savedPassive","savedNode","fnOrObj","optionsOrCapture","handlerType","handleEvent","__shadyTarget","wrapperFn","patchEvent","lastCurrentTargetDesc","eventPhase","BUBBLING_PHASE","CAPTURING_PHASE","bubbles","ret","ael","idx","rel","activateFocusEventOverrides","ev","getPrototypeOf","patchProto","__sourceProto","PatchedEvent","PatchedCustomEvent","CustomEvent","PatchedMouseEvent","MouseEvent","newSplice","addedCount","removed","calcSplices","currentEnd","old","oldEnd","currentStart","oldStart","prefixCount","suffixCount","minLength","Math","min","currentValue","previousValue","index1","index2","count","equals","rowCount","columnCount","distances","j","north","west","edits","EDIT_ADD","EDIT_DELETE","northWest","EDIT_LEAVE","EDIT_UPDATE","reverse","splices","oldIndex","ShadyRootConstructionToken","ancestorList","ancestors","unshift","token","TypeError","SHADYROOT_NAME","_mode","mode","hostData","MODE_CLOSED","rootData","_renderPending","_render","renderRoot","_distribute","slotData","_distributeNodeToSlot","slotParentRoot","slotParentData","_addAssignedToFlattenedNodes","prevAssignedNodes","_fireSlotChange","_compose","composeList","targetNode","distributedNode","d","next","forcedSlot","oldSlot","CATCHALL_NAME","assigned","nestedAssigned","slotNamesToSort","_mapSlots","sort","a","b","listA","listB","nA","nB","getAssignedSlot","windowMixin","bind","nodeMixin","IsConnectedAccessor","isConnected","textMixin","fragmentMixin","useNative","o","slotMixin","flatten","elementMixin","documentMixin","getElementById","id","nativeBlur","blur","htmlElementMixin","shadowActive","shadowRootMixin","patchBuiltin","ShadyDOM","patch","nativeHTMLElement","Text","HTMLSlotElement","ShadowRoot","reservedTagList","isValidCustomElementName","reserved","has","validForm","test","nativeValue","__CE_isImportDocument","nextSiblingOrAncestorSibling","start","walkDeepDescendantElements","visitedImports","import","__CE_shadowRoot","setPropertyUnchecked","destination","CustomElementInternals","_localNameToDefinition","Map","_constructorToDefinition","_patches","_hasPatches","setDefinition","definition","addPatch","listener","patchTree","__CE_patched","connectTree","custom","__CE_state","connectedCallback","upgradeElement","disconnectTree","disconnectedCallback","patchAndUpgradeTree","upgrade","gatherElements","__CE_hasRegistry","readyState","__CE_documentLoadHandled","clonedVisitedImports","defaultView","localNameToDefinition","constructionStack","pop","failed","__CE_definition","attributeChangedCallback","observedAttributes","oldValue","newValue","namespace","DocumentConstructionObserver","internals","doc","_internals","_document","_handleMutations","childList","subtree","disconnect","Deferred","_resolve","_value","_promise","Promise","resolve","CustomElementRegistry","_elementDefinitionIsRunning","_whenDefinedDeferred","_flushCallback","this._flushCallback","_flushPending","_pendingDefinitions","_documentConstructionObserver","define","Function","SyntaxError","getCallback","callbackValue","adoptedCallback","_flush","pendingDefinitions","elementsWithStableDefinitions","elementsWithPendingDefinitions","pendingElements","pendingUpgradableElements","deferred","whenDefined","reject","prior","some","polyfillWrapFlushCallback","outer","inner","Document_createElement","Document_createElementNS","createElementNS","Document_importNode","Document_prepend","Document_append","DocumentFragment_prepend","DocumentFragment_append","Node_cloneNode","Node_appendChild","Node_insertBefore","Node_removeChild","Node_replaceChild","Node_textContent","Element_attachShadow","Element_innerHTML","Element_getAttribute","Element_setAttribute","Element_removeAttribute","Element_getAttributeNS","getAttributeNS","Element_setAttributeNS","setAttributeNS","Element_removeAttributeNS","removeAttributeNS","Element_insertAdjacentElement","Element_insertAdjacentHTML","Element_prepend","Element_append","Element_before","Element_after","Element_replaceWith","Element_remove","HTMLElement_innerHTML","HTMLElement_insertAdjacentElement","HTMLElement_insertAdjacentHTML","$jscompDefaultExport","AlreadyConstructedMarker","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Document_createElement.call","setPrototypeOf","lastIndex","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.HTMLElement","builtIn","appendPrependPatch","builtInMethod","connectedElements","apply","prepend","append","clone","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Document_importNode.call","NS_HTML","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Document_createElementNS.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Document_prepend","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Document_append","patch_textContent","baseDescriptor","enumerable","assignedValue","childNodesLength","insertedNodes","nativeResult","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Node_insertBefore.call","nodeWasConnected","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Node_appendChild.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Node_cloneNode.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Node_removeChild.call","nodeToInsert","nodeToRemove","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Node_replaceChild.call","nodeToInsertWasConnected","thisIsConnected","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Node_textContent","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Node_textContent.get","parts","beforeAfterPatch","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_before","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_after","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_replaceWith","wasConnected","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_remove","patch_innerHTML","htmlString","removedElements","patch_insertAdjacentElement","baseMethod","position","insertedElement","patch_insertAdjacentHTML","upgradeNodesInRange","end","toLowerCase","marker","String","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_attachShadow","init","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_attachShadow.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_innerHTML","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_innerHTML.get","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.HTMLElement_innerHTML","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.HTMLElement_innerHTML.get","isTemplate","rawElement","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_setAttribute.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_getAttribute.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_setAttributeNS.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_getAttributeNS.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_removeAttribute.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_removeAttributeNS.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.HTMLElement_insertAdjacentElement","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_insertAdjacentElement","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.HTMLElement_insertAdjacentHTML","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_insertAdjacentHTML","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_prepend","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_append","priorCustomElements","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.DocumentFragment_prepend","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.DocumentFragment_append","customElements","StyleNode","parse","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.comments","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.port","parseCss","OPEN_BRACE","previous","CLOSE_BRACE","t","substring","trim","ss","_expandUnicodeEscapes","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.multipleSpaces","lastIndexOf","AT_START","MEDIA_START","types$$module$node_modules$$webcomponents$shadycss$src$css_parse.MEDIA_RULE","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.keyframesRule","types$$module$node_modules$$webcomponents$shadycss$src$css_parse.KEYFRAMES_RULE","split","VAR_START","types$$module$node_modules$$webcomponents$shadycss$src$css_parse.MIXIN_RULE","types$$module$node_modules$$webcomponents$shadycss$src$css_parse.STYLE_RULE","r$","r","code","repeat","stringify","preserveProperties","cssText","rules","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.customProp","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.mixinProp","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.mixinApply","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.varApply","STYLE_RULE","KEYFRAMES_RULE","MEDIA_RULE","MIXIN_RULE","comments","port","customProp","mixinProp","mixinApply","varApply","keyframesRule","multipleSpaces","nativeShadow","nativeCssVariables","calcCssVariables","CSS","supports","ShadyCSS","nativeCss","module$node_modules$$webcomponents$shadycss$src$style_settings.nativeCssVariables","VAR_ASSIGN","MIXIN_MATCH","VAR_CONSUMED","ANIMATION_MATCH","MEDIA_MATCH","BRACKETED","styleTextSet","toCssText","forEachRule","rulesForStyle","style","isKeyframesSelector","rule","styleRuleCallback","keyframesRuleCallback","onlyActiveRules","skipRules","matchMedia","applyCss","moniker","contextNode","applyStyle","lastHeadApplyNode","head","compareDocumentPosition","DOCUMENT_POSITION_PRECEDING","processVariableAndFallback","str","level","prefix","suffix","comma","fallback","setElementClassRaw","getIsExtends","typeExtension","is","extends","StyleTransformer","dom","scope","shouldRemoveScope","_transformDom","_content","classList","remove","SCOPE_NAME","CLASS","elementStyles","styleRules","cssBuildType","css","ext","hostScope","_calcHostScope","CSS_CLASS_PREFIX","isScoped","transformedSelector","_transformRuleCss","self","_transformComplexSelector","transformer","p$","COMPLEX_SELECTOR_SEP","_twiddleNthPlus","NTH","inside","stop","isNth","SLOTTED_START","HOST","SIMPLE_SELECTOR_SEP","info","_transformCompoundSelector","combinator","slottedIndex","SLOTTED","_transformHostSelector","_transformSimpleSelector","slotted","SLOTTED_PAREN","paren","DIR_PAREN","before","dir","PSEUDO_PREFIX","HOST_PAREN","SIMPLE_SELECTOR_PREFIX","typeSelector","SELECTOR_NO_MATCH","normalizeRootSelector","ROOT","_transformDocumentSelector","SCOPE_DOC_SELECTOR","$jscomp.global.Object.defineProperties","RegExp","StyleInfo","ast","placeholder","ownStylePropertyNames","overrideStyleProperties","customStyle","scopeSelector","styleProperties","styleInfo","_getStyleRules","method","StyleProperties","decorateStyles","props","keyframes","ruleIndex","decorateRule","propertyInfo","exec","onKeyframesRule","_keyframes","names","properties","collectProperties","hasProperties","assign","any","valueForProperty","property","valueForProperties","propertyValue","colon","pp","propertyDataFromStyles","selectorToMatch","parseInt","key","whenHostOrRootRule","cssBuild","parsedSelector","isRoot","isHost","hostAndRootPropertiesForScope","hostProps","rootProps","_element","transformStyles","hostSelector","hostRx","HOST_PREFIX","rxHostSelector","HOST_SUFFIX","StyleInfo$$module$node_modules$$webcomponents$shadycss$src$style_info.get","keyframeTransforms","_elementKeyframeTransforms","output","input","hasAnimations","keyframeNamesToTransform","keyframe","transform","keyframesRules","keyframesNameRx","transformedKeyframesName","scopeId","_keyframesRuleTransformer","applyCustomStyle","XSCOPE_NAME","placeholderMap","ce","origDefine","wrappedDefine","clazz","placeHolder","createComment","after","StyleCache","cache","store","tagname","styleElement","typeMax","fetch","ownPropertyNames","entry","pn","handler","mxns","mxn","classes","hasAttribute","currentScope","newScope","unscoped","delayedStart","body","requestAnimationFrame","module$node_modules$$webcomponents$shadycss$src$document_watcher.flush","templateMap","promise","invalidate","elementName","template","templateIsValid","startValidatingTemplate","_validating","then","readyPromise","whenReady","resolveFn","documentWait","styleCache","ScopingShim","_scopeCounter","_documentOwner","_documentOwnerStyleInfo","StyleInfo$$module$node_modules$$webcomponents$shadycss$src$style_info.set","_elementsHaveApplied","_customStyleInterface","_applyShim","_ensure","ScopingShim$$module$node_modules$$webcomponents$shadycss$src$scoping_shim.prototype","?.prototype","ScopingShim$$module$node_modules$$webcomponents$shadycss$src$scoping_shim_prototype$flush","getStyleAst","styleAstToString","prepareTemplate","_prepared","styleTextParts","styles","scopingAttribute","newStyle","__cssBuild","_cssBuild","shadowroot","_style","_ownPropertyNames","_ensureCustomStyleInterface","CustomStyleInterface","transformCustomStyleForDocument","flushCustomStyles","_ensureApplyShim","ApplyShim","customStyles","_revalidateCustomStyleApplyShim","_updateProperties","_applyCustomStyles","styleDocument","overrideProps","_isRootOwner","removeProperty","setProperty","cachedStyle","cacheEntry","oldScopeSelector","cachedScopeSelector","applyElementStyle","v","_styleOwnerForNode","owner","ownerStyleInfo","hostAndRootProps","propertiesMatchingHost","propertyData","overrides","reify","styleSubtree","shadowChildren","documentRule","_transformRule","getComputedStyleValue","getComputedStyle","getPropertyValue","setElementClass","classString","scopeName","classAttr","k$","_styleInfoForNode","elementExtends","WebComponents","fire","ready","wait"],"mappings":"A;;;;;;;;;;;;;;;;;;aAWA,IAAA,CAAA,CCgCAA,EAb2B,WAAlB,EAAC,MAAO,OAAR,EAAiC,MAAjC,GAa0B,IAb1B,CAa0B,IAb1B,CAEe,WAAlB,EAAC,MAAO,OAAR,EAA2C,IAA3C,EAAiC,MAAjC,CAAmD,MAAnD,CAW6B,IDhCnC,CEyBAC,GAC4D,UAAxD,EAAsB,MAAO,OAAA,iBAA7B,CACA,MAAA,eADA,CAEA,QAAQ,CAAC,CAAD,CAAS,CAAT,CAAmB,CAAnB,CAA+B,CAOjC,CAAJ,EAAc,KAAA,UAAd,EAAiC,CAAjC,EAA2C,MAAA,UAA3C,GACA,CAAA,CAAO,CAAP,CADA,CACmB,CAAA,MADnB,CAPqC,CCZtB,SAAA,GAAQ,EAAG,CAE9BC,EAAA,CAAqB,QAAQ,EAAG,EAE3BF,EAAA,OAAL,GACEA,CAAA,OADF,CAC6BG,EAD7B,CAJ8B,CAehC,IAAAA,GAAuD,QAAQ,EAAG,CAChE,IAAI,EAAU,CAUd,OAJA,SAAe,CAAC,CAAD,CAAkB,CAC/B,MA9BoBC,gBA8BpB,EAC6B,CAD7B,EACgD,EADhD,EACuD,CAAA,EAFxB,CAP+B,CAAZ,EAoBzB;QAAA,GAAQ,EAAG,CACtCF,EAAA,E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A+nB,aAAA,CAAyBvrB,CAAzB,CAFoB,CAxBN,CAgChB,cAAA0vB,QAAa,CAAC7H,CAAD,CAAa,CACxBrkB,CAAA2rB,EAAA,EACA3rB,EAAAksB,cAAA,CAA0B7H,CAA1B,CAFwB,CAhCV,CA0ChB,sBAAAoJ,QAAqB,CAACjxB,CAAD,CAAUmoB,CAAV,CAAoB,CACvC,MAAO3kB,EAAAytB,sBAAA,CAAkCjxB,CAAlC,CAA2CmoB,CAA3C,CADgC,CA1CzB,CA8ChB9H,UAAWC,CA9CK,CAgDhBP,af7DSA,CeaO,CAmDdsP,GAAJ,GACE/9B,MAAA8uB,SAAAiP,UADF,CAC8BA,EAD9B,CAIIJ;EAAJ,GACE39B,MAAA8uB,SAAA6O,qBADF,CACyCA,EADzC,C,CC5DA,IAAI56B,GAAW/C,MAAA+C,SAGf/C,OAAAqgC,cAAA,CAAuBrgC,MAAAqgC,cAAvB,EAA+C,EAE/CC,SAASA,GAAI,EAAG,CACdrF,qBAAA,CAAsB,QAAA,EAAM,CAC1Bj7B,MAAAqgC,cAAAE,MAAA,CAA6B,CAAA,CAC7BvgC,OAAA+C,SAAAmE,cAAA,CAA8B,IAAImQ,WAAJ,CAAgB,oBAAhB,CAAsC,CAAEZ,QAAS,CAAA,CAAX,CAAtC,CAA9B,CAF0B,CAA5B,CADc,CAOhB+pB,QAASA,GAAI,EAAG,CACdF,EAAA,EACAv9B,GAAA+D,oBAAA,CAA6B,kBAA7B,CAAiD05B,EAAjD,CAFc,CAKY,SAA5B,GAAIz9B,EAAA0d,WAAJ,CACE6f,EAAA,EADF,CAGEv9B,EAAA8D,iBAAA,CAA0B,kBAA1B,CAA8C25B,EAA9C","file":"webcomponents-sd-ce.js","sourcesContent":["/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n\nexport class ShadyData {\n constructor() {\n /** @type {ShadowRoot} */\n this.root = null;\n /** @type {ShadowRoot} */\n this.publicRoot = null;\n this.dirty = false;\n this.observer = null;\n /** @type {Array<Node>} */\n this.assignedNodes = null;\n /** @type {Element} */\n this.assignedSlot = null;\n /** @type {Array<Node>} */\n this._previouslyAssignedNodes = null;\n /** @type {Element} */\n this._prevAssignedSlot = null;\n /** @type {Array<Node>} */\n this.flattenedNodes = null;\n this.ownerShadyRoot = undefined;\n /** @type {Node|undefined} */\n this.parentNode = undefined;\n /** @type {Node|undefined} */\n this.firstChild = undefined;\n /** @type {Node|undefined} */\n this.lastChild = undefined;\n /** @type {Node|undefined} */\n this.previousSibling = undefined;\n /** @type {Node|undefined} */\n this.nextSibling = undefined;\n /** @type {Array<Node>|undefined} */\n this.childNodes = undefined;\n this.__outsideAccessors = false;\n this.__insideAccessors = false;\n }\n}\n\nexport function ensureShadyDataForNode(node) {\n if (!node.__shady) {\n node.__shady = new ShadyData();\n }\n return node.__shady;\n}\n\nexport function shadyDataForNode(node) {\n return node && node.__shady;\n}",null,null,null,null,null,"/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport {shadyDataForNode} from './shady-data.js';\n\nexport let settings = window['ShadyDOM'] || {};\n\nsettings.hasNativeShadowDOM = Boolean(Element.prototype.attachShadow && Node.prototype.getRootNode);\n\nlet desc = Object.getOwnPropertyDescriptor(Node.prototype, 'firstChild');\n\nsettings.hasDescriptors = Boolean(desc && desc.configurable && desc.get);\nsettings.inUse = settings['force'] || !settings.hasNativeShadowDOM;\n\n// Default to using native accessors (instead of treewalker) only for\n// IE/Edge where they are faster.\nconst IS_IE = navigator.userAgent.match('Trident');\nconst IS_EDGE = navigator.userAgent.match('Edge');\nif (settings.useNativeAccessors === undefined) {\n settings.useNativeAccessors = settings.hasDescriptors && (IS_IE || IS_EDGE);\n}\n\nexport function isTrackingLogicalChildNodes(node) {\n const nodeData = shadyDataForNode(node);\n return (nodeData && nodeData.firstChild !== undefined);\n}\n\nexport function isShadyRoot(obj) {\n return Boolean(obj._localName === 'ShadyRoot');\n}\n\nexport function ownerShadyRootForNode(node) {\n let root = node.getRootNode();\n if (isShadyRoot(root)) {\n return root;\n }\n}\n\nlet p = Element.prototype;\nlet matches = p.matches || p.matchesSelector ||\n p.mozMatchesSelector || p.msMatchesSelector ||\n p.oMatchesSelector || p.webkitMatchesSelector;\n\nexport function matchesSelector(element, selector) {\n return matches.call(element, selector);\n}\n\nfunction copyOwnProperty(name, source, target) {\n let pd = Object.getOwnPropertyDescriptor(source, name);\n if (pd) {\n Object.defineProperty(target, name, pd);\n }\n}\n\nexport function extend(target, source) {\n if (target && source) {\n let n$ = Object.getOwnPropertyNames(source);\n for (let i=0, n; (i<n$.length) && (n=n$[i]); i++) {\n copyOwnProperty(n, source, target);\n }\n }\n return target || source;\n}\n\nexport function extendAll(target, ...sources) {\n for (let i=0; i < sources.length; i++) {\n extend(target, sources[i]);\n }\n return target;\n}\n\nexport function mixin(target, source) {\n for (var i in source) {\n target[i] = source[i];\n }\n return target;\n}\n\nexport function patchPrototype(obj, mixin) {\n let proto = Object.getPrototypeOf(obj);\n if (!proto.hasOwnProperty('__patchProto')) {\n let patchProto = Object.create(proto);\n patchProto.__sourceProto = proto;\n extend(patchProto, mixin);\n proto['__patchProto'] = patchProto;\n }\n // old browsers don't have setPrototypeOf\n obj.__proto__ = proto['__patchProto'];\n}\n\n\nlet twiddle = document.createTextNode('');\nlet content = 0;\nlet queue = [];\nnew MutationObserver(() => {\n while (queue.length) {\n // catch errors in user code...\n try {\n queue.shift()();\n } catch(e) {\n // enqueue another record and throw\n twiddle.textContent = content++;\n throw(e);\n }\n }\n}).observe(twiddle, {characterData: true});\n\n// use MutationObserver to get microtask async timing.\nexport function microtask(callback) {\n queue.push(callback);\n twiddle.textContent = content++;\n}\n\nexport const hasDocumentContains = Boolean(document.contains);\n\nexport function contains(container, node) {\n while (node) {\n if (node == container) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from './utils.js';\n\n// render enqueuer/flusher\nlet flushList = [];\nlet scheduled;\nexport function enqueue(callback) {\n if (!scheduled) {\n scheduled = true;\n utils.microtask(flush);\n }\n flushList.push(callback);\n}\n\nexport function flush() {\n scheduled = false;\n let didFlush = Boolean(flushList.length);\n while (flushList.length) {\n flushList.shift()();\n }\n return didFlush;\n}\n\nflush['list'] = flushList;\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from './utils.js';\nimport {ensureShadyDataForNode} from './shady-data.js';\n\nclass AsyncObserver {\n\n constructor() {\n this._scheduled = false;\n this.addedNodes = [];\n this.removedNodes = [];\n this.callbacks = new Set();\n }\n\n schedule() {\n if (!this._scheduled) {\n this._scheduled = true;\n utils.microtask(() => {\n this.flush();\n });\n }\n }\n\n flush() {\n if (this._scheduled) {\n this._scheduled = false;\n let mutations = this.takeRecords();\n if (mutations.length) {\n this.callbacks.forEach(function(cb) {\n cb(mutations);\n });\n }\n }\n }\n\n takeRecords() {\n if (this.addedNodes.length || this.removedNodes.length) {\n let mutations = [{\n addedNodes: this.addedNodes,\n removedNodes: this.removedNodes\n }];\n this.addedNodes = [];\n this.removedNodes = [];\n return mutations;\n }\n return [];\n }\n\n}\n\n// TODO(sorvell): consider instead polyfilling MutationObserver\n// directly so that users do not have to fork their code.\n// Supporting the entire api may be challenging: e.g. filtering out\n// removed nodes in the wrong scope and seeing non-distributing\n// subtree child mutations.\nexport let observeChildren = function(node, callback) {\n const sd = ensureShadyDataForNode(node);\n if (!sd.observer) {\n sd.observer = new AsyncObserver();\n }\n sd.observer.callbacks.add(callback);\n let observer = sd.observer;\n return {\n _callback: callback,\n _observer: observer,\n _node: node,\n takeRecords() {\n return observer.takeRecords()\n }\n };\n}\n\nexport let unobserveChildren = function(handle) {\n let observer = handle && handle._observer;\n if (observer) {\n observer.callbacks.delete(handle._callback);\n if (!observer.callbacks.size) {\n ensureShadyDataForNode(handle._node).observer = null;\n }\n }\n}\n\nexport function filterMutations(mutations, target) {\n /** @const {Node} */\n const targetRootNode = target.getRootNode();\n return mutations.map(function(mutation) {\n /** @const {boolean} */\n const mutationInScope = (targetRootNode === mutation.target.getRootNode());\n if (mutationInScope && mutation.addedNodes) {\n let nodes = Array.from(mutation.addedNodes).filter(function(n) {\n return (targetRootNode === n.getRootNode());\n });\n if (nodes.length) {\n mutation = Object.create(mutation);\n Object.defineProperty(mutation, 'addedNodes', {\n value: nodes,\n configurable: true\n });\n return mutation;\n }\n } else if (mutationInScope) {\n return mutation;\n }\n }).filter(function(m) { return m});\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nexport let appendChild = Element.prototype.appendChild;\nexport let insertBefore = Element.prototype.insertBefore;\nexport let replaceChild = Element.prototype.replaceChild;\nexport let removeChild = Element.prototype.removeChild;\nexport let setAttribute = Element.prototype.setAttribute;\nexport let removeAttribute = Element.prototype.removeAttribute;\nexport let cloneNode = Element.prototype.cloneNode;\nexport let importNode = Document.prototype.importNode;\nexport let addEventListener = Element.prototype.addEventListener;\nexport let removeEventListener = Element.prototype.removeEventListener;\nexport let windowAddEventListener = Window.prototype.addEventListener;\nexport let windowRemoveEventListener = Window.prototype.removeEventListener;\nexport let dispatchEvent = Element.prototype.dispatchEvent;\nexport let contains = Node.prototype.contains || HTMLElement.prototype.contains;\nexport let elementQuerySelector = Element.prototype.querySelector;\nexport let fragmentQuerySelector = DocumentFragment.prototype.querySelector;\nexport let documentQuerySelector = Document.prototype.querySelector;\nexport let querySelector = function(selector) {\n switch (this.nodeType) {\n case Node.ELEMENT_NODE:\n return elementQuerySelector.call(this, selector);\n case Node.DOCUMENT_NODE:\n return documentQuerySelector.call(this, selector);\n default:\n return fragmentQuerySelector.call(this, selector);\n }\n};\nexport let elementQuerySelectorAll = Element.prototype.querySelectorAll;\nexport let fragmentQuerySelectorAll = DocumentFragment.prototype.querySelectorAll;\nexport let documentQuerySelectorAll = Document.prototype.querySelectorAll;\nexport let querySelectorAll = function(selector) {\n switch (this.nodeType) {\n case Node.ELEMENT_NODE:\n return elementQuerySelectorAll.call(this, selector);\n case Node.DOCUMENT_NODE:\n return documentQuerySelectorAll.call(this, selector);\n default:\n return fragmentQuerySelectorAll.call(this, selector);\n }\n};","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n// Cribbed from ShadowDOM polyfill\n// https://github.com/webcomponents/webcomponentsjs/blob/master/src/ShadowDOM/wrappers/HTMLElement.js#L28\n/////////////////////////////////////////////////////////////////////////////\n// innerHTML and outerHTML\n\n// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#escapingString\nlet escapeAttrRegExp = /[&\\u00A0\"]/g;\nlet escapeDataRegExp = /[&\\u00A0<>]/g;\n\nfunction escapeReplace(c) {\n switch (c) {\n case '&':\n return '&';\n case '<':\n return '<';\n case '>':\n return '>';\n case '\"':\n return '"';\n case '\\u00A0':\n return ' ';\n }\n}\n\nfunction escapeAttr(s) {\n return s.replace(escapeAttrRegExp, escapeReplace);\n}\n\nfunction escapeData(s) {\n return s.replace(escapeDataRegExp, escapeReplace);\n}\n\nfunction makeSet(arr) {\n let set = {};\n for (let i = 0; i < arr.length; i++) {\n set[arr[i]] = true;\n }\n return set;\n}\n\n// http://www.whatwg.org/specs/web-apps/current-work/#void-elements\nlet voidElements = makeSet([\n 'area',\n 'base',\n 'br',\n 'col',\n 'command',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'keygen',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr'\n]);\n\nlet plaintextParents = makeSet([\n 'style',\n 'script',\n 'xmp',\n 'iframe',\n 'noembed',\n 'noframes',\n 'plaintext',\n 'noscript'\n]);\n\n/**\n * @param {Node} node\n * @param {Node} parentNode\n * @param {Function=} callback\n */\nexport function getOuterHTML(node, parentNode, callback) {\n switch (node.nodeType) {\n case Node.ELEMENT_NODE: {\n let tagName = node.localName;\n let s = '<' + tagName;\n let attrs = node.attributes;\n for (let i = 0, attr; (attr = attrs[i]); i++) {\n s += ' ' + attr.name + '=\"' + escapeAttr(attr.value) + '\"';\n }\n s += '>';\n if (voidElements[tagName]) {\n return s;\n }\n return s + getInnerHTML(node, callback) + '</' + tagName + '>';\n }\n case Node.TEXT_NODE: {\n let data = /** @type {Text} */ (node).data;\n if (parentNode && plaintextParents[parentNode.localName]) {\n return data;\n }\n return escapeData(data);\n }\n case Node.COMMENT_NODE: {\n return '<!--' + /** @type {Comment} */ (node).data + '-->';\n }\n default: {\n window.console.error(node);\n throw new Error('not implemented');\n }\n }\n}\n\n/**\n * @param {Node} node\n * @param {Function=} callback\n */\nexport function getInnerHTML(node, callback) {\n if (node.localName === 'template') {\n node = /** @type {HTMLTemplateElement} */ (node).content;\n }\n let s = '';\n let c$ = callback ? callback(node) : node.childNodes;\n for (let i=0, l=c$.length, child; (i<l) && (child=c$[i]); i++) {\n s += getOuterHTML(child, node, callback);\n }\n return s;\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport {getInnerHTML} from './innerHTML.js';\n\nlet nodeWalker = document.createTreeWalker(document, NodeFilter.SHOW_ALL,\n null, false);\n\nlet elementWalker = document.createTreeWalker(document, NodeFilter.SHOW_ELEMENT,\n null, false);\n\nexport function parentNode(node) {\n nodeWalker.currentNode = node;\n return nodeWalker.parentNode();\n}\n\nexport function firstChild(node) {\n nodeWalker.currentNode = node;\n return nodeWalker.firstChild();\n}\n\nexport function lastChild(node) {\n nodeWalker.currentNode = node;\n return nodeWalker.lastChild();\n}\n\nexport function previousSibling(node) {\n nodeWalker.currentNode = node;\n return nodeWalker.previousSibling();\n}\n\nexport function nextSibling(node) {\n nodeWalker.currentNode = node;\n return nodeWalker.nextSibling();\n}\n\nexport function childNodes(node) {\n let nodes = [];\n nodeWalker.currentNode = node;\n let n = nodeWalker.firstChild();\n while (n) {\n nodes.push(n);\n n = nodeWalker.nextSibling();\n }\n return nodes;\n}\n\nexport function parentElement(node) {\n elementWalker.currentNode = node;\n return elementWalker.parentNode();\n}\n\nexport function firstElementChild(node) {\n elementWalker.currentNode = node;\n return elementWalker.firstChild();\n}\n\nexport function lastElementChild(node) {\n elementWalker.currentNode = node;\n return elementWalker.lastChild();\n}\n\nexport function previousElementSibling(node) {\n elementWalker.currentNode = node;\n return elementWalker.previousSibling();\n}\n\nexport function nextElementSibling(node) {\n elementWalker.currentNode = node;\n return elementWalker.nextSibling();\n}\n\nexport function children(node) {\n let nodes = [];\n elementWalker.currentNode = node;\n let n = elementWalker.firstChild();\n while (n) {\n nodes.push(n);\n n = elementWalker.nextSibling();\n }\n return nodes;\n}\n\nexport function innerHTML(node) {\n return getInnerHTML(node, (n) => childNodes(n));\n}\n\nexport function textContent(node) {\n /* eslint-disable no-case-declarations */\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n case Node.DOCUMENT_FRAGMENT_NODE:\n let textWalker = document.createTreeWalker(node, NodeFilter.SHOW_TEXT,\n null, false);\n let content = '', n;\n while ( (n = textWalker.nextNode()) ) {\n // TODO(sorvell): can't use textContent since we patch it on Node.prototype!\n // However, should probably patch it only on element.\n content += n.nodeValue;\n }\n return content;\n default:\n return node.nodeValue;\n }\n /* eslint-enable */\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport * as utils from './utils.js';\n\nconst hasDescriptors = utils.settings.hasDescriptors;\n\n// Find descriptor on the \"lowest\" native prototype. Safe as these are not\n// overridden and we call these on nodes.\nconst nativeProtos = [Node.prototype, Element.prototype, HTMLElement.prototype];\n// note, avoid Array.find for IE11 compat.\nfunction findNativeProtoWithDescriptor(name) {\n for (let i=0; i < nativeProtos.length; i++) {\n const proto = nativeProtos[i];\n if (proto.hasOwnProperty(name)) {\n return proto;\n }\n }\n}\nfunction findNodeDescriptor(name) {\n const proto = findNativeProtoWithDescriptor(name);\n if (!proto) {\n throw Error(`Could not find descriptor for ${name}`);\n }\n return Object.getOwnPropertyDescriptor(proto, name);\n}\n\nexport const nodeAccessors = hasDescriptors ? {\n parentNode: findNodeDescriptor('parentNode'),\n firstChild: findNodeDescriptor('firstChild'),\n lastChild: findNodeDescriptor('lastChild'),\n previousSibling: findNodeDescriptor('previousSibling'),\n nextSibling: findNodeDescriptor('nextSibling'),\n childNodes: findNodeDescriptor('childNodes'),\n parentElement: findNodeDescriptor('parentElement'),\n previousElementSibling: findNodeDescriptor('previousElementSibling'),\n nextElementSibling: findNodeDescriptor('nextElementSibling'),\n innerHTML: findNodeDescriptor('innerHTML'),\n textContent: findNodeDescriptor('textContent'),\n firstElementChild: findNodeDescriptor('firstElementChild'),\n lastElementChild: findNodeDescriptor('lastElementChild'),\n children: findNodeDescriptor('children'),\n} : {};\n\nexport const fragmentAccessors = hasDescriptors ? {\n firstElementChild: Object.getOwnPropertyDescriptor(\n DocumentFragment.prototype, 'firstElementChild'),\n lastElementChild: Object.getOwnPropertyDescriptor(\n DocumentFragment.prototype, 'lastElementChild'),\n children: Object.getOwnPropertyDescriptor(\n DocumentFragment.prototype, 'children')\n} : {};\n\nexport const documentAccessors = hasDescriptors ? {\n firstElementChild: Object.getOwnPropertyDescriptor(\n Document.prototype, 'firstElementChild'),\n lastElementChild: Object.getOwnPropertyDescriptor(\n Document.prototype, 'lastElementChild'),\n children: Object.getOwnPropertyDescriptor(\n Document.prototype, 'children')\n} : {};\n\nexport function parentNode(node) {\n return nodeAccessors.parentNode.get.call(node);\n}\n\nexport function firstChild(node) {\n return nodeAccessors.firstChild.get.call(node);\n}\n\nexport function lastChild(node) {\n return nodeAccessors.lastChild.get.call(node);\n}\n\nexport function previousSibling(node) {\n return nodeAccessors.previousSibling.get.call(node);\n}\n\nexport function nextSibling(node) {\n return nodeAccessors.nextSibling.get.call(node);\n}\n\nexport function childNodes(node) {\n return Array.prototype.slice.call(nodeAccessors.childNodes.get.call(node));\n}\n\nexport function parentElement(node) {\n return nodeAccessors.parentElement.get.call(node);\n}\n\nexport function previousElementSibling(node) {\n return nodeAccessors.previousElementSibling.get.call(node);\n}\n\nexport function nextElementSibling(node) {\n return nodeAccessors.nextElementSibling.get.call(node);\n}\n\nexport function innerHTML(node) {\n return nodeAccessors.innerHTML.get.call(node);\n}\n\nexport function textContent(node) {\n return nodeAccessors.textContent.get.call(node);\n}\n\nexport function children(node) {\n let children;\n switch (node.nodeType) {\n case Node.DOCUMENT_FRAGMENT_NODE:\n children = fragmentAccessors.children.get.call(node);\n break;\n case Node.DOCUMENT_NODE:\n children = documentAccessors.children.get.call(node);\n break;\n default:\n children = nodeAccessors.children.get.call(node);\n break;\n }\n return Array.prototype.slice.call(children);\n}\n\nexport function firstElementChild(node) {\n switch (node.nodeType) {\n case Node.DOCUMENT_FRAGMENT_NODE:\n return fragmentAccessors.firstElementChild.get.call(node);\n case Node.DOCUMENT_NODE:\n return documentAccessors.firstElementChild.get.call(node);\n default:\n return nodeAccessors.firstElementChild.get.call(node);\n }\n}\n\nexport function lastElementChild(node) {\n switch (node.nodeType) {\n case Node.DOCUMENT_FRAGMENT_NODE:\n return fragmentAccessors.lastElementChild.get.call(node);\n case Node.DOCUMENT_NODE:\n return documentAccessors.lastElementChild.get.call(node);\n default:\n return nodeAccessors.lastElementChild.get.call(node);\n }\n}","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as nativeTreeWalker from './native-tree-walker.js';\nimport * as nativeTreeAccessors from './native-tree-accessors.js';\nimport * as utils from './utils.js';\n\nexport const accessors = utils.settings.useNativeAccessors ?\n nativeTreeAccessors : nativeTreeWalker;","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from './utils.js';\nimport {getInnerHTML} from './innerHTML.js';\nimport {accessors as nativeTree} from './native-tree.js';\nimport {nodeAccessors as nativeAccessors} from './native-tree-accessors.js';\nimport {contains as nativeContains} from './native-methods.js';\nimport {ensureShadyDataForNode, shadyDataForNode} from './shady-data.js';\n\nfunction clearNode(node) {\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n}\n\nconst hasDescriptors = utils.settings.hasDescriptors;\nconst inertDoc = document.implementation.createHTMLDocument('inert');\n\nconst nativeIsConnectedAccessors =\n/** @type {ObjectPropertyDescriptor} */(\n Object.getOwnPropertyDescriptor(Node.prototype, 'isConnected')\n);\n\nconst nativeIsConnected = nativeIsConnectedAccessors && nativeIsConnectedAccessors.get;\n\nconst nativeActiveElementDescriptor =\n /** @type {ObjectPropertyDescriptor} */(\n Object.getOwnPropertyDescriptor(Document.prototype, 'activeElement')\n );\nfunction getDocumentActiveElement() {\n if (nativeActiveElementDescriptor && nativeActiveElementDescriptor.get) {\n return nativeActiveElementDescriptor.get.call(document);\n } else if (!utils.settings.hasDescriptors) {\n return document.activeElement;\n }\n}\n\nfunction activeElementForNode(node) {\n let active = getDocumentActiveElement();\n // In IE11, activeElement might be an empty object if the document is\n // contained in an iframe.\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10998788/\n if (!active || !active.nodeType) {\n return null;\n }\n let isShadyRoot = !!(utils.isShadyRoot(node));\n if (node !== document) {\n // If this node isn't a document or shady root, then it doesn't have\n // an active element.\n if (!isShadyRoot) {\n return null;\n }\n // If this shady root's host is the active element or the active\n // element is not a descendant of the host (in the composed tree),\n // then it doesn't have an active element.\n if (node.host === active ||\n !nativeContains.call(node.host, active)) {\n return null;\n }\n }\n // This node is either the document or a shady root of which the active\n // element is a (composed) descendant of its host; iterate upwards to\n // find the active element's most shallow host within it.\n let activeRoot = utils.ownerShadyRootForNode(active);\n while (activeRoot && activeRoot !== node) {\n active = activeRoot.host;\n activeRoot = utils.ownerShadyRootForNode(active);\n }\n if (node === document) {\n // This node is the document, so activeRoot should be null.\n return activeRoot ? null : active;\n } else {\n // This node is a non-document shady root, and it should be\n // activeRoot.\n return activeRoot === node ? active : null;\n }\n}\n\nlet OutsideAccessors = {\n\n parentElement: {\n /** @this {Node} */\n get() {\n const nodeData = shadyDataForNode(this);\n let l = nodeData && nodeData.parentNode;\n if (l && l.nodeType !== Node.ELEMENT_NODE) {\n l = null;\n }\n return l !== undefined ? l : nativeTree.parentElement(this);\n },\n configurable: true\n },\n\n parentNode: {\n /** @this {Node} */\n get() {\n const nodeData = shadyDataForNode(this);\n const l = nodeData && nodeData.parentNode;\n return l !== undefined ? l : nativeTree.parentNode(this);\n },\n configurable: true\n },\n\n nextSibling: {\n /** @this {Node} */\n get() {\n const nodeData = shadyDataForNode(this);\n const l = nodeData && nodeData.nextSibling;\n return l !== undefined ? l : nativeTree.nextSibling(this);\n },\n configurable: true\n },\n\n previousSibling: {\n /** @this {Node} */\n get() {\n const nodeData = shadyDataForNode(this);\n const l = nodeData && nodeData.previousSibling;\n return l !== undefined ? l : nativeTree.previousSibling(this);\n },\n configurable: true\n },\n\n // fragment, element, document\n nextElementSibling: {\n /**\n * @this {HTMLElement}\n */\n get() {\n const nodeData = shadyDataForNode(this);\n if (nodeData && nodeData.nextSibling !== undefined) {\n let n = this.nextSibling;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = n.nextSibling;\n }\n return n;\n } else {\n return nativeTree.nextElementSibling(this);\n }\n },\n configurable: true\n },\n\n previousElementSibling: {\n /**\n * @this {HTMLElement}\n */\n get() {\n const nodeData = shadyDataForNode(this);\n if (nodeData && nodeData.previousSibling !== undefined) {\n let n = this.previousSibling;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = n.previousSibling;\n }\n return n;\n } else {\n return nativeTree.previousElementSibling(this);\n }\n },\n configurable: true\n }\n\n};\n\nexport const ClassNameAccessor = {\n className: {\n /**\n * @this {HTMLElement}\n */\n get() {\n return this.getAttribute('class') || '';\n },\n /**\n * @this {HTMLElement}\n */\n set(value) {\n this.setAttribute('class', value);\n },\n configurable: true\n }\n}\n\nexport const IsConnectedAccessor = {\n\n isConnected: {\n /**\n * @this {Node}\n */\n get() {\n if (nativeIsConnected && nativeIsConnected.call(this)) {\n return true;\n }\n if (this.nodeType == Node.DOCUMENT_FRAGMENT_NODE) {\n return false;\n }\n // Fast path for distributed nodes.\n const ownerDocument = this.ownerDocument;\n if (utils.hasDocumentContains) {\n if (nativeContains.call(ownerDocument, this)) {\n return true;\n }\n } else if (ownerDocument.documentElement &&\n nativeContains.call(ownerDocument.documentElement, this)) {\n return true;\n }\n // Slow path for non-distributed nodes.\n let node = this;\n while (node && !(node instanceof Document)) {\n node = node.parentNode || (utils.isShadyRoot(node) ? /** @type {ShadowRoot} */(node).host : undefined);\n }\n return !!(node && node instanceof Document);\n },\n configurable: true\n }\n};\n\nlet InsideAccessors = {\n\n childNodes: {\n /**\n * @this {HTMLElement}\n */\n get() {\n let childNodes;\n if (utils.isTrackingLogicalChildNodes(this)) {\n const nodeData = shadyDataForNode(this);\n if (!nodeData.childNodes) {\n nodeData.childNodes = [];\n for (let n=this.firstChild; n; n=n.nextSibling) {\n nodeData.childNodes.push(n);\n }\n }\n childNodes = nodeData.childNodes;\n } else {\n childNodes = nativeTree.childNodes(this);\n }\n childNodes.item = function(index) {\n return childNodes[index];\n }\n return childNodes;\n },\n configurable: true\n },\n\n childElementCount: {\n /** @this {HTMLElement} */\n get() {\n return this.children.length;\n },\n configurable: true\n },\n\n firstChild: {\n /** @this {HTMLElement} */\n get() {\n const nodeData = shadyDataForNode(this);\n const l = nodeData && nodeData.firstChild;\n return l !== undefined ? l : nativeTree.firstChild(this);\n },\n configurable: true\n },\n\n lastChild: {\n /** @this {HTMLElement} */\n get() {\n const nodeData = shadyDataForNode(this);\n const l = nodeData && nodeData.lastChild;\n return l !== undefined ? l : nativeTree.lastChild(this);\n },\n configurable: true\n },\n\n textContent: {\n /**\n * @this {HTMLElement}\n */\n get() {\n if (utils.isTrackingLogicalChildNodes(this)) {\n let tc = [];\n for (let i = 0, cn = this.childNodes, c; (c = cn[i]); i++) {\n if (c.nodeType !== Node.COMMENT_NODE) {\n tc.push(c.textContent);\n }\n }\n return tc.join('');\n } else {\n return nativeTree.textContent(this);\n }\n },\n /**\n * @this {HTMLElement}\n * @param {string} text\n */\n set(text) {\n if (typeof text === 'undefined' || text === null) {\n text = ''\n }\n switch (this.nodeType) {\n case Node.ELEMENT_NODE:\n case Node.DOCUMENT_FRAGMENT_NODE:\n if (!utils.isTrackingLogicalChildNodes(this) && hasDescriptors) {\n // may be removing a nested slot but fast path if we know we are not.\n const firstChild = this.firstChild;\n if (firstChild != this.lastChild ||\n (firstChild && firstChild.nodeType != Node.TEXT_NODE)) {\n clearNode(this);\n }\n nativeAccessors.textContent.set.call(this, text);\n } else {\n clearNode(this);\n // Document fragments must have no childnodes if setting a blank string\n if (text.length > 0 || this.nodeType === Node.ELEMENT_NODE) {\n this.appendChild(document.createTextNode(text));\n }\n }\n break;\n default:\n // TODO(sorvell): can't do this if patch nodeValue.\n this.nodeValue = text;\n break;\n }\n },\n configurable: true\n },\n\n // fragment, element, document\n firstElementChild: {\n /**\n * @this {HTMLElement}\n */\n get() {\n const nodeData = shadyDataForNode(this);\n if (nodeData && nodeData.firstChild !== undefined) {\n let n = this.firstChild;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = n.nextSibling;\n }\n return n;\n } else {\n return nativeTree.firstElementChild(this);\n }\n },\n configurable: true\n },\n\n lastElementChild: {\n /**\n * @this {HTMLElement}\n */\n get() {\n const nodeData = shadyDataForNode(this);\n if (nodeData && nodeData.lastChild !== undefined) {\n let n = this.lastChild;\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = n.previousSibling;\n }\n return n;\n } else {\n return nativeTree.lastElementChild(this);\n }\n },\n configurable: true\n },\n\n children: {\n /**\n * @this {HTMLElement}\n */\n get() {\n let children;\n if (utils.isTrackingLogicalChildNodes(this)) {\n children = Array.prototype.filter.call(this.childNodes, function(n) {\n return (n.nodeType === Node.ELEMENT_NODE);\n });\n } else {\n children = nativeTree.children(this);\n }\n children.item = function(index) {\n return children[index];\n }\n return children;\n },\n configurable: true\n },\n\n // element (HTMLElement on IE11)\n innerHTML: {\n /**\n * @this {HTMLElement}\n */\n get() {\n if (utils.isTrackingLogicalChildNodes(this)) {\n const content = this.localName === 'template' ?\n /** @type {HTMLTemplateElement} */(this).content : this;\n return getInnerHTML(content);\n } else {\n return nativeTree.innerHTML(this);\n }\n },\n /**\n * @this {HTMLElement}\n */\n set(text) {\n const content = this.localName === 'template' ?\n /** @type {HTMLTemplateElement} */(this).content : this;\n clearNode(content);\n let containerName = this.localName;\n // avoid creating a template so we don't have to pull nodes form `.content`\n if (!containerName || containerName === 'template') {\n containerName = 'div';\n }\n const htmlContainer = inertDoc.createElement(containerName);\n if (hasDescriptors) {\n nativeAccessors.innerHTML.set.call(htmlContainer, text);\n } else {\n htmlContainer.innerHTML = text;\n }\n while (htmlContainer.firstChild) {\n content.appendChild(htmlContainer.firstChild);\n }\n },\n configurable: true\n }\n\n};\n\n// Note: Can be patched on element prototype on all browsers.\n// Must be patched on instance on browsers that support native Shadow DOM\n// but do not have builtin accessors (old Chrome).\nexport let ShadowRootAccessor = {\n\n shadowRoot: {\n /**\n * @this {HTMLElement}\n */\n get() {\n const nodeData = shadyDataForNode(this);\n return nodeData && nodeData.publicRoot || null;\n },\n configurable: true\n }\n};\n\n// Note: Can be patched on document prototype on browsers with builtin accessors.\n// Must be patched separately on simulated ShadowRoot.\n// Must be patched as `_activeElement` on browsers without builtin accessors.\nexport let ActiveElementAccessor = {\n\n activeElement: {\n /**\n * @this {HTMLElement}\n */\n get() {\n return activeElementForNode(this);\n },\n /**\n * @this {HTMLElement}\n */\n set() {},\n configurable: true\n }\n\n};\n\n// patch a group of descriptors on an object only if it exists or if the `force`\n// argument is true.\n/**\n * @param {!Object} obj\n * @param {!Object} descriptors\n * @param {boolean=} force\n */\nfunction patchAccessorGroup(obj, descriptors, force) {\n for (let p in descriptors) {\n let objDesc = Object.getOwnPropertyDescriptor(obj, p);\n if ((objDesc && objDesc.configurable) ||\n (!objDesc && force)) {\n Object.defineProperty(obj, p, descriptors[p]);\n } else if (force) {\n console.warn('Could not define', p, 'on', obj); // eslint-disable-line no-console\n }\n }\n}\n\n// patch dom accessors on proto where they exist\nexport function patchAccessors(proto) {\n patchAccessorGroup(proto, OutsideAccessors);\n patchAccessorGroup(proto, ClassNameAccessor);\n patchAccessorGroup(proto, InsideAccessors);\n patchAccessorGroup(proto, ActiveElementAccessor);\n}\n\nexport function patchShadowRootAccessors(proto) {\n proto.__proto__ = DocumentFragment.prototype;\n // ensure element descriptors (IE/Edge don't have em)\n patchAccessorGroup(proto, OutsideAccessors, true);\n patchAccessorGroup(proto, InsideAccessors, true);\n patchAccessorGroup(proto, ActiveElementAccessor, true);\n // Ensure native properties are all safely wrapped since ShadowRoot is not an\n // actual DocumentFragment instance.\n Object.defineProperties(proto, {\n nodeType: {\n value: Node.DOCUMENT_FRAGMENT_NODE,\n configurable: true\n },\n nodeName: {\n value: '#document-fragment',\n configurable: true\n },\n nodeValue: {\n value: null,\n configurable: true\n }\n });\n // make undefined\n [\n 'localName',\n 'namespaceURI',\n 'prefix'\n ].forEach((prop) => {\n Object.defineProperty(proto, prop, {\n value: undefined,\n configurable: true\n });\n });\n // defer properties to host\n [\n 'ownerDocument',\n 'baseURI',\n 'isConnected'\n ].forEach((prop) => {\n Object.defineProperty(proto, prop, {\n get() {\n return this.host[prop];\n },\n configurable: true\n });\n });\n}\n\n// ensure an element has patched \"outside\" accessors; no-op when not needed\nexport let patchOutsideElementAccessors = utils.settings.hasDescriptors ?\n function() {} : function(element) {\n const sd = ensureShadyDataForNode(element);\n if (!sd.__outsideAccessors) {\n sd.__outsideAccessors = true;\n patchAccessorGroup(element, OutsideAccessors, true);\n patchAccessorGroup(element, ClassNameAccessor, true);\n }\n }\n\n// ensure an element has patched \"inside\" accessors; no-op when not needed\nexport let patchInsideElementAccessors = utils.settings.hasDescriptors ?\n function() {} : function(element) {\n const sd = ensureShadyDataForNode(element);\n if (!sd.__insideAccessors) {\n patchAccessorGroup(element, InsideAccessors, true);\n patchAccessorGroup(element, ShadowRootAccessor, true);\n }\n }\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport {calculateSplices} from './array-splice.js';\nimport * as utils from './utils.js';\nimport {enqueue} from './flush.js';\nimport {recordChildNodes} from './logical-tree.js';\nimport {removeChild, insertBefore, dispatchEvent} from './native-methods.js';\nimport {accessors} from './native-tree.js';\nimport {ensureShadyDataForNode, shadyDataForNode} from './shady-data.js';\n\nconst {parentNode, childNodes} = accessors;\n\n// Do not export this object. It must be passed as the first argument to the\n// ShadyRoot constructor in `attachShadow` to prevent the constructor from\n// throwing. This prevents the user from being able to manually construct a\n// ShadyRoot (i.e. `new ShadowRoot()`).\nconst ShadyRootConstructionToken = {};\n\nconst CATCHALL_NAME = '__catchall';\nconst SHADYROOT_NAME = 'ShadyRoot';\n\nconst MODE_CLOSED = 'closed';\n\nfunction ancestorList(node) {\n let ancestors = [];\n do {\n ancestors.unshift(node);\n } while ((node = node.parentNode));\n return ancestors;\n}\n\n/**\n * @constructor\n * @extends {ShadowRoot}\n */\nexport class ShadyRoot {\n\n constructor(token, host, options) {\n if (token !== ShadyRootConstructionToken) {\n throw new TypeError('Illegal constructor');\n }\n // NOTE: set a fake local name so this element can be\n // distinguished from a DocumentFragment when patching.\n // FF doesn't allow this to be `localName`\n this._localName = SHADYROOT_NAME;\n const c$ = childNodes(host);\n // root <=> host\n this.host = host;\n this._mode = options && options.mode;\n // logical dom setup\n recordChildNodes(host, c$);\n const hostData = shadyDataForNode(host);\n hostData.root = this;\n hostData.publicRoot = this._mode !== MODE_CLOSED ? this : null;\n // setup root\n const rootData = ensureShadyDataForNode(this);\n rootData.firstChild = rootData.lastChild =\n rootData.parentNode = rootData.nextSibling =\n rootData.previousSibling = null;\n rootData.childNodes = [];\n // state flags\n this._renderPending = false;\n this._hasRendered = false;\n // marsalled lazily\n this._slotList = null;\n this._slotMap = null;\n this._pendingSlots = null;\n // fast path initial render: remove existing physical dom.\n for (let i=0, l=c$.length; i < l; i++) {\n removeChild.call(host, c$[i])\n }\n }\n\n // async render\n _asyncRender() {\n if (!this._renderPending) {\n this._renderPending = true;\n enqueue(() => this._render());\n }\n }\n\n // returns the oldest renderPending ancestor root.\n _getRenderRoot() {\n let renderRoot;\n let root = this;\n while (root) {\n if (root._renderPending) {\n renderRoot = root;\n }\n root = root._rendererForHost();\n }\n return renderRoot;\n }\n\n // Returns the shadyRoot `this.host` if `this.host`\n // has children that require distribution.\n _rendererForHost() {\n let root = this.host.getRootNode();\n if (utils.isShadyRoot(root)) {\n let c$ = this.host.childNodes;\n for (let i=0, c; i < c$.length; i++) {\n c = c$[i];\n if (this._isInsertionPoint(c)) {\n return root;\n }\n }\n }\n }\n\n _render() {\n const root = this._getRenderRoot();\n if (root) {\n root['_renderRoot']();\n }\n }\n\n // NOTE: avoid renaming to ease testability.\n ['_renderRoot']() {\n this._renderPending = false;\n if (this._slotList) {\n this._distribute();\n this._compose();\n }\n this._hasRendered = true;\n }\n\n _distribute() {\n this._validateSlots();\n // capture # of previously assigned nodes to help determine if dirty.\n for (let i=0, slot; i < this._slotList.length; i++) {\n slot = this._slotList[i];\n this._clearSlotAssignedNodes(slot);\n }\n // distribute host children.\n for (let n=this.host.firstChild; n; n=n.nextSibling) {\n this._distributeNodeToSlot(n);\n }\n // fallback content, slotchange, and dirty roots\n for (let i=0; i < this._slotList.length; i++) {\n const slot = this._slotList[i];\n const slotData = shadyDataForNode(slot);\n // distribute fallback content\n if (!slotData.assignedNodes.length) {\n for (let n=slot.firstChild; n; n=n.nextSibling) {\n this._distributeNodeToSlot(n, slot);\n }\n }\n const slotParentData = shadyDataForNode(slot.parentNode);\n const slotParentRoot = slotParentData && slotParentData.root;\n if (slotParentRoot && slotParentRoot._hasInsertionPoint()) {\n slotParentRoot['_renderRoot']();\n }\n this._addAssignedToFlattenedNodes(slotData.flattenedNodes,\n slotData.assignedNodes);\n let prevAssignedNodes = slotData._previouslyAssignedNodes;\n if (prevAssignedNodes) {\n for (let i=0; i < prevAssignedNodes.length; i++) {\n shadyDataForNode(prevAssignedNodes[i])._prevAssignedSlot = null;\n }\n slotData._previouslyAssignedNodes = null;\n // dirty if previously less assigned nodes than previously assigned.\n if (prevAssignedNodes.length > slotData.assignedNodes.length) {\n slotData.dirty = true;\n }\n }\n /* Note: A slot is marked dirty whenever a node is newly assigned to it\n or a node is assigned to a different slot (done in `_distributeNodeToSlot`)\n or if the number of nodes assigned to the slot has decreased (done above);\n */\n if (slotData.dirty) {\n slotData.dirty = false;\n this._fireSlotChange(slot);\n }\n }\n }\n\n /**\n * Distributes given `node` to the appropriate slot based on its `slot`\n * attribute. If `forcedSlot` is given, then the node is distributed to the\n * `forcedSlot`.\n * Note: slot to which the node is assigned will be marked dirty for firing\n * `slotchange`.\n * @param {Node} node\n * @param {Node=} forcedSlot\n *\n */\n _distributeNodeToSlot(node, forcedSlot) {\n const nodeData = ensureShadyDataForNode(node);\n let oldSlot = nodeData._prevAssignedSlot;\n nodeData._prevAssignedSlot = null;\n let slot = forcedSlot;\n if (!slot) {\n let name = node.slot || CATCHALL_NAME;\n const list = this._slotMap[name];\n slot = list && list[0];\n }\n if (slot) {\n const slotData = ensureShadyDataForNode(slot);\n slotData.assignedNodes.push(node);\n nodeData.assignedSlot = slot;\n } else {\n nodeData.assignedSlot = undefined;\n }\n if (oldSlot !== nodeData.assignedSlot) {\n if (nodeData.assignedSlot) {\n ensureShadyDataForNode(nodeData.assignedSlot).dirty = true;\n }\n }\n }\n\n /**\n * Clears the assignedNodes tracking data for a given `slot`. Note, the current\n * assigned node data is tracked (via _previouslyAssignedNodes and\n * _prevAssignedSlot) to see if `slotchange` should fire. This data may be out\n * of date at this time because the assigned nodes may have already been\n * distributed to another root. This is ok since this data is only used to\n * track changes.\n * @param {HTMLSlotElement} slot\n */\n _clearSlotAssignedNodes(slot) {\n const slotData = shadyDataForNode(slot);\n let n$ = slotData.assignedNodes;\n slotData.assignedNodes = [];\n slotData.flattenedNodes = [];\n slotData._previouslyAssignedNodes = n$;\n if (n$) {\n for (let i=0; i < n$.length; i++) {\n let n = shadyDataForNode(n$[i]);\n n._prevAssignedSlot = n.assignedSlot;\n // only clear if it was previously set to this slot;\n // this helps ensure that if the node has otherwise been distributed\n // ignore it.\n if (n.assignedSlot === slot) {\n n.assignedSlot = null;\n }\n }\n }\n }\n\n _addAssignedToFlattenedNodes(flattened, assigned) {\n for (let i=0, n; (i<assigned.length) && (n=assigned[i]); i++) {\n if (n.localName == 'slot') {\n const nestedAssigned = shadyDataForNode(n).assignedNodes;\n if (nestedAssigned && nestedAssigned.length) {\n this._addAssignedToFlattenedNodes(flattened, nestedAssigned);\n }\n } else {\n flattened.push(assigned[i]);\n }\n }\n }\n\n _fireSlotChange(slot) {\n // NOTE: cannot bubble correctly here so not setting bubbles: true\n // Safari tech preview does not bubble but chrome does\n // Spec says it bubbles (https://dom.spec.whatwg.org/#mutation-observers)\n dispatchEvent.call(slot, new Event('slotchange'));\n const slotData = shadyDataForNode(slot);\n if (slotData.assignedSlot) {\n this._fireSlotChange(slotData.assignedSlot);\n }\n }\n\n // Reify dom such that it is at its correct rendering position\n // based on logical distribution.\n // NOTE: here we only compose parents of <slot> elements and not the\n // shadowRoot into the host. The latter is performend via a fast path\n // in the `logical-mutation`.insertBefore.\n _compose() {\n const slots = this._slotList;\n let composeList = [];\n for (let i=0; i < slots.length; i++) {\n const parent = slots[i].parentNode;\n /* compose node only if:\n (1) parent does not have a shadowRoot since shadowRoot has already\n composed into the host\n (2) we're not already composing it\n [consider (n^2) but rare better than Set]\n */\n const parentData = shadyDataForNode(parent);\n if (!(parentData && parentData.root) &&\n composeList.indexOf(parent) < 0) {\n composeList.push(parent);\n }\n }\n for (let i=0; i < composeList.length; i++) {\n const node = composeList[i];\n const targetNode = node === this ? this.host : node;\n this._updateChildNodes(targetNode, this._composeNode(node));\n }\n }\n\n // Returns the list of nodes which should be rendered inside `node`.\n _composeNode(node) {\n let children = [];\n let c$ = node.childNodes;\n for (let i = 0; i < c$.length; i++) {\n let child = c$[i];\n // Note: if we see a slot here, the nodes are guaranteed to need to be\n // composed here. This is because if there is redistribution, it has\n // already been handled by this point.\n if (this._isInsertionPoint(child)) {\n let flattenedNodes = shadyDataForNode(child).flattenedNodes;\n for (let j = 0; j < flattenedNodes.length; j++) {\n let distributedNode = flattenedNodes[j];\n children.push(distributedNode);\n }\n } else {\n children.push(child);\n }\n }\n return children;\n }\n\n _isInsertionPoint(node) {\n return node.localName == 'slot';\n }\n\n // Ensures that the rendered node list inside `container` is `children`.\n _updateChildNodes(container, children) {\n let composed = childNodes(container);\n let splices = calculateSplices(children, composed);\n // process removals\n for (let i=0, d=0, s; (i<splices.length) && (s=splices[i]); i++) {\n for (let j=0, n; (j < s.removed.length) && (n=s.removed[j]); j++) {\n // check if the node is still where we expect it is before trying\n // to remove it; this can happen if we move a node and\n // then schedule its previous host for distribution resulting in\n // the node being removed here.\n if (parentNode(n) === container) {\n removeChild.call(container, n);\n }\n // TODO(sorvell): avoid the need for splicing here.\n composed.splice(s.index + d, 1);\n }\n d -= s.addedCount;\n }\n // process adds\n for (let i=0, s, next; (i<splices.length) && (s=splices[i]); i++) { //eslint-disable-line no-redeclare\n next = composed[s.index];\n for (let j=s.index, n; j < s.index + s.addedCount; j++) {\n n = children[j];\n insertBefore.call(container, n, next);\n composed.splice(j, 0, n);\n }\n }\n }\n\n _ensureSlotData() {\n this._pendingSlots = this._pendingSlots || [];\n this._slotList = this._slotList || [];\n this._slotMap = this._slotMap || {};\n }\n\n _addSlots(slots) {\n this._ensureSlotData();\n this._pendingSlots.push(...slots);\n }\n\n _validateSlots() {\n if (this._pendingSlots && this._pendingSlots.length) {\n this._mapSlots(this._pendingSlots);\n this._pendingSlots = [];\n }\n }\n\n /**\n * Adds the given slots. Slots are maintained in an dom-ordered list.\n * In addition a map of name to slot is updated.\n */\n _mapSlots(slots) {\n let slotNamesToSort;\n for (let i=0; i < slots.length; i++) {\n let slot = slots[i];\n // ensure insertionPoints's and their parents have logical dom info.\n // save logical tree info\n // a. for shadyRoot\n // b. for insertion points (fallback)\n // c. for parents of insertion points\n recordChildNodes(slot);\n recordChildNodes(slot.parentNode);\n let name = this._nameForSlot(slot);\n if (this._slotMap[name]) {\n slotNamesToSort = slotNamesToSort || {};\n slotNamesToSort[name] = true;\n this._slotMap[name].push(slot);\n } else {\n this._slotMap[name] = [slot];\n }\n this._slotList.push(slot);\n }\n if (slotNamesToSort) {\n for (let n in slotNamesToSort) {\n this._slotMap[n] = this._sortSlots(this._slotMap[n]);\n }\n }\n }\n\n _nameForSlot(slot) {\n const name = slot['name'] || slot.getAttribute('name') || CATCHALL_NAME;\n slot.__slotName = name;\n return name;\n }\n\n /**\n * Slots are kept in an ordered list. Slots with the same name\n * are sorted here by tree order.\n */\n _sortSlots(slots) {\n // NOTE: Cannot use `compareDocumentPosition` because it's not polyfilled,\n // but the code here could be used to polyfill the preceeding/following info\n // in `compareDocumentPosition`.\n return slots.sort((a, b) => {\n let listA = ancestorList(a);\n let listB = ancestorList(b);\n for (var i=0; i < listA.length; i++) {\n let nA = listA[i];\n let nB = listB[i];\n if (nA !== nB) {\n let c$ = Array.from(nA.parentNode.childNodes);\n return c$.indexOf(nA) - c$.indexOf(nB);\n }\n }\n });\n }\n\n /**\n * Removes from tracked slot data any slots contained within `container` and\n * then updates the tracked data (_slotList and _slotMap).\n * Any removed slots also have their `assignedNodes` removed from comopsed dom.\n */\n _removeContainedSlots(container) {\n if (!this._slotList) {\n return;\n }\n this._validateSlots();\n let didRemove;\n const map = this._slotMap;\n for (let n in map) {\n let slots = map[n];\n for (let i=0; i < slots.length; i++) {\n let slot = slots[i];\n if (utils.contains(container, slot)) {\n slots.splice(i, 1);\n const x = this._slotList.indexOf(slot);\n if (x >= 0) {\n this._slotList.splice(x, 1);\n }\n i--;\n this._removeFlattenedNodes(slot);\n didRemove = true;\n }\n }\n }\n return didRemove;\n }\n\n _updateSlotName(slot) {\n if (!this._slotList) {\n return;\n }\n const oldName = slot.__slotName;\n const name = this._nameForSlot(slot);\n if (name === oldName) {\n return;\n }\n // remove from existing tracking\n let slots = this._slotMap[oldName];\n const i = slots.indexOf(slot);\n if (i >= 0) {\n slots.splice(i, 1);\n }\n // add to new location and sort if nedessary\n let list = this._slotMap[name] || (this._slotMap[name] = []);\n list.push(slot);\n if (list.length > 1) {\n this._slotMap[name] = this._sortSlots(list);\n }\n }\n\n _removeFlattenedNodes(slot) {\n const data = shadyDataForNode(slot);\n let n$ = data.flattenedNodes;\n if (n$) {\n for (let i=0; i<n$.length; i++) {\n let node = n$[i];\n let parent = parentNode(node);\n if (parent) {\n removeChild.call(parent, node);\n }\n }\n }\n data.flattenedNodes = [];\n data.assignedNodes = [];\n }\n\n _hasInsertionPoint() {\n this._validateSlots();\n return Boolean(this._slotList && this._slotList.length);\n }\n}\n\n/**\n Implements a pared down version of ShadowDOM's scoping, which is easy to\n polyfill across browsers.\n*/\nexport function attachShadow(host, options) {\n if (!host) {\n throw 'Must provide a host.';\n }\n if (!options) {\n throw 'Not enough arguments.'\n }\n return new ShadyRoot(ShadyRootConstructionToken, host, options);\n}","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from './utils.js';\nimport {flush} from './flush.js';\nimport {dispatchEvent, querySelectorAll} from './native-methods.js';\nimport * as mutation from './logical-mutation.js';\nimport {ActiveElementAccessor, ShadowRootAccessor, patchAccessors, patchShadowRootAccessors, IsConnectedAccessor} from './patch-accessors.js';\nimport {addEventListener, removeEventListener} from './patch-events.js';\nimport {attachShadow, ShadyRoot} from './attach-shadow.js';\nimport {shadyDataForNode} from './shady-data.js';\n\nfunction getAssignedSlot(node) {\n mutation.renderRootNode(node);\n const nodeData = shadyDataForNode(node);\n return nodeData && nodeData.assignedSlot || null;\n}\n\nlet windowMixin = {\n\n // NOTE: ensure these methods are bound to `window` so that `this` is correct\n // when called directly from global context without a receiver; e.g.\n // `addEventListener(...)`.\n addEventListener: addEventListener.bind(window),\n\n removeEventListener: removeEventListener.bind(window)\n\n};\n\nlet nodeMixin = {\n\n addEventListener: addEventListener,\n\n removeEventListener: removeEventListener,\n\n appendChild(node) {\n return mutation.insertBefore(this, node);\n },\n\n insertBefore(node, ref_node) {\n return mutation.insertBefore(this, node, ref_node);\n },\n\n removeChild(node) {\n return mutation.removeChild(this, node);\n },\n\n /**\n * @this {Node}\n */\n replaceChild(node, ref_node) {\n mutation.insertBefore(this, node, ref_node);\n mutation.removeChild(this, ref_node);\n return node;\n },\n\n /**\n * @this {Node}\n */\n cloneNode(deep) {\n return mutation.cloneNode(this, deep);\n },\n\n /**\n * @this {Node}\n */\n getRootNode(options) {\n return mutation.getRootNode(this, options);\n },\n\n contains(node) {\n return utils.contains(this, node);\n },\n\n /**\n * @this {Node}\n */\n dispatchEvent(event) {\n flush();\n return dispatchEvent.call(this, event);\n }\n\n};\n\n// NOTE: we can do this regardless of the browser supporting native accessors\n// since this is always \"new\" in that case.\nObject.defineProperties(nodeMixin, IsConnectedAccessor);\n\n// NOTE: For some reason 'Text' redefines 'assignedSlot'\nlet textMixin = {\n /**\n * @this {Text}\n */\n get assignedSlot() {\n return getAssignedSlot(this);\n }\n};\n\nlet fragmentMixin = {\n\n // TODO(sorvell): consider doing native QSA and filtering results.\n /**\n * @this {DocumentFragment}\n */\n querySelector(selector) {\n // match selector and halt on first result.\n let result = mutation.query(this, function(n) {\n return utils.matchesSelector(n, selector);\n }, function(n) {\n return Boolean(n);\n })[0];\n return result || null;\n },\n\n /**\n * @this {DocumentFragment}\n */\n // TODO(sorvell): `useNative` option relies on native querySelectorAll and\n // misses distributed nodes, see\n // https://github.com/webcomponents/shadydom/pull/210#issuecomment-361435503\n querySelectorAll(selector, useNative) {\n if (useNative) {\n const o = Array.prototype.slice.call(querySelectorAll(this, selector));\n const root = this.getRootNode();\n return o.filter(e => e.getRootNode() == root);\n }\n return mutation.query(this, function(n) {\n return utils.matchesSelector(n, selector);\n });\n }\n\n};\n\nlet slotMixin = {\n\n /**\n * @this {HTMLSlotElement}\n */\n assignedNodes(options) {\n if (this.localName === 'slot') {\n mutation.renderRootNode(this);\n const nodeData = shadyDataForNode(this);\n return nodeData ?\n ((options && options.flatten ? nodeData.flattenedNodes :\n nodeData.assignedNodes) || []) :\n [];\n }\n }\n\n};\n\nlet elementMixin = utils.extendAll({\n\n /**\n * @this {HTMLElement}\n */\n setAttribute(name, value) {\n mutation.setAttribute(this, name, value);\n },\n\n /**\n * @this {HTMLElement}\n */\n removeAttribute(name) {\n mutation.removeAttribute(this, name);\n },\n\n /**\n * @this {HTMLElement}\n */\n attachShadow(options) {\n return attachShadow(this, options);\n },\n\n /**\n * @this {HTMLElement}\n */\n get slot() {\n return this.getAttribute('slot');\n },\n\n /**\n * @this {HTMLElement}\n */\n set slot(value) {\n mutation.setAttribute(this, 'slot', value);\n },\n\n /**\n * @this {HTMLElement}\n */\n get assignedSlot() {\n return getAssignedSlot(this);\n }\n\n}, fragmentMixin, slotMixin);\n\nObject.defineProperties(elementMixin, ShadowRootAccessor);\n\nlet documentMixin = utils.extendAll({\n /**\n * @this {Document}\n */\n importNode(node, deep) {\n return mutation.importNode(node, deep);\n },\n\n /**\n * @this {Document}\n */\n getElementById(id) {\n let result = mutation.query(this, function(n) {\n return n.id == id;\n }, function(n) {\n return Boolean(n);\n })[0];\n return result || null;\n }\n\n}, fragmentMixin);\n\nObject.defineProperties(documentMixin, {\n '_activeElement': ActiveElementAccessor.activeElement\n});\n\nlet nativeBlur = HTMLElement.prototype.blur;\n\nlet htmlElementMixin = utils.extendAll({\n /**\n * @this {HTMLElement}\n */\n blur() {\n const nodeData = shadyDataForNode(this);\n let root = nodeData && nodeData.root;\n let shadowActive = root && root.activeElement;\n if (shadowActive) {\n shadowActive.blur();\n } else {\n nativeBlur.call(this);\n }\n }\n});\n\nconst shadowRootMixin = {\n addEventListener(type, fn, optionsOrCapture) {\n if (typeof optionsOrCapture !== 'object') {\n optionsOrCapture = {\n capture: Boolean(optionsOrCapture)\n }\n }\n optionsOrCapture.__shadyTarget = this;\n this.host.addEventListener(type, fn, optionsOrCapture);\n },\n\n removeEventListener(type, fn, optionsOrCapture) {\n if (typeof optionsOrCapture !== 'object') {\n optionsOrCapture = {\n capture: Boolean(optionsOrCapture)\n }\n }\n optionsOrCapture.__shadyTarget = this;\n this.host.removeEventListener(type, fn, optionsOrCapture);\n },\n\n getElementById(id) {\n let result = mutation.query(this, function(n) {\n return n.id == id;\n }, function(n) {\n return Boolean(n);\n })[0];\n return result || null;\n }\n}\n\nfunction patchBuiltin(proto, obj) {\n let n$ = Object.getOwnPropertyNames(obj);\n for (let i=0; i < n$.length; i++) {\n let n = n$[i];\n let d = Object.getOwnPropertyDescriptor(obj, n);\n // NOTE: we prefer writing directly here because some browsers\n // have descriptors that are writable but not configurable (e.g.\n // `appendChild` on older browsers)\n if (d.value) {\n proto[n] = d.value;\n } else {\n Object.defineProperty(proto, n, d);\n }\n }\n}\n\n// Apply patches to builtins (e.g. Element.prototype). Some of these patches\n// can be done unconditionally (mostly methods like\n// `Element.prototype.appendChild`) and some can only be done when the browser\n// has proper descriptors on the builtin prototype\n// (e.g. `Element.prototype.firstChild`)`. When descriptors are not available,\n// elements are individually patched when needed (see e.g.\n// `patchInside/OutsideElementAccessors` in `patch-accessors.js`).\nexport function patchBuiltins() {\n let nativeHTMLElement =\n (window['customElements'] && window['customElements']['nativeHTMLElement']) ||\n HTMLElement;\n // These patches can always be done, for all supported browsers.\n patchBuiltin(ShadyRoot.prototype, shadowRootMixin);\n patchBuiltin(window.Node.prototype, nodeMixin);\n patchBuiltin(window.Window.prototype, windowMixin);\n patchBuiltin(window.Text.prototype, textMixin);\n patchBuiltin(window.DocumentFragment.prototype, fragmentMixin);\n patchBuiltin(window.Element.prototype, elementMixin);\n patchBuiltin(window.Document.prototype, documentMixin);\n if (window.HTMLSlotElement) {\n patchBuiltin(window.HTMLSlotElement.prototype, slotMixin);\n }\n patchBuiltin(nativeHTMLElement.prototype, htmlElementMixin);\n // These patches can *only* be done\n // on browsers that have proper property descriptors on builtin prototypes.\n // This includes: IE11, Edge, Chrome >= 4?; Safari >= 10, Firefox\n // On older browsers (Chrome <= 4?, Safari 9), a per element patching\n // strategy is used for patching accessors.\n if (utils.settings.hasDescriptors) {\n patchAccessors(window.Node.prototype);\n patchAccessors(window.Text.prototype);\n patchAccessors(window.DocumentFragment.prototype);\n patchAccessors(window.Element.prototype);\n patchAccessors(nativeHTMLElement.prototype);\n patchAccessors(window.Document.prototype);\n if (window.HTMLSlotElement) {\n patchAccessors(window.HTMLSlotElement.prototype);\n }\n }\n patchShadowRootAccessors(ShadyRoot.prototype);\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport {patchInsideElementAccessors, patchOutsideElementAccessors} from './patch-accessors.js';\nimport {accessors} from './native-tree.js';\nimport {ensureShadyDataForNode, shadyDataForNode} from './shady-data.js';\n\nconst {childNodes} = accessors;\n\nexport function recordInsertBefore(node, container, ref_node) {\n patchInsideElementAccessors(container);\n const containerData = ensureShadyDataForNode(container);\n if (containerData.firstChild !== undefined) {\n containerData.childNodes = null;\n }\n // handle document fragments\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n let c$ = node.childNodes;\n for (let i=0; i < c$.length; i++) {\n linkNode(c$[i], container, ref_node);\n }\n // cleanup logical dom in doc fragment.\n const nodeData = ensureShadyDataForNode(node);\n let resetTo = (nodeData.firstChild !== undefined) ? null : undefined;\n nodeData.firstChild = nodeData.lastChild = resetTo;\n nodeData.childNodes = resetTo;\n } else {\n linkNode(node, container, ref_node);\n }\n}\n\nfunction linkNode(node, container, ref_node) {\n patchOutsideElementAccessors(node);\n ref_node = ref_node || null;\n const nodeData = ensureShadyDataForNode(node);\n const containerData = ensureShadyDataForNode(container);\n const ref_nodeData = ref_node ? ensureShadyDataForNode(ref_node) : null;\n // update ref_node.previousSibling <-> node\n nodeData.previousSibling = ref_node ? ref_nodeData.previousSibling :\n container.lastChild;\n let psd = shadyDataForNode(nodeData.previousSibling);\n if (psd) {\n psd.nextSibling = node;\n }\n // update node <-> ref_node\n let nsd = shadyDataForNode(nodeData.nextSibling = ref_node);\n if (nsd) {\n nsd.previousSibling = node;\n }\n // update node <-> container\n nodeData.parentNode = container;\n if (ref_node) {\n if (ref_node === containerData.firstChild) {\n containerData.firstChild = node;\n }\n } else {\n containerData.lastChild = node;\n if (!containerData.firstChild) {\n containerData.firstChild = node;\n }\n }\n // remove caching of childNodes\n containerData.childNodes = null;\n}\n\nexport function recordRemoveChild(node, container) {\n const nodeData = ensureShadyDataForNode(node);\n const containerData = ensureShadyDataForNode(container);\n if (node === containerData.firstChild) {\n containerData.firstChild = nodeData.nextSibling;\n }\n if (node === containerData.lastChild) {\n containerData.lastChild = nodeData.previousSibling;\n }\n let p = nodeData.previousSibling;\n let n = nodeData.nextSibling;\n if (p) {\n ensureShadyDataForNode(p).nextSibling = n;\n }\n if (n) {\n ensureShadyDataForNode(n).previousSibling = p;\n }\n // When an element is removed, logical data is no longer tracked.\n // Explicitly set `undefined` here to indicate this. This is disginguished\n // from `null` which is set if info is null.\n nodeData.parentNode = nodeData.previousSibling =\n nodeData.nextSibling = undefined;\n if (containerData.childNodes !== undefined) {\n // remove caching of childNodes\n containerData.childNodes = null;\n }\n}\n\nexport let recordChildNodes = function(node, nodes) {\n const nodeData = ensureShadyDataForNode(node);\n if (nodeData.firstChild === undefined) {\n const c$ = nodes || childNodes(node);\n nodeData.firstChild = c$[0] || null;\n nodeData.lastChild = c$[c$.length-1] || null;\n patchInsideElementAccessors(node);\n for (let i=0; i<c$.length; i++) {\n const n = c$[i];\n const sd = ensureShadyDataForNode(n);\n sd.parentNode = node;\n sd.nextSibling = c$[i+1] || null;\n sd.previousSibling = c$[i-1] || null;\n patchOutsideElementAccessors(n);\n }\n }\n}","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from './utils.js';\nimport * as logicalTree from './logical-tree.js';\nimport * as nativeMethods from './native-methods.js';\nimport {accessors} from './native-tree.js';\nimport {ensureShadyDataForNode, shadyDataForNode} from './shady-data.js';\n\nconst {parentNode} = accessors;\n\n// Patched `insertBefore`. Note that all mutations that add nodes are routed\n// here. When a <slot> is added or a node is added to a host with a shadowRoot\n// with a slot, a standard dom `insert` call is aborted and `_asyncRender`\n// is called on the relevant shadowRoot. In all other cases, a standard dom\n// `insert` can be made, but the location and ref_node may need to be changed.\n/**\n * @param {Node} parent\n * @param {Node} node\n * @param {Node=} ref_node\n */\nexport function insertBefore(parent, node, ref_node) {\n if (node === parent) {\n throw Error(`Failed to execute 'appendChild' on 'Node': The new child element contains the parent.`);\n }\n if (ref_node) {\n const refData = shadyDataForNode(ref_node);\n const p = refData && refData.parentNode;\n if ((p !== undefined && p !== parent) ||\n (p === undefined && parentNode(ref_node) !== parent)) {\n throw Error(`Failed to execute 'insertBefore' on 'Node': The node ` +\n `before which the new node is to be inserted is not a child of this node.`);\n }\n }\n if (ref_node === node) {\n return node;\n }\n // remove from existing location\n if (node.parentNode) {\n // NOTE: avoid node.removeChild as this *can* trigger another patched\n // method (e.g. custom elements) and we want only the shady method to run.\n removeChild(node.parentNode, node);\n }\n // add to new parent\n let preventNativeInsert;\n let ownerRoot;\n let slotsAdded;\n if (!node['__noInsertionPoint']) {\n ownerRoot = utils.ownerShadyRootForNode(parent);\n slotsAdded = ownerRoot && findContainedSlots(node);\n if (slotsAdded) {\n ownerRoot._addSlots(slotsAdded);\n }\n }\n // if a slot is added, must render containing root.\n if (parent.localName === 'slot' || slotsAdded) {\n ownerRoot = ownerRoot || utils.ownerShadyRootForNode(parent);\n if (ownerRoot) {\n ownerRoot._asyncRender();\n }\n }\n if (utils.isTrackingLogicalChildNodes(parent)) {\n logicalTree.recordInsertBefore(node, parent, ref_node);\n // when inserting into a host with a shadowRoot with slot, use\n // `shadowRoot._asyncRender()` via `attach-shadow` module\n const parentData = shadyDataForNode(parent);\n if (hasShadowRootWithSlot(parent)) {\n parentData.root._asyncRender();\n preventNativeInsert = true;\n // when inserting into a host with shadowRoot with NO slot, do nothing\n // as the node should not be added to composed dome anywhere.\n } else if (parentData.root) {\n preventNativeInsert = true;\n }\n }\n if (!preventNativeInsert) {\n // if adding to a shadyRoot, add to host instead\n let container = utils.isShadyRoot(parent) ?\n /** @type {ShadowRoot} */(parent).host : parent;\n // if ref_node, get the ref_node that's actually in composed dom.\n if (ref_node) {\n ref_node = firstComposedNode(ref_node);\n nativeMethods.insertBefore.call(container, node, ref_node);\n } else {\n nativeMethods.appendChild.call(container, node);\n }\n }\n scheduleObserver(parent, node);\n return node;\n}\n\nfunction findContainedSlots(node) {\n let slots;\n if (node.localName === 'slot') {\n slots = [node];\n } else if (node.querySelectorAll) {\n slots = node.querySelectorAll('slot');\n }\n if (slots && slots.length) {\n return slots;\n }\n}\n\n/**\n * Patched `removeChild`. Note that all dom \"removals\" are routed here.\n * Removes the given `node` from the element's `children`.\n * This method also performs dom composition.\n * @param {Node} parent\n * @param {Node} node\n*/\nexport function removeChild(parent, node) {\n if (node.parentNode !== parent) {\n throw Error('The node to be removed is not a child of this node: ' +\n node);\n }\n let preventNativeRemove;\n let ownerRoot = utils.ownerShadyRootForNode(node);\n let removingInsertionPoint;\n const parentData = shadyDataForNode(parent);\n if (utils.isTrackingLogicalChildNodes(parent)) {\n logicalTree.recordRemoveChild(node, parent);\n if (hasShadowRootWithSlot(parent)) {\n parentData.root._asyncRender();\n preventNativeRemove = true;\n }\n }\n removeOwnerShadyRoot(node);\n // if removing slot, must render containing root\n if (ownerRoot) {\n let changeSlotContent = parent && parent.localName === 'slot';\n if (changeSlotContent) {\n preventNativeRemove = true;\n }\n removingInsertionPoint = ownerRoot._removeContainedSlots(node);\n if (removingInsertionPoint || changeSlotContent) {\n ownerRoot._asyncRender();\n }\n }\n if (!preventNativeRemove) {\n // if removing from a shadyRoot, remove form host instead\n let container = utils.isShadyRoot(parent) ?\n /** @type {ShadowRoot} */(parent).host :\n parent;\n // not guaranteed to physically be in container; e.g.\n // (1) if parent has a shadyRoot, element may or may not at distributed\n // location (could be undistributed)\n // (2) if parent is a slot, element may not ben in composed dom\n if (!(parentData.root || node.localName === 'slot') ||\n (container === parentNode(node))) {\n nativeMethods.removeChild.call(container, node);\n }\n }\n scheduleObserver(parent, null, node);\n return node;\n}\n\nfunction removeOwnerShadyRoot(node) {\n // optimization: only reset the tree if node is actually in a root\n if (hasCachedOwnerRoot(node)) {\n let c$ = node.childNodes;\n for (let i=0, l=c$.length, n; (i<l) && (n=c$[i]); i++) {\n removeOwnerShadyRoot(n);\n }\n }\n const nodeData = shadyDataForNode(node);\n if (nodeData) {\n nodeData.ownerShadyRoot = undefined;\n }\n}\n\nfunction hasCachedOwnerRoot(node) {\n const nodeData = shadyDataForNode(node);\n return Boolean(nodeData && nodeData.ownerShadyRoot !== undefined);\n}\n\n/**\n * Finds the first flattened node that is composed in the node's parent.\n * If the given node is a slot, then the first flattened node is returned\n * if it exists, otherwise advance to the node's nextSibling.\n * @param {Node} node within which to find first composed node\n * @returns {Node} first composed node\n */\nfunction firstComposedNode(node) {\n let composed = node;\n if (node && node.localName === 'slot') {\n const nodeData = shadyDataForNode(node);\n const flattened = nodeData && nodeData.flattenedNodes;\n composed = flattened && flattened.length ? flattened[0] :\n firstComposedNode(node.nextSibling);\n }\n return composed;\n}\n\nfunction hasShadowRootWithSlot(node) {\n const nodeData = shadyDataForNode(node);\n let root = nodeData && nodeData.root;\n return (root && root._hasInsertionPoint());\n}\n\n/**\n * Should be called whenever an attribute changes. If the `slot` attribute\n * changes, provokes rendering if necessary. If a `<slot>` element's `name`\n * attribute changes, updates the root's slot map and renders.\n * @param {Node} node\n * @param {string} name\n */\nfunction distributeAttributeChange(node, name) {\n if (name === 'slot') {\n const parent = node.parentNode;\n if (hasShadowRootWithSlot(parent)) {\n shadyDataForNode(parent).root._asyncRender();\n }\n } else if (node.localName === 'slot' && name === 'name') {\n let root = utils.ownerShadyRootForNode(node);\n if (root) {\n root._updateSlotName(node);\n root._asyncRender();\n }\n }\n}\n\n/**\n * @param {Node} node\n * @param {Node=} addedNode\n * @param {Node=} removedNode\n */\nfunction scheduleObserver(node, addedNode, removedNode) {\n const nodeData = shadyDataForNode(node);\n const observer = nodeData && nodeData.observer;\n if (observer) {\n if (addedNode) {\n observer.addedNodes.push(addedNode);\n }\n if (removedNode) {\n observer.removedNodes.push(removedNode);\n }\n observer.schedule();\n }\n}\n\n/**\n * @param {Node} node\n * @param {Object=} options\n */\nexport function getRootNode(node, options) { // eslint-disable-line no-unused-vars\n if (!node || !node.nodeType) {\n return;\n }\n const nodeData = ensureShadyDataForNode(node);\n let root = nodeData.ownerShadyRoot;\n if (root === undefined) {\n if (utils.isShadyRoot(node)) {\n root = node;\n nodeData.ownerShadyRoot = root;\n } else {\n let parent = node.parentNode;\n root = parent ? getRootNode(parent) : node;\n // memo-ize result for performance but only memo-ize\n // result if node is in the document. This avoids a problem where a root\n // can be cached while an element is inside a fragment.\n // If this happens and we cache the result, the value can become stale\n // because for perf we avoid processing the subtree of added fragments.\n if (nativeMethods.contains.call(document.documentElement, node)) {\n nodeData.ownerShadyRoot = root;\n }\n }\n\n }\n return root;\n}\n\n// NOTE: `query` is used primarily for ShadyDOM's querySelector impl,\n// but it's also generally useful to recurse through the element tree\n// and is used by Polymer's styling system.\n/**\n * @param {Node} node\n * @param {Function} matcher\n * @param {Function=} halter\n */\nexport function query(node, matcher, halter) {\n let list = [];\n queryElements(node.childNodes, matcher,\n halter, list);\n return list;\n}\n\nfunction queryElements(elements, matcher, halter, list) {\n for (let i=0, l=elements.length, c; (i<l) && (c=elements[i]); i++) {\n if (c.nodeType === Node.ELEMENT_NODE &&\n queryElement(c, matcher, halter, list)) {\n return true;\n }\n }\n}\n\nfunction queryElement(node, matcher, halter, list) {\n let result = matcher(node);\n if (result) {\n list.push(node);\n }\n if (halter && halter(result)) {\n return result;\n }\n queryElements(node.childNodes, matcher,\n halter, list);\n}\n\nexport function renderRootNode(element) {\n var root = element.getRootNode();\n if (utils.isShadyRoot(root)) {\n root._render();\n }\n}\n\nlet scopingShim = null;\n\nexport function setAttribute(node, attr, value) {\n if (!scopingShim) {\n scopingShim = window['ShadyCSS'] && window['ShadyCSS']['ScopingShim'];\n }\n if (scopingShim && attr === 'class') {\n scopingShim['setElementClass'](node, value);\n } else {\n nativeMethods.setAttribute.call(node, attr, value);\n distributeAttributeChange(node, attr);\n }\n}\n\nexport function removeAttribute(node, attr) {\n nativeMethods.removeAttribute.call(node, attr);\n distributeAttributeChange(node, attr);\n}\n\nexport function cloneNode(node, deep) {\n if (node.localName == 'template') {\n return nativeMethods.cloneNode.call(node, deep);\n } else {\n let n = nativeMethods.cloneNode.call(node, false);\n if (deep) {\n let c$ = node.childNodes;\n for (let i=0, nc; i < c$.length; i++) {\n nc = c$[i].cloneNode(true);\n n.appendChild(nc);\n }\n }\n return n;\n }\n}\n\n// note: Though not technically correct, we fast path `importNode`\n// when called on a node not owned by the main document.\n// This allows, for example, elements that cannot\n// contain custom elements and are therefore not likely to contain shadowRoots\n// to cloned natively. This is a fairly significant performance win.\nexport function importNode(node, deep) {\n if (node.ownerDocument !== document) {\n return nativeMethods.importNode.call(document, node, deep);\n }\n let n = nativeMethods.importNode.call(document, node, false);\n if (deep) {\n let c$ = node.childNodes;\n for (let i=0, nc; i < c$.length; i++) {\n nc = importNode(c$[i], true);\n n.appendChild(nc);\n }\n }\n return n;\n}",null,"/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from './utils.js';\nimport * as nativeMethods from './native-methods.js';\nimport {shadyDataForNode} from './shady-data.js';\n\n/*\nMake this name unique so it is unlikely to conflict with properties on objects passed to `addEventListener`\nhttps://github.com/webcomponents/shadydom/issues/173\n*/\nconst /** string */ eventWrappersName = `__eventWrappers${Date.now()}`;\n\n// https://github.com/w3c/webcomponents/issues/513#issuecomment-224183937\nlet alwaysComposed = {\n 'blur': true,\n 'focus': true,\n 'focusin': true,\n 'focusout': true,\n 'click': true,\n 'dblclick': true,\n 'mousedown': true,\n 'mouseenter': true,\n 'mouseleave': true,\n 'mousemove': true,\n 'mouseout': true,\n 'mouseover': true,\n 'mouseup': true,\n 'wheel': true,\n 'beforeinput': true,\n 'input': true,\n 'keydown': true,\n 'keyup': true,\n 'compositionstart': true,\n 'compositionupdate': true,\n 'compositionend': true,\n 'touchstart': true,\n 'touchend': true,\n 'touchmove': true,\n 'touchcancel': true,\n 'pointerover': true,\n 'pointerenter': true,\n 'pointerdown': true,\n 'pointermove': true,\n 'pointerup': true,\n 'pointercancel': true,\n 'pointerout': true,\n 'pointerleave': true,\n 'gotpointercapture': true,\n 'lostpointercapture': true,\n 'dragstart': true,\n 'drag': true,\n 'dragenter': true,\n 'dragleave': true,\n 'dragover': true,\n 'drop': true,\n 'dragend': true,\n 'DOMActivate': true,\n 'DOMFocusIn': true,\n 'DOMFocusOut': true,\n 'keypress': true\n};\n\nfunction pathComposer(startNode, composed) {\n let composedPath = [];\n let current = startNode;\n let startRoot = startNode === window ? window : startNode.getRootNode();\n while (current) {\n composedPath.push(current);\n if (current.assignedSlot) {\n current = current.assignedSlot;\n } else if (current.nodeType === Node.DOCUMENT_FRAGMENT_NODE && current.host && (composed || current !== startRoot)) {\n current = current.host;\n } else {\n current = current.parentNode;\n }\n }\n // event composedPath includes window when startNode's ownerRoot is document\n if (composedPath[composedPath.length - 1] === document) {\n composedPath.push(window);\n }\n return composedPath;\n}\n\nfunction retarget(refNode, path) {\n if (!utils.isShadyRoot) {\n return refNode;\n }\n // If ANCESTOR's root is not a shadow root or ANCESTOR's root is BASE's\n // shadow-including inclusive ancestor, return ANCESTOR.\n let refNodePath = pathComposer(refNode, true);\n let p$ = path;\n for (let i=0, ancestor, lastRoot, root, rootIdx; i < p$.length; i++) {\n ancestor = p$[i];\n root = ancestor === window ? window : ancestor.getRootNode();\n if (root !== lastRoot) {\n rootIdx = refNodePath.indexOf(root);\n lastRoot = root;\n }\n if (!utils.isShadyRoot(root) || rootIdx > -1) {\n return ancestor;\n }\n }\n}\n\nlet eventMixin = {\n\n /**\n * @this {Event}\n */\n get composed() {\n // isTrusted may not exist in this browser, so just check if isTrusted is explicitly false\n if (this.isTrusted !== false && this.__composed === undefined) {\n this.__composed = alwaysComposed[this.type];\n }\n return this.__composed || false;\n },\n\n /**\n * @this {Event}\n */\n composedPath() {\n if (!this.__composedPath) {\n this.__composedPath = pathComposer(this['__target'], this.composed);\n }\n return this.__composedPath;\n },\n\n /**\n * @this {Event}\n */\n get target() {\n return retarget(this.currentTarget, this.composedPath());\n },\n\n // http://w3c.github.io/webcomponents/spec/shadow/#event-relatedtarget-retargeting\n /**\n * @this {Event}\n */\n get relatedTarget() {\n if (!this.__relatedTarget) {\n return null;\n }\n if (!this.__relatedTargetComposedPath) {\n this.__relatedTargetComposedPath = pathComposer(this.__relatedTarget, true);\n }\n // find the deepest node in relatedTarget composed path that is in the same root with the currentTarget\n return retarget(this.currentTarget, this.__relatedTargetComposedPath);\n },\n /**\n * @this {Event}\n */\n stopPropagation() {\n Event.prototype.stopPropagation.call(this);\n this.__propagationStopped = true;\n },\n /**\n * @this {Event}\n */\n stopImmediatePropagation() {\n Event.prototype.stopImmediatePropagation.call(this);\n this.__immediatePropagationStopped = true;\n this.__propagationStopped = true;\n }\n\n};\n\nfunction mixinComposedFlag(Base) {\n // NOTE: avoiding use of `class` here so that transpiled output does not\n // try to do `Base.call` with a dom construtor.\n let klazz = function(type, options) {\n let event = new Base(type, options);\n event.__composed = options && Boolean(options['composed']);\n return event;\n }\n // put constructor properties on subclass\n utils.mixin(klazz, Base);\n klazz.prototype = Base.prototype;\n return klazz;\n}\n\nlet nonBubblingEventsToRetarget = {\n 'focus': true,\n 'blur': true\n};\n\n\n/**\n * Check if the event has been retargeted by comparing original `target`, and calculated `target`\n * @param {Event} event\n * @return {boolean} True if the original target and calculated target are the same\n */\nfunction hasRetargeted(event) {\n return event['__target'] !== event.target || event.__relatedTarget !== event.relatedTarget;\n}\n\n/**\n *\n * @param {Event} event\n * @param {Node} node\n * @param {string} phase\n */\nfunction fireHandlers(event, node, phase) {\n let hs = node.__handlers && node.__handlers[event.type] &&\n node.__handlers[event.type][phase];\n if (hs) {\n for (let i = 0, fn; (fn = hs[i]); i++) {\n if (hasRetargeted(event) && event.target === event.relatedTarget) {\n return;\n }\n fn.call(node, event);\n if (event.__immediatePropagationStopped) {\n return;\n }\n }\n }\n}\n\nfunction retargetNonBubblingEvent(e) {\n let path = e.composedPath();\n let node;\n // override `currentTarget` to let patched `target` calculate correctly\n Object.defineProperty(e, 'currentTarget', {\n get: function() {\n return node;\n },\n configurable: true\n });\n for (let i = path.length - 1; i >= 0; i--) {\n node = path[i];\n // capture phase fires all capture handlers\n fireHandlers(e, node, 'capture');\n if (e.__propagationStopped) {\n return;\n }\n }\n\n // set the event phase to `AT_TARGET` as in spec\n Object.defineProperty(e, 'eventPhase', {get() { return Event.AT_TARGET }});\n\n // the event only needs to be fired when owner roots change when iterating the event path\n // keep track of the last seen owner root\n let lastFiredRoot;\n for (let i = 0; i < path.length; i++) {\n node = path[i];\n const nodeData = shadyDataForNode(node);\n const root = nodeData && nodeData.root;\n if (i === 0 || (root && root === lastFiredRoot)) {\n fireHandlers(e, node, 'bubble');\n // don't bother with window, it doesn't have `getRootNode` and will be last in the path anyway\n if (node !== window) {\n lastFiredRoot = node.getRootNode();\n }\n if (e.__propagationStopped) {\n return;\n }\n }\n }\n}\n\nfunction listenerSettingsEqual(savedListener, node, type, capture, once, passive) {\n let {\n node: savedNode,\n type: savedType,\n capture: savedCapture,\n once: savedOnce,\n passive: savedPassive\n } = savedListener;\n return node === savedNode &&\n type === savedType &&\n capture === savedCapture &&\n once === savedOnce &&\n passive === savedPassive;\n}\n\nexport function findListener(wrappers, node, type, capture, once, passive) {\n for (let i = 0; i < wrappers.length; i++) {\n if (listenerSettingsEqual(wrappers[i], node, type, capture, once, passive)) {\n return i;\n }\n }\n return -1;\n}\n\n/**\n * Firefox can throw on accessing eventWrappers inside of `removeEventListener` during a selenium run\n * Try/Catch accessing eventWrappers to work around\n * https://bugzilla.mozilla.org/show_bug.cgi?id=1353074\n */\nfunction getEventWrappers(eventLike) {\n let wrappers = null;\n try {\n wrappers = eventLike[eventWrappersName];\n } catch (e) {} // eslint-disable-line no-empty\n return wrappers;\n}\n\n/**\n * @this {Event}\n */\nexport function addEventListener(type, fnOrObj, optionsOrCapture) {\n if (!fnOrObj) {\n return;\n }\n\n const handlerType = typeof fnOrObj;\n\n // bail if `fnOrObj` is not a function, not an object\n if (handlerType !== 'function' && handlerType !== 'object') {\n return;\n }\n\n // bail if `fnOrObj` is an object without a `handleEvent` method\n if (handlerType === 'object' && (!fnOrObj.handleEvent || typeof fnOrObj.handleEvent !== 'function')) {\n return;\n }\n\n // The callback `fn` might be used for multiple nodes/events. Since we generate\n // a wrapper function, we need to keep track of it when we remove the listener.\n // It's more efficient to store the node/type/options information as Array in\n // `fn` itself rather than the node (we assume that the same callback is used\n // for few nodes at most, whereas a node will likely have many event listeners).\n // NOTE(valdrin) invoking external functions is costly, inline has better perf.\n let capture, once, passive;\n if (optionsOrCapture && typeof optionsOrCapture === 'object') {\n capture = Boolean(optionsOrCapture.capture);\n once = Boolean(optionsOrCapture.once);\n passive = Boolean(optionsOrCapture.passive);\n } else {\n capture = Boolean(optionsOrCapture);\n once = false;\n passive = false;\n }\n // hack to let ShadyRoots have event listeners\n // event listener will be on host, but `currentTarget`\n // will be set to shadyroot for event listener\n let target = (optionsOrCapture && optionsOrCapture.__shadyTarget) || this;\n\n let wrappers = fnOrObj[eventWrappersName];\n if (wrappers) {\n // Stop if the wrapper function has already been created.\n if (findListener(wrappers, target, type, capture, once, passive) > -1) {\n return;\n }\n } else {\n fnOrObj[eventWrappersName] = [];\n }\n\n /**\n * @this {HTMLElement}\n * @param {Event} e\n */\n const wrapperFn = function(e) {\n // Support `once` option.\n if (once) {\n this.removeEventListener(type, fnOrObj, optionsOrCapture);\n }\n if (!e['__target']) {\n patchEvent(e);\n }\n let lastCurrentTargetDesc;\n if (target !== this) {\n // replace `currentTarget` to make `target` and `relatedTarget` correct for inside the shadowroot\n lastCurrentTargetDesc = Object.getOwnPropertyDescriptor(e, 'currentTarget');\n Object.defineProperty(e, 'currentTarget', {get() { return target }, configurable: true});\n }\n // There are two critera that should stop events from firing on this node\n // 1. the event is not composed and the current node is not in the same root as the target\n // 2. when bubbling, if after retargeting, relatedTarget and target point to the same node\n if (e.composed || e.composedPath().indexOf(target) > -1) {\n if (hasRetargeted(e) && e.target === e.relatedTarget) {\n if (e.eventPhase === Event.BUBBLING_PHASE) {\n e.stopImmediatePropagation();\n }\n return;\n }\n // prevent non-bubbling events from triggering bubbling handlers on shadowroot, but only if not in capture phase\n if (e.eventPhase !== Event.CAPTURING_PHASE && !e.bubbles && e.target !== target && !(target instanceof Window)) {\n return;\n }\n let ret = handlerType === 'function' ?\n fnOrObj.call(target, e) :\n (fnOrObj.handleEvent && fnOrObj.handleEvent(e));\n if (target !== this) {\n // replace the \"correct\" `currentTarget`\n if (lastCurrentTargetDesc) {\n Object.defineProperty(e, 'currentTarget', lastCurrentTargetDesc);\n lastCurrentTargetDesc = null;\n } else {\n delete e['currentTarget'];\n }\n }\n return ret;\n }\n };\n // Store the wrapper information.\n fnOrObj[eventWrappersName].push({\n // note: use target here which is either a shadowRoot\n // (when the host element is proxy'ing the event) or this element\n node: target,\n type: type,\n capture: capture,\n once: once,\n passive: passive,\n wrapperFn: wrapperFn\n });\n\n if (nonBubblingEventsToRetarget[type]) {\n this.__handlers = this.__handlers || {};\n this.__handlers[type] = this.__handlers[type] ||\n {'capture': [], 'bubble': []};\n this.__handlers[type][capture ? 'capture' : 'bubble'].push(wrapperFn);\n } else {\n let ael = this instanceof Window ? nativeMethods.windowAddEventListener :\n nativeMethods.addEventListener;\n ael.call(this, type, wrapperFn, optionsOrCapture);\n }\n}\n\n/**\n * @this {Event}\n */\nexport function removeEventListener(type, fnOrObj, optionsOrCapture) {\n if (!fnOrObj) {\n return;\n }\n\n // NOTE(valdrin) invoking external functions is costly, inline has better perf.\n let capture, once, passive;\n if (optionsOrCapture && typeof optionsOrCapture === 'object') {\n capture = Boolean(optionsOrCapture.capture);\n once = Boolean(optionsOrCapture.once);\n passive = Boolean(optionsOrCapture.passive);\n } else {\n capture = Boolean(optionsOrCapture);\n once = false;\n passive = false;\n }\n let target = (optionsOrCapture && optionsOrCapture.__shadyTarget) || this;\n // Search the wrapped function.\n let wrapperFn = undefined;\n let wrappers = getEventWrappers(fnOrObj);\n if (wrappers) {\n let idx = findListener(wrappers, target, type, capture, once, passive);\n if (idx > -1) {\n wrapperFn = wrappers.splice(idx, 1)[0].wrapperFn;\n // Cleanup.\n if (!wrappers.length) {\n fnOrObj[eventWrappersName] = undefined;\n }\n }\n }\n let rel = this instanceof Window ? nativeMethods.windowRemoveEventListener :\n nativeMethods.removeEventListener;\n rel.call(this, type, wrapperFn || fnOrObj, optionsOrCapture);\n if (wrapperFn && nonBubblingEventsToRetarget[type] &&\n this.__handlers && this.__handlers[type]) {\n const arr = this.__handlers[type][capture ? 'capture' : 'bubble'];\n const idx = arr.indexOf(wrapperFn);\n if (idx > -1) {\n arr.splice(idx, 1);\n }\n }\n}\n\nfunction activateFocusEventOverrides() {\n for (let ev in nonBubblingEventsToRetarget) {\n window.addEventListener(ev, function(e) {\n if (!e['__target']) {\n patchEvent(e);\n retargetNonBubblingEvent(e);\n }\n }, true);\n }\n}\n\nfunction patchEvent(event) {\n event['__target'] = event.target;\n event.__relatedTarget = event.relatedTarget;\n // patch event prototype if we can\n if (utils.settings.hasDescriptors) {\n utils.patchPrototype(event, eventMixin);\n // and fallback to patching instance\n } else {\n utils.extend(event, eventMixin);\n }\n}\n\nlet PatchedEvent = mixinComposedFlag(window.Event);\nlet PatchedCustomEvent = mixinComposedFlag(window.CustomEvent);\nlet PatchedMouseEvent = mixinComposedFlag(window.MouseEvent);\n\nexport function patchEvents() {\n window.Event = PatchedEvent;\n window.CustomEvent = PatchedCustomEvent;\n window.MouseEvent = PatchedMouseEvent;\n activateFocusEventOverrides();\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nfunction newSplice(index, removed, addedCount) {\n return {\n index: index,\n removed: removed,\n addedCount: addedCount\n };\n}\n\nconst EDIT_LEAVE = 0;\nconst EDIT_UPDATE = 1;\nconst EDIT_ADD = 2;\nconst EDIT_DELETE = 3;\n\n// Note: This function is *based* on the computation of the Levenshtein\n// \"edit\" distance. The one change is that \"updates\" are treated as two\n// edits - not one. With Array splices, an update is really a delete\n// followed by an add. By retaining this, we optimize for \"keeping\" the\n// maximum array items in the original array. For example:\n//\n// 'xxxx123' -> '123yyyy'\n//\n// With 1-edit updates, the shortest path would be just to update all seven\n// characters. With 2-edit updates, we delete 4, leave 3, and add 4. This\n// leaves the substring '123' intact.\nfunction calcEditDistances(current, currentStart, currentEnd,\n old, oldStart, oldEnd) {\n // \"Deletion\" columns\n let rowCount = oldEnd - oldStart + 1;\n let columnCount = currentEnd - currentStart + 1;\n let distances = new Array(rowCount);\n\n // \"Addition\" rows. Initialize null column.\n for (let i = 0; i < rowCount; i++) {\n distances[i] = new Array(columnCount);\n distances[i][0] = i;\n }\n\n // Initialize null row\n for (let j = 0; j < columnCount; j++)\n distances[0][j] = j;\n\n for (let i = 1; i < rowCount; i++) {\n for (let j = 1; j < columnCount; j++) {\n if (equals(current[currentStart + j - 1], old[oldStart + i - 1]))\n distances[i][j] = distances[i - 1][j - 1];\n else {\n let north = distances[i - 1][j] + 1;\n let west = distances[i][j - 1] + 1;\n distances[i][j] = north < west ? north : west;\n }\n }\n }\n\n return distances;\n}\n\n// This starts at the final weight, and walks \"backward\" by finding\n// the minimum previous weight recursively until the origin of the weight\n// matrix.\nfunction spliceOperationsFromEditDistances(distances) {\n let i = distances.length - 1;\n let j = distances[0].length - 1;\n let current = distances[i][j];\n let edits = [];\n while (i > 0 || j > 0) {\n if (i == 0) {\n edits.push(EDIT_ADD);\n j--;\n continue;\n }\n if (j == 0) {\n edits.push(EDIT_DELETE);\n i--;\n continue;\n }\n let northWest = distances[i - 1][j - 1];\n let west = distances[i - 1][j];\n let north = distances[i][j - 1];\n\n let min;\n if (west < north)\n min = west < northWest ? west : northWest;\n else\n min = north < northWest ? north : northWest;\n\n if (min == northWest) {\n if (northWest == current) {\n edits.push(EDIT_LEAVE);\n } else {\n edits.push(EDIT_UPDATE);\n current = northWest;\n }\n i--;\n j--;\n } else if (min == west) {\n edits.push(EDIT_DELETE);\n i--;\n current = west;\n } else {\n edits.push(EDIT_ADD);\n j--;\n current = north;\n }\n }\n\n edits.reverse();\n return edits;\n}\n\n/**\n * Splice Projection functions:\n *\n * A splice map is a representation of how a previous array of items\n * was transformed into a new array of items. Conceptually it is a list of\n * tuples of\n *\n * <index, removed, addedCount>\n *\n * which are kept in ascending index order of. The tuple represents that at\n * the |index|, |removed| sequence of items were removed, and counting forward\n * from |index|, |addedCount| items were added.\n */\n\n/**\n * Lacking individual splice mutation information, the minimal set of\n * splices can be synthesized given the previous state and final state of an\n * array. The basic approach is to calculate the edit distance matrix and\n * choose the shortest path through it.\n *\n * Complexity: O(l * p)\n * l: The length of the current array\n * p: The length of the old array\n */\nfunction calcSplices(current, currentStart, currentEnd,\n old, oldStart, oldEnd) {\n let prefixCount = 0;\n let suffixCount = 0;\n let splice;\n\n let minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart);\n if (currentStart == 0 && oldStart == 0)\n prefixCount = sharedPrefix(current, old, minLength);\n\n if (currentEnd == current.length && oldEnd == old.length)\n suffixCount = sharedSuffix(current, old, minLength - prefixCount);\n\n currentStart += prefixCount;\n oldStart += prefixCount;\n currentEnd -= suffixCount;\n oldEnd -= suffixCount;\n\n if (currentEnd - currentStart == 0 && oldEnd - oldStart == 0)\n return [];\n\n if (currentStart == currentEnd) {\n splice = newSplice(currentStart, [], 0);\n while (oldStart < oldEnd)\n splice.removed.push(old[oldStart++]);\n\n return [ splice ];\n } else if (oldStart == oldEnd)\n return [ newSplice(currentStart, [], currentEnd - currentStart) ];\n\n let ops = spliceOperationsFromEditDistances(\n calcEditDistances(current, currentStart, currentEnd,\n old, oldStart, oldEnd));\n\n splice = undefined;\n let splices = [];\n let index = currentStart;\n let oldIndex = oldStart;\n for (let i = 0; i < ops.length; i++) {\n switch(ops[i]) {\n case EDIT_LEAVE:\n if (splice) {\n splices.push(splice);\n splice = undefined;\n }\n\n index++;\n oldIndex++;\n break;\n case EDIT_UPDATE:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.addedCount++;\n index++;\n\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n case EDIT_ADD:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.addedCount++;\n index++;\n break;\n case EDIT_DELETE:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n }\n }\n\n if (splice) {\n splices.push(splice);\n }\n return splices;\n}\n\nfunction sharedPrefix(current, old, searchLength) {\n for (let i = 0; i < searchLength; i++)\n if (!equals(current[i], old[i]))\n return i;\n return searchLength;\n}\n\nfunction sharedSuffix(current, old, searchLength) {\n let index1 = current.length;\n let index2 = old.length;\n let count = 0;\n while (count < searchLength && equals(current[--index1], old[--index2]))\n count++;\n\n return count;\n}\n\nfunction equals(currentValue, previousValue) {\n return currentValue === previousValue;\n}\n\nexport function calculateSplices(current, previous) {\n return calcSplices(current, 0, current.length, previous, 0,\n previous.length);\n}\n\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/**\n * Patches elements that interacts with ShadyDOM\n * such that tree traversal and mutation apis act like they would under\n * ShadowDOM.\n *\n * This import enables seemless interaction with ShadyDOM powered\n * custom elements, enabling better interoperation with 3rd party code,\n * libraries, and frameworks that use DOM tree manipulation apis.\n */\n\nimport * as utils from './utils.js';\nimport {flush, enqueue} from './flush.js';\nimport {observeChildren, unobserveChildren, filterMutations} from './observe-changes.js';\nimport * as nativeMethods from './native-methods.js';\nimport {accessors as nativeTree} from './native-tree.js';\nimport {patchBuiltins} from './patch-builtins.js';\nimport {patchInsideElementAccessors, patchOutsideElementAccessors} from './patch-accessors.js';\nimport {patchEvents} from './patch-events.js';\nimport {ShadyRoot} from './attach-shadow.js';\n\nif (utils.settings.inUse) {\n let ShadyDOM = {\n // TODO(sorvell): remove when Polymer does not depend on this.\n 'inUse': utils.settings.inUse,\n // NOTE: old browsers without prototype accessors (very old Chrome\n // and Safari) need manually patched accessors to properly set\n // `innerHTML` and `textContent` when an element is:\n // (1) inside a shadowRoot\n // (2) does not have special (slot) children itself\n // (3) and setting the property needs to provoke distribution (because\n // a nested slot is added/removed)\n 'patch': (node) => {\n patchInsideElementAccessors(node);\n patchOutsideElementAccessors(node);\n return node;\n },\n 'isShadyRoot': utils.isShadyRoot,\n 'enqueue': enqueue,\n 'flush': flush,\n 'settings': utils.settings,\n 'filterMutations': filterMutations,\n 'observeChildren': observeChildren,\n 'unobserveChildren': unobserveChildren,\n 'nativeMethods': nativeMethods,\n 'nativeTree': nativeTree\n };\n\n window['ShadyDOM'] = ShadyDOM;\n\n // Apply patches to events...\n patchEvents();\n // Apply patches to builtins (e.g. Element.prototype) where applicable.\n patchBuiltins();\n\n window.ShadowRoot = ShadyRoot;\n}","const reservedTagList = new Set([\n 'annotation-xml',\n 'color-profile',\n 'font-face',\n 'font-face-src',\n 'font-face-uri',\n 'font-face-format',\n 'font-face-name',\n 'missing-glyph',\n]);\n\n/**\n * @param {string} localName\n * @returns {boolean}\n */\nexport function isValidCustomElementName(localName) {\n const reserved = reservedTagList.has(localName);\n const validForm = /^[a-z][.0-9_a-z]*-[\\-.0-9_a-z]*$/.test(localName);\n return !reserved && validForm;\n}\n\n/**\n * @private\n * @param {!Node} node\n * @return {boolean}\n */\nexport function isConnected(node) {\n // Use `Node#isConnected`, if defined.\n const nativeValue = node.isConnected;\n if (nativeValue !== undefined) {\n return nativeValue;\n }\n\n /** @type {?Node|undefined} */\n let current = node;\n while (current && !(current.__CE_isImportDocument || current instanceof Document)) {\n current = current.parentNode || (window.ShadowRoot && current instanceof ShadowRoot ? current.host : undefined);\n }\n return !!(current && (current.__CE_isImportDocument || current instanceof Document));\n}\n\n/**\n * @param {!Node} root\n * @param {!Node} start\n * @return {?Node}\n */\nfunction nextSiblingOrAncestorSibling(root, start) {\n let node = start;\n while (node && node !== root && !node.nextSibling) {\n node = node.parentNode;\n }\n return (!node || node === root) ? null : node.nextSibling;\n}\n\n/**\n * @param {!Node} root\n * @param {!Node} start\n * @return {?Node}\n */\nfunction nextNode(root, start) {\n return start.firstChild ? start.firstChild : nextSiblingOrAncestorSibling(root, start);\n}\n\n/**\n * @param {!Node} root\n * @param {!function(!Element)} callback\n * @param {!Set<Node>=} visitedImports\n */\nexport function walkDeepDescendantElements(root, callback, visitedImports = new Set()) {\n let node = root;\n while (node) {\n if (node.nodeType === Node.ELEMENT_NODE) {\n const element = /** @type {!Element} */(node);\n\n callback(element);\n\n const localName = element.localName;\n if (localName === 'link' && element.getAttribute('rel') === 'import') {\n // If this import (polyfilled or not) has it's root node available,\n // walk it.\n const importNode = /** @type {!Node} */ (element.import);\n if (importNode instanceof Node && !visitedImports.has(importNode)) {\n // Prevent multiple walks of the same import root.\n visitedImports.add(importNode);\n\n for (let child = importNode.firstChild; child; child = child.nextSibling) {\n walkDeepDescendantElements(child, callback, visitedImports);\n }\n }\n\n // Ignore descendants of import links to prevent attempting to walk the\n // elements created by the HTML Imports polyfill that we just walked\n // above.\n node = nextSiblingOrAncestorSibling(root, element);\n continue;\n } else if (localName === 'template') {\n // Ignore descendants of templates. There shouldn't be any descendants\n // because they will be moved into `.content` during construction in\n // browsers that support template but, in case they exist and are still\n // waiting to be moved by a polyfill, they will be ignored.\n node = nextSiblingOrAncestorSibling(root, element);\n continue;\n }\n\n // Walk shadow roots.\n const shadowRoot = element.__CE_shadowRoot;\n if (shadowRoot) {\n for (let child = shadowRoot.firstChild; child; child = child.nextSibling) {\n walkDeepDescendantElements(child, callback, visitedImports);\n }\n }\n }\n\n node = nextNode(root, node);\n }\n}\n\n/**\n * Used to suppress Closure's \"Modifying the prototype is only allowed if the\n * constructor is in the same scope\" warning without using\n * `@suppress {newCheckTypes, duplicate}` because `newCheckTypes` is too broad.\n *\n * @param {!Object} destination\n * @param {string} name\n * @param {*} value\n */\nexport function setPropertyUnchecked(destination, name, value) {\n destination[name] = value;\n}\n","import * as Utilities from './Utilities.js';\nimport CEState from './CustomElementState.js';\n\nexport default class CustomElementInternals {\n constructor() {\n /** @type {!Map<string, !CustomElementDefinition>} */\n this._localNameToDefinition = new Map();\n\n /** @type {!Map<!Function, !CustomElementDefinition>} */\n this._constructorToDefinition = new Map();\n\n /** @type {!Array<!function(!Node)>} */\n this._patches = [];\n\n /** @type {boolean} */\n this._hasPatches = false;\n }\n\n /**\n * @param {string} localName\n * @param {!CustomElementDefinition} definition\n */\n setDefinition(localName, definition) {\n this._localNameToDefinition.set(localName, definition);\n this._constructorToDefinition.set(definition.constructor, definition);\n }\n\n /**\n * @param {string} localName\n * @return {!CustomElementDefinition|undefined}\n */\n localNameToDefinition(localName) {\n return this._localNameToDefinition.get(localName);\n }\n\n /**\n * @param {!Function} constructor\n * @return {!CustomElementDefinition|undefined}\n */\n constructorToDefinition(constructor) {\n return this._constructorToDefinition.get(constructor);\n }\n\n /**\n * @param {!function(!Node)} listener\n */\n addPatch(listener) {\n this._hasPatches = true;\n this._patches.push(listener);\n }\n\n /**\n * @param {!Node} node\n */\n patchTree(node) {\n if (!this._hasPatches) return;\n\n Utilities.walkDeepDescendantElements(node, element => this.patch(element));\n }\n\n /**\n * @param {!Node} node\n */\n patch(node) {\n if (!this._hasPatches) return;\n\n if (node.__CE_patched) return;\n node.__CE_patched = true;\n\n for (let i = 0; i < this._patches.length; i++) {\n this._patches[i](node);\n }\n }\n\n /**\n * @param {!Node} root\n */\n connectTree(root) {\n const elements = [];\n\n Utilities.walkDeepDescendantElements(root, element => elements.push(element));\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i];\n if (element.__CE_state === CEState.custom) {\n this.connectedCallback(element);\n } else {\n this.upgradeElement(element);\n }\n }\n }\n\n /**\n * @param {!Node} root\n */\n disconnectTree(root) {\n const elements = [];\n\n Utilities.walkDeepDescendantElements(root, element => elements.push(element));\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i];\n if (element.__CE_state === CEState.custom) {\n this.disconnectedCallback(element);\n }\n }\n }\n\n /**\n * Upgrades all uncustomized custom elements at and below a root node for\n * which there is a definition. When custom element reaction callbacks are\n * assumed to be called synchronously (which, by the current DOM / HTML spec\n * definitions, they are *not*), callbacks for both elements customized\n * synchronously by the parser and elements being upgraded occur in the same\n * relative order.\n *\n * NOTE: This function, when used to simulate the construction of a tree that\n * is already created but not customized (i.e. by the parser), does *not*\n * prevent the element from reading the 'final' (true) state of the tree. For\n * example, the element, during truly synchronous parsing / construction would\n * see that it contains no children as they have not yet been inserted.\n * However, this function does not modify the tree, the element will\n * (incorrectly) have children. Additionally, self-modification restrictions\n * for custom element constructors imposed by the DOM spec are *not* enforced.\n *\n *\n * The following nested list shows the steps extending down from the HTML\n * spec's parsing section that cause elements to be synchronously created and\n * upgraded:\n *\n * The \"in body\" insertion mode:\n * https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody\n * - Switch on token:\n * .. other cases ..\n * -> Any other start tag\n * - [Insert an HTML element](below) for the token.\n *\n * Insert an HTML element:\n * https://html.spec.whatwg.org/multipage/syntax.html#insert-an-html-element\n * - Insert a foreign element for the token in the HTML namespace:\n * https://html.spec.whatwg.org/multipage/syntax.html#insert-a-foreign-element\n * - Create an element for a token:\n * https://html.spec.whatwg.org/multipage/syntax.html#create-an-element-for-the-token\n * - Will execute script flag is true?\n * - (Element queue pushed to the custom element reactions stack.)\n * - Create an element:\n * https://dom.spec.whatwg.org/#concept-create-element\n * - Sync CE flag is true?\n * - Constructor called.\n * - Self-modification restrictions enforced.\n * - Sync CE flag is false?\n * - (Upgrade reaction enqueued.)\n * - Attributes appended to element.\n * (`attributeChangedCallback` reactions enqueued.)\n * - Will execute script flag is true?\n * - (Element queue popped from the custom element reactions stack.\n * Reactions in the popped stack are invoked.)\n * - (Element queue pushed to the custom element reactions stack.)\n * - Insert the element:\n * https://dom.spec.whatwg.org/#concept-node-insert\n * - Shadow-including descendants are connected. During parsing\n * construction, there are no shadow-*excluding* descendants.\n * However, the constructor may have validly attached a shadow\n * tree to itself and added descendants to that shadow tree.\n * (`connectedCallback` reactions enqueued.)\n * - (Element queue popped from the custom element reactions stack.\n * Reactions in the popped stack are invoked.)\n *\n * @param {!Node} root\n * @param {{\n * visitedImports: (!Set<!Node>|undefined),\n * upgrade: (!function(!Element)|undefined),\n * }=} options\n */\n patchAndUpgradeTree(root, options = {}) {\n const visitedImports = options.visitedImports || new Set();\n const upgrade = options.upgrade || (element => this.upgradeElement(element));\n\n const elements = [];\n\n const gatherElements = element => {\n if (element.localName === 'link' && element.getAttribute('rel') === 'import') {\n // The HTML Imports polyfill sets a descendant element of the link to\n // the `import` property, specifically this is *not* a Document.\n const importNode = /** @type {?Node} */ (element.import);\n\n if (importNode instanceof Node) {\n importNode.__CE_isImportDocument = true;\n // Connected links are associated with the registry.\n importNode.__CE_hasRegistry = true;\n }\n\n if (importNode && importNode.readyState === 'complete') {\n importNode.__CE_documentLoadHandled = true;\n } else {\n // If this link's import root is not available, its contents can't be\n // walked. Wait for 'load' and walk it when it's ready.\n element.addEventListener('load', () => {\n const importNode = /** @type {!Node} */ (element.import);\n\n if (importNode.__CE_documentLoadHandled) return;\n importNode.__CE_documentLoadHandled = true;\n\n // Clone the `visitedImports` set that was populated sync during\n // the `patchAndUpgradeTree` call that caused this 'load' handler to\n // be added. Then, remove *this* link's import node so that we can\n // walk that import again, even if it was partially walked later\n // during the same `patchAndUpgradeTree` call.\n const clonedVisitedImports = new Set(visitedImports);\n clonedVisitedImports.delete(importNode);\n\n this.patchAndUpgradeTree(importNode, {visitedImports: clonedVisitedImports, upgrade});\n });\n }\n } else {\n elements.push(element);\n }\n };\n\n // `walkDeepDescendantElements` populates (and internally checks against)\n // `visitedImports` when traversing a loaded import.\n Utilities.walkDeepDescendantElements(root, gatherElements, visitedImports);\n\n if (this._hasPatches) {\n for (let i = 0; i < elements.length; i++) {\n this.patch(elements[i]);\n }\n }\n\n for (let i = 0; i < elements.length; i++) {\n upgrade(elements[i]);\n }\n }\n\n /**\n * @param {!Element} element\n */\n upgradeElement(element) {\n const currentState = element.__CE_state;\n if (currentState !== undefined) return;\n\n // Prevent elements created in documents without a browsing context from\n // upgrading.\n //\n // https://html.spec.whatwg.org/multipage/custom-elements.html#look-up-a-custom-element-definition\n // \"If document does not have a browsing context, return null.\"\n //\n // https://html.spec.whatwg.org/multipage/window-object.html#dom-document-defaultview\n // \"The defaultView IDL attribute of the Document interface, on getting,\n // must return this Document's browsing context's WindowProxy object, if\n // this Document has an associated browsing context, or null otherwise.\"\n const ownerDocument = element.ownerDocument;\n if (\n !ownerDocument.defaultView &&\n !(ownerDocument.__CE_isImportDocument && ownerDocument.__CE_hasRegistry)\n ) return;\n\n const definition = this.localNameToDefinition(element.localName);\n if (!definition) return;\n\n definition.constructionStack.push(element);\n\n const constructor = definition.constructor;\n try {\n try {\n let result = new (constructor)();\n if (result !== element) {\n throw new Error('The custom element constructor did not produce the element being upgraded.');\n }\n } finally {\n definition.constructionStack.pop();\n }\n } catch (e) {\n element.__CE_state = CEState.failed;\n throw e;\n }\n\n element.__CE_state = CEState.custom;\n element.__CE_definition = definition;\n\n if (definition.attributeChangedCallback) {\n const observedAttributes = definition.observedAttributes;\n for (let i = 0; i < observedAttributes.length; i++) {\n const name = observedAttributes[i];\n const value = element.getAttribute(name);\n if (value !== null) {\n this.attributeChangedCallback(element, name, null, value, null);\n }\n }\n }\n\n if (Utilities.isConnected(element)) {\n this.connectedCallback(element);\n }\n }\n\n /**\n * @param {!Element} element\n */\n connectedCallback(element) {\n const definition = element.__CE_definition;\n if (definition.connectedCallback) {\n definition.connectedCallback.call(element);\n }\n }\n\n /**\n * @param {!Element} element\n */\n disconnectedCallback(element) {\n const definition = element.__CE_definition;\n if (definition.disconnectedCallback) {\n definition.disconnectedCallback.call(element);\n }\n }\n\n /**\n * @param {!Element} element\n * @param {string} name\n * @param {?string} oldValue\n * @param {?string} newValue\n * @param {?string} namespace\n */\n attributeChangedCallback(element, name, oldValue, newValue, namespace) {\n const definition = element.__CE_definition;\n if (\n definition.attributeChangedCallback &&\n definition.observedAttributes.indexOf(name) > -1\n ) {\n definition.attributeChangedCallback.call(element, name, oldValue, newValue, namespace);\n }\n }\n}\n","/**\n * @enum {number}\n */\nconst CustomElementState = {\n custom: 1,\n failed: 2,\n};\n\nexport default CustomElementState;\n","import CustomElementInternals from './CustomElementInternals.js';\n\nexport default class DocumentConstructionObserver {\n constructor(internals, doc) {\n /**\n * @type {!CustomElementInternals}\n */\n this._internals = internals;\n\n /**\n * @type {!Document}\n */\n this._document = doc;\n\n /**\n * @type {MutationObserver|undefined}\n */\n this._observer = undefined;\n\n\n // Simulate tree construction for all currently accessible nodes in the\n // document.\n this._internals.patchAndUpgradeTree(this._document);\n\n if (this._document.readyState === 'loading') {\n this._observer = new MutationObserver(this._handleMutations.bind(this));\n\n // Nodes created by the parser are given to the observer *before* the next\n // task runs. Inline scripts are run in a new task. This means that the\n // observer will be able to handle the newly parsed nodes before the inline\n // script is run.\n this._observer.observe(this._document, {\n childList: true,\n subtree: true,\n });\n }\n }\n\n disconnect() {\n if (this._observer) {\n this._observer.disconnect();\n }\n }\n\n /**\n * @param {!Array<!MutationRecord>} mutations\n */\n _handleMutations(mutations) {\n // Once the document's `readyState` is 'interactive' or 'complete', all new\n // nodes created within that document will be the result of script and\n // should be handled by patching.\n const readyState = this._document.readyState;\n if (readyState === 'interactive' || readyState === 'complete') {\n this.disconnect();\n }\n\n for (let i = 0; i < mutations.length; i++) {\n const addedNodes = mutations[i].addedNodes;\n for (let j = 0; j < addedNodes.length; j++) {\n const node = addedNodes[j];\n this._internals.patchAndUpgradeTree(node);\n }\n }\n }\n}\n","import CustomElementInternals from './CustomElementInternals.js';\nimport DocumentConstructionObserver from './DocumentConstructionObserver.js';\nimport Deferred from './Deferred.js';\nimport * as Utilities from './Utilities.js';\n\n/**\n * @unrestricted\n */\nexport default class CustomElementRegistry {\n\n /**\n * @param {!CustomElementInternals} internals\n */\n constructor(internals) {\n /**\n * @private\n * @type {boolean}\n */\n this._elementDefinitionIsRunning = false;\n\n /**\n * @private\n * @type {!CustomElementInternals}\n */\n this._internals = internals;\n\n /**\n * @private\n * @type {!Map<string, !Deferred<undefined>>}\n */\n this._whenDefinedDeferred = new Map();\n\n /**\n * The default flush callback triggers the document walk synchronously.\n * @private\n * @type {!Function}\n */\n this._flushCallback = fn => fn();\n\n /**\n * @private\n * @type {boolean}\n */\n this._flushPending = false;\n\n /**\n * @private\n * @type {!Array<!CustomElementDefinition>}\n */\n this._pendingDefinitions = [];\n\n /**\n * @private\n * @type {!DocumentConstructionObserver}\n */\n this._documentConstructionObserver = new DocumentConstructionObserver(internals, document);\n }\n\n /**\n * @param {string} localName\n * @param {!Function} constructor\n */\n define(localName, constructor) {\n if (!(constructor instanceof Function)) {\n throw new TypeError('Custom element constructors must be functions.');\n }\n\n if (!Utilities.isValidCustomElementName(localName)) {\n throw new SyntaxError(`The element name '${localName}' is not valid.`);\n }\n\n if (this._internals.localNameToDefinition(localName)) {\n throw new Error(`A custom element with name '${localName}' has already been defined.`);\n }\n\n if (this._elementDefinitionIsRunning) {\n throw new Error('A custom element is already being defined.');\n }\n this._elementDefinitionIsRunning = true;\n\n let connectedCallback;\n let disconnectedCallback;\n let adoptedCallback;\n let attributeChangedCallback;\n let observedAttributes;\n try {\n /** @type {!Object} */\n const prototype = constructor.prototype;\n if (!(prototype instanceof Object)) {\n throw new TypeError('The custom element constructor\\'s prototype is not an object.');\n }\n\n function getCallback(name) {\n const callbackValue = prototype[name];\n if (callbackValue !== undefined && !(callbackValue instanceof Function)) {\n throw new Error(`The '${name}' callback must be a function.`);\n }\n return callbackValue;\n }\n\n connectedCallback = getCallback('connectedCallback');\n disconnectedCallback = getCallback('disconnectedCallback');\n adoptedCallback = getCallback('adoptedCallback');\n attributeChangedCallback = getCallback('attributeChangedCallback');\n observedAttributes = constructor['observedAttributes'] || [];\n } catch (e) {\n return;\n } finally {\n this._elementDefinitionIsRunning = false;\n }\n\n const definition = {\n localName,\n constructor,\n connectedCallback,\n disconnectedCallback,\n adoptedCallback,\n attributeChangedCallback,\n observedAttributes,\n constructionStack: [],\n };\n\n this._internals.setDefinition(localName, definition);\n this._pendingDefinitions.push(definition);\n\n // If we've already called the flush callback and it hasn't called back yet,\n // don't call it again.\n if (!this._flushPending) {\n this._flushPending = true;\n this._flushCallback(() => this._flush());\n }\n }\n\n _flush() {\n // If no new definitions were defined, don't attempt to flush. This could\n // happen if a flush callback keeps the function it is given and calls it\n // multiple times.\n if (this._flushPending === false) return;\n this._flushPending = false;\n\n const pendingDefinitions = this._pendingDefinitions;\n\n /**\n * Unupgraded elements with definitions that were defined *before* the last\n * flush, in document order.\n * @type {!Array<!Element>}\n */\n const elementsWithStableDefinitions = [];\n\n /**\n * A map from `localName`s of definitions that were defined *after* the last\n * flush to unupgraded elements matching that definition, in document order.\n * @type {!Map<string, !Array<!Element>>}\n */\n const elementsWithPendingDefinitions = new Map();\n for (let i = 0; i < pendingDefinitions.length; i++) {\n elementsWithPendingDefinitions.set(pendingDefinitions[i].localName, []);\n }\n\n this._internals.patchAndUpgradeTree(document, {\n upgrade: element => {\n // Ignore the element if it has already upgraded or failed to upgrade.\n if (element.__CE_state !== undefined) return;\n\n const localName = element.localName;\n\n // If there is an applicable pending definition for the element, add the\n // element to the list of elements to be upgraded with that definition.\n const pendingElements = elementsWithPendingDefinitions.get(localName);\n if (pendingElements) {\n pendingElements.push(element);\n // If there is *any other* applicable definition for the element, add it\n // to the list of elements with stable definitions that need to be upgraded.\n } else if (this._internals.localNameToDefinition(localName)) {\n elementsWithStableDefinitions.push(element);\n }\n },\n });\n\n // Upgrade elements with 'stable' definitions first.\n for (let i = 0; i < elementsWithStableDefinitions.length; i++) {\n this._internals.upgradeElement(elementsWithStableDefinitions[i]);\n }\n\n // Upgrade elements with 'pending' definitions in the order they were defined.\n while (pendingDefinitions.length > 0) {\n const definition = pendingDefinitions.shift();\n const localName = definition.localName;\n\n // Attempt to upgrade all applicable elements.\n const pendingUpgradableElements = elementsWithPendingDefinitions.get(definition.localName);\n for (let i = 0; i < pendingUpgradableElements.length; i++) {\n this._internals.upgradeElement(pendingUpgradableElements[i]);\n }\n\n // Resolve any promises created by `whenDefined` for the definition.\n const deferred = this._whenDefinedDeferred.get(localName);\n if (deferred) {\n deferred.resolve(undefined);\n }\n }\n }\n\n /**\n * @param {string} localName\n * @return {Function|undefined}\n */\n get(localName) {\n const definition = this._internals.localNameToDefinition(localName);\n if (definition) {\n return definition.constructor;\n }\n\n return undefined;\n }\n\n /**\n * @param {string} localName\n * @return {!Promise<undefined>}\n */\n whenDefined(localName) {\n if (!Utilities.isValidCustomElementName(localName)) {\n return Promise.reject(new SyntaxError(`'${localName}' is not a valid custom element name.`));\n }\n\n const prior = this._whenDefinedDeferred.get(localName);\n if (prior) {\n return prior.toPromise();\n }\n\n const deferred = new Deferred();\n this._whenDefinedDeferred.set(localName, deferred);\n\n const definition = this._internals.localNameToDefinition(localName);\n // Resolve immediately only if the given local name has a definition *and*\n // the full document walk to upgrade elements with that local name has\n // already happened.\n if (definition && !this._pendingDefinitions.some(d => d.localName === localName)) {\n deferred.resolve(undefined);\n }\n\n return deferred.toPromise();\n }\n\n polyfillWrapFlushCallback(outer) {\n this._documentConstructionObserver.disconnect();\n const inner = this._flushCallback;\n this._flushCallback = flush => outer(() => inner(flush));\n }\n}\n\n// Closure compiler exports.\nwindow['CustomElementRegistry'] = CustomElementRegistry;\nCustomElementRegistry.prototype['define'] = CustomElementRegistry.prototype.define;\nCustomElementRegistry.prototype['get'] = CustomElementRegistry.prototype.get;\nCustomElementRegistry.prototype['whenDefined'] = CustomElementRegistry.prototype.whenDefined;\nCustomElementRegistry.prototype['polyfillWrapFlushCallback'] = CustomElementRegistry.prototype.polyfillWrapFlushCallback;\n","/**\n * @template T\n */\nexport default class Deferred {\n constructor() {\n /**\n * @private\n * @type {T|undefined}\n */\n this._value = undefined;\n\n /**\n * @private\n * @type {Function|undefined}\n */\n this._resolve = undefined;\n\n /**\n * @private\n * @type {!Promise<T>}\n */\n this._promise = new Promise(resolve => {\n this._resolve = resolve;\n\n if (this._value) {\n resolve(this._value);\n }\n });\n }\n\n /**\n * @param {T} value\n */\n resolve(value) {\n if (this._value) {\n throw new Error('Already resolved.');\n }\n\n this._value = value;\n\n if (this._resolve) {\n this._resolve(value);\n }\n }\n\n /**\n * @return {!Promise<T>}\n */\n toPromise() {\n return this._promise;\n }\n}\n","export default {\n Document_createElement: window.Document.prototype.createElement,\n Document_createElementNS: window.Document.prototype.createElementNS,\n Document_importNode: window.Document.prototype.importNode,\n Document_prepend: window.Document.prototype['prepend'],\n Document_append: window.Document.prototype['append'],\n DocumentFragment_prepend: window.DocumentFragment.prototype['prepend'],\n DocumentFragment_append: window.DocumentFragment.prototype['append'],\n Node_cloneNode: window.Node.prototype.cloneNode,\n Node_appendChild: window.Node.prototype.appendChild,\n Node_insertBefore: window.Node.prototype.insertBefore,\n Node_removeChild: window.Node.prototype.removeChild,\n Node_replaceChild: window.Node.prototype.replaceChild,\n Node_textContent: Object.getOwnPropertyDescriptor(window.Node.prototype, 'textContent'),\n Element_attachShadow: window.Element.prototype['attachShadow'],\n Element_innerHTML: Object.getOwnPropertyDescriptor(window.Element.prototype, 'innerHTML'),\n Element_getAttribute: window.Element.prototype.getAttribute,\n Element_setAttribute: window.Element.prototype.setAttribute,\n Element_removeAttribute: window.Element.prototype.removeAttribute,\n Element_getAttributeNS: window.Element.prototype.getAttributeNS,\n Element_setAttributeNS: window.Element.prototype.setAttributeNS,\n Element_removeAttributeNS: window.Element.prototype.removeAttributeNS,\n Element_insertAdjacentElement: window.Element.prototype['insertAdjacentElement'],\n Element_insertAdjacentHTML: window.Element.prototype['insertAdjacentHTML'],\n Element_prepend: window.Element.prototype['prepend'],\n Element_append: window.Element.prototype['append'],\n Element_before: window.Element.prototype['before'],\n Element_after: window.Element.prototype['after'],\n Element_replaceWith: window.Element.prototype['replaceWith'],\n Element_remove: window.Element.prototype['remove'],\n HTMLElement: window.HTMLElement,\n HTMLElement_innerHTML: Object.getOwnPropertyDescriptor(window.HTMLElement.prototype, 'innerHTML'),\n HTMLElement_insertAdjacentElement: window.HTMLElement.prototype['insertAdjacentElement'],\n HTMLElement_insertAdjacentHTML: window.HTMLElement.prototype['insertAdjacentHTML'],\n};\n","/**\n * This class exists only to work around Closure's lack of a way to describe\n * singletons. It represents the 'already constructed marker' used in custom\n * element construction stacks.\n *\n * https://html.spec.whatwg.org/#concept-already-constructed-marker\n */\nclass AlreadyConstructedMarker {}\n\nexport default new AlreadyConstructedMarker();\n","import Native from './Native.js';\nimport CustomElementInternals from '../CustomElementInternals.js';\nimport CEState from '../CustomElementState.js';\nimport AlreadyConstructedMarker from '../AlreadyConstructedMarker.js';\n\n/**\n * @param {!CustomElementInternals} internals\n */\nexport default function(internals) {\n window['HTMLElement'] = (function() {\n /**\n * @type {function(new: HTMLElement): !HTMLElement}\n */\n function HTMLElement() {\n // This should really be `new.target` but `new.target` can't be emulated\n // in ES5. Assuming the user keeps the default value of the constructor's\n // prototype's `constructor` property, this is equivalent.\n /** @type {!Function} */\n const constructor = this.constructor;\n\n const definition = internals.constructorToDefinition(constructor);\n if (!definition) {\n throw new Error('The custom element being constructed was not registered with `customElements`.');\n }\n\n const constructionStack = definition.constructionStack;\n\n if (constructionStack.length === 0) {\n const element = Native.Document_createElement.call(document, definition.localName);\n Object.setPrototypeOf(element, constructor.prototype);\n element.__CE_state = CEState.custom;\n element.__CE_definition = definition;\n internals.patch(element);\n return element;\n }\n\n const lastIndex = constructionStack.length - 1;\n const element = constructionStack[lastIndex];\n if (element === AlreadyConstructedMarker) {\n throw new Error('The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.');\n }\n constructionStack[lastIndex] = AlreadyConstructedMarker;\n\n Object.setPrototypeOf(element, constructor.prototype);\n internals.patch(/** @type {!HTMLElement} */ (element));\n\n return element;\n }\n\n HTMLElement.prototype = Native.HTMLElement.prototype;\n\n return HTMLElement;\n })();\n};\n","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\nimport CustomElementInternals from './CustomElementInternals.js';\nimport CustomElementRegistry from './CustomElementRegistry.js';\n\nimport PatchHTMLElement from './Patch/HTMLElement.js';\nimport PatchDocument from './Patch/Document.js';\nimport PatchDocumentFragment from './Patch/DocumentFragment.js';\nimport PatchNode from './Patch/Node.js';\nimport PatchElement from './Patch/Element.js';\n\nconst priorCustomElements = window['customElements'];\n\nif (!priorCustomElements ||\n priorCustomElements['forcePolyfill'] ||\n (typeof priorCustomElements['define'] != 'function') ||\n (typeof priorCustomElements['get'] != 'function')) {\n /** @type {!CustomElementInternals} */\n const internals = new CustomElementInternals();\n\n PatchHTMLElement(internals);\n PatchDocument(internals);\n PatchDocumentFragment(internals);\n PatchNode(internals);\n PatchElement(internals);\n\n // The main document is always associated with the registry.\n document.__CE_hasRegistry = true;\n\n /** @type {!CustomElementRegistry} */\n const customElements = new CustomElementRegistry(internals);\n\n Object.defineProperty(window, 'customElements', {\n configurable: true,\n enumerable: true,\n value: customElements,\n });\n}\n","import CustomElementInternals from '../../CustomElementInternals.js';\nimport * as Utilities from '../../Utilities.js';\n\n/**\n * @typedef {{\n * prepend: !function(...(!Node|string)),\n * append: !function(...(!Node|string)),\n * }}\n */\nlet ParentNodeNativeMethods;\n\n/**\n * @param {!CustomElementInternals} internals\n * @param {!Object} destination\n * @param {!ParentNodeNativeMethods} builtIn\n */\nexport default function(internals, destination, builtIn) {\n /**\n * @param {!function(...(!Node|string))} builtInMethod\n * @return {!function(...(!Node|string))}\n */\n function appendPrependPatch(builtInMethod) {\n return function(...nodes) {\n /**\n * A copy of `nodes`, with any DocumentFragment replaced by its children.\n * @type {!Array<!Node>}\n */\n const flattenedNodes = [];\n\n /**\n * Elements in `nodes` that were connected before this call.\n * @type {!Array<!Node>}\n */\n const connectedElements = [];\n\n for (var i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n\n if (node instanceof Element && Utilities.isConnected(node)) {\n connectedElements.push(node);\n }\n\n if (node instanceof DocumentFragment) {\n for (let child = node.firstChild; child; child = child.nextSibling) {\n flattenedNodes.push(child);\n }\n } else {\n flattenedNodes.push(node);\n }\n }\n\n builtInMethod.apply(this, nodes);\n\n for (let i = 0; i < connectedElements.length; i++) {\n internals.disconnectTree(connectedElements[i]);\n }\n\n if (Utilities.isConnected(this)) {\n for (let i = 0; i < flattenedNodes.length; i++) {\n const node = flattenedNodes[i];\n if (node instanceof Element) {\n internals.connectTree(node);\n }\n }\n }\n };\n }\n\n if (builtIn.prepend !== undefined) {\n Utilities.setPropertyUnchecked(destination, 'prepend', appendPrependPatch(builtIn.prepend));\n }\n\n if (builtIn.append !== undefined) {\n Utilities.setPropertyUnchecked(destination, 'append', appendPrependPatch(builtIn.append));\n }\n};\n","import Native from './Native.js';\nimport CustomElementInternals from '../CustomElementInternals.js';\nimport * as Utilities from '../Utilities.js';\n\nimport PatchParentNode from './Interface/ParentNode.js';\n\n/**\n * @param {!CustomElementInternals} internals\n */\nexport default function(internals) {\n Utilities.setPropertyUnchecked(Document.prototype, 'createElement',\n /**\n * @this {Document}\n * @param {string} localName\n * @return {!Element}\n */\n function(localName) {\n // Only create custom elements if this document is associated with the registry.\n if (this.__CE_hasRegistry) {\n const definition = internals.localNameToDefinition(localName);\n if (definition) {\n return new (definition.constructor)();\n }\n }\n\n const result = /** @type {!Element} */\n (Native.Document_createElement.call(this, localName));\n internals.patch(result);\n return result;\n });\n\n Utilities.setPropertyUnchecked(Document.prototype, 'importNode',\n /**\n * @this {Document}\n * @param {!Node} node\n * @param {boolean=} deep\n * @return {!Node}\n */\n function(node, deep) {\n const clone = Native.Document_importNode.call(this, node, deep);\n // Only create custom elements if this document is associated with the registry.\n if (!this.__CE_hasRegistry) {\n internals.patchTree(clone);\n } else {\n internals.patchAndUpgradeTree(clone);\n }\n return clone;\n });\n\n const NS_HTML = \"http://www.w3.org/1999/xhtml\";\n\n Utilities.setPropertyUnchecked(Document.prototype, 'createElementNS',\n /**\n * @this {Document}\n * @param {?string} namespace\n * @param {string} localName\n * @return {!Element}\n */\n function(namespace, localName) {\n // Only create custom elements if this document is associated with the registry.\n if (this.__CE_hasRegistry && (namespace === null || namespace === NS_HTML)) {\n const definition = internals.localNameToDefinition(localName);\n if (definition) {\n return new (definition.constructor)();\n }\n }\n\n const result = /** @type {!Element} */\n (Native.Document_createElementNS.call(this, namespace, localName));\n internals.patch(result);\n return result;\n });\n\n PatchParentNode(internals, Document.prototype, {\n prepend: Native.Document_prepend,\n append: Native.Document_append,\n });\n};\n","import Native from './Native.js';\nimport CustomElementInternals from '../CustomElementInternals.js';\nimport * as Utilities from '../Utilities.js';\n\n/**\n * @param {!CustomElementInternals} internals\n */\nexport default function(internals) {\n // `Node#nodeValue` is implemented on `Attr`.\n // `Node#textContent` is implemented on `Attr`, `Element`.\n\n Utilities.setPropertyUnchecked(Node.prototype, 'insertBefore',\n /**\n * @this {Node}\n * @param {!Node} node\n * @param {?Node} refNode\n * @return {!Node}\n */\n function(node, refNode) {\n if (node instanceof DocumentFragment) {\n const insertedNodes = Array.prototype.slice.apply(node.childNodes);\n const nativeResult = Native.Node_insertBefore.call(this, node, refNode);\n\n // DocumentFragments can't be connected, so `disconnectTree` will never\n // need to be called on a DocumentFragment's children after inserting it.\n\n if (Utilities.isConnected(this)) {\n for (let i = 0; i < insertedNodes.length; i++) {\n internals.connectTree(insertedNodes[i]);\n }\n }\n\n return nativeResult;\n }\n\n const nodeWasConnected = Utilities.isConnected(node);\n const nativeResult = Native.Node_insertBefore.call(this, node, refNode);\n\n if (nodeWasConnected) {\n internals.disconnectTree(node);\n }\n\n if (Utilities.isConnected(this)) {\n internals.connectTree(node);\n }\n\n return nativeResult;\n });\n\n Utilities.setPropertyUnchecked(Node.prototype, 'appendChild',\n /**\n * @this {Node}\n * @param {!Node} node\n * @return {!Node}\n */\n function(node) {\n if (node instanceof DocumentFragment) {\n const insertedNodes = Array.prototype.slice.apply(node.childNodes);\n const nativeResult = Native.Node_appendChild.call(this, node);\n\n // DocumentFragments can't be connected, so `disconnectTree` will never\n // need to be called on a DocumentFragment's children after inserting it.\n\n if (Utilities.isConnected(this)) {\n for (let i = 0; i < insertedNodes.length; i++) {\n internals.connectTree(insertedNodes[i]);\n }\n }\n\n return nativeResult;\n }\n\n const nodeWasConnected = Utilities.isConnected(node);\n const nativeResult = Native.Node_appendChild.call(this, node);\n\n if (nodeWasConnected) {\n internals.disconnectTree(node);\n }\n\n if (Utilities.isConnected(this)) {\n internals.connectTree(node);\n }\n\n return nativeResult;\n });\n\n Utilities.setPropertyUnchecked(Node.prototype, 'cloneNode',\n /**\n * @this {Node}\n * @param {boolean=} deep\n * @return {!Node}\n */\n function(deep) {\n const clone = Native.Node_cloneNode.call(this, deep);\n // Only create custom elements if this element's owner document is\n // associated with the registry.\n if (!this.ownerDocument.__CE_hasRegistry) {\n internals.patchTree(clone);\n } else {\n internals.patchAndUpgradeTree(clone);\n }\n return clone;\n });\n\n Utilities.setPropertyUnchecked(Node.prototype, 'removeChild',\n /**\n * @this {Node}\n * @param {!Node} node\n * @return {!Node}\n */\n function(node) {\n const nodeWasConnected = Utilities.isConnected(node);\n const nativeResult = Native.Node_removeChild.call(this, node);\n\n if (nodeWasConnected) {\n internals.disconnectTree(node);\n }\n\n return nativeResult;\n });\n\n Utilities.setPropertyUnchecked(Node.prototype, 'replaceChild',\n /**\n * @this {Node}\n * @param {!Node} nodeToInsert\n * @param {!Node} nodeToRemove\n * @return {!Node}\n */\n function(nodeToInsert, nodeToRemove) {\n if (nodeToInsert instanceof DocumentFragment) {\n const insertedNodes = Array.prototype.slice.apply(nodeToInsert.childNodes);\n const nativeResult = Native.Node_replaceChild.call(this, nodeToInsert, nodeToRemove);\n\n // DocumentFragments can't be connected, so `disconnectTree` will never\n // need to be called on a DocumentFragment's children after inserting it.\n\n if (Utilities.isConnected(this)) {\n internals.disconnectTree(nodeToRemove);\n for (let i = 0; i < insertedNodes.length; i++) {\n internals.connectTree(insertedNodes[i]);\n }\n }\n\n return nativeResult;\n }\n\n const nodeToInsertWasConnected = Utilities.isConnected(nodeToInsert);\n const nativeResult = Native.Node_replaceChild.call(this, nodeToInsert, nodeToRemove);\n const thisIsConnected = Utilities.isConnected(this);\n\n if (thisIsConnected) {\n internals.disconnectTree(nodeToRemove);\n }\n\n if (nodeToInsertWasConnected) {\n internals.disconnectTree(nodeToInsert);\n }\n\n if (thisIsConnected) {\n internals.connectTree(nodeToInsert);\n }\n\n return nativeResult;\n });\n\n\n function patch_textContent(destination, baseDescriptor) {\n Object.defineProperty(destination, 'textContent', {\n enumerable: baseDescriptor.enumerable,\n configurable: true,\n get: baseDescriptor.get,\n set: /** @this {Node} */ function(assignedValue) {\n // If this is a text node then there are no nodes to disconnect.\n if (this.nodeType === Node.TEXT_NODE) {\n baseDescriptor.set.call(this, assignedValue);\n return;\n }\n\n let removedNodes = undefined;\n // Checking for `firstChild` is faster than reading `childNodes.length`\n // to compare with 0.\n if (this.firstChild) {\n // Using `childNodes` is faster than `children`, even though we only\n // care about elements.\n const childNodes = this.childNodes;\n const childNodesLength = childNodes.length;\n if (childNodesLength > 0 && Utilities.isConnected(this)) {\n // Copying an array by iterating is faster than using slice.\n removedNodes = new Array(childNodesLength);\n for (let i = 0; i < childNodesLength; i++) {\n removedNodes[i] = childNodes[i];\n }\n }\n }\n\n baseDescriptor.set.call(this, assignedValue);\n\n if (removedNodes) {\n for (let i = 0; i < removedNodes.length; i++) {\n internals.disconnectTree(removedNodes[i]);\n }\n }\n },\n });\n }\n\n if (Native.Node_textContent && Native.Node_textContent.get) {\n patch_textContent(Node.prototype, Native.Node_textContent);\n } else {\n internals.addPatch(function(element) {\n patch_textContent(element, {\n enumerable: true,\n configurable: true,\n // NOTE: This implementation of the `textContent` getter assumes that\n // text nodes' `textContent` getter will not be patched.\n get: /** @this {Node} */ function() {\n /** @type {!Array<string>} */\n const parts = [];\n\n for (let i = 0; i < this.childNodes.length; i++) {\n parts.push(this.childNodes[i].textContent);\n }\n\n return parts.join('');\n },\n set: /** @this {Node} */ function(assignedValue) {\n while (this.firstChild) {\n Native.Node_removeChild.call(this, this.firstChild);\n }\n Native.Node_appendChild.call(this, document.createTextNode(assignedValue));\n },\n });\n });\n }\n};\n","import CustomElementInternals from '../../CustomElementInternals.js';\nimport * as Utilities from '../../Utilities.js';\n\n/**\n * @typedef {{\n * before: !function(...(!Node|string)),\n * after: !function(...(!Node|string)),\n * replaceWith: !function(...(!Node|string)),\n * remove: !function(),\n * }}\n */\nlet ChildNodeNativeMethods;\n\n/**\n * @param {!CustomElementInternals} internals\n * @param {!Object} destination\n * @param {!ChildNodeNativeMethods} builtIn\n */\nexport default function(internals, destination, builtIn) {\n /**\n * @param {!function(...(!Node|string))} builtInMethod\n * @return {!function(...(!Node|string))}\n */\n function beforeAfterPatch(builtInMethod) {\n return function(...nodes) {\n /**\n * A copy of `nodes`, with any DocumentFragment replaced by its children.\n * @type {!Array<!Node>}\n */\n const flattenedNodes = [];\n\n /**\n * Elements in `nodes` that were connected before this call.\n * @type {!Array<!Node>}\n */\n const connectedElements = [];\n\n for (var i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n\n if (node instanceof Element && Utilities.isConnected(node)) {\n connectedElements.push(node);\n }\n\n if (node instanceof DocumentFragment) {\n for (let child = node.firstChild; child; child = child.nextSibling) {\n flattenedNodes.push(child);\n }\n } else {\n flattenedNodes.push(node);\n }\n }\n\n builtInMethod.apply(this, nodes);\n\n for (let i = 0; i < connectedElements.length; i++) {\n internals.disconnectTree(connectedElements[i]);\n }\n\n if (Utilities.isConnected(this)) {\n for (let i = 0; i < flattenedNodes.length; i++) {\n const node = flattenedNodes[i];\n if (node instanceof Element) {\n internals.connectTree(node);\n }\n }\n }\n };\n }\n\n if (builtIn.before !== undefined) {\n Utilities.setPropertyUnchecked(destination, 'before', beforeAfterPatch(builtIn.before));\n }\n\n if (builtIn.before !== undefined) {\n Utilities.setPropertyUnchecked(destination, 'after', beforeAfterPatch(builtIn.after));\n }\n\n if (builtIn.replaceWith !== undefined) {\n Utilities.setPropertyUnchecked(destination, 'replaceWith',\n /**\n * @param {...(!Node|string)} nodes\n */\n function(...nodes) {\n /**\n * A copy of `nodes`, with any DocumentFragment replaced by its children.\n * @type {!Array<!Node>}\n */\n const flattenedNodes = [];\n\n /**\n * Elements in `nodes` that were connected before this call.\n * @type {!Array<!Node>}\n */\n const connectedElements = [];\n\n for (var i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n\n if (node instanceof Element && Utilities.isConnected(node)) {\n connectedElements.push(node);\n }\n\n if (node instanceof DocumentFragment) {\n for (let child = node.firstChild; child; child = child.nextSibling) {\n flattenedNodes.push(child);\n }\n } else {\n flattenedNodes.push(node);\n }\n }\n\n const wasConnected = Utilities.isConnected(this);\n\n builtIn.replaceWith.apply(this, nodes);\n\n for (let i = 0; i < connectedElements.length; i++) {\n internals.disconnectTree(connectedElements[i]);\n }\n\n if (wasConnected) {\n internals.disconnectTree(this);\n for (let i = 0; i < flattenedNodes.length; i++) {\n const node = flattenedNodes[i];\n if (node instanceof Element) {\n internals.connectTree(node);\n }\n }\n }\n });\n }\n\n if (builtIn.remove !== undefined) {\n Utilities.setPropertyUnchecked(destination, 'remove',\n function() {\n const wasConnected = Utilities.isConnected(this);\n\n builtIn.remove.call(this);\n\n if (wasConnected) {\n internals.disconnectTree(this);\n }\n });\n }\n};\n","import Native from './Native.js';\nimport CustomElementInternals from '../CustomElementInternals.js';\nimport CEState from '../CustomElementState.js';\nimport * as Utilities from '../Utilities.js';\n\nimport PatchParentNode from './Interface/ParentNode.js';\nimport PatchChildNode from './Interface/ChildNode.js';\n\n/**\n * @param {!CustomElementInternals} internals\n */\nexport default function(internals) {\n if (Native.Element_attachShadow) {\n Utilities.setPropertyUnchecked(Element.prototype, 'attachShadow',\n /**\n * @this {Element}\n * @param {!{mode: string}} init\n * @return {ShadowRoot}\n */\n function(init) {\n const shadowRoot = Native.Element_attachShadow.call(this, init);\n this.__CE_shadowRoot = shadowRoot;\n return shadowRoot;\n });\n }\n\n\n function patch_innerHTML(destination, baseDescriptor) {\n Object.defineProperty(destination, 'innerHTML', {\n enumerable: baseDescriptor.enumerable,\n configurable: true,\n get: baseDescriptor.get,\n set: /** @this {Element} */ function(htmlString) {\n const isConnected = Utilities.isConnected(this);\n\n // NOTE: In IE11, when using the native `innerHTML` setter, all nodes\n // that were previously descendants of the context element have all of\n // their children removed as part of the set - the entire subtree is\n // 'disassembled'. This work around walks the subtree *before* using the\n // native setter.\n /** @type {!Array<!Element>|undefined} */\n let removedElements = undefined;\n if (isConnected) {\n removedElements = [];\n Utilities.walkDeepDescendantElements(this, element => {\n if (element !== this) {\n removedElements.push(element);\n }\n });\n }\n\n baseDescriptor.set.call(this, htmlString);\n\n if (removedElements) {\n for (let i = 0; i < removedElements.length; i++) {\n const element = removedElements[i];\n if (element.__CE_state === CEState.custom) {\n internals.disconnectedCallback(element);\n }\n }\n }\n\n // Only create custom elements if this element's owner document is\n // associated with the registry.\n if (!this.ownerDocument.__CE_hasRegistry) {\n internals.patchTree(this);\n } else {\n internals.patchAndUpgradeTree(this);\n }\n return htmlString;\n },\n });\n }\n\n if (Native.Element_innerHTML && Native.Element_innerHTML.get) {\n patch_innerHTML(Element.prototype, Native.Element_innerHTML);\n } else if (Native.HTMLElement_innerHTML && Native.HTMLElement_innerHTML.get) {\n patch_innerHTML(HTMLElement.prototype, Native.HTMLElement_innerHTML);\n } else {\n\n internals.addPatch(function(element) {\n patch_innerHTML(element, {\n enumerable: true,\n configurable: true,\n // Implements getting `innerHTML` by performing an unpatched `cloneNode`\n // of the element and returning the resulting element's `innerHTML`.\n // TODO: Is this too expensive?\n get: /** @this {Element} */ function() {\n return Native.Node_cloneNode.call(this, true).innerHTML;\n },\n // Implements setting `innerHTML` by creating an unpatched element,\n // setting `innerHTML` of that element and replacing the target\n // element's children with those of the unpatched element.\n set: /** @this {Element} */ function(assignedValue) {\n // NOTE: re-route to `content` for `template` elements.\n // We need to do this because `template.appendChild` does not\n // route into `template.content`.\n const isTemplate = (this.localName === 'template');\n /** @type {!Node} */\n const content = isTemplate ? (/** @type {!HTMLTemplateElement} */\n (this)).content : this;\n /** @type {!Node} */\n const rawElement = Native.Document_createElement.call(document,\n this.localName);\n rawElement.innerHTML = assignedValue;\n\n while (content.childNodes.length > 0) {\n Native.Node_removeChild.call(content, content.childNodes[0]);\n }\n const container = isTemplate ? rawElement.content : rawElement;\n while (container.childNodes.length > 0) {\n Native.Node_appendChild.call(content, container.childNodes[0]);\n }\n },\n });\n });\n }\n\n\n Utilities.setPropertyUnchecked(Element.prototype, 'setAttribute',\n /**\n * @this {Element}\n * @param {string} name\n * @param {string} newValue\n */\n function(name, newValue) {\n // Fast path for non-custom elements.\n if (this.__CE_state !== CEState.custom) {\n return Native.Element_setAttribute.call(this, name, newValue);\n }\n\n const oldValue = Native.Element_getAttribute.call(this, name);\n Native.Element_setAttribute.call(this, name, newValue);\n newValue = Native.Element_getAttribute.call(this, name);\n internals.attributeChangedCallback(this, name, oldValue, newValue, null);\n });\n\n Utilities.setPropertyUnchecked(Element.prototype, 'setAttributeNS',\n /**\n * @this {Element}\n * @param {?string} namespace\n * @param {string} name\n * @param {string} newValue\n */\n function(namespace, name, newValue) {\n // Fast path for non-custom elements.\n if (this.__CE_state !== CEState.custom) {\n return Native.Element_setAttributeNS.call(this, namespace, name, newValue);\n }\n\n const oldValue = Native.Element_getAttributeNS.call(this, namespace, name);\n Native.Element_setAttributeNS.call(this, namespace, name, newValue);\n newValue = Native.Element_getAttributeNS.call(this, namespace, name);\n internals.attributeChangedCallback(this, name, oldValue, newValue, namespace);\n });\n\n Utilities.setPropertyUnchecked(Element.prototype, 'removeAttribute',\n /**\n * @this {Element}\n * @param {string} name\n */\n function(name) {\n // Fast path for non-custom elements.\n if (this.__CE_state !== CEState.custom) {\n return Native.Element_removeAttribute.call(this, name);\n }\n\n const oldValue = Native.Element_getAttribute.call(this, name);\n Native.Element_removeAttribute.call(this, name);\n if (oldValue !== null) {\n internals.attributeChangedCallback(this, name, oldValue, null, null);\n }\n });\n\n Utilities.setPropertyUnchecked(Element.prototype, 'removeAttributeNS',\n /**\n * @this {Element}\n * @param {?string} namespace\n * @param {string} name\n */\n function(namespace, name) {\n // Fast path for non-custom elements.\n if (this.__CE_state !== CEState.custom) {\n return Native.Element_removeAttributeNS.call(this, namespace, name);\n }\n\n const oldValue = Native.Element_getAttributeNS.call(this, namespace, name);\n Native.Element_removeAttributeNS.call(this, namespace, name);\n // In older browsers, `Element#getAttributeNS` may return the empty string\n // instead of null if the attribute does not exist. For details, see;\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNS#Notes\n const newValue = Native.Element_getAttributeNS.call(this, namespace, name);\n if (oldValue !== newValue) {\n internals.attributeChangedCallback(this, name, oldValue, newValue, namespace);\n }\n });\n\n\n function patch_insertAdjacentElement(destination, baseMethod) {\n Utilities.setPropertyUnchecked(destination, 'insertAdjacentElement',\n /**\n * @this {Element}\n * @param {string} position\n * @param {!Element} element\n * @return {?Element}\n */\n function(position, element) {\n const wasConnected = Utilities.isConnected(element);\n const insertedElement = /** @type {!Element} */\n (baseMethod.call(this, position, element));\n\n if (wasConnected) {\n internals.disconnectTree(element);\n }\n\n if (Utilities.isConnected(insertedElement)) {\n internals.connectTree(element);\n }\n return insertedElement;\n });\n }\n\n if (Native.HTMLElement_insertAdjacentElement) {\n patch_insertAdjacentElement(HTMLElement.prototype, Native.HTMLElement_insertAdjacentElement);\n } else if (Native.Element_insertAdjacentElement) {\n patch_insertAdjacentElement(Element.prototype, Native.Element_insertAdjacentElement);\n } else {\n console.warn('Custom Elements: `Element#insertAdjacentElement` was not patched.');\n }\n\n\n function patch_insertAdjacentHTML(destination, baseMethod) {\n /**\n * Patches and upgrades all nodes which are siblings between `start`\n * (inclusive) and `end` (exclusive). If `end` is `null`, then all siblings\n * following `start` will be patched and upgraded.\n * @param {!Node} start\n * @param {?Node} end\n */\n function upgradeNodesInRange(start, end) {\n const nodes = [];\n for (let node = start; node !== end; node = node.nextSibling) {\n nodes.push(node);\n }\n for (let i = 0; i < nodes.length; i++) {\n internals.patchAndUpgradeTree(nodes[i]);\n }\n }\n\n Utilities.setPropertyUnchecked(destination, 'insertAdjacentHTML',\n /**\n * @this {Element}\n * @param {string} position\n * @param {string} text\n */\n function(position, text) {\n position = position.toLowerCase();\n\n if (position === \"beforebegin\") {\n const marker = this.previousSibling;\n baseMethod.call(this, position, text);\n upgradeNodesInRange(\n /** @type {!Node} */ (marker || this.parentNode.firstChild), this);\n } else if (position === \"afterbegin\") {\n const marker = this.firstChild;\n baseMethod.call(this, position, text);\n upgradeNodesInRange(/** @type {!Node} */ (this.firstChild), marker);\n } else if (position === \"beforeend\") {\n const marker = this.lastChild;\n baseMethod.call(this, position, text);\n upgradeNodesInRange(marker || this.firstChild, null);\n } else if (position === \"afterend\") {\n const marker = this.nextSibling;\n baseMethod.call(this, position, text);\n upgradeNodesInRange(/** @type {!Node} */ (this.nextSibling), marker);\n } else {\n throw new SyntaxError(`The value provided (${String(position)}) is ` +\n \"not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.\");\n }\n });\n }\n\n if (Native.HTMLElement_insertAdjacentHTML) {\n patch_insertAdjacentHTML(HTMLElement.prototype, Native.HTMLElement_insertAdjacentHTML);\n } else if (Native.Element_insertAdjacentHTML) {\n patch_insertAdjacentHTML(Element.prototype, Native.Element_insertAdjacentHTML);\n } else {\n console.warn('Custom Elements: `Element#insertAdjacentHTML` was not patched.');\n }\n\n\n PatchParentNode(internals, Element.prototype, {\n prepend: Native.Element_prepend,\n append: Native.Element_append,\n });\n\n PatchChildNode(internals, Element.prototype, {\n before: Native.Element_before,\n after: Native.Element_after,\n replaceWith: Native.Element_replaceWith,\n remove: Native.Element_remove,\n });\n};\n","import CustomElementInternals from '../CustomElementInternals.js';\nimport Native from './Native.js';\nimport PatchParentNode from './Interface/ParentNode.js';\n\n/**\n * @param {!CustomElementInternals} internals\n */\nexport default function(internals) {\n PatchParentNode(internals, DocumentFragment.prototype, {\n prepend: Native.DocumentFragment_prepend,\n append: Native.DocumentFragment_append,\n });\n};\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/*\nExtremely simple css parser. Intended to be not more than what we need\nand definitely not necessarily correct =).\n*/\n\n'use strict';\n\n/** @unrestricted */\nclass StyleNode {\n constructor() {\n /** @type {number} */\n this['start'] = 0;\n /** @type {number} */\n this['end'] = 0;\n /** @type {StyleNode} */\n this['previous'] = null;\n /** @type {StyleNode} */\n this['parent'] = null;\n /** @type {Array<StyleNode>} */\n this['rules'] = null;\n /** @type {string} */\n this['parsedCssText'] = '';\n /** @type {string} */\n this['cssText'] = '';\n /** @type {boolean} */\n this['atRule'] = false;\n /** @type {number} */\n this['type'] = 0;\n /** @type {string} */\n this['keyframesName'] = '';\n /** @type {string} */\n this['selector'] = '';\n /** @type {string} */\n this['parsedSelector'] = '';\n }\n}\n\nexport {StyleNode}\n\n// given a string of css, return a simple rule tree\n/**\n * @param {string} text\n * @return {StyleNode}\n */\nexport function parse(text) {\n text = clean(text);\n return parseCss(lex(text), text);\n}\n\n// remove stuff we don't care about that may hinder parsing\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction clean(cssText) {\n return cssText.replace(RX.comments, '').replace(RX.port, '');\n}\n\n// super simple {...} lexer that returns a node tree\n/**\n * @param {string} text\n * @return {StyleNode}\n */\nfunction lex(text) {\n let root = new StyleNode();\n root['start'] = 0;\n root['end'] = text.length\n let n = root;\n for (let i = 0, l = text.length; i < l; i++) {\n if (text[i] === OPEN_BRACE) {\n if (!n['rules']) {\n n['rules'] = [];\n }\n let p = n;\n let previous = p['rules'][p['rules'].length - 1] || null;\n n = new StyleNode();\n n['start'] = i + 1;\n n['parent'] = p;\n n['previous'] = previous;\n p['rules'].push(n);\n } else if (text[i] === CLOSE_BRACE) {\n n['end'] = i + 1;\n n = n['parent'] || root;\n }\n }\n return root;\n}\n\n// add selectors/cssText to node tree\n/**\n * @param {StyleNode} node\n * @param {string} text\n * @return {StyleNode}\n */\nfunction parseCss(node, text) {\n let t = text.substring(node['start'], node['end'] - 1);\n node['parsedCssText'] = node['cssText'] = t.trim();\n if (node['parent']) {\n let ss = node['previous'] ? node['previous']['end'] : node['parent']['start'];\n t = text.substring(ss, node['start'] - 1);\n t = _expandUnicodeEscapes(t);\n t = t.replace(RX.multipleSpaces, ' ');\n // TODO(sorvell): ad hoc; make selector include only after last ;\n // helps with mixin syntax\n t = t.substring(t.lastIndexOf(';') + 1);\n let s = node['parsedSelector'] = node['selector'] = t.trim();\n node['atRule'] = (s.indexOf(AT_START) === 0);\n // note, support a subset of rule types...\n if (node['atRule']) {\n if (s.indexOf(MEDIA_START) === 0) {\n node['type'] = types.MEDIA_RULE;\n } else if (s.match(RX.keyframesRule)) {\n node['type'] = types.KEYFRAMES_RULE;\n node['keyframesName'] =\n node['selector'].split(RX.multipleSpaces).pop();\n }\n } else {\n if (s.indexOf(VAR_START) === 0) {\n node['type'] = types.MIXIN_RULE;\n } else {\n node['type'] = types.STYLE_RULE;\n }\n }\n }\n let r$ = node['rules'];\n if (r$) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n parseCss(r, text);\n }\n }\n return node;\n}\n\n/**\n * conversion of sort unicode escapes with spaces like `\\33 ` (and longer) into\n * expanded form that doesn't require trailing space `\\000033`\n * @param {string} s\n * @return {string}\n */\nfunction _expandUnicodeEscapes(s) {\n return s.replace(/\\\\([0-9a-f]{1,6})\\s/gi, function() {\n let code = arguments[1],\n repeat = 6 - code.length;\n while (repeat--) {\n code = '0' + code;\n }\n return '\\\\' + code;\n });\n}\n\n/**\n * stringify parsed css.\n * @param {StyleNode} node\n * @param {boolean=} preserveProperties\n * @param {string=} text\n * @return {string}\n */\nexport function stringify(node, preserveProperties, text = '') {\n // calc rule cssText\n let cssText = '';\n if (node['cssText'] || node['rules']) {\n let r$ = node['rules'];\n if (r$ && !_hasMixinRules(r$)) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n cssText = stringify(r, preserveProperties, cssText);\n }\n } else {\n cssText = preserveProperties ? node['cssText'] :\n removeCustomProps(node['cssText']);\n cssText = cssText.trim();\n if (cssText) {\n cssText = ' ' + cssText + '\\n';\n }\n }\n }\n // emit rule if there is cssText\n if (cssText) {\n if (node['selector']) {\n text += node['selector'] + ' ' + OPEN_BRACE + '\\n';\n }\n text += cssText;\n if (node['selector']) {\n text += CLOSE_BRACE + '\\n\\n';\n }\n }\n return text;\n}\n\n/**\n * @param {Array<StyleNode>} rules\n * @return {boolean}\n */\nfunction _hasMixinRules(rules) {\n let r = rules[0];\n return Boolean(r) && Boolean(r['selector']) && r['selector'].indexOf(VAR_START) === 0;\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction removeCustomProps(cssText) {\n cssText = removeCustomPropAssignment(cssText);\n return removeCustomPropApply(cssText);\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nexport function removeCustomPropAssignment(cssText) {\n return cssText\n .replace(RX.customProp, '')\n .replace(RX.mixinProp, '');\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction removeCustomPropApply(cssText) {\n return cssText\n .replace(RX.mixinApply, '')\n .replace(RX.varApply, '');\n}\n\n/** @enum {number} */\nexport const types = {\n STYLE_RULE: 1,\n KEYFRAMES_RULE: 7,\n MEDIA_RULE: 4,\n MIXIN_RULE: 1000\n}\n\nconst OPEN_BRACE = '{';\nconst CLOSE_BRACE = '}';\n\n// helper regexp's\nconst RX = {\n comments: /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//gim,\n port: /@import[^;]*;/gim,\n customProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\\n]|$)/gim,\n mixinProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\\n]|$)?/gim,\n mixinApply: /@apply\\s*\\(?[^);]*\\)?\\s*(?:[;\\n]|$)?/gim,\n varApply: /[^;:]*?:[^;]*?var\\([^;]*\\)(?:[;\\n]|$)?/gim,\n keyframesRule: /^@[^\\s]*keyframes/,\n multipleSpaces: /\\s+/g\n}\n\nconst VAR_START = '--';\nconst MEDIA_START = '@media';\nconst AT_START = '@';\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nexport let nativeShadow = !(window['ShadyDOM'] && window['ShadyDOM']['inUse']);\nexport let nativeCssVariables;\n\n/**\n * @param {(ShadyCSSOptions | ShadyCSSInterface)=} settings\n */\nfunction calcCssVariables(settings) {\n if (settings && settings['shimcssproperties']) {\n nativeCssVariables = false;\n } else {\n // chrome 49 has semi-working css vars, check if box-shadow works\n // safari 9.1 has a recalc bug: https://bugs.webkit.org/show_bug.cgi?id=155782\n // However, shim css custom properties are only supported with ShadyDOM enabled,\n // so fall back on native if we do not detect ShadyDOM\n // Edge 15: custom properties used in ::before and ::after will also be used in the parent element\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12414257/\n nativeCssVariables = nativeShadow || Boolean(!navigator.userAgent.match(/AppleWebKit\\/601|Edge\\/15/) &&\n window.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)'));\n }\n}\n\nif (window.ShadyCSS && window.ShadyCSS.nativeCss !== undefined) {\n nativeCssVariables = window.ShadyCSS.nativeCss;\n} else if (window.ShadyCSS) {\n calcCssVariables(window.ShadyCSS);\n // reset window variable to let ShadyCSS API take its place\n window.ShadyCSS = undefined;\n} else {\n calcCssVariables(window['WebComponents'] && window['WebComponents']['flags']);\n}","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nexport const VAR_ASSIGN = /(?:^|[;\\s{]\\s*)(--[\\w-]*?)\\s*:\\s*(?:((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^)]*?\\)|[^};{])+)|\\{([^}]*)\\}(?:(?=[;\\s}])|$))/gi;\nexport const MIXIN_MATCH = /(?:^|\\W+)@apply\\s*\\(?([^);\\n]*)\\)?/gi;\nexport const VAR_CONSUMED = /(--[\\w-]+)\\s*([:,;)]|$)/gi;\nexport const ANIMATION_MATCH = /(animation\\s*:)|(animation-name\\s*:)/;\nexport const MEDIA_MATCH = /@media\\s(.*)/;\nexport const IS_VAR = /^--/;\nexport const BRACKETED = /\\{[^}]*\\}/g;\nexport const HOST_PREFIX = '(?:^|[^.#[:])';\nexport const HOST_SUFFIX = '($|[.:[\\\\s>+~])';\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\n/** @type {!Set<string>} */\nconst styleTextSet = new Set();\n\nexport const scopingAttribute = 'shady-unscoped';\n\n/**\n * Add a specifically-marked style to the document directly, and only one copy of that style.\n *\n * @param {!HTMLStyleElement} style\n * @return {undefined}\n */\nexport function processUnscopedStyle(style) {\n const text = style.textContent;\n if (!styleTextSet.has(text)) {\n styleTextSet.add(text);\n const newStyle = style.cloneNode(true);\n document.head.appendChild(newStyle);\n }\n}\n\n/**\n * Check if a style is supposed to be unscoped\n * @param {!HTMLStyleElement} style\n * @return {boolean} true if the style has the unscoping attribute\n */\nexport function isUnscopedStyle(style) {\n return style.hasAttribute(scopingAttribute);\n}","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {nativeShadow, nativeCssVariables} from './style-settings.js';\nimport {parse, stringify, types, StyleNode} from './css-parse.js'; // eslint-disable-line no-unused-vars\nimport {MEDIA_MATCH} from './common-regex.js';\nimport {processUnscopedStyle, isUnscopedStyle} from './unscoped-style-handler.js';\n\n/**\n * @param {string|StyleNode} rules\n * @param {function(StyleNode)=} callback\n * @return {string}\n */\nexport function toCssText (rules, callback) {\n if (!rules) {\n return '';\n }\n if (typeof rules === 'string') {\n rules = parse(rules);\n }\n if (callback) {\n forEachRule(rules, callback);\n }\n return stringify(rules, nativeCssVariables);\n}\n\n/**\n * @param {HTMLStyleElement} style\n * @return {StyleNode}\n */\nexport function rulesForStyle(style) {\n if (!style['__cssRules'] && style.textContent) {\n style['__cssRules'] = parse(style.textContent);\n }\n return style['__cssRules'] || null;\n}\n\n// Tests if a rule is a keyframes selector, which looks almost exactly\n// like a normal selector but is not (it has nothing to do with scoping\n// for example).\n/**\n * @param {StyleNode} rule\n * @return {boolean}\n */\nexport function isKeyframesSelector(rule) {\n return Boolean(rule['parent']) &&\n rule['parent']['type'] === types.KEYFRAMES_RULE;\n}\n\n/**\n * @param {StyleNode} node\n * @param {Function=} styleRuleCallback\n * @param {Function=} keyframesRuleCallback\n * @param {boolean=} onlyActiveRules\n */\nexport function forEachRule(node, styleRuleCallback, keyframesRuleCallback, onlyActiveRules) {\n if (!node) {\n return;\n }\n let skipRules = false;\n let type = node['type'];\n if (onlyActiveRules) {\n if (type === types.MEDIA_RULE) {\n let matchMedia = node['selector'].match(MEDIA_MATCH);\n if (matchMedia) {\n // if rule is a non matching @media rule, skip subrules\n if (!window.matchMedia(matchMedia[1]).matches) {\n skipRules = true;\n }\n }\n }\n }\n if (type === types.STYLE_RULE) {\n styleRuleCallback(node);\n } else if (keyframesRuleCallback &&\n type === types.KEYFRAMES_RULE) {\n keyframesRuleCallback(node);\n } else if (type === types.MIXIN_RULE) {\n skipRules = true;\n }\n let r$ = node['rules'];\n if (r$ && !skipRules) {\n for (let i=0, l=r$.length, r; (i<l) && (r=r$[i]); i++) {\n forEachRule(r, styleRuleCallback, keyframesRuleCallback, onlyActiveRules);\n }\n }\n}\n\n// add a string of cssText to the document.\n/**\n * @param {string} cssText\n * @param {string} moniker\n * @param {Node} target\n * @param {Node} contextNode\n * @return {HTMLStyleElement}\n */\nexport function applyCss(cssText, moniker, target, contextNode) {\n let style = createScopeStyle(cssText, moniker);\n applyStyle(style, target, contextNode);\n return style;\n}\n\n/**\n * @param {string} cssText\n * @param {string} moniker\n * @return {HTMLStyleElement}\n */\nexport function createScopeStyle(cssText, moniker) {\n let style = /** @type {HTMLStyleElement} */(document.createElement('style'));\n if (moniker) {\n style.setAttribute('scope', moniker);\n }\n style.textContent = cssText;\n return style;\n}\n\n/**\n * Track the position of the last added style for placing placeholders\n * @type {Node}\n */\nlet lastHeadApplyNode = null;\n\n// insert a comment node as a styling position placeholder.\n/**\n * @param {string} moniker\n * @return {!Comment}\n */\nexport function applyStylePlaceHolder(moniker) {\n let placeHolder = document.createComment(' Shady DOM styles for ' +\n moniker + ' ');\n let after = lastHeadApplyNode ?\n lastHeadApplyNode['nextSibling'] : null;\n let scope = document.head;\n scope.insertBefore(placeHolder, after || scope.firstChild);\n lastHeadApplyNode = placeHolder;\n return placeHolder;\n}\n\n/**\n * @param {HTMLStyleElement} style\n * @param {?Node} target\n * @param {?Node} contextNode\n */\nexport function applyStyle(style, target, contextNode) {\n target = target || document.head;\n let after = (contextNode && contextNode.nextSibling) ||\n target.firstChild;\n target.insertBefore(style, after);\n if (!lastHeadApplyNode) {\n lastHeadApplyNode = style;\n } else {\n // only update lastHeadApplyNode if the new style is inserted after the old lastHeadApplyNode\n let position = style.compareDocumentPosition(lastHeadApplyNode);\n if (position === Node.DOCUMENT_POSITION_PRECEDING) {\n lastHeadApplyNode = style;\n }\n }\n}\n\n/**\n * @param {string} buildType\n * @return {boolean}\n */\nexport function isTargetedBuild(buildType) {\n return nativeShadow ? buildType === 'shadow' : buildType === 'shady';\n}\n\n/**\n * @param {Element} element\n * @return {?string}\n */\nexport function getCssBuildType(element) {\n return element.getAttribute('css-build');\n}\n\n/**\n * Walk from text[start] matching parens and\n * returns position of the outer end paren\n * @param {string} text\n * @param {number} start\n * @return {number}\n */\nfunction findMatchingParen(text, start) {\n let level = 0;\n for (let i=start, l=text.length; i < l; i++) {\n if (text[i] === '(') {\n level++;\n } else if (text[i] === ')') {\n if (--level === 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\n/**\n * @param {string} str\n * @param {function(string, string, string, string)} callback\n */\nexport function processVariableAndFallback(str, callback) {\n // find 'var('\n let start = str.indexOf('var(');\n if (start === -1) {\n // no var?, everything is prefix\n return callback(str, '', '', '');\n }\n //${prefix}var(${inner})${suffix}\n let end = findMatchingParen(str, start + 3);\n let inner = str.substring(start + 4, end);\n let prefix = str.substring(0, start);\n // suffix may have other variables\n let suffix = processVariableAndFallback(str.substring(end + 1), callback);\n let comma = inner.indexOf(',');\n // value and fallback args should be trimmed to match in property lookup\n if (comma === -1) {\n // variable, no fallback\n return callback(prefix, inner.trim(), '', suffix);\n }\n // var(${value},${fallback})\n let value = inner.substring(0, comma).trim();\n let fallback = inner.substring(comma + 1).trim();\n return callback(prefix, value, fallback, suffix);\n}\n\n/**\n * @param {Element} element\n * @param {string} value\n */\nexport function setElementClassRaw(element, value) {\n // use native setAttribute provided by ShadyDOM when setAttribute is patched\n if (nativeShadow) {\n element.setAttribute('class', value);\n } else {\n window['ShadyDOM']['nativeMethods']['setAttribute'].call(element, 'class', value);\n }\n}\n\n/**\n * @param {Element | {is: string, extends: string}} element\n * @return {{is: string, typeExtension: string}}\n */\nexport function getIsExtends(element) {\n let localName = element['localName'];\n let is = '', typeExtension = '';\n /*\n NOTE: technically, this can be wrong for certain svg elements\n with `-` in the name like `<font-face>`\n */\n if (localName) {\n if (localName.indexOf('-') > -1) {\n is = localName;\n } else {\n typeExtension = localName;\n is = (element.getAttribute && element.getAttribute('is')) || '';\n }\n } else {\n is = /** @type {?} */(element).is;\n typeExtension = /** @type {?} */(element).extends;\n }\n return {is, typeExtension};\n}\n\n/**\n * @param {Element|DocumentFragment} element\n * @return {string}\n */\nexport function gatherStyleText(element) {\n /** @type {!Array<string>} */\n const styleTextParts = [];\n const styles = /** @type {!NodeList<!HTMLStyleElement>} */(element.querySelectorAll('style'));\n for (let i = 0; i < styles.length; i++) {\n const style = styles[i];\n if (isUnscopedStyle(style)) {\n if (!nativeShadow) {\n processUnscopedStyle(style);\n style.parentNode.removeChild(style);\n }\n } else {\n styleTextParts.push(style.textContent);\n style.parentNode.removeChild(style);\n }\n }\n return styleTextParts.join('').trim();\n}","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {StyleNode} from './css-parse.js'; // eslint-disable-line no-unused-vars\nimport * as StyleUtil from './style-util.js';\nimport {nativeShadow} from './style-settings.js';\n\n/* Transforms ShadowDOM styling into ShadyDOM styling\n\n* scoping:\n\n * elements in scope get scoping selector class=\"x-foo-scope\"\n * selectors re-written as follows:\n\n div button -> div.x-foo-scope button.x-foo-scope\n\n* :host -> scopeName\n\n* :host(...) -> scopeName...\n\n* ::slotted(...) -> scopeName > ...\n\n* ...:dir(ltr|rtl) -> [dir=\"ltr|rtl\"] ..., ...[dir=\"ltr|rtl\"]\n\n* :host(:dir[rtl]) -> scopeName:dir(rtl) -> [dir=\"rtl\"] scopeName, scopeName[dir=\"rtl\"]\n\n*/\nconst SCOPE_NAME = 'style-scope';\n\nclass StyleTransformer {\n get SCOPE_NAME() {\n return SCOPE_NAME;\n }\n // Given a node and scope name, add a scoping class to each node\n // in the tree. This facilitates transforming css into scoped rules.\n dom(node, scope, shouldRemoveScope) {\n // one time optimization to skip scoping...\n if (node['__styleScoped']) {\n node['__styleScoped'] = null;\n } else {\n this._transformDom(node, scope || '', shouldRemoveScope);\n }\n }\n\n _transformDom(node, selector, shouldRemoveScope) {\n if (node.nodeType === Node.ELEMENT_NODE) {\n this.element(node, selector, shouldRemoveScope);\n }\n let c$ = (node.localName === 'template') ?\n (node.content || node._content).childNodes :\n node.children || node.childNodes;\n if (c$) {\n for (let i=0; i<c$.length; i++) {\n this._transformDom(c$[i], selector, shouldRemoveScope);\n }\n }\n }\n\n element(element, scope, shouldRemoveScope) {\n // note: if using classes, we add both the general 'style-scope' class\n // as well as the specific scope. This enables easy filtering of all\n // `style-scope` elements\n if (scope) {\n // note: svg on IE does not have classList so fallback to class\n if (element.classList) {\n if (shouldRemoveScope) {\n element.classList.remove(SCOPE_NAME);\n element.classList.remove(scope);\n } else {\n element.classList.add(SCOPE_NAME);\n element.classList.add(scope);\n }\n } else if (element.getAttribute) {\n let c = element.getAttribute(CLASS);\n if (shouldRemoveScope) {\n if (c) {\n let newValue = c.replace(SCOPE_NAME, '').replace(scope, '');\n StyleUtil.setElementClassRaw(element, newValue);\n }\n } else {\n let newValue = (c ? c + ' ' : '') + SCOPE_NAME + ' ' + scope;\n StyleUtil.setElementClassRaw(element, newValue);\n }\n }\n }\n }\n\n elementStyles(element, styleRules, callback) {\n let cssBuildType = element['__cssBuild'];\n // no need to shim selectors if settings.useNativeShadow, also\n // a shady css build will already have transformed selectors\n // NOTE: This method may be called as part of static or property shimming.\n // When there is a targeted build it will not be called for static shimming,\n // but when the property shim is used it is called and should opt out of\n // static shimming work when a proper build exists.\n let cssText = '';\n if (nativeShadow || cssBuildType === 'shady') {\n cssText = StyleUtil.toCssText(styleRules, callback);\n } else {\n let {is, typeExtension} = StyleUtil.getIsExtends(element);\n cssText = this.css(styleRules, is, typeExtension, callback) + '\\n\\n';\n }\n return cssText.trim();\n }\n\n // Given a string of cssText and a scoping string (scope), returns\n // a string of scoped css where each selector is transformed to include\n // a class created from the scope. ShadowDOM selectors are also transformed\n // (e.g. :host) to use the scoping selector.\n css(rules, scope, ext, callback) {\n let hostScope = this._calcHostScope(scope, ext);\n scope = this._calcElementScope(scope);\n let self = this;\n return StyleUtil.toCssText(rules, function(/** StyleNode */rule) {\n if (!rule.isScoped) {\n self.rule(rule, scope, hostScope);\n rule.isScoped = true;\n }\n if (callback) {\n callback(rule, scope, hostScope);\n }\n });\n }\n\n _calcElementScope(scope) {\n if (scope) {\n return CSS_CLASS_PREFIX + scope;\n } else {\n return '';\n }\n }\n\n _calcHostScope(scope, ext) {\n return ext ? `[is=${scope}]` : scope;\n }\n\n rule(rule, scope, hostScope) {\n this._transformRule(rule, this._transformComplexSelector,\n scope, hostScope);\n }\n\n /**\n * transforms a css rule to a scoped rule.\n *\n * @param {StyleNode} rule\n * @param {Function} transformer\n * @param {string=} scope\n * @param {string=} hostScope\n */\n _transformRule(rule, transformer, scope, hostScope) {\n // NOTE: save transformedSelector for subsequent matching of elements\n // against selectors (e.g. when calculating style properties)\n rule['selector'] = rule.transformedSelector =\n this._transformRuleCss(rule, transformer, scope, hostScope);\n }\n\n /**\n * @param {StyleNode} rule\n * @param {Function} transformer\n * @param {string=} scope\n * @param {string=} hostScope\n */\n _transformRuleCss(rule, transformer, scope, hostScope) {\n let p$ = rule['selector'].split(COMPLEX_SELECTOR_SEP);\n // we want to skip transformation of rules that appear in keyframes,\n // because they are keyframe selectors, not element selectors.\n if (!StyleUtil.isKeyframesSelector(rule)) {\n for (let i=0, l=p$.length, p; (i<l) && (p=p$[i]); i++) {\n p$[i] = transformer.call(this, p, scope, hostScope);\n }\n }\n return p$.join(COMPLEX_SELECTOR_SEP);\n }\n\n /**\n * @param {string} selector\n * @return {string}\n */\n _twiddleNthPlus(selector) {\n return selector.replace(NTH, (m, type, inside) => {\n if (inside.indexOf('+') > -1) {\n inside = inside.replace(/\\+/g, '___');\n } else if (inside.indexOf('___') > -1) {\n inside = inside.replace(/___/g, '+');\n }\n return `:${type}(${inside})`;\n });\n }\n\n/**\n * @param {string} selector\n * @param {string} scope\n * @param {string=} hostScope\n */\n _transformComplexSelector(selector, scope, hostScope) {\n let stop = false;\n selector = selector.trim();\n // Remove spaces inside of selectors like `:nth-of-type` because it confuses SIMPLE_SELECTOR_SEP\n let isNth = NTH.test(selector);\n if (isNth) {\n selector = selector.replace(NTH, (m, type, inner) => `:${type}(${inner.replace(/\\s/g, '')})`)\n selector = this._twiddleNthPlus(selector);\n }\n selector = selector.replace(SLOTTED_START, `${HOST} $1`);\n selector = selector.replace(SIMPLE_SELECTOR_SEP, (m, c, s) => {\n if (!stop) {\n let info = this._transformCompoundSelector(s, c, scope, hostScope);\n stop = stop || info.stop;\n c = info.combinator;\n s = info.value;\n }\n return c + s;\n });\n if (isNth) {\n selector = this._twiddleNthPlus(selector);\n }\n return selector;\n }\n\n _transformCompoundSelector(selector, combinator, scope, hostScope) {\n // replace :host with host scoping class\n let slottedIndex = selector.indexOf(SLOTTED);\n if (selector.indexOf(HOST) >= 0) {\n selector = this._transformHostSelector(selector, hostScope);\n // replace other selectors with scoping class\n } else if (slottedIndex !== 0) {\n selector = scope ? this._transformSimpleSelector(selector, scope) :\n selector;\n }\n // mark ::slotted() scope jump to replace with descendant selector + arg\n // also ignore left-side combinator\n let slotted = false;\n if (slottedIndex >= 0) {\n combinator = '';\n slotted = true;\n }\n // process scope jumping selectors up to the scope jump and then stop\n let stop;\n if (slotted) {\n stop = true;\n if (slotted) {\n // .zonk ::slotted(.foo) -> .zonk.scope > .foo\n selector = selector.replace(SLOTTED_PAREN, (m, paren) => ` > ${paren}`);\n }\n }\n selector = selector.replace(DIR_PAREN, (m, before, dir) =>\n `[dir=\"${dir}\"] ${before}, ${before}[dir=\"${dir}\"]`);\n return {value: selector, combinator, stop};\n }\n\n _transformSimpleSelector(selector, scope) {\n let p$ = selector.split(PSEUDO_PREFIX);\n p$[0] += scope;\n return p$.join(PSEUDO_PREFIX);\n }\n\n // :host(...) -> scopeName...\n _transformHostSelector(selector, hostScope) {\n let m = selector.match(HOST_PAREN);\n let paren = m && m[2].trim() || '';\n if (paren) {\n if (!paren[0].match(SIMPLE_SELECTOR_PREFIX)) {\n // paren starts with a type selector\n let typeSelector = paren.split(SIMPLE_SELECTOR_PREFIX)[0];\n // if the type selector is our hostScope then avoid pre-pending it\n if (typeSelector === hostScope) {\n return paren;\n // otherwise, this selector should not match in this scope so\n // output a bogus selector.\n } else {\n return SELECTOR_NO_MATCH;\n }\n } else {\n // make sure to do a replace here to catch selectors like:\n // `:host(.foo)::before`\n return selector.replace(HOST_PAREN, function(m, host, paren) {\n return hostScope + paren;\n });\n }\n // if no paren, do a straight :host replacement.\n // TODO(sorvell): this should not strictly be necessary but\n // it's needed to maintain support for `:host[foo]` type selectors\n // which have been improperly used under Shady DOM. This should be\n // deprecated.\n } else {\n return selector.replace(HOST, hostScope);\n }\n }\n\n /**\n * @param {StyleNode} rule\n */\n documentRule(rule) {\n // reset selector in case this is redone.\n rule['selector'] = rule['parsedSelector'];\n this.normalizeRootSelector(rule);\n this._transformRule(rule, this._transformDocumentSelector);\n }\n\n /**\n * @param {StyleNode} rule\n */\n normalizeRootSelector(rule) {\n if (rule['selector'] === ROOT) {\n rule['selector'] = 'html';\n }\n }\n\n/**\n * @param {string} selector\n */\n _transformDocumentSelector(selector) {\n return selector.match(SLOTTED) ?\n this._transformComplexSelector(selector, SCOPE_DOC_SELECTOR) :\n this._transformSimpleSelector(selector.trim(), SCOPE_DOC_SELECTOR);\n }\n}\n\nlet NTH = /:(nth[-\\w]+)\\(([^)]+)\\)/;\nlet SCOPE_DOC_SELECTOR = `:not(.${SCOPE_NAME})`;\nlet COMPLEX_SELECTOR_SEP = ',';\nlet SIMPLE_SELECTOR_SEP = /(^|[\\s>+~]+)((?:\\[.+?\\]|[^\\s>+~=[])+)/g;\nlet SIMPLE_SELECTOR_PREFIX = /[[.:#*]/;\nlet HOST = ':host';\nlet ROOT = ':root';\nlet SLOTTED = '::slotted';\nlet SLOTTED_START = new RegExp(`^(${SLOTTED})`);\n// NOTE: this supports 1 nested () pair for things like\n// :host(:not([selected]), more general support requires\n// parsing which seems like overkill\nlet HOST_PAREN = /(:host)(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))/;\n// similar to HOST_PAREN\nlet SLOTTED_PAREN = /(?:::slotted)(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))/;\nlet DIR_PAREN = /(.*):dir\\((?:(ltr|rtl))\\)/;\nlet CSS_CLASS_PREFIX = '.';\nlet PSEUDO_PREFIX = ':';\nlet CLASS = 'class';\nlet SELECTOR_NO_MATCH = 'should_not_match';\n\nexport default new StyleTransformer()","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {StyleNode} from './css-parse.js'; // eslint-disable-line no-unused-vars\n\n/** @const {string} */\nconst infoKey = '__styleInfo';\n\nexport default class StyleInfo {\n /**\n * @param {Element} node\n * @return {StyleInfo}\n */\n static get(node) {\n if (node) {\n return node[infoKey];\n } else {\n return null;\n }\n }\n /**\n * @param {!Element} node\n * @param {StyleInfo} styleInfo\n * @return {StyleInfo}\n */\n static set(node, styleInfo) {\n node[infoKey] = styleInfo;\n return styleInfo;\n }\n /**\n * @param {StyleNode} ast\n * @param {Node=} placeholder\n * @param {Array<string>=} ownStylePropertyNames\n * @param {string=} elementName\n * @param {string=} typeExtension\n * @param {string=} cssBuild\n */\n constructor(ast, placeholder, ownStylePropertyNames, elementName, typeExtension, cssBuild) {\n /** @type {StyleNode} */\n this.styleRules = ast || null;\n /** @type {Node} */\n this.placeholder = placeholder || null;\n /** @type {!Array<string>} */\n this.ownStylePropertyNames = ownStylePropertyNames || [];\n /** @type {Array<Object>} */\n this.overrideStyleProperties = null;\n /** @type {string} */\n this.elementName = elementName || '';\n /** @type {string} */\n this.cssBuild = cssBuild || '';\n /** @type {string} */\n this.typeExtension = typeExtension || '';\n /** @type {Object<string, string>} */\n this.styleProperties = null;\n /** @type {?string} */\n this.scopeSelector = null;\n /** @type {HTMLStyleElement} */\n this.customStyle = null;\n }\n _getStyleRules() {\n return this.styleRules;\n }\n}\n\nStyleInfo.prototype['_getStyleRules'] = StyleInfo.prototype._getStyleRules;","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {removeCustomPropAssignment, StyleNode} from './css-parse.js'; // eslint-disable-line no-unused-vars\nimport {nativeShadow} from './style-settings.js';\nimport StyleTransformer from './style-transformer.js';\nimport * as StyleUtil from './style-util.js';\nimport * as RX from './common-regex.js';\nimport StyleInfo from './style-info.js';\n\n// TODO: dedupe with shady\n/**\n * @param {string} selector\n * @return {boolean}\n * @this {Element}\n */\nconst matchesSelector = function(selector) {\n const method = this.matches || this.matchesSelector ||\n this.mozMatchesSelector || this.msMatchesSelector ||\n this.oMatchesSelector || this.webkitMatchesSelector;\n return method && method.call(this, selector);\n};\n\nconst IS_IE = navigator.userAgent.match('Trident');\n\nconst XSCOPE_NAME = 'x-scope';\n\nclass StyleProperties {\n get XSCOPE_NAME() {\n return XSCOPE_NAME;\n }\n/**\n * decorates styles with rule info and returns an array of used style property names\n *\n * @param {StyleNode} rules\n * @return {Array<string>}\n */\n decorateStyles(rules) {\n let self = this, props = {}, keyframes = [], ruleIndex = 0;\n StyleUtil.forEachRule(rules, function(rule) {\n self.decorateRule(rule);\n // mark in-order position of ast rule in styles block, used for cache key\n rule.index = ruleIndex++;\n self.collectPropertiesInCssText(rule.propertyInfo.cssText, props);\n }, function onKeyframesRule(rule) {\n keyframes.push(rule);\n });\n // Cache all found keyframes rules for later reference:\n rules._keyframes = keyframes;\n // return this list of property names *consumes* in these styles.\n let names = [];\n for (let i in props) {\n names.push(i);\n }\n return names;\n }\n\n // decorate a single rule with property info\n decorateRule(rule) {\n if (rule.propertyInfo) {\n return rule.propertyInfo;\n }\n let info = {}, properties = {};\n let hasProperties = this.collectProperties(rule, properties);\n if (hasProperties) {\n info.properties = properties;\n // TODO(sorvell): workaround parser seeing mixins as additional rules\n rule['rules'] = null;\n }\n info.cssText = this.collectCssText(rule);\n rule.propertyInfo = info;\n return info;\n }\n\n // collects the custom properties from a rule's cssText\n collectProperties(rule, properties) {\n let info = rule.propertyInfo;\n if (info) {\n if (info.properties) {\n Object.assign(properties, info.properties);\n return true;\n }\n } else {\n let m, rx = RX.VAR_ASSIGN;\n let cssText = rule['parsedCssText'];\n let value;\n let any;\n while ((m = rx.exec(cssText))) {\n // note: group 2 is var, 3 is mixin\n value = (m[2] || m[3]).trim();\n // value of 'inherit' or 'unset' is equivalent to not setting the property here\n if (value !== 'inherit' || value !== 'unset') {\n properties[m[1].trim()] = value;\n }\n any = true;\n }\n return any;\n }\n\n }\n\n // returns cssText of properties that consume variables/mixins\n collectCssText(rule) {\n return this.collectConsumingCssText(rule['parsedCssText']);\n }\n\n // NOTE: we support consumption inside mixin assignment\n // but not production, so strip out {...}\n collectConsumingCssText(cssText) {\n return cssText.replace(RX.BRACKETED, '')\n .replace(RX.VAR_ASSIGN, '');\n }\n\n collectPropertiesInCssText(cssText, props) {\n let m;\n while ((m = RX.VAR_CONSUMED.exec(cssText))) {\n let name = m[1];\n // This regex catches all variable names, and following non-whitespace char\n // If next char is not ':', then variable is a consumer\n if (m[2] !== ':') {\n props[name] = true;\n }\n }\n }\n\n // turns custom properties into realized values.\n reify(props) {\n // big perf optimization here: reify only *own* properties\n // since this object has __proto__ of the element's scope properties\n let names = Object.getOwnPropertyNames(props);\n for (let i=0, n; i < names.length; i++) {\n n = names[i];\n props[n] = this.valueForProperty(props[n], props);\n }\n }\n\n // given a property value, returns the reified value\n // a property value may be:\n // (1) a literal value like: red or 5px;\n // (2) a variable value like: var(--a), var(--a, red), or var(--a, --b) or\n // var(--a, var(--b));\n // (3) a literal mixin value like { properties }. Each of these properties\n // can have values that are: (a) literal, (b) variables, (c) @apply mixins.\n valueForProperty(property, props) {\n // case (1) default\n // case (3) defines a mixin and we have to reify the internals\n if (property) {\n if (property.indexOf(';') >=0) {\n property = this.valueForProperties(property, props);\n } else {\n // case (2) variable\n let self = this;\n let fn = function(prefix, value, fallback, suffix) {\n if (!value) {\n return prefix + suffix;\n }\n let propertyValue = self.valueForProperty(props[value], props);\n // if value is \"initial\", then the variable should be treated as unset\n if (!propertyValue || propertyValue === 'initial') {\n // fallback may be --a or var(--a) or literal\n propertyValue = self.valueForProperty(props[fallback] || fallback, props) ||\n fallback;\n } else if (propertyValue === 'apply-shim-inherit') {\n // CSS build will replace `inherit` with `apply-shim-inherit`\n // for use with native css variables.\n // Since we have full control, we can use `inherit` directly.\n propertyValue = 'inherit';\n }\n return prefix + (propertyValue || '') + suffix;\n };\n property = StyleUtil.processVariableAndFallback(property, fn);\n }\n }\n return property && property.trim() || '';\n }\n\n // note: we do not yet support mixin within mixin\n valueForProperties(property, props) {\n let parts = property.split(';');\n for (let i=0, p, m; i<parts.length; i++) {\n if ((p = parts[i])) {\n RX.MIXIN_MATCH.lastIndex = 0;\n m = RX.MIXIN_MATCH.exec(p);\n if (m) {\n p = this.valueForProperty(props[m[1]], props);\n } else {\n let colon = p.indexOf(':');\n if (colon !== -1) {\n let pp = p.substring(colon);\n pp = pp.trim();\n pp = this.valueForProperty(pp, props) || pp;\n p = p.substring(0, colon) + pp;\n }\n }\n parts[i] = (p && p.lastIndexOf(';') === p.length - 1) ?\n // strip trailing ;\n p.slice(0, -1) :\n p || '';\n }\n }\n return parts.join(';');\n }\n\n applyProperties(rule, props) {\n let output = '';\n // dynamically added sheets may not be decorated so ensure they are.\n if (!rule.propertyInfo) {\n this.decorateRule(rule);\n }\n if (rule.propertyInfo.cssText) {\n output = this.valueForProperties(rule.propertyInfo.cssText, props);\n }\n rule['cssText'] = output;\n }\n\n // Apply keyframe transformations to the cssText of a given rule. The\n // keyframeTransforms object is a map of keyframe names to transformer\n // functions which take in cssText and spit out transformed cssText.\n applyKeyframeTransforms(rule, keyframeTransforms) {\n let input = rule['cssText'];\n let output = rule['cssText'];\n if (rule.hasAnimations == null) {\n // Cache whether or not the rule has any animations to begin with:\n rule.hasAnimations = RX.ANIMATION_MATCH.test(input);\n }\n // If there are no animations referenced, we can skip transforms:\n if (rule.hasAnimations) {\n let transform;\n // If we haven't transformed this rule before, we iterate over all\n // transforms:\n if (rule.keyframeNamesToTransform == null) {\n rule.keyframeNamesToTransform = [];\n for (let keyframe in keyframeTransforms) {\n transform = keyframeTransforms[keyframe];\n output = transform(input);\n // If the transform actually changed the CSS text, we cache the\n // transform name for future use:\n if (input !== output) {\n input = output;\n rule.keyframeNamesToTransform.push(keyframe);\n }\n }\n } else {\n // If we already have a list of keyframe names that apply to this\n // rule, we apply only those keyframe name transforms:\n for (let i = 0; i < rule.keyframeNamesToTransform.length; ++i) {\n transform = keyframeTransforms[rule.keyframeNamesToTransform[i]];\n input = transform(input);\n }\n output = input;\n }\n }\n rule['cssText'] = output;\n }\n\n // Test if the rules in these styles matches the given `element` and if so,\n // collect any custom properties into `props`.\n /**\n * @param {StyleNode} rules\n * @param {Element} element\n */\n propertyDataFromStyles(rules, element) {\n let props = {}, self = this;\n // generates a unique key for these matches\n let o = [];\n // note: active rules excludes non-matching @media rules\n StyleUtil.forEachRule(rules, function(rule) {\n // TODO(sorvell): we could trim the set of rules at declaration\n // time to only include ones that have properties\n if (!rule.propertyInfo) {\n self.decorateRule(rule);\n }\n // match element against transformedSelector: selector may contain\n // unwanted uniquification and parsedSelector does not directly match\n // for :host selectors.\n let selectorToMatch = rule.transformedSelector || rule['parsedSelector'];\n if (element && rule.propertyInfo.properties && selectorToMatch) {\n if (matchesSelector.call(element, selectorToMatch)) {\n self.collectProperties(rule, props);\n // produce numeric key for these matches for lookup\n addToBitMask(rule.index, o);\n }\n }\n }, null, true);\n return {properties: props, key: o};\n }\n\n /**\n * @param {Element} scope\n * @param {StyleNode} rule\n * @param {string|undefined} cssBuild\n * @param {function(Object)} callback\n */\n whenHostOrRootRule(scope, rule, cssBuild, callback) {\n if (!rule.propertyInfo) {\n this.decorateRule(rule);\n }\n if (!rule.propertyInfo.properties) {\n return;\n }\n let {is, typeExtension} = StyleUtil.getIsExtends(scope);\n let hostScope = is ?\n StyleTransformer._calcHostScope(is, typeExtension) :\n 'html';\n let parsedSelector = rule['parsedSelector'];\n let isRoot = (parsedSelector === ':host > *' || parsedSelector === 'html');\n let isHost = parsedSelector.indexOf(':host') === 0 && !isRoot;\n // build info is either in scope (when scope is an element) or in the style\n // when scope is the default scope; note: this allows default scope to have\n // mixed mode built and unbuilt styles.\n if (cssBuild === 'shady') {\n // :root -> x-foo > *.x-foo for elements and html for custom-style\n isRoot = parsedSelector === (hostScope + ' > *.' + hostScope) || parsedSelector.indexOf('html') !== -1;\n // :host -> x-foo for elements, but sub-rules have .x-foo in them\n isHost = !isRoot && parsedSelector.indexOf(hostScope) === 0;\n }\n if (cssBuild === 'shadow') {\n isRoot = parsedSelector === ':host > *' || parsedSelector === 'html';\n isHost = isHost && !isRoot;\n }\n if (!isRoot && !isHost) {\n return;\n }\n let selectorToMatch = hostScope;\n if (isHost) {\n // need to transform :host because `:host` does not work with `matches`\n if (!rule.transformedSelector) {\n // transform :host into a matchable selector\n rule.transformedSelector =\n StyleTransformer._transformRuleCss(\n rule,\n StyleTransformer._transformComplexSelector,\n StyleTransformer._calcElementScope(is),\n hostScope\n );\n }\n selectorToMatch = rule.transformedSelector || hostScope;\n }\n callback({\n selector: selectorToMatch,\n isHost: isHost,\n isRoot: isRoot\n });\n }\n/**\n * @param {Element} scope\n * @param {StyleNode} rules\n * @return {Object}\n */\n hostAndRootPropertiesForScope(scope, rules) {\n let hostProps = {}, rootProps = {}, self = this;\n // note: active rules excludes non-matching @media rules\n let cssBuild = rules && rules['__cssBuild'];\n StyleUtil.forEachRule(rules, function(rule) {\n // if scope is StyleDefaults, use _element for matchesSelector\n self.whenHostOrRootRule(scope, rule, cssBuild, function(info) {\n let element = scope._element || scope;\n if (matchesSelector.call(element, info.selector)) {\n if (info.isHost) {\n self.collectProperties(rule, hostProps);\n } else {\n self.collectProperties(rule, rootProps);\n }\n }\n });\n }, null, true);\n return {rootProps: rootProps, hostProps: hostProps};\n }\n\n /**\n * @param {Element} element\n * @param {Object} properties\n * @param {string} scopeSelector\n */\n transformStyles(element, properties, scopeSelector) {\n let self = this;\n let {is, typeExtension} = StyleUtil.getIsExtends(element);\n let hostSelector = StyleTransformer\n ._calcHostScope(is, typeExtension);\n let rxHostSelector = element.extends ?\n '\\\\' + hostSelector.slice(0, -1) + '\\\\]' :\n hostSelector;\n let hostRx = new RegExp(RX.HOST_PREFIX + rxHostSelector +\n RX.HOST_SUFFIX);\n let rules = StyleInfo.get(element).styleRules;\n let keyframeTransforms =\n this._elementKeyframeTransforms(element, rules, scopeSelector);\n return StyleTransformer.elementStyles(element, rules, function(rule) {\n self.applyProperties(rule, properties);\n if (!nativeShadow &&\n !StyleUtil.isKeyframesSelector(rule) &&\n rule['cssText']) {\n // NOTE: keyframe transforms only scope munge animation names, so it\n // is not necessary to apply them in ShadowDOM.\n self.applyKeyframeTransforms(rule, keyframeTransforms);\n self._scopeSelector(rule, hostRx, hostSelector, scopeSelector);\n }\n });\n }\n\n /**\n * @param {Element} element\n * @param {StyleNode} rules\n * @param {string} scopeSelector\n * @return {Object}\n */\n _elementKeyframeTransforms(element, rules, scopeSelector) {\n let keyframesRules = rules._keyframes;\n let keyframeTransforms = {};\n if (!nativeShadow && keyframesRules) {\n // For non-ShadowDOM, we transform all known keyframes rules in\n // advance for the current scope. This allows us to catch keyframes\n // rules that appear anywhere in the stylesheet:\n for (let i = 0, keyframesRule = keyframesRules[i];\n i < keyframesRules.length;\n keyframesRule = keyframesRules[++i]) {\n this._scopeKeyframes(keyframesRule, scopeSelector);\n keyframeTransforms[keyframesRule['keyframesName']] =\n this._keyframesRuleTransformer(keyframesRule);\n }\n }\n return keyframeTransforms;\n }\n\n // Generate a factory for transforming a chunk of CSS text to handle a\n // particular scoped keyframes rule.\n /**\n * @param {StyleNode} keyframesRule\n * @return {function(string):string}\n */\n _keyframesRuleTransformer(keyframesRule) {\n return function(cssText) {\n return cssText.replace(\n keyframesRule.keyframesNameRx,\n keyframesRule.transformedKeyframesName);\n };\n }\n\n/**\n * Transforms `@keyframes` names to be unique for the current host.\n * Example: @keyframes foo-anim -> @keyframes foo-anim-x-foo-0\n *\n * @param {StyleNode} rule\n * @param {string} scopeId\n */\n _scopeKeyframes(rule, scopeId) {\n // Animation names are of the form [\\w-], so ensure that the name regex does not partially apply\n // to similarly named keyframe names by checking for a word boundary at the beginning and\n // a non-word boundary or `-` at the end.\n rule.keyframesNameRx = new RegExp(`\\\\b${rule['keyframesName']}(?!\\\\B|-)`, 'g');\n rule.transformedKeyframesName = rule['keyframesName'] + '-' + scopeId;\n rule.transformedSelector = rule.transformedSelector || rule['selector'];\n rule['selector'] = rule.transformedSelector.replace(\n rule['keyframesName'], rule.transformedKeyframesName);\n }\n\n // Strategy: x scope shim a selector e.g. to scope `.x-foo-42` (via classes):\n // non-host selector: .a.x-foo -> .x-foo-42 .a.x-foo\n // host selector: x-foo.wide -> .x-foo-42.wide\n // note: we use only the scope class (.x-foo-42) and not the hostSelector\n // (x-foo) to scope :host rules; this helps make property host rules\n // have low specificity. They are overrideable by class selectors but,\n // unfortunately, not by type selectors (e.g. overriding via\n // `.special` is ok, but not by `x-foo`).\n /**\n * @param {StyleNode} rule\n * @param {RegExp} hostRx\n * @param {string} hostSelector\n * @param {string} scopeId\n */\n _scopeSelector(rule, hostRx, hostSelector, scopeId) {\n rule.transformedSelector = rule.transformedSelector || rule['selector'];\n let selector = rule.transformedSelector;\n let scope = '.' + scopeId;\n let parts = selector.split(',');\n for (let i=0, l=parts.length, p; (i<l) && (p=parts[i]); i++) {\n parts[i] = p.match(hostRx) ?\n p.replace(hostSelector, scope) :\n scope + ' ' + p;\n }\n rule['selector'] = parts.join(',');\n }\n\n /**\n * @param {Element} element\n * @param {string} selector\n * @param {string} old\n */\n applyElementScopeSelector(element, selector, old) {\n let c = element.getAttribute('class') || '';\n let v = c;\n if (old) {\n v = c.replace(\n new RegExp('\\\\s*' + XSCOPE_NAME + '\\\\s*' + old + '\\\\s*', 'g'), ' ');\n }\n v += (v ? ' ' : '') + XSCOPE_NAME + ' ' + selector;\n if (c !== v) {\n StyleUtil.setElementClassRaw(element, v);\n }\n }\n\n /**\n * @param {HTMLElement} element\n * @param {Object} properties\n * @param {string} selector\n * @param {HTMLStyleElement} style\n * @return {HTMLStyleElement}\n */\n applyElementStyle(element, properties, selector, style) {\n // calculate cssText to apply\n let cssText = style ? style.textContent || '' :\n this.transformStyles(element, properties, selector);\n // if shady and we have a cached style that is not style, decrement\n let styleInfo = StyleInfo.get(element);\n let s = styleInfo.customStyle;\n if (s && !nativeShadow && (s !== style)) {\n s['_useCount']--;\n if (s['_useCount'] <= 0 && s.parentNode) {\n s.parentNode.removeChild(s);\n }\n }\n // apply styling always under native or if we generated style\n // or the cached style is not in document(!)\n if (nativeShadow) {\n // update existing style only under native\n if (styleInfo.customStyle) {\n styleInfo.customStyle.textContent = cssText;\n style = styleInfo.customStyle;\n // otherwise, if we have css to apply, do so\n } else if (cssText) {\n // apply css after the scope style of the element to help with\n // style precedence rules.\n style = StyleUtil.applyCss(cssText, selector, element.shadowRoot,\n styleInfo.placeholder);\n }\n } else {\n // shady and no cache hit\n if (!style) {\n // apply css after the scope style of the element to help with\n // style precedence rules.\n if (cssText) {\n style = StyleUtil.applyCss(cssText, selector, null,\n styleInfo.placeholder);\n }\n // shady and cache hit but not in document\n } else if (!style.parentNode) {\n if (IS_IE && cssText.indexOf('@media') > -1) {\n // @media rules may be stale in IE 10 and 11\n // refresh the text content of the style to revalidate them.\n style.textContent = cssText;\n }\n StyleUtil.applyStyle(style, null, styleInfo.placeholder);\n }\n }\n // ensure this style is our custom style and increment its use count.\n if (style) {\n style['_useCount'] = style['_useCount'] || 0;\n // increment use count if we changed styles\n if (styleInfo.customStyle != style) {\n style['_useCount']++;\n }\n styleInfo.customStyle = style;\n }\n return style;\n }\n\n /**\n * @param {Element} style\n * @param {Object} properties\n */\n applyCustomStyle(style, properties) {\n let rules = StyleUtil.rulesForStyle(/** @type {HTMLStyleElement} */(style));\n let self = this;\n style.textContent = StyleUtil.toCssText(rules, function(/** StyleNode */rule) {\n let css = rule['cssText'] = rule['parsedCssText'];\n if (rule.propertyInfo && rule.propertyInfo.cssText) {\n // remove property assignments\n // so next function isn't confused\n // NOTE: we have 3 categories of css:\n // (1) normal properties,\n // (2) custom property assignments (--foo: red;),\n // (3) custom property usage: border: var(--foo); @apply(--foo);\n // In elements, 1 and 3 are separated for efficiency; here they\n // are not and this makes this case unique.\n css = removeCustomPropAssignment(/** @type {string} */(css));\n // replace with reified properties, scenario is same as mixin\n rule['cssText'] = self.valueForProperties(css, properties);\n }\n });\n }\n}\n\n/**\n * @param {number} n\n * @param {Array<number>} bits\n */\nfunction addToBitMask(n, bits) {\n let o = parseInt(n / 32, 10);\n let v = 1 << (n % 32);\n bits[o] = (bits[o] || 0) | v;\n}\n\nexport default new StyleProperties();","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {applyStylePlaceHolder} from './style-util.js';\nimport {nativeShadow} from './style-settings.js';\n\n/** @type {Object<string, !Node>} */\nlet placeholderMap = {};\n\n/**\n * @const {CustomElementRegistry}\n */\nconst ce = window['customElements'];\nif (ce && !nativeShadow) {\n /**\n * @const {function(this:CustomElementRegistry, string,function(new:HTMLElement),{extends: string}=)}\n */\n const origDefine = ce['define'];\n /**\n * @param {string} name\n * @param {function(new:HTMLElement)} clazz\n * @param {{extends: string}=} options\n * @return {function(new:HTMLElement)}\n */\n const wrappedDefine = (name, clazz, options) => {\n placeholderMap[name] = applyStylePlaceHolder(name);\n return origDefine.call(/** @type {!CustomElementRegistry} */(ce), name, clazz, options);\n }\n ce['define'] = wrappedDefine;\n}\n\nexport default placeholderMap;\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n'use strict';\n\nexport default class StyleCache {\n constructor(typeMax = 100) {\n // map element name -> [{properties, styleElement, scopeSelector}]\n this.cache = {};\n this.typeMax = typeMax;\n }\n\n _validate(cacheEntry, properties, ownPropertyNames) {\n for (let idx = 0; idx < ownPropertyNames.length; idx++) {\n let pn = ownPropertyNames[idx];\n if (cacheEntry.properties[pn] !== properties[pn]) {\n return false;\n }\n }\n return true;\n }\n\n store(tagname, properties, styleElement, scopeSelector) {\n let list = this.cache[tagname] || [];\n list.push({properties, styleElement, scopeSelector});\n if (list.length > this.typeMax) {\n list.shift();\n }\n this.cache[tagname] = list;\n }\n\n fetch(tagname, properties, ownPropertyNames) {\n let list = this.cache[tagname];\n if (!list) {\n return;\n }\n // reverse list for most-recent lookups\n for (let idx = list.length - 1; idx >= 0; idx--) {\n let entry = list[idx];\n if (this._validate(entry, properties, ownPropertyNames)) {\n return entry;\n }\n }\n }\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {nativeShadow} from './style-settings.js';\nimport StyleTransformer from './style-transformer.js';\nimport {getIsExtends} from './style-util.js';\n\nexport let flush = function() {};\n\n/**\n * @param {HTMLElement} element\n * @return {!Array<string>}\n */\nfunction getClasses(element) {\n let classes = [];\n if (element.classList) {\n classes = Array.from(element.classList);\n } else if (element instanceof window['SVGElement'] && element.hasAttribute('class')) {\n classes = element.getAttribute('class').split(/\\s+/);\n }\n return classes;\n}\n\n/**\n * @param {HTMLElement} element\n * @return {string}\n */\nfunction getCurrentScope(element) {\n let classes = getClasses(element);\n let idx = classes.indexOf(StyleTransformer.SCOPE_NAME);\n if (idx > -1) {\n return classes[idx + 1];\n }\n return '';\n}\n\n/**\n * @param {Array<MutationRecord|null>|null} mxns\n */\nfunction handler(mxns) {\n for (let x=0; x < mxns.length; x++) {\n let mxn = mxns[x];\n if (mxn.target === document.documentElement ||\n mxn.target === document.head) {\n continue;\n }\n for (let i=0; i < mxn.addedNodes.length; i++) {\n let n = mxn.addedNodes[i];\n if (n.nodeType !== Node.ELEMENT_NODE) {\n continue;\n }\n n = /** @type {HTMLElement} */(n); // eslint-disable-line no-self-assign\n let root = n.getRootNode();\n let currentScope = getCurrentScope(n);\n // node was scoped, but now is in document\n if (currentScope && root === n.ownerDocument) {\n StyleTransformer.dom(n, currentScope, true);\n } else if (root.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n let newScope;\n let host = /** @type {ShadowRoot} */(root).host;\n // element may no longer be in a shadowroot\n if (!host) {\n continue;\n }\n newScope = getIsExtends(host).is;\n if (currentScope === newScope) {\n // make sure all the subtree elements are scoped correctly\n let unscoped = window['ShadyDOM']['nativeMethods']['querySelectorAll'].call(\n n, `:not(.${StyleTransformer.SCOPE_NAME})`);\n for (let j = 0; j < unscoped.length; j++) {\n StyleTransformer.element(unscoped[j], currentScope);\n }\n continue;\n }\n if (currentScope) {\n StyleTransformer.dom(n, currentScope, true);\n }\n StyleTransformer.dom(n, newScope);\n }\n }\n }\n}\n\nif (!nativeShadow) {\n let observer = new MutationObserver(handler);\n let start = (node) => {\n observer.observe(node, {childList: true, subtree: true});\n }\n let nativeCustomElements = (window['customElements'] &&\n !window['customElements']['polyfillWrapFlushCallback']);\n // need to start immediately with native custom elements\n // TODO(dfreedm): with polyfilled HTMLImports and native custom elements\n // excessive mutations may be observed; this can be optimized via cooperation\n // with the HTMLImports polyfill.\n if (nativeCustomElements) {\n start(document);\n } else {\n let delayedStart = () => {\n start(document.body);\n }\n // use polyfill timing if it's available\n if (window['HTMLImports']) {\n window['HTMLImports']['whenReady'](delayedStart);\n // otherwise push beyond native imports being ready\n // which requires RAF + readystate interactive.\n } else {\n requestAnimationFrame(function() {\n if (document.readyState === 'loading') {\n let listener = function() {\n delayedStart();\n document.removeEventListener('readystatechange', listener);\n }\n document.addEventListener('readystatechange', listener);\n } else {\n delayedStart();\n }\n });\n }\n }\n\n flush = function() {\n handler(observer.takeRecords());\n }\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\n/**\n * @const {!Object<string, !HTMLTemplateElement>}\n */\nconst templateMap = {};\nexport default templateMap;\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\nimport templateMap from './template-map.js';\nimport {StyleNode} from './css-parse.js'; // eslint-disable-line no-unused-vars\n\n/*\n * Utilities for handling invalidating apply-shim mixins for a given template.\n *\n * The invalidation strategy involves keeping track of the \"current\" version of a template's mixins, and updating that count when a mixin is invalidated.\n * The template\n */\n\n/** @const {string} */\nconst CURRENT_VERSION = '_applyShimCurrentVersion';\n\n/** @const {string} */\nconst NEXT_VERSION = '_applyShimNextVersion';\n\n/** @const {string} */\nconst VALIDATING_VERSION = '_applyShimValidatingVersion';\n\n/**\n * @const {Promise<void>}\n */\nconst promise = Promise.resolve();\n\n/**\n * @param {string} elementName\n */\nexport function invalidate(elementName){\n let template = templateMap[elementName];\n if (template) {\n invalidateTemplate(template);\n }\n}\n\n/**\n * This function can be called multiple times to mark a template invalid\n * and signal that the style inside must be regenerated.\n *\n * Use `startValidatingTemplate` to begin an asynchronous validation cycle.\n * During that cycle, call `templateIsValidating` to see if the template must\n * be revalidated\n * @param {HTMLTemplateElement} template\n */\nexport function invalidateTemplate(template) {\n // default the current version to 0\n template[CURRENT_VERSION] = template[CURRENT_VERSION] || 0;\n // ensure the \"validating for\" flag exists\n template[VALIDATING_VERSION] = template[VALIDATING_VERSION] || 0;\n // increment the next version\n template[NEXT_VERSION] = (template[NEXT_VERSION] || 0) + 1;\n}\n\n/**\n * @param {string} elementName\n * @return {boolean}\n */\nexport function isValid(elementName) {\n let template = templateMap[elementName];\n if (template) {\n return templateIsValid(template);\n }\n return true;\n}\n\n/**\n * @param {HTMLTemplateElement} template\n * @return {boolean}\n */\nexport function templateIsValid(template) {\n return template[CURRENT_VERSION] === template[NEXT_VERSION];\n}\n\n/**\n * @param {string} elementName\n * @return {boolean}\n */\nexport function isValidating(elementName) {\n let template = templateMap[elementName];\n if (template) {\n return templateIsValidating(template);\n }\n return false;\n}\n\n/**\n * Returns true if the template is currently invalid and `startValidating` has been called since the last invalidation.\n * If false, the template must be validated.\n * @param {HTMLTemplateElement} template\n * @return {boolean}\n */\nexport function templateIsValidating(template) {\n return !templateIsValid(template) && template[VALIDATING_VERSION] === template[NEXT_VERSION];\n}\n\n/**\n * the template is marked as `validating` for one microtask so that all instances\n * found in the tree crawl of `applyStyle` will update themselves,\n * but the template will only be updated once.\n * @param {string} elementName\n*/\nexport function startValidating(elementName) {\n let template = templateMap[elementName];\n startValidatingTemplate(template);\n}\n\n/**\n * Begin an asynchronous invalidation cycle.\n * This should be called after every validation of a template\n *\n * After one microtask, the template will be marked as valid until the next call to `invalidateTemplate`\n * @param {HTMLTemplateElement} template\n */\nexport function startValidatingTemplate(template) {\n // remember that the current \"next version\" is the reason for this validation cycle\n template[VALIDATING_VERSION] = template[NEXT_VERSION];\n // however, there only needs to be one async task to clear the counters\n if (!template._validating) {\n template._validating = true;\n promise.then(function() {\n // sync the current version to let future invalidations cause a refresh cycle\n template[CURRENT_VERSION] = template[NEXT_VERSION];\n template._validating = false;\n });\n }\n}\n\n/**\n * @return {boolean}\n */\nexport function elementsAreInvalid() {\n for (let elementName in templateMap) {\n let template = templateMap[elementName];\n if (!templateIsValid(template)) {\n return true;\n }\n }\n return false;\n}","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\n/** @type {Promise<void>} */\nlet readyPromise = null;\n\n/** @type {?function(?function())} */\nlet whenReady = window['HTMLImports'] && window['HTMLImports']['whenReady'] || null;\n\n/** @type {function()} */\nlet resolveFn;\n\n/**\n * @param {?function()} callback\n */\nexport default function documentWait(callback) {\n requestAnimationFrame(function() {\n if (whenReady) {\n whenReady(callback)\n } else {\n if (!readyPromise) {\n readyPromise = new Promise((resolve) => {resolveFn = resolve});\n if (document.readyState === 'complete') {\n resolveFn();\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n resolveFn();\n }\n });\n }\n }\n readyPromise.then(function(){ callback && callback(); });\n }\n });\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {parse, StyleNode} from './css-parse.js';\nimport {nativeShadow, nativeCssVariables} from './style-settings.js';\nimport StyleTransformer from './style-transformer.js';\nimport * as StyleUtil from './style-util.js';\nimport StyleProperties from './style-properties.js';\nimport placeholderMap from './style-placeholder.js';\nimport StyleInfo from './style-info.js';\nimport StyleCache from './style-cache.js';\nimport {flush as watcherFlush} from './document-watcher.js';\nimport templateMap from './template-map.js';\nimport * as ApplyShimUtils from './apply-shim-utils.js';\nimport documentWait from './document-wait.js';\nimport {updateNativeProperties, detectMixin} from './common-utils.js';\nimport {CustomStyleInterfaceInterface} from './custom-style-interface.js'; // eslint-disable-line no-unused-vars\n\n/**\n * @const {StyleCache}\n */\nconst styleCache = new StyleCache();\n\nexport default class ScopingShim {\n constructor() {\n this._scopeCounter = {};\n this._documentOwner = document.documentElement;\n let ast = new StyleNode();\n ast['rules'] = [];\n this._documentOwnerStyleInfo = StyleInfo.set(this._documentOwner, new StyleInfo(ast));\n this._elementsHaveApplied = false;\n this._applyShim = null;\n /** @type {?CustomStyleInterfaceInterface} */\n this._customStyleInterface = null;\n documentWait(() => {\n this._ensure();\n });\n }\n flush() {\n watcherFlush();\n }\n _generateScopeSelector(name) {\n let id = this._scopeCounter[name] = (this._scopeCounter[name] || 0) + 1;\n return `${name}-${id}`;\n }\n getStyleAst(style) {\n return StyleUtil.rulesForStyle(style);\n }\n styleAstToString(ast) {\n return StyleUtil.toCssText(ast);\n }\n _gatherStyles(template) {\n return StyleUtil.gatherStyleText(template.content);\n }\n _getCssBuild(template) {\n let style = template.content.querySelector('style');\n if (!style) {\n return '';\n }\n return style.getAttribute('css-build') || '';\n }\n /**\n * Prepare the styling and template for the given element type\n *\n * @param {HTMLTemplateElement} template\n * @param {string} elementName\n * @param {string=} typeExtension\n */\n prepareTemplate(template, elementName, typeExtension) {\n if (template._prepared) {\n return;\n }\n template._prepared = true;\n template.name = elementName;\n template.extends = typeExtension;\n templateMap[elementName] = template;\n let cssBuild = this._getCssBuild(template);\n let cssText = this._gatherStyles(template);\n let info = {\n is: elementName,\n extends: typeExtension,\n __cssBuild: cssBuild,\n };\n if (!nativeShadow) {\n StyleTransformer.dom(template.content, elementName);\n }\n // check if the styling has mixin definitions or uses\n this._ensure();\n let hasMixins = detectMixin(cssText)\n let ast = parse(cssText);\n // only run the applyshim transforms if there is a mixin involved\n if (hasMixins && nativeCssVariables && this._applyShim) {\n this._applyShim['transformRules'](ast, elementName);\n }\n template['_styleAst'] = ast;\n template._cssBuild = cssBuild;\n\n let ownPropertyNames = [];\n if (!nativeCssVariables) {\n ownPropertyNames = StyleProperties.decorateStyles(template['_styleAst'], info);\n }\n if (!ownPropertyNames.length || nativeCssVariables) {\n let root = nativeShadow ? template.content : null;\n let placeholder = placeholderMap[elementName];\n let style = this._generateStaticStyle(info, template['_styleAst'], root, placeholder);\n template._style = style;\n }\n template._ownPropertyNames = ownPropertyNames;\n }\n _generateStaticStyle(info, rules, shadowroot, placeholder) {\n let cssText = StyleTransformer.elementStyles(info, rules);\n if (cssText.length) {\n return StyleUtil.applyCss(cssText, info.is, shadowroot, placeholder);\n }\n }\n _prepareHost(host) {\n let {is, typeExtension} = StyleUtil.getIsExtends(host);\n let placeholder = placeholderMap[is];\n let template = templateMap[is];\n let ast;\n let ownStylePropertyNames;\n let cssBuild;\n if (template) {\n ast = template['_styleAst'];\n ownStylePropertyNames = template._ownPropertyNames;\n cssBuild = template._cssBuild;\n }\n return StyleInfo.set(host,\n new StyleInfo(\n ast,\n placeholder,\n ownStylePropertyNames,\n is,\n typeExtension,\n cssBuild\n )\n );\n }\n _ensureApplyShim() {\n if (this._applyShim) {\n return;\n } else if (window.ShadyCSS && window.ShadyCSS.ApplyShim) {\n this._applyShim = window.ShadyCSS.ApplyShim;\n this._applyShim['invalidCallback'] = ApplyShimUtils.invalidate;\n }\n }\n _ensureCustomStyleInterface() {\n if (this._customStyleInterface) {\n return;\n } else if (window.ShadyCSS && window.ShadyCSS.CustomStyleInterface) {\n this._customStyleInterface = /** @type {!CustomStyleInterfaceInterface} */(window.ShadyCSS.CustomStyleInterface);\n /** @type {function(!HTMLStyleElement)} */\n this._customStyleInterface['transformCallback'] = (style) => {this.transformCustomStyleForDocument(style)};\n this._customStyleInterface['validateCallback'] = () => {\n requestAnimationFrame(() => {\n if (this._customStyleInterface['enqueued'] || this._elementsHaveApplied) {\n this.flushCustomStyles();\n }\n })\n };\n }\n }\n _ensure() {\n this._ensureApplyShim();\n this._ensureCustomStyleInterface();\n }\n /**\n * Flush and apply custom styles to document\n */\n flushCustomStyles() {\n this._ensure();\n if (!this._customStyleInterface) {\n return;\n }\n let customStyles = this._customStyleInterface['processStyles']();\n // early return if custom-styles don't need validation\n if (!this._customStyleInterface['enqueued']) {\n return;\n }\n if (!nativeCssVariables) {\n this._updateProperties(this._documentOwner, this._documentOwnerStyleInfo);\n this._applyCustomStyles(customStyles);\n } else {\n this._revalidateCustomStyleApplyShim(customStyles);\n }\n this._customStyleInterface['enqueued'] = false;\n // if custom elements have upgraded and there are no native css variables, we must recalculate the whole tree\n if (this._elementsHaveApplied && !nativeCssVariables) {\n this.styleDocument();\n }\n }\n /**\n * Apply styles for the given element\n *\n * @param {!HTMLElement} host\n * @param {Object=} overrideProps\n */\n styleElement(host, overrideProps) {\n let {is} = StyleUtil.getIsExtends(host);\n let styleInfo = StyleInfo.get(host);\n if (!styleInfo) {\n styleInfo = this._prepareHost(host);\n }\n // Only trip the `elementsHaveApplied` flag if a node other that the root document has `applyStyle` called\n if (!this._isRootOwner(host)) {\n this._elementsHaveApplied = true;\n }\n if (overrideProps) {\n styleInfo.overrideStyleProperties =\n styleInfo.overrideStyleProperties || {};\n Object.assign(styleInfo.overrideStyleProperties, overrideProps);\n }\n if (!nativeCssVariables) {\n this._updateProperties(host, styleInfo);\n if (styleInfo.ownStylePropertyNames && styleInfo.ownStylePropertyNames.length) {\n this._applyStyleProperties(host, styleInfo);\n }\n } else {\n if (styleInfo.overrideStyleProperties) {\n updateNativeProperties(host, styleInfo.overrideStyleProperties);\n }\n let template = templateMap[is];\n // bail early if there is no shadowroot for this element\n if (!template && !this._isRootOwner(host)) {\n return;\n }\n if (template && template._style && !ApplyShimUtils.templateIsValid(template)) {\n // update template\n if (!ApplyShimUtils.templateIsValidating(template)) {\n this._ensure();\n this._applyShim && this._applyShim['transformRules'](template['_styleAst'], is);\n template._style.textContent = StyleTransformer.elementStyles(host, styleInfo.styleRules);\n ApplyShimUtils.startValidatingTemplate(template);\n }\n // update instance if native shadowdom\n if (nativeShadow) {\n let root = host.shadowRoot;\n if (root) {\n let style = root.querySelector('style');\n style.textContent = StyleTransformer.elementStyles(host, styleInfo.styleRules);\n }\n }\n styleInfo.styleRules = template['_styleAst'];\n }\n }\n }\n _styleOwnerForNode(node) {\n let root = node.getRootNode();\n let host = root.host;\n if (host) {\n if (StyleInfo.get(host)) {\n return host;\n } else {\n return this._styleOwnerForNode(host);\n }\n }\n return this._documentOwner;\n }\n _isRootOwner(node) {\n return (node === this._documentOwner);\n }\n _applyStyleProperties(host, styleInfo) {\n let is = StyleUtil.getIsExtends(host).is;\n let cacheEntry = styleCache.fetch(is, styleInfo.styleProperties, styleInfo.ownStylePropertyNames);\n let cachedScopeSelector = cacheEntry && cacheEntry.scopeSelector;\n let cachedStyle = cacheEntry ? cacheEntry.styleElement : null;\n let oldScopeSelector = styleInfo.scopeSelector;\n // only generate new scope if cached style is not found\n styleInfo.scopeSelector = cachedScopeSelector || this._generateScopeSelector(is);\n let style = StyleProperties.applyElementStyle(host, styleInfo.styleProperties, styleInfo.scopeSelector, cachedStyle);\n if (!nativeShadow) {\n StyleProperties.applyElementScopeSelector(host, styleInfo.scopeSelector, oldScopeSelector);\n }\n if (!cacheEntry) {\n styleCache.store(is, styleInfo.styleProperties, style, styleInfo.scopeSelector);\n }\n return style;\n }\n _updateProperties(host, styleInfo) {\n let owner = this._styleOwnerForNode(host);\n let ownerStyleInfo = StyleInfo.get(owner);\n let ownerProperties = ownerStyleInfo.styleProperties;\n let props = Object.create(ownerProperties || null);\n let hostAndRootProps = StyleProperties.hostAndRootPropertiesForScope(host, styleInfo.styleRules);\n let propertyData = StyleProperties.propertyDataFromStyles(ownerStyleInfo.styleRules, host);\n let propertiesMatchingHost = propertyData.properties\n Object.assign(\n props,\n hostAndRootProps.hostProps,\n propertiesMatchingHost,\n hostAndRootProps.rootProps\n );\n this._mixinOverrideStyles(props, styleInfo.overrideStyleProperties);\n StyleProperties.reify(props);\n styleInfo.styleProperties = props;\n }\n _mixinOverrideStyles(props, overrides) {\n for (let p in overrides) {\n let v = overrides[p];\n // skip override props if they are not truthy or 0\n // in order to fall back to inherited values\n if (v || v === 0) {\n props[p] = v;\n }\n }\n }\n /**\n * Update styles of the whole document\n *\n * @param {Object=} properties\n */\n styleDocument(properties) {\n this.styleSubtree(this._documentOwner, properties);\n }\n /**\n * Update styles of a subtree\n *\n * @param {!HTMLElement} host\n * @param {Object=} properties\n */\n styleSubtree(host, properties) {\n let root = host.shadowRoot;\n if (root || this._isRootOwner(host)) {\n this.styleElement(host, properties);\n }\n // process the shadowdom children of `host`\n let shadowChildren = root && (root.children || root.childNodes);\n if (shadowChildren) {\n for (let i = 0; i < shadowChildren.length; i++) {\n let c = /** @type {!HTMLElement} */(shadowChildren[i]);\n this.styleSubtree(c);\n }\n } else {\n // process the lightdom children of `host`\n let children = host.children || host.childNodes;\n if (children) {\n for (let i = 0; i < children.length; i++) {\n let c = /** @type {!HTMLElement} */(children[i]);\n this.styleSubtree(c);\n }\n }\n }\n }\n /* Custom Style operations */\n _revalidateCustomStyleApplyShim(customStyles) {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n let s = this._customStyleInterface['getStyleForCustomStyle'](c);\n if (s) {\n this._revalidateApplyShim(s);\n }\n }\n }\n _applyCustomStyles(customStyles) {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n let s = this._customStyleInterface['getStyleForCustomStyle'](c);\n if (s) {\n StyleProperties.applyCustomStyle(s, this._documentOwnerStyleInfo.styleProperties);\n }\n }\n }\n transformCustomStyleForDocument(style) {\n let ast = StyleUtil.rulesForStyle(style);\n StyleUtil.forEachRule(ast, (rule) => {\n if (nativeShadow) {\n StyleTransformer.normalizeRootSelector(rule);\n } else {\n StyleTransformer.documentRule(rule);\n }\n if (nativeCssVariables) {\n this._ensure();\n this._applyShim && this._applyShim['transformRule'](rule);\n }\n });\n if (nativeCssVariables) {\n style.textContent = StyleUtil.toCssText(ast);\n } else {\n this._documentOwnerStyleInfo.styleRules.rules.push(ast);\n }\n }\n _revalidateApplyShim(style) {\n if (nativeCssVariables && this._applyShim) {\n let ast = StyleUtil.rulesForStyle(style);\n this._ensure();\n this._applyShim['transformRules'](ast);\n style.textContent = StyleUtil.toCssText(ast);\n }\n }\n getComputedStyleValue(element, property) {\n let value;\n if (!nativeCssVariables) {\n // element is either a style host, or an ancestor of a style host\n let styleInfo = StyleInfo.get(element) || StyleInfo.get(this._styleOwnerForNode(element));\n value = styleInfo.styleProperties[property];\n }\n // fall back to the property value from the computed styling\n value = value || window.getComputedStyle(element).getPropertyValue(property);\n // trim whitespace that can come after the `:` in css\n // example: padding: 2px -> \" 2px\"\n return value ? value.trim() : '';\n }\n // given an element and a classString, replaces\n // the element's class with the provided classString and adds\n // any necessary ShadyCSS static and property based scoping selectors\n setElementClass(element, classString) {\n let root = element.getRootNode();\n let classes = classString ? classString.split(/\\s/) : [];\n let scopeName = root.host && root.host.localName;\n // If no scope, try to discover scope name from existing class.\n // This can occur if, for example, a template stamped element that\n // has been scoped is manipulated when not in a root.\n if (!scopeName) {\n var classAttr = element.getAttribute('class');\n if (classAttr) {\n let k$ = classAttr.split(/\\s/);\n for (let i=0; i < k$.length; i++) {\n if (k$[i] === StyleTransformer.SCOPE_NAME) {\n scopeName = k$[i+1];\n break;\n }\n }\n }\n }\n if (scopeName) {\n classes.push(StyleTransformer.SCOPE_NAME, scopeName);\n }\n if (!nativeCssVariables) {\n let styleInfo = StyleInfo.get(element);\n if (styleInfo && styleInfo.scopeSelector) {\n classes.push(StyleProperties.XSCOPE_NAME, styleInfo.scopeSelector);\n }\n }\n StyleUtil.setElementClassRaw(element, classes.join(' '));\n }\n _styleInfoForNode(node) {\n return StyleInfo.get(node);\n }\n}\n\n/* exports */\nScopingShim.prototype['flush'] = ScopingShim.prototype.flush;\nScopingShim.prototype['prepareTemplate'] = ScopingShim.prototype.prepareTemplate;\nScopingShim.prototype['styleElement'] = ScopingShim.prototype.styleElement;\nScopingShim.prototype['styleDocument'] = ScopingShim.prototype.styleDocument;\nScopingShim.prototype['styleSubtree'] = ScopingShim.prototype.styleSubtree;\nScopingShim.prototype['getComputedStyleValue'] = ScopingShim.prototype.getComputedStyleValue;\nScopingShim.prototype['setElementClass'] = ScopingShim.prototype.setElementClass;\nScopingShim.prototype['_styleInfoForNode'] = ScopingShim.prototype._styleInfoForNode;\nScopingShim.prototype['transformCustomStyleForDocument'] = ScopingShim.prototype.transformCustomStyleForDocument;\nScopingShim.prototype['getStyleAst'] = ScopingShim.prototype.getStyleAst;\nScopingShim.prototype['styleAstToString'] = ScopingShim.prototype.styleAstToString;\nScopingShim.prototype['flushCustomStyles'] = ScopingShim.prototype.flushCustomStyles;\nObject.defineProperties(ScopingShim.prototype, {\n 'nativeShadow': {\n get() {\n return nativeShadow;\n }\n },\n 'nativeCss': {\n get() {\n return nativeCssVariables;\n }\n }\n});","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport { MIXIN_MATCH, VAR_ASSIGN } from './common-regex.js';\n\n/**\n * @param {Element} element\n * @param {Object=} properties\n */\nexport function updateNativeProperties(element, properties) {\n // remove previous properties\n for (let p in properties) {\n // NOTE: for bc with shim, don't apply null values.\n if (p === null) {\n element.style.removeProperty(p);\n } else {\n element.style.setProperty(p, properties[p]);\n }\n }\n}\n\n/**\n * @param {Element} element\n * @param {string} property\n * @return {string}\n */\nexport function getComputedStyleValue(element, property) {\n /**\n * @const {string}\n */\n const value = window.getComputedStyle(element).getPropertyValue(property);\n if (!value) {\n return '';\n } else {\n return value.trim();\n }\n}\n\n/**\n * return true if `cssText` contains a mixin definition or consumption\n * @param {string} cssText\n * @return {boolean}\n */\nexport function detectMixin(cssText) {\n const has = MIXIN_MATCH.test(cssText) || VAR_ASSIGN.test(cssText);\n // reset state of the regexes\n MIXIN_MATCH.lastIndex = 0;\n VAR_ASSIGN.lastIndex = 0;\n return has;\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport ScopingShim from '../src/scoping-shim.js';\nimport {nativeCssVariables, nativeShadow} from '../src/style-settings.js';\n\n/** @const {ScopingShim} */\nconst scopingShim = new ScopingShim();\n\nlet ApplyShim, CustomStyleInterface;\n\nif (window['ShadyCSS']) {\n ApplyShim = window['ShadyCSS']['ApplyShim'];\n CustomStyleInterface = window['ShadyCSS']['CustomStyleInterface'];\n}\n\nwindow.ShadyCSS = {\n ScopingShim: scopingShim,\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n * @param {string=} elementExtends\n */\n prepareTemplate(template, elementName, elementExtends) {\n scopingShim.flushCustomStyles();\n scopingShim.prepareTemplate(template, elementName, elementExtends)\n },\n\n /**\n * @param {!HTMLElement} element\n * @param {Object=} properties\n */\n styleSubtree(element, properties) {\n scopingShim.flushCustomStyles();\n scopingShim.styleSubtree(element, properties);\n },\n\n /**\n * @param {!HTMLElement} element\n */\n styleElement(element) {\n scopingShim.flushCustomStyles();\n scopingShim.styleElement(element);\n },\n\n /**\n * @param {Object=} properties\n */\n styleDocument(properties) {\n scopingShim.flushCustomStyles();\n scopingShim.styleDocument(properties);\n },\n\n /**\n * @param {Element} element\n * @param {string} property\n * @return {string}\n */\n getComputedStyleValue(element, property) {\n return scopingShim.getComputedStyleValue(element, property);\n },\n\n nativeCss: nativeCssVariables,\n\n nativeShadow: nativeShadow\n};\n\nif (ApplyShim) {\n window.ShadyCSS.ApplyShim = ApplyShim;\n}\n\nif (CustomStyleInterface) {\n window.ShadyCSS.CustomStyleInterface = CustomStyleInterface;\n}","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n'use strict';\n\n/*\n * Polyfills loaded: Custom Elements, Shady DOM/Shady CSS\n * Used in: Safari 9, Firefox, Edge\n */\n\nimport '../node_modules/@webcomponents/shadydom/src/shadydom.js';\nimport '../node_modules/@webcomponents/custom-elements/src/custom-elements.js';\nimport '../node_modules/@webcomponents/shadycss/entrypoints/scoping-shim.js';\n\nlet document = window.document;\n// global for (1) existence means `WebComponentsReady` will file,\n// (2) WebComponents.ready == true means event has fired.\nwindow.WebComponents = window.WebComponents || {};\n\nfunction fire() {\n requestAnimationFrame(() => {\n window.WebComponents.ready = true;\n window.document.dispatchEvent(new CustomEvent('WebComponentsReady', { bubbles: true }));\n })\n}\n\nfunction wait() {\n fire();\n document.removeEventListener('readystatechange', wait);\n}\n\nif (document.readyState !== 'loading') {\n fire();\n} else {\n document.addEventListener('readystatechange', wait);\n}"]}