{"version":3,"file":"index.cjs","names":["status?: string","cause?: unknown"],"sources":["../src/mutator/custom-audio-video-axios-instance.ts","../src/generated/audio-video-api-client/audio-video-api-client.ts","../src/generated/audio-video-api-client/audio-video-api-client.schemas.ts","../src/generated/audio-video-api-client/index.ts","../src/extension/audio-video-job-polling-extension.ts"],"sourcesContent":["import Axios, { type AxiosRequestConfig } from 'axios';\n\nexport const AUDIO_VIDEO_AXIOS_INSTANCE = Axios.create();\nAUDIO_VIDEO_AXIOS_INSTANCE.defaults.baseURL = 'https://audio-video-api.adobe.io';\n\n// add a second `options` argument here if you want to pass extra options to each generated query\nexport const customAudioVideoAxiosInstance = <T>(\n  config: AxiosRequestConfig,\n  options?: AxiosRequestConfig\n): Promise<T> => {\n  const source = Axios.CancelToken.source();\n\n  const promise = AUDIO_VIDEO_AXIOS_INSTANCE({\n    ...config,\n    ...options,\n    cancelToken: source.token,\n  }).then(({ data }) => data);\n\n  return promise;\n};\n","/**\n * Generated by orval v7.14.0 🍺\n * Do not edit manually.\n * Firefly Services Audio and Video API\n * This RESTful API provides resources to use Firefly Services AI for audio and video generation and processing.\n * OpenAPI spec version: 1.0.0\n */\nimport type {\n  AvatarRequest,\n  DubRequest,\n  GenerateReframedVideo202,\n  GenerateReframedVideoBody,\n  GenerateReframedVideoV2202,\n  GenerateReframedVideoV2Body,\n  GenerateSpeechUsingPlainText,\n  JobResultV2200,\n  JobResultV2PathParameters,\n  JobStatusLinkResponse,\n  PresetsResponse,\n  StatusAPIResponse,\n  StatusPathParameters,\n  SubmitAPIResponse,\n  SuccessfulAvatarsResponse,\n  SuccessfulVoicesResponse,\n  TemplateDescribeRequest,\n  TemplateDescribeResponse,\n  TemplateRenderRequest,\n  TemplateRenderResponse,\n  TranscribeRequest,\n} from './audio-video-api-client.schemas';\n\nimport { customAudioVideoAxiosInstance } from '../../mutator/custom-audio-video-axios-instance';\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * This endpoint provides the list of all available voices for the user's enterprise.\n * @summary Get available voices\n */\nexport const voices = (\n  options?: SecondParameter<typeof customAudioVideoAxiosInstance<SuccessfulVoicesResponse>>\n) => {\n  return customAudioVideoAxiosInstance<SuccessfulVoicesResponse>(\n    { url: `/v1/voices`, method: 'GET' },\n    options\n  );\n};\n\n/**\n * This endpoint generates speech from a transcript. You can provide the transcript either as plain text or a pre-signed URL. The response will include a job ID and a status URL for tracking the job.\n * @summary Generate speech from text\n */\nexport const generateSpeech = (\n  generateSpeechUsingPlainText: GenerateSpeechUsingPlainText,\n  options?: SecondParameter<typeof customAudioVideoAxiosInstance<SubmitAPIResponse>>\n) => {\n  return customAudioVideoAxiosInstance<SubmitAPIResponse>(\n    {\n      url: `/v1/generate-speech`,\n      method: 'POST',\n      headers: { 'Content-Type': 'application/json' },\n      data: generateSpeechUsingPlainText,\n    },\n    options\n  );\n};\n\n/**\n * Provides the status and result of an asynchronous job. For Dynamic Graphics Render (DGR), returns the status of a Describe template or Render job.\n * @summary Get job status\n */\nexport const status = (\n  { jobId }: StatusPathParameters,\n  options?: SecondParameter<typeof customAudioVideoAxiosInstance<StatusAPIResponse>>\n) => {\n  return customAudioVideoAxiosInstance<StatusAPIResponse>(\n    { url: `/v1/status/${jobId}`, method: 'GET' },\n    options\n  );\n};\n\n/**\n * Analyzes a MOGRT (video template) file and returns a manifest of editable controls; fonts, images, audio, video and other supported values.\n * @summary Describe template\n */\nexport const templateDescribe = (\n  templateDescribeRequest: TemplateDescribeRequest,\n  options?: SecondParameter<typeof customAudioVideoAxiosInstance<TemplateDescribeResponse>>\n) => {\n  return customAudioVideoAxiosInstance<TemplateDescribeResponse>(\n    {\n      url: `/v1/templates/describe`,\n      method: 'POST',\n      headers: { 'Content-Type': 'application/json' },\n      data: templateDescribeRequest,\n    },\n    options\n  );\n};\n\n/**\n * Returns a list of predefined social-first encoding presets for rendering outputs.\n * @summary Fetch video rendering presets\n */\nexport const getPresets = (\n  options?: SecondParameter<typeof customAudioVideoAxiosInstance<PresetsResponse>>\n) => {\n  return customAudioVideoAxiosInstance<PresetsResponse>(\n    { url: `/v1/presets`, method: 'GET' },\n    options\n  );\n};\n\n/**\n * Renders one or more video variations by applying overrides and export presets. Submit up to 10 overrides per call for a subset of editable layers and get a pre-signed URL link to download the video file. For layers that are not editable, the system defaults are automatically applied at export.\n * @summary Render template\n */\nexport const templateRender = (\n  templateRenderRequest: TemplateRenderRequest,\n  options?: SecondParameter<typeof customAudioVideoAxiosInstance<TemplateRenderResponse>>\n) => {\n  return customAudioVideoAxiosInstance<TemplateRenderResponse>(\n    {\n      url: `/v1/templates/render`,\n      method: 'POST',\n      headers: { 'Content-Type': 'application/json' },\n      data: templateRenderRequest,\n    },\n    options\n  );\n};\n\n/**\n * This endpoint enables you to reframe video using AI. Provide video input with a pre-signed URL to generate reframed video output. \n\nThis API has more limited capabilities than the v2 endpoint, and may be deprecated soon. **It's recommended to use the v2 endpoint instead.**\n * @summary Reframe video\n */\nexport const generateReframedVideo = (\n  generateReframedVideoBody: GenerateReframedVideoBody,\n  options?: SecondParameter<typeof customAudioVideoAxiosInstance<GenerateReframedVideo202>>\n) => {\n  return customAudioVideoAxiosInstance<GenerateReframedVideo202>(\n    {\n      url: `/v1/reframe`,\n      method: 'POST',\n      headers: { 'Content-Type': 'application/json' },\n      data: generateReframedVideoBody,\n    },\n    options\n  );\n};\n\n/**\n * Generates transcripts and captions for the input audio or video in the source language or in a target language.\n * @summary Transcribe media\n */\nexport const transcribe = (\n  transcribeRequest: TranscribeRequest,\n  options?: SecondParameter<typeof customAudioVideoAxiosInstance<JobStatusLinkResponse>>\n) => {\n  return customAudioVideoAxiosInstance<JobStatusLinkResponse>(\n    {\n      url: `/v1/transcribe`,\n      method: 'POST',\n      headers: { 'Content-Type': 'application/json' },\n      data: transcribeRequest,\n    },\n    options\n  );\n};\n\n/**\n * Generate dubbed video or audio. A composited lip sync can also be added for video dubbing.\n * @summary Dub audio or video\n */\nexport const dub = (\n  dubRequest: DubRequest,\n  options?: SecondParameter<typeof customAudioVideoAxiosInstance<JobStatusLinkResponse>>\n) => {\n  return customAudioVideoAxiosInstance<JobStatusLinkResponse>(\n    {\n      url: `/v1/dub`,\n      method: 'POST',\n      headers: { 'Content-Type': 'application/json' },\n      data: dubRequest,\n    },\n    options\n  );\n};\n\n/**\n * Retrieves the list of all available avatars for the user's enterprise.\n * @summary Get available avatars\n */\nexport const avatars = (\n  options?: SecondParameter<typeof customAudioVideoAxiosInstance<SuccessfulAvatarsResponse>>\n) => {\n  return customAudioVideoAxiosInstance<SuccessfulAvatarsResponse>(\n    { url: `/v1/avatars`, method: 'GET' },\n    options\n  );\n};\n\n/**\n * This endpoint enables you to reframe the input media. You can provide a video input via a pre-signed URL to generate reframed output video.\n * @summary Reframe video v2\n */\nexport const generateReframedVideoV2 = (\n  generateReframedVideoV2Body: GenerateReframedVideoV2Body,\n  options?: SecondParameter<typeof customAudioVideoAxiosInstance<GenerateReframedVideoV2202>>\n) => {\n  return customAudioVideoAxiosInstance<GenerateReframedVideoV2202>(\n    {\n      url: `/v2/reframe`,\n      method: 'POST',\n      headers: { 'Content-Type': 'application/json' },\n      data: generateReframedVideoV2Body,\n    },\n    options\n  );\n};\n\n/**\n * This endpoint retrieves the result of an asynchronous reframed job initiated using the job ID.\n * @summary Get job result\n */\nexport const jobResultV2 = (\n  { jobId }: JobResultV2PathParameters,\n  options?: SecondParameter<typeof customAudioVideoAxiosInstance<JobResultV2200>>\n) => {\n  return customAudioVideoAxiosInstance<JobResultV2200>(\n    { url: `/v2/status/${jobId}`, method: 'GET' },\n    options\n  );\n};\n\n/**\n * Generates an avatar video from a provided transcript or audio file. You can provide the transcript either as plain text or a pre-signed URL. The API is asynchronous, so the response will include a job ID and a status URL for tracking the running job.\n * @summary Generate avatar video from text\n */\nexport const generateAvatar = (\n  avatarRequest: AvatarRequest,\n  options?: SecondParameter<typeof customAudioVideoAxiosInstance<SubmitAPIResponse>>\n) => {\n  return customAudioVideoAxiosInstance<SubmitAPIResponse>(\n    {\n      url: `/v1/generate-avatar`,\n      method: 'POST',\n      headers: { 'Content-Type': 'application/json' },\n      data: avatarRequest,\n    },\n    options\n  );\n};\n\ntype AwaitedInput<T> = PromiseLike<T> | T;\n\ntype Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\nexport type VoicesResult = NonNullable<Awaited<ReturnType<typeof voices>>>;\nexport type GenerateSpeechResult = NonNullable<Awaited<ReturnType<typeof generateSpeech>>>;\nexport type StatusResult = NonNullable<Awaited<ReturnType<typeof status>>>;\nexport type TemplateDescribeResult = NonNullable<Awaited<ReturnType<typeof templateDescribe>>>;\nexport type GetPresetsResult = NonNullable<Awaited<ReturnType<typeof getPresets>>>;\nexport type TemplateRenderResult = NonNullable<Awaited<ReturnType<typeof templateRender>>>;\nexport type GenerateReframedVideoResult = NonNullable<\n  Awaited<ReturnType<typeof generateReframedVideo>>\n>;\nexport type TranscribeResult = NonNullable<Awaited<ReturnType<typeof transcribe>>>;\nexport type DubResult = NonNullable<Awaited<ReturnType<typeof dub>>>;\nexport type AvatarsResult = NonNullable<Awaited<ReturnType<typeof avatars>>>;\nexport type GenerateReframedVideoV2Result = NonNullable<\n  Awaited<ReturnType<typeof generateReframedVideoV2>>\n>;\nexport type JobResultV2Result = NonNullable<Awaited<ReturnType<typeof jobResultV2>>>;\nexport type GenerateAvatarResult = NonNullable<Awaited<ReturnType<typeof generateAvatar>>>;\n","/**\n * Generated by orval v7.14.0 🍺\n * Do not edit manually.\n * Firefly Services Audio and Video API\n * This RESTful API provides resources to use Firefly Services AI for audio and video generation and processing.\n * OpenAPI spec version: 1.0.0\n */\n/**\n * List of available voices.\n */\nexport interface SuccessfulVoicesResponse {\n  voices?: VoiceEntity[];\n}\n\n/**\n * The speaking style of the voice.\n */\nexport type VoiceEntityStyle = (typeof VoiceEntityStyle)[keyof typeof VoiceEntityStyle];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const VoiceEntityStyle = {\n  Casual: 'Casual',\n  Excited: 'Excited',\n} as const;\n\n/**\n * This determines if the specific voice ID is available for use. Deprecated voices will have an Inactive status.\n */\nexport type VoiceEntityStatus = (typeof VoiceEntityStatus)[keyof typeof VoiceEntityStatus];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const VoiceEntityStatus = {\n  Active: 'Active',\n  Inactive: 'Inactive',\n} as const;\n\n/**\n * This is a field for any additional properties for the voice.\n */\nexport type VoiceEntityExtendedPropertyMap = { [key: string]: unknown };\n\n/**\n * Details of Voice Entity.\n */\nexport interface VoiceEntity {\n  /** The unique ID for the voice. */\n  voiceId?: string;\n  /** The displayed name for the voice. */\n  displayName?: string;\n  /** The gender of the voice. */\n  gender?: string;\n  /** The speaking style of the voice. */\n  style?: VoiceEntityStyle;\n  /** Not applicable at this time. */\n  voiceType?: string;\n  /** This determines if the specific voice ID is available for use. Deprecated voices will have an Inactive status. */\n  status?: VoiceEntityStatus;\n  /** This is a field for any additional properties for the voice. */\n  extendedPropertyMap?: VoiceEntityExtendedPropertyMap;\n  /** The speed of speaking, in words per minute. */\n  wordsPerMinute?: string;\n  /** Not applicable at this time. */\n  rolePlayList?: string[];\n  /** A pre-signed URL for downloading the sample audio. */\n  sampleURL?: string;\n}\n\n/**\n * List of available avatars.\n */\nexport interface SuccessfulAvatarsResponse {\n  avatars?: AvatarEntity[];\n}\n\n/**\n * The clothing style worn by the avatar.\n */\nexport type AvatarEntityClothingStyle =\n  (typeof AvatarEntityClothingStyle)[keyof typeof AvatarEntityClothingStyle];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AvatarEntityClothingStyle = {\n  Casual: 'Casual',\n  Formal: 'Formal',\n  Professional: 'Professional',\n} as const;\n\n/**\n * The intended age bracket of the avatar.\n */\nexport type AvatarEntityAgeGroup = (typeof AvatarEntityAgeGroup)[keyof typeof AvatarEntityAgeGroup];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AvatarEntityAgeGroup = {\n  Young_Adult: 'Young Adult',\n  Middle_Aged: 'Middle Aged',\n  Senior: 'Senior',\n} as const;\n\n/**\n * This determines if the specific avatar ID is available for use. Deprecated avatars will have an Inactive status.\n */\nexport type AvatarEntityStatus = (typeof AvatarEntityStatus)[keyof typeof AvatarEntityStatus];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AvatarEntityStatus = {\n  Active: 'Active',\n  Inactive: 'Inactive',\n} as const;\n\nexport type AvatarEntityExtendedPropertyMapAspectRatio = {\n  x?: number;\n  y?: number;\n};\n\nexport type AvatarEntityExtendedPropertyMapResolution = {\n  width?: number;\n  height?: number;\n};\n\n/**\n * This is a field for any additional properties for the avatar.\n */\nexport type AvatarEntityExtendedPropertyMap = {\n  aspectRatio?: AvatarEntityExtendedPropertyMapAspectRatio;\n  resolution?: AvatarEntityExtendedPropertyMapResolution;\n};\n\nexport type AvatarEntityThumbnailUrls = {\n  /** A pre-signed URL for downloading the high-resolution avatar thumbnail. */\n  hd?: string;\n  /** A pre-signed URL for downloading the low-resolution avatar thumbnail. */\n  lowRes?: string;\n};\n\nexport type AvatarEntitySampleVideo = {\n  /** A pre-signed URL for downloading avatar sample video in WEBM format. */\n  webm?: string;\n  /** A pre-signed URL for downloading avatar sample video in MP4 format. */\n  mp4?: string;\n};\n\n/**\n * Details of the avatar entity.\n */\nexport interface AvatarEntity {\n  /** The unique ID for the avatar. */\n  avatarId?: string;\n  /** The displayed name for the avatar. */\n  displayName?: string;\n  /** The gender of the avatar. */\n  gender?: string;\n  /** The clothing style worn by the avatar. */\n  clothingStyle?: AvatarEntityClothingStyle;\n  /** The intended age bracket of the avatar. */\n  ageGroup?: AvatarEntityAgeGroup;\n  /** The ethnicity of the avatar. */\n  ethnicity?: string;\n  /** This property is used when the avatar wears a professional or region-specific costume (like Nurse, Doctor, Emergency Worker, Retail Worker, etc.). */\n  style?: string;\n  /** This determines if the specific avatar ID is available for use. Deprecated avatars will have an Inactive status. */\n  status?: AvatarEntityStatus;\n  /** This is a field for any additional properties for the avatar. */\n  extendedPropertyMap?: AvatarEntityExtendedPropertyMap;\n  thumbnailUrls?: AvatarEntityThumbnailUrls;\n  /** The unique ID for the voice. */\n  voiceId?: string;\n  sampleVideo?: AvatarEntitySampleVideo;\n}\n\n/**\n * The language code for the supported language desired in the result.\n */\nexport type SupportedLanguageCode =\n  (typeof SupportedLanguageCode)[keyof typeof SupportedLanguageCode];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const SupportedLanguageCode = {\n  'en-US': 'en-US',\n  'es-ES': 'es-ES',\n  'de-DE': 'de-DE',\n  'fr-FR': 'fr-FR',\n  'da-DK': 'da-DK',\n  'en-GB': 'en-GB',\n  'en-IN': 'en-IN',\n  'es-419': 'es-419',\n  'es-AR': 'es-AR',\n  'fr-CA': 'fr-CA',\n  'hi-IN': 'hi-IN',\n  'it-IT': 'it-IT',\n  'ja-JP': 'ja-JP',\n  'ko-KR': 'ko-KR',\n  'nb-NO': 'nb-NO',\n  'pt-BR': 'pt-BR',\n  'pt-PT': 'pt-PT',\n  'nl-NL': 'nl-NL',\n  'zh-CN': 'zh-CN',\n  'sv-SE': 'sv-SE',\n} as const;\n\n/**\n * The supported audio format for output.\n */\nexport type SupportedAudioOutputAudioFormat =\n  (typeof SupportedAudioOutputAudioFormat)[keyof typeof SupportedAudioOutputAudioFormat];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const SupportedAudioOutputAudioFormat = {\n  'audio/wav': 'audio/wav',\n} as const;\n\n/**\n * The supported video format for background video for Avatar.\n */\nexport type SupportedOutputVideoFormat =\n  (typeof SupportedOutputVideoFormat)[keyof typeof SupportedOutputVideoFormat];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const SupportedOutputVideoFormat = {\n  'video/mp4': 'video/mp4',\n} as const;\n\n/**\n * Supported background type for output Avatar video.\n */\nexport type SupportedBackgroundType =\n  (typeof SupportedBackgroundType)[keyof typeof SupportedBackgroundType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const SupportedBackgroundType = {\n  color: 'color',\n  video: 'video',\n  image: 'image',\n} as const;\n\nexport type TTSRequest = GenerateSpeechUsingPlainText;\n\n/**\n * The format of the text resource.\n */\nexport type GenerateSpeechUsingPlainTextScriptMediaType =\n  (typeof GenerateSpeechUsingPlainTextScriptMediaType)[keyof typeof GenerateSpeechUsingPlainTextScriptMediaType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const GenerateSpeechUsingPlainTextScriptMediaType = {\n  'text/plain': 'text/plain',\n} as const;\n\nexport type GenerateSpeechUsingPlainTextScript =\n  | (TextSource & {\n      localeCode: SupportedLanguageCode;\n      /** The format of the text resource. */\n      mediaType: GenerateSpeechUsingPlainTextScriptMediaType;\n    })\n  | (URLSource & {\n      localeCode: SupportedLanguageCode;\n      /** The format of the text resource. */\n      mediaType: GenerateSpeechUsingPlainTextScriptMediaType;\n    });\n\nexport type GenerateSpeechUsingPlainTextOutput = {\n  mediaType: SupportedAudioOutputAudioFormat;\n};\n\nexport interface GenerateSpeechUsingPlainText {\n  script: GenerateSpeechUsingPlainTextScript;\n  /** ID of the voice to use from the catalog of voices. */\n  voiceId: string;\n  output: GenerateSpeechUsingPlainTextOutput;\n}\n\nexport type AvatarRequest = GenerateAvatarUsingPlainText | GenerateAvatarUsingAudioFile;\n\n/**\n * The format of the text resource.\n */\nexport type GenerateAvatarUsingPlainTextScriptMediaType =\n  (typeof GenerateAvatarUsingPlainTextScriptMediaType)[keyof typeof GenerateAvatarUsingPlainTextScriptMediaType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const GenerateAvatarUsingPlainTextScriptMediaType = {\n  'text/plain': 'text/plain',\n} as const;\n\nexport type GenerateAvatarUsingPlainTextScript =\n  | (TextSource & {\n      localeCode: SupportedLanguageCode;\n      /** The format of the text resource. */\n      mediaType: GenerateAvatarUsingPlainTextScriptMediaType;\n    })\n  | (URLSource & {\n      localeCode: SupportedLanguageCode;\n      /** The format of the text resource. */\n      mediaType: GenerateAvatarUsingPlainTextScriptMediaType;\n    });\n\nexport interface GenerateAvatarUsingPlainText {\n  script: GenerateAvatarUsingPlainTextScript;\n  /** ID of the voice to use from the catalog of voices. */\n  voiceId: string;\n  /** ID of the avatar to use from the catalog of avatars. */\n  avatarId: string;\n  output: AvatarOutputObject;\n}\n\nexport type GenerateAvatarUsingAudioFileAudioMediaType =\n  (typeof GenerateAvatarUsingAudioFileAudioMediaType)[keyof typeof GenerateAvatarUsingAudioFileAudioMediaType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const GenerateAvatarUsingAudioFileAudioMediaType = {\n  'audio/wav': 'audio/wav',\n} as const;\n\nexport type GenerateAvatarUsingAudioFileAudio = {\n  source: URLObject;\n  mediaType: GenerateAvatarUsingAudioFileAudioMediaType;\n  localeCode: SupportedLanguageCode;\n};\n\nexport interface GenerateAvatarUsingAudioFile {\n  audio: GenerateAvatarUsingAudioFileAudio;\n  /** ID of the avatar to use from the catalog of avatars. */\n  avatarId: string;\n  output: AvatarOutputObject;\n}\n\n/**\n * Details of the source including a pre-signed URL. See the [list of allowed domains for storage](https://developer.adobe.com/audio-video-firefly-services/getting-started/storage-solutions/).\n */\nexport type URLSourceSource = {\n  /** The pre-signed URL pointing to the resource to be used for avatar/speech generation. */\n  url?: string;\n};\n\nexport interface URLSource {\n  /** Details of the source including a pre-signed URL. See the [list of allowed domains for storage](https://developer.adobe.com/audio-video-firefly-services/getting-started/storage-solutions/). */\n  source?: URLSourceSource;\n}\n\n/**\n * URL object containing a pre-signed URL. See the [list of allowed domains for storage](https://developer.adobe.com/audio-video-firefly-services/getting-started/storage-solutions/).\n */\nexport interface URLObject {\n  /** The pre-signed URL pointing to the resource to be used for avatar/speech generation. */\n  url?: string;\n}\n\nexport type AvatarOutputObjectBackground =\n  | (OutputColor & {\n      type?: SupportedBackgroundType;\n    })\n  | (URLSource & {\n      type?: SupportedBackgroundType;\n    });\n\nexport type AvatarOutputObjectResolution = {\n  width?: string;\n  height?: string;\n};\n\n/**\n * Output configuration for avatar video generation.\n */\nexport interface AvatarOutputObject {\n  mediaType: SupportedOutputVideoFormat;\n  background?: AvatarOutputObjectBackground;\n  resolution?: AvatarOutputObjectResolution;\n}\n\n/**\n * Details of the text resource.\n */\nexport type TextSource = string;\n\n/**\n * Color specification for avatar background.\n */\nexport type OutputColor = string;\n\n/**\n * Response returned when a job is successfully submitted.\n */\nexport interface SubmitAPIResponse {\n  jobId?: string;\n  statusUrl?: string;\n}\n\n/**\n * Response object for job status queries.\n */\nexport type StatusAPIResponse =\n  | StatusAPIInprogressResponse\n  | StatusAPICompletedResponse\n  | StatusAPIFailedResponse\n  | JobStatus;\n\n/**\n * Status of the job.\n */\nexport type StatusAPIResponseStatus =\n  (typeof StatusAPIResponseStatus)[keyof typeof StatusAPIResponseStatus];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const StatusAPIResponseStatus = {\n  pending: 'pending',\n  running: 'running',\n  failed: 'failed',\n  succeeded: 'succeeded',\n} as const;\n\nexport interface StatusAPIInprogressResponse {\n  jobId?: string;\n  status?: StatusAPIResponseStatus;\n}\n\nexport type StatusAPICompletedResponseOutput = {\n  destination?: Destination;\n};\n\nexport interface StatusAPICompletedResponse {\n  jobId?: string;\n  status?: StatusAPIResponseStatus;\n  output?: StatusAPICompletedResponseOutput;\n}\n\n/**\n * Response object for failed jobs.\n */\nexport interface StatusAPIFailedResponse {\n  status?: StatusAPIResponseStatus;\n  jobId?: string;\n  error_code?: string;\n  message?: string;\n}\n\n/**\n * Generic error response object.\n */\nexport interface FailedResponse {\n  error_code?: string;\n  message?: string;\n}\n\nexport interface ErrorResponse {\n  /** The error code returned with the response. */\n  error_code: string;\n  /** The error message returned with the response. */\n  message: string;\n  /** The error message ID returned with the response. */\n  messageId?: string;\n}\n\n/**\n * Contains metadata about the source of the input template.\n */\nexport type TemplateDescribeRequestSource = {\n  /** A pre-signed URL pointing to the input template file. */\n  url: string;\n};\n\nexport interface TemplateDescribeRequest {\n  /** Contains metadata about the source of the input template. */\n  source: TemplateDescribeRequestSource;\n}\n\nexport interface TemplateDescribeResponse {\n  /** Unique identifier for the describe job. */\n  jobId: string;\n  /** URL to poll for the status of the describe job. */\n  statusUrl: string;\n}\n\n/**\n * Maximum frames per second as a fraction.\n */\nexport type PresetItemMaxFps = {\n  /** Frames-per-second numerator. */\n  numerator: number;\n  /** Frames-per-second denominator. */\n  denominator: number;\n};\n\nexport interface PresetItem {\n  /** Unique identifier for the preset. */\n  presetId: string;\n  /** Human-readable label for the preset. */\n  label: string;\n  /** MIME type of the output media (e.g., video/mp4). */\n  mediaType: string;\n  /** Video codec used (e.g., H.264). */\n  codec: string;\n  /** Codec profile (e.g., high). */\n  profile?: string;\n  /** Maximum frames per second as a fraction. */\n  maxFps: PresetItemMaxFps;\n  /** Bitrate mode (e.g., vbr, cbr). */\n  bitrateMode: string;\n  /** Target bitrate in kilobits per second. */\n  targetBitrateInKbps?: number;\n  /** Maximum bitrate in kilobits per second. */\n  maxBitrateInKbps?: number;\n  /** Whether the preset supports alpha channel. */\n  alpha: boolean;\n  /** Primary use case for this preset. */\n  primaryUsage: string;\n}\n\nexport interface PresetsResponse {\n  items: PresetItem[];\n}\n\n/**\n * Contains metadata about the source of the input template.\n */\nexport type TemplateRenderRequestSource = {\n  /** A pre-signed URL pointing to the input template file. */\n  url: string;\n};\n\nexport type TemplateRenderRequestFontsItemSource = {\n  /** Pre-signed URL for the font file (.ttf/.otf). */\n  url: string;\n};\n\nexport type TemplateRenderRequestFontsItem = {\n  /** PostScript name of the font. */\n  name: string;\n  source: TemplateRenderRequestFontsItemSource;\n};\n\n/**\n * How to handle missing fonts. 'fail' will cause the render to fail; 'use_default' will use Premiere Pro fallback behavior.\n */\nexport type TemplateRenderRequestConfigHandleMissingFonts =\n  (typeof TemplateRenderRequestConfigHandleMissingFonts)[keyof typeof TemplateRenderRequestConfigHandleMissingFonts];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const TemplateRenderRequestConfigHandleMissingFonts = {\n  fail: 'fail',\n  use_default: 'use_default',\n} as const;\n\n/**\n * Configuration options for the render request.\n */\nexport type TemplateRenderRequestConfig = {\n  /** How to handle missing fonts. 'fail' will cause the render to fail; 'use_default' will use Premiere Pro fallback behavior. */\n  handleMissingFonts?: TemplateRenderRequestConfigHandleMissingFonts;\n};\n\nexport type TemplateRenderRequestAssetsItemSource = {\n  /** Pre-signed URL for the image, video, or audio asset. */\n  url: string;\n};\n\nexport type TemplateRenderRequestAssetsItem = {\n  source: TemplateRenderRequestAssetsItemSource;\n};\n\nexport type TemplateRenderRequestPresetsItemSource = {\n  /** ID of a built-in preset from the presets endpoint. */\n  presetId?: string;\n  /** Pre-signed URL for a custom Encoder preset file. */\n  url?: string;\n};\n\nexport type TemplateRenderRequestPresetsItem = {\n  source: TemplateRenderRequestPresetsItemSource;\n};\n\n/**\n * Scaling behavior for media controls.\n */\nexport type TemplateRenderRequestVariationsItemVariablesItemScale =\n  (typeof TemplateRenderRequestVariationsItemVariablesItemScale)[keyof typeof TemplateRenderRequestVariationsItemVariablesItemScale];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const TemplateRenderRequestVariationsItemVariablesItemScale = {\n  no_scale: 'no_scale',\n  fit_to_frame: 'fit_to_frame',\n  stretch_to_fill: 'stretch_to_fill',\n  fill_frame: 'fill_frame',\n} as const;\n\n/**\n * Audio preference for audio controls.\n */\nexport type TemplateRenderRequestVariationsItemVariablesItemAudioPreference =\n  (typeof TemplateRenderRequestVariationsItemVariablesItemAudioPreference)[keyof typeof TemplateRenderRequestVariationsItemVariablesItemAudioPreference];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const TemplateRenderRequestVariationsItemVariablesItemAudioPreference = {\n  replace: 'replace',\n  mix: 'mix',\n} as const;\n\nexport type TemplateRenderRequestVariationsItemVariablesItem = {\n  /** Unique identifier for the template variable (from describe response). */\n  variableId: string;\n  /** Override for checkbox controls. */\n  selectedCheckboxValue?: boolean;\n  /** Override for dropdown controls. */\n  selectedDropdownValue?: string;\n  /** Override for slider controls. */\n  selectedSliderValue?: number;\n  /** Override for text controls. */\n  text?: string;\n  /** PostScript font name for text controls. */\n  fontName?: string;\n  /** Index into the assets array for media or audio controls. */\n  assetIndex?: number;\n  /** Scaling behavior for media controls. */\n  scale?: TemplateRenderRequestVariationsItemVariablesItemScale;\n  /** Audio preference for audio controls. */\n  audioPreference?: TemplateRenderRequestVariationsItemVariablesItemAudioPreference;\n};\n\nexport type TemplateRenderRequestVariationsItem = {\n  /** Variable overrides for this variation. Each object targets one template variable by variableId and supplies the override value. */\n  variables: TemplateRenderRequestVariationsItemVariablesItem[];\n};\n\nexport type TemplateRenderRequestOutputsItem = {\n  /** Zero-based index of the variation to render. */\n  variationIndex: number;\n  /** Zero-based index of the preset in the presets array. */\n  presetIndex: number;\n  /** Optional custom file name for the output. */\n  fileName?: string;\n};\n\nexport interface TemplateRenderRequest {\n  /** Contains metadata about the source of the input template. */\n  source: TemplateRenderRequestSource;\n  /** Array of fonts to be used in the template. */\n  fonts?: TemplateRenderRequestFontsItem[];\n  /** Configuration options for the render request. */\n  config?: TemplateRenderRequestConfig;\n  /** Array of image, video, or audio assets referenced by variations via assetIndex. */\n  assets?: TemplateRenderRequestAssetsItem[];\n  /** Array of export presets. Each item is either a built-in preset (by presetId) or a custom preset (by URL). Outputs reference presets by presetIndex. */\n  presets?: TemplateRenderRequestPresetsItem[];\n  /**\n   * List of variations. Each variation contains variable overrides applied to the template.\n   * @minItems 1\n   */\n  variations: TemplateRenderRequestVariationsItem[];\n  /** Defines which variation and preset combinations to render and optional output file names. */\n  outputs?: TemplateRenderRequestOutputsItem[];\n}\n\nexport interface TemplateRenderResponse {\n  /** Unique identifier for the render job. */\n  jobId: string;\n  /** URL to poll for the status of the rendering job. */\n  statusUrl: string;\n}\n\n/**\n * Current status of the job.\n */\nexport type JobStatusStatus = (typeof JobStatusStatus)[keyof typeof JobStatusStatus];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const JobStatusStatus = {\n  not_started: 'not_started',\n  running: 'running',\n  succeeded: 'succeeded',\n  failed: 'failed',\n  partially_succeeded: 'partially_succeeded',\n} as const;\n\nexport type JobStatusOutputsItemDestination = {\n  /** URL from which the rendered video can be downloaded. */\n  url: string;\n};\n\nexport type JobStatusOutputsItem = {\n  /** Zero-based index of the variation that was rendered. */\n  variationIndex: number;\n  /** Zero-based index of the preset that was used for rendering. */\n  presetIndex: number;\n  destination: JobStatusOutputsItemDestination;\n};\n\nexport type JobStatusErrorsItemError = {\n  /** Error code for the failure. */\n  error_code: string;\n  /** Error message describing the failure. */\n  message: string;\n};\n\nexport type JobStatusErrorsItem = {\n  /** Zero-based index of the variation that failed. */\n  variationIndex: number;\n  /** Zero-based index of the preset that was used for the failed variation. */\n  presetIndex: number;\n  error: JobStatusErrorsItemError;\n};\n\nexport type JobStatusOutputFontsItem = {\n  /** PostScript name of the font. */\n  name: string;\n  /** Whether the font needs to be uploaded in the render request. */\n  uploadRequired?: boolean;\n};\n\n/**\n * Type of the element.\n */\nexport type JobStatusOutputElementsItemType =\n  (typeof JobStatusOutputElementsItemType)[keyof typeof JobStatusOutputElementsItemType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const JobStatusOutputElementsItemType = {\n  mogrt: 'mogrt',\n} as const;\n\n/**\n * Type of the control.\n */\nexport type JobStatusOutputElementsItemControlsItemType =\n  (typeof JobStatusOutputElementsItemControlsItemType)[keyof typeof JobStatusOutputElementsItemControlsItemType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const JobStatusOutputElementsItemControlsItemType = {\n  text: 'text',\n  media: 'media',\n  dropdown: 'dropdown',\n  checkbox: 'checkbox',\n  slider: 'slider',\n  audio: 'audio',\n  comment: 'comment',\n} as const;\n\n/**\n * Default or current values for the control (e.g., text, fontName, selectedCheckboxValue, selectedDropdownValue, selectedSliderValue, scale).\n */\nexport type JobStatusOutputElementsItemControlsItemDefaultData = { [key: string]: unknown };\n\n/**\n * Data associated with the control.\n */\nexport type JobStatusOutputElementsItemControlsItemData = { [key: string]: unknown };\n\n/**\n * Minimum and maximum values for slider controls.\n */\nexport type JobStatusOutputElementsItemControlsItemRange = {\n  minimum?: number;\n  maximum?: number;\n};\n\n/**\n * Dimensions for media controls.\n */\nexport type JobStatusOutputElementsItemControlsItemSize = {\n  width?: number;\n  height?: number;\n};\n\nexport type JobStatusOutputElementsItemControlsItem = {\n  /** Unique identifier for the template variable. */\n  variableId?: string;\n  /** Unique identifier for the control. */\n  id?: string;\n  /** Human-readable label for the control. */\n  label?: string;\n  /** Type of the control. */\n  type?: JobStatusOutputElementsItemControlsItemType;\n  /** Default or current values for the control (e.g., text, fontName, selectedCheckboxValue, selectedDropdownValue, selectedSliderValue, scale). */\n  defaultData?: JobStatusOutputElementsItemControlsItemDefaultData;\n  /** Data associated with the control. */\n  data?: JobStatusOutputElementsItemControlsItemData;\n  /** Available options (object for dropdown; array for checkbox). */\n  options?: unknown;\n  /** Minimum and maximum values for slider controls. */\n  range?: JobStatusOutputElementsItemControlsItemRange;\n  /** Dimensions for media controls. */\n  size?: JobStatusOutputElementsItemControlsItemSize;\n  /** Possible scale values for media controls. */\n  possibleScaleValues?: string[];\n  /** Duration in seconds for audio controls. */\n  durationInSeconds?: number;\n  /** Possible audio preferences (e.g., replace, mix) for audio controls. */\n  possibleAudioPreferences?: string[];\n  /** Comment text for comment controls. */\n  text?: string;\n};\n\nexport type JobStatusOutputElementsItem = {\n  /** Unique identifier for the element. */\n  id?: string;\n  /** Type of the element. */\n  type: JobStatusOutputElementsItemType;\n  /** Array of controls from the template. */\n  controls: JobStatusOutputElementsItemControlsItem[];\n};\n\n/**\n * Output for describe API jobs.\n */\nexport type JobStatusOutput = {\n  /** Array of fonts from the template. */\n  fonts?: JobStatusOutputFontsItem[];\n  /** Array of elements from the template. */\n  elements?: JobStatusOutputElementsItem[];\n};\n\nexport interface JobStatus {\n  /** ID of the render job. */\n  jobId: string;\n  /** Current status of the job. */\n  status: JobStatusStatus;\n  /** Error message when job status is failed. */\n  message?: string;\n  /** Percentage of job completed, as a string. */\n  percentCompleted?: string;\n  /** Array of output files with destination URLs, keyed by variation and preset indices. */\n  outputs?: JobStatusOutputsItem[];\n  /** Array of errors for failed variations (only present when status is partially_succeeded). */\n  errors?: JobStatusErrorsItem[];\n  /** Output for describe API jobs. */\n  output?: JobStatusOutput;\n}\n\n/**\n * The media type of the overlay.\n */\nexport type OverlayMediaType = (typeof OverlayMediaType)[keyof typeof OverlayMediaType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const OverlayMediaType = {\n  'image/gif': 'image/gif',\n  'image/png': 'image/png',\n  'image/jpeg': 'image/jpeg',\n} as const;\n\n/**\n * Details of the source including a pre-signed URL. See the [list of allowed domains for storage](https://developer.adobe.com/audio-video-firefly-services/getting-started/storage-solutions/).\n */\nexport type OverlaySource = {\n  /** The pre-signed URL pointing to the overlay source. */\n  url: string;\n};\n\n/**\n * The scale of the overlay.\n */\nexport type OverlayScale = {\n  /** The width of the overlay. */\n  width: number;\n  /** The height of the overlay. */\n  height: number;\n};\n\n/**\n * The anchor point of the overlay.\n */\nexport type OverlayPositionAnchorPoint =\n  (typeof OverlayPositionAnchorPoint)[keyof typeof OverlayPositionAnchorPoint];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const OverlayPositionAnchorPoint = {\n  top_left: 'top_left',\n  top_right: 'top_right',\n  bottom_left: 'bottom_left',\n  bottom_right: 'bottom_right',\n  center: 'center',\n} as const;\n\n/**\n * The position of the overlay.\n */\nexport type OverlayPosition = {\n  /** The anchor point of the overlay. */\n  anchorPoint: OverlayPositionAnchorPoint;\n  /** The X offset of the overlay from the anchor point. */\n  offsetX: number;\n  /** The Y offset of the overlay from the anchor point. */\n  offsetY: number;\n};\n\n/**\n * The repeat behavior of the overlay.\n */\nexport type OverlayRepeat = (typeof OverlayRepeat)[keyof typeof OverlayRepeat];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const OverlayRepeat = {\n  loop: 'loop',\n  once: 'once',\n} as const;\n\n/**\n * Configuration for an overlay in the reframed video.\n */\nexport interface Overlay {\n  /** The media type of the overlay. */\n  mediaType: OverlayMediaType;\n  /** Details of the source including a pre-signed URL. See the [list of allowed domains for storage](https://developer.adobe.com/audio-video-firefly-services/getting-started/storage-solutions/). */\n  source: OverlaySource;\n  /** The start time of the overlay in the video. */\n  startTime: string;\n  /** The duration of the overlay in the video. */\n  duration: string;\n  /** The scale of the overlay. */\n  scale: OverlayScale;\n  /** The position of the overlay. */\n  position: OverlayPosition;\n  /** The repeat behavior of the overlay. */\n  repeat?: OverlayRepeat;\n}\n\n/**\n * Error response for the reframed video job.\n */\nexport interface GenerateReframedVideoJobErrorBody {\n  /** A code representing the specific error type. */\n  error_code: string;\n  /** A description of the error that occurred. */\n  message: string;\n}\n\n/**\n * Transcribe request body.\n */\nexport type TranscribeRequest =\n  | (TranscribeAudioInput & {\n      /** This determines the language used in the processed output. See the usage notes for more about [the supported languages](https://developer.adobe.com/audio-video-firefly-services/getting-started/usage/#language-support). */\n      targetLocaleCodes?: TargetLocaleCodes[];\n      /** Details to generate captions. */\n      captions?: Captions;\n    })\n  | (TranscribeVideoInput & {\n      /** This determines the language used in the processed output. See the usage notes for more about [the supported languages](https://developer.adobe.com/audio-video-firefly-services/getting-started/usage/#language-support). */\n      targetLocaleCodes?: TargetLocaleCodes[];\n      /** Details to generate captions. */\n      captions?: Captions;\n    });\n\n/**\n * The request body for transcribing audio.\n */\nexport interface TranscribeAudioInput {\n  audio: AudioInput;\n}\n\n/**\n * The request body for transcribing video.\n */\nexport interface TranscribeVideoInput {\n  video: VideoInput;\n}\n\nexport interface Captions {\n  /** Accepted values: ['SRT'] */\n  targetFormats?: TargetCaptionFormats[];\n}\n\n/**\n * Source details including a pre-signed URL for accessing the input media. See the [list of allowed domains for storage](https://developer.adobe.com/audio-video-firefly-services/getting-started/storage-solutions/).\n */\nexport interface Source {\n  /** The pre-signed URL pointing to the input source. */\n  url: string;\n}\n\n/**\n * Destination details including a pre-signed URL for the output media.\n */\nexport interface Destination {\n  /** The pre-signed URL pointing to the output destination. */\n  url: string;\n}\n\n/**\n * The dub request body.\n */\nexport type DubRequest = DubAudioRequest | DubVideoRequest;\n\n/**\n * The audio dub request body.\n */\nexport interface DubAudioRequest {\n  /** This determines the language used in the processed output. See the usage notes for more about [the supported languages](https://developer.adobe.com/audio-video-firefly-services/getting-started/usage/#language-support). */\n  targetLocaleCodes?: TargetLocaleCodes[];\n  transcripts?: TranscriptInput[];\n  audio: AudioInput;\n}\n\n/**\n * The video dub request body.\n */\nexport interface DubVideoRequest {\n  /** This determines the language used in the processed output. See the usage notes for more about [the supported languages](https://developer.adobe.com/audio-video-firefly-services/getting-started/usage/#language-support). */\n  targetLocaleCodes?: TargetLocaleCodes[];\n  transcripts?: TranscriptInput[];\n  video: VideoInput;\n  /** If `true`, a high-quality composited lip sync will be used in the video output. */\n  lipSync?: boolean;\n}\n\n/**\n * Job status response.\n */\nexport interface JobStatusLinkResponse {\n  /** URL to download the results of the job. */\n  statusUrl: string;\n  /** The job ID. */\n  jobId: string;\n}\n\n/**\n * Status of the job.\n */\nexport type FireflyJobApiResponseStatus =\n  (typeof FireflyJobApiResponseStatus)[keyof typeof FireflyJobApiResponseStatus];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const FireflyJobApiResponseStatus = {\n  pending: 'pending',\n  running: 'running',\n  failed: 'failed',\n  succeeded: 'succeeded',\n} as const;\n\n/**\n * Firefly job response.\n */\nexport type FireflyJobResponse = FireflyJobApiResponse | FireflyJobErrorResponse;\n\nexport type FireflyJobApiResponseOutputsItem = DubJobResponse | TranscribeOutput;\n\n/**\n * Firefly job success response.\n */\nexport interface FireflyJobApiResponse {\n  status: FireflyJobApiResponseStatus;\n  /** Associated job ID. */\n  jobId: string;\n  /** Job response details. */\n  outputs?: FireflyJobApiResponseOutputsItem[];\n}\n\n/**\n * Firefly job error response.\n */\nexport interface FireflyJobErrorResponse {\n  status: FireflyJobApiResponseStatus;\n  /** Associated job ID. */\n  jobId: string;\n  /** The error message. */\n  message?: string;\n  /** Associated error code. */\n  error_code?: string;\n}\n\n/**\n * The error response object.\n */\nexport interface ErrorBody {\n  /** The error message. */\n  message: string;\n  /** Associated error code. */\n  error_code: string;\n}\n\nexport type TranscribeOutputItem = {\n  destination?: Destination;\n  captions?: CaptionOutput;\n  localeCode?: TargetLocaleCodes;\n};\n\n/**\n * Transcribe success response\n */\nexport type TranscribeOutput = TranscribeOutputItem[];\n\nexport type CaptionOutputItem = {\n  destination?: Destination;\n  /** Format of the caption */\n  format?: TargetCaptionFormats;\n};\n\n/**\n * Captions output\n */\nexport type CaptionOutput = CaptionOutputItem[];\n\n/**\n * Dubbing success response\n */\nexport type DubJobResponse = DubSuccess | DubPartialFailure;\n\n/**\n * Dubbing success\n */\nexport interface DubSuccess {\n  audioOutput?: AudioOutput;\n  videoOutput?: VideoOutput;\n  transcriptOutput?: TranscribeOutput;\n}\n\n/**\n * Media type of the audio output.\n */\nexport type AudioOutputMediaType = (typeof AudioOutputMediaType)[keyof typeof AudioOutputMediaType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AudioOutputMediaType = {\n  'audio/wav': 'audio/wav',\n} as const;\n\n/**\n * Media type of the video output.\n */\nexport type VideoOutputMediaType = (typeof VideoOutputMediaType)[keyof typeof VideoOutputMediaType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const VideoOutputMediaType = {\n  'video/mp4': 'video/mp4',\n  'video/mov': 'video/mov',\n} as const;\n\n/**\n * Audio output in dubbing response.\n */\nexport interface AudioOutput {\n  mediaType?: AudioOutputMediaType;\n  destination?: Destination;\n}\n\n/**\n * Video output in dubbing response.\n */\nexport interface VideoOutput {\n  mediaType?: VideoOutputMediaType;\n  destination?: Destination;\n}\n\n/**\n * Dubbing failure for specific language.\n */\nexport interface DubPartialFailure {\n  error?: ErrorBody;\n}\n\n/**\n * Transcript input details for a transcribe request.\n */\nexport interface TranscriptInput {\n  /** The pre-signed URL to download the translated/edited transcripts. See the [list of allowed domains for storage](https://developer.adobe.com/audio-video-firefly-services/getting-started/storage-solutions/). */\n  source: Source;\n}\n\n/**\n * Locale code for dubbing target.\n */\nexport type TargetLocaleCodes = (typeof TargetLocaleCodes)[keyof typeof TargetLocaleCodes];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const TargetLocaleCodes = {\n  'da-DK': 'da-DK',\n  'en-IN': 'en-IN',\n  'en-GB': 'en-GB',\n  'es-AR': 'es-AR',\n  'es-419': 'es-419',\n  'fr-CA': 'fr-CA',\n  'hi-IN': 'hi-IN',\n  'ja-JP': 'ja-JP',\n  'ko-KR': 'ko-KR',\n  'nb-NO': 'nb-NO',\n  'nl-NL': 'nl-NL',\n  'pt-BR': 'pt-BR',\n  'sv-SE': 'sv-SE',\n  'zh-CN': 'zh-CN',\n  'en-US': 'en-US',\n  'es-ES': 'es-ES',\n  'de-DE': 'de-DE',\n  'fr-FR': 'fr-FR',\n  'it-IT': 'it-IT',\n  'pt-PT': 'pt-PT',\n} as const;\n\n/**\n * Target caption format.\n */\nexport type TargetCaptionFormats = (typeof TargetCaptionFormats)[keyof typeof TargetCaptionFormats];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const TargetCaptionFormats = {\n  SRT: 'SRT',\n} as const;\n\n/**\n * The audio input details for a dub request.\n */\nexport interface AudioInput {\n  source?: Source;\n  mediaType: AudioInputMediaType;\n}\n\nexport type VideoInputMetadata = {\n  dialogTrackNumber?: number;\n};\n\n/**\n * The video input details for a dub request.\n */\nexport interface VideoInput {\n  source?: Source;\n  mediaType: VideoInputMediaType;\n  metadata?: VideoInputMetadata;\n}\n\n/**\n * Media type of the audio input.\n */\nexport type AudioInputMediaType = (typeof AudioInputMediaType)[keyof typeof AudioInputMediaType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AudioInputMediaType = {\n  'audio/mp3': 'audio/mp3',\n  'audio/wav': 'audio/wav',\n  'audio/mpeg': 'audio/mpeg',\n  'audio/x-m4a': 'audio/x-m4a',\n  'audio/aac': 'audio/aac',\n} as const;\n\n/**\n * Media type of the video input.\n */\nexport type VideoInputMediaType = (typeof VideoInputMediaType)[keyof typeof VideoInputMediaType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const VideoInputMediaType = {\n  'video/mp4': 'video/mp4',\n  'video/mov': 'video/mov',\n  'video/quicktime': 'video/quicktime',\n  'video/x-msvideo': 'video/x-msvideo',\n  'video/x-matroska': 'video/x-matroska',\n} as const;\n\n/**\n * Details of the source including a pre-signed URL. See the [list of allowed domains for storage](https://developer.adobe.com/audio-video-firefly-services/getting-started/storage-solutions/).\n */\nexport type VideoInputV2Source = {\n  /** The pre-signed URL pointing to the input source. */\n  url: string;\n};\n\n/**\n * Video input details for generate reframed video request.\n */\nexport interface VideoInputV2 {\n  /** Details of the source including a pre-signed URL. See the [list of allowed domains for storage](https://developer.adobe.com/audio-video-firefly-services/getting-started/storage-solutions/). */\n  source: VideoInputV2Source;\n}\n\n/**\n * Analysis configuration for the video processing.\n */\nexport interface AnalysisV2 {\n  /** Applies scene edit detection before reframing. */\n  sceneEditDetection?: boolean;\n  /**\n   * Array of focal point keyword identifiers for reframing. Up to 10 keywords are allowed. Keywords must be alphanumeric characters, spaces, hyphens, or underscores only, with a maximum of 1000 characters per keyword.\n   * @maxItems 10\n   */\n  focalPoints?: string[];\n}\n\n/**\n * Repeat behavior for GIF overlay (optional).\n */\nexport type OverlayV2Repeat = null | RepeatV2;\n\nexport interface OverlayV2 {\n  source?: Source;\n  /** Start time for the overlay in the format HH:MM:SS:FF. */\n  startTime?: string;\n  /** Duration of the overlay in the format HH:MM:SS:FF. */\n  duration?: string;\n  scale?: ScaleV2;\n  position?: PositionV2;\n  /** Repeat behavior for GIF overlay (optional). */\n  repeat?: OverlayV2Repeat;\n}\n\n/**\n * Anchor point for taking the position reference.\n */\nexport type PositionV2AnchorPoint =\n  (typeof PositionV2AnchorPoint)[keyof typeof PositionV2AnchorPoint];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const PositionV2AnchorPoint = {\n  top_left: 'top_left',\n  top_right: 'top_right',\n  bottom_left: 'bottom_left',\n  bottom_right: 'bottom_right',\n  center: 'center',\n} as const;\n\n/**\n * Horizontal offset for the anchor point.\n */\nexport type PositionV2OffsetX = number | null;\n\n/**\n * Vertical offset for the anchor point.\n */\nexport type PositionV2OffsetY = number | null;\n\n/**\n * Position configuration for overlay placement.\n */\nexport interface PositionV2 {\n  /** Anchor point for taking the position reference. */\n  anchorPoint?: PositionV2AnchorPoint;\n  /** Horizontal offset for the anchor point. */\n  offsetX?: PositionV2OffsetX;\n  /** Vertical offset for the anchor point. */\n  offsetY?: PositionV2OffsetY;\n}\n\n/**\n * Defines the repeat behavior of the overlay.\n */\nexport type RepeatV2 = (typeof RepeatV2)[keyof typeof RepeatV2];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const RepeatV2 = {\n  stop_on_last_frame: 'stop_on_last_frame',\n  loop: 'loop',\n  time_stretch: 'time_stretch',\n} as const;\n\n/**\n * Scale configuration for overlay dimensions.\n */\nexport interface ScaleV2 {\n  /** The width of the scaled overlay. */\n  width?: number;\n  /** The height of the scaled overlay. */\n  height?: number;\n}\n\n/**\n * Aspect ratio specification for video output.\n */\nexport interface AspectRatioV2 {\n  /** AspectRatio x ratio. */\n  x: number;\n  /** AspectRatio y ratio. */\n  y: number;\n}\n\n/**\n * Media format for the output video. If only the OTIO file is needed, set this as `none`.\n */\nexport type OutputFormatV2Media = (typeof OutputFormatV2Media)[keyof typeof OutputFormatV2Media];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const OutputFormatV2Media = {\n  none: 'none',\n  mp4: 'mp4',\n  mov: 'mov',\n  source: 'source',\n} as const;\n\n/**\n * Sidecar format for additional metadata.\n */\nexport type OutputFormatV2Sidecar =\n  (typeof OutputFormatV2Sidecar)[keyof typeof OutputFormatV2Sidecar];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const OutputFormatV2Sidecar = {\n  json: 'json',\n  otio: 'otio',\n} as const;\n\n/**\n * Output format configuration. A media property is mandatory when this format object is specified.\n */\nexport interface OutputFormatV2 {\n  /** Media format for the output video. If only the OTIO file is needed, set this as `none`. */\n  media: OutputFormatV2Media;\n  /** Sidecar format for additional metadata. */\n  sidecar: OutputFormatV2Sidecar;\n}\n\n/**\n * Configuration for composing elements on the video.\n */\nexport interface CompositionV2 {\n  /** List of overlays to be composed on the video. */\n  overlays?: OverlayV2[];\n}\n\nexport type StatusPathParameters = {\n  jobId: string;\n};\n/**\n * Details of the source including a pre-signed URL. See the [list of allowed domains for storage](https://developer.adobe.com/audio-video-firefly-services/getting-started/storage-solutions/).\n */\nexport type GenerateReframedVideoBodyVideoSource = {\n  /** The pre-signed URL pointing to the input source. */\n  url: string;\n};\n\n/**\n * Supported video media types.\n */\nexport type GenerateReframedVideoBodyVideoMediaType =\n  (typeof GenerateReframedVideoBodyVideoMediaType)[keyof typeof GenerateReframedVideoBodyVideoMediaType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const GenerateReframedVideoBodyVideoMediaType = {\n  'video/mp4': 'video/mp4',\n  'video/quicktime': 'video/quicktime',\n} as const;\n\n/**\n * Video input details.\n */\nexport type GenerateReframedVideoBodyVideo = {\n  /** Details of the source including a pre-signed URL. See the [list of allowed domains for storage](https://developer.adobe.com/audio-video-firefly-services/getting-started/storage-solutions/). */\n  source: GenerateReframedVideoBodyVideoSource;\n  /** Supported video media types. */\n  mediaType: GenerateReframedVideoBodyVideoMediaType;\n};\n\n/**\n * Configuration details for the generated reframed video.\n */\nexport type GenerateReframedVideoBodyOutputConfig = {\n  /** A list of aspect ratios for the output video. */\n  aspectRatios: string[];\n};\n\nexport type GenerateReframedVideoBody = {\n  /** Video input details. */\n  video: GenerateReframedVideoBodyVideo;\n  /** Apply Scene Edit Detection before reframing. */\n  sceneEditDetection?: boolean;\n  /** Configuration details for video overlays. */\n  overlays?: Overlay[];\n  /** Configuration details for the generated reframed video. */\n  outputConfig: GenerateReframedVideoBodyOutputConfig;\n};\n\n/**\n * Response indicating that the reframed video job has been successfully submitted.\n */\nexport type GenerateReframedVideo202 = {\n  /** The unique identifier for the job. */\n  jobId: string;\n  /** The URL to monitor the status of the job. */\n  statusUrl: string;\n};\n\nexport type GenerateReframedVideoV2BodyOutputRenditionsItemOneOf = {\n  aspectRatio: AspectRatioV2;\n  mediaDestination?: Destination;\n  sidecarDestination?: Destination;\n};\n\nexport type GenerateReframedVideoV2BodyOutputRenditionsItemOneOfTwoResolution = {\n  /** Resolution width of the output in pixels. */\n  width: number;\n  /** Resolution height of the output in pixels. */\n  height: number;\n};\n\nexport type GenerateReframedVideoV2BodyOutputRenditionsItemOneOfTwo = {\n  resolution: GenerateReframedVideoV2BodyOutputRenditionsItemOneOfTwoResolution;\n  mediaDestination?: Destination;\n  sidecarDestination?: Destination;\n};\n\nexport type GenerateReframedVideoV2BodyOutputRenditionsItem =\n  | GenerateReframedVideoV2BodyOutputRenditionsItemOneOf\n  | GenerateReframedVideoV2BodyOutputRenditionsItemOneOfTwo;\n\n/**\n * Output configuration details for generating the reframed video.\n */\nexport type GenerateReframedVideoV2BodyOutput = {\n  format?: OutputFormatV2;\n  /** Array of output rendition specifications. */\n  renditions: GenerateReframedVideoV2BodyOutputRenditionsItem[];\n};\n\nexport type GenerateReframedVideoV2Body = {\n  video: VideoInputV2;\n  analysis?: AnalysisV2;\n  composition?: CompositionV2;\n  /** Output configuration details for generating the reframed video. */\n  output: GenerateReframedVideoV2BodyOutput;\n};\n\n/**\n * Response indicating that the reframed video job has been successfully submitted.\n */\nexport type GenerateReframedVideoV2202 = {\n  /** The unique identifier for the job. */\n  jobId: string;\n  /** The URL to monitor the status of the job. */\n  statusUrl: string;\n};\n\n/**\n * Error response for the reframed video job.\n */\nexport type GenerateReframedVideoV2400 = {\n  /** A code representing the specific error type. */\n  error_code: string;\n  /** A description of the error that occurred. */\n  message: string;\n};\n\n/**\n * Error response for the reframed video job.\n */\nexport type GenerateReframedVideoV2401 = {\n  /** A code representing the specific error type. */\n  error_code: string;\n  /** A description of the error that occurred. */\n  message: string;\n};\n\n/**\n * Error response for the reframed video job.\n */\nexport type GenerateReframedVideoV2403 = {\n  /** A code representing the specific error type. */\n  error_code: string;\n  /** A description of the error that occurred. */\n  message: string;\n};\n\n/**\n * Error response for the reframed video job.\n */\nexport type GenerateReframedVideoV2404 = {\n  /** A code representing the specific error type. */\n  error_code: string;\n  /** A description of the error that occurred. */\n  message: string;\n};\n\n/**\n * Error response for the reframed video job.\n */\nexport type GenerateReframedVideoV2405 = {\n  /** A code representing the specific error type. */\n  error_code: string;\n  /** A description of the error that occurred. */\n  message: string;\n};\n\n/**\n * Error response for the reframed video job.\n */\nexport type GenerateReframedVideoV2429 = {\n  /** A code representing the specific error type. */\n  error_code: string;\n  /** A description of the error that occurred. */\n  message: string;\n};\n\n/**\n * Error response for the reframed video job.\n */\nexport type GenerateReframedVideoV2500 = {\n  /** A code representing the specific error type. */\n  error_code: string;\n  /** A description of the error that occurred. */\n  message: string;\n};\n\nexport type JobResultV2PathParameters = {\n  jobId: string;\n};\n/**\n * The status of the reframed video job.\n */\nexport type JobResultV2200OneOfStatus =\n  (typeof JobResultV2200OneOfStatus)[keyof typeof JobResultV2200OneOfStatus];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const JobResultV2200OneOfStatus = {\n  not_started: 'not_started',\n  running: 'running',\n  failed: 'failed',\n  succeeded: 'succeeded',\n  partially_succeeded: 'partially_succeeded',\n} as const;\n\n/**\n * Response indicating that the reframed video job is in progress.\n */\nexport type JobResultV2200OneOf = {\n  /** The status of the reframed video job. */\n  status: JobResultV2200OneOfStatus;\n  /** The unique identifier for the job. */\n  jobId: string;\n};\n\n/**\n * The status of the reframed video job.\n */\nexport type JobResultV2200OneOfThreeStatus =\n  (typeof JobResultV2200OneOfThreeStatus)[keyof typeof JobResultV2200OneOfThreeStatus];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const JobResultV2200OneOfThreeStatus = {\n  not_started: 'not_started',\n  running: 'running',\n  failed: 'failed',\n  succeeded: 'succeeded',\n  partially_succeeded: 'partially_succeeded',\n} as const;\n\n/**\n * Details of the output destination, including a pre-signed URL.\n */\nexport type JobResultV2200OneOfThreeOutputsItemOneOfDestination = {\n  /** The pre-signed URL pointing to the output. */\n  url: string;\n};\n\nexport type JobResultV2200OneOfThreeOutputsItemOneOf = {\n  /** Details of the output destination, including a pre-signed URL. */\n  destination: JobResultV2200OneOfThreeOutputsItemOneOfDestination;\n};\n\n/**\n * Details of the error encountered during the reframing process.\n */\nexport type JobResultV2200OneOfThreeOutputsItemOneOfThreeError = {\n  /** A code representing the specific error type. */\n  error_code: string;\n  /** A description of the error that occurred. */\n  message: string;\n};\n\n/**\n * Error response for the generate reframed video job.\n */\nexport type JobResultV2200OneOfThreeOutputsItemOneOfThree = {\n  /** Details of the error encountered during the reframing process. */\n  error: JobResultV2200OneOfThreeOutputsItemOneOfThreeError;\n};\n\nexport type JobResultV2200OneOfThreeOutputsItem =\n  | JobResultV2200OneOfThreeOutputsItemOneOf\n  | JobResultV2200OneOfThreeOutputsItemOneOfThree;\n\n/**\n * Success response for the reframed video job.\n */\nexport type JobResultV2200OneOfThree = {\n  /** The status of the reframed video job. */\n  status: JobResultV2200OneOfThreeStatus;\n  /** The unique identifier for the job. */\n  jobId: string;\n  /** Array of output rendition results. */\n  outputs: JobResultV2200OneOfThreeOutputsItem[];\n};\n\n/**\n * The status of the reframed video job.\n */\nexport type JobResultV2200OneOfOnezeroStatus =\n  (typeof JobResultV2200OneOfOnezeroStatus)[keyof typeof JobResultV2200OneOfOnezeroStatus];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const JobResultV2200OneOfOnezeroStatus = {\n  not_started: 'not_started',\n  running: 'running',\n  failed: 'failed',\n  succeeded: 'succeeded',\n  partially_succeeded: 'partially_succeeded',\n} as const;\n\n/**\n * Details of the output destination, including a pre-signed URL.\n */\nexport type JobResultV2200OneOfOnezeroOutputsItemOneOfDestination = {\n  /** The pre-signed URL pointing to the output. */\n  url: string;\n};\n\n/**\n * Success response for the generate reframed video job.\n */\nexport type JobResultV2200OneOfOnezeroOutputsItemOneOf = {\n  /** Details of the output destination, including a pre-signed URL. */\n  destination: JobResultV2200OneOfOnezeroOutputsItemOneOfDestination;\n};\n\n/**\n * Details of the error encountered during the reframing process.\n */\nexport type JobResultV2200OneOfOnezeroOutputsItemOneOfThreeError = {\n  /** A code representing the specific error type. */\n  error_code: string;\n  /** A description of the error that occurred. */\n  message: string;\n};\n\n/**\n * Error response for the generate reframed video job.\n */\nexport type JobResultV2200OneOfOnezeroOutputsItemOneOfThree = {\n  /** Details of the error encountered during the reframing process. */\n  error: JobResultV2200OneOfOnezeroOutputsItemOneOfThreeError;\n};\n\nexport type JobResultV2200OneOfOnezeroOutputsItem =\n  | JobResultV2200OneOfOnezeroOutputsItemOneOf\n  | JobResultV2200OneOfOnezeroOutputsItemOneOfThree;\n\n/**\n * Response for a reframed video job that partially succeeded.\n */\nexport type JobResultV2200OneOfOnezero = {\n  /** The status of the reframed video job. */\n  status: JobResultV2200OneOfOnezeroStatus;\n  /** The unique identifier for the job. */\n  jobId: string;\n  /** Details of the job's partial success, including successful outputs and any errors encountered. */\n  outputs: JobResultV2200OneOfOnezeroOutputsItem[];\n};\n\n/**\n * The status of the reframed video job, indicating a failure.\n */\nexport type JobResultV2200OneOfOnesevenStatus =\n  (typeof JobResultV2200OneOfOnesevenStatus)[keyof typeof JobResultV2200OneOfOnesevenStatus];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const JobResultV2200OneOfOnesevenStatus = {\n  not_started: 'not_started',\n  running: 'running',\n  failed: 'failed',\n  succeeded: 'succeeded',\n  partially_succeeded: 'partially_succeeded',\n} as const;\n\n/**\n * Details of the error encountered during the reframing process.\n */\nexport type JobResultV2200OneOfOnesevenOutputsRenditionsItemError = {\n  /** A code representing the specific error type. */\n  error_code: string;\n  /** A description of the error that occurred. */\n  message: string;\n};\n\n/**\n * Error response for the generate reframed video job.\n */\nexport type JobResultV2200OneOfOnesevenOutputsRenditionsItem = {\n  /** Details of the error encountered during the reframing process. */\n  error: JobResultV2200OneOfOnesevenOutputsRenditionsItemError;\n};\n\n/**\n * Details of the errors encountered during the job.\n */\nexport type JobResultV2200OneOfOnesevenOutputs = {\n  /** Array of failed rendition outputs. */\n  renditions: JobResultV2200OneOfOnesevenOutputsRenditionsItem[];\n};\n\n/**\n * Error response for a reframed video job that failed.\n */\nexport type JobResultV2200OneOfOneseven = {\n  /** The status of the reframed video job, indicating a failure. */\n  status: JobResultV2200OneOfOnesevenStatus;\n  /** The unique identifier for the job. */\n  jobId: string;\n  /** Details of the errors encountered during the job. */\n  outputs: JobResultV2200OneOfOnesevenOutputs;\n};\n\n/**\n * Job response on status API.\n */\nexport type JobResultV2200 =\n  | JobResultV2200OneOf\n  | JobResultV2200OneOfThree\n  | JobResultV2200OneOfOnezero\n  | JobResultV2200OneOfOneseven;\n\n/**\n * Response indicating that the reframed video job has been successfully submitted.\n */\nexport type JobResultV2400 = {\n  /** The unique identifier for the job. */\n  jobId: string;\n  /** The URL to monitor the status of the job. */\n  statusUrl: string;\n};\n\n/**\n * Response indicating that the reframed video job has been successfully submitted.\n */\nexport type JobResultV2401 = {\n  /** The unique identifier for the job. */\n  jobId: string;\n  /** The URL to monitor the status of the job. */\n  statusUrl: string;\n};\n\n/**\n * Response indicating that the reframed video job has been successfully submitted.\n */\nexport type JobResultV2403 = {\n  /** The unique identifier for the job. */\n  jobId: string;\n  /** The URL to monitor the status of the job. */\n  statusUrl: string;\n};\n\n/**\n * Response indicating that the reframed video job has been successfully submitted.\n */\nexport type JobResultV2404 = {\n  /** The unique identifier for the job. */\n  jobId: string;\n  /** The URL to monitor the status of the job. */\n  statusUrl: string;\n};\n\n/**\n * Response indicating that the reframed video job has been successfully submitted.\n */\nexport type JobResultV2405 = {\n  /** The unique identifier for the job. */\n  jobId: string;\n  /** The URL to monitor the status of the job. */\n  statusUrl: string;\n};\n\n/**\n * Response indicating that the reframed video job has been successfully submitted.\n */\nexport type JobResultV2422 = {\n  /** The unique identifier for the job. */\n  jobId: string;\n  /** The URL to monitor the status of the job. */\n  statusUrl: string;\n};\n\n/**\n * Response indicating that the reframed video job has been successfully submitted.\n */\nexport type JobResultV2429 = {\n  /** The unique identifier for the job. */\n  jobId: string;\n  /** The URL to monitor the status of the job. */\n  statusUrl: string;\n};\n\n/**\n * Response indicating that the reframed video job has been successfully submitted.\n */\nexport type JobResultV2500 = {\n  /** The unique identifier for the job. */\n  jobId: string;\n  /** The URL to monitor the status of the job. */\n  statusUrl: string;\n};\n","export * from './audio-video-api-client';\nexport * from './audio-video-api-client.schemas';\n","/**\n * Polling utilities for async Audio and Video API jobs\n *\n * This module provides a unified polling mechanism that works with ALL job types\n * in the Adobe Audio and Video API:\n *\n * - **Template jobs**: templateDescribe(), templateRender()\n * - **Speech generation**: generateSpeech()\n * - **Transcription**: transcribe()\n * - **Dubbing**: dub()\n * - **Avatar generation**: generateAvatar()\n * - **Video reframing**: generateReframedVideo(), generateReframedVideoV2()\n *\n * The polling function automatically determines the correct status endpoint\n * and handles different response formats for each job type.\n */\n\nimport { AUDIO_VIDEO_AXIOS_INSTANCE } from '../mutator/custom-audio-video-axios-instance';\nimport type { AxiosRequestConfig } from 'axios';\nimport type {\n  TemplateDescribeResponse,\n  TemplateRenderResponse,\n  SubmitAPIResponse,\n  JobStatusLinkResponse,\n  GenerateReframedVideo202,\n  GenerateReframedVideoV2202,\n  StatusAPIResponse,\n  JobResultV2200,\n  FireflyJobApiResponse,\n} from '../generated/audio-video-api-client';\n\n/**\n * Union type of all possible job responses from Audio and Video API\n */\nexport type AudioVideoJobResponse =\n  | TemplateDescribeResponse\n  | TemplateRenderResponse\n  | SubmitAPIResponse\n  | JobStatusLinkResponse\n  | GenerateReframedVideo202\n  | GenerateReframedVideoV2202;\n\n/**\n * Union type of all possible job status responses\n */\nexport type AudioVideoJobStatusResponse =\n  | StatusAPIResponse\n  | JobResultV2200\n  | FireflyJobApiResponse;\n\nexport interface PollAudioVideoJobOptions {\n  /**\n   * Authentication and other fetch options\n   */\n  axiosRequestConfig?: AxiosRequestConfig;\n  /**\n   * Interval between polling attempts in milliseconds\n   * @default 2000\n   */\n  intervalMs?: number;\n  /**\n   * Maximum number of polling attempts\n   * @default 60\n   */\n  maxAttempts?: number;\n  /**\n   * Callback for progress updates\n   */\n  onProgress?: (status: AudioVideoJobStatusResponse) => void;\n  /**\n   * Custom timeout in milliseconds (overrides maxAttempts)\n   */\n  timeoutMs?: number;\n  /**\n   * Override the status URL path (if not using the standard endpoints)\n   */\n  statusUrlOverride?: string;\n}\n\nexport class PollingError extends Error {\n  public readonly statusJson: string;\n  constructor(\n    message: string,\n    public readonly status?: string,\n    public readonly cause?: unknown\n  ) {\n    super(message);\n    this.statusJson = JSON.stringify(status);\n    this.name = 'PollingError';\n  }\n}\n\nexport class PollingTimeoutError extends PollingError {\n  constructor(message: string, status?: string) {\n    super(message, status);\n    this.name = 'PollingTimeoutError';\n  }\n}\n\n/**\n * Determines the appropriate status endpoint to poll based on the job response\n */\nfunction getStatusEndpoint(jobResult: AudioVideoJobResponse, statusUrlOverride?: string): string {\n  if (statusUrlOverride) {\n    return statusUrlOverride;\n  }\n\n  // If statusUrl is provided, extract the path from it\n  if ('statusUrl' in jobResult && jobResult.statusUrl) {\n    try {\n      const url = new URL(jobResult.statusUrl);\n      return url.pathname;\n    } catch {\n      // If URL parsing fails, try to extract the path directly\n      const match = jobResult.statusUrl.match(/\\/(v[0-9]+\\/status\\/.+)$/);\n      if (match) {\n        return `/${match[1]}`;\n      }\n    }\n  }\n\n  // Determine endpoint based on which properties exist\n  const jobId = 'jobId' in jobResult ? jobResult.jobId : undefined;\n\n  if (!jobId) {\n    throw new PollingError('No job ID or status URL found in job result');\n  }\n\n  // Check if this is a v2 reframe job (has specific v2 properties)\n  if ('outputs' in jobResult && Array.isArray(jobResult.outputs)) {\n    return `/v2/status/${jobId}`;\n  }\n\n  // Default to v1 status endpoint for most jobs\n  return `/v1/status/${jobId}`;\n}\n\n/**\n * Checks if a job status indicates completion (success or failure)\n */\nfunction isJobComplete(status: AudioVideoJobStatusResponse): boolean {\n  if ('status' in status) {\n    const statusValue = status.status;\n    return (\n      statusValue === 'succeeded' ||\n      statusValue === 'partially_succeeded' ||\n      statusValue === 'failed'\n    );\n  }\n  return false;\n}\n\n/**\n * Checks if a job status indicates success\n */\nfunction isJobSuccessful(status: AudioVideoJobStatusResponse): boolean {\n  if ('status' in status) {\n    const statusValue = status.status;\n    return statusValue === 'succeeded' || statusValue === 'partially_succeeded';\n  }\n  return false;\n}\n\n/**\n * Checks if a job status indicates failure\n */\nfunction isJobFailed(status: AudioVideoJobStatusResponse): boolean {\n  if ('status' in status) {\n    return status.status === 'failed';\n  }\n  // Check if it's an error response with error_code\n  if ('error_code' in status) {\n    return true;\n  }\n  return false;\n}\n\n/**\n * Extracts error message from a failed job status\n */\nfunction getErrorMessage(status: AudioVideoJobStatusResponse): string {\n  if ('message' in status && status.message) {\n    return status.message;\n  }\n  if ('error_code' in status && status.error_code) {\n    return `Error code: ${status.error_code}`;\n  }\n  return 'Unknown error';\n}\n\n/**\n * Polls an Audio and Video API async job until completion\n *\n * This function works with all job types in the Audio and Video API:\n * - Template jobs (describe, render)\n * - Speech generation jobs\n * - Transcription jobs\n * - Dubbing jobs\n * - Avatar generation jobs\n * - Video reframing jobs (v1 and v2)\n *\n * @param jobResult - The job result containing jobId and/or statusUrl from the initial async response\n * @param options - Polling configuration options\n * @returns The final job status when succeeded\n * @throws {PollingTimeoutError} If max attempts or timeout is reached\n * @throws {PollingError} If the job fails\n *\n * @example\n * ```typescript\n * // Template rendering\n * const renderJob = await AudioVideoClient.templateRender({ source, variations });\n * const result = await pollAudioVideoJob(renderJob, {\n *   axiosRequestConfig: { headers },\n *   onProgress: (status) => console.log(`Status: ${status.status}`)\n * });\n *\n * // Speech generation\n * const speechJob = await AudioVideoClient.generateSpeech({ text: 'Hello world' });\n * const speechResult = await pollAudioVideoJob(speechJob, { axiosRequestConfig: { headers } });\n *\n * // Video reframing\n * const reframeJob = await AudioVideoClient.generateReframedVideoV2({ input, outputs });\n * const reframeResult = await pollAudioVideoJob(reframeJob, { axiosRequestConfig: { headers } });\n * ```\n */\nexport async function pollAudioVideoJob(\n  jobResult: AudioVideoJobResponse,\n  options: PollAudioVideoJobOptions = {}\n): Promise<AudioVideoJobStatusResponse> {\n  const {\n    axiosRequestConfig = {},\n    intervalMs = 2000,\n    maxAttempts = 60,\n    onProgress,\n    timeoutMs,\n    statusUrlOverride,\n  } = options;\n\n  const statusEndpoint = getStatusEndpoint(jobResult, statusUrlOverride);\n  const startTime = Date.now();\n  const effectiveTimeout = timeoutMs ?? maxAttempts * intervalMs;\n  let attempts = 0;\n\n  while (true) {\n    attempts++;\n\n    // Check timeout\n    const elapsed = Date.now() - startTime;\n    if (elapsed >= effectiveTimeout) {\n      throw new PollingTimeoutError(`Polling timeout after ${elapsed}ms (${attempts} attempts)`);\n    }\n\n    try {\n      const response = await AUDIO_VIDEO_AXIOS_INSTANCE.get<AudioVideoJobStatusResponse>(\n        statusEndpoint,\n        axiosRequestConfig\n      );\n      const status = response.data;\n\n      // Call progress callback if provided\n      if (onProgress) {\n        onProgress(status);\n      }\n\n      // Check if job is complete\n      if (isJobComplete(status)) {\n        if (isJobSuccessful(status)) {\n          return status;\n        }\n\n        if (isJobFailed(status)) {\n          const errorMessage = getErrorMessage(status);\n          throw new PollingError(`Job failed: ${errorMessage}`, JSON.stringify(status));\n        }\n      }\n\n      // Job still running (not_started, running, pending), wait before next poll\n      await sleep(intervalMs);\n    } catch (error) {\n      // Re-throw our custom errors\n      if (error instanceof PollingError) {\n        throw error;\n      }\n\n      // Wrap other errors\n      throw new PollingError(\n        `Failed to poll job status: ${error instanceof Error ? error.message : String(error)}`,\n        undefined,\n        error\n      );\n    }\n  }\n}\n\n/**\n * Utility function to sleep for a given duration\n */\nfunction sleep(ms: number): Promise<void> {\n  return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"],"mappings":"okBAEA,MAAa,EAA6B,EAAA,QAAM,QAAQ,CACxD,EAA2B,SAAS,QAAU,mCAG9C,MAAa,GACX,EACA,IACe,CACf,IAAM,EAAS,EAAA,QAAM,YAAY,QAAQ,CAQzC,OANgB,EAA2B,CACzC,GAAG,EACH,GAAG,EACH,YAAa,EAAO,MACrB,CAAC,CAAC,MAAM,CAAE,UAAW,EAAK,ECuBhB,EACX,GAEO,EACL,CAAE,IAAK,aAAc,OAAQ,MAAO,CACpC,EACD,CAOU,IACX,EACA,IAEO,EACL,CACE,IAAK,sBACL,OAAQ,OACR,QAAS,CAAE,eAAgB,mBAAoB,CAC/C,KAAM,EACP,CACD,EACD,CAOU,IACX,CAAE,SACF,IAEO,EACL,CAAE,IAAK,cAAc,IAAS,OAAQ,MAAO,CAC7C,EACD,CAOU,IACX,EACA,IAEO,EACL,CACE,IAAK,yBACL,OAAQ,OACR,QAAS,CAAE,eAAgB,mBAAoB,CAC/C,KAAM,EACP,CACD,EACD,CAOU,GACX,GAEO,EACL,CAAE,IAAK,cAAe,OAAQ,MAAO,CACrC,EACD,CAOU,GACX,EACA,IAEO,EACL,CACE,IAAK,uBACL,OAAQ,OACR,QAAS,CAAE,eAAgB,mBAAoB,CAC/C,KAAM,EACP,CACD,EACD,CASU,GACX,EACA,IAEO,EACL,CACE,IAAK,cACL,OAAQ,OACR,QAAS,CAAE,eAAgB,mBAAoB,CAC/C,KAAM,EACP,CACD,EACD,CAOU,GACX,EACA,IAEO,EACL,CACE,IAAK,iBACL,OAAQ,OACR,QAAS,CAAE,eAAgB,mBAAoB,CAC/C,KAAM,EACP,CACD,EACD,CAOU,GACX,EACA,IAEO,EACL,CACE,IAAK,UACL,OAAQ,OACR,QAAS,CAAE,eAAgB,mBAAoB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