const { c: e } = require("hyperschema/runtime"),
d = 5
let n = 5
const o = {
preencode(d, n) {
e.uint.preencode(d, n.clock)
},
encode(d, n) {
e.uint.encode(d, n.clock)
},
decode: (d) => ({ clock: e.uint.decode(d) }),
},
c = e.frame(o),
t = {
preencode(d, n) {
;(e.string.preencode(d, n.name), e.fixed32.preencode(d, n.publicKey), c.preencode(d, n.data))
},
encode(d, n) {
;(e.string.encode(d, n.name), e.fixed32.encode(d, n.publicKey), c.encode(d, n.data))
},
decode: (d) => ({
name: e.string.decode(d),
publicKey: e.fixed32.decode(d),
data: c.decode(d),
}),
},
r = c,
i = {
preencode(d, n) {
;(e.string.preencode(d, n.name),
e.fixed32.preencode(d, n.publicKey),
e.buffer.preencode(d, n.attestation),
r.preencode(d, n.data),
d.end++)
},
encode(d, n) {
const o = (n.deleted ? 1 : 0) | (n.skipNameValidation ? 2 : 0)
;(e.string.encode(d, n.name),
e.fixed32.encode(d, n.publicKey),
e.buffer.encode(d, n.attestation),
r.encode(d, n.data),
e.uint.encode(d, o))
},
decode(d) {
const n = e.string.decode(d),
o = e.fixed32.decode(d),
c = e.buffer.decode(d),
t = r.decode(d),
i = e.uint.decode(d)
return {
name: n,
publicKey: o,
attestation: c,
data: t,
deleted: !!(1 & i),
skipNameValidation: !!(2 & i),
}
},
},
a = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.key), e.uint.preencode(d, n.length))
},
encode(d, n) {
;(e.fixed32.encode(d, n.key), e.uint.encode(d, n.length))
},
decode: (d) => ({ key: e.fixed32.decode(d), length: e.uint.decode(d) }),
},
s = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.key), e.uint.preencode(d, n.seq))
},
encode(d, n) {
;(e.fixed32.encode(d, n.key), e.uint.encode(d, n.seq))
},
decode: (d) => ({ key: e.fixed32.decode(d), seq: e.uint.decode(d) }),
},
p = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.publicKey), e.fixed32.preencode(d, n.secretKey))
},
encode(d, n) {
;(e.fixed32.encode(d, n.publicKey), e.fixed32.encode(d, n.secretKey))
},
decode: (d) => ({ publicKey: e.fixed32.decode(d), secretKey: e.fixed32.decode(d) }),
},
u = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.publicKey), e.fixed64.preencode(d, n.secretKey))
},
encode(d, n) {
;(e.fixed32.encode(d, n.publicKey), e.fixed64.encode(d, n.secretKey))
},
decode: (d) => ({ publicKey: e.fixed32.decode(d), secretKey: e.fixed64.decode(d) }),
},
l = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.key),
d.end++,
n.encryptionKey && e.buffer.preencode(d, n.encryptionKey),
n.fastForwardTo && e.fixed32.preencode(d, n.fastForwardTo))
},
encode(d, n) {
const o = (n.encryptionKey ? 1 : 0) | (n.fastForwardTo ? 2 : 0)
;(e.fixed32.encode(d, n.key),
e.uint.encode(d, o),
n.encryptionKey && e.buffer.encode(d, n.encryptionKey),
n.fastForwardTo && e.fixed32.encode(d, n.fastForwardTo))
},
decode(d) {
const n = e.fixed32.decode(d),
o = e.uint.decode(d)
return {
key: n,
encryptionKey: 1 & o ? e.buffer.decode(d) : null,
fastForwardTo: 2 & o ? e.fixed32.decode(d) : null,
}
},
},
f = {
preencode(d, n) {
e.uint.preencode(d, n.timestamp)
},
encode(d, n) {
e.uint.encode(d, n.timestamp)
},
decode: (d) => ({ timestamp: e.uint.decode(d) }),
},
m = {
preencode(d, n) {
;(e.uint.preencode(d, n.blockOffset),
e.uint.preencode(d, n.blockLength),
e.uint.preencode(d, n.byteOffset),
e.uint.preencode(d, n.byteLength))
},
encode(d, n) {
;(e.uint.encode(d, n.blockOffset),
e.uint.encode(d, n.blockLength),
e.uint.encode(d, n.byteOffset),
e.uint.encode(d, n.byteLength))
},
decode: (d) => ({
blockOffset: e.uint.decode(d),
blockLength: e.uint.decode(d),
byteOffset: e.uint.decode(d),
byteLength: e.uint.decode(d),
}),
},
y = {
preencode(d, n) {
;(e.uint.preencode(d, n.width), e.uint.preencode(d, n.height))
},
encode(d, n) {
;(e.uint.encode(d, n.width), e.uint.encode(d, n.height))
},
decode: (d) => ({ width: e.uint.decode(d), height: e.uint.decode(d) }),
},
x = e.frame(y),
b = {
preencode(d, n) {
;(d.end++,
n.name && e.string.preencode(d, n.name),
n.mimetype && e.string.preencode(d, n.mimetype),
n.dimensions && x.preencode(d, n.dimensions),
n.userdata && e.buffer.preencode(d, n.userdata),
n.duration && e.uint.preencode(d, n.duration))
},
encode(d, n) {
const o =
(n.name ? 1 : 0) |
(n.mimetype ? 2 : 0) |
(n.dimensions ? 4 : 0) |
(n.userdata ? 8 : 0) |
(n.duration ? 16 : 0) |
(n.isPreview ? 32 : 0)
;(e.uint.encode(d, o),
n.name && e.string.encode(d, n.name),
n.mimetype && e.string.encode(d, n.mimetype),
n.dimensions && x.encode(d, n.dimensions),
n.userdata && e.buffer.encode(d, n.userdata),
n.duration && e.uint.encode(d, n.duration))
},
decode(d) {
const n = e.uint.decode(d)
return {
name: 1 & n ? e.string.decode(d) : null,
mimetype: 2 & n ? e.string.decode(d) : null,
dimensions: 4 & n ? x.decode(d) : null,
userdata: 8 & n ? e.buffer.decode(d) : null,
duration: 16 & n ? e.uint.decode(d) : 0,
isPreview: !!(32 & n),
}
},
},
k = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.key),
e.string.preencode(d, n.path),
e.uint.preencode(d, n.version),
e.uint.preencode(d, n.size))
},
encode(d, n) {
;(e.fixed32.encode(d, n.key),
e.string.encode(d, n.path),
e.uint.encode(d, n.version),
e.uint.encode(d, n.size))
},
decode: (d) => ({
key: e.fixed32.decode(d),
path: e.string.decode(d),
version: e.uint.decode(d),
size: e.uint.decode(d),
}),
},
g = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.key), m.preencode(d, n.blob))
},
encode(d, n) {
;(e.fixed32.encode(d, n.key), m.encode(d, n.blob))
},
decode: (d) => ({ key: e.fixed32.decode(d), blob: m.decode(d) }),
},
v = e.frame(g),
h = e.frame(k),
K = {
preencode(d, n) {
;(d.end++,
n.inlined && e.buffer.preencode(d, n.inlined),
n.blob && m.preencode(d, n.blob),
n.externalBlob && v.preencode(d, n.externalBlob),
n.externalDrive && h.preencode(d, n.externalDrive))
},
encode(d, n) {
const o =
(n.inlined ? 1 : 0) |
(n.blob ? 2 : 0) |
(n.externalBlob ? 4 : 0) |
(n.externalDrive ? 8 : 0)
;(e.uint.encode(d, o),
n.inlined && e.buffer.encode(d, n.inlined),
n.blob && m.encode(d, n.blob),
n.externalBlob && v.encode(d, n.externalBlob),
n.externalDrive && h.encode(d, n.externalDrive))
},
decode(d) {
const n = e.uint.decode(d)
return {
inlined: 1 & n ? e.buffer.decode(d) : null,
blob: 2 & n ? m.decode(d) : null,
externalBlob: 4 & n ? v.decode(d) : null,
externalDrive: 8 & n ? h.decode(d) : null,
}
},
},
w = e.frame(K),
P = e.frame(b),
T = {
preencode(d, n) {
;(w.preencode(d, n.pointer),
d.end++,
n.metadata && P.preencode(d, n.metadata),
n.preview && It.preencode(d, n.preview),
n.hash && e.fixed32.preencode(d, n.hash))
},
encode(d, n) {
const o = (n.metadata ? 1 : 0) | (n.preview ? 2 : 0) | (n.hash ? 4 : 0)
;(w.encode(d, n.pointer),
e.uint.encode(d, o),
n.metadata && P.encode(d, n.metadata),
n.preview && It.encode(d, n.preview),
n.hash && e.fixed32.encode(d, n.hash))
},
decode(d) {
const n = w.decode(d),
o = e.uint.decode(d)
return {
pointer: n,
metadata: 1 & o ? P.decode(d) : null,
preview: 2 & o ? It.decode(d) : null,
hash: 4 & o ? e.fixed32.decode(d) : null,
}
},
},
A = e.frame(T),
R = A,
C = A,
M = {
preencode(e, d) {
;(e.end++,
d.small && A.preencode(e, d.small),
d.medium && R.preencode(e, d.medium),
d.large && C.preencode(e, d.large))
},
encode(d, n) {
const o = (n.small ? 1 : 0) | (n.medium ? 2 : 0) | (n.large ? 4 : 0)
;(e.uint.encode(d, o),
n.small && A.encode(d, n.small),
n.medium && R.encode(d, n.medium),
n.large && C.encode(d, n.large))
},
decode(d) {
const n = e.uint.decode(d)
return {
small: 1 & n ? A.decode(d) : null,
medium: 2 & n ? R.decode(d) : null,
large: 4 & n ? C.decode(d) : null,
}
},
},
q = {
preencode(e, d) {
e.end++
},
encode(d, n) {
const o = n.isDeleted ? 1 : 0
e.uint.encode(d, o)
},
decode: (d) => ({ isDeleted: !!(1 & e.uint.decode(d)) }),
},
L = e.frame(q),
S = A,
D = {
preencode(d, o) {
;(e.uint.preencode(d, o.id),
s.preencode(d, o.oplog),
L.preencode(d, o.status),
S.preencode(d, o.file),
d.end++,
n >= 5 && o.version && e.uint.preencode(d, o.version))
},
encode(d, o) {
const c = n >= 5 && o.version ? 1 : 0
;(e.uint.encode(d, o.id),
s.encode(d, o.oplog),
L.encode(d, o.status),
S.encode(d, o.file),
e.uint.encode(d, c),
n >= 5 && o.version && e.uint.encode(d, o.version))
},
decode(d) {
const o = e.uint.decode(d),
c = s.decode(d),
t = L.decode(d),
r = S.decode(d),
i = d.start < d.end ? e.uint.decode(d) : 0
return {
id: o,
oplog: c,
status: t,
file: r,
version: n >= 5 && 1 & i ? e.uint.decode(d) : 0,
}
},
},
F = {
preencode(e, d) {
e.end++
},
encode(d, n) {
const o = (n.isActive ? 1 : 0) | (n.isIndexing ? 2 : 0)
e.uint.encode(d, o)
},
decode(d) {
const n = e.uint.decode(d)
return { isActive: !!(1 & n), isIndexing: !!(2 & n) }
},
},
B = {
preencode(d, o) {
const c =
(o.isAdmin ? 1 : 0) |
(o.isModerator ? 2 : 0) |
(o.isPending ? 4 : 0) |
(o.isActive ? 8 : 0) |
(o.isMuted ? 16 : 0) |
(o.isBanned ? 32 : 0) |
(o.isShadowBanned ? 64 : 0) |
(n >= 3 && o.isRemoved ? 128 : 0)
e.uint.preencode(d, c)
},
encode(d, o) {
const c =
(o.isAdmin ? 1 : 0) |
(o.isModerator ? 2 : 0) |
(o.isPending ? 4 : 0) |
(o.isActive ? 8 : 0) |
(o.isMuted ? 16 : 0) |
(o.isBanned ? 32 : 0) |
(o.isShadowBanned ? 64 : 0) |
(n >= 3 && o.isRemoved ? 128 : 0)
e.uint.encode(d, c)
},
decode(d) {
const o = e.uint.decode(d)
return {
isAdmin: !!(1 & o),
isModerator: !!(2 & o),
isPending: !!(4 & o),
isActive: !!(8 & o),
isMuted: !!(16 & o),
isBanned: !!(32 & o),
isShadowBanned: !!(64 & o),
isRemoved: n >= 3 && !!(128 & o),
}
},
},
E = {
preencode(e, d) {
e.end++
},
encode(d, n) {
const o = (n.isMuted ? 1 : 0) | (n.isBanned ? 2 : 0) | (n.isShadowBanned ? 4 : 0)
e.uint.encode(d, o)
},
decode(d) {
const n = e.uint.decode(d)
return { isMuted: !!(1 & n), isBanned: !!(2 & n), isShadowBanned: !!(4 & n) }
},
},
I = {
preencode(d, n) {
e.uint.preencode(d, n.version)
},
encode(d, n) {
e.uint.encode(d, n.version)
},
decode: (d) => ({ version: e.uint.decode(d) }),
},
N = {
preencode(d, n) {
;(e.uint.preencode(d, n.total), e.uint.preencode(d, n.active))
},
encode(d, n) {
;(e.uint.encode(d, n.total), e.uint.encode(d, n.active))
},
decode: (d) => ({ total: e.uint.decode(d), active: e.uint.decode(d) }),
},
j = {
preencode(d, n) {
;(e.uint.preencode(d, n.total), e.uint.preencode(d, n.active), e.uint.preencode(d, n.pending))
},
encode(d, n) {
;(e.uint.encode(d, n.total), e.uint.encode(d, n.active), e.uint.encode(d, n.pending))
},
decode: (d) => ({
total: e.uint.decode(d),
active: e.uint.decode(d),
pending: e.uint.decode(d),
}),
},
O = {
preencode(d, o) {
;(e.uint.preencode(d, o.clock),
e.uint.preencode(d, o.pinned),
e.uint.preencode(d, o.threads),
e.uint.preencode(d, o.timestamp),
d.end++,
n >= 5 && o.flagsClock && e.uint.preencode(d, o.flagsClock))
},
encode(d, o) {
const c = n >= 5 && o.flagsClock ? 1 : 0
;(e.uint.encode(d, o.clock),
e.uint.encode(d, o.pinned),
e.uint.encode(d, o.threads),
e.uint.encode(d, o.timestamp),
e.uint.encode(d, c),
n >= 5 && o.flagsClock && e.uint.encode(d, o.flagsClock))
},
decode(d) {
const o = e.uint.decode(d),
c = e.uint.decode(d),
t = e.uint.decode(d),
r = e.uint.decode(d),
i = d.start < d.end ? e.uint.decode(d) : 0
return {
clock: o,
pinned: c,
threads: t,
timestamp: r,
flagsClock: n >= 5 && 1 & i ? e.uint.decode(d) : 0,
}
},
},
J = o,
U = e.frame(N),
V = e.frame(j),
H = e.frame(O),
z = e.frame(J),
G = {
preencode(e, d) {
;(U.preencode(e, d.devices),
V.preencode(e, d.members),
H.preencode(e, d.chat),
z.preencode(e, d.files))
},
encode(e, d) {
;(U.encode(e, d.devices), V.encode(e, d.members), H.encode(e, d.chat), z.encode(e, d.files))
},
decode: (e) => ({
devices: U.decode(e),
members: V.decode(e),
chat: H.decode(e),
files: z.decode(e),
}),
},
Q = { Default: 1, Broadcast: 2, DirectMessage: 3 },
W = {
preencode(e, d) {
e.end++
},
encode(d, n) {
if (n > 3) throw new Error("Unknown enum")
e.uint.encode(d, n)
},
decode: (d) => e.uint.decode(d),
},
X = {
preencode(e, d) {
;(e.end++, d.roomType && W.preencode(e, d.roomType))
},
encode(d, n) {
const o =
(n.roomType ? 1 : 0) |
(n.isExperimental ? 2 : 0) |
(n.isJoiningDisabled ? 4 : 0) |
(n.isAppendingDisabled ? 8 : 0) |
(n.isCallingDisabled ? 16 : 0) |
(n.isMembershipEventsDisabled ? 32 : 0)
;(e.uint.encode(d, o), n.roomType && W.encode(d, n.roomType))
},
decode(d) {
const n = e.uint.decode(d)
return {
roomType: 1 & n ? W.decode(d) : 0,
isExperimental: !!(2 & n),
isJoiningDisabled: !!(4 & n),
isAppendingDisabled: !!(8 & n),
isCallingDisabled: !!(16 & n),
isMembershipEventsDisabled: !!(32 & n),
}
},
},
Y = e.frame(I),
Z = e.frame(X),
$ = {
preencode(d, n) {
;(Y.preencode(d, n.abi), Z.preencode(d, n.settings), e.uint.preencode(d, n.creationTime))
},
encode(d, n) {
;(Y.encode(d, n.abi), Z.encode(d, n.settings), e.uint.encode(d, n.creationTime))
},
decode: (d) => ({ abi: Y.decode(d), settings: Z.decode(d), creationTime: e.uint.decode(d) }),
},
_ = {
preencode(d, n) {
e.fixed32.preencode(d, n.seed)
},
encode(d, n) {
e.fixed32.encode(d, n.seed)
},
decode: (d) => ({ seed: e.fixed32.decode(d) }),
},
ee = {
preencode(d, n) {
;(p.preencode(d, n.mailboxKeyPair),
u.preencode(d, n.discoveryKeyPair),
e.fixed32.preencode(d, n.wakeupTopic),
e.fixed32.preencode(d, n.swarmTopic))
},
encode(d, n) {
;(p.encode(d, n.mailboxKeyPair),
u.encode(d, n.discoveryKeyPair),
e.fixed32.encode(d, n.wakeupTopic),
e.fixed32.encode(d, n.swarmTopic))
},
decode: (d) => ({
mailboxKeyPair: p.decode(d),
discoveryKeyPair: u.decode(d),
wakeupTopic: e.fixed32.decode(d),
swarmTopic: e.fixed32.decode(d),
}),
},
de = e.array(e.fixed32),
ne = {
preencode(d, o) {
;(d.end++,
o.title && e.string.preencode(d, o.title),
o.avatar && Nt.preencode(d, o.avatar),
o.description && e.string.preencode(d, o.description),
n >= 2 && o.supportedLanguages && jt.preencode(d, o.supportedLanguages),
n >= 3 && o.blindPeers && de.preencode(d, o.blindPeers))
},
encode(d, o) {
const c =
(o.title ? 1 : 0) |
(o.avatar ? 2 : 0) |
(o.description ? 4 : 0) |
(n >= 2 && o.supportedLanguages ? 8 : 0) |
(n >= 3 && o.blindPeers ? 16 : 0)
;(e.uint.encode(d, c),
o.title && e.string.encode(d, o.title),
o.avatar && Nt.encode(d, o.avatar),
o.description && e.string.encode(d, o.description),
n >= 2 && o.supportedLanguages && jt.encode(d, o.supportedLanguages),
n >= 3 && o.blindPeers && de.encode(d, o.blindPeers))
},
decode(d) {
const o = e.uint.decode(d)
return {
title: 1 & o ? e.string.decode(d) : null,
avatar: 2 & o ? Nt.decode(d) : null,
description: 4 & o ? e.string.decode(d) : null,
supportedLanguages: n >= 2 && 8 & o ? jt.decode(d) : null,
blindPeers: n >= 3 && 16 & o ? de.decode(d) : null,
}
},
},
oe = {
preencode(d, n) {
e.fixed32.preencode(d, n.key)
},
encode(d, n) {
e.fixed32.encode(d, n.key)
},
decode: (d) => ({ key: e.fixed32.decode(d) }),
},
ce = e.frame(f),
te = e.frame(oe),
re = {
preencode(e, d) {
;(ce.preencode(e, d.header), te.preencode(e, d.peer))
},
encode(e, d) {
;(ce.encode(e, d.header), te.encode(e, d.peer))
},
decode: (e) => ({ header: ce.decode(e), peer: te.decode(e) }),
},
ie = ce,
ae = {
preencode(d, n) {
;(ie.preencode(d, n.header), e.fixed32.preencode(d, n.key))
},
encode(d, n) {
;(ie.encode(d, n.header), e.fixed32.encode(d, n.key))
},
decode: (d) => ({ header: ie.decode(d), key: e.fixed32.decode(d) }),
},
se = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.memberKey), e.buffer.preencode(d, n.proof))
},
encode(d, n) {
;(e.fixed32.encode(d, n.memberKey), e.buffer.encode(d, n.proof))
},
decode: (d) => ({ memberKey: e.fixed32.decode(d), proof: e.buffer.decode(d) }),
},
pe = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.id), e.buffer.preencode(d, n.response))
},
encode(d, n) {
;(e.fixed32.encode(d, n.id), e.buffer.encode(d, n.response))
},
decode: (d) => ({ id: e.fixed32.decode(d), response: e.buffer.decode(d) }),
},
ue = e.frame(F),
le = e.frame(pe),
fe = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.key),
e.fixed32.preencode(d, n.memberKey),
ue.preencode(d, n.status),
Ot.preencode(d, n.profile),
d.end++,
n.invitation && le.preencode(d, n.invitation))
},
encode(d, n) {
const o = n.invitation ? 1 : 0
;(e.fixed32.encode(d, n.key),
e.fixed32.encode(d, n.memberKey),
ue.encode(d, n.status),
Ot.encode(d, n.profile),
e.uint.encode(d, o),
n.invitation && le.encode(d, n.invitation))
},
decode: (d) => ({
key: e.fixed32.decode(d),
memberKey: e.fixed32.decode(d),
status: ue.decode(d),
profile: Ot.decode(d),
invitation: 1 & e.uint.decode(d) ? le.decode(d) : null,
}),
},
me = {
preencode(d, n) {
;(e.uint.preencode(d, n.timestamp),
d.end++,
n.mailbox && e.fixed32.preencode(d, n.mailbox),
n.displayName && e.string.preencode(d, n.displayName),
n.avatar && Jt.preencode(d, n.avatar),
n.username && e.string.preencode(d, n.username))
},
encode(d, n) {
const o =
(n.mailbox ? 1 : 0) | (n.displayName ? 2 : 0) | (n.avatar ? 4 : 0) | (n.username ? 8 : 0)
;(e.uint.encode(d, n.timestamp),
e.uint.encode(d, o),
n.mailbox && e.fixed32.encode(d, n.mailbox),
n.displayName && e.string.encode(d, n.displayName),
n.avatar && Jt.encode(d, n.avatar),
n.username && e.string.encode(d, n.username))
},
decode(d) {
const n = e.uint.decode(d),
o = e.uint.decode(d)
return {
timestamp: n,
mailbox: 1 & o ? e.fixed32.decode(d) : null,
displayName: 2 & o ? e.string.decode(d) : null,
avatar: 4 & o ? Jt.decode(d) : null,
username: 8 & o ? e.string.decode(d) : null,
}
},
},
ye = {
preencode(d, n) {
;(d.end++,
n.swarmKey && e.fixed32.preencode(d, n.swarmKey),
n.name && e.string.preencode(d, n.name))
},
encode(d, n) {
const o = (n.swarmKey ? 1 : 0) | (n.name ? 2 : 0) | (n.isMobile ? 4 : 0)
;(e.uint.encode(d, o),
n.swarmKey && e.fixed32.encode(d, n.swarmKey),
n.name && e.string.encode(d, n.name))
},
decode(d) {
const n = e.uint.decode(d)
return {
swarmKey: 1 & n ? e.fixed32.decode(d) : null,
name: 2 & n ? e.string.decode(d) : null,
isMobile: !!(4 & n),
}
},
},
xe = e.frame(me),
be = {
preencode(e, d) {
;(xe.preencode(e, d.profile), se.preencode(e, d.attestation))
},
encode(e, d) {
;(xe.encode(e, d.profile), se.encode(e, d.attestation))
},
decode: (e) => ({ profile: xe.decode(e), attestation: se.decode(e) }),
},
ke = {
preencode(e, d) {
;(Ut.preencode(e, d.profile), se.preencode(e, d.attestation))
},
encode(e, d) {
;(Ut.encode(e, d.profile), se.encode(e, d.attestation))
},
decode: (e) => ({ profile: Ut.decode(e), attestation: se.decode(e) }),
},
ge = xe,
ve = {
preencode(e, d) {
;(ge.preencode(e, d.profile), se.preencode(e, d.attestation))
},
encode(e, d) {
;(ge.encode(e, d.profile), se.encode(e, d.attestation))
},
decode: (e) => ({ profile: ge.decode(e), attestation: se.decode(e) }),
},
he = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.id),
e.buffer.preencode(d, n.data),
e.buffer.preencode(d, n.signature))
},
encode(d, n) {
;(e.fixed32.encode(d, n.id), e.buffer.encode(d, n.data), e.buffer.encode(d, n.signature))
},
decode: (d) => ({
id: e.fixed32.decode(d),
data: e.buffer.decode(d),
signature: e.buffer.decode(d),
}),
},
Ke = {
preencode(d, n) {
e.fixed32.preencode(d, n.devicePublicKey)
},
encode(d, n) {
e.fixed32.encode(d, n.devicePublicKey)
},
decode: (d) => ({ devicePublicKey: e.fixed32.decode(d) }),
},
we = {
preencode(d, n) {
;(se.preencode(d, n.privateProfileIdentity), e.buffer.preencode(d, n.deviceProof))
},
encode(d, n) {
;(se.encode(d, n.privateProfileIdentity), e.buffer.encode(d, n.deviceProof))
},
decode: (d) => ({ privateProfileIdentity: se.decode(d), deviceProof: e.buffer.decode(d) }),
},
Pe = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.deviceKey),
se.preencode(d, n.privateProfileIdentity),
e.buffer.preencode(d, n.deviceProof))
},
encode(d, n) {
;(e.fixed32.encode(d, n.deviceKey),
se.encode(d, n.privateProfileIdentity),
e.buffer.encode(d, n.deviceProof))
},
decode: (d) => ({
deviceKey: e.fixed32.decode(d),
privateProfileIdentity: se.decode(d),
deviceProof: e.buffer.decode(d),
}),
},
Te = e.frame(ke),
Ae = e.frame(be),
Re = e.frame(Ke),
Ce = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.deviceKey),
u.preencode(d, n.keyPair),
Te.preencode(d, n.device),
Ae.preencode(d, n.member),
d.end++,
n.identity && Re.preencode(d, n.identity))
},
encode(d, n) {
const o = n.identity ? 1 : 0
;(e.fixed32.encode(d, n.deviceKey),
u.encode(d, n.keyPair),
Te.encode(d, n.device),
Ae.encode(d, n.member),
e.uint.encode(d, o),
n.identity && Re.encode(d, n.identity))
},
decode: (d) => ({
deviceKey: e.fixed32.decode(d),
keyPair: u.decode(d),
device: Te.decode(d),
member: Ae.decode(d),
identity: 1 & e.uint.decode(d) ? Re.decode(d) : null,
}),
},
Me = e.frame(Ce),
qe = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.id),
Me.preencode(d, n.request),
e.buffer.preencode(d, n.signature))
},
encode(d, n) {
;(e.fixed32.encode(d, n.id), Me.encode(d, n.request), e.buffer.encode(d, n.signature))
},
decode: (d) => ({
id: e.fixed32.decode(d),
request: Me.decode(d),
signature: e.buffer.decode(d),
}),
},
Le = Te,
Se = Ae,
De = {
preencode(e, d) {
;(Le.preencode(e, d.device), e.end++, d.member && Se.preencode(e, d.member))
},
encode(d, n) {
const o = n.member ? 1 : 0
;(Le.encode(d, n.device), e.uint.encode(d, o), n.member && Se.encode(d, n.member))
},
decode: (d) => ({ device: Le.decode(d), member: 1 & e.uint.decode(d) ? Se.decode(d) : null }),
},
Fe = e.frame(qe),
Be = e.frame(De),
Ee = {
preencode(e, d) {
;(e.end++,
d.withInvitation && Fe.preencode(e, d.withInvitation),
d.withMemberProof && Be.preencode(e, d.withMemberProof))
},
encode(d, n) {
const o = (n.withInvitation ? 1 : 0) | (n.withMemberProof ? 2 : 0)
;(e.uint.encode(d, o),
n.withInvitation && Fe.encode(d, n.withInvitation),
n.withMemberProof && Be.encode(d, n.withMemberProof))
},
decode(d) {
const n = e.uint.decode(d)
return {
withInvitation: 1 & n ? Fe.decode(d) : null,
withMemberProof: 2 & n ? Be.decode(d) : null,
}
},
},
Ie = e.frame(he),
Ne = e.frame(we),
je = {
preencode(e, d) {
;(Ie.preencode(e, d.signedKeys), e.end++, d.identity && Ne.preencode(e, d.identity))
},
encode(d, n) {
const o = n.identity ? 1 : 0
;(Ie.encode(d, n.signedKeys), e.uint.encode(d, o), n.identity && Ne.encode(d, n.identity))
},
decode: (d) => ({
signedKeys: Ie.decode(d),
identity: 1 & e.uint.decode(d) ? Ne.decode(d) : null,
}),
},
Oe = {
preencode(d, n) {
;(d.end++, n.expiration && e.uint.preencode(d, n.expiration))
},
encode(d, n) {
const o =
(n.expiration ? 1 : 0) |
(n.requiresConfirmation ? 2 : 0) |
(n.canModerate ? 4 : 0) |
(n.canAdmin ? 8 : 0)
;(e.uint.encode(d, o), n.expiration && e.uint.encode(d, n.expiration))
},
decode(d) {
const n = e.uint.decode(d)
return {
expiration: 1 & n ? e.uint.decode(d) : 0,
requiresConfirmation: !!(2 & n),
canModerate: !!(4 & n),
canAdmin: !!(8 & n),
}
},
},
Je = Ie,
Ue = e.frame(Oe),
Ve = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.id),
Je.preencode(d, n.response),
Ue.preencode(d, n.metadata),
d.end++,
n.anchor && a.preencode(d, n.anchor))
},
encode(d, n) {
const o = (n.anchor ? 1 : 0) | (n.isActive ? 2 : 0)
;(e.fixed32.encode(d, n.id),
Je.encode(d, n.response),
Ue.encode(d, n.metadata),
e.uint.encode(d, o),
n.anchor && a.encode(d, n.anchor))
},
decode(d) {
const n = e.fixed32.decode(d),
o = Je.decode(d),
c = Ue.decode(d),
t = e.uint.decode(d)
return {
id: n,
response: o,
metadata: c,
anchor: 1 & t ? a.decode(d) : null,
isActive: !!(2 & t),
}
},
},
He = ce,
ze = e.frame(Ve),
Ge = {
preencode(e, d) {
;(He.preencode(e, d.header), ze.preencode(e, d.invitation))
},
encode(e, d) {
;(He.encode(e, d.header), ze.encode(e, d.invitation))
},
decode: (e) => ({ header: He.decode(e), invitation: ze.decode(e) }),
},
Qe = ce,
We = {
preencode(d, n) {
;(Qe.preencode(d, n.header), e.fixed32.preencode(d, n.id))
},
encode(d, n) {
;(Qe.encode(d, n.header), e.fixed32.encode(d, n.id))
},
decode: (d) => ({ header: Qe.decode(d), id: e.fixed32.decode(d) }),
},
Xe = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.mailbox),
e.fixed32.preencode(d, n.invitationSeed),
a.preencode(d, n.anchor))
},
encode(d, n) {
;(e.fixed32.encode(d, n.mailbox),
e.fixed32.encode(d, n.invitationSeed),
a.encode(d, n.anchor))
},
decode: (d) => ({
mailbox: e.fixed32.decode(d),
invitationSeed: e.fixed32.decode(d),
anchor: a.decode(d),
}),
},
Ye = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.roomKey),
e.fixed32.preencode(d, n.encryptionKey),
e.fixed32.preencode(d, n.seed),
d.end++,
n.fastForwardTo && e.fixed32.preencode(d, n.fastForwardTo))
},
encode(d, n) {
const o = n.fastForwardTo ? 1 : 0
;(e.fixed32.encode(d, n.roomKey),
e.fixed32.encode(d, n.encryptionKey),
e.fixed32.encode(d, n.seed),
e.uint.encode(d, o),
n.fastForwardTo && e.fixed32.encode(d, n.fastForwardTo))
},
decode: (d) => ({
roomKey: e.fixed32.decode(d),
encryptionKey: e.fixed32.decode(d),
seed: e.fixed32.decode(d),
fastForwardTo: 1 & e.uint.decode(d) ? e.fixed32.decode(d) : null,
}),
},
Ze = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.mailbox),
e.fixed32.preencode(d, n.invitationSeed),
a.preencode(d, n.anchor),
e.fixed32.preencode(d, n.identityPublicKey))
},
encode(d, n) {
;(e.fixed32.encode(d, n.mailbox),
e.fixed32.encode(d, n.invitationSeed),
a.encode(d, n.anchor),
e.fixed32.encode(d, n.identityPublicKey))
},
decode: (d) => ({
mailbox: e.fixed32.decode(d),
invitationSeed: e.fixed32.decode(d),
anchor: a.decode(d),
identityPublicKey: e.fixed32.decode(d),
}),
},
$e = {
preencode(d, n) {
e.fixed32.preencode(d, n.mailbox)
},
encode(d, n) {
e.fixed32.encode(d, n.mailbox)
},
decode: (d) => ({ mailbox: e.fixed32.decode(d) }),
},
_e = e.frame(Xe),
ed = e.frame(Ze),
dd = e.frame($e),
nd = e.frame(Ye),
od = e.array(e.ipv4Address),
cd = {
preencode(e, d) {
;(e.end++,
d.room && _e.preencode(e, d.room),
d.identity && ed.preencode(e, d.identity),
d.contact && dd.preencode(e, d.contact),
d.readonly && nd.preencode(e, d.readonly),
n >= 2 && d.additionalNodes && od.preencode(e, d.additionalNodes))
},
encode(d, o) {
const c =
(o.room ? 1 : 0) |
(o.identity ? 2 : 0) |
(o.contact ? 4 : 0) |
(o.readonly ? 8 : 0) |
(n >= 2 && o.additionalNodes ? 16 : 0)
;(e.uint.encode(d, c),
o.room && _e.encode(d, o.room),
o.identity && ed.encode(d, o.identity),
o.contact && dd.encode(d, o.contact),
o.readonly && nd.encode(d, o.readonly),
n >= 2 && o.additionalNodes && od.encode(d, o.additionalNodes))
},
decode(d) {
const o = e.uint.decode(d)
return {
room: 1 & o ? _e.decode(d) : null,
identity: 2 & o ? ed.decode(d) : null,
contact: 4 & o ? dd.decode(d) : null,
readonly: 8 & o ? nd.decode(d) : null,
additionalNodes: n >= 2 && 16 & o ? od.decode(d) : null,
}
},
},
td = ce,
rd = {
preencode(d, n) {
;(td.preencode(d, n.header), e.buffer.preencode(d, n.blindRequest))
},
encode(d, n) {
;(td.encode(d, n.header), e.buffer.encode(d, n.blindRequest))
},
decode: (d) => ({ header: td.decode(d), blindRequest: e.buffer.decode(d) }),
},
id = ce,
ad = {
preencode(e, d) {
;(id.preencode(e, d.header), e.end++, d.profile && Vt.preencode(e, d.profile))
},
encode(d, n) {
const o = n.profile ? 1 : 0
;(id.encode(d, n.header), e.uint.encode(d, o), n.profile && Vt.encode(d, n.profile))
},
decode: (d) => ({ header: id.decode(d), profile: 1 & e.uint.decode(d) ? Vt.decode(d) : null }),
},
sd = ce,
pd = {
preencode(d, n) {
;(sd.preencode(d, n.header), e.fixed32.preencode(d, n.key))
},
encode(d, n) {
;(sd.encode(d, n.header), e.fixed32.encode(d, n.key))
},
decode: (d) => ({ header: sd.decode(d), key: e.fixed32.decode(d) }),
},
ud = { preencode(e, d) {}, encode(e, d) {}, decode: (e) => ({}) },
ld = ud,
fd = Me,
md = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.deviceKey),
e.fixed32.preencode(d, n.id),
fd.preencode(d, n.request))
},
encode(d, n) {
;(e.fixed32.encode(d, n.deviceKey), e.fixed32.encode(d, n.id), fd.encode(d, n.request))
},
decode: (d) => ({
deviceKey: e.fixed32.decode(d),
id: e.fixed32.decode(d),
request: fd.decode(d),
}),
},
yd = ce,
xd = Ne,
bd = {
preencode(d, n) {
;(yd.preencode(d, n.header),
e.fixed32.preencode(d, n.deviceKey),
d.end++,
n.identity && xd.preencode(d, n.identity))
},
encode(d, n) {
const o = n.identity ? 1 : 0
;(yd.encode(d, n.header),
e.fixed32.encode(d, n.deviceKey),
e.uint.encode(d, o),
n.identity && xd.encode(d, n.identity))
},
decode: (d) => ({
header: yd.decode(d),
deviceKey: e.fixed32.decode(d),
identity: 1 & e.uint.decode(d) ? xd.decode(d) : null,
}),
},
kd = ce,
gd = {
preencode(d, n) {
;(kd.preencode(d, n.header), e.fixed32.preencode(d, n.deviceKey))
},
encode(d, n) {
;(kd.encode(d, n.header), e.fixed32.encode(d, n.deviceKey))
},
decode: (d) => ({ header: kd.decode(d), deviceKey: e.fixed32.decode(d) }),
},
vd = e.frame(B),
hd = xe,
Kd = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.key), vd.preencode(d, n.status), hd.preencode(d, n.profile))
},
encode(d, n) {
;(e.fixed32.encode(d, n.key), vd.encode(d, n.status), hd.encode(d, n.profile))
},
decode: (d) => ({ key: e.fixed32.decode(d), status: vd.decode(d), profile: hd.decode(d) }),
},
wd = vd,
Pd = xe,
Td = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.key),
wd.preencode(d, n.status),
Pd.preencode(d, n.profile),
d.end++,
n.proofs && Ht.preencode(d, n.proofs))
},
encode(d, n) {
const o = n.proofs ? 1 : 0
;(e.fixed32.encode(d, n.key),
wd.encode(d, n.status),
Pd.encode(d, n.profile),
e.uint.encode(d, o),
n.proofs && Ht.encode(d, n.proofs))
},
decode: (d) => ({
key: e.fixed32.decode(d),
status: wd.decode(d),
profile: Pd.decode(d),
proofs: 1 & e.uint.decode(d) ? Ht.decode(d) : null,
}),
},
Ad = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.key),
d.end++,
n.profileAttestation && e.buffer.preencode(d, n.profileAttestation),
n.latestReceipt && e.buffer.preencode(d, n.latestReceipt))
},
encode(d, n) {
const o = (n.profileAttestation ? 1 : 0) | (n.latestReceipt ? 2 : 0)
;(e.fixed32.encode(d, n.key),
e.uint.encode(d, o),
n.profileAttestation && e.buffer.encode(d, n.profileAttestation),
n.latestReceipt && e.buffer.encode(d, n.latestReceipt))
},
decode(d) {
const n = e.fixed32.decode(d),
o = e.uint.decode(d)
return {
key: n,
profileAttestation: 1 & o ? e.buffer.decode(d) : null,
latestReceipt: 2 & o ? e.buffer.decode(d) : null,
}
},
},
Rd = ce,
Cd = Ae,
Md = {
preencode(e, d) {
;(Rd.preencode(e, d.header), Cd.preencode(e, d.member))
},
encode(e, d) {
;(Rd.encode(e, d.header), Cd.encode(e, d.member))
},
decode: (e) => ({ header: Rd.decode(e), member: Cd.decode(e) }),
},
qd = ce,
Ld = e.frame(E),
Sd = {
preencode(d, n) {
;(qd.preencode(d, n.header),
e.fixed32.preencode(d, n.memberKey),
e.uint.preencode(d, n.key),
Ld.preencode(d, n.status))
},
encode(d, n) {
;(qd.encode(d, n.header),
e.fixed32.encode(d, n.memberKey),
e.uint.encode(d, n.key),
Ld.encode(d, n.status))
},
decode: (d) => ({
header: qd.decode(d),
memberKey: e.fixed32.decode(d),
key: e.uint.decode(d),
status: Ld.decode(d),
}),
},
Dd = ce,
Fd = {
preencode(d, n) {
;(Dd.preencode(d, n.header), e.fixed32.preencode(d, n.key), d.end++)
},
encode(d, n) {
const o = (n.isModerator ? 1 : 0) | (n.isAdmin ? 2 : 0)
;(Dd.encode(d, n.header), e.fixed32.encode(d, n.key), e.uint.encode(d, o))
},
decode(d) {
const n = Dd.decode(d),
o = e.fixed32.decode(d),
c = e.uint.decode(d)
return { header: n, key: o, isModerator: !!(1 & c), isAdmin: !!(2 & c) }
},
},
Bd = ce,
Ed = {
preencode(d, n) {
;(Bd.preencode(d, n.header), e.fixed32.preencode(d, n.key))
},
encode(d, n) {
;(Bd.encode(d, n.header), e.fixed32.encode(d, n.key))
},
decode: (d) => ({ header: Bd.decode(d), key: e.fixed32.decode(d) }),
},
Id = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.key), e.uint.preencode(d, n.mentions))
},
encode(d, n) {
;(e.fixed32.encode(d, n.key), e.uint.encode(d, n.mentions))
},
decode: (d) => ({ key: e.fixed32.decode(d), mentions: e.uint.decode(d) }),
},
Nd = {
preencode(d, n) {
;(d.end++, n.memberKey && e.fixed32.preencode(d, n.memberKey))
},
encode(d, n) {
const o = n.memberKey ? 1 : 0
;(e.uint.encode(d, o), n.memberKey && e.fixed32.encode(d, n.memberKey))
},
decode: (d) => ({ memberKey: 1 & e.uint.decode(d) ? e.fixed32.decode(d) : null }),
},
jd = Nd,
Od = Nd,
Jd = {
preencode(d, n) {
;(d.end++, n.from && e.string.preencode(d, n.from), n.to && e.string.preencode(d, n.to))
},
encode(d, n) {
const o = (n.from ? 1 : 0) | (n.to ? 2 : 0)
;(e.uint.encode(d, o), n.from && e.string.encode(d, n.from), n.to && e.string.encode(d, n.to))
},
decode(d) {
const n = e.uint.decode(d)
return { from: 1 & n ? e.string.decode(d) : null, to: 2 & n ? e.string.decode(d) : null }
},
},
Ud = e.frame(Nd),
Vd = e.frame(jd),
Hd = e.frame(Jd),
zd = e.frame(Od),
Gd = {
preencode(d, n) {
const o =
(n.memberJoined ? 1 : 0) |
(n.memberLeft ? 2 : 0) |
(n.titleChanged ? 4 : 0) |
(n.callStarted ? 8 : 0) |
(n.callHangup ? 16 : 0) |
(n.callMissed ? 32 : 0) |
(n.roomAvatarChanged ? 64 : 0) |
(n.invitationCreated ? 128 : 0) |
(n.memberRemoved ? 256 : 0)
;(e.uint.preencode(d, o),
n.memberJoined && Ud.preencode(d, n.memberJoined),
n.memberLeft && Vd.preencode(d, n.memberLeft),
n.titleChanged && Hd.preencode(d, n.titleChanged),
n.memberRemoved && zd.preencode(d, n.memberRemoved))
},
encode(d, n) {
const o =
(n.memberJoined ? 1 : 0) |
(n.memberLeft ? 2 : 0) |
(n.titleChanged ? 4 : 0) |
(n.callStarted ? 8 : 0) |
(n.callHangup ? 16 : 0) |
(n.callMissed ? 32 : 0) |
(n.roomAvatarChanged ? 64 : 0) |
(n.invitationCreated ? 128 : 0) |
(n.memberRemoved ? 256 : 0)
;(e.uint.encode(d, o),
n.memberJoined && Ud.encode(d, n.memberJoined),
n.memberLeft && Vd.encode(d, n.memberLeft),
n.titleChanged && Hd.encode(d, n.titleChanged),
n.memberRemoved && zd.encode(d, n.memberRemoved))
},
decode(d) {
const n = e.uint.decode(d)
return {
memberJoined: 1 & n ? Ud.decode(d) : null,
memberLeft: 2 & n ? Vd.decode(d) : null,
titleChanged: 4 & n ? Hd.decode(d) : null,
callStarted: !!(8 & n),
callHangup: !!(16 & n),
callMissed: !!(32 & n),
roomAvatarChanged: !!(64 & n),
invitationCreated: !!(128 & n),
memberRemoved: 256 & n ? zd.decode(d) : null,
}
},
},
Qd = {
preencode(e, d) {
e.end++
},
encode(d, n) {
const o = (n.callStarted ? 1 : 0) | (n.callHangup ? 2 : 0) | (n.callMissed ? 4 : 0)
e.uint.encode(d, o)
},
decode(d) {
const n = e.uint.decode(d)
return { callStarted: !!(1 & n), callHangup: !!(2 & n), callMissed: !!(4 & n) }
},
},
Wd = {
preencode(d, n) {
;(e.uint.preencode(d, n.start), e.uint.preencode(d, n.length))
},
encode(d, n) {
;(e.uint.encode(d, n.start), e.uint.encode(d, n.length))
},
decode: (d) => ({ start: e.uint.decode(d), length: e.uint.decode(d) }),
},
Xd = e.frame(Wd),
Yd = {
preencode(d, n) {
;(Xd.preencode(d, n.range), e.string.preencode(d, n.content))
},
encode(d, n) {
;(Xd.encode(d, n.range), e.string.encode(d, n.content))
},
decode: (d) => ({ range: Xd.decode(d), content: e.string.decode(d) }),
},
Zd = Xd,
$d = {
preencode(d, n) {
;(Zd.preencode(d, n.range), e.fixed32.preencode(d, n.memberKey))
},
encode(d, n) {
;(Zd.encode(d, n.range), e.fixed32.encode(d, n.memberKey))
},
decode: (d) => ({ range: Zd.decode(d), memberKey: e.fixed32.decode(d) }),
},
_d = A,
en = e.array(e.uint),
dn = {
preencode(d, o) {
;(d.end++,
o.title && e.string.preencode(d, o.title),
o.description && e.string.preencode(d, o.description),
o.file && _d.preencode(d, o.file),
n >= 2 && o.files && en.preencode(d, o.files))
},
encode(d, o) {
const c =
(o.title ? 1 : 0) | (o.description ? 2 : 0) | (o.file ? 4 : 0) | (n >= 2 && o.files ? 8 : 0)
;(e.uint.encode(d, c),
o.title && e.string.encode(d, o.title),
o.description && e.string.encode(d, o.description),
o.file && _d.encode(d, o.file),
n >= 2 && o.files && en.encode(d, o.files))
},
decode(d) {
const o = e.uint.decode(d)
return {
title: 1 & o ? e.string.decode(d) : null,
description: 2 & o ? e.string.decode(d) : null,
file: 4 & o ? _d.decode(d) : null,
files: n >= 2 && 8 & o ? en.decode(d) : null,
}
},
},
nn = Xd,
on = e.frame(dn),
cn = {
preencode(d, n) {
;(nn.preencode(d, n.range),
e.string.preencode(d, n.url),
d.end++,
n.preview && on.preencode(d, n.preview))
},
encode(d, n) {
const o = n.preview ? 1 : 0
;(nn.encode(d, n.range),
e.string.encode(d, n.url),
e.uint.encode(d, o),
n.preview && on.encode(d, n.preview))
},
decode: (d) => ({
range: nn.decode(d),
url: e.string.decode(d),
preview: 1 & e.uint.decode(d) ? on.decode(d) : null,
}),
},
tn = e.array(e.frame($d)),
rn = e.array(e.frame(cn)),
an = rn,
sn = e.array(e.frame(Wd)),
pn = sn,
un = sn,
ln = e.array(e.frame(Yd)),
fn = sn,
mn = sn,
yn = {
preencode(d, o) {
const c =
(o.mention ? 1 : 0) |
(o.httpLink ? 2 : 0) |
(o.pearLink ? 4 : 0) |
(o.bold ? 8 : 0) |
(o.italic ? 16 : 0) |
(o.code ? 32 : 0) |
(o.emoji ? 64 : 0) |
(o.codeBlock ? 128 : 0) |
(o.strike ? 256 : 0) |
(n >= 2 && o.translation ? 512 : 0)
;(e.uint.preencode(d, c),
o.mention && tn.preencode(d, o.mention),
o.httpLink && rn.preencode(d, o.httpLink),
o.pearLink && an.preencode(d, o.pearLink),
o.bold && sn.preencode(d, o.bold),
o.italic && pn.preencode(d, o.italic),
o.code && un.preencode(d, o.code),
o.emoji && ln.preencode(d, o.emoji),
o.codeBlock && fn.preencode(d, o.codeBlock),
o.strike && mn.preencode(d, o.strike),
n >= 2 && o.translation && zt.preencode(d, o.translation))
},
encode(d, o) {
const c =
(o.mention ? 1 : 0) |
(o.httpLink ? 2 : 0) |
(o.pearLink ? 4 : 0) |
(o.bold ? 8 : 0) |
(o.italic ? 16 : 0) |
(o.code ? 32 : 0) |
(o.emoji ? 64 : 0) |
(o.codeBlock ? 128 : 0) |
(o.strike ? 256 : 0) |
(n >= 2 && o.translation ? 512 : 0)
;(e.uint.encode(d, c),
o.mention && tn.encode(d, o.mention),
o.httpLink && rn.encode(d, o.httpLink),
o.pearLink && an.encode(d, o.pearLink),
o.bold && sn.encode(d, o.bold),
o.italic && pn.encode(d, o.italic),
o.code && un.encode(d, o.code),
o.emoji && ln.encode(d, o.emoji),
o.codeBlock && fn.encode(d, o.codeBlock),
o.strike && mn.encode(d, o.strike),
n >= 2 && o.translation && zt.encode(d, o.translation))
},
decode(d) {
const o = e.uint.decode(d)
return {
mention: 1 & o ? tn.decode(d) : null,
httpLink: 2 & o ? rn.decode(d) : null,
pearLink: 4 & o ? an.decode(d) : null,
bold: 8 & o ? sn.decode(d) : null,
italic: 16 & o ? pn.decode(d) : null,
code: 32 & o ? un.decode(d) : null,
emoji: 64 & o ? ln.decode(d) : null,
codeBlock: 128 & o ? fn.decode(d) : null,
strike: 256 & o ? mn.decode(d) : null,
translation: n >= 2 && 512 & o ? zt.decode(d) : null,
}
},
},
xn = e.array(e.frame(T)),
bn = e.frame(yn),
kn = e.frame(Qd),
gn = {
preencode(d, n) {
;(d.end++,
n.text && e.string.preencode(d, n.text),
n.files && xn.preencode(d, n.files),
n.display && bn.preencode(d, n.display),
n.replyTo && s.preencode(d, n.replyTo),
n.parent && s.preencode(d, n.parent),
n.event && kn.preencode(d, n.event))
},
encode(d, n) {
const o =
(n.text ? 1 : 0) |
(n.files ? 2 : 0) |
(n.display ? 4 : 0) |
(n.replyTo ? 8 : 0) |
(n.parent ? 16 : 0) |
(n.event ? 32 : 0)
;(e.uint.encode(d, o),
n.text && e.string.encode(d, n.text),
n.files && xn.encode(d, n.files),
n.display && bn.encode(d, n.display),
n.replyTo && s.encode(d, n.replyTo),
n.parent && s.encode(d, n.parent),
n.event && kn.encode(d, n.event))
},
decode(d) {
const n = e.uint.decode(d)
return {
text: 1 & n ? e.string.decode(d) : null,
files: 2 & n ? xn.decode(d) : null,
display: 4 & n ? bn.decode(d) : null,
replyTo: 8 & n ? s.decode(d) : null,
parent: 16 & n ? s.decode(d) : null,
event: 32 & n ? kn.decode(d) : null,
}
},
},
vn = en,
hn = bn,
Kn = {
preencode(d, n) {
;(d.end++,
n.text && e.string.preencode(d, n.text),
n.files && vn.preencode(d, n.files),
n.display && hn.preencode(d, n.display),
n.replyTo && s.preencode(d, n.replyTo),
n.parent && s.preencode(d, n.parent))
},
encode(d, n) {
const o =
(n.text ? 1 : 0) |
(n.files ? 2 : 0) |
(n.display ? 4 : 0) |
(n.replyTo ? 8 : 0) |
(n.parent ? 16 : 0)
;(e.uint.encode(d, o),
n.text && e.string.encode(d, n.text),
n.files && vn.encode(d, n.files),
n.display && hn.encode(d, n.display),
n.replyTo && s.encode(d, n.replyTo),
n.parent && s.encode(d, n.parent))
},
decode(d) {
const n = e.uint.decode(d)
return {
text: 1 & n ? e.string.decode(d) : null,
files: 2 & n ? vn.decode(d) : null,
display: 4 & n ? hn.decode(d) : null,
replyTo: 8 & n ? s.decode(d) : null,
parent: 16 & n ? s.decode(d) : null,
}
},
},
wn = xn,
Pn = bn,
Tn = {
preencode(d, n) {
;(d.end++,
n.text && e.string.preencode(d, n.text),
n.files && wn.preencode(d, n.files),
n.display && Pn.preencode(d, n.display),
n.replyTo && s.preencode(d, n.replyTo),
n.parent && s.preencode(d, n.parent))
},
encode(d, n) {
const o =
(n.text ? 1 : 0) |
(n.files ? 2 : 0) |
(n.display ? 4 : 0) |
(n.replyTo ? 8 : 0) |
(n.parent ? 16 : 0)
;(e.uint.encode(d, o),
n.text && e.string.encode(d, n.text),
n.files && wn.encode(d, n.files),
n.display && Pn.encode(d, n.display),
n.replyTo && s.encode(d, n.replyTo),
n.parent && s.encode(d, n.parent))
},
decode(d) {
const n = e.uint.decode(d)
return {
text: 1 & n ? e.string.decode(d) : null,
files: 2 & n ? wn.decode(d) : null,
display: 4 & n ? Pn.decode(d) : null,
replyTo: 8 & n ? s.decode(d) : null,
parent: 16 & n ? s.decode(d) : null,
}
},
},
An = {
preencode(e, d) {
e.end++
},
encode(d, n) {
const o = (n.isEdited ? 1 : 0) | (n.isDeleted ? 2 : 0) | (n.isPinned ? 4 : 0)
e.uint.encode(d, o)
},
decode(d) {
const n = e.uint.decode(d)
return { isEdited: !!(1 & n), isDeleted: !!(2 & n), isPinned: !!(4 & n) }
},
},
Rn = {
preencode(d, n) {
;(e.uint.preencode(d, n.thread), e.uint.preencode(d, n.index))
},
encode(d, n) {
;(e.uint.encode(d, n.thread), e.uint.encode(d, n.index))
},
decode: (d) => ({ thread: e.uint.decode(d), index: e.uint.decode(d) }),
},
Cn = e.frame(G),
Mn = {
preencode(d, n) {
;(e.uint.preencode(d, n.id),
e.uint.preencode(d, n.count),
d.end++,
n.parent && s.preencode(d, n.parent),
n.stats && Cn.preencode(d, n.stats))
},
encode(d, n) {
const o = (n.parent ? 1 : 0) | (n.stats ? 2 : 0)
;(e.uint.encode(d, n.id),
e.uint.encode(d, n.count),
e.uint.encode(d, o),
n.parent && s.encode(d, n.parent),
n.stats && Cn.encode(d, n.stats))
},
decode(d) {
const n = e.uint.decode(d),
o = e.uint.decode(d),
c = e.uint.decode(d)
return {
id: n,
count: o,
parent: 1 & c ? s.decode(d) : null,
stats: 2 & c ? Cn.decode(d) : null,
}
},
},
qn = e.frame(An),
Ln = e.frame(Kn),
Sn = e.frame(Gd),
Dn = {
preencode(d, n) {
;(Rn.preencode(d, n.id),
s.preencode(d, n.oplog),
e.uint.preencode(d, n.clock),
e.uint.preencode(d, n.timestamp),
d.end++,
n.editedAt && e.uint.preencode(d, n.editedAt),
qn.preencode(d, n.status),
n.message && Ln.preencode(d, n.message),
n.event && Sn.preencode(d, n.event))
},
encode(d, n) {
const o = (n.editedAt ? 1 : 0) | (n.message ? 2 : 0) | (n.event ? 4 : 0)
;(Rn.encode(d, n.id),
s.encode(d, n.oplog),
e.uint.encode(d, n.clock),
e.uint.encode(d, n.timestamp),
e.uint.encode(d, o),
n.editedAt && e.uint.encode(d, n.editedAt),
qn.encode(d, n.status),
n.message && Ln.encode(d, n.message),
n.event && Sn.encode(d, n.event))
},
decode(d) {
const n = Rn.decode(d),
o = s.decode(d),
c = e.uint.decode(d),
t = e.uint.decode(d),
r = e.uint.decode(d)
return {
id: n,
oplog: o,
clock: c,
timestamp: t,
editedAt: 1 & r ? e.uint.decode(d) : 0,
status: qn.decode(d),
message: 2 & r ? Ln.decode(d) : null,
event: 4 & r ? Sn.decode(d) : null,
}
},
},
Fn = qn,
Bn = e.frame(Tn),
En = Sn,
In = {
preencode(d, n) {
;(Rn.preencode(d, n.id),
s.preencode(d, n.oplog),
e.uint.preencode(d, n.clock),
e.uint.preencode(d, n.timestamp),
d.end++,
n.editedAt && e.uint.preencode(d, n.editedAt),
Fn.preencode(d, n.status),
n.message && Bn.preencode(d, n.message),
n.event && En.preencode(d, n.event))
},
encode(d, n) {
const o = (n.editedAt ? 1 : 0) | (n.message ? 2 : 0) | (n.event ? 4 : 0)
;(Rn.encode(d, n.id),
s.encode(d, n.oplog),
e.uint.encode(d, n.clock),
e.uint.encode(d, n.timestamp),
e.uint.encode(d, o),
n.editedAt && e.uint.encode(d, n.editedAt),
Fn.encode(d, n.status),
n.message && Bn.encode(d, n.message),
n.event && En.encode(d, n.event))
},
decode(d) {
const n = Rn.decode(d),
o = s.decode(d),
c = e.uint.decode(d),
t = e.uint.decode(d),
r = e.uint.decode(d)
return {
id: n,
oplog: o,
clock: c,
timestamp: t,
editedAt: 1 & r ? e.uint.decode(d) : 0,
status: Fn.decode(d),
message: 2 & r ? Bn.decode(d) : null,
event: 4 & r ? En.decode(d) : null,
}
},
},
Nn = ce,
jn = e.frame(gn),
On = {
preencode(e, d) {
;(Nn.preencode(e, d.header), jn.preencode(e, d.message))
},
encode(e, d) {
;(Nn.encode(e, d.header), jn.encode(e, d.message))
},
decode: (e) => ({ header: Nn.decode(e), message: jn.decode(e) }),
},
Jn = ce,
Un = {
preencode(e, d) {
;(Jn.preencode(e, d.header), s.preencode(e, d.oplog))
},
encode(e, d) {
;(Jn.encode(e, d.header), s.encode(e, d.oplog))
},
decode: (e) => ({ header: Jn.decode(e), oplog: s.decode(e) }),
},
Vn = ce,
Hn = jn,
zn = {
preencode(e, d) {
;(Vn.preencode(e, d.header), s.preencode(e, d.oplog), Hn.preencode(e, d.message))
},
encode(e, d) {
;(Vn.encode(e, d.header), s.encode(e, d.oplog), Hn.encode(e, d.message))
},
decode: (e) => ({ header: Vn.decode(e), oplog: s.decode(e), message: Hn.decode(e) }),
},
Gn = ce,
Qn = {
preencode(e, d) {
;(Gn.preencode(e, d.header), s.preencode(e, d.oplog), e.end++)
},
encode(d, n) {
const o = n.isPinned ? 1 : 0
;(Gn.encode(d, n.header), s.encode(d, n.oplog), e.uint.encode(d, o))
},
decode: (d) => ({
header: Gn.decode(d),
oplog: s.decode(d),
isPinned: !!(1 & e.uint.decode(d)),
}),
},
Wn = ce,
Xn = {
preencode(d, o) {
;(Wn.preencode(d, o.header),
s.preencode(d, o.oplog),
e.uint.preencode(d, o.index),
Gt.preencode(d, o.preview),
d.end++,
n >= 2 && o.displayType && Wc.preencode(d, o.displayType))
},
encode(d, o) {
const c = n >= 2 && o.displayType ? 1 : 0
;(Wn.encode(d, o.header),
s.encode(d, o.oplog),
e.uint.encode(d, o.index),
Gt.encode(d, o.preview),
e.uint.encode(d, c),
n >= 2 && o.displayType && Wc.encode(d, o.displayType))
},
decode(d) {
const o = Wn.decode(d),
c = s.decode(d),
t = e.uint.decode(d),
r = Gt.decode(d),
i = d.start < d.end ? e.uint.decode(d) : 0
return {
header: o,
oplog: c,
index: t,
preview: r,
displayType: n >= 2 && 1 & i ? Wc.decode(d) : 0,
}
},
},
Yn = {
preencode(d, n) {
;(Rn.preencode(d, n.id),
e.fixed32.preencode(d, n.sender),
e.uint.preencode(d, n.clock),
e.string.preencode(d, n.reaction))
},
encode(d, n) {
;(Rn.encode(d, n.id),
e.fixed32.encode(d, n.sender),
e.uint.encode(d, n.clock),
e.string.encode(d, n.reaction))
},
decode: (d) => ({
id: Rn.decode(d),
sender: e.fixed32.decode(d),
clock: e.uint.decode(d),
reaction: e.string.decode(d),
}),
},
Zn = {
preencode(d, n) {
;(e.string.preencode(d, n.text), e.uint.preencode(d, n.count))
},
encode(d, n) {
;(e.string.encode(d, n.text), e.uint.encode(d, n.count))
},
decode: (d) => ({ text: e.string.decode(d), count: e.uint.decode(d) }),
},
$n = e.array(e.frame(Zn)),
_n = {
preencode(d, o) {
;(Rn.preencode(d, o.id),
e.uint.preencode(d, o.total),
$n.preencode(d, o.reactions),
d.end++,
n >= 2 && o.editedAt && e.uint.preencode(d, o.editedAt))
},
encode(d, o) {
const c = n >= 2 && o.editedAt ? 1 : 0
;(Rn.encode(d, o.id),
e.uint.encode(d, o.total),
$n.encode(d, o.reactions),
e.uint.encode(d, c),
n >= 2 && o.editedAt && e.uint.encode(d, o.editedAt))
},
decode(d) {
const o = Rn.decode(d),
c = e.uint.decode(d),
t = $n.decode(d),
r = d.start < d.end ? e.uint.decode(d) : 0
return { id: o, total: c, reactions: t, editedAt: n >= 2 && 1 & r ? e.uint.decode(d) : 0 }
},
},
eo = ce,
no = {
preencode(d, n) {
;(eo.preencode(d, n.header), s.preencode(d, n.oplog), e.string.preencode(d, n.reaction))
},
encode(d, n) {
;(eo.encode(d, n.header), s.encode(d, n.oplog), e.string.encode(d, n.reaction))
},
decode: (d) => ({ header: eo.decode(d), oplog: s.decode(d), reaction: e.string.decode(d) }),
},
oo = ce,
co = {
preencode(d, n) {
;(oo.preencode(d, n.header), s.preencode(d, n.oplog), e.string.preencode(d, n.reaction))
},
encode(d, n) {
;(oo.encode(d, n.header), s.encode(d, n.oplog), e.string.encode(d, n.reaction))
},
decode: (d) => ({ header: oo.decode(d), oplog: s.decode(d), reaction: e.string.decode(d) }),
},
to = ce,
ro = e.frame(ne),
io = {
preencode(d, n) {
;(to.preencode(d, n.header), e.uint.preencode(d, n.key), ro.preencode(d, n.config))
},
encode(d, n) {
;(to.encode(d, n.header), e.uint.encode(d, n.key), ro.encode(d, n.config))
},
decode: (d) => ({ header: to.decode(d), key: e.uint.decode(d), config: ro.decode(d) }),
},
ao = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.memberKey),
e.string.preencode(d, n.displayName),
d.end++,
n.avatar && Qt.preencode(d, n.avatar))
},
encode(d, n) {
const o = n.avatar ? 1 : 0
;(e.fixed32.encode(d, n.memberKey),
e.string.encode(d, n.displayName),
e.uint.encode(d, o),
n.avatar && Qt.encode(d, n.avatar))
},
decode: (d) => ({
memberKey: e.fixed32.decode(d),
displayName: e.string.decode(d),
avatar: 1 & e.uint.decode(d) ? Qt.decode(d) : null,
}),
},
so = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.key), d.end++, n.username && e.string.preencode(d, n.username))
},
encode(d, n) {
const o = n.username ? 1 : 0
;(e.fixed32.encode(d, n.key),
e.uint.encode(d, o),
n.username && e.string.encode(d, n.username))
},
decode: (d) => ({
key: e.fixed32.decode(d),
username: 1 & e.uint.decode(d) ? e.string.decode(d) : null,
}),
},
po = e.frame(so),
uo = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.publicKey),
d.end++,
n.discoveryCoreKey && e.fixed32.preencode(d, n.discoveryCoreKey),
n.userRegistry && po.preencode(d, n.userRegistry))
},
encode(d, n) {
const o = (n.discoveryCoreKey ? 1 : 0) | (n.userRegistry ? 2 : 0)
;(e.fixed32.encode(d, n.publicKey),
e.uint.encode(d, o),
n.discoveryCoreKey && e.fixed32.encode(d, n.discoveryCoreKey),
n.userRegistry && po.encode(d, n.userRegistry))
},
decode(d) {
const n = e.fixed32.decode(d),
o = e.uint.decode(d)
return {
publicKey: n,
discoveryCoreKey: 1 & o ? e.fixed32.decode(d) : null,
userRegistry: 2 & o ? po.decode(d) : null,
}
},
},
lo = ce,
fo = e.frame($),
mo = e.frame(_),
yo = ro,
xo = e.frame(uo),
bo = Te,
ko = e.array(e.frame(be)),
go = {
preencode(e, d) {
;(lo.preencode(e, d.header),
fo.preencode(e, d.digest),
mo.preencode(e, d.capabilities),
e.end++,
d.config && yo.preencode(e, d.config),
d.identity && xo.preencode(e, d.identity),
d.bootstrapDevice && bo.preencode(e, d.bootstrapDevice),
d.initialMembers && ko.preencode(e, d.initialMembers))
},
encode(d, n) {
const o =
(n.config ? 1 : 0) |
(n.identity ? 2 : 0) |
(n.bootstrapDevice ? 4 : 0) |
(n.initialMembers ? 8 : 0)
;(lo.encode(d, n.header),
fo.encode(d, n.digest),
mo.encode(d, n.capabilities),
e.uint.encode(d, o),
n.config && yo.encode(d, n.config),
n.identity && xo.encode(d, n.identity),
n.bootstrapDevice && bo.encode(d, n.bootstrapDevice),
n.initialMembers && ko.encode(d, n.initialMembers))
},
decode(d) {
const n = lo.decode(d),
o = fo.decode(d),
c = mo.decode(d),
t = e.uint.decode(d)
return {
header: n,
digest: o,
capabilities: c,
config: 1 & t ? yo.decode(d) : null,
identity: 2 & t ? xo.decode(d) : null,
bootstrapDevice: 4 & t ? bo.decode(d) : null,
initialMembers: 8 & t ? ko.decode(d) : null,
}
},
},
vo = ce,
ho = {
preencode(d, n) {
;(vo.preencode(d, n.header), e.uint.preencode(d, n.version))
},
encode(d, n) {
;(vo.encode(d, n.header), e.uint.encode(d, n.version))
},
decode: (d) => ({ header: vo.decode(d), version: e.uint.decode(d) }),
},
Ko = ce,
wo = Z,
Po = {
preencode(d, n) {
;(Ko.preencode(d, n.header), e.uint.preencode(d, n.key), wo.preencode(d, n.settings))
},
encode(d, n) {
;(Ko.encode(d, n.header), e.uint.encode(d, n.key), wo.encode(d, n.settings))
},
decode: (d) => ({ header: Ko.decode(d), key: e.uint.decode(d), settings: wo.decode(d) }),
},
To = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.memberKey),
Wt.preencode(d, n.status),
d.end++,
n.mailbox && e.fixed32.preencode(d, n.mailbox),
n.roomKey && e.fixed32.preencode(d, n.roomKey))
},
encode(d, n) {
const o = (n.mailbox ? 1 : 0) | (n.roomKey ? 2 : 0)
;(e.fixed32.encode(d, n.memberKey),
Wt.encode(d, n.status),
e.uint.encode(d, o),
n.mailbox && e.fixed32.encode(d, n.mailbox),
n.roomKey && e.fixed32.encode(d, n.roomKey))
},
decode(d) {
const n = e.fixed32.decode(d),
o = Wt.decode(d),
c = e.uint.decode(d)
return {
memberKey: n,
status: o,
mailbox: 1 & c ? e.fixed32.decode(d) : null,
roomKey: 2 & c ? e.fixed32.decode(d) : null,
}
},
},
Ao = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.roomKey),
e.buffer.preencode(d, n.encryptionKey),
e.fixed32.preencode(d, n.seed),
a.preencode(d, n.initiator),
e.fixed32.preencode(d, n.fastForwardTo))
},
encode(d, n) {
;(e.fixed32.encode(d, n.roomKey),
e.buffer.encode(d, n.encryptionKey),
e.fixed32.encode(d, n.seed),
a.encode(d, n.initiator),
e.fixed32.encode(d, n.fastForwardTo))
},
decode: (d) => ({
roomKey: e.fixed32.decode(d),
encryptionKey: e.buffer.decode(d),
seed: e.fixed32.decode(d),
initiator: a.decode(d),
fastForwardTo: e.fixed32.decode(d),
}),
},
Ro = e.array(e.frame(Ao)),
Co = de,
Mo = {
preencode(e, d) {
;(Ro.preencode(e, d.sharedRooms), Co.preencode(e, d.blockedContacts))
},
encode(e, d) {
;(Ro.encode(e, d.sharedRooms), Co.encode(e, d.blockedContacts))
},
decode: (e) => ({ sharedRooms: Ro.decode(e), blockedContacts: Co.decode(e) }),
},
qo = xo,
Lo = {
preencode(e, d) {
qo.preencode(e, d.identity)
},
encode(e, d) {
qo.encode(e, d.identity)
},
decode: (e) => ({ identity: qo.decode(e) }),
},
So = {
preencode(d, n) {
;(e.uint.preencode(d, n.rooms), e.uint.preencode(d, n.contacts))
},
encode(d, n) {
;(e.uint.encode(d, n.rooms), e.uint.encode(d, n.contacts))
},
decode: (d) => ({ rooms: e.uint.decode(d), contacts: e.uint.decode(d) }),
},
Do = {
preencode(d, n) {
;(e.uint.preencode(d, n.rooms), e.uint.preencode(d, n.contactRequests))
},
encode(d, n) {
;(e.uint.encode(d, n.rooms), e.uint.encode(d, n.contactRequests))
},
decode: (d) => ({ rooms: e.uint.decode(d), contactRequests: e.uint.decode(d) }),
},
Fo = {
preencode(d, n) {
e.buffer.preencode(d, n.entropy)
},
encode(d, n) {
e.buffer.encode(d, n.entropy)
},
decode: (d) => ({ entropy: e.buffer.decode(d) }),
},
Bo = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.publicKey),
e.fixed32.preencode(d, n.devicePublicKey),
e.fixed32.preencode(d, n.writerKey))
},
encode(d, n) {
;(e.fixed32.encode(d, n.publicKey),
e.fixed32.encode(d, n.devicePublicKey),
e.fixed32.encode(d, n.writerKey))
},
decode: (d) => ({
publicKey: e.fixed32.decode(d),
devicePublicKey: e.fixed32.decode(d),
writerKey: e.fixed32.decode(d),
}),
},
Eo = e.frame(Bo),
Io = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.id),
e.fixed32.preencode(d, n.invitationSeed),
e.fixed32.preencode(d, n.mailbox),
u.preencode(d, n.responseKeyPair),
a.preencode(d, n.initiator),
a.preencode(d, n.inviter),
d.end++,
n.identity && Eo.preencode(d, n.identity))
},
encode(d, n) {
const o = n.identity ? 1 : 0
;(e.fixed32.encode(d, n.id),
e.fixed32.encode(d, n.invitationSeed),
e.fixed32.encode(d, n.mailbox),
u.encode(d, n.responseKeyPair),
a.encode(d, n.initiator),
a.encode(d, n.inviter),
e.uint.encode(d, o),
n.identity && Eo.encode(d, n.identity))
},
decode: (d) => ({
id: e.fixed32.decode(d),
invitationSeed: e.fixed32.decode(d),
mailbox: e.fixed32.decode(d),
responseKeyPair: u.decode(d),
initiator: a.decode(d),
inviter: a.decode(d),
identity: 1 & e.uint.decode(d) ? Eo.decode(d) : null,
}),
},
No = ce,
jo = {
preencode(d, n) {
;(No.preencode(d, n.header), e.buffer.preencode(d, n.blindResponse))
},
encode(d, n) {
;(No.encode(d, n.header), e.buffer.encode(d, n.blindResponse))
},
decode: (d) => ({ header: No.decode(d), blindResponse: e.buffer.decode(d) }),
},
Oo = ce,
Jo = e.frame(Io),
Uo = {
preencode(e, d) {
;(Oo.preencode(e, d.header), Jo.preencode(e, d.invitation))
},
encode(e, d) {
;(Oo.encode(e, d.header), Jo.encode(e, d.invitation))
},
decode: (e) => ({ header: Oo.decode(e), invitation: Jo.decode(e) }),
},
Vo = ce,
Ho = {
preencode(d, n) {
;(Vo.preencode(d, n.header), e.fixed32.preencode(d, n.id))
},
encode(d, n) {
;(Vo.encode(d, n.header), e.fixed32.encode(d, n.id))
},
decode: (d) => ({ header: Vo.decode(d), id: e.fixed32.decode(d) }),
},
zo = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.publicKey),
e.fixed32.preencode(d, n.devicePublicKey),
d.end++,
n.privateProfileKey && e.fixed32.preencode(d, n.privateProfileKey),
n.deviceKeyPair && u.preencode(d, n.deviceKeyPair),
e.buffer.preencode(d, n.deviceProof))
},
encode(d, n) {
const o = (n.privateProfileKey ? 1 : 0) | (n.deviceKeyPair ? 2 : 0)
;(e.fixed32.encode(d, n.publicKey),
e.fixed32.encode(d, n.devicePublicKey),
e.uint.encode(d, o),
n.privateProfileKey && e.fixed32.encode(d, n.privateProfileKey),
n.deviceKeyPair && u.encode(d, n.deviceKeyPair),
e.buffer.encode(d, n.deviceProof))
},
decode(d) {
const n = e.fixed32.decode(d),
o = e.fixed32.decode(d),
c = e.uint.decode(d)
return {
publicKey: n,
devicePublicKey: o,
privateProfileKey: 1 & c ? e.fixed32.decode(d) : null,
deviceKeyPair: 2 & c ? u.decode(d) : null,
deviceProof: e.buffer.decode(d),
}
},
},
Go = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.publicKey),
e.fixed32.preencode(d, n.writerKey),
e.fixed32.preencode(d, n.devicePublicKey),
d.end++,
n.privateProfileKey && e.fixed32.preencode(d, n.privateProfileKey))
},
encode(d, n) {
const o = n.privateProfileKey ? 1 : 0
;(e.fixed32.encode(d, n.publicKey),
e.fixed32.encode(d, n.writerKey),
e.fixed32.encode(d, n.devicePublicKey),
e.uint.encode(d, o),
n.privateProfileKey && e.fixed32.encode(d, n.privateProfileKey))
},
decode: (d) => ({
publicKey: e.fixed32.decode(d),
writerKey: e.fixed32.decode(d),
devicePublicKey: e.fixed32.decode(d),
privateProfileKey: 1 & e.uint.decode(d) ? e.fixed32.decode(d) : null,
}),
},
Qo = {
preencode(e, d) {
e.end++
},
encode(d, o) {
const c =
(o.isActive ? 1 : 0) |
(o.isFullyMuted ? 2 : 0) |
(o.isMentionsOnlyMuted ? 4 : 0) |
(n >= 2 && o.isReadOnly ? 8 : 0)
e.uint.encode(d, c)
},
decode(d) {
const o = e.uint.decode(d)
return {
isActive: !!(1 & o),
isFullyMuted: !!(2 & o),
isMentionsOnlyMuted: !!(4 & o),
isReadOnly: n >= 2 && !!(8 & o),
}
},
},
Wo = e.frame(Qo),
Xo = e.frame(zo),
Yo = Eo,
Zo = {
preencode(d, o) {
;(e.fixed32.preencode(d, o.roomKey),
e.buffer.preencode(d, o.encryptionKey),
e.fixed32.preencode(d, o.mailbox),
Wo.preencode(d, o.status),
e.uint.preencode(d, o.clock),
d.end++,
o.initiator && a.preencode(d, o.initiator),
o.fastForwardTo && e.fixed32.preencode(d, o.fastForwardTo),
o.identitySwap && Xo.preencode(d, o.identitySwap),
o.identitySwapV2 && Yo.preencode(d, o.identitySwapV2),
n >= 2 && o.contact && e.fixed32.preencode(d, o.contact))
},
encode(d, o) {
const c =
(o.initiator ? 1 : 0) |
(o.fastForwardTo ? 2 : 0) |
(o.identitySwap ? 4 : 0) |
(o.identitySwapV2 ? 8 : 0) |
(n >= 2 && o.contact ? 16 : 0)
;(e.fixed32.encode(d, o.roomKey),
e.buffer.encode(d, o.encryptionKey),
e.fixed32.encode(d, o.mailbox),
Wo.encode(d, o.status),
e.uint.encode(d, o.clock),
e.uint.encode(d, c),
o.initiator && a.encode(d, o.initiator),
o.fastForwardTo && e.fixed32.encode(d, o.fastForwardTo),
o.identitySwap && Xo.encode(d, o.identitySwap),
o.identitySwapV2 && Yo.encode(d, o.identitySwapV2),
n >= 2 && o.contact && e.fixed32.encode(d, o.contact))
},
decode(d) {
const o = e.fixed32.decode(d),
c = e.buffer.decode(d),
t = e.fixed32.decode(d),
r = Wo.decode(d),
i = e.uint.decode(d),
s = e.uint.decode(d)
return {
roomKey: o,
encryptionKey: c,
mailbox: t,
status: r,
clock: i,
initiator: 1 & s ? a.decode(d) : null,
fastForwardTo: 2 & s ? e.fixed32.decode(d) : null,
identitySwap: 4 & s ? Xo.decode(d) : null,
identitySwapV2: 8 & s ? Yo.decode(d) : null,
contact: n >= 2 && 16 & s ? e.fixed32.decode(d) : null,
}
},
},
$o = ce,
_o = {
preencode(d, n) {
;($o.preencode(d, n.header),
e.fixed32.preencode(d, n.roomKey),
e.buffer.preencode(d, n.encryptionKey),
e.fixed32.preencode(d, n.mailbox),
d.end++,
n.fastForwardTo && e.fixed32.preencode(d, n.fastForwardTo),
n.initiator && a.preencode(d, n.initiator),
n.dm && e.fixed32.preencode(d, n.dm))
},
encode(d, o) {
const c =
(o.fastForwardTo ? 1 : 0) |
(o.initiator ? 2 : 0) |
(o.dm ? 4 : 0) |
(n >= 2 && o.isReadOnly ? 8 : 0)
;($o.encode(d, o.header),
e.fixed32.encode(d, o.roomKey),
e.buffer.encode(d, o.encryptionKey),
e.fixed32.encode(d, o.mailbox),
e.uint.encode(d, c),
o.fastForwardTo && e.fixed32.encode(d, o.fastForwardTo),
o.initiator && a.encode(d, o.initiator),
o.dm && e.fixed32.encode(d, o.dm))
},
decode(d) {
const o = $o.decode(d),
c = e.fixed32.decode(d),
t = e.buffer.decode(d),
r = e.fixed32.decode(d),
i = e.uint.decode(d)
return {
header: o,
roomKey: c,
encryptionKey: t,
mailbox: r,
fastForwardTo: 1 & i ? e.fixed32.decode(d) : null,
initiator: 2 & i ? a.decode(d) : null,
dm: 4 & i ? e.fixed32.decode(d) : null,
isReadOnly: n >= 2 && !!(8 & i),
}
},
},
ec = ce,
dc = {
preencode(d, n) {
;(ec.preencode(d, n.header), e.fixed32.preencode(d, n.discoveryKey))
},
encode(d, n) {
;(ec.encode(d, n.header), e.fixed32.encode(d, n.discoveryKey))
},
decode: (d) => ({ header: ec.decode(d), discoveryKey: e.fixed32.decode(d) }),
},
nc = ce,
oc = Wo,
cc = {
preencode(d, n) {
;(nc.preencode(d, n.header),
e.fixed32.preencode(d, n.roomKey),
e.uint.preencode(d, n.key),
oc.preencode(d, n.status))
},
encode(d, n) {
;(nc.encode(d, n.header),
e.fixed32.encode(d, n.roomKey),
e.uint.encode(d, n.key),
oc.encode(d, n.status))
},
decode: (d) => ({
header: nc.decode(d),
roomKey: e.fixed32.decode(d),
key: e.uint.decode(d),
status: oc.decode(d),
}),
},
tc = {
preencode(e, d) {
e.end++
},
encode(d, n) {
const o = n.isBlocked ? 1 : 0
e.uint.encode(d, o)
},
decode: (d) => ({ isBlocked: !!(1 & e.uint.decode(d)) }),
},
rc = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.memberKey),
e.uint.preencode(d, n.clock),
Xt.preencode(d, n.status),
d.end++,
n.mailbox && e.fixed32.preencode(d, n.mailbox),
n.roomKey && e.fixed32.preencode(d, n.roomKey))
},
encode(d, n) {
const o = (n.mailbox ? 1 : 0) | (n.roomKey ? 2 : 0)
;(e.fixed32.encode(d, n.memberKey),
e.uint.encode(d, n.clock),
Xt.encode(d, n.status),
e.uint.encode(d, o),
n.mailbox && e.fixed32.encode(d, n.mailbox),
n.roomKey && e.fixed32.encode(d, n.roomKey))
},
decode(d) {
const n = e.fixed32.decode(d),
o = e.uint.decode(d),
c = Xt.decode(d),
t = e.uint.decode(d)
return {
memberKey: n,
clock: o,
status: c,
mailbox: 1 & t ? e.fixed32.decode(d) : null,
roomKey: 2 & t ? e.fixed32.decode(d) : null,
}
},
},
ic = ce,
ac = e.frame(To),
sc = {
preencode(e, d) {
;(ic.preencode(e, d.header), ac.preencode(e, d.contact))
},
encode(e, d) {
;(ic.encode(e, d.header), ac.encode(e, d.contact))
},
decode: (e) => ({ header: ic.decode(e), contact: ac.decode(e) }),
},
pc = ce,
uc = {
preencode(d, n) {
;(pc.preencode(d, n.header),
e.fixed32.preencode(d, n.memberKey),
e.uint.preencode(d, n.key),
Yt.preencode(d, n.status))
},
encode(d, n) {
;(pc.encode(d, n.header),
e.fixed32.encode(d, n.memberKey),
e.uint.encode(d, n.key),
Yt.encode(d, n.status))
},
decode: (d) => ({
header: pc.decode(d),
memberKey: e.fixed32.decode(d),
key: e.uint.decode(d),
status: Yt.decode(d),
}),
},
lc = ce,
fc = {
preencode(d, n) {
;(lc.preencode(d, n.header), e.fixed32.preencode(d, n.memberKey))
},
encode(d, n) {
;(lc.encode(d, n.header), e.fixed32.encode(d, n.memberKey))
},
decode: (d) => ({ header: lc.decode(d), memberKey: e.fixed32.decode(d) }),
},
mc = ce,
yc = {
preencode(d, n) {
;(mc.preencode(d, n.header), e.fixed32.preencode(d, n.memberKey))
},
encode(d, n) {
;(mc.encode(d, n.header), e.fixed32.encode(d, n.memberKey))
},
decode: (d) => ({ header: mc.decode(d), memberKey: e.fixed32.decode(d) }),
},
xc = {
preencode(e, d) {
e.end++
},
encode(d, n) {
const o =
(n.isPending ? 1 : 0) |
(n.isAccepted ? 2 : 0) |
(n.isRejected ? 4 : 0) |
(n.isDiscarded ? 8 : 0) |
(n.isSeen ? 16 : 0)
e.uint.encode(d, o)
},
decode(d) {
const n = e.uint.decode(d)
return {
isPending: !!(1 & n),
isAccepted: !!(2 & n),
isRejected: !!(4 & n),
isDiscarded: !!(8 & n),
isSeen: !!(16 & n),
}
},
},
bc = Ae,
kc = e.frame(l),
gc = {
preencode(d, n) {
;(bc.preencode(d, n.sender),
kc.preencode(d, n.keys),
e.fixed32.preencode(d, n.mailbox),
d.end++,
n.message && e.string.preencode(d, n.message))
},
encode(d, n) {
const o = n.message ? 1 : 0
;(bc.encode(d, n.sender),
kc.encode(d, n.keys),
e.fixed32.encode(d, n.mailbox),
e.uint.encode(d, o),
n.message && e.string.encode(d, n.message))
},
decode: (d) => ({
sender: bc.decode(d),
keys: kc.decode(d),
mailbox: e.fixed32.decode(d),
message: 1 & e.uint.decode(d) ? e.string.decode(d) : null,
}),
},
vc = e.frame(gc),
hc = {
preencode(e, d) {
;(vc.preencode(e, d.body), se.preencode(e, d.attestation))
},
encode(e, d) {
;(vc.encode(e, d.body), se.encode(e, d.attestation))
},
decode: (e) => ({ body: vc.decode(e), attestation: se.decode(e) }),
},
Kc = xe,
wc = e.frame(xc),
Pc = kc,
Tc = {
preencode(d, o) {
;(e.fixed32.preencode(d, o.memberKey),
e.uint.preencode(d, o.clock),
Kc.preencode(d, o.sender),
wc.preencode(d, o.status),
Pc.preencode(d, o.keys),
e.fixed32.preencode(d, o.mailbox),
d.end++,
o.message && e.string.preencode(d, o.message),
n >= 2 && o.sentAt && e.uint.preencode(d, o.sentAt))
},
encode(d, o) {
const c = (o.message ? 1 : 0) | (n >= 2 && o.sentAt ? 2 : 0)
;(e.fixed32.encode(d, o.memberKey),
e.uint.encode(d, o.clock),
Kc.encode(d, o.sender),
wc.encode(d, o.status),
Pc.encode(d, o.keys),
e.fixed32.encode(d, o.mailbox),
e.uint.encode(d, c),
o.message && e.string.encode(d, o.message),
n >= 2 && o.sentAt && e.uint.encode(d, o.sentAt))
},
decode(d) {
const o = e.fixed32.decode(d),
c = e.uint.decode(d),
t = Kc.decode(d),
r = wc.decode(d),
i = Pc.decode(d),
a = e.fixed32.decode(d),
s = e.uint.decode(d)
return {
memberKey: o,
clock: c,
sender: t,
status: r,
keys: i,
mailbox: a,
message: 1 & s ? e.string.decode(d) : null,
sentAt: n >= 2 && 2 & s ? e.uint.decode(d) : 0,
}
},
},
Ac = ce,
Rc = {
preencode(d, n) {
;(Ac.preencode(d, n.header), e.buffer.preencode(d, n.blindRequest))
},
encode(d, n) {
;(Ac.encode(d, n.header), e.buffer.encode(d, n.blindRequest))
},
decode: (d) => ({ header: Ac.decode(d), blindRequest: e.buffer.decode(d) }),
},
Cc = ce,
Mc = wc,
qc = {
preencode(d, o) {
;(Cc.preencode(d, o.header),
e.fixed32.preencode(d, o.memberKey),
e.uint.preencode(d, o.key),
Mc.preencode(d, o.status),
d.end++,
n >= 2 && o.roomKey && e.fixed32.preencode(d, o.roomKey))
},
encode(d, o) {
const c = n >= 2 && o.roomKey ? 1 : 0
;(Cc.encode(d, o.header),
e.fixed32.encode(d, o.memberKey),
e.uint.encode(d, o.key),
Mc.encode(d, o.status),
e.uint.encode(d, c),
n >= 2 && o.roomKey && e.fixed32.encode(d, o.roomKey))
},
decode(d) {
const o = Cc.decode(d),
c = e.fixed32.decode(d),
t = e.uint.decode(d),
r = Mc.decode(d),
i = d.start < d.end ? e.uint.decode(d) : 0
return {
header: o,
memberKey: c,
key: t,
status: r,
roomKey: n >= 2 && 1 & i ? e.fixed32.decode(d) : null,
}
},
},
Lc = {
preencode(d, n) {
;(e.uint.preencode(d, n.timestamp),
e.fixed32.preencode(d, n.key),
e.fixed32.preencode(d, n.mailbox))
},
encode(d, n) {
;(e.uint.encode(d, n.timestamp), e.fixed32.encode(d, n.key), e.fixed32.encode(d, n.mailbox))
},
decode: (d) => ({
version: e.uint.decode(d),
timestamp: e.uint.decode(d),
key: e.fixed32.decode(d),
mailbox: e.fixed32.decode(d),
}),
},
Sc = {
preencode(d, n) {
switch ((e.uint.preencode(d, n.version), n.version)) {
case 0:
case 1:
Lc.preencode(d, n)
break
default:
throw new Error("Unsupported version")
}
},
encode(d, n) {
switch ((e.uint.encode(d, n.version), n.version)) {
case 0:
case 1:
Lc.encode(d, n)
break
default:
throw new Error("Unsupported version")
}
},
decode(d) {
const n = d.start,
o = e.uint.decode(d)
switch (((d.start = n), o)) {
case 0:
case 1:
return Lc.decode(d)
default:
throw new Error("Unsupported version")
}
},
},
Dc = {
preencode(d, n) {
e.fixed32.preencode(d, n.memberKey)
},
encode(d, n) {
e.fixed32.encode(d, n.memberKey)
},
decode: (d) => ({ memberKey: e.fixed32.decode(d) }),
},
Fc = xe,
Bc = e.frame(Dc),
Ec = {
preencode(d, n) {
;(e.uint.preencode(d, n.version),
Fc.preencode(d, n.profile),
Bc.preencode(d, n.attestation),
e.uint.preencode(d, n.count))
},
encode(d, n) {
;(e.uint.encode(d, n.version),
Fc.encode(d, n.profile),
Bc.encode(d, n.attestation),
e.uint.encode(d, n.count))
},
decode: (d) => ({
version: e.uint.decode(d),
profile: Fc.decode(d),
attestation: Bc.decode(d),
count: e.uint.decode(d),
}),
},
Ic = {
preencode(d, n) {
;(e.string.preencode(d, n.username), e.fixed32.preencode(d, n.memberKey))
},
encode(d, n) {
;(e.string.encode(d, n.username), e.fixed32.encode(d, n.memberKey))
},
decode: (d) => ({ username: e.string.decode(d), memberKey: e.fixed32.decode(d) }),
},
Nc = I,
jc = {
preencode(d, n) {
e.buffer.preencode(d, n.key)
},
encode(d, n) {
e.buffer.encode(d, n.key)
},
decode: (d) => ({ key: e.buffer.decode(d) }),
},
Oc = xe,
Jc = {
preencode(e, d) {
;(Oc.preencode(e, d.profile), se.preencode(e, d.attestation))
},
encode(e, d) {
;(Oc.encode(e, d.profile), se.encode(e, d.attestation))
},
decode: (e) => ({ profile: Oc.decode(e), attestation: se.decode(e) }),
},
Uc = {
preencode(d, n) {
;(e.string.preencode(d, n.username), se.preencode(d, n.attestation))
},
encode(d, n) {
;(e.string.encode(d, n.username), se.encode(d, n.attestation))
},
decode: (d) => ({ username: e.string.decode(d), attestation: se.decode(d) }),
},
Vc = { en: "en", it: "it", ru: "ru", es: "es", de: "de" },
Hc = {
preencode(e, d) {
e.end++
},
encode(d, n) {
switch (n) {
case "en":
e.uint.encode(d, 1)
break
case "it":
e.uint.encode(d, 2)
break
case "ru":
e.uint.encode(d, 3)
break
case "es":
e.uint.encode(d, 4)
break
case "de":
e.uint.encode(d, 5)
break
default:
throw new Error("Unknown enum")
}
},
decode(d) {
switch (e.uint.decode(d)) {
case 1:
return "en"
case 2:
return "it"
case 3:
return "ru"
case 4:
return "es"
case 5:
return "de"
default:
return null
}
},
},
zc = Xd,
Gc = {
preencode(d, n) {
;(zc.preencode(d, n.range), Hc.preencode(d, n.language), e.string.preencode(d, n.text))
},
encode(d, n) {
;(zc.encode(d, n.range), Hc.encode(d, n.language), e.string.encode(d, n.text))
},
decode: (d) => ({ range: zc.decode(d), language: Hc.decode(d), text: e.string.decode(d) }),
},
Qc = { HttpLink: 1, PearLink: 2 },
Wc = {
preencode(e, d) {
e.end++
},
encode(d, n) {
if (n > 2) throw new Error("Unknown enum")
e.uint.encode(d, n)
},
decode: (d) => e.uint.decode(d),
},
Xc = ce,
Yc = {
preencode(d, n) {
;(Xc.preencode(d, n.header), e.uint.preencode(d, n.from), e.uint.preencode(d, n.to))
},
encode(d, n) {
;(Xc.encode(d, n.header), e.uint.encode(d, n.from), e.uint.encode(d, n.to))
},
decode: (d) => ({ header: Xc.decode(d), from: e.uint.decode(d), to: e.uint.decode(d) }),
},
Zc = {
RoomType: 1,
IsExperimental: 2,
IsJoiningDisabled: 3,
IsAppendingDisabled: 4,
IsCallingDisabled: 5,
IsMembershipEventsDisabled: 6,
},
$c = {
preencode(e, d) {
e.end++
},
encode(d, n) {
if (n > 6) throw new Error("Unknown enum")
e.uint.encode(d, n)
},
decode: (d) => e.uint.decode(d),
},
_c = ce,
et = {
preencode(d, n) {
;(_c.preencode(d, n.header), e.uint.preencode(d, n.value))
},
encode(d, n) {
;(_c.encode(d, n.header), e.uint.encode(d, n.value))
},
decode: (d) => ({ header: _c.decode(d), value: e.uint.decode(d) }),
},
dt = {
preencode(d, n) {
;(e.uint.preencode(d, n.key), e.uint.preencode(d, n.value))
},
encode(d, n) {
;(e.uint.encode(d, n.key), e.uint.encode(d, n.value))
},
decode: (d) => ({ key: e.uint.decode(d), value: e.uint.decode(d) }),
},
nt = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.deviceKey), e.fixed32.preencode(d, n.key))
},
encode(d, n) {
;(e.fixed32.encode(d, n.deviceKey), e.fixed32.encode(d, n.key))
},
decode: (d) => ({ deviceKey: e.fixed32.decode(d), key: e.fixed32.decode(d) }),
},
ot = ce,
ct = {
preencode(d, n) {
;(ot.preencode(d, n.header), e.fixed32.preencode(d, n.key))
},
encode(d, n) {
;(ot.encode(d, n.header), e.fixed32.encode(d, n.key))
},
decode: (d) => ({ header: ot.decode(d), key: e.fixed32.decode(d) }),
},
tt = ce,
rt = {
preencode(d, n) {
;(tt.preencode(d, n.header), e.fixed32.preencode(d, n.key))
},
encode(d, n) {
;(tt.encode(d, n.header), e.fixed32.encode(d, n.key))
},
decode: (d) => ({ header: tt.decode(d), key: e.fixed32.decode(d) }),
},
it = { Flag: 1 },
at = {
preencode(e, d) {
e.end++
},
encode(d, n) {
if (n > 1) throw new Error("Unknown enum")
e.uint.encode(d, n)
},
decode: (d) => e.uint.decode(d),
},
st = {
preencode(d, n) {
;(Rn.preencode(d, n.id),
e.fixed32.preencode(d, n.sender),
e.uint.preencode(d, n.clock),
at.preencode(d, n.label))
},
encode(d, n) {
;(Rn.encode(d, n.id),
e.fixed32.encode(d, n.sender),
e.uint.encode(d, n.clock),
at.encode(d, n.label))
},
decode: (d) => ({
id: Rn.decode(d),
sender: e.fixed32.decode(d),
clock: e.uint.decode(d),
label: at.decode(d),
}),
},
pt = ce,
ut = {
preencode(e, d) {
;(pt.preencode(e, d.header), s.preencode(e, d.oplog), at.preencode(e, d.label))
},
encode(e, d) {
;(pt.encode(e, d.header), s.encode(e, d.oplog), at.encode(e, d.label))
},
decode: (e) => ({ header: pt.decode(e), oplog: s.decode(e), label: at.decode(e) }),
},
lt = ce,
ft = {
preencode(e, d) {
;(lt.preencode(e, d.header), s.preencode(e, d.oplog), at.preencode(e, d.label))
},
encode(e, d) {
;(lt.encode(e, d.header), s.encode(e, d.oplog), at.encode(e, d.label))
},
decode: (e) => ({ header: lt.decode(e), oplog: s.decode(e), label: at.decode(e) }),
},
mt = {
preencode(d, n) {
;(at.preencode(d, n.label), e.uint.preencode(d, n.count))
},
encode(d, n) {
;(at.encode(d, n.label), e.uint.encode(d, n.count))
},
decode: (d) => ({ label: at.decode(d), count: e.uint.decode(d) }),
},
yt = e.array(e.frame(mt)),
xt = {
preencode(d, o) {
;(Rn.preencode(d, o.id),
e.uint.preencode(d, o.total),
yt.preencode(d, o.labels),
e.uint.preencode(d, o.editedAt),
d.end++,
n >= 5 && o.flagsClock && e.uint.preencode(d, o.flagsClock),
n >= 5 && o.version && e.uint.preencode(d, o.version))
},
encode(d, o) {
const c =
(n >= 5 && o.flagsClock ? 1 : 0) |
(n >= 5 && o.version ? 2 : 0) |
(n >= 5 && o.isDeleted ? 4 : 0)
;(Rn.encode(d, o.id),
e.uint.encode(d, o.total),
yt.encode(d, o.labels),
e.uint.encode(d, o.editedAt),
e.uint.encode(d, c),
n >= 5 && o.flagsClock && e.uint.encode(d, o.flagsClock),
n >= 5 && o.version && e.uint.encode(d, o.version))
},
decode(d) {
const o = Rn.decode(d),
c = e.uint.decode(d),
t = yt.decode(d),
r = e.uint.decode(d),
i = d.start < d.end ? e.uint.decode(d) : 0
return {
id: o,
total: c,
labels: t,
editedAt: r,
flagsClock: n >= 5 && 1 & i ? e.uint.decode(d) : 0,
version: n >= 5 && 2 & i ? e.uint.decode(d) : 0,
isDeleted: n >= 5 && !!(4 & i),
}
},
},
bt = ce,
kt = {
preencode(d, n) {
;(bt.preencode(d, n.header), e.uint.preencode(d, n.length))
},
encode(d, n) {
;(bt.encode(d, n.header), e.uint.encode(d, n.length))
},
decode: (d) => ({ header: bt.decode(d), length: e.uint.decode(d) }),
},
gt = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.memberKey), e.uint.preencode(d, n.length))
},
encode(d, n) {
;(e.fixed32.encode(d, n.memberKey), e.uint.encode(d, n.length))
},
decode: (d) => ({ memberKey: e.fixed32.decode(d), length: e.uint.decode(d) }),
},
vt = oe,
ht = {
preencode(e, d) {
e.end++
},
encode(d, o) {
const c = n >= 3 && o.disableReadReceipts ? 1 : 0
e.uint.encode(d, c)
},
decode(d) {
const o = e.uint.decode(d)
return { disableReadReceipts: n >= 3 && !!(1 & o) }
},
},
Kt = { disableReadReceipts: "disableReadReceipts" },
wt = {
preencode(e, d) {
e.end++
},
encode(d, n) {
if ("disableReadReceipts" !== n) throw new Error("Unknown enum")
e.uint.encode(d, 1)
},
decode: (d) => (1 === e.uint.decode(d) ? "disableReadReceipts" : null),
},
Pt = ce,
Tt = e.frame(ht),
At = {
preencode(e, d) {
;(Pt.preencode(e, d.header), wt.preencode(e, d.key), Tt.preencode(e, d.settings))
},
encode(e, d) {
;(Pt.encode(e, d.header), wt.encode(e, d.key), Tt.encode(e, d.settings))
},
decode: (e) => ({ header: Pt.decode(e), key: wt.decode(e), settings: Tt.decode(e) }),
},
Rt = {
preencode(d, o) {
;(e.fixed32.preencode(d, o.memberKey),
d.end++,
n >= 4 && o.reason && e.string.preencode(d, o.reason))
},
encode(d, o) {
const c = n >= 4 && o.reason ? 1 : 0
;(e.fixed32.encode(d, o.memberKey),
e.uint.encode(d, c),
n >= 4 && o.reason && e.string.encode(d, o.reason))
},
decode(d) {
const o = e.fixed32.decode(d),
c = e.uint.decode(d)
return { memberKey: o, reason: n >= 4 && 1 & c ? e.string.decode(d) : null }
},
},
Ct = { Flag: 1 },
Mt = {
preencode(e, d) {
e.end++
},
encode(d, n) {
if (n > 1) throw new Error("Unknown enum")
e.uint.encode(d, n)
},
decode: (d) => e.uint.decode(d),
},
qt = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.key),
e.fixed32.preencode(d, n.sender),
e.uint.preencode(d, n.clock),
Mt.preencode(d, n.label))
},
encode(d, n) {
;(e.fixed32.encode(d, n.key),
e.fixed32.encode(d, n.sender),
e.uint.encode(d, n.clock),
Mt.encode(d, n.label))
},
decode: (d) => ({
key: e.fixed32.decode(d),
sender: e.fixed32.decode(d),
clock: e.uint.decode(d),
label: Mt.decode(d),
}),
},
Lt = ce,
St = {
preencode(d, n) {
;(Lt.preencode(d, n.header), e.fixed32.preencode(d, n.key), Mt.preencode(d, n.label))
},
encode(d, n) {
;(Lt.encode(d, n.header), e.fixed32.encode(d, n.key), Mt.encode(d, n.label))
},
decode: (d) => ({ header: Lt.decode(d), key: e.fixed32.decode(d), label: Mt.decode(d) }),
},
Dt = {
preencode(d, n) {
;(Mt.preencode(d, n.label), e.uint.preencode(d, n.count))
},
encode(d, n) {
;(Mt.encode(d, n.label), e.uint.encode(d, n.count))
},
decode: (d) => ({ label: Mt.decode(d), count: e.uint.decode(d) }),
},
Ft = e.array(e.frame(Dt)),
Bt = {
preencode(d, n) {
;(e.fixed32.preencode(d, n.key),
e.uint.preencode(d, n.total),
Ft.preencode(d, n.labels),
e.uint.preencode(d, n.editedAt),
e.uint.preencode(d, n.flagsClock))
},
encode(d, n) {
;(e.fixed32.encode(d, n.key),
e.uint.encode(d, n.total),
Ft.encode(d, n.labels),
e.uint.encode(d, n.editedAt),
e.uint.encode(d, n.flagsClock))
},
decode: (d) => ({
key: e.fixed32.decode(d),
total: e.uint.decode(d),
labels: Ft.decode(d),
editedAt: e.uint.decode(d),
flagsClock: e.uint.decode(d),
}),
},
Et = {
preencode(d, o) {
;(e.fixed32.preencode(d, o.memberKey),
d.end++,
n >= 5 && o.reason && e.string.preencode(d, o.reason))
},
encode(d, o) {
const c = n >= 5 && o.reason ? 1 : 0
;(e.fixed32.encode(d, o.memberKey),
e.uint.encode(d, c),
n >= 5 && o.reason && e.string.encode(d, o.reason))
},
decode(d) {
const o = e.fixed32.decode(d),
c = e.uint.decode(d)
return { memberKey: o, reason: n >= 5 && 1 & c ? e.string.decode(d) : null }
},
},
It = e.frame(M),
Nt = It,
jt = e.array(Hc),
Ot = e.frame(ye),
Jt = It,
Ut = Ot,
Vt = Ot,
Ht = e.frame(Ad),
zt = e.array(e.frame(Gc)),
Gt = It,
Qt = It,
Wt = e.frame(tc),
Xt = Wt,
Yt = Wt
function Zt(e) {
n = e
}
function $t(d, o, c = 5) {
return ((n = c), e.encode(dr(d), o))
}
function _t(d, o, c = 5) {
return ((n = c), e.decode(dr(d), o))
}
function er(e) {
switch (e) {
case "@keet/room-type":
return Q
case "@keet/room-supported-language":
return Vc
case "@keet/display-type":
return Qc
case "@keet/system-settings-keys":
return Zc
case "@keet/label-type":
return it
case "@keet-private-id/user-settings-key":
return Kt
case "@keet/member-label-type":
return Ct
default:
throw new Error("Enum not found " + e)
}
}
function dr(e) {
switch (e) {
case "@keet-registry/identity-data":
return o
case "@keet-registry/unattested-identity":
return t
case "@keet-registry/identity":
return i
case "@keet/head":
return a
case "@keet/oplog-id":
return s
case "@keet/encryption-keypair":
return p
case "@keet/signing-keypair":
return u
case "@keet/room-keys":
return l
case "@keet/operation-header":
return f
case "@keet/blob-pointer":
return m
case "@keet/file-dimensions":
return y
case "@keet/file-metadata":
return b
case "@keet/external-drive-pointer":
return k
case "@keet/external-blob-pointer":
return g
case "@keet/file-pointer":
return K
case "@keet/file":
return T
case "@keet/image-file":
return M
case "@keet/file-status":
return q
case "@keet/file-record":
return D
case "@keet/device-status":
return F
case "@keet/member-status":
return B
case "@keet/member-moderation-status":
return E
case "@keet/abi":
return I
case "@keet/device-stats":
return N
case "@keet/member-stats":
return j
case "@keet/chat-stats":
return O
case "@keet/file-stats":
return J
case "@keet/stats":
return G
case "@keet/room-type":
return W
case "@keet/system-settings":
return X
case "@keet/system-digest":
return $
case "@keet/room-seed":
return _
case "@keet/room-capabilities":
return ee
case "@keet/room-config":
return ne
case "@keet/blind-peer":
return oe
case "@keet/add-blind-peer-operation":
return re
case "@keet/remove-blind-peer-operation":
return ae
case "@keet/identity-attestation":
return se
case "@keet/device-invitation":
return pe
case "@keet/device":
return fe
case "@keet/member-profile":
return me
case "@keet/device-profile":
return ye
case "@keet/member-update":
return be
case "@keet/device-update":
return ke
case "@keet/member-contact-info":
return ve
case "@keet/signed-pairing-data":
return he
case "@keet/device-request-identity":
return Ke
case "@keet/device-response-identity":
return we
case "@keet/device-identity":
return Pe
case "@keet/device-request-with-invitation":
return Ce
case "@keet/device-request-with-invitation-and-proof":
return qe
case "@keet/device-request-with-member-proof":
return De
case "@keet/device-request":
return Ee
case "@keet/device-response":
return je
case "@keet/invitation-metadata":
return Oe
case "@keet/invitation":
return Ve
case "@keet/add-invitation-operation":
return Ge
case "@keet/remove-invitation-operation":
return We
case "@keet/sendable-room-invitation":
return Xe
case "@keet/readonly-room-invitation":
return Ye
case "@keet/sendable-identity-invitation":
return Ze
case "@keet/sendable-contact-invitation":
return $e
case "@keet/sendable-invitation":
return cd
case "@keet/add-device-operation":
return rd
case "@keet/update-device-operation":
return ad
case "@keet/remove-device-operation":
return pd
case "@keet/start-indexing-operation":
return ud
case "@keet/stop-indexing-operation":
return ld
case "@keet/join-request":
return md
case "@keet/accept-join-request-operation":
return bd
case "@keet/reject-join-request-operation":
return gd
case "@keet/member":
return Kd
case "@keet/full-member":
return Td
case "@keet/member-proofs":
return Ad
case "@keet/update-member-operation":
return Md
case "@keet/change-member-status-operation":
return Sd
case "@keet/change-member-role-operation":
return Fd
case "@keet/remove-member-operation":
return Ed
case "@keet/member-activity":
return Id
case "@keet/member-joined-event":
return Nd
case "@keet/member-left-event":
return jd
case "@keet/member-removed-event":
return Od
case "@keet/title-changed-chat-event":
return Jd
case "@keet/chat-event":
return Gd
case "@keet/sendable-event":
return Qd
case "@keet/display-range":
return Wd
case "@keet/display-content-range":
return Yd
case "@keet/mention-display-item":
return $d
case "@keet/link-preview":
return dn
case "@keet/display-link-item":
return cn
case "@keet/display":
return yn
case "@keet/oplog-message":
return gn
case "@keet/index-message":
return Kn
case "@keet/full-index-message":
return Tn
case "@keet/message-status":
return An
case "@keet/message-index-id":
return Rn
case "@keet/thread":
return Mn
case "@keet/chat-message-record":
return Dn
case "@keet/full-chat-message-record":
return In
case "@keet/add-chat-message-operation":
return On
case "@keet/remove-chat-message-operation":
return Un
case "@keet/update-chat-message-operation":
return zn
case "@keet/pin-chat-message-operation":
return Qn
case "@keet/add-file-preview-operation":
return Xn
case "@keet/reaction":
return Yn
case "@keet/reactions-summary":
return Zn
case "@keet/reactions-digest":
return _n
case "@keet/add-reaction-operation":
return no
case "@keet/remove-reaction-operation":
return co
case "@keet/update-room-config-operation":
return io
case "@keet/group-member":
return ao
case "@keet/user-registry-info":
return so
case "@keet/room-identity":
return uo
case "@keet/genesis-operation":
return go
case "@keet/upgrade-operation":
return ho
case "@keet/update-system-settings-operation":
return Po
case "@keet-private-id/contact":
return To
case "@keet-private-id/v3-room-migration-info":
return Ao
case "@keet-private-id/run-v3-migration-operation":
return Mo
case "@keet-private-id/update-identity-operation":
return Lo
case "@keet-private-id/counters":
return So
case "@keet-private-id/stats":
return Do
case "@keet-private-id/add-entropy-operation":
return Fo
case "@keet-private-id/pending-invitation-identity":
return Bo
case "@keet-private-id/pending-invitation":
return Io
case "@keet-private-id/resolve-pending-invitation-operation":
return jo
case "@keet-private-id/add-pending-invitation-operation":
return Uo
case "@keet-private-id/remove-pending-invitation-operation":
return Ho
case "@keet-private-id/identity-swap":
return zo
case "@keet-private-id/identity-swap-v2":
return Go
case "@keet-private-id/room-status":
return Qo
case "@keet-private-id/room":
return Zo
case "@keet-private-id/add-room-operation":
return _o
case "@keet-private-id/remove-room-operation":
return dc
case "@keet-private-id/update-room-status-operation":
return cc
case "@keet-private-id/contact-status":
return tc
case "@keet-private-id/contact-record":
return rc
case "@keet-private-id/add-contact-operation":
return sc
case "@keet-private-id/update-contact-status-operation":
return uc
case "@keet-private-id/remove-contact-operation":
return fc
case "@keet-private-id/activate-contact-room-operation":
return yc
case "@keet-private-id/contact-request-status":
return xc
case "@keet-private-id/contact-request-body":
return gc
case "@keet-private-id/contact-request":
return hc
case "@keet-private-id/contact-request-record":
return Tc
case "@keet-private-id/add-contact-request-operation":
return Rc
case "@keet-private-id/update-contact-request-status-operation":
return qc
case "@keet-private-id/profile-discovery-record-v1":
return Lc
case "@keet-private-id/profile-discovery-record":
return Sc
case "@keet-registry-v3/attestation-pointer":
return Dc
case "@keet-registry-v3/identity":
return Ec
case "@keet-registry-v3/reserved":
return Ic
case "@keet-registry-v3/manifest":
return Nc
case "@keet-registry-service/writer":
return jc
case "@keet-registry-service/record":
return Jc
case "@keet-registry-service/reservation":
return Uc
case "@keet/room-supported-language":
return Hc
case "@keet/translation-display-item":
return Gc
case "@keet/display-type":
return Wc
case "@keet/migrate-abi-operation":
return Yc
case "@keet/system-settings-keys":
return $c
case "@keet/test-increment-operation":
return et
case "@keet/test-collection-record-1":
return dt
case "@keet-private-id/unreads":
return nt
case "@keet-private-id/add-unreads-key-operation":
return ct
case "@keet-private-id/remove-unreads-key-operation":
return rt
case "@keet/label-type":
return at
case "@keet/chat-label":
return st
case "@keet/add-chat-label-operation":
return ut
case "@keet/remove-chat-label-operation":
return ft
case "@keet/chat-label-summary":
return mt
case "@keet/chat-label-digest":
return xt
case "@keet/update-read-length-operation":
return kt
case "@keet/read-length":
return gt
case "@keet/tmp-removed-member":
return vt
case "@keet-private-id/settings":
return ht
case "@keet-private-id/user-settings-key":
return wt
case "@keet-private-id/update-settings-operation":
return At
case "@keet-registry-service/block-request":
return Rt
case "@keet/member-label-type":
return Mt
case "@keet/member-label":
return qt
case "@keet/add-member-label-operation":
return St
case "@keet/member-label-summary":
return Dt
case "@keet/member-label-digest":
return Bt
case "@keet-registry-v3/blocked":
return Et
default:
throw new Error("Encoder not found " + e)
}
}
function nr(e, d = 5) {
const o = dr(e)
return {
preencode(e, c) {
;((n = d), o.preencode(e, c))
},
encode(e, c) {
;((n = d), o.encode(e, c))
},
decode: (e) => ((n = d), o.decode(e)),
}
}
const or = nr
module.exports = {
resolveStruct: or,
getStruct: nr,
getEnum: er,
getEncoding: dr,
encode: $t,
decode: _t,
setVersion: Zt,
version: n,
}