@vicinae/api 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/README.md +37 -0
  2. package/bin/run.js +9 -0
  3. package/dist/api/ai.d.ts +110 -0
  4. package/dist/api/ai.js +120 -0
  5. package/dist/api/alert.d.ts +22 -0
  6. package/dist/api/alert.js +61 -0
  7. package/dist/api/bus.d.ts +95 -0
  8. package/dist/api/bus.js +211 -0
  9. package/dist/api/cache.d.ts +117 -0
  10. package/dist/api/cache.js +52 -0
  11. package/dist/api/clipboard.d.ts +34 -0
  12. package/dist/api/clipboard.js +52 -0
  13. package/dist/api/color.d.ts +24 -0
  14. package/dist/api/color.js +24 -0
  15. package/dist/api/components/action-pannel.d.ts +23 -0
  16. package/dist/api/components/action-pannel.js +30 -0
  17. package/dist/api/components/actions.d.ts +52 -0
  18. package/dist/api/components/actions.js +81 -0
  19. package/dist/api/components/detail.d.ts +21 -0
  20. package/dist/api/components/detail.js +12 -0
  21. package/dist/api/components/dropdown.d.ts +36 -0
  22. package/dist/api/components/dropdown.js +21 -0
  23. package/dist/api/components/empty-view.d.ts +9 -0
  24. package/dist/api/components/empty-view.js +12 -0
  25. package/dist/api/components/form.d.ts +81 -0
  26. package/dist/api/components/form.js +53 -0
  27. package/dist/api/components/grid.d.ts +117 -0
  28. package/dist/api/components/grid.js +80 -0
  29. package/dist/api/components/index.d.ts +7 -0
  30. package/dist/api/components/index.js +23 -0
  31. package/dist/api/components/list.d.ts +109 -0
  32. package/dist/api/components/list.js +53 -0
  33. package/dist/api/components/menu-bar.d.ts +26 -0
  34. package/dist/api/components/menu-bar.js +25 -0
  35. package/dist/api/components/metadata.d.ts +23 -0
  36. package/dist/api/components/metadata.js +27 -0
  37. package/dist/api/components/tag.d.ts +16 -0
  38. package/dist/api/components/tag.js +28 -0
  39. package/dist/api/context/index.d.ts +1 -0
  40. package/dist/api/context/index.js +17 -0
  41. package/dist/api/context/navigation-context.d.ts +7 -0
  42. package/dist/api/context/navigation-context.js +8 -0
  43. package/dist/api/context/navigation-provider.d.ts +4 -0
  44. package/dist/api/context/navigation-provider.js +40 -0
  45. package/dist/api/controls.d.ts +3 -0
  46. package/dist/api/controls.js +20 -0
  47. package/dist/api/environment.d.ts +118 -0
  48. package/dist/api/environment.js +17 -0
  49. package/dist/api/hooks/index.d.ts +2 -0
  50. package/dist/api/hooks/index.js +18 -0
  51. package/dist/api/hooks/use-applications.d.ts +2 -0
  52. package/dist/api/hooks/use-applications.js +19 -0
  53. package/dist/api/hooks/use-imperative-form-handle.d.ts +3 -0
  54. package/dist/api/hooks/use-imperative-form-handle.js +25 -0
  55. package/dist/api/hooks/use-navigation.d.ts +4 -0
  56. package/dist/api/hooks/use-navigation.js +13 -0
  57. package/dist/api/hooks.d.ts +1 -0
  58. package/dist/api/hooks.js +24 -0
  59. package/dist/api/icon.d.ts +444 -0
  60. package/dist/api/icon.js +448 -0
  61. package/dist/api/image.d.ts +35 -0
  62. package/dist/api/image.js +84 -0
  63. package/dist/api/index.d.ts +19 -0
  64. package/dist/api/index.js +35 -0
  65. package/dist/api/keyboard.d.ts +16 -0
  66. package/dist/api/keyboard.js +12 -0
  67. package/dist/api/lib/result.d.ts +9 -0
  68. package/dist/api/lib/result.js +11 -0
  69. package/dist/api/local-storage.d.ts +13 -0
  70. package/dist/api/local-storage.js +31 -0
  71. package/dist/api/oauth.d.ts +319 -0
  72. package/dist/api/oauth.js +166 -0
  73. package/dist/api/preference.d.ts +5 -0
  74. package/dist/api/preference.js +18 -0
  75. package/dist/api/proto/application.d.ts +48 -0
  76. package/dist/api/proto/application.js +378 -0
  77. package/dist/api/proto/clipboard.d.ts +65 -0
  78. package/dist/api/proto/clipboard.js +614 -0
  79. package/dist/api/proto/common.d.ts +28 -0
  80. package/dist/api/proto/common.js +102 -0
  81. package/dist/api/proto/extension.d.ts +68 -0
  82. package/dist/api/proto/extension.js +604 -0
  83. package/dist/api/proto/google/protobuf/struct.d.ts +107 -0
  84. package/dist/api/proto/google/protobuf/struct.js +456 -0
  85. package/dist/api/proto/ipc.d.ts +64 -0
  86. package/dist/api/proto/ipc.js +604 -0
  87. package/dist/api/proto/manager.d.ts +82 -0
  88. package/dist/api/proto/manager.js +689 -0
  89. package/dist/api/proto/oauth.d.ts +55 -0
  90. package/dist/api/proto/oauth.js +379 -0
  91. package/dist/api/proto/storage.d.ts +80 -0
  92. package/dist/api/proto/storage.js +804 -0
  93. package/dist/api/proto/ui.d.ts +186 -0
  94. package/dist/api/proto/ui.js +1993 -0
  95. package/dist/api/toast.d.ts +168 -0
  96. package/dist/api/toast.js +152 -0
  97. package/dist/api/utils.d.ts +15 -0
  98. package/dist/api/utils.js +64 -0
  99. package/dist/commands/build/index.d.ts +11 -0
  100. package/dist/commands/build/index.js +123 -0
  101. package/dist/commands/develop/index.d.ts +10 -0
  102. package/dist/commands/develop/index.js +193 -0
  103. package/dist/index.d.ts +1 -0
  104. package/dist/index.js +17 -0
  105. package/dist/schemas/manifest.d.ts +75 -0
  106. package/dist/schemas/manifest.js +4 -0
  107. package/dist/utils/logger.d.ts +13 -0
  108. package/dist/utils/logger.js +38 -0
  109. package/dist/utils/utils.d.ts +2 -0
  110. package/dist/utils/utils.js +19 -0
  111. package/dist/utils/vicinae.d.ts +12 -0
  112. package/dist/utils/vicinae.js +33 -0
  113. package/package.json +73 -0
@@ -0,0 +1,1993 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.7.5
5
+ // protoc v6.31.1
6
+ // source: ui.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.Image = exports.ImageSource = exports.ThemedImageSource = exports.RenderNode_PropsEntry = exports.RenderNode = exports.Response = exports.Request = exports.ConfirmAlertAction = exports.ConfirmAlertRequest = exports.RenderRequest = exports.ShowHudRequest = exports.GetSelectedTextResponse = exports.GetSelectedTextRequest = exports.SetSearchTextRequest = exports.ClearSearchBarRequest = exports.CloseMainWindowRequest = exports.PopViewRequest = exports.PushViewRequest = exports.UpdateToastRequest = exports.HideToastRequest = exports.ShowToastRequest = exports.ImageMask = exports.ConfirmAlertActionStyle = exports.PopToRootType = exports.ToastStyle = exports.protobufPackage = void 0;
9
+ exports.toastStyleFromJSON = toastStyleFromJSON;
10
+ exports.toastStyleToJSON = toastStyleToJSON;
11
+ exports.popToRootTypeFromJSON = popToRootTypeFromJSON;
12
+ exports.popToRootTypeToJSON = popToRootTypeToJSON;
13
+ exports.confirmAlertActionStyleFromJSON = confirmAlertActionStyleFromJSON;
14
+ exports.confirmAlertActionStyleToJSON = confirmAlertActionStyleToJSON;
15
+ exports.imageMaskFromJSON = imageMaskFromJSON;
16
+ exports.imageMaskToJSON = imageMaskToJSON;
17
+ /* eslint-disable */
18
+ const wire_1 = require("@bufbuild/protobuf/wire");
19
+ const common_1 = require("./common");
20
+ const struct_1 = require("./google/protobuf/struct");
21
+ exports.protobufPackage = "proto.ext.ui";
22
+ var ToastStyle;
23
+ (function (ToastStyle) {
24
+ ToastStyle[ToastStyle["Success"] = 0] = "Success";
25
+ ToastStyle[ToastStyle["Info"] = 1] = "Info";
26
+ ToastStyle[ToastStyle["Warning"] = 2] = "Warning";
27
+ ToastStyle[ToastStyle["Error"] = 3] = "Error";
28
+ ToastStyle[ToastStyle["Dynamic"] = 4] = "Dynamic";
29
+ ToastStyle[ToastStyle["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
30
+ })(ToastStyle || (exports.ToastStyle = ToastStyle = {}));
31
+ function toastStyleFromJSON(object) {
32
+ switch (object) {
33
+ case 0:
34
+ case "Success":
35
+ return ToastStyle.Success;
36
+ case 1:
37
+ case "Info":
38
+ return ToastStyle.Info;
39
+ case 2:
40
+ case "Warning":
41
+ return ToastStyle.Warning;
42
+ case 3:
43
+ case "Error":
44
+ return ToastStyle.Error;
45
+ case 4:
46
+ case "Dynamic":
47
+ return ToastStyle.Dynamic;
48
+ case -1:
49
+ case "UNRECOGNIZED":
50
+ default:
51
+ return ToastStyle.UNRECOGNIZED;
52
+ }
53
+ }
54
+ function toastStyleToJSON(object) {
55
+ switch (object) {
56
+ case ToastStyle.Success:
57
+ return "Success";
58
+ case ToastStyle.Info:
59
+ return "Info";
60
+ case ToastStyle.Warning:
61
+ return "Warning";
62
+ case ToastStyle.Error:
63
+ return "Error";
64
+ case ToastStyle.Dynamic:
65
+ return "Dynamic";
66
+ case ToastStyle.UNRECOGNIZED:
67
+ default:
68
+ return "UNRECOGNIZED";
69
+ }
70
+ }
71
+ var PopToRootType;
72
+ (function (PopToRootType) {
73
+ PopToRootType[PopToRootType["PopToRootDefault"] = 0] = "PopToRootDefault";
74
+ PopToRootType[PopToRootType["PopToRootImmediate"] = 1] = "PopToRootImmediate";
75
+ PopToRootType[PopToRootType["PopToRootSuspended"] = 2] = "PopToRootSuspended";
76
+ PopToRootType[PopToRootType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
77
+ })(PopToRootType || (exports.PopToRootType = PopToRootType = {}));
78
+ function popToRootTypeFromJSON(object) {
79
+ switch (object) {
80
+ case 0:
81
+ case "PopToRootDefault":
82
+ return PopToRootType.PopToRootDefault;
83
+ case 1:
84
+ case "PopToRootImmediate":
85
+ return PopToRootType.PopToRootImmediate;
86
+ case 2:
87
+ case "PopToRootSuspended":
88
+ return PopToRootType.PopToRootSuspended;
89
+ case -1:
90
+ case "UNRECOGNIZED":
91
+ default:
92
+ return PopToRootType.UNRECOGNIZED;
93
+ }
94
+ }
95
+ function popToRootTypeToJSON(object) {
96
+ switch (object) {
97
+ case PopToRootType.PopToRootDefault:
98
+ return "PopToRootDefault";
99
+ case PopToRootType.PopToRootImmediate:
100
+ return "PopToRootImmediate";
101
+ case PopToRootType.PopToRootSuspended:
102
+ return "PopToRootSuspended";
103
+ case PopToRootType.UNRECOGNIZED:
104
+ default:
105
+ return "UNRECOGNIZED";
106
+ }
107
+ }
108
+ var ConfirmAlertActionStyle;
109
+ (function (ConfirmAlertActionStyle) {
110
+ ConfirmAlertActionStyle[ConfirmAlertActionStyle["Default"] = 0] = "Default";
111
+ ConfirmAlertActionStyle[ConfirmAlertActionStyle["Destructive"] = 1] = "Destructive";
112
+ ConfirmAlertActionStyle[ConfirmAlertActionStyle["Cancel"] = 2] = "Cancel";
113
+ ConfirmAlertActionStyle[ConfirmAlertActionStyle["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
114
+ })(ConfirmAlertActionStyle || (exports.ConfirmAlertActionStyle = ConfirmAlertActionStyle = {}));
115
+ function confirmAlertActionStyleFromJSON(object) {
116
+ switch (object) {
117
+ case 0:
118
+ case "Default":
119
+ return ConfirmAlertActionStyle.Default;
120
+ case 1:
121
+ case "Destructive":
122
+ return ConfirmAlertActionStyle.Destructive;
123
+ case 2:
124
+ case "Cancel":
125
+ return ConfirmAlertActionStyle.Cancel;
126
+ case -1:
127
+ case "UNRECOGNIZED":
128
+ default:
129
+ return ConfirmAlertActionStyle.UNRECOGNIZED;
130
+ }
131
+ }
132
+ function confirmAlertActionStyleToJSON(object) {
133
+ switch (object) {
134
+ case ConfirmAlertActionStyle.Default:
135
+ return "Default";
136
+ case ConfirmAlertActionStyle.Destructive:
137
+ return "Destructive";
138
+ case ConfirmAlertActionStyle.Cancel:
139
+ return "Cancel";
140
+ case ConfirmAlertActionStyle.UNRECOGNIZED:
141
+ default:
142
+ return "UNRECOGNIZED";
143
+ }
144
+ }
145
+ var ImageMask;
146
+ (function (ImageMask) {
147
+ ImageMask[ImageMask["None"] = 0] = "None";
148
+ ImageMask[ImageMask["Circle"] = 1] = "Circle";
149
+ ImageMask[ImageMask["RoundedRectangle"] = 2] = "RoundedRectangle";
150
+ ImageMask[ImageMask["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
151
+ })(ImageMask || (exports.ImageMask = ImageMask = {}));
152
+ function imageMaskFromJSON(object) {
153
+ switch (object) {
154
+ case 0:
155
+ case "None":
156
+ return ImageMask.None;
157
+ case 1:
158
+ case "Circle":
159
+ return ImageMask.Circle;
160
+ case 2:
161
+ case "RoundedRectangle":
162
+ return ImageMask.RoundedRectangle;
163
+ case -1:
164
+ case "UNRECOGNIZED":
165
+ default:
166
+ return ImageMask.UNRECOGNIZED;
167
+ }
168
+ }
169
+ function imageMaskToJSON(object) {
170
+ switch (object) {
171
+ case ImageMask.None:
172
+ return "None";
173
+ case ImageMask.Circle:
174
+ return "Circle";
175
+ case ImageMask.RoundedRectangle:
176
+ return "RoundedRectangle";
177
+ case ImageMask.UNRECOGNIZED:
178
+ default:
179
+ return "UNRECOGNIZED";
180
+ }
181
+ }
182
+ function createBaseShowToastRequest() {
183
+ return { id: "", title: "", style: 0 };
184
+ }
185
+ exports.ShowToastRequest = {
186
+ encode(message, writer = new wire_1.BinaryWriter()) {
187
+ if (message.id !== "") {
188
+ writer.uint32(10).string(message.id);
189
+ }
190
+ if (message.title !== "") {
191
+ writer.uint32(18).string(message.title);
192
+ }
193
+ if (message.style !== 0) {
194
+ writer.uint32(24).int32(message.style);
195
+ }
196
+ return writer;
197
+ },
198
+ decode(input, length) {
199
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
200
+ const end = length === undefined ? reader.len : reader.pos + length;
201
+ const message = createBaseShowToastRequest();
202
+ while (reader.pos < end) {
203
+ const tag = reader.uint32();
204
+ switch (tag >>> 3) {
205
+ case 1: {
206
+ if (tag !== 10) {
207
+ break;
208
+ }
209
+ message.id = reader.string();
210
+ continue;
211
+ }
212
+ case 2: {
213
+ if (tag !== 18) {
214
+ break;
215
+ }
216
+ message.title = reader.string();
217
+ continue;
218
+ }
219
+ case 3: {
220
+ if (tag !== 24) {
221
+ break;
222
+ }
223
+ message.style = reader.int32();
224
+ continue;
225
+ }
226
+ }
227
+ if ((tag & 7) === 4 || tag === 0) {
228
+ break;
229
+ }
230
+ reader.skip(tag & 7);
231
+ }
232
+ return message;
233
+ },
234
+ fromJSON(object) {
235
+ return {
236
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
237
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
238
+ style: isSet(object.style) ? toastStyleFromJSON(object.style) : 0,
239
+ };
240
+ },
241
+ toJSON(message) {
242
+ const obj = {};
243
+ if (message.id !== "") {
244
+ obj.id = message.id;
245
+ }
246
+ if (message.title !== "") {
247
+ obj.title = message.title;
248
+ }
249
+ if (message.style !== 0) {
250
+ obj.style = toastStyleToJSON(message.style);
251
+ }
252
+ return obj;
253
+ },
254
+ create(base) {
255
+ return exports.ShowToastRequest.fromPartial(base ?? {});
256
+ },
257
+ fromPartial(object) {
258
+ const message = createBaseShowToastRequest();
259
+ message.id = object.id ?? "";
260
+ message.title = object.title ?? "";
261
+ message.style = object.style ?? 0;
262
+ return message;
263
+ },
264
+ };
265
+ function createBaseHideToastRequest() {
266
+ return { id: "" };
267
+ }
268
+ exports.HideToastRequest = {
269
+ encode(message, writer = new wire_1.BinaryWriter()) {
270
+ if (message.id !== "") {
271
+ writer.uint32(10).string(message.id);
272
+ }
273
+ return writer;
274
+ },
275
+ decode(input, length) {
276
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
277
+ const end = length === undefined ? reader.len : reader.pos + length;
278
+ const message = createBaseHideToastRequest();
279
+ while (reader.pos < end) {
280
+ const tag = reader.uint32();
281
+ switch (tag >>> 3) {
282
+ case 1: {
283
+ if (tag !== 10) {
284
+ break;
285
+ }
286
+ message.id = reader.string();
287
+ continue;
288
+ }
289
+ }
290
+ if ((tag & 7) === 4 || tag === 0) {
291
+ break;
292
+ }
293
+ reader.skip(tag & 7);
294
+ }
295
+ return message;
296
+ },
297
+ fromJSON(object) {
298
+ return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
299
+ },
300
+ toJSON(message) {
301
+ const obj = {};
302
+ if (message.id !== "") {
303
+ obj.id = message.id;
304
+ }
305
+ return obj;
306
+ },
307
+ create(base) {
308
+ return exports.HideToastRequest.fromPartial(base ?? {});
309
+ },
310
+ fromPartial(object) {
311
+ const message = createBaseHideToastRequest();
312
+ message.id = object.id ?? "";
313
+ return message;
314
+ },
315
+ };
316
+ function createBaseUpdateToastRequest() {
317
+ return { id: "", title: "" };
318
+ }
319
+ exports.UpdateToastRequest = {
320
+ encode(message, writer = new wire_1.BinaryWriter()) {
321
+ if (message.id !== "") {
322
+ writer.uint32(10).string(message.id);
323
+ }
324
+ if (message.title !== "") {
325
+ writer.uint32(18).string(message.title);
326
+ }
327
+ return writer;
328
+ },
329
+ decode(input, length) {
330
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
331
+ const end = length === undefined ? reader.len : reader.pos + length;
332
+ const message = createBaseUpdateToastRequest();
333
+ while (reader.pos < end) {
334
+ const tag = reader.uint32();
335
+ switch (tag >>> 3) {
336
+ case 1: {
337
+ if (tag !== 10) {
338
+ break;
339
+ }
340
+ message.id = reader.string();
341
+ continue;
342
+ }
343
+ case 2: {
344
+ if (tag !== 18) {
345
+ break;
346
+ }
347
+ message.title = reader.string();
348
+ continue;
349
+ }
350
+ }
351
+ if ((tag & 7) === 4 || tag === 0) {
352
+ break;
353
+ }
354
+ reader.skip(tag & 7);
355
+ }
356
+ return message;
357
+ },
358
+ fromJSON(object) {
359
+ return {
360
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
361
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
362
+ };
363
+ },
364
+ toJSON(message) {
365
+ const obj = {};
366
+ if (message.id !== "") {
367
+ obj.id = message.id;
368
+ }
369
+ if (message.title !== "") {
370
+ obj.title = message.title;
371
+ }
372
+ return obj;
373
+ },
374
+ create(base) {
375
+ return exports.UpdateToastRequest.fromPartial(base ?? {});
376
+ },
377
+ fromPartial(object) {
378
+ const message = createBaseUpdateToastRequest();
379
+ message.id = object.id ?? "";
380
+ message.title = object.title ?? "";
381
+ return message;
382
+ },
383
+ };
384
+ function createBasePushViewRequest() {
385
+ return {};
386
+ }
387
+ exports.PushViewRequest = {
388
+ encode(_, writer = new wire_1.BinaryWriter()) {
389
+ return writer;
390
+ },
391
+ decode(input, length) {
392
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
393
+ const end = length === undefined ? reader.len : reader.pos + length;
394
+ const message = createBasePushViewRequest();
395
+ while (reader.pos < end) {
396
+ const tag = reader.uint32();
397
+ switch (tag >>> 3) {
398
+ }
399
+ if ((tag & 7) === 4 || tag === 0) {
400
+ break;
401
+ }
402
+ reader.skip(tag & 7);
403
+ }
404
+ return message;
405
+ },
406
+ fromJSON(_) {
407
+ return {};
408
+ },
409
+ toJSON(_) {
410
+ const obj = {};
411
+ return obj;
412
+ },
413
+ create(base) {
414
+ return exports.PushViewRequest.fromPartial(base ?? {});
415
+ },
416
+ fromPartial(_) {
417
+ const message = createBasePushViewRequest();
418
+ return message;
419
+ },
420
+ };
421
+ function createBasePopViewRequest() {
422
+ return {};
423
+ }
424
+ exports.PopViewRequest = {
425
+ encode(_, writer = new wire_1.BinaryWriter()) {
426
+ return writer;
427
+ },
428
+ decode(input, length) {
429
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
430
+ const end = length === undefined ? reader.len : reader.pos + length;
431
+ const message = createBasePopViewRequest();
432
+ while (reader.pos < end) {
433
+ const tag = reader.uint32();
434
+ switch (tag >>> 3) {
435
+ }
436
+ if ((tag & 7) === 4 || tag === 0) {
437
+ break;
438
+ }
439
+ reader.skip(tag & 7);
440
+ }
441
+ return message;
442
+ },
443
+ fromJSON(_) {
444
+ return {};
445
+ },
446
+ toJSON(_) {
447
+ const obj = {};
448
+ return obj;
449
+ },
450
+ create(base) {
451
+ return exports.PopViewRequest.fromPartial(base ?? {});
452
+ },
453
+ fromPartial(_) {
454
+ const message = createBasePopViewRequest();
455
+ return message;
456
+ },
457
+ };
458
+ function createBaseCloseMainWindowRequest() {
459
+ return {};
460
+ }
461
+ exports.CloseMainWindowRequest = {
462
+ encode(_, writer = new wire_1.BinaryWriter()) {
463
+ return writer;
464
+ },
465
+ decode(input, length) {
466
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
467
+ const end = length === undefined ? reader.len : reader.pos + length;
468
+ const message = createBaseCloseMainWindowRequest();
469
+ while (reader.pos < end) {
470
+ const tag = reader.uint32();
471
+ switch (tag >>> 3) {
472
+ }
473
+ if ((tag & 7) === 4 || tag === 0) {
474
+ break;
475
+ }
476
+ reader.skip(tag & 7);
477
+ }
478
+ return message;
479
+ },
480
+ fromJSON(_) {
481
+ return {};
482
+ },
483
+ toJSON(_) {
484
+ const obj = {};
485
+ return obj;
486
+ },
487
+ create(base) {
488
+ return exports.CloseMainWindowRequest.fromPartial(base ?? {});
489
+ },
490
+ fromPartial(_) {
491
+ const message = createBaseCloseMainWindowRequest();
492
+ return message;
493
+ },
494
+ };
495
+ function createBaseClearSearchBarRequest() {
496
+ return {};
497
+ }
498
+ exports.ClearSearchBarRequest = {
499
+ encode(_, writer = new wire_1.BinaryWriter()) {
500
+ return writer;
501
+ },
502
+ decode(input, length) {
503
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
504
+ const end = length === undefined ? reader.len : reader.pos + length;
505
+ const message = createBaseClearSearchBarRequest();
506
+ while (reader.pos < end) {
507
+ const tag = reader.uint32();
508
+ switch (tag >>> 3) {
509
+ }
510
+ if ((tag & 7) === 4 || tag === 0) {
511
+ break;
512
+ }
513
+ reader.skip(tag & 7);
514
+ }
515
+ return message;
516
+ },
517
+ fromJSON(_) {
518
+ return {};
519
+ },
520
+ toJSON(_) {
521
+ const obj = {};
522
+ return obj;
523
+ },
524
+ create(base) {
525
+ return exports.ClearSearchBarRequest.fromPartial(base ?? {});
526
+ },
527
+ fromPartial(_) {
528
+ const message = createBaseClearSearchBarRequest();
529
+ return message;
530
+ },
531
+ };
532
+ function createBaseSetSearchTextRequest() {
533
+ return { text: "" };
534
+ }
535
+ exports.SetSearchTextRequest = {
536
+ encode(message, writer = new wire_1.BinaryWriter()) {
537
+ if (message.text !== "") {
538
+ writer.uint32(10).string(message.text);
539
+ }
540
+ return writer;
541
+ },
542
+ decode(input, length) {
543
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
544
+ const end = length === undefined ? reader.len : reader.pos + length;
545
+ const message = createBaseSetSearchTextRequest();
546
+ while (reader.pos < end) {
547
+ const tag = reader.uint32();
548
+ switch (tag >>> 3) {
549
+ case 1: {
550
+ if (tag !== 10) {
551
+ break;
552
+ }
553
+ message.text = reader.string();
554
+ continue;
555
+ }
556
+ }
557
+ if ((tag & 7) === 4 || tag === 0) {
558
+ break;
559
+ }
560
+ reader.skip(tag & 7);
561
+ }
562
+ return message;
563
+ },
564
+ fromJSON(object) {
565
+ return { text: isSet(object.text) ? globalThis.String(object.text) : "" };
566
+ },
567
+ toJSON(message) {
568
+ const obj = {};
569
+ if (message.text !== "") {
570
+ obj.text = message.text;
571
+ }
572
+ return obj;
573
+ },
574
+ create(base) {
575
+ return exports.SetSearchTextRequest.fromPartial(base ?? {});
576
+ },
577
+ fromPartial(object) {
578
+ const message = createBaseSetSearchTextRequest();
579
+ message.text = object.text ?? "";
580
+ return message;
581
+ },
582
+ };
583
+ function createBaseGetSelectedTextRequest() {
584
+ return {};
585
+ }
586
+ exports.GetSelectedTextRequest = {
587
+ encode(_, writer = new wire_1.BinaryWriter()) {
588
+ return writer;
589
+ },
590
+ decode(input, length) {
591
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
592
+ const end = length === undefined ? reader.len : reader.pos + length;
593
+ const message = createBaseGetSelectedTextRequest();
594
+ while (reader.pos < end) {
595
+ const tag = reader.uint32();
596
+ switch (tag >>> 3) {
597
+ }
598
+ if ((tag & 7) === 4 || tag === 0) {
599
+ break;
600
+ }
601
+ reader.skip(tag & 7);
602
+ }
603
+ return message;
604
+ },
605
+ fromJSON(_) {
606
+ return {};
607
+ },
608
+ toJSON(_) {
609
+ const obj = {};
610
+ return obj;
611
+ },
612
+ create(base) {
613
+ return exports.GetSelectedTextRequest.fromPartial(base ?? {});
614
+ },
615
+ fromPartial(_) {
616
+ const message = createBaseGetSelectedTextRequest();
617
+ return message;
618
+ },
619
+ };
620
+ function createBaseGetSelectedTextResponse() {
621
+ return { text: "" };
622
+ }
623
+ exports.GetSelectedTextResponse = {
624
+ encode(message, writer = new wire_1.BinaryWriter()) {
625
+ if (message.text !== "") {
626
+ writer.uint32(10).string(message.text);
627
+ }
628
+ return writer;
629
+ },
630
+ decode(input, length) {
631
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
632
+ const end = length === undefined ? reader.len : reader.pos + length;
633
+ const message = createBaseGetSelectedTextResponse();
634
+ while (reader.pos < end) {
635
+ const tag = reader.uint32();
636
+ switch (tag >>> 3) {
637
+ case 1: {
638
+ if (tag !== 10) {
639
+ break;
640
+ }
641
+ message.text = reader.string();
642
+ continue;
643
+ }
644
+ }
645
+ if ((tag & 7) === 4 || tag === 0) {
646
+ break;
647
+ }
648
+ reader.skip(tag & 7);
649
+ }
650
+ return message;
651
+ },
652
+ fromJSON(object) {
653
+ return { text: isSet(object.text) ? globalThis.String(object.text) : "" };
654
+ },
655
+ toJSON(message) {
656
+ const obj = {};
657
+ if (message.text !== "") {
658
+ obj.text = message.text;
659
+ }
660
+ return obj;
661
+ },
662
+ create(base) {
663
+ return exports.GetSelectedTextResponse.fromPartial(base ?? {});
664
+ },
665
+ fromPartial(object) {
666
+ const message = createBaseGetSelectedTextResponse();
667
+ message.text = object.text ?? "";
668
+ return message;
669
+ },
670
+ };
671
+ function createBaseShowHudRequest() {
672
+ return { text: "", clearRootSearch: false, popToRoot: 0 };
673
+ }
674
+ exports.ShowHudRequest = {
675
+ encode(message, writer = new wire_1.BinaryWriter()) {
676
+ if (message.text !== "") {
677
+ writer.uint32(10).string(message.text);
678
+ }
679
+ if (message.clearRootSearch !== false) {
680
+ writer.uint32(16).bool(message.clearRootSearch);
681
+ }
682
+ if (message.popToRoot !== 0) {
683
+ writer.uint32(24).int32(message.popToRoot);
684
+ }
685
+ return writer;
686
+ },
687
+ decode(input, length) {
688
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
689
+ const end = length === undefined ? reader.len : reader.pos + length;
690
+ const message = createBaseShowHudRequest();
691
+ while (reader.pos < end) {
692
+ const tag = reader.uint32();
693
+ switch (tag >>> 3) {
694
+ case 1: {
695
+ if (tag !== 10) {
696
+ break;
697
+ }
698
+ message.text = reader.string();
699
+ continue;
700
+ }
701
+ case 2: {
702
+ if (tag !== 16) {
703
+ break;
704
+ }
705
+ message.clearRootSearch = reader.bool();
706
+ continue;
707
+ }
708
+ case 3: {
709
+ if (tag !== 24) {
710
+ break;
711
+ }
712
+ message.popToRoot = reader.int32();
713
+ continue;
714
+ }
715
+ }
716
+ if ((tag & 7) === 4 || tag === 0) {
717
+ break;
718
+ }
719
+ reader.skip(tag & 7);
720
+ }
721
+ return message;
722
+ },
723
+ fromJSON(object) {
724
+ return {
725
+ text: isSet(object.text) ? globalThis.String(object.text) : "",
726
+ clearRootSearch: isSet(object.clearRootSearch) ? globalThis.Boolean(object.clearRootSearch) : false,
727
+ popToRoot: isSet(object.popToRoot) ? popToRootTypeFromJSON(object.popToRoot) : 0,
728
+ };
729
+ },
730
+ toJSON(message) {
731
+ const obj = {};
732
+ if (message.text !== "") {
733
+ obj.text = message.text;
734
+ }
735
+ if (message.clearRootSearch !== false) {
736
+ obj.clearRootSearch = message.clearRootSearch;
737
+ }
738
+ if (message.popToRoot !== 0) {
739
+ obj.popToRoot = popToRootTypeToJSON(message.popToRoot);
740
+ }
741
+ return obj;
742
+ },
743
+ create(base) {
744
+ return exports.ShowHudRequest.fromPartial(base ?? {});
745
+ },
746
+ fromPartial(object) {
747
+ const message = createBaseShowHudRequest();
748
+ message.text = object.text ?? "";
749
+ message.clearRootSearch = object.clearRootSearch ?? false;
750
+ message.popToRoot = object.popToRoot ?? 0;
751
+ return message;
752
+ },
753
+ };
754
+ function createBaseRenderRequest() {
755
+ return { json: "" };
756
+ }
757
+ exports.RenderRequest = {
758
+ encode(message, writer = new wire_1.BinaryWriter()) {
759
+ if (message.json !== "") {
760
+ writer.uint32(10).string(message.json);
761
+ }
762
+ return writer;
763
+ },
764
+ decode(input, length) {
765
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
766
+ const end = length === undefined ? reader.len : reader.pos + length;
767
+ const message = createBaseRenderRequest();
768
+ while (reader.pos < end) {
769
+ const tag = reader.uint32();
770
+ switch (tag >>> 3) {
771
+ case 1: {
772
+ if (tag !== 10) {
773
+ break;
774
+ }
775
+ message.json = reader.string();
776
+ continue;
777
+ }
778
+ }
779
+ if ((tag & 7) === 4 || tag === 0) {
780
+ break;
781
+ }
782
+ reader.skip(tag & 7);
783
+ }
784
+ return message;
785
+ },
786
+ fromJSON(object) {
787
+ return { json: isSet(object.json) ? globalThis.String(object.json) : "" };
788
+ },
789
+ toJSON(message) {
790
+ const obj = {};
791
+ if (message.json !== "") {
792
+ obj.json = message.json;
793
+ }
794
+ return obj;
795
+ },
796
+ create(base) {
797
+ return exports.RenderRequest.fromPartial(base ?? {});
798
+ },
799
+ fromPartial(object) {
800
+ const message = createBaseRenderRequest();
801
+ message.json = object.json ?? "";
802
+ return message;
803
+ },
804
+ };
805
+ function createBaseConfirmAlertRequest() {
806
+ return {
807
+ title: "",
808
+ description: "",
809
+ icon: undefined,
810
+ dismissAction: undefined,
811
+ primaryAction: undefined,
812
+ rememberUserChoice: false,
813
+ handle: "",
814
+ };
815
+ }
816
+ exports.ConfirmAlertRequest = {
817
+ encode(message, writer = new wire_1.BinaryWriter()) {
818
+ if (message.title !== "") {
819
+ writer.uint32(10).string(message.title);
820
+ }
821
+ if (message.description !== "") {
822
+ writer.uint32(18).string(message.description);
823
+ }
824
+ if (message.icon !== undefined) {
825
+ writer.uint32(26).string(message.icon);
826
+ }
827
+ if (message.dismissAction !== undefined) {
828
+ exports.ConfirmAlertAction.encode(message.dismissAction, writer.uint32(34).fork()).join();
829
+ }
830
+ if (message.primaryAction !== undefined) {
831
+ exports.ConfirmAlertAction.encode(message.primaryAction, writer.uint32(42).fork()).join();
832
+ }
833
+ if (message.rememberUserChoice !== false) {
834
+ writer.uint32(48).bool(message.rememberUserChoice);
835
+ }
836
+ if (message.handle !== "") {
837
+ writer.uint32(58).string(message.handle);
838
+ }
839
+ return writer;
840
+ },
841
+ decode(input, length) {
842
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
843
+ const end = length === undefined ? reader.len : reader.pos + length;
844
+ const message = createBaseConfirmAlertRequest();
845
+ while (reader.pos < end) {
846
+ const tag = reader.uint32();
847
+ switch (tag >>> 3) {
848
+ case 1: {
849
+ if (tag !== 10) {
850
+ break;
851
+ }
852
+ message.title = reader.string();
853
+ continue;
854
+ }
855
+ case 2: {
856
+ if (tag !== 18) {
857
+ break;
858
+ }
859
+ message.description = reader.string();
860
+ continue;
861
+ }
862
+ case 3: {
863
+ if (tag !== 26) {
864
+ break;
865
+ }
866
+ message.icon = reader.string();
867
+ continue;
868
+ }
869
+ case 4: {
870
+ if (tag !== 34) {
871
+ break;
872
+ }
873
+ message.dismissAction = exports.ConfirmAlertAction.decode(reader, reader.uint32());
874
+ continue;
875
+ }
876
+ case 5: {
877
+ if (tag !== 42) {
878
+ break;
879
+ }
880
+ message.primaryAction = exports.ConfirmAlertAction.decode(reader, reader.uint32());
881
+ continue;
882
+ }
883
+ case 6: {
884
+ if (tag !== 48) {
885
+ break;
886
+ }
887
+ message.rememberUserChoice = reader.bool();
888
+ continue;
889
+ }
890
+ case 7: {
891
+ if (tag !== 58) {
892
+ break;
893
+ }
894
+ message.handle = reader.string();
895
+ continue;
896
+ }
897
+ }
898
+ if ((tag & 7) === 4 || tag === 0) {
899
+ break;
900
+ }
901
+ reader.skip(tag & 7);
902
+ }
903
+ return message;
904
+ },
905
+ fromJSON(object) {
906
+ return {
907
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
908
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
909
+ icon: isSet(object.icon) ? globalThis.String(object.icon) : undefined,
910
+ dismissAction: isSet(object.dismissAction) ? exports.ConfirmAlertAction.fromJSON(object.dismissAction) : undefined,
911
+ primaryAction: isSet(object.primaryAction) ? exports.ConfirmAlertAction.fromJSON(object.primaryAction) : undefined,
912
+ rememberUserChoice: isSet(object.rememberUserChoice) ? globalThis.Boolean(object.rememberUserChoice) : false,
913
+ handle: isSet(object.handle) ? globalThis.String(object.handle) : "",
914
+ };
915
+ },
916
+ toJSON(message) {
917
+ const obj = {};
918
+ if (message.title !== "") {
919
+ obj.title = message.title;
920
+ }
921
+ if (message.description !== "") {
922
+ obj.description = message.description;
923
+ }
924
+ if (message.icon !== undefined) {
925
+ obj.icon = message.icon;
926
+ }
927
+ if (message.dismissAction !== undefined) {
928
+ obj.dismissAction = exports.ConfirmAlertAction.toJSON(message.dismissAction);
929
+ }
930
+ if (message.primaryAction !== undefined) {
931
+ obj.primaryAction = exports.ConfirmAlertAction.toJSON(message.primaryAction);
932
+ }
933
+ if (message.rememberUserChoice !== false) {
934
+ obj.rememberUserChoice = message.rememberUserChoice;
935
+ }
936
+ if (message.handle !== "") {
937
+ obj.handle = message.handle;
938
+ }
939
+ return obj;
940
+ },
941
+ create(base) {
942
+ return exports.ConfirmAlertRequest.fromPartial(base ?? {});
943
+ },
944
+ fromPartial(object) {
945
+ const message = createBaseConfirmAlertRequest();
946
+ message.title = object.title ?? "";
947
+ message.description = object.description ?? "";
948
+ message.icon = object.icon ?? undefined;
949
+ message.dismissAction = (object.dismissAction !== undefined && object.dismissAction !== null)
950
+ ? exports.ConfirmAlertAction.fromPartial(object.dismissAction)
951
+ : undefined;
952
+ message.primaryAction = (object.primaryAction !== undefined && object.primaryAction !== null)
953
+ ? exports.ConfirmAlertAction.fromPartial(object.primaryAction)
954
+ : undefined;
955
+ message.rememberUserChoice = object.rememberUserChoice ?? false;
956
+ message.handle = object.handle ?? "";
957
+ return message;
958
+ },
959
+ };
960
+ function createBaseConfirmAlertAction() {
961
+ return { title: "", style: 0 };
962
+ }
963
+ exports.ConfirmAlertAction = {
964
+ encode(message, writer = new wire_1.BinaryWriter()) {
965
+ if (message.title !== "") {
966
+ writer.uint32(10).string(message.title);
967
+ }
968
+ if (message.style !== 0) {
969
+ writer.uint32(16).int32(message.style);
970
+ }
971
+ return writer;
972
+ },
973
+ decode(input, length) {
974
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
975
+ const end = length === undefined ? reader.len : reader.pos + length;
976
+ const message = createBaseConfirmAlertAction();
977
+ while (reader.pos < end) {
978
+ const tag = reader.uint32();
979
+ switch (tag >>> 3) {
980
+ case 1: {
981
+ if (tag !== 10) {
982
+ break;
983
+ }
984
+ message.title = reader.string();
985
+ continue;
986
+ }
987
+ case 2: {
988
+ if (tag !== 16) {
989
+ break;
990
+ }
991
+ message.style = reader.int32();
992
+ continue;
993
+ }
994
+ }
995
+ if ((tag & 7) === 4 || tag === 0) {
996
+ break;
997
+ }
998
+ reader.skip(tag & 7);
999
+ }
1000
+ return message;
1001
+ },
1002
+ fromJSON(object) {
1003
+ return {
1004
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
1005
+ style: isSet(object.style) ? confirmAlertActionStyleFromJSON(object.style) : 0,
1006
+ };
1007
+ },
1008
+ toJSON(message) {
1009
+ const obj = {};
1010
+ if (message.title !== "") {
1011
+ obj.title = message.title;
1012
+ }
1013
+ if (message.style !== 0) {
1014
+ obj.style = confirmAlertActionStyleToJSON(message.style);
1015
+ }
1016
+ return obj;
1017
+ },
1018
+ create(base) {
1019
+ return exports.ConfirmAlertAction.fromPartial(base ?? {});
1020
+ },
1021
+ fromPartial(object) {
1022
+ const message = createBaseConfirmAlertAction();
1023
+ message.title = object.title ?? "";
1024
+ message.style = object.style ?? 0;
1025
+ return message;
1026
+ },
1027
+ };
1028
+ function createBaseRequest() {
1029
+ return {
1030
+ render: undefined,
1031
+ showToast: undefined,
1032
+ hideToast: undefined,
1033
+ updateToast: undefined,
1034
+ pushView: undefined,
1035
+ popView: undefined,
1036
+ clearSearch: undefined,
1037
+ closeMainWindow: undefined,
1038
+ showHud: undefined,
1039
+ setSearchText: undefined,
1040
+ confirmAlert: undefined,
1041
+ getSelectedText: undefined,
1042
+ };
1043
+ }
1044
+ exports.Request = {
1045
+ encode(message, writer = new wire_1.BinaryWriter()) {
1046
+ if (message.render !== undefined) {
1047
+ exports.RenderRequest.encode(message.render, writer.uint32(10).fork()).join();
1048
+ }
1049
+ if (message.showToast !== undefined) {
1050
+ exports.ShowToastRequest.encode(message.showToast, writer.uint32(18).fork()).join();
1051
+ }
1052
+ if (message.hideToast !== undefined) {
1053
+ exports.HideToastRequest.encode(message.hideToast, writer.uint32(26).fork()).join();
1054
+ }
1055
+ if (message.updateToast !== undefined) {
1056
+ exports.UpdateToastRequest.encode(message.updateToast, writer.uint32(34).fork()).join();
1057
+ }
1058
+ if (message.pushView !== undefined) {
1059
+ exports.PushViewRequest.encode(message.pushView, writer.uint32(42).fork()).join();
1060
+ }
1061
+ if (message.popView !== undefined) {
1062
+ exports.PopViewRequest.encode(message.popView, writer.uint32(50).fork()).join();
1063
+ }
1064
+ if (message.clearSearch !== undefined) {
1065
+ exports.ClearSearchBarRequest.encode(message.clearSearch, writer.uint32(58).fork()).join();
1066
+ }
1067
+ if (message.closeMainWindow !== undefined) {
1068
+ exports.CloseMainWindowRequest.encode(message.closeMainWindow, writer.uint32(66).fork()).join();
1069
+ }
1070
+ if (message.showHud !== undefined) {
1071
+ exports.ShowHudRequest.encode(message.showHud, writer.uint32(74).fork()).join();
1072
+ }
1073
+ if (message.setSearchText !== undefined) {
1074
+ exports.SetSearchTextRequest.encode(message.setSearchText, writer.uint32(82).fork()).join();
1075
+ }
1076
+ if (message.confirmAlert !== undefined) {
1077
+ exports.ConfirmAlertRequest.encode(message.confirmAlert, writer.uint32(90).fork()).join();
1078
+ }
1079
+ if (message.getSelectedText !== undefined) {
1080
+ exports.GetSelectedTextRequest.encode(message.getSelectedText, writer.uint32(98).fork()).join();
1081
+ }
1082
+ return writer;
1083
+ },
1084
+ decode(input, length) {
1085
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1086
+ const end = length === undefined ? reader.len : reader.pos + length;
1087
+ const message = createBaseRequest();
1088
+ while (reader.pos < end) {
1089
+ const tag = reader.uint32();
1090
+ switch (tag >>> 3) {
1091
+ case 1: {
1092
+ if (tag !== 10) {
1093
+ break;
1094
+ }
1095
+ message.render = exports.RenderRequest.decode(reader, reader.uint32());
1096
+ continue;
1097
+ }
1098
+ case 2: {
1099
+ if (tag !== 18) {
1100
+ break;
1101
+ }
1102
+ message.showToast = exports.ShowToastRequest.decode(reader, reader.uint32());
1103
+ continue;
1104
+ }
1105
+ case 3: {
1106
+ if (tag !== 26) {
1107
+ break;
1108
+ }
1109
+ message.hideToast = exports.HideToastRequest.decode(reader, reader.uint32());
1110
+ continue;
1111
+ }
1112
+ case 4: {
1113
+ if (tag !== 34) {
1114
+ break;
1115
+ }
1116
+ message.updateToast = exports.UpdateToastRequest.decode(reader, reader.uint32());
1117
+ continue;
1118
+ }
1119
+ case 5: {
1120
+ if (tag !== 42) {
1121
+ break;
1122
+ }
1123
+ message.pushView = exports.PushViewRequest.decode(reader, reader.uint32());
1124
+ continue;
1125
+ }
1126
+ case 6: {
1127
+ if (tag !== 50) {
1128
+ break;
1129
+ }
1130
+ message.popView = exports.PopViewRequest.decode(reader, reader.uint32());
1131
+ continue;
1132
+ }
1133
+ case 7: {
1134
+ if (tag !== 58) {
1135
+ break;
1136
+ }
1137
+ message.clearSearch = exports.ClearSearchBarRequest.decode(reader, reader.uint32());
1138
+ continue;
1139
+ }
1140
+ case 8: {
1141
+ if (tag !== 66) {
1142
+ break;
1143
+ }
1144
+ message.closeMainWindow = exports.CloseMainWindowRequest.decode(reader, reader.uint32());
1145
+ continue;
1146
+ }
1147
+ case 9: {
1148
+ if (tag !== 74) {
1149
+ break;
1150
+ }
1151
+ message.showHud = exports.ShowHudRequest.decode(reader, reader.uint32());
1152
+ continue;
1153
+ }
1154
+ case 10: {
1155
+ if (tag !== 82) {
1156
+ break;
1157
+ }
1158
+ message.setSearchText = exports.SetSearchTextRequest.decode(reader, reader.uint32());
1159
+ continue;
1160
+ }
1161
+ case 11: {
1162
+ if (tag !== 90) {
1163
+ break;
1164
+ }
1165
+ message.confirmAlert = exports.ConfirmAlertRequest.decode(reader, reader.uint32());
1166
+ continue;
1167
+ }
1168
+ case 12: {
1169
+ if (tag !== 98) {
1170
+ break;
1171
+ }
1172
+ message.getSelectedText = exports.GetSelectedTextRequest.decode(reader, reader.uint32());
1173
+ continue;
1174
+ }
1175
+ }
1176
+ if ((tag & 7) === 4 || tag === 0) {
1177
+ break;
1178
+ }
1179
+ reader.skip(tag & 7);
1180
+ }
1181
+ return message;
1182
+ },
1183
+ fromJSON(object) {
1184
+ return {
1185
+ render: isSet(object.render) ? exports.RenderRequest.fromJSON(object.render) : undefined,
1186
+ showToast: isSet(object.showToast) ? exports.ShowToastRequest.fromJSON(object.showToast) : undefined,
1187
+ hideToast: isSet(object.hideToast) ? exports.HideToastRequest.fromJSON(object.hideToast) : undefined,
1188
+ updateToast: isSet(object.updateToast) ? exports.UpdateToastRequest.fromJSON(object.updateToast) : undefined,
1189
+ pushView: isSet(object.pushView) ? exports.PushViewRequest.fromJSON(object.pushView) : undefined,
1190
+ popView: isSet(object.popView) ? exports.PopViewRequest.fromJSON(object.popView) : undefined,
1191
+ clearSearch: isSet(object.clearSearch) ? exports.ClearSearchBarRequest.fromJSON(object.clearSearch) : undefined,
1192
+ closeMainWindow: isSet(object.closeMainWindow)
1193
+ ? exports.CloseMainWindowRequest.fromJSON(object.closeMainWindow)
1194
+ : undefined,
1195
+ showHud: isSet(object.showHud) ? exports.ShowHudRequest.fromJSON(object.showHud) : undefined,
1196
+ setSearchText: isSet(object.setSearchText) ? exports.SetSearchTextRequest.fromJSON(object.setSearchText) : undefined,
1197
+ confirmAlert: isSet(object.confirmAlert) ? exports.ConfirmAlertRequest.fromJSON(object.confirmAlert) : undefined,
1198
+ getSelectedText: isSet(object.getSelectedText)
1199
+ ? exports.GetSelectedTextRequest.fromJSON(object.getSelectedText)
1200
+ : undefined,
1201
+ };
1202
+ },
1203
+ toJSON(message) {
1204
+ const obj = {};
1205
+ if (message.render !== undefined) {
1206
+ obj.render = exports.RenderRequest.toJSON(message.render);
1207
+ }
1208
+ if (message.showToast !== undefined) {
1209
+ obj.showToast = exports.ShowToastRequest.toJSON(message.showToast);
1210
+ }
1211
+ if (message.hideToast !== undefined) {
1212
+ obj.hideToast = exports.HideToastRequest.toJSON(message.hideToast);
1213
+ }
1214
+ if (message.updateToast !== undefined) {
1215
+ obj.updateToast = exports.UpdateToastRequest.toJSON(message.updateToast);
1216
+ }
1217
+ if (message.pushView !== undefined) {
1218
+ obj.pushView = exports.PushViewRequest.toJSON(message.pushView);
1219
+ }
1220
+ if (message.popView !== undefined) {
1221
+ obj.popView = exports.PopViewRequest.toJSON(message.popView);
1222
+ }
1223
+ if (message.clearSearch !== undefined) {
1224
+ obj.clearSearch = exports.ClearSearchBarRequest.toJSON(message.clearSearch);
1225
+ }
1226
+ if (message.closeMainWindow !== undefined) {
1227
+ obj.closeMainWindow = exports.CloseMainWindowRequest.toJSON(message.closeMainWindow);
1228
+ }
1229
+ if (message.showHud !== undefined) {
1230
+ obj.showHud = exports.ShowHudRequest.toJSON(message.showHud);
1231
+ }
1232
+ if (message.setSearchText !== undefined) {
1233
+ obj.setSearchText = exports.SetSearchTextRequest.toJSON(message.setSearchText);
1234
+ }
1235
+ if (message.confirmAlert !== undefined) {
1236
+ obj.confirmAlert = exports.ConfirmAlertRequest.toJSON(message.confirmAlert);
1237
+ }
1238
+ if (message.getSelectedText !== undefined) {
1239
+ obj.getSelectedText = exports.GetSelectedTextRequest.toJSON(message.getSelectedText);
1240
+ }
1241
+ return obj;
1242
+ },
1243
+ create(base) {
1244
+ return exports.Request.fromPartial(base ?? {});
1245
+ },
1246
+ fromPartial(object) {
1247
+ const message = createBaseRequest();
1248
+ message.render = (object.render !== undefined && object.render !== null)
1249
+ ? exports.RenderRequest.fromPartial(object.render)
1250
+ : undefined;
1251
+ message.showToast = (object.showToast !== undefined && object.showToast !== null)
1252
+ ? exports.ShowToastRequest.fromPartial(object.showToast)
1253
+ : undefined;
1254
+ message.hideToast = (object.hideToast !== undefined && object.hideToast !== null)
1255
+ ? exports.HideToastRequest.fromPartial(object.hideToast)
1256
+ : undefined;
1257
+ message.updateToast = (object.updateToast !== undefined && object.updateToast !== null)
1258
+ ? exports.UpdateToastRequest.fromPartial(object.updateToast)
1259
+ : undefined;
1260
+ message.pushView = (object.pushView !== undefined && object.pushView !== null)
1261
+ ? exports.PushViewRequest.fromPartial(object.pushView)
1262
+ : undefined;
1263
+ message.popView = (object.popView !== undefined && object.popView !== null)
1264
+ ? exports.PopViewRequest.fromPartial(object.popView)
1265
+ : undefined;
1266
+ message.clearSearch = (object.clearSearch !== undefined && object.clearSearch !== null)
1267
+ ? exports.ClearSearchBarRequest.fromPartial(object.clearSearch)
1268
+ : undefined;
1269
+ message.closeMainWindow = (object.closeMainWindow !== undefined && object.closeMainWindow !== null)
1270
+ ? exports.CloseMainWindowRequest.fromPartial(object.closeMainWindow)
1271
+ : undefined;
1272
+ message.showHud = (object.showHud !== undefined && object.showHud !== null)
1273
+ ? exports.ShowHudRequest.fromPartial(object.showHud)
1274
+ : undefined;
1275
+ message.setSearchText = (object.setSearchText !== undefined && object.setSearchText !== null)
1276
+ ? exports.SetSearchTextRequest.fromPartial(object.setSearchText)
1277
+ : undefined;
1278
+ message.confirmAlert = (object.confirmAlert !== undefined && object.confirmAlert !== null)
1279
+ ? exports.ConfirmAlertRequest.fromPartial(object.confirmAlert)
1280
+ : undefined;
1281
+ message.getSelectedText = (object.getSelectedText !== undefined && object.getSelectedText !== null)
1282
+ ? exports.GetSelectedTextRequest.fromPartial(object.getSelectedText)
1283
+ : undefined;
1284
+ return message;
1285
+ },
1286
+ };
1287
+ function createBaseResponse() {
1288
+ return {
1289
+ render: undefined,
1290
+ showToast: undefined,
1291
+ hideToast: undefined,
1292
+ updateToast: undefined,
1293
+ pushView: undefined,
1294
+ popView: undefined,
1295
+ clearSearch: undefined,
1296
+ closeMainWindow: undefined,
1297
+ showHud: undefined,
1298
+ setSearchText: undefined,
1299
+ confirmAlert: undefined,
1300
+ getSelectedText: undefined,
1301
+ };
1302
+ }
1303
+ exports.Response = {
1304
+ encode(message, writer = new wire_1.BinaryWriter()) {
1305
+ if (message.render !== undefined) {
1306
+ common_1.AckResponse.encode(message.render, writer.uint32(10).fork()).join();
1307
+ }
1308
+ if (message.showToast !== undefined) {
1309
+ common_1.AckResponse.encode(message.showToast, writer.uint32(18).fork()).join();
1310
+ }
1311
+ if (message.hideToast !== undefined) {
1312
+ common_1.AckResponse.encode(message.hideToast, writer.uint32(26).fork()).join();
1313
+ }
1314
+ if (message.updateToast !== undefined) {
1315
+ common_1.AckResponse.encode(message.updateToast, writer.uint32(34).fork()).join();
1316
+ }
1317
+ if (message.pushView !== undefined) {
1318
+ common_1.AckResponse.encode(message.pushView, writer.uint32(42).fork()).join();
1319
+ }
1320
+ if (message.popView !== undefined) {
1321
+ common_1.AckResponse.encode(message.popView, writer.uint32(50).fork()).join();
1322
+ }
1323
+ if (message.clearSearch !== undefined) {
1324
+ common_1.AckResponse.encode(message.clearSearch, writer.uint32(58).fork()).join();
1325
+ }
1326
+ if (message.closeMainWindow !== undefined) {
1327
+ common_1.AckResponse.encode(message.closeMainWindow, writer.uint32(66).fork()).join();
1328
+ }
1329
+ if (message.showHud !== undefined) {
1330
+ common_1.AckResponse.encode(message.showHud, writer.uint32(74).fork()).join();
1331
+ }
1332
+ if (message.setSearchText !== undefined) {
1333
+ common_1.AckResponse.encode(message.setSearchText, writer.uint32(82).fork()).join();
1334
+ }
1335
+ if (message.confirmAlert !== undefined) {
1336
+ common_1.AckResponse.encode(message.confirmAlert, writer.uint32(90).fork()).join();
1337
+ }
1338
+ if (message.getSelectedText !== undefined) {
1339
+ exports.GetSelectedTextResponse.encode(message.getSelectedText, writer.uint32(98).fork()).join();
1340
+ }
1341
+ return writer;
1342
+ },
1343
+ decode(input, length) {
1344
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1345
+ const end = length === undefined ? reader.len : reader.pos + length;
1346
+ const message = createBaseResponse();
1347
+ while (reader.pos < end) {
1348
+ const tag = reader.uint32();
1349
+ switch (tag >>> 3) {
1350
+ case 1: {
1351
+ if (tag !== 10) {
1352
+ break;
1353
+ }
1354
+ message.render = common_1.AckResponse.decode(reader, reader.uint32());
1355
+ continue;
1356
+ }
1357
+ case 2: {
1358
+ if (tag !== 18) {
1359
+ break;
1360
+ }
1361
+ message.showToast = common_1.AckResponse.decode(reader, reader.uint32());
1362
+ continue;
1363
+ }
1364
+ case 3: {
1365
+ if (tag !== 26) {
1366
+ break;
1367
+ }
1368
+ message.hideToast = common_1.AckResponse.decode(reader, reader.uint32());
1369
+ continue;
1370
+ }
1371
+ case 4: {
1372
+ if (tag !== 34) {
1373
+ break;
1374
+ }
1375
+ message.updateToast = common_1.AckResponse.decode(reader, reader.uint32());
1376
+ continue;
1377
+ }
1378
+ case 5: {
1379
+ if (tag !== 42) {
1380
+ break;
1381
+ }
1382
+ message.pushView = common_1.AckResponse.decode(reader, reader.uint32());
1383
+ continue;
1384
+ }
1385
+ case 6: {
1386
+ if (tag !== 50) {
1387
+ break;
1388
+ }
1389
+ message.popView = common_1.AckResponse.decode(reader, reader.uint32());
1390
+ continue;
1391
+ }
1392
+ case 7: {
1393
+ if (tag !== 58) {
1394
+ break;
1395
+ }
1396
+ message.clearSearch = common_1.AckResponse.decode(reader, reader.uint32());
1397
+ continue;
1398
+ }
1399
+ case 8: {
1400
+ if (tag !== 66) {
1401
+ break;
1402
+ }
1403
+ message.closeMainWindow = common_1.AckResponse.decode(reader, reader.uint32());
1404
+ continue;
1405
+ }
1406
+ case 9: {
1407
+ if (tag !== 74) {
1408
+ break;
1409
+ }
1410
+ message.showHud = common_1.AckResponse.decode(reader, reader.uint32());
1411
+ continue;
1412
+ }
1413
+ case 10: {
1414
+ if (tag !== 82) {
1415
+ break;
1416
+ }
1417
+ message.setSearchText = common_1.AckResponse.decode(reader, reader.uint32());
1418
+ continue;
1419
+ }
1420
+ case 11: {
1421
+ if (tag !== 90) {
1422
+ break;
1423
+ }
1424
+ message.confirmAlert = common_1.AckResponse.decode(reader, reader.uint32());
1425
+ continue;
1426
+ }
1427
+ case 12: {
1428
+ if (tag !== 98) {
1429
+ break;
1430
+ }
1431
+ message.getSelectedText = exports.GetSelectedTextResponse.decode(reader, reader.uint32());
1432
+ continue;
1433
+ }
1434
+ }
1435
+ if ((tag & 7) === 4 || tag === 0) {
1436
+ break;
1437
+ }
1438
+ reader.skip(tag & 7);
1439
+ }
1440
+ return message;
1441
+ },
1442
+ fromJSON(object) {
1443
+ return {
1444
+ render: isSet(object.render) ? common_1.AckResponse.fromJSON(object.render) : undefined,
1445
+ showToast: isSet(object.showToast) ? common_1.AckResponse.fromJSON(object.showToast) : undefined,
1446
+ hideToast: isSet(object.hideToast) ? common_1.AckResponse.fromJSON(object.hideToast) : undefined,
1447
+ updateToast: isSet(object.updateToast) ? common_1.AckResponse.fromJSON(object.updateToast) : undefined,
1448
+ pushView: isSet(object.pushView) ? common_1.AckResponse.fromJSON(object.pushView) : undefined,
1449
+ popView: isSet(object.popView) ? common_1.AckResponse.fromJSON(object.popView) : undefined,
1450
+ clearSearch: isSet(object.clearSearch) ? common_1.AckResponse.fromJSON(object.clearSearch) : undefined,
1451
+ closeMainWindow: isSet(object.closeMainWindow) ? common_1.AckResponse.fromJSON(object.closeMainWindow) : undefined,
1452
+ showHud: isSet(object.showHud) ? common_1.AckResponse.fromJSON(object.showHud) : undefined,
1453
+ setSearchText: isSet(object.setSearchText) ? common_1.AckResponse.fromJSON(object.setSearchText) : undefined,
1454
+ confirmAlert: isSet(object.confirmAlert) ? common_1.AckResponse.fromJSON(object.confirmAlert) : undefined,
1455
+ getSelectedText: isSet(object.getSelectedText)
1456
+ ? exports.GetSelectedTextResponse.fromJSON(object.getSelectedText)
1457
+ : undefined,
1458
+ };
1459
+ },
1460
+ toJSON(message) {
1461
+ const obj = {};
1462
+ if (message.render !== undefined) {
1463
+ obj.render = common_1.AckResponse.toJSON(message.render);
1464
+ }
1465
+ if (message.showToast !== undefined) {
1466
+ obj.showToast = common_1.AckResponse.toJSON(message.showToast);
1467
+ }
1468
+ if (message.hideToast !== undefined) {
1469
+ obj.hideToast = common_1.AckResponse.toJSON(message.hideToast);
1470
+ }
1471
+ if (message.updateToast !== undefined) {
1472
+ obj.updateToast = common_1.AckResponse.toJSON(message.updateToast);
1473
+ }
1474
+ if (message.pushView !== undefined) {
1475
+ obj.pushView = common_1.AckResponse.toJSON(message.pushView);
1476
+ }
1477
+ if (message.popView !== undefined) {
1478
+ obj.popView = common_1.AckResponse.toJSON(message.popView);
1479
+ }
1480
+ if (message.clearSearch !== undefined) {
1481
+ obj.clearSearch = common_1.AckResponse.toJSON(message.clearSearch);
1482
+ }
1483
+ if (message.closeMainWindow !== undefined) {
1484
+ obj.closeMainWindow = common_1.AckResponse.toJSON(message.closeMainWindow);
1485
+ }
1486
+ if (message.showHud !== undefined) {
1487
+ obj.showHud = common_1.AckResponse.toJSON(message.showHud);
1488
+ }
1489
+ if (message.setSearchText !== undefined) {
1490
+ obj.setSearchText = common_1.AckResponse.toJSON(message.setSearchText);
1491
+ }
1492
+ if (message.confirmAlert !== undefined) {
1493
+ obj.confirmAlert = common_1.AckResponse.toJSON(message.confirmAlert);
1494
+ }
1495
+ if (message.getSelectedText !== undefined) {
1496
+ obj.getSelectedText = exports.GetSelectedTextResponse.toJSON(message.getSelectedText);
1497
+ }
1498
+ return obj;
1499
+ },
1500
+ create(base) {
1501
+ return exports.Response.fromPartial(base ?? {});
1502
+ },
1503
+ fromPartial(object) {
1504
+ const message = createBaseResponse();
1505
+ message.render = (object.render !== undefined && object.render !== null)
1506
+ ? common_1.AckResponse.fromPartial(object.render)
1507
+ : undefined;
1508
+ message.showToast = (object.showToast !== undefined && object.showToast !== null)
1509
+ ? common_1.AckResponse.fromPartial(object.showToast)
1510
+ : undefined;
1511
+ message.hideToast = (object.hideToast !== undefined && object.hideToast !== null)
1512
+ ? common_1.AckResponse.fromPartial(object.hideToast)
1513
+ : undefined;
1514
+ message.updateToast = (object.updateToast !== undefined && object.updateToast !== null)
1515
+ ? common_1.AckResponse.fromPartial(object.updateToast)
1516
+ : undefined;
1517
+ message.pushView = (object.pushView !== undefined && object.pushView !== null)
1518
+ ? common_1.AckResponse.fromPartial(object.pushView)
1519
+ : undefined;
1520
+ message.popView = (object.popView !== undefined && object.popView !== null)
1521
+ ? common_1.AckResponse.fromPartial(object.popView)
1522
+ : undefined;
1523
+ message.clearSearch = (object.clearSearch !== undefined && object.clearSearch !== null)
1524
+ ? common_1.AckResponse.fromPartial(object.clearSearch)
1525
+ : undefined;
1526
+ message.closeMainWindow = (object.closeMainWindow !== undefined && object.closeMainWindow !== null)
1527
+ ? common_1.AckResponse.fromPartial(object.closeMainWindow)
1528
+ : undefined;
1529
+ message.showHud = (object.showHud !== undefined && object.showHud !== null)
1530
+ ? common_1.AckResponse.fromPartial(object.showHud)
1531
+ : undefined;
1532
+ message.setSearchText = (object.setSearchText !== undefined && object.setSearchText !== null)
1533
+ ? common_1.AckResponse.fromPartial(object.setSearchText)
1534
+ : undefined;
1535
+ message.confirmAlert = (object.confirmAlert !== undefined && object.confirmAlert !== null)
1536
+ ? common_1.AckResponse.fromPartial(object.confirmAlert)
1537
+ : undefined;
1538
+ message.getSelectedText = (object.getSelectedText !== undefined && object.getSelectedText !== null)
1539
+ ? exports.GetSelectedTextResponse.fromPartial(object.getSelectedText)
1540
+ : undefined;
1541
+ return message;
1542
+ },
1543
+ };
1544
+ function createBaseRenderNode() {
1545
+ return { type: "", hasDirtyChild: false, hasDirtyProps: false, props: {}, children: [] };
1546
+ }
1547
+ exports.RenderNode = {
1548
+ encode(message, writer = new wire_1.BinaryWriter()) {
1549
+ if (message.type !== "") {
1550
+ writer.uint32(10).string(message.type);
1551
+ }
1552
+ if (message.hasDirtyChild !== false) {
1553
+ writer.uint32(16).bool(message.hasDirtyChild);
1554
+ }
1555
+ if (message.hasDirtyProps !== false) {
1556
+ writer.uint32(24).bool(message.hasDirtyProps);
1557
+ }
1558
+ Object.entries(message.props).forEach(([key, value]) => {
1559
+ if (value !== undefined) {
1560
+ exports.RenderNode_PropsEntry.encode({ key: key, value }, writer.uint32(34).fork()).join();
1561
+ }
1562
+ });
1563
+ for (const v of message.children) {
1564
+ exports.RenderNode.encode(v, writer.uint32(42).fork()).join();
1565
+ }
1566
+ return writer;
1567
+ },
1568
+ decode(input, length) {
1569
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1570
+ const end = length === undefined ? reader.len : reader.pos + length;
1571
+ const message = createBaseRenderNode();
1572
+ while (reader.pos < end) {
1573
+ const tag = reader.uint32();
1574
+ switch (tag >>> 3) {
1575
+ case 1: {
1576
+ if (tag !== 10) {
1577
+ break;
1578
+ }
1579
+ message.type = reader.string();
1580
+ continue;
1581
+ }
1582
+ case 2: {
1583
+ if (tag !== 16) {
1584
+ break;
1585
+ }
1586
+ message.hasDirtyChild = reader.bool();
1587
+ continue;
1588
+ }
1589
+ case 3: {
1590
+ if (tag !== 24) {
1591
+ break;
1592
+ }
1593
+ message.hasDirtyProps = reader.bool();
1594
+ continue;
1595
+ }
1596
+ case 4: {
1597
+ if (tag !== 34) {
1598
+ break;
1599
+ }
1600
+ const entry4 = exports.RenderNode_PropsEntry.decode(reader, reader.uint32());
1601
+ if (entry4.value !== undefined) {
1602
+ message.props[entry4.key] = entry4.value;
1603
+ }
1604
+ continue;
1605
+ }
1606
+ case 5: {
1607
+ if (tag !== 42) {
1608
+ break;
1609
+ }
1610
+ message.children.push(exports.RenderNode.decode(reader, reader.uint32()));
1611
+ continue;
1612
+ }
1613
+ }
1614
+ if ((tag & 7) === 4 || tag === 0) {
1615
+ break;
1616
+ }
1617
+ reader.skip(tag & 7);
1618
+ }
1619
+ return message;
1620
+ },
1621
+ fromJSON(object) {
1622
+ return {
1623
+ type: isSet(object.type) ? globalThis.String(object.type) : "",
1624
+ hasDirtyChild: isSet(object.hasDirtyChild) ? globalThis.Boolean(object.hasDirtyChild) : false,
1625
+ hasDirtyProps: isSet(object.hasDirtyProps) ? globalThis.Boolean(object.hasDirtyProps) : false,
1626
+ props: isObject(object.props)
1627
+ ? Object.entries(object.props).reduce((acc, [key, value]) => {
1628
+ acc[key] = value;
1629
+ return acc;
1630
+ }, {})
1631
+ : {},
1632
+ children: globalThis.Array.isArray(object?.children)
1633
+ ? object.children.map((e) => exports.RenderNode.fromJSON(e))
1634
+ : [],
1635
+ };
1636
+ },
1637
+ toJSON(message) {
1638
+ const obj = {};
1639
+ if (message.type !== "") {
1640
+ obj.type = message.type;
1641
+ }
1642
+ if (message.hasDirtyChild !== false) {
1643
+ obj.hasDirtyChild = message.hasDirtyChild;
1644
+ }
1645
+ if (message.hasDirtyProps !== false) {
1646
+ obj.hasDirtyProps = message.hasDirtyProps;
1647
+ }
1648
+ if (message.props) {
1649
+ const entries = Object.entries(message.props);
1650
+ if (entries.length > 0) {
1651
+ obj.props = {};
1652
+ entries.forEach(([k, v]) => {
1653
+ obj.props[k] = v;
1654
+ });
1655
+ }
1656
+ }
1657
+ if (message.children?.length) {
1658
+ obj.children = message.children.map((e) => exports.RenderNode.toJSON(e));
1659
+ }
1660
+ return obj;
1661
+ },
1662
+ create(base) {
1663
+ return exports.RenderNode.fromPartial(base ?? {});
1664
+ },
1665
+ fromPartial(object) {
1666
+ const message = createBaseRenderNode();
1667
+ message.type = object.type ?? "";
1668
+ message.hasDirtyChild = object.hasDirtyChild ?? false;
1669
+ message.hasDirtyProps = object.hasDirtyProps ?? false;
1670
+ message.props = Object.entries(object.props ?? {}).reduce((acc, [key, value]) => {
1671
+ if (value !== undefined) {
1672
+ acc[key] = value;
1673
+ }
1674
+ return acc;
1675
+ }, {});
1676
+ message.children = object.children?.map((e) => exports.RenderNode.fromPartial(e)) || [];
1677
+ return message;
1678
+ },
1679
+ };
1680
+ function createBaseRenderNode_PropsEntry() {
1681
+ return { key: "", value: undefined };
1682
+ }
1683
+ exports.RenderNode_PropsEntry = {
1684
+ encode(message, writer = new wire_1.BinaryWriter()) {
1685
+ if (message.key !== "") {
1686
+ writer.uint32(10).string(message.key);
1687
+ }
1688
+ if (message.value !== undefined) {
1689
+ struct_1.Value.encode(struct_1.Value.wrap(message.value), writer.uint32(18).fork()).join();
1690
+ }
1691
+ return writer;
1692
+ },
1693
+ decode(input, length) {
1694
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1695
+ const end = length === undefined ? reader.len : reader.pos + length;
1696
+ const message = createBaseRenderNode_PropsEntry();
1697
+ while (reader.pos < end) {
1698
+ const tag = reader.uint32();
1699
+ switch (tag >>> 3) {
1700
+ case 1: {
1701
+ if (tag !== 10) {
1702
+ break;
1703
+ }
1704
+ message.key = reader.string();
1705
+ continue;
1706
+ }
1707
+ case 2: {
1708
+ if (tag !== 18) {
1709
+ break;
1710
+ }
1711
+ message.value = struct_1.Value.unwrap(struct_1.Value.decode(reader, reader.uint32()));
1712
+ continue;
1713
+ }
1714
+ }
1715
+ if ((tag & 7) === 4 || tag === 0) {
1716
+ break;
1717
+ }
1718
+ reader.skip(tag & 7);
1719
+ }
1720
+ return message;
1721
+ },
1722
+ fromJSON(object) {
1723
+ return {
1724
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
1725
+ value: isSet(object?.value) ? object.value : undefined,
1726
+ };
1727
+ },
1728
+ toJSON(message) {
1729
+ const obj = {};
1730
+ if (message.key !== "") {
1731
+ obj.key = message.key;
1732
+ }
1733
+ if (message.value !== undefined) {
1734
+ obj.value = message.value;
1735
+ }
1736
+ return obj;
1737
+ },
1738
+ create(base) {
1739
+ return exports.RenderNode_PropsEntry.fromPartial(base ?? {});
1740
+ },
1741
+ fromPartial(object) {
1742
+ const message = createBaseRenderNode_PropsEntry();
1743
+ message.key = object.key ?? "";
1744
+ message.value = object.value ?? undefined;
1745
+ return message;
1746
+ },
1747
+ };
1748
+ function createBaseThemedImageSource() {
1749
+ return { light: "", dark: "" };
1750
+ }
1751
+ exports.ThemedImageSource = {
1752
+ encode(message, writer = new wire_1.BinaryWriter()) {
1753
+ if (message.light !== "") {
1754
+ writer.uint32(10).string(message.light);
1755
+ }
1756
+ if (message.dark !== "") {
1757
+ writer.uint32(18).string(message.dark);
1758
+ }
1759
+ return writer;
1760
+ },
1761
+ decode(input, length) {
1762
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1763
+ const end = length === undefined ? reader.len : reader.pos + length;
1764
+ const message = createBaseThemedImageSource();
1765
+ while (reader.pos < end) {
1766
+ const tag = reader.uint32();
1767
+ switch (tag >>> 3) {
1768
+ case 1: {
1769
+ if (tag !== 10) {
1770
+ break;
1771
+ }
1772
+ message.light = reader.string();
1773
+ continue;
1774
+ }
1775
+ case 2: {
1776
+ if (tag !== 18) {
1777
+ break;
1778
+ }
1779
+ message.dark = reader.string();
1780
+ continue;
1781
+ }
1782
+ }
1783
+ if ((tag & 7) === 4 || tag === 0) {
1784
+ break;
1785
+ }
1786
+ reader.skip(tag & 7);
1787
+ }
1788
+ return message;
1789
+ },
1790
+ fromJSON(object) {
1791
+ return {
1792
+ light: isSet(object.light) ? globalThis.String(object.light) : "",
1793
+ dark: isSet(object.dark) ? globalThis.String(object.dark) : "",
1794
+ };
1795
+ },
1796
+ toJSON(message) {
1797
+ const obj = {};
1798
+ if (message.light !== "") {
1799
+ obj.light = message.light;
1800
+ }
1801
+ if (message.dark !== "") {
1802
+ obj.dark = message.dark;
1803
+ }
1804
+ return obj;
1805
+ },
1806
+ create(base) {
1807
+ return exports.ThemedImageSource.fromPartial(base ?? {});
1808
+ },
1809
+ fromPartial(object) {
1810
+ const message = createBaseThemedImageSource();
1811
+ message.light = object.light ?? "";
1812
+ message.dark = object.dark ?? "";
1813
+ return message;
1814
+ },
1815
+ };
1816
+ function createBaseImageSource() {
1817
+ return { raw: undefined, themed: undefined };
1818
+ }
1819
+ exports.ImageSource = {
1820
+ encode(message, writer = new wire_1.BinaryWriter()) {
1821
+ if (message.raw !== undefined) {
1822
+ writer.uint32(10).string(message.raw);
1823
+ }
1824
+ if (message.themed !== undefined) {
1825
+ exports.ThemedImageSource.encode(message.themed, writer.uint32(18).fork()).join();
1826
+ }
1827
+ return writer;
1828
+ },
1829
+ decode(input, length) {
1830
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1831
+ const end = length === undefined ? reader.len : reader.pos + length;
1832
+ const message = createBaseImageSource();
1833
+ while (reader.pos < end) {
1834
+ const tag = reader.uint32();
1835
+ switch (tag >>> 3) {
1836
+ case 1: {
1837
+ if (tag !== 10) {
1838
+ break;
1839
+ }
1840
+ message.raw = reader.string();
1841
+ continue;
1842
+ }
1843
+ case 2: {
1844
+ if (tag !== 18) {
1845
+ break;
1846
+ }
1847
+ message.themed = exports.ThemedImageSource.decode(reader, reader.uint32());
1848
+ continue;
1849
+ }
1850
+ }
1851
+ if ((tag & 7) === 4 || tag === 0) {
1852
+ break;
1853
+ }
1854
+ reader.skip(tag & 7);
1855
+ }
1856
+ return message;
1857
+ },
1858
+ fromJSON(object) {
1859
+ return {
1860
+ raw: isSet(object.raw) ? globalThis.String(object.raw) : undefined,
1861
+ themed: isSet(object.themed) ? exports.ThemedImageSource.fromJSON(object.themed) : undefined,
1862
+ };
1863
+ },
1864
+ toJSON(message) {
1865
+ const obj = {};
1866
+ if (message.raw !== undefined) {
1867
+ obj.raw = message.raw;
1868
+ }
1869
+ if (message.themed !== undefined) {
1870
+ obj.themed = exports.ThemedImageSource.toJSON(message.themed);
1871
+ }
1872
+ return obj;
1873
+ },
1874
+ create(base) {
1875
+ return exports.ImageSource.fromPartial(base ?? {});
1876
+ },
1877
+ fromPartial(object) {
1878
+ const message = createBaseImageSource();
1879
+ message.raw = object.raw ?? undefined;
1880
+ message.themed = (object.themed !== undefined && object.themed !== null)
1881
+ ? exports.ThemedImageSource.fromPartial(object.themed)
1882
+ : undefined;
1883
+ return message;
1884
+ },
1885
+ };
1886
+ function createBaseImage() {
1887
+ return { source: undefined, fallback: undefined, mask: undefined, colorTint: undefined };
1888
+ }
1889
+ exports.Image = {
1890
+ encode(message, writer = new wire_1.BinaryWriter()) {
1891
+ if (message.source !== undefined) {
1892
+ exports.ImageSource.encode(message.source, writer.uint32(10).fork()).join();
1893
+ }
1894
+ if (message.fallback !== undefined) {
1895
+ exports.ImageSource.encode(message.fallback, writer.uint32(18).fork()).join();
1896
+ }
1897
+ if (message.mask !== undefined) {
1898
+ writer.uint32(24).int32(message.mask);
1899
+ }
1900
+ if (message.colorTint !== undefined) {
1901
+ writer.uint32(34).string(message.colorTint);
1902
+ }
1903
+ return writer;
1904
+ },
1905
+ decode(input, length) {
1906
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1907
+ const end = length === undefined ? reader.len : reader.pos + length;
1908
+ const message = createBaseImage();
1909
+ while (reader.pos < end) {
1910
+ const tag = reader.uint32();
1911
+ switch (tag >>> 3) {
1912
+ case 1: {
1913
+ if (tag !== 10) {
1914
+ break;
1915
+ }
1916
+ message.source = exports.ImageSource.decode(reader, reader.uint32());
1917
+ continue;
1918
+ }
1919
+ case 2: {
1920
+ if (tag !== 18) {
1921
+ break;
1922
+ }
1923
+ message.fallback = exports.ImageSource.decode(reader, reader.uint32());
1924
+ continue;
1925
+ }
1926
+ case 3: {
1927
+ if (tag !== 24) {
1928
+ break;
1929
+ }
1930
+ message.mask = reader.int32();
1931
+ continue;
1932
+ }
1933
+ case 4: {
1934
+ if (tag !== 34) {
1935
+ break;
1936
+ }
1937
+ message.colorTint = reader.string();
1938
+ continue;
1939
+ }
1940
+ }
1941
+ if ((tag & 7) === 4 || tag === 0) {
1942
+ break;
1943
+ }
1944
+ reader.skip(tag & 7);
1945
+ }
1946
+ return message;
1947
+ },
1948
+ fromJSON(object) {
1949
+ return {
1950
+ source: isSet(object.source) ? exports.ImageSource.fromJSON(object.source) : undefined,
1951
+ fallback: isSet(object.fallback) ? exports.ImageSource.fromJSON(object.fallback) : undefined,
1952
+ mask: isSet(object.mask) ? imageMaskFromJSON(object.mask) : undefined,
1953
+ colorTint: isSet(object.colorTint) ? globalThis.String(object.colorTint) : undefined,
1954
+ };
1955
+ },
1956
+ toJSON(message) {
1957
+ const obj = {};
1958
+ if (message.source !== undefined) {
1959
+ obj.source = exports.ImageSource.toJSON(message.source);
1960
+ }
1961
+ if (message.fallback !== undefined) {
1962
+ obj.fallback = exports.ImageSource.toJSON(message.fallback);
1963
+ }
1964
+ if (message.mask !== undefined) {
1965
+ obj.mask = imageMaskToJSON(message.mask);
1966
+ }
1967
+ if (message.colorTint !== undefined) {
1968
+ obj.colorTint = message.colorTint;
1969
+ }
1970
+ return obj;
1971
+ },
1972
+ create(base) {
1973
+ return exports.Image.fromPartial(base ?? {});
1974
+ },
1975
+ fromPartial(object) {
1976
+ const message = createBaseImage();
1977
+ message.source = (object.source !== undefined && object.source !== null)
1978
+ ? exports.ImageSource.fromPartial(object.source)
1979
+ : undefined;
1980
+ message.fallback = (object.fallback !== undefined && object.fallback !== null)
1981
+ ? exports.ImageSource.fromPartial(object.fallback)
1982
+ : undefined;
1983
+ message.mask = object.mask ?? undefined;
1984
+ message.colorTint = object.colorTint ?? undefined;
1985
+ return message;
1986
+ },
1987
+ };
1988
+ function isObject(value) {
1989
+ return typeof value === "object" && value !== null;
1990
+ }
1991
+ function isSet(value) {
1992
+ return value !== null && value !== undefined;
1993
+ }