{"version":3,"file":"omi.module.js","sources":["../src/utils.ts","../src/construct-style-sheets-polyfill.ts","../src/vdom.ts","../src/constants.ts","../src/dom.ts","../src/diff.ts","../src/reactivity.ts","../src/component.ts","../src/render.ts","../src/define.ts","../src/class.ts","../src/signal.ts","../src/css-tag.ts","../src/index.ts"],"sourcesContent":["import { ExtendedElement } from './dom'\nimport { ObjectVNode, VNode } from './vdom'\nimport './construct-style-sheets-polyfill'\n\n/**\n * Check if the environment has native custom elements support\n * and apply a shim for the HTMLElement constructor if needed.\n */\n(function () {\n const w = typeof window !== 'undefined' ? window : global as any\n if (\n w.Reflect === undefined ||\n w.customElements === undefined ||\n w.customElements.hasOwnProperty('polyfillWrapFlushCallback')\n ) {\n return\n }\n const BuiltInHTMLElement = w.HTMLElement\n w.HTMLElement = function HTMLElement() {\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n }\n HTMLElement.prototype = BuiltInHTMLElement.prototype\n HTMLElement.prototype.constructor = HTMLElement\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\n/**\n * Convert a kebab-case string to camelCase.\n * @param str - The kebab-case string to convert.\n * @returns The camelCase version of the input string.\n */\nexport function camelCase(str: string): string {\n return str.replace(/-(\\w)/g, (_, $1) => $1.toUpperCase())\n}\n\n/**\n * A functional component that renders its children.\n * @param props - The component's props.\n * @returns The component's children.\n */\nexport function Fragment(props: { children: any }): any {\n return props.children\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param ref - The ref to apply.\n * @param value - The value to set or pass to the ref.\n */\nexport function applyRef(ref: ((value: any) => void) | { current: any } | null, value: any): void {\n if (ref != null) {\n if (typeof ref == 'function') ref(value)\n else ref.current = value\n }\n}\n\n/**\n * Check if the given object is an array.\n * @param obj - The object to check.\n * @returns True if the object is an array, false otherwise.\n */\nexport function isArray(obj: unknown): boolean {\n return Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nconst hyphenateRE = /\\B([A-Z])/g\n\n/**\n * Convert a camelCase string to kebab-case.\n * @param str - The camelCase string to convert.\n * @returns The kebab-case version of the input string.\n */\nexport function hyphenate(str: string): string {\n return str.replace(hyphenateRE, '-$1').toLowerCase()\n}\n\n/**\n * Capitalize the first letter of each word in a kebab-case string.\n * @param name - The kebab-case string to capitalize.\n * @returns The capitalized version of the input string.\n */\nexport function capitalize(name: string): string {\n return name\n .replace(/\\-(\\w)/g, (_, letter) => letter.toUpperCase())\n .replace(/^\\S/, (s) => s.toUpperCase())\n}\n\n/**\n * Create a new CSSStyleSheet with the given style.\n * @param style - The CSS style to apply to the new stylesheet.\n * @returns The created CSSStyleSheet.\n */\nexport function createStyleSheet(style: string): CSSStyleSheet {\n const styleSheet = new CSSStyleSheet()\n styleSheet.replaceSync(style)\n return styleSheet\n}\n\n/**\n * Creates a