136 lines
3.9 KiB
JavaScript
136 lines
3.9 KiB
JavaScript
// Metro module 6287 (f6288).
|
|
import { MessageType, MESSAGE_TYPE, reflectionMergePartial, UnknownFieldHandler, WireType } from "./Module1307";
|
|
import { ThemeAwareAsset } from "./Module6278";
|
|
import { LocalizedString } from "./Module6268";
|
|
import { HelpArticle } from "./Module6269";
|
|
import { $callWithNewTarget } from "../_hermes/prelude";
|
|
function $mk78229($env) {
|
|
return () => ThemeAwareAsset;
|
|
}
|
|
function $mk78230($env) {
|
|
return () => LocalizedString;
|
|
}
|
|
function $mk78231($env) {
|
|
return () => HelpArticle;
|
|
}
|
|
let c4003_3;
|
|
let env4003;
|
|
const r3 = env4003 = {};
|
|
class PlanSelectCardBanner$Type extends MessageType {
|
|
constructor() {
|
|
const r1 = env4003;
|
|
const r10 = [{
|
|
no: 1,
|
|
name: "asset",
|
|
kind: "message",
|
|
T: $mk78229(r1)
|
|
}, {
|
|
no: 2,
|
|
name: "body",
|
|
kind: "scalar",
|
|
T: 9
|
|
}, {
|
|
no: 3,
|
|
name: "body_localized",
|
|
kind: "message",
|
|
T: $mk78230(r1)
|
|
}, {
|
|
no: 4,
|
|
name: "help_article",
|
|
kind: "message",
|
|
T: $mk78231(r1)
|
|
}];
|
|
super("discord_protos.premium_marketing.v1.PlanSelectCardBanner", r10);
|
|
}
|
|
create(a0) {
|
|
const r1 = {
|
|
body: ""
|
|
};
|
|
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 r7 = a3 == null ? this.create() : a3;
|
|
const r10 = a0.pos + a1;
|
|
while (a0.pos < r10) {
|
|
const [r21, r20] = a0.tag();
|
|
if (r21 === 1) {
|
|
r7.asset = ThemeAwareAsset.internalBinaryRead(a0, a0.uint32(), a2, r7.asset);
|
|
} else if (r21 === 2) {
|
|
r7.body = a0.string();
|
|
} else if (r21 === 3) {
|
|
r7.bodyLocalized = LocalizedString.internalBinaryRead(a0, a0.uint32(), a2, r7.bodyLocalized);
|
|
} else if (r21 === 4) {
|
|
r7.helpArticle = HelpArticle.internalBinaryRead(a0, a0.uint32(), a2, r7.helpArticle);
|
|
} else {
|
|
let readUnknownField = a2.readUnknownField;
|
|
if (readUnknownField === "throw") {
|
|
throw new globalThis.globalThis.Error(`Unknown field ${r21} (wire type ${r20}) for ${this.typeName}`);
|
|
}
|
|
const r36 = a0.skip(r20);
|
|
if (readUnknownField !== false) {
|
|
if (readUnknownField === true) {
|
|
readUnknownField = UnknownFieldHandler.onRead;
|
|
}
|
|
readUnknownField(this.typeName, r7, r21, r20, r36);
|
|
}
|
|
}
|
|
}
|
|
return r7;
|
|
}
|
|
internalBinaryWrite(a0, a1, a2) {
|
|
if (a0.asset) {
|
|
ThemeAwareAsset.internalBinaryWrite(a0.asset, a1.tag(1, WireType.LengthDelimited).fork(), a2).join();
|
|
}
|
|
if (a0.body !== "") {
|
|
a1.tag(2, WireType.LengthDelimited).string(a0.body);
|
|
}
|
|
if (a0.bodyLocalized) {
|
|
LocalizedString.internalBinaryWrite(a0.bodyLocalized, a1.tag(3, WireType.LengthDelimited).fork(), a2).join();
|
|
}
|
|
if (a0.helpArticle) {
|
|
HelpArticle.internalBinaryWrite(a0.helpArticle, a1.tag(4, 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;
|
|
}
|
|
}
|
|
c4003_3 = PlanSelectCardBanner$Type;
|
|
const prototypeOf = Object.getPrototypeOf(PlanSelectCardBanner$Type);
|
|
const r34 = [{
|
|
no: 1,
|
|
name: "asset",
|
|
kind: "message",
|
|
T: $mk78229(r3)
|
|
}, {
|
|
no: 2,
|
|
name: "body",
|
|
kind: "scalar",
|
|
T: 9
|
|
}, {
|
|
no: 3,
|
|
name: "body_localized",
|
|
kind: "message",
|
|
T: $mk78230(r3)
|
|
}, {
|
|
no: 4,
|
|
name: "help_article",
|
|
kind: "message",
|
|
T: $mk78231(r3)
|
|
}];
|
|
const r39 = Object.create(PlanSelectCardBanner$Type.prototype);
|
|
const r40 = $callWithNewTarget(prototypeOf, r39, PlanSelectCardBanner$Type, "discord_protos.premium_marketing.v1.PlanSelectCardBanner", r34);
|
|
export const PlanSelectCardBanner = r40 instanceof Object ? r40 : r39;
|