{"version":3,"file":"buildThumbnailURL.mjs","names":[],"sources":["../../src/utils/buildThumbnailURL.ts"],"sourcesContent":["import type { S3Store } from '../tus/stores/s3/s3Store'\nimport type { Storage } from '../types'\n\ninterface BuildThumbnailURLArgs {\n  storage: Storage\n  playbackId?: string\n  s3Key?: string\n  s3Store?: S3Store | null\n}\n\nexport function buildThumbnailURL(args: BuildThumbnailURLArgs) {\n  const { storage, s3Store, playbackId, s3Key } = args\n\n  if (storage === 'mux' && playbackId) {\n    return `https://image.mux.com/${playbackId}/thumbnail.jpg?width=400&height=400&fit_mode=pad`\n  }\n\n  if (storage === 's3' && s3Key) {\n    const url = s3Store?.getUrl(s3Key)\n    return `https://wsrv.nl/?url=${url}?width=512&height=512&default=1&q=80`\n  }\n}\n"],"mappings":";AAUA,SAAgB,kBAAkB,MAA6B;CAC7D,MAAM,EAAE,SAAS,SAAS,YAAY,UAAU;AAEhD,KAAI,YAAY,SAAS,WACvB,QAAO,yBAAyB,WAAW;AAG7C,KAAI,YAAY,QAAQ,MAEtB,QAAO,wBADK,SAAS,OAAO,MAAM,CACC"}