Files
discord-decomp/_bundle/Module1893.js
T
2026-11-01 12:12:55 +02:00

734 lines
21 KiB
JavaScript

// Metro module 1893 (f1894).
import { MessageType, MESSAGE_TYPE, reflectionMergePartial, UnknownFieldHandler, WireType } from "./Module1307";
import { Timestamp } from "./Module1336";
import { ClassificationType } from "./Module1894";
import { UInt64Value } from "./Module1337";
import { $callWithNewTarget } from "../_hermes/prelude";
function $mk70496($env) {
return () => Timestamp;
}
function $mk70497($env) {
return () => Timestamp;
}
function $mk70498($env) {
return () => Timestamp;
}
function $mk70499($env) {
return () => ["discord_protos.safety_common.v1.ClassificationType", ClassificationType];
}
function $mk70500($env) {
return () => Timestamp;
}
function $mk70501($env) {
return () => ["discord_protos.safety_common.v1.ClassificationType", ClassificationType];
}
function $mk70502($env) {
return () => Timestamp;
}
function $mk70503($env) {
return () => c1589_5;
}
function $mk70504($env) {
return () => c1589_6;
}
function $mk70505($env) {
return () => c1589_7;
}
function $mk70506($env) {
return () => c1589_8;
}
function $mk70507($env) {
return () => c1589_9;
}
function $mk70508($env) {
return () => ["discord_protos.safety_common.v1.SafetyStateReason", c1589_3];
}
function $mk70509($env) {
return () => ["discord_protos.safety_common.v1.SafetyAnnotations", c1589_4];
}
function $mk70510($env) {
return () => UInt64Value;
}
let c1589_10, c1589_5, c1589_11, c1589_6, c1589_12, c1589_7, c1589_13, c1589_8, c1589_14, c1589_9, c1589_15;
let env1589;
const r12 = env1589 = {};
const c1589_3 = {
REASON_UNSPECIFIED: 0,
0: "REASON_UNSPECIFIED",
DISABLED_SUSPICIOUS_ACTIVITY: 1,
1: "DISABLED_SUSPICIOUS_ACTIVITY",
SMITE_REMOVE_EMAIL_VERIFICATION: 2,
2: "SMITE_REMOVE_EMAIL_VERIFICATION",
USER_REQUIRED_VERIFICATION_INTERVENTIONS_CLIENT: 3,
3: "USER_REQUIRED_VERIFICATION_INTERVENTIONS_CLIENT",
ACTIVE_ASSIGNMENT_COMPLETED: 4,
4: "ACTIVE_ASSIGNMENT_COMPLETED",
ACTIVE_ASSIGNMENT_CREATED: 5,
5: "ACTIVE_ASSIGNMENT_CREATED",
DEFERRED_ASSIGNMENT_CREATED: 6,
6: "DEFERRED_ASSIGNMENT_CREATED",
DEFERRED_ASSIGNMENT_UPGRADED_TO_ACTIVE: 7,
7: "DEFERRED_ASSIGNMENT_UPGRADED_TO_ACTIVE",
DEFERRED_ASSIGNMENT_CANCELLED: 8,
8: "DEFERRED_ASSIGNMENT_CANCELLED",
ASSIGNMENT_STATE_REPAIRED: 9,
9: "ASSIGNMENT_STATE_REPAIRED",
MANUAL_PERMANENT_BAN: 10,
10: "MANUAL_PERMANENT_BAN",
SAFETY_SYSTEM_UNBAN: 11,
11: "SAFETY_SYSTEM_UNBAN",
GENERIC_AUTOMATED_SAFETY_ACTION: 12,
12: "GENERIC_AUTOMATED_SAFETY_ACTION",
GENERIC_MANUAL_SAFETY_ACTION: 13,
13: "GENERIC_MANUAL_SAFETY_ACTION",
BANNED_USER_BACKFILL: 14,
14: "BANNED_USER_BACKFILL"
};
const c1589_4 = {
ANNOTATION_UNSPECIFIED: 0,
0: "ANNOTATION_UNSPECIFIED",
SPAMMER: 1,
1: "SPAMMER",
SELF_DELETED: 2,
2: "SELF_DELETED",
SELF_DISABLED: 3,
3: "SELF_DISABLED",
UNDERAGE_DELETED: 4,
4: "UNDERAGE_DELETED",
SAFETY_POLICY_VIOLATION: 5,
5: "SAFETY_POLICY_VIOLATION",
INACTIVITY_DELETED: 6,
6: "INACTIVITY_DELETED",
GENERIC_DELETED: 7,
7: "GENERIC_DELETED"
};
class NormalState$Type extends MessageType {
constructor() {
super("discord_protos.safety_common.v1.NormalState", []);
}
create(a0) {
const r1 = {};
globalThis.globalThis.Object.defineProperty(r1, MESSAGE_TYPE, {
enumerable: false,
value: this
});
if (a0 !== void 0) {
reflectionMergePartial(this, r1, a0);
}
return r1;
}
internalBinaryRead(a0, a1, a2, a3) {
return a3 == null ? this.create() : a3;
}
internalBinaryWrite(a0, a1, { writeUnknownFields }) {
if (writeUnknownFields !== false) {
if (writeUnknownFields == 1) {
writeUnknownFields = UnknownFieldHandler.onWrite;
}
writeUnknownFields(this.typeName, a0, a1);
}
return a1;
}
}
c1589_10 = NormalState$Type;
const prototypeOf = Object.getPrototypeOf(NormalState$Type);
const r76 = Object.create(NormalState$Type.prototype);
const r77 = $callWithNewTarget(prototypeOf, r76, NormalState$Type, "discord_protos.safety_common.v1.NormalState", []);
c1589_5 = r77 instanceof Object ? r77 : r76;
class RestrictedState$Type extends MessageType {
constructor() {
const r1 = env1589;
const r2 = [{
no: 1,
name: "restricted_until",
kind: "message",
T: $mk70496(r1)
}];
super("discord_protos.safety_common.v1.RestrictedState", r2);
}
create(a0) {
const r1 = {};
globalThis.globalThis.Object.defineProperty(r1, MESSAGE_TYPE, {
enumerable: false,
value: this
});
if (a0 !== void 0) {
reflectionMergePartial(this, r1, a0);
}
return r1;
}
internalBinaryRead(a0, a1, a2, a3) {
const r5 = a3 == null ? this.create() : a3;
const r8 = a0.pos + a1;
while (a0.pos < r8) {
const [r19, r18] = a0.tag();
if (r19 === 1) {
r5.restrictedUntil = Timestamp.internalBinaryRead(a0, a0.uint32(), a2, r5.restrictedUntil);
} else {
let readUnknownField = a2.readUnknownField;
if (readUnknownField === "throw") {
throw new globalThis.globalThis.Error(`Unknown field ${r19} (wire type ${r18}) for ${this.typeName}`);
}
const r34 = a0.skip(r18);
if (readUnknownField !== false) {
if (readUnknownField === true) {
readUnknownField = UnknownFieldHandler.onRead;
}
readUnknownField(this.typeName, r5, r19, r18, r34);
}
}
}
return r5;
}
internalBinaryWrite(a0, a1, a2) {
if (a0.restrictedUntil) {
Timestamp.internalBinaryWrite(a0.restrictedUntil, a1.tag(1, WireType.LengthDelimited).fork(), a2).join();
}
let writeUnknownFields = a2.writeUnknownFields;
if (writeUnknownFields !== false) {
if (writeUnknownFields == 1) {
writeUnknownFields = UnknownFieldHandler.onWrite;
}
writeUnknownFields(this.typeName, a0, a1);
}
return a1;
}
}
c1589_11 = RestrictedState$Type;
const prototypeOf2 = Object.getPrototypeOf(RestrictedState$Type);
const r90 = [{
no: 1,
name: "restricted_until",
kind: "message",
T: $mk70496(r12)
}];
const r91 = Object.create(RestrictedState$Type.prototype);
const r95 = $callWithNewTarget(prototypeOf2, r91, RestrictedState$Type, "discord_protos.safety_common.v1.RestrictedState", r90);
c1589_6 = r95 instanceof Object ? r95 : r91;
class DeferredActionState$Type extends MessageType {
constructor() {
const r1 = env1589;
const r2 = [{
no: 1,
name: "action_deferred_until",
kind: "message",
T: $mk70497(r1)
}];
super("discord_protos.safety_common.v1.DeferredActionState", r2);
}
create(a0) {
const r1 = {};
globalThis.globalThis.Object.defineProperty(r1, MESSAGE_TYPE, {
enumerable: false,
value: this
});
if (a0 !== void 0) {
reflectionMergePartial(this, r1, a0);
}
return r1;
}
internalBinaryRead(a0, a1, a2, a3) {
const r5 = a3 == null ? this.create() : a3;
const r8 = a0.pos + a1;
while (a0.pos < r8) {
const [r19, r18] = a0.tag();
if (r19 === 1) {
r5.actionDeferredUntil = Timestamp.internalBinaryRead(a0, a0.uint32(), a2, r5.actionDeferredUntil);
} else {
let readUnknownField = a2.readUnknownField;
if (readUnknownField === "throw") {
throw new globalThis.globalThis.Error(`Unknown field ${r19} (wire type ${r18}) for ${this.typeName}`);
}
const r34 = a0.skip(r18);
if (readUnknownField !== false) {
if (readUnknownField === true) {
readUnknownField = UnknownFieldHandler.onRead;
}
readUnknownField(this.typeName, r5, r19, r18, r34);
}
}
}
return r5;
}
internalBinaryWrite(a0, a1, a2) {
if (a0.actionDeferredUntil) {
Timestamp.internalBinaryWrite(a0.actionDeferredUntil, a1.tag(1, WireType.LengthDelimited).fork(), a2).join();
}
let writeUnknownFields = a2.writeUnknownFields;
if (writeUnknownFields !== false) {
if (writeUnknownFields == 1) {
writeUnknownFields = UnknownFieldHandler.onWrite;
}
writeUnknownFields(this.typeName, a0, a1);
}
return a1;
}
}
c1589_12 = DeferredActionState$Type;
const prototypeOf3 = Object.getPrototypeOf(DeferredActionState$Type);
const r108 = [{
no: 1,
name: "action_deferred_until",
kind: "message",
T: $mk70497(r12)
}];
const r109 = Object.create(DeferredActionState$Type.prototype);
const r113 = $callWithNewTarget(prototypeOf3, r109, DeferredActionState$Type, "discord_protos.safety_common.v1.DeferredActionState", r108);
c1589_7 = r113 instanceof Object ? r113 : r109;
class TempBannedState$Type extends MessageType {
constructor() {
const r1 = env1589;
const r10 = [{
no: 1,
name: "banned_until",
kind: "message",
T: $mk70498(r1)
}, {
no: 2,
name: "classification_types",
kind: "enum",
repeat: 1,
T: $mk70499(r1)
}, {
no: 3,
name: "banned_at",
kind: "message",
T: $mk70500(r1)
}];
super("discord_protos.safety_common.v1.TempBannedState", r10);
}
create(a0) {
const r1 = {
classificationTypes: []
};
globalThis.globalThis.Object.defineProperty(r1, MESSAGE_TYPE, {
enumerable: false,
value: this
});
if (a0 !== void 0) {
reflectionMergePartial(this, r1, a0);
}
return r1;
}
internalBinaryRead(a0, a1, a2, a3) {
const r6 = a3 == null ? this.create() : a3;
const r9 = a0.pos + a1;
while (a0.pos < r9) {
const [r20, r34] = a0.tag();
if (r20 === 1) {
r6.bannedUntil = Timestamp.internalBinaryRead(a0, a0.uint32(), a2, r6.bannedUntil);
} else if (r20 === 2) {
if (r34 === WireType.LengthDelimited) {
const r83 = a0.int32() + a0.pos;
while (a0.pos < r83) {
r6.classificationTypes.push(a0.int32());
}
} else {
r6.classificationTypes.push(a0.int32());
}
} else if (r20 === 3) {
r6.bannedAt = Timestamp.internalBinaryRead(a0, a0.uint32(), a2, r6.bannedAt);
} else {
let readUnknownField = a2.readUnknownField;
if (readUnknownField === "throw") {
throw new globalThis.globalThis.Error(`Unknown field ${r20} (wire type ${r34}) for ${this.typeName}`);
}
const r15 = a0.skip(r34);
if (readUnknownField !== false) {
if (readUnknownField === true) {
readUnknownField = UnknownFieldHandler.onRead;
}
readUnknownField(this.typeName, r6, r20, r34, r15);
}
}
}
return r6;
}
internalBinaryWrite(a0, a1, a2) {
if (a0.bannedUntil) {
Timestamp.internalBinaryWrite(a0.bannedUntil, a1.tag(1, WireType.LengthDelimited).fork(), a2).join();
}
if (a0.classificationTypes.length) {
a1.tag(2, WireType.LengthDelimited).fork();
const length = a0.classificationTypes.length;
let r0 = 0;
if (0 < length) {
do {
a1.int32(a0.classificationTypes[r0]);
r0 = r0 + 1;
} while (r0 < a0.classificationTypes.length);
}
a1.join();
}
if (a0.bannedAt) {
Timestamp.internalBinaryWrite(a0.bannedAt, a1.tag(3, WireType.LengthDelimited).fork(), a2).join();
}
let writeUnknownFields = a2.writeUnknownFields;
if (writeUnknownFields !== false) {
if (writeUnknownFields == 1) {
writeUnknownFields = UnknownFieldHandler.onWrite;
}
writeUnknownFields(this.typeName, a0, a1);
}
return a1;
}
}
c1589_13 = TempBannedState$Type;
const prototypeOf4 = Object.getPrototypeOf(TempBannedState$Type);
const r126 = [{
no: 1,
name: "banned_until",
kind: "message",
T: $mk70498(r12)
}, {
no: 2,
name: "classification_types",
kind: "enum",
repeat: 1,
T: $mk70499(r12)
}, {
no: 3,
name: "banned_at",
kind: "message",
T: $mk70500(r12)
}];
const r131 = Object.create(TempBannedState$Type.prototype);
const r135 = $callWithNewTarget(prototypeOf4, r131, TempBannedState$Type, "discord_protos.safety_common.v1.TempBannedState", r126);
c1589_8 = r135 instanceof Object ? r135 : r131;
class BannedState$Type extends MessageType {
constructor() {
const r1 = env1589;
const r9 = [{
no: 1,
name: "classification_types",
kind: "enum",
repeat: 1,
T: $mk70501(r1)
}, {
no: 2,
name: "banned_at",
kind: "message",
T: $mk70502(r1)
}];
super("discord_protos.safety_common.v1.BannedState", r9);
}
create(a0) {
const r1 = {
classificationTypes: []
};
globalThis.globalThis.Object.defineProperty(r1, MESSAGE_TYPE, {
enumerable: false,
value: this
});
if (a0 !== void 0) {
reflectionMergePartial(this, r1, a0);
}
return r1;
}
internalBinaryRead(a0, a1, a2, a3) {
const r5 = a3 == null ? this.create() : a3;
const r8 = a0.pos + a1;
while (a0.pos < r8) {
const [r19, r33] = a0.tag();
if (r19 === 1) {
if (r33 === WireType.LengthDelimited) {
const r82 = a0.int32() + a0.pos;
while (a0.pos < r82) {
r5.classificationTypes.push(a0.int32());
}
} else {
r5.classificationTypes.push(a0.int32());
}
} else if (r19 === 2) {
r5.bannedAt = Timestamp.internalBinaryRead(a0, a0.uint32(), a2, r5.bannedAt);
} else {
let readUnknownField = a2.readUnknownField;
if (readUnknownField === "throw") {
throw new globalThis.globalThis.Error(`Unknown field ${r19} (wire type ${r33}) for ${this.typeName}`);
}
const r14 = a0.skip(r33);
if (readUnknownField !== false) {
if (readUnknownField === true) {
readUnknownField = UnknownFieldHandler.onRead;
}
readUnknownField(this.typeName, r5, r19, r33, r14);
}
}
}
return r5;
}
internalBinaryWrite(a0, a1, a2) {
if (a0.classificationTypes.length) {
a1.tag(1, WireType.LengthDelimited).fork();
const length = a0.classificationTypes.length;
let r0 = 0;
if (0 < length) {
do {
a1.int32(a0.classificationTypes[r0]);
r0 = r0 + 1;
} while (r0 < a0.classificationTypes.length);
}
a1.join();
}
if (a0.bannedAt) {
Timestamp.internalBinaryWrite(a0.bannedAt, a1.tag(2, WireType.LengthDelimited).fork(), a2).join();
}
let writeUnknownFields = a2.writeUnknownFields;
if (writeUnknownFields !== false) {
if (writeUnknownFields == 1) {
writeUnknownFields = UnknownFieldHandler.onWrite;
}
writeUnknownFields(this.typeName, a0, a1);
}
return a1;
}
}
c1589_14 = BannedState$Type;
const prototypeOf5 = Object.getPrototypeOf(BannedState$Type);
const r148 = [{
no: 1,
name: "classification_types",
kind: "enum",
repeat: 1,
T: $mk70501(r12)
}, {
no: 2,
name: "banned_at",
kind: "message",
T: $mk70502(r12)
}];
const r151 = Object.create(BannedState$Type.prototype);
const r155 = $callWithNewTarget(prototypeOf5, r151, BannedState$Type, "discord_protos.safety_common.v1.BannedState", r148);
c1589_9 = r155 instanceof Object ? r155 : r151;
class SafetyState$Type extends MessageType {
constructor() {
const r1 = env1589;
const r10 = [{
no: 101,
name: "normal",
kind: "message",
oneof: "state",
T: $mk70503(r1)
}, {
no: 102,
name: "restricted",
kind: "message",
oneof: "state",
T: $mk70504(r1)
}, {
no: 103,
name: "deferred_action",
kind: "message",
oneof: "state",
T: $mk70505(r1)
}, {
no: 104,
name: "temp_banned",
kind: "message",
oneof: "state",
T: $mk70506(r1)
}, {
no: 105,
name: "banned",
kind: "message",
oneof: "state",
T: $mk70507(r1)
}, {
no: 1,
name: "reason",
kind: "enum",
T: $mk70508(r1)
}, {
no: 2,
name: "annotations",
kind: "enum",
repeat: 1,
T: $mk70509(r1)
}, {
no: 3,
name: "last_mutation_id",
kind: "message",
T: $mk70510(r1)
}];
super("discord_protos.safety_common.v1.SafetyState", r10);
}
create(a0) {
const r1 = {
state: {
oneofKind: void 0
},
reason: 0,
annotations: []
};
globalThis.globalThis.Object.defineProperty(r1, MESSAGE_TYPE, {
enumerable: false,
value: this
});
if (a0 !== void 0) {
reflectionMergePartial(this, r1, a0);
}
return r1;
}
internalBinaryRead(a0, a1, a2, a3) {
const r11 = a3 == null ? this.create() : a3;
const r14 = a0.pos + a1;
while (a0.pos < r14) {
const [r25, r39] = a0.tag();
if (r25 === 101) {
r11.state = {
oneofKind: "normal",
normal: c1589_5.internalBinaryRead(a0, a0.uint32(), a2, r11.state.normal)
};
} else if (r25 === 102) {
r11.state = {
oneofKind: "restricted",
restricted: c1589_6.internalBinaryRead(a0, a0.uint32(), a2, r11.state.restricted)
};
} else if (r25 === 103) {
r11.state = {
oneofKind: "deferredAction",
deferredAction: c1589_7.internalBinaryRead(a0, a0.uint32(), a2, r11.state.deferredAction)
};
} else if (r25 === 104) {
r11.state = {
oneofKind: "tempBanned",
tempBanned: c1589_8.internalBinaryRead(a0, a0.uint32(), a2, r11.state.tempBanned)
};
} else if (r25 === 105) {
r11.state = {
oneofKind: "banned",
banned: c1589_9.internalBinaryRead(a0, a0.uint32(), a2, r11.state.banned)
};
} else if (r25 === 1) {
r11.reason = a0.int32();
} else if (r25 === 2) {
if (r39 === WireType.LengthDelimited) {
const r88 = a0.int32() + a0.pos;
while (a0.pos < r88) {
r11.annotations.push(a0.int32());
}
} else {
r11.annotations.push(a0.int32());
}
} else if (r25 === 3) {
r11.lastMutationId = UInt64Value.internalBinaryRead(a0, a0.uint32(), a2, r11.lastMutationId);
} else {
let readUnknownField = a2.readUnknownField;
if (readUnknownField === "throw") {
throw new globalThis.globalThis.Error(`Unknown field ${r25} (wire type ${r39}) for ${this.typeName}`);
}
const r20 = a0.skip(r39);
if (readUnknownField !== false) {
if (readUnknownField === true) {
readUnknownField = UnknownFieldHandler.onRead;
}
readUnknownField(this.typeName, r11, r25, r39, r20);
}
}
}
return r11;
}
internalBinaryWrite(a0, a1, a2) {
if (a0.state.oneofKind === "normal") {
c1589_5.internalBinaryWrite(a0.state.normal, a1.tag(101, WireType.LengthDelimited).fork(), a2).join();
}
if (a0.state.oneofKind === "restricted") {
c1589_6.internalBinaryWrite(a0.state.restricted, a1.tag(102, WireType.LengthDelimited).fork(), a2).join();
}
if (a0.state.oneofKind === "deferredAction") {
c1589_7.internalBinaryWrite(a0.state.deferredAction, a1.tag(103, WireType.LengthDelimited).fork(), a2).join();
}
if (a0.state.oneofKind === "tempBanned") {
c1589_8.internalBinaryWrite(a0.state.tempBanned, a1.tag(104, WireType.LengthDelimited).fork(), a2).join();
}
if (a0.state.oneofKind === "banned") {
c1589_9.internalBinaryWrite(a0.state.banned, a1.tag(105, WireType.LengthDelimited).fork(), a2).join();
}
if (a0.reason !== 0) {
a1.tag(1, WireType.Varint).int32(a0.reason);
}
if (a0.annotations.length) {
a1.tag(2, WireType.LengthDelimited).fork();
const r146 = 0 < a0.annotations.length;
let r148 = 0;
if (r146) {
do {
a1.int32(a0.annotations[r148]);
r148 = r148 + 1;
} while (r148 < a0.annotations.length);
}
a1.join();
}
if (a0.lastMutationId) {
UInt64Value.internalBinaryWrite(a0.lastMutationId, a1.tag(3, WireType.LengthDelimited).fork(), a2).join();
}
let writeUnknownFields = a2.writeUnknownFields;
if (writeUnknownFields !== false) {
if (writeUnknownFields == 1) {
writeUnknownFields = UnknownFieldHandler.onWrite;
}
writeUnknownFields(this.typeName, a0, a1);
}
return a1;
}
}
c1589_15 = SafetyState$Type;
const prototypeOf6 = Object.getPrototypeOf(SafetyState$Type);
const r169 = [{
no: 101,
name: "normal",
kind: "message",
oneof: "state",
T: $mk70503(r12)
}, {
no: 102,
name: "restricted",
kind: "message",
oneof: "state",
T: $mk70504(r12)
}, {
no: 103,
name: "deferred_action",
kind: "message",
oneof: "state",
T: $mk70505(r12)
}, {
no: 104,
name: "temp_banned",
kind: "message",
oneof: "state",
T: $mk70506(r12)
}, {
no: 105,
name: "banned",
kind: "message",
oneof: "state",
T: $mk70507(r12)
}, {
no: 1,
name: "reason",
kind: "enum",
T: $mk70508(r12)
}, {
no: 2,
name: "annotations",
kind: "enum",
repeat: 1,
T: $mk70509(r12)
}, {
no: 3,
name: "last_mutation_id",
kind: "message",
T: $mk70510(r12)
}];
const r184 = Object.create(SafetyState$Type.prototype);
const r188 = $callWithNewTarget(prototypeOf6, r184, SafetyState$Type, "discord_protos.safety_common.v1.SafetyState", r169);
export { c1589_3 as SafetyStateReason };
export { c1589_4 as SafetyAnnotations };
export { c1589_5 as NormalState };
export { c1589_6 as RestrictedState };
export { c1589_7 as DeferredActionState };
export { c1589_8 as TempBannedState };
export { c1589_9 as BannedState };
export const SafetyState = r188 instanceof Object ? r188 : r184;