@hiroosy/baileys-lite 0.3.3 → 0.3.5

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.
Files changed (242) hide show
  1. package/WAProto/index.js +247 -113252
  2. package/WAProto/parts/ADVDeviceIdentity.part +201 -0
  3. package/WAProto/parts/ADVEncryptionType.part +6 -0
  4. package/WAProto/parts/ADVKeyIndexList.part +201 -0
  5. package/WAProto/parts/ADVSignedDeviceIdentity.part +150 -0
  6. package/WAProto/parts/ADVSignedDeviceIdentityHMAC.part +142 -0
  7. package/WAProto/parts/ADVSignedKeyIndexList.part +128 -0
  8. package/WAProto/parts/AIHomeState.part +405 -0
  9. package/WAProto/parts/AIMediaCollectionMessage.part +119 -0
  10. package/WAProto/parts/AIMediaCollectionMetadata.part +100 -0
  11. package/WAProto/parts/AIMetadataOperation.part +83 -0
  12. package/WAProto/parts/AIQueryFanout.part +133 -0
  13. package/WAProto/parts/AIRegenerateMetadata.part +112 -0
  14. package/WAProto/parts/AIRichResponseCodeMetadata.part +252 -0
  15. package/WAProto/parts/AIRichResponseContentItemsMetadata.part +354 -0
  16. package/WAProto/parts/AIRichResponseDynamicMetadata.part +172 -0
  17. package/WAProto/parts/AIRichResponseGridImageMetadata.part +114 -0
  18. package/WAProto/parts/AIRichResponseImageURL.part +119 -0
  19. package/WAProto/parts/AIRichResponseInlineImageMetadata.part +164 -0
  20. package/WAProto/parts/AIRichResponseLatexMetadata.part +346 -0
  21. package/WAProto/parts/AIRichResponseMapMetadata.part +346 -0
  22. package/WAProto/parts/AIRichResponseMessage.part +167 -0
  23. package/WAProto/parts/AIRichResponseMessageType.part +5 -0
  24. package/WAProto/parts/AIRichResponseSubMessage.part +313 -0
  25. package/WAProto/parts/AIRichResponseSubMessageType.part +13 -0
  26. package/WAProto/parts/AIRichResponseTableMetadata.part +223 -0
  27. package/WAProto/parts/AIRichResponseUnifiedResponse.part +84 -0
  28. package/WAProto/parts/AISubscriptionRequestType.part +7 -0
  29. package/WAProto/parts/AISubscriptionUpsellMetadata.part +102 -0
  30. package/WAProto/parts/AIThreadInfo.part +316 -0
  31. package/WAProto/parts/Account.part +138 -0
  32. package/WAProto/parts/ActionLink.part +100 -0
  33. package/WAProto/parts/AutoDownloadSettings.part +138 -0
  34. package/WAProto/parts/AvatarUserSettings.part +100 -0
  35. package/WAProto/parts/BizAccountLinkInfo.part +210 -0
  36. package/WAProto/parts/BizAccountPayload.part +105 -0
  37. package/WAProto/parts/BizIdentityInfo.part +298 -0
  38. package/WAProto/parts/BotAgeCollectionMetadata.part +138 -0
  39. package/WAProto/parts/BotAgentDeepLinkMetadata.part +81 -0
  40. package/WAProto/parts/BotAgentMetadata.part +83 -0
  41. package/WAProto/parts/BotCapabilityMetadata.part +437 -0
  42. package/WAProto/parts/BotCommandMetadata.part +119 -0
  43. package/WAProto/parts/BotDocumentMessageMetadata.part +100 -0
  44. package/WAProto/parts/BotFeedbackMessage.part +1366 -0
  45. package/WAProto/parts/BotGroupMetadata.part +92 -0
  46. package/WAProto/parts/BotGroupParticipantMetadata.part +81 -0
  47. package/WAProto/parts/BotImagineMetadata.part +134 -0
  48. package/WAProto/parts/BotInfrastructureDiagnostics.part +148 -0
  49. package/WAProto/parts/BotLinkedAccount.part +95 -0
  50. package/WAProto/parts/BotLinkedAccountsMetadata.part +134 -0
  51. package/WAProto/parts/BotMediaMetadata.part +229 -0
  52. package/WAProto/parts/BotMemoryFact.part +100 -0
  53. package/WAProto/parts/BotMemoryMetadata.part +141 -0
  54. package/WAProto/parts/BotMemuMetadata.part +92 -0
  55. package/WAProto/parts/BotMessageOrigin.part +95 -0
  56. package/WAProto/parts/BotMessageOriginMetadata.part +92 -0
  57. package/WAProto/parts/BotMessageSharingInfo.part +297 -0
  58. package/WAProto/parts/BotMetadata.part +934 -0
  59. package/WAProto/parts/BotMetricsEntryPoint.part +51 -0
  60. package/WAProto/parts/BotMetricsMetadata.part +341 -0
  61. package/WAProto/parts/BotMetricsThreadEntryPoint.part +8 -0
  62. package/WAProto/parts/BotModeSelectionMetadata.part +151 -0
  63. package/WAProto/parts/BotModelMetadata.part +167 -0
  64. package/WAProto/parts/BotPluginMetadata.part +379 -0
  65. package/WAProto/parts/BotProgressIndicatorMetadata.part +837 -0
  66. package/WAProto/parts/BotPromotionMessageMetadata.part +124 -0
  67. package/WAProto/parts/BotPromptSuggestion.part +100 -0
  68. package/WAProto/parts/BotPromptSuggestions.part +92 -0
  69. package/WAProto/parts/BotPttPromptMetadata.part +81 -0
  70. package/WAProto/parts/BotQuotaMetadata.part +241 -0
  71. package/WAProto/parts/BotReminderMetadata.part +232 -0
  72. package/WAProto/parts/BotRenderingConfigMetadata.part +100 -0
  73. package/WAProto/parts/BotRenderingMetadata.part +203 -0
  74. package/WAProto/parts/BotResolvedToolCallMetadata.part +100 -0
  75. package/WAProto/parts/BotSessionMetadata.part +137 -0
  76. package/WAProto/parts/BotSessionSource.part +11 -0
  77. package/WAProto/parts/BotSignatureVerificationMetadata.part +92 -0
  78. package/WAProto/parts/BotSignatureVerificationUseCaseProof.part +183 -0
  79. package/WAProto/parts/BotSourcesMetadata.part +322 -0
  80. package/WAProto/parts/BotSuggestedPromptMetadata.part +150 -0
  81. package/WAProto/parts/BotUnifiedResponseMutation.part +339 -0
  82. package/WAProto/parts/CallLogRecord.part +646 -0
  83. package/WAProto/parts/CertChain.part +392 -0
  84. package/WAProto/parts/ChatLockSettings.part +102 -0
  85. package/WAProto/parts/ChatRowOpaqueData.part +712 -0
  86. package/WAProto/parts/Citation.part +119 -0
  87. package/WAProto/parts/ClientPairingProps.part +160 -0
  88. package/WAProto/parts/ClientPayload.part +2892 -0
  89. package/WAProto/parts/CollectionName.part +9 -0
  90. package/WAProto/parts/CommentMetadata.part +102 -0
  91. package/WAProto/parts/CompanionCommitment.part +84 -0
  92. package/WAProto/parts/CompanionEphemeralIdentity.part +227 -0
  93. package/WAProto/parts/Config.part +136 -0
  94. package/WAProto/parts/ContextInfo.part +4137 -0
  95. package/WAProto/parts/Conversation.part +1472 -0
  96. package/WAProto/parts/DeviceCapabilities.part +670 -0
  97. package/WAProto/parts/DeviceConsistencyCodeMessage.part +103 -0
  98. package/WAProto/parts/DeviceListMetadata.part +306 -0
  99. package/WAProto/parts/DeviceProps.part +982 -0
  100. package/WAProto/parts/DisappearingMode.part +206 -0
  101. package/WAProto/parts/EmbeddedContent.part +100 -0
  102. package/WAProto/parts/EmbeddedMessage.part +102 -0
  103. package/WAProto/parts/EmbeddedMusic.part +370 -0
  104. package/WAProto/parts/EncryptedPairingRequest.part +106 -0
  105. package/WAProto/parts/EphemeralSetting.part +110 -0
  106. package/WAProto/parts/EventAdditionalMetadata.part +81 -0
  107. package/WAProto/parts/EventResponse.part +152 -0
  108. package/WAProto/parts/ExitCode.part +110 -0
  109. package/WAProto/parts/ExternalBlobReference.part +195 -0
  110. package/WAProto/parts/Field.part +193 -0
  111. package/WAProto/parts/ForwardedAIBotMessageInfo.part +119 -0
  112. package/WAProto/parts/GlobalSettings.part +497 -0
  113. package/WAProto/parts/GroupHistoryBundleInfo.part +141 -0
  114. package/WAProto/parts/GroupHistoryIndividualMessageInfo.part +102 -0
  115. package/WAProto/parts/GroupMention.part +100 -0
  116. package/WAProto/parts/GroupParticipant.part +142 -0
  117. package/WAProto/parts/GroupRootKeyShare.part +92 -0
  118. package/WAProto/parts/GroupRootKeyShareEntry.part +161 -0
  119. package/WAProto/parts/HandshakeMessage.part +815 -0
  120. package/WAProto/parts/HatchMetadataSync.part +132 -0
  121. package/WAProto/parts/HistorySync.part +605 -0
  122. package/WAProto/parts/HistorySyncMsg.part +112 -0
  123. package/WAProto/parts/HydratedTemplateButton.part +501 -0
  124. package/WAProto/parts/IdentityKeyPairStructure.part +106 -0
  125. package/WAProto/parts/InThreadSurveyMetadata.part +779 -0
  126. package/WAProto/parts/InlineContact.part +157 -0
  127. package/WAProto/parts/InteractiveAnnotation.part +246 -0
  128. package/WAProto/parts/InteractiveMessageAdditionalMetadata.part +81 -0
  129. package/WAProto/parts/KeepInChat.part +225 -0
  130. package/WAProto/parts/KeepType.part +6 -0
  131. package/WAProto/parts/KeyExchangeMessage.part +169 -0
  132. package/WAProto/parts/KeyId.part +84 -0
  133. package/WAProto/parts/LIDMigrationMapping.part +149 -0
  134. package/WAProto/parts/LIDMigrationMappingSyncMessage.part +84 -0
  135. package/WAProto/parts/LIDMigrationMappingSyncPayload.part +122 -0
  136. package/WAProto/parts/LegacyMessage.part +104 -0
  137. package/WAProto/parts/LimitSharing.part +177 -0
  138. package/WAProto/parts/LocalizedName.part +119 -0
  139. package/WAProto/parts/Location.part +119 -0
  140. package/WAProto/parts/MediaData.part +81 -0
  141. package/WAProto/parts/MediaDomainInfo.part +120 -0
  142. package/WAProto/parts/MediaKeyDomain.part +6 -0
  143. package/WAProto/parts/MediaNotifyMessage.part +132 -0
  144. package/WAProto/parts/MediaRetryNotification.part +170 -0
  145. package/WAProto/parts/MediaVisibility.part +6 -0
  146. package/WAProto/parts/MemberLabel.part +110 -0
  147. package/WAProto/parts/Message.part +32376 -0
  148. package/WAProto/parts/MessageAddOn.part +305 -0
  149. package/WAProto/parts/MessageAddOnContextInfo.part +113 -0
  150. package/WAProto/parts/MessageAssociation.part +235 -0
  151. package/WAProto/parts/MessageContextInfo.part +451 -0
  152. package/WAProto/parts/MessageKey.part +138 -0
  153. package/WAProto/parts/MessageSecretMessage.part +125 -0
  154. package/WAProto/parts/Money.part +129 -0
  155. package/WAProto/parts/MsgOpaqueData.part +1732 -0
  156. package/WAProto/parts/MsgRowOpaqueData.part +104 -0
  157. package/WAProto/parts/MutationProps.part +89 -0
  158. package/WAProto/parts/NoiseCertificate.part +277 -0
  159. package/WAProto/parts/NotificationMessageInfo.part +152 -0
  160. package/WAProto/parts/NotificationSettings.part +176 -0
  161. package/WAProto/parts/PairingRequest.part +128 -0
  162. package/WAProto/parts/PastParticipant.part +148 -0
  163. package/WAProto/parts/PastParticipants.part +112 -0
  164. package/WAProto/parts/PatchDebugData.part +358 -0
  165. package/WAProto/parts/PaymentBackground.part +460 -0
  166. package/WAProto/parts/PaymentInfo.part +602 -0
  167. package/WAProto/parts/PhoneNumberToLIDMapping.part +100 -0
  168. package/WAProto/parts/PhotoChange.part +125 -0
  169. package/WAProto/parts/PinInChat.part +205 -0
  170. package/WAProto/parts/Point.part +138 -0
  171. package/WAProto/parts/PollAdditionalMetadata.part +216 -0
  172. package/WAProto/parts/PollEncValue.part +106 -0
  173. package/WAProto/parts/PollUpdate.part +202 -0
  174. package/WAProto/parts/PreKeyRecordStructure.part +125 -0
  175. package/WAProto/parts/PreKeySignalMessage.part +185 -0
  176. package/WAProto/parts/PremiumMessageInfo.part +81 -0
  177. package/WAProto/parts/PrimaryEphemeralIdentity.part +106 -0
  178. package/WAProto/parts/PrivacySystemMessage.part +6 -0
  179. package/WAProto/parts/ProcessedVideo.part +266 -0
  180. package/WAProto/parts/ProloguePayload.part +105 -0
  181. package/WAProto/parts/Pushname.part +100 -0
  182. package/WAProto/parts/QuarantinedMessage.part +103 -0
  183. package/WAProto/parts/Reaction.part +169 -0
  184. package/WAProto/parts/RecentEmojiWeight.part +100 -0
  185. package/WAProto/parts/RecordStructure.part +114 -0
  186. package/WAProto/parts/Reportable.part +138 -0
  187. package/WAProto/parts/ReportingTokenInfo.part +84 -0
  188. package/WAProto/parts/ScheduledMessageMetadata.part +132 -0
  189. package/WAProto/parts/SenderKeyDistributionMessage.part +144 -0
  190. package/WAProto/parts/SenderKeyMessage.part +122 -0
  191. package/WAProto/parts/SenderKeyRecordStructure.part +92 -0
  192. package/WAProto/parts/SenderKeyStateStructure.part +469 -0
  193. package/WAProto/parts/ServerErrorReceipt.part +81 -0
  194. package/WAProto/parts/SessionStructure.part +1087 -0
  195. package/WAProto/parts/SessionTransparencyMetadata.part +132 -0
  196. package/WAProto/parts/SessionTransparencyType.part +5 -0
  197. package/WAProto/parts/SignalMessage.part +144 -0
  198. package/WAProto/parts/SignedPreKeyRecordStructure.part +176 -0
  199. package/WAProto/parts/StatusAttribution.part +1235 -0
  200. package/WAProto/parts/StatusMentionMessage.part +83 -0
  201. package/WAProto/parts/StatusPSA.part +121 -0
  202. package/WAProto/parts/StickerMetadata.part +357 -0
  203. package/WAProto/parts/SyncActionData.part +146 -0
  204. package/WAProto/parts/SyncActionValue.part +12959 -0
  205. package/WAProto/parts/SyncdIndex.part +84 -0
  206. package/WAProto/parts/SyncdMutation.part +121 -0
  207. package/WAProto/parts/SyncdMutations.part +92 -0
  208. package/WAProto/parts/SyncdPatch.part +262 -0
  209. package/WAProto/parts/SyncdRecord.part +125 -0
  210. package/WAProto/parts/SyncdSnapshot.part +157 -0
  211. package/WAProto/parts/SyncdValue.part +84 -0
  212. package/WAProto/parts/SyncdVersion.part +91 -0
  213. package/WAProto/parts/TapLinkAction.part +100 -0
  214. package/WAProto/parts/TemplateButton.part +449 -0
  215. package/WAProto/parts/ThreadID.part +126 -0
  216. package/WAProto/parts/UrlTrackingMap.part +231 -0
  217. package/WAProto/parts/UserPassword.part +399 -0
  218. package/WAProto/parts/UserReceipt.part +221 -0
  219. package/WAProto/parts/VerifiedNameCertificate.part +318 -0
  220. package/WAProto/parts/WallpaperSettings.part +119 -0
  221. package/WAProto/parts/WebFeatures.part +1870 -0
  222. package/WAProto/parts/WebLinkRenderConfig.part +5 -0
  223. package/WAProto/parts/WebMessageInfo.part +2851 -0
  224. package/WAProto/parts/WebNotificationsInfo.part +160 -0
  225. package/package.json +1 -1
  226. package/src/binary/wa-binary.js +4 -2
  227. package/src/defaults.js +2 -1
  228. package/src/foundation/cache.js +99 -24
  229. package/src/foundation/memory.js +103 -0
  230. package/src/signal/libsignal.js +1 -8
  231. package/src/signal/signal-repository.js +6 -4
  232. package/src/socket/chats.js +2 -0
  233. package/src/socket/messages-recv.js +5 -3
  234. package/src/socket/messages-send.js +2 -2
  235. package/src/socket/socket-core.js +3 -0
  236. package/src/utils/auth-state-core.js +2 -1
  237. package/src/utils/chat-sync.js +4 -0
  238. package/src/utils/media.js +13 -8
  239. package/src/utils/message-processing.js +22 -6
  240. package/src/utils/wa-protocol-core.js +6 -5
  241. package/src/wam/wam-constants.js +22 -22851
  242. package/src/wam/wam-data.json +1 -0
@@ -0,0 +1,460 @@
1
+ "use strict";
2
+ function PaymentBackground(p) {
3
+ if (p)
4
+ for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
5
+ if (p[ks[i]] != null && ks[i] !== "__proto__")
6
+ this[ks[i]] = p[ks[i]];
7
+ }
8
+ PaymentBackground.prototype.id = null;
9
+ PaymentBackground.prototype.fileLength = null;
10
+ PaymentBackground.prototype.width = null;
11
+ PaymentBackground.prototype.height = null;
12
+ PaymentBackground.prototype.mimetype = null;
13
+ PaymentBackground.prototype.placeholderArgb = null;
14
+ PaymentBackground.prototype.textArgb = null;
15
+ PaymentBackground.prototype.subtextArgb = null;
16
+ PaymentBackground.prototype.mediaData = null;
17
+ PaymentBackground.prototype.type = null;
18
+ let $oneOfFields;
19
+ Object.defineProperty(PaymentBackground.prototype, "_id", {
20
+ get: $util.oneOfGetter($oneOfFields = ["id"]),
21
+ set: $util.oneOfSetter($oneOfFields)
22
+ });
23
+ Object.defineProperty(PaymentBackground.prototype, "_fileLength", {
24
+ get: $util.oneOfGetter($oneOfFields = ["fileLength"]),
25
+ set: $util.oneOfSetter($oneOfFields)
26
+ });
27
+ Object.defineProperty(PaymentBackground.prototype, "_width", {
28
+ get: $util.oneOfGetter($oneOfFields = ["width"]),
29
+ set: $util.oneOfSetter($oneOfFields)
30
+ });
31
+ Object.defineProperty(PaymentBackground.prototype, "_height", {
32
+ get: $util.oneOfGetter($oneOfFields = ["height"]),
33
+ set: $util.oneOfSetter($oneOfFields)
34
+ });
35
+ Object.defineProperty(PaymentBackground.prototype, "_mimetype", {
36
+ get: $util.oneOfGetter($oneOfFields = ["mimetype"]),
37
+ set: $util.oneOfSetter($oneOfFields)
38
+ });
39
+ Object.defineProperty(PaymentBackground.prototype, "_placeholderArgb", {
40
+ get: $util.oneOfGetter($oneOfFields = ["placeholderArgb"]),
41
+ set: $util.oneOfSetter($oneOfFields)
42
+ });
43
+ Object.defineProperty(PaymentBackground.prototype, "_textArgb", {
44
+ get: $util.oneOfGetter($oneOfFields = ["textArgb"]),
45
+ set: $util.oneOfSetter($oneOfFields)
46
+ });
47
+ Object.defineProperty(PaymentBackground.prototype, "_subtextArgb", {
48
+ get: $util.oneOfGetter($oneOfFields = ["subtextArgb"]),
49
+ set: $util.oneOfSetter($oneOfFields)
50
+ });
51
+ Object.defineProperty(PaymentBackground.prototype, "_mediaData", {
52
+ get: $util.oneOfGetter($oneOfFields = ["mediaData"]),
53
+ set: $util.oneOfSetter($oneOfFields)
54
+ });
55
+ Object.defineProperty(PaymentBackground.prototype, "_type", {
56
+ get: $util.oneOfGetter($oneOfFields = ["type"]),
57
+ set: $util.oneOfSetter($oneOfFields)
58
+ });
59
+ PaymentBackground.create = function create(properties) {
60
+ return new PaymentBackground(properties);
61
+ };
62
+ PaymentBackground.encode = function encode(m, w) {
63
+ if (!w)
64
+ w = $Writer.create();
65
+ if (m.id != null && Object.hasOwnProperty.call(m, "id"))
66
+ w.uint32(10).string(m.id);
67
+ if (m.fileLength != null && Object.hasOwnProperty.call(m, "fileLength"))
68
+ w.uint32(16).uint64(m.fileLength);
69
+ if (m.width != null && Object.hasOwnProperty.call(m, "width"))
70
+ w.uint32(24).uint32(m.width);
71
+ if (m.height != null && Object.hasOwnProperty.call(m, "height"))
72
+ w.uint32(32).uint32(m.height);
73
+ if (m.mimetype != null && Object.hasOwnProperty.call(m, "mimetype"))
74
+ w.uint32(42).string(m.mimetype);
75
+ if (m.placeholderArgb != null && Object.hasOwnProperty.call(m, "placeholderArgb"))
76
+ w.uint32(53).fixed32(m.placeholderArgb);
77
+ if (m.textArgb != null && Object.hasOwnProperty.call(m, "textArgb"))
78
+ w.uint32(61).fixed32(m.textArgb);
79
+ if (m.subtextArgb != null && Object.hasOwnProperty.call(m, "subtextArgb"))
80
+ w.uint32(69).fixed32(m.subtextArgb);
81
+ if (m.mediaData != null && Object.hasOwnProperty.call(m, "mediaData"))
82
+ $root.proto.PaymentBackground.MediaData.encode(m.mediaData, w.uint32(74).fork()).ldelim();
83
+ if (m.type != null && Object.hasOwnProperty.call(m, "type"))
84
+ w.uint32(80).int32(m.type);
85
+ return w;
86
+ };
87
+ PaymentBackground.decode = function decode(r, l, e, n) {
88
+ if (!(r instanceof $Reader))
89
+ r = $Reader.create(r);
90
+ if (n === undefined)
91
+ n = 0;
92
+ if (n > $Reader.recursionLimit)
93
+ throw Error("maximum nesting depth exceeded");
94
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PaymentBackground();
95
+ while (r.pos < c) {
96
+ var t = r.uint32();
97
+ if (t === e)
98
+ break;
99
+ switch (t >>> 3) {
100
+ case 1: {
101
+ m.id = r.string();
102
+ break;
103
+ }
104
+ case 2: {
105
+ m.fileLength = r.uint64();
106
+ break;
107
+ }
108
+ case 3: {
109
+ m.width = r.uint32();
110
+ break;
111
+ }
112
+ case 4: {
113
+ m.height = r.uint32();
114
+ break;
115
+ }
116
+ case 5: {
117
+ m.mimetype = r.string();
118
+ break;
119
+ }
120
+ case 6: {
121
+ m.placeholderArgb = r.fixed32();
122
+ break;
123
+ }
124
+ case 7: {
125
+ m.textArgb = r.fixed32();
126
+ break;
127
+ }
128
+ case 8: {
129
+ m.subtextArgb = r.fixed32();
130
+ break;
131
+ }
132
+ case 9: {
133
+ m.mediaData = $root.proto.PaymentBackground.MediaData.decode(r, r.uint32(), undefined, n + 1);
134
+ break;
135
+ }
136
+ case 10: {
137
+ m.type = r.int32();
138
+ break;
139
+ }
140
+ default:
141
+ r.skipType(t & 7, n);
142
+ break;
143
+ }
144
+ }
145
+ return m;
146
+ };
147
+ PaymentBackground.fromObject = function fromObject(d, n) {
148
+ if (d instanceof $root.proto.PaymentBackground)
149
+ return d;
150
+ if (n === undefined)
151
+ n = 0;
152
+ if (n > $util.recursionLimit)
153
+ throw Error("maximum nesting depth exceeded");
154
+ var m = new $root.proto.PaymentBackground();
155
+ if (d.id != null) {
156
+ m.id = String(d.id);
157
+ }
158
+ if (d.fileLength != null) {
159
+ if ($util.Long)
160
+ (m.fileLength = $util.Long.fromValue(d.fileLength)).unsigned = true;
161
+ else if (typeof d.fileLength === "string")
162
+ m.fileLength = parseInt(d.fileLength, 10);
163
+ else if (typeof d.fileLength === "number")
164
+ m.fileLength = d.fileLength;
165
+ else if (typeof d.fileLength === "object")
166
+ m.fileLength = new $util.LongBits(d.fileLength.low >>> 0, d.fileLength.high >>> 0).toNumber(true);
167
+ }
168
+ if (d.width != null) {
169
+ m.width = d.width >>> 0;
170
+ }
171
+ if (d.height != null) {
172
+ m.height = d.height >>> 0;
173
+ }
174
+ if (d.mimetype != null) {
175
+ m.mimetype = String(d.mimetype);
176
+ }
177
+ if (d.placeholderArgb != null) {
178
+ m.placeholderArgb = d.placeholderArgb >>> 0;
179
+ }
180
+ if (d.textArgb != null) {
181
+ m.textArgb = d.textArgb >>> 0;
182
+ }
183
+ if (d.subtextArgb != null) {
184
+ m.subtextArgb = d.subtextArgb >>> 0;
185
+ }
186
+ if (d.mediaData != null) {
187
+ if (typeof d.mediaData !== "object")
188
+ throw TypeError(".proto.PaymentBackground.mediaData: object expected");
189
+ m.mediaData = $root.proto.PaymentBackground.MediaData.fromObject(d.mediaData, n + 1);
190
+ }
191
+ switch (d.type) {
192
+ default:
193
+ if (typeof d.type === "number") {
194
+ m.type = d.type;
195
+ break;
196
+ }
197
+ break;
198
+ case "UNKNOWN":
199
+ case 0:
200
+ m.type = 0;
201
+ break;
202
+ case "DEFAULT":
203
+ case 1:
204
+ m.type = 1;
205
+ break;
206
+ }
207
+ return m;
208
+ };
209
+ PaymentBackground.toObject = function toObject(m, o) {
210
+ if (!o)
211
+ o = {};
212
+ var d = {};
213
+ if (m.id != null && m.hasOwnProperty("id")) {
214
+ d.id = m.id;
215
+ if (o.oneofs)
216
+ d._id = "id";
217
+ }
218
+ if (m.fileLength != null && m.hasOwnProperty("fileLength")) {
219
+ if (typeof m.fileLength === "number")
220
+ d.fileLength = o.longs === String ? String(m.fileLength) : m.fileLength;
221
+ else
222
+ d.fileLength = o.longs === String ? longToString(m.fileLength, true) : o.longs === Number ? longToNumber(m.fileLength, true) : m.fileLength;
223
+ if (o.oneofs)
224
+ d._fileLength = "fileLength";
225
+ }
226
+ if (m.width != null && m.hasOwnProperty("width")) {
227
+ d.width = m.width;
228
+ if (o.oneofs)
229
+ d._width = "width";
230
+ }
231
+ if (m.height != null && m.hasOwnProperty("height")) {
232
+ d.height = m.height;
233
+ if (o.oneofs)
234
+ d._height = "height";
235
+ }
236
+ if (m.mimetype != null && m.hasOwnProperty("mimetype")) {
237
+ d.mimetype = m.mimetype;
238
+ if (o.oneofs)
239
+ d._mimetype = "mimetype";
240
+ }
241
+ if (m.placeholderArgb != null && m.hasOwnProperty("placeholderArgb")) {
242
+ d.placeholderArgb = m.placeholderArgb;
243
+ if (o.oneofs)
244
+ d._placeholderArgb = "placeholderArgb";
245
+ }
246
+ if (m.textArgb != null && m.hasOwnProperty("textArgb")) {
247
+ d.textArgb = m.textArgb;
248
+ if (o.oneofs)
249
+ d._textArgb = "textArgb";
250
+ }
251
+ if (m.subtextArgb != null && m.hasOwnProperty("subtextArgb")) {
252
+ d.subtextArgb = m.subtextArgb;
253
+ if (o.oneofs)
254
+ d._subtextArgb = "subtextArgb";
255
+ }
256
+ if (m.mediaData != null && m.hasOwnProperty("mediaData")) {
257
+ d.mediaData = $root.proto.PaymentBackground.MediaData.toObject(m.mediaData, o);
258
+ if (o.oneofs)
259
+ d._mediaData = "mediaData";
260
+ }
261
+ if (m.type != null && m.hasOwnProperty("type")) {
262
+ d.type = o.enums === String ? $root.proto.PaymentBackground.Type[m.type] === undefined ? m.type : $root.proto.PaymentBackground.Type[m.type] : m.type;
263
+ if (o.oneofs)
264
+ d._type = "type";
265
+ }
266
+ return d;
267
+ };
268
+ PaymentBackground.prototype.toJSON = function toJSON() {
269
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
270
+ };
271
+ PaymentBackground.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
272
+ if (typeUrlPrefix === undefined) {
273
+ typeUrlPrefix = "type.googleapis.com";
274
+ }
275
+ return typeUrlPrefix + "/proto.PaymentBackground";
276
+ };
277
+ $lazy(PaymentBackground, "MediaData", function() {
278
+ function MediaData(p) {
279
+ if (p)
280
+ for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
281
+ if (p[ks[i]] != null && ks[i] !== "__proto__")
282
+ this[ks[i]] = p[ks[i]];
283
+ }
284
+ MediaData.prototype.mediaKey = null;
285
+ MediaData.prototype.mediaKeyTimestamp = null;
286
+ MediaData.prototype.fileSha256 = null;
287
+ MediaData.prototype.fileEncSha256 = null;
288
+ MediaData.prototype.directPath = null;
289
+ let $oneOfFields;
290
+ Object.defineProperty(MediaData.prototype, "_mediaKey", {
291
+ get: $util.oneOfGetter($oneOfFields = ["mediaKey"]),
292
+ set: $util.oneOfSetter($oneOfFields)
293
+ });
294
+ Object.defineProperty(MediaData.prototype, "_mediaKeyTimestamp", {
295
+ get: $util.oneOfGetter($oneOfFields = ["mediaKeyTimestamp"]),
296
+ set: $util.oneOfSetter($oneOfFields)
297
+ });
298
+ Object.defineProperty(MediaData.prototype, "_fileSha256", {
299
+ get: $util.oneOfGetter($oneOfFields = ["fileSha256"]),
300
+ set: $util.oneOfSetter($oneOfFields)
301
+ });
302
+ Object.defineProperty(MediaData.prototype, "_fileEncSha256", {
303
+ get: $util.oneOfGetter($oneOfFields = ["fileEncSha256"]),
304
+ set: $util.oneOfSetter($oneOfFields)
305
+ });
306
+ Object.defineProperty(MediaData.prototype, "_directPath", {
307
+ get: $util.oneOfGetter($oneOfFields = ["directPath"]),
308
+ set: $util.oneOfSetter($oneOfFields)
309
+ });
310
+ MediaData.create = function create(properties) {
311
+ return new MediaData(properties);
312
+ };
313
+ MediaData.encode = function encode(m, w) {
314
+ if (!w)
315
+ w = $Writer.create();
316
+ if (m.mediaKey != null && Object.hasOwnProperty.call(m, "mediaKey"))
317
+ w.uint32(10).bytes(m.mediaKey);
318
+ if (m.mediaKeyTimestamp != null && Object.hasOwnProperty.call(m, "mediaKeyTimestamp"))
319
+ w.uint32(16).int64(m.mediaKeyTimestamp);
320
+ if (m.fileSha256 != null && Object.hasOwnProperty.call(m, "fileSha256"))
321
+ w.uint32(26).bytes(m.fileSha256);
322
+ if (m.fileEncSha256 != null && Object.hasOwnProperty.call(m, "fileEncSha256"))
323
+ w.uint32(34).bytes(m.fileEncSha256);
324
+ if (m.directPath != null && Object.hasOwnProperty.call(m, "directPath"))
325
+ w.uint32(42).string(m.directPath);
326
+ return w;
327
+ };
328
+ MediaData.decode = function decode(r, l, e, n) {
329
+ if (!(r instanceof $Reader))
330
+ r = $Reader.create(r);
331
+ if (n === undefined)
332
+ n = 0;
333
+ if (n > $Reader.recursionLimit)
334
+ throw Error("maximum nesting depth exceeded");
335
+ var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PaymentBackground.MediaData();
336
+ while (r.pos < c) {
337
+ var t = r.uint32();
338
+ if (t === e)
339
+ break;
340
+ switch (t >>> 3) {
341
+ case 1: {
342
+ m.mediaKey = r.bytes();
343
+ break;
344
+ }
345
+ case 2: {
346
+ m.mediaKeyTimestamp = r.int64();
347
+ break;
348
+ }
349
+ case 3: {
350
+ m.fileSha256 = r.bytes();
351
+ break;
352
+ }
353
+ case 4: {
354
+ m.fileEncSha256 = r.bytes();
355
+ break;
356
+ }
357
+ case 5: {
358
+ m.directPath = r.string();
359
+ break;
360
+ }
361
+ default:
362
+ r.skipType(t & 7, n);
363
+ break;
364
+ }
365
+ }
366
+ return m;
367
+ };
368
+ MediaData.fromObject = function fromObject(d, n) {
369
+ if (d instanceof $root.proto.PaymentBackground.MediaData)
370
+ return d;
371
+ if (n === undefined)
372
+ n = 0;
373
+ if (n > $util.recursionLimit)
374
+ throw Error("maximum nesting depth exceeded");
375
+ var m = new $root.proto.PaymentBackground.MediaData();
376
+ if (d.mediaKey != null) {
377
+ if (typeof d.mediaKey === "string")
378
+ $util.base64.decode(d.mediaKey, m.mediaKey = $util.newBuffer($util.base64.length(d.mediaKey)), 0);
379
+ else if (d.mediaKey.length >= 0)
380
+ m.mediaKey = d.mediaKey;
381
+ }
382
+ if (d.mediaKeyTimestamp != null) {
383
+ if ($util.Long)
384
+ (m.mediaKeyTimestamp = $util.Long.fromValue(d.mediaKeyTimestamp)).unsigned = false;
385
+ else if (typeof d.mediaKeyTimestamp === "string")
386
+ m.mediaKeyTimestamp = parseInt(d.mediaKeyTimestamp, 10);
387
+ else if (typeof d.mediaKeyTimestamp === "number")
388
+ m.mediaKeyTimestamp = d.mediaKeyTimestamp;
389
+ else if (typeof d.mediaKeyTimestamp === "object")
390
+ m.mediaKeyTimestamp = new $util.LongBits(d.mediaKeyTimestamp.low >>> 0, d.mediaKeyTimestamp.high >>> 0).toNumber();
391
+ }
392
+ if (d.fileSha256 != null) {
393
+ if (typeof d.fileSha256 === "string")
394
+ $util.base64.decode(d.fileSha256, m.fileSha256 = $util.newBuffer($util.base64.length(d.fileSha256)), 0);
395
+ else if (d.fileSha256.length >= 0)
396
+ m.fileSha256 = d.fileSha256;
397
+ }
398
+ if (d.fileEncSha256 != null) {
399
+ if (typeof d.fileEncSha256 === "string")
400
+ $util.base64.decode(d.fileEncSha256, m.fileEncSha256 = $util.newBuffer($util.base64.length(d.fileEncSha256)), 0);
401
+ else if (d.fileEncSha256.length >= 0)
402
+ m.fileEncSha256 = d.fileEncSha256;
403
+ }
404
+ if (d.directPath != null) {
405
+ m.directPath = String(d.directPath);
406
+ }
407
+ return m;
408
+ };
409
+ MediaData.toObject = function toObject(m, o) {
410
+ if (!o)
411
+ o = {};
412
+ var d = {};
413
+ if (m.mediaKey != null && m.hasOwnProperty("mediaKey")) {
414
+ d.mediaKey = o.bytes === String ? $util.base64.encode(m.mediaKey, 0, m.mediaKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.mediaKey) : m.mediaKey;
415
+ if (o.oneofs)
416
+ d._mediaKey = "mediaKey";
417
+ }
418
+ if (m.mediaKeyTimestamp != null && m.hasOwnProperty("mediaKeyTimestamp")) {
419
+ if (typeof m.mediaKeyTimestamp === "number")
420
+ d.mediaKeyTimestamp = o.longs === String ? String(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
421
+ else
422
+ d.mediaKeyTimestamp = o.longs === String ? longToString(m.mediaKeyTimestamp) : o.longs === Number ? longToNumber(m.mediaKeyTimestamp) : m.mediaKeyTimestamp;
423
+ if (o.oneofs)
424
+ d._mediaKeyTimestamp = "mediaKeyTimestamp";
425
+ }
426
+ if (m.fileSha256 != null && m.hasOwnProperty("fileSha256")) {
427
+ d.fileSha256 = o.bytes === String ? $util.base64.encode(m.fileSha256, 0, m.fileSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileSha256) : m.fileSha256;
428
+ if (o.oneofs)
429
+ d._fileSha256 = "fileSha256";
430
+ }
431
+ if (m.fileEncSha256 != null && m.hasOwnProperty("fileEncSha256")) {
432
+ d.fileEncSha256 = o.bytes === String ? $util.base64.encode(m.fileEncSha256, 0, m.fileEncSha256.length) : o.bytes === Array ? Array.prototype.slice.call(m.fileEncSha256) : m.fileEncSha256;
433
+ if (o.oneofs)
434
+ d._fileEncSha256 = "fileEncSha256";
435
+ }
436
+ if (m.directPath != null && m.hasOwnProperty("directPath")) {
437
+ d.directPath = m.directPath;
438
+ if (o.oneofs)
439
+ d._directPath = "directPath";
440
+ }
441
+ return d;
442
+ };
443
+ MediaData.prototype.toJSON = function toJSON() {
444
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
445
+ };
446
+ MediaData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
447
+ if (typeUrlPrefix === undefined) {
448
+ typeUrlPrefix = "type.googleapis.com";
449
+ }
450
+ return typeUrlPrefix + "/proto.PaymentBackground.MediaData";
451
+ };
452
+ return MediaData;
453
+ });
454
+ $lazy(PaymentBackground, "Type", function() {
455
+ const valuesById = {}, values = Object.create(valuesById);
456
+ values[valuesById[0] = "UNKNOWN"] = 0;
457
+ values[valuesById[1] = "DEFAULT"] = 1;
458
+ return values;
459
+ });
460
+ return PaymentBackground;