{
  "version": 3,
  "sources": ["../../src/utils/transform-attachment.ts"],
  "sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Attachment, RestAttachment } from './types';\n\n/**\n * Transforms an attachment object from the REST API shape into the shape expected by the block editor and other consumers.\n *\n * @param attachment REST API attachment object.\n */\nexport function transformAttachment( attachment: RestAttachment ): Attachment {\n\t// eslint-disable-next-line camelcase\n\tconst { alt_text, source_url, ...savedMediaProps } = attachment;\n\treturn {\n\t\t...savedMediaProps,\n\t\talt: attachment.alt_text,\n\t\tcaption: attachment.caption?.raw ?? '',\n\t\ttitle: attachment.title.raw,\n\t\turl: attachment.source_url,\n\t\tposter:\n\t\t\tattachment._embedded?.[ 'wp:featuredmedia' ]?.[ 0 ]?.source_url ||\n\t\t\tundefined,\n\t};\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,SAAS,oBAAqB,YAAyC;AAE7E,QAAM,EAAE,UAAU,YAAY,GAAG,gBAAgB,IAAI;AACrD,SAAO;AAAA,IACN,GAAG;AAAA,IACH,KAAK,WAAW;AAAA,IAChB,SAAS,WAAW,SAAS,OAAO;AAAA,IACpC,OAAO,WAAW,MAAM;AAAA,IACxB,KAAK,WAAW;AAAA,IAChB,QACC,WAAW,YAAa,kBAAmB,IAAK,CAAE,GAAG,cACrD;AAAA,EACF;AACD;",
  "names": []
}
