/* Metro module 934; source: unknown; dependencies: [65, 836, 841, 895] */ import * as Module00065Module from './module-00065.js'; /* Metro dependency 65 */ import * as Module00895Module from './module-00895.js'; /* Metro dependency 895 */ function _fun9954(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#9954, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1061:6, offset: 0x00d778bc, size: 176 bytes, params: 8, frame: 24 let env0_0 = require; const flattenIssue2 = flattenIssue; const closure2 = function(a0) { return a0.map(_fun9957).join('.'); }; const formatIssueMessage2 = formatIssueMessage; const applyZodErrorsToEvent2 = applyZodErrorsToEvent; const Object = global.Object; const defineProperty = Object.defineProperty; const Symbol = global.Symbol; Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]); let value = Module00895Module; value = value.defineIntegration(function() { var r0; r0 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var env0_0 = r0; var env0_1 = r0.limit ?? 10; return {name: 'ZodErrors', processEvent: _fun9961}; }); exports.applyZodErrorsToEvent = applyZodErrorsToEvent2; exports.flattenIssue = flattenIssue2; exports.flattenIssuePath = closure2; exports.formatIssueMessage = formatIssueMessage2; exports.zodErrorsIntegration = value; function flattenIssuePath(a0) { // fn#9956, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1061:337, offset: 0x00d77a1a, size: 36 bytes, params: 2, frame: 11 return a0.map(function(a0) { var value = a0; return typeof value === 'number' ? '' : value; }).join('.'); } function formatIssueMessage(a0) { // fn#9958, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1061:442, offset: 0x00d77a57, size: 323 bytes, params: 2, frame: 21 var r3; var r2; var flattenIssuePathBinding; var path; var value3; var length; var value4; var add; var error; var Array; var from; var moduleValue; var truncate; var join; var HermesInternal; var concat; var property; var value5; var value6; var expected; var value7; const Set = global.Set; let set = new Set(); let issues = a0.issues; const iterator = issues[Symbol.iterator](); const iterator2 = iterator.next; let r7 = iterator; let item2 = Reflect.apply(iterator2, r7, []); let item = item2.value; item2 = item2.done ? undefined : r7; reducibleJoin2: while (true) { if (item2 === undefined) { Array = global.Array; from = Array.from; set = Reflect.apply(from, Array, [set]); length = set.length; if (length === 0) { issues = a0.issues; length = issues.length; set = 'variable'; reducibleJoin22: while (true) { if (length > 0) { issues = a0.issues; property = issues[0]; value5 = property !== undefined; reducibleJoin18: while (true) { if (value5) { value6 = 'expected' in property; r3 = value6; break reducibleJoin18; } r3 = value5; break reducibleJoin18; } reducibleJoin20: while (true) { if (r3) { expected = property.expected; value7 = typeof expected === 'string'; r3 = value7; break reducibleJoin20; } break reducibleJoin20; } if (r3) { expected = property.expected; r2 = expected; break reducibleJoin22; } r2 = set; break reducibleJoin22; } r2 = set; break reducibleJoin22; } concat = global.HermesInternal.concat; return 'Failed to validate ' + r2; } moduleValue = require(841) /* metro dependency 841 */; truncate = moduleValue.truncate; join = set.join; set = Reflect.apply(join, set, [', ']); set = Reflect.apply(truncate, moduleValue, [set, 100]); HermesInternal = global.HermesInternal; concat = HermesInternal.concat; return 'Failed to validate keys: ' + set; } break reducibleJoin2; } reducibleLoop2: while (true) { try { flattenIssuePathBinding = flattenIssuePath; } catch (error) { try { item2.return(); } catch { } throw error; } try { path = item.path; } catch (error) { try { item2.return(); } catch { } throw error; } try { value3 = flattenIssuePathBinding(path); } catch (error) { try { item2.return(); } catch { } throw error; } try { length = value3.length; } catch (error) { try { item2.return(); } catch { } throw error; } try { value4 = length > 0; } catch (error) { try { item2.return(); } catch { } throw error; } reducibleJoin1: while (true) { if (value4) { try { add = set.add; } catch (error) { try { item2.return(); } catch { } throw error; } try { Reflect.apply(add, set, [value3]); } catch (error) { try { item2.return(); } catch { } throw error; } r7 = item2; break reducibleJoin1; } r7 = item2; break reducibleJoin1; } item2 = Reflect.apply(iterator2, r7, []); item = item2.value; item2 = item2.done ? undefined : r7; if (item2 === undefined) { break reducibleLoop2; } continue reducibleLoop2; } Array = global.Array; set = Array.from(set); length = set.length; if (length === 0) { issues = a0.issues; length = issues.length; set = 'variable'; reducibleJoin22: while (true) { if (length > 0) { issues = a0.issues; property = issues[0]; value5 = property !== undefined; reducibleJoin18: while (true) { if (value5) { value6 = 'expected' in property; r3 = value6; break reducibleJoin18; } r3 = value5; break reducibleJoin18; } reducibleJoin20: while (true) { if (r3) { expected = property.expected; value7 = typeof expected === 'string'; r3 = value7; break reducibleJoin20; } break reducibleJoin20; } if (r3) { expected = property.expected; r2 = expected; break reducibleJoin22; } r2 = set; break reducibleJoin22; } r2 = set; break reducibleJoin22; } return 'Failed to validate ' + r2; } moduleValue = require(841) /* metro dependency 841 */; truncate = moduleValue.truncate; set = set.join(', '); set = Reflect.apply(truncate, moduleValue, [set, 100]); HermesInternal = global.HermesInternal; return 'Failed to validate keys: ' + set; } function applyZodErrorsToEvent(a0) { // fn#9959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1061:831, offset: 0x00d77b9a, size: 791 bytes, params: 2, frame: 35 var r34; var r35; var r5; var r10; var originalException; var isError2; var name; var Array; var isArray; var issues; var value9; var value10; var attachments; var isArray3; var object; var push; var JSON; var value11; var Object; var assign; var Object2; var assign2; var Object3; var assign3; var exception2; var property; var formatIssueMessageBinding; var value12; var value13; var items2; var concat; var binding; var exception3; var value14; var Object4; var assign4; var extra; var error; var Object5; var assign5; var Error; var message; var stack; let value = undefined; const r3 = arguments.length > 1 && value !== arguments[1] && arguments[1]; const r32 = arguments.length > 2 ? arguments[2] : value; const r33 = arguments.length > 3 ? arguments[3] : value; let exception = r32.exception; if (exception != null) { var values = exception.values; if (values) { originalException = r33.originalException; if (originalException) { originalException = r33.originalException; isError2 = (require(836) /* metro dependency 836 */).isError(originalException); if (isError2) { name = originalException.name; r34 = name === 'ZodError'; } else { r34 = isError2; } if (r34) { Array = global.Array; r35 = Array.isArray(originalException.issues); } else { r35 = r34; } if (r35) { originalException = r33.originalException; issues = originalException.issues; if (issues.length === 0) { return r32; } try { originalException = r33.originalException; issues = originalException.issues; if (r3) { r5 = issues; } else { value9 = issues.slice(0, a0); r5 = value9; } value10 = r5.map(flattenIssue); if (r3) { Array = global.Array; isArray = Array.isArray; attachments = r33.attachments; isArray3 = Reflect.apply(isArray, Array, [attachments]); if (!isArray3) { r33.attachments = []; } attachments = r33.attachments; push = attachments.push; JSON = global.JSON; value11 = JSON.stringify({issues: value10}); Reflect.apply(push, attachments, [{filename: 'zod_issues.json', data: value11}]); } Object = global.Object; assign = Object.assign; object = {}; Object2 = global.Object; assign2 = Object2.assign; exception = r32.exception; Object3 = global.Object; assign3 = Object3.assign; exception2 = r32.exception; values = exception2.values; property = values[0]; formatIssueMessageBinding = formatIssueMessage; originalException = r33.originalException; value12 = formatIssueMessageBinding(originalException); value13 = Reflect.apply(assign3, Object3, [{}, property, {value: value12}]); items2 = [value13]; concat = items2.concat; binding = Module00065Module; exception3 = r32.exception; values = exception3.values; value14 = values.slice(1); value = binding(value14); value = Reflect.apply(concat, items2, [value]); value = Reflect.apply(assign2, Object2, [{}, exception, {values: value}]); object.exception = value; Object4 = global.Object; assign4 = Object4.assign; extra = r32.extra; value = value10.slice(0, a0); value = Reflect.apply(assign4, Object4, [{}, extra, {['zoderror.issues']: value}]); object.extra = value; value = Reflect.apply(assign, Object, [{}, r32, object]); } catch (error) { Object = global.Object; assign = Object.assign; Object5 = global.Object; assign5 = Object5.assign; extra = r32.extra; Error = global.Error; value = 'unknown'; if (error instanceof Error) { name = error.name; message = error.message; stack = error.stack; value = '' + name + ': ' + message + '\n' + stack; r10 = value; } else { r10 = value; } return Reflect.apply(assign, Object, [{}, r32, {extra: Reflect.apply(assign5, Object5, [{}, extra, {['zoderrors sentry integration parse error']: {message: 'an exception was thrown while processing ZodError within applyZodErrorsToEvent()', error: r10}}])}]); } return value; } return r32; } return r32; } } return r32; } function _zodErrorsIntegration() { // fn#9960, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1061:2072, offset: 0x00d77eb1, size: 83 bytes, params: 1, frame: 5 let r0 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; r0 = r0.limit ?? 10; return {name: 'ZodErrors', processEvent: processEvent_9961}; function _zodErrorsIntegrationProcessEvent(a0, a1) { // fn#9961, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1061:2233, owner: _zodErrorsIntegration.processEvent, offset: 0x00d77f04, size: 38 bytes, params: 3, frame: 17 return applyZodErrorsToEvent(env0_1, env0_0.saveZodIssuesAsAttachment, a0, a1); } } } function flattenIssue(a0) { // fn#9955, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1061:107, offset: 0x00d7796c, size: 174 bytes, params: 2, frame: 20 const Object = global.Object; const value = undefined; return Object.assign({}, a0, {path: 'path' in a0 && global.Array.isArray(a0.path) ? a0.path.join('.') : value, keys: 'keys' in a0 ? global.JSON.stringify(a0.keys) : value, unionErrors: 'unionErrors' in a0 ? global.JSON.stringify(a0.unionErrors) : value}); } function _fun9957(a0) { // fn#9957, offset: 0x00d77a3e, size: 25 bytes, params: 2, frame: 4 const value = a0; return typeof value === 'number' ? '' : value; } global.__d(_fun9954, 934, [65, 836, 841, 895]) /* metro module 934, dependencies: [65, 836, 841, 895] */;