@mgdis/stencil-helpers 3.2.0 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.d.ts +1 -205
- package/dist/components/index.d.ts.map +1 -1
- package/dist/ide/index.d.ts +1 -108
- package/dist/ide/index.d.ts.map +1 -1
- package/dist/index.es.js +702 -623
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +17 -20
- package/dist/index.umd.js.map +1 -1
- package/dist/locale/index.d.ts +2 -116
- package/dist/locale/index.d.ts.map +1 -1
- package/dist/storybook/index.d.ts +1 -76
- package/dist/storybook/index.d.ts.map +1 -1
- package/dist/tests/index.d.ts +1 -1
- package/dist/tests/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -4
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +14 -15
- package/dist/storybook/index.conf.d.ts +0 -7
- package/dist/storybook/index.conf.d.ts.map +0 -1
- package/dist/tests/unit.conf.d.ts +0 -16
- package/dist/tests/unit.conf.d.ts.map +0 -1
- package/dist/tests/unit.d.ts +0 -76
- package/dist/tests/unit.d.ts.map +0 -1
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../mg-components-helpers/dist/utils/index.js","../src/components/index.ts","../../../node_modules/.pnpm/@stencil+core@4.28.2/node_modules/@stencil/core/internal/app-data/index.js","../../../node_modules/.pnpm/@stencil+core@4.28.2/node_modules/@stencil/core/internal/client/index.js","../../../node_modules/.pnpm/htmlfy@0.7.2/node_modules/htmlfy/src/constants.js","../../../node_modules/.pnpm/htmlfy@0.7.2/node_modules/htmlfy/src/utils.js","../../../node_modules/.pnpm/htmlfy@0.7.2/node_modules/htmlfy/src/closify.js","../../../node_modules/.pnpm/htmlfy@0.7.2/node_modules/htmlfy/src/entify.js","../../../node_modules/.pnpm/htmlfy@0.7.2/node_modules/htmlfy/src/minify.js","../../../node_modules/.pnpm/htmlfy@0.7.2/node_modules/htmlfy/src/prettify.js","../src/storybook/index.ts","../src/ide/index.ts","../src/locale/index.ts","../src/tests/unit.ts"],"sourcesContent":["/**\n * Convert a string to kebab-case.\n *\n * This function ensures:\n * - All characters are converted to lowercase. Based on : https://stackoverflow.com/questions/63116039/camelcase-to-kebab-case\n * - Non-alphabetic characters (except numbers and hyphens) are replaced with hyphens.\n * - Consecutive hyphens are replaced with a single hyphen.\n * - Leading and trailing hyphens are removed.\n *\n * @param str - The input string to convert.\n * @returns The kebab-case formatted string.\n *\n * @example\n * ```typescript\n * toKebabCase('XMLHttpRequest'); // 'xml-http-request'\n * ```\n */\nconst toKebabCase = (str) => str\n .replace(/[A-Z]+(?![a-z])|[A-Z]/g, (match, offset) => (offset > 0 ? '-' : '') + match.toLowerCase())\n .replace(/[^a-z0-9-]+/g, '-') // Replace non a-z, 0-9, or hyphen characters with a hyphen\n .replace(/--+/g, '-') // Replace multiple consecutive hyphens with a single hyphen\n .replace(/(?:^-)|(?:-$)/g, ''); // Remove leading hyphens or number or trailing hyphens\n\nexport { toKebabCase };\n//# sourceMappingURL=index.js.map\n","import { toKebabCase } from '@mgdis/mg-components-helpers/utils';\n\n/**\n * Create random ID\n * @param prefix - add prefix to created ID\n * @param length - ID length\n * @returns ID\n */\nexport const createID = (prefix = '', length = 10): string => {\n const randomBytes = new Uint8Array(length);\n\n crypto.getRandomValues(randomBytes);\n\n const hexString = Array.from(randomBytes)\n .map(byte => byte.toString(16).padStart(2, '0'))\n .join('')\n .slice(0, length);\n\n return prefix !== '' ? `${prefix}-${hexString}` : hexString;\n};\n\n/**\n * Validate html `id` format\n * @param newValue - id value to validate\n * @returns true if `id` is valid\n */\nexport const isValideID = (newValue: unknown): boolean => isValidString(newValue) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(newValue) !== null;\n\n/**\n * Format id from value\n * @param value - id to transforme\n * @returns valid id\n */\nexport const formatID = (value: unknown): string | undefined => {\n let id;\n if (typeof value === 'string') {\n id = value;\n } else if (Boolean(value) && (isObject(value) || Array.isArray(value))) {\n id = JSON.stringify(value);\n } else if (value !== null && value !== undefined && typeof value !== 'boolean') {\n id = String(value);\n }\n return id ? toKebabCase(id) : id;\n};\n\n/**\n * Class to manage component classlist\n */\nexport class ClassList {\n /**\n * Available classes\n */\n classes: string[];\n\n constructor(classlist: string[] = []) {\n this.classes = classlist;\n }\n\n /**\n * Add class\n * @param className - class name to add\n */\n add = (className: string): void => {\n if (!this.has(className)) {\n this.classes.push(className);\n }\n };\n\n /**\n * Delete class\n * @param className - class name to delete\n */\n delete = (className: string): void => {\n const index = this.classes.indexOf(className);\n if (index > -1) {\n this.classes.splice(index, 1);\n }\n };\n\n /**\n * Check if class exist in list\n * @param className - class name to check\n * @returns class name is in the list\n */\n has = (className: string): boolean => {\n return this.classes.includes(className);\n };\n\n /**\n * Join classes seperated by spaces\n * @returns joined values\n */\n join = (): string => {\n return this.classes.join(' ');\n };\n}\n\n/**\n * Typeguard function to check if all array items are strings.\n * @param items - items to check\n * @returns `true` if all items are strings\n */\nexport const allItemsAreString = (items: unknown): items is string[] => Array.isArray(items) && items.every(item => typeof item === 'string');\n\n/**\n * Check if element belongs to the given tagNames list\n * @param element - element to check\n * @param tagNames - allowed tag names list\n * @returns `true` if element tagName is in the tagNames list\n */\nexport const isTagName = (element: Element, tagNames: string[]): boolean => {\n return tagNames.includes(element?.tagName.toLowerCase());\n};\n\n/**\n * CSS selector to select focusable elements.\n * @example\n * ```ts\n * const allFocusableElements: HTMLElement[] = Array.from(this.element.querySelectorAll(focusableElements));\n * ```\n */\nexport const focusableElements = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]), [identifier], mg-button';\n\n/**\n * Get windows\n * @param localWindow - the window we are lookink for other windows\n * @returns The list of windows found\n */\nexport const getWindows = (localWindow: Window): Window[] => {\n const parentWindows = getParentWindows(localWindow);\n const childWindows = getChildWindows(localWindow);\n return [localWindow, ...parentWindows, ...childWindows];\n};\n\n/**\n * Get parent windows\n * @param localWindow - the window we are lookink for parents\n * @param windows - The list of allready found windows\n * @returns The list of windows found\n */\nexport const getParentWindows = (localWindow: Window, windows: Window[] = []): Window[] => {\n // Check if is in iframe\n if (localWindow.self !== localWindow.top) {\n // Check if we have permission to access parent\n try {\n const parentWindow: Window = localWindow.parent;\n if (parentWindow) {\n windows.push(parentWindow);\n return getParentWindows(parentWindow, windows);\n } else return windows;\n } catch (err) {\n console.error('Different hosts between iframes:', err);\n return windows;\n }\n }\n return windows;\n};\n\n/**\n * Get child windows\n * @param localWindow - the window we are lookink for children\n * @param windows - The list of allready found windows\n * @returns The list of windows found\n */\nconst getChildWindows = (localWindow: Window, windows: Window[] = []): Window[] => {\n if (localWindow.frames.length > 0) {\n for (const childWindow of Array.from(localWindow.frames)) {\n windows.push(childWindow);\n getChildWindows(childWindow, windows);\n }\n }\n return windows;\n};\n\n/**\n * Validate string\n * @param value - value to check\n * @returns `true` if string is valid\n */\nexport const isValidString = (value: unknown): value is string => typeof value === 'string' && value.trim() !== '';\n\n/**\n * Stringify value\n * @param value - value to stringify\n * @returns stringified value\n */\nexport const toString = (value: unknown): string => {\n if (typeof value === 'object') return JSON.stringify(value);\n else return `${value}`;\n};\n\n/**\n * Validate number\n * @param value - value to check\n * @returns `true` if number is valid\n */\nexport const isValidNumber = (value: unknown): value is number => typeof value === 'number' && !Number.isNaN(value);\n\n/**\n * Cleans string characters by removing special characters and converting to lowercase.\n * @param text - text to clean\n * @returns cleaned string\n * @example\n * ```ts\n * cleanString('âäàçéèêñù') // 'aaaceeenu'\n * cleanString('BATMAN') // 'batman'\n * ```\n */\nexport const cleanString = (text: string): string =>\n typeof text === 'string'\n ? text\n .toLocaleLowerCase()\n .normalize('NFD')\n .replaceAll(/[\\u0300-\\u036f]/g, '')\n : text;\n\n/**\n * Use to process code next tick in the event loop\n * @param callback - code to excute on next tick\n * @returns differed code excution\n */\nexport const nextTick = async (callback?: () => void): Promise<void> => {\n if (callback) return callback();\n};\n\n/**\n * Check if a value is of object type.\n * @param object - The value to validate.\n * @returns `true` if the value is a valid object (non-null and not an array), otherwise `false`.\n */\nexport const isObject = <T>(object: unknown): object is T => typeof object === 'object' && !Array.isArray(object) && object !== null;\n\n/**\n * Get object value from key\n * @param object - object to query\n * @param path - path of the property to get. Nested keys are allowed with `.` separators (eg: 'key0.key1.key2' = object[key0][key1][key2])\n * @param defaultValue - The value returned for `undefined` resolved values\n * @returns object value\n */\nexport const getObjectValueFromKey = <T, R>(object: T, path: string, defaultValue?: R): R | undefined => {\n const separator = '.';\n if (!isObject<Record<string, R>>(object) || typeof path !== 'string') {\n return defaultValue;\n }\n const [current, ...next] = path.split(separator);\n if (next.length) {\n return getObjectValueFromKey(object[current as keyof T], next.join(separator));\n } else {\n return object[current as keyof T];\n }\n};\n\n/**\n * Define getPage methode interface\n */\nexport interface IGetPage<T> {\n (offset?: number, filter?: Parameters<Array<T>['filter']>[0]): Page<T>;\n}\n\n/**\n * Cursor type\n */\nexport type CursorType = 'first' | 'next' | 'previous' | 'last';\n\n/**\n * Cursor possible values\n */\nexport const Cursor: Record<string, CursorType> = {\n FIRST: 'first',\n NEXT: 'next',\n PREVIOUS: 'previous',\n LAST: 'last',\n} as const;\n\nconst DEFAULT_TOP = 10;\n\n/**\n * Define a valid Page object and navigate throw page items with cursor.\n * Page object entries follow the REST API page practices.\n */\nexport class Page<T> {\n /**\n * Define items\n */\n public items: T[] = [];\n /**\n * Define total\n */\n public total: number;\n /**\n * Define top\n */\n public top: number = DEFAULT_TOP;\n /**\n * Define next\n */\n public next?: IGetPage<T> | string | URL;\n /**\n * Define base index\n */\n public readonly baseIndex = 1;\n\n constructor(init: Partial<Pick<Page<T>, 'items' | 'top' | 'total' | 'next'>>) {\n if (!isObject(init)) {\n throw new Error('Page - init must match IPage type.');\n } else {\n if (Array.isArray(init.items)) this.items = init.items;\n if (typeof init.top === 'number') this.top = init.top;\n this.total = typeof init.total === 'number' ? init.total : this.items.length;\n this.next = init.next;\n }\n }\n\n /**\n * Get index of items from cursor\n * @param cursor - cursor to find\n * @param oldItem - previous item\n * @returns item index\n */\n public getIndexFromCursor = (cursor: CursorType = 'first', oldItem?: T): number | null => {\n const startIndex = 0;\n if (!Array.isArray(this.items) || !this.items.length) return null;\n const lastIndex = this.items.length - this.baseIndex;\n\n let newIndex = startIndex;\n let oldIndex = startIndex;\n if (['previous', 'next'].includes(cursor) && oldItem) {\n const findedIndex = this.items.findIndex(item => JSON.stringify(item) === JSON.stringify(oldItem));\n if (findedIndex === -1) return startIndex;\n oldIndex = findedIndex;\n }\n // Update index from cursor\n if (cursor === 'first') {\n newIndex = startIndex;\n } else if (cursor === 'last') {\n newIndex = lastIndex;\n } else if (cursor === 'previous') {\n newIndex = JSON.stringify(this.items[oldIndex]) === JSON.stringify(this.items[startIndex]) ? lastIndex : oldIndex - this.baseIndex;\n } else if (cursor === 'next') {\n newIndex = JSON.stringify(this.items[oldIndex]) === JSON.stringify(this.items[lastIndex]) ? startIndex : oldIndex + this.baseIndex;\n }\n\n return newIndex;\n };\n}\n\n/**\n * Paginate an items array to navigate into with pages.\n * It follow REST standard and allow to navigate in items array with a similar format.\n */\nexport class Paginate<T> {\n /**\n * Define paginated items\n */\n public items: Page<T>['items'] = [];\n\n /* Privates */\n #top: Page<T>['top'] = DEFAULT_TOP;\n #next?: Page<T>['next'];\n #total?: Page<T>['total'];\n\n constructor(items: Page<T>['items'], options?: { step?: number; top?: Page<T>['top']; total?: Page<T>['total']; next?: Page<T>['next'] }) {\n if (Array.isArray(items)) this.items = items;\n if (options && (['string', 'function'].includes(typeof options.next) || (isObject<URL>(options.next) && URL.canParse(options.next)))) this.#next = options.next;\n if (typeof options?.top === 'number') this.#top = options.top;\n if (typeof options?.total === 'number') this.#total = options.total;\n }\n\n /**\n * Get page\n * @param offset - pagiantion offset\n * @param filter - filter methode\n * @returns formated page\n */\n public getPage: IGetPage<T> = (offset = 0, filter) => {\n const items = typeof filter === 'function' ? this.items.filter(filter) : this.items;\n let next;\n if (this.#next) next = this.#next;\n else if (items.length > offset + this.#top) next = () => this.getPage(offset + this.#top, filter);\n\n return new Page({\n items: items.slice(offset, offset + this.#top),\n total: this.#total,\n top: this.#top,\n next,\n });\n };\n}\n","// src/app-data/index.ts\nvar BUILD = {\n allRenderFn: false,\n element: true,\n event: true,\n hasRenderFn: true,\n hostListener: true,\n hostListenerTargetWindow: true,\n hostListenerTargetDocument: true,\n hostListenerTargetBody: true,\n hostListenerTargetParent: false,\n hostListenerTarget: true,\n member: true,\n method: true,\n mode: true,\n observeAttribute: true,\n prop: true,\n propMutable: true,\n reflect: true,\n scoped: true,\n shadowDom: true,\n slot: true,\n cssAnnotations: true,\n state: true,\n style: true,\n formAssociated: false,\n svg: true,\n updatable: true,\n vdomAttribute: true,\n vdomXlink: true,\n vdomClass: true,\n vdomFunctional: true,\n vdomKey: true,\n vdomListener: true,\n vdomRef: true,\n vdomPropOrAttr: true,\n vdomRender: true,\n vdomStyle: true,\n vdomText: true,\n watchCallback: true,\n taskQueue: true,\n hotModuleReplacement: false,\n isDebug: false,\n isDev: false,\n isTesting: false,\n hydrateServerSide: false,\n hydrateClientSide: false,\n lifecycleDOMEvents: false,\n lazyLoad: false,\n profile: false,\n slotRelocation: true,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n appendChildSlotFix: false,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n cloneNodeFix: false,\n hydratedAttribute: false,\n hydratedClass: true,\n // TODO(STENCIL-1305): remove this option\n scriptDataOpts: false,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n scopedSlotTextContentFix: false,\n // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field\n shadowDomShim: false,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n slotChildNodesFix: false,\n invisiblePrehydration: true,\n propBoolean: true,\n propNumber: true,\n propString: true,\n constructableCSS: true,\n devTools: false,\n shadowDelegatesFocus: true,\n initializeNextTick: false,\n asyncLoading: true,\n asyncQueue: false,\n transformTagName: false,\n attachStyles: true,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n experimentalSlotFixes: false\n};\nvar Env = {};\nvar NAMESPACE = (\n /* default */\n \"app\"\n);\nexport {\n BUILD,\n Env,\n NAMESPACE\n};\n","/*\n Stencil Client Platform v4.28.2 | MIT Licensed | https://stenciljs.com\n */\nvar __defProp = Object.defineProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\n\n// src/client/client-build.ts\nimport { BUILD } from \"@stencil/core/internal/app-data\";\nvar Build = {\n isDev: BUILD.isDev ? true : false,\n isBrowser: true,\n isServer: false,\n isTesting: BUILD.isTesting ? true : false\n};\n\n// src/client/client-host-ref.ts\nimport { BUILD as BUILD3 } from \"@stencil/core/internal/app-data\";\n\n// src/utils/es2022-rewire-class-members.ts\nimport { BUILD as BUILD2 } from \"@stencil/core/internal/app-data\";\n\n// src/utils/constants.ts\nvar SVG_NS = \"http://www.w3.org/2000/svg\";\nvar HTML_NS = \"http://www.w3.org/1999/xhtml\";\n\n// src/utils/es2022-rewire-class-members.ts\nvar reWireGetterSetter = (instance, hostRef) => {\n var _a;\n const cmpMeta = hostRef.$cmpMeta$;\n const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});\n members.map(([memberName, [memberFlags]]) => {\n if ((BUILD2.state || BUILD2.prop) && (memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {\n const ogValue = instance[memberName];\n const ogDescriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(instance), memberName);\n Object.defineProperty(instance, memberName, {\n get() {\n return ogDescriptor.get.call(this);\n },\n set(newValue) {\n ogDescriptor.set.call(this, newValue);\n },\n configurable: true,\n enumerable: true\n });\n instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue;\n }\n });\n};\n\n// src/client/client-host-ref.ts\nvar getHostRef = (ref) => {\n if (ref.__stencil__getHostRef) {\n return ref.__stencil__getHostRef();\n }\n return void 0;\n};\nvar registerInstance = (lazyInstance, hostRef) => {\n lazyInstance.__stencil__getHostRef = () => hostRef;\n hostRef.$lazyInstance$ = lazyInstance;\n if (BUILD3.modernPropertyDecls && (BUILD3.state || BUILD3.prop)) {\n reWireGetterSetter(lazyInstance, hostRef);\n }\n};\nvar registerHost = (hostElement, cmpMeta) => {\n const hostRef = {\n $flags$: 0,\n $hostElement$: hostElement,\n $cmpMeta$: cmpMeta,\n $instanceValues$: /* @__PURE__ */ new Map()\n };\n if (BUILD3.isDev) {\n hostRef.$renderCount$ = 0;\n }\n if (BUILD3.method && BUILD3.lazyLoad) {\n hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r);\n }\n if (BUILD3.asyncLoading) {\n hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);\n hostElement[\"s-p\"] = [];\n hostElement[\"s-rc\"] = [];\n }\n const ref = hostRef;\n hostElement.__stencil__getHostRef = () => ref;\n if (!BUILD3.lazyLoad && BUILD3.modernPropertyDecls && (BUILD3.state || BUILD3.prop)) {\n reWireGetterSetter(hostElement, hostRef);\n }\n return ref;\n};\nvar isMemberInElement = (elm, memberName) => memberName in elm;\n\n// src/client/client-load-module.ts\nimport { BUILD as BUILD5 } from \"@stencil/core/internal/app-data\";\n\n// src/client/client-log.ts\nimport { BUILD as BUILD4 } from \"@stencil/core/internal/app-data\";\nvar customError;\nvar consoleError = (e, el) => (customError || console.error)(e, el);\nvar STENCIL_DEV_MODE = BUILD4.isTesting ? [\"STENCIL:\"] : [\n \"%cstencil\",\n \"color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px\"\n];\nvar consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m);\nvar consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);\nvar consoleDevInfo = (...m) => console.info(...STENCIL_DEV_MODE, ...m);\nvar setErrorHandler = (handler) => customError = handler;\n\n// src/client/client-load-module.ts\nvar cmpModules = /* @__PURE__ */ new Map();\nvar MODULE_IMPORT_PREFIX = \"./\";\nvar loadModule = (cmpMeta, hostRef, hmrVersionId) => {\n const exportName = cmpMeta.$tagName$.replace(/-/g, \"_\");\n const bundleId = cmpMeta.$lazyBundleId$;\n if (BUILD5.isDev && typeof bundleId !== \"string\") {\n consoleDevError(\n `Trying to lazily load component <${cmpMeta.$tagName$}> with style mode \"${hostRef.$modeName$}\", but it does not exist.`\n );\n return void 0;\n } else if (!bundleId) {\n return void 0;\n }\n const module = !BUILD5.hotModuleReplacement ? cmpModules.get(bundleId) : false;\n if (module) {\n return module[exportName];\n }\n /*!__STENCIL_STATIC_IMPORT_SWITCH__*/\n return import(\n /* @vite-ignore */\n /* webpackInclude: /\\.entry\\.js$/ */\n /* webpackExclude: /\\.system\\.entry\\.js$/ */\n /* webpackMode: \"lazy\" */\n `./${bundleId}.entry.js${BUILD5.hotModuleReplacement && hmrVersionId ? \"?s-hmr=\" + hmrVersionId : \"\"}`\n ).then(\n (importedModule) => {\n if (!BUILD5.hotModuleReplacement) {\n cmpModules.set(bundleId, importedModule);\n }\n return importedModule[exportName];\n },\n (e) => {\n consoleError(e, hostRef.$hostElement$);\n }\n );\n};\n\n// src/client/client-style.ts\nvar styles = /* @__PURE__ */ new Map();\nvar modeResolutionChain = [];\n\n// src/client/client-task-queue.ts\nimport { BUILD as BUILD7 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/runtime-constants.ts\nvar CONTENT_REF_ID = \"r\";\nvar ORG_LOCATION_ID = \"o\";\nvar SLOT_NODE_ID = \"s\";\nvar TEXT_NODE_ID = \"t\";\nvar COMMENT_NODE_ID = \"c\";\nvar HYDRATE_ID = \"s-id\";\nvar HYDRATED_STYLE_ID = \"sty-id\";\nvar HYDRATE_CHILD_ID = \"c-id\";\nvar HYDRATED_CSS = \"{visibility:hidden}.hydrated{visibility:inherit}\";\nvar STENCIL_DOC_DATA = \"_stencilDocData\";\nvar DEFAULT_DOC_DATA = {\n hostIds: 0,\n rootLevelIds: 0,\n staticComponents: /* @__PURE__ */ new Set()\n};\nvar SLOT_FB_CSS = \"slot-fb{display:contents}slot-fb[hidden]{display:none}\";\nvar XLINK_NS = \"http://www.w3.org/1999/xlink\";\nvar FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [\n \"formAssociatedCallback\",\n \"formResetCallback\",\n \"formDisabledCallback\",\n \"formStateRestoreCallback\"\n];\n\n// src/client/client-window.ts\nimport { BUILD as BUILD6 } from \"@stencil/core/internal/app-data\";\nvar win = typeof window !== \"undefined\" ? window : {};\nvar H = win.HTMLElement || class {\n};\nvar plt = {\n $flags$: 0,\n $resourcesUrl$: \"\",\n jmp: (h2) => h2(),\n raf: (h2) => requestAnimationFrame(h2),\n ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),\n rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),\n ce: (eventName, opts) => new CustomEvent(eventName, opts)\n};\nvar setPlatformHelpers = (helpers) => {\n Object.assign(plt, helpers);\n};\nvar supportsShadow = BUILD6.shadowDom;\nvar supportsListenerOptions = /* @__PURE__ */ (() => {\n var _a;\n let supportsListenerOptions2 = false;\n try {\n (_a = win.document) == null ? void 0 : _a.addEventListener(\n \"e\",\n null,\n Object.defineProperty({}, \"passive\", {\n get() {\n supportsListenerOptions2 = true;\n }\n })\n );\n } catch (e) {\n }\n return supportsListenerOptions2;\n})();\nvar promiseResolve = (v) => Promise.resolve(v);\nvar supportsConstructableStylesheets = BUILD6.constructableCSS ? /* @__PURE__ */ (() => {\n try {\n new CSSStyleSheet();\n return typeof new CSSStyleSheet().replaceSync === \"function\";\n } catch (e) {\n }\n return false;\n})() : false;\n\n// src/client/client-task-queue.ts\nvar queueCongestion = 0;\nvar queuePending = false;\nvar queueDomReads = [];\nvar queueDomWrites = [];\nvar queueDomWritesLow = [];\nvar queueTask = (queue, write) => (cb) => {\n queue.push(cb);\n if (!queuePending) {\n queuePending = true;\n if (write && plt.$flags$ & 4 /* queueSync */) {\n nextTick(flush);\n } else {\n plt.raf(flush);\n }\n }\n};\nvar consume = (queue) => {\n for (let i2 = 0; i2 < queue.length; i2++) {\n try {\n queue[i2](performance.now());\n } catch (e) {\n consoleError(e);\n }\n }\n queue.length = 0;\n};\nvar consumeTimeout = (queue, timeout) => {\n let i2 = 0;\n let ts = 0;\n while (i2 < queue.length && (ts = performance.now()) < timeout) {\n try {\n queue[i2++](ts);\n } catch (e) {\n consoleError(e);\n }\n }\n if (i2 === queue.length) {\n queue.length = 0;\n } else if (i2 !== 0) {\n queue.splice(0, i2);\n }\n};\nvar flush = () => {\n if (BUILD7.asyncQueue) {\n queueCongestion++;\n }\n consume(queueDomReads);\n if (BUILD7.asyncQueue) {\n const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */ ? performance.now() + 14 * Math.ceil(queueCongestion * (1 / 10)) : Infinity;\n consumeTimeout(queueDomWrites, timeout);\n consumeTimeout(queueDomWritesLow, timeout);\n if (queueDomWrites.length > 0) {\n queueDomWritesLow.push(...queueDomWrites);\n queueDomWrites.length = 0;\n }\n if (queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0) {\n plt.raf(flush);\n } else {\n queueCongestion = 0;\n }\n } else {\n consume(queueDomWrites);\n if (queuePending = queueDomReads.length > 0) {\n plt.raf(flush);\n }\n }\n};\nvar nextTick = (cb) => promiseResolve().then(cb);\nvar readTask = /* @__PURE__ */ queueTask(queueDomReads, false);\nvar writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);\n\n// src/client/index.ts\nimport { BUILD as BUILD29, Env, NAMESPACE as NAMESPACE2 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/asset-path.ts\nvar getAssetPath = (path) => {\n const assetUrl = new URL(path, plt.$resourcesUrl$);\n return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;\n};\nvar setAssetPath = (path) => plt.$resourcesUrl$ = path;\n\n// src/runtime/bootstrap-custom-element.ts\nimport { BUILD as BUILD26 } from \"@stencil/core/internal/app-data\";\n\n// src/utils/helpers.ts\nvar isDef = (v) => v != null && v !== void 0;\nvar isComplexType = (o) => {\n o = typeof o;\n return o === \"object\" || o === \"function\";\n};\n\n// src/utils/query-nonce-meta-tag-content.ts\nfunction queryNonceMetaTagContent(doc) {\n var _a, _b, _c;\n return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name=\"csp-nonce\"]')) == null ? void 0 : _b.getAttribute(\"content\")) != null ? _c : void 0;\n}\n\n// src/utils/regular-expression.ts\nvar escapeRegExpSpecialCharacters = (text) => {\n return text.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n};\n\n// src/utils/result.ts\nvar result_exports = {};\n__export(result_exports, {\n err: () => err,\n map: () => map,\n ok: () => ok,\n unwrap: () => unwrap,\n unwrapErr: () => unwrapErr\n});\nvar ok = (value) => ({\n isOk: true,\n isErr: false,\n value\n});\nvar err = (value) => ({\n isOk: false,\n isErr: true,\n value\n});\nfunction map(result, fn) {\n if (result.isOk) {\n const val = fn(result.value);\n if (val instanceof Promise) {\n return val.then((newVal) => ok(newVal));\n } else {\n return ok(val);\n }\n }\n if (result.isErr) {\n const value = result.value;\n return err(value);\n }\n throw \"should never get here\";\n}\nvar unwrap = (result) => {\n if (result.isOk) {\n return result.value;\n } else {\n throw result.value;\n }\n};\nvar unwrapErr = (result) => {\n if (result.isErr) {\n return result.value;\n } else {\n throw result.value;\n }\n};\n\n// src/utils/util.ts\nvar lowerPathParam = (fn) => (p) => fn(p.toLowerCase());\nvar isDtsFile = lowerPathParam((p) => p.endsWith(\".d.ts\") || p.endsWith(\".d.mts\") || p.endsWith(\".d.cts\"));\nvar isTsFile = lowerPathParam(\n (p) => !isDtsFile(p) && (p.endsWith(\".ts\") || p.endsWith(\".mts\") || p.endsWith(\".cts\"))\n);\nvar isTsxFile = lowerPathParam(\n (p) => p.endsWith(\".tsx\") || p.endsWith(\".mtsx\") || p.endsWith(\".ctsx\")\n);\nvar isJsxFile = lowerPathParam(\n (p) => p.endsWith(\".jsx\") || p.endsWith(\".mjsx\") || p.endsWith(\".cjsx\")\n);\nvar isJsFile = lowerPathParam((p) => p.endsWith(\".js\") || p.endsWith(\".mjs\") || p.endsWith(\".cjs\"));\n\n// src/runtime/connected-callback.ts\nimport { BUILD as BUILD24 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/client-hydrate.ts\nimport { BUILD as BUILD12 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/dom-extras.ts\nimport { BUILD as BUILD9 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/slot-polyfill-utils.ts\nimport { BUILD as BUILD8 } from \"@stencil/core/internal/app-data\";\nvar updateFallbackSlotVisibility = (elm) => {\n const childNodes = internalCall(elm, \"childNodes\");\n if (elm.tagName && elm.tagName.includes(\"-\") && elm[\"s-cr\"] && elm.tagName !== \"SLOT-FB\") {\n getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {\n if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === \"SLOT-FB\") {\n if (getSlotChildSiblings(slotNode, getSlotName(slotNode), false).length) {\n slotNode.hidden = true;\n } else {\n slotNode.hidden = false;\n }\n }\n });\n }\n let i2 = 0;\n for (i2 = 0; i2 < childNodes.length; i2++) {\n const childNode = childNodes[i2];\n if (childNode.nodeType === 1 /* ElementNode */ && internalCall(childNode, \"childNodes\").length) {\n updateFallbackSlotVisibility(childNode);\n }\n }\n};\nvar getSlottedChildNodes = (childNodes) => {\n const result = [];\n for (let i2 = 0; i2 < childNodes.length; i2++) {\n const slottedNode = childNodes[i2][\"s-nr\"] || void 0;\n if (slottedNode && slottedNode.isConnected) {\n result.push(slottedNode);\n }\n }\n return result;\n};\nfunction getHostSlotNodes(childNodes, hostName, slotName) {\n let i2 = 0;\n let slottedNodes = [];\n let childNode;\n for (; i2 < childNodes.length; i2++) {\n childNode = childNodes[i2];\n if (childNode[\"s-sr\"] && (!hostName || childNode[\"s-hn\"] === hostName) && (slotName === void 0 || getSlotName(childNode) === slotName)) {\n slottedNodes.push(childNode);\n if (typeof slotName !== \"undefined\") return slottedNodes;\n }\n slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];\n }\n return slottedNodes;\n}\nvar getSlotChildSiblings = (slot, slotName, includeSlot = true) => {\n const childNodes = [];\n if (includeSlot && slot[\"s-sr\"] || !slot[\"s-sr\"]) childNodes.push(slot);\n let node = slot;\n while (node = node.nextSibling) {\n if (getSlotName(node) === slotName && (includeSlot || !node[\"s-sr\"])) childNodes.push(node);\n }\n return childNodes;\n};\nvar isNodeLocatedInSlot = (nodeToRelocate, slotName) => {\n if (nodeToRelocate.nodeType === 1 /* ElementNode */) {\n if (nodeToRelocate.getAttribute(\"slot\") === null && slotName === \"\") {\n return true;\n }\n if (nodeToRelocate.getAttribute(\"slot\") === slotName) {\n return true;\n }\n return false;\n }\n if (nodeToRelocate[\"s-sn\"] === slotName) {\n return true;\n }\n return slotName === \"\";\n};\nvar addSlotRelocateNode = (newChild, slotNode, prepend, position) => {\n if (newChild[\"s-ol\"] && newChild[\"s-ol\"].isConnected) {\n return;\n }\n const slottedNodeLocation = document.createTextNode(\"\");\n slottedNodeLocation[\"s-nr\"] = newChild;\n if (!slotNode[\"s-cr\"] || !slotNode[\"s-cr\"].parentNode) return;\n const parent = slotNode[\"s-cr\"].parentNode;\n const appendMethod = prepend ? internalCall(parent, \"prepend\") : internalCall(parent, \"appendChild\");\n if (BUILD8.hydrateClientSide && typeof position !== \"undefined\") {\n slottedNodeLocation[\"s-oo\"] = position;\n const childNodes = internalCall(parent, \"childNodes\");\n const slotRelocateNodes = [slottedNodeLocation];\n childNodes.forEach((n) => {\n if (n[\"s-nr\"]) slotRelocateNodes.push(n);\n });\n slotRelocateNodes.sort((a, b) => {\n if (!a[\"s-oo\"] || a[\"s-oo\"] < (b[\"s-oo\"] || 0)) return -1;\n else if (!b[\"s-oo\"] || b[\"s-oo\"] < a[\"s-oo\"]) return 1;\n return 0;\n });\n slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));\n } else {\n appendMethod.call(parent, slottedNodeLocation);\n }\n newChild[\"s-ol\"] = slottedNodeLocation;\n newChild[\"s-sh\"] = slotNode[\"s-hn\"];\n};\nvar getSlotName = (node) => typeof node[\"s-sn\"] === \"string\" ? node[\"s-sn\"] : node.nodeType === 1 && node.getAttribute(\"slot\") || void 0;\nfunction patchSlotNode(node) {\n if (node.assignedElements || node.assignedNodes || !node[\"s-sr\"]) return;\n const assignedFactory = (elementsOnly) => (function(opts) {\n const toReturn = [];\n const slotName = this[\"s-sn\"];\n if (opts == null ? void 0 : opts.flatten) {\n console.error(`\n Flattening is not supported for Stencil non-shadow slots. \n You can use \\`.childNodes\\` to nested slot fallback content.\n If you have a particular use case, please open an issue on the Stencil repo.\n `);\n }\n const parent = this[\"s-cr\"].parentElement;\n const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);\n slottedNodes.forEach((n) => {\n if (slotName === getSlotName(n)) {\n toReturn.push(n);\n }\n });\n if (elementsOnly) {\n return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);\n }\n return toReturn;\n }).bind(node);\n node.assignedElements = assignedFactory(true);\n node.assignedNodes = assignedFactory(false);\n}\nfunction dispatchSlotChangeEvent(elm) {\n elm.dispatchEvent(new CustomEvent(\"slotchange\", { bubbles: false, cancelable: false, composed: false }));\n}\nfunction findSlotFromSlottedNode(slottedNode, parentHost) {\n var _a;\n parentHost = parentHost || ((_a = slottedNode[\"s-ol\"]) == null ? void 0 : _a.parentElement);\n if (!parentHost) return { slotNode: null, slotName: \"\" };\n const slotName = slottedNode[\"s-sn\"] = getSlotName(slottedNode) || \"\";\n const childNodes = internalCall(parentHost, \"childNodes\");\n const slotNode = getHostSlotNodes(childNodes, parentHost.tagName, slotName)[0];\n return { slotNode, slotName };\n}\n\n// src/runtime/dom-extras.ts\nvar patchPseudoShadowDom = (hostElementPrototype) => {\n patchCloneNode(hostElementPrototype);\n patchSlotAppendChild(hostElementPrototype);\n patchSlotAppend(hostElementPrototype);\n patchSlotPrepend(hostElementPrototype);\n patchSlotInsertAdjacentElement(hostElementPrototype);\n patchSlotInsertAdjacentHTML(hostElementPrototype);\n patchSlotInsertAdjacentText(hostElementPrototype);\n patchInsertBefore(hostElementPrototype);\n patchTextContent(hostElementPrototype);\n patchChildSlotNodes(hostElementPrototype);\n patchSlotRemoveChild(hostElementPrototype);\n};\nvar patchCloneNode = (HostElementPrototype) => {\n const orgCloneNode = HostElementPrototype.cloneNode;\n HostElementPrototype.cloneNode = function(deep) {\n const srcNode = this;\n const isShadowDom = BUILD9.shadowDom ? srcNode.shadowRoot && supportsShadow : false;\n const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);\n if (BUILD9.slot && !isShadowDom && deep) {\n let i2 = 0;\n let slotted, nonStencilNode;\n const stencilPrivates = [\n \"s-id\",\n \"s-cr\",\n \"s-lr\",\n \"s-rc\",\n \"s-sc\",\n \"s-p\",\n \"s-cn\",\n \"s-sr\",\n \"s-sn\",\n \"s-hn\",\n \"s-ol\",\n \"s-nr\",\n \"s-si\",\n \"s-rf\",\n \"s-scs\"\n ];\n const childNodes = this.__childNodes || this.childNodes;\n for (; i2 < childNodes.length; i2++) {\n slotted = childNodes[i2][\"s-nr\"];\n nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);\n if (slotted) {\n if (BUILD9.appendChildSlotFix && clonedNode.__appendChild) {\n clonedNode.__appendChild(slotted.cloneNode(true));\n } else {\n clonedNode.appendChild(slotted.cloneNode(true));\n }\n }\n if (nonStencilNode) {\n clonedNode.appendChild(childNodes[i2].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nvar patchSlotAppendChild = (HostElementPrototype) => {\n HostElementPrototype.__appendChild = HostElementPrototype.appendChild;\n HostElementPrototype.appendChild = function(newChild) {\n const { slotName, slotNode } = findSlotFromSlottedNode(newChild, this);\n if (slotNode) {\n addSlotRelocateNode(newChild, slotNode);\n const slotChildNodes = getSlotChildSiblings(slotNode, slotName);\n const appendAfter = slotChildNodes[slotChildNodes.length - 1];\n const parent = internalCall(appendAfter, \"parentNode\");\n const insertedNode = internalCall(parent, \"insertBefore\")(newChild, appendAfter.nextSibling);\n dispatchSlotChangeEvent(slotNode);\n updateFallbackSlotVisibility(this);\n return insertedNode;\n }\n return this.__appendChild(newChild);\n };\n};\nvar patchSlotRemoveChild = (ElementPrototype) => {\n ElementPrototype.__removeChild = ElementPrototype.removeChild;\n ElementPrototype.removeChild = function(toRemove) {\n if (toRemove && typeof toRemove[\"s-sn\"] !== \"undefined\") {\n const childNodes = this.__childNodes || this.childNodes;\n const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove[\"s-sn\"]);\n if (slotNode && toRemove.isConnected) {\n toRemove.remove();\n updateFallbackSlotVisibility(this);\n return;\n }\n }\n return this.__removeChild(toRemove);\n };\n};\nvar patchSlotPrepend = (HostElementPrototype) => {\n HostElementPrototype.__prepend = HostElementPrototype.prepend;\n HostElementPrototype.prepend = function(...newChildren) {\n newChildren.forEach((newChild) => {\n if (typeof newChild === \"string\") {\n newChild = this.ownerDocument.createTextNode(newChild);\n }\n const slotName = (newChild[\"s-sn\"] = getSlotName(newChild)) || \"\";\n const childNodes = internalCall(this, \"childNodes\");\n const slotNode = getHostSlotNodes(childNodes, this.tagName, slotName)[0];\n if (slotNode) {\n addSlotRelocateNode(newChild, slotNode, true);\n const slotChildNodes = getSlotChildSiblings(slotNode, slotName);\n const appendAfter = slotChildNodes[0];\n const parent = internalCall(appendAfter, \"parentNode\");\n const toReturn = internalCall(parent, \"insertBefore\")(newChild, internalCall(appendAfter, \"nextSibling\"));\n dispatchSlotChangeEvent(slotNode);\n return toReturn;\n }\n if (newChild.nodeType === 1 && !!newChild.getAttribute(\"slot\")) {\n newChild.hidden = true;\n }\n return HostElementPrototype.__prepend(newChild);\n });\n };\n};\nvar patchSlotAppend = (HostElementPrototype) => {\n HostElementPrototype.__append = HostElementPrototype.append;\n HostElementPrototype.append = function(...newChildren) {\n newChildren.forEach((newChild) => {\n if (typeof newChild === \"string\") {\n newChild = this.ownerDocument.createTextNode(newChild);\n }\n this.appendChild(newChild);\n });\n };\n};\nvar patchSlotInsertAdjacentHTML = (HostElementPrototype) => {\n const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;\n HostElementPrototype.insertAdjacentHTML = function(position, text) {\n if (position !== \"afterbegin\" && position !== \"beforeend\") {\n return originalInsertAdjacentHtml.call(this, position, text);\n }\n const container = this.ownerDocument.createElement(\"_\");\n let node;\n container.innerHTML = text;\n if (position === \"afterbegin\") {\n while (node = container.firstChild) {\n this.prepend(node);\n }\n } else if (position === \"beforeend\") {\n while (node = container.firstChild) {\n this.append(node);\n }\n }\n };\n};\nvar patchSlotInsertAdjacentText = (HostElementPrototype) => {\n HostElementPrototype.insertAdjacentText = function(position, text) {\n this.insertAdjacentHTML(position, text);\n };\n};\nvar patchInsertBefore = (HostElementPrototype) => {\n const eleProto = HostElementPrototype;\n if (eleProto.__insertBefore) return;\n eleProto.__insertBefore = HostElementPrototype.insertBefore;\n HostElementPrototype.insertBefore = function(newChild, currentChild) {\n const { slotName, slotNode } = findSlotFromSlottedNode(newChild, this);\n const slottedNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);\n if (slotNode) {\n let found = false;\n slottedNodes.forEach((childNode) => {\n if (childNode === currentChild || currentChild === null) {\n found = true;\n if (currentChild === null || slotName !== currentChild[\"s-sn\"]) {\n this.appendChild(newChild);\n return;\n }\n if (slotName === currentChild[\"s-sn\"]) {\n addSlotRelocateNode(newChild, slotNode);\n const parent = internalCall(currentChild, \"parentNode\");\n internalCall(parent, \"insertBefore\")(newChild, currentChild);\n dispatchSlotChangeEvent(slotNode);\n }\n return;\n }\n });\n if (found) return newChild;\n }\n const parentNode = currentChild == null ? void 0 : currentChild.__parentNode;\n if (parentNode && !this.isSameNode(parentNode)) {\n return this.appendChild(newChild);\n }\n return this.__insertBefore(newChild, currentChild);\n };\n};\nvar patchSlotInsertAdjacentElement = (HostElementPrototype) => {\n const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;\n HostElementPrototype.insertAdjacentElement = function(position, element) {\n if (position !== \"afterbegin\" && position !== \"beforeend\") {\n return originalInsertAdjacentElement.call(this, position, element);\n }\n if (position === \"afterbegin\") {\n this.prepend(element);\n return element;\n } else if (position === \"beforeend\") {\n this.append(element);\n return element;\n }\n return element;\n };\n};\nvar patchTextContent = (hostElementPrototype) => {\n patchHostOriginalAccessor(\"textContent\", hostElementPrototype);\n Object.defineProperty(hostElementPrototype, \"textContent\", {\n get: function() {\n let text = \"\";\n const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);\n childNodes.forEach((node) => text += node.textContent || \"\");\n return text;\n },\n set: function(value) {\n const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);\n childNodes.forEach((node) => {\n if (node[\"s-ol\"]) node[\"s-ol\"].remove();\n node.remove();\n });\n this.insertAdjacentHTML(\"beforeend\", value);\n }\n });\n};\nvar patchChildSlotNodes = (elm) => {\n class FakeNodeList extends Array {\n item(n) {\n return this[n];\n }\n }\n patchHostOriginalAccessor(\"children\", elm);\n Object.defineProperty(elm, \"children\", {\n get() {\n return this.childNodes.filter((n) => n.nodeType === 1);\n }\n });\n Object.defineProperty(elm, \"childElementCount\", {\n get() {\n return this.children.length;\n }\n });\n patchHostOriginalAccessor(\"firstChild\", elm);\n Object.defineProperty(elm, \"firstChild\", {\n get() {\n return this.childNodes[0];\n }\n });\n patchHostOriginalAccessor(\"lastChild\", elm);\n Object.defineProperty(elm, \"lastChild\", {\n get() {\n return this.childNodes[this.childNodes.length - 1];\n }\n });\n patchHostOriginalAccessor(\"childNodes\", elm);\n Object.defineProperty(elm, \"childNodes\", {\n get() {\n const result = new FakeNodeList();\n result.push(...getSlottedChildNodes(this.__childNodes));\n return result;\n }\n });\n};\nvar patchSlottedNode = (node) => {\n if (!node || node.__nextSibling !== void 0 || !globalThis.Node) return;\n patchNextSibling(node);\n patchPreviousSibling(node);\n patchParentNode(node);\n if (node.nodeType === Node.ELEMENT_NODE) {\n patchNextElementSibling(node);\n patchPreviousElementSibling(node);\n }\n};\nvar patchNextSibling = (node) => {\n if (!node || node.__nextSibling) return;\n patchHostOriginalAccessor(\"nextSibling\", node);\n Object.defineProperty(node, \"nextSibling\", {\n get: function() {\n var _a;\n const parentNodes = (_a = this[\"s-ol\"]) == null ? void 0 : _a.parentNode.childNodes;\n const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);\n if (parentNodes && index > -1) {\n return parentNodes[index + 1];\n }\n return this.__nextSibling;\n }\n });\n};\nvar patchNextElementSibling = (element) => {\n if (!element || element.__nextElementSibling) return;\n patchHostOriginalAccessor(\"nextElementSibling\", element);\n Object.defineProperty(element, \"nextElementSibling\", {\n get: function() {\n var _a;\n const parentEles = (_a = this[\"s-ol\"]) == null ? void 0 : _a.parentNode.children;\n const index = parentEles == null ? void 0 : parentEles.indexOf(this);\n if (parentEles && index > -1) {\n return parentEles[index + 1];\n }\n return this.__nextElementSibling;\n }\n });\n};\nvar patchPreviousSibling = (node) => {\n if (!node || node.__previousSibling) return;\n patchHostOriginalAccessor(\"previousSibling\", node);\n Object.defineProperty(node, \"previousSibling\", {\n get: function() {\n var _a;\n const parentNodes = (_a = this[\"s-ol\"]) == null ? void 0 : _a.parentNode.childNodes;\n const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);\n if (parentNodes && index > -1) {\n return parentNodes[index - 1];\n }\n return this.__previousSibling;\n }\n });\n};\nvar patchPreviousElementSibling = (element) => {\n if (!element || element.__previousElementSibling) return;\n patchHostOriginalAccessor(\"previousElementSibling\", element);\n Object.defineProperty(element, \"previousElementSibling\", {\n get: function() {\n var _a;\n const parentNodes = (_a = this[\"s-ol\"]) == null ? void 0 : _a.parentNode.children;\n const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);\n if (parentNodes && index > -1) {\n return parentNodes[index - 1];\n }\n return this.__previousElementSibling;\n }\n });\n};\nvar patchParentNode = (node) => {\n if (!node || node.__parentNode) return;\n patchHostOriginalAccessor(\"parentNode\", node);\n Object.defineProperty(node, \"parentNode\", {\n get: function() {\n var _a;\n return ((_a = this[\"s-ol\"]) == null ? void 0 : _a.parentNode) || this.__parentNode;\n },\n set: function(value) {\n this.__parentNode = value;\n }\n });\n};\nvar validElementPatches = [\"children\", \"nextElementSibling\", \"previousElementSibling\"];\nvar validNodesPatches = [\n \"childNodes\",\n \"firstChild\",\n \"lastChild\",\n \"nextSibling\",\n \"previousSibling\",\n \"textContent\",\n \"parentNode\"\n];\nfunction patchHostOriginalAccessor(accessorName, node) {\n let accessor;\n if (validElementPatches.includes(accessorName)) {\n accessor = Object.getOwnPropertyDescriptor(Element.prototype, accessorName);\n } else if (validNodesPatches.includes(accessorName)) {\n accessor = Object.getOwnPropertyDescriptor(Node.prototype, accessorName);\n }\n if (!accessor) {\n accessor = Object.getOwnPropertyDescriptor(node, accessorName);\n }\n if (accessor) Object.defineProperty(node, \"__\" + accessorName, accessor);\n}\nfunction internalCall(node, method) {\n if (\"__\" + method in node) {\n const toReturn = node[\"__\" + method];\n if (typeof toReturn !== \"function\") return toReturn;\n return toReturn.bind(node);\n } else {\n if (typeof node[method] !== \"function\") return node[method];\n return node[method].bind(node);\n }\n}\n\n// src/runtime/profile.ts\nimport { BUILD as BUILD10 } from \"@stencil/core/internal/app-data\";\nvar i = 0;\nvar createTime = (fnName, tagName = \"\") => {\n if (BUILD10.profile && performance.mark) {\n const key = `st:${fnName}:${tagName}:${i++}`;\n performance.mark(key);\n return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);\n } else {\n return () => {\n return;\n };\n }\n};\nvar uniqueTime = (key, measureText) => {\n if (BUILD10.profile && performance.mark) {\n if (performance.getEntriesByName(key, \"mark\").length === 0) {\n performance.mark(key);\n }\n return () => {\n if (performance.getEntriesByName(measureText, \"measure\").length === 0) {\n performance.measure(measureText, key);\n }\n };\n } else {\n return () => {\n return;\n };\n }\n};\nvar inspect = (ref) => {\n const hostRef = getHostRef(ref);\n if (!hostRef) {\n return void 0;\n }\n const flags = hostRef.$flags$;\n const hostElement = hostRef.$hostElement$;\n return {\n renderCount: hostRef.$renderCount$,\n flags: {\n hasRendered: !!(flags & 2 /* hasRendered */),\n hasConnected: !!(flags & 1 /* hasConnected */),\n isWaitingForChildren: !!(flags & 4 /* isWaitingForChildren */),\n isConstructingInstance: !!(flags & 8 /* isConstructingInstance */),\n isQueuedForUpdate: !!(flags & 16 /* isQueuedForUpdate */),\n hasInitializedComponent: !!(flags & 32 /* hasInitializedComponent */),\n hasLoadedComponent: !!(flags & 64 /* hasLoadedComponent */),\n isWatchReady: !!(flags & 128 /* isWatchReady */),\n isListenReady: !!(flags & 256 /* isListenReady */),\n needsRerender: !!(flags & 512 /* needsRerender */)\n },\n instanceValues: hostRef.$instanceValues$,\n ancestorComponent: hostRef.$ancestorComponent$,\n hostElement,\n lazyInstance: hostRef.$lazyInstance$,\n vnode: hostRef.$vnode$,\n modeName: hostRef.$modeName$,\n onReadyPromise: hostRef.$onReadyPromise$,\n onReadyResolve: hostRef.$onReadyResolve$,\n onInstancePromise: hostRef.$onInstancePromise$,\n onInstanceResolve: hostRef.$onInstanceResolve$,\n onRenderResolve: hostRef.$onRenderResolve$,\n queuedListeners: hostRef.$queuedListeners$,\n rmListeners: hostRef.$rmListeners$,\n [\"s-id\"]: hostElement[\"s-id\"],\n [\"s-cr\"]: hostElement[\"s-cr\"],\n [\"s-lr\"]: hostElement[\"s-lr\"],\n [\"s-p\"]: hostElement[\"s-p\"],\n [\"s-rc\"]: hostElement[\"s-rc\"],\n [\"s-sc\"]: hostElement[\"s-sc\"]\n };\n};\nvar installDevTools = () => {\n if (BUILD10.devTools) {\n const stencil = win.stencil = win.stencil || {};\n const originalInspect = stencil.inspect;\n stencil.inspect = (ref) => {\n let result = inspect(ref);\n if (!result && typeof originalInspect === \"function\") {\n result = originalInspect(ref);\n }\n return result;\n };\n }\n};\n\n// src/runtime/vdom/h.ts\nimport { BUILD as BUILD11 } from \"@stencil/core/internal/app-data\";\nvar h = (nodeName, vnodeData, ...children) => {\n let child = null;\n let key = null;\n let slotName = null;\n let simple = false;\n let lastSimple = false;\n const vNodeChildren = [];\n const walk = (c) => {\n for (let i2 = 0; i2 < c.length; i2++) {\n child = c[i2];\n if (Array.isArray(child)) {\n walk(child);\n } else if (child != null && typeof child !== \"boolean\") {\n if (simple = typeof nodeName !== \"function\" && !isComplexType(child)) {\n child = String(child);\n } else if (BUILD11.isDev && typeof nodeName !== \"function\" && child.$flags$ === void 0) {\n consoleDevError(`vNode passed as children has unexpected type.\nMake sure it's using the correct h() function.\nEmpty objects can also be the cause, look for JSX comments that became objects.`);\n }\n if (simple && lastSimple) {\n vNodeChildren[vNodeChildren.length - 1].$text$ += child;\n } else {\n vNodeChildren.push(simple ? newVNode(null, child) : child);\n }\n lastSimple = simple;\n }\n }\n };\n walk(children);\n if (vnodeData) {\n if (BUILD11.isDev && nodeName === \"input\") {\n validateInputProperties(vnodeData);\n }\n if (BUILD11.vdomKey && vnodeData.key) {\n key = vnodeData.key;\n }\n if (BUILD11.slotRelocation && vnodeData.name) {\n slotName = vnodeData.name;\n }\n if (BUILD11.vdomClass) {\n const classData = vnodeData.className || vnodeData.class;\n if (classData) {\n vnodeData.class = typeof classData !== \"object\" ? classData : Object.keys(classData).filter((k) => classData[k]).join(\" \");\n }\n }\n }\n if (BUILD11.isDev && vNodeChildren.some(isHost)) {\n consoleDevError(`The <Host> must be the single root component. Make sure:\n- You are NOT using hostData() and <Host> in the same component.\n- <Host> is used once, and it's the single root component of the render() function.`);\n }\n if (BUILD11.vdomFunctional && typeof nodeName === \"function\") {\n return nodeName(\n vnodeData === null ? {} : vnodeData,\n vNodeChildren,\n vdomFnUtils\n );\n }\n const vnode = newVNode(nodeName, null);\n vnode.$attrs$ = vnodeData;\n if (vNodeChildren.length > 0) {\n vnode.$children$ = vNodeChildren;\n }\n if (BUILD11.vdomKey) {\n vnode.$key$ = key;\n }\n if (BUILD11.slotRelocation) {\n vnode.$name$ = slotName;\n }\n return vnode;\n};\nvar newVNode = (tag, text) => {\n const vnode = {\n $flags$: 0,\n $tag$: tag,\n $text$: text,\n $elm$: null,\n $children$: null\n };\n if (BUILD11.vdomAttribute) {\n vnode.$attrs$ = null;\n }\n if (BUILD11.vdomKey) {\n vnode.$key$ = null;\n }\n if (BUILD11.slotRelocation) {\n vnode.$name$ = null;\n }\n return vnode;\n};\nvar Host = {};\nvar isHost = (node) => node && node.$tag$ === Host;\nvar vdomFnUtils = {\n forEach: (children, cb) => children.map(convertToPublic).forEach(cb),\n map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate)\n};\nvar convertToPublic = (node) => ({\n vattrs: node.$attrs$,\n vchildren: node.$children$,\n vkey: node.$key$,\n vname: node.$name$,\n vtag: node.$tag$,\n vtext: node.$text$\n});\nvar convertToPrivate = (node) => {\n if (typeof node.vtag === \"function\") {\n const vnodeData = { ...node.vattrs };\n if (node.vkey) {\n vnodeData.key = node.vkey;\n }\n if (node.vname) {\n vnodeData.name = node.vname;\n }\n return h(node.vtag, vnodeData, ...node.vchildren || []);\n }\n const vnode = newVNode(node.vtag, node.vtext);\n vnode.$attrs$ = node.vattrs;\n vnode.$children$ = node.vchildren;\n vnode.$key$ = node.vkey;\n vnode.$name$ = node.vname;\n return vnode;\n};\nvar validateInputProperties = (inputElm) => {\n const props = Object.keys(inputElm);\n const value = props.indexOf(\"value\");\n if (value === -1) {\n return;\n }\n const typeIndex = props.indexOf(\"type\");\n const minIndex = props.indexOf(\"min\");\n const maxIndex = props.indexOf(\"max\");\n const stepIndex = props.indexOf(\"step\");\n if (value < typeIndex || value < minIndex || value < maxIndex || value < stepIndex) {\n consoleDevWarn(`The \"value\" prop of <input> should be set after \"min\", \"max\", \"type\" and \"step\"`);\n }\n};\n\n// src/runtime/client-hydrate.ts\nvar initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {\n const endHydrate = createTime(\"hydrateClient\", tagName);\n const shadowRoot = hostElm.shadowRoot;\n const childRenderNodes = [];\n const slotNodes = [];\n const slottedNodes = [];\n const shadowRootNodes = BUILD12.shadowDom && shadowRoot ? [] : null;\n const vnode = newVNode(tagName, null);\n vnode.$elm$ = hostElm;\n let scopeId2;\n if (BUILD12.scoped) {\n const cmpMeta = hostRef.$cmpMeta$;\n if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm[\"s-sc\"]) {\n scopeId2 = hostElm[\"s-sc\"];\n hostElm.classList.add(scopeId2 + \"-h\");\n } else if (hostElm[\"s-sc\"]) {\n delete hostElm[\"s-sc\"];\n }\n }\n if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {\n initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());\n }\n hostElm[HYDRATE_ID] = hostId;\n hostElm.removeAttribute(HYDRATE_ID);\n hostRef.$vnode$ = clientHydrate(\n vnode,\n childRenderNodes,\n slotNodes,\n shadowRootNodes,\n hostElm,\n hostElm,\n hostId,\n slottedNodes\n );\n let crIndex = 0;\n const crLength = childRenderNodes.length;\n let childRenderNode;\n for (crIndex; crIndex < crLength; crIndex++) {\n childRenderNode = childRenderNodes[crIndex];\n const orgLocationId = childRenderNode.$hostId$ + \".\" + childRenderNode.$nodeId$;\n const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);\n const node = childRenderNode.$elm$;\n if (!shadowRoot) {\n node[\"s-hn\"] = tagName.toUpperCase();\n if (childRenderNode.$tag$ === \"slot\") {\n node[\"s-cr\"] = hostElm[\"s-cr\"];\n }\n }\n if (childRenderNode.$tag$ === \"slot\") {\n childRenderNode.$name$ = childRenderNode.$elm$[\"s-sn\"] || childRenderNode.$elm$[\"name\"] || null;\n if (childRenderNode.$children$) {\n childRenderNode.$flags$ |= 2 /* isSlotFallback */;\n if (!childRenderNode.$elm$.childNodes.length) {\n childRenderNode.$children$.forEach((c) => {\n childRenderNode.$elm$.appendChild(c.$elm$);\n });\n }\n } else {\n childRenderNode.$flags$ |= 1 /* isSlotReference */;\n }\n }\n if (orgLocationNode && orgLocationNode.isConnected) {\n if (shadowRoot && orgLocationNode[\"s-en\"] === \"\") {\n orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);\n }\n orgLocationNode.parentNode.removeChild(orgLocationNode);\n if (!shadowRoot) {\n node[\"s-oo\"] = parseInt(childRenderNode.$nodeId$);\n }\n }\n plt.$orgLocNodes$.delete(orgLocationId);\n }\n const hosts = [];\n const snLen = slottedNodes.length;\n let snIndex = 0;\n let slotGroup;\n let snGroupIdx;\n let snGroupLen;\n let slottedItem;\n for (snIndex; snIndex < snLen; snIndex++) {\n slotGroup = slottedNodes[snIndex];\n if (!slotGroup || !slotGroup.length) continue;\n snGroupLen = slotGroup.length;\n snGroupIdx = 0;\n for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {\n slottedItem = slotGroup[snGroupIdx];\n if (!hosts[slottedItem.hostId]) {\n hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);\n }\n if (!hosts[slottedItem.hostId]) continue;\n const hostEle = hosts[slottedItem.hostId];\n if (!hostEle.shadowRoot || !shadowRoot) {\n slottedItem.slot[\"s-cr\"] = hostEle[\"s-cr\"];\n if (!slottedItem.slot[\"s-cr\"] && hostEle.shadowRoot) {\n slottedItem.slot[\"s-cr\"] = hostEle;\n } else {\n slottedItem.slot[\"s-cr\"] = (hostEle.__childNodes || hostEle.childNodes)[0];\n }\n addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node[\"s-oo\"]);\n if (BUILD12.experimentalSlotFixes) {\n patchSlottedNode(slottedItem.node);\n }\n }\n if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {\n hostEle.appendChild(slottedItem.node);\n }\n }\n }\n if (BUILD12.scoped && scopeId2 && slotNodes.length) {\n slotNodes.forEach((slot) => {\n slot.$elm$.parentElement.classList.add(scopeId2 + \"-s\");\n });\n }\n if (BUILD12.shadowDom && shadowRoot && !shadowRoot.childNodes.length) {\n let rnIdex = 0;\n const rnLen = shadowRootNodes.length;\n if (rnLen) {\n for (rnIdex; rnIdex < rnLen; rnIdex++) {\n shadowRoot.appendChild(shadowRootNodes[rnIdex]);\n }\n Array.from(hostElm.childNodes).forEach((node) => {\n if (typeof node[\"s-sn\"] !== \"string\") {\n if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {\n node.removeAttribute(\"hidden\");\n } else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {\n node.parentNode.removeChild(node);\n }\n }\n });\n }\n }\n plt.$orgLocNodes$.delete(hostElm[\"s-id\"]);\n hostRef.$hostElement$ = hostElm;\n endHydrate();\n};\nvar clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {\n let childNodeType;\n let childIdSplt;\n let childVNode;\n let i2;\n const scopeId2 = hostElm[\"s-sc\"];\n if (node.nodeType === 1 /* ElementNode */) {\n childNodeType = node.getAttribute(HYDRATE_CHILD_ID);\n if (childNodeType) {\n childIdSplt = childNodeType.split(\".\");\n if (childIdSplt[0] === hostId || childIdSplt[0] === \"0\") {\n childVNode = createSimpleVNode({\n $flags$: 0,\n $hostId$: childIdSplt[0],\n $nodeId$: childIdSplt[1],\n $depth$: childIdSplt[2],\n $index$: childIdSplt[3],\n $tag$: node.tagName.toLowerCase(),\n $elm$: node,\n // If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch\n // won't try to reconcile them. Classes set on the node will be blown away.\n $attrs$: { class: node.className || \"\" }\n });\n childRenderNodes.push(childVNode);\n node.removeAttribute(HYDRATE_CHILD_ID);\n if (!parentVNode.$children$) {\n parentVNode.$children$ = [];\n }\n if (BUILD12.scoped && scopeId2) {\n node[\"s-si\"] = scopeId2;\n childVNode.$attrs$.class += \" \" + scopeId2;\n }\n const slotName = childVNode.$elm$.getAttribute(\"s-sn\");\n if (typeof slotName === \"string\") {\n if (childVNode.$tag$ === \"slot-fb\") {\n addSlot(\n slotName,\n childIdSplt[2],\n childVNode,\n node,\n parentVNode,\n childRenderNodes,\n slotNodes,\n shadowRootNodes,\n slottedNodes\n );\n if (BUILD12.scoped && scopeId2) {\n node.classList.add(scopeId2);\n }\n }\n childVNode.$elm$[\"s-sn\"] = slotName;\n childVNode.$elm$.removeAttribute(\"s-sn\");\n }\n if (childVNode.$index$ !== void 0) {\n parentVNode.$children$[childVNode.$index$] = childVNode;\n }\n parentVNode = childVNode;\n if (shadowRootNodes && childVNode.$depth$ === \"0\") {\n shadowRootNodes[childVNode.$index$] = childVNode.$elm$;\n }\n }\n }\n if (node.shadowRoot) {\n for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {\n clientHydrate(\n parentVNode,\n childRenderNodes,\n slotNodes,\n shadowRootNodes,\n hostElm,\n node.shadowRoot.childNodes[i2],\n hostId,\n slottedNodes\n );\n }\n }\n const nonShadowNodes = node.__childNodes || node.childNodes;\n for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {\n clientHydrate(\n parentVNode,\n childRenderNodes,\n slotNodes,\n shadowRootNodes,\n hostElm,\n nonShadowNodes[i2],\n hostId,\n slottedNodes\n );\n }\n } else if (node.nodeType === 8 /* CommentNode */) {\n childIdSplt = node.nodeValue.split(\".\");\n if (childIdSplt[1] === hostId || childIdSplt[1] === \"0\") {\n childNodeType = childIdSplt[0];\n childVNode = createSimpleVNode({\n $hostId$: childIdSplt[1],\n $nodeId$: childIdSplt[2],\n $depth$: childIdSplt[3],\n $index$: childIdSplt[4] || \"0\",\n $elm$: node,\n $attrs$: null,\n $children$: null,\n $key$: null,\n $name$: null,\n $tag$: null,\n $text$: null\n });\n if (childNodeType === TEXT_NODE_ID) {\n childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);\n if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {\n childVNode.$text$ = childVNode.$elm$.textContent;\n childRenderNodes.push(childVNode);\n node.remove();\n if (hostId === childVNode.$hostId$) {\n if (!parentVNode.$children$) {\n parentVNode.$children$ = [];\n }\n parentVNode.$children$[childVNode.$index$] = childVNode;\n }\n if (shadowRootNodes && childVNode.$depth$ === \"0\") {\n shadowRootNodes[childVNode.$index$] = childVNode.$elm$;\n }\n }\n } else if (childNodeType === COMMENT_NODE_ID) {\n childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);\n if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {\n childRenderNodes.push(childVNode);\n node.remove();\n }\n } else if (childVNode.$hostId$ === hostId) {\n if (childNodeType === SLOT_NODE_ID) {\n const slotName = node[\"s-sn\"] = childIdSplt[5] || \"\";\n addSlot(\n slotName,\n childIdSplt[2],\n childVNode,\n node,\n parentVNode,\n childRenderNodes,\n slotNodes,\n shadowRootNodes,\n slottedNodes\n );\n } else if (childNodeType === CONTENT_REF_ID) {\n if (BUILD12.shadowDom && shadowRootNodes) {\n node.remove();\n } else if (BUILD12.slotRelocation) {\n hostElm[\"s-cr\"] = node;\n node[\"s-cn\"] = true;\n }\n }\n }\n }\n } else if (parentVNode && parentVNode.$tag$ === \"style\") {\n const vnode = newVNode(null, node.textContent);\n vnode.$elm$ = node;\n vnode.$index$ = \"0\";\n parentVNode.$children$ = [vnode];\n } else {\n if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {\n node.remove();\n }\n }\n return parentVNode;\n};\nvar initializeDocumentHydrate = (node, orgLocNodes) => {\n if (node.nodeType === 1 /* ElementNode */) {\n const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);\n if (componentId) {\n orgLocNodes.set(componentId, node);\n }\n let i2 = 0;\n if (node.shadowRoot) {\n for (; i2 < node.shadowRoot.childNodes.length; i2++) {\n initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);\n }\n }\n const nonShadowNodes = node.__childNodes || node.childNodes;\n for (i2 = 0; i2 < nonShadowNodes.length; i2++) {\n initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);\n }\n } else if (node.nodeType === 8 /* CommentNode */) {\n const childIdSplt = node.nodeValue.split(\".\");\n if (childIdSplt[0] === ORG_LOCATION_ID) {\n orgLocNodes.set(childIdSplt[1] + \".\" + childIdSplt[2], node);\n node.nodeValue = \"\";\n node[\"s-en\"] = childIdSplt[3];\n }\n }\n};\nvar createSimpleVNode = (vnode) => {\n const defaultVNode = {\n $flags$: 0,\n $hostId$: null,\n $nodeId$: null,\n $depth$: null,\n $index$: \"0\",\n $elm$: null,\n $attrs$: null,\n $children$: null,\n $key$: null,\n $name$: null,\n $tag$: null,\n $text$: null\n };\n return { ...defaultVNode, ...vnode };\n};\nfunction addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {\n node[\"s-sr\"] = true;\n childVNode.$name$ = slotName || null;\n childVNode.$tag$ = \"slot\";\n const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$[\"s-id\"] || parentVNode.$elm$.getAttribute(\"s-id\") : \"\";\n if (BUILD12.shadowDom && shadowRootNodes && win.document) {\n const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);\n if (childVNode.$name$) {\n childVNode.$elm$.setAttribute(\"name\", slotName);\n }\n if (parentNodeId && parentNodeId !== childVNode.$hostId$) {\n parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);\n } else {\n node.parentNode.insertBefore(childVNode.$elm$, node);\n }\n addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);\n node.remove();\n if (childVNode.$depth$ === \"0\") {\n shadowRootNodes[childVNode.$index$] = childVNode.$elm$;\n }\n } else {\n const slot = childVNode.$elm$;\n const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;\n addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);\n patchSlotNode(node);\n if (shouldMove) {\n parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);\n }\n childRenderNodes.push(childVNode);\n }\n slotNodes.push(childVNode);\n if (!parentVNode.$children$) {\n parentVNode.$children$ = [];\n }\n parentVNode.$children$[childVNode.$index$] = childVNode;\n}\nvar addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {\n let slottedNode = slotNode.nextSibling;\n slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];\n while (slottedNode && ((slottedNode[\"getAttribute\"] && slottedNode.getAttribute(\"slot\") || slottedNode[\"s-sn\"]) === slotName || slotName === \"\" && !slottedNode[\"s-sn\"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(\".\") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {\n slottedNode[\"s-sn\"] = slotName;\n slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });\n slottedNode = slottedNode.nextSibling;\n }\n};\nvar findCorrespondingNode = (node, type) => {\n let sibling = node;\n do {\n sibling = sibling.nextSibling;\n } while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));\n return sibling;\n};\n\n// src/runtime/initialize-component.ts\nimport { BUILD as BUILD23 } from \"@stencil/core/internal/app-data\";\n\n// src/utils/shadow-css.ts\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n *\n * This file is a port of shadowCSS from `webcomponents.js` to TypeScript.\n * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js\n * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts\n */\nvar safeSelector = (selector) => {\n const placeholders = [];\n let index = 0;\n selector = selector.replace(/(\\[[^\\]]*\\])/g, (_, keep) => {\n const replaceBy = `__ph-${index}__`;\n placeholders.push(keep);\n index++;\n return replaceBy;\n });\n const content = selector.replace(/(:nth-[-\\w]+)(\\([^)]+\\))/g, (_, pseudo, exp) => {\n const replaceBy = `__ph-${index}__`;\n placeholders.push(exp);\n index++;\n return pseudo + replaceBy;\n });\n const ss = {\n content,\n placeholders\n };\n return ss;\n};\nvar restoreSafeSelector = (placeholders, content) => {\n return content.replace(/__ph-(\\d+)__/g, (_, index) => placeholders[+index]);\n};\nvar _polyfillHost = \"-shadowcsshost\";\nvar _polyfillSlotted = \"-shadowcssslotted\";\nvar _polyfillHostContext = \"-shadowcsscontext\";\nvar _parenSuffix = \")(?:\\\\(((?:\\\\([^)(]*\\\\)|[^)(]*)+?)\\\\))?([^,{]*)\";\nvar _cssColonHostRe = new RegExp(\"(\" + _polyfillHost + _parenSuffix, \"gim\");\nvar _cssColonHostContextRe = new RegExp(\"(\" + _polyfillHostContext + _parenSuffix, \"gim\");\nvar _cssColonSlottedRe = new RegExp(\"(\" + _polyfillSlotted + _parenSuffix, \"gim\");\nvar _polyfillHostNoCombinator = _polyfillHost + \"-no-combinator\";\nvar _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\\s]*)/;\nvar _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];\nvar _selectorReSuffix = \"([>\\\\s~+[.,{:][\\\\s\\\\S]*)?$\";\nvar _polyfillHostRe = /-shadowcsshost/gim;\nvar createSupportsRuleRe = (selector) => new RegExp(`((?<!(^@supports(.*)))|(?<={.*))(${selector}\\\\b)`, \"gim\");\nvar _colonSlottedRe = createSupportsRuleRe(\"::slotted\");\nvar _colonHostRe = createSupportsRuleRe(\":host\");\nvar _colonHostContextRe = createSupportsRuleRe(\":host-context\");\nvar _commentRe = /\\/\\*\\s*[\\s\\S]*?\\*\\//g;\nvar stripComments = (input) => {\n return input.replace(_commentRe, \"\");\n};\nvar _commentWithHashRe = /\\/\\*\\s*#\\s*source(Mapping)?URL=[\\s\\S]+?\\*\\//g;\nvar extractCommentsWithHash = (input) => {\n return input.match(_commentWithHashRe) || [];\n};\nvar _ruleRe = /(\\s*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))/g;\nvar _curlyRe = /([{}])/g;\nvar _selectorPartsRe = /(^.*?[^\\\\])??((:+)(.*)|$)/;\nvar OPEN_CURLY = \"{\";\nvar CLOSE_CURLY = \"}\";\nvar BLOCK_PLACEHOLDER = \"%BLOCK%\";\nvar processRules = (input, ruleCallback) => {\n const inputWithEscapedBlocks = escapeBlocks(input);\n let nextBlockIndex = 0;\n return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {\n const selector = m[2];\n let content = \"\";\n let suffix = m[4];\n let contentPrefix = \"\";\n if (suffix && suffix.startsWith(\"{\" + BLOCK_PLACEHOLDER)) {\n content = inputWithEscapedBlocks.blocks[nextBlockIndex++];\n suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);\n contentPrefix = \"{\";\n }\n const cssRule = {\n selector,\n content\n };\n const rule = ruleCallback(cssRule);\n return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;\n });\n};\nvar escapeBlocks = (input) => {\n const inputParts = input.split(_curlyRe);\n const resultParts = [];\n const escapedBlocks = [];\n let bracketCount = 0;\n let currentBlockParts = [];\n for (let partIndex = 0; partIndex < inputParts.length; partIndex++) {\n const part = inputParts[partIndex];\n if (part === CLOSE_CURLY) {\n bracketCount--;\n }\n if (bracketCount > 0) {\n currentBlockParts.push(part);\n } else {\n if (currentBlockParts.length > 0) {\n escapedBlocks.push(currentBlockParts.join(\"\"));\n resultParts.push(BLOCK_PLACEHOLDER);\n currentBlockParts = [];\n }\n resultParts.push(part);\n }\n if (part === OPEN_CURLY) {\n bracketCount++;\n }\n }\n if (currentBlockParts.length > 0) {\n escapedBlocks.push(currentBlockParts.join(\"\"));\n resultParts.push(BLOCK_PLACEHOLDER);\n }\n const strEscapedBlocks = {\n escapedString: resultParts.join(\"\"),\n blocks: escapedBlocks\n };\n return strEscapedBlocks;\n};\nvar insertPolyfillHostInCssText = (cssText) => {\n cssText = cssText.replace(_colonHostContextRe, `$1${_polyfillHostContext}`).replace(_colonHostRe, `$1${_polyfillHost}`).replace(_colonSlottedRe, `$1${_polyfillSlotted}`);\n return cssText;\n};\nvar convertColonRule = (cssText, regExp, partReplacer) => {\n return cssText.replace(regExp, (...m) => {\n if (m[2]) {\n const parts = m[2].split(\",\");\n const r = [];\n for (let i2 = 0; i2 < parts.length; i2++) {\n const p = parts[i2].trim();\n if (!p) break;\n r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));\n }\n return r.join(\",\");\n } else {\n return _polyfillHostNoCombinator + m[3];\n }\n });\n};\nvar colonHostPartReplacer = (host, part, suffix) => {\n return host + part.replace(_polyfillHost, \"\") + suffix;\n};\nvar convertColonHost = (cssText) => {\n return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer);\n};\nvar colonHostContextPartReplacer = (host, part, suffix) => {\n if (part.indexOf(_polyfillHost) > -1) {\n return colonHostPartReplacer(host, part, suffix);\n } else {\n return host + part + suffix + \", \" + part + \" \" + host + suffix;\n }\n};\nvar convertColonSlotted = (cssText, slotScopeId) => {\n const slotClass = \".\" + slotScopeId + \" > \";\n const selectors = [];\n cssText = cssText.replace(_cssColonSlottedRe, (...m) => {\n if (m[2]) {\n const compound = m[2].trim();\n const suffix = m[3];\n const slottedSelector = slotClass + compound + suffix;\n let prefixSelector = \"\";\n for (let i2 = m[4] - 1; i2 >= 0; i2--) {\n const char = m[5][i2];\n if (char === \"}\" || char === \",\") {\n break;\n }\n prefixSelector = char + prefixSelector;\n }\n const orgSelector = (prefixSelector + slottedSelector).trim();\n const addedSelector = `${prefixSelector.trimEnd()}${slottedSelector.trim()}`.trim();\n if (orgSelector !== addedSelector) {\n const updatedSelector = `${addedSelector}, ${orgSelector}`;\n selectors.push({\n orgSelector,\n updatedSelector\n });\n }\n return slottedSelector;\n } else {\n return _polyfillHostNoCombinator + m[3];\n }\n });\n return {\n selectors,\n cssText\n };\n};\nvar convertColonHostContext = (cssText) => {\n return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer);\n};\nvar convertShadowDOMSelectors = (cssText) => {\n return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, \" \"), cssText);\n};\nvar makeScopeMatcher = (scopeSelector2) => {\n const lre = /\\[/g;\n const rre = /\\]/g;\n scopeSelector2 = scopeSelector2.replace(lre, \"\\\\[\").replace(rre, \"\\\\]\");\n return new RegExp(\"^(\" + scopeSelector2 + \")\" + _selectorReSuffix, \"m\");\n};\nvar selectorNeedsScoping = (selector, scopeSelector2) => {\n const re = makeScopeMatcher(scopeSelector2);\n return !re.test(selector);\n};\nvar injectScopingSelector = (selector, scopingSelector) => {\n return selector.replace(_selectorPartsRe, (_, before = \"\", _colonGroup, colon = \"\", after = \"\") => {\n return before + scopingSelector + colon + after;\n });\n};\nvar applySimpleSelectorScope = (selector, scopeSelector2, hostSelector) => {\n _polyfillHostRe.lastIndex = 0;\n if (_polyfillHostRe.test(selector)) {\n const replaceBy = `.${hostSelector}`;\n return selector.replace(_polyfillHostNoCombinatorRe, (_, selector2) => injectScopingSelector(selector2, replaceBy)).replace(_polyfillHostRe, replaceBy + \" \");\n }\n return scopeSelector2 + \" \" + selector;\n};\nvar applyStrictSelectorScope = (selector, scopeSelector2, hostSelector) => {\n const isRe = /\\[is=([^\\]]*)\\]/g;\n scopeSelector2 = scopeSelector2.replace(isRe, (_, ...parts) => parts[0]);\n const className = \".\" + scopeSelector2;\n const _scopeSelectorPart = (p) => {\n let scopedP = p.trim();\n if (!scopedP) {\n return \"\";\n }\n if (p.indexOf(_polyfillHostNoCombinator) > -1) {\n scopedP = applySimpleSelectorScope(p, scopeSelector2, hostSelector);\n } else {\n const t = p.replace(_polyfillHostRe, \"\");\n if (t.length > 0) {\n scopedP = injectScopingSelector(t, className);\n }\n }\n return scopedP;\n };\n const safeContent = safeSelector(selector);\n selector = safeContent.content;\n let scopedSelector = \"\";\n let startIndex = 0;\n let res;\n const sep = /( |>|\\+|~(?!=))\\s*/g;\n const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;\n let shouldScope = !hasHost;\n while ((res = sep.exec(selector)) !== null) {\n const separator = res[1];\n const part2 = selector.slice(startIndex, res.index).trim();\n shouldScope = shouldScope || part2.indexOf(_polyfillHostNoCombinator) > -1;\n const scopedPart = shouldScope ? _scopeSelectorPart(part2) : part2;\n scopedSelector += `${scopedPart} ${separator} `;\n startIndex = sep.lastIndex;\n }\n const part = selector.substring(startIndex);\n shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;\n scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;\n return restoreSafeSelector(safeContent.placeholders, scopedSelector);\n};\nvar scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => {\n return selector.split(\",\").map((shallowPart) => {\n if (slotSelector && shallowPart.indexOf(\".\" + slotSelector) > -1) {\n return shallowPart.trim();\n }\n if (selectorNeedsScoping(shallowPart, scopeSelectorText)) {\n return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim();\n } else {\n return shallowPart.trim();\n }\n }).join(\", \");\n};\nvar scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {\n return processRules(cssText, (rule) => {\n let selector = rule.selector;\n let content = rule.content;\n if (rule.selector[0] !== \"@\") {\n selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);\n } else if (rule.selector.startsWith(\"@media\") || rule.selector.startsWith(\"@supports\") || rule.selector.startsWith(\"@page\") || rule.selector.startsWith(\"@document\")) {\n content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector);\n }\n const cssRule = {\n selector: selector.replace(/\\s{2,}/g, \" \").trim(),\n content\n };\n return cssRule;\n });\n};\nvar scopeCssText = (cssText, scopeId2, hostScopeId, slotScopeId, commentOriginalSelector) => {\n cssText = insertPolyfillHostInCssText(cssText);\n cssText = convertColonHost(cssText);\n cssText = convertColonHostContext(cssText);\n const slotted = convertColonSlotted(cssText, slotScopeId);\n cssText = slotted.cssText;\n cssText = convertShadowDOMSelectors(cssText);\n if (scopeId2) {\n cssText = scopeSelectors(cssText, scopeId2, hostScopeId, slotScopeId, commentOriginalSelector);\n }\n cssText = replaceShadowCssHost(cssText, hostScopeId);\n cssText = cssText.replace(/>\\s*\\*\\s+([^{, ]+)/gm, \" $1 \");\n return {\n cssText: cssText.trim(),\n // We need to replace the shadow CSS host string in each of these selectors since we created\n // them prior to the replacement happening in the components CSS text.\n slottedSelectors: slotted.selectors.map((ref) => ({\n orgSelector: replaceShadowCssHost(ref.orgSelector, hostScopeId),\n updatedSelector: replaceShadowCssHost(ref.updatedSelector, hostScopeId)\n }))\n };\n};\nvar replaceShadowCssHost = (cssText, hostScopeId) => {\n return cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);\n};\nvar scopeCss = (cssText, scopeId2, commentOriginalSelector) => {\n const hostScopeId = scopeId2 + \"-h\";\n const slotScopeId = scopeId2 + \"-s\";\n const commentsWithHash = extractCommentsWithHash(cssText);\n cssText = stripComments(cssText);\n const orgSelectors = [];\n if (commentOriginalSelector) {\n const processCommentedSelector = (rule) => {\n const placeholder = `/*!@___${orgSelectors.length}___*/`;\n const comment = `/*!@${rule.selector}*/`;\n orgSelectors.push({ placeholder, comment });\n rule.selector = placeholder + rule.selector;\n return rule;\n };\n cssText = processRules(cssText, (rule) => {\n if (rule.selector[0] !== \"@\") {\n return processCommentedSelector(rule);\n } else if (rule.selector.startsWith(\"@media\") || rule.selector.startsWith(\"@supports\") || rule.selector.startsWith(\"@page\") || rule.selector.startsWith(\"@document\")) {\n rule.content = processRules(rule.content, processCommentedSelector);\n return rule;\n }\n return rule;\n });\n }\n const scoped = scopeCssText(cssText, scopeId2, hostScopeId, slotScopeId, commentOriginalSelector);\n cssText = [scoped.cssText, ...commentsWithHash].join(\"\\n\");\n if (commentOriginalSelector) {\n orgSelectors.forEach(({ placeholder, comment }) => {\n cssText = cssText.replace(placeholder, comment);\n });\n }\n scoped.slottedSelectors.forEach((slottedSelector) => {\n const regex = new RegExp(escapeRegExpSpecialCharacters(slottedSelector.orgSelector), \"g\");\n cssText = cssText.replace(regex, slottedSelector.updatedSelector);\n });\n return cssText;\n};\n\n// src/runtime/mode.ts\nvar computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);\nvar setMode = (handler) => modeResolutionChain.push(handler);\nvar getMode = (ref) => getHostRef(ref).$modeName$;\n\n// src/runtime/proxy-component.ts\nimport { BUILD as BUILD22 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/set-value.ts\nimport { BUILD as BUILD21 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/parse-property-value.ts\nimport { BUILD as BUILD13 } from \"@stencil/core/internal/app-data\";\nvar parsePropertyValue = (propValue, propType) => {\n if (propValue != null && !isComplexType(propValue)) {\n if (BUILD13.propBoolean && propType & 4 /* Boolean */) {\n return propValue === \"false\" ? false : propValue === \"\" || !!propValue;\n }\n if (BUILD13.propNumber && propType & 2 /* Number */) {\n return parseFloat(propValue);\n }\n if (BUILD13.propString && propType & 1 /* String */) {\n return String(propValue);\n }\n return propValue;\n }\n return propValue;\n};\n\n// src/runtime/update-component.ts\nimport { BUILD as BUILD20, NAMESPACE } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/event-emitter.ts\nimport { BUILD as BUILD15 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/element.ts\nimport { BUILD as BUILD14 } from \"@stencil/core/internal/app-data\";\nvar getElement = (ref) => BUILD14.lazyLoad ? getHostRef(ref).$hostElement$ : ref;\n\n// src/runtime/event-emitter.ts\nvar createEvent = (ref, name, flags) => {\n const elm = getElement(ref);\n return {\n emit: (detail) => {\n if (BUILD15.isDev && !elm.isConnected) {\n consoleDevWarn(`The \"${name}\" event was emitted, but the dispatcher node is no longer connected to the dom.`);\n }\n return emitEvent(elm, name, {\n bubbles: !!(flags & 4 /* Bubbles */),\n composed: !!(flags & 2 /* Composed */),\n cancelable: !!(flags & 1 /* Cancellable */),\n detail\n });\n }\n };\n};\nvar emitEvent = (elm, name, opts) => {\n const ev = plt.ce(name, opts);\n elm.dispatchEvent(ev);\n return ev;\n};\n\n// src/runtime/styles.ts\nimport { BUILD as BUILD16 } from \"@stencil/core/internal/app-data\";\nvar rootAppliedStyles = /* @__PURE__ */ new WeakMap();\nvar registerStyle = (scopeId2, cssText, allowCS) => {\n let style = styles.get(scopeId2);\n if (supportsConstructableStylesheets && allowCS) {\n style = style || new CSSStyleSheet();\n if (typeof style === \"string\") {\n style = cssText;\n } else {\n style.replaceSync(cssText);\n }\n } else {\n style = cssText;\n }\n styles.set(scopeId2, style);\n};\nvar addStyle = (styleContainerNode, cmpMeta, mode) => {\n var _a;\n const scopeId2 = getScopeId(cmpMeta, mode);\n const style = styles.get(scopeId2);\n if (!BUILD16.attachStyles || !win.document) {\n return scopeId2;\n }\n styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;\n if (style) {\n if (typeof style === \"string\") {\n styleContainerNode = styleContainerNode.head || styleContainerNode;\n let appliedStyles = rootAppliedStyles.get(styleContainerNode);\n let styleElm;\n if (!appliedStyles) {\n rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());\n }\n if (!appliedStyles.has(scopeId2)) {\n if (BUILD16.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}=\"${scopeId2}\"]`))) {\n styleElm.innerHTML = style;\n } else {\n styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}=\"${scopeId2}\"]`) || win.document.createElement(\"style\");\n styleElm.innerHTML = style;\n const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);\n if (nonce != null) {\n styleElm.setAttribute(\"nonce\", nonce);\n }\n if ((BUILD16.hydrateServerSide || BUILD16.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {\n styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);\n }\n if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {\n if (styleContainerNode.nodeName === \"HEAD\") {\n const preconnectLinks = styleContainerNode.querySelectorAll(\"link[rel=preconnect]\");\n const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector(\"style\");\n styleContainerNode.insertBefore(\n styleElm,\n (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null\n );\n } else if (\"host\" in styleContainerNode) {\n if (supportsConstructableStylesheets) {\n const stylesheet = new CSSStyleSheet();\n stylesheet.replaceSync(style);\n styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];\n } else {\n const existingStyleContainer = styleContainerNode.querySelector(\"style\");\n if (existingStyleContainer) {\n existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;\n } else {\n styleContainerNode.prepend(styleElm);\n }\n }\n } else {\n styleContainerNode.append(styleElm);\n }\n }\n if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {\n styleContainerNode.insertBefore(styleElm, null);\n }\n }\n if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {\n styleElm.innerHTML += SLOT_FB_CSS;\n }\n if (appliedStyles) {\n appliedStyles.add(scopeId2);\n }\n }\n } else if (BUILD16.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {\n styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];\n }\n }\n return scopeId2;\n};\nvar attachStyles = (hostRef) => {\n const cmpMeta = hostRef.$cmpMeta$;\n const elm = hostRef.$hostElement$;\n const flags = cmpMeta.$flags$;\n const endAttachStyles = createTime(\"attachStyles\", cmpMeta.$tagName$);\n const scopeId2 = addStyle(\n BUILD16.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),\n cmpMeta,\n hostRef.$modeName$\n );\n if ((BUILD16.shadowDom || BUILD16.scoped) && BUILD16.cssAnnotations && (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */ || flags & 128 /* shadowNeedsScopedCss */)) {\n elm[\"s-sc\"] = scopeId2;\n elm.classList.add(scopeId2 + \"-h\");\n }\n endAttachStyles();\n};\nvar getScopeId = (cmp, mode) => \"sc-\" + (BUILD16.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + \"-\" + mode : cmp.$tagName$);\nvar convertScopedToShadow = (css) => css.replace(/\\/\\*!@([^\\/]+)\\*\\/[^\\{]+\\{/g, \"$1{\");\nvar hydrateScopedToShadow = () => {\n if (!win.document) {\n return;\n }\n const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);\n let i2 = 0;\n for (; i2 < styles2.length; i2++) {\n registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);\n }\n};\n\n// src/runtime/vdom/vdom-render.ts\nimport { BUILD as BUILD19 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/vdom/update-element.ts\nimport { BUILD as BUILD18 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/vdom/set-accessor.ts\nimport { BUILD as BUILD17 } from \"@stencil/core/internal/app-data\";\nvar setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {\n if (oldValue === newValue) {\n return;\n }\n let isProp = isMemberInElement(elm, memberName);\n let ln = memberName.toLowerCase();\n if (BUILD17.vdomClass && memberName === \"class\") {\n const classList = elm.classList;\n const oldClasses = parseClassList(oldValue);\n let newClasses = parseClassList(newValue);\n if (BUILD17.hydrateClientSide && elm[\"s-si\"] && initialRender) {\n newClasses.push(elm[\"s-si\"]);\n oldClasses.forEach((c) => {\n if (c.startsWith(elm[\"s-si\"])) newClasses.push(c);\n });\n newClasses = [...new Set(newClasses)];\n classList.add(...newClasses);\n } else {\n classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));\n classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));\n }\n } else if (BUILD17.vdomStyle && memberName === \"style\") {\n if (BUILD17.updatable) {\n for (const prop in oldValue) {\n if (!newValue || newValue[prop] == null) {\n if (!BUILD17.hydrateServerSide && prop.includes(\"-\")) {\n elm.style.removeProperty(prop);\n } else {\n elm.style[prop] = \"\";\n }\n }\n }\n }\n for (const prop in newValue) {\n if (!oldValue || newValue[prop] !== oldValue[prop]) {\n if (!BUILD17.hydrateServerSide && prop.includes(\"-\")) {\n elm.style.setProperty(prop, newValue[prop]);\n } else {\n elm.style[prop] = newValue[prop];\n }\n }\n }\n } else if (BUILD17.vdomKey && memberName === \"key\") {\n } else if (BUILD17.vdomRef && memberName === \"ref\") {\n if (newValue) {\n newValue(elm);\n }\n } else if (BUILD17.vdomListener && (BUILD17.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === \"o\" && memberName[1] === \"n\") {\n if (memberName[2] === \"-\") {\n memberName = memberName.slice(3);\n } else if (isMemberInElement(win, ln)) {\n memberName = ln.slice(2);\n } else {\n memberName = ln[2] + memberName.slice(3);\n }\n if (oldValue || newValue) {\n const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);\n memberName = memberName.replace(CAPTURE_EVENT_REGEX, \"\");\n if (oldValue) {\n plt.rel(elm, memberName, oldValue, capture);\n }\n if (newValue) {\n plt.ael(elm, memberName, newValue, capture);\n }\n }\n } else if (BUILD17.vdomPropOrAttr) {\n const isComplex = isComplexType(newValue);\n if ((isProp || isComplex && newValue !== null) && !isSvg) {\n try {\n if (!elm.tagName.includes(\"-\")) {\n const n = newValue == null ? \"\" : newValue;\n if (memberName === \"list\") {\n isProp = false;\n } else if (oldValue == null || elm[memberName] != n) {\n if (typeof elm.__lookupSetter__(memberName) === \"function\") {\n elm[memberName] = n;\n } else {\n elm.setAttribute(memberName, n);\n }\n }\n } else if (elm[memberName] !== newValue) {\n elm[memberName] = newValue;\n }\n } catch (e) {\n }\n }\n let xlink = false;\n if (BUILD17.vdomXlink) {\n if (ln !== (ln = ln.replace(/^xlink\\:?/, \"\"))) {\n memberName = ln;\n xlink = true;\n }\n }\n if (newValue == null || newValue === false) {\n if (newValue !== false || elm.getAttribute(memberName) === \"\") {\n if (BUILD17.vdomXlink && xlink) {\n elm.removeAttributeNS(XLINK_NS, memberName);\n } else {\n elm.removeAttribute(memberName);\n }\n }\n } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {\n newValue = newValue === true ? \"\" : newValue;\n if (BUILD17.vdomXlink && xlink) {\n elm.setAttributeNS(XLINK_NS, memberName, newValue);\n } else {\n elm.setAttribute(memberName, newValue);\n }\n }\n }\n};\nvar parseClassListRegex = /\\s/;\nvar parseClassList = (value) => {\n if (typeof value === \"object\" && value && \"baseVal\" in value) {\n value = value.baseVal;\n }\n if (!value || typeof value !== \"string\") {\n return [];\n }\n return value.split(parseClassListRegex);\n};\nvar CAPTURE_EVENT_SUFFIX = \"Capture\";\nvar CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + \"$\");\n\n// src/runtime/vdom/update-element.ts\nvar updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {\n const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;\n const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};\n const newVnodeAttrs = newVnode.$attrs$ || {};\n if (BUILD18.updatable) {\n for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {\n if (!(memberName in newVnodeAttrs)) {\n setAccessor(\n elm,\n memberName,\n oldVnodeAttrs[memberName],\n void 0,\n isSvgMode2,\n newVnode.$flags$,\n isInitialRender\n );\n }\n }\n }\n for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {\n setAccessor(\n elm,\n memberName,\n oldVnodeAttrs[memberName],\n newVnodeAttrs[memberName],\n isSvgMode2,\n newVnode.$flags$,\n isInitialRender\n );\n }\n};\nfunction sortedAttrNames(attrNames) {\n return attrNames.includes(\"ref\") ? (\n // we need to sort these to ensure that `'ref'` is the last attr\n [...attrNames.filter((attr) => attr !== \"ref\"), \"ref\"]\n ) : (\n // no need to sort, return the original array\n attrNames\n );\n}\n\n// src/runtime/vdom/vdom-render.ts\nvar scopeId;\nvar contentRef;\nvar hostTagName;\nvar useNativeShadowDom = false;\nvar checkSlotFallbackVisibility = false;\nvar checkSlotRelocate = false;\nvar isSvgMode = false;\nvar createElm = (oldParentVNode, newParentVNode, childIndex) => {\n var _a;\n const newVNode2 = newParentVNode.$children$[childIndex];\n let i2 = 0;\n let elm;\n let childNode;\n let oldVNode;\n if (BUILD19.slotRelocation && !useNativeShadowDom) {\n checkSlotRelocate = true;\n if (newVNode2.$tag$ === \"slot\") {\n newVNode2.$flags$ |= newVNode2.$children$ ? (\n // slot element has fallback content\n // still create an element that \"mocks\" the slot element\n 2 /* isSlotFallback */\n ) : (\n // slot element does not have fallback content\n // create an html comment we'll use to always reference\n // where actual slot content should sit next to\n 1 /* isSlotReference */\n );\n }\n }\n if (BUILD19.isDev && newVNode2.$elm$) {\n consoleDevError(\n `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`\n );\n }\n if (BUILD19.vdomText && newVNode2.$text$ !== null) {\n elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);\n } else if (BUILD19.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {\n elm = newVNode2.$elm$ = BUILD19.isDebug || BUILD19.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : win.document.createTextNode(\"\");\n if (BUILD19.vdomAttribute) {\n updateElement(null, newVNode2, isSvgMode);\n }\n } else {\n if (BUILD19.svg && !isSvgMode) {\n isSvgMode = newVNode2.$tag$ === \"svg\";\n }\n if (!win.document) {\n throw new Error(\n \"You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.\"\n );\n }\n elm = newVNode2.$elm$ = BUILD19.svg ? win.document.createElementNS(\n isSvgMode ? SVG_NS : HTML_NS,\n !useNativeShadowDom && BUILD19.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? \"slot-fb\" : newVNode2.$tag$\n ) : win.document.createElement(\n !useNativeShadowDom && BUILD19.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? \"slot-fb\" : newVNode2.$tag$\n );\n if (BUILD19.svg && isSvgMode && newVNode2.$tag$ === \"foreignObject\") {\n isSvgMode = false;\n }\n if (BUILD19.vdomAttribute) {\n updateElement(null, newVNode2, isSvgMode);\n }\n if (BUILD19.scoped && isDef(scopeId) && elm[\"s-si\"] !== scopeId) {\n elm.classList.add(elm[\"s-si\"] = scopeId);\n }\n if (newVNode2.$children$) {\n for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {\n childNode = createElm(oldParentVNode, newVNode2, i2);\n if (childNode) {\n elm.appendChild(childNode);\n }\n }\n }\n if (BUILD19.svg) {\n if (newVNode2.$tag$ === \"svg\") {\n isSvgMode = false;\n } else if (elm.tagName === \"foreignObject\") {\n isSvgMode = true;\n }\n }\n }\n elm[\"s-hn\"] = hostTagName;\n if (BUILD19.slotRelocation) {\n if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {\n elm[\"s-sr\"] = true;\n elm[\"s-cr\"] = contentRef;\n elm[\"s-sn\"] = newVNode2.$name$ || \"\";\n elm[\"s-rf\"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;\n patchSlotNode(elm);\n oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];\n if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {\n if (BUILD19.experimentalSlotFixes) {\n relocateToHostRoot(oldParentVNode.$elm$);\n } else {\n putBackInOriginalLocation(oldParentVNode.$elm$, false);\n }\n }\n if (BUILD19.scoped) {\n addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);\n }\n }\n }\n return elm;\n};\nvar relocateToHostRoot = (parentElm) => {\n plt.$flags$ |= 1 /* isTmpDisconnected */;\n const host = parentElm.closest(hostTagName.toLowerCase());\n if (host != null) {\n const contentRefNode = Array.from(host.__childNodes || host.childNodes).find(\n (ref) => ref[\"s-cr\"]\n );\n const childNodeArray = Array.from(\n parentElm.__childNodes || parentElm.childNodes\n );\n for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {\n if (childNode[\"s-sh\"] != null) {\n insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null);\n childNode[\"s-sh\"] = void 0;\n checkSlotRelocate = true;\n }\n }\n }\n plt.$flags$ &= ~1 /* isTmpDisconnected */;\n};\nvar putBackInOriginalLocation = (parentElm, recursive) => {\n plt.$flags$ |= 1 /* isTmpDisconnected */;\n const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);\n if (parentElm[\"s-sr\"] && BUILD19.experimentalSlotFixes) {\n let node = parentElm;\n while (node = node.nextSibling) {\n if (node && node[\"s-sn\"] === parentElm[\"s-sn\"] && node[\"s-sh\"] === hostTagName) {\n oldSlotChildNodes.push(node);\n }\n }\n }\n for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {\n const childNode = oldSlotChildNodes[i2];\n if (childNode[\"s-hn\"] !== hostTagName && childNode[\"s-ol\"]) {\n insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));\n childNode[\"s-ol\"].remove();\n childNode[\"s-ol\"] = void 0;\n childNode[\"s-sh\"] = void 0;\n checkSlotRelocate = true;\n }\n if (recursive) {\n putBackInOriginalLocation(childNode, recursive);\n }\n }\n plt.$flags$ &= ~1 /* isTmpDisconnected */;\n};\nvar addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {\n let containerElm = BUILD19.slotRelocation && parentElm[\"s-cr\"] && parentElm[\"s-cr\"].parentNode || parentElm;\n let childNode;\n if (BUILD19.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {\n containerElm = containerElm.shadowRoot;\n }\n for (; startIdx <= endIdx; ++startIdx) {\n if (vnodes[startIdx]) {\n childNode = createElm(null, parentVNode, startIdx);\n if (childNode) {\n vnodes[startIdx].$elm$ = childNode;\n insertBefore(containerElm, childNode, BUILD19.slotRelocation ? referenceNode(before) : before);\n }\n }\n }\n};\nvar removeVnodes = (vnodes, startIdx, endIdx) => {\n for (let index = startIdx; index <= endIdx; ++index) {\n const vnode = vnodes[index];\n if (vnode) {\n const elm = vnode.$elm$;\n nullifyVNodeRefs(vnode);\n if (elm) {\n if (BUILD19.slotRelocation) {\n checkSlotFallbackVisibility = true;\n if (elm[\"s-ol\"]) {\n elm[\"s-ol\"].remove();\n } else {\n putBackInOriginalLocation(elm, true);\n }\n }\n elm.remove();\n }\n }\n }\n};\nvar updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {\n let oldStartIdx = 0;\n let newStartIdx = 0;\n let idxInOld = 0;\n let i2 = 0;\n let oldEndIdx = oldCh.length - 1;\n let oldStartVnode = oldCh[0];\n let oldEndVnode = oldCh[oldEndIdx];\n let newEndIdx = newCh.length - 1;\n let newStartVnode = newCh[0];\n let newEndVnode = newCh[newEndIdx];\n let node;\n let elmToMove;\n while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n if (oldStartVnode == null) {\n oldStartVnode = oldCh[++oldStartIdx];\n } else if (oldEndVnode == null) {\n oldEndVnode = oldCh[--oldEndIdx];\n } else if (newStartVnode == null) {\n newStartVnode = newCh[++newStartIdx];\n } else if (newEndVnode == null) {\n newEndVnode = newCh[--newEndIdx];\n } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {\n patch(oldStartVnode, newStartVnode, isInitialRender);\n oldStartVnode = oldCh[++oldStartIdx];\n newStartVnode = newCh[++newStartIdx];\n } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {\n patch(oldEndVnode, newEndVnode, isInitialRender);\n oldEndVnode = oldCh[--oldEndIdx];\n newEndVnode = newCh[--newEndIdx];\n } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {\n if (BUILD19.slotRelocation && (oldStartVnode.$tag$ === \"slot\" || newEndVnode.$tag$ === \"slot\")) {\n putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);\n }\n patch(oldStartVnode, newEndVnode, isInitialRender);\n insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);\n oldStartVnode = oldCh[++oldStartIdx];\n newEndVnode = newCh[--newEndIdx];\n } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {\n if (BUILD19.slotRelocation && (oldStartVnode.$tag$ === \"slot\" || newEndVnode.$tag$ === \"slot\")) {\n putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);\n }\n patch(oldEndVnode, newStartVnode, isInitialRender);\n insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);\n oldEndVnode = oldCh[--oldEndIdx];\n newStartVnode = newCh[++newStartIdx];\n } else {\n idxInOld = -1;\n if (BUILD19.vdomKey) {\n for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {\n if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {\n idxInOld = i2;\n break;\n }\n }\n }\n if (BUILD19.vdomKey && idxInOld >= 0) {\n elmToMove = oldCh[idxInOld];\n if (elmToMove.$tag$ !== newStartVnode.$tag$) {\n node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);\n } else {\n patch(elmToMove, newStartVnode, isInitialRender);\n oldCh[idxInOld] = void 0;\n node = elmToMove.$elm$;\n }\n newStartVnode = newCh[++newStartIdx];\n } else {\n node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);\n newStartVnode = newCh[++newStartIdx];\n }\n if (node) {\n if (BUILD19.slotRelocation) {\n insertBefore(\n referenceNode(oldStartVnode.$elm$).parentNode,\n node,\n referenceNode(oldStartVnode.$elm$)\n );\n } else {\n insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);\n }\n }\n }\n }\n if (oldStartIdx > oldEndIdx) {\n addVnodes(\n parentElm,\n newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,\n newVNode2,\n newCh,\n newStartIdx,\n newEndIdx\n );\n } else if (BUILD19.updatable && newStartIdx > newEndIdx) {\n removeVnodes(oldCh, oldStartIdx, oldEndIdx);\n }\n};\nvar isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {\n if (leftVNode.$tag$ === rightVNode.$tag$) {\n if (BUILD19.slotRelocation && leftVNode.$tag$ === \"slot\") {\n return leftVNode.$name$ === rightVNode.$name$;\n }\n if (BUILD19.vdomKey && !isInitialRender) {\n return leftVNode.$key$ === rightVNode.$key$;\n }\n if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {\n leftVNode.$key$ = rightVNode.$key$;\n }\n return true;\n }\n return false;\n};\nvar referenceNode = (node) => node && node[\"s-ol\"] || node;\nvar patch = (oldVNode, newVNode2, isInitialRender = false) => {\n const elm = newVNode2.$elm$ = oldVNode.$elm$;\n const oldChildren = oldVNode.$children$;\n const newChildren = newVNode2.$children$;\n const tag = newVNode2.$tag$;\n const text = newVNode2.$text$;\n let defaultHolder;\n if (!BUILD19.vdomText || text === null) {\n if (BUILD19.svg) {\n isSvgMode = tag === \"svg\" ? true : tag === \"foreignObject\" ? false : isSvgMode;\n }\n if (BUILD19.vdomAttribute || BUILD19.reflect) {\n if (BUILD19.slot && tag === \"slot\" && !useNativeShadowDom) {\n if (BUILD19.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {\n newVNode2.$elm$[\"s-sn\"] = newVNode2.$name$ || \"\";\n relocateToHostRoot(newVNode2.$elm$.parentElement);\n }\n }\n updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);\n }\n if (BUILD19.updatable && oldChildren !== null && newChildren !== null) {\n updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);\n } else if (newChildren !== null) {\n if (BUILD19.updatable && BUILD19.vdomText && oldVNode.$text$ !== null) {\n elm.textContent = \"\";\n }\n addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);\n } else if (\n // don't do this on initial render as it can cause non-hydrated content to be removed\n !isInitialRender && BUILD19.updatable && oldChildren !== null\n ) {\n removeVnodes(oldChildren, 0, oldChildren.length - 1);\n }\n if (BUILD19.svg && isSvgMode && tag === \"svg\") {\n isSvgMode = false;\n }\n } else if (BUILD19.vdomText && BUILD19.slotRelocation && (defaultHolder = elm[\"s-cr\"])) {\n defaultHolder.parentNode.textContent = text;\n } else if (BUILD19.vdomText && oldVNode.$text$ !== text) {\n elm.data = text;\n }\n};\nvar relocateNodes = [];\nvar markSlotContentForRelocation = (elm) => {\n let node;\n let hostContentNodes;\n let j;\n const children = elm.__childNodes || elm.childNodes;\n for (const childNode of children) {\n if (childNode[\"s-sr\"] && (node = childNode[\"s-cr\"]) && node.parentNode) {\n hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;\n const slotName = childNode[\"s-sn\"];\n for (j = hostContentNodes.length - 1; j >= 0; j--) {\n node = hostContentNodes[j];\n if (!node[\"s-cn\"] && !node[\"s-nr\"] && node[\"s-hn\"] !== childNode[\"s-hn\"] && (!BUILD19.experimentalSlotFixes || !node[\"s-sh\"] || node[\"s-sh\"] !== childNode[\"s-hn\"])) {\n if (isNodeLocatedInSlot(node, slotName)) {\n let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);\n checkSlotFallbackVisibility = true;\n node[\"s-sn\"] = node[\"s-sn\"] || slotName;\n if (relocateNodeData) {\n relocateNodeData.$nodeToRelocate$[\"s-sh\"] = childNode[\"s-hn\"];\n relocateNodeData.$slotRefNode$ = childNode;\n } else {\n node[\"s-sh\"] = childNode[\"s-hn\"];\n relocateNodes.push({\n $slotRefNode$: childNode,\n $nodeToRelocate$: node\n });\n }\n if (node[\"s-sr\"]) {\n relocateNodes.map((relocateNode) => {\n if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node[\"s-sn\"])) {\n relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);\n if (relocateNodeData && !relocateNode.$slotRefNode$) {\n relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;\n }\n }\n });\n }\n } else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {\n relocateNodes.push({\n $nodeToRelocate$: node\n });\n }\n }\n }\n }\n if (childNode.nodeType === 1 /* ElementNode */) {\n markSlotContentForRelocation(childNode);\n }\n }\n};\nvar nullifyVNodeRefs = (vNode) => {\n if (BUILD19.vdomRef) {\n vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);\n vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);\n }\n};\nvar insertBefore = (parent, newNode, reference) => {\n if (BUILD19.scoped && typeof newNode[\"s-sn\"] === \"string\" && !!newNode[\"s-sr\"] && !!newNode[\"s-cr\"]) {\n addRemoveSlotScopedClass(newNode[\"s-cr\"], newNode, parent, newNode.parentElement);\n } else if (BUILD19.experimentalSlotFixes && typeof newNode[\"s-sn\"] === \"string\") {\n if (parent.getRootNode().nodeType !== 11 /* DOCUMENT_FRAGMENT_NODE */) {\n patchParentNode(newNode);\n }\n parent.insertBefore(newNode, reference);\n const { slotNode } = findSlotFromSlottedNode(newNode);\n if (slotNode) dispatchSlotChangeEvent(slotNode);\n return newNode;\n }\n if (BUILD19.experimentalSlotFixes && parent.__insertBefore) {\n return parent.__insertBefore(newNode, reference);\n } else {\n return parent == null ? void 0 : parent.insertBefore(newNode, reference);\n }\n};\nfunction addRemoveSlotScopedClass(reference, slotNode, newParent, oldParent) {\n var _a, _b;\n let scopeId2;\n if (reference && typeof slotNode[\"s-sn\"] === \"string\" && !!slotNode[\"s-sr\"] && reference.parentNode && reference.parentNode[\"s-sc\"] && (scopeId2 = slotNode[\"s-si\"] || reference.parentNode[\"s-sc\"])) {\n const scopeName = slotNode[\"s-sn\"];\n const hostName = slotNode[\"s-hn\"];\n (_a = newParent.classList) == null ? void 0 : _a.add(scopeId2 + \"-s\");\n if (oldParent && ((_b = oldParent.classList) == null ? void 0 : _b.contains(scopeId2 + \"-s\"))) {\n let child = (oldParent.__childNodes || oldParent.childNodes)[0];\n let found = false;\n while (child) {\n if (child[\"s-sn\"] !== scopeName && child[\"s-hn\"] === hostName && !!child[\"s-sr\"]) {\n found = true;\n break;\n }\n child = child.nextSibling;\n }\n if (!found) oldParent.classList.remove(scopeId2 + \"-s\");\n }\n }\n}\nvar renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {\n var _a, _b, _c, _d, _e;\n const hostElm = hostRef.$hostElement$;\n const cmpMeta = hostRef.$cmpMeta$;\n const oldVNode = hostRef.$vnode$ || newVNode(null, null);\n const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);\n hostTagName = hostElm.tagName;\n if (BUILD19.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {\n throw new Error(`The <Host> must be the single root component.\nLooks like the render() function of \"${hostTagName.toLowerCase()}\" is returning an array that contains the <Host>.\n\nThe render() function should look like this instead:\n\nrender() {\n // Do not return an array\n return (\n <Host>{content}</Host>\n );\n}\n `);\n }\n if (BUILD19.reflect && cmpMeta.$attrsToReflect$) {\n rootVnode.$attrs$ = rootVnode.$attrs$ || {};\n cmpMeta.$attrsToReflect$.map(\n ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]\n );\n }\n if (isInitialLoad && rootVnode.$attrs$) {\n for (const key of Object.keys(rootVnode.$attrs$)) {\n if (hostElm.hasAttribute(key) && ![\"key\", \"ref\", \"style\", \"class\"].includes(key)) {\n rootVnode.$attrs$[key] = hostElm[key];\n }\n }\n }\n rootVnode.$tag$ = null;\n rootVnode.$flags$ |= 4 /* isHost */;\n hostRef.$vnode$ = rootVnode;\n rootVnode.$elm$ = oldVNode.$elm$ = BUILD19.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;\n if (BUILD19.scoped || BUILD19.shadowDom) {\n scopeId = hostElm[\"s-sc\"];\n }\n useNativeShadowDom = supportsShadow && !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);\n if (BUILD19.slotRelocation) {\n contentRef = hostElm[\"s-cr\"];\n checkSlotFallbackVisibility = false;\n }\n patch(oldVNode, rootVnode, isInitialLoad);\n if (BUILD19.slotRelocation) {\n plt.$flags$ |= 1 /* isTmpDisconnected */;\n if (checkSlotRelocate) {\n markSlotContentForRelocation(rootVnode.$elm$);\n for (const relocateData of relocateNodes) {\n const nodeToRelocate = relocateData.$nodeToRelocate$;\n if (!nodeToRelocate[\"s-ol\"] && win.document) {\n const orgLocationNode = BUILD19.isDebug || BUILD19.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : win.document.createTextNode(\"\");\n orgLocationNode[\"s-nr\"] = nodeToRelocate;\n insertBefore(nodeToRelocate.parentNode, nodeToRelocate[\"s-ol\"] = orgLocationNode, nodeToRelocate);\n }\n }\n for (const relocateData of relocateNodes) {\n const nodeToRelocate = relocateData.$nodeToRelocate$;\n const slotRefNode = relocateData.$slotRefNode$;\n if (slotRefNode) {\n const parentNodeRef = slotRefNode.parentNode;\n let insertBeforeNode = slotRefNode.nextSibling;\n if (!BUILD19.hydrateServerSide && (!BUILD19.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {\n let orgLocationNode = (_a = nodeToRelocate[\"s-ol\"]) == null ? void 0 : _a.previousSibling;\n while (orgLocationNode) {\n let refNode = (_b = orgLocationNode[\"s-nr\"]) != null ? _b : null;\n if (refNode && refNode[\"s-sn\"] === nodeToRelocate[\"s-sn\"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {\n refNode = refNode.nextSibling;\n while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode[\"s-sr\"])) {\n refNode = refNode == null ? void 0 : refNode.nextSibling;\n }\n if (!refNode || !refNode[\"s-nr\"]) {\n insertBeforeNode = refNode;\n break;\n }\n }\n orgLocationNode = orgLocationNode.previousSibling;\n }\n }\n const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;\n const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;\n if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {\n if (nodeToRelocate !== insertBeforeNode) {\n if (!BUILD19.experimentalSlotFixes && !nodeToRelocate[\"s-hn\"] && nodeToRelocate[\"s-ol\"]) {\n nodeToRelocate[\"s-hn\"] = nodeToRelocate[\"s-ol\"].parentNode.nodeName;\n }\n insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);\n if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== \"SLOT-FB\") {\n nodeToRelocate.hidden = (_c = nodeToRelocate[\"s-ih\"]) != null ? _c : false;\n }\n }\n }\n nodeToRelocate && typeof slotRefNode[\"s-rf\"] === \"function\" && slotRefNode[\"s-rf\"](slotRefNode);\n } else {\n if (nodeToRelocate.nodeType === 1 /* ElementNode */) {\n if (isInitialLoad) {\n nodeToRelocate[\"s-ih\"] = (_d = nodeToRelocate.hidden) != null ? _d : false;\n }\n nodeToRelocate.hidden = true;\n }\n }\n }\n }\n if (checkSlotFallbackVisibility) {\n updateFallbackSlotVisibility(rootVnode.$elm$);\n }\n plt.$flags$ &= ~1 /* isTmpDisconnected */;\n relocateNodes.length = 0;\n }\n if (BUILD19.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {\n const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;\n for (const childNode of children) {\n if (childNode[\"s-hn\"] !== hostTagName && !childNode[\"s-sh\"]) {\n if (isInitialLoad && childNode[\"s-ih\"] == null) {\n childNode[\"s-ih\"] = (_e = childNode.hidden) != null ? _e : false;\n }\n childNode.hidden = true;\n }\n }\n }\n contentRef = void 0;\n};\nvar slotReferenceDebugNode = (slotVNode) => {\n var _a;\n return (_a = win.document) == null ? void 0 : _a.createComment(\n `<slot${slotVNode.$name$ ? ' name=\"' + slotVNode.$name$ + '\"' : \"\"}> (host=${hostTagName.toLowerCase()})`\n );\n};\nvar originalLocationDebugNode = (nodeToRelocate) => {\n var _a;\n return (_a = win.document) == null ? void 0 : _a.createComment(\n `org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate[\"s-hn\"]})` : `[${nodeToRelocate.textContent}]`)\n );\n};\n\n// src/runtime/update-component.ts\nvar attachToAncestor = (hostRef, ancestorComponent) => {\n if (BUILD20.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent[\"s-p\"]) {\n const index = ancestorComponent[\"s-p\"].push(\n new Promise(\n (r) => hostRef.$onRenderResolve$ = () => {\n ancestorComponent[\"s-p\"].splice(index - 1, 1);\n r();\n }\n )\n );\n }\n};\nvar scheduleUpdate = (hostRef, isInitialLoad) => {\n if (BUILD20.taskQueue && BUILD20.updatable) {\n hostRef.$flags$ |= 16 /* isQueuedForUpdate */;\n }\n if (BUILD20.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {\n hostRef.$flags$ |= 512 /* needsRerender */;\n return;\n }\n attachToAncestor(hostRef, hostRef.$ancestorComponent$);\n const dispatch = () => dispatchHooks(hostRef, isInitialLoad);\n return BUILD20.taskQueue ? writeTask(dispatch) : dispatch();\n};\nvar dispatchHooks = (hostRef, isInitialLoad) => {\n const elm = hostRef.$hostElement$;\n const endSchedule = createTime(\"scheduleUpdate\", hostRef.$cmpMeta$.$tagName$);\n const instance = BUILD20.lazyLoad ? hostRef.$lazyInstance$ : elm;\n if (!instance) {\n throw new Error(\n `Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \\`externalRuntime: true\\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`\n );\n }\n let maybePromise;\n if (isInitialLoad) {\n if (BUILD20.lazyLoad && BUILD20.hostListener) {\n hostRef.$flags$ |= 256 /* isListenReady */;\n if (hostRef.$queuedListeners$) {\n hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));\n hostRef.$queuedListeners$ = void 0;\n }\n }\n emitLifecycleEvent(elm, \"componentWillLoad\");\n maybePromise = safeCall(instance, \"componentWillLoad\", void 0, elm);\n } else {\n emitLifecycleEvent(elm, \"componentWillUpdate\");\n maybePromise = safeCall(instance, \"componentWillUpdate\", void 0, elm);\n }\n emitLifecycleEvent(elm, \"componentWillRender\");\n maybePromise = enqueue(maybePromise, () => safeCall(instance, \"componentWillRender\", void 0, elm));\n endSchedule();\n return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));\n};\nvar enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {\n console.error(err2);\n fn();\n}) : fn();\nvar isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === \"function\";\nvar updateComponent = async (hostRef, instance, isInitialLoad) => {\n var _a;\n const elm = hostRef.$hostElement$;\n const endUpdate = createTime(\"update\", hostRef.$cmpMeta$.$tagName$);\n const rc = elm[\"s-rc\"];\n if (BUILD20.style && isInitialLoad) {\n attachStyles(hostRef);\n }\n const endRender = createTime(\"render\", hostRef.$cmpMeta$.$tagName$);\n if (BUILD20.isDev) {\n hostRef.$flags$ |= 1024 /* devOnRender */;\n }\n if (BUILD20.hydrateServerSide) {\n await callRender(hostRef, instance, elm, isInitialLoad);\n } else {\n callRender(hostRef, instance, elm, isInitialLoad);\n }\n if (BUILD20.isDev) {\n hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;\n hostRef.$flags$ &= ~1024 /* devOnRender */;\n }\n if (BUILD20.hydrateServerSide) {\n try {\n serverSideConnected(elm);\n if (isInitialLoad) {\n if (hostRef.$cmpMeta$.$flags$ & 1 /* shadowDomEncapsulation */) {\n elm[\"s-en\"] = \"\";\n } else if (hostRef.$cmpMeta$.$flags$ & 2 /* scopedCssEncapsulation */) {\n elm[\"s-en\"] = \"c\";\n }\n }\n } catch (e) {\n consoleError(e, elm);\n }\n }\n if (BUILD20.asyncLoading && rc) {\n rc.map((cb) => cb());\n elm[\"s-rc\"] = void 0;\n }\n endRender();\n endUpdate();\n if (BUILD20.asyncLoading) {\n const childrenPromises = (_a = elm[\"s-p\"]) != null ? _a : [];\n const postUpdate = () => postUpdateComponent(hostRef);\n if (childrenPromises.length === 0) {\n postUpdate();\n } else {\n Promise.all(childrenPromises).then(postUpdate);\n hostRef.$flags$ |= 4 /* isWaitingForChildren */;\n childrenPromises.length = 0;\n }\n } else {\n postUpdateComponent(hostRef);\n }\n};\nvar renderingRef = null;\nvar callRender = (hostRef, instance, elm, isInitialLoad) => {\n const allRenderFn = BUILD20.allRenderFn ? true : false;\n const lazyLoad = BUILD20.lazyLoad ? true : false;\n const taskQueue = BUILD20.taskQueue ? true : false;\n const updatable = BUILD20.updatable ? true : false;\n try {\n renderingRef = instance;\n instance = allRenderFn ? instance.render() : instance.render && instance.render();\n if (updatable && taskQueue) {\n hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;\n }\n if (updatable || lazyLoad) {\n hostRef.$flags$ |= 2 /* hasRendered */;\n }\n if (BUILD20.hasRenderFn || BUILD20.reflect) {\n if (BUILD20.vdomRender || BUILD20.reflect) {\n if (BUILD20.hydrateServerSide) {\n return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));\n } else {\n renderVdom(hostRef, instance, isInitialLoad);\n }\n } else {\n const shadowRoot = elm.shadowRoot;\n if (hostRef.$cmpMeta$.$flags$ & 1 /* shadowDomEncapsulation */) {\n shadowRoot.textContent = instance;\n } else {\n elm.textContent = instance;\n }\n }\n }\n } catch (e) {\n consoleError(e, hostRef.$hostElement$);\n }\n renderingRef = null;\n return null;\n};\nvar getRenderingRef = () => renderingRef;\nvar postUpdateComponent = (hostRef) => {\n const tagName = hostRef.$cmpMeta$.$tagName$;\n const elm = hostRef.$hostElement$;\n const endPostUpdate = createTime(\"postUpdate\", tagName);\n const instance = BUILD20.lazyLoad ? hostRef.$lazyInstance$ : elm;\n const ancestorComponent = hostRef.$ancestorComponent$;\n if (BUILD20.isDev) {\n hostRef.$flags$ |= 1024 /* devOnRender */;\n }\n safeCall(instance, \"componentDidRender\", void 0, elm);\n if (BUILD20.isDev) {\n hostRef.$flags$ &= ~1024 /* devOnRender */;\n }\n emitLifecycleEvent(elm, \"componentDidRender\");\n if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {\n hostRef.$flags$ |= 64 /* hasLoadedComponent */;\n if (BUILD20.asyncLoading && BUILD20.cssAnnotations) {\n addHydratedFlag(elm);\n }\n if (BUILD20.isDev) {\n hostRef.$flags$ |= 2048 /* devOnDidLoad */;\n }\n safeCall(instance, \"componentDidLoad\", void 0, elm);\n if (BUILD20.isDev) {\n hostRef.$flags$ &= ~2048 /* devOnDidLoad */;\n }\n emitLifecycleEvent(elm, \"componentDidLoad\");\n endPostUpdate();\n if (BUILD20.asyncLoading) {\n hostRef.$onReadyResolve$(elm);\n if (!ancestorComponent) {\n appDidLoad(tagName);\n }\n }\n } else {\n if (BUILD20.isDev) {\n hostRef.$flags$ |= 1024 /* devOnRender */;\n }\n safeCall(instance, \"componentDidUpdate\", void 0, elm);\n if (BUILD20.isDev) {\n hostRef.$flags$ &= ~1024 /* devOnRender */;\n }\n emitLifecycleEvent(elm, \"componentDidUpdate\");\n endPostUpdate();\n }\n if (BUILD20.method && BUILD20.lazyLoad) {\n hostRef.$onInstanceResolve$(elm);\n }\n if (BUILD20.asyncLoading) {\n if (hostRef.$onRenderResolve$) {\n hostRef.$onRenderResolve$();\n hostRef.$onRenderResolve$ = void 0;\n }\n if (hostRef.$flags$ & 512 /* needsRerender */) {\n nextTick(() => scheduleUpdate(hostRef, false));\n }\n hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);\n }\n};\nvar forceUpdate = (ref) => {\n if (BUILD20.updatable && (Build.isBrowser || Build.isTesting)) {\n const hostRef = getHostRef(ref);\n const isConnected = hostRef.$hostElement$.isConnected;\n if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {\n scheduleUpdate(hostRef, false);\n }\n return isConnected;\n }\n return false;\n};\nvar appDidLoad = (who) => {\n if (BUILD20.asyncQueue) {\n plt.$flags$ |= 2 /* appLoaded */;\n }\n nextTick(() => emitEvent(win, \"appload\", { detail: { namespace: NAMESPACE } }));\n if (BUILD20.profile && performance.measure) {\n performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, \"st:app:start\");\n }\n};\nvar safeCall = (instance, method, arg, elm) => {\n if (instance && instance[method]) {\n try {\n return instance[method](arg);\n } catch (e) {\n consoleError(e, elm);\n }\n }\n return void 0;\n};\nvar emitLifecycleEvent = (elm, lifecycleName) => {\n if (BUILD20.lifecycleDOMEvents) {\n emitEvent(elm, \"stencil_\" + lifecycleName, {\n bubbles: true,\n composed: true,\n detail: {\n namespace: NAMESPACE\n }\n });\n }\n};\nvar addHydratedFlag = (elm) => {\n var _a, _b;\n return BUILD20.hydratedClass ? elm.classList.add((_a = BUILD20.hydratedSelectorName) != null ? _a : \"hydrated\") : BUILD20.hydratedAttribute ? elm.setAttribute((_b = BUILD20.hydratedSelectorName) != null ? _b : \"hydrated\", \"\") : void 0;\n};\nvar serverSideConnected = (elm) => {\n const children = elm.children;\n if (children != null) {\n for (let i2 = 0, ii = children.length; i2 < ii; i2++) {\n const childElm = children[i2];\n if (typeof childElm.connectedCallback === \"function\") {\n childElm.connectedCallback();\n }\n serverSideConnected(childElm);\n }\n }\n};\n\n// src/runtime/set-value.ts\nvar getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);\nvar setValue = (ref, propName, newVal, cmpMeta) => {\n const hostRef = getHostRef(ref);\n if (BUILD21.lazyLoad && !hostRef) {\n throw new Error(\n `Couldn't find host element for \"${cmpMeta.$tagName$}\" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`\n );\n }\n const elm = BUILD21.lazyLoad ? hostRef.$hostElement$ : ref;\n const oldVal = hostRef.$instanceValues$.get(propName);\n const flags = hostRef.$flags$;\n const instance = BUILD21.lazyLoad ? hostRef.$lazyInstance$ : elm;\n newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);\n const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);\n const didValueChange = newVal !== oldVal && !areBothNaN;\n if ((!BUILD21.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {\n hostRef.$instanceValues$.set(propName, newVal);\n if (BUILD21.isDev) {\n if (hostRef.$flags$ & 1024 /* devOnRender */) {\n consoleDevWarn(\n `The state/prop \"${propName}\" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,\n \"\\nElement\",\n elm,\n \"\\nNew value\",\n newVal,\n \"\\nOld value\",\n oldVal\n );\n } else if (hostRef.$flags$ & 2048 /* devOnDidLoad */) {\n consoleDevWarn(\n `The state/prop \"${propName}\" changed during \"componentDidLoad()\", this triggers extra re-renders, try to setup on \"componentWillLoad()\"`,\n \"\\nElement\",\n elm,\n \"\\nNew value\",\n newVal,\n \"\\nOld value\",\n oldVal\n );\n }\n }\n if (!BUILD21.lazyLoad || instance) {\n if (BUILD21.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {\n const watchMethods = cmpMeta.$watchers$[propName];\n if (watchMethods) {\n watchMethods.map((watchMethodName) => {\n try {\n instance[watchMethodName](newVal, oldVal, propName);\n } catch (e) {\n consoleError(e, elm);\n }\n });\n }\n }\n if (BUILD21.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {\n if (instance.componentShouldUpdate) {\n if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {\n return;\n }\n }\n scheduleUpdate(hostRef, false);\n }\n }\n }\n};\n\n// src/runtime/proxy-component.ts\nvar proxyComponent = (Cstr, cmpMeta, flags) => {\n var _a, _b;\n const prototype = Cstr.prototype;\n if (BUILD22.isTesting) {\n if (prototype.__stencilAugmented) {\n return;\n }\n prototype.__stencilAugmented = true;\n }\n if (BUILD22.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {\n FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {\n const originalFormAssociatedCallback = prototype[cbName];\n Object.defineProperty(prototype, cbName, {\n value(...args) {\n const hostRef = getHostRef(this);\n const instance = BUILD22.lazyLoad ? hostRef.$lazyInstance$ : this;\n if (!instance) {\n hostRef.$onReadyPromise$.then((asyncInstance) => {\n const cb = asyncInstance[cbName];\n typeof cb === \"function\" && cb.call(asyncInstance, ...args);\n });\n } else {\n const cb = BUILD22.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;\n typeof cb === \"function\" && cb.call(instance, ...args);\n }\n }\n });\n });\n }\n if (BUILD22.member && cmpMeta.$members$ || BUILD22.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {\n if (BUILD22.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {\n cmpMeta.$watchers$ = Cstr.watchers;\n }\n const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});\n members.map(([memberName, [memberFlags]]) => {\n if ((BUILD22.prop || BUILD22.state) && (memberFlags & 31 /* Prop */ || (!BUILD22.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {\n const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};\n if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;\n if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;\n if (flags & 1 /* isElementConstructor */ || !origGetter) {\n Object.defineProperty(prototype, memberName, {\n get() {\n if (BUILD22.lazyLoad) {\n if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {\n return getValue(this, memberName);\n }\n const ref = getHostRef(this);\n const instance = ref ? ref.$lazyInstance$ : prototype;\n if (!instance) return;\n return instance[memberName];\n }\n if (!BUILD22.lazyLoad) {\n return origGetter ? origGetter.apply(this) : getValue(this, memberName);\n }\n },\n configurable: true,\n enumerable: true\n });\n }\n Object.defineProperty(prototype, memberName, {\n set(newValue) {\n const ref = getHostRef(this);\n if (BUILD22.isDev) {\n if (\n // we are proxying the instance (not element)\n (flags & 1 /* isElementConstructor */) === 0 && // if the class has a setter, then the Element can update instance values, so ignore\n (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0 && // the element is not constructing\n (ref && ref.$flags$ & 8 /* isConstructingInstance */) === 0 && // the member is a prop\n (memberFlags & 31 /* Prop */) !== 0 && // the member is not mutable\n (memberFlags & 1024 /* Mutable */) === 0\n ) {\n consoleDevWarn(\n `@Prop() \"${memberName}\" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.\nMore information: https://stenciljs.com/docs/properties#prop-mutability`\n );\n }\n }\n if (origSetter) {\n const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];\n if (typeof currentValue === \"undefined\" && ref.$instanceValues$.get(memberName)) {\n newValue = ref.$instanceValues$.get(memberName);\n } else if (!ref.$instanceValues$.get(memberName) && currentValue) {\n ref.$instanceValues$.set(memberName, currentValue);\n }\n origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);\n newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];\n setValue(this, memberName, newValue, cmpMeta);\n return;\n }\n if (!BUILD22.lazyLoad) {\n setValue(this, memberName, newValue, cmpMeta);\n return;\n }\n if (BUILD22.lazyLoad) {\n if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {\n setValue(this, memberName, newValue, cmpMeta);\n if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {\n ref.$onReadyPromise$.then(() => {\n if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {\n ref.$lazyInstance$[memberName] = newValue;\n }\n });\n }\n return;\n }\n const setterSetVal = () => {\n const currentValue = ref.$lazyInstance$[memberName];\n if (!ref.$instanceValues$.get(memberName) && currentValue) {\n ref.$instanceValues$.set(memberName, currentValue);\n }\n ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);\n setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);\n };\n if (ref.$lazyInstance$) {\n setterSetVal();\n } else {\n ref.$onReadyPromise$.then(() => setterSetVal());\n }\n }\n }\n });\n } else if (BUILD22.lazyLoad && BUILD22.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {\n Object.defineProperty(prototype, memberName, {\n value(...args) {\n var _a2;\n const ref = getHostRef(this);\n return (_a2 = ref == null ? void 0 : ref.$onInstancePromise$) == null ? void 0 : _a2.then(() => {\n var _a3;\n return (_a3 = ref.$lazyInstance$) == null ? void 0 : _a3[memberName](...args);\n });\n }\n });\n }\n });\n if (BUILD22.observeAttribute && (!BUILD22.lazyLoad || flags & 1 /* isElementConstructor */)) {\n const attrNameToPropName = /* @__PURE__ */ new Map();\n prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {\n plt.jmp(() => {\n var _a2;\n const propName = attrNameToPropName.get(attrName);\n if (this.hasOwnProperty(propName) && BUILD22.lazyLoad) {\n newValue = this[propName];\n delete this[propName];\n } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === \"number\" && // cast type to number to avoid TS compiler issues\n this[propName] == newValue) {\n return;\n } else if (propName == null) {\n const hostRef = getHostRef(this);\n const flags2 = hostRef == null ? void 0 : hostRef.$flags$;\n if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {\n const elm = BUILD22.lazyLoad ? hostRef.$hostElement$ : this;\n const instance = BUILD22.lazyLoad ? hostRef.$lazyInstance$ : elm;\n const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];\n entry == null ? void 0 : entry.forEach((callbackName) => {\n if (instance[callbackName] != null) {\n instance[callbackName].call(instance, newValue, oldValue, attrName);\n }\n });\n }\n return;\n }\n const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);\n newValue = newValue === null && typeof this[propName] === \"boolean\" ? false : newValue;\n if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {\n this[propName] = newValue;\n }\n });\n };\n Cstr.observedAttributes = Array.from(\n /* @__PURE__ */ new Set([\n ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),\n ...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {\n var _a2;\n const attrName = m[1] || propName;\n attrNameToPropName.set(attrName, propName);\n if (BUILD22.reflect && m[0] & 512 /* ReflectAttr */) {\n (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);\n }\n return attrName;\n })\n ])\n );\n }\n }\n return Cstr;\n};\n\n// src/runtime/initialize-component.ts\nvar initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {\n let Cstr;\n if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {\n hostRef.$flags$ |= 32 /* hasInitializedComponent */;\n const bundleId = cmpMeta.$lazyBundleId$;\n if (BUILD23.lazyLoad && bundleId) {\n const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);\n if (CstrImport && \"then\" in CstrImport) {\n const endLoad = uniqueTime(\n `st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`,\n `[Stencil] Load module for <${cmpMeta.$tagName$}>`\n );\n Cstr = await CstrImport;\n endLoad();\n } else {\n Cstr = CstrImport;\n }\n if (!Cstr) {\n throw new Error(`Constructor for \"${cmpMeta.$tagName$}#${hostRef.$modeName$}\" was not found`);\n }\n if (BUILD23.member && !Cstr.isProxied) {\n if (BUILD23.watchCallback) {\n cmpMeta.$watchers$ = Cstr.watchers;\n }\n proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);\n Cstr.isProxied = true;\n }\n const endNewInstance = createTime(\"createInstance\", cmpMeta.$tagName$);\n if (BUILD23.member) {\n hostRef.$flags$ |= 8 /* isConstructingInstance */;\n }\n try {\n new Cstr(hostRef);\n } catch (e) {\n consoleError(e, elm);\n }\n if (BUILD23.member) {\n hostRef.$flags$ &= ~8 /* isConstructingInstance */;\n }\n if (BUILD23.watchCallback) {\n hostRef.$flags$ |= 128 /* isWatchReady */;\n }\n endNewInstance();\n fireConnectedCallback(hostRef.$lazyInstance$, elm);\n } else {\n Cstr = elm.constructor;\n const cmpTag = elm.localName;\n customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);\n }\n if (BUILD23.style && Cstr && Cstr.style) {\n let style;\n if (typeof Cstr.style === \"string\") {\n style = Cstr.style;\n } else if (BUILD23.mode && typeof Cstr.style !== \"string\") {\n hostRef.$modeName$ = computeMode(elm);\n if (hostRef.$modeName$) {\n style = Cstr.style[hostRef.$modeName$];\n }\n if (BUILD23.hydrateServerSide && hostRef.$modeName$) {\n elm.setAttribute(\"s-mode\", hostRef.$modeName$);\n }\n }\n const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);\n if (!styles.has(scopeId2)) {\n const endRegisterStyles = createTime(\"registerStyles\", cmpMeta.$tagName$);\n if (BUILD23.hydrateServerSide && BUILD23.shadowDom && cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */) {\n style = scopeCss(style, scopeId2, true);\n }\n registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));\n endRegisterStyles();\n }\n }\n }\n const ancestorComponent = hostRef.$ancestorComponent$;\n const schedule = () => scheduleUpdate(hostRef, true);\n if (BUILD23.asyncLoading && ancestorComponent && ancestorComponent[\"s-rc\"]) {\n ancestorComponent[\"s-rc\"].push(schedule);\n } else {\n schedule();\n }\n};\nvar fireConnectedCallback = (instance, elm) => {\n if (BUILD23.lazyLoad) {\n safeCall(instance, \"connectedCallback\", void 0, elm);\n }\n};\n\n// src/runtime/connected-callback.ts\nvar connectedCallback = (elm) => {\n if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {\n const hostRef = getHostRef(elm);\n const cmpMeta = hostRef.$cmpMeta$;\n const endConnected = createTime(\"connectedCallback\", cmpMeta.$tagName$);\n if (BUILD24.hostListenerTargetParent) {\n addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);\n }\n if (!(hostRef.$flags$ & 1 /* hasConnected */)) {\n hostRef.$flags$ |= 1 /* hasConnected */;\n let hostId;\n if (BUILD24.hydrateClientSide) {\n hostId = elm.getAttribute(HYDRATE_ID);\n if (hostId) {\n if (BUILD24.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {\n const scopeId2 = BUILD24.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute(\"s-mode\")) : addStyle(elm.shadowRoot, cmpMeta);\n elm.classList.remove(scopeId2 + \"-h\", scopeId2 + \"-s\");\n } else if (BUILD24.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {\n const scopeId2 = getScopeId(cmpMeta, BUILD24.mode ? elm.getAttribute(\"s-mode\") : void 0);\n elm[\"s-sc\"] = scopeId2;\n }\n initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);\n }\n }\n if (BUILD24.slotRelocation && !hostId) {\n if (BUILD24.hydrateServerSide || (BUILD24.slot || BUILD24.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field\n cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {\n setContentReference(elm);\n }\n }\n if (BUILD24.asyncLoading) {\n let ancestorComponent = elm;\n while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {\n if (BUILD24.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute(\"s-id\") && ancestorComponent[\"s-p\"] || ancestorComponent[\"s-p\"]) {\n attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);\n break;\n }\n }\n }\n if (BUILD24.prop && !BUILD24.hydrateServerSide && cmpMeta.$members$) {\n Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {\n if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {\n const value = elm[memberName];\n delete elm[memberName];\n elm[memberName] = value;\n }\n });\n }\n if (BUILD24.initializeNextTick) {\n nextTick(() => initializeComponent(elm, hostRef, cmpMeta));\n } else {\n initializeComponent(elm, hostRef, cmpMeta);\n }\n } else {\n addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);\n if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {\n fireConnectedCallback(hostRef.$lazyInstance$, elm);\n } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {\n hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));\n }\n }\n endConnected();\n }\n};\nvar setContentReference = (elm) => {\n if (!win.document) {\n return;\n }\n const contentRefElm = elm[\"s-cr\"] = win.document.createComment(\n BUILD24.isDebug ? `content-ref (host=${elm.localName})` : \"\"\n );\n contentRefElm[\"s-cn\"] = true;\n insertBefore(elm, contentRefElm, elm.firstChild);\n};\n\n// src/runtime/disconnected-callback.ts\nimport { BUILD as BUILD25 } from \"@stencil/core/internal/app-data\";\nvar disconnectInstance = (instance, elm) => {\n if (BUILD25.lazyLoad) {\n safeCall(instance, \"disconnectedCallback\", void 0, elm || instance);\n }\n};\nvar disconnectedCallback = async (elm) => {\n if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {\n const hostRef = getHostRef(elm);\n if (BUILD25.hostListener) {\n if (hostRef.$rmListeners$) {\n hostRef.$rmListeners$.map((rmListener) => rmListener());\n hostRef.$rmListeners$ = void 0;\n }\n }\n if (!BUILD25.lazyLoad) {\n disconnectInstance(elm);\n } else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {\n disconnectInstance(hostRef.$lazyInstance$, elm);\n } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {\n hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));\n }\n }\n if (rootAppliedStyles.has(elm)) {\n rootAppliedStyles.delete(elm);\n }\n if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {\n rootAppliedStyles.delete(elm.shadowRoot);\n }\n};\n\n// src/runtime/bootstrap-custom-element.ts\nvar defineCustomElement = (Cstr, compactMeta) => {\n customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta));\n};\nvar proxyCustomElement = (Cstr, compactMeta) => {\n const cmpMeta = {\n $flags$: compactMeta[0],\n $tagName$: compactMeta[1]\n };\n if (BUILD26.member) {\n cmpMeta.$members$ = compactMeta[2];\n }\n if (BUILD26.hostListener) {\n cmpMeta.$listeners$ = compactMeta[3];\n }\n if (BUILD26.watchCallback) {\n cmpMeta.$watchers$ = Cstr.$watchers$;\n }\n if (BUILD26.reflect) {\n cmpMeta.$attrsToReflect$ = [];\n }\n if (BUILD26.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {\n cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;\n }\n if (BUILD26.experimentalSlotFixes) {\n if (BUILD26.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {\n patchPseudoShadowDom(Cstr.prototype);\n }\n } else {\n if (BUILD26.slotChildNodesFix) {\n patchChildSlotNodes(Cstr.prototype);\n }\n if (BUILD26.cloneNodeFix) {\n patchCloneNode(Cstr.prototype);\n }\n if (BUILD26.appendChildSlotFix) {\n patchSlotAppendChild(Cstr.prototype);\n }\n if (BUILD26.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {\n patchTextContent(Cstr.prototype);\n }\n }\n if (BUILD26.hydrateClientSide && BUILD26.shadowDom) {\n hydrateScopedToShadow();\n }\n const originalConnectedCallback = Cstr.prototype.connectedCallback;\n const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;\n Object.assign(Cstr.prototype, {\n __hasHostListenerAttached: false,\n __registerHost() {\n registerHost(this, cmpMeta);\n },\n connectedCallback() {\n if (!this.__hasHostListenerAttached) {\n const hostRef = getHostRef(this);\n addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);\n this.__hasHostListenerAttached = true;\n }\n connectedCallback(this);\n if (originalConnectedCallback) {\n originalConnectedCallback.call(this);\n }\n },\n disconnectedCallback() {\n disconnectedCallback(this);\n if (originalDisconnectedCallback) {\n originalDisconnectedCallback.call(this);\n }\n },\n __attachShadow() {\n if (supportsShadow) {\n if (!this.shadowRoot) {\n if (BUILD26.shadowDelegatesFocus) {\n this.attachShadow({\n mode: \"open\",\n delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)\n });\n } else {\n this.attachShadow({ mode: \"open\" });\n }\n } else {\n if (this.shadowRoot.mode !== \"open\") {\n throw new Error(\n `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`\n );\n }\n }\n } else {\n this.shadowRoot = this;\n }\n }\n });\n Cstr.is = cmpMeta.$tagName$;\n return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);\n};\nvar forceModeUpdate = (elm) => {\n if (BUILD26.style && BUILD26.mode && !BUILD26.lazyLoad) {\n const mode = computeMode(elm);\n const hostRef = getHostRef(elm);\n if (hostRef.$modeName$ !== mode) {\n const cmpMeta = hostRef.$cmpMeta$;\n const oldScopeId = elm[\"s-sc\"];\n const scopeId2 = getScopeId(cmpMeta, mode);\n const style = elm.constructor.style[mode];\n const flags = cmpMeta.$flags$;\n if (style) {\n if (!styles.has(scopeId2)) {\n registerStyle(scopeId2, style, !!(flags & 1 /* shadowDomEncapsulation */));\n }\n hostRef.$modeName$ = mode;\n elm.classList.remove(oldScopeId + \"-h\", oldScopeId + \"-s\");\n attachStyles(hostRef);\n forceUpdate(elm);\n }\n }\n }\n};\n\n// src/runtime/bootstrap-lazy.ts\nimport { BUILD as BUILD27 } from \"@stencil/core/internal/app-data\";\n\n// src/runtime/hmr-component.ts\nvar hmrStart = (hostElement, cmpMeta, hmrVersionId) => {\n const hostRef = getHostRef(hostElement);\n hostRef.$flags$ = 1 /* hasConnected */;\n initializeComponent(hostElement, hostRef, cmpMeta, hmrVersionId);\n};\n\n// src/runtime/bootstrap-lazy.ts\nvar bootstrapLazy = (lazyBundles, options = {}) => {\n var _a;\n if (BUILD27.profile && performance.mark) {\n performance.mark(\"st:app:start\");\n }\n installDevTools();\n if (!win.document) {\n console.warn(\"Stencil: No document found. Skipping bootstrapping lazy components.\");\n return;\n }\n const endBootstrap = createTime(\"bootstrapLazy\");\n const cmpTags = [];\n const exclude = options.exclude || [];\n const customElements2 = win.customElements;\n const head = win.document.head;\n const metaCharset = /* @__PURE__ */ head.querySelector(\"meta[charset]\");\n const dataStyles = /* @__PURE__ */ win.document.createElement(\"style\");\n const deferredConnectedCallbacks = [];\n let appLoadFallback;\n let isBootstrapping = true;\n Object.assign(plt, options);\n plt.$resourcesUrl$ = new URL(options.resourcesUrl || \"./\", win.document.baseURI).href;\n if (BUILD27.asyncQueue) {\n if (options.syncQueue) {\n plt.$flags$ |= 4 /* queueSync */;\n }\n }\n if (BUILD27.hydrateClientSide) {\n plt.$flags$ |= 2 /* appLoaded */;\n }\n if (BUILD27.hydrateClientSide && BUILD27.shadowDom) {\n hydrateScopedToShadow();\n }\n let hasSlotRelocation = false;\n lazyBundles.map((lazyBundle) => {\n lazyBundle[1].map((compactMeta) => {\n var _a2;\n const cmpMeta = {\n $flags$: compactMeta[0],\n $tagName$: compactMeta[1],\n $members$: compactMeta[2],\n $listeners$: compactMeta[3]\n };\n if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {\n hasSlotRelocation = true;\n }\n if (BUILD27.member) {\n cmpMeta.$members$ = compactMeta[2];\n }\n if (BUILD27.hostListener) {\n cmpMeta.$listeners$ = compactMeta[3];\n }\n if (BUILD27.reflect) {\n cmpMeta.$attrsToReflect$ = [];\n }\n if (BUILD27.watchCallback) {\n cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};\n }\n if (BUILD27.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {\n cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;\n }\n const tagName = BUILD27.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;\n const HostElement = class extends HTMLElement {\n // StencilLazyHost\n constructor(self) {\n super(self);\n this.hasRegisteredEventListeners = false;\n self = this;\n registerHost(self, cmpMeta);\n if (BUILD27.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {\n if (supportsShadow) {\n if (!self.shadowRoot) {\n if (BUILD27.shadowDelegatesFocus) {\n self.attachShadow({\n mode: \"open\",\n delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)\n });\n } else {\n self.attachShadow({ mode: \"open\" });\n }\n } else {\n if (self.shadowRoot.mode !== \"open\") {\n throw new Error(\n `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${self.shadowRoot.mode} but Stencil only supports open shadow roots.`\n );\n }\n }\n } else if (!BUILD27.hydrateServerSide && !(\"shadowRoot\" in self)) {\n self.shadowRoot = self;\n }\n }\n }\n connectedCallback() {\n const hostRef = getHostRef(this);\n if (!this.hasRegisteredEventListeners) {\n this.hasRegisteredEventListeners = true;\n addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);\n }\n if (appLoadFallback) {\n clearTimeout(appLoadFallback);\n appLoadFallback = null;\n }\n if (isBootstrapping) {\n deferredConnectedCallbacks.push(this);\n } else {\n plt.jmp(() => connectedCallback(this));\n }\n }\n disconnectedCallback() {\n plt.jmp(() => disconnectedCallback(this));\n plt.raf(() => {\n var _a3;\n const hostRef = getHostRef(this);\n const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);\n if (i2 > -1) {\n deferredConnectedCallbacks.splice(i2, 1);\n }\n if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {\n delete hostRef.$vnode$.$elm$;\n }\n });\n }\n componentOnReady() {\n return getHostRef(this).$onReadyPromise$;\n }\n };\n if (BUILD27.experimentalSlotFixes) {\n if (BUILD27.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {\n patchPseudoShadowDom(HostElement.prototype);\n }\n } else {\n if (BUILD27.slotChildNodesFix) {\n patchChildSlotNodes(HostElement.prototype);\n }\n if (BUILD27.cloneNodeFix) {\n patchCloneNode(HostElement.prototype);\n }\n if (BUILD27.appendChildSlotFix) {\n patchSlotAppendChild(HostElement.prototype);\n }\n if (BUILD27.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {\n patchTextContent(HostElement.prototype);\n }\n }\n if (BUILD27.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {\n HostElement.formAssociated = true;\n }\n if (BUILD27.hotModuleReplacement) {\n HostElement.prototype[\"s-hmr\"] = function(hmrVersionId) {\n hmrStart(this, cmpMeta, hmrVersionId);\n };\n }\n cmpMeta.$lazyBundleId$ = lazyBundle[0];\n if (!exclude.includes(tagName) && !customElements2.get(tagName)) {\n cmpTags.push(tagName);\n customElements2.define(\n tagName,\n proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */)\n );\n }\n });\n });\n if (cmpTags.length > 0) {\n if (hasSlotRelocation) {\n dataStyles.textContent += SLOT_FB_CSS;\n }\n if (BUILD27.invisiblePrehydration && (BUILD27.hydratedClass || BUILD27.hydratedAttribute)) {\n dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;\n }\n if (dataStyles.innerHTML.length) {\n dataStyles.setAttribute(\"data-styles\", \"\");\n const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);\n if (nonce != null) {\n dataStyles.setAttribute(\"nonce\", nonce);\n }\n head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);\n }\n }\n isBootstrapping = false;\n if (deferredConnectedCallbacks.length) {\n deferredConnectedCallbacks.map((host) => host.connectedCallback());\n } else {\n if (BUILD27.profile) {\n plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, \"timeout\"));\n } else {\n plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));\n }\n }\n endBootstrap();\n};\n\n// src/runtime/fragment.ts\nvar Fragment = (_, children) => children;\n\n// src/runtime/host-listener.ts\nimport { BUILD as BUILD28 } from \"@stencil/core/internal/app-data\";\nvar addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {\n if (BUILD28.hostListener && listeners && win.document) {\n if (BUILD28.hostListenerTargetParent) {\n if (attachParentListeners) {\n listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);\n } else {\n listeners = listeners.filter(([flags]) => !(flags & 32 /* TargetParent */));\n }\n }\n listeners.map(([flags, name, method]) => {\n const target = BUILD28.hostListenerTarget ? getHostListenerTarget(win.document, elm, flags) : elm;\n const handler = hostListenerProxy(hostRef, method);\n const opts = hostListenerOpts(flags);\n plt.ael(target, name, handler, opts);\n (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));\n });\n }\n};\nvar hostListenerProxy = (hostRef, methodName) => (ev) => {\n var _a;\n try {\n if (BUILD28.lazyLoad) {\n if (hostRef.$flags$ & 256 /* isListenReady */) {\n (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);\n } else {\n (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);\n }\n } else {\n hostRef.$hostElement$[methodName](ev);\n }\n } catch (e) {\n consoleError(e, hostRef.$hostElement$);\n }\n};\nvar getHostListenerTarget = (doc, elm, flags) => {\n if (BUILD28.hostListenerTargetDocument && flags & 4 /* TargetDocument */) {\n return doc;\n }\n if (BUILD28.hostListenerTargetWindow && flags & 8 /* TargetWindow */) {\n return win;\n }\n if (BUILD28.hostListenerTargetBody && flags & 16 /* TargetBody */) {\n return doc.body;\n }\n if (BUILD28.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement) {\n return elm.parentElement;\n }\n return elm;\n};\nvar hostListenerOpts = (flags) => supportsListenerOptions ? {\n passive: (flags & 1 /* Passive */) !== 0,\n capture: (flags & 2 /* Capture */) !== 0\n} : (flags & 2 /* Capture */) !== 0;\n\n// src/runtime/nonce.ts\nvar setNonce = (nonce) => plt.$nonce$ = nonce;\n\n// src/runtime/platform-options.ts\nvar setPlatformOptions = (opts) => Object.assign(plt, opts);\n\n// src/runtime/vdom/vdom-annotations.ts\nvar insertVdomAnnotations = (doc, staticComponents) => {\n if (doc != null) {\n const docData = STENCIL_DOC_DATA in doc ? doc[STENCIL_DOC_DATA] : { ...DEFAULT_DOC_DATA };\n docData.staticComponents = new Set(staticComponents);\n const orgLocationNodes = [];\n parseVNodeAnnotations(doc, doc.body, docData, orgLocationNodes);\n orgLocationNodes.forEach((orgLocationNode) => {\n var _a;\n if (orgLocationNode != null && orgLocationNode[\"s-nr\"]) {\n const nodeRef = orgLocationNode[\"s-nr\"];\n let hostId = nodeRef[\"s-host-id\"];\n let nodeId = nodeRef[\"s-node-id\"];\n let childId = `${hostId}.${nodeId}`;\n if (hostId == null) {\n hostId = 0;\n docData.rootLevelIds++;\n nodeId = docData.rootLevelIds;\n childId = `${hostId}.${nodeId}`;\n if (nodeRef.nodeType === 1 /* ElementNode */) {\n nodeRef.setAttribute(HYDRATE_CHILD_ID, childId);\n if (typeof nodeRef[\"s-sn\"] === \"string\" && !nodeRef.getAttribute(\"slot\")) {\n nodeRef.setAttribute(\"s-sn\", nodeRef[\"s-sn\"]);\n }\n } else if (nodeRef.nodeType === 3 /* TextNode */) {\n if (hostId === 0) {\n const textContent = (_a = nodeRef.nodeValue) == null ? void 0 : _a.trim();\n if (textContent === \"\") {\n orgLocationNode.remove();\n return;\n }\n }\n const commentBeforeTextNode = doc.createComment(childId);\n commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;\n insertBefore(nodeRef.parentNode, commentBeforeTextNode, nodeRef);\n } else if (nodeRef.nodeType === 8 /* CommentNode */) {\n const commentBeforeTextNode = doc.createComment(childId);\n commentBeforeTextNode.nodeValue = `${COMMENT_NODE_ID}.${childId}`;\n nodeRef.parentNode.insertBefore(commentBeforeTextNode, nodeRef);\n }\n }\n let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;\n const orgLocationParentNode = orgLocationNode.parentElement;\n if (orgLocationParentNode) {\n if (orgLocationParentNode[\"s-en\"] === \"\") {\n orgLocationNodeId += `.`;\n } else if (orgLocationParentNode[\"s-en\"] === \"c\") {\n orgLocationNodeId += `.c`;\n }\n }\n orgLocationNode.nodeValue = orgLocationNodeId;\n }\n });\n }\n};\nvar parseVNodeAnnotations = (doc, node, docData, orgLocationNodes) => {\n var _a;\n if (node == null) {\n return;\n }\n if (node[\"s-nr\"] != null) {\n orgLocationNodes.push(node);\n }\n if (node.nodeType === 1 /* ElementNode */) {\n const childNodes = [...Array.from(node.childNodes), ...Array.from(((_a = node.shadowRoot) == null ? void 0 : _a.childNodes) || [])];\n childNodes.forEach((childNode) => {\n const hostRef = getHostRef(childNode);\n if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) {\n const cmpData = {\n nodeIds: 0\n };\n insertVNodeAnnotations(doc, childNode, hostRef.$vnode$, docData, cmpData);\n }\n parseVNodeAnnotations(doc, childNode, docData, orgLocationNodes);\n });\n }\n};\nvar insertVNodeAnnotations = (doc, hostElm, vnode, docData, cmpData) => {\n if (vnode != null) {\n const hostId = ++docData.hostIds;\n hostElm.setAttribute(HYDRATE_ID, hostId);\n if (hostElm[\"s-cr\"] != null) {\n hostElm[\"s-cr\"].nodeValue = `${CONTENT_REF_ID}.${hostId}`;\n }\n if (vnode.$children$ != null) {\n const depth = 0;\n vnode.$children$.forEach((vnodeChild, index) => {\n insertChildVNodeAnnotations(doc, vnodeChild, cmpData, hostId, depth, index);\n });\n }\n if (hostElm && vnode && vnode.$elm$ && !hostElm.hasAttribute(HYDRATE_CHILD_ID)) {\n const parent = hostElm.parentElement;\n if (parent && parent.childNodes) {\n const parentChildNodes = Array.from(parent.childNodes);\n const comment = parentChildNodes.find(\n (node) => node.nodeType === 8 /* CommentNode */ && node[\"s-sr\"]\n );\n if (comment) {\n const index = parentChildNodes.indexOf(hostElm) - 1;\n vnode.$elm$.setAttribute(\n HYDRATE_CHILD_ID,\n `${comment[\"s-host-id\"]}.${comment[\"s-node-id\"]}.0.${index}`\n );\n }\n }\n }\n }\n};\nvar insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, index) => {\n const childElm = vnodeChild.$elm$;\n if (childElm == null) {\n return;\n }\n const nodeId = cmpData.nodeIds++;\n const childId = `${hostId}.${nodeId}.${depth}.${index}`;\n childElm[\"s-host-id\"] = hostId;\n childElm[\"s-node-id\"] = nodeId;\n if (childElm.nodeType === 1 /* ElementNode */) {\n childElm.setAttribute(HYDRATE_CHILD_ID, childId);\n if (typeof childElm[\"s-sn\"] === \"string\" && !childElm.getAttribute(\"slot\")) {\n childElm.setAttribute(\"s-sn\", childElm[\"s-sn\"]);\n }\n } else if (childElm.nodeType === 3 /* TextNode */) {\n const parentNode = childElm.parentNode;\n const nodeName = parentNode == null ? void 0 : parentNode.nodeName;\n if (nodeName !== \"STYLE\" && nodeName !== \"SCRIPT\") {\n const textNodeId = `${TEXT_NODE_ID}.${childId}`;\n const commentBeforeTextNode = doc.createComment(textNodeId);\n insertBefore(parentNode, commentBeforeTextNode, childElm);\n }\n } else if (childElm.nodeType === 8 /* CommentNode */) {\n if (childElm[\"s-sr\"]) {\n const slotName = childElm[\"s-sn\"] || \"\";\n const slotNodeId = `${SLOT_NODE_ID}.${childId}.${slotName}`;\n childElm.nodeValue = slotNodeId;\n }\n }\n if (vnodeChild.$children$ != null) {\n const childDepth = depth + 1;\n vnodeChild.$children$.forEach((vnode, index2) => {\n insertChildVNodeAnnotations(doc, vnode, cmpData, hostId, childDepth, index2);\n });\n }\n};\nexport {\n BUILD29 as BUILD,\n Build,\n Env,\n Fragment,\n H,\n H as HTMLElement,\n Host,\n NAMESPACE2 as NAMESPACE,\n STENCIL_DEV_MODE,\n addHostEventListeners,\n bootstrapLazy,\n cmpModules,\n connectedCallback,\n consoleDevError,\n consoleDevInfo,\n consoleDevWarn,\n consoleError,\n createEvent,\n defineCustomElement,\n disconnectedCallback,\n forceModeUpdate,\n forceUpdate,\n getAssetPath,\n getElement,\n getHostRef,\n getMode,\n getRenderingRef,\n getValue,\n h,\n insertVdomAnnotations,\n isMemberInElement,\n loadModule,\n modeResolutionChain,\n nextTick,\n parsePropertyValue,\n plt,\n postUpdateComponent,\n promiseResolve,\n proxyComponent,\n proxyCustomElement,\n readTask,\n registerHost,\n registerInstance,\n renderVdom,\n setAssetPath,\n setErrorHandler,\n setMode,\n setNonce,\n setPlatformHelpers,\n setPlatformOptions,\n setValue,\n styles,\n supportsConstructableStylesheets,\n supportsListenerOptions,\n supportsShadow,\n win,\n writeTask\n};\n","/**\n * @type {import('htmlfy').Config}\n */\nexport const CONFIG = {\n content_wrap: 0,\n ignore: [],\n ignore_with: '_!i-£___£%_',\n strict: false,\n tab_size: 2,\n tag_wrap: 0,\n tag_wrap_width: 80,\n trim: []\n}\n\nexport const CONTENT_IGNORE_STRING = '__!i-£___£%__'\nexport const IGNORE_STRING = '!i-£___£%_'\n\nexport const VOID_ELEMENTS = [\n 'area', 'base', 'br', 'col', 'embed', 'hr', \n 'img', 'input', 'link', 'meta',\n 'param', 'source', 'track', 'wbr'\n]\n","import { IGNORE_STRING, CONFIG, CONTENT_IGNORE_STRING } from './constants.js'\n\n/**\n * Checks if content contains at least one HTML element or custom HTML element.\n * \n * The first regex matches void and self-closing elements.\n * The second regex matches normal HTML elements, plus they can have a namespace.\n * The third regex matches custom HTML elemtns, plus they can have a namespace.\n * \n * HTML elements should begin with a letter, and can end with a letter or number.\n * \n * Custom elements must begin with a letter, and can end with a letter, number,\n * hyphen, underscore, or period. However, all letters must be lowercase.\n * They must have at least one hyphen, and can only have periods and underscores if there is a hyphen.\n * \n * These regexes are based on\n * https://w3c.github.io/html-reference/syntax.html#tag-name\n * and\n * https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n * respectively.\n * \n * @param {string} content Content to evaluate.\n * @returns {boolean} A boolean.\n */\nexport const isHtml = (content) => \n /<(?:[A-Za-z]+[A-Za-z0-9]*)(?:\\s+.*?)*?\\/{0,1}>/.test(content) ||\n /<(?<Element>(?:[A-Za-z]+[A-Za-z0-9]*:)?(?:[A-Za-z]+[A-Za-z0-9]*))(?:\\s+.*?)*?>(?:.|\\n)*?<\\/{1}\\k<Element>>/.test(content) || \n /<(?<Element>(?:[a-z][a-z0-9._]*:)?[a-z][a-z0-9._]*-[a-z0-9._-]+)(?:\\s+.*?)*?>(?:.|\\n)*?<\\/{1}\\k<Element>>/.test(content)\n\n/**\n * Generic utility which merges two objects.\n * \n * @param {any} current Original object.\n * @param {any} updates Object to merge with original.\n * @returns {any}\n */\nconst mergeObjects = (current, updates) => {\n if (!current || !updates)\n throw new Error(\"Both 'current' and 'updates' must be passed-in to mergeObjects()\")\n\n /**\n * @type {any}\n */\n let merged\n \n if (Array.isArray(current)) {\n merged = structuredClone(current).concat(updates)\n } else if (typeof current === 'object') {\n merged = { ...current }\n for (let key of Object.keys(updates)) {\n if (typeof updates[key] !== 'object') {\n merged[key] = updates[key]\n } else {\n /* key is an object, run mergeObjects again. */\n merged[key] = mergeObjects(merged[key] || {}, updates[key])\n }\n }\n }\n\n return merged\n}\n\n/**\n * Merge a user config with the default config.\n * \n * @param {import('htmlfy').Config} dconfig The default config.\n * @param {import('htmlfy').UserConfig} config The user config.\n * @returns {import('htmlfy').Config}\n */\nexport const mergeConfig = (dconfig, config) => {\n /**\n * We need to make a deep copy of `dconfig`,\n * otherwise we end up altering the original `CONFIG` because `dconfig` is a reference to it.\n */\n return mergeObjects(structuredClone(dconfig), config)\n}\n\n/**\n * \n * @param {string} html \n */\nexport const protectAttributes = (html) => {\n html = html.replace(/<[\\w:\\-]+([^>]*[^\\/])>/g, (/** @type {string} */match, /** @type {any} */capture) => {\n return match.replace(capture, (match) => {\n return match\n .replace(/\\n/g, IGNORE_STRING + 'nl!')\n .replace(/\\r/g, IGNORE_STRING + 'cr!')\n .replace(/\\s/g, IGNORE_STRING + 'ws!')\n })\n })\n\n return html\n}\n\n/**\n * \n * @param {string} html \n */\nexport const protectContent = (html) => {\n return html\n .replace(/\\n/g, CONTENT_IGNORE_STRING + 'nl!')\n .replace(/\\r/g, CONTENT_IGNORE_STRING + 'cr!')\n .replace(/\\s/g, CONTENT_IGNORE_STRING + 'ws!')\n}\n\n/**\n * \n * @param {string} html \n */\nexport const finalProtectContent = (html) => {\n const regex = /\\s*<([a-zA-Z0-9:-]+)[^>]*>\\n\\s*<\\/\\1>(?=\\n[ ]*[^\\n]*__!i-£___£%__[^\\n]*\\n)(\\n[ ]*\\S[^\\n]*\\n)|<([a-zA-Z0-9:-]+)[^>]*>(?=\\n[ ]*[^\\n]*__!i-£___£%__[^\\n]*\\n)(\\n[ ]*\\S[^\\n]*\\n\\s*)<\\/\\3>/g\n return html\n .replace(regex, (/** @type {string} */match, p1, p2, p3, p4) => {\n const text_to_protect = p2 || p4\n\n if (!text_to_protect)\n return match\n\n const protected_text = text_to_protect\n .replace(/\\n/g, CONTENT_IGNORE_STRING + 'nl!')\n .replace(/\\r/g, CONTENT_IGNORE_STRING + 'cr!')\n .replace(/\\s/g, CONTENT_IGNORE_STRING + \"ws!\");\n\n return match.replace(text_to_protect, protected_text)\n })\n}\n\n/**\n * Replace html brackets with ignore string.\n * \n * @param {string} html \n * @returns {string}\n */\nexport const setIgnoreAttribute = (html) => {\n const regex = /<([A-Za-z][A-Za-z0-9]*|[a-z][a-z0-9._]*-[a-z0-9._-]+)((?:\\s+[A-Za-z0-9_-]+=\"[^\"]*\"|\\s*[a-z]*)*)>/g\n\n html = html.replace(regex, (/** @type {string} */match, p1, p2) => {\n return match.replace(p2, (match) => {\n return match\n .replace(/</g, IGNORE_STRING + 'lt!')\n .replace(/>/g, IGNORE_STRING + 'gt!')\n })\n })\n \n return html\n}\n\n/**\n * Replace entities with ignore string.\n * \n * @param {string} html \n * @param {import('htmlfy').Config} config\n * @returns {string}\n */\nexport const setIgnoreElement = (html, config) => {\n const ignore = config.ignore\n const ignore_string = config.ignore_with\n\n for (let e = 0; e < ignore.length; e++) {\n const regex = new RegExp(`<${ignore[e]}[^>]*>((.|\\n)*?)<\\/${ignore[e]}>`, \"g\")\n\n html = html.replace(regex, (/** @type {string} */match, /** @type {any} */capture) => {\n return match.replace(capture, (match) => {\n return match\n .replace(/</g, '-' + ignore_string + 'lt-')\n .replace(/>/g, '-' + ignore_string + 'gt-')\n .replace(/\\n/g, '-' + ignore_string + 'nl-')\n .replace(/\\r/g, '-' + ignore_string + 'cr-')\n .replace(/\\s/g, '-' + ignore_string + 'ws-')\n })\n })\n }\n \n return html\n}\n\n/**\n * Trim leading and trailing whitespace characters.\n * \n * @param {string} html\n * @param {string[]} trim\n * @returns {string}\n */\nexport const trimify = (html, trim) => {\n for (let e = 0; e < trim.length; e++) {\n /* Whitespace character must be escaped with '\\' or RegExp() won't include it. */\n const leading_whitespace = new RegExp(`(<${trim[e]}[^>]*>)\\\\s+`, \"g\")\n const trailing_whitespace = new RegExp(`\\\\s+(</${trim[e]}>)`, \"g\")\n\n html = html\n .replace(leading_whitespace, '$1')\n .replace(trailing_whitespace, '$1')\n }\n\n return html\n}\n\n/**\n * \n * @param {string} html \n */\nexport const unprotectAttributes = (html) => {\n html = html.replace(/<[\\w:\\-]+([^>]*[^\\/])>/g, (/** @type {string} */match, /** @type {any} */capture) => {\n return match.replace(capture, (match) => {\n return match\n .replace(new RegExp(IGNORE_STRING + 'nl!', \"g\"), '\\n')\n .replace(new RegExp(IGNORE_STRING + 'cr!', \"g\"), '\\r')\n .replace(new RegExp(IGNORE_STRING + 'ws!', \"g\"), ' ')\n })\n })\n\n return html\n}\n\n/**\n * \n * @param {string} html \n */\nexport const unprotectContent = (html) => {\n html = html.replace(/.*__!i-£___£%__[a-z]{2}!.*/g, (/** @type {string} */match) => {\n return match.replace(/__!i-£___£%__[a-z]{2}!/g, (match) => {\n return match\n .replace(new RegExp(CONTENT_IGNORE_STRING + 'nl!', \"g\"), '\\n')\n .replace(new RegExp(CONTENT_IGNORE_STRING + 'cr!', \"g\"), '\\r')\n .replace(new RegExp(CONTENT_IGNORE_STRING + 'ws!', \"g\"), ' ')\n })\n })\n\n return html\n}\n\n/**\n * Replace ignore string with html brackets.\n * \n * @param {string} html \n * @returns {string}\n */\nexport const unsetIgnoreAttribute = (html) => {\n html = html.replace(/<[\\w:\\-]+([^>]*)>/g, (/** @type {string} */match, /** @type {any} */capture) => {\n return match.replace(capture, (match) => {\n return match\n .replace(new RegExp(IGNORE_STRING + 'lt!', \"g\"), '<')\n .replace(new RegExp(IGNORE_STRING + 'gt!', \"g\"), '>')\n })\n })\n \n return html\n}\n\n/**\n * Replace ignore string with entities.\n * \n * @param {string} html \n * @param {import('htmlfy').Config} config\n * @returns {string}\n */\nexport const unsetIgnoreElement = (html, config) => {\n const ignore = config.ignore\n const ignore_string = config.ignore_with\n\n for (let e = 0; e < ignore.length; e++) {\n const regex = new RegExp(`<${ignore[e]}[^>]*>((.|\\n)*?)<\\/${ignore[e]}>`, \"g\")\n\n html = html.replace(regex, (/** @type {string} */match, /** @type {any} */capture) => {\n return match.replace(capture, (match) => {\n return match\n .replace(new RegExp('-' + ignore_string + 'lt-', \"g\"), '<')\n .replace(new RegExp('-' + ignore_string + 'gt-', \"g\"), '>')\n .replace(new RegExp('-' + ignore_string + 'nl-', \"g\"), '\\n')\n .replace(new RegExp('-' + ignore_string + 'cr-', \"g\"), '\\r')\n .replace(new RegExp('-' + ignore_string + 'ws-', \"g\"), ' ')\n })\n })\n }\n \n return html\n}\n\n/**\n * Validate any passed-in config options and merge with CONFIG.\n * \n * @param {import('htmlfy').UserConfig} config A user config.\n * @returns {import('htmlfy').Config} A validated config.\n */\nexport const validateConfig = (config) => {\n if (typeof config !== 'object') throw new Error('Config must be an object.')\n\n const config_empty = !(\n Object.hasOwn(config, 'content_wrap') ||\n Object.hasOwn(config, 'ignore') || \n Object.hasOwn(config, 'ignore_with') || \n Object.hasOwn(config, 'strict') || \n Object.hasOwn(config, 'tab_size') || \n Object.hasOwn(config, 'tag_wrap') || \n Object.hasOwn(config, 'tag_wrap_width') || \n Object.hasOwn(config, 'trim')\n )\n\n if (config_empty) return CONFIG\n\n let tab_size = config.tab_size\n\n if (tab_size) {\n if (typeof tab_size !== 'number') throw new Error(`tab_size must be a number, not ${typeof config.tab_size}.`)\n\n const safe = Number.isSafeInteger(tab_size)\n if (!safe) throw new Error(`Tab size ${tab_size} is not safe. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger for more info.`)\n\n /** \n * Round down, just in case a safe floating point,\n * like 4.0, was passed.\n */\n tab_size = Math.floor(tab_size)\n if (tab_size < 1 || tab_size > 16) throw new Error('Tab size out of range. Expecting 1 to 16.')\n \n config.tab_size = tab_size\n }\n\n if (Object.hasOwn(config, 'content_wrap') && typeof config.content_wrap !== 'number')\n throw new Error(`content_wrap config must be a number, not ${typeof config.tag_wrap_width}.`)\n\n if (Object.hasOwn(config, 'ignore') && (!Array.isArray(config.ignore) || !config.ignore?.every((e) => typeof e === 'string')))\n throw new Error('Ignore config must be an array of strings.')\n\n if (Object.hasOwn(config, 'ignore_with') && typeof config.ignore_with !== 'string')\n throw new Error(`Ignore_with config must be a string, not ${typeof config.ignore_with}.`)\n\n if (Object.hasOwn(config, 'strict') && typeof config.strict !== 'boolean')\n throw new Error(`Strict config must be a boolean, not ${typeof config.strict}.`)\n\n /* TODO remove in v0.9.0 */\n if (Object.hasOwn(config, 'tag_wrap') && typeof config.tag_wrap === 'boolean') {\n console.warn('tag_wrap as a boolean is deprecated, and will not be supported in v0.9.0+. Use `tag_wrap: <number>` instead; where <number> is the max character width acceptable before wrapping attributes.')\n if (config.tag_wrap_width)\n config.tag_wrap = config.tag_wrap_width\n else\n config.tag_wrap = CONFIG.tag_wrap_width\n }\n \n if (Object.hasOwn(config, 'tag_wrap') && typeof config.tag_wrap !== 'number')\n throw new Error(`tag_wrap config must be a number, not ${typeof config.tag_wrap}.`)\n\n /* TODO remove in v0.9.0 */\n if (Object.hasOwn(config, 'tag_wrap_width'))\n console.warn('tag_wrap_width is deprecated, and will not be supported in v0.9.0+. Use `tag_wrap: <number>` instead; where <number> is the max character width acceptable before wrapping attributes.')\n\n /* TODO remove in v0.9.0 */\n if (Object.hasOwn(config, 'tag_wrap_width') && typeof config.tag_wrap_width !== 'number')\n throw new Error(`tag_wrap_width config must be a number, not ${typeof config.tag_wrap_width}.`)\n\n if (Object.hasOwn(config, 'trim') && (!Array.isArray(config.trim) || !config.trim?.every((e) => typeof e === 'string')))\n throw new Error('Trim config must be an array of strings.')\n\n return mergeConfig(CONFIG, config)\n\n}\n\n/**\n * \n * @param {string} text \n * @param {number} width \n * @param {string} indent\n */\nexport const wordWrap = (text, width, indent) => {\n const words = text.trim().split(/\\s+/)\n \n if (words.length === 0 || (words.length === 1 && words[0] === ''))\n return \"\"\n\n const lines = []\n let current_line = \"\"\n const padding_string = indent\n\n words.forEach((word) => {\n if (word === \"\") return\n\n if (word.length >= width) {\n /* If there's content on the current line, push it first with correct padding. */\n if (current_line !== \"\")\n lines.push(lines.length === 0 ? indent + current_line : padding_string + current_line)\n\n /* Push a long word on its own line with correct padding. */\n lines.push(lines.length === 0 ? indent + word : padding_string + word)\n current_line = \"\" // Reset current line\n return // Move to the next word\n }\n\n /* Check if adding the next word exceeds the wrap width. */\n const test_line = current_line === \"\" ? word : current_line + \" \" + word\n\n if (test_line.length <= width) {\n current_line = test_line\n } else {\n /* Word doesn't fit, finish the current line and push it. */\n if (current_line !== \"\") {\n /* Add padding based on whether it's the first line added or not. */\n lines.push(lines.length === 0 ? indent + current_line : padding_string + current_line)\n }\n /* Start a new line with the current word. */\n current_line = word\n }\n })\n\n /* Add the last remaining line with appropriate padding. */\n if (current_line !== \"\")\n lines.push(lines.length === 0 ? indent + current_line : padding_string + current_line)\n\n const result = lines.join(\"\\n\")\n\n return protectContent(result)\n}\n","import { VOID_ELEMENTS } from \"./constants.js\"\nimport { isHtml } from \"./utils.js\"\n\n/**\n * Ensure void elements are \"self-closing\".\n * \n * @param {string} html The HTML string to evaluate.\n * @param {boolean} check_html Check to see if the content contains any HTML, before processing.\n * @returns {string}\n * @example <br> => <br />\n */\nexport const closify = (html, check_html = true) => {\n if (check_html && !isHtml(html)) return html\n \n return html.replace(/<([a-zA-Z\\-0-9:]+)[^>]*>/g, (match, name) => {\n if (VOID_ELEMENTS.indexOf(name) > -1)\n return (`${match.substring(0, match.length - 1)} />`).replace(/\\/\\s\\//g, '/')\n\n return match.replace(/[\\s]?\\/>/g, `></${name}>`)\n })\n}\n","/**\n * Enforce entity characters for textarea content.\n * To also minifiy, pass `minify` as `true`.\n * \n * @param {string} html The HTML string to evaluate.\n * @param {boolean} [minify] Fully minifies the content of textarea elements. \n * Defaults to `false`. We recommend a value of `true` if you're running `entify()` \n * as a standalone function.\n * @returns {string}\n * @example <textarea>3 > 2</textarea> => <textarea>3 > 2</textarea>\n */\nexport const entify = (html, minify = false) => {\n /** \n * Use entities inside textarea content.\n */\n html = html.replace(/<textarea[^>]*>((.|\\n)*?)<\\/textarea>/g, (match, capture) => {\n return match.replace(capture, (match) => {\n return match\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(/\\n/g, ' ')\n .replace(/\\r/g, ' ')\n .replace(/\\s/g, ' ')\n })\n })\n\n /* Typical minification, but only for textareas. */\n if (minify) {\n html = html.replace(/<textarea[^>]*>((.|\\n)*?)<\\/textarea>/g, (match, capture) => {\n /* Replace things inside the textarea content. */\n match = match.replace(capture, (match) => {\n return match\n .replace(/\\n|\\t/g, '')\n .replace(/[a-z]+=\"\\s*\"/ig, '')\n .replace(/>\\s+</g, '><')\n .replace(/\\s+/g, ' ')\n })\n\n /* Replace things in the entire element */\n match = match\n .replace(/\\s+/g, ' ')\n .replace(/\\s>/g, '>')\n .replace(/>\\s/g, '>')\n .replace(/\\s</g, '<')\n .replace(/class=[\"']\\s/g, (match) => match.replace(/\\s/g, ''))\n .replace(/(class=.*)\\s([\"'])/g, '$1'+'$2')\n return match\n })\n }\n\n return html\n}\n","import { entify } from \"./entify.js\"\nimport { isHtml } from \"./utils.js\"\n\n/**\n * Creates a single-line HTML string\n * by removing line returns, tabs, and relevant spaces.\n * \n * @param {string} html The HTML string to minify.\n * @param {boolean} check_html Check to see if the content contains any HTML, before processing.\n * @returns {string} A minified HTML string.\n */\nexport const minify = (html, check_html = true) => {\n if (check_html && !isHtml(html)) return html\n\n /**\n * Ensure textarea content is specially minified and protected\n * before general minification.\n */\n html = entify(html)\n\n /* All other minification. */\n // Remove ALL newlines and tabs explicitly.\n html = html.replace(/\\n|\\t/g, '')\n\n // Remove whitespace ONLY between tags.\n html = html.replace(/>\\s+</g, \"><\")\n\n // Collapse any remaining multiple spaces to single spaces.\n html = html.replace(/ {2,}/g, ' ')\n\n // Remove specific single spaces OR whitespace within closing tags.\n html = html.replace(/ >/g, \">\") // <tag > -> <tag>\n html = html.replace(/ </g, \"<\") // Text < -> Text< (Also handles leading space before tag)\n html = html.replace(/> /g, \">\") // > Text -> >Text\n html = html.replace(/<\\s*\\//g, '</') // < /tag -> </tag>\n\n // Trim spaces around equals signs in attributes (run before value trim)\n // This handles `attr = \"value\"` -> `attr=\"value\"`\n html = html.replace(/ = /g, \"=\")\n // Consider safer alternatives if needed (e.g., / = \"/g, '=\"')\n\n // Trim whitespace inside attribute values\n html = html.replace(\n /([a-zA-Z0-9_-]+)=(['\"])(.*?)\\2/g,\n (match, attr_name, quote, value) => {\n // value.trim() handles both leading/trailing spaces\n // and cases where the value is only whitespace (becomes empty string)\n const trimmed_value = value.trim()\n return `${attr_name}=${quote}${trimmed_value}${quote}`\n }\n )\n\n // Final trim for the whole string\n html = html.trim()\n\n return html\n}\n","import { closify } from './closify.js'\nimport { minify } from './minify.js'\nimport { \n finalProtectContent,\n isHtml, \n protectAttributes, \n setIgnoreAttribute, \n setIgnoreElement, \n trimify, \n unprotectAttributes, \n unprotectContent, \n unsetIgnoreAttribute, \n unsetIgnoreElement, \n validateConfig, \n wordWrap\n} from './utils.js'\nimport { CONFIG, VOID_ELEMENTS } from './constants.js'\n\n/**\n * @type {boolean}\n */\nlet strict\n\n/**\n * @type {string[]}\n */\nlet trim\n\n/**\n * @type {{ line: Record<string,string>[] }}\n */\nconst convert = {\n line: []\n}\n\n/**\n * Isolate tags, content, and comments.\n * \n * @param {string} html The HTML string to evaluate.\n * @returns {string}\n * @example <div>Hello World!</div> => \n * [#-# : 0 : <div> : #-#]\n * Hello World!\n * [#-# : 1 : </div> : #-#]\n */\nconst enqueue = (html) => {\n convert.line = []\n let i = -1\n /* Regex to find tags OR text content between tags. */\n const regex = /(<[^>]+>)|([^<]+)/g\n\n html = html.replace(regex, (match, c1, c2) => {\n if (c1) {\n convert.line.push({ type: \"tag\", value: match })\n } else if (c2 && c2.trim().length > 0) {\n /* It's text content (and not just whitespace). */\n convert.line.push({ type: \"text\", value: match })\n }\n\n i++\n return `\\n[#-# : ${i} : ${match} : #-#]\\n`\n })\n\n return html\n};\n\n/**\n * Preprocess the HTML.\n * \n * @param {string} html The HTML string to preprocess.\n * @returns {string}\n */\nconst preprocess = (html) => {\n html = closify(html, false)\n\n if (trim.length > 0) html = trimify(html, trim)\n\n html = minify(html, false)\n html = enqueue(html)\n\n return html\n}\n\n/**\n * \n * @param {string} html The HTML string to process.\n * @param {import('htmlfy').Config} config \n * @returns {string}\n */\nconst process = (html, config) => {\n const step = \" \".repeat(config.tab_size)\n const tag_wrap = config.tag_wrap\n const content_wrap = config.content_wrap\n\n /* Track current number of indentations needed. */\n let indents = ''\n\n /** @type string[] */\n const output_lines = []\n const tag_regex = /<[A-Za-z]+\\b[^>]*(?:.|\\n)*?\\/?>/g /* Is opening tag or void element. */\n const attribute_regex = /\\s{1}[A-Za-z-]+(?:=\".*?\")?/g /* Matches all tag/element attributes. */\n const preserve_whitespace_tags = new Set([\"pre\", \"textarea\", \"script\", \"style\"])\n\n /* Process lines and indent. */\n convert.line.forEach((source, index) => {\n let current_line_value = source.value\n let subtrahend = 0\n const prev_line_data = convert.line[index - 1]\n const prev_line_value = prev_line_data?.value ?? \"\" // Use empty string if no prev line\n\n /**\n * Arbitratry character, to keep track of the string's length.\n */\n indents += '0'\n\n if (index === 0) subtrahend++\n /* We're processing a closing tag. */\n if (current_line_value.trim().startsWith(\"</\")) subtrahend++\n /* prevLine is a doctype declaration. */\n if (prev_line_value.trim().startsWith(\"<!doctype\")) subtrahend++\n /* prevLine is a comment. */\n if (prev_line_value.trim().startsWith(\"<!--\")) subtrahend++\n /* prevLine is a self-closing tag. */\n if (prev_line_value.trim().endsWith(\"/>\")) subtrahend++\n /* prevLine is a closing tag. */\n if (prev_line_value.trim().startsWith(\"</\")) subtrahend++\n /* prevLine is text. */\n if (prev_line_data?.type === \"text\") subtrahend++\n\n /* Determine offset for line indentation. */\n const offset = Math.max(0, indents.length - subtrahend)\n /* Correct indent level for *this* line's content */\n const current_indent_level = offset // Store the level for this line\n\n indents = indents.substring(0, current_indent_level) // Adjust for *next* round\n const padding = step.repeat(current_indent_level)\n\n /* Remove comment. */\n if (strict && current_line_value.trim().startsWith(\"<!--\"))\n return\n\n let result = current_line_value\n\n if (\n source.type === 'text' && \n content_wrap > 0 && \n result.length >= content_wrap\n ) {\n result = wordWrap(result, content_wrap, padding)\n }\n /* Wrap the attributes of open tags and void elements. */\n else if (\n tag_wrap > 0 &&\n result.length > tag_wrap &&\n tag_regex.test(result)\n ) {\n tag_regex.lastIndex = 0; // Reset stateful regex\n attribute_regex.lastIndex = 0; // Reset stateful regex\n\n const tag_parts = result.split(attribute_regex).filter(Boolean)\n\n if (tag_parts.length >= 2) {\n const attributes = result.matchAll(attribute_regex)\n const inner_padding = padding + step\n let wrapped_tag = padding + tag_parts[0] + \"\\n\"\n\n for (const a of attributes) {\n const attribute_string = a[0].trim()\n wrapped_tag += inner_padding + attribute_string + \"\\n\"\n }\n\n const tag_name_match = tag_parts[0].match(/<([A-Za-z_:-]+)/)\n const tag_name = tag_name_match ? tag_name_match[1] : \"\"\n const is_void = VOID_ELEMENTS.includes(tag_name)\n const closing_part = tag_parts[1].trim()\n const closing_padding = padding + (strict && is_void ? \" \" : \"\") // Add space if void/strict\n\n wrapped_tag += closing_padding + closing_part\n\n result = wrapped_tag // Assign the fully wrapped string\n } else {\n result = padding + result\n }\n } else {\n /* Apply simple indentation (if no wrapping occurred) */\n result = padding + result\n }\n\n /* Add the processed line (or lines if wordWrap creates them) to the output */\n output_lines.push(result)\n })\n\n /* Join all processed lines into the final HTML string */\n let final_html = output_lines.join(\"\\n\")\n\n /* Preserve wrapped attributes. */\n if (tag_wrap > 0) final_html = protectAttributes(final_html)\n\n /* Extra preserve wrapped content. */\n if (content_wrap > 0 && /\\n[ ]*[^\\n]*__!i-£___£%__[^\\n]*\\n/.test(final_html))\n final_html = finalProtectContent(final_html)\n\n /* Remove line returns, tabs, and consecutive spaces within html elements or their content. */\n final_html = final_html.replace(\n /<(?<Element>.+).*>[^<]*?[^><\\/\\s][^<]*?<\\/{1}\\k<Element>|<script[^>]*>\\s+<\\/script>|<(\\w+)>\\s+<\\/(\\w+)|<(?:([\\w:\\._-]+)|([\\w:\\._-]+)[^>]*[^\\/])>\\s+<\\/([\\w:\\._-]+)>/g,\n match => match.replace(/\\n|\\t|\\s{2,}/g, '')\n )\n\n /* Revert wrapped content. */\n if (content_wrap > 0) final_html = unprotectContent(final_html)\n\n /* Revert wrapped attributes. */\n if (tag_wrap > 0) final_html = unprotectAttributes(final_html)\n\n /* Remove self-closing nature of void elements. */\n if (strict) final_html = final_html.replace(/\\s\\/>|\\/>/g, '>')\n\n /* Trim leading and/or trailing line returns. */\n if (final_html.startsWith(\"\\n\")) final_html = final_html.substring(1)\n if (final_html.endsWith(\"\\n\")) final_html = final_html.substring(0, final_html.length - 1)\n\n return final_html\n}\n\n/**\n * Format HTML with line returns and indentations.\n * \n * @param {string} html The HTML string to prettify.\n * @param {import('htmlfy').UserConfig} [config] A user configuration object.\n * @returns {string} A well-formed HTML string.\n */\nexport const prettify = (html, config) => {\n /* Return content as-is if it does not contain any HTML elements. */\n if (!isHtml(html)) return html\n\n const validated_config = config ? validateConfig(config) : CONFIG\n strict = validated_config.strict\n\n const ignore = validated_config.ignore.length > 0\n trim = validated_config.trim\n\n /* Preserve ignored elements. */\n if (ignore) html = setIgnoreElement(html, validated_config)\n\n /* Preserve html text within attribute values. */\n html = setIgnoreAttribute(html)\n\n html = preprocess(html)\n html = process(html, validated_config)\n\n /* Revert html text within attribute values. */\n html = unsetIgnoreAttribute(html)\n\n /* Revert ignored elements. */\n if (ignore) html = unsetIgnoreElement(html, validated_config)\n\n return html\n}\n","import { renderVdom } from '@stencil/core/internal/client';\nimport type { VNode } from '@stencil/core';\nimport { ArgsType } from './index.conf';\nimport { JsonDocs, JsonDocsComponent, JsonDocsProp } from '@stencil/core/internal';\nimport { prettify } from 'htmlfy';\n\n/**\n * Render attribute on the given element\n * @param element - targeted to render attribute\n * @param name - of the attribute\n * @param value - of the attribute\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst renderAttribute = (element: HTMLElement, name: string, value: any): void => {\n if ([null, undefined, '', false].includes(value) || ['innerHTML', 'style', ''].includes(name)) {\n return;\n }\n element.setAttribute(name, !['object', 'function'].includes(typeof value) ? value : `⚠️ Property must be set through a script or a framework-specific syntax.`);\n};\n\n/**\n * Render new element in parent element\n * @param parentNode - HTML element\n * @param tagName - of the new element\n * @param attributes - of the new element\n * @param children - of the new element\n * @param text - of the new element\n */\nconst renderElement = (parentNode: HTMLElement, tagName: VNode['$tag$'], attributes: VNode['$attrs$'], children: VNode[], text: VNode['$text$']): void => {\n // render HTML\n if (tagName && typeof tagName === 'string') {\n const element = document.createElement(tagName);\n Object.keys(attributes || {}).forEach(attr => {\n renderAttribute(element, attr, attributes[attr]);\n });\n\n children?.forEach(child => {\n renderElement(element, child.$tag$, child.$attrs$, child.$children$, child.$text$);\n });\n\n if (attributes?.innerHTML) element.innerHTML = attributes.innerHTML;\n\n parentNode.appendChild(element);\n }\n // render text\n if (text) {\n parentNode.innerHTML = text;\n }\n};\n\n/**\n * Filter default argument on component argument to prevent them to be rendered\n * @param args - all possible args with custom values\n * @param defaultValues - component default args values\n * @param slots - slots\n * @returns filtres args\n * @example\n * ```ts\n * import { filterArgs } from '@mgdis/stencil-helpers';\n * const Template = (args: MgBadgeType): HTMLElement => <mg-badge {...filterArgs(args, { variant: 'info' }, ['actions'])}></mg-badge>;\n * ```\n */\nexport const filterArgs = <T>(args: T, defaultValues?: Partial<T>, slots: string[] = []): T => {\n const filteredArgs = {} as { [key: string]: unknown };\n if (typeof args !== 'object') {\n throw new Error(\"filterArgs - args isn't an object.\");\n }\n for (const k in args) {\n if (!slots.includes(k)) {\n const arg = args[k];\n // Change camelCase k to kebab-case\n const key = k.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n if (!defaultValues || !Object.keys(defaultValues).includes(k) || defaultValues[k] !== arg) {\n filteredArgs[key] = arg;\n }\n }\n }\n return filteredArgs as T;\n};\n\n/**\n * Storybook stencil wrapper. Used to target element with `storybook-root` id and render virtual DOM inside.\n * @param storyFn - storybook render function\n * @param context - storybook context\n * @returns rendered element\n * @example\n * ```ts\n * // .storybook/preview.ts\n * import { stencilWrapper } from '@mgdis/stencil-helpers';\n * export const decorators: Preview['decorators'] = [stencilWrapper];\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const stencilWrapper = (storyFn: (ctx: any) => void, context: ArgsType): Element | undefined => {\n const host = document.getElementById('storybook-root');\n if (host === null) return;\n\n // update local switcher based on context variable\n document.querySelector('[lang]')?.setAttribute('lang', (context.globals as { locale: string })?.locale || 'en');\n\n renderVdom(\n {\n $ancestorComponent$: undefined,\n $flags$: 0,\n $modeName$: undefined,\n $cmpMeta$: {\n $flags$: 0,\n $tagName$: host.tagName,\n },\n $hostElement$: host,\n },\n storyFn(context),\n );\n return host.children[host.children.length - 1];\n};\n\n/**\n * Get story HTML from virtual DOM.\n * Mainly used to render, component code exemple in stories.\n * @param vitualNode - story virtual DOM\n * @returns stringified rendered HTML\n * @example\n * ```ts\n * // .storybook/preview.ts\n * import { getStoryHTML } from '@mgdis/stencil-helpers';\n *\n * export const parameters: Preview['parameters'] = {\n * docs: {\n * source: {\n * transform: (_, ctx) => getStoryHTML(ctx.originalStoryFn(ctx.args)),\n * }\n * },\n * };\n * ```\n */\nexport const getStoryHTML = ({ $tag$, $attrs$, $children$, $text$ }: VNode): string => {\n const host = document.createElement('div');\n\n renderElement(host, $tag$, $attrs$, $children$, $text$);\n\n return prettify(host.innerHTML, {\n tag_wrap: 40,\n content_wrap: 120,\n }).replace(/=\"true\"/g, '');\n};\n\n/**\n * Retrieve Component Storybook URL from file path\n * @param storybookBaseUrl - Storybook Base URL\n * @param filePath - Component file path\n * @returns Component Storybook URL\n */\nexport const getStorybookUrl = (storybookBaseUrl: string, filePath: string | undefined): string | undefined => {\n if (!filePath) {\n return;\n }\n const split = filePath.split('/');\n return `${storybookBaseUrl}${split.slice(2, split.length - 1).join('-')}--docs`;\n};\n\nexport class StorybookPreview {\n /**\n * JsonDocs\n */\n jsonDoc: JsonDocs;\n\n constructor(jsonDoc: JsonDocs) {\n this.jsonDoc = jsonDoc;\n }\n\n /**\n * Get component data from the jsonDoc\n * @param tagName - tag name we want to get the data from\n * @returns component data\n */\n #getComponentData = (tagName: string): JsonDocsComponent | undefined => {\n return this.jsonDoc.components.find(component => component.tag === tagName);\n };\n\n /**\n * Get the control for the given prop\n * Based on https://storybook.js.org/docs/api/arg-types#controltype\n * @param prop - prop to get control for\n * @returns control type and options if applicable\n */\n #getPropControl = (prop: JsonDocsProp) => {\n // Get types\n const types: (string | undefined)[] = prop.type\n .replace(/\"([^\"]+)\"/g, '$1') // Remove quotes\n .replace(/\\s/g, '') // Remove all whitespace for simplicity\n .replace(/\\(.*?\\)/g, match => match.replace(/\\|/g, ' OR ')) // Replace '|' inside parentheses\n .split('|')\n .map(type => type.trim().replace(/ OR /g, '|')); // Revert ' OR ' back to '|'\n\n // Return control and options\n if (prop.type === 'string') {\n return { control: { type: 'text' } };\n } else if (prop.type === 'number') {\n return { control: { type: 'number' } };\n } else if (prop.type === 'boolean') {\n return { control: { type: 'boolean' } };\n } else if (prop.type.startsWith('{') && prop.type.endsWith('}')) {\n return { control: { type: 'object' } };\n } else if (types.length > 1) {\n // Manage case when multiple types are possible\n if (types.includes('string')) {\n return { control: { type: 'text' } };\n } else if (types.every(type => type?.includes('[]'))) {\n return { control: { type: 'object' } };\n } else {\n // Add the posibility to set undefined\n types.unshift(undefined);\n return { control: { type: 'select' }, options: types };\n }\n } else return { control: { type: 'object' } };\n };\n\n /**\n * Extract component arg types from the component data\n * @param tagName - tag name we want to extract the arg types from\n * @returns component arg types\n */\n extractArgTypes = (tagName: string) => {\n const componentData = this.#getComponentData(tagName);\n\n // Extract props arg types\n const componentPropsArgTypes = componentData?.props.reduce((acc, prop) => {\n // Get Controls\n const { control, options } = this.#getPropControl(prop);\n // Set Component ArgTypes\n return {\n ...acc,\n [prop.name]: {\n name: prop.attr || prop.name,\n description: prop.docs,\n type: { required: prop.required },\n table: {\n category: 'props',\n type: { summary: prop.type },\n defaultValue: { summary: prop.default },\n },\n control,\n options,\n },\n };\n }, {});\n\n // Extract events arg types\n const componentEventsArgTypes = componentData?.events.reduce(\n (acc, event) => ({\n ...acc,\n [event.event]: {\n name: event.event,\n description: event.docs,\n table: {\n category: 'events',\n type: { summary: event.detail },\n },\n },\n }),\n {},\n );\n\n // Extracts Methods arg types\n const componentMethodsArgTypes = componentData?.methods.reduce(\n (acc, method) => ({\n ...acc,\n [method.name]: {\n name: method.name,\n description: method.docs,\n table: {\n category: 'methods',\n type: { summary: method.signature },\n },\n },\n }),\n {},\n );\n\n // Extracts Slots arg types\n const componentSlotsArgTypes = componentData?.slots.reduce(\n (acc, slot) => ({\n ...acc,\n [slot.name]: {\n name: slot.name !== '' ? slot.name : 'default', // default slot are unnamed\n description: slot.docs,\n table: {\n category: 'slots',\n type: { summary: undefined },\n },\n },\n }),\n {},\n );\n\n // Extracts CSS Properties arg types\n const componentCSSPropArgTypes = componentData?.styles.reduce(\n (acc, style) => ({\n ...acc,\n [style.name]: {\n name: style.name,\n description: style.docs,\n table: {\n category: 'custom properties',\n type: { summary: undefined },\n },\n },\n }),\n {},\n );\n\n // Extract component dependencies\n const componentDependencies = componentData?.dependencies.reduce((acc, dependency) => {\n const dependencyData = this.#getComponentData(dependency);\n if (!dependencyData) return acc; // Prevents from adding internal dependency\n return {\n ...acc,\n [dependency]: {\n name: dependency,\n description: `<a href=\"./?path=/docs/${getStorybookUrl('', dependencyData?.filePath)}\">View Component Documentation</a>`,\n table: {\n category: 'depends on',\n type: { summary: undefined },\n },\n },\n };\n }, {});\n\n // Extract dependents components\n const componentDependents = componentData?.dependents.reduce((acc, dependent) => {\n const dependentData = this.#getComponentData(dependent);\n if (!dependentData) return acc; // Prevents from adding internal dependent\n return {\n ...acc,\n [dependent]: {\n name: dependent,\n description: `<a href=\"./?path=/docs/${getStorybookUrl('', dependentData?.filePath)}\">View Component Documentation</a>`,\n table: {\n category: 'used by',\n type: { summary: undefined },\n },\n },\n };\n }, {});\n\n return {\n ...componentPropsArgTypes,\n ...componentEventsArgTypes,\n ...componentMethodsArgTypes,\n ...componentSlotsArgTypes,\n ...componentCSSPropArgTypes,\n ...componentDependencies,\n ...componentDependents,\n };\n };\n\n /**\n * Extract component description from the component data\n * @param tagName - tag name we want to extract the description from\n * @returns component description\n */\n extractComponentDescription = (tagName: string) => {\n const componentData = this.#getComponentData(tagName);\n return componentData?.readme || componentData?.docs;\n };\n}\n","import { JsonDocs, JsonDocsComponent, JsonDocsProp } from '@stencil/core/internal';\nimport { getStorybookUrl } from '../storybook';\n\n/**\n * Retrieve Component source URL from file path\n * @param sourcesBaseUrl - Source base URL\n * @param filePath - Component file path\n * @returns Component source URL\n */\nconst getSourcesUrl = (sourcesBaseUrl: string, filePath: string | undefined): string | undefined => {\n if (!filePath) {\n return;\n }\n return `${sourcesBaseUrl}${filePath}`;\n};\n\n/**\n * Get Component element description\n * @param component - Component\n * @returns Component element description\n */\nconst getElementDescription = (component: JsonDocsComponent): string => {\n // Init description\n let description = component.overview ? `${component.overview}\\n\\n` : '';\n // Attributes\n const attributes = component.props.filter(({ attr }) => attr !== undefined);\n if (attributes.length) {\n description += `Attributes:\\n`;\n description += attributes.map(({ attr, docs }) => `- \\`${attr}\\`: ${docs}\\n`).join('');\n description += '\\n';\n }\n // Properties\n const properties = component.props.filter(({ attr }) => attr === undefined);\n if (properties.length) {\n description += `Properties:\\n`;\n description += properties.map(({ name, docs }) => `- \\`${name}\\`: ${docs}\\n`).join('');\n description += '\\n';\n }\n // Methods\n if (component.methods.length) {\n description += `Methods:\\n`;\n description += component.methods.map(({ name, docs }) => `- \\`${name}\\`: ${docs}\\n`).join('');\n description += '\\n';\n }\n // Events\n if (component.events.length) {\n description += `Events:\\n`;\n description += component.events.map(({ event, docs }) => `- \\`${event}\\`: ${docs}\\n`).join('');\n description += '\\n';\n }\n // Listeners\n if (component.listeners.length) {\n description += `Listeners:\\n`;\n description += component.listeners.map(({ event }) => `- \\`${event}\\`\\n`).join('');\n description += '\\n';\n }\n // Slots\n if (component.slots.length) {\n description += `Slots:\\n`;\n description += component.slots.map(({ name, docs }) => `- \\`${name}\\`: ${docs}\\n`).join('');\n description += '\\n';\n }\n // Return\n return description;\n};\n\n/**\n * Get Props Description\n * @param prop - Component Property\n * @returns Props Description\n */\nconst getAttributeDescription = (prop: JsonDocsProp): string => {\n return `${prop.docs}\\n\\nType: \\`${prop.type}\\``;\n};\n\n/**\n * Generate Web Types metadata for IntelliJ's IDE\n * @param name - Library name\n * @param version - Library version\n * @param jsonDocs - Stencil JSON doc\n * @param storybookBaseUrl - Storybook Base Url\n * @returns Web Types metadata\n * @example\n * ```ts\n * const webTypesJson = webTypesGenerator('@mgdis/mg-components', '1.0.0', jsonDocs, 'https://storybook.example.com');\n * ```\n */\nexport const webTypesGenerator = (name: string, version: string, jsonDocs: JsonDocs, storybookBaseUrl: string) => ({\n '$schema': 'https://json.schemastore.org/web-types',\n name,\n version,\n 'description-markup': 'markdown',\n 'contributions': {\n html: {\n elements: jsonDocs.components.map(component => {\n const docUrl = getStorybookUrl(storybookBaseUrl, component.filePath);\n return {\n 'name': component.tag,\n 'description': getElementDescription(component),\n 'doc-url': docUrl,\n 'attributes': component.props\n .filter(prop => prop.attr)\n .map(prop => ({\n 'name': prop.attr,\n 'description': getAttributeDescription(prop),\n 'doc-url': docUrl,\n 'value': {\n type: prop.type,\n default: prop.default,\n required: prop.required,\n },\n })),\n 'js': {\n properties: component.props.map(prop => ({\n 'name': prop.name,\n 'description': getAttributeDescription(prop),\n 'doc-url': docUrl,\n 'value': {\n type: prop.type,\n default: prop.default,\n required: prop.required,\n },\n })),\n events: component.events.map(event => ({\n name: event.event,\n description: event.docs,\n })),\n },\n 'css': {\n properties: component.styles.map(style => ({\n name: style.name,\n description: style.docs,\n })),\n },\n };\n }),\n },\n },\n});\n\n/**\n * Create Storybook Reference\n * @param storybookBaseUrl - Storybook Base Url\n * @param filePath - Component file path\n * @returns Storybook Reference\n */\nconst getReferences = (storybookBaseUrl: string, sourceBaseUrl: string, filePath: string | undefined) => {\n return [\n { name: 'Storybook', url: getStorybookUrl(storybookBaseUrl, filePath) },\n { name: 'Sources', url: getSourcesUrl(sourceBaseUrl, filePath) },\n ];\n};\n\n/**\n * Get Property possible values\n * @param prop - Component Property\n * @returns Property possible values\n */\nconst getValues = (prop: JsonDocsProp): unknown[] | undefined => {\n // Only values Array where all objects have a value seems to be usefull\n if (prop.values.some(({ value }) => value === undefined)) {\n return;\n }\n return prop.values.map(({ value }) => ({ name: value }));\n};\n\n/**\n * Generate custom HTML datasets for VS Code\n * @param jsonDocs - Stencil JSON doc\n * @param storybookBaseUrl - Storybook Base Url\n * @returns custom HTML datasets\n * @example\n * ```ts\n * const customDataJson = vsCodeGenerator(jsonDocs, 'https://storybook.example.com', 'https://sources.example.com');\n * ```\n */\nexport const vsCodeGenerator = (jsonDocs: JsonDocs, storybookBaseUrl: string, sourceBaseUrl: string) => ({\n version: 1.1,\n tags: jsonDocs.components.map(component => {\n const references = getReferences(storybookBaseUrl, sourceBaseUrl, component.filePath);\n return {\n name: component.tag,\n description: getElementDescription(component),\n attributes: component.props.map(prop => ({\n name: prop.attr || prop.name,\n description: getAttributeDescription(prop),\n values: getValues(prop),\n references,\n })),\n references,\n };\n }),\n globalAttributes: [],\n valueSets: [],\n});\n\n/**\n * Generate custom CSS datasets for VS Code\n * @param jsonDocs - Stencil JSON doc\n * @returns custom CSS datasets\n * @example\n * ```ts\n * const customDataJson = vsCodeCssGenerator(jsonDocs);\n * ```\n */\nexport const vsCodeCssGenerator = (jsonDocs: JsonDocs) => ({\n version: 1.1,\n properties: jsonDocs.components.flatMap(component =>\n component.styles.map(style => ({\n name: style.name,\n description: style.docs,\n })),\n ),\n});\n","import type { ObjectType } from '../types';\n\n/**\n * Gets the date pattern based on the specified locale.\n * @param locale - the locale to refer to\n * @returns date pattern\n * @example\n * ```ts\n * getLocaleDatePattern('fr') // 'dd/mm/yyyy'\n * ```\n */\nexport const getLocaleDatePattern = (locale: string) => {\n const year = { value: '2023', pattern: 'yyyy' };\n const month = { value: '12', pattern: 'mm' };\n const day = { value: '24', pattern: 'dd' };\n return localeDate([year.value, month.value, day.value].join('-'), locale, { timeZone: 'UTC' })\n .replace(year.value, year.pattern)\n .replace(month.value, month.pattern)\n .replace(day.value, day.pattern);\n};\n\n/**\n * Formats a date object to a string with the pattern 'YYYY-MM-DD'.\n * @param date - date to parse\n * @returns string date with pattern 'YYYY-MM-DD'\n * @example\n * ```ts\n * dateToString(new Date('2023-12-24')) // '2023-12-24'\n * ```\n */\nexport const dateToString = (date: Date): string | undefined => date.toISOString().split('T')[0];\n\n/**\n * Get locale and messages\n * We load the defined locale but for now we only support the first subtag for messages\n * @param element - element we need to get the language\n * @param messages - messages to use\n * @param defaultLocale - default messages locale\n * @returns messages object\n */\nconst getLocaleMessages = (element: HTMLElement, messages: ObjectType, defaultLocale: string): { locale: string; messages: ObjectType } => {\n // Get local\n const closestLangAttribute: HTMLElement | null = element.closest('[lang]');\n const closestLang: string[] = Intl.NumberFormat.supportedLocalesOf(closestLangAttribute?.lang as string);\n const locale = closestLang.length > 0 && typeof closestLang[0] === 'string' ? closestLang[0] : navigator.language || defaultLocale;\n // Only keep first subtag\n const localeSubtag = locale.split('-').shift() as string;\n\n // If messages is empty, return a default object\n if (Object.keys(messages).length === 0) {\n return {\n locale,\n messages: { lang: defaultLocale },\n };\n }\n\n // Return\n return {\n locale,\n messages: (messages[localeSubtag] || messages[defaultLocale] || { lang: defaultLocale }) as ObjectType,\n };\n};\n\n/**\n * Format number to the locale currency\n * @param number - number to format\n * @param locale - locale to apply\n * @param currency - currency to apply\n * @returns formatted currency\n * @example\n * ```ts\n * localeCurrency(1234567890.12, 'fr', 'EUR') // '1 234 567 890,12\\xa0€'\n * ```\n */\nexport const localeCurrency = (number: number, locale: string, currency: string): string => new Intl.NumberFormat(locale, { style: 'currency', currency }).format(number);\n\n/**\n * Format number to locale\n * @param number - number to format\n * @param locale - locale to apply\n * @param decimalLength - decimal length to apply\n * @returns formatted number\n * @example\n * ```ts\n * localeNumber(1234567890.12, 'fr') // 1 234 567 890,12\n * ```\n */\nexport const localeNumber = (number: number, locale: string, decimalLength: number = 0): string =>\n new Intl.NumberFormat(locale, { minimumFractionDigits: decimalLength }).format(Number(number));\n\n/**\n * Format number as percentage based on locale\n * @param number - number to format\n * @param locale - locale to apply\n * @param decimalLength - decimal length to apply\n * @returns formatted percentage\n * @example\n * ```ts\n * localePercent(0.42, 'fr', 2) // '42,00 %'\n * localePercent(0.42, 'en', 2) // '42.00%'\n * ```\n */\nexport const localePercent = (number: number, locale: string, decimalLength: number = 0): string => {\n return new Intl.NumberFormat(locale, {\n style: 'percent',\n minimumFractionDigits: decimalLength,\n maximumFractionDigits: decimalLength,\n }).format(number);\n};\n\n/**\n * Format number with standardized unit based on locale using Intl unit formatting\n * @param number - number to format\n * @param locale - locale to apply\n * @param unit - standardized unit (e.g., 'kilometer', 'kilogram', 'celsius')\n * @param unitDisplay - how to display the unit ('short', 'long', 'narrow')\n * @param decimalLength - decimal length to apply\n * @returns formatted number with localized unit\n * @example\n * ```ts\n * localeUnit(1234567890.12, 'fr', 'kilometer') // '1 234 567 890,12 km'\n * localeUnit(23, 'fr', 'celsius') // '23 °C'\n * localeUnit(10, 'fr', 'kilometer', 0, 'long') // '10 kilomètres'\n * ```\n */\nexport const localeUnit = (\n number: number,\n locale: string,\n unit: Intl.NumberFormatOptions['unit'],\n unitDisplay: Intl.NumberFormatOptions['unitDisplay'] = 'short',\n decimalLength: number = 0,\n): string => {\n return new Intl.NumberFormat(locale, {\n style: 'unit',\n unit,\n unitDisplay,\n minimumFractionDigits: decimalLength,\n maximumFractionDigits: decimalLength,\n }).format(number);\n};\n\n/**\n * Date RegExp, usefull to test if string is a follow the date pattern\n * @example\n * ```ts\n * dateRegExp.test('mystring') // false\n * dateRegExp.test('2020-12-31') // true\n * ```\n */\nexport const dateRegExp = /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$/;\n\n/**\n * Locale date format\n * @param date - date to format\n * @param locale - locale to apply\n * @param config - DateTimeFormatOptions object to apply\n * @returns formatted date\n * @example\n * ```ts\n * localeDate('2022-06-02', 'fr') // '02/06/2022'\n * ```\n */\nexport const localeDate = (date: string | undefined, locale: string, config?: Intl.DateTimeFormatOptions): string =>\n typeof date !== 'string' || date === '' || !dateRegExp.test(date) ? '' : new Intl.DateTimeFormat(locale, config).format(new Date(date));\n\n/**\n * Get Intl object\n * @param messages - locales to render in object format. `ex: { en: { porp: \"test\" }, fr: { porp: \"test\" }}`.\n * @param defaultLocale - fallback locale to render. `ex: 'en'`.\n * @returns from the element passed in return function you will get the matching messages object\n * @example\n * ```ts\n * import en from './en/messages.json';\n * import fr from './fr/messages.json';\n * import { defineLocales } from '@mgdis/stencil-helpers';\n *\n * const defaultLocale = 'en';\n * const messages = { en, fr };\n *\n * export const initLocales = defineLocales(messages, defaultLocale);\n * ```\n */\nexport const defineLocales =\n (messages: ObjectType, defaultLocale: 'fr' | 'en' | string) =>\n (element: HTMLElement): { locale: string; messages: ObjectType } =>\n getLocaleMessages(element, messages, defaultLocale);\n","import type { SetupMutationObserverMockParams, setupResizeObserverMockParams } from './unit.conf';\n\n/**\n * Utility function that mocks the `MutationObserver` API. Recommended to execute inside `beforeEach`.\n * @param mutationObserverMock - Parameter that is sent to the `Object.defineProperty`\n * overwrite method. `jest.fn()` mock functions can be passed here if the goal is to not only\n * mock the mutation observer, but its methods.\n * You can manually fire an intersection entry:\n * @param mutationObserverMock - configuration object\n * @returns Mocked MutationObserver\n * @example\n * ```\n * let fireMo;\n * setupMutationObserverMock({\n * observe: function () {\n * fireMo = this.cb;\n * },\n * });\n * ...\n * fireMo([{ type: 'childList', addedNodes: [AMockElemenet, AnotherMockElemenet], target: yourMockElemenet }]);;\n * ```\n */\nexport const setupMutationObserverMock = ({ disconnect, observe, takeRecords }: SetupMutationObserverMockParams): typeof MutationObserver => {\n class MockMutationObserver implements MutationObserver {\n /**\n *\n */\n disconnect: () => void = disconnect;\n /**\n *\n */\n observe: (target: Node, options?: MutationObserverInit) => void = observe;\n /**\n *\n */\n takeRecords: () => MutationRecord[] = takeRecords;\n /**\n *\n */\n cb: MutationCallback;\n constructor(fn: MutationCallback) {\n this.cb = fn;\n }\n }\n\n [window, global].forEach(element => {\n Object.defineProperty(element, 'MutationObserver', {\n writable: true,\n configurable: true,\n value: MockMutationObserver,\n });\n });\n\n return MockMutationObserver;\n};\n\n/**\n * Utility function that mocks the `ResizeObserver` API. Recommended to execute inside `beforeEach`.\n * @param resizeObserverMock - Parameter that is sent to the `Object.defineProperty`\n * overwrite method. `jest.fn()` mock functions can be passed here if the goal is to not only\n * mock the resize observer, but its methods.\n * You can manually fire an intersection entry:\n * @param resizeObserverMock - configuration object\n * @returns Mocked ResizeObserver\n * @example\n * ```\n * let fireRo;\n * setupResizeObserverMock({\n * observe: function () {\n * fireRo = this.cb;\n * },\n * });\n * ...\n * fireRo([{\n * borderBoxSize: ResizeObserverSize[],\n * contentBoxSize: ResizeObserverSize[],\n * contentRect: DOMRectReadOnly,\n * devicePixelContentBoxSize: ResizeObserverSize[],\n * target: yourMockElemenet\n * }]);;\n * ```\n */\nexport const setupResizeObserverMock = ({ disconnect, observe }: setupResizeObserverMockParams): typeof ResizeObserver => {\n class MockResizeObserver implements ResizeObserver {\n /**\n *\n */\n disconnect: () => void = disconnect;\n /**\n *\n */\n observe: (target: Element, options?: ResizeObserverOptions) => void = observe;\n /**\n *\n */\n unobserve!: () => void;\n /**\n *\n */\n cb: ResizeObserverCallback;\n constructor(fn: ResizeObserverCallback) {\n this.cb = fn;\n }\n }\n\n [window, global].forEach(element => {\n Object.defineProperty(element, 'ResizeObserver', {\n writable: true,\n configurable: true,\n value: MockResizeObserver,\n });\n });\n\n return MockResizeObserver;\n};\n\nclass MockCustomEvent extends Event {\n /**\n *\n */\n detail: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n}\n\n/**\n * Utility function that mocks the `SubmitEvent` API. Recommended to execute inside `beforeEach`.\n * @example\n * ```\n * setupSubmitEventMock();\n * ```\n * @returns custom event mock\n */\nexport const setupSubmitEventMock = (): typeof MockCustomEvent => {\n class SubmitEvent extends MockCustomEvent {}\n\n [window, global].forEach(element => {\n Object.defineProperty(element, 'SubmitEvent', {\n writable: true,\n configurable: true,\n value: SubmitEvent,\n });\n });\n\n return SubmitEvent;\n};\n\n/**\n * Utility function that mocks the `requestAnimationFrame` API. Recommended to execute inside `test`.\n * @example\n * ```\n * setUpRequestAnimationFrameMock(jest.runOnlyPendingTimers);\n * ```\n * @param faketimer - recommended to use jest.runOnlyPendingTimers()\n * @returns custom setUpRequestAnimationFrameMock mock\n */\nexport const setUpRequestAnimationFrameMock = (faketimer: () => void): typeof requestAnimationFrame => {\n const requestAnimationFrame = (callback: FrameRequestCallback) => {\n setTimeout(callback, 1);\n faketimer();\n return 0;\n };\n\n [window, global].forEach(element => {\n Object.defineProperty(element, 'requestAnimationFrame', {\n writable: true,\n configurable: true,\n value: requestAnimationFrame,\n });\n });\n\n return requestAnimationFrame;\n};\n"],"names":["toKebabCase","str","match","offset","createID","prefix","length","randomBytes","hexString","byte","isValideID","newValue","isValidString","formatID","value","id","isObject","ClassList","classlist","__publicField","className","index","allItemsAreString","items","item","isTagName","element","tagNames","focusableElements","getWindows","localWindow","parentWindows","getParentWindows","childWindows","getChildWindows","windows","parentWindow","err","childWindow","toString","isValidNumber","cleanString","text","nextTick","callback","object","getObjectValueFromKey","path","defaultValue","separator","current","next","Cursor","DEFAULT_TOP","Page","init","cursor","oldItem","lastIndex","newIndex","oldIndex","findedIndex","_top","_next","_total","Paginate","options","__privateAdd","filter","__privateGet","__privateSet","BUILD","__defProp","__export","target","all","name","SVG_NS","HTML_NS","isMemberInElement","elm","memberName","XLINK_NS","win","plt","h2","el","eventName","listener","opts","isDef","v","isComplexType","o","result_exports","map","ok","unwrap","unwrapErr","result","fn","val","newVal","updateFallbackSlotVisibility","childNodes","internalCall","getHostSlotNodes","slotNode","getSlotChildSiblings","getSlotName","i2","childNode","getSlottedChildNodes","slottedNode","hostName","slotName","slottedNodes","slot","includeSlot","node","isNodeLocatedInSlot","nodeToRelocate","patchSlotNode","assignedFactory","elementsOnly","toReturn","parent","n","method","h","nodeName","vnodeData","children","child","key","simple","lastSimple","vNodeChildren","walk","c","newVNode","vnode","tag","Host","isHost","setAccessor","oldValue","isSvg","flags","initialRender","isProp","ln","classList","oldClasses","parseClassList","newClasses","prop","capture","CAPTURE_EVENT_SUFFIX","CAPTURE_EVENT_REGEX","isComplex","xlink","parseClassListRegex","updateElement","oldVnode","newVnode","isSvgMode2","isInitialRender","oldVnodeAttrs","newVnodeAttrs","sortedAttrNames","attrNames","attr","scopeId","contentRef","hostTagName","useNativeShadowDom","checkSlotFallbackVisibility","checkSlotRelocate","isSvgMode","createElm","oldParentVNode","newParentVNode","childIndex","_a","newVNode2","oldVNode","BUILD19","putBackInOriginalLocation","addRemoveSlotScopedClass","parentElm","recursive","oldSlotChildNodes","insertBefore","referenceNode","addVnodes","before","parentVNode","vnodes","startIdx","endIdx","containerElm","removeVnodes","nullifyVNodeRefs","updateChildren","oldCh","newCh","oldStartIdx","newStartIdx","idxInOld","oldEndIdx","oldStartVnode","oldEndVnode","newEndIdx","newStartVnode","newEndVnode","elmToMove","isSameVnode","patch","leftVNode","rightVNode","oldChildren","newChildren","defaultHolder","relocateNodes","markSlotContentForRelocation","hostContentNodes","j","relocateNodeData","r","relocateNode","vNode","newNode","reference","newParent","oldParent","_b","scopeId2","scopeName","found","renderVdom","hostRef","renderFnResults","isInitialLoad","_c","_d","_e","hostElm","cmpMeta","rootVnode","propName","attribute","relocateData","orgLocationNode","slotRefNode","parentNodeRef","insertBeforeNode","refNode","nextSibling","CONFIG","CONTENT_IGNORE_STRING","IGNORE_STRING","VOID_ELEMENTS","isHtml","content","mergeObjects","updates","merged","mergeConfig","dconfig","config","protectAttributes","html","protectContent","finalProtectContent","regex","p1","p2","p3","p4","text_to_protect","protected_text","setIgnoreAttribute","setIgnoreElement","ignore","ignore_string","e","trimify","trim","leading_whitespace","trailing_whitespace","unprotectAttributes","unprotectContent","unsetIgnoreAttribute","unsetIgnoreElement","validateConfig","tab_size","wordWrap","width","indent","words","lines","current_line","padding_string","word","test_line","closify","check_html","entify","minify","attr_name","quote","trimmed_value","strict","convert","enqueue","i","c1","c2","preprocess","process","step","tag_wrap","content_wrap","indents","output_lines","tag_regex","attribute_regex","source","current_line_value","subtrahend","prev_line_data","prev_line_value","current_indent_level","padding","tag_parts","attributes","inner_padding","wrapped_tag","a","attribute_string","tag_name_match","tag_name","is_void","closing_part","closing_padding","final_html","prettify","validated_config","renderAttribute","renderElement","parentNode","tagName","filterArgs","args","defaultValues","slots","filteredArgs","k","arg","stencilWrapper","storyFn","context","host","getStoryHTML","$tag$","$attrs$","$children$","$text$","getStorybookUrl","storybookBaseUrl","filePath","split","_getComponentData","_getPropControl","StorybookPreview","jsonDoc","component","types","type","componentData","componentPropsArgTypes","acc","control","componentEventsArgTypes","event","componentMethodsArgTypes","componentSlotsArgTypes","componentCSSPropArgTypes","style","componentDependencies","dependency","dependencyData","componentDependents","dependent","dependentData","getSourcesUrl","sourcesBaseUrl","getElementDescription","description","docs","properties","getAttributeDescription","webTypesGenerator","version","jsonDocs","docUrl","getReferences","sourceBaseUrl","getValues","vsCodeGenerator","references","vsCodeCssGenerator","getLocaleDatePattern","locale","year","month","day","localeDate","dateToString","date","getLocaleMessages","messages","defaultLocale","closestLangAttribute","closestLang","localeSubtag","localeCurrency","number","currency","localeNumber","decimalLength","localePercent","localeUnit","unit","unitDisplay","dateRegExp","defineLocales","setupMutationObserverMock","disconnect","observe","takeRecords","MockMutationObserver","setupResizeObserverMock","MockResizeObserver","MockCustomEvent","setupSubmitEventMock","SubmitEvent","setUpRequestAnimationFrameMock","faketimer","requestAnimationFrame"],"mappings":";;;;;;;AAiBA,MAAMA,KAAc,CAACC,MAAQA,EACxB,QAAQ,0BAA0B,CAACC,GAAOC,OAAYA,IAAS,IAAI,MAAM,MAAMD,EAAM,YAAa,CAAA,EAClG,QAAQ,gBAAgB,GAAG,EAC3B,QAAQ,QAAQ,GAAG,EACnB,QAAQ,kBAAkB,EAAE,GCbpBE,KAAW,CAACC,IAAS,IAAIC,IAAS,OAAe;AACtD,QAAAC,IAAc,IAAI,WAAWD,CAAM;AAEzC,SAAO,gBAAgBC,CAAW;AAE5B,QAAAC,IAAY,MAAM,KAAKD,CAAW,EACrC,IAAI,CAAAE,MAAQA,EAAK,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,EAC9C,KAAK,EAAE,EACP,MAAM,GAAGH,CAAM;AAElB,SAAOD,MAAW,KAAK,GAAGA,CAAM,IAAIG,CAAS,KAAKA;AACpD,GAOaE,KAAa,CAACC,MAA+BC,GAAcD,CAAQ,KAAK,kCAAkC,KAAKA,CAAQ,MAAM,MAO7HE,KAAW,CAACC,MAAuC;AAC1D,MAAAC;AACA,SAAA,OAAOD,KAAU,WACdC,IAAAD,IACYA,MAAWE,EAASF,CAAK,KAAK,MAAM,QAAQA,CAAK,KAC7DC,IAAA,KAAK,UAAUD,CAAK,IAChBA,KAAU,QAA+B,OAAOA,KAAU,cACnEC,IAAK,OAAOD,CAAK,IAEZC,KAAKf,GAA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,WAAK,KAAKiF;AAAA,IAAA;AAAA,EACZ;AAGF,UAAC,QAAQ,MAAM,EAAE,QAAQ,CAAW1E,MAAA;AAC3B,WAAA,eAAeA,GAAS,kBAAkB;AAAA,MAC/C,UAAU;AAAA,MACV,cAAc;AAAA,MACd,OAAOka;AAAA,IAAA,CACR;AAAA,EAAA,CACF,GAEMA;AACT;AAEA,MAAMC,WAAwB,MAAM;AAAA,EAApC;AAAA;AAIE;AAAA;AAAA;AAAA,IAAA1a,EAAA;AAAA;AAAA;AACF;AAUO,MAAM2a,KAAuB,MAA8B;AAAA,EAChE,MAAMC,UAAoBF,GAAgB;AAAA,EAAA;AAE1C,UAAC,QAAQ,MAAM,EAAE,QAAQ,CAAWna,MAAA;AAC3B,WAAA,eAAeA,GAAS,eAAe;AAAA,MAC5C,UAAU;AAAA,MACV,cAAc;AAAA,MACd,OAAOqa;AAAA,IAAA,CACR;AAAA,EAAA,CACF,GAEMA;AACT,GAWaC,KAAiC,CAACC,MAAwD;AAC/F,QAAAC,IAAwB,CAACtZ,OAC7B,WAAWA,GAAU,CAAC,GACZqZ,EAAA,GACH;AAGT,UAAC,QAAQ,MAAM,EAAE,QAAQ,CAAWva,MAAA;AAC3B,WAAA,eAAeA,GAAS,yBAAyB;AAAA,MACtD,UAAU;AAAA,MACV,cAAc;AAAA,MACd,OAAOwa;AAAA,IAAA,CACR;AAAA,EAAA,CACF,GAEMA;AACT;","x_google_ignoreList":[2,3,4,5,6,7,8,9]}
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../helpers/dist/utils/index.js","../../helpers/dist/stencil/index.js","../../helpers/dist/locale/index.js","../../helpers/dist/storybook/index.js","../../helpers/dist/tests/index.js"],"sourcesContent":["/**\n * Class to manage component classlist\n */\nclass ClassList {\n /**\n * Available classes\n */\n classes;\n constructor(classlist = []) {\n this.classes = classlist;\n }\n /**\n * Add class\n * @param className - class name to add\n */\n add = (className) => {\n if (!this.has(className)) {\n this.classes.push(className);\n }\n };\n /**\n * Delete class\n * @param className - class name to delete\n */\n delete = (className) => {\n const index = this.classes.indexOf(className);\n if (index > -1) {\n this.classes.splice(index, 1);\n }\n };\n /**\n * Check if class exist in list\n * @param className - class name to check\n * @returns class name is in the list\n */\n has = (className) => {\n return this.classes.includes(className);\n };\n /**\n * Join classes seperated by spaces\n * @returns joined values\n */\n join = () => {\n return this.classes.join(' ');\n };\n}\n\n/**\n * Check if a value is of object type.\n * @param object - The value to validate.\n * @returns `true` if the value is a valid object (non-null and not an array), otherwise `false`.\n */\nconst isObject = (object) => typeof object === 'object' && !Array.isArray(object) && object !== null;\n/**\n * Get object value from key\n * @param object - object to query\n * @param path - path of the property to get. Nested keys are allowed with `.` separators (eg: 'key0.key1.key2' = object[key0][key1][key2])\n * @param defaultValue - The value returned for `undefined` resolved values\n * @returns object value\n */\nconst getObjectValueFromKey = (object, path, defaultValue) => {\n const separator = '.';\n if (!isObject(object) || typeof path !== 'string') {\n return defaultValue;\n }\n const [current, ...next] = path.split(separator);\n if (next.length) {\n return getObjectValueFromKey(object[current], next.join(separator));\n }\n else {\n return object[current];\n }\n};\n\n/**\n * Typeguard function to check if all array items are strings.\n * @param items - items to check\n * @returns `true` if all items are strings\n */\nconst allItemsAreString = (items) => Array.isArray(items) && items.every(item => typeof item === 'string');\n/**\n * Validate string\n * @param value - value to check\n * @returns `true` if string is valid\n */\nconst isValidString = (value) => typeof value === 'string' && value.trim() !== '';\n/**\n * Stringify value\n * @param value - value to stringify\n * @returns stringified value\n */\nconst toString = (value) => (typeof value === 'object' ? JSON.stringify(value) : String(value));\n/**\n * Cleans string characters by removing special characters and converting to lowercase.\n * @param text - text to clean\n * @returns cleaned string\n * @example\n * ```ts\n * cleanString('âäàçéèêñù') // 'aaaceeenu'\n * cleanString('BATMAN') // 'batman'\n * ```\n */\nconst cleanString = (text) => typeof text === 'string'\n ? text\n .toLocaleLowerCase()\n .normalize('NFD')\n .replaceAll(/[\\u0300-\\u036f]/g, '')\n : text;\n\n/**\n * Convert a string to kebab-case.\n *\n * This function ensures:\n * - All characters are converted to lowercase. Based on : https://stackoverflow.com/questions/63116039/camelcase-to-kebab-case\n * - Non-alphabetic characters (except numbers and hyphens) are replaced with hyphens.\n * - Consecutive hyphens are replaced with a single hyphen.\n * - Leading and trailing hyphens are removed.\n *\n * @param str - The input string to convert.\n * @returns The kebab-case formatted string.\n *\n * @example\n * ```typescript\n * toKebabCase('XMLHttpRequest'); // 'xml-http-request'\n * ```\n */\nconst toKebabCase = (str) => str\n .replace(/[A-Z]+(?![a-z])|[A-Z]/g, (match, offset) => (offset > 0 ? '-' : '') + match.toLowerCase())\n .replace(/[^a-z0-9-]+/g, '-') // Replace non a-z, 0-9, or hyphen characters with a hyphen\n .replace(/--+/g, '-') // Replace multiple consecutive hyphens with a single hyphen\n .replace(/(?:^-)|(?:-$)/g, ''); // Remove leading hyphens or number or trailing hyphens\n\n/**\n * Create random ID\n * @param prefix - add prefix to created ID\n * @param length - ID length\n * @returns ID\n */\nconst createID = (prefix = '', length = 10) => {\n const randomBytes = new Uint8Array(length);\n crypto.getRandomValues(randomBytes);\n const hexString = Array.from(randomBytes)\n .map(byte => byte.toString(16).padStart(2, '0'))\n .join('')\n .slice(0, length);\n return prefix !== '' ? `${prefix}-${hexString}` : hexString;\n};\n/**\n * Validate html `id` format\n * @param newValue - id value to validate\n * @returns true if `id` is valid\n */\nconst isValideID = (newValue) => isValidString(newValue) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(newValue) !== null;\n/**\n * Format id from value\n * @param value - id to transforme\n * @returns valid id\n */\nconst formatID = (value) => {\n let id;\n if (typeof value === 'string') {\n id = value;\n }\n else if (Boolean(value) && typeof value === 'object' && (isObject(value) || Array.isArray(value))) {\n id = JSON.stringify(value);\n }\n else if (value !== null && value !== undefined && typeof value !== 'boolean' && typeof value !== 'object') {\n id = String(value);\n }\n return id ? toKebabCase(id) : id;\n};\n\n/**\n * Use to process code next tick in the event loop\n * @param callback - code to excute on next tick\n * @returns differed code excution\n */\nconst nextTick = async (callback) => {\n if (callback)\n return callback();\n};\n/**\n * Cursor possible values\n */\nconst Cursor = {\n FIRST: 'first',\n NEXT: 'next',\n PREVIOUS: 'previous',\n LAST: 'last',\n};\nconst DEFAULT_TOP = 10;\n/**\n * Define a valid Page object and navigate throw page items with cursor.\n * Page object entries follow the REST API page practices.\n */\nclass Page {\n /**\n * Define items\n */\n items = [];\n /**\n * Define total\n */\n total;\n /**\n * Define top\n */\n top = DEFAULT_TOP;\n /**\n * Define next\n */\n next;\n /**\n * Define base index\n */\n baseIndex = 1;\n constructor(init) {\n if (!isObject(init)) {\n throw new Error('Page - init must match IPage type.');\n }\n else {\n if (Array.isArray(init.items))\n this.items = init.items;\n if (typeof init.top === 'number')\n this.top = init.top;\n this.total = typeof init.total === 'number' ? init.total : this.items.length;\n this.next = init.next;\n }\n }\n /**\n * Get index of items from cursor\n * @param cursor - cursor to find\n * @param oldItem - previous item\n * @returns item index\n */\n getIndexFromCursor = (cursor = 'first', oldItem) => {\n const startIndex = 0;\n if (!Array.isArray(this.items) || !this.items.length)\n return null;\n const lastIndex = this.items.length - this.baseIndex;\n let newIndex;\n let oldIndex = startIndex;\n if (['previous', 'next'].includes(cursor) && oldItem) {\n const findedIndex = this.items.findIndex(item => JSON.stringify(item) === JSON.stringify(oldItem));\n if (findedIndex === -1)\n return startIndex;\n oldIndex = findedIndex;\n }\n // Update index from cursor\n if (cursor === 'first') {\n newIndex = startIndex;\n }\n else if (cursor === 'last') {\n newIndex = lastIndex;\n }\n else if (cursor === 'previous') {\n newIndex = JSON.stringify(this.items[oldIndex]) === JSON.stringify(this.items[startIndex]) ? lastIndex : oldIndex - this.baseIndex;\n }\n else if (cursor === 'next') {\n newIndex = JSON.stringify(this.items[oldIndex]) === JSON.stringify(this.items[lastIndex]) ? startIndex : oldIndex + this.baseIndex;\n }\n else {\n newIndex = startIndex;\n }\n return newIndex;\n };\n}\n/**\n * Paginate an items array to navigate into with pages.\n * It follow REST standard and allow to navigate in items array with a similar format.\n */\nclass Paginate {\n /**\n * Define paginated items\n */\n items = [];\n /* Privates */\n #top = DEFAULT_TOP;\n #next;\n #total;\n constructor(items, options) {\n if (Array.isArray(items))\n this.items = items;\n if (options && (['string', 'function'].includes(typeof options.next) || (isObject(options.next) && URL.canParse(options.next))))\n this.#next = options.next;\n if (typeof options?.top === 'number')\n this.#top = options.top;\n if (typeof options?.total === 'number')\n this.#total = options.total;\n }\n /**\n * Get page\n * @param offset - pagiantion offset\n * @param filter - filter methode\n * @returns formated page\n */\n getPage = (offset = 0, filter) => {\n const items = typeof filter === 'function' ? this.items.filter(filter) : this.items;\n let next;\n if (this.#next)\n next = this.#next;\n else if (items.length > offset + this.#top)\n next = () => this.getPage(offset + this.#top, filter);\n return new Page({\n items: items.slice(offset, offset + this.#top),\n total: this.#total,\n top: this.#top,\n next,\n });\n };\n}\n\n/**\n * Date RegExp, usefull to test if string is a follow the date pattern\n * @example\n * ```ts\n * dateRegExp.test('mystring') // false\n * dateRegExp.test('2020-12-31') // true\n * ```\n */\nconst dateRegExp = /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$/;\n/**\n * Formats a date object to a string with the pattern 'YYYY-MM-DD'.\n * @param date - date to parse\n * @returns string date with pattern 'YYYY-MM-DD'\n * @example\n * ```ts\n * dateToString(new Date('2023-12-24')) // '2023-12-24'\n * ```\n */\nconst dateToString = (date) => date.toISOString().split('T')[0];\n\n/**\n * Check if element belongs to the given tagNames list\n * @param element - element to check\n * @param tagNames - allowed tag names list\n * @returns `true` if element tagName is in the tagNames list\n */\nconst isTagName = (element, tagNames) => tagNames.includes(element?.tagName.toLowerCase());\n/**\n * CSS selector to select focusable elements.\n * @example\n * ```ts\n * const allFocusableElements: HTMLElement[] = Array.from(this.element.querySelectorAll(focusableElements));\n * ```\n */\nconst focusableElements = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]), [identifier], mg-button';\n\n/**\n * Validate number\n * @param value - value to check\n * @returns `true` if number is valid\n */\nconst isValidNumber = (value) => typeof value === 'number' && !Number.isNaN(value);\n\n/**\n * Get windows\n * @param localWindow - the window we are lookink for other windows\n * @returns The list of windows found\n */\nconst getWindows = (localWindow) => {\n const parentWindows = getParentWindows(localWindow);\n const childWindows = getChildWindows(localWindow);\n return [localWindow, ...parentWindows, ...childWindows];\n};\n/**\n * Get parent windows\n * @param localWindow - the window we are lookink for parents\n * @param windows - The list of allready found windows\n * @returns The list of windows found\n */\nconst getParentWindows = (localWindow, windows = []) => {\n // Check if is in iframe\n if (localWindow.self !== localWindow.top) {\n // Check if we have permission to access parent\n try {\n const parentWindow = localWindow.parent;\n if (parentWindow) {\n windows.push(parentWindow);\n return getParentWindows(parentWindow, windows);\n }\n else\n return windows;\n }\n catch (err) {\n console.error('Different hosts between iframes:', err);\n return windows;\n }\n }\n return windows;\n};\n/**\n * Get child windows\n * @param localWindow - the window we are lookink for children\n * @param windows - The list of allready found windows\n * @returns The list of windows found\n */\nconst getChildWindows = (localWindow, windows = []) => {\n if (localWindow.frames.length > 0) {\n for (const childWindow of Array.from(localWindow.frames)) {\n windows.push(childWindow);\n getChildWindows(childWindow, windows);\n }\n }\n return windows;\n};\n\nexport { ClassList, Cursor, Page, Paginate, allItemsAreString, cleanString, createID, dateRegExp, dateToString, focusableElements, formatID, getChildWindows, getObjectValueFromKey, getParentWindows, getWindows, isObject, isTagName, isValidNumber, isValidString, isValideID, nextTick, toKebabCase, toString };\n//# sourceMappingURL=index.js.map\n","/*\n Stencil Client Platform v4.28.2 | MIT Licensed | https://stenciljs.com\n */\nvar __defProp = Object.defineProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\n\n// src/utils/result.ts\nvar result_exports = {};\n__export(result_exports, {\n err: () => err,\n map: () => map,\n ok: () => ok,\n unwrap: () => unwrap,\n unwrapErr: () => unwrapErr\n});\nvar ok = (value) => ({\n isOk: true,\n isErr: false,\n value\n});\nvar err = (value) => ({\n isOk: false,\n isErr: true,\n value\n});\nfunction map(result, fn) {\n if (result.isOk) {\n const val = fn(result.value);\n if (val instanceof Promise) {\n return val.then((newVal) => ok(newVal));\n } else {\n return ok(val);\n }\n }\n if (result.isErr) {\n const value = result.value;\n return err(value);\n }\n throw \"should never get here\";\n}\nvar unwrap = (result) => {\n if (result.isOk) {\n return result.value;\n } else {\n throw result.value;\n }\n};\nvar unwrapErr = (result) => {\n if (result.isErr) {\n return result.value;\n } else {\n throw result.value;\n }\n};\n\n/**\n * Retrieve Component Storybook URL from file path\n * @param storybookBaseUrl - Storybook Base URL\n * @param filePath - Component file path\n * @returns Component Storybook URL\n */\nconst getStorybookUrl = (storybookBaseUrl, filePath) => {\n if (!filePath) {\n return;\n }\n const split = filePath.split('/');\n return `${storybookBaseUrl}${split.slice(2, split.length - 1).join('-')}--docs`;\n};\n\n/**\n * Retrieve Component source URL from file path\n * @param sourcesBaseUrl - Source base URL\n * @param filePath - Component file path\n * @returns Component source URL\n */\nconst getSourcesUrl = (sourcesBaseUrl, filePath) => {\n if (!filePath) {\n return;\n }\n return `${sourcesBaseUrl}${filePath}`;\n};\n/**\n * Get Component element description\n * @param component - Component\n * @returns Component element description\n */\nconst getElementDescription = (component) => {\n // Init description\n let description = component.overview ? `${component.overview}\\n\\n` : '';\n // Attributes\n const attributes = component.props.filter(({ attr }) => attr !== undefined);\n if (attributes.length) {\n description += `Attributes:\\n`;\n description += attributes.map(({ attr, docs }) => `- \\`${attr}\\`: ${docs}\\n`).join('');\n description += '\\n';\n }\n // Properties\n const properties = component.props.filter(({ attr }) => attr === undefined);\n if (properties.length) {\n description += `Properties:\\n`;\n description += properties.map(({ name, docs }) => `- \\`${name}\\`: ${docs}\\n`).join('');\n description += '\\n';\n }\n // Methods\n if (component.methods.length) {\n description += `Methods:\\n`;\n description += component.methods.map(({ name, docs }) => `- \\`${name}\\`: ${docs}\\n`).join('');\n description += '\\n';\n }\n // Events\n if (component.events.length) {\n description += `Events:\\n`;\n description += component.events.map(({ event, docs }) => `- \\`${event}\\`: ${docs}\\n`).join('');\n description += '\\n';\n }\n // Listeners\n if (component.listeners.length) {\n description += `Listeners:\\n`;\n description += component.listeners.map(({ event }) => `- \\`${event}\\`\\n`).join('');\n description += '\\n';\n }\n // Slots\n if (component.slots.length) {\n description += `Slots:\\n`;\n description += component.slots.map(({ name, docs }) => `- \\`${name}\\`: ${docs}\\n`).join('');\n description += '\\n';\n }\n // Return\n return description;\n};\n/**\n * Get Props Description\n * @param prop - Component Property\n * @returns Props Description\n */\nconst getAttributeDescription = (prop) => {\n return `${prop.docs}\\n\\nType: \\`${prop.type}\\``;\n};\n/**\n * Generate Web Types metadata for IntelliJ's IDE\n * @param name - Library name\n * @param version - Library version\n * @param jsonDocs - Stencil JSON doc\n * @param storybookBaseUrl - Storybook Base Url\n * @returns Web Types metadata\n * @example\n * ```ts\n * const webTypesJson = webTypesGenerator('@mgdis/mg-components', '1.0.0', jsonDocs, 'https://storybook.example.com');\n * ```\n */\nconst webTypesGenerator = (name, version, jsonDocs, storybookBaseUrl) => ({\n '$schema': 'https://json.schemastore.org/web-types',\n name,\n version,\n 'description-markup': 'markdown',\n 'contributions': {\n html: {\n elements: jsonDocs.components.map(component => {\n const docUrl = getStorybookUrl(storybookBaseUrl, component.filePath);\n return {\n 'name': component.tag,\n 'description': getElementDescription(component),\n 'doc-url': docUrl,\n 'attributes': component.props\n .filter(prop => prop.attr)\n .map(prop => ({\n 'name': prop.attr,\n 'description': getAttributeDescription(prop),\n 'doc-url': docUrl,\n 'value': {\n type: prop.type,\n default: prop.default,\n required: prop.required,\n },\n })),\n 'js': {\n properties: component.props.map(prop => ({\n 'name': prop.name,\n 'description': getAttributeDescription(prop),\n 'doc-url': docUrl,\n 'value': {\n type: prop.type,\n default: prop.default,\n required: prop.required,\n },\n })),\n events: component.events.map(event => ({\n name: event.event,\n description: event.docs,\n })),\n },\n 'css': {\n properties: component.styles.map(style => ({\n name: style.name,\n description: style.docs,\n })),\n },\n };\n }),\n },\n },\n});\n/**\n * Create Storybook Reference\n * @param storybookBaseUrl - Storybook Base Url\n * @param filePath - Component file path\n * @returns Storybook Reference\n */\nconst getReferences = (storybookBaseUrl, sourceBaseUrl, filePath) => {\n return [\n { name: 'Storybook', url: getStorybookUrl(storybookBaseUrl, filePath) },\n { name: 'Sources', url: getSourcesUrl(sourceBaseUrl, filePath) },\n ];\n};\n/**\n * Get Property possible values\n * @param prop - Component Property\n * @returns Property possible values\n */\nconst getValues = (prop) => {\n // Only values Array where all objects have a value seems to be usefull\n if (prop.values.some(({ value }) => value === undefined)) {\n return;\n }\n return prop.values.map(({ value }) => ({ name: value }));\n};\n/**\n * Generate custom HTML datasets for VS Code\n * @param jsonDocs - Stencil JSON doc\n * @param storybookBaseUrl - Storybook Base Url\n * @returns custom HTML datasets\n * @example\n * ```ts\n * const customDataJson = vsCodeGenerator(jsonDocs, 'https://storybook.example.com', 'https://sources.example.com');\n * ```\n */\nconst vsCodeGenerator = (jsonDocs, storybookBaseUrl, sourceBaseUrl) => ({\n version: 1.1,\n tags: jsonDocs.components.map(component => {\n const references = getReferences(storybookBaseUrl, sourceBaseUrl, component.filePath);\n return {\n name: component.tag,\n description: getElementDescription(component),\n attributes: component.props.map(prop => ({\n name: prop.attr ?? prop.name,\n description: getAttributeDescription(prop),\n values: getValues(prop),\n references,\n })),\n references,\n };\n }),\n globalAttributes: [],\n valueSets: [],\n});\n/**\n * Generate custom CSS datasets for VS Code\n * @param jsonDocs - Stencil JSON doc\n * @returns custom CSS datasets\n * @example\n * ```ts\n * const customDataJson = vsCodeCssGenerator(jsonDocs);\n * ```\n */\nconst vsCodeCssGenerator = (jsonDocs) => ({\n version: 1.1,\n properties: jsonDocs.components.flatMap(component => component.styles.map(style => ({\n name: style.name,\n description: style.docs,\n }))),\n});\n\nexport { vsCodeCssGenerator, vsCodeGenerator, webTypesGenerator };\n//# sourceMappingURL=index.js.map\n","/**\n * Date RegExp, usefull to test if string is a follow the date pattern\n * @example\n * ```ts\n * dateRegExp.test('mystring') // false\n * dateRegExp.test('2020-12-31') // true\n * ```\n */\nconst dateRegExp = /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$/;\n\n/**\n * Gets the date pattern based on the specified locale.\n * @param locale - the locale to refer to\n * @returns date pattern\n * @example\n * ```ts\n * localeDatePattern('fr') // 'dd/mm/yyyy'\n * ```\n */\nconst localeDatePattern = (locale) => {\n const year = { value: '2023', pattern: 'yyyy' };\n const month = { value: '12', pattern: 'mm' };\n const day = { value: '24', pattern: 'dd' };\n return localeDate([year.value, month.value, day.value].join('-'), locale, { timeZone: 'UTC' })\n .replace(year.value, year.pattern)\n .replace(month.value, month.pattern)\n .replace(day.value, day.pattern);\n};\n/**\n * Get locale and messages\n * We load the defined locale but for now we only support the first subtag for messages\n * @param element - element we need to get the language\n * @param messages - messages to use\n * @param defaultLocale - default messages locale\n * @returns messages object\n */\nconst localeMessages = (element, messages, defaultLocale) => {\n // Get local\n const closestLangAttribute = element.closest('[lang]');\n const closestLang = Intl.NumberFormat.supportedLocalesOf(closestLangAttribute?.lang);\n const locale = closestLang.length > 0 && typeof closestLang[0] === 'string' ? closestLang[0] : navigator.language || defaultLocale;\n // Only keep first subtag\n const localeSubtag = locale.split('-').shift();\n // If messages is empty, return a default object\n if (Object.keys(messages).length === 0) {\n return {\n locale,\n messages: { lang: defaultLocale },\n };\n }\n // Return\n return {\n locale,\n messages: (messages[localeSubtag] || messages[defaultLocale] || { lang: defaultLocale }),\n };\n};\n/**\n * Format number to the locale currency\n * @param number - number to format\n * @param locale - locale to apply\n * @param currency - currency to apply\n * @returns formatted currency\n * @example\n * ```ts\n * localeCurrency(1234567890.12, 'fr', 'EUR') // '1 234 567 890,12\\xa0€'\n * ```\n */\nconst localeCurrency = (number, locale, currency) => new Intl.NumberFormat(locale, { style: 'currency', currency }).format(number);\n/**\n * Format number to locale\n * @param number - number to format\n * @param locale - locale to apply\n * @param decimalLength - decimal length to apply\n * @returns formatted number\n * @example\n * ```ts\n * localeNumber(1234567890.12, 'fr') // 1 234 567 890,12\n * ```\n */\nconst localeNumber = (number, locale, decimalLength = 0) => new Intl.NumberFormat(locale, { minimumFractionDigits: decimalLength }).format(Number(number));\n/**\n * Format number as percentage based on locale\n * @param number - number to format\n * @param locale - locale to apply\n * @param decimalLength - decimal length to apply\n * @returns formatted percentage\n * @example\n * ```ts\n * localePercent(0.42, 'fr', 2) // '42,00 %'\n * localePercent(0.42, 'en', 2) // '42.00%'\n * ```\n */\nconst localePercent = (number, locale, decimalLength = 0) => {\n return new Intl.NumberFormat(locale, {\n style: 'percent',\n minimumFractionDigits: decimalLength,\n maximumFractionDigits: decimalLength,\n }).format(number);\n};\n/**\n * Format number with standardized unit based on locale using Intl unit formatting\n * @param number - number to format\n * @param locale - locale to apply\n * @param unit - standardized unit (e.g., 'kilometer', 'kilogram', 'celsius')\n * @param unitDisplay - how to display the unit ('short', 'long', 'narrow')\n * @param decimalLength - decimal length to apply\n * @returns formatted number with localized unit\n * @example\n * ```ts\n * localeUnit(1234567890.12, 'fr', 'kilometer') // '1 234 567 890,12 km'\n * localeUnit(23, 'fr', 'celsius') // '23 °C'\n * localeUnit(10, 'fr', 'kilometer', 0, 'long') // '10 kilomètres'\n * ```\n */\nconst localeUnit = (number, locale, unit, unitDisplay = 'short', decimalLength = 0) => {\n return new Intl.NumberFormat(locale, {\n style: 'unit',\n unit,\n unitDisplay,\n minimumFractionDigits: decimalLength,\n maximumFractionDigits: decimalLength,\n }).format(number);\n};\n/**\n * Locale date format\n * @param date - date to format\n * @param locale - locale to apply\n * @param config - DateTimeFormatOptions object to apply\n * @returns formatted date\n * @example\n * ```ts\n * localeDate('2022-06-02', 'fr') // '02/06/2022'\n * ```\n */\nconst localeDate = (date, locale, config) => typeof date !== 'string' || date === '' || !dateRegExp.test(date) ? '' : new Intl.DateTimeFormat(locale, config).format(new Date(date));\n/**\n * Get Intl object\n * @param messages - locales to render in object format. `ex: { en: { porp: \"test\" }, fr: { porp: \"test\" }}`.\n * @param defaultLocale - fallback locale to render. `ex: 'en'`.\n * @returns from the element passed in return function you will get the matching messages object\n * @example\n * ```ts\n * import en from './en/messages.json';\n * import fr from './fr/messages.json';\n * import { defineLocales } from '@mgdis/core-ui-helpers/dist/utils';\n *\n * const defaultLocale = 'en';\n * const messages = { en, fr };\n *\n * export const initLocales = defineLocales(messages, defaultLocale);\n * ```\n */\nconst defineLocales = (messages, defaultLocale) => (element) => localeMessages(element, messages, defaultLocale);\n\nexport { defineLocales, localeCurrency, localeDate, localeDatePattern, localeNumber, localePercent, localeUnit };\n//# sourceMappingURL=index.js.map\n","// src/app-data/index.ts\nvar BUILD = {\n updatable: true,\n slotRelocation: true,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n experimentalSlotFixes: false\n};\n\n/*\n Stencil Client Platform v4.28.2 | MIT Licensed | https://stenciljs.com\n */\nvar __defProp = Object.defineProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\n\n// src/utils/constants.ts\nvar SVG_NS = \"http://www.w3.org/2000/svg\";\nvar HTML_NS = \"http://www.w3.org/1999/xhtml\";\nvar isMemberInElement = (elm, memberName) => memberName in elm;\nvar XLINK_NS = \"http://www.w3.org/1999/xlink\";\nvar win = typeof window !== \"undefined\" ? window : {};\nvar plt = {\n $flags$: 0,\n $resourcesUrl$: \"\",\n jmp: (h2) => h2(),\n raf: (h2) => requestAnimationFrame(h2),\n ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),\n rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),\n ce: (eventName, opts) => new CustomEvent(eventName, opts)\n};\n\n// src/utils/helpers.ts\nvar isDef = (v) => v != null && v !== void 0;\nvar isComplexType = (o) => {\n o = typeof o;\n return o === \"object\" || o === \"function\";\n};\n\n// src/utils/result.ts\nvar result_exports = {};\n__export(result_exports, {\n err: () => err,\n map: () => map,\n ok: () => ok,\n unwrap: () => unwrap,\n unwrapErr: () => unwrapErr\n});\nvar ok = (value) => ({\n isOk: true,\n isErr: false,\n value\n});\nvar err = (value) => ({\n isOk: false,\n isErr: true,\n value\n});\nfunction map(result, fn) {\n if (result.isOk) {\n const val = fn(result.value);\n if (val instanceof Promise) {\n return val.then((newVal) => ok(newVal));\n } else {\n return ok(val);\n }\n }\n if (result.isErr) {\n const value = result.value;\n return err(value);\n }\n throw \"should never get here\";\n}\nvar unwrap = (result) => {\n if (result.isOk) {\n return result.value;\n } else {\n throw result.value;\n }\n};\nvar unwrapErr = (result) => {\n if (result.isErr) {\n return result.value;\n } else {\n throw result.value;\n }\n};\nvar updateFallbackSlotVisibility = (elm) => {\n const childNodes = internalCall(elm, \"childNodes\");\n if (elm.tagName && elm.tagName.includes(\"-\") && elm[\"s-cr\"] && elm.tagName !== \"SLOT-FB\") {\n getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {\n if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === \"SLOT-FB\") {\n if (getSlotChildSiblings(slotNode, getSlotName(slotNode), false).length) {\n slotNode.hidden = true;\n } else {\n slotNode.hidden = false;\n }\n }\n });\n }\n let i2 = 0;\n for (i2 = 0; i2 < childNodes.length; i2++) {\n const childNode = childNodes[i2];\n if (childNode.nodeType === 1 /* ElementNode */ && internalCall(childNode, \"childNodes\").length) {\n updateFallbackSlotVisibility(childNode);\n }\n }\n};\nvar getSlottedChildNodes = (childNodes) => {\n const result = [];\n for (let i2 = 0; i2 < childNodes.length; i2++) {\n const slottedNode = childNodes[i2][\"s-nr\"] || void 0;\n if (slottedNode && slottedNode.isConnected) {\n result.push(slottedNode);\n }\n }\n return result;\n};\nfunction getHostSlotNodes(childNodes, hostName, slotName) {\n let i2 = 0;\n let slottedNodes = [];\n let childNode;\n for (; i2 < childNodes.length; i2++) {\n childNode = childNodes[i2];\n if (childNode[\"s-sr\"] && (!hostName || childNode[\"s-hn\"] === hostName) && (slotName === void 0)) {\n slottedNodes.push(childNode);\n }\n slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];\n }\n return slottedNodes;\n}\nvar getSlotChildSiblings = (slot, slotName, includeSlot = true) => {\n const childNodes = [];\n if (includeSlot && slot[\"s-sr\"] || !slot[\"s-sr\"]) childNodes.push(slot);\n let node = slot;\n while (node = node.nextSibling) {\n if (getSlotName(node) === slotName && (includeSlot || !node[\"s-sr\"])) childNodes.push(node);\n }\n return childNodes;\n};\nvar isNodeLocatedInSlot = (nodeToRelocate, slotName) => {\n if (nodeToRelocate.nodeType === 1 /* ElementNode */) {\n if (nodeToRelocate.getAttribute(\"slot\") === null && slotName === \"\") {\n return true;\n }\n if (nodeToRelocate.getAttribute(\"slot\") === slotName) {\n return true;\n }\n return false;\n }\n if (nodeToRelocate[\"s-sn\"] === slotName) {\n return true;\n }\n return slotName === \"\";\n};\nvar getSlotName = (node) => typeof node[\"s-sn\"] === \"string\" ? node[\"s-sn\"] : node.nodeType === 1 && node.getAttribute(\"slot\") || void 0;\nfunction patchSlotNode(node) {\n if (node.assignedElements || node.assignedNodes || !node[\"s-sr\"]) return;\n const assignedFactory = (elementsOnly) => (function(opts) {\n const toReturn = [];\n const slotName = this[\"s-sn\"];\n if (opts == null ? void 0 : opts.flatten) {\n console.error(`\n Flattening is not supported for Stencil non-shadow slots. \n You can use \\`.childNodes\\` to nested slot fallback content.\n If you have a particular use case, please open an issue on the Stencil repo.\n `);\n }\n const parent = this[\"s-cr\"].parentElement;\n const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);\n slottedNodes.forEach((n) => {\n if (slotName === getSlotName(n)) {\n toReturn.push(n);\n }\n });\n if (elementsOnly) {\n return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);\n }\n return toReturn;\n }).bind(node);\n node.assignedElements = assignedFactory(true);\n node.assignedNodes = assignedFactory(false);\n}\nfunction internalCall(node, method) {\n if (\"__\" + method in node) {\n const toReturn = node[\"__\" + method];\n if (typeof toReturn !== \"function\") return toReturn;\n return toReturn.bind(node);\n } else {\n if (typeof node[method] !== \"function\") return node[method];\n return node[method].bind(node);\n }\n}\nvar h = (nodeName, vnodeData, ...children) => {\n let child = null;\n let key = null;\n let slotName = null;\n let simple = false;\n let lastSimple = false;\n const vNodeChildren = [];\n const walk = (c) => {\n for (let i2 = 0; i2 < c.length; i2++) {\n child = c[i2];\n if (Array.isArray(child)) {\n walk(child);\n } else if (child != null && typeof child !== \"boolean\") {\n if (simple = !isComplexType(child)) {\n child = String(child);\n }\n if (simple && lastSimple) {\n vNodeChildren[vNodeChildren.length - 1].$text$ += child;\n } else {\n vNodeChildren.push(simple ? newVNode(null, child) : child);\n }\n lastSimple = simple;\n }\n }\n };\n walk(children);\n const vnode = newVNode(nodeName, null);\n vnode.$attrs$ = vnodeData;\n if (vNodeChildren.length > 0) {\n vnode.$children$ = vNodeChildren;\n }\n {\n vnode.$key$ = key;\n }\n {\n vnode.$name$ = slotName;\n }\n return vnode;\n};\nvar newVNode = (tag, text) => {\n const vnode = {\n $flags$: 0,\n $tag$: tag,\n $text$: text,\n $elm$: null,\n $children$: null\n };\n {\n vnode.$attrs$ = null;\n }\n {\n vnode.$key$ = null;\n }\n {\n vnode.$name$ = null;\n }\n return vnode;\n};\nvar Host = {};\nvar isHost = (node) => node && node.$tag$ === Host;\nvar setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {\n if (oldValue === newValue) {\n return;\n }\n let isProp = isMemberInElement(elm, memberName);\n let ln = memberName.toLowerCase();\n if (memberName === \"class\") {\n const classList = elm.classList;\n const oldClasses = parseClassList(oldValue);\n let newClasses = parseClassList(newValue);\n {\n classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));\n classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));\n }\n } else if (memberName === \"style\") {\n {\n for (const prop in oldValue) {\n if (!newValue || newValue[prop] == null) {\n if (prop.includes(\"-\")) {\n elm.style.removeProperty(prop);\n } else {\n elm.style[prop] = \"\";\n }\n }\n }\n }\n for (const prop in newValue) {\n if (!oldValue || newValue[prop] !== oldValue[prop]) {\n if (prop.includes(\"-\")) {\n elm.style.setProperty(prop, newValue[prop]);\n } else {\n elm.style[prop] = newValue[prop];\n }\n }\n }\n } else if (memberName === \"key\") ; else if (memberName === \"ref\") {\n if (newValue) {\n newValue(elm);\n }\n } else if ((!elm.__lookupSetter__(memberName)) && memberName[0] === \"o\" && memberName[1] === \"n\") {\n if (memberName[2] === \"-\") {\n memberName = memberName.slice(3);\n } else if (isMemberInElement(win, ln)) {\n memberName = ln.slice(2);\n } else {\n memberName = ln[2] + memberName.slice(3);\n }\n if (oldValue || newValue) {\n const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);\n memberName = memberName.replace(CAPTURE_EVENT_REGEX, \"\");\n if (oldValue) {\n plt.rel(elm, memberName, oldValue, capture);\n }\n if (newValue) {\n plt.ael(elm, memberName, newValue, capture);\n }\n }\n } else {\n const isComplex = isComplexType(newValue);\n if ((isProp || isComplex && newValue !== null) && !isSvg) {\n try {\n if (!elm.tagName.includes(\"-\")) {\n const n = newValue == null ? \"\" : newValue;\n if (memberName === \"list\") {\n isProp = false;\n } else if (oldValue == null || elm[memberName] != n) {\n if (typeof elm.__lookupSetter__(memberName) === \"function\") {\n elm[memberName] = n;\n } else {\n elm.setAttribute(memberName, n);\n }\n }\n } else if (elm[memberName] !== newValue) {\n elm[memberName] = newValue;\n }\n } catch (e) {\n }\n }\n let xlink = false;\n {\n if (ln !== (ln = ln.replace(/^xlink\\:?/, \"\"))) {\n memberName = ln;\n xlink = true;\n }\n }\n if (newValue == null || newValue === false) {\n if (newValue !== false || elm.getAttribute(memberName) === \"\") {\n if (xlink) {\n elm.removeAttributeNS(XLINK_NS, memberName);\n } else {\n elm.removeAttribute(memberName);\n }\n }\n } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {\n newValue = newValue === true ? \"\" : newValue;\n if (xlink) {\n elm.setAttributeNS(XLINK_NS, memberName, newValue);\n } else {\n elm.setAttribute(memberName, newValue);\n }\n }\n }\n};\nvar parseClassListRegex = /\\s/;\nvar parseClassList = (value) => {\n if (typeof value === \"object\" && value && \"baseVal\" in value) {\n value = value.baseVal;\n }\n if (!value || typeof value !== \"string\") {\n return [];\n }\n return value.split(parseClassListRegex);\n};\nvar CAPTURE_EVENT_SUFFIX = \"Capture\";\nvar CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + \"$\");\n\n// src/runtime/vdom/update-element.ts\nvar updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {\n const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;\n const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};\n const newVnodeAttrs = newVnode.$attrs$ || {};\n {\n for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {\n if (!(memberName in newVnodeAttrs)) {\n setAccessor(\n elm,\n memberName,\n oldVnodeAttrs[memberName],\n void 0,\n isSvgMode2,\n newVnode.$flags$);\n }\n }\n }\n for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {\n setAccessor(\n elm,\n memberName,\n oldVnodeAttrs[memberName],\n newVnodeAttrs[memberName],\n isSvgMode2,\n newVnode.$flags$);\n }\n};\nfunction sortedAttrNames(attrNames) {\n return attrNames.includes(\"ref\") ? (\n // we need to sort these to ensure that `'ref'` is the last attr\n [...attrNames.filter((attr) => attr !== \"ref\"), \"ref\"]\n ) : (\n // no need to sort, return the original array\n attrNames\n );\n}\n\n// src/runtime/vdom/vdom-render.ts\nvar scopeId;\nvar contentRef;\nvar hostTagName;\nvar useNativeShadowDom = false;\nvar checkSlotFallbackVisibility = false;\nvar checkSlotRelocate = false;\nvar isSvgMode = false;\nvar createElm = (oldParentVNode, newParentVNode, childIndex) => {\n var _a;\n const newVNode2 = newParentVNode.$children$[childIndex];\n let i2 = 0;\n let elm;\n let childNode;\n let oldVNode;\n if (!useNativeShadowDom) {\n checkSlotRelocate = true;\n if (newVNode2.$tag$ === \"slot\") {\n newVNode2.$flags$ |= newVNode2.$children$ ? (\n // slot element has fallback content\n // still create an element that \"mocks\" the slot element\n 2 /* isSlotFallback */\n ) : (\n // slot element does not have fallback content\n // create an html comment we'll use to always reference\n // where actual slot content should sit next to\n 1 /* isSlotReference */\n );\n }\n }\n if (newVNode2.$text$ !== null) {\n elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);\n } else if (newVNode2.$flags$ & 1 /* isSlotReference */) {\n elm = newVNode2.$elm$ = win.document.createTextNode(\"\");\n {\n updateElement(null, newVNode2, isSvgMode);\n }\n } else {\n if (!isSvgMode) {\n isSvgMode = newVNode2.$tag$ === \"svg\";\n }\n if (!win.document) {\n throw new Error(\n \"You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.\"\n );\n }\n elm = newVNode2.$elm$ = win.document.createElementNS(\n isSvgMode ? SVG_NS : HTML_NS,\n !useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? \"slot-fb\" : newVNode2.$tag$\n ) ;\n if (isSvgMode && newVNode2.$tag$ === \"foreignObject\") {\n isSvgMode = false;\n }\n {\n updateElement(null, newVNode2, isSvgMode);\n }\n if (isDef(scopeId) && elm[\"s-si\"] !== scopeId) {\n elm.classList.add(elm[\"s-si\"] = scopeId);\n }\n if (newVNode2.$children$) {\n for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {\n childNode = createElm(oldParentVNode, newVNode2, i2);\n if (childNode) {\n elm.appendChild(childNode);\n }\n }\n }\n {\n if (newVNode2.$tag$ === \"svg\") {\n isSvgMode = false;\n } else if (elm.tagName === \"foreignObject\") {\n isSvgMode = true;\n }\n }\n }\n elm[\"s-hn\"] = hostTagName;\n {\n if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {\n elm[\"s-sr\"] = true;\n elm[\"s-cr\"] = contentRef;\n elm[\"s-sn\"] = newVNode2.$name$ || \"\";\n elm[\"s-rf\"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;\n patchSlotNode(elm);\n oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];\n if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {\n {\n putBackInOriginalLocation(oldParentVNode.$elm$, false);\n }\n }\n {\n addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);\n }\n }\n }\n return elm;\n};\nvar putBackInOriginalLocation = (parentElm, recursive) => {\n plt.$flags$ |= 1 /* isTmpDisconnected */;\n const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);\n if (parentElm[\"s-sr\"] && BUILD.experimentalSlotFixes) ;\n for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {\n const childNode = oldSlotChildNodes[i2];\n if (childNode[\"s-hn\"] !== hostTagName && childNode[\"s-ol\"]) {\n insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));\n childNode[\"s-ol\"].remove();\n childNode[\"s-ol\"] = void 0;\n childNode[\"s-sh\"] = void 0;\n checkSlotRelocate = true;\n }\n if (recursive) {\n putBackInOriginalLocation(childNode, recursive);\n }\n }\n plt.$flags$ &= -2 /* isTmpDisconnected */;\n};\nvar addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {\n let containerElm = parentElm[\"s-cr\"] && parentElm[\"s-cr\"].parentNode || parentElm;\n let childNode;\n if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {\n containerElm = containerElm.shadowRoot;\n }\n for (; startIdx <= endIdx; ++startIdx) {\n if (vnodes[startIdx]) {\n childNode = createElm(null, parentVNode, startIdx);\n if (childNode) {\n vnodes[startIdx].$elm$ = childNode;\n insertBefore(containerElm, childNode, referenceNode(before) );\n }\n }\n }\n};\nvar removeVnodes = (vnodes, startIdx, endIdx) => {\n for (let index = startIdx; index <= endIdx; ++index) {\n const vnode = vnodes[index];\n if (vnode) {\n const elm = vnode.$elm$;\n nullifyVNodeRefs(vnode);\n if (elm) {\n {\n checkSlotFallbackVisibility = true;\n if (elm[\"s-ol\"]) {\n elm[\"s-ol\"].remove();\n } else {\n putBackInOriginalLocation(elm, true);\n }\n }\n elm.remove();\n }\n }\n }\n};\nvar updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {\n let oldStartIdx = 0;\n let newStartIdx = 0;\n let idxInOld = 0;\n let i2 = 0;\n let oldEndIdx = oldCh.length - 1;\n let oldStartVnode = oldCh[0];\n let oldEndVnode = oldCh[oldEndIdx];\n let newEndIdx = newCh.length - 1;\n let newStartVnode = newCh[0];\n let newEndVnode = newCh[newEndIdx];\n let node;\n let elmToMove;\n while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n if (oldStartVnode == null) {\n oldStartVnode = oldCh[++oldStartIdx];\n } else if (oldEndVnode == null) {\n oldEndVnode = oldCh[--oldEndIdx];\n } else if (newStartVnode == null) {\n newStartVnode = newCh[++newStartIdx];\n } else if (newEndVnode == null) {\n newEndVnode = newCh[--newEndIdx];\n } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {\n patch(oldStartVnode, newStartVnode, isInitialRender);\n oldStartVnode = oldCh[++oldStartIdx];\n newStartVnode = newCh[++newStartIdx];\n } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {\n patch(oldEndVnode, newEndVnode, isInitialRender);\n oldEndVnode = oldCh[--oldEndIdx];\n newEndVnode = newCh[--newEndIdx];\n } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {\n if ((oldStartVnode.$tag$ === \"slot\" || newEndVnode.$tag$ === \"slot\")) {\n putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);\n }\n patch(oldStartVnode, newEndVnode, isInitialRender);\n insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);\n oldStartVnode = oldCh[++oldStartIdx];\n newEndVnode = newCh[--newEndIdx];\n } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {\n if ((oldStartVnode.$tag$ === \"slot\" || newEndVnode.$tag$ === \"slot\")) {\n putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);\n }\n patch(oldEndVnode, newStartVnode, isInitialRender);\n insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);\n oldEndVnode = oldCh[--oldEndIdx];\n newStartVnode = newCh[++newStartIdx];\n } else {\n idxInOld = -1;\n {\n for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {\n if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {\n idxInOld = i2;\n break;\n }\n }\n }\n if (idxInOld >= 0) {\n elmToMove = oldCh[idxInOld];\n if (elmToMove.$tag$ !== newStartVnode.$tag$) {\n node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);\n } else {\n patch(elmToMove, newStartVnode, isInitialRender);\n oldCh[idxInOld] = void 0;\n node = elmToMove.$elm$;\n }\n newStartVnode = newCh[++newStartIdx];\n } else {\n node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);\n newStartVnode = newCh[++newStartIdx];\n }\n if (node) {\n {\n insertBefore(\n referenceNode(oldStartVnode.$elm$).parentNode,\n node,\n referenceNode(oldStartVnode.$elm$)\n );\n }\n }\n }\n }\n if (oldStartIdx > oldEndIdx) {\n addVnodes(\n parentElm,\n newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,\n newVNode2,\n newCh,\n newStartIdx,\n newEndIdx\n );\n } else if (newStartIdx > newEndIdx) {\n removeVnodes(oldCh, oldStartIdx, oldEndIdx);\n }\n};\nvar isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {\n if (leftVNode.$tag$ === rightVNode.$tag$) {\n if (leftVNode.$tag$ === \"slot\") {\n return leftVNode.$name$ === rightVNode.$name$;\n }\n if (!isInitialRender) {\n return leftVNode.$key$ === rightVNode.$key$;\n }\n if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {\n leftVNode.$key$ = rightVNode.$key$;\n }\n return true;\n }\n return false;\n};\nvar referenceNode = (node) => node && node[\"s-ol\"] || node;\nvar patch = (oldVNode, newVNode2, isInitialRender = false) => {\n const elm = newVNode2.$elm$ = oldVNode.$elm$;\n const oldChildren = oldVNode.$children$;\n const newChildren = newVNode2.$children$;\n const tag = newVNode2.$tag$;\n const text = newVNode2.$text$;\n let defaultHolder;\n if (text === null) {\n {\n isSvgMode = tag === \"svg\" ? true : tag === \"foreignObject\" ? false : isSvgMode;\n }\n {\n updateElement(oldVNode, newVNode2, isSvgMode);\n }\n if (oldChildren !== null && newChildren !== null) {\n updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);\n } else if (newChildren !== null) {\n if (oldVNode.$text$ !== null) {\n elm.textContent = \"\";\n }\n addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);\n } else if (\n // don't do this on initial render as it can cause non-hydrated content to be removed\n !isInitialRender && BUILD.updatable && oldChildren !== null\n ) {\n removeVnodes(oldChildren, 0, oldChildren.length - 1);\n }\n if (isSvgMode && tag === \"svg\") {\n isSvgMode = false;\n }\n } else if ((defaultHolder = elm[\"s-cr\"])) {\n defaultHolder.parentNode.textContent = text;\n } else if (oldVNode.$text$ !== text) {\n elm.data = text;\n }\n};\nvar relocateNodes = [];\nvar markSlotContentForRelocation = (elm) => {\n let node;\n let hostContentNodes;\n let j;\n const children = elm.__childNodes || elm.childNodes;\n for (const childNode of children) {\n if (childNode[\"s-sr\"] && (node = childNode[\"s-cr\"]) && node.parentNode) {\n hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;\n const slotName = childNode[\"s-sn\"];\n for (j = hostContentNodes.length - 1; j >= 0; j--) {\n node = hostContentNodes[j];\n if (!node[\"s-cn\"] && !node[\"s-nr\"] && node[\"s-hn\"] !== childNode[\"s-hn\"] && (true)) {\n if (isNodeLocatedInSlot(node, slotName)) {\n let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);\n checkSlotFallbackVisibility = true;\n node[\"s-sn\"] = node[\"s-sn\"] || slotName;\n if (relocateNodeData) {\n relocateNodeData.$nodeToRelocate$[\"s-sh\"] = childNode[\"s-hn\"];\n relocateNodeData.$slotRefNode$ = childNode;\n } else {\n node[\"s-sh\"] = childNode[\"s-hn\"];\n relocateNodes.push({\n $slotRefNode$: childNode,\n $nodeToRelocate$: node\n });\n }\n if (node[\"s-sr\"]) {\n relocateNodes.map((relocateNode) => {\n if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node[\"s-sn\"])) {\n relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);\n if (relocateNodeData && !relocateNode.$slotRefNode$) {\n relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;\n }\n }\n });\n }\n } else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {\n relocateNodes.push({\n $nodeToRelocate$: node\n });\n }\n }\n }\n }\n if (childNode.nodeType === 1 /* ElementNode */) {\n markSlotContentForRelocation(childNode);\n }\n }\n};\nvar nullifyVNodeRefs = (vNode) => {\n {\n vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);\n vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);\n }\n};\nvar insertBefore = (parent, newNode, reference) => {\n if (typeof newNode[\"s-sn\"] === \"string\" && !!newNode[\"s-sr\"] && !!newNode[\"s-cr\"]) {\n addRemoveSlotScopedClass(newNode[\"s-cr\"], newNode, parent, newNode.parentElement);\n }\n {\n return parent == null ? void 0 : parent.insertBefore(newNode, reference);\n }\n};\nfunction addRemoveSlotScopedClass(reference, slotNode, newParent, oldParent) {\n var _a, _b;\n let scopeId2;\n if (reference && typeof slotNode[\"s-sn\"] === \"string\" && !!slotNode[\"s-sr\"] && reference.parentNode && reference.parentNode[\"s-sc\"] && (scopeId2 = slotNode[\"s-si\"] || reference.parentNode[\"s-sc\"])) {\n const scopeName = slotNode[\"s-sn\"];\n const hostName = slotNode[\"s-hn\"];\n (_a = newParent.classList) == null ? void 0 : _a.add(scopeId2 + \"-s\");\n if (oldParent && ((_b = oldParent.classList) == null ? void 0 : _b.contains(scopeId2 + \"-s\"))) {\n let child = (oldParent.__childNodes || oldParent.childNodes)[0];\n let found = false;\n while (child) {\n if (child[\"s-sn\"] !== scopeName && child[\"s-hn\"] === hostName && !!child[\"s-sr\"]) {\n found = true;\n break;\n }\n child = child.nextSibling;\n }\n if (!found) oldParent.classList.remove(scopeId2 + \"-s\");\n }\n }\n}\nvar renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {\n var _a, _b, _c, _d, _e;\n const hostElm = hostRef.$hostElement$;\n const cmpMeta = hostRef.$cmpMeta$;\n const oldVNode = hostRef.$vnode$ || newVNode(null, null);\n const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);\n hostTagName = hostElm.tagName;\n if (cmpMeta.$attrsToReflect$) {\n rootVnode.$attrs$ = rootVnode.$attrs$ || {};\n cmpMeta.$attrsToReflect$.map(\n ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]\n );\n }\n if (isInitialLoad && rootVnode.$attrs$) {\n for (const key of Object.keys(rootVnode.$attrs$)) {\n if (hostElm.hasAttribute(key) && ![\"key\", \"ref\", \"style\", \"class\"].includes(key)) {\n rootVnode.$attrs$[key] = hostElm[key];\n }\n }\n }\n rootVnode.$tag$ = null;\n rootVnode.$flags$ |= 4 /* isHost */;\n hostRef.$vnode$ = rootVnode;\n rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;\n {\n scopeId = hostElm[\"s-sc\"];\n }\n useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);\n {\n contentRef = hostElm[\"s-cr\"];\n checkSlotFallbackVisibility = false;\n }\n patch(oldVNode, rootVnode, isInitialLoad);\n {\n plt.$flags$ |= 1 /* isTmpDisconnected */;\n if (checkSlotRelocate) {\n markSlotContentForRelocation(rootVnode.$elm$);\n for (const relocateData of relocateNodes) {\n const nodeToRelocate = relocateData.$nodeToRelocate$;\n if (!nodeToRelocate[\"s-ol\"] && win.document) {\n const orgLocationNode = win.document.createTextNode(\"\");\n orgLocationNode[\"s-nr\"] = nodeToRelocate;\n insertBefore(nodeToRelocate.parentNode, nodeToRelocate[\"s-ol\"] = orgLocationNode, nodeToRelocate);\n }\n }\n for (const relocateData of relocateNodes) {\n const nodeToRelocate = relocateData.$nodeToRelocate$;\n const slotRefNode = relocateData.$slotRefNode$;\n if (slotRefNode) {\n const parentNodeRef = slotRefNode.parentNode;\n let insertBeforeNode = slotRefNode.nextSibling;\n {\n let orgLocationNode = (_a = nodeToRelocate[\"s-ol\"]) == null ? void 0 : _a.previousSibling;\n while (orgLocationNode) {\n let refNode = (_b = orgLocationNode[\"s-nr\"]) != null ? _b : null;\n if (refNode && refNode[\"s-sn\"] === nodeToRelocate[\"s-sn\"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {\n refNode = refNode.nextSibling;\n while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode[\"s-sr\"])) {\n refNode = refNode == null ? void 0 : refNode.nextSibling;\n }\n if (!refNode || !refNode[\"s-nr\"]) {\n insertBeforeNode = refNode;\n break;\n }\n }\n orgLocationNode = orgLocationNode.previousSibling;\n }\n }\n const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;\n const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;\n if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {\n if (nodeToRelocate !== insertBeforeNode) {\n if (!nodeToRelocate[\"s-hn\"] && nodeToRelocate[\"s-ol\"]) {\n nodeToRelocate[\"s-hn\"] = nodeToRelocate[\"s-ol\"].parentNode.nodeName;\n }\n insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);\n if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== \"SLOT-FB\") {\n nodeToRelocate.hidden = (_c = nodeToRelocate[\"s-ih\"]) != null ? _c : false;\n }\n }\n }\n nodeToRelocate && typeof slotRefNode[\"s-rf\"] === \"function\" && slotRefNode[\"s-rf\"](slotRefNode);\n } else {\n if (nodeToRelocate.nodeType === 1 /* ElementNode */) {\n if (isInitialLoad) {\n nodeToRelocate[\"s-ih\"] = (_d = nodeToRelocate.hidden) != null ? _d : false;\n }\n nodeToRelocate.hidden = true;\n }\n }\n }\n }\n if (checkSlotFallbackVisibility) {\n updateFallbackSlotVisibility(rootVnode.$elm$);\n }\n plt.$flags$ &= -2 /* isTmpDisconnected */;\n relocateNodes.length = 0;\n }\n if (BUILD.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {\n const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;\n for (const childNode of children) {\n if (childNode[\"s-hn\"] !== hostTagName && !childNode[\"s-sh\"]) {\n if (isInitialLoad && childNode[\"s-ih\"] == null) {\n childNode[\"s-ih\"] = (_e = childNode.hidden) != null ? _e : false;\n }\n childNode.hidden = true;\n }\n }\n }\n contentRef = void 0;\n};\n\n/**\n * @type {import('htmlfy').Config}\n */\nconst CONFIG = {\n content_wrap: 0,\n ignore: [],\n ignore_with: '_!i-£___£%_',\n strict: false,\n tab_size: 2,\n tag_wrap: 0,\n tag_wrap_width: 80,\n trim: []\n};\n\nconst CONTENT_IGNORE_STRING = '__!i-£___£%__';\nconst IGNORE_STRING = '!i-£___£%_';\n\nconst VOID_ELEMENTS = [\n 'area', 'base', 'br', 'col', 'embed', 'hr', \n 'img', 'input', 'link', 'meta',\n 'param', 'source', 'track', 'wbr'\n];\n\n/**\n * Checks if content contains at least one HTML element or custom HTML element.\n * \n * The first regex matches void and self-closing elements.\n * The second regex matches normal HTML elements, plus they can have a namespace.\n * The third regex matches custom HTML elemtns, plus they can have a namespace.\n * \n * HTML elements should begin with a letter, and can end with a letter or number.\n * \n * Custom elements must begin with a letter, and can end with a letter, number,\n * hyphen, underscore, or period. However, all letters must be lowercase.\n * They must have at least one hyphen, and can only have periods and underscores if there is a hyphen.\n * \n * These regexes are based on\n * https://w3c.github.io/html-reference/syntax.html#tag-name\n * and\n * https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n * respectively.\n * \n * @param {string} content Content to evaluate.\n * @returns {boolean} A boolean.\n */\nconst isHtml = (content) => \n /<(?:[A-Za-z]+[A-Za-z0-9]*)(?:\\s+.*?)*?\\/{0,1}>/.test(content) ||\n /<(?<Element>(?:[A-Za-z]+[A-Za-z0-9]*:)?(?:[A-Za-z]+[A-Za-z0-9]*))(?:\\s+.*?)*?>(?:.|\\n)*?<\\/{1}\\k<Element>>/.test(content) || \n /<(?<Element>(?:[a-z][a-z0-9._]*:)?[a-z][a-z0-9._]*-[a-z0-9._-]+)(?:\\s+.*?)*?>(?:.|\\n)*?<\\/{1}\\k<Element>>/.test(content);\n\n/**\n * Generic utility which merges two objects.\n * \n * @param {any} current Original object.\n * @param {any} updates Object to merge with original.\n * @returns {any}\n */\nconst mergeObjects = (current, updates) => {\n if (!current || !updates)\n throw new Error(\"Both 'current' and 'updates' must be passed-in to mergeObjects()\")\n\n /**\n * @type {any}\n */\n let merged;\n \n if (Array.isArray(current)) {\n merged = structuredClone(current).concat(updates);\n } else if (typeof current === 'object') {\n merged = { ...current };\n for (let key of Object.keys(updates)) {\n if (typeof updates[key] !== 'object') {\n merged[key] = updates[key];\n } else {\n /* key is an object, run mergeObjects again. */\n merged[key] = mergeObjects(merged[key] || {}, updates[key]);\n }\n }\n }\n\n return merged\n};\n\n/**\n * Merge a user config with the default config.\n * \n * @param {import('htmlfy').Config} dconfig The default config.\n * @param {import('htmlfy').UserConfig} config The user config.\n * @returns {import('htmlfy').Config}\n */\nconst mergeConfig = (dconfig, config) => {\n /**\n * We need to make a deep copy of `dconfig`,\n * otherwise we end up altering the original `CONFIG` because `dconfig` is a reference to it.\n */\n return mergeObjects(structuredClone(dconfig), config)\n};\n\n/**\n * \n * @param {string} html \n */\nconst protectAttributes = (html) => {\n html = html.replace(/<[\\w:\\-]+([^>]*[^\\/])>/g, (/** @type {string} */match, /** @type {any} */capture) => {\n return match.replace(capture, (match) => {\n return match\n .replace(/\\n/g, IGNORE_STRING + 'nl!')\n .replace(/\\r/g, IGNORE_STRING + 'cr!')\n .replace(/\\s/g, IGNORE_STRING + 'ws!')\n })\n });\n\n return html\n};\n\n/**\n * \n * @param {string} html \n */\nconst protectContent = (html) => {\n return html\n .replace(/\\n/g, CONTENT_IGNORE_STRING + 'nl!')\n .replace(/\\r/g, CONTENT_IGNORE_STRING + 'cr!')\n .replace(/\\s/g, CONTENT_IGNORE_STRING + 'ws!')\n};\n\n/**\n * \n * @param {string} html \n */\nconst finalProtectContent = (html) => {\n const regex = /\\s*<([a-zA-Z0-9:-]+)[^>]*>\\n\\s*<\\/\\1>(?=\\n[ ]*[^\\n]*__!i-£___£%__[^\\n]*\\n)(\\n[ ]*\\S[^\\n]*\\n)|<([a-zA-Z0-9:-]+)[^>]*>(?=\\n[ ]*[^\\n]*__!i-£___£%__[^\\n]*\\n)(\\n[ ]*\\S[^\\n]*\\n\\s*)<\\/\\3>/g;\n return html\n .replace(regex, (/** @type {string} */match, p1, p2, p3, p4) => {\n const text_to_protect = p2 || p4;\n\n if (!text_to_protect)\n return match\n\n const protected_text = text_to_protect\n .replace(/\\n/g, CONTENT_IGNORE_STRING + 'nl!')\n .replace(/\\r/g, CONTENT_IGNORE_STRING + 'cr!')\n .replace(/\\s/g, CONTENT_IGNORE_STRING + \"ws!\");\n\n return match.replace(text_to_protect, protected_text)\n })\n};\n\n/**\n * Replace html brackets with ignore string.\n * \n * @param {string} html \n * @returns {string}\n */\nconst setIgnoreAttribute = (html) => {\n const regex = /<([A-Za-z][A-Za-z0-9]*|[a-z][a-z0-9._]*-[a-z0-9._-]+)((?:\\s+[A-Za-z0-9_-]+=\"[^\"]*\"|\\s*[a-z]*)*)>/g;\n\n html = html.replace(regex, (/** @type {string} */match, p1, p2) => {\n return match.replace(p2, (match) => {\n return match\n .replace(/</g, IGNORE_STRING + 'lt!')\n .replace(/>/g, IGNORE_STRING + 'gt!')\n })\n });\n \n return html\n};\n\n/**\n * Trim leading and trailing whitespace characters.\n * \n * @param {string} html\n * @param {string[]} trim\n * @returns {string}\n */\nconst trimify = (html, trim) => {\n for (let e = 0; e < trim.length; e++) {\n /* Whitespace character must be escaped with '\\' or RegExp() won't include it. */\n const leading_whitespace = new RegExp(`(<${trim[e]}[^>]*>)\\\\s+`, \"g\");\n const trailing_whitespace = new RegExp(`\\\\s+(</${trim[e]}>)`, \"g\");\n\n html = html\n .replace(leading_whitespace, '$1')\n .replace(trailing_whitespace, '$1');\n }\n\n return html\n};\n\n/**\n * \n * @param {string} html \n */\nconst unprotectAttributes = (html) => {\n html = html.replace(/<[\\w:\\-]+([^>]*[^\\/])>/g, (/** @type {string} */match, /** @type {any} */capture) => {\n return match.replace(capture, (match) => {\n return match\n .replace(new RegExp(IGNORE_STRING + 'nl!', \"g\"), '\\n')\n .replace(new RegExp(IGNORE_STRING + 'cr!', \"g\"), '\\r')\n .replace(new RegExp(IGNORE_STRING + 'ws!', \"g\"), ' ')\n })\n });\n\n return html\n};\n\n/**\n * \n * @param {string} html \n */\nconst unprotectContent = (html) => {\n html = html.replace(/.*__!i-£___£%__[a-z]{2}!.*/g, (/** @type {string} */match) => {\n return match.replace(/__!i-£___£%__[a-z]{2}!/g, (match) => {\n return match\n .replace(new RegExp(CONTENT_IGNORE_STRING + 'nl!', \"g\"), '\\n')\n .replace(new RegExp(CONTENT_IGNORE_STRING + 'cr!', \"g\"), '\\r')\n .replace(new RegExp(CONTENT_IGNORE_STRING + 'ws!', \"g\"), ' ')\n })\n });\n\n return html\n};\n\nconst escapedIgnoreString = IGNORE_STRING.replace(\n /[-\\/\\\\^$*+?.()|[\\]{}]/g,\n \"\\\\$&\"\n);\nconst ltPlaceholderRegex = new RegExp(escapedIgnoreString + \"lt!\", \"g\");\nconst gtPlaceholderRegex = new RegExp(escapedIgnoreString + \"gt!\", \"g\");\n\n/**\n * Replace ignore string with html brackets.\n * \n * @param {string} html \n * @returns {string}\n */\nconst unsetIgnoreAttribute = (html) => {\n /* Regex to find opening tags and capture their attributes. */\n const tagRegex = /<([\\w:\\-]+)([^>]*)>/g;\n\n return html.replace(\n tagRegex,\n (\n /** @type {string} */ fullMatch,\n /** @type {string} */ tagName,\n /** @type {string} */ attributesCapture\n ) => {\n const processedAttributes = attributesCapture\n .replace(ltPlaceholderRegex, \"<\")\n .replace(gtPlaceholderRegex, \">\");\n\n /* Reconstruct the tag. */\n return `<${tagName}${processedAttributes}>`\n }\n )\n};\n\n/**\n * Validate any passed-in config options and merge with CONFIG.\n * \n * @param {import('htmlfy').UserConfig} config A user config.\n * @returns {import('htmlfy').Config} A validated config.\n */\nconst validateConfig = (config) => {\n if (typeof config !== 'object') throw new Error('Config must be an object.')\n\n const config_empty = !(\n Object.hasOwn(config, 'content_wrap') ||\n Object.hasOwn(config, 'ignore') || \n Object.hasOwn(config, 'ignore_with') || \n Object.hasOwn(config, 'strict') || \n Object.hasOwn(config, 'tab_size') || \n Object.hasOwn(config, 'tag_wrap') || \n Object.hasOwn(config, 'tag_wrap_width') || \n Object.hasOwn(config, 'trim')\n );\n\n if (config_empty) return CONFIG\n\n let tab_size = config.tab_size;\n\n if (tab_size) {\n if (typeof tab_size !== 'number') throw new Error(`tab_size must be a number, not ${typeof config.tab_size}.`)\n\n const safe = Number.isSafeInteger(tab_size);\n if (!safe) throw new Error(`Tab size ${tab_size} is not safe. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger for more info.`)\n\n /** \n * Round down, just in case a safe floating point,\n * like 4.0, was passed.\n */\n tab_size = Math.floor(tab_size);\n if (tab_size < 1 || tab_size > 16) throw new Error('Tab size out of range. Expecting 1 to 16.')\n \n config.tab_size = tab_size;\n }\n\n if (Object.hasOwn(config, 'content_wrap') && typeof config.content_wrap !== 'number')\n throw new Error(`content_wrap config must be a number, not ${typeof config.tag_wrap_width}.`)\n\n if (Object.hasOwn(config, 'ignore') && (!Array.isArray(config.ignore) || !config.ignore?.every((e) => typeof e === 'string')))\n throw new Error('Ignore config must be an array of strings.')\n\n if (Object.hasOwn(config, 'ignore_with') && typeof config.ignore_with !== 'string')\n throw new Error(`Ignore_with config must be a string, not ${typeof config.ignore_with}.`)\n\n if (Object.hasOwn(config, 'strict') && typeof config.strict !== 'boolean')\n throw new Error(`Strict config must be a boolean, not ${typeof config.strict}.`)\n\n /* TODO remove in v0.9.0 */\n if (Object.hasOwn(config, 'tag_wrap') && typeof config.tag_wrap === 'boolean') {\n console.warn('tag_wrap as a boolean is deprecated, and will not be supported in v0.9.0+. Use `tag_wrap: <number>` instead; where <number> is the max character width acceptable before wrapping attributes.');\n if (config.tag_wrap_width)\n config.tag_wrap = config.tag_wrap_width;\n else\n config.tag_wrap = CONFIG.tag_wrap_width;\n }\n \n if (Object.hasOwn(config, 'tag_wrap') && typeof config.tag_wrap !== 'number')\n throw new Error(`tag_wrap config must be a number, not ${typeof config.tag_wrap}.`)\n\n /* TODO remove in v0.9.0 */\n if (Object.hasOwn(config, 'tag_wrap_width'))\n console.warn('tag_wrap_width is deprecated, and will not be supported in v0.9.0+. Use `tag_wrap: <number>` instead; where <number> is the max character width acceptable before wrapping attributes.');\n\n /* TODO remove in v0.9.0 */\n if (Object.hasOwn(config, 'tag_wrap_width') && typeof config.tag_wrap_width !== 'number')\n throw new Error(`tag_wrap_width config must be a number, not ${typeof config.tag_wrap_width}.`)\n\n if (Object.hasOwn(config, 'trim') && (!Array.isArray(config.trim) || !config.trim?.every((e) => typeof e === 'string')))\n throw new Error('Trim config must be an array of strings.')\n\n return mergeConfig(CONFIG, config)\n\n};\n\n/**\n * \n * @param {string} text \n * @param {number} width \n * @param {string} indent\n */\nconst wordWrap = (text, width, indent) => {\n const words = text.trim().split(/\\s+/);\n \n if (words.length === 0 || (words.length === 1 && words[0] === ''))\n return \"\"\n\n const lines = [];\n let current_line = \"\";\n const padding_string = indent;\n\n words.forEach((word) => {\n if (word === \"\") return\n\n if (word.length >= width) {\n /* If there's content on the current line, push it first with correct padding. */\n if (current_line !== \"\")\n lines.push(lines.length === 0 ? indent + current_line : padding_string + current_line);\n\n /* Push a long word on its own line with correct padding. */\n lines.push(lines.length === 0 ? indent + word : padding_string + word);\n current_line = \"\"; // Reset current line\n return // Move to the next word\n }\n\n /* Check if adding the next word exceeds the wrap width. */\n const test_line = current_line === \"\" ? word : current_line + \" \" + word;\n\n if (test_line.length <= width) {\n current_line = test_line;\n } else {\n /* Word doesn't fit, finish the current line and push it. */\n if (current_line !== \"\") {\n /* Add padding based on whether it's the first line added or not. */\n lines.push(lines.length === 0 ? indent + current_line : padding_string + current_line);\n }\n /* Start a new line with the current word. */\n current_line = word;\n }\n });\n\n /* Add the last remaining line with appropriate padding. */\n if (current_line !== \"\")\n lines.push(lines.length === 0 ? indent + current_line : padding_string + current_line);\n\n const result = lines.join(\"\\n\");\n\n return protectContent(result)\n};\n\n/**\n * Extract any HTML blocks to be ignored,\n * and replace them with a placeholder\n * for re-insertion later.\n * \n * @param {string} html \n * @param {import('htmlfy').Config} config \n * @returns {{ html_with_markers: string, extracted_map: Map<any,any> }}\n */\nfunction extractIgnoredBlocks(html, config) {\n let current_html = html;\n const extracted_blocks = new Map();\n let marker_id = 0;\n const MARKER_PREFIX = \"___HTMLFY_SPECIAL_IGNORE_MARKER_\";\n\n for (const tag of config.ignore) {\n /* Ensure tag is escaped if it can contain regex special chars. */\n const safe_tag_name = tag.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\");\n\n const regex = new RegExp(\n `<${safe_tag_name}[^>]*>.*?<\\/${safe_tag_name}>`,\n \"gs\" // global and dotAll\n );\n\n let match;\n const replacements = []; // Store [startIndex, endIndex, marker]\n\n while ((match = regex.exec(current_html)) !== null) {\n const marker = `${MARKER_PREFIX}${marker_id++}___`;\n extracted_blocks.set(marker, match[0]); // Store the full original match\n replacements.push({\n start: match.index,\n end: regex.lastIndex,\n marker: marker,\n });\n }\n\n /* Apply replacements from the end to the beginning to keep indices valid. */\n for (let i = replacements.length - 1; i >= 0; i--) {\n const rep = replacements[i];\n current_html =\n current_html.substring(0, rep.start) +\n rep.marker +\n current_html.substring(rep.end);\n }\n }\n return { html_with_markers: current_html, extracted_map: extracted_blocks }\n}\n\n/**\n * Re-insert ignored HTML blocks.\n * \n * @param {string} html_with_markers \n * @param {Map<any,any>} extracted_map \n * @returns \n */\nfunction reinsertIgnoredBlocks(html_with_markers, extracted_map) {\n let final_html = html_with_markers;\n\n for (const [marker, original_block] of extracted_map) {\n final_html = final_html.split(marker).join(original_block);\n }\n return final_html\n}\n\n/**\n * Ensure void elements are \"self-closing\".\n * \n * @param {string} html The HTML string to evaluate.\n * @param {boolean} check_html Check to see if the content contains any HTML, before processing.\n * @returns {string}\n * @example <br> => <br />\n */\nconst closify = (html, check_html = true) => {\n if (check_html && !isHtml(html)) return html\n \n return html.replace(/<([a-zA-Z\\-0-9:]+)[^>]*>/g, (match, name) => {\n if (VOID_ELEMENTS.indexOf(name) > -1)\n return (`${match.substring(0, match.length - 1)} />`).replace(/\\/\\s\\//g, '/')\n\n return match.replace(/[\\s]?\\/>/g, `></${name}>`)\n })\n};\n\n/**\n * Enforce entity characters for textarea content.\n * To also minifiy, pass `minify` as `true`.\n * \n * @param {string} html The HTML string to evaluate.\n * @param {boolean} [minify] Fully minifies the content of textarea elements. \n * Defaults to `false`. We recommend a value of `true` if you're running `entify()` \n * as a standalone function.\n * @returns {string}\n * @example <textarea>3 > 2</textarea> => <textarea>3 > 2</textarea>\n */\nconst entify = (html, minify = false) => {\n /** \n * Use entities inside textarea content.\n */\n html = html.replace(/<textarea[^>]*>((.|\\n)*?)<\\/textarea>/g, (match, capture) => {\n return match.replace(capture, (match) => {\n return match\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(/\\n/g, ' ')\n .replace(/\\r/g, ' ')\n .replace(/\\s/g, ' ')\n })\n });\n\n /* Typical minification, but only for textareas. */\n if (minify) {\n html = html.replace(/<textarea[^>]*>((.|\\n)*?)<\\/textarea>/g, (match, capture) => {\n /* Replace things inside the textarea content. */\n match = match.replace(capture, (match) => {\n return match\n .replace(/\\n|\\t/g, '')\n .replace(/[a-z]+=\"\\s*\"/ig, '')\n .replace(/>\\s+</g, '><')\n .replace(/\\s+/g, ' ')\n });\n\n /* Replace things in the entire element */\n match = match\n .replace(/\\s+/g, ' ')\n .replace(/\\s>/g, '>')\n .replace(/>\\s/g, '>')\n .replace(/\\s</g, '<')\n .replace(/class=[\"']\\s/g, (match) => match.replace(/\\s/g, ''))\n .replace(/(class=.*)\\s([\"'])/g, '$1'+'$2');\n return match\n });\n }\n\n return html\n};\n\n/**\n * Creates a single-line HTML string\n * by removing line returns, tabs, and relevant spaces.\n * \n * @param {string} html The HTML string to minify.\n * @param {boolean} check_html Check to see if the content contains any HTML, before processing.\n * @returns {string} A minified HTML string.\n */\nconst minify = (html, check_html = true) => {\n if (check_html && !isHtml(html)) return html\n\n /**\n * Ensure textarea content is specially minified and protected\n * before general minification.\n */\n html = entify(html);\n\n /* All other minification. */\n // Remove ALL newlines and tabs explicitly.\n html = html.replace(/\\n|\\t/g, '');\n\n // Remove whitespace ONLY between tags.\n html = html.replace(/>\\s+</g, \"><\");\n\n // Collapse any remaining multiple spaces to single spaces.\n html = html.replace(/ {2,}/g, ' ');\n\n // Remove specific single spaces OR whitespace within closing tags.\n html = html.replace(/ >/g, \">\"); // <tag > -> <tag>\n html = html.replace(/ </g, \"<\"); // Text < -> Text< (Also handles leading space before tag)\n html = html.replace(/> /g, \">\"); // > Text -> >Text\n html = html.replace(/<\\s*\\//g, '</'); // < /tag -> </tag>\n\n // Trim spaces around equals signs in attributes (run before value trim)\n // This handles `attr = \"value\"` -> `attr=\"value\"`\n html = html.replace(/ = /g, \"=\");\n // Consider safer alternatives if needed (e.g., / = \"/g, '=\"')\n\n // Trim whitespace inside attribute values\n html = html.replace(\n /([a-zA-Z0-9_-]+)=(['\"])(.*?)\\2/g,\n (match, attr_name, quote, value) => {\n // value.trim() handles both leading/trailing spaces\n // and cases where the value is only whitespace (becomes empty string)\n const trimmed_value = value.trim();\n return `${attr_name}=${quote}${trimmed_value}${quote}`\n }\n );\n\n // Final trim for the whole string\n html = html.trim();\n\n return html\n};\n\n/**\n * @type {boolean}\n */\nlet strict;\n\n/**\n * @type {string[]}\n */\nlet trim;\n\n/**\n * @type {{ line: Record<string,string>[] }}\n */\nconst convert = {\n line: []\n};\n\n/**\n * @type {Map<any,any>}\n */\nlet ignore_map;\n\n/**\n * Isolate tags, content, and comments.\n * \n * @param {string} html The HTML string to evaluate.\n * @returns {string}\n * @example <div>Hello World!</div> => \n * [#-# : 0 : <div> : #-#]\n * Hello World!\n * [#-# : 1 : </div> : #-#]\n */\nconst enqueue = (html) => {\n convert.line = [];\n let i = -1;\n /* Regex to find tags OR text content between tags. */\n const regex = /(<[^>]+>)|([^<]+)/g;\n\n html = html.replace(regex, (match, c1, c2) => {\n if (c1) {\n convert.line.push({ type: \"tag\", value: match });\n } else if (c2 && c2.trim().length > 0) {\n /* It's text content (and not just whitespace). */\n convert.line.push({ type: \"text\", value: match });\n }\n\n i++;\n return `\\n[#-# : ${i} : ${match} : #-#]\\n`\n });\n\n return html\n};\n\n/**\n * Preprocess the HTML.\n * \n * @param {string} html The HTML string to preprocess.\n * @returns {string}\n */\nconst preprocess = (html) => {\n html = closify(html, false);\n\n if (trim.length > 0) html = trimify(html, trim);\n\n html = minify(html, false);\n html = enqueue(html);\n\n return html\n};\n\n/**\n * \n * @param {string} html The HTML string to process.\n * @param {import('htmlfy').Config} config \n * @returns {string}\n */\nconst process = (html, config) => {\n const step = \" \".repeat(config.tab_size);\n const tag_wrap = config.tag_wrap;\n const content_wrap = config.content_wrap;\n const ignore_with = config.ignore_with;\n const placeholder_template = `-${ignore_with}`;\n\n /* Track current number of indentations needed. */\n let indents = '';\n\n /** @type string[] */\n const output_lines = [];\n const tag_regex = /<[A-Za-z]+\\b[^>]*(?:.|\\n)*?\\/?>/g; /* Is opening tag or void element. */\n const attribute_regex = /\\s{1}[A-Za-z-]+(?:=\".*?\")?/g; /* Matches all tag/element attributes. */\n\n /* Process lines and indent. */\n convert.line.forEach((source, index) => {\n let current_line_value = source.value;\n\n const is_ignored_content =\n current_line_value.startsWith(placeholder_template + \"lt--\") ||\n current_line_value.startsWith(placeholder_template + \"gt--\") ||\n current_line_value.startsWith(placeholder_template + \"nl--\") ||\n current_line_value.startsWith(placeholder_template + \"cr--\") ||\n current_line_value.startsWith(placeholder_template + \"ws--\") ||\n current_line_value.startsWith(placeholder_template + \"tab--\");\n\n let subtrahend = 0;\n const prev_line_data = convert.line[index - 1];\n const prev_line_value = prev_line_data?.value ?? \"\"; // Use empty string if no prev line\n\n /**\n * Arbitratry character, to keep track of the string's length.\n */\n indents += '0';\n\n if (index === 0) subtrahend++;\n /* We're processing a closing tag. */\n if (current_line_value.trim().startsWith(\"</\")) subtrahend++;\n /* prevLine is a doctype declaration. */\n if (prev_line_value.trim().startsWith(\"<!doctype\")) subtrahend++;\n /* prevLine is a comment. */\n if (prev_line_value.trim().startsWith(\"<!--\")) subtrahend++;\n /* prevLine is a self-closing tag. */\n if (prev_line_value.trim().endsWith(\"/>\")) subtrahend++;\n /* prevLine is a closing tag. */\n if (prev_line_value.trim().startsWith(\"</\")) subtrahend++;\n /* prevLine is text. */\n if (prev_line_data?.type === \"text\") subtrahend++;\n\n /* Determine offset for line indentation. */\n const offset = Math.max(0, indents.length - subtrahend);\n /* Correct indent level for *this* line's content */\n const current_indent_level = offset; // Store the level for this line\n\n indents = indents.substring(0, current_indent_level); // Adjust for *next* round\n\n /**\n * Starts with a single punctuation character.\n * Add punctuation to end of previous line.\n * \n * TODO - Implement inline groups instead?\n */\n if (source.type === 'text' && /^[!,;\\.]/.test(current_line_value)) {\n if (current_line_value.length === 1) {\n output_lines[output_lines.length - 1] = \n output_lines.at(-1) + current_line_value;\n return\n } else {\n output_lines[output_lines.length - 1] = \n output_lines.at(-1) + current_line_value.charAt(0);\n current_line_value = current_line_value.slice(1).trim();\n }\n }\n\n const padding = step.repeat(current_indent_level);\n\n if (is_ignored_content) {\n /* Stop processing this line, as it's set to be ignored. */\n output_lines.push(current_line_value);\n } else {\n /* Remove comment. */\n if (strict && current_line_value.trim().startsWith(\"<!--\"))\n return\n\n let result = current_line_value;\n\n if (\n source.type === 'text' && \n content_wrap > 0 && \n result.length >= content_wrap\n ) {\n result = wordWrap(result, content_wrap, padding);\n }\n /* Wrap the attributes of open tags and void elements. */\n else if (\n tag_wrap > 0 &&\n result.length > tag_wrap &&\n tag_regex.test(result)\n ) {\n tag_regex.lastIndex = 0; // Reset stateful regex\n attribute_regex.lastIndex = 0; // Reset stateful regex\n\n const tag_parts = result.split(attribute_regex).filter(Boolean);\n\n if (tag_parts.length >= 2) {\n const attributes = result.matchAll(attribute_regex);\n const inner_padding = padding + step;\n let wrapped_tag = padding + tag_parts[0] + \"\\n\";\n\n for (const a of attributes) {\n const attribute_string = a[0].trim();\n wrapped_tag += inner_padding + attribute_string + \"\\n\";\n }\n\n const tag_name_match = tag_parts[0].match(/<([A-Za-z_:-]+)/);\n const tag_name = tag_name_match ? tag_name_match[1] : \"\";\n const is_void = VOID_ELEMENTS.includes(tag_name);\n const closing_part = tag_parts[1].trim();\n const closing_padding = padding + (strict && is_void ? \" \" : \"\"); // Add space if void/strict\n\n wrapped_tag += closing_padding + closing_part;\n\n result = wrapped_tag; // Assign the fully wrapped string\n } else {\n result = padding + result;\n }\n } else {\n /* Apply simple indentation (if no wrapping occurred) */\n result = padding + result;\n }\n\n /* Add the processed line (or lines if wordWrap creates them) to the output */\n output_lines.push(result);\n }\n });\n\n /* Join all processed lines into the final HTML string */\n let final_html = output_lines.join(\"\\n\");\n\n /* Preserve wrapped attributes. */\n if (tag_wrap > 0) final_html = protectAttributes(final_html);\n\n /* Extra preserve wrapped content. */\n if (content_wrap > 0 && /\\n[ ]*[^\\n]*__!i-£___£%__[^\\n]*\\n/.test(final_html))\n final_html = finalProtectContent(final_html);\n\n /* Remove line returns, tabs, and consecutive spaces within html elements or their content. */\n final_html = final_html.replace(\n /<(?<Element>.+).*>[^<]*?[^><\\/\\s][^<]*?<\\/{1}\\k<Element>|<script[^>]*>\\s+<\\/script>|<(\\w+)>\\s+<\\/(\\w+)|<(?:([\\w:\\._-]+)|([\\w:\\._-]+)[^>]*[^\\/])>\\s+<\\/([\\w:\\._-]+)>/g,\n match => match.replace(/\\n|\\t|\\s{2,}/g, '')\n );\n\n /* Revert wrapped content. */\n if (content_wrap > 0) final_html = unprotectContent(final_html);\n\n /* Revert wrapped attributes. */\n if (tag_wrap > 0) final_html = unprotectAttributes(final_html);\n\n /* Remove self-closing nature of void elements. */\n if (strict) final_html = final_html.replace(/\\s\\/>|\\/>/g, '>');\n\n /* Trim leading and/or trailing line returns. */\n if (final_html.startsWith(\"\\n\")) final_html = final_html.substring(1);\n if (final_html.endsWith(\"\\n\")) final_html = final_html.substring(0, final_html.length - 1);\n\n return final_html\n};\n\n/**\n * Format HTML with line returns and indentations.\n * \n * @param {string} html The HTML string to prettify.\n * @param {import('htmlfy').UserConfig} [config] A user configuration object.\n * @returns {string} A well-formed HTML string.\n */\nconst prettify = (html, config) => {\n /* Return content as-is if it does not contain any HTML elements. */\n if (!isHtml(html)) return html\n\n const validated_config = config ? validateConfig(config) : CONFIG;\n strict = validated_config.strict;\n\n const ignore = validated_config.ignore.length > 0;\n trim = validated_config.trim;\n\n /* Extract ignored elements. */\n if (ignore) {\n const { html_with_markers, extracted_map } = extractIgnoredBlocks(html, validated_config);\n html = html_with_markers;\n ignore_map = extracted_map;\n }\n\n /* Preserve html text within attribute values. */\n html = setIgnoreAttribute(html);\n\n html = preprocess(html);\n html = process(html, validated_config);\n\n /* Revert html text within attribute values. */\n html = unsetIgnoreAttribute(html);\n\n /* Re-insert ignored elements. */\n if (ignore) {\n html = reinsertIgnoredBlocks(html, ignore_map);\n }\n\n return html\n};\n\n/**\n * Render attribute on the given element\n * @param element - targeted to render attribute\n * @param name - of the attribute\n * @param value - of the attribute\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst renderAttribute = (element, name, value) => {\n if ([null, undefined, '', false].includes(value) || ['innerHTML', 'style', ''].includes(name)) {\n return;\n }\n element.setAttribute(name, !['object', 'function'].includes(typeof value) ? value : `⚠️ Property must be set through a script or a framework-specific syntax.`);\n};\n/**\n * Render new element in parent element\n * @param parentNode - HTML element\n * @param tagName - of the new element\n * @param attributes - of the new element\n * @param children - of the new element\n * @param text - of the new element\n */\nconst renderElement = (parentNode, tagName, attributes, children, text) => {\n // render HTML\n if (tagName && typeof tagName === 'string') {\n const element = document.createElement(tagName);\n Object.keys(attributes || {}).forEach(attr => {\n renderAttribute(element, attr, attributes[attr]);\n });\n children?.forEach(child => {\n renderElement(element, child.$tag$, child.$attrs$, child.$children$, child.$text$);\n });\n if (attributes?.innerHTML)\n element.innerHTML = attributes.innerHTML;\n parentNode.appendChild(element);\n }\n // render text\n if (text) {\n parentNode.innerHTML = text;\n }\n};\n/**\n * Filter default argument on component argument to prevent them to be rendered\n * @param args - all possible args with custom values\n * @param defaultValues - component default args values\n * @param slots - slots\n * @returns filtres args\n * @example\n * ```ts\n * import { filterArgs } from '@mgdis/core-ui-helpers/dist/storybook';\n * const Template = (args: MgBadgeType): HTMLElement => <mg-badge {...filterArgs(args, { variant: 'info' }, ['actions'])}></mg-badge>;\n * ```\n */\nconst filterArgs = (args, defaultValues, slots = []) => {\n const filteredArgs = {};\n if (typeof args !== 'object') {\n throw new Error(\"filterArgs - args isn't an object.\");\n }\n for (const k in args) {\n if (!slots.includes(k)) {\n const arg = args[k];\n // Change camelCase k to kebab-case\n const key = k.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n if (!defaultValues || !Object.keys(defaultValues).includes(k) || defaultValues[k] !== arg) {\n filteredArgs[key] = arg;\n }\n }\n }\n return filteredArgs;\n};\n/**\n * Storybook stencil wrapper. Used to target element with `storybook-root` id and render virtual DOM inside.\n * @param storyFn - storybook render function\n * @param context - storybook context\n * @returns rendered element\n * @example\n * ```ts\n * // .storybook/preview.ts\n * import { stencilWrapper } from '@mgdis/core-ui-helpers/dist/storybook';\n * export const decorators: Preview['decorators'] = [stencilWrapper];\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst stencilWrapper = (storyFn, context) => {\n const host = document.getElementById('storybook-root');\n if (host === null)\n return;\n // update local switcher based on context variable\n document.querySelector('[lang]')?.setAttribute('lang', context.globals?.locale || 'en');\n renderVdom({\n $cmpMeta$: {\n $flags$: 0,\n $tagName$: host.tagName,\n },\n $hostElement$: host,\n }, storyFn(context));\n return host.children[host.children.length - 1];\n};\n/**\n * Get story HTML from virtual DOM.\n * Mainly used to render, component code exemple in stories.\n * @param vitualNode - story virtual DOM\n * @returns stringified rendered HTML\n * @example\n * ```ts\n * // .storybook/preview.ts\n * import { getStoryHTML } from '@mgdis/core-ui-helpers/dist/storybook';\n *\n * export const parameters: Preview['parameters'] = {\n * docs: {\n * source: {\n * transform: (_, ctx) => getStoryHTML(ctx.originalStoryFn(ctx.args)),\n * }\n * },\n * };\n * ```\n */\nconst getStoryHTML = ({ $tag$, $attrs$, $children$, $text$ }) => {\n const host = document.createElement('div');\n renderElement(host, $tag$, $attrs$, $children$, $text$);\n return prettify(host.innerHTML, {\n tag_wrap: 40,\n content_wrap: 120,\n }).replace(/=\"true\"/g, '');\n};\n/**\n * Retrieve Component Storybook URL from file path\n * @param storybookBaseUrl - Storybook Base URL\n * @param filePath - Component file path\n * @returns Component Storybook URL\n */\nconst getStorybookUrl = (storybookBaseUrl, filePath) => {\n if (!filePath) {\n return;\n }\n const split = filePath.split('/');\n return `${storybookBaseUrl}${split.slice(2, split.length - 1).join('-')}--docs`;\n};\nclass StorybookPreview {\n /**\n * JsonDocs\n */\n jsonDoc;\n constructor(jsonDoc) {\n this.jsonDoc = jsonDoc;\n }\n /**\n * Get component data from the jsonDoc\n * @param tagName - tag name we want to get the data from\n * @returns component data\n */\n #getComponentData = (tagName) => {\n return this.jsonDoc.components.find(component => component.tag === tagName);\n };\n /**\n * Get the control for the given prop\n * Based on https://storybook.js.org/docs/api/arg-types#controltype\n * @param prop - prop to get control for\n * @returns control type and options if applicable\n */\n #getPropControl = (prop) => {\n // Get types\n const types = prop.type\n .replace(/\"([^\"]+)\"/g, '$1') // Remove quotes\n .replace(/\\s/g, '') // Remove all whitespace for simplicity\n .replace(/\\(.*?\\)/g, match => match.replace(/\\|/g, ' OR ')) // Replace '|' inside parentheses\n .split('|')\n .map(type => type.trim().replace(/ OR /g, '|')); // Revert ' OR ' back to '|'\n // Return control and options\n if (prop.type === 'string') {\n return { control: { type: 'text' } };\n }\n else if (prop.type === 'number') {\n return { control: { type: 'number' } };\n }\n else if (prop.type === 'boolean') {\n return { control: { type: 'boolean' } };\n }\n else if (prop.type.startsWith('{') && prop.type.endsWith('}')) {\n return { control: { type: 'object' } };\n }\n else if (types.length > 1) {\n // Manage case when multiple types are possible\n if (types.includes('string')) {\n return { control: { type: 'text' } };\n }\n else if (types.every(type => type?.includes('[]'))) {\n return { control: { type: 'object' } };\n }\n else {\n // Add the posibility to set undefined\n types.unshift(undefined);\n return { control: { type: 'select' }, options: types };\n }\n }\n else\n return { control: { type: 'object' } };\n };\n /**\n * Extract component arg types from the component data\n * @param tagName - tag name we want to extract the arg types from\n * @returns component arg types\n */\n extractArgTypes = (tagName) => {\n const componentData = this.#getComponentData(tagName);\n // Extract props arg types\n const componentPropsArgTypes = componentData?.props.reduce((acc, prop) => {\n // Get Controls\n const { control, options } = this.#getPropControl(prop);\n // Set Component ArgTypes\n return {\n ...acc,\n [prop.name]: {\n name: prop.attr || prop.name,\n description: prop.docs,\n type: { required: prop.required },\n table: {\n category: 'props',\n type: { summary: prop.type },\n defaultValue: { summary: prop.default },\n },\n control,\n options,\n },\n };\n }, {});\n // Extract events arg types\n const componentEventsArgTypes = componentData?.events.reduce((acc, event) => ({\n ...acc,\n [event.event]: {\n name: event.event,\n description: event.docs,\n table: {\n category: 'events',\n type: { summary: event.detail },\n },\n },\n }), {});\n // Extracts Methods arg types\n const componentMethodsArgTypes = componentData?.methods.reduce((acc, method) => ({\n ...acc,\n [method.name]: {\n name: method.name,\n description: method.docs,\n table: {\n category: 'methods',\n type: { summary: method.signature },\n },\n },\n }), {});\n // Extracts Slots arg types\n const componentSlotsArgTypes = componentData?.slots.reduce((acc, slot) => ({\n ...acc,\n [slot.name]: {\n name: slot.name !== '' ? slot.name : 'default', // default slot are unnamed\n description: slot.docs,\n table: {\n category: 'slots',\n type: { summary: undefined },\n },\n },\n }), {});\n // Extracts CSS Properties arg types\n const componentCSSPropArgTypes = componentData?.styles.reduce((acc, style) => ({\n ...acc,\n [style.name]: {\n name: style.name,\n description: style.docs,\n table: {\n category: 'custom properties',\n type: { summary: undefined },\n },\n },\n }), {});\n // Extract component dependencies\n const componentDependencies = componentData?.dependencies.reduce((acc, dependency) => {\n const dependencyData = this.#getComponentData(dependency);\n if (!dependencyData)\n return acc; // Prevents from adding internal dependency\n return {\n ...acc,\n [dependency]: {\n name: dependency,\n description: `<a href=\"./?path=/docs/${getStorybookUrl('', dependencyData?.filePath)}\">View Component Documentation</a>`,\n table: {\n category: 'depends on',\n type: { summary: undefined },\n },\n },\n };\n }, {});\n // Extract dependents components\n const componentDependents = componentData?.dependents.reduce((acc, dependent) => {\n const dependentData = this.#getComponentData(dependent);\n if (!dependentData)\n return acc; // Prevents from adding internal dependent\n return {\n ...acc,\n [dependent]: {\n name: dependent,\n description: `<a href=\"./?path=/docs/${getStorybookUrl('', dependentData?.filePath)}\">View Component Documentation</a>`,\n table: {\n category: 'used by',\n type: { summary: undefined },\n },\n },\n };\n }, {});\n return {\n ...componentPropsArgTypes,\n ...componentEventsArgTypes,\n ...componentMethodsArgTypes,\n ...componentSlotsArgTypes,\n ...componentCSSPropArgTypes,\n ...componentDependencies,\n ...componentDependents,\n };\n };\n /**\n * Extract component description from the component data\n * @param tagName - tag name we want to extract the description from\n * @returns component description\n */\n extractComponentDescription = (tagName) => {\n const componentData = this.#getComponentData(tagName);\n return componentData?.readme || componentData?.docs;\n };\n}\n\nexport { StorybookPreview, filterArgs, getStoryHTML, getStorybookUrl, stencilWrapper };\n//# sourceMappingURL=index.js.map\n","/**\n * Utility function that mocks the `MutationObserver` API. Recommended to execute inside `beforeEach`.\n * @param mutationObserverMock - Parameter that is sent to the `Object.defineProperty`\n * overwrite method. `jest.fn()` mock functions can be passed here if the goal is to not only\n * mock the mutation observer, but its methods.\n * You can manually fire an intersection entry:\n * @param mutationObserverMock - configuration object\n * @returns Mocked MutationObserver\n * @example\n * ```\n * let fireMo;\n * setupMutationObserverMock({\n * observe: function () {\n * fireMo = this.cb;\n * },\n * });\n * ...\n * fireMo([{ type: 'childList', addedNodes: [AMockElemenet, AnotherMockElemenet], target: yourMockElemenet }]);;\n * ```\n */\nconst setupMutationObserverMock = ({ disconnect, observe, takeRecords }) => {\n class MockMutationObserver {\n /**\n *\n */\n disconnect = disconnect;\n /**\n *\n */\n observe = observe;\n /**\n *\n */\n takeRecords = takeRecords;\n /**\n *\n */\n cb;\n constructor(fn) {\n this.cb = fn;\n }\n }\n [window, global].forEach(element => {\n Object.defineProperty(element, 'MutationObserver', {\n writable: true,\n configurable: true,\n value: MockMutationObserver,\n });\n });\n return MockMutationObserver;\n};\n/**\n * Utility function that mocks the `ResizeObserver` API. Recommended to execute inside `beforeEach`.\n * @param resizeObserverMock - Parameter that is sent to the `Object.defineProperty`\n * overwrite method. `jest.fn()` mock functions can be passed here if the goal is to not only\n * mock the resize observer, but its methods.\n * You can manually fire an intersection entry:\n * @param resizeObserverMock - configuration object\n * @returns Mocked ResizeObserver\n * @example\n * ```\n * let fireRo;\n * setupResizeObserverMock({\n * observe: function () {\n * fireRo = this.cb;\n * },\n * });\n * ...\n * fireRo([{\n * borderBoxSize: ResizeObserverSize[],\n * contentBoxSize: ResizeObserverSize[],\n * contentRect: DOMRectReadOnly,\n * devicePixelContentBoxSize: ResizeObserverSize[],\n * target: yourMockElemenet\n * }]);;\n * ```\n */\nconst setupResizeObserverMock = ({ disconnect, observe }) => {\n class MockResizeObserver {\n /**\n *\n */\n disconnect = disconnect;\n /**\n *\n */\n observe = observe;\n /**\n *\n */\n unobserve;\n /**\n *\n */\n cb;\n constructor(fn) {\n this.cb = fn;\n }\n }\n [window, global].forEach(element => {\n Object.defineProperty(element, 'ResizeObserver', {\n writable: true,\n configurable: true,\n value: MockResizeObserver,\n });\n });\n return MockResizeObserver;\n};\nclass MockCustomEvent extends Event {\n /**\n *\n */\n detail; // eslint-disable-line @typescript-eslint/no-explicit-any\n}\n/**\n * Utility function that mocks the `SubmitEvent` API. Recommended to execute inside `beforeEach`.\n * @example\n * ```\n * setupSubmitEventMock();\n * ```\n * @returns custom event mock\n */\nconst setupSubmitEventMock = () => {\n class SubmitEvent extends MockCustomEvent {\n }\n [window, global].forEach(element => {\n Object.defineProperty(element, 'SubmitEvent', {\n writable: true,\n configurable: true,\n value: SubmitEvent,\n });\n });\n return SubmitEvent;\n};\n/**\n * Utility function that mocks the `requestAnimationFrame` API. Recommended to execute inside `test`.\n * @example\n * ```\n * setUpRequestAnimationFrameMock(jest.runOnlyPendingTimers);\n * ```\n * @param faketimer - recommended to use jest.runOnlyPendingTimers()\n * @returns custom setUpRequestAnimationFrameMock mock\n */\nconst setUpRequestAnimationFrameMock = (faketimer) => {\n const requestAnimationFrame = (callback) => {\n setTimeout(callback, 1);\n faketimer();\n return 0;\n };\n [window, global].forEach(element => {\n Object.defineProperty(element, 'requestAnimationFrame', {\n writable: true,\n configurable: true,\n value: requestAnimationFrame,\n });\n });\n return requestAnimationFrame;\n};\n\nexport { setUpRequestAnimationFrameMock, setupMutationObserverMock, setupResizeObserverMock, setupSubmitEventMock };\n//# sourceMappingURL=index.js.map\n"],"names":["ClassList","classlist","__publicField","className","index","isObject","object","getObjectValueFromKey","path","defaultValue","separator","current","next","allItemsAreString","items","item","isValidString","value","toString","cleanString","text","toKebabCase","str","match","offset","createID","prefix","length","randomBytes","hexString","byte","isValideID","newValue","formatID","id","nextTick","callback","Cursor","DEFAULT_TOP","Page","init","cursor","oldItem","lastIndex","newIndex","oldIndex","findedIndex","_top","_next","_total","Paginate","options","__privateAdd","filter","__privateGet","__privateSet","dateRegExp","dateToString","date","isTagName","element","tagNames","focusableElements","isValidNumber","getWindows","localWindow","parentWindows","getParentWindows","childWindows","getChildWindows","windows","parentWindow","err","childWindow","__defProp","__export","target","all","name","result_exports","map","ok","unwrap","unwrapErr","result","fn","val","newVal","getStorybookUrl","storybookBaseUrl","filePath","split","getSourcesUrl","sourcesBaseUrl","getElementDescription","component","description","attributes","attr","docs","properties","event","getAttributeDescription","prop","webTypesGenerator","version","jsonDocs","docUrl","style","getReferences","sourceBaseUrl","getValues","vsCodeGenerator","references","vsCodeCssGenerator","localeDatePattern","locale","year","month","day","localeDate","localeMessages","messages","defaultLocale","closestLangAttribute","closestLang","localeSubtag","localeCurrency","number","currency","localeNumber","decimalLength","localePercent","localeUnit","unit","unitDisplay","config","defineLocales","BUILD","SVG_NS","HTML_NS","isMemberInElement","elm","memberName","XLINK_NS","win","plt","h2","el","eventName","listener","opts","isDef","v","isComplexType","o","updateFallbackSlotVisibility","childNodes","internalCall","getHostSlotNodes","slotNode","getSlotChildSiblings","getSlotName","i2","childNode","getSlottedChildNodes","slottedNode","hostName","slotName","slottedNodes","slot","includeSlot","node","isNodeLocatedInSlot","nodeToRelocate","patchSlotNode","assignedFactory","elementsOnly","toReturn","parent","n","method","h","nodeName","vnodeData","children","child","key","simple","lastSimple","vNodeChildren","walk","c","newVNode","vnode","tag","Host","isHost","setAccessor","oldValue","isSvg","flags","initialRender","isProp","ln","classList","oldClasses","parseClassList","newClasses","capture","CAPTURE_EVENT_SUFFIX","CAPTURE_EVENT_REGEX","isComplex","xlink","parseClassListRegex","updateElement","oldVnode","newVnode","isSvgMode2","isInitialRender","oldVnodeAttrs","newVnodeAttrs","sortedAttrNames","attrNames","scopeId","contentRef","hostTagName","useNativeShadowDom","checkSlotFallbackVisibility","checkSlotRelocate","isSvgMode","createElm","oldParentVNode","newParentVNode","childIndex","_a","newVNode2","oldVNode","putBackInOriginalLocation","addRemoveSlotScopedClass","parentElm","recursive","oldSlotChildNodes","insertBefore","referenceNode","addVnodes","before","parentVNode","vnodes","startIdx","endIdx","containerElm","removeVnodes","nullifyVNodeRefs","updateChildren","oldCh","newCh","oldStartIdx","newStartIdx","idxInOld","oldEndIdx","oldStartVnode","oldEndVnode","newEndIdx","newStartVnode","newEndVnode","elmToMove","isSameVnode","patch","leftVNode","rightVNode","oldChildren","newChildren","defaultHolder","relocateNodes","markSlotContentForRelocation","hostContentNodes","j","relocateNodeData","r","relocateNode","vNode","newNode","reference","newParent","oldParent","_b","scopeId2","scopeName","found","renderVdom","hostRef","renderFnResults","isInitialLoad","_c","_d","_e","hostElm","cmpMeta","rootVnode","propName","attribute","relocateData","orgLocationNode","slotRefNode","parentNodeRef","insertBeforeNode","refNode","nextSibling","CONFIG","CONTENT_IGNORE_STRING","IGNORE_STRING","VOID_ELEMENTS","isHtml","content","mergeObjects","updates","merged","mergeConfig","dconfig","protectAttributes","html","protectContent","finalProtectContent","regex","p1","p2","p3","p4","text_to_protect","protected_text","setIgnoreAttribute","trimify","trim","e","leading_whitespace","trailing_whitespace","unprotectAttributes","unprotectContent","escapedIgnoreString","ltPlaceholderRegex","gtPlaceholderRegex","unsetIgnoreAttribute","tagRegex","fullMatch","tagName","attributesCapture","processedAttributes","validateConfig","tab_size","wordWrap","width","indent","words","lines","current_line","padding_string","word","test_line","extractIgnoredBlocks","current_html","extracted_blocks","marker_id","MARKER_PREFIX","safe_tag_name","replacements","marker","i","rep","reinsertIgnoredBlocks","html_with_markers","extracted_map","final_html","original_block","closify","check_html","entify","minify","attr_name","quote","trimmed_value","strict","convert","ignore_map","enqueue","c1","c2","preprocess","process","step","tag_wrap","content_wrap","placeholder_template","indents","output_lines","tag_regex","attribute_regex","source","current_line_value","is_ignored_content","subtrahend","prev_line_data","prev_line_value","current_indent_level","padding","tag_parts","inner_padding","wrapped_tag","a","attribute_string","tag_name_match","tag_name","is_void","closing_part","closing_padding","prettify","validated_config","ignore","renderAttribute","renderElement","parentNode","filterArgs","args","defaultValues","slots","filteredArgs","k","arg","stencilWrapper","storyFn","context","host","getStoryHTML","$tag$","$attrs$","$children$","$text$","_getComponentData","_getPropControl","StorybookPreview","jsonDoc","types","type","componentData","componentPropsArgTypes","acc","control","componentEventsArgTypes","componentMethodsArgTypes","componentSlotsArgTypes","componentCSSPropArgTypes","componentDependencies","dependency","dependencyData","componentDependents","dependent","dependentData","setupMutationObserverMock","disconnect","observe","takeRecords","MockMutationObserver","setupResizeObserverMock","MockResizeObserver","MockCustomEvent","setupSubmitEventMock","SubmitEvent","setUpRequestAnimationFrameMock","faketimer","requestAnimationFrame"],"mappings":";;;;;;;AAGA,MAAMA,GAAU;AAAA,EAKZ,YAAYC,IAAY,IAAI;AAD5B;AAAA;AAAA;AAAA,IAAAC,EAAA;AAQA;AAAA;AAAA;AAAA;AAAA,IAAAA,EAAA,aAAM,CAACC,MAAc;AACjB,MAAK,KAAK,IAAIA,CAAS,KACnB,KAAK,QAAQ,KAAKA,CAAS;AAAA,IAElC;AAKD;AAAA;AAAA;AAAA;AAAA,IAAAD,EAAA,gBAAS,CAACC,MAAc;AACpB,YAAMC,IAAQ,KAAK,QAAQ,QAAQD,CAAS;AAC5C,MAAIC,IAAQ,MACR,KAAK,QAAQ,OAAOA,GAAO,CAAC;AAAA,IAEnC;AAMD;AAAA;AA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