230 lines
6.1 KiB
JavaScript
230 lines
6.1 KiB
JavaScript
// Metro module 6272 (f6273).
|
|
import { MessageType, MESSAGE_TYPE, reflectionMergePartial, UnknownFieldHandler, WireType } from "./Module1307";
|
|
import { CTAButton } from "./Module6270";
|
|
import { HelpArticle } from "./Module6269";
|
|
import { LocalizedString } from "./Module6268";
|
|
import { $callWithNewTarget } from "../_hermes/prelude";
|
|
function $mk78173($env) {
|
|
return () => CTAButton;
|
|
}
|
|
function $mk78174($env) {
|
|
return () => HelpArticle;
|
|
}
|
|
function $mk78175($env) {
|
|
return () => LocalizedString;
|
|
}
|
|
function $mk78176($env) {
|
|
return () => LocalizedString;
|
|
}
|
|
function $mk78177($env) {
|
|
return () => ["discord_protos.premium_marketing.v1.MarketingPageBannerButtonVariant", c3988_3, "MARKETING_PAGE_BANNER_BUTTON_VARIANT_"];
|
|
}
|
|
let c3988_4;
|
|
let env3988;
|
|
const r4 = env3988 = {};
|
|
const c3988_3 = {
|
|
UNSPECIFIED: 0,
|
|
0: "UNSPECIFIED",
|
|
EXPRESSIVE: 1,
|
|
1: "EXPRESSIVE",
|
|
PRIMARY: 2,
|
|
2: "PRIMARY"
|
|
};
|
|
class MarketingPageBanner$Type extends MessageType {
|
|
constructor() {
|
|
const r1 = env3988;
|
|
const r2 = [{
|
|
no: 1,
|
|
name: "asset_url",
|
|
kind: "scalar",
|
|
T: 9
|
|
}, {
|
|
no: 2,
|
|
name: "header",
|
|
kind: "scalar",
|
|
T: 9
|
|
}, {
|
|
no: 3,
|
|
name: "body",
|
|
kind: "scalar",
|
|
T: 9
|
|
}, {
|
|
no: 4,
|
|
name: "help_article_id",
|
|
kind: "scalar",
|
|
T: 9
|
|
}, {
|
|
no: 5,
|
|
name: "button",
|
|
kind: "message",
|
|
T: $mk78173(r1)
|
|
}, {
|
|
no: 6,
|
|
name: "help_article",
|
|
kind: "message",
|
|
T: $mk78174(r1)
|
|
}, {
|
|
no: 7,
|
|
name: "header_localized",
|
|
kind: "message",
|
|
T: $mk78175(r1)
|
|
}, {
|
|
no: 8,
|
|
name: "body_localized",
|
|
kind: "message",
|
|
T: $mk78176(r1)
|
|
}, {
|
|
no: 9,
|
|
name: "button_variant",
|
|
kind: "enum",
|
|
T: $mk78177(r1)
|
|
}];
|
|
super("discord_protos.premium_marketing.v1.MarketingPageBanner", r2);
|
|
}
|
|
create(a0) {
|
|
const r1 = {
|
|
assetUrl: "",
|
|
header: "",
|
|
body: "",
|
|
helpArticleId: "",
|
|
buttonVariant: 0
|
|
};
|
|
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 r12 = a3 == null ? this.create() : a3;
|
|
const r15 = a0.pos + a1;
|
|
while (a0.pos < r15) {
|
|
const [r26, r25] = a0.tag();
|
|
if (r26 === 1) {
|
|
r12.assetUrl = a0.string();
|
|
} else if (r26 === 2) {
|
|
r12.header = a0.string();
|
|
} else if (r26 === 3) {
|
|
r12.body = a0.string();
|
|
} else if (r26 === 4) {
|
|
r12.helpArticleId = a0.string();
|
|
} else if (r26 === 5) {
|
|
r12.button = CTAButton.internalBinaryRead(a0, a0.uint32(), a2, r12.button);
|
|
} else if (r26 === 6) {
|
|
r12.helpArticle = HelpArticle.internalBinaryRead(a0, a0.uint32(), a2, r12.helpArticle);
|
|
} else if (r26 === 7) {
|
|
r12.headerLocalized = LocalizedString.internalBinaryRead(a0, a0.uint32(), a2, r12.headerLocalized);
|
|
} else if (r26 === 8) {
|
|
r12.bodyLocalized = LocalizedString.internalBinaryRead(a0, a0.uint32(), a2, r12.bodyLocalized);
|
|
} else if (r26 === 9) {
|
|
r12.buttonVariant = a0.int32();
|
|
} else {
|
|
let readUnknownField = a2.readUnknownField;
|
|
if (readUnknownField === "throw") {
|
|
throw new globalThis.globalThis.Error(`Unknown field ${r26} (wire type ${r25}) for ${this.typeName}`);
|
|
}
|
|
const r41 = a0.skip(r25);
|
|
if (readUnknownField !== false) {
|
|
if (readUnknownField === true) {
|
|
readUnknownField = UnknownFieldHandler.onRead;
|
|
}
|
|
readUnknownField(this.typeName, r12, r26, r25, r41);
|
|
}
|
|
}
|
|
}
|
|
return r12;
|
|
}
|
|
internalBinaryWrite(a0, a1, a2) {
|
|
if (a0.assetUrl !== "") {
|
|
a1.tag(1, WireType.LengthDelimited).string(a0.assetUrl);
|
|
}
|
|
if (a0.header !== "") {
|
|
a1.tag(2, WireType.LengthDelimited).string(a0.header);
|
|
}
|
|
if (a0.body !== "") {
|
|
a1.tag(3, WireType.LengthDelimited).string(a0.body);
|
|
}
|
|
if (a0.helpArticleId !== "") {
|
|
a1.tag(4, WireType.LengthDelimited).string(a0.helpArticleId);
|
|
}
|
|
if (a0.button) {
|
|
CTAButton.internalBinaryWrite(a0.button, a1.tag(5, WireType.LengthDelimited).fork(), a2).join();
|
|
}
|
|
if (a0.helpArticle) {
|
|
HelpArticle.internalBinaryWrite(a0.helpArticle, a1.tag(6, WireType.LengthDelimited).fork(), a2).join();
|
|
}
|
|
if (a0.headerLocalized) {
|
|
LocalizedString.internalBinaryWrite(a0.headerLocalized, a1.tag(7, WireType.LengthDelimited).fork(), a2).join();
|
|
}
|
|
if (a0.bodyLocalized) {
|
|
LocalizedString.internalBinaryWrite(a0.bodyLocalized, a1.tag(8, WireType.LengthDelimited).fork(), a2).join();
|
|
}
|
|
if (a0.buttonVariant !== 0) {
|
|
a1.tag(9, WireType.Varint).int32(a0.buttonVariant);
|
|
}
|
|
let writeUnknownFields = a2.writeUnknownFields;
|
|
if (writeUnknownFields !== false) {
|
|
if (writeUnknownFields == 1) {
|
|
writeUnknownFields = UnknownFieldHandler.onWrite;
|
|
}
|
|
writeUnknownFields(this.typeName, a0, a1);
|
|
}
|
|
return a1;
|
|
}
|
|
}
|
|
c3988_4 = MarketingPageBanner$Type;
|
|
const prototypeOf = Object.getPrototypeOf(MarketingPageBanner$Type);
|
|
const r40 = [{
|
|
no: 1,
|
|
name: "asset_url",
|
|
kind: "scalar",
|
|
T: 9
|
|
}, {
|
|
no: 2,
|
|
name: "header",
|
|
kind: "scalar",
|
|
T: 9
|
|
}, {
|
|
no: 3,
|
|
name: "body",
|
|
kind: "scalar",
|
|
T: 9
|
|
}, {
|
|
no: 4,
|
|
name: "help_article_id",
|
|
kind: "scalar",
|
|
T: 9
|
|
}, {
|
|
no: 5,
|
|
name: "button",
|
|
kind: "message",
|
|
T: $mk78173(r4)
|
|
}, {
|
|
no: 6,
|
|
name: "help_article",
|
|
kind: "message",
|
|
T: $mk78174(r4)
|
|
}, {
|
|
no: 7,
|
|
name: "header_localized",
|
|
kind: "message",
|
|
T: $mk78175(r4)
|
|
}, {
|
|
no: 8,
|
|
name: "body_localized",
|
|
kind: "message",
|
|
T: $mk78176(r4)
|
|
}, {
|
|
no: 9,
|
|
name: "button_variant",
|
|
kind: "enum",
|
|
T: $mk78177(r4)
|
|
}];
|
|
const r53 = Object.create(MarketingPageBanner$Type.prototype);
|
|
const r54 = $callWithNewTarget(prototypeOf, r53, MarketingPageBanner$Type, "discord_protos.premium_marketing.v1.MarketingPageBanner", r40);
|
|
export { c3988_3 as MarketingPageBannerButtonVariant };
|
|
export const MarketingPageBanner = r54 instanceof Object ? r54 : r53;
|