This repository has been archived by the owner on Jan 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
/
html-imports.min.js.map
1 lines (1 loc) · 45.6 KB
/
html-imports.min.js.map
1
{"version":3,"sources":["src/html-imports.js"],"names":["scope","newCustomEvent","type","params","window","CustomEvent","event","document","createEvent","initCustomEvent","bubbles","cancelable","detail","importForElement","element","useNative","ownerDocument","doc","parentNode","closest","importSelector","isImportLink","whenImportsReady","callback","imports","QSA","rootImportSelector","pending","length","forEach","imp","whenElementLoaded","whenDocumentReady","stateChanged","readyState","body","removeEventListener","addEventListener","whenReady","localName","src","firstChild","onLoadingDone","isIE","node","nodeType","Node","ELEMENT_NODE","rel","constructor","Importer","documents","inflight","dynamicImportsMO","MutationObserver","m","handleMutations","observe","head","childList","subtree","loadImports","replaceScripts","fragment","template","content","scriptsSelector","script","clone","createElement","attributes","attr","setAttribute","name","value","textContent","replaceChild","selector","childNodes","querySelectorAll","emptyNodeList","list","inverseOrder","increment","i","link","currentScript","Object","defineProperty","get","scripts","configurable","CSS_URL_REGEXP","CSS_IMPORT_REGEXP","STYLESHEET_REGEXP","Path","fixUrls","base","href","resolveUrl","getAttribute","r","replaceUrls","text","linkUrl","regexp","replace","pre","url","post","urlPath","undefined","__workingURL","u","URL","pathname","e","__tempDoc","implementation","createHTMLDocument","__base","appendChild","__anchor","Xhr","async","load","success","fail","match","pieces","split","resource","header","indexOf","atob","decodeURIComponent","request","XMLHttpRequest","open","onload","request.onload","redirectedUrl","responseURL","getResponseHeader","location","origin","protocol","host","response","responseText","status","send","test","navigator","userAgent","links","loadImport","fireEventIfNeeded","makeDocument","processImportsIfLoadingDone","createDocumentFragment","p1","p2","innerHTML","baseEl","querySelector","removeAttribute","inlineScriptIndex","n$","importDependenciesSelector","n","importDependencyAttr","Error","encodeURIComponent","num","disconnect","flatten","scriptsOk","stylesOk","fireEvents","waitForStyles","runScripts","DOCUMENT_FRAGMENT_NODE","cloneScript","l","s","s$","pendingScriptsSelector","pendingStylesSelector","needsMove","disabledLinkSelector","placeholder","insertBefore","nextSibling","newSibling","import","dispatchEvent","eventType","mutations","addedNodes","elem","importer","imps","target","native_baseURI","getOwnPropertyDescriptor","prototype","klass","Element","ownerDoc","call","enumerable","HTMLLinkElement","HTMLImports"],"mappings":"A;;;;;;;;;aASC,SAAA,CAAAA,CAAA,CAAS,CAyqBeC,QAAA,EAAA,CAACC,CAAD,CAAOC,CAAP,CAAkB,CACvC,GAAkC,UAAlC,GAAI,MAAOC,OAAAC,YAAX,CACE,MAAO,KAAIA,WAAJ,CAAgBH,CAAhB,CAAsBC,CAAtB,CAET,KAAMG,EAAqCC,QAAAC,YAAA,CAAqB,aAArB,CAC3CF,EAAAG,gBAAA,CAAsBP,CAAtB,CAA4B,CAAA,CAAQC,CAAAO,QAApC,CAAqD,CAAA,CAAQP,CAAAQ,WAA7D,CAAiFR,CAAAS,OAAjF,CACA,OAAON,EANgC,CAjChBO,QAAA,EAAA,CAAAC,CAAA,CAAW,CAClC,GAAIC,CAAJ,CAEE,MAAOD,EAAAE,cAAA,GAA0BT,QAA1B,CAAqCO,CAAAE,cAArC,CAA6D,IAEtE,KAAIC,EAAMH,CAAA,YACV,IAAI,CAACG,CAAL,EAAYH,CAAAI,WAAZ,CAAgC,CAC9BD,CAAA,CAA+BH,CAAAI,WAC/B,IAA2B,UAA3B,GAAI,MAAOD,EAAAE,QAAX,CAGEF,CAAA,CAAMA,CAAAE,QAAA,CAtdWC,kBAsdX,CAHR,KAME,KAAA,CAAO,CAACC,CAAA,CAAaJ,CAAb,CAAR,GAA8BA,CAA9B,CAAoCA,CAAAC,WAApC,EAAA,EAEFJ,CAAA,YAAA,CAAyBG,CAVK,CAYhC,MAAOA,EAlB2B,CApBXK,QAAA,EAAA,CAAAC,CAAA,CAAY,CACnC,IAAIC,EACDC,CAAA,CAAIlB,QAAJ;AA1asBmB,2CA0atB,CADH,CAEIC,EAAUH,CAAAI,OACTD,EAAL,CAIAE,CAAA,CAAQL,CAAR,CAA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yright (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(scope => {\n\n /********************* base setup *********************/\n const link = document.createElement('link');\n const useNative = Boolean('import' in link);\n const emptyNodeList = link.querySelectorAll('*');\n\n // Polyfill `currentScript` for browsers without it.\n let currentScript = null;\n if ('currentScript' in document === false) {\n Object.defineProperty(document, 'currentScript', {\n get() {\n return currentScript ||\n // NOTE: only works when called in synchronously executing code.\n // readyState should check if `loading` but IE10 is\n // interactive when scripts run so we cheat. This is not needed by\n // html-imports polyfill but helps generally polyfill `currentScript`.\n (document.readyState !== 'complete' ?\n document.scripts[document.scripts.length - 1] : null);\n },\n configurable: true\n });\n }\n\n /**\n * @param {Array|NodeList|NamedNodeMap} list\n * @param {!Function} callback\n * @param {boolean=} inverseOrder\n */\n const forEach = (list, callback, inverseOrder) => {\n const length = list ? list.length : 0;\n const increment = inverseOrder ? -1 : 1;\n let i = inverseOrder ? length - 1 : 0;\n for (; i < length && i >= 0; i = i + increment) {\n callback(list[i], i);\n }\n };\n\n /**\n * @param {!Node} node\n * @param {!string} selector\n * @return {!NodeList<!Element>}\n */\n const QSA = (node, selector) => {\n // IE 11 throws a SyntaxError if a node with no children is queried with\n // a selector containing the `:not([type])` syntax.\n if (!node.childNodes.length) {\n return emptyNodeList;\n }\n return node.querySelectorAll(selector);\n };\n\n /**\n * @param {!DocumentFragment} fragment\n */\n const replaceScripts = (fragment) => {\n forEach(QSA(fragment, 'template'), template => {\n forEach(QSA(template.content, scriptsSelector), script => {\n const clone = /** @type {!HTMLScriptElement} */\n (document.createElement('script'));\n forEach(script.attributes, attr => clone.setAttribute(attr.name, attr.value));\n clone.textContent = script.textContent;\n script.parentNode.replaceChild(clone, script);\n });\n replaceScripts(template.content);\n });\n };\n\n /********************* path fixup *********************/\n const CSS_URL_REGEXP = /(url\\()([^)]*)(\\))/g;\n const CSS_IMPORT_REGEXP = /(@import[\\s]+(?!url\\())([^;]*)(;)/g;\n const STYLESHEET_REGEXP = /(<link[^>]*)(rel=['|\"]?stylesheet['|\"]?[^>]*>)/g;\n\n // path fixup: style elements in imports must be made relative to the main\n // document. We fixup url's in url() and @import.\n const Path = {\n\n fixUrls(element, base) {\n if (element.href) {\n element.setAttribute('href',\n Path.resolveUrl(element.getAttribute('href'), base));\n }\n if (element.src) {\n element.setAttribute('src',\n Path.resolveUrl(element.getAttribute('src'), base));\n }\n if (element.localName === 'style') {\n const r = Path.replaceUrls(element.textContent, base, CSS_URL_REGEXP);\n element.textContent = Path.replaceUrls(r, base, CSS_IMPORT_REGEXP);\n }\n },\n\n replaceUrls(text, linkUrl, regexp) {\n return text.replace(regexp, (m, pre, url, post) => {\n let urlPath = url.replace(/[\"']/g, '');\n if (linkUrl) {\n urlPath = Path.resolveUrl(urlPath, linkUrl);\n }\n return pre + '\\'' + urlPath + '\\'' + post;\n });\n },\n\n resolveUrl(url, base) {\n // Lazy feature detection.\n if (Path.__workingURL === undefined) {\n Path.__workingURL = false;\n try {\n const u = new URL('b', 'http://a');\n u.pathname = 'c%20d';\n Path.__workingURL = (u.href === 'http://a/c%20d');\n } catch (e) {}\n }\n\n if (Path.__workingURL) {\n return (new URL(url, base)).href;\n }\n\n // Fallback to creating an anchor into a disconnected document.\n let doc = Path.__tempDoc;\n if (!doc) {\n doc = document.implementation.createHTMLDocument('temp');\n Path.__tempDoc = doc;\n doc.__base = doc.createElement('base');\n doc.head.appendChild(doc.__base);\n doc.__anchor = doc.createElement('a');\n }\n doc.__base.href = base;\n doc.__anchor.href = url;\n return doc.__anchor.href || url;\n }\n };\n\n /********************* Xhr processor *********************/\n const Xhr = {\n\n async: true,\n\n /**\n * @param {!string} url\n * @param {!function(!string, string=)} success\n * @param {!function(!string)} fail\n */\n load(url, success, fail) {\n if (!url) {\n fail('error: href must be specified');\n } else if (url.match(/^data:/)) {\n // Handle Data URI Scheme\n const pieces = url.split(',');\n const header = pieces[0];\n let resource = pieces[1];\n if (header.indexOf(';base64') > -1) {\n resource = atob(resource);\n } else {\n resource = decodeURIComponent(resource);\n }\n success(resource);\n } else {\n const request = new XMLHttpRequest();\n request.open('GET', url, Xhr.async);\n request.onload = () => {\n // Servers redirecting an import can add a Location header to help us\n // polyfill correctly. Handle relative and full paths.\n // Prefer responseURL which already resolves redirects\n // https://xhr.spec.whatwg.org/#the-responseurl-attribute\n let redirectedUrl = request.responseURL || request.getResponseHeader('Location');\n if (redirectedUrl && redirectedUrl.indexOf('/') === 0) {\n // In IE location.origin might not work\n // https://connect.microsoft.com/IE/feedback/details/1763802/location-origin-is-undefined-in-ie-11-on-windows-10-but-works-on-windows-7\n const origin = (location.origin || location.protocol + '//' + location.host);\n redirectedUrl = origin + redirectedUrl;\n }\n const resource = /** @type {string} */ (request.response || request.responseText);\n if (request.status === 304 || request.status === 0 ||\n request.status >= 200 && request.status < 300) {\n success(resource, redirectedUrl);\n } else {\n fail(resource);\n }\n };\n request.send();\n }\n }\n };\n\n /********************* importer *********************/\n\n const isIE = /Trident/.test(navigator.userAgent) ||\n /Edge\\/\\d./i.test(navigator.userAgent);\n\n const importSelector = 'link[rel=import]';\n\n // Used to disable loading of resources.\n const importDisableType = 'import-disable';\n\n const disabledLinkSelector = `link[rel=stylesheet][href][type=${importDisableType}]`;\n\n const scriptsSelector = `script:not([type]),script[type=\"application/javascript\"],` +\n `script[type=\"text/javascript\"],script[type=\"module\"]`;\n\n const importDependenciesSelector = `${importSelector},${disabledLinkSelector},` +\n `style:not([type]),link[rel=stylesheet][href]:not([type]),` + scriptsSelector;\n\n const importDependencyAttr = 'import-dependency';\n\n const rootImportSelector = `${importSelector}:not([${importDependencyAttr}])`;\n\n const pendingScriptsSelector = `script[${importDependencyAttr}]`;\n\n const pendingStylesSelector = `style[${importDependencyAttr}],` +\n `link[rel=stylesheet][${importDependencyAttr}]`;\n\n /**\n * Importer will:\n * - load any linked import documents (with deduping)\n * - whenever an import is loaded, prompt the parser to try to parse\n * - observe imported documents for new elements (these are handled via the\n * dynamic importer)\n */\n class Importer {\n constructor() {\n this.documents = {};\n // Used to keep track of pending loads, so that flattening and firing of\n // events can be done when all resources are ready.\n this.inflight = 0;\n this.dynamicImportsMO = new MutationObserver(m => this.handleMutations(m));\n // Observe changes on <head>.\n this.dynamicImportsMO.observe(document.head, {\n childList: true,\n subtree: true\n });\n // 1. Load imports contents\n // 2. Assign them to first import links on the document\n // 3. Wait for import styles & scripts to be done loading/running\n // 4. Fire load/error events\n this.loadImports(document);\n }\n\n /**\n * @param {!(HTMLDocument|DocumentFragment|Element)} doc\n */\n loadImports(doc) {\n const links = /** @type {!NodeList<!HTMLLinkElement>} */\n (QSA(doc, importSelector));\n forEach(links, link => this.loadImport(link));\n }\n\n /**\n * @param {!HTMLLinkElement} link\n */\n loadImport(link) {\n const url = link.href;\n // This resource is already being handled by another import.\n if (this.documents[url] !== undefined) {\n // If import is already loaded, we can safely associate it to the link\n // and fire the load/error event.\n const imp = this.documents[url];\n if (imp && imp['__loaded']) {\n link['__import'] = imp;\n this.fireEventIfNeeded(link);\n }\n return;\n }\n this.inflight++;\n // Mark it as pending to notify others this url is being loaded.\n this.documents[url] = 'pending';\n Xhr.load(url, (resource, redirectedUrl) => {\n const doc = this.makeDocument(resource, redirectedUrl || url);\n this.documents[url] = doc;\n this.inflight--;\n // Load subtree.\n this.loadImports(doc);\n this.processImportsIfLoadingDone();\n }, () => {\n // If load fails, handle error.\n this.documents[url] = null;\n this.inflight--;\n this.processImportsIfLoadingDone();\n });\n }\n\n /**\n * Creates a new document containing resource and normalizes urls accordingly.\n * @param {string=} resource\n * @param {string=} url\n * @return {!DocumentFragment}\n */\n makeDocument(resource, url) {\n if (!resource) {\n return document.createDocumentFragment();\n }\n\n if (isIE) {\n // <link rel=stylesheet> should be appended to <head>. Not doing so\n // in IE/Edge breaks the cascading order. We disable the loading by\n // setting the type before setting innerHTML to avoid loading\n // resources twice.\n resource = resource.replace(STYLESHEET_REGEXP, (match, p1, p2) => {\n if (match.indexOf('type=') === -1) {\n return `${p1} type=${importDisableType} ${p2}`;\n }\n return match;\n });\n }\n\n let content;\n const template = /** @type {!HTMLTemplateElement} */\n (document.createElement('template'));\n template.innerHTML = resource;\n if (template.content) {\n content = template.content;\n // Clone scripts inside templates since they won't execute when the\n // hosting template is cloned.\n replaceScripts(content);\n } else {\n // <template> not supported, create fragment and move content into it.\n content = document.createDocumentFragment();\n while (template.firstChild) {\n content.appendChild(template.firstChild);\n }\n }\n\n // Support <base> in imported docs. Resolve url and remove its href.\n const baseEl = content.querySelector('base');\n if (baseEl) {\n url = Path.resolveUrl(baseEl.getAttribute('href'), url);\n baseEl.removeAttribute('href');\n }\n\n const n$ = /** @type {!NodeList<!(HTMLLinkElement|HTMLScriptElement|HTMLStyleElement)>} */\n (QSA(content, importDependenciesSelector));\n // For source map hints.\n let inlineScriptIndex = 0;\n forEach(n$, n => {\n // Listen for load/error events, then fix urls.\n whenElementLoaded(n);\n Path.fixUrls(n, url);\n // Mark for easier selectors.\n n.setAttribute(importDependencyAttr, '');\n // Generate source map hints for inline scripts.\n if (n.localName === 'script' && !n.src && n.textContent) {\n if(n.type === 'module') {\n throw new Error('Inline module scripts are not supported in HTML Imports.');\n }\n const num = inlineScriptIndex ? `-${inlineScriptIndex}` : '';\n const content = n.textContent + `\\n//# sourceURL=${url}${num}.js\\n`;\n // We use the src attribute so it triggers load/error events, and it's\n // easier to capture errors (e.g. parsing) like this.\n n.setAttribute('src', 'data:text/javascript;charset=utf-8,' + encodeURIComponent(content));\n n.textContent = '';\n inlineScriptIndex++;\n }\n });\n return content;\n }\n\n /**\n * Waits for loaded imports to finish loading scripts and styles, then fires\n * the load/error events.\n */\n processImportsIfLoadingDone() {\n // Wait until all resources are ready, then load import resources.\n if (this.inflight) return;\n\n // Stop observing, flatten & load resource, then restart observing <head>.\n this.dynamicImportsMO.disconnect();\n this.flatten(document);\n // We wait for styles to load, and at the same time we execute the scripts,\n // then fire the load/error events for imports to have faster whenReady\n // callback execution.\n // NOTE: This is different for native behavior where scripts would be\n // executed after the styles before them are loaded.\n // To achieve that, we could select pending styles and scripts in the\n // document and execute them sequentially in their dom order.\n let scriptsOk = false,\n stylesOk = false;\n const onLoadingDone = () => {\n if (stylesOk && scriptsOk) {\n // Catch any imports that might have been added while we\n // weren't looking, wait for them as well.\n this.loadImports(document);\n if (this.inflight) return;\n\n // Restart observing.\n this.dynamicImportsMO.observe(document.head, {\n childList: true,\n subtree: true\n });\n this.fireEvents();\n }\n }\n this.waitForStyles(() => {\n stylesOk = true;\n onLoadingDone();\n });\n this.runScripts(() => {\n scriptsOk = true;\n onLoadingDone();\n });\n }\n\n /**\n * @param {!HTMLDocument} doc\n */\n flatten(doc) {\n const n$ = /** @type {!NodeList<!HTMLLinkElement>} */\n (QSA(doc, importSelector));\n forEach(n$, n => {\n const imp = this.documents[n.href];\n n['__import'] = /** @type {!Document} */ (imp);\n if (imp && imp.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n // We set the .import to be the link itself, and update its readyState.\n // Other links with the same href will point to this link.\n this.documents[n.href] = n;\n n.readyState = 'loading';\n n['__import'] = n;\n this.flatten(imp);\n n.appendChild(imp);\n }\n });\n }\n\n /**\n * Replaces all the imported scripts with a clone in order to execute them.\n * Updates the `currentScript`.\n * @param {!function()} callback\n */\n runScripts(callback) {\n const s$ = QSA(document, pendingScriptsSelector);\n const l = s$.length;\n const cloneScript = i => {\n if (i < l) {\n // The pending scripts have been generated through innerHTML and\n // browsers won't execute them for security reasons. We cannot use\n // s.cloneNode(true) either, the only way to run the script is manually\n // creating a new element and copying its attributes.\n const s = s$[i];\n const clone = /** @type {!HTMLScriptElement} */\n (document.createElement('script'));\n // Remove import-dependency attribute to avoid double cloning.\n s.removeAttribute(importDependencyAttr);\n forEach(s.attributes, attr => clone.setAttribute(attr.name, attr.value));\n // Update currentScript and replace original with clone script.\n currentScript = clone;\n s.parentNode.replaceChild(clone, s);\n whenElementLoaded(clone, () => {\n currentScript = null;\n cloneScript(i + 1);\n });\n } else {\n callback();\n }\n };\n cloneScript(0);\n }\n\n /**\n * Waits for all the imported stylesheets/styles to be loaded.\n * @param {!function()} callback\n */\n waitForStyles(callback) {\n const s$ = /** @type {!NodeList<!(HTMLLinkElement|HTMLStyleElement)>} */\n (QSA(document, pendingStylesSelector));\n let pending = s$.length;\n if (!pending) {\n callback();\n return;\n }\n // <link rel=stylesheet> should be appended to <head>. Not doing so\n // in IE/Edge breaks the cascading order\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10472273/\n // If there is one <link rel=stylesheet> imported, we must move all imported\n // links and styles to <head>.\n const needsMove = isIE && !!document.querySelector(disabledLinkSelector);\n forEach(s$, s => {\n // Listen for load/error events, remove selector once is done loading.\n whenElementLoaded(s, () => {\n s.removeAttribute(importDependencyAttr);\n if (--pending === 0) {\n callback();\n }\n });\n // Check if was already moved to head, to handle the case where the element\n // has already been moved but it is still loading.\n if (needsMove && s.parentNode !== document.head) {\n // Replace the element we're about to move with a placeholder.\n const placeholder = document.createElement(s.localName);\n // Add reference of the moved element.\n placeholder['__appliedElement'] = s;\n // Disable this from appearing in document.styleSheets.\n placeholder.setAttribute('type', 'import-placeholder');\n // Append placeholder next to the sibling, and move original to <head>.\n s.parentNode.insertBefore(placeholder, s.nextSibling);\n let newSibling = importForElement(s);\n while (newSibling && importForElement(newSibling)) {\n newSibling = importForElement(newSibling);\n }\n if (newSibling.parentNode !== document.head) {\n newSibling = null;\n }\n document.head.insertBefore(s, newSibling);\n // Enable the loading of <link rel=stylesheet>.\n s.removeAttribute('type');\n }\n });\n }\n\n /**\n * Fires load/error events for imports in the right order .\n */\n fireEvents() {\n const n$ = /** @type {!NodeList<!HTMLLinkElement>} */\n (QSA(document, importSelector));\n // Inverse order to have events firing bottom-up.\n forEach(n$, n => this.fireEventIfNeeded(n), true);\n }\n\n /**\n * Fires load/error event for the import if this wasn't done already.\n * @param {!HTMLLinkElement} link\n */\n fireEventIfNeeded(link) {\n // Don't fire twice same event.\n if (!link['__loaded']) {\n link['__loaded'] = true;\n // Update link's import readyState.\n link.import && (link.import.readyState = 'complete');\n const eventType = link.import ? 'load' : 'error';\n link.dispatchEvent(newCustomEvent(eventType, {\n bubbles: false,\n cancelable: false,\n detail: undefined\n }));\n }\n }\n\n /**\n * @param {Array<MutationRecord>} mutations\n */\n handleMutations(mutations) {\n forEach(mutations, m => forEach(m.addedNodes, elem => {\n if (elem && elem.nodeType === Node.ELEMENT_NODE) {\n // NOTE: added scripts are not updating currentScript in IE.\n if (isImportLink(elem)) {\n this.loadImport( /** @type {!HTMLLinkElement} */ (elem));\n } else {\n this.loadImports( /** @type {!Element} */ (elem));\n }\n }\n }));\n }\n }\n\n /**\n * @param {!Node} node\n * @return {boolean}\n */\n const isImportLink = node => {\n return node.nodeType === Node.ELEMENT_NODE && node.localName === 'link' &&\n ( /** @type {!HTMLLinkElement} */ (node).rel === 'import');\n };\n\n /**\n * Waits for an element to finish loading. If already done loading, it will\n * mark the element accordingly.\n * @param {!(HTMLLinkElement|HTMLScriptElement|HTMLStyleElement)} element\n * @param {function()=} callback\n */\n const whenElementLoaded = (element, callback) => {\n if (element['__loaded']) {\n callback && callback();\n } else if ((element.localName === 'script' && !element.src) ||\n (element.localName === 'style' && !element.firstChild)) {\n // Inline scripts and empty styles don't trigger load/error events,\n // consider them already loaded.\n element['__loaded'] = true;\n callback && callback();\n } else {\n const onLoadingDone = event => {\n element.removeEventListener(event.type, onLoadingDone);\n element['__loaded'] = true;\n callback && callback();\n };\n element.addEventListener('load', onLoadingDone);\n // NOTE: We listen only for load events in IE/Edge, because in IE/Edge\n // <style> with @import will fire error events for each failing @import,\n // and finally will trigger the load event when all @import are\n // finished (even if all fail).\n if (!isIE || element.localName !== 'style') {\n element.addEventListener('error', onLoadingDone);\n }\n }\n }\n\n /**\n * Calls the callback when all imports in the document at call time\n * (or at least document ready) have loaded. Callback is called synchronously\n * if imports are already done loading.\n * @param {function()=} callback\n */\n const whenReady = callback => {\n // 1. ensure the document is in a ready state (has dom), then\n // 2. watch for loading of imports and call callback when done\n whenDocumentReady(() => whenImportsReady(() => callback && callback()));\n }\n\n /**\n * Invokes the callback when document is in ready state. Callback is called\n * synchronously if document is already done loading.\n * @param {!function()} callback\n */\n const whenDocumentReady = callback => {\n const stateChanged = () => {\n // NOTE: Firefox can hit readystate interactive without document.body existing.\n // This is anti-spec, but we handle it here anyways by waiting for next change.\n if (document.readyState !== 'loading' && !!document.body) {\n document.removeEventListener('readystatechange', stateChanged);\n callback();\n }\n }\n document.addEventListener('readystatechange', stateChanged);\n stateChanged();\n }\n\n /**\n * Invokes the callback after all imports are loaded. Callback is called\n * synchronously if imports are already done loading.\n * @param {!function()} callback\n */\n const whenImportsReady = callback => {\n let imports = /** @type {!NodeList<!HTMLLinkElement>} */\n (QSA(document, rootImportSelector));\n let pending = imports.length;\n if (!pending) {\n callback();\n return;\n }\n forEach(imports, imp => whenElementLoaded(imp, () => {\n if (--pending === 0) {\n callback();\n }\n }));\n }\n\n /**\n * Returns the import document containing the element.\n * @param {!Node} element\n * @return {HTMLLinkElement|Document|undefined}\n */\n const importForElement = element => {\n if (useNative) {\n // Return only if not in the main doc!\n return element.ownerDocument !== document ? element.ownerDocument : null;\n }\n let doc = element['__importDoc'];\n if (!doc && element.parentNode) {\n doc = /** @type {!Element} */ (element.parentNode);\n if (typeof doc.closest === 'function') {\n // Element.closest returns the element itself if it matches the selector,\n // so we search the closest import starting from the parent.\n doc = doc.closest(importSelector);\n } else {\n // Walk up the parent tree until we find an import.\n while (!isImportLink(doc) && (doc = doc.parentNode)) {}\n }\n element['__importDoc'] = doc;\n }\n return doc;\n }\n\n let importer = null;\n /**\n * Ensures imports contained in the element are imported.\n * Use this to handle dynamic imports attached to body.\n * @param {!(HTMLDocument|Element)} doc\n */\n const loadImports = (doc) => {\n if (importer) {\n importer.loadImports(doc);\n }\n };\n\n const newCustomEvent = (type, params) => {\n if (typeof window.CustomEvent === 'function') {\n return new CustomEvent(type, params);\n }\n const event = /** @type {!CustomEvent} */ (document.createEvent('CustomEvent'));\n event.initCustomEvent(type, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);\n return event;\n };\n\n if (useNative) {\n // Check for imports that might already be done loading by the time this\n // script is actually executed. Native imports are blocking, so the ones\n // available in the document by this time should already have failed\n // or have .import defined.\n const imps = /** @type {!NodeList<!HTMLLinkElement>} */\n (QSA(document, importSelector));\n forEach(imps, imp => {\n if (!imp.import || imp.import.readyState !== 'loading') {\n imp['__loaded'] = true;\n }\n });\n // Listen for load/error events to capture dynamically added scripts.\n /**\n * @type {!function(!Event)}\n */\n const onLoadingDone = event => {\n const elem = /** @type {!Element} */ (event.target);\n if (isImportLink(elem)) {\n elem['__loaded'] = true;\n }\n };\n document.addEventListener('load', onLoadingDone, true /* useCapture */ );\n document.addEventListener('error', onLoadingDone, true /* useCapture */ );\n } else {\n // Override baseURI so that imported elements' baseURI can be used seemlessly\n // on native or polyfilled html-imports.\n // NOTE: a <link rel=import> will have `link.baseURI === link.href`, as the link\n // itself is used as the `import` document.\n /** @type {Object|undefined} */\n const native_baseURI = Object.getOwnPropertyDescriptor(Node.prototype, 'baseURI');\n // NOTE: if not configurable (e.g. safari9), set it on the Element prototype.\n const klass = !native_baseURI || native_baseURI.configurable ? Node : Element;\n Object.defineProperty(klass.prototype, 'baseURI', {\n get() {\n const ownerDoc = /** @type {HTMLLinkElement} */ (isImportLink(this) ? this : importForElement(this));\n if (ownerDoc) return ownerDoc.href;\n // Use native baseURI if possible.\n if (native_baseURI && native_baseURI.get) return native_baseURI.get.call(this);\n // Polyfill it if not available.\n const base = /** @type {HTMLBaseElement} */ (document.querySelector('base'));\n return (base || window.location).href;\n },\n configurable: true,\n enumerable: true\n });\n\n // Define 'import' read-only property.\n Object.defineProperty(HTMLLinkElement.prototype, 'import', {\n get() {\n return /** @type {HTMLLinkElement} */ (this)['__import'] || null;\n },\n configurable: true,\n enumerable: true\n });\n\n whenDocumentReady(() => {\n importer = new Importer()\n });\n }\n\n /**\n Add support for the `HTMLImportsLoaded` event and the `HTMLImports.whenReady`\n method. This api is necessary because unlike the native implementation,\n script elements do not force imports to resolve. Instead, users should wrap\n code in either an `HTMLImportsLoaded` handler or after load time in an\n `HTMLImports.whenReady(callback)` call.\n\n NOTE: This module also supports these apis under the native implementation.\n Therefore, if this file is loaded, the same code can be used under both\n the polyfill and native implementation.\n */\n whenReady(() => document.dispatchEvent(newCustomEvent('HTMLImportsLoaded', {\n cancelable: true,\n bubbles: true,\n detail: undefined\n })));\n\n // exports\n scope.useNative = useNative;\n scope.whenReady = whenReady;\n scope.importForElement = importForElement;\n scope.loadImports = loadImports;\n\n})(window.HTMLImports = (window.HTMLImports || {}));"]}