msf-editor
Advanced tools
| 'use strict'; | ||
| function _interopNamespace(e) { | ||
| if (e && e.__esModule) { return e; } else { | ||
| var n = {}; | ||
| if (e) { | ||
| Object.keys(e).forEach(function (k) { | ||
| var d = Object.getOwnPropertyDescriptor(e, k); | ||
| Object.defineProperty(n, k, d.get ? d : { | ||
| enumerable: true, | ||
| get: function () { | ||
| return e[k]; | ||
| } | ||
| }); | ||
| }); | ||
| } | ||
| n['default'] = e; | ||
| return n; | ||
| } | ||
| } | ||
| const NAMESPACE = 'msf-editor'; | ||
| let queueCongestion = 0; | ||
| let queuePending = false; | ||
| let scopeId; | ||
| let hostTagName; | ||
| let isSvgMode = false; | ||
| const win = typeof window !== 'undefined' ? window : {}; | ||
| const doc = win.document || { head: {} }; | ||
| const plt = { | ||
| $flags$: 0, | ||
| $resourcesUrl$: '', | ||
| jmp: (h) => h(), | ||
| raf: (h) => requestAnimationFrame(h), | ||
| ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts), | ||
| rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts), | ||
| }; | ||
| const supportsShadowDom = /*@__PURE__*/ (() => (doc.head.attachShadow + '').includes('[native'))() ; | ||
| const supportsListenerOptions = /*@__PURE__*/ (() => { | ||
| let supportsListenerOptions = false; | ||
| try { | ||
| doc.addEventListener('e', null, Object.defineProperty({}, 'passive', { | ||
| get() { supportsListenerOptions = true; } | ||
| })); | ||
| } | ||
| catch (e) { } | ||
| return supportsListenerOptions; | ||
| })(); | ||
| const supportsConstructibleStylesheets = /*@__PURE__*/ (() => { | ||
| try { | ||
| new CSSStyleSheet(); | ||
| return true; | ||
| } | ||
| catch (e) { } | ||
| return false; | ||
| })() ; | ||
| const hostRefs = new WeakMap(); | ||
| const getHostRef = (ref) => hostRefs.get(ref); | ||
| const registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef); | ||
| const registerHost = (elm) => { | ||
| const hostRef = { | ||
| $flags$: 0, | ||
| $hostElement$: elm, | ||
| $instanceValues$: new Map() | ||
| }; | ||
| { | ||
| hostRef.$onInstancePromise$ = new Promise(r => hostRef.$onInstanceResolve$ = r); | ||
| } | ||
| { | ||
| hostRef.$onReadyPromise$ = new Promise(r => hostRef.$onReadyResolve$ = r); | ||
| elm['s-p'] = []; | ||
| elm['s-rc'] = []; | ||
| } | ||
| return hostRefs.set(elm, hostRef); | ||
| }; | ||
| const isMemberInElement = (elm, memberName) => memberName in elm; | ||
| const consoleError = (e) => console.error(e); | ||
| const moduleCache = /*@__PURE__*/ new Map(); | ||
| const loadModule = (cmpMeta, hostRef, hmrVersionId) => { | ||
| // loadModuleImport | ||
| const exportName = cmpMeta.$tagName$.replace(/-/g, '_'); | ||
| const bundleId = ( cmpMeta.$lazyBundleIds$); | ||
| const module = moduleCache.get(bundleId) ; | ||
| if (module) { | ||
| return module[exportName]; | ||
| } | ||
| return new Promise(function (resolve) { resolve(_interopNamespace(require( | ||
| /* webpackInclude: /\.entry\.js$/ */ | ||
| /* webpackExclude: /\.system\.entry\.js$/ */ | ||
| /* webpackMode: "lazy" */ | ||
| `./${bundleId}.entry.js${ ''}`))); }).then(importedModule => { | ||
| { | ||
| moduleCache.set(bundleId, importedModule); | ||
| } | ||
| return importedModule[exportName]; | ||
| }, consoleError); | ||
| }; | ||
| const styles = new Map(); | ||
| const queueDomReads = []; | ||
| const queueDomWrites = []; | ||
| const queueDomWritesLow = []; | ||
| const queueTask = (queue, write) => (cb) => { | ||
| queue.push(cb); | ||
| if (!queuePending) { | ||
| queuePending = true; | ||
| if (write && plt.$flags$ & 4 /* queueSync */) { | ||
| nextTick(flush); | ||
| } | ||
| else { | ||
| plt.raf(flush); | ||
| } | ||
| } | ||
| }; | ||
| const consume = (queue) => { | ||
| for (let i = 0; i < queue.length; i++) { | ||
| try { | ||
| queue[i](performance.now()); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| queue.length = 0; | ||
| }; | ||
| const consumeTimeout = (queue, timeout) => { | ||
| let i = 0; | ||
| let ts = 0; | ||
| while (i < queue.length && (ts = performance.now()) < timeout) { | ||
| try { | ||
| queue[i++](ts); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| if (i === queue.length) { | ||
| queue.length = 0; | ||
| } | ||
| else if (i !== 0) { | ||
| queue.splice(0, i); | ||
| } | ||
| }; | ||
| const flush = () => { | ||
| queueCongestion++; | ||
| // always force a bunch of medium callbacks to run, but still have | ||
| // a throttle on how many can run in a certain time | ||
| // DOM READS!!! | ||
| consume(queueDomReads); | ||
| const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */ | ||
| ? performance.now() + (10 * Math.ceil(queueCongestion * (1.0 / 22.0))) | ||
| : Infinity; | ||
| // DOM WRITES!!! | ||
| consumeTimeout(queueDomWrites, timeout); | ||
| consumeTimeout(queueDomWritesLow, timeout); | ||
| if (queueDomWrites.length > 0) { | ||
| queueDomWritesLow.push(...queueDomWrites); | ||
| queueDomWrites.length = 0; | ||
| } | ||
| if (queuePending = ((queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length) > 0)) { | ||
| // still more to do yet, but we've run out of time | ||
| // let's let this thing cool off and try again in the next tick | ||
| plt.raf(flush); | ||
| } | ||
| else { | ||
| queueCongestion = 0; | ||
| } | ||
| }; | ||
| const nextTick = /*@__PURE__*/ (cb) => Promise.resolve().then(cb); | ||
| const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true); | ||
| /** | ||
| * Default style mode id | ||
| */ | ||
| /** | ||
| * Reusable empty obj/array | ||
| * Don't add values to these!! | ||
| */ | ||
| const EMPTY_OBJ = {}; | ||
| const isDef = (v) => v != null; | ||
| const isComplexType = (o) => { | ||
| // https://jsperf.com/typeof-fn-object/5 | ||
| o = typeof o; | ||
| return o === 'object' || o === 'function'; | ||
| }; | ||
| const getDynamicImportFunction = (namespace) => { | ||
| return `__sc_import_${namespace.replace(/\s|-/g, '_')}`; | ||
| }; | ||
| const patchEsm = () => { | ||
| // @ts-ignore | ||
| if ( !(win.CSS && win.CSS.supports && win.CSS.supports('color', 'var(--c)'))) { | ||
| // @ts-ignore | ||
| return new Promise(function (resolve) { resolve(require('./css-shim-6aaf713d-bfe06088.js')); }).then(() => { | ||
| plt.$cssShim$ = win.__stencil_cssshim; | ||
| if (plt.$cssShim$) { | ||
| return plt.$cssShim$.initShim(); | ||
| } | ||
| }); | ||
| } | ||
| return Promise.resolve(); | ||
| }; | ||
| const patchBrowser = () => { | ||
| { | ||
| // shim css vars | ||
| plt.$cssShim$ = win.__stencil_cssshim; | ||
| } | ||
| // @ts-ignore | ||
| const scriptElm = Array.from(doc.querySelectorAll('script')).find(s => (new RegExp(`\/${NAMESPACE}(\\.esm)?\\.js($|\\?|#)`).test(s.src) || | ||
| s.getAttribute('data-stencil-namespace') === NAMESPACE)); | ||
| const opts = scriptElm['data-opts'] || {}; | ||
| const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('core-f2d12a35.js', document.baseURI).href)); | ||
| if ('onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) { | ||
| // Safari < v11 support: This IF is true if it's Safari below v11. | ||
| // This fn cannot use async/await since Safari didn't support it until v11, | ||
| // however, Safari 10 did support modules. Safari 10 also didn't support "nomodule", | ||
| // so both the ESM file and nomodule file would get downloaded. Only Safari | ||
| // has 'onbeforeload' in the script, and "history.scrollRestoration" was added | ||
| // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue. | ||
| // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds. | ||
| return { then() { } }; | ||
| } | ||
| if (importMeta !== '') { | ||
| opts.resourcesUrl = new URL('.', importMeta).href; | ||
| } | ||
| else { | ||
| opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href; | ||
| patchDynamicImport(opts.resourcesUrl, scriptElm); | ||
| if (!window.customElements) { | ||
| // module support, but no custom elements support (Old Edge) | ||
| // @ts-ignore | ||
| return new Promise(function (resolve) { resolve(require('./dom-76cc7c7d-769a0dda.js')); }).then(() => opts); | ||
| } | ||
| } | ||
| return Promise.resolve(opts); | ||
| }; | ||
| const patchDynamicImport = (base, orgScriptElm) => { | ||
| const importFunctionName = getDynamicImportFunction(NAMESPACE); | ||
| try { | ||
| // test if this browser supports dynamic imports | ||
| // There is a caching issue in V8, that breaks using import() in Function | ||
| // By generating a random string, we can workaround it | ||
| // Check https://bugs.chromium.org/p/v8/issues/detail?id=9558 for more info | ||
| win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`); | ||
| } | ||
| catch (e) { | ||
| // this shim is specifically for browsers that do support "esm" imports | ||
| // however, they do NOT support "dynamic" imports | ||
| // basically this code is for old Edge, v18 and below | ||
| const moduleMap = new Map(); | ||
| win[importFunctionName] = (src) => { | ||
| const url = new URL(src, base).href; | ||
| let mod = moduleMap.get(url); | ||
| if (!mod) { | ||
| const script = doc.createElement('script'); | ||
| script.type = 'module'; | ||
| script.crossOrigin = orgScriptElm.crossOrigin; | ||
| script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], { type: 'application/javascript' })); | ||
| mod = new Promise(resolve => { | ||
| script.onload = () => { | ||
| resolve(win[importFunctionName].m); | ||
| script.remove(); | ||
| }; | ||
| }); | ||
| moduleMap.set(url, mod); | ||
| doc.head.appendChild(script); | ||
| } | ||
| return mod; | ||
| }; | ||
| } | ||
| }; | ||
| const parsePropertyValue = (propValue, propType) => { | ||
| // ensure this value is of the correct prop type | ||
| if (propValue != null && !isComplexType(propValue)) { | ||
| if ( propType & 1 /* String */) { | ||
| // could have been passed as a number or boolean | ||
| // but we still want it as a string | ||
| return String(propValue); | ||
| } | ||
| // redundant return here for better minification | ||
| return propValue; | ||
| } | ||
| // not sure exactly what type we want | ||
| // so no need to change to a different type | ||
| return propValue; | ||
| }; | ||
| const HYDRATED_CLASS = 'hydrated'; | ||
| const createTime = (fnName, tagName = '') => { | ||
| { | ||
| return () => { return; }; | ||
| } | ||
| }; | ||
| const uniqueTime = (key, measureText) => { | ||
| { | ||
| return () => { return; }; | ||
| } | ||
| }; | ||
| const rootAppliedStyles = new WeakMap(); | ||
| const registerStyle = (scopeId, cssText, allowCS) => { | ||
| let style = styles.get(scopeId); | ||
| if (supportsConstructibleStylesheets && allowCS) { | ||
| style = (style || new CSSStyleSheet()); | ||
| style.replace(cssText); | ||
| } | ||
| else { | ||
| style = cssText; | ||
| } | ||
| styles.set(scopeId, style); | ||
| }; | ||
| const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => { | ||
| let scopeId = getScopeId(cmpMeta.$tagName$); | ||
| let style = styles.get(scopeId); | ||
| // if an element is NOT connected then getRootNode() will return the wrong root node | ||
| // so the fallback is to always use the document for the root node in those cases | ||
| styleContainerNode = (styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc); | ||
| if (style) { | ||
| if (typeof style === 'string') { | ||
| styleContainerNode = styleContainerNode.head || styleContainerNode; | ||
| let appliedStyles = rootAppliedStyles.get(styleContainerNode); | ||
| let styleElm; | ||
| if (!appliedStyles) { | ||
| rootAppliedStyles.set(styleContainerNode, appliedStyles = new Set()); | ||
| } | ||
| if (!appliedStyles.has(scopeId)) { | ||
| { | ||
| if ( plt.$cssShim$) { | ||
| styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style, !!(cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */)); | ||
| const newScopeId = styleElm['s-sc']; | ||
| if (newScopeId) { | ||
| scopeId = newScopeId; | ||
| // we don't want to add this styleID to the appliedStyles Set | ||
| // since the cssVarShim might need to apply several different | ||
| // stylesheets for the same component | ||
| appliedStyles = null; | ||
| } | ||
| } | ||
| else { | ||
| styleElm = doc.createElement('style'); | ||
| styleElm.innerHTML = style; | ||
| } | ||
| styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link')); | ||
| } | ||
| if (appliedStyles) { | ||
| appliedStyles.add(scopeId); | ||
| } | ||
| } | ||
| } | ||
| else if ( !styleContainerNode.adoptedStyleSheets.includes(style)) { | ||
| styleContainerNode.adoptedStyleSheets = [ | ||
| ...styleContainerNode.adoptedStyleSheets, | ||
| style | ||
| ]; | ||
| } | ||
| } | ||
| return scopeId; | ||
| }; | ||
| const attachStyles = (elm, cmpMeta, mode) => { | ||
| const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$); | ||
| const scopeId = addStyle(( supportsShadowDom && elm.shadowRoot) | ||
| ? elm.shadowRoot | ||
| : elm.getRootNode(), cmpMeta, mode, elm); | ||
| if ( cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */) { | ||
| // only required when we're NOT using native shadow dom (slot) | ||
| // or this browser doesn't support native shadow dom | ||
| // and this host element was NOT created with SSR | ||
| // let's pick out the inner content for slot projection | ||
| // create a node to represent where the original | ||
| // content was first placed, which is useful later on | ||
| // DOM WRITE!! | ||
| elm['s-sc'] = scopeId; | ||
| elm.classList.add(scopeId + '-h'); | ||
| } | ||
| endAttachStyles(); | ||
| }; | ||
| const getScopeId = (tagName, mode) => 'sc-' + ( tagName); | ||
| /** | ||
| * Production h() function based on Preact by | ||
| * Jason Miller (@developit) | ||
| * Licensed under the MIT License | ||
| * https://github.com/developit/preact/blob/master/LICENSE | ||
| * | ||
| * Modified for Stencil's compiler and vdom | ||
| */ | ||
| // const stack: any[] = []; | ||
| // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode; | ||
| // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode; | ||
| const h = (nodeName, vnodeData, ...children) => { | ||
| let child = null; | ||
| let simple = false; | ||
| let lastSimple = false; | ||
| let vNodeChildren = []; | ||
| const walk = (c) => { | ||
| for (let i = 0; i < c.length; i++) { | ||
| child = c[i]; | ||
| if (Array.isArray(child)) { | ||
| walk(child); | ||
| } | ||
| else if (child != null && typeof child !== 'boolean') { | ||
| if (simple = typeof nodeName !== 'function' && !isComplexType(child)) { | ||
| child = String(child); | ||
| } | ||
| if (simple && lastSimple) { | ||
| // If the previous child was simple (string), we merge both | ||
| vNodeChildren[vNodeChildren.length - 1].$text$ += child; | ||
| } | ||
| else { | ||
| // Append a new vNode, if it's text, we create a text vNode | ||
| vNodeChildren.push(simple ? newVNode(null, child) : child); | ||
| } | ||
| lastSimple = simple; | ||
| } | ||
| } | ||
| }; | ||
| walk(children); | ||
| if (vnodeData) { | ||
| { | ||
| const classData = vnodeData.className || vnodeData.class; | ||
| if (classData) { | ||
| vnodeData.class = typeof classData !== 'object' | ||
| ? classData | ||
| : Object.keys(classData) | ||
| .filter(k => classData[k]) | ||
| .join(' '); | ||
| } | ||
| } | ||
| } | ||
| const vnode = newVNode(nodeName, null); | ||
| vnode.$attrs$ = vnodeData; | ||
| if (vNodeChildren.length > 0) { | ||
| vnode.$children$ = vNodeChildren; | ||
| } | ||
| return vnode; | ||
| }; | ||
| const newVNode = (tag, text) => { | ||
| const vnode = { | ||
| $flags$: 0, | ||
| $tag$: tag, | ||
| $text$: text, | ||
| $elm$: null, | ||
| $children$: null | ||
| }; | ||
| { | ||
| vnode.$attrs$ = null; | ||
| } | ||
| return vnode; | ||
| }; | ||
| const Host = {}; | ||
| const isHost = (node) => node && node.$tag$ === Host; | ||
| /** | ||
| * Production setAccessor() function based on Preact by | ||
| * Jason Miller (@developit) | ||
| * Licensed under the MIT License | ||
| * https://github.com/developit/preact/blob/master/LICENSE | ||
| * | ||
| * Modified for Stencil's compiler and vdom | ||
| */ | ||
| const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => { | ||
| if (oldValue === newValue) { | ||
| return; | ||
| } | ||
| let isProp = isMemberInElement(elm, memberName); | ||
| let ln = memberName.toLowerCase(); | ||
| if ( memberName === 'class') { | ||
| const classList = elm.classList; | ||
| const oldClasses = parseClassList(oldValue); | ||
| const newClasses = parseClassList(newValue); | ||
| classList.remove(...oldClasses.filter(c => c && !newClasses.includes(c))); | ||
| classList.add(...newClasses.filter(c => c && !oldClasses.includes(c))); | ||
| } | ||
| else { | ||
| // Set property if it exists and it's not a SVG | ||
| const isComplex = isComplexType(newValue); | ||
| if ((isProp || (isComplex && newValue !== null)) && !isSvg) { | ||
| try { | ||
| if (!elm.tagName.includes('-')) { | ||
| let n = newValue == null ? '' : newValue; | ||
| // Workaround for Safari, moving the <input> caret when re-assigning the same valued | ||
| if (memberName === 'list') { | ||
| isProp = false; | ||
| // tslint:disable-next-line: triple-equals | ||
| } | ||
| else if (oldValue == null || elm[memberName] != n) { | ||
| elm[memberName] = n; | ||
| } | ||
| } | ||
| else { | ||
| elm[memberName] = newValue; | ||
| } | ||
| } | ||
| catch (e) { } | ||
| } | ||
| if (newValue == null || newValue === false) { | ||
| { | ||
| elm.removeAttribute(memberName); | ||
| } | ||
| } | ||
| else if ((!isProp || (flags & 4 /* isHost */) || isSvg) && !isComplex) { | ||
| newValue = newValue === true ? '' : newValue; | ||
| { | ||
| elm.setAttribute(memberName, newValue); | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| const parseClassListRegex = /\s/; | ||
| const parseClassList = (value) => (!value) ? [] : value.split(parseClassListRegex); | ||
| const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => { | ||
| // if the element passed in is a shadow root, which is a document fragment | ||
| // then we want to be adding attrs/props to the shadow root's "host" element | ||
| // if it's not a shadow root, then we add attrs/props to the same element | ||
| const elm = (newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host) ? newVnode.$elm$.host : newVnode.$elm$; | ||
| const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ; | ||
| const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ; | ||
| { | ||
| // remove attributes no longer present on the vnode by setting them to undefined | ||
| for (memberName in oldVnodeAttrs) { | ||
| if (!(memberName in newVnodeAttrs)) { | ||
| setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$); | ||
| } | ||
| } | ||
| } | ||
| // add new & update changed attributes | ||
| for (memberName in newVnodeAttrs) { | ||
| setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$); | ||
| } | ||
| }; | ||
| const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => { | ||
| // tslint:disable-next-line: prefer-const | ||
| let newVNode = newParentVNode.$children$[childIndex]; | ||
| let i = 0; | ||
| let elm; | ||
| let childNode; | ||
| { | ||
| // create element | ||
| elm = newVNode.$elm$ = ( doc.createElement( newVNode.$tag$)); | ||
| // add css classes, attrs, props, listeners, etc. | ||
| { | ||
| updateElement(null, newVNode, isSvgMode); | ||
| } | ||
| if ( isDef(scopeId) && elm['s-si'] !== scopeId) { | ||
| // if there is a scopeId and this is the initial render | ||
| // then let's add the scopeId as a css class | ||
| elm.classList.add((elm['s-si'] = scopeId)); | ||
| } | ||
| if (newVNode.$children$) { | ||
| for (i = 0; i < newVNode.$children$.length; ++i) { | ||
| // create the node | ||
| childNode = createElm(oldParentVNode, newVNode, i); | ||
| // return node could have been null | ||
| if (childNode) { | ||
| // append our new node | ||
| elm.appendChild(childNode); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| return elm; | ||
| }; | ||
| const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => { | ||
| let containerElm = ( parentElm); | ||
| let childNode; | ||
| if ( containerElm.shadowRoot && containerElm.tagName === hostTagName) { | ||
| containerElm = containerElm.shadowRoot; | ||
| } | ||
| for (; startIdx <= endIdx; ++startIdx) { | ||
| if (vnodes[startIdx]) { | ||
| childNode = createElm(null, parentVNode, startIdx); | ||
| if (childNode) { | ||
| vnodes[startIdx].$elm$ = childNode; | ||
| containerElm.insertBefore(childNode, before); | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => { | ||
| for (; startIdx <= endIdx; ++startIdx) { | ||
| if (vnode = vnodes[startIdx]) { | ||
| elm = vnode.$elm$; | ||
| // remove the vnode's element from the dom | ||
| elm.remove(); | ||
| } | ||
| } | ||
| }; | ||
| const updateChildren = (parentElm, oldCh, newVNode, newCh) => { | ||
| let oldStartIdx = 0; | ||
| let newStartIdx = 0; | ||
| let oldEndIdx = oldCh.length - 1; | ||
| let oldStartVnode = oldCh[0]; | ||
| let oldEndVnode = oldCh[oldEndIdx]; | ||
| let newEndIdx = newCh.length - 1; | ||
| let newStartVnode = newCh[0]; | ||
| let newEndVnode = newCh[newEndIdx]; | ||
| let node; | ||
| while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { | ||
| if (oldStartVnode == null) { | ||
| // Vnode might have been moved left | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| } | ||
| else if (oldEndVnode == null) { | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| } | ||
| else if (newStartVnode == null) { | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else if (newEndVnode == null) { | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldStartVnode, newStartVnode)) { | ||
| patch(oldStartVnode, newStartVnode); | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else if (isSameVnode(oldEndVnode, newEndVnode)) { | ||
| patch(oldEndVnode, newEndVnode); | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldStartVnode, newEndVnode)) { | ||
| patch(oldStartVnode, newEndVnode); | ||
| parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling); | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldEndVnode, newStartVnode)) { | ||
| patch(oldEndVnode, newStartVnode); | ||
| parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$); | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else { | ||
| { | ||
| // new element | ||
| node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx); | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| if (node) { | ||
| { | ||
| oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| if (oldStartIdx > oldEndIdx) { | ||
| addVnodes(parentElm, (newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$), newVNode, newCh, newStartIdx, newEndIdx); | ||
| } | ||
| else if ( newStartIdx > newEndIdx) { | ||
| removeVnodes(oldCh, oldStartIdx, oldEndIdx); | ||
| } | ||
| }; | ||
| const isSameVnode = (vnode1, vnode2) => { | ||
| // compare if two vnode to see if they're "technically" the same | ||
| // need to have the same element tag, and same key to be the same | ||
| if (vnode1.$tag$ === vnode2.$tag$) { | ||
| return true; | ||
| } | ||
| return false; | ||
| }; | ||
| const patch = (oldVNode, newVNode) => { | ||
| const elm = newVNode.$elm$ = oldVNode.$elm$; | ||
| const oldChildren = oldVNode.$children$; | ||
| const newChildren = newVNode.$children$; | ||
| { | ||
| // element node | ||
| { | ||
| { | ||
| // either this is the first render of an element OR it's an update | ||
| // AND we already know it's possible it could have changed | ||
| // this updates the element's css classes, attrs, props, listeners, etc. | ||
| updateElement(oldVNode, newVNode, isSvgMode); | ||
| } | ||
| } | ||
| if ( oldChildren !== null && newChildren !== null) { | ||
| // looks like there's child vnodes for both the old and new vnodes | ||
| updateChildren(elm, oldChildren, newVNode, newChildren); | ||
| } | ||
| else if (newChildren !== null) { | ||
| // add the new vnode children | ||
| addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1); | ||
| } | ||
| else if ( oldChildren !== null) { | ||
| // no new child vnodes, but there are old child vnodes to remove | ||
| removeVnodes(oldChildren, 0, oldChildren.length - 1); | ||
| } | ||
| } | ||
| }; | ||
| const renderVdom = (hostElm, hostRef, cmpMeta, renderFnResults) => { | ||
| hostTagName = hostElm.tagName; | ||
| const oldVNode = hostRef.$vnode$ || newVNode(null, null); | ||
| const rootVnode = isHost(renderFnResults) | ||
| ? renderFnResults | ||
| : h(null, null, renderFnResults); | ||
| rootVnode.$tag$ = null; | ||
| rootVnode.$flags$ |= 4 /* isHost */; | ||
| hostRef.$vnode$ = rootVnode; | ||
| rootVnode.$elm$ = oldVNode.$elm$ = ( hostElm.shadowRoot || hostElm ); | ||
| { | ||
| scopeId = hostElm['s-sc']; | ||
| } | ||
| // synchronous patch | ||
| patch(oldVNode, rootVnode); | ||
| }; | ||
| const attachToAncestor = (hostRef, ancestorComponent) => { | ||
| if ( ancestorComponent && !hostRef.$onRenderResolve$) { | ||
| ancestorComponent['s-p'].push(new Promise(r => hostRef.$onRenderResolve$ = r)); | ||
| } | ||
| }; | ||
| const scheduleUpdate = (elm, hostRef, cmpMeta, isInitialLoad) => { | ||
| { | ||
| hostRef.$flags$ |= 16 /* isQueuedForUpdate */; | ||
| } | ||
| if ( hostRef.$flags$ & 4 /* isWaitingForChildren */) { | ||
| hostRef.$flags$ |= 512 /* needsRerender */; | ||
| return; | ||
| } | ||
| const endSchedule = createTime('scheduleUpdate', cmpMeta.$tagName$); | ||
| const ancestorComponent = hostRef.$ancestorComponent$; | ||
| const instance = hostRef.$lazyInstance$ ; | ||
| const update = () => updateComponent(elm, hostRef, cmpMeta, instance, isInitialLoad); | ||
| attachToAncestor(hostRef, ancestorComponent); | ||
| let promise; | ||
| if (isInitialLoad) { | ||
| { | ||
| hostRef.$flags$ |= 256 /* isListenReady */; | ||
| if (hostRef.$queuedListeners$) { | ||
| hostRef.$queuedListeners$.forEach(([methodName, event]) => safeCall(instance, methodName, event)); | ||
| hostRef.$queuedListeners$ = null; | ||
| } | ||
| } | ||
| { | ||
| promise = safeCall(instance, 'componentWillLoad'); | ||
| } | ||
| } | ||
| { | ||
| promise = then(promise, () => safeCall(instance, 'componentWillRender')); | ||
| } | ||
| endSchedule(); | ||
| // there is no ancestorc omponent or the ancestor component | ||
| // has already fired off its lifecycle update then | ||
| // fire off the initial update | ||
| return then(promise, () => writeTask(update) | ||
| ); | ||
| }; | ||
| const updateComponent = (elm, hostRef, cmpMeta, instance, isInitialLoad) => { | ||
| // updateComponent | ||
| const endUpdate = createTime('update', cmpMeta.$tagName$); | ||
| const rc = elm['s-rc']; | ||
| if ( isInitialLoad) { | ||
| // DOM WRITE! | ||
| attachStyles(elm, cmpMeta, hostRef.$modeName$); | ||
| } | ||
| const endRender = createTime('render', cmpMeta.$tagName$); | ||
| { | ||
| { | ||
| // looks like we've got child nodes to render into this host element | ||
| // or we need to update the css class/attrs on the host element | ||
| // DOM WRITE! | ||
| renderVdom(elm, hostRef, cmpMeta, callRender(instance)); | ||
| } | ||
| } | ||
| if ( plt.$cssShim$) { | ||
| plt.$cssShim$.updateHost(elm); | ||
| } | ||
| { | ||
| hostRef.$flags$ &= ~16 /* isQueuedForUpdate */; | ||
| } | ||
| { | ||
| hostRef.$flags$ |= 2 /* hasRendered */; | ||
| } | ||
| if ( rc) { | ||
| // ok, so turns out there are some child host elements | ||
| // waiting on this parent element to load | ||
| // let's fire off all update callbacks waiting | ||
| rc.forEach(cb => cb()); | ||
| elm['s-rc'] = undefined; | ||
| } | ||
| endRender(); | ||
| endUpdate(); | ||
| { | ||
| const childrenPromises = elm['s-p']; | ||
| const postUpdate = () => postUpdateComponent(elm, hostRef, cmpMeta); | ||
| if (childrenPromises.length === 0) { | ||
| postUpdate(); | ||
| } | ||
| else { | ||
| Promise.all(childrenPromises).then(postUpdate); | ||
| hostRef.$flags$ |= 4 /* isWaitingForChildren */; | ||
| childrenPromises.length = 0; | ||
| } | ||
| } | ||
| }; | ||
| const callRender = (instance, elm) => { | ||
| try { | ||
| instance = instance.render() ; | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| return instance; | ||
| }; | ||
| const postUpdateComponent = (elm, hostRef, cmpMeta) => { | ||
| const endPostUpdate = createTime('postUpdate', cmpMeta.$tagName$); | ||
| const ancestorComponent = hostRef.$ancestorComponent$; | ||
| if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) { | ||
| hostRef.$flags$ |= 64 /* hasLoadedComponent */; | ||
| { | ||
| // DOM WRITE! | ||
| // add the css class that this element has officially hydrated | ||
| elm.classList.add(HYDRATED_CLASS); | ||
| } | ||
| endPostUpdate(); | ||
| { | ||
| hostRef.$onReadyResolve$(elm); | ||
| if (!ancestorComponent) { | ||
| appDidLoad(); | ||
| } | ||
| } | ||
| } | ||
| else { | ||
| endPostUpdate(); | ||
| } | ||
| { | ||
| hostRef.$onInstanceResolve$(elm); | ||
| } | ||
| // load events fire from bottom to top | ||
| // the deepest elements load first then bubbles up | ||
| { | ||
| if (hostRef.$onRenderResolve$) { | ||
| hostRef.$onRenderResolve$(); | ||
| hostRef.$onRenderResolve$ = undefined; | ||
| } | ||
| if (hostRef.$flags$ & 512 /* needsRerender */) { | ||
| nextTick(() => scheduleUpdate(elm, hostRef, cmpMeta, false)); | ||
| } | ||
| hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */); | ||
| } | ||
| // ( •_•) | ||
| // ( •_•)>⌐■-■ | ||
| // (⌐■_■) | ||
| }; | ||
| const forceUpdate = (elm, cmpMeta) => { | ||
| { | ||
| const hostRef = getHostRef(elm); | ||
| const isConnected = hostRef.$hostElement$.isConnected; | ||
| if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) { | ||
| scheduleUpdate(elm, hostRef, cmpMeta, false); | ||
| } | ||
| // Returns "true" when the forced update was successfully scheduled | ||
| return isConnected; | ||
| } | ||
| }; | ||
| const appDidLoad = (who) => { | ||
| // on appload | ||
| // we have finish the first big initial render | ||
| { | ||
| doc.documentElement.classList.add(HYDRATED_CLASS); | ||
| } | ||
| { | ||
| plt.$flags$ |= 2 /* appLoaded */; | ||
| } | ||
| }; | ||
| const safeCall = (instance, method, arg) => { | ||
| if (instance && instance[method]) { | ||
| try { | ||
| return instance[method](arg); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| return undefined; | ||
| }; | ||
| const then = (promise, thenFn) => { | ||
| return promise && promise.then ? promise.then(thenFn) : thenFn(); | ||
| }; | ||
| const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName); | ||
| const setValue = (ref, propName, newVal, cmpMeta) => { | ||
| // check our new property value against our internal value | ||
| const hostRef = getHostRef(ref); | ||
| const elm = hostRef.$hostElement$ ; | ||
| const oldVal = hostRef.$instanceValues$.get(propName); | ||
| const flags = hostRef.$flags$; | ||
| const instance = hostRef.$lazyInstance$ ; | ||
| newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]); | ||
| if (newVal !== oldVal && ( !(flags & 8 /* isConstructingInstance */) || oldVal === undefined)) { | ||
| // gadzooks! the property's value has changed!! | ||
| // set our new value! | ||
| hostRef.$instanceValues$.set(propName, newVal); | ||
| if ( instance) { | ||
| if ( (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) { | ||
| // looks like this value actually changed, so we've got work to do! | ||
| // but only if we've already rendered, otherwise just chill out | ||
| // queue that we need to do an update, but don't worry about queuing | ||
| // up millions cuz this function ensures it only runs once | ||
| scheduleUpdate(elm, hostRef, cmpMeta, false); | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| const proxyComponent = (Cstr, cmpMeta, flags) => { | ||
| if ( cmpMeta.$members$) { | ||
| // It's better to have a const than two Object.entries() | ||
| const members = Object.entries(cmpMeta.$members$); | ||
| const prototype = Cstr.prototype; | ||
| members.forEach(([memberName, [memberFlags]]) => { | ||
| if ( ((memberFlags & 31 /* Prop */) || | ||
| (( flags & 2 /* proxyState */) && | ||
| (memberFlags & 32 /* State */)))) { | ||
| // proxyComponent - prop | ||
| Object.defineProperty(prototype, memberName, { | ||
| get() { | ||
| // proxyComponent, get value | ||
| return getValue(this, memberName); | ||
| }, | ||
| set(newValue) { | ||
| // proxyComponent, set value | ||
| setValue(this, memberName, newValue, cmpMeta); | ||
| }, | ||
| configurable: true, | ||
| enumerable: true | ||
| }); | ||
| } | ||
| else if ( (flags & 1 /* isElementConstructor */) && (memberFlags & 64 /* Method */)) { | ||
| // proxyComponent - method | ||
| Object.defineProperty(prototype, memberName, { | ||
| value(...args) { | ||
| const ref = getHostRef(this); | ||
| return ref.$onInstancePromise$.then(() => ref.$lazyInstance$[memberName](...args)); | ||
| } | ||
| }); | ||
| } | ||
| }); | ||
| if ( ( flags & 1 /* isElementConstructor */)) { | ||
| const attrNameToPropName = new Map(); | ||
| prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) { | ||
| plt.jmp(() => { | ||
| const propName = attrNameToPropName.get(attrName); | ||
| this[propName] = newValue === null && typeof this[propName] === 'boolean' | ||
| ? false | ||
| : newValue; | ||
| }); | ||
| }; | ||
| // create an array of attributes to observe | ||
| // and also create a map of html attribute name to js property name | ||
| Cstr.observedAttributes = members | ||
| .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes | ||
| .map(([propName, m]) => { | ||
| const attrName = m[1] || propName; | ||
| attrNameToPropName.set(attrName, propName); | ||
| return attrName; | ||
| }); | ||
| } | ||
| } | ||
| return Cstr; | ||
| }; | ||
| const addEventListeners = (elm, hostRef, listeners) => { | ||
| hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []; | ||
| const removeFns = listeners.map(([flags, name, method]) => { | ||
| const target = ( getHostListenerTarget(elm, flags) ); | ||
| const handler = hostListenerProxy(hostRef, method); | ||
| const opts = hostListenerOpts(flags); | ||
| plt.ael(target, name, handler, opts); | ||
| return () => plt.rel(target, name, handler, opts); | ||
| }); | ||
| return () => removeFns.forEach(fn => fn()); | ||
| }; | ||
| const hostListenerProxy = (hostRef, methodName) => { | ||
| return (ev) => { | ||
| { | ||
| if (hostRef.$flags$ & 256 /* isListenReady */) { | ||
| // instance is ready, let's call it's member method for this event | ||
| hostRef.$lazyInstance$[methodName](ev); | ||
| } | ||
| else { | ||
| hostRef.$queuedListeners$.push([methodName, ev]); | ||
| } | ||
| } | ||
| }; | ||
| }; | ||
| const getHostListenerTarget = (elm, flags) => { | ||
| if ( flags & 8 /* TargetWindow */) | ||
| return win; | ||
| return elm; | ||
| }; | ||
| const hostListenerOpts = (flags) => supportsListenerOptions ? | ||
| { | ||
| 'passive': (flags & 1 /* Passive */) !== 0, | ||
| 'capture': (flags & 2 /* Capture */) !== 0, | ||
| } | ||
| : (flags & 2 /* Capture */) !== 0; | ||
| const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => { | ||
| // initializeComponent | ||
| if ( (hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) { | ||
| // we haven't initialized this element yet | ||
| hostRef.$flags$ |= 32 /* hasInitializedComponent */; | ||
| { | ||
| // lazy loaded components | ||
| // request the component's implementation to be | ||
| // wired up with the host element | ||
| Cstr = loadModule(cmpMeta); | ||
| if (Cstr.then) { | ||
| // Await creates a micro-task avoid if possible | ||
| const endLoad = uniqueTime(); | ||
| Cstr = await Cstr; | ||
| endLoad(); | ||
| } | ||
| if ( !Cstr.isProxied) { | ||
| proxyComponent(Cstr, cmpMeta, 2 /* proxyState */); | ||
| Cstr.isProxied = true; | ||
| } | ||
| const endNewInstance = createTime('createInstance', cmpMeta.$tagName$); | ||
| // ok, time to construct the instance | ||
| // but let's keep track of when we start and stop | ||
| // so that the getters/setters don't incorrectly step on data | ||
| { | ||
| hostRef.$flags$ |= 8 /* isConstructingInstance */; | ||
| } | ||
| // construct the lazy-loaded component implementation | ||
| // passing the hostRef is very important during | ||
| // construction in order to directly wire together the | ||
| // host element and the lazy-loaded instance | ||
| try { | ||
| new Cstr(hostRef); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| { | ||
| hostRef.$flags$ &= ~8 /* isConstructingInstance */; | ||
| } | ||
| endNewInstance(); | ||
| } | ||
| const scopeId = getScopeId(cmpMeta.$tagName$); | ||
| if ( !styles.has(scopeId) && Cstr.style) { | ||
| const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$); | ||
| // this component has styles but we haven't registered them yet | ||
| let style = Cstr.style; | ||
| if ( cmpMeta.$flags$ & 8 /* needsShadowDomShim */) { | ||
| style = await new Promise(function (resolve) { resolve(require('./shadow-css-4889ae62-03827a39.js')); }).then(m => m.scopeCss(style, scopeId, false)); | ||
| } | ||
| registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)); | ||
| endRegisterStyles(); | ||
| } | ||
| } | ||
| // we've successfully created a lazy instance | ||
| const ancestorComponent = hostRef.$ancestorComponent$; | ||
| const schedule = () => scheduleUpdate(elm, hostRef, cmpMeta, true); | ||
| if ( ancestorComponent && ancestorComponent['s-rc']) { | ||
| // this is the intial load and this component it has an ancestor component | ||
| // but the ancestor component has NOT fired its will update lifecycle yet | ||
| // so let's just cool our jets and wait for the ancestor to continue first | ||
| // this will get fired off when the ancestor component | ||
| // finally gets around to rendering its lazy self | ||
| // fire off the initial update | ||
| ancestorComponent['s-rc'].push(schedule); | ||
| } | ||
| else { | ||
| schedule(); | ||
| } | ||
| }; | ||
| const connectedCallback = (elm, cmpMeta) => { | ||
| if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) { | ||
| const endConnected = createTime('connectedCallback', cmpMeta.$tagName$); | ||
| // connectedCallback | ||
| const hostRef = getHostRef(elm); | ||
| if ( cmpMeta.$listeners$) { | ||
| // initialize our event listeners on the host element | ||
| // we do this now so that we can listening to events that may | ||
| // have fired even before the instance is ready | ||
| hostRef.$rmListeners$ = addEventListeners(elm, hostRef, cmpMeta.$listeners$); | ||
| } | ||
| if (!(hostRef.$flags$ & 1 /* hasConnected */)) { | ||
| // first time this component has connected | ||
| hostRef.$flags$ |= 1 /* hasConnected */; | ||
| { | ||
| // find the first ancestor component (if there is one) and register | ||
| // this component as one of the actively loading child components for its ancestor | ||
| let ancestorComponent = elm; | ||
| while ((ancestorComponent = (ancestorComponent.parentNode || ancestorComponent.host))) { | ||
| // climb up the ancestors looking for the first | ||
| // component that hasn't finished its lifecycle update yet | ||
| if ( | ||
| (ancestorComponent['s-p'])) { | ||
| // we found this components first ancestor component | ||
| // keep a reference to this component's ancestor component | ||
| attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent)); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| // Lazy properties | ||
| // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties | ||
| if ( cmpMeta.$members$) { | ||
| Object.entries(cmpMeta.$members$).forEach(([memberName, [memberFlags]]) => { | ||
| if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) { | ||
| const value = elm[memberName]; | ||
| delete elm[memberName]; | ||
| elm[memberName] = value; | ||
| } | ||
| }); | ||
| } | ||
| { | ||
| // connectedCallback, taskQueue, initialLoad | ||
| // angular sets attribute AFTER connectCallback | ||
| // https://github.com/angular/angular/issues/18909 | ||
| // https://github.com/angular/angular/issues/19940 | ||
| nextTick(() => initializeComponent(elm, hostRef, cmpMeta)); | ||
| } | ||
| } | ||
| endConnected(); | ||
| } | ||
| }; | ||
| const disconnectedCallback = (elm) => { | ||
| if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) { | ||
| const hostRef = getHostRef(elm); | ||
| { | ||
| if (hostRef.$rmListeners$) { | ||
| hostRef.$rmListeners$(); | ||
| hostRef.$rmListeners$ = undefined; | ||
| } | ||
| } | ||
| // clear CSS var-shim tracking | ||
| if ( plt.$cssShim$) { | ||
| plt.$cssShim$.removeHost(elm); | ||
| } | ||
| } | ||
| }; | ||
| const bootstrapLazy = (lazyBundles, options = {}) => { | ||
| const endBootstrap = createTime(); | ||
| const cmpTags = []; | ||
| const exclude = options.exclude || []; | ||
| const head = doc.head; | ||
| const customElements = win.customElements; | ||
| const y = /*@__PURE__*/ head.querySelector('meta[charset]'); | ||
| const visibilityStyle = /*@__PURE__*/ doc.createElement('style'); | ||
| const deferredConnectedCallbacks = []; | ||
| let appLoadFallback; | ||
| let isBootstrapping = true; | ||
| Object.assign(plt, options); | ||
| plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href; | ||
| if (options.syncQueue) { | ||
| plt.$flags$ |= 4 /* queueSync */; | ||
| } | ||
| lazyBundles.forEach(lazyBundle => lazyBundle[1].forEach(compactMeta => { | ||
| const cmpMeta = { | ||
| $flags$: compactMeta[0], | ||
| $tagName$: compactMeta[1], | ||
| $members$: compactMeta[2], | ||
| $listeners$: compactMeta[3], | ||
| }; | ||
| { | ||
| cmpMeta.$members$ = compactMeta[2]; | ||
| } | ||
| { | ||
| cmpMeta.$listeners$ = compactMeta[3]; | ||
| } | ||
| if ( !supportsShadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { | ||
| cmpMeta.$flags$ |= 8 /* needsShadowDomShim */; | ||
| } | ||
| const tagName = cmpMeta.$tagName$; | ||
| const HostElement = class extends HTMLElement { | ||
| // StencilLazyHost | ||
| constructor(self) { | ||
| // @ts-ignore | ||
| super(self); | ||
| self = this; | ||
| registerHost(self); | ||
| if ( cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { | ||
| // this component is using shadow dom | ||
| // and this browser supports shadow dom | ||
| // add the read-only property "shadowRoot" to the host element | ||
| // adding the shadow root build conditionals to minimize runtime | ||
| if (supportsShadowDom) { | ||
| { | ||
| self.attachShadow({ mode: 'open' }); | ||
| } | ||
| } | ||
| else if ( !('shadowRoot' in self)) { | ||
| self.shadowRoot = self; | ||
| } | ||
| } | ||
| } | ||
| connectedCallback() { | ||
| if (appLoadFallback) { | ||
| clearTimeout(appLoadFallback); | ||
| appLoadFallback = null; | ||
| } | ||
| if (isBootstrapping) { | ||
| // connectedCallback will be processed once all components have been registered | ||
| deferredConnectedCallbacks.push(this); | ||
| } | ||
| else { | ||
| plt.jmp(() => connectedCallback(this, cmpMeta)); | ||
| } | ||
| } | ||
| disconnectedCallback() { | ||
| plt.jmp(() => disconnectedCallback(this)); | ||
| } | ||
| forceUpdate() { | ||
| forceUpdate(this, cmpMeta); | ||
| } | ||
| componentOnReady() { | ||
| return getHostRef(this).$onReadyPromise$; | ||
| } | ||
| }; | ||
| cmpMeta.$lazyBundleIds$ = lazyBundle[0]; | ||
| if (!exclude.includes(tagName) && !customElements.get(tagName)) { | ||
| cmpTags.push(tagName); | ||
| customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */)); | ||
| } | ||
| })); | ||
| // visibilityStyle.innerHTML = cmpTags.map(t => `${t}:not(.hydrated)`) + '{display:none}'; | ||
| visibilityStyle.innerHTML = cmpTags + '{visibility:hidden}.hydrated{visibility:inherit}'; | ||
| visibilityStyle.setAttribute('data-styles', ''); | ||
| head.insertBefore(visibilityStyle, y ? y.nextSibling : head.firstChild); | ||
| // Process deferred connectedCallbacks now all components have been registered | ||
| isBootstrapping = false; | ||
| if (deferredConnectedCallbacks.length > 0) { | ||
| deferredConnectedCallbacks.forEach(host => host.connectedCallback()); | ||
| } | ||
| else { | ||
| plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, 'timeout')); | ||
| } | ||
| // Fallback appLoad event | ||
| endBootstrap(); | ||
| }; | ||
| const createEvent = (ref, name, flags) => { | ||
| const elm = getElement(ref); | ||
| return { | ||
| emit: (detail) => { | ||
| const ev = new ( CustomEvent)(name, { | ||
| bubbles: !!(flags & 4 /* Bubbles */), | ||
| composed: !!(flags & 2 /* Composed */), | ||
| cancelable: !!(flags & 1 /* Cancellable */), | ||
| detail | ||
| }); | ||
| elm.dispatchEvent(ev); | ||
| return ev; | ||
| } | ||
| }; | ||
| }; | ||
| const getElement = (ref) => getHostRef(ref).$hostElement$ ; | ||
| exports.bootstrapLazy = bootstrapLazy; | ||
| exports.createEvent = createEvent; | ||
| exports.getElement = getElement; | ||
| exports.h = h; | ||
| exports.patchBrowser = patchBrowser; | ||
| exports.patchEsm = patchEsm; | ||
| exports.registerInstance = registerInstance; |
| 'use strict'; | ||
| /* | ||
| Extremely simple css parser. Intended to be not more than what we need | ||
| and definitely not necessarily correct =). | ||
| */ | ||
| /** @unrestricted */ | ||
| var StyleNode = /** @class */ (function () { | ||
| function StyleNode() { | ||
| this.start = 0; | ||
| this.end = 0; | ||
| this.previous = null; | ||
| this.parent = null; | ||
| this.rules = null; | ||
| this.parsedCssText = ''; | ||
| this.cssText = ''; | ||
| this.atRule = false; | ||
| this.type = 0; | ||
| this.keyframesName = ''; | ||
| this.selector = ''; | ||
| this.parsedSelector = ''; | ||
| } | ||
| return StyleNode; | ||
| }()); | ||
| // given a string of css, return a simple rule tree | ||
| /** | ||
| * @param {string} text | ||
| * @return {StyleNode} | ||
| */ | ||
| function parse(text) { | ||
| text = clean(text); | ||
| return parseCss(lex(text), text); | ||
| } | ||
| // remove stuff we don't care about that may hinder parsing | ||
| /** | ||
| * @param {string} cssText | ||
| * @return {string} | ||
| */ | ||
| function clean(cssText) { | ||
| return cssText.replace(RX.comments, '').replace(RX.port, ''); | ||
| } | ||
| // super simple {...} lexer that returns a node tree | ||
| /** | ||
| * @param {string} text | ||
| * @return {StyleNode} | ||
| */ | ||
| function lex(text) { | ||
| var root = new StyleNode(); | ||
| root['start'] = 0; | ||
| root['end'] = text.length; | ||
| var n = root; | ||
| for (var i = 0, l = text.length; i < l; i++) { | ||
| if (text[i] === OPEN_BRACE) { | ||
| if (!n['rules']) { | ||
| n['rules'] = []; | ||
| } | ||
| var p = n; | ||
| var previous = p['rules'][p['rules'].length - 1] || null; | ||
| n = new StyleNode(); | ||
| n['start'] = i + 1; | ||
| n['parent'] = p; | ||
| n['previous'] = previous; | ||
| p['rules'].push(n); | ||
| } | ||
| else if (text[i] === CLOSE_BRACE) { | ||
| n['end'] = i + 1; | ||
| n = n['parent'] || root; | ||
| } | ||
| } | ||
| return root; | ||
| } | ||
| // add selectors/cssText to node tree | ||
| /** | ||
| * @param {StyleNode} node | ||
| * @param {string} text | ||
| * @return {StyleNode} | ||
| */ | ||
| function parseCss(node, text) { | ||
| var t = text.substring(node['start'], node['end'] - 1); | ||
| node['parsedCssText'] = node['cssText'] = t.trim(); | ||
| if (node.parent) { | ||
| var ss = node.previous ? node.previous['end'] : node.parent['start']; | ||
| t = text.substring(ss, node['start'] - 1); | ||
| t = _expandUnicodeEscapes(t); | ||
| t = t.replace(RX.multipleSpaces, ' '); | ||
| // TODO(sorvell): ad hoc; make selector include only after last ; | ||
| // helps with mixin syntax | ||
| t = t.substring(t.lastIndexOf(';') + 1); | ||
| var s = node['parsedSelector'] = node['selector'] = t.trim(); | ||
| node['atRule'] = (s.indexOf(AT_START) === 0); | ||
| // note, support a subset of rule types... | ||
| if (node['atRule']) { | ||
| if (s.indexOf(MEDIA_START) === 0) { | ||
| node['type'] = types.MEDIA_RULE; | ||
| } | ||
| else if (s.match(RX.keyframesRule)) { | ||
| node['type'] = types.KEYFRAMES_RULE; | ||
| node['keyframesName'] = node['selector'].split(RX.multipleSpaces).pop(); | ||
| } | ||
| } | ||
| else { | ||
| if (s.indexOf(VAR_START) === 0) { | ||
| node['type'] = types.MIXIN_RULE; | ||
| } | ||
| else { | ||
| node['type'] = types.STYLE_RULE; | ||
| } | ||
| } | ||
| } | ||
| var r$ = node['rules']; | ||
| if (r$) { | ||
| for (var i = 0, l = r$.length, r = void 0; (i < l) && (r = r$[i]); i++) { | ||
| parseCss(r, text); | ||
| } | ||
| } | ||
| return node; | ||
| } | ||
| /** | ||
| * conversion of sort unicode escapes with spaces like `\33 ` (and longer) into | ||
| * expanded form that doesn't require trailing space `\000033` | ||
| * @param {string} s | ||
| * @return {string} | ||
| */ | ||
| function _expandUnicodeEscapes(s) { | ||
| return s.replace(/\\([0-9a-f]{1,6})\s/gi, function () { | ||
| var code = arguments[1], repeat = 6 - code.length; | ||
| while (repeat--) { | ||
| code = '0' + code; | ||
| } | ||
| return '\\' + code; | ||
| }); | ||
| } | ||
| /** @enum {number} */ | ||
| var types = { | ||
| STYLE_RULE: 1, | ||
| KEYFRAMES_RULE: 7, | ||
| MEDIA_RULE: 4, | ||
| MIXIN_RULE: 1000 | ||
| }; | ||
| var OPEN_BRACE = '{'; | ||
| var CLOSE_BRACE = '}'; | ||
| // helper regexp's | ||
| var RX = { | ||
| comments: /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim, | ||
| port: /@import[^;]*;/gim, | ||
| customProp: /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim, | ||
| mixinProp: /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim, | ||
| mixinApply: /@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim, | ||
| varApply: /[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim, | ||
| keyframesRule: /^@[^\s]*keyframes/, | ||
| multipleSpaces: /\s+/g | ||
| }; | ||
| var VAR_START = '--'; | ||
| var MEDIA_START = '@media'; | ||
| var AT_START = '@'; | ||
| function findRegex(regex, cssText, offset) { | ||
| regex['lastIndex'] = 0; | ||
| var r = cssText.substring(offset).match(regex); | ||
| if (r) { | ||
| var start = offset + r['index']; | ||
| return { | ||
| start: start, | ||
| end: start + r[0].length | ||
| }; | ||
| } | ||
| return null; | ||
| } | ||
| var VAR_USAGE_START = /\bvar\(/; | ||
| var VAR_ASSIGN_START = /\B--[\w-]+\s*:/; | ||
| var COMMENTS = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim; | ||
| var TRAILING_LINES = /^[\t ]+\n/gm; | ||
| function resolveVar(props, prop, fallback) { | ||
| if (props[prop]) { | ||
| return props[prop]; | ||
| } | ||
| if (fallback) { | ||
| return executeTemplate(fallback, props); | ||
| } | ||
| return ''; | ||
| } | ||
| function findVarEndIndex(cssText, offset) { | ||
| var count = 0; | ||
| var i = offset; | ||
| for (; i < cssText.length; i++) { | ||
| var c = cssText[i]; | ||
| if (c === '(') { | ||
| count++; | ||
| } | ||
| else if (c === ')') { | ||
| count--; | ||
| if (count <= 0) { | ||
| return i + 1; | ||
| } | ||
| } | ||
| } | ||
| return i; | ||
| } | ||
| function parseVar(cssText, offset) { | ||
| var varPos = findRegex(VAR_USAGE_START, cssText, offset); | ||
| if (!varPos) { | ||
| return null; | ||
| } | ||
| var endVar = findVarEndIndex(cssText, varPos.start); | ||
| var varContent = cssText.substring(varPos.end, endVar - 1); | ||
| var _a = varContent.split(','), propName = _a[0], fallback = _a.slice(1); | ||
| return { | ||
| start: varPos.start, | ||
| end: endVar, | ||
| propName: propName.trim(), | ||
| fallback: fallback.length > 0 ? fallback.join(',').trim() : undefined | ||
| }; | ||
| } | ||
| function compileVar(cssText, template, offset) { | ||
| var varMeta = parseVar(cssText, offset); | ||
| if (!varMeta) { | ||
| template.push(cssText.substring(offset, cssText.length)); | ||
| return cssText.length; | ||
| } | ||
| var propName = varMeta.propName; | ||
| var fallback = varMeta.fallback != null ? compileTemplate(varMeta.fallback) : undefined; | ||
| template.push(cssText.substring(offset, varMeta.start), function (params) { return resolveVar(params, propName, fallback); }); | ||
| return varMeta.end; | ||
| } | ||
| function executeTemplate(template, props) { | ||
| var final = ''; | ||
| for (var i = 0; i < template.length; i++) { | ||
| var s = template[i]; | ||
| final += (typeof s === 'string') | ||
| ? s | ||
| : s(props); | ||
| } | ||
| return final; | ||
| } | ||
| function findEndValue(cssText, offset) { | ||
| var onStr = false; | ||
| var double = false; | ||
| var i = offset; | ||
| for (; i < cssText.length; i++) { | ||
| var c = cssText[i]; | ||
| if (onStr) { | ||
| if (double && c === '"') { | ||
| onStr = false; | ||
| } | ||
| if (!double && c === '\'') { | ||
| onStr = false; | ||
| } | ||
| } | ||
| else { | ||
| if (c === '"') { | ||
| onStr = true; | ||
| double = true; | ||
| } | ||
| else if (c === '\'') { | ||
| onStr = true; | ||
| double = false; | ||
| } | ||
| else if (c === ';') { | ||
| return i + 1; | ||
| } | ||
| else if (c === '}') { | ||
| return i; | ||
| } | ||
| } | ||
| } | ||
| return i; | ||
| } | ||
| function removeCustomAssigns(cssText) { | ||
| var final = ''; | ||
| var offset = 0; | ||
| while (true) { | ||
| var assignPos = findRegex(VAR_ASSIGN_START, cssText, offset); | ||
| var start = assignPos ? assignPos.start : cssText.length; | ||
| final += cssText.substring(offset, start); | ||
| if (assignPos) { | ||
| offset = findEndValue(cssText, start); | ||
| } | ||
| else { | ||
| break; | ||
| } | ||
| } | ||
| return final; | ||
| } | ||
| function compileTemplate(cssText) { | ||
| var index = 0; | ||
| cssText = cssText.replace(COMMENTS, ''); | ||
| cssText = removeCustomAssigns(cssText) | ||
| .replace(TRAILING_LINES, ''); | ||
| var segments = []; | ||
| while (index < cssText.length) { | ||
| index = compileVar(cssText, segments, index); | ||
| } | ||
| return segments; | ||
| } | ||
| function resolveValues(selectors) { | ||
| var props = {}; | ||
| selectors.forEach(function (selector) { | ||
| selector.declarations.forEach(function (dec) { | ||
| props[dec.prop] = dec.value; | ||
| }); | ||
| }); | ||
| var propsValues = {}; | ||
| var entries = Object.entries(props); | ||
| var _loop_1 = function (i) { | ||
| var dirty = false; | ||
| entries.forEach(function (_a) { | ||
| var key = _a[0], value = _a[1]; | ||
| var propValue = executeTemplate(value, propsValues); | ||
| if (propValue !== propsValues[key]) { | ||
| propsValues[key] = propValue; | ||
| dirty = true; | ||
| } | ||
| }); | ||
| if (!dirty) { | ||
| return "break"; | ||
| } | ||
| }; | ||
| for (var i = 0; i < 10; i++) { | ||
| var state_1 = _loop_1(); | ||
| if (state_1 === "break") | ||
| break; | ||
| } | ||
| return propsValues; | ||
| } | ||
| function getSelectors(root, index) { | ||
| if (index === void 0) { index = 0; } | ||
| if (!root.rules) { | ||
| return []; | ||
| } | ||
| var selectors = []; | ||
| root.rules | ||
| .filter(function (rule) { return rule.type === types.STYLE_RULE; }) | ||
| .forEach(function (rule) { | ||
| var declarations = getDeclarations(rule.cssText); | ||
| if (declarations.length > 0) { | ||
| rule.parsedSelector.split(',').forEach(function (selector) { | ||
| selector = selector.trim(); | ||
| selectors.push({ | ||
| selector: selector, | ||
| declarations: declarations, | ||
| specificity: computeSpecificity(), | ||
| nu: index | ||
| }); | ||
| }); | ||
| } | ||
| index++; | ||
| }); | ||
| return selectors; | ||
| } | ||
| function computeSpecificity(_selector) { | ||
| return 1; | ||
| } | ||
| var IMPORTANT = '!important'; | ||
| var FIND_DECLARATIONS = /(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm; | ||
| function getDeclarations(cssText) { | ||
| var declarations = []; | ||
| var xArray; | ||
| while (xArray = FIND_DECLARATIONS.exec(cssText.trim())) { | ||
| var _a = normalizeValue(xArray[2]), value = _a.value, important = _a.important; | ||
| declarations.push({ | ||
| prop: xArray[1].trim(), | ||
| value: compileTemplate(value), | ||
| important: important, | ||
| }); | ||
| } | ||
| return declarations; | ||
| } | ||
| function normalizeValue(value) { | ||
| var regex = /\s+/gim; | ||
| value = value.replace(regex, ' ').trim(); | ||
| var important = value.endsWith(IMPORTANT); | ||
| if (important) { | ||
| value = value.substr(0, value.length - IMPORTANT.length).trim(); | ||
| } | ||
| return { | ||
| value: value, | ||
| important: important | ||
| }; | ||
| } | ||
| function getActiveSelectors(hostEl, hostScopeMap, globalScopes) { | ||
| // computes the css scopes that might affect this particular element | ||
| // avoiding using spread arrays to avoid ts helper fns when in es5 | ||
| var scopes = []; | ||
| var scopesForElement = getScopesForElement(hostScopeMap, hostEl); | ||
| // globalScopes are always took into account | ||
| globalScopes.forEach(function (s) { return scopes.push(s); }); | ||
| // the parent scopes are computed by walking parent dom until <html> is reached | ||
| scopesForElement.forEach(function (s) { return scopes.push(s); }); | ||
| // each scope might have an array of associated selectors | ||
| // let's flatten the complete array of selectors from all the scopes | ||
| var selectorSet = getSelectorsForScopes(scopes); | ||
| // we filter to only the selectors that matches the hostEl | ||
| var activeSelectors = selectorSet.filter(function (selector) { return matches(hostEl, selector.selector); }); | ||
| // sort selectors by specifity | ||
| return sortSelectors(activeSelectors); | ||
| } | ||
| function getScopesForElement(hostTemplateMap, node) { | ||
| var scopes = []; | ||
| while (node) { | ||
| var scope = hostTemplateMap.get(node); | ||
| if (scope) { | ||
| scopes.push(scope); | ||
| } | ||
| node = node.parentElement; | ||
| } | ||
| return scopes; | ||
| } | ||
| function getSelectorsForScopes(scopes) { | ||
| var selectors = []; | ||
| scopes.forEach(function (scope) { | ||
| selectors.push.apply(selectors, scope.selectors); | ||
| }); | ||
| return selectors; | ||
| } | ||
| function sortSelectors(selectors) { | ||
| selectors.sort(function (a, b) { | ||
| if (a.specificity === b.specificity) { | ||
| return a.nu - b.nu; | ||
| } | ||
| return a.specificity - b.specificity; | ||
| }); | ||
| return selectors; | ||
| } | ||
| function matches(el, selector) { | ||
| return selector === ':root' || selector === 'html' || el.matches(selector); | ||
| } | ||
| function parseCSS(original) { | ||
| var ast = parse(original); | ||
| var template = compileTemplate(original); | ||
| var selectors = getSelectors(ast); | ||
| return { | ||
| original: original, | ||
| template: template, | ||
| selectors: selectors, | ||
| usesCssVars: template.length > 1 | ||
| }; | ||
| } | ||
| function addGlobalStyle(globalScopes, styleEl) { | ||
| if (globalScopes.some(function (css) { return css.styleEl === styleEl; })) { | ||
| return false; | ||
| } | ||
| var css = parseCSS(styleEl.textContent); | ||
| css.styleEl = styleEl; | ||
| globalScopes.push(css); | ||
| return true; | ||
| } | ||
| function updateGlobalScopes(scopes) { | ||
| var selectors = getSelectorsForScopes(scopes); | ||
| var props = resolveValues(selectors); | ||
| scopes.forEach(function (scope) { | ||
| if (scope.usesCssVars) { | ||
| scope.styleEl.textContent = executeTemplate(scope.template, props); | ||
| } | ||
| }); | ||
| } | ||
| function reScope(scope, scopeId) { | ||
| var template = scope.template.map(function (segment) { | ||
| return (typeof segment === 'string') | ||
| ? replaceScope(segment, scope.scopeId, scopeId) | ||
| : segment; | ||
| }); | ||
| var selectors = scope.selectors.map(function (sel) { | ||
| return Object.assign(Object.assign({}, sel), { selector: replaceScope(sel.selector, scope.scopeId, scopeId) }); | ||
| }); | ||
| return Object.assign(Object.assign({}, scope), { template: template, | ||
| selectors: selectors, | ||
| scopeId: scopeId }); | ||
| } | ||
| function replaceScope(original, oldScopeId, newScopeId) { | ||
| original = replaceAll(original, "\\." + oldScopeId, "." + newScopeId); | ||
| return original; | ||
| } | ||
| function replaceAll(input, find, replace) { | ||
| return input.replace(new RegExp(find, 'g'), replace); | ||
| } | ||
| function loadDocument(doc, globalScopes) { | ||
| loadDocumentStyles(doc, globalScopes); | ||
| return loadDocumentLinks(doc, globalScopes).then(function () { | ||
| updateGlobalScopes(globalScopes); | ||
| }); | ||
| } | ||
| function startWatcher(doc, globalScopes) { | ||
| var mutation = new MutationObserver(function () { | ||
| if (loadDocumentStyles(doc, globalScopes)) { | ||
| updateGlobalScopes(globalScopes); | ||
| } | ||
| }); | ||
| mutation.observe(document.head, { childList: true }); | ||
| } | ||
| function loadDocumentLinks(doc, globalScopes) { | ||
| var promises = []; | ||
| var linkElms = doc.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'); | ||
| for (var i = 0; i < linkElms.length; i++) { | ||
| promises.push(addGlobalLink(doc, globalScopes, linkElms[i])); | ||
| } | ||
| return Promise.all(promises); | ||
| } | ||
| function loadDocumentStyles(doc, globalScopes) { | ||
| var styleElms = Array.from(doc.querySelectorAll('style:not([data-styles]):not([data-no-shim])')); | ||
| return styleElms | ||
| .map(function (style) { return addGlobalStyle(globalScopes, style); }) | ||
| .some(Boolean); | ||
| } | ||
| function addGlobalLink(doc, globalScopes, linkElm) { | ||
| var url = linkElm.href; | ||
| return fetch(url).then(function (rsp) { return rsp.text(); }).then(function (text) { | ||
| if (hasCssVariables(text) && linkElm.parentNode) { | ||
| if (hasRelativeUrls(text)) { | ||
| text = fixRelativeUrls(text, url); | ||
| } | ||
| var styleEl = doc.createElement('style'); | ||
| styleEl.setAttribute('data-styles', ''); | ||
| styleEl.textContent = text; | ||
| addGlobalStyle(globalScopes, styleEl); | ||
| linkElm.parentNode.insertBefore(styleEl, linkElm); | ||
| linkElm.remove(); | ||
| } | ||
| }).catch(function (err) { | ||
| console.error(err); | ||
| }); | ||
| } | ||
| // This regexp tries to determine when a variable is declared, for example: | ||
| // | ||
| // .my-el { --highlight-color: green; } | ||
| // | ||
| // but we don't want to trigger when a classname uses "--" or a pseudo-class is | ||
| // used. We assume that the only characters that can preceed a variable | ||
| // declaration are "{", from an opening block, ";" from a preceeding rule, or a | ||
| // space. This prevents the regexp from matching a word in a selector, since | ||
| // they would need to start with a "." or "#". (We assume element names don't | ||
| // start with "--"). | ||
| var CSS_VARIABLE_REGEXP = /[\s;{]--[-a-zA-Z0-9]+\s*:/m; | ||
| function hasCssVariables(css) { | ||
| return css.indexOf('var(') > -1 || CSS_VARIABLE_REGEXP.test(css); | ||
| } | ||
| // This regexp find all url() usages with relative urls | ||
| var CSS_URL_REGEXP = /url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim; | ||
| function hasRelativeUrls(css) { | ||
| CSS_URL_REGEXP.lastIndex = 0; | ||
| return CSS_URL_REGEXP.test(css); | ||
| } | ||
| function fixRelativeUrls(css, originalUrl) { | ||
| // get the basepath from the original import url | ||
| var basePath = originalUrl.replace(/[^/]*$/, ''); | ||
| // replace the relative url, with the new relative url | ||
| return css.replace(CSS_URL_REGEXP, function (fullMatch, url) { | ||
| // rhe new relative path is the base path + uri | ||
| // TODO: normalize relative URL | ||
| var relativeUrl = basePath + url; | ||
| return fullMatch.replace(url, relativeUrl); | ||
| }); | ||
| } | ||
| var CustomStyle = /** @class */ (function () { | ||
| function CustomStyle(win, doc) { | ||
| this.win = win; | ||
| this.doc = doc; | ||
| this.count = 0; | ||
| this.hostStyleMap = new WeakMap(); | ||
| this.hostScopeMap = new WeakMap(); | ||
| this.globalScopes = []; | ||
| this.scopesMap = new Map(); | ||
| this.didInit = false; | ||
| } | ||
| CustomStyle.prototype.initShim = function () { | ||
| var _this = this; | ||
| if (this.didInit) { | ||
| return Promise.resolve(); | ||
| } | ||
| else { | ||
| this.didInit = true; | ||
| return new Promise(function (resolve) { | ||
| _this.win.requestAnimationFrame(function () { | ||
| startWatcher(_this.doc, _this.globalScopes); | ||
| loadDocument(_this.doc, _this.globalScopes).then(function () { return resolve(); }); | ||
| }); | ||
| }); | ||
| } | ||
| }; | ||
| CustomStyle.prototype.addLink = function (linkEl) { | ||
| var _this = this; | ||
| return addGlobalLink(this.doc, this.globalScopes, linkEl).then(function () { | ||
| _this.updateGlobal(); | ||
| }); | ||
| }; | ||
| CustomStyle.prototype.addGlobalStyle = function (styleEl) { | ||
| if (addGlobalStyle(this.globalScopes, styleEl)) { | ||
| this.updateGlobal(); | ||
| } | ||
| }; | ||
| CustomStyle.prototype.createHostStyle = function (hostEl, cssScopeId, cssText, isScoped) { | ||
| if (this.hostScopeMap.has(hostEl)) { | ||
| throw new Error('host style already created'); | ||
| } | ||
| var baseScope = this.registerHostTemplate(cssText, cssScopeId, isScoped); | ||
| var styleEl = this.doc.createElement('style'); | ||
| styleEl.setAttribute('data-no-shim', ''); | ||
| if (!baseScope.usesCssVars) { | ||
| // This component does not use (read) css variables | ||
| styleEl.textContent = cssText; | ||
| } | ||
| else if (isScoped) { | ||
| // This component is dynamic: uses css var and is scoped | ||
| styleEl['s-sc'] = cssScopeId = baseScope.scopeId + "-" + this.count; | ||
| styleEl.textContent = '/*needs update*/'; | ||
| this.hostStyleMap.set(hostEl, styleEl); | ||
| this.hostScopeMap.set(hostEl, reScope(baseScope, cssScopeId)); | ||
| this.count++; | ||
| } | ||
| else { | ||
| // This component uses css vars, but it's no-encapsulation (global static) | ||
| baseScope.styleEl = styleEl; | ||
| if (!baseScope.usesCssVars) { | ||
| styleEl.textContent = executeTemplate(baseScope.template, {}); | ||
| } | ||
| this.globalScopes.push(baseScope); | ||
| this.updateGlobal(); | ||
| this.hostScopeMap.set(hostEl, baseScope); | ||
| } | ||
| return styleEl; | ||
| }; | ||
| CustomStyle.prototype.removeHost = function (hostEl) { | ||
| var css = this.hostStyleMap.get(hostEl); | ||
| if (css) { | ||
| css.remove(); | ||
| } | ||
| this.hostStyleMap.delete(hostEl); | ||
| this.hostScopeMap.delete(hostEl); | ||
| }; | ||
| CustomStyle.prototype.updateHost = function (hostEl) { | ||
| var scope = this.hostScopeMap.get(hostEl); | ||
| if (scope && scope.usesCssVars && scope.isScoped) { | ||
| var styleEl = this.hostStyleMap.get(hostEl); | ||
| if (styleEl) { | ||
| var selectors = getActiveSelectors(hostEl, this.hostScopeMap, this.globalScopes); | ||
| var props = resolveValues(selectors); | ||
| styleEl.textContent = executeTemplate(scope.template, props); | ||
| } | ||
| } | ||
| }; | ||
| CustomStyle.prototype.updateGlobal = function () { | ||
| updateGlobalScopes(this.globalScopes); | ||
| }; | ||
| CustomStyle.prototype.registerHostTemplate = function (cssText, scopeId, isScoped) { | ||
| var scope = this.scopesMap.get(scopeId); | ||
| if (!scope) { | ||
| scope = parseCSS(cssText); | ||
| scope.scopeId = scopeId; | ||
| scope.isScoped = isScoped; | ||
| this.scopesMap.set(scopeId, scope); | ||
| } | ||
| return scope; | ||
| }; | ||
| return CustomStyle; | ||
| }()); | ||
| var win = window; | ||
| function needsShim() { | ||
| return !(win.CSS && win.CSS.supports && win.CSS.supports('color', 'var(--c)')); | ||
| } | ||
| if (!win.__stencil_cssshim && needsShim()) { | ||
| win.__stencil_cssshim = new CustomStyle(win, document); | ||
| } |
| 'use strict'; | ||
| (function(){ | ||
| var aa=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function g(a){var b=aa.has(a);a=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(a);return !b&&a}function l(a){var b=a.isConnected;if(void 0!==b)return b;for(;a&&!(a.__CE_isImportDocument||a instanceof Document);)a=a.parentNode||(window.ShadowRoot&&a instanceof ShadowRoot?a.host:void 0);return !(!a||!(a.__CE_isImportDocument||a instanceof Document))} | ||
| function n(a,b){for(;b&&b!==a&&!b.nextSibling;)b=b.parentNode;return b&&b!==a?b.nextSibling:null} | ||
| function p(a,b,d){d=void 0===d?new Set:d;for(var c=a;c;){if(c.nodeType===Node.ELEMENT_NODE){var e=c;b(e);var f=e.localName;if("link"===f&&"import"===e.getAttribute("rel")){c=e.import;if(c instanceof Node&&!d.has(c))for(d.add(c),c=c.firstChild;c;c=c.nextSibling)p(c,b,d);c=n(a,e);continue}else if("template"===f){c=n(a,e);continue}if(e=e.__CE_shadowRoot)for(e=e.firstChild;e;e=e.nextSibling)p(e,b,d);}c=c.firstChild?c.firstChild:n(a,c);}}function r(a,b,d){a[b]=d;}function u(){this.a=new Map;this.g=new Map;this.c=[];this.f=[];this.b=!1;}function ba(a,b,d){a.a.set(b,d);a.g.set(d.constructorFunction,d);}function ca(a,b){a.b=!0;a.c.push(b);}function da(a,b){a.b=!0;a.f.push(b);}function v(a,b){a.b&&p(b,function(b){return w(a,b)});}function w(a,b){if(a.b&&!b.__CE_patched){b.__CE_patched=!0;for(var d=0;d<a.c.length;d++)a.c[d](b);for(d=0;d<a.f.length;d++)a.f[d](b);}} | ||
| function x(a,b){var d=[];p(b,function(b){return d.push(b)});for(b=0;b<d.length;b++){var c=d[b];1===c.__CE_state?a.connectedCallback(c):y(a,c);}}function z(a,b){var d=[];p(b,function(b){return d.push(b)});for(b=0;b<d.length;b++){var c=d[b];1===c.__CE_state&&a.disconnectedCallback(c);}} | ||
| function A(a,b,d){d=void 0===d?{}:d;var c=d.u||new Set,e=d.i||function(b){return y(a,b)},f=[];p(b,function(b){if("link"===b.localName&&"import"===b.getAttribute("rel")){var d=b.import;d instanceof Node&&(d.__CE_isImportDocument=!0,d.__CE_hasRegistry=!0);d&&"complete"===d.readyState?d.__CE_documentLoadHandled=!0:b.addEventListener("load",function(){var d=b.import;if(!d.__CE_documentLoadHandled){d.__CE_documentLoadHandled=!0;var f=new Set(c);f.delete(d);A(a,d,{u:f,i:e});}});}else f.push(b);},c);if(a.b)for(b= | ||
| 0;b<f.length;b++)w(a,f[b]);for(b=0;b<f.length;b++)e(f[b]);} | ||
| function y(a,b){if(void 0===b.__CE_state){var d=b.ownerDocument;if(d.defaultView||d.__CE_isImportDocument&&d.__CE_hasRegistry)if(d=a.a.get(b.localName)){d.constructionStack.push(b);var c=d.constructorFunction;try{try{if(new c!==b)throw Error("The custom element constructor did not produce the element being upgraded.");}finally{d.constructionStack.pop();}}catch(t){throw b.__CE_state=2,t;}b.__CE_state=1;b.__CE_definition=d;if(d.attributeChangedCallback)for(d=d.observedAttributes,c=0;c<d.length;c++){var e= | ||
| d[c],f=b.getAttribute(e);null!==f&&a.attributeChangedCallback(b,e,null,f,null);}l(b)&&a.connectedCallback(b);}}}u.prototype.connectedCallback=function(a){var b=a.__CE_definition;b.connectedCallback&&b.connectedCallback.call(a);};u.prototype.disconnectedCallback=function(a){var b=a.__CE_definition;b.disconnectedCallback&&b.disconnectedCallback.call(a);}; | ||
| u.prototype.attributeChangedCallback=function(a,b,d,c,e){var f=a.__CE_definition;f.attributeChangedCallback&&-1<f.observedAttributes.indexOf(b)&&f.attributeChangedCallback.call(a,b,d,c,e);};function B(a){var b=document;this.c=a;this.a=b;this.b=void 0;A(this.c,this.a);"loading"===this.a.readyState&&(this.b=new MutationObserver(this.f.bind(this)),this.b.observe(this.a,{childList:!0,subtree:!0}));}function C(a){a.b&&a.b.disconnect();}B.prototype.f=function(a){var b=this.a.readyState;"interactive"!==b&&"complete"!==b||C(this);for(b=0;b<a.length;b++)for(var d=a[b].addedNodes,c=0;c<d.length;c++)A(this.c,d[c]);};function ea(){var a=this;this.b=this.a=void 0;this.c=new Promise(function(b){a.b=b;a.a&&b(a.a);});}function D(a){if(a.a)throw Error("Already resolved.");a.a=void 0;a.b&&a.b(void 0);}function E(a){this.c=!1;this.a=a;this.j=new Map;this.f=function(b){return b()};this.b=!1;this.g=[];this.o=new B(a);} | ||
| E.prototype.l=function(a,b){var d=this;if(!(b instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!g(a))throw new SyntaxError("The element name '"+a+"' is not valid.");if(this.a.a.get(a))throw Error("A custom element with name '"+a+"' has already been defined.");if(this.c)throw Error("A custom element is already being defined.");this.c=!0;try{var c=function(b){var a=e[b];if(void 0!==a&&!(a instanceof Function))throw Error("The '"+b+"' callback must be a function."); | ||
| return a},e=b.prototype;if(!(e instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");var f=c("connectedCallback");var t=c("disconnectedCallback");var k=c("adoptedCallback");var h=c("attributeChangedCallback");var m=b.observedAttributes||[];}catch(q){return}finally{this.c=!1;}b={localName:a,constructorFunction:b,connectedCallback:f,disconnectedCallback:t,adoptedCallback:k,attributeChangedCallback:h,observedAttributes:m,constructionStack:[]};ba(this.a, | ||
| a,b);this.g.push(b);this.b||(this.b=!0,this.f(function(){return fa(d)}));};E.prototype.i=function(a){A(this.a,a);}; | ||
| function fa(a){if(!1!==a.b){a.b=!1;for(var b=a.g,d=[],c=new Map,e=0;e<b.length;e++)c.set(b[e].localName,[]);A(a.a,document,{i:function(b){if(void 0===b.__CE_state){var e=b.localName,f=c.get(e);f?f.push(b):a.a.a.get(e)&&d.push(b);}}});for(e=0;e<d.length;e++)y(a.a,d[e]);for(;0<b.length;){var f=b.shift();e=f.localName;f=c.get(f.localName);for(var t=0;t<f.length;t++)y(a.a,f[t]);(e=a.j.get(e))&&D(e);}}}E.prototype.get=function(a){if(a=this.a.a.get(a))return a.constructorFunction}; | ||
| E.prototype.m=function(a){if(!g(a))return Promise.reject(new SyntaxError("'"+a+"' is not a valid custom element name."));var b=this.j.get(a);if(b)return b.c;b=new ea;this.j.set(a,b);this.a.a.get(a)&&!this.g.some(function(b){return b.localName===a})&&D(b);return b.c};E.prototype.s=function(a){C(this.o);var b=this.f;this.f=function(d){return a(function(){return b(d)})};};window.CustomElementRegistry=E;E.prototype.define=E.prototype.l;E.prototype.upgrade=E.prototype.i;E.prototype.get=E.prototype.get; | ||
| E.prototype.whenDefined=E.prototype.m;E.prototype.polyfillWrapFlushCallback=E.prototype.s;var F=window.Document.prototype.createElement,G=window.Document.prototype.createElementNS,ha=window.Document.prototype.importNode,ia=window.Document.prototype.prepend,ja=window.Document.prototype.append,ka=window.DocumentFragment.prototype.prepend,la=window.DocumentFragment.prototype.append,H=window.Node.prototype.cloneNode,I=window.Node.prototype.appendChild,J=window.Node.prototype.insertBefore,K=window.Node.prototype.removeChild,L=window.Node.prototype.replaceChild,M=Object.getOwnPropertyDescriptor(window.Node.prototype, | ||
| "textContent"),N=window.Element.prototype.attachShadow,O=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),P=window.Element.prototype.getAttribute,Q=window.Element.prototype.setAttribute,R=window.Element.prototype.removeAttribute,S=window.Element.prototype.getAttributeNS,T=window.Element.prototype.setAttributeNS,U=window.Element.prototype.removeAttributeNS,ma=window.Element.prototype.insertAdjacentElement,na=window.Element.prototype.insertAdjacentHTML,oa=window.Element.prototype.prepend, | ||
| pa=window.Element.prototype.append,V=window.Element.prototype.before,qa=window.Element.prototype.after,ra=window.Element.prototype.replaceWith,sa=window.Element.prototype.remove,ta=window.HTMLElement,W=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),ua=window.HTMLElement.prototype.insertAdjacentElement,va=window.HTMLElement.prototype.insertAdjacentHTML;var wa=new function(){};function xa(){var a=X;window.HTMLElement=function(){function b(){var b=this.constructor,c=a.g.get(b);if(!c)throw Error("The custom element being constructed was not registered with `customElements`.");var e=c.constructionStack;if(0===e.length)return e=F.call(document,c.localName),Object.setPrototypeOf(e,b.prototype),e.__CE_state=1,e.__CE_definition=c,w(a,e),e;c=e.length-1;var f=e[c];if(f===wa)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times."); | ||
| e[c]=wa;Object.setPrototypeOf(f,b.prototype);w(a,f);return f}b.prototype=ta.prototype;Object.defineProperty(b.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:b});return b}();}function Y(a,b,d){function c(b){return function(d){for(var e=[],c=0;c<arguments.length;++c)e[c]=arguments[c];c=[];for(var f=[],m=0;m<e.length;m++){var q=e[m];q instanceof Element&&l(q)&&f.push(q);if(q instanceof DocumentFragment)for(q=q.firstChild;q;q=q.nextSibling)c.push(q);else c.push(q);}b.apply(this,e);for(e=0;e<f.length;e++)z(a,f[e]);if(l(this))for(e=0;e<c.length;e++)f=c[e],f instanceof Element&&x(a,f);}}void 0!==d.h&&(b.prepend=c(d.h));void 0!==d.append&&(b.append=c(d.append));}function ya(){var a=X;r(Document.prototype,"createElement",function(b){if(this.__CE_hasRegistry){var d=a.a.get(b);if(d)return new d.constructorFunction}b=F.call(this,b);w(a,b);return b});r(Document.prototype,"importNode",function(b,d){b=ha.call(this,b,!!d);this.__CE_hasRegistry?A(a,b):v(a,b);return b});r(Document.prototype,"createElementNS",function(b,d){if(this.__CE_hasRegistry&&(null===b||"http://www.w3.org/1999/xhtml"===b)){var c=a.a.get(d);if(c)return new c.constructorFunction}b=G.call(this,b, | ||
| d);w(a,b);return b});Y(a,Document.prototype,{h:ia,append:ja});}function za(){function a(a,c){Object.defineProperty(a,"textContent",{enumerable:c.enumerable,configurable:!0,get:c.get,set:function(a){if(this.nodeType===Node.TEXT_NODE)c.set.call(this,a);else{var d=void 0;if(this.firstChild){var e=this.childNodes,k=e.length;if(0<k&&l(this)){d=Array(k);for(var h=0;h<k;h++)d[h]=e[h];}}c.set.call(this,a);if(d)for(a=0;a<d.length;a++)z(b,d[a]);}}});}var b=X;r(Node.prototype,"insertBefore",function(a,c){if(a instanceof DocumentFragment){var e=Array.prototype.slice.apply(a.childNodes); | ||
| a=J.call(this,a,c);if(l(this))for(c=0;c<e.length;c++)x(b,e[c]);return a}e=l(a);c=J.call(this,a,c);e&&z(b,a);l(this)&&x(b,a);return c});r(Node.prototype,"appendChild",function(a){if(a instanceof DocumentFragment){var c=Array.prototype.slice.apply(a.childNodes);a=I.call(this,a);if(l(this))for(var e=0;e<c.length;e++)x(b,c[e]);return a}c=l(a);e=I.call(this,a);c&&z(b,a);l(this)&&x(b,a);return e});r(Node.prototype,"cloneNode",function(a){a=H.call(this,!!a);this.ownerDocument.__CE_hasRegistry?A(b,a):v(b, | ||
| a);return a});r(Node.prototype,"removeChild",function(a){var c=l(a),e=K.call(this,a);c&&z(b,a);return e});r(Node.prototype,"replaceChild",function(a,c){if(a instanceof DocumentFragment){var e=Array.prototype.slice.apply(a.childNodes);a=L.call(this,a,c);if(l(this))for(z(b,c),c=0;c<e.length;c++)x(b,e[c]);return a}e=l(a);var f=L.call(this,a,c),d=l(this);d&&z(b,c);e&&z(b,a);d&&x(b,a);return f});M&&M.get?a(Node.prototype,M):ca(b,function(b){a(b,{enumerable:!0,configurable:!0,get:function(){for(var a=[], | ||
| b=0;b<this.childNodes.length;b++){var f=this.childNodes[b];f.nodeType!==Node.COMMENT_NODE&&a.push(f.textContent);}return a.join("")},set:function(a){for(;this.firstChild;)K.call(this,this.firstChild);null!=a&&""!==a&&I.call(this,document.createTextNode(a));}});});}function Aa(a){function b(b){return function(e){for(var c=[],d=0;d<arguments.length;++d)c[d]=arguments[d];d=[];for(var k=[],h=0;h<c.length;h++){var m=c[h];m instanceof Element&&l(m)&&k.push(m);if(m instanceof DocumentFragment)for(m=m.firstChild;m;m=m.nextSibling)d.push(m);else d.push(m);}b.apply(this,c);for(c=0;c<k.length;c++)z(a,k[c]);if(l(this))for(c=0;c<d.length;c++)k=d[c],k instanceof Element&&x(a,k);}}var d=Element.prototype;void 0!==V&&(d.before=b(V));void 0!==V&&(d.after=b(qa));void 0!==ra&& | ||
| r(d,"replaceWith",function(b){for(var e=[],c=0;c<arguments.length;++c)e[c]=arguments[c];c=[];for(var d=[],k=0;k<e.length;k++){var h=e[k];h instanceof Element&&l(h)&&d.push(h);if(h instanceof DocumentFragment)for(h=h.firstChild;h;h=h.nextSibling)c.push(h);else c.push(h);}k=l(this);ra.apply(this,e);for(e=0;e<d.length;e++)z(a,d[e]);if(k)for(z(a,this),e=0;e<c.length;e++)d=c[e],d instanceof Element&&x(a,d);});void 0!==sa&&r(d,"remove",function(){var b=l(this);sa.call(this);b&&z(a,this);});}function Ba(){function a(a,b){Object.defineProperty(a,"innerHTML",{enumerable:b.enumerable,configurable:!0,get:b.get,set:function(a){var e=this,d=void 0;l(this)&&(d=[],p(this,function(a){a!==e&&d.push(a);}));b.set.call(this,a);if(d)for(var f=0;f<d.length;f++){var t=d[f];1===t.__CE_state&&c.disconnectedCallback(t);}this.ownerDocument.__CE_hasRegistry?A(c,this):v(c,this);return a}});}function b(a,b){r(a,"insertAdjacentElement",function(a,e){var d=l(e);a=b.call(this,a,e);d&&z(c,e);l(a)&&x(c,e);return a});} | ||
| function d(a,b){function e(a,b){for(var e=[];a!==b;a=a.nextSibling)e.push(a);for(b=0;b<e.length;b++)A(c,e[b]);}r(a,"insertAdjacentHTML",function(a,c){a=a.toLowerCase();if("beforebegin"===a){var d=this.previousSibling;b.call(this,a,c);e(d||this.parentNode.firstChild,this);}else if("afterbegin"===a)d=this.firstChild,b.call(this,a,c),e(this.firstChild,d);else if("beforeend"===a)d=this.lastChild,b.call(this,a,c),e(d||this.firstChild,null);else if("afterend"===a)d=this.nextSibling,b.call(this,a,c),e(this.nextSibling, | ||
| d);else throw new SyntaxError("The value provided ("+String(a)+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");});}var c=X;N&&r(Element.prototype,"attachShadow",function(a){a=N.call(this,a);var b=c;if(b.b&&!a.__CE_patched){a.__CE_patched=!0;for(var e=0;e<b.c.length;e++)b.c[e](a);}return this.__CE_shadowRoot=a});O&&O.get?a(Element.prototype,O):W&&W.get?a(HTMLElement.prototype,W):da(c,function(b){a(b,{enumerable:!0,configurable:!0,get:function(){return H.call(this,!0).innerHTML}, | ||
| set:function(a){var b="template"===this.localName,c=b?this.content:this,e=G.call(document,this.namespaceURI,this.localName);for(e.innerHTML=a;0<c.childNodes.length;)K.call(c,c.childNodes[0]);for(a=b?e.content:e;0<a.childNodes.length;)I.call(c,a.childNodes[0]);}});});r(Element.prototype,"setAttribute",function(a,b){if(1!==this.__CE_state)return Q.call(this,a,b);var e=P.call(this,a);Q.call(this,a,b);b=P.call(this,a);c.attributeChangedCallback(this,a,e,b,null);});r(Element.prototype,"setAttributeNS",function(a, | ||
| b,d){if(1!==this.__CE_state)return T.call(this,a,b,d);var e=S.call(this,a,b);T.call(this,a,b,d);d=S.call(this,a,b);c.attributeChangedCallback(this,b,e,d,a);});r(Element.prototype,"removeAttribute",function(a){if(1!==this.__CE_state)return R.call(this,a);var b=P.call(this,a);R.call(this,a);null!==b&&c.attributeChangedCallback(this,a,b,null,null);});r(Element.prototype,"removeAttributeNS",function(a,b){if(1!==this.__CE_state)return U.call(this,a,b);var d=S.call(this,a,b);U.call(this,a,b);var e=S.call(this, | ||
| a,b);d!==e&&c.attributeChangedCallback(this,b,d,e,a);});ua?b(HTMLElement.prototype,ua):ma?b(Element.prototype,ma):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched.");va?d(HTMLElement.prototype,va):na?d(Element.prototype,na):console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched.");Y(c,Element.prototype,{h:oa,append:pa});Aa(c);}var Z=window.customElements;if(!Z||Z.forcePolyfill||"function"!=typeof Z.define||"function"!=typeof Z.get){var X=new u;xa();ya();Y(X,DocumentFragment.prototype,{h:ka,append:la});za();Ba();document.__CE_hasRegistry=!0;var customElements=new E(X);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:customElements});}}).call(self); | ||
| // Polyfill document.baseURI | ||
| if (typeof document.baseURI !== 'string') { | ||
| Object.defineProperty(Document.prototype, 'baseURI', { | ||
| enumerable: true, | ||
| configurable: true, | ||
| get: function () { | ||
| var base = document.querySelector('base'); | ||
| if (base && base.href) { | ||
| return base.href; | ||
| } | ||
| return document.URL; | ||
| } | ||
| }); | ||
| } | ||
| // Polyfill CustomEvent | ||
| if (typeof window.CustomEvent !== 'function') { | ||
| window.CustomEvent = function CustomEvent(event, params) { | ||
| params = params || { bubbles: false, cancelable: false, detail: undefined }; | ||
| var evt = document.createEvent( 'CustomEvent' ); | ||
| evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail ); | ||
| return evt; | ||
| }; | ||
| window.CustomEvent.prototype = window.Event.prototype; | ||
| } | ||
| // Event.composedPath | ||
| (function(E, d, w) { | ||
| if(!E.composedPath) { | ||
| E.composedPath = function() { | ||
| if (this.path) { | ||
| return this.path; | ||
| } | ||
| var target = this.target; | ||
| this.path = []; | ||
| while (target.parentNode !== null) { | ||
| this.path.push(target); | ||
| target = target.parentNode; | ||
| } | ||
| this.path.push(d, w); | ||
| return this.path; | ||
| }; | ||
| } | ||
| })(Event.prototype, document, window); | ||
| /*! | ||
| Element.closest and Element.matches | ||
| https://github.com/jonathantneal/closest | ||
| Creative Commons Zero v1.0 Universal | ||
| */ | ||
| (function(a){"function"!==typeof a.matches&&(a.matches=a.msMatchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||function(a){a=(this.document||this.ownerDocument).querySelectorAll(a);for(var b=0;a[b]&&a[b]!==this;)++b;return !!a[b]});"function"!==typeof a.closest&&(a.closest=function(a){for(var b=this;b&&1===b.nodeType;){if(b.matches(a))return b;b=b.parentNode;}return null});})(window.Element.prototype); | ||
| /*! | ||
| Element.getRootNode() | ||
| */ | ||
| (function(c){function d(a){a=b(a);return a&&11===a.nodeType?d(a.host):a}function b(a){return a&&a.parentNode?b(a.parentNode):a}"function"!==typeof c.getRootNode&&(c.getRootNode=function(a){return a&&a.composed?d(this):b(this)});})(Element.prototype); | ||
| /*! | ||
| Element.isConnected() | ||
| */ | ||
| (function(prototype) { | ||
| if (!("isConnected" in prototype)) { | ||
| Object.defineProperty(prototype, 'isConnected', { | ||
| configurable: true, | ||
| enumerable: true, | ||
| get: function() { | ||
| var root = this.getRootNode({composed: true}); | ||
| return root && root.nodeType === 9; | ||
| } | ||
| }); | ||
| } | ||
| })(Element.prototype); | ||
| /*! | ||
| Element.remove() | ||
| */ | ||
| (function(b){b.forEach(function(a){a.hasOwnProperty("remove")||Object.defineProperty(a,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this);}});});})([Element.prototype,CharacterData.prototype,DocumentType.prototype]); | ||
| /*! | ||
| Element.classList | ||
| */ | ||
| !function(e){'classList'in e||Object.defineProperty(e,"classList",{get:function(){var e=this,t=(e.getAttribute("class")||"").replace(/^\s+|\s$/g,"").split(/\s+/g);function n(){t.length>0?e.setAttribute("class",t.join(" ")):e.removeAttribute("class");}return ""===t[0]&&t.splice(0,1),t.toggle=function(e,i){void 0!==i?i?t.add(e):t.remove(e):-1!==t.indexOf(e)?t.splice(t.indexOf(e),1):t.push(e),n();},t.add=function(){for(var e=[].slice.call(arguments),i=0,s=e.length;i<s;i++)-1===t.indexOf(e[i])&&t.push(e[i]);n();},t.remove=function(){for(var e=[].slice.call(arguments),i=0,s=e.length;i<s;i++)-1!==t.indexOf(e[i])&&t.splice(t.indexOf(e[i]),1);n();},t.item=function(e){return t[e]},t.contains=function(e){return -1!==t.indexOf(e)},t.replace=function(e,i){-1!==t.indexOf(e)&&t.splice(t.indexOf(e),1,i),n();},t.value=e.getAttribute("class")||"",t}});}(Element.prototype); | ||
| /*! | ||
| DOMTokenList | ||
| */ | ||
| (function(prototype){ | ||
| try { | ||
| document.body.classList.add(); | ||
| } catch (e) { | ||
| var originalAdd = prototype.add; | ||
| var originalRemove = prototype.remove; | ||
| prototype.add = function() { | ||
| for (var i = 0; i < arguments.length; i++) { | ||
| originalAdd.call(this, arguments[i]); | ||
| } | ||
| }; | ||
| prototype.remove = function() { | ||
| for (var i = 0; i < arguments.length; i++) { | ||
| originalRemove.call(this, arguments[i]); | ||
| } | ||
| }; | ||
| } | ||
| }(DOMTokenList.prototype)); |
| 'use strict'; | ||
| /** | ||
| * @license | ||
| * Copyright Google Inc. All Rights Reserved. | ||
| * | ||
| * Use of this source code is governed by an MIT-style license that can be | ||
| * found in the LICENSE file at https://angular.io/license | ||
| * | ||
| * This file is a port of shadowCSS from webcomponents.js to TypeScript. | ||
| * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js | ||
| * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts | ||
| */ | ||
| const safeSelector = (selector) => { | ||
| const placeholders = []; | ||
| let index = 0; | ||
| let content; | ||
| // Replaces attribute selectors with placeholders. | ||
| // The WS in [attr="va lue"] would otherwise be interpreted as a selector separator. | ||
| selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => { | ||
| const replaceBy = `__ph-${index}__`; | ||
| placeholders.push(keep); | ||
| index++; | ||
| return replaceBy; | ||
| }); | ||
| // Replaces the expression in `:nth-child(2n + 1)` with a placeholder. | ||
| // WS and "+" would otherwise be interpreted as selector separators. | ||
| content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => { | ||
| const replaceBy = `__ph-${index}__`; | ||
| placeholders.push(exp); | ||
| index++; | ||
| return pseudo + replaceBy; | ||
| }); | ||
| const ss = { | ||
| content, | ||
| placeholders, | ||
| }; | ||
| return ss; | ||
| }; | ||
| const restoreSafeSelector = (placeholders, content) => { | ||
| return content.replace(/__ph-(\d+)__/g, (_, index) => placeholders[+index]); | ||
| }; | ||
| const _polyfillHost = '-shadowcsshost'; | ||
| const _polyfillSlotted = '-shadowcssslotted'; | ||
| // note: :host-context pre-processed to -shadowcsshostcontext. | ||
| const _polyfillHostContext = '-shadowcsscontext'; | ||
| const _parenSuffix = ')(?:\\((' + | ||
| '(?:\\([^)(]*\\)|[^)(]*)+?' + | ||
| ')\\))?([^,{]*)'; | ||
| const _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim'); | ||
| const _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim'); | ||
| const _cssColonSlottedRe = new RegExp('(' + _polyfillSlotted + _parenSuffix, 'gim'); | ||
| const _polyfillHostNoCombinator = _polyfillHost + '-no-combinator'; | ||
| const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/; | ||
| const _shadowDOMSelectorsRe = [ | ||
| /::shadow/g, | ||
| /::content/g | ||
| ]; | ||
| const _selectorReSuffix = '([>\\s~+\[.,{:][\\s\\S]*)?$'; | ||
| const _polyfillHostRe = /-shadowcsshost/gim; | ||
| const _colonHostRe = /:host/gim; | ||
| const _colonSlottedRe = /::slotted/gim; | ||
| const _colonHostContextRe = /:host-context/gim; | ||
| const _commentRe = /\/\*\s*[\s\S]*?\*\//g; | ||
| const stripComments = (input) => { | ||
| return input.replace(_commentRe, ''); | ||
| }; | ||
| const _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g; | ||
| const extractCommentsWithHash = (input) => { | ||
| return input.match(_commentWithHashRe) || []; | ||
| }; | ||
| const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g; | ||
| const _curlyRe = /([{}])/g; | ||
| const OPEN_CURLY = '{'; | ||
| const CLOSE_CURLY = '}'; | ||
| const BLOCK_PLACEHOLDER = '%BLOCK%'; | ||
| const processRules = (input, ruleCallback) => { | ||
| const inputWithEscapedBlocks = escapeBlocks(input); | ||
| let nextBlockIndex = 0; | ||
| return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => { | ||
| const selector = m[2]; | ||
| let content = ''; | ||
| let suffix = m[4]; | ||
| let contentPrefix = ''; | ||
| if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) { | ||
| content = inputWithEscapedBlocks.blocks[nextBlockIndex++]; | ||
| suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1); | ||
| contentPrefix = '{'; | ||
| } | ||
| const cssRule = { | ||
| selector, | ||
| content | ||
| }; | ||
| const rule = ruleCallback(cssRule); | ||
| return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`; | ||
| }); | ||
| }; | ||
| const escapeBlocks = (input) => { | ||
| const inputParts = input.split(_curlyRe); | ||
| const resultParts = []; | ||
| const escapedBlocks = []; | ||
| let bracketCount = 0; | ||
| let currentBlockParts = []; | ||
| for (let partIndex = 0; partIndex < inputParts.length; partIndex++) { | ||
| const part = inputParts[partIndex]; | ||
| if (part === CLOSE_CURLY) { | ||
| bracketCount--; | ||
| } | ||
| if (bracketCount > 0) { | ||
| currentBlockParts.push(part); | ||
| } | ||
| else { | ||
| if (currentBlockParts.length > 0) { | ||
| escapedBlocks.push(currentBlockParts.join('')); | ||
| resultParts.push(BLOCK_PLACEHOLDER); | ||
| currentBlockParts = []; | ||
| } | ||
| resultParts.push(part); | ||
| } | ||
| if (part === OPEN_CURLY) { | ||
| bracketCount++; | ||
| } | ||
| } | ||
| if (currentBlockParts.length > 0) { | ||
| escapedBlocks.push(currentBlockParts.join('')); | ||
| resultParts.push(BLOCK_PLACEHOLDER); | ||
| } | ||
| const strEscapedBlocks = { | ||
| escapedString: resultParts.join(''), | ||
| blocks: escapedBlocks | ||
| }; | ||
| return strEscapedBlocks; | ||
| }; | ||
| const insertPolyfillHostInCssText = (selector) => { | ||
| selector = selector | ||
| .replace(_colonHostContextRe, _polyfillHostContext) | ||
| .replace(_colonHostRe, _polyfillHost) | ||
| .replace(_colonSlottedRe, _polyfillSlotted); | ||
| return selector; | ||
| }; | ||
| const convertColonRule = (cssText, regExp, partReplacer) => { | ||
| // m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule | ||
| return cssText.replace(regExp, (...m) => { | ||
| if (m[2]) { | ||
| const parts = m[2].split(','); | ||
| const r = []; | ||
| for (let i = 0; i < parts.length; i++) { | ||
| const p = parts[i].trim(); | ||
| if (!p) | ||
| break; | ||
| r.push(partReplacer(_polyfillHostNoCombinator, p, m[3])); | ||
| } | ||
| return r.join(','); | ||
| } | ||
| else { | ||
| return _polyfillHostNoCombinator + m[3]; | ||
| } | ||
| }); | ||
| }; | ||
| const colonHostPartReplacer = (host, part, suffix) => { | ||
| return host + part.replace(_polyfillHost, '') + suffix; | ||
| }; | ||
| const convertColonHost = (cssText) => { | ||
| return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer); | ||
| }; | ||
| const colonHostContextPartReplacer = (host, part, suffix) => { | ||
| if (part.indexOf(_polyfillHost) > -1) { | ||
| return colonHostPartReplacer(host, part, suffix); | ||
| } | ||
| else { | ||
| return host + part + suffix + ', ' + part + ' ' + host + suffix; | ||
| } | ||
| }; | ||
| const convertColonSlotted = (cssText, slotAttr) => { | ||
| const regExp = _cssColonSlottedRe; | ||
| return cssText.replace(regExp, (...m) => { | ||
| if (m[2]) { | ||
| const compound = m[2].trim(); | ||
| const suffix = m[3]; | ||
| const sel = '.' + slotAttr + ' > ' + compound + suffix; | ||
| return sel; | ||
| } | ||
| else { | ||
| return _polyfillHostNoCombinator + m[3]; | ||
| } | ||
| }); | ||
| }; | ||
| const convertColonHostContext = (cssText) => { | ||
| return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer); | ||
| }; | ||
| const convertShadowDOMSelectors = (cssText) => { | ||
| return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText); | ||
| }; | ||
| const makeScopeMatcher = (scopeSelector) => { | ||
| const lre = /\[/g; | ||
| const rre = /\]/g; | ||
| scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]'); | ||
| return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm'); | ||
| }; | ||
| const selectorNeedsScoping = (selector, scopeSelector) => { | ||
| const re = makeScopeMatcher(scopeSelector); | ||
| return !re.test(selector); | ||
| }; | ||
| const applySimpleSelectorScope = (selector, scopeSelector, hostSelector) => { | ||
| // In Android browser, the lastIndex is not reset when the regex is used in String.replace() | ||
| _polyfillHostRe.lastIndex = 0; | ||
| if (_polyfillHostRe.test(selector)) { | ||
| const replaceBy = `.${hostSelector}`; | ||
| return selector | ||
| .replace(_polyfillHostNoCombinatorRe, (_, selector) => { | ||
| return selector.replace(/([^:]*)(:*)(.*)/, (_, before, colon, after) => { | ||
| return before + replaceBy + colon + after; | ||
| }); | ||
| }) | ||
| .replace(_polyfillHostRe, replaceBy + ' '); | ||
| } | ||
| return scopeSelector + ' ' + selector; | ||
| }; | ||
| const applyStrictSelectorScope = (selector, scopeSelector, hostSelector) => { | ||
| const isRe = /\[is=([^\]]*)\]/g; | ||
| scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]); | ||
| const className = '.' + scopeSelector; | ||
| const _scopeSelectorPart = (p) => { | ||
| let scopedP = p.trim(); | ||
| if (!scopedP) { | ||
| return ''; | ||
| } | ||
| if (p.indexOf(_polyfillHostNoCombinator) > -1) { | ||
| scopedP = applySimpleSelectorScope(p, scopeSelector, hostSelector); | ||
| } | ||
| else { | ||
| // remove :host since it should be unnecessary | ||
| const t = p.replace(_polyfillHostRe, ''); | ||
| if (t.length > 0) { | ||
| const matches = t.match(/([^:]*)(:*)(.*)/); | ||
| if (matches) { | ||
| scopedP = matches[1] + className + matches[2] + matches[3]; | ||
| } | ||
| } | ||
| } | ||
| return scopedP; | ||
| }; | ||
| const safeContent = safeSelector(selector); | ||
| selector = safeContent.content; | ||
| let scopedSelector = ''; | ||
| let startIndex = 0; | ||
| let res; | ||
| const sep = /( |>|\+|~(?!=))\s*/g; | ||
| // If a selector appears before :host it should not be shimmed as it | ||
| // matches on ancestor elements and not on elements in the host's shadow | ||
| // `:host-context(div)` is transformed to | ||
| // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator` | ||
| // the `div` is not part of the component in the 2nd selectors and should not be scoped. | ||
| // Historically `component-tag:host` was matching the component so we also want to preserve | ||
| // this behavior to avoid breaking legacy apps (it should not match). | ||
| // The behavior should be: | ||
| // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything) | ||
| // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a | ||
| // `:host-context(tag)`) | ||
| const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1; | ||
| // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present | ||
| let shouldScope = !hasHost; | ||
| while ((res = sep.exec(selector)) !== null) { | ||
| const separator = res[1]; | ||
| const part = selector.slice(startIndex, res.index).trim(); | ||
| shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1; | ||
| const scopedPart = shouldScope ? _scopeSelectorPart(part) : part; | ||
| scopedSelector += `${scopedPart} ${separator} `; | ||
| startIndex = sep.lastIndex; | ||
| } | ||
| const part = selector.substring(startIndex); | ||
| shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1; | ||
| scopedSelector += shouldScope ? _scopeSelectorPart(part) : part; | ||
| // replace the placeholders with their original values | ||
| return restoreSafeSelector(safeContent.placeholders, scopedSelector); | ||
| }; | ||
| const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => { | ||
| return selector.split(',') | ||
| .map(shallowPart => { | ||
| if (slotSelector && shallowPart.indexOf('.' + slotSelector) > -1) { | ||
| return shallowPart.trim(); | ||
| } | ||
| if (selectorNeedsScoping(shallowPart, scopeSelectorText)) { | ||
| return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim(); | ||
| } | ||
| else { | ||
| return shallowPart.trim(); | ||
| } | ||
| }) | ||
| .join(', '); | ||
| }; | ||
| const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => { | ||
| return processRules(cssText, (rule) => { | ||
| let selector = rule.selector; | ||
| let content = rule.content; | ||
| if (rule.selector[0] !== '@') { | ||
| selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector); | ||
| } | ||
| else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') || | ||
| rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) { | ||
| content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector); | ||
| } | ||
| const cssRule = { | ||
| selector: selector.replace(/\s{2,}/g, ' ').trim(), | ||
| content | ||
| }; | ||
| return cssRule; | ||
| }); | ||
| }; | ||
| const scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => { | ||
| cssText = insertPolyfillHostInCssText(cssText); | ||
| cssText = convertColonHost(cssText); | ||
| cssText = convertColonHostContext(cssText); | ||
| cssText = convertColonSlotted(cssText, slotScopeId); | ||
| cssText = convertShadowDOMSelectors(cssText); | ||
| if (scopeId) { | ||
| cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId); | ||
| } | ||
| cssText = cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`); | ||
| cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, ' $1 '); | ||
| return cssText.trim(); | ||
| }; | ||
| const scopeCss = (cssText, scopeId, commentOriginalSelector) => { | ||
| const hostScopeId = scopeId + '-h'; | ||
| const slotScopeId = scopeId + '-s'; | ||
| const commentsWithHash = extractCommentsWithHash(cssText); | ||
| cssText = stripComments(cssText); | ||
| const orgSelectors = []; | ||
| if (commentOriginalSelector) { | ||
| const processCommentedSelector = (rule) => { | ||
| const placeholder = `/*!@___${orgSelectors.length}___*/`; | ||
| const comment = `/*!@${rule.selector}*/`; | ||
| orgSelectors.push({ placeholder, comment }); | ||
| rule.selector = placeholder + rule.selector; | ||
| return rule; | ||
| }; | ||
| cssText = processRules(cssText, rule => { | ||
| if (rule.selector[0] !== '@') { | ||
| return processCommentedSelector(rule); | ||
| } | ||
| else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') || | ||
| rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) { | ||
| rule.content = processRules(rule.content, processCommentedSelector); | ||
| return rule; | ||
| } | ||
| return rule; | ||
| }); | ||
| } | ||
| const scopedCssText = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId); | ||
| cssText = [scopedCssText, ...commentsWithHash].join('\n'); | ||
| if (commentOriginalSelector) { | ||
| orgSelectors.forEach(({ placeholder, comment }) => { | ||
| cssText = cssText.replace(placeholder, comment); | ||
| }); | ||
| } | ||
| return cssText; | ||
| }; | ||
| exports.scopeCss = scopeCss; |
| var __extends = (this && this.__extends) || (function () { | ||
| var extendStatics = function (d, b) { | ||
| extendStatics = Object.setPrototypeOf || | ||
| ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
| function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
| return extendStatics(d, b); | ||
| }; | ||
| return function (d, b) { | ||
| extendStatics(d, b); | ||
| function __() { this.constructor = d; } | ||
| d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
| }; | ||
| })(); | ||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
| return new (P || (P = Promise))(function (resolve, reject) { | ||
| function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
| function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
| function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
| step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
| }); | ||
| }; | ||
| var __generator = (this && this.__generator) || function (thisArg, body) { | ||
| var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
| return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
| function verb(n) { return function (v) { return step([n, v]); }; } | ||
| function step(op) { | ||
| if (f) throw new TypeError("Generator is already executing."); | ||
| while (_) try { | ||
| if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
| if (y = 0, t) op = [op[0] & 2, t.value]; | ||
| switch (op[0]) { | ||
| case 0: case 1: t = op; break; | ||
| case 4: _.label++; return { value: op[1], done: false }; | ||
| case 5: _.label++; y = op[1]; op = [0]; continue; | ||
| case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
| default: | ||
| if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
| if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
| if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
| if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
| if (t[2]) _.ops.pop(); | ||
| _.trys.pop(); continue; | ||
| } | ||
| op = body.call(thisArg, _); | ||
| } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
| if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
| } | ||
| }; | ||
| var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
| for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
| for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
| for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
| r[k] = a[j]; | ||
| return r; | ||
| }; | ||
| var NAMESPACE = 'msf-editor'; | ||
| var queueCongestion = 0; | ||
| var queuePending = false; | ||
| var scopeId; | ||
| var hostTagName; | ||
| var isSvgMode = false; | ||
| var win = typeof window !== 'undefined' ? window : {}; | ||
| var doc = win.document || { head: {} }; | ||
| var plt = { | ||
| $flags$: 0, | ||
| $resourcesUrl$: '', | ||
| jmp: function (h) { return h(); }, | ||
| raf: function (h) { return requestAnimationFrame(h); }, | ||
| ael: function (el, eventName, listener, opts) { return el.addEventListener(eventName, listener, opts); }, | ||
| rel: function (el, eventName, listener, opts) { return el.removeEventListener(eventName, listener, opts); }, | ||
| }; | ||
| var supportsShadowDom = /*@__PURE__*/ (function () { return (doc.head.attachShadow + '').includes('[native'); })(); | ||
| var supportsListenerOptions = /*@__PURE__*/ (function () { | ||
| var supportsListenerOptions = false; | ||
| try { | ||
| doc.addEventListener('e', null, Object.defineProperty({}, 'passive', { | ||
| get: function () { supportsListenerOptions = true; } | ||
| })); | ||
| } | ||
| catch (e) { } | ||
| return supportsListenerOptions; | ||
| })(); | ||
| var supportsConstructibleStylesheets = /*@__PURE__*/ (function () { | ||
| try { | ||
| new CSSStyleSheet(); | ||
| return true; | ||
| } | ||
| catch (e) { } | ||
| return false; | ||
| })(); | ||
| var hostRefs = new WeakMap(); | ||
| var getHostRef = function (ref) { return hostRefs.get(ref); }; | ||
| var registerInstance = function (lazyInstance, hostRef) { return hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef); }; | ||
| var registerHost = function (elm) { | ||
| var hostRef = { | ||
| $flags$: 0, | ||
| $hostElement$: elm, | ||
| $instanceValues$: new Map() | ||
| }; | ||
| { | ||
| hostRef.$onInstancePromise$ = new Promise(function (r) { return hostRef.$onInstanceResolve$ = r; }); | ||
| } | ||
| { | ||
| hostRef.$onReadyPromise$ = new Promise(function (r) { return hostRef.$onReadyResolve$ = r; }); | ||
| elm['s-p'] = []; | ||
| elm['s-rc'] = []; | ||
| } | ||
| return hostRefs.set(elm, hostRef); | ||
| }; | ||
| var isMemberInElement = function (elm, memberName) { return memberName in elm; }; | ||
| var consoleError = function (e) { return console.error(e); }; | ||
| var moduleCache = /*@__PURE__*/ new Map(); | ||
| var loadModule = function (cmpMeta, hostRef, hmrVersionId) { | ||
| // loadModuleImport | ||
| var exportName = cmpMeta.$tagName$.replace(/-/g, '_'); | ||
| var bundleId = (cmpMeta.$lazyBundleIds$); | ||
| var module = moduleCache.get(bundleId); | ||
| if (module) { | ||
| return module[exportName]; | ||
| } | ||
| return import( | ||
| /* webpackInclude: /\.entry\.js$/ */ | ||
| /* webpackExclude: /\.system\.entry\.js$/ */ | ||
| /* webpackMode: "lazy" */ | ||
| "./" + bundleId + ".entry.js" + '').then(function (importedModule) { | ||
| { | ||
| moduleCache.set(bundleId, importedModule); | ||
| } | ||
| return importedModule[exportName]; | ||
| }, consoleError); | ||
| }; | ||
| var styles = new Map(); | ||
| var queueDomReads = []; | ||
| var queueDomWrites = []; | ||
| var queueDomWritesLow = []; | ||
| var queueTask = function (queue, write) { return function (cb) { | ||
| queue.push(cb); | ||
| if (!queuePending) { | ||
| queuePending = true; | ||
| if (write && plt.$flags$ & 4 /* queueSync */) { | ||
| nextTick(flush); | ||
| } | ||
| else { | ||
| plt.raf(flush); | ||
| } | ||
| } | ||
| }; }; | ||
| var consume = function (queue) { | ||
| for (var i = 0; i < queue.length; i++) { | ||
| try { | ||
| queue[i](performance.now()); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| queue.length = 0; | ||
| }; | ||
| var consumeTimeout = function (queue, timeout) { | ||
| var i = 0; | ||
| var ts = 0; | ||
| while (i < queue.length && (ts = performance.now()) < timeout) { | ||
| try { | ||
| queue[i++](ts); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| if (i === queue.length) { | ||
| queue.length = 0; | ||
| } | ||
| else if (i !== 0) { | ||
| queue.splice(0, i); | ||
| } | ||
| }; | ||
| var flush = function () { | ||
| queueCongestion++; | ||
| // always force a bunch of medium callbacks to run, but still have | ||
| // a throttle on how many can run in a certain time | ||
| // DOM READS!!! | ||
| consume(queueDomReads); | ||
| var timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */ | ||
| ? performance.now() + (10 * Math.ceil(queueCongestion * (1.0 / 22.0))) | ||
| : Infinity; | ||
| // DOM WRITES!!! | ||
| consumeTimeout(queueDomWrites, timeout); | ||
| consumeTimeout(queueDomWritesLow, timeout); | ||
| if (queueDomWrites.length > 0) { | ||
| queueDomWritesLow.push.apply(queueDomWritesLow, queueDomWrites); | ||
| queueDomWrites.length = 0; | ||
| } | ||
| if (queuePending = ((queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length) > 0)) { | ||
| // still more to do yet, but we've run out of time | ||
| // let's let this thing cool off and try again in the next tick | ||
| plt.raf(flush); | ||
| } | ||
| else { | ||
| queueCongestion = 0; | ||
| } | ||
| }; | ||
| var nextTick = /*@__PURE__*/ function (cb) { return Promise.resolve().then(cb); }; | ||
| var writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true); | ||
| /** | ||
| * Default style mode id | ||
| */ | ||
| /** | ||
| * Reusable empty obj/array | ||
| * Don't add values to these!! | ||
| */ | ||
| var EMPTY_OBJ = {}; | ||
| var isDef = function (v) { return v != null; }; | ||
| var isComplexType = function (o) { | ||
| // https://jsperf.com/typeof-fn-object/5 | ||
| o = typeof o; | ||
| return o === 'object' || o === 'function'; | ||
| }; | ||
| var getDynamicImportFunction = function (namespace) { | ||
| return "__sc_import_" + namespace.replace(/\s|-/g, '_'); | ||
| }; | ||
| var patchEsm = function () { | ||
| // @ts-ignore | ||
| if (!(win.CSS && win.CSS.supports && win.CSS.supports('color', 'var(--c)'))) { | ||
| // @ts-ignore | ||
| return import('./css-shim-6aaf713d-9b13816a.js').then(function () { | ||
| plt.$cssShim$ = win.__stencil_cssshim; | ||
| if (plt.$cssShim$) { | ||
| return plt.$cssShim$.initShim(); | ||
| } | ||
| }); | ||
| } | ||
| return Promise.resolve(); | ||
| }; | ||
| var patchBrowser = function () { | ||
| { | ||
| // shim css vars | ||
| plt.$cssShim$ = win.__stencil_cssshim; | ||
| } | ||
| // @ts-ignore | ||
| var scriptElm = Array.from(doc.querySelectorAll('script')).find(function (s) { return (new RegExp("/" + NAMESPACE + "(\\.esm)?\\.js($|\\?|#)").test(s.src) || | ||
| s.getAttribute('data-stencil-namespace') === NAMESPACE); }); | ||
| var opts = scriptElm['data-opts'] || {}; | ||
| var importMeta = ""; | ||
| if ('onbeforeload' in scriptElm && !history.scrollRestoration && false /* IS_SYSTEM_JS_BUILD */) { | ||
| // Safari < v11 support: This IF is true if it's Safari below v11. | ||
| // This fn cannot use async/await since Safari didn't support it until v11, | ||
| // however, Safari 10 did support modules. Safari 10 also didn't support "nomodule", | ||
| // so both the ESM file and nomodule file would get downloaded. Only Safari | ||
| // has 'onbeforeload' in the script, and "history.scrollRestoration" was added | ||
| // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue. | ||
| // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds. | ||
| return { then: function () { } }; | ||
| } | ||
| if (importMeta !== '') { | ||
| opts.resourcesUrl = new URL('.', importMeta).href; | ||
| } | ||
| else { | ||
| opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href; | ||
| patchDynamicImport(opts.resourcesUrl, scriptElm); | ||
| if (!window.customElements) { | ||
| // module support, but no custom elements support (Old Edge) | ||
| // @ts-ignore | ||
| return import('./dom-76cc7c7d-0a082895.js').then(function () { return opts; }); | ||
| } | ||
| } | ||
| return Promise.resolve(opts); | ||
| }; | ||
| var patchDynamicImport = function (base, orgScriptElm) { | ||
| var importFunctionName = getDynamicImportFunction(NAMESPACE); | ||
| try { | ||
| // test if this browser supports dynamic imports | ||
| // There is a caching issue in V8, that breaks using import() in Function | ||
| // By generating a random string, we can workaround it | ||
| // Check https://bugs.chromium.org/p/v8/issues/detail?id=9558 for more info | ||
| win[importFunctionName] = new Function('w', "return import(w);//" + Math.random()); | ||
| } | ||
| catch (e) { | ||
| // this shim is specifically for browsers that do support "esm" imports | ||
| // however, they do NOT support "dynamic" imports | ||
| // basically this code is for old Edge, v18 and below | ||
| var moduleMap_1 = new Map(); | ||
| win[importFunctionName] = function (src) { | ||
| var url = new URL(src, base).href; | ||
| var mod = moduleMap_1.get(url); | ||
| if (!mod) { | ||
| var script_1 = doc.createElement('script'); | ||
| script_1.type = 'module'; | ||
| script_1.crossOrigin = orgScriptElm.crossOrigin; | ||
| script_1.src = URL.createObjectURL(new Blob(["import * as m from '" + url + "'; window." + importFunctionName + ".m = m;"], { type: 'application/javascript' })); | ||
| mod = new Promise(function (resolve) { | ||
| script_1.onload = function () { | ||
| resolve(win[importFunctionName].m); | ||
| script_1.remove(); | ||
| }; | ||
| }); | ||
| moduleMap_1.set(url, mod); | ||
| doc.head.appendChild(script_1); | ||
| } | ||
| return mod; | ||
| }; | ||
| } | ||
| }; | ||
| var parsePropertyValue = function (propValue, propType) { | ||
| // ensure this value is of the correct prop type | ||
| if (propValue != null && !isComplexType(propValue)) { | ||
| if (propType & 1 /* String */) { | ||
| // could have been passed as a number or boolean | ||
| // but we still want it as a string | ||
| return String(propValue); | ||
| } | ||
| // redundant return here for better minification | ||
| return propValue; | ||
| } | ||
| // not sure exactly what type we want | ||
| // so no need to change to a different type | ||
| return propValue; | ||
| }; | ||
| var HYDRATED_CLASS = 'hydrated'; | ||
| var createTime = function (fnName, tagName) { | ||
| if (tagName === void 0) { tagName = ''; } | ||
| { | ||
| return function () { return; }; | ||
| } | ||
| }; | ||
| var uniqueTime = function (key, measureText) { | ||
| { | ||
| return function () { return; }; | ||
| } | ||
| }; | ||
| var rootAppliedStyles = new WeakMap(); | ||
| var registerStyle = function (scopeId, cssText, allowCS) { | ||
| var style = styles.get(scopeId); | ||
| if (supportsConstructibleStylesheets && allowCS) { | ||
| style = (style || new CSSStyleSheet()); | ||
| style.replace(cssText); | ||
| } | ||
| else { | ||
| style = cssText; | ||
| } | ||
| styles.set(scopeId, style); | ||
| }; | ||
| var addStyle = function (styleContainerNode, cmpMeta, mode, hostElm) { | ||
| var scopeId = getScopeId(cmpMeta.$tagName$); | ||
| var style = styles.get(scopeId); | ||
| // if an element is NOT connected then getRootNode() will return the wrong root node | ||
| // so the fallback is to always use the document for the root node in those cases | ||
| styleContainerNode = (styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc); | ||
| if (style) { | ||
| if (typeof style === 'string') { | ||
| styleContainerNode = styleContainerNode.head || styleContainerNode; | ||
| var appliedStyles = rootAppliedStyles.get(styleContainerNode); | ||
| var styleElm = void 0; | ||
| if (!appliedStyles) { | ||
| rootAppliedStyles.set(styleContainerNode, appliedStyles = new Set()); | ||
| } | ||
| if (!appliedStyles.has(scopeId)) { | ||
| { | ||
| if (plt.$cssShim$) { | ||
| styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style, !!(cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */)); | ||
| var newScopeId = styleElm['s-sc']; | ||
| if (newScopeId) { | ||
| scopeId = newScopeId; | ||
| // we don't want to add this styleID to the appliedStyles Set | ||
| // since the cssVarShim might need to apply several different | ||
| // stylesheets for the same component | ||
| appliedStyles = null; | ||
| } | ||
| } | ||
| else { | ||
| styleElm = doc.createElement('style'); | ||
| styleElm.innerHTML = style; | ||
| } | ||
| styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link')); | ||
| } | ||
| if (appliedStyles) { | ||
| appliedStyles.add(scopeId); | ||
| } | ||
| } | ||
| } | ||
| else if (!styleContainerNode.adoptedStyleSheets.includes(style)) { | ||
| styleContainerNode.adoptedStyleSheets = __spreadArrays(styleContainerNode.adoptedStyleSheets, [ | ||
| style | ||
| ]); | ||
| } | ||
| } | ||
| return scopeId; | ||
| }; | ||
| var attachStyles = function (elm, cmpMeta, mode) { | ||
| var endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$); | ||
| var scopeId = addStyle((supportsShadowDom && elm.shadowRoot) | ||
| ? elm.shadowRoot | ||
| : elm.getRootNode(), cmpMeta, mode, elm); | ||
| if (cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */) { | ||
| // only required when we're NOT using native shadow dom (slot) | ||
| // or this browser doesn't support native shadow dom | ||
| // and this host element was NOT created with SSR | ||
| // let's pick out the inner content for slot projection | ||
| // create a node to represent where the original | ||
| // content was first placed, which is useful later on | ||
| // DOM WRITE!! | ||
| elm['s-sc'] = scopeId; | ||
| elm.classList.add(scopeId + '-h'); | ||
| } | ||
| endAttachStyles(); | ||
| }; | ||
| var getScopeId = function (tagName, mode) { return 'sc-' + (tagName); }; | ||
| /** | ||
| * Production h() function based on Preact by | ||
| * Jason Miller (@developit) | ||
| * Licensed under the MIT License | ||
| * https://github.com/developit/preact/blob/master/LICENSE | ||
| * | ||
| * Modified for Stencil's compiler and vdom | ||
| */ | ||
| // const stack: any[] = []; | ||
| // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode; | ||
| // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode; | ||
| var h = function (nodeName, vnodeData) { | ||
| var children = []; | ||
| for (var _i = 2; _i < arguments.length; _i++) { | ||
| children[_i - 2] = arguments[_i]; | ||
| } | ||
| var child = null; | ||
| var simple = false; | ||
| var lastSimple = false; | ||
| var vNodeChildren = []; | ||
| var walk = function (c) { | ||
| for (var i = 0; i < c.length; i++) { | ||
| child = c[i]; | ||
| if (Array.isArray(child)) { | ||
| walk(child); | ||
| } | ||
| else if (child != null && typeof child !== 'boolean') { | ||
| if (simple = typeof nodeName !== 'function' && !isComplexType(child)) { | ||
| child = String(child); | ||
| } | ||
| if (simple && lastSimple) { | ||
| // If the previous child was simple (string), we merge both | ||
| vNodeChildren[vNodeChildren.length - 1].$text$ += child; | ||
| } | ||
| else { | ||
| // Append a new vNode, if it's text, we create a text vNode | ||
| vNodeChildren.push(simple ? newVNode(null, child) : child); | ||
| } | ||
| lastSimple = simple; | ||
| } | ||
| } | ||
| }; | ||
| walk(children); | ||
| if (vnodeData) { | ||
| { | ||
| var classData_1 = vnodeData.className || vnodeData.class; | ||
| if (classData_1) { | ||
| vnodeData.class = typeof classData_1 !== 'object' | ||
| ? classData_1 | ||
| : Object.keys(classData_1) | ||
| .filter(function (k) { return classData_1[k]; }) | ||
| .join(' '); | ||
| } | ||
| } | ||
| } | ||
| var vnode = newVNode(nodeName, null); | ||
| vnode.$attrs$ = vnodeData; | ||
| if (vNodeChildren.length > 0) { | ||
| vnode.$children$ = vNodeChildren; | ||
| } | ||
| return vnode; | ||
| }; | ||
| var newVNode = function (tag, text) { | ||
| var vnode = { | ||
| $flags$: 0, | ||
| $tag$: tag, | ||
| $text$: text, | ||
| $elm$: null, | ||
| $children$: null | ||
| }; | ||
| { | ||
| vnode.$attrs$ = null; | ||
| } | ||
| return vnode; | ||
| }; | ||
| var Host = {}; | ||
| var isHost = function (node) { return node && node.$tag$ === Host; }; | ||
| /** | ||
| * Production setAccessor() function based on Preact by | ||
| * Jason Miller (@developit) | ||
| * Licensed under the MIT License | ||
| * https://github.com/developit/preact/blob/master/LICENSE | ||
| * | ||
| * Modified for Stencil's compiler and vdom | ||
| */ | ||
| var setAccessor = function (elm, memberName, oldValue, newValue, isSvg, flags) { | ||
| if (oldValue === newValue) { | ||
| return; | ||
| } | ||
| var isProp = isMemberInElement(elm, memberName); | ||
| var ln = memberName.toLowerCase(); | ||
| if (memberName === 'class') { | ||
| var classList = elm.classList; | ||
| var oldClasses_1 = parseClassList(oldValue); | ||
| var newClasses_1 = parseClassList(newValue); | ||
| classList.remove.apply(classList, oldClasses_1.filter(function (c) { return c && !newClasses_1.includes(c); })); | ||
| classList.add.apply(classList, newClasses_1.filter(function (c) { return c && !oldClasses_1.includes(c); })); | ||
| } | ||
| else { | ||
| // Set property if it exists and it's not a SVG | ||
| var isComplex = isComplexType(newValue); | ||
| if ((isProp || (isComplex && newValue !== null)) && !isSvg) { | ||
| try { | ||
| if (!elm.tagName.includes('-')) { | ||
| var n = newValue == null ? '' : newValue; | ||
| // Workaround for Safari, moving the <input> caret when re-assigning the same valued | ||
| if (memberName === 'list') { | ||
| isProp = false; | ||
| // tslint:disable-next-line: triple-equals | ||
| } | ||
| else if (oldValue == null || elm[memberName] != n) { | ||
| elm[memberName] = n; | ||
| } | ||
| } | ||
| else { | ||
| elm[memberName] = newValue; | ||
| } | ||
| } | ||
| catch (e) { } | ||
| } | ||
| if (newValue == null || newValue === false) { | ||
| { | ||
| elm.removeAttribute(memberName); | ||
| } | ||
| } | ||
| else if ((!isProp || (flags & 4 /* isHost */) || isSvg) && !isComplex) { | ||
| newValue = newValue === true ? '' : newValue; | ||
| { | ||
| elm.setAttribute(memberName, newValue); | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| var parseClassListRegex = /\s/; | ||
| var parseClassList = function (value) { return (!value) ? [] : value.split(parseClassListRegex); }; | ||
| var updateElement = function (oldVnode, newVnode, isSvgMode, memberName) { | ||
| // if the element passed in is a shadow root, which is a document fragment | ||
| // then we want to be adding attrs/props to the shadow root's "host" element | ||
| // if it's not a shadow root, then we add attrs/props to the same element | ||
| var elm = (newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host) ? newVnode.$elm$.host : newVnode.$elm$; | ||
| var oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ; | ||
| var newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ; | ||
| { | ||
| // remove attributes no longer present on the vnode by setting them to undefined | ||
| for (memberName in oldVnodeAttrs) { | ||
| if (!(memberName in newVnodeAttrs)) { | ||
| setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$); | ||
| } | ||
| } | ||
| } | ||
| // add new & update changed attributes | ||
| for (memberName in newVnodeAttrs) { | ||
| setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$); | ||
| } | ||
| }; | ||
| var createElm = function (oldParentVNode, newParentVNode, childIndex, parentElm) { | ||
| // tslint:disable-next-line: prefer-const | ||
| var newVNode = newParentVNode.$children$[childIndex]; | ||
| var i = 0; | ||
| var elm; | ||
| var childNode; | ||
| { | ||
| // create element | ||
| elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$)); | ||
| // add css classes, attrs, props, listeners, etc. | ||
| { | ||
| updateElement(null, newVNode, isSvgMode); | ||
| } | ||
| if (isDef(scopeId) && elm['s-si'] !== scopeId) { | ||
| // if there is a scopeId and this is the initial render | ||
| // then let's add the scopeId as a css class | ||
| elm.classList.add((elm['s-si'] = scopeId)); | ||
| } | ||
| if (newVNode.$children$) { | ||
| for (i = 0; i < newVNode.$children$.length; ++i) { | ||
| // create the node | ||
| childNode = createElm(oldParentVNode, newVNode, i); | ||
| // return node could have been null | ||
| if (childNode) { | ||
| // append our new node | ||
| elm.appendChild(childNode); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| return elm; | ||
| }; | ||
| var addVnodes = function (parentElm, before, parentVNode, vnodes, startIdx, endIdx) { | ||
| var containerElm = (parentElm); | ||
| var childNode; | ||
| if (containerElm.shadowRoot && containerElm.tagName === hostTagName) { | ||
| containerElm = containerElm.shadowRoot; | ||
| } | ||
| for (; startIdx <= endIdx; ++startIdx) { | ||
| if (vnodes[startIdx]) { | ||
| childNode = createElm(null, parentVNode, startIdx); | ||
| if (childNode) { | ||
| vnodes[startIdx].$elm$ = childNode; | ||
| containerElm.insertBefore(childNode, before); | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| var removeVnodes = function (vnodes, startIdx, endIdx, vnode, elm) { | ||
| for (; startIdx <= endIdx; ++startIdx) { | ||
| if (vnode = vnodes[startIdx]) { | ||
| elm = vnode.$elm$; | ||
| // remove the vnode's element from the dom | ||
| elm.remove(); | ||
| } | ||
| } | ||
| }; | ||
| var updateChildren = function (parentElm, oldCh, newVNode, newCh) { | ||
| var oldStartIdx = 0; | ||
| var newStartIdx = 0; | ||
| var oldEndIdx = oldCh.length - 1; | ||
| var oldStartVnode = oldCh[0]; | ||
| var oldEndVnode = oldCh[oldEndIdx]; | ||
| var newEndIdx = newCh.length - 1; | ||
| var newStartVnode = newCh[0]; | ||
| var newEndVnode = newCh[newEndIdx]; | ||
| var node; | ||
| while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { | ||
| if (oldStartVnode == null) { | ||
| // Vnode might have been moved left | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| } | ||
| else if (oldEndVnode == null) { | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| } | ||
| else if (newStartVnode == null) { | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else if (newEndVnode == null) { | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldStartVnode, newStartVnode)) { | ||
| patch(oldStartVnode, newStartVnode); | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else if (isSameVnode(oldEndVnode, newEndVnode)) { | ||
| patch(oldEndVnode, newEndVnode); | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldStartVnode, newEndVnode)) { | ||
| patch(oldStartVnode, newEndVnode); | ||
| parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling); | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldEndVnode, newStartVnode)) { | ||
| patch(oldEndVnode, newStartVnode); | ||
| parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$); | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else { | ||
| { | ||
| // new element | ||
| node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx); | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| if (node) { | ||
| { | ||
| oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| if (oldStartIdx > oldEndIdx) { | ||
| addVnodes(parentElm, (newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$), newVNode, newCh, newStartIdx, newEndIdx); | ||
| } | ||
| else if (newStartIdx > newEndIdx) { | ||
| removeVnodes(oldCh, oldStartIdx, oldEndIdx); | ||
| } | ||
| }; | ||
| var isSameVnode = function (vnode1, vnode2) { | ||
| // compare if two vnode to see if they're "technically" the same | ||
| // need to have the same element tag, and same key to be the same | ||
| if (vnode1.$tag$ === vnode2.$tag$) { | ||
| return true; | ||
| } | ||
| return false; | ||
| }; | ||
| var patch = function (oldVNode, newVNode) { | ||
| var elm = newVNode.$elm$ = oldVNode.$elm$; | ||
| var oldChildren = oldVNode.$children$; | ||
| var newChildren = newVNode.$children$; | ||
| { | ||
| // element node | ||
| { | ||
| { | ||
| // either this is the first render of an element OR it's an update | ||
| // AND we already know it's possible it could have changed | ||
| // this updates the element's css classes, attrs, props, listeners, etc. | ||
| updateElement(oldVNode, newVNode, isSvgMode); | ||
| } | ||
| } | ||
| if (oldChildren !== null && newChildren !== null) { | ||
| // looks like there's child vnodes for both the old and new vnodes | ||
| updateChildren(elm, oldChildren, newVNode, newChildren); | ||
| } | ||
| else if (newChildren !== null) { | ||
| // add the new vnode children | ||
| addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1); | ||
| } | ||
| else if (oldChildren !== null) { | ||
| // no new child vnodes, but there are old child vnodes to remove | ||
| removeVnodes(oldChildren, 0, oldChildren.length - 1); | ||
| } | ||
| } | ||
| }; | ||
| var renderVdom = function (hostElm, hostRef, cmpMeta, renderFnResults) { | ||
| hostTagName = hostElm.tagName; | ||
| var oldVNode = hostRef.$vnode$ || newVNode(null, null); | ||
| var rootVnode = isHost(renderFnResults) | ||
| ? renderFnResults | ||
| : h(null, null, renderFnResults); | ||
| rootVnode.$tag$ = null; | ||
| rootVnode.$flags$ |= 4 /* isHost */; | ||
| hostRef.$vnode$ = rootVnode; | ||
| rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm); | ||
| { | ||
| scopeId = hostElm['s-sc']; | ||
| } | ||
| // synchronous patch | ||
| patch(oldVNode, rootVnode); | ||
| }; | ||
| var attachToAncestor = function (hostRef, ancestorComponent) { | ||
| if (ancestorComponent && !hostRef.$onRenderResolve$) { | ||
| ancestorComponent['s-p'].push(new Promise(function (r) { return hostRef.$onRenderResolve$ = r; })); | ||
| } | ||
| }; | ||
| var scheduleUpdate = function (elm, hostRef, cmpMeta, isInitialLoad) { | ||
| { | ||
| hostRef.$flags$ |= 16 /* isQueuedForUpdate */; | ||
| } | ||
| if (hostRef.$flags$ & 4 /* isWaitingForChildren */) { | ||
| hostRef.$flags$ |= 512 /* needsRerender */; | ||
| return; | ||
| } | ||
| var endSchedule = createTime('scheduleUpdate', cmpMeta.$tagName$); | ||
| var ancestorComponent = hostRef.$ancestorComponent$; | ||
| var instance = hostRef.$lazyInstance$; | ||
| var update = function () { return updateComponent(elm, hostRef, cmpMeta, instance, isInitialLoad); }; | ||
| attachToAncestor(hostRef, ancestorComponent); | ||
| var promise; | ||
| if (isInitialLoad) { | ||
| { | ||
| hostRef.$flags$ |= 256 /* isListenReady */; | ||
| if (hostRef.$queuedListeners$) { | ||
| hostRef.$queuedListeners$.forEach(function (_a) { | ||
| var methodName = _a[0], event = _a[1]; | ||
| return safeCall(instance, methodName, event); | ||
| }); | ||
| hostRef.$queuedListeners$ = null; | ||
| } | ||
| } | ||
| { | ||
| promise = safeCall(instance, 'componentWillLoad'); | ||
| } | ||
| } | ||
| { | ||
| promise = then(promise, function () { return safeCall(instance, 'componentWillRender'); }); | ||
| } | ||
| endSchedule(); | ||
| // there is no ancestorc omponent or the ancestor component | ||
| // has already fired off its lifecycle update then | ||
| // fire off the initial update | ||
| return then(promise, function () { return writeTask(update); }); | ||
| }; | ||
| var updateComponent = function (elm, hostRef, cmpMeta, instance, isInitialLoad) { | ||
| // updateComponent | ||
| var endUpdate = createTime('update', cmpMeta.$tagName$); | ||
| var rc = elm['s-rc']; | ||
| if (isInitialLoad) { | ||
| // DOM WRITE! | ||
| attachStyles(elm, cmpMeta, hostRef.$modeName$); | ||
| } | ||
| var endRender = createTime('render', cmpMeta.$tagName$); | ||
| { | ||
| { | ||
| // looks like we've got child nodes to render into this host element | ||
| // or we need to update the css class/attrs on the host element | ||
| // DOM WRITE! | ||
| renderVdom(elm, hostRef, cmpMeta, callRender(instance)); | ||
| } | ||
| } | ||
| if (plt.$cssShim$) { | ||
| plt.$cssShim$.updateHost(elm); | ||
| } | ||
| { | ||
| hostRef.$flags$ &= ~16 /* isQueuedForUpdate */; | ||
| } | ||
| { | ||
| hostRef.$flags$ |= 2 /* hasRendered */; | ||
| } | ||
| if (rc) { | ||
| // ok, so turns out there are some child host elements | ||
| // waiting on this parent element to load | ||
| // let's fire off all update callbacks waiting | ||
| rc.forEach(function (cb) { return cb(); }); | ||
| elm['s-rc'] = undefined; | ||
| } | ||
| endRender(); | ||
| endUpdate(); | ||
| { | ||
| var childrenPromises = elm['s-p']; | ||
| var postUpdate = function () { return postUpdateComponent(elm, hostRef, cmpMeta); }; | ||
| if (childrenPromises.length === 0) { | ||
| postUpdate(); | ||
| } | ||
| else { | ||
| Promise.all(childrenPromises).then(postUpdate); | ||
| hostRef.$flags$ |= 4 /* isWaitingForChildren */; | ||
| childrenPromises.length = 0; | ||
| } | ||
| } | ||
| }; | ||
| var callRender = function (instance, elm) { | ||
| try { | ||
| instance = instance.render(); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| return instance; | ||
| }; | ||
| var postUpdateComponent = function (elm, hostRef, cmpMeta) { | ||
| var endPostUpdate = createTime('postUpdate', cmpMeta.$tagName$); | ||
| var ancestorComponent = hostRef.$ancestorComponent$; | ||
| if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) { | ||
| hostRef.$flags$ |= 64 /* hasLoadedComponent */; | ||
| { | ||
| // DOM WRITE! | ||
| // add the css class that this element has officially hydrated | ||
| elm.classList.add(HYDRATED_CLASS); | ||
| } | ||
| endPostUpdate(); | ||
| { | ||
| hostRef.$onReadyResolve$(elm); | ||
| if (!ancestorComponent) { | ||
| appDidLoad(); | ||
| } | ||
| } | ||
| } | ||
| else { | ||
| endPostUpdate(); | ||
| } | ||
| { | ||
| hostRef.$onInstanceResolve$(elm); | ||
| } | ||
| // load events fire from bottom to top | ||
| // the deepest elements load first then bubbles up | ||
| { | ||
| if (hostRef.$onRenderResolve$) { | ||
| hostRef.$onRenderResolve$(); | ||
| hostRef.$onRenderResolve$ = undefined; | ||
| } | ||
| if (hostRef.$flags$ & 512 /* needsRerender */) { | ||
| nextTick(function () { return scheduleUpdate(elm, hostRef, cmpMeta, false); }); | ||
| } | ||
| hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */); | ||
| } | ||
| // ( •_•) | ||
| // ( •_•)>⌐■-■ | ||
| // (⌐■_■) | ||
| }; | ||
| var forceUpdate = function (elm, cmpMeta) { | ||
| { | ||
| var hostRef = getHostRef(elm); | ||
| var isConnected = hostRef.$hostElement$.isConnected; | ||
| if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) { | ||
| scheduleUpdate(elm, hostRef, cmpMeta, false); | ||
| } | ||
| // Returns "true" when the forced update was successfully scheduled | ||
| return isConnected; | ||
| } | ||
| }; | ||
| var appDidLoad = function (who) { | ||
| // on appload | ||
| // we have finish the first big initial render | ||
| { | ||
| doc.documentElement.classList.add(HYDRATED_CLASS); | ||
| } | ||
| { | ||
| plt.$flags$ |= 2 /* appLoaded */; | ||
| } | ||
| }; | ||
| var safeCall = function (instance, method, arg) { | ||
| if (instance && instance[method]) { | ||
| try { | ||
| return instance[method](arg); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| return undefined; | ||
| }; | ||
| var then = function (promise, thenFn) { | ||
| return promise && promise.then ? promise.then(thenFn) : thenFn(); | ||
| }; | ||
| var getValue = function (ref, propName) { return getHostRef(ref).$instanceValues$.get(propName); }; | ||
| var setValue = function (ref, propName, newVal, cmpMeta) { | ||
| // check our new property value against our internal value | ||
| var hostRef = getHostRef(ref); | ||
| var elm = hostRef.$hostElement$; | ||
| var oldVal = hostRef.$instanceValues$.get(propName); | ||
| var flags = hostRef.$flags$; | ||
| var instance = hostRef.$lazyInstance$; | ||
| newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]); | ||
| if (newVal !== oldVal && (!(flags & 8 /* isConstructingInstance */) || oldVal === undefined)) { | ||
| // gadzooks! the property's value has changed!! | ||
| // set our new value! | ||
| hostRef.$instanceValues$.set(propName, newVal); | ||
| if (instance) { | ||
| if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) { | ||
| // looks like this value actually changed, so we've got work to do! | ||
| // but only if we've already rendered, otherwise just chill out | ||
| // queue that we need to do an update, but don't worry about queuing | ||
| // up millions cuz this function ensures it only runs once | ||
| scheduleUpdate(elm, hostRef, cmpMeta, false); | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| var proxyComponent = function (Cstr, cmpMeta, flags) { | ||
| if (cmpMeta.$members$) { | ||
| // It's better to have a const than two Object.entries() | ||
| var members = Object.entries(cmpMeta.$members$); | ||
| var prototype_1 = Cstr.prototype; | ||
| members.forEach(function (_a) { | ||
| var memberName = _a[0], memberFlags = _a[1][0]; | ||
| if (((memberFlags & 31 /* Prop */) || | ||
| ((flags & 2 /* proxyState */) && | ||
| (memberFlags & 32 /* State */)))) { | ||
| // proxyComponent - prop | ||
| Object.defineProperty(prototype_1, memberName, { | ||
| get: function () { | ||
| // proxyComponent, get value | ||
| return getValue(this, memberName); | ||
| }, | ||
| set: function (newValue) { | ||
| // proxyComponent, set value | ||
| setValue(this, memberName, newValue, cmpMeta); | ||
| }, | ||
| configurable: true, | ||
| enumerable: true | ||
| }); | ||
| } | ||
| else if ((flags & 1 /* isElementConstructor */) && (memberFlags & 64 /* Method */)) { | ||
| // proxyComponent - method | ||
| Object.defineProperty(prototype_1, memberName, { | ||
| value: function () { | ||
| var args = []; | ||
| for (var _i = 0; _i < arguments.length; _i++) { | ||
| args[_i] = arguments[_i]; | ||
| } | ||
| var ref = getHostRef(this); | ||
| return ref.$onInstancePromise$.then(function () { | ||
| var _a; | ||
| return (_a = ref.$lazyInstance$)[memberName].apply(_a, args); | ||
| }); | ||
| } | ||
| }); | ||
| } | ||
| }); | ||
| if ((flags & 1 /* isElementConstructor */)) { | ||
| var attrNameToPropName_1 = new Map(); | ||
| prototype_1.attributeChangedCallback = function (attrName, _oldValue, newValue) { | ||
| var _this = this; | ||
| plt.jmp(function () { | ||
| var propName = attrNameToPropName_1.get(attrName); | ||
| _this[propName] = newValue === null && typeof _this[propName] === 'boolean' | ||
| ? false | ||
| : newValue; | ||
| }); | ||
| }; | ||
| // create an array of attributes to observe | ||
| // and also create a map of html attribute name to js property name | ||
| Cstr.observedAttributes = members | ||
| .filter(function (_a) { | ||
| var _ = _a[0], m = _a[1]; | ||
| return m[0] & 15; | ||
| } /* HasAttribute */) // filter to only keep props that should match attributes | ||
| .map(function (_a) { | ||
| var propName = _a[0], m = _a[1]; | ||
| var attrName = m[1] || propName; | ||
| attrNameToPropName_1.set(attrName, propName); | ||
| return attrName; | ||
| }); | ||
| } | ||
| } | ||
| return Cstr; | ||
| }; | ||
| var addEventListeners = function (elm, hostRef, listeners) { | ||
| hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []; | ||
| var removeFns = listeners.map(function (_a) { | ||
| var flags = _a[0], name = _a[1], method = _a[2]; | ||
| var target = (getHostListenerTarget(elm, flags)); | ||
| var handler = hostListenerProxy(hostRef, method); | ||
| var opts = hostListenerOpts(flags); | ||
| plt.ael(target, name, handler, opts); | ||
| return function () { return plt.rel(target, name, handler, opts); }; | ||
| }); | ||
| return function () { return removeFns.forEach(function (fn) { return fn(); }); }; | ||
| }; | ||
| var hostListenerProxy = function (hostRef, methodName) { | ||
| return function (ev) { | ||
| { | ||
| if (hostRef.$flags$ & 256 /* isListenReady */) { | ||
| // instance is ready, let's call it's member method for this event | ||
| hostRef.$lazyInstance$[methodName](ev); | ||
| } | ||
| else { | ||
| hostRef.$queuedListeners$.push([methodName, ev]); | ||
| } | ||
| } | ||
| }; | ||
| }; | ||
| var getHostListenerTarget = function (elm, flags) { | ||
| if (flags & 8 /* TargetWindow */) | ||
| return win; | ||
| return elm; | ||
| }; | ||
| var hostListenerOpts = function (flags) { return supportsListenerOptions ? | ||
| { | ||
| 'passive': (flags & 1 /* Passive */) !== 0, | ||
| 'capture': (flags & 2 /* Capture */) !== 0, | ||
| } | ||
| : (flags & 2 /* Capture */) !== 0; }; | ||
| var initializeComponent = function (elm, hostRef, cmpMeta, hmrVersionId, Cstr) { return __awaiter(void 0, void 0, void 0, function () { | ||
| var endLoad, endNewInstance, scopeId_1, endRegisterStyles, style_1, ancestorComponent, schedule; | ||
| return __generator(this, function (_a) { | ||
| switch (_a.label) { | ||
| case 0: | ||
| if (!((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0)) return [3 /*break*/, 5]; | ||
| // we haven't initialized this element yet | ||
| hostRef.$flags$ |= 32 /* hasInitializedComponent */; | ||
| // lazy loaded components | ||
| // request the component's implementation to be | ||
| // wired up with the host element | ||
| Cstr = loadModule(cmpMeta); | ||
| if (!Cstr.then) return [3 /*break*/, 2]; | ||
| endLoad = uniqueTime(); | ||
| return [4 /*yield*/, Cstr]; | ||
| case 1: | ||
| Cstr = _a.sent(); | ||
| endLoad(); | ||
| _a.label = 2; | ||
| case 2: | ||
| if (!Cstr.isProxied) { | ||
| proxyComponent(Cstr, cmpMeta, 2 /* proxyState */); | ||
| Cstr.isProxied = true; | ||
| } | ||
| endNewInstance = createTime('createInstance', cmpMeta.$tagName$); | ||
| // ok, time to construct the instance | ||
| // but let's keep track of when we start and stop | ||
| // so that the getters/setters don't incorrectly step on data | ||
| { | ||
| hostRef.$flags$ |= 8 /* isConstructingInstance */; | ||
| } | ||
| // construct the lazy-loaded component implementation | ||
| // passing the hostRef is very important during | ||
| // construction in order to directly wire together the | ||
| // host element and the lazy-loaded instance | ||
| try { | ||
| new Cstr(hostRef); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| { | ||
| hostRef.$flags$ &= ~8 /* isConstructingInstance */; | ||
| } | ||
| endNewInstance(); | ||
| scopeId_1 = getScopeId(cmpMeta.$tagName$); | ||
| if (!(!styles.has(scopeId_1) && Cstr.style)) return [3 /*break*/, 5]; | ||
| endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$); | ||
| style_1 = Cstr.style; | ||
| if (!(cmpMeta.$flags$ & 8) /* needsShadowDomShim */) return [3 /*break*/, 4]; /* needsShadowDomShim */ | ||
| return [4 /*yield*/, import('./shadow-css-4889ae62-23996f3f.js').then(function (m) { return m.scopeCss(style_1, scopeId_1, false); })]; | ||
| case 3: | ||
| style_1 = _a.sent(); | ||
| _a.label = 4; | ||
| case 4: | ||
| registerStyle(scopeId_1, style_1, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)); | ||
| endRegisterStyles(); | ||
| _a.label = 5; | ||
| case 5: | ||
| ancestorComponent = hostRef.$ancestorComponent$; | ||
| schedule = function () { return scheduleUpdate(elm, hostRef, cmpMeta, true); }; | ||
| if (ancestorComponent && ancestorComponent['s-rc']) { | ||
| // this is the intial load and this component it has an ancestor component | ||
| // but the ancestor component has NOT fired its will update lifecycle yet | ||
| // so let's just cool our jets and wait for the ancestor to continue first | ||
| // this will get fired off when the ancestor component | ||
| // finally gets around to rendering its lazy self | ||
| // fire off the initial update | ||
| ancestorComponent['s-rc'].push(schedule); | ||
| } | ||
| else { | ||
| schedule(); | ||
| } | ||
| return [2 /*return*/]; | ||
| } | ||
| }); | ||
| }); }; | ||
| var connectedCallback = function (elm, cmpMeta) { | ||
| if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) { | ||
| var endConnected = createTime('connectedCallback', cmpMeta.$tagName$); | ||
| // connectedCallback | ||
| var hostRef_1 = getHostRef(elm); | ||
| if (cmpMeta.$listeners$) { | ||
| // initialize our event listeners on the host element | ||
| // we do this now so that we can listening to events that may | ||
| // have fired even before the instance is ready | ||
| hostRef_1.$rmListeners$ = addEventListeners(elm, hostRef_1, cmpMeta.$listeners$); | ||
| } | ||
| if (!(hostRef_1.$flags$ & 1 /* hasConnected */)) { | ||
| // first time this component has connected | ||
| hostRef_1.$flags$ |= 1 /* hasConnected */; | ||
| { | ||
| // find the first ancestor component (if there is one) and register | ||
| // this component as one of the actively loading child components for its ancestor | ||
| var ancestorComponent = elm; | ||
| while ((ancestorComponent = (ancestorComponent.parentNode || ancestorComponent.host))) { | ||
| // climb up the ancestors looking for the first | ||
| // component that hasn't finished its lifecycle update yet | ||
| if ((ancestorComponent['s-p'])) { | ||
| // we found this components first ancestor component | ||
| // keep a reference to this component's ancestor component | ||
| attachToAncestor(hostRef_1, (hostRef_1.$ancestorComponent$ = ancestorComponent)); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| // Lazy properties | ||
| // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties | ||
| if (cmpMeta.$members$) { | ||
| Object.entries(cmpMeta.$members$).forEach(function (_a) { | ||
| var memberName = _a[0], memberFlags = _a[1][0]; | ||
| if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) { | ||
| var value = elm[memberName]; | ||
| delete elm[memberName]; | ||
| elm[memberName] = value; | ||
| } | ||
| }); | ||
| } | ||
| { | ||
| // connectedCallback, taskQueue, initialLoad | ||
| // angular sets attribute AFTER connectCallback | ||
| // https://github.com/angular/angular/issues/18909 | ||
| // https://github.com/angular/angular/issues/19940 | ||
| nextTick(function () { return initializeComponent(elm, hostRef_1, cmpMeta); }); | ||
| } | ||
| } | ||
| endConnected(); | ||
| } | ||
| }; | ||
| var disconnectedCallback = function (elm) { | ||
| if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) { | ||
| var hostRef = getHostRef(elm); | ||
| { | ||
| if (hostRef.$rmListeners$) { | ||
| hostRef.$rmListeners$(); | ||
| hostRef.$rmListeners$ = undefined; | ||
| } | ||
| } | ||
| // clear CSS var-shim tracking | ||
| if (plt.$cssShim$) { | ||
| plt.$cssShim$.removeHost(elm); | ||
| } | ||
| } | ||
| }; | ||
| var bootstrapLazy = function (lazyBundles, options) { | ||
| if (options === void 0) { options = {}; } | ||
| var endBootstrap = createTime(); | ||
| var cmpTags = []; | ||
| var exclude = options.exclude || []; | ||
| var head = doc.head; | ||
| var customElements = win.customElements; | ||
| var y = /*@__PURE__*/ head.querySelector('meta[charset]'); | ||
| var visibilityStyle = /*@__PURE__*/ doc.createElement('style'); | ||
| var deferredConnectedCallbacks = []; | ||
| var appLoadFallback; | ||
| var isBootstrapping = true; | ||
| Object.assign(plt, options); | ||
| plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href; | ||
| if (options.syncQueue) { | ||
| plt.$flags$ |= 4 /* queueSync */; | ||
| } | ||
| lazyBundles.forEach(function (lazyBundle) { return lazyBundle[1].forEach(function (compactMeta) { | ||
| var cmpMeta = { | ||
| $flags$: compactMeta[0], | ||
| $tagName$: compactMeta[1], | ||
| $members$: compactMeta[2], | ||
| $listeners$: compactMeta[3], | ||
| }; | ||
| { | ||
| cmpMeta.$members$ = compactMeta[2]; | ||
| } | ||
| { | ||
| cmpMeta.$listeners$ = compactMeta[3]; | ||
| } | ||
| if (!supportsShadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { | ||
| cmpMeta.$flags$ |= 8 /* needsShadowDomShim */; | ||
| } | ||
| var tagName = cmpMeta.$tagName$; | ||
| var HostElement = /** @class */ (function (_super) { | ||
| __extends(HostElement, _super); | ||
| // StencilLazyHost | ||
| function HostElement(self) { | ||
| var _this = | ||
| // @ts-ignore | ||
| _super.call(this, self) || this; | ||
| self = _this; | ||
| registerHost(self); | ||
| if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { | ||
| // this component is using shadow dom | ||
| // and this browser supports shadow dom | ||
| // add the read-only property "shadowRoot" to the host element | ||
| // adding the shadow root build conditionals to minimize runtime | ||
| if (supportsShadowDom) { | ||
| { | ||
| self.attachShadow({ mode: 'open' }); | ||
| } | ||
| } | ||
| else if (!('shadowRoot' in self)) { | ||
| self.shadowRoot = self; | ||
| } | ||
| } | ||
| return _this; | ||
| } | ||
| HostElement.prototype.connectedCallback = function () { | ||
| var _this = this; | ||
| if (appLoadFallback) { | ||
| clearTimeout(appLoadFallback); | ||
| appLoadFallback = null; | ||
| } | ||
| if (isBootstrapping) { | ||
| // connectedCallback will be processed once all components have been registered | ||
| deferredConnectedCallbacks.push(this); | ||
| } | ||
| else { | ||
| plt.jmp(function () { return connectedCallback(_this, cmpMeta); }); | ||
| } | ||
| }; | ||
| HostElement.prototype.disconnectedCallback = function () { | ||
| var _this = this; | ||
| plt.jmp(function () { return disconnectedCallback(_this); }); | ||
| }; | ||
| HostElement.prototype.forceUpdate = function () { | ||
| forceUpdate(this, cmpMeta); | ||
| }; | ||
| HostElement.prototype.componentOnReady = function () { | ||
| return getHostRef(this).$onReadyPromise$; | ||
| }; | ||
| return HostElement; | ||
| }(HTMLElement)); | ||
| cmpMeta.$lazyBundleIds$ = lazyBundle[0]; | ||
| if (!exclude.includes(tagName) && !customElements.get(tagName)) { | ||
| cmpTags.push(tagName); | ||
| customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */)); | ||
| } | ||
| }); }); | ||
| // visibilityStyle.innerHTML = cmpTags.map(t => `${t}:not(.hydrated)`) + '{display:none}'; | ||
| visibilityStyle.innerHTML = cmpTags + '{visibility:hidden}.hydrated{visibility:inherit}'; | ||
| visibilityStyle.setAttribute('data-styles', ''); | ||
| head.insertBefore(visibilityStyle, y ? y.nextSibling : head.firstChild); | ||
| // Process deferred connectedCallbacks now all components have been registered | ||
| isBootstrapping = false; | ||
| if (deferredConnectedCallbacks.length > 0) { | ||
| deferredConnectedCallbacks.forEach(function (host) { return host.connectedCallback(); }); | ||
| } | ||
| else { | ||
| plt.jmp(function () { return appLoadFallback = setTimeout(appDidLoad, 30, 'timeout'); }); | ||
| } | ||
| // Fallback appLoad event | ||
| endBootstrap(); | ||
| }; | ||
| var createEvent = function (ref, name, flags) { | ||
| var elm = getElement(ref); | ||
| return { | ||
| emit: function (detail) { | ||
| var ev = new (CustomEvent)(name, { | ||
| bubbles: !!(flags & 4 /* Bubbles */), | ||
| composed: !!(flags & 2 /* Composed */), | ||
| cancelable: !!(flags & 1 /* Cancellable */), | ||
| detail: detail | ||
| }); | ||
| elm.dispatchEvent(ev); | ||
| return ev; | ||
| } | ||
| }; | ||
| }; | ||
| var getElement = function (ref) { return getHostRef(ref).$hostElement$; }; | ||
| export { patchEsm as a, bootstrapLazy as b, createEvent as c, getElement as g, h, patchBrowser as p, registerInstance as r }; |
| /* | ||
| Extremely simple css parser. Intended to be not more than what we need | ||
| and definitely not necessarily correct =). | ||
| */ | ||
| /** @unrestricted */ | ||
| var StyleNode = /** @class */ (function () { | ||
| function StyleNode() { | ||
| this.start = 0; | ||
| this.end = 0; | ||
| this.previous = null; | ||
| this.parent = null; | ||
| this.rules = null; | ||
| this.parsedCssText = ''; | ||
| this.cssText = ''; | ||
| this.atRule = false; | ||
| this.type = 0; | ||
| this.keyframesName = ''; | ||
| this.selector = ''; | ||
| this.parsedSelector = ''; | ||
| } | ||
| return StyleNode; | ||
| }()); | ||
| // given a string of css, return a simple rule tree | ||
| /** | ||
| * @param {string} text | ||
| * @return {StyleNode} | ||
| */ | ||
| function parse(text) { | ||
| text = clean(text); | ||
| return parseCss(lex(text), text); | ||
| } | ||
| // remove stuff we don't care about that may hinder parsing | ||
| /** | ||
| * @param {string} cssText | ||
| * @return {string} | ||
| */ | ||
| function clean(cssText) { | ||
| return cssText.replace(RX.comments, '').replace(RX.port, ''); | ||
| } | ||
| // super simple {...} lexer that returns a node tree | ||
| /** | ||
| * @param {string} text | ||
| * @return {StyleNode} | ||
| */ | ||
| function lex(text) { | ||
| var root = new StyleNode(); | ||
| root['start'] = 0; | ||
| root['end'] = text.length; | ||
| var n = root; | ||
| for (var i = 0, l = text.length; i < l; i++) { | ||
| if (text[i] === OPEN_BRACE) { | ||
| if (!n['rules']) { | ||
| n['rules'] = []; | ||
| } | ||
| var p = n; | ||
| var previous = p['rules'][p['rules'].length - 1] || null; | ||
| n = new StyleNode(); | ||
| n['start'] = i + 1; | ||
| n['parent'] = p; | ||
| n['previous'] = previous; | ||
| p['rules'].push(n); | ||
| } | ||
| else if (text[i] === CLOSE_BRACE) { | ||
| n['end'] = i + 1; | ||
| n = n['parent'] || root; | ||
| } | ||
| } | ||
| return root; | ||
| } | ||
| // add selectors/cssText to node tree | ||
| /** | ||
| * @param {StyleNode} node | ||
| * @param {string} text | ||
| * @return {StyleNode} | ||
| */ | ||
| function parseCss(node, text) { | ||
| var t = text.substring(node['start'], node['end'] - 1); | ||
| node['parsedCssText'] = node['cssText'] = t.trim(); | ||
| if (node.parent) { | ||
| var ss = node.previous ? node.previous['end'] : node.parent['start']; | ||
| t = text.substring(ss, node['start'] - 1); | ||
| t = _expandUnicodeEscapes(t); | ||
| t = t.replace(RX.multipleSpaces, ' '); | ||
| // TODO(sorvell): ad hoc; make selector include only after last ; | ||
| // helps with mixin syntax | ||
| t = t.substring(t.lastIndexOf(';') + 1); | ||
| var s = node['parsedSelector'] = node['selector'] = t.trim(); | ||
| node['atRule'] = (s.indexOf(AT_START) === 0); | ||
| // note, support a subset of rule types... | ||
| if (node['atRule']) { | ||
| if (s.indexOf(MEDIA_START) === 0) { | ||
| node['type'] = types.MEDIA_RULE; | ||
| } | ||
| else if (s.match(RX.keyframesRule)) { | ||
| node['type'] = types.KEYFRAMES_RULE; | ||
| node['keyframesName'] = node['selector'].split(RX.multipleSpaces).pop(); | ||
| } | ||
| } | ||
| else { | ||
| if (s.indexOf(VAR_START) === 0) { | ||
| node['type'] = types.MIXIN_RULE; | ||
| } | ||
| else { | ||
| node['type'] = types.STYLE_RULE; | ||
| } | ||
| } | ||
| } | ||
| var r$ = node['rules']; | ||
| if (r$) { | ||
| for (var i = 0, l = r$.length, r = void 0; (i < l) && (r = r$[i]); i++) { | ||
| parseCss(r, text); | ||
| } | ||
| } | ||
| return node; | ||
| } | ||
| /** | ||
| * conversion of sort unicode escapes with spaces like `\33 ` (and longer) into | ||
| * expanded form that doesn't require trailing space `\000033` | ||
| * @param {string} s | ||
| * @return {string} | ||
| */ | ||
| function _expandUnicodeEscapes(s) { | ||
| return s.replace(/\\([0-9a-f]{1,6})\s/gi, function () { | ||
| var code = arguments[1], repeat = 6 - code.length; | ||
| while (repeat--) { | ||
| code = '0' + code; | ||
| } | ||
| return '\\' + code; | ||
| }); | ||
| } | ||
| /** @enum {number} */ | ||
| var types = { | ||
| STYLE_RULE: 1, | ||
| KEYFRAMES_RULE: 7, | ||
| MEDIA_RULE: 4, | ||
| MIXIN_RULE: 1000 | ||
| }; | ||
| var OPEN_BRACE = '{'; | ||
| var CLOSE_BRACE = '}'; | ||
| // helper regexp's | ||
| var RX = { | ||
| comments: /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim, | ||
| port: /@import[^;]*;/gim, | ||
| customProp: /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim, | ||
| mixinProp: /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim, | ||
| mixinApply: /@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim, | ||
| varApply: /[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim, | ||
| keyframesRule: /^@[^\s]*keyframes/, | ||
| multipleSpaces: /\s+/g | ||
| }; | ||
| var VAR_START = '--'; | ||
| var MEDIA_START = '@media'; | ||
| var AT_START = '@'; | ||
| function findRegex(regex, cssText, offset) { | ||
| regex['lastIndex'] = 0; | ||
| var r = cssText.substring(offset).match(regex); | ||
| if (r) { | ||
| var start = offset + r['index']; | ||
| return { | ||
| start: start, | ||
| end: start + r[0].length | ||
| }; | ||
| } | ||
| return null; | ||
| } | ||
| var VAR_USAGE_START = /\bvar\(/; | ||
| var VAR_ASSIGN_START = /\B--[\w-]+\s*:/; | ||
| var COMMENTS = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim; | ||
| var TRAILING_LINES = /^[\t ]+\n/gm; | ||
| function resolveVar(props, prop, fallback) { | ||
| if (props[prop]) { | ||
| return props[prop]; | ||
| } | ||
| if (fallback) { | ||
| return executeTemplate(fallback, props); | ||
| } | ||
| return ''; | ||
| } | ||
| function findVarEndIndex(cssText, offset) { | ||
| var count = 0; | ||
| var i = offset; | ||
| for (; i < cssText.length; i++) { | ||
| var c = cssText[i]; | ||
| if (c === '(') { | ||
| count++; | ||
| } | ||
| else if (c === ')') { | ||
| count--; | ||
| if (count <= 0) { | ||
| return i + 1; | ||
| } | ||
| } | ||
| } | ||
| return i; | ||
| } | ||
| function parseVar(cssText, offset) { | ||
| var varPos = findRegex(VAR_USAGE_START, cssText, offset); | ||
| if (!varPos) { | ||
| return null; | ||
| } | ||
| var endVar = findVarEndIndex(cssText, varPos.start); | ||
| var varContent = cssText.substring(varPos.end, endVar - 1); | ||
| var _a = varContent.split(','), propName = _a[0], fallback = _a.slice(1); | ||
| return { | ||
| start: varPos.start, | ||
| end: endVar, | ||
| propName: propName.trim(), | ||
| fallback: fallback.length > 0 ? fallback.join(',').trim() : undefined | ||
| }; | ||
| } | ||
| function compileVar(cssText, template, offset) { | ||
| var varMeta = parseVar(cssText, offset); | ||
| if (!varMeta) { | ||
| template.push(cssText.substring(offset, cssText.length)); | ||
| return cssText.length; | ||
| } | ||
| var propName = varMeta.propName; | ||
| var fallback = varMeta.fallback != null ? compileTemplate(varMeta.fallback) : undefined; | ||
| template.push(cssText.substring(offset, varMeta.start), function (params) { return resolveVar(params, propName, fallback); }); | ||
| return varMeta.end; | ||
| } | ||
| function executeTemplate(template, props) { | ||
| var final = ''; | ||
| for (var i = 0; i < template.length; i++) { | ||
| var s = template[i]; | ||
| final += (typeof s === 'string') | ||
| ? s | ||
| : s(props); | ||
| } | ||
| return final; | ||
| } | ||
| function findEndValue(cssText, offset) { | ||
| var onStr = false; | ||
| var double = false; | ||
| var i = offset; | ||
| for (; i < cssText.length; i++) { | ||
| var c = cssText[i]; | ||
| if (onStr) { | ||
| if (double && c === '"') { | ||
| onStr = false; | ||
| } | ||
| if (!double && c === '\'') { | ||
| onStr = false; | ||
| } | ||
| } | ||
| else { | ||
| if (c === '"') { | ||
| onStr = true; | ||
| double = true; | ||
| } | ||
| else if (c === '\'') { | ||
| onStr = true; | ||
| double = false; | ||
| } | ||
| else if (c === ';') { | ||
| return i + 1; | ||
| } | ||
| else if (c === '}') { | ||
| return i; | ||
| } | ||
| } | ||
| } | ||
| return i; | ||
| } | ||
| function removeCustomAssigns(cssText) { | ||
| var final = ''; | ||
| var offset = 0; | ||
| while (true) { | ||
| var assignPos = findRegex(VAR_ASSIGN_START, cssText, offset); | ||
| var start = assignPos ? assignPos.start : cssText.length; | ||
| final += cssText.substring(offset, start); | ||
| if (assignPos) { | ||
| offset = findEndValue(cssText, start); | ||
| } | ||
| else { | ||
| break; | ||
| } | ||
| } | ||
| return final; | ||
| } | ||
| function compileTemplate(cssText) { | ||
| var index = 0; | ||
| cssText = cssText.replace(COMMENTS, ''); | ||
| cssText = removeCustomAssigns(cssText) | ||
| .replace(TRAILING_LINES, ''); | ||
| var segments = []; | ||
| while (index < cssText.length) { | ||
| index = compileVar(cssText, segments, index); | ||
| } | ||
| return segments; | ||
| } | ||
| function resolveValues(selectors) { | ||
| var props = {}; | ||
| selectors.forEach(function (selector) { | ||
| selector.declarations.forEach(function (dec) { | ||
| props[dec.prop] = dec.value; | ||
| }); | ||
| }); | ||
| var propsValues = {}; | ||
| var entries = Object.entries(props); | ||
| var _loop_1 = function (i) { | ||
| var dirty = false; | ||
| entries.forEach(function (_a) { | ||
| var key = _a[0], value = _a[1]; | ||
| var propValue = executeTemplate(value, propsValues); | ||
| if (propValue !== propsValues[key]) { | ||
| propsValues[key] = propValue; | ||
| dirty = true; | ||
| } | ||
| }); | ||
| if (!dirty) { | ||
| return "break"; | ||
| } | ||
| }; | ||
| for (var i = 0; i < 10; i++) { | ||
| var state_1 = _loop_1(); | ||
| if (state_1 === "break") | ||
| break; | ||
| } | ||
| return propsValues; | ||
| } | ||
| function getSelectors(root, index) { | ||
| if (index === void 0) { | ||
| index = 0; | ||
| } | ||
| if (!root.rules) { | ||
| return []; | ||
| } | ||
| var selectors = []; | ||
| root.rules | ||
| .filter(function (rule) { return rule.type === types.STYLE_RULE; }) | ||
| .forEach(function (rule) { | ||
| var declarations = getDeclarations(rule.cssText); | ||
| if (declarations.length > 0) { | ||
| rule.parsedSelector.split(',').forEach(function (selector) { | ||
| selector = selector.trim(); | ||
| selectors.push({ | ||
| selector: selector, | ||
| declarations: declarations, | ||
| specificity: computeSpecificity(), | ||
| nu: index | ||
| }); | ||
| }); | ||
| } | ||
| index++; | ||
| }); | ||
| return selectors; | ||
| } | ||
| function computeSpecificity(_selector) { | ||
| return 1; | ||
| } | ||
| var IMPORTANT = '!important'; | ||
| var FIND_DECLARATIONS = /(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm; | ||
| function getDeclarations(cssText) { | ||
| var declarations = []; | ||
| var xArray; | ||
| while (xArray = FIND_DECLARATIONS.exec(cssText.trim())) { | ||
| var _a = normalizeValue(xArray[2]), value = _a.value, important = _a.important; | ||
| declarations.push({ | ||
| prop: xArray[1].trim(), | ||
| value: compileTemplate(value), | ||
| important: important, | ||
| }); | ||
| } | ||
| return declarations; | ||
| } | ||
| function normalizeValue(value) { | ||
| var regex = /\s+/gim; | ||
| value = value.replace(regex, ' ').trim(); | ||
| var important = value.endsWith(IMPORTANT); | ||
| if (important) { | ||
| value = value.substr(0, value.length - IMPORTANT.length).trim(); | ||
| } | ||
| return { | ||
| value: value, | ||
| important: important | ||
| }; | ||
| } | ||
| function getActiveSelectors(hostEl, hostScopeMap, globalScopes) { | ||
| // computes the css scopes that might affect this particular element | ||
| // avoiding using spread arrays to avoid ts helper fns when in es5 | ||
| var scopes = []; | ||
| var scopesForElement = getScopesForElement(hostScopeMap, hostEl); | ||
| // globalScopes are always took into account | ||
| globalScopes.forEach(function (s) { return scopes.push(s); }); | ||
| // the parent scopes are computed by walking parent dom until <html> is reached | ||
| scopesForElement.forEach(function (s) { return scopes.push(s); }); | ||
| // each scope might have an array of associated selectors | ||
| // let's flatten the complete array of selectors from all the scopes | ||
| var selectorSet = getSelectorsForScopes(scopes); | ||
| // we filter to only the selectors that matches the hostEl | ||
| var activeSelectors = selectorSet.filter(function (selector) { return matches(hostEl, selector.selector); }); | ||
| // sort selectors by specifity | ||
| return sortSelectors(activeSelectors); | ||
| } | ||
| function getScopesForElement(hostTemplateMap, node) { | ||
| var scopes = []; | ||
| while (node) { | ||
| var scope = hostTemplateMap.get(node); | ||
| if (scope) { | ||
| scopes.push(scope); | ||
| } | ||
| node = node.parentElement; | ||
| } | ||
| return scopes; | ||
| } | ||
| function getSelectorsForScopes(scopes) { | ||
| var selectors = []; | ||
| scopes.forEach(function (scope) { | ||
| selectors.push.apply(selectors, scope.selectors); | ||
| }); | ||
| return selectors; | ||
| } | ||
| function sortSelectors(selectors) { | ||
| selectors.sort(function (a, b) { | ||
| if (a.specificity === b.specificity) { | ||
| return a.nu - b.nu; | ||
| } | ||
| return a.specificity - b.specificity; | ||
| }); | ||
| return selectors; | ||
| } | ||
| function matches(el, selector) { | ||
| return selector === ':root' || selector === 'html' || el.matches(selector); | ||
| } | ||
| function parseCSS(original) { | ||
| var ast = parse(original); | ||
| var template = compileTemplate(original); | ||
| var selectors = getSelectors(ast); | ||
| return { | ||
| original: original, | ||
| template: template, | ||
| selectors: selectors, | ||
| usesCssVars: template.length > 1 | ||
| }; | ||
| } | ||
| function addGlobalStyle(globalScopes, styleEl) { | ||
| if (globalScopes.some(function (css) { return css.styleEl === styleEl; })) { | ||
| return false; | ||
| } | ||
| var css = parseCSS(styleEl.textContent); | ||
| css.styleEl = styleEl; | ||
| globalScopes.push(css); | ||
| return true; | ||
| } | ||
| function updateGlobalScopes(scopes) { | ||
| var selectors = getSelectorsForScopes(scopes); | ||
| var props = resolveValues(selectors); | ||
| scopes.forEach(function (scope) { | ||
| if (scope.usesCssVars) { | ||
| scope.styleEl.textContent = executeTemplate(scope.template, props); | ||
| } | ||
| }); | ||
| } | ||
| function reScope(scope, scopeId) { | ||
| var template = scope.template.map(function (segment) { | ||
| return (typeof segment === 'string') | ||
| ? replaceScope(segment, scope.scopeId, scopeId) | ||
| : segment; | ||
| }); | ||
| var selectors = scope.selectors.map(function (sel) { | ||
| return Object.assign(Object.assign({}, sel), { selector: replaceScope(sel.selector, scope.scopeId, scopeId) }); | ||
| }); | ||
| return Object.assign(Object.assign({}, scope), { template: template, | ||
| selectors: selectors, | ||
| scopeId: scopeId }); | ||
| } | ||
| function replaceScope(original, oldScopeId, newScopeId) { | ||
| original = replaceAll(original, "\\." + oldScopeId, "." + newScopeId); | ||
| return original; | ||
| } | ||
| function replaceAll(input, find, replace) { | ||
| return input.replace(new RegExp(find, 'g'), replace); | ||
| } | ||
| function loadDocument(doc, globalScopes) { | ||
| loadDocumentStyles(doc, globalScopes); | ||
| return loadDocumentLinks(doc, globalScopes).then(function () { | ||
| updateGlobalScopes(globalScopes); | ||
| }); | ||
| } | ||
| function startWatcher(doc, globalScopes) { | ||
| var mutation = new MutationObserver(function () { | ||
| if (loadDocumentStyles(doc, globalScopes)) { | ||
| updateGlobalScopes(globalScopes); | ||
| } | ||
| }); | ||
| mutation.observe(document.head, { childList: true }); | ||
| } | ||
| function loadDocumentLinks(doc, globalScopes) { | ||
| var promises = []; | ||
| var linkElms = doc.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'); | ||
| for (var i = 0; i < linkElms.length; i++) { | ||
| promises.push(addGlobalLink(doc, globalScopes, linkElms[i])); | ||
| } | ||
| return Promise.all(promises); | ||
| } | ||
| function loadDocumentStyles(doc, globalScopes) { | ||
| var styleElms = Array.from(doc.querySelectorAll('style:not([data-styles]):not([data-no-shim])')); | ||
| return styleElms | ||
| .map(function (style) { return addGlobalStyle(globalScopes, style); }) | ||
| .some(Boolean); | ||
| } | ||
| function addGlobalLink(doc, globalScopes, linkElm) { | ||
| var url = linkElm.href; | ||
| return fetch(url).then(function (rsp) { return rsp.text(); }).then(function (text) { | ||
| if (hasCssVariables(text) && linkElm.parentNode) { | ||
| if (hasRelativeUrls(text)) { | ||
| text = fixRelativeUrls(text, url); | ||
| } | ||
| var styleEl = doc.createElement('style'); | ||
| styleEl.setAttribute('data-styles', ''); | ||
| styleEl.textContent = text; | ||
| addGlobalStyle(globalScopes, styleEl); | ||
| linkElm.parentNode.insertBefore(styleEl, linkElm); | ||
| linkElm.remove(); | ||
| } | ||
| }).catch(function (err) { | ||
| console.error(err); | ||
| }); | ||
| } | ||
| // This regexp tries to determine when a variable is declared, for example: | ||
| // | ||
| // .my-el { --highlight-color: green; } | ||
| // | ||
| // but we don't want to trigger when a classname uses "--" or a pseudo-class is | ||
| // used. We assume that the only characters that can preceed a variable | ||
| // declaration are "{", from an opening block, ";" from a preceeding rule, or a | ||
| // space. This prevents the regexp from matching a word in a selector, since | ||
| // they would need to start with a "." or "#". (We assume element names don't | ||
| // start with "--"). | ||
| var CSS_VARIABLE_REGEXP = /[\s;{]--[-a-zA-Z0-9]+\s*:/m; | ||
| function hasCssVariables(css) { | ||
| return css.indexOf('var(') > -1 || CSS_VARIABLE_REGEXP.test(css); | ||
| } | ||
| // This regexp find all url() usages with relative urls | ||
| var CSS_URL_REGEXP = /url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim; | ||
| function hasRelativeUrls(css) { | ||
| CSS_URL_REGEXP.lastIndex = 0; | ||
| return CSS_URL_REGEXP.test(css); | ||
| } | ||
| function fixRelativeUrls(css, originalUrl) { | ||
| // get the basepath from the original import url | ||
| var basePath = originalUrl.replace(/[^/]*$/, ''); | ||
| // replace the relative url, with the new relative url | ||
| return css.replace(CSS_URL_REGEXP, function (fullMatch, url) { | ||
| // rhe new relative path is the base path + uri | ||
| // TODO: normalize relative URL | ||
| var relativeUrl = basePath + url; | ||
| return fullMatch.replace(url, relativeUrl); | ||
| }); | ||
| } | ||
| var CustomStyle = /** @class */ (function () { | ||
| function CustomStyle(win, doc) { | ||
| this.win = win; | ||
| this.doc = doc; | ||
| this.count = 0; | ||
| this.hostStyleMap = new WeakMap(); | ||
| this.hostScopeMap = new WeakMap(); | ||
| this.globalScopes = []; | ||
| this.scopesMap = new Map(); | ||
| this.didInit = false; | ||
| } | ||
| CustomStyle.prototype.initShim = function () { | ||
| var _this = this; | ||
| if (this.didInit) { | ||
| return Promise.resolve(); | ||
| } | ||
| else { | ||
| this.didInit = true; | ||
| return new Promise(function (resolve) { | ||
| _this.win.requestAnimationFrame(function () { | ||
| startWatcher(_this.doc, _this.globalScopes); | ||
| loadDocument(_this.doc, _this.globalScopes).then(function () { return resolve(); }); | ||
| }); | ||
| }); | ||
| } | ||
| }; | ||
| CustomStyle.prototype.addLink = function (linkEl) { | ||
| var _this = this; | ||
| return addGlobalLink(this.doc, this.globalScopes, linkEl).then(function () { | ||
| _this.updateGlobal(); | ||
| }); | ||
| }; | ||
| CustomStyle.prototype.addGlobalStyle = function (styleEl) { | ||
| if (addGlobalStyle(this.globalScopes, styleEl)) { | ||
| this.updateGlobal(); | ||
| } | ||
| }; | ||
| CustomStyle.prototype.createHostStyle = function (hostEl, cssScopeId, cssText, isScoped) { | ||
| if (this.hostScopeMap.has(hostEl)) { | ||
| throw new Error('host style already created'); | ||
| } | ||
| var baseScope = this.registerHostTemplate(cssText, cssScopeId, isScoped); | ||
| var styleEl = this.doc.createElement('style'); | ||
| styleEl.setAttribute('data-no-shim', ''); | ||
| if (!baseScope.usesCssVars) { | ||
| // This component does not use (read) css variables | ||
| styleEl.textContent = cssText; | ||
| } | ||
| else if (isScoped) { | ||
| // This component is dynamic: uses css var and is scoped | ||
| styleEl['s-sc'] = cssScopeId = baseScope.scopeId + "-" + this.count; | ||
| styleEl.textContent = '/*needs update*/'; | ||
| this.hostStyleMap.set(hostEl, styleEl); | ||
| this.hostScopeMap.set(hostEl, reScope(baseScope, cssScopeId)); | ||
| this.count++; | ||
| } | ||
| else { | ||
| // This component uses css vars, but it's no-encapsulation (global static) | ||
| baseScope.styleEl = styleEl; | ||
| if (!baseScope.usesCssVars) { | ||
| styleEl.textContent = executeTemplate(baseScope.template, {}); | ||
| } | ||
| this.globalScopes.push(baseScope); | ||
| this.updateGlobal(); | ||
| this.hostScopeMap.set(hostEl, baseScope); | ||
| } | ||
| return styleEl; | ||
| }; | ||
| CustomStyle.prototype.removeHost = function (hostEl) { | ||
| var css = this.hostStyleMap.get(hostEl); | ||
| if (css) { | ||
| css.remove(); | ||
| } | ||
| this.hostStyleMap.delete(hostEl); | ||
| this.hostScopeMap.delete(hostEl); | ||
| }; | ||
| CustomStyle.prototype.updateHost = function (hostEl) { | ||
| var scope = this.hostScopeMap.get(hostEl); | ||
| if (scope && scope.usesCssVars && scope.isScoped) { | ||
| var styleEl = this.hostStyleMap.get(hostEl); | ||
| if (styleEl) { | ||
| var selectors = getActiveSelectors(hostEl, this.hostScopeMap, this.globalScopes); | ||
| var props = resolveValues(selectors); | ||
| styleEl.textContent = executeTemplate(scope.template, props); | ||
| } | ||
| } | ||
| }; | ||
| CustomStyle.prototype.updateGlobal = function () { | ||
| updateGlobalScopes(this.globalScopes); | ||
| }; | ||
| CustomStyle.prototype.registerHostTemplate = function (cssText, scopeId, isScoped) { | ||
| var scope = this.scopesMap.get(scopeId); | ||
| if (!scope) { | ||
| scope = parseCSS(cssText); | ||
| scope.scopeId = scopeId; | ||
| scope.isScoped = isScoped; | ||
| this.scopesMap.set(scopeId, scope); | ||
| } | ||
| return scope; | ||
| }; | ||
| return CustomStyle; | ||
| }()); | ||
| var win = window; | ||
| function needsShim() { | ||
| return !(win.CSS && win.CSS.supports && win.CSS.supports('color', 'var(--c)')); | ||
| } | ||
| if (!win.__stencil_cssshim && needsShim()) { | ||
| win.__stencil_cssshim = new CustomStyle(win, document); | ||
| } |
| (function () { | ||
| var aa = new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ")); | ||
| function g(a) { var b = aa.has(a); a = /^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(a); return !b && a; } | ||
| function l(a) { var b = a.isConnected; if (void 0 !== b) | ||
| return b; for (; a && !(a.__CE_isImportDocument || a instanceof Document);) | ||
| a = a.parentNode || (window.ShadowRoot && a instanceof ShadowRoot ? a.host : void 0); return !(!a || !(a.__CE_isImportDocument || a instanceof Document)); } | ||
| function n(a, b) { for (; b && b !== a && !b.nextSibling;) | ||
| b = b.parentNode; return b && b !== a ? b.nextSibling : null; } | ||
| function p(a, b, d) { d = void 0 === d ? new Set : d; for (var c = a; c;) { | ||
| if (c.nodeType === Node.ELEMENT_NODE) { | ||
| var e = c; | ||
| b(e); | ||
| var f = e.localName; | ||
| if ("link" === f && "import" === e.getAttribute("rel")) { | ||
| c = e.import; | ||
| if (c instanceof Node && !d.has(c)) | ||
| for (d.add(c), c = c.firstChild; c; c = c.nextSibling) | ||
| p(c, b, d); | ||
| c = n(a, e); | ||
| continue; | ||
| } | ||
| else if ("template" === f) { | ||
| c = n(a, e); | ||
| continue; | ||
| } | ||
| if (e = e.__CE_shadowRoot) | ||
| for (e = e.firstChild; e; e = e.nextSibling) | ||
| p(e, b, d); | ||
| } | ||
| c = c.firstChild ? c.firstChild : n(a, c); | ||
| } } | ||
| function r(a, b, d) { a[b] = d; } | ||
| function u() { this.a = new Map; this.g = new Map; this.c = []; this.f = []; this.b = !1; } | ||
| function ba(a, b, d) { a.a.set(b, d); a.g.set(d.constructorFunction, d); } | ||
| function ca(a, b) { a.b = !0; a.c.push(b); } | ||
| function da(a, b) { a.b = !0; a.f.push(b); } | ||
| function v(a, b) { a.b && p(b, function (b) { return w(a, b); }); } | ||
| function w(a, b) { if (a.b && !b.__CE_patched) { | ||
| b.__CE_patched = !0; | ||
| for (var d = 0; d < a.c.length; d++) | ||
| a.c[d](b); | ||
| for (d = 0; d < a.f.length; d++) | ||
| a.f[d](b); | ||
| } } | ||
| function x(a, b) { var d = []; p(b, function (b) { return d.push(b); }); for (b = 0; b < d.length; b++) { | ||
| var c = d[b]; | ||
| 1 === c.__CE_state ? a.connectedCallback(c) : y(a, c); | ||
| } } | ||
| function z(a, b) { var d = []; p(b, function (b) { return d.push(b); }); for (b = 0; b < d.length; b++) { | ||
| var c = d[b]; | ||
| 1 === c.__CE_state && a.disconnectedCallback(c); | ||
| } } | ||
| function A(a, b, d) { | ||
| d = void 0 === d ? {} : d; | ||
| var c = d.u || new Set, e = d.i || function (b) { return y(a, b); }, f = []; | ||
| p(b, function (b) { if ("link" === b.localName && "import" === b.getAttribute("rel")) { | ||
| var d = b.import; | ||
| d instanceof Node && (d.__CE_isImportDocument = !0, d.__CE_hasRegistry = !0); | ||
| d && "complete" === d.readyState ? d.__CE_documentLoadHandled = !0 : b.addEventListener("load", function () { var d = b.import; if (!d.__CE_documentLoadHandled) { | ||
| d.__CE_documentLoadHandled = !0; | ||
| var f = new Set(c); | ||
| f.delete(d); | ||
| A(a, d, { u: f, i: e }); | ||
| } }); | ||
| } | ||
| else | ||
| f.push(b); }, c); | ||
| if (a.b) | ||
| for (b = | ||
| 0; b < f.length; b++) | ||
| w(a, f[b]); | ||
| for (b = 0; b < f.length; b++) | ||
| e(f[b]); | ||
| } | ||
| function y(a, b) { | ||
| if (void 0 === b.__CE_state) { | ||
| var d = b.ownerDocument; | ||
| if (d.defaultView || d.__CE_isImportDocument && d.__CE_hasRegistry) | ||
| if (d = a.a.get(b.localName)) { | ||
| d.constructionStack.push(b); | ||
| var c = d.constructorFunction; | ||
| try { | ||
| try { | ||
| if (new c !== b) | ||
| throw Error("The custom element constructor did not produce the element being upgraded."); | ||
| } | ||
| finally { | ||
| d.constructionStack.pop(); | ||
| } | ||
| } | ||
| catch (t) { | ||
| throw b.__CE_state = 2, t; | ||
| } | ||
| b.__CE_state = 1; | ||
| b.__CE_definition = d; | ||
| if (d.attributeChangedCallback) | ||
| for (d = d.observedAttributes, c = 0; c < d.length; c++) { | ||
| var e = d[c], f = b.getAttribute(e); | ||
| null !== f && a.attributeChangedCallback(b, e, null, f, null); | ||
| } | ||
| l(b) && a.connectedCallback(b); | ||
| } | ||
| } | ||
| } | ||
| u.prototype.connectedCallback = function (a) { var b = a.__CE_definition; b.connectedCallback && b.connectedCallback.call(a); }; | ||
| u.prototype.disconnectedCallback = function (a) { var b = a.__CE_definition; b.disconnectedCallback && b.disconnectedCallback.call(a); }; | ||
| u.prototype.attributeChangedCallback = function (a, b, d, c, e) { var f = a.__CE_definition; f.attributeChangedCallback && -1 < f.observedAttributes.indexOf(b) && f.attributeChangedCallback.call(a, b, d, c, e); }; | ||
| function B(a) { var b = document; this.c = a; this.a = b; this.b = void 0; A(this.c, this.a); "loading" === this.a.readyState && (this.b = new MutationObserver(this.f.bind(this)), this.b.observe(this.a, { childList: !0, subtree: !0 })); } | ||
| function C(a) { a.b && a.b.disconnect(); } | ||
| B.prototype.f = function (a) { var b = this.a.readyState; "interactive" !== b && "complete" !== b || C(this); for (b = 0; b < a.length; b++) | ||
| for (var d = a[b].addedNodes, c = 0; c < d.length; c++) | ||
| A(this.c, d[c]); }; | ||
| function ea() { var a = this; this.b = this.a = void 0; this.c = new Promise(function (b) { a.b = b; a.a && b(a.a); }); } | ||
| function D(a) { if (a.a) | ||
| throw Error("Already resolved."); a.a = void 0; a.b && a.b(void 0); } | ||
| function E(a) { this.c = !1; this.a = a; this.j = new Map; this.f = function (b) { return b(); }; this.b = !1; this.g = []; this.o = new B(a); } | ||
| E.prototype.l = function (a, b) { | ||
| var d = this; | ||
| if (!(b instanceof Function)) | ||
| throw new TypeError("Custom element constructors must be functions."); | ||
| if (!g(a)) | ||
| throw new SyntaxError("The element name '" + a + "' is not valid."); | ||
| if (this.a.a.get(a)) | ||
| throw Error("A custom element with name '" + a + "' has already been defined."); | ||
| if (this.c) | ||
| throw Error("A custom element is already being defined."); | ||
| this.c = !0; | ||
| try { | ||
| var c = function (b) { | ||
| var a = e[b]; | ||
| if (void 0 !== a && !(a instanceof Function)) | ||
| throw Error("The '" + b + "' callback must be a function."); | ||
| return a; | ||
| }, e = b.prototype; | ||
| if (!(e instanceof Object)) | ||
| throw new TypeError("The custom element constructor's prototype is not an object."); | ||
| var f = c("connectedCallback"); | ||
| var t = c("disconnectedCallback"); | ||
| var k = c("adoptedCallback"); | ||
| var h = c("attributeChangedCallback"); | ||
| var m = b.observedAttributes || []; | ||
| } | ||
| catch (q) { | ||
| return; | ||
| } | ||
| finally { | ||
| this.c = !1; | ||
| } | ||
| b = { localName: a, constructorFunction: b, connectedCallback: f, disconnectedCallback: t, adoptedCallback: k, attributeChangedCallback: h, observedAttributes: m, constructionStack: [] }; | ||
| ba(this.a, a, b); | ||
| this.g.push(b); | ||
| this.b || (this.b = !0, this.f(function () { return fa(d); })); | ||
| }; | ||
| E.prototype.i = function (a) { A(this.a, a); }; | ||
| function fa(a) { if (!1 !== a.b) { | ||
| a.b = !1; | ||
| for (var b = a.g, d = [], c = new Map, e = 0; e < b.length; e++) | ||
| c.set(b[e].localName, []); | ||
| A(a.a, document, { i: function (b) { if (void 0 === b.__CE_state) { | ||
| var e = b.localName, f = c.get(e); | ||
| f ? f.push(b) : a.a.a.get(e) && d.push(b); | ||
| } } }); | ||
| for (e = 0; e < d.length; e++) | ||
| y(a.a, d[e]); | ||
| for (; 0 < b.length;) { | ||
| var f = b.shift(); | ||
| e = f.localName; | ||
| f = c.get(f.localName); | ||
| for (var t = 0; t < f.length; t++) | ||
| y(a.a, f[t]); | ||
| (e = a.j.get(e)) && D(e); | ||
| } | ||
| } } | ||
| E.prototype.get = function (a) { if (a = this.a.a.get(a)) | ||
| return a.constructorFunction; }; | ||
| E.prototype.m = function (a) { if (!g(a)) | ||
| return Promise.reject(new SyntaxError("'" + a + "' is not a valid custom element name.")); var b = this.j.get(a); if (b) | ||
| return b.c; b = new ea; this.j.set(a, b); this.a.a.get(a) && !this.g.some(function (b) { return b.localName === a; }) && D(b); return b.c; }; | ||
| E.prototype.s = function (a) { C(this.o); var b = this.f; this.f = function (d) { return a(function () { return b(d); }); }; }; | ||
| window.CustomElementRegistry = E; | ||
| E.prototype.define = E.prototype.l; | ||
| E.prototype.upgrade = E.prototype.i; | ||
| E.prototype.get = E.prototype.get; | ||
| E.prototype.whenDefined = E.prototype.m; | ||
| E.prototype.polyfillWrapFlushCallback = E.prototype.s; | ||
| var F = window.Document.prototype.createElement, G = window.Document.prototype.createElementNS, ha = window.Document.prototype.importNode, ia = window.Document.prototype.prepend, ja = window.Document.prototype.append, ka = window.DocumentFragment.prototype.prepend, la = window.DocumentFragment.prototype.append, H = window.Node.prototype.cloneNode, I = window.Node.prototype.appendChild, J = window.Node.prototype.insertBefore, K = window.Node.prototype.removeChild, L = window.Node.prototype.replaceChild, M = Object.getOwnPropertyDescriptor(window.Node.prototype, "textContent"), N = window.Element.prototype.attachShadow, O = Object.getOwnPropertyDescriptor(window.Element.prototype, "innerHTML"), P = window.Element.prototype.getAttribute, Q = window.Element.prototype.setAttribute, R = window.Element.prototype.removeAttribute, S = window.Element.prototype.getAttributeNS, T = window.Element.prototype.setAttributeNS, U = window.Element.prototype.removeAttributeNS, ma = window.Element.prototype.insertAdjacentElement, na = window.Element.prototype.insertAdjacentHTML, oa = window.Element.prototype.prepend, pa = window.Element.prototype.append, V = window.Element.prototype.before, qa = window.Element.prototype.after, ra = window.Element.prototype.replaceWith, sa = window.Element.prototype.remove, ta = window.HTMLElement, W = Object.getOwnPropertyDescriptor(window.HTMLElement.prototype, "innerHTML"), ua = window.HTMLElement.prototype.insertAdjacentElement, va = window.HTMLElement.prototype.insertAdjacentHTML; | ||
| var wa = new function () { }; | ||
| function xa() { | ||
| var a = X; | ||
| window.HTMLElement = function () { | ||
| function b() { | ||
| var b = this.constructor, c = a.g.get(b); | ||
| if (!c) | ||
| throw Error("The custom element being constructed was not registered with `customElements`."); | ||
| var e = c.constructionStack; | ||
| if (0 === e.length) | ||
| return e = F.call(document, c.localName), Object.setPrototypeOf(e, b.prototype), e.__CE_state = 1, e.__CE_definition = c, w(a, e), e; | ||
| c = e.length - 1; | ||
| var f = e[c]; | ||
| if (f === wa) | ||
| throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times."); | ||
| e[c] = wa; | ||
| Object.setPrototypeOf(f, b.prototype); | ||
| w(a, f); | ||
| return f; | ||
| } | ||
| b.prototype = ta.prototype; | ||
| Object.defineProperty(b.prototype, "constructor", { writable: !0, configurable: !0, enumerable: !1, value: b }); | ||
| return b; | ||
| }(); | ||
| } | ||
| function Y(a, b, d) { function c(b) { return function (d) { for (var e = [], c = 0; c < arguments.length; ++c) | ||
| e[c] = arguments[c]; c = []; for (var f = [], m = 0; m < e.length; m++) { | ||
| var q = e[m]; | ||
| q instanceof Element && l(q) && f.push(q); | ||
| if (q instanceof DocumentFragment) | ||
| for (q = q.firstChild; q; q = q.nextSibling) | ||
| c.push(q); | ||
| else | ||
| c.push(q); | ||
| } b.apply(this, e); for (e = 0; e < f.length; e++) | ||
| z(a, f[e]); if (l(this)) | ||
| for (e = 0; e < c.length; e++) | ||
| f = c[e], f instanceof Element && x(a, f); }; } void 0 !== d.h && (b.prepend = c(d.h)); void 0 !== d.append && (b.append = c(d.append)); } | ||
| function ya() { | ||
| var a = X; | ||
| r(Document.prototype, "createElement", function (b) { if (this.__CE_hasRegistry) { | ||
| var d = a.a.get(b); | ||
| if (d) | ||
| return new d.constructorFunction; | ||
| } b = F.call(this, b); w(a, b); return b; }); | ||
| r(Document.prototype, "importNode", function (b, d) { b = ha.call(this, b, !!d); this.__CE_hasRegistry ? A(a, b) : v(a, b); return b; }); | ||
| r(Document.prototype, "createElementNS", function (b, d) { | ||
| if (this.__CE_hasRegistry && (null === b || "http://www.w3.org/1999/xhtml" === b)) { | ||
| var c = a.a.get(d); | ||
| if (c) | ||
| return new c.constructorFunction; | ||
| } | ||
| b = G.call(this, b, d); | ||
| w(a, b); | ||
| return b; | ||
| }); | ||
| Y(a, Document.prototype, { h: ia, append: ja }); | ||
| } | ||
| function za() { | ||
| function a(a, c) { Object.defineProperty(a, "textContent", { enumerable: c.enumerable, configurable: !0, get: c.get, set: function (a) { if (this.nodeType === Node.TEXT_NODE) | ||
| c.set.call(this, a); | ||
| else { | ||
| var d = void 0; | ||
| if (this.firstChild) { | ||
| var e = this.childNodes, k = e.length; | ||
| if (0 < k && l(this)) { | ||
| d = Array(k); | ||
| for (var h = 0; h < k; h++) | ||
| d[h] = e[h]; | ||
| } | ||
| } | ||
| c.set.call(this, a); | ||
| if (d) | ||
| for (a = 0; a < d.length; a++) | ||
| z(b, d[a]); | ||
| } } }); } | ||
| var b = X; | ||
| r(Node.prototype, "insertBefore", function (a, c) { | ||
| if (a instanceof DocumentFragment) { | ||
| var e = Array.prototype.slice.apply(a.childNodes); | ||
| a = J.call(this, a, c); | ||
| if (l(this)) | ||
| for (c = 0; c < e.length; c++) | ||
| x(b, e[c]); | ||
| return a; | ||
| } | ||
| e = l(a); | ||
| c = J.call(this, a, c); | ||
| e && z(b, a); | ||
| l(this) && x(b, a); | ||
| return c; | ||
| }); | ||
| r(Node.prototype, "appendChild", function (a) { if (a instanceof DocumentFragment) { | ||
| var c = Array.prototype.slice.apply(a.childNodes); | ||
| a = I.call(this, a); | ||
| if (l(this)) | ||
| for (var e = 0; e < c.length; e++) | ||
| x(b, c[e]); | ||
| return a; | ||
| } c = l(a); e = I.call(this, a); c && z(b, a); l(this) && x(b, a); return e; }); | ||
| r(Node.prototype, "cloneNode", function (a) { | ||
| a = H.call(this, !!a); | ||
| this.ownerDocument.__CE_hasRegistry ? A(b, a) : v(b, a); | ||
| return a; | ||
| }); | ||
| r(Node.prototype, "removeChild", function (a) { var c = l(a), e = K.call(this, a); c && z(b, a); return e; }); | ||
| r(Node.prototype, "replaceChild", function (a, c) { if (a instanceof DocumentFragment) { | ||
| var e = Array.prototype.slice.apply(a.childNodes); | ||
| a = L.call(this, a, c); | ||
| if (l(this)) | ||
| for (z(b, c), c = 0; c < e.length; c++) | ||
| x(b, e[c]); | ||
| return a; | ||
| } e = l(a); var f = L.call(this, a, c), d = l(this); d && z(b, c); e && z(b, a); d && x(b, a); return f; }); | ||
| M && M.get ? a(Node.prototype, M) : ca(b, function (b) { | ||
| a(b, { enumerable: !0, configurable: !0, get: function () { | ||
| for (var a = [], b = 0; b < this.childNodes.length; b++) { | ||
| var f = this.childNodes[b]; | ||
| f.nodeType !== Node.COMMENT_NODE && a.push(f.textContent); | ||
| } | ||
| return a.join(""); | ||
| }, set: function (a) { for (; this.firstChild;) | ||
| K.call(this, this.firstChild); null != a && "" !== a && I.call(this, document.createTextNode(a)); } }); | ||
| }); | ||
| } | ||
| function Aa(a) { | ||
| function b(b) { return function (e) { for (var c = [], d = 0; d < arguments.length; ++d) | ||
| c[d] = arguments[d]; d = []; for (var k = [], h = 0; h < c.length; h++) { | ||
| var m = c[h]; | ||
| m instanceof Element && l(m) && k.push(m); | ||
| if (m instanceof DocumentFragment) | ||
| for (m = m.firstChild; m; m = m.nextSibling) | ||
| d.push(m); | ||
| else | ||
| d.push(m); | ||
| } b.apply(this, c); for (c = 0; c < k.length; c++) | ||
| z(a, k[c]); if (l(this)) | ||
| for (c = 0; c < d.length; c++) | ||
| k = d[c], k instanceof Element && x(a, k); }; } | ||
| var d = Element.prototype; | ||
| void 0 !== V && (d.before = b(V)); | ||
| void 0 !== V && (d.after = b(qa)); | ||
| void 0 !== ra && | ||
| r(d, "replaceWith", function (b) { for (var e = [], c = 0; c < arguments.length; ++c) | ||
| e[c] = arguments[c]; c = []; for (var d = [], k = 0; k < e.length; k++) { | ||
| var h = e[k]; | ||
| h instanceof Element && l(h) && d.push(h); | ||
| if (h instanceof DocumentFragment) | ||
| for (h = h.firstChild; h; h = h.nextSibling) | ||
| c.push(h); | ||
| else | ||
| c.push(h); | ||
| } k = l(this); ra.apply(this, e); for (e = 0; e < d.length; e++) | ||
| z(a, d[e]); if (k) | ||
| for (z(a, this), e = 0; e < c.length; e++) | ||
| d = c[e], d instanceof Element && x(a, d); }); | ||
| void 0 !== sa && r(d, "remove", function () { var b = l(this); sa.call(this); b && z(a, this); }); | ||
| } | ||
| function Ba() { | ||
| function a(a, b) { Object.defineProperty(a, "innerHTML", { enumerable: b.enumerable, configurable: !0, get: b.get, set: function (a) { var e = this, d = void 0; l(this) && (d = [], p(this, function (a) { a !== e && d.push(a); })); b.set.call(this, a); if (d) | ||
| for (var f = 0; f < d.length; f++) { | ||
| var t = d[f]; | ||
| 1 === t.__CE_state && c.disconnectedCallback(t); | ||
| } this.ownerDocument.__CE_hasRegistry ? A(c, this) : v(c, this); return a; } }); } | ||
| function b(a, b) { r(a, "insertAdjacentElement", function (a, e) { var d = l(e); a = b.call(this, a, e); d && z(c, e); l(a) && x(c, e); return a; }); } | ||
| function d(a, b) { | ||
| function e(a, b) { for (var e = []; a !== b; a = a.nextSibling) | ||
| e.push(a); for (b = 0; b < e.length; b++) | ||
| A(c, e[b]); } | ||
| r(a, "insertAdjacentHTML", function (a, c) { | ||
| a = a.toLowerCase(); | ||
| if ("beforebegin" === a) { | ||
| var d = this.previousSibling; | ||
| b.call(this, a, c); | ||
| e(d || this.parentNode.firstChild, this); | ||
| } | ||
| else if ("afterbegin" === a) | ||
| d = this.firstChild, b.call(this, a, c), e(this.firstChild, d); | ||
| else if ("beforeend" === a) | ||
| d = this.lastChild, b.call(this, a, c), e(d || this.firstChild, null); | ||
| else if ("afterend" === a) | ||
| d = this.nextSibling, b.call(this, a, c), e(this.nextSibling, d); | ||
| else | ||
| throw new SyntaxError("The value provided (" + String(a) + ") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'."); | ||
| }); | ||
| } | ||
| var c = X; | ||
| N && r(Element.prototype, "attachShadow", function (a) { a = N.call(this, a); var b = c; if (b.b && !a.__CE_patched) { | ||
| a.__CE_patched = !0; | ||
| for (var e = 0; e < b.c.length; e++) | ||
| b.c[e](a); | ||
| } return this.__CE_shadowRoot = a; }); | ||
| O && O.get ? a(Element.prototype, O) : W && W.get ? a(HTMLElement.prototype, W) : da(c, function (b) { | ||
| a(b, { enumerable: !0, configurable: !0, get: function () { return H.call(this, !0).innerHTML; }, | ||
| set: function (a) { var b = "template" === this.localName, c = b ? this.content : this, e = G.call(document, this.namespaceURI, this.localName); for (e.innerHTML = a; 0 < c.childNodes.length;) | ||
| K.call(c, c.childNodes[0]); for (a = b ? e.content : e; 0 < a.childNodes.length;) | ||
| I.call(c, a.childNodes[0]); } }); | ||
| }); | ||
| r(Element.prototype, "setAttribute", function (a, b) { if (1 !== this.__CE_state) | ||
| return Q.call(this, a, b); var e = P.call(this, a); Q.call(this, a, b); b = P.call(this, a); c.attributeChangedCallback(this, a, e, b, null); }); | ||
| r(Element.prototype, "setAttributeNS", function (a, b, d) { if (1 !== this.__CE_state) | ||
| return T.call(this, a, b, d); var e = S.call(this, a, b); T.call(this, a, b, d); d = S.call(this, a, b); c.attributeChangedCallback(this, b, e, d, a); }); | ||
| r(Element.prototype, "removeAttribute", function (a) { if (1 !== this.__CE_state) | ||
| return R.call(this, a); var b = P.call(this, a); R.call(this, a); null !== b && c.attributeChangedCallback(this, a, b, null, null); }); | ||
| r(Element.prototype, "removeAttributeNS", function (a, b) { | ||
| if (1 !== this.__CE_state) | ||
| return U.call(this, a, b); | ||
| var d = S.call(this, a, b); | ||
| U.call(this, a, b); | ||
| var e = S.call(this, a, b); | ||
| d !== e && c.attributeChangedCallback(this, b, d, e, a); | ||
| }); | ||
| ua ? b(HTMLElement.prototype, ua) : ma ? b(Element.prototype, ma) : console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched."); | ||
| va ? d(HTMLElement.prototype, va) : na ? d(Element.prototype, na) : console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched."); | ||
| Y(c, Element.prototype, { h: oa, append: pa }); | ||
| Aa(c); | ||
| } | ||
| var Z = window.customElements; | ||
| if (!Z || Z.forcePolyfill || "function" != typeof Z.define || "function" != typeof Z.get) { | ||
| var X = new u; | ||
| xa(); | ||
| ya(); | ||
| Y(X, DocumentFragment.prototype, { h: ka, append: la }); | ||
| za(); | ||
| Ba(); | ||
| document.__CE_hasRegistry = !0; | ||
| var customElements = new E(X); | ||
| Object.defineProperty(window, "customElements", { configurable: !0, enumerable: !0, value: customElements }); | ||
| } | ||
| }).call(self); | ||
| // Polyfill document.baseURI | ||
| if (typeof document.baseURI !== 'string') { | ||
| Object.defineProperty(Document.prototype, 'baseURI', { | ||
| enumerable: true, | ||
| configurable: true, | ||
| get: function () { | ||
| var base = document.querySelector('base'); | ||
| if (base && base.href) { | ||
| return base.href; | ||
| } | ||
| return document.URL; | ||
| } | ||
| }); | ||
| } | ||
| // Polyfill CustomEvent | ||
| if (typeof window.CustomEvent !== 'function') { | ||
| window.CustomEvent = function CustomEvent(event, params) { | ||
| params = params || { bubbles: false, cancelable: false, detail: undefined }; | ||
| var evt = document.createEvent('CustomEvent'); | ||
| evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); | ||
| return evt; | ||
| }; | ||
| window.CustomEvent.prototype = window.Event.prototype; | ||
| } | ||
| // Event.composedPath | ||
| (function (E, d, w) { | ||
| if (!E.composedPath) { | ||
| E.composedPath = function () { | ||
| if (this.path) { | ||
| return this.path; | ||
| } | ||
| var target = this.target; | ||
| this.path = []; | ||
| while (target.parentNode !== null) { | ||
| this.path.push(target); | ||
| target = target.parentNode; | ||
| } | ||
| this.path.push(d, w); | ||
| return this.path; | ||
| }; | ||
| } | ||
| })(Event.prototype, document, window); | ||
| /*! | ||
| Element.closest and Element.matches | ||
| https://github.com/jonathantneal/closest | ||
| Creative Commons Zero v1.0 Universal | ||
| */ | ||
| (function (a) { "function" !== typeof a.matches && (a.matches = a.msMatchesSelector || a.mozMatchesSelector || a.webkitMatchesSelector || function (a) { a = (this.document || this.ownerDocument).querySelectorAll(a); for (var b = 0; a[b] && a[b] !== this;) | ||
| ++b; return !!a[b]; }); "function" !== typeof a.closest && (a.closest = function (a) { for (var b = this; b && 1 === b.nodeType;) { | ||
| if (b.matches(a)) | ||
| return b; | ||
| b = b.parentNode; | ||
| } return null; }); })(window.Element.prototype); | ||
| /*! | ||
| Element.getRootNode() | ||
| */ | ||
| (function (c) { function d(a) { a = b(a); return a && 11 === a.nodeType ? d(a.host) : a; } function b(a) { return a && a.parentNode ? b(a.parentNode) : a; } "function" !== typeof c.getRootNode && (c.getRootNode = function (a) { return a && a.composed ? d(this) : b(this); }); })(Element.prototype); | ||
| /*! | ||
| Element.isConnected() | ||
| */ | ||
| (function (prototype) { | ||
| if (!("isConnected" in prototype)) { | ||
| Object.defineProperty(prototype, 'isConnected', { | ||
| configurable: true, | ||
| enumerable: true, | ||
| get: function () { | ||
| var root = this.getRootNode({ composed: true }); | ||
| return root && root.nodeType === 9; | ||
| } | ||
| }); | ||
| } | ||
| })(Element.prototype); | ||
| /*! | ||
| Element.remove() | ||
| */ | ||
| (function (b) { b.forEach(function (a) { a.hasOwnProperty("remove") || Object.defineProperty(a, "remove", { configurable: !0, enumerable: !0, writable: !0, value: function () { null !== this.parentNode && this.parentNode.removeChild(this); } }); }); })([Element.prototype, CharacterData.prototype, DocumentType.prototype]); | ||
| /*! | ||
| Element.classList | ||
| */ | ||
| !function (e) { 'classList' in e || Object.defineProperty(e, "classList", { get: function () { var e = this, t = (e.getAttribute("class") || "").replace(/^\s+|\s$/g, "").split(/\s+/g); function n() { t.length > 0 ? e.setAttribute("class", t.join(" ")) : e.removeAttribute("class"); } return "" === t[0] && t.splice(0, 1), t.toggle = function (e, i) { void 0 !== i ? i ? t.add(e) : t.remove(e) : -1 !== t.indexOf(e) ? t.splice(t.indexOf(e), 1) : t.push(e), n(); }, t.add = function () { for (var e = [].slice.call(arguments), i = 0, s = e.length; i < s; i++) | ||
| -1 === t.indexOf(e[i]) && t.push(e[i]); n(); }, t.remove = function () { for (var e = [].slice.call(arguments), i = 0, s = e.length; i < s; i++) | ||
| -1 !== t.indexOf(e[i]) && t.splice(t.indexOf(e[i]), 1); n(); }, t.item = function (e) { return t[e]; }, t.contains = function (e) { return -1 !== t.indexOf(e); }, t.replace = function (e, i) { -1 !== t.indexOf(e) && t.splice(t.indexOf(e), 1, i), n(); }, t.value = e.getAttribute("class") || "", t; } }); }(Element.prototype); | ||
| /*! | ||
| DOMTokenList | ||
| */ | ||
| (function (prototype) { | ||
| try { | ||
| document.body.classList.add(); | ||
| } | ||
| catch (e) { | ||
| var originalAdd = prototype.add; | ||
| var originalRemove = prototype.remove; | ||
| prototype.add = function () { | ||
| for (var i = 0; i < arguments.length; i++) { | ||
| originalAdd.call(this, arguments[i]); | ||
| } | ||
| }; | ||
| prototype.remove = function () { | ||
| for (var i = 0; i < arguments.length; i++) { | ||
| originalRemove.call(this, arguments[i]); | ||
| } | ||
| }; | ||
| } | ||
| }(DOMTokenList.prototype)); |
| var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
| for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
| for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
| for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
| r[k] = a[j]; | ||
| return r; | ||
| }; | ||
| /** | ||
| * @license | ||
| * Copyright Google Inc. All Rights Reserved. | ||
| * | ||
| * Use of this source code is governed by an MIT-style license that can be | ||
| * found in the LICENSE file at https://angular.io/license | ||
| * | ||
| * This file is a port of shadowCSS from webcomponents.js to TypeScript. | ||
| * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js | ||
| * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts | ||
| */ | ||
| var safeSelector = function (selector) { | ||
| var placeholders = []; | ||
| var index = 0; | ||
| var content; | ||
| // Replaces attribute selectors with placeholders. | ||
| // The WS in [attr="va lue"] would otherwise be interpreted as a selector separator. | ||
| selector = selector.replace(/(\[[^\]]*\])/g, function (_, keep) { | ||
| var replaceBy = "__ph-" + index + "__"; | ||
| placeholders.push(keep); | ||
| index++; | ||
| return replaceBy; | ||
| }); | ||
| // Replaces the expression in `:nth-child(2n + 1)` with a placeholder. | ||
| // WS and "+" would otherwise be interpreted as selector separators. | ||
| content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, function (_, pseudo, exp) { | ||
| var replaceBy = "__ph-" + index + "__"; | ||
| placeholders.push(exp); | ||
| index++; | ||
| return pseudo + replaceBy; | ||
| }); | ||
| var ss = { | ||
| content: content, | ||
| placeholders: placeholders, | ||
| }; | ||
| return ss; | ||
| }; | ||
| var restoreSafeSelector = function (placeholders, content) { | ||
| return content.replace(/__ph-(\d+)__/g, function (_, index) { return placeholders[+index]; }); | ||
| }; | ||
| var _polyfillHost = '-shadowcsshost'; | ||
| var _polyfillSlotted = '-shadowcssslotted'; | ||
| // note: :host-context pre-processed to -shadowcsshostcontext. | ||
| var _polyfillHostContext = '-shadowcsscontext'; | ||
| var _parenSuffix = ')(?:\\((' + | ||
| '(?:\\([^)(]*\\)|[^)(]*)+?' + | ||
| ')\\))?([^,{]*)'; | ||
| var _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim'); | ||
| var _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim'); | ||
| var _cssColonSlottedRe = new RegExp('(' + _polyfillSlotted + _parenSuffix, 'gim'); | ||
| var _polyfillHostNoCombinator = _polyfillHost + '-no-combinator'; | ||
| var _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/; | ||
| var _shadowDOMSelectorsRe = [ | ||
| /::shadow/g, | ||
| /::content/g | ||
| ]; | ||
| var _selectorReSuffix = '([>\\s~+\[.,{:][\\s\\S]*)?$'; | ||
| var _polyfillHostRe = /-shadowcsshost/gim; | ||
| var _colonHostRe = /:host/gim; | ||
| var _colonSlottedRe = /::slotted/gim; | ||
| var _colonHostContextRe = /:host-context/gim; | ||
| var _commentRe = /\/\*\s*[\s\S]*?\*\//g; | ||
| var stripComments = function (input) { | ||
| return input.replace(_commentRe, ''); | ||
| }; | ||
| var _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g; | ||
| var extractCommentsWithHash = function (input) { | ||
| return input.match(_commentWithHashRe) || []; | ||
| }; | ||
| var _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g; | ||
| var _curlyRe = /([{}])/g; | ||
| var OPEN_CURLY = '{'; | ||
| var CLOSE_CURLY = '}'; | ||
| var BLOCK_PLACEHOLDER = '%BLOCK%'; | ||
| var processRules = function (input, ruleCallback) { | ||
| var inputWithEscapedBlocks = escapeBlocks(input); | ||
| var nextBlockIndex = 0; | ||
| return inputWithEscapedBlocks.escapedString.replace(_ruleRe, function () { | ||
| var m = []; | ||
| for (var _i = 0; _i < arguments.length; _i++) { | ||
| m[_i] = arguments[_i]; | ||
| } | ||
| var selector = m[2]; | ||
| var content = ''; | ||
| var suffix = m[4]; | ||
| var contentPrefix = ''; | ||
| if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) { | ||
| content = inputWithEscapedBlocks.blocks[nextBlockIndex++]; | ||
| suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1); | ||
| contentPrefix = '{'; | ||
| } | ||
| var cssRule = { | ||
| selector: selector, | ||
| content: content | ||
| }; | ||
| var rule = ruleCallback(cssRule); | ||
| return "" + m[1] + rule.selector + m[3] + contentPrefix + rule.content + suffix; | ||
| }); | ||
| }; | ||
| var escapeBlocks = function (input) { | ||
| var inputParts = input.split(_curlyRe); | ||
| var resultParts = []; | ||
| var escapedBlocks = []; | ||
| var bracketCount = 0; | ||
| var currentBlockParts = []; | ||
| for (var partIndex = 0; partIndex < inputParts.length; partIndex++) { | ||
| var part = inputParts[partIndex]; | ||
| if (part === CLOSE_CURLY) { | ||
| bracketCount--; | ||
| } | ||
| if (bracketCount > 0) { | ||
| currentBlockParts.push(part); | ||
| } | ||
| else { | ||
| if (currentBlockParts.length > 0) { | ||
| escapedBlocks.push(currentBlockParts.join('')); | ||
| resultParts.push(BLOCK_PLACEHOLDER); | ||
| currentBlockParts = []; | ||
| } | ||
| resultParts.push(part); | ||
| } | ||
| if (part === OPEN_CURLY) { | ||
| bracketCount++; | ||
| } | ||
| } | ||
| if (currentBlockParts.length > 0) { | ||
| escapedBlocks.push(currentBlockParts.join('')); | ||
| resultParts.push(BLOCK_PLACEHOLDER); | ||
| } | ||
| var strEscapedBlocks = { | ||
| escapedString: resultParts.join(''), | ||
| blocks: escapedBlocks | ||
| }; | ||
| return strEscapedBlocks; | ||
| }; | ||
| var insertPolyfillHostInCssText = function (selector) { | ||
| selector = selector | ||
| .replace(_colonHostContextRe, _polyfillHostContext) | ||
| .replace(_colonHostRe, _polyfillHost) | ||
| .replace(_colonSlottedRe, _polyfillSlotted); | ||
| return selector; | ||
| }; | ||
| var convertColonRule = function (cssText, regExp, partReplacer) { | ||
| // m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule | ||
| return cssText.replace(regExp, function () { | ||
| var m = []; | ||
| for (var _i = 0; _i < arguments.length; _i++) { | ||
| m[_i] = arguments[_i]; | ||
| } | ||
| if (m[2]) { | ||
| var parts = m[2].split(','); | ||
| var r = []; | ||
| for (var i = 0; i < parts.length; i++) { | ||
| var p = parts[i].trim(); | ||
| if (!p) | ||
| break; | ||
| r.push(partReplacer(_polyfillHostNoCombinator, p, m[3])); | ||
| } | ||
| return r.join(','); | ||
| } | ||
| else { | ||
| return _polyfillHostNoCombinator + m[3]; | ||
| } | ||
| }); | ||
| }; | ||
| var colonHostPartReplacer = function (host, part, suffix) { | ||
| return host + part.replace(_polyfillHost, '') + suffix; | ||
| }; | ||
| var convertColonHost = function (cssText) { | ||
| return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer); | ||
| }; | ||
| var colonHostContextPartReplacer = function (host, part, suffix) { | ||
| if (part.indexOf(_polyfillHost) > -1) { | ||
| return colonHostPartReplacer(host, part, suffix); | ||
| } | ||
| else { | ||
| return host + part + suffix + ', ' + part + ' ' + host + suffix; | ||
| } | ||
| }; | ||
| var convertColonSlotted = function (cssText, slotAttr) { | ||
| var regExp = _cssColonSlottedRe; | ||
| return cssText.replace(regExp, function () { | ||
| var m = []; | ||
| for (var _i = 0; _i < arguments.length; _i++) { | ||
| m[_i] = arguments[_i]; | ||
| } | ||
| if (m[2]) { | ||
| var compound = m[2].trim(); | ||
| var suffix = m[3]; | ||
| var sel = '.' + slotAttr + ' > ' + compound + suffix; | ||
| return sel; | ||
| } | ||
| else { | ||
| return _polyfillHostNoCombinator + m[3]; | ||
| } | ||
| }); | ||
| }; | ||
| var convertColonHostContext = function (cssText) { | ||
| return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer); | ||
| }; | ||
| var convertShadowDOMSelectors = function (cssText) { | ||
| return _shadowDOMSelectorsRe.reduce(function (result, pattern) { return result.replace(pattern, ' '); }, cssText); | ||
| }; | ||
| var makeScopeMatcher = function (scopeSelector) { | ||
| var lre = /\[/g; | ||
| var rre = /\]/g; | ||
| scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]'); | ||
| return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm'); | ||
| }; | ||
| var selectorNeedsScoping = function (selector, scopeSelector) { | ||
| var re = makeScopeMatcher(scopeSelector); | ||
| return !re.test(selector); | ||
| }; | ||
| var applySimpleSelectorScope = function (selector, scopeSelector, hostSelector) { | ||
| // In Android browser, the lastIndex is not reset when the regex is used in String.replace() | ||
| _polyfillHostRe.lastIndex = 0; | ||
| if (_polyfillHostRe.test(selector)) { | ||
| var replaceBy_1 = "." + hostSelector; | ||
| return selector | ||
| .replace(_polyfillHostNoCombinatorRe, function (_, selector) { | ||
| return selector.replace(/([^:]*)(:*)(.*)/, function (_, before, colon, after) { | ||
| return before + replaceBy_1 + colon + after; | ||
| }); | ||
| }) | ||
| .replace(_polyfillHostRe, replaceBy_1 + ' '); | ||
| } | ||
| return scopeSelector + ' ' + selector; | ||
| }; | ||
| var applyStrictSelectorScope = function (selector, scopeSelector, hostSelector) { | ||
| var isRe = /\[is=([^\]]*)\]/g; | ||
| scopeSelector = scopeSelector.replace(isRe, function (_) { | ||
| var parts = []; | ||
| for (var _i = 1; _i < arguments.length; _i++) { | ||
| parts[_i - 1] = arguments[_i]; | ||
| } | ||
| return parts[0]; | ||
| }); | ||
| var className = '.' + scopeSelector; | ||
| var _scopeSelectorPart = function (p) { | ||
| var scopedP = p.trim(); | ||
| if (!scopedP) { | ||
| return ''; | ||
| } | ||
| if (p.indexOf(_polyfillHostNoCombinator) > -1) { | ||
| scopedP = applySimpleSelectorScope(p, scopeSelector, hostSelector); | ||
| } | ||
| else { | ||
| // remove :host since it should be unnecessary | ||
| var t = p.replace(_polyfillHostRe, ''); | ||
| if (t.length > 0) { | ||
| var matches = t.match(/([^:]*)(:*)(.*)/); | ||
| if (matches) { | ||
| scopedP = matches[1] + className + matches[2] + matches[3]; | ||
| } | ||
| } | ||
| } | ||
| return scopedP; | ||
| }; | ||
| var safeContent = safeSelector(selector); | ||
| selector = safeContent.content; | ||
| var scopedSelector = ''; | ||
| var startIndex = 0; | ||
| var res; | ||
| var sep = /( |>|\+|~(?!=))\s*/g; | ||
| // If a selector appears before :host it should not be shimmed as it | ||
| // matches on ancestor elements and not on elements in the host's shadow | ||
| // `:host-context(div)` is transformed to | ||
| // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator` | ||
| // the `div` is not part of the component in the 2nd selectors and should not be scoped. | ||
| // Historically `component-tag:host` was matching the component so we also want to preserve | ||
| // this behavior to avoid breaking legacy apps (it should not match). | ||
| // The behavior should be: | ||
| // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything) | ||
| // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a | ||
| // `:host-context(tag)`) | ||
| var hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1; | ||
| // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present | ||
| var shouldScope = !hasHost; | ||
| while ((res = sep.exec(selector)) !== null) { | ||
| var separator = res[1]; | ||
| var part_1 = selector.slice(startIndex, res.index).trim(); | ||
| shouldScope = shouldScope || part_1.indexOf(_polyfillHostNoCombinator) > -1; | ||
| var scopedPart = shouldScope ? _scopeSelectorPart(part_1) : part_1; | ||
| scopedSelector += scopedPart + " " + separator + " "; | ||
| startIndex = sep.lastIndex; | ||
| } | ||
| var part = selector.substring(startIndex); | ||
| shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1; | ||
| scopedSelector += shouldScope ? _scopeSelectorPart(part) : part; | ||
| // replace the placeholders with their original values | ||
| return restoreSafeSelector(safeContent.placeholders, scopedSelector); | ||
| }; | ||
| var scopeSelector = function (selector, scopeSelectorText, hostSelector, slotSelector) { | ||
| return selector.split(',') | ||
| .map(function (shallowPart) { | ||
| if (slotSelector && shallowPart.indexOf('.' + slotSelector) > -1) { | ||
| return shallowPart.trim(); | ||
| } | ||
| if (selectorNeedsScoping(shallowPart, scopeSelectorText)) { | ||
| return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim(); | ||
| } | ||
| else { | ||
| return shallowPart.trim(); | ||
| } | ||
| }) | ||
| .join(', '); | ||
| }; | ||
| var scopeSelectors = function (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) { | ||
| return processRules(cssText, function (rule) { | ||
| var selector = rule.selector; | ||
| var content = rule.content; | ||
| if (rule.selector[0] !== '@') { | ||
| selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector); | ||
| } | ||
| else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') || | ||
| rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) { | ||
| content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector); | ||
| } | ||
| var cssRule = { | ||
| selector: selector.replace(/\s{2,}/g, ' ').trim(), | ||
| content: content | ||
| }; | ||
| return cssRule; | ||
| }); | ||
| }; | ||
| var scopeCssText = function (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) { | ||
| cssText = insertPolyfillHostInCssText(cssText); | ||
| cssText = convertColonHost(cssText); | ||
| cssText = convertColonHostContext(cssText); | ||
| cssText = convertColonSlotted(cssText, slotScopeId); | ||
| cssText = convertShadowDOMSelectors(cssText); | ||
| if (scopeId) { | ||
| cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId); | ||
| } | ||
| cssText = cssText.replace(/-shadowcsshost-no-combinator/g, "." + hostScopeId); | ||
| cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, ' $1 '); | ||
| return cssText.trim(); | ||
| }; | ||
| var scopeCss = function (cssText, scopeId, commentOriginalSelector) { | ||
| var hostScopeId = scopeId + '-h'; | ||
| var slotScopeId = scopeId + '-s'; | ||
| var commentsWithHash = extractCommentsWithHash(cssText); | ||
| cssText = stripComments(cssText); | ||
| var orgSelectors = []; | ||
| if (commentOriginalSelector) { | ||
| var processCommentedSelector_1 = function (rule) { | ||
| var placeholder = "/*!@___" + orgSelectors.length + "___*/"; | ||
| var comment = "/*!@" + rule.selector + "*/"; | ||
| orgSelectors.push({ placeholder: placeholder, comment: comment }); | ||
| rule.selector = placeholder + rule.selector; | ||
| return rule; | ||
| }; | ||
| cssText = processRules(cssText, function (rule) { | ||
| if (rule.selector[0] !== '@') { | ||
| return processCommentedSelector_1(rule); | ||
| } | ||
| else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') || | ||
| rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) { | ||
| rule.content = processRules(rule.content, processCommentedSelector_1); | ||
| return rule; | ||
| } | ||
| return rule; | ||
| }); | ||
| } | ||
| var scopedCssText = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId); | ||
| cssText = __spreadArrays([scopedCssText], commentsWithHash).join('\n'); | ||
| if (commentOriginalSelector) { | ||
| orgSelectors.forEach(function (_a) { | ||
| var placeholder = _a.placeholder, comment = _a.comment; | ||
| cssText = cssText.replace(placeholder, comment); | ||
| }); | ||
| } | ||
| return cssText; | ||
| }; | ||
| export { scopeCss }; |
| const NAMESPACE = 'msf-editor'; | ||
| let queueCongestion = 0; | ||
| let queuePending = false; | ||
| let scopeId; | ||
| let hostTagName; | ||
| let isSvgMode = false; | ||
| const win = typeof window !== 'undefined' ? window : {}; | ||
| const doc = win.document || { head: {} }; | ||
| const plt = { | ||
| $flags$: 0, | ||
| $resourcesUrl$: '', | ||
| jmp: (h) => h(), | ||
| raf: (h) => requestAnimationFrame(h), | ||
| ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts), | ||
| rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts), | ||
| }; | ||
| const supportsShadowDom = /*@__PURE__*/ (() => (doc.head.attachShadow + '').includes('[native'))() ; | ||
| const supportsListenerOptions = /*@__PURE__*/ (() => { | ||
| let supportsListenerOptions = false; | ||
| try { | ||
| doc.addEventListener('e', null, Object.defineProperty({}, 'passive', { | ||
| get() { supportsListenerOptions = true; } | ||
| })); | ||
| } | ||
| catch (e) { } | ||
| return supportsListenerOptions; | ||
| })(); | ||
| const supportsConstructibleStylesheets = /*@__PURE__*/ (() => { | ||
| try { | ||
| new CSSStyleSheet(); | ||
| return true; | ||
| } | ||
| catch (e) { } | ||
| return false; | ||
| })() ; | ||
| const hostRefs = new WeakMap(); | ||
| const getHostRef = (ref) => hostRefs.get(ref); | ||
| const registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef); | ||
| const registerHost = (elm) => { | ||
| const hostRef = { | ||
| $flags$: 0, | ||
| $hostElement$: elm, | ||
| $instanceValues$: new Map() | ||
| }; | ||
| { | ||
| hostRef.$onInstancePromise$ = new Promise(r => hostRef.$onInstanceResolve$ = r); | ||
| } | ||
| { | ||
| hostRef.$onReadyPromise$ = new Promise(r => hostRef.$onReadyResolve$ = r); | ||
| elm['s-p'] = []; | ||
| elm['s-rc'] = []; | ||
| } | ||
| return hostRefs.set(elm, hostRef); | ||
| }; | ||
| const isMemberInElement = (elm, memberName) => memberName in elm; | ||
| const consoleError = (e) => console.error(e); | ||
| const moduleCache = /*@__PURE__*/ new Map(); | ||
| const loadModule = (cmpMeta, hostRef, hmrVersionId) => { | ||
| // loadModuleImport | ||
| const exportName = cmpMeta.$tagName$.replace(/-/g, '_'); | ||
| const bundleId = ( cmpMeta.$lazyBundleIds$); | ||
| const module = moduleCache.get(bundleId) ; | ||
| if (module) { | ||
| return module[exportName]; | ||
| } | ||
| return import( | ||
| /* webpackInclude: /\.entry\.js$/ */ | ||
| /* webpackExclude: /\.system\.entry\.js$/ */ | ||
| /* webpackMode: "lazy" */ | ||
| `./${bundleId}.entry.js${ ''}`).then(importedModule => { | ||
| { | ||
| moduleCache.set(bundleId, importedModule); | ||
| } | ||
| return importedModule[exportName]; | ||
| }, consoleError); | ||
| }; | ||
| const styles = new Map(); | ||
| const queueDomReads = []; | ||
| const queueDomWrites = []; | ||
| const queueDomWritesLow = []; | ||
| const queueTask = (queue, write) => (cb) => { | ||
| queue.push(cb); | ||
| if (!queuePending) { | ||
| queuePending = true; | ||
| if (write && plt.$flags$ & 4 /* queueSync */) { | ||
| nextTick(flush); | ||
| } | ||
| else { | ||
| plt.raf(flush); | ||
| } | ||
| } | ||
| }; | ||
| const consume = (queue) => { | ||
| for (let i = 0; i < queue.length; i++) { | ||
| try { | ||
| queue[i](performance.now()); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| queue.length = 0; | ||
| }; | ||
| const consumeTimeout = (queue, timeout) => { | ||
| let i = 0; | ||
| let ts = 0; | ||
| while (i < queue.length && (ts = performance.now()) < timeout) { | ||
| try { | ||
| queue[i++](ts); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| if (i === queue.length) { | ||
| queue.length = 0; | ||
| } | ||
| else if (i !== 0) { | ||
| queue.splice(0, i); | ||
| } | ||
| }; | ||
| const flush = () => { | ||
| queueCongestion++; | ||
| // always force a bunch of medium callbacks to run, but still have | ||
| // a throttle on how many can run in a certain time | ||
| // DOM READS!!! | ||
| consume(queueDomReads); | ||
| const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */ | ||
| ? performance.now() + (10 * Math.ceil(queueCongestion * (1.0 / 22.0))) | ||
| : Infinity; | ||
| // DOM WRITES!!! | ||
| consumeTimeout(queueDomWrites, timeout); | ||
| consumeTimeout(queueDomWritesLow, timeout); | ||
| if (queueDomWrites.length > 0) { | ||
| queueDomWritesLow.push(...queueDomWrites); | ||
| queueDomWrites.length = 0; | ||
| } | ||
| if (queuePending = ((queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length) > 0)) { | ||
| // still more to do yet, but we've run out of time | ||
| // let's let this thing cool off and try again in the next tick | ||
| plt.raf(flush); | ||
| } | ||
| else { | ||
| queueCongestion = 0; | ||
| } | ||
| }; | ||
| const nextTick = /*@__PURE__*/ (cb) => Promise.resolve().then(cb); | ||
| const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true); | ||
| /** | ||
| * Default style mode id | ||
| */ | ||
| /** | ||
| * Reusable empty obj/array | ||
| * Don't add values to these!! | ||
| */ | ||
| const EMPTY_OBJ = {}; | ||
| const isDef = (v) => v != null; | ||
| const isComplexType = (o) => { | ||
| // https://jsperf.com/typeof-fn-object/5 | ||
| o = typeof o; | ||
| return o === 'object' || o === 'function'; | ||
| }; | ||
| const getDynamicImportFunction = (namespace) => { | ||
| return `__sc_import_${namespace.replace(/\s|-/g, '_')}`; | ||
| }; | ||
| const patchEsm = () => { | ||
| // @ts-ignore | ||
| if ( !(win.CSS && win.CSS.supports && win.CSS.supports('color', 'var(--c)'))) { | ||
| // @ts-ignore | ||
| return import('./css-shim-6aaf713d-9b13816a.js').then(() => { | ||
| plt.$cssShim$ = win.__stencil_cssshim; | ||
| if (plt.$cssShim$) { | ||
| return plt.$cssShim$.initShim(); | ||
| } | ||
| }); | ||
| } | ||
| return Promise.resolve(); | ||
| }; | ||
| const patchBrowser = () => { | ||
| { | ||
| // shim css vars | ||
| plt.$cssShim$ = win.__stencil_cssshim; | ||
| } | ||
| // @ts-ignore | ||
| const scriptElm = Array.from(doc.querySelectorAll('script')).find(s => (new RegExp(`\/${NAMESPACE}(\\.esm)?\\.js($|\\?|#)`).test(s.src) || | ||
| s.getAttribute('data-stencil-namespace') === NAMESPACE)); | ||
| const opts = scriptElm['data-opts'] || {}; | ||
| const importMeta = ""; | ||
| if ('onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) { | ||
| // Safari < v11 support: This IF is true if it's Safari below v11. | ||
| // This fn cannot use async/await since Safari didn't support it until v11, | ||
| // however, Safari 10 did support modules. Safari 10 also didn't support "nomodule", | ||
| // so both the ESM file and nomodule file would get downloaded. Only Safari | ||
| // has 'onbeforeload' in the script, and "history.scrollRestoration" was added | ||
| // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue. | ||
| // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds. | ||
| return { then() { } }; | ||
| } | ||
| if (importMeta !== '') { | ||
| opts.resourcesUrl = new URL('.', importMeta).href; | ||
| } | ||
| else { | ||
| opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href; | ||
| patchDynamicImport(opts.resourcesUrl, scriptElm); | ||
| if (!window.customElements) { | ||
| // module support, but no custom elements support (Old Edge) | ||
| // @ts-ignore | ||
| return import('./dom-76cc7c7d-0a082895.js').then(() => opts); | ||
| } | ||
| } | ||
| return Promise.resolve(opts); | ||
| }; | ||
| const patchDynamicImport = (base, orgScriptElm) => { | ||
| const importFunctionName = getDynamicImportFunction(NAMESPACE); | ||
| try { | ||
| // test if this browser supports dynamic imports | ||
| // There is a caching issue in V8, that breaks using import() in Function | ||
| // By generating a random string, we can workaround it | ||
| // Check https://bugs.chromium.org/p/v8/issues/detail?id=9558 for more info | ||
| win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`); | ||
| } | ||
| catch (e) { | ||
| // this shim is specifically for browsers that do support "esm" imports | ||
| // however, they do NOT support "dynamic" imports | ||
| // basically this code is for old Edge, v18 and below | ||
| const moduleMap = new Map(); | ||
| win[importFunctionName] = (src) => { | ||
| const url = new URL(src, base).href; | ||
| let mod = moduleMap.get(url); | ||
| if (!mod) { | ||
| const script = doc.createElement('script'); | ||
| script.type = 'module'; | ||
| script.crossOrigin = orgScriptElm.crossOrigin; | ||
| script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], { type: 'application/javascript' })); | ||
| mod = new Promise(resolve => { | ||
| script.onload = () => { | ||
| resolve(win[importFunctionName].m); | ||
| script.remove(); | ||
| }; | ||
| }); | ||
| moduleMap.set(url, mod); | ||
| doc.head.appendChild(script); | ||
| } | ||
| return mod; | ||
| }; | ||
| } | ||
| }; | ||
| const parsePropertyValue = (propValue, propType) => { | ||
| // ensure this value is of the correct prop type | ||
| if (propValue != null && !isComplexType(propValue)) { | ||
| if ( propType & 1 /* String */) { | ||
| // could have been passed as a number or boolean | ||
| // but we still want it as a string | ||
| return String(propValue); | ||
| } | ||
| // redundant return here for better minification | ||
| return propValue; | ||
| } | ||
| // not sure exactly what type we want | ||
| // so no need to change to a different type | ||
| return propValue; | ||
| }; | ||
| const HYDRATED_CLASS = 'hydrated'; | ||
| const createTime = (fnName, tagName = '') => { | ||
| { | ||
| return () => { return; }; | ||
| } | ||
| }; | ||
| const uniqueTime = (key, measureText) => { | ||
| { | ||
| return () => { return; }; | ||
| } | ||
| }; | ||
| const rootAppliedStyles = new WeakMap(); | ||
| const registerStyle = (scopeId, cssText, allowCS) => { | ||
| let style = styles.get(scopeId); | ||
| if (supportsConstructibleStylesheets && allowCS) { | ||
| style = (style || new CSSStyleSheet()); | ||
| style.replace(cssText); | ||
| } | ||
| else { | ||
| style = cssText; | ||
| } | ||
| styles.set(scopeId, style); | ||
| }; | ||
| const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => { | ||
| let scopeId = getScopeId(cmpMeta.$tagName$); | ||
| let style = styles.get(scopeId); | ||
| // if an element is NOT connected then getRootNode() will return the wrong root node | ||
| // so the fallback is to always use the document for the root node in those cases | ||
| styleContainerNode = (styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc); | ||
| if (style) { | ||
| if (typeof style === 'string') { | ||
| styleContainerNode = styleContainerNode.head || styleContainerNode; | ||
| let appliedStyles = rootAppliedStyles.get(styleContainerNode); | ||
| let styleElm; | ||
| if (!appliedStyles) { | ||
| rootAppliedStyles.set(styleContainerNode, appliedStyles = new Set()); | ||
| } | ||
| if (!appliedStyles.has(scopeId)) { | ||
| { | ||
| if ( plt.$cssShim$) { | ||
| styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style, !!(cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */)); | ||
| const newScopeId = styleElm['s-sc']; | ||
| if (newScopeId) { | ||
| scopeId = newScopeId; | ||
| // we don't want to add this styleID to the appliedStyles Set | ||
| // since the cssVarShim might need to apply several different | ||
| // stylesheets for the same component | ||
| appliedStyles = null; | ||
| } | ||
| } | ||
| else { | ||
| styleElm = doc.createElement('style'); | ||
| styleElm.innerHTML = style; | ||
| } | ||
| styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link')); | ||
| } | ||
| if (appliedStyles) { | ||
| appliedStyles.add(scopeId); | ||
| } | ||
| } | ||
| } | ||
| else if ( !styleContainerNode.adoptedStyleSheets.includes(style)) { | ||
| styleContainerNode.adoptedStyleSheets = [ | ||
| ...styleContainerNode.adoptedStyleSheets, | ||
| style | ||
| ]; | ||
| } | ||
| } | ||
| return scopeId; | ||
| }; | ||
| const attachStyles = (elm, cmpMeta, mode) => { | ||
| const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$); | ||
| const scopeId = addStyle(( supportsShadowDom && elm.shadowRoot) | ||
| ? elm.shadowRoot | ||
| : elm.getRootNode(), cmpMeta, mode, elm); | ||
| if ( cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */) { | ||
| // only required when we're NOT using native shadow dom (slot) | ||
| // or this browser doesn't support native shadow dom | ||
| // and this host element was NOT created with SSR | ||
| // let's pick out the inner content for slot projection | ||
| // create a node to represent where the original | ||
| // content was first placed, which is useful later on | ||
| // DOM WRITE!! | ||
| elm['s-sc'] = scopeId; | ||
| elm.classList.add(scopeId + '-h'); | ||
| } | ||
| endAttachStyles(); | ||
| }; | ||
| const getScopeId = (tagName, mode) => 'sc-' + ( tagName); | ||
| /** | ||
| * Production h() function based on Preact by | ||
| * Jason Miller (@developit) | ||
| * Licensed under the MIT License | ||
| * https://github.com/developit/preact/blob/master/LICENSE | ||
| * | ||
| * Modified for Stencil's compiler and vdom | ||
| */ | ||
| // const stack: any[] = []; | ||
| // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode; | ||
| // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode; | ||
| const h = (nodeName, vnodeData, ...children) => { | ||
| let child = null; | ||
| let simple = false; | ||
| let lastSimple = false; | ||
| let vNodeChildren = []; | ||
| const walk = (c) => { | ||
| for (let i = 0; i < c.length; i++) { | ||
| child = c[i]; | ||
| if (Array.isArray(child)) { | ||
| walk(child); | ||
| } | ||
| else if (child != null && typeof child !== 'boolean') { | ||
| if (simple = typeof nodeName !== 'function' && !isComplexType(child)) { | ||
| child = String(child); | ||
| } | ||
| if (simple && lastSimple) { | ||
| // If the previous child was simple (string), we merge both | ||
| vNodeChildren[vNodeChildren.length - 1].$text$ += child; | ||
| } | ||
| else { | ||
| // Append a new vNode, if it's text, we create a text vNode | ||
| vNodeChildren.push(simple ? newVNode(null, child) : child); | ||
| } | ||
| lastSimple = simple; | ||
| } | ||
| } | ||
| }; | ||
| walk(children); | ||
| if (vnodeData) { | ||
| { | ||
| const classData = vnodeData.className || vnodeData.class; | ||
| if (classData) { | ||
| vnodeData.class = typeof classData !== 'object' | ||
| ? classData | ||
| : Object.keys(classData) | ||
| .filter(k => classData[k]) | ||
| .join(' '); | ||
| } | ||
| } | ||
| } | ||
| const vnode = newVNode(nodeName, null); | ||
| vnode.$attrs$ = vnodeData; | ||
| if (vNodeChildren.length > 0) { | ||
| vnode.$children$ = vNodeChildren; | ||
| } | ||
| return vnode; | ||
| }; | ||
| const newVNode = (tag, text) => { | ||
| const vnode = { | ||
| $flags$: 0, | ||
| $tag$: tag, | ||
| $text$: text, | ||
| $elm$: null, | ||
| $children$: null | ||
| }; | ||
| { | ||
| vnode.$attrs$ = null; | ||
| } | ||
| return vnode; | ||
| }; | ||
| const Host = {}; | ||
| const isHost = (node) => node && node.$tag$ === Host; | ||
| /** | ||
| * Production setAccessor() function based on Preact by | ||
| * Jason Miller (@developit) | ||
| * Licensed under the MIT License | ||
| * https://github.com/developit/preact/blob/master/LICENSE | ||
| * | ||
| * Modified for Stencil's compiler and vdom | ||
| */ | ||
| const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => { | ||
| if (oldValue === newValue) { | ||
| return; | ||
| } | ||
| let isProp = isMemberInElement(elm, memberName); | ||
| let ln = memberName.toLowerCase(); | ||
| if ( memberName === 'class') { | ||
| const classList = elm.classList; | ||
| const oldClasses = parseClassList(oldValue); | ||
| const newClasses = parseClassList(newValue); | ||
| classList.remove(...oldClasses.filter(c => c && !newClasses.includes(c))); | ||
| classList.add(...newClasses.filter(c => c && !oldClasses.includes(c))); | ||
| } | ||
| else { | ||
| // Set property if it exists and it's not a SVG | ||
| const isComplex = isComplexType(newValue); | ||
| if ((isProp || (isComplex && newValue !== null)) && !isSvg) { | ||
| try { | ||
| if (!elm.tagName.includes('-')) { | ||
| let n = newValue == null ? '' : newValue; | ||
| // Workaround for Safari, moving the <input> caret when re-assigning the same valued | ||
| if (memberName === 'list') { | ||
| isProp = false; | ||
| // tslint:disable-next-line: triple-equals | ||
| } | ||
| else if (oldValue == null || elm[memberName] != n) { | ||
| elm[memberName] = n; | ||
| } | ||
| } | ||
| else { | ||
| elm[memberName] = newValue; | ||
| } | ||
| } | ||
| catch (e) { } | ||
| } | ||
| if (newValue == null || newValue === false) { | ||
| { | ||
| elm.removeAttribute(memberName); | ||
| } | ||
| } | ||
| else if ((!isProp || (flags & 4 /* isHost */) || isSvg) && !isComplex) { | ||
| newValue = newValue === true ? '' : newValue; | ||
| { | ||
| elm.setAttribute(memberName, newValue); | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| const parseClassListRegex = /\s/; | ||
| const parseClassList = (value) => (!value) ? [] : value.split(parseClassListRegex); | ||
| const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => { | ||
| // if the element passed in is a shadow root, which is a document fragment | ||
| // then we want to be adding attrs/props to the shadow root's "host" element | ||
| // if it's not a shadow root, then we add attrs/props to the same element | ||
| const elm = (newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host) ? newVnode.$elm$.host : newVnode.$elm$; | ||
| const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ; | ||
| const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ; | ||
| { | ||
| // remove attributes no longer present on the vnode by setting them to undefined | ||
| for (memberName in oldVnodeAttrs) { | ||
| if (!(memberName in newVnodeAttrs)) { | ||
| setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$); | ||
| } | ||
| } | ||
| } | ||
| // add new & update changed attributes | ||
| for (memberName in newVnodeAttrs) { | ||
| setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$); | ||
| } | ||
| }; | ||
| const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => { | ||
| // tslint:disable-next-line: prefer-const | ||
| let newVNode = newParentVNode.$children$[childIndex]; | ||
| let i = 0; | ||
| let elm; | ||
| let childNode; | ||
| { | ||
| // create element | ||
| elm = newVNode.$elm$ = ( doc.createElement( newVNode.$tag$)); | ||
| // add css classes, attrs, props, listeners, etc. | ||
| { | ||
| updateElement(null, newVNode, isSvgMode); | ||
| } | ||
| if ( isDef(scopeId) && elm['s-si'] !== scopeId) { | ||
| // if there is a scopeId and this is the initial render | ||
| // then let's add the scopeId as a css class | ||
| elm.classList.add((elm['s-si'] = scopeId)); | ||
| } | ||
| if (newVNode.$children$) { | ||
| for (i = 0; i < newVNode.$children$.length; ++i) { | ||
| // create the node | ||
| childNode = createElm(oldParentVNode, newVNode, i); | ||
| // return node could have been null | ||
| if (childNode) { | ||
| // append our new node | ||
| elm.appendChild(childNode); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| return elm; | ||
| }; | ||
| const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => { | ||
| let containerElm = ( parentElm); | ||
| let childNode; | ||
| if ( containerElm.shadowRoot && containerElm.tagName === hostTagName) { | ||
| containerElm = containerElm.shadowRoot; | ||
| } | ||
| for (; startIdx <= endIdx; ++startIdx) { | ||
| if (vnodes[startIdx]) { | ||
| childNode = createElm(null, parentVNode, startIdx); | ||
| if (childNode) { | ||
| vnodes[startIdx].$elm$ = childNode; | ||
| containerElm.insertBefore(childNode, before); | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => { | ||
| for (; startIdx <= endIdx; ++startIdx) { | ||
| if (vnode = vnodes[startIdx]) { | ||
| elm = vnode.$elm$; | ||
| // remove the vnode's element from the dom | ||
| elm.remove(); | ||
| } | ||
| } | ||
| }; | ||
| const updateChildren = (parentElm, oldCh, newVNode, newCh) => { | ||
| let oldStartIdx = 0; | ||
| let newStartIdx = 0; | ||
| let oldEndIdx = oldCh.length - 1; | ||
| let oldStartVnode = oldCh[0]; | ||
| let oldEndVnode = oldCh[oldEndIdx]; | ||
| let newEndIdx = newCh.length - 1; | ||
| let newStartVnode = newCh[0]; | ||
| let newEndVnode = newCh[newEndIdx]; | ||
| let node; | ||
| while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { | ||
| if (oldStartVnode == null) { | ||
| // Vnode might have been moved left | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| } | ||
| else if (oldEndVnode == null) { | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| } | ||
| else if (newStartVnode == null) { | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else if (newEndVnode == null) { | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldStartVnode, newStartVnode)) { | ||
| patch(oldStartVnode, newStartVnode); | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else if (isSameVnode(oldEndVnode, newEndVnode)) { | ||
| patch(oldEndVnode, newEndVnode); | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldStartVnode, newEndVnode)) { | ||
| patch(oldStartVnode, newEndVnode); | ||
| parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling); | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldEndVnode, newStartVnode)) { | ||
| patch(oldEndVnode, newStartVnode); | ||
| parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$); | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else { | ||
| { | ||
| // new element | ||
| node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx); | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| if (node) { | ||
| { | ||
| oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| if (oldStartIdx > oldEndIdx) { | ||
| addVnodes(parentElm, (newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$), newVNode, newCh, newStartIdx, newEndIdx); | ||
| } | ||
| else if ( newStartIdx > newEndIdx) { | ||
| removeVnodes(oldCh, oldStartIdx, oldEndIdx); | ||
| } | ||
| }; | ||
| const isSameVnode = (vnode1, vnode2) => { | ||
| // compare if two vnode to see if they're "technically" the same | ||
| // need to have the same element tag, and same key to be the same | ||
| if (vnode1.$tag$ === vnode2.$tag$) { | ||
| return true; | ||
| } | ||
| return false; | ||
| }; | ||
| const patch = (oldVNode, newVNode) => { | ||
| const elm = newVNode.$elm$ = oldVNode.$elm$; | ||
| const oldChildren = oldVNode.$children$; | ||
| const newChildren = newVNode.$children$; | ||
| { | ||
| // element node | ||
| { | ||
| { | ||
| // either this is the first render of an element OR it's an update | ||
| // AND we already know it's possible it could have changed | ||
| // this updates the element's css classes, attrs, props, listeners, etc. | ||
| updateElement(oldVNode, newVNode, isSvgMode); | ||
| } | ||
| } | ||
| if ( oldChildren !== null && newChildren !== null) { | ||
| // looks like there's child vnodes for both the old and new vnodes | ||
| updateChildren(elm, oldChildren, newVNode, newChildren); | ||
| } | ||
| else if (newChildren !== null) { | ||
| // add the new vnode children | ||
| addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1); | ||
| } | ||
| else if ( oldChildren !== null) { | ||
| // no new child vnodes, but there are old child vnodes to remove | ||
| removeVnodes(oldChildren, 0, oldChildren.length - 1); | ||
| } | ||
| } | ||
| }; | ||
| const renderVdom = (hostElm, hostRef, cmpMeta, renderFnResults) => { | ||
| hostTagName = hostElm.tagName; | ||
| const oldVNode = hostRef.$vnode$ || newVNode(null, null); | ||
| const rootVnode = isHost(renderFnResults) | ||
| ? renderFnResults | ||
| : h(null, null, renderFnResults); | ||
| rootVnode.$tag$ = null; | ||
| rootVnode.$flags$ |= 4 /* isHost */; | ||
| hostRef.$vnode$ = rootVnode; | ||
| rootVnode.$elm$ = oldVNode.$elm$ = ( hostElm.shadowRoot || hostElm ); | ||
| { | ||
| scopeId = hostElm['s-sc']; | ||
| } | ||
| // synchronous patch | ||
| patch(oldVNode, rootVnode); | ||
| }; | ||
| const attachToAncestor = (hostRef, ancestorComponent) => { | ||
| if ( ancestorComponent && !hostRef.$onRenderResolve$) { | ||
| ancestorComponent['s-p'].push(new Promise(r => hostRef.$onRenderResolve$ = r)); | ||
| } | ||
| }; | ||
| const scheduleUpdate = (elm, hostRef, cmpMeta, isInitialLoad) => { | ||
| { | ||
| hostRef.$flags$ |= 16 /* isQueuedForUpdate */; | ||
| } | ||
| if ( hostRef.$flags$ & 4 /* isWaitingForChildren */) { | ||
| hostRef.$flags$ |= 512 /* needsRerender */; | ||
| return; | ||
| } | ||
| const endSchedule = createTime('scheduleUpdate', cmpMeta.$tagName$); | ||
| const ancestorComponent = hostRef.$ancestorComponent$; | ||
| const instance = hostRef.$lazyInstance$ ; | ||
| const update = () => updateComponent(elm, hostRef, cmpMeta, instance, isInitialLoad); | ||
| attachToAncestor(hostRef, ancestorComponent); | ||
| let promise; | ||
| if (isInitialLoad) { | ||
| { | ||
| hostRef.$flags$ |= 256 /* isListenReady */; | ||
| if (hostRef.$queuedListeners$) { | ||
| hostRef.$queuedListeners$.forEach(([methodName, event]) => safeCall(instance, methodName, event)); | ||
| hostRef.$queuedListeners$ = null; | ||
| } | ||
| } | ||
| { | ||
| promise = safeCall(instance, 'componentWillLoad'); | ||
| } | ||
| } | ||
| { | ||
| promise = then(promise, () => safeCall(instance, 'componentWillRender')); | ||
| } | ||
| endSchedule(); | ||
| // there is no ancestorc omponent or the ancestor component | ||
| // has already fired off its lifecycle update then | ||
| // fire off the initial update | ||
| return then(promise, () => writeTask(update) | ||
| ); | ||
| }; | ||
| const updateComponent = (elm, hostRef, cmpMeta, instance, isInitialLoad) => { | ||
| // updateComponent | ||
| const endUpdate = createTime('update', cmpMeta.$tagName$); | ||
| const rc = elm['s-rc']; | ||
| if ( isInitialLoad) { | ||
| // DOM WRITE! | ||
| attachStyles(elm, cmpMeta, hostRef.$modeName$); | ||
| } | ||
| const endRender = createTime('render', cmpMeta.$tagName$); | ||
| { | ||
| { | ||
| // looks like we've got child nodes to render into this host element | ||
| // or we need to update the css class/attrs on the host element | ||
| // DOM WRITE! | ||
| renderVdom(elm, hostRef, cmpMeta, callRender(instance)); | ||
| } | ||
| } | ||
| if ( plt.$cssShim$) { | ||
| plt.$cssShim$.updateHost(elm); | ||
| } | ||
| { | ||
| hostRef.$flags$ &= ~16 /* isQueuedForUpdate */; | ||
| } | ||
| { | ||
| hostRef.$flags$ |= 2 /* hasRendered */; | ||
| } | ||
| if ( rc) { | ||
| // ok, so turns out there are some child host elements | ||
| // waiting on this parent element to load | ||
| // let's fire off all update callbacks waiting | ||
| rc.forEach(cb => cb()); | ||
| elm['s-rc'] = undefined; | ||
| } | ||
| endRender(); | ||
| endUpdate(); | ||
| { | ||
| const childrenPromises = elm['s-p']; | ||
| const postUpdate = () => postUpdateComponent(elm, hostRef, cmpMeta); | ||
| if (childrenPromises.length === 0) { | ||
| postUpdate(); | ||
| } | ||
| else { | ||
| Promise.all(childrenPromises).then(postUpdate); | ||
| hostRef.$flags$ |= 4 /* isWaitingForChildren */; | ||
| childrenPromises.length = 0; | ||
| } | ||
| } | ||
| }; | ||
| const callRender = (instance, elm) => { | ||
| try { | ||
| instance = instance.render() ; | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| return instance; | ||
| }; | ||
| const postUpdateComponent = (elm, hostRef, cmpMeta) => { | ||
| const endPostUpdate = createTime('postUpdate', cmpMeta.$tagName$); | ||
| const ancestorComponent = hostRef.$ancestorComponent$; | ||
| if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) { | ||
| hostRef.$flags$ |= 64 /* hasLoadedComponent */; | ||
| { | ||
| // DOM WRITE! | ||
| // add the css class that this element has officially hydrated | ||
| elm.classList.add(HYDRATED_CLASS); | ||
| } | ||
| endPostUpdate(); | ||
| { | ||
| hostRef.$onReadyResolve$(elm); | ||
| if (!ancestorComponent) { | ||
| appDidLoad(); | ||
| } | ||
| } | ||
| } | ||
| else { | ||
| endPostUpdate(); | ||
| } | ||
| { | ||
| hostRef.$onInstanceResolve$(elm); | ||
| } | ||
| // load events fire from bottom to top | ||
| // the deepest elements load first then bubbles up | ||
| { | ||
| if (hostRef.$onRenderResolve$) { | ||
| hostRef.$onRenderResolve$(); | ||
| hostRef.$onRenderResolve$ = undefined; | ||
| } | ||
| if (hostRef.$flags$ & 512 /* needsRerender */) { | ||
| nextTick(() => scheduleUpdate(elm, hostRef, cmpMeta, false)); | ||
| } | ||
| hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */); | ||
| } | ||
| // ( •_•) | ||
| // ( •_•)>⌐■-■ | ||
| // (⌐■_■) | ||
| }; | ||
| const forceUpdate = (elm, cmpMeta) => { | ||
| { | ||
| const hostRef = getHostRef(elm); | ||
| const isConnected = hostRef.$hostElement$.isConnected; | ||
| if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) { | ||
| scheduleUpdate(elm, hostRef, cmpMeta, false); | ||
| } | ||
| // Returns "true" when the forced update was successfully scheduled | ||
| return isConnected; | ||
| } | ||
| }; | ||
| const appDidLoad = (who) => { | ||
| // on appload | ||
| // we have finish the first big initial render | ||
| { | ||
| doc.documentElement.classList.add(HYDRATED_CLASS); | ||
| } | ||
| { | ||
| plt.$flags$ |= 2 /* appLoaded */; | ||
| } | ||
| }; | ||
| const safeCall = (instance, method, arg) => { | ||
| if (instance && instance[method]) { | ||
| try { | ||
| return instance[method](arg); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| return undefined; | ||
| }; | ||
| const then = (promise, thenFn) => { | ||
| return promise && promise.then ? promise.then(thenFn) : thenFn(); | ||
| }; | ||
| const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName); | ||
| const setValue = (ref, propName, newVal, cmpMeta) => { | ||
| // check our new property value against our internal value | ||
| const hostRef = getHostRef(ref); | ||
| const elm = hostRef.$hostElement$ ; | ||
| const oldVal = hostRef.$instanceValues$.get(propName); | ||
| const flags = hostRef.$flags$; | ||
| const instance = hostRef.$lazyInstance$ ; | ||
| newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]); | ||
| if (newVal !== oldVal && ( !(flags & 8 /* isConstructingInstance */) || oldVal === undefined)) { | ||
| // gadzooks! the property's value has changed!! | ||
| // set our new value! | ||
| hostRef.$instanceValues$.set(propName, newVal); | ||
| if ( instance) { | ||
| if ( (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) { | ||
| // looks like this value actually changed, so we've got work to do! | ||
| // but only if we've already rendered, otherwise just chill out | ||
| // queue that we need to do an update, but don't worry about queuing | ||
| // up millions cuz this function ensures it only runs once | ||
| scheduleUpdate(elm, hostRef, cmpMeta, false); | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| const proxyComponent = (Cstr, cmpMeta, flags) => { | ||
| if ( cmpMeta.$members$) { | ||
| // It's better to have a const than two Object.entries() | ||
| const members = Object.entries(cmpMeta.$members$); | ||
| const prototype = Cstr.prototype; | ||
| members.forEach(([memberName, [memberFlags]]) => { | ||
| if ( ((memberFlags & 31 /* Prop */) || | ||
| (( flags & 2 /* proxyState */) && | ||
| (memberFlags & 32 /* State */)))) { | ||
| // proxyComponent - prop | ||
| Object.defineProperty(prototype, memberName, { | ||
| get() { | ||
| // proxyComponent, get value | ||
| return getValue(this, memberName); | ||
| }, | ||
| set(newValue) { | ||
| // proxyComponent, set value | ||
| setValue(this, memberName, newValue, cmpMeta); | ||
| }, | ||
| configurable: true, | ||
| enumerable: true | ||
| }); | ||
| } | ||
| else if ( (flags & 1 /* isElementConstructor */) && (memberFlags & 64 /* Method */)) { | ||
| // proxyComponent - method | ||
| Object.defineProperty(prototype, memberName, { | ||
| value(...args) { | ||
| const ref = getHostRef(this); | ||
| return ref.$onInstancePromise$.then(() => ref.$lazyInstance$[memberName](...args)); | ||
| } | ||
| }); | ||
| } | ||
| }); | ||
| if ( ( flags & 1 /* isElementConstructor */)) { | ||
| const attrNameToPropName = new Map(); | ||
| prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) { | ||
| plt.jmp(() => { | ||
| const propName = attrNameToPropName.get(attrName); | ||
| this[propName] = newValue === null && typeof this[propName] === 'boolean' | ||
| ? false | ||
| : newValue; | ||
| }); | ||
| }; | ||
| // create an array of attributes to observe | ||
| // and also create a map of html attribute name to js property name | ||
| Cstr.observedAttributes = members | ||
| .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes | ||
| .map(([propName, m]) => { | ||
| const attrName = m[1] || propName; | ||
| attrNameToPropName.set(attrName, propName); | ||
| return attrName; | ||
| }); | ||
| } | ||
| } | ||
| return Cstr; | ||
| }; | ||
| const addEventListeners = (elm, hostRef, listeners) => { | ||
| hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []; | ||
| const removeFns = listeners.map(([flags, name, method]) => { | ||
| const target = ( getHostListenerTarget(elm, flags) ); | ||
| const handler = hostListenerProxy(hostRef, method); | ||
| const opts = hostListenerOpts(flags); | ||
| plt.ael(target, name, handler, opts); | ||
| return () => plt.rel(target, name, handler, opts); | ||
| }); | ||
| return () => removeFns.forEach(fn => fn()); | ||
| }; | ||
| const hostListenerProxy = (hostRef, methodName) => { | ||
| return (ev) => { | ||
| { | ||
| if (hostRef.$flags$ & 256 /* isListenReady */) { | ||
| // instance is ready, let's call it's member method for this event | ||
| hostRef.$lazyInstance$[methodName](ev); | ||
| } | ||
| else { | ||
| hostRef.$queuedListeners$.push([methodName, ev]); | ||
| } | ||
| } | ||
| }; | ||
| }; | ||
| const getHostListenerTarget = (elm, flags) => { | ||
| if ( flags & 8 /* TargetWindow */) | ||
| return win; | ||
| return elm; | ||
| }; | ||
| const hostListenerOpts = (flags) => supportsListenerOptions ? | ||
| { | ||
| 'passive': (flags & 1 /* Passive */) !== 0, | ||
| 'capture': (flags & 2 /* Capture */) !== 0, | ||
| } | ||
| : (flags & 2 /* Capture */) !== 0; | ||
| const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => { | ||
| // initializeComponent | ||
| if ( (hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) { | ||
| // we haven't initialized this element yet | ||
| hostRef.$flags$ |= 32 /* hasInitializedComponent */; | ||
| { | ||
| // lazy loaded components | ||
| // request the component's implementation to be | ||
| // wired up with the host element | ||
| Cstr = loadModule(cmpMeta); | ||
| if (Cstr.then) { | ||
| // Await creates a micro-task avoid if possible | ||
| const endLoad = uniqueTime(); | ||
| Cstr = await Cstr; | ||
| endLoad(); | ||
| } | ||
| if ( !Cstr.isProxied) { | ||
| proxyComponent(Cstr, cmpMeta, 2 /* proxyState */); | ||
| Cstr.isProxied = true; | ||
| } | ||
| const endNewInstance = createTime('createInstance', cmpMeta.$tagName$); | ||
| // ok, time to construct the instance | ||
| // but let's keep track of when we start and stop | ||
| // so that the getters/setters don't incorrectly step on data | ||
| { | ||
| hostRef.$flags$ |= 8 /* isConstructingInstance */; | ||
| } | ||
| // construct the lazy-loaded component implementation | ||
| // passing the hostRef is very important during | ||
| // construction in order to directly wire together the | ||
| // host element and the lazy-loaded instance | ||
| try { | ||
| new Cstr(hostRef); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| { | ||
| hostRef.$flags$ &= ~8 /* isConstructingInstance */; | ||
| } | ||
| endNewInstance(); | ||
| } | ||
| const scopeId = getScopeId(cmpMeta.$tagName$); | ||
| if ( !styles.has(scopeId) && Cstr.style) { | ||
| const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$); | ||
| // this component has styles but we haven't registered them yet | ||
| let style = Cstr.style; | ||
| if ( cmpMeta.$flags$ & 8 /* needsShadowDomShim */) { | ||
| style = await import('./shadow-css-4889ae62-23996f3f.js').then(m => m.scopeCss(style, scopeId, false)); | ||
| } | ||
| registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)); | ||
| endRegisterStyles(); | ||
| } | ||
| } | ||
| // we've successfully created a lazy instance | ||
| const ancestorComponent = hostRef.$ancestorComponent$; | ||
| const schedule = () => scheduleUpdate(elm, hostRef, cmpMeta, true); | ||
| if ( ancestorComponent && ancestorComponent['s-rc']) { | ||
| // this is the intial load and this component it has an ancestor component | ||
| // but the ancestor component has NOT fired its will update lifecycle yet | ||
| // so let's just cool our jets and wait for the ancestor to continue first | ||
| // this will get fired off when the ancestor component | ||
| // finally gets around to rendering its lazy self | ||
| // fire off the initial update | ||
| ancestorComponent['s-rc'].push(schedule); | ||
| } | ||
| else { | ||
| schedule(); | ||
| } | ||
| }; | ||
| const connectedCallback = (elm, cmpMeta) => { | ||
| if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) { | ||
| const endConnected = createTime('connectedCallback', cmpMeta.$tagName$); | ||
| // connectedCallback | ||
| const hostRef = getHostRef(elm); | ||
| if ( cmpMeta.$listeners$) { | ||
| // initialize our event listeners on the host element | ||
| // we do this now so that we can listening to events that may | ||
| // have fired even before the instance is ready | ||
| hostRef.$rmListeners$ = addEventListeners(elm, hostRef, cmpMeta.$listeners$); | ||
| } | ||
| if (!(hostRef.$flags$ & 1 /* hasConnected */)) { | ||
| // first time this component has connected | ||
| hostRef.$flags$ |= 1 /* hasConnected */; | ||
| { | ||
| // find the first ancestor component (if there is one) and register | ||
| // this component as one of the actively loading child components for its ancestor | ||
| let ancestorComponent = elm; | ||
| while ((ancestorComponent = (ancestorComponent.parentNode || ancestorComponent.host))) { | ||
| // climb up the ancestors looking for the first | ||
| // component that hasn't finished its lifecycle update yet | ||
| if ( | ||
| (ancestorComponent['s-p'])) { | ||
| // we found this components first ancestor component | ||
| // keep a reference to this component's ancestor component | ||
| attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent)); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| // Lazy properties | ||
| // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties | ||
| if ( cmpMeta.$members$) { | ||
| Object.entries(cmpMeta.$members$).forEach(([memberName, [memberFlags]]) => { | ||
| if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) { | ||
| const value = elm[memberName]; | ||
| delete elm[memberName]; | ||
| elm[memberName] = value; | ||
| } | ||
| }); | ||
| } | ||
| { | ||
| // connectedCallback, taskQueue, initialLoad | ||
| // angular sets attribute AFTER connectCallback | ||
| // https://github.com/angular/angular/issues/18909 | ||
| // https://github.com/angular/angular/issues/19940 | ||
| nextTick(() => initializeComponent(elm, hostRef, cmpMeta)); | ||
| } | ||
| } | ||
| endConnected(); | ||
| } | ||
| }; | ||
| const disconnectedCallback = (elm) => { | ||
| if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) { | ||
| const hostRef = getHostRef(elm); | ||
| { | ||
| if (hostRef.$rmListeners$) { | ||
| hostRef.$rmListeners$(); | ||
| hostRef.$rmListeners$ = undefined; | ||
| } | ||
| } | ||
| // clear CSS var-shim tracking | ||
| if ( plt.$cssShim$) { | ||
| plt.$cssShim$.removeHost(elm); | ||
| } | ||
| } | ||
| }; | ||
| const bootstrapLazy = (lazyBundles, options = {}) => { | ||
| const endBootstrap = createTime(); | ||
| const cmpTags = []; | ||
| const exclude = options.exclude || []; | ||
| const head = doc.head; | ||
| const customElements = win.customElements; | ||
| const y = /*@__PURE__*/ head.querySelector('meta[charset]'); | ||
| const visibilityStyle = /*@__PURE__*/ doc.createElement('style'); | ||
| const deferredConnectedCallbacks = []; | ||
| let appLoadFallback; | ||
| let isBootstrapping = true; | ||
| Object.assign(plt, options); | ||
| plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href; | ||
| if (options.syncQueue) { | ||
| plt.$flags$ |= 4 /* queueSync */; | ||
| } | ||
| lazyBundles.forEach(lazyBundle => lazyBundle[1].forEach(compactMeta => { | ||
| const cmpMeta = { | ||
| $flags$: compactMeta[0], | ||
| $tagName$: compactMeta[1], | ||
| $members$: compactMeta[2], | ||
| $listeners$: compactMeta[3], | ||
| }; | ||
| { | ||
| cmpMeta.$members$ = compactMeta[2]; | ||
| } | ||
| { | ||
| cmpMeta.$listeners$ = compactMeta[3]; | ||
| } | ||
| if ( !supportsShadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { | ||
| cmpMeta.$flags$ |= 8 /* needsShadowDomShim */; | ||
| } | ||
| const tagName = cmpMeta.$tagName$; | ||
| const HostElement = class extends HTMLElement { | ||
| // StencilLazyHost | ||
| constructor(self) { | ||
| // @ts-ignore | ||
| super(self); | ||
| self = this; | ||
| registerHost(self); | ||
| if ( cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { | ||
| // this component is using shadow dom | ||
| // and this browser supports shadow dom | ||
| // add the read-only property "shadowRoot" to the host element | ||
| // adding the shadow root build conditionals to minimize runtime | ||
| if (supportsShadowDom) { | ||
| { | ||
| self.attachShadow({ mode: 'open' }); | ||
| } | ||
| } | ||
| else if ( !('shadowRoot' in self)) { | ||
| self.shadowRoot = self; | ||
| } | ||
| } | ||
| } | ||
| connectedCallback() { | ||
| if (appLoadFallback) { | ||
| clearTimeout(appLoadFallback); | ||
| appLoadFallback = null; | ||
| } | ||
| if (isBootstrapping) { | ||
| // connectedCallback will be processed once all components have been registered | ||
| deferredConnectedCallbacks.push(this); | ||
| } | ||
| else { | ||
| plt.jmp(() => connectedCallback(this, cmpMeta)); | ||
| } | ||
| } | ||
| disconnectedCallback() { | ||
| plt.jmp(() => disconnectedCallback(this)); | ||
| } | ||
| forceUpdate() { | ||
| forceUpdate(this, cmpMeta); | ||
| } | ||
| componentOnReady() { | ||
| return getHostRef(this).$onReadyPromise$; | ||
| } | ||
| }; | ||
| cmpMeta.$lazyBundleIds$ = lazyBundle[0]; | ||
| if (!exclude.includes(tagName) && !customElements.get(tagName)) { | ||
| cmpTags.push(tagName); | ||
| customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */)); | ||
| } | ||
| })); | ||
| // visibilityStyle.innerHTML = cmpTags.map(t => `${t}:not(.hydrated)`) + '{display:none}'; | ||
| visibilityStyle.innerHTML = cmpTags + '{visibility:hidden}.hydrated{visibility:inherit}'; | ||
| visibilityStyle.setAttribute('data-styles', ''); | ||
| head.insertBefore(visibilityStyle, y ? y.nextSibling : head.firstChild); | ||
| // Process deferred connectedCallbacks now all components have been registered | ||
| isBootstrapping = false; | ||
| if (deferredConnectedCallbacks.length > 0) { | ||
| deferredConnectedCallbacks.forEach(host => host.connectedCallback()); | ||
| } | ||
| else { | ||
| plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, 'timeout')); | ||
| } | ||
| // Fallback appLoad event | ||
| endBootstrap(); | ||
| }; | ||
| const createEvent = (ref, name, flags) => { | ||
| const elm = getElement(ref); | ||
| return { | ||
| emit: (detail) => { | ||
| const ev = new ( CustomEvent)(name, { | ||
| bubbles: !!(flags & 4 /* Bubbles */), | ||
| composed: !!(flags & 2 /* Composed */), | ||
| cancelable: !!(flags & 1 /* Cancellable */), | ||
| detail | ||
| }); | ||
| elm.dispatchEvent(ev); | ||
| return ev; | ||
| } | ||
| }; | ||
| }; | ||
| const getElement = (ref) => getHostRef(ref).$hostElement$ ; | ||
| export { patchEsm as a, bootstrapLazy as b, createEvent as c, getElement as g, h, patchBrowser as p, registerInstance as r }; |
| /* | ||
| Extremely simple css parser. Intended to be not more than what we need | ||
| and definitely not necessarily correct =). | ||
| */ | ||
| /** @unrestricted */ | ||
| var StyleNode = /** @class */ (function () { | ||
| function StyleNode() { | ||
| this.start = 0; | ||
| this.end = 0; | ||
| this.previous = null; | ||
| this.parent = null; | ||
| this.rules = null; | ||
| this.parsedCssText = ''; | ||
| this.cssText = ''; | ||
| this.atRule = false; | ||
| this.type = 0; | ||
| this.keyframesName = ''; | ||
| this.selector = ''; | ||
| this.parsedSelector = ''; | ||
| } | ||
| return StyleNode; | ||
| }()); | ||
| // given a string of css, return a simple rule tree | ||
| /** | ||
| * @param {string} text | ||
| * @return {StyleNode} | ||
| */ | ||
| function parse(text) { | ||
| text = clean(text); | ||
| return parseCss(lex(text), text); | ||
| } | ||
| // remove stuff we don't care about that may hinder parsing | ||
| /** | ||
| * @param {string} cssText | ||
| * @return {string} | ||
| */ | ||
| function clean(cssText) { | ||
| return cssText.replace(RX.comments, '').replace(RX.port, ''); | ||
| } | ||
| // super simple {...} lexer that returns a node tree | ||
| /** | ||
| * @param {string} text | ||
| * @return {StyleNode} | ||
| */ | ||
| function lex(text) { | ||
| var root = new StyleNode(); | ||
| root['start'] = 0; | ||
| root['end'] = text.length; | ||
| var n = root; | ||
| for (var i = 0, l = text.length; i < l; i++) { | ||
| if (text[i] === OPEN_BRACE) { | ||
| if (!n['rules']) { | ||
| n['rules'] = []; | ||
| } | ||
| var p = n; | ||
| var previous = p['rules'][p['rules'].length - 1] || null; | ||
| n = new StyleNode(); | ||
| n['start'] = i + 1; | ||
| n['parent'] = p; | ||
| n['previous'] = previous; | ||
| p['rules'].push(n); | ||
| } | ||
| else if (text[i] === CLOSE_BRACE) { | ||
| n['end'] = i + 1; | ||
| n = n['parent'] || root; | ||
| } | ||
| } | ||
| return root; | ||
| } | ||
| // add selectors/cssText to node tree | ||
| /** | ||
| * @param {StyleNode} node | ||
| * @param {string} text | ||
| * @return {StyleNode} | ||
| */ | ||
| function parseCss(node, text) { | ||
| var t = text.substring(node['start'], node['end'] - 1); | ||
| node['parsedCssText'] = node['cssText'] = t.trim(); | ||
| if (node.parent) { | ||
| var ss = node.previous ? node.previous['end'] : node.parent['start']; | ||
| t = text.substring(ss, node['start'] - 1); | ||
| t = _expandUnicodeEscapes(t); | ||
| t = t.replace(RX.multipleSpaces, ' '); | ||
| // TODO(sorvell): ad hoc; make selector include only after last ; | ||
| // helps with mixin syntax | ||
| t = t.substring(t.lastIndexOf(';') + 1); | ||
| var s = node['parsedSelector'] = node['selector'] = t.trim(); | ||
| node['atRule'] = (s.indexOf(AT_START) === 0); | ||
| // note, support a subset of rule types... | ||
| if (node['atRule']) { | ||
| if (s.indexOf(MEDIA_START) === 0) { | ||
| node['type'] = types.MEDIA_RULE; | ||
| } | ||
| else if (s.match(RX.keyframesRule)) { | ||
| node['type'] = types.KEYFRAMES_RULE; | ||
| node['keyframesName'] = node['selector'].split(RX.multipleSpaces).pop(); | ||
| } | ||
| } | ||
| else { | ||
| if (s.indexOf(VAR_START) === 0) { | ||
| node['type'] = types.MIXIN_RULE; | ||
| } | ||
| else { | ||
| node['type'] = types.STYLE_RULE; | ||
| } | ||
| } | ||
| } | ||
| var r$ = node['rules']; | ||
| if (r$) { | ||
| for (var i = 0, l = r$.length, r = void 0; (i < l) && (r = r$[i]); i++) { | ||
| parseCss(r, text); | ||
| } | ||
| } | ||
| return node; | ||
| } | ||
| /** | ||
| * conversion of sort unicode escapes with spaces like `\33 ` (and longer) into | ||
| * expanded form that doesn't require trailing space `\000033` | ||
| * @param {string} s | ||
| * @return {string} | ||
| */ | ||
| function _expandUnicodeEscapes(s) { | ||
| return s.replace(/\\([0-9a-f]{1,6})\s/gi, function () { | ||
| var code = arguments[1], repeat = 6 - code.length; | ||
| while (repeat--) { | ||
| code = '0' + code; | ||
| } | ||
| return '\\' + code; | ||
| }); | ||
| } | ||
| /** @enum {number} */ | ||
| var types = { | ||
| STYLE_RULE: 1, | ||
| KEYFRAMES_RULE: 7, | ||
| MEDIA_RULE: 4, | ||
| MIXIN_RULE: 1000 | ||
| }; | ||
| var OPEN_BRACE = '{'; | ||
| var CLOSE_BRACE = '}'; | ||
| // helper regexp's | ||
| var RX = { | ||
| comments: /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim, | ||
| port: /@import[^;]*;/gim, | ||
| customProp: /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim, | ||
| mixinProp: /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim, | ||
| mixinApply: /@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim, | ||
| varApply: /[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim, | ||
| keyframesRule: /^@[^\s]*keyframes/, | ||
| multipleSpaces: /\s+/g | ||
| }; | ||
| var VAR_START = '--'; | ||
| var MEDIA_START = '@media'; | ||
| var AT_START = '@'; | ||
| function findRegex(regex, cssText, offset) { | ||
| regex['lastIndex'] = 0; | ||
| var r = cssText.substring(offset).match(regex); | ||
| if (r) { | ||
| var start = offset + r['index']; | ||
| return { | ||
| start: start, | ||
| end: start + r[0].length | ||
| }; | ||
| } | ||
| return null; | ||
| } | ||
| var VAR_USAGE_START = /\bvar\(/; | ||
| var VAR_ASSIGN_START = /\B--[\w-]+\s*:/; | ||
| var COMMENTS = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim; | ||
| var TRAILING_LINES = /^[\t ]+\n/gm; | ||
| function resolveVar(props, prop, fallback) { | ||
| if (props[prop]) { | ||
| return props[prop]; | ||
| } | ||
| if (fallback) { | ||
| return executeTemplate(fallback, props); | ||
| } | ||
| return ''; | ||
| } | ||
| function findVarEndIndex(cssText, offset) { | ||
| var count = 0; | ||
| var i = offset; | ||
| for (; i < cssText.length; i++) { | ||
| var c = cssText[i]; | ||
| if (c === '(') { | ||
| count++; | ||
| } | ||
| else if (c === ')') { | ||
| count--; | ||
| if (count <= 0) { | ||
| return i + 1; | ||
| } | ||
| } | ||
| } | ||
| return i; | ||
| } | ||
| function parseVar(cssText, offset) { | ||
| var varPos = findRegex(VAR_USAGE_START, cssText, offset); | ||
| if (!varPos) { | ||
| return null; | ||
| } | ||
| var endVar = findVarEndIndex(cssText, varPos.start); | ||
| var varContent = cssText.substring(varPos.end, endVar - 1); | ||
| var _a = varContent.split(','), propName = _a[0], fallback = _a.slice(1); | ||
| return { | ||
| start: varPos.start, | ||
| end: endVar, | ||
| propName: propName.trim(), | ||
| fallback: fallback.length > 0 ? fallback.join(',').trim() : undefined | ||
| }; | ||
| } | ||
| function compileVar(cssText, template, offset) { | ||
| var varMeta = parseVar(cssText, offset); | ||
| if (!varMeta) { | ||
| template.push(cssText.substring(offset, cssText.length)); | ||
| return cssText.length; | ||
| } | ||
| var propName = varMeta.propName; | ||
| var fallback = varMeta.fallback != null ? compileTemplate(varMeta.fallback) : undefined; | ||
| template.push(cssText.substring(offset, varMeta.start), function (params) { return resolveVar(params, propName, fallback); }); | ||
| return varMeta.end; | ||
| } | ||
| function executeTemplate(template, props) { | ||
| var final = ''; | ||
| for (var i = 0; i < template.length; i++) { | ||
| var s = template[i]; | ||
| final += (typeof s === 'string') | ||
| ? s | ||
| : s(props); | ||
| } | ||
| return final; | ||
| } | ||
| function findEndValue(cssText, offset) { | ||
| var onStr = false; | ||
| var double = false; | ||
| var i = offset; | ||
| for (; i < cssText.length; i++) { | ||
| var c = cssText[i]; | ||
| if (onStr) { | ||
| if (double && c === '"') { | ||
| onStr = false; | ||
| } | ||
| if (!double && c === '\'') { | ||
| onStr = false; | ||
| } | ||
| } | ||
| else { | ||
| if (c === '"') { | ||
| onStr = true; | ||
| double = true; | ||
| } | ||
| else if (c === '\'') { | ||
| onStr = true; | ||
| double = false; | ||
| } | ||
| else if (c === ';') { | ||
| return i + 1; | ||
| } | ||
| else if (c === '}') { | ||
| return i; | ||
| } | ||
| } | ||
| } | ||
| return i; | ||
| } | ||
| function removeCustomAssigns(cssText) { | ||
| var final = ''; | ||
| var offset = 0; | ||
| while (true) { | ||
| var assignPos = findRegex(VAR_ASSIGN_START, cssText, offset); | ||
| var start = assignPos ? assignPos.start : cssText.length; | ||
| final += cssText.substring(offset, start); | ||
| if (assignPos) { | ||
| offset = findEndValue(cssText, start); | ||
| } | ||
| else { | ||
| break; | ||
| } | ||
| } | ||
| return final; | ||
| } | ||
| function compileTemplate(cssText) { | ||
| var index = 0; | ||
| cssText = cssText.replace(COMMENTS, ''); | ||
| cssText = removeCustomAssigns(cssText) | ||
| .replace(TRAILING_LINES, ''); | ||
| var segments = []; | ||
| while (index < cssText.length) { | ||
| index = compileVar(cssText, segments, index); | ||
| } | ||
| return segments; | ||
| } | ||
| function resolveValues(selectors) { | ||
| var props = {}; | ||
| selectors.forEach(function (selector) { | ||
| selector.declarations.forEach(function (dec) { | ||
| props[dec.prop] = dec.value; | ||
| }); | ||
| }); | ||
| var propsValues = {}; | ||
| var entries = Object.entries(props); | ||
| var _loop_1 = function (i) { | ||
| var dirty = false; | ||
| entries.forEach(function (_a) { | ||
| var key = _a[0], value = _a[1]; | ||
| var propValue = executeTemplate(value, propsValues); | ||
| if (propValue !== propsValues[key]) { | ||
| propsValues[key] = propValue; | ||
| dirty = true; | ||
| } | ||
| }); | ||
| if (!dirty) { | ||
| return "break"; | ||
| } | ||
| }; | ||
| for (var i = 0; i < 10; i++) { | ||
| var state_1 = _loop_1(); | ||
| if (state_1 === "break") | ||
| break; | ||
| } | ||
| return propsValues; | ||
| } | ||
| function getSelectors(root, index) { | ||
| if (index === void 0) { index = 0; } | ||
| if (!root.rules) { | ||
| return []; | ||
| } | ||
| var selectors = []; | ||
| root.rules | ||
| .filter(function (rule) { return rule.type === types.STYLE_RULE; }) | ||
| .forEach(function (rule) { | ||
| var declarations = getDeclarations(rule.cssText); | ||
| if (declarations.length > 0) { | ||
| rule.parsedSelector.split(',').forEach(function (selector) { | ||
| selector = selector.trim(); | ||
| selectors.push({ | ||
| selector: selector, | ||
| declarations: declarations, | ||
| specificity: computeSpecificity(), | ||
| nu: index | ||
| }); | ||
| }); | ||
| } | ||
| index++; | ||
| }); | ||
| return selectors; | ||
| } | ||
| function computeSpecificity(_selector) { | ||
| return 1; | ||
| } | ||
| var IMPORTANT = '!important'; | ||
| var FIND_DECLARATIONS = /(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm; | ||
| function getDeclarations(cssText) { | ||
| var declarations = []; | ||
| var xArray; | ||
| while (xArray = FIND_DECLARATIONS.exec(cssText.trim())) { | ||
| var _a = normalizeValue(xArray[2]), value = _a.value, important = _a.important; | ||
| declarations.push({ | ||
| prop: xArray[1].trim(), | ||
| value: compileTemplate(value), | ||
| important: important, | ||
| }); | ||
| } | ||
| return declarations; | ||
| } | ||
| function normalizeValue(value) { | ||
| var regex = /\s+/gim; | ||
| value = value.replace(regex, ' ').trim(); | ||
| var important = value.endsWith(IMPORTANT); | ||
| if (important) { | ||
| value = value.substr(0, value.length - IMPORTANT.length).trim(); | ||
| } | ||
| return { | ||
| value: value, | ||
| important: important | ||
| }; | ||
| } | ||
| function getActiveSelectors(hostEl, hostScopeMap, globalScopes) { | ||
| // computes the css scopes that might affect this particular element | ||
| // avoiding using spread arrays to avoid ts helper fns when in es5 | ||
| var scopes = []; | ||
| var scopesForElement = getScopesForElement(hostScopeMap, hostEl); | ||
| // globalScopes are always took into account | ||
| globalScopes.forEach(function (s) { return scopes.push(s); }); | ||
| // the parent scopes are computed by walking parent dom until <html> is reached | ||
| scopesForElement.forEach(function (s) { return scopes.push(s); }); | ||
| // each scope might have an array of associated selectors | ||
| // let's flatten the complete array of selectors from all the scopes | ||
| var selectorSet = getSelectorsForScopes(scopes); | ||
| // we filter to only the selectors that matches the hostEl | ||
| var activeSelectors = selectorSet.filter(function (selector) { return matches(hostEl, selector.selector); }); | ||
| // sort selectors by specifity | ||
| return sortSelectors(activeSelectors); | ||
| } | ||
| function getScopesForElement(hostTemplateMap, node) { | ||
| var scopes = []; | ||
| while (node) { | ||
| var scope = hostTemplateMap.get(node); | ||
| if (scope) { | ||
| scopes.push(scope); | ||
| } | ||
| node = node.parentElement; | ||
| } | ||
| return scopes; | ||
| } | ||
| function getSelectorsForScopes(scopes) { | ||
| var selectors = []; | ||
| scopes.forEach(function (scope) { | ||
| selectors.push.apply(selectors, scope.selectors); | ||
| }); | ||
| return selectors; | ||
| } | ||
| function sortSelectors(selectors) { | ||
| selectors.sort(function (a, b) { | ||
| if (a.specificity === b.specificity) { | ||
| return a.nu - b.nu; | ||
| } | ||
| return a.specificity - b.specificity; | ||
| }); | ||
| return selectors; | ||
| } | ||
| function matches(el, selector) { | ||
| return selector === ':root' || selector === 'html' || el.matches(selector); | ||
| } | ||
| function parseCSS(original) { | ||
| var ast = parse(original); | ||
| var template = compileTemplate(original); | ||
| var selectors = getSelectors(ast); | ||
| return { | ||
| original: original, | ||
| template: template, | ||
| selectors: selectors, | ||
| usesCssVars: template.length > 1 | ||
| }; | ||
| } | ||
| function addGlobalStyle(globalScopes, styleEl) { | ||
| if (globalScopes.some(function (css) { return css.styleEl === styleEl; })) { | ||
| return false; | ||
| } | ||
| var css = parseCSS(styleEl.textContent); | ||
| css.styleEl = styleEl; | ||
| globalScopes.push(css); | ||
| return true; | ||
| } | ||
| function updateGlobalScopes(scopes) { | ||
| var selectors = getSelectorsForScopes(scopes); | ||
| var props = resolveValues(selectors); | ||
| scopes.forEach(function (scope) { | ||
| if (scope.usesCssVars) { | ||
| scope.styleEl.textContent = executeTemplate(scope.template, props); | ||
| } | ||
| }); | ||
| } | ||
| function reScope(scope, scopeId) { | ||
| var template = scope.template.map(function (segment) { | ||
| return (typeof segment === 'string') | ||
| ? replaceScope(segment, scope.scopeId, scopeId) | ||
| : segment; | ||
| }); | ||
| var selectors = scope.selectors.map(function (sel) { | ||
| return Object.assign(Object.assign({}, sel), { selector: replaceScope(sel.selector, scope.scopeId, scopeId) }); | ||
| }); | ||
| return Object.assign(Object.assign({}, scope), { template: template, | ||
| selectors: selectors, | ||
| scopeId: scopeId }); | ||
| } | ||
| function replaceScope(original, oldScopeId, newScopeId) { | ||
| original = replaceAll(original, "\\." + oldScopeId, "." + newScopeId); | ||
| return original; | ||
| } | ||
| function replaceAll(input, find, replace) { | ||
| return input.replace(new RegExp(find, 'g'), replace); | ||
| } | ||
| function loadDocument(doc, globalScopes) { | ||
| loadDocumentStyles(doc, globalScopes); | ||
| return loadDocumentLinks(doc, globalScopes).then(function () { | ||
| updateGlobalScopes(globalScopes); | ||
| }); | ||
| } | ||
| function startWatcher(doc, globalScopes) { | ||
| var mutation = new MutationObserver(function () { | ||
| if (loadDocumentStyles(doc, globalScopes)) { | ||
| updateGlobalScopes(globalScopes); | ||
| } | ||
| }); | ||
| mutation.observe(document.head, { childList: true }); | ||
| } | ||
| function loadDocumentLinks(doc, globalScopes) { | ||
| var promises = []; | ||
| var linkElms = doc.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'); | ||
| for (var i = 0; i < linkElms.length; i++) { | ||
| promises.push(addGlobalLink(doc, globalScopes, linkElms[i])); | ||
| } | ||
| return Promise.all(promises); | ||
| } | ||
| function loadDocumentStyles(doc, globalScopes) { | ||
| var styleElms = Array.from(doc.querySelectorAll('style:not([data-styles]):not([data-no-shim])')); | ||
| return styleElms | ||
| .map(function (style) { return addGlobalStyle(globalScopes, style); }) | ||
| .some(Boolean); | ||
| } | ||
| function addGlobalLink(doc, globalScopes, linkElm) { | ||
| var url = linkElm.href; | ||
| return fetch(url).then(function (rsp) { return rsp.text(); }).then(function (text) { | ||
| if (hasCssVariables(text) && linkElm.parentNode) { | ||
| if (hasRelativeUrls(text)) { | ||
| text = fixRelativeUrls(text, url); | ||
| } | ||
| var styleEl = doc.createElement('style'); | ||
| styleEl.setAttribute('data-styles', ''); | ||
| styleEl.textContent = text; | ||
| addGlobalStyle(globalScopes, styleEl); | ||
| linkElm.parentNode.insertBefore(styleEl, linkElm); | ||
| linkElm.remove(); | ||
| } | ||
| }).catch(function (err) { | ||
| console.error(err); | ||
| }); | ||
| } | ||
| // This regexp tries to determine when a variable is declared, for example: | ||
| // | ||
| // .my-el { --highlight-color: green; } | ||
| // | ||
| // but we don't want to trigger when a classname uses "--" or a pseudo-class is | ||
| // used. We assume that the only characters that can preceed a variable | ||
| // declaration are "{", from an opening block, ";" from a preceeding rule, or a | ||
| // space. This prevents the regexp from matching a word in a selector, since | ||
| // they would need to start with a "." or "#". (We assume element names don't | ||
| // start with "--"). | ||
| var CSS_VARIABLE_REGEXP = /[\s;{]--[-a-zA-Z0-9]+\s*:/m; | ||
| function hasCssVariables(css) { | ||
| return css.indexOf('var(') > -1 || CSS_VARIABLE_REGEXP.test(css); | ||
| } | ||
| // This regexp find all url() usages with relative urls | ||
| var CSS_URL_REGEXP = /url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim; | ||
| function hasRelativeUrls(css) { | ||
| CSS_URL_REGEXP.lastIndex = 0; | ||
| return CSS_URL_REGEXP.test(css); | ||
| } | ||
| function fixRelativeUrls(css, originalUrl) { | ||
| // get the basepath from the original import url | ||
| var basePath = originalUrl.replace(/[^/]*$/, ''); | ||
| // replace the relative url, with the new relative url | ||
| return css.replace(CSS_URL_REGEXP, function (fullMatch, url) { | ||
| // rhe new relative path is the base path + uri | ||
| // TODO: normalize relative URL | ||
| var relativeUrl = basePath + url; | ||
| return fullMatch.replace(url, relativeUrl); | ||
| }); | ||
| } | ||
| var CustomStyle = /** @class */ (function () { | ||
| function CustomStyle(win, doc) { | ||
| this.win = win; | ||
| this.doc = doc; | ||
| this.count = 0; | ||
| this.hostStyleMap = new WeakMap(); | ||
| this.hostScopeMap = new WeakMap(); | ||
| this.globalScopes = []; | ||
| this.scopesMap = new Map(); | ||
| this.didInit = false; | ||
| } | ||
| CustomStyle.prototype.initShim = function () { | ||
| var _this = this; | ||
| if (this.didInit) { | ||
| return Promise.resolve(); | ||
| } | ||
| else { | ||
| this.didInit = true; | ||
| return new Promise(function (resolve) { | ||
| _this.win.requestAnimationFrame(function () { | ||
| startWatcher(_this.doc, _this.globalScopes); | ||
| loadDocument(_this.doc, _this.globalScopes).then(function () { return resolve(); }); | ||
| }); | ||
| }); | ||
| } | ||
| }; | ||
| CustomStyle.prototype.addLink = function (linkEl) { | ||
| var _this = this; | ||
| return addGlobalLink(this.doc, this.globalScopes, linkEl).then(function () { | ||
| _this.updateGlobal(); | ||
| }); | ||
| }; | ||
| CustomStyle.prototype.addGlobalStyle = function (styleEl) { | ||
| if (addGlobalStyle(this.globalScopes, styleEl)) { | ||
| this.updateGlobal(); | ||
| } | ||
| }; | ||
| CustomStyle.prototype.createHostStyle = function (hostEl, cssScopeId, cssText, isScoped) { | ||
| if (this.hostScopeMap.has(hostEl)) { | ||
| throw new Error('host style already created'); | ||
| } | ||
| var baseScope = this.registerHostTemplate(cssText, cssScopeId, isScoped); | ||
| var styleEl = this.doc.createElement('style'); | ||
| styleEl.setAttribute('data-no-shim', ''); | ||
| if (!baseScope.usesCssVars) { | ||
| // This component does not use (read) css variables | ||
| styleEl.textContent = cssText; | ||
| } | ||
| else if (isScoped) { | ||
| // This component is dynamic: uses css var and is scoped | ||
| styleEl['s-sc'] = cssScopeId = baseScope.scopeId + "-" + this.count; | ||
| styleEl.textContent = '/*needs update*/'; | ||
| this.hostStyleMap.set(hostEl, styleEl); | ||
| this.hostScopeMap.set(hostEl, reScope(baseScope, cssScopeId)); | ||
| this.count++; | ||
| } | ||
| else { | ||
| // This component uses css vars, but it's no-encapsulation (global static) | ||
| baseScope.styleEl = styleEl; | ||
| if (!baseScope.usesCssVars) { | ||
| styleEl.textContent = executeTemplate(baseScope.template, {}); | ||
| } | ||
| this.globalScopes.push(baseScope); | ||
| this.updateGlobal(); | ||
| this.hostScopeMap.set(hostEl, baseScope); | ||
| } | ||
| return styleEl; | ||
| }; | ||
| CustomStyle.prototype.removeHost = function (hostEl) { | ||
| var css = this.hostStyleMap.get(hostEl); | ||
| if (css) { | ||
| css.remove(); | ||
| } | ||
| this.hostStyleMap.delete(hostEl); | ||
| this.hostScopeMap.delete(hostEl); | ||
| }; | ||
| CustomStyle.prototype.updateHost = function (hostEl) { | ||
| var scope = this.hostScopeMap.get(hostEl); | ||
| if (scope && scope.usesCssVars && scope.isScoped) { | ||
| var styleEl = this.hostStyleMap.get(hostEl); | ||
| if (styleEl) { | ||
| var selectors = getActiveSelectors(hostEl, this.hostScopeMap, this.globalScopes); | ||
| var props = resolveValues(selectors); | ||
| styleEl.textContent = executeTemplate(scope.template, props); | ||
| } | ||
| } | ||
| }; | ||
| CustomStyle.prototype.updateGlobal = function () { | ||
| updateGlobalScopes(this.globalScopes); | ||
| }; | ||
| CustomStyle.prototype.registerHostTemplate = function (cssText, scopeId, isScoped) { | ||
| var scope = this.scopesMap.get(scopeId); | ||
| if (!scope) { | ||
| scope = parseCSS(cssText); | ||
| scope.scopeId = scopeId; | ||
| scope.isScoped = isScoped; | ||
| this.scopesMap.set(scopeId, scope); | ||
| } | ||
| return scope; | ||
| }; | ||
| return CustomStyle; | ||
| }()); | ||
| var win = window; | ||
| function needsShim() { | ||
| return !(win.CSS && win.CSS.supports && win.CSS.supports('color', 'var(--c)')); | ||
| } | ||
| if (!win.__stencil_cssshim && needsShim()) { | ||
| win.__stencil_cssshim = new CustomStyle(win, document); | ||
| } |
| (function(){ | ||
| var aa=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function g(a){var b=aa.has(a);a=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(a);return !b&&a}function l(a){var b=a.isConnected;if(void 0!==b)return b;for(;a&&!(a.__CE_isImportDocument||a instanceof Document);)a=a.parentNode||(window.ShadowRoot&&a instanceof ShadowRoot?a.host:void 0);return !(!a||!(a.__CE_isImportDocument||a instanceof Document))} | ||
| function n(a,b){for(;b&&b!==a&&!b.nextSibling;)b=b.parentNode;return b&&b!==a?b.nextSibling:null} | ||
| function p(a,b,d){d=void 0===d?new Set:d;for(var c=a;c;){if(c.nodeType===Node.ELEMENT_NODE){var e=c;b(e);var f=e.localName;if("link"===f&&"import"===e.getAttribute("rel")){c=e.import;if(c instanceof Node&&!d.has(c))for(d.add(c),c=c.firstChild;c;c=c.nextSibling)p(c,b,d);c=n(a,e);continue}else if("template"===f){c=n(a,e);continue}if(e=e.__CE_shadowRoot)for(e=e.firstChild;e;e=e.nextSibling)p(e,b,d);}c=c.firstChild?c.firstChild:n(a,c);}}function r(a,b,d){a[b]=d;}function u(){this.a=new Map;this.g=new Map;this.c=[];this.f=[];this.b=!1;}function ba(a,b,d){a.a.set(b,d);a.g.set(d.constructorFunction,d);}function ca(a,b){a.b=!0;a.c.push(b);}function da(a,b){a.b=!0;a.f.push(b);}function v(a,b){a.b&&p(b,function(b){return w(a,b)});}function w(a,b){if(a.b&&!b.__CE_patched){b.__CE_patched=!0;for(var d=0;d<a.c.length;d++)a.c[d](b);for(d=0;d<a.f.length;d++)a.f[d](b);}} | ||
| function x(a,b){var d=[];p(b,function(b){return d.push(b)});for(b=0;b<d.length;b++){var c=d[b];1===c.__CE_state?a.connectedCallback(c):y(a,c);}}function z(a,b){var d=[];p(b,function(b){return d.push(b)});for(b=0;b<d.length;b++){var c=d[b];1===c.__CE_state&&a.disconnectedCallback(c);}} | ||
| function A(a,b,d){d=void 0===d?{}:d;var c=d.u||new Set,e=d.i||function(b){return y(a,b)},f=[];p(b,function(b){if("link"===b.localName&&"import"===b.getAttribute("rel")){var d=b.import;d instanceof Node&&(d.__CE_isImportDocument=!0,d.__CE_hasRegistry=!0);d&&"complete"===d.readyState?d.__CE_documentLoadHandled=!0:b.addEventListener("load",function(){var d=b.import;if(!d.__CE_documentLoadHandled){d.__CE_documentLoadHandled=!0;var f=new Set(c);f.delete(d);A(a,d,{u:f,i:e});}});}else f.push(b);},c);if(a.b)for(b= | ||
| 0;b<f.length;b++)w(a,f[b]);for(b=0;b<f.length;b++)e(f[b]);} | ||
| function y(a,b){if(void 0===b.__CE_state){var d=b.ownerDocument;if(d.defaultView||d.__CE_isImportDocument&&d.__CE_hasRegistry)if(d=a.a.get(b.localName)){d.constructionStack.push(b);var c=d.constructorFunction;try{try{if(new c!==b)throw Error("The custom element constructor did not produce the element being upgraded.");}finally{d.constructionStack.pop();}}catch(t){throw b.__CE_state=2,t;}b.__CE_state=1;b.__CE_definition=d;if(d.attributeChangedCallback)for(d=d.observedAttributes,c=0;c<d.length;c++){var e= | ||
| d[c],f=b.getAttribute(e);null!==f&&a.attributeChangedCallback(b,e,null,f,null);}l(b)&&a.connectedCallback(b);}}}u.prototype.connectedCallback=function(a){var b=a.__CE_definition;b.connectedCallback&&b.connectedCallback.call(a);};u.prototype.disconnectedCallback=function(a){var b=a.__CE_definition;b.disconnectedCallback&&b.disconnectedCallback.call(a);}; | ||
| u.prototype.attributeChangedCallback=function(a,b,d,c,e){var f=a.__CE_definition;f.attributeChangedCallback&&-1<f.observedAttributes.indexOf(b)&&f.attributeChangedCallback.call(a,b,d,c,e);};function B(a){var b=document;this.c=a;this.a=b;this.b=void 0;A(this.c,this.a);"loading"===this.a.readyState&&(this.b=new MutationObserver(this.f.bind(this)),this.b.observe(this.a,{childList:!0,subtree:!0}));}function C(a){a.b&&a.b.disconnect();}B.prototype.f=function(a){var b=this.a.readyState;"interactive"!==b&&"complete"!==b||C(this);for(b=0;b<a.length;b++)for(var d=a[b].addedNodes,c=0;c<d.length;c++)A(this.c,d[c]);};function ea(){var a=this;this.b=this.a=void 0;this.c=new Promise(function(b){a.b=b;a.a&&b(a.a);});}function D(a){if(a.a)throw Error("Already resolved.");a.a=void 0;a.b&&a.b(void 0);}function E(a){this.c=!1;this.a=a;this.j=new Map;this.f=function(b){return b()};this.b=!1;this.g=[];this.o=new B(a);} | ||
| E.prototype.l=function(a,b){var d=this;if(!(b instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!g(a))throw new SyntaxError("The element name '"+a+"' is not valid.");if(this.a.a.get(a))throw Error("A custom element with name '"+a+"' has already been defined.");if(this.c)throw Error("A custom element is already being defined.");this.c=!0;try{var c=function(b){var a=e[b];if(void 0!==a&&!(a instanceof Function))throw Error("The '"+b+"' callback must be a function."); | ||
| return a},e=b.prototype;if(!(e instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");var f=c("connectedCallback");var t=c("disconnectedCallback");var k=c("adoptedCallback");var h=c("attributeChangedCallback");var m=b.observedAttributes||[];}catch(q){return}finally{this.c=!1;}b={localName:a,constructorFunction:b,connectedCallback:f,disconnectedCallback:t,adoptedCallback:k,attributeChangedCallback:h,observedAttributes:m,constructionStack:[]};ba(this.a, | ||
| a,b);this.g.push(b);this.b||(this.b=!0,this.f(function(){return fa(d)}));};E.prototype.i=function(a){A(this.a,a);}; | ||
| function fa(a){if(!1!==a.b){a.b=!1;for(var b=a.g,d=[],c=new Map,e=0;e<b.length;e++)c.set(b[e].localName,[]);A(a.a,document,{i:function(b){if(void 0===b.__CE_state){var e=b.localName,f=c.get(e);f?f.push(b):a.a.a.get(e)&&d.push(b);}}});for(e=0;e<d.length;e++)y(a.a,d[e]);for(;0<b.length;){var f=b.shift();e=f.localName;f=c.get(f.localName);for(var t=0;t<f.length;t++)y(a.a,f[t]);(e=a.j.get(e))&&D(e);}}}E.prototype.get=function(a){if(a=this.a.a.get(a))return a.constructorFunction}; | ||
| E.prototype.m=function(a){if(!g(a))return Promise.reject(new SyntaxError("'"+a+"' is not a valid custom element name."));var b=this.j.get(a);if(b)return b.c;b=new ea;this.j.set(a,b);this.a.a.get(a)&&!this.g.some(function(b){return b.localName===a})&&D(b);return b.c};E.prototype.s=function(a){C(this.o);var b=this.f;this.f=function(d){return a(function(){return b(d)})};};window.CustomElementRegistry=E;E.prototype.define=E.prototype.l;E.prototype.upgrade=E.prototype.i;E.prototype.get=E.prototype.get; | ||
| E.prototype.whenDefined=E.prototype.m;E.prototype.polyfillWrapFlushCallback=E.prototype.s;var F=window.Document.prototype.createElement,G=window.Document.prototype.createElementNS,ha=window.Document.prototype.importNode,ia=window.Document.prototype.prepend,ja=window.Document.prototype.append,ka=window.DocumentFragment.prototype.prepend,la=window.DocumentFragment.prototype.append,H=window.Node.prototype.cloneNode,I=window.Node.prototype.appendChild,J=window.Node.prototype.insertBefore,K=window.Node.prototype.removeChild,L=window.Node.prototype.replaceChild,M=Object.getOwnPropertyDescriptor(window.Node.prototype, | ||
| "textContent"),N=window.Element.prototype.attachShadow,O=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),P=window.Element.prototype.getAttribute,Q=window.Element.prototype.setAttribute,R=window.Element.prototype.removeAttribute,S=window.Element.prototype.getAttributeNS,T=window.Element.prototype.setAttributeNS,U=window.Element.prototype.removeAttributeNS,ma=window.Element.prototype.insertAdjacentElement,na=window.Element.prototype.insertAdjacentHTML,oa=window.Element.prototype.prepend, | ||
| pa=window.Element.prototype.append,V=window.Element.prototype.before,qa=window.Element.prototype.after,ra=window.Element.prototype.replaceWith,sa=window.Element.prototype.remove,ta=window.HTMLElement,W=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),ua=window.HTMLElement.prototype.insertAdjacentElement,va=window.HTMLElement.prototype.insertAdjacentHTML;var wa=new function(){};function xa(){var a=X;window.HTMLElement=function(){function b(){var b=this.constructor,c=a.g.get(b);if(!c)throw Error("The custom element being constructed was not registered with `customElements`.");var e=c.constructionStack;if(0===e.length)return e=F.call(document,c.localName),Object.setPrototypeOf(e,b.prototype),e.__CE_state=1,e.__CE_definition=c,w(a,e),e;c=e.length-1;var f=e[c];if(f===wa)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times."); | ||
| e[c]=wa;Object.setPrototypeOf(f,b.prototype);w(a,f);return f}b.prototype=ta.prototype;Object.defineProperty(b.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:b});return b}();}function Y(a,b,d){function c(b){return function(d){for(var e=[],c=0;c<arguments.length;++c)e[c]=arguments[c];c=[];for(var f=[],m=0;m<e.length;m++){var q=e[m];q instanceof Element&&l(q)&&f.push(q);if(q instanceof DocumentFragment)for(q=q.firstChild;q;q=q.nextSibling)c.push(q);else c.push(q);}b.apply(this,e);for(e=0;e<f.length;e++)z(a,f[e]);if(l(this))for(e=0;e<c.length;e++)f=c[e],f instanceof Element&&x(a,f);}}void 0!==d.h&&(b.prepend=c(d.h));void 0!==d.append&&(b.append=c(d.append));}function ya(){var a=X;r(Document.prototype,"createElement",function(b){if(this.__CE_hasRegistry){var d=a.a.get(b);if(d)return new d.constructorFunction}b=F.call(this,b);w(a,b);return b});r(Document.prototype,"importNode",function(b,d){b=ha.call(this,b,!!d);this.__CE_hasRegistry?A(a,b):v(a,b);return b});r(Document.prototype,"createElementNS",function(b,d){if(this.__CE_hasRegistry&&(null===b||"http://www.w3.org/1999/xhtml"===b)){var c=a.a.get(d);if(c)return new c.constructorFunction}b=G.call(this,b, | ||
| d);w(a,b);return b});Y(a,Document.prototype,{h:ia,append:ja});}function za(){function a(a,c){Object.defineProperty(a,"textContent",{enumerable:c.enumerable,configurable:!0,get:c.get,set:function(a){if(this.nodeType===Node.TEXT_NODE)c.set.call(this,a);else{var d=void 0;if(this.firstChild){var e=this.childNodes,k=e.length;if(0<k&&l(this)){d=Array(k);for(var h=0;h<k;h++)d[h]=e[h];}}c.set.call(this,a);if(d)for(a=0;a<d.length;a++)z(b,d[a]);}}});}var b=X;r(Node.prototype,"insertBefore",function(a,c){if(a instanceof DocumentFragment){var e=Array.prototype.slice.apply(a.childNodes); | ||
| a=J.call(this,a,c);if(l(this))for(c=0;c<e.length;c++)x(b,e[c]);return a}e=l(a);c=J.call(this,a,c);e&&z(b,a);l(this)&&x(b,a);return c});r(Node.prototype,"appendChild",function(a){if(a instanceof DocumentFragment){var c=Array.prototype.slice.apply(a.childNodes);a=I.call(this,a);if(l(this))for(var e=0;e<c.length;e++)x(b,c[e]);return a}c=l(a);e=I.call(this,a);c&&z(b,a);l(this)&&x(b,a);return e});r(Node.prototype,"cloneNode",function(a){a=H.call(this,!!a);this.ownerDocument.__CE_hasRegistry?A(b,a):v(b, | ||
| a);return a});r(Node.prototype,"removeChild",function(a){var c=l(a),e=K.call(this,a);c&&z(b,a);return e});r(Node.prototype,"replaceChild",function(a,c){if(a instanceof DocumentFragment){var e=Array.prototype.slice.apply(a.childNodes);a=L.call(this,a,c);if(l(this))for(z(b,c),c=0;c<e.length;c++)x(b,e[c]);return a}e=l(a);var f=L.call(this,a,c),d=l(this);d&&z(b,c);e&&z(b,a);d&&x(b,a);return f});M&&M.get?a(Node.prototype,M):ca(b,function(b){a(b,{enumerable:!0,configurable:!0,get:function(){for(var a=[], | ||
| b=0;b<this.childNodes.length;b++){var f=this.childNodes[b];f.nodeType!==Node.COMMENT_NODE&&a.push(f.textContent);}return a.join("")},set:function(a){for(;this.firstChild;)K.call(this,this.firstChild);null!=a&&""!==a&&I.call(this,document.createTextNode(a));}});});}function Aa(a){function b(b){return function(e){for(var c=[],d=0;d<arguments.length;++d)c[d]=arguments[d];d=[];for(var k=[],h=0;h<c.length;h++){var m=c[h];m instanceof Element&&l(m)&&k.push(m);if(m instanceof DocumentFragment)for(m=m.firstChild;m;m=m.nextSibling)d.push(m);else d.push(m);}b.apply(this,c);for(c=0;c<k.length;c++)z(a,k[c]);if(l(this))for(c=0;c<d.length;c++)k=d[c],k instanceof Element&&x(a,k);}}var d=Element.prototype;void 0!==V&&(d.before=b(V));void 0!==V&&(d.after=b(qa));void 0!==ra&& | ||
| r(d,"replaceWith",function(b){for(var e=[],c=0;c<arguments.length;++c)e[c]=arguments[c];c=[];for(var d=[],k=0;k<e.length;k++){var h=e[k];h instanceof Element&&l(h)&&d.push(h);if(h instanceof DocumentFragment)for(h=h.firstChild;h;h=h.nextSibling)c.push(h);else c.push(h);}k=l(this);ra.apply(this,e);for(e=0;e<d.length;e++)z(a,d[e]);if(k)for(z(a,this),e=0;e<c.length;e++)d=c[e],d instanceof Element&&x(a,d);});void 0!==sa&&r(d,"remove",function(){var b=l(this);sa.call(this);b&&z(a,this);});}function Ba(){function a(a,b){Object.defineProperty(a,"innerHTML",{enumerable:b.enumerable,configurable:!0,get:b.get,set:function(a){var e=this,d=void 0;l(this)&&(d=[],p(this,function(a){a!==e&&d.push(a);}));b.set.call(this,a);if(d)for(var f=0;f<d.length;f++){var t=d[f];1===t.__CE_state&&c.disconnectedCallback(t);}this.ownerDocument.__CE_hasRegistry?A(c,this):v(c,this);return a}});}function b(a,b){r(a,"insertAdjacentElement",function(a,e){var d=l(e);a=b.call(this,a,e);d&&z(c,e);l(a)&&x(c,e);return a});} | ||
| function d(a,b){function e(a,b){for(var e=[];a!==b;a=a.nextSibling)e.push(a);for(b=0;b<e.length;b++)A(c,e[b]);}r(a,"insertAdjacentHTML",function(a,c){a=a.toLowerCase();if("beforebegin"===a){var d=this.previousSibling;b.call(this,a,c);e(d||this.parentNode.firstChild,this);}else if("afterbegin"===a)d=this.firstChild,b.call(this,a,c),e(this.firstChild,d);else if("beforeend"===a)d=this.lastChild,b.call(this,a,c),e(d||this.firstChild,null);else if("afterend"===a)d=this.nextSibling,b.call(this,a,c),e(this.nextSibling, | ||
| d);else throw new SyntaxError("The value provided ("+String(a)+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");});}var c=X;N&&r(Element.prototype,"attachShadow",function(a){a=N.call(this,a);var b=c;if(b.b&&!a.__CE_patched){a.__CE_patched=!0;for(var e=0;e<b.c.length;e++)b.c[e](a);}return this.__CE_shadowRoot=a});O&&O.get?a(Element.prototype,O):W&&W.get?a(HTMLElement.prototype,W):da(c,function(b){a(b,{enumerable:!0,configurable:!0,get:function(){return H.call(this,!0).innerHTML}, | ||
| set:function(a){var b="template"===this.localName,c=b?this.content:this,e=G.call(document,this.namespaceURI,this.localName);for(e.innerHTML=a;0<c.childNodes.length;)K.call(c,c.childNodes[0]);for(a=b?e.content:e;0<a.childNodes.length;)I.call(c,a.childNodes[0]);}});});r(Element.prototype,"setAttribute",function(a,b){if(1!==this.__CE_state)return Q.call(this,a,b);var e=P.call(this,a);Q.call(this,a,b);b=P.call(this,a);c.attributeChangedCallback(this,a,e,b,null);});r(Element.prototype,"setAttributeNS",function(a, | ||
| b,d){if(1!==this.__CE_state)return T.call(this,a,b,d);var e=S.call(this,a,b);T.call(this,a,b,d);d=S.call(this,a,b);c.attributeChangedCallback(this,b,e,d,a);});r(Element.prototype,"removeAttribute",function(a){if(1!==this.__CE_state)return R.call(this,a);var b=P.call(this,a);R.call(this,a);null!==b&&c.attributeChangedCallback(this,a,b,null,null);});r(Element.prototype,"removeAttributeNS",function(a,b){if(1!==this.__CE_state)return U.call(this,a,b);var d=S.call(this,a,b);U.call(this,a,b);var e=S.call(this, | ||
| a,b);d!==e&&c.attributeChangedCallback(this,b,d,e,a);});ua?b(HTMLElement.prototype,ua):ma?b(Element.prototype,ma):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched.");va?d(HTMLElement.prototype,va):na?d(Element.prototype,na):console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched.");Y(c,Element.prototype,{h:oa,append:pa});Aa(c);}var Z=window.customElements;if(!Z||Z.forcePolyfill||"function"!=typeof Z.define||"function"!=typeof Z.get){var X=new u;xa();ya();Y(X,DocumentFragment.prototype,{h:ka,append:la});za();Ba();document.__CE_hasRegistry=!0;var customElements=new E(X);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:customElements});}}).call(self); | ||
| // Polyfill document.baseURI | ||
| if (typeof document.baseURI !== 'string') { | ||
| Object.defineProperty(Document.prototype, 'baseURI', { | ||
| enumerable: true, | ||
| configurable: true, | ||
| get: function () { | ||
| var base = document.querySelector('base'); | ||
| if (base && base.href) { | ||
| return base.href; | ||
| } | ||
| return document.URL; | ||
| } | ||
| }); | ||
| } | ||
| // Polyfill CustomEvent | ||
| if (typeof window.CustomEvent !== 'function') { | ||
| window.CustomEvent = function CustomEvent(event, params) { | ||
| params = params || { bubbles: false, cancelable: false, detail: undefined }; | ||
| var evt = document.createEvent( 'CustomEvent' ); | ||
| evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail ); | ||
| return evt; | ||
| }; | ||
| window.CustomEvent.prototype = window.Event.prototype; | ||
| } | ||
| // Event.composedPath | ||
| (function(E, d, w) { | ||
| if(!E.composedPath) { | ||
| E.composedPath = function() { | ||
| if (this.path) { | ||
| return this.path; | ||
| } | ||
| var target = this.target; | ||
| this.path = []; | ||
| while (target.parentNode !== null) { | ||
| this.path.push(target); | ||
| target = target.parentNode; | ||
| } | ||
| this.path.push(d, w); | ||
| return this.path; | ||
| }; | ||
| } | ||
| })(Event.prototype, document, window); | ||
| /*! | ||
| Element.closest and Element.matches | ||
| https://github.com/jonathantneal/closest | ||
| Creative Commons Zero v1.0 Universal | ||
| */ | ||
| (function(a){"function"!==typeof a.matches&&(a.matches=a.msMatchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||function(a){a=(this.document||this.ownerDocument).querySelectorAll(a);for(var b=0;a[b]&&a[b]!==this;)++b;return !!a[b]});"function"!==typeof a.closest&&(a.closest=function(a){for(var b=this;b&&1===b.nodeType;){if(b.matches(a))return b;b=b.parentNode;}return null});})(window.Element.prototype); | ||
| /*! | ||
| Element.getRootNode() | ||
| */ | ||
| (function(c){function d(a){a=b(a);return a&&11===a.nodeType?d(a.host):a}function b(a){return a&&a.parentNode?b(a.parentNode):a}"function"!==typeof c.getRootNode&&(c.getRootNode=function(a){return a&&a.composed?d(this):b(this)});})(Element.prototype); | ||
| /*! | ||
| Element.isConnected() | ||
| */ | ||
| (function(prototype) { | ||
| if (!("isConnected" in prototype)) { | ||
| Object.defineProperty(prototype, 'isConnected', { | ||
| configurable: true, | ||
| enumerable: true, | ||
| get: function() { | ||
| var root = this.getRootNode({composed: true}); | ||
| return root && root.nodeType === 9; | ||
| } | ||
| }); | ||
| } | ||
| })(Element.prototype); | ||
| /*! | ||
| Element.remove() | ||
| */ | ||
| (function(b){b.forEach(function(a){a.hasOwnProperty("remove")||Object.defineProperty(a,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this);}});});})([Element.prototype,CharacterData.prototype,DocumentType.prototype]); | ||
| /*! | ||
| Element.classList | ||
| */ | ||
| !function(e){'classList'in e||Object.defineProperty(e,"classList",{get:function(){var e=this,t=(e.getAttribute("class")||"").replace(/^\s+|\s$/g,"").split(/\s+/g);function n(){t.length>0?e.setAttribute("class",t.join(" ")):e.removeAttribute("class");}return ""===t[0]&&t.splice(0,1),t.toggle=function(e,i){void 0!==i?i?t.add(e):t.remove(e):-1!==t.indexOf(e)?t.splice(t.indexOf(e),1):t.push(e),n();},t.add=function(){for(var e=[].slice.call(arguments),i=0,s=e.length;i<s;i++)-1===t.indexOf(e[i])&&t.push(e[i]);n();},t.remove=function(){for(var e=[].slice.call(arguments),i=0,s=e.length;i<s;i++)-1!==t.indexOf(e[i])&&t.splice(t.indexOf(e[i]),1);n();},t.item=function(e){return t[e]},t.contains=function(e){return -1!==t.indexOf(e)},t.replace=function(e,i){-1!==t.indexOf(e)&&t.splice(t.indexOf(e),1,i),n();},t.value=e.getAttribute("class")||"",t}});}(Element.prototype); | ||
| /*! | ||
| DOMTokenList | ||
| */ | ||
| (function(prototype){ | ||
| try { | ||
| document.body.classList.add(); | ||
| } catch (e) { | ||
| var originalAdd = prototype.add; | ||
| var originalRemove = prototype.remove; | ||
| prototype.add = function() { | ||
| for (var i = 0; i < arguments.length; i++) { | ||
| originalAdd.call(this, arguments[i]); | ||
| } | ||
| }; | ||
| prototype.remove = function() { | ||
| for (var i = 0; i < arguments.length; i++) { | ||
| originalRemove.call(this, arguments[i]); | ||
| } | ||
| }; | ||
| } | ||
| }(DOMTokenList.prototype)); |
| /*! | ||
| es6-promise - a tiny implementation of Promises/A+. | ||
| Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) | ||
| Licensed under MIT license | ||
| See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE | ||
| https://cdn.jsdelivr.net/npm/es6-promise/dist/es6-promise.auto.min.js | ||
| v4.2.8 | ||
| */ | ||
| !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){"use strict";function t(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function e(t){return"function"==typeof t}function n(t){W=t}function r(t){z=t}function o(){return function(){return process.nextTick(a)}}function i(){return"undefined"!=typeof U?function(){U(a)}:c()}function s(){var t=0,e=new H(a),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t<N;t+=2){var e=Q[t],n=Q[t+1];e(n),Q[t]=void 0,Q[t+1]=void 0}N=0}function f(){try{var t=Function("return this")().require("vertx");return U=t.runOnLoop||t.runOnContext,i()}catch(e){return c()}}function l(t,e){var n=this,r=new this.constructor(p);void 0===r[V]&&x(r);var o=n._state;if(o){var i=arguments[o-1];z(function(){return T(o,r,i,n._result)})}else j(n,r,t,e);return r}function h(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(p);return w(n,t),n}function p(){}function v(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function _(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function y(t,e,n){z(function(t){var r=!1,o=_(n,e,function(n){r||(r=!0,e!==n?w(t,n):A(t,n))},function(e){r||(r=!0,S(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,S(t,o))},t)}function m(t,e){e._state===Z?A(t,e._result):e._state===$?S(t,e._result):j(e,void 0,function(e){return w(t,e)},function(e){return S(t,e)})}function b(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?m(t,n):void 0===r?A(t,n):e(r)?y(t,n,r):A(t,n)}function w(e,n){if(e===n)S(e,v());else if(t(n)){var r=void 0;try{r=n.then}catch(o){return void S(e,o)}b(e,n,r)}else A(e,n)}function g(t){t._onerror&&t._onerror(t._result),E(t)}function A(t,e){t._state===X&&(t._result=e,t._state=Z,0!==t._subscribers.length&&z(E,t))}function S(t,e){t._state===X&&(t._state=$,t._result=e,z(g,t))}function j(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+Z]=n,o[i+$]=r,0===i&&t._state&&z(E,t)}function E(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?T(n,r,o,i):o(i);t._subscribers.length=0}}function T(t,n,r,o){var i=e(r),s=void 0,u=void 0,c=!0;if(i){try{s=r(o)}catch(a){c=!1,u=a}if(n===s)return void S(n,d())}else s=o;n._state!==X||(i&&c?w(n,s):c===!1?S(n,u):t===Z?A(n,s):t===$&&S(n,s))}function M(t,e){try{e(function(e){w(t,e)},function(e){S(t,e)})}catch(n){S(t,n)}}function P(){return tt++}function x(t){t[V]=tt++,t._state=void 0,t._result=void 0,t._subscribers=[]}function C(){return new Error("Array Methods must be provided an Array")}function O(t){return new et(this,t).promise}function k(t){var e=this;return new e(L(t)?function(n,r){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(n,r)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function F(t){var e=this,n=new e(p);return S(n,t),n}function Y(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function q(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function D(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=nt}var K=void 0;K=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var L=K,N=0,U=void 0,W=void 0,z=function(t,e){Q[N]=t,Q[N+1]=e,N+=2,2===N&&(W?W(a):R())},B="undefined"!=typeof window?window:void 0,G=B||{},H=G.MutationObserver||G.WebKitMutationObserver,I="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),J="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Q=new Array(1e3),R=void 0;R=I?o():H?s():J?u():void 0===B&&"function"==typeof require?f():c();var V=Math.random().toString(36).substring(2),X=void 0,Z=1,$=2,tt=0,et=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(p),this.promise[V]||x(this.promise),L(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?A(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&A(this.promise,this._result))):S(this.promise,C())}return t.prototype._enumerate=function(t){for(var e=0;this._state===X&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=void 0,i=void 0,s=!1;try{o=t.then}catch(u){s=!0,i=u}if(o===l&&t._state!==X)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===nt){var c=new n(p);s?S(c,i):b(c,t,o),this._willSettleAt(c,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===X&&(this._remaining--,t===$?S(r,n):this._result[e]=n),0===this._remaining&&A(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;j(t,void 0,function(t){return n._settledAt(Z,e,t)},function(t){return n._settledAt($,e,t)})},t}(),nt=function(){function t(e){this[V]=P(),this._result=this._state=void 0,this._subscribers=[],p!==e&&("function"!=typeof e&&Y(),this instanceof t?M(this,e):q())}return t.prototype["catch"]=function(t){return this.then(null,t)},t.prototype["finally"]=function(t){var n=this,r=n.constructor;return e(t)?n.then(function(e){return r.resolve(t()).then(function(){return e})},function(e){return r.resolve(t()).then(function(){throw e})}):n.then(t,t)},t}();return nt.prototype.then=l,nt.all=O,nt.race=k,nt.resolve=h,nt.reject=F,nt._setScheduler=n,nt._setAsap=r,nt._asap=z,nt.polyfill=D,nt.Promise=nt,nt.polyfill(),nt}); |
| /** | ||
| * @license | ||
| * Copyright Google Inc. All Rights Reserved. | ||
| * | ||
| * Use of this source code is governed by an MIT-style license that can be | ||
| * found in the LICENSE file at https://angular.io/license | ||
| * | ||
| * This file is a port of shadowCSS from webcomponents.js to TypeScript. | ||
| * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js | ||
| * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts | ||
| */ | ||
| const safeSelector = (selector) => { | ||
| const placeholders = []; | ||
| let index = 0; | ||
| let content; | ||
| // Replaces attribute selectors with placeholders. | ||
| // The WS in [attr="va lue"] would otherwise be interpreted as a selector separator. | ||
| selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => { | ||
| const replaceBy = `__ph-${index}__`; | ||
| placeholders.push(keep); | ||
| index++; | ||
| return replaceBy; | ||
| }); | ||
| // Replaces the expression in `:nth-child(2n + 1)` with a placeholder. | ||
| // WS and "+" would otherwise be interpreted as selector separators. | ||
| content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => { | ||
| const replaceBy = `__ph-${index}__`; | ||
| placeholders.push(exp); | ||
| index++; | ||
| return pseudo + replaceBy; | ||
| }); | ||
| const ss = { | ||
| content, | ||
| placeholders, | ||
| }; | ||
| return ss; | ||
| }; | ||
| const restoreSafeSelector = (placeholders, content) => { | ||
| return content.replace(/__ph-(\d+)__/g, (_, index) => placeholders[+index]); | ||
| }; | ||
| const _polyfillHost = '-shadowcsshost'; | ||
| const _polyfillSlotted = '-shadowcssslotted'; | ||
| // note: :host-context pre-processed to -shadowcsshostcontext. | ||
| const _polyfillHostContext = '-shadowcsscontext'; | ||
| const _parenSuffix = ')(?:\\((' + | ||
| '(?:\\([^)(]*\\)|[^)(]*)+?' + | ||
| ')\\))?([^,{]*)'; | ||
| const _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim'); | ||
| const _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim'); | ||
| const _cssColonSlottedRe = new RegExp('(' + _polyfillSlotted + _parenSuffix, 'gim'); | ||
| const _polyfillHostNoCombinator = _polyfillHost + '-no-combinator'; | ||
| const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/; | ||
| const _shadowDOMSelectorsRe = [ | ||
| /::shadow/g, | ||
| /::content/g | ||
| ]; | ||
| const _selectorReSuffix = '([>\\s~+\[.,{:][\\s\\S]*)?$'; | ||
| const _polyfillHostRe = /-shadowcsshost/gim; | ||
| const _colonHostRe = /:host/gim; | ||
| const _colonSlottedRe = /::slotted/gim; | ||
| const _colonHostContextRe = /:host-context/gim; | ||
| const _commentRe = /\/\*\s*[\s\S]*?\*\//g; | ||
| const stripComments = (input) => { | ||
| return input.replace(_commentRe, ''); | ||
| }; | ||
| const _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g; | ||
| const extractCommentsWithHash = (input) => { | ||
| return input.match(_commentWithHashRe) || []; | ||
| }; | ||
| const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g; | ||
| const _curlyRe = /([{}])/g; | ||
| const OPEN_CURLY = '{'; | ||
| const CLOSE_CURLY = '}'; | ||
| const BLOCK_PLACEHOLDER = '%BLOCK%'; | ||
| const processRules = (input, ruleCallback) => { | ||
| const inputWithEscapedBlocks = escapeBlocks(input); | ||
| let nextBlockIndex = 0; | ||
| return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => { | ||
| const selector = m[2]; | ||
| let content = ''; | ||
| let suffix = m[4]; | ||
| let contentPrefix = ''; | ||
| if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) { | ||
| content = inputWithEscapedBlocks.blocks[nextBlockIndex++]; | ||
| suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1); | ||
| contentPrefix = '{'; | ||
| } | ||
| const cssRule = { | ||
| selector, | ||
| content | ||
| }; | ||
| const rule = ruleCallback(cssRule); | ||
| return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`; | ||
| }); | ||
| }; | ||
| const escapeBlocks = (input) => { | ||
| const inputParts = input.split(_curlyRe); | ||
| const resultParts = []; | ||
| const escapedBlocks = []; | ||
| let bracketCount = 0; | ||
| let currentBlockParts = []; | ||
| for (let partIndex = 0; partIndex < inputParts.length; partIndex++) { | ||
| const part = inputParts[partIndex]; | ||
| if (part === CLOSE_CURLY) { | ||
| bracketCount--; | ||
| } | ||
| if (bracketCount > 0) { | ||
| currentBlockParts.push(part); | ||
| } | ||
| else { | ||
| if (currentBlockParts.length > 0) { | ||
| escapedBlocks.push(currentBlockParts.join('')); | ||
| resultParts.push(BLOCK_PLACEHOLDER); | ||
| currentBlockParts = []; | ||
| } | ||
| resultParts.push(part); | ||
| } | ||
| if (part === OPEN_CURLY) { | ||
| bracketCount++; | ||
| } | ||
| } | ||
| if (currentBlockParts.length > 0) { | ||
| escapedBlocks.push(currentBlockParts.join('')); | ||
| resultParts.push(BLOCK_PLACEHOLDER); | ||
| } | ||
| const strEscapedBlocks = { | ||
| escapedString: resultParts.join(''), | ||
| blocks: escapedBlocks | ||
| }; | ||
| return strEscapedBlocks; | ||
| }; | ||
| const insertPolyfillHostInCssText = (selector) => { | ||
| selector = selector | ||
| .replace(_colonHostContextRe, _polyfillHostContext) | ||
| .replace(_colonHostRe, _polyfillHost) | ||
| .replace(_colonSlottedRe, _polyfillSlotted); | ||
| return selector; | ||
| }; | ||
| const convertColonRule = (cssText, regExp, partReplacer) => { | ||
| // m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule | ||
| return cssText.replace(regExp, (...m) => { | ||
| if (m[2]) { | ||
| const parts = m[2].split(','); | ||
| const r = []; | ||
| for (let i = 0; i < parts.length; i++) { | ||
| const p = parts[i].trim(); | ||
| if (!p) | ||
| break; | ||
| r.push(partReplacer(_polyfillHostNoCombinator, p, m[3])); | ||
| } | ||
| return r.join(','); | ||
| } | ||
| else { | ||
| return _polyfillHostNoCombinator + m[3]; | ||
| } | ||
| }); | ||
| }; | ||
| const colonHostPartReplacer = (host, part, suffix) => { | ||
| return host + part.replace(_polyfillHost, '') + suffix; | ||
| }; | ||
| const convertColonHost = (cssText) => { | ||
| return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer); | ||
| }; | ||
| const colonHostContextPartReplacer = (host, part, suffix) => { | ||
| if (part.indexOf(_polyfillHost) > -1) { | ||
| return colonHostPartReplacer(host, part, suffix); | ||
| } | ||
| else { | ||
| return host + part + suffix + ', ' + part + ' ' + host + suffix; | ||
| } | ||
| }; | ||
| const convertColonSlotted = (cssText, slotAttr) => { | ||
| const regExp = _cssColonSlottedRe; | ||
| return cssText.replace(regExp, (...m) => { | ||
| if (m[2]) { | ||
| const compound = m[2].trim(); | ||
| const suffix = m[3]; | ||
| const sel = '.' + slotAttr + ' > ' + compound + suffix; | ||
| return sel; | ||
| } | ||
| else { | ||
| return _polyfillHostNoCombinator + m[3]; | ||
| } | ||
| }); | ||
| }; | ||
| const convertColonHostContext = (cssText) => { | ||
| return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer); | ||
| }; | ||
| const convertShadowDOMSelectors = (cssText) => { | ||
| return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText); | ||
| }; | ||
| const makeScopeMatcher = (scopeSelector) => { | ||
| const lre = /\[/g; | ||
| const rre = /\]/g; | ||
| scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]'); | ||
| return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm'); | ||
| }; | ||
| const selectorNeedsScoping = (selector, scopeSelector) => { | ||
| const re = makeScopeMatcher(scopeSelector); | ||
| return !re.test(selector); | ||
| }; | ||
| const applySimpleSelectorScope = (selector, scopeSelector, hostSelector) => { | ||
| // In Android browser, the lastIndex is not reset when the regex is used in String.replace() | ||
| _polyfillHostRe.lastIndex = 0; | ||
| if (_polyfillHostRe.test(selector)) { | ||
| const replaceBy = `.${hostSelector}`; | ||
| return selector | ||
| .replace(_polyfillHostNoCombinatorRe, (_, selector) => { | ||
| return selector.replace(/([^:]*)(:*)(.*)/, (_, before, colon, after) => { | ||
| return before + replaceBy + colon + after; | ||
| }); | ||
| }) | ||
| .replace(_polyfillHostRe, replaceBy + ' '); | ||
| } | ||
| return scopeSelector + ' ' + selector; | ||
| }; | ||
| const applyStrictSelectorScope = (selector, scopeSelector, hostSelector) => { | ||
| const isRe = /\[is=([^\]]*)\]/g; | ||
| scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]); | ||
| const className = '.' + scopeSelector; | ||
| const _scopeSelectorPart = (p) => { | ||
| let scopedP = p.trim(); | ||
| if (!scopedP) { | ||
| return ''; | ||
| } | ||
| if (p.indexOf(_polyfillHostNoCombinator) > -1) { | ||
| scopedP = applySimpleSelectorScope(p, scopeSelector, hostSelector); | ||
| } | ||
| else { | ||
| // remove :host since it should be unnecessary | ||
| const t = p.replace(_polyfillHostRe, ''); | ||
| if (t.length > 0) { | ||
| const matches = t.match(/([^:]*)(:*)(.*)/); | ||
| if (matches) { | ||
| scopedP = matches[1] + className + matches[2] + matches[3]; | ||
| } | ||
| } | ||
| } | ||
| return scopedP; | ||
| }; | ||
| const safeContent = safeSelector(selector); | ||
| selector = safeContent.content; | ||
| let scopedSelector = ''; | ||
| let startIndex = 0; | ||
| let res; | ||
| const sep = /( |>|\+|~(?!=))\s*/g; | ||
| // If a selector appears before :host it should not be shimmed as it | ||
| // matches on ancestor elements and not on elements in the host's shadow | ||
| // `:host-context(div)` is transformed to | ||
| // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator` | ||
| // the `div` is not part of the component in the 2nd selectors and should not be scoped. | ||
| // Historically `component-tag:host` was matching the component so we also want to preserve | ||
| // this behavior to avoid breaking legacy apps (it should not match). | ||
| // The behavior should be: | ||
| // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything) | ||
| // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a | ||
| // `:host-context(tag)`) | ||
| const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1; | ||
| // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present | ||
| let shouldScope = !hasHost; | ||
| while ((res = sep.exec(selector)) !== null) { | ||
| const separator = res[1]; | ||
| const part = selector.slice(startIndex, res.index).trim(); | ||
| shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1; | ||
| const scopedPart = shouldScope ? _scopeSelectorPart(part) : part; | ||
| scopedSelector += `${scopedPart} ${separator} `; | ||
| startIndex = sep.lastIndex; | ||
| } | ||
| const part = selector.substring(startIndex); | ||
| shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1; | ||
| scopedSelector += shouldScope ? _scopeSelectorPart(part) : part; | ||
| // replace the placeholders with their original values | ||
| return restoreSafeSelector(safeContent.placeholders, scopedSelector); | ||
| }; | ||
| const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => { | ||
| return selector.split(',') | ||
| .map(shallowPart => { | ||
| if (slotSelector && shallowPart.indexOf('.' + slotSelector) > -1) { | ||
| return shallowPart.trim(); | ||
| } | ||
| if (selectorNeedsScoping(shallowPart, scopeSelectorText)) { | ||
| return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim(); | ||
| } | ||
| else { | ||
| return shallowPart.trim(); | ||
| } | ||
| }) | ||
| .join(', '); | ||
| }; | ||
| const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => { | ||
| return processRules(cssText, (rule) => { | ||
| let selector = rule.selector; | ||
| let content = rule.content; | ||
| if (rule.selector[0] !== '@') { | ||
| selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector); | ||
| } | ||
| else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') || | ||
| rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) { | ||
| content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector); | ||
| } | ||
| const cssRule = { | ||
| selector: selector.replace(/\s{2,}/g, ' ').trim(), | ||
| content | ||
| }; | ||
| return cssRule; | ||
| }); | ||
| }; | ||
| const scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => { | ||
| cssText = insertPolyfillHostInCssText(cssText); | ||
| cssText = convertColonHost(cssText); | ||
| cssText = convertColonHostContext(cssText); | ||
| cssText = convertColonSlotted(cssText, slotScopeId); | ||
| cssText = convertShadowDOMSelectors(cssText); | ||
| if (scopeId) { | ||
| cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId); | ||
| } | ||
| cssText = cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`); | ||
| cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, ' $1 '); | ||
| return cssText.trim(); | ||
| }; | ||
| const scopeCss = (cssText, scopeId, commentOriginalSelector) => { | ||
| const hostScopeId = scopeId + '-h'; | ||
| const slotScopeId = scopeId + '-s'; | ||
| const commentsWithHash = extractCommentsWithHash(cssText); | ||
| cssText = stripComments(cssText); | ||
| const orgSelectors = []; | ||
| if (commentOriginalSelector) { | ||
| const processCommentedSelector = (rule) => { | ||
| const placeholder = `/*!@___${orgSelectors.length}___*/`; | ||
| const comment = `/*!@${rule.selector}*/`; | ||
| orgSelectors.push({ placeholder, comment }); | ||
| rule.selector = placeholder + rule.selector; | ||
| return rule; | ||
| }; | ||
| cssText = processRules(cssText, rule => { | ||
| if (rule.selector[0] !== '@') { | ||
| return processCommentedSelector(rule); | ||
| } | ||
| else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') || | ||
| rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) { | ||
| rule.content = processRules(rule.content, processCommentedSelector); | ||
| return rule; | ||
| } | ||
| return rule; | ||
| }); | ||
| } | ||
| const scopedCssText = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId); | ||
| cssText = [scopedCssText, ...commentsWithHash].join('\n'); | ||
| if (commentOriginalSelector) { | ||
| orgSelectors.forEach(({ placeholder, comment }) => { | ||
| cssText = cssText.replace(placeholder, comment); | ||
| }); | ||
| } | ||
| return cssText; | ||
| }; | ||
| export { scopeCss }; |
| var __extends=this&&this.__extends||function(){var e=function(r,n){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var n in r)if(r.hasOwnProperty(n))e[n]=r[n]};return e(r,n)};return function(r,n){e(r,n);function t(){this.constructor=r}r.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}}();var __awaiter=this&&this.__awaiter||function(e,r,n,t){function a(e){return e instanceof n?e:new n((function(r){r(e)}))}return new(n||(n=Promise))((function(n,i){function s(e){try{u(t.next(e))}catch(r){i(r)}}function o(e){try{u(t["throw"](e))}catch(r){i(r)}}function u(e){e.done?n(e.value):a(e.value).then(s,o)}u((t=t.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,a,i,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(e){return function(r){return u([e,r])}}function u(s){if(t)throw new TypeError("Generator is already executing.");while(n)try{if(t=1,a&&(i=s[0]&2?a["return"]:s[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;if(a=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;a=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){n.label=s[1];break}if(s[0]===6&&n.label<i[1]){n.label=i[1];i=s;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(s);break}if(i[2])n.ops.pop();n.trys.pop();continue}s=r.call(e,n)}catch(o){s=[6,o];a=0}finally{t=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArrays=this&&this.__spreadArrays||function(){for(var e=0,r=0,n=arguments.length;r<n;r++)e+=arguments[r].length;for(var t=Array(e),a=0,r=0;r<n;r++)for(var i=arguments[r],s=0,o=i.length;s<o;s++,a++)t[a]=i[s];return t};System.register([],(function(e,r){"use strict";return{execute:function(){var n=this;var t="msf-editor";var a=0;var i=false;var s;var o;var u=false;var l=typeof window!=="undefined"?window:{};var f=l.document||{head:{}};var c={$flags$:0,$resourcesUrl$:"",jmp:function(e){return e()},raf:function(e){return requestAnimationFrame(e)},ael:function(e,r,n,t){return e.addEventListener(r,n,t)},rel:function(e,r,n,t){return e.removeEventListener(r,n,t)}};var $=function(){return(f.head.attachShadow+"").includes("[native")}();var v=function(){var e=false;try{f.addEventListener("e",null,Object.defineProperty({},"passive",{get:function(){e=true}}))}catch(r){}return e}();var h=function(){try{new CSSStyleSheet;return true}catch(e){}return false}();var d=new WeakMap;var m=function(e){return d.get(e)};var p=e("r",(function(e,r){return d.set(r.$lazyInstance$=e,r)}));var g=function(e){var r={$flags$:0,$hostElement$:e,$instanceValues$:new Map};{r.$onInstancePromise$=new Promise((function(e){return r.$onInstanceResolve$=e}))}{r.$onReadyPromise$=new Promise((function(e){return r.$onReadyResolve$=e}));e["s-p"]=[];e["s-rc"]=[]}return d.set(e,r)};var y=function(e,r){return r in e};var b=function(e){return console.error(e)};var w=new Map;var S=function(e,n,t){var a=e.$tagName$.replace(/-/g,"_");var i=e.$lazyBundleIds$;var s=w.get(i);if(s){return s[a]}return r.import("./"+i+".entry.js"+"").then((function(e){{w.set(i,e)}return e[a]}),b)};var _=new Map;var R=[];var L=[];var E=[];var j=function(e,r){return function(n){e.push(n);if(!i){i=true;if(r&&c.$flags$&4){x(P)}else{c.raf(P)}}}};var C=function(e){for(var r=0;r<e.length;r++){try{e[r](performance.now())}catch(n){b(n)}}e.length=0};var N=function(e,r){var n=0;var t=0;while(n<e.length&&(t=performance.now())<r){try{e[n++](t)}catch(a){b(a)}}if(n===e.length){e.length=0}else if(n!==0){e.splice(0,n)}};var P=function(){a++;C(R);var e=(c.$flags$&6)===2?performance.now()+10*Math.ceil(a*(1/22)):Infinity;N(L,e);N(E,e);if(L.length>0){E.push.apply(E,L);L.length=0}if(i=R.length+L.length+E.length>0){c.raf(P)}else{a=0}};var x=function(e){return Promise.resolve().then(e)};var U=j(L,true);var A={};var O=function(e){return e!=null};var k=function(e){e=typeof e;return e==="object"||e==="function"};var I=function(e){return"__sc_import_"+e.replace(/\s|-/g,"_")};var M=e("a",(function(){if(!(l.CSS&&l.CSS.supports&&l.CSS.supports("color","var(--c)"))){return r.import("./p-447ccb56.system.js").then((function(){c.$cssShim$=l.__stencil_cssshim;if(c.$cssShim$){return c.$cssShim$.initShim()}}))}return Promise.resolve()}));var q=e("p",(function(){{c.$cssShim$=l.__stencil_cssshim}var e=Array.from(f.querySelectorAll("script")).find((function(e){return new RegExp("/"+t+"(\\.esm)?\\.js($|\\?|#)").test(e.src)||e.getAttribute("data-stencil-namespace")===t}));var n=e["data-opts"]||{};var a=r.meta.url;if("onbeforeload"in e&&!history.scrollRestoration&&false){return{then:function(){}}}if(a!==""){n.resourcesUrl=new URL(".",a).href}else{n.resourcesUrl=new URL(".",new URL(e.getAttribute("data-resources-url")||e.src,l.location.href)).href;B(n.resourcesUrl,e);if(!window.customElements){return r.import("./p-7f10eb01.system.js").then((function(){return n}))}}return Promise.resolve(n)}));var B=function(e,r){var n=I(t);try{l[n]=new Function("w","return import(w);//"+Math.random())}catch(i){var a=new Map;l[n]=function(t){var i=new URL(t,e).href;var s=a.get(i);if(!s){var o=f.createElement("script");o.type="module";o.crossOrigin=r.crossOrigin;o.src=URL.createObjectURL(new Blob(["import * as m from '"+i+"'; window."+n+".m = m;"],{type:"application/javascript"}));s=new Promise((function(e){o.onload=function(){e(l[n].m);o.remove()}}));a.set(i,s);f.head.appendChild(o)}return s}}};var T=function(e,r){if(e!=null&&!k(e)){if(r&1){return String(e)}return e}return e};var z="hydrated";var H=function(e,r){if(r===void 0){r=""}{return function(){return}}};var V=function(e,r){{return function(){return}}};var W=new WeakMap;var F=function(e,r,n){var t=_.get(e);if(h&&n){t=t||new CSSStyleSheet;t.replace(r)}else{t=r}_.set(e,t)};var G=function(e,r,n,t){var a=D(r.$tagName$);var i=_.get(a);e=e.nodeType===11?e:f;if(i){if(typeof i==="string"){e=e.head||e;var s=W.get(e);var o=void 0;if(!s){W.set(e,s=new Set)}if(!s.has(a)){{if(c.$cssShim$){o=c.$cssShim$.createHostStyle(t,a,i,!!(r.$flags$&10));var u=o["s-sc"];if(u){a=u;s=null}}else{o=f.createElement("style");o.innerHTML=i}e.insertBefore(o,e.querySelector("link"))}if(s){s.add(a)}}}else if(!e.adoptedStyleSheets.includes(i)){e.adoptedStyleSheets=__spreadArrays(e.adoptedStyleSheets,[i])}}return a};var Q=function(e,r,n){var t=H("attachStyles",r.$tagName$);var a=G($&&e.shadowRoot?e.shadowRoot:e.getRootNode(),r,n,e);if(r.$flags$&10){e["s-sc"]=a;e.classList.add(a+"-h")}t()};var D=function(e,r){return"sc-"+e};var J=e("h",(function(e,r){var n=[];for(var t=2;t<arguments.length;t++){n[t-2]=arguments[t]}var a=null;var i=false;var s=false;var o=[];var u=function(r){for(var n=0;n<r.length;n++){a=r[n];if(Array.isArray(a)){u(a)}else if(a!=null&&typeof a!=="boolean"){if(i=typeof e!=="function"&&!k(a)){a=String(a)}if(i&&s){o[o.length-1].$text$+=a}else{o.push(i?K(null,a):a)}s=i}}};u(n);if(r){{var l=r.className||r.class;if(l){r.class=typeof l!=="object"?l:Object.keys(l).filter((function(e){return l[e]})).join(" ")}}}var f=K(e,null);f.$attrs$=r;if(o.length>0){f.$children$=o}return f}));var K=function(e,r){var n={$flags$:0,$tag$:e,$text$:r,$elm$:null,$children$:null};{n.$attrs$=null}return n};var X={};var Y=function(e){return e&&e.$tag$===X};var Z=function(e,r,n,t,a,i){if(n===t){return}var s=y(e,r);var o=r.toLowerCase();if(r==="class"){var u=e.classList;var l=re(n);var f=re(t);u.remove.apply(u,l.filter((function(e){return e&&!f.includes(e)})));u.add.apply(u,f.filter((function(e){return e&&!l.includes(e)})))}else{var c=k(t);if((s||c&&t!==null)&&!a){try{if(!e.tagName.includes("-")){var $=t==null?"":t;if(r==="list"){s=false}else if(n==null||e[r]!=$){e[r]=$}}else{e[r]=t}}catch(v){}}if(t==null||t===false){{e.removeAttribute(r)}}else if((!s||i&4||a)&&!c){t=t===true?"":t;{e.setAttribute(r,t)}}}};var ee=/\s/;var re=function(e){return!e?[]:e.split(ee)};var ne=function(e,r,n,t){var a=r.$elm$.nodeType===11&&r.$elm$.host?r.$elm$.host:r.$elm$;var i=e&&e.$attrs$||A;var s=r.$attrs$||A;{for(t in i){if(!(t in s)){Z(a,t,i[t],undefined,n,r.$flags$)}}}for(t in s){Z(a,t,i[t],s[t],n,r.$flags$)}};var te=function(e,r,n,t){var a=r.$children$[n];var i=0;var o;var l;{o=a.$elm$=f.createElement(a.$tag$);{ne(null,a,u)}if(O(s)&&o["s-si"]!==s){o.classList.add(o["s-si"]=s)}if(a.$children$){for(i=0;i<a.$children$.length;++i){l=te(e,a,i);if(l){o.appendChild(l)}}}}return o};var ae=function(e,r,n,t,a,i){var s=e;var u;if(s.shadowRoot&&s.tagName===o){s=s.shadowRoot}for(;a<=i;++a){if(t[a]){u=te(null,n,a);if(u){t[a].$elm$=u;s.insertBefore(u,r)}}}};var ie=function(e,r,n,t,a){for(;r<=n;++r){if(t=e[r]){a=t.$elm$;a.remove()}}};var se=function(e,r,n,t){var a=0;var i=0;var s=r.length-1;var o=r[0];var u=r[s];var l=t.length-1;var f=t[0];var c=t[l];var $;while(a<=s&&i<=l){if(o==null){o=r[++a]}else if(u==null){u=r[--s]}else if(f==null){f=t[++i]}else if(c==null){c=t[--l]}else if(oe(o,f)){ue(o,f);o=r[++a];f=t[++i]}else if(oe(u,c)){ue(u,c);u=r[--s];c=t[--l]}else if(oe(o,c)){ue(o,c);e.insertBefore(o.$elm$,u.$elm$.nextSibling);o=r[++a];c=t[--l]}else if(oe(u,f)){ue(u,f);e.insertBefore(u.$elm$,o.$elm$);u=r[--s];f=t[++i]}else{{$=te(r&&r[i],n,i);f=t[++i]}if($){{o.$elm$.parentNode.insertBefore($,o.$elm$)}}}}if(a>s){ae(e,t[l+1]==null?null:t[l+1].$elm$,n,t,i,l)}else if(i>l){ie(r,a,s)}};var oe=function(e,r){if(e.$tag$===r.$tag$){return true}return false};var ue=function(e,r){var n=r.$elm$=e.$elm$;var t=e.$children$;var a=r.$children$;{{{ne(e,r,u)}}if(t!==null&&a!==null){se(n,t,r,a)}else if(a!==null){ae(n,null,r,a,0,a.length-1)}else if(t!==null){ie(t,0,t.length-1)}}};var le=function(e,r,n,t){o=e.tagName;var a=r.$vnode$||K(null,null);var i=Y(t)?t:J(null,null,t);i.$tag$=null;i.$flags$|=4;r.$vnode$=i;i.$elm$=a.$elm$=e.shadowRoot||e;{s=e["s-sc"]}ue(a,i)};var fe=function(e,r){if(r&&!e.$onRenderResolve$){r["s-p"].push(new Promise((function(r){return e.$onRenderResolve$=r})))}};var ce=function(e,r,n,t){{r.$flags$|=16}if(r.$flags$&4){r.$flags$|=512;return}var a=H("scheduleUpdate",n.$tagName$);var i=r.$ancestorComponent$;var s=r.$lazyInstance$;var o=function(){return $e(e,r,n,s,t)};fe(r,i);var u;if(t){{r.$flags$|=256;if(r.$queuedListeners$){r.$queuedListeners$.forEach((function(e){var r=e[0],n=e[1];return pe(s,r,n)}));r.$queuedListeners$=null}}{u=pe(s,"componentWillLoad")}}{u=ge(u,(function(){return pe(s,"componentWillRender")}))}a();return ge(u,(function(){return U(o)}))};var $e=function(e,r,n,t,a){var i=H("update",n.$tagName$);var s=e["s-rc"];if(a){Q(e,n,r.$modeName$)}var o=H("render",n.$tagName$);{{le(e,r,n,ve(t))}}if(c.$cssShim$){c.$cssShim$.updateHost(e)}{r.$flags$&=~16}{r.$flags$|=2}if(s){s.forEach((function(e){return e()}));e["s-rc"]=undefined}o();i();{var u=e["s-p"];var l=function(){return he(e,r,n)};if(u.length===0){l()}else{Promise.all(u).then(l);r.$flags$|=4;u.length=0}}};var ve=function(e,r){try{e=e.render()}catch(n){b(n)}return e};var he=function(e,r,n){var t=H("postUpdate",n.$tagName$);var a=r.$ancestorComponent$;if(!(r.$flags$&64)){r.$flags$|=64;{e.classList.add(z)}t();{r.$onReadyResolve$(e);if(!a){me()}}}else{t()}{r.$onInstanceResolve$(e)}{if(r.$onRenderResolve$){r.$onRenderResolve$();r.$onRenderResolve$=undefined}if(r.$flags$&512){x((function(){return ce(e,r,n,false)}))}r.$flags$&=~(4|512)}};var de=function(e,r){{var n=m(e);var t=n.$hostElement$.isConnected;if(t&&(n.$flags$&(2|16))===2){ce(e,n,r,false)}return t}};var me=function(e){{f.documentElement.classList.add(z)}{c.$flags$|=2}};var pe=function(e,r,n){if(e&&e[r]){try{return e[r](n)}catch(t){b(t)}}return undefined};var ge=function(e,r){return e&&e.then?e.then(r):r()};var ye=function(e,r){return m(e).$instanceValues$.get(r)};var be=function(e,r,n,t){var a=m(e);var i=a.$hostElement$;var s=a.$instanceValues$.get(r);var o=a.$flags$;var u=a.$lazyInstance$;n=T(n,t.$members$[r][0]);if(n!==s&&(!(o&8)||s===undefined)){a.$instanceValues$.set(r,n);if(u){if((o&(2|16))===2){ce(i,a,t,false)}}}};var we=function(e,r,n){if(r.$members$){var t=Object.entries(r.$members$);var a=e.prototype;t.forEach((function(e){var t=e[0],i=e[1][0];if(i&31||n&2&&i&32){Object.defineProperty(a,t,{get:function(){return ye(this,t)},set:function(e){be(this,t,e,r)},configurable:true,enumerable:true})}else if(n&1&&i&64){Object.defineProperty(a,t,{value:function(){var e=[];for(var r=0;r<arguments.length;r++){e[r]=arguments[r]}var n=m(this);return n.$onInstancePromise$.then((function(){var r;return(r=n.$lazyInstance$)[t].apply(r,e)}))}})}}));if(n&1){var i=new Map;a.attributeChangedCallback=function(e,r,n){var t=this;c.jmp((function(){var r=i.get(e);t[r]=n===null&&typeof t[r]==="boolean"?false:n}))};e.observedAttributes=t.filter((function(e){var r=e[0],n=e[1];return n[0]&15})).map((function(e){var r=e[0],n=e[1];var t=n[1]||r;i.set(t,r);return t}))}}return e};var Se=function(e,r,n){r.$queuedListeners$=r.$queuedListeners$||[];var t=n.map((function(n){var t=n[0],a=n[1],i=n[2];var s=Re(e,t);var o=_e(r,i);var u=Le(t);c.ael(s,a,o,u);return function(){return c.rel(s,a,o,u)}}));return function(){return t.forEach((function(e){return e()}))}};var _e=function(e,r){return function(n){{if(e.$flags$&256){e.$lazyInstance$[r](n)}else{e.$queuedListeners$.push([r,n])}}}};var Re=function(e,r){if(r&8)return l;return e};var Le=function(e){return v?{passive:(e&1)!==0,capture:(e&2)!==0}:(e&2)!==0};var Ee=function(e,t,a,i,s){return __awaiter(n,void 0,void 0,(function(){var n,i,o,u,l,f,c;return __generator(this,(function($){switch($.label){case 0:if(!((t.$flags$&32)===0))return[3,5];t.$flags$|=32;s=S(a);if(!s.then)return[3,2];n=V();return[4,s];case 1:s=$.sent();n();$.label=2;case 2:if(!s.isProxied){we(s,a,2);s.isProxied=true}i=H("createInstance",a.$tagName$);{t.$flags$|=8}try{new s(t)}catch(v){b(v)}{t.$flags$&=~8}i();o=D(a.$tagName$);if(!(!_.has(o)&&s.style))return[3,5];u=H("registerStyles",a.$tagName$);l=s.style;if(!(a.$flags$&8))return[3,4];return[4,r.import("./p-ed968002.system.js").then((function(e){return e.scopeCss(l,o,false)}))];case 3:l=$.sent();$.label=4;case 4:F(o,l,!!(a.$flags$&1));u();$.label=5;case 5:f=t.$ancestorComponent$;c=function(){return ce(e,t,a,true)};if(f&&f["s-rc"]){f["s-rc"].push(c)}else{c()}return[2]}}))}))};var je=function(e,r){if((c.$flags$&1)===0){var n=H("connectedCallback",r.$tagName$);var t=m(e);if(r.$listeners$){t.$rmListeners$=Se(e,t,r.$listeners$)}if(!(t.$flags$&1)){t.$flags$|=1;{var a=e;while(a=a.parentNode||a.host){if(a["s-p"]){fe(t,t.$ancestorComponent$=a);break}}}if(r.$members$){Object.entries(r.$members$).forEach((function(r){var n=r[0],t=r[1][0];if(t&31&&e.hasOwnProperty(n)){var a=e[n];delete e[n];e[n]=a}}))}{x((function(){return Ee(e,t,r)}))}}n()}};var Ce=function(e){if((c.$flags$&1)===0){var r=m(e);{if(r.$rmListeners$){r.$rmListeners$();r.$rmListeners$=undefined}}if(c.$cssShim$){c.$cssShim$.removeHost(e)}}};var Ne=e("b",(function(e,r){if(r===void 0){r={}}var n=H();var t=[];var a=r.exclude||[];var i=f.head;var s=l.customElements;var o=i.querySelector("meta[charset]");var u=f.createElement("style");var v=[];var h;var d=true;Object.assign(c,r);c.$resourcesUrl$=new URL(r.resourcesUrl||"./",f.baseURI).href;if(r.syncQueue){c.$flags$|=4}e.forEach((function(e){return e[1].forEach((function(r){var n={$flags$:r[0],$tagName$:r[1],$members$:r[2],$listeners$:r[3]};{n.$members$=r[2]}{n.$listeners$=r[3]}if(!$&&n.$flags$&1){n.$flags$|=8}var i=n.$tagName$;var o=function(e){__extends(r,e);function r(r){var t=e.call(this,r)||this;r=t;g(r);if(n.$flags$&1){if($){{r.attachShadow({mode:"open"})}}else if(!("shadowRoot"in r)){r.shadowRoot=r}}return t}r.prototype.connectedCallback=function(){var e=this;if(h){clearTimeout(h);h=null}if(d){v.push(this)}else{c.jmp((function(){return je(e,n)}))}};r.prototype.disconnectedCallback=function(){var e=this;c.jmp((function(){return Ce(e)}))};r.prototype.forceUpdate=function(){de(this,n)};r.prototype.componentOnReady=function(){return m(this).$onReadyPromise$};return r}(HTMLElement);n.$lazyBundleIds$=e[0];if(!a.includes(i)&&!s.get(i)){t.push(i);s.define(i,we(o,n,1))}}))}));u.innerHTML=t+"{visibility:hidden}.hydrated{visibility:inherit}";u.setAttribute("data-styles","");i.insertBefore(u,o?o.nextSibling:i.firstChild);d=false;if(v.length>0){v.forEach((function(e){return e.connectedCallback()}))}else{c.jmp((function(){return h=setTimeout(me,30,"timeout")}))}n()}));var Pe=e("c",(function(e,r,n){var t=xe(e);return{emit:function(e){var a=new CustomEvent(r,{bubbles:!!(n&4),composed:!!(n&2),cancelable:!!(n&1),detail:e});t.dispatchEvent(a);return a}}}));var xe=e("g",(function(e){return m(e).$hostElement$}))}}})); |
| var t,n,i,e,o,r;(function(){var t=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function n(n){var i=t.has(n);return n=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(n),!i&&n}function i(t){var n=t.isConnected;if(void 0!==n)return n;for(;t&&!(t.__CE_isImportDocument||t instanceof Document);)t=t.parentNode||(window.ShadowRoot&&t instanceof ShadowRoot?t.host:void 0);return!(!t||!(t.__CE_isImportDocument||t instanceof Document))}function e(t,n){for(;n&&n!==t&&!n.nextSibling;)n=n.parentNode;return n&&n!==t?n.nextSibling:null}function o(t,n,i){i=void 0===i?new Set:i;for(var r=t;r;){if(r.nodeType===Node.ELEMENT_NODE){var f=r;n(f);var s=f.localName;if("link"===s&&"import"===f.getAttribute("rel")){if((r=f.import)instanceof Node&&!i.has(r))for(i.add(r),r=r.firstChild;r;r=r.nextSibling)o(r,n,i);r=e(t,f);continue}if("template"===s){r=e(t,f);continue}if(f=f.__CE_shadowRoot)for(f=f.firstChild;f;f=f.nextSibling)o(f,n,i)}r=r.firstChild?r.firstChild:e(t,r)}}function r(t,n,i){t[n]=i}function f(){this.a=new Map,this.g=new Map,this.c=[],this.f=[],this.b=!1}function s(t,n){t.b&&o(n,(function(n){return c(t,n)}))}function c(t,n){if(t.b&&!n.__CE_patched){n.__CE_patched=!0;for(var i=0;i<t.c.length;i++)t.c[i](n);for(i=0;i<t.f.length;i++)t.f[i](n)}}function u(t,n){var i=[];for(o(n,(function(t){return i.push(t)})),n=0;n<i.length;n++){var e=i[n];1===e.__CE_state?t.connectedCallback(e):l(t,e)}}function a(t,n){var i=[];for(o(n,(function(t){return i.push(t)})),n=0;n<i.length;n++){var e=i[n];1===e.__CE_state&&t.disconnectedCallback(e)}}function h(t,n,i){var e=(i=void 0===i?{}:i).u||new Set,r=i.i||function(n){return l(t,n)},f=[];if(o(n,(function(n){if("link"===n.localName&&"import"===n.getAttribute("rel")){var i=n.import;i instanceof Node&&(i.__CE_isImportDocument=!0,i.__CE_hasRegistry=!0),i&&"complete"===i.readyState?i.__CE_documentLoadHandled=!0:n.addEventListener("load",(function(){var i=n.import;if(!i.__CE_documentLoadHandled){i.__CE_documentLoadHandled=!0;var o=new Set(e);o.delete(i),h(t,i,{u:o,i:r})}}))}else f.push(n)}),e),t.b)for(n=0;n<f.length;n++)c(t,f[n]);for(n=0;n<f.length;n++)r(f[n])}function l(t,n){if(void 0===n.__CE_state){var e=n.ownerDocument;if((e.defaultView||e.__CE_isImportDocument&&e.__CE_hasRegistry)&&(e=t.a.get(n.localName))){e.constructionStack.push(n);var o=e.constructorFunction;try{try{if(new o!==n)throw Error("The custom element constructor did not produce the element being upgraded.")}finally{e.constructionStack.pop()}}catch(s){throw n.__CE_state=2,s}if(n.__CE_state=1,n.__CE_definition=e,e.attributeChangedCallback)for(e=e.observedAttributes,o=0;o<e.length;o++){var r=e[o],f=n.getAttribute(r);null!==f&&t.attributeChangedCallback(n,r,null,f,null)}i(n)&&t.connectedCallback(n)}}}function d(t){var n=document;this.c=t,this.a=n,this.b=void 0,h(this.c,this.a),"loading"===this.a.readyState&&(this.b=new MutationObserver(this.f.bind(this)),this.b.observe(this.a,{childList:!0,subtree:!0}))}function w(t){t.b&&t.b.disconnect()}function v(){var t=this;this.b=this.a=void 0,this.c=new Promise((function(n){t.b=n,t.a&&n(t.a)}))}function m(t){if(t.a)throw Error("Already resolved.");t.a=void 0,t.b&&t.b(void 0)}function b(t){this.c=!1,this.a=t,this.j=new Map,this.f=function(t){return t()},this.b=!1,this.g=[],this.o=new d(t)}f.prototype.connectedCallback=function(t){var n=t.__CE_definition;n.connectedCallback&&n.connectedCallback.call(t)},f.prototype.disconnectedCallback=function(t){var n=t.__CE_definition;n.disconnectedCallback&&n.disconnectedCallback.call(t)},f.prototype.attributeChangedCallback=function(t,n,i,e,o){var r=t.__CE_definition;r.attributeChangedCallback&&-1<r.observedAttributes.indexOf(n)&&r.attributeChangedCallback.call(t,n,i,e,o)},d.prototype.f=function(t){var n=this.a.readyState;for("interactive"!==n&&"complete"!==n||w(this),n=0;n<t.length;n++)for(var i=t[n].addedNodes,e=0;e<i.length;e++)h(this.c,i[e])},b.prototype.l=function(t,i){var e=this;if(!(i instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!n(t))throw new SyntaxError("The element name '"+t+"' is not valid.");if(this.a.a.get(t))throw Error("A custom element with name '"+t+"' has already been defined.");if(this.c)throw Error("A custom element is already being defined.");this.c=!0;try{var o=function(t){var n=r[t];if(void 0!==n&&!(n instanceof Function))throw Error("The '"+t+"' callback must be a function.");return n},r=i.prototype;if(!(r instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");var f=o("connectedCallback"),s=o("disconnectedCallback"),c=o("adoptedCallback"),u=o("attributeChangedCallback"),a=i.observedAttributes||[]}catch(d){return}finally{this.c=!1}(function(t,n,i){t.a.set(n,i),t.g.set(i.constructorFunction,i)})(this.a,t,i={localName:t,constructorFunction:i,connectedCallback:f,disconnectedCallback:s,adoptedCallback:c,attributeChangedCallback:u,observedAttributes:a,constructionStack:[]}),this.g.push(i),this.b||(this.b=!0,this.f((function(){return function(t){if(!1!==t.b){t.b=!1;for(var n=t.g,i=[],e=new Map,o=0;o<n.length;o++)e.set(n[o].localName,[]);for(h(t.a,document,{i:function(n){if(void 0===n.__CE_state){var o=n.localName,r=e.get(o);r?r.push(n):t.a.a.get(o)&&i.push(n)}}}),o=0;o<i.length;o++)l(t.a,i[o]);for(;0<n.length;){var r=n.shift();o=r.localName,r=e.get(r.localName);for(var f=0;f<r.length;f++)l(t.a,r[f]);(o=t.j.get(o))&&m(o)}}}(e)})))},b.prototype.i=function(t){h(this.a,t)},b.prototype.get=function(t){if(t=this.a.a.get(t))return t.constructorFunction},b.prototype.m=function(t){if(!n(t))return Promise.reject(new SyntaxError("'"+t+"' is not a valid custom element name."));var i=this.j.get(t);return i?i.c:(i=new v,this.j.set(t,i),this.a.a.get(t)&&!this.g.some((function(n){return n.localName===t}))&&m(i),i.c)},b.prototype.s=function(t){w(this.o);var n=this.f;this.f=function(i){return t((function(){return n(i)}))}},window.CustomElementRegistry=b,b.prototype.define=b.prototype.l,b.prototype.upgrade=b.prototype.i,b.prototype.get=b.prototype.get,b.prototype.whenDefined=b.prototype.m,b.prototype.polyfillWrapFlushCallback=b.prototype.s;var E=window.Document.prototype.createElement,p=window.Document.prototype.createElementNS,g=window.Document.prototype.importNode,y=window.Document.prototype.prepend,C=window.Document.prototype.append,T=window.DocumentFragment.prototype.prepend,j=window.DocumentFragment.prototype.append,D=window.Node.prototype.cloneNode,N=window.Node.prototype.appendChild,A=window.Node.prototype.insertBefore,O=window.Node.prototype.removeChild,M=window.Node.prototype.replaceChild,S=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),k=window.Element.prototype.attachShadow,L=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),F=window.Element.prototype.getAttribute,H=window.Element.prototype.setAttribute,x=window.Element.prototype.removeAttribute,z=window.Element.prototype.getAttributeNS,P=window.Element.prototype.setAttributeNS,R=window.Element.prototype.removeAttributeNS,$=window.Element.prototype.insertAdjacentElement,_=window.Element.prototype.insertAdjacentHTML,B=window.Element.prototype.prepend,I=window.Element.prototype.append,U=window.Element.prototype.before,W=window.Element.prototype.after,q=window.Element.prototype.replaceWith,G=window.Element.prototype.remove,J=window.HTMLElement,K=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),Q=window.HTMLElement.prototype.insertAdjacentElement,V=window.HTMLElement.prototype.insertAdjacentHTML,X=new function(){};function Y(t,n,e){function o(n){return function(e){for(var o=[],r=0;r<arguments.length;++r)o[r]=arguments[r];r=[];for(var f=[],s=0;s<o.length;s++){var c=o[s];if(c instanceof Element&&i(c)&&f.push(c),c instanceof DocumentFragment)for(c=c.firstChild;c;c=c.nextSibling)r.push(c);else r.push(c)}for(n.apply(this,o),o=0;o<f.length;o++)a(t,f[o]);if(i(this))for(o=0;o<r.length;o++)(f=r[o])instanceof Element&&u(t,f)}}void 0!==e.h&&(n.prepend=o(e.h)),void 0!==e.append&&(n.append=o(e.append))}var Z,tt=window.customElements;if(!tt||tt.forcePolyfill||"function"!=typeof tt.define||"function"!=typeof tt.get){var nt=new f;Z=nt,window.HTMLElement=function(){function t(){var t=this.constructor,n=Z.g.get(t);if(!n)throw Error("The custom element being constructed was not registered with `customElements`.");var i=n.constructionStack;if(0===i.length)return i=E.call(document,n.localName),Object.setPrototypeOf(i,t.prototype),i.__CE_state=1,i.__CE_definition=n,c(Z,i),i;var e=i[n=i.length-1];if(e===X)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.");return i[n]=X,Object.setPrototypeOf(e,t.prototype),c(Z,e),e}return t.prototype=J.prototype,Object.defineProperty(t.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:t}),t}(),function(){var t=nt;r(Document.prototype,"createElement",(function(n){if(this.__CE_hasRegistry){var i=t.a.get(n);if(i)return new i.constructorFunction}return n=E.call(this,n),c(t,n),n})),r(Document.prototype,"importNode",(function(n,i){return n=g.call(this,n,!!i),this.__CE_hasRegistry?h(t,n):s(t,n),n})),r(Document.prototype,"createElementNS",(function(n,i){if(this.__CE_hasRegistry&&(null===n||"http://www.w3.org/1999/xhtml"===n)){var e=t.a.get(i);if(e)return new e.constructorFunction}return n=p.call(this,n,i),c(t,n),n})),Y(t,Document.prototype,{h:y,append:C})}(),Y(nt,DocumentFragment.prototype,{h:T,append:j}),function(){function t(t,e){Object.defineProperty(t,"textContent",{enumerable:e.enumerable,configurable:!0,get:e.get,set:function(t){if(this.nodeType===Node.TEXT_NODE)e.set.call(this,t);else{var o=void 0;if(this.firstChild){var r=this.childNodes,f=r.length;if(0<f&&i(this)){o=Array(f);for(var s=0;s<f;s++)o[s]=r[s]}}if(e.set.call(this,t),o)for(t=0;t<o.length;t++)a(n,o[t])}}})}var n=nt;r(Node.prototype,"insertBefore",(function(t,e){if(t instanceof DocumentFragment){var o=Array.prototype.slice.apply(t.childNodes);if(t=A.call(this,t,e),i(this))for(e=0;e<o.length;e++)u(n,o[e]);return t}return o=i(t),e=A.call(this,t,e),o&&a(n,t),i(this)&&u(n,t),e})),r(Node.prototype,"appendChild",(function(t){if(t instanceof DocumentFragment){var e=Array.prototype.slice.apply(t.childNodes);if(t=N.call(this,t),i(this))for(var o=0;o<e.length;o++)u(n,e[o]);return t}return e=i(t),o=N.call(this,t),e&&a(n,t),i(this)&&u(n,t),o})),r(Node.prototype,"cloneNode",(function(t){return t=D.call(this,!!t),this.ownerDocument.__CE_hasRegistry?h(n,t):s(n,t),t})),r(Node.prototype,"removeChild",(function(t){var e=i(t),o=O.call(this,t);return e&&a(n,t),o})),r(Node.prototype,"replaceChild",(function(t,e){if(t instanceof DocumentFragment){var o=Array.prototype.slice.apply(t.childNodes);if(t=M.call(this,t,e),i(this))for(a(n,e),e=0;e<o.length;e++)u(n,o[e]);return t}o=i(t);var r=M.call(this,t,e),f=i(this);return f&&a(n,e),o&&a(n,t),f&&u(n,t),r})),S&&S.get?t(Node.prototype,S):function(t,n){t.b=!0,t.c.push(n)}(n,(function(n){t(n,{enumerable:!0,configurable:!0,get:function(){for(var t=[],n=0;n<this.childNodes.length;n++){var i=this.childNodes[n];i.nodeType!==Node.COMMENT_NODE&&t.push(i.textContent)}return t.join("")},set:function(t){for(;this.firstChild;)O.call(this,this.firstChild);null!=t&&""!==t&&N.call(this,document.createTextNode(t))}})}))}(),function(){function t(t,n){Object.defineProperty(t,"innerHTML",{enumerable:n.enumerable,configurable:!0,get:n.get,set:function(t){var e=this,r=void 0;if(i(this)&&(r=[],o(this,(function(t){t!==e&&r.push(t)}))),n.set.call(this,t),r)for(var c=0;c<r.length;c++){var u=r[c];1===u.__CE_state&&f.disconnectedCallback(u)}return this.ownerDocument.__CE_hasRegistry?h(f,this):s(f,this),t}})}function n(t,n){r(t,"insertAdjacentElement",(function(t,e){var o=i(e);return t=n.call(this,t,e),o&&a(f,e),i(t)&&u(f,e),t}))}function e(t,n){function i(t,n){for(var i=[];t!==n;t=t.nextSibling)i.push(t);for(n=0;n<i.length;n++)h(f,i[n])}r(t,"insertAdjacentHTML",(function(t,e){if("beforebegin"===(t=t.toLowerCase())){var o=this.previousSibling;n.call(this,t,e),i(o||this.parentNode.firstChild,this)}else if("afterbegin"===t)o=this.firstChild,n.call(this,t,e),i(this.firstChild,o);else if("beforeend"===t)o=this.lastChild,n.call(this,t,e),i(o||this.firstChild,null);else{if("afterend"!==t)throw new SyntaxError("The value provided ("+String(t)+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");o=this.nextSibling,n.call(this,t,e),i(this.nextSibling,o)}}))}var f=nt;k&&r(Element.prototype,"attachShadow",(function(t){t=k.call(this,t);var n=f;if(n.b&&!t.__CE_patched){t.__CE_patched=!0;for(var i=0;i<n.c.length;i++)n.c[i](t)}return this.__CE_shadowRoot=t})),L&&L.get?t(Element.prototype,L):K&&K.get?t(HTMLElement.prototype,K):function(t,n){t.b=!0,t.f.push(n)}(f,(function(n){t(n,{enumerable:!0,configurable:!0,get:function(){return D.call(this,!0).innerHTML},set:function(t){var n="template"===this.localName,i=n?this.content:this,e=p.call(document,this.namespaceURI,this.localName);for(e.innerHTML=t;0<i.childNodes.length;)O.call(i,i.childNodes[0]);for(t=n?e.content:e;0<t.childNodes.length;)N.call(i,t.childNodes[0])}})})),r(Element.prototype,"setAttribute",(function(t,n){if(1!==this.__CE_state)return H.call(this,t,n);var i=F.call(this,t);H.call(this,t,n),n=F.call(this,t),f.attributeChangedCallback(this,t,i,n,null)})),r(Element.prototype,"setAttributeNS",(function(t,n,i){if(1!==this.__CE_state)return P.call(this,t,n,i);var e=z.call(this,t,n);P.call(this,t,n,i),i=z.call(this,t,n),f.attributeChangedCallback(this,n,e,i,t)})),r(Element.prototype,"removeAttribute",(function(t){if(1!==this.__CE_state)return x.call(this,t);var n=F.call(this,t);x.call(this,t),null!==n&&f.attributeChangedCallback(this,t,n,null,null)})),r(Element.prototype,"removeAttributeNS",(function(t,n){if(1!==this.__CE_state)return R.call(this,t,n);var i=z.call(this,t,n);R.call(this,t,n);var e=z.call(this,t,n);i!==e&&f.attributeChangedCallback(this,n,i,e,t)})),Q?n(HTMLElement.prototype,Q):$?n(Element.prototype,$):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched."),V?e(HTMLElement.prototype,V):_?e(Element.prototype,_):console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched."),Y(f,Element.prototype,{h:B,append:I}),function(t){function n(n){return function(e){for(var o=[],r=0;r<arguments.length;++r)o[r]=arguments[r];r=[];for(var f=[],s=0;s<o.length;s++){var c=o[s];if(c instanceof Element&&i(c)&&f.push(c),c instanceof DocumentFragment)for(c=c.firstChild;c;c=c.nextSibling)r.push(c);else r.push(c)}for(n.apply(this,o),o=0;o<f.length;o++)a(t,f[o]);if(i(this))for(o=0;o<r.length;o++)(f=r[o])instanceof Element&&u(t,f)}}var e=Element.prototype;void 0!==U&&(e.before=n(U)),void 0!==U&&(e.after=n(W)),void 0!==q&&r(e,"replaceWith",(function(n){for(var e=[],o=0;o<arguments.length;++o)e[o]=arguments[o];o=[];for(var r=[],f=0;f<e.length;f++){var s=e[f];if(s instanceof Element&&i(s)&&r.push(s),s instanceof DocumentFragment)for(s=s.firstChild;s;s=s.nextSibling)o.push(s);else o.push(s)}for(f=i(this),q.apply(this,e),e=0;e<r.length;e++)a(t,r[e]);if(f)for(a(t,this),e=0;e<o.length;e++)(r=o[e])instanceof Element&&u(t,r)})),void 0!==G&&r(e,"remove",(function(){var n=i(this);G.call(this),n&&a(t,this)}))}(f)}(),document.__CE_hasRegistry=!0;var it=new b(nt);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:it})}}).call(self),"string"!=typeof document.baseURI&&Object.defineProperty(Document.prototype,"baseURI",{enumerable:!0,configurable:!0,get:function(){var t=document.querySelector("base");return t&&t.href?t.href:document.URL}}),"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(t,n){n=n||{bubbles:!1,cancelable:!1,detail:void 0};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,n.bubbles,n.cancelable,n.detail),i},window.CustomEvent.prototype=window.Event.prototype),t=Event.prototype,n=document,i=window,t.composedPath||(t.composedPath=function(){if(this.path)return this.path;var t=this.target;for(this.path=[];null!==t.parentNode;)this.path.push(t),t=t.parentNode;return this.path.push(n,i),this.path}),"function"!=typeof( | ||
| /*! | ||
| Element.closest and Element.matches | ||
| https://github.com/jonathantneal/closest | ||
| Creative Commons Zero v1.0 Universal | ||
| */ | ||
| e=window.Element.prototype).matches&&(e.matches=e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||function(t){t=(this.document||this.ownerDocument).querySelectorAll(t);for(var n=0;t[n]&&t[n]!==this;)++n;return!!t[n]}),"function"!=typeof e.closest&&(e.closest=function(t){for(var n=this;n&&1===n.nodeType;){if(n.matches(t))return n;n=n.parentNode}return null}), | ||
| /*! | ||
| Element.getRootNode() | ||
| */ | ||
| function(t){function n(t){return t&&t.parentNode?n(t.parentNode):t}"function"!=typeof t.getRootNode&&(t.getRootNode=function(t){return t&&t.composed?function t(i){return(i=n(i))&&11===i.nodeType?t(i.host):i}(this):n(this)})}(Element.prototype),"isConnected"in( | ||
| /*! | ||
| Element.isConnected() | ||
| */ | ||
| o=Element.prototype)||Object.defineProperty(o,"isConnected",{configurable:!0,enumerable:!0,get:function(){var t=this.getRootNode({composed:!0});return t&&9===t.nodeType}}),[Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach((function(t){t.hasOwnProperty("remove")||Object.defineProperty(t,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this)}})})),"classList"in(r=Element.prototype)||Object.defineProperty(r,"classList",{get:function(){var t=this,n=(t.getAttribute("class")||"").replace(/^\s+|\s$/g,"").split(/\s+/g);function i(){n.length>0?t.setAttribute("class",n.join(" ")):t.removeAttribute("class")}return""===n[0]&&n.splice(0,1),n.toggle=function(t,e){void 0!==e?e?n.add(t):n.remove(t):-1!==n.indexOf(t)?n.splice(n.indexOf(t),1):n.push(t),i()},n.add=function(){for(var t=[].slice.call(arguments),e=0,o=t.length;e<o;e++)-1===n.indexOf(t[e])&&n.push(t[e]);i()},n.remove=function(){for(var t=[].slice.call(arguments),e=0,o=t.length;e<o;e++)-1!==n.indexOf(t[e])&&n.splice(n.indexOf(t[e]),1);i()},n.item=function(t){return n[t]},n.contains=function(t){return-1!==n.indexOf(t)},n.replace=function(t,e){-1!==n.indexOf(t)&&n.splice(n.indexOf(t),1,e),i()},n.value=t.getAttribute("class")||"",n}}), | ||
| /*! | ||
| DOMTokenList | ||
| */ | ||
| function(t){try{document.body.classList.add()}catch(r){var n=t.add,i=t.remove;t.add=function(){for(var t=0;t<arguments.length;t++)n.call(this,arguments[t])},t.remove=function(){for(var t=0;t<arguments.length;t++)i.call(this,arguments[t])}}}(DOMTokenList.prototype); |
| System.register([],(function(){"use strict";return{execute:function(){var t=function(){function t(){this.start=0;this.end=0;this.previous=null;this.parent=null;this.rules=null;this.parsedCssText="";this.cssText="";this.atRule=false;this.type=0;this.keyframesName="";this.selector="";this.parsedSelector=""}return t}();function e(t){t=r(t);return s(n(t),t)}function r(t){return t.replace(l.comments,"").replace(l.port,"")}function n(e){var r=new t;r["start"]=0;r["end"]=e.length;var n=r;for(var s=0,i=e.length;s<i;s++){if(e[s]===o){if(!n["rules"]){n["rules"]=[]}var a=n;var l=a["rules"][a["rules"].length-1]||null;n=new t;n["start"]=s+1;n["parent"]=a;n["previous"]=l;a["rules"].push(n)}else if(e[s]===u){n["end"]=s+1;n=n["parent"]||r}}return r}function s(t,e){var r=e.substring(t["start"],t["end"]-1);t["parsedCssText"]=t["cssText"]=r.trim();if(t.parent){var n=t.previous?t.previous["end"]:t.parent["start"];r=e.substring(n,t["start"]-1);r=i(r);r=r.replace(l.multipleSpaces," ");r=r.substring(r.lastIndexOf(";")+1);var o=t["parsedSelector"]=t["selector"]=r.trim();t["atRule"]=o.indexOf(p)===0;if(t["atRule"]){if(o.indexOf(f)===0){t["type"]=a.MEDIA_RULE}else if(o.match(l.keyframesRule)){t["type"]=a.KEYFRAMES_RULE;t["keyframesName"]=t["selector"].split(l.multipleSpaces).pop()}}else{if(o.indexOf(c)===0){t["type"]=a.MIXIN_RULE}else{t["type"]=a.STYLE_RULE}}}var u=t["rules"];if(u){for(var h=0,v=u.length,m=void 0;h<v&&(m=u[h]);h++){s(m,e)}}return t}function i(t){return t.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){var t=arguments[1],e=6-t.length;while(e--){t="0"+t}return"\\"+t}))}var a={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3};var o="{";var u="}";var l={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g};var c="--";var f="@media";var p="@";function h(t,e,r){t["lastIndex"]=0;var n=e.substring(r).match(t);if(n){var s=r+n["index"];return{start:s,end:s+n[0].length}}return null}var v=/\bvar\(/;var m=/\B--[\w-]+\s*:/;var d=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim;var g=/^[\t ]+\n/gm;function y(t,e,r){if(t[e]){return t[e]}if(r){return x(r,t)}return""}function S(t,e){var r=0;var n=e;for(;n<t.length;n++){var s=t[n];if(s==="("){r++}else if(s===")"){r--;if(r<=0){return n+1}}}return n}function b(t,e){var r=h(v,t,e);if(!r){return null}var n=S(t,r.start);var s=t.substring(r.end,n-1);var i=s.split(","),a=i[0],o=i.slice(1);return{start:r.start,end:n,propName:a.trim(),fallback:o.length>0?o.join(",").trim():undefined}}function E(t,e,r){var n=b(t,r);if(!n){e.push(t.substring(r,t.length));return t.length}var s=n.propName;var i=n.fallback!=null?C(n.fallback):undefined;e.push(t.substring(r,n.start),(function(t){return y(t,s,i)}));return n.end}function x(t,e){var r="";for(var n=0;n<t.length;n++){var s=t[n];r+=typeof s==="string"?s:s(e)}return r}function M(t,e){var r=false;var n=false;var s=e;for(;s<t.length;s++){var i=t[s];if(r){if(n&&i==='"'){r=false}if(!n&&i==="'"){r=false}}else{if(i==='"'){r=true;n=true}else if(i==="'"){r=true;n=false}else if(i===";"){return s+1}else if(i==="}"){return s}}}return s}function w(t){var e="";var r=0;while(true){var n=h(m,t,r);var s=n?n.start:t.length;e+=t.substring(r,s);if(n){r=M(t,s)}else{break}}return e}function C(t){var e=0;t=t.replace(d,"");t=w(t).replace(g,"");var r=[];while(e<t.length){e=E(t,r,e)}return r}function I(t){var e={};t.forEach((function(t){t.declarations.forEach((function(t){e[t.prop]=t.value}))}));var r={};var n=Object.entries(e);var s=function(t){var e=false;n.forEach((function(t){var n=t[0],s=t[1];var i=x(s,r);if(i!==r[n]){r[n]=i;e=true}}));if(!e){return"break"}};for(var i=0;i<10;i++){var a=s();if(a==="break")break}return r}function R(t,e){if(e===void 0){e=0}if(!t.rules){return[]}var r=[];t.rules.filter((function(t){return t.type===a.STYLE_RULE})).forEach((function(t){var n=A(t.cssText);if(n.length>0){t.parsedSelector.split(",").forEach((function(t){t=t.trim();r.push({selector:t,declarations:n,specificity:k(),nu:e})}))}e++}));return r}function k(t){return 1}var _="!important";var L=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function A(t){var e=[];var r;while(r=L.exec(t.trim())){var n=O(r[2]),s=n.value,i=n.important;e.push({prop:r[1].trim(),value:C(s),important:i})}return e}function O(t){var e=/\s+/gim;t=t.replace(e," ").trim();var r=t.endsWith(_);if(r){t=t.substr(0,t.length-_.length).trim()}return{value:t,important:r}}function T(t,e,r){var n=[];var s=U(e,t);r.forEach((function(t){return n.push(t)}));s.forEach((function(t){return n.push(t)}));var i=N(n);var a=i.filter((function(e){return $(t,e.selector)}));return j(a)}function U(t,e){var r=[];while(e){var n=t.get(e);if(n){r.push(n)}e=e.parentElement}return r}function N(t){var e=[];t.forEach((function(t){e.push.apply(e,t.selectors)}));return e}function j(t){t.sort((function(t,e){if(t.specificity===e.specificity){return t.nu-e.nu}return t.specificity-e.specificity}));return t}function $(t,e){return e===":root"||e==="html"||t.matches(e)}function G(t){var r=e(t);var n=C(t);var s=R(r);return{original:t,template:n,selectors:s,usesCssVars:n.length>1}}function H(t,e){if(t.some((function(t){return t.styleEl===e}))){return false}var r=G(e.textContent);r.styleEl=e;t.push(r);return true}function P(t){var e=N(t);var r=I(e);t.forEach((function(t){if(t.usesCssVars){t.styleEl.textContent=x(t.template,r)}}))}function V(t,e){var r=t.template.map((function(r){return typeof r==="string"?Y(r,t.scopeId,e):r}));var n=t.selectors.map((function(r){return Object.assign(Object.assign({},r),{selector:Y(r.selector,t.scopeId,e)})}));return Object.assign(Object.assign({},t),{template:r,selectors:n,scopeId:e})}function Y(t,e,r){t=q(t,"\\."+e,"."+r);return t}function q(t,e,r){return t.replace(new RegExp(e,"g"),r)}function B(t,e){D(t,e);return W(t,e).then((function(){P(e)}))}function F(t,e){var r=new MutationObserver((function(){if(D(t,e)){P(e)}}));r.observe(document.head,{childList:true})}function W(t,e){var r=[];var n=t.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])');for(var s=0;s<n.length;s++){r.push(K(t,e,n[s]))}return Promise.all(r)}function D(t,e){var r=Array.from(t.querySelectorAll("style:not([data-styles]):not([data-no-shim])"));return r.map((function(t){return H(e,t)})).some(Boolean)}function K(t,e,r){var n=r.href;return fetch(n).then((function(t){return t.text()})).then((function(s){if(z(s)&&r.parentNode){if(J(s)){s=Q(s,n)}var i=t.createElement("style");i.setAttribute("data-styles","");i.textContent=s;H(e,i);r.parentNode.insertBefore(i,r);r.remove()}})).catch((function(t){console.error(t)}))}var X=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function z(t){return t.indexOf("var(")>-1||X.test(t)}var Z=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function J(t){Z.lastIndex=0;return Z.test(t)}function Q(t,e){var r=e.replace(/[^/]*$/,"");return t.replace(Z,(function(t,e){var n=r+e;return t.replace(e,n)}))}var tt=function(){function t(t,e){this.win=t;this.doc=e;this.count=0;this.hostStyleMap=new WeakMap;this.hostScopeMap=new WeakMap;this.globalScopes=[];this.scopesMap=new Map;this.didInit=false}t.prototype.initShim=function(){var t=this;if(this.didInit){return Promise.resolve()}else{this.didInit=true;return new Promise((function(e){t.win.requestAnimationFrame((function(){F(t.doc,t.globalScopes);B(t.doc,t.globalScopes).then((function(){return e()}))}))}))}};t.prototype.addLink=function(t){var e=this;return K(this.doc,this.globalScopes,t).then((function(){e.updateGlobal()}))};t.prototype.addGlobalStyle=function(t){if(H(this.globalScopes,t)){this.updateGlobal()}};t.prototype.createHostStyle=function(t,e,r,n){if(this.hostScopeMap.has(t)){throw new Error("host style already created")}var s=this.registerHostTemplate(r,e,n);var i=this.doc.createElement("style");i.setAttribute("data-no-shim","");if(!s.usesCssVars){i.textContent=r}else if(n){i["s-sc"]=e=s.scopeId+"-"+this.count;i.textContent="/*needs update*/";this.hostStyleMap.set(t,i);this.hostScopeMap.set(t,V(s,e));this.count++}else{s.styleEl=i;if(!s.usesCssVars){i.textContent=x(s.template,{})}this.globalScopes.push(s);this.updateGlobal();this.hostScopeMap.set(t,s)}return i};t.prototype.removeHost=function(t){var e=this.hostStyleMap.get(t);if(e){e.remove()}this.hostStyleMap.delete(t);this.hostScopeMap.delete(t)};t.prototype.updateHost=function(t){var e=this.hostScopeMap.get(t);if(e&&e.usesCssVars&&e.isScoped){var r=this.hostStyleMap.get(t);if(r){var n=T(t,this.hostScopeMap,this.globalScopes);var s=I(n);r.textContent=x(e.template,s)}}};t.prototype.updateGlobal=function(){P(this.globalScopes)};t.prototype.registerHostTemplate=function(t,e,r){var n=this.scopesMap.get(e);if(!n){n=G(t);n.scopeId=e;n.isScoped=r;this.scopesMap.set(e,n)}return n};return t}();var et=window;function rt(){return!(et.CSS&&et.CSS.supports&&et.CSS.supports("color","var(--c)"))}if(!et.__stencil_cssshim&&rt()){et.__stencil_cssshim=new tt(et,document)}}}})); |
| System.register(["./p-20b31ffb.system.js"],(function(){"use strict";var e,t;return{setters:[function(n){e=n.p;t=n.b}],execute:function(){e().then((function(e){return t([["p-9zybx1zw.system",[[1,"ms-editor",{token:[1],config:[8],content:[1],modalOpen:[32],save:[64],test:[64],spinner:[64],start:[64],sendTest:[64],beforeUnload:[64],load:[64],preview:[64]},[[8,"message","componentWillLoad"]]]]]],e)}))}}})); |
| var n=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};var t={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},r="{",i="}",e={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},u="--",o="@media",s="@";function a(n,t,r){n.lastIndex=0;var i=t.substring(r).match(n);if(i){var e=r+i.index;return{start:e,end:e+i[0].length}}return null}var f=/\bvar\(/,c=/\B--[\w-]+\s*:/,v=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,h=/^[\t ]+\n/gm;function l(n,t,r){var i=function(n,t){var r=a(f,n,t);if(!r)return null;var i=function(n,t){for(var r=0,i=t;i<n.length;i++){var e=n[i];if("("===e)r++;else if(")"===e&&--r<=0)return i+1}return i}(n,r.start),e=n.substring(r.end,i-1).split(","),u=e[0],o=e.slice(1);return{start:r.start,end:i,propName:u.trim(),fallback:o.length>0?o.join(",").trim():void 0}}(n,r);if(!i)return t.push(n.substring(r,n.length)),n.length;var e=i.propName,u=null!=i.fallback?d(i.fallback):void 0;return t.push(n.substring(r,i.start),(function(n){return function(n,t,r){return n[t]?n[t]:r?m(r,n):""}(n,e,u)})),i.end}function m(n,t){for(var r="",i=0;i<n.length;i++){var e=n[i];r+="string"==typeof e?e:e(t)}return r}function p(n,t){for(var r=!1,i=!1,e=t;e<n.length;e++){var u=n[e];if(r)i&&'"'===u&&(r=!1),i||"'"!==u||(r=!1);else if('"'===u)r=!0,i=!0;else if("'"===u)r=!0,i=!1;else{if(";"===u)return e+1;if("}"===u)return e}}return e}function d(n){var t=0;n=function(n){for(var t="",r=0;;){var i=a(c,n,r),e=i?i.start:n.length;if(t+=n.substring(r,e),!i)break;r=p(n,e)}return t}(n=n.replace(v,"")).replace(h,"");for(var r=[];t<n.length;)t=l(n,r,t);return r}function g(n){var t={};n.forEach((function(n){n.declarations.forEach((function(n){t[n.prop]=n.value}))}));for(var r={},i=Object.entries(t),e=function(){var n=!1;if(i.forEach((function(t){var i=t[0],e=m(t[1],r);e!==r[i]&&(r[i]=e,n=!0)})),!n)return"break"},u=0;u<10&&"break"!==e();u++);return r}function y(n,r){if(void 0===r&&(r=0),!n.rules)return[];var i=[];return n.rules.filter((function(n){return n.type===t.STYLE_RULE})).forEach((function(n){var t=function(n){for(var t,r=[];t=b.exec(n.trim());){var i=E(t[2]),e=i.value,u=i.important;r.push({prop:t[1].trim(),value:d(e),important:u})}return r}(n.cssText);t.length>0&&n.parsedSelector.split(",").forEach((function(n){n=n.trim(),i.push({selector:n,declarations:t,specificity:1,nu:r})})),r++})),i}var w="!important",b=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function E(n){var t=(n=n.replace(/\s+/gim," ").trim()).endsWith(w);return t&&(n=n.substr(0,n.length-w.length).trim()),{value:n,important:t}}function k(n){var t=[];return n.forEach((function(n){t.push.apply(t,n.selectors)})),t}function M(a){var f,c=function n(r,i){var a=i.substring(r.start,r.end-1);if(r.parsedCssText=r.cssText=a.trim(),r.parent){a=(a=(a=function(n){return n.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var n=arguments[1],t=6-n.length;t--;)n="0"+n;return"\\"+n}))}(a=i.substring(r.previous?r.previous.end:r.parent.start,r.start-1))).replace(e.multipleSpaces," ")).substring(a.lastIndexOf(";")+1);var f=r.parsedSelector=r.selector=a.trim();r.atRule=0===f.indexOf(s),r.atRule?0===f.indexOf(o)?r.type=t.MEDIA_RULE:f.match(e.keyframesRule)&&(r.type=t.KEYFRAMES_RULE,r.keyframesName=r.selector.split(e.multipleSpaces).pop()):r.type=0===f.indexOf(u)?t.MIXIN_RULE:t.STYLE_RULE}var c=r.rules;if(c)for(var v=0,h=c.length,l=void 0;v<h&&(l=c[v]);v++)n(l,i);return r}(function(t){var e=new n;e.start=0,e.end=t.length;for(var u=e,o=0,s=t.length;o<s;o++)if(t[o]===r){u.rules||(u.rules=[]);var a=u,f=a.rules[a.rules.length-1]||null;(u=new n).start=o+1,u.parent=a,u.previous=f,a.rules.push(u)}else t[o]===i&&(u.end=o+1,u=u.parent||e);return e}(f=(f=a).replace(e.comments,"").replace(e.port,"")),f),v=d(a);return{original:a,template:v,selectors:y(c),usesCssVars:v.length>1}}function R(n,t){if(n.some((function(n){return n.styleEl===t})))return!1;var r=M(t.textContent);return r.styleEl=t,n.push(r),!0}function A(n){var t=g(k(n));n.forEach((function(n){n.usesCssVars&&(n.styleEl.textContent=m(n.template,t))}))}function L(n,t,r){var i;return i="."+r,n.replace(new RegExp("\\."+t,"g"),i)}function O(n,t){return Array.from(n.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(n){return R(t,n)})).some(Boolean)}function $(n,t,r){var i=r.href;return fetch(i).then((function(n){return n.text()})).then((function(e){if(((o=e).indexOf("var(")>-1||j.test(o))&&r.parentNode){(function(n){return P.lastIndex=0,P.test(n)})(e)&&(e=function(n,t){var r=t.replace(/[^/]*$/,"");return n.replace(P,(function(n,t){return n.replace(t,r+t)}))}(e,i));var u=n.createElement("style");u.setAttribute("data-styles",""),u.textContent=e,R(t,u),r.parentNode.insertBefore(u,r),r.remove()}var o})).catch((function(n){console.error(n)}))}var j=/[\s;{]--[-a-zA-Z0-9]+\s*:/m,P=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim,I=function(){function n(n,t){this.win=n,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return n.prototype.initShim=function(){var n=this;return this.didInit?Promise.resolve():(this.didInit=!0,new Promise((function(t){n.win.requestAnimationFrame((function(){var r,i;r=n.doc,i=n.globalScopes,new MutationObserver((function(){O(r,i)&&A(i)})).observe(document.head,{childList:!0}),function(n,t){return O(n,t),function(n,t){for(var r=[],i=n.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),e=0;e<i.length;e++)r.push($(n,t,i[e]));return Promise.all(r)}(n,t).then((function(){A(t)}))}(n.doc,n.globalScopes).then((function(){return t()}))}))})))},n.prototype.addLink=function(n){var t=this;return $(this.doc,this.globalScopes,n).then((function(){t.updateGlobal()}))},n.prototype.addGlobalStyle=function(n){R(this.globalScopes,n)&&this.updateGlobal()},n.prototype.createHostStyle=function(n,t,r,i){if(this.hostScopeMap.has(n))throw new Error("host style already created");var e,u,o,s,a=this.registerHostTemplate(r,t,i),f=this.doc.createElement("style");return f.setAttribute("data-no-shim",""),a.usesCssVars?i?(f["s-sc"]=t=a.scopeId+"-"+this.count,f.textContent="/*needs update*/",this.hostStyleMap.set(n,f),this.hostScopeMap.set(n,(u=t,o=(e=a).template.map((function(n){return"string"==typeof n?L(n,e.scopeId,u):n})),s=e.selectors.map((function(n){return Object.assign(Object.assign({},n),{selector:L(n.selector,e.scopeId,u)})})),Object.assign(Object.assign({},e),{template:o,selectors:s,scopeId:u}))),this.count++):(a.styleEl=f,a.usesCssVars||(f.textContent=m(a.template,{})),this.globalScopes.push(a),this.updateGlobal(),this.hostScopeMap.set(n,a)):f.textContent=r,f},n.prototype.removeHost=function(n){var t=this.hostStyleMap.get(n);t&&t.remove(),this.hostStyleMap.delete(n),this.hostScopeMap.delete(n)},n.prototype.updateHost=function(n){var t=this.hostScopeMap.get(n);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(n);if(r){var i=g(function(n,t,r){var i,e=[],u=function(n,t){for(var r=[];t;){var i=n.get(t);i&&r.push(i),t=t.parentElement}return r}(t,n);return r.forEach((function(n){return e.push(n)})),u.forEach((function(n){return e.push(n)})),(i=k(e).filter((function(t){return function(n,t){return":root"===t||"html"===t||n.matches(t)}(n,t.selector)}))).sort((function(n,t){return n.specificity===t.specificity?n.nu-t.nu:n.specificity-t.specificity})),i}(n,this.hostScopeMap,this.globalScopes));r.textContent=m(t.template,i)}}},n.prototype.updateGlobal=function(){A(this.globalScopes)},n.prototype.registerHostTemplate=function(n,t,r){var i=this.scopesMap.get(t);return i||((i=M(n)).scopeId=t,i.isScoped=r,this.scopesMap.set(t,i)),i},n}(),U=window;U.__stencil_cssshim||U.CSS&&U.CSS.supports&&U.CSS.supports("color","var(--c)")||(U.__stencil_cssshim=new I(U,document)); |
| System.register([],(function(){"use strict";return{execute:function(){(function(){var t=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function e(e){var n=t.has(e);e=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(e);return!n&&e}function n(t){var e=t.isConnected;if(void 0!==e)return e;for(;t&&!(t.__CE_isImportDocument||t instanceof Document);)t=t.parentNode||(window.ShadowRoot&&t instanceof ShadowRoot?t.host:void 0);return!(!t||!(t.__CE_isImportDocument||t instanceof Document))}function o(t,e){for(;e&&e!==t&&!e.nextSibling;)e=e.parentNode;return e&&e!==t?e.nextSibling:null}function i(t,e,n){n=void 0===n?new Set:n;for(var r=t;r;){if(r.nodeType===Node.ELEMENT_NODE){var a=r;e(a);var c=a.localName;if("link"===c&&"import"===a.getAttribute("rel")){r=a.import;if(r instanceof Node&&!n.has(r))for(n.add(r),r=r.firstChild;r;r=r.nextSibling)i(r,e,n);r=o(t,a);continue}else if("template"===c){r=o(t,a);continue}if(a=a.__CE_shadowRoot)for(a=a.firstChild;a;a=a.nextSibling)i(a,e,n)}r=r.firstChild?r.firstChild:o(t,r)}}function r(t,e,n){t[e]=n}function a(){this.a=new Map;this.g=new Map;this.c=[];this.f=[];this.b=!1}function c(t,e,n){t.a.set(e,n);t.g.set(n.constructorFunction,n)}function l(t,e){t.b=!0;t.c.push(e)}function s(t,e){t.b=!0;t.f.push(e)}function u(t,e){t.b&&i(e,(function(e){return f(t,e)}))}function f(t,e){if(t.b&&!e.__CE_patched){e.__CE_patched=!0;for(var n=0;n<t.c.length;n++)t.c[n](e);for(n=0;n<t.f.length;n++)t.f[n](e)}}function p(t,e){var n=[];i(e,(function(t){return n.push(t)}));for(e=0;e<n.length;e++){var o=n[e];1===o.__CE_state?t.connectedCallback(o):m(t,o)}}function h(t,e){var n=[];i(e,(function(t){return n.push(t)}));for(e=0;e<n.length;e++){var o=n[e];1===o.__CE_state&&t.disconnectedCallback(o)}}function d(t,e,n){n=void 0===n?{}:n;var o=n.u||new Set,r=n.i||function(e){return m(t,e)},a=[];i(e,(function(e){if("link"===e.localName&&"import"===e.getAttribute("rel")){var n=e.import;n instanceof Node&&(n.__CE_isImportDocument=!0,n.__CE_hasRegistry=!0);n&&"complete"===n.readyState?n.__CE_documentLoadHandled=!0:e.addEventListener("load",(function(){var n=e.import;if(!n.__CE_documentLoadHandled){n.__CE_documentLoadHandled=!0;var i=new Set(o);i.delete(n);d(t,n,{u:i,i:r})}}))}else a.push(e)}),o);if(t.b)for(e=0;e<a.length;e++)f(t,a[e]);for(e=0;e<a.length;e++)r(a[e])}function m(t,e){if(void 0===e.__CE_state){var o=e.ownerDocument;if(o.defaultView||o.__CE_isImportDocument&&o.__CE_hasRegistry)if(o=t.a.get(e.localName)){o.constructionStack.push(e);var i=o.constructorFunction;try{try{if(new i!==e)throw Error("The custom element constructor did not produce the element being upgraded.")}finally{o.constructionStack.pop()}}catch(c){throw e.__CE_state=2,c}e.__CE_state=1;e.__CE_definition=o;if(o.attributeChangedCallback)for(o=o.observedAttributes,i=0;i<o.length;i++){var r=o[i],a=e.getAttribute(r);null!==a&&t.attributeChangedCallback(e,r,null,a,null)}n(e)&&t.connectedCallback(e)}}}a.prototype.connectedCallback=function(t){var e=t.__CE_definition;e.connectedCallback&&e.connectedCallback.call(t)};a.prototype.disconnectedCallback=function(t){var e=t.__CE_definition;e.disconnectedCallback&&e.disconnectedCallback.call(t)};a.prototype.attributeChangedCallback=function(t,e,n,o,i){var r=t.__CE_definition;r.attributeChangedCallback&&-1<r.observedAttributes.indexOf(e)&&r.attributeChangedCallback.call(t,e,n,o,i)};function y(t){var e=document;this.c=t;this.a=e;this.b=void 0;d(this.c,this.a);"loading"===this.a.readyState&&(this.b=new MutationObserver(this.f.bind(this)),this.b.observe(this.a,{childList:!0,subtree:!0}))}function b(t){t.b&&t.b.disconnect()}y.prototype.f=function(t){var e=this.a.readyState;"interactive"!==e&&"complete"!==e||b(this);for(e=0;e<t.length;e++)for(var n=t[e].addedNodes,o=0;o<n.length;o++)d(this.c,n[o])};function v(){var t=this;this.b=this.a=void 0;this.c=new Promise((function(e){t.b=e;t.a&&e(t.a)}))}function g(t){if(t.a)throw Error("Already resolved.");t.a=void 0;t.b&&t.b(void 0)}function w(t){this.c=!1;this.a=t;this.j=new Map;this.f=function(t){return t()};this.b=!1;this.g=[];this.o=new y(t)}w.prototype.l=function(t,n){var o=this;if(!(n instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!e(t))throw new SyntaxError("The element name '"+t+"' is not valid.");if(this.a.a.get(t))throw Error("A custom element with name '"+t+"' has already been defined.");if(this.c)throw Error("A custom element is already being defined.");this.c=!0;try{var i=function(t){var e=r[t];if(void 0!==e&&!(e instanceof Function))throw Error("The '"+t+"' callback must be a function.");return e},r=n.prototype;if(!(r instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");var a=i("connectedCallback");var l=i("disconnectedCallback");var s=i("adoptedCallback");var u=i("attributeChangedCallback");var f=n.observedAttributes||[]}catch(p){return}finally{this.c=!1}n={localName:t,constructorFunction:n,connectedCallback:a,disconnectedCallback:l,adoptedCallback:s,attributeChangedCallback:u,observedAttributes:f,constructionStack:[]};c(this.a,t,n);this.g.push(n);this.b||(this.b=!0,this.f((function(){return E(o)})))};w.prototype.i=function(t){d(this.a,t)};function E(t){if(!1!==t.b){t.b=!1;for(var e=t.g,n=[],o=new Map,i=0;i<e.length;i++)o.set(e[i].localName,[]);d(t.a,document,{i:function(e){if(void 0===e.__CE_state){var i=e.localName,r=o.get(i);r?r.push(e):t.a.a.get(i)&&n.push(e)}}});for(i=0;i<n.length;i++)m(t.a,n[i]);for(;0<e.length;){var r=e.shift();i=r.localName;r=o.get(r.localName);for(var a=0;a<r.length;a++)m(t.a,r[a]);(i=t.j.get(i))&&g(i)}}}w.prototype.get=function(t){if(t=this.a.a.get(t))return t.constructorFunction};w.prototype.m=function(t){if(!e(t))return Promise.reject(new SyntaxError("'"+t+"' is not a valid custom element name."));var n=this.j.get(t);if(n)return n.c;n=new v;this.j.set(t,n);this.a.a.get(t)&&!this.g.some((function(e){return e.localName===t}))&&g(n);return n.c};w.prototype.s=function(t){b(this.o);var e=this.f;this.f=function(n){return t((function(){return e(n)}))}};window.CustomElementRegistry=w;w.prototype.define=w.prototype.l;w.prototype.upgrade=w.prototype.i;w.prototype.get=w.prototype.get;w.prototype.whenDefined=w.prototype.m;w.prototype.polyfillWrapFlushCallback=w.prototype.s;var _=window.Document.prototype.createElement,C=window.Document.prototype.createElementNS,N=window.Document.prototype.importNode,S=window.Document.prototype.prepend,T=window.Document.prototype.append,D=window.DocumentFragment.prototype.prepend,k=window.DocumentFragment.prototype.append,A=window.Node.prototype.cloneNode,O=window.Node.prototype.appendChild,j=window.Node.prototype.insertBefore,L=window.Node.prototype.removeChild,M=window.Node.prototype.replaceChild,x=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),H=window.Element.prototype.attachShadow,R=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),P=window.Element.prototype.getAttribute,F=window.Element.prototype.setAttribute,I=window.Element.prototype.removeAttribute,z=window.Element.prototype.getAttributeNS,U=window.Element.prototype.setAttributeNS,W=window.Element.prototype.removeAttributeNS,q=window.Element.prototype.insertAdjacentElement,B=window.Element.prototype.insertAdjacentHTML,$=window.Element.prototype.prepend,V=window.Element.prototype.append,X=window.Element.prototype.before,G=window.Element.prototype.after,J=window.Element.prototype.replaceWith,K=window.Element.prototype.remove,Q=window.HTMLElement,Y=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),Z=window.HTMLElement.prototype.insertAdjacentElement,tt=window.HTMLElement.prototype.insertAdjacentHTML;var et=new function(){};function nt(){var t=st;window.HTMLElement=function(){function e(){var e=this.constructor,n=t.g.get(e);if(!n)throw Error("The custom element being constructed was not registered with `customElements`.");var o=n.constructionStack;if(0===o.length)return o=_.call(document,n.localName),Object.setPrototypeOf(o,e.prototype),o.__CE_state=1,o.__CE_definition=n,f(t,o),o;n=o.length-1;var i=o[n];if(i===et)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.");o[n]=et;Object.setPrototypeOf(i,e.prototype);f(t,i);return i}e.prototype=Q.prototype;Object.defineProperty(e.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:e});return e}()}function ot(t,e,o){function i(e){return function(o){for(var i=[],r=0;r<arguments.length;++r)i[r]=arguments[r];r=[];for(var a=[],c=0;c<i.length;c++){var l=i[c];l instanceof Element&&n(l)&&a.push(l);if(l instanceof DocumentFragment)for(l=l.firstChild;l;l=l.nextSibling)r.push(l);else r.push(l)}e.apply(this,i);for(i=0;i<a.length;i++)h(t,a[i]);if(n(this))for(i=0;i<r.length;i++)a=r[i],a instanceof Element&&p(t,a)}}void 0!==o.h&&(e.prepend=i(o.h));void 0!==o.append&&(e.append=i(o.append))}function it(){var t=st;r(Document.prototype,"createElement",(function(e){if(this.__CE_hasRegistry){var n=t.a.get(e);if(n)return new n.constructorFunction}e=_.call(this,e);f(t,e);return e}));r(Document.prototype,"importNode",(function(e,n){e=N.call(this,e,!!n);this.__CE_hasRegistry?d(t,e):u(t,e);return e}));r(Document.prototype,"createElementNS",(function(e,n){if(this.__CE_hasRegistry&&(null===e||"http://www.w3.org/1999/xhtml"===e)){var o=t.a.get(n);if(o)return new o.constructorFunction}e=C.call(this,e,n);f(t,e);return e}));ot(t,Document.prototype,{h:S,append:T})}function rt(){function t(t,o){Object.defineProperty(t,"textContent",{enumerable:o.enumerable,configurable:!0,get:o.get,set:function(t){if(this.nodeType===Node.TEXT_NODE)o.set.call(this,t);else{var i=void 0;if(this.firstChild){var r=this.childNodes,a=r.length;if(0<a&&n(this)){i=Array(a);for(var c=0;c<a;c++)i[c]=r[c]}}o.set.call(this,t);if(i)for(t=0;t<i.length;t++)h(e,i[t])}}})}var e=st;r(Node.prototype,"insertBefore",(function(t,o){if(t instanceof DocumentFragment){var i=Array.prototype.slice.apply(t.childNodes);t=j.call(this,t,o);if(n(this))for(o=0;o<i.length;o++)p(e,i[o]);return t}i=n(t);o=j.call(this,t,o);i&&h(e,t);n(this)&&p(e,t);return o}));r(Node.prototype,"appendChild",(function(t){if(t instanceof DocumentFragment){var o=Array.prototype.slice.apply(t.childNodes);t=O.call(this,t);if(n(this))for(var i=0;i<o.length;i++)p(e,o[i]);return t}o=n(t);i=O.call(this,t);o&&h(e,t);n(this)&&p(e,t);return i}));r(Node.prototype,"cloneNode",(function(t){t=A.call(this,!!t);this.ownerDocument.__CE_hasRegistry?d(e,t):u(e,t);return t}));r(Node.prototype,"removeChild",(function(t){var o=n(t),i=L.call(this,t);o&&h(e,t);return i}));r(Node.prototype,"replaceChild",(function(t,o){if(t instanceof DocumentFragment){var i=Array.prototype.slice.apply(t.childNodes);t=M.call(this,t,o);if(n(this))for(h(e,o),o=0;o<i.length;o++)p(e,i[o]);return t}i=n(t);var r=M.call(this,t,o),a=n(this);a&&h(e,o);i&&h(e,t);a&&p(e,t);return r}));x&&x.get?t(Node.prototype,x):l(e,(function(e){t(e,{enumerable:!0,configurable:!0,get:function(){for(var t=[],e=0;e<this.childNodes.length;e++){var n=this.childNodes[e];n.nodeType!==Node.COMMENT_NODE&&t.push(n.textContent)}return t.join("")},set:function(t){for(;this.firstChild;)L.call(this,this.firstChild);null!=t&&""!==t&&O.call(this,document.createTextNode(t))}})}))}function at(t){function e(e){return function(o){for(var i=[],r=0;r<arguments.length;++r)i[r]=arguments[r];r=[];for(var a=[],c=0;c<i.length;c++){var l=i[c];l instanceof Element&&n(l)&&a.push(l);if(l instanceof DocumentFragment)for(l=l.firstChild;l;l=l.nextSibling)r.push(l);else r.push(l)}e.apply(this,i);for(i=0;i<a.length;i++)h(t,a[i]);if(n(this))for(i=0;i<r.length;i++)a=r[i],a instanceof Element&&p(t,a)}}var o=Element.prototype;void 0!==X&&(o.before=e(X));void 0!==X&&(o.after=e(G));void 0!==J&&r(o,"replaceWith",(function(e){for(var o=[],i=0;i<arguments.length;++i)o[i]=arguments[i];i=[];for(var r=[],a=0;a<o.length;a++){var c=o[a];c instanceof Element&&n(c)&&r.push(c);if(c instanceof DocumentFragment)for(c=c.firstChild;c;c=c.nextSibling)i.push(c);else i.push(c)}a=n(this);J.apply(this,o);for(o=0;o<r.length;o++)h(t,r[o]);if(a)for(h(t,this),o=0;o<i.length;o++)r=i[o],r instanceof Element&&p(t,r)}));void 0!==K&&r(o,"remove",(function(){var e=n(this);K.call(this);e&&h(t,this)}))}function ct(){function t(t,e){Object.defineProperty(t,"innerHTML",{enumerable:e.enumerable,configurable:!0,get:e.get,set:function(t){var o=this,r=void 0;n(this)&&(r=[],i(this,(function(t){t!==o&&r.push(t)})));e.set.call(this,t);if(r)for(var c=0;c<r.length;c++){var l=r[c];1===l.__CE_state&&a.disconnectedCallback(l)}this.ownerDocument.__CE_hasRegistry?d(a,this):u(a,this);return t}})}function e(t,e){r(t,"insertAdjacentElement",(function(t,o){var i=n(o);t=e.call(this,t,o);i&&h(a,o);n(t)&&p(a,o);return t}))}function o(t,e){function n(t,e){for(var n=[];t!==e;t=t.nextSibling)n.push(t);for(e=0;e<n.length;e++)d(a,n[e])}r(t,"insertAdjacentHTML",(function(t,o){t=t.toLowerCase();if("beforebegin"===t){var i=this.previousSibling;e.call(this,t,o);n(i||this.parentNode.firstChild,this)}else if("afterbegin"===t)i=this.firstChild,e.call(this,t,o),n(this.firstChild,i);else if("beforeend"===t)i=this.lastChild,e.call(this,t,o),n(i||this.firstChild,null);else if("afterend"===t)i=this.nextSibling,e.call(this,t,o),n(this.nextSibling,i);else throw new SyntaxError("The value provided ("+String(t)+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.")}))}var a=st;H&&r(Element.prototype,"attachShadow",(function(t){t=H.call(this,t);var e=a;if(e.b&&!t.__CE_patched){t.__CE_patched=!0;for(var n=0;n<e.c.length;n++)e.c[n](t)}return this.__CE_shadowRoot=t}));R&&R.get?t(Element.prototype,R):Y&&Y.get?t(HTMLElement.prototype,Y):s(a,(function(e){t(e,{enumerable:!0,configurable:!0,get:function(){return A.call(this,!0).innerHTML},set:function(t){var e="template"===this.localName,n=e?this.content:this,o=C.call(document,this.namespaceURI,this.localName);for(o.innerHTML=t;0<n.childNodes.length;)L.call(n,n.childNodes[0]);for(t=e?o.content:o;0<t.childNodes.length;)O.call(n,t.childNodes[0])}})}));r(Element.prototype,"setAttribute",(function(t,e){if(1!==this.__CE_state)return F.call(this,t,e);var n=P.call(this,t);F.call(this,t,e);e=P.call(this,t);a.attributeChangedCallback(this,t,n,e,null)}));r(Element.prototype,"setAttributeNS",(function(t,e,n){if(1!==this.__CE_state)return U.call(this,t,e,n);var o=z.call(this,t,e);U.call(this,t,e,n);n=z.call(this,t,e);a.attributeChangedCallback(this,e,o,n,t)}));r(Element.prototype,"removeAttribute",(function(t){if(1!==this.__CE_state)return I.call(this,t);var e=P.call(this,t);I.call(this,t);null!==e&&a.attributeChangedCallback(this,t,e,null,null)}));r(Element.prototype,"removeAttributeNS",(function(t,e){if(1!==this.__CE_state)return W.call(this,t,e);var n=z.call(this,t,e);W.call(this,t,e);var o=z.call(this,t,e);n!==o&&a.attributeChangedCallback(this,e,n,o,t)}));Z?e(HTMLElement.prototype,Z):q?e(Element.prototype,q):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched.");tt?o(HTMLElement.prototype,tt):B?o(Element.prototype,B):console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched.");ot(a,Element.prototype,{h:$,append:V});at(a)}var lt=window.customElements;if(!lt||lt.forcePolyfill||"function"!=typeof lt.define||"function"!=typeof lt.get){var st=new a;nt();it();ot(st,DocumentFragment.prototype,{h:D,append:k});rt();ct();document.__CE_hasRegistry=!0;var ut=new w(st);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:ut})}}).call(self);if(typeof document.baseURI!=="string"){Object.defineProperty(Document.prototype,"baseURI",{enumerable:true,configurable:true,get:function(){var t=document.querySelector("base");if(t&&t.href){return t.href}return document.URL}})}if(typeof window.CustomEvent!=="function"){window.CustomEvent=function t(e,n){n=n||{bubbles:false,cancelable:false,detail:undefined};var o=document.createEvent("CustomEvent");o.initCustomEvent(e,n.bubbles,n.cancelable,n.detail);return o};window.CustomEvent.prototype=window.Event.prototype}(function(t,e,n){if(!t.composedPath){t.composedPath=function(){if(this.path){return this.path}var t=this.target;this.path=[];while(t.parentNode!==null){this.path.push(t);t=t.parentNode}this.path.push(e,n);return this.path}}})(Event.prototype,document,window); | ||
| /*! | ||
| Element.closest and Element.matches | ||
| https://github.com/jonathantneal/closest | ||
| Creative Commons Zero v1.0 Universal | ||
| */(function(t){"function"!==typeof t.matches&&(t.matches=t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||function(t){t=(this.document||this.ownerDocument).querySelectorAll(t);for(var e=0;t[e]&&t[e]!==this;)++e;return!!t[e]});"function"!==typeof t.closest&&(t.closest=function(t){for(var e=this;e&&1===e.nodeType;){if(e.matches(t))return e;e=e.parentNode}return null})})(window.Element.prototype); | ||
| /*! | ||
| Element.getRootNode() | ||
| */(function(t){function e(t){t=n(t);return t&&11===t.nodeType?e(t.host):t}function n(t){return t&&t.parentNode?n(t.parentNode):t}"function"!==typeof t.getRootNode&&(t.getRootNode=function(t){return t&&t.composed?e(this):n(this)})})(Element.prototype); | ||
| /*! | ||
| Element.isConnected() | ||
| */(function(t){if(!("isConnected"in t)){Object.defineProperty(t,"isConnected",{configurable:true,enumerable:true,get:function(){var t=this.getRootNode({composed:true});return t&&t.nodeType===9}})}})(Element.prototype); | ||
| /*! | ||
| Element.remove() | ||
| */(function(t){t.forEach((function(t){t.hasOwnProperty("remove")||Object.defineProperty(t,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this)}})}))})([Element.prototype,CharacterData.prototype,DocumentType.prototype]); | ||
| /*! | ||
| Element.classList | ||
| */!function(t){"classList"in t||Object.defineProperty(t,"classList",{get:function(){var t=this,e=(t.getAttribute("class")||"").replace(/^\s+|\s$/g,"").split(/\s+/g);function n(){e.length>0?t.setAttribute("class",e.join(" ")):t.removeAttribute("class")}return""===e[0]&&e.splice(0,1),e.toggle=function(t,o){void 0!==o?o?e.add(t):e.remove(t):-1!==e.indexOf(t)?e.splice(e.indexOf(t),1):e.push(t),n()},e.add=function(){for(var t=[].slice.call(arguments),o=0,i=t.length;o<i;o++)-1===e.indexOf(t[o])&&e.push(t[o]);n()},e.remove=function(){for(var t=[].slice.call(arguments),o=0,i=t.length;o<i;o++)-1!==e.indexOf(t[o])&&e.splice(e.indexOf(t[o]),1);n()},e.item=function(t){return e[t]},e.contains=function(t){return-1!==e.indexOf(t)},e.replace=function(t,o){-1!==e.indexOf(t)&&e.splice(e.indexOf(t),1,o),n()},e.value=t.getAttribute("class")||"",e}})}(Element.prototype); | ||
| /*! | ||
| DOMTokenList | ||
| */(function(t){try{document.body.classList.add()}catch(o){var e=t.add;var n=t.remove;t.add=function(){for(var t=0;t<arguments.length;t++){e.call(this,arguments[t])}};t.remove=function(){for(var t=0;t<arguments.length;t++){n.call(this,arguments[t])}}}})(DOMTokenList.prototype)}}})); |
| var __awaiter=this&&this.__awaiter||function(t,e,n,o){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{l(o.next(t))}catch(e){i(e)}}function s(t){try{l(o["throw"](t))}catch(e){i(e)}}function l(t){t.done?n(t.value):r(t.value).then(a,s)}l((o=o.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return l([t,e])}}function l(a){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,r&&(i=a[0]&2?r["return"]:a[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;if(r=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){n.label=a[1];break}if(a[0]===6&&n.label<i[1]){n.label=i[1];i=a;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(a);break}if(i[2])n.ops.pop();n.trys.pop();continue}a=e.call(t,n)}catch(s){a=[6,s];r=0}finally{o=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-20b31ffb.system.js"],(function(t){"use strict";var e,n,o,r;return{setters:[function(t){e=t.r;n=t.c;o=t.h;r=t.g}],execute:function(){var i=t("ms_editor",function(){function t(t){e(this,t);this.content="";this.modalOpen=false;this.editorEvent=n(this,"editorEvent",7)}t.prototype.sendMessage=function(t,e){this.editorFrame.contentWindow.postMessage({action:t,data:e},"*")};t.prototype.save=function(t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.sendMessage("save",t);return[2]}))}))};t.prototype.test=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){console.log("Only a test");return[2]}))}))};t.prototype.spinner=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!["hide","show"].includes(t)){t="hide"}this.sendMessage("showSpinner",{behavior:t});return[2]}))}))};t.prototype.start=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.sendMessage("load",t);return[2]}))}))};t.prototype.sendTest=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.sendMessage("sendTest",t);return[2]}))}))};t.prototype.beforeUnload=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.sendMessage("beforeUnload",t);return[2]}))}))};t.prototype.load=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.sendMessage("load",t);return[2]}))}))};t.prototype.preview=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.sendMessage("preview",t);return[2]}))}))};t.prototype.initConfig=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n,o;return __generator(this,(function(r){switch(r.label){case 0:if(!(this.config.rteToolbars&&this.config.rteToolbars.toolbar_0&&this.config.rteToolbars.toolbar_0 instanceof Promise))return[3,2];t=this.config.rteToolbars;return[4,this.config.rteToolbars.toolbar_0];case 1:t.toolbar_0=r.sent();r.label=2;case 2:if(!(this.config.lang&&this.config.lang.custom&&this.config.lang.custom instanceof Promise))return[3,4];e=this.config.lang;return[4,this.config.lang.custom];case 3:e.custom=r.sent();r.label=4;case 4:if(!(this.config.rteToolbars&&this.config.rteToolbars.toolbar_1&&this.config.rteToolbars.toolbar_1 instanceof Promise))return[3,6];n=this.config.rteToolbars;return[4,this.config.rteToolbars.toolbar_1];case 5:n.toolbar_1=r.sent();r.label=6;case 6:o=typeof this.config.debug!=="undefined"&&this.config.debug;this.editorUrl=this.config.editorUrl||"//editor.mailstyler.com";this.mscFrameworkUrl=o?"http://localhost:4200":this.editorUrl;return[2]}}))}))};t.prototype.componentWillRender=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.initConfig()];case 1:t.sent();console.info("MailStyler Plugin: load assets");return[2]}}))}))};t.prototype.render=function(){return o("iframe",{class:{open:this.modalOpen},src:this.mscFrameworkUrl})};t.prototype.editorDidOpen=function(){var t=this.content||"";this.load(t).then((function(t){return console.log("MailStyler Plugin: Template is loaded succesfully")}))};t.prototype.listenMessage=function(t){if(t.data&&t.data.action){var e=t.data,n=e.action,o=e.data;if(n==="appOk"){console.info("MailStyler Plugin: Editor is ready!");this.editorDidOpen()}else if(n==="appReady"){var r=Object.assign({},this.config);Object.keys(r).filter((function(t){return typeof r[t]==="function"})).forEach((function(t){return delete r[t]}));this.sendMessage("init",{token:this.token,hostname:window.location.hostname,config:r})}else if(n==="appSave"){var i=new RegExp('bgcolor="none"',"g");o.html=o.html.replace(i,"");o.raw_html=o.raw_html.replace(i,"");if("function"==typeof this.config.onSave){this.config.onSave(o.html,o.raw_html,o.json,o.opts)}else{console.error("MailStyler Plugin: You should provide a valid onSave callback")}}else if(n==="appAutoSave"){var i=new RegExp('bgcolor="none"',"g");o.html=o.html.replace(i,"");o.raw_html=o.raw_html.replace(i,"");if("function"==typeof this.config.onAutoSave){this.config.onAutoSave(o.html,o.raw_html,o.json,o.opts)}else{console.error("MailStyler Plugin: You should provide a valid onAutoSave callback")}}else if(n==="appSaveBlock"){var i=new RegExp('bgcolor="none"',"g");o.html=o.html.replace(i,"");o.raw_html=o.raw_html.replace(i,"");if("function"==typeof this.config.onSaveBlock){this.config.onSaveBlock(o.html,o.raw_html)}else{console.error("MailStyler Plugin: You should provide a valid onSaveBlock callback")}}else if(n==="appModal"){this.modalOpen=o.env==="open"}this.editorEvent.emit({action:n,data:o})}};t.prototype.componentWillLoad=function(t){this.editorFrame=this.element.shadowRoot.querySelector("iframe");if(t){this.listenMessage(t)}};Object.defineProperty(t.prototype,"element",{get:function(){return r(this)},enumerable:true,configurable:true});Object.defineProperty(t,"style",{get:function(){return":host{display:block;height:100vh}:host,iframe{width:100%;border:0}iframe{height:100%;min-width:1024px;z-index:9999;top:0}iframe.open{position:fixed}"},enumerable:true,configurable:true});return t}())}}})); |
| let t,e,n=0,o=!1;const s="undefined"!=typeof window?window:{},l=s.document||{head:{}},r={t:0,o:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o)},c=(()=>(l.head.attachShadow+"").includes("[native"))(),i=(()=>{try{return new CSSStyleSheet,!0}catch(t){}return!1})(),a=new WeakMap,u=t=>a.get(t),f=(t,e)=>a.set(e.s=t,e),m=t=>console.error(t),d=new Map,p=new Map,h=[],w=[],$=[],y=(t,e)=>n=>{t.push(n),o||(o=!0,e&&4&r.t?g(_):r.raf(_))},b=(t,e)=>{let n=0,o=0;for(;n<t.length&&(o=performance.now())<e;)try{t[n++](o)}catch(s){m(s)}n===t.length?t.length=0:0!==n&&t.splice(0,n)},_=()=>{n++,(t=>{for(let n=0;n<t.length;n++)try{t[n](performance.now())}catch(e){m(e)}t.length=0})(h);const t=2==(6&r.t)?performance.now()+10*Math.ceil(n*(1/22)):1/0;b(w,t),b($,t),w.length>0&&($.push(...w),w.length=0),(o=h.length+w.length+$.length>0)?r.raf(_):n=0},g=t=>Promise.resolve().then(t),j=y(w,!0),v={},S=t=>"object"==(t=typeof t)||"function"===t,M=()=>s.CSS&&s.CSS.supports&&s.CSS.supports("color","var(--c)")?Promise.resolve():__sc_import_msf_editor("./p-73bc5e11.js").then(()=>{r.l=s.__stencil_cssshim}),R=()=>{r.l=s.__stencil_cssshim;const t=Array.from(l.querySelectorAll("script")).find(t=>new RegExp("/msf-editor(\\.esm)?\\.js($|\\?|#)").test(t.src)||"msf-editor"===t.getAttribute("data-stencil-namespace")),e=t["data-opts"]||{};return"onbeforeload"in t&&!history.scrollRestoration?{then(){}}:(e.resourcesUrl=new URL(".",new URL(t.getAttribute("data-resources-url")||t.src,s.location.href)).href,P(e.resourcesUrl,t),window.customElements?Promise.resolve(e):__sc_import_msf_editor("./p-3b66a627.js").then(()=>e))},P=(t,e)=>{const n=(()=>`__sc_import_${"msf-editor".replace(/\s|-/g,"_")}`)();try{s[n]=new Function("w",`return import(w);//${Math.random()}`)}catch(o){const r=new Map;s[n]=o=>{const c=new URL(o,t).href;let i=r.get(c);if(!i){const t=l.createElement("script");t.type="module",t.crossOrigin=e.crossOrigin,t.src=URL.createObjectURL(new Blob([`import * as m from '${c}'; window.${n}.m = m;`],{type:"application/javascript"})),i=new Promise(e=>{t.onload=()=>{e(s[n].m),t.remove()}}),r.set(c,i),l.head.appendChild(t)}return i}}},L=new WeakMap,O=t=>"sc-"+t,U=(t,e,...n)=>{let o=null,s=!1,l=!1,r=[];const c=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?c(o):null!=o&&"boolean"!=typeof o&&((s="function"!=typeof t&&!S(o))&&(o=String(o)),s&&l?r[r.length-1].i+=o:r.push(s?k(null,o):o),l=s)};if(c(n),e){const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter(e=>t[e]).join(" "))}const i=k(t,null);return i.u=e,r.length>0&&(i.p=r),i},k=(t,e)=>({t:0,h:t,i:e,$:null,p:null,u:null}),C={},x=(t,e,n,o,s,l)=>{if(n===o)return;let r=((t,e)=>e in t)(t,e);if(e.toLowerCase(),"class"===e){const e=t.classList,s=W(n),l=W(o);e.remove(...s.filter(t=>t&&!l.includes(t))),e.add(...l.filter(t=>t&&!s.includes(t)))}else{const i=S(o);if((r||i&&null!==o)&&!s)try{if(t.tagName.includes("-"))t[e]=o;else{let s=null==o?"":o;"list"===e?r=!1:null!=n&&t[e]==s||(t[e]=s)}}catch(c){}null==o||!1===o?t.removeAttribute(e):(!r||4&l||s)&&!i&&t.setAttribute(e,o=!0===o?"":o)}},E=/\s/,W=t=>t?t.split(E):[],A=(t,e,n,o)=>{const s=11===e.$.nodeType&&e.$.host?e.$.host:e.$,l=t&&t.u||v,r=e.u||v;for(o in l)o in r||x(s,o,l[o],void 0,n,e.t);for(o in r)x(s,o,l[o],r[o],n,e.t)},T=(e,n,o)=>{let s,r,c=n.p[o],i=0;if(s=c.$=l.createElement(c.h),A(null,c,!1),(t=>null!=t)(t)&&s["s-si"]!==t&&s.classList.add(s["s-si"]=t),c.p)for(i=0;i<c.p.length;++i)(r=T(e,c,i))&&s.appendChild(r);return s},F=(t,n,o,s,l,r)=>{let c,i=t;for(i.shadowRoot&&i.tagName===e&&(i=i.shadowRoot);l<=r;++l)s[l]&&(c=T(null,o,l))&&(s[l].$=c,i.insertBefore(c,n))},q=(t,e,n,o)=>{for(;e<=n;++e)(o=t[e])&&o.$.remove()},B=(t,e)=>t.h===e.h,H=(t,e)=>{const n=e.$=t.$,o=t.p,s=e.p;A(t,e,!1),null!==o&&null!==s?((t,e,n,o)=>{let s,l=0,r=0,c=e.length-1,i=e[0],a=e[c],u=o.length-1,f=o[0],m=o[u];for(;l<=c&&r<=u;)null==i?i=e[++l]:null==a?a=e[--c]:null==f?f=o[++r]:null==m?m=o[--u]:B(i,f)?(H(i,f),i=e[++l],f=o[++r]):B(a,m)?(H(a,m),a=e[--c],m=o[--u]):B(i,m)?(H(i,m),t.insertBefore(i.$,a.$.nextSibling),i=e[++l],m=o[--u]):B(a,f)?(H(a,f),t.insertBefore(a.$,i.$),a=e[--c],f=o[++r]):(s=T(e&&e[r],n,r),f=o[++r],s&&i.$.parentNode.insertBefore(s,i.$));l>c?F(t,null==o[u+1]?null:o[u+1].$,n,o,r,u):r>u&&q(e,l,c)})(n,o,e,s):null!==s?F(n,null,e,s,0,s.length-1):null!==o&&q(o,0,o.length-1)},N=(t,e)=>{e&&!t._&&e["s-p"].push(new Promise(e=>t._=e))},V=(t,e,n,o)=>{if(e.t|=16,4&e.t)return void(e.t|=512);const s=e.s,l=()=>z(t,e,n,s,o);let r;return N(e,e.g),o&&(e.t|=256,e.j&&(e.j.forEach(([t,e])=>J(s,t,e)),e.j=null),r=J(s,"componentWillLoad")),r=K(r,()=>J(s,"componentWillRender")),K(r,()=>j(l))},z=(n,o,s,r,i)=>{const a=n["s-rc"];i&&((t,e)=>{const n=((t,e)=>{let n=O(e.v),o=p.get(n);if(t=11===t.nodeType?t:l,o)if("string"==typeof o){let e,s=L.get(t=t.head||t);s||L.set(t,s=new Set),s.has(n)||((e=l.createElement("style")).innerHTML=o,t.insertBefore(e,t.querySelector("link")),s&&s.add(n))}else t.adoptedStyleSheets.includes(o)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,o]);return n})(c&&t.shadowRoot?t.shadowRoot:t.getRootNode(),e);10&e.t&&(t["s-sc"]=n,t.classList.add(n+"-h"))})(n,s),((n,o,s,l)=>{e=n.tagName;const r=o.S||k(null,null),c=(t=>t&&t.h===C)(l)?l:U(null,null,l);c.h=null,c.t|=4,o.S=c,c.$=r.$=n.shadowRoot||n,t=n["s-sc"],H(r,c)})(n,o,0,D(r)),o.t&=-17,o.t|=2,a&&(a.forEach(t=>t()),n["s-rc"]=void 0);{const t=n["s-p"],e=()=>G(n,o,s);0===t.length?e():(Promise.all(t).then(e),o.t|=4,t.length=0)}},D=t=>{try{t=t.render()}catch(e){m(e)}return t},G=(t,e,n)=>{const o=e.g;64&e.t||(e.t|=64,t.classList.add("hydrated"),e.M(t),o||I()),e.R(t),e._&&(e._(),e._=void 0),512&e.t&&g(()=>V(t,e,n,!1)),e.t&=-517},I=()=>{l.documentElement.classList.add("hydrated"),r.t|=2},J=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(o){m(o)}},K=(t,e)=>t&&t.then?t.then(e):e(),Q=(t,e,n)=>{if(e.P){const o=Object.entries(e.P),s=t.prototype;if(o.forEach(([t,[o]])=>{31&o||2&n&&32&o?Object.defineProperty(s,t,{get(){return((t,e)=>u(t).L.get(e))(this,t)},set(n){((t,e,n,o)=>{const s=u(this),l=s.O,r=s.L.get(e),c=s.t,i=s.s;(n=((t,e)=>null==t||S(t)?t:1&e?String(t):t)(n,o.P[e][0]))===r||8&c&&void 0!==r||(s.L.set(e,n),i&&2==(18&c)&&V(l,s,o,!1))})(0,t,n,e)},configurable:!0,enumerable:!0}):1&n&&64&o&&Object.defineProperty(s,t,{value(...e){const n=u(this);return n.U.then(()=>n.s[t](...e))}})}),1&n){const e=new Map;s.attributeChangedCallback=function(t,n,o){r.jmp(()=>{const n=e.get(t);this[n]=(null!==o||"boolean"!=typeof this[n])&&o})},t.observedAttributes=o.filter(([t,e])=>15&e[0]).map(([t,n])=>{const o=n[1]||t;return e.set(o,t),o})}}return t},X=(t,e={})=>{const n=[],o=e.exclude||[],f=l.head,h=s.customElements,w=f.querySelector("meta[charset]"),$=l.createElement("style"),y=[];let b,_=!0;Object.assign(r,e),r.o=new URL(e.resourcesUrl||"./",l.baseURI).href,e.syncQueue&&(r.t|=4),t.forEach(t=>t[1].forEach(e=>{const l={t:e[0],v:e[1],P:e[2],k:e[3]};l.P=e[2],l.k=e[3],!c&&1&l.t&&(l.t|=8);const f=l.v,w=class extends HTMLElement{constructor(t){super(t),(t=>{const e={t:0,O:t,L:new Map};e.U=new Promise(t=>e.R=t),e.C=new Promise(t=>e.M=t),t["s-p"]=[],t["s-rc"]=[],a.set(t,e)})(t=this),1&l.t&&(c?t.attachShadow({mode:"open"}):"shadowRoot"in t||(t.shadowRoot=t))}connectedCallback(){b&&(clearTimeout(b),b=null),_?y.push(this):r.jmp(()=>((t,e)=>{if(0==(1&r.t)){const n=()=>{},o=u(t);if(e.k&&(o.W=((t,e,n)=>{e.j=e.j||[];const o=n.map(([n,o,l])=>{const c=((t,e)=>8&e?s:t)(t,n),i=((t,e)=>n=>{256&t.t?t.s[e](n):t.j.push([e,n])})(e,l),a=(t=>({passive:0!=(1&t),capture:0!=(2&t)}))(n);return r.ael(c,o,i,a),()=>r.rel(c,o,i,a)});return()=>o.forEach(t=>t())})(t,o,e.k)),!(1&o.t)){o.t|=1;{let e=t;for(;e=e.parentNode||e.host;)if(e["s-p"]){N(o,o.g=e);break}}e.P&&Object.entries(e.P).forEach(([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}}),g(()=>(async(t,e,n,o,s)=>{if(0==(32&e.t)){e.t|=32;{if((s=(t=>{const e=t.v.replace(/-/g,"_"),n=t.A,o=d.get(n);return o?o[e]:__sc_import_msf_editor(`./${n}.entry.js`).then(t=>(d.set(n,t),t[e]),m)})(n)).then){const t=()=>{};s=await s,t()}s.isProxied||(Q(s,n,2),s.isProxied=!0);const t=()=>{};e.t|=8;try{new s(e)}catch(c){m(c)}e.t&=-9,t()}const t=O(n.v);if(!p.has(t)&&s.style){const e=()=>{};let o=s.style;8&n.t&&(o=await __sc_import_msf_editor("./p-affe7c09.js").then(e=>e.scopeCss(o,t,!1))),((t,e,n)=>{let o=p.get(t);i&&n?(o=o||new CSSStyleSheet).replace(e):o=e,p.set(t,o)})(t,o,!!(1&n.t)),e()}}const l=e.g,r=()=>V(t,e,n,!0);l&&l["s-rc"]?l["s-rc"].push(r):r()})(t,o,e))}n()}})(this,l))}disconnectedCallback(){r.jmp(()=>(()=>{if(0==(1&r.t)){const t=u(this);t.W&&(t.W(),t.W=void 0)}})())}forceUpdate(){((t,e)=>{{const n=u(t);n.O.isConnected&&2==(18&n.t)&&V(t,n,e,!1)}})(this,l)}componentOnReady(){return u(this).C}};l.A=t[0],o.includes(f)||h.get(f)||(n.push(f),h.define(f,Q(w,l,1)))})),$.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",$.setAttribute("data-styles",""),f.insertBefore($,w?w.nextSibling:f.firstChild),_=!1,y.length>0?y.forEach(t=>t.connectedCallback()):r.jmp(()=>b=setTimeout(I,30,"timeout"))},Y=(t,e,n)=>{const o=Z(t);return{emit:t=>{const s=new CustomEvent(e,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:t});return o.dispatchEvent(s),s}}},Z=t=>u(t).O;export{M as a,X as b,Y as c,Z as g,U as h,R as p,f as r}; |
| /** | ||
| * @license | ||
| * Copyright Google Inc. All Rights Reserved. | ||
| * | ||
| * Use of this source code is governed by an MIT-style license that can be | ||
| * found in the LICENSE file at https://angular.io/license | ||
| * | ||
| * This file is a port of shadowCSS from webcomponents.js to TypeScript. | ||
| * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js | ||
| * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts | ||
| */ | ||
| const s=")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)",o=new RegExp("(-shadowcsshost"+s,"gim"),t=new RegExp("(-shadowcsscontext"+s,"gim"),n=new RegExp("(-shadowcssslotted"+s,"gim"),e=/-shadowcsshost-no-combinator([^\s]*)/,c=[/::shadow/g,/::content/g],r=/-shadowcsshost/gim,h=/:host/gim,a=/::slotted/gim,d=/:host-context/gim,g=/\/\*\s*[\s\S]*?\*\//g,i=/\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g,m=/(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g,l=/([{}])/g,u=(s,o)=>{const t=w(s);let n=0;return t.escapedString.replace(m,(...s)=>{const e=s[2];let c="",r=s[4],h="";r&&r.startsWith("{%BLOCK%")&&(c=t.blocks[n++],r=r.substring("%BLOCK%".length+1),h="{");const a=o({selector:e,content:c});return`${s[1]}${a.selector}${s[3]}${h}${a.content}${r}`})},w=s=>{const o=s.split(l),t=[],n=[];let e=0,c=[];for(let r=0;r<o.length;r++){const s=o[r];"}"===s&&e--,e>0?c.push(s):(c.length>0&&(n.push(c.join("")),t.push("%BLOCK%"),c=[]),t.push(s)),"{"===s&&e++}return c.length>0&&(n.push(c.join("")),t.push("%BLOCK%")),{escapedString:t.join(""),blocks:n}},p=(s,o,t)=>s.replace(o,(...s)=>{if(s[2]){const o=s[2].split(","),n=[];for(let e=0;e<o.length;e++){const c=o[e].trim();if(!c)break;n.push(t("-shadowcsshost-no-combinator",c,s[3]))}return n.join(",")}return"-shadowcsshost-no-combinator"+s[3]}),_=(s,o,t)=>s+o.replace("-shadowcsshost","")+t,$=(s,o,t)=>o.indexOf("-shadowcsshost")>-1?_(s,o,t):s+o+t+", "+o+" "+s+t,b=(s,o,t,n)=>u(s,s=>{let c=s.selector,h=s.content;return"@"!==s.selector[0]?c=((s,o,t,n)=>s.split(",").map(s=>n&&s.indexOf("."+n)>-1?s.trim():((s,o)=>!(s=>(s=s.replace(/\[/g,"\\[").replace(/\]/g,"\\]"),new RegExp("^("+s+")([>\\s~+[.,{:][\\s\\S]*)?$","m")))(o).test(s))(s,o)?((s,o,t)=>{const n="."+(o=o.replace(/\[is=([^\]]*)\]/g,(s,...o)=>o[0])),c=s=>{let c=s.trim();if(!c)return"";if(s.indexOf("-shadowcsshost-no-combinator")>-1)c=((s,o,t)=>{if(r.lastIndex=0,r.test(s)){const o=`.${t}`;return s.replace(e,(s,t)=>t.replace(/([^:]*)(:*)(.*)/,(s,t,n,e)=>t+o+n+e)).replace(r,o+" ")}return o+" "+s})(s,o,t);else{const o=s.replace(r,"");if(o.length>0){const s=o.match(/([^:]*)(:*)(.*)/);s&&(c=s[1]+n+s[2]+s[3])}}return c},h=(s=>{const o=[];let t,n=0;return{content:t=(s=s.replace(/(\[[^\]]*\])/g,(s,t)=>{const e=`__ph-${n}__`;return o.push(t),n++,e})).replace(/(:nth-[-\w]+)(\([^)]+\))/g,(s,t,e)=>{const c=`__ph-${n}__`;return o.push(e),n++,t+c}),placeholders:o}})(s);let a,d="",g=0;const i=/( |>|\+|~(?!=))\s*/g;let m=!((s=h.content).indexOf("-shadowcsshost-no-combinator")>-1);for(;null!==(a=i.exec(s));){const o=a[1],t=s.slice(g,a.index).trim();d+=`${(m=m||t.indexOf("-shadowcsshost-no-combinator")>-1)?c(t):t} ${o} `,g=i.lastIndex}const l=s.substring(g);return d+=(m=m||l.indexOf("-shadowcsshost-no-combinator")>-1)?c(l):l,((s,o)=>o.replace(/__ph-(\d+)__/g,(o,t)=>s[+t]))(h.placeholders,d)})(s,o,t).trim():s.trim()).join(", "))(s.selector,o,t,n):(s.selector.startsWith("@media")||s.selector.startsWith("@supports")||s.selector.startsWith("@page")||s.selector.startsWith("@document"))&&(h=b(s.content,o,t,n)),{selector:c.replace(/\s{2,}/g," ").trim(),content:h}}),f=(s,e,r)=>{const m=e+"-h",l=e+"-s",w=(s=>s.match(i)||[])(s);s=(s=>s.replace(g,""))(s);const f=[];if(r){const o=s=>{const o=`/*!@___${f.length}___*/`;return f.push({placeholder:o,comment:`/*!@${s.selector}*/`}),s.selector=o+s.selector,s};s=u(s,s=>"@"!==s.selector[0]?o(s):s.selector.startsWith("@media")||s.selector.startsWith("@supports")||s.selector.startsWith("@page")||s.selector.startsWith("@document")?(s.content=u(s.content,o),s):s)}const x=((s,e,r,g)=>(s=(s=>c.reduce((s,o)=>s.replace(o," "),s))(s=((s,o)=>s.replace(n,(...s)=>{if(s[2]){const t=s[2].trim();return"."+o+" > "+t+s[3]}return"-shadowcsshost-no-combinator"+s[3]}))(s=(s=>p(s,t,$))(s=(s=>p(s,o,_))(s=(s=>s=s.replace(d,"-shadowcsscontext").replace(h,"-shadowcsshost").replace(a,"-shadowcssslotted"))(s))),g)),e&&(s=b(s,e,r,g)),(s=(s=s.replace(/-shadowcsshost-no-combinator/g,`.${r}`)).replace(/>\s*\*\s+([^{, ]+)/gm," $1 ")).trim()))(s,e,m,l);return s=[x,...w].join("\n"),r&&f.forEach(({placeholder:o,comment:t})=>{s=s.replace(o,t)}),s};export{f as scopeCss}; |
| import{r as s,c as t,h as i,g as e}from"./p-acbc4922.js";const o=class{constructor(i){s(this,i),this.content="",this.modalOpen=!1,this.editorEvent=t(this,"editorEvent",7)}sendMessage(s,t){this.editorFrame.contentWindow.postMessage({action:s,data:t},"*")}async save(s={}){this.sendMessage("save",s)}async test(){console.log("Only a test")}async spinner(s){["hide","show"].includes(s)||(s="hide"),this.sendMessage("showSpinner",{behavior:s})}async start(s){this.sendMessage("load",s)}async sendTest(s){this.sendMessage("sendTest",s)}async beforeUnload(s){this.sendMessage("beforeUnload",s)}async load(s){this.sendMessage("load",s)}async preview(s){this.sendMessage("preview",s)}async initConfig(){this.config.rteToolbars&&this.config.rteToolbars.toolbar_0&&this.config.rteToolbars.toolbar_0 instanceof Promise&&(this.config.rteToolbars.toolbar_0=await this.config.rteToolbars.toolbar_0),this.config.lang&&this.config.lang.custom&&this.config.lang.custom instanceof Promise&&(this.config.lang.custom=await this.config.lang.custom),this.config.rteToolbars&&this.config.rteToolbars.toolbar_1&&this.config.rteToolbars.toolbar_1 instanceof Promise&&(this.config.rteToolbars.toolbar_1=await this.config.rteToolbars.toolbar_1);const s=void 0!==this.config.debug&&this.config.debug;this.editorUrl=this.config.editorUrl||"//editor.mailstyler.com",this.mscFrameworkUrl=s?"http://localhost:4200":this.editorUrl}async componentWillRender(){await this.initConfig(),console.info("MailStyler Plugin: load assets")}render(){return i("iframe",{class:{open:this.modalOpen},src:this.mscFrameworkUrl})}editorDidOpen(){this.load(this.content||"").then(()=>console.log("MailStyler Plugin: Template is loaded succesfully"))}listenMessage(s){if(s.data&&s.data.action){const{action:t,data:i}=s.data;if("appOk"===t)console.info("MailStyler Plugin: Editor is ready!"),this.editorDidOpen();else if("appReady"===t){let s=Object.assign({},this.config);Object.keys(s).filter(t=>"function"==typeof s[t]).forEach(t=>delete s[t]),this.sendMessage("init",{token:this.token,hostname:window.location.hostname,config:s})}else if("appSave"===t){const s=new RegExp('bgcolor="none"',"g");i.html=i.html.replace(s,""),i.raw_html=i.raw_html.replace(s,""),"function"==typeof this.config.onSave?this.config.onSave(i.html,i.raw_html,i.json,i.opts):console.error("MailStyler Plugin: You should provide a valid onSave callback")}else if("appAutoSave"===t){const s=new RegExp('bgcolor="none"',"g");i.html=i.html.replace(s,""),i.raw_html=i.raw_html.replace(s,""),"function"==typeof this.config.onAutoSave?this.config.onAutoSave(i.html,i.raw_html,i.json,i.opts):console.error("MailStyler Plugin: You should provide a valid onAutoSave callback")}else if("appSaveBlock"===t){const s=new RegExp('bgcolor="none"',"g");i.html=i.html.replace(s,""),i.raw_html=i.raw_html.replace(s,""),"function"==typeof this.config.onSaveBlock?this.config.onSaveBlock(i.html,i.raw_html):console.error("MailStyler Plugin: You should provide a valid onSaveBlock callback")}else"appModal"===t&&(this.modalOpen="open"===i.env);this.editorEvent.emit({action:t,data:i})}}componentWillLoad(s){this.editorFrame=this.element.shadowRoot.querySelector("iframe"),s&&this.listenMessage(s)}get element(){return e(this)}static get style(){return":host{display:block;height:100vh}:host,iframe{width:100%;border:0}iframe{height:100%;min-width:1024px;z-index:9999;top:0}iframe.open{position:fixed}"}};export{o as ms_editor}; |
| var __spreadArrays=this&&this.__spreadArrays||function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),a=0,e=0;e<t;e++)for(var s=arguments[e],c=0,o=s.length;c<o;c++,a++)n[a]=s[c];return n};System.register([],(function(r){"use strict";return{execute:function(){ | ||
| /** | ||
| * @license | ||
| * Copyright Google Inc. All Rights Reserved. | ||
| * | ||
| * Use of this source code is governed by an MIT-style license that can be | ||
| * found in the LICENSE file at https://angular.io/license | ||
| * | ||
| * This file is a port of shadowCSS from webcomponents.js to TypeScript. | ||
| * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js | ||
| * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts | ||
| */ | ||
| var e=function(r){var e=[];var t=0;var n;r=r.replace(/(\[[^\]]*\])/g,(function(r,n){var a="__ph-"+t+"__";e.push(n);t++;return a}));n=r.replace(/(:nth-[-\w]+)(\([^)]+\))/g,(function(r,n,a){var s="__ph-"+t+"__";e.push(a);t++;return n+s}));var a={content:n,placeholders:e};return a};var t=function(r,e){return e.replace(/__ph-(\d+)__/g,(function(e,t){return r[+t]}))};var n="-shadowcsshost";var a="-shadowcssslotted";var s="-shadowcsscontext";var c=")(?:\\(("+"(?:\\([^)(]*\\)|[^)(]*)+?"+")\\))?([^,{]*)";var o=new RegExp("("+n+c,"gim");var i=new RegExp("("+s+c,"gim");var v=new RegExp("("+a+c,"gim");var u=n+"-no-combinator";var l=/-shadowcsshost-no-combinator([^\s]*)/;var f=[/::shadow/g,/::content/g];var p="([>\\s~+[.,{:][\\s\\S]*)?$";var h=/-shadowcsshost/gim;var g=/:host/gim;var d=/::slotted/gim;var m=/:host-context/gim;var _=/\/\*\s*[\s\S]*?\*\//g;var x=function(r){return r.replace(_,"")};var w=/\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;var W=function(r){return r.match(w)||[]};var b=/(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;var O=/([{}])/g;var j="{";var S="}";var y="%BLOCK%";var E=function(r,e){var t=R(r);var n=0;return t.escapedString.replace(b,(function(){var r=[];for(var a=0;a<arguments.length;a++){r[a]=arguments[a]}var s=r[2];var c="";var o=r[4];var i="";if(o&&o.startsWith("{"+y)){c=t.blocks[n++];o=o.substring(y.length+1);i="{"}var v={selector:s,content:c};var u=e(v);return""+r[1]+u.selector+r[3]+i+u.content+o}))};var R=function(r){var e=r.split(O);var t=[];var n=[];var a=0;var s=[];for(var c=0;c<e.length;c++){var o=e[c];if(o===S){a--}if(a>0){s.push(o)}else{if(s.length>0){n.push(s.join(""));t.push(y);s=[]}t.push(o)}if(o===j){a++}}if(s.length>0){n.push(s.join(""));t.push(y)}var i={escapedString:t.join(""),blocks:n};return i};var A=function(r){r=r.replace(m,s).replace(g,n).replace(d,a);return r};var k=function(r,e,t){return r.replace(e,(function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}if(r[2]){var n=r[2].split(",");var a=[];for(var s=0;s<n.length;s++){var c=n[s].trim();if(!c)break;a.push(t(u,c,r[3]))}return a.join(",")}else{return u+r[3]}}))};var C=function(r,e,t){return r+e.replace(n,"")+t};var L=function(r){return k(r,o,C)};var B=function(r,e,t){if(e.indexOf(n)>-1){return C(r,e,t)}else{return r+e+t+", "+e+" "+r+t}};var I=function(r,e){var t=v;return r.replace(t,(function(){var r=[];for(var t=0;t<arguments.length;t++){r[t]=arguments[t]}if(r[2]){var n=r[2].trim();var a=r[3];var s="."+e+" > "+n+a;return s}else{return u+r[3]}}))};var K=function(r){return k(r,i,B)};var $=function(r){return f.reduce((function(r,e){return r.replace(e," ")}),r)};var M=function(r){var e=/\[/g;var t=/\]/g;r=r.replace(e,"\\[").replace(t,"\\]");return new RegExp("^("+r+")"+p,"m")};var U=function(r,e){var t=M(e);return!t.test(r)};var q=function(r,e,t){h.lastIndex=0;if(h.test(r)){var n="."+t;return r.replace(l,(function(r,e){return e.replace(/([^:]*)(:*)(.*)/,(function(r,e,t,a){return e+n+t+a}))})).replace(h,n+" ")}return e+" "+r};var z=function(r,n,a){var s=/\[is=([^\]]*)\]/g;n=n.replace(s,(function(r){var e=[];for(var t=1;t<arguments.length;t++){e[t-1]=arguments[t]}return e[0]}));var c="."+n;var o=function(r){var e=r.trim();if(!e){return""}if(r.indexOf(u)>-1){e=q(r,n,a)}else{var t=r.replace(h,"");if(t.length>0){var s=t.match(/([^:]*)(:*)(.*)/);if(s){e=s[1]+c+s[2]+s[3]}}}return e};var i=e(r);r=i.content;var v="";var l=0;var f;var p=/( |>|\+|~(?!=))\s*/g;var g=r.indexOf(u)>-1;var d=!g;while((f=p.exec(r))!==null){var m=f[1];var _=r.slice(l,f.index).trim();d=d||_.indexOf(u)>-1;var x=d?o(_):_;v+=x+" "+m+" ";l=p.lastIndex}var w=r.substring(l);d=d||w.indexOf(u)>-1;v+=d?o(w):w;return t(i.placeholders,v)};var D=function(r,e,t,n){return r.split(",").map((function(r){if(n&&r.indexOf("."+n)>-1){return r.trim()}if(U(r,e)){return z(r,e,t).trim()}else{return r.trim()}})).join(", ")};var F=function(r,e,t,n,a){return E(r,(function(r){var a=r.selector;var s=r.content;if(r.selector[0]!=="@"){a=D(r.selector,e,t,n)}else if(r.selector.startsWith("@media")||r.selector.startsWith("@supports")||r.selector.startsWith("@page")||r.selector.startsWith("@document")){s=F(r.content,e,t,n)}var c={selector:a.replace(/\s{2,}/g," ").trim(),content:s};return c}))};var G=function(r,e,t,n,a){r=A(r);r=L(r);r=K(r);r=I(r,n);r=$(r);if(e){r=F(r,e,t,n)}r=r.replace(/-shadowcsshost-no-combinator/g,"."+t);r=r.replace(/>\s*\*\s+([^{, ]+)/gm," $1 ");return r.trim()};var H=r("scopeCss",(function(r,e,t){var n=e+"-h";var a=e+"-s";var s=W(r);r=x(r);var c=[];if(t){var o=function(r){var e="/*!@___"+c.length+"___*/";var t="/*!@"+r.selector+"*/";c.push({placeholder:e,comment:t});r.selector=e+r.selector;return r};r=E(r,(function(r){if(r.selector[0]!=="@"){return o(r)}else if(r.selector.startsWith("@media")||r.selector.startsWith("@supports")||r.selector.startsWith("@page")||r.selector.startsWith("@document")){r.content=E(r.content,o);return r}return r}))}var i=G(r,e,n,a);r=__spreadArrays([i],s).join("\n");if(t){c.forEach((function(e){var t=e.placeholder,n=e.comment;r=r.replace(t,n)}))}return r}))}}})); |
| /** | ||
| * This file gets copied to all distributions of stencil component collections. | ||
| * - no imports | ||
| */ | ||
| export interface ComponentWillLoad { | ||
| /** | ||
| * The component is about to load and it has not | ||
| * rendered yet. | ||
| * | ||
| * This is the best place to make any data updates | ||
| * before the first render. | ||
| * | ||
| * componentWillLoad will only be called once. | ||
| */ | ||
| componentWillLoad: () => Promise<void> | void; | ||
| } | ||
| export interface ComponentDidLoad { | ||
| /** | ||
| * The component has loaded and has already rendered. | ||
| * | ||
| * Updating data in this method will cause the | ||
| * component to re-render. | ||
| * | ||
| * componentDidLoad will only be called once. | ||
| */ | ||
| componentDidLoad: () => void; | ||
| } | ||
| export interface ComponentWillUpdate { | ||
| /** | ||
| * The component is about to update and re-render. | ||
| * | ||
| * Called multiple times throughout the life of | ||
| * the component as it updates. | ||
| * | ||
| * componentWillUpdate is not called on the first render. | ||
| */ | ||
| componentWillUpdate: () => Promise<void> | void; | ||
| } | ||
| export interface ComponentDidUpdate { | ||
| /** | ||
| * The component has just re-rendered. | ||
| * | ||
| * Called multiple times throughout the life of | ||
| * the component as it updates. | ||
| * | ||
| * componentWillUpdate is not called on the | ||
| * first render. | ||
| */ | ||
| componentDidUpdate: () => void; | ||
| } | ||
| export interface ComponentDidUnload { | ||
| /** | ||
| * The component did unload and the element | ||
| * will be destroyed. | ||
| */ | ||
| componentDidUnload: () => void; | ||
| } | ||
| export interface ComponentInterface { | ||
| connectedCallback?: () => void; | ||
| disconnectedCallback?: () => void; | ||
| componentWillRender?: () => Promise<void> | void; | ||
| componentDidRender?: () => void; | ||
| /** | ||
| * The component is about to load and it has not | ||
| * rendered yet. | ||
| * | ||
| * This is the best place to make any data updates | ||
| * before the first render. | ||
| * | ||
| * componentWillLoad will only be called once. | ||
| */ | ||
| componentWillLoad?: () => Promise<void> | void; | ||
| /** | ||
| * The component has loaded and has already rendered. | ||
| * | ||
| * Updating data in this method will cause the | ||
| * component to re-render. | ||
| * | ||
| * componentDidLoad will only be called once. | ||
| */ | ||
| componentDidLoad?: () => void; | ||
| /** | ||
| * The component is about to update and re-render. | ||
| * | ||
| * Called multiple times throughout the life of | ||
| * the component as it updates. | ||
| * | ||
| * componentWillUpdate is not called on the first render. | ||
| */ | ||
| componentWillUpdate?: () => Promise<void> | void; | ||
| /** | ||
| * The component has just re-rendered. | ||
| * | ||
| * Called multiple times throughout the life of | ||
| * the component as it updates. | ||
| * | ||
| * componentWillUpdate is not called on the | ||
| * first render. | ||
| */ | ||
| componentDidUpdate?: () => void; | ||
| render?: () => any; | ||
| [memberName: string]: any; | ||
| } | ||
| /** | ||
| * General types important to applications using stencil built components | ||
| */ | ||
| export interface EventEmitter<T= any> { | ||
| emit: (data?: T) => CustomEvent<T>; | ||
| } | ||
| export interface QueueApi { | ||
| tick: (cb: RafCallback) => void; | ||
| read: (cb: RafCallback) => void; | ||
| write: (cb: RafCallback) => void; | ||
| clear?: () => void; | ||
| flush?: (cb?: () => void) => void; | ||
| } | ||
| export interface RafCallback { | ||
| (timeStamp: number): void; | ||
| } | ||
| export interface HTMLStencilElement extends HTMLElement { | ||
| componentOnReady(): Promise<this>; | ||
| forceUpdate(): void; | ||
| } | ||
| declare namespace LocalJSX { | ||
| export interface Element {} | ||
| export interface IntrinsicElements {} | ||
| } | ||
| export { LocalJSX as JSX }; | ||
| export namespace JSXBase { | ||
| export interface IntrinsicElements { | ||
| // Stencil elements | ||
| slot: JSXBase.SlotAttributes; | ||
| // HTML | ||
| a: JSXBase.AnchorHTMLAttributes<HTMLAnchorElement>; | ||
| abbr: JSXBase.HTMLAttributes; | ||
| address: JSXBase.HTMLAttributes; | ||
| area: JSXBase.AreaHTMLAttributes<HTMLAreaElement>; | ||
| article: JSXBase.HTMLAttributes; | ||
| aside: JSXBase.HTMLAttributes; | ||
| audio: JSXBase.AudioHTMLAttributes<HTMLAudioElement>; | ||
| b: JSXBase.HTMLAttributes; | ||
| base: JSXBase.BaseHTMLAttributes<HTMLBaseElement>; | ||
| bdi: JSXBase.HTMLAttributes; | ||
| bdo: JSXBase.HTMLAttributes; | ||
| big: JSXBase.HTMLAttributes; | ||
| blockquote: JSXBase.BlockquoteHTMLAttributes<HTMLQuoteElement>; | ||
| body: JSXBase.HTMLAttributes<HTMLBodyElement>; | ||
| br: JSXBase.HTMLAttributes<HTMLBRElement>; | ||
| button: JSXBase.ButtonHTMLAttributes<HTMLButtonElement>; | ||
| canvas: JSXBase.CanvasHTMLAttributes<HTMLCanvasElement>; | ||
| caption: JSXBase.HTMLAttributes<HTMLTableCaptionElement>; | ||
| cite: JSXBase.HTMLAttributes; | ||
| code: JSXBase.HTMLAttributes; | ||
| col: JSXBase.ColHTMLAttributes<HTMLTableColElement>; | ||
| colgroup: JSXBase.ColgroupHTMLAttributes<HTMLTableColElement>; | ||
| data: JSXBase.HTMLAttributes<HTMLDataElement>; | ||
| datalist: JSXBase.HTMLAttributes<HTMLDataListElement>; | ||
| dd: JSXBase.HTMLAttributes; | ||
| del: JSXBase.DelHTMLAttributes<HTMLModElement>; | ||
| details: JSXBase.DetailsHTMLAttributes<HTMLElement>; | ||
| dfn: JSXBase.HTMLAttributes; | ||
| dialog: JSXBase.DialogHTMLAttributes<HTMLDialogElement>; | ||
| div: JSXBase.HTMLAttributes<HTMLDivElement>; | ||
| dl: JSXBase.HTMLAttributes<HTMLDListElement>; | ||
| dt: JSXBase.HTMLAttributes; | ||
| em: JSXBase.HTMLAttributes; | ||
| embed: JSXBase.EmbedHTMLAttributes<HTMLEmbedElement>; | ||
| fieldset: JSXBase.FieldsetHTMLAttributes<HTMLFieldSetElement>; | ||
| figcaption: JSXBase.HTMLAttributes; | ||
| figure: JSXBase.HTMLAttributes; | ||
| footer: JSXBase.HTMLAttributes; | ||
| form: JSXBase.FormHTMLAttributes<HTMLFormElement>; | ||
| h1: JSXBase.HTMLAttributes<HTMLHeadingElement>; | ||
| h2: JSXBase.HTMLAttributes<HTMLHeadingElement>; | ||
| h3: JSXBase.HTMLAttributes<HTMLHeadingElement>; | ||
| h4: JSXBase.HTMLAttributes<HTMLHeadingElement>; | ||
| h5: JSXBase.HTMLAttributes<HTMLHeadingElement>; | ||
| h6: JSXBase.HTMLAttributes<HTMLHeadingElement>; | ||
| head: JSXBase.HTMLAttributes<HTMLHeadElement>; | ||
| header: JSXBase.HTMLAttributes; | ||
| hgroup: JSXBase.HTMLAttributes; | ||
| hr: JSXBase.HTMLAttributes<HTMLHRElement>; | ||
| html: JSXBase.HTMLAttributes<HTMLHtmlElement>; | ||
| i: JSXBase.HTMLAttributes; | ||
| iframe: JSXBase.IframeHTMLAttributes<HTMLIFrameElement>; | ||
| img: JSXBase.ImgHTMLAttributes<HTMLImageElement>; | ||
| input: JSXBase.InputHTMLAttributes<HTMLInputElement>; | ||
| ins: JSXBase.InsHTMLAttributes<HTMLModElement>; | ||
| kbd: JSXBase.HTMLAttributes; | ||
| keygen: JSXBase.KeygenHTMLAttributes<HTMLElement>; | ||
| label: JSXBase.LabelHTMLAttributes<HTMLLabelElement>; | ||
| legend: JSXBase.HTMLAttributes<HTMLLegendElement>; | ||
| li: JSXBase.LiHTMLAttributes<HTMLLIElement>; | ||
| link: JSXBase.LinkHTMLAttributes<HTMLLinkElement>; | ||
| main: JSXBase.HTMLAttributes; | ||
| map: JSXBase.MapHTMLAttributes<HTMLMapElement>; | ||
| mark: JSXBase.HTMLAttributes; | ||
| menu: JSXBase.MenuHTMLAttributes<HTMLMenuElement>; | ||
| menuitem: JSXBase.HTMLAttributes; | ||
| meta: JSXBase.MetaHTMLAttributes<HTMLMetaElement>; | ||
| meter: JSXBase.MeterHTMLAttributes<HTMLMeterElement>; | ||
| nav: JSXBase.HTMLAttributes; | ||
| noscript: JSXBase.HTMLAttributes; | ||
| object: JSXBase.ObjectHTMLAttributes<HTMLObjectElement>; | ||
| ol: JSXBase.OlHTMLAttributes<HTMLOListElement>; | ||
| optgroup: JSXBase.OptgroupHTMLAttributes<HTMLOptGroupElement>; | ||
| option: JSXBase.OptionHTMLAttributes<HTMLOptionElement>; | ||
| output: JSXBase.OutputHTMLAttributes<HTMLOutputElement>; | ||
| p: JSXBase.HTMLAttributes<HTMLParagraphElement>; | ||
| param: JSXBase.ParamHTMLAttributes<HTMLParamElement>; | ||
| picture: JSXBase.HTMLAttributes<HTMLPictureElement>; | ||
| pre: JSXBase.HTMLAttributes<HTMLPreElement>; | ||
| progress: JSXBase.ProgressHTMLAttributes<HTMLProgressElement>; | ||
| q: JSXBase.QuoteHTMLAttributes<HTMLQuoteElement>; | ||
| rp: JSXBase.HTMLAttributes; | ||
| rt: JSXBase.HTMLAttributes; | ||
| ruby: JSXBase.HTMLAttributes; | ||
| s: JSXBase.HTMLAttributes; | ||
| samp: JSXBase.HTMLAttributes; | ||
| script: JSXBase.ScriptHTMLAttributes<HTMLScriptElement>; | ||
| section: JSXBase.HTMLAttributes; | ||
| select: JSXBase.SelectHTMLAttributes<HTMLSelectElement>; | ||
| small: JSXBase.HTMLAttributes; | ||
| source: JSXBase.SourceHTMLAttributes<HTMLSourceElement>; | ||
| span: JSXBase.HTMLAttributes<HTMLSpanElement>; | ||
| strong: JSXBase.HTMLAttributes; | ||
| style: JSXBase.StyleHTMLAttributes<HTMLStyleElement>; | ||
| sub: JSXBase.HTMLAttributes; | ||
| summary: JSXBase.HTMLAttributes; | ||
| sup: JSXBase.HTMLAttributes; | ||
| table: JSXBase.TableHTMLAttributes<HTMLTableElement>; | ||
| tbody: JSXBase.HTMLAttributes<HTMLTableSectionElement>; | ||
| td: JSXBase.TdHTMLAttributes<HTMLTableDataCellElement>; | ||
| textarea: JSXBase.TextareaHTMLAttributes<HTMLTextAreaElement>; | ||
| tfoot: JSXBase.HTMLAttributes<HTMLTableSectionElement>; | ||
| th: JSXBase.ThHTMLAttributes<HTMLTableHeaderCellElement>; | ||
| thead: JSXBase.HTMLAttributes<HTMLTableSectionElement>; | ||
| time: JSXBase.TimeHTMLAttributes<HTMLTimeElement>; | ||
| title: JSXBase.HTMLAttributes<HTMLTitleElement>; | ||
| tr: JSXBase.HTMLAttributes<HTMLTableRowElement>; | ||
| track: JSXBase.TrackHTMLAttributes<HTMLTrackElement>; | ||
| u: JSXBase.HTMLAttributes; | ||
| ul: JSXBase.HTMLAttributes<HTMLUListElement>; | ||
| 'var': JSXBase.HTMLAttributes; | ||
| video: JSXBase.VideoHTMLAttributes<HTMLVideoElement>; | ||
| wbr: JSXBase.HTMLAttributes; | ||
| // SVG | ||
| animate: JSXBase.SVGAttributes; | ||
| circle: JSXBase.SVGAttributes; | ||
| clipPath: JSXBase.SVGAttributes; | ||
| defs: JSXBase.SVGAttributes; | ||
| desc: JSXBase.SVGAttributes; | ||
| ellipse: JSXBase.SVGAttributes; | ||
| feBlend: JSXBase.SVGAttributes; | ||
| feColorMatrix: JSXBase.SVGAttributes; | ||
| feComponentTransfer: JSXBase.SVGAttributes; | ||
| feComposite: JSXBase.SVGAttributes; | ||
| feConvolveMatrix: JSXBase.SVGAttributes; | ||
| feDiffuseLighting: JSXBase.SVGAttributes; | ||
| feDisplacementMap: JSXBase.SVGAttributes; | ||
| feDistantLight: JSXBase.SVGAttributes; | ||
| feDropShadow: JSXBase.SVGAttributes; | ||
| feFlood: JSXBase.SVGAttributes; | ||
| feFuncA: JSXBase.SVGAttributes; | ||
| feFuncB: JSXBase.SVGAttributes; | ||
| feFuncG: JSXBase.SVGAttributes; | ||
| feFuncR: JSXBase.SVGAttributes; | ||
| feGaussianBlur: JSXBase.SVGAttributes; | ||
| feImage: JSXBase.SVGAttributes; | ||
| feMerge: JSXBase.SVGAttributes; | ||
| feMergeNode: JSXBase.SVGAttributes; | ||
| feMorphology: JSXBase.SVGAttributes; | ||
| feOffset: JSXBase.SVGAttributes; | ||
| fePointLight: JSXBase.SVGAttributes; | ||
| feSpecularLighting: JSXBase.SVGAttributes; | ||
| feSpotLight: JSXBase.SVGAttributes; | ||
| feTile: JSXBase.SVGAttributes; | ||
| feTurbulence: JSXBase.SVGAttributes; | ||
| filter: JSXBase.SVGAttributes; | ||
| foreignObject: JSXBase.SVGAttributes; | ||
| g: JSXBase.SVGAttributes; | ||
| image: JSXBase.SVGAttributes; | ||
| line: JSXBase.SVGAttributes; | ||
| linearGradient: JSXBase.SVGAttributes; | ||
| marker: JSXBase.SVGAttributes; | ||
| mask: JSXBase.SVGAttributes; | ||
| metadata: JSXBase.SVGAttributes; | ||
| path: JSXBase.SVGAttributes; | ||
| pattern: JSXBase.SVGAttributes; | ||
| polygon: JSXBase.SVGAttributes; | ||
| polyline: JSXBase.SVGAttributes; | ||
| radialGradient: JSXBase.SVGAttributes; | ||
| rect: JSXBase.SVGAttributes; | ||
| stop: JSXBase.SVGAttributes; | ||
| svg: JSXBase.SVGAttributes; | ||
| switch: JSXBase.SVGAttributes; | ||
| symbol: JSXBase.SVGAttributes; | ||
| text: JSXBase.SVGAttributes; | ||
| textPath: JSXBase.SVGAttributes; | ||
| tspan: JSXBase.SVGAttributes; | ||
| use: JSXBase.SVGAttributes; | ||
| view: JSXBase.SVGAttributes; | ||
| } | ||
| export interface SlotAttributes { | ||
| name?: string; | ||
| slot?: string; | ||
| } | ||
| export interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| download?: any; | ||
| href?: string; | ||
| hrefLang?: string; | ||
| hreflang?: string; | ||
| media?: string; | ||
| rel?: string; | ||
| target?: string; | ||
| } | ||
| export interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {} | ||
| export interface AreaHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| alt?: string; | ||
| coords?: string; | ||
| download?: any; | ||
| href?: string; | ||
| hrefLang?: string; | ||
| hreflang?: string; | ||
| media?: string; | ||
| rel?: string; | ||
| shape?: string; | ||
| target?: string; | ||
| } | ||
| export interface BaseHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| href?: string; | ||
| target?: string; | ||
| } | ||
| export interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| cite?: string; | ||
| } | ||
| export interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| autoFocus?: boolean; | ||
| disabled?: boolean; | ||
| form?: string; | ||
| formAction?: string; | ||
| formaction?: string; | ||
| formEncType?: string; | ||
| formenctype?: string; | ||
| formMethod?: string; | ||
| formmethod?: string; | ||
| formNoValidate?: boolean; | ||
| formnovalidate?: boolean; | ||
| formTarget?: string; | ||
| formtarget?: string; | ||
| name?: string; | ||
| type?: string; | ||
| value?: string | string[] | number; | ||
| } | ||
| export interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| height?: number | string; | ||
| width?: number | string; | ||
| } | ||
| export interface ColHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| span?: number; | ||
| } | ||
| export interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| span?: number; | ||
| } | ||
| export interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| open?: boolean; | ||
| } | ||
| export interface DelHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| cite?: string; | ||
| dateTime?: string; | ||
| datetime?: string; | ||
| } | ||
| export interface DialogHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| onClose?: (event: Event) => void; | ||
| open?: boolean; | ||
| returnValue?: string; | ||
| } | ||
| export interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| height?: number | string; | ||
| src?: string; | ||
| type?: string; | ||
| width?: number | string; | ||
| } | ||
| export interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| disabled?: boolean; | ||
| form?: string; | ||
| name?: string; | ||
| } | ||
| export interface FormHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| acceptCharset?: string; | ||
| acceptcharset?: string; | ||
| action?: string; | ||
| autoComplete?: string; | ||
| autocomplete?: string; | ||
| encType?: string; | ||
| enctype?: string; | ||
| method?: string; | ||
| name?: string; | ||
| noValidate?: boolean; | ||
| novalidate?: boolean | string; | ||
| target?: string; | ||
| } | ||
| export interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| manifest?: string; | ||
| } | ||
| export interface IframeHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| allowFullScreen?: boolean; | ||
| allowfullScreen?: string | boolean; | ||
| allowTransparency?: boolean; | ||
| allowtransparency?: string | boolean; | ||
| frameBorder?: number | string; | ||
| frameborder?: number | string; | ||
| importance?: 'low' | 'auto' | 'high'; | ||
| height?: number | string; | ||
| loading?: 'lazy' | 'auto' | 'eager'; | ||
| marginHeight?: number; | ||
| marginheight?: string | number; | ||
| marginWidth?: number; | ||
| marginwidth?: string | number; | ||
| name?: string; | ||
| referrerPolicy?: ReferrerPolicy; | ||
| sandbox?: string; | ||
| scrolling?: string; | ||
| seamless?: boolean; | ||
| src?: string; | ||
| srcDoc?: string; | ||
| srcdoc?: string; | ||
| width?: number | string; | ||
| } | ||
| export interface ImgHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| alt?: string; | ||
| decoding?: 'async' | 'auto' | 'sync'; | ||
| importance?: 'low' | 'auto' | 'high'; | ||
| height?: number | string; | ||
| loading?: 'lazy' | 'auto' | 'eager'; | ||
| sizes?: string; | ||
| src?: string; | ||
| srcSet?: string; | ||
| srcset?: string; | ||
| useMap?: string; | ||
| usemap?: string; | ||
| width?: number | string; | ||
| } | ||
| export interface InsHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| cite?: string; | ||
| dateTime?: string; | ||
| datetime?: string; | ||
| } | ||
| export interface InputHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| accept?: string; | ||
| alt?: string; | ||
| autoComplete?: string; | ||
| autocomplete?: string; | ||
| autoFocus?: boolean; | ||
| autofocus?: boolean | string; | ||
| capture?: string; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute | ||
| checked?: boolean; | ||
| crossOrigin?: string; | ||
| crossorigin?: string; | ||
| disabled?: boolean; | ||
| form?: string; | ||
| formAction?: string; | ||
| formaction?: string; | ||
| formEncType?: string; | ||
| formenctype?: string; | ||
| formMethod?: string; | ||
| formmethod?: string; | ||
| formNoValidate?: boolean; | ||
| formnovalidate?: boolean; | ||
| formTarget?: string; | ||
| formtarget?: string; | ||
| height?: number | string; | ||
| list?: string; | ||
| max?: number | string; | ||
| maxLength?: number; | ||
| maxlength?: number | string; | ||
| min?: number | string; | ||
| minLength?: number; | ||
| minlength?: number | string; | ||
| multiple?: boolean; | ||
| name?: string; | ||
| pattern?: string; | ||
| placeholder?: string; | ||
| readOnly?: boolean; | ||
| readonly?: boolean | string; | ||
| required?: boolean; | ||
| size?: number; | ||
| src?: string; | ||
| step?: number | string; | ||
| type?: string; | ||
| value?: string | string[] | number; | ||
| width?: number | string; | ||
| } | ||
| export interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| autoFocus?: boolean; | ||
| autofocus?: boolean | string; | ||
| challenge?: string; | ||
| disabled?: boolean; | ||
| form?: string; | ||
| keyType?: string; | ||
| keytype?: string; | ||
| keyParams?: string; | ||
| keyparams?: string; | ||
| name?: string; | ||
| } | ||
| export interface LabelHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| form?: string; | ||
| htmlFor?: string; | ||
| htmlfor?: string; | ||
| } | ||
| export interface LiHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| value?: string | string[] | number; | ||
| } | ||
| export interface LinkHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| href?: string; | ||
| hrefLang?: string; | ||
| hreflang?: string; | ||
| importance?: 'low' | 'auto' | 'high'; | ||
| integrity?: string; | ||
| media?: string; | ||
| rel?: string; | ||
| sizes?: string; | ||
| type?: string; | ||
| } | ||
| export interface MapHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| name?: string; | ||
| } | ||
| export interface MenuHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| type?: string; | ||
| } | ||
| export interface MediaHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| autoPlay?: boolean; | ||
| autoplay?: boolean | string; | ||
| controls?: boolean; | ||
| crossOrigin?: string; | ||
| crossorigin?: string; | ||
| loop?: boolean; | ||
| mediaGroup?: string; | ||
| mediagroup?: string; | ||
| muted?: boolean; | ||
| preload?: string; | ||
| src?: string; | ||
| // https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events | ||
| onAbort?: (event: Event) => void; | ||
| onCanPlay?: (event: Event) => void; | ||
| onCanPlayThrough?: (event: Event) => void; | ||
| onDurationChange?: (event: Event) => void; | ||
| onEmptied?: (event: Event) => void; | ||
| onEnded?: (event: Event) => void; | ||
| onError?: (event: Event) => void; | ||
| onInterruptBegin?: (event: Event) => void; | ||
| onInterruptEnd?: (event: Event) => void; | ||
| onLoadedData?: (event: Event) => void; | ||
| onLoadedMetaData?: (event: Event) => void; | ||
| onLoadStart?: (event: Event) => void; | ||
| onMozAudioAvailable?: (event: Event) => void; | ||
| onPause?: (event: Event) => void; | ||
| onPlay?: (event: Event) => void; | ||
| onPlaying?: (event: Event) => void; | ||
| onProgress?: (event: Event) => void; | ||
| onRateChange?: (event: Event) => void; | ||
| onSeeked?: (event: Event) => void; | ||
| onSeeking?: (event: Event) => void; | ||
| onStalled?: (event: Event) => void; | ||
| onSuspend?: (event: Event) => void; | ||
| onTimeUpdate?: (event: Event) => void; | ||
| onVolumeChange?: (event: Event) => void; | ||
| onWaiting?: (event: Event) => void; | ||
| } | ||
| export interface MetaHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| charSet?: string; | ||
| charset?: string; | ||
| content?: string; | ||
| httpEquiv?: string; | ||
| httpequiv?: string; | ||
| name?: string; | ||
| } | ||
| export interface MeterHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| form?: string; | ||
| high?: number; | ||
| low?: number; | ||
| max?: number | string; | ||
| min?: number | string; | ||
| optimum?: number; | ||
| value?: string | string[] | number; | ||
| } | ||
| export interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| cite?: string; | ||
| } | ||
| export interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| classID?: string; | ||
| classid?: string; | ||
| data?: string; | ||
| form?: string; | ||
| height?: number | string; | ||
| name?: string; | ||
| type?: string; | ||
| useMap?: string; | ||
| usemap?: string; | ||
| width?: number | string; | ||
| wmode?: string; | ||
| } | ||
| export interface OlHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| reversed?: boolean; | ||
| start?: number; | ||
| } | ||
| export interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| disabled?: boolean; | ||
| label?: string; | ||
| } | ||
| export interface OptionHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| disabled?: boolean; | ||
| label?: string; | ||
| selected?: boolean; | ||
| value?: string | string[] | number; | ||
| } | ||
| export interface OutputHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| form?: string; | ||
| htmlFor?: string; | ||
| htmlfor?: string; | ||
| name?: string; | ||
| } | ||
| export interface ParamHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| name?: string; | ||
| value?: string | string[] | number; | ||
| } | ||
| export interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| max?: number | string; | ||
| value?: string | string[] | number; | ||
| } | ||
| export interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| async?: boolean; | ||
| charSet?: string; | ||
| charset?: string; | ||
| crossOrigin?: string; | ||
| crossorigin?: string; | ||
| defer?: boolean; | ||
| importance?: 'low' | 'auto' | 'high'; | ||
| integrity?: string; | ||
| nonce?: string; | ||
| src?: string; | ||
| type?: string; | ||
| } | ||
| export interface SelectHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| autoFocus?: boolean; | ||
| disabled?: boolean; | ||
| form?: string; | ||
| multiple?: boolean; | ||
| name?: string; | ||
| required?: boolean; | ||
| size?: number; | ||
| } | ||
| export interface SourceHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| media?: string; | ||
| sizes?: string; | ||
| src?: string; | ||
| srcSet?: string; | ||
| type?: string; | ||
| } | ||
| export interface StyleHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| media?: string; | ||
| nonce?: string; | ||
| scoped?: boolean; | ||
| type?: string; | ||
| } | ||
| export interface TableHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| cellPadding?: number | string; | ||
| cellpadding?: number | string; | ||
| cellSpacing?: number | string; | ||
| cellspacing?: number | string; | ||
| summary?: string; | ||
| } | ||
| export interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| autoFocus?: boolean; | ||
| autofocus?: boolean | string; | ||
| cols?: number; | ||
| disabled?: boolean; | ||
| form?: string; | ||
| maxLength?: number; | ||
| maxlength?: number | string; | ||
| minLength?: number; | ||
| minlength?: number | string; | ||
| name?: string; | ||
| placeholder?: string; | ||
| readOnly?: boolean; | ||
| readonly?: boolean | string; | ||
| required?: boolean; | ||
| rows?: number; | ||
| value?: string | string[] | number; | ||
| wrap?: string; | ||
| } | ||
| export interface TdHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| colSpan?: number; | ||
| headers?: string; | ||
| rowSpan?: number; | ||
| } | ||
| export interface ThHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| colSpan?: number; | ||
| headers?: string; | ||
| rowSpan?: number; | ||
| rowspan?: number | string; | ||
| scope?: string; | ||
| } | ||
| export interface TimeHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| dateTime?: string; | ||
| } | ||
| export interface TrackHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| default?: boolean; | ||
| kind?: string; | ||
| label?: string; | ||
| src?: string; | ||
| srcLang?: string; | ||
| srclang?: string; | ||
| } | ||
| export interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> { | ||
| height?: number | string; | ||
| playsInline?: boolean; | ||
| playsinline?: boolean | string; | ||
| poster?: string; | ||
| width?: number | string; | ||
| } | ||
| export interface HTMLAttributes<T = HTMLElement> extends DOMAttributes<T> { | ||
| // vdom specific | ||
| innerHTML?: string; | ||
| key?: string | number; | ||
| // Standard HTML Attributes | ||
| accessKey?: string; | ||
| class?: string | { [className: string]: boolean }; | ||
| contentEditable?: boolean | string; | ||
| contenteditable?: boolean | string; | ||
| contextMenu?: string; | ||
| contextmenu?: string; | ||
| dir?: string; | ||
| draggable?: boolean; | ||
| hidden?: boolean; | ||
| id?: string; | ||
| lang?: string; | ||
| spellCheck?: boolean; | ||
| spellcheck?: boolean | string; | ||
| style?: { [key: string]: string | undefined }; | ||
| tabIndex?: number; | ||
| tabindex?: number | string; | ||
| title?: string; | ||
| // Unknown | ||
| inputMode?: string; | ||
| inputmode?: string; | ||
| is?: string; | ||
| radioGroup?: string; // <command>, <menuitem> | ||
| radiogroup?: string; | ||
| part?: string; | ||
| // WAI-ARIA | ||
| role?: string; | ||
| // RDFa Attributes | ||
| about?: string; | ||
| datatype?: string; | ||
| inlist?: any; | ||
| prefix?: string; | ||
| property?: string; | ||
| resource?: string; | ||
| typeof?: string; | ||
| vocab?: string; | ||
| // Non-standard Attributes | ||
| autoCapitalize?: string; | ||
| autocapitalize?: string; | ||
| autoCorrect?: string; | ||
| autocorrect?: string; | ||
| autoSave?: string; | ||
| autosave?: string; | ||
| color?: string; | ||
| itemProp?: string; | ||
| itemprop?: string; | ||
| itemScope?: boolean; | ||
| itemscope?: boolean; | ||
| itemType?: string; | ||
| itemtype?: string; | ||
| itemID?: string; | ||
| itemid?: string; | ||
| itemRef?: string; | ||
| itemref?: string; | ||
| results?: number; | ||
| security?: string; | ||
| unselectable?: boolean; | ||
| } | ||
| export interface SVGAttributes<T = SVGElement> extends DOMAttributes<T> { | ||
| // Attributes which also defined in HTMLAttributes | ||
| // See comment in SVGDOMPropertyConfig.js | ||
| class?: string | { [className: string]: boolean }; | ||
| color?: string; | ||
| height?: number | string; | ||
| id?: string; | ||
| lang?: string; | ||
| max?: number | string; | ||
| media?: string; | ||
| method?: string; | ||
| min?: number | string; | ||
| name?: string; | ||
| style?: { [key: string]: string | undefined }; | ||
| target?: string; | ||
| type?: string; | ||
| width?: number | string; | ||
| // Other HTML properties supported by SVG elements in browsers | ||
| role?: string; | ||
| tabIndex?: number; | ||
| // SVG Specific attributes | ||
| accentHeight?: number | string; | ||
| accumulate?: 'none' | 'sum'; | ||
| additive?: 'replace' | 'sum'; | ||
| alignmentBaseline?: 'auto' | 'baseline' | 'before-edge' | 'text-before-edge' | 'middle' | 'central' | 'after-edge' | | ||
| 'text-after-edge' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'inherit'; | ||
| allowReorder?: 'no' | 'yes'; | ||
| alphabetic?: number | string; | ||
| amplitude?: number | string; | ||
| arabicForm?: 'initial' | 'medial' | 'terminal' | 'isolated'; | ||
| ascent?: number | string; | ||
| attributeName?: string; | ||
| attributeType?: string; | ||
| autoReverse?: number | string; | ||
| azimuth?: number | string; | ||
| baseFrequency?: number | string; | ||
| baselineShift?: number | string; | ||
| baseProfile?: number | string; | ||
| bbox?: number | string; | ||
| begin?: number | string; | ||
| bias?: number | string; | ||
| by?: number | string; | ||
| calcMode?: number | string; | ||
| capHeight?: number | string; | ||
| clip?: number | string; | ||
| clipPath?: string; | ||
| clipPathUnits?: number | string; | ||
| clipRule?: number | string; | ||
| colorInterpolation?: number | string; | ||
| colorInterpolationFilters?: 'auto' | 'sRGB' | 'linearRGB' | 'inherit'; | ||
| colorProfile?: number | string; | ||
| colorRendering?: number | string; | ||
| contentScriptType?: number | string; | ||
| contentStyleType?: number | string; | ||
| cursor?: number | string; | ||
| cx?: number | string; | ||
| cy?: number | string; | ||
| d?: string; | ||
| decelerate?: number | string; | ||
| descent?: number | string; | ||
| diffuseConstant?: number | string; | ||
| direction?: number | string; | ||
| display?: number | string; | ||
| divisor?: number | string; | ||
| dominantBaseline?: number | string; | ||
| dur?: number | string; | ||
| dx?: number | string; | ||
| dy?: number | string; | ||
| edgeMode?: number | string; | ||
| elevation?: number | string; | ||
| enableBackground?: number | string; | ||
| end?: number | string; | ||
| exponent?: number | string; | ||
| externalResourcesRequired?: number | string; | ||
| fill?: string; | ||
| fillOpacity?: number | string; | ||
| fillRule?: 'nonzero' | 'evenodd' | 'inherit'; | ||
| filter?: string; | ||
| filterRes?: number | string; | ||
| filterUnits?: number | string; | ||
| floodColor?: number | string; | ||
| floodOpacity?: number | string; | ||
| focusable?: number | string; | ||
| fontFamily?: string; | ||
| fontSize?: number | string; | ||
| fontSizeAdjust?: number | string; | ||
| fontStretch?: number | string; | ||
| fontStyle?: number | string; | ||
| fontVariant?: number | string; | ||
| fontWeight?: number | string; | ||
| format?: number | string; | ||
| from?: number | string; | ||
| fx?: number | string; | ||
| fy?: number | string; | ||
| g1?: number | string; | ||
| g2?: number | string; | ||
| glyphName?: number | string; | ||
| glyphOrientationHorizontal?: number | string; | ||
| glyphOrientationVertical?: number | string; | ||
| glyphRef?: number | string; | ||
| gradientTransform?: string; | ||
| gradientUnits?: string; | ||
| hanging?: number | string; | ||
| horizAdvX?: number | string; | ||
| horizOriginX?: number | string; | ||
| ideographic?: number | string; | ||
| imageRendering?: number | string; | ||
| in2?: number | string; | ||
| in?: string; | ||
| intercept?: number | string; | ||
| k1?: number | string; | ||
| k2?: number | string; | ||
| k3?: number | string; | ||
| k4?: number | string; | ||
| k?: number | string; | ||
| kernelMatrix?: number | string; | ||
| kernelUnitLength?: number | string; | ||
| kerning?: number | string; | ||
| keyPoints?: number | string; | ||
| keySplines?: number | string; | ||
| keyTimes?: number | string; | ||
| lengthAdjust?: number | string; | ||
| letterSpacing?: number | string; | ||
| lightingColor?: number | string; | ||
| limitingConeAngle?: number | string; | ||
| local?: number | string; | ||
| markerEnd?: string; | ||
| markerHeight?: number | string; | ||
| markerMid?: string; | ||
| markerStart?: string; | ||
| markerUnits?: number | string; | ||
| markerWidth?: number | string; | ||
| mask?: string; | ||
| maskContentUnits?: number | string; | ||
| maskUnits?: number | string; | ||
| mathematical?: number | string; | ||
| mode?: number | string; | ||
| numOctaves?: number | string; | ||
| offset?: number | string; | ||
| opacity?: number | string; | ||
| operator?: number | string; | ||
| order?: number | string; | ||
| orient?: number | string; | ||
| orientation?: number | string; | ||
| origin?: number | string; | ||
| overflow?: number | string; | ||
| overlinePosition?: number | string; | ||
| overlineThickness?: number | string; | ||
| paintOrder?: number | string; | ||
| panose1?: number | string; | ||
| pathLength?: number | string; | ||
| patternContentUnits?: string; | ||
| patternTransform?: number | string; | ||
| patternUnits?: string; | ||
| pointerEvents?: number | string; | ||
| points?: string; | ||
| pointsAtX?: number | string; | ||
| pointsAtY?: number | string; | ||
| pointsAtZ?: number | string; | ||
| preserveAlpha?: number | string; | ||
| preserveAspectRatio?: string; | ||
| primitiveUnits?: number | string; | ||
| r?: number | string; | ||
| radius?: number | string; | ||
| refX?: number | string; | ||
| refY?: number | string; | ||
| renderingIntent?: number | string; | ||
| repeatCount?: number | string; | ||
| repeatDur?: number | string; | ||
| requiredExtensions?: number | string; | ||
| requiredFeatures?: number | string; | ||
| restart?: number | string; | ||
| result?: string; | ||
| rotate?: number | string; | ||
| rx?: number | string; | ||
| ry?: number | string; | ||
| scale?: number | string; | ||
| seed?: number | string; | ||
| shapeRendering?: number | string; | ||
| slope?: number | string; | ||
| spacing?: number | string; | ||
| specularConstant?: number | string; | ||
| specularExponent?: number | string; | ||
| speed?: number | string; | ||
| spreadMethod?: string; | ||
| startOffset?: number | string; | ||
| stdDeviation?: number | string; | ||
| stemh?: number | string; | ||
| stemv?: number | string; | ||
| stitchTiles?: number | string; | ||
| stopColor?: string; | ||
| stopOpacity?: number | string; | ||
| strikethroughPosition?: number | string; | ||
| strikethroughThickness?: number | string; | ||
| string?: number | string; | ||
| stroke?: string; | ||
| strokeDasharray?: string | number; | ||
| strokeDashoffset?: string | number; | ||
| strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit'; | ||
| strokeLinejoin?: 'miter' | 'round' | 'bevel' | 'inherit'; | ||
| strokeMiterlimit?: string; | ||
| strokeOpacity?: number | string; | ||
| strokeWidth?: number | string; | ||
| surfaceScale?: number | string; | ||
| systemLanguage?: number | string; | ||
| tableValues?: number | string; | ||
| targetX?: number | string; | ||
| targetY?: number | string; | ||
| textAnchor?: string; | ||
| textDecoration?: number | string; | ||
| textLength?: number | string; | ||
| textRendering?: number | string; | ||
| to?: number | string; | ||
| transform?: string; | ||
| u1?: number | string; | ||
| u2?: number | string; | ||
| underlinePosition?: number | string; | ||
| underlineThickness?: number | string; | ||
| unicode?: number | string; | ||
| unicodeBidi?: number | string; | ||
| unicodeRange?: number | string; | ||
| unitsPerEm?: number | string; | ||
| vAlphabetic?: number | string; | ||
| values?: string; | ||
| vectorEffect?: number | string; | ||
| version?: string; | ||
| vertAdvY?: number | string; | ||
| vertOriginX?: number | string; | ||
| vertOriginY?: number | string; | ||
| vHanging?: number | string; | ||
| vIdeographic?: number | string; | ||
| viewBox?: string; | ||
| viewTarget?: number | string; | ||
| visibility?: number | string; | ||
| vMathematical?: number | string; | ||
| widths?: number | string; | ||
| wordSpacing?: number | string; | ||
| writingMode?: number | string; | ||
| x1?: number | string; | ||
| x2?: number | string; | ||
| x?: number | string; | ||
| xChannelSelector?: string; | ||
| xHeight?: number | string; | ||
| xlinkActuate?: string; | ||
| xlinkArcrole?: string; | ||
| xlinkHref?: string; | ||
| xlinkRole?: string; | ||
| xlinkShow?: string; | ||
| xlinkTitle?: string; | ||
| xlinkType?: string; | ||
| xmlBase?: string; | ||
| xmlLang?: string; | ||
| xmlns?: string; | ||
| xmlnsXlink?: string; | ||
| xmlSpace?: string; | ||
| y1?: number | string; | ||
| y2?: number | string; | ||
| y?: number | string; | ||
| yChannelSelector?: string; | ||
| z?: number | string; | ||
| zoomAndPan?: string; | ||
| } | ||
| export interface DOMAttributes<T = Element> { | ||
| ref?: (elm?: T) => void; | ||
| slot?: string; | ||
| // Clipboard Events | ||
| onCopy?: (event: ClipboardEvent) => void; | ||
| onCopyCapture?: (event: ClipboardEvent) => void; | ||
| onCut?: (event: ClipboardEvent) => void; | ||
| onCutCapture?: (event: ClipboardEvent) => void; | ||
| onPaste?: (event: ClipboardEvent) => void; | ||
| onPasteCapture?: (event: ClipboardEvent) => void; | ||
| // Composition Events | ||
| onCompositionEnd?: (event: CompositionEvent) => void; | ||
| onCompositionEndCapture?: (event: CompositionEvent) => void; | ||
| onCompositionStart?: (event: CompositionEvent) => void; | ||
| onCompositionStartCapture?: (event: CompositionEvent) => void; | ||
| onCompositionUpdate?: (event: CompositionEvent) => void; | ||
| onCompositionUpdateCapture?: (event: CompositionEvent) => void; | ||
| // Focus Events | ||
| onFocus?: (event: FocusEvent) => void; | ||
| onFocusCapture?: (event: FocusEvent) => void; | ||
| onBlur?: (event: FocusEvent) => void; | ||
| onBlurCapture?: (event: FocusEvent) => void; | ||
| // Form Events | ||
| onChange?: (event: Event) => void; | ||
| onChangeCapture?: (event: Event) => void; | ||
| onInput?: (event: Event) => void; | ||
| onInputCapture?: (event: Event) => void; | ||
| onReset?: (event: Event) => void; | ||
| onResetCapture?: (event: Event) => void; | ||
| onSubmit?: (event: Event) => void; | ||
| onSubmitCapture?: (event: Event) => void; | ||
| onInvalid?: (event: Event) => void; | ||
| onInvalidCapture?: (event: Event) => void; | ||
| // Image Events | ||
| onLoad?: (event: Event) => void; | ||
| onLoadCapture?: (event: Event) => void; | ||
| onError?: (event: Event) => void; // also a Media Event | ||
| onErrorCapture?: (event: Event) => void; // also a Media Event | ||
| // Keyboard Events | ||
| onKeyDown?: (event: KeyboardEvent) => void; | ||
| onKeyDownCapture?: (event: KeyboardEvent) => void; | ||
| onKeyPress?: (event: KeyboardEvent) => void; | ||
| onKeyPressCapture?: (event: KeyboardEvent) => void; | ||
| onKeyUp?: (event: KeyboardEvent) => void; | ||
| onKeyUpCapture?: (event: KeyboardEvent) => void; | ||
| // MouseEvents | ||
| onAuxClick?: (event: MouseEvent) => void; | ||
| onClick?: (event: MouseEvent) => void; | ||
| onClickCapture?: (event: MouseEvent) => void; | ||
| onContextMenu?: (event: MouseEvent) => void; | ||
| onContextMenuCapture?: (event: MouseEvent) => void; | ||
| onDblClick?: (event: MouseEvent) => void; | ||
| onDblClickCapture?: (event: MouseEvent) => void; | ||
| onDrag?: (event: DragEvent) => void; | ||
| onDragCapture?: (event: DragEvent) => void; | ||
| onDragEnd?: (event: DragEvent) => void; | ||
| onDragEndCapture?: (event: DragEvent) => void; | ||
| onDragEnter?: (event: DragEvent) => void; | ||
| onDragEnterCapture?: (event: DragEvent) => void; | ||
| onDragExit?: (event: DragEvent) => void; | ||
| onDragExitCapture?: (event: DragEvent) => void; | ||
| onDragLeave?: (event: DragEvent) => void; | ||
| onDragLeaveCapture?: (event: DragEvent) => void; | ||
| onDragOver?: (event: DragEvent) => void; | ||
| onDragOverCapture?: (event: DragEvent) => void; | ||
| onDragStart?: (event: DragEvent) => void; | ||
| onDragStartCapture?: (event: DragEvent) => void; | ||
| onDrop?: (event: DragEvent) => void; | ||
| onDropCapture?: (event: DragEvent) => void; | ||
| onMouseDown?: (event: MouseEvent) => void; | ||
| onMouseDownCapture?: (event: MouseEvent) => void; | ||
| onMouseEnter?: (event: MouseEvent) => void; | ||
| onMouseLeave?: (event: MouseEvent) => void; | ||
| onMouseMove?: (event: MouseEvent) => void; | ||
| onMouseMoveCapture?: (event: MouseEvent) => void; | ||
| onMouseOut?: (event: MouseEvent) => void; | ||
| onMouseOutCapture?: (event: MouseEvent) => void; | ||
| onMouseOver?: (event: MouseEvent) => void; | ||
| onMouseOverCapture?: (event: MouseEvent) => void; | ||
| onMouseUp?: (event: MouseEvent) => void; | ||
| onMouseUpCapture?: (event: MouseEvent) => void; | ||
| // Touch Events | ||
| onTouchCancel?: (event: TouchEvent) => void; | ||
| onTouchCancelCapture?: (event: TouchEvent) => void; | ||
| onTouchEnd?: (event: TouchEvent) => void; | ||
| onTouchEndCapture?: (event: TouchEvent) => void; | ||
| onTouchMove?: (event: TouchEvent) => void; | ||
| onTouchMoveCapture?: (event: TouchEvent) => void; | ||
| onTouchStart?: (event: TouchEvent) => void; | ||
| onTouchStartCapture?: (event: TouchEvent) => void; | ||
| // Pointer Events | ||
| onPointerDown?: (event: PointerEvent) => void; | ||
| onPointerDownCapture?: (event: PointerEvent) => void; | ||
| onPointerMove?: (event: PointerEvent) => void; | ||
| onPointerMoveCapture?: (event: PointerEvent) => void; | ||
| onPointerUp?: (event: PointerEvent) => void; | ||
| onPointerUpCapture?: (event: PointerEvent) => void; | ||
| onPointerCancel?: (event: PointerEvent) => void; | ||
| onPointerCancelCapture?: (event: PointerEvent) => void; | ||
| onPointerEnter?: (event: PointerEvent) => void; | ||
| onPointerEnterCapture?: (event: PointerEvent) => void; | ||
| onPointerLeave?: (event: PointerEvent) => void; | ||
| onPointerLeaveCapture?: (event: PointerEvent) => void; | ||
| onPointerOver?: (event: PointerEvent) => void; | ||
| onPointerOverCapture?: (event: PointerEvent) => void; | ||
| onPointerOut?: (event: PointerEvent) => void; | ||
| onPointerOutCapture?: (event: PointerEvent) => void; | ||
| onGotPointerCapture?: (event: PointerEvent) => void; | ||
| onGotPointerCaptureCapture?: (event: PointerEvent) => void; | ||
| onLostPointerCapture?: (event: PointerEvent) => void; | ||
| onLostPointerCaptureCapture?: (event: PointerEvent) => void; | ||
| // UI Events | ||
| onScroll?: (event: UIEvent) => void; | ||
| onScrollCapture?: (event: UIEvent) => void; | ||
| // Wheel Events | ||
| onWheel?: (event: WheelEvent) => void; | ||
| onWheelCapture?: (event: WheelEvent) => void; | ||
| // Animation Events | ||
| onAnimationStart?: (event: AnimationEvent) => void; | ||
| onAnimationStartCapture?: (event: AnimationEvent) => void; | ||
| onAnimationEnd?: (event: AnimationEvent) => void; | ||
| onAnimationEndCapture?: (event: AnimationEvent) => void; | ||
| onAnimationIteration?: (event: AnimationEvent) => void; | ||
| onAnimationIterationCapture?: (event: AnimationEvent) => void; | ||
| // Transition Events | ||
| onTransitionEnd?: (event: TransitionEvent) => void; | ||
| onTransitionEndCapture?: (event: TransitionEvent) => void; | ||
| } | ||
| } | ||
| export interface Hyperscript { | ||
| (sel: any): VNode; | ||
| (sel: Node, data: VNodeData): VNode; | ||
| (sel: any, data: VNodeData): VNode; | ||
| (sel: any, text: string): VNode; | ||
| (sel: any, children: Array<VNode | undefined | null>): VNode; | ||
| (sel: any, data: VNodeData, text: string): VNode; | ||
| (sel: any, data: VNodeData, children: Array<VNode | undefined | null>): VNode; | ||
| (sel: any, data: VNodeData, children: VNode): VNode; | ||
| } | ||
| export interface VNodeData { | ||
| class?: {[className: string]: boolean}; | ||
| style?: any; | ||
| [attrName: string]: any; | ||
| } | ||
| export type ChildType = VNode | number | string; | ||
| export type PropsType = VNodeProdData | number | string | null; | ||
| export interface VNodeProdData { | ||
| key?: string | number; | ||
| class?: {[className: string]: boolean} | string; | ||
| className?: {[className: string]: boolean} | string; | ||
| style?: any; | ||
| [key: string]: any; | ||
| } | ||
| export interface FunctionalUtilities { | ||
| forEach: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => void) => void; | ||
| map: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => ChildNode) => VNode[]; | ||
| } | ||
| export interface FunctionalComponent<T = {}> { | ||
| (props: T, children: VNode[], utils: FunctionalUtilities): VNode | VNode[]; | ||
| } | ||
| export interface VNode { | ||
| $flags$: number; | ||
| $tag$: string | number | Function; | ||
| $elm$: any; | ||
| $text$: string; | ||
| $children$: VNode[]; | ||
| $attrs$?: any; | ||
| $name$?: string; | ||
| $key$?: string | number; | ||
| } | ||
| export interface ChildNode { | ||
| vtag?: string | number | Function; | ||
| vkey?: string | number; | ||
| vtext?: string; | ||
| vchildren?: VNode[]; | ||
| vattrs?: any; | ||
| vname?: string; | ||
| } |
@@ -5,9 +5,7 @@ 'use strict'; | ||
| const index = require('./index-0661ae79.js'); | ||
| const patch = require('./patch-f742a090.js'); | ||
| const core = require('./core-f2d12a35.js'); | ||
| const defineCustomElements = (win, options) => { | ||
| if (typeof window === 'undefined') return Promise.resolve(); | ||
| return patch.patchEsm().then(() => { | ||
| return index.bootstrapLazy([["ms-editor.cjs",[[1,"ms-editor",{"token":[1],"config":[8],"content":[1],"modalOpen":[32],"save":[64],"test":[64],"spinner":[64],"start":[64],"sendTest":[64],"load":[64],"preview":[64]},[[8,"message","componentWillLoad"]]]]]], options); | ||
| return core.patchEsm().then(() => { | ||
| core.bootstrapLazy([["ms-editor.cjs",[[1,"ms-editor",{"token":[1],"config":[8],"content":[1],"modalOpen":[32],"save":[64],"test":[64],"spinner":[64],"start":[64],"sendTest":[64],"beforeUnload":[64],"load":[64],"preview":[64]},[[8,"message","componentWillLoad"]]]]]], options); | ||
| }); | ||
@@ -14,0 +12,0 @@ }; |
@@ -5,12 +5,10 @@ 'use strict'; | ||
| const index = require('./index-0661ae79.js'); | ||
| const core = require('./core-f2d12a35.js'); | ||
| const editorCss = ":host{display:block;width:100%;border:0;height:100vh}iframe{height:100%;width:100%;min-width:1024px;border:0;z-index:9999;top:0}iframe.open{position:fixed}"; | ||
| const Editor = class { | ||
| constructor(hostRef) { | ||
| index.registerInstance(this, hostRef); | ||
| this.editorEvent = index.createEvent(this, "editorEvent", 7); | ||
| core.registerInstance(this, hostRef); | ||
| this.content = ''; | ||
| this.modalOpen = false; | ||
| this.editorEvent = core.createEvent(this, "editorEvent", 7); | ||
| } | ||
@@ -43,2 +41,5 @@ sendMessage(action, data) { | ||
| } | ||
| async beforeUnload(evt) { | ||
| this.sendMessage("beforeUnload", evt); | ||
| } | ||
| async load(data) { | ||
@@ -75,3 +76,3 @@ this.sendMessage("load", data); | ||
| render() { | ||
| return (index.h("iframe", { class: { 'open': this.modalOpen }, src: this.mscFrameworkUrl })); | ||
| return (core.h("iframe", { class: { 'open': this.modalOpen }, src: this.mscFrameworkUrl })); | ||
| } | ||
@@ -147,6 +148,6 @@ editorDidOpen() { | ||
| } | ||
| get element() { return index.getElement(this); } | ||
| get element() { return core.getElement(this); } | ||
| static get style() { return ":host{display:block;height:100vh}:host,iframe{width:100%;border:0}iframe{height:100%;min-width:1024px;z-index:9999;top:0}iframe.open{position:fixed}"; } | ||
| }; | ||
| Editor.style = editorCss; | ||
| exports.ms_editor = Editor; |
| 'use strict'; | ||
| const index = require('./index-0661ae79.js'); | ||
| const patch = require('./patch-f742a090.js'); | ||
| const core = require('./core-f2d12a35.js'); | ||
| patch.patchBrowser().then(options => { | ||
| return index.bootstrapLazy([["ms-editor.cjs",[[1,"ms-editor",{"token":[1],"config":[8],"content":[1],"modalOpen":[32],"save":[64],"test":[64],"spinner":[64],"start":[64],"sendTest":[64],"load":[64],"preview":[64]},[[8,"message","componentWillLoad"]]]]]], options); | ||
| core.patchBrowser().then(options => { | ||
| return core.bootstrapLazy([["ms-editor.cjs",[[1,"ms-editor",{"token":[1],"config":[8],"content":[1],"modalOpen":[32],"save":[64],"test":[64],"spinner":[64],"start":[64],"sendTest":[64],"beforeUnload":[64],"load":[64],"preview":[64]},[[8,"message","componentWillLoad"]]]]]], options); | ||
| }); |
| { | ||
| "entries": [ | ||
| "./components/editor/editor.js" | ||
| "components/editor/editor.js" | ||
| ], | ||
| "compiler": { | ||
| "name": "@stencil/core", | ||
| "version": "1.17.3", | ||
| "typescriptVersion": "3.9.7" | ||
| "version": "1.8.5", | ||
| "typescriptVersion": "3.7.2" | ||
| }, | ||
@@ -10,0 +10,0 @@ "collections": [], |
@@ -1,2 +0,2 @@ | ||
| import { Component, Element, Event, h, Listen, Method, Prop, State } from '@stencil/core'; | ||
| import { h } from "@stencil/core"; | ||
| export class Editor { | ||
@@ -33,2 +33,5 @@ constructor() { | ||
| } | ||
| async beforeUnload(evt) { | ||
| this.sendMessage("beforeUnload", evt); | ||
| } | ||
| async load(data) { | ||
@@ -255,3 +258,3 @@ this.sendMessage("load", data); | ||
| "complexType": { | ||
| "signature": "(behavior: 'hide' | 'show') => Promise<void>", | ||
| "signature": "(behavior: \"hide\" | \"show\") => Promise<void>", | ||
| "parameters": [{ | ||
@@ -311,2 +314,24 @@ "tags": [], | ||
| }, | ||
| "beforeUnload": { | ||
| "complexType": { | ||
| "signature": "(evt: BeforeUnloadEvent) => Promise<void>", | ||
| "parameters": [{ | ||
| "tags": [], | ||
| "text": "" | ||
| }], | ||
| "references": { | ||
| "Promise": { | ||
| "location": "global" | ||
| }, | ||
| "BeforeUnloadEvent": { | ||
| "location": "global" | ||
| } | ||
| }, | ||
| "return": "Promise<void>" | ||
| }, | ||
| "docs": { | ||
| "text": "", | ||
| "tags": [] | ||
| } | ||
| }, | ||
| "load": { | ||
@@ -313,0 +338,0 @@ "complexType": { |
@@ -1,10 +0,7 @@ | ||
| import { b as bootstrapLazy } from './index-05772288.js'; | ||
| import { a as patchEsm } from './patch-7e2b83c7.js'; | ||
| import { a as patchEsm, b as bootstrapLazy } from './core-a07e1759.js'; | ||
| var defineCustomElements = function (win, options) { | ||
| if (typeof window === 'undefined') | ||
| return Promise.resolve(); | ||
| return patchEsm().then(function () { | ||
| return bootstrapLazy([["ms-editor", [[1, "ms-editor", { "token": [1], "config": [8], "content": [1], "modalOpen": [32], "save": [64], "test": [64], "spinner": [64], "start": [64], "sendTest": [64], "load": [64], "preview": [64] }, [[8, "message", "componentWillLoad"]]]]]], options); | ||
| bootstrapLazy([["ms-editor", [[1, "ms-editor", { "token": [1], "config": [8], "content": [1], "modalOpen": [32], "save": [64], "test": [64], "spinner": [64], "start": [64], "sendTest": [64], "beforeUnload": [64], "load": [64], "preview": [64] }, [[8, "message", "componentWillLoad"]]]]]], options); | ||
| }); | ||
| }; | ||
| export { defineCustomElements }; |
@@ -37,10 +37,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| }; | ||
| import { r as registerInstance, c as createEvent, h, g as getElement } from './index-05772288.js'; | ||
| var editorCss = ":host{display:block;width:100%;border:0;height:100vh}iframe{height:100%;width:100%;min-width:1024px;border:0;z-index:9999;top:0}iframe.open{position:fixed}"; | ||
| import { r as registerInstance, c as createEvent, h, g as getElement } from './core-a07e1759.js'; | ||
| var Editor = /** @class */ (function () { | ||
| function class_1(hostRef) { | ||
| registerInstance(this, hostRef); | ||
| this.editorEvent = createEvent(this, "editorEvent", 7); | ||
| this.content = ''; | ||
| this.modalOpen = false; | ||
| this.editorEvent = createEvent(this, "editorEvent", 7); | ||
| } | ||
@@ -99,2 +98,10 @@ class_1.prototype.sendMessage = function (action, data) { | ||
| }; | ||
| class_1.prototype.beforeUnload = function (evt) { | ||
| return __awaiter(this, void 0, void 0, function () { | ||
| return __generator(this, function (_a) { | ||
| this.sendMessage("beforeUnload", evt); | ||
| return [2 /*return*/]; | ||
| }); | ||
| }); | ||
| }; | ||
| class_1.prototype.load = function (data) { | ||
@@ -244,8 +251,12 @@ return __awaiter(this, void 0, void 0, function () { | ||
| get: function () { return getElement(this); }, | ||
| enumerable: false, | ||
| enumerable: true, | ||
| configurable: true | ||
| }); | ||
| Object.defineProperty(class_1, "style", { | ||
| get: function () { return ":host{display:block;height:100vh}:host,iframe{width:100%;border:0}iframe{height:100%;min-width:1024px;z-index:9999;top:0}iframe.open{position:fixed}"; }, | ||
| enumerable: true, | ||
| configurable: true | ||
| }); | ||
| return class_1; | ||
| }()); | ||
| Editor.style = editorCss; | ||
| export { Editor as ms_editor }; |
@@ -1,5 +0,4 @@ | ||
| import { b as bootstrapLazy } from './index-05772288.js'; | ||
| import { p as patchBrowser } from './patch-7e2b83c7.js'; | ||
| import { p as patchBrowser, b as bootstrapLazy } from './core-a07e1759.js'; | ||
| patchBrowser().then(function (options) { | ||
| return bootstrapLazy([["ms-editor", [[1, "ms-editor", { "token": [1], "config": [8], "content": [1], "modalOpen": [32], "save": [64], "test": [64], "spinner": [64], "start": [64], "sendTest": [64], "load": [64], "preview": [64] }, [[8, "message", "componentWillLoad"]]]]]], options); | ||
| return bootstrapLazy([["ms-editor", [[1, "ms-editor", { "token": [1], "config": [8], "content": [1], "modalOpen": [32], "save": [64], "test": [64], "spinner": [64], "start": [64], "sendTest": [64], "beforeUnload": [64], "load": [64], "preview": [64] }, [[8, "message", "componentWillLoad"]]]]]], options); | ||
| }); |
@@ -1,8 +0,6 @@ | ||
| import { b as bootstrapLazy } from './index-05772288.js'; | ||
| import { a as patchEsm } from './patch-7e2b83c7.js'; | ||
| import { a as patchEsm, b as bootstrapLazy } from './core-a07e1759.js'; | ||
| const defineCustomElements = (win, options) => { | ||
| if (typeof window === 'undefined') return Promise.resolve(); | ||
| return patchEsm().then(() => { | ||
| return bootstrapLazy([["ms-editor",[[1,"ms-editor",{"token":[1],"config":[8],"content":[1],"modalOpen":[32],"save":[64],"test":[64],"spinner":[64],"start":[64],"sendTest":[64],"load":[64],"preview":[64]},[[8,"message","componentWillLoad"]]]]]], options); | ||
| bootstrapLazy([["ms-editor",[[1,"ms-editor",{"token":[1],"config":[8],"content":[1],"modalOpen":[32],"save":[64],"test":[64],"spinner":[64],"start":[64],"sendTest":[64],"beforeUnload":[64],"load":[64],"preview":[64]},[[8,"message","componentWillLoad"]]]]]], options); | ||
| }); | ||
@@ -9,0 +7,0 @@ }; |
@@ -1,11 +0,9 @@ | ||
| import { r as registerInstance, c as createEvent, h, g as getElement } from './index-05772288.js'; | ||
| import { r as registerInstance, c as createEvent, h, g as getElement } from './core-a07e1759.js'; | ||
| const editorCss = ":host{display:block;width:100%;border:0;height:100vh}iframe{height:100%;width:100%;min-width:1024px;border:0;z-index:9999;top:0}iframe.open{position:fixed}"; | ||
| const Editor = class { | ||
| constructor(hostRef) { | ||
| registerInstance(this, hostRef); | ||
| this.editorEvent = createEvent(this, "editorEvent", 7); | ||
| this.content = ''; | ||
| this.modalOpen = false; | ||
| this.editorEvent = createEvent(this, "editorEvent", 7); | ||
| } | ||
@@ -38,2 +36,5 @@ sendMessage(action, data) { | ||
| } | ||
| async beforeUnload(evt) { | ||
| this.sendMessage("beforeUnload", evt); | ||
| } | ||
| async load(data) { | ||
@@ -142,5 +143,5 @@ this.sendMessage("load", data); | ||
| get element() { return getElement(this); } | ||
| static get style() { return ":host{display:block;height:100vh}:host,iframe{width:100%;border:0}iframe{height:100%;min-width:1024px;z-index:9999;top:0}iframe.open{position:fixed}"; } | ||
| }; | ||
| Editor.style = editorCss; | ||
| export { Editor as ms_editor }; |
@@ -1,6 +0,5 @@ | ||
| import { b as bootstrapLazy } from './index-05772288.js'; | ||
| import { p as patchBrowser } from './patch-7e2b83c7.js'; | ||
| import { p as patchBrowser, b as bootstrapLazy } from './core-a07e1759.js'; | ||
| patchBrowser().then(options => { | ||
| return bootstrapLazy([["ms-editor",[[1,"ms-editor",{"token":[1],"config":[8],"content":[1],"modalOpen":[32],"save":[64],"test":[64],"spinner":[64],"start":[64],"sendTest":[64],"load":[64],"preview":[64]},[[8,"message","componentWillLoad"]]]]]], options); | ||
| return bootstrapLazy([["ms-editor",[[1,"ms-editor",{"token":[1],"config":[8],"content":[1],"modalOpen":[32],"save":[64],"test":[64],"spinner":[64],"start":[64],"sendTest":[64],"beforeUnload":[64],"load":[64],"preview":[64]},[[8,"message","componentWillLoad"]]]]]], options); | ||
| }); |
@@ -1,1 +0,658 @@ | ||
| var StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@";function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}var VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.substr(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return Object.assign(Object.assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return Object.assign(Object.assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\."+t,"."+r)}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t=s.scopeId+"-"+this.count,o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window); | ||
| /* | ||
| Extremely simple css parser. Intended to be not more than what we need | ||
| and definitely not necessarily correct =). | ||
| */ | ||
| /** @unrestricted */ | ||
| var StyleNode = /** @class */ (function () { | ||
| function StyleNode() { | ||
| this.start = 0; | ||
| this.end = 0; | ||
| this.previous = null; | ||
| this.parent = null; | ||
| this.rules = null; | ||
| this.parsedCssText = ''; | ||
| this.cssText = ''; | ||
| this.atRule = false; | ||
| this.type = 0; | ||
| this.keyframesName = ''; | ||
| this.selector = ''; | ||
| this.parsedSelector = ''; | ||
| } | ||
| return StyleNode; | ||
| }()); | ||
| // given a string of css, return a simple rule tree | ||
| /** | ||
| * @param {string} text | ||
| * @return {StyleNode} | ||
| */ | ||
| function parse(text) { | ||
| text = clean(text); | ||
| return parseCss(lex(text), text); | ||
| } | ||
| // remove stuff we don't care about that may hinder parsing | ||
| /** | ||
| * @param {string} cssText | ||
| * @return {string} | ||
| */ | ||
| function clean(cssText) { | ||
| return cssText.replace(RX.comments, '').replace(RX.port, ''); | ||
| } | ||
| // super simple {...} lexer that returns a node tree | ||
| /** | ||
| * @param {string} text | ||
| * @return {StyleNode} | ||
| */ | ||
| function lex(text) { | ||
| var root = new StyleNode(); | ||
| root['start'] = 0; | ||
| root['end'] = text.length; | ||
| var n = root; | ||
| for (var i = 0, l = text.length; i < l; i++) { | ||
| if (text[i] === OPEN_BRACE) { | ||
| if (!n['rules']) { | ||
| n['rules'] = []; | ||
| } | ||
| var p = n; | ||
| var previous = p['rules'][p['rules'].length - 1] || null; | ||
| n = new StyleNode(); | ||
| n['start'] = i + 1; | ||
| n['parent'] = p; | ||
| n['previous'] = previous; | ||
| p['rules'].push(n); | ||
| } | ||
| else if (text[i] === CLOSE_BRACE) { | ||
| n['end'] = i + 1; | ||
| n = n['parent'] || root; | ||
| } | ||
| } | ||
| return root; | ||
| } | ||
| // add selectors/cssText to node tree | ||
| /** | ||
| * @param {StyleNode} node | ||
| * @param {string} text | ||
| * @return {StyleNode} | ||
| */ | ||
| function parseCss(node, text) { | ||
| var t = text.substring(node['start'], node['end'] - 1); | ||
| node['parsedCssText'] = node['cssText'] = t.trim(); | ||
| if (node.parent) { | ||
| var ss = node.previous ? node.previous['end'] : node.parent['start']; | ||
| t = text.substring(ss, node['start'] - 1); | ||
| t = _expandUnicodeEscapes(t); | ||
| t = t.replace(RX.multipleSpaces, ' '); | ||
| // TODO(sorvell): ad hoc; make selector include only after last ; | ||
| // helps with mixin syntax | ||
| t = t.substring(t.lastIndexOf(';') + 1); | ||
| var s = node['parsedSelector'] = node['selector'] = t.trim(); | ||
| node['atRule'] = (s.indexOf(AT_START) === 0); | ||
| // note, support a subset of rule types... | ||
| if (node['atRule']) { | ||
| if (s.indexOf(MEDIA_START) === 0) { | ||
| node['type'] = types.MEDIA_RULE; | ||
| } | ||
| else if (s.match(RX.keyframesRule)) { | ||
| node['type'] = types.KEYFRAMES_RULE; | ||
| node['keyframesName'] = node['selector'].split(RX.multipleSpaces).pop(); | ||
| } | ||
| } | ||
| else { | ||
| if (s.indexOf(VAR_START) === 0) { | ||
| node['type'] = types.MIXIN_RULE; | ||
| } | ||
| else { | ||
| node['type'] = types.STYLE_RULE; | ||
| } | ||
| } | ||
| } | ||
| var r$ = node['rules']; | ||
| if (r$) { | ||
| for (var i = 0, l = r$.length, r = void 0; (i < l) && (r = r$[i]); i++) { | ||
| parseCss(r, text); | ||
| } | ||
| } | ||
| return node; | ||
| } | ||
| /** | ||
| * conversion of sort unicode escapes with spaces like `\33 ` (and longer) into | ||
| * expanded form that doesn't require trailing space `\000033` | ||
| * @param {string} s | ||
| * @return {string} | ||
| */ | ||
| function _expandUnicodeEscapes(s) { | ||
| return s.replace(/\\([0-9a-f]{1,6})\s/gi, function () { | ||
| var code = arguments[1], repeat = 6 - code.length; | ||
| while (repeat--) { | ||
| code = '0' + code; | ||
| } | ||
| return '\\' + code; | ||
| }); | ||
| } | ||
| /** @enum {number} */ | ||
| var types = { | ||
| STYLE_RULE: 1, | ||
| KEYFRAMES_RULE: 7, | ||
| MEDIA_RULE: 4, | ||
| MIXIN_RULE: 1000 | ||
| }; | ||
| var OPEN_BRACE = '{'; | ||
| var CLOSE_BRACE = '}'; | ||
| // helper regexp's | ||
| var RX = { | ||
| comments: /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim, | ||
| port: /@import[^;]*;/gim, | ||
| customProp: /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim, | ||
| mixinProp: /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim, | ||
| mixinApply: /@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim, | ||
| varApply: /[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim, | ||
| keyframesRule: /^@[^\s]*keyframes/, | ||
| multipleSpaces: /\s+/g | ||
| }; | ||
| var VAR_START = '--'; | ||
| var MEDIA_START = '@media'; | ||
| var AT_START = '@'; | ||
| function findRegex(regex, cssText, offset) { | ||
| regex['lastIndex'] = 0; | ||
| var r = cssText.substring(offset).match(regex); | ||
| if (r) { | ||
| var start = offset + r['index']; | ||
| return { | ||
| start: start, | ||
| end: start + r[0].length | ||
| }; | ||
| } | ||
| return null; | ||
| } | ||
| var VAR_USAGE_START = /\bvar\(/; | ||
| var VAR_ASSIGN_START = /\B--[\w-]+\s*:/; | ||
| var COMMENTS = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim; | ||
| var TRAILING_LINES = /^[\t ]+\n/gm; | ||
| function resolveVar(props, prop, fallback) { | ||
| if (props[prop]) { | ||
| return props[prop]; | ||
| } | ||
| if (fallback) { | ||
| return executeTemplate(fallback, props); | ||
| } | ||
| return ''; | ||
| } | ||
| function findVarEndIndex(cssText, offset) { | ||
| var count = 0; | ||
| var i = offset; | ||
| for (; i < cssText.length; i++) { | ||
| var c = cssText[i]; | ||
| if (c === '(') { | ||
| count++; | ||
| } | ||
| else if (c === ')') { | ||
| count--; | ||
| if (count <= 0) { | ||
| return i + 1; | ||
| } | ||
| } | ||
| } | ||
| return i; | ||
| } | ||
| function parseVar(cssText, offset) { | ||
| var varPos = findRegex(VAR_USAGE_START, cssText, offset); | ||
| if (!varPos) { | ||
| return null; | ||
| } | ||
| var endVar = findVarEndIndex(cssText, varPos.start); | ||
| var varContent = cssText.substring(varPos.end, endVar - 1); | ||
| var _a = varContent.split(','), propName = _a[0], fallback = _a.slice(1); | ||
| return { | ||
| start: varPos.start, | ||
| end: endVar, | ||
| propName: propName.trim(), | ||
| fallback: fallback.length > 0 ? fallback.join(',').trim() : undefined | ||
| }; | ||
| } | ||
| function compileVar(cssText, template, offset) { | ||
| var varMeta = parseVar(cssText, offset); | ||
| if (!varMeta) { | ||
| template.push(cssText.substring(offset, cssText.length)); | ||
| return cssText.length; | ||
| } | ||
| var propName = varMeta.propName; | ||
| var fallback = varMeta.fallback != null ? compileTemplate(varMeta.fallback) : undefined; | ||
| template.push(cssText.substring(offset, varMeta.start), function (params) { return resolveVar(params, propName, fallback); }); | ||
| return varMeta.end; | ||
| } | ||
| function executeTemplate(template, props) { | ||
| var final = ''; | ||
| for (var i = 0; i < template.length; i++) { | ||
| var s = template[i]; | ||
| final += (typeof s === 'string') | ||
| ? s | ||
| : s(props); | ||
| } | ||
| return final; | ||
| } | ||
| function findEndValue(cssText, offset) { | ||
| var onStr = false; | ||
| var double = false; | ||
| var i = offset; | ||
| for (; i < cssText.length; i++) { | ||
| var c = cssText[i]; | ||
| if (onStr) { | ||
| if (double && c === '"') { | ||
| onStr = false; | ||
| } | ||
| if (!double && c === '\'') { | ||
| onStr = false; | ||
| } | ||
| } | ||
| else { | ||
| if (c === '"') { | ||
| onStr = true; | ||
| double = true; | ||
| } | ||
| else if (c === '\'') { | ||
| onStr = true; | ||
| double = false; | ||
| } | ||
| else if (c === ';') { | ||
| return i + 1; | ||
| } | ||
| else if (c === '}') { | ||
| return i; | ||
| } | ||
| } | ||
| } | ||
| return i; | ||
| } | ||
| function removeCustomAssigns(cssText) { | ||
| var final = ''; | ||
| var offset = 0; | ||
| while (true) { | ||
| var assignPos = findRegex(VAR_ASSIGN_START, cssText, offset); | ||
| var start = assignPos ? assignPos.start : cssText.length; | ||
| final += cssText.substring(offset, start); | ||
| if (assignPos) { | ||
| offset = findEndValue(cssText, start); | ||
| } | ||
| else { | ||
| break; | ||
| } | ||
| } | ||
| return final; | ||
| } | ||
| function compileTemplate(cssText) { | ||
| var index = 0; | ||
| cssText = cssText.replace(COMMENTS, ''); | ||
| cssText = removeCustomAssigns(cssText) | ||
| .replace(TRAILING_LINES, ''); | ||
| var segments = []; | ||
| while (index < cssText.length) { | ||
| index = compileVar(cssText, segments, index); | ||
| } | ||
| return segments; | ||
| } | ||
| function resolveValues(selectors) { | ||
| var props = {}; | ||
| selectors.forEach(function (selector) { | ||
| selector.declarations.forEach(function (dec) { | ||
| props[dec.prop] = dec.value; | ||
| }); | ||
| }); | ||
| var propsValues = {}; | ||
| var entries = Object.entries(props); | ||
| var _loop_1 = function (i) { | ||
| var dirty = false; | ||
| entries.forEach(function (_a) { | ||
| var key = _a[0], value = _a[1]; | ||
| var propValue = executeTemplate(value, propsValues); | ||
| if (propValue !== propsValues[key]) { | ||
| propsValues[key] = propValue; | ||
| dirty = true; | ||
| } | ||
| }); | ||
| if (!dirty) { | ||
| return "break"; | ||
| } | ||
| }; | ||
| for (var i = 0; i < 10; i++) { | ||
| var state_1 = _loop_1(i); | ||
| if (state_1 === "break") | ||
| break; | ||
| } | ||
| return propsValues; | ||
| } | ||
| function getSelectors(root, index) { | ||
| if (index === void 0) { index = 0; } | ||
| if (!root.rules) { | ||
| return []; | ||
| } | ||
| var selectors = []; | ||
| root.rules | ||
| .filter(function (rule) { return rule.type === types.STYLE_RULE; }) | ||
| .forEach(function (rule) { | ||
| var declarations = getDeclarations(rule.cssText); | ||
| if (declarations.length > 0) { | ||
| rule.parsedSelector.split(',').forEach(function (selector) { | ||
| selector = selector.trim(); | ||
| selectors.push({ | ||
| selector: selector, | ||
| declarations: declarations, | ||
| specificity: computeSpecificity(), | ||
| nu: index | ||
| }); | ||
| }); | ||
| } | ||
| index++; | ||
| }); | ||
| return selectors; | ||
| } | ||
| function computeSpecificity(_selector) { | ||
| return 1; | ||
| } | ||
| var IMPORTANT = '!important'; | ||
| var FIND_DECLARATIONS = /(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm; | ||
| function getDeclarations(cssText) { | ||
| var declarations = []; | ||
| var xArray; | ||
| while (xArray = FIND_DECLARATIONS.exec(cssText.trim())) { | ||
| var _a = normalizeValue(xArray[2]), value = _a.value, important = _a.important; | ||
| declarations.push({ | ||
| prop: xArray[1].trim(), | ||
| value: compileTemplate(value), | ||
| important: important, | ||
| }); | ||
| } | ||
| return declarations; | ||
| } | ||
| function normalizeValue(value) { | ||
| var regex = /\s+/gim; | ||
| value = value.replace(regex, ' ').trim(); | ||
| var important = value.endsWith(IMPORTANT); | ||
| if (important) { | ||
| value = value.substr(0, value.length - IMPORTANT.length).trim(); | ||
| } | ||
| return { | ||
| value: value, | ||
| important: important | ||
| }; | ||
| } | ||
| function getActiveSelectors(hostEl, hostScopeMap, globalScopes) { | ||
| // computes the css scopes that might affect this particular element | ||
| // avoiding using spread arrays to avoid ts helper fns when in es5 | ||
| var scopes = []; | ||
| var scopesForElement = getScopesForElement(hostScopeMap, hostEl); | ||
| // globalScopes are always took into account | ||
| globalScopes.forEach(function (s) { return scopes.push(s); }); | ||
| // the parent scopes are computed by walking parent dom until <html> is reached | ||
| scopesForElement.forEach(function (s) { return scopes.push(s); }); | ||
| // each scope might have an array of associated selectors | ||
| // let's flatten the complete array of selectors from all the scopes | ||
| var selectorSet = getSelectorsForScopes(scopes); | ||
| // we filter to only the selectors that matches the hostEl | ||
| var activeSelectors = selectorSet.filter(function (selector) { return matches(hostEl, selector.selector); }); | ||
| // sort selectors by specifity | ||
| return sortSelectors(activeSelectors); | ||
| } | ||
| function getScopesForElement(hostTemplateMap, node) { | ||
| var scopes = []; | ||
| while (node) { | ||
| var scope = hostTemplateMap.get(node); | ||
| if (scope) { | ||
| scopes.push(scope); | ||
| } | ||
| node = node.parentElement; | ||
| } | ||
| return scopes; | ||
| } | ||
| function getSelectorsForScopes(scopes) { | ||
| var selectors = []; | ||
| scopes.forEach(function (scope) { | ||
| selectors.push.apply(selectors, scope.selectors); | ||
| }); | ||
| return selectors; | ||
| } | ||
| function sortSelectors(selectors) { | ||
| selectors.sort(function (a, b) { | ||
| if (a.specificity === b.specificity) { | ||
| return a.nu - b.nu; | ||
| } | ||
| return a.specificity - b.specificity; | ||
| }); | ||
| return selectors; | ||
| } | ||
| function matches(el, selector) { | ||
| return selector === ':root' || selector === 'html' || el.matches(selector); | ||
| } | ||
| function parseCSS(original) { | ||
| var ast = parse(original); | ||
| var template = compileTemplate(original); | ||
| var selectors = getSelectors(ast); | ||
| return { | ||
| original: original, | ||
| template: template, | ||
| selectors: selectors, | ||
| usesCssVars: template.length > 1 | ||
| }; | ||
| } | ||
| function addGlobalStyle(globalScopes, styleEl) { | ||
| if (globalScopes.some(function (css) { return css.styleEl === styleEl; })) { | ||
| return false; | ||
| } | ||
| var css = parseCSS(styleEl.textContent); | ||
| css.styleEl = styleEl; | ||
| globalScopes.push(css); | ||
| return true; | ||
| } | ||
| function updateGlobalScopes(scopes) { | ||
| var selectors = getSelectorsForScopes(scopes); | ||
| var props = resolveValues(selectors); | ||
| scopes.forEach(function (scope) { | ||
| if (scope.usesCssVars) { | ||
| scope.styleEl.textContent = executeTemplate(scope.template, props); | ||
| } | ||
| }); | ||
| } | ||
| function reScope(scope, scopeId) { | ||
| var template = scope.template.map(function (segment) { | ||
| return (typeof segment === 'string') | ||
| ? replaceScope(segment, scope.scopeId, scopeId) | ||
| : segment; | ||
| }); | ||
| var selectors = scope.selectors.map(function (sel) { | ||
| return Object.assign(Object.assign({}, sel), { selector: replaceScope(sel.selector, scope.scopeId, scopeId) }); | ||
| }); | ||
| return Object.assign(Object.assign({}, scope), { template: template, | ||
| selectors: selectors, | ||
| scopeId: scopeId }); | ||
| } | ||
| function replaceScope(original, oldScopeId, newScopeId) { | ||
| original = replaceAll(original, "\\." + oldScopeId, "." + newScopeId); | ||
| return original; | ||
| } | ||
| function replaceAll(input, find, replace) { | ||
| return input.replace(new RegExp(find, 'g'), replace); | ||
| } | ||
| function loadDocument(doc, globalScopes) { | ||
| loadDocumentStyles(doc, globalScopes); | ||
| return loadDocumentLinks(doc, globalScopes).then(function () { | ||
| updateGlobalScopes(globalScopes); | ||
| }); | ||
| } | ||
| function startWatcher(doc, globalScopes) { | ||
| var mutation = new MutationObserver(function () { | ||
| if (loadDocumentStyles(doc, globalScopes)) { | ||
| updateGlobalScopes(globalScopes); | ||
| } | ||
| }); | ||
| mutation.observe(document.head, { childList: true }); | ||
| } | ||
| function loadDocumentLinks(doc, globalScopes) { | ||
| var promises = []; | ||
| var linkElms = doc.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'); | ||
| for (var i = 0; i < linkElms.length; i++) { | ||
| promises.push(addGlobalLink(doc, globalScopes, linkElms[i])); | ||
| } | ||
| return Promise.all(promises); | ||
| } | ||
| function loadDocumentStyles(doc, globalScopes) { | ||
| var styleElms = Array.from(doc.querySelectorAll('style:not([data-styles]):not([data-no-shim])')); | ||
| return styleElms | ||
| .map(function (style) { return addGlobalStyle(globalScopes, style); }) | ||
| .some(Boolean); | ||
| } | ||
| function addGlobalLink(doc, globalScopes, linkElm) { | ||
| var url = linkElm.href; | ||
| return fetch(url).then(function (rsp) { return rsp.text(); }).then(function (text) { | ||
| if (hasCssVariables(text) && linkElm.parentNode) { | ||
| if (hasRelativeUrls(text)) { | ||
| text = fixRelativeUrls(text, url); | ||
| } | ||
| var styleEl = doc.createElement('style'); | ||
| styleEl.setAttribute('data-styles', ''); | ||
| styleEl.textContent = text; | ||
| addGlobalStyle(globalScopes, styleEl); | ||
| linkElm.parentNode.insertBefore(styleEl, linkElm); | ||
| linkElm.remove(); | ||
| } | ||
| }).catch(function (err) { | ||
| console.error(err); | ||
| }); | ||
| } | ||
| // This regexp tries to determine when a variable is declared, for example: | ||
| // | ||
| // .my-el { --highlight-color: green; } | ||
| // | ||
| // but we don't want to trigger when a classname uses "--" or a pseudo-class is | ||
| // used. We assume that the only characters that can preceed a variable | ||
| // declaration are "{", from an opening block, ";" from a preceeding rule, or a | ||
| // space. This prevents the regexp from matching a word in a selector, since | ||
| // they would need to start with a "." or "#". (We assume element names don't | ||
| // start with "--"). | ||
| var CSS_VARIABLE_REGEXP = /[\s;{]--[-a-zA-Z0-9]+\s*:/m; | ||
| function hasCssVariables(css) { | ||
| return css.indexOf('var(') > -1 || CSS_VARIABLE_REGEXP.test(css); | ||
| } | ||
| // This regexp find all url() usages with relative urls | ||
| var CSS_URL_REGEXP = /url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim; | ||
| function hasRelativeUrls(css) { | ||
| CSS_URL_REGEXP.lastIndex = 0; | ||
| return CSS_URL_REGEXP.test(css); | ||
| } | ||
| function fixRelativeUrls(css, originalUrl) { | ||
| // get the basepath from the original import url | ||
| var basePath = originalUrl.replace(/[^/]*$/, ''); | ||
| // replace the relative url, with the new relative url | ||
| return css.replace(CSS_URL_REGEXP, function (fullMatch, url) { | ||
| // rhe new relative path is the base path + uri | ||
| // TODO: normalize relative URL | ||
| var relativeUrl = basePath + url; | ||
| return fullMatch.replace(url, relativeUrl); | ||
| }); | ||
| } | ||
| var CustomStyle = /** @class */ (function () { | ||
| function CustomStyle(win, doc) { | ||
| this.win = win; | ||
| this.doc = doc; | ||
| this.count = 0; | ||
| this.hostStyleMap = new WeakMap(); | ||
| this.hostScopeMap = new WeakMap(); | ||
| this.globalScopes = []; | ||
| this.scopesMap = new Map(); | ||
| this.didInit = false; | ||
| } | ||
| CustomStyle.prototype.initShim = function () { | ||
| var _this = this; | ||
| if (this.didInit) { | ||
| return Promise.resolve(); | ||
| } | ||
| else { | ||
| this.didInit = true; | ||
| return new Promise(function (resolve) { | ||
| _this.win.requestAnimationFrame(function () { | ||
| startWatcher(_this.doc, _this.globalScopes); | ||
| loadDocument(_this.doc, _this.globalScopes).then(function () { return resolve(); }); | ||
| }); | ||
| }); | ||
| } | ||
| }; | ||
| CustomStyle.prototype.addLink = function (linkEl) { | ||
| var _this = this; | ||
| return addGlobalLink(this.doc, this.globalScopes, linkEl).then(function () { | ||
| _this.updateGlobal(); | ||
| }); | ||
| }; | ||
| CustomStyle.prototype.addGlobalStyle = function (styleEl) { | ||
| if (addGlobalStyle(this.globalScopes, styleEl)) { | ||
| this.updateGlobal(); | ||
| } | ||
| }; | ||
| CustomStyle.prototype.createHostStyle = function (hostEl, cssScopeId, cssText, isScoped) { | ||
| if (this.hostScopeMap.has(hostEl)) { | ||
| throw new Error('host style already created'); | ||
| } | ||
| var baseScope = this.registerHostTemplate(cssText, cssScopeId, isScoped); | ||
| var styleEl = this.doc.createElement('style'); | ||
| styleEl.setAttribute('data-no-shim', ''); | ||
| if (!baseScope.usesCssVars) { | ||
| // This component does not use (read) css variables | ||
| styleEl.textContent = cssText; | ||
| } | ||
| else if (isScoped) { | ||
| // This component is dynamic: uses css var and is scoped | ||
| styleEl['s-sc'] = cssScopeId = baseScope.scopeId + "-" + this.count; | ||
| styleEl.textContent = '/*needs update*/'; | ||
| this.hostStyleMap.set(hostEl, styleEl); | ||
| this.hostScopeMap.set(hostEl, reScope(baseScope, cssScopeId)); | ||
| this.count++; | ||
| } | ||
| else { | ||
| // This component uses css vars, but it's no-encapsulation (global static) | ||
| baseScope.styleEl = styleEl; | ||
| if (!baseScope.usesCssVars) { | ||
| styleEl.textContent = executeTemplate(baseScope.template, {}); | ||
| } | ||
| this.globalScopes.push(baseScope); | ||
| this.updateGlobal(); | ||
| this.hostScopeMap.set(hostEl, baseScope); | ||
| } | ||
| return styleEl; | ||
| }; | ||
| CustomStyle.prototype.removeHost = function (hostEl) { | ||
| var css = this.hostStyleMap.get(hostEl); | ||
| if (css) { | ||
| css.remove(); | ||
| } | ||
| this.hostStyleMap.delete(hostEl); | ||
| this.hostScopeMap.delete(hostEl); | ||
| }; | ||
| CustomStyle.prototype.updateHost = function (hostEl) { | ||
| var scope = this.hostScopeMap.get(hostEl); | ||
| if (scope && scope.usesCssVars && scope.isScoped) { | ||
| var styleEl = this.hostStyleMap.get(hostEl); | ||
| if (styleEl) { | ||
| var selectors = getActiveSelectors(hostEl, this.hostScopeMap, this.globalScopes); | ||
| var props = resolveValues(selectors); | ||
| styleEl.textContent = executeTemplate(scope.template, props); | ||
| } | ||
| } | ||
| }; | ||
| CustomStyle.prototype.updateGlobal = function () { | ||
| updateGlobalScopes(this.globalScopes); | ||
| }; | ||
| CustomStyle.prototype.registerHostTemplate = function (cssText, scopeId, isScoped) { | ||
| var scope = this.scopesMap.get(scopeId); | ||
| if (!scope) { | ||
| scope = parseCSS(cssText); | ||
| scope.scopeId = scopeId; | ||
| scope.isScoped = isScoped; | ||
| this.scopesMap.set(scopeId, scope); | ||
| } | ||
| return scope; | ||
| }; | ||
| return CustomStyle; | ||
| }()); | ||
| var win = window; | ||
| function needsShim() { | ||
| return !(win.CSS && win.CSS.supports && win.CSS.supports('color', 'var(--c)')); | ||
| } | ||
| if (!win.__stencil_cssshim && needsShim()) { | ||
| win.__stencil_cssshim = new CustomStyle(win, document); | ||
| } |
@@ -41,10 +41,47 @@ (function(){ | ||
| // Polyfill document.baseURI | ||
| "string"!==typeof document.baseURI&&Object.defineProperty(Document.prototype,"baseURI",{enumerable:!0,configurable:!0,get:function(){var a=document.querySelector("base");return a&&a.href?a.href:document.URL}}); | ||
| if (typeof document.baseURI !== 'string') { | ||
| Object.defineProperty(Document.prototype, 'baseURI', { | ||
| enumerable: true, | ||
| configurable: true, | ||
| get: function () { | ||
| var base = document.querySelector('base'); | ||
| if (base && base.href) { | ||
| return base.href; | ||
| } | ||
| return document.URL; | ||
| } | ||
| }); | ||
| } | ||
| // Polyfill CustomEvent | ||
| "function"!==typeof window.CustomEvent&&(window.CustomEvent=function(c,a){a=a||{bubbles:!1,cancelable:!1,detail:void 0};var b=document.createEvent("CustomEvent");b.initCustomEvent(c,a.bubbles,a.cancelable,a.detail);return b},window.CustomEvent.prototype=window.Event.prototype); | ||
| if (typeof window.CustomEvent !== 'function') { | ||
| window.CustomEvent = function CustomEvent(event, params) { | ||
| params = params || { bubbles: false, cancelable: false, detail: undefined }; | ||
| var evt = document.createEvent( 'CustomEvent' ); | ||
| evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail ); | ||
| return evt; | ||
| } | ||
| window.CustomEvent.prototype = window.Event.prototype; | ||
| } | ||
| // Event.composedPath | ||
| (function(b,c,d){b.composedPath||(b.composedPath=function(){if(this.path)return this.path;var a=this.target;for(this.path=[];null!==a.parentNode;)this.path.push(a),a=a.parentNode;this.path.push(c,d);return this.path})})(Event.prototype,document,window); | ||
| (function(E, d, w) { | ||
| if(!E.composedPath) { | ||
| E.composedPath = function() { | ||
| if (this.path) { | ||
| return this.path; | ||
| } | ||
| var target = this.target; | ||
| this.path = []; | ||
| while (target.parentNode !== null) { | ||
| this.path.push(target); | ||
| target = target.parentNode; | ||
| } | ||
| this.path.push(d, w); | ||
| return this.path; | ||
| } | ||
| } | ||
| })(Event.prototype, document, window); | ||
| /*! | ||
@@ -65,3 +102,14 @@ Element.closest and Element.matches | ||
| */ | ||
| (function(a){"isConnected"in a||Object.defineProperty(a,"isConnected",{configurable:!0,enumerable:!0,get:function(){var a=this.getRootNode({composed:!0});return a&&9===a.nodeType}})})(Element.prototype); | ||
| (function(prototype) { | ||
| if (!("isConnected" in prototype)) { | ||
| Object.defineProperty(prototype, 'isConnected', { | ||
| configurable: true, | ||
| enumerable: true, | ||
| get: function() { | ||
| var root = this.getRootNode({composed: true}); | ||
| return root && root.nodeType === 9; | ||
| } | ||
| }) | ||
| } | ||
| })(Element.prototype); | ||
@@ -81,2 +129,21 @@ /*! | ||
| */ | ||
| (function(b){try{document.body.classList.add()}catch(e){var c=b.add,d=b.remove;b.add=function(){for(var a=0;a<arguments.length;a++)c.call(this,arguments[a])};b.remove=function(){for(var a=0;a<arguments.length;a++)d.call(this,arguments[a])}}})(DOMTokenList.prototype); | ||
| (function(prototype){ | ||
| try { | ||
| document.body.classList.add(); | ||
| } catch (e) { | ||
| var originalAdd = prototype.add; | ||
| var originalRemove = prototype.remove; | ||
| prototype.add = function() { | ||
| for (var i = 0; i < arguments.length; i++) { | ||
| originalAdd.call(this, arguments[i]); | ||
| } | ||
| }; | ||
| prototype.remove = function() { | ||
| for (var i = 0; i < arguments.length; i++) { | ||
| originalRemove.call(this, arguments[i]); | ||
| } | ||
| }; | ||
| } | ||
| }(DOMTokenList.prototype)); |
@@ -1,1 +0,18 @@ | ||
| (function(){if("undefined"!==typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var a=HTMLElement;window.HTMLElement=function(){return Reflect.construct(a,[],this.constructor)};HTMLElement.prototype=a.prototype;HTMLElement.prototype.constructor=HTMLElement;Object.setPrototypeOf(HTMLElement,a)}})(); | ||
| (function() { | ||
| if ( | ||
| // No Reflect, no classes, no need for shim because native custom elements | ||
| // require ES2015 classes or Reflect. | ||
| window.Reflect === undefined || | ||
| window.customElements === undefined | ||
| ) { | ||
| return; | ||
| } | ||
| var BuiltInHTMLElement = HTMLElement; | ||
| window.HTMLElement = /** @this {!Object} */ function HTMLElement() { | ||
| return Reflect.construct( | ||
| BuiltInHTMLElement, [], /** @type {!Function} */ (this.constructor)); | ||
| }; | ||
| HTMLElement.prototype = BuiltInHTMLElement.prototype; | ||
| HTMLElement.prototype.constructor = HTMLElement; | ||
| Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement); | ||
| })(); |
| export function applyPolyfills() { | ||
| var promises = []; | ||
| if (typeof window !== 'undefined') { | ||
| var win = window; | ||
| if (!win.customElements || | ||
| (win.Element && (!win.Element.prototype.closest || !win.Element.prototype.matches || !win.Element.prototype.remove || !win.Element.prototype.getRootNode))) { | ||
| promises.push(import(/* webpackChunkName: "polyfills-dom" */ './dom.js')); | ||
| var promises = []; | ||
| if (!win.customElements || (win.Element && (!win.Element.prototype.closest || !win.Element.prototype.matches || !win.Element.prototype.remove))) { | ||
| promises.push(import('./dom.js')); | ||
| } | ||
@@ -30,6 +30,7 @@ | ||
| ) { | ||
| promises.push(import(/* webpackChunkName: "polyfills-core-js" */ './core-js.js')); | ||
| promises.push(import('./core-js.js')); | ||
| } | ||
| return Promise.all(promises); | ||
| } | ||
| return Promise.all(promises); | ||
| return Promise.resolve(); | ||
| } |
+1
-1
@@ -1,1 +0,1 @@ | ||
| module.exports = require('./cjs/index.cjs.js'); | ||
| module.exports = require('./cjs/index.cjs.js'); |
@@ -20,3 +20,2 @@ | ||
| scriptElm = doc.createElement('script'); | ||
@@ -27,6 +26,6 @@ scriptElm.setAttribute('nomodule', ''); | ||
| scriptElm.setAttribute('data-stencil-namespace', 'msf-editor'); | ||
| doc.head.appendChild(scriptElm) | ||
| doc.head.appendChild(scriptElm); | ||
| console.warn(warn.join('\n')); | ||
| })(document); |
@@ -1,1 +0,1 @@ | ||
| import{b as e}from"./p-ee2647c7.js";import{p as o}from"./p-e22cdd92.js";o().then(o=>e([["p-339e1958",[[1,"ms-editor",{token:[1],config:[8],content:[1],modalOpen:[32],save:[64],test:[64],spinner:[64],start:[64],sendTest:[64],load:[64],preview:[64]},[[8,"message","componentWillLoad"]]]]]],o)); | ||
| import{p as e,b as o}from"./p-acbc4922.js";e().then(e=>o([["p-csoj4gml",[[1,"ms-editor",{token:[1],config:[8],content:[1],modalOpen:[32],save:[64],test:[64],spinner:[64],start:[64],sendTest:[64],beforeUnload:[64],load:[64],preview:[64]},[[8,"message","componentWillLoad"]]]]]],e)); |
@@ -7,46 +7,60 @@ /* eslint-disable */ | ||
| */ | ||
| import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime"; | ||
| import { HTMLStencilElement, JSXBase } from './stencil.core'; | ||
| export namespace Components { | ||
| interface MsEditor { | ||
| "config": any; | ||
| "content": string; | ||
| "load": (data: any) => Promise<void>; | ||
| "preview": (device: any) => Promise<void>; | ||
| "save": (opts?: any) => Promise<void>; | ||
| "sendTest": (data: any) => Promise<void>; | ||
| "spinner": (behavior: 'hide' | 'show') => Promise<void>; | ||
| "start": (data: any) => Promise<void>; | ||
| "test": () => Promise<void>; | ||
| "token": string; | ||
| } | ||
| interface MsEditor { | ||
| 'beforeUnload': (evt: BeforeUnloadEvent) => Promise<void>; | ||
| 'config': any; | ||
| 'content': string; | ||
| 'load': (data: any) => Promise<void>; | ||
| 'preview': (device: any) => Promise<void>; | ||
| 'save': (opts?: any) => Promise<void>; | ||
| 'sendTest': (data: any) => Promise<void>; | ||
| 'spinner': (behavior: "hide" | "show") => Promise<void>; | ||
| 'start': (data: any) => Promise<void>; | ||
| 'test': () => Promise<void>; | ||
| 'token': string; | ||
| } | ||
| } | ||
| declare global { | ||
| interface HTMLMsEditorElement extends Components.MsEditor, HTMLStencilElement { | ||
| } | ||
| var HTMLMsEditorElement: { | ||
| prototype: HTMLMsEditorElement; | ||
| new (): HTMLMsEditorElement; | ||
| }; | ||
| interface HTMLElementTagNameMap { | ||
| "ms-editor": HTMLMsEditorElement; | ||
| } | ||
| interface HTMLMsEditorElement extends Components.MsEditor, HTMLStencilElement {} | ||
| var HTMLMsEditorElement: { | ||
| prototype: HTMLMsEditorElement; | ||
| new (): HTMLMsEditorElement; | ||
| }; | ||
| interface HTMLElementTagNameMap { | ||
| 'ms-editor': HTMLMsEditorElement; | ||
| } | ||
| } | ||
| declare namespace LocalJSX { | ||
| interface MsEditor { | ||
| "config"?: any; | ||
| "content"?: string; | ||
| "onEditorEvent"?: (event: CustomEvent<{ data: any, action: string }>) => void; | ||
| "token"?: string; | ||
| } | ||
| interface IntrinsicElements { | ||
| "ms-editor": MsEditor; | ||
| } | ||
| interface MsEditor { | ||
| 'config'?: any; | ||
| 'content'?: string; | ||
| 'onEditorEvent'?: (event: CustomEvent<{ data: any, action: string }>) => void; | ||
| 'token'?: string; | ||
| } | ||
| interface IntrinsicElements { | ||
| 'ms-editor': MsEditor; | ||
| } | ||
| } | ||
| export { LocalJSX as JSX }; | ||
| declare module "@stencil/core" { | ||
| export namespace JSX { | ||
| interface IntrinsicElements { | ||
| "ms-editor": LocalJSX.MsEditor & JSXBase.HTMLAttributes<HTMLMsEditorElement>; | ||
| } | ||
| export namespace JSX { | ||
| interface IntrinsicElements { | ||
| 'ms-editor': LocalJSX.MsEditor & JSXBase.HTMLAttributes<HTMLMsEditorElement>; | ||
| } | ||
| } | ||
| } | ||
@@ -1,2 +0,2 @@ | ||
| import { EventEmitter } from '../../stencil-public-runtime'; | ||
| import { EventEmitter } from '../../stencil.core'; | ||
| export declare class Editor { | ||
@@ -21,2 +21,3 @@ token: string; | ||
| sendTest(data: any): Promise<void>; | ||
| beforeUnload(evt: BeforeUnloadEvent): Promise<void>; | ||
| load(data: any): Promise<void>; | ||
@@ -23,0 +24,0 @@ preview(device: any): Promise<void>; |
@@ -12,3 +12,3 @@ | ||
| } | ||
| export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): Promise<void>; | ||
| export declare function defineCustomElements(win: Window, opts?: CustomElementsDefineOptions): Promise<void>; | ||
| export declare function applyPolyfills(): Promise<void>; |
+19
-1
| (function(){if("undefined"!==typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var a=HTMLElement;window.HTMLElement=function(){return Reflect.construct(a,[],this.constructor)};HTMLElement.prototype=a.prototype;HTMLElement.prototype.constructor=HTMLElement;Object.setPrototypeOf(HTMLElement,a)}})(); | ||
| (function() { | ||
| if ( | ||
| // No Reflect, no classes, no need for shim because native custom elements | ||
| // require ES2015 classes or Reflect. | ||
| window.Reflect === undefined || | ||
| window.customElements === undefined | ||
| ) { | ||
| return; | ||
| } | ||
| var BuiltInHTMLElement = HTMLElement; | ||
| window.HTMLElement = /** @this {!Object} */ function HTMLElement() { | ||
| return Reflect.construct( | ||
| BuiltInHTMLElement, [], /** @type {!Function} */ (this.constructor)); | ||
| }; | ||
| HTMLElement.prototype = BuiltInHTMLElement.prototype; | ||
| HTMLElement.prototype.constructor = HTMLElement; | ||
| Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement); | ||
| })(); | ||
| export * from '../dist/esm/polyfills/index.js'; | ||
| export * from '../dist/esm-es5/loader.mjs'; |
+1
-1
| { | ||
| "name": "msf-editor", | ||
| "version": "0.5.0", | ||
| "version": "0.6.0", | ||
| "description": "Stencil Component Starter", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
| 'use strict'; | ||
| /* | ||
| Stencil Client Patch v1.17.3 | MIT Licensed | https://stenciljs.com | ||
| */ | ||
| var StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector="";};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r);}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE;}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return "\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@";function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return {start:s,end:s+n[0].length}}return null}var VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return {start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t);}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else {if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s);}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value;}));}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0);})),!t)return "break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return [];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t});})),t++;})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o});}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.substr(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement;}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors);})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return ":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return {original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return !1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t));}));}function reScope(e,t){var r=e.template.map((function(r){return "string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return Object.assign(Object.assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return Object.assign(Object.assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\."+t,"."+r)}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t);}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t);})).observe(document.head,{childList:!0});}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove();}})).catch((function(e){console.error(e);}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1;}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}));}));})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal();}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal();},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t=s.scopeId+"-"+this.count,o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e);},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n);}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes);},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document));}("undefined"!=typeof window&&window); |
| 'use strict'; | ||
| /* | ||
| Stencil Client Patch v1.17.3 | MIT Licensed | https://stenciljs.com | ||
| */ | ||
| (function(){ | ||
| var aa=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function g(a){var b=aa.has(a);a=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(a);return !b&&a}function l(a){var b=a.isConnected;if(void 0!==b)return b;for(;a&&!(a.__CE_isImportDocument||a instanceof Document);)a=a.parentNode||(window.ShadowRoot&&a instanceof ShadowRoot?a.host:void 0);return !(!a||!(a.__CE_isImportDocument||a instanceof Document))} | ||
| function n(a,b){for(;b&&b!==a&&!b.nextSibling;)b=b.parentNode;return b&&b!==a?b.nextSibling:null} | ||
| function p(a,b,d){d=void 0===d?new Set:d;for(var c=a;c;){if(c.nodeType===Node.ELEMENT_NODE){var e=c;b(e);var f=e.localName;if("link"===f&&"import"===e.getAttribute("rel")){c=e.import;if(c instanceof Node&&!d.has(c))for(d.add(c),c=c.firstChild;c;c=c.nextSibling)p(c,b,d);c=n(a,e);continue}else if("template"===f){c=n(a,e);continue}if(e=e.__CE_shadowRoot)for(e=e.firstChild;e;e=e.nextSibling)p(e,b,d);}c=c.firstChild?c.firstChild:n(a,c);}}function r(a,b,d){a[b]=d;}function u(){this.a=new Map;this.g=new Map;this.c=[];this.f=[];this.b=!1;}function ba(a,b,d){a.a.set(b,d);a.g.set(d.constructorFunction,d);}function ca(a,b){a.b=!0;a.c.push(b);}function da(a,b){a.b=!0;a.f.push(b);}function v(a,b){a.b&&p(b,function(b){return w(a,b)});}function w(a,b){if(a.b&&!b.__CE_patched){b.__CE_patched=!0;for(var d=0;d<a.c.length;d++)a.c[d](b);for(d=0;d<a.f.length;d++)a.f[d](b);}} | ||
| function x(a,b){var d=[];p(b,function(b){return d.push(b)});for(b=0;b<d.length;b++){var c=d[b];1===c.__CE_state?a.connectedCallback(c):y(a,c);}}function z(a,b){var d=[];p(b,function(b){return d.push(b)});for(b=0;b<d.length;b++){var c=d[b];1===c.__CE_state&&a.disconnectedCallback(c);}} | ||
| function A(a,b,d){d=void 0===d?{}:d;var c=d.u||new Set,e=d.i||function(b){return y(a,b)},f=[];p(b,function(b){if("link"===b.localName&&"import"===b.getAttribute("rel")){var d=b.import;d instanceof Node&&(d.__CE_isImportDocument=!0,d.__CE_hasRegistry=!0);d&&"complete"===d.readyState?d.__CE_documentLoadHandled=!0:b.addEventListener("load",function(){var d=b.import;if(!d.__CE_documentLoadHandled){d.__CE_documentLoadHandled=!0;var f=new Set(c);f.delete(d);A(a,d,{u:f,i:e});}});}else f.push(b);},c);if(a.b)for(b= | ||
| 0;b<f.length;b++)w(a,f[b]);for(b=0;b<f.length;b++)e(f[b]);} | ||
| function y(a,b){if(void 0===b.__CE_state){var d=b.ownerDocument;if(d.defaultView||d.__CE_isImportDocument&&d.__CE_hasRegistry)if(d=a.a.get(b.localName)){d.constructionStack.push(b);var c=d.constructorFunction;try{try{if(new c!==b)throw Error("The custom element constructor did not produce the element being upgraded.");}finally{d.constructionStack.pop();}}catch(t){throw b.__CE_state=2,t;}b.__CE_state=1;b.__CE_definition=d;if(d.attributeChangedCallback)for(d=d.observedAttributes,c=0;c<d.length;c++){var e= | ||
| d[c],f=b.getAttribute(e);null!==f&&a.attributeChangedCallback(b,e,null,f,null);}l(b)&&a.connectedCallback(b);}}}u.prototype.connectedCallback=function(a){var b=a.__CE_definition;b.connectedCallback&&b.connectedCallback.call(a);};u.prototype.disconnectedCallback=function(a){var b=a.__CE_definition;b.disconnectedCallback&&b.disconnectedCallback.call(a);}; | ||
| u.prototype.attributeChangedCallback=function(a,b,d,c,e){var f=a.__CE_definition;f.attributeChangedCallback&&-1<f.observedAttributes.indexOf(b)&&f.attributeChangedCallback.call(a,b,d,c,e);};function B(a){var b=document;this.c=a;this.a=b;this.b=void 0;A(this.c,this.a);"loading"===this.a.readyState&&(this.b=new MutationObserver(this.f.bind(this)),this.b.observe(this.a,{childList:!0,subtree:!0}));}function C(a){a.b&&a.b.disconnect();}B.prototype.f=function(a){var b=this.a.readyState;"interactive"!==b&&"complete"!==b||C(this);for(b=0;b<a.length;b++)for(var d=a[b].addedNodes,c=0;c<d.length;c++)A(this.c,d[c]);};function ea(){var a=this;this.b=this.a=void 0;this.c=new Promise(function(b){a.b=b;a.a&&b(a.a);});}function D(a){if(a.a)throw Error("Already resolved.");a.a=void 0;a.b&&a.b(void 0);}function E(a){this.c=!1;this.a=a;this.j=new Map;this.f=function(b){return b()};this.b=!1;this.g=[];this.o=new B(a);} | ||
| E.prototype.l=function(a,b){var d=this;if(!(b instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!g(a))throw new SyntaxError("The element name '"+a+"' is not valid.");if(this.a.a.get(a))throw Error("A custom element with name '"+a+"' has already been defined.");if(this.c)throw Error("A custom element is already being defined.");this.c=!0;try{var c=function(b){var a=e[b];if(void 0!==a&&!(a instanceof Function))throw Error("The '"+b+"' callback must be a function."); | ||
| return a},e=b.prototype;if(!(e instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");var f=c("connectedCallback");var t=c("disconnectedCallback");var k=c("adoptedCallback");var h=c("attributeChangedCallback");var m=b.observedAttributes||[];}catch(q){return}finally{this.c=!1;}b={localName:a,constructorFunction:b,connectedCallback:f,disconnectedCallback:t,adoptedCallback:k,attributeChangedCallback:h,observedAttributes:m,constructionStack:[]};ba(this.a, | ||
| a,b);this.g.push(b);this.b||(this.b=!0,this.f(function(){return fa(d)}));};E.prototype.i=function(a){A(this.a,a);}; | ||
| function fa(a){if(!1!==a.b){a.b=!1;for(var b=a.g,d=[],c=new Map,e=0;e<b.length;e++)c.set(b[e].localName,[]);A(a.a,document,{i:function(b){if(void 0===b.__CE_state){var e=b.localName,f=c.get(e);f?f.push(b):a.a.a.get(e)&&d.push(b);}}});for(e=0;e<d.length;e++)y(a.a,d[e]);for(;0<b.length;){var f=b.shift();e=f.localName;f=c.get(f.localName);for(var t=0;t<f.length;t++)y(a.a,f[t]);(e=a.j.get(e))&&D(e);}}}E.prototype.get=function(a){if(a=this.a.a.get(a))return a.constructorFunction}; | ||
| E.prototype.m=function(a){if(!g(a))return Promise.reject(new SyntaxError("'"+a+"' is not a valid custom element name."));var b=this.j.get(a);if(b)return b.c;b=new ea;this.j.set(a,b);this.a.a.get(a)&&!this.g.some(function(b){return b.localName===a})&&D(b);return b.c};E.prototype.s=function(a){C(this.o);var b=this.f;this.f=function(d){return a(function(){return b(d)})};};window.CustomElementRegistry=E;E.prototype.define=E.prototype.l;E.prototype.upgrade=E.prototype.i;E.prototype.get=E.prototype.get; | ||
| E.prototype.whenDefined=E.prototype.m;E.prototype.polyfillWrapFlushCallback=E.prototype.s;var F=window.Document.prototype.createElement,G=window.Document.prototype.createElementNS,ha=window.Document.prototype.importNode,ia=window.Document.prototype.prepend,ja=window.Document.prototype.append,ka=window.DocumentFragment.prototype.prepend,la=window.DocumentFragment.prototype.append,H=window.Node.prototype.cloneNode,I=window.Node.prototype.appendChild,J=window.Node.prototype.insertBefore,K=window.Node.prototype.removeChild,L=window.Node.prototype.replaceChild,M=Object.getOwnPropertyDescriptor(window.Node.prototype, | ||
| "textContent"),N=window.Element.prototype.attachShadow,O=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),P=window.Element.prototype.getAttribute,Q=window.Element.prototype.setAttribute,R=window.Element.prototype.removeAttribute,S=window.Element.prototype.getAttributeNS,T=window.Element.prototype.setAttributeNS,U=window.Element.prototype.removeAttributeNS,ma=window.Element.prototype.insertAdjacentElement,na=window.Element.prototype.insertAdjacentHTML,oa=window.Element.prototype.prepend, | ||
| pa=window.Element.prototype.append,V=window.Element.prototype.before,qa=window.Element.prototype.after,ra=window.Element.prototype.replaceWith,sa=window.Element.prototype.remove,ta=window.HTMLElement,W=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),ua=window.HTMLElement.prototype.insertAdjacentElement,va=window.HTMLElement.prototype.insertAdjacentHTML;var wa=new function(){};function xa(){var a=X;window.HTMLElement=function(){function b(){var b=this.constructor,c=a.g.get(b);if(!c)throw Error("The custom element being constructed was not registered with `customElements`.");var e=c.constructionStack;if(0===e.length)return e=F.call(document,c.localName),Object.setPrototypeOf(e,b.prototype),e.__CE_state=1,e.__CE_definition=c,w(a,e),e;c=e.length-1;var f=e[c];if(f===wa)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times."); | ||
| e[c]=wa;Object.setPrototypeOf(f,b.prototype);w(a,f);return f}b.prototype=ta.prototype;Object.defineProperty(b.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:b});return b}();}function Y(a,b,d){function c(b){return function(d){for(var e=[],c=0;c<arguments.length;++c)e[c]=arguments[c];c=[];for(var f=[],m=0;m<e.length;m++){var q=e[m];q instanceof Element&&l(q)&&f.push(q);if(q instanceof DocumentFragment)for(q=q.firstChild;q;q=q.nextSibling)c.push(q);else c.push(q);}b.apply(this,e);for(e=0;e<f.length;e++)z(a,f[e]);if(l(this))for(e=0;e<c.length;e++)f=c[e],f instanceof Element&&x(a,f);}}void 0!==d.h&&(b.prepend=c(d.h));void 0!==d.append&&(b.append=c(d.append));}function ya(){var a=X;r(Document.prototype,"createElement",function(b){if(this.__CE_hasRegistry){var d=a.a.get(b);if(d)return new d.constructorFunction}b=F.call(this,b);w(a,b);return b});r(Document.prototype,"importNode",function(b,d){b=ha.call(this,b,!!d);this.__CE_hasRegistry?A(a,b):v(a,b);return b});r(Document.prototype,"createElementNS",function(b,d){if(this.__CE_hasRegistry&&(null===b||"http://www.w3.org/1999/xhtml"===b)){var c=a.a.get(d);if(c)return new c.constructorFunction}b=G.call(this,b, | ||
| d);w(a,b);return b});Y(a,Document.prototype,{h:ia,append:ja});}function za(){function a(a,c){Object.defineProperty(a,"textContent",{enumerable:c.enumerable,configurable:!0,get:c.get,set:function(a){if(this.nodeType===Node.TEXT_NODE)c.set.call(this,a);else {var d=void 0;if(this.firstChild){var e=this.childNodes,k=e.length;if(0<k&&l(this)){d=Array(k);for(var h=0;h<k;h++)d[h]=e[h];}}c.set.call(this,a);if(d)for(a=0;a<d.length;a++)z(b,d[a]);}}});}var b=X;r(Node.prototype,"insertBefore",function(a,c){if(a instanceof DocumentFragment){var e=Array.prototype.slice.apply(a.childNodes); | ||
| a=J.call(this,a,c);if(l(this))for(c=0;c<e.length;c++)x(b,e[c]);return a}e=l(a);c=J.call(this,a,c);e&&z(b,a);l(this)&&x(b,a);return c});r(Node.prototype,"appendChild",function(a){if(a instanceof DocumentFragment){var c=Array.prototype.slice.apply(a.childNodes);a=I.call(this,a);if(l(this))for(var e=0;e<c.length;e++)x(b,c[e]);return a}c=l(a);e=I.call(this,a);c&&z(b,a);l(this)&&x(b,a);return e});r(Node.prototype,"cloneNode",function(a){a=H.call(this,!!a);this.ownerDocument.__CE_hasRegistry?A(b,a):v(b, | ||
| a);return a});r(Node.prototype,"removeChild",function(a){var c=l(a),e=K.call(this,a);c&&z(b,a);return e});r(Node.prototype,"replaceChild",function(a,c){if(a instanceof DocumentFragment){var e=Array.prototype.slice.apply(a.childNodes);a=L.call(this,a,c);if(l(this))for(z(b,c),c=0;c<e.length;c++)x(b,e[c]);return a}e=l(a);var f=L.call(this,a,c),d=l(this);d&&z(b,c);e&&z(b,a);d&&x(b,a);return f});M&&M.get?a(Node.prototype,M):ca(b,function(b){a(b,{enumerable:!0,configurable:!0,get:function(){for(var a=[], | ||
| b=0;b<this.childNodes.length;b++){var f=this.childNodes[b];f.nodeType!==Node.COMMENT_NODE&&a.push(f.textContent);}return a.join("")},set:function(a){for(;this.firstChild;)K.call(this,this.firstChild);null!=a&&""!==a&&I.call(this,document.createTextNode(a));}});});}function Aa(a){function b(b){return function(e){for(var c=[],d=0;d<arguments.length;++d)c[d]=arguments[d];d=[];for(var k=[],h=0;h<c.length;h++){var m=c[h];m instanceof Element&&l(m)&&k.push(m);if(m instanceof DocumentFragment)for(m=m.firstChild;m;m=m.nextSibling)d.push(m);else d.push(m);}b.apply(this,c);for(c=0;c<k.length;c++)z(a,k[c]);if(l(this))for(c=0;c<d.length;c++)k=d[c],k instanceof Element&&x(a,k);}}var d=Element.prototype;void 0!==V&&(d.before=b(V));void 0!==V&&(d.after=b(qa));void 0!==ra&& | ||
| r(d,"replaceWith",function(b){for(var e=[],c=0;c<arguments.length;++c)e[c]=arguments[c];c=[];for(var d=[],k=0;k<e.length;k++){var h=e[k];h instanceof Element&&l(h)&&d.push(h);if(h instanceof DocumentFragment)for(h=h.firstChild;h;h=h.nextSibling)c.push(h);else c.push(h);}k=l(this);ra.apply(this,e);for(e=0;e<d.length;e++)z(a,d[e]);if(k)for(z(a,this),e=0;e<c.length;e++)d=c[e],d instanceof Element&&x(a,d);});void 0!==sa&&r(d,"remove",function(){var b=l(this);sa.call(this);b&&z(a,this);});}function Ba(){function a(a,b){Object.defineProperty(a,"innerHTML",{enumerable:b.enumerable,configurable:!0,get:b.get,set:function(a){var e=this,d=void 0;l(this)&&(d=[],p(this,function(a){a!==e&&d.push(a);}));b.set.call(this,a);if(d)for(var f=0;f<d.length;f++){var t=d[f];1===t.__CE_state&&c.disconnectedCallback(t);}this.ownerDocument.__CE_hasRegistry?A(c,this):v(c,this);return a}});}function b(a,b){r(a,"insertAdjacentElement",function(a,e){var d=l(e);a=b.call(this,a,e);d&&z(c,e);l(a)&&x(c,e);return a});} | ||
| function d(a,b){function e(a,b){for(var e=[];a!==b;a=a.nextSibling)e.push(a);for(b=0;b<e.length;b++)A(c,e[b]);}r(a,"insertAdjacentHTML",function(a,c){a=a.toLowerCase();if("beforebegin"===a){var d=this.previousSibling;b.call(this,a,c);e(d||this.parentNode.firstChild,this);}else if("afterbegin"===a)d=this.firstChild,b.call(this,a,c),e(this.firstChild,d);else if("beforeend"===a)d=this.lastChild,b.call(this,a,c),e(d||this.firstChild,null);else if("afterend"===a)d=this.nextSibling,b.call(this,a,c),e(this.nextSibling, | ||
| d);else throw new SyntaxError("The value provided ("+String(a)+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");});}var c=X;N&&r(Element.prototype,"attachShadow",function(a){a=N.call(this,a);var b=c;if(b.b&&!a.__CE_patched){a.__CE_patched=!0;for(var e=0;e<b.c.length;e++)b.c[e](a);}return this.__CE_shadowRoot=a});O&&O.get?a(Element.prototype,O):W&&W.get?a(HTMLElement.prototype,W):da(c,function(b){a(b,{enumerable:!0,configurable:!0,get:function(){return H.call(this,!0).innerHTML}, | ||
| set:function(a){var b="template"===this.localName,c=b?this.content:this,e=G.call(document,this.namespaceURI,this.localName);for(e.innerHTML=a;0<c.childNodes.length;)K.call(c,c.childNodes[0]);for(a=b?e.content:e;0<a.childNodes.length;)I.call(c,a.childNodes[0]);}});});r(Element.prototype,"setAttribute",function(a,b){if(1!==this.__CE_state)return Q.call(this,a,b);var e=P.call(this,a);Q.call(this,a,b);b=P.call(this,a);c.attributeChangedCallback(this,a,e,b,null);});r(Element.prototype,"setAttributeNS",function(a, | ||
| b,d){if(1!==this.__CE_state)return T.call(this,a,b,d);var e=S.call(this,a,b);T.call(this,a,b,d);d=S.call(this,a,b);c.attributeChangedCallback(this,b,e,d,a);});r(Element.prototype,"removeAttribute",function(a){if(1!==this.__CE_state)return R.call(this,a);var b=P.call(this,a);R.call(this,a);null!==b&&c.attributeChangedCallback(this,a,b,null,null);});r(Element.prototype,"removeAttributeNS",function(a,b){if(1!==this.__CE_state)return U.call(this,a,b);var d=S.call(this,a,b);U.call(this,a,b);var e=S.call(this, | ||
| a,b);d!==e&&c.attributeChangedCallback(this,b,d,e,a);});ua?b(HTMLElement.prototype,ua):ma?b(Element.prototype,ma):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched.");va?d(HTMLElement.prototype,va):na?d(Element.prototype,na):console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched.");Y(c,Element.prototype,{h:oa,append:pa});Aa(c);}var Z=window.customElements;if(!Z||Z.forcePolyfill||"function"!=typeof Z.define||"function"!=typeof Z.get){var X=new u;xa();ya();Y(X,DocumentFragment.prototype,{h:ka,append:la});za();Ba();document.__CE_hasRegistry=!0;var customElements=new E(X);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:customElements});}}).call(self); | ||
| // Polyfill document.baseURI | ||
| "string"!==typeof document.baseURI&&Object.defineProperty(Document.prototype,"baseURI",{enumerable:!0,configurable:!0,get:function(){var a=document.querySelector("base");return a&&a.href?a.href:document.URL}}); | ||
| // Polyfill CustomEvent | ||
| "function"!==typeof window.CustomEvent&&(window.CustomEvent=function(c,a){a=a||{bubbles:!1,cancelable:!1,detail:void 0};var b=document.createEvent("CustomEvent");b.initCustomEvent(c,a.bubbles,a.cancelable,a.detail);return b},window.CustomEvent.prototype=window.Event.prototype); | ||
| // Event.composedPath | ||
| (function(b,c,d){b.composedPath||(b.composedPath=function(){if(this.path)return this.path;var a=this.target;for(this.path=[];null!==a.parentNode;)this.path.push(a),a=a.parentNode;this.path.push(c,d);return this.path});})(Event.prototype,document,window); | ||
| /*! | ||
| Element.closest and Element.matches | ||
| https://github.com/jonathantneal/closest | ||
| Creative Commons Zero v1.0 Universal | ||
| */ | ||
| (function(a){"function"!==typeof a.matches&&(a.matches=a.msMatchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||function(a){a=(this.document||this.ownerDocument).querySelectorAll(a);for(var b=0;a[b]&&a[b]!==this;)++b;return !!a[b]});"function"!==typeof a.closest&&(a.closest=function(a){for(var b=this;b&&1===b.nodeType;){if(b.matches(a))return b;b=b.parentNode;}return null});})(window.Element.prototype); | ||
| /*! | ||
| Element.getRootNode() | ||
| */ | ||
| (function(c){function d(a){a=b(a);return a&&11===a.nodeType?d(a.host):a}function b(a){return a&&a.parentNode?b(a.parentNode):a}"function"!==typeof c.getRootNode&&(c.getRootNode=function(a){return a&&a.composed?d(this):b(this)});})(Element.prototype); | ||
| /*! | ||
| Element.isConnected() | ||
| */ | ||
| (function(a){"isConnected"in a||Object.defineProperty(a,"isConnected",{configurable:!0,enumerable:!0,get:function(){var a=this.getRootNode({composed:!0});return a&&9===a.nodeType}});})(Element.prototype); | ||
| /*! | ||
| Element.remove() | ||
| */ | ||
| (function(b){b.forEach(function(a){a.hasOwnProperty("remove")||Object.defineProperty(a,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this);}});});})([Element.prototype,CharacterData.prototype,DocumentType.prototype]); | ||
| /*! | ||
| Element.classList | ||
| */ | ||
| !function(e){'classList'in e||Object.defineProperty(e,"classList",{get:function(){var e=this,t=(e.getAttribute("class")||"").replace(/^\s+|\s$/g,"").split(/\s+/g);function n(){t.length>0?e.setAttribute("class",t.join(" ")):e.removeAttribute("class");}return ""===t[0]&&t.splice(0,1),t.toggle=function(e,i){void 0!==i?i?t.add(e):t.remove(e):-1!==t.indexOf(e)?t.splice(t.indexOf(e),1):t.push(e),n();},t.add=function(){for(var e=[].slice.call(arguments),i=0,s=e.length;i<s;i++)-1===t.indexOf(e[i])&&t.push(e[i]);n();},t.remove=function(){for(var e=[].slice.call(arguments),i=0,s=e.length;i<s;i++)-1!==t.indexOf(e[i])&&t.splice(t.indexOf(e[i]),1);n();},t.item=function(e){return t[e]},t.contains=function(e){return -1!==t.indexOf(e)},t.replace=function(e,i){-1!==t.indexOf(e)&&t.splice(t.indexOf(e),1,i),n();},t.value=e.getAttribute("class")||"",t}});}(Element.prototype); | ||
| /*! | ||
| DOMTokenList | ||
| */ | ||
| (function(b){try{document.body.classList.add();}catch(e){var c=b.add,d=b.remove;b.add=function(){for(var a=0;a<arguments.length;a++)c.call(this,arguments[a]);};b.remove=function(){for(var a=0;a<arguments.length;a++)d.call(this,arguments[a]);};}})(DOMTokenList.prototype); |
| 'use strict'; | ||
| function _interopNamespace(e) { | ||
| if (e && e.__esModule) { return e; } else { | ||
| var n = {}; | ||
| if (e) { | ||
| Object.keys(e).forEach(function (k) { | ||
| var d = Object.getOwnPropertyDescriptor(e, k); | ||
| Object.defineProperty(n, k, d.get ? d : { | ||
| enumerable: true, | ||
| get: function () { | ||
| return e[k]; | ||
| } | ||
| }); | ||
| }); | ||
| } | ||
| n['default'] = e; | ||
| return n; | ||
| } | ||
| } | ||
| const NAMESPACE = 'msf-editor'; | ||
| let scopeId; | ||
| let hostTagName; | ||
| let isSvgMode = false; | ||
| let queueCongestion = 0; | ||
| let queuePending = false; | ||
| const win = typeof window !== 'undefined' ? window : {}; | ||
| const CSS = win.CSS ; | ||
| const doc = win.document || { head: {} }; | ||
| const plt = { | ||
| $flags$: 0, | ||
| $resourcesUrl$: '', | ||
| jmp: h => h(), | ||
| raf: h => requestAnimationFrame(h), | ||
| ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts), | ||
| rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts), | ||
| ce: (eventName, opts) => new CustomEvent(eventName, opts), | ||
| }; | ||
| const supportsShadow = /*@__PURE__*/ (() => (doc.head.attachShadow + '').indexOf('[native') > -1)() ; | ||
| const promiseResolve = (v) => Promise.resolve(v); | ||
| const supportsConstructibleStylesheets = /*@__PURE__*/ (() => { | ||
| try { | ||
| new CSSStyleSheet(); | ||
| return true; | ||
| } | ||
| catch (e) { } | ||
| return false; | ||
| })() | ||
| ; | ||
| const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => { | ||
| if ( listeners) { | ||
| listeners.map(([flags, name, method]) => { | ||
| const target = getHostListenerTarget(elm, flags) ; | ||
| const handler = hostListenerProxy(hostRef, method); | ||
| const opts = hostListenerOpts(flags); | ||
| plt.ael(target, name, handler, opts); | ||
| (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts)); | ||
| }); | ||
| } | ||
| }; | ||
| const hostListenerProxy = (hostRef, methodName) => (ev) => { | ||
| { | ||
| if (hostRef.$flags$ & 256 /* isListenReady */) { | ||
| // instance is ready, let's call it's member method for this event | ||
| hostRef.$lazyInstance$[methodName](ev); | ||
| } | ||
| else { | ||
| (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]); | ||
| } | ||
| } | ||
| }; | ||
| const getHostListenerTarget = (elm, flags) => { | ||
| if ( flags & 8 /* TargetWindow */) | ||
| return win; | ||
| return elm; | ||
| }; | ||
| // prettier-ignore | ||
| const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0; | ||
| const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}'; | ||
| const createTime = (fnName, tagName = '') => { | ||
| { | ||
| return () => { | ||
| return; | ||
| }; | ||
| } | ||
| }; | ||
| const uniqueTime = (key, measureText) => { | ||
| { | ||
| return () => { | ||
| return; | ||
| }; | ||
| } | ||
| }; | ||
| const rootAppliedStyles = new WeakMap(); | ||
| const registerStyle = (scopeId, cssText, allowCS) => { | ||
| let style = styles.get(scopeId); | ||
| if (supportsConstructibleStylesheets && allowCS) { | ||
| style = (style || new CSSStyleSheet()); | ||
| style.replace(cssText); | ||
| } | ||
| else { | ||
| style = cssText; | ||
| } | ||
| styles.set(scopeId, style); | ||
| }; | ||
| const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => { | ||
| let scopeId = getScopeId(cmpMeta); | ||
| let style = styles.get(scopeId); | ||
| // if an element is NOT connected then getRootNode() will return the wrong root node | ||
| // so the fallback is to always use the document for the root node in those cases | ||
| styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc; | ||
| if (style) { | ||
| if (typeof style === 'string') { | ||
| styleContainerNode = styleContainerNode.head || styleContainerNode; | ||
| let appliedStyles = rootAppliedStyles.get(styleContainerNode); | ||
| let styleElm; | ||
| if (!appliedStyles) { | ||
| rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set())); | ||
| } | ||
| if (!appliedStyles.has(scopeId)) { | ||
| { | ||
| if ( plt.$cssShim$) { | ||
| styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style, !!(cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */)); | ||
| const newScopeId = styleElm['s-sc']; | ||
| if (newScopeId) { | ||
| scopeId = newScopeId; | ||
| // we don't want to add this styleID to the appliedStyles Set | ||
| // since the cssVarShim might need to apply several different | ||
| // stylesheets for the same component | ||
| appliedStyles = null; | ||
| } | ||
| } | ||
| else { | ||
| styleElm = doc.createElement('style'); | ||
| styleElm.innerHTML = style; | ||
| } | ||
| styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link')); | ||
| } | ||
| if (appliedStyles) { | ||
| appliedStyles.add(scopeId); | ||
| } | ||
| } | ||
| } | ||
| else if ( !styleContainerNode.adoptedStyleSheets.includes(style)) { | ||
| styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style]; | ||
| } | ||
| } | ||
| return scopeId; | ||
| }; | ||
| const attachStyles = (hostRef) => { | ||
| const cmpMeta = hostRef.$cmpMeta$; | ||
| const elm = hostRef.$hostElement$; | ||
| const flags = cmpMeta.$flags$; | ||
| const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$); | ||
| const scopeId = addStyle( supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$, elm); | ||
| if ( flags & 10 /* needsScopedEncapsulation */) { | ||
| // only required when we're NOT using native shadow dom (slot) | ||
| // or this browser doesn't support native shadow dom | ||
| // and this host element was NOT created with SSR | ||
| // let's pick out the inner content for slot projection | ||
| // create a node to represent where the original | ||
| // content was first placed, which is useful later on | ||
| // DOM WRITE!! | ||
| elm['s-sc'] = scopeId; | ||
| elm.classList.add(scopeId + '-h'); | ||
| } | ||
| endAttachStyles(); | ||
| }; | ||
| const getScopeId = (cmp, mode) => 'sc-' + ( cmp.$tagName$); | ||
| /** | ||
| * Default style mode id | ||
| */ | ||
| /** | ||
| * Reusable empty obj/array | ||
| * Don't add values to these!! | ||
| */ | ||
| const EMPTY_OBJ = {}; | ||
| const isDef = (v) => v != null; | ||
| const noop = () => { | ||
| /* noop*/ | ||
| }; | ||
| const isComplexType = (o) => { | ||
| // https://jsperf.com/typeof-fn-object/5 | ||
| o = typeof o; | ||
| return o === 'object' || o === 'function'; | ||
| }; | ||
| const IS_DENO_ENV = typeof Deno !== 'undefined'; | ||
| const IS_NODE_ENV = !IS_DENO_ENV && | ||
| typeof global !== 'undefined' && | ||
| typeof require === 'function' && | ||
| !!global.process && | ||
| typeof __filename === 'string' && | ||
| (!global.origin || typeof global.origin !== 'string'); | ||
| const IS_DENO_WINDOWS_ENV = IS_DENO_ENV && Deno.build.os === 'windows'; | ||
| const getCurrentDirectory = IS_NODE_ENV ? process.cwd : IS_DENO_ENV ? Deno.cwd : () => '/'; | ||
| const exit = IS_NODE_ENV ? process.exit : IS_DENO_ENV ? Deno.exit : noop; | ||
| /** | ||
| * Production h() function based on Preact by | ||
| * Jason Miller (@developit) | ||
| * Licensed under the MIT License | ||
| * https://github.com/developit/preact/blob/master/LICENSE | ||
| * | ||
| * Modified for Stencil's compiler and vdom | ||
| */ | ||
| // const stack: any[] = []; | ||
| // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode; | ||
| // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode; | ||
| const h = (nodeName, vnodeData, ...children) => { | ||
| let child = null; | ||
| let simple = false; | ||
| let lastSimple = false; | ||
| let vNodeChildren = []; | ||
| const walk = (c) => { | ||
| for (let i = 0; i < c.length; i++) { | ||
| child = c[i]; | ||
| if (Array.isArray(child)) { | ||
| walk(child); | ||
| } | ||
| else if (child != null && typeof child !== 'boolean') { | ||
| if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) { | ||
| child = String(child); | ||
| } | ||
| if (simple && lastSimple) { | ||
| // If the previous child was simple (string), we merge both | ||
| vNodeChildren[vNodeChildren.length - 1].$text$ += child; | ||
| } | ||
| else { | ||
| // Append a new vNode, if it's text, we create a text vNode | ||
| vNodeChildren.push(simple ? newVNode(null, child) : child); | ||
| } | ||
| lastSimple = simple; | ||
| } | ||
| } | ||
| }; | ||
| walk(children); | ||
| if (vnodeData) { | ||
| { | ||
| const classData = vnodeData.className || vnodeData.class; | ||
| if (classData) { | ||
| vnodeData.class = | ||
| typeof classData !== 'object' | ||
| ? classData | ||
| : Object.keys(classData) | ||
| .filter(k => classData[k]) | ||
| .join(' '); | ||
| } | ||
| } | ||
| } | ||
| const vnode = newVNode(nodeName, null); | ||
| vnode.$attrs$ = vnodeData; | ||
| if (vNodeChildren.length > 0) { | ||
| vnode.$children$ = vNodeChildren; | ||
| } | ||
| return vnode; | ||
| }; | ||
| const newVNode = (tag, text) => { | ||
| const vnode = { | ||
| $flags$: 0, | ||
| $tag$: tag, | ||
| $text$: text, | ||
| $elm$: null, | ||
| $children$: null, | ||
| }; | ||
| { | ||
| vnode.$attrs$ = null; | ||
| } | ||
| return vnode; | ||
| }; | ||
| const Host = {}; | ||
| const isHost = (node) => node && node.$tag$ === Host; | ||
| /** | ||
| * Production setAccessor() function based on Preact by | ||
| * Jason Miller (@developit) | ||
| * Licensed under the MIT License | ||
| * https://github.com/developit/preact/blob/master/LICENSE | ||
| * | ||
| * Modified for Stencil's compiler and vdom | ||
| */ | ||
| const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => { | ||
| if (oldValue !== newValue) { | ||
| let isProp = isMemberInElement(elm, memberName); | ||
| let ln = memberName.toLowerCase(); | ||
| if ( memberName === 'class') { | ||
| const classList = elm.classList; | ||
| const oldClasses = parseClassList(oldValue); | ||
| const newClasses = parseClassList(newValue); | ||
| classList.remove(...oldClasses.filter(c => c && !newClasses.includes(c))); | ||
| classList.add(...newClasses.filter(c => c && !oldClasses.includes(c))); | ||
| } | ||
| else { | ||
| // Set property if it exists and it's not a SVG | ||
| const isComplex = isComplexType(newValue); | ||
| if ((isProp || (isComplex && newValue !== null)) && !isSvg) { | ||
| try { | ||
| if (!elm.tagName.includes('-')) { | ||
| let n = newValue == null ? '' : newValue; | ||
| // Workaround for Safari, moving the <input> caret when re-assigning the same valued | ||
| if (memberName === 'list') { | ||
| isProp = false; | ||
| // tslint:disable-next-line: triple-equals | ||
| } | ||
| else if (oldValue == null || elm[memberName] != n) { | ||
| elm[memberName] = n; | ||
| } | ||
| } | ||
| else { | ||
| elm[memberName] = newValue; | ||
| } | ||
| } | ||
| catch (e) { } | ||
| } | ||
| if (newValue == null || newValue === false) { | ||
| if (newValue !== false || elm.getAttribute(memberName) === '') { | ||
| { | ||
| elm.removeAttribute(memberName); | ||
| } | ||
| } | ||
| } | ||
| else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) { | ||
| newValue = newValue === true ? '' : newValue; | ||
| { | ||
| elm.setAttribute(memberName, newValue); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| const parseClassListRegex = /\s/; | ||
| const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex)); | ||
| const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => { | ||
| // if the element passed in is a shadow root, which is a document fragment | ||
| // then we want to be adding attrs/props to the shadow root's "host" element | ||
| // if it's not a shadow root, then we add attrs/props to the same element | ||
| const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$; | ||
| const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ; | ||
| const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ; | ||
| { | ||
| // remove attributes no longer present on the vnode by setting them to undefined | ||
| for (memberName in oldVnodeAttrs) { | ||
| if (!(memberName in newVnodeAttrs)) { | ||
| setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$); | ||
| } | ||
| } | ||
| } | ||
| // add new & update changed attributes | ||
| for (memberName in newVnodeAttrs) { | ||
| setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$); | ||
| } | ||
| }; | ||
| const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => { | ||
| // tslint:disable-next-line: prefer-const | ||
| let newVNode = newParentVNode.$children$[childIndex]; | ||
| let i = 0; | ||
| let elm; | ||
| let childNode; | ||
| { | ||
| // create element | ||
| elm = newVNode.$elm$ = ( doc.createElement( newVNode.$tag$)); | ||
| // add css classes, attrs, props, listeners, etc. | ||
| { | ||
| updateElement(null, newVNode, isSvgMode); | ||
| } | ||
| if ( isDef(scopeId) && elm['s-si'] !== scopeId) { | ||
| // if there is a scopeId and this is the initial render | ||
| // then let's add the scopeId as a css class | ||
| elm.classList.add((elm['s-si'] = scopeId)); | ||
| } | ||
| if (newVNode.$children$) { | ||
| for (i = 0; i < newVNode.$children$.length; ++i) { | ||
| // create the node | ||
| childNode = createElm(oldParentVNode, newVNode, i); | ||
| // return node could have been null | ||
| if (childNode) { | ||
| // append our new node | ||
| elm.appendChild(childNode); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| return elm; | ||
| }; | ||
| const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => { | ||
| let containerElm = ( parentElm); | ||
| let childNode; | ||
| if ( containerElm.shadowRoot && containerElm.tagName === hostTagName) { | ||
| containerElm = containerElm.shadowRoot; | ||
| } | ||
| for (; startIdx <= endIdx; ++startIdx) { | ||
| if (vnodes[startIdx]) { | ||
| childNode = createElm(null, parentVNode, startIdx); | ||
| if (childNode) { | ||
| vnodes[startIdx].$elm$ = childNode; | ||
| containerElm.insertBefore(childNode, before); | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => { | ||
| for (; startIdx <= endIdx; ++startIdx) { | ||
| if ((vnode = vnodes[startIdx])) { | ||
| elm = vnode.$elm$; | ||
| // remove the vnode's element from the dom | ||
| elm.remove(); | ||
| } | ||
| } | ||
| }; | ||
| const updateChildren = (parentElm, oldCh, newVNode, newCh) => { | ||
| let oldStartIdx = 0; | ||
| let newStartIdx = 0; | ||
| let oldEndIdx = oldCh.length - 1; | ||
| let oldStartVnode = oldCh[0]; | ||
| let oldEndVnode = oldCh[oldEndIdx]; | ||
| let newEndIdx = newCh.length - 1; | ||
| let newStartVnode = newCh[0]; | ||
| let newEndVnode = newCh[newEndIdx]; | ||
| let node; | ||
| while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { | ||
| if (oldStartVnode == null) { | ||
| // Vnode might have been moved left | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| } | ||
| else if (oldEndVnode == null) { | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| } | ||
| else if (newStartVnode == null) { | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else if (newEndVnode == null) { | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldStartVnode, newStartVnode)) { | ||
| patch(oldStartVnode, newStartVnode); | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else if (isSameVnode(oldEndVnode, newEndVnode)) { | ||
| patch(oldEndVnode, newEndVnode); | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldStartVnode, newEndVnode)) { | ||
| patch(oldStartVnode, newEndVnode); | ||
| parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling); | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldEndVnode, newStartVnode)) { | ||
| patch(oldEndVnode, newStartVnode); | ||
| parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$); | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else { | ||
| { | ||
| // new element | ||
| node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx); | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| if (node) { | ||
| { | ||
| oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| if (oldStartIdx > oldEndIdx) { | ||
| addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx); | ||
| } | ||
| else if ( newStartIdx > newEndIdx) { | ||
| removeVnodes(oldCh, oldStartIdx, oldEndIdx); | ||
| } | ||
| }; | ||
| const isSameVnode = (vnode1, vnode2) => { | ||
| // compare if two vnode to see if they're "technically" the same | ||
| // need to have the same element tag, and same key to be the same | ||
| if (vnode1.$tag$ === vnode2.$tag$) { | ||
| return true; | ||
| } | ||
| return false; | ||
| }; | ||
| const patch = (oldVNode, newVNode) => { | ||
| const elm = (newVNode.$elm$ = oldVNode.$elm$); | ||
| const oldChildren = oldVNode.$children$; | ||
| const newChildren = newVNode.$children$; | ||
| { | ||
| // element node | ||
| { | ||
| { | ||
| // either this is the first render of an element OR it's an update | ||
| // AND we already know it's possible it could have changed | ||
| // this updates the element's css classes, attrs, props, listeners, etc. | ||
| updateElement(oldVNode, newVNode, isSvgMode); | ||
| } | ||
| } | ||
| if ( oldChildren !== null && newChildren !== null) { | ||
| // looks like there's child vnodes for both the old and new vnodes | ||
| updateChildren(elm, oldChildren, newVNode, newChildren); | ||
| } | ||
| else if (newChildren !== null) { | ||
| // add the new vnode children | ||
| addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1); | ||
| } | ||
| else if ( oldChildren !== null) { | ||
| // no new child vnodes, but there are old child vnodes to remove | ||
| removeVnodes(oldChildren, 0, oldChildren.length - 1); | ||
| } | ||
| } | ||
| }; | ||
| const renderVdom = (hostRef, renderFnResults) => { | ||
| const hostElm = hostRef.$hostElement$; | ||
| const oldVNode = hostRef.$vnode$ || newVNode(null, null); | ||
| const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults); | ||
| hostTagName = hostElm.tagName; | ||
| rootVnode.$tag$ = null; | ||
| rootVnode.$flags$ |= 4 /* isHost */; | ||
| hostRef.$vnode$ = rootVnode; | ||
| rootVnode.$elm$ = oldVNode.$elm$ = ( hostElm.shadowRoot || hostElm ); | ||
| { | ||
| scopeId = hostElm['s-sc']; | ||
| } | ||
| // synchronous patch | ||
| patch(oldVNode, rootVnode); | ||
| }; | ||
| const getElement = (ref) => ( getHostRef(ref).$hostElement$ ); | ||
| const createEvent = (ref, name, flags) => { | ||
| const elm = getElement(ref); | ||
| return { | ||
| emit: (detail) => { | ||
| return emitEvent(elm, name, { | ||
| bubbles: !!(flags & 4 /* Bubbles */), | ||
| composed: !!(flags & 2 /* Composed */), | ||
| cancelable: !!(flags & 1 /* Cancellable */), | ||
| detail, | ||
| }); | ||
| }, | ||
| }; | ||
| }; | ||
| const emitEvent = (elm, name, opts) => { | ||
| const ev = plt.ce(name, opts); | ||
| elm.dispatchEvent(ev); | ||
| return ev; | ||
| }; | ||
| const attachToAncestor = (hostRef, ancestorComponent) => { | ||
| if ( ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) { | ||
| ancestorComponent['s-p'].push(new Promise(r => (hostRef.$onRenderResolve$ = r))); | ||
| } | ||
| }; | ||
| const scheduleUpdate = (hostRef, isInitialLoad) => { | ||
| { | ||
| hostRef.$flags$ |= 16 /* isQueuedForUpdate */; | ||
| } | ||
| if ( hostRef.$flags$ & 4 /* isWaitingForChildren */) { | ||
| hostRef.$flags$ |= 512 /* needsRerender */; | ||
| return; | ||
| } | ||
| attachToAncestor(hostRef, hostRef.$ancestorComponent$); | ||
| // there is no ancestorc omponent or the ancestor component | ||
| // has already fired off its lifecycle update then | ||
| // fire off the initial update | ||
| const dispatch = () => dispatchHooks(hostRef, isInitialLoad); | ||
| return writeTask(dispatch) ; | ||
| }; | ||
| const dispatchHooks = (hostRef, isInitialLoad) => { | ||
| const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$); | ||
| const instance = hostRef.$lazyInstance$ ; | ||
| let promise; | ||
| if (isInitialLoad) { | ||
| { | ||
| hostRef.$flags$ |= 256 /* isListenReady */; | ||
| if (hostRef.$queuedListeners$) { | ||
| hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event)); | ||
| hostRef.$queuedListeners$ = null; | ||
| } | ||
| } | ||
| { | ||
| promise = safeCall(instance, 'componentWillLoad'); | ||
| } | ||
| } | ||
| { | ||
| promise = then(promise, () => safeCall(instance, 'componentWillRender')); | ||
| } | ||
| endSchedule(); | ||
| return then(promise, () => updateComponent(hostRef, instance, isInitialLoad)); | ||
| }; | ||
| const updateComponent = (hostRef, instance, isInitialLoad) => { | ||
| // updateComponent | ||
| const elm = hostRef.$hostElement$; | ||
| const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$); | ||
| const rc = elm['s-rc']; | ||
| if ( isInitialLoad) { | ||
| // DOM WRITE! | ||
| attachStyles(hostRef); | ||
| } | ||
| const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$); | ||
| { | ||
| { | ||
| // looks like we've got child nodes to render into this host element | ||
| // or we need to update the css class/attrs on the host element | ||
| // DOM WRITE! | ||
| renderVdom(hostRef, callRender(hostRef, instance)); | ||
| } | ||
| } | ||
| if ( plt.$cssShim$) { | ||
| plt.$cssShim$.updateHost(elm); | ||
| } | ||
| if ( rc) { | ||
| // ok, so turns out there are some child host elements | ||
| // waiting on this parent element to load | ||
| // let's fire off all update callbacks waiting | ||
| rc.map(cb => cb()); | ||
| elm['s-rc'] = undefined; | ||
| } | ||
| endRender(); | ||
| endUpdate(); | ||
| { | ||
| const childrenPromises = elm['s-p']; | ||
| const postUpdate = () => postUpdateComponent(hostRef); | ||
| if (childrenPromises.length === 0) { | ||
| postUpdate(); | ||
| } | ||
| else { | ||
| Promise.all(childrenPromises).then(postUpdate); | ||
| hostRef.$flags$ |= 4 /* isWaitingForChildren */; | ||
| childrenPromises.length = 0; | ||
| } | ||
| } | ||
| }; | ||
| const callRender = (hostRef, instance) => { | ||
| try { | ||
| instance = instance.render() ; | ||
| { | ||
| hostRef.$flags$ &= ~16 /* isQueuedForUpdate */; | ||
| } | ||
| { | ||
| hostRef.$flags$ |= 2 /* hasRendered */; | ||
| } | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| return instance; | ||
| }; | ||
| const postUpdateComponent = (hostRef) => { | ||
| const tagName = hostRef.$cmpMeta$.$tagName$; | ||
| const elm = hostRef.$hostElement$; | ||
| const endPostUpdate = createTime('postUpdate', tagName); | ||
| const ancestorComponent = hostRef.$ancestorComponent$; | ||
| if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) { | ||
| hostRef.$flags$ |= 64 /* hasLoadedComponent */; | ||
| { | ||
| // DOM WRITE! | ||
| addHydratedFlag(elm); | ||
| } | ||
| endPostUpdate(); | ||
| { | ||
| hostRef.$onReadyResolve$(elm); | ||
| if (!ancestorComponent) { | ||
| appDidLoad(); | ||
| } | ||
| } | ||
| } | ||
| else { | ||
| endPostUpdate(); | ||
| } | ||
| { | ||
| hostRef.$onInstanceResolve$(elm); | ||
| } | ||
| // load events fire from bottom to top | ||
| // the deepest elements load first then bubbles up | ||
| { | ||
| if (hostRef.$onRenderResolve$) { | ||
| hostRef.$onRenderResolve$(); | ||
| hostRef.$onRenderResolve$ = undefined; | ||
| } | ||
| if (hostRef.$flags$ & 512 /* needsRerender */) { | ||
| nextTick(() => scheduleUpdate(hostRef, false)); | ||
| } | ||
| hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */); | ||
| } | ||
| // ( •_•) | ||
| // ( •_•)>⌐■-■ | ||
| // (⌐■_■) | ||
| }; | ||
| const forceUpdate = (ref) => { | ||
| { | ||
| const hostRef = getHostRef(ref); | ||
| const isConnected = hostRef.$hostElement$.isConnected; | ||
| if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) { | ||
| scheduleUpdate(hostRef, false); | ||
| } | ||
| // Returns "true" when the forced update was successfully scheduled | ||
| return isConnected; | ||
| } | ||
| }; | ||
| const appDidLoad = (who) => { | ||
| // on appload | ||
| // we have finish the first big initial render | ||
| { | ||
| addHydratedFlag(doc.documentElement); | ||
| } | ||
| { | ||
| plt.$flags$ |= 2 /* appLoaded */; | ||
| } | ||
| nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } })); | ||
| }; | ||
| const safeCall = (instance, method, arg) => { | ||
| if (instance && instance[method]) { | ||
| try { | ||
| return instance[method](arg); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| return undefined; | ||
| }; | ||
| const then = (promise, thenFn) => { | ||
| return promise && promise.then ? promise.then(thenFn) : thenFn(); | ||
| }; | ||
| const addHydratedFlag = (elm) => ( elm.classList.add('hydrated') ); | ||
| const parsePropertyValue = (propValue, propType) => { | ||
| // ensure this value is of the correct prop type | ||
| if (propValue != null && !isComplexType(propValue)) { | ||
| if ( propType & 1 /* String */) { | ||
| // could have been passed as a number or boolean | ||
| // but we still want it as a string | ||
| return String(propValue); | ||
| } | ||
| // redundant return here for better minification | ||
| return propValue; | ||
| } | ||
| // not sure exactly what type we want | ||
| // so no need to change to a different type | ||
| return propValue; | ||
| }; | ||
| const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName); | ||
| const setValue = (ref, propName, newVal, cmpMeta) => { | ||
| // check our new property value against our internal value | ||
| const hostRef = getHostRef(ref); | ||
| const oldVal = hostRef.$instanceValues$.get(propName); | ||
| const flags = hostRef.$flags$; | ||
| const instance = hostRef.$lazyInstance$ ; | ||
| newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]); | ||
| if (( !(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && newVal !== oldVal) { | ||
| // gadzooks! the property's value has changed!! | ||
| // set our new value! | ||
| hostRef.$instanceValues$.set(propName, newVal); | ||
| if ( instance) { | ||
| if ( (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) { | ||
| // looks like this value actually changed, so we've got work to do! | ||
| // but only if we've already rendered, otherwise just chill out | ||
| // queue that we need to do an update, but don't worry about queuing | ||
| // up millions cuz this function ensures it only runs once | ||
| scheduleUpdate(hostRef, false); | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| const proxyComponent = (Cstr, cmpMeta, flags) => { | ||
| if ( cmpMeta.$members$) { | ||
| // It's better to have a const than two Object.entries() | ||
| const members = Object.entries(cmpMeta.$members$); | ||
| const prototype = Cstr.prototype; | ||
| members.map(([memberName, [memberFlags]]) => { | ||
| if ( (memberFlags & 31 /* Prop */ || (( flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) { | ||
| // proxyComponent - prop | ||
| Object.defineProperty(prototype, memberName, { | ||
| get() { | ||
| // proxyComponent, get value | ||
| return getValue(this, memberName); | ||
| }, | ||
| set(newValue) { | ||
| // proxyComponent, set value | ||
| setValue(this, memberName, newValue, cmpMeta); | ||
| }, | ||
| configurable: true, | ||
| enumerable: true, | ||
| }); | ||
| } | ||
| else if ( flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) { | ||
| // proxyComponent - method | ||
| Object.defineProperty(prototype, memberName, { | ||
| value(...args) { | ||
| const ref = getHostRef(this); | ||
| return ref.$onInstancePromise$.then(() => ref.$lazyInstance$[memberName](...args)); | ||
| }, | ||
| }); | ||
| } | ||
| }); | ||
| if ( ( flags & 1 /* isElementConstructor */)) { | ||
| const attrNameToPropName = new Map(); | ||
| prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) { | ||
| plt.jmp(() => { | ||
| const propName = attrNameToPropName.get(attrName); | ||
| this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue; | ||
| }); | ||
| }; | ||
| // create an array of attributes to observe | ||
| // and also create a map of html attribute name to js property name | ||
| Cstr.observedAttributes = members | ||
| .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes | ||
| .map(([propName, m]) => { | ||
| const attrName = m[1] || propName; | ||
| attrNameToPropName.set(attrName, propName); | ||
| return attrName; | ||
| }); | ||
| } | ||
| } | ||
| return Cstr; | ||
| }; | ||
| const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => { | ||
| // initializeComponent | ||
| if ( (hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) { | ||
| { | ||
| // we haven't initialized this element yet | ||
| hostRef.$flags$ |= 32 /* hasInitializedComponent */; | ||
| // lazy loaded components | ||
| // request the component's implementation to be | ||
| // wired up with the host element | ||
| Cstr = loadModule(cmpMeta); | ||
| if (Cstr.then) { | ||
| // Await creates a micro-task avoid if possible | ||
| const endLoad = uniqueTime(); | ||
| Cstr = await Cstr; | ||
| endLoad(); | ||
| } | ||
| if ( !Cstr.isProxied) { | ||
| proxyComponent(Cstr, cmpMeta, 2 /* proxyState */); | ||
| Cstr.isProxied = true; | ||
| } | ||
| const endNewInstance = createTime('createInstance', cmpMeta.$tagName$); | ||
| // ok, time to construct the instance | ||
| // but let's keep track of when we start and stop | ||
| // so that the getters/setters don't incorrectly step on data | ||
| { | ||
| hostRef.$flags$ |= 8 /* isConstructingInstance */; | ||
| } | ||
| // construct the lazy-loaded component implementation | ||
| // passing the hostRef is very important during | ||
| // construction in order to directly wire together the | ||
| // host element and the lazy-loaded instance | ||
| try { | ||
| new Cstr(hostRef); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| { | ||
| hostRef.$flags$ &= ~8 /* isConstructingInstance */; | ||
| } | ||
| endNewInstance(); | ||
| } | ||
| if ( Cstr.style) { | ||
| // this component has styles but we haven't registered them yet | ||
| let style = Cstr.style; | ||
| const scopeId = getScopeId(cmpMeta); | ||
| if (!styles.has(scopeId)) { | ||
| const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$); | ||
| if ( cmpMeta.$flags$ & 8 /* needsShadowDomShim */) { | ||
| style = await Promise.resolve().then(function () { return require('./shadow-css-8d840853.js'); }).then(m => m.scopeCss(style, scopeId, false)); | ||
| } | ||
| registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)); | ||
| endRegisterStyles(); | ||
| } | ||
| } | ||
| } | ||
| // we've successfully created a lazy instance | ||
| const ancestorComponent = hostRef.$ancestorComponent$; | ||
| const schedule = () => scheduleUpdate(hostRef, true); | ||
| if ( ancestorComponent && ancestorComponent['s-rc']) { | ||
| // this is the intial load and this component it has an ancestor component | ||
| // but the ancestor component has NOT fired its will update lifecycle yet | ||
| // so let's just cool our jets and wait for the ancestor to continue first | ||
| // this will get fired off when the ancestor component | ||
| // finally gets around to rendering its lazy self | ||
| // fire off the initial update | ||
| ancestorComponent['s-rc'].push(schedule); | ||
| } | ||
| else { | ||
| schedule(); | ||
| } | ||
| }; | ||
| const connectedCallback = (elm) => { | ||
| if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) { | ||
| const hostRef = getHostRef(elm); | ||
| const cmpMeta = hostRef.$cmpMeta$; | ||
| const endConnected = createTime('connectedCallback', cmpMeta.$tagName$); | ||
| if (!(hostRef.$flags$ & 1 /* hasConnected */)) { | ||
| // first time this component has connected | ||
| hostRef.$flags$ |= 1 /* hasConnected */; | ||
| { | ||
| // find the first ancestor component (if there is one) and register | ||
| // this component as one of the actively loading child components for its ancestor | ||
| let ancestorComponent = elm; | ||
| while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) { | ||
| // climb up the ancestors looking for the first | ||
| // component that hasn't finished its lifecycle update yet | ||
| if ( | ||
| ancestorComponent['s-p']) { | ||
| // we found this components first ancestor component | ||
| // keep a reference to this component's ancestor component | ||
| attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent)); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| // Lazy properties | ||
| // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties | ||
| if ( cmpMeta.$members$) { | ||
| Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => { | ||
| if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) { | ||
| const value = elm[memberName]; | ||
| delete elm[memberName]; | ||
| elm[memberName] = value; | ||
| } | ||
| }); | ||
| } | ||
| { | ||
| // connectedCallback, taskQueue, initialLoad | ||
| // angular sets attribute AFTER connectCallback | ||
| // https://github.com/angular/angular/issues/18909 | ||
| // https://github.com/angular/angular/issues/19940 | ||
| nextTick(() => initializeComponent(elm, hostRef, cmpMeta)); | ||
| } | ||
| } | ||
| else { | ||
| // not the first time this has connected | ||
| // reattach any event listeners to the host | ||
| // since they would have been removed when disconnected | ||
| addHostEventListeners(elm, hostRef, cmpMeta.$listeners$); | ||
| } | ||
| endConnected(); | ||
| } | ||
| }; | ||
| const disconnectedCallback = (elm) => { | ||
| if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) { | ||
| const hostRef = getHostRef(elm); | ||
| { | ||
| if (hostRef.$rmListeners$) { | ||
| hostRef.$rmListeners$.map(rmListener => rmListener()); | ||
| hostRef.$rmListeners$ = undefined; | ||
| } | ||
| } | ||
| // clear CSS var-shim tracking | ||
| if ( plt.$cssShim$) { | ||
| plt.$cssShim$.removeHost(elm); | ||
| } | ||
| } | ||
| }; | ||
| const bootstrapLazy = (lazyBundles, options = {}) => { | ||
| const endBootstrap = createTime(); | ||
| const cmpTags = []; | ||
| const exclude = options.exclude || []; | ||
| const customElements = win.customElements; | ||
| const head = doc.head; | ||
| const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]'); | ||
| const visibilityStyle = /*@__PURE__*/ doc.createElement('style'); | ||
| const deferredConnectedCallbacks = []; | ||
| let appLoadFallback; | ||
| let isBootstrapping = true; | ||
| Object.assign(plt, options); | ||
| plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href; | ||
| { | ||
| if (options.syncQueue) { | ||
| plt.$flags$ |= 4 /* queueSync */; | ||
| } | ||
| } | ||
| lazyBundles.map(lazyBundle => lazyBundle[1].map(compactMeta => { | ||
| const cmpMeta = { | ||
| $flags$: compactMeta[0], | ||
| $tagName$: compactMeta[1], | ||
| $members$: compactMeta[2], | ||
| $listeners$: compactMeta[3], | ||
| }; | ||
| { | ||
| cmpMeta.$members$ = compactMeta[2]; | ||
| } | ||
| { | ||
| cmpMeta.$listeners$ = compactMeta[3]; | ||
| } | ||
| if ( !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { | ||
| cmpMeta.$flags$ |= 8 /* needsShadowDomShim */; | ||
| } | ||
| const tagName = cmpMeta.$tagName$; | ||
| const HostElement = class extends HTMLElement { | ||
| // StencilLazyHost | ||
| constructor(self) { | ||
| // @ts-ignore | ||
| super(self); | ||
| self = this; | ||
| registerHost(self, cmpMeta); | ||
| if ( cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { | ||
| // this component is using shadow dom | ||
| // and this browser supports shadow dom | ||
| // add the read-only property "shadowRoot" to the host element | ||
| // adding the shadow root build conditionals to minimize runtime | ||
| if (supportsShadow) { | ||
| { | ||
| self.attachShadow({ mode: 'open' }); | ||
| } | ||
| } | ||
| else if ( !('shadowRoot' in self)) { | ||
| self.shadowRoot = self; | ||
| } | ||
| } | ||
| } | ||
| connectedCallback() { | ||
| if (appLoadFallback) { | ||
| clearTimeout(appLoadFallback); | ||
| appLoadFallback = null; | ||
| } | ||
| if (isBootstrapping) { | ||
| // connectedCallback will be processed once all components have been registered | ||
| deferredConnectedCallbacks.push(this); | ||
| } | ||
| else { | ||
| plt.jmp(() => connectedCallback(this)); | ||
| } | ||
| } | ||
| disconnectedCallback() { | ||
| plt.jmp(() => disconnectedCallback(this)); | ||
| } | ||
| forceUpdate() { | ||
| forceUpdate(this); | ||
| } | ||
| componentOnReady() { | ||
| return getHostRef(this).$onReadyPromise$; | ||
| } | ||
| }; | ||
| cmpMeta.$lazyBundleId$ = lazyBundle[0]; | ||
| if (!exclude.includes(tagName) && !customElements.get(tagName)) { | ||
| cmpTags.push(tagName); | ||
| customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */)); | ||
| } | ||
| })); | ||
| { | ||
| visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS; | ||
| visibilityStyle.setAttribute('data-styles', ''); | ||
| head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild); | ||
| } | ||
| // Process deferred connectedCallbacks now all components have been registered | ||
| isBootstrapping = false; | ||
| if (deferredConnectedCallbacks.length) { | ||
| deferredConnectedCallbacks.map(host => host.connectedCallback()); | ||
| } | ||
| else { | ||
| { | ||
| plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30))); | ||
| } | ||
| } | ||
| // Fallback appLoad event | ||
| endBootstrap(); | ||
| }; | ||
| const hostRefs = new WeakMap(); | ||
| const getHostRef = (ref) => hostRefs.get(ref); | ||
| const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef); | ||
| const registerHost = (elm, cmpMeta) => { | ||
| const hostRef = { | ||
| $flags$: 0, | ||
| $hostElement$: elm, | ||
| $cmpMeta$: cmpMeta, | ||
| $instanceValues$: new Map(), | ||
| }; | ||
| { | ||
| hostRef.$onInstancePromise$ = new Promise(r => (hostRef.$onInstanceResolve$ = r)); | ||
| } | ||
| { | ||
| hostRef.$onReadyPromise$ = new Promise(r => (hostRef.$onReadyResolve$ = r)); | ||
| elm['s-p'] = []; | ||
| elm['s-rc'] = []; | ||
| } | ||
| addHostEventListeners(elm, hostRef, cmpMeta.$listeners$); | ||
| return hostRefs.set(elm, hostRef); | ||
| }; | ||
| const isMemberInElement = (elm, memberName) => memberName in elm; | ||
| const consoleError = (e) => console.error(e); | ||
| const cmpModules = /*@__PURE__*/ new Map(); | ||
| const loadModule = (cmpMeta, hostRef, hmrVersionId) => { | ||
| // loadModuleImport | ||
| const exportName = cmpMeta.$tagName$.replace(/-/g, '_'); | ||
| const bundleId = cmpMeta.$lazyBundleId$; | ||
| const module = cmpModules.get(bundleId) ; | ||
| if (module) { | ||
| return module[exportName]; | ||
| } | ||
| return Promise.resolve().then(function () { return _interopNamespace(require( | ||
| /* webpackInclude: /\.entry\.js$/ */ | ||
| /* webpackExclude: /\.system\.entry\.js$/ */ | ||
| /* webpackMode: "lazy" */ | ||
| `./${bundleId}.entry.js${ ''}`)); }).then(importedModule => { | ||
| { | ||
| cmpModules.set(bundleId, importedModule); | ||
| } | ||
| return importedModule[exportName]; | ||
| }, consoleError); | ||
| }; | ||
| const styles = new Map(); | ||
| const queueDomReads = []; | ||
| const queueDomWrites = []; | ||
| const queueDomWritesLow = []; | ||
| const queueTask = (queue, write) => (cb) => { | ||
| queue.push(cb); | ||
| if (!queuePending) { | ||
| queuePending = true; | ||
| if (write && plt.$flags$ & 4 /* queueSync */) { | ||
| nextTick(flush); | ||
| } | ||
| else { | ||
| plt.raf(flush); | ||
| } | ||
| } | ||
| }; | ||
| const consume = (queue) => { | ||
| for (let i = 0; i < queue.length; i++) { | ||
| try { | ||
| queue[i](performance.now()); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| queue.length = 0; | ||
| }; | ||
| const consumeTimeout = (queue, timeout) => { | ||
| let i = 0; | ||
| let ts = 0; | ||
| while (i < queue.length && (ts = performance.now()) < timeout) { | ||
| try { | ||
| queue[i++](ts); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| if (i === queue.length) { | ||
| queue.length = 0; | ||
| } | ||
| else if (i !== 0) { | ||
| queue.splice(0, i); | ||
| } | ||
| }; | ||
| const flush = () => { | ||
| { | ||
| queueCongestion++; | ||
| } | ||
| // always force a bunch of medium callbacks to run, but still have | ||
| // a throttle on how many can run in a certain time | ||
| // DOM READS!!! | ||
| consume(queueDomReads); | ||
| // DOM WRITES!!! | ||
| { | ||
| const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */ ? performance.now() + 14 * Math.ceil(queueCongestion * (1.0 / 10.0)) : Infinity; | ||
| consumeTimeout(queueDomWrites, timeout); | ||
| consumeTimeout(queueDomWritesLow, timeout); | ||
| if (queueDomWrites.length > 0) { | ||
| queueDomWritesLow.push(...queueDomWrites); | ||
| queueDomWrites.length = 0; | ||
| } | ||
| if ((queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0)) { | ||
| // still more to do yet, but we've run out of time | ||
| // let's let this thing cool off and try again in the next tick | ||
| plt.raf(flush); | ||
| } | ||
| else { | ||
| queueCongestion = 0; | ||
| } | ||
| } | ||
| }; | ||
| const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb); | ||
| const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true); | ||
| exports.CSS = CSS; | ||
| exports.NAMESPACE = NAMESPACE; | ||
| exports.bootstrapLazy = bootstrapLazy; | ||
| exports.createEvent = createEvent; | ||
| exports.doc = doc; | ||
| exports.getElement = getElement; | ||
| exports.h = h; | ||
| exports.plt = plt; | ||
| exports.promiseResolve = promiseResolve; | ||
| exports.registerInstance = registerInstance; | ||
| exports.win = win; |
| 'use strict'; | ||
| const index = require('./index-0661ae79.js'); | ||
| /* | ||
| Stencil Client Patch v1.17.3 | MIT Licensed | https://stenciljs.com | ||
| */ | ||
| const noop = () => { | ||
| /* noop*/ | ||
| }; | ||
| const IS_DENO_ENV = typeof Deno !== 'undefined'; | ||
| const IS_NODE_ENV = !IS_DENO_ENV && | ||
| typeof global !== 'undefined' && | ||
| typeof require === 'function' && | ||
| !!global.process && | ||
| typeof __filename === 'string' && | ||
| (!global.origin || typeof global.origin !== 'string'); | ||
| const IS_DENO_WINDOWS_ENV = IS_DENO_ENV && Deno.build.os === 'windows'; | ||
| const getCurrentDirectory = IS_NODE_ENV ? process.cwd : IS_DENO_ENV ? Deno.cwd : () => '/'; | ||
| const exit = IS_NODE_ENV ? process.exit : IS_DENO_ENV ? Deno.exit : noop; | ||
| const getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\s|-/g, '_')}`; | ||
| const patchEsm = () => { | ||
| // NOTE!! This fn cannot use async/await! | ||
| // @ts-ignore | ||
| if ( !(index.CSS && index.CSS.supports && index.CSS.supports('color', 'var(--c)'))) { | ||
| // @ts-ignore | ||
| return Promise.resolve().then(function () { return require(/* webpackChunkName: "polyfills-css-shim" */ './css-shim-0abe6f52.js'); }).then(() => { | ||
| if ((index.plt.$cssShim$ = index.win.__cssshim)) { | ||
| return index.plt.$cssShim$.i(); | ||
| } | ||
| else { | ||
| // for better minification | ||
| return 0; | ||
| } | ||
| }); | ||
| } | ||
| return index.promiseResolve(); | ||
| }; | ||
| const patchBrowser = () => { | ||
| { | ||
| // shim css vars | ||
| index.plt.$cssShim$ = index.win.__cssshim; | ||
| } | ||
| // @ts-ignore | ||
| const scriptElm = Array.from(index.doc.querySelectorAll('script')).find(s => new RegExp(`\/${index.NAMESPACE}(\\.esm)?\\.js($|\\?|#)`).test(s.src) || s.getAttribute('data-stencil-namespace') === index.NAMESPACE) | ||
| ; | ||
| const opts = scriptElm['data-opts'] || {} ; | ||
| if ( 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) { | ||
| // Safari < v11 support: This IF is true if it's Safari below v11. | ||
| // This fn cannot use async/await since Safari didn't support it until v11, | ||
| // however, Safari 10 did support modules. Safari 10 also didn't support "nomodule", | ||
| // so both the ESM file and nomodule file would get downloaded. Only Safari | ||
| // has 'onbeforeload' in the script, and "history.scrollRestoration" was added | ||
| // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue. | ||
| // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds. | ||
| return { | ||
| then() { | ||
| /* promise noop */ | ||
| }, | ||
| }; | ||
| } | ||
| { | ||
| opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, index.win.location.href)).href; | ||
| { | ||
| patchDynamicImport(opts.resourcesUrl, scriptElm); | ||
| } | ||
| if ( !index.win.customElements) { | ||
| // module support, but no custom elements support (Old Edge) | ||
| // @ts-ignore | ||
| return Promise.resolve().then(function () { return require(/* webpackChunkName: "polyfills-dom" */ './dom-c3bc978c.js'); }).then(() => opts); | ||
| } | ||
| } | ||
| return index.promiseResolve(opts); | ||
| }; | ||
| const patchDynamicImport = (base, orgScriptElm) => { | ||
| const importFunctionName = getDynamicImportFunction(index.NAMESPACE); | ||
| try { | ||
| // test if this browser supports dynamic imports | ||
| // There is a caching issue in V8, that breaks using import() in Function | ||
| // By generating a random string, we can workaround it | ||
| // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info | ||
| index.win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`); | ||
| } | ||
| catch (e) { | ||
| // this shim is specifically for browsers that do support "esm" imports | ||
| // however, they do NOT support "dynamic" imports | ||
| // basically this code is for old Edge, v18 and below | ||
| const moduleMap = new Map(); | ||
| index.win[importFunctionName] = (src) => { | ||
| const url = new URL(src, base).href; | ||
| let mod = moduleMap.get(url); | ||
| if (!mod) { | ||
| const script = index.doc.createElement('script'); | ||
| script.type = 'module'; | ||
| script.crossOrigin = orgScriptElm.crossOrigin; | ||
| script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], { type: 'application/javascript' })); | ||
| mod = new Promise(resolve => { | ||
| script.onload = () => { | ||
| resolve(index.win[importFunctionName].m); | ||
| script.remove(); | ||
| }; | ||
| }); | ||
| moduleMap.set(url, mod); | ||
| index.doc.head.appendChild(script); | ||
| } | ||
| return mod; | ||
| }; | ||
| } | ||
| }; | ||
| exports.patchBrowser = patchBrowser; | ||
| exports.patchEsm = patchEsm; |
| 'use strict'; | ||
| /* | ||
| Stencil Client Platform v1.17.3 | MIT Licensed | https://stenciljs.com | ||
| */ | ||
| /** | ||
| * @license | ||
| * Copyright Google Inc. All Rights Reserved. | ||
| * | ||
| * Use of this source code is governed by an MIT-style license that can be | ||
| * found in the LICENSE file at https://angular.io/license | ||
| * | ||
| * This file is a port of shadowCSS from webcomponents.js to TypeScript. | ||
| * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js | ||
| * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts | ||
| */ | ||
| const safeSelector = (selector) => { | ||
| const placeholders = []; | ||
| let index = 0; | ||
| let content; | ||
| // Replaces attribute selectors with placeholders. | ||
| // The WS in [attr="va lue"] would otherwise be interpreted as a selector separator. | ||
| selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => { | ||
| const replaceBy = `__ph-${index}__`; | ||
| placeholders.push(keep); | ||
| index++; | ||
| return replaceBy; | ||
| }); | ||
| // Replaces the expression in `:nth-child(2n + 1)` with a placeholder. | ||
| // WS and "+" would otherwise be interpreted as selector separators. | ||
| content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => { | ||
| const replaceBy = `__ph-${index}__`; | ||
| placeholders.push(exp); | ||
| index++; | ||
| return pseudo + replaceBy; | ||
| }); | ||
| const ss = { | ||
| content, | ||
| placeholders, | ||
| }; | ||
| return ss; | ||
| }; | ||
| const restoreSafeSelector = (placeholders, content) => { | ||
| return content.replace(/__ph-(\d+)__/g, (_, index) => placeholders[+index]); | ||
| }; | ||
| const _polyfillHost = '-shadowcsshost'; | ||
| const _polyfillSlotted = '-shadowcssslotted'; | ||
| // note: :host-context pre-processed to -shadowcsshostcontext. | ||
| const _polyfillHostContext = '-shadowcsscontext'; | ||
| const _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)'; | ||
| const _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim'); | ||
| const _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim'); | ||
| const _cssColonSlottedRe = new RegExp('(' + _polyfillSlotted + _parenSuffix, 'gim'); | ||
| const _polyfillHostNoCombinator = _polyfillHost + '-no-combinator'; | ||
| const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/; | ||
| const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g]; | ||
| const _selectorReSuffix = '([>\\s~+[.,{:][\\s\\S]*)?$'; | ||
| const _polyfillHostRe = /-shadowcsshost/gim; | ||
| const _colonHostRe = /:host/gim; | ||
| const _colonSlottedRe = /::slotted/gim; | ||
| const _colonHostContextRe = /:host-context/gim; | ||
| const _commentRe = /\/\*\s*[\s\S]*?\*\//g; | ||
| const stripComments = (input) => { | ||
| return input.replace(_commentRe, ''); | ||
| }; | ||
| const _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g; | ||
| const extractCommentsWithHash = (input) => { | ||
| return input.match(_commentWithHashRe) || []; | ||
| }; | ||
| const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g; | ||
| const _curlyRe = /([{}])/g; | ||
| const OPEN_CURLY = '{'; | ||
| const CLOSE_CURLY = '}'; | ||
| const BLOCK_PLACEHOLDER = '%BLOCK%'; | ||
| const processRules = (input, ruleCallback) => { | ||
| const inputWithEscapedBlocks = escapeBlocks(input); | ||
| let nextBlockIndex = 0; | ||
| return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => { | ||
| const selector = m[2]; | ||
| let content = ''; | ||
| let suffix = m[4]; | ||
| let contentPrefix = ''; | ||
| if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) { | ||
| content = inputWithEscapedBlocks.blocks[nextBlockIndex++]; | ||
| suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1); | ||
| contentPrefix = '{'; | ||
| } | ||
| const cssRule = { | ||
| selector, | ||
| content, | ||
| }; | ||
| const rule = ruleCallback(cssRule); | ||
| return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`; | ||
| }); | ||
| }; | ||
| const escapeBlocks = (input) => { | ||
| const inputParts = input.split(_curlyRe); | ||
| const resultParts = []; | ||
| const escapedBlocks = []; | ||
| let bracketCount = 0; | ||
| let currentBlockParts = []; | ||
| for (let partIndex = 0; partIndex < inputParts.length; partIndex++) { | ||
| const part = inputParts[partIndex]; | ||
| if (part === CLOSE_CURLY) { | ||
| bracketCount--; | ||
| } | ||
| if (bracketCount > 0) { | ||
| currentBlockParts.push(part); | ||
| } | ||
| else { | ||
| if (currentBlockParts.length > 0) { | ||
| escapedBlocks.push(currentBlockParts.join('')); | ||
| resultParts.push(BLOCK_PLACEHOLDER); | ||
| currentBlockParts = []; | ||
| } | ||
| resultParts.push(part); | ||
| } | ||
| if (part === OPEN_CURLY) { | ||
| bracketCount++; | ||
| } | ||
| } | ||
| if (currentBlockParts.length > 0) { | ||
| escapedBlocks.push(currentBlockParts.join('')); | ||
| resultParts.push(BLOCK_PLACEHOLDER); | ||
| } | ||
| const strEscapedBlocks = { | ||
| escapedString: resultParts.join(''), | ||
| blocks: escapedBlocks, | ||
| }; | ||
| return strEscapedBlocks; | ||
| }; | ||
| const insertPolyfillHostInCssText = (selector) => { | ||
| selector = selector | ||
| .replace(_colonHostContextRe, _polyfillHostContext) | ||
| .replace(_colonHostRe, _polyfillHost) | ||
| .replace(_colonSlottedRe, _polyfillSlotted); | ||
| return selector; | ||
| }; | ||
| const convertColonRule = (cssText, regExp, partReplacer) => { | ||
| // m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule | ||
| return cssText.replace(regExp, (...m) => { | ||
| if (m[2]) { | ||
| const parts = m[2].split(','); | ||
| const r = []; | ||
| for (let i = 0; i < parts.length; i++) { | ||
| const p = parts[i].trim(); | ||
| if (!p) | ||
| break; | ||
| r.push(partReplacer(_polyfillHostNoCombinator, p, m[3])); | ||
| } | ||
| return r.join(','); | ||
| } | ||
| else { | ||
| return _polyfillHostNoCombinator + m[3]; | ||
| } | ||
| }); | ||
| }; | ||
| const colonHostPartReplacer = (host, part, suffix) => { | ||
| return host + part.replace(_polyfillHost, '') + suffix; | ||
| }; | ||
| const convertColonHost = (cssText) => { | ||
| return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer); | ||
| }; | ||
| const colonHostContextPartReplacer = (host, part, suffix) => { | ||
| if (part.indexOf(_polyfillHost) > -1) { | ||
| return colonHostPartReplacer(host, part, suffix); | ||
| } | ||
| else { | ||
| return host + part + suffix + ', ' + part + ' ' + host + suffix; | ||
| } | ||
| }; | ||
| const convertColonSlotted = (cssText, slotScopeId) => { | ||
| const slotClass = '.' + slotScopeId + ' > '; | ||
| const selectors = []; | ||
| cssText = cssText.replace(_cssColonSlottedRe, (...m) => { | ||
| if (m[2]) { | ||
| const compound = m[2].trim(); | ||
| const suffix = m[3]; | ||
| const slottedSelector = slotClass + compound + suffix; | ||
| let prefixSelector = ''; | ||
| for (let i = m[4] - 1; i >= 0; i--) { | ||
| const char = m[5][i]; | ||
| if (char === '}' || char === ',') { | ||
| break; | ||
| } | ||
| prefixSelector = char + prefixSelector; | ||
| } | ||
| const orgSelector = prefixSelector + slottedSelector; | ||
| const addedSelector = `${prefixSelector.trimRight()}${slottedSelector.trim()}`; | ||
| if (orgSelector.trim() !== addedSelector.trim()) { | ||
| const updatedSelector = `${addedSelector}, ${orgSelector}`; | ||
| selectors.push({ | ||
| orgSelector, | ||
| updatedSelector, | ||
| }); | ||
| } | ||
| return slottedSelector; | ||
| } | ||
| else { | ||
| return _polyfillHostNoCombinator + m[3]; | ||
| } | ||
| }); | ||
| return { | ||
| selectors, | ||
| cssText, | ||
| }; | ||
| }; | ||
| const convertColonHostContext = (cssText) => { | ||
| return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer); | ||
| }; | ||
| const convertShadowDOMSelectors = (cssText) => { | ||
| return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText); | ||
| }; | ||
| const makeScopeMatcher = (scopeSelector) => { | ||
| const lre = /\[/g; | ||
| const rre = /\]/g; | ||
| scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]'); | ||
| return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm'); | ||
| }; | ||
| const selectorNeedsScoping = (selector, scopeSelector) => { | ||
| const re = makeScopeMatcher(scopeSelector); | ||
| return !re.test(selector); | ||
| }; | ||
| const applySimpleSelectorScope = (selector, scopeSelector, hostSelector) => { | ||
| // In Android browser, the lastIndex is not reset when the regex is used in String.replace() | ||
| _polyfillHostRe.lastIndex = 0; | ||
| if (_polyfillHostRe.test(selector)) { | ||
| const replaceBy = `.${hostSelector}`; | ||
| return selector | ||
| .replace(_polyfillHostNoCombinatorRe, (_, selector) => { | ||
| return selector.replace(/([^:]*)(:*)(.*)/, (_, before, colon, after) => { | ||
| return before + replaceBy + colon + after; | ||
| }); | ||
| }) | ||
| .replace(_polyfillHostRe, replaceBy + ' '); | ||
| } | ||
| return scopeSelector + ' ' + selector; | ||
| }; | ||
| const applyStrictSelectorScope = (selector, scopeSelector, hostSelector) => { | ||
| const isRe = /\[is=([^\]]*)\]/g; | ||
| scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]); | ||
| const className = '.' + scopeSelector; | ||
| const _scopeSelectorPart = (p) => { | ||
| let scopedP = p.trim(); | ||
| if (!scopedP) { | ||
| return ''; | ||
| } | ||
| if (p.indexOf(_polyfillHostNoCombinator) > -1) { | ||
| scopedP = applySimpleSelectorScope(p, scopeSelector, hostSelector); | ||
| } | ||
| else { | ||
| // remove :host since it should be unnecessary | ||
| const t = p.replace(_polyfillHostRe, ''); | ||
| if (t.length > 0) { | ||
| const matches = t.match(/([^:]*)(:*)(.*)/); | ||
| if (matches) { | ||
| scopedP = matches[1] + className + matches[2] + matches[3]; | ||
| } | ||
| } | ||
| } | ||
| return scopedP; | ||
| }; | ||
| const safeContent = safeSelector(selector); | ||
| selector = safeContent.content; | ||
| let scopedSelector = ''; | ||
| let startIndex = 0; | ||
| let res; | ||
| const sep = /( |>|\+|~(?!=))\s*/g; | ||
| // If a selector appears before :host it should not be shimmed as it | ||
| // matches on ancestor elements and not on elements in the host's shadow | ||
| // `:host-context(div)` is transformed to | ||
| // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator` | ||
| // the `div` is not part of the component in the 2nd selectors and should not be scoped. | ||
| // Historically `component-tag:host` was matching the component so we also want to preserve | ||
| // this behavior to avoid breaking legacy apps (it should not match). | ||
| // The behavior should be: | ||
| // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything) | ||
| // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a | ||
| // `:host-context(tag)`) | ||
| const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1; | ||
| // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present | ||
| let shouldScope = !hasHost; | ||
| while ((res = sep.exec(selector)) !== null) { | ||
| const separator = res[1]; | ||
| const part = selector.slice(startIndex, res.index).trim(); | ||
| shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1; | ||
| const scopedPart = shouldScope ? _scopeSelectorPart(part) : part; | ||
| scopedSelector += `${scopedPart} ${separator} `; | ||
| startIndex = sep.lastIndex; | ||
| } | ||
| const part = selector.substring(startIndex); | ||
| shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1; | ||
| scopedSelector += shouldScope ? _scopeSelectorPart(part) : part; | ||
| // replace the placeholders with their original values | ||
| return restoreSafeSelector(safeContent.placeholders, scopedSelector); | ||
| }; | ||
| const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => { | ||
| return selector | ||
| .split(',') | ||
| .map(shallowPart => { | ||
| if (slotSelector && shallowPart.indexOf('.' + slotSelector) > -1) { | ||
| return shallowPart.trim(); | ||
| } | ||
| if (selectorNeedsScoping(shallowPart, scopeSelectorText)) { | ||
| return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim(); | ||
| } | ||
| else { | ||
| return shallowPart.trim(); | ||
| } | ||
| }) | ||
| .join(', '); | ||
| }; | ||
| const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => { | ||
| return processRules(cssText, (rule) => { | ||
| let selector = rule.selector; | ||
| let content = rule.content; | ||
| if (rule.selector[0] !== '@') { | ||
| selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector); | ||
| } | ||
| else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') || rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) { | ||
| content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector); | ||
| } | ||
| const cssRule = { | ||
| selector: selector.replace(/\s{2,}/g, ' ').trim(), | ||
| content, | ||
| }; | ||
| return cssRule; | ||
| }); | ||
| }; | ||
| const scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => { | ||
| cssText = insertPolyfillHostInCssText(cssText); | ||
| cssText = convertColonHost(cssText); | ||
| cssText = convertColonHostContext(cssText); | ||
| const slotted = convertColonSlotted(cssText, slotScopeId); | ||
| cssText = slotted.cssText; | ||
| cssText = convertShadowDOMSelectors(cssText); | ||
| if (scopeId) { | ||
| cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId); | ||
| } | ||
| cssText = cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`); | ||
| cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, ' $1 '); | ||
| return { | ||
| cssText: cssText.trim(), | ||
| slottedSelectors: slotted.selectors, | ||
| }; | ||
| }; | ||
| const scopeCss = (cssText, scopeId, commentOriginalSelector) => { | ||
| const hostScopeId = scopeId + '-h'; | ||
| const slotScopeId = scopeId + '-s'; | ||
| const commentsWithHash = extractCommentsWithHash(cssText); | ||
| cssText = stripComments(cssText); | ||
| const orgSelectors = []; | ||
| if (commentOriginalSelector) { | ||
| const processCommentedSelector = (rule) => { | ||
| const placeholder = `/*!@___${orgSelectors.length}___*/`; | ||
| const comment = `/*!@${rule.selector}*/`; | ||
| orgSelectors.push({ placeholder, comment }); | ||
| rule.selector = placeholder + rule.selector; | ||
| return rule; | ||
| }; | ||
| cssText = processRules(cssText, rule => { | ||
| if (rule.selector[0] !== '@') { | ||
| return processCommentedSelector(rule); | ||
| } | ||
| else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') || rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) { | ||
| rule.content = processRules(rule.content, processCommentedSelector); | ||
| return rule; | ||
| } | ||
| return rule; | ||
| }); | ||
| } | ||
| const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId); | ||
| cssText = [scoped.cssText, ...commentsWithHash].join('\n'); | ||
| if (commentOriginalSelector) { | ||
| orgSelectors.forEach(({ placeholder, comment }) => { | ||
| cssText = cssText.replace(placeholder, comment); | ||
| }); | ||
| } | ||
| scoped.slottedSelectors.forEach(slottedSelector => { | ||
| cssText = cssText.replace(slottedSelector.orgSelector, slottedSelector.updatedSelector); | ||
| }); | ||
| return cssText; | ||
| }; | ||
| exports.scopeCss = scopeCss; |
| /* | ||
| Stencil Client Patch v1.17.3 | MIT Licensed | https://stenciljs.com | ||
| */ | ||
| var StyleNode = function () { this.start = 0, this.end = 0, this.previous = null, this.parent = null, this.rules = null, this.parsedCssText = "", this.cssText = "", this.atRule = !1, this.type = 0, this.keyframesName = "", this.selector = "", this.parsedSelector = ""; }; | ||
| function parse(e) { return parseCss(lex(e = clean(e)), e); } | ||
| function clean(e) { return e.replace(RX.comments, "").replace(RX.port, ""); } | ||
| function lex(e) { var t = new StyleNode; t.start = 0, t.end = e.length; for (var r = t, n = 0, s = e.length; n < s; n++) | ||
| if (e[n] === OPEN_BRACE) { | ||
| r.rules || (r.rules = []); | ||
| var o = r, a = o.rules[o.rules.length - 1] || null; | ||
| (r = new StyleNode).start = n + 1, r.parent = o, r.previous = a, o.rules.push(r); | ||
| } | ||
| else | ||
| e[n] === CLOSE_BRACE && (r.end = n + 1, r = r.parent || t); return t; } | ||
| function parseCss(e, t) { var r = t.substring(e.start, e.end - 1); if (e.parsedCssText = e.cssText = r.trim(), e.parent) { | ||
| var n = e.previous ? e.previous.end : e.parent.start; | ||
| r = (r = (r = _expandUnicodeEscapes(r = t.substring(n, e.start - 1))).replace(RX.multipleSpaces, " ")).substring(r.lastIndexOf(";") + 1); | ||
| var s = e.parsedSelector = e.selector = r.trim(); | ||
| e.atRule = 0 === s.indexOf(AT_START), e.atRule ? 0 === s.indexOf(MEDIA_START) ? e.type = types.MEDIA_RULE : s.match(RX.keyframesRule) && (e.type = types.KEYFRAMES_RULE, e.keyframesName = e.selector.split(RX.multipleSpaces).pop()) : 0 === s.indexOf(VAR_START) ? e.type = types.MIXIN_RULE : e.type = types.STYLE_RULE; | ||
| } var o = e.rules; if (o) | ||
| for (var a = 0, i = o.length, l = void 0; a < i && (l = o[a]); a++) | ||
| parseCss(l, t); return e; } | ||
| function _expandUnicodeEscapes(e) { return e.replace(/\\([0-9a-f]{1,6})\s/gi, (function () { for (var e = arguments[1], t = 6 - e.length; t--;) | ||
| e = "0" + e; return "\\" + e; })); } | ||
| var types = { STYLE_RULE: 1, KEYFRAMES_RULE: 7, MEDIA_RULE: 4, MIXIN_RULE: 1e3 }, OPEN_BRACE = "{", CLOSE_BRACE = "}", RX = { comments: /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim, port: /@import[^;]*;/gim, customProp: /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim, mixinProp: /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim, mixinApply: /@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim, varApply: /[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim, keyframesRule: /^@[^\s]*keyframes/, multipleSpaces: /\s+/g }, VAR_START = "--", MEDIA_START = "@media", AT_START = "@"; | ||
| function findRegex(e, t, r) { e.lastIndex = 0; var n = t.substring(r).match(e); if (n) { | ||
| var s = r + n.index; | ||
| return { start: s, end: s + n[0].length }; | ||
| } return null; } | ||
| var VAR_USAGE_START = /\bvar\(/, VAR_ASSIGN_START = /\B--[\w-]+\s*:/, COMMENTS = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim, TRAILING_LINES = /^[\t ]+\n/gm; | ||
| function resolveVar(e, t, r) { return e[t] ? e[t] : r ? executeTemplate(r, e) : ""; } | ||
| function findVarEndIndex(e, t) { for (var r = 0, n = t; n < e.length; n++) { | ||
| var s = e[n]; | ||
| if ("(" === s) | ||
| r++; | ||
| else if (")" === s && --r <= 0) | ||
| return n + 1; | ||
| } return n; } | ||
| function parseVar(e, t) { var r = findRegex(VAR_USAGE_START, e, t); if (!r) | ||
| return null; var n = findVarEndIndex(e, r.start), s = e.substring(r.end, n - 1).split(","), o = s[0], a = s.slice(1); return { start: r.start, end: n, propName: o.trim(), fallback: a.length > 0 ? a.join(",").trim() : void 0 }; } | ||
| function compileVar(e, t, r) { var n = parseVar(e, r); if (!n) | ||
| return t.push(e.substring(r, e.length)), e.length; var s = n.propName, o = null != n.fallback ? compileTemplate(n.fallback) : void 0; return t.push(e.substring(r, n.start), (function (e) { return resolveVar(e, s, o); })), n.end; } | ||
| function executeTemplate(e, t) { for (var r = "", n = 0; n < e.length; n++) { | ||
| var s = e[n]; | ||
| r += "string" == typeof s ? s : s(t); | ||
| } return r; } | ||
| function findEndValue(e, t) { for (var r = !1, n = !1, s = t; s < e.length; s++) { | ||
| var o = e[s]; | ||
| if (r) | ||
| n && '"' === o && (r = !1), n || "'" !== o || (r = !1); | ||
| else if ('"' === o) | ||
| r = !0, n = !0; | ||
| else if ("'" === o) | ||
| r = !0, n = !1; | ||
| else { | ||
| if (";" === o) | ||
| return s + 1; | ||
| if ("}" === o) | ||
| return s; | ||
| } | ||
| } return s; } | ||
| function removeCustomAssigns(e) { for (var t = "", r = 0;;) { | ||
| var n = findRegex(VAR_ASSIGN_START, e, r), s = n ? n.start : e.length; | ||
| if (t += e.substring(r, s), !n) | ||
| break; | ||
| r = findEndValue(e, s); | ||
| } return t; } | ||
| function compileTemplate(e) { var t = 0; e = removeCustomAssigns(e = e.replace(COMMENTS, "")).replace(TRAILING_LINES, ""); for (var r = []; t < e.length;) | ||
| t = compileVar(e, r, t); return r; } | ||
| function resolveValues(e) { var t = {}; e.forEach((function (e) { e.declarations.forEach((function (e) { t[e.prop] = e.value; })); })); for (var r = {}, n = Object.entries(t), s = function (e) { var t = !1; if (n.forEach((function (e) { var n = e[0], s = executeTemplate(e[1], r); s !== r[n] && (r[n] = s, t = !0); })), !t) | ||
| return "break"; }, o = 0; o < 10; o++) { | ||
| if ("break" === s()) | ||
| break; | ||
| } return r; } | ||
| function getSelectors(e, t) { if (void 0 === t && (t = 0), !e.rules) | ||
| return []; var r = []; return e.rules.filter((function (e) { return e.type === types.STYLE_RULE; })).forEach((function (e) { var n = getDeclarations(e.cssText); n.length > 0 && e.parsedSelector.split(",").forEach((function (e) { e = e.trim(), r.push({ selector: e, declarations: n, specificity: computeSpecificity(), nu: t }); })), t++; })), r; } | ||
| function computeSpecificity(e) { return 1; } | ||
| var IMPORTANT = "!important", FIND_DECLARATIONS = /(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm; | ||
| function getDeclarations(e) { for (var t, r = []; t = FIND_DECLARATIONS.exec(e.trim());) { | ||
| var n = normalizeValue(t[2]), s = n.value, o = n.important; | ||
| r.push({ prop: t[1].trim(), value: compileTemplate(s), important: o }); | ||
| } return r; } | ||
| function normalizeValue(e) { var t = (e = e.replace(/\s+/gim, " ").trim()).endsWith(IMPORTANT); return t && (e = e.substr(0, e.length - IMPORTANT.length).trim()), { value: e, important: t }; } | ||
| function getActiveSelectors(e, t, r) { var n = [], s = getScopesForElement(t, e); return r.forEach((function (e) { return n.push(e); })), s.forEach((function (e) { return n.push(e); })), sortSelectors(getSelectorsForScopes(n).filter((function (t) { return matches(e, t.selector); }))); } | ||
| function getScopesForElement(e, t) { for (var r = []; t;) { | ||
| var n = e.get(t); | ||
| n && r.push(n), t = t.parentElement; | ||
| } return r; } | ||
| function getSelectorsForScopes(e) { var t = []; return e.forEach((function (e) { t.push.apply(t, e.selectors); })), t; } | ||
| function sortSelectors(e) { return e.sort((function (e, t) { return e.specificity === t.specificity ? e.nu - t.nu : e.specificity - t.specificity; })), e; } | ||
| function matches(e, t) { return ":root" === t || "html" === t || e.matches(t); } | ||
| function parseCSS(e) { var t = parse(e), r = compileTemplate(e); return { original: e, template: r, selectors: getSelectors(t), usesCssVars: r.length > 1 }; } | ||
| function addGlobalStyle(e, t) { if (e.some((function (e) { return e.styleEl === t; }))) | ||
| return !1; var r = parseCSS(t.textContent); return r.styleEl = t, e.push(r), !0; } | ||
| function updateGlobalScopes(e) { var t = resolveValues(getSelectorsForScopes(e)); e.forEach((function (e) { e.usesCssVars && (e.styleEl.textContent = executeTemplate(e.template, t)); })); } | ||
| function reScope(e, t) { var r = e.template.map((function (r) { return "string" == typeof r ? replaceScope(r, e.scopeId, t) : r; })), n = e.selectors.map((function (r) { return Object.assign(Object.assign({}, r), { selector: replaceScope(r.selector, e.scopeId, t) }); })); return Object.assign(Object.assign({}, e), { template: r, selectors: n, scopeId: t }); } | ||
| function replaceScope(e, t, r) { return e = replaceAll(e, "\\." + t, "." + r); } | ||
| function replaceAll(e, t, r) { return e.replace(new RegExp(t, "g"), r); } | ||
| function loadDocument(e, t) { return loadDocumentStyles(e, t), loadDocumentLinks(e, t).then((function () { updateGlobalScopes(t); })); } | ||
| function startWatcher(e, t) { "undefined" != typeof MutationObserver && new MutationObserver((function () { loadDocumentStyles(e, t) && updateGlobalScopes(t); })).observe(document.head, { childList: !0 }); } | ||
| function loadDocumentLinks(e, t) { for (var r = [], n = e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'), s = 0; s < n.length; s++) | ||
| r.push(addGlobalLink(e, t, n[s])); return Promise.all(r); } | ||
| function loadDocumentStyles(e, t) { return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function (e) { return addGlobalStyle(t, e); })).some(Boolean); } | ||
| function addGlobalLink(e, t, r) { var n = r.href; return fetch(n).then((function (e) { return e.text(); })).then((function (s) { if (hasCssVariables(s) && r.parentNode) { | ||
| hasRelativeUrls(s) && (s = fixRelativeUrls(s, n)); | ||
| var o = e.createElement("style"); | ||
| o.setAttribute("data-styles", ""), o.textContent = s, addGlobalStyle(t, o), r.parentNode.insertBefore(o, r), r.remove(); | ||
| } })).catch((function (e) { console.error(e); })); } | ||
| var CSS_VARIABLE_REGEXP = /[\s;{]--[-a-zA-Z0-9]+\s*:/m; | ||
| function hasCssVariables(e) { return e.indexOf("var(") > -1 || CSS_VARIABLE_REGEXP.test(e); } | ||
| var CSS_URL_REGEXP = /url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim; | ||
| function hasRelativeUrls(e) { return CSS_URL_REGEXP.lastIndex = 0, CSS_URL_REGEXP.test(e); } | ||
| function fixRelativeUrls(e, t) { var r = t.replace(/[^/]*$/, ""); return e.replace(CSS_URL_REGEXP, (function (e, t) { var n = r + t; return e.replace(t, n); })); } | ||
| var CustomStyle = function () { function e(e, t) { this.win = e, this.doc = t, this.count = 0, this.hostStyleMap = new WeakMap, this.hostScopeMap = new WeakMap, this.globalScopes = [], this.scopesMap = new Map, this.didInit = !1; } return e.prototype.i = function () { var e = this; return this.didInit || !this.win.requestAnimationFrame ? Promise.resolve() : (this.didInit = !0, new Promise((function (t) { e.win.requestAnimationFrame((function () { startWatcher(e.doc, e.globalScopes), loadDocument(e.doc, e.globalScopes).then((function () { return t(); })); })); }))); }, e.prototype.addLink = function (e) { var t = this; return addGlobalLink(this.doc, this.globalScopes, e).then((function () { t.updateGlobal(); })); }, e.prototype.addGlobalStyle = function (e) { addGlobalStyle(this.globalScopes, e) && this.updateGlobal(); }, e.prototype.createHostStyle = function (e, t, r, n) { if (this.hostScopeMap.has(e)) | ||
| throw new Error("host style already created"); var s = this.registerHostTemplate(r, t, n), o = this.doc.createElement("style"); return o.setAttribute("data-no-shim", ""), s.usesCssVars ? n ? (o["s-sc"] = t = s.scopeId + "-" + this.count, o.textContent = "/*needs update*/", this.hostStyleMap.set(e, o), this.hostScopeMap.set(e, reScope(s, t)), this.count++) : (s.styleEl = o, s.usesCssVars || (o.textContent = executeTemplate(s.template, {})), this.globalScopes.push(s), this.updateGlobal(), this.hostScopeMap.set(e, s)) : o.textContent = r, o; }, e.prototype.removeHost = function (e) { var t = this.hostStyleMap.get(e); t && t.remove(), this.hostStyleMap.delete(e), this.hostScopeMap.delete(e); }, e.prototype.updateHost = function (e) { var t = this.hostScopeMap.get(e); if (t && t.usesCssVars && t.isScoped) { | ||
| var r = this.hostStyleMap.get(e); | ||
| if (r) { | ||
| var n = resolveValues(getActiveSelectors(e, this.hostScopeMap, this.globalScopes)); | ||
| r.textContent = executeTemplate(t.template, n); | ||
| } | ||
| } }, e.prototype.updateGlobal = function () { updateGlobalScopes(this.globalScopes); }, e.prototype.registerHostTemplate = function (e, t, r) { var n = this.scopesMap.get(t); return n || ((n = parseCSS(e)).scopeId = t, n.isScoped = r, this.scopesMap.set(t, n)), n; }, e; }(); | ||
| !function (e) { !e || e.__cssshim || e.CSS && e.CSS.supports && e.CSS.supports("color", "var(--c)") || (e.__cssshim = new CustomStyle(e, e.document)); }("undefined" != typeof window && window); |
| /* | ||
| Stencil Client Patch v1.17.3 | MIT Licensed | https://stenciljs.com | ||
| */ | ||
| (function () { | ||
| var aa = new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ")); | ||
| function g(a) { var b = aa.has(a); a = /^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(a); return !b && a; } | ||
| function l(a) { var b = a.isConnected; if (void 0 !== b) | ||
| return b; for (; a && !(a.__CE_isImportDocument || a instanceof Document);) | ||
| a = a.parentNode || (window.ShadowRoot && a instanceof ShadowRoot ? a.host : void 0); return !(!a || !(a.__CE_isImportDocument || a instanceof Document)); } | ||
| function n(a, b) { for (; b && b !== a && !b.nextSibling;) | ||
| b = b.parentNode; return b && b !== a ? b.nextSibling : null; } | ||
| function p(a, b, d) { d = void 0 === d ? new Set : d; for (var c = a; c;) { | ||
| if (c.nodeType === Node.ELEMENT_NODE) { | ||
| var e = c; | ||
| b(e); | ||
| var f = e.localName; | ||
| if ("link" === f && "import" === e.getAttribute("rel")) { | ||
| c = e.import; | ||
| if (c instanceof Node && !d.has(c)) | ||
| for (d.add(c), c = c.firstChild; c; c = c.nextSibling) | ||
| p(c, b, d); | ||
| c = n(a, e); | ||
| continue; | ||
| } | ||
| else if ("template" === f) { | ||
| c = n(a, e); | ||
| continue; | ||
| } | ||
| if (e = e.__CE_shadowRoot) | ||
| for (e = e.firstChild; e; e = e.nextSibling) | ||
| p(e, b, d); | ||
| } | ||
| c = c.firstChild ? c.firstChild : n(a, c); | ||
| } } | ||
| function r(a, b, d) { a[b] = d; } | ||
| function u() { this.a = new Map; this.g = new Map; this.c = []; this.f = []; this.b = !1; } | ||
| function ba(a, b, d) { a.a.set(b, d); a.g.set(d.constructorFunction, d); } | ||
| function ca(a, b) { a.b = !0; a.c.push(b); } | ||
| function da(a, b) { a.b = !0; a.f.push(b); } | ||
| function v(a, b) { a.b && p(b, function (b) { return w(a, b); }); } | ||
| function w(a, b) { if (a.b && !b.__CE_patched) { | ||
| b.__CE_patched = !0; | ||
| for (var d = 0; d < a.c.length; d++) | ||
| a.c[d](b); | ||
| for (d = 0; d < a.f.length; d++) | ||
| a.f[d](b); | ||
| } } | ||
| function x(a, b) { var d = []; p(b, function (b) { return d.push(b); }); for (b = 0; b < d.length; b++) { | ||
| var c = d[b]; | ||
| 1 === c.__CE_state ? a.connectedCallback(c) : y(a, c); | ||
| } } | ||
| function z(a, b) { var d = []; p(b, function (b) { return d.push(b); }); for (b = 0; b < d.length; b++) { | ||
| var c = d[b]; | ||
| 1 === c.__CE_state && a.disconnectedCallback(c); | ||
| } } | ||
| function A(a, b, d) { | ||
| d = void 0 === d ? {} : d; | ||
| var c = d.u || new Set, e = d.i || function (b) { return y(a, b); }, f = []; | ||
| p(b, function (b) { if ("link" === b.localName && "import" === b.getAttribute("rel")) { | ||
| var d = b.import; | ||
| d instanceof Node && (d.__CE_isImportDocument = !0, d.__CE_hasRegistry = !0); | ||
| d && "complete" === d.readyState ? d.__CE_documentLoadHandled = !0 : b.addEventListener("load", function () { var d = b.import; if (!d.__CE_documentLoadHandled) { | ||
| d.__CE_documentLoadHandled = !0; | ||
| var f = new Set(c); | ||
| f.delete(d); | ||
| A(a, d, { u: f, i: e }); | ||
| } }); | ||
| } | ||
| else | ||
| f.push(b); }, c); | ||
| if (a.b) | ||
| for (b = | ||
| 0; b < f.length; b++) | ||
| w(a, f[b]); | ||
| for (b = 0; b < f.length; b++) | ||
| e(f[b]); | ||
| } | ||
| function y(a, b) { | ||
| if (void 0 === b.__CE_state) { | ||
| var d = b.ownerDocument; | ||
| if (d.defaultView || d.__CE_isImportDocument && d.__CE_hasRegistry) | ||
| if (d = a.a.get(b.localName)) { | ||
| d.constructionStack.push(b); | ||
| var c = d.constructorFunction; | ||
| try { | ||
| try { | ||
| if (new c !== b) | ||
| throw Error("The custom element constructor did not produce the element being upgraded."); | ||
| } | ||
| finally { | ||
| d.constructionStack.pop(); | ||
| } | ||
| } | ||
| catch (t) { | ||
| throw b.__CE_state = 2, t; | ||
| } | ||
| b.__CE_state = 1; | ||
| b.__CE_definition = d; | ||
| if (d.attributeChangedCallback) | ||
| for (d = d.observedAttributes, c = 0; c < d.length; c++) { | ||
| var e = d[c], f = b.getAttribute(e); | ||
| null !== f && a.attributeChangedCallback(b, e, null, f, null); | ||
| } | ||
| l(b) && a.connectedCallback(b); | ||
| } | ||
| } | ||
| } | ||
| u.prototype.connectedCallback = function (a) { var b = a.__CE_definition; b.connectedCallback && b.connectedCallback.call(a); }; | ||
| u.prototype.disconnectedCallback = function (a) { var b = a.__CE_definition; b.disconnectedCallback && b.disconnectedCallback.call(a); }; | ||
| u.prototype.attributeChangedCallback = function (a, b, d, c, e) { var f = a.__CE_definition; f.attributeChangedCallback && -1 < f.observedAttributes.indexOf(b) && f.attributeChangedCallback.call(a, b, d, c, e); }; | ||
| function B(a) { var b = document; this.c = a; this.a = b; this.b = void 0; A(this.c, this.a); "loading" === this.a.readyState && (this.b = new MutationObserver(this.f.bind(this)), this.b.observe(this.a, { childList: !0, subtree: !0 })); } | ||
| function C(a) { a.b && a.b.disconnect(); } | ||
| B.prototype.f = function (a) { var b = this.a.readyState; "interactive" !== b && "complete" !== b || C(this); for (b = 0; b < a.length; b++) | ||
| for (var d = a[b].addedNodes, c = 0; c < d.length; c++) | ||
| A(this.c, d[c]); }; | ||
| function ea() { var a = this; this.b = this.a = void 0; this.c = new Promise(function (b) { a.b = b; a.a && b(a.a); }); } | ||
| function D(a) { if (a.a) | ||
| throw Error("Already resolved."); a.a = void 0; a.b && a.b(void 0); } | ||
| function E(a) { this.c = !1; this.a = a; this.j = new Map; this.f = function (b) { return b(); }; this.b = !1; this.g = []; this.o = new B(a); } | ||
| E.prototype.l = function (a, b) { | ||
| var d = this; | ||
| if (!(b instanceof Function)) | ||
| throw new TypeError("Custom element constructors must be functions."); | ||
| if (!g(a)) | ||
| throw new SyntaxError("The element name '" + a + "' is not valid."); | ||
| if (this.a.a.get(a)) | ||
| throw Error("A custom element with name '" + a + "' has already been defined."); | ||
| if (this.c) | ||
| throw Error("A custom element is already being defined."); | ||
| this.c = !0; | ||
| try { | ||
| var c = function (b) { | ||
| var a = e[b]; | ||
| if (void 0 !== a && !(a instanceof Function)) | ||
| throw Error("The '" + b + "' callback must be a function."); | ||
| return a; | ||
| }, e = b.prototype; | ||
| if (!(e instanceof Object)) | ||
| throw new TypeError("The custom element constructor's prototype is not an object."); | ||
| var f = c("connectedCallback"); | ||
| var t = c("disconnectedCallback"); | ||
| var k = c("adoptedCallback"); | ||
| var h = c("attributeChangedCallback"); | ||
| var m = b.observedAttributes || []; | ||
| } | ||
| catch (q) { | ||
| return; | ||
| } | ||
| finally { | ||
| this.c = !1; | ||
| } | ||
| b = { localName: a, constructorFunction: b, connectedCallback: f, disconnectedCallback: t, adoptedCallback: k, attributeChangedCallback: h, observedAttributes: m, constructionStack: [] }; | ||
| ba(this.a, a, b); | ||
| this.g.push(b); | ||
| this.b || (this.b = !0, this.f(function () { return fa(d); })); | ||
| }; | ||
| E.prototype.i = function (a) { A(this.a, a); }; | ||
| function fa(a) { if (!1 !== a.b) { | ||
| a.b = !1; | ||
| for (var b = a.g, d = [], c = new Map, e = 0; e < b.length; e++) | ||
| c.set(b[e].localName, []); | ||
| A(a.a, document, { i: function (b) { if (void 0 === b.__CE_state) { | ||
| var e = b.localName, f = c.get(e); | ||
| f ? f.push(b) : a.a.a.get(e) && d.push(b); | ||
| } } }); | ||
| for (e = 0; e < d.length; e++) | ||
| y(a.a, d[e]); | ||
| for (; 0 < b.length;) { | ||
| var f = b.shift(); | ||
| e = f.localName; | ||
| f = c.get(f.localName); | ||
| for (var t = 0; t < f.length; t++) | ||
| y(a.a, f[t]); | ||
| (e = a.j.get(e)) && D(e); | ||
| } | ||
| } } | ||
| E.prototype.get = function (a) { if (a = this.a.a.get(a)) | ||
| return a.constructorFunction; }; | ||
| E.prototype.m = function (a) { if (!g(a)) | ||
| return Promise.reject(new SyntaxError("'" + a + "' is not a valid custom element name.")); var b = this.j.get(a); if (b) | ||
| return b.c; b = new ea; this.j.set(a, b); this.a.a.get(a) && !this.g.some(function (b) { return b.localName === a; }) && D(b); return b.c; }; | ||
| E.prototype.s = function (a) { C(this.o); var b = this.f; this.f = function (d) { return a(function () { return b(d); }); }; }; | ||
| window.CustomElementRegistry = E; | ||
| E.prototype.define = E.prototype.l; | ||
| E.prototype.upgrade = E.prototype.i; | ||
| E.prototype.get = E.prototype.get; | ||
| E.prototype.whenDefined = E.prototype.m; | ||
| E.prototype.polyfillWrapFlushCallback = E.prototype.s; | ||
| var F = window.Document.prototype.createElement, G = window.Document.prototype.createElementNS, ha = window.Document.prototype.importNode, ia = window.Document.prototype.prepend, ja = window.Document.prototype.append, ka = window.DocumentFragment.prototype.prepend, la = window.DocumentFragment.prototype.append, H = window.Node.prototype.cloneNode, I = window.Node.prototype.appendChild, J = window.Node.prototype.insertBefore, K = window.Node.prototype.removeChild, L = window.Node.prototype.replaceChild, M = Object.getOwnPropertyDescriptor(window.Node.prototype, "textContent"), N = window.Element.prototype.attachShadow, O = Object.getOwnPropertyDescriptor(window.Element.prototype, "innerHTML"), P = window.Element.prototype.getAttribute, Q = window.Element.prototype.setAttribute, R = window.Element.prototype.removeAttribute, S = window.Element.prototype.getAttributeNS, T = window.Element.prototype.setAttributeNS, U = window.Element.prototype.removeAttributeNS, ma = window.Element.prototype.insertAdjacentElement, na = window.Element.prototype.insertAdjacentHTML, oa = window.Element.prototype.prepend, pa = window.Element.prototype.append, V = window.Element.prototype.before, qa = window.Element.prototype.after, ra = window.Element.prototype.replaceWith, sa = window.Element.prototype.remove, ta = window.HTMLElement, W = Object.getOwnPropertyDescriptor(window.HTMLElement.prototype, "innerHTML"), ua = window.HTMLElement.prototype.insertAdjacentElement, va = window.HTMLElement.prototype.insertAdjacentHTML; | ||
| var wa = new function () { }; | ||
| function xa() { | ||
| var a = X; | ||
| window.HTMLElement = function () { | ||
| function b() { | ||
| var b = this.constructor, c = a.g.get(b); | ||
| if (!c) | ||
| throw Error("The custom element being constructed was not registered with `customElements`."); | ||
| var e = c.constructionStack; | ||
| if (0 === e.length) | ||
| return e = F.call(document, c.localName), Object.setPrototypeOf(e, b.prototype), e.__CE_state = 1, e.__CE_definition = c, w(a, e), e; | ||
| c = e.length - 1; | ||
| var f = e[c]; | ||
| if (f === wa) | ||
| throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times."); | ||
| e[c] = wa; | ||
| Object.setPrototypeOf(f, b.prototype); | ||
| w(a, f); | ||
| return f; | ||
| } | ||
| b.prototype = ta.prototype; | ||
| Object.defineProperty(b.prototype, "constructor", { writable: !0, configurable: !0, enumerable: !1, value: b }); | ||
| return b; | ||
| }(); | ||
| } | ||
| function Y(a, b, d) { function c(b) { return function (d) { for (var e = [], c = 0; c < arguments.length; ++c) | ||
| e[c] = arguments[c]; c = []; for (var f = [], m = 0; m < e.length; m++) { | ||
| var q = e[m]; | ||
| q instanceof Element && l(q) && f.push(q); | ||
| if (q instanceof DocumentFragment) | ||
| for (q = q.firstChild; q; q = q.nextSibling) | ||
| c.push(q); | ||
| else | ||
| c.push(q); | ||
| } b.apply(this, e); for (e = 0; e < f.length; e++) | ||
| z(a, f[e]); if (l(this)) | ||
| for (e = 0; e < c.length; e++) | ||
| f = c[e], f instanceof Element && x(a, f); }; } void 0 !== d.h && (b.prepend = c(d.h)); void 0 !== d.append && (b.append = c(d.append)); } | ||
| function ya() { | ||
| var a = X; | ||
| r(Document.prototype, "createElement", function (b) { if (this.__CE_hasRegistry) { | ||
| var d = a.a.get(b); | ||
| if (d) | ||
| return new d.constructorFunction; | ||
| } b = F.call(this, b); w(a, b); return b; }); | ||
| r(Document.prototype, "importNode", function (b, d) { b = ha.call(this, b, !!d); this.__CE_hasRegistry ? A(a, b) : v(a, b); return b; }); | ||
| r(Document.prototype, "createElementNS", function (b, d) { | ||
| if (this.__CE_hasRegistry && (null === b || "http://www.w3.org/1999/xhtml" === b)) { | ||
| var c = a.a.get(d); | ||
| if (c) | ||
| return new c.constructorFunction; | ||
| } | ||
| b = G.call(this, b, d); | ||
| w(a, b); | ||
| return b; | ||
| }); | ||
| Y(a, Document.prototype, { h: ia, append: ja }); | ||
| } | ||
| function za() { | ||
| function a(a, c) { Object.defineProperty(a, "textContent", { enumerable: c.enumerable, configurable: !0, get: c.get, set: function (a) { if (this.nodeType === Node.TEXT_NODE) | ||
| c.set.call(this, a); | ||
| else { | ||
| var d = void 0; | ||
| if (this.firstChild) { | ||
| var e = this.childNodes, k = e.length; | ||
| if (0 < k && l(this)) { | ||
| d = Array(k); | ||
| for (var h = 0; h < k; h++) | ||
| d[h] = e[h]; | ||
| } | ||
| } | ||
| c.set.call(this, a); | ||
| if (d) | ||
| for (a = 0; a < d.length; a++) | ||
| z(b, d[a]); | ||
| } } }); } | ||
| var b = X; | ||
| r(Node.prototype, "insertBefore", function (a, c) { | ||
| if (a instanceof DocumentFragment) { | ||
| var e = Array.prototype.slice.apply(a.childNodes); | ||
| a = J.call(this, a, c); | ||
| if (l(this)) | ||
| for (c = 0; c < e.length; c++) | ||
| x(b, e[c]); | ||
| return a; | ||
| } | ||
| e = l(a); | ||
| c = J.call(this, a, c); | ||
| e && z(b, a); | ||
| l(this) && x(b, a); | ||
| return c; | ||
| }); | ||
| r(Node.prototype, "appendChild", function (a) { if (a instanceof DocumentFragment) { | ||
| var c = Array.prototype.slice.apply(a.childNodes); | ||
| a = I.call(this, a); | ||
| if (l(this)) | ||
| for (var e = 0; e < c.length; e++) | ||
| x(b, c[e]); | ||
| return a; | ||
| } c = l(a); e = I.call(this, a); c && z(b, a); l(this) && x(b, a); return e; }); | ||
| r(Node.prototype, "cloneNode", function (a) { | ||
| a = H.call(this, !!a); | ||
| this.ownerDocument.__CE_hasRegistry ? A(b, a) : v(b, a); | ||
| return a; | ||
| }); | ||
| r(Node.prototype, "removeChild", function (a) { var c = l(a), e = K.call(this, a); c && z(b, a); return e; }); | ||
| r(Node.prototype, "replaceChild", function (a, c) { if (a instanceof DocumentFragment) { | ||
| var e = Array.prototype.slice.apply(a.childNodes); | ||
| a = L.call(this, a, c); | ||
| if (l(this)) | ||
| for (z(b, c), c = 0; c < e.length; c++) | ||
| x(b, e[c]); | ||
| return a; | ||
| } e = l(a); var f = L.call(this, a, c), d = l(this); d && z(b, c); e && z(b, a); d && x(b, a); return f; }); | ||
| M && M.get ? a(Node.prototype, M) : ca(b, function (b) { | ||
| a(b, { enumerable: !0, configurable: !0, get: function () { | ||
| for (var a = [], b = 0; b < this.childNodes.length; b++) { | ||
| var f = this.childNodes[b]; | ||
| f.nodeType !== Node.COMMENT_NODE && a.push(f.textContent); | ||
| } | ||
| return a.join(""); | ||
| }, set: function (a) { for (; this.firstChild;) | ||
| K.call(this, this.firstChild); null != a && "" !== a && I.call(this, document.createTextNode(a)); } }); | ||
| }); | ||
| } | ||
| function Aa(a) { | ||
| function b(b) { return function (e) { for (var c = [], d = 0; d < arguments.length; ++d) | ||
| c[d] = arguments[d]; d = []; for (var k = [], h = 0; h < c.length; h++) { | ||
| var m = c[h]; | ||
| m instanceof Element && l(m) && k.push(m); | ||
| if (m instanceof DocumentFragment) | ||
| for (m = m.firstChild; m; m = m.nextSibling) | ||
| d.push(m); | ||
| else | ||
| d.push(m); | ||
| } b.apply(this, c); for (c = 0; c < k.length; c++) | ||
| z(a, k[c]); if (l(this)) | ||
| for (c = 0; c < d.length; c++) | ||
| k = d[c], k instanceof Element && x(a, k); }; } | ||
| var d = Element.prototype; | ||
| void 0 !== V && (d.before = b(V)); | ||
| void 0 !== V && (d.after = b(qa)); | ||
| void 0 !== ra && | ||
| r(d, "replaceWith", function (b) { for (var e = [], c = 0; c < arguments.length; ++c) | ||
| e[c] = arguments[c]; c = []; for (var d = [], k = 0; k < e.length; k++) { | ||
| var h = e[k]; | ||
| h instanceof Element && l(h) && d.push(h); | ||
| if (h instanceof DocumentFragment) | ||
| for (h = h.firstChild; h; h = h.nextSibling) | ||
| c.push(h); | ||
| else | ||
| c.push(h); | ||
| } k = l(this); ra.apply(this, e); for (e = 0; e < d.length; e++) | ||
| z(a, d[e]); if (k) | ||
| for (z(a, this), e = 0; e < c.length; e++) | ||
| d = c[e], d instanceof Element && x(a, d); }); | ||
| void 0 !== sa && r(d, "remove", function () { var b = l(this); sa.call(this); b && z(a, this); }); | ||
| } | ||
| function Ba() { | ||
| function a(a, b) { Object.defineProperty(a, "innerHTML", { enumerable: b.enumerable, configurable: !0, get: b.get, set: function (a) { var e = this, d = void 0; l(this) && (d = [], p(this, function (a) { a !== e && d.push(a); })); b.set.call(this, a); if (d) | ||
| for (var f = 0; f < d.length; f++) { | ||
| var t = d[f]; | ||
| 1 === t.__CE_state && c.disconnectedCallback(t); | ||
| } this.ownerDocument.__CE_hasRegistry ? A(c, this) : v(c, this); return a; } }); } | ||
| function b(a, b) { r(a, "insertAdjacentElement", function (a, e) { var d = l(e); a = b.call(this, a, e); d && z(c, e); l(a) && x(c, e); return a; }); } | ||
| function d(a, b) { | ||
| function e(a, b) { for (var e = []; a !== b; a = a.nextSibling) | ||
| e.push(a); for (b = 0; b < e.length; b++) | ||
| A(c, e[b]); } | ||
| r(a, "insertAdjacentHTML", function (a, c) { | ||
| a = a.toLowerCase(); | ||
| if ("beforebegin" === a) { | ||
| var d = this.previousSibling; | ||
| b.call(this, a, c); | ||
| e(d || this.parentNode.firstChild, this); | ||
| } | ||
| else if ("afterbegin" === a) | ||
| d = this.firstChild, b.call(this, a, c), e(this.firstChild, d); | ||
| else if ("beforeend" === a) | ||
| d = this.lastChild, b.call(this, a, c), e(d || this.firstChild, null); | ||
| else if ("afterend" === a) | ||
| d = this.nextSibling, b.call(this, a, c), e(this.nextSibling, d); | ||
| else | ||
| throw new SyntaxError("The value provided (" + String(a) + ") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'."); | ||
| }); | ||
| } | ||
| var c = X; | ||
| N && r(Element.prototype, "attachShadow", function (a) { a = N.call(this, a); var b = c; if (b.b && !a.__CE_patched) { | ||
| a.__CE_patched = !0; | ||
| for (var e = 0; e < b.c.length; e++) | ||
| b.c[e](a); | ||
| } return this.__CE_shadowRoot = a; }); | ||
| O && O.get ? a(Element.prototype, O) : W && W.get ? a(HTMLElement.prototype, W) : da(c, function (b) { | ||
| a(b, { enumerable: !0, configurable: !0, get: function () { return H.call(this, !0).innerHTML; }, set: function (a) { var b = "template" === this.localName, c = b ? this.content : this, e = G.call(document, this.namespaceURI, this.localName); for (e.innerHTML = a; 0 < c.childNodes.length;) | ||
| K.call(c, c.childNodes[0]); for (a = b ? e.content : e; 0 < a.childNodes.length;) | ||
| I.call(c, a.childNodes[0]); } }); | ||
| }); | ||
| r(Element.prototype, "setAttribute", function (a, b) { if (1 !== this.__CE_state) | ||
| return Q.call(this, a, b); var e = P.call(this, a); Q.call(this, a, b); b = P.call(this, a); c.attributeChangedCallback(this, a, e, b, null); }); | ||
| r(Element.prototype, "setAttributeNS", function (a, b, d) { if (1 !== this.__CE_state) | ||
| return T.call(this, a, b, d); var e = S.call(this, a, b); T.call(this, a, b, d); d = S.call(this, a, b); c.attributeChangedCallback(this, b, e, d, a); }); | ||
| r(Element.prototype, "removeAttribute", function (a) { if (1 !== this.__CE_state) | ||
| return R.call(this, a); var b = P.call(this, a); R.call(this, a); null !== b && c.attributeChangedCallback(this, a, b, null, null); }); | ||
| r(Element.prototype, "removeAttributeNS", function (a, b) { | ||
| if (1 !== this.__CE_state) | ||
| return U.call(this, a, b); | ||
| var d = S.call(this, a, b); | ||
| U.call(this, a, b); | ||
| var e = S.call(this, a, b); | ||
| d !== e && c.attributeChangedCallback(this, b, d, e, a); | ||
| }); | ||
| ua ? b(HTMLElement.prototype, ua) : ma ? b(Element.prototype, ma) : console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched."); | ||
| va ? d(HTMLElement.prototype, va) : na ? d(Element.prototype, na) : console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched."); | ||
| Y(c, Element.prototype, { h: oa, append: pa }); | ||
| Aa(c); | ||
| } | ||
| var Z = window.customElements; | ||
| if (!Z || Z.forcePolyfill || "function" != typeof Z.define || "function" != typeof Z.get) { | ||
| var X = new u; | ||
| xa(); | ||
| ya(); | ||
| Y(X, DocumentFragment.prototype, { h: ka, append: la }); | ||
| za(); | ||
| Ba(); | ||
| document.__CE_hasRegistry = !0; | ||
| var customElements = new E(X); | ||
| Object.defineProperty(window, "customElements", { configurable: !0, enumerable: !0, value: customElements }); | ||
| } | ||
| }).call(self); | ||
| // Polyfill document.baseURI | ||
| "string" !== typeof document.baseURI && Object.defineProperty(Document.prototype, "baseURI", { enumerable: !0, configurable: !0, get: function () { var a = document.querySelector("base"); return a && a.href ? a.href : document.URL; } }); | ||
| // Polyfill CustomEvent | ||
| "function" !== typeof window.CustomEvent && (window.CustomEvent = function (c, a) { a = a || { bubbles: !1, cancelable: !1, detail: void 0 }; var b = document.createEvent("CustomEvent"); b.initCustomEvent(c, a.bubbles, a.cancelable, a.detail); return b; }, window.CustomEvent.prototype = window.Event.prototype); | ||
| // Event.composedPath | ||
| (function (b, c, d) { b.composedPath || (b.composedPath = function () { if (this.path) | ||
| return this.path; var a = this.target; for (this.path = []; null !== a.parentNode;) | ||
| this.path.push(a), a = a.parentNode; this.path.push(c, d); return this.path; }); })(Event.prototype, document, window); | ||
| /*! | ||
| Element.closest and Element.matches | ||
| https://github.com/jonathantneal/closest | ||
| Creative Commons Zero v1.0 Universal | ||
| */ | ||
| (function (a) { "function" !== typeof a.matches && (a.matches = a.msMatchesSelector || a.mozMatchesSelector || a.webkitMatchesSelector || function (a) { a = (this.document || this.ownerDocument).querySelectorAll(a); for (var b = 0; a[b] && a[b] !== this;) | ||
| ++b; return !!a[b]; }); "function" !== typeof a.closest && (a.closest = function (a) { for (var b = this; b && 1 === b.nodeType;) { | ||
| if (b.matches(a)) | ||
| return b; | ||
| b = b.parentNode; | ||
| } return null; }); })(window.Element.prototype); | ||
| /*! | ||
| Element.getRootNode() | ||
| */ | ||
| (function (c) { function d(a) { a = b(a); return a && 11 === a.nodeType ? d(a.host) : a; } function b(a) { return a && a.parentNode ? b(a.parentNode) : a; } "function" !== typeof c.getRootNode && (c.getRootNode = function (a) { return a && a.composed ? d(this) : b(this); }); })(Element.prototype); | ||
| /*! | ||
| Element.isConnected() | ||
| */ | ||
| (function (a) { "isConnected" in a || Object.defineProperty(a, "isConnected", { configurable: !0, enumerable: !0, get: function () { var a = this.getRootNode({ composed: !0 }); return a && 9 === a.nodeType; } }); })(Element.prototype); | ||
| /*! | ||
| Element.remove() | ||
| */ | ||
| (function (b) { b.forEach(function (a) { a.hasOwnProperty("remove") || Object.defineProperty(a, "remove", { configurable: !0, enumerable: !0, writable: !0, value: function () { null !== this.parentNode && this.parentNode.removeChild(this); } }); }); })([Element.prototype, CharacterData.prototype, DocumentType.prototype]); | ||
| /*! | ||
| Element.classList | ||
| */ | ||
| !function (e) { 'classList' in e || Object.defineProperty(e, "classList", { get: function () { var e = this, t = (e.getAttribute("class") || "").replace(/^\s+|\s$/g, "").split(/\s+/g); function n() { t.length > 0 ? e.setAttribute("class", t.join(" ")) : e.removeAttribute("class"); } return "" === t[0] && t.splice(0, 1), t.toggle = function (e, i) { void 0 !== i ? i ? t.add(e) : t.remove(e) : -1 !== t.indexOf(e) ? t.splice(t.indexOf(e), 1) : t.push(e), n(); }, t.add = function () { for (var e = [].slice.call(arguments), i = 0, s = e.length; i < s; i++) | ||
| -1 === t.indexOf(e[i]) && t.push(e[i]); n(); }, t.remove = function () { for (var e = [].slice.call(arguments), i = 0, s = e.length; i < s; i++) | ||
| -1 !== t.indexOf(e[i]) && t.splice(t.indexOf(e[i]), 1); n(); }, t.item = function (e) { return t[e]; }, t.contains = function (e) { return -1 !== t.indexOf(e); }, t.replace = function (e, i) { -1 !== t.indexOf(e) && t.splice(t.indexOf(e), 1, i), n(); }, t.value = e.getAttribute("class") || "", t; } }); }(Element.prototype); | ||
| /*! | ||
| DOMTokenList | ||
| */ | ||
| (function (b) { try { | ||
| document.body.classList.add(); | ||
| } | ||
| catch (e) { | ||
| var c = b.add, d = b.remove; | ||
| b.add = function () { for (var a = 0; a < arguments.length; a++) | ||
| c.call(this, arguments[a]); }; | ||
| b.remove = function () { for (var a = 0; a < arguments.length; a++) | ||
| d.call(this, arguments[a]); }; | ||
| } })(DOMTokenList.prototype); |
| var __extends = (this && this.__extends) || (function () { | ||
| var extendStatics = function (d, b) { | ||
| extendStatics = Object.setPrototypeOf || | ||
| ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
| function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
| return extendStatics(d, b); | ||
| }; | ||
| return function (d, b) { | ||
| extendStatics(d, b); | ||
| function __() { this.constructor = d; } | ||
| d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
| }; | ||
| })(); | ||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
| return new (P || (P = Promise))(function (resolve, reject) { | ||
| function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
| function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
| function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
| step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
| }); | ||
| }; | ||
| var __generator = (this && this.__generator) || function (thisArg, body) { | ||
| var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
| return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
| function verb(n) { return function (v) { return step([n, v]); }; } | ||
| function step(op) { | ||
| if (f) throw new TypeError("Generator is already executing."); | ||
| while (_) try { | ||
| if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
| if (y = 0, t) op = [op[0] & 2, t.value]; | ||
| switch (op[0]) { | ||
| case 0: case 1: t = op; break; | ||
| case 4: _.label++; return { value: op[1], done: false }; | ||
| case 5: _.label++; y = op[1]; op = [0]; continue; | ||
| case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
| default: | ||
| if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
| if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
| if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
| if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
| if (t[2]) _.ops.pop(); | ||
| _.trys.pop(); continue; | ||
| } | ||
| op = body.call(thisArg, _); | ||
| } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
| if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
| } | ||
| }; | ||
| var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
| for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
| for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
| for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
| r[k] = a[j]; | ||
| return r; | ||
| }; | ||
| var NAMESPACE = 'msf-editor'; | ||
| var scopeId; | ||
| var hostTagName; | ||
| var isSvgMode = false; | ||
| var queueCongestion = 0; | ||
| var queuePending = false; | ||
| var win = typeof window !== 'undefined' ? window : {}; | ||
| var CSS = win.CSS; | ||
| var doc = win.document || { head: {} }; | ||
| var plt = { | ||
| $flags$: 0, | ||
| $resourcesUrl$: '', | ||
| jmp: function (h) { return h(); }, | ||
| raf: function (h) { return requestAnimationFrame(h); }, | ||
| ael: function (el, eventName, listener, opts) { return el.addEventListener(eventName, listener, opts); }, | ||
| rel: function (el, eventName, listener, opts) { return el.removeEventListener(eventName, listener, opts); }, | ||
| ce: function (eventName, opts) { return new CustomEvent(eventName, opts); }, | ||
| }; | ||
| var supportsShadow = /*@__PURE__*/ (function () { return (doc.head.attachShadow + '').indexOf('[native') > -1; })(); | ||
| var promiseResolve = function (v) { return Promise.resolve(v); }; | ||
| var supportsConstructibleStylesheets = /*@__PURE__*/ (function () { | ||
| try { | ||
| new CSSStyleSheet(); | ||
| return true; | ||
| } | ||
| catch (e) { } | ||
| return false; | ||
| })(); | ||
| var addHostEventListeners = function (elm, hostRef, listeners, attachParentListeners) { | ||
| if (listeners) { | ||
| listeners.map(function (_a) { | ||
| var flags = _a[0], name = _a[1], method = _a[2]; | ||
| var target = getHostListenerTarget(elm, flags); | ||
| var handler = hostListenerProxy(hostRef, method); | ||
| var opts = hostListenerOpts(flags); | ||
| plt.ael(target, name, handler, opts); | ||
| (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(function () { return plt.rel(target, name, handler, opts); }); | ||
| }); | ||
| } | ||
| }; | ||
| var hostListenerProxy = function (hostRef, methodName) { return function (ev) { | ||
| { | ||
| if (hostRef.$flags$ & 256 /* isListenReady */) { | ||
| // instance is ready, let's call it's member method for this event | ||
| hostRef.$lazyInstance$[methodName](ev); | ||
| } | ||
| else { | ||
| (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]); | ||
| } | ||
| } | ||
| }; }; | ||
| var getHostListenerTarget = function (elm, flags) { | ||
| if (flags & 8 /* TargetWindow */) | ||
| return win; | ||
| return elm; | ||
| }; | ||
| // prettier-ignore | ||
| var hostListenerOpts = function (flags) { return (flags & 2 /* Capture */) !== 0; }; | ||
| var HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}'; | ||
| var createTime = function (fnName, tagName) { | ||
| if (tagName === void 0) { tagName = ''; } | ||
| { | ||
| return function () { | ||
| return; | ||
| }; | ||
| } | ||
| }; | ||
| var uniqueTime = function (key, measureText) { | ||
| { | ||
| return function () { | ||
| return; | ||
| }; | ||
| } | ||
| }; | ||
| var rootAppliedStyles = new WeakMap(); | ||
| var registerStyle = function (scopeId, cssText, allowCS) { | ||
| var style = styles.get(scopeId); | ||
| if (supportsConstructibleStylesheets && allowCS) { | ||
| style = (style || new CSSStyleSheet()); | ||
| style.replace(cssText); | ||
| } | ||
| else { | ||
| style = cssText; | ||
| } | ||
| styles.set(scopeId, style); | ||
| }; | ||
| var addStyle = function (styleContainerNode, cmpMeta, mode, hostElm) { | ||
| var scopeId = getScopeId(cmpMeta); | ||
| var style = styles.get(scopeId); | ||
| // if an element is NOT connected then getRootNode() will return the wrong root node | ||
| // so the fallback is to always use the document for the root node in those cases | ||
| styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc; | ||
| if (style) { | ||
| if (typeof style === 'string') { | ||
| styleContainerNode = styleContainerNode.head || styleContainerNode; | ||
| var appliedStyles = rootAppliedStyles.get(styleContainerNode); | ||
| var styleElm = void 0; | ||
| if (!appliedStyles) { | ||
| rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set())); | ||
| } | ||
| if (!appliedStyles.has(scopeId)) { | ||
| { | ||
| if (plt.$cssShim$) { | ||
| styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style, !!(cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */)); | ||
| var newScopeId = styleElm['s-sc']; | ||
| if (newScopeId) { | ||
| scopeId = newScopeId; | ||
| // we don't want to add this styleID to the appliedStyles Set | ||
| // since the cssVarShim might need to apply several different | ||
| // stylesheets for the same component | ||
| appliedStyles = null; | ||
| } | ||
| } | ||
| else { | ||
| styleElm = doc.createElement('style'); | ||
| styleElm.innerHTML = style; | ||
| } | ||
| styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link')); | ||
| } | ||
| if (appliedStyles) { | ||
| appliedStyles.add(scopeId); | ||
| } | ||
| } | ||
| } | ||
| else if (!styleContainerNode.adoptedStyleSheets.includes(style)) { | ||
| styleContainerNode.adoptedStyleSheets = __spreadArrays(styleContainerNode.adoptedStyleSheets, [style]); | ||
| } | ||
| } | ||
| return scopeId; | ||
| }; | ||
| var attachStyles = function (hostRef) { | ||
| var cmpMeta = hostRef.$cmpMeta$; | ||
| var elm = hostRef.$hostElement$; | ||
| var flags = cmpMeta.$flags$; | ||
| var endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$); | ||
| var scopeId = addStyle(supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$, elm); | ||
| if (flags & 10 /* needsScopedEncapsulation */) { | ||
| // only required when we're NOT using native shadow dom (slot) | ||
| // or this browser doesn't support native shadow dom | ||
| // and this host element was NOT created with SSR | ||
| // let's pick out the inner content for slot projection | ||
| // create a node to represent where the original | ||
| // content was first placed, which is useful later on | ||
| // DOM WRITE!! | ||
| elm['s-sc'] = scopeId; | ||
| elm.classList.add(scopeId + '-h'); | ||
| } | ||
| endAttachStyles(); | ||
| }; | ||
| var getScopeId = function (cmp, mode) { return 'sc-' + (cmp.$tagName$); }; | ||
| /** | ||
| * Default style mode id | ||
| */ | ||
| /** | ||
| * Reusable empty obj/array | ||
| * Don't add values to these!! | ||
| */ | ||
| var EMPTY_OBJ = {}; | ||
| var isDef = function (v) { return v != null; }; | ||
| var noop = function () { | ||
| /* noop*/ | ||
| }; | ||
| var isComplexType = function (o) { | ||
| // https://jsperf.com/typeof-fn-object/5 | ||
| o = typeof o; | ||
| return o === 'object' || o === 'function'; | ||
| }; | ||
| var IS_DENO_ENV = typeof Deno !== 'undefined'; | ||
| var IS_NODE_ENV = !IS_DENO_ENV && | ||
| typeof global !== 'undefined' && | ||
| typeof require === 'function' && | ||
| !!global.process && | ||
| typeof __filename === 'string' && | ||
| (!global.origin || typeof global.origin !== 'string'); | ||
| var IS_DENO_WINDOWS_ENV = IS_DENO_ENV && Deno.build.os === 'windows'; | ||
| var getCurrentDirectory = IS_NODE_ENV ? process.cwd : IS_DENO_ENV ? Deno.cwd : function () { return '/'; }; | ||
| var exit = IS_NODE_ENV ? process.exit : IS_DENO_ENV ? Deno.exit : noop; | ||
| /** | ||
| * Production h() function based on Preact by | ||
| * Jason Miller (@developit) | ||
| * Licensed under the MIT License | ||
| * https://github.com/developit/preact/blob/master/LICENSE | ||
| * | ||
| * Modified for Stencil's compiler and vdom | ||
| */ | ||
| // const stack: any[] = []; | ||
| // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode; | ||
| // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode; | ||
| var h = function (nodeName, vnodeData) { | ||
| var children = []; | ||
| for (var _i = 2; _i < arguments.length; _i++) { | ||
| children[_i - 2] = arguments[_i]; | ||
| } | ||
| var child = null; | ||
| var simple = false; | ||
| var lastSimple = false; | ||
| var vNodeChildren = []; | ||
| var walk = function (c) { | ||
| for (var i = 0; i < c.length; i++) { | ||
| child = c[i]; | ||
| if (Array.isArray(child)) { | ||
| walk(child); | ||
| } | ||
| else if (child != null && typeof child !== 'boolean') { | ||
| if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) { | ||
| child = String(child); | ||
| } | ||
| if (simple && lastSimple) { | ||
| // If the previous child was simple (string), we merge both | ||
| vNodeChildren[vNodeChildren.length - 1].$text$ += child; | ||
| } | ||
| else { | ||
| // Append a new vNode, if it's text, we create a text vNode | ||
| vNodeChildren.push(simple ? newVNode(null, child) : child); | ||
| } | ||
| lastSimple = simple; | ||
| } | ||
| } | ||
| }; | ||
| walk(children); | ||
| if (vnodeData) { | ||
| { | ||
| var classData_1 = vnodeData.className || vnodeData.class; | ||
| if (classData_1) { | ||
| vnodeData.class = | ||
| typeof classData_1 !== 'object' | ||
| ? classData_1 | ||
| : Object.keys(classData_1) | ||
| .filter(function (k) { return classData_1[k]; }) | ||
| .join(' '); | ||
| } | ||
| } | ||
| } | ||
| var vnode = newVNode(nodeName, null); | ||
| vnode.$attrs$ = vnodeData; | ||
| if (vNodeChildren.length > 0) { | ||
| vnode.$children$ = vNodeChildren; | ||
| } | ||
| return vnode; | ||
| }; | ||
| var newVNode = function (tag, text) { | ||
| var vnode = { | ||
| $flags$: 0, | ||
| $tag$: tag, | ||
| $text$: text, | ||
| $elm$: null, | ||
| $children$: null, | ||
| }; | ||
| { | ||
| vnode.$attrs$ = null; | ||
| } | ||
| return vnode; | ||
| }; | ||
| var Host = {}; | ||
| var isHost = function (node) { return node && node.$tag$ === Host; }; | ||
| /** | ||
| * Production setAccessor() function based on Preact by | ||
| * Jason Miller (@developit) | ||
| * Licensed under the MIT License | ||
| * https://github.com/developit/preact/blob/master/LICENSE | ||
| * | ||
| * Modified for Stencil's compiler and vdom | ||
| */ | ||
| var setAccessor = function (elm, memberName, oldValue, newValue, isSvg, flags) { | ||
| if (oldValue !== newValue) { | ||
| var isProp = isMemberInElement(elm, memberName); | ||
| var ln = memberName.toLowerCase(); | ||
| if (memberName === 'class') { | ||
| var classList = elm.classList; | ||
| var oldClasses_1 = parseClassList(oldValue); | ||
| var newClasses_1 = parseClassList(newValue); | ||
| classList.remove.apply(classList, oldClasses_1.filter(function (c) { return c && !newClasses_1.includes(c); })); | ||
| classList.add.apply(classList, newClasses_1.filter(function (c) { return c && !oldClasses_1.includes(c); })); | ||
| } | ||
| else { | ||
| // Set property if it exists and it's not a SVG | ||
| var isComplex = isComplexType(newValue); | ||
| if ((isProp || (isComplex && newValue !== null)) && !isSvg) { | ||
| try { | ||
| if (!elm.tagName.includes('-')) { | ||
| var n = newValue == null ? '' : newValue; | ||
| // Workaround for Safari, moving the <input> caret when re-assigning the same valued | ||
| if (memberName === 'list') { | ||
| isProp = false; | ||
| // tslint:disable-next-line: triple-equals | ||
| } | ||
| else if (oldValue == null || elm[memberName] != n) { | ||
| elm[memberName] = n; | ||
| } | ||
| } | ||
| else { | ||
| elm[memberName] = newValue; | ||
| } | ||
| } | ||
| catch (e) { } | ||
| } | ||
| if (newValue == null || newValue === false) { | ||
| if (newValue !== false || elm.getAttribute(memberName) === '') { | ||
| { | ||
| elm.removeAttribute(memberName); | ||
| } | ||
| } | ||
| } | ||
| else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) { | ||
| newValue = newValue === true ? '' : newValue; | ||
| { | ||
| elm.setAttribute(memberName, newValue); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| var parseClassListRegex = /\s/; | ||
| var parseClassList = function (value) { return (!value ? [] : value.split(parseClassListRegex)); }; | ||
| var updateElement = function (oldVnode, newVnode, isSvgMode, memberName) { | ||
| // if the element passed in is a shadow root, which is a document fragment | ||
| // then we want to be adding attrs/props to the shadow root's "host" element | ||
| // if it's not a shadow root, then we add attrs/props to the same element | ||
| var elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$; | ||
| var oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ; | ||
| var newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ; | ||
| { | ||
| // remove attributes no longer present on the vnode by setting them to undefined | ||
| for (memberName in oldVnodeAttrs) { | ||
| if (!(memberName in newVnodeAttrs)) { | ||
| setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$); | ||
| } | ||
| } | ||
| } | ||
| // add new & update changed attributes | ||
| for (memberName in newVnodeAttrs) { | ||
| setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$); | ||
| } | ||
| }; | ||
| var createElm = function (oldParentVNode, newParentVNode, childIndex, parentElm) { | ||
| // tslint:disable-next-line: prefer-const | ||
| var newVNode = newParentVNode.$children$[childIndex]; | ||
| var i = 0; | ||
| var elm; | ||
| var childNode; | ||
| { | ||
| // create element | ||
| elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$)); | ||
| // add css classes, attrs, props, listeners, etc. | ||
| { | ||
| updateElement(null, newVNode, isSvgMode); | ||
| } | ||
| if (isDef(scopeId) && elm['s-si'] !== scopeId) { | ||
| // if there is a scopeId and this is the initial render | ||
| // then let's add the scopeId as a css class | ||
| elm.classList.add((elm['s-si'] = scopeId)); | ||
| } | ||
| if (newVNode.$children$) { | ||
| for (i = 0; i < newVNode.$children$.length; ++i) { | ||
| // create the node | ||
| childNode = createElm(oldParentVNode, newVNode, i); | ||
| // return node could have been null | ||
| if (childNode) { | ||
| // append our new node | ||
| elm.appendChild(childNode); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| return elm; | ||
| }; | ||
| var addVnodes = function (parentElm, before, parentVNode, vnodes, startIdx, endIdx) { | ||
| var containerElm = (parentElm); | ||
| var childNode; | ||
| if (containerElm.shadowRoot && containerElm.tagName === hostTagName) { | ||
| containerElm = containerElm.shadowRoot; | ||
| } | ||
| for (; startIdx <= endIdx; ++startIdx) { | ||
| if (vnodes[startIdx]) { | ||
| childNode = createElm(null, parentVNode, startIdx); | ||
| if (childNode) { | ||
| vnodes[startIdx].$elm$ = childNode; | ||
| containerElm.insertBefore(childNode, before); | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| var removeVnodes = function (vnodes, startIdx, endIdx, vnode, elm) { | ||
| for (; startIdx <= endIdx; ++startIdx) { | ||
| if ((vnode = vnodes[startIdx])) { | ||
| elm = vnode.$elm$; | ||
| // remove the vnode's element from the dom | ||
| elm.remove(); | ||
| } | ||
| } | ||
| }; | ||
| var updateChildren = function (parentElm, oldCh, newVNode, newCh) { | ||
| var oldStartIdx = 0; | ||
| var newStartIdx = 0; | ||
| var oldEndIdx = oldCh.length - 1; | ||
| var oldStartVnode = oldCh[0]; | ||
| var oldEndVnode = oldCh[oldEndIdx]; | ||
| var newEndIdx = newCh.length - 1; | ||
| var newStartVnode = newCh[0]; | ||
| var newEndVnode = newCh[newEndIdx]; | ||
| var node; | ||
| while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { | ||
| if (oldStartVnode == null) { | ||
| // Vnode might have been moved left | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| } | ||
| else if (oldEndVnode == null) { | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| } | ||
| else if (newStartVnode == null) { | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else if (newEndVnode == null) { | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldStartVnode, newStartVnode)) { | ||
| patch(oldStartVnode, newStartVnode); | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else if (isSameVnode(oldEndVnode, newEndVnode)) { | ||
| patch(oldEndVnode, newEndVnode); | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldStartVnode, newEndVnode)) { | ||
| patch(oldStartVnode, newEndVnode); | ||
| parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling); | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldEndVnode, newStartVnode)) { | ||
| patch(oldEndVnode, newStartVnode); | ||
| parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$); | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else { | ||
| { | ||
| // new element | ||
| node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx); | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| if (node) { | ||
| { | ||
| oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| if (oldStartIdx > oldEndIdx) { | ||
| addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx); | ||
| } | ||
| else if (newStartIdx > newEndIdx) { | ||
| removeVnodes(oldCh, oldStartIdx, oldEndIdx); | ||
| } | ||
| }; | ||
| var isSameVnode = function (vnode1, vnode2) { | ||
| // compare if two vnode to see if they're "technically" the same | ||
| // need to have the same element tag, and same key to be the same | ||
| if (vnode1.$tag$ === vnode2.$tag$) { | ||
| return true; | ||
| } | ||
| return false; | ||
| }; | ||
| var patch = function (oldVNode, newVNode) { | ||
| var elm = (newVNode.$elm$ = oldVNode.$elm$); | ||
| var oldChildren = oldVNode.$children$; | ||
| var newChildren = newVNode.$children$; | ||
| { | ||
| // element node | ||
| { | ||
| { | ||
| // either this is the first render of an element OR it's an update | ||
| // AND we already know it's possible it could have changed | ||
| // this updates the element's css classes, attrs, props, listeners, etc. | ||
| updateElement(oldVNode, newVNode, isSvgMode); | ||
| } | ||
| } | ||
| if (oldChildren !== null && newChildren !== null) { | ||
| // looks like there's child vnodes for both the old and new vnodes | ||
| updateChildren(elm, oldChildren, newVNode, newChildren); | ||
| } | ||
| else if (newChildren !== null) { | ||
| // add the new vnode children | ||
| addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1); | ||
| } | ||
| else if (oldChildren !== null) { | ||
| // no new child vnodes, but there are old child vnodes to remove | ||
| removeVnodes(oldChildren, 0, oldChildren.length - 1); | ||
| } | ||
| } | ||
| }; | ||
| var renderVdom = function (hostRef, renderFnResults) { | ||
| var hostElm = hostRef.$hostElement$; | ||
| var oldVNode = hostRef.$vnode$ || newVNode(null, null); | ||
| var rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults); | ||
| hostTagName = hostElm.tagName; | ||
| rootVnode.$tag$ = null; | ||
| rootVnode.$flags$ |= 4 /* isHost */; | ||
| hostRef.$vnode$ = rootVnode; | ||
| rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm); | ||
| { | ||
| scopeId = hostElm['s-sc']; | ||
| } | ||
| // synchronous patch | ||
| patch(oldVNode, rootVnode); | ||
| }; | ||
| var getElement = function (ref) { return (getHostRef(ref).$hostElement$); }; | ||
| var createEvent = function (ref, name, flags) { | ||
| var elm = getElement(ref); | ||
| return { | ||
| emit: function (detail) { | ||
| return emitEvent(elm, name, { | ||
| bubbles: !!(flags & 4 /* Bubbles */), | ||
| composed: !!(flags & 2 /* Composed */), | ||
| cancelable: !!(flags & 1 /* Cancellable */), | ||
| detail: detail, | ||
| }); | ||
| }, | ||
| }; | ||
| }; | ||
| var emitEvent = function (elm, name, opts) { | ||
| var ev = plt.ce(name, opts); | ||
| elm.dispatchEvent(ev); | ||
| return ev; | ||
| }; | ||
| var attachToAncestor = function (hostRef, ancestorComponent) { | ||
| if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) { | ||
| ancestorComponent['s-p'].push(new Promise(function (r) { return (hostRef.$onRenderResolve$ = r); })); | ||
| } | ||
| }; | ||
| var scheduleUpdate = function (hostRef, isInitialLoad) { | ||
| { | ||
| hostRef.$flags$ |= 16 /* isQueuedForUpdate */; | ||
| } | ||
| if (hostRef.$flags$ & 4 /* isWaitingForChildren */) { | ||
| hostRef.$flags$ |= 512 /* needsRerender */; | ||
| return; | ||
| } | ||
| attachToAncestor(hostRef, hostRef.$ancestorComponent$); | ||
| // there is no ancestorc omponent or the ancestor component | ||
| // has already fired off its lifecycle update then | ||
| // fire off the initial update | ||
| var dispatch = function () { return dispatchHooks(hostRef, isInitialLoad); }; | ||
| return writeTask(dispatch); | ||
| }; | ||
| var dispatchHooks = function (hostRef, isInitialLoad) { | ||
| var endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$); | ||
| var instance = hostRef.$lazyInstance$; | ||
| var promise; | ||
| if (isInitialLoad) { | ||
| { | ||
| hostRef.$flags$ |= 256 /* isListenReady */; | ||
| if (hostRef.$queuedListeners$) { | ||
| hostRef.$queuedListeners$.map(function (_a) { | ||
| var methodName = _a[0], event = _a[1]; | ||
| return safeCall(instance, methodName, event); | ||
| }); | ||
| hostRef.$queuedListeners$ = null; | ||
| } | ||
| } | ||
| { | ||
| promise = safeCall(instance, 'componentWillLoad'); | ||
| } | ||
| } | ||
| { | ||
| promise = then(promise, function () { return safeCall(instance, 'componentWillRender'); }); | ||
| } | ||
| endSchedule(); | ||
| return then(promise, function () { return updateComponent(hostRef, instance, isInitialLoad); }); | ||
| }; | ||
| var updateComponent = function (hostRef, instance, isInitialLoad) { | ||
| // updateComponent | ||
| var elm = hostRef.$hostElement$; | ||
| var endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$); | ||
| var rc = elm['s-rc']; | ||
| if (isInitialLoad) { | ||
| // DOM WRITE! | ||
| attachStyles(hostRef); | ||
| } | ||
| var endRender = createTime('render', hostRef.$cmpMeta$.$tagName$); | ||
| { | ||
| { | ||
| // looks like we've got child nodes to render into this host element | ||
| // or we need to update the css class/attrs on the host element | ||
| // DOM WRITE! | ||
| renderVdom(hostRef, callRender(hostRef, instance)); | ||
| } | ||
| } | ||
| if (plt.$cssShim$) { | ||
| plt.$cssShim$.updateHost(elm); | ||
| } | ||
| if (rc) { | ||
| // ok, so turns out there are some child host elements | ||
| // waiting on this parent element to load | ||
| // let's fire off all update callbacks waiting | ||
| rc.map(function (cb) { return cb(); }); | ||
| elm['s-rc'] = undefined; | ||
| } | ||
| endRender(); | ||
| endUpdate(); | ||
| { | ||
| var childrenPromises = elm['s-p']; | ||
| var postUpdate = function () { return postUpdateComponent(hostRef); }; | ||
| if (childrenPromises.length === 0) { | ||
| postUpdate(); | ||
| } | ||
| else { | ||
| Promise.all(childrenPromises).then(postUpdate); | ||
| hostRef.$flags$ |= 4 /* isWaitingForChildren */; | ||
| childrenPromises.length = 0; | ||
| } | ||
| } | ||
| }; | ||
| var callRender = function (hostRef, instance) { | ||
| try { | ||
| instance = instance.render(); | ||
| { | ||
| hostRef.$flags$ &= ~16 /* isQueuedForUpdate */; | ||
| } | ||
| { | ||
| hostRef.$flags$ |= 2 /* hasRendered */; | ||
| } | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| return instance; | ||
| }; | ||
| var postUpdateComponent = function (hostRef) { | ||
| var tagName = hostRef.$cmpMeta$.$tagName$; | ||
| var elm = hostRef.$hostElement$; | ||
| var endPostUpdate = createTime('postUpdate', tagName); | ||
| var ancestorComponent = hostRef.$ancestorComponent$; | ||
| if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) { | ||
| hostRef.$flags$ |= 64 /* hasLoadedComponent */; | ||
| { | ||
| // DOM WRITE! | ||
| addHydratedFlag(elm); | ||
| } | ||
| endPostUpdate(); | ||
| { | ||
| hostRef.$onReadyResolve$(elm); | ||
| if (!ancestorComponent) { | ||
| appDidLoad(); | ||
| } | ||
| } | ||
| } | ||
| else { | ||
| endPostUpdate(); | ||
| } | ||
| { | ||
| hostRef.$onInstanceResolve$(elm); | ||
| } | ||
| // load events fire from bottom to top | ||
| // the deepest elements load first then bubbles up | ||
| { | ||
| if (hostRef.$onRenderResolve$) { | ||
| hostRef.$onRenderResolve$(); | ||
| hostRef.$onRenderResolve$ = undefined; | ||
| } | ||
| if (hostRef.$flags$ & 512 /* needsRerender */) { | ||
| nextTick(function () { return scheduleUpdate(hostRef, false); }); | ||
| } | ||
| hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */); | ||
| } | ||
| // ( •_•) | ||
| // ( •_•)>⌐■-■ | ||
| // (⌐■_■) | ||
| }; | ||
| var forceUpdate = function (ref) { | ||
| { | ||
| var hostRef = getHostRef(ref); | ||
| var isConnected = hostRef.$hostElement$.isConnected; | ||
| if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) { | ||
| scheduleUpdate(hostRef, false); | ||
| } | ||
| // Returns "true" when the forced update was successfully scheduled | ||
| return isConnected; | ||
| } | ||
| }; | ||
| var appDidLoad = function (who) { | ||
| // on appload | ||
| // we have finish the first big initial render | ||
| { | ||
| addHydratedFlag(doc.documentElement); | ||
| } | ||
| { | ||
| plt.$flags$ |= 2 /* appLoaded */; | ||
| } | ||
| nextTick(function () { return emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }); }); | ||
| }; | ||
| var safeCall = function (instance, method, arg) { | ||
| if (instance && instance[method]) { | ||
| try { | ||
| return instance[method](arg); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| return undefined; | ||
| }; | ||
| var then = function (promise, thenFn) { | ||
| return promise && promise.then ? promise.then(thenFn) : thenFn(); | ||
| }; | ||
| var addHydratedFlag = function (elm) { return (elm.classList.add('hydrated')); }; | ||
| var parsePropertyValue = function (propValue, propType) { | ||
| // ensure this value is of the correct prop type | ||
| if (propValue != null && !isComplexType(propValue)) { | ||
| if (propType & 1 /* String */) { | ||
| // could have been passed as a number or boolean | ||
| // but we still want it as a string | ||
| return String(propValue); | ||
| } | ||
| // redundant return here for better minification | ||
| return propValue; | ||
| } | ||
| // not sure exactly what type we want | ||
| // so no need to change to a different type | ||
| return propValue; | ||
| }; | ||
| var getValue = function (ref, propName) { return getHostRef(ref).$instanceValues$.get(propName); }; | ||
| var setValue = function (ref, propName, newVal, cmpMeta) { | ||
| // check our new property value against our internal value | ||
| var hostRef = getHostRef(ref); | ||
| var oldVal = hostRef.$instanceValues$.get(propName); | ||
| var flags = hostRef.$flags$; | ||
| var instance = hostRef.$lazyInstance$; | ||
| newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]); | ||
| if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && newVal !== oldVal) { | ||
| // gadzooks! the property's value has changed!! | ||
| // set our new value! | ||
| hostRef.$instanceValues$.set(propName, newVal); | ||
| if (instance) { | ||
| if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) { | ||
| // looks like this value actually changed, so we've got work to do! | ||
| // but only if we've already rendered, otherwise just chill out | ||
| // queue that we need to do an update, but don't worry about queuing | ||
| // up millions cuz this function ensures it only runs once | ||
| scheduleUpdate(hostRef, false); | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| var proxyComponent = function (Cstr, cmpMeta, flags) { | ||
| if (cmpMeta.$members$) { | ||
| // It's better to have a const than two Object.entries() | ||
| var members = Object.entries(cmpMeta.$members$); | ||
| var prototype_1 = Cstr.prototype; | ||
| members.map(function (_a) { | ||
| var memberName = _a[0], memberFlags = _a[1][0]; | ||
| if ((memberFlags & 31 /* Prop */ || ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) { | ||
| // proxyComponent - prop | ||
| Object.defineProperty(prototype_1, memberName, { | ||
| get: function () { | ||
| // proxyComponent, get value | ||
| return getValue(this, memberName); | ||
| }, | ||
| set: function (newValue) { | ||
| // proxyComponent, set value | ||
| setValue(this, memberName, newValue, cmpMeta); | ||
| }, | ||
| configurable: true, | ||
| enumerable: true, | ||
| }); | ||
| } | ||
| else if (flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) { | ||
| // proxyComponent - method | ||
| Object.defineProperty(prototype_1, memberName, { | ||
| value: function () { | ||
| var args = []; | ||
| for (var _i = 0; _i < arguments.length; _i++) { | ||
| args[_i] = arguments[_i]; | ||
| } | ||
| var ref = getHostRef(this); | ||
| return ref.$onInstancePromise$.then(function () { | ||
| var _a; | ||
| return (_a = ref.$lazyInstance$)[memberName].apply(_a, args); | ||
| }); | ||
| }, | ||
| }); | ||
| } | ||
| }); | ||
| if ((flags & 1 /* isElementConstructor */)) { | ||
| var attrNameToPropName_1 = new Map(); | ||
| prototype_1.attributeChangedCallback = function (attrName, _oldValue, newValue) { | ||
| var _this = this; | ||
| plt.jmp(function () { | ||
| var propName = attrNameToPropName_1.get(attrName); | ||
| _this[propName] = newValue === null && typeof _this[propName] === 'boolean' ? false : newValue; | ||
| }); | ||
| }; | ||
| // create an array of attributes to observe | ||
| // and also create a map of html attribute name to js property name | ||
| Cstr.observedAttributes = members | ||
| .filter(function (_a) { | ||
| var _ = _a[0], m = _a[1]; | ||
| return m[0] & 15; | ||
| } /* HasAttribute */) // filter to only keep props that should match attributes | ||
| .map(function (_a) { | ||
| var propName = _a[0], m = _a[1]; | ||
| var attrName = m[1] || propName; | ||
| attrNameToPropName_1.set(attrName, propName); | ||
| return attrName; | ||
| }); | ||
| } | ||
| } | ||
| return Cstr; | ||
| }; | ||
| var initializeComponent = function (elm, hostRef, cmpMeta, hmrVersionId, Cstr) { return __awaiter(void 0, void 0, void 0, function () { | ||
| var endLoad, endNewInstance, style_1, scopeId_1, endRegisterStyles, ancestorComponent, schedule; | ||
| return __generator(this, function (_a) { | ||
| switch (_a.label) { | ||
| case 0: | ||
| if (!((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0)) return [3 /*break*/, 5]; | ||
| // we haven't initialized this element yet | ||
| hostRef.$flags$ |= 32 /* hasInitializedComponent */; | ||
| // lazy loaded components | ||
| // request the component's implementation to be | ||
| // wired up with the host element | ||
| Cstr = loadModule(cmpMeta); | ||
| if (!Cstr.then) return [3 /*break*/, 2]; | ||
| endLoad = uniqueTime(); | ||
| return [4 /*yield*/, Cstr]; | ||
| case 1: | ||
| Cstr = _a.sent(); | ||
| endLoad(); | ||
| _a.label = 2; | ||
| case 2: | ||
| if (!Cstr.isProxied) { | ||
| proxyComponent(Cstr, cmpMeta, 2 /* proxyState */); | ||
| Cstr.isProxied = true; | ||
| } | ||
| endNewInstance = createTime('createInstance', cmpMeta.$tagName$); | ||
| // ok, time to construct the instance | ||
| // but let's keep track of when we start and stop | ||
| // so that the getters/setters don't incorrectly step on data | ||
| { | ||
| hostRef.$flags$ |= 8 /* isConstructingInstance */; | ||
| } | ||
| // construct the lazy-loaded component implementation | ||
| // passing the hostRef is very important during | ||
| // construction in order to directly wire together the | ||
| // host element and the lazy-loaded instance | ||
| try { | ||
| new Cstr(hostRef); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| { | ||
| hostRef.$flags$ &= ~8 /* isConstructingInstance */; | ||
| } | ||
| endNewInstance(); | ||
| if (!Cstr.style) return [3 /*break*/, 5]; | ||
| style_1 = Cstr.style; | ||
| scopeId_1 = getScopeId(cmpMeta); | ||
| if (!!styles.has(scopeId_1)) return [3 /*break*/, 5]; | ||
| endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$); | ||
| if (!(cmpMeta.$flags$ & 8) /* needsShadowDomShim */) return [3 /*break*/, 4]; /* needsShadowDomShim */ | ||
| return [4 /*yield*/, import('./shadow-css-c63963b5.js').then(function (m) { return m.scopeCss(style_1, scopeId_1, false); })]; | ||
| case 3: | ||
| style_1 = _a.sent(); | ||
| _a.label = 4; | ||
| case 4: | ||
| registerStyle(scopeId_1, style_1, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)); | ||
| endRegisterStyles(); | ||
| _a.label = 5; | ||
| case 5: | ||
| ancestorComponent = hostRef.$ancestorComponent$; | ||
| schedule = function () { return scheduleUpdate(hostRef, true); }; | ||
| if (ancestorComponent && ancestorComponent['s-rc']) { | ||
| // this is the intial load and this component it has an ancestor component | ||
| // but the ancestor component has NOT fired its will update lifecycle yet | ||
| // so let's just cool our jets and wait for the ancestor to continue first | ||
| // this will get fired off when the ancestor component | ||
| // finally gets around to rendering its lazy self | ||
| // fire off the initial update | ||
| ancestorComponent['s-rc'].push(schedule); | ||
| } | ||
| else { | ||
| schedule(); | ||
| } | ||
| return [2 /*return*/]; | ||
| } | ||
| }); | ||
| }); }; | ||
| var connectedCallback = function (elm) { | ||
| if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) { | ||
| var hostRef_1 = getHostRef(elm); | ||
| var cmpMeta_1 = hostRef_1.$cmpMeta$; | ||
| var endConnected = createTime('connectedCallback', cmpMeta_1.$tagName$); | ||
| if (!(hostRef_1.$flags$ & 1 /* hasConnected */)) { | ||
| // first time this component has connected | ||
| hostRef_1.$flags$ |= 1 /* hasConnected */; | ||
| { | ||
| // find the first ancestor component (if there is one) and register | ||
| // this component as one of the actively loading child components for its ancestor | ||
| var ancestorComponent = elm; | ||
| while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) { | ||
| // climb up the ancestors looking for the first | ||
| // component that hasn't finished its lifecycle update yet | ||
| if (ancestorComponent['s-p']) { | ||
| // we found this components first ancestor component | ||
| // keep a reference to this component's ancestor component | ||
| attachToAncestor(hostRef_1, (hostRef_1.$ancestorComponent$ = ancestorComponent)); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| // Lazy properties | ||
| // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties | ||
| if (cmpMeta_1.$members$) { | ||
| Object.entries(cmpMeta_1.$members$).map(function (_a) { | ||
| var memberName = _a[0], memberFlags = _a[1][0]; | ||
| if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) { | ||
| var value = elm[memberName]; | ||
| delete elm[memberName]; | ||
| elm[memberName] = value; | ||
| } | ||
| }); | ||
| } | ||
| { | ||
| // connectedCallback, taskQueue, initialLoad | ||
| // angular sets attribute AFTER connectCallback | ||
| // https://github.com/angular/angular/issues/18909 | ||
| // https://github.com/angular/angular/issues/19940 | ||
| nextTick(function () { return initializeComponent(elm, hostRef_1, cmpMeta_1); }); | ||
| } | ||
| } | ||
| else { | ||
| // not the first time this has connected | ||
| // reattach any event listeners to the host | ||
| // since they would have been removed when disconnected | ||
| addHostEventListeners(elm, hostRef_1, cmpMeta_1.$listeners$); | ||
| } | ||
| endConnected(); | ||
| } | ||
| }; | ||
| var disconnectedCallback = function (elm) { | ||
| if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) { | ||
| var hostRef = getHostRef(elm); | ||
| { | ||
| if (hostRef.$rmListeners$) { | ||
| hostRef.$rmListeners$.map(function (rmListener) { return rmListener(); }); | ||
| hostRef.$rmListeners$ = undefined; | ||
| } | ||
| } | ||
| // clear CSS var-shim tracking | ||
| if (plt.$cssShim$) { | ||
| plt.$cssShim$.removeHost(elm); | ||
| } | ||
| } | ||
| }; | ||
| var bootstrapLazy = function (lazyBundles, options) { | ||
| if (options === void 0) { options = {}; } | ||
| var endBootstrap = createTime(); | ||
| var cmpTags = []; | ||
| var exclude = options.exclude || []; | ||
| var customElements = win.customElements; | ||
| var head = doc.head; | ||
| var metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]'); | ||
| var visibilityStyle = /*@__PURE__*/ doc.createElement('style'); | ||
| var deferredConnectedCallbacks = []; | ||
| var appLoadFallback; | ||
| var isBootstrapping = true; | ||
| Object.assign(plt, options); | ||
| plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href; | ||
| { | ||
| if (options.syncQueue) { | ||
| plt.$flags$ |= 4 /* queueSync */; | ||
| } | ||
| } | ||
| lazyBundles.map(function (lazyBundle) { return lazyBundle[1].map(function (compactMeta) { | ||
| var cmpMeta = { | ||
| $flags$: compactMeta[0], | ||
| $tagName$: compactMeta[1], | ||
| $members$: compactMeta[2], | ||
| $listeners$: compactMeta[3], | ||
| }; | ||
| { | ||
| cmpMeta.$members$ = compactMeta[2]; | ||
| } | ||
| { | ||
| cmpMeta.$listeners$ = compactMeta[3]; | ||
| } | ||
| if (!supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { | ||
| cmpMeta.$flags$ |= 8 /* needsShadowDomShim */; | ||
| } | ||
| var tagName = cmpMeta.$tagName$; | ||
| var HostElement = /** @class */ (function (_super) { | ||
| __extends(HostElement, _super); | ||
| // StencilLazyHost | ||
| function HostElement(self) { | ||
| var _this = | ||
| // @ts-ignore | ||
| _super.call(this, self) || this; | ||
| self = _this; | ||
| registerHost(self, cmpMeta); | ||
| if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { | ||
| // this component is using shadow dom | ||
| // and this browser supports shadow dom | ||
| // add the read-only property "shadowRoot" to the host element | ||
| // adding the shadow root build conditionals to minimize runtime | ||
| if (supportsShadow) { | ||
| { | ||
| self.attachShadow({ mode: 'open' }); | ||
| } | ||
| } | ||
| else if (!('shadowRoot' in self)) { | ||
| self.shadowRoot = self; | ||
| } | ||
| } | ||
| return _this; | ||
| } | ||
| HostElement.prototype.connectedCallback = function () { | ||
| var _this = this; | ||
| if (appLoadFallback) { | ||
| clearTimeout(appLoadFallback); | ||
| appLoadFallback = null; | ||
| } | ||
| if (isBootstrapping) { | ||
| // connectedCallback will be processed once all components have been registered | ||
| deferredConnectedCallbacks.push(this); | ||
| } | ||
| else { | ||
| plt.jmp(function () { return connectedCallback(_this); }); | ||
| } | ||
| }; | ||
| HostElement.prototype.disconnectedCallback = function () { | ||
| var _this = this; | ||
| plt.jmp(function () { return disconnectedCallback(_this); }); | ||
| }; | ||
| HostElement.prototype.forceUpdate = function () { | ||
| forceUpdate(this); | ||
| }; | ||
| HostElement.prototype.componentOnReady = function () { | ||
| return getHostRef(this).$onReadyPromise$; | ||
| }; | ||
| return HostElement; | ||
| }(HTMLElement)); | ||
| cmpMeta.$lazyBundleId$ = lazyBundle[0]; | ||
| if (!exclude.includes(tagName) && !customElements.get(tagName)) { | ||
| cmpTags.push(tagName); | ||
| customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */)); | ||
| } | ||
| }); }); | ||
| { | ||
| visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS; | ||
| visibilityStyle.setAttribute('data-styles', ''); | ||
| head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild); | ||
| } | ||
| // Process deferred connectedCallbacks now all components have been registered | ||
| isBootstrapping = false; | ||
| if (deferredConnectedCallbacks.length) { | ||
| deferredConnectedCallbacks.map(function (host) { return host.connectedCallback(); }); | ||
| } | ||
| else { | ||
| { | ||
| plt.jmp(function () { return (appLoadFallback = setTimeout(appDidLoad, 30)); }); | ||
| } | ||
| } | ||
| // Fallback appLoad event | ||
| endBootstrap(); | ||
| }; | ||
| var hostRefs = new WeakMap(); | ||
| var getHostRef = function (ref) { return hostRefs.get(ref); }; | ||
| var registerInstance = function (lazyInstance, hostRef) { return hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef); }; | ||
| var registerHost = function (elm, cmpMeta) { | ||
| var hostRef = { | ||
| $flags$: 0, | ||
| $hostElement$: elm, | ||
| $cmpMeta$: cmpMeta, | ||
| $instanceValues$: new Map(), | ||
| }; | ||
| { | ||
| hostRef.$onInstancePromise$ = new Promise(function (r) { return (hostRef.$onInstanceResolve$ = r); }); | ||
| } | ||
| { | ||
| hostRef.$onReadyPromise$ = new Promise(function (r) { return (hostRef.$onReadyResolve$ = r); }); | ||
| elm['s-p'] = []; | ||
| elm['s-rc'] = []; | ||
| } | ||
| addHostEventListeners(elm, hostRef, cmpMeta.$listeners$); | ||
| return hostRefs.set(elm, hostRef); | ||
| }; | ||
| var isMemberInElement = function (elm, memberName) { return memberName in elm; }; | ||
| var consoleError = function (e) { return console.error(e); }; | ||
| var cmpModules = /*@__PURE__*/ new Map(); | ||
| var loadModule = function (cmpMeta, hostRef, hmrVersionId) { | ||
| // loadModuleImport | ||
| var exportName = cmpMeta.$tagName$.replace(/-/g, '_'); | ||
| var bundleId = cmpMeta.$lazyBundleId$; | ||
| var module = cmpModules.get(bundleId); | ||
| if (module) { | ||
| return module[exportName]; | ||
| } | ||
| return import( | ||
| /* webpackInclude: /\.entry\.js$/ */ | ||
| /* webpackExclude: /\.system\.entry\.js$/ */ | ||
| /* webpackMode: "lazy" */ | ||
| "./" + bundleId + ".entry.js" + '').then(function (importedModule) { | ||
| { | ||
| cmpModules.set(bundleId, importedModule); | ||
| } | ||
| return importedModule[exportName]; | ||
| }, consoleError); | ||
| }; | ||
| var styles = new Map(); | ||
| var queueDomReads = []; | ||
| var queueDomWrites = []; | ||
| var queueDomWritesLow = []; | ||
| var queueTask = function (queue, write) { return function (cb) { | ||
| queue.push(cb); | ||
| if (!queuePending) { | ||
| queuePending = true; | ||
| if (write && plt.$flags$ & 4 /* queueSync */) { | ||
| nextTick(flush); | ||
| } | ||
| else { | ||
| plt.raf(flush); | ||
| } | ||
| } | ||
| }; }; | ||
| var consume = function (queue) { | ||
| for (var i = 0; i < queue.length; i++) { | ||
| try { | ||
| queue[i](performance.now()); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| queue.length = 0; | ||
| }; | ||
| var consumeTimeout = function (queue, timeout) { | ||
| var i = 0; | ||
| var ts = 0; | ||
| while (i < queue.length && (ts = performance.now()) < timeout) { | ||
| try { | ||
| queue[i++](ts); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| if (i === queue.length) { | ||
| queue.length = 0; | ||
| } | ||
| else if (i !== 0) { | ||
| queue.splice(0, i); | ||
| } | ||
| }; | ||
| var flush = function () { | ||
| { | ||
| queueCongestion++; | ||
| } | ||
| // always force a bunch of medium callbacks to run, but still have | ||
| // a throttle on how many can run in a certain time | ||
| // DOM READS!!! | ||
| consume(queueDomReads); | ||
| // DOM WRITES!!! | ||
| { | ||
| var timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */ ? performance.now() + 14 * Math.ceil(queueCongestion * (1.0 / 10.0)) : Infinity; | ||
| consumeTimeout(queueDomWrites, timeout); | ||
| consumeTimeout(queueDomWritesLow, timeout); | ||
| if (queueDomWrites.length > 0) { | ||
| queueDomWritesLow.push.apply(queueDomWritesLow, queueDomWrites); | ||
| queueDomWrites.length = 0; | ||
| } | ||
| if ((queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0)) { | ||
| // still more to do yet, but we've run out of time | ||
| // let's let this thing cool off and try again in the next tick | ||
| plt.raf(flush); | ||
| } | ||
| else { | ||
| queueCongestion = 0; | ||
| } | ||
| } | ||
| }; | ||
| var nextTick = /*@__PURE__*/ function (cb) { return promiseResolve().then(cb); }; | ||
| var writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true); | ||
| export { CSS as C, NAMESPACE as N, promiseResolve as a, bootstrapLazy as b, createEvent as c, doc as d, getElement as g, h, plt as p, registerInstance as r, win as w }; |
| import { C as CSS, p as plt, w as win, a as promiseResolve, d as doc, N as NAMESPACE } from './index-05772288.js'; | ||
| /* | ||
| Stencil Client Patch v1.17.3 | MIT Licensed | https://stenciljs.com | ||
| */ | ||
| var noop = function () { | ||
| /* noop*/ | ||
| }; | ||
| var IS_DENO_ENV = typeof Deno !== 'undefined'; | ||
| var IS_NODE_ENV = !IS_DENO_ENV && | ||
| typeof global !== 'undefined' && | ||
| typeof require === 'function' && | ||
| !!global.process && | ||
| typeof __filename === 'string' && | ||
| (!global.origin || typeof global.origin !== 'string'); | ||
| var IS_DENO_WINDOWS_ENV = IS_DENO_ENV && Deno.build.os === 'windows'; | ||
| var getCurrentDirectory = IS_NODE_ENV ? process.cwd : IS_DENO_ENV ? Deno.cwd : function () { return '/'; }; | ||
| var exit = IS_NODE_ENV ? process.exit : IS_DENO_ENV ? Deno.exit : noop; | ||
| var getDynamicImportFunction = function (namespace) { return "__sc_import_" + namespace.replace(/\s|-/g, '_'); }; | ||
| var patchEsm = function () { | ||
| // NOTE!! This fn cannot use async/await! | ||
| // @ts-ignore | ||
| if (!(CSS && CSS.supports && CSS.supports('color', 'var(--c)'))) { | ||
| // @ts-ignore | ||
| return import(/* webpackChunkName: "polyfills-css-shim" */ './css-shim-a659079f.js').then(function () { | ||
| if ((plt.$cssShim$ = win.__cssshim)) { | ||
| return plt.$cssShim$.i(); | ||
| } | ||
| else { | ||
| // for better minification | ||
| return 0; | ||
| } | ||
| }); | ||
| } | ||
| return promiseResolve(); | ||
| }; | ||
| var patchBrowser = function () { | ||
| { | ||
| // shim css vars | ||
| plt.$cssShim$ = win.__cssshim; | ||
| } | ||
| // @ts-ignore | ||
| var scriptElm = Array.from(doc.querySelectorAll('script')).find(function (s) { return new RegExp("/" + NAMESPACE + "(\\.esm)?\\.js($|\\?|#)").test(s.src) || s.getAttribute('data-stencil-namespace') === NAMESPACE; }); | ||
| var opts = scriptElm['data-opts'] || {}; | ||
| if ('onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) { | ||
| // Safari < v11 support: This IF is true if it's Safari below v11. | ||
| // This fn cannot use async/await since Safari didn't support it until v11, | ||
| // however, Safari 10 did support modules. Safari 10 also didn't support "nomodule", | ||
| // so both the ESM file and nomodule file would get downloaded. Only Safari | ||
| // has 'onbeforeload' in the script, and "history.scrollRestoration" was added | ||
| // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue. | ||
| // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds. | ||
| return { | ||
| then: function () { | ||
| /* promise noop */ | ||
| }, | ||
| }; | ||
| } | ||
| { | ||
| opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href; | ||
| { | ||
| patchDynamicImport(opts.resourcesUrl, scriptElm); | ||
| } | ||
| if (!win.customElements) { | ||
| // module support, but no custom elements support (Old Edge) | ||
| // @ts-ignore | ||
| return import(/* webpackChunkName: "polyfills-dom" */ './dom-4061ceba.js').then(function () { return opts; }); | ||
| } | ||
| } | ||
| return promiseResolve(opts); | ||
| }; | ||
| var patchDynamicImport = function (base, orgScriptElm) { | ||
| var importFunctionName = getDynamicImportFunction(NAMESPACE); | ||
| try { | ||
| // test if this browser supports dynamic imports | ||
| // There is a caching issue in V8, that breaks using import() in Function | ||
| // By generating a random string, we can workaround it | ||
| // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info | ||
| win[importFunctionName] = new Function('w', "return import(w);//" + Math.random()); | ||
| } | ||
| catch (e) { | ||
| // this shim is specifically for browsers that do support "esm" imports | ||
| // however, they do NOT support "dynamic" imports | ||
| // basically this code is for old Edge, v18 and below | ||
| var moduleMap_1 = new Map(); | ||
| win[importFunctionName] = function (src) { | ||
| var url = new URL(src, base).href; | ||
| var mod = moduleMap_1.get(url); | ||
| if (!mod) { | ||
| var script_1 = doc.createElement('script'); | ||
| script_1.type = 'module'; | ||
| script_1.crossOrigin = orgScriptElm.crossOrigin; | ||
| script_1.src = URL.createObjectURL(new Blob(["import * as m from '" + url + "'; window." + importFunctionName + ".m = m;"], { type: 'application/javascript' })); | ||
| mod = new Promise(function (resolve) { | ||
| script_1.onload = function () { | ||
| resolve(win[importFunctionName].m); | ||
| script_1.remove(); | ||
| }; | ||
| }); | ||
| moduleMap_1.set(url, mod); | ||
| doc.head.appendChild(script_1); | ||
| } | ||
| return mod; | ||
| }; | ||
| } | ||
| }; | ||
| export { patchEsm as a, patchBrowser as p }; |
| var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
| for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
| for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
| for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
| r[k] = a[j]; | ||
| return r; | ||
| }; | ||
| /* | ||
| Stencil Client Platform v1.17.3 | MIT Licensed | https://stenciljs.com | ||
| */ | ||
| /** | ||
| * @license | ||
| * Copyright Google Inc. All Rights Reserved. | ||
| * | ||
| * Use of this source code is governed by an MIT-style license that can be | ||
| * found in the LICENSE file at https://angular.io/license | ||
| * | ||
| * This file is a port of shadowCSS from webcomponents.js to TypeScript. | ||
| * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js | ||
| * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts | ||
| */ | ||
| var safeSelector = function (selector) { | ||
| var placeholders = []; | ||
| var index = 0; | ||
| var content; | ||
| // Replaces attribute selectors with placeholders. | ||
| // The WS in [attr="va lue"] would otherwise be interpreted as a selector separator. | ||
| selector = selector.replace(/(\[[^\]]*\])/g, function (_, keep) { | ||
| var replaceBy = "__ph-" + index + "__"; | ||
| placeholders.push(keep); | ||
| index++; | ||
| return replaceBy; | ||
| }); | ||
| // Replaces the expression in `:nth-child(2n + 1)` with a placeholder. | ||
| // WS and "+" would otherwise be interpreted as selector separators. | ||
| content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, function (_, pseudo, exp) { | ||
| var replaceBy = "__ph-" + index + "__"; | ||
| placeholders.push(exp); | ||
| index++; | ||
| return pseudo + replaceBy; | ||
| }); | ||
| var ss = { | ||
| content: content, | ||
| placeholders: placeholders, | ||
| }; | ||
| return ss; | ||
| }; | ||
| var restoreSafeSelector = function (placeholders, content) { | ||
| return content.replace(/__ph-(\d+)__/g, function (_, index) { return placeholders[+index]; }); | ||
| }; | ||
| var _polyfillHost = '-shadowcsshost'; | ||
| var _polyfillSlotted = '-shadowcssslotted'; | ||
| // note: :host-context pre-processed to -shadowcsshostcontext. | ||
| var _polyfillHostContext = '-shadowcsscontext'; | ||
| var _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)'; | ||
| var _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim'); | ||
| var _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim'); | ||
| var _cssColonSlottedRe = new RegExp('(' + _polyfillSlotted + _parenSuffix, 'gim'); | ||
| var _polyfillHostNoCombinator = _polyfillHost + '-no-combinator'; | ||
| var _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/; | ||
| var _shadowDOMSelectorsRe = [/::shadow/g, /::content/g]; | ||
| var _selectorReSuffix = '([>\\s~+[.,{:][\\s\\S]*)?$'; | ||
| var _polyfillHostRe = /-shadowcsshost/gim; | ||
| var _colonHostRe = /:host/gim; | ||
| var _colonSlottedRe = /::slotted/gim; | ||
| var _colonHostContextRe = /:host-context/gim; | ||
| var _commentRe = /\/\*\s*[\s\S]*?\*\//g; | ||
| var stripComments = function (input) { | ||
| return input.replace(_commentRe, ''); | ||
| }; | ||
| var _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g; | ||
| var extractCommentsWithHash = function (input) { | ||
| return input.match(_commentWithHashRe) || []; | ||
| }; | ||
| var _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g; | ||
| var _curlyRe = /([{}])/g; | ||
| var OPEN_CURLY = '{'; | ||
| var CLOSE_CURLY = '}'; | ||
| var BLOCK_PLACEHOLDER = '%BLOCK%'; | ||
| var processRules = function (input, ruleCallback) { | ||
| var inputWithEscapedBlocks = escapeBlocks(input); | ||
| var nextBlockIndex = 0; | ||
| return inputWithEscapedBlocks.escapedString.replace(_ruleRe, function () { | ||
| var m = []; | ||
| for (var _i = 0; _i < arguments.length; _i++) { | ||
| m[_i] = arguments[_i]; | ||
| } | ||
| var selector = m[2]; | ||
| var content = ''; | ||
| var suffix = m[4]; | ||
| var contentPrefix = ''; | ||
| if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) { | ||
| content = inputWithEscapedBlocks.blocks[nextBlockIndex++]; | ||
| suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1); | ||
| contentPrefix = '{'; | ||
| } | ||
| var cssRule = { | ||
| selector: selector, | ||
| content: content, | ||
| }; | ||
| var rule = ruleCallback(cssRule); | ||
| return "" + m[1] + rule.selector + m[3] + contentPrefix + rule.content + suffix; | ||
| }); | ||
| }; | ||
| var escapeBlocks = function (input) { | ||
| var inputParts = input.split(_curlyRe); | ||
| var resultParts = []; | ||
| var escapedBlocks = []; | ||
| var bracketCount = 0; | ||
| var currentBlockParts = []; | ||
| for (var partIndex = 0; partIndex < inputParts.length; partIndex++) { | ||
| var part = inputParts[partIndex]; | ||
| if (part === CLOSE_CURLY) { | ||
| bracketCount--; | ||
| } | ||
| if (bracketCount > 0) { | ||
| currentBlockParts.push(part); | ||
| } | ||
| else { | ||
| if (currentBlockParts.length > 0) { | ||
| escapedBlocks.push(currentBlockParts.join('')); | ||
| resultParts.push(BLOCK_PLACEHOLDER); | ||
| currentBlockParts = []; | ||
| } | ||
| resultParts.push(part); | ||
| } | ||
| if (part === OPEN_CURLY) { | ||
| bracketCount++; | ||
| } | ||
| } | ||
| if (currentBlockParts.length > 0) { | ||
| escapedBlocks.push(currentBlockParts.join('')); | ||
| resultParts.push(BLOCK_PLACEHOLDER); | ||
| } | ||
| var strEscapedBlocks = { | ||
| escapedString: resultParts.join(''), | ||
| blocks: escapedBlocks, | ||
| }; | ||
| return strEscapedBlocks; | ||
| }; | ||
| var insertPolyfillHostInCssText = function (selector) { | ||
| selector = selector | ||
| .replace(_colonHostContextRe, _polyfillHostContext) | ||
| .replace(_colonHostRe, _polyfillHost) | ||
| .replace(_colonSlottedRe, _polyfillSlotted); | ||
| return selector; | ||
| }; | ||
| var convertColonRule = function (cssText, regExp, partReplacer) { | ||
| // m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule | ||
| return cssText.replace(regExp, function () { | ||
| var m = []; | ||
| for (var _i = 0; _i < arguments.length; _i++) { | ||
| m[_i] = arguments[_i]; | ||
| } | ||
| if (m[2]) { | ||
| var parts = m[2].split(','); | ||
| var r = []; | ||
| for (var i = 0; i < parts.length; i++) { | ||
| var p = parts[i].trim(); | ||
| if (!p) | ||
| break; | ||
| r.push(partReplacer(_polyfillHostNoCombinator, p, m[3])); | ||
| } | ||
| return r.join(','); | ||
| } | ||
| else { | ||
| return _polyfillHostNoCombinator + m[3]; | ||
| } | ||
| }); | ||
| }; | ||
| var colonHostPartReplacer = function (host, part, suffix) { | ||
| return host + part.replace(_polyfillHost, '') + suffix; | ||
| }; | ||
| var convertColonHost = function (cssText) { | ||
| return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer); | ||
| }; | ||
| var colonHostContextPartReplacer = function (host, part, suffix) { | ||
| if (part.indexOf(_polyfillHost) > -1) { | ||
| return colonHostPartReplacer(host, part, suffix); | ||
| } | ||
| else { | ||
| return host + part + suffix + ', ' + part + ' ' + host + suffix; | ||
| } | ||
| }; | ||
| var convertColonSlotted = function (cssText, slotScopeId) { | ||
| var slotClass = '.' + slotScopeId + ' > '; | ||
| var selectors = []; | ||
| cssText = cssText.replace(_cssColonSlottedRe, function () { | ||
| var m = []; | ||
| for (var _i = 0; _i < arguments.length; _i++) { | ||
| m[_i] = arguments[_i]; | ||
| } | ||
| if (m[2]) { | ||
| var compound = m[2].trim(); | ||
| var suffix = m[3]; | ||
| var slottedSelector = slotClass + compound + suffix; | ||
| var prefixSelector = ''; | ||
| for (var i = m[4] - 1; i >= 0; i--) { | ||
| var char = m[5][i]; | ||
| if (char === '}' || char === ',') { | ||
| break; | ||
| } | ||
| prefixSelector = char + prefixSelector; | ||
| } | ||
| var orgSelector = prefixSelector + slottedSelector; | ||
| var addedSelector = "" + prefixSelector.trimRight() + slottedSelector.trim(); | ||
| if (orgSelector.trim() !== addedSelector.trim()) { | ||
| var updatedSelector = addedSelector + ", " + orgSelector; | ||
| selectors.push({ | ||
| orgSelector: orgSelector, | ||
| updatedSelector: updatedSelector, | ||
| }); | ||
| } | ||
| return slottedSelector; | ||
| } | ||
| else { | ||
| return _polyfillHostNoCombinator + m[3]; | ||
| } | ||
| }); | ||
| return { | ||
| selectors: selectors, | ||
| cssText: cssText, | ||
| }; | ||
| }; | ||
| var convertColonHostContext = function (cssText) { | ||
| return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer); | ||
| }; | ||
| var convertShadowDOMSelectors = function (cssText) { | ||
| return _shadowDOMSelectorsRe.reduce(function (result, pattern) { return result.replace(pattern, ' '); }, cssText); | ||
| }; | ||
| var makeScopeMatcher = function (scopeSelector) { | ||
| var lre = /\[/g; | ||
| var rre = /\]/g; | ||
| scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]'); | ||
| return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm'); | ||
| }; | ||
| var selectorNeedsScoping = function (selector, scopeSelector) { | ||
| var re = makeScopeMatcher(scopeSelector); | ||
| return !re.test(selector); | ||
| }; | ||
| var applySimpleSelectorScope = function (selector, scopeSelector, hostSelector) { | ||
| // In Android browser, the lastIndex is not reset when the regex is used in String.replace() | ||
| _polyfillHostRe.lastIndex = 0; | ||
| if (_polyfillHostRe.test(selector)) { | ||
| var replaceBy_1 = "." + hostSelector; | ||
| return selector | ||
| .replace(_polyfillHostNoCombinatorRe, function (_, selector) { | ||
| return selector.replace(/([^:]*)(:*)(.*)/, function (_, before, colon, after) { | ||
| return before + replaceBy_1 + colon + after; | ||
| }); | ||
| }) | ||
| .replace(_polyfillHostRe, replaceBy_1 + ' '); | ||
| } | ||
| return scopeSelector + ' ' + selector; | ||
| }; | ||
| var applyStrictSelectorScope = function (selector, scopeSelector, hostSelector) { | ||
| var isRe = /\[is=([^\]]*)\]/g; | ||
| scopeSelector = scopeSelector.replace(isRe, function (_) { | ||
| var parts = []; | ||
| for (var _i = 1; _i < arguments.length; _i++) { | ||
| parts[_i - 1] = arguments[_i]; | ||
| } | ||
| return parts[0]; | ||
| }); | ||
| var className = '.' + scopeSelector; | ||
| var _scopeSelectorPart = function (p) { | ||
| var scopedP = p.trim(); | ||
| if (!scopedP) { | ||
| return ''; | ||
| } | ||
| if (p.indexOf(_polyfillHostNoCombinator) > -1) { | ||
| scopedP = applySimpleSelectorScope(p, scopeSelector, hostSelector); | ||
| } | ||
| else { | ||
| // remove :host since it should be unnecessary | ||
| var t = p.replace(_polyfillHostRe, ''); | ||
| if (t.length > 0) { | ||
| var matches = t.match(/([^:]*)(:*)(.*)/); | ||
| if (matches) { | ||
| scopedP = matches[1] + className + matches[2] + matches[3]; | ||
| } | ||
| } | ||
| } | ||
| return scopedP; | ||
| }; | ||
| var safeContent = safeSelector(selector); | ||
| selector = safeContent.content; | ||
| var scopedSelector = ''; | ||
| var startIndex = 0; | ||
| var res; | ||
| var sep = /( |>|\+|~(?!=))\s*/g; | ||
| // If a selector appears before :host it should not be shimmed as it | ||
| // matches on ancestor elements and not on elements in the host's shadow | ||
| // `:host-context(div)` is transformed to | ||
| // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator` | ||
| // the `div` is not part of the component in the 2nd selectors and should not be scoped. | ||
| // Historically `component-tag:host` was matching the component so we also want to preserve | ||
| // this behavior to avoid breaking legacy apps (it should not match). | ||
| // The behavior should be: | ||
| // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything) | ||
| // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a | ||
| // `:host-context(tag)`) | ||
| var hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1; | ||
| // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present | ||
| var shouldScope = !hasHost; | ||
| while ((res = sep.exec(selector)) !== null) { | ||
| var separator = res[1]; | ||
| var part_1 = selector.slice(startIndex, res.index).trim(); | ||
| shouldScope = shouldScope || part_1.indexOf(_polyfillHostNoCombinator) > -1; | ||
| var scopedPart = shouldScope ? _scopeSelectorPart(part_1) : part_1; | ||
| scopedSelector += scopedPart + " " + separator + " "; | ||
| startIndex = sep.lastIndex; | ||
| } | ||
| var part = selector.substring(startIndex); | ||
| shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1; | ||
| scopedSelector += shouldScope ? _scopeSelectorPart(part) : part; | ||
| // replace the placeholders with their original values | ||
| return restoreSafeSelector(safeContent.placeholders, scopedSelector); | ||
| }; | ||
| var scopeSelector = function (selector, scopeSelectorText, hostSelector, slotSelector) { | ||
| return selector | ||
| .split(',') | ||
| .map(function (shallowPart) { | ||
| if (slotSelector && shallowPart.indexOf('.' + slotSelector) > -1) { | ||
| return shallowPart.trim(); | ||
| } | ||
| if (selectorNeedsScoping(shallowPart, scopeSelectorText)) { | ||
| return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim(); | ||
| } | ||
| else { | ||
| return shallowPart.trim(); | ||
| } | ||
| }) | ||
| .join(', '); | ||
| }; | ||
| var scopeSelectors = function (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) { | ||
| return processRules(cssText, function (rule) { | ||
| var selector = rule.selector; | ||
| var content = rule.content; | ||
| if (rule.selector[0] !== '@') { | ||
| selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector); | ||
| } | ||
| else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') || rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) { | ||
| content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector); | ||
| } | ||
| var cssRule = { | ||
| selector: selector.replace(/\s{2,}/g, ' ').trim(), | ||
| content: content, | ||
| }; | ||
| return cssRule; | ||
| }); | ||
| }; | ||
| var scopeCssText = function (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) { | ||
| cssText = insertPolyfillHostInCssText(cssText); | ||
| cssText = convertColonHost(cssText); | ||
| cssText = convertColonHostContext(cssText); | ||
| var slotted = convertColonSlotted(cssText, slotScopeId); | ||
| cssText = slotted.cssText; | ||
| cssText = convertShadowDOMSelectors(cssText); | ||
| if (scopeId) { | ||
| cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId); | ||
| } | ||
| cssText = cssText.replace(/-shadowcsshost-no-combinator/g, "." + hostScopeId); | ||
| cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, ' $1 '); | ||
| return { | ||
| cssText: cssText.trim(), | ||
| slottedSelectors: slotted.selectors, | ||
| }; | ||
| }; | ||
| var scopeCss = function (cssText, scopeId, commentOriginalSelector) { | ||
| var hostScopeId = scopeId + '-h'; | ||
| var slotScopeId = scopeId + '-s'; | ||
| var commentsWithHash = extractCommentsWithHash(cssText); | ||
| cssText = stripComments(cssText); | ||
| var orgSelectors = []; | ||
| if (commentOriginalSelector) { | ||
| var processCommentedSelector_1 = function (rule) { | ||
| var placeholder = "/*!@___" + orgSelectors.length + "___*/"; | ||
| var comment = "/*!@" + rule.selector + "*/"; | ||
| orgSelectors.push({ placeholder: placeholder, comment: comment }); | ||
| rule.selector = placeholder + rule.selector; | ||
| return rule; | ||
| }; | ||
| cssText = processRules(cssText, function (rule) { | ||
| if (rule.selector[0] !== '@') { | ||
| return processCommentedSelector_1(rule); | ||
| } | ||
| else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') || rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) { | ||
| rule.content = processRules(rule.content, processCommentedSelector_1); | ||
| return rule; | ||
| } | ||
| return rule; | ||
| }); | ||
| } | ||
| var scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId); | ||
| cssText = __spreadArrays([scoped.cssText], commentsWithHash).join('\n'); | ||
| if (commentOriginalSelector) { | ||
| orgSelectors.forEach(function (_a) { | ||
| var placeholder = _a.placeholder, comment = _a.comment; | ||
| cssText = cssText.replace(placeholder, comment); | ||
| }); | ||
| } | ||
| scoped.slottedSelectors.forEach(function (slottedSelector) { | ||
| cssText = cssText.replace(slottedSelector.orgSelector, slottedSelector.updatedSelector); | ||
| }); | ||
| return cssText; | ||
| }; | ||
| export { scopeCss }; |
| /* | ||
| Stencil Client Patch v1.17.3 | MIT Licensed | https://stenciljs.com | ||
| */ | ||
| var StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector="";};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r);}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE;}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return "\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@";function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return {start:s,end:s+n[0].length}}return null}var VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return {start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t);}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else {if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s);}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value;}));}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0);})),!t)return "break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return [];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t});})),t++;})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o});}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.substr(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement;}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors);})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return ":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return {original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return !1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t));}));}function reScope(e,t){var r=e.template.map((function(r){return "string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return Object.assign(Object.assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return Object.assign(Object.assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\."+t,"."+r)}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t);}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t);})).observe(document.head,{childList:!0});}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove();}})).catch((function(e){console.error(e);}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1;}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}));}));})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal();}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal();},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t=s.scopeId+"-"+this.count,o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e);},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n);}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes);},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document));}("undefined"!=typeof window&&window); |
| /* | ||
| Stencil Client Patch v1.17.3 | MIT Licensed | https://stenciljs.com | ||
| */ | ||
| (function(){ | ||
| var aa=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function g(a){var b=aa.has(a);a=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(a);return !b&&a}function l(a){var b=a.isConnected;if(void 0!==b)return b;for(;a&&!(a.__CE_isImportDocument||a instanceof Document);)a=a.parentNode||(window.ShadowRoot&&a instanceof ShadowRoot?a.host:void 0);return !(!a||!(a.__CE_isImportDocument||a instanceof Document))} | ||
| function n(a,b){for(;b&&b!==a&&!b.nextSibling;)b=b.parentNode;return b&&b!==a?b.nextSibling:null} | ||
| function p(a,b,d){d=void 0===d?new Set:d;for(var c=a;c;){if(c.nodeType===Node.ELEMENT_NODE){var e=c;b(e);var f=e.localName;if("link"===f&&"import"===e.getAttribute("rel")){c=e.import;if(c instanceof Node&&!d.has(c))for(d.add(c),c=c.firstChild;c;c=c.nextSibling)p(c,b,d);c=n(a,e);continue}else if("template"===f){c=n(a,e);continue}if(e=e.__CE_shadowRoot)for(e=e.firstChild;e;e=e.nextSibling)p(e,b,d);}c=c.firstChild?c.firstChild:n(a,c);}}function r(a,b,d){a[b]=d;}function u(){this.a=new Map;this.g=new Map;this.c=[];this.f=[];this.b=!1;}function ba(a,b,d){a.a.set(b,d);a.g.set(d.constructorFunction,d);}function ca(a,b){a.b=!0;a.c.push(b);}function da(a,b){a.b=!0;a.f.push(b);}function v(a,b){a.b&&p(b,function(b){return w(a,b)});}function w(a,b){if(a.b&&!b.__CE_patched){b.__CE_patched=!0;for(var d=0;d<a.c.length;d++)a.c[d](b);for(d=0;d<a.f.length;d++)a.f[d](b);}} | ||
| function x(a,b){var d=[];p(b,function(b){return d.push(b)});for(b=0;b<d.length;b++){var c=d[b];1===c.__CE_state?a.connectedCallback(c):y(a,c);}}function z(a,b){var d=[];p(b,function(b){return d.push(b)});for(b=0;b<d.length;b++){var c=d[b];1===c.__CE_state&&a.disconnectedCallback(c);}} | ||
| function A(a,b,d){d=void 0===d?{}:d;var c=d.u||new Set,e=d.i||function(b){return y(a,b)},f=[];p(b,function(b){if("link"===b.localName&&"import"===b.getAttribute("rel")){var d=b.import;d instanceof Node&&(d.__CE_isImportDocument=!0,d.__CE_hasRegistry=!0);d&&"complete"===d.readyState?d.__CE_documentLoadHandled=!0:b.addEventListener("load",function(){var d=b.import;if(!d.__CE_documentLoadHandled){d.__CE_documentLoadHandled=!0;var f=new Set(c);f.delete(d);A(a,d,{u:f,i:e});}});}else f.push(b);},c);if(a.b)for(b= | ||
| 0;b<f.length;b++)w(a,f[b]);for(b=0;b<f.length;b++)e(f[b]);} | ||
| function y(a,b){if(void 0===b.__CE_state){var d=b.ownerDocument;if(d.defaultView||d.__CE_isImportDocument&&d.__CE_hasRegistry)if(d=a.a.get(b.localName)){d.constructionStack.push(b);var c=d.constructorFunction;try{try{if(new c!==b)throw Error("The custom element constructor did not produce the element being upgraded.");}finally{d.constructionStack.pop();}}catch(t){throw b.__CE_state=2,t;}b.__CE_state=1;b.__CE_definition=d;if(d.attributeChangedCallback)for(d=d.observedAttributes,c=0;c<d.length;c++){var e= | ||
| d[c],f=b.getAttribute(e);null!==f&&a.attributeChangedCallback(b,e,null,f,null);}l(b)&&a.connectedCallback(b);}}}u.prototype.connectedCallback=function(a){var b=a.__CE_definition;b.connectedCallback&&b.connectedCallback.call(a);};u.prototype.disconnectedCallback=function(a){var b=a.__CE_definition;b.disconnectedCallback&&b.disconnectedCallback.call(a);}; | ||
| u.prototype.attributeChangedCallback=function(a,b,d,c,e){var f=a.__CE_definition;f.attributeChangedCallback&&-1<f.observedAttributes.indexOf(b)&&f.attributeChangedCallback.call(a,b,d,c,e);};function B(a){var b=document;this.c=a;this.a=b;this.b=void 0;A(this.c,this.a);"loading"===this.a.readyState&&(this.b=new MutationObserver(this.f.bind(this)),this.b.observe(this.a,{childList:!0,subtree:!0}));}function C(a){a.b&&a.b.disconnect();}B.prototype.f=function(a){var b=this.a.readyState;"interactive"!==b&&"complete"!==b||C(this);for(b=0;b<a.length;b++)for(var d=a[b].addedNodes,c=0;c<d.length;c++)A(this.c,d[c]);};function ea(){var a=this;this.b=this.a=void 0;this.c=new Promise(function(b){a.b=b;a.a&&b(a.a);});}function D(a){if(a.a)throw Error("Already resolved.");a.a=void 0;a.b&&a.b(void 0);}function E(a){this.c=!1;this.a=a;this.j=new Map;this.f=function(b){return b()};this.b=!1;this.g=[];this.o=new B(a);} | ||
| E.prototype.l=function(a,b){var d=this;if(!(b instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!g(a))throw new SyntaxError("The element name '"+a+"' is not valid.");if(this.a.a.get(a))throw Error("A custom element with name '"+a+"' has already been defined.");if(this.c)throw Error("A custom element is already being defined.");this.c=!0;try{var c=function(b){var a=e[b];if(void 0!==a&&!(a instanceof Function))throw Error("The '"+b+"' callback must be a function."); | ||
| return a},e=b.prototype;if(!(e instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");var f=c("connectedCallback");var t=c("disconnectedCallback");var k=c("adoptedCallback");var h=c("attributeChangedCallback");var m=b.observedAttributes||[];}catch(q){return}finally{this.c=!1;}b={localName:a,constructorFunction:b,connectedCallback:f,disconnectedCallback:t,adoptedCallback:k,attributeChangedCallback:h,observedAttributes:m,constructionStack:[]};ba(this.a, | ||
| a,b);this.g.push(b);this.b||(this.b=!0,this.f(function(){return fa(d)}));};E.prototype.i=function(a){A(this.a,a);}; | ||
| function fa(a){if(!1!==a.b){a.b=!1;for(var b=a.g,d=[],c=new Map,e=0;e<b.length;e++)c.set(b[e].localName,[]);A(a.a,document,{i:function(b){if(void 0===b.__CE_state){var e=b.localName,f=c.get(e);f?f.push(b):a.a.a.get(e)&&d.push(b);}}});for(e=0;e<d.length;e++)y(a.a,d[e]);for(;0<b.length;){var f=b.shift();e=f.localName;f=c.get(f.localName);for(var t=0;t<f.length;t++)y(a.a,f[t]);(e=a.j.get(e))&&D(e);}}}E.prototype.get=function(a){if(a=this.a.a.get(a))return a.constructorFunction}; | ||
| E.prototype.m=function(a){if(!g(a))return Promise.reject(new SyntaxError("'"+a+"' is not a valid custom element name."));var b=this.j.get(a);if(b)return b.c;b=new ea;this.j.set(a,b);this.a.a.get(a)&&!this.g.some(function(b){return b.localName===a})&&D(b);return b.c};E.prototype.s=function(a){C(this.o);var b=this.f;this.f=function(d){return a(function(){return b(d)})};};window.CustomElementRegistry=E;E.prototype.define=E.prototype.l;E.prototype.upgrade=E.prototype.i;E.prototype.get=E.prototype.get; | ||
| E.prototype.whenDefined=E.prototype.m;E.prototype.polyfillWrapFlushCallback=E.prototype.s;var F=window.Document.prototype.createElement,G=window.Document.prototype.createElementNS,ha=window.Document.prototype.importNode,ia=window.Document.prototype.prepend,ja=window.Document.prototype.append,ka=window.DocumentFragment.prototype.prepend,la=window.DocumentFragment.prototype.append,H=window.Node.prototype.cloneNode,I=window.Node.prototype.appendChild,J=window.Node.prototype.insertBefore,K=window.Node.prototype.removeChild,L=window.Node.prototype.replaceChild,M=Object.getOwnPropertyDescriptor(window.Node.prototype, | ||
| "textContent"),N=window.Element.prototype.attachShadow,O=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),P=window.Element.prototype.getAttribute,Q=window.Element.prototype.setAttribute,R=window.Element.prototype.removeAttribute,S=window.Element.prototype.getAttributeNS,T=window.Element.prototype.setAttributeNS,U=window.Element.prototype.removeAttributeNS,ma=window.Element.prototype.insertAdjacentElement,na=window.Element.prototype.insertAdjacentHTML,oa=window.Element.prototype.prepend, | ||
| pa=window.Element.prototype.append,V=window.Element.prototype.before,qa=window.Element.prototype.after,ra=window.Element.prototype.replaceWith,sa=window.Element.prototype.remove,ta=window.HTMLElement,W=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),ua=window.HTMLElement.prototype.insertAdjacentElement,va=window.HTMLElement.prototype.insertAdjacentHTML;var wa=new function(){};function xa(){var a=X;window.HTMLElement=function(){function b(){var b=this.constructor,c=a.g.get(b);if(!c)throw Error("The custom element being constructed was not registered with `customElements`.");var e=c.constructionStack;if(0===e.length)return e=F.call(document,c.localName),Object.setPrototypeOf(e,b.prototype),e.__CE_state=1,e.__CE_definition=c,w(a,e),e;c=e.length-1;var f=e[c];if(f===wa)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times."); | ||
| e[c]=wa;Object.setPrototypeOf(f,b.prototype);w(a,f);return f}b.prototype=ta.prototype;Object.defineProperty(b.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:b});return b}();}function Y(a,b,d){function c(b){return function(d){for(var e=[],c=0;c<arguments.length;++c)e[c]=arguments[c];c=[];for(var f=[],m=0;m<e.length;m++){var q=e[m];q instanceof Element&&l(q)&&f.push(q);if(q instanceof DocumentFragment)for(q=q.firstChild;q;q=q.nextSibling)c.push(q);else c.push(q);}b.apply(this,e);for(e=0;e<f.length;e++)z(a,f[e]);if(l(this))for(e=0;e<c.length;e++)f=c[e],f instanceof Element&&x(a,f);}}void 0!==d.h&&(b.prepend=c(d.h));void 0!==d.append&&(b.append=c(d.append));}function ya(){var a=X;r(Document.prototype,"createElement",function(b){if(this.__CE_hasRegistry){var d=a.a.get(b);if(d)return new d.constructorFunction}b=F.call(this,b);w(a,b);return b});r(Document.prototype,"importNode",function(b,d){b=ha.call(this,b,!!d);this.__CE_hasRegistry?A(a,b):v(a,b);return b});r(Document.prototype,"createElementNS",function(b,d){if(this.__CE_hasRegistry&&(null===b||"http://www.w3.org/1999/xhtml"===b)){var c=a.a.get(d);if(c)return new c.constructorFunction}b=G.call(this,b, | ||
| d);w(a,b);return b});Y(a,Document.prototype,{h:ia,append:ja});}function za(){function a(a,c){Object.defineProperty(a,"textContent",{enumerable:c.enumerable,configurable:!0,get:c.get,set:function(a){if(this.nodeType===Node.TEXT_NODE)c.set.call(this,a);else {var d=void 0;if(this.firstChild){var e=this.childNodes,k=e.length;if(0<k&&l(this)){d=Array(k);for(var h=0;h<k;h++)d[h]=e[h];}}c.set.call(this,a);if(d)for(a=0;a<d.length;a++)z(b,d[a]);}}});}var b=X;r(Node.prototype,"insertBefore",function(a,c){if(a instanceof DocumentFragment){var e=Array.prototype.slice.apply(a.childNodes); | ||
| a=J.call(this,a,c);if(l(this))for(c=0;c<e.length;c++)x(b,e[c]);return a}e=l(a);c=J.call(this,a,c);e&&z(b,a);l(this)&&x(b,a);return c});r(Node.prototype,"appendChild",function(a){if(a instanceof DocumentFragment){var c=Array.prototype.slice.apply(a.childNodes);a=I.call(this,a);if(l(this))for(var e=0;e<c.length;e++)x(b,c[e]);return a}c=l(a);e=I.call(this,a);c&&z(b,a);l(this)&&x(b,a);return e});r(Node.prototype,"cloneNode",function(a){a=H.call(this,!!a);this.ownerDocument.__CE_hasRegistry?A(b,a):v(b, | ||
| a);return a});r(Node.prototype,"removeChild",function(a){var c=l(a),e=K.call(this,a);c&&z(b,a);return e});r(Node.prototype,"replaceChild",function(a,c){if(a instanceof DocumentFragment){var e=Array.prototype.slice.apply(a.childNodes);a=L.call(this,a,c);if(l(this))for(z(b,c),c=0;c<e.length;c++)x(b,e[c]);return a}e=l(a);var f=L.call(this,a,c),d=l(this);d&&z(b,c);e&&z(b,a);d&&x(b,a);return f});M&&M.get?a(Node.prototype,M):ca(b,function(b){a(b,{enumerable:!0,configurable:!0,get:function(){for(var a=[], | ||
| b=0;b<this.childNodes.length;b++){var f=this.childNodes[b];f.nodeType!==Node.COMMENT_NODE&&a.push(f.textContent);}return a.join("")},set:function(a){for(;this.firstChild;)K.call(this,this.firstChild);null!=a&&""!==a&&I.call(this,document.createTextNode(a));}});});}function Aa(a){function b(b){return function(e){for(var c=[],d=0;d<arguments.length;++d)c[d]=arguments[d];d=[];for(var k=[],h=0;h<c.length;h++){var m=c[h];m instanceof Element&&l(m)&&k.push(m);if(m instanceof DocumentFragment)for(m=m.firstChild;m;m=m.nextSibling)d.push(m);else d.push(m);}b.apply(this,c);for(c=0;c<k.length;c++)z(a,k[c]);if(l(this))for(c=0;c<d.length;c++)k=d[c],k instanceof Element&&x(a,k);}}var d=Element.prototype;void 0!==V&&(d.before=b(V));void 0!==V&&(d.after=b(qa));void 0!==ra&& | ||
| r(d,"replaceWith",function(b){for(var e=[],c=0;c<arguments.length;++c)e[c]=arguments[c];c=[];for(var d=[],k=0;k<e.length;k++){var h=e[k];h instanceof Element&&l(h)&&d.push(h);if(h instanceof DocumentFragment)for(h=h.firstChild;h;h=h.nextSibling)c.push(h);else c.push(h);}k=l(this);ra.apply(this,e);for(e=0;e<d.length;e++)z(a,d[e]);if(k)for(z(a,this),e=0;e<c.length;e++)d=c[e],d instanceof Element&&x(a,d);});void 0!==sa&&r(d,"remove",function(){var b=l(this);sa.call(this);b&&z(a,this);});}function Ba(){function a(a,b){Object.defineProperty(a,"innerHTML",{enumerable:b.enumerable,configurable:!0,get:b.get,set:function(a){var e=this,d=void 0;l(this)&&(d=[],p(this,function(a){a!==e&&d.push(a);}));b.set.call(this,a);if(d)for(var f=0;f<d.length;f++){var t=d[f];1===t.__CE_state&&c.disconnectedCallback(t);}this.ownerDocument.__CE_hasRegistry?A(c,this):v(c,this);return a}});}function b(a,b){r(a,"insertAdjacentElement",function(a,e){var d=l(e);a=b.call(this,a,e);d&&z(c,e);l(a)&&x(c,e);return a});} | ||
| function d(a,b){function e(a,b){for(var e=[];a!==b;a=a.nextSibling)e.push(a);for(b=0;b<e.length;b++)A(c,e[b]);}r(a,"insertAdjacentHTML",function(a,c){a=a.toLowerCase();if("beforebegin"===a){var d=this.previousSibling;b.call(this,a,c);e(d||this.parentNode.firstChild,this);}else if("afterbegin"===a)d=this.firstChild,b.call(this,a,c),e(this.firstChild,d);else if("beforeend"===a)d=this.lastChild,b.call(this,a,c),e(d||this.firstChild,null);else if("afterend"===a)d=this.nextSibling,b.call(this,a,c),e(this.nextSibling, | ||
| d);else throw new SyntaxError("The value provided ("+String(a)+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");});}var c=X;N&&r(Element.prototype,"attachShadow",function(a){a=N.call(this,a);var b=c;if(b.b&&!a.__CE_patched){a.__CE_patched=!0;for(var e=0;e<b.c.length;e++)b.c[e](a);}return this.__CE_shadowRoot=a});O&&O.get?a(Element.prototype,O):W&&W.get?a(HTMLElement.prototype,W):da(c,function(b){a(b,{enumerable:!0,configurable:!0,get:function(){return H.call(this,!0).innerHTML}, | ||
| set:function(a){var b="template"===this.localName,c=b?this.content:this,e=G.call(document,this.namespaceURI,this.localName);for(e.innerHTML=a;0<c.childNodes.length;)K.call(c,c.childNodes[0]);for(a=b?e.content:e;0<a.childNodes.length;)I.call(c,a.childNodes[0]);}});});r(Element.prototype,"setAttribute",function(a,b){if(1!==this.__CE_state)return Q.call(this,a,b);var e=P.call(this,a);Q.call(this,a,b);b=P.call(this,a);c.attributeChangedCallback(this,a,e,b,null);});r(Element.prototype,"setAttributeNS",function(a, | ||
| b,d){if(1!==this.__CE_state)return T.call(this,a,b,d);var e=S.call(this,a,b);T.call(this,a,b,d);d=S.call(this,a,b);c.attributeChangedCallback(this,b,e,d,a);});r(Element.prototype,"removeAttribute",function(a){if(1!==this.__CE_state)return R.call(this,a);var b=P.call(this,a);R.call(this,a);null!==b&&c.attributeChangedCallback(this,a,b,null,null);});r(Element.prototype,"removeAttributeNS",function(a,b){if(1!==this.__CE_state)return U.call(this,a,b);var d=S.call(this,a,b);U.call(this,a,b);var e=S.call(this, | ||
| a,b);d!==e&&c.attributeChangedCallback(this,b,d,e,a);});ua?b(HTMLElement.prototype,ua):ma?b(Element.prototype,ma):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched.");va?d(HTMLElement.prototype,va):na?d(Element.prototype,na):console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched.");Y(c,Element.prototype,{h:oa,append:pa});Aa(c);}var Z=window.customElements;if(!Z||Z.forcePolyfill||"function"!=typeof Z.define||"function"!=typeof Z.get){var X=new u;xa();ya();Y(X,DocumentFragment.prototype,{h:ka,append:la});za();Ba();document.__CE_hasRegistry=!0;var customElements=new E(X);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:customElements});}}).call(self); | ||
| // Polyfill document.baseURI | ||
| "string"!==typeof document.baseURI&&Object.defineProperty(Document.prototype,"baseURI",{enumerable:!0,configurable:!0,get:function(){var a=document.querySelector("base");return a&&a.href?a.href:document.URL}}); | ||
| // Polyfill CustomEvent | ||
| "function"!==typeof window.CustomEvent&&(window.CustomEvent=function(c,a){a=a||{bubbles:!1,cancelable:!1,detail:void 0};var b=document.createEvent("CustomEvent");b.initCustomEvent(c,a.bubbles,a.cancelable,a.detail);return b},window.CustomEvent.prototype=window.Event.prototype); | ||
| // Event.composedPath | ||
| (function(b,c,d){b.composedPath||(b.composedPath=function(){if(this.path)return this.path;var a=this.target;for(this.path=[];null!==a.parentNode;)this.path.push(a),a=a.parentNode;this.path.push(c,d);return this.path});})(Event.prototype,document,window); | ||
| /*! | ||
| Element.closest and Element.matches | ||
| https://github.com/jonathantneal/closest | ||
| Creative Commons Zero v1.0 Universal | ||
| */ | ||
| (function(a){"function"!==typeof a.matches&&(a.matches=a.msMatchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||function(a){a=(this.document||this.ownerDocument).querySelectorAll(a);for(var b=0;a[b]&&a[b]!==this;)++b;return !!a[b]});"function"!==typeof a.closest&&(a.closest=function(a){for(var b=this;b&&1===b.nodeType;){if(b.matches(a))return b;b=b.parentNode;}return null});})(window.Element.prototype); | ||
| /*! | ||
| Element.getRootNode() | ||
| */ | ||
| (function(c){function d(a){a=b(a);return a&&11===a.nodeType?d(a.host):a}function b(a){return a&&a.parentNode?b(a.parentNode):a}"function"!==typeof c.getRootNode&&(c.getRootNode=function(a){return a&&a.composed?d(this):b(this)});})(Element.prototype); | ||
| /*! | ||
| Element.isConnected() | ||
| */ | ||
| (function(a){"isConnected"in a||Object.defineProperty(a,"isConnected",{configurable:!0,enumerable:!0,get:function(){var a=this.getRootNode({composed:!0});return a&&9===a.nodeType}});})(Element.prototype); | ||
| /*! | ||
| Element.remove() | ||
| */ | ||
| (function(b){b.forEach(function(a){a.hasOwnProperty("remove")||Object.defineProperty(a,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this);}});});})([Element.prototype,CharacterData.prototype,DocumentType.prototype]); | ||
| /*! | ||
| Element.classList | ||
| */ | ||
| !function(e){'classList'in e||Object.defineProperty(e,"classList",{get:function(){var e=this,t=(e.getAttribute("class")||"").replace(/^\s+|\s$/g,"").split(/\s+/g);function n(){t.length>0?e.setAttribute("class",t.join(" ")):e.removeAttribute("class");}return ""===t[0]&&t.splice(0,1),t.toggle=function(e,i){void 0!==i?i?t.add(e):t.remove(e):-1!==t.indexOf(e)?t.splice(t.indexOf(e),1):t.push(e),n();},t.add=function(){for(var e=[].slice.call(arguments),i=0,s=e.length;i<s;i++)-1===t.indexOf(e[i])&&t.push(e[i]);n();},t.remove=function(){for(var e=[].slice.call(arguments),i=0,s=e.length;i<s;i++)-1!==t.indexOf(e[i])&&t.splice(t.indexOf(e[i]),1);n();},t.item=function(e){return t[e]},t.contains=function(e){return -1!==t.indexOf(e)},t.replace=function(e,i){-1!==t.indexOf(e)&&t.splice(t.indexOf(e),1,i),n();},t.value=e.getAttribute("class")||"",t}});}(Element.prototype); | ||
| /*! | ||
| DOMTokenList | ||
| */ | ||
| (function(b){try{document.body.classList.add();}catch(e){var c=b.add,d=b.remove;b.add=function(){for(var a=0;a<arguments.length;a++)c.call(this,arguments[a]);};b.remove=function(){for(var a=0;a<arguments.length;a++)d.call(this,arguments[a]);};}})(DOMTokenList.prototype); |
| const NAMESPACE = 'msf-editor'; | ||
| let scopeId; | ||
| let hostTagName; | ||
| let isSvgMode = false; | ||
| let queueCongestion = 0; | ||
| let queuePending = false; | ||
| const win = typeof window !== 'undefined' ? window : {}; | ||
| const CSS = win.CSS ; | ||
| const doc = win.document || { head: {} }; | ||
| const plt = { | ||
| $flags$: 0, | ||
| $resourcesUrl$: '', | ||
| jmp: h => h(), | ||
| raf: h => requestAnimationFrame(h), | ||
| ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts), | ||
| rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts), | ||
| ce: (eventName, opts) => new CustomEvent(eventName, opts), | ||
| }; | ||
| const supportsShadow = /*@__PURE__*/ (() => (doc.head.attachShadow + '').indexOf('[native') > -1)() ; | ||
| const promiseResolve = (v) => Promise.resolve(v); | ||
| const supportsConstructibleStylesheets = /*@__PURE__*/ (() => { | ||
| try { | ||
| new CSSStyleSheet(); | ||
| return true; | ||
| } | ||
| catch (e) { } | ||
| return false; | ||
| })() | ||
| ; | ||
| const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => { | ||
| if ( listeners) { | ||
| listeners.map(([flags, name, method]) => { | ||
| const target = getHostListenerTarget(elm, flags) ; | ||
| const handler = hostListenerProxy(hostRef, method); | ||
| const opts = hostListenerOpts(flags); | ||
| plt.ael(target, name, handler, opts); | ||
| (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts)); | ||
| }); | ||
| } | ||
| }; | ||
| const hostListenerProxy = (hostRef, methodName) => (ev) => { | ||
| { | ||
| if (hostRef.$flags$ & 256 /* isListenReady */) { | ||
| // instance is ready, let's call it's member method for this event | ||
| hostRef.$lazyInstance$[methodName](ev); | ||
| } | ||
| else { | ||
| (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]); | ||
| } | ||
| } | ||
| }; | ||
| const getHostListenerTarget = (elm, flags) => { | ||
| if ( flags & 8 /* TargetWindow */) | ||
| return win; | ||
| return elm; | ||
| }; | ||
| // prettier-ignore | ||
| const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0; | ||
| const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}'; | ||
| const createTime = (fnName, tagName = '') => { | ||
| { | ||
| return () => { | ||
| return; | ||
| }; | ||
| } | ||
| }; | ||
| const uniqueTime = (key, measureText) => { | ||
| { | ||
| return () => { | ||
| return; | ||
| }; | ||
| } | ||
| }; | ||
| const rootAppliedStyles = new WeakMap(); | ||
| const registerStyle = (scopeId, cssText, allowCS) => { | ||
| let style = styles.get(scopeId); | ||
| if (supportsConstructibleStylesheets && allowCS) { | ||
| style = (style || new CSSStyleSheet()); | ||
| style.replace(cssText); | ||
| } | ||
| else { | ||
| style = cssText; | ||
| } | ||
| styles.set(scopeId, style); | ||
| }; | ||
| const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => { | ||
| let scopeId = getScopeId(cmpMeta); | ||
| let style = styles.get(scopeId); | ||
| // if an element is NOT connected then getRootNode() will return the wrong root node | ||
| // so the fallback is to always use the document for the root node in those cases | ||
| styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc; | ||
| if (style) { | ||
| if (typeof style === 'string') { | ||
| styleContainerNode = styleContainerNode.head || styleContainerNode; | ||
| let appliedStyles = rootAppliedStyles.get(styleContainerNode); | ||
| let styleElm; | ||
| if (!appliedStyles) { | ||
| rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set())); | ||
| } | ||
| if (!appliedStyles.has(scopeId)) { | ||
| { | ||
| if ( plt.$cssShim$) { | ||
| styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style, !!(cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */)); | ||
| const newScopeId = styleElm['s-sc']; | ||
| if (newScopeId) { | ||
| scopeId = newScopeId; | ||
| // we don't want to add this styleID to the appliedStyles Set | ||
| // since the cssVarShim might need to apply several different | ||
| // stylesheets for the same component | ||
| appliedStyles = null; | ||
| } | ||
| } | ||
| else { | ||
| styleElm = doc.createElement('style'); | ||
| styleElm.innerHTML = style; | ||
| } | ||
| styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link')); | ||
| } | ||
| if (appliedStyles) { | ||
| appliedStyles.add(scopeId); | ||
| } | ||
| } | ||
| } | ||
| else if ( !styleContainerNode.adoptedStyleSheets.includes(style)) { | ||
| styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style]; | ||
| } | ||
| } | ||
| return scopeId; | ||
| }; | ||
| const attachStyles = (hostRef) => { | ||
| const cmpMeta = hostRef.$cmpMeta$; | ||
| const elm = hostRef.$hostElement$; | ||
| const flags = cmpMeta.$flags$; | ||
| const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$); | ||
| const scopeId = addStyle( supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$, elm); | ||
| if ( flags & 10 /* needsScopedEncapsulation */) { | ||
| // only required when we're NOT using native shadow dom (slot) | ||
| // or this browser doesn't support native shadow dom | ||
| // and this host element was NOT created with SSR | ||
| // let's pick out the inner content for slot projection | ||
| // create a node to represent where the original | ||
| // content was first placed, which is useful later on | ||
| // DOM WRITE!! | ||
| elm['s-sc'] = scopeId; | ||
| elm.classList.add(scopeId + '-h'); | ||
| } | ||
| endAttachStyles(); | ||
| }; | ||
| const getScopeId = (cmp, mode) => 'sc-' + ( cmp.$tagName$); | ||
| /** | ||
| * Default style mode id | ||
| */ | ||
| /** | ||
| * Reusable empty obj/array | ||
| * Don't add values to these!! | ||
| */ | ||
| const EMPTY_OBJ = {}; | ||
| const isDef = (v) => v != null; | ||
| const noop = () => { | ||
| /* noop*/ | ||
| }; | ||
| const isComplexType = (o) => { | ||
| // https://jsperf.com/typeof-fn-object/5 | ||
| o = typeof o; | ||
| return o === 'object' || o === 'function'; | ||
| }; | ||
| const IS_DENO_ENV = typeof Deno !== 'undefined'; | ||
| const IS_NODE_ENV = !IS_DENO_ENV && | ||
| typeof global !== 'undefined' && | ||
| typeof require === 'function' && | ||
| !!global.process && | ||
| typeof __filename === 'string' && | ||
| (!global.origin || typeof global.origin !== 'string'); | ||
| const IS_DENO_WINDOWS_ENV = IS_DENO_ENV && Deno.build.os === 'windows'; | ||
| const getCurrentDirectory = IS_NODE_ENV ? process.cwd : IS_DENO_ENV ? Deno.cwd : () => '/'; | ||
| const exit = IS_NODE_ENV ? process.exit : IS_DENO_ENV ? Deno.exit : noop; | ||
| /** | ||
| * Production h() function based on Preact by | ||
| * Jason Miller (@developit) | ||
| * Licensed under the MIT License | ||
| * https://github.com/developit/preact/blob/master/LICENSE | ||
| * | ||
| * Modified for Stencil's compiler and vdom | ||
| */ | ||
| // const stack: any[] = []; | ||
| // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode; | ||
| // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode; | ||
| const h = (nodeName, vnodeData, ...children) => { | ||
| let child = null; | ||
| let simple = false; | ||
| let lastSimple = false; | ||
| let vNodeChildren = []; | ||
| const walk = (c) => { | ||
| for (let i = 0; i < c.length; i++) { | ||
| child = c[i]; | ||
| if (Array.isArray(child)) { | ||
| walk(child); | ||
| } | ||
| else if (child != null && typeof child !== 'boolean') { | ||
| if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) { | ||
| child = String(child); | ||
| } | ||
| if (simple && lastSimple) { | ||
| // If the previous child was simple (string), we merge both | ||
| vNodeChildren[vNodeChildren.length - 1].$text$ += child; | ||
| } | ||
| else { | ||
| // Append a new vNode, if it's text, we create a text vNode | ||
| vNodeChildren.push(simple ? newVNode(null, child) : child); | ||
| } | ||
| lastSimple = simple; | ||
| } | ||
| } | ||
| }; | ||
| walk(children); | ||
| if (vnodeData) { | ||
| { | ||
| const classData = vnodeData.className || vnodeData.class; | ||
| if (classData) { | ||
| vnodeData.class = | ||
| typeof classData !== 'object' | ||
| ? classData | ||
| : Object.keys(classData) | ||
| .filter(k => classData[k]) | ||
| .join(' '); | ||
| } | ||
| } | ||
| } | ||
| const vnode = newVNode(nodeName, null); | ||
| vnode.$attrs$ = vnodeData; | ||
| if (vNodeChildren.length > 0) { | ||
| vnode.$children$ = vNodeChildren; | ||
| } | ||
| return vnode; | ||
| }; | ||
| const newVNode = (tag, text) => { | ||
| const vnode = { | ||
| $flags$: 0, | ||
| $tag$: tag, | ||
| $text$: text, | ||
| $elm$: null, | ||
| $children$: null, | ||
| }; | ||
| { | ||
| vnode.$attrs$ = null; | ||
| } | ||
| return vnode; | ||
| }; | ||
| const Host = {}; | ||
| const isHost = (node) => node && node.$tag$ === Host; | ||
| /** | ||
| * Production setAccessor() function based on Preact by | ||
| * Jason Miller (@developit) | ||
| * Licensed under the MIT License | ||
| * https://github.com/developit/preact/blob/master/LICENSE | ||
| * | ||
| * Modified for Stencil's compiler and vdom | ||
| */ | ||
| const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => { | ||
| if (oldValue !== newValue) { | ||
| let isProp = isMemberInElement(elm, memberName); | ||
| let ln = memberName.toLowerCase(); | ||
| if ( memberName === 'class') { | ||
| const classList = elm.classList; | ||
| const oldClasses = parseClassList(oldValue); | ||
| const newClasses = parseClassList(newValue); | ||
| classList.remove(...oldClasses.filter(c => c && !newClasses.includes(c))); | ||
| classList.add(...newClasses.filter(c => c && !oldClasses.includes(c))); | ||
| } | ||
| else { | ||
| // Set property if it exists and it's not a SVG | ||
| const isComplex = isComplexType(newValue); | ||
| if ((isProp || (isComplex && newValue !== null)) && !isSvg) { | ||
| try { | ||
| if (!elm.tagName.includes('-')) { | ||
| let n = newValue == null ? '' : newValue; | ||
| // Workaround for Safari, moving the <input> caret when re-assigning the same valued | ||
| if (memberName === 'list') { | ||
| isProp = false; | ||
| // tslint:disable-next-line: triple-equals | ||
| } | ||
| else if (oldValue == null || elm[memberName] != n) { | ||
| elm[memberName] = n; | ||
| } | ||
| } | ||
| else { | ||
| elm[memberName] = newValue; | ||
| } | ||
| } | ||
| catch (e) { } | ||
| } | ||
| if (newValue == null || newValue === false) { | ||
| if (newValue !== false || elm.getAttribute(memberName) === '') { | ||
| { | ||
| elm.removeAttribute(memberName); | ||
| } | ||
| } | ||
| } | ||
| else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) { | ||
| newValue = newValue === true ? '' : newValue; | ||
| { | ||
| elm.setAttribute(memberName, newValue); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| const parseClassListRegex = /\s/; | ||
| const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex)); | ||
| const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => { | ||
| // if the element passed in is a shadow root, which is a document fragment | ||
| // then we want to be adding attrs/props to the shadow root's "host" element | ||
| // if it's not a shadow root, then we add attrs/props to the same element | ||
| const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$; | ||
| const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ; | ||
| const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ; | ||
| { | ||
| // remove attributes no longer present on the vnode by setting them to undefined | ||
| for (memberName in oldVnodeAttrs) { | ||
| if (!(memberName in newVnodeAttrs)) { | ||
| setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$); | ||
| } | ||
| } | ||
| } | ||
| // add new & update changed attributes | ||
| for (memberName in newVnodeAttrs) { | ||
| setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$); | ||
| } | ||
| }; | ||
| const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => { | ||
| // tslint:disable-next-line: prefer-const | ||
| let newVNode = newParentVNode.$children$[childIndex]; | ||
| let i = 0; | ||
| let elm; | ||
| let childNode; | ||
| { | ||
| // create element | ||
| elm = newVNode.$elm$ = ( doc.createElement( newVNode.$tag$)); | ||
| // add css classes, attrs, props, listeners, etc. | ||
| { | ||
| updateElement(null, newVNode, isSvgMode); | ||
| } | ||
| if ( isDef(scopeId) && elm['s-si'] !== scopeId) { | ||
| // if there is a scopeId and this is the initial render | ||
| // then let's add the scopeId as a css class | ||
| elm.classList.add((elm['s-si'] = scopeId)); | ||
| } | ||
| if (newVNode.$children$) { | ||
| for (i = 0; i < newVNode.$children$.length; ++i) { | ||
| // create the node | ||
| childNode = createElm(oldParentVNode, newVNode, i); | ||
| // return node could have been null | ||
| if (childNode) { | ||
| // append our new node | ||
| elm.appendChild(childNode); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| return elm; | ||
| }; | ||
| const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => { | ||
| let containerElm = ( parentElm); | ||
| let childNode; | ||
| if ( containerElm.shadowRoot && containerElm.tagName === hostTagName) { | ||
| containerElm = containerElm.shadowRoot; | ||
| } | ||
| for (; startIdx <= endIdx; ++startIdx) { | ||
| if (vnodes[startIdx]) { | ||
| childNode = createElm(null, parentVNode, startIdx); | ||
| if (childNode) { | ||
| vnodes[startIdx].$elm$ = childNode; | ||
| containerElm.insertBefore(childNode, before); | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => { | ||
| for (; startIdx <= endIdx; ++startIdx) { | ||
| if ((vnode = vnodes[startIdx])) { | ||
| elm = vnode.$elm$; | ||
| // remove the vnode's element from the dom | ||
| elm.remove(); | ||
| } | ||
| } | ||
| }; | ||
| const updateChildren = (parentElm, oldCh, newVNode, newCh) => { | ||
| let oldStartIdx = 0; | ||
| let newStartIdx = 0; | ||
| let oldEndIdx = oldCh.length - 1; | ||
| let oldStartVnode = oldCh[0]; | ||
| let oldEndVnode = oldCh[oldEndIdx]; | ||
| let newEndIdx = newCh.length - 1; | ||
| let newStartVnode = newCh[0]; | ||
| let newEndVnode = newCh[newEndIdx]; | ||
| let node; | ||
| while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { | ||
| if (oldStartVnode == null) { | ||
| // Vnode might have been moved left | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| } | ||
| else if (oldEndVnode == null) { | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| } | ||
| else if (newStartVnode == null) { | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else if (newEndVnode == null) { | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldStartVnode, newStartVnode)) { | ||
| patch(oldStartVnode, newStartVnode); | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else if (isSameVnode(oldEndVnode, newEndVnode)) { | ||
| patch(oldEndVnode, newEndVnode); | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldStartVnode, newEndVnode)) { | ||
| patch(oldStartVnode, newEndVnode); | ||
| parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling); | ||
| oldStartVnode = oldCh[++oldStartIdx]; | ||
| newEndVnode = newCh[--newEndIdx]; | ||
| } | ||
| else if (isSameVnode(oldEndVnode, newStartVnode)) { | ||
| patch(oldEndVnode, newStartVnode); | ||
| parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$); | ||
| oldEndVnode = oldCh[--oldEndIdx]; | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| else { | ||
| { | ||
| // new element | ||
| node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx); | ||
| newStartVnode = newCh[++newStartIdx]; | ||
| } | ||
| if (node) { | ||
| { | ||
| oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| if (oldStartIdx > oldEndIdx) { | ||
| addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx); | ||
| } | ||
| else if ( newStartIdx > newEndIdx) { | ||
| removeVnodes(oldCh, oldStartIdx, oldEndIdx); | ||
| } | ||
| }; | ||
| const isSameVnode = (vnode1, vnode2) => { | ||
| // compare if two vnode to see if they're "technically" the same | ||
| // need to have the same element tag, and same key to be the same | ||
| if (vnode1.$tag$ === vnode2.$tag$) { | ||
| return true; | ||
| } | ||
| return false; | ||
| }; | ||
| const patch = (oldVNode, newVNode) => { | ||
| const elm = (newVNode.$elm$ = oldVNode.$elm$); | ||
| const oldChildren = oldVNode.$children$; | ||
| const newChildren = newVNode.$children$; | ||
| { | ||
| // element node | ||
| { | ||
| { | ||
| // either this is the first render of an element OR it's an update | ||
| // AND we already know it's possible it could have changed | ||
| // this updates the element's css classes, attrs, props, listeners, etc. | ||
| updateElement(oldVNode, newVNode, isSvgMode); | ||
| } | ||
| } | ||
| if ( oldChildren !== null && newChildren !== null) { | ||
| // looks like there's child vnodes for both the old and new vnodes | ||
| updateChildren(elm, oldChildren, newVNode, newChildren); | ||
| } | ||
| else if (newChildren !== null) { | ||
| // add the new vnode children | ||
| addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1); | ||
| } | ||
| else if ( oldChildren !== null) { | ||
| // no new child vnodes, but there are old child vnodes to remove | ||
| removeVnodes(oldChildren, 0, oldChildren.length - 1); | ||
| } | ||
| } | ||
| }; | ||
| const renderVdom = (hostRef, renderFnResults) => { | ||
| const hostElm = hostRef.$hostElement$; | ||
| const oldVNode = hostRef.$vnode$ || newVNode(null, null); | ||
| const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults); | ||
| hostTagName = hostElm.tagName; | ||
| rootVnode.$tag$ = null; | ||
| rootVnode.$flags$ |= 4 /* isHost */; | ||
| hostRef.$vnode$ = rootVnode; | ||
| rootVnode.$elm$ = oldVNode.$elm$ = ( hostElm.shadowRoot || hostElm ); | ||
| { | ||
| scopeId = hostElm['s-sc']; | ||
| } | ||
| // synchronous patch | ||
| patch(oldVNode, rootVnode); | ||
| }; | ||
| const getElement = (ref) => ( getHostRef(ref).$hostElement$ ); | ||
| const createEvent = (ref, name, flags) => { | ||
| const elm = getElement(ref); | ||
| return { | ||
| emit: (detail) => { | ||
| return emitEvent(elm, name, { | ||
| bubbles: !!(flags & 4 /* Bubbles */), | ||
| composed: !!(flags & 2 /* Composed */), | ||
| cancelable: !!(flags & 1 /* Cancellable */), | ||
| detail, | ||
| }); | ||
| }, | ||
| }; | ||
| }; | ||
| const emitEvent = (elm, name, opts) => { | ||
| const ev = plt.ce(name, opts); | ||
| elm.dispatchEvent(ev); | ||
| return ev; | ||
| }; | ||
| const attachToAncestor = (hostRef, ancestorComponent) => { | ||
| if ( ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) { | ||
| ancestorComponent['s-p'].push(new Promise(r => (hostRef.$onRenderResolve$ = r))); | ||
| } | ||
| }; | ||
| const scheduleUpdate = (hostRef, isInitialLoad) => { | ||
| { | ||
| hostRef.$flags$ |= 16 /* isQueuedForUpdate */; | ||
| } | ||
| if ( hostRef.$flags$ & 4 /* isWaitingForChildren */) { | ||
| hostRef.$flags$ |= 512 /* needsRerender */; | ||
| return; | ||
| } | ||
| attachToAncestor(hostRef, hostRef.$ancestorComponent$); | ||
| // there is no ancestorc omponent or the ancestor component | ||
| // has already fired off its lifecycle update then | ||
| // fire off the initial update | ||
| const dispatch = () => dispatchHooks(hostRef, isInitialLoad); | ||
| return writeTask(dispatch) ; | ||
| }; | ||
| const dispatchHooks = (hostRef, isInitialLoad) => { | ||
| const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$); | ||
| const instance = hostRef.$lazyInstance$ ; | ||
| let promise; | ||
| if (isInitialLoad) { | ||
| { | ||
| hostRef.$flags$ |= 256 /* isListenReady */; | ||
| if (hostRef.$queuedListeners$) { | ||
| hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event)); | ||
| hostRef.$queuedListeners$ = null; | ||
| } | ||
| } | ||
| { | ||
| promise = safeCall(instance, 'componentWillLoad'); | ||
| } | ||
| } | ||
| { | ||
| promise = then(promise, () => safeCall(instance, 'componentWillRender')); | ||
| } | ||
| endSchedule(); | ||
| return then(promise, () => updateComponent(hostRef, instance, isInitialLoad)); | ||
| }; | ||
| const updateComponent = (hostRef, instance, isInitialLoad) => { | ||
| // updateComponent | ||
| const elm = hostRef.$hostElement$; | ||
| const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$); | ||
| const rc = elm['s-rc']; | ||
| if ( isInitialLoad) { | ||
| // DOM WRITE! | ||
| attachStyles(hostRef); | ||
| } | ||
| const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$); | ||
| { | ||
| { | ||
| // looks like we've got child nodes to render into this host element | ||
| // or we need to update the css class/attrs on the host element | ||
| // DOM WRITE! | ||
| renderVdom(hostRef, callRender(hostRef, instance)); | ||
| } | ||
| } | ||
| if ( plt.$cssShim$) { | ||
| plt.$cssShim$.updateHost(elm); | ||
| } | ||
| if ( rc) { | ||
| // ok, so turns out there are some child host elements | ||
| // waiting on this parent element to load | ||
| // let's fire off all update callbacks waiting | ||
| rc.map(cb => cb()); | ||
| elm['s-rc'] = undefined; | ||
| } | ||
| endRender(); | ||
| endUpdate(); | ||
| { | ||
| const childrenPromises = elm['s-p']; | ||
| const postUpdate = () => postUpdateComponent(hostRef); | ||
| if (childrenPromises.length === 0) { | ||
| postUpdate(); | ||
| } | ||
| else { | ||
| Promise.all(childrenPromises).then(postUpdate); | ||
| hostRef.$flags$ |= 4 /* isWaitingForChildren */; | ||
| childrenPromises.length = 0; | ||
| } | ||
| } | ||
| }; | ||
| const callRender = (hostRef, instance) => { | ||
| try { | ||
| instance = instance.render() ; | ||
| { | ||
| hostRef.$flags$ &= ~16 /* isQueuedForUpdate */; | ||
| } | ||
| { | ||
| hostRef.$flags$ |= 2 /* hasRendered */; | ||
| } | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| return instance; | ||
| }; | ||
| const postUpdateComponent = (hostRef) => { | ||
| const tagName = hostRef.$cmpMeta$.$tagName$; | ||
| const elm = hostRef.$hostElement$; | ||
| const endPostUpdate = createTime('postUpdate', tagName); | ||
| const ancestorComponent = hostRef.$ancestorComponent$; | ||
| if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) { | ||
| hostRef.$flags$ |= 64 /* hasLoadedComponent */; | ||
| { | ||
| // DOM WRITE! | ||
| addHydratedFlag(elm); | ||
| } | ||
| endPostUpdate(); | ||
| { | ||
| hostRef.$onReadyResolve$(elm); | ||
| if (!ancestorComponent) { | ||
| appDidLoad(); | ||
| } | ||
| } | ||
| } | ||
| else { | ||
| endPostUpdate(); | ||
| } | ||
| { | ||
| hostRef.$onInstanceResolve$(elm); | ||
| } | ||
| // load events fire from bottom to top | ||
| // the deepest elements load first then bubbles up | ||
| { | ||
| if (hostRef.$onRenderResolve$) { | ||
| hostRef.$onRenderResolve$(); | ||
| hostRef.$onRenderResolve$ = undefined; | ||
| } | ||
| if (hostRef.$flags$ & 512 /* needsRerender */) { | ||
| nextTick(() => scheduleUpdate(hostRef, false)); | ||
| } | ||
| hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */); | ||
| } | ||
| // ( •_•) | ||
| // ( •_•)>⌐■-■ | ||
| // (⌐■_■) | ||
| }; | ||
| const forceUpdate = (ref) => { | ||
| { | ||
| const hostRef = getHostRef(ref); | ||
| const isConnected = hostRef.$hostElement$.isConnected; | ||
| if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) { | ||
| scheduleUpdate(hostRef, false); | ||
| } | ||
| // Returns "true" when the forced update was successfully scheduled | ||
| return isConnected; | ||
| } | ||
| }; | ||
| const appDidLoad = (who) => { | ||
| // on appload | ||
| // we have finish the first big initial render | ||
| { | ||
| addHydratedFlag(doc.documentElement); | ||
| } | ||
| { | ||
| plt.$flags$ |= 2 /* appLoaded */; | ||
| } | ||
| nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } })); | ||
| }; | ||
| const safeCall = (instance, method, arg) => { | ||
| if (instance && instance[method]) { | ||
| try { | ||
| return instance[method](arg); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| return undefined; | ||
| }; | ||
| const then = (promise, thenFn) => { | ||
| return promise && promise.then ? promise.then(thenFn) : thenFn(); | ||
| }; | ||
| const addHydratedFlag = (elm) => ( elm.classList.add('hydrated') ); | ||
| const parsePropertyValue = (propValue, propType) => { | ||
| // ensure this value is of the correct prop type | ||
| if (propValue != null && !isComplexType(propValue)) { | ||
| if ( propType & 1 /* String */) { | ||
| // could have been passed as a number or boolean | ||
| // but we still want it as a string | ||
| return String(propValue); | ||
| } | ||
| // redundant return here for better minification | ||
| return propValue; | ||
| } | ||
| // not sure exactly what type we want | ||
| // so no need to change to a different type | ||
| return propValue; | ||
| }; | ||
| const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName); | ||
| const setValue = (ref, propName, newVal, cmpMeta) => { | ||
| // check our new property value against our internal value | ||
| const hostRef = getHostRef(ref); | ||
| const oldVal = hostRef.$instanceValues$.get(propName); | ||
| const flags = hostRef.$flags$; | ||
| const instance = hostRef.$lazyInstance$ ; | ||
| newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]); | ||
| if (( !(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && newVal !== oldVal) { | ||
| // gadzooks! the property's value has changed!! | ||
| // set our new value! | ||
| hostRef.$instanceValues$.set(propName, newVal); | ||
| if ( instance) { | ||
| if ( (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) { | ||
| // looks like this value actually changed, so we've got work to do! | ||
| // but only if we've already rendered, otherwise just chill out | ||
| // queue that we need to do an update, but don't worry about queuing | ||
| // up millions cuz this function ensures it only runs once | ||
| scheduleUpdate(hostRef, false); | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| const proxyComponent = (Cstr, cmpMeta, flags) => { | ||
| if ( cmpMeta.$members$) { | ||
| // It's better to have a const than two Object.entries() | ||
| const members = Object.entries(cmpMeta.$members$); | ||
| const prototype = Cstr.prototype; | ||
| members.map(([memberName, [memberFlags]]) => { | ||
| if ( (memberFlags & 31 /* Prop */ || (( flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) { | ||
| // proxyComponent - prop | ||
| Object.defineProperty(prototype, memberName, { | ||
| get() { | ||
| // proxyComponent, get value | ||
| return getValue(this, memberName); | ||
| }, | ||
| set(newValue) { | ||
| // proxyComponent, set value | ||
| setValue(this, memberName, newValue, cmpMeta); | ||
| }, | ||
| configurable: true, | ||
| enumerable: true, | ||
| }); | ||
| } | ||
| else if ( flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) { | ||
| // proxyComponent - method | ||
| Object.defineProperty(prototype, memberName, { | ||
| value(...args) { | ||
| const ref = getHostRef(this); | ||
| return ref.$onInstancePromise$.then(() => ref.$lazyInstance$[memberName](...args)); | ||
| }, | ||
| }); | ||
| } | ||
| }); | ||
| if ( ( flags & 1 /* isElementConstructor */)) { | ||
| const attrNameToPropName = new Map(); | ||
| prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) { | ||
| plt.jmp(() => { | ||
| const propName = attrNameToPropName.get(attrName); | ||
| this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue; | ||
| }); | ||
| }; | ||
| // create an array of attributes to observe | ||
| // and also create a map of html attribute name to js property name | ||
| Cstr.observedAttributes = members | ||
| .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes | ||
| .map(([propName, m]) => { | ||
| const attrName = m[1] || propName; | ||
| attrNameToPropName.set(attrName, propName); | ||
| return attrName; | ||
| }); | ||
| } | ||
| } | ||
| return Cstr; | ||
| }; | ||
| const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => { | ||
| // initializeComponent | ||
| if ( (hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) { | ||
| { | ||
| // we haven't initialized this element yet | ||
| hostRef.$flags$ |= 32 /* hasInitializedComponent */; | ||
| // lazy loaded components | ||
| // request the component's implementation to be | ||
| // wired up with the host element | ||
| Cstr = loadModule(cmpMeta); | ||
| if (Cstr.then) { | ||
| // Await creates a micro-task avoid if possible | ||
| const endLoad = uniqueTime(); | ||
| Cstr = await Cstr; | ||
| endLoad(); | ||
| } | ||
| if ( !Cstr.isProxied) { | ||
| proxyComponent(Cstr, cmpMeta, 2 /* proxyState */); | ||
| Cstr.isProxied = true; | ||
| } | ||
| const endNewInstance = createTime('createInstance', cmpMeta.$tagName$); | ||
| // ok, time to construct the instance | ||
| // but let's keep track of when we start and stop | ||
| // so that the getters/setters don't incorrectly step on data | ||
| { | ||
| hostRef.$flags$ |= 8 /* isConstructingInstance */; | ||
| } | ||
| // construct the lazy-loaded component implementation | ||
| // passing the hostRef is very important during | ||
| // construction in order to directly wire together the | ||
| // host element and the lazy-loaded instance | ||
| try { | ||
| new Cstr(hostRef); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| { | ||
| hostRef.$flags$ &= ~8 /* isConstructingInstance */; | ||
| } | ||
| endNewInstance(); | ||
| } | ||
| if ( Cstr.style) { | ||
| // this component has styles but we haven't registered them yet | ||
| let style = Cstr.style; | ||
| const scopeId = getScopeId(cmpMeta); | ||
| if (!styles.has(scopeId)) { | ||
| const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$); | ||
| if ( cmpMeta.$flags$ & 8 /* needsShadowDomShim */) { | ||
| style = await import('./shadow-css-c63963b5.js').then(m => m.scopeCss(style, scopeId, false)); | ||
| } | ||
| registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)); | ||
| endRegisterStyles(); | ||
| } | ||
| } | ||
| } | ||
| // we've successfully created a lazy instance | ||
| const ancestorComponent = hostRef.$ancestorComponent$; | ||
| const schedule = () => scheduleUpdate(hostRef, true); | ||
| if ( ancestorComponent && ancestorComponent['s-rc']) { | ||
| // this is the intial load and this component it has an ancestor component | ||
| // but the ancestor component has NOT fired its will update lifecycle yet | ||
| // so let's just cool our jets and wait for the ancestor to continue first | ||
| // this will get fired off when the ancestor component | ||
| // finally gets around to rendering its lazy self | ||
| // fire off the initial update | ||
| ancestorComponent['s-rc'].push(schedule); | ||
| } | ||
| else { | ||
| schedule(); | ||
| } | ||
| }; | ||
| const connectedCallback = (elm) => { | ||
| if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) { | ||
| const hostRef = getHostRef(elm); | ||
| const cmpMeta = hostRef.$cmpMeta$; | ||
| const endConnected = createTime('connectedCallback', cmpMeta.$tagName$); | ||
| if (!(hostRef.$flags$ & 1 /* hasConnected */)) { | ||
| // first time this component has connected | ||
| hostRef.$flags$ |= 1 /* hasConnected */; | ||
| { | ||
| // find the first ancestor component (if there is one) and register | ||
| // this component as one of the actively loading child components for its ancestor | ||
| let ancestorComponent = elm; | ||
| while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) { | ||
| // climb up the ancestors looking for the first | ||
| // component that hasn't finished its lifecycle update yet | ||
| if ( | ||
| ancestorComponent['s-p']) { | ||
| // we found this components first ancestor component | ||
| // keep a reference to this component's ancestor component | ||
| attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent)); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| // Lazy properties | ||
| // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties | ||
| if ( cmpMeta.$members$) { | ||
| Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => { | ||
| if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) { | ||
| const value = elm[memberName]; | ||
| delete elm[memberName]; | ||
| elm[memberName] = value; | ||
| } | ||
| }); | ||
| } | ||
| { | ||
| // connectedCallback, taskQueue, initialLoad | ||
| // angular sets attribute AFTER connectCallback | ||
| // https://github.com/angular/angular/issues/18909 | ||
| // https://github.com/angular/angular/issues/19940 | ||
| nextTick(() => initializeComponent(elm, hostRef, cmpMeta)); | ||
| } | ||
| } | ||
| else { | ||
| // not the first time this has connected | ||
| // reattach any event listeners to the host | ||
| // since they would have been removed when disconnected | ||
| addHostEventListeners(elm, hostRef, cmpMeta.$listeners$); | ||
| } | ||
| endConnected(); | ||
| } | ||
| }; | ||
| const disconnectedCallback = (elm) => { | ||
| if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) { | ||
| const hostRef = getHostRef(elm); | ||
| { | ||
| if (hostRef.$rmListeners$) { | ||
| hostRef.$rmListeners$.map(rmListener => rmListener()); | ||
| hostRef.$rmListeners$ = undefined; | ||
| } | ||
| } | ||
| // clear CSS var-shim tracking | ||
| if ( plt.$cssShim$) { | ||
| plt.$cssShim$.removeHost(elm); | ||
| } | ||
| } | ||
| }; | ||
| const bootstrapLazy = (lazyBundles, options = {}) => { | ||
| const endBootstrap = createTime(); | ||
| const cmpTags = []; | ||
| const exclude = options.exclude || []; | ||
| const customElements = win.customElements; | ||
| const head = doc.head; | ||
| const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]'); | ||
| const visibilityStyle = /*@__PURE__*/ doc.createElement('style'); | ||
| const deferredConnectedCallbacks = []; | ||
| let appLoadFallback; | ||
| let isBootstrapping = true; | ||
| Object.assign(plt, options); | ||
| plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href; | ||
| { | ||
| if (options.syncQueue) { | ||
| plt.$flags$ |= 4 /* queueSync */; | ||
| } | ||
| } | ||
| lazyBundles.map(lazyBundle => lazyBundle[1].map(compactMeta => { | ||
| const cmpMeta = { | ||
| $flags$: compactMeta[0], | ||
| $tagName$: compactMeta[1], | ||
| $members$: compactMeta[2], | ||
| $listeners$: compactMeta[3], | ||
| }; | ||
| { | ||
| cmpMeta.$members$ = compactMeta[2]; | ||
| } | ||
| { | ||
| cmpMeta.$listeners$ = compactMeta[3]; | ||
| } | ||
| if ( !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { | ||
| cmpMeta.$flags$ |= 8 /* needsShadowDomShim */; | ||
| } | ||
| const tagName = cmpMeta.$tagName$; | ||
| const HostElement = class extends HTMLElement { | ||
| // StencilLazyHost | ||
| constructor(self) { | ||
| // @ts-ignore | ||
| super(self); | ||
| self = this; | ||
| registerHost(self, cmpMeta); | ||
| if ( cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { | ||
| // this component is using shadow dom | ||
| // and this browser supports shadow dom | ||
| // add the read-only property "shadowRoot" to the host element | ||
| // adding the shadow root build conditionals to minimize runtime | ||
| if (supportsShadow) { | ||
| { | ||
| self.attachShadow({ mode: 'open' }); | ||
| } | ||
| } | ||
| else if ( !('shadowRoot' in self)) { | ||
| self.shadowRoot = self; | ||
| } | ||
| } | ||
| } | ||
| connectedCallback() { | ||
| if (appLoadFallback) { | ||
| clearTimeout(appLoadFallback); | ||
| appLoadFallback = null; | ||
| } | ||
| if (isBootstrapping) { | ||
| // connectedCallback will be processed once all components have been registered | ||
| deferredConnectedCallbacks.push(this); | ||
| } | ||
| else { | ||
| plt.jmp(() => connectedCallback(this)); | ||
| } | ||
| } | ||
| disconnectedCallback() { | ||
| plt.jmp(() => disconnectedCallback(this)); | ||
| } | ||
| forceUpdate() { | ||
| forceUpdate(this); | ||
| } | ||
| componentOnReady() { | ||
| return getHostRef(this).$onReadyPromise$; | ||
| } | ||
| }; | ||
| cmpMeta.$lazyBundleId$ = lazyBundle[0]; | ||
| if (!exclude.includes(tagName) && !customElements.get(tagName)) { | ||
| cmpTags.push(tagName); | ||
| customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */)); | ||
| } | ||
| })); | ||
| { | ||
| visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS; | ||
| visibilityStyle.setAttribute('data-styles', ''); | ||
| head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild); | ||
| } | ||
| // Process deferred connectedCallbacks now all components have been registered | ||
| isBootstrapping = false; | ||
| if (deferredConnectedCallbacks.length) { | ||
| deferredConnectedCallbacks.map(host => host.connectedCallback()); | ||
| } | ||
| else { | ||
| { | ||
| plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30))); | ||
| } | ||
| } | ||
| // Fallback appLoad event | ||
| endBootstrap(); | ||
| }; | ||
| const hostRefs = new WeakMap(); | ||
| const getHostRef = (ref) => hostRefs.get(ref); | ||
| const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef); | ||
| const registerHost = (elm, cmpMeta) => { | ||
| const hostRef = { | ||
| $flags$: 0, | ||
| $hostElement$: elm, | ||
| $cmpMeta$: cmpMeta, | ||
| $instanceValues$: new Map(), | ||
| }; | ||
| { | ||
| hostRef.$onInstancePromise$ = new Promise(r => (hostRef.$onInstanceResolve$ = r)); | ||
| } | ||
| { | ||
| hostRef.$onReadyPromise$ = new Promise(r => (hostRef.$onReadyResolve$ = r)); | ||
| elm['s-p'] = []; | ||
| elm['s-rc'] = []; | ||
| } | ||
| addHostEventListeners(elm, hostRef, cmpMeta.$listeners$); | ||
| return hostRefs.set(elm, hostRef); | ||
| }; | ||
| const isMemberInElement = (elm, memberName) => memberName in elm; | ||
| const consoleError = (e) => console.error(e); | ||
| const cmpModules = /*@__PURE__*/ new Map(); | ||
| const loadModule = (cmpMeta, hostRef, hmrVersionId) => { | ||
| // loadModuleImport | ||
| const exportName = cmpMeta.$tagName$.replace(/-/g, '_'); | ||
| const bundleId = cmpMeta.$lazyBundleId$; | ||
| const module = cmpModules.get(bundleId) ; | ||
| if (module) { | ||
| return module[exportName]; | ||
| } | ||
| return import( | ||
| /* webpackInclude: /\.entry\.js$/ */ | ||
| /* webpackExclude: /\.system\.entry\.js$/ */ | ||
| /* webpackMode: "lazy" */ | ||
| `./${bundleId}.entry.js${ ''}`).then(importedModule => { | ||
| { | ||
| cmpModules.set(bundleId, importedModule); | ||
| } | ||
| return importedModule[exportName]; | ||
| }, consoleError); | ||
| }; | ||
| const styles = new Map(); | ||
| const queueDomReads = []; | ||
| const queueDomWrites = []; | ||
| const queueDomWritesLow = []; | ||
| const queueTask = (queue, write) => (cb) => { | ||
| queue.push(cb); | ||
| if (!queuePending) { | ||
| queuePending = true; | ||
| if (write && plt.$flags$ & 4 /* queueSync */) { | ||
| nextTick(flush); | ||
| } | ||
| else { | ||
| plt.raf(flush); | ||
| } | ||
| } | ||
| }; | ||
| const consume = (queue) => { | ||
| for (let i = 0; i < queue.length; i++) { | ||
| try { | ||
| queue[i](performance.now()); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| queue.length = 0; | ||
| }; | ||
| const consumeTimeout = (queue, timeout) => { | ||
| let i = 0; | ||
| let ts = 0; | ||
| while (i < queue.length && (ts = performance.now()) < timeout) { | ||
| try { | ||
| queue[i++](ts); | ||
| } | ||
| catch (e) { | ||
| consoleError(e); | ||
| } | ||
| } | ||
| if (i === queue.length) { | ||
| queue.length = 0; | ||
| } | ||
| else if (i !== 0) { | ||
| queue.splice(0, i); | ||
| } | ||
| }; | ||
| const flush = () => { | ||
| { | ||
| queueCongestion++; | ||
| } | ||
| // always force a bunch of medium callbacks to run, but still have | ||
| // a throttle on how many can run in a certain time | ||
| // DOM READS!!! | ||
| consume(queueDomReads); | ||
| // DOM WRITES!!! | ||
| { | ||
| const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */ ? performance.now() + 14 * Math.ceil(queueCongestion * (1.0 / 10.0)) : Infinity; | ||
| consumeTimeout(queueDomWrites, timeout); | ||
| consumeTimeout(queueDomWritesLow, timeout); | ||
| if (queueDomWrites.length > 0) { | ||
| queueDomWritesLow.push(...queueDomWrites); | ||
| queueDomWrites.length = 0; | ||
| } | ||
| if ((queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0)) { | ||
| // still more to do yet, but we've run out of time | ||
| // let's let this thing cool off and try again in the next tick | ||
| plt.raf(flush); | ||
| } | ||
| else { | ||
| queueCongestion = 0; | ||
| } | ||
| } | ||
| }; | ||
| const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb); | ||
| const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true); | ||
| export { CSS as C, NAMESPACE as N, promiseResolve as a, bootstrapLazy as b, createEvent as c, doc as d, getElement as g, h, plt as p, registerInstance as r, win as w }; |
| import { C as CSS, p as plt, w as win, a as promiseResolve, d as doc, N as NAMESPACE } from './index-05772288.js'; | ||
| /* | ||
| Stencil Client Patch v1.17.3 | MIT Licensed | https://stenciljs.com | ||
| */ | ||
| const noop = () => { | ||
| /* noop*/ | ||
| }; | ||
| const IS_DENO_ENV = typeof Deno !== 'undefined'; | ||
| const IS_NODE_ENV = !IS_DENO_ENV && | ||
| typeof global !== 'undefined' && | ||
| typeof require === 'function' && | ||
| !!global.process && | ||
| typeof __filename === 'string' && | ||
| (!global.origin || typeof global.origin !== 'string'); | ||
| const IS_DENO_WINDOWS_ENV = IS_DENO_ENV && Deno.build.os === 'windows'; | ||
| const getCurrentDirectory = IS_NODE_ENV ? process.cwd : IS_DENO_ENV ? Deno.cwd : () => '/'; | ||
| const exit = IS_NODE_ENV ? process.exit : IS_DENO_ENV ? Deno.exit : noop; | ||
| const getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\s|-/g, '_')}`; | ||
| const patchEsm = () => { | ||
| // NOTE!! This fn cannot use async/await! | ||
| // @ts-ignore | ||
| if ( !(CSS && CSS.supports && CSS.supports('color', 'var(--c)'))) { | ||
| // @ts-ignore | ||
| return import(/* webpackChunkName: "polyfills-css-shim" */ './css-shim-a659079f.js').then(() => { | ||
| if ((plt.$cssShim$ = win.__cssshim)) { | ||
| return plt.$cssShim$.i(); | ||
| } | ||
| else { | ||
| // for better minification | ||
| return 0; | ||
| } | ||
| }); | ||
| } | ||
| return promiseResolve(); | ||
| }; | ||
| const patchBrowser = () => { | ||
| { | ||
| // shim css vars | ||
| plt.$cssShim$ = win.__cssshim; | ||
| } | ||
| // @ts-ignore | ||
| const scriptElm = Array.from(doc.querySelectorAll('script')).find(s => new RegExp(`\/${NAMESPACE}(\\.esm)?\\.js($|\\?|#)`).test(s.src) || s.getAttribute('data-stencil-namespace') === NAMESPACE) | ||
| ; | ||
| const opts = scriptElm['data-opts'] || {} ; | ||
| if ( 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) { | ||
| // Safari < v11 support: This IF is true if it's Safari below v11. | ||
| // This fn cannot use async/await since Safari didn't support it until v11, | ||
| // however, Safari 10 did support modules. Safari 10 also didn't support "nomodule", | ||
| // so both the ESM file and nomodule file would get downloaded. Only Safari | ||
| // has 'onbeforeload' in the script, and "history.scrollRestoration" was added | ||
| // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue. | ||
| // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds. | ||
| return { | ||
| then() { | ||
| /* promise noop */ | ||
| }, | ||
| }; | ||
| } | ||
| { | ||
| opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href; | ||
| { | ||
| patchDynamicImport(opts.resourcesUrl, scriptElm); | ||
| } | ||
| if ( !win.customElements) { | ||
| // module support, but no custom elements support (Old Edge) | ||
| // @ts-ignore | ||
| return import(/* webpackChunkName: "polyfills-dom" */ './dom-4061ceba.js').then(() => opts); | ||
| } | ||
| } | ||
| return promiseResolve(opts); | ||
| }; | ||
| const patchDynamicImport = (base, orgScriptElm) => { | ||
| const importFunctionName = getDynamicImportFunction(NAMESPACE); | ||
| try { | ||
| // test if this browser supports dynamic imports | ||
| // There is a caching issue in V8, that breaks using import() in Function | ||
| // By generating a random string, we can workaround it | ||
| // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info | ||
| win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`); | ||
| } | ||
| catch (e) { | ||
| // this shim is specifically for browsers that do support "esm" imports | ||
| // however, they do NOT support "dynamic" imports | ||
| // basically this code is for old Edge, v18 and below | ||
| const moduleMap = new Map(); | ||
| win[importFunctionName] = (src) => { | ||
| const url = new URL(src, base).href; | ||
| let mod = moduleMap.get(url); | ||
| if (!mod) { | ||
| const script = doc.createElement('script'); | ||
| script.type = 'module'; | ||
| script.crossOrigin = orgScriptElm.crossOrigin; | ||
| script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], { type: 'application/javascript' })); | ||
| mod = new Promise(resolve => { | ||
| script.onload = () => { | ||
| resolve(win[importFunctionName].m); | ||
| script.remove(); | ||
| }; | ||
| }); | ||
| moduleMap.set(url, mod); | ||
| doc.head.appendChild(script); | ||
| } | ||
| return mod; | ||
| }; | ||
| } | ||
| }; | ||
| export { patchEsm as a, patchBrowser as p }; |
| /* | ||
| Stencil Client Platform v1.17.3 | MIT Licensed | https://stenciljs.com | ||
| */ | ||
| /** | ||
| * @license | ||
| * Copyright Google Inc. All Rights Reserved. | ||
| * | ||
| * Use of this source code is governed by an MIT-style license that can be | ||
| * found in the LICENSE file at https://angular.io/license | ||
| * | ||
| * This file is a port of shadowCSS from webcomponents.js to TypeScript. | ||
| * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js | ||
| * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts | ||
| */ | ||
| const safeSelector = (selector) => { | ||
| const placeholders = []; | ||
| let index = 0; | ||
| let content; | ||
| // Replaces attribute selectors with placeholders. | ||
| // The WS in [attr="va lue"] would otherwise be interpreted as a selector separator. | ||
| selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => { | ||
| const replaceBy = `__ph-${index}__`; | ||
| placeholders.push(keep); | ||
| index++; | ||
| return replaceBy; | ||
| }); | ||
| // Replaces the expression in `:nth-child(2n + 1)` with a placeholder. | ||
| // WS and "+" would otherwise be interpreted as selector separators. | ||
| content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => { | ||
| const replaceBy = `__ph-${index}__`; | ||
| placeholders.push(exp); | ||
| index++; | ||
| return pseudo + replaceBy; | ||
| }); | ||
| const ss = { | ||
| content, | ||
| placeholders, | ||
| }; | ||
| return ss; | ||
| }; | ||
| const restoreSafeSelector = (placeholders, content) => { | ||
| return content.replace(/__ph-(\d+)__/g, (_, index) => placeholders[+index]); | ||
| }; | ||
| const _polyfillHost = '-shadowcsshost'; | ||
| const _polyfillSlotted = '-shadowcssslotted'; | ||
| // note: :host-context pre-processed to -shadowcsshostcontext. | ||
| const _polyfillHostContext = '-shadowcsscontext'; | ||
| const _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)'; | ||
| const _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim'); | ||
| const _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim'); | ||
| const _cssColonSlottedRe = new RegExp('(' + _polyfillSlotted + _parenSuffix, 'gim'); | ||
| const _polyfillHostNoCombinator = _polyfillHost + '-no-combinator'; | ||
| const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/; | ||
| const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g]; | ||
| const _selectorReSuffix = '([>\\s~+[.,{:][\\s\\S]*)?$'; | ||
| const _polyfillHostRe = /-shadowcsshost/gim; | ||
| const _colonHostRe = /:host/gim; | ||
| const _colonSlottedRe = /::slotted/gim; | ||
| const _colonHostContextRe = /:host-context/gim; | ||
| const _commentRe = /\/\*\s*[\s\S]*?\*\//g; | ||
| const stripComments = (input) => { | ||
| return input.replace(_commentRe, ''); | ||
| }; | ||
| const _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g; | ||
| const extractCommentsWithHash = (input) => { | ||
| return input.match(_commentWithHashRe) || []; | ||
| }; | ||
| const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g; | ||
| const _curlyRe = /([{}])/g; | ||
| const OPEN_CURLY = '{'; | ||
| const CLOSE_CURLY = '}'; | ||
| const BLOCK_PLACEHOLDER = '%BLOCK%'; | ||
| const processRules = (input, ruleCallback) => { | ||
| const inputWithEscapedBlocks = escapeBlocks(input); | ||
| let nextBlockIndex = 0; | ||
| return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => { | ||
| const selector = m[2]; | ||
| let content = ''; | ||
| let suffix = m[4]; | ||
| let contentPrefix = ''; | ||
| if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) { | ||
| content = inputWithEscapedBlocks.blocks[nextBlockIndex++]; | ||
| suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1); | ||
| contentPrefix = '{'; | ||
| } | ||
| const cssRule = { | ||
| selector, | ||
| content, | ||
| }; | ||
| const rule = ruleCallback(cssRule); | ||
| return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`; | ||
| }); | ||
| }; | ||
| const escapeBlocks = (input) => { | ||
| const inputParts = input.split(_curlyRe); | ||
| const resultParts = []; | ||
| const escapedBlocks = []; | ||
| let bracketCount = 0; | ||
| let currentBlockParts = []; | ||
| for (let partIndex = 0; partIndex < inputParts.length; partIndex++) { | ||
| const part = inputParts[partIndex]; | ||
| if (part === CLOSE_CURLY) { | ||
| bracketCount--; | ||
| } | ||
| if (bracketCount > 0) { | ||
| currentBlockParts.push(part); | ||
| } | ||
| else { | ||
| if (currentBlockParts.length > 0) { | ||
| escapedBlocks.push(currentBlockParts.join('')); | ||
| resultParts.push(BLOCK_PLACEHOLDER); | ||
| currentBlockParts = []; | ||
| } | ||
| resultParts.push(part); | ||
| } | ||
| if (part === OPEN_CURLY) { | ||
| bracketCount++; | ||
| } | ||
| } | ||
| if (currentBlockParts.length > 0) { | ||
| escapedBlocks.push(currentBlockParts.join('')); | ||
| resultParts.push(BLOCK_PLACEHOLDER); | ||
| } | ||
| const strEscapedBlocks = { | ||
| escapedString: resultParts.join(''), | ||
| blocks: escapedBlocks, | ||
| }; | ||
| return strEscapedBlocks; | ||
| }; | ||
| const insertPolyfillHostInCssText = (selector) => { | ||
| selector = selector | ||
| .replace(_colonHostContextRe, _polyfillHostContext) | ||
| .replace(_colonHostRe, _polyfillHost) | ||
| .replace(_colonSlottedRe, _polyfillSlotted); | ||
| return selector; | ||
| }; | ||
| const convertColonRule = (cssText, regExp, partReplacer) => { | ||
| // m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule | ||
| return cssText.replace(regExp, (...m) => { | ||
| if (m[2]) { | ||
| const parts = m[2].split(','); | ||
| const r = []; | ||
| for (let i = 0; i < parts.length; i++) { | ||
| const p = parts[i].trim(); | ||
| if (!p) | ||
| break; | ||
| r.push(partReplacer(_polyfillHostNoCombinator, p, m[3])); | ||
| } | ||
| return r.join(','); | ||
| } | ||
| else { | ||
| return _polyfillHostNoCombinator + m[3]; | ||
| } | ||
| }); | ||
| }; | ||
| const colonHostPartReplacer = (host, part, suffix) => { | ||
| return host + part.replace(_polyfillHost, '') + suffix; | ||
| }; | ||
| const convertColonHost = (cssText) => { | ||
| return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer); | ||
| }; | ||
| const colonHostContextPartReplacer = (host, part, suffix) => { | ||
| if (part.indexOf(_polyfillHost) > -1) { | ||
| return colonHostPartReplacer(host, part, suffix); | ||
| } | ||
| else { | ||
| return host + part + suffix + ', ' + part + ' ' + host + suffix; | ||
| } | ||
| }; | ||
| const convertColonSlotted = (cssText, slotScopeId) => { | ||
| const slotClass = '.' + slotScopeId + ' > '; | ||
| const selectors = []; | ||
| cssText = cssText.replace(_cssColonSlottedRe, (...m) => { | ||
| if (m[2]) { | ||
| const compound = m[2].trim(); | ||
| const suffix = m[3]; | ||
| const slottedSelector = slotClass + compound + suffix; | ||
| let prefixSelector = ''; | ||
| for (let i = m[4] - 1; i >= 0; i--) { | ||
| const char = m[5][i]; | ||
| if (char === '}' || char === ',') { | ||
| break; | ||
| } | ||
| prefixSelector = char + prefixSelector; | ||
| } | ||
| const orgSelector = prefixSelector + slottedSelector; | ||
| const addedSelector = `${prefixSelector.trimRight()}${slottedSelector.trim()}`; | ||
| if (orgSelector.trim() !== addedSelector.trim()) { | ||
| const updatedSelector = `${addedSelector}, ${orgSelector}`; | ||
| selectors.push({ | ||
| orgSelector, | ||
| updatedSelector, | ||
| }); | ||
| } | ||
| return slottedSelector; | ||
| } | ||
| else { | ||
| return _polyfillHostNoCombinator + m[3]; | ||
| } | ||
| }); | ||
| return { | ||
| selectors, | ||
| cssText, | ||
| }; | ||
| }; | ||
| const convertColonHostContext = (cssText) => { | ||
| return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer); | ||
| }; | ||
| const convertShadowDOMSelectors = (cssText) => { | ||
| return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText); | ||
| }; | ||
| const makeScopeMatcher = (scopeSelector) => { | ||
| const lre = /\[/g; | ||
| const rre = /\]/g; | ||
| scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]'); | ||
| return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm'); | ||
| }; | ||
| const selectorNeedsScoping = (selector, scopeSelector) => { | ||
| const re = makeScopeMatcher(scopeSelector); | ||
| return !re.test(selector); | ||
| }; | ||
| const applySimpleSelectorScope = (selector, scopeSelector, hostSelector) => { | ||
| // In Android browser, the lastIndex is not reset when the regex is used in String.replace() | ||
| _polyfillHostRe.lastIndex = 0; | ||
| if (_polyfillHostRe.test(selector)) { | ||
| const replaceBy = `.${hostSelector}`; | ||
| return selector | ||
| .replace(_polyfillHostNoCombinatorRe, (_, selector) => { | ||
| return selector.replace(/([^:]*)(:*)(.*)/, (_, before, colon, after) => { | ||
| return before + replaceBy + colon + after; | ||
| }); | ||
| }) | ||
| .replace(_polyfillHostRe, replaceBy + ' '); | ||
| } | ||
| return scopeSelector + ' ' + selector; | ||
| }; | ||
| const applyStrictSelectorScope = (selector, scopeSelector, hostSelector) => { | ||
| const isRe = /\[is=([^\]]*)\]/g; | ||
| scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]); | ||
| const className = '.' + scopeSelector; | ||
| const _scopeSelectorPart = (p) => { | ||
| let scopedP = p.trim(); | ||
| if (!scopedP) { | ||
| return ''; | ||
| } | ||
| if (p.indexOf(_polyfillHostNoCombinator) > -1) { | ||
| scopedP = applySimpleSelectorScope(p, scopeSelector, hostSelector); | ||
| } | ||
| else { | ||
| // remove :host since it should be unnecessary | ||
| const t = p.replace(_polyfillHostRe, ''); | ||
| if (t.length > 0) { | ||
| const matches = t.match(/([^:]*)(:*)(.*)/); | ||
| if (matches) { | ||
| scopedP = matches[1] + className + matches[2] + matches[3]; | ||
| } | ||
| } | ||
| } | ||
| return scopedP; | ||
| }; | ||
| const safeContent = safeSelector(selector); | ||
| selector = safeContent.content; | ||
| let scopedSelector = ''; | ||
| let startIndex = 0; | ||
| let res; | ||
| const sep = /( |>|\+|~(?!=))\s*/g; | ||
| // If a selector appears before :host it should not be shimmed as it | ||
| // matches on ancestor elements and not on elements in the host's shadow | ||
| // `:host-context(div)` is transformed to | ||
| // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator` | ||
| // the `div` is not part of the component in the 2nd selectors and should not be scoped. | ||
| // Historically `component-tag:host` was matching the component so we also want to preserve | ||
| // this behavior to avoid breaking legacy apps (it should not match). | ||
| // The behavior should be: | ||
| // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything) | ||
| // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a | ||
| // `:host-context(tag)`) | ||
| const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1; | ||
| // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present | ||
| let shouldScope = !hasHost; | ||
| while ((res = sep.exec(selector)) !== null) { | ||
| const separator = res[1]; | ||
| const part = selector.slice(startIndex, res.index).trim(); | ||
| shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1; | ||
| const scopedPart = shouldScope ? _scopeSelectorPart(part) : part; | ||
| scopedSelector += `${scopedPart} ${separator} `; | ||
| startIndex = sep.lastIndex; | ||
| } | ||
| const part = selector.substring(startIndex); | ||
| shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1; | ||
| scopedSelector += shouldScope ? _scopeSelectorPart(part) : part; | ||
| // replace the placeholders with their original values | ||
| return restoreSafeSelector(safeContent.placeholders, scopedSelector); | ||
| }; | ||
| const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => { | ||
| return selector | ||
| .split(',') | ||
| .map(shallowPart => { | ||
| if (slotSelector && shallowPart.indexOf('.' + slotSelector) > -1) { | ||
| return shallowPart.trim(); | ||
| } | ||
| if (selectorNeedsScoping(shallowPart, scopeSelectorText)) { | ||
| return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim(); | ||
| } | ||
| else { | ||
| return shallowPart.trim(); | ||
| } | ||
| }) | ||
| .join(', '); | ||
| }; | ||
| const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => { | ||
| return processRules(cssText, (rule) => { | ||
| let selector = rule.selector; | ||
| let content = rule.content; | ||
| if (rule.selector[0] !== '@') { | ||
| selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector); | ||
| } | ||
| else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') || rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) { | ||
| content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector); | ||
| } | ||
| const cssRule = { | ||
| selector: selector.replace(/\s{2,}/g, ' ').trim(), | ||
| content, | ||
| }; | ||
| return cssRule; | ||
| }); | ||
| }; | ||
| const scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => { | ||
| cssText = insertPolyfillHostInCssText(cssText); | ||
| cssText = convertColonHost(cssText); | ||
| cssText = convertColonHostContext(cssText); | ||
| const slotted = convertColonSlotted(cssText, slotScopeId); | ||
| cssText = slotted.cssText; | ||
| cssText = convertShadowDOMSelectors(cssText); | ||
| if (scopeId) { | ||
| cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId); | ||
| } | ||
| cssText = cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`); | ||
| cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, ' $1 '); | ||
| return { | ||
| cssText: cssText.trim(), | ||
| slottedSelectors: slotted.selectors, | ||
| }; | ||
| }; | ||
| const scopeCss = (cssText, scopeId, commentOriginalSelector) => { | ||
| const hostScopeId = scopeId + '-h'; | ||
| const slotScopeId = scopeId + '-s'; | ||
| const commentsWithHash = extractCommentsWithHash(cssText); | ||
| cssText = stripComments(cssText); | ||
| const orgSelectors = []; | ||
| if (commentOriginalSelector) { | ||
| const processCommentedSelector = (rule) => { | ||
| const placeholder = `/*!@___${orgSelectors.length}___*/`; | ||
| const comment = `/*!@${rule.selector}*/`; | ||
| orgSelectors.push({ placeholder, comment }); | ||
| rule.selector = placeholder + rule.selector; | ||
| return rule; | ||
| }; | ||
| cssText = processRules(cssText, rule => { | ||
| if (rule.selector[0] !== '@') { | ||
| return processCommentedSelector(rule); | ||
| } | ||
| else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') || rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) { | ||
| rule.content = processRules(rule.content, processCommentedSelector); | ||
| return rule; | ||
| } | ||
| return rule; | ||
| }); | ||
| } | ||
| const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId); | ||
| cssText = [scoped.cssText, ...commentsWithHash].join('\n'); | ||
| if (commentOriginalSelector) { | ||
| orgSelectors.forEach(({ placeholder, comment }) => { | ||
| cssText = cssText.replace(placeholder, comment); | ||
| }); | ||
| } | ||
| scoped.slottedSelectors.forEach(slottedSelector => { | ||
| cssText = cssText.replace(slottedSelector.orgSelector, slottedSelector.updatedSelector); | ||
| }); | ||
| return cssText; | ||
| }; | ||
| export { scopeCss }; |
| System.register([],(function(){"use strict";return{execute:function(){var t=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function e(t){return s(n(t=r(t)),t)}function r(t){return t.replace(c.comments,"").replace(c.port,"")}function n(e){var r=new t;r.start=0,r.end=e.length;for(var n=r,s=0,i=e.length;s<i;s++)if(e[s]===a){n.rules||(n.rules=[]);var o=n,c=o.rules[o.rules.length-1]||null;(n=new t).start=s+1,n.parent=o,n.previous=c,o.rules.push(n)}else e[s]===u&&(n.end=s+1,n=n.parent||r);return r}function s(t,e){var r=e.substring(t.start,t.end-1);if(t.parsedCssText=t.cssText=r.trim(),t.parent){var n=t.previous?t.previous.end:t.parent.start;r=(r=(r=i(r=e.substring(n,t.start-1))).replace(c.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var a=t.parsedSelector=t.selector=r.trim();t.atRule=0===a.indexOf(f),t.atRule?0===a.indexOf(p)?t.type=o.MEDIA_RULE:a.match(c.keyframesRule)&&(t.type=o.KEYFRAMES_RULE,t.keyframesName=t.selector.split(c.multipleSpaces).pop()):0===a.indexOf(l)?t.type=o.MIXIN_RULE:t.type=o.STYLE_RULE}var u=t.rules;if(u)for(var h=0,v=u.length,m=void 0;h<v&&(m=u[h]);h++)s(m,e);return t}function i(t){return t.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var t=arguments[1],e=6-t.length;e--;)t="0"+t;return"\\"+t}))}var o={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},a="{",u="}",c={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},l="--",p="@media",f="@";function h(t,e,r){t.lastIndex=0;var n=e.substring(r).match(t);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}var v=/\bvar\(/,m=/\B--[\w-]+\s*:/,d=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,g=/^[\t ]+\n/gm;function y(t,e,r){return t[e]?t[e]:r?x(r,t):""}function S(t,e){for(var r=0,n=e;n<t.length;n++){var s=t[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function b(t,e){var r=h(v,t,e);if(!r)return null;var n=S(t,r.start),s=t.substring(r.end,n-1).split(","),i=s[0],o=s.slice(1);return{start:r.start,end:n,propName:i.trim(),fallback:o.length>0?o.join(",").trim():void 0}}function E(t,e,r){var n=b(t,r);if(!n)return e.push(t.substring(r,t.length)),t.length;var s=n.propName,i=null!=n.fallback?C(n.fallback):void 0;return e.push(t.substring(r,n.start),(function(t){return y(t,s,i)})),n.end}function x(t,e){for(var r="",n=0;n<t.length;n++){var s=t[n];r+="string"==typeof s?s:s(e)}return r}function M(t,e){for(var r=!1,n=!1,s=e;s<t.length;s++){var i=t[s];if(r)n&&'"'===i&&(r=!1),n||"'"!==i||(r=!1);else if('"'===i)r=!0,n=!0;else if("'"===i)r=!0,n=!1;else{if(";"===i)return s+1;if("}"===i)return s}}return s}function w(t){for(var e="",r=0;;){var n=h(m,t,r),s=n?n.start:t.length;if(e+=t.substring(r,s),!n)break;r=M(t,s)}return e}function C(t){var e=0;t=w(t=t.replace(d,"")).replace(g,"");for(var r=[];e<t.length;)e=E(t,r,e);return r}function I(t){var e={};t.forEach((function(t){t.declarations.forEach((function(t){e[t.prop]=t.value}))}));for(var r={},n=Object.entries(e),s=function(t){var e=!1;if(n.forEach((function(t){var n=t[0],s=x(t[1],r);s!==r[n]&&(r[n]=s,e=!0)})),!e)return"break"},i=0;i<10;i++){if("break"===s())break}return r}function R(t,e){if(void 0===e&&(e=0),!t.rules)return[];var r=[];return t.rules.filter((function(t){return t.type===o.STYLE_RULE})).forEach((function(t){var n=_(t.cssText);n.length>0&&t.parsedSelector.split(",").forEach((function(t){t=t.trim(),r.push({selector:t,declarations:n,specificity:k(),nu:e})})),e++})),r}function k(t){return 1}var A="!important",L=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function _(t){for(var e,r=[];e=L.exec(t.trim());){var n=O(e[2]),s=n.value,i=n.important;r.push({prop:e[1].trim(),value:C(s),important:i})}return r}function O(t){var e=(t=t.replace(/\s+/gim," ").trim()).endsWith(A);return e&&(t=t.substr(0,t.length-A.length).trim()),{value:t,important:e}}function T(t,e,r){var n=[],s=U(e,t);return r.forEach((function(t){return n.push(t)})),s.forEach((function(t){return n.push(t)})),j(N(n).filter((function(e){return $(t,e.selector)})))}function U(t,e){for(var r=[];e;){var n=t.get(e);n&&r.push(n),e=e.parentElement}return r}function N(t){var e=[];return t.forEach((function(t){e.push.apply(e,t.selectors)})),e}function j(t){return t.sort((function(t,e){return t.specificity===e.specificity?t.nu-e.nu:t.specificity-e.specificity})),t}function $(t,e){return":root"===e||"html"===e||t.matches(e)}function G(t){var r=e(t),n=C(t);return{original:t,template:n,selectors:R(r),usesCssVars:n.length>1}}function H(t,e){if(t.some((function(t){return t.styleEl===e})))return!1;var r=G(e.textContent);return r.styleEl=e,t.push(r),!0}function P(t){var e=I(N(t));t.forEach((function(t){t.usesCssVars&&(t.styleEl.textContent=x(t.template,e))}))}function V(t,e){var r=t.template.map((function(r){return"string"==typeof r?Y(r,t.scopeId,e):r})),n=t.selectors.map((function(r){return Object.assign(Object.assign({},r),{selector:Y(r.selector,t.scopeId,e)})}));return Object.assign(Object.assign({},t),{template:r,selectors:n,scopeId:e})}function Y(t,e,r){return t=q(t,"\\."+e,"."+r)}function q(t,e,r){return t.replace(new RegExp(e,"g"),r)}function F(t,e){return D(t,e),W(t,e).then((function(){P(e)}))}function B(t,e){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){D(t,e)&&P(e)})).observe(document.head,{childList:!0})}function W(t,e){for(var r=[],n=t.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(K(t,e,n[s]));return Promise.all(r)}function D(t,e){return Array.from(t.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(t){return H(e,t)})).some(Boolean)}function K(t,e,r){var n=r.href;return fetch(n).then((function(t){return t.text()})).then((function(s){if(z(s)&&r.parentNode){J(s)&&(s=Q(s,n));var i=t.createElement("style");i.setAttribute("data-styles",""),i.textContent=s,H(e,i),r.parentNode.insertBefore(i,r),r.remove()}})).catch((function(t){console.error(t)}))}var X=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function z(t){return t.indexOf("var(")>-1||X.test(t)}var Z=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function J(t){return Z.lastIndex=0,Z.test(t)}function Q(t,e){var r=e.replace(/[^/]*$/,"");return t.replace(Z,(function(t,e){var n=r+e;return t.replace(e,n)}))}var tt=function(){function t(t,e){this.win=t,this.doc=e,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return t.prototype.i=function(){var t=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(e){t.win.requestAnimationFrame((function(){B(t.doc,t.globalScopes),F(t.doc,t.globalScopes).then((function(){return e()}))}))})))},t.prototype.addLink=function(t){var e=this;return K(this.doc,this.globalScopes,t).then((function(){e.updateGlobal()}))},t.prototype.addGlobalStyle=function(t){H(this.globalScopes,t)&&this.updateGlobal()},t.prototype.createHostStyle=function(t,e,r,n){if(this.hostScopeMap.has(t))throw new Error("host style already created");var s=this.registerHostTemplate(r,e,n),i=this.doc.createElement("style");return i.setAttribute("data-no-shim",""),s.usesCssVars?n?(i["s-sc"]=e=s.scopeId+"-"+this.count,i.textContent="/*needs update*/",this.hostStyleMap.set(t,i),this.hostScopeMap.set(t,V(s,e)),this.count++):(s.styleEl=i,s.usesCssVars||(i.textContent=x(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(t,s)):i.textContent=r,i},t.prototype.removeHost=function(t){var e=this.hostStyleMap.get(t);e&&e.remove(),this.hostStyleMap.delete(t),this.hostScopeMap.delete(t)},t.prototype.updateHost=function(t){var e=this.hostScopeMap.get(t);if(e&&e.usesCssVars&&e.isScoped){var r=this.hostStyleMap.get(t);if(r){var n=I(T(t,this.hostScopeMap,this.globalScopes));r.textContent=x(e.template,n)}}},t.prototype.updateGlobal=function(){P(this.globalScopes)},t.prototype.registerHostTemplate=function(t,e,r){var n=this.scopesMap.get(e);return n||((n=G(t)).scopeId=e,n.isScoped=r,this.scopesMap.set(e,n)),n},t}();!function(t){!t||t.__cssshim||t.CSS&&t.CSS.supports&&t.CSS.supports("color","var(--c)")||(t.__cssshim=new tt(t,t.document))}("undefined"!=typeof window&&window)}}})); |
| System.register([],(function(){"use strict";return{execute:function(){(function(){var t=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function e(e){var n=t.has(e);e=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(e);return!n&&e}function n(t){var e=t.isConnected;if(void 0!==e)return e;for(;t&&!(t.__CE_isImportDocument||t instanceof Document);)t=t.parentNode||(window.ShadowRoot&&t instanceof ShadowRoot?t.host:void 0);return!(!t||!(t.__CE_isImportDocument||t instanceof Document))}function o(t,e){for(;e&&e!==t&&!e.nextSibling;)e=e.parentNode;return e&&e!==t?e.nextSibling:null}function i(t,e,n){n=void 0===n?new Set:n;for(var r=t;r;){if(r.nodeType===Node.ELEMENT_NODE){var a=r;e(a);var c=a.localName;if("link"===c&&"import"===a.getAttribute("rel")){r=a.import;if(r instanceof Node&&!n.has(r))for(n.add(r),r=r.firstChild;r;r=r.nextSibling)i(r,e,n);r=o(t,a);continue}else if("template"===c){r=o(t,a);continue}if(a=a.__CE_shadowRoot)for(a=a.firstChild;a;a=a.nextSibling)i(a,e,n)}r=r.firstChild?r.firstChild:o(t,r)}}function r(t,e,n){t[e]=n}function a(){this.a=new Map;this.g=new Map;this.c=[];this.f=[];this.b=!1}function c(t,e,n){t.a.set(e,n);t.g.set(n.constructorFunction,n)}function l(t,e){t.b=!0;t.c.push(e)}function s(t,e){t.b=!0;t.f.push(e)}function u(t,e){t.b&&i(e,(function(e){return f(t,e)}))}function f(t,e){if(t.b&&!e.__CE_patched){e.__CE_patched=!0;for(var n=0;n<t.c.length;n++)t.c[n](e);for(n=0;n<t.f.length;n++)t.f[n](e)}}function p(t,e){var n=[];i(e,(function(t){return n.push(t)}));for(e=0;e<n.length;e++){var o=n[e];1===o.__CE_state?t.connectedCallback(o):m(t,o)}}function h(t,e){var n=[];i(e,(function(t){return n.push(t)}));for(e=0;e<n.length;e++){var o=n[e];1===o.__CE_state&&t.disconnectedCallback(o)}}function d(t,e,n){n=void 0===n?{}:n;var o=n.u||new Set,r=n.i||function(e){return m(t,e)},a=[];i(e,(function(e){if("link"===e.localName&&"import"===e.getAttribute("rel")){var n=e.import;n instanceof Node&&(n.__CE_isImportDocument=!0,n.__CE_hasRegistry=!0);n&&"complete"===n.readyState?n.__CE_documentLoadHandled=!0:e.addEventListener("load",(function(){var n=e.import;if(!n.__CE_documentLoadHandled){n.__CE_documentLoadHandled=!0;var i=new Set(o);i.delete(n);d(t,n,{u:i,i:r})}}))}else a.push(e)}),o);if(t.b)for(e=0;e<a.length;e++)f(t,a[e]);for(e=0;e<a.length;e++)r(a[e])}function m(t,e){if(void 0===e.__CE_state){var o=e.ownerDocument;if(o.defaultView||o.__CE_isImportDocument&&o.__CE_hasRegistry)if(o=t.a.get(e.localName)){o.constructionStack.push(e);var i=o.constructorFunction;try{try{if(new i!==e)throw Error("The custom element constructor did not produce the element being upgraded.")}finally{o.constructionStack.pop()}}catch(c){throw e.__CE_state=2,c}e.__CE_state=1;e.__CE_definition=o;if(o.attributeChangedCallback)for(o=o.observedAttributes,i=0;i<o.length;i++){var r=o[i],a=e.getAttribute(r);null!==a&&t.attributeChangedCallback(e,r,null,a,null)}n(e)&&t.connectedCallback(e)}}}a.prototype.connectedCallback=function(t){var e=t.__CE_definition;e.connectedCallback&&e.connectedCallback.call(t)};a.prototype.disconnectedCallback=function(t){var e=t.__CE_definition;e.disconnectedCallback&&e.disconnectedCallback.call(t)};a.prototype.attributeChangedCallback=function(t,e,n,o,i){var r=t.__CE_definition;r.attributeChangedCallback&&-1<r.observedAttributes.indexOf(e)&&r.attributeChangedCallback.call(t,e,n,o,i)};function y(t){var e=document;this.c=t;this.a=e;this.b=void 0;d(this.c,this.a);"loading"===this.a.readyState&&(this.b=new MutationObserver(this.f.bind(this)),this.b.observe(this.a,{childList:!0,subtree:!0}))}function b(t){t.b&&t.b.disconnect()}y.prototype.f=function(t){var e=this.a.readyState;"interactive"!==e&&"complete"!==e||b(this);for(e=0;e<t.length;e++)for(var n=t[e].addedNodes,o=0;o<n.length;o++)d(this.c,n[o])};function v(){var t=this;this.b=this.a=void 0;this.c=new Promise((function(e){t.b=e;t.a&&e(t.a)}))}function g(t){if(t.a)throw Error("Already resolved.");t.a=void 0;t.b&&t.b(void 0)}function w(t){this.c=!1;this.a=t;this.j=new Map;this.f=function(t){return t()};this.b=!1;this.g=[];this.o=new y(t)}w.prototype.l=function(t,n){var o=this;if(!(n instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!e(t))throw new SyntaxError("The element name '"+t+"' is not valid.");if(this.a.a.get(t))throw Error("A custom element with name '"+t+"' has already been defined.");if(this.c)throw Error("A custom element is already being defined.");this.c=!0;try{var i=function(t){var e=r[t];if(void 0!==e&&!(e instanceof Function))throw Error("The '"+t+"' callback must be a function.");return e},r=n.prototype;if(!(r instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");var a=i("connectedCallback");var l=i("disconnectedCallback");var s=i("adoptedCallback");var u=i("attributeChangedCallback");var f=n.observedAttributes||[]}catch(p){return}finally{this.c=!1}n={localName:t,constructorFunction:n,connectedCallback:a,disconnectedCallback:l,adoptedCallback:s,attributeChangedCallback:u,observedAttributes:f,constructionStack:[]};c(this.a,t,n);this.g.push(n);this.b||(this.b=!0,this.f((function(){return E(o)})))};w.prototype.i=function(t){d(this.a,t)};function E(t){if(!1!==t.b){t.b=!1;for(var e=t.g,n=[],o=new Map,i=0;i<e.length;i++)o.set(e[i].localName,[]);d(t.a,document,{i:function(e){if(void 0===e.__CE_state){var i=e.localName,r=o.get(i);r?r.push(e):t.a.a.get(i)&&n.push(e)}}});for(i=0;i<n.length;i++)m(t.a,n[i]);for(;0<e.length;){var r=e.shift();i=r.localName;r=o.get(r.localName);for(var a=0;a<r.length;a++)m(t.a,r[a]);(i=t.j.get(i))&&g(i)}}}w.prototype.get=function(t){if(t=this.a.a.get(t))return t.constructorFunction};w.prototype.m=function(t){if(!e(t))return Promise.reject(new SyntaxError("'"+t+"' is not a valid custom element name."));var n=this.j.get(t);if(n)return n.c;n=new v;this.j.set(t,n);this.a.a.get(t)&&!this.g.some((function(e){return e.localName===t}))&&g(n);return n.c};w.prototype.s=function(t){b(this.o);var e=this.f;this.f=function(n){return t((function(){return e(n)}))}};window.CustomElementRegistry=w;w.prototype.define=w.prototype.l;w.prototype.upgrade=w.prototype.i;w.prototype.get=w.prototype.get;w.prototype.whenDefined=w.prototype.m;w.prototype.polyfillWrapFlushCallback=w.prototype.s;var _=window.Document.prototype.createElement,C=window.Document.prototype.createElementNS,N=window.Document.prototype.importNode,S=window.Document.prototype.prepend,T=window.Document.prototype.append,D=window.DocumentFragment.prototype.prepend,k=window.DocumentFragment.prototype.append,A=window.Node.prototype.cloneNode,O=window.Node.prototype.appendChild,j=window.Node.prototype.insertBefore,L=window.Node.prototype.removeChild,M=window.Node.prototype.replaceChild,x=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),H=window.Element.prototype.attachShadow,R=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),P=window.Element.prototype.getAttribute,F=window.Element.prototype.setAttribute,I=window.Element.prototype.removeAttribute,z=window.Element.prototype.getAttributeNS,U=window.Element.prototype.setAttributeNS,W=window.Element.prototype.removeAttributeNS,q=window.Element.prototype.insertAdjacentElement,B=window.Element.prototype.insertAdjacentHTML,$=window.Element.prototype.prepend,V=window.Element.prototype.append,X=window.Element.prototype.before,G=window.Element.prototype.after,J=window.Element.prototype.replaceWith,K=window.Element.prototype.remove,Q=window.HTMLElement,Y=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),Z=window.HTMLElement.prototype.insertAdjacentElement,tt=window.HTMLElement.prototype.insertAdjacentHTML;var et=new function(){};function nt(){var t=st;window.HTMLElement=function(){function e(){var e=this.constructor,n=t.g.get(e);if(!n)throw Error("The custom element being constructed was not registered with `customElements`.");var o=n.constructionStack;if(0===o.length)return o=_.call(document,n.localName),Object.setPrototypeOf(o,e.prototype),o.__CE_state=1,o.__CE_definition=n,f(t,o),o;n=o.length-1;var i=o[n];if(i===et)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.");o[n]=et;Object.setPrototypeOf(i,e.prototype);f(t,i);return i}e.prototype=Q.prototype;Object.defineProperty(e.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:e});return e}()}function ot(t,e,o){function i(e){return function(o){for(var i=[],r=0;r<arguments.length;++r)i[r]=arguments[r];r=[];for(var a=[],c=0;c<i.length;c++){var l=i[c];l instanceof Element&&n(l)&&a.push(l);if(l instanceof DocumentFragment)for(l=l.firstChild;l;l=l.nextSibling)r.push(l);else r.push(l)}e.apply(this,i);for(i=0;i<a.length;i++)h(t,a[i]);if(n(this))for(i=0;i<r.length;i++)a=r[i],a instanceof Element&&p(t,a)}}void 0!==o.h&&(e.prepend=i(o.h));void 0!==o.append&&(e.append=i(o.append))}function it(){var t=st;r(Document.prototype,"createElement",(function(e){if(this.__CE_hasRegistry){var n=t.a.get(e);if(n)return new n.constructorFunction}e=_.call(this,e);f(t,e);return e}));r(Document.prototype,"importNode",(function(e,n){e=N.call(this,e,!!n);this.__CE_hasRegistry?d(t,e):u(t,e);return e}));r(Document.prototype,"createElementNS",(function(e,n){if(this.__CE_hasRegistry&&(null===e||"http://www.w3.org/1999/xhtml"===e)){var o=t.a.get(n);if(o)return new o.constructorFunction}e=C.call(this,e,n);f(t,e);return e}));ot(t,Document.prototype,{h:S,append:T})}function rt(){function t(t,o){Object.defineProperty(t,"textContent",{enumerable:o.enumerable,configurable:!0,get:o.get,set:function(t){if(this.nodeType===Node.TEXT_NODE)o.set.call(this,t);else{var i=void 0;if(this.firstChild){var r=this.childNodes,a=r.length;if(0<a&&n(this)){i=Array(a);for(var c=0;c<a;c++)i[c]=r[c]}}o.set.call(this,t);if(i)for(t=0;t<i.length;t++)h(e,i[t])}}})}var e=st;r(Node.prototype,"insertBefore",(function(t,o){if(t instanceof DocumentFragment){var i=Array.prototype.slice.apply(t.childNodes);t=j.call(this,t,o);if(n(this))for(o=0;o<i.length;o++)p(e,i[o]);return t}i=n(t);o=j.call(this,t,o);i&&h(e,t);n(this)&&p(e,t);return o}));r(Node.prototype,"appendChild",(function(t){if(t instanceof DocumentFragment){var o=Array.prototype.slice.apply(t.childNodes);t=O.call(this,t);if(n(this))for(var i=0;i<o.length;i++)p(e,o[i]);return t}o=n(t);i=O.call(this,t);o&&h(e,t);n(this)&&p(e,t);return i}));r(Node.prototype,"cloneNode",(function(t){t=A.call(this,!!t);this.ownerDocument.__CE_hasRegistry?d(e,t):u(e,t);return t}));r(Node.prototype,"removeChild",(function(t){var o=n(t),i=L.call(this,t);o&&h(e,t);return i}));r(Node.prototype,"replaceChild",(function(t,o){if(t instanceof DocumentFragment){var i=Array.prototype.slice.apply(t.childNodes);t=M.call(this,t,o);if(n(this))for(h(e,o),o=0;o<i.length;o++)p(e,i[o]);return t}i=n(t);var r=M.call(this,t,o),a=n(this);a&&h(e,o);i&&h(e,t);a&&p(e,t);return r}));x&&x.get?t(Node.prototype,x):l(e,(function(e){t(e,{enumerable:!0,configurable:!0,get:function(){for(var t=[],e=0;e<this.childNodes.length;e++){var n=this.childNodes[e];n.nodeType!==Node.COMMENT_NODE&&t.push(n.textContent)}return t.join("")},set:function(t){for(;this.firstChild;)L.call(this,this.firstChild);null!=t&&""!==t&&O.call(this,document.createTextNode(t))}})}))}function at(t){function e(e){return function(o){for(var i=[],r=0;r<arguments.length;++r)i[r]=arguments[r];r=[];for(var a=[],c=0;c<i.length;c++){var l=i[c];l instanceof Element&&n(l)&&a.push(l);if(l instanceof DocumentFragment)for(l=l.firstChild;l;l=l.nextSibling)r.push(l);else r.push(l)}e.apply(this,i);for(i=0;i<a.length;i++)h(t,a[i]);if(n(this))for(i=0;i<r.length;i++)a=r[i],a instanceof Element&&p(t,a)}}var o=Element.prototype;void 0!==X&&(o.before=e(X));void 0!==X&&(o.after=e(G));void 0!==J&&r(o,"replaceWith",(function(e){for(var o=[],i=0;i<arguments.length;++i)o[i]=arguments[i];i=[];for(var r=[],a=0;a<o.length;a++){var c=o[a];c instanceof Element&&n(c)&&r.push(c);if(c instanceof DocumentFragment)for(c=c.firstChild;c;c=c.nextSibling)i.push(c);else i.push(c)}a=n(this);J.apply(this,o);for(o=0;o<r.length;o++)h(t,r[o]);if(a)for(h(t,this),o=0;o<i.length;o++)r=i[o],r instanceof Element&&p(t,r)}));void 0!==K&&r(o,"remove",(function(){var e=n(this);K.call(this);e&&h(t,this)}))}function ct(){function t(t,e){Object.defineProperty(t,"innerHTML",{enumerable:e.enumerable,configurable:!0,get:e.get,set:function(t){var o=this,r=void 0;n(this)&&(r=[],i(this,(function(t){t!==o&&r.push(t)})));e.set.call(this,t);if(r)for(var c=0;c<r.length;c++){var l=r[c];1===l.__CE_state&&a.disconnectedCallback(l)}this.ownerDocument.__CE_hasRegistry?d(a,this):u(a,this);return t}})}function e(t,e){r(t,"insertAdjacentElement",(function(t,o){var i=n(o);t=e.call(this,t,o);i&&h(a,o);n(t)&&p(a,o);return t}))}function o(t,e){function n(t,e){for(var n=[];t!==e;t=t.nextSibling)n.push(t);for(e=0;e<n.length;e++)d(a,n[e])}r(t,"insertAdjacentHTML",(function(t,o){t=t.toLowerCase();if("beforebegin"===t){var i=this.previousSibling;e.call(this,t,o);n(i||this.parentNode.firstChild,this)}else if("afterbegin"===t)i=this.firstChild,e.call(this,t,o),n(this.firstChild,i);else if("beforeend"===t)i=this.lastChild,e.call(this,t,o),n(i||this.firstChild,null);else if("afterend"===t)i=this.nextSibling,e.call(this,t,o),n(this.nextSibling,i);else throw new SyntaxError("The value provided ("+String(t)+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.")}))}var a=st;H&&r(Element.prototype,"attachShadow",(function(t){t=H.call(this,t);var e=a;if(e.b&&!t.__CE_patched){t.__CE_patched=!0;for(var n=0;n<e.c.length;n++)e.c[n](t)}return this.__CE_shadowRoot=t}));R&&R.get?t(Element.prototype,R):Y&&Y.get?t(HTMLElement.prototype,Y):s(a,(function(e){t(e,{enumerable:!0,configurable:!0,get:function(){return A.call(this,!0).innerHTML},set:function(t){var e="template"===this.localName,n=e?this.content:this,o=C.call(document,this.namespaceURI,this.localName);for(o.innerHTML=t;0<n.childNodes.length;)L.call(n,n.childNodes[0]);for(t=e?o.content:o;0<t.childNodes.length;)O.call(n,t.childNodes[0])}})}));r(Element.prototype,"setAttribute",(function(t,e){if(1!==this.__CE_state)return F.call(this,t,e);var n=P.call(this,t);F.call(this,t,e);e=P.call(this,t);a.attributeChangedCallback(this,t,n,e,null)}));r(Element.prototype,"setAttributeNS",(function(t,e,n){if(1!==this.__CE_state)return U.call(this,t,e,n);var o=z.call(this,t,e);U.call(this,t,e,n);n=z.call(this,t,e);a.attributeChangedCallback(this,e,o,n,t)}));r(Element.prototype,"removeAttribute",(function(t){if(1!==this.__CE_state)return I.call(this,t);var e=P.call(this,t);I.call(this,t);null!==e&&a.attributeChangedCallback(this,t,e,null,null)}));r(Element.prototype,"removeAttributeNS",(function(t,e){if(1!==this.__CE_state)return W.call(this,t,e);var n=z.call(this,t,e);W.call(this,t,e);var o=z.call(this,t,e);n!==o&&a.attributeChangedCallback(this,e,n,o,t)}));Z?e(HTMLElement.prototype,Z):q?e(Element.prototype,q):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched.");tt?o(HTMLElement.prototype,tt):B?o(Element.prototype,B):console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched.");ot(a,Element.prototype,{h:$,append:V});at(a)}var lt=window.customElements;if(!lt||lt.forcePolyfill||"function"!=typeof lt.define||"function"!=typeof lt.get){var st=new a;nt();it();ot(st,DocumentFragment.prototype,{h:D,append:k});rt();ct();document.__CE_hasRegistry=!0;var ut=new w(st);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:ut})}}).call(self);"string"!==typeof document.baseURI&&Object.defineProperty(Document.prototype,"baseURI",{enumerable:!0,configurable:!0,get:function(){var t=document.querySelector("base");return t&&t.href?t.href:document.URL}});"function"!==typeof window.CustomEvent&&(window.CustomEvent=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail);return n},window.CustomEvent.prototype=window.Event.prototype);(function(t,e,n){t.composedPath||(t.composedPath=function(){if(this.path)return this.path;var t=this.target;for(this.path=[];null!==t.parentNode;)this.path.push(t),t=t.parentNode;this.path.push(e,n);return this.path})})(Event.prototype,document,window); | ||
| /*! | ||
| Element.closest and Element.matches | ||
| https://github.com/jonathantneal/closest | ||
| Creative Commons Zero v1.0 Universal | ||
| */(function(t){"function"!==typeof t.matches&&(t.matches=t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||function(t){t=(this.document||this.ownerDocument).querySelectorAll(t);for(var e=0;t[e]&&t[e]!==this;)++e;return!!t[e]});"function"!==typeof t.closest&&(t.closest=function(t){for(var e=this;e&&1===e.nodeType;){if(e.matches(t))return e;e=e.parentNode}return null})})(window.Element.prototype); | ||
| /*! | ||
| Element.getRootNode() | ||
| */(function(t){function e(t){t=n(t);return t&&11===t.nodeType?e(t.host):t}function n(t){return t&&t.parentNode?n(t.parentNode):t}"function"!==typeof t.getRootNode&&(t.getRootNode=function(t){return t&&t.composed?e(this):n(this)})})(Element.prototype); | ||
| /*! | ||
| Element.isConnected() | ||
| */(function(t){"isConnected"in t||Object.defineProperty(t,"isConnected",{configurable:!0,enumerable:!0,get:function(){var t=this.getRootNode({composed:!0});return t&&9===t.nodeType}})})(Element.prototype); | ||
| /*! | ||
| Element.remove() | ||
| */(function(t){t.forEach((function(t){t.hasOwnProperty("remove")||Object.defineProperty(t,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this)}})}))})([Element.prototype,CharacterData.prototype,DocumentType.prototype]); | ||
| /*! | ||
| Element.classList | ||
| */!function(t){"classList"in t||Object.defineProperty(t,"classList",{get:function(){var t=this,e=(t.getAttribute("class")||"").replace(/^\s+|\s$/g,"").split(/\s+/g);function n(){e.length>0?t.setAttribute("class",e.join(" ")):t.removeAttribute("class")}return""===e[0]&&e.splice(0,1),e.toggle=function(t,o){void 0!==o?o?e.add(t):e.remove(t):-1!==e.indexOf(t)?e.splice(e.indexOf(t),1):e.push(t),n()},e.add=function(){for(var t=[].slice.call(arguments),o=0,i=t.length;o<i;o++)-1===e.indexOf(t[o])&&e.push(t[o]);n()},e.remove=function(){for(var t=[].slice.call(arguments),o=0,i=t.length;o<i;o++)-1!==e.indexOf(t[o])&&e.splice(e.indexOf(t[o]),1);n()},e.item=function(t){return e[t]},e.contains=function(t){return-1!==e.indexOf(t)},e.replace=function(t,o){-1!==e.indexOf(t)&&e.splice(e.indexOf(t),1,o),n()},e.value=t.getAttribute("class")||"",e}})}(Element.prototype); | ||
| /*! | ||
| DOMTokenList | ||
| */(function(t){try{document.body.classList.add()}catch(o){var e=t.add,n=t.remove;t.add=function(){for(var t=0;t<arguments.length;t++)e.call(this,arguments[t])};t.remove=function(){for(var t=0;t<arguments.length;t++)n.call(this,arguments[t])}}})(DOMTokenList.prototype)}}})); |
| var n=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};var t={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},r="{",i="}",u={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},e="--",o="@media",f="@";function s(n,t,r){n.lastIndex=0;var i=t.substring(r).match(n);if(i){var u=r+i.index;return{start:u,end:u+i[0].length}}return null}var a=/\bvar\(/,c=/\B--[\w-]+\s*:/,v=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,h=/^[\t ]+\n/gm;function l(n,t,r){var i=function(n,t){var r=s(a,n,t);if(!r)return null;var i=function(n,t){for(var r=0,i=t;i<n.length;i++){var u=n[i];if("("===u)r++;else if(")"===u&&--r<=0)return i+1}return i}(n,r.start),u=n.substring(r.end,i-1).split(","),e=u[0],o=u.slice(1);return{start:r.start,end:i,propName:e.trim(),fallback:o.length>0?o.join(",").trim():void 0}}(n,r);if(!i)return t.push(n.substring(r,n.length)),n.length;var u=i.propName,e=null!=i.fallback?d(i.fallback):void 0;return t.push(n.substring(r,i.start),(function(n){return function(n,t,r){return n[t]?n[t]:r?m(r,n):""}(n,u,e)})),i.end}function m(n,t){for(var r="",i=0;i<n.length;i++){var u=n[i];r+="string"==typeof u?u:u(t)}return r}function p(n,t){for(var r=!1,i=!1,u=t;u<n.length;u++){var e=n[u];if(r)i&&'"'===e&&(r=!1),i||"'"!==e||(r=!1);else if('"'===e)r=!0,i=!0;else if("'"===e)r=!0,i=!1;else{if(";"===e)return u+1;if("}"===e)return u}}return u}function d(n){var t=0;n=function(n){for(var t="",r=0;;){var i=s(c,n,r),u=i?i.start:n.length;if(t+=n.substring(r,u),!i)break;r=p(n,u)}return t}(n=n.replace(v,"")).replace(h,"");for(var r=[];t<n.length;)t=l(n,r,t);return r}function y(n){var t={};n.forEach((function(n){n.declarations.forEach((function(n){t[n.prop]=n.value}))}));for(var r={},i=Object.entries(t),u=function(){var n=!1;if(i.forEach((function(t){var i=t[0],u=m(t[1],r);u!==r[i]&&(r[i]=u,n=!0)})),!n)return"break"},e=0;e<10&&"break"!==u();e++);return r}function g(n,r){if(void 0===r&&(r=0),!n.rules)return[];var i=[];return n.rules.filter((function(n){return n.type===t.STYLE_RULE})).forEach((function(n){var t=function(n){for(var t,r=[];t=w.exec(n.trim());){var i=b(t[2]),u=i.value,e=i.important;r.push({prop:t[1].trim(),value:d(u),important:e})}return r}(n.cssText);t.length>0&&n.parsedSelector.split(",").forEach((function(n){n=n.trim(),i.push({selector:n,declarations:t,specificity:1,nu:r})})),r++})),i}var w=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function b(n){var t=(n=n.replace(/\s+/gim," ").trim()).endsWith("!important");return t&&(n=n.substr(0,n.length-10).trim()),{value:n,important:t}}function E(n){var t=[];return n.forEach((function(n){t.push.apply(t,n.selectors)})),t}function k(s){var a=function(s){return function n(r,i){var s=i.substring(r.start,r.end-1);if(r.parsedCssText=r.cssText=s.trim(),r.parent){s=(s=(s=function(n){return n.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var n=arguments[1],t=6-n.length;t--;)n="0"+n;return"\\"+n}))}(s=i.substring(r.previous?r.previous.end:r.parent.start,r.start-1))).replace(u.multipleSpaces," ")).substring(s.lastIndexOf(";")+1);var a=r.parsedSelector=r.selector=s.trim();r.atRule=0===a.indexOf(f),r.atRule?0===a.indexOf(o)?r.type=t.MEDIA_RULE:a.match(u.keyframesRule)&&(r.type=t.KEYFRAMES_RULE,r.keyframesName=r.selector.split(u.multipleSpaces).pop()):r.type=0===a.indexOf(e)?t.MIXIN_RULE:t.STYLE_RULE}var c=r.rules;if(c)for(var v=0,h=c.length,l=void 0;v<h&&(l=c[v]);v++)n(l,i);return r}(function(t){var u=new n;u.start=0,u.end=t.length;for(var e=u,o=0,f=t.length;o<f;o++)if(t[o]===r){e.rules||(e.rules=[]);var s=e,a=s.rules[s.rules.length-1]||null;(e=new n).start=o+1,e.parent=s,e.previous=a,s.rules.push(e)}else t[o]===i&&(e.end=o+1,e=e.parent||u);return u}(s=function(n){return n.replace(u.comments,"").replace(u.port,"")}(s)),s)}(s),c=d(s);return{original:s,template:c,selectors:g(a),usesCssVars:c.length>1}}function M(n,t){if(n.some((function(n){return n.styleEl===t})))return!1;var r=k(t.textContent);return r.styleEl=t,n.push(r),!0}function O(n){var t=y(E(n));n.forEach((function(n){n.usesCssVars&&(n.styleEl.textContent=m(n.template,t))}))}function R(n,t,r){return function(n,t,r){return n.replace(RegExp(t,"g"),r)}(n,"\\."+t,"."+r)}function A(n,t){return Array.from(n.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(n){return M(t,n)})).some(Boolean)}function L(n,t,r){var i=r.href;return fetch(i).then((function(n){return n.text()})).then((function(u){if(function(n){return n.indexOf("var(")>-1||$.test(n)}(u)&&r.parentNode){(function(n){return j.lastIndex=0,j.test(n)})(u)&&(u=function(n,t){var r=t.replace(/[^/]*$/,"");return n.replace(j,(function(n,t){return n.replace(t,r+t)}))}(u,i));var e=n.createElement("style");e.setAttribute("data-styles",""),e.textContent=u,M(t,e),r.parentNode.insertBefore(e,r),r.remove()}})).catch((function(n){console.error(n)}))}var $=/[\s;{]--[-a-zA-Z0-9]+\s*:/m,j=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim,P=function(){function n(n,t){this.win=n,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return n.prototype.i=function(){var n=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){n.win.requestAnimationFrame((function(){(function(n,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){A(n,t)&&O(t)})).observe(document.head,{childList:!0})})(n.doc,n.globalScopes),function(n,t){return A(n,t),function(n,t){for(var r=[],i=n.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),u=0;u<i.length;u++)r.push(L(n,t,i[u]));return Promise.all(r)}(n,t).then((function(){O(t)}))}(n.doc,n.globalScopes).then((function(){return t()}))}))})))},n.prototype.addLink=function(n){var t=this;return L(this.doc,this.globalScopes,n).then((function(){t.updateGlobal()}))},n.prototype.addGlobalStyle=function(n){M(this.globalScopes,n)&&this.updateGlobal()},n.prototype.createHostStyle=function(n,t,r,i){if(this.hostScopeMap.has(n))throw Error("host style already created");var u=this.registerHostTemplate(r,t,i),e=this.doc.createElement("style");return e.setAttribute("data-no-shim",""),u.usesCssVars?i?(e["s-sc"]=t=u.scopeId+"-"+this.count,e.textContent="/*needs update*/",this.hostStyleMap.set(n,e),this.hostScopeMap.set(n,function(n,t){var r=n.template.map((function(r){return"string"==typeof r?R(r,n.scopeId,t):r})),i=n.selectors.map((function(r){return Object.assign(Object.assign({},r),{selector:R(r.selector,n.scopeId,t)})}));return Object.assign(Object.assign({},n),{template:r,selectors:i,scopeId:t})}(u,t)),this.count++):(u.styleEl=e,u.usesCssVars||(e.textContent=m(u.template,{})),this.globalScopes.push(u),this.updateGlobal(),this.hostScopeMap.set(n,u)):e.textContent=r,e},n.prototype.removeHost=function(n){var t=this.hostStyleMap.get(n);t&&t.remove(),this.hostStyleMap.delete(n),this.hostScopeMap.delete(n)},n.prototype.updateHost=function(n){var t=this.hostScopeMap.get(n);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(n);if(r){var i=y(function(n,t,r){var i=[],u=function(n,t){for(var r=[];t;){var i=n.get(t);i&&r.push(i),t=t.parentElement}return r}(t,n);return r.forEach((function(n){return i.push(n)})),u.forEach((function(n){return i.push(n)})),function(n){return n.sort((function(n,t){return n.specificity===t.specificity?n.nu-t.nu:n.specificity-t.specificity})),n}(E(i).filter((function(t){return function(n,t){return":root"===t||"html"===t||n.matches(t)}(n,t.selector)})))}(n,this.hostScopeMap,this.globalScopes));r.textContent=m(t.template,i)}}},n.prototype.updateGlobal=function(){O(this.globalScopes)},n.prototype.registerHostTemplate=function(n,t,r){var i=this.scopesMap.get(t);return i||((i=k(n)).scopeId=t,i.isScoped=r,this.scopesMap.set(t,i)),i},n}();!function(n){!n||n.__cssshim||n.CSS&&n.CSS.supports&&n.CSS.supports("color","var(--c)")||(n.__cssshim=new P(n,n.document))}("undefined"!=typeof window&&window); |
| import{r as i,c as t,h as s,g as e}from"./p-ee2647c7.js";const o=class{constructor(s){i(this,s),this.editorEvent=t(this,"editorEvent",7),this.content="",this.modalOpen=!1}sendMessage(i,t){this.editorFrame.contentWindow.postMessage({action:i,data:t},"*")}async save(i={}){this.sendMessage("save",i)}async test(){console.log("Only a test")}async spinner(i){["hide","show"].includes(i)||(i="hide"),this.sendMessage("showSpinner",{behavior:i})}async start(i){this.sendMessage("load",i)}async sendTest(i){this.sendMessage("sendTest",i)}async load(i){this.sendMessage("load",i)}async preview(i){this.sendMessage("preview",i)}async initConfig(){this.config.rteToolbars&&this.config.rteToolbars.toolbar_0&&this.config.rteToolbars.toolbar_0 instanceof Promise&&(this.config.rteToolbars.toolbar_0=await this.config.rteToolbars.toolbar_0),this.config.lang&&this.config.lang.custom&&this.config.lang.custom instanceof Promise&&(this.config.lang.custom=await this.config.lang.custom),this.config.rteToolbars&&this.config.rteToolbars.toolbar_1&&this.config.rteToolbars.toolbar_1 instanceof Promise&&(this.config.rteToolbars.toolbar_1=await this.config.rteToolbars.toolbar_1);const i=void 0!==this.config.debug&&this.config.debug;this.editorUrl=this.config.editorUrl||"//editor.mailstyler.com",this.mscFrameworkUrl=i?"http://localhost:4200":this.editorUrl}async componentWillRender(){await this.initConfig(),console.info("MailStyler Plugin: load assets")}render(){return s("iframe",{class:{open:this.modalOpen},src:this.mscFrameworkUrl})}editorDidOpen(){this.load(this.content||"").then(()=>console.log("MailStyler Plugin: Template is loaded succesfully"))}listenMessage(i){if(i.data&&i.data.action){const{action:t,data:s}=i.data;if("appOk"===t)console.info("MailStyler Plugin: Editor is ready!"),this.editorDidOpen();else if("appReady"===t){let i=Object.assign({},this.config);Object.keys(i).filter(t=>"function"==typeof i[t]).forEach(t=>delete i[t]),this.sendMessage("init",{token:this.token,hostname:window.location.hostname,config:i})}else if("appSave"===t){const i=new RegExp('bgcolor="none"',"g");s.html=s.html.replace(i,""),s.raw_html=s.raw_html.replace(i,""),"function"==typeof this.config.onSave?this.config.onSave(s.html,s.raw_html,s.json,s.opts):console.error("MailStyler Plugin: You should provide a valid onSave callback")}else if("appAutoSave"===t){const i=new RegExp('bgcolor="none"',"g");s.html=s.html.replace(i,""),s.raw_html=s.raw_html.replace(i,""),"function"==typeof this.config.onAutoSave?this.config.onAutoSave(s.html,s.raw_html,s.json,s.opts):console.error("MailStyler Plugin: You should provide a valid onAutoSave callback")}else if("appSaveBlock"===t){const i=new RegExp('bgcolor="none"',"g");s.html=s.html.replace(i,""),s.raw_html=s.raw_html.replace(i,""),"function"==typeof this.config.onSaveBlock?this.config.onSaveBlock(s.html,s.raw_html):console.error("MailStyler Plugin: You should provide a valid onSaveBlock callback")}else"appModal"===t&&(this.modalOpen="open"===s.env);this.editorEvent.emit({action:t,data:s})}}componentWillLoad(i){this.editorFrame=this.element.shadowRoot.querySelector("iframe"),i&&this.listenMessage(i)}get element(){return e(this)}};o.style=":host{display:block;width:100%;border:0;height:100vh}iframe{height:100%;width:100%;min-width:1024px;border:0;z-index:9999;top:0}iframe.open{position:fixed}";export{o as ms_editor} |
| self,function(){var t=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function n(n){var i=t.has(n);return n=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(n),!i&&n}function i(t){var n=t.isConnected;if(void 0!==n)return n;for(;t&&!(t.__CE_isImportDocument||t instanceof Document);)t=t.parentNode||(window.ShadowRoot&&t instanceof ShadowRoot?t.host:void 0);return!(!t||!(t.__CE_isImportDocument||t instanceof Document))}function e(t,n){for(;n&&n!==t&&!n.nextSibling;)n=n.parentNode;return n&&n!==t?n.nextSibling:null}function o(t,n,i){i=void 0===i?new Set:i;for(var r=t;r;){if(r.nodeType===Node.ELEMENT_NODE){var f=r;n(f);var c=f.localName;if("link"===c&&"import"===f.getAttribute("rel")){if((r=f.import)instanceof Node&&!i.has(r))for(i.add(r),r=r.firstChild;r;r=r.nextSibling)o(r,n,i);r=e(t,f);continue}if("template"===c){r=e(t,f);continue}if(f=f.__CE_shadowRoot)for(f=f.firstChild;f;f=f.nextSibling)o(f,n,i)}r=r.firstChild?r.firstChild:e(t,r)}}function r(t,n,i){t[n]=i}function f(){this.a=new Map,this.g=new Map,this.c=[],this.f=[],this.b=!1}function c(t,n){t.b&&o(n,(function(n){return u(t,n)}))}function u(t,n){if(t.b&&!n.__CE_patched){n.__CE_patched=!0;for(var i=0;i<t.c.length;i++)t.c[i](n);for(i=0;i<t.f.length;i++)t.f[i](n)}}function s(t,n){var i=[];for(o(n,(function(t){return i.push(t)})),n=0;n<i.length;n++){var e=i[n];1===e.__CE_state?t.connectedCallback(e):l(t,e)}}function a(t,n){var i=[];for(o(n,(function(t){return i.push(t)})),n=0;n<i.length;n++){var e=i[n];1===e.__CE_state&&t.disconnectedCallback(e)}}function h(t,n,i){var e=(i=void 0===i?{}:i).u||new Set,r=i.i||function(n){return l(t,n)},f=[];if(o(n,(function(n){if("link"===n.localName&&"import"===n.getAttribute("rel")){var i=n.import;i instanceof Node&&(i.__CE_isImportDocument=!0,i.__CE_hasRegistry=!0),i&&"complete"===i.readyState?i.__CE_documentLoadHandled=!0:n.addEventListener("load",(function(){var i=n.import;if(!i.__CE_documentLoadHandled){i.__CE_documentLoadHandled=!0;var o=new Set(e);o.delete(i),h(t,i,{u:o,i:r})}}))}else f.push(n)}),e),t.b)for(n=0;n<f.length;n++)u(t,f[n]);for(n=0;n<f.length;n++)r(f[n])}function l(t,n){if(void 0===n.__CE_state){var e=n.ownerDocument;if((e.defaultView||e.__CE_isImportDocument&&e.__CE_hasRegistry)&&(e=t.a.get(n.localName))){e.constructionStack.push(n);var o=e.constructorFunction;try{try{if(new o!==n)throw Error("The custom element constructor did not produce the element being upgraded.")}finally{e.constructionStack.pop()}}catch(c){throw n.__CE_state=2,c}if(n.__CE_state=1,n.__CE_definition=e,e.attributeChangedCallback)for(e=e.observedAttributes,o=0;o<e.length;o++){var r=e[o],f=n.getAttribute(r);null!==f&&t.attributeChangedCallback(n,r,null,f,null)}i(n)&&t.connectedCallback(n)}}}function d(t){var n=document;this.c=t,this.a=n,this.b=void 0,h(this.c,this.a),"loading"===this.a.readyState&&(this.b=new MutationObserver(this.f.bind(this)),this.b.observe(this.a,{childList:!0,subtree:!0}))}function w(t){t.b&&t.b.disconnect()}function v(){var t=this;this.b=this.a=void 0,this.c=new Promise((function(n){t.b=n,t.a&&n(t.a)}))}function m(t){if(t.a)throw Error("Already resolved.");t.a=void 0,t.b&&t.b(void 0)}function b(t){this.c=!1,this.a=t,this.j=new Map,this.f=function(t){return t()},this.b=!1,this.g=[],this.o=new d(t)}f.prototype.connectedCallback=function(t){var n=t.__CE_definition;n.connectedCallback&&n.connectedCallback.call(t)},f.prototype.disconnectedCallback=function(t){var n=t.__CE_definition;n.disconnectedCallback&&n.disconnectedCallback.call(t)},f.prototype.attributeChangedCallback=function(t,n,i,e,o){var r=t.__CE_definition;r.attributeChangedCallback&&-1<r.observedAttributes.indexOf(n)&&r.attributeChangedCallback.call(t,n,i,e,o)},d.prototype.f=function(t){var n=this.a.readyState;for("interactive"!==n&&"complete"!==n||w(this),n=0;n<t.length;n++)for(var i=t[n].addedNodes,e=0;e<i.length;e++)h(this.c,i[e])},b.prototype.l=function(t,i){var e=this;if(!(i instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!n(t))throw new SyntaxError("The element name '"+t+"' is not valid.");if(this.a.a.get(t))throw Error("A custom element with name '"+t+"' has already been defined.");if(this.c)throw Error("A custom element is already being defined.");this.c=!0;try{var o=function(t){var n=r[t];if(void 0!==n&&!(n instanceof Function))throw Error("The '"+t+"' callback must be a function.");return n},r=i.prototype;if(!(r instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");var f=o("connectedCallback"),c=o("disconnectedCallback"),u=o("adoptedCallback"),s=o("attributeChangedCallback"),a=i.observedAttributes||[]}catch(d){return}finally{this.c=!1}(function(t,n,i){t.a.set(n,i),t.g.set(i.constructorFunction,i)})(this.a,t,i={localName:t,constructorFunction:i,connectedCallback:f,disconnectedCallback:c,adoptedCallback:u,attributeChangedCallback:s,observedAttributes:a,constructionStack:[]}),this.g.push(i),this.b||(this.b=!0,this.f((function(){return function(t){if(!1!==t.b){t.b=!1;for(var n=t.g,i=[],e=new Map,o=0;o<n.length;o++)e.set(n[o].localName,[]);for(h(t.a,document,{i:function(n){if(void 0===n.__CE_state){var o=n.localName,r=e.get(o);r?r.push(n):t.a.a.get(o)&&i.push(n)}}}),o=0;o<i.length;o++)l(t.a,i[o]);for(;0<n.length;){var r=n.shift();o=r.localName,r=e.get(r.localName);for(var f=0;f<r.length;f++)l(t.a,r[f]);(o=t.j.get(o))&&m(o)}}}(e)})))},b.prototype.i=function(t){h(this.a,t)},b.prototype.get=function(t){if(t=this.a.a.get(t))return t.constructorFunction},b.prototype.m=function(t){if(!n(t))return Promise.reject(new SyntaxError("'"+t+"' is not a valid custom element name."));var i=this.j.get(t);return i||(i=new v,this.j.set(t,i),this.a.a.get(t)&&!this.g.some((function(n){return n.localName===t}))&&m(i)),i.c},b.prototype.s=function(t){w(this.o);var n=this.f;this.f=function(i){return t((function(){return n(i)}))}},window.CustomElementRegistry=b,b.prototype.define=b.prototype.l,b.prototype.upgrade=b.prototype.i,b.prototype.get=b.prototype.get,b.prototype.whenDefined=b.prototype.m,b.prototype.polyfillWrapFlushCallback=b.prototype.s;var E=window.Document.prototype.createElement,p=window.Document.prototype.createElementNS,g=window.Document.prototype.importNode,y=window.Document.prototype.prepend,C=window.Document.prototype.append,T=window.DocumentFragment.prototype.prepend,j=window.DocumentFragment.prototype.append,D=window.Node.prototype.cloneNode,N=window.Node.prototype.appendChild,A=window.Node.prototype.insertBefore,O=window.Node.prototype.removeChild,M=window.Node.prototype.replaceChild,k=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),L=window.Element.prototype.attachShadow,S=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),F=window.Element.prototype.getAttribute,H=window.Element.prototype.setAttribute,x=window.Element.prototype.removeAttribute,z=window.Element.prototype.getAttributeNS,P=window.Element.prototype.setAttributeNS,R=window.Element.prototype.removeAttributeNS,$=window.Element.prototype.insertAdjacentElement,_=window.Element.prototype.insertAdjacentHTML,B=window.Element.prototype.prepend,I=window.Element.prototype.append,U=window.Element.prototype.before,W=window.Element.prototype.after,q=window.Element.prototype.replaceWith,G=window.Element.prototype.remove,J=window.HTMLElement,K=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),Q=window.HTMLElement.prototype.insertAdjacentElement,V=window.HTMLElement.prototype.insertAdjacentHTML,X=new function(){};function Y(t,n,e){function o(n){return function(e){for(var o=[],r=0;r<arguments.length;++r)o[r]=arguments[r];r=[];for(var f=[],c=0;c<o.length;c++){var u=o[c];if(u instanceof Element&&i(u)&&f.push(u),u instanceof DocumentFragment)for(u=u.firstChild;u;u=u.nextSibling)r.push(u);else r.push(u)}for(n.apply(this,o),o=0;o<f.length;o++)a(t,f[o]);if(i(this))for(o=0;o<r.length;o++)(f=r[o])instanceof Element&&s(t,f)}}void 0!==e.h&&(n.prepend=o(e.h)),void 0!==e.append&&(n.append=o(e.append))}var Z=window.customElements;if(!Z||Z.forcePolyfill||"function"!=typeof Z.define||"function"!=typeof Z.get){var tt=new f;!function(){var t=tt;window.HTMLElement=function(){function n(){var n=this.constructor,i=t.g.get(n);if(!i)throw Error("The custom element being constructed was not registered with `customElements`.");var e=i.constructionStack;if(0===e.length)return e=E.call(document,i.localName),Object.setPrototypeOf(e,n.prototype),e.__CE_state=1,e.__CE_definition=i,u(t,e),e;var o=e[i=e.length-1];if(o===X)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.");return e[i]=X,Object.setPrototypeOf(o,n.prototype),u(t,o),o}return Object.defineProperty(n.prototype=J.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:n}),n}()}(),function(){var t=tt;r(Document.prototype,"createElement",(function(n){if(this.__CE_hasRegistry){var i=t.a.get(n);if(i)return new i.constructorFunction}return n=E.call(this,n),u(t,n),n})),r(Document.prototype,"importNode",(function(n,i){return n=g.call(this,n,!!i),this.__CE_hasRegistry?h(t,n):c(t,n),n})),r(Document.prototype,"createElementNS",(function(n,i){if(this.__CE_hasRegistry&&(null===n||"http://www.w3.org/1999/xhtml"===n)){var e=t.a.get(i);if(e)return new e.constructorFunction}return n=p.call(this,n,i),u(t,n),n})),Y(t,Document.prototype,{h:y,append:C})}(),Y(tt,DocumentFragment.prototype,{h:T,append:j}),function(){function t(t,e){Object.defineProperty(t,"textContent",{enumerable:e.enumerable,configurable:!0,get:e.get,set:function(t){if(this.nodeType===Node.TEXT_NODE)e.set.call(this,t);else{var o=void 0;if(this.firstChild){var r=this.childNodes,f=r.length;if(0<f&&i(this)){o=Array(f);for(var c=0;c<f;c++)o[c]=r[c]}}if(e.set.call(this,t),o)for(t=0;t<o.length;t++)a(n,o[t])}}})}var n=tt;r(Node.prototype,"insertBefore",(function(t,e){if(t instanceof DocumentFragment){var o=Array.prototype.slice.apply(t.childNodes);if(t=A.call(this,t,e),i(this))for(e=0;e<o.length;e++)s(n,o[e]);return t}return o=i(t),e=A.call(this,t,e),o&&a(n,t),i(this)&&s(n,t),e})),r(Node.prototype,"appendChild",(function(t){if(t instanceof DocumentFragment){var e=Array.prototype.slice.apply(t.childNodes);if(t=N.call(this,t),i(this))for(var o=0;o<e.length;o++)s(n,e[o]);return t}return e=i(t),o=N.call(this,t),e&&a(n,t),i(this)&&s(n,t),o})),r(Node.prototype,"cloneNode",(function(t){return t=D.call(this,!!t),this.ownerDocument.__CE_hasRegistry?h(n,t):c(n,t),t})),r(Node.prototype,"removeChild",(function(t){var e=i(t),o=O.call(this,t);return e&&a(n,t),o})),r(Node.prototype,"replaceChild",(function(t,e){if(t instanceof DocumentFragment){var o=Array.prototype.slice.apply(t.childNodes);if(t=M.call(this,t,e),i(this))for(a(n,e),e=0;e<o.length;e++)s(n,o[e]);return t}o=i(t);var r=M.call(this,t,e),f=i(this);return f&&a(n,e),o&&a(n,t),f&&s(n,t),r})),k&&k.get?t(Node.prototype,k):function(t,n){t.b=!0,t.c.push(n)}(n,(function(n){t(n,{enumerable:!0,configurable:!0,get:function(){for(var t=[],n=0;n<this.childNodes.length;n++){var i=this.childNodes[n];i.nodeType!==Node.COMMENT_NODE&&t.push(i.textContent)}return t.join("")},set:function(t){for(;this.firstChild;)O.call(this,this.firstChild);null!=t&&""!==t&&N.call(this,document.createTextNode(t))}})}))}(),function(){function t(t,n){Object.defineProperty(t,"innerHTML",{enumerable:n.enumerable,configurable:!0,get:n.get,set:function(t){var e=this,r=void 0;if(i(this)&&(r=[],o(this,(function(t){t!==e&&r.push(t)}))),n.set.call(this,t),r)for(var u=0;u<r.length;u++){var s=r[u];1===s.__CE_state&&f.disconnectedCallback(s)}return this.ownerDocument.__CE_hasRegistry?h(f,this):c(f,this),t}})}function n(t,n){r(t,"insertAdjacentElement",(function(t,e){var o=i(e);return t=n.call(this,t,e),o&&a(f,e),i(t)&&s(f,e),t}))}function e(t,n){function i(t,n){for(var i=[];t!==n;t=t.nextSibling)i.push(t);for(n=0;n<i.length;n++)h(f,i[n])}r(t,"insertAdjacentHTML",(function(t,e){if("beforebegin"===(t=t.toLowerCase())){var o=this.previousSibling;n.call(this,t,e),i(o||this.parentNode.firstChild,this)}else if("afterbegin"===t)o=this.firstChild,n.call(this,t,e),i(this.firstChild,o);else if("beforeend"===t)o=this.lastChild,n.call(this,t,e),i(o||this.firstChild,null);else{if("afterend"!==t)throw new SyntaxError("The value provided ("+t+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");o=this.nextSibling,n.call(this,t,e),i(this.nextSibling,o)}}))}var f=tt;L&&r(Element.prototype,"attachShadow",(function(t){t=L.call(this,t);var n=f;if(n.b&&!t.__CE_patched){t.__CE_patched=!0;for(var i=0;i<n.c.length;i++)n.c[i](t)}return this.__CE_shadowRoot=t})),S&&S.get?t(Element.prototype,S):K&&K.get?t(HTMLElement.prototype,K):function(t,n){t.b=!0,t.f.push(n)}(f,(function(n){t(n,{enumerable:!0,configurable:!0,get:function(){return D.call(this,!0).innerHTML},set:function(t){var n="template"===this.localName,i=n?this.content:this,e=p.call(document,this.namespaceURI,this.localName);for(e.innerHTML=t;0<i.childNodes.length;)O.call(i,i.childNodes[0]);for(t=n?e.content:e;0<t.childNodes.length;)N.call(i,t.childNodes[0])}})})),r(Element.prototype,"setAttribute",(function(t,n){if(1!==this.__CE_state)return H.call(this,t,n);var i=F.call(this,t);H.call(this,t,n),n=F.call(this,t),f.attributeChangedCallback(this,t,i,n,null)})),r(Element.prototype,"setAttributeNS",(function(t,n,i){if(1!==this.__CE_state)return P.call(this,t,n,i);var e=z.call(this,t,n);P.call(this,t,n,i),i=z.call(this,t,n),f.attributeChangedCallback(this,n,e,i,t)})),r(Element.prototype,"removeAttribute",(function(t){if(1!==this.__CE_state)return x.call(this,t);var n=F.call(this,t);x.call(this,t),null!==n&&f.attributeChangedCallback(this,t,n,null,null)})),r(Element.prototype,"removeAttributeNS",(function(t,n){if(1!==this.__CE_state)return R.call(this,t,n);var i=z.call(this,t,n);R.call(this,t,n);var e=z.call(this,t,n);i!==e&&f.attributeChangedCallback(this,n,i,e,t)})),Q?n(HTMLElement.prototype,Q):$?n(Element.prototype,$):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched."),V?e(HTMLElement.prototype,V):_?e(Element.prototype,_):console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched."),Y(f,Element.prototype,{h:B,append:I}),function(t){function n(n){return function(e){for(var o=[],r=0;r<arguments.length;++r)o[r]=arguments[r];r=[];for(var f=[],c=0;c<o.length;c++){var u=o[c];if(u instanceof Element&&i(u)&&f.push(u),u instanceof DocumentFragment)for(u=u.firstChild;u;u=u.nextSibling)r.push(u);else r.push(u)}for(n.apply(this,o),o=0;o<f.length;o++)a(t,f[o]);if(i(this))for(o=0;o<r.length;o++)(f=r[o])instanceof Element&&s(t,f)}}var e=Element.prototype;void 0!==U&&(e.before=n(U)),void 0!==U&&(e.after=n(W)),void 0!==q&&r(e,"replaceWith",(function(n){for(var e=[],o=0;o<arguments.length;++o)e[o]=arguments[o];o=[];for(var r=[],f=0;f<e.length;f++){var c=e[f];if(c instanceof Element&&i(c)&&r.push(c),c instanceof DocumentFragment)for(c=c.firstChild;c;c=c.nextSibling)o.push(c);else o.push(c)}for(f=i(this),q.apply(this,e),e=0;e<r.length;e++)a(t,r[e]);if(f)for(a(t,this),e=0;e<o.length;e++)(r=o[e])instanceof Element&&s(t,r)})),void 0!==G&&r(e,"remove",(function(){var n=i(this);G.call(this),n&&a(t,this)}))}(f)}(),document.__CE_hasRegistry=!0;var nt=new b(tt);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:nt})}}(),"string"!=typeof document.baseURI&&Object.defineProperty(Document.prototype,"baseURI",{enumerable:!0,configurable:!0,get:function(){var t=document.querySelector("base");return t&&t.href?t.href:document.URL}}),"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(t,n){n=n||{bubbles:!1,cancelable:!1,detail:void 0};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,n.bubbles,n.cancelable,n.detail),i},window.CustomEvent.prototype=window.Event.prototype),function(t,n,i){t.composedPath||(t.composedPath=function(){if(this.path)return this.path;var t=this.target;for(this.path=[];null!==t.parentNode;)this.path.push(t),t=t.parentNode;return this.path.push(n,i),this.path})}(Event.prototype,document,window), | ||
| /*! | ||
| Element.closest and Element.matches | ||
| https://github.com/jonathantneal/closest | ||
| Creative Commons Zero v1.0 Universal | ||
| */ | ||
| function(t){"function"!=typeof t.matches&&(t.matches=t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||function(t){t=(this.document||this.ownerDocument).querySelectorAll(t);for(var n=0;t[n]&&t[n]!==this;)++n;return!!t[n]}),"function"!=typeof t.closest&&(t.closest=function(t){for(var n=this;n&&1===n.nodeType;){if(n.matches(t))return n;n=n.parentNode}return null})}(window.Element.prototype), | ||
| /*! | ||
| Element.getRootNode() | ||
| */ | ||
| function(t){function n(t){return t&&t.parentNode?n(t.parentNode):t}"function"!=typeof t.getRootNode&&(t.getRootNode=function(t){return t&&t.composed?function t(i){return(i=n(i))&&11===i.nodeType?t(i.host):i}(this):n(this)})}(Element.prototype), | ||
| /*! | ||
| Element.isConnected() | ||
| */ | ||
| function(t){"isConnected"in t||Object.defineProperty(t,"isConnected",{configurable:!0,enumerable:!0,get:function(){var t=this.getRootNode({composed:!0});return t&&9===t.nodeType}})}(Element.prototype),[Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach((function(t){t.hasOwnProperty("remove")||Object.defineProperty(t,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this)}})})),function(t){"classList"in t||Object.defineProperty(t,"classList",{get:function(){var t=this,n=(t.getAttribute("class")||"").replace(/^\s+|\s$/g,"").split(/\s+/g);function i(){n.length>0?t.setAttribute("class",n.join(" ")):t.removeAttribute("class")}return""===n[0]&&n.splice(0,1),n.toggle=function(t,e){void 0!==e?e?n.add(t):n.remove(t):-1!==n.indexOf(t)?n.splice(n.indexOf(t),1):n.push(t),i()},n.add=function(){for(var t=[].slice.call(arguments),e=0,o=t.length;e<o;e++)-1===n.indexOf(t[e])&&n.push(t[e]);i()},n.remove=function(){for(var t=[].slice.call(arguments),e=0,o=t.length;e<o;e++)-1!==n.indexOf(t[e])&&n.splice(n.indexOf(t[e]),1);i()},n.item=function(t){return n[t]},n.contains=function(t){return-1!==n.indexOf(t)},n.replace=function(t,e){-1!==n.indexOf(t)&&n.splice(n.indexOf(t),1,e),i()},n.value=t.getAttribute("class")||"",n}})}(Element.prototype), | ||
| /*! | ||
| DOMTokenList | ||
| */ | ||
| function(t){try{document.body.classList.add()}catch(e){var n=t.add,i=t.remove;t.add=function(){for(var t=0;t<arguments.length;t++)n.call(this,arguments[t])},t.remove=function(){for(var t=0;t<arguments.length;t++)i.call(this,arguments[t])}}}(DOMTokenList.prototype); |
| System.register(["./p-dec69e97.system.js"],(function(e,r){"use strict";var t,n,o,s,i,c;return{setters:[function(e){t=e.C;n=e.p;o=e.w;s=e.a;i=e.d;c=e.N}],execute:function(){var a=function(){};var u=typeof Deno!=="undefined";var f=!u&&typeof global!=="undefined"&&typeof require==="function"&&!!global.process&&typeof __filename==="string"&&(!global.origin||typeof global.origin!=="string");var p=u&&Deno.build.os==="windows";var l=f?process.cwd:u?Deno.cwd:function(){return"/"};var m=f?process.exit:u?Deno.exit:a;var d=function(e){return"__sc_import_"+e.replace(/\s|-/g,"_")};var v=e("a",(function(){if(!(t&&t.supports&&t.supports("color","var(--c)"))){return r.import("./p-03188b5b.system.js").then((function(){if(n.$cssShim$=o.__cssshim){return n.$cssShim$.i()}else{return 0}}))}return s()}));var w=e("p",(function(){{n.$cssShim$=o.__cssshim}var e=Array.from(i.querySelectorAll("script")).find((function(e){return new RegExp("/"+c+"(\\.esm)?\\.js($|\\?|#)").test(e.src)||e.getAttribute("data-stencil-namespace")===c}));var t=e["data-opts"]||{};if("onbeforeload"in e&&!history.scrollRestoration){return{then:function(){}}}{t.resourcesUrl=new URL(".",new URL(e.getAttribute("data-resources-url")||e.src,o.location.href)).href;{g(t.resourcesUrl,e)}if(!o.customElements){return r.import("./p-0b8ecd50.system.js").then((function(){return t}))}}return s(t)}));var g=function(e,r){var t=d(c);try{o[t]=new Function("w","return import(w);//"+Math.random())}catch(s){var n=new Map;o[t]=function(s){var c=new URL(s,e).href;var a=n.get(c);if(!a){var u=i.createElement("script");u.type="module";u.crossOrigin=r.crossOrigin;u.src=URL.createObjectURL(new Blob(["import * as m from '"+c+"'; window."+t+".m = m;"],{type:"application/javascript"}));a=new Promise((function(e){u.onload=function(){e(o[t].m);u.remove()}}));n.set(c,a);i.head.appendChild(u)}return a}}}}}})); |
| var __spreadArrays=this&&this.__spreadArrays||function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),a=0,e=0;e<t;e++)for(var s=arguments[e],c=0,o=s.length;c<o;c++,a++)n[a]=s[c];return n};System.register([],(function(r){"use strict";return{execute:function(){ | ||
| /** | ||
| * @license | ||
| * Copyright Google Inc. All Rights Reserved. | ||
| * | ||
| * Use of this source code is governed by an MIT-style license that can be | ||
| * found in the LICENSE file at https://angular.io/license | ||
| * | ||
| * This file is a port of shadowCSS from webcomponents.js to TypeScript. | ||
| * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js | ||
| * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts | ||
| */ | ||
| var e=function(r){var e=[];var t=0;var n;r=r.replace(/(\[[^\]]*\])/g,(function(r,n){var a="__ph-"+t+"__";e.push(n);t++;return a}));n=r.replace(/(:nth-[-\w]+)(\([^)]+\))/g,(function(r,n,a){var s="__ph-"+t+"__";e.push(a);t++;return n+s}));var a={content:n,placeholders:e};return a};var t=function(r,e){return e.replace(/__ph-(\d+)__/g,(function(e,t){return r[+t]}))};var n="-shadowcsshost";var a="-shadowcssslotted";var s="-shadowcsscontext";var c=")(?:\\(("+"(?:\\([^)(]*\\)|[^)(]*)+?"+")\\))?([^,{]*)";var o=new RegExp("("+n+c,"gim");var i=new RegExp("("+s+c,"gim");var v=new RegExp("("+a+c,"gim");var u=n+"-no-combinator";var l=/-shadowcsshost-no-combinator([^\s]*)/;var f=[/::shadow/g,/::content/g];var p="([>\\s~+[.,{:][\\s\\S]*)?$";var h=/-shadowcsshost/gim;var g=/:host/gim;var d=/::slotted/gim;var m=/:host-context/gim;var _=/\/\*\s*[\s\S]*?\*\//g;var x=function(r){return r.replace(_,"")};var w=/\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;var S=function(r){return r.match(w)||[]};var b=/(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;var W=/([{}])/g;var O="{";var j="}";var E="%BLOCK%";var R=function(r,e){var t=y(r);var n=0;return t.escapedString.replace(b,(function(){var r=[];for(var a=0;a<arguments.length;a++){r[a]=arguments[a]}var s=r[2];var c="";var o=r[4];var i="";if(o&&o.startsWith("{"+E)){c=t.blocks[n++];o=o.substring(E.length+1);i="{"}var v={selector:s,content:c};var u=e(v);return""+r[1]+u.selector+r[3]+i+u.content+o}))};var y=function(r){var e=r.split(W);var t=[];var n=[];var a=0;var s=[];for(var c=0;c<e.length;c++){var o=e[c];if(o===j){a--}if(a>0){s.push(o)}else{if(s.length>0){n.push(s.join(""));t.push(E);s=[]}t.push(o)}if(o===O){a++}}if(s.length>0){n.push(s.join(""));t.push(E)}var i={escapedString:t.join(""),blocks:n};return i};var k=function(r){r=r.replace(m,s).replace(g,n).replace(d,a);return r};var A=function(r,e,t){return r.replace(e,(function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}if(r[2]){var n=r[2].split(",");var a=[];for(var s=0;s<n.length;s++){var c=n[s].trim();if(!c)break;a.push(t(u,c,r[3]))}return a.join(",")}else{return u+r[3]}}))};var T=function(r,e,t){return r+e.replace(n,"")+t};var C=function(r){return A(r,o,T)};var L=function(r,e,t){if(e.indexOf(n)>-1){return T(r,e,t)}else{return r+e+t+", "+e+" "+r+t}};var B=function(r,e){var t="."+e+" > ";var n=[];r=r.replace(v,(function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}if(r[2]){var a=r[2].trim();var s=r[3];var c=t+a+s;var o="";for(var i=r[4]-1;i>=0;i--){var v=r[5][i];if(v==="}"||v===","){break}o=v+o}var l=o+c;var f=""+o.trimRight()+c.trim();if(l.trim()!==f.trim()){var p=f+", "+l;n.push({orgSelector:l,updatedSelector:p})}return c}else{return u+r[3]}}));return{selectors:n,cssText:r}};var I=function(r){return A(r,i,L)};var K=function(r){return f.reduce((function(r,e){return r.replace(e," ")}),r)};var $=function(r){var e=/\[/g;var t=/\]/g;r=r.replace(e,"\\[").replace(t,"\\]");return new RegExp("^("+r+")"+p,"m")};var M=function(r,e){var t=$(e);return!t.test(r)};var U=function(r,e,t){h.lastIndex=0;if(h.test(r)){var n="."+t;return r.replace(l,(function(r,e){return e.replace(/([^:]*)(:*)(.*)/,(function(r,e,t,a){return e+n+t+a}))})).replace(h,n+" ")}return e+" "+r};var q=function(r,n,a){var s=/\[is=([^\]]*)\]/g;n=n.replace(s,(function(r){var e=[];for(var t=1;t<arguments.length;t++){e[t-1]=arguments[t]}return e[0]}));var c="."+n;var o=function(r){var e=r.trim();if(!e){return""}if(r.indexOf(u)>-1){e=U(r,n,a)}else{var t=r.replace(h,"");if(t.length>0){var s=t.match(/([^:]*)(:*)(.*)/);if(s){e=s[1]+c+s[2]+s[3]}}}return e};var i=e(r);r=i.content;var v="";var l=0;var f;var p=/( |>|\+|~(?!=))\s*/g;var g=r.indexOf(u)>-1;var d=!g;while((f=p.exec(r))!==null){var m=f[1];var _=r.slice(l,f.index).trim();d=d||_.indexOf(u)>-1;var x=d?o(_):_;v+=x+" "+m+" ";l=p.lastIndex}var w=r.substring(l);d=d||w.indexOf(u)>-1;v+=d?o(w):w;return t(i.placeholders,v)};var z=function(r,e,t,n){return r.split(",").map((function(r){if(n&&r.indexOf("."+n)>-1){return r.trim()}if(M(r,e)){return q(r,e,t).trim()}else{return r.trim()}})).join(", ")};var D=function(r,e,t,n,a){return R(r,(function(r){var a=r.selector;var s=r.content;if(r.selector[0]!=="@"){a=z(r.selector,e,t,n)}else if(r.selector.startsWith("@media")||r.selector.startsWith("@supports")||r.selector.startsWith("@page")||r.selector.startsWith("@document")){s=D(r.content,e,t,n)}var c={selector:a.replace(/\s{2,}/g," ").trim(),content:s};return c}))};var F=function(r,e,t,n,a){r=k(r);r=C(r);r=I(r);var s=B(r,n);r=s.cssText;r=K(r);if(e){r=D(r,e,t,n)}r=r.replace(/-shadowcsshost-no-combinator/g,"."+t);r=r.replace(/>\s*\*\s+([^{, ]+)/gm," $1 ");return{cssText:r.trim(),slottedSelectors:s.selectors}};var G=r("scopeCss",(function(r,e,t){var n=e+"-h";var a=e+"-s";var s=S(r);r=x(r);var c=[];if(t){var o=function(r){var e="/*!@___"+c.length+"___*/";var t="/*!@"+r.selector+"*/";c.push({placeholder:e,comment:t});r.selector=e+r.selector;return r};r=R(r,(function(r){if(r.selector[0]!=="@"){return o(r)}else if(r.selector.startsWith("@media")||r.selector.startsWith("@supports")||r.selector.startsWith("@page")||r.selector.startsWith("@document")){r.content=R(r.content,o);return r}return r}))}var i=F(r,e,n,a);r=__spreadArrays([i.cssText],s).join("\n");if(t){c.forEach((function(e){var t=e.placeholder,n=e.comment;r=r.replace(t,n)}))}i.slottedSelectors.forEach((function(e){r=r.replace(e.orgSelector,e.updatedSelector)}));return r}))}}})); |
| var __awaiter=this&&this.__awaiter||function(t,e,o,n){function i(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,r){function a(t){try{l(n.next(t))}catch(e){r(e)}}function s(t){try{l(n["throw"](t))}catch(e){r(e)}}function l(t){t.done?o(t.value):i(t.value).then(a,s)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return l([t,e])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(o)try{if(n=1,i&&(r=a[0]&2?i["return"]:a[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;if(i=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;i=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(a[0]===6&&o.label<r[1]){o.label=r[1];r=a;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(a);break}if(r[2])o.ops.pop();o.trys.pop();continue}a=e.call(t,o)}catch(s){a=[6,s];i=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-dec69e97.system.js"],(function(t){"use strict";var e,o,n,i;return{setters:[function(t){e=t.r;o=t.c;n=t.h;i=t.g}],execute:function(){var r=":host{display:block;width:100%;border:0;height:100vh}iframe{height:100%;width:100%;min-width:1024px;border:0;z-index:9999;top:0}iframe.open{position:fixed}";var a=t("ms_editor",function(){function t(t){e(this,t);this.editorEvent=o(this,"editorEvent",7);this.content="";this.modalOpen=false}t.prototype.sendMessage=function(t,e){this.editorFrame.contentWindow.postMessage({action:t,data:e},"*")};t.prototype.save=function(t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.sendMessage("save",t);return[2]}))}))};t.prototype.test=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){console.log("Only a test");return[2]}))}))};t.prototype.spinner=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!["hide","show"].includes(t)){t="hide"}this.sendMessage("showSpinner",{behavior:t});return[2]}))}))};t.prototype.start=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.sendMessage("load",t);return[2]}))}))};t.prototype.sendTest=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.sendMessage("sendTest",t);return[2]}))}))};t.prototype.load=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.sendMessage("load",t);return[2]}))}))};t.prototype.preview=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.sendMessage("preview",t);return[2]}))}))};t.prototype.initConfig=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,o,n;return __generator(this,(function(i){switch(i.label){case 0:if(!(this.config.rteToolbars&&this.config.rteToolbars.toolbar_0&&this.config.rteToolbars.toolbar_0 instanceof Promise))return[3,2];t=this.config.rteToolbars;return[4,this.config.rteToolbars.toolbar_0];case 1:t.toolbar_0=i.sent();i.label=2;case 2:if(!(this.config.lang&&this.config.lang.custom&&this.config.lang.custom instanceof Promise))return[3,4];e=this.config.lang;return[4,this.config.lang.custom];case 3:e.custom=i.sent();i.label=4;case 4:if(!(this.config.rteToolbars&&this.config.rteToolbars.toolbar_1&&this.config.rteToolbars.toolbar_1 instanceof Promise))return[3,6];o=this.config.rteToolbars;return[4,this.config.rteToolbars.toolbar_1];case 5:o.toolbar_1=i.sent();i.label=6;case 6:n=typeof this.config.debug!=="undefined"&&this.config.debug;this.editorUrl=this.config.editorUrl||"//editor.mailstyler.com";this.mscFrameworkUrl=n?"http://localhost:4200":this.editorUrl;return[2]}}))}))};t.prototype.componentWillRender=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.initConfig()];case 1:t.sent();console.info("MailStyler Plugin: load assets");return[2]}}))}))};t.prototype.render=function(){return n("iframe",{class:{open:this.modalOpen},src:this.mscFrameworkUrl})};t.prototype.editorDidOpen=function(){var t=this.content||"";this.load(t).then((function(t){return console.log("MailStyler Plugin: Template is loaded succesfully")}))};t.prototype.listenMessage=function(t){if(t.data&&t.data.action){var e=t.data,o=e.action,n=e.data;if(o==="appOk"){console.info("MailStyler Plugin: Editor is ready!");this.editorDidOpen()}else if(o==="appReady"){var i=Object.assign({},this.config);Object.keys(i).filter((function(t){return typeof i[t]==="function"})).forEach((function(t){return delete i[t]}));this.sendMessage("init",{token:this.token,hostname:window.location.hostname,config:i})}else if(o==="appSave"){var r=new RegExp('bgcolor="none"',"g");n.html=n.html.replace(r,"");n.raw_html=n.raw_html.replace(r,"");if("function"==typeof this.config.onSave){this.config.onSave(n.html,n.raw_html,n.json,n.opts)}else{console.error("MailStyler Plugin: You should provide a valid onSave callback")}}else if(o==="appAutoSave"){var r=new RegExp('bgcolor="none"',"g");n.html=n.html.replace(r,"");n.raw_html=n.raw_html.replace(r,"");if("function"==typeof this.config.onAutoSave){this.config.onAutoSave(n.html,n.raw_html,n.json,n.opts)}else{console.error("MailStyler Plugin: You should provide a valid onAutoSave callback")}}else if(o==="appSaveBlock"){var r=new RegExp('bgcolor="none"',"g");n.html=n.html.replace(r,"");n.raw_html=n.raw_html.replace(r,"");if("function"==typeof this.config.onSaveBlock){this.config.onSaveBlock(n.html,n.raw_html)}else{console.error("MailStyler Plugin: You should provide a valid onSaveBlock callback")}}else if(o==="appModal"){this.modalOpen=n.env==="open"}this.editorEvent.emit({action:o,data:n})}};t.prototype.componentWillLoad=function(t){this.editorFrame=this.element.shadowRoot.querySelector("iframe");if(t){this.listenMessage(t)}};Object.defineProperty(t.prototype,"element",{get:function(){return i(this)},enumerable:false,configurable:true});return t}());a.style=r}}})); |
| System.register(["./p-dec69e97.system.js","./p-6cd84c75.system.js"],(function(){"use strict";var e,t;return{setters:[function(t){e=t.b},function(e){t=e.p}],execute:function(){t().then((function(t){return e([["p-8d27655c.system",[[1,"ms-editor",{token:[1],config:[8],content:[1],modalOpen:[32],save:[64],test:[64],spinner:[64],start:[64],sendTest:[64],load:[64],preview:[64]},[[8,"message","componentWillLoad"]]]]]],t)}))}}})); |
| var __extends=this&&this.__extends||function(){var e=function(n,r){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var r in n)if(n.hasOwnProperty(r))e[r]=n[r]};return e(n,r)};return function(n,r){e(n,r);function t(){this.constructor=n}n.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}}();var __awaiter=this&&this.__awaiter||function(e,n,r,t){function a(e){return e instanceof r?e:new r((function(n){n(e)}))}return new(r||(r=Promise))((function(r,i){function o(e){try{l(t.next(e))}catch(n){i(n)}}function s(e){try{l(t["throw"](e))}catch(n){i(n)}}function l(e){e.done?r(e.value):a(e.value).then(o,s)}l((t=t.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,a,i,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(n){return l([e,n])}}function l(o){if(t)throw new TypeError("Generator is already executing.");while(r)try{if(t=1,a&&(i=o[0]&2?a["return"]:o[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,o[1])).done)return i;if(a=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;a=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1];i=o;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(o);break}if(i[2])r.ops.pop();r.trys.pop();continue}o=n.call(e,r)}catch(s){o=[6,s];a=0}finally{t=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};var __spreadArrays=this&&this.__spreadArrays||function(){for(var e=0,n=0,r=arguments.length;n<r;n++)e+=arguments[n].length;for(var t=Array(e),a=0,n=0;n<r;n++)for(var i=arguments[n],o=0,s=i.length;o<s;o++,a++)t[a]=i[o];return t};System.register([],(function(e,n){"use strict";return{execute:function(){var r=this;var t=e("N","msf-editor");var a;var i;var o=false;var s=0;var l=false;var u=e("w",typeof window!=="undefined"?window:{});var f=e("C",u.CSS);var $=e("d",u.document||{head:{}});var c=e("p",{$flags$:0,$resourcesUrl$:"",jmp:function(e){return e()},raf:function(e){return requestAnimationFrame(e)},ael:function(e,n,r,t){return e.addEventListener(n,r,t)},rel:function(e,n,r,t){return e.removeEventListener(n,r,t)},ce:function(e,n){return new CustomEvent(e,n)}});var v=function(){return($.head.attachShadow+"").indexOf("[native")>-1}();var d=e("a",(function(e){return Promise.resolve(e)}));var h=function(){try{new CSSStyleSheet;return true}catch(e){}return false}();var p=function(e,n,r,t){if(r){r.map((function(r){var t=r[0],a=r[1],i=r[2];var o=g(e,t);var s=m(n,i);var l=y(t);c.ael(o,a,s,l);(n.$rmListeners$=n.$rmListeners$||[]).push((function(){return c.rel(o,a,s,l)}))}))}};var m=function(e,n){return function(r){{if(e.$flags$&256){e.$lazyInstance$[n](r)}else{(e.$queuedListeners$=e.$queuedListeners$||[]).push([n,r])}}}};var g=function(e,n){if(n&8)return u;return e};var y=function(e){return(e&2)!==0};var b="{visibility:hidden}.hydrated{visibility:inherit}";var w=function(e,n){if(n===void 0){n=""}{return function(){return}}};var S=function(e,n){{return function(){return}}};var _=new WeakMap;var R=function(e,n,r){var t=xe.get(e);if(h&&r){t=t||new CSSStyleSheet;t.replace(n)}else{t=n}xe.set(e,t)};var L=function(e,n,r,t){var a=C(n);var i=xe.get(a);e=e.nodeType===11?e:$;if(i){if(typeof i==="string"){e=e.head||e;var o=_.get(e);var s=void 0;if(!o){_.set(e,o=new Set)}if(!o.has(a)){{if(c.$cssShim$){s=c.$cssShim$.createHostStyle(t,a,i,!!(n.$flags$&10));var l=s["s-sc"];if(l){a=l;o=null}}else{s=$.createElement("style");s.innerHTML=i}e.insertBefore(s,e.querySelector("link"))}if(o){o.add(a)}}}else if(!e.adoptedStyleSheets.includes(i)){e.adoptedStyleSheets=__spreadArrays(e.adoptedStyleSheets,[i])}}return a};var N=function(e){var n=e.$cmpMeta$;var r=e.$hostElement$;var t=n.$flags$;var a=w("attachStyles",n.$tagName$);var i=L(v&&r.shadowRoot?r.shadowRoot:r.getRootNode(),n,e.$modeName$,r);if(t&10){r["s-sc"]=i;r.classList.add(i+"-h")}a()};var C=function(e,n){return"sc-"+e.$tagName$};var x={};var j=function(e){return e!=null};var E=function(){};var M=function(e){e=typeof e;return e==="object"||e==="function"};var P=typeof Deno!=="undefined";var k=!P&&typeof global!=="undefined"&&typeof require==="function"&&!!global.process&&typeof __filename==="string"&&(!global.origin||typeof global.origin!=="string");var I=P&&Deno.build.os==="windows";var A=k?process.cwd:P?Deno.cwd:function(){return"/"};var O=k?process.exit:P?Deno.exit:E;var q=e("h",(function(e,n){var r=[];for(var t=2;t<arguments.length;t++){r[t-2]=arguments[t]}var a=null;var i=false;var o=false;var s=[];var l=function(n){for(var r=0;r<n.length;r++){a=n[r];if(Array.isArray(a)){l(a)}else if(a!=null&&typeof a!=="boolean"){if(i=typeof e!=="function"&&!M(a)){a=String(a)}if(i&&o){s[s.length-1].$text$+=a}else{s.push(i?B(null,a):a)}o=i}}};l(r);if(n){{var u=n.className||n.class;if(u){n.class=typeof u!=="object"?u:Object.keys(u).filter((function(e){return u[e]})).join(" ")}}}var f=B(e,null);f.$attrs$=n;if(s.length>0){f.$children$=s}return f}));var B=function(e,n){var r={$flags$:0,$tag$:e,$text$:n,$elm$:null,$children$:null};{r.$attrs$=null}return r};var T={};var U=function(e){return e&&e.$tag$===T};var z=function(e,n,r,t,a,i){if(r!==t){var o=Re(e,n);var s=n.toLowerCase();if(n==="class"){var l=e.classList;var u=D(r);var f=D(t);l.remove.apply(l,u.filter((function(e){return e&&!f.includes(e)})));l.add.apply(l,f.filter((function(e){return e&&!u.includes(e)})))}else{var $=M(t);if((o||$&&t!==null)&&!a){try{if(!e.tagName.includes("-")){var c=t==null?"":t;if(n==="list"){o=false}else if(r==null||e[n]!=c){e[n]=c}}else{e[n]=t}}catch(v){}}if(t==null||t===false){if(t!==false||e.getAttribute(n)===""){{e.removeAttribute(n)}}}else if((!o||i&4||a)&&!$){t=t===true?"":t;{e.setAttribute(n,t)}}}}};var H=/\s/;var D=function(e){return!e?[]:e.split(H)};var V=function(e,n,r,t){var a=n.$elm$.nodeType===11&&n.$elm$.host?n.$elm$.host:n.$elm$;var i=e&&e.$attrs$||x;var o=n.$attrs$||x;{for(t in i){if(!(t in o)){z(a,t,i[t],undefined,r,n.$flags$)}}}for(t in o){z(a,t,i[t],o[t],r,n.$flags$)}};var W=function(e,n,r,t){var i=n.$children$[r];var s=0;var l;var u;{l=i.$elm$=$.createElement(i.$tag$);{V(null,i,o)}if(j(a)&&l["s-si"]!==a){l.classList.add(l["s-si"]=a)}if(i.$children$){for(s=0;s<i.$children$.length;++s){u=W(e,i,s);if(u){l.appendChild(u)}}}}return l};var F=function(e,n,r,t,a,o){var s=e;var l;if(s.shadowRoot&&s.tagName===i){s=s.shadowRoot}for(;a<=o;++a){if(t[a]){l=W(null,r,a);if(l){t[a].$elm$=l;s.insertBefore(l,n)}}}};var G=function(e,n,r,t,a){for(;n<=r;++n){if(t=e[n]){a=t.$elm$;a.remove()}}};var Q=function(e,n,r,t){var a=0;var i=0;var o=n.length-1;var s=n[0];var l=n[o];var u=t.length-1;var f=t[0];var $=t[u];var c;while(a<=o&&i<=u){if(s==null){s=n[++a]}else if(l==null){l=n[--o]}else if(f==null){f=t[++i]}else if($==null){$=t[--u]}else if(J(s,f)){K(s,f);s=n[++a];f=t[++i]}else if(J(l,$)){K(l,$);l=n[--o];$=t[--u]}else if(J(s,$)){K(s,$);e.insertBefore(s.$elm$,l.$elm$.nextSibling);s=n[++a];$=t[--u]}else if(J(l,f)){K(l,f);e.insertBefore(l.$elm$,s.$elm$);l=n[--o];f=t[++i]}else{{c=W(n&&n[i],r,i);f=t[++i]}if(c){{s.$elm$.parentNode.insertBefore(c,s.$elm$)}}}}if(a>o){F(e,t[u+1]==null?null:t[u+1].$elm$,r,t,i,u)}else if(i>u){G(n,a,o)}};var J=function(e,n){if(e.$tag$===n.$tag$){return true}return false};var K=function(e,n){var r=n.$elm$=e.$elm$;var t=e.$children$;var a=n.$children$;{{{V(e,n,o)}}if(t!==null&&a!==null){Q(r,t,n,a)}else if(a!==null){F(r,null,n,a,0,a.length-1)}else if(t!==null){G(t,0,t.length-1)}}};var X=function(e,n){var r=e.$hostElement$;var t=e.$vnode$||B(null,null);var o=U(n)?n:q(null,null,n);i=r.tagName;o.$tag$=null;o.$flags$|=4;e.$vnode$=o;o.$elm$=t.$elm$=r.shadowRoot||r;{a=r["s-sc"]}K(t,o)};var Y=e("g",(function(e){return we(e).$hostElement$}));var Z=e("c",(function(e,n,r){var t=Y(e);return{emit:function(e){return ee(t,n,{bubbles:!!(r&4),composed:!!(r&2),cancelable:!!(r&1),detail:e})}}}));var ee=function(e,n,r){var t=c.ce(n,r);e.dispatchEvent(t);return t};var ne=function(e,n){if(n&&!e.$onRenderResolve$&&n["s-p"]){n["s-p"].push(new Promise((function(n){return e.$onRenderResolve$=n})))}};var re=function(e,n){{e.$flags$|=16}if(e.$flags$&4){e.$flags$|=512;return}ne(e,e.$ancestorComponent$);var r=function(){return te(e,n)};return qe(r)};var te=function(e,n){var r=w("scheduleUpdate",e.$cmpMeta$.$tagName$);var t=e.$lazyInstance$;var a;if(n){{e.$flags$|=256;if(e.$queuedListeners$){e.$queuedListeners$.map((function(e){var n=e[0],r=e[1];return ue(t,n,r)}));e.$queuedListeners$=null}}{a=ue(t,"componentWillLoad")}}{a=fe(a,(function(){return ue(t,"componentWillRender")}))}r();return fe(a,(function(){return ae(e,t,n)}))};var ae=function(e,n,r){var t=e.$hostElement$;var a=w("update",e.$cmpMeta$.$tagName$);var i=t["s-rc"];if(r){N(e)}var o=w("render",e.$cmpMeta$.$tagName$);{{X(e,ie(e,n))}}if(c.$cssShim$){c.$cssShim$.updateHost(t)}if(i){i.map((function(e){return e()}));t["s-rc"]=undefined}o();a();{var s=t["s-p"];var l=function(){return oe(e)};if(s.length===0){l()}else{Promise.all(s).then(l);e.$flags$|=4;s.length=0}}};var ie=function(e,n){try{n=n.render();{e.$flags$&=~16}{e.$flags$|=2}}catch(r){Le(r)}return n};var oe=function(e){var n=e.$cmpMeta$.$tagName$;var r=e.$hostElement$;var t=w("postUpdate",n);var a=e.$ancestorComponent$;if(!(e.$flags$&64)){e.$flags$|=64;{$e(r)}t();{e.$onReadyResolve$(r);if(!a){le()}}}else{t()}{e.$onInstanceResolve$(r)}{if(e.$onRenderResolve$){e.$onRenderResolve$();e.$onRenderResolve$=undefined}if(e.$flags$&512){Oe((function(){return re(e,false)}))}e.$flags$&=~(4|512)}};var se=function(e){{var n=we(e);var r=n.$hostElement$.isConnected;if(r&&(n.$flags$&(2|16))===2){re(n,false)}return r}};var le=function(e){{$e($.documentElement)}{c.$flags$|=2}Oe((function(){return ee(u,"appload",{detail:{namespace:t}})}))};var ue=function(e,n,r){if(e&&e[n]){try{return e[n](r)}catch(t){Le(t)}}return undefined};var fe=function(e,n){return e&&e.then?e.then(n):n()};var $e=function(e){return e.classList.add("hydrated")};var ce=function(e,n){if(e!=null&&!M(e)){if(n&1){return String(e)}return e}return e};var ve=function(e,n){return we(e).$instanceValues$.get(n)};var de=function(e,n,r,t){var a=we(e);var i=a.$instanceValues$.get(n);var o=a.$flags$;var s=a.$lazyInstance$;r=ce(r,t.$members$[n][0]);if((!(o&8)||i===undefined)&&r!==i){a.$instanceValues$.set(n,r);if(s){if((o&(2|16))===2){re(a,false)}}}};var he=function(e,n,r){if(n.$members$){var t=Object.entries(n.$members$);var a=e.prototype;t.map((function(e){var t=e[0],i=e[1][0];if(i&31||r&2&&i&32){Object.defineProperty(a,t,{get:function(){return ve(this,t)},set:function(e){de(this,t,e,n)},configurable:true,enumerable:true})}else if(r&1&&i&64){Object.defineProperty(a,t,{value:function(){var e=[];for(var n=0;n<arguments.length;n++){e[n]=arguments[n]}var r=we(this);return r.$onInstancePromise$.then((function(){var n;return(n=r.$lazyInstance$)[t].apply(n,e)}))}})}}));if(r&1){var i=new Map;a.attributeChangedCallback=function(e,n,r){var t=this;c.jmp((function(){var n=i.get(e);t[n]=r===null&&typeof t[n]==="boolean"?false:r}))};e.observedAttributes=t.filter((function(e){var n=e[0],r=e[1];return r[0]&15})).map((function(e){var n=e[0],r=e[1];var t=r[1]||n;i.set(t,n);return t}))}}return e};var pe=function(e,t,a,i,o){return __awaiter(r,void 0,void 0,(function(){var e,r,i,s,l,u,f;return __generator(this,(function($){switch($.label){case 0:if(!((t.$flags$&32)===0))return[3,5];t.$flags$|=32;o=Ce(a);if(!o.then)return[3,2];e=S();return[4,o];case 1:o=$.sent();e();$.label=2;case 2:if(!o.isProxied){he(o,a,2);o.isProxied=true}r=w("createInstance",a.$tagName$);{t.$flags$|=8}try{new o(t)}catch(c){Le(c)}{t.$flags$&=~8}r();if(!o.style)return[3,5];i=o.style;s=C(a);if(!!xe.has(s))return[3,5];l=w("registerStyles",a.$tagName$);if(!(a.$flags$&8))return[3,4];return[4,n.import("./p-7f0a8d9c.system.js").then((function(e){return e.scopeCss(i,s,false)}))];case 3:i=$.sent();$.label=4;case 4:R(s,i,!!(a.$flags$&1));l();$.label=5;case 5:u=t.$ancestorComponent$;f=function(){return re(t,true)};if(u&&u["s-rc"]){u["s-rc"].push(f)}else{f()}return[2]}}))}))};var me=function(e){if((c.$flags$&1)===0){var n=we(e);var r=n.$cmpMeta$;var t=w("connectedCallback",r.$tagName$);if(!(n.$flags$&1)){n.$flags$|=1;{var a=e;while(a=a.parentNode||a.host){if(a["s-p"]){ne(n,n.$ancestorComponent$=a);break}}}if(r.$members$){Object.entries(r.$members$).map((function(n){var r=n[0],t=n[1][0];if(t&31&&e.hasOwnProperty(r)){var a=e[r];delete e[r];e[r]=a}}))}{Oe((function(){return pe(e,n,r)}))}}else{p(e,n,r.$listeners$)}t()}};var ge=function(e){if((c.$flags$&1)===0){var n=we(e);{if(n.$rmListeners$){n.$rmListeners$.map((function(e){return e()}));n.$rmListeners$=undefined}}if(c.$cssShim$){c.$cssShim$.removeHost(e)}}};var ye=e("b",(function(e,n){if(n===void 0){n={}}var r=w();var t=[];var a=n.exclude||[];var i=u.customElements;var o=$.head;var s=o.querySelector("meta[charset]");var l=$.createElement("style");var f=[];var d;var h=true;Object.assign(c,n);c.$resourcesUrl$=new URL(n.resourcesUrl||"./",$.baseURI).href;{if(n.syncQueue){c.$flags$|=4}}e.map((function(e){return e[1].map((function(n){var r={$flags$:n[0],$tagName$:n[1],$members$:n[2],$listeners$:n[3]};{r.$members$=n[2]}{r.$listeners$=n[3]}if(!v&&r.$flags$&1){r.$flags$|=8}var o=r.$tagName$;var s=function(e){__extends(n,e);function n(n){var t=e.call(this,n)||this;n=t;_e(n,r);if(r.$flags$&1){if(v){{n.attachShadow({mode:"open"})}}else if(!("shadowRoot"in n)){n.shadowRoot=n}}return t}n.prototype.connectedCallback=function(){var e=this;if(d){clearTimeout(d);d=null}if(h){f.push(this)}else{c.jmp((function(){return me(e)}))}};n.prototype.disconnectedCallback=function(){var e=this;c.jmp((function(){return ge(e)}))};n.prototype.forceUpdate=function(){se(this)};n.prototype.componentOnReady=function(){return we(this).$onReadyPromise$};return n}(HTMLElement);r.$lazyBundleId$=e[0];if(!a.includes(o)&&!i.get(o)){t.push(o);i.define(o,he(s,r,1))}}))}));{l.innerHTML=t+b;l.setAttribute("data-styles","");o.insertBefore(l,s?s.nextSibling:o.firstChild)}h=false;if(f.length){f.map((function(e){return e.connectedCallback()}))}else{{c.jmp((function(){return d=setTimeout(le,30)}))}}r()}));var be=new WeakMap;var we=function(e){return be.get(e)};var Se=e("r",(function(e,n){return be.set(n.$lazyInstance$=e,n)}));var _e=function(e,n){var r={$flags$:0,$hostElement$:e,$cmpMeta$:n,$instanceValues$:new Map};{r.$onInstancePromise$=new Promise((function(e){return r.$onInstanceResolve$=e}))}{r.$onReadyPromise$=new Promise((function(e){return r.$onReadyResolve$=e}));e["s-p"]=[];e["s-rc"]=[]}p(e,r,n.$listeners$);return be.set(e,r)};var Re=function(e,n){return n in e};var Le=function(e){return console.error(e)};var Ne=new Map;var Ce=function(e,r,t){var a=e.$tagName$.replace(/-/g,"_");var i=e.$lazyBundleId$;var o=Ne.get(i);if(o){return o[a]}return n.import("./"+i+".entry.js"+"").then((function(e){{Ne.set(i,e)}return e[a]}),Le)};var xe=new Map;var je=[];var Ee=[];var Me=[];var Pe=function(e,n){return function(r){e.push(r);if(!l){l=true;if(n&&c.$flags$&4){Oe(Ae)}else{c.raf(Ae)}}}};var ke=function(e){for(var n=0;n<e.length;n++){try{e[n](performance.now())}catch(r){Le(r)}}e.length=0};var Ie=function(e,n){var r=0;var t=0;while(r<e.length&&(t=performance.now())<n){try{e[r++](t)}catch(a){Le(a)}}if(r===e.length){e.length=0}else if(r!==0){e.splice(0,r)}};var Ae=function(){{s++}ke(je);{var e=(c.$flags$&6)===2?performance.now()+14*Math.ceil(s*(1/10)):Infinity;Ie(Ee,e);Ie(Me,e);if(Ee.length>0){Me.push.apply(Me,Ee);Ee.length=0}if(l=je.length+Ee.length+Me.length>0){c.raf(Ae)}else{s=0}}};var Oe=function(e){return d().then(e)};var qe=Pe(Ee,true)}}})); |
| import{C as e,p as o,w as s,a as t,d as n,N as r}from"./p-ee2647c7.js";const a="undefined"!=typeof Deno,p=!(a||"undefined"==typeof global||"function"!=typeof require||!global.process||"string"!=typeof __filename||global.origin&&"string"==typeof global.origin),i=(a&&Deno,p?process:a&&Deno,p?process:a&&Deno,()=>e&&e.supports&&e.supports("color","var(--c)")?t():__sc_import_msf_editor("./p-24fc4ba9.js").then(()=>(o.o=s.__cssshim)?(!1).i():0)),c=()=>{o.o=s.__cssshim;const e=Array.from(n.querySelectorAll("script")).find(e=>RegExp(`/${r}(\\.esm)?\\.js($|\\?|#)`).test(e.src)||e.getAttribute("data-stencil-namespace")===r),a=e["data-opts"]||{};return"onbeforeload"in e&&!history.scrollRestoration?{then(){}}:(a.resourcesUrl=new URL(".",new URL(e.getAttribute("data-resources-url")||e.src,s.location.href)).href,m(a.resourcesUrl,e),s.customElements?t(a):__sc_import_msf_editor("./p-46109683.js").then(()=>a))},m=(e,o)=>{const t="__sc_import_"+r.replace(/\s|-/g,"_");try{s[t]=Function("w","return import(w);//"+Math.random())}catch(a){const r=new Map;s[t]=a=>{const p=new URL(a,e).href;let i=r.get(p);if(!i){const e=n.createElement("script");e.type="module",e.crossOrigin=o.crossOrigin,e.src=URL.createObjectURL(new Blob([`import * as m from '${p}'; window.${t}.m = m;`],{type:"application/javascript"})),i=new Promise(o=>{e.onload=()=>{o(s[t].m),e.remove()}}),r.set(p,i),n.head.appendChild(e)}return i}}};export{i as a,c as p} |
| /** | ||
| * @license | ||
| * Copyright Google Inc. All Rights Reserved. | ||
| * | ||
| * Use of this source code is governed by an MIT-style license that can be | ||
| * found in the LICENSE file at https://angular.io/license | ||
| * | ||
| * This file is a port of shadowCSS from webcomponents.js to TypeScript. | ||
| * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js | ||
| * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts | ||
| */ | ||
| const s=/(-shadowcsshost)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))?([^,{]*)/gim,t=/(-shadowcsscontext)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))?([^,{]*)/gim,o=/(-shadowcssslotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))?([^,{]*)/gim,n=/-shadowcsshost-no-combinator([^\s]*)/,e=[/::shadow/g,/::content/g],c=/-shadowcsshost/gim,r=/:host/gim,h=/::slotted/gim,a=/:host-context/gim,d=/\/\*\s*[\s\S]*?\*\//g,l=/\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g,i=/(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g,g=/([{}])/g,u=(s,t)=>{const o=m(s);let n=0;return o.escapedString.replace(i,(...s)=>{const e=s[2];let c="",r=s[4],h="";r&&r.startsWith("{%BLOCK%")&&(c=o.blocks[n++],r=r.substring(8),h="{");const a=t({selector:e,content:c});return`${s[1]}${a.selector}${s[3]}${h}${a.content}${r}`})},m=s=>{const t=s.split(g),o=[],n=[];let e=0,c=[];for(let r=0;r<t.length;r++){const s=t[r];"}"===s&&e--,e>0?c.push(s):(c.length>0&&(n.push(c.join("")),o.push("%BLOCK%"),c=[]),o.push(s)),"{"===s&&e++}return c.length>0&&(n.push(c.join("")),o.push("%BLOCK%")),{escapedString:o.join(""),blocks:n}},w=(s,t,o)=>s.replace(t,(...s)=>{if(s[2]){const t=s[2].split(","),n=[];for(let e=0;e<t.length;e++){const c=t[e].trim();if(!c)break;n.push(o("-shadowcsshost-no-combinator",c,s[3]))}return n.join(",")}return"-shadowcsshost-no-combinator"+s[3]}),p=(s,t,o)=>s+t.replace("-shadowcsshost","")+o,$=(s,t,o)=>t.indexOf("-shadowcsshost")>-1?p(s,t,o):s+t+o+", "+t+" "+s+o,_=(s,t,o,e)=>u(s,s=>{let r=s.selector,h=s.content;return"@"!==s.selector[0]?r=((s,t,o,e)=>s.split(",").map(s=>e&&s.indexOf("."+e)>-1?s.trim():((s,t)=>!(s=>(s=s.replace(/\[/g,"\\[").replace(/\]/g,"\\]"),RegExp("^("+s+")([>\\s~+[.,{:][\\s\\S]*)?$","m")))(t).test(s))(s,t)?((s,t,o)=>{const e="."+(t=t.replace(/\[is=([^\]]*)\]/g,(s,...t)=>t[0])),r=s=>{let r=s.trim();if(!r)return"";if(s.indexOf("-shadowcsshost-no-combinator")>-1)r=((s,t,o)=>{if(c.lastIndex=0,c.test(s)){const t="."+o;return s.replace(n,(s,o)=>o.replace(/([^:]*)(:*)(.*)/,(s,o,n,e)=>o+t+n+e)).replace(c,t+" ")}return t+" "+s})(s,t,o);else{const t=s.replace(c,"");if(t.length>0){const s=t.match(/([^:]*)(:*)(.*)/);s&&(r=s[1]+e+s[2]+s[3])}}return r},h=(s=>{const t=[];let o,n=0;return o=(s=s.replace(/(\[[^\]]*\])/g,(s,o)=>{const e=`__ph-${n}__`;return t.push(o),n++,e})).replace(/(:nth-[-\w]+)(\([^)]+\))/g,(s,o,e)=>{const c=`__ph-${n}__`;return t.push(e),n++,o+c}),{content:o,placeholders:t}})(s);let a,d="",l=0;const i=/( |>|\+|~(?!=))\s*/g;let g=!((s=h.content).indexOf("-shadowcsshost-no-combinator")>-1);for(;null!==(a=i.exec(s));){const t=a[1],o=s.slice(l,a.index).trim();g=g||o.indexOf("-shadowcsshost-no-combinator")>-1,d+=`${g?r(o):o} ${t} `,l=i.lastIndex}const u=s.substring(l);return g=g||u.indexOf("-shadowcsshost-no-combinator")>-1,d+=g?r(u):u,((s,t)=>t.replace(/__ph-(\d+)__/g,(t,o)=>s[+o]))(h.placeholders,d)})(s,t,o).trim():s.trim()).join(", "))(s.selector,t,o,e):(s.selector.startsWith("@media")||s.selector.startsWith("@supports")||s.selector.startsWith("@page")||s.selector.startsWith("@document"))&&(h=_(s.content,t,o,e)),{selector:r.replace(/\s{2,}/g," ").trim(),content:h}}),f=(n,c,i)=>{const g=c+"-h",m=c+"-s",f=(s=>s.match(l)||[])(n);n=(s=>s.replace(d,""))(n);const b=[];if(i){const s=s=>{const t=`/*!@___${b.length}___*/`;return b.push({placeholder:t,comment:`/*!@${s.selector}*/`}),s.selector=t+s.selector,s};n=u(n,t=>"@"!==t.selector[0]?s(t):t.selector.startsWith("@media")||t.selector.startsWith("@supports")||t.selector.startsWith("@page")||t.selector.startsWith("@document")?(t.content=u(t.content,s),t):t)}const x=((n,c,d,l)=>{const i=((s,t)=>{const n="."+t+" > ",e=[];return s=s.replace(o,(...s)=>{if(s[2]){const t=s[2].trim(),o=n+t+s[3];let c="";for(let n=s[4]-1;n>=0;n--){const t=s[5][n];if("}"===t||","===t)break;c=t+c}const r=c+o,h=`${c.trimRight()}${o.trim()}`;return r.trim()!==h.trim()&&e.push({orgSelector:r,updatedSelector:`${h}, ${r}`}),o}return"-shadowcsshost-no-combinator"+s[3]}),{selectors:e,cssText:s}})(n=(s=>w(s,t,$))(n=(t=>w(t,s,p))(n=(s=>s.replace(a,"-shadowcsscontext").replace(r,"-shadowcsshost").replace(h,"-shadowcssslotted"))(n))),l);return n=(s=>e.reduce((s,t)=>s.replace(t," "),s))(n=i.cssText),c&&(n=_(n,c,d,l)),{cssText:(n=(n=n.replace(/-shadowcsshost-no-combinator/g,"."+d)).replace(/>\s*\*\s+([^{, ]+)/gm," $1 ")).trim(),slottedSelectors:i.selectors}})(n,c,g,m);return n=[x.cssText,...f].join("\n"),i&&b.forEach(({placeholder:s,comment:t})=>{n=n.replace(s,t)}),x.slottedSelectors.forEach(s=>{n=n.replace(s.orgSelector,s.updatedSelector)}),n};export{f as scopeCss} |
| const e="msf-editor";let t,n,l=0,o=!1;const s="undefined"!=typeof window?window:{},r=s.CSS,c=s.document||{head:{}},i={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},a=(()=>(c.head.attachShadow+"").indexOf("[native")>-1)(),u=e=>Promise.resolve(e),f=(()=>{try{return new CSSStyleSheet,!0}catch(e){}return!1})(),d=(e,t,n)=>{n&&n.map(([n,l,o])=>{const s=m(e,n),r=p(t,o),c=$(n);i.ael(s,l,r,c),(t.o=t.o||[]).push(()=>i.rel(s,l,r,c))})},p=(e,t)=>n=>{256&e.t?e.s[t](n):(e.i=e.i||[]).push([t,n])},m=(e,t)=>8&t?s:e,$=e=>0!=(2&e),y=new WeakMap,h=e=>"sc-"+e.u,b={},w=e=>"object"==(e=typeof e)||"function"===e,g="undefined"!=typeof Deno,_=!(g||"undefined"==typeof global||"function"!=typeof require||!global.process||"string"!=typeof __filename||global.origin&&"string"==typeof global.origin),j=(g&&Deno,_?process:g&&Deno,_?process:g&&Deno,(e,t,...n)=>{let l=null,o=!1,s=!1,r=[];const c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!w(l))&&(l+=""),o&&s?r[r.length-1].p+=l:r.push(o?v(null,l):l),s=o)};if(c(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter(t=>e[t]).join(" "))}const i=v(e,null);return i.m=t,r.length>0&&(i.$=r),i}),v=(e,t)=>({t:0,h:e,p:t,g:null,$:null,m:null}),M={},S=(e,t,n,l,o,s)=>{if(n!==l){let c=Z(e,t);if(t.toLowerCase(),"class"===t){const t=e.classList,o=k(n),s=k(l);t.remove(...o.filter(e=>e&&!s.includes(e))),t.add(...s.filter(e=>e&&!o.includes(e)))}else{const i=w(l);if((c||i&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{let o=null==l?"":l;"list"===t?c=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(r){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!c||4&s||o)&&!i&&e.setAttribute(t,l=!0===l?"":l)}}},O=/\s/,k=e=>e?e.split(O):[],C=(e,t,n,l)=>{const o=11===t.g.nodeType&&t.g.host?t.g.host:t.g,s=e&&e.m||b,r=t.m||b;for(l in s)l in r||S(o,l,s[l],void 0,n,t.t);for(l in r)S(o,l,s[l],r[l],n,t.t)},P=(e,n,l)=>{let o,s,r=n.$[l],i=0;if(o=r.g=c.createElement(r.h),C(null,r,!1),null!=t&&o["s-si"]!==t&&o.classList.add(o["s-si"]=t),r.$)for(i=0;i<r.$.length;++i)s=P(e,r,i),s&&o.appendChild(s);return o},D=(e,t,l,o,s,r)=>{let c,i=e;for(i.shadowRoot&&i.tagName===n&&(i=i.shadowRoot);s<=r;++s)o[s]&&(c=P(null,l,s),c&&(o[s].g=c,i.insertBefore(c,t)))},R=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.g.remove()},W=(e,t)=>e.h===t.h,x=(e,t)=>{const n=t.g=e.g,l=e.$,o=t.$;C(e,t,!1),null!==l&&null!==o?((e,t,n,l)=>{let o,s=0,r=0,c=t.length-1,i=t[0],a=t[c],u=l.length-1,f=l[0],d=l[u];for(;s<=c&&r<=u;)null==i?i=t[++s]:null==a?a=t[--c]:null==f?f=l[++r]:null==d?d=l[--u]:W(i,f)?(x(i,f),i=t[++s],f=l[++r]):W(a,d)?(x(a,d),a=t[--c],d=l[--u]):W(i,d)?(x(i,d),e.insertBefore(i.g,a.g.nextSibling),i=t[++s],d=l[--u]):W(a,f)?(x(a,f),e.insertBefore(a.g,i.g),a=t[--c],f=l[++r]):(o=P(t&&t[r],n,r),f=l[++r],o&&i.g.parentNode.insertBefore(o,i.g));s>c?D(e,null==l[u+1]?null:l[u+1].g,n,l,r,u):r>u&&R(t,s,c)})(n,l,t,o):null!==o?D(n,null,t,o,0,o.length-1):null!==l&&R(l,0,l.length-1)},E=e=>Q(e)._,L=(e,t,n)=>{const l=E(e);return{emit:e=>T(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},T=(e,t,n)=>{const l=i.ce(t,n);return e.dispatchEvent(l),l},U=(e,t)=>{t&&!e.j&&t["s-p"]&&t["s-p"].push(new Promise(t=>e.j=t))},q=(e,t)=>{if(e.t|=16,!(4&e.t))return U(e,e.v),fe(()=>A(e,t));e.t|=512},A=(e,t)=>{const n=e.s;let l;return t&&(e.t|=256,e.i&&(e.i.map(([e,t])=>z(n,e,t)),e.i=null),l=z(n,"componentWillLoad")),l=B(l,()=>z(n,"componentWillRender")),B(l,()=>N(e,n,t))},N=(e,l,o)=>{const s=e._,r=s["s-rc"];o&&(e=>{const t=e.M,n=e._,l=t.t,o=((e,t)=>{let n=h(t),l=le.get(n);if(e=11===e.nodeType?e:c,l)if("string"==typeof l){let t,o=y.get(e=e.head||e);o||y.set(e,o=new Set),o.has(n)||(t=c.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(a&&n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);((e,l)=>{const o=e._,s=e.S||v(null,null),r=(e=>e&&e.h===M)(l)?l:j(null,null,l);n=o.tagName,r.h=null,r.t|=4,e.S=r,r.g=s.g=o.shadowRoot||o,t=o["s-sc"],x(s,r)})(e,F(e,l)),r&&(r.map(e=>e()),s["s-rc"]=void 0);{const t=s["s-p"],n=()=>H(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},F=(e,t)=>{try{t=t.render(),e.t&=-17,e.t|=2}catch(n){ee(n)}return t},H=e=>{const t=e._,n=e.v;64&e.t||(e.t|=64,G(t),e.O(t),n||V()),e.k(t),e.j&&(e.j(),e.j=void 0),512&e.t&&ue(()=>q(e,!1)),e.t&=-517},V=()=>{G(c.documentElement),i.t|=2,ue(()=>T(s,"appload",{detail:{namespace:"msf-editor"}}))},z=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(l){ee(l)}},B=(e,t)=>e&&e.then?e.then(t):t(),G=e=>e.classList.add("hydrated"),I=(e,t,n)=>{if(t.C){const l=Object.entries(t.C),o=e.prototype;if(l.map(([e,[l]])=>{31&l||2&n&&32&l?Object.defineProperty(o,e,{get(){return((e,t)=>Q(this).P.get(t))(0,e)},set(n){((e,t,n,l)=>{const o=Q(e),s=o.P.get(t),r=o.t,c=o.s;n=((e,t)=>null==e||w(e)?e:1&t?e+"":e)(n,l.C[t][0]),8&r&&void 0!==s||n===s||(o.P.set(t,n),c&&2==(18&r)&&q(o,!1))})(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&l&&Object.defineProperty(o,e,{value(...t){const n=Q(this);return n.D.then(()=>n.s[e](...t))}})}),1&n){const t=new Map;o.attributeChangedCallback=function(e,n,l){i.jmp(()=>{const n=t.get(e);this[n]=(null!==l||"boolean"!=typeof this[n])&&l})},e.observedAttributes=l.filter(([e,t])=>15&t[0]).map(([e,n])=>{const l=n[1]||e;return t.set(l,e),l})}}return e},J=(e,t={})=>{const n=[],l=t.exclude||[],o=s.customElements,r=c.head,u=r.querySelector("meta[charset]"),p=c.createElement("style"),m=[];let $,y=!0;Object.assign(i,t),i.l=new URL(t.resourcesUrl||"./",c.baseURI).href,t.syncQueue&&(i.t|=4),e.map(e=>e[1].map(t=>{const s={t:t[0],u:t[1],C:t[2],R:t[3]};s.C=t[2],s.R=t[3],!a&&1&s.t&&(s.t|=8);const r=s.u,c=class extends HTMLElement{constructor(e){super(e),Y(e=this,s),1&s.t&&(a?e.attachShadow({mode:"open"}):"shadowRoot"in e||(e.shadowRoot=e))}connectedCallback(){$&&(clearTimeout($),$=null),y?m.push(this):i.jmp(()=>(e=>{if(0==(1&i.t)){const t=Q(e),n=t.M,l=()=>{};if(1&t.t)d(e,t,n.R);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){U(t,t.v=n);break}}n.C&&Object.entries(n.C).map(([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}}),ue(()=>(async(e,t,n,l,o)=>{if(0==(32&t.t)){{if(t.t|=32,(o=ne(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(I(o,n,2),o.isProxied=!0);const e=()=>{};t.t|=8;try{new o(t)}catch(c){ee(c)}t.t&=-9,e()}if(o.style){let e=o.style;const t=h(n);if(!le.has(t)){const l=()=>{};8&n.t&&(e=await __sc_import_msf_editor("./p-ebb4d602.js").then(n=>n.scopeCss(e,t,!1))),((e,t,n)=>{let l=le.get(e);f&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,le.set(e,l)})(t,e,!!(1&n.t)),l()}}}const s=t.v,r=()=>q(t,!0);s&&s["s-rc"]?s["s-rc"].push(r):r()})(0,t,n))}l()}})(this))}disconnectedCallback(){i.jmp(()=>(()=>{if(0==(1&i.t)){const e=Q(this);e.o&&(e.o.map(e=>e()),e.o=void 0)}})())}forceUpdate(){(()=>{{const e=Q(this);e._.isConnected&&2==(18&e.t)&&q(e,!1)}})()}componentOnReady(){return Q(this).W}};s.L=e[0],l.includes(r)||o.get(r)||(n.push(r),o.define(r,I(c,s,1)))})),p.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",p.setAttribute("data-styles",""),r.insertBefore(p,u?u.nextSibling:r.firstChild),y=!1,m.length?m.map(e=>e.connectedCallback()):i.jmp(()=>$=setTimeout(V,30))},K=new WeakMap,Q=e=>K.get(e),X=(e,t)=>K.set(t.s=e,t),Y=(e,t)=>{const n={t:0,_:e,M:t,P:new Map};return n.D=new Promise(e=>n.k=e),n.W=new Promise(e=>n.O=e),e["s-p"]=[],e["s-rc"]=[],d(e,n,t.R),K.set(e,n)},Z=(e,t)=>t in e,ee=e=>console.error(e),te=new Map,ne=e=>{const t=e.u.replace(/-/g,"_"),n=e.L,l=te.get(n);return l?l[t]:__sc_import_msf_editor(`./${n}.entry.js`).then(e=>(te.set(n,e),e[t]),ee)},le=new Map,oe=[],se=[],re=[],ce=(e,t)=>n=>{e.push(n),o||(o=!0,t&&4&i.t?ue(ae):i.raf(ae))},ie=(e,t)=>{let n=0,l=0;for(;n<e.length&&(l=performance.now())<t;)try{e[n++](l)}catch(o){ee(o)}n===e.length?e.length=0:0!==n&&e.splice(0,n)},ae=()=>{l++,(e=>{for(let n=0;n<e.length;n++)try{e[n](performance.now())}catch(t){ee(t)}e.length=0})(oe);{const e=2==(6&i.t)?performance.now()+14*Math.ceil(.1*l):1/0;ie(se,e),ie(re,e),se.length>0&&(re.push(...se),se.length=0),(o=oe.length+se.length+re.length>0)?i.raf(ae):l=0}},ue=e=>u().then(e),fe=ce(se,!0);export{r as C,e as N,u as a,J as b,L as c,c as d,E as g,j as h,i as p,X as r,s as w} |
| declare type CustomMethodDecorator<T> = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void; | ||
| export interface ComponentDecorator { | ||
| (opts?: ComponentOptions): ClassDecorator; | ||
| } | ||
| export interface ComponentOptions { | ||
| /** | ||
| * Tag name of the web component. Ideally, the tag name must be globally unique, | ||
| * so it's recommended to choose an unique prefix for all your components within the same collection. | ||
| * | ||
| * In addition, tag name must contain a '-' | ||
| */ | ||
| tag: string; | ||
| /** | ||
| * If `true`, the component will use scoped stylesheets. Similar to shadow-dom, | ||
| * but without native isolation. Defaults to `false`. | ||
| */ | ||
| scoped?: boolean; | ||
| /** | ||
| * If `true`, the component will use native shadow-dom encapsulation, it will fallback to | ||
| * `scoped` if the browser does not support shadow-dom natively. Defaults to `false`. | ||
| * Additionally, `shadow` can also be given options when attaching the shadow root. | ||
| */ | ||
| shadow?: boolean | ShadowRootOptions; | ||
| /** | ||
| * Relative URL to some external stylesheet file. It should be a `.css` file unless some | ||
| * external plugin is installed like `@stencil/sass`. | ||
| */ | ||
| styleUrl?: string; | ||
| /** | ||
| * Similar as `styleUrl` but allows to specify different stylesheets for different modes. | ||
| */ | ||
| styleUrls?: string[] | ModeStyles; | ||
| /** | ||
| * String that contains inlined CSS instead of using an external stylesheet. | ||
| * The performance characteristics of this feature are the same as using an external stylesheet. | ||
| * | ||
| * Notice, you can't use sass, or less, only `css` is allowed using `styles`, use `styleUrl` is you need more advanced features. | ||
| */ | ||
| styles?: string | { | ||
| [modeName: string]: any; | ||
| }; | ||
| /** | ||
| * Array of relative links to folders of assets required by the component. | ||
| */ | ||
| assetsDirs?: string[]; | ||
| /** | ||
| * @deprecated Use `assetsDirs` instead | ||
| */ | ||
| assetsDir?: string; | ||
| } | ||
| export interface ShadowRootOptions { | ||
| /** | ||
| * When set to `true`, specifies behavior that mitigates custom element issues | ||
| * around focusability. When a non-focusable part of the shadow DOM is clicked, the first | ||
| * focusable part is given focus, and the shadow host is given any available `:focus` styling. | ||
| */ | ||
| delegatesFocus?: boolean; | ||
| } | ||
| export interface ModeStyles { | ||
| [modeName: string]: string | string[]; | ||
| } | ||
| export interface PropDecorator { | ||
| (opts?: PropOptions): PropertyDecorator; | ||
| } | ||
| export interface PropOptions { | ||
| /** | ||
| * The name of the associated DOM attribute. | ||
| * Stencil uses different heuristics to determine the default name of the attribute, | ||
| * but using this property, you can override the default behaviour. | ||
| */ | ||
| attribute?: string | null; | ||
| /** | ||
| * A Prop is _by default_ immutable from inside the component logic. | ||
| * Once a value is set by a user, the component cannot update it internally. | ||
| * However, it's possible to explicitly allow a Prop to be mutated from inside the component, | ||
| * by setting this `mutable` option to `true`. | ||
| */ | ||
| mutable?: boolean; | ||
| /** | ||
| * In some cases it may be useful to keep a Prop in sync with an attribute. | ||
| * In this case you can set the `reflect` option to `true`, since it defaults to `false`: | ||
| */ | ||
| reflect?: boolean; | ||
| /** @deprecated: "attr" has been deprecated, please use "attribute" instead. */ | ||
| attr?: string; | ||
| /** @deprecated "context" has been deprecated. */ | ||
| context?: string; | ||
| /** @deprecated "connect" has been deprecated, please use ES modules and/or dynamic imports instead. */ | ||
| connect?: string; | ||
| /** @deprecated "reflectToAttr" has been deprecated, please use "reflect" instead. */ | ||
| reflectToAttr?: boolean; | ||
| } | ||
| export interface MethodDecorator { | ||
| (opts?: MethodOptions): CustomMethodDecorator<any>; | ||
| } | ||
| export interface MethodOptions { | ||
| } | ||
| export interface ElementDecorator { | ||
| (): PropertyDecorator; | ||
| } | ||
| export interface EventDecorator { | ||
| (opts?: EventOptions): PropertyDecorator; | ||
| } | ||
| export interface EventOptions { | ||
| /** | ||
| * A string custom event name to override the default. | ||
| */ | ||
| eventName?: string; | ||
| /** | ||
| * A Boolean indicating whether the event bubbles up through the DOM or not. | ||
| */ | ||
| bubbles?: boolean; | ||
| /** | ||
| * A Boolean indicating whether the event is cancelable. | ||
| */ | ||
| cancelable?: boolean; | ||
| /** | ||
| * A Boolean value indicating whether or not the event can bubble across the boundary between the shadow DOM and the regular DOM. | ||
| */ | ||
| composed?: boolean; | ||
| } | ||
| export interface ListenDecorator { | ||
| (eventName: string, opts?: ListenOptions): CustomMethodDecorator<any>; | ||
| } | ||
| export interface ListenOptions { | ||
| /** | ||
| * Handlers can also be registered for an event other than the host itself. | ||
| * The `target` option can be used to change where the event listener is attached, | ||
| * this is useful for listening to application-wide events. | ||
| */ | ||
| target?: ListenTargetOptions; | ||
| /** | ||
| * Event listener attached with `@Listen` does not "capture" by default, | ||
| * When a event listener is set to "capture", means the event will be dispatched | ||
| * during the "capture phase". Please see | ||
| * https://www.quirksmode.org/js/events_order.html for further information. | ||
| */ | ||
| capture?: boolean; | ||
| /** | ||
| * By default, Stencil uses several heuristics to determine if | ||
| * it must attach a `passive` event listener or not. | ||
| * | ||
| * Using the `passive` option can be used to change the default behaviour. | ||
| * Please see https://developers.google.com/web/updates/2016/06/passive-event-listeners for further information. | ||
| */ | ||
| passive?: boolean; | ||
| } | ||
| export declare type ListenTargetOptions = 'parent' | 'body' | 'document' | 'window'; | ||
| export interface StateDecorator { | ||
| (): PropertyDecorator; | ||
| } | ||
| export interface WatchDecorator { | ||
| (propName: string): CustomMethodDecorator<any>; | ||
| } | ||
| export interface UserBuildConditionals { | ||
| isDev: boolean; | ||
| isBrowser: boolean; | ||
| isServer: boolean; | ||
| isTesting: boolean; | ||
| } | ||
| /** | ||
| * The `Build` object provides many build conditionals that can be used to | ||
| * include or exclude code depending on the build. | ||
| */ | ||
| export declare const Build: UserBuildConditionals; | ||
| /** | ||
| * The `@Component()` decorator is used to provide metadata about the component class. | ||
| * https://stenciljs.com/docs/component | ||
| */ | ||
| export declare const Component: ComponentDecorator; | ||
| /** | ||
| * The `@Element()` decorator is a reference to the actual host element | ||
| * once it has rendered. | ||
| */ | ||
| export declare const Element: ElementDecorator; | ||
| /** | ||
| * Components can emit data and events using the Event Emitter decorator. | ||
| * To dispatch Custom DOM events for other components to handle, use the | ||
| * `@Event()` decorator. The Event decorator also makes it easier for Stencil | ||
| * to automatically build types and documentation for the event data. | ||
| * https://stenciljs.com/docs/events | ||
| */ | ||
| export declare const Event: EventDecorator; | ||
| /** | ||
| * The `Listen()` decorator is for listening DOM events, including the ones | ||
| * dispatched from `@Events()`. | ||
| * https://stenciljs.com/docs/events#listen-decorator | ||
| */ | ||
| export declare const Listen: ListenDecorator; | ||
| /** | ||
| * The `@Method()` decorator is used to expose methods on the public API. | ||
| * Class methods decorated with the @Method() decorator can be called directly | ||
| * from the element, meaning they are intended to be callable from the outside. | ||
| * https://stenciljs.com/docs/methods | ||
| */ | ||
| export declare const Method: MethodDecorator; | ||
| /** | ||
| * Props are custom attribute/properties exposed publicly on the element | ||
| * that developers can provide values for. Children components do not need to | ||
| * know about or reference parent components, so Props can be used to pass | ||
| * data down from the parent to the child. Components need to explicitly | ||
| * declare the Props they expect to receive using the `@Prop()` decorator. | ||
| * Any value changes to a Prop will cause a re-render. | ||
| * https://stenciljs.com/docs/properties | ||
| */ | ||
| export declare const Prop: PropDecorator; | ||
| /** | ||
| * The `@State()` decorator can be used to manage internal data for a component. | ||
| * This means that a user cannot modify this data from outside the component, | ||
| * but the component can modify it however it sees fit. Any value changes to a | ||
| * `@State()` property will cause the components render function to be called again. | ||
| * https://stenciljs.com/docs/state | ||
| */ | ||
| export declare const State: StateDecorator; | ||
| /** | ||
| * When a property's value has changed, a method decorated with `@Watch()` will be | ||
| * called and passed the new value of the prop along with the old value. Watch is | ||
| * useful for validating props or handling side effects. Watch decorator does not | ||
| * fire when a component initially loads. | ||
| * https://stenciljs.com/docs/reactive-data#watch-decorator | ||
| */ | ||
| export declare const Watch: WatchDecorator; | ||
| export declare type ResolutionHandler = (elm: HTMLElement) => string | undefined | null; | ||
| /** | ||
| * `setMode()` is used for libraries which provide multiple "modes" for styles. | ||
| */ | ||
| export declare const setMode: (handler: ResolutionHandler) => void; | ||
| /** | ||
| * getMode | ||
| */ | ||
| export declare function getMode<T = string | undefined>(ref: any): T; | ||
| /** | ||
| * Get the base path to where the assets can be found. Use `setAssetPath(path)` | ||
| * if the path needs to be customized. | ||
| */ | ||
| export declare function getAssetPath(path: string): string; | ||
| /** | ||
| * Used to manually set the base path where assets can be found. For lazy-loaded | ||
| * builds the asset path is automatically set and assets copied to the correct | ||
| * build directory. However, for custom elements builds, the `setAssetPath(path)` could | ||
| * be used to customize the asset path depending on how the script file is consumed. | ||
| * If the script is used as "module", it's recommended to use "import.meta.url", such | ||
| * as `setAssetPath(import.meta.url)`. Other options include | ||
| * `setAssetPath(document.currentScript.src)`, or using a bundler's replace plugin to | ||
| * dynamically set the path at build time, such as `setAssetPath(process.env.ASSET_PATH)`. | ||
| * But do note that this configuration depends on how your script is bundled, or lack of | ||
| * bunding, and where your assets can be loaded from. Additionally custom bundling | ||
| * will have to ensure the static assets are copied to its build directory. | ||
| */ | ||
| export declare function setAssetPath(path: string): string; | ||
| /** | ||
| * getElement | ||
| */ | ||
| export declare function getElement(ref: any): HTMLStencilElement; | ||
| /** | ||
| * Schedules a new render of the given instance or element even if no state changed. | ||
| * | ||
| * Notice `forceUpdate()` is not syncronous and might perform the DOM render in the next frame. | ||
| */ | ||
| export declare function forceUpdate(ref: any): void; | ||
| /** | ||
| * getRenderingRef | ||
| */ | ||
| export declare function getRenderingRef(): any; | ||
| export interface HTMLStencilElement extends HTMLElement { | ||
| componentOnReady(): Promise<this>; | ||
| /** @deprecated */ | ||
| forceUpdate(): void; | ||
| } | ||
| /** | ||
| * Schedules a DOM-write task. The provided callback will be executed | ||
| * in the best moment to perform DOM mutation without causing layout thrashing. | ||
| * | ||
| * For further information: https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing | ||
| */ | ||
| export declare function writeTask(task: RafCallback): void; | ||
| /** | ||
| * Schedules a DOM-read task. The provided callback will be executed | ||
| * in the best moment to perform DOM reads without causing layout thrashing. | ||
| * | ||
| * For further information: https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing | ||
| */ | ||
| export declare function readTask(task: RafCallback): void; | ||
| /** | ||
| * This file gets copied to all distributions of stencil component collections. | ||
| * - no imports | ||
| */ | ||
| export interface ComponentWillLoad { | ||
| /** | ||
| * The component is about to load and it has not | ||
| * rendered yet. | ||
| * | ||
| * This is the best place to make any data updates | ||
| * before the first render. | ||
| * | ||
| * componentWillLoad will only be called once. | ||
| */ | ||
| componentWillLoad(): Promise<void> | void; | ||
| } | ||
| export interface ComponentDidLoad { | ||
| /** | ||
| * The component has loaded and has already rendered. | ||
| * | ||
| * Updating data in this method will cause the | ||
| * component to re-render. | ||
| * | ||
| * componentDidLoad will only be called once. | ||
| */ | ||
| componentDidLoad(): void; | ||
| } | ||
| export interface ComponentWillUpdate { | ||
| /** | ||
| * The component is about to update and re-render. | ||
| * | ||
| * Called multiple times throughout the life of | ||
| * the component as it updates. | ||
| * | ||
| * componentWillUpdate is not called on the first render. | ||
| */ | ||
| componentWillUpdate(): Promise<void> | void; | ||
| } | ||
| export interface ComponentDidUpdate { | ||
| /** | ||
| * The component has just re-rendered. | ||
| * | ||
| * Called multiple times throughout the life of | ||
| * the component as it updates. | ||
| * | ||
| * componentWillUpdate is not called on the | ||
| * first render. | ||
| */ | ||
| componentDidUpdate(): void; | ||
| } | ||
| export interface ComponentDidUnload { | ||
| /** | ||
| * The component did unload and the element | ||
| * will be destroyed. | ||
| */ | ||
| componentDidUnload(): void; | ||
| } | ||
| export interface ComponentInterface { | ||
| connectedCallback?(): void; | ||
| disconnectedCallback?(): void; | ||
| componentWillRender?(): Promise<void> | void; | ||
| componentDidRender?(): void; | ||
| /** | ||
| * The component is about to load and it has not | ||
| * rendered yet. | ||
| * | ||
| * This is the best place to make any data updates | ||
| * before the first render. | ||
| * | ||
| * componentWillLoad will only be called once. | ||
| */ | ||
| componentWillLoad?(): Promise<void> | void; | ||
| /** | ||
| * The component has loaded and has already rendered. | ||
| * | ||
| * Updating data in this method will cause the | ||
| * component to re-render. | ||
| * | ||
| * componentDidLoad will only be called once. | ||
| */ | ||
| componentDidLoad?(): void; | ||
| /** | ||
| * A `@Prop` or `@State` property changed and a rerender is about to be requested. | ||
| * | ||
| * Called multiple times throughout the life of | ||
| * the component as its properties change. | ||
| * | ||
| * componentShouldUpdate is not called on the first render. | ||
| */ | ||
| componentShouldUpdate?(newVal: any, oldVal: any, propName: string): boolean | void; | ||
| /** | ||
| * The component is about to update and re-render. | ||
| * | ||
| * Called multiple times throughout the life of | ||
| * the component as it updates. | ||
| * | ||
| * componentWillUpdate is not called on the first render. | ||
| */ | ||
| componentWillUpdate?(): Promise<void> | void; | ||
| /** | ||
| * The component has just re-rendered. | ||
| * | ||
| * Called multiple times throughout the life of | ||
| * the component as it updates. | ||
| * | ||
| * componentWillUpdate is not called on the | ||
| * first render. | ||
| */ | ||
| componentDidUpdate?(): void; | ||
| render?(): any; | ||
| [memberName: string]: any; | ||
| } | ||
| export interface EventEmitter<T = any> { | ||
| emit: (data?: T) => CustomEvent<T>; | ||
| } | ||
| export interface RafCallback { | ||
| (timeStamp: number): void; | ||
| } | ||
| export interface QueueApi { | ||
| tick: (cb: RafCallback) => void; | ||
| read: (cb: RafCallback) => void; | ||
| write: (cb: RafCallback) => void; | ||
| clear?: () => void; | ||
| flush?: (cb?: () => void) => void; | ||
| } | ||
| /** | ||
| * Host | ||
| */ | ||
| interface HostAttributes { | ||
| class?: string | { | ||
| [className: string]: boolean; | ||
| }; | ||
| style?: { | ||
| [key: string]: string | undefined; | ||
| }; | ||
| ref?: (el: HTMLElement | null) => void; | ||
| [prop: string]: any; | ||
| } | ||
| export interface FunctionalUtilities { | ||
| forEach: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => void) => void; | ||
| map: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => ChildNode) => VNode[]; | ||
| } | ||
| export interface FunctionalComponent<T = {}> { | ||
| (props: T, children: VNode[], utils: FunctionalUtilities): VNode | VNode[]; | ||
| } | ||
| export interface ChildNode { | ||
| vtag?: string | number | Function; | ||
| vkey?: string | number; | ||
| vtext?: string; | ||
| vchildren?: VNode[]; | ||
| vattrs?: any; | ||
| vname?: string; | ||
| } | ||
| /** | ||
| * Host is a functional component can be used at the root of the render function | ||
| * to set attributes and event listeners to the host element itself. | ||
| * | ||
| * For further information: https://stenciljs.com/docs/host-element | ||
| */ | ||
| export declare const Host: FunctionalComponent<HostAttributes>; | ||
| /** | ||
| * The "h" namespace is used to import JSX types for elements and attributes. | ||
| * It is imported in order to avoid conflicting global JSX issues. | ||
| */ | ||
| export declare namespace h { | ||
| function h(sel: any): VNode; | ||
| function h(sel: Node, data: VNodeData): VNode; | ||
| function h(sel: any, data: VNodeData): VNode; | ||
| function h(sel: any, text: string): VNode; | ||
| function h(sel: any, children: Array<VNode | undefined | null>): VNode; | ||
| function h(sel: any, data: VNodeData, text: string): VNode; | ||
| function h(sel: any, data: VNodeData, children: Array<VNode | undefined | null>): VNode; | ||
| function h(sel: any, data: VNodeData, children: VNode): VNode; | ||
| namespace JSX { | ||
| interface IntrinsicElements extends LocalJSX.IntrinsicElements, JSXBase.IntrinsicElements { | ||
| [tagName: string]: any; | ||
| } | ||
| } | ||
| } | ||
| export interface VNode { | ||
| $flags$: number; | ||
| $tag$: string | number | Function; | ||
| $elm$: any; | ||
| $text$: string; | ||
| $children$: VNode[]; | ||
| $attrs$?: any; | ||
| $name$?: string; | ||
| $key$?: string | number; | ||
| } | ||
| export interface VNodeData { | ||
| class?: { | ||
| [className: string]: boolean; | ||
| }; | ||
| style?: any; | ||
| [attrName: string]: any; | ||
| } | ||
| declare namespace LocalJSX { | ||
| interface Element { | ||
| } | ||
| interface IntrinsicElements { | ||
| } | ||
| } | ||
| export { LocalJSX as JSX }; | ||
| export declare namespace JSXBase { | ||
| interface IntrinsicElements { | ||
| slot: JSXBase.SlotAttributes; | ||
| a: JSXBase.AnchorHTMLAttributes<HTMLAnchorElement>; | ||
| abbr: JSXBase.HTMLAttributes; | ||
| address: JSXBase.HTMLAttributes; | ||
| area: JSXBase.AreaHTMLAttributes<HTMLAreaElement>; | ||
| article: JSXBase.HTMLAttributes; | ||
| aside: JSXBase.HTMLAttributes; | ||
| audio: JSXBase.AudioHTMLAttributes<HTMLAudioElement>; | ||
| b: JSXBase.HTMLAttributes; | ||
| base: JSXBase.BaseHTMLAttributes<HTMLBaseElement>; | ||
| bdi: JSXBase.HTMLAttributes; | ||
| bdo: JSXBase.HTMLAttributes; | ||
| big: JSXBase.HTMLAttributes; | ||
| blockquote: JSXBase.BlockquoteHTMLAttributes<HTMLQuoteElement>; | ||
| body: JSXBase.HTMLAttributes<HTMLBodyElement>; | ||
| br: JSXBase.HTMLAttributes<HTMLBRElement>; | ||
| button: JSXBase.ButtonHTMLAttributes<HTMLButtonElement>; | ||
| canvas: JSXBase.CanvasHTMLAttributes<HTMLCanvasElement>; | ||
| caption: JSXBase.HTMLAttributes<HTMLTableCaptionElement>; | ||
| cite: JSXBase.HTMLAttributes; | ||
| code: JSXBase.HTMLAttributes; | ||
| col: JSXBase.ColHTMLAttributes<HTMLTableColElement>; | ||
| colgroup: JSXBase.ColgroupHTMLAttributes<HTMLTableColElement>; | ||
| data: JSXBase.HTMLAttributes<HTMLDataElement>; | ||
| datalist: JSXBase.HTMLAttributes<HTMLDataListElement>; | ||
| dd: JSXBase.HTMLAttributes; | ||
| del: JSXBase.DelHTMLAttributes<HTMLModElement>; | ||
| details: JSXBase.DetailsHTMLAttributes<HTMLElement>; | ||
| dfn: JSXBase.HTMLAttributes; | ||
| dialog: JSXBase.DialogHTMLAttributes<HTMLDialogElement>; | ||
| div: JSXBase.HTMLAttributes<HTMLDivElement>; | ||
| dl: JSXBase.HTMLAttributes<HTMLDListElement>; | ||
| dt: JSXBase.HTMLAttributes; | ||
| em: JSXBase.HTMLAttributes; | ||
| embed: JSXBase.EmbedHTMLAttributes<HTMLEmbedElement>; | ||
| fieldset: JSXBase.FieldsetHTMLAttributes<HTMLFieldSetElement>; | ||
| figcaption: JSXBase.HTMLAttributes; | ||
| figure: JSXBase.HTMLAttributes; | ||
| footer: JSXBase.HTMLAttributes; | ||
| form: JSXBase.FormHTMLAttributes<HTMLFormElement>; | ||
| h1: JSXBase.HTMLAttributes<HTMLHeadingElement>; | ||
| h2: JSXBase.HTMLAttributes<HTMLHeadingElement>; | ||
| h3: JSXBase.HTMLAttributes<HTMLHeadingElement>; | ||
| h4: JSXBase.HTMLAttributes<HTMLHeadingElement>; | ||
| h5: JSXBase.HTMLAttributes<HTMLHeadingElement>; | ||
| h6: JSXBase.HTMLAttributes<HTMLHeadingElement>; | ||
| head: JSXBase.HTMLAttributes<HTMLHeadElement>; | ||
| header: JSXBase.HTMLAttributes; | ||
| hgroup: JSXBase.HTMLAttributes; | ||
| hr: JSXBase.HTMLAttributes<HTMLHRElement>; | ||
| html: JSXBase.HTMLAttributes<HTMLHtmlElement>; | ||
| i: JSXBase.HTMLAttributes; | ||
| iframe: JSXBase.IframeHTMLAttributes<HTMLIFrameElement>; | ||
| img: JSXBase.ImgHTMLAttributes<HTMLImageElement>; | ||
| input: JSXBase.InputHTMLAttributes<HTMLInputElement>; | ||
| ins: JSXBase.InsHTMLAttributes<HTMLModElement>; | ||
| kbd: JSXBase.HTMLAttributes; | ||
| keygen: JSXBase.KeygenHTMLAttributes<HTMLElement>; | ||
| label: JSXBase.LabelHTMLAttributes<HTMLLabelElement>; | ||
| legend: JSXBase.HTMLAttributes<HTMLLegendElement>; | ||
| li: JSXBase.LiHTMLAttributes<HTMLLIElement>; | ||
| link: JSXBase.LinkHTMLAttributes<HTMLLinkElement>; | ||
| main: JSXBase.HTMLAttributes; | ||
| map: JSXBase.MapHTMLAttributes<HTMLMapElement>; | ||
| mark: JSXBase.HTMLAttributes; | ||
| menu: JSXBase.MenuHTMLAttributes<HTMLMenuElement>; | ||
| menuitem: JSXBase.HTMLAttributes; | ||
| meta: JSXBase.MetaHTMLAttributes<HTMLMetaElement>; | ||
| meter: JSXBase.MeterHTMLAttributes<HTMLMeterElement>; | ||
| nav: JSXBase.HTMLAttributes; | ||
| noscript: JSXBase.HTMLAttributes; | ||
| object: JSXBase.ObjectHTMLAttributes<HTMLObjectElement>; | ||
| ol: JSXBase.OlHTMLAttributes<HTMLOListElement>; | ||
| optgroup: JSXBase.OptgroupHTMLAttributes<HTMLOptGroupElement>; | ||
| option: JSXBase.OptionHTMLAttributes<HTMLOptionElement>; | ||
| output: JSXBase.OutputHTMLAttributes<HTMLOutputElement>; | ||
| p: JSXBase.HTMLAttributes<HTMLParagraphElement>; | ||
| param: JSXBase.ParamHTMLAttributes<HTMLParamElement>; | ||
| picture: JSXBase.HTMLAttributes<HTMLPictureElement>; | ||
| pre: JSXBase.HTMLAttributes<HTMLPreElement>; | ||
| progress: JSXBase.ProgressHTMLAttributes<HTMLProgressElement>; | ||
| q: JSXBase.QuoteHTMLAttributes<HTMLQuoteElement>; | ||
| rp: JSXBase.HTMLAttributes; | ||
| rt: JSXBase.HTMLAttributes; | ||
| ruby: JSXBase.HTMLAttributes; | ||
| s: JSXBase.HTMLAttributes; | ||
| samp: JSXBase.HTMLAttributes; | ||
| script: JSXBase.ScriptHTMLAttributes<HTMLScriptElement>; | ||
| section: JSXBase.HTMLAttributes; | ||
| select: JSXBase.SelectHTMLAttributes<HTMLSelectElement>; | ||
| small: JSXBase.HTMLAttributes; | ||
| source: JSXBase.SourceHTMLAttributes<HTMLSourceElement>; | ||
| span: JSXBase.HTMLAttributes<HTMLSpanElement>; | ||
| strong: JSXBase.HTMLAttributes; | ||
| style: JSXBase.StyleHTMLAttributes<HTMLStyleElement>; | ||
| sub: JSXBase.HTMLAttributes; | ||
| summary: JSXBase.HTMLAttributes; | ||
| sup: JSXBase.HTMLAttributes; | ||
| table: JSXBase.TableHTMLAttributes<HTMLTableElement>; | ||
| tbody: JSXBase.HTMLAttributes<HTMLTableSectionElement>; | ||
| td: JSXBase.TdHTMLAttributes<HTMLTableDataCellElement>; | ||
| textarea: JSXBase.TextareaHTMLAttributes<HTMLTextAreaElement>; | ||
| tfoot: JSXBase.HTMLAttributes<HTMLTableSectionElement>; | ||
| th: JSXBase.ThHTMLAttributes<HTMLTableHeaderCellElement>; | ||
| thead: JSXBase.HTMLAttributes<HTMLTableSectionElement>; | ||
| time: JSXBase.TimeHTMLAttributes<HTMLTimeElement>; | ||
| title: JSXBase.HTMLAttributes<HTMLTitleElement>; | ||
| tr: JSXBase.HTMLAttributes<HTMLTableRowElement>; | ||
| track: JSXBase.TrackHTMLAttributes<HTMLTrackElement>; | ||
| u: JSXBase.HTMLAttributes; | ||
| ul: JSXBase.HTMLAttributes<HTMLUListElement>; | ||
| var: JSXBase.HTMLAttributes; | ||
| video: JSXBase.VideoHTMLAttributes<HTMLVideoElement>; | ||
| wbr: JSXBase.HTMLAttributes; | ||
| animate: JSXBase.SVGAttributes; | ||
| circle: JSXBase.SVGAttributes; | ||
| clipPath: JSXBase.SVGAttributes; | ||
| defs: JSXBase.SVGAttributes; | ||
| desc: JSXBase.SVGAttributes; | ||
| ellipse: JSXBase.SVGAttributes; | ||
| feBlend: JSXBase.SVGAttributes; | ||
| feColorMatrix: JSXBase.SVGAttributes; | ||
| feComponentTransfer: JSXBase.SVGAttributes; | ||
| feComposite: JSXBase.SVGAttributes; | ||
| feConvolveMatrix: JSXBase.SVGAttributes; | ||
| feDiffuseLighting: JSXBase.SVGAttributes; | ||
| feDisplacementMap: JSXBase.SVGAttributes; | ||
| feDistantLight: JSXBase.SVGAttributes; | ||
| feDropShadow: JSXBase.SVGAttributes; | ||
| feFlood: JSXBase.SVGAttributes; | ||
| feFuncA: JSXBase.SVGAttributes; | ||
| feFuncB: JSXBase.SVGAttributes; | ||
| feFuncG: JSXBase.SVGAttributes; | ||
| feFuncR: JSXBase.SVGAttributes; | ||
| feGaussianBlur: JSXBase.SVGAttributes; | ||
| feImage: JSXBase.SVGAttributes; | ||
| feMerge: JSXBase.SVGAttributes; | ||
| feMergeNode: JSXBase.SVGAttributes; | ||
| feMorphology: JSXBase.SVGAttributes; | ||
| feOffset: JSXBase.SVGAttributes; | ||
| fePointLight: JSXBase.SVGAttributes; | ||
| feSpecularLighting: JSXBase.SVGAttributes; | ||
| feSpotLight: JSXBase.SVGAttributes; | ||
| feTile: JSXBase.SVGAttributes; | ||
| feTurbulence: JSXBase.SVGAttributes; | ||
| filter: JSXBase.SVGAttributes; | ||
| foreignObject: JSXBase.SVGAttributes; | ||
| g: JSXBase.SVGAttributes; | ||
| image: JSXBase.SVGAttributes; | ||
| line: JSXBase.SVGAttributes; | ||
| linearGradient: JSXBase.SVGAttributes; | ||
| marker: JSXBase.SVGAttributes; | ||
| mask: JSXBase.SVGAttributes; | ||
| metadata: JSXBase.SVGAttributes; | ||
| path: JSXBase.SVGAttributes; | ||
| pattern: JSXBase.SVGAttributes; | ||
| polygon: JSXBase.SVGAttributes; | ||
| polyline: JSXBase.SVGAttributes; | ||
| radialGradient: JSXBase.SVGAttributes; | ||
| rect: JSXBase.SVGAttributes; | ||
| stop: JSXBase.SVGAttributes; | ||
| svg: JSXBase.SVGAttributes; | ||
| switch: JSXBase.SVGAttributes; | ||
| symbol: JSXBase.SVGAttributes; | ||
| text: JSXBase.SVGAttributes; | ||
| textPath: JSXBase.SVGAttributes; | ||
| tspan: JSXBase.SVGAttributes; | ||
| use: JSXBase.SVGAttributes; | ||
| view: JSXBase.SVGAttributes; | ||
| } | ||
| interface SlotAttributes { | ||
| name?: string; | ||
| slot?: string; | ||
| onSlotchange?: (event: Event) => void; | ||
| } | ||
| interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| download?: any; | ||
| href?: string; | ||
| hrefLang?: string; | ||
| hreflang?: string; | ||
| media?: string; | ||
| rel?: string; | ||
| target?: string; | ||
| } | ||
| interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> { | ||
| } | ||
| interface AreaHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| alt?: string; | ||
| coords?: string; | ||
| download?: any; | ||
| href?: string; | ||
| hrefLang?: string; | ||
| hreflang?: string; | ||
| media?: string; | ||
| rel?: string; | ||
| shape?: string; | ||
| target?: string; | ||
| } | ||
| interface BaseHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| href?: string; | ||
| target?: string; | ||
| } | ||
| interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| cite?: string; | ||
| } | ||
| interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| autoFocus?: boolean; | ||
| disabled?: boolean; | ||
| form?: string; | ||
| formAction?: string; | ||
| formaction?: string; | ||
| formEncType?: string; | ||
| formenctype?: string; | ||
| formMethod?: string; | ||
| formmethod?: string; | ||
| formNoValidate?: boolean; | ||
| formnovalidate?: boolean; | ||
| formTarget?: string; | ||
| formtarget?: string; | ||
| name?: string; | ||
| type?: string; | ||
| value?: string | string[] | number; | ||
| } | ||
| interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| height?: number | string; | ||
| width?: number | string; | ||
| } | ||
| interface ColHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| span?: number; | ||
| } | ||
| interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| span?: number; | ||
| } | ||
| interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| open?: boolean; | ||
| onToggle?: (event: Event) => void; | ||
| } | ||
| interface DelHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| cite?: string; | ||
| dateTime?: string; | ||
| datetime?: string; | ||
| } | ||
| interface DialogHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| onClose?: (event: Event) => void; | ||
| open?: boolean; | ||
| returnValue?: string; | ||
| } | ||
| interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| height?: number | string; | ||
| src?: string; | ||
| type?: string; | ||
| width?: number | string; | ||
| } | ||
| interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| disabled?: boolean; | ||
| form?: string; | ||
| name?: string; | ||
| } | ||
| interface FormHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| acceptCharset?: string; | ||
| acceptcharset?: string; | ||
| action?: string; | ||
| autoComplete?: string; | ||
| autocomplete?: string; | ||
| encType?: string; | ||
| enctype?: string; | ||
| method?: string; | ||
| name?: string; | ||
| noValidate?: boolean; | ||
| novalidate?: boolean | string; | ||
| target?: string; | ||
| } | ||
| interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| manifest?: string; | ||
| } | ||
| interface IframeHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| allow?: string; | ||
| allowFullScreen?: boolean; | ||
| allowfullScreen?: string | boolean; | ||
| allowTransparency?: boolean; | ||
| allowtransparency?: string | boolean; | ||
| frameBorder?: number | string; | ||
| frameborder?: number | string; | ||
| importance?: 'low' | 'auto' | 'high'; | ||
| height?: number | string; | ||
| loading?: 'lazy' | 'auto' | 'eager'; | ||
| marginHeight?: number; | ||
| marginheight?: string | number; | ||
| marginWidth?: number; | ||
| marginwidth?: string | number; | ||
| name?: string; | ||
| referrerPolicy?: ReferrerPolicy; | ||
| sandbox?: string; | ||
| scrolling?: string; | ||
| seamless?: boolean; | ||
| src?: string; | ||
| srcDoc?: string; | ||
| srcdoc?: string; | ||
| width?: number | string; | ||
| } | ||
| interface ImgHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| alt?: string; | ||
| decoding?: 'async' | 'auto' | 'sync'; | ||
| importance?: 'low' | 'auto' | 'high'; | ||
| height?: number | string; | ||
| loading?: 'lazy' | 'auto' | 'eager'; | ||
| sizes?: string; | ||
| src?: string; | ||
| srcSet?: string; | ||
| srcset?: string; | ||
| useMap?: string; | ||
| usemap?: string; | ||
| width?: number | string; | ||
| } | ||
| interface InsHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| cite?: string; | ||
| dateTime?: string; | ||
| datetime?: string; | ||
| } | ||
| interface InputHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| accept?: string; | ||
| allowdirs?: boolean; | ||
| alt?: string; | ||
| autoCapitalize?: any; | ||
| autocapitalize?: any; | ||
| autoComplete?: string; | ||
| autocomplete?: string; | ||
| autoFocus?: boolean; | ||
| autofocus?: boolean | string; | ||
| capture?: string; | ||
| checked?: boolean; | ||
| crossOrigin?: string; | ||
| crossorigin?: string; | ||
| defaultChecked?: boolean; | ||
| defaultValue?: string; | ||
| dirName?: string; | ||
| disabled?: boolean; | ||
| files?: any; | ||
| form?: string; | ||
| formAction?: string; | ||
| formaction?: string; | ||
| formEncType?: string; | ||
| formenctype?: string; | ||
| formMethod?: string; | ||
| formmethod?: string; | ||
| formNoValidate?: boolean; | ||
| formnovalidate?: boolean; | ||
| formTarget?: string; | ||
| formtarget?: string; | ||
| height?: number | string; | ||
| indeterminate?: boolean; | ||
| list?: string; | ||
| max?: number | string; | ||
| maxLength?: number; | ||
| maxlength?: number | string; | ||
| min?: number | string; | ||
| minLength?: number; | ||
| minlength?: number | string; | ||
| multiple?: boolean; | ||
| name?: string; | ||
| pattern?: string; | ||
| placeholder?: string; | ||
| readOnly?: boolean; | ||
| readonly?: boolean | string; | ||
| required?: boolean; | ||
| selectionStart?: number | string; | ||
| selectionEnd?: number | string; | ||
| selectionDirection?: string; | ||
| size?: number; | ||
| src?: string; | ||
| step?: number | string; | ||
| type?: string; | ||
| value?: string | string[] | number; | ||
| valueAsDate?: any; | ||
| valueAsNumber?: any; | ||
| webkitdirectory?: boolean; | ||
| webkitEntries?: any; | ||
| width?: number | string; | ||
| } | ||
| interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| autoFocus?: boolean; | ||
| autofocus?: boolean | string; | ||
| challenge?: string; | ||
| disabled?: boolean; | ||
| form?: string; | ||
| keyType?: string; | ||
| keytype?: string; | ||
| keyParams?: string; | ||
| keyparams?: string; | ||
| name?: string; | ||
| } | ||
| interface LabelHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| form?: string; | ||
| htmlFor?: string; | ||
| htmlfor?: string; | ||
| } | ||
| interface LiHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| value?: string | string[] | number; | ||
| } | ||
| interface LinkHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| as?: string; | ||
| href?: string; | ||
| hrefLang?: string; | ||
| hreflang?: string; | ||
| importance?: 'low' | 'auto' | 'high'; | ||
| integrity?: string; | ||
| media?: string; | ||
| rel?: string; | ||
| sizes?: string; | ||
| type?: string; | ||
| } | ||
| interface MapHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| name?: string; | ||
| } | ||
| interface MenuHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| type?: string; | ||
| } | ||
| interface MediaHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| autoPlay?: boolean; | ||
| autoplay?: boolean | string; | ||
| controls?: boolean; | ||
| crossOrigin?: string; | ||
| crossorigin?: string; | ||
| loop?: boolean; | ||
| mediaGroup?: string; | ||
| mediagroup?: string; | ||
| muted?: boolean; | ||
| preload?: string; | ||
| src?: string; | ||
| onAbort?: (event: Event) => void; | ||
| onCanPlay?: (event: Event) => void; | ||
| onCanPlayThrough?: (event: Event) => void; | ||
| onDurationChange?: (event: Event) => void; | ||
| onEmptied?: (event: Event) => void; | ||
| onEnded?: (event: Event) => void; | ||
| onError?: (event: Event) => void; | ||
| onInterruptBegin?: (event: Event) => void; | ||
| onInterruptEnd?: (event: Event) => void; | ||
| onLoadedData?: (event: Event) => void; | ||
| onLoadedMetaData?: (event: Event) => void; | ||
| onLoadStart?: (event: Event) => void; | ||
| onMozAudioAvailable?: (event: Event) => void; | ||
| onPause?: (event: Event) => void; | ||
| onPlay?: (event: Event) => void; | ||
| onPlaying?: (event: Event) => void; | ||
| onProgress?: (event: Event) => void; | ||
| onRateChange?: (event: Event) => void; | ||
| onSeeked?: (event: Event) => void; | ||
| onSeeking?: (event: Event) => void; | ||
| onStalled?: (event: Event) => void; | ||
| onSuspend?: (event: Event) => void; | ||
| onTimeUpdate?: (event: Event) => void; | ||
| onVolumeChange?: (event: Event) => void; | ||
| onWaiting?: (event: Event) => void; | ||
| } | ||
| interface MetaHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| charSet?: string; | ||
| charset?: string; | ||
| content?: string; | ||
| httpEquiv?: string; | ||
| httpequiv?: string; | ||
| name?: string; | ||
| } | ||
| interface MeterHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| form?: string; | ||
| high?: number; | ||
| low?: number; | ||
| max?: number | string; | ||
| min?: number | string; | ||
| optimum?: number; | ||
| value?: string | string[] | number; | ||
| } | ||
| interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| cite?: string; | ||
| } | ||
| interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| classID?: string; | ||
| classid?: string; | ||
| data?: string; | ||
| form?: string; | ||
| height?: number | string; | ||
| name?: string; | ||
| type?: string; | ||
| useMap?: string; | ||
| usemap?: string; | ||
| width?: number | string; | ||
| wmode?: string; | ||
| } | ||
| interface OlHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| reversed?: boolean; | ||
| start?: number; | ||
| } | ||
| interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| disabled?: boolean; | ||
| label?: string; | ||
| } | ||
| interface OptionHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| disabled?: boolean; | ||
| label?: string; | ||
| selected?: boolean; | ||
| value?: string | string[] | number; | ||
| } | ||
| interface OutputHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| form?: string; | ||
| htmlFor?: string; | ||
| htmlfor?: string; | ||
| name?: string; | ||
| } | ||
| interface ParamHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| name?: string; | ||
| value?: string | string[] | number; | ||
| } | ||
| interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| max?: number | string; | ||
| value?: string | string[] | number; | ||
| } | ||
| interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| async?: boolean; | ||
| charSet?: string; | ||
| charset?: string; | ||
| crossOrigin?: string; | ||
| crossorigin?: string; | ||
| defer?: boolean; | ||
| importance?: 'low' | 'auto' | 'high'; | ||
| integrity?: string; | ||
| nonce?: string; | ||
| src?: string; | ||
| type?: string; | ||
| } | ||
| interface SelectHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| autoFocus?: boolean; | ||
| disabled?: boolean; | ||
| form?: string; | ||
| multiple?: boolean; | ||
| name?: string; | ||
| required?: boolean; | ||
| size?: number; | ||
| autoComplete?: string; | ||
| autocomplete?: string; | ||
| } | ||
| interface SourceHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| media?: string; | ||
| sizes?: string; | ||
| src?: string; | ||
| srcSet?: string; | ||
| type?: string; | ||
| } | ||
| interface StyleHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| media?: string; | ||
| nonce?: string; | ||
| scoped?: boolean; | ||
| type?: string; | ||
| } | ||
| interface TableHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| cellPadding?: number | string; | ||
| cellpadding?: number | string; | ||
| cellSpacing?: number | string; | ||
| cellspacing?: number | string; | ||
| summary?: string; | ||
| } | ||
| interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| autoFocus?: boolean; | ||
| autofocus?: boolean | string; | ||
| cols?: number; | ||
| disabled?: boolean; | ||
| form?: string; | ||
| maxLength?: number; | ||
| maxlength?: number | string; | ||
| minLength?: number; | ||
| minlength?: number | string; | ||
| name?: string; | ||
| placeholder?: string; | ||
| readOnly?: boolean; | ||
| readonly?: boolean | string; | ||
| required?: boolean; | ||
| rows?: number; | ||
| value?: string | string[] | number; | ||
| wrap?: string; | ||
| } | ||
| interface TdHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| colSpan?: number; | ||
| headers?: string; | ||
| rowSpan?: number; | ||
| } | ||
| interface ThHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| abbr?: string; | ||
| colSpan?: number; | ||
| headers?: string; | ||
| rowSpan?: number; | ||
| rowspan?: number | string; | ||
| scope?: string; | ||
| } | ||
| interface TimeHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| dateTime?: string; | ||
| } | ||
| interface TrackHTMLAttributes<T> extends HTMLAttributes<T> { | ||
| default?: boolean; | ||
| kind?: string; | ||
| label?: string; | ||
| src?: string; | ||
| srcLang?: string; | ||
| srclang?: string; | ||
| } | ||
| interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> { | ||
| height?: number | string; | ||
| playsInline?: boolean; | ||
| playsinline?: boolean | string; | ||
| poster?: string; | ||
| width?: number | string; | ||
| } | ||
| interface HTMLAttributes<T = HTMLElement> extends DOMAttributes<T> { | ||
| innerHTML?: string; | ||
| accessKey?: string; | ||
| class?: string | { | ||
| [className: string]: boolean; | ||
| }; | ||
| contentEditable?: boolean | string; | ||
| contenteditable?: boolean | string; | ||
| contextMenu?: string; | ||
| contextmenu?: string; | ||
| dir?: string; | ||
| draggable?: boolean; | ||
| hidden?: boolean; | ||
| id?: string; | ||
| lang?: string; | ||
| spellcheck?: 'true' | 'false' | any; | ||
| style?: { | ||
| [key: string]: string | undefined; | ||
| }; | ||
| tabIndex?: number; | ||
| tabindex?: number | string; | ||
| title?: string; | ||
| inputMode?: string; | ||
| inputmode?: string; | ||
| enterKeyHint?: string; | ||
| enterkeyhint?: string; | ||
| is?: string; | ||
| radioGroup?: string; | ||
| radiogroup?: string; | ||
| role?: string; | ||
| about?: string; | ||
| datatype?: string; | ||
| inlist?: any; | ||
| prefix?: string; | ||
| property?: string; | ||
| resource?: string; | ||
| typeof?: string; | ||
| vocab?: string; | ||
| autoCapitalize?: any; | ||
| autocapitalize?: any; | ||
| autoCorrect?: string; | ||
| autocorrect?: string; | ||
| autoSave?: string; | ||
| autosave?: string; | ||
| color?: string; | ||
| itemProp?: string; | ||
| itemprop?: string; | ||
| itemScope?: boolean; | ||
| itemscope?: boolean; | ||
| itemType?: string; | ||
| itemtype?: string; | ||
| itemID?: string; | ||
| itemid?: string; | ||
| itemRef?: string; | ||
| itemref?: string; | ||
| results?: number; | ||
| security?: string; | ||
| unselectable?: boolean; | ||
| } | ||
| interface SVGAttributes<T = SVGElement> extends DOMAttributes<T> { | ||
| 'class'?: string | { | ||
| [className: string]: boolean; | ||
| }; | ||
| 'color'?: string; | ||
| 'height'?: number | string; | ||
| 'id'?: string; | ||
| 'lang'?: string; | ||
| 'max'?: number | string; | ||
| 'media'?: string; | ||
| 'method'?: string; | ||
| 'min'?: number | string; | ||
| 'name'?: string; | ||
| 'style'?: { | ||
| [key: string]: string | undefined; | ||
| }; | ||
| 'target'?: string; | ||
| 'type'?: string; | ||
| 'width'?: number | string; | ||
| 'role'?: string; | ||
| 'tabindex'?: number; | ||
| 'accent-height'?: number | string; | ||
| 'accumulate'?: 'none' | 'sum'; | ||
| 'additive'?: 'replace' | 'sum'; | ||
| 'alignment-baseline'?: 'auto' | 'baseline' | 'before-edge' | 'text-before-edge' | 'middle' | 'central' | 'after-edge' | 'text-after-edge' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'inherit'; | ||
| 'allowReorder'?: 'no' | 'yes'; | ||
| 'alphabetic'?: number | string; | ||
| 'amplitude'?: number | string; | ||
| 'arabic-form'?: 'initial' | 'medial' | 'terminal' | 'isolated'; | ||
| 'ascent'?: number | string; | ||
| 'attributeName'?: string; | ||
| 'attributeType'?: string; | ||
| 'autoReverse'?: number | string; | ||
| 'azimuth'?: number | string; | ||
| 'baseFrequency'?: number | string; | ||
| 'baseline-shift'?: number | string; | ||
| 'baseProfile'?: number | string; | ||
| 'bbox'?: number | string; | ||
| 'begin'?: number | string; | ||
| 'bias'?: number | string; | ||
| 'by'?: number | string; | ||
| 'calcMode'?: number | string; | ||
| 'cap-height'?: number | string; | ||
| 'clip'?: number | string; | ||
| 'clip-path'?: string; | ||
| 'clipPathUnits'?: number | string; | ||
| 'clip-rule'?: number | string; | ||
| 'color-interpolation'?: number | string; | ||
| 'color-interpolation-filters'?: 'auto' | 's-rGB' | 'linear-rGB' | 'inherit'; | ||
| 'color-profile'?: number | string; | ||
| 'color-rendering'?: number | string; | ||
| 'contentScriptType'?: number | string; | ||
| 'contentStyleType'?: number | string; | ||
| 'cursor'?: number | string; | ||
| 'cx'?: number | string; | ||
| 'cy'?: number | string; | ||
| 'd'?: string; | ||
| 'decelerate'?: number | string; | ||
| 'descent'?: number | string; | ||
| 'diffuseConstant'?: number | string; | ||
| 'direction'?: number | string; | ||
| 'display'?: number | string; | ||
| 'divisor'?: number | string; | ||
| 'dominant-baseline'?: number | string; | ||
| 'dur'?: number | string; | ||
| 'dx'?: number | string; | ||
| 'dy'?: number | string; | ||
| 'edge-mode'?: number | string; | ||
| 'elevation'?: number | string; | ||
| 'enable-background'?: number | string; | ||
| 'end'?: number | string; | ||
| 'exponent'?: number | string; | ||
| 'externalResourcesRequired'?: number | string; | ||
| 'fill'?: string; | ||
| 'fill-opacity'?: number | string; | ||
| 'fill-rule'?: 'nonzero' | 'evenodd' | 'inherit'; | ||
| 'filter'?: string; | ||
| 'filterRes'?: number | string; | ||
| 'filterUnits'?: number | string; | ||
| 'flood-color'?: number | string; | ||
| 'flood-opacity'?: number | string; | ||
| 'focusable'?: number | string; | ||
| 'font-family'?: string; | ||
| 'font-size'?: number | string; | ||
| 'font-size-adjust'?: number | string; | ||
| 'font-stretch'?: number | string; | ||
| 'font-style'?: number | string; | ||
| 'font-variant'?: number | string; | ||
| 'font-weight'?: number | string; | ||
| 'format'?: number | string; | ||
| 'from'?: number | string; | ||
| 'fx'?: number | string; | ||
| 'fy'?: number | string; | ||
| 'g1'?: number | string; | ||
| 'g2'?: number | string; | ||
| 'glyph-name'?: number | string; | ||
| 'glyph-orientation-horizontal'?: number | string; | ||
| 'glyph-orientation-vertical'?: number | string; | ||
| 'glyphRef'?: number | string; | ||
| 'gradientTransform'?: string; | ||
| 'gradientUnits'?: string; | ||
| 'hanging'?: number | string; | ||
| 'horiz-adv-x'?: number | string; | ||
| 'horiz-origin-x'?: number | string; | ||
| 'href'?: string; | ||
| 'ideographic'?: number | string; | ||
| 'image-rendering'?: number | string; | ||
| 'in2'?: number | string; | ||
| 'in'?: string; | ||
| 'intercept'?: number | string; | ||
| 'k1'?: number | string; | ||
| 'k2'?: number | string; | ||
| 'k3'?: number | string; | ||
| 'k4'?: number | string; | ||
| 'k'?: number | string; | ||
| 'kernelMatrix'?: number | string; | ||
| 'kernelUnitLength'?: number | string; | ||
| 'kerning'?: number | string; | ||
| 'keyPoints'?: number | string; | ||
| 'keySplines'?: number | string; | ||
| 'keyTimes'?: number | string; | ||
| 'lengthAdjust'?: number | string; | ||
| 'letter-spacing'?: number | string; | ||
| 'lighting-color'?: number | string; | ||
| 'limitingConeAngle'?: number | string; | ||
| 'local'?: number | string; | ||
| 'marker-end'?: string; | ||
| 'markerHeight'?: number | string; | ||
| 'marker-mid'?: string; | ||
| 'marker-start'?: string; | ||
| 'markerUnits'?: number | string; | ||
| 'markerWidth'?: number | string; | ||
| 'mask'?: string; | ||
| 'maskContentUnits'?: number | string; | ||
| 'maskUnits'?: number | string; | ||
| 'mathematical'?: number | string; | ||
| 'mode'?: number | string; | ||
| 'numOctaves'?: number | string; | ||
| 'offset'?: number | string; | ||
| 'opacity'?: number | string; | ||
| 'operator'?: number | string; | ||
| 'order'?: number | string; | ||
| 'orient'?: number | string; | ||
| 'orientation'?: number | string; | ||
| 'origin'?: number | string; | ||
| 'overflow'?: number | string; | ||
| 'overline-position'?: number | string; | ||
| 'overline-thickness'?: number | string; | ||
| 'paint-order'?: number | string; | ||
| 'panose1'?: number | string; | ||
| 'pathLength'?: number | string; | ||
| 'patternContentUnits'?: string; | ||
| 'patternTransform'?: number | string; | ||
| 'patternUnits'?: string; | ||
| 'pointer-events'?: number | string; | ||
| 'points'?: string; | ||
| 'pointsAtX'?: number | string; | ||
| 'pointsAtY'?: number | string; | ||
| 'pointsAtZ'?: number | string; | ||
| 'preserveAlpha'?: number | string; | ||
| 'preserveAspectRatio'?: string; | ||
| 'primitiveUnits'?: number | string; | ||
| 'r'?: number | string; | ||
| 'radius'?: number | string; | ||
| 'refX'?: number | string; | ||
| 'refY'?: number | string; | ||
| 'rendering-intent'?: number | string; | ||
| 'repeatCount'?: number | string; | ||
| 'repeatDur'?: number | string; | ||
| 'requiredextensions'?: number | string; | ||
| 'requiredFeatures'?: number | string; | ||
| 'restart'?: number | string; | ||
| 'result'?: string; | ||
| 'rotate'?: number | string; | ||
| 'rx'?: number | string; | ||
| 'ry'?: number | string; | ||
| 'scale'?: number | string; | ||
| 'seed'?: number | string; | ||
| 'shape-rendering'?: number | string; | ||
| 'slope'?: number | string; | ||
| 'spacing'?: number | string; | ||
| 'specularConstant'?: number | string; | ||
| 'specularExponent'?: number | string; | ||
| 'speed'?: number | string; | ||
| 'spreadMethod'?: string; | ||
| 'startOffset'?: number | string; | ||
| 'stdDeviation'?: number | string; | ||
| 'stemh'?: number | string; | ||
| 'stemv'?: number | string; | ||
| 'stitchTiles'?: number | string; | ||
| 'stop-color'?: string; | ||
| 'stop-opacity'?: number | string; | ||
| 'strikethrough-position'?: number | string; | ||
| 'strikethrough-thickness'?: number | string; | ||
| 'string'?: number | string; | ||
| 'stroke'?: string; | ||
| 'stroke-dasharray'?: string | number; | ||
| 'stroke-dashoffset'?: string | number; | ||
| 'stroke-linecap'?: 'butt' | 'round' | 'square' | 'inherit'; | ||
| 'stroke-linejoin'?: 'miter' | 'round' | 'bevel' | 'inherit'; | ||
| 'stroke-miterlimit'?: string; | ||
| 'stroke-opacity'?: number | string; | ||
| 'stroke-width'?: number | string; | ||
| 'surfaceScale'?: number | string; | ||
| 'systemLanguage'?: number | string; | ||
| 'tableValues'?: number | string; | ||
| 'targetX'?: number | string; | ||
| 'targetY'?: number | string; | ||
| 'text-anchor'?: string; | ||
| 'text-decoration'?: number | string; | ||
| 'textLength'?: number | string; | ||
| 'text-rendering'?: number | string; | ||
| 'to'?: number | string; | ||
| 'transform'?: string; | ||
| 'u1'?: number | string; | ||
| 'u2'?: number | string; | ||
| 'underline-position'?: number | string; | ||
| 'underline-thickness'?: number | string; | ||
| 'unicode'?: number | string; | ||
| 'unicode-bidi'?: number | string; | ||
| 'unicode-range'?: number | string; | ||
| 'units-per-em'?: number | string; | ||
| 'v-alphabetic'?: number | string; | ||
| 'values'?: string; | ||
| 'vector-effect'?: number | string; | ||
| 'version'?: string; | ||
| 'vert-adv-y'?: number | string; | ||
| 'vert-origin-x'?: number | string; | ||
| 'vert-origin-y'?: number | string; | ||
| 'v-hanging'?: number | string; | ||
| 'v-ideographic'?: number | string; | ||
| 'viewBox'?: string; | ||
| 'viewTarget'?: number | string; | ||
| 'visibility'?: number | string; | ||
| 'v-mathematical'?: number | string; | ||
| 'widths'?: number | string; | ||
| 'word-spacing'?: number | string; | ||
| 'writing-mode'?: number | string; | ||
| 'x1'?: number | string; | ||
| 'x2'?: number | string; | ||
| 'x'?: number | string; | ||
| 'x-channel-selector'?: string; | ||
| 'x-height'?: number | string; | ||
| 'xlinkActuate'?: string; | ||
| 'xlinkArcrole'?: string; | ||
| 'xlinkHref'?: string; | ||
| 'xlinkRole'?: string; | ||
| 'xlinkShow'?: string; | ||
| 'xlinkTitle'?: string; | ||
| 'xlinkType'?: string; | ||
| 'xmlBase'?: string; | ||
| 'xmlLang'?: string; | ||
| 'xmlns'?: string; | ||
| 'xmlSpace'?: string; | ||
| 'y1'?: number | string; | ||
| 'y2'?: number | string; | ||
| 'y'?: number | string; | ||
| 'yChannelSelector'?: string; | ||
| 'z'?: number | string; | ||
| 'zoomAndPan'?: string; | ||
| } | ||
| interface DOMAttributes<T = Element> { | ||
| key?: string | number; | ||
| ref?: (elm?: T) => void; | ||
| slot?: string; | ||
| part?: string; | ||
| exportparts?: string; | ||
| onCopy?: (event: ClipboardEvent) => void; | ||
| onCopyCapture?: (event: ClipboardEvent) => void; | ||
| onCut?: (event: ClipboardEvent) => void; | ||
| onCutCapture?: (event: ClipboardEvent) => void; | ||
| onPaste?: (event: ClipboardEvent) => void; | ||
| onPasteCapture?: (event: ClipboardEvent) => void; | ||
| onCompositionEnd?: (event: CompositionEvent) => void; | ||
| onCompositionEndCapture?: (event: CompositionEvent) => void; | ||
| onCompositionStart?: (event: CompositionEvent) => void; | ||
| onCompositionStartCapture?: (event: CompositionEvent) => void; | ||
| onCompositionUpdate?: (event: CompositionEvent) => void; | ||
| onCompositionUpdateCapture?: (event: CompositionEvent) => void; | ||
| onFocus?: (event: FocusEvent) => void; | ||
| onFocusCapture?: (event: FocusEvent) => void; | ||
| onFocusIn?: (event: FocusEvent) => void; | ||
| onFocusInCapture?: (event: FocusEvent) => void; | ||
| onFocusOut?: (event: FocusEvent) => void; | ||
| onFocusOutCapture?: (event: FocusEvent) => void; | ||
| onBlur?: (event: FocusEvent) => void; | ||
| onBlurCapture?: (event: FocusEvent) => void; | ||
| onChange?: (event: Event) => void; | ||
| onChangeCapture?: (event: Event) => void; | ||
| onInput?: (event: Event) => void; | ||
| onInputCapture?: (event: Event) => void; | ||
| onReset?: (event: Event) => void; | ||
| onResetCapture?: (event: Event) => void; | ||
| onSubmit?: (event: Event) => void; | ||
| onSubmitCapture?: (event: Event) => void; | ||
| onInvalid?: (event: Event) => void; | ||
| onInvalidCapture?: (event: Event) => void; | ||
| onLoad?: (event: Event) => void; | ||
| onLoadCapture?: (event: Event) => void; | ||
| onError?: (event: Event) => void; | ||
| onErrorCapture?: (event: Event) => void; | ||
| onKeyDown?: (event: KeyboardEvent) => void; | ||
| onKeyDownCapture?: (event: KeyboardEvent) => void; | ||
| onKeyPress?: (event: KeyboardEvent) => void; | ||
| onKeyPressCapture?: (event: KeyboardEvent) => void; | ||
| onKeyUp?: (event: KeyboardEvent) => void; | ||
| onKeyUpCapture?: (event: KeyboardEvent) => void; | ||
| onAuxClick?: (event: MouseEvent) => void; | ||
| onClick?: (event: MouseEvent) => void; | ||
| onClickCapture?: (event: MouseEvent) => void; | ||
| onContextMenu?: (event: MouseEvent) => void; | ||
| onContextMenuCapture?: (event: MouseEvent) => void; | ||
| onDblClick?: (event: MouseEvent) => void; | ||
| onDblClickCapture?: (event: MouseEvent) => void; | ||
| onDrag?: (event: DragEvent) => void; | ||
| onDragCapture?: (event: DragEvent) => void; | ||
| onDragEnd?: (event: DragEvent) => void; | ||
| onDragEndCapture?: (event: DragEvent) => void; | ||
| onDragEnter?: (event: DragEvent) => void; | ||
| onDragEnterCapture?: (event: DragEvent) => void; | ||
| onDragExit?: (event: DragEvent) => void; | ||
| onDragExitCapture?: (event: DragEvent) => void; | ||
| onDragLeave?: (event: DragEvent) => void; | ||
| onDragLeaveCapture?: (event: DragEvent) => void; | ||
| onDragOver?: (event: DragEvent) => void; | ||
| onDragOverCapture?: (event: DragEvent) => void; | ||
| onDragStart?: (event: DragEvent) => void; | ||
| onDragStartCapture?: (event: DragEvent) => void; | ||
| onDrop?: (event: DragEvent) => void; | ||
| onDropCapture?: (event: DragEvent) => void; | ||
| onMouseDown?: (event: MouseEvent) => void; | ||
| onMouseDownCapture?: (event: MouseEvent) => void; | ||
| onMouseEnter?: (event: MouseEvent) => void; | ||
| onMouseLeave?: (event: MouseEvent) => void; | ||
| onMouseMove?: (event: MouseEvent) => void; | ||
| onMouseMoveCapture?: (event: MouseEvent) => void; | ||
| onMouseOut?: (event: MouseEvent) => void; | ||
| onMouseOutCapture?: (event: MouseEvent) => void; | ||
| onMouseOver?: (event: MouseEvent) => void; | ||
| onMouseOverCapture?: (event: MouseEvent) => void; | ||
| onMouseUp?: (event: MouseEvent) => void; | ||
| onMouseUpCapture?: (event: MouseEvent) => void; | ||
| onTouchCancel?: (event: TouchEvent) => void; | ||
| onTouchCancelCapture?: (event: TouchEvent) => void; | ||
| onTouchEnd?: (event: TouchEvent) => void; | ||
| onTouchEndCapture?: (event: TouchEvent) => void; | ||
| onTouchMove?: (event: TouchEvent) => void; | ||
| onTouchMoveCapture?: (event: TouchEvent) => void; | ||
| onTouchStart?: (event: TouchEvent) => void; | ||
| onTouchStartCapture?: (event: TouchEvent) => void; | ||
| onPointerDown?: (event: PointerEvent) => void; | ||
| onPointerDownCapture?: (event: PointerEvent) => void; | ||
| onPointerMove?: (event: PointerEvent) => void; | ||
| onPointerMoveCapture?: (event: PointerEvent) => void; | ||
| onPointerUp?: (event: PointerEvent) => void; | ||
| onPointerUpCapture?: (event: PointerEvent) => void; | ||
| onPointerCancel?: (event: PointerEvent) => void; | ||
| onPointerCancelCapture?: (event: PointerEvent) => void; | ||
| onPointerEnter?: (event: PointerEvent) => void; | ||
| onPointerEnterCapture?: (event: PointerEvent) => void; | ||
| onPointerLeave?: (event: PointerEvent) => void; | ||
| onPointerLeaveCapture?: (event: PointerEvent) => void; | ||
| onPointerOver?: (event: PointerEvent) => void; | ||
| onPointerOverCapture?: (event: PointerEvent) => void; | ||
| onPointerOut?: (event: PointerEvent) => void; | ||
| onPointerOutCapture?: (event: PointerEvent) => void; | ||
| onGotPointerCapture?: (event: PointerEvent) => void; | ||
| onGotPointerCaptureCapture?: (event: PointerEvent) => void; | ||
| onLostPointerCapture?: (event: PointerEvent) => void; | ||
| onLostPointerCaptureCapture?: (event: PointerEvent) => void; | ||
| onScroll?: (event: UIEvent) => void; | ||
| onScrollCapture?: (event: UIEvent) => void; | ||
| onWheel?: (event: WheelEvent) => void; | ||
| onWheelCapture?: (event: WheelEvent) => void; | ||
| onAnimationStart?: (event: AnimationEvent) => void; | ||
| onAnimationStartCapture?: (event: AnimationEvent) => void; | ||
| onAnimationEnd?: (event: AnimationEvent) => void; | ||
| onAnimationEndCapture?: (event: AnimationEvent) => void; | ||
| onAnimationIteration?: (event: AnimationEvent) => void; | ||
| onAnimationIterationCapture?: (event: AnimationEvent) => void; | ||
| onTransitionEnd?: (event: TransitionEvent) => void; | ||
| onTransitionEndCapture?: (event: TransitionEvent) => void; | ||
| } | ||
| } | ||
| export interface CustomElementsDefineOptions { | ||
| exclude?: string[]; | ||
| resourcesUrl?: string; | ||
| syncQueue?: boolean; | ||
| transformTagName?: (tagName: string) => string; | ||
| jmp?: (c: Function) => any; | ||
| raf?: (c: FrameRequestCallback) => number; | ||
| ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void; | ||
| rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void; | ||
| ce?: (eventName: string, opts?: any) => CustomEvent; | ||
| } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 4 instances
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 4 instances
792232
2.68%12791
28.6%21
-19.23%3
-40%28
-6.67%69
-5.48%