// node_modules/@stencil/core/internal/app-data/index.js var BUILD = { allRenderFn: false, cmpDidLoad: true, cmpDidUnload: false, cmpDidUpdate: true, cmpDidRender: true, cmpWillLoad: true, cmpWillUpdate: true, cmpWillRender: true, connectedCallback: true, disconnectedCallback: true, element: true, event: true, hasRenderFn: true, lifecycle: true, hostListener: true, hostListenerTargetWindow: true, hostListenerTargetDocument: true, hostListenerTargetBody: true, hostListenerTargetParent: false, hostListenerTarget: true, member: true, method: true, mode: true, observeAttribute: true, prop: true, propMutable: true, reflect: true, scoped: true, shadowDom: true, slot: true, cssAnnotations: true, state: true, style: true, svg: true, updatable: true, vdomAttribute: true, vdomXlink: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomRef: true, vdomPropOrAttr: true, vdomRender: true, vdomStyle: true, vdomText: true, watchCallback: true, taskQueue: true, hotModuleReplacement: false, isDebug: false, isDev: false, isTesting: false, hydrateServerSide: false, hydrateClientSide: false, lifecycleDOMEvents: false, lazyLoad: false, profile: false, slotRelocation: true, appendChildSlotFix: false, cloneNodeFix: false, hydratedAttribute: false, hydratedClass: true, safari10: false, scriptDataOpts: false, scopedSlotTextContentFix: false, shadowDomShim: false, slotChildNodesFix: false, invisiblePrehydration: true, propBoolean: true, propNumber: true, propString: true, cssVarShim: false, constructableCSS: true, cmpShouldUpdate: true, devTools: false, dynamicImportShim: false, shadowDelegatesFocus: true, initializeNextTick: false, asyncLoading: false, asyncQueue: false, transformTagName: false, attachStyles: true }; var NAMESPACE = "app"; // node_modules/@stencil/core/internal/client/index.js var scopeId; var contentRef; var hostTagName; var customError; var i = 0; var useNativeShadowDom = false; var checkSlotFallbackVisibility = false; var checkSlotRelocate = false; var isSvgMode = false; var renderingRef = null; var queueCongestion = 0; var queuePending = false; var Build = { isDev: BUILD.isDev ? true : false, isBrowser: true, isServer: false, isTesting: BUILD.isTesting ? true : false }; var getAssetPath = (path) => { const assetUrl = new URL(path, plt.$resourcesUrl$); return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname; }; var setAssetPath = (path) => plt.$resourcesUrl$ = path; var createTime = (fnName, tagName = "") => { if (BUILD.profile && performance.mark) { const key = `st:${fnName}:${tagName}:${i++}`; performance.mark(key); return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key); } else { return () => { return; }; } }; var uniqueTime = (key, measureText) => { if (BUILD.profile && performance.mark) { if (performance.getEntriesByName(key).length === 0) { performance.mark(key); } return () => { if (performance.getEntriesByName(measureText).length === 0) { performance.measure(measureText, key); } }; } else { return () => { return; }; } }; var CONTENT_REF_ID = "r"; var ORG_LOCATION_ID = "o"; var SLOT_NODE_ID = "s"; var TEXT_NODE_ID = "t"; var HYDRATE_ID = "s-id"; var HYDRATED_STYLE_ID = "sty-id"; var HYDRATE_CHILD_ID = "c-id"; var XLINK_NS = "http://www.w3.org/1999/xlink"; var EMPTY_OBJ = {}; var SVG_NS = "http://www.w3.org/2000/svg"; var HTML_NS = "http://www.w3.org/1999/xhtml"; var isDef = (v) => v != null; var isComplexType = (o) => { o = typeof o; return o === "object" || o === "function"; }; var h = (nodeName, vnodeData, ...children) => { let child = null; let key = null; let slotName = null; let simple = false; let lastSimple = false; const vNodeChildren = []; const walk = (c) => { for (let i2 = 0; i2 < c.length; i2++) { child = c[i2]; if (Array.isArray(child)) { walk(child); } else if (child != null && typeof child !== "boolean") { if (simple = typeof nodeName !== "function" && !isComplexType(child)) { child = String(child); } else if (BUILD.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) { consoleDevError(`vNode passed as children has unexpected type. Make sure it's using the correct h() function. Empty objects can also be the cause, look for JSX comments that became objects.`); } if (simple && lastSimple) { vNodeChildren[vNodeChildren.length - 1].$text$ += child; } else { vNodeChildren.push(simple ? newVNode(null, child) : child); } lastSimple = simple; } } }; walk(children); if (vnodeData) { if (BUILD.isDev && nodeName === "input") { validateInputProperties(vnodeData); } if (BUILD.vdomKey && vnodeData.key) { key = vnodeData.key; } if (BUILD.slotRelocation && vnodeData.name) { slotName = vnodeData.name; } if (BUILD.vdomClass) { const classData = vnodeData.className || vnodeData.class; if (classData) { vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" "); } } } if (BUILD.isDev && vNodeChildren.some(isHost)) { consoleDevError(`The must be the single root component. Make sure: - You are NOT using hostData() and in the same component. - is used once, and it's the single root component of the render() function.`); } if (BUILD.vdomFunctional && typeof nodeName === "function") { return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils); } const vnode = newVNode(nodeName, null); vnode.$attrs$ = vnodeData; if (vNodeChildren.length > 0) { vnode.$children$ = vNodeChildren; } if (BUILD.vdomKey) { vnode.$key$ = key; } if (BUILD.slotRelocation) { vnode.$name$ = slotName; } return vnode; }; var newVNode = (tag, text) => { const vnode = { $flags$: 0, $tag$: tag, $text$: text, $elm$: null, $children$: null }; if (BUILD.vdomAttribute) { vnode.$attrs$ = null; } if (BUILD.vdomKey) { vnode.$key$ = null; } if (BUILD.slotRelocation) { vnode.$name$ = null; } return vnode; }; var Host = {}; var isHost = (node) => node && node.$tag$ === Host; var vdomFnUtils = { forEach: (children, cb) => children.map(convertToPublic).forEach(cb), map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate) }; var convertToPublic = (node) => ({ vattrs: node.$attrs$, vchildren: node.$children$, vkey: node.$key$, vname: node.$name$, vtag: node.$tag$, vtext: node.$text$ }); var convertToPrivate = (node) => { if (typeof node.vtag === "function") { const vnodeData = Object.assign({}, node.vattrs); if (node.vkey) { vnodeData.key = node.vkey; } if (node.vname) { vnodeData.name = node.vname; } return h(node.vtag, vnodeData, ...node.vchildren || []); } const vnode = newVNode(node.vtag, node.vtext); vnode.$attrs$ = node.vattrs; vnode.$children$ = node.vchildren; vnode.$key$ = node.vkey; vnode.$name$ = node.vname; return vnode; }; var validateInputProperties = (inputElm) => { const props = Object.keys(inputElm); const value = props.indexOf("value"); if (value === -1) { return; } const typeIndex = props.indexOf("type"); const minIndex = props.indexOf("min"); const maxIndex = props.indexOf("max"); const stepIndex = props.indexOf("step"); if (value < typeIndex || value < minIndex || value < maxIndex || value < stepIndex) { consoleDevWarn(`The "value" prop of should be set after "min", "max", "type" and "step"`); } }; var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => { const endHydrate = createTime("hydrateClient", tagName); const shadowRoot = hostElm.shadowRoot; const childRenderNodes = []; const slotNodes = []; const shadowRootNodes = BUILD.shadowDom && shadowRoot ? [] : null; const vnode = hostRef.$vnode$ = newVNode(tagName, null); if (!plt.$orgLocNodes$) { initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map()); } hostElm[HYDRATE_ID] = hostId; hostElm.removeAttribute(HYDRATE_ID); clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId); childRenderNodes.map((c) => { const orgLocationId = c.$hostId$ + "." + c.$nodeId$; const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId); const node = c.$elm$; if (orgLocationNode && supportsShadow && orgLocationNode["s-en"] === "") { orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling); } if (!shadowRoot) { node["s-hn"] = tagName; if (orgLocationNode) { node["s-ol"] = orgLocationNode; node["s-ol"]["s-nr"] = node; } } plt.$orgLocNodes$.delete(orgLocationId); }); if (BUILD.shadowDom && shadowRoot) { shadowRootNodes.map((shadowRootNode) => { if (shadowRootNode) { shadowRoot.appendChild(shadowRootNode); } }); } endHydrate(); }; var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => { let childNodeType; let childIdSplt; let childVNode; let i2; if (node.nodeType === 1) { childNodeType = node.getAttribute(HYDRATE_CHILD_ID); if (childNodeType) { childIdSplt = childNodeType.split("."); if (childIdSplt[0] === hostId || childIdSplt[0] === "0") { childVNode = { $flags$: 0, $hostId$: childIdSplt[0], $nodeId$: childIdSplt[1], $depth$: childIdSplt[2], $index$: childIdSplt[3], $tag$: node.tagName.toLowerCase(), $elm$: node, $attrs$: null, $children$: null, $key$: null, $name$: null, $text$: null }; childRenderNodes.push(childVNode); node.removeAttribute(HYDRATE_CHILD_ID); if (!parentVNode.$children$) { parentVNode.$children$ = []; } parentVNode.$children$[childVNode.$index$] = childVNode; parentVNode = childVNode; if (shadowRootNodes && childVNode.$depth$ === "0") { shadowRootNodes[childVNode.$index$] = childVNode.$elm$; } } } for (i2 = node.childNodes.length - 1; i2 >= 0; i2--) { clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i2], hostId); } if (node.shadowRoot) { for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) { clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i2], hostId); } } } else if (node.nodeType === 8) { childIdSplt = node.nodeValue.split("."); if (childIdSplt[1] === hostId || childIdSplt[1] === "0") { childNodeType = childIdSplt[0]; childVNode = { $flags$: 0, $hostId$: childIdSplt[1], $nodeId$: childIdSplt[2], $depth$: childIdSplt[3], $index$: childIdSplt[4], $elm$: node, $attrs$: null, $children$: null, $key$: null, $name$: null, $tag$: null, $text$: null }; if (childNodeType === TEXT_NODE_ID) { childVNode.$elm$ = node.nextSibling; if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3) { childVNode.$text$ = childVNode.$elm$.textContent; childRenderNodes.push(childVNode); node.remove(); if (!parentVNode.$children$) { parentVNode.$children$ = []; } parentVNode.$children$[childVNode.$index$] = childVNode; if (shadowRootNodes && childVNode.$depth$ === "0") { shadowRootNodes[childVNode.$index$] = childVNode.$elm$; } } } else if (childVNode.$hostId$ === hostId) { if (childNodeType === SLOT_NODE_ID) { childVNode.$tag$ = "slot"; if (childIdSplt[5]) { node["s-sn"] = childVNode.$name$ = childIdSplt[5]; } else { node["s-sn"] = ""; } node["s-sr"] = true; if (BUILD.shadowDom && shadowRootNodes) { childVNode.$elm$ = doc.createElement(childVNode.$tag$); if (childVNode.$name$) { childVNode.$elm$.setAttribute("name", childVNode.$name$); } node.parentNode.insertBefore(childVNode.$elm$, node); node.remove(); if (childVNode.$depth$ === "0") { shadowRootNodes[childVNode.$index$] = childVNode.$elm$; } } slotNodes.push(childVNode); if (!parentVNode.$children$) { parentVNode.$children$ = []; } parentVNode.$children$[childVNode.$index$] = childVNode; } else if (childNodeType === CONTENT_REF_ID) { if (BUILD.shadowDom && shadowRootNodes) { node.remove(); } else if (BUILD.slotRelocation) { hostElm["s-cr"] = node; node["s-cn"] = true; } } } } } else if (parentVNode && parentVNode.$tag$ === "style") { const vnode = newVNode(null, node.textContent); vnode.$elm$ = node; vnode.$index$ = "0"; parentVNode.$children$ = [vnode]; } }; var initializeDocumentHydrate = (node, orgLocNodes) => { if (node.nodeType === 1) { let i2 = 0; for (; i2 < node.childNodes.length; i2++) { initializeDocumentHydrate(node.childNodes[i2], orgLocNodes); } if (node.shadowRoot) { for (i2 = 0; i2 < node.shadowRoot.childNodes.length; i2++) { initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes); } } } else if (node.nodeType === 8) { const childIdSplt = node.nodeValue.split("."); if (childIdSplt[0] === ORG_LOCATION_ID) { orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node); node.nodeValue = ""; node["s-en"] = childIdSplt[3]; } } }; var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m); var parsePropertyValue = (propValue, propType) => { if (propValue != null && !isComplexType(propValue)) { if (BUILD.propBoolean && propType & 4) { return propValue === "false" ? false : propValue === "" || !!propValue; } if (BUILD.propNumber && propType & 2) { return parseFloat(propValue); } if (BUILD.propString && propType & 1) { return String(propValue); } return propValue; } return propValue; }; var getElement = (ref) => BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref; var createEvent = (ref, name, flags) => { const elm = getElement(ref); return { emit: (detail) => { if (BUILD.isDev && !elm.isConnected) { consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`); } return emitEvent(elm, name, { bubbles: !!(flags & 4), composed: !!(flags & 2), cancelable: !!(flags & 1), detail }); } }; }; var emitEvent = (elm, name, opts) => { const ev = plt.ce(name, opts); elm.dispatchEvent(ev); return ev; }; var rootAppliedStyles = /* @__PURE__ */ new WeakMap(); var registerStyle = (scopeId2, cssText, allowCS) => { let style = styles.get(scopeId2); if (supportsConstructableStylesheets && allowCS) { style = style || new CSSStyleSheet(); if (typeof style === "string") { style = cssText; } else { style.replaceSync(cssText); } } else { style = cssText; } styles.set(scopeId2, style); }; var addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => { let scopeId2 = getScopeId(cmpMeta, mode); const style = styles.get(scopeId2); if (!BUILD.attachStyles) { return scopeId2; } styleContainerNode = styleContainerNode.nodeType === 11 ? 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 = /* @__PURE__ */ new Set()); } if (!appliedStyles.has(scopeId2)) { if (BUILD.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) { styleElm.innerHTML = style; } else { if (BUILD.cssVarShim && plt.$cssShim$) { styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId2, style, !!(cmpMeta.$flags$ & 10)); const newScopeId = styleElm["s-sc"]; if (newScopeId) { scopeId2 = newScopeId; appliedStyles = null; } } else { styleElm = doc.createElement("style"); styleElm.innerHTML = style; } if (BUILD.hydrateServerSide || BUILD.hotModuleReplacement) { styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2); } styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link")); } if (appliedStyles) { appliedStyles.add(scopeId2); } } } else if (BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) { styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style]; } } return scopeId2; }; var attachStyles = (hostRef) => { const cmpMeta = hostRef.$cmpMeta$; const elm = hostRef.$hostElement$; const flags = cmpMeta.$flags$; const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$); const scopeId2 = addStyle(BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$, elm); if ((BUILD.shadowDom || BUILD.scoped) && BUILD.cssAnnotations && flags & 10) { elm["s-sc"] = scopeId2; elm.classList.add(scopeId2 + "-h"); if (BUILD.scoped && flags & 2) { elm.classList.add(scopeId2 + "-s"); } } endAttachStyles(); }; var getScopeId = (cmp, mode) => "sc-" + (BUILD.mode && mode && cmp.$flags$ & 32 ? cmp.$tagName$ + "-" + mode : cmp.$tagName$); var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => { if (oldValue !== newValue) { let isProp = isMemberInElement(elm, memberName); let ln = memberName.toLowerCase(); if (BUILD.vdomClass && 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 if (BUILD.vdomStyle && memberName === "style") { if (BUILD.updatable) { for (const prop in oldValue) { if (!newValue || newValue[prop] == null) { if (!BUILD.hydrateServerSide && prop.includes("-")) { elm.style.removeProperty(prop); } else { elm.style[prop] = ""; } } } } for (const prop in newValue) { if (!oldValue || newValue[prop] !== oldValue[prop]) { if (!BUILD.hydrateServerSide && prop.includes("-")) { elm.style.setProperty(prop, newValue[prop]); } else { elm.style[prop] = newValue[prop]; } } } } else if (BUILD.vdomKey && memberName === "key") ; else if (BUILD.vdomRef && memberName === "ref") { if (newValue) { newValue(elm); } } else if (BUILD.vdomListener && (BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") { if (memberName[2] === "-") { memberName = memberName.slice(3); } else if (isMemberInElement(win, ln)) { memberName = ln.slice(2); } else { memberName = ln[2] + memberName.slice(3); } if (oldValue) { plt.rel(elm, memberName, oldValue, false); } if (newValue) { plt.ael(elm, memberName, newValue, false); } } else if (BUILD.vdomPropOrAttr) { const isComplex = isComplexType(newValue); if ((isProp || isComplex && newValue !== null) && !isSvg) { try { if (!elm.tagName.includes("-")) { const n = newValue == null ? "" : newValue; if (memberName === "list") { isProp = false; } else if (oldValue == null || elm[memberName] != n) { elm[memberName] = n; } } else { elm[memberName] = newValue; } } catch (e) { } } let xlink = false; if (BUILD.vdomXlink) { if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) { memberName = ln; xlink = true; } } if (newValue == null || newValue === false) { if (newValue !== false || elm.getAttribute(memberName) === "") { if (BUILD.vdomXlink && xlink) { elm.removeAttributeNS(XLINK_NS, memberName); } else { elm.removeAttribute(memberName); } } } else if ((!isProp || flags & 4 || isSvg) && !isComplex) { newValue = newValue === true ? "" : newValue; if (BUILD.vdomXlink && xlink) { elm.setAttributeNS(XLINK_NS, memberName, newValue); } else { elm.setAttribute(memberName, newValue); } } } } }; var parseClassListRegex = /\s/; var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex); var updateElement = (oldVnode, newVnode, isSvgMode2, memberName) => { const elm = newVnode.$elm$.nodeType === 11 && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$; const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ; const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ; if (BUILD.updatable) { for (memberName in oldVnodeAttrs) { if (!(memberName in newVnodeAttrs)) { setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$); } } } for (memberName in newVnodeAttrs) { setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$); } }; var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => { const newVNode2 = newParentVNode.$children$[childIndex]; let i2 = 0; let elm; let childNode; let oldVNode; if (BUILD.slotRelocation && !useNativeShadowDom) { checkSlotRelocate = true; if (newVNode2.$tag$ === "slot") { if (scopeId) { parentElm.classList.add(scopeId + "-s"); } newVNode2.$flags$ |= newVNode2.$children$ ? 2 : 1; } } if (BUILD.isDev && newVNode2.$elm$) { consoleDevError(`The JSX ${newVNode2.$text$ !== null ? `"${newVNode2.$text$}" text` : `"${newVNode2.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`); } if (BUILD.vdomText && newVNode2.$text$ !== null) { elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$); } else if (BUILD.slotRelocation && newVNode2.$flags$ & 1) { elm = newVNode2.$elm$ = BUILD.isDebug || BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode(""); } else { if (BUILD.svg && !isSvgMode) { isSvgMode = newVNode2.$tag$ === "svg"; } elm = newVNode2.$elm$ = BUILD.svg ? doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, BUILD.slotRelocation && newVNode2.$flags$ & 2 ? "slot-fb" : newVNode2.$tag$) : doc.createElement(BUILD.slotRelocation && newVNode2.$flags$ & 2 ? "slot-fb" : newVNode2.$tag$); if (BUILD.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") { isSvgMode = false; } if (BUILD.vdomAttribute) { updateElement(null, newVNode2, isSvgMode); } if ((BUILD.shadowDom || BUILD.scoped) && isDef(scopeId) && elm["s-si"] !== scopeId) { elm.classList.add(elm["s-si"] = scopeId); } if (newVNode2.$children$) { for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) { childNode = createElm(oldParentVNode, newVNode2, i2, elm); if (childNode) { elm.appendChild(childNode); } } } if (BUILD.svg) { if (newVNode2.$tag$ === "svg") { isSvgMode = false; } else if (elm.tagName === "foreignObject") { isSvgMode = true; } } } if (BUILD.slotRelocation) { elm["s-hn"] = hostTagName; if (newVNode2.$flags$ & (2 | 1)) { elm["s-sr"] = true; elm["s-cr"] = contentRef; elm["s-sn"] = newVNode2.$name$ || ""; oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex]; if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) { putBackInOriginalLocation(oldParentVNode.$elm$, false); } } } return elm; }; var putBackInOriginalLocation = (parentElm, recursive) => { plt.$flags$ |= 1; const oldSlotChildNodes = parentElm.childNodes; for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) { const childNode = oldSlotChildNodes[i2]; if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) { parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode)); childNode["s-ol"].remove(); childNode["s-ol"] = void 0; checkSlotRelocate = true; } if (recursive) { putBackInOriginalLocation(childNode, recursive); } } plt.$flags$ &= ~1; }; var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => { let containerElm = BUILD.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm; let childNode; if (BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) { containerElm = containerElm.shadowRoot; } for (; startIdx <= endIdx; ++startIdx) { if (vnodes[startIdx]) { childNode = createElm(null, parentVNode, startIdx, parentElm); if (childNode) { vnodes[startIdx].$elm$ = childNode; containerElm.insertBefore(childNode, BUILD.slotRelocation ? referenceNode(before) : before); } } } }; var removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => { for (; startIdx <= endIdx; ++startIdx) { if (vnode = vnodes[startIdx]) { elm = vnode.$elm$; callNodeRefs(vnode); if (BUILD.slotRelocation) { checkSlotFallbackVisibility = true; if (elm["s-ol"]) { elm["s-ol"].remove(); } else { putBackInOriginalLocation(elm, true); } } elm.remove(); } } }; var updateChildren = (parentElm, oldCh, newVNode2, newCh) => { let oldStartIdx = 0; let newStartIdx = 0; let idxInOld = 0; let i2 = 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; let elmToMove; while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { if (oldStartVnode == null) { 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)) { if (BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) { putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false); } patch(oldStartVnode, newEndVnode); parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling); oldStartVnode = oldCh[++oldStartIdx]; newEndVnode = newCh[--newEndIdx]; } else if (isSameVnode(oldEndVnode, newStartVnode)) { if (BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) { putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false); } patch(oldEndVnode, newStartVnode); parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$); oldEndVnode = oldCh[--oldEndIdx]; newStartVnode = newCh[++newStartIdx]; } else { idxInOld = -1; if (BUILD.vdomKey) { for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) { if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) { idxInOld = i2; break; } } } if (BUILD.vdomKey && idxInOld >= 0) { elmToMove = oldCh[idxInOld]; if (elmToMove.$tag$ !== newStartVnode.$tag$) { node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld, parentElm); } else { patch(elmToMove, newStartVnode); oldCh[idxInOld] = void 0; node = elmToMove.$elm$; } newStartVnode = newCh[++newStartIdx]; } else { node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx, parentElm); newStartVnode = newCh[++newStartIdx]; } if (node) { if (BUILD.slotRelocation) { parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$)); } else { oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$); } } } } if (oldStartIdx > oldEndIdx) { addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode2, newCh, newStartIdx, newEndIdx); } else if (BUILD.updatable && newStartIdx > newEndIdx) { removeVnodes(oldCh, oldStartIdx, oldEndIdx); } }; var isSameVnode = (leftVNode, rightVNode) => { if (leftVNode.$tag$ === rightVNode.$tag$) { if (BUILD.slotRelocation && leftVNode.$tag$ === "slot") { return leftVNode.$name$ === rightVNode.$name$; } if (BUILD.vdomKey) { return leftVNode.$key$ === rightVNode.$key$; } return true; } return false; }; var referenceNode = (node) => { return node && node["s-ol"] || node; }; var parentReferenceNode = (node) => (node["s-ol"] ? node["s-ol"] : node).parentNode; var patch = (oldVNode, newVNode2) => { const elm = newVNode2.$elm$ = oldVNode.$elm$; const oldChildren = oldVNode.$children$; const newChildren = newVNode2.$children$; const tag = newVNode2.$tag$; const text = newVNode2.$text$; let defaultHolder; if (!BUILD.vdomText || text === null) { if (BUILD.svg) { isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode; } if (BUILD.vdomAttribute || BUILD.reflect) { if (BUILD.slot && tag === "slot") ; else { updateElement(oldVNode, newVNode2, isSvgMode); } } if (BUILD.updatable && oldChildren !== null && newChildren !== null) { updateChildren(elm, oldChildren, newVNode2, newChildren); } else if (newChildren !== null) { if (BUILD.updatable && BUILD.vdomText && oldVNode.$text$ !== null) { elm.textContent = ""; } addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1); } else if (BUILD.updatable && oldChildren !== null) { removeVnodes(oldChildren, 0, oldChildren.length - 1); } if (BUILD.svg && isSvgMode && tag === "svg") { isSvgMode = false; } } else if (BUILD.vdomText && BUILD.slotRelocation && (defaultHolder = elm["s-cr"])) { defaultHolder.parentNode.textContent = text; } else if (BUILD.vdomText && oldVNode.$text$ !== text) { elm.data = text; } }; var updateFallbackSlotVisibility = (elm) => { const childNodes = elm.childNodes; let childNode; let i2; let ilen; let j; let slotNameAttr; let nodeType; for (i2 = 0, ilen = childNodes.length; i2 < ilen; i2++) { childNode = childNodes[i2]; if (childNode.nodeType === 1) { if (childNode["s-sr"]) { slotNameAttr = childNode["s-sn"]; childNode.hidden = false; for (j = 0; j < ilen; j++) { nodeType = childNodes[j].nodeType; if (childNodes[j]["s-hn"] !== childNode["s-hn"] || slotNameAttr !== "") { if (nodeType === 1 && slotNameAttr === childNodes[j].getAttribute("slot")) { childNode.hidden = true; break; } } else { if (nodeType === 1 || nodeType === 3 && childNodes[j].textContent.trim() !== "") { childNode.hidden = true; break; } } } } updateFallbackSlotVisibility(childNode); } } }; var relocateNodes = []; var relocateSlotContent = (elm) => { let childNode; let node; let hostContentNodes; let slotNameAttr; let relocateNodeData; let j; let i2 = 0; const childNodes = elm.childNodes; const ilen = childNodes.length; for (; i2 < ilen; i2++) { childNode = childNodes[i2]; if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) { hostContentNodes = node.parentNode.childNodes; slotNameAttr = childNode["s-sn"]; for (j = hostContentNodes.length - 1; j >= 0; j--) { node = hostContentNodes[j]; if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"]) { if (isNodeLocatedInSlot(node, slotNameAttr)) { relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node); checkSlotFallbackVisibility = true; node["s-sn"] = node["s-sn"] || slotNameAttr; if (relocateNodeData) { relocateNodeData.$slotRefNode$ = childNode; } else { relocateNodes.push({ $slotRefNode$: childNode, $nodeToRelocate$: node }); } if (node["s-sr"]) { relocateNodes.map((relocateNode) => { if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node["s-sn"])) { relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node); if (relocateNodeData && !relocateNode.$slotRefNode$) { relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$; } } }); } } else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) { relocateNodes.push({ $nodeToRelocate$: node }); } } } } if (childNode.nodeType === 1) { relocateSlotContent(childNode); } } }; var isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => { if (nodeToRelocate.nodeType === 1) { if (nodeToRelocate.getAttribute("slot") === null && slotNameAttr === "") { return true; } if (nodeToRelocate.getAttribute("slot") === slotNameAttr) { return true; } return false; } if (nodeToRelocate["s-sn"] === slotNameAttr) { return true; } return slotNameAttr === ""; }; var callNodeRefs = (vNode) => { if (BUILD.vdomRef) { vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null); vNode.$children$ && vNode.$children$.map(callNodeRefs); } }; var renderVdom = (hostRef, renderFnResults) => { const hostElm = hostRef.$hostElement$; const cmpMeta = hostRef.$cmpMeta$; const oldVNode = hostRef.$vnode$ || newVNode(null, null); const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults); hostTagName = hostElm.tagName; if (BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) { throw new Error(`The must be the single root component. Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the . The render() function should look like this instead: render() { // Do not return an array return ( {content} ); } `); } if (BUILD.reflect && cmpMeta.$attrsToReflect$) { rootVnode.$attrs$ = rootVnode.$attrs$ || {}; cmpMeta.$attrsToReflect$.map(([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]); } rootVnode.$tag$ = null; rootVnode.$flags$ |= 4; hostRef.$vnode$ = rootVnode; rootVnode.$elm$ = oldVNode.$elm$ = BUILD.shadowDom ? hostElm.shadowRoot || hostElm : hostElm; if (BUILD.scoped || BUILD.shadowDom) { scopeId = hostElm["s-sc"]; } if (BUILD.slotRelocation) { contentRef = hostElm["s-cr"]; useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1) !== 0; checkSlotFallbackVisibility = false; } patch(oldVNode, rootVnode); if (BUILD.slotRelocation) { plt.$flags$ |= 1; if (checkSlotRelocate) { relocateSlotContent(rootVnode.$elm$); let relocateData; let nodeToRelocate; let orgLocationNode; let parentNodeRef; let insertBeforeNode; let refNode; let i2 = 0; for (; i2 < relocateNodes.length; i2++) { relocateData = relocateNodes[i2]; nodeToRelocate = relocateData.$nodeToRelocate$; if (!nodeToRelocate["s-ol"]) { orgLocationNode = BUILD.isDebug || BUILD.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode(""); orgLocationNode["s-nr"] = nodeToRelocate; nodeToRelocate.parentNode.insertBefore(nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate); } } for (i2 = 0; i2 < relocateNodes.length; i2++) { relocateData = relocateNodes[i2]; nodeToRelocate = relocateData.$nodeToRelocate$; if (relocateData.$slotRefNode$) { parentNodeRef = relocateData.$slotRefNode$.parentNode; insertBeforeNode = relocateData.$slotRefNode$.nextSibling; orgLocationNode = nodeToRelocate["s-ol"]; while (orgLocationNode = orgLocationNode.previousSibling) { refNode = orgLocationNode["s-nr"]; if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === refNode.parentNode) { refNode = refNode.nextSibling; if (!refNode || !refNode["s-nr"]) { insertBeforeNode = refNode; break; } } } if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) { if (nodeToRelocate !== insertBeforeNode) { if (!nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) { nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName; } parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode); } } } else { if (nodeToRelocate.nodeType === 1) { nodeToRelocate.hidden = true; } } } } if (checkSlotFallbackVisibility) { updateFallbackSlotVisibility(rootVnode.$elm$); } plt.$flags$ &= ~1; relocateNodes.length = 0; } }; var slotReferenceDebugNode = (slotVNode) => doc.createComment(` (host=${hostTagName.toLowerCase()})`); var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(`org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)); var attachToAncestor = (hostRef, ancestorComponent) => { if (BUILD.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) { ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r)); } }; var scheduleUpdate = (hostRef, isInitialLoad) => { if (BUILD.taskQueue && BUILD.updatable) { hostRef.$flags$ |= 16; } if (BUILD.asyncLoading && hostRef.$flags$ & 4) { hostRef.$flags$ |= 512; return; } attachToAncestor(hostRef, hostRef.$ancestorComponent$); const dispatch = () => dispatchHooks(hostRef, isInitialLoad); return BUILD.taskQueue ? writeTask(dispatch) : dispatch(); }; var dispatchHooks = (hostRef, isInitialLoad) => { const elm = hostRef.$hostElement$; const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$); const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm; let promise; if (isInitialLoad) { if (BUILD.lazyLoad && BUILD.hostListener) { hostRef.$flags$ |= 256; if (hostRef.$queuedListeners$) { hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event)); hostRef.$queuedListeners$ = null; } } emitLifecycleEvent(elm, "componentWillLoad"); if (BUILD.cmpWillLoad) { promise = safeCall(instance, "componentWillLoad"); } } else { emitLifecycleEvent(elm, "componentWillUpdate"); if (BUILD.cmpWillUpdate) { promise = safeCall(instance, "componentWillUpdate"); } } emitLifecycleEvent(elm, "componentWillRender"); if (BUILD.cmpWillRender) { promise = then(promise, () => safeCall(instance, "componentWillRender")); } endSchedule(); return then(promise, () => updateComponent(hostRef, instance, isInitialLoad)); }; var updateComponent = async (hostRef, instance, isInitialLoad) => { const elm = hostRef.$hostElement$; const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$); const rc = elm["s-rc"]; if (BUILD.style && isInitialLoad) { attachStyles(hostRef); } const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$); if (BUILD.isDev) { hostRef.$flags$ |= 1024; } if (BUILD.hydrateServerSide) { await callRender(hostRef, instance, elm); } else { callRender(hostRef, instance, elm); } if (BUILD.cssVarShim && plt.$cssShim$) { plt.$cssShim$.updateHost(elm); } if (BUILD.isDev) { hostRef.$renderCount$++; hostRef.$flags$ &= ~1024; } if (BUILD.hydrateServerSide) { try { serverSideConnected(elm); if (isInitialLoad) { if (hostRef.$cmpMeta$.$flags$ & 1) { elm["s-en"] = ""; } else if (hostRef.$cmpMeta$.$flags$ & 2) { elm["s-en"] = "c"; } } } catch (e) { consoleError(e, elm); } } if (BUILD.asyncLoading && rc) { rc.map((cb) => cb()); elm["s-rc"] = void 0; } endRender(); endUpdate(); if (BUILD.asyncLoading) { const childrenPromises = elm["s-p"]; const postUpdate = () => postUpdateComponent(hostRef); if (childrenPromises.length === 0) { postUpdate(); } else { Promise.all(childrenPromises).then(postUpdate); hostRef.$flags$ |= 4; childrenPromises.length = 0; } } else { postUpdateComponent(hostRef); } }; var callRender = (hostRef, instance, elm) => { const allRenderFn = BUILD.allRenderFn ? true : false; const lazyLoad = BUILD.lazyLoad ? true : false; const taskQueue = BUILD.taskQueue ? true : false; const updatable = BUILD.updatable ? true : false; try { renderingRef = instance; instance = allRenderFn ? instance.render() : instance.render && instance.render(); if (updatable && taskQueue) { hostRef.$flags$ &= ~16; } if (updatable || lazyLoad) { hostRef.$flags$ |= 2; } if (BUILD.hasRenderFn || BUILD.reflect) { if (BUILD.vdomRender || BUILD.reflect) { if (BUILD.hydrateServerSide) { return Promise.resolve(instance).then((value) => renderVdom(hostRef, value)); } else { renderVdom(hostRef, instance); } } else { elm.textContent = instance; } } } catch (e) { consoleError(e, hostRef.$hostElement$); } renderingRef = null; return null; }; var postUpdateComponent = (hostRef) => { const tagName = hostRef.$cmpMeta$.$tagName$; const elm = hostRef.$hostElement$; const endPostUpdate = createTime("postUpdate", tagName); const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm; const ancestorComponent = hostRef.$ancestorComponent$; if (BUILD.cmpDidRender) { if (BUILD.isDev) { hostRef.$flags$ |= 1024; } safeCall(instance, "componentDidRender"); if (BUILD.isDev) { hostRef.$flags$ &= ~1024; } } emitLifecycleEvent(elm, "componentDidRender"); if (!(hostRef.$flags$ & 64)) { hostRef.$flags$ |= 64; if (BUILD.asyncLoading && BUILD.cssAnnotations) { addHydratedFlag(elm); } if (BUILD.cmpDidLoad) { if (BUILD.isDev) { hostRef.$flags$ |= 2048; } safeCall(instance, "componentDidLoad"); if (BUILD.isDev) { hostRef.$flags$ &= ~2048; } } emitLifecycleEvent(elm, "componentDidLoad"); endPostUpdate(); if (BUILD.asyncLoading) { hostRef.$onReadyResolve$(elm); if (!ancestorComponent) { appDidLoad(tagName); } } } else { if (BUILD.cmpDidUpdate) { if (BUILD.isDev) { hostRef.$flags$ |= 1024; } safeCall(instance, "componentDidUpdate"); if (BUILD.isDev) { hostRef.$flags$ &= ~1024; } } emitLifecycleEvent(elm, "componentDidUpdate"); endPostUpdate(); } if (BUILD.hotModuleReplacement) { elm["s-hmr-load"] && elm["s-hmr-load"](); } if (BUILD.method && BUILD.lazyLoad) { hostRef.$onInstanceResolve$(elm); } if (BUILD.asyncLoading) { if (hostRef.$onRenderResolve$) { hostRef.$onRenderResolve$(); hostRef.$onRenderResolve$ = void 0; } if (hostRef.$flags$ & 512) { nextTick(() => scheduleUpdate(hostRef, false)); } hostRef.$flags$ &= ~(4 | 512); } }; var forceUpdate = (ref) => { if (BUILD.updatable) { const hostRef = getHostRef(ref); const isConnected = hostRef.$hostElement$.isConnected; if (isConnected && (hostRef.$flags$ & (2 | 16)) === 2) { scheduleUpdate(hostRef, false); } return isConnected; } return false; }; var appDidLoad = (who) => { if (BUILD.cssAnnotations) { addHydratedFlag(doc.documentElement); } if (BUILD.asyncQueue) { plt.$flags$ |= 2; } nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } })); if (BUILD.profile && performance.measure) { performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start"); } }; var safeCall = (instance, method, arg) => { if (instance && instance[method]) { try { return instance[method](arg); } catch (e) { consoleError(e); } } return void 0; }; var then = (promise, thenFn) => { return promise && promise.then ? promise.then(thenFn) : thenFn(); }; var emitLifecycleEvent = (elm, lifecycleName) => { if (BUILD.lifecycleDOMEvents) { emitEvent(elm, "stencil_" + lifecycleName, { bubbles: true, composed: true, detail: { namespace: NAMESPACE } }); } }; var addHydratedFlag = (elm) => BUILD.hydratedClass ? elm.classList.add("hydrated") : BUILD.hydratedAttribute ? elm.setAttribute("hydrated", "") : void 0; var serverSideConnected = (elm) => { const children = elm.children; if (children != null) { for (let i2 = 0, ii = children.length; i2 < ii; i2++) { const childElm = children[i2]; if (typeof childElm.connectedCallback === "function") { childElm.connectedCallback(); } serverSideConnected(childElm); } } }; var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName); var setValue = (ref, propName, newVal, cmpMeta) => { const hostRef = getHostRef(ref); const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : ref; const oldVal = hostRef.$instanceValues$.get(propName); const flags = hostRef.$flags$; const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm; newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]); const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal); const didValueChange = newVal !== oldVal && !areBothNaN; if ((!BUILD.lazyLoad || !(flags & 8) || oldVal === void 0) && didValueChange) { hostRef.$instanceValues$.set(propName, newVal); if (BUILD.isDev) { if (hostRef.$flags$ & 1024) { consoleDevWarn(`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`, "\nElement", elm, "\nNew value", newVal, "\nOld value", oldVal); } else if (hostRef.$flags$ & 2048) { consoleDevWarn(`The state/prop "${propName}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`, "\nElement", elm, "\nNew value", newVal, "\nOld value", oldVal); } } if (!BUILD.lazyLoad || instance) { if (BUILD.watchCallback && cmpMeta.$watchers$ && flags & 128) { const watchMethods = cmpMeta.$watchers$[propName]; if (watchMethods) { watchMethods.map((watchMethodName) => { try { instance[watchMethodName](newVal, oldVal, propName); } catch (e) { consoleError(e, elm); } }); } } if (BUILD.updatable && (flags & (2 | 16)) === 2) { if (BUILD.cmpShouldUpdate && instance.componentShouldUpdate) { if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) { return; } } scheduleUpdate(hostRef, false); } } } }; var proxyComponent = (Cstr, cmpMeta, flags) => { if (BUILD.member && cmpMeta.$members$) { if (BUILD.watchCallback && Cstr.watchers) { cmpMeta.$watchers$ = Cstr.watchers; } const members = Object.entries(cmpMeta.$members$); const prototype = Cstr.prototype; members.map(([memberName, [memberFlags]]) => { if ((BUILD.prop || BUILD.state) && (memberFlags & 31 || (!BUILD.lazyLoad || flags & 2) && memberFlags & 32)) { Object.defineProperty(prototype, memberName, { get() { return getValue(this, memberName); }, set(newValue) { if (BUILD.isDev) { const ref = getHostRef(this); if ((flags & 1) === 0 && (ref.$flags$ & 8) === 0 && (memberFlags & 31) !== 0 && (memberFlags & 1024) === 0) { consoleDevWarn(`@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component. More information: https://stenciljs.com/docs/properties#prop-mutability`); } } setValue(this, memberName, newValue, cmpMeta); }, configurable: true, enumerable: true }); } else if (BUILD.lazyLoad && BUILD.method && flags & 1 && memberFlags & 64) { Object.defineProperty(prototype, memberName, { value(...args) { const ref = getHostRef(this); return ref.$onInstancePromise$.then(() => ref.$lazyInstance$[memberName](...args)); } }); } }); if (BUILD.observeAttribute && (!BUILD.lazyLoad || flags & 1)) { const attrNameToPropName = /* @__PURE__ */ new Map(); prototype.attributeChangedCallback = function(attrName, _oldValue, newValue) { plt.jmp(() => { const propName = attrNameToPropName.get(attrName); if (this.hasOwnProperty(propName)) { newValue = this[propName]; delete this[propName]; } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && this[propName] == newValue) { return; } this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue; }); }; Cstr.observedAttributes = members.filter(([_, m]) => m[0] & 15).map(([propName, m]) => { const attrName = m[1] || propName; attrNameToPropName.set(attrName, propName); if (BUILD.reflect && m[0] & 512) { cmpMeta.$attrsToReflect$.push([propName, attrName]); } return attrName; }); } } return Cstr; }; var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => { if ((BUILD.lazyLoad || BUILD.hydrateServerSide || BUILD.style) && (hostRef.$flags$ & 32) === 0) { if (BUILD.lazyLoad || BUILD.hydrateClientSide) { hostRef.$flags$ |= 32; Cstr = loadModule(cmpMeta, hostRef, hmrVersionId); if (Cstr.then) { const endLoad = uniqueTime(`st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`, `[Stencil] Load module for <${cmpMeta.$tagName$}>`); Cstr = await Cstr; endLoad(); } if ((BUILD.isDev || BUILD.isDebug) && !Cstr) { throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`); } if (BUILD.member && !Cstr.isProxied) { if (BUILD.watchCallback) { cmpMeta.$watchers$ = Cstr.watchers; } proxyComponent(Cstr, cmpMeta, 2); Cstr.isProxied = true; } const endNewInstance = createTime("createInstance", cmpMeta.$tagName$); if (BUILD.member) { hostRef.$flags$ |= 8; } try { new Cstr(hostRef); } catch (e) { consoleError(e); } if (BUILD.member) { hostRef.$flags$ &= ~8; } if (BUILD.watchCallback) { hostRef.$flags$ |= 128; } endNewInstance(); fireConnectedCallback(hostRef.$lazyInstance$); } else { Cstr = elm.constructor; hostRef.$flags$ |= 32; customElements.whenDefined(cmpMeta.$tagName$).then(() => hostRef.$flags$ |= 128); } if (BUILD.style && Cstr.style) { let style = Cstr.style; if (BUILD.mode && typeof style !== "string") { style = style[hostRef.$modeName$ = computeMode(elm)]; if (BUILD.hydrateServerSide && hostRef.$modeName$) { elm.setAttribute("s-mode", hostRef.$modeName$); } } const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$); if (!styles.has(scopeId2)) { const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$); if (!BUILD.hydrateServerSide && BUILD.shadowDom && BUILD.shadowDomShim && cmpMeta.$flags$ & 8) { style = await import("./shadow-css-YOETQ6TH.js").then((m) => m.scopeCss(style, scopeId2, false)); } registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1)); endRegisterStyles(); } } } const ancestorComponent = hostRef.$ancestorComponent$; const schedule = () => scheduleUpdate(hostRef, true); if (BUILD.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) { ancestorComponent["s-rc"].push(schedule); } else { schedule(); } }; var fireConnectedCallback = (instance) => { if (BUILD.lazyLoad && BUILD.connectedCallback) { safeCall(instance, "connectedCallback"); } }; var connectedCallback = (elm) => { if ((plt.$flags$ & 1) === 0) { const hostRef = getHostRef(elm); const cmpMeta = hostRef.$cmpMeta$; const endConnected = createTime("connectedCallback", cmpMeta.$tagName$); if (BUILD.hostListenerTargetParent) { addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true); } if (!(hostRef.$flags$ & 1)) { hostRef.$flags$ |= 1; let hostId; if (BUILD.hydrateClientSide) { hostId = elm.getAttribute(HYDRATE_ID); if (hostId) { if (BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & 1) { const scopeId2 = BUILD.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta); elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s"); } initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef); } } if (BUILD.slotRelocation && !hostId) { if (BUILD.hydrateServerSide || (BUILD.slot || BUILD.shadowDom) && cmpMeta.$flags$ & (4 | 8)) { setContentReference(elm); } } if (BUILD.asyncLoading) { let ancestorComponent = elm; while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) { if (BUILD.hydrateClientSide && ancestorComponent.nodeType === 1 && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) { attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent); break; } } } if (BUILD.prop && !BUILD.hydrateServerSide && cmpMeta.$members$) { Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => { if (memberFlags & 31 && elm.hasOwnProperty(memberName)) { const value = elm[memberName]; delete elm[memberName]; elm[memberName] = value; } }); } if (BUILD.initializeNextTick) { nextTick(() => initializeComponent(elm, hostRef, cmpMeta)); } else { initializeComponent(elm, hostRef, cmpMeta); } } else { addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false); fireConnectedCallback(hostRef.$lazyInstance$); } endConnected(); } }; var setContentReference = (elm) => { const contentRefElm = elm["s-cr"] = doc.createComment(BUILD.isDebug ? `content-ref (host=${elm.localName})` : ""); contentRefElm["s-cn"] = true; elm.insertBefore(contentRefElm, elm.firstChild); }; var disconnectedCallback = (elm) => { if ((plt.$flags$ & 1) === 0) { const hostRef = getHostRef(elm); const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm; if (BUILD.hostListener) { if (hostRef.$rmListeners$) { hostRef.$rmListeners$.map((rmListener) => rmListener()); hostRef.$rmListeners$ = void 0; } } if (BUILD.cssVarShim && plt.$cssShim$) { plt.$cssShim$.removeHost(elm); } if (BUILD.lazyLoad && BUILD.disconnectedCallback) { safeCall(instance, "disconnectedCallback"); } if (BUILD.cmpDidUnload) { safeCall(instance, "componentDidUnload"); } } }; var proxyCustomElement = (Cstr, compactMeta) => { const cmpMeta = { $flags$: compactMeta[0], $tagName$: compactMeta[1] }; if (BUILD.member) { cmpMeta.$members$ = compactMeta[2]; } if (BUILD.hostListener) { cmpMeta.$listeners$ = compactMeta[3]; } if (BUILD.watchCallback) { cmpMeta.$watchers$ = Cstr.$watchers$; } if (BUILD.reflect) { cmpMeta.$attrsToReflect$ = []; } if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1) { cmpMeta.$flags$ |= 8; } const originalConnectedCallback = Cstr.prototype.connectedCallback; const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback; Object.assign(Cstr.prototype, { __registerHost() { registerHost(this, cmpMeta); }, connectedCallback() { connectedCallback(this); if (BUILD.connectedCallback && originalConnectedCallback) { originalConnectedCallback.call(this); } }, disconnectedCallback() { disconnectedCallback(this); if (BUILD.disconnectedCallback && originalDisconnectedCallback) { originalDisconnectedCallback.call(this); } }, __attachShadow() { if (supportsShadow) { if (BUILD.shadowDelegatesFocus) { this.attachShadow({ mode: "open", delegatesFocus: !!(cmpMeta.$flags$ & 16) }); } else { this.attachShadow({ mode: "open" }); } } else { this.shadowRoot = this; } } }); Cstr.is = cmpMeta.$tagName$; return proxyComponent(Cstr, cmpMeta, 1 | 2); }; var Fragment = (_, children) => children; var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => { if (BUILD.hostListener && listeners) { if (BUILD.hostListenerTargetParent) { if (attachParentListeners) { listeners = listeners.filter(([flags]) => flags & 32); } else { listeners = listeners.filter(([flags]) => !(flags & 32)); } } listeners.map(([flags, name, method]) => { const target = BUILD.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm; 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)); }); } }; var hostListenerProxy = (hostRef, methodName) => (ev) => { try { if (BUILD.lazyLoad) { if (hostRef.$flags$ & 256) { hostRef.$lazyInstance$[methodName](ev); } else { (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]); } } else { hostRef.$hostElement$[methodName](ev); } } catch (e) { consoleError(e); } }; var getHostListenerTarget = (elm, flags) => { if (BUILD.hostListenerTargetDocument && flags & 4) return doc; if (BUILD.hostListenerTargetWindow && flags & 8) return win; if (BUILD.hostListenerTargetBody && flags & 16) return doc.body; if (BUILD.hostListenerTargetParent && flags & 32) return elm.parentElement; return elm; }; var hostListenerOpts = (flags) => supportsListenerOptions ? { passive: (flags & 1) !== 0, capture: (flags & 2) !== 0 } : (flags & 2) !== 0; var hostRefs = /* @__PURE__ */ new WeakMap(); var getHostRef = (ref) => hostRefs.get(ref); var registerHost = (elm, cmpMeta) => { const hostRef = { $flags$: 0, $hostElement$: elm, $cmpMeta$: cmpMeta, $instanceValues$: /* @__PURE__ */ new Map() }; if (BUILD.isDev) { hostRef.$renderCount$ = 0; } if (BUILD.method && BUILD.lazyLoad) { hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r); } if (BUILD.asyncLoading) { hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r); elm["s-p"] = []; elm["s-rc"] = []; } addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false); return hostRefs.set(elm, hostRef); }; var isMemberInElement = (elm, memberName) => memberName in elm; var consoleError = (e, el) => (customError || console.error)(e, el); var STENCIL_DEV_MODE = BUILD.isTesting ? ["STENCIL:"] : [ "%cstencil", "color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px" ]; var consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m); var consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m); var cmpModules = /* @__PURE__ */ new Map(); var loadModule = (cmpMeta, hostRef, hmrVersionId) => { const exportName = cmpMeta.$tagName$.replace(/-/g, "_"); const bundleId = cmpMeta.$lazyBundleId$; if (BUILD.isDev && typeof bundleId !== "string") { consoleDevError(`Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`); return void 0; } const module = !BUILD.hotModuleReplacement ? cmpModules.get(bundleId) : false; if (module) { return module[exportName]; } return import( /* @vite-ignore */ /* webpackInclude: /\.entry\.js$/ */ /* webpackExclude: /\.system\.entry\.js$/ */ /* webpackMode: "lazy" */ `./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVersionId ? "?s-hmr=" + hmrVersionId : ""}` ).then((importedModule) => { if (!BUILD.hotModuleReplacement) { cmpModules.set(bundleId, importedModule); } return importedModule[exportName]; }, consoleError); }; var styles = /* @__PURE__ */ new Map(); var modeResolutionChain = []; var win = typeof window !== "undefined" ? window : {}; var CSS = BUILD.cssVarShim ? win.CSS : null; var doc = win.document || { head: {} }; var H = win.HTMLElement || class { }; var plt = { $flags$: 0, $resourcesUrl$: "", jmp: (h2) => h2(), raf: (h2) => requestAnimationFrame(h2), 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) }; var supportsShadow = BUILD.shadowDomShim && BUILD.shadowDom ? (() => (doc.head.attachShadow + "").indexOf("[native") > -1)() : true; var supportsListenerOptions = (() => { let supportsListenerOptions2 = false; try { doc.addEventListener("e", null, Object.defineProperty({}, "passive", { get() { supportsListenerOptions2 = true; } })); } catch (e) { } return supportsListenerOptions2; })(); var promiseResolve = (v) => Promise.resolve(v); var supportsConstructableStylesheets = BUILD.constructableCSS ? (() => { try { new CSSStyleSheet(); return typeof new CSSStyleSheet().replaceSync === "function"; } catch (e) { } return false; })() : false; var queueDomReads = []; var queueDomWrites = []; var queueDomWritesLow = []; var queueTask = (queue, write) => (cb) => { queue.push(cb); if (!queuePending) { queuePending = true; if (write && plt.$flags$ & 4) { nextTick(flush); } else { plt.raf(flush); } } }; var consume = (queue) => { for (let i2 = 0; i2 < queue.length; i2++) { try { queue[i2](performance.now()); } catch (e) { consoleError(e); } } queue.length = 0; }; var consumeTimeout = (queue, timeout) => { let i2 = 0; let ts = 0; while (i2 < queue.length && (ts = performance.now()) < timeout) { try { queue[i2++](ts); } catch (e) { consoleError(e); } } if (i2 === queue.length) { queue.length = 0; } else if (i2 !== 0) { queue.splice(0, i2); } }; var flush = () => { if (BUILD.asyncQueue) { queueCongestion++; } consume(queueDomReads); if (BUILD.asyncQueue) { const timeout = (plt.$flags$ & 6) === 2 ? performance.now() + 14 * Math.ceil(queueCongestion * (1 / 10)) : 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) { plt.raf(flush); } else { queueCongestion = 0; } } else { consume(queueDomWrites); if (queuePending = queueDomReads.length > 0) { plt.raf(flush); } } }; var nextTick = (cb) => promiseResolve().then(cb); var readTask = queueTask(queueDomReads, false); var writeTask = queueTask(queueDomWrites, true); export { Build, getAssetPath, setAssetPath, h, Host, createEvent, forceUpdate, proxyCustomElement, Fragment, H }; /*!__STENCIL_STATIC_IMPORT_SWITCH__*/ //# sourceMappingURL=chunk-IOZKU7B2.js.map