@deepgram/sdk 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -39
- package/dist/index.js +1 -1
- package/dist/transcription/liveTranscription.d.ts +1 -0
- package/dist/types/liveTranscriptionOptions.d.ts +14 -14
- package/dist/types/metadata.d.ts +2 -0
- package/dist/types/prerecordedTranscriptionOptions.d.ts +14 -14
- package/dist/types/prerecordedTranscriptionResponse.d.ts +1 -0
- package/dist/types/warning.d.ts +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,51 +3,52 @@
|
|
|
3
3
|
[](https://github.com/deepgram/node-sdk/actions/workflows/CI.yml) [](https://www.npmjs.com/package/@deepgram/sdk) [](CODE_OF_CONDUCT.md)
|
|
4
4
|
|
|
5
5
|
Official Node.js SDK for [Deepgram](https://www.deepgram.com/). Start building with our powerful transcription & speech understanding API.
|
|
6
|
+
> This SDK only supports hosted usage of api.deepgram.com.
|
|
6
7
|
|
|
7
8
|
> ### Deprecated JS Browser SDK
|
|
8
9
|
>
|
|
9
10
|
> As of version 2.x, the JS Browser SDK was removed from the Node SDK and will become an independent Client SDK.
|
|
10
11
|
> To use the older SDK, please `npm i @deepgram/sdk@1.2.1` and use `@deepgram/sdk/browser`.
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
13
|
+
* [Deepgram Node.js SDK](#deepgram-nodejs-sdk)
|
|
14
|
+
* [Getting an API Key](#getting-an-api-key)
|
|
15
|
+
* [Installation](#installation)
|
|
16
|
+
* [Constructor](#constructor)
|
|
17
|
+
* [Transcription](#transcription)
|
|
18
|
+
* [Remote Files](#remote-files)
|
|
19
|
+
* [Local Files](#local-files)
|
|
20
|
+
* [Live Audio](#live-audio)
|
|
21
|
+
* [Projects](#projects)
|
|
22
|
+
* [Get Projects](#get-projects)
|
|
23
|
+
* [Get Project](#get-project)
|
|
24
|
+
* [Update Project](#update-project)
|
|
25
|
+
* [Delete Project](#delete-project)
|
|
26
|
+
* [Keys](#keys)
|
|
27
|
+
* [List Keys](#list-keys)
|
|
28
|
+
* [Get Key](#get-key)
|
|
29
|
+
* [Create Key](#create-key)
|
|
30
|
+
* [Delete Key](#delete-key)
|
|
31
|
+
* [Members](#members)
|
|
32
|
+
* [Get Members](#get-members)
|
|
33
|
+
* [Remove Member](#remove-member)
|
|
34
|
+
* [Scopes](#scopes)
|
|
35
|
+
* [Get Member Scopes](#get-member-scopes)
|
|
36
|
+
* [Update Scope](#update-scope)
|
|
37
|
+
* [Invitations](#invitations)
|
|
38
|
+
* [List Invites](#list-invites)
|
|
39
|
+
* [Send Invite](#send-invite)
|
|
40
|
+
* [Delete Invite](#delete-invite)
|
|
41
|
+
* [Leave Project](#leave-project)
|
|
42
|
+
* [Usage](#usage)
|
|
43
|
+
* [Get All Requests](#get-all-requests)
|
|
44
|
+
* [Get Request](#get-request)
|
|
45
|
+
* [Summarize Usage](#summarize-usage)
|
|
46
|
+
* [Get Fields](#get-fields)
|
|
47
|
+
* [Billing](#billing)
|
|
48
|
+
* [Get All Balances](#get-all-balances)
|
|
49
|
+
* [Get Balance](#get-balance)
|
|
50
|
+
* [Development and Contributing](#development-and-contributing)
|
|
51
|
+
* [Getting Help](#getting-help)
|
|
51
52
|
|
|
52
53
|
# Getting an API Key
|
|
53
54
|
|
package/dist/index.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["dg-node-sdk"]=t():e["dg-node-sdk"]=t()}(global,(()=>(()=>{var e={5343:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{c(i.next(e))}catch(e){s(e)}}function a(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((i=i.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Billing=void 0;var n=function(){function e(e,t,r,i){this._credentials=e,this._apiUrl=t,this._requireSSL=r,this._request=i}return e.prototype.listBalances=function(e,t){return void 0===t&&(t="v1/projects"),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(t,"/").concat(e,"/balances"))]}))}))},e.prototype.getBalance=function(e,t,n){return void 0===n&&(n="v1/projects"),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(n,"/").concat(e,"/balances/").concat(t))]}))}))},e}();t.Billing=n},6688:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultOptions=void 0,t.DefaultOptions={apiUrl:"api.deepgram.com",requireSSL:!0}},6092:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(6688),t)},2625:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1447:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionState=void 0,(r=t.ConnectionState||(t.ConnectionState={}))[r.CONNECTING=0]="CONNECTING",r[r.OPEN=1]="OPEN",r[r.CLOSING=2]="CLOSING",r[r.CLOSED=3]="CLOSED"},5153:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6121:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(2625),t),n(r(1447),t),n(r(5153),t),n(r(2843),t),n(r(5754),t),n(r(3544),t),n(r(5272),t)},2843:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5754:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3544:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5272:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5483:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(9489),t),n(r(2795),t)},9489:function(e,t,r){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.secondsToTimestamp=void 0;var n=i(r(7484)),s=i(r(178));n.default.extend(s.default),t.secondsToTimestamp=function(e,t){return void 0===t&&(t="HH:mm:ss.SSS"),(0,n.default)(1e3*e).utc().format(t)}},2795:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateOptions=void 0,t.validateOptions=function(e,t){if(!e||0===e.trim().length)throw new Error("DG: API key is required");if(!t||0===t.trim().length)throw new Error("DG: API url should be a valid url or not provided")}},1098:function(e,t,r){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},i.apply(this,arguments)},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._request=void 0;var s=r(2781),o=n(r(5687)),a=n(r(3685)),c=r(1408);t._request=function(e,t,r,n,u,l,h){var f=function(e,t,r,n,o,a,u){var l={};!a||a instanceof s.Readable||(l["Content-Length"]=Buffer.byteLength(a));var h={host:t,protocol:r?"https:":"http:",path:n,method:o,headers:i({"User-Agent":(0,c.userAgent)(),"Content-Type":"application/json",Authorization:"token ".concat(e)},l)},f=h.headers;return u&&u.headers&&(f=i(i({},f),u.headers)),i(i(i({},h),u),{headers:f})}(t,r,n,u,e,l,h);return new Promise((function(e,t){try{var r=(n?o.default:a.default).request(f,(function(r){var i="";r.on("data",(function(e){i+=e})),r.on("end",(function(){var n;try{n=JSON.parse(i)}catch(e){n={error:i}}r.statusCode&&r.statusCode>=400&&(n.error,t("DG: ".concat(JSON.stringify(n)))),n.error&&t("DG: ".concat(i)),e(n)})),r.on("error",(function(e){t("DG: ".concat(e))}))}));r.on("error",(function(e){t("DG: ".concat(e))})),l?l instanceof s.Readable?(l.pipe(r),l.on("finish",(function(){r.end()}))):(r.write(l),r.end()):r.end()}catch(e){t("DG: ".concat(e))}}))}},6359:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{c(i.next(e))}catch(e){s(e)}}function a(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((i=i.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Invitation=void 0;var n=function(){function e(e,t,r,i){this._credentials=e,this._apiUrl=t,this._requireSSL=r,this._request=i}return e.prototype.list=function(e,t){return void 0===t&&(t="v1/projects"),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(t,"/").concat(e,"/invites"))]}))}))},e.prototype.send=function(e,t,n){return void 0===n&&(n="v1/projects"),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this._request("POST",this._credentials,this._apiUrl,this._requireSSL,"/".concat(n,"/").concat(e,"/invites"),JSON.stringify({email:t.email,scope:t.scope}))]}))}))},e.prototype.leave=function(e,t){return void 0===t&&(t="v1/projects"),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this._request("DELETE",this._credentials,this._apiUrl,this._requireSSL,"/".concat(t,"/").concat(e,"/leave"))]}))}))},e.prototype.delete=function(e,t,n){return void 0===n&&(n="v1/projects"),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this._request("DELETE",this._credentials,this._apiUrl,this._requireSSL,"/".concat(n,"/").concat(e,"/invites/").concat(t))]}))}))},e}();t.Invitation=n},9292:function(e,t){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},r.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{c(i.next(e))}catch(e){s(e)}}function a(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((i=i.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Keys=void 0;var s=function(){function e(e,t,r,i){this._credentials=e,this._apiUrl=t,this._requireSSL=r,this._request=i}return e.prototype.list=function(e,t){return void 0===t&&(t="v1/projects"),i(this,void 0,void 0,(function(){return n(this,(function(i){switch(i.label){case 0:return[4,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(t,"/").concat(e,"/keys"))];case 1:return[2,{api_keys:i.sent().api_keys.map((function(e){return r(r({},e),e.api_key)}))}]}}))}))},e.prototype.get=function(e,t,r){return void 0===r&&(r="v1/projects"),i(this,void 0,void 0,(function(){return n(this,(function(i){return[2,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(r,"/").concat(e,"/keys/").concat(t))]}))}))},e.prototype.create=function(e,t,r,s,o){return void 0===o&&(o="v1/projects"),i(this,void 0,void 0,(function(){return n(this,(function(i){if(s&&void 0!==s.expirationDate&&void 0!==s.timeToLive)throw new Error("Please provide expirationDate or timeToLive or neither. Providing both is not allowed.");return[2,this._request("POST",this._credentials,this._apiUrl,this._requireSSL,"/".concat(o,"/").concat(e,"/keys"),JSON.stringify({comment:t,scopes:r,expiration_date:s&&s.expirationDate?s.expirationDate:void 0,time_to_live_in_seconds:s&&s.timeToLive?s.timeToLive:void 0}))]}))}))},e.prototype.delete=function(e,t,r){return void 0===r&&(r="v1/projects"),i(this,void 0,void 0,(function(){return n(this,(function(i){return[2,this._request("DELETE",this._credentials,this._apiUrl,this._requireSSL,"/".concat(r,"/").concat(e,"/keys/").concat(t))]}))}))},e}();t.Keys=s},8949:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{c(i.next(e))}catch(e){s(e)}}function a(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((i=i.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Members=void 0;var n=function(){function e(e,t,r,i){this._credentials=e,this._apiUrl=t,this._requireSSL=r,this._request=i}return e.prototype.listMembers=function(e,t){return void 0===t&&(t="v1/projects"),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(t,"/").concat(e,"/members"))]}))}))},e.prototype.removeMember=function(e,t,n){return void 0===n&&(n="v1/projects"),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this._request("DELETE",this._credentials,this._apiUrl,this._requireSSL,"/".concat(n,"/").concat(e,"/members/").concat(t))]}))}))},e}();t.Members=n},319:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{c(i.next(e))}catch(e){s(e)}}function a(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((i=i.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Projects=void 0;var n=function(){function e(e,t,r,i){this._credentials=e,this._apiUrl=t,this._requireSSL=r,this._request=i}return e.prototype.list=function(e){return void 0===e&&(e="v1/projects"),r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(e))]}))}))},e.prototype.get=function(e,t){return void 0===t&&(t="v1/projects"),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(t,"/").concat(e))]}))}))},e.prototype.update=function(e,t,n){return void 0===n&&(n="v1/projects"),r(this,void 0,void 0,(function(){var r,s;return i(this,(function(i){return s=e,(r=e).project_id&&(s=r.project_id),[2,this._request("PATCH",this._credentials,this._apiUrl,this._requireSSL,"/".concat(n,"/").concat(s),JSON.stringify(t))]}))}))},e.prototype.delete=function(e,t){return void 0===t&&(t="v1/projects"),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this._request("DELETE",this._credentials,this._apiUrl,this._requireSSL,"/".concat(t,"/").concat(e))]}))}))},e}();t.Projects=n},3647:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{c(i.next(e))}catch(e){s(e)}}function a(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((i=i.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Scopes=void 0;var n=function(){function e(e,t,r,i){this._credentials=e,this._apiUrl=t,this._requireSSL=r,this._request=i}return e.prototype.get=function(e,t,n){return void 0===n&&(n="v1/projects"),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(n,"/").concat(e,"/members/").concat(t,"/scopes"))]}))}))},e.prototype.update=function(e,t,n,s){return void 0===s&&(s="v1/projects"),r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this._request("PUT",this._credentials,this._apiUrl,this._requireSSL,"/".concat(s,"/").concat(e,"/members/").concat(t,"/scopes"),JSON.stringify({scope:n}))]}))}))},e}();t.Scopes=n},487:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{c(i.next(e))}catch(e){s(e)}}function a(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((i=i.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Transcriber=void 0;var s=r(5379),o=r(3825),a=function(){function e(e,t,r){this._credentials=e,this._apiUrl=t,this._requireSSL=r}return e.prototype.preRecorded=function(e,t,r){return i(this,void 0,void 0,(function(){return n(this,(function(i){switch(i.label){case 0:return[4,(0,o.preRecordedTranscription)(this._credentials,this._apiUrl||"",this._requireSSL,e,t,r)];case 1:return[2,i.sent()]}}))}))},e.prototype.live=function(e,t){return new s.LiveTranscription(this._credentials,this._apiUrl||"",this._requireSSL,e,t)},e}();t.Transcriber=a},5379:function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},s.apply(this,arguments)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LiveTranscription=void 0;var a=o(r(2361)),c=o(r(3477)),u=o(r(8777)),l=r(6121),h=r(1408),f=function(e){function t(t,r,i,n,o){void 0===o&&(o="v1/listen");var a=e.call(this,void 0)||this,l=s({},n),f=i?"wss":"ws";return a._socket=new u.default("".concat(f,"://").concat(r,"/").concat(o,"?").concat(c.default.stringify(l)),{headers:{Authorization:"token ".concat(t),"User-Agent":(0,h.userAgent)()}}),a._bindSocketEvents(),a}return n(t,e),t.prototype._bindSocketEvents=function(){var e=this;this._socket.onopen=function(){e.emit("open",e)},this._socket.onclose=function(t){var r=t.target;if(r._req){var i=r._req.res.rawHeaders.indexOf("dg-error");t.reason=r._req.res.rawHeaders[i+1]}e.emit("close",t)},this._socket.onerror=function(t){e.emit("error",t)},this._socket.onmessage=function(t){e.emit("transcriptReceived",t.data)}},t.prototype.configure=function(e){this._socket.send(JSON.stringify({type:"Configure",processors:e}))},t.prototype.getReadyState=function(){return this._socket.readyState},t.prototype.send=function(e){this._socket.readyState===l.ConnectionState.OPEN?this._socket.send(e):this.emit("error","Could not send. Connection not open.")},t.prototype.finish=function(){this._socket.send(new Uint8Array(0))},t}(a.default);t.LiveTranscription=f},3825:function(e,t,r){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},i.apply(this,arguments)},n=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{c(i.next(e))}catch(e){s(e)}}function a(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((i=i.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preRecordedTranscription=void 0;var a=o(r(3477)),c=r(3274),u=r(1098);function l(e){return!!e.url}t.preRecordedTranscription=function(e,t,r,o,h,f){return void 0===f&&(f="v1/listen"),n(void 0,void 0,void 0,(function(){var n,d,p,_;return s(this,(function(s){switch(s.label){case 0:if(n=i({},h),!l(o)&&(void 0===o.mimetype||0===o.mimetype.length))throw new Error("DG: Mimetype must be provided if the source is a Buffer or a Readable");if(l(o))d=JSON.stringify(o);else if(o.buffer)d=o.buffer;else{if(!o.stream)throw new Error("Unknown TranscriptionSource type");d=o.stream}return p={},l(o)||(p.headers={"Content-Type":o.mimetype}),[4,(0,u._request)("POST",e,t,r,"/".concat(f,"?").concat(a.default.stringify(n)),d,p)];case 1:return _=s.sent(),[2,Object.assign(new c.PrerecordedTranscriptionResponse,_)]}}))}))}},7660:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4407:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9674:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6143:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6513:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5021:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7096:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3274:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(7660),t),n(r(7467),t),n(r(4407),t),n(r(9674),t),n(r(6143),t),n(r(6513),t),n(r(7096),t),n(r(5642),t),n(r(3867),t),n(r(7135),t),n(r(7569),t),n(r(4630),t),n(r(1741),t),n(r(5395),t),n(r(9713),t),n(r(2140),t),n(r(6397),t),n(r(4148),t),n(r(5937),t),n(r(2135),t),n(r(597),t),n(r(5086),t),n(r(6339),t),n(r(838),t),n(r(4439),t),n(r(2678),t),n(r(9266),t),n(r(7845),t),n(r(5935),t),n(r(1562),t),n(r(6536),t),n(r(393),t),n(r(3249),t),n(r(2401),t),n(r(2e3),t),n(r(4019),t),n(r(9070),t),n(r(2862),t),n(r(5228),t),n(r(1491),t),n(r(8169),t),n(r(4016),t),n(r(432),t),n(r(7992),t),n(r(7894),t),n(r(6108),t),n(r(5278),t),n(r(8121),t),n(r(5021),t)},5642:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3867:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7135:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7569:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4630:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1741:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5395:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9713:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2140:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6397:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4148:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5937:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2135:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},597:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5086:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrerecordedTranscriptionResponse=void 0;var i=r(5483),n=function(){function e(){}return e.prototype.toWebVTT=function(e){var t,r,n,s;if(void 0===e&&(e=8),!this.results||!this.results.utterances)throw new Error("This function requires a transcript that was generated with the utterances feature.");var o=[];return o.push("WEBVTT"),o.push(""),o.push("NOTE"),o.push("Transcription provided by Deepgram"),o.push("Request Id: ".concat(null===(t=this.metadata)||void 0===t?void 0:t.request_id)),o.push("Created: ".concat(null===(r=this.metadata)||void 0===r?void 0:r.created)),o.push("Duration: ".concat(null===(n=this.metadata)||void 0===n?void 0:n.duration)),o.push("Channels: ".concat(null===(s=this.metadata)||void 0===s?void 0:s.channels)),o.push(""),this.results.utterances.forEach((function(t){o.push(function(e,t){var r=function(e,t){for(var r=[],i=0;i<e.length;i+=t){var n=e.slice(i,i+t);r.push(n)}return r}(e.words,t),n=[];return r.forEach((function(e){var t=e[0],r=e[e.length-1];n.push("".concat((0,i.secondsToTimestamp)(t.start)," --\x3e ").concat((0,i.secondsToTimestamp)(r.end))),n.push(e.map((function(e){var t;return null!==(t=e.punctuated_word)&&void 0!==t?t:e.word})).join(" ")),n.push("")})),n.join("\n")}(t,e))})),o.join("\n")},e.prototype.toSRT=function(e){if(void 0===e&&(e=8),!this.results||!this.results.utterances)throw new Error("This function requires a transcript that was generated with the utterances feature.");var t=[],r=1;return this.results.utterances.forEach((function(n){t.push(function(e,t){var n=function(e,t){for(var r=[],i=0;i<e.length;i+=t){var n=e.slice(i,i+t);r.push(n)}return r}(e.words,t),s=[];return n.forEach((function(e){var t=e[0],n=e[e.length-1];s.push((r++).toString()),s.push("".concat((0,i.secondsToTimestamp)(t.start,"HH:mm:ss,SSS")," --\x3e ").concat((0,i.secondsToTimestamp)(n.end,"HH:mm:ss,SSS"))),s.push(e.map((function(e){var t;return null!==(t=e.punctuated_word)&&void 0!==t?t:e.word})).join(" ")),s.push("")})),s.join("\n")}(n,e))})),t.join("\n")},e}();t.PrerecordedTranscriptionResponse=n},6339:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},838:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4439:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2678:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9266:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7845:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5935:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1562:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6536:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},393:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3249:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2401:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2e3:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4019:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9070:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5228:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1491:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8169:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4016:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},432:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7992:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7894:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6108:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5278:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5321:function(e,t,r){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},i.apply(this,arguments)},n=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{c(i.next(e))}catch(e){s(e)}}function a(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((i=i.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Usage=void 0;var a=o(r(3477)),c=function(){function e(e,t,r,i){this._credentials=e,this._apiUrl=t,this._requireSSL=r,this._request=i}return e.prototype.listRequests=function(e,t,r){return void 0===r&&(r="v1/projects"),n(this,void 0,void 0,(function(){var n;return s(this,(function(s){switch(s.label){case 0:return n=i({},t),[4,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(r,"/").concat(e,"/requests?").concat(a.default.stringify(n)))];case 1:return[2,s.sent()]}}))}))},e.prototype.getRequest=function(e,t,r){return void 0===r&&(r="v1/projects"),n(this,void 0,void 0,(function(){return s(this,(function(i){switch(i.label){case 0:return[4,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(r,"/").concat(e,"/requests/").concat(t))];case 1:return[2,i.sent()]}}))}))},e.prototype.getUsage=function(e,t,r){return void 0===r&&(r="v1/projects"),n(this,void 0,void 0,(function(){var n;return s(this,(function(s){switch(s.label){case 0:return n=i({},t),[4,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(r,"/").concat(e,"/usage?").concat(a.default.stringify(n)))];case 1:return[2,s.sent()]}}))}))},e.prototype.getFields=function(e,t,r){return void 0===r&&(r="v1/projects"),n(this,void 0,void 0,(function(){var n;return s(this,(function(s){switch(s.label){case 0:return n=i({},t),[4,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(r,"/").concat(e,"/usage/fields?").concat(a.default.stringify(n)))];case 1:return[2,s.sent()]}}))}))},e}();t.Usage=c},1408:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.userAgent=void 0,t.userAgent=function(){var e="@deepgram/sdk/UNKNOWN node/UNKNOWN";try{e="@deepgram/sdk/".concat("2.2.0"," node/").concat(process.version.replace("v",""))}catch(e){console.warn("Could not load package details")}return e}},9376:e=>{"use strict";e.exports={mask:(e,t,r,i,n)=>{for(var s=0;s<n;s++)r[i+s]=e[s]^t[3&s]},unmask:(e,t)=>{const r=e.length;for(var i=0;i<r;i++)e[i]^=t[3&i]}}},1891:(e,t,r)=>{"use strict";try{e.exports=r(9516)(__dirname)}catch(t){e.exports=r(9376)}},7484:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,r="millisecond",i="second",n="minute",s="hour",o="day",a="week",c="month",u="quarter",l="year",h="date",f="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|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,_={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])+"]"}},v=function(e,t,r){var i=String(e);return!i||i.length>=t?e:""+Array(t+1-i.length).join(r)+e},y={s:v,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),i=Math.floor(r/60),n=r%60;return(t<=0?"+":"-")+v(i,2,"0")+":"+v(n,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var i=12*(r.year()-t.year())+(r.month()-t.month()),n=t.clone().add(i,c),s=r-n<0,o=t.clone().add(i+(s?-1:1),c);return+(-(i+(r-n)/(s?n-o:o-n))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:l,w:a,d:o,D:h,h:s,m:n,s:i,ms:r,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},m="en",b={};b[m]=_;var g=function(e){return e instanceof x},S=function e(t,r,i){var n;if(!t)return m;if("string"==typeof t){var s=t.toLowerCase();b[s]&&(n=s),r&&(b[s]=r,n=s);var o=t.split("-");if(!n&&o.length>1)return e(o[0])}else{var a=t.name;b[a]=t,n=a}return!i&&n&&(m=n),n||!i&&m},w=function(e,t){if(g(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new x(r)},O=y;O.l=S,O.i=g,O.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var x=function(){function _(e){this.$L=S(e.locale,null,!0),this.parse(e)}var v=_.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(O.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var i=t.match(d);if(i){var n=i[2]-1||0,s=(i[7]||"0").substring(0,3);return r?new Date(Date.UTC(i[1],n,i[3]||1,i[4]||0,i[5]||0,i[6]||0,s)):new Date(i[1],n,i[3]||1,i[4]||0,i[5]||0,i[6]||0,s)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},v.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()},v.$utils=function(){return O},v.isValid=function(){return!(this.$d.toString()===f)},v.isSame=function(e,t){var r=w(e);return this.startOf(t)<=r&&r<=this.endOf(t)},v.isAfter=function(e,t){return w(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<w(e)},v.$g=function(e,t,r){return O.u(e)?this[t]:this.set(r,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var r=this,u=!!O.u(t)||t,f=O.p(e),d=function(e,t){var i=O.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return u?i:i.endOf(o)},p=function(e,t){return O.w(r.toDate()[e].apply(r.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},_=this.$W,v=this.$M,y=this.$D,m="set"+(this.$u?"UTC":"");switch(f){case l:return u?d(1,0):d(31,11);case c:return u?d(1,v):d(0,v+1);case a:var b=this.$locale().weekStart||0,g=(_<b?_+7:_)-b;return d(u?y-g:y+(6-g),v);case o:case h:return p(m+"Hours",0);case s:return p(m+"Minutes",1);case n:return p(m+"Seconds",2);case i:return p(m+"Milliseconds",3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var a,u=O.p(e),f="set"+(this.$u?"UTC":""),d=(a={},a[o]=f+"Date",a[h]=f+"Date",a[c]=f+"Month",a[l]=f+"FullYear",a[s]=f+"Hours",a[n]=f+"Minutes",a[i]=f+"Seconds",a[r]=f+"Milliseconds",a)[u],p=u===o?this.$D+(t-this.$W):t;if(u===c||u===l){var _=this.clone().set(h,1);_.$d[d](p),_.init(),this.$d=_.set(h,Math.min(this.$D,_.daysInMonth())).$d}else d&&this.$d[d](p);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[O.p(e)]()},v.add=function(r,u){var h,f=this;r=Number(r);var d=O.p(u),p=function(e){var t=w(f);return O.w(t.date(t.date()+Math.round(e*r)),f)};if(d===c)return this.set(c,this.$M+r);if(d===l)return this.set(l,this.$y+r);if(d===o)return p(1);if(d===a)return p(7);var _=(h={},h[n]=e,h[s]=t,h[i]=1e3,h)[d]||1,v=this.$d.getTime()+r*_;return O.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||f;var i=e||"YYYY-MM-DDTHH:mm:ssZ",n=O.z(this),s=this.$H,o=this.$m,a=this.$M,c=r.weekdays,u=r.months,l=function(e,r,n,s){return e&&(e[r]||e(t,i))||n[r].slice(0,s)},h=function(e){return O.s(s%12||12,e,"0")},d=r.meridiem||function(e,t,r){var i=e<12?"AM":"PM";return r?i.toLowerCase():i},_={YY:String(this.$y).slice(-2),YYYY:O.s(this.$y,4,"0"),M:a+1,MM:O.s(a+1,2,"0"),MMM:l(r.monthsShort,a,u,3),MMMM:l(u,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:l(r.weekdaysMin,this.$W,c,2),ddd:l(r.weekdaysShort,this.$W,c,3),dddd:c[this.$W],H:String(s),HH:O.s(s,2,"0"),h:h(1),hh:h(2),a:d(s,o,!0),A:d(s,o,!1),m:String(o),mm:O.s(o,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:n};return i.replace(p,(function(e,t){return t||_[e]||n.replace(":","")}))},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(r,h,f){var d,p=O.p(h),_=w(r),v=(_.utcOffset()-this.utcOffset())*e,y=this-_,m=O.m(this,_);return m=(d={},d[l]=m/12,d[c]=m,d[u]=m/3,d[a]=(y-v)/6048e5,d[o]=(y-v)/864e5,d[s]=y/t,d[n]=y/e,d[i]=y/1e3,d)[p]||y,f?m:O.a(m)},v.daysInMonth=function(){return this.endOf(c).$D},v.$locale=function(){return b[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),i=S(e,t,!0);return i&&(r.$L=i),r},v.clone=function(){return O.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},_}(),E=x.prototype;return w.prototype=E,[["$ms",r],["$s",i],["$m",n],["$H",s],["$W",o],["$M",c],["$y",l],["$D",h]].forEach((function(e){E[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||(e(t,x,w),e.$i=!0),w},w.locale=S,w.isDayjs=g,w.unix=function(e){return w(1e3*e)},w.en=b[m],w.Ls=b,w.p={},w}()},178:function(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(i,n,s){var o=n.prototype;s.utc=function(e){return new n({date:e,utc:!0,args:arguments})},o.utc=function(t){var r=s(this.toDate(),{locale:this.$L,utc:!0});return t?r.add(this.utcOffset(),e):r},o.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var a=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),a.call(this,e)};var c=o.init;o.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 c.call(this)};var u=o.utcOffset;o.utcOffset=function(i,n){var s=this.$utils().u;if(s(i))return this.$u?0:s(this.$offset)?u.call(this):this.$offset;if("string"==typeof i&&(i=function(e){void 0===e&&(e="");var i=e.match(t);if(!i)return null;var n=(""+i[0]).match(r)||["-",0,0],s=n[0],o=60*+n[1]+ +n[2];return 0===o?0:"+"===s?o:-o}(i),null===i))return this;var o=Math.abs(i)<=16?60*i:i,a=this;if(n)return a.$offset=o,a.$u=0===i,a;if(0!==i){var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(a=this.local().add(o+c,e)).$offset=o,a.$x.$localOffset=c}else a=this.utc();return a};var l=o.format;o.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var h=o.toDate;o.toDate=function(e){return"s"===e&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var f=o.diff;o.diff=function(e,t,r){if(e&&this.$u===e.$u)return f.call(this,e,t,r);var i=this.local(),n=s(e).local();return f.call(i,n,t,r)}}}()},9516:(e,t,r)=>{"function"==typeof process.addon?e.exports=process.addon.bind(process):e.exports=r(7524)},7524:(e,t,r)=>{var i=r(7147),n=r(1017),s=r(2037),o=require,a=process.config&&process.config.variables||{},c=!!process.env.PREBUILDS_ONLY,u=process.versions.modules,l=process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE||"undefined"!=typeof window&&window.process&&"renderer"===window.process.type?"electron":process.versions&&process.versions.nw?"node-webkit":"node",h=process.env.npm_config_arch||s.arch(),f=process.env.npm_config_platform||s.platform(),d=process.env.LIBC||(function(e){return"linux"===e&&i.existsSync("/etc/alpine-release")}(f)?"musl":"glibc"),p=process.env.ARM_VERSION||("arm64"===h?"8":a.arm_version)||"",_=(process.versions.uv||"").split(".")[0];function v(e){return o(v.resolve(e))}function y(e){try{return i.readdirSync(e)}catch(e){return[]}}function m(e,t){var r=y(e).filter(t);return r[0]&&n.join(e,r[0])}function b(e){return/\.node$/.test(e)}function g(e){var t=e.split("-");if(2===t.length){var r=t[0],i=t[1].split("+");if(r&&i.length&&i.every(Boolean))return{name:e,platform:r,architectures:i}}}function S(e,t){return function(r){return null!=r&&r.platform===e&&r.architectures.includes(t)}}function w(e,t){return e.architectures.length-t.architectures.length}function O(e){var t=e.split("."),r={file:e,specificity:0};if("node"===t.pop()){for(var i=0;i<t.length;i++){var n=t[i];if("node"===n||"electron"===n||"node-webkit"===n)r.runtime=n;else if("napi"===n)r.napi=!0;else if("abi"===n.slice(0,3))r.abi=n.slice(3);else if("uv"===n.slice(0,2))r.uv=n.slice(2);else if("armv"===n.slice(0,4))r.armv=n.slice(4);else{if("glibc"!==n&&"musl"!==n)continue;r.libc=n}r.specificity++}return r}}function x(e,t){return function(r){return!(null==r||r.runtime!==e&&!function(e){return"node"===e.runtime&&e.napi}(r)||r.abi!==t&&!r.napi||r.uv&&r.uv!==_||r.armv&&r.armv!==p||r.libc&&r.libc!==d)}}function E(e){return function(t,r){return t.runtime!==r.runtime?t.runtime===e?-1:1:t.abi!==r.abi?t.abi?-1:1:t.specificity!==r.specificity?t.specificity>r.specificity?-1:1:0}}e.exports=v,v.resolve=v.path=function(e){e=n.resolve(e||".");try{var t=o(n.join(e,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[t+"_PREBUILD"]&&(e=process.env[t+"_PREBUILD"])}catch(e){}if(!c){var r=m(n.join(e,"build/Release"),b);if(r)return r;var i=m(n.join(e,"build/Debug"),b);if(i)return i}var s=k(e);if(s)return s;var a=k(n.dirname(process.execPath));if(a)return a;var v=["platform="+f,"arch="+h,"runtime="+l,"abi="+u,"uv="+_,p?"armv="+p:"","libc="+d,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"","webpack=true"].filter(Boolean).join(" ");throw new Error("No native build was found for "+v+"\n loaded from: "+e+"\n");function k(e){var t=y(n.join(e,"prebuilds")).map(g).filter(S(f,h)).sort(w)[0];if(t){var r=n.join(e,"prebuilds",t.name),i=y(r).map(O).filter(x(l,u)).sort(E(l))[0];return i?n.join(r,i.file):void 0}}},v.parseTags=O,v.matchTags=x,v.compareTags=E,v.parseTuple=g,v.matchTuple=S,v.compareTuples=w},137:e=>{"use strict";e.exports=function(e){const t=e.length;let r=0;for(;r<t;)if(0==(128&e[r]))r++;else if(192==(224&e[r])){if(r+1===t||128!=(192&e[r+1])||192==(254&e[r]))return!1;r+=2}else if(224==(240&e[r])){if(r+2>=t||128!=(192&e[r+1])||128!=(192&e[r+2])||224===e[r]&&128==(224&e[r+1])||237===e[r]&&160==(224&e[r+1]))return!1;r+=3}else{if(240!=(248&e[r]))return!1;if(r+3>=t||128!=(192&e[r+1])||128!=(192&e[r+2])||128!=(192&e[r+3])||240===e[r]&&128==(240&e[r+1])||244===e[r]&&e[r+1]>143||e[r]>244)return!1;r+=4}return!0}},311:(e,t,r)=>{"use strict";try{e.exports=r(9516)(__dirname)}catch(t){e.exports=r(137)}},8777:(e,t,r)=>{"use strict";const i=r(8762);i.createWebSocketStream=r(404),i.Server=r(9284),i.Receiver=r(2957),i.Sender=r(7330),e.exports=i},977:(e,t,r)=>{"use strict";const{EMPTY_BUFFER:i}=r(1872);function n(e,t){if(0===e.length)return i;if(1===e.length)return e[0];const r=Buffer.allocUnsafe(t);let n=0;for(let t=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return n<t?r.slice(0,n):r}function s(e,t,r,i,n){for(let s=0;s<n;s++)r[i+s]=e[s]^t[3&s]}function o(e,t){const r=e.length;for(let i=0;i<r;i++)e[i]^=t[3&i]}function a(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function c(e){if(c.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=Buffer.from(e):ArrayBuffer.isView(e)?t=Buffer.from(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),c.readOnly=!1),t}try{const t=r(1891),i=t.BufferUtil||t;e.exports={concat:n,mask(e,t,r,n,o){o<48?s(e,t,r,n,o):i.mask(e,t,r,n,o)},toArrayBuffer:a,toBuffer:c,unmask(e,t){e.length<32?o(e,t):i.unmask(e,t)}}}catch(t){e.exports={concat:n,mask:s,toArrayBuffer:a,toBuffer:c,unmask:o}}},1872:e=>{"use strict";e.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),EMPTY_BUFFER:Buffer.alloc(0),NOOP:()=>{}}},62:e=>{"use strict";class t{constructor(e,t){this.target=t,this.type=e}}class r extends t{constructor(e,t){super("message",t),this.data=e}}class i extends t{constructor(e,t,r){super("close",r),this.wasClean=r._closeFrameReceived&&r._closeFrameSent,this.reason=t,this.code=e}}class n extends t{constructor(e){super("open",e)}}class s extends t{constructor(e,t){super("error",t),this.message=e.message,this.error=e}}const o={addEventListener(e,t,o){if("function"!=typeof t)return;function a(e){t.call(this,new r(e,this))}function c(e,r){t.call(this,new i(e,r,this))}function u(e){t.call(this,new s(e,this))}function l(){t.call(this,new n(this))}const h=o&&o.once?"once":"on";"message"===e?(a._listener=t,this[h](e,a)):"close"===e?(c._listener=t,this[h](e,c)):"error"===e?(u._listener=t,this[h](e,u)):"open"===e?(l._listener=t,this[h](e,l)):this[h](e,t)},removeEventListener(e,t){const r=this.listeners(e);for(let i=0;i<r.length;i++)r[i]!==t&&r[i]._listener!==t||this.removeListener(e,r[i])}};e.exports=o},1503:e=>{"use strict";const t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function r(e,t,r){void 0===e[t]?e[t]=[r]:e[t].push(r)}e.exports={format:function(e){return Object.keys(e).map((t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map((e=>[t].concat(Object.keys(e).map((t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map((e=>!0===e?t:`${t}=${e}`)).join("; ")}))).join("; "))).join(", ")})).join(", ")},parse:function(e){const i=Object.create(null);if(void 0===e||""===e)return i;let n,s,o=Object.create(null),a=!1,c=!1,u=!1,l=-1,h=-1,f=0;for(;f<e.length;f++){const d=e.charCodeAt(f);if(void 0===n)if(-1===h&&1===t[d])-1===l&&(l=f);else if(32===d||9===d)-1===h&&-1!==l&&(h=f);else{if(59!==d&&44!==d)throw new SyntaxError(`Unexpected character at index ${f}`);{if(-1===l)throw new SyntaxError(`Unexpected character at index ${f}`);-1===h&&(h=f);const t=e.slice(l,h);44===d?(r(i,t,o),o=Object.create(null)):n=t,l=h=-1}}else if(void 0===s)if(-1===h&&1===t[d])-1===l&&(l=f);else if(32===d||9===d)-1===h&&-1!==l&&(h=f);else if(59===d||44===d){if(-1===l)throw new SyntaxError(`Unexpected character at index ${f}`);-1===h&&(h=f),r(o,e.slice(l,h),!0),44===d&&(r(i,n,o),o=Object.create(null),n=void 0),l=h=-1}else{if(61!==d||-1===l||-1!==h)throw new SyntaxError(`Unexpected character at index ${f}`);s=e.slice(l,f),l=h=-1}else if(c){if(1!==t[d])throw new SyntaxError(`Unexpected character at index ${f}`);-1===l?l=f:a||(a=!0),c=!1}else if(u)if(1===t[d])-1===l&&(l=f);else if(34===d&&-1!==l)u=!1,h=f;else{if(92!==d)throw new SyntaxError(`Unexpected character at index ${f}`);c=!0}else if(34===d&&61===e.charCodeAt(f-1))u=!0;else if(-1===h&&1===t[d])-1===l&&(l=f);else if(-1===l||32!==d&&9!==d){if(59!==d&&44!==d)throw new SyntaxError(`Unexpected character at index ${f}`);{if(-1===l)throw new SyntaxError(`Unexpected character at index ${f}`);-1===h&&(h=f);let t=e.slice(l,h);a&&(t=t.replace(/\\/g,""),a=!1),r(o,s,t),44===d&&(r(i,n,o),o=Object.create(null),n=void 0),s=void 0,l=h=-1}}else-1===h&&(h=f)}if(-1===l||u)throw new SyntaxError("Unexpected end of input");-1===h&&(h=f);const d=e.slice(l,h);return void 0===n?r(i,d,o):(void 0===s?r(o,d,!0):r(o,s,a?d.replace(/\\/g,""):d),r(i,n,o)),i}}},305:e=>{"use strict";const t=Symbol("kDone"),r=Symbol("kRun");e.exports=class{constructor(e){this[t]=()=>{this.pending--,this[r]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[r]()}[r](){if(this.pending!==this.concurrency&&this.jobs.length){const e=this.jobs.shift();this.pending++,e(this[t])}}}},5196:(e,t,r)=>{"use strict";const i=r(9796),n=r(977),s=r(305),{kStatusCode:o,NOOP:a}=r(1872),c=Buffer.from([0,0,255,255]),u=Symbol("permessage-deflate"),l=Symbol("total-length"),h=Symbol("callback"),f=Symbol("buffers"),d=Symbol("error");let p;function _(e){this[f].push(e),this[l]+=e.length}function v(e){this[l]+=e.length,this[u]._maxPayload<1||this[l]<=this[u]._maxPayload?this[f].push(e):(this[d]=new RangeError("Max payload size exceeded"),this[d].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[d][o]=1009,this.removeListener("data",v),this.reset())}function y(e){this[u]._inflate=null,e[o]=1007,this[h](e)}e.exports=class{constructor(e,t,r){if(this._maxPayload=0|r,this._options=e||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!p){const e=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;p=new s(e)}}static get extensionName(){return"permessage-deflate"}offer(){const e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){const e=this._deflate[h];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){const t=this._options,r=e.find((e=>!(!1===t.serverNoContextTakeover&&e.server_no_context_takeover||e.server_max_window_bits&&(!1===t.serverMaxWindowBits||"number"==typeof t.serverMaxWindowBits&&t.serverMaxWindowBits>e.server_max_window_bits)||"number"==typeof t.clientMaxWindowBits&&!e.client_max_window_bits)));if(!r)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(r.server_no_context_takeover=!0),t.clientNoContextTakeover&&(r.client_no_context_takeover=!0),"number"==typeof t.serverMaxWindowBits&&(r.server_max_window_bits=t.serverMaxWindowBits),"number"==typeof t.clientMaxWindowBits?r.client_max_window_bits=t.clientMaxWindowBits:!0!==r.client_max_window_bits&&!1!==t.clientMaxWindowBits||delete r.client_max_window_bits,r}acceptAsClient(e){const t=e[0];if(!1===this._options.clientNoContextTakeover&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(t.client_max_window_bits){if(!1===this._options.clientMaxWindowBits||"number"==typeof this._options.clientMaxWindowBits&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}else"number"==typeof this._options.clientMaxWindowBits&&(t.client_max_window_bits=this._options.clientMaxWindowBits);return t}normalizeParams(e){return e.forEach((e=>{Object.keys(e).forEach((t=>{let r=e[t];if(r.length>1)throw new Error(`Parameter "${t}" must have only a single value`);if(r=r[0],"client_max_window_bits"===t){if(!0!==r){const e=+r;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${r}`);r=e}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${t}": ${r}`)}else if("server_max_window_bits"===t){const e=+r;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${r}`);r=e}else{if("client_no_context_takeover"!==t&&"server_no_context_takeover"!==t)throw new Error(`Unknown parameter "${t}"`);if(!0!==r)throw new TypeError(`Invalid value for parameter "${t}": ${r}`)}e[t]=r}))})),e}decompress(e,t,r){p.add((i=>{this._decompress(e,t,((e,t)=>{i(),r(e,t)}))}))}compress(e,t,r){p.add((i=>{this._compress(e,t,((e,t)=>{i(),r(e,t)}))}))}_decompress(e,t,r){const s=this._isServer?"client":"server";if(!this._inflate){const e=`${s}_max_window_bits`,t="number"!=typeof this.params[e]?i.Z_DEFAULT_WINDOWBITS:this.params[e];this._inflate=i.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t}),this._inflate[u]=this,this._inflate[l]=0,this._inflate[f]=[],this._inflate.on("error",y),this._inflate.on("data",v)}this._inflate[h]=r,this._inflate.write(e),t&&this._inflate.write(c),this._inflate.flush((()=>{const e=this._inflate[d];if(e)return this._inflate.close(),this._inflate=null,void r(e);const i=n.concat(this._inflate[f],this._inflate[l]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[l]=0,this._inflate[f]=[],t&&this.params[`${s}_no_context_takeover`]&&this._inflate.reset()),r(null,i)}))}_compress(e,t,r){const s=this._isServer?"server":"client";if(!this._deflate){const e=`${s}_max_window_bits`,t="number"!=typeof this.params[e]?i.Z_DEFAULT_WINDOWBITS:this.params[e];this._deflate=i.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t}),this._deflate[l]=0,this._deflate[f]=[],this._deflate.on("error",a),this._deflate.on("data",_)}this._deflate[h]=r,this._deflate.write(e),this._deflate.flush(i.Z_SYNC_FLUSH,(()=>{if(!this._deflate)return;let e=n.concat(this._deflate[f],this._deflate[l]);t&&(e=e.slice(0,e.length-4)),this._deflate[h]=null,this._deflate[l]=0,this._deflate[f]=[],t&&this.params[`${s}_no_context_takeover`]&&this._deflate.reset(),r(null,e)}))}}},2957:(e,t,r)=>{"use strict";const{Writable:i}=r(2781),n=r(5196),{BINARY_TYPES:s,EMPTY_BUFFER:o,kStatusCode:a,kWebSocket:c}=r(1872),{concat:u,toArrayBuffer:l,unmask:h}=r(977),{isValidStatusCode:f,isValidUTF8:d}=r(6746);function p(e,t,r,i,n){const s=new e(r?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(s,p),s.code=n,s[a]=i,s}e.exports=class extends i{constructor(e,t,r,i){super(),this._binaryType=e||s[0],this[c]=void 0,this._extensions=t||{},this._isServer=!!r,this._maxPayload=0|i,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=0,this._loop=!1}_write(e,t,r){if(8===this._opcode&&0==this._state)return r();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(r)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){const t=this._buffers[0];return this._buffers[0]=t.slice(e),t.slice(0,e)}const t=Buffer.allocUnsafe(e);do{const r=this._buffers[0],i=t.length-e;e>=r.length?t.set(this._buffers.shift(),i):(t.set(new Uint8Array(r.buffer,r.byteOffset,e),i),this._buffers[0]=r.slice(e)),e-=r.length}while(e>0);return t}startLoop(e){let t;this._loop=!0;do{switch(this._state){case 0:t=this.getInfo();break;case 1:t=this.getPayloadLength16();break;case 2:t=this.getPayloadLength64();break;case 3:this.getMask();break;case 4:t=this.getData(e);break;default:return void(this._loop=!1)}}while(this._loop);e(t)}getInfo(){if(this._bufferedBytes<2)return void(this._loop=!1);const e=this.consume(2);if(0!=(48&e[0]))return this._loop=!1,p(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");const t=64==(64&e[0]);if(t&&!this._extensions[n.extensionName])return this._loop=!1,p(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=128==(128&e[0]),this._opcode=15&e[0],this._payloadLength=127&e[1],0===this._opcode){if(t)return this._loop=!1,p(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,p(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented)return this._loop=!1,p(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=t}else{if(!(this._opcode>7&&this._opcode<11))return this._loop=!1,p(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin)return this._loop=!1,p(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(t)return this._loop=!1,p(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125)return this._loop=!1,p(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}if(this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=128==(128&e[1]),this._isServer){if(!this._masked)return this._loop=!1,p(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,p(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(126===this._payloadLength)this._state=1;else{if(127!==this._payloadLength)return this.haveLength();this._state=2}}getPayloadLength16(){if(!(this._bufferedBytes<2))return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength();this._loop=!1}getPayloadLength64(){if(this._bufferedBytes<8)return void(this._loop=!1);const e=this.consume(8),t=e.readUInt32BE(0);return t>Math.pow(2,21)-1?(this._loop=!1,p(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=t*Math.pow(2,32)+e.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,p(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=3:this._state=4}getMask(){this._bufferedBytes<4?this._loop=!1:(this._mask=this.consume(4),this._state=4)}getData(e){let t=o;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength)return void(this._loop=!1);t=this.consume(this._payloadLength),this._masked&&h(t,this._mask)}return this._opcode>7?this.controlMessage(t):this._compressed?(this._state=5,void this.decompress(t,e)):(t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage())}decompress(e,t){this._extensions[n.extensionName].decompress(e,this._fin,((e,r)=>{if(e)return t(e);if(r.length){if(this._messageLength+=r.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return t(p(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));this._fragments.push(r)}const i=this.dataMessage();if(i)return t(i);this.startLoop(t)}))}dataMessage(){if(this._fin){const e=this._messageLength,t=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){let r;r="nodebuffer"===this._binaryType?u(t,e):"arraybuffer"===this._binaryType?l(u(t,e)):t,this.emit("message",r)}else{const r=u(t,e);if(!d(r))return this._loop=!1,p(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",r.toString())}}this._state=0}controlMessage(e){if(8===this._opcode)if(this._loop=!1,0===e.length)this.emit("conclude",1005,""),this.end();else{if(1===e.length)return p(RangeError,"invalid payload length 1",!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");{const t=e.readUInt16BE(0);if(!f(t))return p(RangeError,`invalid status code ${t}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");const r=e.slice(2);if(!d(r))return p(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",t,r.toString()),this.end()}}else 9===this._opcode?this.emit("ping",e):this.emit("pong",e);this._state=0}}},7330:(e,t,r)=>{"use strict";r(1808),r(4404);const{randomFillSync:i}=r(6113),n=r(5196),{EMPTY_BUFFER:s}=r(1872),{isValidStatusCode:o}=r(6746),{mask:a,toBuffer:c}=r(977),u=Buffer.alloc(4);class l{constructor(e,t){this._extensions=t||{},this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){const r=t.mask&&t.readOnly;let n=t.mask?6:2,s=e.length;e.length>=65536?(n+=8,s=127):e.length>125&&(n+=2,s=126);const o=Buffer.allocUnsafe(r?e.length+n:n);return o[0]=t.fin?128|t.opcode:t.opcode,t.rsv1&&(o[0]|=64),o[1]=s,126===s?o.writeUInt16BE(e.length,2):127===s&&(o.writeUInt32BE(0,2),o.writeUInt32BE(e.length,6)),t.mask?(i(u,0,4),o[1]|=128,o[n-4]=u[0],o[n-3]=u[1],o[n-2]=u[2],o[n-1]=u[3],r?(a(e,u,o,n,e.length),[o]):(a(e,u,e,0,e.length),[o,e])):[o,e]}close(e,t,r,i){let n;if(void 0===e)n=s;else{if("number"!=typeof e||!o(e))throw new TypeError("First argument must be a valid error code number");if(void 0===t||""===t)n=Buffer.allocUnsafe(2),n.writeUInt16BE(e,0);else{const r=Buffer.byteLength(t);if(r>123)throw new RangeError("The message must not be greater than 123 bytes");n=Buffer.allocUnsafe(2+r),n.writeUInt16BE(e,0),n.write(t,2)}}this._deflating?this.enqueue([this.doClose,n,r,i]):this.doClose(n,r,i)}doClose(e,t,r){this.sendFrame(l.frame(e,{fin:!0,rsv1:!1,opcode:8,mask:t,readOnly:!1}),r)}ping(e,t,r){const i=c(e);if(i.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPing,i,t,c.readOnly,r]):this.doPing(i,t,c.readOnly,r)}doPing(e,t,r,i){this.sendFrame(l.frame(e,{fin:!0,rsv1:!1,opcode:9,mask:t,readOnly:r}),i)}pong(e,t,r){const i=c(e);if(i.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPong,i,t,c.readOnly,r]):this.doPong(i,t,c.readOnly,r)}doPong(e,t,r,i){this.sendFrame(l.frame(e,{fin:!0,rsv1:!1,opcode:10,mask:t,readOnly:r}),i)}send(e,t,r){const i=c(e),s=this._extensions[n.extensionName];let o=t.binary?2:1,a=t.compress;if(this._firstFragment?(this._firstFragment=!1,a&&s&&(a=i.length>=s._threshold),this._compress=a):(a=!1,o=0),t.fin&&(this._firstFragment=!0),s){const e={fin:t.fin,rsv1:a,opcode:o,mask:t.mask,readOnly:c.readOnly};this._deflating?this.enqueue([this.dispatch,i,this._compress,e,r]):this.dispatch(i,this._compress,e,r)}else this.sendFrame(l.frame(i,{fin:t.fin,rsv1:!1,opcode:o,mask:t.mask,readOnly:c.readOnly}),r)}dispatch(e,t,r,i){if(!t)return void this.sendFrame(l.frame(e,r),i);const s=this._extensions[n.extensionName];this._bufferedBytes+=e.length,this._deflating=!0,s.compress(e,r.fin,((t,n)=>{if(this._socket.destroyed){const e=new Error("The socket was closed while data was being compressed");"function"==typeof i&&i(e);for(let t=0;t<this._queue.length;t++){const r=this._queue[t][4];"function"==typeof r&&r(e)}}else this._bufferedBytes-=e.length,this._deflating=!1,r.readOnly=!1,this.sendFrame(l.frame(n,r),i),this.dequeue()}))}dequeue(){for(;!this._deflating&&this._queue.length;){const e=this._queue.shift();this._bufferedBytes-=e[1].length,Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[1].length,this._queue.push(e)}sendFrame(e,t){2===e.length?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}}e.exports=l},404:(e,t,r)=>{"use strict";const{Duplex:i}=r(2781);function n(e){e.emit("close")}function s(){!this.destroyed&&this._writableState.finished&&this.destroy()}function o(e){this.removeListener("error",o),this.destroy(),0===this.listenerCount("error")&&this.emit("error",e)}e.exports=function(e,t){let r=!0,a=!0;function c(){r&&e._socket.resume()}e.readyState===e.CONNECTING?e.once("open",(function(){e._receiver.removeAllListeners("drain"),e._receiver.on("drain",c)})):(e._receiver.removeAllListeners("drain"),e._receiver.on("drain",c));const u=new i({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",(function(t){u.push(t)||(r=!1,e._socket.pause())})),e.once("error",(function(e){u.destroyed||(a=!1,u.destroy(e))})),e.once("close",(function(){u.destroyed||u.push(null)})),u._destroy=function(t,r){if(e.readyState===e.CLOSED)return r(t),void process.nextTick(n,u);let i=!1;e.once("error",(function(e){i=!0,r(e)})),e.once("close",(function(){i||r(t),process.nextTick(n,u)})),a&&e.terminate()},u._final=function(t){e.readyState!==e.CONNECTING?null!==e._socket&&(e._socket._writableState.finished?(t(),u._readableState.endEmitted&&u.destroy()):(e._socket.once("finish",(function(){t()})),e.close())):e.once("open",(function(){u._final(t)}))},u._read=function(){e.readyState!==e.OPEN&&e.readyState!==e.CLOSING||r||(r=!0,e._receiver._writableState.needDrain||e._socket.resume())},u._write=function(t,r,i){e.readyState!==e.CONNECTING?e.send(t,i):e.once("open",(function(){u._write(t,r,i)}))},u.on("end",s),u.on("error",o),u}},6746:(e,t,r)=>{"use strict";function i(e){return e>=1e3&&e<=1014&&1004!==e&&1005!==e&&1006!==e||e>=3e3&&e<=4999}function n(e){const t=e.length;let r=0;for(;r<t;)if(0==(128&e[r]))r++;else if(192==(224&e[r])){if(r+1===t||128!=(192&e[r+1])||192==(254&e[r]))return!1;r+=2}else if(224==(240&e[r])){if(r+2>=t||128!=(192&e[r+1])||128!=(192&e[r+2])||224===e[r]&&128==(224&e[r+1])||237===e[r]&&160==(224&e[r+1]))return!1;r+=3}else{if(240!=(248&e[r]))return!1;if(r+3>=t||128!=(192&e[r+1])||128!=(192&e[r+2])||128!=(192&e[r+3])||240===e[r]&&128==(240&e[r+1])||244===e[r]&&e[r+1]>143||e[r]>244)return!1;r+=4}return!0}try{let t=r(311);"object"==typeof t&&(t=t.Validation.isValidUTF8),e.exports={isValidStatusCode:i,isValidUTF8:e=>e.length<150?n(e):t(e)}}catch(t){e.exports={isValidStatusCode:i,isValidUTF8:n}}},9284:(e,t,r)=>{"use strict";const i=r(2361),n=r(3685),{createHash:s}=(r(5687),r(1808),r(4404),r(6113)),o=r(5196),a=r(8762),{format:c,parse:u}=r(1503),{GUID:l,kWebSocket:h}=r(1872),f=/^[+/0-9A-Za-z]{22}==$/;function d(e){e._state=2,e.emit("close")}function p(){this.destroy()}function _(e,t,r,i){e.writable&&(r=r||n.STATUS_CODES[t],i={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...i},e.write(`HTTP/1.1 ${t} ${n.STATUS_CODES[t]}\r\n`+Object.keys(i).map((e=>`${e}: ${i[e]}`)).join("\r\n")+"\r\n\r\n"+r)),e.removeListener("error",p),e.destroy()}function v(e){return e.trim()}e.exports=class extends i{constructor(e,t){if(super(),null==(e={maxPayload:104857600,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,...e}).port&&!e.server&&!e.noServer||null!=e.port&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(null!=e.port?(this._server=n.createServer(((e,t)=>{const r=n.STATUS_CODES[426];t.writeHead(426,{"Content-Length":r.length,"Content-Type":"text/plain"}),t.end(r)})),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){const e=this.emit.bind(this,"connection");this._removeListeners=function(e,t){for(const r of Object.keys(t))e.on(r,t[r]);return function(){for(const r of Object.keys(t))e.removeListener(r,t[r])}}(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(t,r,i)=>{this.handleUpgrade(t,r,i,e)}})}!0===e.perMessageDeflate&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set),this.options=e,this._state=0}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(e&&this.once("close",e),2===this._state)return void process.nextTick(d,this);if(1===this._state)return;if(this._state=1,this.clients)for(const e of this.clients)e.terminate();const t=this._server;t&&(this._removeListeners(),this._removeListeners=this._server=null,null!=this.options.port)?t.close(d.bind(void 0,this)):process.nextTick(d,this)}shouldHandle(e){if(this.options.path){const t=e.url.indexOf("?");if((-1!==t?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,r,i){t.on("error",p);const n=void 0!==e.headers["sec-websocket-key"]&&e.headers["sec-websocket-key"].trim(),s=+e.headers["sec-websocket-version"],a={};if("GET"!==e.method||"websocket"!==e.headers.upgrade.toLowerCase()||!n||!f.test(n)||8!==s&&13!==s||!this.shouldHandle(e))return _(t,400);if(this.options.perMessageDeflate){const r=new o(this.options.perMessageDeflate,!0,this.options.maxPayload);try{const t=u(e.headers["sec-websocket-extensions"]);t[o.extensionName]&&(r.accept(t[o.extensionName]),a[o.extensionName]=r)}catch(e){return _(t,400)}}if(this.options.verifyClient){const o={origin:e.headers[8===s?"sec-websocket-origin":"origin"],secure:!(!e.socket.authorized&&!e.socket.encrypted),req:e};if(2===this.options.verifyClient.length)return void this.options.verifyClient(o,((s,o,c,u)=>{if(!s)return _(t,o||401,c,u);this.completeUpgrade(n,a,e,t,r,i)}));if(!this.options.verifyClient(o))return _(t,401)}this.completeUpgrade(n,a,e,t,r,i)}completeUpgrade(e,t,r,i,n,u){if(!i.readable||!i.writable)return i.destroy();if(i[h])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return _(i,503);const f=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${s("sha1").update(e+l).digest("base64")}`],d=new a(null);let y=r.headers["sec-websocket-protocol"];if(y&&(y=y.split(",").map(v),y=this.options.handleProtocols?this.options.handleProtocols(y,r):y[0],y&&(f.push(`Sec-WebSocket-Protocol: ${y}`),d._protocol=y)),t[o.extensionName]){const e=t[o.extensionName].params,r=c({[o.extensionName]:[e]});f.push(`Sec-WebSocket-Extensions: ${r}`),d._extensions=t}this.emit("headers",f,r),i.write(f.concat("\r\n").join("\r\n")),i.removeListener("error",p),d.setSocket(i,n,this.options.maxPayload),this.clients&&(this.clients.add(d),d.on("close",(()=>this.clients.delete(d)))),u(d,r)}}},8762:(e,t,r)=>{"use strict";const i=r(2361),n=r(5687),s=r(3685),o=r(1808),a=r(4404),{randomBytes:c,createHash:u}=r(6113),{Readable:l}=r(2781),{URL:h}=r(7310),f=r(5196),d=r(2957),p=r(7330),{BINARY_TYPES:_,EMPTY_BUFFER:v,GUID:y,kStatusCode:m,kWebSocket:b,NOOP:g}=r(1872),{addEventListener:S,removeEventListener:w}=r(62),{format:O,parse:x}=r(1503),{toBuffer:E}=r(977),k=["CONNECTING","OPEN","CLOSING","CLOSED"],P=[8,13];class T extends i{constructor(e,t,r){super(),this._binaryType=_[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage="",this._closeTimer=null,this._extensions={},this._protocol="",this._readyState=T.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,null!==e?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,Array.isArray(t)?t=t.join(", "):"object"==typeof t&&null!==t&&(r=t,t=void 0),M(this,e,t,r)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(e){_.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get onclose(){}set onclose(e){}get onerror(){}set onerror(e){}get onopen(){}set onopen(e){}get onmessage(){}set onmessage(e){}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,r){const i=new d(this.binaryType,this._extensions,this._isServer,r);this._sender=new p(e,this._extensions),this._receiver=i,this._socket=e,i[b]=this,e[b]=this,i.on("conclude",D),i.on("drain",U),i.on("error",q),i.on("message",I),i.on("ping",B),i.on("pong",A),e.setTimeout(0),e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",G),e.on("data",F),e.on("end",H),e.on("error",V),this._readyState=T.OPEN,this.emit("open")}emitClose(){if(!this._socket)return this._readyState=T.CLOSED,void this.emit("close",this._closeCode,this._closeMessage);this._extensions[f.extensionName]&&this._extensions[f.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=T.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==T.CLOSED){if(this.readyState===T.CONNECTING){const e="WebSocket was closed before the connection was established";return N(this,this._req,e)}this.readyState!==T.CLOSING?(this._readyState=T.CLOSING,this._sender.close(e,t,!this._isServer,(e=>{e||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())})),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),3e4)):this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end()}}ping(e,t,r){if(this.readyState===T.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(r=e,e=t=void 0):"function"==typeof t&&(r=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===T.OPEN?(void 0===t&&(t=!this._isServer),this._sender.ping(e||v,t,r)):$(this,e,r)}pong(e,t,r){if(this.readyState===T.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(r=e,e=t=void 0):"function"==typeof t&&(r=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===T.OPEN?(void 0===t&&(t=!this._isServer),this._sender.pong(e||v,t,r)):$(this,e,r)}send(e,t,r){if(this.readyState===T.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof t&&(r=t,t={}),"number"==typeof e&&(e=e.toString()),this.readyState!==T.OPEN)return void $(this,e,r);const i={binary:"string"!=typeof e,mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[f.extensionName]||(i.compress=!1),this._sender.send(e||v,i,r)}terminate(){if(this.readyState!==T.CLOSED){if(this.readyState===T.CONNECTING){const e="WebSocket was closed before the connection was established";return N(this,this._req,e)}this._socket&&(this._readyState=T.CLOSING,this._socket.destroy())}}}function M(e,t,r,i){const o={protocolVersion:P[1],maxPayload:104857600,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...i,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,host:void 0,path:void 0,port:void 0};if(!P.includes(o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${P.join(", ")})`);let a;t instanceof h?(a=t,e._url=t.href):(a=new h(t),e._url=t);const l="ws+unix:"===a.protocol;if(!(a.host||l&&a.pathname)){const t=new Error(`Invalid URL: ${e.url}`);if(0===e._redirects)throw t;return void L(e,t)}const d="wss:"===a.protocol||"https:"===a.protocol,p=d?443:80,_=c(16).toString("base64"),v=d?n.get:s.get;let m;if(o.createConnection=d?C:j,o.defaultPort=o.defaultPort||p,o.port=a.port||p,o.host=a.hostname.startsWith("[")?a.hostname.slice(1,-1):a.hostname,o.headers={"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":_,Connection:"Upgrade",Upgrade:"websocket",...o.headers},o.path=a.pathname+a.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&(m=new f(!0!==o.perMessageDeflate?o.perMessageDeflate:{},!1,o.maxPayload),o.headers["Sec-WebSocket-Extensions"]=O({[f.extensionName]:m.offer()})),r&&(o.headers["Sec-WebSocket-Protocol"]=r),o.origin&&(o.protocolVersion<13?o.headers["Sec-WebSocket-Origin"]=o.origin:o.headers.Origin=o.origin),(a.username||a.password)&&(o.auth=`${a.username}:${a.password}`),l){const e=o.path.split(":");o.socketPath=e[0],o.path=e[1]}if(o.followRedirects){if(0===e._redirects){e._originalUnixSocket=l,e._originalSecure=d,e._originalHostOrSocketPath=l?o.socketPath:a.host;const t=i&&i.headers;if(i={...i,headers:{}},t)for(const[e,r]of Object.entries(t))i.headers[e.toLowerCase()]=r}else{const t=l?!!e._originalUnixSocket&&o.socketPath===e._originalHostOrSocketPath:!e._originalUnixSocket&&a.host===e._originalHostOrSocketPath;(!t||e._originalSecure&&!d)&&(delete o.headers.authorization,delete o.headers.cookie,t||delete o.headers.host,o.auth=void 0)}o.auth&&!i.headers.authorization&&(i.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64"))}let b=e._req=v(o);o.timeout&&b.on("timeout",(()=>{N(e,b,"Opening handshake has timed out")})),b.on("error",(t=>{null===b||b.aborted||(b=e._req=null,L(e,t))})),b.on("response",(n=>{const s=n.headers.location,a=n.statusCode;if(s&&o.followRedirects&&a>=300&&a<400){if(++e._redirects>o.maxRedirects)return void N(e,b,"Maximum redirects exceeded");let n;b.abort();try{n=new h(s,t)}catch(t){return void L(e,t)}M(e,n,r,i)}else e.emit("unexpected-response",b,n)||N(e,b,`Unexpected server response: ${n.statusCode}`)})),b.on("upgrade",((t,i,n)=>{if(e.emit("upgrade",t),e.readyState!==T.CONNECTING)return;if(b=e._req=null,"websocket"!==t.headers.upgrade.toLowerCase())return void N(e,i,"Invalid Upgrade header");const s=u("sha1").update(_+y).digest("base64");if(t.headers["sec-websocket-accept"]!==s)return void N(e,i,"Invalid Sec-WebSocket-Accept header");const a=t.headers["sec-websocket-protocol"],c=(r||"").split(/, */);let l;if(!r&&a?l="Server sent a subprotocol but none was requested":r&&!a?l="Server sent no subprotocol":a&&!c.includes(a)&&(l="Server sent an invalid subprotocol"),l)return void N(e,i,l);a&&(e._protocol=a);const h=t.headers["sec-websocket-extensions"];if(void 0!==h){if(!m)return void N(e,i,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");let t;try{t=x(h)}catch(t){return void N(e,i,"Invalid Sec-WebSocket-Extensions header")}const r=Object.keys(t);if(r.length){if(1!==r.length||r[0]!==f.extensionName)return void N(e,i,"Server indicated an extension that was not requested");try{m.accept(t[f.extensionName])}catch(t){return void N(e,i,"Invalid Sec-WebSocket-Extensions header")}e._extensions[f.extensionName]=m}}e.setSocket(i,n,o.maxPayload)}))}function L(e,t){e._readyState=T.CLOSING,e.emit("error",t),e.emitClose()}function j(e){return e.path=e.socketPath,o.connect(e)}function C(e){return e.path=void 0,e.servername||""===e.servername||(e.servername=o.isIP(e.host)?"":e.host),a.connect(e)}function N(e,t,r){e._readyState=T.CLOSING;const i=new Error(r);Error.captureStackTrace(i,N),t.setHeader?(t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),t.once("abort",e.emitClose.bind(e)),e.emit("error",i)):(t.destroy(i),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function $(e,t,r){if(t){const r=E(t).length;e._socket?e._sender._bufferedBytes+=r:e._bufferedAmount+=r}r&&r(new Error(`WebSocket is not open: readyState ${e.readyState} (${k[e.readyState]})`))}function D(e,t){const r=this[b];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,void 0!==r._socket[b]&&(r._socket.removeListener("data",F),process.nextTick(W,r._socket),1005===e?r.close():r.close(e,t))}function U(){this[b]._socket.resume()}function q(e){const t=this[b];void 0!==t._socket[b]&&(t._socket.removeListener("data",F),process.nextTick(W,t._socket),t.close(e[m])),t.emit("error",e)}function R(){this[b].emitClose()}function I(e){this[b].emit("message",e)}function B(e){const t=this[b];t.pong(e,!t._isServer,g),t.emit("ping",e)}function A(e){this[b].emit("pong",e)}function W(e){e.resume()}function G(){const e=this[b];let t;this.removeListener("close",G),this.removeListener("data",F),this.removeListener("end",H),e._readyState=T.CLOSING,this._readableState.endEmitted||e._closeFrameReceived||e._receiver._writableState.errorEmitted||null===(t=e._socket.read())||e._receiver.write(t),e._receiver.end(),this[b]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",R),e._receiver.on("finish",R))}function F(e){this[b]._receiver.write(e)||this.pause()}function H(){const e=this[b];e._readyState=T.CLOSING,e._receiver.end(),this.end()}function V(){const e=this[b];this.removeListener("error",V),this.on("error",g),e&&(e._readyState=T.CLOSING,this.destroy())}Object.defineProperty(T,"CONNECTING",{enumerable:!0,value:k.indexOf("CONNECTING")}),Object.defineProperty(T.prototype,"CONNECTING",{enumerable:!0,value:k.indexOf("CONNECTING")}),Object.defineProperty(T,"OPEN",{enumerable:!0,value:k.indexOf("OPEN")}),Object.defineProperty(T.prototype,"OPEN",{enumerable:!0,value:k.indexOf("OPEN")}),Object.defineProperty(T,"CLOSING",{enumerable:!0,value:k.indexOf("CLOSING")}),Object.defineProperty(T.prototype,"CLOSING",{enumerable:!0,value:k.indexOf("CLOSING")}),Object.defineProperty(T,"CLOSED",{enumerable:!0,value:k.indexOf("CLOSED")}),Object.defineProperty(T.prototype,"CLOSED",{enumerable:!0,value:k.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","protocol","readyState","url"].forEach((e=>{Object.defineProperty(T.prototype,e,{enumerable:!0})})),["open","error","close","message"].forEach((e=>{Object.defineProperty(T.prototype,`on${e}`,{enumerable:!0,get(){const t=this.listeners(e);for(let e=0;e<t.length;e++)if(t[e]._listener)return t[e]._listener},set(t){const r=this.listeners(e);for(let t=0;t<r.length;t++)r[t]._listener&&this.removeListener(e,r[t]);this.addEventListener(e,t)}})})),T.prototype.addEventListener=S,T.prototype.removeEventListener=w,e.exports=T},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},3477:e=>{"use strict";e.exports=require("querystring")},2781:e=>{"use strict";e.exports=require("stream")},4404:e=>{"use strict";e.exports=require("tls")},7310:e=>{"use strict";e.exports=require("url")},9796:e=>{"use strict";e.exports=require("zlib")}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={exports:{}};return e[i].call(s.exports,s,s.exports,r),s.exports}var i={};return(()=>{"use strict";var e=i;Object.defineProperty(e,"__esModule",{value:!0}),e.Deepgram=void 0;var t=r(6092),n=r(9292),s=r(319),o=r(487),a=r(5321),c=r(8949),u=r(6359),l=r(5343),h=r(3647),f=r(5483),d=r(1098);e.Deepgram=function(e,r,i){this._apiKey=e,this._apiUrl=null!=r?r:t.DefaultOptions.apiUrl,this._requireSSL=null!=i?i:t.DefaultOptions.requireSSL,(0,f.validateOptions)(this._apiKey,this._apiUrl),this.keys=new n.Keys(this._apiKey,this._apiUrl,this._requireSSL,d._request),this.projects=new s.Projects(this._apiKey,this._apiUrl,this._requireSSL,d._request),this.transcription=new o.Transcriber(this._apiKey,this._apiUrl,this._requireSSL),this.usage=new a.Usage(this._apiKey,this._apiUrl,this._requireSSL,d._request),this.members=new c.Members(this._apiKey,this._apiUrl,this._requireSSL,d._request),this.invitation=new u.Invitation(this._apiKey,this._apiUrl,this._requireSSL,d._request),this.billing=new l.Billing(this._apiKey,this._apiUrl,this._requireSSL,d._request),this.scopes=new h.Scopes(this._apiKey,this._apiUrl,this._requireSSL,d._request)}})(),i})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["dg-node-sdk"]=t():e["dg-node-sdk"]=t()}(global,(()=>(()=>{var e={5343:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Billing=void 0;var i=function(){function e(e,t,r,n){this._credentials=e,this._apiUrl=t,this._requireSSL=r,this._request=n}return e.prototype.listBalances=function(e,t){return void 0===t&&(t="v1/projects"),r(this,void 0,void 0,(function(){return n(this,(function(r){return[2,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(t,"/").concat(e,"/balances"))]}))}))},e.prototype.getBalance=function(e,t,i){return void 0===i&&(i="v1/projects"),r(this,void 0,void 0,(function(){return n(this,(function(r){return[2,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(i,"/").concat(e,"/balances/").concat(t))]}))}))},e}();t.Billing=i},6688:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultOptions=void 0,t.DefaultOptions={apiUrl:"api.deepgram.com",requireSSL:!0}},6092:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=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}),i(r(6688),t)},2625:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1447:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionState=void 0,(r=t.ConnectionState||(t.ConnectionState={}))[r.CONNECTING=0]="CONNECTING",r[r.OPEN=1]="OPEN",r[r.CLOSING=2]="CLOSING",r[r.CLOSED=3]="CLOSED"},5153:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6121:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=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}),i(r(2625),t),i(r(1447),t),i(r(5153),t),i(r(2843),t),i(r(5754),t),i(r(3544),t),i(r(5272),t)},2843:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5754:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3544:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5272:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5483:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=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}),i(r(9489),t),i(r(2795),t)},9489: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.secondsToTimestamp=void 0;var i=n(r(7484)),s=n(r(178));i.default.extend(s.default),t.secondsToTimestamp=function(e,t){return void 0===t&&(t="HH:mm:ss.SSS"),(0,i.default)(1e3*e).utc().format(t)}},2795:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateOptions=void 0,t.validateOptions=function(e,t){if(!e||0===e.trim().length)throw new Error("DG: API key is required");if(!t||0===t.trim().length)throw new Error("DG: API url should be a valid url or not provided")}},1098:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._request=void 0;var s=r(2781),o=i(r(5687)),a=i(r(3685)),c=r(1408);t._request=function(e,t,r,i,u,l,h){var f=function(e,t,r,i,o,a,u){var l={};!a||a instanceof s.Readable||(l["Content-Length"]=Buffer.byteLength(a));var h={host:t,protocol:r?"https:":"http:",path:i,method:o,headers:n({"User-Agent":(0,c.userAgent)(),"Content-Type":"application/json",Authorization:"token ".concat(e)},l)},f=h.headers;return u&&u.headers&&(f=n(n({},f),u.headers)),n(n(n({},h),u),{headers:f})}(t,r,i,u,e,l,h);return new Promise((function(e,t){try{var r=(i?o.default:a.default).request(f,(function(r){var n="";r.on("data",(function(e){n+=e})),r.on("end",(function(){var i;try{i=JSON.parse(n)}catch(e){i={error:n}}r.statusCode&&r.statusCode>=400&&(i.error,t("DG: ".concat(JSON.stringify(i)))),i.error&&t("DG: ".concat(n)),e(i)})),r.on("error",(function(e){t("DG: ".concat(e))}))}));r.on("error",(function(e){t("DG: ".concat(e))})),l?l instanceof s.Readable?(l.pipe(r),l.on("finish",(function(){r.end()}))):(r.write(l),r.end()):r.end()}catch(e){t("DG: ".concat(e))}}))}},6359:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Invitation=void 0;var i=function(){function e(e,t,r,n){this._credentials=e,this._apiUrl=t,this._requireSSL=r,this._request=n}return e.prototype.list=function(e,t){return void 0===t&&(t="v1/projects"),r(this,void 0,void 0,(function(){return n(this,(function(r){return[2,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(t,"/").concat(e,"/invites"))]}))}))},e.prototype.send=function(e,t,i){return void 0===i&&(i="v1/projects"),r(this,void 0,void 0,(function(){return n(this,(function(r){return[2,this._request("POST",this._credentials,this._apiUrl,this._requireSSL,"/".concat(i,"/").concat(e,"/invites"),JSON.stringify({email:t.email,scope:t.scope}))]}))}))},e.prototype.leave=function(e,t){return void 0===t&&(t="v1/projects"),r(this,void 0,void 0,(function(){return n(this,(function(r){return[2,this._request("DELETE",this._credentials,this._apiUrl,this._requireSSL,"/".concat(t,"/").concat(e,"/leave"))]}))}))},e.prototype.delete=function(e,t,i){return void 0===i&&(i="v1/projects"),r(this,void 0,void 0,(function(){return n(this,(function(r){return[2,this._request("DELETE",this._credentials,this._apiUrl,this._requireSSL,"/".concat(i,"/").concat(e,"/invites/").concat(t))]}))}))},e}();t.Invitation=i},9292:function(e,t){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Keys=void 0;var s=function(){function e(e,t,r,n){this._credentials=e,this._apiUrl=t,this._requireSSL=r,this._request=n}return e.prototype.list=function(e,t){return void 0===t&&(t="v1/projects"),n(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(t,"/").concat(e,"/keys"))];case 1:return[2,{api_keys:n.sent().api_keys.map((function(e){return r(r({},e),e.api_key)}))}]}}))}))},e.prototype.get=function(e,t,r){return void 0===r&&(r="v1/projects"),n(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(r,"/").concat(e,"/keys/").concat(t))]}))}))},e.prototype.create=function(e,t,r,s,o){return void 0===o&&(o="v1/projects"),n(this,void 0,void 0,(function(){return i(this,(function(n){if(s&&void 0!==s.expirationDate&&void 0!==s.timeToLive)throw new Error("Please provide expirationDate or timeToLive or neither. Providing both is not allowed.");return[2,this._request("POST",this._credentials,this._apiUrl,this._requireSSL,"/".concat(o,"/").concat(e,"/keys"),JSON.stringify({comment:t,scopes:r,expiration_date:s&&s.expirationDate?s.expirationDate:void 0,time_to_live_in_seconds:s&&s.timeToLive?s.timeToLive:void 0}))]}))}))},e.prototype.delete=function(e,t,r){return void 0===r&&(r="v1/projects"),n(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this._request("DELETE",this._credentials,this._apiUrl,this._requireSSL,"/".concat(r,"/").concat(e,"/keys/").concat(t))]}))}))},e}();t.Keys=s},8949:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Members=void 0;var i=function(){function e(e,t,r,n){this._credentials=e,this._apiUrl=t,this._requireSSL=r,this._request=n}return e.prototype.listMembers=function(e,t){return void 0===t&&(t="v1/projects"),r(this,void 0,void 0,(function(){return n(this,(function(r){return[2,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(t,"/").concat(e,"/members"))]}))}))},e.prototype.removeMember=function(e,t,i){return void 0===i&&(i="v1/projects"),r(this,void 0,void 0,(function(){return n(this,(function(r){return[2,this._request("DELETE",this._credentials,this._apiUrl,this._requireSSL,"/".concat(i,"/").concat(e,"/members/").concat(t))]}))}))},e}();t.Members=i},319:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Projects=void 0;var i=function(){function e(e,t,r,n){this._credentials=e,this._apiUrl=t,this._requireSSL=r,this._request=n}return e.prototype.list=function(e){return void 0===e&&(e="v1/projects"),r(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(e))]}))}))},e.prototype.get=function(e,t){return void 0===t&&(t="v1/projects"),r(this,void 0,void 0,(function(){return n(this,(function(r){return[2,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(t,"/").concat(e))]}))}))},e.prototype.update=function(e,t,i){return void 0===i&&(i="v1/projects"),r(this,void 0,void 0,(function(){var r,s;return n(this,(function(n){return s=e,(r=e).project_id&&(s=r.project_id),[2,this._request("PATCH",this._credentials,this._apiUrl,this._requireSSL,"/".concat(i,"/").concat(s),JSON.stringify(t))]}))}))},e.prototype.delete=function(e,t){return void 0===t&&(t="v1/projects"),r(this,void 0,void 0,(function(){return n(this,(function(r){return[2,this._request("DELETE",this._credentials,this._apiUrl,this._requireSSL,"/".concat(t,"/").concat(e))]}))}))},e}();t.Projects=i},3647:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Scopes=void 0;var i=function(){function e(e,t,r,n){this._credentials=e,this._apiUrl=t,this._requireSSL=r,this._request=n}return e.prototype.get=function(e,t,i){return void 0===i&&(i="v1/projects"),r(this,void 0,void 0,(function(){return n(this,(function(r){return[2,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(i,"/").concat(e,"/members/").concat(t,"/scopes"))]}))}))},e.prototype.update=function(e,t,i,s){return void 0===s&&(s="v1/projects"),r(this,void 0,void 0,(function(){return n(this,(function(r){return[2,this._request("PUT",this._credentials,this._apiUrl,this._requireSSL,"/".concat(s,"/").concat(e,"/members/").concat(t,"/scopes"),JSON.stringify({scope:i}))]}))}))},e}();t.Scopes=i},487:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Transcriber=void 0;var s=r(5379),o=r(3825),a=function(){function e(e,t,r){this._credentials=e,this._apiUrl=t,this._requireSSL=r}return e.prototype.preRecorded=function(e,t,r){return n(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,(0,o.preRecordedTranscription)(this._credentials,this._apiUrl||"",this._requireSSL,e,t,r)];case 1:return[2,n.sent()]}}))}))},e.prototype.live=function(e,t){return new s.LiveTranscription(this._credentials,this._apiUrl||"",this._requireSSL,e,t)},e}();t.Transcriber=a},5379:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__assign||function(){return s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},s.apply(this,arguments)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LiveTranscription=void 0;var a=o(r(2361)),c=o(r(3477)),u=o(r(8777)),l=r(6121),h=r(1408),f=function(e){function t(t,r,n,i,o){void 0===o&&(o="v1/listen");var a=e.call(this,void 0)||this,l=s({},i),f=n?"wss":"ws";return a._socket=new u.default("".concat(f,"://").concat(r,"/").concat(o,"?").concat(c.default.stringify(l)),{headers:{Authorization:"token ".concat(t),"User-Agent":(0,h.userAgent)()}}),a._bindSocketEvents(),a}return i(t,e),t.prototype._bindSocketEvents=function(){var e=this;this._socket.onopen=function(){e.emit("open",e)},this._socket.onclose=function(t){var r=t.target;if(r._req){var n=r._req.res.rawHeaders.indexOf("dg-error");t.reason=r._req.res.rawHeaders[n+1]}e.emit("close",t)},this._socket.onerror=function(t){e.emit("error",t)},this._socket.onmessage=function(t){e.emit("transcriptReceived",t.data)}},t.prototype.configure=function(e){this._socket.send(JSON.stringify({type:"Configure",processors:e}))},t.prototype.keepAlive=function(){this._socket.send(JSON.stringify({type:"KeepAlive"}))},t.prototype.getReadyState=function(){return this._socket.readyState},t.prototype.send=function(e){this._socket.readyState===l.ConnectionState.OPEN?this._socket.send(e):this.emit("error","Could not send. Connection not open.")},t.prototype.finish=function(){this._socket.send(new Uint8Array(0))},t}(a.default);t.LiveTranscription=f},3825:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.preRecordedTranscription=void 0;var a=o(r(3477)),c=r(3274),u=r(1098);function l(e){return!!e.url}t.preRecordedTranscription=function(e,t,r,o,h,f){return void 0===f&&(f="v1/listen"),i(void 0,void 0,void 0,(function(){var i,d,p,_;return s(this,(function(s){switch(s.label){case 0:if(i=n({},h),!l(o)&&(void 0===o.mimetype||0===o.mimetype.length))throw new Error("DG: Mimetype must be provided if the source is a Buffer or a Readable");if(l(o))d=JSON.stringify(o);else if(o.buffer)d=o.buffer;else{if(!o.stream)throw new Error("Unknown TranscriptionSource type");d=o.stream}return p={},l(o)||(p.headers={"Content-Type":o.mimetype}),[4,(0,u._request)("POST",e,t,r,"/".concat(f,"?").concat(a.default.stringify(i)),d,p)];case 1:return _=s.sent(),[2,Object.assign(new c.PrerecordedTranscriptionResponse,_)]}}))}))}},7660:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4407:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9674:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6143:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6513:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5021:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7096:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3274:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=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}),i(r(7660),t),i(r(7467),t),i(r(4407),t),i(r(9674),t),i(r(6143),t),i(r(6513),t),i(r(7096),t),i(r(5642),t),i(r(3867),t),i(r(7135),t),i(r(7569),t),i(r(4630),t),i(r(1741),t),i(r(5395),t),i(r(9713),t),i(r(2140),t),i(r(6397),t),i(r(4148),t),i(r(5937),t),i(r(2135),t),i(r(597),t),i(r(5086),t),i(r(6339),t),i(r(838),t),i(r(4439),t),i(r(2678),t),i(r(9266),t),i(r(7845),t),i(r(5935),t),i(r(1562),t),i(r(6536),t),i(r(393),t),i(r(3249),t),i(r(2401),t),i(r(2e3),t),i(r(4019),t),i(r(9070),t),i(r(2862),t),i(r(5228),t),i(r(1491),t),i(r(8169),t),i(r(4016),t),i(r(432),t),i(r(7992),t),i(r(7894),t),i(r(6108),t),i(r(5278),t),i(r(8121),t),i(r(5021),t)},5642:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3867:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7135:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7569:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4630:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1741:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5395:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9713:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2140:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6397:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4148:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5937:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2135:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},597:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5086:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrerecordedTranscriptionResponse=void 0;var n=r(5483),i=function(){function e(){}return e.prototype.toWebVTT=function(e){var t,r,i,s;if(void 0===e&&(e=8),!this.results||!this.results.utterances)throw new Error("This function requires a transcript that was generated with the utterances feature.");var o=[];return o.push("WEBVTT"),o.push(""),o.push("NOTE"),o.push("Transcription provided by Deepgram"),o.push("Request Id: ".concat(null===(t=this.metadata)||void 0===t?void 0:t.request_id)),o.push("Created: ".concat(null===(r=this.metadata)||void 0===r?void 0:r.created)),o.push("Duration: ".concat(null===(i=this.metadata)||void 0===i?void 0:i.duration)),o.push("Channels: ".concat(null===(s=this.metadata)||void 0===s?void 0:s.channels)),o.push(""),this.results.utterances.forEach((function(t){o.push(function(e,t){var r=function(e,t){for(var r=[],n=0;n<e.length;n+=t){var i=e.slice(n,n+t);r.push(i)}return r}(e.words,t),i=[];return r.forEach((function(e){var t=e[0],r=e[e.length-1];i.push("".concat((0,n.secondsToTimestamp)(t.start)," --\x3e ").concat((0,n.secondsToTimestamp)(r.end))),i.push(e.map((function(e){var t;return null!==(t=e.punctuated_word)&&void 0!==t?t:e.word})).join(" ")),i.push("")})),i.join("\n")}(t,e))})),o.join("\n")},e.prototype.toSRT=function(e){if(void 0===e&&(e=8),!this.results||!this.results.utterances)throw new Error("This function requires a transcript that was generated with the utterances feature.");var t=[],r=1;return this.results.utterances.forEach((function(i){t.push(function(e,t){var i=function(e,t){for(var r=[],n=0;n<e.length;n+=t){var i=e.slice(n,n+t);r.push(i)}return r}(e.words,t),s=[];return i.forEach((function(e){var t=e[0],i=e[e.length-1];s.push((r++).toString()),s.push("".concat((0,n.secondsToTimestamp)(t.start,"HH:mm:ss,SSS")," --\x3e ").concat((0,n.secondsToTimestamp)(i.end,"HH:mm:ss,SSS"))),s.push(e.map((function(e){var t;return null!==(t=e.punctuated_word)&&void 0!==t?t:e.word})).join(" ")),s.push("")})),s.join("\n")}(i,e))})),t.join("\n")},e}();t.PrerecordedTranscriptionResponse=i},6339:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},838:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4439:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2678:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9266:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7845:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5935:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1562:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6536:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},393:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3249:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2401:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2e3:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4019:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9070:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5228:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1491:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8169:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4016:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},432:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7992:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7894:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6108:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5278:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5321:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Usage=void 0;var a=o(r(3477)),c=function(){function e(e,t,r,n){this._credentials=e,this._apiUrl=t,this._requireSSL=r,this._request=n}return e.prototype.listRequests=function(e,t,r){return void 0===r&&(r="v1/projects"),i(this,void 0,void 0,(function(){var i;return s(this,(function(s){switch(s.label){case 0:return i=n({},t),[4,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(r,"/").concat(e,"/requests?").concat(a.default.stringify(i)))];case 1:return[2,s.sent()]}}))}))},e.prototype.getRequest=function(e,t,r){return void 0===r&&(r="v1/projects"),i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(r,"/").concat(e,"/requests/").concat(t))];case 1:return[2,n.sent()]}}))}))},e.prototype.getUsage=function(e,t,r){return void 0===r&&(r="v1/projects"),i(this,void 0,void 0,(function(){var i;return s(this,(function(s){switch(s.label){case 0:return i=n({},t),[4,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(r,"/").concat(e,"/usage?").concat(a.default.stringify(i)))];case 1:return[2,s.sent()]}}))}))},e.prototype.getFields=function(e,t,r){return void 0===r&&(r="v1/projects"),i(this,void 0,void 0,(function(){var i;return s(this,(function(s){switch(s.label){case 0:return i=n({},t),[4,this._request("GET",this._credentials,this._apiUrl,this._requireSSL,"/".concat(r,"/").concat(e,"/usage/fields?").concat(a.default.stringify(i)))];case 1:return[2,s.sent()]}}))}))},e}();t.Usage=c},1408:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.userAgent=void 0,t.userAgent=function(){var e="@deepgram/sdk/UNKNOWN node/UNKNOWN";try{e="@deepgram/sdk/".concat("2.3.0"," node/").concat(process.version.replace("v",""))}catch(e){console.warn("Could not load package details")}return e}},9376:e=>{"use strict";e.exports={mask:(e,t,r,n,i)=>{for(var s=0;s<i;s++)r[n+s]=e[s]^t[3&s]},unmask:(e,t)=>{const r=e.length;for(var n=0;n<r;n++)e[n]^=t[3&n]}}},1891:(e,t,r)=>{"use strict";try{e.exports=r(9516)(__dirname)}catch(t){e.exports=r(9376)}},7484:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,r="millisecond",n="second",i="minute",s="hour",o="day",a="week",c="month",u="quarter",l="year",h="date",f="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|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,_={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])+"]"}},v=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},y={s:v,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),i=r%60;return(t<=0?"+":"-")+v(n,2,"0")+":"+v(i,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()),i=t.clone().add(n,c),s=r-i<0,o=t.clone().add(n+(s?-1:1),c);return+(-(n+(r-i)/(s?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:l,w:a,d:o,D:h,h:s,m:i,s:n,ms:r,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",m={};m[b]=_;var g=function(e){return e instanceof x},S=function e(t,r,n){var i;if(!t)return b;if("string"==typeof t){var s=t.toLowerCase();m[s]&&(i=s),r&&(m[s]=r,i=s);var o=t.split("-");if(!i&&o.length>1)return e(o[0])}else{var a=t.name;m[a]=t,i=a}return!n&&i&&(b=i),i||!n&&b},w=function(e,t){if(g(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new x(r)},O=y;O.l=S,O.i=g,O.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var x=function(){function _(e){this.$L=S(e.locale,null,!0),this.parse(e)}var v=_.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(O.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(d);if(n){var i=n[2]-1||0,s=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},v.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()},v.$utils=function(){return O},v.isValid=function(){return!(this.$d.toString()===f)},v.isSame=function(e,t){var r=w(e);return this.startOf(t)<=r&&r<=this.endOf(t)},v.isAfter=function(e,t){return w(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<w(e)},v.$g=function(e,t,r){return O.u(e)?this[t]:this.set(r,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var r=this,u=!!O.u(t)||t,f=O.p(e),d=function(e,t){var n=O.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return u?n:n.endOf(o)},p=function(e,t){return O.w(r.toDate()[e].apply(r.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},_=this.$W,v=this.$M,y=this.$D,b="set"+(this.$u?"UTC":"");switch(f){case l:return u?d(1,0):d(31,11);case c:return u?d(1,v):d(0,v+1);case a:var m=this.$locale().weekStart||0,g=(_<m?_+7:_)-m;return d(u?y-g:y+(6-g),v);case o:case h:return p(b+"Hours",0);case s:return p(b+"Minutes",1);case i:return p(b+"Seconds",2);case n:return p(b+"Milliseconds",3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var a,u=O.p(e),f="set"+(this.$u?"UTC":""),d=(a={},a[o]=f+"Date",a[h]=f+"Date",a[c]=f+"Month",a[l]=f+"FullYear",a[s]=f+"Hours",a[i]=f+"Minutes",a[n]=f+"Seconds",a[r]=f+"Milliseconds",a)[u],p=u===o?this.$D+(t-this.$W):t;if(u===c||u===l){var _=this.clone().set(h,1);_.$d[d](p),_.init(),this.$d=_.set(h,Math.min(this.$D,_.daysInMonth())).$d}else d&&this.$d[d](p);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[O.p(e)]()},v.add=function(r,u){var h,f=this;r=Number(r);var d=O.p(u),p=function(e){var t=w(f);return O.w(t.date(t.date()+Math.round(e*r)),f)};if(d===c)return this.set(c,this.$M+r);if(d===l)return this.set(l,this.$y+r);if(d===o)return p(1);if(d===a)return p(7);var _=(h={},h[i]=e,h[s]=t,h[n]=1e3,h)[d]||1,v=this.$d.getTime()+r*_;return O.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||f;var n=e||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,o=this.$m,a=this.$M,c=r.weekdays,u=r.months,l=r.meridiem,h=function(e,r,i,s){return e&&(e[r]||e(t,n))||i[r].slice(0,s)},d=function(e){return O.s(s%12||12,e,"0")},_=l||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(p,(function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return O.s(t.$y,4,"0");case"M":return a+1;case"MM":return O.s(a+1,2,"0");case"MMM":return h(r.monthsShort,a,u,3);case"MMMM":return h(u,a);case"D":return t.$D;case"DD":return O.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return h(r.weekdaysMin,t.$W,c,2);case"ddd":return h(r.weekdaysShort,t.$W,c,3);case"dddd":return c[t.$W];case"H":return String(s);case"HH":return O.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return _(s,o,!0);case"A":return _(s,o,!1);case"m":return String(o);case"mm":return O.s(o,2,"0");case"s":return String(t.$s);case"ss":return O.s(t.$s,2,"0");case"SSS":return O.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")}))},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(r,h,f){var d,p=this,_=O.p(h),v=w(r),y=(v.utcOffset()-this.utcOffset())*e,b=this-v,m=function(){return O.m(p,v)};switch(_){case l:d=m()/12;break;case c:d=m();break;case u:d=m()/3;break;case a:d=(b-y)/6048e5;break;case o:d=(b-y)/864e5;break;case s:d=b/t;break;case i:d=b/e;break;case n:d=b/1e3;break;default:d=b}return f?d:O.a(d)},v.daysInMonth=function(){return this.endOf(c).$D},v.$locale=function(){return m[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=S(e,t,!0);return n&&(r.$L=n),r},v.clone=function(){return O.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},_}(),E=x.prototype;return w.prototype=E,[["$ms",r],["$s",n],["$m",i],["$H",s],["$W",o],["$M",c],["$y",l],["$D",h]].forEach((function(e){E[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||(e(t,x,w),e.$i=!0),w},w.locale=S,w.isDayjs=g,w.unix=function(e){return w(1e3*e)},w.en=m[b],w.Ls=m,w.p={},w}()},178:function(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,s){var o=i.prototype;s.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var r=s(this.toDate(),{locale:this.$L,utc:!0});return t?r.add(this.utcOffset(),e):r},o.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var a=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),a.call(this,e)};var c=o.init;o.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 c.call(this)};var u=o.utcOffset;o.utcOffset=function(n,i){var s=this.$utils().u;if(s(n))return this.$u?0:s(this.$offset)?u.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 i=(""+n[0]).match(r)||["-",0,0],s=i[0],o=60*+i[1]+ +i[2];return 0===o?0:"+"===s?o:-o}(n),null===n))return this;var o=Math.abs(n)<=16?60*n:n,a=this;if(i)return a.$offset=o,a.$u=0===n,a;if(0!==n){var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(a=this.local().add(o+c,e)).$offset=o,a.$x.$localOffset=c}else a=this.utc();return a};var l=o.format;o.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var h=o.toDate;o.toDate=function(e){return"s"===e&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var f=o.diff;o.diff=function(e,t,r){if(e&&this.$u===e.$u)return f.call(this,e,t,r);var n=this.local(),i=s(e).local();return f.call(n,i,t,r)}}}()},9516:(e,t,r)=>{"function"==typeof process.addon?e.exports=process.addon.bind(process):e.exports=r(7524)},7524:(e,t,r)=>{var n=r(7147),i=r(1017),s=r(2037),o=require,a=process.config&&process.config.variables||{},c=!!process.env.PREBUILDS_ONLY,u=process.versions.modules,l=process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE||"undefined"!=typeof window&&window.process&&"renderer"===window.process.type?"electron":process.versions&&process.versions.nw?"node-webkit":"node",h=process.env.npm_config_arch||s.arch(),f=process.env.npm_config_platform||s.platform(),d=process.env.LIBC||(function(e){return"linux"===e&&n.existsSync("/etc/alpine-release")}(f)?"musl":"glibc"),p=process.env.ARM_VERSION||("arm64"===h?"8":a.arm_version)||"",_=(process.versions.uv||"").split(".")[0];function v(e){return o(v.resolve(e))}function y(e){try{return n.readdirSync(e)}catch(e){return[]}}function b(e,t){var r=y(e).filter(t);return r[0]&&i.join(e,r[0])}function m(e){return/\.node$/.test(e)}function g(e){var t=e.split("-");if(2===t.length){var r=t[0],n=t[1].split("+");if(r&&n.length&&n.every(Boolean))return{name:e,platform:r,architectures:n}}}function S(e,t){return function(r){return null!=r&&r.platform===e&&r.architectures.includes(t)}}function w(e,t){return e.architectures.length-t.architectures.length}function O(e){var t=e.split("."),r={file:e,specificity:0};if("node"===t.pop()){for(var n=0;n<t.length;n++){var i=t[n];if("node"===i||"electron"===i||"node-webkit"===i)r.runtime=i;else if("napi"===i)r.napi=!0;else if("abi"===i.slice(0,3))r.abi=i.slice(3);else if("uv"===i.slice(0,2))r.uv=i.slice(2);else if("armv"===i.slice(0,4))r.armv=i.slice(4);else{if("glibc"!==i&&"musl"!==i)continue;r.libc=i}r.specificity++}return r}}function x(e,t){return function(r){return!(null==r||r.runtime!==e&&!function(e){return"node"===e.runtime&&e.napi}(r)||r.abi!==t&&!r.napi||r.uv&&r.uv!==_||r.armv&&r.armv!==p||r.libc&&r.libc!==d)}}function E(e){return function(t,r){return t.runtime!==r.runtime?t.runtime===e?-1:1:t.abi!==r.abi?t.abi?-1:1:t.specificity!==r.specificity?t.specificity>r.specificity?-1:1:0}}e.exports=v,v.resolve=v.path=function(e){e=i.resolve(e||".");try{var t=o(i.join(e,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[t+"_PREBUILD"]&&(e=process.env[t+"_PREBUILD"])}catch(e){}if(!c){var r=b(i.join(e,"build/Release"),m);if(r)return r;var n=b(i.join(e,"build/Debug"),m);if(n)return n}var s=k(e);if(s)return s;var a=k(i.dirname(process.execPath));if(a)return a;var v=["platform="+f,"arch="+h,"runtime="+l,"abi="+u,"uv="+_,p?"armv="+p:"","libc="+d,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"","webpack=true"].filter(Boolean).join(" ");throw new Error("No native build was found for "+v+"\n loaded from: "+e+"\n");function k(e){var t=y(i.join(e,"prebuilds")).map(g).filter(S(f,h)).sort(w)[0];if(t){var r=i.join(e,"prebuilds",t.name),n=y(r).map(O).filter(x(l,u)).sort(E(l))[0];return n?i.join(r,n.file):void 0}}},v.parseTags=O,v.matchTags=x,v.compareTags=E,v.parseTuple=g,v.matchTuple=S,v.compareTuples=w},137:e=>{"use strict";e.exports=function(e){const t=e.length;let r=0;for(;r<t;)if(0==(128&e[r]))r++;else if(192==(224&e[r])){if(r+1===t||128!=(192&e[r+1])||192==(254&e[r]))return!1;r+=2}else if(224==(240&e[r])){if(r+2>=t||128!=(192&e[r+1])||128!=(192&e[r+2])||224===e[r]&&128==(224&e[r+1])||237===e[r]&&160==(224&e[r+1]))return!1;r+=3}else{if(240!=(248&e[r]))return!1;if(r+3>=t||128!=(192&e[r+1])||128!=(192&e[r+2])||128!=(192&e[r+3])||240===e[r]&&128==(240&e[r+1])||244===e[r]&&e[r+1]>143||e[r]>244)return!1;r+=4}return!0}},311:(e,t,r)=>{"use strict";try{e.exports=r(9516)(__dirname)}catch(t){e.exports=r(137)}},8777:(e,t,r)=>{"use strict";const n=r(8762);n.createWebSocketStream=r(404),n.Server=r(9284),n.Receiver=r(2957),n.Sender=r(7330),e.exports=n},977:(e,t,r)=>{"use strict";const{EMPTY_BUFFER:n}=r(1872);function i(e,t){if(0===e.length)return n;if(1===e.length)return e[0];const r=Buffer.allocUnsafe(t);let i=0;for(let t=0;t<e.length;t++){const n=e[t];r.set(n,i),i+=n.length}return i<t?r.slice(0,i):r}function s(e,t,r,n,i){for(let s=0;s<i;s++)r[n+s]=e[s]^t[3&s]}function o(e,t){const r=e.length;for(let n=0;n<r;n++)e[n]^=t[3&n]}function a(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function c(e){if(c.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=Buffer.from(e):ArrayBuffer.isView(e)?t=Buffer.from(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),c.readOnly=!1),t}try{const t=r(1891),n=t.BufferUtil||t;e.exports={concat:i,mask(e,t,r,i,o){o<48?s(e,t,r,i,o):n.mask(e,t,r,i,o)},toArrayBuffer:a,toBuffer:c,unmask(e,t){e.length<32?o(e,t):n.unmask(e,t)}}}catch(t){e.exports={concat:i,mask:s,toArrayBuffer:a,toBuffer:c,unmask:o}}},1872:e=>{"use strict";e.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),EMPTY_BUFFER:Buffer.alloc(0),NOOP:()=>{}}},62:e=>{"use strict";class t{constructor(e,t){this.target=t,this.type=e}}class r extends t{constructor(e,t){super("message",t),this.data=e}}class n extends t{constructor(e,t,r){super("close",r),this.wasClean=r._closeFrameReceived&&r._closeFrameSent,this.reason=t,this.code=e}}class i extends t{constructor(e){super("open",e)}}class s extends t{constructor(e,t){super("error",t),this.message=e.message,this.error=e}}const o={addEventListener(e,t,o){if("function"!=typeof t)return;function a(e){t.call(this,new r(e,this))}function c(e,r){t.call(this,new n(e,r,this))}function u(e){t.call(this,new s(e,this))}function l(){t.call(this,new i(this))}const h=o&&o.once?"once":"on";"message"===e?(a._listener=t,this[h](e,a)):"close"===e?(c._listener=t,this[h](e,c)):"error"===e?(u._listener=t,this[h](e,u)):"open"===e?(l._listener=t,this[h](e,l)):this[h](e,t)},removeEventListener(e,t){const r=this.listeners(e);for(let n=0;n<r.length;n++)r[n]!==t&&r[n]._listener!==t||this.removeListener(e,r[n])}};e.exports=o},1503:e=>{"use strict";const t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function r(e,t,r){void 0===e[t]?e[t]=[r]:e[t].push(r)}e.exports={format:function(e){return Object.keys(e).map((t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map((e=>[t].concat(Object.keys(e).map((t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map((e=>!0===e?t:`${t}=${e}`)).join("; ")}))).join("; "))).join(", ")})).join(", ")},parse:function(e){const n=Object.create(null);if(void 0===e||""===e)return n;let i,s,o=Object.create(null),a=!1,c=!1,u=!1,l=-1,h=-1,f=0;for(;f<e.length;f++){const d=e.charCodeAt(f);if(void 0===i)if(-1===h&&1===t[d])-1===l&&(l=f);else if(32===d||9===d)-1===h&&-1!==l&&(h=f);else{if(59!==d&&44!==d)throw new SyntaxError(`Unexpected character at index ${f}`);{if(-1===l)throw new SyntaxError(`Unexpected character at index ${f}`);-1===h&&(h=f);const t=e.slice(l,h);44===d?(r(n,t,o),o=Object.create(null)):i=t,l=h=-1}}else if(void 0===s)if(-1===h&&1===t[d])-1===l&&(l=f);else if(32===d||9===d)-1===h&&-1!==l&&(h=f);else if(59===d||44===d){if(-1===l)throw new SyntaxError(`Unexpected character at index ${f}`);-1===h&&(h=f),r(o,e.slice(l,h),!0),44===d&&(r(n,i,o),o=Object.create(null),i=void 0),l=h=-1}else{if(61!==d||-1===l||-1!==h)throw new SyntaxError(`Unexpected character at index ${f}`);s=e.slice(l,f),l=h=-1}else if(c){if(1!==t[d])throw new SyntaxError(`Unexpected character at index ${f}`);-1===l?l=f:a||(a=!0),c=!1}else if(u)if(1===t[d])-1===l&&(l=f);else if(34===d&&-1!==l)u=!1,h=f;else{if(92!==d)throw new SyntaxError(`Unexpected character at index ${f}`);c=!0}else if(34===d&&61===e.charCodeAt(f-1))u=!0;else if(-1===h&&1===t[d])-1===l&&(l=f);else if(-1===l||32!==d&&9!==d){if(59!==d&&44!==d)throw new SyntaxError(`Unexpected character at index ${f}`);{if(-1===l)throw new SyntaxError(`Unexpected character at index ${f}`);-1===h&&(h=f);let t=e.slice(l,h);a&&(t=t.replace(/\\/g,""),a=!1),r(o,s,t),44===d&&(r(n,i,o),o=Object.create(null),i=void 0),s=void 0,l=h=-1}}else-1===h&&(h=f)}if(-1===l||u)throw new SyntaxError("Unexpected end of input");-1===h&&(h=f);const d=e.slice(l,h);return void 0===i?r(n,d,o):(void 0===s?r(o,d,!0):r(o,s,a?d.replace(/\\/g,""):d),r(n,i,o)),n}}},305:e=>{"use strict";const t=Symbol("kDone"),r=Symbol("kRun");e.exports=class{constructor(e){this[t]=()=>{this.pending--,this[r]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[r]()}[r](){if(this.pending!==this.concurrency&&this.jobs.length){const e=this.jobs.shift();this.pending++,e(this[t])}}}},5196:(e,t,r)=>{"use strict";const n=r(9796),i=r(977),s=r(305),{kStatusCode:o,NOOP:a}=r(1872),c=Buffer.from([0,0,255,255]),u=Symbol("permessage-deflate"),l=Symbol("total-length"),h=Symbol("callback"),f=Symbol("buffers"),d=Symbol("error");let p;function _(e){this[f].push(e),this[l]+=e.length}function v(e){this[l]+=e.length,this[u]._maxPayload<1||this[l]<=this[u]._maxPayload?this[f].push(e):(this[d]=new RangeError("Max payload size exceeded"),this[d].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[d][o]=1009,this.removeListener("data",v),this.reset())}function y(e){this[u]._inflate=null,e[o]=1007,this[h](e)}e.exports=class{constructor(e,t,r){if(this._maxPayload=0|r,this._options=e||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!p){const e=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;p=new s(e)}}static get extensionName(){return"permessage-deflate"}offer(){const e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){const e=this._deflate[h];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){const t=this._options,r=e.find((e=>!(!1===t.serverNoContextTakeover&&e.server_no_context_takeover||e.server_max_window_bits&&(!1===t.serverMaxWindowBits||"number"==typeof t.serverMaxWindowBits&&t.serverMaxWindowBits>e.server_max_window_bits)||"number"==typeof t.clientMaxWindowBits&&!e.client_max_window_bits)));if(!r)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(r.server_no_context_takeover=!0),t.clientNoContextTakeover&&(r.client_no_context_takeover=!0),"number"==typeof t.serverMaxWindowBits&&(r.server_max_window_bits=t.serverMaxWindowBits),"number"==typeof t.clientMaxWindowBits?r.client_max_window_bits=t.clientMaxWindowBits:!0!==r.client_max_window_bits&&!1!==t.clientMaxWindowBits||delete r.client_max_window_bits,r}acceptAsClient(e){const t=e[0];if(!1===this._options.clientNoContextTakeover&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(t.client_max_window_bits){if(!1===this._options.clientMaxWindowBits||"number"==typeof this._options.clientMaxWindowBits&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}else"number"==typeof this._options.clientMaxWindowBits&&(t.client_max_window_bits=this._options.clientMaxWindowBits);return t}normalizeParams(e){return e.forEach((e=>{Object.keys(e).forEach((t=>{let r=e[t];if(r.length>1)throw new Error(`Parameter "${t}" must have only a single value`);if(r=r[0],"client_max_window_bits"===t){if(!0!==r){const e=+r;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${r}`);r=e}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${t}": ${r}`)}else if("server_max_window_bits"===t){const e=+r;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${r}`);r=e}else{if("client_no_context_takeover"!==t&&"server_no_context_takeover"!==t)throw new Error(`Unknown parameter "${t}"`);if(!0!==r)throw new TypeError(`Invalid value for parameter "${t}": ${r}`)}e[t]=r}))})),e}decompress(e,t,r){p.add((n=>{this._decompress(e,t,((e,t)=>{n(),r(e,t)}))}))}compress(e,t,r){p.add((n=>{this._compress(e,t,((e,t)=>{n(),r(e,t)}))}))}_decompress(e,t,r){const s=this._isServer?"client":"server";if(!this._inflate){const e=`${s}_max_window_bits`,t="number"!=typeof this.params[e]?n.Z_DEFAULT_WINDOWBITS:this.params[e];this._inflate=n.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t}),this._inflate[u]=this,this._inflate[l]=0,this._inflate[f]=[],this._inflate.on("error",y),this._inflate.on("data",v)}this._inflate[h]=r,this._inflate.write(e),t&&this._inflate.write(c),this._inflate.flush((()=>{const e=this._inflate[d];if(e)return this._inflate.close(),this._inflate=null,void r(e);const n=i.concat(this._inflate[f],this._inflate[l]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[l]=0,this._inflate[f]=[],t&&this.params[`${s}_no_context_takeover`]&&this._inflate.reset()),r(null,n)}))}_compress(e,t,r){const s=this._isServer?"server":"client";if(!this._deflate){const e=`${s}_max_window_bits`,t="number"!=typeof this.params[e]?n.Z_DEFAULT_WINDOWBITS:this.params[e];this._deflate=n.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t}),this._deflate[l]=0,this._deflate[f]=[],this._deflate.on("error",a),this._deflate.on("data",_)}this._deflate[h]=r,this._deflate.write(e),this._deflate.flush(n.Z_SYNC_FLUSH,(()=>{if(!this._deflate)return;let e=i.concat(this._deflate[f],this._deflate[l]);t&&(e=e.slice(0,e.length-4)),this._deflate[h]=null,this._deflate[l]=0,this._deflate[f]=[],t&&this.params[`${s}_no_context_takeover`]&&this._deflate.reset(),r(null,e)}))}}},2957:(e,t,r)=>{"use strict";const{Writable:n}=r(2781),i=r(5196),{BINARY_TYPES:s,EMPTY_BUFFER:o,kStatusCode:a,kWebSocket:c}=r(1872),{concat:u,toArrayBuffer:l,unmask:h}=r(977),{isValidStatusCode:f,isValidUTF8:d}=r(6746);function p(e,t,r,n,i){const s=new e(r?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(s,p),s.code=i,s[a]=n,s}e.exports=class extends n{constructor(e,t,r,n){super(),this._binaryType=e||s[0],this[c]=void 0,this._extensions=t||{},this._isServer=!!r,this._maxPayload=0|n,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=0,this._loop=!1}_write(e,t,r){if(8===this._opcode&&0==this._state)return r();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(r)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){const t=this._buffers[0];return this._buffers[0]=t.slice(e),t.slice(0,e)}const t=Buffer.allocUnsafe(e);do{const r=this._buffers[0],n=t.length-e;e>=r.length?t.set(this._buffers.shift(),n):(t.set(new Uint8Array(r.buffer,r.byteOffset,e),n),this._buffers[0]=r.slice(e)),e-=r.length}while(e>0);return t}startLoop(e){let t;this._loop=!0;do{switch(this._state){case 0:t=this.getInfo();break;case 1:t=this.getPayloadLength16();break;case 2:t=this.getPayloadLength64();break;case 3:this.getMask();break;case 4:t=this.getData(e);break;default:return void(this._loop=!1)}}while(this._loop);e(t)}getInfo(){if(this._bufferedBytes<2)return void(this._loop=!1);const e=this.consume(2);if(0!=(48&e[0]))return this._loop=!1,p(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");const t=64==(64&e[0]);if(t&&!this._extensions[i.extensionName])return this._loop=!1,p(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=128==(128&e[0]),this._opcode=15&e[0],this._payloadLength=127&e[1],0===this._opcode){if(t)return this._loop=!1,p(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,p(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented)return this._loop=!1,p(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=t}else{if(!(this._opcode>7&&this._opcode<11))return this._loop=!1,p(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin)return this._loop=!1,p(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(t)return this._loop=!1,p(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125)return this._loop=!1,p(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}if(this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=128==(128&e[1]),this._isServer){if(!this._masked)return this._loop=!1,p(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,p(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(126===this._payloadLength)this._state=1;else{if(127!==this._payloadLength)return this.haveLength();this._state=2}}getPayloadLength16(){if(!(this._bufferedBytes<2))return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength();this._loop=!1}getPayloadLength64(){if(this._bufferedBytes<8)return void(this._loop=!1);const e=this.consume(8),t=e.readUInt32BE(0);return t>Math.pow(2,21)-1?(this._loop=!1,p(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=t*Math.pow(2,32)+e.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,p(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=3:this._state=4}getMask(){this._bufferedBytes<4?this._loop=!1:(this._mask=this.consume(4),this._state=4)}getData(e){let t=o;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength)return void(this._loop=!1);t=this.consume(this._payloadLength),this._masked&&h(t,this._mask)}return this._opcode>7?this.controlMessage(t):this._compressed?(this._state=5,void this.decompress(t,e)):(t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage())}decompress(e,t){this._extensions[i.extensionName].decompress(e,this._fin,((e,r)=>{if(e)return t(e);if(r.length){if(this._messageLength+=r.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return t(p(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));this._fragments.push(r)}const n=this.dataMessage();if(n)return t(n);this.startLoop(t)}))}dataMessage(){if(this._fin){const e=this._messageLength,t=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){let r;r="nodebuffer"===this._binaryType?u(t,e):"arraybuffer"===this._binaryType?l(u(t,e)):t,this.emit("message",r)}else{const r=u(t,e);if(!d(r))return this._loop=!1,p(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",r.toString())}}this._state=0}controlMessage(e){if(8===this._opcode)if(this._loop=!1,0===e.length)this.emit("conclude",1005,""),this.end();else{if(1===e.length)return p(RangeError,"invalid payload length 1",!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");{const t=e.readUInt16BE(0);if(!f(t))return p(RangeError,`invalid status code ${t}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");const r=e.slice(2);if(!d(r))return p(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",t,r.toString()),this.end()}}else 9===this._opcode?this.emit("ping",e):this.emit("pong",e);this._state=0}}},7330:(e,t,r)=>{"use strict";r(1808),r(4404);const{randomFillSync:n}=r(6113),i=r(5196),{EMPTY_BUFFER:s}=r(1872),{isValidStatusCode:o}=r(6746),{mask:a,toBuffer:c}=r(977),u=Buffer.alloc(4);class l{constructor(e,t){this._extensions=t||{},this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){const r=t.mask&&t.readOnly;let i=t.mask?6:2,s=e.length;e.length>=65536?(i+=8,s=127):e.length>125&&(i+=2,s=126);const o=Buffer.allocUnsafe(r?e.length+i:i);return o[0]=t.fin?128|t.opcode:t.opcode,t.rsv1&&(o[0]|=64),o[1]=s,126===s?o.writeUInt16BE(e.length,2):127===s&&(o.writeUInt32BE(0,2),o.writeUInt32BE(e.length,6)),t.mask?(n(u,0,4),o[1]|=128,o[i-4]=u[0],o[i-3]=u[1],o[i-2]=u[2],o[i-1]=u[3],r?(a(e,u,o,i,e.length),[o]):(a(e,u,e,0,e.length),[o,e])):[o,e]}close(e,t,r,n){let i;if(void 0===e)i=s;else{if("number"!=typeof e||!o(e))throw new TypeError("First argument must be a valid error code number");if(void 0===t||""===t)i=Buffer.allocUnsafe(2),i.writeUInt16BE(e,0);else{const r=Buffer.byteLength(t);if(r>123)throw new RangeError("The message must not be greater than 123 bytes");i=Buffer.allocUnsafe(2+r),i.writeUInt16BE(e,0),i.write(t,2)}}this._deflating?this.enqueue([this.doClose,i,r,n]):this.doClose(i,r,n)}doClose(e,t,r){this.sendFrame(l.frame(e,{fin:!0,rsv1:!1,opcode:8,mask:t,readOnly:!1}),r)}ping(e,t,r){const n=c(e);if(n.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPing,n,t,c.readOnly,r]):this.doPing(n,t,c.readOnly,r)}doPing(e,t,r,n){this.sendFrame(l.frame(e,{fin:!0,rsv1:!1,opcode:9,mask:t,readOnly:r}),n)}pong(e,t,r){const n=c(e);if(n.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPong,n,t,c.readOnly,r]):this.doPong(n,t,c.readOnly,r)}doPong(e,t,r,n){this.sendFrame(l.frame(e,{fin:!0,rsv1:!1,opcode:10,mask:t,readOnly:r}),n)}send(e,t,r){const n=c(e),s=this._extensions[i.extensionName];let o=t.binary?2:1,a=t.compress;if(this._firstFragment?(this._firstFragment=!1,a&&s&&(a=n.length>=s._threshold),this._compress=a):(a=!1,o=0),t.fin&&(this._firstFragment=!0),s){const e={fin:t.fin,rsv1:a,opcode:o,mask:t.mask,readOnly:c.readOnly};this._deflating?this.enqueue([this.dispatch,n,this._compress,e,r]):this.dispatch(n,this._compress,e,r)}else this.sendFrame(l.frame(n,{fin:t.fin,rsv1:!1,opcode:o,mask:t.mask,readOnly:c.readOnly}),r)}dispatch(e,t,r,n){if(!t)return void this.sendFrame(l.frame(e,r),n);const s=this._extensions[i.extensionName];this._bufferedBytes+=e.length,this._deflating=!0,s.compress(e,r.fin,((t,i)=>{if(this._socket.destroyed){const e=new Error("The socket was closed while data was being compressed");"function"==typeof n&&n(e);for(let t=0;t<this._queue.length;t++){const r=this._queue[t][4];"function"==typeof r&&r(e)}}else this._bufferedBytes-=e.length,this._deflating=!1,r.readOnly=!1,this.sendFrame(l.frame(i,r),n),this.dequeue()}))}dequeue(){for(;!this._deflating&&this._queue.length;){const e=this._queue.shift();this._bufferedBytes-=e[1].length,Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[1].length,this._queue.push(e)}sendFrame(e,t){2===e.length?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}}e.exports=l},404:(e,t,r)=>{"use strict";const{Duplex:n}=r(2781);function i(e){e.emit("close")}function s(){!this.destroyed&&this._writableState.finished&&this.destroy()}function o(e){this.removeListener("error",o),this.destroy(),0===this.listenerCount("error")&&this.emit("error",e)}e.exports=function(e,t){let r=!0,a=!0;function c(){r&&e._socket.resume()}e.readyState===e.CONNECTING?e.once("open",(function(){e._receiver.removeAllListeners("drain"),e._receiver.on("drain",c)})):(e._receiver.removeAllListeners("drain"),e._receiver.on("drain",c));const u=new n({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",(function(t){u.push(t)||(r=!1,e._socket.pause())})),e.once("error",(function(e){u.destroyed||(a=!1,u.destroy(e))})),e.once("close",(function(){u.destroyed||u.push(null)})),u._destroy=function(t,r){if(e.readyState===e.CLOSED)return r(t),void process.nextTick(i,u);let n=!1;e.once("error",(function(e){n=!0,r(e)})),e.once("close",(function(){n||r(t),process.nextTick(i,u)})),a&&e.terminate()},u._final=function(t){e.readyState!==e.CONNECTING?null!==e._socket&&(e._socket._writableState.finished?(t(),u._readableState.endEmitted&&u.destroy()):(e._socket.once("finish",(function(){t()})),e.close())):e.once("open",(function(){u._final(t)}))},u._read=function(){e.readyState!==e.OPEN&&e.readyState!==e.CLOSING||r||(r=!0,e._receiver._writableState.needDrain||e._socket.resume())},u._write=function(t,r,n){e.readyState!==e.CONNECTING?e.send(t,n):e.once("open",(function(){u._write(t,r,n)}))},u.on("end",s),u.on("error",o),u}},6746:(e,t,r)=>{"use strict";function n(e){return e>=1e3&&e<=1014&&1004!==e&&1005!==e&&1006!==e||e>=3e3&&e<=4999}function i(e){const t=e.length;let r=0;for(;r<t;)if(0==(128&e[r]))r++;else if(192==(224&e[r])){if(r+1===t||128!=(192&e[r+1])||192==(254&e[r]))return!1;r+=2}else if(224==(240&e[r])){if(r+2>=t||128!=(192&e[r+1])||128!=(192&e[r+2])||224===e[r]&&128==(224&e[r+1])||237===e[r]&&160==(224&e[r+1]))return!1;r+=3}else{if(240!=(248&e[r]))return!1;if(r+3>=t||128!=(192&e[r+1])||128!=(192&e[r+2])||128!=(192&e[r+3])||240===e[r]&&128==(240&e[r+1])||244===e[r]&&e[r+1]>143||e[r]>244)return!1;r+=4}return!0}try{let t=r(311);"object"==typeof t&&(t=t.Validation.isValidUTF8),e.exports={isValidStatusCode:n,isValidUTF8:e=>e.length<150?i(e):t(e)}}catch(t){e.exports={isValidStatusCode:n,isValidUTF8:i}}},9284:(e,t,r)=>{"use strict";const n=r(2361),i=r(3685),{createHash:s}=(r(5687),r(1808),r(4404),r(6113)),o=r(5196),a=r(8762),{format:c,parse:u}=r(1503),{GUID:l,kWebSocket:h}=r(1872),f=/^[+/0-9A-Za-z]{22}==$/;function d(e){e._state=2,e.emit("close")}function p(){this.destroy()}function _(e,t,r,n){e.writable&&(r=r||i.STATUS_CODES[t],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...n},e.write(`HTTP/1.1 ${t} ${i.STATUS_CODES[t]}\r\n`+Object.keys(n).map((e=>`${e}: ${n[e]}`)).join("\r\n")+"\r\n\r\n"+r)),e.removeListener("error",p),e.destroy()}function v(e){return e.trim()}e.exports=class extends n{constructor(e,t){if(super(),null==(e={maxPayload:104857600,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,...e}).port&&!e.server&&!e.noServer||null!=e.port&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(null!=e.port?(this._server=i.createServer(((e,t)=>{const r=i.STATUS_CODES[426];t.writeHead(426,{"Content-Length":r.length,"Content-Type":"text/plain"}),t.end(r)})),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){const e=this.emit.bind(this,"connection");this._removeListeners=function(e,t){for(const r of Object.keys(t))e.on(r,t[r]);return function(){for(const r of Object.keys(t))e.removeListener(r,t[r])}}(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(t,r,n)=>{this.handleUpgrade(t,r,n,e)}})}!0===e.perMessageDeflate&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set),this.options=e,this._state=0}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(e&&this.once("close",e),2===this._state)return void process.nextTick(d,this);if(1===this._state)return;if(this._state=1,this.clients)for(const e of this.clients)e.terminate();const t=this._server;t&&(this._removeListeners(),this._removeListeners=this._server=null,null!=this.options.port)?t.close(d.bind(void 0,this)):process.nextTick(d,this)}shouldHandle(e){if(this.options.path){const t=e.url.indexOf("?");if((-1!==t?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,r,n){t.on("error",p);const i=void 0!==e.headers["sec-websocket-key"]&&e.headers["sec-websocket-key"].trim(),s=+e.headers["sec-websocket-version"],a={};if("GET"!==e.method||"websocket"!==e.headers.upgrade.toLowerCase()||!i||!f.test(i)||8!==s&&13!==s||!this.shouldHandle(e))return _(t,400);if(this.options.perMessageDeflate){const r=new o(this.options.perMessageDeflate,!0,this.options.maxPayload);try{const t=u(e.headers["sec-websocket-extensions"]);t[o.extensionName]&&(r.accept(t[o.extensionName]),a[o.extensionName]=r)}catch(e){return _(t,400)}}if(this.options.verifyClient){const o={origin:e.headers[8===s?"sec-websocket-origin":"origin"],secure:!(!e.socket.authorized&&!e.socket.encrypted),req:e};if(2===this.options.verifyClient.length)return void this.options.verifyClient(o,((s,o,c,u)=>{if(!s)return _(t,o||401,c,u);this.completeUpgrade(i,a,e,t,r,n)}));if(!this.options.verifyClient(o))return _(t,401)}this.completeUpgrade(i,a,e,t,r,n)}completeUpgrade(e,t,r,n,i,u){if(!n.readable||!n.writable)return n.destroy();if(n[h])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return _(n,503);const f=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${s("sha1").update(e+l).digest("base64")}`],d=new a(null);let y=r.headers["sec-websocket-protocol"];if(y&&(y=y.split(",").map(v),y=this.options.handleProtocols?this.options.handleProtocols(y,r):y[0],y&&(f.push(`Sec-WebSocket-Protocol: ${y}`),d._protocol=y)),t[o.extensionName]){const e=t[o.extensionName].params,r=c({[o.extensionName]:[e]});f.push(`Sec-WebSocket-Extensions: ${r}`),d._extensions=t}this.emit("headers",f,r),n.write(f.concat("\r\n").join("\r\n")),n.removeListener("error",p),d.setSocket(n,i,this.options.maxPayload),this.clients&&(this.clients.add(d),d.on("close",(()=>this.clients.delete(d)))),u(d,r)}}},8762:(e,t,r)=>{"use strict";const n=r(2361),i=r(5687),s=r(3685),o=r(1808),a=r(4404),{randomBytes:c,createHash:u}=r(6113),{Readable:l}=r(2781),{URL:h}=r(7310),f=r(5196),d=r(2957),p=r(7330),{BINARY_TYPES:_,EMPTY_BUFFER:v,GUID:y,kStatusCode:b,kWebSocket:m,NOOP:g}=r(1872),{addEventListener:S,removeEventListener:w}=r(62),{format:O,parse:x}=r(1503),{toBuffer:E}=r(977),k=["CONNECTING","OPEN","CLOSING","CLOSED"],P=[8,13];class T extends n{constructor(e,t,r){super(),this._binaryType=_[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage="",this._closeTimer=null,this._extensions={},this._protocol="",this._readyState=T.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,null!==e?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,Array.isArray(t)?t=t.join(", "):"object"==typeof t&&null!==t&&(r=t,t=void 0),M(this,e,t,r)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(e){_.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get onclose(){}set onclose(e){}get onerror(){}set onerror(e){}get onopen(){}set onopen(e){}get onmessage(){}set onmessage(e){}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,r){const n=new d(this.binaryType,this._extensions,this._isServer,r);this._sender=new p(e,this._extensions),this._receiver=n,this._socket=e,n[m]=this,e[m]=this,n.on("conclude",D),n.on("drain",U),n.on("error",q),n.on("message",I),n.on("ping",B),n.on("pong",A),e.setTimeout(0),e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",G),e.on("data",F),e.on("end",H),e.on("error",V),this._readyState=T.OPEN,this.emit("open")}emitClose(){if(!this._socket)return this._readyState=T.CLOSED,void this.emit("close",this._closeCode,this._closeMessage);this._extensions[f.extensionName]&&this._extensions[f.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=T.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==T.CLOSED){if(this.readyState===T.CONNECTING){const e="WebSocket was closed before the connection was established";return N(this,this._req,e)}this.readyState!==T.CLOSING?(this._readyState=T.CLOSING,this._sender.close(e,t,!this._isServer,(e=>{e||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())})),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),3e4)):this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end()}}ping(e,t,r){if(this.readyState===T.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(r=e,e=t=void 0):"function"==typeof t&&(r=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===T.OPEN?(void 0===t&&(t=!this._isServer),this._sender.ping(e||v,t,r)):$(this,e,r)}pong(e,t,r){if(this.readyState===T.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(r=e,e=t=void 0):"function"==typeof t&&(r=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===T.OPEN?(void 0===t&&(t=!this._isServer),this._sender.pong(e||v,t,r)):$(this,e,r)}send(e,t,r){if(this.readyState===T.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof t&&(r=t,t={}),"number"==typeof e&&(e=e.toString()),this.readyState!==T.OPEN)return void $(this,e,r);const n={binary:"string"!=typeof e,mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[f.extensionName]||(n.compress=!1),this._sender.send(e||v,n,r)}terminate(){if(this.readyState!==T.CLOSED){if(this.readyState===T.CONNECTING){const e="WebSocket was closed before the connection was established";return N(this,this._req,e)}this._socket&&(this._readyState=T.CLOSING,this._socket.destroy())}}}function M(e,t,r,n){const o={protocolVersion:P[1],maxPayload:104857600,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,host:void 0,path:void 0,port:void 0};if(!P.includes(o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${P.join(", ")})`);let a;t instanceof h?(a=t,e._url=t.href):(a=new h(t),e._url=t);const l="ws+unix:"===a.protocol;if(!(a.host||l&&a.pathname)){const t=new Error(`Invalid URL: ${e.url}`);if(0===e._redirects)throw t;return void L(e,t)}const d="wss:"===a.protocol||"https:"===a.protocol,p=d?443:80,_=c(16).toString("base64"),v=d?i.get:s.get;let b;if(o.createConnection=d?C:j,o.defaultPort=o.defaultPort||p,o.port=a.port||p,o.host=a.hostname.startsWith("[")?a.hostname.slice(1,-1):a.hostname,o.headers={"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":_,Connection:"Upgrade",Upgrade:"websocket",...o.headers},o.path=a.pathname+a.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&(b=new f(!0!==o.perMessageDeflate?o.perMessageDeflate:{},!1,o.maxPayload),o.headers["Sec-WebSocket-Extensions"]=O({[f.extensionName]:b.offer()})),r&&(o.headers["Sec-WebSocket-Protocol"]=r),o.origin&&(o.protocolVersion<13?o.headers["Sec-WebSocket-Origin"]=o.origin:o.headers.Origin=o.origin),(a.username||a.password)&&(o.auth=`${a.username}:${a.password}`),l){const e=o.path.split(":");o.socketPath=e[0],o.path=e[1]}if(o.followRedirects){if(0===e._redirects){e._originalUnixSocket=l,e._originalSecure=d,e._originalHostOrSocketPath=l?o.socketPath:a.host;const t=n&&n.headers;if(n={...n,headers:{}},t)for(const[e,r]of Object.entries(t))n.headers[e.toLowerCase()]=r}else{const t=l?!!e._originalUnixSocket&&o.socketPath===e._originalHostOrSocketPath:!e._originalUnixSocket&&a.host===e._originalHostOrSocketPath;(!t||e._originalSecure&&!d)&&(delete o.headers.authorization,delete o.headers.cookie,t||delete o.headers.host,o.auth=void 0)}o.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64"))}let m=e._req=v(o);o.timeout&&m.on("timeout",(()=>{N(e,m,"Opening handshake has timed out")})),m.on("error",(t=>{null===m||m.aborted||(m=e._req=null,L(e,t))})),m.on("response",(i=>{const s=i.headers.location,a=i.statusCode;if(s&&o.followRedirects&&a>=300&&a<400){if(++e._redirects>o.maxRedirects)return void N(e,m,"Maximum redirects exceeded");let i;m.abort();try{i=new h(s,t)}catch(t){return void L(e,t)}M(e,i,r,n)}else e.emit("unexpected-response",m,i)||N(e,m,`Unexpected server response: ${i.statusCode}`)})),m.on("upgrade",((t,n,i)=>{if(e.emit("upgrade",t),e.readyState!==T.CONNECTING)return;if(m=e._req=null,"websocket"!==t.headers.upgrade.toLowerCase())return void N(e,n,"Invalid Upgrade header");const s=u("sha1").update(_+y).digest("base64");if(t.headers["sec-websocket-accept"]!==s)return void N(e,n,"Invalid Sec-WebSocket-Accept header");const a=t.headers["sec-websocket-protocol"],c=(r||"").split(/, */);let l;if(!r&&a?l="Server sent a subprotocol but none was requested":r&&!a?l="Server sent no subprotocol":a&&!c.includes(a)&&(l="Server sent an invalid subprotocol"),l)return void N(e,n,l);a&&(e._protocol=a);const h=t.headers["sec-websocket-extensions"];if(void 0!==h){if(!b)return void N(e,n,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");let t;try{t=x(h)}catch(t){return void N(e,n,"Invalid Sec-WebSocket-Extensions header")}const r=Object.keys(t);if(r.length){if(1!==r.length||r[0]!==f.extensionName)return void N(e,n,"Server indicated an extension that was not requested");try{b.accept(t[f.extensionName])}catch(t){return void N(e,n,"Invalid Sec-WebSocket-Extensions header")}e._extensions[f.extensionName]=b}}e.setSocket(n,i,o.maxPayload)}))}function L(e,t){e._readyState=T.CLOSING,e.emit("error",t),e.emitClose()}function j(e){return e.path=e.socketPath,o.connect(e)}function C(e){return e.path=void 0,e.servername||""===e.servername||(e.servername=o.isIP(e.host)?"":e.host),a.connect(e)}function N(e,t,r){e._readyState=T.CLOSING;const n=new Error(r);Error.captureStackTrace(n,N),t.setHeader?(t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),t.once("abort",e.emitClose.bind(e)),e.emit("error",n)):(t.destroy(n),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function $(e,t,r){if(t){const r=E(t).length;e._socket?e._sender._bufferedBytes+=r:e._bufferedAmount+=r}r&&r(new Error(`WebSocket is not open: readyState ${e.readyState} (${k[e.readyState]})`))}function D(e,t){const r=this[m];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,void 0!==r._socket[m]&&(r._socket.removeListener("data",F),process.nextTick(W,r._socket),1005===e?r.close():r.close(e,t))}function U(){this[m]._socket.resume()}function q(e){const t=this[m];void 0!==t._socket[m]&&(t._socket.removeListener("data",F),process.nextTick(W,t._socket),t.close(e[b])),t.emit("error",e)}function R(){this[m].emitClose()}function I(e){this[m].emit("message",e)}function B(e){const t=this[m];t.pong(e,!t._isServer,g),t.emit("ping",e)}function A(e){this[m].emit("pong",e)}function W(e){e.resume()}function G(){const e=this[m];let t;this.removeListener("close",G),this.removeListener("data",F),this.removeListener("end",H),e._readyState=T.CLOSING,this._readableState.endEmitted||e._closeFrameReceived||e._receiver._writableState.errorEmitted||null===(t=e._socket.read())||e._receiver.write(t),e._receiver.end(),this[m]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",R),e._receiver.on("finish",R))}function F(e){this[m]._receiver.write(e)||this.pause()}function H(){const e=this[m];e._readyState=T.CLOSING,e._receiver.end(),this.end()}function V(){const e=this[m];this.removeListener("error",V),this.on("error",g),e&&(e._readyState=T.CLOSING,this.destroy())}Object.defineProperty(T,"CONNECTING",{enumerable:!0,value:k.indexOf("CONNECTING")}),Object.defineProperty(T.prototype,"CONNECTING",{enumerable:!0,value:k.indexOf("CONNECTING")}),Object.defineProperty(T,"OPEN",{enumerable:!0,value:k.indexOf("OPEN")}),Object.defineProperty(T.prototype,"OPEN",{enumerable:!0,value:k.indexOf("OPEN")}),Object.defineProperty(T,"CLOSING",{enumerable:!0,value:k.indexOf("CLOSING")}),Object.defineProperty(T.prototype,"CLOSING",{enumerable:!0,value:k.indexOf("CLOSING")}),Object.defineProperty(T,"CLOSED",{enumerable:!0,value:k.indexOf("CLOSED")}),Object.defineProperty(T.prototype,"CLOSED",{enumerable:!0,value:k.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","protocol","readyState","url"].forEach((e=>{Object.defineProperty(T.prototype,e,{enumerable:!0})})),["open","error","close","message"].forEach((e=>{Object.defineProperty(T.prototype,`on${e}`,{enumerable:!0,get(){const t=this.listeners(e);for(let e=0;e<t.length;e++)if(t[e]._listener)return t[e]._listener},set(t){const r=this.listeners(e);for(let t=0;t<r.length;t++)r[t]._listener&&this.removeListener(e,r[t]);this.addEventListener(e,t)}})})),T.prototype.addEventListener=S,T.prototype.removeEventListener=w,e.exports=T},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},3477:e=>{"use strict";e.exports=require("querystring")},2781:e=>{"use strict";e.exports=require("stream")},4404:e=>{"use strict";e.exports=require("tls")},7310:e=>{"use strict";e.exports=require("url")},9796:e=>{"use strict";e.exports=require("zlib")}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}var n={};return(()=>{"use strict";var e=n;Object.defineProperty(e,"__esModule",{value:!0}),e.Deepgram=void 0;var t=r(6092),i=r(9292),s=r(319),o=r(487),a=r(5321),c=r(8949),u=r(6359),l=r(5343),h=r(3647),f=r(5483),d=r(1098);e.Deepgram=function(e,r,n){this._apiKey=e,this._apiUrl=null!=r?r:t.DefaultOptions.apiUrl,this._requireSSL=null!=n?n:t.DefaultOptions.requireSSL,(0,f.validateOptions)(this._apiKey,this._apiUrl),this.keys=new i.Keys(this._apiKey,this._apiUrl,this._requireSSL,d._request),this.projects=new s.Projects(this._apiKey,this._apiUrl,this._requireSSL,d._request),this.transcription=new o.Transcriber(this._apiKey,this._apiUrl,this._requireSSL),this.usage=new a.Usage(this._apiKey,this._apiUrl,this._requireSSL,d._request),this.members=new c.Members(this._apiKey,this._apiUrl,this._requireSSL,d._request),this.invitation=new u.Invitation(this._apiKey,this._apiUrl,this._requireSSL,d._request),this.billing=new l.Billing(this._apiKey,this._apiUrl,this._requireSSL,d._request),this.scopes=new h.Scopes(this._apiKey,this._apiUrl,this._requireSSL,d._request)}})(),n})()));
|
|
@@ -7,6 +7,7 @@ export declare class LiveTranscription extends EventEmitter {
|
|
|
7
7
|
constructor(credentials: string, apiUrl: string, requireSSL: boolean, options?: LiveTranscriptionOptions, endpoint?: string);
|
|
8
8
|
private _bindSocketEvents;
|
|
9
9
|
configure(config: ToggleConfigOptions): void;
|
|
10
|
+
keepAlive(): void;
|
|
10
11
|
/**
|
|
11
12
|
* Returns the ready state of the websocket connection
|
|
12
13
|
*/
|
|
@@ -24,12 +24,6 @@ export type LiveTranscriptionOptions = {
|
|
|
24
24
|
* @see https://developers.deepgram.com/documentation/features/tier/
|
|
25
25
|
*/
|
|
26
26
|
tier?: string;
|
|
27
|
-
/**
|
|
28
|
-
* Terms or phrases to search for in the submitted audio and replace
|
|
29
|
-
* @remarks Can send multiple instances in query string replace=this:that&replace=thisalso:thatalso. Replacing a term or phrase with nothing will remove the term or phrase from the audio transcript.
|
|
30
|
-
* @see https://developers.deepgram.com/documentation/features/replace/
|
|
31
|
-
*/
|
|
32
|
-
replace?: string;
|
|
33
27
|
/**
|
|
34
28
|
* BCP-47 language tag that hints at the primary spoken language.
|
|
35
29
|
* @default en-US
|
|
@@ -103,13 +97,6 @@ export type LiveTranscriptionOptions = {
|
|
|
103
97
|
* adds spaces between numbers in the transcript
|
|
104
98
|
*/
|
|
105
99
|
numbers_spaces?: boolean;
|
|
106
|
-
/**
|
|
107
|
-
* Terms or phrases to search for in the submitted audio. Deepgram searches
|
|
108
|
-
* for acoustic patterns in audio rather than text patterns in transcripts
|
|
109
|
-
* because we have noticed that acoustic pattern matching is more performant.
|
|
110
|
-
* @see https://developers.deepgram.com/documentation/features/search/
|
|
111
|
-
*/
|
|
112
|
-
search?: Array<string>;
|
|
113
100
|
/**
|
|
114
101
|
* Callback URL to provide if you would like your submitted audio to be
|
|
115
102
|
* processed asynchronously. When passed, Deepgram will immediately respond
|
|
@@ -120,6 +107,19 @@ export type LiveTranscriptionOptions = {
|
|
|
120
107
|
* @see https://developers.deepgram.com/documentation/features/callback/
|
|
121
108
|
*/
|
|
122
109
|
callback?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Terms or phrases to search for in the submitted audio and replace
|
|
112
|
+
* @remarks Can send multiple instances in query string replace=this:that&replace=thisalso:thatalso. Replacing a term or phrase with nothing will remove the term or phrase from the audio transcript.
|
|
113
|
+
* @see https://developers.deepgram.com/documentation/features/replace/
|
|
114
|
+
*/
|
|
115
|
+
replace?: string[] | string;
|
|
116
|
+
/**
|
|
117
|
+
* Terms or phrases to search for in the submitted audio. Deepgram searches
|
|
118
|
+
* for acoustic patterns in audio rather than text patterns in transcripts
|
|
119
|
+
* because we have noticed that acoustic pattern matching is more performant.
|
|
120
|
+
* @see https://developers.deepgram.com/documentation/features/search/
|
|
121
|
+
*/
|
|
122
|
+
search?: string[] | string;
|
|
123
123
|
/**
|
|
124
124
|
* Keywords to which the model should pay particular attention to boosting
|
|
125
125
|
* or suppressing to help it understand context. Just like a human listener,
|
|
@@ -127,7 +127,7 @@ export type LiveTranscriptionOptions = {
|
|
|
127
127
|
* hard-to-decipher speech when it knows the context of the conversation.
|
|
128
128
|
* @see https://developers.deepgram.com/documentation/features/keywords/
|
|
129
129
|
*/
|
|
130
|
-
keywords?:
|
|
130
|
+
keywords?: string[] | string;
|
|
131
131
|
/**
|
|
132
132
|
* Support for out-of-vocabulary (OOV) keyword boosting when processing streaming audio is
|
|
133
133
|
* currently in beta; to fall back to previous keyword behavior append the query parameter
|
package/dist/types/metadata.d.ts
CHANGED
|
@@ -24,12 +24,6 @@ export type PrerecordedTranscriptionOptions = {
|
|
|
24
24
|
* @see https://developers.deepgram.com/documentation/features/tier/
|
|
25
25
|
*/
|
|
26
26
|
tier?: string;
|
|
27
|
-
/**
|
|
28
|
-
* Terms or phrases to search for in the submitted audio and replace
|
|
29
|
-
* @remarks Can send multiple instances in query string replace=this:that&replace=thisalso:thatalso. Replacing a term or phrase with nothing will remove the term or phrase from the audio transcript.
|
|
30
|
-
* @see https://developers.deepgram.com/documentation/features/replace/
|
|
31
|
-
*/
|
|
32
|
-
replace?: string;
|
|
33
27
|
/**
|
|
34
28
|
* BCP-47 language tag that hints at the primary spoken language.
|
|
35
29
|
* @default en-US
|
|
@@ -103,13 +97,6 @@ export type PrerecordedTranscriptionOptions = {
|
|
|
103
97
|
* adds spaces between numbers in the transcript
|
|
104
98
|
*/
|
|
105
99
|
numbers_spaces?: boolean;
|
|
106
|
-
/**
|
|
107
|
-
* Terms or phrases to search for in the submitted audio. Deepgram searches
|
|
108
|
-
* for acoustic patterns in audio rather than text patterns in transcripts
|
|
109
|
-
* because we have noticed that acoustic pattern matching is more performant.
|
|
110
|
-
* @see https://developers.deepgram.com/documentation/features/search/
|
|
111
|
-
*/
|
|
112
|
-
search?: Array<string>;
|
|
113
100
|
/**
|
|
114
101
|
* Callback URL to provide if you would like your submitted audio to be
|
|
115
102
|
* processed asynchronously. When passed, Deepgram will immediately respond
|
|
@@ -120,6 +107,19 @@ export type PrerecordedTranscriptionOptions = {
|
|
|
120
107
|
* @see https://developers.deepgram.com/documentation/features/callback/
|
|
121
108
|
*/
|
|
122
109
|
callback?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Terms or phrases to search for in the submitted audio and replace
|
|
112
|
+
* @remarks Can send multiple instances in query string replace=this:that&replace=thisalso:thatalso. Replacing a term or phrase with nothing will remove the term or phrase from the audio transcript.
|
|
113
|
+
* @see https://developers.deepgram.com/documentation/features/replace/
|
|
114
|
+
*/
|
|
115
|
+
replace?: string[] | string;
|
|
116
|
+
/**
|
|
117
|
+
* Terms or phrases to search for in the submitted audio. Deepgram searches
|
|
118
|
+
* for acoustic patterns in audio rather than text patterns in transcripts
|
|
119
|
+
* because we have noticed that acoustic pattern matching is more performant.
|
|
120
|
+
* @see https://developers.deepgram.com/documentation/features/search/
|
|
121
|
+
*/
|
|
122
|
+
search?: string[] | string;
|
|
123
123
|
/**
|
|
124
124
|
* Keywords to which the model should pay particular attention to boosting
|
|
125
125
|
* or suppressing to help it understand context. Just like a human listener,
|
|
@@ -127,7 +127,7 @@ export type PrerecordedTranscriptionOptions = {
|
|
|
127
127
|
* hard-to-decipher speech when it knows the context of the conversation.
|
|
128
128
|
* @see https://developers.deepgram.com/documentation/features/keywords/
|
|
129
129
|
*/
|
|
130
|
-
keywords?:
|
|
130
|
+
keywords?: string[] | string;
|
|
131
131
|
/**
|
|
132
132
|
* Support for out-of-vocabulary (OOV) keyword boosting when processing streaming audio is
|
|
133
133
|
* currently in beta; to fall back to previous keyword behavior append the query parameter
|