{"version":3,"file":"omi.umd.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/define.ts","../src/class.ts","../src/signal.ts","../src/css-tag.ts","../src/render.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 * Check if two nodes are equivalent.\n * @param node - The DOM Node to compare.\n * @param vnode - The virtual DOM node to compare.\n * @param hydrating - If true, ignores component constructors when comparing.\n * @returns True if the nodes are equivalent, false otherwise.\n */\nexport function isSameNodeType(node: ExtendedElement, vnode: VNode): boolean {\n  if (typeof vnode === 'string' || typeof vnode === 'number') {\n    return node.splitText !== undefined\n  }\n  return isNamedNode(node, (vnode as ObjectVNode).nodeName as string)\n}\n\n/**\n * Check if an Element has a given nodeName, case-insensitively.\n * @param node - The DOM Element to inspect the name of.\n * @param nodeName - The unnormalized name to compare against.\n * @returns True if the element has the given nodeName, false otherwise.\n */\nexport function isNamedNode(node: ExtendedElement, nodeName: string): boolean {\n  return (\n    node.normalizedNodeName === nodeName ||\n    node.nodeName.toLowerCase() === nodeName.toLowerCase()\n  )\n}\n\nexport function createRef() {\n  return {}\n}\n\nexport function isPrimitive(value: unknown) {\n  return (\n    typeof value === 'undefined' ||\n    typeof value === 'boolean' ||\n    typeof value === 'number' ||\n    typeof value === 'string' ||\n    typeof value === 'symbol'\n  )\n}\n\nexport function bind(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) {\n  return {\n    configurable: true,\n    get() {\n      const bound = descriptor.value.bind(this)\n      Object.defineProperty(this, propertyKey, {\n        value: bound,\n        configurable: true,\n        writable: true,\n      })\n      return bound\n    },\n  }\n}","// @ts-nocheck\n\n(function () {\n  'use strict'\n\n  if (typeof document === 'undefined' || 'adoptedStyleSheets' in document) { return }\n\n  var hasShadyCss = 'ShadyCSS' in window && !ShadyCSS.nativeShadow\n  var bootstrapper = document.implementation.createHTMLDocument('boot')\n  var closedShadowRootRegistry = new WeakMap()\n  var _DOMException = typeof DOMException === 'object' ? Error : DOMException\n\n  var defineProperty = Object.defineProperty\n  var forEach = Array.prototype.forEach\n  var importPattern = /@import.+?;?$/gm\n  function rejectImports(contents) {\n    var _contents = contents.replace(importPattern, '')\n    if (_contents !== contents) {\n      console.warn('@import rules are not allowed here. See https://github.com/WICG/construct-stylesheets/issues/119#issuecomment-588352418')\n    }\n    return _contents.trim()\n  }\n  function clearRules(sheet) {\n    for (var i = 0; i < sheet.cssRules.length; i++) {\n      sheet.deleteRule(0)\n    }\n  }\n  function insertAllRules(from, to) {\n    forEach.call(from.cssRules, function (rule, i) {\n      to.insertRule(rule.cssText, i)\n    })\n  }\n  function isElementConnected(element) {\n    return 'isConnected' in element\n      ? element.isConnected\n      : document.contains(element)\n  }\n  function unique(arr) {\n    return arr.filter(function (value, index) { return arr.indexOf(value) === index })\n  }\n  function diff(arr1, arr2) {\n    return arr1.filter(function (value) { return arr2.indexOf(value) === -1 })\n  }\n  function removeNode(node) {\n    node.parentNode.removeChild(node)\n  }\n  function getShadowRoot(element) {\n    return element.shadowRoot || closedShadowRootRegistry.get(element)\n  }\n\n  var cssStyleSheetMethods = [\n    'addImport',\n    'addPageRule',\n    'addRule',\n    'deleteRule',\n    'insertRule',\n    'removeImport',\n    'removeRule',\n  ]\n  var NonConstructedStyleSheet = CSSStyleSheet\n  var nonConstructedProto = NonConstructedStyleSheet.prototype\n  nonConstructedProto.replace = function () {\n    return Promise.reject(new _DOMException('Can\\'t call replace on non-constructed CSSStyleSheets.'))\n  }\n  nonConstructedProto.replaceSync = function () {\n    throw new _DOMException('Failed to execute \\'replaceSync\\' on \\'CSSStyleSheet\\': Can\\'t call replaceSync on non-constructed CSSStyleSheets.')\n  }\n  function isCSSStyleSheetInstance(instance) {\n    return typeof instance === 'object'\n      ? proto$2.isPrototypeOf(instance) ||\n      nonConstructedProto.isPrototypeOf(instance)\n      : false\n  }\n  function isNonConstructedStyleSheetInstance(instance) {\n    return typeof instance === 'object'\n      ? nonConstructedProto.isPrototypeOf(instance)\n      : false\n  }\n  var $basicStyleSheet = new WeakMap()\n  var $locations = new WeakMap()\n  var $adoptersByLocation = new WeakMap()\n  function addAdopterLocation(sheet, location) {\n    var adopter = document.createElement('style')\n    $adoptersByLocation.get(sheet).set(location, adopter)\n    $locations.get(sheet).push(location)\n    return adopter\n  }\n  function getAdopterByLocation(sheet, location) {\n    return $adoptersByLocation.get(sheet).get(location)\n  }\n  function removeAdopterLocation(sheet, location) {\n    $adoptersByLocation.get(sheet).delete(location)\n    $locations.set(sheet, $locations.get(sheet).filter(function (_location) { return _location !== location }))\n  }\n  function restyleAdopter(sheet, adopter) {\n    requestAnimationFrame(function () {\n      clearRules(adopter.sheet)\n      insertAllRules($basicStyleSheet.get(sheet), adopter.sheet)\n    })\n  }\n  function checkInvocationCorrectness(self) {\n    if (!$basicStyleSheet.has(self)) {\n      throw new TypeError('Illegal invocation')\n    }\n  }\n  function ConstructedStyleSheet() {\n    var self = this\n    var style = document.createElement('style')\n    bootstrapper.body.appendChild(style)\n    $basicStyleSheet.set(self, style.sheet)\n    $locations.set(self, [])\n    $adoptersByLocation.set(self, new WeakMap())\n  }\n  var proto$2 = ConstructedStyleSheet.prototype\n  proto$2.replace = function replace(contents) {\n    try {\n      this.replaceSync(contents)\n      return Promise.resolve(this)\n    }\n    catch (e) {\n      return Promise.reject(e)\n    }\n  }\n  proto$2.replaceSync = function replaceSync(contents) {\n    checkInvocationCorrectness(this)\n    if (typeof contents === 'string') {\n      var self_1 = this\n      var style = $basicStyleSheet.get(self_1).ownerNode\n      style.textContent = rejectImports(contents)\n      $basicStyleSheet.set(self_1, style.sheet)\n      $locations.get(self_1).forEach(function (location) {\n        if (location.isConnected()) {\n          restyleAdopter(self_1, getAdopterByLocation(self_1, location))\n        }\n      })\n    }\n  }\n  defineProperty(proto$2, 'cssRules', {\n    configurable: true,\n    enumerable: true,\n    get: function cssRules() {\n      checkInvocationCorrectness(this)\n      return $basicStyleSheet.get(this).cssRules\n    },\n  })\n  cssStyleSheetMethods.forEach(function (method) {\n    proto$2[method] = function () {\n      var self = this\n      checkInvocationCorrectness(self)\n      var args = arguments\n      var basic = $basicStyleSheet.get(self)\n      var locations = $locations.get(self)\n      var result = basic[method].apply(basic, args)\n      locations.forEach(function (location) {\n        if (location.isConnected()) {\n          var sheet = getAdopterByLocation(self, location).sheet\n          sheet[method].apply(sheet, args)\n        }\n      })\n      return result\n    }\n  })\n  defineProperty(ConstructedStyleSheet, Symbol.hasInstance, {\n    configurable: true,\n    value: isCSSStyleSheetInstance,\n  })\n\n  var defaultObserverOptions = {\n    childList: true,\n    subtree: true,\n  }\n  var locations = new WeakMap()\n  function getAssociatedLocation(element) {\n    var location = locations.get(element)\n    if (!location) {\n      location = new Location(element)\n      locations.set(element, location)\n    }\n    return location\n  }\n  function attachAdoptedStyleSheetProperty(constructor) {\n    defineProperty(constructor.prototype, 'adoptedStyleSheets', {\n      configurable: true,\n      enumerable: true,\n      get: function () {\n        return getAssociatedLocation(this).sheets\n      },\n      set: function (sheets) {\n        getAssociatedLocation(this).update(sheets)\n      },\n    })\n  }\n  function traverseWebComponents(node, callback) {\n    var iter = document.createNodeIterator(node, NodeFilter.SHOW_ELEMENT, function (foundNode) {\n      return getShadowRoot(foundNode)\n        ? NodeFilter.FILTER_ACCEPT\n        : NodeFilter.FILTER_REJECT\n    },\n      null, false)\n    for (var next = void 0; (next = iter.nextNode());) {\n      callback(getShadowRoot(next))\n    }\n  }\n  var $element = new WeakMap()\n  var $uniqueSheets = new WeakMap()\n  var $observer = new WeakMap()\n  function isExistingAdopter(self, element) {\n    return (element instanceof HTMLStyleElement &&\n      $uniqueSheets.get(self).some(function (sheet) { return getAdopterByLocation(sheet, self) }))\n  }\n  function getAdopterContainer(self) {\n    var element = $element.get(self)\n    return element instanceof Document ? element.body : element\n  }\n  function adopt(self) {\n    var styleList = document.createDocumentFragment()\n    var sheets = $uniqueSheets.get(self)\n    var observer = $observer.get(self)\n    var container = getAdopterContainer(self)\n    observer.disconnect()\n    sheets.forEach(function (sheet) {\n      styleList.appendChild(getAdopterByLocation(sheet, self) || addAdopterLocation(sheet, self))\n    })\n    container.insertBefore(styleList, null)\n    observer.observe(container, defaultObserverOptions)\n    sheets.forEach(function (sheet) {\n      restyleAdopter(sheet, getAdopterByLocation(sheet, self))\n    })\n  }\n  function Location(element) {\n    var self = this\n    self.sheets = []\n    $element.set(self, element)\n    $uniqueSheets.set(self, [])\n    $observer.set(self, new MutationObserver(function (mutations, observer) {\n      if (!document) {\n        observer.disconnect()\n        return\n      }\n      mutations.forEach(function (mutation) {\n        if (!hasShadyCss) {\n          forEach.call(mutation.addedNodes, function (node) {\n            if (!(node instanceof Element)) {\n              return\n            }\n            traverseWebComponents(node, function (root) {\n              getAssociatedLocation(root).connect()\n            })\n          })\n        }\n        forEach.call(mutation.removedNodes, function (node) {\n          if (!(node instanceof Element)) {\n            return\n          }\n          if (isExistingAdopter(self, node)) {\n            adopt(self)\n          }\n          if (!hasShadyCss) {\n            traverseWebComponents(node, function (root) {\n              getAssociatedLocation(root).disconnect()\n            })\n          }\n        })\n      })\n    }))\n  }\n  var proto$1 = Location.prototype\n  proto$1.isConnected = function isConnected() {\n    var element = $element.get(this)\n    return element instanceof Document\n      ? element.readyState !== 'loading'\n      : isElementConnected(element.host)\n  }\n  proto$1.connect = function connect() {\n    var container = getAdopterContainer(this)\n    $observer.get(this).observe(container, defaultObserverOptions)\n    if ($uniqueSheets.get(this).length > 0) {\n      adopt(this)\n    }\n    traverseWebComponents(container, function (root) {\n      getAssociatedLocation(root).connect()\n    })\n  }\n  proto$1.disconnect = function disconnect() {\n    $observer.get(this).disconnect()\n  }\n  proto$1.update = function update(sheets) {\n    var self = this\n    var locationType = $element.get(self) === document ? 'Document' : 'ShadowRoot'\n    if (!Array.isArray(sheets)) {\n      throw new TypeError('Failed to set the \\'adoptedStyleSheets\\' property on ' + locationType + ': Iterator getter is not callable.')\n    }\n    if (!sheets.every(isCSSStyleSheetInstance)) {\n      throw new TypeError('Failed to set the \\'adoptedStyleSheets\\' property on ' + locationType + ': Failed to convert value to \\'CSSStyleSheet\\'')\n    }\n    if (sheets.some(isNonConstructedStyleSheetInstance)) {\n      throw new TypeError('Failed to set the \\'adoptedStyleSheets\\' property on ' + locationType + ': Can\\'t adopt non-constructed stylesheets')\n    }\n    self.sheets = sheets\n    var oldUniqueSheets = $uniqueSheets.get(self)\n    var uniqueSheets = unique(sheets)\n    var removedSheets = diff(oldUniqueSheets, uniqueSheets)\n    removedSheets.forEach(function (sheet) {\n      removeNode(getAdopterByLocation(sheet, self))\n      removeAdopterLocation(sheet, self)\n    })\n    $uniqueSheets.set(self, uniqueSheets)\n    if (self.isConnected() && uniqueSheets.length > 0) {\n      adopt(self)\n    }\n  }\n\n  window.CSSStyleSheet = ConstructedStyleSheet\n  attachAdoptedStyleSheetProperty(Document)\n  if ('ShadowRoot' in window) {\n    attachAdoptedStyleSheetProperty(ShadowRoot)\n    var proto = Element.prototype\n    var attach_1 = proto.attachShadow\n    proto.attachShadow = function attachShadow(init) {\n      var root = attach_1.call(this, init)\n      if (init.mode === 'closed') {\n        closedShadowRootRegistry.set(this, root)\n      }\n      return root\n    }\n  }\n  var documentLocation = getAssociatedLocation(document)\n  if (documentLocation.isConnected()) {\n    documentLocation.connect()\n  }\n  else {\n    document.addEventListener('DOMContentLoaded', documentLocation.connect.bind(documentLocation))\n  }\n\n}())\n","import { Fragment } from './utils'\n\nexport type Attributes = {\n  key?: string | number\n  ignoreAttrs?: boolean\n  children?: VNode[] | null\n  [prop: string]: unknown\n}\n\nexport type ObjectVNode = {\n  nodeName: string | Function\n  attributes: Attributes\n  children: VNode[]\n  key: string | number | undefined\n}\n\nexport type VNode = ObjectVNode | string | number | boolean | null | undefined\n\n\nconst stack: VNode[] = []\n\nexport function createElement(nodeName: string | Function, attributes: Attributes, restChildren: VNode[]): VNode | VNode[] {\n  let children: VNode[] = [],\n    lastSimple: boolean = false,\n    child: VNode,\n    simple: boolean,\n    i: number\n\n  // jsx 嵌套的元素自动忽略  attrs\n  if (attributes) {\n    attributes.ignoreAttrs = true\n  } else {\n    attributes = { ignoreAttrs: true }\n  }\n  for (i = arguments.length; i-- > 2;) {\n    stack.push(arguments[i])\n  }\n  if (attributes.children != null) {\n    if (!stack.length) stack.push(...attributes.children)\n    delete attributes.children\n  }\n  while (stack.length) {\n    if ((child = (stack.pop() as VNode)) && (child as unknown as VNode[]).pop !== undefined) {\n      for (i = (child as unknown as VNode[]).length; i--;) stack.push((child as unknown as VNode[])[i])\n    } else {\n      if (typeof child === 'boolean') child = null\n\n      if ((simple = typeof nodeName !== 'function')) {\n        if (child == null) child = ''\n        else if (typeof child === 'number') child = String(child)\n        else if (typeof child !== 'string') simple = false\n      }\n\n      if (simple && lastSimple) {\n        children[children.length - 1] += (child as string)\n      } else if (children.length === 0) {\n        children = [child]\n      } else {\n        children.push(child)\n      }\n\n      lastSimple = simple\n    }\n  }\n\n  if (nodeName === Fragment) {\n    return children\n  }\n\n  const p: VNode = {\n    nodeName,\n    children,\n    attributes,\n    key: attributes.key,\n  }\n\n  return p\n}\n\n// h.f or <></>\ncreateElement.f = Fragment\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param vnode The virtual DOM element to clone\n * @param props Attributes/props to add when cloning\n * @param rest Any additional arguments will be used as replacement children.\n */\n\nexport function cloneElement(vnode: ObjectVNode, props: Attributes, ...rest: VNode[]): VNode | VNode[] {\n  return createElement(\n    vnode.nodeName,\n    { ...vnode.attributes, ...props },\n    rest.length > 0 ? rest : vnode.children\n  )\n}","export const DOM_EVENT_MAP = {\n  onanimationcancel: 1,\n  oncompositionend: 1,\n  oncompositionstart: 1,\n  oncompositionupdate: 1,\n  onfocusin: 1,\n  onfocusout: 1,\n  onscrollend: 1,\n  ontouchcancel: 1,\n  ontouchend: 1,\n  ontouchmove: 1,\n  ontouchstart: 1\n}\n\nexport type EventTypes = 'onanimationcancel' | 'oncompositionend' | 'oncompositionstart' | 'oncompositionupdate' | 'onfocusin' | 'onfocusout' | 'onscrollend' | 'ontouchcancel' | 'ontouchend' | 'ontouchmove' | 'ontouchstart'\n\n// DOM properties that should NOT have \"px\" added when numeric\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i\n","import { Component } from './component'\nimport { IS_NON_DIMENSIONAL, DOM_EVENT_MAP, EventTypes } from './constants'\nimport { applyRef } from './utils'\n\nexport type ExtendedElement = (HTMLElement | SVGAElement | HTMLInputElement) & {\n  receiveProps: Function\n  update: Function\n  store?: unknown\n  className?: string\n  props: Record<string, unknown>\n  splitText?: Function\n  prevProps?: Record<string, unknown> & {\n    ref?: {\n      current?: unknown\n    } | Function\n  }\n  attributes: NamedNodeMap\n  _component?: Component\n  nativeRemoveAttribute: Function\n  nativeSetAttribute: Function\n  _listeners: Record<string, Function>\n} & Record<string, unknown>\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n *  namespace.\n * @returns {Element} The created DOM node\n */\nexport function createNode(nodeName: string, isSvg: boolean) {\n  /** @type {Element} */\n  let node = isSvg\n    ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\n    : document.createElement(nodeName)\n  // @ts-ignore\n  node.normalizedNodeName = nodeName\n  return node as ExtendedElement\n}\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node: Element) {\n  let parentNode = node.parentNode\n  if (parentNode) parentNode.removeChild(node)\n}\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {Element} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n *  event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(\n  node: ExtendedElement,\n  name: string,\n  old: any,\n  value: any,\n  isSvg: boolean\n) {\n  if (name === 'className') name = 'class'\n  if (name === 'key' || name === 'ignoreAttrs') {\n    // ignore\n  } else if (name === 'ref') {\n    applyRef(old, null)\n    applyRef(value, node)\n  } else if (name === 'class' && !isSvg) {\n    node.className = value || ''\n  } else if (name === 'style') {\n    if (!value || typeof value === 'string' || typeof old === 'string') {\n      node.style.cssText = value || ''\n    }\n    if (value && typeof value === 'object') {\n      if (typeof old !== 'string') {\n        for (let i in old) if (!(i in value)) (node.style as any)[i] = ''\n      }\n      for (let i in value) {\n        (node.style as any)[i] =\n          typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false\n            ? value[i] + 'px'\n            : value[i]\n      }\n    }\n  } else if (name === 'unsafeHTML') {\n    if (value) node.innerHTML = value.html || value || ''\n  } else if (name[0] == 'o' && name[1] == 'n') {\n    bindEvent(node, name, value, old)\n  } else if (node.nodeName === 'INPUT' && name === 'value') {\n    (node as HTMLInputElement).value = value == null ? '' : value\n  } else if (\n    name !== 'list' &&\n    name !== 'type' &&\n    name !== 'css' &&\n    !isSvg &&\n    name in node &&\n    value !== ''\n  ) {\n    //value !== '' fix for selected, disabled, checked with pure element\n    // Attempt to set a DOM property to the given value.\n    // IE & FF throw for certain property-value combinations.\n    try {\n      node[name] = value == null ? '' : value\n    } catch (e) { }\n    if ((value == null || value === false) && name != 'spellcheck')\n      node.nativeRemoveAttribute ? node.nativeRemoveAttribute(name) : node.removeAttribute(name)\n  } else {\n    let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n    // spellcheck is treated differently than all other boolean values and\n    // should not be removed when the value is `false`. See:\n    // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\n    if (value == null || value === false) {\n      if (ns)\n        node.removeAttributeNS(\n          'http://www.w3.org/1999/xlink',\n          name.toLowerCase()\n        )\n      else\n        node.nativeRemoveAttribute ? node.nativeRemoveAttribute(name) : node.removeAttribute(name)\n    } else if (typeof value !== 'function') {\n      if (ns) {\n        node.setAttributeNS(\n          'http://www.w3.org/1999/xlink',\n          name.toLowerCase(),\n          value\n        )\n      } else {\n        node.nativeSetAttribute ? node.nativeSetAttribute(name, value) : node.setAttribute(name, value)\n      }\n    }\n  }\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @private\n */\nfunction eventProxy(e: Event) {\n  // @ts-ignore\n  return this._listeners[e.type](e)\n}\n\nfunction bindEvent(node: ExtendedElement, name: string, value: any, old: any) {\n  let useCapture = name !== (name = name.replace(/Capture$/, ''))\n  let nameLower = name.toLowerCase()\n  name = ((DOM_EVENT_MAP[nameLower as EventTypes] || nameLower in node) ? nameLower : name).slice(2)\n  if (value) {\n    if (!old) {\n      node.addEventListener(name, eventProxy, useCapture)\n    }\n  } else {\n    node.removeEventListener(name, eventProxy, useCapture)\n  }\n  ; (node._listeners || (node._listeners = {}))[name] = value\n}\n","import { isSameNodeType, isNamedNode, camelCase, isArray } from './utils'\nimport { createNode, setAccessor, removeNode } from './dom'\nimport { ObjectVNode, VNode } from './vdom'\nimport { Component } from './component'\nimport { ExtendedElement } from './dom'\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nexport let diffLevel = 0\n\n/** Global flag indicating if the diff is currently within an SVG */\nlet isSvgMode = false\nlet isForeignObject = false\n/** Global flag indicating if the diff is performing hydration */\nlet hydrating = false\n\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n *  @param {Element} [dom=null]    A DOM node to mutate into the shape of the `vnode`\n *  @param {VNode} vnode      A VNode (with descendants forming a tree) representing the desired DOM structure\n *  @returns {Element} dom      The created/mutated element\n *  @private\n */\nexport function diff(dom: ExtendedElement | ExtendedElement[] | null, vnode: VNode | VNode[], parent: ExtendedElement | null, component: Component | null, updateSelf: boolean): ExtendedElement | ExtendedElement[] | null {\n  // first render return undefined\n  if (!dom && !vnode) return null\n  // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n  let ret\n  if (!diffLevel++) {\n    // when first starting the diff, check if we're diffing an SVG or within an SVG\n    isSvgMode = parent != null && (parent as Element as SVGElement).ownerSVGElement !== undefined\n\n    // hydration is indicated by the existing element to be diffed not having a prop cache\n    hydrating = dom != null && !('prevProps' in dom)\n  }\n\n  if (isArray(vnode)) {\n    if (parent) {\n      // don't use css and props.css when using h.f\n      // diff node list and vnode list\n      innerDiffNode(parent, vnode as VNode[], hydrating, component as Component, updateSelf)\n    } else {\n      // connectedCallback 的时候 parent 为 null\n      ret = [];\n      (vnode as unknown as VNode[]).forEach((item, index) => {\n        let ele = idiff(index === 0 ? dom : null, item, component as Component, updateSelf)\n        // 返回数组的情况下,在 Component 中进行了 shadowRoot.appendChild\n        // 所有不会出现 vnode index 大于 0 丢失的情况\n        ret.push(ele)\n      })\n    }\n  } else {\n    if (isArray(dom)) {\n      (dom as ExtendedElement[]).forEach((child, index) => {\n        if (index === 0) {\n          ret = idiff(child, vnode as VNode, component as Component, updateSelf)\n        } else {\n          recollectNodeTree(child, false)\n        }\n      })\n    } else {\n      ret = idiff(dom, vnode as VNode, component as Component, updateSelf)\n    }\n    // append the element if its a new parent\n    if (parent && (ret as Node)?.parentNode !== parent) parent.appendChild((ret as Node))\n  }\n\n  // diffLevel being reduced to 0 means we're exiting the diff\n  if (!--diffLevel) {\n    hydrating = false\n    // invoke queued componentDidMount lifecycle methods\n  }\n\n  return ret as ExtendedElement | ExtendedElement[] | null\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom: ExtendedElement | ExtendedElement[] | null | Text | HTMLElement, vnode: VNode, component: Component, updateSelf: boolean) {\n  if (dom && vnode && (dom as ExtendedElement).props) {\n    (dom as ExtendedElement).props.children = (vnode as ObjectVNode).children\n  }\n  let out = dom,\n    prevSvgMode = isSvgMode,\n    prevForeignObject = isForeignObject\n\n  // empty values (null, undefined, booleans) render as empty Text nodes\n  if (vnode == null || typeof vnode === 'boolean') vnode = ''\n\n  // Fast case: Strings & Numbers create/update Text nodes.\n  if (typeof vnode === 'string' || typeof vnode === 'number') {\n    // update if it's already a Text node:\n    if (\n      dom &&\n      (dom as ExtendedElement).splitText !== undefined &&\n      (dom as ExtendedElement).parentNode &&\n      (!(dom as ExtendedElement)._component || component)\n    ) {\n      /* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n      if ((dom as ExtendedElement).nodeValue != vnode) {\n        (dom as ExtendedElement).nodeValue = String(vnode)\n      }\n    } else {\n      // it wasn't a Text node: replace it with one and recycle the old Element\n      out = document.createTextNode(String(vnode))\n      if (dom) {\n        if ((dom as Text).parentNode) (dom as Text).parentNode?.replaceChild(out, (dom as Text))\n        recollectNodeTree(dom as ExtendedElement, true)\n      }\n    }\n\n    if (out) {\n      (out as ExtendedElement).prevProps = {}\n    }\n\n    return out\n  }\n\n  let vnodeName = vnode.nodeName\n  // if (typeof vnodeName === 'function') {\n  //   console.warn('vnodeName is function')\n  // }\n\n  // Tracks entering and exiting SVG namespace when descending through the tree.\n  isForeignObject = vnodeName === 'foreignObject'\n  isSvgMode =\n    vnodeName === 'svg'\n      ? true\n      : isForeignObject\n        ? false\n        : isSvgMode\n\n  // If there's no existing element or it's the wrong type, create a new one:\n  vnodeName = String(vnodeName)\n  if (!dom || !isNamedNode(dom as ExtendedElement, vnodeName)) {\n    // foreignObject 自身 isSvgMode 设置成 true,内部设置成 false\n    out = createNode(vnodeName, isForeignObject || isSvgMode)\n\n    if (dom) {\n      // move children into the replacement node\n      while ((dom as ExtendedElement).firstChild) (out as HTMLElement).appendChild((dom as ExtendedElement).firstChild as Node)\n\n      // if the previous Element was mounted into the DOM, replace it inline\n      if ((dom as ExtendedElement).parentNode) (dom as ExtendedElement).parentNode?.replaceChild(out as HTMLElement, dom as ExtendedElement)\n\n      // recycle the old element (skips non-Element node types)\n      recollectNodeTree(dom as ExtendedElement, true)\n    }\n  }\n\n  let fc = (out as ExtendedElement).firstChild,\n    props = (out as ExtendedElement).prevProps,\n    vchildren = vnode.children\n\n  if (props == null) {\n    props = (out as ExtendedElement).prevProps = {}\n    for (let a = (out as ExtendedElement).attributes, i = a.length; i--;)\n      props[a[i].name] = a[i].value\n  }\n\n  // Optimization: fast-path for elements containing a single TextNode:\n  if (\n    !hydrating &&\n    vchildren &&\n    vchildren.length === 1 &&\n    typeof vchildren[0] === 'string' &&\n    fc != null &&\n    (fc as Text).splitText !== undefined &&\n    fc.nextSibling == null\n  ) {\n    if (fc.nodeValue != vchildren[0]) {\n      fc.nodeValue = vchildren[0]\n    }\n  }\n  // otherwise, if there are existing or new children, diff them:\n  else if ((vchildren && vchildren.length) || fc != null) {\n    if (!(((out as ExtendedElement).constructor as typeof Component).is == 'Component' && ((out as ExtendedElement).constructor as typeof Component).noSlot)) {\n      innerDiffNode(\n        out as ExtendedElement,\n        vchildren,\n        hydrating || props.unsafeHTML != null,\n        component,\n        updateSelf\n      )\n    }\n  }\n\n  // Apply attributes/props from VNode to the DOM Element:\n  diffAttributes(out as ExtendedElement, vnode.attributes, props, component, updateSelf)\n  if ((out as ExtendedElement).props) {\n    (out as ExtendedElement).props.children = vnode.children\n  }\n  // restore previous SVG mode: (in case we're exiting an SVG namespace)\n  isSvgMode = prevSvgMode\n  isForeignObject = prevForeignObject\n  return out\n}\n\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n *  @param {Element} dom      Element whose children should be compared & mutated\n *  @param {Array} vchildren    Array of VNodes to compare to `dom.childNodes`\n *  @param {Boolean} isHydrating  If `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom: ExtendedElement, vchildren: VNode[], isHydrating: boolean, component: Component, updateSelf: boolean) {\n  let originalChildren = dom.childNodes,\n    children = [],\n    keyed: Record<string, Element | undefined> = {},\n    keyedLen = 0,\n    min = 0,\n    len = originalChildren.length,\n    childrenLen = 0,\n    vlen = vchildren ? vchildren.length : 0,\n    j,\n    c,\n    f,\n    vchild,\n    child\n\n  // Build up a map of keyed children and an Array of unkeyed children:\n  if (len !== 0) {\n    for (let i = 0; i < len; i++) {\n      let child = originalChildren[i],\n        props = (child as ExtendedElement).prevProps,\n        key =\n          vlen && props\n            ? props.key\n            : null\n      if (key != null) {\n        keyedLen++\n        keyed[key as string] = child as Element\n      } else if (\n        props ||\n        ((child as ExtendedElement).splitText !== undefined\n          ? isHydrating\n            ? (child as Text).nodeValue?.trim()\n            : true\n          : isHydrating)\n      ) {\n        children[childrenLen++] = child\n      }\n    }\n  }\n\n  if (vlen !== 0) {\n    for (let i = 0; i < vlen; i++) {\n      vchild = vchildren[i]\n      child = null\n\n      if (vchild) {\n        // attempt to find a node based on key matching\n        let key = (vchild as ObjectVNode).key\n        if (key != null) {\n          if (keyedLen && keyed[key] !== undefined) {\n            child = keyed[key]\n            keyed[key] = undefined\n            keyedLen--\n          }\n        }\n        // attempt to pluck a node of the same type from the existing children\n        else if (!child && min < childrenLen) {\n          for (j = min; j < childrenLen; j++) {\n            if (\n              children[j] !== undefined &&\n              isSameNodeType((c = children[j] as ExtendedElement), vchild)\n            ) {\n              child = c\n              children[j] = undefined\n              if (j === childrenLen - 1) childrenLen--\n              if (j === min) min++\n              break\n            }\n          }\n        }\n      }\n\n      // morph the matched/found/created DOM child to match vchild (deep)\n      child = idiff(child as ExtendedElement, vchild, component, updateSelf)\n\n      f = originalChildren[i]\n      if (child && child !== dom && child !== f) {\n        if (f == null) {\n          dom.appendChild(child as Element)\n        } else if (child === f.nextSibling) {\n          removeNode(f as Element)\n        } else {\n          dom.insertBefore(child as Element, f)\n        }\n      }\n    }\n  }\n\n  // remove unused keyed children:\n  if (keyedLen) {\n    for (let i in keyed)\n      if (keyed[i] !== undefined) recollectNodeTree(keyed[i] as ExtendedElement, false)\n  }\n\n  // remove orphaned unkeyed children:\n  while (min <= childrenLen) {\n    if ((child = children[childrenLen--]) !== undefined)\n      recollectNodeTree(child as ExtendedElement, false)\n  }\n}\n\n/** Recursively recycle (or just unmount) a node and its descendants.\n *  @param {Node} node            DOM node to start unmount/removal from\n *  @param {Boolean} [unmountOnly=false]  If `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node: ExtendedElement, unmountOnly: boolean) {\n  // If the node's VNode had a ref function, invoke it with null here.\n  // (this is part of the React spec, and smart for unsetting references)\n  if (node.prevProps != null && node.prevProps.ref) {\n    if (typeof node.prevProps.ref === 'function') {\n      node.prevProps.ref(null)\n    } else if (node.prevProps.ref.current) {\n      node.prevProps.ref.current = null\n    }\n  }\n\n  if (unmountOnly === false || node.prevProps == null) {\n    removeNode(node)\n  }\n\n  removeChildren(node)\n}\n\n/** Recollect/unmount all children.\n *  - we use .lastChild here because it causes less reflow than .firstChild\n *  - it's also cheaper than accessing the .childNodes Live NodeList\n */\nexport function removeChildren(node: ChildNode | null | undefined) {\n  node = node?.lastChild\n  while (node) {\n    let next = node.previousSibling\n    recollectNodeTree(node as ExtendedElement, true)\n    node = next\n  }\n}\n\n/** Apply differences in attributes from a VNode to the given DOM Element.\n *  @param {Element} dom    Element with attributes to diff `attrs` against\n *  @param {Object} attrs    The desired end-state key-value attribute pairs\n *  @param {Object} old      Current/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom: ExtendedElement, attrs: Record<string, unknown>, old: Record<string, unknown>, component: Component, updateSelf: boolean) {\n  let name\n  // let update = false\n  let isComponent = dom.update\n  let oldClone\n  if (dom.receiveProps) {\n    oldClone = Object.assign({}, old)\n  }\n  // remove attributes no longer present on the vnode by setting them to undefined\n  for (name in old) {\n    if (!(attrs && attrs[name] != null) && old[name] != null) {\n      setAccessor(\n        dom,\n        name,\n        old[name],\n        (old[name] = undefined),\n        isForeignObject || isSvgMode,\n      )\n      if (isComponent) {\n        delete dom.props[name]\n        // update = true\n      }\n    }\n  }\n\n  // add new & update changed attributes\n  for (name in attrs) {\n    if (isComponent && typeof attrs[name] === 'object' && name !== 'ref') {\n      if (name === 'style') {\n        setAccessor(\n          dom,\n          name,\n          old[name],\n          (old[name] = attrs[name]),\n          isForeignObject || isSvgMode\n        )\n      }\n      let ccName = camelCase(name)\n      dom.props[ccName] = old[ccName] = attrs[name]\n      //update = true\n    } else if (\n      name !== 'children' &&\n      (!(name in old) ||\n        attrs[name] !==\n        (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n    ) {\n      setAccessor(dom, name, old[name], attrs[name], isForeignObject || isSvgMode)\n      // fix lazy load props missing\n      if (dom.nodeName.indexOf('-') !== -1) {\n        dom.props = dom.props || {}\n        let ccName = camelCase(name)\n        dom.props[ccName] = old[ccName] = attrs[name]\n        // update = true\n      } else {\n        old[name] = attrs[name]\n      }\n    }\n  }\n\n  if (isComponent && !updateSelf && dom.parentNode) {\n    // __hasChildren is not accuracy when it was empty at first, so add dom.children.length > 0 condition\n    // if (update || dom.__hasChildren || dom.children.length > 0 || (dom.store && !dom.store.data)) {\n    if (dom.receiveProps(dom.props, oldClone) !== false) {\n      dom.update()\n    }\n    // }\n  }\n}\n","import { Component } from './component'\nimport { isPrimitive } from './utils'\n\ntype EffectFn = () => void;\ntype ComputedFn<T> = () => T;\n\nlet activeEffect: EffectFn | null = null\nlet batchQueue: EffectFn[] = []\n\ninterface SignalValue<T> {\n  value: T;\n  peek: () => T;\n  update: () => void;\n}\nlet activeComponent: Component | null = null\n\nexport function setActiveComponent(component: Component | null): void {\n  activeComponent = component\n}\n\nexport function getActiveComponent(): Component | null {\n  return activeComponent\n}\n\n/**\n * Creates a signal with an initial value.\n * @param initialValue - The initial value of the signal.\n * @returns A signal object with `value` and `peek` properties.\n */\nexport function signal<T>(initialValue: T): SignalValue<T> {\n  let value = initialValue\n  const deps = new Set<EffectFn>()\n  const depsComponents = new Set<Component>()\n\n  return new Proxy({} as SignalValue<T>, {\n    get(_, prop: keyof SignalValue<T>) {\n      if (prop === 'value') {\n        if (activeEffect) {\n          deps.add(activeEffect)\n        }\n        const component = getActiveComponent()\n        if (component) depsComponents.add(component)\n        return value\n      }\n      if (prop === 'peek') return () => value\n      if (prop === 'update') return () => {\n        value = value\n        deps.forEach(fn => fn())\n        depsComponents.forEach(component => component.update())\n      }\n    },\n    set(_, prop: keyof SignalValue<T>, newValue: T) {\n      if (prop === 'value') {\n        if(!isPrimitive(value) ||  !isPrimitive(newValue) || value !== newValue) {\n          value = newValue\n          deps.forEach(fn => fn())\n          depsComponents.forEach(component => component.update())\n        }    \n        return true\n      }\n      return false\n    }\n  })\n}\n\n/**\n * Creates a computed signal based on a function.\n * @param fn - The function to compute the signal value.\n * @returns A computed signal object.\n */\nexport function computed<T>(fn: ComputedFn<T>): SignalValue<T> {\n  const computedSignal = signal<T>(fn())\n  effect(() => {\n    computedSignal.value = fn()\n  })\n  return computedSignal\n}\n\n/**\n * Creates an effect based on a function.\n * @param fn - The function to create the effect.\n */\nexport function effect(fn: EffectFn): () => void {\n  const deps = new Set<SignalValue<any>>()\n  let isRunning = false // Add a flag to check if the effect function is currently running\n\n  // Create a new effect function to collect dependencies and run the original function\n  const effectFn = () => {\n    if (isRunning) return // If the effect function is already running, return directly\n    isRunning = true // Start running the effect function\n    activeEffect = effectFn\n    fn()\n    activeEffect = null\n    isRunning = false // Finish running the effect function\n  }\n\n  // Run the effect function for the first time\n  effectFn()\n\n  // Return a dispose function to cancel the effect\n  return () => {\n    deps.clear()\n  }\n}\n\n/**\n * Batches multiple updates into a single update.\n * @param fn - The function to batch.\n */\nexport function batch(fn: EffectFn): void {\n  batchQueue.push(fn)\n  if (batchQueue.length === 1) {\n    Promise.resolve().then(runBatch)\n  }\n}\n\n/**\n * Runs all functions in the batch queue.\n */\nexport function runBatch(): void {\n  while (batchQueue.length) {\n    const fn = batchQueue.shift()\n    if (fn) fn()\n  }\n}","import { isArray, hyphenate, capitalize, createStyleSheet } from './utils'\nimport { diff } from './diff'\nimport { ExtendedElement } from './dom'\nimport 'weakmap-polyfill'\nimport { VNode } from './vdom'\nimport { setActiveComponent } from './reactivity'\n\nlet id = 0\n\nconst adoptedStyleSheetsMap = new WeakMap()\ntype Module = { default: string }\ntype CSSItem = Module | string\n\ntype PropType = Object | Number | String | Boolean\n\ntype PropTypes = {\n  [key: string]: PropType | Array<PropType>\n}\n\nexport class Component extends HTMLElement {\n  static is = 'Component'\n  static defaultProps: Record<string, unknown>\n  static propTypes: PropTypes\n  static css: CSSItem | CSSItem[]\n  static isLightDOM: boolean\n  static noSlot: boolean\n\n  props: Record<string, unknown>\n  prevProps: Record<string, unknown> | null\n  elementId: number\n  isInstalled: boolean\n  store?: unknown\n  inject?: string[]\n  injection?: { [key: string]: unknown }\n  renderRoot?: ExtendedElement | ShadowRoot | Component\n  rootElement: ExtendedElement | ExtendedElement[] | null\n\n  constructor() {\n    super()\n    // @ts-ignore fix lazy load props missing\n    this.props = Object.assign({}, (this.constructor as typeof Component).defaultProps, this.props)\n    this.elementId = id++\n    this.isInstalled = false\n    this.rootElement = null\n    this.prevProps = null\n  }\n\n  injectObject() {\n    let p: ExtendedElement = this.parentNode as ExtendedElement\n    while (p && !this.store) {\n      this.store = p.store\n      p = (p.parentNode || p.host) as ExtendedElement\n    }\n\n    if (this.inject) {\n      this.injection = {}\n      p = this.parentNode as ExtendedElement\n      let provide: unknown\n      while (p && !provide) {\n        provide = p.provide\n        p = (p.parentNode || p.host) as ExtendedElement\n      }\n      if (provide) {\n        this.inject.forEach(injectKey => {\n          // @ts-ignore\n          this.injection[injectKey] = provide[injectKey]\n        })\n      }\n    }\n  }\n\n  createRenderRoot(): ShadowRoot | Component {\n    if ((this.constructor as typeof Component).isLightDOM) {\n      return this\n    } else {\n      if (this.shadowRoot) {\n        let fc: ChildNode | null\n        while ((fc = this.shadowRoot.firstChild)) {\n          this.shadowRoot.removeChild(fc)\n        }\n        return this.shadowRoot\n      } else {\n        return this.attachShadow({\n          mode: 'open'\n        })\n      }\n    }\n  }\n\n  applyAdoptedStyleSheets() {\n    if (!(this.constructor as typeof Component).isLightDOM && !adoptedStyleSheetsMap.has(this.constructor)) {\n      const css = (this.constructor as typeof Component).css\n      if (css) {\n        let styleSheets: CSSStyleSheet[] = []\n        if (typeof css === 'string') {\n          styleSheets = [createStyleSheet(css)]\n        } else if (isArray(css)) {\n          styleSheets = (css as Module[]).map(styleSheet => {\n            if (typeof styleSheet === 'string') {\n              return createStyleSheet(styleSheet)\n            } else if (\n              (styleSheet as Module).default &&\n              typeof (styleSheet as Module).default === 'string'\n            ) {\n              return createStyleSheet((styleSheet as Module).default)\n            } else {\n              return styleSheet\n            }\n          }) as CSSStyleSheet[]\n        } else if ((css as Module).default && typeof (css as Module).default === 'string') {\n          styleSheets = [createStyleSheet((css as Module).default)]\n        } else {\n          styleSheets = [css as unknown as CSSStyleSheet]\n        }\n        (this.renderRoot as ShadowRoot).adoptedStyleSheets = styleSheets\n        adoptedStyleSheetsMap.set(this.constructor, styleSheets)\n      }\n    } else {\n      (this.renderRoot as ShadowRoot).adoptedStyleSheets = adoptedStyleSheetsMap.get(\n        this.constructor\n      )\n    }\n  }\n  connectedCallback(): void {\n    this.injectObject()\n    this.attrsToProps()\n    this.beforeInstall()\n    this.install()\n    this.afterInstall()\n    this.renderRoot = this.createRenderRoot()\n    this.applyAdoptedStyleSheets()\n    this.beforeRender()\n    setActiveComponent(this)\n    // @ts-ignore\n    const rendered = this.render(this.props, this.store)\n    setActiveComponent(null)\n    this.rootElement = diff(null, rendered as VNode, null, this, false)\n    this.rendered()\n    if (isArray(this.rootElement)) {\n      (this.rootElement as Element[]).forEach((item) => {\n        this.renderRoot?.appendChild(item)\n      })\n    } else {\n      this.rootElement && this.renderRoot?.appendChild(this.rootElement as Element)\n    }\n    this.installed()\n    this.isInstalled = true\n  }\n\n  disconnectedCallback(): void {\n    this.uninstall()\n    this.isInstalled = false\n  }\n\n  update(updateSelf?: boolean): void {\n\n    this.beforeUpdate()\n    this.beforeRender()\n    this.attrsToProps()\n    setActiveComponent(this)\n    // @ts-ignore\n    const rendered = this.render(this.props, this.store)\n    setActiveComponent(null)\n    this.rendered()\n\n    this.rootElement = diff(\n      this.rootElement,\n      rendered as VNode,\n      this.renderRoot as ExtendedElement,\n      this,\n      !!updateSelf\n    )\n    this.updated()\n  }\n\n  updateProps(obj: Record<string, unknown>): void {\n    Object.keys(obj).forEach((key) => {\n      this.props[key] = obj[key]\n      if (this.prevProps) {\n        this.prevProps[key] = obj[key]\n      }\n    })\n    this.update()\n  }\n\n  updateSelf(): void {\n    this.update(true)\n  }\n\n  removeAttribute(key: string): void {\n    super.removeAttribute(key)\n    // Avoid executing removeAttribute methods before connectedCallback\n    this.isInstalled && this.update()\n  }\n\n  setAttribute(key: string, val: string | object): void {\n    if (val && typeof val === 'object') {\n      super.setAttribute(key, JSON.stringify(val))\n    } else {\n      super.setAttribute(key, val)\n    }\n    // Avoid executing setAttribute methods before connectedCallback\n    this.isInstalled && this.update()\n  }\n\n  nativeRemoveAttribute(key: string): void {\n    super.removeAttribute(key)\n  }\n\n  nativeSetAttribute(key: string, val: string): void {\n    super.setAttribute(key, val)\n  }\n\n  attrsToProps(): void {\n    if (this.props.ignoreAttrs) return\n    const ele = this\n    const attrs = (this.constructor as typeof Component).propTypes\n    if (!attrs) return\n    Object.keys(attrs).forEach((key) => {\n      const types = isArray(attrs[key]) ? attrs[key] : [attrs[key]]\n      const val = ele.getAttribute(hyphenate(key))\n      if (val !== null) {\n        for (let i = 0; i < (types as Array<PropType>).length; i++) {\n          const type = (types as Array<PropType>)[i]\n          let matched = false\n          switch (type) {\n            case String:\n              ele.props[key] = val\n              matched = true\n              break\n            case Number:\n              ele.props[key] = Number(val)\n              matched = true\n              break\n            case Boolean:\n              if (val === 'false' || val === '0') {\n                ele.props[key] = false\n              } else {\n                ele.props[key] = true\n              }\n              matched = true\n              break\n            case Array:\n            case Object:\n              try {\n                ele.props[key] = JSON.parse(val)\n              } catch (e) {\n                console.warn(\n                  `The ${key} object prop does not comply with the JSON specification, the incorrect string is [${val}].`\n                )\n              }\n              matched = true\n              break\n          }\n          if (matched) break\n        }\n      } else {\n        if (\n          (ele.constructor as typeof Component).defaultProps &&\n          (ele.constructor as typeof Component).defaultProps.hasOwnProperty(key)\n        ) {\n          ele.props[key] = (ele.constructor as typeof Component).defaultProps[key]\n        } else {\n          ele.props[key] = null\n        }\n      }\n    })\n  }\n\n  fire(name: string, data: unknown): void {\n    const handler = this.props[`on${capitalize(name)}`] as Function\n    if (handler) {\n      handler(\n        new CustomEvent(name, {\n          detail: data\n        })\n      )\n    } else {\n      this.dispatchEvent(\n        new CustomEvent(name, {\n          detail: data\n        })\n      )\n    }\n  }\n\n  beforeInstall() { }\n\n  install() { }\n\n  afterInstall() { }\n\n  installed() { }\n\n  uninstall() { }\n\n  beforeUpdate() { }\n\n  updated() { }\n\n  beforeRender() { }\n\n  rendered() { }\n\n  receiveProps() { }\n}\n","/**\n * Defines a custom element.\n * @param name - The name of the custom element.\n * @param ctor - The constructor function for the custom element.\n */\nexport function define(name: string, ctor: CustomElementConstructor): void {\n  if (customElements.get(name)) {\n    console.warn(`Failed to execute 'define' on 'CustomElementRegistry': the name \"${name}\" has already been used with this registry`)\n    return\n  }\n\n  customElements.define(name, ctor)\n}\n\nexport function tag(name: string) {\n  return function (target: CustomElementConstructor) {\n    define(name, target)\n  }\n}\n","/**\n * classNames based on https://github.com/JedWatson/classnames\n * by Jed Watson\n * Licensed under the MIT License\n * https://github.com/JedWatson/classnames/blob/master/LICENSE\n * modified by dntzhang\n */\nconst hasOwn = {}.hasOwnProperty\n\ntype Value = string | number | boolean | undefined | null\ntype Mapping = Record<string, unknown>\ninterface ArgumentArray extends Array<Argument> { }\ninterface ReadonlyArgumentArray extends ReadonlyArray<Argument> { }\ntype Argument = Value | Mapping | ArgumentArray | ReadonlyArgumentArray\n\nexport function classNames(...args: ArgumentArray): string {\n  const classes: (string | number)[] = []\n\n  for (let i = 0; i < args.length; i++) {\n    const arg: Argument = args[i]\n    if (!arg) continue\n\n    const argType = typeof arg\n\n    if (argType === 'string' || argType === 'number') {\n      classes.push(arg as (string | number))\n    } else if (Array.isArray(arg) && arg.length) {\n      const inner = classNames(...arg)\n      if (inner) {\n        classes.push(inner)\n      }\n    } else if (argType === 'object') {\n      for (const key in (arg as Mapping)) {\n        if (hasOwn.call(arg, key) && (arg as Mapping)[key]) {\n          classes.push(key)\n        }\n      }\n    }\n  }\n\n  return classes.join(' ')\n}\n\ntype PropsMapping = {\n  class?: Argument,\n  className?: Argument\n} & Mapping\n\nexport function extractClass(props: PropsMapping, ...args: ArgumentArray): { class: string } | undefined {\n  if (props.class) {\n    args.unshift(props.class)\n    delete props.class\n  } else if (props.className) {\n    args.unshift(props.className)\n    delete props.className\n  }\n  if (args.length > 0) {\n    return { class: classNames(...args) }\n  }\n}\n","import { signal, computed, effect, batch, setActiveComponent, getActiveComponent } from './reactivity'\n\nexport class Signal<T> {\n  private _value: T\n  private _signal: ReturnType<typeof signal>\n\n  constructor(initialValue: T) {\n    this._value = initialValue as unknown as T\n    this._signal = signal(initialValue)\n  }\n\n  get value() {\n    return this._signal.value as T\n  }\n\n  set value(newValue: T) {\n    this._signal.value = newValue\n  }\n\n  peek() {\n    return this._signal.peek()\n  }\n\n  computed(fn: () => T): Signal<T> {\n    return computed(fn) as Signal<T>\n  }\n\n  effect(fn: () => void) {\n    return effect(fn)\n  }\n\n  batch(fn: () => void) {\n    return batch(fn)\n  }\n\n  setActiveComponent(component: any) {\n    return setActiveComponent(component)\n  }\n\n  getActiveComponent() {\n    return getActiveComponent()\n  }\n\n  update(fn?: (value: T) => void) {\n    fn && fn(this._value)\n    this.value = this.value\n  }\n\n}","/**\n * Cache for storing created CSSStyleSheets.\n */\nlet styleSheetCache: { [key: string]: CSSStyleSheet } = {}\n\n/**\n * A tagged template function for CSS that supports JavaScript expressions.\n * It concatenates the parts of the template string with the values of the expressions.\n * It also checks if the values are safe to insert into CSS.\n * The function returns a CSSStyleSheet object, which can be shared among multiple elements.\n *\n * @param {TemplateStringsArray} strings - The parts of the template string.\n * @param {...unknown[]} values - The values of the expressions.\n * @returns {CSSStyleSheet} The resulting CSSStyleSheet object.\n * @throws {Error} If a value is not safe to insert into CSS.\n */\nexport function css(strings: TemplateStringsArray, ...values: unknown[]): CSSStyleSheet {\n  let str = ''\n  strings.forEach((string, i) => {\n    // Check if the value is safe to insert into CSS\n    if (values[i] !== undefined && typeof values[i] !== 'string' && typeof values[i] !== 'number') {\n      throw new Error(`Unsupported value in CSS: ${values[i]}`)\n    }\n\n    str += string + (values[i] || '')\n  })\n\n  // Check if the style sheet is in the cache\n  if (styleSheetCache[str]) {\n    // If it is, return the cached style sheet\n    return styleSheetCache[str]\n  } else {\n    // If it's not, create a new style sheet\n    const styleSheet = new CSSStyleSheet()\n    styleSheet.replaceSync(str)\n\n    // Store the new style sheet in the cache\n    styleSheetCache[str] = styleSheet\n\n    // Return the new style sheet\n    return styleSheet\n  }\n}","import { diff } from './diff'\nimport { ExtendedElement } from './dom'\nimport { VNode } from './vdom'\n\nexport function render(vnode: unknown, parent: Element | null, store?: unknown) {\n  parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n  if (store && parent) {\n    (parent as ExtendedElement).store = store\n  }\n  return diff(null, vnode as VNode, parent as ExtendedElement, null, false)\n}\n","export { cloneElement, createElement, createElement as h } from './vdom'\nexport { Component, Component as WeElement } from './component'\nexport { render } from './render'\nexport { define, define as defineElement, tag } from './define'\nexport { classNames, extractClass } from './class'\nexport { createRef, bind } from './utils'\nexport { signal, computed, effect, batch, setActiveComponent, getActiveComponent } from './reactivity'\nexport { Signal } from './signal'\nexport { css } from './css-tag'\nexport const version = '7.1.0'\n\n\n"],"names":["camelCase","str","replace","_","$1","toUpperCase","Fragment","props","children","applyRef","ref","value","current","isArray","obj","Object","prototype","toString","call","document","hasShadyCss","window","ShadyCSS","nativeShadow","bootstrapper","implementation","createHTMLDocument","closedShadowRootRegistry","WeakMap","_DOMException","DOMException","Error","defineProperty","forEach","Array","importPattern","nonConstructedProto","CSSStyleSheet","Promise","reject","replaceSync","$basicStyleSheet","$locations","$adoptersByLocation","proto$2","ConstructedStyleSheet","contents","this","resolve","e","checkInvocationCorrectness","self_1","style","get","ownerNode","textContent","_contents","console","warn","trim","rejectImports","set","sheet","location","isConnected","restyleAdopter","getAdopterByLocation","configurable","enumerable","cssRules","method","self","args","arguments","basic","locations","result","apply","Symbol","hasInstance","isCSSStyleSheetInstance","defaultObserverOptions","childList","subtree","$element","$uniqueSheets","$observer","proto$1","Location","element","Document","readyState","contains","isElementConnected","host","connect","container","getAdopterContainer","observe","length","adopt","traverseWebComponents","root","getAssociatedLocation","disconnect","update","sheets","locationType","TypeError","every","some","isNonConstructedStyleSheetInstance","arr","arr2","oldUniqueSheets","uniqueSheets","filter","index","indexOf","node","parentNode","removeChild","_location","removeAdopterLocation","attachAdoptedStyleSheetProperty","ShadowRoot","proto","Element","attach_1","attachShadow","init","mode","documentLocation","addEventListener","bind","getShadowRoot","shadowRoot","instance","isPrototypeOf","adopter","requestAnimationFrame","from","to","i","deleteRule","clearRules","rule","insertRule","cssText","has","createElement","body","appendChild","constructor","callback","iter","createNodeIterator","NodeFilter","SHOW_ELEMENT","foundNode","FILTER_ACCEPT","FILTER_REJECT","next","nextNode","styleList","createDocumentFragment","observer","push","addAdopterLocation","insertBefore","MutationObserver","mutations","mutation","addedNodes","removedNodes","HTMLStyleElement","isExistingAdopter","w","global","undefined","Reflect","customElements","hasOwnProperty","BuiltInHTMLElement","HTMLElement","construct","setPrototypeOf","hyphenateRE","createStyleSheet","styleSheet","isNamedNode","nodeName","normalizedNodeName","toLowerCase","isPrimitive","stack","attributes","restChildren","child","simple","lastSimple","ignoreAttrs","pop","String","key","f","DOM_EVENT_MAP","onanimationcancel","oncompositionend","oncompositionstart","oncompositionupdate","onfocusin","onfocusout","onscrollend","ontouchcancel","ontouchend","ontouchmove","ontouchstart","IS_NON_DIMENSIONAL","removeNode","setAccessor","name","old","isSvg","test","innerHTML","html","useCapture","nameLower","slice","eventProxy","removeEventListener","_listeners","bindEvent","nativeRemoveAttribute","removeAttribute","ns","removeAttributeNS","setAttributeNS","nativeSetAttribute","setAttribute","className","type","diffLevel","isSvgMode","isForeignObject","hydrating","diff","dom","vnode","parent","component","updateSelf","ownerSVGElement","innerDiffNode","ret","item","ele","idiff","recollectNodeTree","_ret","_dom$parentNode","out","prevSvgMode","prevForeignObject","splitText","_component","nodeValue","createTextNode","replaceChild","prevProps","vnodeName","createElementNS","_dom$parentNode2","firstChild","fc","vchildren","a","nextSibling","is","noSlot","unsafeHTML","attrs","oldClone","isComponent","receiveProps","assign","ccName","diffAttributes","isHydrating","j","c","vchild","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","_child$nodeValue","unmountOnly","_node","lastChild","previousSibling","removeChildren","activeEffect","batchQueue","activeComponent","setActiveComponent","getActiveComponent","signal","initialValue","deps","Set","depsComponents","Proxy","prop","add","fn","newValue","computed","computedSignal","effect","isRunning","effectFn","clear","batch","then","runBatch","shift","id","adoptedStyleSheetsMap","Component","_HTMLElement","_this","elementId","isInstalled","store","inject","injection","renderRoot","rootElement","defaultProps","_proto","injectObject","_this2","p","provide","injectKey","createRenderRoot","isLightDOM","applyAdoptedStyleSheets","adoptedStyleSheets","styleSheets","css","map","connectedCallback","_this3","attrsToProps","beforeInstall","install","afterInstall","beforeRender","_this$renderRoot","rendered","render","_this3$renderRoot","installed","disconnectedCallback","uninstall","beforeUpdate","updated","updateProps","_this4","keys","val","JSON","stringify","propTypes","types","getAttribute","matched","Number","Boolean","parse","fire","data","handler","capitalize","letter","s","CustomEvent","detail","dispatchEvent","_wrapNativeSuper","define","ctor","hasOwn","classNames","classes","arg","argType","inner","join","Signal","_value","_signal","peek","styleSheetCache","target","propertyKey","descriptor","bound","writable","rest","_extends","strings","values","string","unshift","class","querySelector"],"mappings":"stDA+BgB,SAAAA,EAAUC,GACxB,OAAOA,EAAIC,QAAQ,SAAU,SAACC,EAAGC,GAAO,OAAAA,EAAGC,aAAa,EAC1D,CAOgB,SAAAC,EAASC,GACvB,OAAOA,EAAMC,QACf,CAOgB,SAAAC,EAASC,EAAuDC,GACnE,MAAPD,IACgB,mBAAPA,EAAmBA,EAAIC,GAC7BD,EAAIE,QAAUD,EAEvB,CAOM,SAAUE,EAAQC,GACtB,MAA+C,mBAAxCC,OAAOC,UAAUC,SAASC,KAAKJ,EACxC,EC7DC,WAGC,GAAwB,oBAAbK,YAA4B,uBAAwBA,UAA/D,CAEA,IAAIC,EAAc,aAAcC,SAAWC,SAASC,aAChDC,EAAeL,SAASM,eAAeC,mBAAmB,QAC1DC,EAA2B,IAAIC,QAC/BC,EAAwC,iBAAjBC,aAA4BC,MAAQD,aAE3DE,EAAiBjB,OAAOiB,eACxBC,EAAUC,MAAMlB,UAAUiB,QAC1BE,EAAgB,kBA8ChBC,EAD2BC,cACoBrB,UACnDoB,EAAoBlC,QAAU,WAC5B,OAAOoC,QAAQC,OAAO,IAAIV,EAAc,yDAC1C,EACAO,EAAoBI,YAAc,WAChC,MAAU,IAAAX,EAAc,gHAC1B,EAYA,IAAIY,EAAmB,IAAIb,QACvBc,EAAa,IAAId,QACjBe,EAAsB,IAAIf,QAiC1BgB,EAAUC,EAAsB7B,UACpC4B,EAAQ1C,QAAU,SAAiB4C,GACjC,IAEE,OADAC,KAAKP,YAAYM,GACVR,QAAQU,QAAQD,KACxB,CACD,MAAOE,GACL,OAAOX,QAAQC,OAAOU,EACvB,CACH,EACAL,EAAQJ,YAAc,SAAqBM,GAEzC,GADAI,EAA2BH,MACH,iBAAbD,EAAuB,CAChC,IAAIK,EAASJ,KACTK,EAAQX,EAAiBY,IAAIF,GAAQG,UACzC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