@attocash/cli 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/README.md +157 -5
  2. package/dist/application/app.d.ts +34 -3
  3. package/dist/application/app.js +142 -125
  4. package/dist/application/operations.d.ts +3 -0
  5. package/dist/application/operations.js +30 -8
  6. package/dist/cli/cli.d.ts +1 -0
  7. package/dist/cli/cli.js +101 -13
  8. package/dist/cli/onboarding.d.ts +13 -0
  9. package/dist/cli/onboarding.js +99 -2
  10. package/dist/cli/output.js +18 -2
  11. package/dist/doctor/profile.js +2 -1
  12. package/dist/internal-marketplace.d.ts +25 -0
  13. package/dist/internal-marketplace.js +50 -0
  14. package/dist/marketplace/approval-files.d.ts +3 -0
  15. package/dist/marketplace/approval-files.js +97 -0
  16. package/dist/marketplace/approval-preview.d.ts +2 -0
  17. package/dist/marketplace/approval-preview.js +86 -0
  18. package/dist/marketplace/proof-approval.d.ts +82 -0
  19. package/dist/marketplace/proof-approval.js +671 -0
  20. package/dist/marketplace/topups.d.ts +82 -0
  21. package/dist/marketplace/topups.js +485 -0
  22. package/dist/network/batching.d.ts +2 -0
  23. package/dist/network/batching.js +23 -0
  24. package/dist/network/entry.d.ts +2 -0
  25. package/dist/network/entry.js +35 -0
  26. package/dist/network/reader.d.ts +2 -0
  27. package/dist/network/reader.js +125 -37
  28. package/dist/spending/approval.d.ts +35 -0
  29. package/dist/spending/approval.js +25 -0
  30. package/dist/spending/atto-x402.d.ts +31 -0
  31. package/dist/spending/atto-x402.js +174 -0
  32. package/dist/spending/ledger.d.ts +74 -2
  33. package/dist/spending/ledger.js +298 -7
  34. package/dist/spending/payments.d.ts +105 -5
  35. package/dist/spending/payments.js +795 -11
  36. package/dist/storage/recovery-seed.d.ts +13 -0
  37. package/dist/storage/recovery-seed.js +93 -0
  38. package/dist/storage/state.d.ts +4 -0
  39. package/dist/storage/state.js +32 -2
  40. package/dist/wallet/receive.d.ts +39 -0
  41. package/dist/wallet/receive.js +264 -0
  42. package/dist/wallet/signing.d.ts +1 -0
  43. package/dist/wallet/signing.js +37 -21
  44. package/dist/wallet/types.d.ts +1 -0
  45. package/node_modules/@attocash/commons-core/Kotlin-DateTime-library-kotlinx-datetime.mjs +1922 -1918
  46. package/node_modules/@attocash/commons-core/Kotlin-DateTime-library-kotlinx-datetime.mjs.map +1 -1
  47. package/node_modules/@attocash/commons-core/README.md +9 -0
  48. package/node_modules/@attocash/commons-core/commons-commons-core.d.mts +10 -0
  49. package/node_modules/@attocash/commons-core/commons-commons-core.mjs +2543 -2434
  50. package/node_modules/@attocash/commons-core/commons-commons-core.mjs.map +1 -1
  51. package/node_modules/@attocash/commons-core/kotlin-kotlin-stdlib.mjs +4695 -4227
  52. package/node_modules/@attocash/commons-core/kotlin-kotlin-stdlib.mjs.map +1 -1
  53. package/node_modules/@attocash/commons-core/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs.map +1 -1
  54. package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-bytestring.mjs +60 -60
  55. package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-bytestring.mjs.map +1 -1
  56. package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-core.mjs +651 -631
  57. package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
  58. package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-core.mjs +2294 -2295
  59. package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
  60. package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
  61. package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
  62. package/node_modules/@attocash/commons-core/package.json +1 -1
  63. package/node_modules/@attocash/commons-node/commons-commons-node.d.mts +1 -0
  64. package/node_modules/@attocash/commons-node/commons-commons-node.mjs +873 -847
  65. package/node_modules/@attocash/commons-node/commons-commons-node.mjs.map +1 -1
  66. package/node_modules/@attocash/commons-node/kotlin-logging.mjs +109 -109
  67. package/node_modules/@attocash/commons-node/kotlin-logging.mjs.map +1 -1
  68. package/node_modules/@attocash/commons-node/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
  69. package/node_modules/@attocash/commons-node/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
  70. package/node_modules/@attocash/commons-node/package.json +3 -3
  71. package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.d.mts +1 -0
  72. package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.mjs +674 -640
  73. package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.mjs.map +1 -1
  74. package/node_modules/@attocash/commons-node-remote/kotlin-logging.mjs +109 -109
  75. package/node_modules/@attocash/commons-node-remote/kotlin-logging.mjs.map +1 -1
  76. package/node_modules/@attocash/commons-node-remote/kotlinx-browser.mjs.map +1 -1
  77. package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -1
  78. package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
  79. package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
  80. package/node_modules/@attocash/commons-node-remote/package.json +4 -4
  81. package/node_modules/@attocash/commons-transport/commons-commons-transport.d.mts +1 -0
  82. package/node_modules/@attocash/commons-transport/commons-commons-transport.mjs +52 -51
  83. package/node_modules/@attocash/commons-transport/commons-commons-transport.mjs.map +1 -1
  84. package/node_modules/@attocash/commons-transport/kotlinx-atomicfu.mjs +13 -13
  85. package/node_modules/@attocash/commons-transport/kotlinx-atomicfu.mjs.map +1 -1
  86. package/node_modules/@attocash/commons-transport/kotlinx-browser.mjs.map +1 -1
  87. package/node_modules/@attocash/commons-transport/kotlinx-coroutines-core.mjs +2639 -2608
  88. package/node_modules/@attocash/commons-transport/kotlinx-coroutines-core.mjs.map +1 -1
  89. package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -1
  90. package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
  91. package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
  92. package/node_modules/@attocash/commons-transport/ktor-ktor-client-content-negotiation.mjs +411 -196
  93. package/node_modules/@attocash/commons-transport/ktor-ktor-client-content-negotiation.mjs.map +1 -1
  94. package/node_modules/@attocash/commons-transport/ktor-ktor-client-core.mjs +2115 -1976
  95. package/node_modules/@attocash/commons-transport/ktor-ktor-client-core.mjs.map +1 -1
  96. package/node_modules/@attocash/commons-transport/ktor-ktor-events.mjs +7 -7
  97. package/node_modules/@attocash/commons-transport/ktor-ktor-events.mjs.map +1 -1
  98. package/node_modules/@attocash/commons-transport/ktor-ktor-http-cio.mjs +385 -384
  99. package/node_modules/@attocash/commons-transport/ktor-ktor-http-cio.mjs.map +1 -1
  100. package/node_modules/@attocash/commons-transport/ktor-ktor-http.mjs +1261 -1185
  101. package/node_modules/@attocash/commons-transport/ktor-ktor-http.mjs.map +1 -1
  102. package/node_modules/@attocash/commons-transport/ktor-ktor-io.mjs +668 -656
  103. package/node_modules/@attocash/commons-transport/ktor-ktor-io.mjs.map +1 -1
  104. package/node_modules/@attocash/commons-transport/ktor-ktor-openapi-schema.mjs +89 -0
  105. package/node_modules/@attocash/commons-transport/ktor-ktor-openapi-schema.mjs.map +1 -0
  106. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx-json.mjs +9 -9
  107. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx-json.mjs.map +1 -1
  108. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx.mjs +120 -128
  109. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx.mjs.map +1 -1
  110. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization.mjs +46 -49
  111. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization.mjs.map +1 -1
  112. package/node_modules/@attocash/commons-transport/ktor-ktor-sse.mjs.map +1 -1
  113. package/node_modules/@attocash/commons-transport/ktor-ktor-utils.mjs +1041 -985
  114. package/node_modules/@attocash/commons-transport/ktor-ktor-utils.mjs.map +1 -1
  115. package/node_modules/@attocash/commons-transport/ktor-ktor-websocket-serialization.mjs.map +1 -1
  116. package/node_modules/@attocash/commons-transport/ktor-ktor-websockets.mjs +530 -455
  117. package/node_modules/@attocash/commons-transport/ktor-ktor-websockets.mjs.map +1 -1
  118. package/node_modules/@attocash/commons-transport/package.json +4 -4
  119. package/node_modules/@attocash/commons-worker/commons-commons-worker.d.mts +1 -0
  120. package/node_modules/@attocash/commons-worker/commons-commons-worker.mjs +230 -226
  121. package/node_modules/@attocash/commons-worker/commons-commons-worker.mjs.map +1 -1
  122. package/node_modules/@attocash/commons-worker/kotlin-logging.mjs +109 -109
  123. package/node_modules/@attocash/commons-worker/kotlin-logging.mjs.map +1 -1
  124. package/node_modules/@attocash/commons-worker/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
  125. package/node_modules/@attocash/commons-worker/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
  126. package/node_modules/@attocash/commons-worker/package.json +3 -3
  127. package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.d.mts +1 -0
  128. package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.mjs +91 -86
  129. package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.mjs.map +1 -1
  130. package/node_modules/@attocash/commons-worker-remote/kotlin-logging.mjs +109 -109
  131. package/node_modules/@attocash/commons-worker-remote/kotlin-logging.mjs.map +1 -1
  132. package/node_modules/@attocash/commons-worker-remote/kotlinx-browser.mjs.map +1 -1
  133. package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -1
  134. package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
  135. package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
  136. package/node_modules/@attocash/commons-worker-remote/package.json +4 -4
  137. package/package.json +9 -5
@@ -1,125 +1,220 @@
1
1
  import {
2
+ KProperty1ca4yb4wlo496 as KProperty1,
3
+ getPropertyCallableRef3hckxc0xueiaj as getPropertyCallableRef,
4
+ constructCallableReference23y65rf941mch as constructCallableReference,
2
5
  initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
6
+ lazy2hsh8ze7j6ikd as lazy,
7
+ endsWith3cq61xxngobwh as endsWith,
3
8
  plus1ogy4liedzq5j as plus,
4
9
  toMutableSetjdpdbr9jsqq8 as toMutableSet,
5
10
  ArrayList3it5z8td81qkl as ArrayList,
6
11
  protoOf180f3jzyo7rfj as protoOf,
7
- Unit_instance3vdlo4e4f5ggx as Unit_instance,
12
+ Unit_instance3kz1zqli6gr1r as Unit_instance,
8
13
  VOID3gxj6tk5isa35 as VOID,
14
+ equals2au1ep9vhcato as equals,
15
+ FunctionAdapter3lcrrz3moet5b as FunctionAdapter,
16
+ isInterface3d6p8outrmvmk as isInterface,
17
+ hashCodeq5arwsb9dgti as hashCode,
18
+ asSequence2phdjljfh9jhx as asSequence,
19
+ flatMap1gb3cjy1dqv3d as flatMap,
20
+ filter184huxd00uyfg as filter,
21
+ emptySequence25zpp7hgtqwdd as emptySequence,
22
+ initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
23
+ initMetadataForInterface1egvbzx539z91 as initMetadataForInterface,
9
24
  Exceptiondt2hlxn7j7vw as Exception,
10
25
  captureStack1fzi4aczwc4hg as captureStack,
11
- constructCallableReference23y65rf941mch as constructCallableReference,
12
26
  toString1pkumu07cwy4m as toString,
13
27
  Collection1k04j3hzsbod0 as Collection,
14
- isInterface3d6p8outrmvmk as isInterface,
15
28
  emptyList1g2z5xcrvp2zy as emptyList,
29
+ collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
16
30
  getKClassFromExpression348iqjl4fnx2f as getKClassFromExpression,
17
31
  Unitkvevlwgzwiuc as Unit,
18
32
  ensureNotNull1e947j3ixpazm as ensureNotNull,
19
- equals2au1ep9vhcato as equals,
20
33
  joinToString1cxrrlmo0chqs as joinToString,
21
- collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
22
- PrimitiveClasses_getInstance143761yrsca9q as PrimitiveClasses_getInstance,
34
+ orPromise1iucc2to2udt2 as orPromise,
35
+ to2cs3ny02qtbcb as to,
36
+ mapOf1xd03cq9cnmy8 as mapOf,
37
+ PrimitiveClasses_getInstance13wbaztpz3e2d as PrimitiveClasses_getInstance,
23
38
  getKClass3t8tygqu4lcxf as getKClass,
24
39
  setOf45ia9pnfhe90 as setOf,
25
40
  KtList3hktaavzmj137 as KtList,
26
41
  arrayOf1akklvh2at202 as arrayOf,
27
42
  createKType31ecntyyaay3k as createKType,
28
43
  createInvariantKTypeProjection3h5364czc0a8w as createInvariantKTypeProjection,
29
- endsWith3cq61xxngobwh as endsWith,
30
- initMetadataForObject1cxne3s9w65el as initMetadataForObject,
31
44
  LinkedHashSet2tkztfx86kyx2 as LinkedHashSet,
32
45
  } from '@attocash/commons-core/kotlin-kotlin-stdlib.mjs';
33
46
  import {
34
- Application_getInstance17ubdrb0i0ohu as Application_getInstance,
35
- Companion_getInstance3eu9tsw6r4gc4 as Companion_getInstance,
47
+ register$default2ko31hm484mcz as register$default,
48
+ Configuration20xgygxdzhlk5 as Configuration,
49
+ deserialize3e6u4ptep3aeu as deserialize,
50
+ } from './ktor-ktor-serialization.mjs';
51
+ import {
52
+ parseHeaderValuealpos28fgp6t as parseHeaderValue,
53
+ Companion_getInstance2mdqh2piyf0f8 as Companion_getInstance,
54
+ ContentType1svlpabm9v7iz as ContentType,
55
+ BadContentTypeFormatException2lqc4nmtnbgvk as BadContentTypeFormatException,
36
56
  OutgoingContent3t2ohmyam9o76 as OutgoingContent,
37
57
  contentType2zzm38yxo3syt as contentType,
38
58
  charset1dribv3ku48b1 as charset,
39
- NullBody_instanceyfq32eqie90j as NullBody_instance,
59
+ NullBody_instance22vwyocs8eppk as NullBody_instance,
40
60
  contentType317fn4f991q9a as contentType_0,
61
+ Application_getInstance3vhi2qmce4cj0 as Application_getInstance,
41
62
  HttpStatusCode3o1wkms10pg4k as HttpStatusCode,
42
- ContentType1svlpabm9v7iz as ContentType,
43
63
  } from './ktor-ktor-http.mjs';
44
64
  import {
45
- register$default1k5lce5zfzlxr as register$default,
46
- Configuration20xgygxdzhlk5 as Configuration,
47
- deserializedbfwk7upcilb as deserialize,
48
- } from './ktor-ktor-serialization.mjs';
65
+ get_isTraceEnabled82xibuu04nxp as get_isTraceEnabled,
66
+ KtorSimpleLogger1xdphsp5l4e48 as KtorSimpleLogger,
67
+ TypeInfo2nbxsuf4v8os2 as TypeInfo,
68
+ AttributeKey3aq8ytwgx54f7 as AttributeKey,
69
+ } from './ktor-ktor-utils.mjs';
49
70
  import {
50
71
  accept2gi3b7wj4jds9 as accept,
51
- EmptyContent_getInstance3hxw2ytgkcdf2 as EmptyContent_getInstance,
72
+ EmptyContent_getInstance1v4yj3cymlz7 as EmptyContent_getInstance,
52
73
  get_request3dwcif5y0fvf1 as get_request,
53
74
  ClientSSESession332rusa1q4gim as ClientSSESession,
54
75
  ClientSSESessionWithDeserialization37nab8162l18r as ClientSSESessionWithDeserialization,
55
76
  createClientPluginjwpvufjows5r as createClientPlugin,
56
77
  } from './ktor-ktor-client-core.mjs';
57
78
  import {
58
- Charsets_getInstance3jooo7e4x0j2x as Charsets_getInstance,
79
+ Charsets_getInstancezrqwjk0yrlyw as Charsets_getInstance,
59
80
  ByteReadChannel2wzou76jce72d as ByteReadChannel,
60
81
  } from './ktor-ktor-io.mjs';
61
- import {
62
- KtorSimpleLogger1xdphsp5l4e48 as KtorSimpleLogger,
63
- TypeInfo2nbxsuf4v8os2 as TypeInfo,
64
- AttributeKey3aq8ytwgx54f7 as AttributeKey,
65
- } from './ktor-ktor-utils.mjs';
66
82
  //region block: imports
67
83
  //endregion
68
84
  //region block: pre-declaration
69
85
  class ConverterRegistration {
70
86
  constructor(converter, contentTypeToSend, contentTypeMatcher) {
71
- this.u5b_1 = converter;
72
- this.v5b_1 = contentTypeToSend;
73
- this.w5b_1 = contentTypeMatcher;
87
+ this.converter_1 = converter;
88
+ this.contentTypeToSend_1 = contentTypeToSend;
89
+ this.contentTypeMatcher_1 = contentTypeMatcher;
74
90
  }
75
91
  }
76
92
  class ContentNegotiationConfig$defaultMatcher$1 {
77
93
  constructor($pattern) {
78
- this.x5b_1 = $pattern;
94
+ this.$pattern_1 = $pattern;
95
+ var tmp = this;
96
+ tmp.subtypeSuffix$delegate_1 = lazy(ContentNegotiationConfig$defaultMatcher$o$subtypeSuffix$delegate$lambda($pattern));
79
97
  }
80
- y5b(contentType) {
81
- return contentType.g4b(this.x5b_1);
98
+ contains_eqyxob_k$(contentType) {
99
+ if (contentType.match_syvve3_k$(this.$pattern_1)) {
100
+ return true;
101
+ }
102
+ var tmp0_elvis_lhs = _get_subtypeSuffix__jfpkue(this);
103
+ var tmp;
104
+ if (tmp0_elvis_lhs == null) {
105
+ return false;
106
+ } else {
107
+ tmp = tmp0_elvis_lhs;
108
+ }
109
+ var subtypeSuffix = tmp;
110
+ return endsWith(contentType.contentSubtype_1, subtypeSuffix, true);
82
111
  }
83
112
  }
84
113
  class ContentNegotiationConfig {
85
114
  constructor() {
86
- this.z5b_1 = toMutableSet(plus(get_DefaultIgnoredTypes(), get_DefaultCommonIgnoredTypes()));
115
+ this.ignoredTypes_1 = toMutableSet(plus(get_DefaultIgnoredTypes(), get_DefaultCommonIgnoredTypes()));
87
116
  var tmp = this;
88
117
  // Inline function 'kotlin.collections.mutableListOf' call
89
- tmp.a5c_1 = ArrayList.f2();
90
- this.b5c_1 = null;
118
+ tmp.registrations_1 = ArrayList.new_kotlin_collections_ArrayList_ony0vx_k$();
119
+ this.defaultAcceptHeaderQValue_1 = null;
120
+ this.acceptHeaderMergeStrategy_1 = Companion_getInstance_0().Default_1;
91
121
  }
92
- y4t(contentType, converter, configuration) {
93
- var matcher = contentType.g4b(Application_getInstance().n49_1) ? JsonContentTypeMatcher_instance : defaultMatcher(this, contentType);
94
- this.c5c(contentType, converter, matcher, configuration);
122
+ register_48t3rv_k$(contentType, converter, configuration) {
123
+ this.register_rs9lpt_k$(contentType, converter, defaultMatcher(this, contentType), configuration);
95
124
  }
96
- c5c(contentTypeToSend, converter, contentTypeMatcher, configuration) {
125
+ register_rs9lpt_k$(contentTypeToSend, converter, contentTypeMatcher, configuration) {
97
126
  // Inline function 'kotlin.apply' call
98
127
  configuration(converter);
99
128
  var registration = new ConverterRegistration(converter, contentTypeToSend, contentTypeMatcher);
100
- this.a5c_1.e2(registration);
129
+ this.registrations_1.add_utx5q5_k$(registration);
101
130
  }
102
131
  }
103
- class ContentConverterException extends Exception {
104
- constructor(message) {
105
- return new.target.f5c(message);
132
+ class ContentTypeMergeStrategy {}
133
+ class sam$io_ktor_client_plugins_contentnegotiation_ContentTypeMergeStrategy$0 {
134
+ constructor(function_0) {
135
+ this.function_1 = function_0;
106
136
  }
107
- static f5c(message) {
108
- var $this = this.be(message);
109
- captureStack($this, $this.e5c_1);
110
- return $this;
137
+ mergeContentTypes_u6wnti_k$(registeredContentTypes, acceptHeaders) {
138
+ return this.function_1(registeredContentTypes, acceptHeaders);
139
+ }
140
+ getFunctionDelegate_jtodtf_k$() {
141
+ return this.function_1;
142
+ }
143
+ equals(other) {
144
+ var tmp;
145
+ if (!(other == null) ? isInterface(other, ContentTypeMergeStrategy) : false) {
146
+ var tmp_0;
147
+ if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
148
+ tmp_0 = equals(this.getFunctionDelegate_jtodtf_k$(), other.getFunctionDelegate_jtodtf_k$());
149
+ } else {
150
+ tmp_0 = false;
151
+ }
152
+ tmp = tmp_0;
153
+ } else {
154
+ tmp = false;
155
+ }
156
+ return tmp;
157
+ }
158
+ hashCode() {
159
+ return hashCode(this.getFunctionDelegate_jtodtf_k$());
111
160
  }
112
161
  }
113
- class JsonContentTypeMatcher {
114
- y5b(contentType) {
115
- if (contentType.g4b(Application_getInstance().n49_1)) {
116
- return true;
162
+ class sam$io_ktor_client_plugins_contentnegotiation_ContentTypeMergeStrategy$0_0 {
163
+ constructor(function_0) {
164
+ this.function_1 = function_0;
165
+ }
166
+ mergeContentTypes_u6wnti_k$(registeredContentTypes, acceptHeaders) {
167
+ return this.function_1(registeredContentTypes, acceptHeaders);
168
+ }
169
+ getFunctionDelegate_jtodtf_k$() {
170
+ return this.function_1;
171
+ }
172
+ equals(other) {
173
+ var tmp;
174
+ if (!(other == null) ? isInterface(other, ContentTypeMergeStrategy) : false) {
175
+ var tmp_0;
176
+ if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
177
+ tmp_0 = equals(this.getFunctionDelegate_jtodtf_k$(), other.getFunctionDelegate_jtodtf_k$());
178
+ } else {
179
+ tmp_0 = false;
180
+ }
181
+ tmp = tmp_0;
182
+ } else {
183
+ tmp = false;
117
184
  }
118
- var value = contentType.f4b().toString();
119
- return Application_getInstance().h4a(value) && endsWith(value, '+json', true);
185
+ return tmp;
186
+ }
187
+ hashCode() {
188
+ return hashCode(this.getFunctionDelegate_jtodtf_k$());
189
+ }
190
+ }
191
+ class Companion {
192
+ constructor() {
193
+ Companion_instance = this;
194
+ var tmp = this;
195
+ var tmp_0 = ContentTypeMergeStrategy$Companion$Default$lambda;
196
+ tmp.Default_1 = new sam$io_ktor_client_plugins_contentnegotiation_ContentTypeMergeStrategy$0(tmp_0);
197
+ var tmp_1 = this;
198
+ var tmp_2 = ContentTypeMergeStrategy$Companion$SkipIfPresent$lambda;
199
+ tmp_1.SkipIfPresent_1 = new sam$io_ktor_client_plugins_contentnegotiation_ContentTypeMergeStrategy$0_0(tmp_2);
200
+ }
201
+ }
202
+ class ContentConverterException extends Exception {
203
+ constructor(message) {
204
+ return new.target.new_io_ktor_client_plugins_contentnegotiation_ContentConverterException_3zcu9b_k$(message);
205
+ }
206
+ static new_io_ktor_client_plugins_contentnegotiation_ContentConverterException_3zcu9b_k$(message) {
207
+ var $this = this.new_kotlin_Exception_hsqbop_k$(message);
208
+ captureStack($this, $this.$throwableCtor_2);
209
+ return $this;
120
210
  }
121
211
  }
122
212
  //endregion
213
+ function get_supportedSuffixTypes() {
214
+ _init_properties_ContentNegotiation_kt__o183go();
215
+ return supportedSuffixTypes;
216
+ }
217
+ var supportedSuffixTypes;
123
218
  function get_LOGGER() {
124
219
  _init_properties_ContentNegotiation_kt__o183go();
125
220
  return LOGGER;
@@ -140,40 +235,121 @@ function get_ContentNegotiation() {
140
235
  return ContentNegotiation;
141
236
  }
142
237
  var ContentNegotiation;
238
+ function _get_subtypeSuffix__jfpkue($this) {
239
+ var tmp0 = $this.subtypeSuffix$delegate_1;
240
+ var tmp = KProperty1;
241
+ // Inline function 'kotlin.getValue' call
242
+ getPropertyCallableRef('subtypeSuffix', 1, tmp, ContentNegotiationConfig$defaultMatcher$o$_get_subtypeSuffix_$ref_v9fn95(), null);
243
+ return tmp0.get_value_j01efc_k$();
244
+ }
245
+ function ContentNegotiationConfig$defaultMatcher$o$subtypeSuffix$delegate$lambda($pattern) {
246
+ return () => {
247
+ var tmp0_safe_receiver = get_supportedSuffixTypes().get_wei43m_k$($pattern.withoutParameters_wrqe36_k$());
248
+ var tmp;
249
+ if (tmp0_safe_receiver == null) {
250
+ tmp = null;
251
+ } else {
252
+ // Inline function 'kotlin.let' call
253
+ tmp = '+' + tmp0_safe_receiver;
254
+ }
255
+ return tmp;
256
+ };
257
+ }
258
+ function ContentNegotiationConfig$defaultMatcher$o$_get_subtypeSuffix_$ref_v9fn95() {
259
+ return constructCallableReference((p0) => _get_subtypeSuffix__jfpkue(p0), 1, 0, 97);
260
+ }
143
261
  function defaultMatcher($this, pattern) {
144
262
  return new ContentNegotiationConfig$defaultMatcher$1(pattern);
145
263
  }
264
+ function ContentTypeMergeStrategy$Companion$Default$lambda(registered, headers) {
265
+ var tmp = asSequence(headers);
266
+ var parsedHeaders = flatMap(tmp, ContentTypeMergeStrategy$Companion$Default$lambda$lambda);
267
+ var tmp_0 = asSequence(registered);
268
+ return filter(tmp_0, ContentTypeMergeStrategy$Companion$Default$lambda$lambda_0(parsedHeaders));
269
+ }
270
+ function ContentTypeMergeStrategy$Companion$Default$lambda$lambda(it) {
271
+ return parseHeaderValue(it);
272
+ }
273
+ function ContentTypeMergeStrategy$Companion$Default$lambda$lambda_0($parsedHeaders) {
274
+ return (contentType) => {
275
+ var tmp0 = $parsedHeaders;
276
+ var tmp$ret$0;
277
+ $l$block: {
278
+ // Inline function 'kotlin.sequences.none' call
279
+ var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
280
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
281
+ var element = _iterator__ex2g4s.next_20eer_k$();
282
+ var tmp;
283
+ try {
284
+ var acceptedType = Companion_getInstance().parse_pc1q8p_k$(element.value_1);
285
+ tmp = ContentType.new_io_ktor_http_ContentType_8p6a24_k$(acceptedType.contentType_1, acceptedType.contentSubtype_1, element.params_1).match_syvve3_k$(contentType);
286
+ } catch ($p) {
287
+ var tmp_0;
288
+ if ($p instanceof BadContentTypeFormatException) {
289
+ var e = $p;
290
+ tmp_0 = false;
291
+ } else {
292
+ throw $p;
293
+ }
294
+ tmp = tmp_0;
295
+ }
296
+ if (tmp) {
297
+ tmp$ret$0 = false;
298
+ break $l$block;
299
+ }
300
+ }
301
+ tmp$ret$0 = true;
302
+ }
303
+ return tmp$ret$0;
304
+ };
305
+ }
306
+ function ContentTypeMergeStrategy$Companion$SkipIfPresent$lambda(registered, headers) {
307
+ var tmp;
308
+ // Inline function 'kotlin.collections.isNotEmpty' call
309
+ if (!headers.isEmpty_y1axqb_k$()) {
310
+ tmp = emptySequence();
311
+ } else {
312
+ tmp = Companion_getInstance_0().Default_1.mergeContentTypes_u6wnti_k$(registered, headers);
313
+ }
314
+ return tmp;
315
+ }
316
+ var Companion_instance;
317
+ function Companion_getInstance_0() {
318
+ if (Companion_instance === VOID)
319
+ new Companion();
320
+ return Companion_instance;
321
+ }
146
322
  function ContentNegotiationConfig$_init_$ref_1ne3ob() {
147
- return constructCallableReference(() => new ContentNegotiationConfig(), 0, 0, 95, '<init>');
323
+ return constructCallableReference(() => new ContentNegotiationConfig(), 0, 0, 98, '<init>');
148
324
  }
149
325
  function ContentNegotiation$lambda($this$createClientPlugin) {
150
326
  _init_properties_ContentNegotiation_kt__o183go();
151
- var registrations = $this$createClientPlugin.z50_1.a5c_1;
152
- var ignoredTypes = $this$createClientPlugin.z50_1.z5b_1;
153
- $this$createClientPlugin.l56(ContentNegotiation$lambda$slambda(registrations, $this$createClientPlugin, ignoredTypes));
154
- $this$createClientPlugin.j53(ContentNegotiation$lambda$slambda_0(ignoredTypes, registrations, $this$createClientPlugin));
327
+ var registrations = $this$createClientPlugin.pluginConfig_1.registrations_1;
328
+ var ignoredTypes = $this$createClientPlugin.pluginConfig_1.ignoredTypes_1;
329
+ $this$createClientPlugin.transformRequestBody_immy9t_k$(ContentNegotiation$lambda$slambda(registrations, $this$createClientPlugin, ignoredTypes));
330
+ $this$createClientPlugin.transformResponseBody_ee7rr5_k$(ContentNegotiation$lambda$slambda_0(ignoredTypes, registrations, $this$createClientPlugin));
155
331
  return Unit_instance;
156
332
  }
157
333
  function ContentNegotiation$lambda$convertRequest$lambda(it) {
158
334
  _init_properties_ContentNegotiation_kt__o183go();
159
- return toString(it.u5b_1);
335
+ return toString(it.converter_1);
160
336
  }
161
337
  function *invoke$convertRequest(registrations, $this_createClientPlugin, ignoredTypes, request, body, $completion) {
162
338
  var tmp;
163
- if (request.l4w_1.u41(get_ExcludedContentTypes())) {
164
- var excluded = request.l4w_1.s41(get_ExcludedContentTypes());
339
+ if (request.attributes_1.contains_du0289_k$(get_ExcludedContentTypes())) {
340
+ var excluded = request.attributes_1.get_r696p5_k$(get_ExcludedContentTypes());
165
341
  // Inline function 'kotlin.collections.filter' call
166
342
  // Inline function 'kotlin.collections.filterTo' call
167
- var destination = ArrayList.f2();
168
- var _iterator__ex2g4s = registrations.l1();
169
- while (_iterator__ex2g4s.m1()) {
170
- var element = _iterator__ex2g4s.n1();
343
+ var destination = ArrayList.new_kotlin_collections_ArrayList_ony0vx_k$();
344
+ var _iterator__ex2g4s = registrations.iterator_jk1svi_k$();
345
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
346
+ var element = _iterator__ex2g4s.next_20eer_k$();
171
347
  var tmp$ret$3;
172
348
  $l$block_0: {
173
349
  // Inline function 'kotlin.collections.none' call
174
350
  var tmp_0;
175
351
  if (isInterface(excluded, Collection)) {
176
- tmp_0 = excluded.j1();
352
+ tmp_0 = excluded.isEmpty_y1axqb_k$();
177
353
  } else {
178
354
  tmp_0 = false;
179
355
  }
@@ -181,10 +357,10 @@ function *invoke$convertRequest(registrations, $this_createClientPlugin, ignored
181
357
  tmp$ret$3 = true;
182
358
  break $l$block_0;
183
359
  }
184
- var _iterator__ex2g4s_0 = excluded.l1();
185
- while (_iterator__ex2g4s_0.m1()) {
186
- var element_0 = _iterator__ex2g4s_0.n1();
187
- if (element.v5b_1.g4b(element_0)) {
360
+ var _iterator__ex2g4s_0 = excluded.iterator_jk1svi_k$();
361
+ while (_iterator__ex2g4s_0.hasNext_bitz1p_k$()) {
362
+ var element_0 = _iterator__ex2g4s_0.next_20eer_k$();
363
+ if (element.contentTypeToSend_1.match_syvve3_k$(element_0)) {
188
364
  tmp$ret$3 = false;
189
365
  break $l$block_0;
190
366
  }
@@ -192,7 +368,7 @@ function *invoke$convertRequest(registrations, $this_createClientPlugin, ignored
192
368
  tmp$ret$3 = true;
193
369
  }
194
370
  if (tmp$ret$3) {
195
- destination.e2(element);
371
+ destination.add_utx5q5_k$(element);
196
372
  }
197
373
  }
198
374
  tmp = destination;
@@ -201,105 +377,110 @@ function *invoke$convertRequest(registrations, $this_createClientPlugin, ignored
201
377
  }
202
378
  var requestRegistrations = tmp;
203
379
  // Inline function 'kotlin.collections.orEmpty' call
204
- var tmp0_elvis_lhs = request.i4w_1.d44('Accept');
380
+ var tmp0_elvis_lhs = request.headers_1.getAll_ffxf4h_k$('Accept');
205
381
  var acceptHeaders = tmp0_elvis_lhs == null ? emptyList() : tmp0_elvis_lhs;
206
- // Inline function 'kotlin.collections.forEach' call
207
- var _iterator__ex2g4s_1 = requestRegistrations.l1();
208
- while (_iterator__ex2g4s_1.m1()) {
209
- var element_1 = _iterator__ex2g4s_1.n1();
210
- var tmp$ret$8;
211
- $l$block_2: {
212
- // Inline function 'kotlin.collections.none' call
213
- var tmp_1;
214
- if (isInterface(acceptHeaders, Collection)) {
215
- tmp_1 = acceptHeaders.j1();
216
- } else {
217
- tmp_1 = false;
218
- }
219
- if (tmp_1) {
220
- tmp$ret$8 = true;
221
- break $l$block_2;
222
- }
223
- var _iterator__ex2g4s_2 = acceptHeaders.l1();
224
- while (_iterator__ex2g4s_2.m1()) {
225
- var element_2 = _iterator__ex2g4s_2.n1();
226
- if (Companion_getInstance().ss(element_2).g4b(element_1.v5b_1)) {
227
- tmp$ret$8 = false;
228
- break $l$block_2;
229
- }
230
- }
231
- tmp$ret$8 = true;
232
- }
233
- if (tmp$ret$8) {
234
- var qValue = $this_createClientPlugin.z50_1.b5c_1;
235
- var contentTypeToSend = qValue == null ? element_1.v5b_1 : element_1.v5b_1.d4b('q', qValue.toString());
236
- get_LOGGER().k48('Adding Accept=' + contentTypeToSend.toString() + ' header for ' + request.g4w_1.toString());
237
- accept(request, contentTypeToSend);
382
+ var tmp_1 = $this_createClientPlugin.pluginConfig_1.acceptHeaderMergeStrategy_1;
383
+ // Inline function 'kotlin.collections.map' call
384
+ // Inline function 'kotlin.collections.mapTo' call
385
+ var destination_0 = ArrayList.new_kotlin_collections_ArrayList_tdd6ob_k$(collectionSizeOrDefault(requestRegistrations, 10));
386
+ var _iterator__ex2g4s_1 = requestRegistrations.iterator_jk1svi_k$();
387
+ while (_iterator__ex2g4s_1.hasNext_bitz1p_k$()) {
388
+ var item = _iterator__ex2g4s_1.next_20eer_k$();
389
+ var tmp$ret$8 = item.contentTypeToSend_1;
390
+ destination_0.add_utx5q5_k$(tmp$ret$8);
391
+ }
392
+ // Inline function 'kotlin.sequences.forEach' call
393
+ var _iterator__ex2g4s_2 = tmp_1.mergeContentTypes_u6wnti_k$(destination_0, acceptHeaders).iterator_jk1svi_k$();
394
+ while (_iterator__ex2g4s_2.hasNext_bitz1p_k$()) {
395
+ var element_1 = _iterator__ex2g4s_2.next_20eer_k$();
396
+ var qValue = $this_createClientPlugin.pluginConfig_1.defaultAcceptHeaderQValue_1;
397
+ var contentTypeToSend = qValue == null ? element_1 : element_1.withParameter_j6bpqb_k$('q', qValue.toString());
398
+ // Inline function 'io.ktor.util.logging.trace' call
399
+ var this_0 = get_LOGGER();
400
+ if (get_isTraceEnabled(this_0)) {
401
+ var tmp$ret$12 = 'Adding Accept=' + contentTypeToSend.toString() + ' header for ' + request.url_1.toString();
402
+ this_0.trace_fti9bv_k$(tmp$ret$12);
238
403
  }
404
+ accept(request, contentTypeToSend);
239
405
  }
240
406
  var tmp_2;
241
407
  if (body instanceof OutgoingContent) {
242
408
  tmp_2 = true;
243
409
  } else {
244
- var tmp$ret$10;
245
- $l$block_4: {
410
+ var tmp$ret$13;
411
+ $l$block_2: {
246
412
  // Inline function 'kotlin.collections.any' call
247
413
  var tmp_3;
248
414
  if (isInterface(ignoredTypes, Collection)) {
249
- tmp_3 = ignoredTypes.j1();
415
+ tmp_3 = ignoredTypes.isEmpty_y1axqb_k$();
250
416
  } else {
251
417
  tmp_3 = false;
252
418
  }
253
419
  if (tmp_3) {
254
- tmp$ret$10 = false;
255
- break $l$block_4;
420
+ tmp$ret$13 = false;
421
+ break $l$block_2;
256
422
  }
257
- var _iterator__ex2g4s_3 = ignoredTypes.l1();
258
- while (_iterator__ex2g4s_3.m1()) {
259
- var element_3 = _iterator__ex2g4s_3.n1();
260
- if (element_3.if(body)) {
261
- tmp$ret$10 = true;
262
- break $l$block_4;
423
+ var _iterator__ex2g4s_3 = ignoredTypes.iterator_jk1svi_k$();
424
+ while (_iterator__ex2g4s_3.hasNext_bitz1p_k$()) {
425
+ var element_2 = _iterator__ex2g4s_3.next_20eer_k$();
426
+ if (element_2.isInstance_6tn68w_k$(body)) {
427
+ tmp$ret$13 = true;
428
+ break $l$block_2;
263
429
  }
264
430
  }
265
- tmp$ret$10 = false;
431
+ tmp$ret$13 = false;
266
432
  }
267
- tmp_2 = tmp$ret$10;
433
+ tmp_2 = tmp$ret$13;
268
434
  }
269
435
  if (tmp_2) {
270
- get_LOGGER().k48('Body type ' + toString(getKClassFromExpression(body)) + ' is in ignored types. ' + ('Skipping ContentNegotiation for ' + request.g4w_1.toString() + '.'));
436
+ // Inline function 'io.ktor.util.logging.trace' call
437
+ var this_1 = get_LOGGER();
438
+ if (get_isTraceEnabled(this_1)) {
439
+ var tmp$ret$16 = 'Body type ' + toString(getKClassFromExpression(body)) + ' is in ignored types. Skipping ContentNegotiation for ' + request.url_1.toString() + '.';
440
+ this_1.trace_fti9bv_k$(tmp$ret$16);
441
+ }
271
442
  return null;
272
443
  }
273
444
  var tmp0_elvis_lhs_0 = contentType(request);
274
445
  var tmp_4;
275
446
  if (tmp0_elvis_lhs_0 == null) {
276
447
  // Inline function 'kotlin.run' call
277
- get_LOGGER().k48("Request doesn't have Content-Type header. Skipping ContentNegotiation for " + request.g4w_1.toString() + '.');
448
+ // Inline function 'io.ktor.util.logging.trace' call
449
+ var this_2 = get_LOGGER();
450
+ if (get_isTraceEnabled(this_2)) {
451
+ var tmp$ret$20 = "Request doesn't have Content-Type header. Skipping ContentNegotiation for " + request.url_1.toString() + '.';
452
+ this_2.trace_fti9bv_k$(tmp$ret$20);
453
+ }
278
454
  return null;
279
455
  } else {
280
456
  tmp_4 = tmp0_elvis_lhs_0;
281
457
  }
282
458
  var contentType_0 = tmp_4;
283
459
  if (body instanceof Unit) {
284
- get_LOGGER().k48('Sending empty body for ' + request.g4w_1.toString());
285
- request.i4w_1.k44('Content-Type');
460
+ // Inline function 'io.ktor.util.logging.trace' call
461
+ var this_3 = get_LOGGER();
462
+ if (get_isTraceEnabled(this_3)) {
463
+ var tmp$ret$22 = 'Sending empty body for ' + request.url_1.toString();
464
+ this_3.trace_fti9bv_k$(tmp$ret$22);
465
+ }
466
+ request.headers_1.remove_6241ba_k$('Content-Type');
286
467
  return EmptyContent_getInstance();
287
468
  }
288
469
  // Inline function 'kotlin.collections.filter' call
289
470
  // Inline function 'kotlin.collections.filterTo' call
290
- var destination_0 = ArrayList.f2();
291
- var _iterator__ex2g4s_4 = registrations.l1();
292
- while (_iterator__ex2g4s_4.m1()) {
293
- var element_4 = _iterator__ex2g4s_4.n1();
294
- if (element_4.w5b_1.y5b(contentType_0)) {
295
- destination_0.e2(element_4);
471
+ var destination_1 = ArrayList.new_kotlin_collections_ArrayList_ony0vx_k$();
472
+ var _iterator__ex2g4s_4 = registrations.iterator_jk1svi_k$();
473
+ while (_iterator__ex2g4s_4.hasNext_bitz1p_k$()) {
474
+ var element_3 = _iterator__ex2g4s_4.next_20eer_k$();
475
+ if (element_3.contentTypeMatcher_1.contains_eqyxob_k$(contentType_0)) {
476
+ destination_1.add_utx5q5_k$(element_3);
296
477
  }
297
478
  }
298
479
  // Inline function 'kotlin.takeIf' call
299
480
  var tmp_5;
300
481
  // Inline function 'kotlin.collections.isNotEmpty' call
301
- if (!destination_0.j1()) {
302
- tmp_5 = destination_0;
482
+ if (!destination_1.isEmpty_y1axqb_k$()) {
483
+ tmp_5 = destination_1;
303
484
  } else {
304
485
  tmp_5 = null;
305
486
  }
@@ -307,26 +488,36 @@ function *invoke$convertRequest(registrations, $this_createClientPlugin, ignored
307
488
  var tmp_6;
308
489
  if (tmp1_elvis_lhs == null) {
309
490
  // Inline function 'kotlin.run' call
310
- get_LOGGER().k48('None of the registered converters match request Content-Type=' + contentType_0.toString() + '. ' + ('Skipping ContentNegotiation for ' + request.g4w_1.toString() + '.'));
491
+ // Inline function 'io.ktor.util.logging.trace' call
492
+ var this_4 = get_LOGGER();
493
+ if (get_isTraceEnabled(this_4)) {
494
+ var tmp$ret$32 = 'None of the registered converters match request Content-Type=' + contentType_0.toString() + '. ' + ('Skipping ContentNegotiation for ' + request.url_1.toString() + '.');
495
+ this_4.trace_fti9bv_k$(tmp$ret$32);
496
+ }
311
497
  return null;
312
498
  } else {
313
499
  tmp_6 = tmp1_elvis_lhs;
314
500
  }
315
501
  var matchingRegistrations = tmp_6;
316
- if (request.y56() == null) {
317
- get_LOGGER().k48('Request has unknown body type. Skipping ContentNegotiation for ' + request.g4w_1.toString() + '.');
502
+ if (request.get_bodyType_3n7prv_k$() == null) {
503
+ // Inline function 'io.ktor.util.logging.trace' call
504
+ var this_5 = get_LOGGER();
505
+ if (get_isTraceEnabled(this_5)) {
506
+ var tmp$ret$34 = 'Request has unknown body type. Skipping ContentNegotiation for ' + request.url_1.toString() + '.';
507
+ this_5.trace_fti9bv_k$(tmp$ret$34);
508
+ }
318
509
  return null;
319
510
  }
320
- request.i4w_1.k44('Content-Type');
321
- var tmp$ret$22;
322
- $l$block_5: {
511
+ request.headers_1.remove_6241ba_k$('Content-Type');
512
+ var tmp$ret$35;
513
+ $l$block_3: {
323
514
  // Inline function 'kotlin.collections.firstNotNullOfOrNull' call
324
- var _iterator__ex2g4s_5 = matchingRegistrations.l1();
325
- while (_iterator__ex2g4s_5.m1()) {
326
- var element_5 = _iterator__ex2g4s_5.n1();
515
+ var _iterator__ex2g4s_5 = matchingRegistrations.iterator_jk1svi_k$();
516
+ while (_iterator__ex2g4s_5.hasNext_bitz1p_k$()) {
517
+ var element_4 = _iterator__ex2g4s_5.next_20eer_k$();
327
518
  var tmp0_elvis_lhs_1 = charset(contentType_0);
328
- var tmp_7 = tmp0_elvis_lhs_1 == null ? Charsets_getInstance().o40_1 : tmp0_elvis_lhs_1;
329
- var tmp_8 = ensureNotNull(request.y56());
519
+ var tmp_7 = tmp0_elvis_lhs_1 == null ? Charsets_getInstance().UTF_8__1 : tmp0_elvis_lhs_1;
520
+ var tmp_8 = ensureNotNull(request.get_bodyType_3n7prv_k$());
330
521
  // Inline function 'kotlin.takeIf' call
331
522
  var tmp_9;
332
523
  if (!equals(body, NullBody_instance)) {
@@ -334,24 +525,29 @@ function *invoke$convertRequest(registrations, $this_createClientPlugin, ignored
334
525
  } else {
335
526
  tmp_9 = null;
336
527
  }
337
- var tmp$ret$24 = tmp_9;
338
- var result = yield* element_5.u5b_1.g5c(contentType_0, tmp_7, tmp_8, tmp$ret$24, $completion);
528
+ var tmp$ret$37 = tmp_9;
529
+ var result = yield* element_4.converter_1.serialize_vlmgdn_k$(contentType_0, tmp_7, tmp_8, tmp$ret$37, $completion);
339
530
  if (!(result == null)) {
340
- get_LOGGER().k48('Converted request body using ' + toString(element_5.u5b_1) + ' for ' + request.g4w_1.toString());
531
+ // Inline function 'io.ktor.util.logging.trace' call
532
+ var this_6 = get_LOGGER();
533
+ if (get_isTraceEnabled(this_6)) {
534
+ var tmp$ret$40 = 'Converted request body using ' + toString(element_4.converter_1) + ' for ' + request.url_1.toString();
535
+ this_6.trace_fti9bv_k$(tmp$ret$40);
536
+ }
341
537
  }
342
538
  var result_0 = result;
343
539
  if (!(result_0 == null)) {
344
- tmp$ret$22 = result_0;
345
- break $l$block_5;
540
+ tmp$ret$35 = result_0;
541
+ break $l$block_3;
346
542
  }
347
543
  }
348
- tmp$ret$22 = null;
544
+ tmp$ret$35 = null;
349
545
  }
350
- var tmp2_elvis_lhs = tmp$ret$22;
546
+ var tmp2_elvis_lhs = tmp$ret$35;
351
547
  var tmp_10;
352
548
  if (tmp2_elvis_lhs == null) {
353
549
  var tmp_11 = "Can't convert " + toString(body) + ' with contentType ' + contentType_0.toString() + ' using converters ';
354
- throw ContentConverterException.f5c(tmp_11 + joinToString(matchingRegistrations, VOID, VOID, VOID, VOID, VOID, ContentNegotiation$lambda$convertRequest$lambda));
550
+ throw ContentConverterException.new_io_ktor_client_plugins_contentnegotiation_ContentConverterException_3zcu9b_k$(tmp_11 + joinToString(matchingRegistrations, VOID, VOID, VOID, VOID, VOID, ContentNegotiation$lambda$convertRequest$lambda));
355
551
  } else {
356
552
  tmp_10 = tmp2_elvis_lhs;
357
553
  }
@@ -359,38 +555,48 @@ function *invoke$convertRequest(registrations, $this_createClientPlugin, ignored
359
555
  return serializedContent;
360
556
  }
361
557
  function *invoke$convertResponse(ignoredTypes, registrations, $this_createClientPlugin, requestUrl, info, body, responseContentType, charset, $completion) {
362
- charset = charset === VOID ? Charsets_getInstance().o40_1 : charset;
558
+ charset = charset === VOID ? Charsets_getInstance().UTF_8__1 : charset;
363
559
  if (!isInterface(body, ByteReadChannel)) {
364
- get_LOGGER().k48('Response body is already transformed. Skipping ContentNegotiation for ' + requestUrl.toString() + '.');
560
+ // Inline function 'io.ktor.util.logging.trace' call
561
+ var this_0 = get_LOGGER();
562
+ if (get_isTraceEnabled(this_0)) {
563
+ var tmp$ret$1 = 'Response body is already transformed. Skipping ContentNegotiation for ' + requestUrl.toString() + '.';
564
+ this_0.trace_fti9bv_k$(tmp$ret$1);
565
+ }
365
566
  return null;
366
567
  }
367
- if (ignoredTypes.j3(info.y47_1)) {
368
- get_LOGGER().k48('Response body type ' + toString(info.y47_1) + ' is in ignored types. ' + ('Skipping ContentNegotiation for ' + requestUrl.toString() + '.'));
568
+ if (ignoredTypes.contains_aljjnj_k$(info.type_1)) {
569
+ // Inline function 'io.ktor.util.logging.trace' call
570
+ var this_1 = get_LOGGER();
571
+ if (get_isTraceEnabled(this_1)) {
572
+ var tmp$ret$3 = 'Response body type ' + toString(info.type_1) + ' is in ignored types. Skipping ContentNegotiation for ' + requestUrl.toString() + '.';
573
+ this_1.trace_fti9bv_k$(tmp$ret$3);
574
+ }
369
575
  return null;
370
576
  }
371
577
  // Inline function 'kotlin.collections.filter' call
372
578
  // Inline function 'kotlin.collections.filterTo' call
373
- var destination = ArrayList.f2();
374
- var _iterator__ex2g4s = registrations.l1();
375
- while (_iterator__ex2g4s.m1()) {
376
- var element = _iterator__ex2g4s.n1();
377
- if (element.w5b_1.y5b(responseContentType)) {
378
- destination.e2(element);
579
+ var destination = ArrayList.new_kotlin_collections_ArrayList_ony0vx_k$();
580
+ var _iterator__ex2g4s = registrations.iterator_jk1svi_k$();
581
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
582
+ var element = _iterator__ex2g4s.next_20eer_k$();
583
+ if (element.contentTypeMatcher_1.contains_eqyxob_k$(responseContentType)) {
584
+ destination.add_utx5q5_k$(element);
379
585
  }
380
586
  }
381
587
  // Inline function 'kotlin.collections.map' call
382
588
  // Inline function 'kotlin.collections.mapTo' call
383
- var destination_0 = ArrayList.d2(collectionSizeOrDefault(destination, 10));
384
- var _iterator__ex2g4s_0 = destination.l1();
385
- while (_iterator__ex2g4s_0.m1()) {
386
- var item = _iterator__ex2g4s_0.n1();
387
- var tmp$ret$5 = item.u5b_1;
388
- destination_0.e2(tmp$ret$5);
589
+ var destination_0 = ArrayList.new_kotlin_collections_ArrayList_tdd6ob_k$(collectionSizeOrDefault(destination, 10));
590
+ var _iterator__ex2g4s_0 = destination.iterator_jk1svi_k$();
591
+ while (_iterator__ex2g4s_0.hasNext_bitz1p_k$()) {
592
+ var item = _iterator__ex2g4s_0.next_20eer_k$();
593
+ var tmp$ret$9 = item.converter_1;
594
+ destination_0.add_utx5q5_k$(tmp$ret$9);
389
595
  }
390
596
  // Inline function 'kotlin.takeIf' call
391
597
  var tmp;
392
598
  // Inline function 'kotlin.collections.isNotEmpty' call
393
- if (!destination_0.j1()) {
599
+ if (!destination_0.isEmpty_y1axqb_k$()) {
394
600
  tmp = destination_0;
395
601
  } else {
396
602
  tmp = null;
@@ -399,25 +605,36 @@ function *invoke$convertResponse(ignoredTypes, registrations, $this_createClient
399
605
  var tmp_0;
400
606
  if (tmp0_elvis_lhs == null) {
401
607
  // Inline function 'kotlin.run' call
402
- get_LOGGER().k48('None of the registered converters match response with Content-Type=' + responseContentType.toString() + '. ' + ('Skipping ContentNegotiation for ' + requestUrl.toString() + '.'));
608
+ // Inline function 'io.ktor.util.logging.trace' call
609
+ var this_2 = get_LOGGER();
610
+ if (get_isTraceEnabled(this_2)) {
611
+ var tmp$ret$16 = 'None of the registered converters match response with Content-Type=' + responseContentType.toString() + '. ' + ('Skipping ContentNegotiation for ' + requestUrl.toString() + '.');
612
+ this_2.trace_fti9bv_k$(tmp$ret$16);
613
+ }
403
614
  return null;
404
615
  } else {
405
616
  tmp_0 = tmp0_elvis_lhs;
406
617
  }
407
618
  var suitableConverters = tmp_0;
408
619
  var result = yield* deserialize(suitableConverters, body, info, charset, $completion);
409
- if (!isInterface(result, ByteReadChannel)) {
410
- get_LOGGER().k48('Response body was converted to ' + toString(getKClassFromExpression(result)) + ' for ' + requestUrl.toString() + '.');
620
+ var tmp_1;
621
+ if (get_isTraceEnabled(get_LOGGER())) {
622
+ tmp_1 = !isInterface(result, ByteReadChannel);
623
+ } else {
624
+ tmp_1 = false;
625
+ }
626
+ if (tmp_1) {
627
+ get_LOGGER().trace_fti9bv_k$('Response body was converted to ' + toString(getKClassFromExpression(result)) + ' for ' + requestUrl.toString() + '.');
411
628
  }
412
629
  return result;
413
630
  }
414
631
  function ContentNegotiation$lambda$slambda($registrations, $this_createClientPlugin, $ignoredTypes) {
415
- return constructCallableReference(function *($this$transformRequestBody, request, body, _unused_var__etf5q3, $completion) {
632
+ return constructCallableReference(($this$transformRequestBody, request, body, _unused_var__etf5q3, $completion) => orPromise($completion, function *($completion) {
416
633
  return yield* /*#__NOINLINE__*/invoke$convertRequest($registrations, $this_createClientPlugin, $ignoredTypes, request, body, $completion);
417
- }, 4);
634
+ }), 4);
418
635
  }
419
636
  function ContentNegotiation$lambda$slambda_0($ignoredTypes, $registrations, $this_createClientPlugin) {
420
- return constructCallableReference(function *($this$transformResponseBody, response, body, info, $completion) {
637
+ return constructCallableReference(($this$transformResponseBody, response, body, info, $completion) => orPromise($completion, function *($completion) {
421
638
  var tmp0_elvis_lhs = contentType_0(response);
422
639
  var tmp;
423
640
  if (tmp0_elvis_lhs == null) {
@@ -427,68 +644,66 @@ function ContentNegotiation$lambda$slambda_0($ignoredTypes, $registrations, $thi
427
644
  }
428
645
  var contentType = tmp;
429
646
  var tmp1_elvis_lhs = charset(contentType);
430
- var charset_0 = tmp1_elvis_lhs == null ? Charsets_getInstance().o40_1 : tmp1_elvis_lhs;
431
- return yield* /*#__NOINLINE__*/invoke$convertResponse($ignoredTypes, $registrations, $this_createClientPlugin, get_request(response).g4x(), info, body, contentType, charset_0, $completion);
432
- }, 4);
647
+ var charset_0 = tmp1_elvis_lhs == null ? Charsets_getInstance().UTF_8__1 : tmp1_elvis_lhs;
648
+ return yield* /*#__NOINLINE__*/invoke$convertResponse($ignoredTypes, $registrations, $this_createClientPlugin, get_request(response).get_url_18iuii_k$(), info, body, contentType, charset_0, $completion);
649
+ }), 4);
433
650
  }
434
651
  var properties_initialized_ContentNegotiation_kt_1ayduy;
435
652
  function _init_properties_ContentNegotiation_kt__o183go() {
436
653
  if (!properties_initialized_ContentNegotiation_kt_1ayduy) {
437
654
  properties_initialized_ContentNegotiation_kt_1ayduy = true;
655
+ supportedSuffixTypes = mapOf([to(Application_getInstance().Json_1, 'json'), to(Application_getInstance().Xml_1, 'xml'), to(ContentType.new_io_ktor_http_ContentType_8p6a24_k$('application', 'fastinfoset'), 'fastinfoset'), to(ContentType.new_io_ktor_http_ContentType_8p6a24_k$('application', 'vnd.wap.wbxml'), 'wbxml'), to(Application_getInstance().Zip_1, 'zip')]);
438
656
  LOGGER = KtorSimpleLogger('io.ktor.client.plugins.contentnegotiation.ContentNegotiation');
439
- DefaultCommonIgnoredTypes = setOf([PrimitiveClasses_getInstance().mg(), PrimitiveClasses_getInstance().ig(), getKClass(HttpStatusCode), getKClass(ByteReadChannel), getKClass(OutgoingContent), getKClass(ClientSSESession), getKClass(ClientSSESessionWithDeserialization)]);
657
+ DefaultCommonIgnoredTypes = setOf([PrimitiveClasses_getInstance().get_byteArrayClass_57my8g_k$(), PrimitiveClasses_getInstance().get_stringClass_bik2gy_k$(), getKClass(HttpStatusCode), getKClass(ByteReadChannel), getKClass(OutgoingContent), getKClass(ClientSSESession), getKClass(ClientSSESessionWithDeserialization)]);
440
658
  // Inline function 'io.ktor.util.AttributeKey' call
441
659
  var name = 'ExcludedContentTypesAttr';
442
660
  // Inline function 'io.ktor.util.reflect.typeInfo' call
443
661
  var tmp = getKClass(KtList);
662
+ var tmp_0 = !(null == null) ? isInterface(null, KtList) : false;
444
663
  // Inline function 'io.ktor.util.reflect.typeOfOrNull' call
445
- var tmp_0;
664
+ var tmp_1;
446
665
  try {
447
- tmp_0 = createKType(getKClass(KtList), arrayOf([createInvariantKTypeProjection(createKType(getKClass(ContentType), arrayOf([]), false))]), false);
666
+ tmp_1 = createKType(getKClass(KtList), arrayOf([createInvariantKTypeProjection(createKType(getKClass(ContentType), arrayOf([]), false))]), false);
448
667
  } catch ($p) {
449
- var tmp_1;
668
+ var tmp_2;
450
669
  if ($p instanceof Error) {
451
670
  var _unused_var__etf5q3 = $p;
452
- tmp_1 = null;
671
+ tmp_2 = null;
453
672
  } else {
454
673
  throw $p;
455
674
  }
456
- tmp_0 = tmp_1;
675
+ tmp_1 = tmp_2;
457
676
  }
458
- var tmp$ret$2 = tmp_0;
459
- var tmp$ret$1 = new TypeInfo(tmp, tmp$ret$2);
677
+ var tmp$ret$2 = tmp_1;
678
+ var tmp$ret$1 = new TypeInfo(tmp, tmp_0, tmp$ret$2);
460
679
  ExcludedContentTypes = new AttributeKey(name, tmp$ret$1);
461
- var tmp_2 = ContentNegotiationConfig$_init_$ref_1ne3ob();
462
- ContentNegotiation = createClientPlugin('ContentNegotiation', tmp_2, ContentNegotiation$lambda);
680
+ var tmp_3 = ContentNegotiationConfig$_init_$ref_1ne3ob();
681
+ ContentNegotiation = createClientPlugin('ContentNegotiation', tmp_3, ContentNegotiation$lambda);
463
682
  }
464
683
  }
465
- var JsonContentTypeMatcher_instance;
466
- function JsonContentTypeMatcher_getInstance() {
467
- return JsonContentTypeMatcher_instance;
468
- }
469
684
  function get_DefaultIgnoredTypes() {
470
- _init_properties_DefaultIgnoredTypes_web_kt__6eddjw();
685
+ _init_properties_DefaultIgnoredTypes_nonJvm_kt__d0t56u();
471
686
  return DefaultIgnoredTypes;
472
687
  }
473
688
  var DefaultIgnoredTypes;
474
- var properties_initialized_DefaultIgnoredTypes_web_kt_23uj7m;
475
- function _init_properties_DefaultIgnoredTypes_web_kt__6eddjw() {
476
- if (!properties_initialized_DefaultIgnoredTypes_web_kt_23uj7m) {
477
- properties_initialized_DefaultIgnoredTypes_web_kt_23uj7m = true;
689
+ var properties_initialized_DefaultIgnoredTypes_nonJvm_kt_bmyzac;
690
+ function _init_properties_DefaultIgnoredTypes_nonJvm_kt__d0t56u() {
691
+ if (!properties_initialized_DefaultIgnoredTypes_nonJvm_kt_bmyzac) {
692
+ properties_initialized_DefaultIgnoredTypes_nonJvm_kt_bmyzac = true;
478
693
  // Inline function 'kotlin.collections.mutableSetOf' call
479
- DefaultIgnoredTypes = LinkedHashSet.r2();
694
+ DefaultIgnoredTypes = LinkedHashSet.new_kotlin_collections_LinkedHashSet_ahyf7j_k$();
480
695
  }
481
696
  }
482
697
  //region block: post-declaration
483
698
  initMetadataForClass(ConverterRegistration, 'ConverterRegistration');
484
699
  initMetadataForClass(ContentNegotiationConfig$defaultMatcher$1);
485
- protoOf(ContentNegotiationConfig).z4t = register$default;
700
+ protoOf(ContentNegotiationConfig).register$default_yp0q2f_k$ = register$default;
486
701
  initMetadataForClass(ContentNegotiationConfig, 'ContentNegotiationConfig', ContentNegotiationConfig, VOID, [Configuration]);
702
+ initMetadataForInterface(ContentTypeMergeStrategy, 'ContentTypeMergeStrategy');
703
+ initMetadataForClass(sam$io_ktor_client_plugins_contentnegotiation_ContentTypeMergeStrategy$0, 'sam$io_ktor_client_plugins_contentnegotiation_ContentTypeMergeStrategy$0', VOID, VOID, [ContentTypeMergeStrategy, FunctionAdapter]);
704
+ initMetadataForClass(sam$io_ktor_client_plugins_contentnegotiation_ContentTypeMergeStrategy$0_0, 'sam$io_ktor_client_plugins_contentnegotiation_ContentTypeMergeStrategy$0', VOID, VOID, [ContentTypeMergeStrategy, FunctionAdapter]);
705
+ initMetadataForCompanion(Companion);
487
706
  initMetadataForClass(ContentConverterException, 'ContentConverterException');
488
- initMetadataForObject(JsonContentTypeMatcher, 'JsonContentTypeMatcher');
489
- //endregion
490
- //region block: init
491
- JsonContentTypeMatcher_instance = new JsonContentTypeMatcher();
492
707
  //endregion
493
708
  //region block: exports
494
709
  export {