{"version":3,"file":"jsxRuntime.cjs","sources":["../src/index.ts"],"sourcesContent":["import { h, Fragment } from 'lithent';\nimport type {\n  Props,\n  TagFunction,\n  FragmentFunction,\n  MiddleStateWDomChildren,\n} from 'lithent';\n\nfunction createWNode(\n  type: TagFunction | FragmentFunction | string,\n  orgProps: Props,\n  key: unknown,\n  isStaticChildren: boolean,\n  _source: unknown,\n  _self: unknown\n) {\n  const { children, ...props } = orgProps;\n  if (children !== null && children !== undefined) {\n    // A dynamic array is one keyed loop child of h(). Only jsxs/JSXDEV's\n    // static siblings may be spread; flattening a loop loses key matching.\n    const newChildren: MiddleStateWDomChildren =\n      isStaticChildren && Array.isArray(children) ? children : [children];\n\n    return h(type, { ...props, key } as Props, ...newChildren);\n  }\n\n  return h(type, { ...props, key } as Props);\n}\n\nfunction createStaticWNode(\n  type: TagFunction | FragmentFunction | string,\n  orgProps: Props,\n  key: unknown,\n  _isStaticChildren?: boolean,\n  _source?: unknown,\n  _self?: unknown\n) {\n  return createWNode(type, orgProps, key, true, undefined, undefined);\n}\n\nexport {\n  createWNode as jsx,\n  createStaticWNode as jsxs,\n  createWNode as jsxDEV,\n  Fragment,\n};\n"],"names":["createWNode","type","orgProps","key","isStaticChildren","_source","_self","children","props","newChildren","h","createStaticWNode","_isStaticChildren"],"mappings":"2GAQA,SAASA,EACPC,EACAC,EACAC,EACAC,EACAC,EACAC,EACA,CACA,KAAM,CAAE,SAAAC,EAAU,GAAGC,CAAA,EAAUN,EAC3B,GAAAK,GAAa,KAAgC,CAGzC,MAAAE,EACJL,GAAoB,MAAM,QAAQG,CAAQ,EAAIA,EAAW,CAACA,CAAQ,EAE7D,OAAAG,EAAAA,EAAET,EAAM,CAAE,GAAGO,EAAO,IAAAL,CAAI,EAAY,GAAGM,CAAW,CAC3D,CAEA,OAAOC,EAAAA,EAAET,EAAM,CAAE,GAAGO,EAAO,IAAAL,CAAc,CAAA,CAC3C,CAEA,SAASQ,EACPV,EACAC,EACAC,EACAS,EACAP,EACAC,EACA,CACA,OAAON,EAAYC,EAAMC,EAAUC,EAAK,EAA0B,CACpE"}