{"version":3,"sources":["jsdelivr-header.js","/npm/overmind-components@1.0.0/src/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,mGCNA,YAAA,QAAA,eACA,UAAA,QAAA,aACA,OAAA,QAAA,UACA,UAAA,QAAA,aACA,SAAA,QAAA,YAUA,SAAS,iBAAiB,GACxB,OAAO,EAAS,QAAO,CAAC,EAAM,IACd,OAAV,EACK,EAAK,OAAO,IAAI,OAAA,MACG,iBAAV,GAAuC,mBAAV,EACtC,EAAK,OAAO,IAAI,UAAA,QAAQ,IACtB,MAAM,QAAQ,GAChB,EAAK,OACV,EAAM,KAAK,GACQ,OAAb,EACK,IAAI,OAAA,KAES,iBAAb,GACa,mBAAb,EAEA,IAAI,UAAA,QAAQ,GAGd,KAKN,EAAK,OAAO,IAClB,GACL,CAEA,SAAgB,cAAc,EAAK,KAAU,GAC3C,MAAmB,mBAAR,EACF,IAAI,YAAA,UAAU,EAAK,EAAO,iBAAiB,IAG7C,IAAI,UAAA,QAAQ,EAAK,EAAO,iBAAiB,GAClD,CAIA,SAAgB,OAAO,EAAK,EAAQ,EAAQ,EAAU,UACpD,EAAI,gBAAkB,EACtB,MAAM,EAAS,IAAI,UAAA,QAAQ,EAAQ,KAAM,CAAC,IAO1C,OANA,EAAO,MAAM,KAAM,CACjB,MACA,UACA,OAAQ,IAAI,SAAA,OAAO,KAGd,CACT,CAjDA,QAAA,aAAA,QAAA,WAAA,SA6BA,QAAA,4BAQa,QAAA,EAAI,cAEjB,QAAA","file":"/npm/overmind-components@1.0.0/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/overmind-components@1.0.0/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { Component } from './Component'\nimport { Element } from './Element'\nimport { Null } from './Null'\nimport { Literal } from './Literal'\nimport { Events } from './Events'\n\nexport { FormEvent } from './Component'\n\nexport type Component<Props = object> = (\n  props: Props extends { children: any } ? Props : Props & { children?: any }\n) => JSX.Element\n\nexport * from './hooks'\n\nfunction evaluateChildren(children) {\n  return children.reduce((aggr, child) => {\n    if (child === null) {\n      return aggr.concat(new Null())\n    } else if (typeof child !== 'object' && typeof child !== 'function') {\n      return aggr.concat(new Literal(child))\n    } else if (Array.isArray(child)) {\n      return aggr.concat(\n        child.map((subChild) => {\n          if (subChild === null) {\n            return new Null()\n          } else if (\n            typeof subChild !== 'object' &&\n            typeof subChild !== 'function'\n          ) {\n            return new Literal(subChild)\n          }\n\n          return subChild\n        })\n      )\n    }\n\n    return aggr.concat(child)\n  }, [])\n}\n\nexport function createElement(tag, props, ...children) {\n  if (typeof tag === 'function') {\n    return new Component(tag, props, evaluateChildren(children))\n  }\n\n  return new Element(tag, props, evaluateChildren(children))\n}\n\nexport const h = createElement\n\nexport function render(app, source, target, factory = document as any) {\n  app.nextComponentId = 0\n  const parent = new Element(target, null, [source])\n  parent.mount(null, {\n    app,\n    factory,\n    events: new Events(factory),\n  })\n\n  return parent\n}\n"]}