@sphereon/idk-lib-data-link-http-client-public 0.25.0-SNAPSHOT-build-8529934

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.
@@ -0,0 +1,4930 @@
1
+ import {
2
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
3
+ abs22kdeprm0tm5i as abs,
4
+ Unit_instancev9v8hjid95df as Unit_instance,
5
+ equals2au1ep9vhcato as equals,
6
+ initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
7
+ VOID3gxj6tk5isa35 as VOID,
8
+ initMetadataForInterface1egvbzx539z91 as initMetadataForInterface,
9
+ initMetadataForObject1cxne3s9w65el as initMetadataForObject,
10
+ toLongkk4waq8msp1k as toLong,
11
+ fromInt2ii0rejb1w62w as fromInt,
12
+ NotImplementedErrorfzlkpv14xxr8 as NotImplementedError,
13
+ ArrayList3it5z8td81qkl as ArrayList,
14
+ collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
15
+ IllegalArgumentException2asla15b5jaob as IllegalArgumentException,
16
+ THROW_CCE2g6jy02ryeudk as THROW_CCE,
17
+ Paire9pteg33gng7 as Pair,
18
+ toMap1vec9topfei08 as toMap,
19
+ toMutableMapr5f3w62lv8sk as toMutableMap,
20
+ toMutableList20rdgwi7d3cwi as toMutableList,
21
+ lazy2hsh8ze7j6ikd as lazy,
22
+ KProperty1ca4yb4wlo496 as KProperty1,
23
+ getPropertyCallableRef3hckxc0xueiaj as getPropertyCallableRef,
24
+ NoSuchElementException679xzhnp5bpj as NoSuchElementException,
25
+ startsWith26w8qjqapeeq6 as startsWith,
26
+ split2bvyvnrlcifjv as split,
27
+ toIntOrNull3w2d066r9pvwm as toIntOrNull,
28
+ KtMap140uvy3s5zad8 as KtMap,
29
+ isInterface3d6p8outrmvmk as isInterface,
30
+ mutableMapOfk2y3zt1azl40 as mutableMapOf,
31
+ copyToArray2j022khrow2yi as copyToArray,
32
+ protoOf180f3jzyo7rfj as protoOf,
33
+ noWhenBranchMatchedException2a6r7ubxgky5j as noWhenBranchMatchedException,
34
+ numberToLong2pakxeg38estk as numberToLong,
35
+ isNumberiramasdbon0i as isNumber,
36
+ KtList3hktaavzmj137 as KtList,
37
+ isByteArray4nnzfn1x4o3w as isByteArray,
38
+ toString30pk9tzaqopn as toString,
39
+ KtMutableMap1kqeifoi36kpz as KtMutableMap,
40
+ KtMutableList1beimitadwkna as KtMutableList,
41
+ numberToDouble210hrknaofnhf as numberToDouble,
42
+ isInfinite12nl8hpz1hbp2 as isInfinite,
43
+ isNaNymqb93xtq8w8 as isNaN_0,
44
+ _Char___init__impl__6a9atx2gndcvjvc5pke as _Char___init__impl__6a9atx,
45
+ contains2el4s70rdq4ld as contains,
46
+ toString1pkumu07cwy4m as toString_0,
47
+ contentToString3ujacv8hqfipd as contentToString,
48
+ contentEqualsaf55p28mnw74 as contentEquals,
49
+ getStringHashCode26igk1bx568vk as getStringHashCode,
50
+ contentHashCode2i020q5tbeh2s as contentHashCode,
51
+ defineProp3ur6h3slcvq4x as defineProp,
52
+ getOrNull1go7ef9ldk0df as getOrNull,
53
+ ensureNotNull1e947j3ixpazm as ensureNotNull,
54
+ toByte4i43936u611k as toByte,
55
+ getKClass3t8tygqu4lcxf as getKClass,
56
+ LazyThreadSafetyMode_PUBLICATION_getInstance3qslfm3vqg6y3 as LazyThreadSafetyMode_PUBLICATION_getInstance,
57
+ lazy1261dae0bgscp as lazy_0,
58
+ createThis2j2avj17cvnv2 as createThis,
59
+ contentEquals1cdp6c846cfdi as contentEquals_0,
60
+ contentHashCode25jw6rgkgywwr as contentHashCode_0,
61
+ StringBuildermazzzhj6kkai as StringBuilder,
62
+ convertToInty04h231mmjoh as convertToInt,
63
+ throwUninitializedPropertyAccessException14fok093f3k3t as throwUninitializedPropertyAccessException,
64
+ IllegalStateExceptionkoljg5n0nrlr as IllegalStateException,
65
+ getKClassFromExpression348iqjl4fnx2f as getKClassFromExpression,
66
+ _ULong___init__impl__c78o9k4z3cjzifecv6 as _ULong___init__impl__c78o9k,
67
+ _UByte___init__impl__g9hnc43bwrjlqz9k9id as _UByte___init__impl__g9hnc4,
68
+ _UInt___init__impl__l7qpdl2xbmh7to8lpd7 as _UInt___init__impl__l7qpdl,
69
+ _UInt___get_data__impl__f0vqqw2j5mttix8w0l0 as _UInt___get_data__impl__f0vqqw,
70
+ _ULong___get_data__impl__fggpzb2bbucljk081qt as _ULong___get_data__impl__fggpzb,
71
+ ulongCompare29yg6v52hxi4l as ulongCompare,
72
+ shiftLeft3tsh2sstjchzn as shiftLeft,
73
+ _UByte___get_data__impl__jof9qr23gcv767stjfh as _UByte___get_data__impl__jof9qr,
74
+ convertToByte2t4hntblnhq2k as convertToByte,
75
+ to2cs3ny02qtbcb as to,
76
+ mapOf1xd03cq9cnmy8 as mapOf,
77
+ emptyList1g2z5xcrvp2zy as emptyList,
78
+ mapOf2zpbbmyqk8xpf as mapOf_0,
79
+ toRawBits2035dtuolth0v as toRawBits,
80
+ toRawBits3bthuu8natj5y as toRawBits_0,
81
+ shiftRight2gqph14wydb8s as shiftRight,
82
+ toCharArray32huqyw9tt7kx as toCharArray,
83
+ negate13xrbakfwasjy as negate,
84
+ hashCodeq5arwsb9dgti as hashCode,
85
+ isArray1hxjqtqy632bc as isArray,
86
+ ULong3f9k7s38t3rfp as ULong,
87
+ UInt1hthisrv6cndi as UInt,
88
+ Enum3alwj03lh1n41 as Enum,
89
+ numberRangeToNumber25vse2rgp6rs8 as numberRangeToNumber,
90
+ ClosedRangehokgr73im9z3 as ClosedRange,
91
+ contains2c50nlxg7en7o as contains_0,
92
+ LinkedHashMap1zhqxkxv3xnkl as LinkedHashMap,
93
+ mapCapacity1h45rc3eh9p2l as mapCapacity,
94
+ coerceAtLeast2bkz8m9ik7hep as coerceAtLeast,
95
+ getBooleanHashCode1bbj3u6b3v0a7 as getBooleanHashCode,
96
+ encodeToByteArray1onwao0uakjfh as encodeToByteArray,
97
+ emptySetcxexqki71qfa as emptySet,
98
+ charSequenceLength3278n89t01tmv as charSequenceLength,
99
+ charSequenceGet1vxk1y5n17t1z as charSequenceGet,
100
+ hexToByteArrayj26yk4970vc7 as hexToByteArray,
101
+ contains3ue2qo8xhmpf1 as contains_1,
102
+ compareTo3ankvs086tmwq as compareTo,
103
+ THROW_IAE23kobfj9wdoxr as THROW_IAE,
104
+ enumEntries20mr21zbe3az4 as enumEntries,
105
+ } from '../kotlin-kotlin-stdlib.mjs';
106
+ import {
107
+ SerializerFactory1qv9hivitncuv as SerializerFactory,
108
+ STRING_getInstance3lkmlozu5h7cs as STRING_getInstance,
109
+ PrimitiveSerialDescriptor3egfp53lutxj2 as PrimitiveSerialDescriptor,
110
+ KSerializerzf77vz1967fq as KSerializer,
111
+ SerializableWithd2dap36updxd as SerializableWith,
112
+ SealedClassSerializeriwipiibk55zc as SealedClassSerializer,
113
+ PluginGeneratedSerialDescriptorqdzeg5asqhfg as PluginGeneratedSerialDescriptor,
114
+ UnknownFieldExceptiona60e3a6v1xqo as UnknownFieldException,
115
+ StringSerializer_getInstance11v9md0a7d9yk as StringSerializer_getInstance,
116
+ typeParametersSerializers2likxjr48tr7y as typeParametersSerializers,
117
+ GeneratedSerializer1f7t7hssdd2ws as GeneratedSerializer,
118
+ throwMissingFieldException2cmke0v3ynf14 as throwMissingFieldException,
119
+ createSimpleEnumSerializer2guioz11kk1m0 as createSimpleEnumSerializer,
120
+ SerializersModuleBuilderfxsfdohcdipc as SerializersModuleBuilder,
121
+ PolymorphicSerializer3p3fzpdobi8hh as PolymorphicSerializer,
122
+ } from '../kotlinx-serialization-kotlinx-serialization-core.mjs';
123
+ import {
124
+ get_long3gjrkvy7fxjbp as get_long,
125
+ get_float1xtaobzj8js8m as get_float,
126
+ get_double1785hcxaminy4 as get_double,
127
+ get_boolean37ml8jnzy6rg3 as get_boolean,
128
+ JsonObjectee06ihoeeiqj as JsonObject,
129
+ JsonArray2urf8ey7u44sd as JsonArray,
130
+ JsonPrimitive3ttzjh2ft5dnx as JsonPrimitive,
131
+ get_jsonPrimitivez17tyd5rw1ql as get_jsonPrimitive,
132
+ get_jsonArray18sglwhl4pclz as get_jsonArray,
133
+ get_jsonObject2u4z2ch1uuca9 as get_jsonObject,
134
+ JsonNull_getInstancehlive1cpt4pr as JsonNull_getInstance,
135
+ JsonNull2liwjj96vm0w2 as JsonNull,
136
+ JsonPrimitive1xkjzc5d7ihuv as JsonPrimitive_0,
137
+ JsonPrimitiveolttw629wj53 as JsonPrimitive_1,
138
+ JsonPrimitive2fp8648nd60dn as JsonPrimitive_2,
139
+ JsonElementSerializer_getInstance78doow9tocv6 as JsonElementSerializer_getInstance,
140
+ JsonPrimitive2bieimc5ppopv as JsonPrimitive_3,
141
+ Jsonsmkyu9xjl7fv as Json,
142
+ } from '../kotlinx-serialization-kotlinx-serialization-json.mjs';
143
+ import {
144
+ decodeFrom1073q8kh3s8td as decodeFrom,
145
+ Encoding_BASE64URL_getInstance3007plr09ildu as Encoding_BASE64URL_getInstance,
146
+ stringify34zhnmfghbpa3 as stringify,
147
+ encodeTor9bkrvfg8b4d as encodeTo,
148
+ Encoding_BASE64_getInstance1xh6pw2c537bw as Encoding_BASE64_getInstance,
149
+ Companion_instance5oxdm74ajkut as Companion_instance,
150
+ Companion_getInstance30e4zwksmxd8c as Companion_getInstance,
151
+ toKotlin2s7lqlzr80lb7 as toKotlin,
152
+ decodeFromHex2g869l1sb6kd2 as decodeFromHex,
153
+ appendUInt8re067py6h8wc as appendUInt8,
154
+ appendUInt641vfseodaf624a as appendUInt64,
155
+ appendUInt321o2oja5gonu7g as appendUInt32,
156
+ appendUInt161gvzy2qtzy6su as appendUInt16,
157
+ Messagewe9y1c82z9xg as Message,
158
+ IdkError2sgfqzhbgqgzo as IdkError,
159
+ Severity_ERROR_getInstance9py2fxzng5v1 as Severity_ERROR_getInstance,
160
+ Encoding_HEX_getInstance3cjbki6wjz0rh as Encoding_HEX_getInstance,
161
+ decodeFromBase64Url3ffgzyiduv5ck as decodeFromBase64Url,
162
+ decodeFromBase6490f19dqrq6mr as decodeFromBase64,
163
+ Encoding_UTF8_getInstance79x1u1osdb4y as Encoding_UTF8_getInstance,
164
+ } from './idk-lib-core-api-public.mjs';
165
+ import { toInstant2ixtmlbww6j32 as toInstant } from '../Kotlin-DateTime-library-kotlinx-datetime.mjs';
166
+ import { ByteStringBuilder1h7wixkupnryt as ByteStringBuilder } from '../kotlinx-io-kotlinx-io-bytestring.mjs';
167
+ //region block: imports
168
+ var imul = Math.imul;
169
+ //endregion
170
+ //region block: pre-declaration
171
+ class HasCborJsonRepresentation {}
172
+ function toJson(includeCDDL, $super) {
173
+ includeCDDL = includeCDDL === VOID ? false : includeCDDL;
174
+ return $super === VOID ? this.y2y(includeCDDL) : $super.y2y.call(this, includeCDDL);
175
+ }
176
+ class CborBaseItem {
177
+ constructor(cddl) {
178
+ return new.target.j36(cddl);
179
+ }
180
+ static j36(cddl) {
181
+ Companion_getInstance_2();
182
+ var $this = createThis(this);
183
+ $this.cddl = cddl;
184
+ return $this;
185
+ }
186
+ d2z() {
187
+ return this.cddl;
188
+ }
189
+ static k36(seen0, cddl, serializationConstructorMarker) {
190
+ Companion_getInstance_2();
191
+ var $this = createThis(this);
192
+ $this.cddl = cddl;
193
+ return $this;
194
+ }
195
+ }
196
+ class CborItem extends CborBaseItem {
197
+ constructor(value, cddl) {
198
+ return new.target.z35(value, cddl);
199
+ }
200
+ static z35(value, cddl) {
201
+ var $this = this.j36(cddl);
202
+ $this.value = value;
203
+ $this.n2y_1 = toCharArray('0123456789abcdef');
204
+ $this.o2y_1 = cddl.majorType;
205
+ $this.info = cddl.info;
206
+ $this.c2z();
207
+ return $this;
208
+ }
209
+ h4() {
210
+ return this.value;
211
+ }
212
+ p2y() {
213
+ return this.n2y_1;
214
+ }
215
+ encodeCbor() {
216
+ var builder = new ByteStringBuilder();
217
+ this.q2y(builder);
218
+ return builder.y2k().u2k();
219
+ }
220
+ r2y() {
221
+ return this.o2y_1;
222
+ }
223
+ s2y() {
224
+ return this.info;
225
+ }
226
+ t2y() {
227
+ // Inline function 'kotlin.require' call
228
+ // Inline function 'kotlin.require' call
229
+ if (!(this instanceof CborString)) {
230
+ var message = 'Failed requirement.';
231
+ throw IllegalArgumentException.y1(toString_0(message));
232
+ }
233
+ return this.value;
234
+ }
235
+ u2y() {
236
+ // Inline function 'kotlin.require' call
237
+ // Inline function 'kotlin.require' call
238
+ if (!(this instanceof CborBool)) {
239
+ var message = 'Failed requirement.';
240
+ throw IllegalArgumentException.y1(toString_0(message));
241
+ }
242
+ return this.value;
243
+ }
244
+ v2y() {
245
+ // Inline function 'kotlin.require' call
246
+ // Inline function 'kotlin.require' call
247
+ if (!(this instanceof CborByteString)) {
248
+ var message = 'Failed requirement.';
249
+ throw IllegalArgumentException.y1(toString_0(message));
250
+ }
251
+ return this.value;
252
+ }
253
+ toBstr() {
254
+ var builder = new ByteStringBuilder();
255
+ this.q2y(builder);
256
+ return toCborByteString(builder.y2k().u2k());
257
+ }
258
+ w2y() {
259
+ var tmp;
260
+ if (this instanceof CborNInt) {
261
+ tmp = negate(this.value);
262
+ } else {
263
+ if (this instanceof CborUInt) {
264
+ tmp = this.value;
265
+ } else {
266
+ throw IllegalArgumentException.y1('Value ' + toString(this.value) + ' (' + toString_0(this.cddl) + ') is not long');
267
+ }
268
+ }
269
+ return tmp;
270
+ }
271
+ x2y() {
272
+ var tmp;
273
+ if (this instanceof CborNInt) {
274
+ var tmp_0;
275
+ if (this.value > 2147483647n) {
276
+ throw IllegalArgumentException.y1('Unsigned value does not fit in Int field');
277
+ } else {
278
+ tmp_0 = -convertToInt(this.value) | 0;
279
+ }
280
+ tmp = tmp_0;
281
+ } else {
282
+ if (this instanceof CborUInt) {
283
+ var tmp_1;
284
+ if (this.value > 2147483647n) {
285
+ throw IllegalArgumentException.y1('Unsigned value does not fit in Int field');
286
+ } else {
287
+ tmp_1 = convertToInt(this.value);
288
+ }
289
+ tmp = tmp_1;
290
+ } else {
291
+ throw IllegalArgumentException.y1('Value ' + toString(this.value) + ' (' + toString_0(this.cddl) + ') is not int');
292
+ }
293
+ }
294
+ return tmp;
295
+ }
296
+ toValue() {
297
+ return this.value;
298
+ }
299
+ toJsonSimple() {
300
+ throw IllegalArgumentException.y1('Because of boxing this method must be implemented in subclasses');
301
+ }
302
+ y2y(includeCDDL) {
303
+ return includeCDDL ? this.toJsonWithCDDL() : this.toJsonSimple();
304
+ }
305
+ toJsonWithCDDL() {
306
+ var cddl = JsonPrimitive_1(this.cddl.format);
307
+ return new JsonObject(mapOf([new Pair(CborConst_getInstance().z34_1, cddl), new Pair(CborConst_getInstance().b35_1, this.toJsonSimple())]));
308
+ }
309
+ toJsonCborItem() {
310
+ return new CborItem$toJsonCborItem$1(this);
311
+ }
312
+ z2y() {
313
+ // Inline function 'kotlin.require' call
314
+ // Inline function 'kotlin.require' call
315
+ if (!(this instanceof CborMap)) {
316
+ var message = 'Failed requirement.';
317
+ throw IllegalArgumentException.y1(toString_0(message));
318
+ }
319
+ var tmp = this.value;
320
+ return isInterface(tmp, KtMutableMap) ? tmp : THROW_CCE();
321
+ }
322
+ a2z() {
323
+ // Inline function 'kotlin.require' call
324
+ // Inline function 'kotlin.require' call
325
+ if (!(this instanceof CborArray)) {
326
+ var message = 'Failed requirement.';
327
+ throw IllegalArgumentException.y1(toString_0(message));
328
+ }
329
+ var tmp = this.value;
330
+ return isInterface(tmp, KtMutableList) ? tmp : THROW_CCE();
331
+ }
332
+ b2z() {
333
+ // Inline function 'kotlin.require' call
334
+ // Inline function 'kotlin.require' call
335
+ if (!(this instanceof CborTagged)) {
336
+ var message = 'Failed requirement.';
337
+ throw IllegalArgumentException.y1(toString_0(message));
338
+ }
339
+ return this.taggedItem;
340
+ }
341
+ c2z() {
342
+ }
343
+ toString() {
344
+ return 'CborItem(' + CborConst_getInstance().b35_1 + '=' + toString(this.value) + ', ' + CborConst_getInstance().z34_1 + '=' + toString_0(this.cddl) + ')';
345
+ }
346
+ equals(other) {
347
+ if (this === other)
348
+ return true;
349
+ if (!(other instanceof CborItem))
350
+ return false;
351
+ if (!equals(this.value, other.value))
352
+ return false;
353
+ if (!equals(this.majorType, other.majorType))
354
+ return false;
355
+ if (!(this.info == other.info))
356
+ return false;
357
+ return true;
358
+ }
359
+ hashCode() {
360
+ var tmp0_safe_receiver = this.value;
361
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : hashCode(tmp0_safe_receiver);
362
+ var result = tmp1_elvis_lhs == null ? 0 : tmp1_elvis_lhs;
363
+ var tmp = imul(31, result);
364
+ var tmp2_safe_receiver = this.majorType;
365
+ var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.hashCode();
366
+ result = tmp + (tmp3_elvis_lhs == null ? 0 : tmp3_elvis_lhs) | 0;
367
+ var tmp_0 = imul(31, result);
368
+ var tmp4_elvis_lhs = this.info;
369
+ result = tmp_0 + (tmp4_elvis_lhs == null ? 0 : tmp4_elvis_lhs) | 0;
370
+ return result;
371
+ }
372
+ get majorType() {
373
+ return this.r2y();
374
+ }
375
+ get asStr() {
376
+ return this.t2y();
377
+ }
378
+ get asBool() {
379
+ return this.u2y();
380
+ }
381
+ get asBstr() {
382
+ return this.v2y();
383
+ }
384
+ get asLong() {
385
+ return this.w2y();
386
+ }
387
+ get asInt() {
388
+ return this.x2y();
389
+ }
390
+ get asMap() {
391
+ return this.z2y();
392
+ }
393
+ get asList() {
394
+ return this.a2z();
395
+ }
396
+ get asTaggedSubject() {
397
+ return this.b2z();
398
+ }
399
+ }
400
+ class CborNumber extends CborItem {
401
+ static m2y(value, cddl) {
402
+ return this.z35(value, cddl);
403
+ }
404
+ toJsonSimple() {
405
+ return JsonPrimitive_2(this.toValue());
406
+ }
407
+ }
408
+ class AbstractCborInt extends CborNumber {
409
+ constructor(value, cddl) {
410
+ return new.target.j2y(value, cddl);
411
+ }
412
+ static j2y(value, cddl) {
413
+ return this.m2y(value, cddl);
414
+ }
415
+ }
416
+ class CborInt extends AbstractCborInt {
417
+ constructor(value) {
418
+ return new.target.g2z(value);
419
+ }
420
+ static g2z(value) {
421
+ return this.j2y(abs(value), value >= 0n ? uint_getInstance() : nint_getInstance());
422
+ }
423
+ q2y(builder) {
424
+ if (equals(this.cddl, uint_getInstance())) {
425
+ CborUInt.m2z(this.value).q2y(builder);
426
+ } else {
427
+ CborNInt.j2z(this.value).q2y(builder);
428
+ }
429
+ }
430
+ }
431
+ class Companion {
432
+ l1l() {
433
+ return CDDLSerializer_getInstance();
434
+ }
435
+ k18(typeParamsSerializers) {
436
+ return this.l1l();
437
+ }
438
+ }
439
+ class CDDLType {}
440
+ function toTag(additionalInfo, $super) {
441
+ additionalInfo = additionalInfo === VOID ? null : additionalInfo;
442
+ return $super === VOID ? this.p2z(additionalInfo) : $super.p2z.call(this, additionalInfo);
443
+ }
444
+ function newCborItemFromJson(value, cddl, $super) {
445
+ cddl = cddl === VOID ? any_getInstance() : cddl;
446
+ return $super === VOID ? this.q2z(value, cddl) : $super.q2z.call(this, value, cddl);
447
+ }
448
+ class CDDL {
449
+ constructor(format, majorType, info, aliasFor) {
450
+ majorType = majorType === VOID ? null : majorType;
451
+ info = info === VOID ? null : info;
452
+ var tmp;
453
+ if (aliasFor === VOID) {
454
+ // Inline function 'kotlin.arrayOf' call
455
+ // Inline function 'kotlin.js.unsafeCast' call
456
+ // Inline function 'kotlin.js.asDynamic' call
457
+ tmp = [];
458
+ } else {
459
+ tmp = aliasFor;
460
+ }
461
+ aliasFor = tmp;
462
+ this.u2z_1 = format;
463
+ this.v2z_1 = majorType;
464
+ this.w2z_1 = info;
465
+ this.x2z_1 = aliasFor;
466
+ }
467
+ n2z() {
468
+ return this.u2z_1;
469
+ }
470
+ r2y() {
471
+ return this.v2z_1;
472
+ }
473
+ s2y() {
474
+ return this.w2z_1;
475
+ }
476
+ o2z() {
477
+ return this.x2z_1;
478
+ }
479
+ q2z(element, cddl) {
480
+ var tmp0_safe_receiver = element instanceof JsonPrimitive ? element : null;
481
+ var jsonPrimitive = tmp0_safe_receiver == null ? null : get_jsonPrimitive(tmp0_safe_receiver);
482
+ var tmp1_safe_receiver = element instanceof JsonArray ? element : null;
483
+ var jsonArray = tmp1_safe_receiver == null ? null : get_jsonArray(tmp1_safe_receiver);
484
+ var tmp2_safe_receiver = element instanceof JsonObject ? element : null;
485
+ var jsonObject = tmp2_safe_receiver == null ? null : get_jsonObject(tmp2_safe_receiver);
486
+ var isNull = equals(element, JsonNull_getInstance()) || element === null;
487
+ var isString = (jsonPrimitive == null ? null : jsonPrimitive.d1l()) === true;
488
+ if (isNull) {
489
+ return CborNull.v35();
490
+ } else if (isString && !(jsonPrimitive === null)) {
491
+ return CborString.t2z(jsonPrimitive.e1l());
492
+ } else if (!(jsonArray === null)) {
493
+ return list_getInstance().fromJson(jsonArray);
494
+ } else if (!(jsonObject === null)) {
495
+ if (Companion_instance_6.d35(jsonObject)) {
496
+ var tmp;
497
+ if (Companion_instance_6.w35(jsonObject)) {
498
+ var tmp_0 = jsonObject.uh('key');
499
+ var tmp4_safe_receiver = tmp_0 instanceof JsonPrimitive ? tmp_0 : null;
500
+ tmp = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.e1l();
501
+ } else {
502
+ tmp = null;
503
+ }
504
+ var key = tmp;
505
+ var tmp_1 = jsonObject.uh('cddl');
506
+ var tmp5_safe_receiver = tmp_1 instanceof JsonPrimitive ? tmp_1 : null;
507
+ var cddlStr = tmp5_safe_receiver == null ? null : tmp5_safe_receiver.e1l();
508
+ if (cddlStr === null) {
509
+ return CborNull.v35();
510
+ }
511
+ var cddlObject = util_getInstance().fromFormat(cddlStr);
512
+ // Inline function 'kotlin.collections.find' call
513
+ var tmp0 = jsonObject.m4();
514
+ var tmp$ret$1;
515
+ $l$block: {
516
+ // Inline function 'kotlin.collections.firstOrNull' call
517
+ var _iterator__ex2g4s = tmp0.j1();
518
+ while (_iterator__ex2g4s.k1()) {
519
+ var element_0 = _iterator__ex2g4s.l1();
520
+ if (!(element_0 === CborConst_getInstance().z34_1) && !(element_0 === CborConst_getInstance().a35_1)) {
521
+ tmp$ret$1 = element_0;
522
+ break $l$block;
523
+ }
524
+ }
525
+ tmp$ret$1 = null;
526
+ }
527
+ // Inline function 'kotlin.collections.get' call
528
+ var key_0 = tmp$ret$1;
529
+ var tmp$ret$3 = (isInterface(jsonObject, KtMap) ? jsonObject : THROW_CCE()).l4(key_0);
530
+ var cborObject = this.newCborItemFromJson(tmp$ret$3, cddlObject);
531
+ if (key === null) {
532
+ return cborObject;
533
+ }
534
+ return CborMap.q34(mutableMapOf([new Pair(CborString.t2z(key), cborObject)]));
535
+ }
536
+ // Inline function 'kotlin.collections.map' call
537
+ // Inline function 'kotlin.collections.mapTo' call
538
+ var destination = ArrayList.j2(jsonObject.m2());
539
+ // Inline function 'kotlin.collections.iterator' call
540
+ var _iterator__ex2g4s_0 = jsonObject.x2().j1();
541
+ while (_iterator__ex2g4s_0.k1()) {
542
+ var item = _iterator__ex2g4s_0.l1();
543
+ var tmp$ret$7 = new Pair(CborString.t2z(item.g4()), this.newCborItemFromJson(item.h4()));
544
+ destination.k2(tmp$ret$7);
545
+ }
546
+ // Inline function 'kotlin.collections.toTypedArray' call
547
+ var tmp$ret$8 = copyToArray(destination);
548
+ return CborMap.q34(mutableMapOf(tmp$ret$8.slice()));
549
+ } else if (!(jsonPrimitive === null)) {
550
+ if (cddl == null) {
551
+ return this.newCborItem(jsonPrimitive);
552
+ }
553
+ return equals(cddl, tstr_getInstance()) ? tstr_getInstance().fromJson(jsonPrimitive) : equals(cddl, Null_getInstance()) ? CborNull.v35() : equals(cddl, False_getInstance()) ? Companion_getInstance_7().m33_1 : equals(cddl, True_getInstance()) ? Companion_getInstance_7().n33_1 : equals(cddl, bool_getInstance()) ? bool_getInstance().fromJson(jsonPrimitive) : equals(cddl, bstr_getInstance()) ? bstr_getInstance().fromJson(jsonPrimitive) : equals(cddl, bytes_getInstance()) ? bytes_getInstance().fromJson(jsonPrimitive) : equals(cddl, float_getInstance()) ? float_getInstance().fromJson(jsonPrimitive) : equals(cddl, float16_getInstance()) ? float16_getInstance().fromJson(jsonPrimitive) : equals(cddl, float32_getInstance()) ? float32_getInstance().fromJson(jsonPrimitive) : equals(cddl, float64_getInstance()) ? float64_getInstance().fromJson(jsonPrimitive) : equals(cddl, full_date_getInstance()) ? full_date_getInstance().fromJson(jsonPrimitive) : equals(cddl, int_getInstance()) ? int_getInstance().fromJson(jsonPrimitive) : equals(cddl, nil_getInstance()) ? nil_getInstance().newNil() : equals(cddl, nint_getInstance()) ? nint_getInstance().fromJson(jsonPrimitive) : equals(cddl, tdate_getInstance()) ? tdate_getInstance().fromJson(jsonPrimitive) : equals(cddl, text_getInstance()) ? text_getInstance().fromJson(jsonPrimitive) : equals(cddl, time_getInstance()) ? time_getInstance().fromJson(jsonPrimitive) : equals(cddl, uint_getInstance()) ? uint_getInstance().fromJson(jsonPrimitive) : equals(cddl, undefined_getInstance()) ? undefined_getInstance().newUndefined() : cddl.newCborItem(jsonPrimitive);
554
+ }
555
+ return this.newCborItem(element);
556
+ }
557
+ newCborItem(origValue) {
558
+ var value = origValue;
559
+ var tmp;
560
+ if (value instanceof JsonPrimitive) {
561
+ tmp = value;
562
+ } else {
563
+ if (value instanceof JsonArray) {
564
+ tmp = value;
565
+ } else {
566
+ if (value instanceof JsonObject) {
567
+ tmp = value;
568
+ } else {
569
+ if (value instanceof JsonNull) {
570
+ tmp = value;
571
+ } else {
572
+ tmp = null;
573
+ }
574
+ }
575
+ }
576
+ }
577
+ var jsonElement = tmp;
578
+ if (value == null) {
579
+ return nil_getInstance().newNil();
580
+ } else if (equals(value, Unit_instance)) {
581
+ return undefined_getInstance().newUndefined();
582
+ }
583
+ var tmp_0;
584
+ if (this.equals(tstr_getInstance())) {
585
+ tmp_0 = jsonElement === null ? tstr_getInstance().newString(toString_0(value)) : tstr_getInstance().fromJson(get_jsonPrimitive(jsonElement));
586
+ } else if (this.equals(False_getInstance())) {
587
+ tmp_0 = False_getInstance().newFalse();
588
+ } else if (this.equals(Null_getInstance())) {
589
+ tmp_0 = Null_getInstance().newNull();
590
+ } else if (this.equals(True_getInstance())) {
591
+ tmp_0 = True_getInstance().newTrue();
592
+ } else if (this.equals(any_getInstance())) {
593
+ var tmp_1;
594
+ if (value instanceof JsonPrimitive) {
595
+ var prim = value;
596
+ tmp_1 = prim.d1l() ? tstr_getInstance().fromJson(prim) : prim.e1l() === 'true' || prim.e1l() === 'false' ? bool_getInstance().fromJson(prim) : contains(prim.e1l(), _Char___init__impl__6a9atx(46)) || contains(prim.e1l(), _Char___init__impl__6a9atx(101)) || contains(prim.e1l(), _Char___init__impl__6a9atx(69)) ? float64_getInstance().fromJson(prim) : int_getInstance().fromJson(prim);
597
+ } else {
598
+ if (!(value == null) ? typeof value === 'string' : false) {
599
+ tmp_1 = jsonElement === null ? tstr_getInstance().newString(value) : tstr_getInstance().fromJson(get_jsonPrimitive(jsonElement));
600
+ } else {
601
+ if (!(value == null) ? isByteArray(value) : false) {
602
+ tmp_1 = jsonElement === null ? bstr_getInstance().newByteString(value) : bstr_getInstance().fromJson(get_jsonPrimitive(jsonElement));
603
+ } else {
604
+ if (!(value == null) ? typeof value === 'string' : false) {
605
+ tmp_1 = jsonElement === null ? tdate_getInstance().newTDate(value) : tdate_getInstance().fromJson(get_jsonPrimitive(jsonElement));
606
+ } else {
607
+ if (!(value == null) ? typeof value === 'string' : false) {
608
+ tmp_1 = jsonElement === null ? full_date_getInstance().newFullDate(value) : full_date_getInstance().fromJson(get_jsonPrimitive(jsonElement));
609
+ } else {
610
+ if (!(value == null) ? typeof value === 'boolean' : false) {
611
+ tmp_1 = jsonElement === null ? bool_getInstance().newBool(value) : bool_getInstance().fromJson(get_jsonPrimitive(jsonElement));
612
+ } else {
613
+ if (isNumber(value)) {
614
+ var tmp_2;
615
+ if (jsonElement === null) {
616
+ tmp_2 = toCborItem(value);
617
+ } else {
618
+ var d = numberToDouble(value);
619
+ var tmp_3;
620
+ var tmp_4;
621
+ var tmp_5;
622
+ // Inline function 'kotlin.math.floor' call
623
+ if (!(d === Math.floor(d))) {
624
+ tmp_5 = true;
625
+ } else {
626
+ tmp_5 = isInfinite(d);
627
+ }
628
+ if (tmp_5) {
629
+ tmp_4 = true;
630
+ } else {
631
+ tmp_4 = isNaN_0(d);
632
+ }
633
+ if (tmp_4) {
634
+ tmp_3 = float64_getInstance().fromJson(get_jsonPrimitive(jsonElement));
635
+ } else {
636
+ tmp_3 = int_getInstance().fromJson(get_jsonPrimitive(jsonElement));
637
+ }
638
+ tmp_2 = tmp_3;
639
+ }
640
+ tmp_1 = tmp_2;
641
+ } else {
642
+ if (!(value == null) ? isInterface(value, KtMutableList) : false) {
643
+ var tmp_6;
644
+ if (jsonElement === null) {
645
+ var tmp_7 = list_getInstance();
646
+ // Inline function 'kotlin.collections.map' call
647
+ // Inline function 'kotlin.collections.mapTo' call
648
+ var destination = ArrayList.j2(collectionSizeOrDefault(value, 10));
649
+ var _iterator__ex2g4s = value.j1();
650
+ while (_iterator__ex2g4s.k1()) {
651
+ var item = _iterator__ex2g4s.l1();
652
+ var tmp_8;
653
+ if (item instanceof CborItem) {
654
+ tmp_8 = item;
655
+ } else {
656
+ tmp_8 = any_getInstance().newCborItem(item);
657
+ }
658
+ var tmp$ret$3 = tmp_8;
659
+ destination.k2(tmp$ret$3);
660
+ }
661
+ tmp_6 = tmp_7.newList(toMutableList(destination));
662
+ } else {
663
+ tmp_6 = list_getInstance().fromJson(get_jsonArray(jsonElement));
664
+ }
665
+ tmp_1 = tmp_6;
666
+ } else {
667
+ if (!(value == null) ? isInterface(value, KtMutableMap) : false) {
668
+ var tmp_9;
669
+ if (jsonElement === null) {
670
+ var tmp_10 = map_getInstance();
671
+ // Inline function 'kotlin.collections.map' call
672
+ // Inline function 'kotlin.collections.mapTo' call
673
+ var destination_0 = ArrayList.j2(value.m2());
674
+ // Inline function 'kotlin.collections.iterator' call
675
+ var _iterator__ex2g4s_0 = value.x2().j1();
676
+ while (_iterator__ex2g4s_0.k1()) {
677
+ var item_0 = _iterator__ex2g4s_0.l1();
678
+ var tmp_11;
679
+ var tmp_12 = item_0.g4();
680
+ if (tmp_12 instanceof CborItem) {
681
+ var tmp_13 = item_0.g4();
682
+ tmp_11 = tmp_13 instanceof CborItem ? tmp_13 : THROW_CCE();
683
+ } else {
684
+ tmp_11 = any_getInstance().newCborItem(item_0.g4());
685
+ }
686
+ var tmp_14 = tmp_11;
687
+ var tmp_15;
688
+ var tmp_16 = item_0.h4();
689
+ if (tmp_16 instanceof CborItem) {
690
+ var tmp_17 = item_0.h4();
691
+ tmp_15 = tmp_17 instanceof CborItem ? tmp_17 : THROW_CCE();
692
+ } else {
693
+ tmp_15 = any_getInstance().newCborItem(item_0.h4());
694
+ }
695
+ var tmp$ret$7 = new Pair(tmp_14, tmp_15);
696
+ destination_0.k2(tmp$ret$7);
697
+ }
698
+ // Inline function 'kotlin.collections.toTypedArray' call
699
+ var tmp$ret$8 = copyToArray(destination_0);
700
+ tmp_9 = tmp_10.newMap(mutableMapOf(tmp$ret$8.slice()));
701
+ } else {
702
+ tmp_9 = map_getInstance().fromJson(get_jsonObject(jsonElement));
703
+ }
704
+ tmp_1 = tmp_9;
705
+ } else {
706
+ throw IllegalArgumentException.y1('newCborItem for ' + toString(value) + ' Not implemented yet');
707
+ }
708
+ }
709
+ }
710
+ }
711
+ }
712
+ }
713
+ }
714
+ }
715
+ }
716
+ return tmp_1;
717
+ } else if (this.equals(bool_getInstance())) {
718
+ tmp_0 = jsonElement === null ? bool_getInstance().newBool(equals(value, true)) : bool_getInstance().fromJson(get_jsonPrimitive(jsonElement));
719
+ } else if (this.equals(bstr_getInstance())) {
720
+ var tmp_18;
721
+ if (jsonElement === null) {
722
+ var tmp_19 = bstr_getInstance();
723
+ tmp_18 = tmp_19.newByteString((!(value == null) ? isByteArray(value) : false) ? value : THROW_CCE());
724
+ } else {
725
+ tmp_18 = bstr_getInstance().fromJson(get_jsonPrimitive(jsonElement));
726
+ }
727
+ tmp_0 = tmp_18;
728
+ } else if (this.equals(bstr_indef_length_getInstance())) {
729
+ var tmp_20;
730
+ if (jsonElement === null) {
731
+ var tmp_21 = bstr_indef_length_getInstance();
732
+ tmp_20 = tmp_21.newByteString((!(value == null) ? isInterface(value, KtList) : false) ? value : THROW_CCE());
733
+ } else {
734
+ // Inline function 'kotlin.TODO' call
735
+ var reason = 'indef cddl from json not implemented yet';
736
+ throw NotImplementedError.jd('An operation is not implemented: ' + reason);
737
+ }
738
+ tmp_0 = tmp_20;
739
+ } else if (this.equals(bytes_getInstance())) {
740
+ var tmp_22;
741
+ if (jsonElement === null) {
742
+ var tmp_23 = bytes_getInstance();
743
+ tmp_22 = tmp_23.newBytes((!(value == null) ? isByteArray(value) : false) ? value : THROW_CCE());
744
+ } else {
745
+ tmp_22 = bytes_getInstance().fromJson(get_jsonPrimitive(jsonElement));
746
+ }
747
+ tmp_0 = tmp_22;
748
+ } else if (this.equals(float_getInstance())) {
749
+ var tmp_24;
750
+ if (jsonElement === null) {
751
+ var tmp_25 = float_getInstance();
752
+ tmp_24 = tmp_25.newFloat((!(value == null) ? typeof value === 'number' : false) ? value : THROW_CCE());
753
+ } else {
754
+ tmp_24 = float_getInstance().fromJson(get_jsonPrimitive(jsonElement));
755
+ }
756
+ tmp_0 = tmp_24;
757
+ } else if (this.equals(float16_getInstance())) {
758
+ var tmp_26;
759
+ if (jsonElement === null) {
760
+ var tmp_27 = float16_getInstance();
761
+ tmp_26 = tmp_27.newFloat16((!(value == null) ? typeof value === 'number' : false) ? value : THROW_CCE());
762
+ } else {
763
+ tmp_26 = float16_getInstance().fromJson(get_jsonPrimitive(jsonElement));
764
+ }
765
+ tmp_0 = tmp_26;
766
+ } else if (this.equals(float32_getInstance())) {
767
+ var tmp_28;
768
+ if (jsonElement === null) {
769
+ var tmp_29 = float32_getInstance();
770
+ tmp_28 = tmp_29.newFloat32((!(value == null) ? typeof value === 'number' : false) ? value : THROW_CCE());
771
+ } else {
772
+ tmp_28 = float32_getInstance().fromJson(get_jsonPrimitive(jsonElement));
773
+ }
774
+ tmp_0 = tmp_28;
775
+ } else if (this.equals(float64_getInstance())) {
776
+ var tmp_30;
777
+ if (jsonElement === null) {
778
+ var tmp_31 = float64_getInstance();
779
+ tmp_30 = tmp_31.newFloat64((!(value == null) ? typeof value === 'number' : false) ? value : THROW_CCE());
780
+ } else {
781
+ tmp_30 = float64_getInstance().fromJson(get_jsonPrimitive(jsonElement));
782
+ }
783
+ tmp_0 = tmp_30;
784
+ } else if (this.equals(full_date_getInstance())) {
785
+ var tmp_32;
786
+ if (jsonElement === null) {
787
+ var tmp_33 = full_date_getInstance();
788
+ tmp_32 = tmp_33.newFullDate((!(value == null) ? typeof value === 'string' : false) ? value : THROW_CCE());
789
+ } else {
790
+ tmp_32 = full_date_getInstance().fromJson(get_jsonPrimitive(jsonElement));
791
+ }
792
+ tmp_0 = tmp_32;
793
+ } else if (this.equals(int_getInstance())) {
794
+ var tmp_34;
795
+ if (jsonElement === null) {
796
+ var tmp_35 = int_getInstance();
797
+ tmp_34 = tmp_35.newInt((!(value == null) ? typeof value === 'number' : false) ? value : THROW_CCE());
798
+ } else {
799
+ tmp_34 = int_getInstance().fromJson(get_jsonPrimitive(jsonElement));
800
+ }
801
+ tmp_0 = tmp_34;
802
+ } else if (this.equals(list_getInstance())) {
803
+ var tmp_36;
804
+ if (jsonElement === null) {
805
+ var tmp_37;
806
+ if (value instanceof CborArray) {
807
+ tmp_37 = value;
808
+ } else {
809
+ var tmp_38 = list_getInstance();
810
+ // Inline function 'kotlin.collections.map' call
811
+ var this_0 = (!(value == null) ? isInterface(value, KtList) : false) ? value : THROW_CCE();
812
+ // Inline function 'kotlin.collections.mapTo' call
813
+ var destination_1 = ArrayList.j2(collectionSizeOrDefault(this_0, 10));
814
+ var _iterator__ex2g4s_1 = this_0.j1();
815
+ while (_iterator__ex2g4s_1.k1()) {
816
+ var item_1 = _iterator__ex2g4s_1.l1();
817
+ var tmp_39;
818
+ if (item_1 instanceof CborItem) {
819
+ tmp_39 = item_1;
820
+ } else {
821
+ tmp_39 = any_getInstance().newCborItem(item_1);
822
+ }
823
+ var tmp$ret$12 = tmp_39;
824
+ destination_1.k2(tmp$ret$12);
825
+ }
826
+ tmp_37 = tmp_38.newList(toMutableList(destination_1));
827
+ }
828
+ tmp_36 = tmp_37;
829
+ } else {
830
+ tmp_36 = list_getInstance().fromJson(get_jsonArray(jsonElement));
831
+ }
832
+ tmp_0 = tmp_36;
833
+ } else if (this.equals(map_getInstance())) {
834
+ var tmp_40;
835
+ if (jsonElement === null) {
836
+ var tmp_41;
837
+ if (value instanceof CborMap) {
838
+ tmp_41 = value;
839
+ } else {
840
+ var tmp_42 = map_getInstance();
841
+ // Inline function 'kotlin.collections.map' call
842
+ var this_1 = (!(value == null) ? isInterface(value, KtMap) : false) ? value : THROW_CCE();
843
+ // Inline function 'kotlin.collections.mapTo' call
844
+ var destination_2 = ArrayList.j2(this_1.m2());
845
+ // Inline function 'kotlin.collections.iterator' call
846
+ var _iterator__ex2g4s_2 = this_1.x2().j1();
847
+ while (_iterator__ex2g4s_2.k1()) {
848
+ var item_2 = _iterator__ex2g4s_2.l1();
849
+ var tmp_43;
850
+ var tmp_44 = item_2.g4();
851
+ if (tmp_44 instanceof CborItem) {
852
+ var tmp_45 = item_2.g4();
853
+ tmp_43 = tmp_45 instanceof CborItem ? tmp_45 : THROW_CCE();
854
+ } else {
855
+ tmp_43 = any_getInstance().newCborItem(item_2.g4());
856
+ }
857
+ var tmp_46 = tmp_43;
858
+ var tmp_47;
859
+ var tmp_48 = item_2.h4();
860
+ if (tmp_48 instanceof CborItem) {
861
+ var tmp_49 = item_2.h4();
862
+ tmp_47 = tmp_49 instanceof CborItem ? tmp_49 : THROW_CCE();
863
+ } else {
864
+ tmp_47 = any_getInstance().newCborItem(item_2.h4());
865
+ }
866
+ var tmp$ret$16 = new Pair(tmp_46, tmp_47);
867
+ destination_2.k2(tmp$ret$16);
868
+ }
869
+ // Inline function 'kotlin.collections.toTypedArray' call
870
+ var tmp$ret$17 = copyToArray(destination_2);
871
+ tmp_41 = tmp_42.newMap(mutableMapOf(tmp$ret$17.slice()));
872
+ }
873
+ tmp_40 = tmp_41;
874
+ } else {
875
+ return map_getInstance().fromJson(get_jsonObject(jsonElement));
876
+ }
877
+ tmp_0 = tmp_40;
878
+ } else if (this.equals(nil_getInstance())) {
879
+ tmp_0 = nil_getInstance().newNil();
880
+ } else if (this.equals(nint_getInstance())) {
881
+ var tmp_50;
882
+ if (jsonElement === null) {
883
+ var tmp_51 = nint_getInstance();
884
+ var tmp_52;
885
+ if (isNumber(value)) {
886
+ tmp_52 = numberToLong(value);
887
+ } else {
888
+ tmp_52 = (!(value == null) ? typeof value === 'bigint' : false) ? value : THROW_CCE();
889
+ }
890
+ tmp_50 = tmp_51.newNInt(tmp_52);
891
+ } else {
892
+ tmp_50 = nint_getInstance().fromJson(get_jsonPrimitive(jsonElement));
893
+ }
894
+ tmp_0 = tmp_50;
895
+ } else if (this.equals(tdate_getInstance())) {
896
+ var tmp_53;
897
+ if (jsonElement === null) {
898
+ var tmp_54 = tdate_getInstance();
899
+ tmp_53 = tmp_54.newTDate((!(value == null) ? typeof value === 'string' : false) ? value : THROW_CCE());
900
+ } else {
901
+ tmp_53 = tdate_getInstance().fromJson(get_jsonPrimitive(jsonElement));
902
+ }
903
+ tmp_0 = tmp_53;
904
+ } else if (this.equals(text_getInstance())) {
905
+ var tmp_55;
906
+ if (jsonElement === null) {
907
+ var tmp_56 = text_getInstance();
908
+ tmp_55 = tmp_56.newText((!(value == null) ? typeof value === 'string' : false) ? value : THROW_CCE());
909
+ } else {
910
+ tmp_55 = text_getInstance().fromJson(get_jsonPrimitive(jsonElement));
911
+ }
912
+ tmp_0 = tmp_55;
913
+ } else if (this.equals(time_getInstance())) {
914
+ var tmp_57;
915
+ if (jsonElement === null) {
916
+ var tmp_58 = time_getInstance();
917
+ tmp_57 = tmp_58.newTime((!(value == null) ? typeof value === 'bigint' : false) ? value : THROW_CCE());
918
+ } else {
919
+ tmp_57 = time_getInstance().fromJson(get_jsonPrimitive(jsonElement));
920
+ }
921
+ tmp_0 = tmp_57;
922
+ } else if (this.equals(tstr_indef_length_getInstance())) {
923
+ var tmp_59;
924
+ if (!(jsonElement === null)) {
925
+ var tmp_60 = tstr_indef_length_getInstance();
926
+ tmp_59 = tmp_60.newStringIndefLength((!(value == null) ? isInterface(value, KtList) : false) ? value : THROW_CCE());
927
+ } else {
928
+ // Inline function 'kotlin.TODO' call
929
+ var reason_0 = 'tstr indef length from json to cbor not implemented';
930
+ throw NotImplementedError.jd('An operation is not implemented: ' + reason_0);
931
+ }
932
+ tmp_0 = tmp_59;
933
+ } else if (this.equals(uint_getInstance())) {
934
+ var tmp_61;
935
+ if (jsonElement === null) {
936
+ var tmp_62 = uint_getInstance();
937
+ var tmp_63;
938
+ if (!(value == null) ? typeof value === 'bigint' : false) {
939
+ tmp_63 = value;
940
+ } else {
941
+ if (isNumber(value)) {
942
+ tmp_63 = numberToLong(value);
943
+ } else {
944
+ tmp_63 = (!(value == null) ? typeof value === 'bigint' : false) ? value : THROW_CCE();
945
+ }
946
+ }
947
+ tmp_61 = tmp_62.newUint(tmp_63);
948
+ } else {
949
+ tmp_61 = uint_getInstance().fromJson(get_jsonPrimitive(jsonElement));
950
+ }
951
+ tmp_0 = tmp_61;
952
+ } else if (this.equals(undefined_getInstance())) {
953
+ tmp_0 = undefined_getInstance().newUndefined();
954
+ } else {
955
+ noWhenBranchMatchedException();
956
+ }
957
+ return tmp_0;
958
+ }
959
+ p2z(additionalInfo) {
960
+ // Inline function 'kotlin.collections.isNotEmpty' call
961
+ // Inline function 'kotlin.collections.isEmpty' call
962
+ if (!(this.aliasFor.length === 0)) {
963
+ if (additionalInfo == null) {
964
+ return this.aliasFor[0].toTag(additionalInfo);
965
+ }
966
+ var tmp0 = util_getInstance().entries;
967
+ var tmp$ret$2;
968
+ $l$block: {
969
+ // Inline function 'kotlin.collections.first' call
970
+ var inductionVariable = 0;
971
+ var last = tmp0.length;
972
+ while (inductionVariable < last) {
973
+ var element = tmp0[inductionVariable];
974
+ inductionVariable = inductionVariable + 1 | 0;
975
+ if (equals(element.majorType, this.majorType) && element.info === additionalInfo) {
976
+ tmp$ret$2 = element;
977
+ break $l$block;
978
+ }
979
+ }
980
+ throw NoSuchElementException.u1('Array contains no element matching the predicate.');
981
+ }
982
+ return tmp$ret$2.toTag(additionalInfo);
983
+ }
984
+ var tag = '#';
985
+ if (!(this.majorType == null)) {
986
+ tag = tag + toString(this.majorType);
987
+ }
988
+ if (!(additionalInfo == null)) {
989
+ tag = tag + ('.' + additionalInfo);
990
+ }
991
+ return tag;
992
+ }
993
+ toString() {
994
+ return "CDDL(format='" + this.format + "', majorType=" + toString(this.majorType) + ', info=' + this.info + ', aliasFor=' + contentToString(this.aliasFor) + ')';
995
+ }
996
+ equals(other) {
997
+ if (this === other)
998
+ return true;
999
+ if (!(other instanceof CDDL))
1000
+ return false;
1001
+ if (!(this.format === other.format))
1002
+ return false;
1003
+ if (!equals(this.majorType, other.majorType))
1004
+ return false;
1005
+ if (!(this.info == other.info))
1006
+ return false;
1007
+ if (!contentEquals(this.aliasFor, other.aliasFor))
1008
+ return false;
1009
+ return true;
1010
+ }
1011
+ hashCode() {
1012
+ var result = getStringHashCode(this.format);
1013
+ var tmp = imul(31, result);
1014
+ var tmp0_safe_receiver = this.majorType;
1015
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.hashCode();
1016
+ result = tmp + (tmp1_elvis_lhs == null ? 0 : tmp1_elvis_lhs) | 0;
1017
+ var tmp_0 = imul(31, result);
1018
+ var tmp2_elvis_lhs = this.info;
1019
+ result = tmp_0 + (tmp2_elvis_lhs == null ? 0 : tmp2_elvis_lhs) | 0;
1020
+ result = imul(31, result) + contentHashCode(this.aliasFor) | 0;
1021
+ return result;
1022
+ }
1023
+ get format() {
1024
+ return this.n2z();
1025
+ }
1026
+ get majorType() {
1027
+ return this.r2y();
1028
+ }
1029
+ get info() {
1030
+ return this.s2y();
1031
+ }
1032
+ get aliasFor() {
1033
+ return this.o2z();
1034
+ }
1035
+ }
1036
+ class tstr extends CDDL {
1037
+ constructor() {
1038
+ tstr_instance = null;
1039
+ super('tstr', MajorType_UNICODE_STRING_getInstance());
1040
+ tstr_instance = this;
1041
+ }
1042
+ newString(value) {
1043
+ return CborString.t2z(value);
1044
+ }
1045
+ fromJson(value) {
1046
+ return CborString.t2z(value.e1l());
1047
+ }
1048
+ }
1049
+ class uint extends CDDL {
1050
+ constructor() {
1051
+ uint_instance = null;
1052
+ super('uint', MajorType_UNSIGNED_INTEGER_getInstance());
1053
+ uint_instance = this;
1054
+ }
1055
+ newUint(value) {
1056
+ return CborUInt.m2z(value);
1057
+ }
1058
+ fromJson(value) {
1059
+ return CborUInt.m2z(toLong(value.e1l()));
1060
+ }
1061
+ l1l() {
1062
+ return CDDLSerializer_getInstance();
1063
+ }
1064
+ k18(typeParamsSerializers) {
1065
+ return this.l1l();
1066
+ }
1067
+ }
1068
+ class nint extends CDDL {
1069
+ constructor() {
1070
+ nint_instance = null;
1071
+ super('nint', MajorType_NEGATIVE_INTEGER_getInstance());
1072
+ nint_instance = this;
1073
+ }
1074
+ newNInt(value) {
1075
+ return CborNInt.j2z(value);
1076
+ }
1077
+ fromJson(value) {
1078
+ return CborNInt.j2z(toLong(value.e1l()));
1079
+ }
1080
+ l1l() {
1081
+ return CDDLSerializer_getInstance();
1082
+ }
1083
+ k18(typeParamsSerializers) {
1084
+ return this.l1l();
1085
+ }
1086
+ }
1087
+ class int extends CDDL {
1088
+ constructor() {
1089
+ int_instance = null;
1090
+ // Inline function 'kotlin.arrayOf' call
1091
+ // Inline function 'kotlin.js.unsafeCast' call
1092
+ // Inline function 'kotlin.js.asDynamic' call
1093
+ super('int', null, null, [uint_getInstance(), nint_getInstance()]);
1094
+ int_instance = this;
1095
+ }
1096
+ newInt(value) {
1097
+ return value < 0 ? CborNInt.j2z(fromInt(value)) : CborUInt.m2z(fromInt(value));
1098
+ }
1099
+ newLong(value) {
1100
+ return value < 0n ? CborNInt.j2z(value) : CborUInt.m2z(value);
1101
+ }
1102
+ fromJson(value) {
1103
+ return get_long(value) < 0n ? CborNInt.j2z(get_long(value)) : CborUInt.m2z(get_long(value));
1104
+ }
1105
+ l1l() {
1106
+ return CDDLSerializer_getInstance();
1107
+ }
1108
+ k18(typeParamsSerializers) {
1109
+ return this.l1l();
1110
+ }
1111
+ }
1112
+ class bstr extends CDDL {
1113
+ constructor() {
1114
+ bstr_instance = null;
1115
+ super('bstr', MajorType_BYTE_STRING_getInstance());
1116
+ bstr_instance = this;
1117
+ }
1118
+ newByteString(value) {
1119
+ return CborByteString.m30(value);
1120
+ }
1121
+ r30(value, encoding) {
1122
+ return CborByteString.m30(decodeFrom(value.e1l(), encoding));
1123
+ }
1124
+ fromJson(value, encoding, $super) {
1125
+ encoding = encoding === VOID ? Encoding_BASE64URL_getInstance() : encoding;
1126
+ return $super === VOID ? this.r30(value, encoding) : $super.r30.call(this, value, encoding);
1127
+ }
1128
+ l1l() {
1129
+ return CDDLSerializer_getInstance();
1130
+ }
1131
+ k18(typeParamsSerializers) {
1132
+ return this.l1l();
1133
+ }
1134
+ }
1135
+ class bstr_indef_length extends CDDL {
1136
+ constructor() {
1137
+ bstr_indef_length_instance = null;
1138
+ super('bstr', MajorType_BYTE_STRING_getInstance());
1139
+ bstr_indef_length_instance = this;
1140
+ }
1141
+ newByteString(value) {
1142
+ return CborByteStringIndefLength.u30(value);
1143
+ }
1144
+ z30(value, encoding) {
1145
+ // Inline function 'kotlin.TODO' call
1146
+ var reason = 'indef length from json to cbor not implemented yet';
1147
+ throw NotImplementedError.jd('An operation is not implemented: ' + reason);
1148
+ }
1149
+ fromJson(value, encoding, $super) {
1150
+ encoding = encoding === VOID ? Encoding_BASE64URL_getInstance() : encoding;
1151
+ return $super === VOID ? this.z30(value, encoding) : $super.z30.call(this, value, encoding);
1152
+ }
1153
+ l1l() {
1154
+ return CDDLSerializer_getInstance();
1155
+ }
1156
+ k18(typeParamsSerializers) {
1157
+ return this.l1l();
1158
+ }
1159
+ }
1160
+ class bytes extends CDDL {
1161
+ constructor() {
1162
+ bytes_instance = null;
1163
+ var tmp = MajorType_BYTE_STRING_getInstance();
1164
+ // Inline function 'kotlin.arrayOf' call
1165
+ // Inline function 'kotlin.js.unsafeCast' call
1166
+ // Inline function 'kotlin.js.asDynamic' call
1167
+ super('bytes', tmp, VOID, [bstr_getInstance()]);
1168
+ bytes_instance = this;
1169
+ }
1170
+ newBytes(value) {
1171
+ return CborByteString.m30(value);
1172
+ }
1173
+ r30(value, encoding) {
1174
+ return CborByteString.m30(decodeFrom(value.e1l(), encoding));
1175
+ }
1176
+ fromJson(value, encoding, $super) {
1177
+ encoding = encoding === VOID ? Encoding_BASE64URL_getInstance() : encoding;
1178
+ return $super === VOID ? this.r30(value, encoding) : $super.r30.call(this, value, encoding);
1179
+ }
1180
+ l1l() {
1181
+ return CDDLSerializer_getInstance();
1182
+ }
1183
+ k18(typeParamsSerializers) {
1184
+ return this.l1l();
1185
+ }
1186
+ }
1187
+ class tstr_indef_length extends CDDL {
1188
+ constructor() {
1189
+ tstr_indef_length_instance = null;
1190
+ super('tstr', MajorType_UNICODE_STRING_getInstance());
1191
+ tstr_indef_length_instance = this;
1192
+ }
1193
+ newStringIndefLength(value) {
1194
+ return CborStringIndefLength.g31(value);
1195
+ }
1196
+ z30(value, encoding) {
1197
+ // Inline function 'kotlin.TODO' call
1198
+ var reason = 'indef length from json to cbor not implemented yet';
1199
+ throw NotImplementedError.jd('An operation is not implemented: ' + reason);
1200
+ }
1201
+ fromJson(value, encoding, $super) {
1202
+ encoding = encoding === VOID ? Encoding_BASE64URL_getInstance() : encoding;
1203
+ return $super === VOID ? this.z30(value, encoding) : $super.z30.call(this, value, encoding);
1204
+ }
1205
+ l1l() {
1206
+ return CDDLSerializer_getInstance();
1207
+ }
1208
+ k18(typeParamsSerializers) {
1209
+ return this.l1l();
1210
+ }
1211
+ }
1212
+ class text extends CDDL {
1213
+ constructor() {
1214
+ text_instance = null;
1215
+ var tmp = MajorType_UNICODE_STRING_getInstance();
1216
+ // Inline function 'kotlin.arrayOf' call
1217
+ // Inline function 'kotlin.js.unsafeCast' call
1218
+ // Inline function 'kotlin.js.asDynamic' call
1219
+ super('text', tmp, VOID, [tstr_getInstance()]);
1220
+ text_instance = this;
1221
+ }
1222
+ newText(value) {
1223
+ return CborString.t2z(value);
1224
+ }
1225
+ fromJson(value) {
1226
+ return CborString.t2z(value.e1l());
1227
+ }
1228
+ l1l() {
1229
+ return CDDLSerializer_getInstance();
1230
+ }
1231
+ k18(typeParamsSerializers) {
1232
+ return this.l1l();
1233
+ }
1234
+ }
1235
+ class tdate extends CDDL {
1236
+ constructor() {
1237
+ tdate_instance = null;
1238
+ super('tdate', MajorType_TAG_getInstance(), 0);
1239
+ tdate_instance = this;
1240
+ }
1241
+ newTDate(value) {
1242
+ return CborTDate.s31(value);
1243
+ }
1244
+ fromJson(value) {
1245
+ return CborTDate.s31(value.e1l());
1246
+ }
1247
+ l1l() {
1248
+ return CDDLSerializer_getInstance();
1249
+ }
1250
+ k18(typeParamsSerializers) {
1251
+ return this.l1l();
1252
+ }
1253
+ }
1254
+ class full_date extends CDDL {
1255
+ constructor() {
1256
+ full_date_instance = null;
1257
+ super('full-date', MajorType_TAG_getInstance(), 1004);
1258
+ full_date_instance = this;
1259
+ }
1260
+ newFullDate(value) {
1261
+ return CborFullDate.a32(value);
1262
+ }
1263
+ fromJson(value) {
1264
+ return CborFullDate.a32(value.e1l());
1265
+ }
1266
+ l1l() {
1267
+ return CDDLSerializer_getInstance();
1268
+ }
1269
+ k18(typeParamsSerializers) {
1270
+ return this.l1l();
1271
+ }
1272
+ }
1273
+ class time extends CDDL {
1274
+ constructor() {
1275
+ time_instance = null;
1276
+ super('time', MajorType_TAG_getInstance(), 1);
1277
+ time_instance = this;
1278
+ }
1279
+ newTime(value) {
1280
+ return CborTime.i32(value);
1281
+ }
1282
+ fromJson(value) {
1283
+ return CborTime.i32(toLong(value.e1l()));
1284
+ }
1285
+ l1l() {
1286
+ return CDDLSerializer_getInstance();
1287
+ }
1288
+ k18(typeParamsSerializers) {
1289
+ return this.l1l();
1290
+ }
1291
+ }
1292
+ class float16 extends CDDL {
1293
+ constructor() {
1294
+ float16_instance = null;
1295
+ super('float16', MajorType_SPECIAL_getInstance(), 25);
1296
+ float16_instance = this;
1297
+ }
1298
+ newFloat16(value) {
1299
+ return CborFloat16.p32(value);
1300
+ }
1301
+ fromJson(value) {
1302
+ return CborFloat16.p32(get_float(value));
1303
+ }
1304
+ l1l() {
1305
+ return CDDLSerializer_getInstance();
1306
+ }
1307
+ k18(typeParamsSerializers) {
1308
+ return this.l1l();
1309
+ }
1310
+ }
1311
+ class float32 extends CDDL {
1312
+ constructor() {
1313
+ float32_instance = null;
1314
+ super('float32', MajorType_SPECIAL_getInstance(), 26);
1315
+ float32_instance = this;
1316
+ }
1317
+ newFloat32(value) {
1318
+ return CborFloat32.w32(value);
1319
+ }
1320
+ fromJson(value) {
1321
+ return CborFloat32.w32(get_float(value));
1322
+ }
1323
+ l1l() {
1324
+ return CDDLSerializer_getInstance();
1325
+ }
1326
+ k18(typeParamsSerializers) {
1327
+ return this.l1l();
1328
+ }
1329
+ }
1330
+ class float64 extends CDDL {
1331
+ constructor() {
1332
+ float64_instance = null;
1333
+ super('float64', MajorType_SPECIAL_getInstance(), 27);
1334
+ float64_instance = this;
1335
+ }
1336
+ newFloat64(value) {
1337
+ return CborDouble.d33(value);
1338
+ }
1339
+ fromJson(value) {
1340
+ return CborDouble.d33(get_double(value));
1341
+ }
1342
+ l1l() {
1343
+ return CDDLSerializer_getInstance();
1344
+ }
1345
+ k18(typeParamsSerializers) {
1346
+ return this.l1l();
1347
+ }
1348
+ }
1349
+ class float extends CDDL {
1350
+ constructor() {
1351
+ float_instance = null;
1352
+ var tmp = MajorType_SPECIAL_getInstance();
1353
+ // Inline function 'kotlin.arrayOf' call
1354
+ // Inline function 'kotlin.js.unsafeCast' call
1355
+ // Inline function 'kotlin.js.asDynamic' call
1356
+ super('float', tmp, VOID, [float16_getInstance(), float32_getInstance(), float64_getInstance()]);
1357
+ float_instance = this;
1358
+ }
1359
+ newFloat(value) {
1360
+ return CborFloat32.w32(value);
1361
+ }
1362
+ fromJson(value) {
1363
+ return CborFloat32.w32(get_float(value));
1364
+ }
1365
+ l1l() {
1366
+ return CDDLSerializer_getInstance();
1367
+ }
1368
+ k18(typeParamsSerializers) {
1369
+ return this.l1l();
1370
+ }
1371
+ }
1372
+ class False extends CDDL {
1373
+ constructor() {
1374
+ False_instance = null;
1375
+ super('false', MajorType_SPECIAL_getInstance(), 20);
1376
+ False_instance = this;
1377
+ }
1378
+ newFalse() {
1379
+ return Companion_getInstance_7().m33_1;
1380
+ }
1381
+ fromJson(value) {
1382
+ return Companion_getInstance_7().m33_1;
1383
+ }
1384
+ l1l() {
1385
+ return CDDLSerializer_getInstance();
1386
+ }
1387
+ k18(typeParamsSerializers) {
1388
+ return this.l1l();
1389
+ }
1390
+ }
1391
+ class True extends CDDL {
1392
+ constructor() {
1393
+ True_instance = null;
1394
+ super('true', MajorType_SPECIAL_getInstance(), 21);
1395
+ True_instance = this;
1396
+ }
1397
+ newTrue() {
1398
+ return Companion_getInstance_7().n33_1;
1399
+ }
1400
+ fromJson(value) {
1401
+ return Companion_getInstance_7().n33_1;
1402
+ }
1403
+ l1l() {
1404
+ return CDDLSerializer_getInstance();
1405
+ }
1406
+ k18(typeParamsSerializers) {
1407
+ return this.l1l();
1408
+ }
1409
+ }
1410
+ class bool extends CDDL {
1411
+ constructor() {
1412
+ bool_instance = null;
1413
+ var tmp = MajorType_SPECIAL_getInstance();
1414
+ // Inline function 'kotlin.arrayOf' call
1415
+ // Inline function 'kotlin.js.unsafeCast' call
1416
+ // Inline function 'kotlin.js.asDynamic' call
1417
+ super('bool', tmp, VOID, [False_getInstance(), True_getInstance()]);
1418
+ bool_instance = this;
1419
+ }
1420
+ newBool(value) {
1421
+ return value ? Companion_getInstance_7().n33_1 : Companion_getInstance_7().m33_1;
1422
+ }
1423
+ fromJson(value) {
1424
+ return get_boolean(value) ? Companion_getInstance_7().n33_1 : Companion_getInstance_7().m33_1;
1425
+ }
1426
+ l1l() {
1427
+ return CDDLSerializer_getInstance();
1428
+ }
1429
+ k18(typeParamsSerializers) {
1430
+ return this.l1l();
1431
+ }
1432
+ }
1433
+ class nil extends CDDL {
1434
+ constructor() {
1435
+ nil_instance = null;
1436
+ super('nil', MajorType_SPECIAL_getInstance(), 22);
1437
+ nil_instance = this;
1438
+ }
1439
+ newNil() {
1440
+ return Companion_getInstance_7().o33_1;
1441
+ }
1442
+ fromJson(value) {
1443
+ return Companion_getInstance_7().o33_1;
1444
+ }
1445
+ l1l() {
1446
+ return CDDLSerializer_getInstance();
1447
+ }
1448
+ k18(typeParamsSerializers) {
1449
+ return this.l1l();
1450
+ }
1451
+ }
1452
+ class Null extends CDDL {
1453
+ constructor() {
1454
+ Null_instance = null;
1455
+ var tmp = MajorType_SPECIAL_getInstance();
1456
+ // Inline function 'kotlin.arrayOf' call
1457
+ // Inline function 'kotlin.js.unsafeCast' call
1458
+ // Inline function 'kotlin.js.asDynamic' call
1459
+ super('null', tmp, 22, [nil_getInstance()]);
1460
+ Null_instance = this;
1461
+ }
1462
+ newNull() {
1463
+ return Companion_getInstance_7().o33_1;
1464
+ }
1465
+ fromJson(value) {
1466
+ return Companion_getInstance_7().o33_1;
1467
+ }
1468
+ l1l() {
1469
+ return CDDLSerializer_getInstance();
1470
+ }
1471
+ k18(typeParamsSerializers) {
1472
+ return this.l1l();
1473
+ }
1474
+ }
1475
+ class undefined_0 extends CDDL {
1476
+ constructor() {
1477
+ undefined_instance = null;
1478
+ super('undefined', MajorType_SPECIAL_getInstance(), 23);
1479
+ undefined_instance = this;
1480
+ }
1481
+ newUndefined() {
1482
+ return Companion_getInstance_7().p33_1;
1483
+ }
1484
+ fromJson(value) {
1485
+ return Companion_getInstance_7().p33_1;
1486
+ }
1487
+ l1l() {
1488
+ return CDDLSerializer_getInstance();
1489
+ }
1490
+ k18(typeParamsSerializers) {
1491
+ return this.l1l();
1492
+ }
1493
+ }
1494
+ class map extends CDDL {
1495
+ constructor() {
1496
+ map_instance = null;
1497
+ super('map', MajorType_MAP_getInstance());
1498
+ map_instance = this;
1499
+ }
1500
+ newMap(value) {
1501
+ return CborMap.q34(value);
1502
+ }
1503
+ fromJson(value) {
1504
+ // Inline function 'kotlin.collections.map' call
1505
+ var this_0 = value.x2();
1506
+ // Inline function 'kotlin.collections.mapTo' call
1507
+ var destination = ArrayList.j2(collectionSizeOrDefault(this_0, 10));
1508
+ var _iterator__ex2g4s = this_0.j1();
1509
+ while (_iterator__ex2g4s.k1()) {
1510
+ var item = _iterator__ex2g4s.l1();
1511
+ var tmp = CborString.t2z(item.g4());
1512
+ var tmp0_subject = item.h4();
1513
+ var tmp_0;
1514
+ if (tmp0_subject instanceof JsonPrimitive) {
1515
+ tmp_0 = any_getInstance().fromJson(item.h4());
1516
+ } else {
1517
+ if (tmp0_subject instanceof JsonArray) {
1518
+ var tmp_1 = list_getInstance();
1519
+ var tmp_2 = item.h4();
1520
+ tmp_0 = tmp_1.fromJson(tmp_2 instanceof JsonArray ? tmp_2 : THROW_CCE());
1521
+ } else {
1522
+ if (tmp0_subject instanceof JsonObject) {
1523
+ var tmp_3 = map_getInstance();
1524
+ var tmp_4 = item.h4();
1525
+ tmp_0 = tmp_3.fromJson(tmp_4 instanceof JsonObject ? tmp_4 : THROW_CCE());
1526
+ } else {
1527
+ throw IllegalArgumentException.y1('Unknown type encountered');
1528
+ }
1529
+ }
1530
+ }
1531
+ var tmp$ret$2 = new Pair(tmp, tmp_0);
1532
+ destination.k2(tmp$ret$2);
1533
+ }
1534
+ return CborMap.q34(toMutableMap(toMap(destination)));
1535
+ }
1536
+ l1l() {
1537
+ return CDDLSerializer_getInstance();
1538
+ }
1539
+ k18(typeParamsSerializers) {
1540
+ return this.l1l();
1541
+ }
1542
+ }
1543
+ class list extends CDDL {
1544
+ constructor() {
1545
+ list_instance = null;
1546
+ super('list', MajorType_ARRAY_getInstance());
1547
+ list_instance = this;
1548
+ }
1549
+ newList(value) {
1550
+ return CborArray.x34(value);
1551
+ }
1552
+ fromJson(value) {
1553
+ // Inline function 'kotlin.collections.map' call
1554
+ // Inline function 'kotlin.collections.mapTo' call
1555
+ var destination = ArrayList.j2(collectionSizeOrDefault(value, 10));
1556
+ var _iterator__ex2g4s = value.j1();
1557
+ while (_iterator__ex2g4s.k1()) {
1558
+ var item = _iterator__ex2g4s.l1();
1559
+ var tmp;
1560
+ if (item instanceof JsonPrimitive) {
1561
+ tmp = any_getInstance().fromJson(item);
1562
+ } else {
1563
+ if (item instanceof JsonArray) {
1564
+ tmp = list_getInstance().fromJson(item);
1565
+ } else {
1566
+ if (item instanceof JsonObject) {
1567
+ var tmp_0;
1568
+ if (Companion_instance_6.d35(item)) {
1569
+ var tmp_1 = list_getInstance();
1570
+ var tmp1_safe_receiver = item.uh(CborConst_getInstance().z34_1);
1571
+ var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : get_jsonPrimitive(tmp1_safe_receiver);
1572
+ var tmp3_safe_receiver = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.e1l();
1573
+ var tmp_2;
1574
+ if (tmp3_safe_receiver == null) {
1575
+ tmp_2 = null;
1576
+ } else {
1577
+ // Inline function 'kotlin.let' call
1578
+ tmp_2 = util_getInstance().fromFormat(tmp3_safe_receiver);
1579
+ }
1580
+ tmp_0 = tmp_1.newCborItemFromJson(item, tmp_2);
1581
+ } else {
1582
+ tmp_0 = map_getInstance().fromJson(item);
1583
+ }
1584
+ tmp = tmp_0;
1585
+ } else {
1586
+ throw IllegalArgumentException.y1('Unknown type encountered');
1587
+ }
1588
+ }
1589
+ }
1590
+ var tmp$ret$2 = tmp;
1591
+ destination.k2(tmp$ret$2);
1592
+ }
1593
+ return CborArray.x34(toMutableList(destination));
1594
+ }
1595
+ l1l() {
1596
+ return CDDLSerializer_getInstance();
1597
+ }
1598
+ k18(typeParamsSerializers) {
1599
+ return this.l1l();
1600
+ }
1601
+ }
1602
+ class any extends CDDL {
1603
+ constructor() {
1604
+ any_instance = null;
1605
+ super('any');
1606
+ any_instance = this;
1607
+ }
1608
+ newAny(value) {
1609
+ return CborAny.k35(value);
1610
+ }
1611
+ fromJson(value) {
1612
+ return this.newCborItemFromJson(value);
1613
+ }
1614
+ l1l() {
1615
+ return CDDLSerializer_getInstance();
1616
+ }
1617
+ k18(typeParamsSerializers) {
1618
+ return this.l1l();
1619
+ }
1620
+ }
1621
+ class util {
1622
+ constructor() {
1623
+ util_instance = this;
1624
+ var tmp = this;
1625
+ tmp.p35_1 = lazy(CDDL$util$entries$delegate$lambda);
1626
+ }
1627
+ x2() {
1628
+ var tmp0 = this.p35_1;
1629
+ var tmp = KProperty1;
1630
+ // Inline function 'kotlin.getValue' call
1631
+ getPropertyCallableRef('entries', 1, tmp, CDDL$util$_get_entries_$ref_c77ahj(), null);
1632
+ return tmp0.h4();
1633
+ }
1634
+ fromFormat(format) {
1635
+ var tmp0 = this.entries;
1636
+ var tmp$ret$0;
1637
+ $l$block: {
1638
+ // Inline function 'kotlin.collections.first' call
1639
+ var inductionVariable = 0;
1640
+ var last = tmp0.length;
1641
+ while (inductionVariable < last) {
1642
+ var element = tmp0[inductionVariable];
1643
+ inductionVariable = inductionVariable + 1 | 0;
1644
+ if (element.format === format) {
1645
+ tmp$ret$0 = element;
1646
+ break $l$block;
1647
+ }
1648
+ }
1649
+ throw NoSuchElementException.u1('Array contains no element matching the predicate.');
1650
+ }
1651
+ return tmp$ret$0;
1652
+ }
1653
+ fromTag(tag) {
1654
+ if (!startsWith(tag, '#')) {
1655
+ throw IllegalArgumentException.y1('Invalid tag supplied ' + tag);
1656
+ }
1657
+ var parts = split(tag, ['#', '.']);
1658
+ if (parts.m2() === 1) {
1659
+ return any_getInstance();
1660
+ }
1661
+ var majorVal = toIntOrNull(parts.n2(1));
1662
+ var tmp;
1663
+ if (majorVal == null) {
1664
+ tmp = null;
1665
+ } else {
1666
+ // Inline function 'kotlin.let' call
1667
+ tmp = Companion_getInstance_10().r35(majorVal);
1668
+ }
1669
+ return this.fromMajorType(tmp, toIntOrNull(parts.n2(2)));
1670
+ }
1671
+ fromBytes(input) {
1672
+ var majorType = input >> 5;
1673
+ return this.fromMajorType(Companion_getInstance_10().r35(majorType));
1674
+ }
1675
+ s35(majorType, additionalInfo) {
1676
+ var tmp0 = this.entries;
1677
+ var tmp$ret$0;
1678
+ $l$block: {
1679
+ // Inline function 'kotlin.collections.first' call
1680
+ var inductionVariable = 0;
1681
+ var last = tmp0.length;
1682
+ while (inductionVariable < last) {
1683
+ var element = tmp0[inductionVariable];
1684
+ inductionVariable = inductionVariable + 1 | 0;
1685
+ if (equals(element.majorType, majorType) && element.info == additionalInfo) {
1686
+ tmp$ret$0 = element;
1687
+ break $l$block;
1688
+ }
1689
+ }
1690
+ throw NoSuchElementException.u1('Array contains no element matching the predicate.');
1691
+ }
1692
+ return tmp$ret$0;
1693
+ }
1694
+ fromMajorType(majorType, additionalInfo, $super) {
1695
+ majorType = majorType === VOID ? null : majorType;
1696
+ additionalInfo = additionalInfo === VOID ? null : additionalInfo;
1697
+ return $super === VOID ? this.s35(majorType, additionalInfo) : $super.s35.call(this, majorType, additionalInfo);
1698
+ }
1699
+ get entries() {
1700
+ return this.x2();
1701
+ }
1702
+ }
1703
+ class Companion_0 {}
1704
+ class CDDLSerializer {
1705
+ constructor() {
1706
+ CDDLSerializer_instance = this;
1707
+ this.x35_1 = PrimitiveSerialDescriptor('CDDL', STRING_getInstance());
1708
+ }
1709
+ av() {
1710
+ return this.x35_1;
1711
+ }
1712
+ y35(encoder, value) {
1713
+ encoder.u10(value.format);
1714
+ }
1715
+ nv(encoder, value) {
1716
+ return this.y35(encoder, value instanceof CDDL ? value : THROW_CCE());
1717
+ }
1718
+ ov(decoder) {
1719
+ return util_getInstance().fromFormat(decoder.lz());
1720
+ }
1721
+ }
1722
+ class CborAny extends CborItem {
1723
+ constructor(value) {
1724
+ return new.target.k35(value);
1725
+ }
1726
+ static k35(value) {
1727
+ return this.z35(value, any_getInstance());
1728
+ }
1729
+ q2y(builder) {
1730
+ var tmp = this.cddl;
1731
+ (tmp instanceof CDDL ? tmp : THROW_CCE()).newCborItem(this.value).q2y(builder);
1732
+ }
1733
+ toJsonSimple() {
1734
+ // Inline function 'kotlin.TODO' call
1735
+ var reason = 'No to Json on a Cbor Any yet';
1736
+ throw NotImplementedError.jd('An operation is not implemented: ' + reason);
1737
+ }
1738
+ }
1739
+ class ICborItemValueJson {}
1740
+ class CborArray$toJsonCborItem$1 {
1741
+ constructor(this$0) {
1742
+ this.a36_1 = this$0.cddl;
1743
+ this.b36_1 = this$0.toJsonWithCDDL();
1744
+ }
1745
+ d2z() {
1746
+ return this.a36_1;
1747
+ }
1748
+ h4() {
1749
+ return this.b36_1;
1750
+ }
1751
+ get cddl() {
1752
+ return this.d2z();
1753
+ }
1754
+ get value() {
1755
+ return this.h4();
1756
+ }
1757
+ }
1758
+ class CborCollectionItem extends CborItem {
1759
+ constructor(value, cddl) {
1760
+ return new.target.e36(value, cddl);
1761
+ }
1762
+ static e36(value, cddl) {
1763
+ return this.z35(value, cddl);
1764
+ }
1765
+ }
1766
+ class CborArray extends CborCollectionItem {
1767
+ constructor(value, indefiniteLength) {
1768
+ return new.target.x34(value, indefiniteLength);
1769
+ }
1770
+ static x34(value, indefiniteLength) {
1771
+ var tmp;
1772
+ if (value === VOID) {
1773
+ // Inline function 'kotlin.collections.mutableListOf' call
1774
+ tmp = ArrayList.s2();
1775
+ } else {
1776
+ tmp = value;
1777
+ }
1778
+ value = tmp;
1779
+ indefiniteLength = indefiniteLength === VOID ? false : indefiniteLength;
1780
+ var $this = this.e36(value, list_getInstance());
1781
+ $this.indefiniteLength = indefiniteLength;
1782
+ return $this;
1783
+ }
1784
+ f36() {
1785
+ return this.indefiniteLength;
1786
+ }
1787
+ required(idx) {
1788
+ if (idx > this.value.m2()) {
1789
+ throw IllegalArgumentException.y1('Index ' + idx + ' out of bounds');
1790
+ }
1791
+ return this.value.n2(idx);
1792
+ }
1793
+ optional(idx) {
1794
+ var tmp0_elvis_lhs = getOrNull(this.value, idx);
1795
+ var tmp;
1796
+ if (tmp0_elvis_lhs == null) {
1797
+ return null;
1798
+ } else {
1799
+ tmp = tmp0_elvis_lhs;
1800
+ }
1801
+ var item = tmp;
1802
+ var tmp_0;
1803
+ if (item instanceof CborNil) {
1804
+ tmp_0 = true;
1805
+ } else {
1806
+ tmp_0 = item instanceof CborNull;
1807
+ }
1808
+ if (tmp_0)
1809
+ return null;
1810
+ return item;
1811
+ }
1812
+ toJsonSimple() {
1813
+ // Inline function 'kotlin.collections.map' call
1814
+ var this_0 = this.value;
1815
+ // Inline function 'kotlin.collections.mapTo' call
1816
+ var destination = ArrayList.j2(collectionSizeOrDefault(this_0, 10));
1817
+ var _iterator__ex2g4s = this_0.j1();
1818
+ while (_iterator__ex2g4s.k1()) {
1819
+ var item = _iterator__ex2g4s.l1();
1820
+ var tmp$ret$2 = item.toJsonSimple();
1821
+ destination.k2(tmp$ret$2);
1822
+ }
1823
+ return new JsonArray(destination);
1824
+ }
1825
+ toJsonWithCDDL() {
1826
+ // Inline function 'kotlin.collections.map' call
1827
+ var this_0 = this.value;
1828
+ // Inline function 'kotlin.collections.mapTo' call
1829
+ var destination = ArrayList.j2(collectionSizeOrDefault(this_0, 10));
1830
+ var _iterator__ex2g4s = this_0.j1();
1831
+ while (_iterator__ex2g4s.k1()) {
1832
+ var item = _iterator__ex2g4s.l1();
1833
+ var tmp$ret$2 = item.toJsonWithCDDL();
1834
+ destination.k2(tmp$ret$2);
1835
+ }
1836
+ return new JsonArray(destination);
1837
+ }
1838
+ toJsonCborItem() {
1839
+ return new CborArray$toJsonCborItem$1(this);
1840
+ }
1841
+ q2y(builder) {
1842
+ if (this.indefiniteLength) {
1843
+ var majorTypeShifted = ensureNotNull(this.majorType).type << 5;
1844
+ builder.z2k(toByte(majorTypeShifted + 31 | 0));
1845
+ // Inline function 'kotlin.collections.forEach' call
1846
+ var _iterator__ex2g4s = this.value.j1();
1847
+ while (_iterator__ex2g4s.k1()) {
1848
+ var element = _iterator__ex2g4s.l1();
1849
+ (element instanceof CborItem ? element : THROW_CCE()).q2y(builder);
1850
+ }
1851
+ builder.z2k(-1);
1852
+ } else {
1853
+ cborEncodeLength(builder, ensureNotNull(this.majorType), this.value.m2());
1854
+ // Inline function 'kotlin.collections.forEach' call
1855
+ var _iterator__ex2g4s_0 = this.value.j1();
1856
+ while (_iterator__ex2g4s_0.k1()) {
1857
+ var element_0 = _iterator__ex2g4s_0.l1();
1858
+ (element_0 instanceof CborItem ? element_0 : THROW_CCE()).q2y(builder);
1859
+ }
1860
+ }
1861
+ }
1862
+ toString() {
1863
+ return 'CborArray(value=' + stringify(this.value) + ', indefiniteLength=' + this.indefiniteLength + ')';
1864
+ }
1865
+ }
1866
+ class Companion_1 {
1867
+ constructor() {
1868
+ Companion_instance_2 = this;
1869
+ var tmp = this;
1870
+ var tmp_0 = LazyThreadSafetyMode_PUBLICATION_getInstance();
1871
+ tmp.i36_1 = lazy_0(tmp_0, CborBaseItem$Companion$_anonymous__u5lfyv);
1872
+ }
1873
+ l1l() {
1874
+ return _get_$cachedSerializer__te6jhj(this);
1875
+ }
1876
+ k18(typeParamsSerializers) {
1877
+ return this.l1l();
1878
+ }
1879
+ }
1880
+ class CborSimple extends CborItem {
1881
+ static q36(value, cddl) {
1882
+ Companion_getInstance_7();
1883
+ var $this = this.z35(value, cddl);
1884
+ var tmp;
1885
+ if (cddl instanceof bool) {
1886
+ tmp = equals(value, true) ? True_getInstance().info : False_getInstance().info;
1887
+ } else {
1888
+ tmp = cddl.info;
1889
+ }
1890
+ var info = tmp;
1891
+ if (info == null) {
1892
+ throw IllegalArgumentException.pd();
1893
+ }
1894
+ // Inline function 'kotlin.require' call
1895
+ // Inline function 'kotlin.require' call
1896
+ if (!(typeof info === 'number')) {
1897
+ var message = 'Failed requirement.';
1898
+ throw IllegalArgumentException.y1(toString_0(message));
1899
+ }
1900
+ var tmp_0;
1901
+ if (info < 24) {
1902
+ tmp_0 = true;
1903
+ } else {
1904
+ tmp_0 = 32 <= info ? info <= 255 : false;
1905
+ }
1906
+ // Inline function 'kotlin.check' call
1907
+ if (!tmp_0) {
1908
+ throw IllegalStateException.o('Check failed.');
1909
+ }
1910
+ return $this;
1911
+ }
1912
+ q2y(builder) {
1913
+ var majorTypeShifted = toByte(ensureNotNull(this.majorType).type << 5);
1914
+ // Inline function 'kotlin.experimental.or' call
1915
+ var other = toByte(ensureNotNull(this.info));
1916
+ var tmp$ret$0 = toByte(majorTypeShifted | other);
1917
+ builder.z2k(tmp$ret$0);
1918
+ }
1919
+ equals(other) {
1920
+ var tmp;
1921
+ if (other instanceof CborSimple) {
1922
+ tmp = equals(this.value, other.value);
1923
+ } else {
1924
+ tmp = false;
1925
+ }
1926
+ return tmp;
1927
+ }
1928
+ hashCode() {
1929
+ // Inline function 'kotlin.hashCode' call
1930
+ var tmp0_safe_receiver = this.value;
1931
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : hashCode(tmp0_safe_receiver);
1932
+ return tmp1_elvis_lhs == null ? 0 : tmp1_elvis_lhs;
1933
+ }
1934
+ toString() {
1935
+ return this.equals(Companion_getInstance_7().m33_1) ? 'Simple(FALSE)' : this.equals(Companion_getInstance_7().n33_1) ? 'Simple(TRUE)' : this.equals(Companion_getInstance_7().o33_1) ? 'Simple(NULL)' : this.equals(Companion_getInstance_7().p33_1) ? 'Simple(UNDEFINED)' : 'Simple(' + toString(this.value) + ')';
1936
+ }
1937
+ }
1938
+ class CborBool extends CborSimple {
1939
+ constructor(value, cddl) {
1940
+ return new.target.n36(value, cddl);
1941
+ }
1942
+ static n36(value, cddl) {
1943
+ return this.q36(value, cddl);
1944
+ }
1945
+ toJsonSimple() {
1946
+ return JsonPrimitive_0(this.toValue());
1947
+ }
1948
+ }
1949
+ class CborTrue extends CborBool {
1950
+ constructor() {
1951
+ return new.target.t36();
1952
+ }
1953
+ static t36() {
1954
+ var $this = this.n36(true, True_getInstance());
1955
+ if (!$this.value) {
1956
+ throw IllegalArgumentException.y1('True requires value true');
1957
+ }
1958
+ return $this;
1959
+ }
1960
+ }
1961
+ class CborFalse extends CborBool {
1962
+ constructor() {
1963
+ return new.target.w36();
1964
+ }
1965
+ static w36() {
1966
+ var $this = this.n36(false, False_getInstance());
1967
+ if ($this.value) {
1968
+ throw IllegalArgumentException.y1('False requires value false');
1969
+ }
1970
+ return $this;
1971
+ }
1972
+ }
1973
+ class CborBuilder {
1974
+ constructor(item, subject) {
1975
+ this.x36_1 = item;
1976
+ this.y36_1 = subject;
1977
+ }
1978
+ build() {
1979
+ return this.x36_1;
1980
+ }
1981
+ subject() {
1982
+ return this.y36_1;
1983
+ }
1984
+ encodedBuild() {
1985
+ return this.build().encodeCbor();
1986
+ }
1987
+ }
1988
+ class Companion_2 {
1989
+ z36(value) {
1990
+ return value.toBstr();
1991
+ }
1992
+ }
1993
+ class CborByteString extends CborItem {
1994
+ constructor(value) {
1995
+ return new.target.m30(value);
1996
+ }
1997
+ static m30(value) {
1998
+ return this.z35(value, bstr_getInstance());
1999
+ }
2000
+ toJsonSimple() {
2001
+ return JsonPrimitive_1(this.encodeValueTo(Encoding_BASE64URL_getInstance()));
2002
+ }
2003
+ q2y(builder) {
2004
+ cborEncodeLength(builder, ensureNotNull(this.majorType), this.value.length);
2005
+ builder.b2l(this.value);
2006
+ }
2007
+ encodeValueTo(encoding) {
2008
+ return encodeTo(this.value, encoding);
2009
+ }
2010
+ equals(other) {
2011
+ var tmp;
2012
+ if (other instanceof CborByteString) {
2013
+ tmp = contentEquals_0(this.value, other.value);
2014
+ } else {
2015
+ tmp = false;
2016
+ }
2017
+ return tmp;
2018
+ }
2019
+ hashCode() {
2020
+ return contentHashCode_0(this.value);
2021
+ }
2022
+ toString() {
2023
+ var sb = StringBuilder.lg('bstr(');
2024
+ var indexedObject = this.value;
2025
+ var inductionVariable = 0;
2026
+ var last = indexedObject.length;
2027
+ while (inductionVariable < last) {
2028
+ var b = indexedObject[inductionVariable];
2029
+ inductionVariable = inductionVariable + 1 | 0;
2030
+ sb.i1(this.n2y_1[(b & 255) >> 4]);
2031
+ sb.i1(this.n2y_1[b & 15]);
2032
+ }
2033
+ sb.g1(')');
2034
+ return sb.toString();
2035
+ }
2036
+ }
2037
+ class CborByteStringIndefLength extends CborItem {
2038
+ static u30(value) {
2039
+ return this.z35(value, bstr_indef_length_getInstance());
2040
+ }
2041
+ toJsonSimple() {
2042
+ // Inline function 'kotlin.TODO' call
2043
+ var reason = 'Cbor bytestring indef length to JSON not implemented yet';
2044
+ throw NotImplementedError.jd('An operation is not implemented: ' + reason);
2045
+ }
2046
+ q2y(builder) {
2047
+ var majorTypeShifted = ensureNotNull(this.majorType).type << 5;
2048
+ builder.z2k(toByte(majorTypeShifted + 31 | 0));
2049
+ // Inline function 'kotlin.collections.forEach' call
2050
+ var _iterator__ex2g4s = this.value.j1();
2051
+ while (_iterator__ex2g4s.k1()) {
2052
+ var element = _iterator__ex2g4s.l1();
2053
+ cborEncodeLength(builder, this.majorType, element.length);
2054
+ builder.b2l(element);
2055
+ }
2056
+ builder.z2k(-1);
2057
+ }
2058
+ }
2059
+ class CborConst {
2060
+ constructor() {
2061
+ CborConst_instance = this;
2062
+ this.y34_1 = 'cbor';
2063
+ this.z34_1 = 'cddl';
2064
+ this.a35_1 = 'key';
2065
+ this.b35_1 = 'value';
2066
+ this.c35_1 = 'sphereon:' + this.y34_1;
2067
+ }
2068
+ }
2069
+ class CborTagged extends CborItem {
2070
+ constructor(tagNumber, taggedItem) {
2071
+ return new.target.d37(tagNumber, taggedItem);
2072
+ }
2073
+ static d37(tagNumber, taggedItem) {
2074
+ var $this = this.z35(taggedItem.value, taggedItem.cddl);
2075
+ $this.tagNumber = tagNumber;
2076
+ $this.taggedItem = taggedItem;
2077
+ $this.c37_1 = MajorType_TAG_getInstance();
2078
+ return $this;
2079
+ }
2080
+ e37() {
2081
+ return this.tagNumber;
2082
+ }
2083
+ f37() {
2084
+ return this.taggedItem;
2085
+ }
2086
+ r2y() {
2087
+ return this.c37_1;
2088
+ }
2089
+ q2y(builder) {
2090
+ cborEncodeLength(builder, MajorType_TAG_getInstance(), this.tagNumber);
2091
+ this.taggedItem.q2y(builder);
2092
+ }
2093
+ toJsonSimple() {
2094
+ return this.taggedItem.toJsonSimple();
2095
+ }
2096
+ equals(other) {
2097
+ if (this === other)
2098
+ return true;
2099
+ if (other == null || !getKClassFromExpression(this).equals(getKClassFromExpression(other)))
2100
+ return false;
2101
+ if (!super.equals(other))
2102
+ return false;
2103
+ if (!(other instanceof CborTagged))
2104
+ THROW_CCE();
2105
+ if (!(this.tagNumber === other.tagNumber))
2106
+ return false;
2107
+ if (!this.taggedItem.equals(other.taggedItem))
2108
+ return false;
2109
+ return true;
2110
+ }
2111
+ hashCode() {
2112
+ var result = super.hashCode();
2113
+ result = imul(31, result) + this.tagNumber | 0;
2114
+ result = imul(31, result) + this.taggedItem.hashCode() | 0;
2115
+ return result;
2116
+ }
2117
+ }
2118
+ class CborTDate extends CborTagged {
2119
+ constructor(value) {
2120
+ return new.target.s31(value);
2121
+ }
2122
+ static s31(value) {
2123
+ return this.d37(ensureNotNull(tdate_getInstance().info), CborString.t2z(Companion_instance.b2t(value).toMdocTdateString()));
2124
+ }
2125
+ toJsonSimple() {
2126
+ return JsonPrimitive_1(this.toValue());
2127
+ }
2128
+ }
2129
+ class CborFullDate extends CborTagged {
2130
+ constructor(value) {
2131
+ return new.target.a32(value);
2132
+ }
2133
+ static a32(value) {
2134
+ return this.d37(ensureNotNull(full_date_getInstance().info), CborString.t2z(value));
2135
+ }
2136
+ toJsonSimple() {
2137
+ return JsonPrimitive_1(this.toValue());
2138
+ }
2139
+ }
2140
+ class Companion_3 {
2141
+ constructor() {
2142
+ Companion_instance_4 = this;
2143
+ this.DEFAULT_MAX_DEPTH = 64;
2144
+ this.DEFAULT_MAX_ITEMS = 1000000;
2145
+ this.DEFAULT_MAX_STRING_LENGTH = 10000000;
2146
+ this.g37_1 = new CborDecoderConfig();
2147
+ this.h37_1 = new CborDecoderConfig(2147483647, 2147483647, 2147483647);
2148
+ this.i37_1 = new CborDecoderConfig(32, 100000, 1000000);
2149
+ }
2150
+ j37() {
2151
+ return this.DEFAULT_MAX_DEPTH;
2152
+ }
2153
+ k37() {
2154
+ return this.DEFAULT_MAX_ITEMS;
2155
+ }
2156
+ l37() {
2157
+ return this.DEFAULT_MAX_STRING_LENGTH;
2158
+ }
2159
+ i2v() {
2160
+ return this.g37_1;
2161
+ }
2162
+ m37() {
2163
+ return this.h37_1;
2164
+ }
2165
+ n37() {
2166
+ return this.i37_1;
2167
+ }
2168
+ }
2169
+ class CborDecoderConfig {
2170
+ constructor(maxDepth, maxItems, maxStringLength) {
2171
+ Companion_getInstance_4();
2172
+ maxDepth = maxDepth === VOID ? 64 : maxDepth;
2173
+ maxItems = maxItems === VOID ? 1000000 : maxItems;
2174
+ maxStringLength = maxStringLength === VOID ? 10000000 : maxStringLength;
2175
+ this.maxDepth = maxDepth;
2176
+ this.maxItems = maxItems;
2177
+ this.maxStringLength = maxStringLength;
2178
+ // Inline function 'kotlin.require' call
2179
+ if (!(this.maxDepth > 0)) {
2180
+ var message = 'maxDepth must be positive';
2181
+ throw IllegalArgumentException.y1(toString_0(message));
2182
+ }
2183
+ // Inline function 'kotlin.require' call
2184
+ if (!(this.maxItems > 0)) {
2185
+ var message_0 = 'maxItems must be positive';
2186
+ throw IllegalArgumentException.y1(toString_0(message_0));
2187
+ }
2188
+ // Inline function 'kotlin.require' call
2189
+ if (!(this.maxStringLength > 0)) {
2190
+ var message_1 = 'maxStringLength must be positive';
2191
+ throw IllegalArgumentException.y1(toString_0(message_1));
2192
+ }
2193
+ }
2194
+ o37() {
2195
+ return this.maxDepth;
2196
+ }
2197
+ p37() {
2198
+ return this.maxItems;
2199
+ }
2200
+ q37() {
2201
+ return this.maxStringLength;
2202
+ }
2203
+ nk() {
2204
+ return this.maxDepth;
2205
+ }
2206
+ ok() {
2207
+ return this.maxItems;
2208
+ }
2209
+ tr() {
2210
+ return this.maxStringLength;
2211
+ }
2212
+ r37(maxDepth, maxItems, maxStringLength) {
2213
+ return new CborDecoderConfig(maxDepth, maxItems, maxStringLength);
2214
+ }
2215
+ copy(maxDepth, maxItems, maxStringLength, $super) {
2216
+ maxDepth = maxDepth === VOID ? this.maxDepth : maxDepth;
2217
+ maxItems = maxItems === VOID ? this.maxItems : maxItems;
2218
+ maxStringLength = maxStringLength === VOID ? this.maxStringLength : maxStringLength;
2219
+ return $super === VOID ? this.r37(maxDepth, maxItems, maxStringLength) : $super.r37.call(this, maxDepth, maxItems, maxStringLength);
2220
+ }
2221
+ toString() {
2222
+ return 'CborDecoderConfig(maxDepth=' + this.maxDepth + ', maxItems=' + this.maxItems + ', maxStringLength=' + this.maxStringLength + ')';
2223
+ }
2224
+ hashCode() {
2225
+ var result = this.maxDepth;
2226
+ result = imul(result, 31) + this.maxItems | 0;
2227
+ result = imul(result, 31) + this.maxStringLength | 0;
2228
+ return result;
2229
+ }
2230
+ equals(other) {
2231
+ if (this === other)
2232
+ return true;
2233
+ if (!(other instanceof CborDecoderConfig))
2234
+ return false;
2235
+ if (!(this.maxDepth === other.maxDepth))
2236
+ return false;
2237
+ if (!(this.maxItems === other.maxItems))
2238
+ return false;
2239
+ if (!(this.maxStringLength === other.maxStringLength))
2240
+ return false;
2241
+ return true;
2242
+ }
2243
+ }
2244
+ class CborHexEncodedItem extends CborByteString {
2245
+ constructor(hex) {
2246
+ return new.target.u37(hex);
2247
+ }
2248
+ static u37(hex) {
2249
+ return this.m30(decodeFromHex(hex));
2250
+ }
2251
+ }
2252
+ class Companion_4 {
2253
+ v37(deserializedValue) {
2254
+ var tmp;
2255
+ if (!(deserializedValue == null) ? isByteArray(deserializedValue) : false) {
2256
+ tmp = CborByteString.m30(deserializedValue);
2257
+ } else {
2258
+ if (deserializedValue instanceof CborByteString) {
2259
+ tmp = deserializedValue;
2260
+ } else {
2261
+ if (deserializedValue instanceof CborEncodedItem) {
2262
+ tmp = CborByteString.m30(deserializedValue.value.value);
2263
+ } else {
2264
+ if (deserializedValue instanceof CborItem) {
2265
+ tmp = deserializedValue.toBstr();
2266
+ } else {
2267
+ throw IllegalArgumentException.y1('A CBOR item, encoded item, or byte array is required');
2268
+ }
2269
+ }
2270
+ }
2271
+ }
2272
+ return tmp;
2273
+ }
2274
+ w37(encoded) {
2275
+ return encoded.data();
2276
+ }
2277
+ }
2278
+ class CborEncodedItem extends CborItem {
2279
+ constructor(value) {
2280
+ return new.target.a38(value);
2281
+ }
2282
+ static a38(value) {
2283
+ var $this = this.z35(CborTagged.d37(24, value), bstr_getInstance());
2284
+ $this.isOriginal = !!($this.z37_1 == null);
2285
+ return $this;
2286
+ }
2287
+ b38(_set____db54di) {
2288
+ this.z37_1 = _set____db54di;
2289
+ }
2290
+ c38() {
2291
+ var tmp = this.z37_1;
2292
+ if (!(tmp == null))
2293
+ return tmp;
2294
+ else {
2295
+ throwUninitializedPropertyAccessException('_data');
2296
+ }
2297
+ }
2298
+ d38() {
2299
+ return this.isOriginal;
2300
+ }
2301
+ static fromBytes(value, data) {
2302
+ data = data === VOID ? null : data;
2303
+ return this.e38(CborByteString.m30(value), data);
2304
+ }
2305
+ static e38(value, data) {
2306
+ data = data === VOID ? null : data;
2307
+ var $this = this.a38(value);
2308
+ if (!(data == null)) {
2309
+ $this.z37_1 = data;
2310
+ }
2311
+ return $this;
2312
+ }
2313
+ toJsonSimple() {
2314
+ return this.value.toJsonSimple();
2315
+ }
2316
+ toJsonWithCDDL() {
2317
+ return super.toJsonWithCDDL();
2318
+ }
2319
+ wasEncoded() {
2320
+ return this.isOriginal;
2321
+ }
2322
+ copy(data) {
2323
+ return CborEncodedItem.fromBytes(this.value.value, data);
2324
+ }
2325
+ isDataInitialized() {
2326
+ return !(this.z37_1 == null);
2327
+ }
2328
+ f38(fromBytesCallback) {
2329
+ if (!(this.z37_1 == null))
2330
+ return this._data;
2331
+ if (fromBytesCallback == null) {
2332
+ throw IllegalStateException.o('Encoded data is not initialized. Decode through a typed codec and call copy(decodedValue), or pass a decoder callback explicitly.');
2333
+ }
2334
+ this.z37_1 = fromBytesCallback(this.value.taggedItem.value);
2335
+ return this._data;
2336
+ }
2337
+ data(fromBytesCallback, $super) {
2338
+ fromBytesCallback = fromBytesCallback === VOID ? null : fromBytesCallback;
2339
+ return $super === VOID ? this.f38(fromBytesCallback) : $super.f38.call(this, fromBytesCallback);
2340
+ }
2341
+ q2y(builder) {
2342
+ this.value.q2y(builder);
2343
+ }
2344
+ equals(other) {
2345
+ if (this === other)
2346
+ return true;
2347
+ if (other == null || !getKClassFromExpression(this).equals(getKClassFromExpression(other)))
2348
+ return false;
2349
+ return contentEquals_0(this.value.value, (other instanceof CborEncodedItem ? other : THROW_CCE()).value.value);
2350
+ }
2351
+ hashCode() {
2352
+ return this.value.hashCode();
2353
+ }
2354
+ toString() {
2355
+ var data = this.isDataInitialized() ? this._data : '<uninitialized>';
2356
+ return 'CborEncodedItem(_data=' + toString_0(data) + ', value=' + this.value.toString() + ', isOriginal=' + this.isOriginal + ')';
2357
+ }
2358
+ get _data() {
2359
+ return this.c38();
2360
+ }
2361
+ set _data(value) {
2362
+ this.b38(value);
2363
+ }
2364
+ }
2365
+ class CborError {
2366
+ g38(current, max, severity, causes) {
2367
+ return new IdkError('CBOR_MAX_DEPTH_EXCEEDED', new Message('com.sphereon.cbor.error.max-depth-exceeded', mapOf([to('current', current), to('max', max)]), 'Maximum CBOR nesting depth exceeded: current=' + current + ', max=' + max), severity, VOID, causes, mapOf([to('currentDepth', current), to('maxDepth', max)]));
2368
+ }
2369
+ MAX_DEPTH_EXCEEDED(current, max, severity, causes, $super) {
2370
+ severity = severity === VOID ? Severity_ERROR_getInstance() : severity;
2371
+ causes = causes === VOID ? emptyList() : causes;
2372
+ return $super === VOID ? this.g38(current, max, severity, causes) : $super.g38.call(this, current, max, severity, causes);
2373
+ }
2374
+ h38(current, max, severity, causes) {
2375
+ return new IdkError('CBOR_MAX_ITEMS_EXCEEDED', new Message('com.sphereon.cbor.error.max-items-exceeded', mapOf([to('current', current), to('max', max)]), 'Maximum CBOR item count exceeded: current=' + current + ', max=' + max), severity, VOID, causes, mapOf([to('currentItems', current), to('maxItems', max)]));
2376
+ }
2377
+ MAX_ITEMS_EXCEEDED(current, max, severity, causes, $super) {
2378
+ severity = severity === VOID ? Severity_ERROR_getInstance() : severity;
2379
+ causes = causes === VOID ? emptyList() : causes;
2380
+ return $super === VOID ? this.h38(current, max, severity, causes) : $super.h38.call(this, current, max, severity, causes);
2381
+ }
2382
+ i38(length, max, severity, causes) {
2383
+ return new IdkError('CBOR_MAX_STRING_LENGTH_EXCEEDED', new Message('com.sphereon.cbor.error.max-string-length-exceeded', mapOf([to('length', length), to('max', max)]), 'Maximum CBOR string length exceeded: length=' + length + ', max=' + max), severity, VOID, causes, mapOf([to('stringLength', length), to('maxLength', max)]));
2384
+ }
2385
+ MAX_STRING_LENGTH_EXCEEDED(length, max, severity, causes, $super) {
2386
+ severity = severity === VOID ? Severity_ERROR_getInstance() : severity;
2387
+ causes = causes === VOID ? emptyList() : causes;
2388
+ return $super === VOID ? this.i38(length, max, severity, causes) : $super.i38.call(this, length, max, severity, causes);
2389
+ }
2390
+ j38(count, severity, causes) {
2391
+ return new IdkError('CBOR_LEFTOVER_BYTES', new Message('com.sphereon.cbor.error.leftover-bytes', mapOf_0(to('count', count)), '' + count + ' bytes leftover after decoding CBOR'), severity, VOID, causes, mapOf_0(to('leftoverBytes', count)));
2392
+ }
2393
+ LEFTOVER_BYTES(count, severity, causes, $super) {
2394
+ severity = severity === VOID ? Severity_ERROR_getInstance() : severity;
2395
+ causes = causes === VOID ? emptyList() : causes;
2396
+ return $super === VOID ? this.j38(count, severity, causes) : $super.j38.call(this, count, severity, causes);
2397
+ }
2398
+ k38(offset, required, available, severity, causes) {
2399
+ return new IdkError('CBOR_OUT_OF_BOUNDS', new Message('com.sphereon.cbor.error.out-of-bounds', mapOf([to('offset', offset), to('required', required), to('available', available)]), 'CBOR out of bounds: tried to read ' + required + ' bytes at offset ' + offset + ', but only ' + available + ' bytes available'), severity, VOID, causes, mapOf([to('offset', offset), to('required', required), to('available', available)]));
2400
+ }
2401
+ OUT_OF_BOUNDS(offset, required, available, severity, causes, $super) {
2402
+ severity = severity === VOID ? Severity_ERROR_getInstance() : severity;
2403
+ causes = causes === VOID ? emptyList() : causes;
2404
+ return $super === VOID ? this.k38(offset, required, available, severity, causes) : $super.k38.call(this, offset, required, available, severity, causes);
2405
+ }
2406
+ l38(offset, severity, causes) {
2407
+ return new IdkError('CBOR_INVALID_UTF8', new Message('com.sphereon.cbor.error.invalid-utf8', mapOf_0(to('offset', offset)), 'Invalid UTF-8 encoding at offset ' + offset), severity, VOID, causes, mapOf_0(to('offset', offset)));
2408
+ }
2409
+ INVALID_UTF8(offset, severity, causes, $super) {
2410
+ severity = severity === VOID ? Severity_ERROR_getInstance() : severity;
2411
+ causes = causes === VOID ? emptyList() : causes;
2412
+ return $super === VOID ? this.l38(offset, severity, causes) : $super.l38.call(this, offset, severity, causes);
2413
+ }
2414
+ m38(value, offset, severity, causes) {
2415
+ return new IdkError('CBOR_INVALID_ADDITIONAL_INFO', new Message('com.sphereon.cbor.error.invalid-additional-info', mapOf([to('value', value), to('offset', offset)]), 'Invalid CBOR additional information value ' + value + ' at offset ' + offset), severity, VOID, causes, mapOf([to('additionalInfo', value), to('offset', offset)]));
2416
+ }
2417
+ INVALID_ADDITIONAL_INFO(value, offset, severity, causes, $super) {
2418
+ severity = severity === VOID ? Severity_ERROR_getInstance() : severity;
2419
+ causes = causes === VOID ? emptyList() : causes;
2420
+ return $super === VOID ? this.m38(value, offset, severity, causes) : $super.m38.call(this, value, offset, severity, causes);
2421
+ }
2422
+ n38(offset, severity, causes) {
2423
+ return new IdkError('CBOR_UNEXPECTED_BREAK', new Message('com.sphereon.cbor.error.unexpected-break', mapOf_0(to('offset', offset)), 'Unexpected BREAK code outside indefinite-length item at offset ' + offset), severity, VOID, causes, mapOf_0(to('offset', offset)));
2424
+ }
2425
+ UNEXPECTED_BREAK(offset, severity, causes, $super) {
2426
+ severity = severity === VOID ? Severity_ERROR_getInstance() : severity;
2427
+ causes = causes === VOID ? emptyList() : causes;
2428
+ return $super === VOID ? this.n38(offset, severity, causes) : $super.n38.call(this, offset, severity, causes);
2429
+ }
2430
+ o38(majorType, offset, severity, causes) {
2431
+ return new IdkError('CBOR_INDEFINITE_LENGTH_NOT_ALLOWED', new Message('com.sphereon.cbor.error.indefinite-length-not-allowed', mapOf([to('majorType', majorType), to('offset', offset)]), 'Indefinite length (additional information 31) not allowed for major type ' + majorType + ' at offset ' + offset), severity, VOID, causes, mapOf([to('majorType', majorType), to('offset', offset)]));
2432
+ }
2433
+ INDEFINITE_LENGTH_NOT_ALLOWED(majorType, offset, severity, causes, $super) {
2434
+ severity = severity === VOID ? Severity_ERROR_getInstance() : severity;
2435
+ causes = causes === VOID ? emptyList() : causes;
2436
+ return $super === VOID ? this.o38(majorType, offset, severity, causes) : $super.o38.call(this, majorType, offset, severity, causes);
2437
+ }
2438
+ p38(message, throwable, severity, causes) {
2439
+ return new IdkError('CBOR_DECODE_ERROR', new Message('com.sphereon.cbor.error.decode-error', mapOf_0(to('message', message)), 'CBOR decode error: ' + message), severity, VOID, causes, VOID, throwable);
2440
+ }
2441
+ DECODE_ERROR(message, throwable, severity, causes, $super) {
2442
+ throwable = throwable === VOID ? null : throwable;
2443
+ severity = severity === VOID ? Severity_ERROR_getInstance() : severity;
2444
+ causes = causes === VOID ? emptyList() : causes;
2445
+ return $super === VOID ? this.p38(message, throwable, severity, causes) : $super.p38.call(this, message, throwable, severity, causes);
2446
+ }
2447
+ }
2448
+ class CborFloat extends CborNumber {
2449
+ constructor(value, cddl) {
2450
+ return new.target.s38(value, cddl);
2451
+ }
2452
+ static s38(value, cddl) {
2453
+ return this.m2y(value, cddl);
2454
+ }
2455
+ q2y(builder) {
2456
+ // Inline function 'kotlin.run' call
2457
+ var majorTypeShifted = toByte(ensureNotNull(this.majorType).type << 5);
2458
+ // Inline function 'kotlin.experimental.or' call
2459
+ var tmp$ret$2 = toByte(majorTypeShifted | 26);
2460
+ builder.z2k(tmp$ret$2);
2461
+ var raw = toRawBits(this.value);
2462
+ builder.z2k(toByte(raw >> 24 & 255));
2463
+ builder.z2k(toByte(raw >> 16 & 255));
2464
+ builder.z2k(toByte(raw >> 8 & 255));
2465
+ builder.z2k(toByte(raw >> 0 & 255));
2466
+ }
2467
+ }
2468
+ class CborFloat16 extends CborFloat {
2469
+ constructor(value) {
2470
+ return new.target.p32(value);
2471
+ }
2472
+ static p32(value) {
2473
+ return this.s38(value, float16_getInstance());
2474
+ }
2475
+ }
2476
+ class CborFloat32 extends CborFloat {
2477
+ constructor(value) {
2478
+ return new.target.w32(value);
2479
+ }
2480
+ static w32(value) {
2481
+ return this.s38(value, float32_getInstance());
2482
+ }
2483
+ }
2484
+ class CborDouble extends CborItem {
2485
+ constructor(value) {
2486
+ return new.target.d33(value);
2487
+ }
2488
+ static d33(value) {
2489
+ return this.z35(value, float64_getInstance());
2490
+ }
2491
+ toJsonSimple() {
2492
+ return JsonPrimitive_2(this.toValue());
2493
+ }
2494
+ q2y(builder) {
2495
+ // Inline function 'kotlin.run' call
2496
+ var majorTypeShifted = toByte(ensureNotNull(this.majorType).type << 5);
2497
+ // Inline function 'kotlin.experimental.or' call
2498
+ var tmp$ret$2 = toByte(majorTypeShifted | 27);
2499
+ builder.z2k(tmp$ret$2);
2500
+ var raw = toRawBits_0(this.value);
2501
+ builder.z2k(convertToByte(shiftRight(raw, 56) & 255n));
2502
+ builder.z2k(convertToByte(shiftRight(raw, 48) & 255n));
2503
+ builder.z2k(convertToByte(shiftRight(raw, 40) & 255n));
2504
+ builder.z2k(convertToByte(shiftRight(raw, 32) & 255n));
2505
+ builder.z2k(convertToByte(shiftRight(raw, 24) & 255n));
2506
+ builder.z2k(convertToByte(shiftRight(raw, 16) & 255n));
2507
+ builder.z2k(convertToByte(shiftRight(raw, 8) & 255n));
2508
+ builder.z2k(convertToByte(shiftRight(raw, 0) & 255n));
2509
+ return Unit_instance;
2510
+ }
2511
+ }
2512
+ class CborItem$toJsonCborItem$1 {
2513
+ constructor(this$0) {
2514
+ this.t38_1 = this$0;
2515
+ }
2516
+ d2z() {
2517
+ return this.t38_1.cddl;
2518
+ }
2519
+ h4() {
2520
+ return this.t38_1.toJsonWithCDDL();
2521
+ }
2522
+ get cddl() {
2523
+ return this.d2z();
2524
+ }
2525
+ get value() {
2526
+ return this.h4();
2527
+ }
2528
+ }
2529
+ class ICborItemJson {}
2530
+ class CborItemJson$Companion$fromJsonPrimitive$1 {
2531
+ constructor($cddl, $jsonPrimitive) {
2532
+ this.u38_1 = $cddl;
2533
+ this.v38_1 = $jsonPrimitive;
2534
+ }
2535
+ d2z() {
2536
+ return this.u38_1;
2537
+ }
2538
+ h4() {
2539
+ return this.v38_1;
2540
+ }
2541
+ get cddl() {
2542
+ return this.d2z();
2543
+ }
2544
+ get value() {
2545
+ return this.h4();
2546
+ }
2547
+ }
2548
+ class CborItemJson$Companion$fromJsonObjectAsValueJson$1 {
2549
+ constructor($cddl, $jsonObject, $value) {
2550
+ this.w38_1 = $cddl;
2551
+ var tmp = this;
2552
+ var tmp0_safe_receiver = $jsonObject.uh(CborConst_getInstance().a35_1);
2553
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : get_jsonPrimitive(tmp0_safe_receiver);
2554
+ var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.e1l();
2555
+ var tmp_0;
2556
+ if (tmp2_elvis_lhs == null) {
2557
+ throw IllegalStateException.o("'key' key not available");
2558
+ } else {
2559
+ tmp_0 = tmp2_elvis_lhs;
2560
+ }
2561
+ tmp.x38_1 = tmp_0;
2562
+ this.y38_1 = $value;
2563
+ }
2564
+ d2z() {
2565
+ return this.w38_1;
2566
+ }
2567
+ g4() {
2568
+ return this.x38_1;
2569
+ }
2570
+ h4() {
2571
+ return this.y38_1;
2572
+ }
2573
+ get cddl() {
2574
+ return this.d2z();
2575
+ }
2576
+ get key() {
2577
+ return this.g4();
2578
+ }
2579
+ get value() {
2580
+ return this.h4();
2581
+ }
2582
+ }
2583
+ class CborItemJson$Companion$fromJsonObjectAsValueJson$2 {
2584
+ constructor($cddl, $value) {
2585
+ this.z38_1 = $cddl;
2586
+ this.a39_1 = $value;
2587
+ }
2588
+ d2z() {
2589
+ return this.z38_1;
2590
+ }
2591
+ h4() {
2592
+ return this.a39_1;
2593
+ }
2594
+ get cddl() {
2595
+ return this.d2z();
2596
+ }
2597
+ get value() {
2598
+ return this.h4();
2599
+ }
2600
+ }
2601
+ class Companion_5 {
2602
+ d35(jsonElement) {
2603
+ if (!(jsonElement instanceof JsonObject)) {
2604
+ return false;
2605
+ }
2606
+ if (jsonElement.m2() === 2 || jsonElement.m2() === 3) {
2607
+ return jsonElement.b1l(CborConst_getInstance().z34_1) && jsonElement.b1l(CborConst_getInstance().b35_1);
2608
+ }
2609
+ return false;
2610
+ }
2611
+ w35(jsonElement) {
2612
+ if (!(jsonElement instanceof JsonObject)) {
2613
+ return false;
2614
+ }
2615
+ if (jsonElement.m2() === 3) {
2616
+ return jsonElement.b1l(CborConst_getInstance().z34_1) && jsonElement.b1l(CborConst_getInstance().b35_1) && jsonElement.b1l(CborConst_getInstance().a35_1);
2617
+ }
2618
+ return false;
2619
+ }
2620
+ b39(jsonPrimitive, cddl, key) {
2621
+ if (!(key === null)) {
2622
+ return new CborItemJson(key, jsonPrimitive, cddl);
2623
+ }
2624
+ return new CborItemJson$Companion$fromJsonPrimitive$1(cddl, jsonPrimitive);
2625
+ }
2626
+ c39(jsonPrimitive, cddl, key, $super) {
2627
+ key = key === VOID ? null : key;
2628
+ return $super === VOID ? this.b39(jsonPrimitive, cddl, key) : $super.b39.call(this, jsonPrimitive, cddl, key);
2629
+ }
2630
+ d39(jsonArray) {
2631
+ // Inline function 'kotlin.collections.map' call
2632
+ // Inline function 'kotlin.collections.mapTo' call
2633
+ var destination = ArrayList.j2(collectionSizeOrDefault(jsonArray, 10));
2634
+ var _iterator__ex2g4s = jsonArray.j1();
2635
+ while (_iterator__ex2g4s.k1()) {
2636
+ var item = _iterator__ex2g4s.l1();
2637
+ if (!((item instanceof JsonObject ? item : null) === null)) {
2638
+ Companion_instance_6.e39(get_jsonObject(item));
2639
+ } else {
2640
+ if (!((item instanceof JsonPrimitive ? item : null) === null)) {
2641
+ if (item.d1l()) {
2642
+ Companion_instance_6.c39(get_jsonPrimitive(item), tstr_getInstance());
2643
+ } else {
2644
+ Companion_instance_6.c39(get_jsonPrimitive(item), any_getInstance());
2645
+ }
2646
+ } else {
2647
+ if (!((item instanceof JsonArray ? item : null) === null)) {
2648
+ Companion_instance_6.d39(get_jsonArray(item));
2649
+ }
2650
+ }
2651
+ }
2652
+ throw IllegalStateException.o('JsonObject does not contain 3 elements from a Cbor Json Item');
2653
+ }
2654
+ // Inline function 'kotlin.collections.toTypedArray' call
2655
+ return copyToArray(destination);
2656
+ }
2657
+ f39(jsonObject) {
2658
+ if (!this.w35(jsonObject)) {
2659
+ throw IllegalStateException.o('JsonObject does not contain 3 elements from a Cbor Json Item');
2660
+ }
2661
+ var tmp = this.e39(jsonObject);
2662
+ return isInterface(tmp, ICborItemJson) ? tmp : THROW_CCE();
2663
+ }
2664
+ e39(jsonObject) {
2665
+ if (!this.d35(jsonObject) && !this.d35(jsonObject)) {
2666
+ throw IllegalStateException.o('JsonObject does not contain 2 or 3 elements from a Cbor Json Item');
2667
+ }
2668
+ var tmp0_elvis_lhs = jsonObject.uh(CborConst_getInstance().b35_1);
2669
+ var tmp;
2670
+ if (tmp0_elvis_lhs == null) {
2671
+ throw IllegalStateException.o('value not available');
2672
+ } else {
2673
+ tmp = tmp0_elvis_lhs;
2674
+ }
2675
+ var value = tmp;
2676
+ var tmp_0 = util_getInstance();
2677
+ var tmp1_safe_receiver = jsonObject.uh(CborConst_getInstance().z34_1);
2678
+ var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : get_jsonPrimitive(tmp1_safe_receiver);
2679
+ var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.e1l();
2680
+ var tmp_1;
2681
+ if (tmp3_elvis_lhs == null) {
2682
+ throw IllegalStateException.o('cddl key not available');
2683
+ } else {
2684
+ tmp_1 = tmp3_elvis_lhs;
2685
+ }
2686
+ var cddl = tmp_0.fromFormat(tmp_1);
2687
+ if (jsonObject.b1l(CborConst_getInstance().a35_1)) {
2688
+ return new CborItemJson$Companion$fromJsonObjectAsValueJson$1(cddl, jsonObject, value);
2689
+ }
2690
+ return new CborItemJson$Companion$fromJsonObjectAsValueJson$2(cddl, value);
2691
+ }
2692
+ g39(cborItemJson) {
2693
+ return new CborItemJson(cborItemJson.key, cborItemJson.value, cborItemJson.cddl);
2694
+ }
2695
+ l1l() {
2696
+ return $serializer_getInstance();
2697
+ }
2698
+ }
2699
+ class $serializer {
2700
+ constructor() {
2701
+ $serializer_instance = this;
2702
+ var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('com.sphereon.cbor.CborItemJson', this, 3);
2703
+ tmp0_serialDesc.j17('key', false);
2704
+ tmp0_serialDesc.j17('value', false);
2705
+ tmp0_serialDesc.j17('cddl', false);
2706
+ this.h39_1 = tmp0_serialDesc;
2707
+ }
2708
+ i39(encoder, value) {
2709
+ var tmp0_desc = this.h39_1;
2710
+ var tmp1_output = encoder.pz(tmp0_desc);
2711
+ tmp1_output.f11(tmp0_desc, 0, value.j39_1);
2712
+ tmp1_output.h11(tmp0_desc, 1, JsonElementSerializer_getInstance(), value.k39_1);
2713
+ tmp1_output.h11(tmp0_desc, 2, CDDLSerializer_getInstance(), value.l39_1);
2714
+ tmp1_output.qz(tmp0_desc);
2715
+ }
2716
+ nv(encoder, value) {
2717
+ return this.i39(encoder, value instanceof CborItemJson ? value : THROW_CCE());
2718
+ }
2719
+ ov(decoder) {
2720
+ var tmp0_desc = this.h39_1;
2721
+ var tmp1_flag = true;
2722
+ var tmp2_index = 0;
2723
+ var tmp3_bitMask0 = 0;
2724
+ var tmp4_local0 = null;
2725
+ var tmp5_local1 = null;
2726
+ var tmp6_local2 = null;
2727
+ var tmp7_input = decoder.pz(tmp0_desc);
2728
+ if (tmp7_input.f10()) {
2729
+ tmp4_local0 = tmp7_input.zz(tmp0_desc, 0);
2730
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
2731
+ tmp5_local1 = tmp7_input.b10(tmp0_desc, 1, JsonElementSerializer_getInstance(), tmp5_local1);
2732
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
2733
+ tmp6_local2 = tmp7_input.b10(tmp0_desc, 2, CDDLSerializer_getInstance(), tmp6_local2);
2734
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
2735
+ } else
2736
+ while (tmp1_flag) {
2737
+ tmp2_index = tmp7_input.g10(tmp0_desc);
2738
+ switch (tmp2_index) {
2739
+ case -1:
2740
+ tmp1_flag = false;
2741
+ break;
2742
+ case 0:
2743
+ tmp4_local0 = tmp7_input.zz(tmp0_desc, 0);
2744
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
2745
+ break;
2746
+ case 1:
2747
+ tmp5_local1 = tmp7_input.b10(tmp0_desc, 1, JsonElementSerializer_getInstance(), tmp5_local1);
2748
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
2749
+ break;
2750
+ case 2:
2751
+ tmp6_local2 = tmp7_input.b10(tmp0_desc, 2, CDDLSerializer_getInstance(), tmp6_local2);
2752
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
2753
+ break;
2754
+ default:
2755
+ throw UnknownFieldException.xw(tmp2_index);
2756
+ }
2757
+ }
2758
+ tmp7_input.qz(tmp0_desc);
2759
+ return CborItemJson.m39(tmp3_bitMask0, tmp4_local0, tmp5_local1, tmp6_local2, null);
2760
+ }
2761
+ av() {
2762
+ return this.h39_1;
2763
+ }
2764
+ y17() {
2765
+ // Inline function 'kotlin.arrayOf' call
2766
+ // Inline function 'kotlin.js.unsafeCast' call
2767
+ // Inline function 'kotlin.js.asDynamic' call
2768
+ return [StringSerializer_getInstance(), JsonElementSerializer_getInstance(), CDDLSerializer_getInstance()];
2769
+ }
2770
+ }
2771
+ class CborItemJson {
2772
+ constructor(key, value, cddl) {
2773
+ this.j39_1 = key;
2774
+ this.k39_1 = value;
2775
+ this.l39_1 = cddl;
2776
+ }
2777
+ g4() {
2778
+ return this.j39_1;
2779
+ }
2780
+ h4() {
2781
+ return this.k39_1;
2782
+ }
2783
+ d2z() {
2784
+ return this.l39_1;
2785
+ }
2786
+ toJsonWithCDDL() {
2787
+ return new JsonObject(mapOf_0(new Pair(JsonPrimitive_1(this.j39_1).e1l(), new JsonObject(mapOf([new Pair(CborConst_getInstance().b35_1, this.k39_1), new Pair(CborConst_getInstance().z34_1, JsonPrimitive_1(this.l39_1.format))])))));
2788
+ }
2789
+ toJsonSimple() {
2790
+ return new JsonObject(mapOf_0(new Pair(JsonPrimitive_1(this.j39_1).e1l(), this.k39_1)));
2791
+ }
2792
+ y2y(includeCDDL) {
2793
+ return includeCDDL ? this.toJsonWithCDDL() : this.toJsonSimple();
2794
+ }
2795
+ toJsonCborItem() {
2796
+ return this;
2797
+ }
2798
+ nk() {
2799
+ return this.j39_1;
2800
+ }
2801
+ ok() {
2802
+ return this.k39_1;
2803
+ }
2804
+ tr() {
2805
+ return this.l39_1;
2806
+ }
2807
+ n39(key, value, cddl) {
2808
+ return new CborItemJson(key, value, cddl);
2809
+ }
2810
+ copy(key, value, cddl, $super) {
2811
+ key = key === VOID ? this.j39_1 : key;
2812
+ value = value === VOID ? this.k39_1 : value;
2813
+ cddl = cddl === VOID ? this.l39_1 : cddl;
2814
+ return $super === VOID ? this.n39(key, value, cddl) : $super.n39.call(this, key, value, cddl);
2815
+ }
2816
+ toString() {
2817
+ return 'CborItemJson(key=' + this.j39_1 + ', value=' + toString_0(this.k39_1) + ', cddl=' + toString_0(this.l39_1) + ')';
2818
+ }
2819
+ hashCode() {
2820
+ var result = getStringHashCode(this.j39_1);
2821
+ result = imul(result, 31) + hashCode(this.k39_1) | 0;
2822
+ result = imul(result, 31) + hashCode(this.l39_1) | 0;
2823
+ return result;
2824
+ }
2825
+ equals(other) {
2826
+ if (this === other)
2827
+ return true;
2828
+ if (!(other instanceof CborItemJson))
2829
+ return false;
2830
+ if (!(this.j39_1 === other.j39_1))
2831
+ return false;
2832
+ if (!equals(this.k39_1, other.k39_1))
2833
+ return false;
2834
+ if (!equals(this.l39_1, other.l39_1))
2835
+ return false;
2836
+ return true;
2837
+ }
2838
+ static m39(seen0, key, value, cddl, serializationConstructorMarker) {
2839
+ if (!(7 === (7 & seen0))) {
2840
+ throwMissingFieldException(seen0, 7, $serializer_getInstance().h39_1);
2841
+ }
2842
+ var $this = createThis(this);
2843
+ $this.j39_1 = key;
2844
+ $this.k39_1 = value;
2845
+ $this.l39_1 = cddl;
2846
+ return $this;
2847
+ }
2848
+ get key() {
2849
+ return this.g4();
2850
+ }
2851
+ get value() {
2852
+ return this.h4();
2853
+ }
2854
+ get cddl() {
2855
+ return this.d2z();
2856
+ }
2857
+ }
2858
+ class SimpleCborBuilder {
2859
+ constructor(item) {
2860
+ this.o39_1 = item;
2861
+ }
2862
+ build() {
2863
+ return this.o39_1;
2864
+ }
2865
+ }
2866
+ class CborMap$toJsonCborItem$1 {
2867
+ constructor(this$0) {
2868
+ this.p39_1 = map_getInstance();
2869
+ this.q39_1 = this$0.toJsonWithCDDL();
2870
+ }
2871
+ d2z() {
2872
+ return this.p39_1;
2873
+ }
2874
+ h4() {
2875
+ return this.q39_1;
2876
+ }
2877
+ get cddl() {
2878
+ return this.d2z();
2879
+ }
2880
+ get value() {
2881
+ return this.h4();
2882
+ }
2883
+ }
2884
+ class CborMap extends CborCollectionItem {
2885
+ constructor(value, indefiniteLength) {
2886
+ return new.target.q34(value, indefiniteLength);
2887
+ }
2888
+ static q34(value, indefiniteLength) {
2889
+ var tmp;
2890
+ if (value === VOID) {
2891
+ // Inline function 'kotlin.collections.mutableMapOf' call
2892
+ tmp = LinkedHashMap.v5();
2893
+ } else {
2894
+ tmp = value;
2895
+ }
2896
+ value = tmp;
2897
+ indefiniteLength = indefiniteLength === VOID ? false : indefiniteLength;
2898
+ var $this = this.e36(value, map_getInstance());
2899
+ $this.indefiniteLength = indefiniteLength;
2900
+ return $this;
2901
+ }
2902
+ f36() {
2903
+ return this.indefiniteLength;
2904
+ }
2905
+ get(key) {
2906
+ return this.value.l4(key);
2907
+ }
2908
+ toJsonSimple() {
2909
+ // Inline function 'kotlin.collections.associate' call
2910
+ var this_0 = this.value.x2();
2911
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
2912
+ // Inline function 'kotlin.collections.associateTo' call
2913
+ var destination = LinkedHashMap.hc(capacity);
2914
+ var _iterator__ex2g4s = this_0.j1();
2915
+ while (_iterator__ex2g4s.k1()) {
2916
+ var element = _iterator__ex2g4s.l1();
2917
+ var key = get_jsonPrimitive(element.g4().toJsonSimple()).e1l();
2918
+ var tmp;
2919
+ var tmp_0 = element.h4();
2920
+ if (tmp_0 instanceof CborItem) {
2921
+ var tmp_1 = element.h4();
2922
+ tmp = (tmp_1 instanceof CborItem ? tmp_1 : THROW_CCE()).toJsonSimple();
2923
+ } else {
2924
+ throw IllegalArgumentException.y1('Map must contain cbor values');
2925
+ }
2926
+ var value = tmp;
2927
+ // Inline function 'kotlin.collections.plusAssign' call
2928
+ var pair = new Pair(key, value);
2929
+ destination.p4(pair.first, pair.second);
2930
+ }
2931
+ return new JsonObject(destination);
2932
+ }
2933
+ toJsonWithCDDL() {
2934
+ // Inline function 'kotlin.collections.map' call
2935
+ var this_0 = this.value.x2();
2936
+ // Inline function 'kotlin.collections.mapTo' call
2937
+ var destination = ArrayList.j2(collectionSizeOrDefault(this_0, 10));
2938
+ var _iterator__ex2g4s = this_0.j1();
2939
+ while (_iterator__ex2g4s.k1()) {
2940
+ var item = _iterator__ex2g4s.l1();
2941
+ var tmp;
2942
+ var tmp_0 = item.h4();
2943
+ if (tmp_0 instanceof CborItem) {
2944
+ var tmp_1 = item.h4();
2945
+ tmp = (tmp_1 instanceof CborItem ? tmp_1 : THROW_CCE()).toJsonWithCDDL();
2946
+ } else {
2947
+ throw IllegalArgumentException.y1('Map must contain cbor values');
2948
+ }
2949
+ var json = tmp;
2950
+ var arrayElement = json instanceof JsonArray ? json : null;
2951
+ var isArray = !(arrayElement === null);
2952
+ var objectElement = json instanceof JsonObject ? json : null;
2953
+ var isObject = !(objectElement === null);
2954
+ var primitiveElement = json instanceof JsonPrimitive ? json : null;
2955
+ var isPrimitive = !(primitiveElement === null);
2956
+ var key = get_jsonPrimitive(item.g4().toJsonSimple());
2957
+ var tmp_2;
2958
+ if (isArray) {
2959
+ tmp_2 = JsonPrimitive_1(list_getInstance().format);
2960
+ } else if (isPrimitive) {
2961
+ var tmp0_safe_receiver = item.h4();
2962
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.cddl;
2963
+ var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.format;
2964
+ tmp_2 = JsonPrimitive_1(tmp2_elvis_lhs == null ? nil_getInstance().format : tmp2_elvis_lhs);
2965
+ } else {
2966
+ tmp_2 = ensureNotNull(get_jsonObject(json).uh(CborConst_getInstance().z34_1));
2967
+ }
2968
+ var cddl = tmp_2;
2969
+ var tmp4_elvis_lhs = primitiveElement == null ? arrayElement : primitiveElement;
2970
+ var value = tmp4_elvis_lhs == null ? ensureNotNull(get_jsonObject(json).uh(CborConst_getInstance().b35_1)) : tmp4_elvis_lhs;
2971
+ var tmp$ret$2 = new JsonObject(mapOf([to('key', key), to(CborConst_getInstance().z34_1, cddl), to(CborConst_getInstance().b35_1, value)]));
2972
+ destination.k2(tmp$ret$2);
2973
+ }
2974
+ return new JsonArray(destination);
2975
+ }
2976
+ toJsonWithCDDLObject() {
2977
+ // Inline function 'kotlin.collections.map' call
2978
+ var this_0 = this.value.x2();
2979
+ // Inline function 'kotlin.collections.mapTo' call
2980
+ var destination = ArrayList.j2(collectionSizeOrDefault(this_0, 10));
2981
+ var _iterator__ex2g4s = this_0.j1();
2982
+ while (_iterator__ex2g4s.k1()) {
2983
+ var item = _iterator__ex2g4s.l1();
2984
+ var tmp;
2985
+ var tmp_0 = item.h4();
2986
+ if (tmp_0 instanceof CborItem) {
2987
+ var tmp_1 = item.h4();
2988
+ tmp = (tmp_1 instanceof CborItem ? tmp_1 : THROW_CCE()).toJsonWithCDDL();
2989
+ } else {
2990
+ throw IllegalArgumentException.y1('Map must contain cbor values');
2991
+ }
2992
+ var json = tmp;
2993
+ var arrayElement = json instanceof JsonArray ? json : null;
2994
+ var isArray = !(arrayElement === null);
2995
+ var objectElement = json instanceof JsonObject ? json : null;
2996
+ var isObject = !(objectElement === null);
2997
+ var primitiveElement = json instanceof JsonPrimitive ? json : null;
2998
+ var isPrimitive = !(primitiveElement === null);
2999
+ var key = get_jsonPrimitive(item.g4().toJsonSimple()).e1l();
3000
+ var tmp_2;
3001
+ if (isArray) {
3002
+ tmp_2 = JsonPrimitive_1(list_getInstance().format);
3003
+ } else if (isPrimitive) {
3004
+ var tmp0_safe_receiver = item.h4();
3005
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.cddl;
3006
+ var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.format;
3007
+ tmp_2 = JsonPrimitive_1(tmp2_elvis_lhs == null ? nil_getInstance().format : tmp2_elvis_lhs);
3008
+ } else {
3009
+ tmp_2 = ensureNotNull(get_jsonObject(json).uh(CborConst_getInstance().z34_1));
3010
+ }
3011
+ var cddl = tmp_2;
3012
+ var tmp4_elvis_lhs = primitiveElement == null ? arrayElement : primitiveElement;
3013
+ var value = tmp4_elvis_lhs == null ? ensureNotNull(get_jsonObject(json).uh(CborConst_getInstance().b35_1)) : tmp4_elvis_lhs;
3014
+ var tmp$ret$2 = new Pair(key, new JsonObject(mapOf([to(CborConst_getInstance().z34_1, cddl), to(CborConst_getInstance().b35_1, value)])));
3015
+ destination.k2(tmp$ret$2);
3016
+ }
3017
+ // Inline function 'kotlin.collections.toTypedArray' call
3018
+ var tmp$ret$3 = copyToArray(destination);
3019
+ return new JsonObject(mapOf(tmp$ret$3.slice()));
3020
+ }
3021
+ toJsonCborItem() {
3022
+ return new CborMap$toJsonCborItem$1(this);
3023
+ }
3024
+ r39(key, required) {
3025
+ var tmp = StringLabel.u39(key);
3026
+ var value = this.value.l4(tmp instanceof CborItem ? tmp : THROW_CCE());
3027
+ if (required === true && value == null) {
3028
+ throw IllegalArgumentException.y1('Value is null for required label ' + key);
3029
+ }
3030
+ return value;
3031
+ }
3032
+ getStringLabel(key, required, $super) {
3033
+ required = required === VOID ? false : required;
3034
+ return $super === VOID ? this.r39(key, required) : $super.r39.call(this, key, required);
3035
+ }
3036
+ v39(key, required) {
3037
+ var tmp = NumberLabel.fromInt(convertToInt(key));
3038
+ var value = this.value.l4(tmp instanceof CborItem ? tmp : THROW_CCE());
3039
+ if (required === true && value == null) {
3040
+ throw IllegalArgumentException.y1('Value is null for required label ' + key.toString());
3041
+ }
3042
+ return value;
3043
+ }
3044
+ getNumberLabel(key, required, $super) {
3045
+ required = required === VOID ? false : required;
3046
+ return $super === VOID ? this.v39(key, required) : $super.v39.call(this, key, required);
3047
+ }
3048
+ q2y(builder) {
3049
+ if (this.indefiniteLength) {
3050
+ var majorTypeShifted = ensureNotNull(this.majorType).type << 5;
3051
+ builder.z2k(toByte(majorTypeShifted + 31 | 0));
3052
+ // Inline function 'kotlin.collections.iterator' call
3053
+ var _iterator__ex2g4s = this.value.x2().j1();
3054
+ while (_iterator__ex2g4s.k1()) {
3055
+ var _destruct__k2r9zo = _iterator__ex2g4s.l1();
3056
+ // Inline function 'kotlin.collections.component1' call
3057
+ var keyItem = _destruct__k2r9zo.g4();
3058
+ // Inline function 'kotlin.collections.component2' call
3059
+ var valueItem = _destruct__k2r9zo.h4();
3060
+ keyItem.q2y(builder);
3061
+ if (valueItem == null)
3062
+ null;
3063
+ else {
3064
+ valueItem.q2y(builder);
3065
+ }
3066
+ }
3067
+ builder.z2k(-1);
3068
+ } else {
3069
+ cborEncodeLength(builder, ensureNotNull(this.majorType), this.value.m2());
3070
+ // Inline function 'kotlin.collections.iterator' call
3071
+ var _iterator__ex2g4s_0 = this.value.x2().j1();
3072
+ while (_iterator__ex2g4s_0.k1()) {
3073
+ var _destruct__k2r9zo_0 = _iterator__ex2g4s_0.l1();
3074
+ // Inline function 'kotlin.collections.component1' call
3075
+ var keyItem_0 = _destruct__k2r9zo_0.g4();
3076
+ // Inline function 'kotlin.collections.component2' call
3077
+ var valueItem_0 = _destruct__k2r9zo_0.h4();
3078
+ keyItem_0.q2y(builder);
3079
+ if (valueItem_0 == null)
3080
+ null;
3081
+ else {
3082
+ valueItem_0.q2y(builder);
3083
+ }
3084
+ }
3085
+ }
3086
+ }
3087
+ equals(other) {
3088
+ if (this === other)
3089
+ return true;
3090
+ if (!(other instanceof CborMap))
3091
+ return false;
3092
+ if (!super.equals(other))
3093
+ return false;
3094
+ if (!(this.indefiniteLength === other.indefiniteLength))
3095
+ return false;
3096
+ return true;
3097
+ }
3098
+ hashCode() {
3099
+ var result = super.hashCode();
3100
+ result = imul(31, result) + getBooleanHashCode(this.indefiniteLength) | 0;
3101
+ return result;
3102
+ }
3103
+ toString() {
3104
+ return 'CborMap(value=' + stringify(this.value) + ', indefiniteLength=' + this.indefiniteLength + ')';
3105
+ }
3106
+ }
3107
+ class CborNInt extends AbstractCborInt {
3108
+ constructor(value) {
3109
+ return new.target.j2z(value);
3110
+ }
3111
+ static j2z(value) {
3112
+ return this.j2y(value, nint_getInstance());
3113
+ }
3114
+ c2z() {
3115
+ this.value;
3116
+ }
3117
+ q2y(builder) {
3118
+ cborEncodeLength(builder, ensureNotNull(this.majorType), convertToInt(this.value) - 1 | 0);
3119
+ }
3120
+ }
3121
+ class CborNil extends CborSimple {
3122
+ constructor() {
3123
+ return new.target.y39();
3124
+ }
3125
+ static y39() {
3126
+ var $this = this.q36(null, nil_getInstance());
3127
+ if (!($this.value == null)) {
3128
+ throw IllegalArgumentException.y1('Nil requires value null');
3129
+ }
3130
+ return $this;
3131
+ }
3132
+ toJsonSimple() {
3133
+ return JsonNull_getInstance();
3134
+ }
3135
+ }
3136
+ class CborNull extends CborSimple {
3137
+ constructor() {
3138
+ return new.target.v35();
3139
+ }
3140
+ static v35() {
3141
+ var $this = this.q36(null, Null_getInstance());
3142
+ if (!($this.value == null)) {
3143
+ throw IllegalArgumentException.y1('Nil requires value null');
3144
+ }
3145
+ return $this;
3146
+ }
3147
+ toJsonSimple() {
3148
+ return JsonNull_getInstance();
3149
+ }
3150
+ }
3151
+ class CborStringIndefLength extends CborItem {
3152
+ static g31(value) {
3153
+ return this.z35(value, tstr_indef_length_getInstance());
3154
+ }
3155
+ q2y(builder) {
3156
+ var majorTypeShifted = ensureNotNull(this.majorType).type << 5;
3157
+ builder.z2k(toByte(majorTypeShifted + 31 | 0));
3158
+ // Inline function 'kotlin.collections.forEach' call
3159
+ var _iterator__ex2g4s = this.value.j1();
3160
+ while (_iterator__ex2g4s.k1()) {
3161
+ var element = _iterator__ex2g4s.l1();
3162
+ var encodedStr = encodeToByteArray(element);
3163
+ cborEncodeLength(builder, this.majorType, encodedStr.length);
3164
+ builder.b2l(encodedStr);
3165
+ }
3166
+ builder.z2k(-1);
3167
+ }
3168
+ toJsonSimple() {
3169
+ // Inline function 'kotlin.TODO' call
3170
+ var reason = 'Indef lengt to json not implemented yet';
3171
+ throw NotImplementedError.jd('An operation is not implemented: ' + reason);
3172
+ }
3173
+ }
3174
+ class CborEncoder {}
3175
+ class CborParser {}
3176
+ function parse(bytes, config, $super) {
3177
+ config = config === VOID ? Companion_getInstance_4().g37_1 : config;
3178
+ return $super === VOID ? this.z39(bytes, config) : $super.z39.call(this, bytes, config);
3179
+ }
3180
+ function parseWithOffset(bytes, offset, config, $super) {
3181
+ config = config === VOID ? Companion_getInstance_4().g37_1 : config;
3182
+ return $super === VOID ? this.a3a(bytes, offset, config) : $super.a3a.call(this, bytes, offset, config);
3183
+ }
3184
+ class CborDiagnostics {}
3185
+ function render(item, options, $super) {
3186
+ options = options === VOID ? emptySet() : options;
3187
+ return $super === VOID ? this.b3a(item, options) : $super.b3a.call(this, item, options);
3188
+ }
3189
+ function renderEncoded(encodedItem, options, $super) {
3190
+ options = options === VOID ? emptySet() : options;
3191
+ return $super === VOID ? this.c3a(encodedItem, options) : $super.c3a.call(this, encodedItem, options);
3192
+ }
3193
+ class Companion_6 {
3194
+ constructor() {
3195
+ Companion_instance_7 = this;
3196
+ this.m33_1 = CborFalse.w36();
3197
+ this.n33_1 = CborTrue.t36();
3198
+ this.o33_1 = CborNull.v35();
3199
+ this.p33_1 = CborUndefined.f3a();
3200
+ }
3201
+ }
3202
+ class CborString extends CborItem {
3203
+ constructor(value) {
3204
+ return new.target.t2z(value);
3205
+ }
3206
+ static t2z(value) {
3207
+ return this.z35(value, tstr_getInstance());
3208
+ }
3209
+ q2y(builder) {
3210
+ var encodedValue = encodeToByteArray(this.value);
3211
+ cborEncodeLength(builder, ensureNotNull(this.majorType), encodedValue.length);
3212
+ builder.b2l(encodeToByteArray(this.value));
3213
+ }
3214
+ toJsonSimple() {
3215
+ return JsonPrimitive_1(this.toValue());
3216
+ }
3217
+ equals(other) {
3218
+ if (this === other)
3219
+ return true;
3220
+ if (other == null || !getKClassFromExpression(this).equals(getKClassFromExpression(other)))
3221
+ return false;
3222
+ if (!super.equals(other))
3223
+ return false;
3224
+ return true;
3225
+ }
3226
+ hashCode() {
3227
+ return getStringHashCode(this.value);
3228
+ }
3229
+ toString() {
3230
+ return 'tstr("' + this.value + '")';
3231
+ }
3232
+ }
3233
+ class Companion_7 {
3234
+ constructor() {
3235
+ this.DATE_TIME_STRING = 0;
3236
+ this.DATE_TIME_NUMBER = 1;
3237
+ this.ENCODED_CBOR = 24;
3238
+ this.FULL_DATE_STRING = 1004;
3239
+ }
3240
+ g3a() {
3241
+ return this.DATE_TIME_STRING;
3242
+ }
3243
+ h3a() {
3244
+ return this.DATE_TIME_NUMBER;
3245
+ }
3246
+ i3a() {
3247
+ return this.ENCODED_CBOR;
3248
+ }
3249
+ j3a() {
3250
+ return this.FULL_DATE_STRING;
3251
+ }
3252
+ }
3253
+ class CborTime extends CborTagged {
3254
+ constructor(value) {
3255
+ return new.target.i32(value);
3256
+ }
3257
+ static i32(value) {
3258
+ return this.d37(ensureNotNull(time_getInstance().info), CborUInt.m2z(value));
3259
+ }
3260
+ }
3261
+ class CborUInt extends AbstractCborInt {
3262
+ constructor(value) {
3263
+ return new.target.m2z(value);
3264
+ }
3265
+ static m2z(value) {
3266
+ return this.j2y(value, uint_getInstance());
3267
+ }
3268
+ static fromNumber(value) {
3269
+ return this.m2z(numberToLong(value));
3270
+ }
3271
+ c2z() {
3272
+ // Inline function 'kotlin.Long.compareTo' call
3273
+ var this_0 = this.value;
3274
+ compareTo(this_0, fromInt(0));
3275
+ }
3276
+ q2y(builder) {
3277
+ var tmp = ensureNotNull(this.majorType);
3278
+ // Inline function 'kotlin.toULong' call
3279
+ var this_0 = this.value;
3280
+ var tmp$ret$0 = _ULong___init__impl__c78o9k(this_0);
3281
+ cborEncodeLength_0(builder, tmp, tmp$ret$0);
3282
+ }
3283
+ }
3284
+ class CborUndefined extends CborSimple {
3285
+ constructor() {
3286
+ return new.target.f3a();
3287
+ }
3288
+ static f3a() {
3289
+ var $this = this.q36(Unit_instance, undefined_getInstance());
3290
+ if (!equals($this.value, Unit_instance)) {
3291
+ throw IllegalArgumentException.y1('Undefined requires value Unit');
3292
+ }
3293
+ return $this;
3294
+ }
3295
+ toJsonSimple() {
3296
+ return JsonPrimitive_3(null);
3297
+ }
3298
+ }
3299
+ class LabelType extends Enum {
3300
+ get name() {
3301
+ return this.b1();
3302
+ }
3303
+ get ordinal() {
3304
+ return this.a5();
3305
+ }
3306
+ }
3307
+ class CoseLabeled {
3308
+ constructor(label, value) {
3309
+ this.label = label;
3310
+ this.value = value;
3311
+ }
3312
+ m3a() {
3313
+ return this.label;
3314
+ }
3315
+ h4() {
3316
+ return this.value;
3317
+ }
3318
+ }
3319
+ class Companion_8 {
3320
+ z36(cborItem) {
3321
+ var tmp;
3322
+ if (cborItem instanceof CborUInt) {
3323
+ tmp = NumberLabel.fromInt(convertToInt(cborItem.value));
3324
+ } else {
3325
+ if (cborItem instanceof CborNInt) {
3326
+ tmp = NumberLabel.fromInt(-convertToInt(cborItem.value) | 0);
3327
+ } else {
3328
+ if (cborItem instanceof CborString) {
3329
+ tmp = StringLabel.u39(cborItem.value);
3330
+ } else {
3331
+ if (cborItem instanceof CoseLabel) {
3332
+ tmp = cborItem instanceof CoseLabel ? cborItem : THROW_CCE();
3333
+ } else {
3334
+ throw IllegalStateException.o('Cannot create a label from cbor item with type ' + toString_0(cborItem.cddl));
3335
+ }
3336
+ }
3337
+ }
3338
+ }
3339
+ return tmp;
3340
+ }
3341
+ }
3342
+ class CoseLabel extends CborItem {
3343
+ constructor(value, cddl, type) {
3344
+ return new.target.p3a(value, cddl, type);
3345
+ }
3346
+ static p3a(value, cddl, type) {
3347
+ var $this = this.z35(value, cddl);
3348
+ $this.type = type;
3349
+ return $this;
3350
+ }
3351
+ q3a() {
3352
+ return this.type;
3353
+ }
3354
+ required(map) {
3355
+ // Inline function 'kotlin.collections.containsKey' call
3356
+ var this_0 = map.value;
3357
+ if (!(isInterface(this_0, KtMap) ? this_0 : THROW_CCE()).j4(this)) {
3358
+ throw IllegalArgumentException.y1('Key (label: ' + toString(this.value) + ', type: ' + toString_0(this.cddl) + ') not found in cbor map');
3359
+ }
3360
+ // Inline function 'kotlin.collections.get' call
3361
+ var this_1 = map.value;
3362
+ var tmp = (isInterface(this_1, KtMap) ? this_1 : THROW_CCE()).l4(this);
3363
+ return tmp instanceof CborBaseItem ? tmp : THROW_CCE();
3364
+ }
3365
+ requiredAsCborMap(map) {
3366
+ return this.required(map);
3367
+ }
3368
+ requiredAsCborArray(map) {
3369
+ return this.required(map);
3370
+ }
3371
+ requiredAsListFromCborArray(map) {
3372
+ var tmp = this.requiredAsCborArray(map).value;
3373
+ return isInterface(tmp, KtMutableList) ? tmp : THROW_CCE();
3374
+ }
3375
+ optional(map) {
3376
+ // Inline function 'kotlin.collections.containsKey' call
3377
+ var this_0 = map.value;
3378
+ if (!(isInterface(this_0, KtMap) ? this_0 : THROW_CCE()).j4(this)) {
3379
+ return null;
3380
+ }
3381
+ // Inline function 'kotlin.collections.get' call
3382
+ var this_1 = map.value;
3383
+ var tmp = (isInterface(this_1, KtMap) ? this_1 : THROW_CCE()).l4(this);
3384
+ return tmp instanceof CborBaseItem ? tmp : THROW_CCE();
3385
+ }
3386
+ optionalAsCborMap(map) {
3387
+ return this.optional(map);
3388
+ }
3389
+ optionalAsCborArray(map) {
3390
+ return this.optional(map);
3391
+ }
3392
+ }
3393
+ class NumberLabeledMap {
3394
+ constructor(labeledItems) {
3395
+ var tmp;
3396
+ if (labeledItems === VOID) {
3397
+ // Inline function 'kotlin.collections.mutableMapOf' call
3398
+ var tmp$ret$0 = LinkedHashMap.v5();
3399
+ tmp = CborMap.q34(tmp$ret$0);
3400
+ } else {
3401
+ tmp = labeledItems;
3402
+ }
3403
+ labeledItems = tmp;
3404
+ this.labeledItems = labeledItems;
3405
+ }
3406
+ r3a() {
3407
+ return this.labeledItems;
3408
+ }
3409
+ putLabel(label, cborItem) {
3410
+ if (cborItem == null) {
3411
+ return Unit_instance;
3412
+ }
3413
+ var tmp0 = this.labeledItems.value;
3414
+ // Inline function 'kotlin.collections.set' call
3415
+ var key = NumberLabel.fromInt(label);
3416
+ tmp0.p4(key, cborItem);
3417
+ }
3418
+ requiredLabel(label) {
3419
+ return this.labeledItems.value.l4(NumberLabel.fromInt(label));
3420
+ }
3421
+ optionalLabel(label) {
3422
+ var numberLabel = NumberLabel.fromInt(label);
3423
+ var tmp0_elvis_lhs = this.labeledItems.value.l4(numberLabel);
3424
+ var tmp;
3425
+ if (tmp0_elvis_lhs == null) {
3426
+ return null;
3427
+ } else {
3428
+ tmp = tmp0_elvis_lhs;
3429
+ }
3430
+ var result = tmp;
3431
+ return result;
3432
+ }
3433
+ hasLabel(label) {
3434
+ return this.labeledItems.value.j4(NumberLabel.fromInt(label));
3435
+ }
3436
+ getLabels() {
3437
+ return this.labeledItems.value.m4();
3438
+ }
3439
+ connectLabels() {
3440
+ if (this.labeledItems.value.h1()) {
3441
+ throw IllegalArgumentException.y1('Please implement connectLabels() in a sub class');
3442
+ }
3443
+ return this.labeledItems;
3444
+ }
3445
+ encode() {
3446
+ return this.connectLabels().encodeCbor();
3447
+ }
3448
+ equals(other) {
3449
+ if (this === other)
3450
+ return true;
3451
+ if (!(other instanceof NumberLabeledMap))
3452
+ return false;
3453
+ if (!this.labeledItems.equals(other.labeledItems))
3454
+ return false;
3455
+ return true;
3456
+ }
3457
+ hashCode() {
3458
+ return this.labeledItems.hashCode();
3459
+ }
3460
+ }
3461
+ class DiagnosticOption extends Enum {
3462
+ get name() {
3463
+ return this.b1();
3464
+ }
3465
+ get ordinal() {
3466
+ return this.a5();
3467
+ }
3468
+ }
3469
+ class Companion_9 {
3470
+ constructor() {
3471
+ Companion_instance_10 = this;
3472
+ var tmp = this;
3473
+ var tmp_0 = LazyThreadSafetyMode_PUBLICATION_getInstance();
3474
+ tmp.q35_1 = lazy_0(tmp_0, MajorType$Companion$_anonymous__2dqzk4);
3475
+ }
3476
+ r35(value) {
3477
+ // Inline function 'kotlin.collections.find' call
3478
+ var tmp0 = get_entries();
3479
+ var tmp$ret$1;
3480
+ $l$block: {
3481
+ // Inline function 'kotlin.collections.firstOrNull' call
3482
+ var _iterator__ex2g4s = tmp0.j1();
3483
+ while (_iterator__ex2g4s.k1()) {
3484
+ var element = _iterator__ex2g4s.l1();
3485
+ if (element.type === value) {
3486
+ tmp$ret$1 = element;
3487
+ break $l$block;
3488
+ }
3489
+ }
3490
+ tmp$ret$1 = null;
3491
+ }
3492
+ var tmp0_elvis_lhs = tmp$ret$1;
3493
+ var tmp;
3494
+ if (tmp0_elvis_lhs == null) {
3495
+ throw IllegalArgumentException.y1('Unknown major type with value ' + value);
3496
+ } else {
3497
+ tmp = tmp0_elvis_lhs;
3498
+ }
3499
+ return tmp;
3500
+ }
3501
+ l1l() {
3502
+ return _get_$cachedSerializer__te6jhj_0(this);
3503
+ }
3504
+ k18(typeParamsSerializers) {
3505
+ return this.l1l();
3506
+ }
3507
+ }
3508
+ class MajorType extends Enum {
3509
+ constructor(name, ordinal, type) {
3510
+ super(name, ordinal);
3511
+ this.type = type;
3512
+ }
3513
+ q3a() {
3514
+ return this.type;
3515
+ }
3516
+ get name() {
3517
+ return this.b1();
3518
+ }
3519
+ get ordinal() {
3520
+ return this.a5();
3521
+ }
3522
+ }
3523
+ class Companion_10 {
3524
+ z36(structure) {
3525
+ var generic = Companion_instance_9.z36(structure);
3526
+ // Inline function 'kotlin.require' call
3527
+ if (!(generic instanceof NumberLabel)) {
3528
+ var message = 'Label passed in was not convertable a NumberLabel';
3529
+ throw IllegalArgumentException.y1(toString_0(message));
3530
+ }
3531
+ return generic;
3532
+ }
3533
+ }
3534
+ class NumberLabel extends CoseLabel {
3535
+ constructor(value) {
3536
+ return new.target.w3a(value);
3537
+ }
3538
+ static w3a(value) {
3539
+ return this.p3a(abs(value), value >= 0n ? uint_getInstance() : nint_getInstance(), LabelType_Number_getInstance());
3540
+ }
3541
+ static fromInt(value) {
3542
+ return this.w3a(fromInt(value));
3543
+ }
3544
+ toJsonSimple() {
3545
+ return JsonPrimitive_2(this.toValue());
3546
+ }
3547
+ q2y(builder) {
3548
+ return this.toCborItem().q2y(builder);
3549
+ }
3550
+ toString() {
3551
+ return this.value.toString();
3552
+ }
3553
+ toCborItem() {
3554
+ var tmp;
3555
+ if (equals(this.majorType, MajorType_NEGATIVE_INTEGER_getInstance())) {
3556
+ tmp = CborNInt.j2z(this.value);
3557
+ } else {
3558
+ tmp = CborUInt.m2z(this.value);
3559
+ }
3560
+ return tmp;
3561
+ }
3562
+ }
3563
+ class Companion_11 {
3564
+ z36(structure) {
3565
+ var generic = Companion_instance_9.z36(structure);
3566
+ // Inline function 'kotlin.require' call
3567
+ if (!(generic instanceof StringLabel)) {
3568
+ var message = 'Label passed in was not convertable a StringLabel';
3569
+ throw IllegalArgumentException.y1(toString_0(message));
3570
+ }
3571
+ return generic;
3572
+ }
3573
+ }
3574
+ class StringLabel extends CoseLabel {
3575
+ constructor(value) {
3576
+ return new.target.u39(value);
3577
+ }
3578
+ static u39(value) {
3579
+ return this.p3a(value, tstr_getInstance(), LabelType_String_getInstance());
3580
+ }
3581
+ toJsonSimple() {
3582
+ return JsonPrimitive_1(this.toValue());
3583
+ }
3584
+ q2y(builder) {
3585
+ var encodedValue = encodeToByteArray(this.value);
3586
+ cborEncodeLength(builder, ensureNotNull(this.majorType), encodedValue.length);
3587
+ builder.b2l(encodeToByteArray(this.value));
3588
+ }
3589
+ toString() {
3590
+ return this.value;
3591
+ }
3592
+ toCborItem() {
3593
+ return CborString.t2z(this.value);
3594
+ }
3595
+ }
3596
+ class CborJsonSupport {
3597
+ constructor() {
3598
+ CborJsonSupport_instance = this;
3599
+ var tmp = this;
3600
+ // Inline function 'kotlinx.serialization.modules.SerializersModule' call
3601
+ var builder = new SerializersModuleBuilder();
3602
+ tmp.module = builder.i15();
3603
+ var tmp_0 = this;
3604
+ tmp_0.serializer = Json(VOID, CborJsonSupport$serializer$lambda);
3605
+ }
3606
+ r2q() {
3607
+ return this.module;
3608
+ }
3609
+ s2q() {
3610
+ return this.serializer;
3611
+ }
3612
+ }
3613
+ class HasToJsonString {}
3614
+ class HasToJsonDTO {}
3615
+ class Companion_12 {
3616
+ constructor() {
3617
+ Companion_instance_13 = this;
3618
+ var tmp = this;
3619
+ var tmp_0 = LazyThreadSafetyMode_PUBLICATION_getInstance();
3620
+ tmp.x3a_1 = lazy_0(tmp_0, JsonView$Companion$_anonymous__r3v0im);
3621
+ }
3622
+ l1l() {
3623
+ return _get_$cachedSerializer__te6jhj_1(this);
3624
+ }
3625
+ k18(typeParamsSerializers) {
3626
+ return this.l1l();
3627
+ }
3628
+ }
3629
+ class JsonView {
3630
+ constructor() {
3631
+ Companion_getInstance_13();
3632
+ }
3633
+ toJsonDTO() {
3634
+ return toJsonDTO(this);
3635
+ }
3636
+ static y3a(seen0, serializationConstructorMarker) {
3637
+ Companion_getInstance_13();
3638
+ return createThis(this);
3639
+ }
3640
+ }
3641
+ //endregion
3642
+ var Companion_instance_0;
3643
+ function Companion_getInstance_0() {
3644
+ return Companion_instance_0;
3645
+ }
3646
+ function CDDL$util$entries$delegate$lambda() {
3647
+ // Inline function 'kotlin.arrayOf' call
3648
+ // Inline function 'kotlin.js.unsafeCast' call
3649
+ // Inline function 'kotlin.js.asDynamic' call
3650
+ return [any_getInstance(), uint_getInstance(), int_getInstance(), nint_getInstance(), bstr_getInstance(), bstr_indef_length_getInstance(), bytes_getInstance(), tstr_getInstance(), tstr_indef_length_getInstance(), text_getInstance(), tdate_getInstance(), full_date_getInstance(), time_getInstance(), float_getInstance(), False_getInstance(), True_getInstance(), bool_getInstance(), nil_getInstance(), Null_getInstance(), undefined_getInstance(), float16_getInstance(), float32_getInstance(), float64_getInstance(), map_getInstance(), list_getInstance()];
3651
+ }
3652
+ function CDDL$util$_get_entries_$ref_c77ahj() {
3653
+ return (p0) => p0.entries;
3654
+ }
3655
+ var tstr_instance;
3656
+ function tstr_getInstance() {
3657
+ if (tstr_instance === VOID)
3658
+ new tstr();
3659
+ return tstr_instance;
3660
+ }
3661
+ var uint_instance;
3662
+ function uint_getInstance() {
3663
+ if (uint_instance === VOID)
3664
+ new uint();
3665
+ return uint_instance;
3666
+ }
3667
+ var nint_instance;
3668
+ function nint_getInstance() {
3669
+ if (nint_instance === VOID)
3670
+ new nint();
3671
+ return nint_instance;
3672
+ }
3673
+ var int_instance;
3674
+ function int_getInstance() {
3675
+ if (int_instance === VOID)
3676
+ new int();
3677
+ return int_instance;
3678
+ }
3679
+ var bstr_instance;
3680
+ function bstr_getInstance() {
3681
+ if (bstr_instance === VOID)
3682
+ new bstr();
3683
+ return bstr_instance;
3684
+ }
3685
+ var bstr_indef_length_instance;
3686
+ function bstr_indef_length_getInstance() {
3687
+ if (bstr_indef_length_instance === VOID)
3688
+ new bstr_indef_length();
3689
+ return bstr_indef_length_instance;
3690
+ }
3691
+ var bytes_instance;
3692
+ function bytes_getInstance() {
3693
+ if (bytes_instance === VOID)
3694
+ new bytes();
3695
+ return bytes_instance;
3696
+ }
3697
+ var tstr_indef_length_instance;
3698
+ function tstr_indef_length_getInstance() {
3699
+ if (tstr_indef_length_instance === VOID)
3700
+ new tstr_indef_length();
3701
+ return tstr_indef_length_instance;
3702
+ }
3703
+ var text_instance;
3704
+ function text_getInstance() {
3705
+ if (text_instance === VOID)
3706
+ new text();
3707
+ return text_instance;
3708
+ }
3709
+ var tdate_instance;
3710
+ function tdate_getInstance() {
3711
+ if (tdate_instance === VOID)
3712
+ new tdate();
3713
+ return tdate_instance;
3714
+ }
3715
+ var full_date_instance;
3716
+ function full_date_getInstance() {
3717
+ if (full_date_instance === VOID)
3718
+ new full_date();
3719
+ return full_date_instance;
3720
+ }
3721
+ var time_instance;
3722
+ function time_getInstance() {
3723
+ if (time_instance === VOID)
3724
+ new time();
3725
+ return time_instance;
3726
+ }
3727
+ var float16_instance;
3728
+ function float16_getInstance() {
3729
+ if (float16_instance === VOID)
3730
+ new float16();
3731
+ return float16_instance;
3732
+ }
3733
+ var float32_instance;
3734
+ function float32_getInstance() {
3735
+ if (float32_instance === VOID)
3736
+ new float32();
3737
+ return float32_instance;
3738
+ }
3739
+ var float64_instance;
3740
+ function float64_getInstance() {
3741
+ if (float64_instance === VOID)
3742
+ new float64();
3743
+ return float64_instance;
3744
+ }
3745
+ var float_instance;
3746
+ function float_getInstance() {
3747
+ if (float_instance === VOID)
3748
+ new float();
3749
+ return float_instance;
3750
+ }
3751
+ var False_instance;
3752
+ function False_getInstance() {
3753
+ if (False_instance === VOID)
3754
+ new False();
3755
+ return False_instance;
3756
+ }
3757
+ var True_instance;
3758
+ function True_getInstance() {
3759
+ if (True_instance === VOID)
3760
+ new True();
3761
+ return True_instance;
3762
+ }
3763
+ var bool_instance;
3764
+ function bool_getInstance() {
3765
+ if (bool_instance === VOID)
3766
+ new bool();
3767
+ return bool_instance;
3768
+ }
3769
+ var nil_instance;
3770
+ function nil_getInstance() {
3771
+ if (nil_instance === VOID)
3772
+ new nil();
3773
+ return nil_instance;
3774
+ }
3775
+ var Null_instance;
3776
+ function Null_getInstance() {
3777
+ if (Null_instance === VOID)
3778
+ new Null();
3779
+ return Null_instance;
3780
+ }
3781
+ var undefined_instance;
3782
+ function undefined_getInstance() {
3783
+ if (undefined_instance === VOID)
3784
+ new undefined_0();
3785
+ return undefined_instance;
3786
+ }
3787
+ var map_instance;
3788
+ function map_getInstance() {
3789
+ if (map_instance === VOID)
3790
+ new map();
3791
+ return map_instance;
3792
+ }
3793
+ var list_instance;
3794
+ function list_getInstance() {
3795
+ if (list_instance === VOID)
3796
+ new list();
3797
+ return list_instance;
3798
+ }
3799
+ var any_instance;
3800
+ function any_getInstance() {
3801
+ if (any_instance === VOID)
3802
+ new any();
3803
+ return any_instance;
3804
+ }
3805
+ var util_instance;
3806
+ function util_getInstance() {
3807
+ if (util_instance === VOID)
3808
+ new util();
3809
+ return util_instance;
3810
+ }
3811
+ var Companion_instance_1;
3812
+ function Companion_getInstance_1() {
3813
+ return Companion_instance_1;
3814
+ }
3815
+ var CDDLSerializer_instance;
3816
+ function CDDLSerializer_getInstance() {
3817
+ if (CDDLSerializer_instance === VOID)
3818
+ new CDDLSerializer();
3819
+ return CDDLSerializer_instance;
3820
+ }
3821
+ function _get_$cachedSerializer__te6jhj($this) {
3822
+ return $this.i36_1.h4();
3823
+ }
3824
+ function CborBaseItem$Companion$_anonymous__u5lfyv() {
3825
+ var tmp = getKClass(CborBaseItem);
3826
+ // Inline function 'kotlin.arrayOf' call
3827
+ // Inline function 'kotlin.js.unsafeCast' call
3828
+ // Inline function 'kotlin.js.asDynamic' call
3829
+ var tmp_0 = [];
3830
+ // Inline function 'kotlin.arrayOf' call
3831
+ // Inline function 'kotlin.js.unsafeCast' call
3832
+ // Inline function 'kotlin.js.asDynamic' call
3833
+ var tmp_1 = [];
3834
+ // Inline function 'kotlin.arrayOf' call
3835
+ // Inline function 'kotlin.js.unsafeCast' call
3836
+ // Inline function 'kotlin.js.asDynamic' call
3837
+ var tmp$ret$6 = [];
3838
+ return SealedClassSerializer.lw('com.sphereon.cbor.CborBaseItem', tmp, tmp_0, tmp_1, tmp$ret$6);
3839
+ }
3840
+ var Companion_instance_2;
3841
+ function Companion_getInstance_2() {
3842
+ if (Companion_instance_2 === VOID)
3843
+ new Companion_1();
3844
+ return Companion_instance_2;
3845
+ }
3846
+ var Companion_instance_3;
3847
+ function Companion_getInstance_3() {
3848
+ return Companion_instance_3;
3849
+ }
3850
+ function fromCborItem(value) {
3851
+ return Companion_instance_3.z36(value);
3852
+ }
3853
+ function encodeToCborByteArray(_this__u8e3s4, encoding) {
3854
+ encoding = encoding === VOID ? null : encoding;
3855
+ // Inline function 'kotlin.collections.map' call
3856
+ // Inline function 'kotlin.collections.mapTo' call
3857
+ var destination = ArrayList.j2(_this__u8e3s4.length);
3858
+ var inductionVariable = 0;
3859
+ var last = _this__u8e3s4.length;
3860
+ while (inductionVariable < last) {
3861
+ var item = _this__u8e3s4[inductionVariable];
3862
+ inductionVariable = inductionVariable + 1 | 0;
3863
+ var tmp$ret$2 = toCborByteString_0(item, encoding);
3864
+ destination.k2(tmp$ret$2);
3865
+ }
3866
+ return CborArray.x34(toMutableList(destination));
3867
+ }
3868
+ function encodeToBase64Array(_this__u8e3s4, urlSafe) {
3869
+ urlSafe = urlSafe === VOID ? false : urlSafe;
3870
+ // Inline function 'kotlin.collections.map' call
3871
+ var this_0 = _this__u8e3s4.value;
3872
+ // Inline function 'kotlin.collections.mapTo' call
3873
+ var destination = ArrayList.j2(collectionSizeOrDefault(this_0, 10));
3874
+ var _iterator__ex2g4s = this_0.j1();
3875
+ while (_iterator__ex2g4s.k1()) {
3876
+ var item = _iterator__ex2g4s.l1();
3877
+ var tmp$ret$2 = urlSafe ? item.encodeValueTo(Encoding_BASE64URL_getInstance()) : item.encodeValueTo(Encoding_BASE64_getInstance());
3878
+ destination.k2(tmp$ret$2);
3879
+ }
3880
+ // Inline function 'kotlin.collections.toTypedArray' call
3881
+ return copyToArray(destination);
3882
+ }
3883
+ function encodeToArray(_this__u8e3s4, encoding) {
3884
+ // Inline function 'kotlin.collections.map' call
3885
+ var this_0 = _this__u8e3s4.value;
3886
+ // Inline function 'kotlin.collections.mapTo' call
3887
+ var destination = ArrayList.j2(collectionSizeOrDefault(this_0, 10));
3888
+ var _iterator__ex2g4s = this_0.j1();
3889
+ while (_iterator__ex2g4s.k1()) {
3890
+ var item = _iterator__ex2g4s.l1();
3891
+ var tmp$ret$2 = item.encodeValueTo(encoding);
3892
+ destination.k2(tmp$ret$2);
3893
+ }
3894
+ // Inline function 'kotlin.collections.toTypedArray' call
3895
+ return copyToArray(destination);
3896
+ }
3897
+ function toCborByteString(_this__u8e3s4) {
3898
+ return CborByteString.m30(_this__u8e3s4);
3899
+ }
3900
+ var CborConst_instance;
3901
+ function CborConst_getInstance() {
3902
+ if (CborConst_instance === VOID)
3903
+ new CborConst();
3904
+ return CborConst_instance;
3905
+ }
3906
+ function cborTDateToEpochSeconds(_this__u8e3s4, utils, timeZoneId) {
3907
+ utils = utils === VOID ? Companion_getInstance().a2t_1 : utils;
3908
+ timeZoneId = timeZoneId === VOID ? null : timeZoneId;
3909
+ return toInstant(cborTDateToLocalDateTime(_this__u8e3s4, utils, timeZoneId), utils.timeZone(timeZoneId)).fq_1;
3910
+ }
3911
+ function cborFullDateToEpochSeconds(_this__u8e3s4, utils, timeZoneId) {
3912
+ utils = utils === VOID ? Companion_getInstance().a2t_1 : utils;
3913
+ timeZoneId = timeZoneId === VOID ? null : timeZoneId;
3914
+ return toInstant(cborFullDateToLocalDateTime(_this__u8e3s4, utils, timeZoneId), utils.timeZone(timeZoneId)).fq_1;
3915
+ }
3916
+ function toCborFullDate(_this__u8e3s4, utils, timeZoneId) {
3917
+ utils = utils === VOID ? Companion_getInstance().a2t_1 : utils;
3918
+ timeZoneId = timeZoneId === VOID ? null : timeZoneId;
3919
+ return CborFullDate.a32(toLocalDateTime(_this__u8e3s4, utils, timeZoneId).z1x_1.toString());
3920
+ }
3921
+ function localDateToDateStringISO(_this__u8e3s4, utils, timeZoneId) {
3922
+ utils = utils === VOID ? Companion_getInstance().a2t_1 : utils;
3923
+ timeZoneId = timeZoneId === VOID ? null : timeZoneId;
3924
+ return utils.dateISO(timeZoneId, convertToInt(_this__u8e3s4.toInstant(utils, timeZoneId).fq_1));
3925
+ }
3926
+ function localDateToCborFullDate(_this__u8e3s4) {
3927
+ return toCborFullDate(_this__u8e3s4.toString());
3928
+ }
3929
+ function instantToDateStringISO(_this__u8e3s4, utils, timeZoneId) {
3930
+ utils = utils === VOID ? Companion_getInstance().a2t_1 : utils;
3931
+ timeZoneId = timeZoneId === VOID ? null : timeZoneId;
3932
+ return utils.dateISO(timeZoneId, convertToInt(_this__u8e3s4.fq_1));
3933
+ }
3934
+ function cborTDateToLocalDateTime(_this__u8e3s4, utils, timeZoneId) {
3935
+ utils = utils === VOID ? Companion_getInstance().a2t_1 : utils;
3936
+ timeZoneId = timeZoneId === VOID ? null : timeZoneId;
3937
+ return toLocalDateTime(_this__u8e3s4.value, utils, timeZoneId);
3938
+ }
3939
+ function cborFullDateToLocalDateTime(_this__u8e3s4, utils, timeZoneId) {
3940
+ utils = utils === VOID ? Companion_getInstance().a2t_1 : utils;
3941
+ timeZoneId = timeZoneId === VOID ? null : timeZoneId;
3942
+ return toLocalDateTime(_this__u8e3s4.value, utils, timeZoneId);
3943
+ }
3944
+ function toLocalDateTime(_this__u8e3s4, utils, timeZoneId) {
3945
+ utils = utils === VOID ? Companion_getInstance().a2t_1 : utils;
3946
+ timeZoneId = timeZoneId === VOID ? null : timeZoneId;
3947
+ return toKotlin(utils.dateTime(timeZoneId, convertToInt(Companion_instance.b2t(_this__u8e3s4).toEpochSeconds(timeZoneId))));
3948
+ }
3949
+ var Companion_instance_4;
3950
+ function Companion_getInstance_4() {
3951
+ if (Companion_instance_4 === VOID)
3952
+ new Companion_3();
3953
+ return Companion_instance_4;
3954
+ }
3955
+ function get_DEFAULT() {
3956
+ return Companion_getInstance_4().g37_1;
3957
+ }
3958
+ function get_PERMISSIVE() {
3959
+ return Companion_getInstance_4().h37_1;
3960
+ }
3961
+ function get_STRICT() {
3962
+ return Companion_getInstance_4().i37_1;
3963
+ }
3964
+ var Companion_instance_5;
3965
+ function Companion_getInstance_5() {
3966
+ return Companion_instance_5;
3967
+ }
3968
+ function toData(encoded) {
3969
+ return Companion_instance_5.w37(encoded);
3970
+ }
3971
+ function cborEncodeLength(builder, majorType, length) {
3972
+ // Inline function 'kotlin.toULong' call
3973
+ var tmp$ret$0 = _ULong___init__impl__c78o9k(fromInt(length));
3974
+ return cborEncodeLength_0(builder, majorType, tmp$ret$0);
3975
+ }
3976
+ function cborEncodeLength_0(builder, majorType, length) {
3977
+ // Inline function 'kotlin.toUByte' call
3978
+ var this_0 = majorType.type << 5;
3979
+ var majorTypeShifted = _UByte___init__impl__g9hnc4(toByte(this_0));
3980
+ // Inline function 'kotlin.apply' call
3981
+ // Inline function 'kotlin.ULong.compareTo' call
3982
+ // Inline function 'kotlin.UInt.toULong' call
3983
+ var this_1 = _UInt___init__impl__l7qpdl(24);
3984
+ // Inline function 'kotlin.uintToULong' call
3985
+ // Inline function 'kotlin.uintToLong' call
3986
+ var value = _UInt___get_data__impl__f0vqqw(this_1);
3987
+ var tmp$ret$6 = fromInt(value) & 4294967295n;
3988
+ // Inline function 'kotlin.ULong.compareTo' call
3989
+ var other = _ULong___init__impl__c78o9k(tmp$ret$6);
3990
+ if (ulongCompare(_ULong___get_data__impl__fggpzb(length), _ULong___get_data__impl__fggpzb(other)) < 0) {
3991
+ // Inline function 'kotlin.ULong.toUByte' call
3992
+ // Inline function 'kotlin.toUByte' call
3993
+ var this_2 = _ULong___get_data__impl__fggpzb(length);
3994
+ // Inline function 'kotlin.UByte.or' call
3995
+ var other_0 = _UByte___init__impl__g9hnc4(convertToByte(this_2));
3996
+ var tmp0 = _UByte___get_data__impl__jof9qr(majorTypeShifted);
3997
+ // Inline function 'kotlin.experimental.or' call
3998
+ var other_1 = _UByte___get_data__impl__jof9qr(other_0);
3999
+ var tmp$ret$11 = toByte(tmp0 | other_1);
4000
+ var tmp$ret$10 = _UByte___init__impl__g9hnc4(tmp$ret$11);
4001
+ appendUInt8(builder, tmp$ret$10);
4002
+ } else {
4003
+ // Inline function 'kotlin.ULong.shl' call
4004
+ var this_3 = _ULong___init__impl__c78o9k(1n);
4005
+ // Inline function 'kotlin.ULong.compareTo' call
4006
+ var other_2 = _ULong___init__impl__c78o9k(shiftLeft(_ULong___get_data__impl__fggpzb(this_3), 8));
4007
+ if (ulongCompare(_ULong___get_data__impl__fggpzb(length), _ULong___get_data__impl__fggpzb(other_2)) < 0) {
4008
+ // Inline function 'kotlin.UByte.or' call
4009
+ var other_3 = _UByte___init__impl__g9hnc4(24);
4010
+ var tmp0_0 = _UByte___get_data__impl__jof9qr(majorTypeShifted);
4011
+ // Inline function 'kotlin.experimental.or' call
4012
+ var other_4 = _UByte___get_data__impl__jof9qr(other_3);
4013
+ var tmp$ret$15 = toByte(tmp0_0 | other_4);
4014
+ var tmp$ret$14 = _UByte___init__impl__g9hnc4(tmp$ret$15);
4015
+ var tmp = appendUInt8(builder, tmp$ret$14);
4016
+ // Inline function 'kotlin.ULong.toUByte' call
4017
+ // Inline function 'kotlin.toUByte' call
4018
+ var this_4 = _ULong___get_data__impl__fggpzb(length);
4019
+ var tmp$ret$16 = _UByte___init__impl__g9hnc4(convertToByte(this_4));
4020
+ appendUInt8(tmp, tmp$ret$16);
4021
+ } else {
4022
+ // Inline function 'kotlin.ULong.shl' call
4023
+ var this_5 = _ULong___init__impl__c78o9k(1n);
4024
+ // Inline function 'kotlin.ULong.compareTo' call
4025
+ var other_5 = _ULong___init__impl__c78o9k(shiftLeft(_ULong___get_data__impl__fggpzb(this_5), 16));
4026
+ if (ulongCompare(_ULong___get_data__impl__fggpzb(length), _ULong___get_data__impl__fggpzb(other_5)) < 0) {
4027
+ // Inline function 'kotlin.UByte.or' call
4028
+ var other_6 = _UByte___init__impl__g9hnc4(25);
4029
+ var tmp0_1 = _UByte___get_data__impl__jof9qr(majorTypeShifted);
4030
+ // Inline function 'kotlin.experimental.or' call
4031
+ var other_7 = _UByte___get_data__impl__jof9qr(other_6);
4032
+ var tmp$ret$21 = toByte(tmp0_1 | other_7);
4033
+ var tmp$ret$20 = _UByte___init__impl__g9hnc4(tmp$ret$21);
4034
+ var tmp_0 = appendUInt8(builder, tmp$ret$20);
4035
+ // Inline function 'kotlin.ULong.toUInt' call
4036
+ // Inline function 'kotlin.toUInt' call
4037
+ var this_6 = _ULong___get_data__impl__fggpzb(length);
4038
+ var tmp$ret$22 = _UInt___init__impl__l7qpdl(convertToInt(this_6));
4039
+ appendUInt16(tmp_0, tmp$ret$22);
4040
+ } else {
4041
+ // Inline function 'kotlin.ULong.shl' call
4042
+ var this_7 = _ULong___init__impl__c78o9k(1n);
4043
+ // Inline function 'kotlin.ULong.compareTo' call
4044
+ var other_8 = _ULong___init__impl__c78o9k(shiftLeft(_ULong___get_data__impl__fggpzb(this_7), 32));
4045
+ if (ulongCompare(_ULong___get_data__impl__fggpzb(length), _ULong___get_data__impl__fggpzb(other_8)) < 0) {
4046
+ // Inline function 'kotlin.UByte.or' call
4047
+ var other_9 = _UByte___init__impl__g9hnc4(26);
4048
+ var tmp0_2 = _UByte___get_data__impl__jof9qr(majorTypeShifted);
4049
+ // Inline function 'kotlin.experimental.or' call
4050
+ var other_10 = _UByte___get_data__impl__jof9qr(other_9);
4051
+ var tmp$ret$27 = toByte(tmp0_2 | other_10);
4052
+ var tmp$ret$26 = _UByte___init__impl__g9hnc4(tmp$ret$27);
4053
+ var tmp_1 = appendUInt8(builder, tmp$ret$26);
4054
+ // Inline function 'kotlin.ULong.toUInt' call
4055
+ // Inline function 'kotlin.toUInt' call
4056
+ var this_8 = _ULong___get_data__impl__fggpzb(length);
4057
+ var tmp$ret$28 = _UInt___init__impl__l7qpdl(convertToInt(this_8));
4058
+ appendUInt32(tmp_1, tmp$ret$28);
4059
+ } else {
4060
+ // Inline function 'kotlin.UByte.or' call
4061
+ var other_11 = _UByte___init__impl__g9hnc4(27);
4062
+ var tmp0_3 = _UByte___get_data__impl__jof9qr(majorTypeShifted);
4063
+ // Inline function 'kotlin.experimental.or' call
4064
+ var other_12 = _UByte___get_data__impl__jof9qr(other_11);
4065
+ var tmp$ret$31 = toByte(tmp0_3 | other_12);
4066
+ var tmp$ret$30 = _UByte___init__impl__g9hnc4(tmp$ret$31);
4067
+ appendUInt64(appendUInt8(builder, tmp$ret$30), length);
4068
+ }
4069
+ }
4070
+ }
4071
+ }
4072
+ }
4073
+ var CborError_instance;
4074
+ function CborError_getInstance() {
4075
+ return CborError_instance;
4076
+ }
4077
+ function toCborItem(_this__u8e3s4) {
4078
+ var tmp;
4079
+ if (_this__u8e3s4 instanceof CborItem) {
4080
+ tmp = _this__u8e3s4;
4081
+ } else {
4082
+ if (_this__u8e3s4 instanceof Enum) {
4083
+ tmp = tstr_getInstance().newCborItem(_this__u8e3s4.p1_1);
4084
+ } else {
4085
+ if (!(_this__u8e3s4 == null) ? typeof _this__u8e3s4 === 'string' : false) {
4086
+ tmp = tstr_getInstance().newCborItem(_this__u8e3s4);
4087
+ } else {
4088
+ if (!(_this__u8e3s4 == null) ? isByteArray(_this__u8e3s4) : false) {
4089
+ tmp = bstr_getInstance().newCborItem(_this__u8e3s4);
4090
+ } else {
4091
+ if (!(_this__u8e3s4 == null) ? typeof _this__u8e3s4 === 'boolean' : false) {
4092
+ tmp = bool_getInstance().newCborItem(_this__u8e3s4);
4093
+ } else {
4094
+ if (_this__u8e3s4 instanceof UInt) {
4095
+ var tmp_0 = uint_getInstance();
4096
+ // Inline function 'kotlin.UInt.toLong' call
4097
+ var this_0 = _this__u8e3s4.qs_1;
4098
+ // Inline function 'kotlin.uintToLong' call
4099
+ var value = _UInt___get_data__impl__f0vqqw(this_0);
4100
+ var tmp$ret$0 = fromInt(value) & 4294967295n;
4101
+ tmp = tmp_0.newUint(tmp$ret$0);
4102
+ } else {
4103
+ if (_this__u8e3s4 instanceof ULong) {
4104
+ var tmp_1 = uint_getInstance();
4105
+ // Inline function 'kotlin.ULong.toLong' call
4106
+ var this_1 = _this__u8e3s4.pt_1;
4107
+ var tmp$ret$2 = _ULong___get_data__impl__fggpzb(this_1);
4108
+ tmp = tmp_1.newUint(tmp$ret$2);
4109
+ } else {
4110
+ if (isNumber(_this__u8e3s4)) {
4111
+ tmp = numberToCborItem(_this__u8e3s4);
4112
+ } else {
4113
+ if (!(_this__u8e3s4 == null) ? isInterface(_this__u8e3s4, KtList) : false) {
4114
+ // Inline function 'kotlin.collections.map' call
4115
+ // Inline function 'kotlin.collections.mapTo' call
4116
+ var destination = ArrayList.j2(collectionSizeOrDefault(_this__u8e3s4, 10));
4117
+ var _iterator__ex2g4s = _this__u8e3s4.j1();
4118
+ while (_iterator__ex2g4s.k1()) {
4119
+ var item = _iterator__ex2g4s.l1();
4120
+ var tmp$ret$5 = toCborItem(item);
4121
+ destination.k2(tmp$ret$5);
4122
+ }
4123
+ tmp = CborArray.x34(toMutableList(destination));
4124
+ } else {
4125
+ if (!(_this__u8e3s4 == null) ? isArray(_this__u8e3s4) : false) {
4126
+ // Inline function 'kotlin.collections.map' call
4127
+ // Inline function 'kotlin.collections.mapTo' call
4128
+ var destination_0 = ArrayList.j2(_this__u8e3s4.length);
4129
+ var inductionVariable = 0;
4130
+ var last = _this__u8e3s4.length;
4131
+ while (inductionVariable < last) {
4132
+ var item_0 = _this__u8e3s4[inductionVariable];
4133
+ inductionVariable = inductionVariable + 1 | 0;
4134
+ var tmp$ret$8 = toCborItem(item_0);
4135
+ destination_0.k2(tmp$ret$8);
4136
+ }
4137
+ tmp = CborArray.x34(toMutableList(destination_0));
4138
+ } else {
4139
+ if (!(_this__u8e3s4 == null) ? isInterface(_this__u8e3s4, KtMap) : false) {
4140
+ // Inline function 'kotlin.collections.map' call
4141
+ // Inline function 'kotlin.collections.mapTo' call
4142
+ var destination_1 = ArrayList.j2(_this__u8e3s4.m2());
4143
+ // Inline function 'kotlin.collections.iterator' call
4144
+ var _iterator__ex2g4s_0 = _this__u8e3s4.x2().j1();
4145
+ while (_iterator__ex2g4s_0.k1()) {
4146
+ var item_1 = _iterator__ex2g4s_0.l1();
4147
+ // Inline function 'kotlin.collections.component1' call
4148
+ var k = item_1.g4();
4149
+ // Inline function 'kotlin.collections.component2' call
4150
+ var v = item_1.h4();
4151
+ var tmp$ret$12 = to(Companion_instance_9.z36(toCborItem(k)), toCborItem(v));
4152
+ destination_1.k2(tmp$ret$12);
4153
+ }
4154
+ tmp = CborMap.q34(toMutableMap(toMap(destination_1)));
4155
+ } else {
4156
+ if (_this__u8e3s4 == null) {
4157
+ tmp = CborNull.v35();
4158
+ } else {
4159
+ throw IllegalArgumentException.y1('Value must be a String, ByteArray, Byte, Short, Int, Long, Boolean, Double, Float, Enum, CborItem<*>, List, Array or Map, not ' + getKClassFromExpression(_this__u8e3s4).d1() + ' with value ' + toString_0(_this__u8e3s4));
4160
+ }
4161
+ }
4162
+ }
4163
+ }
4164
+ }
4165
+ }
4166
+ }
4167
+ }
4168
+ }
4169
+ }
4170
+ }
4171
+ }
4172
+ return tmp;
4173
+ }
4174
+ var Companion_instance_6;
4175
+ function Companion_getInstance_6() {
4176
+ return Companion_instance_6;
4177
+ }
4178
+ var $serializer_instance;
4179
+ function $serializer_getInstance() {
4180
+ if ($serializer_instance === VOID)
4181
+ new $serializer();
4182
+ return $serializer_instance;
4183
+ }
4184
+ function isCborItemValueJson(jsonElement) {
4185
+ return Companion_instance_6.d35(jsonElement);
4186
+ }
4187
+ function isCborItemJson(jsonElement) {
4188
+ return Companion_instance_6.w35(jsonElement);
4189
+ }
4190
+ function fromJsonPrimitive(jsonPrimitive, cddl, key) {
4191
+ key = key === VOID ? null : key;
4192
+ return Companion_instance_6.c39(jsonPrimitive, cddl, key);
4193
+ }
4194
+ function fromJsonArray(jsonArray) {
4195
+ return Companion_instance_6.d39(jsonArray);
4196
+ }
4197
+ function fromJsonObjectAsCborItemJson(jsonObject) {
4198
+ return Companion_instance_6.f39(jsonObject);
4199
+ }
4200
+ function fromJsonObjectAsValueJson(jsonObject) {
4201
+ return Companion_instance_6.e39(jsonObject);
4202
+ }
4203
+ function fromDTO(cborItemJson) {
4204
+ return Companion_instance_6.g39(cborItemJson);
4205
+ }
4206
+ function jsonObjectToCborJsonItem(_this__u8e3s4) {
4207
+ return Companion_instance_6.e39(_this__u8e3s4);
4208
+ }
4209
+ function numberToCborItem(_this__u8e3s4) {
4210
+ var tmp;
4211
+ if (typeof _this__u8e3s4 === 'number') {
4212
+ tmp = typeof _this__u8e3s4 === 'number';
4213
+ } else {
4214
+ tmp = false;
4215
+ }
4216
+ var jsLikeNumberSystem = tmp;
4217
+ if (!jsLikeNumberSystem) {
4218
+ var tmp_0;
4219
+ if (typeof _this__u8e3s4 === 'number') {
4220
+ tmp_0 = float_getInstance().newCborItem(_this__u8e3s4);
4221
+ } else {
4222
+ if (typeof _this__u8e3s4 === 'number') {
4223
+ tmp_0 = float64_getInstance().newFloat64(_this__u8e3s4);
4224
+ } else {
4225
+ if (typeof _this__u8e3s4 === 'number') {
4226
+ tmp_0 = int_getInstance().newInt(_this__u8e3s4);
4227
+ } else {
4228
+ if (typeof _this__u8e3s4 === 'number') {
4229
+ tmp_0 = int_getInstance().newInt(_this__u8e3s4);
4230
+ } else {
4231
+ if (typeof _this__u8e3s4 === 'number') {
4232
+ tmp_0 = int_getInstance().newInt(_this__u8e3s4);
4233
+ } else {
4234
+ if (typeof _this__u8e3s4 === 'bigint') {
4235
+ tmp_0 = int_getInstance().newLong(_this__u8e3s4);
4236
+ } else {
4237
+ tmp_0 = float64_getInstance().newFloat64(numberToDouble(_this__u8e3s4));
4238
+ }
4239
+ }
4240
+ }
4241
+ }
4242
+ }
4243
+ }
4244
+ return tmp_0;
4245
+ }
4246
+ var d = _this__u8e3s4;
4247
+ var tmp_1;
4248
+ var tmp_2;
4249
+ var tmp_3;
4250
+ // Inline function 'kotlin.math.floor' call
4251
+ if (!(d === Math.floor(d))) {
4252
+ tmp_3 = true;
4253
+ } else {
4254
+ tmp_3 = isInfinite(d);
4255
+ }
4256
+ if (tmp_3) {
4257
+ tmp_2 = true;
4258
+ } else {
4259
+ tmp_2 = isNaN_0(d);
4260
+ }
4261
+ if (tmp_2) {
4262
+ tmp_1 = float64_getInstance().newFloat64(d);
4263
+ } else {
4264
+ var l = numberToLong(d);
4265
+ var tmp_4;
4266
+ // Inline function 'kotlin.ranges.contains' call
4267
+ var this_0 = numberRangeToNumber(-2147483648, 2147483647);
4268
+ if (contains_0(isInterface(this_0, ClosedRange) ? this_0 : THROW_CCE(), l)) {
4269
+ tmp_4 = int_getInstance().newInt(convertToInt(l));
4270
+ } else {
4271
+ tmp_4 = int_getInstance().newLong(l);
4272
+ }
4273
+ tmp_1 = tmp_4;
4274
+ }
4275
+ return tmp_1;
4276
+ }
4277
+ var Companion_instance_7;
4278
+ function Companion_getInstance_7() {
4279
+ if (Companion_instance_7 === VOID)
4280
+ new Companion_6();
4281
+ return Companion_instance_7;
4282
+ }
4283
+ var HEX_ALPHABET;
4284
+ function toCborByteString_0(_this__u8e3s4, encoding) {
4285
+ encoding = encoding === VOID ? null : encoding;
4286
+ if (encoding === Encoding_HEX_getInstance() || (encoding === null && (_this__u8e3s4.length % 2 | 0) === 0)) {
4287
+ // Inline function 'kotlin.text.filter' call
4288
+ // Inline function 'kotlin.text.filterTo' call
4289
+ var destination = StringBuilder.f1();
4290
+ var inductionVariable = 0;
4291
+ var last = charSequenceLength(_this__u8e3s4);
4292
+ if (inductionVariable < last)
4293
+ do {
4294
+ var index = inductionVariable;
4295
+ inductionVariable = inductionVariable + 1 | 0;
4296
+ var element = charSequenceGet(_this__u8e3s4, index);
4297
+ if (contains(HEX_ALPHABET, element)) {
4298
+ destination.i1(element);
4299
+ }
4300
+ }
4301
+ while (inductionVariable < last);
4302
+ var tmp$ret$0 = destination.toString();
4303
+ if (equals(_this__u8e3s4, tmp$ret$0)) {
4304
+ return CborByteString.m30(hexToByteArray(_this__u8e3s4));
4305
+ }
4306
+ }
4307
+ var tmp;
4308
+ if (encoding === Encoding_BASE64URL_getInstance() || encoding === Encoding_BASE64_getInstance()) {
4309
+ tmp = true;
4310
+ } else {
4311
+ var tmp_0;
4312
+ if (encoding === null) {
4313
+ var tmp_1;
4314
+ // Inline function 'kotlin.text.filter' call
4315
+ // Inline function 'kotlin.text.filterTo' call
4316
+ var destination_0 = StringBuilder.f1();
4317
+ var inductionVariable_0 = 0;
4318
+ var last_0 = charSequenceLength(_this__u8e3s4);
4319
+ if (inductionVariable_0 < last_0)
4320
+ do {
4321
+ var index_0 = inductionVariable_0;
4322
+ inductionVariable_0 = inductionVariable_0 + 1 | 0;
4323
+ var element_0 = charSequenceGet(_this__u8e3s4, index_0);
4324
+ if (contains('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', element_0)) {
4325
+ destination_0.i1(element_0);
4326
+ }
4327
+ }
4328
+ while (inductionVariable_0 < last_0);
4329
+ if (_this__u8e3s4 === destination_0.toString()) {
4330
+ tmp_1 = true;
4331
+ } else {
4332
+ // Inline function 'kotlin.text.filter' call
4333
+ // Inline function 'kotlin.text.filterTo' call
4334
+ var destination_1 = StringBuilder.f1();
4335
+ var inductionVariable_1 = 0;
4336
+ var last_1 = charSequenceLength(_this__u8e3s4);
4337
+ if (inductionVariable_1 < last_1)
4338
+ do {
4339
+ var index_1 = inductionVariable_1;
4340
+ inductionVariable_1 = inductionVariable_1 + 1 | 0;
4341
+ var element_1 = charSequenceGet(_this__u8e3s4, index_1);
4342
+ if (contains('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', element_1)) {
4343
+ destination_1.i1(element_1);
4344
+ }
4345
+ }
4346
+ while (inductionVariable_1 < last_1);
4347
+ tmp_1 = _this__u8e3s4 === destination_1.toString();
4348
+ }
4349
+ tmp_0 = tmp_1;
4350
+ } else {
4351
+ tmp_0 = false;
4352
+ }
4353
+ tmp = tmp_0;
4354
+ }
4355
+ if (tmp) {
4356
+ if (encoding === Encoding_BASE64URL_getInstance() || contains_1(_this__u8e3s4, '-') || contains_1(_this__u8e3s4, '_')) {
4357
+ return CborByteString.m30(decodeFromBase64Url(_this__u8e3s4));
4358
+ }
4359
+ return CborByteString.m30(decodeFromBase64(_this__u8e3s4));
4360
+ }
4361
+ return CborByteString.m30(decodeFrom(_this__u8e3s4, Encoding_UTF8_getInstance()));
4362
+ }
4363
+ function toCborStringArray(_this__u8e3s4) {
4364
+ // Inline function 'kotlin.collections.map' call
4365
+ // Inline function 'kotlin.collections.mapTo' call
4366
+ var destination = ArrayList.j2(_this__u8e3s4.length);
4367
+ var inductionVariable = 0;
4368
+ var last = _this__u8e3s4.length;
4369
+ while (inductionVariable < last) {
4370
+ var item = _this__u8e3s4[inductionVariable];
4371
+ inductionVariable = inductionVariable + 1 | 0;
4372
+ var tmp$ret$2 = toCborString(item);
4373
+ destination.k2(tmp$ret$2);
4374
+ }
4375
+ return CborArray.x34(toMutableList(destination));
4376
+ }
4377
+ function toCborString(_this__u8e3s4) {
4378
+ return CborString.t2z(_this__u8e3s4);
4379
+ }
4380
+ function toStringArray(_this__u8e3s4) {
4381
+ // Inline function 'kotlin.collections.map' call
4382
+ var this_0 = _this__u8e3s4.value;
4383
+ // Inline function 'kotlin.collections.mapTo' call
4384
+ var destination = ArrayList.j2(collectionSizeOrDefault(this_0, 10));
4385
+ var _iterator__ex2g4s = this_0.j1();
4386
+ while (_iterator__ex2g4s.k1()) {
4387
+ var item = _iterator__ex2g4s.l1();
4388
+ var tmp$ret$2 = item.value;
4389
+ destination.k2(tmp$ret$2);
4390
+ }
4391
+ // Inline function 'kotlin.collections.toTypedArray' call
4392
+ return copyToArray(destination);
4393
+ }
4394
+ var Companion_instance_8;
4395
+ function Companion_getInstance_8() {
4396
+ return Companion_instance_8;
4397
+ }
4398
+ var LabelType_String_instance;
4399
+ var LabelType_Number_instance;
4400
+ function values() {
4401
+ return [LabelType_String_getInstance(), LabelType_Number_getInstance()];
4402
+ }
4403
+ function valueOf(value) {
4404
+ switch (value) {
4405
+ case 'String':
4406
+ return LabelType_String_getInstance();
4407
+ case 'Number':
4408
+ return LabelType_Number_getInstance();
4409
+ default:
4410
+ LabelType_initEntries();
4411
+ THROW_IAE('No enum constant com.sphereon.cbor.LabelType.' + value);
4412
+ break;
4413
+ }
4414
+ }
4415
+ var LabelType_entriesInitialized;
4416
+ function LabelType_initEntries() {
4417
+ if (LabelType_entriesInitialized)
4418
+ return Unit_instance;
4419
+ LabelType_entriesInitialized = true;
4420
+ LabelType_String_instance = new LabelType('String', 0);
4421
+ LabelType_Number_instance = new LabelType('Number', 1);
4422
+ }
4423
+ var Companion_instance_9;
4424
+ function Companion_getInstance_9() {
4425
+ return Companion_instance_9;
4426
+ }
4427
+ function fromCborItem_0(cborItem) {
4428
+ return Companion_instance_9.z36(cborItem);
4429
+ }
4430
+ function toNumberLabel(_this__u8e3s4) {
4431
+ return NumberLabel.fromInt(_this__u8e3s4);
4432
+ }
4433
+ function longToNumberLabel(_this__u8e3s4) {
4434
+ return NumberLabel.fromInt(convertToInt(_this__u8e3s4));
4435
+ }
4436
+ function toStringLabel(_this__u8e3s4) {
4437
+ return StringLabel.u39(_this__u8e3s4);
4438
+ }
4439
+ function LabelType_String_getInstance() {
4440
+ LabelType_initEntries();
4441
+ return LabelType_String_instance;
4442
+ }
4443
+ function LabelType_Number_getInstance() {
4444
+ LabelType_initEntries();
4445
+ return LabelType_Number_instance;
4446
+ }
4447
+ var DiagnosticOption_EMBEDDED_CBOR_instance;
4448
+ var DiagnosticOption_PRETTY_PRINT_instance;
4449
+ var DiagnosticOption_BSTR_PRINT_LENGTH_instance;
4450
+ function values_0() {
4451
+ return [DiagnosticOption_EMBEDDED_CBOR_getInstance(), DiagnosticOption_PRETTY_PRINT_getInstance(), DiagnosticOption_BSTR_PRINT_LENGTH_getInstance()];
4452
+ }
4453
+ function valueOf_0(value) {
4454
+ switch (value) {
4455
+ case 'EMBEDDED_CBOR':
4456
+ return DiagnosticOption_EMBEDDED_CBOR_getInstance();
4457
+ case 'PRETTY_PRINT':
4458
+ return DiagnosticOption_PRETTY_PRINT_getInstance();
4459
+ case 'BSTR_PRINT_LENGTH':
4460
+ return DiagnosticOption_BSTR_PRINT_LENGTH_getInstance();
4461
+ default:
4462
+ DiagnosticOption_initEntries();
4463
+ THROW_IAE('No enum constant com.sphereon.cbor.DiagnosticOption.' + value);
4464
+ break;
4465
+ }
4466
+ }
4467
+ var DiagnosticOption_entriesInitialized;
4468
+ function DiagnosticOption_initEntries() {
4469
+ if (DiagnosticOption_entriesInitialized)
4470
+ return Unit_instance;
4471
+ DiagnosticOption_entriesInitialized = true;
4472
+ DiagnosticOption_EMBEDDED_CBOR_instance = new DiagnosticOption('EMBEDDED_CBOR', 0);
4473
+ DiagnosticOption_PRETTY_PRINT_instance = new DiagnosticOption('PRETTY_PRINT', 1);
4474
+ DiagnosticOption_BSTR_PRINT_LENGTH_instance = new DiagnosticOption('BSTR_PRINT_LENGTH', 2);
4475
+ }
4476
+ function DiagnosticOption_EMBEDDED_CBOR_getInstance() {
4477
+ DiagnosticOption_initEntries();
4478
+ return DiagnosticOption_EMBEDDED_CBOR_instance;
4479
+ }
4480
+ function DiagnosticOption_PRETTY_PRINT_getInstance() {
4481
+ DiagnosticOption_initEntries();
4482
+ return DiagnosticOption_PRETTY_PRINT_instance;
4483
+ }
4484
+ function DiagnosticOption_BSTR_PRINT_LENGTH_getInstance() {
4485
+ DiagnosticOption_initEntries();
4486
+ return DiagnosticOption_BSTR_PRINT_LENGTH_instance;
4487
+ }
4488
+ function _get_$cachedSerializer__te6jhj_0($this) {
4489
+ return $this.q35_1.h4();
4490
+ }
4491
+ function MajorType$Companion$_anonymous__2dqzk4() {
4492
+ return createSimpleEnumSerializer('com.sphereon.cbor.MajorType', values_1());
4493
+ }
4494
+ var MajorType_UNSIGNED_INTEGER_instance;
4495
+ var MajorType_NEGATIVE_INTEGER_instance;
4496
+ var MajorType_BYTE_STRING_instance;
4497
+ var MajorType_UNICODE_STRING_instance;
4498
+ var MajorType_ARRAY_instance;
4499
+ var MajorType_MAP_instance;
4500
+ var MajorType_TAG_instance;
4501
+ var MajorType_SPECIAL_instance;
4502
+ var Companion_instance_10;
4503
+ function Companion_getInstance_10() {
4504
+ MajorType_initEntries();
4505
+ if (Companion_instance_10 === VOID)
4506
+ new Companion_9();
4507
+ return Companion_instance_10;
4508
+ }
4509
+ function values_1() {
4510
+ return [MajorType_UNSIGNED_INTEGER_getInstance(), MajorType_NEGATIVE_INTEGER_getInstance(), MajorType_BYTE_STRING_getInstance(), MajorType_UNICODE_STRING_getInstance(), MajorType_ARRAY_getInstance(), MajorType_MAP_getInstance(), MajorType_TAG_getInstance(), MajorType_SPECIAL_getInstance()];
4511
+ }
4512
+ function valueOf_1(value) {
4513
+ switch (value) {
4514
+ case 'UNSIGNED_INTEGER':
4515
+ return MajorType_UNSIGNED_INTEGER_getInstance();
4516
+ case 'NEGATIVE_INTEGER':
4517
+ return MajorType_NEGATIVE_INTEGER_getInstance();
4518
+ case 'BYTE_STRING':
4519
+ return MajorType_BYTE_STRING_getInstance();
4520
+ case 'UNICODE_STRING':
4521
+ return MajorType_UNICODE_STRING_getInstance();
4522
+ case 'ARRAY':
4523
+ return MajorType_ARRAY_getInstance();
4524
+ case 'MAP':
4525
+ return MajorType_MAP_getInstance();
4526
+ case 'TAG':
4527
+ return MajorType_TAG_getInstance();
4528
+ case 'SPECIAL':
4529
+ return MajorType_SPECIAL_getInstance();
4530
+ default:
4531
+ MajorType_initEntries();
4532
+ THROW_IAE('No enum constant com.sphereon.cbor.MajorType.' + value);
4533
+ break;
4534
+ }
4535
+ }
4536
+ function get_entries() {
4537
+ if ($ENTRIES == null)
4538
+ $ENTRIES = enumEntries(values_1());
4539
+ return $ENTRIES;
4540
+ }
4541
+ function fromInt_0(value) {
4542
+ return Companion_getInstance_10().r35(value);
4543
+ }
4544
+ var MajorType_entriesInitialized;
4545
+ function MajorType_initEntries() {
4546
+ if (MajorType_entriesInitialized)
4547
+ return Unit_instance;
4548
+ MajorType_entriesInitialized = true;
4549
+ MajorType_UNSIGNED_INTEGER_instance = new MajorType('UNSIGNED_INTEGER', 0, 0);
4550
+ MajorType_NEGATIVE_INTEGER_instance = new MajorType('NEGATIVE_INTEGER', 1, 1);
4551
+ MajorType_BYTE_STRING_instance = new MajorType('BYTE_STRING', 2, 2);
4552
+ MajorType_UNICODE_STRING_instance = new MajorType('UNICODE_STRING', 3, 3);
4553
+ MajorType_ARRAY_instance = new MajorType('ARRAY', 4, 4);
4554
+ MajorType_MAP_instance = new MajorType('MAP', 5, 5);
4555
+ MajorType_TAG_instance = new MajorType('TAG', 6, 6);
4556
+ MajorType_SPECIAL_instance = new MajorType('SPECIAL', 7, 7);
4557
+ Companion_getInstance_10();
4558
+ }
4559
+ var $ENTRIES;
4560
+ function MajorType_UNSIGNED_INTEGER_getInstance() {
4561
+ MajorType_initEntries();
4562
+ return MajorType_UNSIGNED_INTEGER_instance;
4563
+ }
4564
+ function MajorType_NEGATIVE_INTEGER_getInstance() {
4565
+ MajorType_initEntries();
4566
+ return MajorType_NEGATIVE_INTEGER_instance;
4567
+ }
4568
+ function MajorType_BYTE_STRING_getInstance() {
4569
+ MajorType_initEntries();
4570
+ return MajorType_BYTE_STRING_instance;
4571
+ }
4572
+ function MajorType_UNICODE_STRING_getInstance() {
4573
+ MajorType_initEntries();
4574
+ return MajorType_UNICODE_STRING_instance;
4575
+ }
4576
+ function MajorType_ARRAY_getInstance() {
4577
+ MajorType_initEntries();
4578
+ return MajorType_ARRAY_instance;
4579
+ }
4580
+ function MajorType_MAP_getInstance() {
4581
+ MajorType_initEntries();
4582
+ return MajorType_MAP_instance;
4583
+ }
4584
+ function MajorType_TAG_getInstance() {
4585
+ MajorType_initEntries();
4586
+ return MajorType_TAG_instance;
4587
+ }
4588
+ function MajorType_SPECIAL_getInstance() {
4589
+ MajorType_initEntries();
4590
+ return MajorType_SPECIAL_instance;
4591
+ }
4592
+ var Companion_instance_11;
4593
+ function Companion_getInstance_11() {
4594
+ return Companion_instance_11;
4595
+ }
4596
+ function fromCborItem_1(structure) {
4597
+ return Companion_instance_11.z36(structure);
4598
+ }
4599
+ var Companion_instance_12;
4600
+ function Companion_getInstance_12() {
4601
+ return Companion_instance_12;
4602
+ }
4603
+ function fromCborItem_2(structure) {
4604
+ return Companion_instance_12.z36(structure);
4605
+ }
4606
+ function get_cborJsonSerializer() {
4607
+ _init_properties_CborJsonSerialization_kt__uyoa38();
4608
+ return cborJsonSerializer;
4609
+ }
4610
+ var cborJsonSerializer;
4611
+ function CborJsonSupport$serializer$lambda($this$Json) {
4612
+ $this$Json.f1k_1 = CborJsonSupport_getInstance().module;
4613
+ return Unit_instance;
4614
+ }
4615
+ var CborJsonSupport_instance;
4616
+ function CborJsonSupport_getInstance() {
4617
+ if (CborJsonSupport_instance === VOID)
4618
+ new CborJsonSupport();
4619
+ return CborJsonSupport_instance;
4620
+ }
4621
+ var properties_initialized_CborJsonSerialization_kt_i0f4vq;
4622
+ function _init_properties_CborJsonSerialization_kt__uyoa38() {
4623
+ if (!properties_initialized_CborJsonSerialization_kt_i0f4vq) {
4624
+ properties_initialized_CborJsonSerialization_kt_i0f4vq = true;
4625
+ cborJsonSerializer = CborJsonSupport_getInstance().serializer;
4626
+ }
4627
+ }
4628
+ function _get_$cachedSerializer__te6jhj_1($this) {
4629
+ return $this.x3a_1.h4();
4630
+ }
4631
+ function JsonView$Companion$_anonymous__r3v0im() {
4632
+ var tmp = getKClass(JsonView);
4633
+ // Inline function 'kotlin.arrayOf' call
4634
+ // Inline function 'kotlin.js.unsafeCast' call
4635
+ // Inline function 'kotlin.js.asDynamic' call
4636
+ var tmp$ret$0 = [];
4637
+ return PolymorphicSerializer.xv(tmp, tmp$ret$0);
4638
+ }
4639
+ var Companion_instance_13;
4640
+ function Companion_getInstance_13() {
4641
+ if (Companion_instance_13 === VOID)
4642
+ new Companion_12();
4643
+ return Companion_instance_13;
4644
+ }
4645
+ function toJsonDTO(subject) {
4646
+ return JSON.parse(subject.toJsonString());
4647
+ }
4648
+ //region block: post-declaration
4649
+ initMetadataForInterface(HasCborJsonRepresentation, 'HasCborJsonRepresentation');
4650
+ initMetadataForClass(CborBaseItem, 'CborBaseItem', VOID, VOID, VOID, VOID, VOID, {0: Companion_getInstance_2});
4651
+ protoOf(CborItem).toJson = toJson;
4652
+ initMetadataForClass(CborItem, 'CborItem', VOID, VOID, [HasCborJsonRepresentation]);
4653
+ initMetadataForClass(CborNumber, 'CborNumber');
4654
+ initMetadataForClass(AbstractCborInt, 'AbstractCborInt');
4655
+ initMetadataForClass(CborInt, 'CborInt');
4656
+ initMetadataForCompanion(Companion, VOID, [SerializerFactory]);
4657
+ initMetadataForInterface(CDDLType, 'CDDLType', VOID, VOID, VOID, VOID, VOID, {0: CDDLSerializer_getInstance});
4658
+ protoOf(CDDL).newCborItemFromJson = newCborItemFromJson;
4659
+ protoOf(CDDL).toTag = toTag;
4660
+ initMetadataForClass(CDDL, 'CDDL', VOID, VOID, [CDDLType], VOID, VOID, {0: CDDLSerializer_getInstance});
4661
+ initMetadataForObject(tstr, 'tstr');
4662
+ initMetadataForObject(uint, 'uint', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4663
+ initMetadataForObject(nint, 'nint', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4664
+ initMetadataForObject(int, 'int', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4665
+ initMetadataForObject(bstr, 'bstr', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4666
+ initMetadataForObject(bstr_indef_length, 'bstr_indef_length', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4667
+ initMetadataForObject(bytes, 'bytes', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4668
+ initMetadataForObject(tstr_indef_length, 'tstr_indef_length', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4669
+ initMetadataForObject(text, 'text', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4670
+ initMetadataForObject(tdate, 'tdate', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4671
+ initMetadataForObject(full_date, 'full_date', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4672
+ initMetadataForObject(time, 'time', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4673
+ initMetadataForObject(float16, 'float16', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4674
+ initMetadataForObject(float32, 'float32', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4675
+ initMetadataForObject(float64, 'float64', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4676
+ initMetadataForObject(float, 'float', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4677
+ initMetadataForObject(False, 'False', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4678
+ initMetadataForObject(True, 'True', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4679
+ initMetadataForObject(bool, 'bool', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4680
+ initMetadataForObject(nil, 'nil', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4681
+ initMetadataForObject(Null, 'Null', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4682
+ initMetadataForObject(undefined_0, 'undefined', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4683
+ initMetadataForObject(map, 'map', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4684
+ initMetadataForObject(list, 'list', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4685
+ initMetadataForObject(any, 'any', VOID, VOID, [SerializerFactory], VOID, VOID, {0: CDDLSerializer_getInstance});
4686
+ initMetadataForObject(util, 'util');
4687
+ initMetadataForCompanion(Companion_0);
4688
+ initMetadataForObject(CDDLSerializer, 'CDDLSerializer', VOID, VOID, [KSerializer]);
4689
+ initMetadataForClass(CborAny, 'CborAny');
4690
+ initMetadataForInterface(ICborItemValueJson, 'ICborItemValueJson');
4691
+ initMetadataForClass(CborArray$toJsonCborItem$1, VOID, VOID, VOID, [ICborItemValueJson]);
4692
+ initMetadataForClass(CborCollectionItem, 'CborCollectionItem');
4693
+ initMetadataForClass(CborArray, 'CborArray', CborArray.x34);
4694
+ initMetadataForCompanion(Companion_1, VOID, [SerializerFactory]);
4695
+ initMetadataForClass(CborSimple, 'CborSimple');
4696
+ initMetadataForClass(CborBool, 'CborBool');
4697
+ initMetadataForClass(CborTrue, 'CborTrue', CborTrue.t36);
4698
+ initMetadataForClass(CborFalse, 'CborFalse', CborFalse.w36);
4699
+ initMetadataForClass(CborBuilder, 'CborBuilder');
4700
+ initMetadataForCompanion(Companion_2);
4701
+ initMetadataForClass(CborByteString, 'CborByteString');
4702
+ initMetadataForClass(CborByteStringIndefLength, 'CborByteStringIndefLength');
4703
+ initMetadataForObject(CborConst, 'CborConst');
4704
+ initMetadataForClass(CborTagged, 'CborTagged');
4705
+ initMetadataForClass(CborTDate, 'CborTDate');
4706
+ initMetadataForClass(CborFullDate, 'CborFullDate');
4707
+ initMetadataForCompanion(Companion_3);
4708
+ initMetadataForClass(CborDecoderConfig, 'CborDecoderConfig', CborDecoderConfig);
4709
+ initMetadataForClass(CborHexEncodedItem, 'CborHexEncodedItem');
4710
+ initMetadataForCompanion(Companion_4);
4711
+ initMetadataForClass(CborEncodedItem, 'CborEncodedItem');
4712
+ initMetadataForObject(CborError, 'CborError');
4713
+ initMetadataForClass(CborFloat, 'CborFloat');
4714
+ initMetadataForClass(CborFloat16, 'CborFloat16');
4715
+ initMetadataForClass(CborFloat32, 'CborFloat32');
4716
+ initMetadataForClass(CborDouble, 'CborDouble');
4717
+ initMetadataForClass(CborItem$toJsonCborItem$1, VOID, VOID, VOID, [ICborItemValueJson]);
4718
+ initMetadataForInterface(ICborItemJson, 'ICborItemJson', VOID, VOID, [ICborItemValueJson]);
4719
+ initMetadataForClass(CborItemJson$Companion$fromJsonPrimitive$1, VOID, VOID, VOID, [ICborItemValueJson]);
4720
+ initMetadataForClass(CborItemJson$Companion$fromJsonObjectAsValueJson$1, VOID, VOID, VOID, [ICborItemJson]);
4721
+ initMetadataForClass(CborItemJson$Companion$fromJsonObjectAsValueJson$2, VOID, VOID, VOID, [ICborItemValueJson]);
4722
+ initMetadataForCompanion(Companion_5);
4723
+ protoOf($serializer).z17 = typeParametersSerializers;
4724
+ initMetadataForObject($serializer, '$serializer', VOID, VOID, [GeneratedSerializer]);
4725
+ protoOf(CborItemJson).toJson = toJson;
4726
+ initMetadataForClass(CborItemJson, 'CborItemJson', VOID, VOID, [HasCborJsonRepresentation, ICborItemJson], VOID, VOID, {0: $serializer_getInstance});
4727
+ initMetadataForClass(SimpleCborBuilder, 'SimpleCborBuilder');
4728
+ initMetadataForClass(CborMap$toJsonCborItem$1, VOID, VOID, VOID, [ICborItemValueJson]);
4729
+ initMetadataForClass(CborMap, 'CborMap', CborMap.q34);
4730
+ initMetadataForClass(CborNInt, 'CborNInt');
4731
+ initMetadataForClass(CborNil, 'CborNil', CborNil.y39);
4732
+ initMetadataForClass(CborNull, 'CborNull', CborNull.v35);
4733
+ initMetadataForClass(CborStringIndefLength, 'CborStringIndefLength');
4734
+ initMetadataForInterface(CborEncoder, 'CborEncoder');
4735
+ initMetadataForInterface(CborParser, 'CborParser');
4736
+ initMetadataForInterface(CborDiagnostics, 'CborDiagnostics');
4737
+ initMetadataForCompanion(Companion_6);
4738
+ initMetadataForClass(CborString, 'CborString');
4739
+ initMetadataForCompanion(Companion_7);
4740
+ initMetadataForClass(CborTime, 'CborTime');
4741
+ initMetadataForClass(CborUInt, 'CborUInt');
4742
+ initMetadataForClass(CborUndefined, 'CborUndefined', CborUndefined.f3a);
4743
+ initMetadataForClass(LabelType, 'LabelType');
4744
+ initMetadataForClass(CoseLabeled, 'CoseLabeled');
4745
+ initMetadataForCompanion(Companion_8);
4746
+ initMetadataForClass(CoseLabel, 'CoseLabel');
4747
+ initMetadataForClass(NumberLabeledMap, 'NumberLabeledMap', NumberLabeledMap);
4748
+ initMetadataForClass(DiagnosticOption, 'DiagnosticOption');
4749
+ initMetadataForCompanion(Companion_9, VOID, [SerializerFactory]);
4750
+ initMetadataForClass(MajorType, 'MajorType', VOID, VOID, VOID, VOID, VOID, {0: Companion_getInstance_10});
4751
+ initMetadataForCompanion(Companion_10);
4752
+ initMetadataForClass(NumberLabel, 'NumberLabel');
4753
+ initMetadataForCompanion(Companion_11);
4754
+ initMetadataForClass(StringLabel, 'StringLabel');
4755
+ initMetadataForObject(CborJsonSupport, 'CborJsonSupport');
4756
+ initMetadataForInterface(HasToJsonString, 'HasToJsonString');
4757
+ initMetadataForInterface(HasToJsonDTO, 'HasToJsonDTO');
4758
+ initMetadataForCompanion(Companion_12, VOID, [SerializerFactory]);
4759
+ initMetadataForClass(JsonView, 'JsonView', VOID, VOID, [HasToJsonString, HasToJsonDTO], VOID, VOID, {0: Companion_getInstance_13});
4760
+ //endregion
4761
+ //region block: init
4762
+ Companion_instance_0 = new Companion();
4763
+ Companion_instance_1 = new Companion_0();
4764
+ Companion_instance_3 = new Companion_2();
4765
+ Companion_instance_5 = new Companion_4();
4766
+ CborError_instance = new CborError();
4767
+ Companion_instance_6 = new Companion_5();
4768
+ HEX_ALPHABET = '0123456789abcdefABCDEF';
4769
+ Companion_instance_8 = new Companion_7();
4770
+ Companion_instance_9 = new Companion_8();
4771
+ Companion_instance_11 = new Companion_10();
4772
+ Companion_instance_12 = new Companion_11();
4773
+ //endregion
4774
+ //region block: exports
4775
+ defineProp(CDDL, 'tstr', tstr_getInstance, VOID, true);
4776
+ defineProp(CDDL, 'uint', uint_getInstance, VOID, true);
4777
+ defineProp(CDDL, 'nint', nint_getInstance, VOID, true);
4778
+ defineProp(CDDL, 'int', int_getInstance, VOID, true);
4779
+ defineProp(CDDL, 'bstr', bstr_getInstance, VOID, true);
4780
+ defineProp(CDDL, 'bstr_indef_length', bstr_indef_length_getInstance, VOID, true);
4781
+ defineProp(CDDL, 'bytes', bytes_getInstance, VOID, true);
4782
+ defineProp(CDDL, 'tstr_indef_length', tstr_indef_length_getInstance, VOID, true);
4783
+ defineProp(CDDL, 'text', text_getInstance, VOID, true);
4784
+ defineProp(CDDL, 'tdate', tdate_getInstance, VOID, true);
4785
+ defineProp(CDDL, 'full_date', full_date_getInstance, VOID, true);
4786
+ defineProp(CDDL, 'time', time_getInstance, VOID, true);
4787
+ defineProp(CDDL, 'float16', float16_getInstance, VOID, true);
4788
+ defineProp(CDDL, 'float32', float32_getInstance, VOID, true);
4789
+ defineProp(CDDL, 'float64', float64_getInstance, VOID, true);
4790
+ defineProp(CDDL, 'float', float_getInstance, VOID, true);
4791
+ defineProp(CDDL, 'False', False_getInstance, VOID, true);
4792
+ defineProp(CDDL, 'True', True_getInstance, VOID, true);
4793
+ defineProp(CDDL, 'bool', bool_getInstance, VOID, true);
4794
+ defineProp(CDDL, 'nil', nil_getInstance, VOID, true);
4795
+ defineProp(CDDL, 'Null', Null_getInstance, VOID, true);
4796
+ defineProp(CDDL, 'undefined', undefined_getInstance, VOID, true);
4797
+ defineProp(CDDL, 'map', map_getInstance, VOID, true);
4798
+ defineProp(CDDL, 'list', list_getInstance, VOID, true);
4799
+ defineProp(CDDL, 'any', any_getInstance, VOID, true);
4800
+ defineProp(CDDL, 'util', util_getInstance, VOID, true);
4801
+ CborByteString.fromCborItem = fromCborItem;
4802
+ defineProp(CborByteString, 'Companion', Companion_getInstance_3, VOID, true);
4803
+ defineProp(CborDecoderConfig, 'DEFAULT', get_DEFAULT, VOID, true);
4804
+ defineProp(CborDecoderConfig, 'PERMISSIVE', get_PERMISSIVE, VOID, true);
4805
+ defineProp(CborDecoderConfig, 'STRICT', get_STRICT, VOID, true);
4806
+ defineProp(CborDecoderConfig, 'Companion', Companion_getInstance_4, VOID, true);
4807
+ CborEncodedItem.toData = toData;
4808
+ defineProp(CborEncodedItem, 'Companion', Companion_getInstance_5, VOID, true);
4809
+ var CborError_0 = {getInstance: CborError_getInstance};
4810
+ CborItemJson.isCborItemValueJson = isCborItemValueJson;
4811
+ CborItemJson.isCborItemJson = isCborItemJson;
4812
+ CborItemJson.fromJsonPrimitive = fromJsonPrimitive;
4813
+ CborItemJson.fromJsonArray = fromJsonArray;
4814
+ CborItemJson.fromJsonObjectAsCborItemJson = fromJsonObjectAsCborItemJson;
4815
+ CborItemJson.fromJsonObjectAsValueJson = fromJsonObjectAsValueJson;
4816
+ CborItemJson.fromDTO = fromDTO;
4817
+ defineProp(CborItemJson, 'Companion', Companion_getInstance_6, VOID, true);
4818
+ defineProp(CborTagged, 'Companion', Companion_getInstance_8, VOID, true);
4819
+ LabelType.values = values;
4820
+ LabelType.valueOf = valueOf;
4821
+ defineProp(LabelType, 'String', LabelType_String_getInstance, VOID, true);
4822
+ defineProp(LabelType, 'Number', LabelType_Number_getInstance, VOID, true);
4823
+ CoseLabel.fromCborItem = fromCborItem_0;
4824
+ defineProp(CoseLabel, 'Companion', Companion_getInstance_9, VOID, true);
4825
+ DiagnosticOption.values = values_0;
4826
+ DiagnosticOption.valueOf = valueOf_0;
4827
+ defineProp(DiagnosticOption, 'EMBEDDED_CBOR', DiagnosticOption_EMBEDDED_CBOR_getInstance, VOID, true);
4828
+ defineProp(DiagnosticOption, 'PRETTY_PRINT', DiagnosticOption_PRETTY_PRINT_getInstance, VOID, true);
4829
+ defineProp(DiagnosticOption, 'BSTR_PRINT_LENGTH', DiagnosticOption_BSTR_PRINT_LENGTH_getInstance, VOID, true);
4830
+ MajorType.values = values_1;
4831
+ MajorType.valueOf = valueOf_1;
4832
+ MajorType.fromInt = fromInt_0;
4833
+ defineProp(MajorType, 'UNSIGNED_INTEGER', MajorType_UNSIGNED_INTEGER_getInstance, VOID, true);
4834
+ defineProp(MajorType, 'NEGATIVE_INTEGER', MajorType_NEGATIVE_INTEGER_getInstance, VOID, true);
4835
+ defineProp(MajorType, 'BYTE_STRING', MajorType_BYTE_STRING_getInstance, VOID, true);
4836
+ defineProp(MajorType, 'UNICODE_STRING', MajorType_UNICODE_STRING_getInstance, VOID, true);
4837
+ defineProp(MajorType, 'ARRAY', MajorType_ARRAY_getInstance, VOID, true);
4838
+ defineProp(MajorType, 'MAP', MajorType_MAP_getInstance, VOID, true);
4839
+ defineProp(MajorType, 'TAG', MajorType_TAG_getInstance, VOID, true);
4840
+ defineProp(MajorType, 'SPECIAL', MajorType_SPECIAL_getInstance, VOID, true);
4841
+ defineProp(MajorType, 'Companion', Companion_getInstance_10, VOID, true);
4842
+ NumberLabel.fromCborItem = fromCborItem_1;
4843
+ defineProp(NumberLabel, 'Companion', Companion_getInstance_11, VOID, true);
4844
+ StringLabel.fromCborItem = fromCborItem_2;
4845
+ defineProp(StringLabel, 'Companion', Companion_getInstance_12, VOID, true);
4846
+ var cborJsonSerializer_0 = {get: get_cborJsonSerializer};
4847
+ var CborJsonSupport_0 = {getInstance: CborJsonSupport_getInstance};
4848
+ export {
4849
+ AbstractCborInt as AbstractCborInt,
4850
+ CborInt as CborInt,
4851
+ CDDL as CDDL,
4852
+ CborAny as CborAny,
4853
+ CborArray as CborArray,
4854
+ CborBaseItem as CborBaseItem,
4855
+ CborBool as CborBool,
4856
+ CborTrue as CborTrue,
4857
+ CborFalse as CborFalse,
4858
+ CborBuilder as CborBuilder,
4859
+ CborByteString as CborByteString,
4860
+ CborTDate as CborTDate,
4861
+ CborFullDate as CborFullDate,
4862
+ cborTDateToEpochSeconds as cborTDateToEpochSeconds,
4863
+ cborFullDateToEpochSeconds as cborFullDateToEpochSeconds,
4864
+ toCborFullDate as toCborFullDate,
4865
+ localDateToDateStringISO as localDateToDateStringISO,
4866
+ localDateToCborFullDate as localDateToCborFullDate,
4867
+ CborDecoderConfig as CborDecoderConfig,
4868
+ CborHexEncodedItem as CborHexEncodedItem,
4869
+ CborEncodedItem as CborEncodedItem,
4870
+ CborError_0 as CborError,
4871
+ CborFloat as CborFloat,
4872
+ CborFloat16 as CborFloat16,
4873
+ CborFloat32 as CborFloat32,
4874
+ CborDouble as CborDouble,
4875
+ CborItem as CborItem,
4876
+ CborCollectionItem as CborCollectionItem,
4877
+ toCborItem as toCborItem,
4878
+ CborItemJson as CborItemJson,
4879
+ jsonObjectToCborJsonItem as jsonObjectToCborJsonItem,
4880
+ SimpleCborBuilder as SimpleCborBuilder,
4881
+ CborMap as CborMap,
4882
+ CborNInt as CborNInt,
4883
+ CborNil as CborNil,
4884
+ CborNull as CborNull,
4885
+ CborString as CborString,
4886
+ CborTagged as CborTagged,
4887
+ CborTime as CborTime,
4888
+ CborUInt as CborUInt,
4889
+ CborUndefined as CborUndefined,
4890
+ LabelType as LabelType,
4891
+ CoseLabeled as CoseLabeled,
4892
+ CoseLabel as CoseLabel,
4893
+ NumberLabeledMap as NumberLabeledMap,
4894
+ toNumberLabel as toNumberLabel,
4895
+ longToNumberLabel as longToNumberLabel,
4896
+ toStringLabel as toStringLabel,
4897
+ DiagnosticOption as DiagnosticOption,
4898
+ MajorType as MajorType,
4899
+ NumberLabel as NumberLabel,
4900
+ StringLabel as StringLabel,
4901
+ cborJsonSerializer_0 as cborJsonSerializer,
4902
+ CborJsonSupport_0 as CborJsonSupport,
4903
+ JsonView as JsonView,
4904
+ toJsonDTO as toJsonDTO,
4905
+ };
4906
+ export {
4907
+ HasToJsonDTO as HasToJsonDTO2q70g1p41k4p9,
4908
+ HasToJsonString as HasToJsonString3asrh3f8vd9cb,
4909
+ JsonView as JsonView3q3pdhdhrhyhz,
4910
+ toJsonDTO as toJsonDTO3f19kxx7jwojk,
4911
+ CborArray as CborArray32s40dj5blqyh,
4912
+ CborByteString as CborByteString1vx2dm89vgsji,
4913
+ CborEncodedItem as CborEncodedItem2rmdcmuwxeyxs,
4914
+ CborNumber as CborNumber25ne8cwymvwir,
4915
+ CborString as CborString2zb00032a50c8,
4916
+ CborUInt as CborUInt2sjifbi7c98qb,
4917
+ NumberLabel as NumberLabel2hxmtk9n3k5ox,
4918
+ encodeToArray as encodeToArray3p2jcnpyti43k,
4919
+ encodeToBase64Array as encodeToBase64Array17sgt230vtvqz,
4920
+ encodeToCborByteArray as encodeToCborByteArray2lgqrb64maepg,
4921
+ instantToDateStringISO as instantToDateStringISO208d56fskqdtz,
4922
+ toCborByteString_0 as toCborByteString1qlosmsyjdgwm,
4923
+ toCborByteString as toCborByteString2pnueicmkk3nc,
4924
+ toCborStringArray as toCborStringArrayewahvl9jnzdi,
4925
+ toCborString as toCborString3lr1tzcpfvoxf,
4926
+ toStringArray as toStringArrayiecophari9b3,
4927
+ };
4928
+ //endregion
4929
+
4930
+ //# sourceMappingURL=idk-lib-cbor-public.mjs.map