@taskmagic/apps-murf-api 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ # apps-murf-api
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build apps-murf-api` to build the library.
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@taskmagic/apps-murf-api",
3
+ "version": "0.0.1",
4
+ "dependencies": {
5
+ "@anthropic-ai/sdk": "0.33.1",
6
+ "@sinclair/typebox": "0.34.11",
7
+ "axios": "1.17.0",
8
+ "axios-retry": "4.4.1",
9
+ "deepmerge-ts": "7.1.0",
10
+ "form-data": "4.0.5",
11
+ "mime-types": "2.1.35",
12
+ "nanoid": "3.3.8",
13
+ "openai": "4.67.1",
14
+ "replicate": "0.34.1",
15
+ "semver": "7.6.0",
16
+ "zod": "3.25.76",
17
+ "@taskmagic/pieces-common": "0.4.4",
18
+ "@taskmagic/pieces-framework": "0.7.46",
19
+ "@taskmagic/shared": "0.10.171",
20
+ "tslib": "1.14.1"
21
+ },
22
+ "overrides": {
23
+ "cross-spawn": "7.0.6",
24
+ "elliptic": "^6.6.1",
25
+ "fast-xml-parser": "^4.4.1",
26
+ "protobufjs": "^7.5.5",
27
+ "tmp": "^0.2.4",
28
+ "koa": "^2.16.4",
29
+ "picomatch": "^4.0.4",
30
+ "langsmith": "^0.6.0",
31
+ "serialize-javascript": "^6.0.2",
32
+ "elevenlabs": {
33
+ "form-data": "^4.0.4"
34
+ },
35
+ "@tryfabric/martian": {
36
+ "@notionhq/client": "$@notionhq/client"
37
+ },
38
+ "vite": {
39
+ "rollup": "npm:@rollup/wasm-node@^4.61.1"
40
+ }
41
+ },
42
+ "resolutions": {
43
+ "rollup": "npm:@rollup/wasm-node@^4.61.1"
44
+ },
45
+ "types": "./src/index.d.ts",
46
+ "main": "./src/index.js",
47
+ "type": "commonjs"
48
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const murfApi: import("@taskmagic/pieces-framework").Piece<import("@taskmagic/pieces-framework").SecretTextProperty<true>>;
package/src/index.js ADDED
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.murfApi = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const shared_1 = require("@taskmagic/shared");
8
+ const auth_1 = require("./lib/common/auth");
9
+ const client_1 = require("./lib/common/client");
10
+ const list_voices_1 = require("./lib/actions/list-voices");
11
+ const translate_text_1 = require("./lib/actions/translate-text");
12
+ const voice_change_1 = require("./lib/actions/voice-change");
13
+ const text_to_speech_1 = require("./lib/actions/text-to-speech");
14
+ exports.murfApi = (0, pieces_framework_1.createPiece)({
15
+ displayName: 'Murf AI',
16
+ description: 'Generate AI voiceovers and narration with Murf: convert text to speech, change the voice of existing audio, translate text, and browse available voices.',
17
+ auth: auth_1.murfAuth,
18
+ minimumSupportedRelease: '0.30.0',
19
+ logoUrl: 'https://cdn.activepieces.com/pieces/murf-api.png',
20
+ authors: ['Niket2035'],
21
+ categories: [shared_1.PieceCategory.ARTIFICIAL_INTELLIGENCE],
22
+ ai: {
23
+ description: 'Generate AI speech and voiceovers with Murf: convert text to speech, re-voice existing audio, translate text, and list available voices.',
24
+ keywords: [
25
+ 'murf',
26
+ 'text to speech',
27
+ 'tts',
28
+ 'voiceover',
29
+ 'narration',
30
+ 'ai voice',
31
+ 'voice changer',
32
+ 'speech synthesis',
33
+ 'translate',
34
+ 'audio',
35
+ ],
36
+ },
37
+ actions: [
38
+ list_voices_1.listVoices,
39
+ translate_text_1.translateText,
40
+ voice_change_1.voiceChange,
41
+ text_to_speech_1.textToSpeech,
42
+ (0, pieces_common_1.createCustomApiCallAction)({
43
+ auth: auth_1.murfAuth,
44
+ baseUrl: () => client_1.BASE_URL,
45
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
46
+ return {
47
+ 'api-key': auth,
48
+ };
49
+ }),
50
+ }),
51
+ ],
52
+ triggers: [],
53
+ });
54
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/murf-api/src/index.ts"],"names":[],"mappings":";;;;AAAA,kEAA0D;AAC1D,4DAAqE;AACrE,8CAAkD;AAClD,4CAA6C;AAC7C,gDAA+C;AAC/C,2DAAuD;AACvD,iEAA6D;AAC7D,6DAAyD;AACzD,iEAA4D;AAE/C,QAAA,OAAO,GAAG,IAAA,8BAAW,EAAC;IACjC,WAAW,EAAE,SAAS;IACtB,WAAW,EACT,0JAA0J;IAC5J,IAAI,EAAE,eAAQ;IACd,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,kDAAkD;IAC3D,OAAO,EAAE,CAAC,WAAW,CAAC;IACtB,UAAU,EAAE,CAAC,sBAAa,CAAC,uBAAuB,CAAC;IACnD,EAAE,EAAE;QACF,WAAW,EACT,0IAA0I;QAC5I,QAAQ,EAAE;YACR,MAAM;YACN,gBAAgB;YAChB,KAAK;YACL,WAAW;YACX,WAAW;YACX,UAAU;YACV,eAAe;YACf,kBAAkB;YAClB,WAAW;YACX,OAAO;SACR;KACF;IACD,OAAO,EAAE;QACP,wBAAU;QACV,8BAAa;QACb,0BAAW;QACX,6BAAY;QACZ,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,eAAQ;YACd,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAQ;YACvB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,SAAS,EAAE,IAAc;iBAC1B,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const listVoices: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ locale: import("@taskmagic/pieces-framework").DropdownProperty<string, true>;
3
+ style: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
4
+ }>;
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listVoices = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const client_1 = require("../common/client");
8
+ const auth_1 = require("../common/auth");
9
+ const dropdown_1 = require("../common/dropdown");
10
+ exports.listVoices = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.murfAuth,
12
+ name: 'list-voices',
13
+ displayName: 'List Voices',
14
+ description: 'Get the list of available voices for text-to-speech',
15
+ ai: {
16
+ instructions: 'Read-only. Use this to discover a valid voiceId (and its supported locales/styles) before configuring Text to Speech or Voice Changer. Leave both filters empty to fetch every available voice.',
17
+ probe: true,
18
+ },
19
+ props: {
20
+ locale: dropdown_1.murfCommon.language,
21
+ style: pieces_framework_1.Property.Dropdown({
22
+ displayName: 'Style',
23
+ description: 'Filter by style (optional)',
24
+ required: false,
25
+ refreshers: ['locale'],
26
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, locale }) {
27
+ if (!auth) {
28
+ return {
29
+ disabled: true,
30
+ options: [],
31
+ placeholder: 'Please connect your Murf account first',
32
+ };
33
+ }
34
+ const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, '/speech/voices');
35
+ const voices = Array.isArray(response) ? response : [];
36
+ const filtered = locale
37
+ ? voices.filter((v) => v.locale === locale ||
38
+ (Array.isArray(v.supportedLocales) &&
39
+ v.supportedLocales.includes(locale)))
40
+ : voices;
41
+ const allStyles = new Set();
42
+ filtered.forEach((voice) => {
43
+ if (Array.isArray(voice.availableStyles)) {
44
+ voice.availableStyles.forEach((s) => allStyles.add(s));
45
+ }
46
+ });
47
+ return {
48
+ disabled: false,
49
+ options: [
50
+ { label: 'All Styles', value: '' },
51
+ ...Array.from(allStyles).map((s) => ({
52
+ label: s.charAt(0).toUpperCase() + s.slice(1),
53
+ value: s,
54
+ })),
55
+ ],
56
+ };
57
+ }),
58
+ }),
59
+ },
60
+ run(context) {
61
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
62
+ const { locale, style } = context.propsValue;
63
+ const response = yield (0, client_1.makeRequest)(context.auth, pieces_common_1.HttpMethod.GET, '/speech/voices');
64
+ const voices = Array.isArray(response) ? response : [];
65
+ let filtered = voices;
66
+ if (locale) {
67
+ filtered = filtered.filter((v) => v.locale === locale ||
68
+ (Array.isArray(v.supportedLocales) &&
69
+ v.supportedLocales.includes(locale)));
70
+ }
71
+ if (style) {
72
+ filtered = filtered.filter((v) => { var _a; return (_a = v.availableStyles) === null || _a === void 0 ? void 0 : _a.includes(style); });
73
+ }
74
+ return {
75
+ voices: filtered.map((voice) => ({
76
+ voiceId: voice.voiceId,
77
+ displayName: voice.displayName,
78
+ gender: voice.gender,
79
+ locale: voice.locale,
80
+ supportedLocales: voice.supportedLocales,
81
+ availableStyles: voice.availableStyles,
82
+ })),
83
+ };
84
+ });
85
+ },
86
+ });
87
+ //# sourceMappingURL=list-voices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-voices.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/murf-api/src/lib/actions/list-voices.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,4DAAsD;AACtD,6CAA+C;AAC/C,yCAA0C;AAC1C,iDAAgD;AAEnC,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACrC,IAAI,EAAE,eAAQ;IACd,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,qDAAqD;IAClE,EAAE,EAAE;QACF,YAAY,EACV,iMAAiM;QACnM,KAAK,EAAE,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,CAAC,CAAC,CAAM,EAAE,EAAE,WACpC,OAAA,MAAA,CAAC,CAAC,eAAe,0CAAE,QAAQ,CAAC,KAAK,CAAC,CAAA,EAAA,CACnC,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,CAAC;oBACpC,OAAO,EAAE,KAAK,CAAC,OAAO;oBACtB,WAAW,EAAE,KAAK,CAAC,WAAW;oBAC9B,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;oBACxC,eAAe,EAAE,KAAK,CAAC,eAAe;iBACvC,CAAC,CAAC;aACJ,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ export declare const textToSpeech: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ language: import("@taskmagic/pieces-framework").DropdownProperty<string, true>;
3
+ voiceId: import("@taskmagic/pieces-framework").DropdownProperty<unknown, true>;
4
+ text: import("@taskmagic/pieces-framework").LongTextProperty<true>;
5
+ audioDuration: import("@taskmagic/pieces-framework").NumberProperty<false>;
6
+ channelType: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
7
+ encodeAsBase64: import("@taskmagic/pieces-framework").CheckboxProperty<false>;
8
+ format: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
9
+ modelVersion: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
10
+ multiNativeLocale: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
11
+ pitch: import("@taskmagic/pieces-framework").NumberProperty<false>;
12
+ rate: import("@taskmagic/pieces-framework").NumberProperty<false>;
13
+ style: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
14
+ sampleRate: import("@taskmagic/pieces-framework").NumberProperty<false>;
15
+ variation: import("@taskmagic/pieces-framework").NumberProperty<false>;
16
+ wordDurationsAsOriginalText: import("@taskmagic/pieces-framework").CheckboxProperty<false>;
17
+ pronunciationDictionary: import("@taskmagic/pieces-framework").JsonProperty<false>;
18
+ }>;
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.textToSpeech = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const auth_1 = require("../common/auth");
7
+ const client_1 = require("../common/client");
8
+ const pieces_common_1 = require("@taskmagic/pieces-common");
9
+ const dropdown_1 = require("../common/dropdown");
10
+ exports.textToSpeech = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.murfAuth,
12
+ name: 'text_to_speech',
13
+ displayName: 'Text to Speech',
14
+ description: 'Converts input text into speech using Murf AI.',
15
+ props: {
16
+ language: dropdown_1.murfCommon.language,
17
+ voiceId: dropdown_1.murfCommon.voiceId,
18
+ text: pieces_framework_1.Property.LongText({
19
+ displayName: 'Text',
20
+ description: 'The text to be synthesized.',
21
+ required: true,
22
+ }),
23
+ audioDuration: pieces_framework_1.Property.Number({
24
+ displayName: 'Audio Duration (seconds)',
25
+ description: 'Specify audio length. If 0, Murf ignores this. Only for Gen2 model.',
26
+ required: false,
27
+ }),
28
+ channelType: pieces_framework_1.Property.StaticDropdown({
29
+ displayName: 'Channel Type',
30
+ description: 'Mono or Stereo output.',
31
+ required: false,
32
+ options: {
33
+ options: [
34
+ { label: 'Mono', value: 'MONO' },
35
+ { label: 'Stereo', value: 'STEREO' },
36
+ ],
37
+ },
38
+ }),
39
+ encodeAsBase64: pieces_framework_1.Property.Checkbox({
40
+ displayName: 'Encode as Base64',
41
+ description: 'Return Base64 encoded audio instead of URL (zero retention).',
42
+ required: false,
43
+ }),
44
+ format: pieces_framework_1.Property.StaticDropdown({
45
+ displayName: 'Audio Format',
46
+ description: 'Select audio format.',
47
+ required: false,
48
+ options: {
49
+ options: [
50
+ { label: 'MP3', value: 'MP3' },
51
+ { label: 'WAV', value: 'WAV' },
52
+ { label: 'FLAC', value: 'FLAC' },
53
+ { label: 'ALAW', value: 'ALAW' },
54
+ { label: 'ULAW', value: 'ULAW' },
55
+ { label: 'PCM', value: 'PCM' },
56
+ { label: 'OGG', value: 'OGG' },
57
+ ],
58
+ },
59
+ }),
60
+ modelVersion: pieces_framework_1.Property.StaticDropdown({
61
+ displayName: 'Model Version',
62
+ description: 'Choose Gen1 or Gen2.',
63
+ required: false,
64
+ options: {
65
+ options: [
66
+ { label: 'GEN1', value: 'GEN1' },
67
+ { label: 'GEN2', value: 'GEN2' },
68
+ ],
69
+ },
70
+ }),
71
+ multiNativeLocale: pieces_framework_1.Property.ShortText({
72
+ displayName: 'Multi Native Locale',
73
+ description: 'Set multi-language voice (e.g., en-US, es-ES). Only for Gen2.',
74
+ required: false,
75
+ }),
76
+ pitch: pieces_framework_1.Property.Number({
77
+ displayName: 'Pitch',
78
+ description: 'Pitch adjustment (-50 to 50).',
79
+ required: false,
80
+ }),
81
+ rate: pieces_framework_1.Property.Number({
82
+ displayName: 'Rate',
83
+ description: 'Speed adjustment (-50 to 50).',
84
+ required: false,
85
+ }),
86
+ style: pieces_framework_1.Property.ShortText({
87
+ displayName: 'Style',
88
+ description: "Voice style (e.g., 'default', 'calm', 'energetic'). Check voice details.",
89
+ required: false,
90
+ }),
91
+ sampleRate: pieces_framework_1.Property.Number({
92
+ displayName: 'Sample Rate',
93
+ description: 'Defaults to 44100. Allowed: 8000, 24000, 44100, 48000.',
94
+ required: false,
95
+ }),
96
+ variation: pieces_framework_1.Property.Number({
97
+ displayName: 'Variation',
98
+ description: 'Variation level (0-5). Defaults to 1. Higher = more natural pauses/pitch/speed.',
99
+ required: false,
100
+ }),
101
+ wordDurationsAsOriginalText: pieces_framework_1.Property.Checkbox({
102
+ displayName: 'Word Durations as Original Text',
103
+ description: 'If true, response word timings map to original text. (English only).',
104
+ required: false,
105
+ }),
106
+ pronunciationDictionary: pieces_framework_1.Property.Json({
107
+ displayName: 'Pronunciation Dictionary',
108
+ description: 'Custom word pronunciations.',
109
+ required: false,
110
+ }),
111
+ },
112
+ run(context) {
113
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
114
+ const body = {
115
+ text: context.propsValue.text,
116
+ voiceId: context.propsValue.voiceId,
117
+ audioDuration: context.propsValue.audioDuration,
118
+ channelType: context.propsValue.channelType,
119
+ encodeAsBase64: context.propsValue.encodeAsBase64,
120
+ format: context.propsValue.format,
121
+ modelVersion: context.propsValue.modelVersion,
122
+ multiNativeLocale: context.propsValue.multiNativeLocale,
123
+ pitch: context.propsValue.pitch,
124
+ rate: context.propsValue.rate,
125
+ sampleRate: context.propsValue.sampleRate,
126
+ style: context.propsValue.style,
127
+ variation: context.propsValue.variation,
128
+ wordDurationsAsOriginalText: context.propsValue.wordDurationsAsOriginalText,
129
+ pronunciationDictionary: context.propsValue.pronunciationDictionary,
130
+ };
131
+ const response = yield (0, client_1.makeRequest)(context.auth, pieces_common_1.HttpMethod.POST, '/speech/generate', body);
132
+ return response;
133
+ });
134
+ },
135
+ });
136
+ //# sourceMappingURL=text-to-speech.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-to-speech.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/murf-api/src/lib/actions/text-to-speech.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,yCAA0C;AAC1C,6CAA+C;AAC/C,4DAAsD;AACtD,iDAAgD;AAEnC,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,eAAQ;IACd,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,gDAAgD;IAC7D,KAAK,EAAE;QACL,QAAQ,EAAE,qBAAU,CAAC,QAAQ;QAC7B,OAAO,EAAE,qBAAU,CAAC,OAAO;QAC3B,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE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ction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ targetLanguage: import("@taskmagic/pieces-framework").DropdownProperty<string, true>;
3
+ texts: import("@taskmagic/pieces-framework").ArrayProperty<true>;
4
+ }>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.translateText = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const auth_1 = require("../common/auth");
7
+ const dropdown_1 = require("../common/dropdown");
8
+ const client_1 = require("../common/client");
9
+ const pieces_common_1 = require("@taskmagic/pieces-common");
10
+ exports.translateText = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.murfAuth,
12
+ name: 'translateText',
13
+ displayName: 'Translate Text',
14
+ description: 'Translate one or more texts to the target language.',
15
+ props: {
16
+ targetLanguage: dropdown_1.murfCommon.language,
17
+ texts: pieces_framework_1.Property.Array({
18
+ displayName: 'Texts',
19
+ description: 'List of texts to translate',
20
+ required: true,
21
+ }),
22
+ },
23
+ run(_a) {
24
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
25
+ const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.POST, '/text/translate', {
26
+ target_language: propsValue.targetLanguage,
27
+ texts: propsValue.texts,
28
+ });
29
+ return response;
30
+ });
31
+ },
32
+ });
33
+ //# sourceMappingURL=translate-text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translate-text.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/murf-api/src/lib/actions/translate-text.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,yCAA0C;AAC1C,iDAAgD;AAChD,6CAA+C;AAC/C,4DAAsD;AAEzC,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,eAAQ;IACd,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,qDAAqD;IAClE,KAAK,EAAE;QACL,cAAc,EAAE,qBAAU,CAAC,QAAQ;QACnC,KAAK,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACpB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,4BAA4B;YACzC,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,IAAc,EACd,0BAAU,CAAC,IAAI,EACf,iBAAiB,EACjB;gBACE,eAAe,EAAE,UAAU,CAAC,cAAc;gBAC1C,KAAK,EAAE,UAAU,CAAC,KAAK;aACxB,CACF,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare const voiceChange: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ language: import("@taskmagic/pieces-framework").DropdownProperty<string, true>;
3
+ voiceId: import("@taskmagic/pieces-framework").DropdownProperty<unknown, true>;
4
+ fileUrl: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
5
+ file: import("@taskmagic/pieces-framework").FileProperty<false>;
6
+ format: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
7
+ channelType: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
8
+ pitch: import("@taskmagic/pieces-framework").NumberProperty<false>;
9
+ rate: import("@taskmagic/pieces-framework").NumberProperty<false>;
10
+ encodeOutputAsBase64: import("@taskmagic/pieces-framework").CheckboxProperty<false>;
11
+ }>;
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.voiceChange = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const auth_1 = require("../common/auth");
8
+ const dropdown_1 = require("../common/dropdown");
9
+ const client_1 = require("../common/client");
10
+ const form_data_1 = tslib_1.__importDefault(require("form-data"));
11
+ exports.voiceChange = (0, pieces_framework_1.createAction)({
12
+ auth: auth_1.murfAuth,
13
+ name: 'voice-changer-convert',
14
+ displayName: 'Voice Changer',
15
+ description: 'Convert an input audio file to a different voice using Murf Voice Changer.',
16
+ props: {
17
+ language: dropdown_1.murfCommon.language,
18
+ voiceId: dropdown_1.murfCommon.voiceId,
19
+ fileUrl: pieces_framework_1.Property.ShortText({
20
+ displayName: 'File URL',
21
+ description: 'Publicly accessible URL of the input audio file. Either provide this or upload a file.',
22
+ required: false,
23
+ }),
24
+ file: pieces_framework_1.Property.File({
25
+ displayName: 'Upload File',
26
+ description: 'Upload an audio file for voice conversion',
27
+ required: false,
28
+ }),
29
+ format: pieces_framework_1.Property.StaticDropdown({
30
+ displayName: 'Output Format',
31
+ description: 'Format of the generated audio file',
32
+ required: false,
33
+ options: {
34
+ options: [
35
+ { label: 'MP3', value: 'MP3' },
36
+ { label: 'WAV', value: 'WAV' },
37
+ { label: 'FLAC', value: 'FLAC' },
38
+ { label: 'OGG', value: 'OGG' },
39
+ ],
40
+ },
41
+ }),
42
+ channelType: pieces_framework_1.Property.StaticDropdown({
43
+ displayName: 'Channel Type',
44
+ description: 'Choose MONO or STEREO output',
45
+ required: false,
46
+ options: {
47
+ options: [
48
+ { label: 'Mono', value: 'MONO' },
49
+ { label: 'Stereo', value: 'STEREO' },
50
+ ],
51
+ },
52
+ }),
53
+ pitch: pieces_framework_1.Property.Number({
54
+ displayName: 'Pitch',
55
+ description: 'Pitch adjustment (-50 to 50)',
56
+ required: false,
57
+ }),
58
+ rate: pieces_framework_1.Property.Number({
59
+ displayName: 'Rate',
60
+ description: 'Speed adjustment (-50 to 50)',
61
+ required: false,
62
+ }),
63
+ encodeOutputAsBase64: pieces_framework_1.Property.Checkbox({
64
+ displayName: 'Encode Output as Base64',
65
+ description: 'Receive audio directly as Base64 instead of a file URL',
66
+ required: false,
67
+ }),
68
+ },
69
+ run(_a) {
70
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
71
+ var _b;
72
+ try {
73
+ const { voiceId, file, fileUrl, format, pitch, rate, encodeOutputAsBase64 } = propsValue;
74
+ // Validation
75
+ if (!file && !fileUrl) {
76
+ throw new Error(" Either 'Source Audio File' or 'Source File URL' must be provided.");
77
+ }
78
+ if (file && fileUrl) {
79
+ throw new Error(" Provide only one: 'Source Audio File' OR 'Source File URL', not both.");
80
+ }
81
+ // Build FormData
82
+ const formData = new form_data_1.default();
83
+ formData.append('voice_id', voiceId);
84
+ if (fileUrl) {
85
+ formData.append('file_url', fileUrl);
86
+ }
87
+ if (file) {
88
+ try {
89
+ const fileBuffer = Buffer.from(file.base64, 'base64');
90
+ const blob = new Blob([fileBuffer]);
91
+ formData.append('file', blob, file.filename);
92
+ }
93
+ catch (e) {
94
+ throw new Error("Failed to process uploaded file. Ensure it's a valid audio file.");
95
+ }
96
+ }
97
+ if (format)
98
+ formData.append('format', format);
99
+ if (pitch !== undefined)
100
+ formData.append('pitch', pitch.toString());
101
+ if (rate !== undefined)
102
+ formData.append('rate', rate.toString());
103
+ if (encodeOutputAsBase64)
104
+ formData.append('encode_output_as_base64', 'true');
105
+ // API request
106
+ const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.POST, '/voice-changer/convert', formData, true);
107
+ // Handle Murf error response
108
+ if (response === null || response === void 0 ? void 0 : response.errorMessage) {
109
+ throw new Error(` Murf API error (${response.errorCode || 'unknown'}): ${response.errorMessage}`);
110
+ }
111
+ return {
112
+ success: true,
113
+ message: ' Voice conversion successful',
114
+ data: response,
115
+ };
116
+ }
117
+ catch (error) {
118
+ return {
119
+ success: false,
120
+ message: error.message || 'Unexpected error during voice conversion',
121
+ details: ((_b = error.response) === null || _b === void 0 ? void 0 : _b.body) || error,
122
+ };
123
+ }
124
+ });
125
+ },
126
+ });
127
+ //# sourceMappingURL=voice-change.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voice-change.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/murf-api/src/lib/actions/voice-change.ts"],"names":[],"mappings":";;;;AAAA,kEAA6E;AAC7E,4DAAsD;AACtD,yCAA0C;AAC1C,iDAAgD;AAChD,6CAA+C;AAC/C,kEAAiC;AAEpB,QAAA,WAAW,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,eAAQ;IACd,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,eAAe;IAC5B,WAAW,EACT,4EAA4E;IAC9E,KAAK,EAAE;QACL,QAAQ,EAAE,qBAAU,CAAC,QAAQ;QAC7B,OAAO,EAAE,qBAAU,CAAC,OAAO;QAC3B,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,UAAU;YACvB,WAAW,EACT,wFAAwF;YAC1F,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,2CAA2C;YACxD,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC9B,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,oCAAoC;YACjD,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;oBAC9B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;oBAC9B,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;oBAChC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;iBAC/B;aACF;SACF,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,cAAc,CAAC;YACnC,WAAW,EAAE,cAAc;YAC3B,WAAW,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CAAC;gBAED,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE,8BAA8B;oBACvC,IAAI,EAAE,QAAQ;iBACf,CAAC;YACJ,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,0CAA0C;oBACpE,OAAO,EAAE,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,KAAI,KAAK;iBACvC,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const murfAuth: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.murfAuth = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const client_1 = require("./client");
8
+ exports.murfAuth = pieces_framework_1.PieceAuth.SecretText({
9
+ displayName: 'API Key',
10
+ description: 'Enter your API key from https://murf.ai',
11
+ required: true,
12
+ validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
13
+ if (!auth) {
14
+ return {
15
+ valid: false,
16
+ error: 'API Key is required',
17
+ };
18
+ }
19
+ try {
20
+ const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, '/auth/token');
21
+ if (response && response.token) {
22
+ return { valid: true };
23
+ }
24
+ return {
25
+ valid: false,
26
+ error: 'Invalid API key or token could not be generated',
27
+ };
28
+ }
29
+ catch (e) {
30
+ return {
31
+ valid: false,
32
+ error: `Auth validation failed: ${e.message}`,
33
+ };
34
+ }
35
+ }),
36
+ });
37
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/murf-api/src/lib/common/auth.ts"],"names":[],"mappings":";;;;AAAA,kEAAwD;AACxD,4DAAsD;AACtD,qCAAuC;AAE1B,QAAA,QAAQ,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC3C,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,yCAAyC;IACtD,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,qBAAqB;aAC7B,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,IAAc,EACd,0BAAU,CAAC,GAAG,EACd,aAAa,CACd,CAAC;YAEF,IAAI,QAAQ,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;gBAC/B,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;YACzB,CAAC;YAED,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,iDAAiD;aACzD,CAAC;QACJ,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,2BAA2B,CAAC,CAAC,OAAO,EAAE;aAC9C,CAAC;QACJ,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { HttpMethod } from '@taskmagic/pieces-common';
2
+ export declare const BASE_URL = "https://api.murf.ai/v1";
3
+ export declare function makeRequest(apiKey: string, method: HttpMethod, path: string, body?: unknown, isFormData?: boolean): Promise<any>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BASE_URL = void 0;
4
+ exports.makeRequest = makeRequest;
5
+ const tslib_1 = require("tslib");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ exports.BASE_URL = 'https://api.murf.ai/v1';
8
+ function makeRequest(apiKey_1, method_1, path_1, body_1) {
9
+ return tslib_1.__awaiter(this, arguments, void 0, function* (apiKey, method, path, body, isFormData = false) {
10
+ try {
11
+ let headers = {
12
+ 'api-key': apiKey,
13
+ };
14
+ const requestBody = body;
15
+ if (!isFormData) {
16
+ headers['Content-Type'] = 'application/json';
17
+ }
18
+ else if (body && typeof body.getHeaders === 'function') {
19
+ headers = Object.assign(Object.assign({}, headers), body.getHeaders());
20
+ }
21
+ const response = yield pieces_common_1.httpClient.sendRequest({
22
+ method,
23
+ url: `${exports.BASE_URL}${path}`,
24
+ headers,
25
+ body: requestBody,
26
+ });
27
+ return response.body;
28
+ }
29
+ catch (error) {
30
+ throw new Error(`Unexpected error: ${JSON.stringify(error.response || error.message || error)}`);
31
+ }
32
+ });
33
+ }
34
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/murf-api/src/lib/common/client.ts"],"names":[],"mappings":";;;AAIA,kCAiCC;;AArCD,4DAAkE;AAErD,QAAA,QAAQ,GAAG,wBAAwB,CAAC;AAEjD,SAAsB,WAAW;iEAC/B,MAAc,EACd,MAAkB,EAClB,IAAY,EACZ,IAAc,EACd,UAAU,GAAG,KAAK;QAElB,IAAI,CAAC;YACH,IAAI,OAAO,GAA2B;gBACpC,SAAS,EAAE,MAAM;aAClB,CAAC;YAEF,MAAM,WAAW,GAAG,IAAI,CAAC;YAEzB,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,OAAO,CAAC,cAAc,CAAC,GAAG,kBAAkB,CAAC;YAC/C,CAAC;iBAAM,IAAI,IAAI,IAAI,OAAQ,IAAiC,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;gBACvF,OAAO,mCAAQ,OAAO,GAAM,IAAqD,CAAC,UAAU,EAAE,CAAE,CAAC;YACnG,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM;gBACN,GAAG,EAAE,GAAG,gBAAQ,GAAG,IAAI,EAAE;gBACzB,OAAO;gBACP,IAAI,EAAE,WAAW;aAClB,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CACb,qBAAqB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,EAAE,CAChF,CAAC;QACJ,CAAC;IACH,CAAC;CAAA"}
@@ -0,0 +1,5 @@
1
+ export declare const murfCommon: {
2
+ language: import("@taskmagic/pieces-framework").DropdownProperty<string, true>;
3
+ voiceId: import("@taskmagic/pieces-framework").DropdownProperty<unknown, true>;
4
+ sourceLocale: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
5
+ };
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.murfCommon = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const client_1 = require("./client");
8
+ // Helper to fetch voices
9
+ const getVoices = (apiKey) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
10
+ return yield (0, client_1.makeRequest)(apiKey, pieces_common_1.HttpMethod.GET, '/speech/voices');
11
+ });
12
+ // Helper to build unique language list
13
+ const getLanguages = (apiKey) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
14
+ const voices = yield getVoices(apiKey);
15
+ const languageMap = new Map();
16
+ voices.forEach((voice) => {
17
+ if (voice.supportedLocales) {
18
+ Object.keys(voice.supportedLocales).forEach((localeCode) => {
19
+ if (!languageMap.has(localeCode)) {
20
+ languageMap.set(localeCode, voice.supportedLocales[localeCode].detail || localeCode);
21
+ }
22
+ });
23
+ }
24
+ });
25
+ return Array.from(languageMap, ([value, label]) => ({ label, value }));
26
+ });
27
+ exports.murfCommon = {
28
+ language: pieces_framework_1.Property.Dropdown({
29
+ displayName: 'Language',
30
+ description: 'Select your preferred language for the translated output.',
31
+ required: true,
32
+ refreshers: [],
33
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
34
+ if (!auth) {
35
+ return {
36
+ disabled: true,
37
+ placeholder: 'Please connect your Murf account first.',
38
+ options: [],
39
+ };
40
+ }
41
+ const langs = yield getLanguages(auth);
42
+ return {
43
+ disabled: false,
44
+ options: langs,
45
+ };
46
+ }),
47
+ }),
48
+ voiceId: pieces_framework_1.Property.Dropdown({
49
+ displayName: 'Voice',
50
+ description: 'Choose a voice for converting text into speech',
51
+ required: true,
52
+ refreshers: ['language'],
53
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, language }) {
54
+ if (!auth || !language) {
55
+ return {
56
+ disabled: true,
57
+ placeholder: 'Please select a language and connect your Murf account first.',
58
+ options: [],
59
+ };
60
+ }
61
+ const voices = yield getVoices(auth);
62
+ const filtered = voices.filter((v) => Object.keys(v.supportedLocales || {}).includes(language));
63
+ return {
64
+ disabled: false,
65
+ options: filtered.map((v) => ({
66
+ label: `${v.displayName} (${v.gender}, ${v.locale})`,
67
+ value: v.voiceId,
68
+ })),
69
+ };
70
+ }),
71
+ }),
72
+ sourceLocale: pieces_framework_1.Property.Dropdown({
73
+ displayName: 'Source Locale',
74
+ description: 'Select the source locale for input text.',
75
+ required: false,
76
+ refreshers: [],
77
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
78
+ if (!auth) {
79
+ return {
80
+ disabled: true,
81
+ placeholder: 'Please connect your Murf account first.',
82
+ options: [],
83
+ };
84
+ }
85
+ const voices = yield getVoices(auth);
86
+ const localeMap = new Map();
87
+ voices.forEach((voice) => {
88
+ if (voice.supportedLocales) {
89
+ Object.entries(voice.supportedLocales).forEach(([localeCode, localeData]) => {
90
+ if (!localeMap.has(localeCode)) {
91
+ localeMap.set(localeCode, localeData.detail);
92
+ }
93
+ });
94
+ }
95
+ });
96
+ return {
97
+ disabled: false,
98
+ options: Array.from(localeMap, ([value, label]) => ({ value, label })),
99
+ };
100
+ }),
101
+ }),
102
+ };
103
+ //# sourceMappingURL=dropdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/murf-api/src/lib/common/dropdown.ts"],"names":[],"mappings":";;;;AAAA,kEAAuD;AACvD,4DAAsD;AACtD,qCAAuC;AAEvC,yBAAyB;AACzB,MAAM,SAAS,GAAG,CAAO,MAAc,EAAE,EAAE;IACzC,OAAO,MAAM,IAAA,oBAAW,EAAC,MAAM,EAAE,0BAAU,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;AACrE,CAAC,CAAA,CAAC;AAEF,uCAAuC;AACvC,MAAM,YAAY,GAAG,CAAO,MAAc,EAAE,EAAE;IAC5C,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE9C,MAAM,CAAC,OAAO,CAAC,CAAC,KAAU,EAAE,EAAE;QAC5B,IAAI,KAAK,CAAC,gBAAgB,EAAE,CAAC;YAC3B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;gBACzD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;oBACjC,WAAW,CAAC,GAAG,CACb,UAAU,EACV,KAAK,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,MAAM,IAAI,UAAU,CACxD,CAAC;gBACJ,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,IAAI,C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