{"version":3,"file":"createAnnotationElement.js","names":[],"sources":["../../src/utils/createAnnotationElement.ts"],"sourcesContent":["import type { Element as HASTElement } from 'hast';\n\nimport type { AnnotationSpan } from '../types';\nimport { createHastElement } from './hast_utils';\n\nexport function createAnnotationElement(span: AnnotationSpan): HASTElement {\n  return createHastElement({\n    tagName: 'div',\n    children: [\n      createHastElement({\n        tagName: 'div',\n        children: span.annotations?.map((slotId) =>\n          createHastElement({ tagName: 'slot', properties: { name: slotId } })\n        ),\n        properties: { 'data-annotation-content': '' },\n      }),\n    ],\n    properties: {\n      'data-line-annotation': `${span.hunkIndex},${span.lineIndex}`,\n    },\n  });\n}\n"],"mappings":";;;AAKA,SAAgB,wBAAwB,MAAmC;AACzE,QAAO,kBAAkB;EACvB,SAAS;EACT,UAAU,CACR,kBAAkB;GAChB,SAAS;GACT,UAAU,KAAK,aAAa,KAAK,WAC/B,kBAAkB;IAAE,SAAS;IAAQ,YAAY,EAAE,MAAM,QAAQ;IAAE,CAAC,CACrE;GACD,YAAY,EAAE,2BAA2B,IAAI;GAC9C,CAAC,CACH;EACD,YAAY,EACV,wBAAwB,GAAG,KAAK,UAAU,GAAG,KAAK,aACnD;EACF,CAAC"}