@deepgram/sdk 4.11.1 → 4.11.2
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/README.md +230 -17
- package/dist/main/lib/version.d.ts +1 -1
- package/dist/main/lib/version.js +1 -1
- package/dist/main/packages/AbstractLiveClient.d.ts.map +1 -1
- package/dist/main/packages/AbstractLiveClient.js +2 -2
- package/dist/main/packages/AbstractLiveClient.js.map +1 -1
- package/dist/module/lib/version.d.ts +1 -1
- package/dist/module/lib/version.js +1 -1
- package/dist/module/packages/AbstractLiveClient.d.ts.map +1 -1
- package/dist/module/packages/AbstractLiveClient.js +2 -2
- package/dist/module/packages/AbstractLiveClient.js.map +1 -1
- package/dist/umd/deepgram.js +1 -1
- package/package.json +1 -1
- package/src/lib/version.ts +1 -1
- package/src/packages/AbstractLiveClient.ts +2 -3
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
> 🎯 **Development Setup**: This project uses [Corepack](https://nodejs.org/api/corepack.html) for package manager consistency. Run `corepack enable` once, then use `pnpm` commands normally. See [DEVELOPMENT.md](./DEVELOPMENT.md) for details.
|
|
6
6
|
|
|
7
7
|
<!-- TOC -->
|
|
8
|
+
|
|
8
9
|
- [Documentation](#documentation)
|
|
9
10
|
- [Migrating from earlier versions](#migrating-from-earlier-versions)
|
|
10
11
|
- [V2 to V3](#v2-to-v3)
|
|
@@ -13,7 +14,14 @@
|
|
|
13
14
|
- [Installation](#installation)
|
|
14
15
|
- [UMD](#umd)
|
|
15
16
|
- [ESM](#esm)
|
|
16
|
-
- [
|
|
17
|
+
- [Authentication](#authentication)
|
|
18
|
+
- [1. API Key Authentication (Recommended)](#1-api-key-authentication-recommended)
|
|
19
|
+
- [2. Access Token Authentication](#2-access-token-authentication)
|
|
20
|
+
- [3. Proxy Authentication](#3-proxy-authentication)
|
|
21
|
+
- [Getting Credentials](#getting-credentials)
|
|
22
|
+
- [API Keys](#api-keys)
|
|
23
|
+
- [Access Tokens](#access-tokens)
|
|
24
|
+
- [Environment Variables](#environment-variables)
|
|
17
25
|
- [Getting an API Key](#getting-an-api-key)
|
|
18
26
|
- [Scoped Configuration](#scoped-configuration)
|
|
19
27
|
- [Global Defaults](#global-defaults)
|
|
@@ -38,9 +46,9 @@
|
|
|
38
46
|
- [Single-Request](#single-request)
|
|
39
47
|
- [Continuous Text Stream (WebSocket)](#continuous-text-stream-websocket)
|
|
40
48
|
- [Text Intelligence](#text-intelligence)
|
|
41
|
-
- [
|
|
49
|
+
- [Token Management](#token-management)
|
|
42
50
|
- [Get Token Details](#get-token-details)
|
|
43
|
-
- [Grant Token](#grant-token)
|
|
51
|
+
- [Grant Access Token](#grant-access-token)
|
|
44
52
|
- [Projects](#projects)
|
|
45
53
|
- [Get Projects](#get-projects)
|
|
46
54
|
- [Get Project](#get-project)
|
|
@@ -67,11 +75,12 @@
|
|
|
67
75
|
- [Get Request](#get-request)
|
|
68
76
|
- [Summarize Usage](#summarize-usage)
|
|
69
77
|
- [Get Fields](#get-fields)
|
|
70
|
-
- [Summarize Usage](#summarize-usage)
|
|
78
|
+
- [Summarize Usage (Deprecated)](#summarize-usage-1)
|
|
71
79
|
- [Billing](#billing)
|
|
72
80
|
- [Get All Balances](#get-all-balances)
|
|
73
81
|
- [Get Balance](#get-balance)
|
|
74
82
|
- [Models](#models)
|
|
83
|
+
- [Get All Models](#get-all-models)
|
|
75
84
|
- [Get All Project Models](#get-all-project-models)
|
|
76
85
|
- [Get Model](#get-model)
|
|
77
86
|
- [On-Prem APIs](#on-prem-apis)
|
|
@@ -163,18 +172,88 @@ You can now use type="module" `<script>`s to import deepgram from CDNs, like:
|
|
|
163
172
|
</script>
|
|
164
173
|
```
|
|
165
174
|
|
|
166
|
-
##
|
|
175
|
+
## Authentication
|
|
176
|
+
|
|
177
|
+
The Deepgram SDK supports three authentication methods:
|
|
167
178
|
|
|
168
|
-
|
|
179
|
+
### 1. API Key Authentication (Recommended)
|
|
180
|
+
|
|
181
|
+
Uses `Token` scheme in Authorization header.
|
|
169
182
|
|
|
170
183
|
```js
|
|
171
184
|
import { createClient } from "@deepgram/sdk";
|
|
172
|
-
// - or -
|
|
173
|
-
// const { createClient } = require("@deepgram/sdk");
|
|
174
185
|
|
|
175
|
-
|
|
186
|
+
// Method 1: Pass API key as first parameter
|
|
187
|
+
const deepgramClient = createClient("YOUR_DEEPGRAM_API_KEY");
|
|
188
|
+
|
|
189
|
+
// Method 2: Pass API key in options object
|
|
190
|
+
const deepgramClient = createClient({ key: "YOUR_DEEPGRAM_API_KEY" });
|
|
191
|
+
|
|
192
|
+
// Method 3: Use environment variable (DEEPGRAM_API_KEY)
|
|
193
|
+
const deepgramClient = createClient();
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### 2. Access Token Authentication
|
|
197
|
+
|
|
198
|
+
Uses `Bearer` scheme in Authorization header. Access tokens are temporary (30-second TTL) and must be obtained using an API key.
|
|
199
|
+
|
|
200
|
+
```js
|
|
201
|
+
import { createClient } from "@deepgram/sdk";
|
|
202
|
+
|
|
203
|
+
// Must use accessToken property in options object
|
|
204
|
+
const deepgramClient = createClient({ accessToken: "YOUR_ACCESS_TOKEN" });
|
|
205
|
+
|
|
206
|
+
// Or use environment variable (DEEPGRAM_ACCESS_TOKEN)
|
|
207
|
+
const deepgramClient = createClient();
|
|
176
208
|
```
|
|
177
209
|
|
|
210
|
+
### 3. Proxy Authentication
|
|
211
|
+
|
|
212
|
+
For browser environments or custom proxy setups. Pass `"proxy"` as the API key.
|
|
213
|
+
|
|
214
|
+
```js
|
|
215
|
+
import { createClient } from "@deepgram/sdk";
|
|
216
|
+
|
|
217
|
+
const deepgramClient = createClient("proxy", {
|
|
218
|
+
global: { fetch: { options: { proxy: { url: "http://localhost:8080" } } } },
|
|
219
|
+
});
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
> **Important**: Your proxy must set the `Authorization: token DEEPGRAM_API_KEY` header and forward requests to Deepgram's API.
|
|
223
|
+
|
|
224
|
+
### Getting Credentials
|
|
225
|
+
|
|
226
|
+
#### API Keys
|
|
227
|
+
|
|
228
|
+
Create API keys via the Management API:
|
|
229
|
+
|
|
230
|
+
```js
|
|
231
|
+
const { result, error } = await deepgramClient.manage.createProjectKey(projectId, {
|
|
232
|
+
comment: "My API key",
|
|
233
|
+
scopes: ["usage:write"],
|
|
234
|
+
});
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Endpoint**: `POST https://api.deepgram.com/v1/projects/:projectId/keys`
|
|
238
|
+
|
|
239
|
+
#### Access Tokens
|
|
240
|
+
|
|
241
|
+
Generate temporary access tokens (requires existing API key):
|
|
242
|
+
|
|
243
|
+
```js
|
|
244
|
+
const { result, error } = await deepgramClient.auth.grantToken();
|
|
245
|
+
// Returns: { access_token: string, expires_in: 30 }
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**Endpoint**: `POST https://api.deepgram.com/v1/auth/grant`
|
|
249
|
+
|
|
250
|
+
### Environment Variables
|
|
251
|
+
|
|
252
|
+
The SDK automatically checks for credentials in this priority order:
|
|
253
|
+
|
|
254
|
+
1. `DEEPGRAM_ACCESS_TOKEN` (highest priority)
|
|
255
|
+
2. `DEEPGRAM_API_KEY` (fallback)
|
|
256
|
+
|
|
178
257
|
### Getting an API Key
|
|
179
258
|
|
|
180
259
|
🔑 To access the Deepgram API you will need a [free Deepgram API Key](https://console.deepgram.com/signup?jump=keys).
|
|
@@ -289,16 +368,51 @@ Useful for many things.
|
|
|
289
368
|
```js
|
|
290
369
|
import { createClient } from "@deepgram/sdk";
|
|
291
370
|
|
|
292
|
-
const deepgramClient = createClient(
|
|
371
|
+
const deepgramClient = createClient({
|
|
293
372
|
global: { fetch: { options: { headers: { "x-custom-header": "foo" } } } },
|
|
294
373
|
});
|
|
295
374
|
```
|
|
296
375
|
|
|
297
376
|
## Browser Usage
|
|
298
377
|
|
|
299
|
-
|
|
378
|
+
The SDK works in modern browsers with some considerations:
|
|
379
|
+
|
|
380
|
+
### WebSocket Features (Full Support)
|
|
381
|
+
|
|
382
|
+
- **Live Transcription**: ✅ Direct connection to `wss://api.deepgram.com`
|
|
383
|
+
- **Voice Agent**: ✅ Direct connection to `wss://agent.deepgram.com`
|
|
384
|
+
- **Live Text-to-Speech**: ✅ Direct connection to `wss://api.deepgram.com`
|
|
385
|
+
|
|
386
|
+
### REST API Features (Proxy Required)
|
|
387
|
+
|
|
388
|
+
- **Pre-recorded Transcription**: ⚠️ Requires proxy due to CORS
|
|
389
|
+
- **Text Intelligence**: ⚠️ Requires proxy due to CORS
|
|
390
|
+
- **Management APIs**: ⚠️ Requires proxy due to CORS
|
|
391
|
+
|
|
392
|
+
### Setup Options
|
|
393
|
+
|
|
394
|
+
#### Option 1: CDN (UMD)
|
|
395
|
+
|
|
396
|
+
```html
|
|
397
|
+
<script src="https://cdn.jsdelivr.net/npm/@deepgram/sdk"></script>
|
|
398
|
+
<script>
|
|
399
|
+
const { createClient } = deepgram;
|
|
400
|
+
const deepgramClient = createClient("YOUR_API_KEY");
|
|
401
|
+
</script>
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
#### Option 2: CDN (ESM)
|
|
300
405
|
|
|
301
|
-
|
|
406
|
+
```html
|
|
407
|
+
<script type="module">
|
|
408
|
+
import { createClient } from "https://cdn.jsdelivr.net/npm/@deepgram/sdk/+esm";
|
|
409
|
+
const deepgramClient = createClient("YOUR_API_KEY");
|
|
410
|
+
</script>
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
#### Option 3: Proxy for REST APIs
|
|
414
|
+
|
|
415
|
+
See [proxy requests in the browser](#proxy-requests-in-the-browser) for REST API access.
|
|
302
416
|
|
|
303
417
|
## Transcription
|
|
304
418
|
|
|
@@ -316,6 +430,8 @@ const { result, error } = await deepgramClient.listen.prerecorded.transcribeUrl(
|
|
|
316
430
|
);
|
|
317
431
|
```
|
|
318
432
|
|
|
433
|
+
**API Endpoint**: `POST https://api.deepgram.com/v1/listen`
|
|
434
|
+
|
|
319
435
|
[See our API reference for more info](https://developers.deepgram.com/reference/speech-to-text-api/listen).
|
|
320
436
|
|
|
321
437
|
### Local Files
|
|
@@ -332,6 +448,8 @@ const { result, error } = await deepgramClient.listen.prerecorded.transcribeFile
|
|
|
332
448
|
);
|
|
333
449
|
```
|
|
334
450
|
|
|
451
|
+
**API Endpoint**: `POST https://api.deepgram.com/v1/listen`
|
|
452
|
+
|
|
335
453
|
[See our API reference for more info](https://developers.deepgram.com/reference/speech-to-text-api/listen).
|
|
336
454
|
|
|
337
455
|
### Callbacks / Async
|
|
@@ -351,6 +469,8 @@ const { result, error } = await deepgramClient.listen.prerecorded.transcribeUrlC
|
|
|
351
469
|
);
|
|
352
470
|
```
|
|
353
471
|
|
|
472
|
+
**API Endpoint**: `POST https://api.deepgram.com/v1/listen?callback=http://callback/endpoint`
|
|
473
|
+
|
|
354
474
|
[See our API reference for more info](https://developers.deepgram.com/reference/speech-to-text-api/listen).
|
|
355
475
|
|
|
356
476
|
### Live Transcription (WebSocket)
|
|
@@ -374,6 +494,8 @@ deepgramConnection.on(LiveTranscriptionEvents.Open, () => {
|
|
|
374
494
|
});
|
|
375
495
|
```
|
|
376
496
|
|
|
497
|
+
**WebSocket Endpoint**: `wss://api.deepgram.com/v1/listen`
|
|
498
|
+
|
|
377
499
|
[See our API reference for more info](https://developers.deepgram.com/reference/speech-to-text-api/listen-streaming).
|
|
378
500
|
|
|
379
501
|
### Captions
|
|
@@ -424,6 +546,8 @@ deepgramConnection.on(AgentEvents.Open, () => {
|
|
|
424
546
|
});
|
|
425
547
|
```
|
|
426
548
|
|
|
549
|
+
**WebSocket Endpoint**: `wss://agent.deepgram.com/v1/agent/converse`
|
|
550
|
+
|
|
427
551
|
[See our API reference for more info](https://developers.deepgram.com/reference/voice-agent-api/agent).
|
|
428
552
|
|
|
429
553
|
## Text to Speech
|
|
@@ -442,6 +566,8 @@ const { result } = await deepgramClient.speak.request(
|
|
|
442
566
|
);
|
|
443
567
|
```
|
|
444
568
|
|
|
569
|
+
**API Endpoint**: `POST https://api.deepgram.com/v1/speak`
|
|
570
|
+
|
|
445
571
|
[See our API reference for more info](https://developers.deepgram.com/reference/text-to-speech-api/speak).
|
|
446
572
|
|
|
447
573
|
### Continuous Text Stream (WebSocket)
|
|
@@ -469,6 +595,8 @@ deepgramConnection.on(LiveTTSEvents.Open, () => {
|
|
|
469
595
|
});
|
|
470
596
|
```
|
|
471
597
|
|
|
598
|
+
**WebSocket Endpoint**: `wss://api.deepgram.com/v1/speak`
|
|
599
|
+
|
|
472
600
|
[See our API reference for more info](https://developers.deepgram.com/reference/text-to-speech-api/speak-streaming).
|
|
473
601
|
|
|
474
602
|
## Text Intelligence
|
|
@@ -489,9 +617,11 @@ const { result, error } = await deepgramClient.read.analyzeText(
|
|
|
489
617
|
);
|
|
490
618
|
```
|
|
491
619
|
|
|
620
|
+
**API Endpoint**: `POST https://api.deepgram.com/v1/read`
|
|
621
|
+
|
|
492
622
|
[See our API reference for more info](https://developers.deepgram.com/reference/text-intelligence-api/text-read).
|
|
493
623
|
|
|
494
|
-
##
|
|
624
|
+
## Token Management
|
|
495
625
|
|
|
496
626
|
### Get Token Details
|
|
497
627
|
|
|
@@ -501,17 +631,26 @@ Retrieves the details of the current authentication token.
|
|
|
501
631
|
const { result, error } = await deepgramClient.manage.getTokenDetails();
|
|
502
632
|
```
|
|
503
633
|
|
|
634
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/auth/token`
|
|
635
|
+
|
|
504
636
|
[See our API reference for more info](https://developers.deepgram.com/reference/authentication)
|
|
505
637
|
|
|
506
|
-
### Grant Token
|
|
638
|
+
### Grant Access Token
|
|
507
639
|
|
|
508
|
-
Creates a temporary token with a 30-second TTL.
|
|
640
|
+
Creates a temporary access token with a 30-second TTL. Requires an existing API key for authentication.
|
|
509
641
|
|
|
510
642
|
```js
|
|
643
|
+
// Create a temporary access token
|
|
511
644
|
const { result, error } = await deepgramClient.auth.grantToken();
|
|
645
|
+
// Returns: { access_token: string, expires_in: 30 }
|
|
646
|
+
|
|
647
|
+
// Use the access token in a new client instance
|
|
648
|
+
const tempClient = createClient({ accessToken: result.access_token });
|
|
512
649
|
```
|
|
513
650
|
|
|
514
|
-
|
|
651
|
+
**API Endpoint**: `POST https://api.deepgram.com/v1/auth/grant`
|
|
652
|
+
|
|
653
|
+
> **Important**: You _must_ pass an `accessToken` property to use a temporary token. Passing the token as a raw string will treat it as an API key and use the incorrect authorization scheme.
|
|
515
654
|
|
|
516
655
|
[See our API reference for more info](https://developers.deepgram.com/reference/token-based-auth-api/grant-token).
|
|
517
656
|
|
|
@@ -525,6 +664,8 @@ Returns all projects accessible by the API key.
|
|
|
525
664
|
const { result, error } = await deepgramClient.manage.getProjects();
|
|
526
665
|
```
|
|
527
666
|
|
|
667
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects`
|
|
668
|
+
|
|
528
669
|
[See our API reference for more info](https://developers.deepgram.com/reference/get-projects).
|
|
529
670
|
|
|
530
671
|
### Get Project
|
|
@@ -535,6 +676,8 @@ Retrieves a specific project based on the provided project_id.
|
|
|
535
676
|
const { result, error } = await deepgramClient.manage.getProject(projectId);
|
|
536
677
|
```
|
|
537
678
|
|
|
679
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects/:projectId`
|
|
680
|
+
|
|
538
681
|
[See our API reference for more info](https://developers.deepgram.com/reference/get-project).
|
|
539
682
|
|
|
540
683
|
### Update Project
|
|
@@ -545,6 +688,8 @@ Update a project.
|
|
|
545
688
|
const { result, error } = await deepgramClient.manage.updateProject(projectId, options);
|
|
546
689
|
```
|
|
547
690
|
|
|
691
|
+
**API Endpoint**: `PATCH https://api.deepgram.com/v1/projects/:projectId`
|
|
692
|
+
|
|
548
693
|
[See our API reference for more info](https://developers.deepgram.com/reference/update-project).
|
|
549
694
|
|
|
550
695
|
### Delete Project
|
|
@@ -555,6 +700,8 @@ Delete a project.
|
|
|
555
700
|
const { error } = await deepgramClient.manage.deleteProject(projectId);
|
|
556
701
|
```
|
|
557
702
|
|
|
703
|
+
**API Endpoint**: `DELETE https://api.deepgram.com/v1/projects/:projectId`
|
|
704
|
+
|
|
558
705
|
[See our API reference for more info](https://developers.deepgram.com/reference/delete-project).
|
|
559
706
|
|
|
560
707
|
## Keys
|
|
@@ -567,6 +714,8 @@ Retrieves all keys associated with the provided project_id.
|
|
|
567
714
|
const { result, error } = await deepgramClient.manage.getProjectKeys(projectId);
|
|
568
715
|
```
|
|
569
716
|
|
|
717
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects/:projectId/keys`
|
|
718
|
+
|
|
570
719
|
[See our API reference for more info](https://developers.deepgram.com/reference/list-keys).
|
|
571
720
|
|
|
572
721
|
### Get Key
|
|
@@ -577,6 +726,8 @@ Retrieves a specific key associated with the provided project_id.
|
|
|
577
726
|
const { result, error } = await deepgramClient.manage.getProjectKey(projectId, projectKeyId);
|
|
578
727
|
```
|
|
579
728
|
|
|
729
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects/:projectId/keys/:keyId`
|
|
730
|
+
|
|
580
731
|
[See our API reference for more info](https://developers.deepgram.com/reference/get-key).
|
|
581
732
|
|
|
582
733
|
### Create Key
|
|
@@ -584,9 +735,17 @@ const { result, error } = await deepgramClient.manage.getProjectKey(projectId, p
|
|
|
584
735
|
Creates an API key with the provided scopes.
|
|
585
736
|
|
|
586
737
|
```js
|
|
587
|
-
const { result, error } = await deepgramClient.manage.createProjectKey(projectId,
|
|
738
|
+
const { result, error } = await deepgramClient.manage.createProjectKey(projectId, {
|
|
739
|
+
comment: "My API key",
|
|
740
|
+
scopes: ["usage:write"], // Required: array of scope strings
|
|
741
|
+
tags: ["production"], // Optional: array of tag strings
|
|
742
|
+
time_to_live_in_seconds: 86400, // Optional: TTL in seconds
|
|
743
|
+
// OR use expiration_date: "2024-12-31T23:59:59Z" // Optional: ISO date string
|
|
744
|
+
});
|
|
588
745
|
```
|
|
589
746
|
|
|
747
|
+
**API Endpoint**: `POST https://api.deepgram.com/v1/projects/:projectId/keys`
|
|
748
|
+
|
|
590
749
|
[See our API reference for more info](https://developers.deepgram.com/reference/create-key).
|
|
591
750
|
|
|
592
751
|
### Delete Key
|
|
@@ -597,6 +756,8 @@ Deletes a specific key associated with the provided project_id.
|
|
|
597
756
|
const { error } = await deepgramClient.manage.deleteProjectKey(projectId, projectKeyId);
|
|
598
757
|
```
|
|
599
758
|
|
|
759
|
+
**API Endpoint**: `DELETE https://api.deepgram.com/v1/projects/:projectId/keys/:keyId`
|
|
760
|
+
|
|
600
761
|
[See our API reference for more info](https://developers.deepgram.com/reference/delete-key).
|
|
601
762
|
|
|
602
763
|
## Members
|
|
@@ -609,6 +770,8 @@ Retrieves account objects for all of the accounts in the specified project_id.
|
|
|
609
770
|
const { result, error } = await deepgramClient.manage.getProjectMembers(projectId);
|
|
610
771
|
```
|
|
611
772
|
|
|
773
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects/:projectId/members`
|
|
774
|
+
|
|
612
775
|
[See our API reference for more info](https://developers.deepgram.com/reference/get-members).
|
|
613
776
|
|
|
614
777
|
### Remove Member
|
|
@@ -619,6 +782,8 @@ Removes member account for specified member_id.
|
|
|
619
782
|
const { error } = await deepgramClient.manage.removeProjectMember(projectId, projectMemberId);
|
|
620
783
|
```
|
|
621
784
|
|
|
785
|
+
**API Endpoint**: `DELETE https://api.deepgram.com/v1/projects/:projectId/members/:memberId`
|
|
786
|
+
|
|
622
787
|
[See our API reference for more info](https://developers.deepgram.com/reference/remove-member).
|
|
623
788
|
|
|
624
789
|
## Scopes
|
|
@@ -634,6 +799,8 @@ const { result, error } = await deepgramClient.manage.getProjectMemberScopes(
|
|
|
634
799
|
);
|
|
635
800
|
```
|
|
636
801
|
|
|
802
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects/:projectId/members/:memberId/scopes`
|
|
803
|
+
|
|
637
804
|
[See our API reference for more info](https://developers.deepgram.com/reference/get-member-scopes).
|
|
638
805
|
|
|
639
806
|
### Update Scope
|
|
@@ -648,6 +815,8 @@ const { result, error } = await deepgramClient.manage.updateProjectMemberScope(
|
|
|
648
815
|
);
|
|
649
816
|
```
|
|
650
817
|
|
|
818
|
+
**API Endpoint**: `PUT https://api.deepgram.com/v1/projects/:projectId/members/:memberId/scopes`
|
|
819
|
+
|
|
651
820
|
[See our API reference for more info](https://developers.deepgram.com/reference/update-scope).
|
|
652
821
|
|
|
653
822
|
## Invitations
|
|
@@ -660,6 +829,8 @@ Retrieves all invitations associated with the provided project_id.
|
|
|
660
829
|
const { result, error } = await deepgramClient.manage.getProjectInvites(projectId);
|
|
661
830
|
```
|
|
662
831
|
|
|
832
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects/:projectId/invites`
|
|
833
|
+
|
|
663
834
|
[See our API reference for more info](https://developers.deepgram.com/reference/list-invites).
|
|
664
835
|
|
|
665
836
|
### Send Invite
|
|
@@ -670,6 +841,8 @@ Sends an invitation to the provided email address.
|
|
|
670
841
|
const { result, error } = await deepgramClient.manage.sendProjectInvite(projectId, options);
|
|
671
842
|
```
|
|
672
843
|
|
|
844
|
+
**API Endpoint**: `POST https://api.deepgram.com/v1/projects/:projectId/invites`
|
|
845
|
+
|
|
673
846
|
[See our API reference for more info](https://developers.deepgram.com/reference/send-invites).
|
|
674
847
|
|
|
675
848
|
### Delete Invite
|
|
@@ -680,6 +853,8 @@ Removes the specified invitation from the project.
|
|
|
680
853
|
const { error } = await deepgramClient.manage.deleteProjectInvite(projectId, email);
|
|
681
854
|
```
|
|
682
855
|
|
|
856
|
+
**API Endpoint**: `DELETE https://api.deepgram.com/v1/projects/:projectId/invites/:email`
|
|
857
|
+
|
|
683
858
|
[See our API reference for more info](https://developers.deepgram.com/reference/delete-invite).
|
|
684
859
|
|
|
685
860
|
### Leave Project
|
|
@@ -690,6 +865,8 @@ Removes the authenticated user from the project.
|
|
|
690
865
|
const { result, error } = await deepgramClient.manage.leaveProject(projectId);
|
|
691
866
|
```
|
|
692
867
|
|
|
868
|
+
**API Endpoint**: `DELETE https://api.deepgram.com/v1/projects/:projectId/leave`
|
|
869
|
+
|
|
693
870
|
[See our API reference for more info](https://developers.deepgram.com/reference/leave-project).
|
|
694
871
|
|
|
695
872
|
## Usage
|
|
@@ -702,6 +879,8 @@ Retrieves all requests associated with the provided project_id based on the prov
|
|
|
702
879
|
const { result, error } = await deepgramClient.manage.getProjectUsageRequests(projectId, options);
|
|
703
880
|
```
|
|
704
881
|
|
|
882
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects/:projectId/requests`
|
|
883
|
+
|
|
705
884
|
### Get Request
|
|
706
885
|
|
|
707
886
|
Retrieves a specific request associated with the provided project_id.
|
|
@@ -710,6 +889,8 @@ Retrieves a specific request associated with the provided project_id.
|
|
|
710
889
|
const { result, error } = await deepgramClient.manage.getProjectUsageRequest(projectId, requestId);
|
|
711
890
|
```
|
|
712
891
|
|
|
892
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects/:projectId/requests/:requestId`
|
|
893
|
+
|
|
713
894
|
[See our API reference for more info](https://developers.deepgram.com/reference/get-request).
|
|
714
895
|
|
|
715
896
|
### Summarize Usage
|
|
@@ -720,6 +901,8 @@ Retrieves usage associated with the provided project_id based on the provided op
|
|
|
720
901
|
const { result, error } = await deepgramClient.manage.getProjectUsageSummary(projectId, options);
|
|
721
902
|
```
|
|
722
903
|
|
|
904
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects/:projectId/usage`
|
|
905
|
+
|
|
723
906
|
[See our API reference for more info](https://developers.deepgram.com/reference/summarize-usage).
|
|
724
907
|
|
|
725
908
|
### Get Fields
|
|
@@ -730,6 +913,8 @@ Lists the features, models, tags, languages, and processing method used for requ
|
|
|
730
913
|
const { result, error } = await deepgramClient.manage.getProjectUsageFields(projectId, options);
|
|
731
914
|
```
|
|
732
915
|
|
|
916
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects/:projectId/usage/fields`
|
|
917
|
+
|
|
733
918
|
[See our API reference for more info](https://developers.deepgram.com/reference/get-fields).
|
|
734
919
|
|
|
735
920
|
### Summarize Usage
|
|
@@ -740,6 +925,8 @@ const { result, error } = await deepgramClient.manage.getProjectUsageFields(proj
|
|
|
740
925
|
const { result, error } = await deepgramClient.manage.getProjectUsage(projectId, options);
|
|
741
926
|
```
|
|
742
927
|
|
|
928
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects/:projectId/usage` (deprecated)
|
|
929
|
+
|
|
743
930
|
[See our API reference for more info](https://developers.deepgram.com/reference/management-api/usage/get).
|
|
744
931
|
|
|
745
932
|
## Billing
|
|
@@ -752,6 +939,8 @@ Retrieves the list of balance info for the specified project.
|
|
|
752
939
|
const { result, error } = await deepgramClient.manage.getProjectBalances(projectId);
|
|
753
940
|
```
|
|
754
941
|
|
|
942
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects/:projectId/balances`
|
|
943
|
+
|
|
755
944
|
[See our API reference for more info](https://developers.deepgram.com/reference/get-all-balances).
|
|
756
945
|
|
|
757
946
|
### Get Balance
|
|
@@ -762,10 +951,22 @@ Retrieves the balance info for the specified project and balance_id.
|
|
|
762
951
|
const { result, error } = await deepgramClient.manage.getProjectBalance(projectId, balanceId);
|
|
763
952
|
```
|
|
764
953
|
|
|
954
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects/:projectId/balances/:balanceId`
|
|
955
|
+
|
|
765
956
|
[See our API reference for more info](https://developers.deepgram.com/reference/get-balance).
|
|
766
957
|
|
|
767
958
|
## Models
|
|
768
959
|
|
|
960
|
+
### Get All Models
|
|
961
|
+
|
|
962
|
+
Retrieves all models available globally.
|
|
963
|
+
|
|
964
|
+
```js
|
|
965
|
+
const { result, error } = await deepgramClient.models.getAll();
|
|
966
|
+
```
|
|
967
|
+
|
|
968
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/models`
|
|
969
|
+
|
|
769
970
|
### Get All Project Models
|
|
770
971
|
|
|
771
972
|
Retrieves all models available for a given project.
|
|
@@ -774,6 +975,8 @@ Retrieves all models available for a given project.
|
|
|
774
975
|
const { result, error } = await deepgramClient.manage.getAllModels(projectId, {});
|
|
775
976
|
```
|
|
776
977
|
|
|
978
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects/:projectId/models`
|
|
979
|
+
|
|
777
980
|
[See our API reference for more info](https://developers.deepgram.com/reference/management-api/projects/list-models).
|
|
778
981
|
|
|
779
982
|
### Get Model
|
|
@@ -784,6 +987,8 @@ Retrieves details of a specific model.
|
|
|
784
987
|
const { result, error } = await deepgramClient.manage.getModel(projectId, modelId);
|
|
785
988
|
```
|
|
786
989
|
|
|
990
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects/:projectId/models/:modelId`
|
|
991
|
+
|
|
787
992
|
[See our API reference for more info](https://developers.deepgram.com/reference/management-api/models/get)
|
|
788
993
|
|
|
789
994
|
## On-Prem APIs
|
|
@@ -796,6 +1001,8 @@ Lists sets of distribution credentials for the specified project.
|
|
|
796
1001
|
const { result, error } = await deepgramClient.onprem.listCredentials(projectId);
|
|
797
1002
|
```
|
|
798
1003
|
|
|
1004
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects/:projectId/onprem/distribution/credentials`
|
|
1005
|
+
|
|
799
1006
|
[See our API reference for more info](https://developers.deepgram.com/reference/self-hosted-api/list-credentials)
|
|
800
1007
|
|
|
801
1008
|
### Get On-Prem credentials
|
|
@@ -806,6 +1013,8 @@ Returns a set of distribution credentials for the specified project.
|
|
|
806
1013
|
const { result, error } = await deepgramClient.onprem.getCredentials(projectId, credentialId);
|
|
807
1014
|
```
|
|
808
1015
|
|
|
1016
|
+
**API Endpoint**: `GET https://api.deepgram.com/v1/projects/:projectId/onprem/distribution/credentials/:credentialsId`
|
|
1017
|
+
|
|
809
1018
|
[See our API reference for more info](https://developers.deepgram.com/reference/self-hosted-api/get-credentials)
|
|
810
1019
|
|
|
811
1020
|
### Create On-Prem credentials
|
|
@@ -816,6 +1025,8 @@ Creates a set of distribution credentials for the specified project.
|
|
|
816
1025
|
const { result, error } = await deepgramClient.onprem.createCredentials(projectId, options);
|
|
817
1026
|
```
|
|
818
1027
|
|
|
1028
|
+
**API Endpoint**: `POST https://api.deepgram.com/v1/projects/:projectId/onprem/distribution/credentials`
|
|
1029
|
+
|
|
819
1030
|
[See our API reference for more info](https://developers.deepgram.com/reference/self-hosted-api/create-credentials)
|
|
820
1031
|
|
|
821
1032
|
### Delete On-Prem credentials
|
|
@@ -826,6 +1037,8 @@ Deletes a set of distribution credentials for the specified project.
|
|
|
826
1037
|
const { result, error } = await deepgramClient.onprem.deleteCredentials(projectId, credentialId);
|
|
827
1038
|
```
|
|
828
1039
|
|
|
1040
|
+
**API Endpoint**: `DELETE https://api.deepgram.com/v1/projects/:projectId/onprem/distribution/credentials/:credentialsId`
|
|
1041
|
+
|
|
829
1042
|
[See our API reference for more info](https://developers.deepgram.com/reference/self-hosted-api/delete-credentials)
|
|
830
1043
|
|
|
831
1044
|
## Backwards Compatibility
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "4.11.
|
|
1
|
+
export declare const version = "4.11.2";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/main/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractLiveClient.d.ts","sourceRoot":"","sources":["../../../src/packages/AbstractLiveClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAQ,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,IAAI,CAAC;AAEnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD;;;;;;;GAOG;AACH,UAAU,wBAAwB;IAChC,KACE,OAAO,EAAE,MAAM,GAAG,GAAG,E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EAAE,QAAQ,CAAY;IAC7B,SAAS,EAAE,QAAQ,CAAY;IAC/B,MAAM,EAAE,QAAQ,CAAY;IAC5B,UAAU,EAAE,MAAM,CAA4B;IAC9C,IAAI,EAAE,QAAQ,CAAY;IAC1B,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,IAAI,CAAQ;gBAEpB,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE;QAAE,KAAK,EAAE,QAAQ,CAAA;KAAE;CAI9E;AAED,OAAO,EAAE,kBAAkB,IAAI,gBAAgB,EAAE,CAAC"}
|
|
@@ -138,8 +138,8 @@ class AbstractLiveClient extends AbstractClient_1.AbstractClient {
|
|
|
138
138
|
headers: this.headers,
|
|
139
139
|
});
|
|
140
140
|
console.log(`Using WS package`);
|
|
141
|
+
this.setupConnection();
|
|
141
142
|
});
|
|
142
|
-
this.setupConnection();
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
145
|
/**
|
|
@@ -165,8 +165,8 @@ class AbstractLiveClient extends AbstractClient_1.AbstractClient {
|
|
|
165
165
|
this.conn = new WS(requestUrl, undefined, {
|
|
166
166
|
headers: this.headers,
|
|
167
167
|
});
|
|
168
|
+
this.setupConnection();
|
|
168
169
|
});
|
|
169
|
-
this.setupConnection();
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
172
|
* Disconnects the socket from the client.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractLiveClient.js","sourceRoot":"","sources":["../../../src/packages/AbstractLiveClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAwD;AACxD,gDAAmE;AAGnE,4CAAuC;AACvC,0CAAuD;AA+BvD;;;;;GAKG;AACH,iCAAiC;AACjC,gBAAgB;AAChB,qBAAqB;AACrB,kBAAkB;AAClB,IAAI;AAEJ;;GAEG;AACH,MAAM,0BAA0B,GAAG,OAAO,SAAS,KAAK,WAAW,CAAC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AAwB,IAAI,CAAC;QAG9B,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC7B,CAAC;CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "4.11.
|
|
1
|
+
export declare const version = "4.11.2";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = "4.11.
|
|
1
|
+
export const version = "4.11.2";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractLiveClient.d.ts","sourceRoot":"","sources":["../../../src/packages/AbstractLiveClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAQ,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,IAAI,CAAC;AAEnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD;;;;;;;GAOG;AACH,UAAU,wBAAwB;IAChC,KACE,OAAO,EAAE,MAAM,GAAG,GAAG,EACrB,QAAQ,CAAC,EAAE,GAAG,EACd,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GACxC,aAAa,CAAC;CAClB;AAED;;;;;GAKG;AACH,KAAK,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAEhE;;GAEG;AACH,KAAK,cAAc,GAAG,MAAM,GAAG,eAAe,GAAG,IAAI,CAAC;AAmBtD;;;;;;GAMG;AACH,8BAAsB,kBAAmB,SAAQ,cAAc;IACtD,OAAO,E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IAAI,gBAAgB,EAAE,CAAC"}
|
|
@@ -112,8 +112,8 @@ export class AbstractLiveClient extends AbstractClient {
|
|
|
112
112
|
headers: this.headers,
|
|
113
113
|
});
|
|
114
114
|
console.log(`Using WS package`);
|
|
115
|
+
this.setupConnection();
|
|
115
116
|
});
|
|
116
|
-
this.setupConnection();
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
119
119
|
/**
|
|
@@ -139,8 +139,8 @@ export class AbstractLiveClient extends AbstractClient {
|
|
|
139
139
|
this.conn = new WS(requestUrl, undefined, {
|
|
140
140
|
headers: this.headers,
|
|
141
141
|
});
|
|
142
|
+
this.setupConnection();
|
|
142
143
|
});
|
|
143
|
-
this.setupConnection();
|
|
144
144
|
}
|
|
145
145
|
/**
|
|
146
146
|
* Disconnects the socket from the client.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractLiveClient.js","sourceRoot":"","sources":["../../../src/packages/AbstractLiveClient.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGnE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AA+BvD;;;;;GAKG;AACH,iCAAiC;AACjC,gBAAgB;AAChB,qBAAqB;AACrB,kBAAkB;AAClB,IAAI;AAEJ;;GAEG;AACH,MAAM,0BAA0B,GAAG,OAAO,SAAS,KAAK,WAAW,CAAC;AAEpE;;;;;;GAMG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,cAAc;IAM7D,YAAY,OAA8B;QACxC,KAAK,CAAC,OAAO,CAAC,CAAC;QAJV,SAAI,GAAyB,IAAI,CAAC;QAClC,eAAU,GAAe,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"AbstractLiveClient.js","sourceRo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AK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC7B,CAAC;CACF;AAED,OAAO,EAAE,kBAAkB,IAAI,gBAAgB,EAAE,CAAC"}
|
package/dist/umd/deepgram.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.deepgram=t():e.deepgram=t()}(self,(()=>(()=>{var e={367:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OnPremClient=t.SelfHostedRestClient=void 0;const s=r(4306),o=r(5096);class i extends o.AbstractRestClient{constructor(){super(...arguments),this.namespace="selfhosted"}listCredentials(e,t=":version/projects/:projectId/onprem/distribution/credentials"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{projectId:e});return{result:yield this.get(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getCredentials(e,t,r=":version/projects/:projectId/onprem/distribution/credentials/:credentialsId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,credentialsId:t});return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}createCredentials(e,t,r=":version/projects/:projectId/onprem/distribution/credentials"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e}),s=JSON.stringify(t);return{result:yield this.post(n,s).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}deleteCredentials(e,t,r=":version/projects/:projectId/onprem/distribution/credentials/:credentialsId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,credentialsId:t});return{result:yield this.delete(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}}t.SelfHostedRestClient=i,t.OnPremClient=i},398:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakClient=void 0;const n=r(5066),s=r(3712),o=r(4492);class i extends n.AbstractClient{constructor(){super(...arguments),this.namespace="speak"}request(e,t,r=":version/speak"){return new o.SpeakRestClient(this.options).request(e,t,r)}live(e={},t=":version/speak"){return new s.SpeakLiveClient(this.options,e,t)}}t.SpeakClient=i},459:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},472:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthRestClient=void 0;const s=r(4306),o=r(5096);class i extends o.AbstractRestClient{constructor(){super(...arguments),this.namespace="auth"}grantToken(e={},t=":version/auth/grant"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t),n=JSON.stringify(e);return{result:yield this.post(r,n,{headers:{"Content-Type":"application/json"}}).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}}t.AuthRestClient=i},569:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},684:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.convertLegacyOptions=t.isDeepgramClientOptions=t.isLiveSchema=t.buildRequestUrl=t.convertProtocolToWs=t.CallbackUrl=t.isFileSource=t.isTextSource=t.isUrlSource=t.resolveHeadersConstructor=t.appendSearchParams=t.applyDefaults=t.stripTrailingSlash=void 0;const s=r(8389),o=n(r(7314)),i=r(5793);function a(e,t){Object.keys(t).forEach((r=>{Array.isArray(t[r])?t[r].forEach((t=>{e.append(r,String(t))})):e.append(r,String(t[r]))}))}t.stripTrailingSlash=function(e){return e.replace(/\/$/,"")},t.applyDefaults=function(e={},t={}){return(0,o.default)(t,e)},t.appendSearchParams=a,t.resolveHeadersConstructor=()=>"undefined"==typeof Headers?s.Headers:Headers,t.isUrlSource=e=>!(!e||!e.url),t.isTextSource=e=>!(!e||!e.text),t.isFileSource=e=>!(!c(e)&&!u(e));const u=e=>null!=e&&Buffer.isBuffer(e),c=e=>null!=e&&!(0,i.isBrowser)()&&"object"==typeof e&&"function"==typeof e.pipe&&"function"==typeof e.read&&"object"==typeof e._readableState;class l extends URL{constructor(){super(...arguments),this.callbackUrl=!0}}t.CallbackUrl=l,t.convertProtocolToWs=e=>e.toLowerCase().replace(/^http/,"ws"),t.buildRequestUrl=(e,t,r)=>{const n=new URL(e,t);return a(n.searchParams,r),n},t.isLiveSchema=function(e){return null!=e&&void 0!==e.interim_results},t.isDeepgramClientOptions=function(e){return null!=e&&void 0!==e.global},t.convertLegacyOptions=e=>{var t,r,n,s,i,a;const u={};return e._experimentalCustomFetch&&(u.global={fetch:{client:e._experimentalCustomFetch}}),(null===(t=(e=(0,o.default)(e,u)).restProxy)||void 0===t?void 0:t.url)&&(u.global={fetch:{options:{proxy:{url:null===(r=e.restProxy)||void 0===r?void 0:r.url}}}}),(null===(n=(e=(0,o.default)(e,u)).global)||void 0===n?void 0:n.url)&&(u.global={fetch:{options:{url:e.global.url}},websocket:{options:{url:e.global.url}}}),(null===(s=(e=(0,o.default)(e,u)).global)||void 0===s?void 0:s.headers)&&(u.global={fetch:{options:{headers:null===(i=e.global)||void 0===i?void 0:i.headers}},websocket:{options:{_nodeOnlyHeaders:null===(a=e.global)||void 0===a?void 0:a.headers}}}),(0,o.default)(e,u)}},740:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractWsClient=t.AbstractLiveClient=void 0;const a=r(5066),u=r(8712),c=r(5793),l=r(4306),d="undefined"!=typeof WebSocket;class h extends a.AbstractClient{constructor(e){super(e),this.conn=null,this.sendBuffer=[],this.reconnect=a.noop;const{key:t,websocket:{options:r,client:n}}=this.namespaceOptions;this.proxy?this.baseUrl=r.proxy.url:this.baseUrl=r.url,this.transport=n||null,r._nodeOnlyHeaders?this.headers=r._nodeOnlyHeaders:this.headers={},"Authorization"in this.headers||(this.accessToken?this.headers.Authorization=`Bearer ${this.accessToken}`:this.headers.Authorization=`Token ${t}`)}connect(e,t){if(this.conn)return;this.reconnect=(r=e)=>{this.connect(r,t)};const n=this.getRequestUrl(t,{},e),s=this.accessToken,i=this.key;if(!s&&!i)throw new Error("No key or access token provided for WebSocket connection.");return this.transport?(this.conn=new this.transport(n,void 0,{headers:this.headers}),void this.setupConnection()):(0,c.isBun)()?(Promise.resolve().then((()=>o(r(3584)))).then((({default:e})=>{this.conn=new e(n,{headers:this.headers}),console.log("Using WS package")})),void this.setupConnection()):d?(this.conn=new WebSocket(n,s?["bearer",s]:["token",i]),void this.setupConnection()):(this.conn=new p(n,void 0,{close:()=>{this.conn=null}}),Promise.resolve().then((()=>o(r(3584)))).then((({default:e})=>{this.conn=new e(n,void 0,{headers:this.headers})})),void this.setupConnection())}disconnect(e,t){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,null!=t?t:""):this.conn.close(),this.conn=null)}connectionState(){switch(this.conn&&this.conn.readyState){case u.SOCKET_STATES.connecting:return u.CONNECTION_STATE.Connecting;case u.SOCKET_STATES.open:return u.CONNECTION_STATE.Open;case u.SOCKET_STATES.closing:return u.CONNECTION_STATE.Closing;default:return u.CONNECTION_STATE.Closed}}getReadyState(){var e,t;return null!==(t=null===(e=this.conn)||void 0===e?void 0:e.readyState)&&void 0!==t?t:u.SOCKET_STATES.closed}isConnected(){return this.connectionState()===u.CONNECTION_STATE.Open}send(e){const t=()=>i(this,void 0,void 0,(function*(){var t;if(e instanceof Blob){if(0===e.size)return void this.log("warn","skipping `send` for zero-byte blob",e);e=yield e.arrayBuffer()}"string"==typeof e||(null==e?void 0:e.byteLength)?null===(t=this.conn)||void 0===t||t.send(e):this.log("warn","skipping `send` for zero-byte payload",e)}));this.isConnected()?t():this.sendBuffer.push(t)}get proxy(){var e;return"proxy"===this.key&&!!(null===(e=this.namespaceOptions.websocket.options.proxy)||void 0===e?void 0:e.url)}extractErrorInformation(e,t){var r;const n={};if(t&&(n.readyState=t.readyState,n.url="string"==typeof t.url?t.url:null===(r=t.url)||void 0===r?void 0:r.toString()),t&&"object"==typeof t){const r=t;if(r._req&&r._req.res&&(n.statusCode=r._req.res.statusCode,r._req.res.headers)){n.responseHeaders=Object.assign({},r._req.res.headers);const e=r._req.res.headers["dg-request-id"]||r._req.res.headers["x-dg-request-id"];e&&(n.requestId=e)}if(e&&"target"in e&&e.target){const t=e.target;t.url&&(n.url=t.url),void 0!==t.readyState&&(n.readyState=t.readyState)}}return n}createEnhancedError(e,t){const r=new l.DeepgramWebSocketError(e.message||"WebSocket connection error",Object.assign({originalEvent:e},t));return Object.assign(Object.assign({},e),{error:r,statusCode:t.statusCode,requestId:t.requestId,responseHeaders:t.responseHeaders,url:t.url,readyState:t.readyState,message:this.buildEnhancedErrorMessage(e,t)})}buildEnhancedErrorMessage(e,t){let r=e.message||"WebSocket connection error";const n=[];if(t.statusCode&&n.push(`Status: ${t.statusCode}`),t.requestId&&n.push(`Request ID: ${t.requestId}`),void 0!==t.readyState){const e=["CONNECTING","OPEN","CLOSING","CLOSED"][t.readyState]||`Unknown(${t.readyState})`;n.push(`Ready State: ${e}`)}return t.url&&n.push(`URL: ${t.url}`),n.length>0&&(r+=` (${n.join(", ")})`),r}setupConnectionEvents(e){this.conn&&(this.conn.onopen=()=>{this.emit(e.Open,this)},this.conn.onclose=t=>{this.emit(e.Close,t)},this.conn.onerror=t=>{const r=this.extractErrorInformation(t,this.conn||void 0),n=this.createEnhancedError(t,r);this.emit(e.Error,n)})}}t.AbstractLiveClient=h,t.AbstractWsClient=h;class p{constructor(e,t,r){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=u.SOCKET_STATES.connecting,this.send=()=>{},this.url=null,this.url=e.toString(),this.close=r.close}}},747:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},753:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},816:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},875:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ListenClient=void 0;const n=r(5066),s=r(5357),o=r(6733);class i extends n.AbstractClient{constructor(){super(...arguments),this.namespace="listen"}get prerecorded(){return new o.ListenRestClient(this.options)}live(e={},t=":version/listen"){return new s.ListenLiveClient(this.options,e,t)}}t.ListenClient=i},986:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.LiveTTSEvents=void 0,(r=t.LiveTTSEvents||(t.LiveTTSEvents={})).Open="Open",r.Close="Close",r.Error="Error",r.Metadata="Metadata",r.Flushed="Flushed",r.Warning="Warning",r.Audio="Audio",r.Unhandled="Unhandled"},1176:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.AgentEvents=void 0,(r=t.AgentEvents||(t.AgentEvents={})).Open="Open",r.Close="Close",r.Error="Error",r.Audio="Audio",r.Welcome="Welcome",r.SettingsApplied="SettingsApplied",r.ConversationText="ConversationText",r.UserStartedSpeaking="UserStartedSpeaking",r.AgentThinking="AgentThinking",r.FunctionCallRequest="FunctionCallRequest",r.AgentStartedSpeaking="AgentStartedSpeaking",r.AgentAudioDone="AgentAudioDone",r.InjectionRefused="InjectionRefused",r.PromptUpdated="PromptUpdated",r.SpeakUpdated="SpeakUpdated",r.Unhandled="Unhandled"},1221:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1556:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1557:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1775:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1828:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1901:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2043:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AgentLiveClient=void 0;const n=r(8712),s=r(1176),o=r(740);class i extends o.AbstractLiveClient{constructor(e,t="/:version/agent/converse"){var r,s,o,i;super(e),this.namespace="agent",this.baseUrl=null!==(i=null===(o=null===(s=null===(r=e.agent)||void 0===r?void 0:r.websocket)||void 0===s?void 0:s.options)||void 0===o?void 0:o.url)&&void 0!==i?i:n.DEFAULT_AGENT_URL,this.connect({},t)}setupConnection(){this.setupConnectionEvents({Open:s.AgentEvents.Open,Close:s.AgentEvents.Close,Error:s.AgentEvents.Error}),this.conn&&(this.conn.onmessage=e=>{this.handleMessage(e)})}handleMessage(e){var t,r,n,o,i,a;if("string"==typeof e.data)try{const t=JSON.parse(e.data);this.handleTextMessage(t)}catch(i){this.emit(s.AgentEvents.Error,{event:e,data:(null===(t=e.data)||void 0===t?void 0:t.toString().substring(0,200))+((null===(r=e.data)||void 0===r?void 0:r.toString().length)>200?"...":""),message:"Unable to parse `data` as JSON.",error:i,url:null===(n=this.conn)||void 0===n?void 0:n.url,readyState:null===(o=this.conn)||void 0===o?void 0:o.readyState})}else e.data instanceof Blob?e.data.arrayBuffer().then((e=>{this.handleBinaryMessage(Buffer.from(e))})):e.data instanceof ArrayBuffer?this.handleBinaryMessage(Buffer.from(e.data)):Buffer.isBuffer(e.data)?this.handleBinaryMessage(e.data):(console.log("Received unknown data type",e.data),this.emit(s.AgentEvents.Error,{event:e,message:"Received unknown data type.",url:null===(i=this.conn)||void 0===i?void 0:i.url,readyState:null===(a=this.conn)||void 0===a?void 0:a.readyState,dataType:typeof e.data}))}handleBinaryMessage(e){this.emit(s.AgentEvents.Audio,e)}handleTextMessage(e){e.type in s.AgentEvents?this.emit(e.type,e):this.emit(s.AgentEvents.Unhandled,e)}configure(e){const t=JSON.stringify(Object.assign({type:"Settings"},e));this.send(t)}updatePrompt(e){this.send(JSON.stringify({type:"UpdatePrompt",prompt:e}))}updateSpeak(e){this.send(JSON.stringify({type:"UpdateSpeak",speak:e}))}injectAgentMessage(e){this.send(JSON.stringify({type:"InjectAgentMessage",content:e}))}injectUserMessage(e){this.send(JSON.stringify({type:"InjectUserMessage",content:e}))}functionCallResponse(e){this.send(JSON.stringify(Object.assign({type:"FunctionCallResponse"},e)))}keepAlive(){this.send(JSON.stringify({type:"KeepAlive"}))}}t.AgentLiveClient=i},2171:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(3075),t),s(r(816),t),s(r(9836),t),s(r(8633),t),s(r(1901),t),s(r(3036),t),s(r(4852),t),s(r(5263),t),s(r(1749),t),s(r(9115),t),s(r(459),t),s(r(6544),t),s(r(8034),t),s(r(9518),t),s(r(8968),t),s(r(2701),t),s(r(8785),t),s(r(5874),t),s(r(9176),t),s(r(8457),t),s(r(3150),t),s(r(1557),t),s(r(4329),t),s(r(9042),t),s(r(6302),t),s(r(4592),t),s(r(8600),t),s(r(7205),t),s(r(747),t),s(r(9475),t),s(r(569),t),s(r(1221),t),s(r(8378),t),s(r(753),t),s(r(1775),t),s(r(2278),t),s(r(7034),t),s(r(4602),t),s(r(7897),t),s(r(1556),t),s(r(6180),t),s(r(1828),t),s(r(8502),t),s(r(4775),t),s(r(4198),t)},2278:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2701:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3036:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3063:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiveConnectionState=void 0;const n=r(8712);var s;(s=t.LiveConnectionState||(t.LiveConnectionState={}))[s.CONNECTING=n.SOCKET_STATES.connecting]="CONNECTING",s[s.OPEN=n.SOCKET_STATES.open]="OPEN",s[s.CLOSING=n.SOCKET_STATES.closing]="CLOSING",s[s.CLOSED=n.SOCKET_STATES.closed]="CLOSED"},3075:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3150:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3242:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ReadClient=t.ReadRestClient=void 0;const s=r(684),o=r(4306),i=r(5096);class a extends i.AbstractRestClient{constructor(){super(...arguments),this.namespace="read"}analyzeUrl(e,t,r=":version/read"){return n(this,void 0,void 0,(function*(){try{let n;if(!(0,s.isUrlSource)(e))throw new o.DeepgramError("Unknown source type");if(n=JSON.stringify(e),void 0!==t&&"callback"in t)throw new o.DeepgramError("Callback cannot be provided as an option to a synchronous transcription. Use `analyzeUrlCallback` or `analyzeTextCallback` instead.");const i=this.getRequestUrl(r,{},Object.assign({},t));return{result:yield this.post(i,n).then((e=>e.json())),error:null}}catch(e){if((0,o.isDeepgramError)(e))return{result:null,error:e};throw e}}))}analyzeText(e,t,r=":version/read"){return n(this,void 0,void 0,(function*(){try{let n;if(!(0,s.isTextSource)(e))throw new o.DeepgramError("Unknown source type");if(n=JSON.stringify(e),void 0!==t&&"callback"in t)throw new o.DeepgramError("Callback cannot be provided as an option to a synchronous requests. Use `analyzeUrlCallback` or `analyzeTextCallback` instead.");const i=this.getRequestUrl(r,{},Object.assign({},t));return{result:yield this.post(i,n).then((e=>e.json())),error:null}}catch(e){if((0,o.isDeepgramError)(e))return{result:null,error:e};throw e}}))}analyzeUrlCallback(e,t,r,i=":version/read"){return n(this,void 0,void 0,(function*(){try{let n;if(!(0,s.isUrlSource)(e))throw new o.DeepgramError("Unknown source type");n=JSON.stringify(e);const a=this.getRequestUrl(i,{},Object.assign(Object.assign({},r),{callback:t.toString()}));return{result:yield this.post(a,n).then((e=>e.json())),error:null}}catch(e){if((0,o.isDeepgramError)(e))return{result:null,error:e};throw e}}))}analyzeTextCallback(e,t,r,i=":version/read"){return n(this,void 0,void 0,(function*(){try{let n;if(!(0,s.isTextSource)(e))throw new o.DeepgramError("Unknown source type");n=JSON.stringify(e);const a=this.getRequestUrl(i,{},Object.assign(Object.assign({},r),{callback:t.toString()}));return{result:yield this.post(a,n,{headers:{"Content-Type":"deepgram/audio+video"}}).then((e=>e.json())),error:null}}catch(e){if((0,o.isDeepgramError)(e))return{result:null,error:e};throw e}}))}}t.ReadRestClient=a,t.ReadClient=a},3465:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.srt=t.webvtt=t.Deepgram=t.DeepgramClient=t.createClient=void 0;const i=r(4306),a=o(r(3695));t.DeepgramClient=a.default,t.Deepgram=class{constructor(e,t,r){throw this.apiKey=e,this.apiUrl=t,this.requireSSL=r,new i.DeepgramVersionError}},t.createClient=function(e,t){let r={};return"string"==typeof e||"function"==typeof e?("object"==typeof t&&(r=t),r.key=e):"object"==typeof e&&(r=e),new a.default(r)},s(r(6731),t),s(r(2171),t),s(r(6416),t),s(r(8712),t),s(r(4306),t),s(r(684),t);var u=r(6327);Object.defineProperty(t,"webvtt",{enumerable:!0,get:function(){return u.webvtt}}),Object.defineProperty(t,"srt",{enumerable:!0,get:function(){return u.srt}})},3584:e=>{"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},3695:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4306),s=r(6731);class o extends s.AbstractClient{get auth(){return new s.AuthRestClient(this.options)}get listen(){return new s.ListenClient(this.options)}get manage(){return new s.ManageClient(this.options)}get models(){return new s.ModelsRestClient(this.options)}get onprem(){return this.selfhosted}get selfhosted(){return new s.SelfHostedRestClient(this.options)}get read(){return new s.ReadClient(this.options)}get speak(){return new s.SpeakClient(this.options)}agent(e="/:version/agent/converse"){return new s.AgentLiveClient(this.options,e)}get transcription(){throw new n.DeepgramVersionError}get projects(){throw new n.DeepgramVersionError}get keys(){throw new n.DeepgramVersionError}get members(){throw new n.DeepgramVersionError}get scopes(){throw new n.DeepgramVersionError}get invitation(){throw new n.DeepgramVersionError}get usage(){throw new n.DeepgramVersionError}get billing(){throw new n.DeepgramVersionError}}t.default=o},3712:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakLiveClient=void 0;const n=r(740),s=r(6416);class o extends n.AbstractLiveClient{constructor(e,t={},r=":version/speak"){super(e),this.namespace="speak",this.connect(t,r)}setupConnection(){this.setupConnectionEvents({Open:s.LiveTTSEvents.Open,Close:s.LiveTTSEvents.Close,Error:s.LiveTTSEvents.Error}),this.conn&&(this.conn.onmessage=e=>{this.handleMessage(e)})}handleTextMessage(e){e.type===s.LiveTTSEvents.Metadata?this.emit(s.LiveTTSEvents.Metadata,e):e.type===s.LiveTTSEvents.Flushed?this.emit(s.LiveTTSEvents.Flushed,e):e.type===s.LiveTTSEvents.Warning?this.emit(s.LiveTTSEvents.Warning,e):this.emit(s.LiveTTSEvents.Unhandled,e)}handleBinaryMessage(e){this.emit(s.LiveTTSEvents.Audio,e)}sendText(e){this.send(JSON.stringify({type:"Speak",text:e}))}flush(){this.send(JSON.stringify({type:"Flush"}))}clear(){this.send(JSON.stringify({type:"Clear"}))}requestClose(){this.send(JSON.stringify({type:"Close"}))}handleMessage(e){var t,r,n,o,i,a;if("string"==typeof e.data)try{const t=JSON.parse(e.data);this.handleTextMessage(t)}catch(i){this.emit(s.LiveTTSEvents.Error,{event:e,message:"Unable to parse `data` as JSON.",error:i,url:null===(t=this.conn)||void 0===t?void 0:t.url,readyState:null===(r=this.conn)||void 0===r?void 0:r.readyState,data:(null===(n=e.data)||void 0===n?void 0:n.toString().substring(0,200))+((null===(o=e.data)||void 0===o?void 0:o.toString().length)>200?"...":"")})}else e.data instanceof Blob?e.data.arrayBuffer().then((e=>{this.handleBinaryMessage(Buffer.from(e))})):e.data instanceof ArrayBuffer?this.handleBinaryMessage(Buffer.from(e.data)):Buffer.isBuffer(e.data)?this.handleBinaryMessage(e.data):(console.log("Received unknown data type",e.data),this.emit(s.LiveTTSEvents.Error,{event:e,message:"Received unknown data type.",url:null===(i=this.conn)||void 0===i?void 0:i.url,readyState:null===(a=this.conn)||void 0===a?void 0:a.readyState,dataType:typeof e.data}))}}t.SpeakLiveClient=o},4198:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4268:function(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,s,o){var i=s.prototype;o.utc=function(e){return new s({date:e,utc:!0,args:arguments})},i.utc=function(t){var r=o(this.toDate(),{locale:this.$L,utc:!0});return t?r.add(this.utcOffset(),e):r},i.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var a=i.parse;i.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),a.call(this,e)};var u=i.init;i.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else u.call(this)};var c=i.utcOffset;i.utcOffset=function(n,s){var o=this.$utils().u;if(o(n))return this.$u?0:o(this.$offset)?c.call(this):this.$offset;if("string"==typeof n&&(n=function(e){void 0===e&&(e="");var n=e.match(t);if(!n)return null;var s=(""+n[0]).match(r)||["-",0,0],o=s[0],i=60*+s[1]+ +s[2];return 0===i?0:"+"===o?i:-i}(n),null===n))return this;var i=Math.abs(n)<=16?60*n:n,a=this;if(s)return a.$offset=i,a.$u=0===n,a;if(0!==n){var u=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(a=this.local().add(i+u,e)).$offset=i,a.$x.$localOffset=u}else a=this.utc();return a};var l=i.format;i.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,t)},i.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var d=i.toDate;i.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var h=i.diff;i.diff=function(e,t,r){if(e&&this.$u===e.$u)return h.call(this,e,t,r);var n=this.local(),s=o(e).local();return h.call(n,s,t,r)}}}()},4306:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeepgramWebSocketError=t.DeepgramVersionError=t.DeepgramUnknownError=t.DeepgramApiError=t.isDeepgramError=t.DeepgramError=void 0;class r extends Error{constructor(e){super(e),this.__dgError=!0,this.name="DeepgramError"}}t.DeepgramError=r,t.isDeepgramError=function(e){return"object"==typeof e&&null!==e&&"__dgError"in e},t.DeepgramApiError=class extends r{constructor(e,t){super(e),this.name="DeepgramApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}},t.DeepgramUnknownError=class extends r{constructor(e,t){super(e),this.name="DeepgramUnknownError",this.originalError=t}},t.DeepgramVersionError=class extends r{constructor(){super("You are attempting to use an old format for a newer SDK version. Read more here: https://dpgr.am/js-v3"),this.name="DeepgramVersionError"}},t.DeepgramWebSocketError=class extends r{constructor(e,t={}){super(e),this.name="DeepgramWebSocketError",this.originalEvent=t.originalEvent,this.statusCode=t.statusCode,this.requestId=t.requestId,this.responseHeaders=t.responseHeaders,this.url=t.url,this.readyState=t.readyState}toJSON(){return{name:this.name,message:this.message,statusCode:this.statusCode,requestId:this.requestId,responseHeaders:this.responseHeaders,url:this.url,readyState:this.readyState,originalEvent:this.originalEvent?{type:this.originalEvent.type,timeStamp:this.originalEvent.timeStamp}:void 0}}}},4329:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4492:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakRestClient=void 0;const s=r(4306),o=r(684),i=r(5096);class a extends i.AbstractRestClient{constructor(){super(...arguments),this.namespace="speak"}request(e,t,r=":version/speak"){return n(this,void 0,void 0,(function*(){let n;if(!(0,o.isTextSource)(e))throw new s.DeepgramError("Unknown transcription source type");n=JSON.stringify(e);const i=this.getRequestUrl(r,{},Object.assign({model:"aura-2-thalia-en"},t));return this.result=yield this.post(i,n,{headers:{Accept:"audio/*","Content-Type":"application/json"}}),this}))}getStream(){return n(this,void 0,void 0,(function*(){if(!this.result)throw new s.DeepgramUnknownError("Tried to get stream before making request","");return this.result.body}))}getHeaders(){return n(this,void 0,void 0,(function*(){if(!this.result)throw new s.DeepgramUnknownError("Tried to get headers before making request","");return this.result.headers}))}}t.SpeakRestClient=a},4592:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4602:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4775:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4852:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5066:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractClient=t.noop=void 0;const n=r(9784),s=r(8712),o=r(4306),i=r(684);t.noop=()=>{};class a extends n.EventEmitter{constructor(e){if(super(),this.factory=void 0,this.key=void 0,this.accessToken=void 0,this.namespace="global",this.version="v1",this.baseUrl=s.DEFAULT_URL,this.logger=t.noop,"function"==typeof e.accessToken?(this.factory=e.accessToken,this.accessToken=this.factory()):this.accessToken=e.accessToken,"function"==typeof e.key?(this.factory=e.key,this.key=this.factory()):this.key=e.key,this.key||this.accessToken||(this.accessToken=process.env.DEEPGRAM_ACCESS_TOKEN,this.accessToken||(this.key=process.env.DEEPGRAM_API_KEY)),!this.key&&!this.accessToken)throw new o.DeepgramError("A deepgram API key or access token is required.");e=(0,i.convertLegacyOptions)(e),this.options=(0,i.applyDefaults)(e,s.DEFAULT_OPTIONS)}v(e="v1"){return this.version=e,this}get namespaceOptions(){const e=(0,i.applyDefaults)(this.options[this.namespace],this.options.global);return Object.assign(Object.assign({},e),{key:this.key})}getRequestUrl(e,t={version:this.version},r){t.version=this.version,e=e.replace(/:(\w+)/g,(function(e,r){return t[r]}));const n=new URL(e,this.baseUrl);return r&&(0,i.appendSearchParams)(n.searchParams,r),n}log(e,t,r){this.logger(e,t,r)}}t.AbstractClient=a},5096:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractRestfulClient=t.AbstractRestClient=void 0;const o=r(4306),i=r(6245),a=r(5066),u=r(5793),c=s(r(7314));class l extends a.AbstractClient{constructor(e){if(super(e),(0,u.isBrowser)()&&!this.proxy)throw new o.DeepgramError("Due to CORS we are unable to support REST-based API calls to our API from the browser. Please consider using a proxy: https://dpgr.am/js-proxy for more information.");const{accessToken:t,key:r,fetch:n}=this;this.fetch=(0,i.fetchWithAuth)({accessToken:t,apiKey:r,customFetch:n}),this.proxy?this.baseUrl=this.namespaceOptions.fetch.options.proxy.url:this.baseUrl=this.namespaceOptions.fetch.options.url}_getErrorMessage(e){return e.msg||e.message||e.error_description||e.error||JSON.stringify(e)}_handleError(e,t){return n(this,void 0,void 0,(function*(){const r=yield(0,i.resolveResponse)();e instanceof r?e.json().then((r=>{t(new o.DeepgramApiError(this._getErrorMessage(r),e.status||500))})).catch((e=>{t(new o.DeepgramUnknownError(this._getErrorMessage(e),e))})):t(new o.DeepgramUnknownError(this._getErrorMessage(e),e))}))}_getRequestOptions(e,t,r){let n={method:e};return n="GET"===e||"DELETE"===e?Object.assign(Object.assign({},n),t):Object.assign(Object.assign({duplex:"half",body:t},n),r),(0,c.default)(this.namespaceOptions.fetch.options,n,{clone:!1})}_handleRequest(e,t,r,s){return n(this,void 0,void 0,(function*(){return new Promise(((n,o)=>{(0,this.fetch)(t,this._getRequestOptions(e,r,s)).then((e=>{if(!e.ok)throw e;n(e)})).catch((e=>this._handleError(e,o)))}))}))}get(e,t){return n(this,void 0,void 0,(function*(){return this._handleRequest("GET",e,t)}))}post(e,t,r){return n(this,void 0,void 0,(function*(){return this._handleRequest("POST",e,t,r)}))}put(e,t,r){return n(this,void 0,void 0,(function*(){return this._handleRequest("PUT",e,t,r)}))}patch(e,t,r){return n(this,void 0,void 0,(function*(){return this._handleRequest("PATCH",e,t,r)}))}delete(e,t){return n(this,void 0,void 0,(function*(){return this._handleRequest("DELETE",e,t)}))}get proxy(){var e;return"proxy"===this.key&&!!(null===(e=this.namespaceOptions.fetch.options.proxy)||void 0===e?void 0:e.url)}}t.AbstractRestClient=l,t.AbstractRestfulClient=l},5263:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5292:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ModelsRestClient=void 0;const s=r(4306),o=r(5096);class i extends o.AbstractRestClient{constructor(){super(...arguments),this.namespace="models"}getAll(e=":version/models",t={}){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(e,{},t);return{result:yield this.get(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getModel(e,t=":version/models/:modelId"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{modelId:e});return{result:yield this.get(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}}t.ModelsRestClient=i},5357:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiveClient=t.ListenLiveClient=void 0;const n=r(740),s=r(6416),o=r(4306);class i extends n.AbstractLiveClient{constructor(e,t={},r=":version/listen"){var n,s;if(super(e),this.namespace="listen",(null===(n=t.keyterm)||void 0===n?void 0:n.length)&&!(null===(s=t.model)||void 0===s?void 0:s.startsWith("nova-3")))throw new o.DeepgramError("Keyterms are only supported with the Nova 3 models.");this.connect(t,r)}setupConnection(){this.setupConnectionEvents({Open:s.LiveTranscriptionEvents.Open,Close:s.LiveTranscriptionEvents.Close,Error:s.LiveTranscriptionEvents.Error}),this.conn&&(this.conn.onmessage=e=>{var t,r,n,o;try{const t=JSON.parse(e.data.toString());t.type===s.LiveTranscriptionEvents.Metadata?this.emit(s.LiveTranscriptionEvents.Metadata,t):t.type===s.LiveTranscriptionEvents.Transcript?this.emit(s.LiveTranscriptionEvents.Transcript,t):t.type===s.LiveTranscriptionEvents.UtteranceEnd?this.emit(s.LiveTranscriptionEvents.UtteranceEnd,t):t.type===s.LiveTranscriptionEvents.SpeechStarted?this.emit(s.LiveTranscriptionEvents.SpeechStarted,t):this.emit(s.LiveTranscriptionEvents.Unhandled,t)}catch(i){this.emit(s.LiveTranscriptionEvents.Error,{event:e,message:"Unable to parse `data` as JSON.",error:i,url:null===(t=this.conn)||void 0===t?void 0:t.url,readyState:null===(r=this.conn)||void 0===r?void 0:r.readyState,data:(null===(n=e.data)||void 0===n?void 0:n.toString().substring(0,200))+((null===(o=e.data)||void 0===o?void 0:o.toString().length)>200?"...":"")})}})}configure(e){this.send(JSON.stringify({type:"Configure",processors:e}))}keepAlive(){this.send(JSON.stringify({type:"KeepAlive"}))}finalize(){this.send(JSON.stringify({type:"Finalize"}))}finish(){this.requestClose()}requestClose(){this.send(JSON.stringify({type:"CloseStream"}))}}t.ListenLiveClient=i,t.LiveClient=i},5569:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="0.0.0-automated"},5793:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBun=t.isNode=t.isBrowser=t.BROWSER_AGENT=t.BUN_VERSION=t.NODE_VERSION=void 0,t.NODE_VERSION="undefined"!=typeof process&&process.versions&&process.versions.node?process.versions.node:"unknown",t.BUN_VERSION="undefined"!=typeof process&&process.versions&&process.versions.bun?process.versions.bun:"unknown",t.BROWSER_AGENT="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:"unknown",t.isBrowser=()=>"unknown"!==t.BROWSER_AGENT,t.isNode=()=>"unknown"!==t.NODE_VERSION,t.isBun=()=>"unknown"!==t.BUN_VERSION},5874:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6180:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6245:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.resolveResponse=t.fetchWithAuth=t.resolveFetch=void 0;const u=r(684),c=a(r(8389));t.resolveFetch=e=>{let t;return t=e||("undefined"==typeof fetch?c.default:fetch),(...e)=>t(...e)},t.fetchWithAuth=({apiKey:e,customFetch:r,accessToken:n})=>{const s=(0,t.resolveFetch)(r),o=(0,u.resolveHeadersConstructor)();return(t,r)=>i(void 0,void 0,void 0,(function*(){const i=new o(null==r?void 0:r.headers);return i.has("Authorization")||i.set("Authorization",n?`Bearer ${n}`:`Token ${e}`),s(t,Object.assign(Object.assign({},r),{headers:i}))}))},t.resolveResponse=()=>i(void 0,void 0,void 0,(function*(){return"undefined"==typeof Response?(yield Promise.resolve().then((()=>o(r(8389))))).Response:Response}))},6287:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,r="millisecond",n="second",s="minute",o="hour",i="day",a="week",u="month",c="quarter",l="year",d="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},y=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},g={s:y,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),s=r%60;return(t<=0?"+":"-")+y(n,2,"0")+":"+y(s,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),s=t.clone().add(n,u),o=r-s<0,i=t.clone().add(n+(o?-1:1),u);return+(-(n+(r-s)/(o?s-i:i-s))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:l,w:a,d:i,D:d,h:o,m:s,s:n,ms:r,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},m="en",b={};b[m]=v;var _="$isDayjsObject",w=function(e){return e instanceof S||!(!e||!e[_])},O=function e(t,r,n){var s;if(!t)return m;if("string"==typeof t){var o=t.toLowerCase();b[o]&&(s=o),r&&(b[o]=r,s=o);var i=t.split("-");if(!s&&i.length>1)return e(i[0])}else{var a=t.name;b[a]=t,s=a}return!n&&s&&(m=s),s||!n&&m},E=function(e,t){if(w(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new S(r)},j=g;j.l=O,j.i=w,j.w=function(e,t){return E(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function v(e){this.$L=O(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[_]=!0}var y=v.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(j.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(p);if(n){var s=n[2]-1||0,o=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)}}return new Date(t)}(e),this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return j},y.isValid=function(){return!(this.$d.toString()===h)},y.isSame=function(e,t){var r=E(e);return this.startOf(t)<=r&&r<=this.endOf(t)},y.isAfter=function(e,t){return E(e)<this.startOf(t)},y.isBefore=function(e,t){return this.endOf(t)<E(e)},y.$g=function(e,t,r){return j.u(e)?this[t]:this.set(r,e)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(e,t){var r=this,c=!!j.u(t)||t,h=j.p(e),p=function(e,t){var n=j.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return c?n:n.endOf(i)},f=function(e,t){return j.w(r.toDate()[e].apply(r.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},v=this.$W,y=this.$M,g=this.$D,m="set"+(this.$u?"UTC":"");switch(h){case l:return c?p(1,0):p(31,11);case u:return c?p(1,y):p(0,y+1);case a:var b=this.$locale().weekStart||0,_=(v<b?v+7:v)-b;return p(c?g-_:g+(6-_),y);case i:case d:return f(m+"Hours",0);case o:return f(m+"Minutes",1);case s:return f(m+"Seconds",2);case n:return f(m+"Milliseconds",3);default:return this.clone()}},y.endOf=function(e){return this.startOf(e,!1)},y.$set=function(e,t){var a,c=j.p(e),h="set"+(this.$u?"UTC":""),p=(a={},a[i]=h+"Date",a[d]=h+"Date",a[u]=h+"Month",a[l]=h+"FullYear",a[o]=h+"Hours",a[s]=h+"Minutes",a[n]=h+"Seconds",a[r]=h+"Milliseconds",a)[c],f=c===i?this.$D+(t-this.$W):t;if(c===u||c===l){var v=this.clone().set(d,1);v.$d[p](f),v.init(),this.$d=v.set(d,Math.min(this.$D,v.daysInMonth())).$d}else p&&this.$d[p](f);return this.init(),this},y.set=function(e,t){return this.clone().$set(e,t)},y.get=function(e){return this[j.p(e)]()},y.add=function(r,c){var d,h=this;r=Number(r);var p=j.p(c),f=function(e){var t=E(h);return j.w(t.date(t.date()+Math.round(e*r)),h)};if(p===u)return this.set(u,this.$M+r);if(p===l)return this.set(l,this.$y+r);if(p===i)return f(1);if(p===a)return f(7);var v=(d={},d[s]=e,d[o]=t,d[n]=1e3,d)[p]||1,y=this.$d.getTime()+r*v;return j.w(y,this)},y.subtract=function(e,t){return this.add(-1*e,t)},y.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||h;var n=e||"YYYY-MM-DDTHH:mm:ssZ",s=j.z(this),o=this.$H,i=this.$m,a=this.$M,u=r.weekdays,c=r.months,l=r.meridiem,d=function(e,r,s,o){return e&&(e[r]||e(t,n))||s[r].slice(0,o)},p=function(e){return j.s(o%12||12,e,"0")},v=l||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(f,(function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return j.s(t.$y,4,"0");case"M":return a+1;case"MM":return j.s(a+1,2,"0");case"MMM":return d(r.monthsShort,a,c,3);case"MMMM":return d(c,a);case"D":return t.$D;case"DD":return j.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(r.weekdaysMin,t.$W,u,2);case"ddd":return d(r.weekdaysShort,t.$W,u,3);case"dddd":return u[t.$W];case"H":return String(o);case"HH":return j.s(o,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return v(o,i,!0);case"A":return v(o,i,!1);case"m":return String(i);case"mm":return j.s(i,2,"0");case"s":return String(t.$s);case"ss":return j.s(t.$s,2,"0");case"SSS":return j.s(t.$ms,3,"0");case"Z":return s}return null}(e)||s.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(r,d,h){var p,f=this,v=j.p(d),y=E(r),g=(y.utcOffset()-this.utcOffset())*e,m=this-y,b=function(){return j.m(f,y)};switch(v){case l:p=b()/12;break;case u:p=b();break;case c:p=b()/3;break;case a:p=(m-g)/6048e5;break;case i:p=(m-g)/864e5;break;case o:p=m/t;break;case s:p=m/e;break;case n:p=m/1e3;break;default:p=m}return h?p:j.a(p)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return b[this.$L]},y.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=O(e,t,!0);return n&&(r.$L=n),r},y.clone=function(){return j.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},v}(),T=S.prototype;return E.prototype=T,[["$ms",r],["$s",n],["$m",s],["$H",o],["$W",i],["$M",u],["$y",l],["$D",d]].forEach((function(e){T[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),E.extend=function(e,t){return e.$i||(e(t,S,E),e.$i=!0),E},E.locale=O,E.isDayjs=w,E.unix=function(e){return E(1e3*e)},E.en=b[m],E.Ls=b,E.p={},E}()},6302:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6327:(e,t,r)=>{"use strict";function n(e){return"transcriptionData"in e}r.r(t),r.d(t,{AssemblyAiConverter:()=>h,DeepgramConverter:()=>l,chunkArray:()=>c,isConverter:()=>n,secondsToTimestamp:()=>u,srt:()=>v,webvtt:()=>f});var s=r(6287),o=r.n(s),i=r(4268),a=r.n(i);function u(e,t="HH:mm:ss.SSS"){return o()(1e3*e).utc().format(t)}function c(e,t){const r=[];for(let n=0;n<e.length;n+=t){const s=e.slice(n,n+t);r.push(s)}return r}o().extend(a());class l{constructor(e){this.transcriptionData=e}getLines(e=8){const{results:t}=this.transcriptionData;let r=[];if(t.utterances)t.utterances.forEach((t=>{t.words.length>e?r.push(...c(t.words,e)):r.push(t.words)}));else{const n=t.channels[0].alternatives[0].words,s="speaker"in n[0];let o=[],i=0;n.forEach((t=>{var n;s&&t.speaker!==i&&(r.push(o),o=[]),o.length===e&&(r.push(o),o=[]),s&&(i=null!==(n=t.speaker)&&void 0!==n?n:0),o.push(t)})),r.push(o)}return r}getHeaders(){var e,t,r,n,s,o,i,a;const u=[];return u.push("NOTE"),u.push("Transcription provided by Deepgram"),(null===(e=this.transcriptionData.metadata)||void 0===e?void 0:e.request_id)&&u.push(`Request Id: ${null===(t=this.transcriptionData.metadata)||void 0===t?void 0:t.request_id}`),(null===(r=this.transcriptionData.metadata)||void 0===r?void 0:r.created)&&u.push(`Created: ${null===(n=this.transcriptionData.metadata)||void 0===n?void 0:n.created}`),(null===(s=this.transcriptionData.metadata)||void 0===s?void 0:s.duration)&&u.push(`Duration: ${null===(o=this.transcriptionData.metadata)||void 0===o?void 0:o.duration}`),(null===(i=this.transcriptionData.metadata)||void 0===i?void 0:i.channels)&&u.push(`Channels: ${null===(a=this.transcriptionData.metadata)||void 0===a?void 0:a.channels}`),u}}const d=e=>({word:e.text,start:e.start,end:e.end,confidence:e.confidence,punctuated_word:e.text,speaker:e.speaker});class h{constructor(e){this.transcriptionData=e}getLines(e=8){const t=this.transcriptionData;let r=[];return t.utterances?t.utterances.forEach((t=>{t.words.length>e?r.push(...c(t.words.map((e=>d(e))),e)):r.push(t.words.map((e=>d(e))))})):r.push(...c(t.words.map((e=>d(e))),e)),r}getHeaders(){const e=[];return e.push("NOTE"),e.push("Transcription provided by Assembly AI"),this.transcriptionData.id&&e.push(`Id: ${this.transcriptionData.id}`),this.transcriptionData.audio_duration&&e.push(`Duration: ${this.transcriptionData.audio_duration}`),e}}const p=e=>n(e)?e:new l(e),f=(e,t=8)=>{const r=[];let n=p(e);r.push("WEBVTT"),r.push(""),n.getHeaders&&r.push(n.getHeaders().join("\n")),n.getHeaders&&r.push("");const s=n.getLines(t),o="speaker"in s[0][0];return s.forEach((e=>{const t=e[0],n=e[e.length-1];r.push(`${u(t.start)} --\x3e ${u(n.end)}`);const s=e.map((e=>{var t;return null!==(t=e.punctuated_word)&&void 0!==t?t:e.word})).join(" "),i=o?`<v Speaker ${t.speaker}>`:"";r.push(`${i}${s}`),r.push("")})),r.join("\n")},v=(e,t=8)=>{const r=[];let n=p(e).getLines(t);const s="speaker"in n[0][0];let o,i=1;return n.forEach((e=>{r.push((i++).toString());const t=e[0],n=e[e.length-1];r.push(`${u(t.start,"HH:mm:ss,SSS")} --\x3e ${u(n.end,"HH:mm:ss,SSS")}`);const a=e.map((e=>{var t;return null!==(t=e.punctuated_word)&&void 0!==t?t:e.word})).join(" "),c=s&&o!==t.speaker?`[Speaker ${t.speaker}]\n`:"";r.push(`${c}${a}`),r.push(""),o=t.speaker})),r.join("\n")}},6416:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(1176),t),s(r(3063),t),s(r(6487),t),s(r(986),t)},6487:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.LiveTranscriptionEvents=void 0,(r=t.LiveTranscriptionEvents||(t.LiveTranscriptionEvents={})).Open="open",r.Close="close",r.Error="error",r.Transcript="Results",r.Metadata="Metadata",r.UtteranceEnd="UtteranceEnd",r.SpeechStarted="SpeechStarted",r.Unhandled="Unhandled"},6544:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6731:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(5066),t),s(r(740),t),s(r(5096),t),s(r(2043),t),s(r(472),t),s(r(875),t),s(r(5357),t),s(r(6733),t),s(r(7361),t),s(r(5292),t),s(r(3242),t),s(r(367),t),s(r(398),t),s(r(3712),t),s(r(4492),t)},6733:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PrerecordedClient=t.ListenRestClient=void 0;const s=r(684),o=r(4306),i=r(5096);class a extends i.AbstractRestClient{constructor(){super(...arguments),this.namespace="listen"}transcribeUrl(e,t,r=":version/listen"){var i,a;return n(this,void 0,void 0,(function*(){try{let n;if(!(0,s.isUrlSource)(e))throw new o.DeepgramError("Unknown transcription source type");if(n=JSON.stringify(e),void 0!==t&&"callback"in t)throw new o.DeepgramError("Callback cannot be provided as an option to a synchronous transcription. Use `transcribeUrlCallback` or `transcribeFileCallback` instead.");if((null===(i=null==t?void 0:t.keyterm)||void 0===i?void 0:i.length)&&!(null===(a=t.model)||void 0===a?void 0:a.startsWith("nova-3")))throw new o.DeepgramError("Keyterms are only supported with the Nova 3 models.");const u=this.getRequestUrl(r,{},Object.assign({},t));return{result:yield this.post(u,n).then((e=>e.json())),error:null}}catch(e){if((0,o.isDeepgramError)(e))return{result:null,error:e};throw e}}))}transcribeFile(e,t,r=":version/listen"){return n(this,void 0,void 0,(function*(){try{let n;if(!(0,s.isFileSource)(e))throw new o.DeepgramError("Unknown transcription source type");if(n=e,void 0!==t&&"callback"in t)throw new o.DeepgramError("Callback cannot be provided as an option to a synchronous transcription. Use `transcribeUrlCallback` or `transcribeFileCallback` instead.");const i=this.getRequestUrl(r,{},Object.assign({},t));return{result:yield this.post(i,n,{headers:{"Content-Type":"deepgram/audio+video"}}).then((e=>e.json())),error:null}}catch(e){if((0,o.isDeepgramError)(e))return{result:null,error:e};throw e}}))}transcribeUrlCallback(e,t,r,i=":version/listen"){return n(this,void 0,void 0,(function*(){try{let n;if(!(0,s.isUrlSource)(e))throw new o.DeepgramError("Unknown transcription source type");n=JSON.stringify(e);const a=this.getRequestUrl(i,{},Object.assign(Object.assign({},r),{callback:t.toString()}));return{result:yield this.post(a,n).then((e=>e.json())),error:null}}catch(e){if((0,o.isDeepgramError)(e))return{result:null,error:e};throw e}}))}transcribeFileCallback(e,t,r,i=":version/listen"){return n(this,void 0,void 0,(function*(){try{let n;if(!(0,s.isFileSource)(e))throw new o.DeepgramError("Unknown transcription source type");n=e;const a=this.getRequestUrl(i,{},Object.assign(Object.assign({},r),{callback:t.toString()}));return{result:yield this.post(a,n,{headers:{"Content-Type":"deepgram/audio+video"}}).then((e=>e.json())),error:null}}catch(e){if((0,o.isDeepgramError)(e))return{result:null,error:e};throw e}}))}}t.ListenRestClient=a,t.PrerecordedClient=a},7034:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7205:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7314:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===r}(e)}(e)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function s(e,t,r){return e.concat(t).map((function(e){return n(e,r)}))}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function i(e,t){try{return t in e}catch(e){return!1}}function a(e,r,u){(u=u||{}).arrayMerge=u.arrayMerge||s,u.isMergeableObject=u.isMergeableObject||t,u.cloneUnlessOtherwiseSpecified=n;var c=Array.isArray(r);return c===Array.isArray(e)?c?u.arrayMerge(e,r,u):function(e,t,r){var s={};return r.isMergeableObject(e)&&o(e).forEach((function(t){s[t]=n(e[t],r)})),o(t).forEach((function(o){(function(e,t){return i(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(i(e,o)&&r.isMergeableObject(t[o])?s[o]=function(e,t){if(!t.customMerge)return a;var r=t.customMerge(e);return"function"==typeof r?r:a}(o,r)(e[o],t[o],r):s[o]=n(t[o],r))})),s}(e,r,u):n(r,u)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return a(e,r,t)}),{})};var u=a;e.exports=u},7361:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ManageClient=t.ManageRestClient=void 0;const s=r(4306),o=r(5096);class i extends o.AbstractRestClient{constructor(){super(...arguments),this.namespace="manage"}getTokenDetails(e=":version/auth/token"){return n(this,void 0,void 0,(function*(){try{const t=this.getRequestUrl(e);return{result:yield this.get(t).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjects(e=":version/projects"){return n(this,void 0,void 0,(function*(){try{const t=this.getRequestUrl(e);return{result:yield this.get(t).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProject(e,t=":version/projects/:projectId"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{projectId:e});return{result:yield this.get(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}updateProject(e,t,r=":version/projects/:projectId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e},t),s=JSON.stringify(t);return{result:yield this.patch(n,s).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}deleteProject(e,t=":version/projects/:projectId"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{projectId:e});return yield this.delete(r),{error:null}}catch(e){if((0,s.isDeepgramError)(e))return{error:e};throw e}}))}getProjectKeys(e,t=":version/projects/:projectId/keys"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{projectId:e});return{result:yield this.get(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjectKey(e,t,r=":version/projects/:projectId/keys/:keyId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,keyId:t});return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}createProjectKey(e,t,r=":version/projects/:projectId/keys"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e},t),s=JSON.stringify(t);return{result:yield this.post(n,s).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}deleteProjectKey(e,t,r=":version/projects/:projectId/keys/:keyId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,keyId:t});return yield this.delete(n),{error:null}}catch(e){if((0,s.isDeepgramError)(e))return{error:e};throw e}}))}getProjectMembers(e,t=":version/projects/:projectId/members"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{projectId:e});return{result:yield this.get(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}removeProjectMember(e,t,r=":version/projects/:projectId/members/:memberId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,memberId:t});return yield this.delete(n),{error:null}}catch(e){if((0,s.isDeepgramError)(e))return{error:e};throw e}}))}getProjectMemberScopes(e,t,r=":version/projects/:projectId/members/:memberId/scopes"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,memberId:t});return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}updateProjectMemberScope(e,t,r,o=":version/projects/:projectId/members/:memberId/scopes"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(o,{projectId:e,memberId:t},r),s=JSON.stringify(r);return{result:yield this.put(n,s).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjectInvites(e,t=":version/projects/:projectId/invites"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{projectId:e});return{result:yield this.get(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}sendProjectInvite(e,t,r=":version/projects/:projectId/invites"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e},t),s=JSON.stringify(t);return{result:yield this.post(n,s).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}deleteProjectInvite(e,t,r=":version/projects/:projectId/invites/:email"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,email:t});return yield this.delete(n),{error:null}}catch(e){if((0,s.isDeepgramError)(e))return{error:e};throw e}}))}leaveProject(e,t=":version/projects/:projectId/leave"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{projectId:e});return{result:yield this.delete(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjectUsageRequests(e,t,r=":version/projects/:projectId/requests"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e},t);return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjectUsageRequest(e,t,r=":version/projects/:projectId/requests/:requestId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,requestId:t});return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjectUsageSummary(e,t,r=":version/projects/:projectId/usage"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e},t);return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjectUsageFields(e,t,r=":version/projects/:projectId/usage/fields"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e},t);return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjectBalances(e,t=":version/projects/:projectId/balances"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{projectId:e});return{result:yield this.get(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjectBalance(e,t,r=":version/projects/:projectId/balances/:balanceId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,balanceId:t});return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getAllModels(e,t={},r=":version/projects/:projectId/models"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e},t);return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getModel(e,t,r=":version/projects/:projectId/models/:modelId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,modelId:t});return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}}t.ManageRestClient=i,t.ManageClient=i},7897:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8034:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8378:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8389:(e,t,r)=>{var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==r.g&&r.g,s=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==r.g&&r.g||{},s="URLSearchParams"in n,o="Symbol"in n&&"iterator"in Symbol,i="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in n,u="ArrayBuffer"in n;if(u)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function d(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return o&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function v(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function y(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=y(t);return t.readAsArrayBuffer(e),r}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:s&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=v(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return v(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(i)return this.blob().then(g);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,r,n,s,o=v(this);if(o)return o;if(this._bodyBlob)return e=this._bodyBlob,r=y(t=new FileReader),s=(n=/charset=([A-Za-z0-9_-]+)/.exec(e.type))?n[1]:"utf-8",t.readAsText(e,s),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(O)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=d(e),t=h(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},f.prototype.delete=function(e){delete this.map[d(e)]},f.prototype.get=function(e){return e=d(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(d(e))},f.prototype.set=function(e,t){this.map[d(e)]=h(t)},f.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),p(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),p(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),p(e)},o&&(f.prototype[Symbol.iterator]=f.prototype.entries);var _=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function w(e,t){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,s,o=(t=t||{}).body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(s=(r=t.method||this.method||"GET").toUpperCase(),_.indexOf(s)>-1?s:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in n)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;i.test(this.url)?this.url=this.url.replace(i,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function O(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),s=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(s))}})),t}function E(e,t){if(!(this instanceof E))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},b.call(w.prototype),b.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},E.error=function(){var e=new E(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var j=[301,302,303,307,308];E.redirect=function(e,t){if(-1===j.indexOf(t))throw new RangeError("Invalid status code");return new E(null,{status:t,headers:{location:e}})},t.DOMException=n.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,r){return new Promise((function(s,o){var a=new w(e,r);if(a.signal&&a.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function l(){c.abort()}if(c.onload=function(){var e,t,r={statusText:c.statusText,headers:(e=c.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var s=r.join(":").trim();try{t.append(n,s)}catch(e){console.warn("Response "+e.message)}}})),t)};0===a.url.indexOf("file://")&&(c.status<200||c.status>599)?r.status=200:r.status=c.status,r.url="responseURL"in c?c.responseURL:r.headers.get("X-Request-URL");var n="response"in c?c.response:c.responseText;setTimeout((function(){s(new E(n,r))}),0)},c.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},c.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request timed out"))}),0)},c.onabort=function(){setTimeout((function(){o(new t.DOMException("Aborted","AbortError"))}),0)},c.open(a.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(a.url),!0),"include"===a.credentials?c.withCredentials=!0:"omit"===a.credentials&&(c.withCredentials=!1),"responseType"in c&&(i?c.responseType="blob":u&&(c.responseType="arraybuffer")),r&&"object"==typeof r.headers&&!(r.headers instanceof f||n.Headers&&r.headers instanceof n.Headers)){var p=[];Object.getOwnPropertyNames(r.headers).forEach((function(e){p.push(d(e)),c.setRequestHeader(e,h(r.headers[e]))})),a.headers.forEach((function(e,t){-1===p.indexOf(t)&&c.setRequestHeader(t,e)}))}else a.headers.forEach((function(e,t){c.setRequestHeader(t,e)}));a.signal&&(a.signal.addEventListener("abort",l),c.onreadystatechange=function(){4===c.readyState&&a.signal.removeEventListener("abort",l)}),c.send(void 0===a._bodyInit?null:a._bodyInit)}))}S.polyfill=!0,n.fetch||(n.fetch=S,n.Headers=f,n.Request=w,n.Response=E),t.Headers=f,t.Request=w,t.Response=E,t.fetch=S,Object.defineProperty(t,"__esModule",{value:!0})}({})}(s),s.fetch.ponyfill=!0,delete s.fetch.polyfill;var o=n.fetch?n:s;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t},8457:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8502:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8600:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8633:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8712:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONNECTION_STATE=t.SOCKET_STATES=t.DEFAULT_OPTIONS=t.DEFAULT_AGENT_OPTIONS=t.DEFAULT_GLOBAL_OPTIONS=t.DEFAULT_AGENT_URL=t.DEFAULT_URL=t.DEFAULT_HEADERS=void 0;const n=r(684),s=r(5793),o=r(5569);var i,a;t.DEFAULT_HEADERS={"Content-Type":"application/json","X-Client-Info":`@deepgram/sdk; ${(0,s.isBrowser)()?"browser":"server"}; v${o.version}`,"User-Agent":`@deepgram/sdk/${o.version} ${(0,s.isNode)()?`node/${s.NODE_VERSION}`:(0,s.isBun)()?`bun/${s.BUN_VERSION}`:(0,s.isBrowser)()?`javascript ${s.BROWSER_AGENT}`:"unknown"}`},t.DEFAULT_URL="https://api.deepgram.com",t.DEFAULT_AGENT_URL="wss://agent.deepgram.com",t.DEFAULT_GLOBAL_OPTIONS={fetch:{options:{url:t.DEFAULT_URL,headers:t.DEFAULT_HEADERS}},websocket:{options:{url:(0,n.convertProtocolToWs)(t.DEFAULT_URL),_nodeOnlyHeaders:t.DEFAULT_HEADERS}}},t.DEFAULT_AGENT_OPTIONS={fetch:{options:{url:t.DEFAULT_URL,headers:t.DEFAULT_HEADERS}},websocket:{options:{url:t.DEFAULT_AGENT_URL,_nodeOnlyHeaders:t.DEFAULT_HEADERS}}},t.DEFAULT_OPTIONS={global:t.DEFAULT_GLOBAL_OPTIONS,agent:t.DEFAULT_AGENT_OPTIONS},(a=t.SOCKET_STATES||(t.SOCKET_STATES={}))[a.connecting=0]="connecting",a[a.open=1]="open",a[a.closing=2]="closing",a[a.closed=3]="closed",(i=t.CONNECTION_STATE||(t.CONNECTION_STATE={})).Connecting="connecting",i.Open="open",i.Closing="closing",i.Closed="closed"},8785:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8968:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9042:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9115:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9176:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9475:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9518:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9784:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function s(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",s),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,s)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var i=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var s,o,i,c;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),i=o[t]),void 0===i)i=o[t]=r,++e._eventsCount;else if("function"==typeof i?i=o[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),(s=u(e))>0&&i.length>s&&!i.warned){i.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=i.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},s=l.bind(n);return s.listener=r,n.wrapFn=s,s}function h(e,t,r){var n=e._events;if(void 0===n)return[];var s=n[t];return void 0===s?[]:"function"==typeof s?r?[s.listener||s]:[s]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(s):f(s,s.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function f(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function v(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function s(o){n.once&&e.removeEventListener(t,s),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");i=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var s="error"===e,o=this._events;if(void 0!==o)s=s&&void 0===o.error;else if(!s)return!1;if(s){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var a=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw a.context=i,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,l=f(u,c);for(r=0;r<c;++r)n(l[r],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,d(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,d(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,s,o,i;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(s=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){i=r[o].listener,s=o;break}if(s<0)return this;0===s?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,s),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,i||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var s,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(s=o[n])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},9836:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(3465)})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.deepgram=t():e.deepgram=t()}(self,(()=>(()=>{var e={367:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OnPremClient=t.SelfHostedRestClient=void 0;const s=r(4306),o=r(5096);class i extends o.AbstractRestClient{constructor(){super(...arguments),this.namespace="selfhosted"}listCredentials(e,t=":version/projects/:projectId/onprem/distribution/credentials"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{projectId:e});return{result:yield this.get(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getCredentials(e,t,r=":version/projects/:projectId/onprem/distribution/credentials/:credentialsId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,credentialsId:t});return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}createCredentials(e,t,r=":version/projects/:projectId/onprem/distribution/credentials"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e}),s=JSON.stringify(t);return{result:yield this.post(n,s).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}deleteCredentials(e,t,r=":version/projects/:projectId/onprem/distribution/credentials/:credentialsId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,credentialsId:t});return{result:yield this.delete(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}}t.SelfHostedRestClient=i,t.OnPremClient=i},398:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakClient=void 0;const n=r(5066),s=r(3712),o=r(4492);class i extends n.AbstractClient{constructor(){super(...arguments),this.namespace="speak"}request(e,t,r=":version/speak"){return new o.SpeakRestClient(this.options).request(e,t,r)}live(e={},t=":version/speak"){return new s.SpeakLiveClient(this.options,e,t)}}t.SpeakClient=i},459:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},472:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthRestClient=void 0;const s=r(4306),o=r(5096);class i extends o.AbstractRestClient{constructor(){super(...arguments),this.namespace="auth"}grantToken(e={},t=":version/auth/grant"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t),n=JSON.stringify(e);return{result:yield this.post(r,n,{headers:{"Content-Type":"application/json"}}).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}}t.AuthRestClient=i},569:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},684:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.convertLegacyOptions=t.isDeepgramClientOptions=t.isLiveSchema=t.buildRequestUrl=t.convertProtocolToWs=t.CallbackUrl=t.isFileSource=t.isTextSource=t.isUrlSource=t.resolveHeadersConstructor=t.appendSearchParams=t.applyDefaults=t.stripTrailingSlash=void 0;const s=r(8389),o=n(r(7314)),i=r(5793);function a(e,t){Object.keys(t).forEach((r=>{Array.isArray(t[r])?t[r].forEach((t=>{e.append(r,String(t))})):e.append(r,String(t[r]))}))}t.stripTrailingSlash=function(e){return e.replace(/\/$/,"")},t.applyDefaults=function(e={},t={}){return(0,o.default)(t,e)},t.appendSearchParams=a,t.resolveHeadersConstructor=()=>"undefined"==typeof Headers?s.Headers:Headers,t.isUrlSource=e=>!(!e||!e.url),t.isTextSource=e=>!(!e||!e.text),t.isFileSource=e=>!(!c(e)&&!u(e));const u=e=>null!=e&&Buffer.isBuffer(e),c=e=>null!=e&&!(0,i.isBrowser)()&&"object"==typeof e&&"function"==typeof e.pipe&&"function"==typeof e.read&&"object"==typeof e._readableState;class l extends URL{constructor(){super(...arguments),this.callbackUrl=!0}}t.CallbackUrl=l,t.convertProtocolToWs=e=>e.toLowerCase().replace(/^http/,"ws"),t.buildRequestUrl=(e,t,r)=>{const n=new URL(e,t);return a(n.searchParams,r),n},t.isLiveSchema=function(e){return null!=e&&void 0!==e.interim_results},t.isDeepgramClientOptions=function(e){return null!=e&&void 0!==e.global},t.convertLegacyOptions=e=>{var t,r,n,s,i,a;const u={};return e._experimentalCustomFetch&&(u.global={fetch:{client:e._experimentalCustomFetch}}),(null===(t=(e=(0,o.default)(e,u)).restProxy)||void 0===t?void 0:t.url)&&(u.global={fetch:{options:{proxy:{url:null===(r=e.restProxy)||void 0===r?void 0:r.url}}}}),(null===(n=(e=(0,o.default)(e,u)).global)||void 0===n?void 0:n.url)&&(u.global={fetch:{options:{url:e.global.url}},websocket:{options:{url:e.global.url}}}),(null===(s=(e=(0,o.default)(e,u)).global)||void 0===s?void 0:s.headers)&&(u.global={fetch:{options:{headers:null===(i=e.global)||void 0===i?void 0:i.headers}},websocket:{options:{_nodeOnlyHeaders:null===(a=e.global)||void 0===a?void 0:a.headers}}}),(0,o.default)(e,u)}},740:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractWsClient=t.AbstractLiveClient=void 0;const a=r(5066),u=r(8712),c=r(5793),l=r(4306),d="undefined"!=typeof WebSocket;class h extends a.AbstractClient{constructor(e){super(e),this.conn=null,this.sendBuffer=[],this.reconnect=a.noop;const{key:t,websocket:{options:r,client:n}}=this.namespaceOptions;this.proxy?this.baseUrl=r.proxy.url:this.baseUrl=r.url,this.transport=n||null,r._nodeOnlyHeaders?this.headers=r._nodeOnlyHeaders:this.headers={},"Authorization"in this.headers||(this.accessToken?this.headers.Authorization=`Bearer ${this.accessToken}`:this.headers.Authorization=`Token ${t}`)}connect(e,t){if(this.conn)return;this.reconnect=(r=e)=>{this.connect(r,t)};const n=this.getRequestUrl(t,{},e),s=this.accessToken,i=this.key;if(!s&&!i)throw new Error("No key or access token provided for WebSocket connection.");if(this.transport)return this.conn=new this.transport(n,void 0,{headers:this.headers}),void this.setupConnection();if((0,c.isBun)())Promise.resolve().then((()=>o(r(3584)))).then((({default:e})=>{this.conn=new e(n,{headers:this.headers}),console.log("Using WS package"),this.setupConnection()}));else{if(d)return this.conn=new WebSocket(n,s?["bearer",s]:["token",i]),void this.setupConnection();this.conn=new p(n,void 0,{close:()=>{this.conn=null}}),Promise.resolve().then((()=>o(r(3584)))).then((({default:e})=>{this.conn=new e(n,void 0,{headers:this.headers}),this.setupConnection()}))}}disconnect(e,t){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,null!=t?t:""):this.conn.close(),this.conn=null)}connectionState(){switch(this.conn&&this.conn.readyState){case u.SOCKET_STATES.connecting:return u.CONNECTION_STATE.Connecting;case u.SOCKET_STATES.open:return u.CONNECTION_STATE.Open;case u.SOCKET_STATES.closing:return u.CONNECTION_STATE.Closing;default:return u.CONNECTION_STATE.Closed}}getReadyState(){var e,t;return null!==(t=null===(e=this.conn)||void 0===e?void 0:e.readyState)&&void 0!==t?t:u.SOCKET_STATES.closed}isConnected(){return this.connectionState()===u.CONNECTION_STATE.Open}send(e){const t=()=>i(this,void 0,void 0,(function*(){var t;if(e instanceof Blob){if(0===e.size)return void this.log("warn","skipping `send` for zero-byte blob",e);e=yield e.arrayBuffer()}"string"==typeof e||(null==e?void 0:e.byteLength)?null===(t=this.conn)||void 0===t||t.send(e):this.log("warn","skipping `send` for zero-byte payload",e)}));this.isConnected()?t():this.sendBuffer.push(t)}get proxy(){var e;return"proxy"===this.key&&!!(null===(e=this.namespaceOptions.websocket.options.proxy)||void 0===e?void 0:e.url)}extractErrorInformation(e,t){var r;const n={};if(t&&(n.readyState=t.readyState,n.url="string"==typeof t.url?t.url:null===(r=t.url)||void 0===r?void 0:r.toString()),t&&"object"==typeof t){const r=t;if(r._req&&r._req.res&&(n.statusCode=r._req.res.statusCode,r._req.res.headers)){n.responseHeaders=Object.assign({},r._req.res.headers);const e=r._req.res.headers["dg-request-id"]||r._req.res.headers["x-dg-request-id"];e&&(n.requestId=e)}if(e&&"target"in e&&e.target){const t=e.target;t.url&&(n.url=t.url),void 0!==t.readyState&&(n.readyState=t.readyState)}}return n}createEnhancedError(e,t){const r=new l.DeepgramWebSocketError(e.message||"WebSocket connection error",Object.assign({originalEvent:e},t));return Object.assign(Object.assign({},e),{error:r,statusCode:t.statusCode,requestId:t.requestId,responseHeaders:t.responseHeaders,url:t.url,readyState:t.readyState,message:this.buildEnhancedErrorMessage(e,t)})}buildEnhancedErrorMessage(e,t){let r=e.message||"WebSocket connection error";const n=[];if(t.statusCode&&n.push(`Status: ${t.statusCode}`),t.requestId&&n.push(`Request ID: ${t.requestId}`),void 0!==t.readyState){const e=["CONNECTING","OPEN","CLOSING","CLOSED"][t.readyState]||`Unknown(${t.readyState})`;n.push(`Ready State: ${e}`)}return t.url&&n.push(`URL: ${t.url}`),n.length>0&&(r+=` (${n.join(", ")})`),r}setupConnectionEvents(e){this.conn&&(this.conn.onopen=()=>{this.emit(e.Open,this)},this.conn.onclose=t=>{this.emit(e.Close,t)},this.conn.onerror=t=>{const r=this.extractErrorInformation(t,this.conn||void 0),n=this.createEnhancedError(t,r);this.emit(e.Error,n)})}}t.AbstractLiveClient=h,t.AbstractWsClient=h;class p{constructor(e,t,r){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=u.SOCKET_STATES.connecting,this.send=()=>{},this.url=null,this.url=e.toString(),this.close=r.close}}},747:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},753:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},816:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},875:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ListenClient=void 0;const n=r(5066),s=r(5357),o=r(6733);class i extends n.AbstractClient{constructor(){super(...arguments),this.namespace="listen"}get prerecorded(){return new o.ListenRestClient(this.options)}live(e={},t=":version/listen"){return new s.ListenLiveClient(this.options,e,t)}}t.ListenClient=i},986:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.LiveTTSEvents=void 0,(r=t.LiveTTSEvents||(t.LiveTTSEvents={})).Open="Open",r.Close="Close",r.Error="Error",r.Metadata="Metadata",r.Flushed="Flushed",r.Warning="Warning",r.Audio="Audio",r.Unhandled="Unhandled"},1176:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.AgentEvents=void 0,(r=t.AgentEvents||(t.AgentEvents={})).Open="Open",r.Close="Close",r.Error="Error",r.Audio="Audio",r.Welcome="Welcome",r.SettingsApplied="SettingsApplied",r.ConversationText="ConversationText",r.UserStartedSpeaking="UserStartedSpeaking",r.AgentThinking="AgentThinking",r.FunctionCallRequest="FunctionCallRequest",r.AgentStartedSpeaking="AgentStartedSpeaking",r.AgentAudioDone="AgentAudioDone",r.InjectionRefused="InjectionRefused",r.PromptUpdated="PromptUpdated",r.SpeakUpdated="SpeakUpdated",r.Unhandled="Unhandled"},1221:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1556:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1557:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1775:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1828:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1901:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2043:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AgentLiveClient=void 0;const n=r(8712),s=r(1176),o=r(740);class i extends o.AbstractLiveClient{constructor(e,t="/:version/agent/converse"){var r,s,o,i;super(e),this.namespace="agent",this.baseUrl=null!==(i=null===(o=null===(s=null===(r=e.agent)||void 0===r?void 0:r.websocket)||void 0===s?void 0:s.options)||void 0===o?void 0:o.url)&&void 0!==i?i:n.DEFAULT_AGENT_URL,this.connect({},t)}setupConnection(){this.setupConnectionEvents({Open:s.AgentEvents.Open,Close:s.AgentEvents.Close,Error:s.AgentEvents.Error}),this.conn&&(this.conn.onmessage=e=>{this.handleMessage(e)})}handleMessage(e){var t,r,n,o,i,a;if("string"==typeof e.data)try{const t=JSON.parse(e.data);this.handleTextMessage(t)}catch(i){this.emit(s.AgentEvents.Error,{event:e,data:(null===(t=e.data)||void 0===t?void 0:t.toString().substring(0,200))+((null===(r=e.data)||void 0===r?void 0:r.toString().length)>200?"...":""),message:"Unable to parse `data` as JSON.",error:i,url:null===(n=this.conn)||void 0===n?void 0:n.url,readyState:null===(o=this.conn)||void 0===o?void 0:o.readyState})}else e.data instanceof Blob?e.data.arrayBuffer().then((e=>{this.handleBinaryMessage(Buffer.from(e))})):e.data instanceof ArrayBuffer?this.handleBinaryMessage(Buffer.from(e.data)):Buffer.isBuffer(e.data)?this.handleBinaryMessage(e.data):(console.log("Received unknown data type",e.data),this.emit(s.AgentEvents.Error,{event:e,message:"Received unknown data type.",url:null===(i=this.conn)||void 0===i?void 0:i.url,readyState:null===(a=this.conn)||void 0===a?void 0:a.readyState,dataType:typeof e.data}))}handleBinaryMessage(e){this.emit(s.AgentEvents.Audio,e)}handleTextMessage(e){e.type in s.AgentEvents?this.emit(e.type,e):this.emit(s.AgentEvents.Unhandled,e)}configure(e){const t=JSON.stringify(Object.assign({type:"Settings"},e));this.send(t)}updatePrompt(e){this.send(JSON.stringify({type:"UpdatePrompt",prompt:e}))}updateSpeak(e){this.send(JSON.stringify({type:"UpdateSpeak",speak:e}))}injectAgentMessage(e){this.send(JSON.stringify({type:"InjectAgentMessage",content:e}))}injectUserMessage(e){this.send(JSON.stringify({type:"InjectUserMessage",content:e}))}functionCallResponse(e){this.send(JSON.stringify(Object.assign({type:"FunctionCallResponse"},e)))}keepAlive(){this.send(JSON.stringify({type:"KeepAlive"}))}}t.AgentLiveClient=i},2171:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(3075),t),s(r(816),t),s(r(9836),t),s(r(8633),t),s(r(1901),t),s(r(3036),t),s(r(4852),t),s(r(5263),t),s(r(1749),t),s(r(9115),t),s(r(459),t),s(r(6544),t),s(r(8034),t),s(r(9518),t),s(r(8968),t),s(r(2701),t),s(r(8785),t),s(r(5874),t),s(r(9176),t),s(r(8457),t),s(r(3150),t),s(r(1557),t),s(r(4329),t),s(r(9042),t),s(r(6302),t),s(r(4592),t),s(r(8600),t),s(r(7205),t),s(r(747),t),s(r(9475),t),s(r(569),t),s(r(1221),t),s(r(8378),t),s(r(753),t),s(r(1775),t),s(r(2278),t),s(r(7034),t),s(r(4602),t),s(r(7897),t),s(r(1556),t),s(r(6180),t),s(r(1828),t),s(r(8502),t),s(r(4775),t),s(r(4198),t)},2278:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2701:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3036:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3063:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiveConnectionState=void 0;const n=r(8712);var s;(s=t.LiveConnectionState||(t.LiveConnectionState={}))[s.CONNECTING=n.SOCKET_STATES.connecting]="CONNECTING",s[s.OPEN=n.SOCKET_STATES.open]="OPEN",s[s.CLOSING=n.SOCKET_STATES.closing]="CLOSING",s[s.CLOSED=n.SOCKET_STATES.closed]="CLOSED"},3075:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3150:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3242:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ReadClient=t.ReadRestClient=void 0;const s=r(684),o=r(4306),i=r(5096);class a extends i.AbstractRestClient{constructor(){super(...arguments),this.namespace="read"}analyzeUrl(e,t,r=":version/read"){return n(this,void 0,void 0,(function*(){try{let n;if(!(0,s.isUrlSource)(e))throw new o.DeepgramError("Unknown source type");if(n=JSON.stringify(e),void 0!==t&&"callback"in t)throw new o.DeepgramError("Callback cannot be provided as an option to a synchronous transcription. Use `analyzeUrlCallback` or `analyzeTextCallback` instead.");const i=this.getRequestUrl(r,{},Object.assign({},t));return{result:yield this.post(i,n).then((e=>e.json())),error:null}}catch(e){if((0,o.isDeepgramError)(e))return{result:null,error:e};throw e}}))}analyzeText(e,t,r=":version/read"){return n(this,void 0,void 0,(function*(){try{let n;if(!(0,s.isTextSource)(e))throw new o.DeepgramError("Unknown source type");if(n=JSON.stringify(e),void 0!==t&&"callback"in t)throw new o.DeepgramError("Callback cannot be provided as an option to a synchronous requests. Use `analyzeUrlCallback` or `analyzeTextCallback` instead.");const i=this.getRequestUrl(r,{},Object.assign({},t));return{result:yield this.post(i,n).then((e=>e.json())),error:null}}catch(e){if((0,o.isDeepgramError)(e))return{result:null,error:e};throw e}}))}analyzeUrlCallback(e,t,r,i=":version/read"){return n(this,void 0,void 0,(function*(){try{let n;if(!(0,s.isUrlSource)(e))throw new o.DeepgramError("Unknown source type");n=JSON.stringify(e);const a=this.getRequestUrl(i,{},Object.assign(Object.assign({},r),{callback:t.toString()}));return{result:yield this.post(a,n).then((e=>e.json())),error:null}}catch(e){if((0,o.isDeepgramError)(e))return{result:null,error:e};throw e}}))}analyzeTextCallback(e,t,r,i=":version/read"){return n(this,void 0,void 0,(function*(){try{let n;if(!(0,s.isTextSource)(e))throw new o.DeepgramError("Unknown source type");n=JSON.stringify(e);const a=this.getRequestUrl(i,{},Object.assign(Object.assign({},r),{callback:t.toString()}));return{result:yield this.post(a,n,{headers:{"Content-Type":"deepgram/audio+video"}}).then((e=>e.json())),error:null}}catch(e){if((0,o.isDeepgramError)(e))return{result:null,error:e};throw e}}))}}t.ReadRestClient=a,t.ReadClient=a},3465:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.srt=t.webvtt=t.Deepgram=t.DeepgramClient=t.createClient=void 0;const i=r(4306),a=o(r(3695));t.DeepgramClient=a.default,t.Deepgram=class{constructor(e,t,r){throw this.apiKey=e,this.apiUrl=t,this.requireSSL=r,new i.DeepgramVersionError}},t.createClient=function(e,t){let r={};return"string"==typeof e||"function"==typeof e?("object"==typeof t&&(r=t),r.key=e):"object"==typeof e&&(r=e),new a.default(r)},s(r(6731),t),s(r(2171),t),s(r(6416),t),s(r(8712),t),s(r(4306),t),s(r(684),t);var u=r(6327);Object.defineProperty(t,"webvtt",{enumerable:!0,get:function(){return u.webvtt}}),Object.defineProperty(t,"srt",{enumerable:!0,get:function(){return u.srt}})},3584:e=>{"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},3695:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4306),s=r(6731);class o extends s.AbstractClient{get auth(){return new s.AuthRestClient(this.options)}get listen(){return new s.ListenClient(this.options)}get manage(){return new s.ManageClient(this.options)}get models(){return new s.ModelsRestClient(this.options)}get onprem(){return this.selfhosted}get selfhosted(){return new s.SelfHostedRestClient(this.options)}get read(){return new s.ReadClient(this.options)}get speak(){return new s.SpeakClient(this.options)}agent(e="/:version/agent/converse"){return new s.AgentLiveClient(this.options,e)}get transcription(){throw new n.DeepgramVersionError}get projects(){throw new n.DeepgramVersionError}get keys(){throw new n.DeepgramVersionError}get members(){throw new n.DeepgramVersionError}get scopes(){throw new n.DeepgramVersionError}get invitation(){throw new n.DeepgramVersionError}get usage(){throw new n.DeepgramVersionError}get billing(){throw new n.DeepgramVersionError}}t.default=o},3712:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakLiveClient=void 0;const n=r(740),s=r(6416);class o extends n.AbstractLiveClient{constructor(e,t={},r=":version/speak"){super(e),this.namespace="speak",this.connect(t,r)}setupConnection(){this.setupConnectionEvents({Open:s.LiveTTSEvents.Open,Close:s.LiveTTSEvents.Close,Error:s.LiveTTSEvents.Error}),this.conn&&(this.conn.onmessage=e=>{this.handleMessage(e)})}handleTextMessage(e){e.type===s.LiveTTSEvents.Metadata?this.emit(s.LiveTTSEvents.Metadata,e):e.type===s.LiveTTSEvents.Flushed?this.emit(s.LiveTTSEvents.Flushed,e):e.type===s.LiveTTSEvents.Warning?this.emit(s.LiveTTSEvents.Warning,e):this.emit(s.LiveTTSEvents.Unhandled,e)}handleBinaryMessage(e){this.emit(s.LiveTTSEvents.Audio,e)}sendText(e){this.send(JSON.stringify({type:"Speak",text:e}))}flush(){this.send(JSON.stringify({type:"Flush"}))}clear(){this.send(JSON.stringify({type:"Clear"}))}requestClose(){this.send(JSON.stringify({type:"Close"}))}handleMessage(e){var t,r,n,o,i,a;if("string"==typeof e.data)try{const t=JSON.parse(e.data);this.handleTextMessage(t)}catch(i){this.emit(s.LiveTTSEvents.Error,{event:e,message:"Unable to parse `data` as JSON.",error:i,url:null===(t=this.conn)||void 0===t?void 0:t.url,readyState:null===(r=this.conn)||void 0===r?void 0:r.readyState,data:(null===(n=e.data)||void 0===n?void 0:n.toString().substring(0,200))+((null===(o=e.data)||void 0===o?void 0:o.toString().length)>200?"...":"")})}else e.data instanceof Blob?e.data.arrayBuffer().then((e=>{this.handleBinaryMessage(Buffer.from(e))})):e.data instanceof ArrayBuffer?this.handleBinaryMessage(Buffer.from(e.data)):Buffer.isBuffer(e.data)?this.handleBinaryMessage(e.data):(console.log("Received unknown data type",e.data),this.emit(s.LiveTTSEvents.Error,{event:e,message:"Received unknown data type.",url:null===(i=this.conn)||void 0===i?void 0:i.url,readyState:null===(a=this.conn)||void 0===a?void 0:a.readyState,dataType:typeof e.data}))}}t.SpeakLiveClient=o},4198:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4268:function(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,s,o){var i=s.prototype;o.utc=function(e){return new s({date:e,utc:!0,args:arguments})},i.utc=function(t){var r=o(this.toDate(),{locale:this.$L,utc:!0});return t?r.add(this.utcOffset(),e):r},i.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var a=i.parse;i.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),a.call(this,e)};var u=i.init;i.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else u.call(this)};var c=i.utcOffset;i.utcOffset=function(n,s){var o=this.$utils().u;if(o(n))return this.$u?0:o(this.$offset)?c.call(this):this.$offset;if("string"==typeof n&&(n=function(e){void 0===e&&(e="");var n=e.match(t);if(!n)return null;var s=(""+n[0]).match(r)||["-",0,0],o=s[0],i=60*+s[1]+ +s[2];return 0===i?0:"+"===o?i:-i}(n),null===n))return this;var i=Math.abs(n)<=16?60*n:n,a=this;if(s)return a.$offset=i,a.$u=0===n,a;if(0!==n){var u=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(a=this.local().add(i+u,e)).$offset=i,a.$x.$localOffset=u}else a=this.utc();return a};var l=i.format;i.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,t)},i.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var d=i.toDate;i.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var h=i.diff;i.diff=function(e,t,r){if(e&&this.$u===e.$u)return h.call(this,e,t,r);var n=this.local(),s=o(e).local();return h.call(n,s,t,r)}}}()},4306:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeepgramWebSocketError=t.DeepgramVersionError=t.DeepgramUnknownError=t.DeepgramApiError=t.isDeepgramError=t.DeepgramError=void 0;class r extends Error{constructor(e){super(e),this.__dgError=!0,this.name="DeepgramError"}}t.DeepgramError=r,t.isDeepgramError=function(e){return"object"==typeof e&&null!==e&&"__dgError"in e},t.DeepgramApiError=class extends r{constructor(e,t){super(e),this.name="DeepgramApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}},t.DeepgramUnknownError=class extends r{constructor(e,t){super(e),this.name="DeepgramUnknownError",this.originalError=t}},t.DeepgramVersionError=class extends r{constructor(){super("You are attempting to use an old format for a newer SDK version. Read more here: https://dpgr.am/js-v3"),this.name="DeepgramVersionError"}},t.DeepgramWebSocketError=class extends r{constructor(e,t={}){super(e),this.name="DeepgramWebSocketError",this.originalEvent=t.originalEvent,this.statusCode=t.statusCode,this.requestId=t.requestId,this.responseHeaders=t.responseHeaders,this.url=t.url,this.readyState=t.readyState}toJSON(){return{name:this.name,message:this.message,statusCode:this.statusCode,requestId:this.requestId,responseHeaders:this.responseHeaders,url:this.url,readyState:this.readyState,originalEvent:this.originalEvent?{type:this.originalEvent.type,timeStamp:this.originalEvent.timeStamp}:void 0}}}},4329:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4492:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakRestClient=void 0;const s=r(4306),o=r(684),i=r(5096);class a extends i.AbstractRestClient{constructor(){super(...arguments),this.namespace="speak"}request(e,t,r=":version/speak"){return n(this,void 0,void 0,(function*(){let n;if(!(0,o.isTextSource)(e))throw new s.DeepgramError("Unknown transcription source type");n=JSON.stringify(e);const i=this.getRequestUrl(r,{},Object.assign({model:"aura-2-thalia-en"},t));return this.result=yield this.post(i,n,{headers:{Accept:"audio/*","Content-Type":"application/json"}}),this}))}getStream(){return n(this,void 0,void 0,(function*(){if(!this.result)throw new s.DeepgramUnknownError("Tried to get stream before making request","");return this.result.body}))}getHeaders(){return n(this,void 0,void 0,(function*(){if(!this.result)throw new s.DeepgramUnknownError("Tried to get headers before making request","");return this.result.headers}))}}t.SpeakRestClient=a},4592:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4602:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4775:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4852:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5066:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractClient=t.noop=void 0;const n=r(9784),s=r(8712),o=r(4306),i=r(684);t.noop=()=>{};class a extends n.EventEmitter{constructor(e){if(super(),this.factory=void 0,this.key=void 0,this.accessToken=void 0,this.namespace="global",this.version="v1",this.baseUrl=s.DEFAULT_URL,this.logger=t.noop,"function"==typeof e.accessToken?(this.factory=e.accessToken,this.accessToken=this.factory()):this.accessToken=e.accessToken,"function"==typeof e.key?(this.factory=e.key,this.key=this.factory()):this.key=e.key,this.key||this.accessToken||(this.accessToken=process.env.DEEPGRAM_ACCESS_TOKEN,this.accessToken||(this.key=process.env.DEEPGRAM_API_KEY)),!this.key&&!this.accessToken)throw new o.DeepgramError("A deepgram API key or access token is required.");e=(0,i.convertLegacyOptions)(e),this.options=(0,i.applyDefaults)(e,s.DEFAULT_OPTIONS)}v(e="v1"){return this.version=e,this}get namespaceOptions(){const e=(0,i.applyDefaults)(this.options[this.namespace],this.options.global);return Object.assign(Object.assign({},e),{key:this.key})}getRequestUrl(e,t={version:this.version},r){t.version=this.version,e=e.replace(/:(\w+)/g,(function(e,r){return t[r]}));const n=new URL(e,this.baseUrl);return r&&(0,i.appendSearchParams)(n.searchParams,r),n}log(e,t,r){this.logger(e,t,r)}}t.AbstractClient=a},5096:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractRestfulClient=t.AbstractRestClient=void 0;const o=r(4306),i=r(6245),a=r(5066),u=r(5793),c=s(r(7314));class l extends a.AbstractClient{constructor(e){if(super(e),(0,u.isBrowser)()&&!this.proxy)throw new o.DeepgramError("Due to CORS we are unable to support REST-based API calls to our API from the browser. Please consider using a proxy: https://dpgr.am/js-proxy for more information.");const{accessToken:t,key:r,fetch:n}=this;this.fetch=(0,i.fetchWithAuth)({accessToken:t,apiKey:r,customFetch:n}),this.proxy?this.baseUrl=this.namespaceOptions.fetch.options.proxy.url:this.baseUrl=this.namespaceOptions.fetch.options.url}_getErrorMessage(e){return e.msg||e.message||e.error_description||e.error||JSON.stringify(e)}_handleError(e,t){return n(this,void 0,void 0,(function*(){const r=yield(0,i.resolveResponse)();e instanceof r?e.json().then((r=>{t(new o.DeepgramApiError(this._getErrorMessage(r),e.status||500))})).catch((e=>{t(new o.DeepgramUnknownError(this._getErrorMessage(e),e))})):t(new o.DeepgramUnknownError(this._getErrorMessage(e),e))}))}_getRequestOptions(e,t,r){let n={method:e};return n="GET"===e||"DELETE"===e?Object.assign(Object.assign({},n),t):Object.assign(Object.assign({duplex:"half",body:t},n),r),(0,c.default)(this.namespaceOptions.fetch.options,n,{clone:!1})}_handleRequest(e,t,r,s){return n(this,void 0,void 0,(function*(){return new Promise(((n,o)=>{(0,this.fetch)(t,this._getRequestOptions(e,r,s)).then((e=>{if(!e.ok)throw e;n(e)})).catch((e=>this._handleError(e,o)))}))}))}get(e,t){return n(this,void 0,void 0,(function*(){return this._handleRequest("GET",e,t)}))}post(e,t,r){return n(this,void 0,void 0,(function*(){return this._handleRequest("POST",e,t,r)}))}put(e,t,r){return n(this,void 0,void 0,(function*(){return this._handleRequest("PUT",e,t,r)}))}patch(e,t,r){return n(this,void 0,void 0,(function*(){return this._handleRequest("PATCH",e,t,r)}))}delete(e,t){return n(this,void 0,void 0,(function*(){return this._handleRequest("DELETE",e,t)}))}get proxy(){var e;return"proxy"===this.key&&!!(null===(e=this.namespaceOptions.fetch.options.proxy)||void 0===e?void 0:e.url)}}t.AbstractRestClient=l,t.AbstractRestfulClient=l},5263:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5292:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ModelsRestClient=void 0;const s=r(4306),o=r(5096);class i extends o.AbstractRestClient{constructor(){super(...arguments),this.namespace="models"}getAll(e=":version/models",t={}){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(e,{},t);return{result:yield this.get(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getModel(e,t=":version/models/:modelId"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{modelId:e});return{result:yield this.get(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}}t.ModelsRestClient=i},5357:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiveClient=t.ListenLiveClient=void 0;const n=r(740),s=r(6416),o=r(4306);class i extends n.AbstractLiveClient{constructor(e,t={},r=":version/listen"){var n,s;if(super(e),this.namespace="listen",(null===(n=t.keyterm)||void 0===n?void 0:n.length)&&!(null===(s=t.model)||void 0===s?void 0:s.startsWith("nova-3")))throw new o.DeepgramError("Keyterms are only supported with the Nova 3 models.");this.connect(t,r)}setupConnection(){this.setupConnectionEvents({Open:s.LiveTranscriptionEvents.Open,Close:s.LiveTranscriptionEvents.Close,Error:s.LiveTranscriptionEvents.Error}),this.conn&&(this.conn.onmessage=e=>{var t,r,n,o;try{const t=JSON.parse(e.data.toString());t.type===s.LiveTranscriptionEvents.Metadata?this.emit(s.LiveTranscriptionEvents.Metadata,t):t.type===s.LiveTranscriptionEvents.Transcript?this.emit(s.LiveTranscriptionEvents.Transcript,t):t.type===s.LiveTranscriptionEvents.UtteranceEnd?this.emit(s.LiveTranscriptionEvents.UtteranceEnd,t):t.type===s.LiveTranscriptionEvents.SpeechStarted?this.emit(s.LiveTranscriptionEvents.SpeechStarted,t):this.emit(s.LiveTranscriptionEvents.Unhandled,t)}catch(i){this.emit(s.LiveTranscriptionEvents.Error,{event:e,message:"Unable to parse `data` as JSON.",error:i,url:null===(t=this.conn)||void 0===t?void 0:t.url,readyState:null===(r=this.conn)||void 0===r?void 0:r.readyState,data:(null===(n=e.data)||void 0===n?void 0:n.toString().substring(0,200))+((null===(o=e.data)||void 0===o?void 0:o.toString().length)>200?"...":"")})}})}configure(e){this.send(JSON.stringify({type:"Configure",processors:e}))}keepAlive(){this.send(JSON.stringify({type:"KeepAlive"}))}finalize(){this.send(JSON.stringify({type:"Finalize"}))}finish(){this.requestClose()}requestClose(){this.send(JSON.stringify({type:"CloseStream"}))}}t.ListenLiveClient=i,t.LiveClient=i},5569:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="0.0.0-automated"},5793:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBun=t.isNode=t.isBrowser=t.BROWSER_AGENT=t.BUN_VERSION=t.NODE_VERSION=void 0,t.NODE_VERSION="undefined"!=typeof process&&process.versions&&process.versions.node?process.versions.node:"unknown",t.BUN_VERSION="undefined"!=typeof process&&process.versions&&process.versions.bun?process.versions.bun:"unknown",t.BROWSER_AGENT="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:"unknown",t.isBrowser=()=>"unknown"!==t.BROWSER_AGENT,t.isNode=()=>"unknown"!==t.NODE_VERSION,t.isBun=()=>"unknown"!==t.BUN_VERSION},5874:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6180:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6245:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.resolveResponse=t.fetchWithAuth=t.resolveFetch=void 0;const u=r(684),c=a(r(8389));t.resolveFetch=e=>{let t;return t=e||("undefined"==typeof fetch?c.default:fetch),(...e)=>t(...e)},t.fetchWithAuth=({apiKey:e,customFetch:r,accessToken:n})=>{const s=(0,t.resolveFetch)(r),o=(0,u.resolveHeadersConstructor)();return(t,r)=>i(void 0,void 0,void 0,(function*(){const i=new o(null==r?void 0:r.headers);return i.has("Authorization")||i.set("Authorization",n?`Bearer ${n}`:`Token ${e}`),s(t,Object.assign(Object.assign({},r),{headers:i}))}))},t.resolveResponse=()=>i(void 0,void 0,void 0,(function*(){return"undefined"==typeof Response?(yield Promise.resolve().then((()=>o(r(8389))))).Response:Response}))},6287:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,r="millisecond",n="second",s="minute",o="hour",i="day",a="week",u="month",c="quarter",l="year",d="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},y=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},g={s:y,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),s=r%60;return(t<=0?"+":"-")+y(n,2,"0")+":"+y(s,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),s=t.clone().add(n,u),o=r-s<0,i=t.clone().add(n+(o?-1:1),u);return+(-(n+(r-s)/(o?s-i:i-s))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:l,w:a,d:i,D:d,h:o,m:s,s:n,ms:r,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},m="en",b={};b[m]=v;var _="$isDayjsObject",w=function(e){return e instanceof S||!(!e||!e[_])},O=function e(t,r,n){var s;if(!t)return m;if("string"==typeof t){var o=t.toLowerCase();b[o]&&(s=o),r&&(b[o]=r,s=o);var i=t.split("-");if(!s&&i.length>1)return e(i[0])}else{var a=t.name;b[a]=t,s=a}return!n&&s&&(m=s),s||!n&&m},E=function(e,t){if(w(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new S(r)},j=g;j.l=O,j.i=w,j.w=function(e,t){return E(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function v(e){this.$L=O(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[_]=!0}var y=v.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(j.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(p);if(n){var s=n[2]-1||0,o=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)}}return new Date(t)}(e),this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return j},y.isValid=function(){return!(this.$d.toString()===h)},y.isSame=function(e,t){var r=E(e);return this.startOf(t)<=r&&r<=this.endOf(t)},y.isAfter=function(e,t){return E(e)<this.startOf(t)},y.isBefore=function(e,t){return this.endOf(t)<E(e)},y.$g=function(e,t,r){return j.u(e)?this[t]:this.set(r,e)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(e,t){var r=this,c=!!j.u(t)||t,h=j.p(e),p=function(e,t){var n=j.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return c?n:n.endOf(i)},f=function(e,t){return j.w(r.toDate()[e].apply(r.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},v=this.$W,y=this.$M,g=this.$D,m="set"+(this.$u?"UTC":"");switch(h){case l:return c?p(1,0):p(31,11);case u:return c?p(1,y):p(0,y+1);case a:var b=this.$locale().weekStart||0,_=(v<b?v+7:v)-b;return p(c?g-_:g+(6-_),y);case i:case d:return f(m+"Hours",0);case o:return f(m+"Minutes",1);case s:return f(m+"Seconds",2);case n:return f(m+"Milliseconds",3);default:return this.clone()}},y.endOf=function(e){return this.startOf(e,!1)},y.$set=function(e,t){var a,c=j.p(e),h="set"+(this.$u?"UTC":""),p=(a={},a[i]=h+"Date",a[d]=h+"Date",a[u]=h+"Month",a[l]=h+"FullYear",a[o]=h+"Hours",a[s]=h+"Minutes",a[n]=h+"Seconds",a[r]=h+"Milliseconds",a)[c],f=c===i?this.$D+(t-this.$W):t;if(c===u||c===l){var v=this.clone().set(d,1);v.$d[p](f),v.init(),this.$d=v.set(d,Math.min(this.$D,v.daysInMonth())).$d}else p&&this.$d[p](f);return this.init(),this},y.set=function(e,t){return this.clone().$set(e,t)},y.get=function(e){return this[j.p(e)]()},y.add=function(r,c){var d,h=this;r=Number(r);var p=j.p(c),f=function(e){var t=E(h);return j.w(t.date(t.date()+Math.round(e*r)),h)};if(p===u)return this.set(u,this.$M+r);if(p===l)return this.set(l,this.$y+r);if(p===i)return f(1);if(p===a)return f(7);var v=(d={},d[s]=e,d[o]=t,d[n]=1e3,d)[p]||1,y=this.$d.getTime()+r*v;return j.w(y,this)},y.subtract=function(e,t){return this.add(-1*e,t)},y.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||h;var n=e||"YYYY-MM-DDTHH:mm:ssZ",s=j.z(this),o=this.$H,i=this.$m,a=this.$M,u=r.weekdays,c=r.months,l=r.meridiem,d=function(e,r,s,o){return e&&(e[r]||e(t,n))||s[r].slice(0,o)},p=function(e){return j.s(o%12||12,e,"0")},v=l||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(f,(function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return j.s(t.$y,4,"0");case"M":return a+1;case"MM":return j.s(a+1,2,"0");case"MMM":return d(r.monthsShort,a,c,3);case"MMMM":return d(c,a);case"D":return t.$D;case"DD":return j.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(r.weekdaysMin,t.$W,u,2);case"ddd":return d(r.weekdaysShort,t.$W,u,3);case"dddd":return u[t.$W];case"H":return String(o);case"HH":return j.s(o,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return v(o,i,!0);case"A":return v(o,i,!1);case"m":return String(i);case"mm":return j.s(i,2,"0");case"s":return String(t.$s);case"ss":return j.s(t.$s,2,"0");case"SSS":return j.s(t.$ms,3,"0");case"Z":return s}return null}(e)||s.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(r,d,h){var p,f=this,v=j.p(d),y=E(r),g=(y.utcOffset()-this.utcOffset())*e,m=this-y,b=function(){return j.m(f,y)};switch(v){case l:p=b()/12;break;case u:p=b();break;case c:p=b()/3;break;case a:p=(m-g)/6048e5;break;case i:p=(m-g)/864e5;break;case o:p=m/t;break;case s:p=m/e;break;case n:p=m/1e3;break;default:p=m}return h?p:j.a(p)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return b[this.$L]},y.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=O(e,t,!0);return n&&(r.$L=n),r},y.clone=function(){return j.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},v}(),T=S.prototype;return E.prototype=T,[["$ms",r],["$s",n],["$m",s],["$H",o],["$W",i],["$M",u],["$y",l],["$D",d]].forEach((function(e){T[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),E.extend=function(e,t){return e.$i||(e(t,S,E),e.$i=!0),E},E.locale=O,E.isDayjs=w,E.unix=function(e){return E(1e3*e)},E.en=b[m],E.Ls=b,E.p={},E}()},6302:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6327:(e,t,r)=>{"use strict";function n(e){return"transcriptionData"in e}r.r(t),r.d(t,{AssemblyAiConverter:()=>h,DeepgramConverter:()=>l,chunkArray:()=>c,isConverter:()=>n,secondsToTimestamp:()=>u,srt:()=>v,webvtt:()=>f});var s=r(6287),o=r.n(s),i=r(4268),a=r.n(i);function u(e,t="HH:mm:ss.SSS"){return o()(1e3*e).utc().format(t)}function c(e,t){const r=[];for(let n=0;n<e.length;n+=t){const s=e.slice(n,n+t);r.push(s)}return r}o().extend(a());class l{constructor(e){this.transcriptionData=e}getLines(e=8){const{results:t}=this.transcriptionData;let r=[];if(t.utterances)t.utterances.forEach((t=>{t.words.length>e?r.push(...c(t.words,e)):r.push(t.words)}));else{const n=t.channels[0].alternatives[0].words,s="speaker"in n[0];let o=[],i=0;n.forEach((t=>{var n;s&&t.speaker!==i&&(r.push(o),o=[]),o.length===e&&(r.push(o),o=[]),s&&(i=null!==(n=t.speaker)&&void 0!==n?n:0),o.push(t)})),r.push(o)}return r}getHeaders(){var e,t,r,n,s,o,i,a;const u=[];return u.push("NOTE"),u.push("Transcription provided by Deepgram"),(null===(e=this.transcriptionData.metadata)||void 0===e?void 0:e.request_id)&&u.push(`Request Id: ${null===(t=this.transcriptionData.metadata)||void 0===t?void 0:t.request_id}`),(null===(r=this.transcriptionData.metadata)||void 0===r?void 0:r.created)&&u.push(`Created: ${null===(n=this.transcriptionData.metadata)||void 0===n?void 0:n.created}`),(null===(s=this.transcriptionData.metadata)||void 0===s?void 0:s.duration)&&u.push(`Duration: ${null===(o=this.transcriptionData.metadata)||void 0===o?void 0:o.duration}`),(null===(i=this.transcriptionData.metadata)||void 0===i?void 0:i.channels)&&u.push(`Channels: ${null===(a=this.transcriptionData.metadata)||void 0===a?void 0:a.channels}`),u}}const d=e=>({word:e.text,start:e.start,end:e.end,confidence:e.confidence,punctuated_word:e.text,speaker:e.speaker});class h{constructor(e){this.transcriptionData=e}getLines(e=8){const t=this.transcriptionData;let r=[];return t.utterances?t.utterances.forEach((t=>{t.words.length>e?r.push(...c(t.words.map((e=>d(e))),e)):r.push(t.words.map((e=>d(e))))})):r.push(...c(t.words.map((e=>d(e))),e)),r}getHeaders(){const e=[];return e.push("NOTE"),e.push("Transcription provided by Assembly AI"),this.transcriptionData.id&&e.push(`Id: ${this.transcriptionData.id}`),this.transcriptionData.audio_duration&&e.push(`Duration: ${this.transcriptionData.audio_duration}`),e}}const p=e=>n(e)?e:new l(e),f=(e,t=8)=>{const r=[];let n=p(e);r.push("WEBVTT"),r.push(""),n.getHeaders&&r.push(n.getHeaders().join("\n")),n.getHeaders&&r.push("");const s=n.getLines(t),o="speaker"in s[0][0];return s.forEach((e=>{const t=e[0],n=e[e.length-1];r.push(`${u(t.start)} --\x3e ${u(n.end)}`);const s=e.map((e=>{var t;return null!==(t=e.punctuated_word)&&void 0!==t?t:e.word})).join(" "),i=o?`<v Speaker ${t.speaker}>`:"";r.push(`${i}${s}`),r.push("")})),r.join("\n")},v=(e,t=8)=>{const r=[];let n=p(e).getLines(t);const s="speaker"in n[0][0];let o,i=1;return n.forEach((e=>{r.push((i++).toString());const t=e[0],n=e[e.length-1];r.push(`${u(t.start,"HH:mm:ss,SSS")} --\x3e ${u(n.end,"HH:mm:ss,SSS")}`);const a=e.map((e=>{var t;return null!==(t=e.punctuated_word)&&void 0!==t?t:e.word})).join(" "),c=s&&o!==t.speaker?`[Speaker ${t.speaker}]\n`:"";r.push(`${c}${a}`),r.push(""),o=t.speaker})),r.join("\n")}},6416:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(1176),t),s(r(3063),t),s(r(6487),t),s(r(986),t)},6487:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.LiveTranscriptionEvents=void 0,(r=t.LiveTranscriptionEvents||(t.LiveTranscriptionEvents={})).Open="open",r.Close="close",r.Error="error",r.Transcript="Results",r.Metadata="Metadata",r.UtteranceEnd="UtteranceEnd",r.SpeechStarted="SpeechStarted",r.Unhandled="Unhandled"},6544:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6731:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(5066),t),s(r(740),t),s(r(5096),t),s(r(2043),t),s(r(472),t),s(r(875),t),s(r(5357),t),s(r(6733),t),s(r(7361),t),s(r(5292),t),s(r(3242),t),s(r(367),t),s(r(398),t),s(r(3712),t),s(r(4492),t)},6733:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PrerecordedClient=t.ListenRestClient=void 0;const s=r(684),o=r(4306),i=r(5096);class a extends i.AbstractRestClient{constructor(){super(...arguments),this.namespace="listen"}transcribeUrl(e,t,r=":version/listen"){var i,a;return n(this,void 0,void 0,(function*(){try{let n;if(!(0,s.isUrlSource)(e))throw new o.DeepgramError("Unknown transcription source type");if(n=JSON.stringify(e),void 0!==t&&"callback"in t)throw new o.DeepgramError("Callback cannot be provided as an option to a synchronous transcription. Use `transcribeUrlCallback` or `transcribeFileCallback` instead.");if((null===(i=null==t?void 0:t.keyterm)||void 0===i?void 0:i.length)&&!(null===(a=t.model)||void 0===a?void 0:a.startsWith("nova-3")))throw new o.DeepgramError("Keyterms are only supported with the Nova 3 models.");const u=this.getRequestUrl(r,{},Object.assign({},t));return{result:yield this.post(u,n).then((e=>e.json())),error:null}}catch(e){if((0,o.isDeepgramError)(e))return{result:null,error:e};throw e}}))}transcribeFile(e,t,r=":version/listen"){return n(this,void 0,void 0,(function*(){try{let n;if(!(0,s.isFileSource)(e))throw new o.DeepgramError("Unknown transcription source type");if(n=e,void 0!==t&&"callback"in t)throw new o.DeepgramError("Callback cannot be provided as an option to a synchronous transcription. Use `transcribeUrlCallback` or `transcribeFileCallback` instead.");const i=this.getRequestUrl(r,{},Object.assign({},t));return{result:yield this.post(i,n,{headers:{"Content-Type":"deepgram/audio+video"}}).then((e=>e.json())),error:null}}catch(e){if((0,o.isDeepgramError)(e))return{result:null,error:e};throw e}}))}transcribeUrlCallback(e,t,r,i=":version/listen"){return n(this,void 0,void 0,(function*(){try{let n;if(!(0,s.isUrlSource)(e))throw new o.DeepgramError("Unknown transcription source type");n=JSON.stringify(e);const a=this.getRequestUrl(i,{},Object.assign(Object.assign({},r),{callback:t.toString()}));return{result:yield this.post(a,n).then((e=>e.json())),error:null}}catch(e){if((0,o.isDeepgramError)(e))return{result:null,error:e};throw e}}))}transcribeFileCallback(e,t,r,i=":version/listen"){return n(this,void 0,void 0,(function*(){try{let n;if(!(0,s.isFileSource)(e))throw new o.DeepgramError("Unknown transcription source type");n=e;const a=this.getRequestUrl(i,{},Object.assign(Object.assign({},r),{callback:t.toString()}));return{result:yield this.post(a,n,{headers:{"Content-Type":"deepgram/audio+video"}}).then((e=>e.json())),error:null}}catch(e){if((0,o.isDeepgramError)(e))return{result:null,error:e};throw e}}))}}t.ListenRestClient=a,t.PrerecordedClient=a},7034:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7205:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7314:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===r}(e)}(e)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function s(e,t,r){return e.concat(t).map((function(e){return n(e,r)}))}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function i(e,t){try{return t in e}catch(e){return!1}}function a(e,r,u){(u=u||{}).arrayMerge=u.arrayMerge||s,u.isMergeableObject=u.isMergeableObject||t,u.cloneUnlessOtherwiseSpecified=n;var c=Array.isArray(r);return c===Array.isArray(e)?c?u.arrayMerge(e,r,u):function(e,t,r){var s={};return r.isMergeableObject(e)&&o(e).forEach((function(t){s[t]=n(e[t],r)})),o(t).forEach((function(o){(function(e,t){return i(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(i(e,o)&&r.isMergeableObject(t[o])?s[o]=function(e,t){if(!t.customMerge)return a;var r=t.customMerge(e);return"function"==typeof r?r:a}(o,r)(e[o],t[o],r):s[o]=n(t[o],r))})),s}(e,r,u):n(r,u)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return a(e,r,t)}),{})};var u=a;e.exports=u},7361:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ManageClient=t.ManageRestClient=void 0;const s=r(4306),o=r(5096);class i extends o.AbstractRestClient{constructor(){super(...arguments),this.namespace="manage"}getTokenDetails(e=":version/auth/token"){return n(this,void 0,void 0,(function*(){try{const t=this.getRequestUrl(e);return{result:yield this.get(t).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjects(e=":version/projects"){return n(this,void 0,void 0,(function*(){try{const t=this.getRequestUrl(e);return{result:yield this.get(t).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProject(e,t=":version/projects/:projectId"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{projectId:e});return{result:yield this.get(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}updateProject(e,t,r=":version/projects/:projectId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e},t),s=JSON.stringify(t);return{result:yield this.patch(n,s).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}deleteProject(e,t=":version/projects/:projectId"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{projectId:e});return yield this.delete(r),{error:null}}catch(e){if((0,s.isDeepgramError)(e))return{error:e};throw e}}))}getProjectKeys(e,t=":version/projects/:projectId/keys"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{projectId:e});return{result:yield this.get(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjectKey(e,t,r=":version/projects/:projectId/keys/:keyId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,keyId:t});return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}createProjectKey(e,t,r=":version/projects/:projectId/keys"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e},t),s=JSON.stringify(t);return{result:yield this.post(n,s).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}deleteProjectKey(e,t,r=":version/projects/:projectId/keys/:keyId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,keyId:t});return yield this.delete(n),{error:null}}catch(e){if((0,s.isDeepgramError)(e))return{error:e};throw e}}))}getProjectMembers(e,t=":version/projects/:projectId/members"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{projectId:e});return{result:yield this.get(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}removeProjectMember(e,t,r=":version/projects/:projectId/members/:memberId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,memberId:t});return yield this.delete(n),{error:null}}catch(e){if((0,s.isDeepgramError)(e))return{error:e};throw e}}))}getProjectMemberScopes(e,t,r=":version/projects/:projectId/members/:memberId/scopes"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,memberId:t});return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}updateProjectMemberScope(e,t,r,o=":version/projects/:projectId/members/:memberId/scopes"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(o,{projectId:e,memberId:t},r),s=JSON.stringify(r);return{result:yield this.put(n,s).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjectInvites(e,t=":version/projects/:projectId/invites"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{projectId:e});return{result:yield this.get(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}sendProjectInvite(e,t,r=":version/projects/:projectId/invites"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e},t),s=JSON.stringify(t);return{result:yield this.post(n,s).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}deleteProjectInvite(e,t,r=":version/projects/:projectId/invites/:email"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,email:t});return yield this.delete(n),{error:null}}catch(e){if((0,s.isDeepgramError)(e))return{error:e};throw e}}))}leaveProject(e,t=":version/projects/:projectId/leave"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{projectId:e});return{result:yield this.delete(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjectUsageRequests(e,t,r=":version/projects/:projectId/requests"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e},t);return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjectUsageRequest(e,t,r=":version/projects/:projectId/requests/:requestId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,requestId:t});return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjectUsageSummary(e,t,r=":version/projects/:projectId/usage"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e},t);return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjectUsageFields(e,t,r=":version/projects/:projectId/usage/fields"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e},t);return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjectBalances(e,t=":version/projects/:projectId/balances"){return n(this,void 0,void 0,(function*(){try{const r=this.getRequestUrl(t,{projectId:e});return{result:yield this.get(r).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getProjectBalance(e,t,r=":version/projects/:projectId/balances/:balanceId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,balanceId:t});return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getAllModels(e,t={},r=":version/projects/:projectId/models"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e},t);return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}getModel(e,t,r=":version/projects/:projectId/models/:modelId"){return n(this,void 0,void 0,(function*(){try{const n=this.getRequestUrl(r,{projectId:e,modelId:t});return{result:yield this.get(n).then((e=>e.json())),error:null}}catch(e){if((0,s.isDeepgramError)(e))return{result:null,error:e};throw e}}))}}t.ManageRestClient=i,t.ManageClient=i},7897:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8034:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8378:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8389:(e,t,r)=>{var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==r.g&&r.g,s=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==r.g&&r.g||{},s="URLSearchParams"in n,o="Symbol"in n&&"iterator"in Symbol,i="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in n,u="ArrayBuffer"in n;if(u)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function d(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return o&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function v(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function y(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=y(t);return t.readAsArrayBuffer(e),r}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:s&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=v(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return v(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(i)return this.blob().then(g);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,r,n,s,o=v(this);if(o)return o;if(this._bodyBlob)return e=this._bodyBlob,r=y(t=new FileReader),s=(n=/charset=([A-Za-z0-9_-]+)/.exec(e.type))?n[1]:"utf-8",t.readAsText(e,s),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(O)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=d(e),t=h(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},f.prototype.delete=function(e){delete this.map[d(e)]},f.prototype.get=function(e){return e=d(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(d(e))},f.prototype.set=function(e,t){this.map[d(e)]=h(t)},f.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),p(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),p(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),p(e)},o&&(f.prototype[Symbol.iterator]=f.prototype.entries);var _=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function w(e,t){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,s,o=(t=t||{}).body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(s=(r=t.method||this.method||"GET").toUpperCase(),_.indexOf(s)>-1?s:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in n)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;i.test(this.url)?this.url=this.url.replace(i,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function O(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),s=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(s))}})),t}function E(e,t){if(!(this instanceof E))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},b.call(w.prototype),b.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},E.error=function(){var e=new E(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var j=[301,302,303,307,308];E.redirect=function(e,t){if(-1===j.indexOf(t))throw new RangeError("Invalid status code");return new E(null,{status:t,headers:{location:e}})},t.DOMException=n.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,r){return new Promise((function(s,o){var a=new w(e,r);if(a.signal&&a.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function l(){c.abort()}if(c.onload=function(){var e,t,r={statusText:c.statusText,headers:(e=c.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var s=r.join(":").trim();try{t.append(n,s)}catch(e){console.warn("Response "+e.message)}}})),t)};0===a.url.indexOf("file://")&&(c.status<200||c.status>599)?r.status=200:r.status=c.status,r.url="responseURL"in c?c.responseURL:r.headers.get("X-Request-URL");var n="response"in c?c.response:c.responseText;setTimeout((function(){s(new E(n,r))}),0)},c.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},c.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request timed out"))}),0)},c.onabort=function(){setTimeout((function(){o(new t.DOMException("Aborted","AbortError"))}),0)},c.open(a.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(a.url),!0),"include"===a.credentials?c.withCredentials=!0:"omit"===a.credentials&&(c.withCredentials=!1),"responseType"in c&&(i?c.responseType="blob":u&&(c.responseType="arraybuffer")),r&&"object"==typeof r.headers&&!(r.headers instanceof f||n.Headers&&r.headers instanceof n.Headers)){var p=[];Object.getOwnPropertyNames(r.headers).forEach((function(e){p.push(d(e)),c.setRequestHeader(e,h(r.headers[e]))})),a.headers.forEach((function(e,t){-1===p.indexOf(t)&&c.setRequestHeader(t,e)}))}else a.headers.forEach((function(e,t){c.setRequestHeader(t,e)}));a.signal&&(a.signal.addEventListener("abort",l),c.onreadystatechange=function(){4===c.readyState&&a.signal.removeEventListener("abort",l)}),c.send(void 0===a._bodyInit?null:a._bodyInit)}))}S.polyfill=!0,n.fetch||(n.fetch=S,n.Headers=f,n.Request=w,n.Response=E),t.Headers=f,t.Request=w,t.Response=E,t.fetch=S,Object.defineProperty(t,"__esModule",{value:!0})}({})}(s),s.fetch.ponyfill=!0,delete s.fetch.polyfill;var o=n.fetch?n:s;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t},8457:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8502:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8600:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8633:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8712:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONNECTION_STATE=t.SOCKET_STATES=t.DEFAULT_OPTIONS=t.DEFAULT_AGENT_OPTIONS=t.DEFAULT_GLOBAL_OPTIONS=t.DEFAULT_AGENT_URL=t.DEFAULT_URL=t.DEFAULT_HEADERS=void 0;const n=r(684),s=r(5793),o=r(5569);var i,a;t.DEFAULT_HEADERS={"Content-Type":"application/json","X-Client-Info":`@deepgram/sdk; ${(0,s.isBrowser)()?"browser":"server"}; v${o.version}`,"User-Agent":`@deepgram/sdk/${o.version} ${(0,s.isNode)()?`node/${s.NODE_VERSION}`:(0,s.isBun)()?`bun/${s.BUN_VERSION}`:(0,s.isBrowser)()?`javascript ${s.BROWSER_AGENT}`:"unknown"}`},t.DEFAULT_URL="https://api.deepgram.com",t.DEFAULT_AGENT_URL="wss://agent.deepgram.com",t.DEFAULT_GLOBAL_OPTIONS={fetch:{options:{url:t.DEFAULT_URL,headers:t.DEFAULT_HEADERS}},websocket:{options:{url:(0,n.convertProtocolToWs)(t.DEFAULT_URL),_nodeOnlyHeaders:t.DEFAULT_HEADERS}}},t.DEFAULT_AGENT_OPTIONS={fetch:{options:{url:t.DEFAULT_URL,headers:t.DEFAULT_HEADERS}},websocket:{options:{url:t.DEFAULT_AGENT_URL,_nodeOnlyHeaders:t.DEFAULT_HEADERS}}},t.DEFAULT_OPTIONS={global:t.DEFAULT_GLOBAL_OPTIONS,agent:t.DEFAULT_AGENT_OPTIONS},(a=t.SOCKET_STATES||(t.SOCKET_STATES={}))[a.connecting=0]="connecting",a[a.open=1]="open",a[a.closing=2]="closing",a[a.closed=3]="closed",(i=t.CONNECTION_STATE||(t.CONNECTION_STATE={})).Connecting="connecting",i.Open="open",i.Closing="closing",i.Closed="closed"},8785:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8968:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9042:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9115:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9176:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9475:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9518:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9784:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function s(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",s),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,s)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var i=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var s,o,i,c;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),i=o[t]),void 0===i)i=o[t]=r,++e._eventsCount;else if("function"==typeof i?i=o[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),(s=u(e))>0&&i.length>s&&!i.warned){i.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=i.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},s=l.bind(n);return s.listener=r,n.wrapFn=s,s}function h(e,t,r){var n=e._events;if(void 0===n)return[];var s=n[t];return void 0===s?[]:"function"==typeof s?r?[s.listener||s]:[s]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(s):f(s,s.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function f(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function v(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function s(o){n.once&&e.removeEventListener(t,s),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");i=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var s="error"===e,o=this._events;if(void 0!==o)s=s&&void 0===o.error;else if(!s)return!1;if(s){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var a=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw a.context=i,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,l=f(u,c);for(r=0;r<c;++r)n(l[r],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,d(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,d(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,s,o,i;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(s=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){i=r[o].listener,s=o;break}if(s<0)return this;0===s?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,s),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,i||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var s,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(s=o[n])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},9836:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(3465)})()));
|
package/package.json
CHANGED
package/src/lib/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "4.11.
|
|
1
|
+
export const version = "4.11.2";
|
|
@@ -144,8 +144,8 @@ export abstract class AbstractLiveClient extends AbstractClient {
|
|
|
144
144
|
headers: this.headers,
|
|
145
145
|
});
|
|
146
146
|
console.log(`Using WS package`);
|
|
147
|
+
this.setupConnection();
|
|
147
148
|
});
|
|
148
|
-
this.setupConnection();
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
151
|
|
|
@@ -177,9 +177,8 @@ export abstract class AbstractLiveClient extends AbstractClient {
|
|
|
177
177
|
this.conn = new WS(requestUrl, undefined, {
|
|
178
178
|
headers: this.headers,
|
|
179
179
|
});
|
|
180
|
+
this.setupConnection();
|
|
180
181
|
});
|
|
181
|
-
|
|
182
|
-
this.setupConnection();
|
|
183
182
|
}
|
|
184
183
|
|
|
185
184
|
/**
|