@kvaser/canking-api
Version:
CanKing API to communicate with the CanKing service using Node.js.
1,670 lines (1,669 loc) • 111 kB
JavaScript
import { aS as u, aT as o, A as s, S, T as x, aa as Be, a9 as we, as as E, W as m, aH as O, aG as T, aF as P, ao as v, an as G, aI as h } from "./measurement_settings.mjs";
import d from "long";
function F() {
return {};
}
const qe = {
encode(e, n = new u()) {
return n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = F();
for (; r.pos < a; ) {
const i = r.uint32();
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {};
},
toJSON(e) {
return {};
},
create(e) {
return qe.fromPartial(e ?? {});
},
fromPartial(e) {
return F();
}
};
var Ze = /* @__PURE__ */ ((e) => (e[e.PROJECT_FILE = 0] = "PROJECT_FILE", e[e.LOG_FILE = 1] = "LOG_FILE", e[e.CAN_DATABASES = 2] = "CAN_DATABASES", e[e.LIN_DATABASES = 3] = "LIN_DATABASES", e[e.UNRECOGNIZED = -1] = "UNRECOGNIZED", e))(Ze || {});
function bn(e) {
switch (e) {
case 0:
case "PROJECT_FILE":
return 0;
case 1:
case "LOG_FILE":
return 1;
case 2:
case "CAN_DATABASES":
return 2;
case 3:
case "LIN_DATABASES":
return 3;
case -1:
case "UNRECOGNIZED":
default:
return -1;
}
}
function jn(e) {
switch (e) {
case 0:
return "PROJECT_FILE";
case 1:
return "LOG_FILE";
case 2:
return "CAN_DATABASES";
case 3:
return "LIN_DATABASES";
case -1:
default:
return "UNRECOGNIZED";
}
}
var Ke = /* @__PURE__ */ ((e) => (e[e.LOG_LEVEL_TRACE = 0] = "LOG_LEVEL_TRACE", e[e.LOG_LEVEL_DEBUG = 1] = "LOG_LEVEL_DEBUG", e[e.LOG_LEVEL_INFORMATION = 2] = "LOG_LEVEL_INFORMATION", e[e.LOG_LEVEL_WARNING = 3] = "LOG_LEVEL_WARNING", e[e.LOG_LEVEL_ERROR = 4] = "LOG_LEVEL_ERROR", e[e.LOG_LEVEL_CRITICAL = 5] = "LOG_LEVEL_CRITICAL", e[e.LOG_LEVEL_NONE = 6] = "LOG_LEVEL_NONE", e[e.UNRECOGNIZED = -1] = "UNRECOGNIZED", e))(Ke || {});
function D(e) {
switch (e) {
case 0:
case "LOG_LEVEL_TRACE":
return 0;
case 1:
case "LOG_LEVEL_DEBUG":
return 1;
case 2:
case "LOG_LEVEL_INFORMATION":
return 2;
case 3:
case "LOG_LEVEL_WARNING":
return 3;
case 4:
case "LOG_LEVEL_ERROR":
return 4;
case 5:
case "LOG_LEVEL_CRITICAL":
return 5;
case 6:
case "LOG_LEVEL_NONE":
return 6;
case -1:
case "UNRECOGNIZED":
default:
return -1;
}
}
function y(e) {
switch (e) {
case 0:
return "LOG_LEVEL_TRACE";
case 1:
return "LOG_LEVEL_DEBUG";
case 2:
return "LOG_LEVEL_INFORMATION";
case 3:
return "LOG_LEVEL_WARNING";
case 4:
return "LOG_LEVEL_ERROR";
case 5:
return "LOG_LEVEL_CRITICAL";
case 6:
return "LOG_LEVEL_NONE";
case -1:
default:
return "UNRECOGNIZED";
}
}
var Qe = /* @__PURE__ */ ((e) => (e[e.APP_EVENT_UNSPECIFIED = 0] = "APP_EVENT_UNSPECIFIED", e[e.APP_EVENT_LICENSE_INFO_CHANGED = 1] = "APP_EVENT_LICENSE_INFO_CHANGED", e[e.UNRECOGNIZED = -1] = "UNRECOGNIZED", e))(Qe || {});
function He(e) {
switch (e) {
case 0:
case "APP_EVENT_UNSPECIFIED":
return 0;
case 1:
case "APP_EVENT_LICENSE_INFO_CHANGED":
return 1;
case -1:
case "UNRECOGNIZED":
default:
return -1;
}
}
function We(e) {
switch (e) {
case 0:
return "APP_EVENT_UNSPECIFIED";
case 1:
return "APP_EVENT_LICENSE_INFO_CHANGED";
case -1:
default:
return "UNRECOGNIZED";
}
}
function U() {
return { preferences: void 0, logLevel: 0 };
}
const Ye = {
encode(e, n = new u()) {
return e.preferences !== void 0 && s.encode(e.preferences, n.uint32(10).fork()).join(), e.logLevel !== 0 && n.uint32(16).int32(e.logLevel), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = U();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.preferences = s.decode(r, r.uint32());
continue;
}
case 2: {
if (i !== 16)
break;
t.logLevel = r.int32();
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
preferences: c(e.preferences) ? s.fromJSON(e.preferences) : void 0,
logLevel: c(e.logLevel) ? D(e.logLevel) : 0
};
},
toJSON(e) {
const n = {};
return e.preferences !== void 0 && (n.preferences = s.toJSON(e.preferences)), e.logLevel !== 0 && (n.logLevel = y(e.logLevel)), n;
},
create(e) {
return Ye.fromPartial(e ?? {});
},
fromPartial(e) {
const n = U();
return n.preferences = e.preferences !== void 0 && e.preferences !== null ? s.fromPartial(e.preferences) : void 0, n.logLevel = e.logLevel ?? 0, n;
}
};
function B() {
return { logLevel: 0 };
}
const $e = {
encode(e, n = new u()) {
return e.logLevel !== 0 && n.uint32(8).int32(e.logLevel), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = B();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 8)
break;
t.logLevel = r.int32();
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return { logLevel: c(e.logLevel) ? D(e.logLevel) : 0 };
},
toJSON(e) {
const n = {};
return e.logLevel !== 0 && (n.logLevel = y(e.logLevel)), n;
},
create(e) {
return $e.fromPartial(e ?? {});
},
fromPartial(e) {
const n = B();
return n.logLevel = e.logLevel ?? 0, n;
}
};
function w() {
return { time: d.ZERO, logLevel: 0, eventId: 0, categoryName: "", message: "" };
}
const g = {
encode(e, n = new u()) {
return e.time.equals(d.ZERO) || n.uint32(8).int64(e.time.toString()), e.logLevel !== 0 && n.uint32(16).int32(e.logLevel), e.eventId !== 0 && n.uint32(24).int32(e.eventId), e.categoryName !== "" && n.uint32(34).string(e.categoryName), e.message !== "" && n.uint32(42).string(e.message), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = w();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 8)
break;
t.time = d.fromString(r.int64().toString());
continue;
}
case 2: {
if (i !== 16)
break;
t.logLevel = r.int32();
continue;
}
case 3: {
if (i !== 24)
break;
t.eventId = r.int32();
continue;
}
case 4: {
if (i !== 34)
break;
t.categoryName = r.string();
continue;
}
case 5: {
if (i !== 42)
break;
t.message = r.string();
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
time: c(e.time) ? d.fromValue(e.time) : d.ZERO,
logLevel: c(e.logLevel) ? D(e.logLevel) : 0,
eventId: c(e.eventId) ? globalThis.Number(e.eventId) : 0,
categoryName: c(e.categoryName) ? globalThis.String(e.categoryName) : "",
message: c(e.message) ? globalThis.String(e.message) : ""
};
},
toJSON(e) {
const n = {};
return e.time.equals(d.ZERO) || (n.time = (e.time || d.ZERO).toString()), e.logLevel !== 0 && (n.logLevel = y(e.logLevel)), e.eventId !== 0 && (n.eventId = Math.round(e.eventId)), e.categoryName !== "" && (n.categoryName = e.categoryName), e.message !== "" && (n.message = e.message), n;
},
create(e) {
return g.fromPartial(e ?? {});
},
fromPartial(e) {
const n = w();
return n.time = e.time !== void 0 && e.time !== null ? d.fromValue(e.time) : d.ZERO, n.logLevel = e.logLevel ?? 0, n.eventId = e.eventId ?? 0, n.categoryName = e.categoryName ?? "", n.message = e.message ?? "", n;
}
};
function q() {
return { items: [] };
}
const ze = {
encode(e, n = new u()) {
for (const r of e.items)
g.encode(r, n.uint32(10).fork()).join();
return n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = q();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.items.push(g.decode(r, r.uint32()));
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
items: globalThis.Array.isArray(e == null ? void 0 : e.items) ? e.items.map((n) => g.fromJSON(n)) : []
};
},
toJSON(e) {
var r;
const n = {};
return (r = e.items) != null && r.length && (n.items = e.items.map((a) => g.toJSON(a))), n;
},
create(e) {
return ze.fromPartial(e ?? {});
},
fromPartial(e) {
var r;
const n = q();
return n.items = ((r = e.items) == null ? void 0 : r.map((a) => g.fromPartial(a))) || [], n;
}
};
function Z() {
return {
licenseKey: "",
productId: "",
productName: "",
productVersion: "",
instanceId: "",
instanceName: "",
expirationDate: d.ZERO,
isValid: !1
};
}
const N = {
encode(e, n = new u()) {
return e.licenseKey !== "" && n.uint32(10).string(e.licenseKey), e.productId !== "" && n.uint32(18).string(e.productId), e.productName !== "" && n.uint32(26).string(e.productName), e.productVersion !== "" && n.uint32(34).string(e.productVersion), e.instanceId !== "" && n.uint32(42).string(e.instanceId), e.instanceName !== "" && n.uint32(50).string(e.instanceName), e.expirationDate.equals(d.ZERO) || n.uint32(56).int64(e.expirationDate.toString()), e.isValid !== !1 && n.uint32(64).bool(e.isValid), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = Z();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.licenseKey = r.string();
continue;
}
case 2: {
if (i !== 18)
break;
t.productId = r.string();
continue;
}
case 3: {
if (i !== 26)
break;
t.productName = r.string();
continue;
}
case 4: {
if (i !== 34)
break;
t.productVersion = r.string();
continue;
}
case 5: {
if (i !== 42)
break;
t.instanceId = r.string();
continue;
}
case 6: {
if (i !== 50)
break;
t.instanceName = r.string();
continue;
}
case 7: {
if (i !== 56)
break;
t.expirationDate = d.fromString(r.int64().toString());
continue;
}
case 8: {
if (i !== 64)
break;
t.isValid = r.bool();
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
licenseKey: c(e.licenseKey) ? globalThis.String(e.licenseKey) : "",
productId: c(e.productId) ? globalThis.String(e.productId) : "",
productName: c(e.productName) ? globalThis.String(e.productName) : "",
productVersion: c(e.productVersion) ? globalThis.String(e.productVersion) : "",
instanceId: c(e.instanceId) ? globalThis.String(e.instanceId) : "",
instanceName: c(e.instanceName) ? globalThis.String(e.instanceName) : "",
expirationDate: c(e.expirationDate) ? d.fromValue(e.expirationDate) : d.ZERO,
isValid: c(e.isValid) ? globalThis.Boolean(e.isValid) : !1
};
},
toJSON(e) {
const n = {};
return e.licenseKey !== "" && (n.licenseKey = e.licenseKey), e.productId !== "" && (n.productId = e.productId), e.productName !== "" && (n.productName = e.productName), e.productVersion !== "" && (n.productVersion = e.productVersion), e.instanceId !== "" && (n.instanceId = e.instanceId), e.instanceName !== "" && (n.instanceName = e.instanceName), e.expirationDate.equals(d.ZERO) || (n.expirationDate = (e.expirationDate || d.ZERO).toString()), e.isValid !== !1 && (n.isValid = e.isValid), n;
},
create(e) {
return N.fromPartial(e ?? {});
},
fromPartial(e) {
const n = Z();
return n.licenseKey = e.licenseKey ?? "", n.productId = e.productId ?? "", n.productName = e.productName ?? "", n.productVersion = e.productVersion ?? "", n.instanceId = e.instanceId ?? "", n.instanceName = e.instanceName ?? "", n.expirationDate = e.expirationDate !== void 0 && e.expirationDate !== null ? d.fromValue(e.expirationDate) : d.ZERO, n.isValid = e.isValid ?? !1, n;
}
};
function K() {
return { items: [] };
}
const k = {
encode(e, n = new u()) {
for (const r of e.items)
N.encode(r, n.uint32(10).fork()).join();
return n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = K();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.items.push(N.decode(r, r.uint32()));
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
items: globalThis.Array.isArray(e == null ? void 0 : e.items) ? e.items.map((n) => N.fromJSON(n)) : []
};
},
toJSON(e) {
var r;
const n = {};
return (r = e.items) != null && r.length && (n.items = e.items.map((a) => N.toJSON(a))), n;
},
create(e) {
return k.fromPartial(e ?? {});
},
fromPartial(e) {
var r;
const n = K();
return n.items = ((r = e.items) == null ? void 0 : r.map((a) => N.fromPartial(a))) || [], n;
}
};
function Q() {
return { eventType: 0, licenses: void 0 };
}
const Xe = {
encode(e, n = new u()) {
return e.eventType !== 0 && n.uint32(8).int32(e.eventType), e.licenses !== void 0 && k.encode(e.licenses, n.uint32(18).fork()).join(), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = Q();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 8)
break;
t.eventType = r.int32();
continue;
}
case 2: {
if (i !== 18)
break;
t.licenses = k.decode(r, r.uint32());
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
eventType: c(e.eventType) ? He(e.eventType) : 0,
licenses: c(e.licenses) ? k.fromJSON(e.licenses) : void 0
};
},
toJSON(e) {
const n = {};
return e.eventType !== 0 && (n.eventType = We(e.eventType)), e.licenses !== void 0 && (n.licenses = k.toJSON(e.licenses)), n;
},
create(e) {
return Xe.fromPartial(e ?? {});
},
fromPartial(e) {
const n = Q();
return n.eventType = e.eventType ?? 0, n.licenses = e.licenses !== void 0 && e.licenses !== null ? k.fromPartial(e.licenses) : void 0, n;
}
};
function H() {
return { preferences: void 0, filePath: "", replaceExisting: void 0 };
}
const be = {
encode(e, n = new u()) {
return e.preferences !== void 0 && s.encode(e.preferences, n.uint32(10).fork()).join(), e.filePath !== "" && n.uint32(18).string(e.filePath), e.replaceExisting !== void 0 && n.uint32(24).bool(e.replaceExisting), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = H();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.preferences = s.decode(r, r.uint32());
continue;
}
case 2: {
if (i !== 18)
break;
t.filePath = r.string();
continue;
}
case 3: {
if (i !== 24)
break;
t.replaceExisting = r.bool();
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
preferences: c(e.preferences) ? s.fromJSON(e.preferences) : void 0,
filePath: c(e.filePath) ? globalThis.String(e.filePath) : "",
replaceExisting: c(e.replaceExisting) ? globalThis.Boolean(e.replaceExisting) : void 0
};
},
toJSON(e) {
const n = {};
return e.preferences !== void 0 && (n.preferences = s.toJSON(e.preferences)), e.filePath !== "" && (n.filePath = e.filePath), e.replaceExisting !== void 0 && (n.replaceExisting = e.replaceExisting), n;
},
create(e) {
return be.fromPartial(e ?? {});
},
fromPartial(e) {
const n = H();
return n.preferences = e.preferences !== void 0 && e.preferences !== null ? s.fromPartial(e.preferences) : void 0, n.filePath = e.filePath ?? "", n.replaceExisting = e.replaceExisting ?? void 0, n;
}
};
function W() {
return { preferences: void 0, name: "" };
}
const je = {
encode(e, n = new u()) {
return e.preferences !== void 0 && s.encode(e.preferences, n.uint32(10).fork()).join(), e.name !== "" && n.uint32(18).string(e.name), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = W();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.preferences = s.decode(r, r.uint32());
continue;
}
case 2: {
if (i !== 18)
break;
t.name = r.string();
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
preferences: c(e.preferences) ? s.fromJSON(e.preferences) : void 0,
name: c(e.name) ? globalThis.String(e.name) : ""
};
},
toJSON(e) {
const n = {};
return e.preferences !== void 0 && (n.preferences = s.toJSON(e.preferences)), e.name !== "" && (n.name = e.name), n;
},
create(e) {
return je.fromPartial(e ?? {});
},
fromPartial(e) {
const n = W();
return n.preferences = e.preferences !== void 0 && e.preferences !== null ? s.fromPartial(e.preferences) : void 0, n.name = e.name ?? "", n;
}
};
function Y() {
return { preferences: void 0, filePathOrName: "" };
}
const en = {
encode(e, n = new u()) {
return e.preferences !== void 0 && s.encode(e.preferences, n.uint32(10).fork()).join(), e.filePathOrName !== "" && n.uint32(18).string(e.filePathOrName), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = Y();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.preferences = s.decode(r, r.uint32());
continue;
}
case 2: {
if (i !== 18)
break;
t.filePathOrName = r.string();
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
preferences: c(e.preferences) ? s.fromJSON(e.preferences) : void 0,
filePathOrName: c(e.filePathOrName) ? globalThis.String(e.filePathOrName) : ""
};
},
toJSON(e) {
const n = {};
return e.preferences !== void 0 && (n.preferences = s.toJSON(e.preferences)), e.filePathOrName !== "" && (n.filePathOrName = e.filePathOrName), n;
},
create(e) {
return en.fromPartial(e ?? {});
},
fromPartial(e) {
const n = Y();
return n.preferences = e.preferences !== void 0 && e.preferences !== null ? s.fromPartial(e.preferences) : void 0, n.filePathOrName = e.filePathOrName ?? "", n;
}
};
function $() {
return { name: "", displayName: "", description: "", version: "", author: "", defaultConfig: "" };
}
const nn = {
encode(e, n = new u()) {
return e.name !== "" && n.uint32(10).string(e.name), e.displayName !== "" && n.uint32(18).string(e.displayName), e.description !== "" && n.uint32(26).string(e.description), e.version !== "" && n.uint32(34).string(e.version), e.author !== "" && n.uint32(42).string(e.author), e.defaultConfig !== "" && n.uint32(50).string(e.defaultConfig), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = $();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.name = r.string();
continue;
}
case 2: {
if (i !== 18)
break;
t.displayName = r.string();
continue;
}
case 3: {
if (i !== 26)
break;
t.description = r.string();
continue;
}
case 4: {
if (i !== 34)
break;
t.version = r.string();
continue;
}
case 5: {
if (i !== 42)
break;
t.author = r.string();
continue;
}
case 6: {
if (i !== 50)
break;
t.defaultConfig = r.string();
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
name: c(e.name) ? globalThis.String(e.name) : "",
displayName: c(e.displayName) ? globalThis.String(e.displayName) : "",
description: c(e.description) ? globalThis.String(e.description) : "",
version: c(e.version) ? globalThis.String(e.version) : "",
author: c(e.author) ? globalThis.String(e.author) : "",
defaultConfig: c(e.defaultConfig) ? globalThis.String(e.defaultConfig) : ""
};
},
toJSON(e) {
const n = {};
return e.name !== "" && (n.name = e.name), e.displayName !== "" && (n.displayName = e.displayName), e.description !== "" && (n.description = e.description), e.version !== "" && (n.version = e.version), e.author !== "" && (n.author = e.author), e.defaultConfig !== "" && (n.defaultConfig = e.defaultConfig), n;
},
create(e) {
return nn.fromPartial(e ?? {});
},
fromPartial(e) {
const n = $();
return n.name = e.name ?? "", n.displayName = e.displayName ?? "", n.description = e.description ?? "", n.version = e.version ?? "", n.author = e.author ?? "", n.defaultConfig = e.defaultConfig ?? "", n;
}
};
function z() {
return { licenses: [] };
}
const rn = {
encode(e, n = new u()) {
for (const r of e.licenses)
N.encode(r, n.uint32(10).fork()).join();
return n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = z();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.licenses.push(N.decode(r, r.uint32()));
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
licenses: globalThis.Array.isArray(e == null ? void 0 : e.licenses) ? e.licenses.map((n) => N.fromJSON(n)) : []
};
},
toJSON(e) {
var r;
const n = {};
return (r = e.licenses) != null && r.length && (n.licenses = e.licenses.map((a) => N.toJSON(a))), n;
},
create(e) {
return rn.fromPartial(e ?? {});
},
fromPartial(e) {
var r;
const n = z();
return n.licenses = ((r = e.licenses) == null ? void 0 : r.map((a) => N.fromPartial(a))) || [], n;
}
};
function X() {
return { preferences: void 0, licenseKey: "", productId: "" };
}
const tn = {
encode(e, n = new u()) {
return e.preferences !== void 0 && s.encode(e.preferences, n.uint32(10).fork()).join(), e.licenseKey !== "" && n.uint32(18).string(e.licenseKey), e.productId !== "" && n.uint32(26).string(e.productId), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = X();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.preferences = s.decode(r, r.uint32());
continue;
}
case 2: {
if (i !== 18)
break;
t.licenseKey = r.string();
continue;
}
case 3: {
if (i !== 26)
break;
t.productId = r.string();
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
preferences: c(e.preferences) ? s.fromJSON(e.preferences) : void 0,
licenseKey: c(e.licenseKey) ? globalThis.String(e.licenseKey) : "",
productId: c(e.productId) ? globalThis.String(e.productId) : ""
};
},
toJSON(e) {
const n = {};
return e.preferences !== void 0 && (n.preferences = s.toJSON(e.preferences)), e.licenseKey !== "" && (n.licenseKey = e.licenseKey), e.productId !== "" && (n.productId = e.productId), n;
},
create(e) {
return tn.fromPartial(e ?? {});
},
fromPartial(e) {
const n = X();
return n.preferences = e.preferences !== void 0 && e.preferences !== null ? s.fromPartial(e.preferences) : void 0, n.licenseKey = e.licenseKey ?? "", n.productId = e.productId ?? "", n;
}
};
function b() {
return { apiVersion: "", serviceVersion: "", canlibVersion: "" };
}
const an = {
encode(e, n = new u()) {
return e.apiVersion !== "" && n.uint32(10).string(e.apiVersion), e.serviceVersion !== "" && n.uint32(18).string(e.serviceVersion), e.canlibVersion !== "" && n.uint32(26).string(e.canlibVersion), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = b();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.apiVersion = r.string();
continue;
}
case 2: {
if (i !== 18)
break;
t.serviceVersion = r.string();
continue;
}
case 3: {
if (i !== 26)
break;
t.canlibVersion = r.string();
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
apiVersion: c(e.apiVersion) ? globalThis.String(e.apiVersion) : "",
serviceVersion: c(e.serviceVersion) ? globalThis.String(e.serviceVersion) : "",
canlibVersion: c(e.canlibVersion) ? globalThis.String(e.canlibVersion) : ""
};
},
toJSON(e) {
const n = {};
return e.apiVersion !== "" && (n.apiVersion = e.apiVersion), e.serviceVersion !== "" && (n.serviceVersion = e.serviceVersion), e.canlibVersion !== "" && (n.canlibVersion = e.canlibVersion), n;
},
create(e) {
return an.fromPartial(e ?? {});
},
fromPartial(e) {
const n = b();
return n.apiVersion = e.apiVersion ?? "", n.serviceVersion = e.serviceVersion ?? "", n.canlibVersion = e.canlibVersion ?? "", n;
}
};
function c(e) {
return e != null;
}
var sn = /* @__PURE__ */ ((e) => (e[e.MEASUREMENT_EVENT_UNSPECIFIED = 0] = "MEASUREMENT_EVENT_UNSPECIFIED", e[e.MEASUREMENT_EVENT_MEASUREMENT_SETUP_CHANGED = 1] = "MEASUREMENT_EVENT_MEASUREMENT_SETUP_CHANGED", e[e.MEASUREMENT_EVENT_ONLINE_STATUS_CHANGED = 2] = "MEASUREMENT_EVENT_ONLINE_STATUS_CHANGED", e[e.MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STARTED = 3] = "MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STARTED", e[e.MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STOPPED = 4] = "MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STOPPED", e[e.UNRECOGNIZED = -1] = "UNRECOGNIZED", e))(sn || {});
function on(e) {
switch (e) {
case 0:
case "MEASUREMENT_EVENT_UNSPECIFIED":
return 0;
case 1:
case "MEASUREMENT_EVENT_MEASUREMENT_SETUP_CHANGED":
return 1;
case 2:
case "MEASUREMENT_EVENT_ONLINE_STATUS_CHANGED":
return 2;
case 3:
case "MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STARTED":
return 3;
case 4:
case "MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STOPPED":
return 4;
case -1:
case "UNRECOGNIZED":
default:
return -1;
}
}
function fn(e) {
switch (e) {
case 0:
return "MEASUREMENT_EVENT_UNSPECIFIED";
case 1:
return "MEASUREMENT_EVENT_MEASUREMENT_SETUP_CHANGED";
case 2:
return "MEASUREMENT_EVENT_ONLINE_STATUS_CHANGED";
case 3:
return "MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STARTED";
case 4:
return "MEASUREMENT_EVENT_PERIODIC_TRANSMISSION_STOPPED";
case -1:
default:
return "UNRECOGNIZED";
}
}
function j() {
return { preferences: void 0, setup: void 0 };
}
const un = {
encode(e, n = new u()) {
return e.preferences !== void 0 && s.encode(e.preferences, n.uint32(10).fork()).join(), e.setup !== void 0 && h.encode(e.setup, n.uint32(18).fork()).join(), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = j();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.preferences = s.decode(r, r.uint32());
continue;
}
case 2: {
if (i !== 18)
break;
t.setup = h.decode(r, r.uint32());
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
preferences: f(e.preferences) ? s.fromJSON(e.preferences) : void 0,
setup: f(e.setup) ? h.fromJSON(e.setup) : void 0
};
},
toJSON(e) {
const n = {};
return e.preferences !== void 0 && (n.preferences = s.toJSON(e.preferences)), e.setup !== void 0 && (n.setup = h.toJSON(e.setup)), n;
},
create(e) {
return un.fromPartial(e ?? {});
},
fromPartial(e) {
const n = j();
return n.preferences = e.preferences !== void 0 && e.preferences !== null ? s.fromPartial(e.preferences) : void 0, n.setup = e.setup !== void 0 && e.setup !== null ? h.fromPartial(e.setup) : void 0, n;
}
};
function ee() {
return { preferences: void 0, configuration: void 0 };
}
const dn = {
encode(e, n = new u()) {
return e.preferences !== void 0 && s.encode(e.preferences, n.uint32(10).fork()).join(), e.configuration !== void 0 && G.encode(e.configuration, n.uint32(18).fork()).join(), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = ee();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.preferences = s.decode(r, r.uint32());
continue;
}
case 2: {
if (i !== 18)
break;
t.configuration = G.decode(r, r.uint32());
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
preferences: f(e.preferences) ? s.fromJSON(e.preferences) : void 0,
configuration: f(e.configuration) ? G.fromJSON(e.configuration) : void 0
};
},
toJSON(e) {
const n = {};
return e.preferences !== void 0 && (n.preferences = s.toJSON(e.preferences)), e.configuration !== void 0 && (n.configuration = G.toJSON(e.configuration)), n;
},
create(e) {
return dn.fromPartial(e ?? {});
},
fromPartial(e) {
const n = ee();
return n.preferences = e.preferences !== void 0 && e.preferences !== null ? s.fromPartial(e.preferences) : void 0, n.configuration = e.configuration !== void 0 && e.configuration !== null ? G.fromPartial(e.configuration) : void 0, n;
}
};
function ne() {
return { preferences: void 0, configuration: void 0 };
}
const cn = {
encode(e, n = new u()) {
return e.preferences !== void 0 && s.encode(e.preferences, n.uint32(10).fork()).join(), e.configuration !== void 0 && v.encode(e.configuration, n.uint32(18).fork()).join(), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = ne();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.preferences = s.decode(r, r.uint32());
continue;
}
case 2: {
if (i !== 18)
break;
t.configuration = v.decode(r, r.uint32());
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
preferences: f(e.preferences) ? s.fromJSON(e.preferences) : void 0,
configuration: f(e.configuration) ? v.fromJSON(e.configuration) : void 0
};
},
toJSON(e) {
const n = {};
return e.preferences !== void 0 && (n.preferences = s.toJSON(e.preferences)), e.configuration !== void 0 && (n.configuration = v.toJSON(e.configuration)), n;
},
create(e) {
return cn.fromPartial(e ?? {});
},
fromPartial(e) {
const n = ne();
return n.preferences = e.preferences !== void 0 && e.preferences !== null ? s.fromPartial(e.preferences) : void 0, n.configuration = e.configuration !== void 0 && e.configuration !== null ? v.fromPartial(e.configuration) : void 0, n;
}
};
function re() {
return { preferences: void 0, source: void 0, replaceAllProperties: !1 };
}
const ln = {
encode(e, n = new u()) {
return e.preferences !== void 0 && s.encode(e.preferences, n.uint32(10).fork()).join(), e.source !== void 0 && P.encode(e.source, n.uint32(18).fork()).join(), e.replaceAllProperties !== !1 && n.uint32(24).bool(e.replaceAllProperties), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = re();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.preferences = s.decode(r, r.uint32());
continue;
}
case 2: {
if (i !== 18)
break;
t.source = P.decode(r, r.uint32());
continue;
}
case 3: {
if (i !== 24)
break;
t.replaceAllProperties = r.bool();
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
preferences: f(e.preferences) ? s.fromJSON(e.preferences) : void 0,
source: f(e.source) ? P.fromJSON(e.source) : void 0,
replaceAllProperties: f(e.replaceAllProperties) ? globalThis.Boolean(e.replaceAllProperties) : !1
};
},
toJSON(e) {
const n = {};
return e.preferences !== void 0 && (n.preferences = s.toJSON(e.preferences)), e.source !== void 0 && (n.source = P.toJSON(e.source)), e.replaceAllProperties !== !1 && (n.replaceAllProperties = e.replaceAllProperties), n;
},
create(e) {
return ln.fromPartial(e ?? {});
},
fromPartial(e) {
const n = re();
return n.preferences = e.preferences !== void 0 && e.preferences !== null ? s.fromPartial(e.preferences) : void 0, n.source = e.source !== void 0 && e.source !== null ? P.fromPartial(e.source) : void 0, n.replaceAllProperties = e.replaceAllProperties ?? !1, n;
}
};
function ie() {
return { source: void 0 };
}
const pn = {
encode(e, n = new u()) {
return e.source !== void 0 && P.encode(e.source, n.uint32(10).fork()).join(), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = ie();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.source = P.decode(r, r.uint32());
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return { source: f(e.source) ? P.fromJSON(e.source) : void 0 };
},
toJSON(e) {
const n = {};
return e.source !== void 0 && (n.source = P.toJSON(e.source)), n;
},
create(e) {
return pn.fromPartial(e ?? {});
},
fromPartial(e) {
const n = ie();
return n.source = e.source !== void 0 && e.source !== null ? P.fromPartial(e.source) : void 0, n;
}
};
function te() {
return {
preferences: void 0,
dataProcessor: void 0,
previousNode: "",
nextNode: "",
replaceAllProperties: !1
};
}
const Sn = {
encode(e, n = new u()) {
return e.preferences !== void 0 && s.encode(e.preferences, n.uint32(10).fork()).join(), e.dataProcessor !== void 0 && T.encode(e.dataProcessor, n.uint32(18).fork()).join(), e.previousNode !== "" && n.uint32(26).string(e.previousNode), e.nextNode !== "" && n.uint32(34).string(e.nextNode), e.replaceAllProperties !== !1 && n.uint32(40).bool(e.replaceAllProperties), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = te();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.preferences = s.decode(r, r.uint32());
continue;
}
case 2: {
if (i !== 18)
break;
t.dataProcessor = T.decode(r, r.uint32());
continue;
}
case 3: {
if (i !== 26)
break;
t.previousNode = r.string();
continue;
}
case 4: {
if (i !== 34)
break;
t.nextNode = r.string();
continue;
}
case 5: {
if (i !== 40)
break;
t.replaceAllProperties = r.bool();
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
preferences: f(e.preferences) ? s.fromJSON(e.preferences) : void 0,
dataProcessor: f(e.dataProcessor) ? T.fromJSON(e.dataProcessor) : void 0,
previousNode: f(e.previousNode) ? globalThis.String(e.previousNode) : "",
nextNode: f(e.nextNode) ? globalThis.String(e.nextNode) : "",
replaceAllProperties: f(e.replaceAllProperties) ? globalThis.Boolean(e.replaceAllProperties) : !1
};
},
toJSON(e) {
const n = {};
return e.preferences !== void 0 && (n.preferences = s.toJSON(e.preferences)), e.dataProcessor !== void 0 && (n.dataProcessor = T.toJSON(e.dataProcessor)), e.previousNode !== "" && (n.previousNode = e.previousNode), e.nextNode !== "" && (n.nextNode = e.nextNode), e.replaceAllProperties !== !1 && (n.replaceAllProperties = e.replaceAllProperties), n;
},
create(e) {
return Sn.fromPartial(e ?? {});
},
fromPartial(e) {
const n = te();
return n.preferences = e.preferences !== void 0 && e.preferences !== null ? s.fromPartial(e.preferences) : void 0, n.dataProcessor = e.dataProcessor !== void 0 && e.dataProcessor !== null ? T.fromPartial(e.dataProcessor) : void 0, n.previousNode = e.previousNode ?? "", n.nextNode = e.nextNode ?? "", n.replaceAllProperties = e.replaceAllProperties ?? !1, n;
}
};
function ae() {
return { dataProcessor: void 0 };
}
const Nn = {
encode(e, n = new u()) {
return e.dataProcessor !== void 0 && T.encode(e.dataProcessor, n.uint32(10).fork()).join(), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = ae();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.dataProcessor = T.decode(r, r.uint32());
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
dataProcessor: f(e.dataProcessor) ? T.fromJSON(e.dataProcessor) : void 0
};
},
toJSON(e) {
const n = {};
return e.dataProcessor !== void 0 && (n.dataProcessor = T.toJSON(e.dataProcessor)), n;
},
create(e) {
return Nn.fromPartial(e ?? {});
},
fromPartial(e) {
const n = ae();
return n.dataProcessor = e.dataProcessor !== void 0 && e.dataProcessor !== null ? T.fromPartial(e.dataProcessor) : void 0, n;
}
};
function se() {
return { preferences: void 0, target: void 0, replaceAllProperties: !1 };
}
const En = {
encode(e, n = new u()) {
return e.preferences !== void 0 && s.encode(e.preferences, n.uint32(10).fork()).join(), e.target !== void 0 && O.encode(e.target, n.uint32(18).fork()).join(), e.replaceAllProperties !== !1 && n.uint32(24).bool(e.replaceAllProperties), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = se();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.preferences = s.decode(r, r.uint32());
continue;
}
case 2: {
if (i !== 18)
break;
t.target = O.decode(r, r.uint32());
continue;
}
case 3: {
if (i !== 24)
break;
t.replaceAllProperties = r.bool();
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
preferences: f(e.preferences) ? s.fromJSON(e.preferences) : void 0,
target: f(e.target) ? O.fromJSON(e.target) : void 0,
replaceAllProperties: f(e.replaceAllProperties) ? globalThis.Boolean(e.replaceAllProperties) : !1
};
},
toJSON(e) {
const n = {};
return e.preferences !== void 0 && (n.preferences = s.toJSON(e.preferences)), e.target !== void 0 && (n.target = O.toJSON(e.target)), e.replaceAllProperties !== !1 && (n.replaceAllProperties = e.replaceAllProperties), n;
},
create(e) {
return En.fromPartial(e ?? {});
},
fromPartial(e) {
const n = se();
return n.preferences = e.preferences !== void 0 && e.preferences !== null ? s.fromPartial(e.preferences) : void 0, n.target = e.target !== void 0 && e.target !== null ? O.fromPartial(e.target) : void 0, n.replaceAllProperties = e.replaceAllProperties ?? !1, n;
}
};
function oe() {
return { target: void 0 };
}
const mn = {
encode(e, n = new u()) {
return e.target !== void 0 && O.encode(e.target, n.uint32(10).fork()).join(), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = oe();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.target = O.decode(r, r.uint32());
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return { target: f(e.target) ? O.fromJSON(e.target) : void 0 };
},
toJSON(e) {
const n = {};
return e.target !== void 0 && (n.target = O.toJSON(e.target)), n;
},
create(e) {
return mn.fromPartial(e ?? {});
},
fromPartial(e) {
const n = oe();
return n.target = e.target !== void 0 && e.target !== null ? O.fromPartial(e.target) : void 0, n;
}
};
function fe() {
return { preferences: void 0, startNode: "", endNode: "" };
}
const On = {
encode(e, n = new u()) {
return e.preferences !== void 0 && s.encode(e.preferences, n.uint32(10).fork()).join(), e.startNode !== "" && n.uint32(18).string(e.startNode), e.endNode !== "" && n.uint32(26).string(e.endNode), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = fe();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.preferences = s.decode(r, r.uint32());
continue;
}
case 2: {
if (i !== 18)
break;
t.startNode = r.string();
continue;
}
case 3: {
if (i !== 26)
break;
t.endNode = r.string();
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
preferences: f(e.preferences) ? s.fromJSON(e.preferences) : void 0,
startNode: f(e.startNode) ? globalThis.String(e.startNode) : "",
endNode: f(e.endNode) ? globalThis.String(e.endNode) : ""
};
},
toJSON(e) {
const n = {};
return e.preferences !== void 0 && (n.preferences = s.toJSON(e.preferences)), e.startNode !== "" && (n.startNode = e.startNode), e.endNode !== "" && (n.endNode = e.endNode), n;
},
create(e) {
return On.fromPartial(e ?? {});
},
fromPartial(e) {
const n = fe();
return n.preferences = e.preferences !== void 0 && e.preferences !== null ? s.fromPartial(e.preferences) : void 0, n.startNode = e.startNode ?? "", n.endNode = e.endNode ?? "", n;
}
};
function ue() {
return { preferences: void 0, startNode: "", endNode: "" };
}
const Tn = {
encode(e, n = new u()) {
return e.preferences !== void 0 && s.encode(e.preferences, n.uint32(10).fork()).join(), e.startNode !== "" && n.uint32(18).string(e.startNode), e.endNode !== "" && n.uint32(26).string(e.endNode), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = ue();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.preferences = s.decode(r, r.uint32());
continue;
}
case 2: {
if (i !== 18)
break;
t.startNode = r.string();
continue;
}
case 3: {
if (i !== 26)
break;
t.endNode = r.string();
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
preferences: f(e.preferences) ? s.fromJSON(e.preferences) : void 0,
startNode: f(e.startNode) ? globalThis.String(e.startNode) : "",
endNode: f(e.endNode) ? globalThis.String(e.endNode) : ""
};
},
toJSON(e) {
const n = {};
return e.preferences !== void 0 && (n.preferences = s.toJSON(e.preferences)), e.startNode !== "" && (n.startNode = e.startNode), e.endNode !== "" && (n.endNode = e.endNode), n;
},
create(e) {
return Tn.fromPartial(e ?? {});
},
fromPartial(e) {
const n = ue();
return n.preferences = e.preferences !== void 0 && e.preferences !== null ? s.fromPartial(e.preferences) : void 0, n.startNode = e.startNode ?? "", n.endNode = e.endNode ?? "", n;
}
};
function de() {
return { preferences: void 0, identifier: "" };
}
const Pn = {
encode(e, n = new u()) {
return e.preferences !== void 0 && s.encode(e.preferences, n.uint32(10).fork()).join(), e.identifier !== "" && n.uint32(18).string(e.identifier), n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = de();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)
break;
t.preferences = s.decode(r, r.uint32());
continue;
}
case 2: {
if (i !== 18)
break;
t.identifier = r.string();
continue;
}
}
if ((i & 7) === 4 || i === 0)
break;
r.skip(i & 7);
}
return t;
},
fromJSON(e) {
return {
preferences: f(e.preferences) ? s.fromJSON(e.preferences) : void 0,
identifier: f(e.identifier) ? globalThis.String(e.identifier) : ""
};
},
toJSON(e) {
const n = {};
return e.preferences !== void 0 && (n.preferences = s.toJSON(e.preferences)), e.identifier !== "" && (n.identifier = e.identifier), n;
},
create(e) {
return Pn.fromPartial(e ?? {});
},
fromPartial(e) {
const n = de();
return n.preferences = e.preferences !== void 0 && e.preferences !== null ? s.fromPartial(e.preferences) : void 0, n.identifier = e.identifier ?? "", n;
}
};
function ce() {
return { preferences: void 0, identifiers: [] };
}
const hn = {
encode(e, n = new u()) {
e.preferences !== void 0 && s.encode(e.preferences, n.uint32(10).fork()).join();
for (const r of e.identifiers)
n.uint32(18).string(r);
return n;
},
decode(e, n) {
const r = e instanceof o ? e : new o(e);
let a = n === void 0 ? r.len : r.pos + n;
const t = ce();
for (; r.pos < a; ) {
const i = r.uint32();
switch (i >>> 3) {
case 1: {
if (i !== 10)