@imgly/plugin-ai-audio-generation-web 0.1.9 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,40 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.2.0] - 2025-07-15
6
+
7
+ ### Breaking Changes
8
+
9
+ - [all] **Provider Initialization**: `initProvider` is replaced with `initializeProviders` and `initializeProvider` with a different signature
10
+ - [all] **Quick Actions Structure**: `provider.input.quickctions.actions` replaced with `provider.input.quickActions.supported`
11
+ - [all] **History Asset Sources**: Combined history asset source is now not added to the default asset libraries anymore. Add the following sources to any library entry (default or not):
12
+ - Image Generation History: `ly.img.ai.image-generation.history`
13
+ - Video Generation History: `ly.img.ai.video-generation.history`
14
+ - Audio Generation History: `ly.img.ai.audio-generation.history`
15
+ - Sticker Generation History: `ly.img.ai.sticker-generation.history`
16
+ - [all] **ID Format Standardization**: All `ly.img.ai/` prefixed IDs changed to use dot notation `ly.img.ai.` for consistency
17
+ - Panel IDs: `ly.img.ai/apps` → `ly.img.ai.apps`, `ly.img.ai/image-generation` → `ly.img.ai.image-generation`
18
+ - Dock IDs: `ly.img.ai/apps.dock` → `ly.img.ai.apps.dock`
19
+
20
+ ### New Features
21
+
22
+ - [all] **Multiple Providers Support**: All plugin packages now support arrays of providers with automatic selection UI
23
+ - [image-generation] **Recraft20b Provider**: Added new Recraft20b (v2) provider via fal.ai with support for icon styles including `broken_line`, `colored_outline`, `colored_shapes`, and more
24
+ - [sticker-generation] **New Sticker Generation Plugin**: Added `@imgly/plugin-ai-sticker-generation-web` plugin for AI-powered sticker generation with support for text-to-sticker generation using Recraft20b provider with icon styles
25
+ - [image-generation] **Flux Pro Kontext Provider**: Added Flux Pro Kontext provider for image editing with style transfer and artist style options
26
+ - [image-generation] **Flux Pro Kontext Max Provider**: Added Flux Pro Kontext Max provider for enhanced image editing capabilities
27
+ - [video-generation] **Veo3 Provider**: Added Veo3 text-to-video provider via fal.ai with support for 16:9, 9:16, and 1:1 aspect ratios and 8-second duration
28
+ - [video-generation] **Kling Video V2.1 Master Providers**: Added Kling Video V2.1 Master providers for both text-to-video and image-to-video generation with configurable duration (5s/10s) and aspect ratios
29
+ - [text-generation] **Model Selection**: OpenAI and Anthropic providers now support configurable model selection through the `model` parameter
30
+
31
+ ### Deprecated Features
32
+
33
+ - [all] **Middleware Configuration**: The `middleware` property in provider configurations is deprecated. Use `middlewares` instead. The old property will continue to work for now.
34
+
35
+ ## [0.1.10] - 2025-06-20
36
+
37
+ - [all] Fix issue with GPT provider when using text provider
38
+
5
39
  ## [0.1.9] - 2025-06-05
6
40
 
7
41
  - [all] Add support for custom headers
package/README.md CHANGED
@@ -27,6 +27,8 @@ npm install @imgly/plugin-ai-audio-generation-web
27
27
 
28
28
  To use the plugin, import it and configure it with your preferred providers:
29
29
 
30
+ #### Single Provider Configuration
31
+
30
32
  ```typescript
31
33
  import CreativeEditorSDK from '@cesdk/cesdk-js';
32
34
  import AudioGeneration from '@imgly/plugin-ai-audio-generation-web';
@@ -42,12 +44,73 @@ CreativeEditorSDK.create(domElement, {
42
44
  AudioGeneration({
43
45
  // Text-to-speech provider
44
46
  text2speech: Elevenlabs.ElevenMultilingualV2({
45
- proxyUrl: 'https://your-elevenlabs-proxy.example.com'
47
+ proxyUrl: 'http://your-proxy-server.com/api/proxy',
48
+ headers: {
49
+ 'x-custom-header': 'value',
50
+ 'x-client-version': '1.0.0'
51
+ }
46
52
  }),
47
53
 
48
54
  // Sound effects provider (optional)
49
55
  text2sound: Elevenlabs.ElevenSoundEffects({
50
- proxyUrl: 'https://your-elevenlabs-proxy.example.com'
56
+ proxyUrl: 'http://your-proxy-server.com/api/proxy',
57
+ headers: {
58
+ 'x-custom-header': 'value',
59
+ 'x-client-version': '1.0.0'
60
+ }
61
+ }),
62
+
63
+ // Optional configuration
64
+ debug: false,
65
+ dryRun: false
66
+ })
67
+ );
68
+ });
69
+ ```
70
+
71
+ #### Multiple Providers Configuration
72
+
73
+ You can configure multiple providers for each generation type, and users will see a selection box to choose between them:
74
+
75
+ ```typescript
76
+ import CreativeEditorSDK from '@cesdk/cesdk-js';
77
+ import AudioGeneration from '@imgly/plugin-ai-audio-generation-web';
78
+ import Elevenlabs from '@imgly/plugin-ai-audio-generation-web/elevenlabs';
79
+
80
+ // Initialize CreativeEditor SDK
81
+ CreativeEditorSDK.create(domElement, {
82
+ license: 'your-license-key'
83
+ // Other configuration options...
84
+ }).then(async (cesdk) => {
85
+ // Add the audio generation plugin with multiple providers
86
+ cesdk.addPlugin(
87
+ AudioGeneration({
88
+ // Multiple text-to-speech providers
89
+ text2speech: [
90
+ Elevenlabs.ElevenMultilingualV2({
91
+ proxyUrl: 'http://your-proxy-server.com/api/proxy',
92
+ headers: {
93
+ 'x-custom-header': 'value',
94
+ 'x-client-version': '1.0.0'
95
+ }
96
+ }),
97
+ // Add more providers here as they become available
98
+ // OtherProvider.SomeModel({
99
+ // proxyUrl: 'http://your-proxy-server.com/api/proxy',
100
+ // headers: {
101
+ // 'x-api-key': 'your-key',
102
+ // 'x-source': 'cesdk'
103
+ // }
104
+ // })
105
+ ],
106
+
107
+ // Sound effects provider (optional)
108
+ text2sound: Elevenlabs.ElevenSoundEffects({
109
+ proxyUrl: 'http://your-proxy-server.com/api/proxy',
110
+ headers: {
111
+ 'x-custom-header': 'value',
112
+ 'x-client-version': '1.0.0'
113
+ }
51
114
  }),
52
115
 
53
116
  // Optional configuration
@@ -68,7 +131,11 @@ A versatile text-to-speech engine that supports multiple languages and voices:
68
131
 
69
132
  ```typescript
70
133
  text2speech: Elevenlabs.ElevenMultilingualV2({
71
- proxyUrl: 'https://your-elevenlabs-proxy.example.com'
134
+ proxyUrl: 'http://your-proxy-server.com/api/proxy',
135
+ headers: {
136
+ 'x-custom-header': 'value',
137
+ 'x-client-version': '1.0.0'
138
+ }
72
139
  });
73
140
  ```
74
141
 
@@ -78,6 +145,7 @@ Key features:
78
145
  - Multilingual support
79
146
  - Adjustable speaking speed
80
147
  - Natural-sounding speech
148
+ - Custom headers support for API requests
81
149
 
82
150
  #### 2. ElevenSoundEffects (Text-to-Sound)
83
151
 
@@ -85,7 +153,11 @@ A sound effect generator that creates audio from text descriptions:
85
153
 
86
154
  ```typescript
87
155
  text2sound: Elevenlabs.ElevenSoundEffects({
88
- proxyUrl: 'https://your-elevenlabs-proxy.example.com'
156
+ proxyUrl: 'http://your-proxy-server.com/api/proxy',
157
+ headers: {
158
+ 'x-custom-header': 'value',
159
+ 'x-client-version': '1.0.0'
160
+ }
89
161
  });
90
162
  ```
91
163
 
@@ -95,18 +167,19 @@ Key features:
95
167
  - Create ambient sounds, effects, and music
96
168
  - Seamless integration with CreativeEditor SDK
97
169
  - Automatic thumbnails and duration detection
170
+ - Custom headers support for API requests
98
171
 
99
172
  ### Configuration Options
100
173
 
101
174
  The plugin accepts the following configuration options:
102
175
 
103
- | Option | Type | Description | Default |
104
- | ------------- | --------- | ----------------------------------------------- | --------- |
105
- | `text2speech` | Provider | Provider for text-to-speech generation | undefined |
106
- | `text2sound` | Provider | Provider for sound effect generation | undefined |
107
- | `debug` | boolean | Enable debug logging | false |
108
- | `dryRun` | boolean | Simulate generation without API calls | false |
109
- | `middleware` | Function[] | Array of middleware functions for the generation | undefined |
176
+ | Option | Type | Description | Default |
177
+ | ------------- | -------------------- | ----------------------------------------------- | --------- |
178
+ | `text2speech` | Provider \| Provider[] | Provider(s) for text-to-speech generation. When multiple providers are provided, users can select between them | undefined |
179
+ | `text2sound` | Provider \| Provider[] | Provider(s) for sound effect generation. When multiple providers are provided, users can select between them | undefined |
180
+ | `debug` | boolean | Enable debug logging | false |
181
+ | `dryRun` | boolean | Simulate generation without API calls | false |
182
+ | `middleware` | Function[] | Array of middleware functions for the generation | undefined |
110
183
 
111
184
  ### Middleware Configuration
112
185
 
@@ -151,7 +224,7 @@ const customMiddleware = async (input, options, next) => {
151
224
  cesdk.addPlugin(
152
225
  AudioGeneration({
153
226
  text2speech: Elevenlabs.ElevenMultilingualV2({
154
- proxyUrl: 'https://your-elevenlabs-proxy.example.com'
227
+ proxyUrl: 'http://your-proxy-server.com/api/proxy'
155
228
  }),
156
229
  middleware: [logging, rateLimit, customMiddleware] // Apply middleware in order
157
230
  })
@@ -171,10 +244,20 @@ For security reasons, it's recommended to use a proxy server to handle API reque
171
244
 
172
245
  ```typescript
173
246
  text2speech: Elevenlabs.ElevenMultilingualV2({
174
- proxyUrl: 'https://your-elevenlabs-proxy.example.com'
247
+ proxyUrl: 'http://your-proxy-server.com/api/proxy',
248
+ headers: {
249
+ 'x-custom-header': 'value',
250
+ 'x-client-version': '1.0.0'
251
+ }
175
252
  });
176
253
  ```
177
254
 
255
+ The `headers` option allows you to include custom HTTP headers in all API requests. This is useful for:
256
+ - Adding custom client identification headers
257
+ - Including version information
258
+ - Passing through metadata required by your API
259
+ - Adding correlation IDs for request tracing
260
+
178
261
  You'll need to implement a proxy server that forwards requests to ElevenLabs and handles authentication.
179
262
 
180
263
  ## API Reference
@@ -191,11 +274,11 @@ Creates and returns a plugin that can be added to CreativeEditor SDK.
191
274
 
192
275
  ```typescript
193
276
  interface PluginConfiguration {
194
- // Provider for text-to-speech generation
195
- text2speech?: AiAudioProvider;
277
+ // Provider(s) for text-to-speech generation
278
+ text2speech?: AiAudioProvider | AiAudioProvider[];
196
279
 
197
- // Provider for sound effect generation
198
- text2sound?: AiAudioProvider;
280
+ // Provider(s) for sound effect generation
281
+ text2sound?: AiAudioProvider | AiAudioProvider[];
199
282
 
200
283
  // Enable debug logging
201
284
  debug?: boolean;
@@ -215,6 +298,7 @@ interface PluginConfiguration {
215
298
  ```typescript
216
299
  Elevenlabs.ElevenMultilingualV2(config: {
217
300
  proxyUrl: string;
301
+ headers?: Record<string, string>;
218
302
  debug?: boolean;
219
303
  }): AiAudioProvider
220
304
  ```
@@ -224,6 +308,7 @@ Elevenlabs.ElevenMultilingualV2(config: {
224
308
  ```typescript
225
309
  Elevenlabs.ElevenSoundEffects(config: {
226
310
  proxyUrl: string;
311
+ headers?: Record<string, string>;
227
312
  debug?: boolean;
228
313
  }): AiAudioProvider
229
314
  ```
@@ -239,9 +324,9 @@ The plugin automatically registers the following UI components:
239
324
 
240
325
  ### Panel IDs
241
326
 
242
- - Main speech panel: `ly.img.ai/elevenlabs/monolingual/v1`
243
- - Main sound panel: `ly.img.ai/elevenlabs/sound-generation`
244
- - Voice selection panel: `ly.img.ai/audio-generation/speech/elevenlabs.voiceSelection`
327
+ - Main speech panel: `ly.img.ai.elevenlabs/monolingual/v1`
328
+ - Main sound panel: `ly.img.ai.elevenlabs/sound-generation`
329
+ - Voice selection panel: `ly.img.ai.audio-generation/speech/elevenlabs.voiceSelection`
245
330
 
246
331
  ### Asset History
247
332
 
@@ -252,9 +337,9 @@ Generated audio files are automatically stored in asset sources with the followi
252
337
 
253
338
  ## Related Packages
254
339
 
255
- - [@imgly/plugin-ai-generation-web](https://github.com/imgly/plugin-ai-generation-web) - Core utilities for AI generation
256
- - [@imgly/plugin-ai-image-generation-web](https://github.com/imgly/plugin-ai-image-generation-web) - AI image generation
257
- - [@imgly/plugin-ai-video-generation-web](https://github.com/imgly/plugin-ai-video-generation-web) - AI video generation
340
+ - [@imgly/plugin-ai-generation-web](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-generation-web) - Core utilities for AI generation
341
+ - [@imgly/plugin-ai-image-generation-web](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-image-generation-web) - AI image generation
342
+ - [@imgly/plugin-ai-video-generation-web](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-video-generation-web) - AI video generation
258
343
 
259
344
  ## License
260
345
 
@@ -1,2 +1,84 @@
1
- var C={openapi:"3.0.0",info:{title:"Elevenlabs API",version:"1.0.0",description:"Elevenlabs API"},components:{schemas:{ElevenlabsInput:{title:"TextToSpeechInput",type:"object",properties:{prompt:{title:"Prompt",type:"string","x-imgly-builder":{component:"TextArea"}},voice_id:{title:"Voice",type:"string",description:"The voice ID to use for the speech synthesis.",default:"JBFqnCBsd6RMkjVDRZzb"},speed:{title:"Speed",type:"number",description:"The speed of the speech synthesis.",default:1,"x-imgly-step":.05,minimum:.7,maximum:1.2}},"x-elevenlabs-order-properties":["prompt","style","image_size"],required:["prompt","voice_id"]}}}};var E={version:"2.0.0",id:"ly.img.voices.eleventlabs",assets:[{id:"JBFqnCBsd6RMkjVDRZzb",label:{en:"George"},tags:{en:["British Accent","warm","middle aged","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/JBFqnCBsd6RMkjVDRZzb/e6206d1a-0721-4787-aafb-06a6e705cac5.mp3",thumbUri:"{{base_url}}george.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.42"}},{id:"FGY2WhTYpPnrIDTdsKH5",label:{en:"Laura"},tags:{en:["American Accent","upbeat","young","female","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/FGY2WhTYpPnrIDTdsKH5/67341759-ad08-41a5-be6e-de12fe448618.mp3",thumbUri:"{{base_url}}laura.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.04"}},{id:"IKne3meq5aSn9XLyUdCD",label:{en:"Charlie"},tags:{en:["Australian Accent","natural","middle aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/IKne3meq5aSn9XLyUdCD/102de6f2-22ed-43e0-a1f1-111fa75c5481.mp3",thumbUri:"{{base_url}}charlie.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.53"}},{id:"9BWtsMINqrJLrRacOk9x",label:{en:"Aria"},tags:{en:["American Accent","expressive","middle-aged","female","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/9BWtsMINqrJLrRacOk9x/405766b8-1f4e-4d3c-aba1-6f25333823ec.mp3",thumbUri:"{{base_url}}aria.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.71"}},{id:"EXAVITQu4vr4xnSDxMaL",label:{en:"Sarah"},tags:{en:["american Accent","soft","young","female","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/EXAVITQu4vr4xnSDxMaL/01a3e33c-6e99-4ee7-8543-ff2216a32186.mp3",thumbUri:"{{base_url}}sarah2.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.53"}},{id:"SAz9YHcvj6GT2YYXdXww",label:{en:"River"},tags:{en:["American Accent","confident","middle-aged","non-binary","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/SAz9YHcvj6GT2YYXdXww/e6c95f0b-2227-491a-b3d7-2249240decb7.mp3",thumbUri:"{{base_url}}river.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.53"}},{id:"XrExE9yKIg1WjnnlVkGX",label:{en:"Matilda"},tags:{en:["American Accent","friendly","middle-aged","female","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/XrExE9yKIg1WjnnlVkGX/b930e18d-6b4d-466e-bab2-0ae97c6d8535.mp3",thumbUri:"{{base_url}}matilda.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.64"}},{id:"N2lVS1w4EtoT3dr4eOWO",label:{en:"Callum"},tags:{en:["Transatlantic Accent","intense","middle-aged","male","characters"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/N2lVS1w4EtoT3dr4eOWO/ac833bd8-ffda-4938-9ebc-b0f99ca25481.mp3",thumbUri:"{{base_url}}callum.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"4.18"}},{id:"TX3LPaxmHKxFdv7VOQHJ",label:{en:"Liam"},tags:{en:["American Accent","articulate","young","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/TX3LPaxmHKxFdv7VOQHJ/63148076-6363-42db-aea8-31424308b92c.mp3",thumbUri:"{{base_url}}liam.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"4.13"}},{id:"XB0fDUnXU5powFXDhCwa",label:{en:"Charlotte"},tags:{en:["Swedish Accent","seductive","young","female","characters"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/XB0fDUnXU5powFXDhCwa/942356dc-f10d-4d89-bda5-4f8505ee038b.mp3",thumbUri:"{{base_url}}charlotte.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.25"}},{id:"CwhRBWXzGAHq8TQ4Fs17",label:{en:"Roger"},tags:{en:["American Accent","confident","middle-aged","male","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/CwhRBWXzGAHq8TQ4Fs17/58ee3ff5-f6f2-4628-93b8-e38eb31806b0.mp3",thumbUri:"{{base_url}}roger.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.89"}},{id:"nPczCjzI2devNBz1zQrb",label:{en:"Brian"},tags:{en:["American Accent","deep","middle-aged","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/nPczCjzI2devNBz1zQrb/2dd3e72c-4fd3-42f1-93ea-abc5d4e5aa1d.mp3",thumbUri:"{{base_url}}brian.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.46"}},{id:"cgSgspJ2msm6clMCkdW9",label:{en:"Jessica"},tags:{en:["American Accent","expressive","young","female","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/cgSgspJ2msm6clMCkdW9/56a97bf8-b69b-448f-846c-c3a11683d45a.mp3",thumbUri:"{{base_url}}jessica.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.89"}},{id:"Xb7hH8MSUJpSbSDYk0k2",label:{en:"Alice"},tags:{en:["British Accent","confident","middle-aged","female","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/Xb7hH8MSUJpSbSDYk0k2/d10f7534-11f6-41fe-a012-2de1e482d336.mp3",thumbUri:"{{base_url}}alice.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.53"}},{id:"pFZP5JQG7iQjIQuC4Bku",label:{en:"Lily"},tags:{en:["British Accent","warm","middle-aged","female","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/pFZP5JQG7iQjIQuC4Bku/89b68b35-b3dd-4348-a84a-a3c13a3c2b30.mp3",thumbUri:"{{base_url}}lily.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.11"}},{id:"cjVigY5qzO86Huf0OWal",label:{en:"Eric"},tags:{en:["American Accent","friendly","middle-aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/cjVigY5qzO86Huf0OWal/d098fda0-6456-4030-b3d8-63aa048c9070.mp3",thumbUri:"{{base_url}}eric.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.32"}},{id:"bIHbv24MWmeRgasZH58o",label:{en:"Will"},tags:{en:["American Accent","friendly","young","male","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/bIHbv24MWmeRgasZH58o/8caf8f3d-ad29-4980-af41-53f20c72d7a4.mp3",thumbUri:"{{base_url}}will.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.74"}},{id:"iP95p4xoKVk53GoZ742B",label:{en:"Chris"},tags:{en:["American Accent","casual","middle-aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/iP95p4xoKVk53GoZ742B/3f4bde72-cc48-40dd-829f-57fbf906f4d7.mp3",thumbUri:"{{base_url}}chris.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.29"}},{id:"pqHfZKP75CvOlQylNhV4",label:{en:"Bill"},tags:{en:["American Accent","trustworthy","old","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/pqHfZKP75CvOlQylNhV4/d782b3ff-84ba-4029-848c-acf01285524d.mp3",thumbUri:"{{base_url}}bill.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.51"}},{id:"onwK4e9ZLuTAKqWW03F9",label:{en:"Daniel"},tags:{en:["British Accent","authoritative","middle-aged","male","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/onwK4e9ZLuTAKqWW03F9/7eee0236-1a72-4b86-b303-5dcadc007ba9.mp3",thumbUri:"{{base_url}}daniel.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.75"}}]};function I(e,i,a){return Math.min(Math.max(e,i),a)}async function T(e){return new Promise((i,a)=>{let o=new Audio;o.src=e,o.addEventListener("loadedmetadata",()=>{let t=o.duration;i(t)}),o.addEventListener("error",t=>{a(new Error(`Failed to load audio metadata: ${t.message}`))})})}var V={width:256,height:256,backgroundColor:"transparent",waveformColor:"black",pixelsPerSecond:100};async function A(e,i={}){let{width:a,height:o,backgroundColor:t,waveformColor:s,pixelsPerSecond:r}={...V,...i},m=new AudioContext,n=await e.arrayBuffer(),l=await m.decodeAudioData(n),d=l.duration,u=Math.max(a,Math.ceil(d*r)),f=l.sampleRate*d/u,g=document.createElement("canvas");g.width=a,g.height=o;let c=g.getContext("2d");c.fillStyle=t,c.fillRect(0,0,a,o);let D=l.getChannelData(0),y=o/2,_=l.length;c.strokeStyle=s,c.beginPath(),c.moveTo(0,y);for(let p=0;p<a;p++){let h=1,v=-1;for(let S=0;S<f;S++){let P=Math.floor(p*f+S);if(P<_){let x=D[P];x<h&&(h=x),x>v&&(v=x)}}let q=y-h*y,O=y-v*y;c.lineTo(p,O),c.lineTo(p,q)}return c.stroke(),new Promise((p,h)=>{g.toBlob(v=>{v?p(v):h(new Error("Canvas to Blob conversion failed"))})})}function w(e,i,a={}){let{ellipsis:o="...",preserveSentences:t=!1,minLength:s=0}=a;if(!e||e.length<=s||e.length<=i)return e;let r=i-o.length;if(t){let l=/[.!?](?:\s|$)/g,d,u=0;for(;(d=l.exec(e))!==null&&!(d.index>r);)u=d.index+1;if(u>0)return e.substring(0,u)+o}let m=e.substring(0,r),n=m.lastIndexOf(" ");return n>0&&(m=m.substring(0,n)),m+o}function k(e){return async({cesdk:i})=>K(i,e)}function K(e,i){let a=i.baseURL??"https://cdn.img.ly/assets/plugins/plugin-ai-audio-generation-web/v1/elevenlabs/",o="ly.img.ai/audio-generation/speech/elevenlabs",t=`${o}.voiceSelection`,s=j(e,a),r="elevenlabs/monolingual/v1";return e.setTranslations({en:{[`panel.${r}`]:"AI Voice",[`panel.${t}`]:"Select a Voice"}}),{id:r,kind:"audio",initialize:async()=>{e.ui.addAssetLibraryEntry({id:s,sourceIds:[s],gridColumns:3}),e.ui.registerPanel(t,({builder:n,payload:l})=>{n.Library(`${o}.voiceSelection.library`,{searchable:!0,entries:[s],onSelect:async d=>{let{id:u,label:b}=d;l?.onSelect(u,b??u,d.meta?.thumbUri),e.ui.closePanel(t)}})})},input:{panel:{type:"schema",document:C,inputReference:"#/components/schemas/ElevenlabsInput",useFlow:"generation-only",renderCustomProperty:{voice_id:n=>{let l=n.experimental.global("voice",{voiceId:"JBFqnCBsd6RMkjVDRZzb",name:"George",thumbnail:`${a}george.webp`});return n.builder.Button(`${o}.openVoiceSelection`,{inputLabel:"Voice",icon:"@imgly/Appearance",trailingIcon:"@imgly/ChevronRight",labelAlignment:"left",label:l.value.name,onClick:()=>{e.ui.openPanel(t,{payload:{id:l.value.voiceId,onSelect:(d,u,b)=>{l.setValue({voiceId:d,name:u,thumbnail:b})}}})}}),()=>({id:"voice_id",type:"string",value:l.value.voiceId})}},getBlockInput:async n=>({audio:{label:w(n.prompt,25)}})}},output:{abortable:!0,history:"@imgly/indexedDB",middleware:i.middleware,generate:async(n,{abortSignal:l})=>{let d=await F(n.prompt,n.voice_id,{speed:parseFloat(n.speed.toFixed(10))},i,l),u=URL.createObjectURL(d),[b,f]=await Promise.all([A(d,{width:512,height:128}),T(u)]),g=URL.createObjectURL(b);return{kind:"audio",url:u,duration:f,thumbnailUrl:g}}},config:i}}async function F(e,i,a,o,t){let s=`${o.proxyUrl}/v1/text-to-speech/${i}`,r=await fetch(s,{signal:t,method:"POST",headers:{Accept:"audio/mpeg","Content-Type":"application/json",...o.headers??{}},body:JSON.stringify({text:e,model_id:"eleven_multilingual_v2",voice_settings:{speed:I(a?.speed||1,.7,1.2),stability:a?.stability||.5,similarity_boost:a?.similarityBoost||.5}})});if(!r.ok){let m=await r.text();throw new Error(`API error: ${r.status} - ${m}`)}return r.blob()}function j(e,i){let{id:a,assets:o}=E;return e.engine.asset.addLocalSource(a),o.map(async t=>{e.engine.asset.addAssetToSource(a,{...t,meta:{...t.meta,thumbUri:t.meta.thumbUri.replace("{{base_url}}",`${i}thumbnails/`)}})}),a}var U={openapi:"3.0.0",info:{title:"Elevenlabs Sound Effects API",version:"1.0.0",description:"Elevenlabs Sound Effects API"},components:{schemas:{TextToSoundInput:{title:"TextToSoundInput",type:"object",properties:{text:{title:"Prompt",type:"string","x-imgly-builder":{component:"TextArea"}},duration_seconds:{title:"Duration (sec.)",type:"number",minimum:.6,maximum:22,default:2}},"x-elevenlabs-order-properties":["text"],required:["text"]}}}};function B(e){return async({cesdk:i})=>M(i,e)}function M(e,i){let a="elevenlabs/sound-generation";return e.setTranslations({en:{[`panel.${a}`]:"Generate Sound"}}),{id:a,kind:"audio",initialize:async()=>{},input:{panel:{type:"schema",document:U,inputReference:"#/components/schemas/TextToSoundInput",useFlow:"generation-only",getBlockInput:async t=>({audio:{label:w(t.text,25)}})}},output:{abortable:!0,history:"@imgly/indexedDB",middleware:i.middleware,generate:async(t,{abortSignal:s})=>{let r=await W(t.text,t.duration_seconds,i,s),m=URL.createObjectURL(r),[n,l]=await Promise.all([A(r,{width:512,height:128}),T(m)]),d=URL.createObjectURL(n);return{kind:"audio",url:m,duration:l,thumbnailUrl:d}}},config:i}}async function W(e,i,a,o){let t=`${a.proxyUrl}/v1/sound-generation`,s=await fetch(t,{signal:o,method:"POST",headers:{Accept:"audio/mpeg","Content-Type":"application/json",...a.headers??{}},body:JSON.stringify({text:e,duration_seconds:i})});if(!s.ok){let r=await s.text();throw new Error(`API error: ${s.status} - ${r}`)}return s.blob()}var z={ElevenMultilingualV2:k,ElevenSoundEffects:B},re=z;export{re as default};
1
+ var Le=typeof global=="object"&&global&&global.Object===Object&&global,ge=Le,De=typeof self=="object"&&self&&self.Object===Object&&self,Pe=ge||De||Function("return this")(),g=Pe,$e=g.Symbol,k=$e,me=Object.prototype,Ne=me.hasOwnProperty,Oe=me.toString,E=k?k.toStringTag:void 0;function _e(e){var t=Ne.call(e,E),i=e[E];try{e[E]=void 0;var r=!0}catch{}var n=Oe.call(e);return r&&(t?e[E]=i:delete e[E]),n}var ze=_e,Ue=Object.prototype,Re=Ue.toString;function Be(e){return Re.call(e)}var Fe=Be,Ve="[object Null]",qe="[object Undefined]",J=k?k.toStringTag:void 0;function Ge(e){return e==null?e===void 0?qe:Ve:J&&J in Object(e)?ze(e):Fe(e)}var D=Ge;function Ye(e){return e!=null&&typeof e=="object"}var W=Ye,zr=Array.isArray;function Qe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var be=Qe,Ke="[object AsyncFunction]",He="[object Function]",Ze="[object GeneratorFunction]",We="[object Proxy]";function Xe(e){if(!be(e))return!1;var t=D(e);return t==He||t==Ze||t==Ke||t==We}var Je=Xe,et=g["__core-js_shared__"],V=et,ee=function(){var e=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function tt(e){return!!ee&&ee in e}var it=tt,rt=Function.prototype,nt=rt.toString;function ot(e){if(e!=null){try{return nt.call(e)}catch{}try{return e+""}catch{}}return""}var y=ot,at=/[\\^$.*+?()[\]{}|]/g,lt=/^\[object .+?Constructor\]$/,st=Function.prototype,ut=Object.prototype,dt=st.toString,ct=ut.hasOwnProperty,pt=RegExp("^"+dt.call(ct).replace(at,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function gt(e){if(!be(e)||it(e))return!1;var t=Je(e)?pt:lt;return t.test(y(e))}var mt=gt;function bt(e,t){return e?.[t]}var yt=bt;function ft(e,t){var i=yt(e,t);return mt(i)?i:void 0}var I=ft,ht=I(g,"WeakMap"),Y=ht;function vt(e,t){return e===t||e!==e&&t!==t}var wt=vt,kt=9007199254740991;function It(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=kt}var xt=It,Ur=Object.prototype,At="[object Arguments]";function Ct(e){return W(e)&&D(e)==At}var te=Ct,ye=Object.prototype,St=ye.hasOwnProperty,Mt=ye.propertyIsEnumerable,Rr=te(function(){return arguments}())?te:function(e){return W(e)&&St.call(e,"callee")&&!Mt.call(e,"callee")},fe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ie=fe&&typeof module=="object"&&module&&!module.nodeType&&module,Et=ie&&ie.exports===fe,re=Et?g.Buffer:void 0,Br=re?re.isBuffer:void 0,Tt="[object Arguments]",jt="[object Array]",Lt="[object Boolean]",Dt="[object Date]",Pt="[object Error]",$t="[object Function]",Nt="[object Map]",Ot="[object Number]",_t="[object Object]",zt="[object RegExp]",Ut="[object Set]",Rt="[object String]",Bt="[object WeakMap]",Ft="[object ArrayBuffer]",Vt="[object DataView]",qt="[object Float32Array]",Gt="[object Float64Array]",Yt="[object Int8Array]",Qt="[object Int16Array]",Kt="[object Int32Array]",Ht="[object Uint8Array]",Zt="[object Uint8ClampedArray]",Wt="[object Uint16Array]",Xt="[object Uint32Array]",o={};o[qt]=o[Gt]=o[Yt]=o[Qt]=o[Kt]=o[Ht]=o[Zt]=o[Wt]=o[Xt]=!0;o[Tt]=o[jt]=o[Ft]=o[Lt]=o[Vt]=o[Dt]=o[Pt]=o[$t]=o[Nt]=o[Ot]=o[_t]=o[zt]=o[Ut]=o[Rt]=o[Bt]=!1;function Jt(e){return W(e)&&xt(e.length)&&!!o[D(e)]}var ei=Jt;function ti(e){return function(t){return e(t)}}var ii=ti,he=typeof exports=="object"&&exports&&!exports.nodeType&&exports,T=he&&typeof module=="object"&&module&&!module.nodeType&&module,ri=T&&T.exports===he,q=ri&&ge.process,ni=function(){try{var e=T&&T.require&&T.require("util").types;return e||q&&q.binding&&q.binding("util")}catch{}}(),ne=ni,oe=ne&&ne.isTypedArray,Fr=oe?ii(oe):ei,oi=Object.prototype,Vr=oi.hasOwnProperty;function ai(e,t){return function(i){return e(t(i))}}var li=ai,qr=li(Object.keys,Object),si=Object.prototype,Gr=si.hasOwnProperty,ui=I(Object,"create"),j=ui;function di(){this.__data__=j?j(null):{},this.size=0}var ci=di;function pi(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var gi=pi,mi="__lodash_hash_undefined__",bi=Object.prototype,yi=bi.hasOwnProperty;function fi(e){var t=this.__data__;if(j){var i=t[e];return i===mi?void 0:i}return yi.call(t,e)?t[e]:void 0}var hi=fi,vi=Object.prototype,wi=vi.hasOwnProperty;function ki(e){var t=this.__data__;return j?t[e]!==void 0:wi.call(t,e)}var Ii=ki,xi="__lodash_hash_undefined__";function Ai(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=j&&t===void 0?xi:t,this}var Ci=Ai;function x(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}x.prototype.clear=ci;x.prototype.delete=gi;x.prototype.get=hi;x.prototype.has=Ii;x.prototype.set=Ci;var ae=x;function Si(){this.__data__=[],this.size=0}var Mi=Si;function Ei(e,t){for(var i=e.length;i--;)if(wt(e[i][0],t))return i;return-1}var O=Ei,Ti=Array.prototype,ji=Ti.splice;function Li(e){var t=this.__data__,i=O(t,e);if(i<0)return!1;var r=t.length-1;return i==r?t.pop():ji.call(t,i,1),--this.size,!0}var Di=Li;function Pi(e){var t=this.__data__,i=O(t,e);return i<0?void 0:t[i][1]}var $i=Pi;function Ni(e){return O(this.__data__,e)>-1}var Oi=Ni;function _i(e,t){var i=this.__data__,r=O(i,e);return r<0?(++this.size,i.push([e,t])):i[r][1]=t,this}var zi=_i;function A(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}A.prototype.clear=Mi;A.prototype.delete=Di;A.prototype.get=$i;A.prototype.has=Oi;A.prototype.set=zi;var _=A,Ui=I(g,"Map"),L=Ui;function Ri(){this.size=0,this.__data__={hash:new ae,map:new(L||_),string:new ae}}var Bi=Ri;function Fi(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Vi=Fi;function qi(e,t){var i=e.__data__;return Vi(t)?i[typeof t=="string"?"string":"hash"]:i.map}var z=qi;function Gi(e){var t=z(this,e).delete(e);return this.size-=t?1:0,t}var Yi=Gi;function Qi(e){return z(this,e).get(e)}var Ki=Qi;function Hi(e){return z(this,e).has(e)}var Zi=Hi;function Wi(e,t){var i=z(this,e),r=i.size;return i.set(e,t),this.size+=i.size==r?0:1,this}var Xi=Wi;function C(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}C.prototype.clear=Bi;C.prototype.delete=Yi;C.prototype.get=Ki;C.prototype.has=Zi;C.prototype.set=Xi;var ve=C;function Ji(){this.__data__=new _,this.size=0}var er=Ji;function tr(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}var ir=tr;function rr(e){return this.__data__.get(e)}var nr=rr;function or(e){return this.__data__.has(e)}var ar=or,lr=200;function sr(e,t){var i=this.__data__;if(i instanceof _){var r=i.__data__;if(!L||r.length<lr-1)return r.push([e,t]),this.size=++i.size,this;i=this.__data__=new ve(r)}return i.set(e,t),this.size=i.size,this}var ur=sr;function P(e){var t=this.__data__=new _(e);this.size=t.size}P.prototype.clear=er;P.prototype.delete=ir;P.prototype.get=nr;P.prototype.has=ar;P.prototype.set=ur;var dr=Object.prototype,Yr=dr.propertyIsEnumerable,cr=I(g,"DataView"),Q=cr,pr=I(g,"Promise"),K=pr,gr=I(g,"Set"),H=gr,le="[object Map]",mr="[object Object]",se="[object Promise]",ue="[object Set]",de="[object WeakMap]",ce="[object DataView]",br=y(Q),yr=y(L),fr=y(K),hr=y(H),vr=y(Y),w=D;(Q&&w(new Q(new ArrayBuffer(1)))!=ce||L&&w(new L)!=le||K&&w(K.resolve())!=se||H&&w(new H)!=ue||Y&&w(new Y)!=de)&&(w=function(e){var t=D(e),i=t==mr?e.constructor:void 0,r=i?y(i):"";if(r)switch(r){case br:return ce;case yr:return le;case fr:return se;case hr:return ue;case vr:return de}return t});var Qr=g.Uint8Array,wr="__lodash_hash_undefined__";function kr(e){return this.__data__.set(e,wr),this}var Ir=kr;function xr(e){return this.__data__.has(e)}var Ar=xr;function Z(e){var t=-1,i=e==null?0:e.length;for(this.__data__=new ve;++t<i;)this.add(e[t])}Z.prototype.add=Z.prototype.push=Ir;Z.prototype.has=Ar;var pe=k?k.prototype:void 0,Kr=pe?pe.valueOf:void 0,Cr=Object.prototype,Hr=Cr.hasOwnProperty,Sr=Object.prototype,Zr=Sr.hasOwnProperty,Wr=new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,"i"),Xr=new RegExp(/[A-Fa-f0-9]{1}/,"g"),Jr=new RegExp(/[A-Fa-f0-9]{2}/,"g");var Mr="ly.img.ai";function we(e){return`${Mr}.${e}`}var G="@imgly/plugin-ai-generation",en=`
2
+ <svg>
3
+ <symbol
4
+ fill="none"
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ viewBox="0 0 24 24"
7
+ id="@imgly/Sparkle"
8
+ >
9
+ <path d="M5.35545 2.06745C5.24149 1.72556 4.7579 1.72556 4.64394 2.06745L4.05898 3.82232C4.02166 3.93429 3.9338 4.02215 3.82184 4.05948L2.06694 4.64459C1.72506 4.75858 1.72509 5.24217 2.06699 5.3561L3.82179 5.9409C3.93378 5.97822 4.02166 6.06609 4.05899 6.17808L4.64394 7.93291C4.7579 8.2748 5.24149 8.2748 5.35545 7.93291L5.9404 6.17806C5.97773 6.06608 6.06559 5.97821 6.17757 5.94089L7.93242 5.35594C8.27431 5.24198 8.27431 4.75839 7.93242 4.64442L6.17757 4.05947C6.06559 4.02215 5.97773 3.93428 5.9404 3.8223L5.35545 2.06745Z" fill="currentColor"/>
10
+ <path d="M17.9632 3.23614C17.8026 2.80788 17.1968 2.80788 17.0362 3.23614L16.0787 5.78951C16.0285 5.92337 15.9229 6.02899 15.789 6.07918L13.2356 7.0367C12.8074 7.19729 12.8074 7.80307 13.2356 7.96366L15.789 8.92118C15.9229 8.97138 16.0285 9.077 16.0787 9.21085L17.0362 11.7642C17.1968 12.1925 17.8026 12.1925 17.9632 11.7642L18.9207 9.21086C18.9709 9.077 19.0765 8.97138 19.2104 8.92118L21.7637 7.96366C22.192 7.80307 22.192 7.1973 21.7637 7.0367L19.2104 6.07918C19.0765 6.02899 18.9709 5.92337 18.9207 5.78951L17.9632 3.23614Z" fill="currentColor"/>
11
+ <path d="M9.30058 7.82012C9.54712 7.1791 10.454 7.1791 10.7006 7.82012L12.3809 12.189C12.4571 12.3871 12.6136 12.5436 12.8117 12.6198L17.1806 14.3001C17.8216 14.5466 17.8216 15.4536 17.1806 15.7001L12.8117 17.3804C12.6136 17.4566 12.4571 17.6131 12.3809 17.8112L10.7006 22.1801C10.454 22.8211 9.54712 22.8211 9.30058 22.1801L7.62024 17.8112C7.54406 17.6131 7.38754 17.4566 7.18947 17.3804L2.82061 15.7001C2.17959 15.4536 2.17959 14.5466 2.82061 14.3001L7.18947 12.6198C7.38754 12.5436 7.54406 12.3871 7.62024 12.189L9.30058 7.82012Z" fill="currentColor"/>
12
+
13
+ </symbol>
14
+
15
+ <symbol
16
+ fill="none"
17
+ xmlns="http://www.w3.org/2000/svg"
18
+ viewBox="0 0 24 24"
19
+ id="${G}/image"
20
+ >
21
+ <path d="M3 16.5V18C3 19.6569 4.34315 21 6 21H18C19.6569 21 21 19.6569 21 18V6C21 4.34315 19.6569 3 18 3L17.999 5C18.5513 5 19 5.44772 19 6V18C19 18.5523 18.5523 19 18 19H6C5.44772 19 5 18.5523 5 18V16.5H3Z" fill="currentColor"/>
22
+ <path d="M13.0982 0.884877C12.9734 0.568323 12.5254 0.568322 12.4005 0.884876L11.7485 2.53819C11.7104 2.63483 11.6339 2.71134 11.5372 2.74945L9.8839 3.40151C9.56735 3.52636 9.56734 3.97436 9.8839 4.09921L11.5372 4.75126C11.6339 4.78938 11.7104 4.86588 11.7485 4.96253L12.4005 6.61584C12.5254 6.93239 12.9734 6.9324 13.0982 6.61584L13.7503 4.96253C13.7884 4.86588 13.8649 4.78938 13.9616 4.75126L15.6149 4.09921C15.9314 3.97436 15.9314 3.52636 15.6149 3.40151L13.9616 2.74945C13.8649 2.71134 13.7884 2.63483 13.7503 2.53819L13.0982 0.884877Z" fill="currentColor"/>
23
+ <path d="M6.40053 5.38488C6.52538 5.06832 6.97338 5.06832 7.09823 5.38488L8.17455 8.11392C8.21267 8.21057 8.28917 8.28707 8.38582 8.32519L11.1149 9.40151C11.4314 9.52636 11.4314 9.97436 11.1149 10.0992L8.38582 11.1755C8.28917 11.2136 8.21267 11.2901 8.17455 11.3868L7.09823 14.1158C6.97338 14.4324 6.52538 14.4324 6.40053 14.1158L5.32421 11.3868C5.2861 11.2901 5.20959 11.2136 5.11295 11.1755L2.3839 10.0992C2.06735 9.97436 2.06735 9.52636 2.3839 9.40151L5.11295 8.32519C5.20959 8.28707 5.2861 8.21057 5.32421 8.11392L6.40053 5.38488Z" fill="currentColor"/>
24
+ <path d="M18.9994 16.5008V18.0004C18.9994 18.5526 18.5517 19.0004 17.9994 19.0004H9.33302L14.3753 11.4369C14.6722 10.9916 15.3266 10.9916 15.6234 11.4369L18.9994 16.5008Z" fill="currentColor"/>
25
+
26
+ </symbol>
27
+ <symbol
28
+ fill="none"
29
+ xmlns="http://www.w3.org/2000/svg"
30
+ viewBox="0 0 24 24"
31
+ id="${G}/video"
32
+ >
33
+ <path d="M6 3C4.34315 3 3 4.34315 3 6V18C3 19.6569 4.34315 21 6 21H18C19.6569 21 21 19.6569 21 18V16.5H19V18C19 18.5523 18.5523 19 18 19H6C5.44772 19 5 18.5523 5 18V6C5 5.44772 5.44772 5 6 5V3Z" fill="currentColor"/>
34
+ <path d="M10.9025 0.8839C11.0273 0.567345 11.4753 0.567346 11.6002 0.883901L12.2522 2.53721C12.2904 2.63386 12.3669 2.71036 12.4635 2.74848L14.1168 3.40053C14.4334 3.52538 14.4334 3.97338 14.1168 4.09823L12.4635 4.75029C12.3669 4.7884 12.2904 4.86491 12.2522 4.96155L11.6002 6.61486C11.4753 6.93142 11.0273 6.93142 10.9025 6.61486L10.2504 4.96155C10.2123 4.86491 10.1358 4.7884 10.0392 4.75029L8.38585 4.09823C8.0693 3.97338 8.0693 3.52538 8.38585 3.40053L10.0392 2.74848C10.1358 2.71036 10.2123 2.63386 10.2504 2.53721L10.9025 0.8839Z" fill="currentColor"/>
35
+ <path d="M18.9019 3.3845C19.0267 3.06795 19.4747 3.06795 19.5996 3.3845L20.6759 6.11355C20.714 6.2102 20.7905 6.2867 20.8872 6.32482L23.6162 7.40114C23.9328 7.52598 23.9328 7.97399 23.6162 8.09883L20.8872 9.17515C20.7905 9.21327 20.714 9.28977 20.6759 9.38642L19.5996 12.1155C19.4747 12.432 19.0267 12.432 18.9019 12.1155L17.8255 9.38642C17.7874 9.28977 17.7109 9.21327 17.6143 9.17515L14.8852 8.09883C14.5687 7.97399 14.5687 7.52598 14.8852 7.40114L17.6143 6.32482C17.7109 6.2867 17.7874 6.2102 17.8255 6.11355L18.9019 3.3845Z" fill="currentColor"/>
36
+ <path d="M14.9994 13.2862C15.5089 12.8859 15.5089 12.1141 14.9995 11.7137L10.618 8.27047C9.96188 7.75485 9.00011 8.22225 9.00011 9.05673L9.00011 15.9429C9.00011 16.7773 9.96185 17.2448 10.618 16.7292L14.9994 13.2862Z" fill="currentColor"/>
37
+ </symbol>
38
+ <symbol
39
+ fill="none"
40
+ xmlns="http://www.w3.org/2000/svg"
41
+ viewBox="0 0 24 24"
42
+ id="${G}/audio"
43
+ >
44
+ <path d="M6 3.80273C4.2066 4.84016 3 6.77919 3 9.00004V12.8153C3 15.931 5.39501 18.4873 8.44444 18.7436V20.9645C8.44444 22.2198 9.89427 22.9198 10.8773 22.1392L15.1265 18.7647H15.5C17.8285 18.7647 19.8472 17.4384 20.8417 15.5H18.4187C17.6889 16.2784 16.6512 16.7647 15.5 16.7647H14.9522C14.6134 16.7647 14.2846 16.8794 14.0193 17.0901L10.4444 19.929V18.2597C10.4444 17.4341 9.77513 16.7647 8.9495 16.7647C7.80494 16.7647 6.77409 16.2779 6.05276 15.5H6V15.4419C5.37798 14.7439 5 13.8237 5 12.8153V9.00004C5 7.98559 5.37764 7.05935 6 6.35422V3.80273Z" fill="currentColor"/>
45
+ <path d="M11.6002 1.8839C11.4753 1.56735 11.0273 1.56735 10.9025 1.8839L10.2504 3.53721C10.2123 3.63386 10.1358 3.71036 10.0392 3.74848L8.38585 4.40053C8.0693 4.52538 8.0693 4.97338 8.38585 5.09823L10.0392 5.75029C10.1358 5.7884 10.2123 5.86491 10.2504 5.96155L10.9025 7.61486C11.0273 7.93142 11.4753 7.93142 11.6002 7.61486L12.2522 5.96155C12.2904 5.86491 12.3669 5.7884 12.4635 5.75029L14.1168 5.09823C14.4334 4.97338 14.4334 4.52538 14.1168 4.40053L12.4635 3.74848C12.3669 3.71036 12.2904 3.63386 12.2522 3.53721L11.6002 1.8839Z" fill="currentColor"/>
46
+ <path d="M19.5996 4.3845C19.4747 4.06795 19.0267 4.06795 18.9019 4.3845L17.8255 7.11355C17.7874 7.2102 17.7109 7.2867 17.6143 7.32482L14.8852 8.40114C14.5687 8.52598 14.5687 8.97399 14.8852 9.09883L17.6143 10.1752C17.7109 10.2133 17.7874 10.2898 17.8255 10.3864L18.9019 13.1155C19.0267 13.432 19.4747 13.432 19.5996 13.1155L20.6759 10.3864C20.714 10.2898 20.7905 10.2133 20.8872 10.1752L23.6162 9.09883C23.9328 8.97399 23.9328 8.52598 23.6162 8.40114L20.8872 7.32482C20.7905 7.2867 20.714 7.2102 20.6759 7.11355L19.5996 4.3845Z" fill="currentColor"/>
47
+ </symbol>
48
+ <symbol
49
+ fill="none"
50
+ xmlns="http://www.w3.org/2000/svg"
51
+ viewBox="0 0 24 24"
52
+ id="@imgly/MixingPlate"
53
+ >
54
+ <path d="M9.75 9C10.5784 9 11.25 8.32843 11.25 7.5C11.25 6.67157 10.5784 6 9.75 6C8.92157 6 8.25 6.67157 8.25 7.5C8.25 8.32843 8.92157 9 9.75 9Z" fill="currentColor"/>
55
+ <path d="M7 13C7.82843 13 8.5 12.3284 8.5 11.5C8.5 10.6716 7.82843 10 7 10C6.17157 10 5.5 10.6716 5.5 11.5C5.5 12.3284 6.17157 13 7 13Z" fill="currentColor"/>
56
+ <path d="M15.75 7.5C15.75 8.32843 15.0784 9 14.25 9C13.4216 9 12.75 8.32843 12.75 7.5C12.75 6.67157 13.4216 6 14.25 6C15.0784 6 15.75 6.67157 15.75 7.5Z" fill="currentColor"/>
57
+ <path d="M17 13C17.8284 13 18.5 12.3284 18.5 11.5C18.5 10.6716 17.8284 10 17 10C16.1716 10 15.5 10.6716 15.5 11.5C15.5 12.3284 16.1716 13 17 13Z" fill="currentColor"/>
58
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8.26309 2.77709C10.6681 1.77921 13.4829 1.7322 15.9209 2.64297C18.1572 3.47923 20.0876 5.09285 21.1766 7.28598C22.3395 9.62772 22.4889 13.1077 20.3864 15.2982C19.2693 16.4621 17.7657 16.9982 16.0026 16.9997C15.7897 16.9997 15.5555 16.9864 15.3497 16.9745C15.309 16.9722 15.2694 16.9699 15.2313 16.9679C14.9817 16.9542 14.761 16.9455 14.5569 16.9539C14.124 16.9718 13.9598 17.0612 13.89 17.1324C13.718 17.3081 13.6946 17.6672 13.8854 17.8895C14.2899 18.3608 14.5016 18.9277 14.5016 19.5497C14.5016 20.2206 14.3086 20.9011 13.7542 21.3896C13.2471 21.837 12.6082 21.9997 11.9635 21.9997C10.6049 21.9997 9.31155 21.7367 8.0934 21.2067C6.89058 20.6831 5.84501 19.9687 4.94363 19.0666C4.04281 18.1651 3.31836 17.107 2.79369 15.8978C1.72761 13.4409 1.72662 10.5261 2.81247 8.07034C3.88024 5.65548 5.84206 3.78161 8.26309 2.77709ZM15.2207 4.51639C13.2556 3.78239 10.9651 3.82132 9.02956 4.62439C7.06888 5.43791 5.49559 6.94785 4.64163 8.87914C3.78373 10.8194 3.78253 13.1522 4.62841 15.1017C5.05312 16.0805 5.63511 16.9291 6.35838 17.6529C7.08102 18.3761 7.91671 18.9484 8.89123 19.3728C9.8492 19.7895 10.87 19.9997 11.9635 19.9997C12.2815 19.9997 12.394 19.9225 12.431 19.8899L12.4319 19.8891C12.4367 19.8849 12.4487 19.8743 12.4631 19.8359C12.4799 19.7911 12.5016 19.7024 12.5016 19.5497C12.5016 19.4091 12.4633 19.3034 12.3677 19.192C11.5353 18.222 11.5272 16.6868 12.4611 15.7331C13.0741 15.1071 13.8844 14.98 14.4745 14.9556C14.7819 14.943 15.085 14.9568 15.3409 14.9709C15.3906 14.9736 15.4379 14.9763 15.4832 14.9788C15.6876 14.9904 15.8508 14.9997 16.0009 14.9997C17.3405 14.9986 18.2792 14.6054 18.9435 13.9133C20.2633 12.5382 20.3186 10.055 19.3853 8.1755C18.5436 6.48051 17.0293 5.19281 15.2207 4.51639Z" fill="currentColor"/>
59
+
60
+ </symbol>
61
+ </svg>
62
+ `;var ke={openapi:"3.0.0",info:{title:"Elevenlabs API",version:"1.0.0",description:"Elevenlabs API"},components:{schemas:{ElevenlabsInput:{title:"TextToSpeechInput",type:"object",properties:{prompt:{title:"Prompt",type:"string","x-imgly-builder":{component:"TextArea"}},voice_id:{title:"Voice",type:"string",description:"The voice ID to use for the speech synthesis.",default:"JBFqnCBsd6RMkjVDRZzb"},speed:{title:"Speed",type:"number",description:"The speed of the speech synthesis.",default:1,"x-imgly-step":.05,minimum:.7,maximum:1.2}},"x-elevenlabs-order-properties":["prompt","style","image_size"],required:["prompt","voice_id"]}}}};var Ie={version:"2.0.0",id:"ly.img.voices.eleventlabs",assets:[{id:"JBFqnCBsd6RMkjVDRZzb",label:{en:"George"},tags:{en:["British Accent","warm","middle aged","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/JBFqnCBsd6RMkjVDRZzb/e6206d1a-0721-4787-aafb-06a6e705cac5.mp3",thumbUri:"{{base_url}}george.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.42"}},{id:"FGY2WhTYpPnrIDTdsKH5",label:{en:"Laura"},tags:{en:["American Accent","upbeat","young","female","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/FGY2WhTYpPnrIDTdsKH5/67341759-ad08-41a5-be6e-de12fe448618.mp3",thumbUri:"{{base_url}}laura.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.04"}},{id:"IKne3meq5aSn9XLyUdCD",label:{en:"Charlie"},tags:{en:["Australian Accent","natural","middle aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/IKne3meq5aSn9XLyUdCD/102de6f2-22ed-43e0-a1f1-111fa75c5481.mp3",thumbUri:"{{base_url}}charlie.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.53"}},{id:"9BWtsMINqrJLrRacOk9x",label:{en:"Aria"},tags:{en:["American Accent","expressive","middle-aged","female","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/9BWtsMINqrJLrRacOk9x/405766b8-1f4e-4d3c-aba1-6f25333823ec.mp3",thumbUri:"{{base_url}}aria.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.71"}},{id:"EXAVITQu4vr4xnSDxMaL",label:{en:"Sarah"},tags:{en:["american Accent","soft","young","female","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/EXAVITQu4vr4xnSDxMaL/01a3e33c-6e99-4ee7-8543-ff2216a32186.mp3",thumbUri:"{{base_url}}sarah2.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.53"}},{id:"SAz9YHcvj6GT2YYXdXww",label:{en:"River"},tags:{en:["American Accent","confident","middle-aged","non-binary","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/SAz9YHcvj6GT2YYXdXww/e6c95f0b-2227-491a-b3d7-2249240decb7.mp3",thumbUri:"{{base_url}}river.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.53"}},{id:"XrExE9yKIg1WjnnlVkGX",label:{en:"Matilda"},tags:{en:["American Accent","friendly","middle-aged","female","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/XrExE9yKIg1WjnnlVkGX/b930e18d-6b4d-466e-bab2-0ae97c6d8535.mp3",thumbUri:"{{base_url}}matilda.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.64"}},{id:"N2lVS1w4EtoT3dr4eOWO",label:{en:"Callum"},tags:{en:["Transatlantic Accent","intense","middle-aged","male","characters"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/N2lVS1w4EtoT3dr4eOWO/ac833bd8-ffda-4938-9ebc-b0f99ca25481.mp3",thumbUri:"{{base_url}}callum.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"4.18"}},{id:"TX3LPaxmHKxFdv7VOQHJ",label:{en:"Liam"},tags:{en:["American Accent","articulate","young","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/TX3LPaxmHKxFdv7VOQHJ/63148076-6363-42db-aea8-31424308b92c.mp3",thumbUri:"{{base_url}}liam.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"4.13"}},{id:"XB0fDUnXU5powFXDhCwa",label:{en:"Charlotte"},tags:{en:["Swedish Accent","seductive","young","female","characters"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/XB0fDUnXU5powFXDhCwa/942356dc-f10d-4d89-bda5-4f8505ee038b.mp3",thumbUri:"{{base_url}}charlotte.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.25"}},{id:"CwhRBWXzGAHq8TQ4Fs17",label:{en:"Roger"},tags:{en:["American Accent","confident","middle-aged","male","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/CwhRBWXzGAHq8TQ4Fs17/58ee3ff5-f6f2-4628-93b8-e38eb31806b0.mp3",thumbUri:"{{base_url}}roger.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.89"}},{id:"nPczCjzI2devNBz1zQrb",label:{en:"Brian"},tags:{en:["American Accent","deep","middle-aged","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/nPczCjzI2devNBz1zQrb/2dd3e72c-4fd3-42f1-93ea-abc5d4e5aa1d.mp3",thumbUri:"{{base_url}}brian.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.46"}},{id:"cgSgspJ2msm6clMCkdW9",label:{en:"Jessica"},tags:{en:["American Accent","expressive","young","female","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/cgSgspJ2msm6clMCkdW9/56a97bf8-b69b-448f-846c-c3a11683d45a.mp3",thumbUri:"{{base_url}}jessica.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.89"}},{id:"Xb7hH8MSUJpSbSDYk0k2",label:{en:"Alice"},tags:{en:["British Accent","confident","middle-aged","female","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/Xb7hH8MSUJpSbSDYk0k2/d10f7534-11f6-41fe-a012-2de1e482d336.mp3",thumbUri:"{{base_url}}alice.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.53"}},{id:"pFZP5JQG7iQjIQuC4Bku",label:{en:"Lily"},tags:{en:["British Accent","warm","middle-aged","female","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/pFZP5JQG7iQjIQuC4Bku/89b68b35-b3dd-4348-a84a-a3c13a3c2b30.mp3",thumbUri:"{{base_url}}lily.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.11"}},{id:"cjVigY5qzO86Huf0OWal",label:{en:"Eric"},tags:{en:["American Accent","friendly","middle-aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/cjVigY5qzO86Huf0OWal/d098fda0-6456-4030-b3d8-63aa048c9070.mp3",thumbUri:"{{base_url}}eric.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.32"}},{id:"bIHbv24MWmeRgasZH58o",label:{en:"Will"},tags:{en:["American Accent","friendly","young","male","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/bIHbv24MWmeRgasZH58o/8caf8f3d-ad29-4980-af41-53f20c72d7a4.mp3",thumbUri:"{{base_url}}will.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.74"}},{id:"iP95p4xoKVk53GoZ742B",label:{en:"Chris"},tags:{en:["American Accent","casual","middle-aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/iP95p4xoKVk53GoZ742B/3f4bde72-cc48-40dd-829f-57fbf906f4d7.mp3",thumbUri:"{{base_url}}chris.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.29"}},{id:"pqHfZKP75CvOlQylNhV4",label:{en:"Bill"},tags:{en:["American Accent","trustworthy","old","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/pqHfZKP75CvOlQylNhV4/d782b3ff-84ba-4029-848c-acf01285524d.mp3",thumbUri:"{{base_url}}bill.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.51"}},{id:"onwK4e9ZLuTAKqWW03F9",label:{en:"Daniel"},tags:{en:["British Accent","authoritative","middle-aged","male","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/onwK4e9ZLuTAKqWW03F9/7eee0236-1a72-4b86-b303-5dcadc007ba9.mp3",thumbUri:"{{base_url}}daniel.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.75"}}]};function xe(e,t,i){return Math.min(Math.max(e,t),i)}async function U(e){return new Promise((t,i)=>{let r=new Audio;r.src=e,r.addEventListener("loadedmetadata",()=>{let n=r.duration;t(n)}),r.addEventListener("error",n=>{i(new Error(`Failed to load audio metadata: ${n.message}`))})})}var jr={width:256,height:256,backgroundColor:"transparent",waveformColor:"black",pixelsPerSecond:100};async function R(e,t={}){let{width:i,height:r,backgroundColor:n,waveformColor:u,pixelsPerSecond:a}={...jr,...t},p=new AudioContext,l=await e.arrayBuffer(),s=await p.decodeAudioData(l),d=s.duration,c=Math.max(i,Math.ceil(d*a)),$=s.sampleRate*d/c,h=document.createElement("canvas");h.width=i,h.height=r;let m=h.getContext("2d");m.fillStyle=n,m.fillRect(0,0,i,r);let Me=s.getChannelData(0),S=r/2,Ee=s.length;m.strokeStyle=u,m.beginPath(),m.moveTo(0,S);for(let b=0;b<i;b++){let M=1,v=-1;for(let F=0;F<$;F++){let X=Math.floor(b*$+F);if(X<Ee){let N=Me[X];N<M&&(M=N),N>v&&(v=N)}}let Te=S-M*S,je=S-v*S;m.lineTo(b,je),m.lineTo(b,Te)}return m.stroke(),new Promise((b,M)=>{h.toBlob(v=>{v?b(v):M(new Error("Canvas to Blob conversion failed"))})})}function B(e,t,i={}){let{ellipsis:r="...",preserveSentences:n=!1,minLength:u=0}=i;if(!e||e.length<=u||e.length<=t)return e;let a=t-r.length;if(n){let s=/[.!?](?:\s|$)/g,d,c=0;for(;(d=s.exec(e))!==null&&!(d.index>a);)c=d.index+1;if(c>0)return e.substring(0,c)+r}let p=e.substring(0,a),l=p.lastIndexOf(" ");return l>0&&(p=p.substring(0,l)),p+r}function Ae(e){return async({cesdk:t})=>Lr(t,e)}function Lr(e,t){let i=t.baseURL??"https://cdn.img.ly/assets/plugins/plugin-ai-audio-generation-web/v1/elevenlabs/",r="ly.img.ai.audio-generation.speech.elevenlabs",n=`${r}.voiceSelection`,u=Pr(e,i),a="elevenlabs/monolingual/v1";return e.setTranslations({en:{[`panel.${a}`]:"AI Voice",[`panel.${n}`]:"Select a Voice",[`panel.${we("elevenlabs")}`]:"AI Voice",[`libraries.${a}.history.label`]:"AI Voice","libraries.elevenlabs/sound-generation.history.label":"Generated Sound"}}),{id:a,name:"Elevenlabs Multilingual V2",kind:"audio",initialize:async()=>{e.ui.addAssetLibraryEntry({id:u,sourceIds:[u],gridColumns:3}),e.ui.registerPanel(n,({builder:l,payload:s})=>{l.Library(`${r}.voiceSelection.library`,{searchable:!0,entries:[u],onSelect:async d=>{let{id:c,label:f}=d;s?.onSelect(c,f??c,d.meta?.thumbUri),e.ui.closePanel(n)}})})},input:{panel:{type:"schema",document:ke,inputReference:"#/components/schemas/ElevenlabsInput",useFlow:"generation-only",renderCustomProperty:{voice_id:l=>{let s=l.experimental.global("voice",{voiceId:"JBFqnCBsd6RMkjVDRZzb",name:"George",thumbnail:`${i}george.webp`});return l.builder.Button(`${r}.openVoiceSelection`,{inputLabel:"Voice",icon:"@imgly/Appearance",trailingIcon:"@imgly/ChevronRight",labelAlignment:"left",label:s.value.name,onClick:()=>{e.ui.openPanel(n,{payload:{id:s.value.voiceId,onSelect:(d,c,f)=>{s.setValue({voiceId:d,name:c,thumbnail:f})}}})}}),()=>({id:"voice_id",type:"string",value:s.value.voiceId})}},getBlockInput:async l=>({audio:{label:B(l.prompt,25)}})}},output:{abortable:!0,history:"@imgly/indexedDB",middleware:t.middlewares??t.middleware??[],generate:async(l,{abortSignal:s})=>{let d=await Dr(l.prompt,l.voice_id,{speed:parseFloat(l.speed.toFixed(10))},t,s),c=URL.createObjectURL(d),[f,$]=await Promise.all([R(d,{width:512,height:128}),U(c)]),h=URL.createObjectURL(f);return{kind:"audio",url:c,duration:$,thumbnailUrl:h}}},config:t}}async function Dr(e,t,i,r,n){let u=`${r.proxyUrl}/v1/text-to-speech/${t}`,a=await fetch(u,{signal:n,method:"POST",headers:{Accept:"audio/mpeg","Content-Type":"application/json",...r.headers??{}},body:JSON.stringify({text:e,model_id:"eleven_multilingual_v2",voice_settings:{speed:xe(i?.speed||1,.7,1.2),stability:i?.stability||.5,similarity_boost:i?.similarityBoost||.5}})});if(!a.ok){let p=await a.text();throw new Error(`API error: ${a.status} - ${p}`)}return a.blob()}function Pr(e,t){let{id:i,assets:r}=Ie;return e.engine.asset.addLocalSource(i),r.map(async n=>{e.engine.asset.addAssetToSource(i,{...n,meta:{...n.meta,thumbUri:n.meta.thumbUri.replace("{{base_url}}",`${t}thumbnails/`)}})}),i}var Ce={openapi:"3.0.0",info:{title:"Elevenlabs Sound Effects API",version:"1.0.0",description:"Elevenlabs Sound Effects API"},components:{schemas:{TextToSoundInput:{title:"TextToSoundInput",type:"object",properties:{text:{title:"Prompt",type:"string","x-imgly-builder":{component:"TextArea"}},duration_seconds:{title:"Duration (sec.)",type:"number",minimum:.6,maximum:22,default:2}},"x-elevenlabs-order-properties":["text"],required:["text"]}}}};function Se(e){return async({cesdk:t})=>Nr(t,e)}function Nr(e,t){let i="elevenlabs/sound-generation";return e.setTranslations({en:{[`panel.${i}`]:"Generate Sound"}}),{id:i,name:"Elevenlabs Sound Generation",kind:"audio",initialize:async()=>{},input:{panel:{type:"schema",document:Ce,inputReference:"#/components/schemas/TextToSoundInput",useFlow:"generation-only",getBlockInput:async n=>({audio:{label:B(n.text,25)}})}},output:{abortable:!0,history:"@imgly/indexedDB",middleware:t.middlewares??t.middleware??[],generate:async(n,{abortSignal:u})=>{let a=await Or(n.text,n.duration_seconds,t,u),p=URL.createObjectURL(a),[l,s]=await Promise.all([R(a,{width:512,height:128}),U(p)]),d=URL.createObjectURL(l);return{kind:"audio",url:p,duration:s,thumbnailUrl:d}}},config:t}}async function Or(e,t,i,r){let n=`${i.proxyUrl}/v1/sound-generation`,u=await fetch(n,{signal:r,method:"POST",headers:{Accept:"audio/mpeg","Content-Type":"application/json",...i.headers??{}},body:JSON.stringify({text:e,duration_seconds:t})});if(!u.ok){let a=await u.text();throw new Error(`API error: ${u.status} - ${a}`)}return u.blob()}var _r={ElevenMultilingualV2:Ae,ElevenSoundEffects:Se},hn=_r;export{hn as default};
63
+ /*! Bundled license information:
64
+
65
+ @imgly/plugin-ai-generation-web/dist/index.mjs:
66
+ (*! Bundled license information:
67
+
68
+ @imgly/plugin-utils/dist/index.mjs:
69
+ (*! Bundled license information:
70
+
71
+ lodash-es/lodash.js:
72
+ (**
73
+ * @license
74
+ * Lodash (Custom Build) <https://lodash.com/>
75
+ * Build: `lodash modularize exports="es" -o ./`
76
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
77
+ * Released under MIT license <https://lodash.com/license>
78
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
79
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
80
+ *)
81
+ *)
82
+ *)
83
+ */
2
84
  //# sourceMappingURL=index.mjs.map