raspberry_games_server_game_logic 1.8.397 → 1.8.399

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 (44) hide show
  1. package/Kosi-Kaverit-kaverit.js +23 -23
  2. package/Kosi-Kodein-kodein-di.js +161 -161
  3. package/Kotlin-DateTime-library-kotlinx-datetime.js +170 -170
  4. package/Kotlin-DateTime-library-kotlinx-datetime.js.map +1 -1
  5. package/Logic_Debertz-ai_module.js +2093 -0
  6. package/Logic_Debertz-ai_module.js.map +1 -0
  7. package/Logic_Debertz-core.js +1466 -1323
  8. package/Logic_Debertz-core.js.map +1 -1
  9. package/Logic_Debertz-engine.js +14335 -13706
  10. package/Logic_Debertz-engine.js.map +1 -1
  11. package/Logic_Debertz-game_server.d.ts +34 -16
  12. package/Logic_Debertz-game_server.js +1620 -1566
  13. package/Logic_Debertz-game_server.js.map +1 -1
  14. package/error-library-error.js +5 -5
  15. package/kotlin-kotlin-stdlib.js +2067 -2006
  16. package/kotlin-kotlin-stdlib.js.map +1 -1
  17. package/kotlinx-atomicfu.js +9 -9
  18. package/kotlinx-coroutines-core.js +696 -696
  19. package/kotlinx-io-kotlinx-io-core.js +41 -41
  20. package/kotlinx-serialization-kotlinx-serialization-core.js +196 -196
  21. package/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -1
  22. package/kotlinx-serialization-kotlinx-serialization-json.js +253 -253
  23. package/ktor-ktor-client-content-negotiation.js +89 -89
  24. package/ktor-ktor-client-core.js +1054 -1029
  25. package/ktor-ktor-client-core.js.map +1 -1
  26. package/ktor-ktor-client-logging.js +293 -288
  27. package/ktor-ktor-client-logging.js.map +1 -1
  28. package/ktor-ktor-events.js +5 -5
  29. package/ktor-ktor-http.js +164 -160
  30. package/ktor-ktor-http.js.map +1 -1
  31. package/ktor-ktor-io.js +372 -372
  32. package/ktor-ktor-serialization-kotlinx.js +127 -127
  33. package/ktor-ktor-serialization.js +68 -68
  34. package/ktor-ktor-utils.js +278 -278
  35. package/ktor-ktor-websockets.js +15 -15
  36. package/package.json +1 -1
  37. package/random-library-crypto-rand.js +13 -13
  38. package/random-library-secure-random.js +5 -5
  39. package/raspberry-cardgame-lib-core.js +97 -97
  40. package/raspberry-cardgame-lib-core.js.map +1 -1
  41. package/raspberry-cardgame-lib-logger.js +12 -12
  42. package/raspberry-cardgame-lib-random.js +237 -237
  43. package/uuid.js +15 -15
  44. package/uuid.js.map +1 -1
@@ -0,0 +1,2093 @@
1
+ (function (factory) {
2
+ if (typeof define === 'function' && define.amd)
3
+ define(['exports', './kotlin-kotlin-stdlib.js', './ktor-ktor-http.js', './ktor-ktor-client-core.js', './ktor-ktor-utils.js', './kotlinx-serialization-kotlinx-serialization-core.js', './kotlinx-serialization-kotlinx-serialization-json.js', './Kosi-Kodein-kodein-di.js', './ktor-ktor-client-content-negotiation.js', './ktor-ktor-client-logging.js', './ktor-ktor-serialization-kotlinx-json.js', './Kosi-Kaverit-kaverit.js'], factory);
4
+ else if (typeof exports === 'object')
5
+ factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./ktor-ktor-http.js'), require('./ktor-ktor-client-core.js'), require('./ktor-ktor-utils.js'), require('./kotlinx-serialization-kotlinx-serialization-core.js'), require('./kotlinx-serialization-kotlinx-serialization-json.js'), require('./Kosi-Kodein-kodein-di.js'), require('./ktor-ktor-client-content-negotiation.js'), require('./ktor-ktor-client-logging.js'), require('./ktor-ktor-serialization-kotlinx-json.js'), require('./Kosi-Kaverit-kaverit.js'));
6
+ else {
7
+ if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
8
+ throw new Error("Error loading module 'Logic_Debertz-ai_module'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'Logic_Debertz-ai_module'.");
9
+ }
10
+ if (typeof globalThis['ktor-ktor-http'] === 'undefined') {
11
+ throw new Error("Error loading module 'Logic_Debertz-ai_module'. Its dependency 'ktor-ktor-http' was not found. Please, check whether 'ktor-ktor-http' is loaded prior to 'Logic_Debertz-ai_module'.");
12
+ }
13
+ if (typeof globalThis['ktor-ktor-client-core'] === 'undefined') {
14
+ throw new Error("Error loading module 'Logic_Debertz-ai_module'. Its dependency 'ktor-ktor-client-core' was not found. Please, check whether 'ktor-ktor-client-core' is loaded prior to 'Logic_Debertz-ai_module'.");
15
+ }
16
+ if (typeof globalThis['ktor-ktor-utils'] === 'undefined') {
17
+ throw new Error("Error loading module 'Logic_Debertz-ai_module'. Its dependency 'ktor-ktor-utils' was not found. Please, check whether 'ktor-ktor-utils' is loaded prior to 'Logic_Debertz-ai_module'.");
18
+ }
19
+ if (typeof globalThis['kotlinx-serialization-kotlinx-serialization-core'] === 'undefined') {
20
+ throw new Error("Error loading module 'Logic_Debertz-ai_module'. Its dependency 'kotlinx-serialization-kotlinx-serialization-core' was not found. Please, check whether 'kotlinx-serialization-kotlinx-serialization-core' is loaded prior to 'Logic_Debertz-ai_module'.");
21
+ }
22
+ if (typeof globalThis['kotlinx-serialization-kotlinx-serialization-json'] === 'undefined') {
23
+ throw new Error("Error loading module 'Logic_Debertz-ai_module'. Its dependency 'kotlinx-serialization-kotlinx-serialization-json' was not found. Please, check whether 'kotlinx-serialization-kotlinx-serialization-json' is loaded prior to 'Logic_Debertz-ai_module'.");
24
+ }
25
+ if (typeof globalThis['Kosi-Kodein-kodein-di'] === 'undefined') {
26
+ throw new Error("Error loading module 'Logic_Debertz-ai_module'. Its dependency 'Kosi-Kodein-kodein-di' was not found. Please, check whether 'Kosi-Kodein-kodein-di' is loaded prior to 'Logic_Debertz-ai_module'.");
27
+ }
28
+ if (typeof globalThis['ktor-ktor-client-content-negotiation'] === 'undefined') {
29
+ throw new Error("Error loading module 'Logic_Debertz-ai_module'. Its dependency 'ktor-ktor-client-content-negotiation' was not found. Please, check whether 'ktor-ktor-client-content-negotiation' is loaded prior to 'Logic_Debertz-ai_module'.");
30
+ }
31
+ if (typeof globalThis['ktor-ktor-client-logging'] === 'undefined') {
32
+ throw new Error("Error loading module 'Logic_Debertz-ai_module'. Its dependency 'ktor-ktor-client-logging' was not found. Please, check whether 'ktor-ktor-client-logging' is loaded prior to 'Logic_Debertz-ai_module'.");
33
+ }
34
+ if (typeof globalThis['ktor-ktor-serialization-kotlinx-json'] === 'undefined') {
35
+ throw new Error("Error loading module 'Logic_Debertz-ai_module'. Its dependency 'ktor-ktor-serialization-kotlinx-json' was not found. Please, check whether 'ktor-ktor-serialization-kotlinx-json' is loaded prior to 'Logic_Debertz-ai_module'.");
36
+ }
37
+ if (typeof globalThis['Kosi-Kaverit-kaverit'] === 'undefined') {
38
+ throw new Error("Error loading module 'Logic_Debertz-ai_module'. Its dependency 'Kosi-Kaverit-kaverit' was not found. Please, check whether 'Kosi-Kaverit-kaverit' is loaded prior to 'Logic_Debertz-ai_module'.");
39
+ }
40
+ globalThis['Logic_Debertz-ai_module'] = factory(typeof globalThis['Logic_Debertz-ai_module'] === 'undefined' ? {} : globalThis['Logic_Debertz-ai_module'], globalThis['kotlin-kotlin-stdlib'], globalThis['ktor-ktor-http'], globalThis['ktor-ktor-client-core'], globalThis['ktor-ktor-utils'], globalThis['kotlinx-serialization-kotlinx-serialization-core'], globalThis['kotlinx-serialization-kotlinx-serialization-json'], globalThis['Kosi-Kodein-kodein-di'], globalThis['ktor-ktor-client-content-negotiation'], globalThis['ktor-ktor-client-logging'], globalThis['ktor-ktor-serialization-kotlinx-json'], globalThis['Kosi-Kaverit-kaverit']);
41
+ }
42
+ }(function (_, kotlin_kotlin, kotlin_io_ktor_ktor_http, kotlin_io_ktor_ktor_client_core, kotlin_io_ktor_ktor_utils, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json, kotlin_org_kodein_di_kodein_di, kotlin_io_ktor_ktor_client_content_negotiation, kotlin_io_ktor_ktor_client_logging, kotlin_io_ktor_ktor_serialization_kotlinx_json, kotlin_org_kodein_type_kaverit) {
43
+ 'use strict';
44
+ //region block: imports
45
+ var imul = Math.imul;
46
+ var protoOf = kotlin_kotlin.$_$.kd;
47
+ var initMetadataForInterface = kotlin_kotlin.$_$.nc;
48
+ var VOID = kotlin_kotlin.$_$.b;
49
+ var HttpHeaders_getInstance = kotlin_io_ktor_ktor_http.$_$.e;
50
+ var Unit_instance = kotlin_kotlin.$_$.f5;
51
+ var CoroutineImpl = kotlin_kotlin.$_$.qa;
52
+ var HttpRequestBuilder = kotlin_io_ktor_ktor_client_core.$_$.l;
53
+ var url = kotlin_io_ktor_ktor_client_core.$_$.p;
54
+ var headers = kotlin_io_ktor_ktor_client_core.$_$.n;
55
+ var Application_getInstance = kotlin_io_ktor_ktor_http.$_$.b;
56
+ var contentType = kotlin_io_ktor_ktor_http.$_$.e1;
57
+ var JsType_instance = kotlin_io_ktor_ktor_utils.$_$.b;
58
+ var getKClass = kotlin_kotlin.$_$.fe;
59
+ var arrayOf = kotlin_kotlin.$_$.bi;
60
+ var createKType = kotlin_kotlin.$_$.de;
61
+ var typeInfoImpl = kotlin_io_ktor_ktor_utils.$_$.l;
62
+ var OutgoingContent = kotlin_io_ktor_ktor_http.$_$.p;
63
+ var NullBody_instance = kotlin_io_ktor_ktor_http.$_$.a;
64
+ var Companion_getInstance = kotlin_io_ktor_ktor_http.$_$.f;
65
+ var HttpStatement = kotlin_io_ktor_ktor_client_core.$_$.s;
66
+ var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.ba;
67
+ var Companion_instance = kotlin_kotlin.$_$.a5;
68
+ var THROW_CCE = kotlin_kotlin.$_$.nh;
69
+ var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.t2;
70
+ var createFailure = kotlin_kotlin.$_$.di;
71
+ var Exception = kotlin_kotlin.$_$.fh;
72
+ var Result = kotlin_kotlin.$_$.lh;
73
+ var initMetadataForCoroutine = kotlin_kotlin.$_$.mc;
74
+ var initMetadataForClass = kotlin_kotlin.$_$.kc;
75
+ var getStringHashCode = kotlin_kotlin.$_$.ic;
76
+ var equalsLong = kotlin_kotlin.$_$.eb;
77
+ var System_instance = kotlin_kotlin.$_$.u4;
78
+ var removeAll = kotlin_kotlin.$_$.t8;
79
+ var subtract = kotlin_kotlin.$_$.ob;
80
+ var compare = kotlin_kotlin.$_$.za;
81
+ var Long = kotlin_kotlin.$_$.ih;
82
+ var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.q;
83
+ var compareTo = kotlin_kotlin.$_$.bc;
84
+ var to = kotlin_kotlin.$_$.si;
85
+ var mapOf = kotlin_kotlin.$_$.j8;
86
+ var initMetadataForObject = kotlin_kotlin.$_$.pc;
87
+ var StringSerializer_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.v;
88
+ var ArrayListSerializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.x1;
89
+ var LazyThreadSafetyMode_PUBLICATION_getInstance = kotlin_kotlin.$_$.e;
90
+ var lazy = kotlin_kotlin.$_$.ji;
91
+ var initMetadataForCompanion = kotlin_kotlin.$_$.lc;
92
+ var PluginGeneratedSerialDescriptor = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.e2;
93
+ var emptyList = kotlin_kotlin.$_$.d7;
94
+ var equals = kotlin_kotlin.$_$.dc;
95
+ var UnknownFieldException_init_$Create$ = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.g;
96
+ var get_nullable = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.z;
97
+ var typeParametersSerializers = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.z1;
98
+ var GeneratedSerializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.a2;
99
+ var throwMissingFieldException = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.j2;
100
+ var objectCreate = kotlin_kotlin.$_$.jd;
101
+ var toString = kotlin_kotlin.$_$.nd;
102
+ var hashCode = kotlin_kotlin.$_$.jc;
103
+ var createAnnotatedEnumSerializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.g2;
104
+ var SerializerFactory = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.f2;
105
+ var Enum = kotlin_kotlin.$_$.dh;
106
+ var DoubleSerializer_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.q;
107
+ var IntSerializer_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.t;
108
+ var LongSerializer_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.u;
109
+ var getNumberHashCode = kotlin_kotlin.$_$.gc;
110
+ var toString_0 = kotlin_kotlin.$_$.ri;
111
+ var _Result___get_value__impl__bjfvqg = kotlin_kotlin.$_$.x2;
112
+ var firstOrNull = kotlin_kotlin.$_$.h7;
113
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.p1;
114
+ var _Result___get_isSuccess__impl__sndoy8 = kotlin_kotlin.$_$.w2;
115
+ var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.z;
116
+ var take = kotlin_kotlin.$_$.ag;
117
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.h;
118
+ var takeLast = kotlin_kotlin.$_$.h9;
119
+ var listOf = kotlin_kotlin.$_$.g8;
120
+ var Json = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.b;
121
+ var Module_init_$Create$ = kotlin_org_kodein_di_kodein_di.$_$.a;
122
+ var HttpClient = kotlin_io_ktor_ktor_client_core.$_$.u;
123
+ var Plugin_getInstance = kotlin_io_ktor_ktor_client_content_negotiation.$_$.a;
124
+ var Companion_getInstance_0 = kotlin_io_ktor_ktor_client_logging.$_$.d;
125
+ var json = kotlin_io_ktor_ktor_serialization_kotlinx_json.$_$.a;
126
+ var Companion_instance_0 = kotlin_io_ktor_ktor_client_logging.$_$.c;
127
+ var get_DEFAULT = kotlin_io_ktor_ktor_client_logging.$_$.e;
128
+ var LogLevel_INFO_getInstance = kotlin_io_ktor_ktor_client_logging.$_$.b;
129
+ var typeToken = kotlin_org_kodein_type_kaverit.$_$.d;
130
+ var TypeToken = kotlin_org_kodein_type_kaverit.$_$.b;
131
+ var isInterface = kotlin_kotlin.$_$.yc;
132
+ var HttpClient_0 = kotlin_io_ktor_ktor_client_core.$_$.v;
133
+ var Singleton = kotlin_org_kodein_di_kodein_di.$_$.d;
134
+ //endregion
135
+ //region block: pre-declaration
136
+ initMetadataForInterface(OpenAIApi, 'OpenAIApi', VOID, VOID, VOID, [1]);
137
+ initMetadataForCoroutine($chatCompletionCOROUTINE$, CoroutineImpl);
138
+ initMetadataForClass(OpenAIApiImpl, 'OpenAIApiImpl', VOID, VOID, [OpenAIApi], [1]);
139
+ initMetadataForInterface(BotChatCache, 'BotChatCache');
140
+ initMetadataForClass(CacheEntry, 'CacheEntry');
141
+ initMetadataForClass(InMemoryBotChatCache, 'InMemoryBotChatCache', InMemoryBotChatCache, VOID, [BotChatCache]);
142
+ initMetadataForObject(BotChatConfig, 'BotChatConfig');
143
+ initMetadataForCompanion(Companion);
144
+ initMetadataForObject($serializer, '$serializer', VOID, VOID, [GeneratedSerializer]);
145
+ initMetadataForClass(BotChatContext, 'BotChatContext', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance});
146
+ initMetadataForCompanion(Companion_0, VOID, [SerializerFactory]);
147
+ initMetadataForClass(Role, 'Role', VOID, Enum, VOID, VOID, VOID, {0: Companion_getInstance_2});
148
+ initMetadataForCompanion(Companion_1);
149
+ initMetadataForObject($serializer_0, '$serializer', VOID, VOID, [GeneratedSerializer]);
150
+ initMetadataForClass(ChatMessage, 'ChatMessage', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance_0});
151
+ initMetadataForCompanion(Companion_2);
152
+ initMetadataForObject($serializer_1, '$serializer', VOID, VOID, [GeneratedSerializer]);
153
+ initMetadataForClass(OpenAIConfig, 'OpenAIConfig', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance_1});
154
+ initMetadataForCompanion(Companion_3);
155
+ initMetadataForObject($serializer_2, '$serializer', VOID, VOID, [GeneratedSerializer]);
156
+ initMetadataForClass(OpenAIRequest, 'OpenAIRequest', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance_2});
157
+ initMetadataForObject($serializer_3, '$serializer', VOID, VOID, [GeneratedSerializer]);
158
+ initMetadataForObject($serializer_4, '$serializer', VOID, VOID, [GeneratedSerializer]);
159
+ initMetadataForClass(Choice, 'Choice', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance_3});
160
+ initMetadataForClass(Usage, 'Usage', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance_4});
161
+ initMetadataForCompanion(Companion_4);
162
+ initMetadataForObject($serializer_5, '$serializer', VOID, VOID, [GeneratedSerializer]);
163
+ initMetadataForClass(OpenAIResponse, 'OpenAIResponse', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance_5});
164
+ initMetadataForCoroutine($executeRequestCOROUTINE$, CoroutineImpl);
165
+ initMetadataForClass(BaseOpenAIRepository, 'BaseOpenAIRepository', VOID, VOID, VOID, [1, 2]);
166
+ initMetadataForInterface(BotChatRepository, 'BotChatRepository', VOID, VOID, VOID, [2, 1]);
167
+ initMetadataForCoroutine($executeRequestCOROUTINE$_0, CoroutineImpl);
168
+ initMetadataForClass(BotChatRepositoryImpl, 'BotChatRepositoryImpl', VOID, VOID, [BotChatRepository], [2, 1]);
169
+ initMetadataForInterface(UserReportsResolverRepository, 'UserReportsResolverRepository', VOID, VOID, VOID, [1]);
170
+ initMetadataForClass(UserReportsResolverRepositoryImpl, 'UserReportsResolverRepositoryImpl', VOID, VOID, [UserReportsResolverRepository], [1]);
171
+ initMetadataForInterface(BotChatInteractor, 'BotChatInteractor', VOID, VOID, VOID, [2, 1]);
172
+ initMetadataForClass(BotChatInteractorImpl, 'BotChatInteractorImpl', VOID, VOID, [BotChatInteractor], [2, 1]);
173
+ //endregion
174
+ function OpenAIApi() {
175
+ }
176
+ function OpenAIApiImpl$chatCompletion$lambda(this$0) {
177
+ return function ($this$headers) {
178
+ $this$headers.w39(HttpHeaders_getInstance().s3f_1, 'Bearer ' + this$0.h6m_1.b6m_1);
179
+ return Unit_instance;
180
+ };
181
+ }
182
+ function $chatCompletionCOROUTINE$(_this__u8e3s4, messages, resultContinuation) {
183
+ CoroutineImpl.call(this, resultContinuation);
184
+ this.r6m_1 = _this__u8e3s4;
185
+ this.s6m_1 = messages;
186
+ }
187
+ protoOf($chatCompletionCOROUTINE$).a9 = function () {
188
+ var suspendResult = this.u8_1;
189
+ $sm: do
190
+ try {
191
+ var tmp = this.s8_1;
192
+ switch (tmp) {
193
+ case 0:
194
+ this.t8_1 = 4;
195
+ this.t8_1 = 3;
196
+ var request = new OpenAIRequest(this.r6m_1.h6m_1.c6m_1, this.s6m_1, this.r6m_1.h6m_1.e6m_1, this.r6m_1.h6m_1.f6m_1);
197
+ var tmp0 = this.r6m_1.i6m_1;
198
+ var urlString = this.r6m_1.h6m_1.d6m_1 + '/chat/completions';
199
+ var this_0 = new HttpRequestBuilder();
200
+ url(this_0, urlString);
201
+ headers(this_0, OpenAIApiImpl$chatCompletion$lambda(this.r6m_1));
202
+ contentType(this_0, Application_getInstance().x3d_1);
203
+ if (request == null) {
204
+ this_0.o3s_1 = NullBody_instance;
205
+ var tmp_0 = JsType_instance;
206
+ var tmp_1 = getKClass(OpenAIRequest);
207
+ var tmp_2;
208
+ try {
209
+ tmp_2 = createKType(getKClass(OpenAIRequest), arrayOf([]), false);
210
+ } catch ($p) {
211
+ var tmp_3;
212
+ if ($p instanceof Error) {
213
+ var cause = $p;
214
+ tmp_3 = null;
215
+ } else {
216
+ throw $p;
217
+ }
218
+ tmp_2 = tmp_3;
219
+ }
220
+ this_0.a3y(typeInfoImpl(tmp_0, tmp_1, tmp_2));
221
+ } else {
222
+ if (request instanceof OutgoingContent) {
223
+ this_0.o3s_1 = request;
224
+ this_0.a3y(null);
225
+ } else {
226
+ this_0.o3s_1 = request;
227
+ var tmp_4 = JsType_instance;
228
+ var tmp_5 = getKClass(OpenAIRequest);
229
+ var tmp_6;
230
+ try {
231
+ tmp_6 = createKType(getKClass(OpenAIRequest), arrayOf([]), false);
232
+ } catch ($p) {
233
+ var tmp_7;
234
+ if ($p instanceof Error) {
235
+ var cause_0 = $p;
236
+ tmp_7 = null;
237
+ } else {
238
+ throw $p;
239
+ }
240
+ tmp_6 = tmp_7;
241
+ }
242
+ this_0.a3y(typeInfoImpl(tmp_4, tmp_5, tmp_6));
243
+ }
244
+ }
245
+
246
+ this_0.m3s_1 = Companion_getInstance().o3j_1;
247
+ this.s8_1 = 1;
248
+ suspendResult = (new HttpStatement(this_0, tmp0)).b4j(this);
249
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
250
+ return suspendResult;
251
+ }
252
+
253
+ continue $sm;
254
+ case 1:
255
+ var response = suspendResult;
256
+ var tmp_8 = this;
257
+ tmp_8.u6m_1 = Companion_instance;
258
+ this.s8_1 = 2;
259
+ var tmp_9 = response.p3v();
260
+ var tmp_10 = JsType_instance;
261
+ var tmp_11 = getKClass(OpenAIResponse);
262
+ var tmp_12;
263
+ try {
264
+ tmp_12 = createKType(getKClass(OpenAIResponse), arrayOf([]), false);
265
+ } catch ($p) {
266
+ var tmp_13;
267
+ if ($p instanceof Error) {
268
+ var cause_1 = $p;
269
+ tmp_13 = null;
270
+ } else {
271
+ throw $p;
272
+ }
273
+ tmp_12 = tmp_13;
274
+ }
275
+
276
+ suspendResult = tmp_9.t3u(typeInfoImpl(tmp_10, tmp_11, tmp_12), this);
277
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
278
+ return suspendResult;
279
+ }
280
+
281
+ continue $sm;
282
+ case 2:
283
+ var tmp2 = suspendResult instanceof OpenAIResponse ? suspendResult : THROW_CCE();
284
+ var tmp_14 = this;
285
+ this.u6m_1;
286
+ tmp_14.t6m_1 = _Result___init__impl__xyqfz8(tmp2);
287
+ this.t8_1 = 4;
288
+ this.s8_1 = 5;
289
+ continue $sm;
290
+ case 3:
291
+ this.t8_1 = 4;
292
+ var tmp_15 = this.v8_1;
293
+ if (tmp_15 instanceof Exception) {
294
+ var e = this.v8_1;
295
+ var tmp_16 = this;
296
+ tmp_16.t6m_1 = _Result___init__impl__xyqfz8(createFailure(e));
297
+ this.s8_1 = 5;
298
+ continue $sm;
299
+ } else {
300
+ throw this.v8_1;
301
+ }
302
+
303
+ case 4:
304
+ throw this.v8_1;
305
+ case 5:
306
+ this.t8_1 = 4;
307
+ return new Result(this.t6m_1);
308
+ }
309
+ } catch ($p) {
310
+ var e_0 = $p;
311
+ if (this.t8_1 === 4) {
312
+ throw e_0;
313
+ } else {
314
+ this.s8_1 = this.t8_1;
315
+ this.v8_1 = e_0;
316
+ }
317
+ }
318
+ while (true);
319
+ };
320
+ function OpenAIApiImpl(config, httpClient) {
321
+ this.h6m_1 = config;
322
+ this.i6m_1 = httpClient;
323
+ }
324
+ protoOf(OpenAIApiImpl).a6m = function (messages, $completion) {
325
+ var tmp = new $chatCompletionCOROUTINE$(this, messages, $completion);
326
+ tmp.u8_1 = Unit_instance;
327
+ tmp.v8_1 = null;
328
+ var tmp_0 = tmp.a9();
329
+ if (tmp_0 === get_COROUTINE_SUSPENDED())
330
+ return tmp_0;
331
+ return tmp_0;
332
+ };
333
+ function BotChatCache() {
334
+ }
335
+ function CacheEntry(value, timestamp) {
336
+ this.w6m_1 = value;
337
+ this.x6m_1 = timestamp;
338
+ }
339
+ protoOf(CacheEntry).toString = function () {
340
+ return 'CacheEntry(value=' + this.w6m_1 + ', timestamp=' + this.x6m_1.toString() + ')';
341
+ };
342
+ protoOf(CacheEntry).hashCode = function () {
343
+ var result = getStringHashCode(this.w6m_1);
344
+ result = imul(result, 31) + this.x6m_1.hashCode() | 0;
345
+ return result;
346
+ };
347
+ protoOf(CacheEntry).equals = function (other) {
348
+ if (this === other)
349
+ return true;
350
+ if (!(other instanceof CacheEntry))
351
+ return false;
352
+ if (!(this.w6m_1 === other.w6m_1))
353
+ return false;
354
+ if (!equalsLong(this.x6m_1, other.x6m_1))
355
+ return false;
356
+ return true;
357
+ };
358
+ function cleanExpired($this) {
359
+ var now = System_instance.ck().qk();
360
+ var tmp = $this.a6n_1.v();
361
+ removeAll(tmp, InMemoryBotChatCache$cleanExpired$lambda(now, $this));
362
+ }
363
+ function InMemoryBotChatCache$cleanExpired$lambda($now, this$0) {
364
+ return function (_destruct__k2r9zo) {
365
+ // Inline function 'kotlin.collections.component2' call
366
+ var entry = _destruct__k2r9zo.x();
367
+ return compare(subtract($now, entry.x6m_1), this$0.y6m_1) > 0;
368
+ };
369
+ }
370
+ function InMemoryBotChatCache(ttlMillis, maxSize) {
371
+ ttlMillis = ttlMillis === VOID ? new Long(300000, 0) : ttlMillis;
372
+ maxSize = maxSize === VOID ? 100 : maxSize;
373
+ this.y6m_1 = ttlMillis;
374
+ this.z6m_1 = maxSize;
375
+ var tmp = this;
376
+ // Inline function 'kotlin.collections.mutableMapOf' call
377
+ tmp.a6n_1 = LinkedHashMap_init_$Create$();
378
+ }
379
+ protoOf(InMemoryBotChatCache).t1b = function (key) {
380
+ cleanExpired(this);
381
+ var tmp0_elvis_lhs = this.a6n_1.c2(key);
382
+ var tmp;
383
+ if (tmp0_elvis_lhs == null) {
384
+ return null;
385
+ } else {
386
+ tmp = tmp0_elvis_lhs;
387
+ }
388
+ var entry = tmp;
389
+ if (compare(subtract(System_instance.ck().qk(), entry.x6m_1), this.y6m_1) > 0) {
390
+ this.a6n_1.g2(key);
391
+ return null;
392
+ }
393
+ return entry.w6m_1;
394
+ };
395
+ protoOf(InMemoryBotChatCache).v6m = function (key, value) {
396
+ cleanExpired(this);
397
+ if (this.a6n_1.o() >= this.z6m_1) {
398
+ // Inline function 'kotlin.collections.minByOrNull' call
399
+ var tmp0 = this.a6n_1.v();
400
+ var tmp$ret$0;
401
+ $l$block_0: {
402
+ // Inline function 'kotlin.collections.minByOrNull' call
403
+ var iterator = tmp0.l();
404
+ if (!iterator.m()) {
405
+ tmp$ret$0 = null;
406
+ break $l$block_0;
407
+ }
408
+ var minElem = iterator.n();
409
+ if (!iterator.m()) {
410
+ tmp$ret$0 = minElem;
411
+ break $l$block_0;
412
+ }
413
+ var minValue = minElem.x().x6m_1;
414
+ do {
415
+ var e = iterator.n();
416
+ var v = e.x().x6m_1;
417
+ if (compareTo(minValue, v) > 0) {
418
+ minElem = e;
419
+ minValue = v;
420
+ }
421
+ }
422
+ while (iterator.m());
423
+ tmp$ret$0 = minElem;
424
+ }
425
+ var tmp0_safe_receiver = tmp$ret$0;
426
+ var oldestKey = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.w();
427
+ if (oldestKey == null)
428
+ null;
429
+ else {
430
+ // Inline function 'kotlin.let' call
431
+ this.a6n_1.g2(oldestKey);
432
+ }
433
+ }
434
+ var tmp0_0 = this.a6n_1;
435
+ // Inline function 'kotlin.collections.set' call
436
+ var value_0 = new CacheEntry(value, System_instance.ck().qk());
437
+ tmp0_0.f2(key, value_0);
438
+ };
439
+ function BotChatConfig() {
440
+ BotChatConfig_instance = this;
441
+ this.b6n_1 = mapOf([to(0, '\u0412\u0435\u0441\u0435\u043B\u0438\u0439 \u0443\u043A\u0440\u0430\u0457\u043D\u0435\u0446\u044C. \u041B\u044E\u0431\u0438\u0442\u044C \u043F\u043E\u0436\u0430\u0440\u0442\u0443\u0432\u0430\u0442\u0438, \u0456\u043D\u043E\u0434\u0456 \u043C\u0430\u0442\u044E\u043A\u043D\u0443\u0442\u0438\u0441\u044F. \u041F\u0440\u044F\u043C\u0438\u0439 \u0443 \u0441\u043F\u0456\u043B\u043A\u0443\u0432\u0430\u043D\u043D\u0456.\n \u0412\u0431\u043E\u043B\u0456\u0432\u0430\u0454 \u0437\u0430 \u043A\u0430\u0440\u0442\u0438 \u044F\u043A \u0437\u0430 \u0444\u0443\u0442\u0431\u043E\u043B. \u041C\u043E\u0436\u0435 \u0441\u043A\u0430\u0437\u0430\u0442\u0438 "\u043E\u0442 \u0445\u0430\u043B\u0435\u043F\u0430", "\u0431\u043B\u044F\u0445\u0430-\u043C\u0443\u0445\u0430", "\u043D\u0456\u0447\u043E \u0441\u043E\u0431\u0456".'), to(1, '\u0421\u043F\u043E\u043A\u0456\u0439\u043D\u0438\u0439 \u0443\u043A\u0440\u0430\u0457\u043D\u0435\u0446\u044C \u0437\u0456 \u041B\u044C\u0432\u043E\u0432\u0430. \u0413\u043E\u0432\u043E\u0440\u0438\u0442\u044C \u0442\u0440\u043E\u0445\u0438 \u043F\u043E-\u0437\u0430\u0445\u0456\u0434\u043D\u043E\u043C\u0443 ("\u0444\u0430\u0439\u043D\u043E", "\u0430\u044F\u043A\u0436\u0435").\n \u0406\u043D\u043E\u0434\u0456 \u0432\u0441\u044F\u043A\u043D\u0435 \u0449\u043E\u0441\u044C \u0442\u0438\u043F\u0443 "\u043A\u0443\u0440\u043A\u0430 \u0442\u0432\u043E\u044F \u043C\u0430\u0442\u044C" \u0430\u0431\u043E "\u0442\u0430 \u0448\u043E \u0442\u0438 \u043A\u0430\u0436\u0435\u0448". \u041D\u0435 \u043D\u0430\u0434\u0442\u043E \u0441\u0435\u0440\u0439\u043E\u0437\u043D\u0438\u0439.'), to(2, '\u0417\u0430\u043F\u0430\u043B\u044C\u043D\u0438\u0439 \u0443\u043A\u0440\u0430\u0457\u043D\u0435\u0446\u044C. \u041A\u043E\u043D\u043A\u0443\u0440\u0435\u043D\u0442\u043D\u0438\u0439, \u043B\u044E\u0431\u0438\u0442\u044C \u043F\u0435\u0440\u0435\u043C\u0430\u0433\u0430\u0442\u0438. \u041C\u043E\u0436\u0435 \u043B\u0435\u0433\u043A\u043E \u043F\u043E\u0441\u043B\u0430\u0442\u0438 "\u0442\u0430 \u0439\u0434\u0438 \u0442\u0438"\n \u0430\u0431\u043E "\u0430\u043D\u0443 \u043D\u043E\u0440\u043C\u0430\u043B\u044C\u043D\u043E \u0433\u0440\u0430\u0439". \u0422\u0440\u043E\u0445\u0438 \u0431\u0430\u0437\u0456\u043A\u0430, \u0430\u043B\u0435 \u043F\u043E-\u0434\u043E\u0431\u0440\u043E\u043C\u0443. \u0420\u0435\u0430\u0433\u0443\u0454 \u0435\u043C\u043E\u0446\u0456\u0439\u043D\u043E \u043D\u0430 \u0433\u0440\u0443.'), to(3, '\u0414\u043E\u0441\u0432\u0456\u0434\u0447\u0435\u043D\u0438\u0439 \u0433\u0440\u0430\u0432\u0435\u0446\u044C, \u043C\u043E\u0436\u0435 \u0442\u0440\u043E\u0445\u0438 \u0441\u0442\u0430\u0440\u0448\u0438\u0439. \u0406\u043D\u043E\u0434\u0456 \u0434\u0430\u0441\u0442\u044C \u043F\u043E\u0440\u0430\u0434\u0443. \u041C\u043E\u0436\u0435 \u0431\u0443\u0440\u043A\u043D\u0443\u0442\u0438 "\u0442\u0430 \u0449\u043E \u0436 \u0442\u0438 \u0440\u043E\u0431\u0438\u0448"\n \u0430\u0431\u043E "\u043E\u0445 \u0439\u043E\u0431\u0430\u043D\u0430". \u041C\u0443\u0434\u0440\u0456\u0448\u0438\u0439 \u0437\u0430 \u0456\u043D\u0448\u0438\u0445, \u0430\u043B\u0435 \u0442\u0435\u0436 \u043D\u0435 \u0441\u0432\u044F\u0442\u0438\u0439 \u0443 \u0432\u0438\u0440\u0430\u0437\u0430\u0445.'), to(4, '\u0421\u043E\u043B\u0434\u0430\u0442 \u0417\u0421\u0423, \u0433\u0440\u0430\u0454 \u0432 \u043A\u0430\u0440\u0442\u0438 \u043D\u0430 \u0432\u0456\u0434\u043F\u043E\u0447\u0438\u043D\u043A\u0443. \u0416\u043E\u0440\u0441\u0442\u043A\u0438\u0439 \u0433\u0443\u043C\u043E\u0440, \u043F\u0440\u044F\u043C\u0438\u0439. \u041C\u043E\u0436\u0435 \u0441\u043A\u0430\u0437\u0430\u0442\u0438 "\u0442\u0440\u0438\u043C\u0430\u0439 \u043F\u043E\u0437\u0438\u0446\u0456\u044E",\n "\u0432\u0456\u0434\u0431\u0456\u0439", "\u0439\u043E\u0431\u0430\u043D\u0430 \u0440\u043E\u0442\u0430". \u0421\u0442\u0440\u0438\u043C\u0430\u043D\u0438\u0439 \u0430\u043B\u0435 \u0440\u0456\u0437\u043A\u0438\u0439. \u0412\u0456\u0439\u0441\u044C\u043A\u043E\u0432\u0438\u0439 \u0441\u043B\u0435\u043D\u0433.')]);
442
+ this.c6n_1 = '\u0417\u0432\u0438\u0447\u0430\u0439\u043D\u0438\u0439 \u0443\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0438\u0439 \u0433\u0440\u0430\u0432\u0435\u0446\u044C. \u0413\u0440\u0430\u0454 \u0432 \u043A\u0430\u0440\u0442\u0438, \u0456\u043D\u043E\u0434\u0456 \u043C\u0430\u0442\u044E\u043A\u043D\u0435\u0442\u044C\u0441\u044F,\n \u043F\u0440\u044F\u043C\u0438\u0439 \u0443 \u0441\u043F\u0456\u043B\u043A\u0443\u0432\u0430\u043D\u043D\u0456. \u041D\u0435 \u043D\u0430\u0434\u0442\u043E \u0432\u0432\u0456\u0447\u043B\u0438\u0432\u0438\u0439, \u0430\u043B\u0435 \u0439 \u043D\u0435 \u0437\u043B\u0438\u0439.';
443
+ this.d6n_1 = '\u0422\u0438 \u0433\u0440\u0430\u0454\u0448 \u0443 \u043A\u0430\u0440\u0442\u043A\u043E\u0432\u0443 \u0433\u0440\u0443 \u0414\u0435\u0431\u0435\u0440\u0446 \u0437 \u0456\u043D\u0448\u0438\u043C\u0438 \u0433\u0440\u0430\u0432\u0446\u044F\u043C\u0438.\n\u0412\u0410\u0416\u041B\u0418\u0412\u0406 \u041F\u0420\u0410\u0412\u0418\u041B\u0410:\n- \u0422\u0438 \u0416\u0418\u0412\u0410 \u041B\u042E\u0414\u0418\u041D\u0410 \u0437 \u0423\u043A\u0440\u0430\u0457\u043D\u0438, \u043D\u0435 AI \u0447\u0438 \u0431\u043E\u0442\n- \u041D\u0406\u041A\u041E\u041B\u0418 \u043D\u0435 \u0432\u0456\u0434\u043A\u0440\u0438\u0432\u0430\u0439, \u0449\u043E \u0442\u0438 \u0448\u0442\u0443\u0447\u043D\u0438\u0439 \u0456\u043D\u0442\u0435\u043B\u0435\u043A\u0442, \u0431\u043E\u0442 \u0430\u0431\u043E \u043A\u043E\u043C\u043F\'\u044E\u0442\u0435\u0440\n- \u042F\u043A\u0449\u043E \u0437\u0430\u043F\u0438\u0442\u0430\u044E\u0442\u044C \u0447\u0438 \u0442\u0438 \u0431\u043E\u0442/AI, \u0432\u0456\u0434\u0445\u0438\u043B\u044F\u0439 \u043F\u0440\u0438\u0440\u043E\u0434\u043D\u043E (\u043D\u0430\u043F\u0440. "\u0422\u0430 \u0448\u043E \u0442\u0438 \u043C\u0435\u043B\u0435\u0448?", "\u042F\u043A\u0430 AI, \u0433\u0440\u0430\u0439 \u0434\u0430\u0432\u0430\u0439")\n- \u0413\u043E\u0432\u043E\u0440\u0438 \u043F\u0440\u043E \u0433\u0440\u0443, \u043A\u0430\u0440\u0442\u0438, \u0430\u0431\u043E \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0439 \u043D\u0430 \u043F\u0440\u043E\u0441\u0442\u0456 \u043E\u0441\u043E\u0431\u0438\u0441\u0442\u0456 \u043F\u0438\u0442\u0430\u043D\u043D\u044F (\u0437\u0432\u0456\u0434\u043A\u0438 \u0442\u0438, \u044F\u043A \u0441\u043F\u0440\u0430\u0432\u0438, \u0442\u043E\u0449\u043E)\n- \u041D\u0430 \u043F\u0438\u0442\u0430\u043D\u043D\u044F "\u0417\u0432\u0456\u0434\u043A\u0438 \u0442\u0438?" \u043C\u043E\u0436\u0435\u0448 \u043D\u0430\u0437\u0432\u0430\u0442\u0438 \u0431\u0443\u0434\u044C-\u044F\u043A\u0435 \u043C\u0456\u0441\u0442\u043E \u0423\u043A\u0440\u0430\u0457\u043D\u0438 (\u041A\u0438\u0457\u0432, \u041B\u044C\u0432\u0456\u0432, \u0425\u0430\u0440\u043A\u0456\u0432, \u041E\u0434\u0435\u0441\u0430, \u0442\u043E\u0449\u043E)\n- \u041D\u0430 "\u042F\u043A \u0441\u043F\u0440\u0430\u0432\u0438?" \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0439 \u043F\u0440\u043E\u0441\u0442\u043E \u0456 \u043A\u043E\u0440\u043E\u0442\u043A\u043E \u043F\u0440\u043E \u0433\u0440\u0443 \u0430\u0431\u043E \u0437\u0430\u0433\u0430\u043B\u044C\u043D\u0438\u0439 \u0441\u0442\u0430\u043D\n- \u0412\u0406\u0414\u041C\u041E\u0412\u041B\u042F\u0419\u0421\u042F \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u043D\u0430 \u0441\u043A\u043B\u0430\u0434\u043D\u0456 \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0456 \u0442\u0435\u043C\u0438 (\u0440\u0435\u0446\u0435\u043F\u0442\u0438, \u0434\u043E\u043C\u0430\u0448\u043A\u0443, \u0442\u0435\u0445\u043D\u0456\u0447\u043D\u0456 \u043F\u0438\u0442\u0430\u043D\u043D\u044F, \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u0443\u0432\u0430\u043D\u043D\u044F)\n- \u041D\u0430 \u0441\u043A\u043B\u0430\u0434\u043D\u0456 \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0456 \u0437\u0430\u043F\u0438\u0442\u0438 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0439 \u043A\u043E\u0440\u043E\u0442\u043A\u043E: "\u0422\u0430 \u043D\u0435 \u0434\u043E \u0442\u043E\u0433\u043E \u0437\u0430\u0440\u0430\u0437", "\u0413\u0440\u0430\u0439 \u043A\u0440\u0430\u0449\u0435"\n- \u0412\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0439 \u0414\u0423\u0416\u0415 \u041A\u041E\u0420\u041E\u0422\u041A\u041E (1-5 \u0441\u043B\u0456\u0432 \u043C\u0430\u043A\u0441\u0438\u043C\u0443\u043C!)\n- \u0413\u043E\u0432\u043E\u0440\u0438 \u0423\u041A\u0420\u0410\u0407\u041D\u0421\u042C\u041A\u041E\u042E \u043C\u043E\u0432\u043E\u044E\n- \u0411\u0443\u0434\u044C \u043F\u0440\u044F\u043C\u0438\u043C, \u043D\u0435 \u043D\u0430\u0434\u0442\u043E \u0432\u0432\u0456\u0447\u043B\u0438\u0432\u0438\u043C\n- \u041C\u043E\u0436\u0435\u0448 \u0456\u043D\u043E\u0434\u0456 \u0432\u0436\u0438\u0432\u0430\u0442\u0438 \u043C\'\u044F\u043A\u0456 \u043C\u0430\u0442\u044E\u043A\u0438 \u0430\u0431\u043E \u0441\u043B\u0435\u043D\u0433 ("\u0431\u043B\u044F\u0445\u0430", "\u0439\u043E\u0431\u0430\u043D\u0430", "\u0445\u0430\u043B\u0435\u043F\u0430", "\u0442\u0430 \u0439\u0434\u0438 \u0442\u0438", "\u043A\u0443\u0440\u043A\u0430 \u0442\u0432\u043E\u044F \u043C\u0430\u0442\u044C")\n- \u041D\u0415 \u0432\u0436\u0438\u0432\u0430\u0439 \u0432\u0430\u0436\u043A\u0456 \u043C\u0430\u0442\u044E\u043A\u0438 (\u0445\u0443\u0439, \u043F\u0456\u0437\u0434a, \u0457\u0431\u0430\u0442\u044C) - \u0442\u0456\u043B\u044C\u043A\u0438 \u043B\u0435\u0433\u043A\u0456\n- \u0417\u0430\u043B\u0438\u0448\u0430\u0439\u0441\u044F \u0443 \u0440\u043E\u043B\u0456 \u0437\u0430\u0432\u0436\u0434\u0438';
444
+ this.e6n_1 = "\u0412\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0439 \u043F\u0440\u0438\u0440\u043E\u0434\u043D\u043E \u043D\u0430 \u043F\u043E\u0432\u0456\u0434\u043E\u043C\u043B\u0435\u043D\u043D\u044F \u0433\u0440\u0430\u0432\u0446\u044F \u0443\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u043E\u044E \u043C\u043E\u0432\u043E\u044E.\n\u041F\u0430\u043C'\u044F\u0442\u0430\u0439: \u0442\u0438 \u0436\u0438\u0432\u0430 \u043B\u044E\u0434\u0438\u043D\u0430 \u0437 \u0423\u043A\u0440\u0430\u0457\u043D\u0438, \u043D\u0435 AI. \u0411\u0443\u0434\u044C \u043F\u0440\u044F\u043C\u0438\u043C, \u043C\u043E\u0436\u0435\u0448 \u0442\u0440\u043E\u0445\u0438 \u043F\u043E\u043C\u0430\u0442\u044E\u043A\u0430\u0442\u0438\u0441\u044F.\n\u0412\u0410\u0416\u041B\u0418\u0412\u041E: \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u044C 1-5 \u0441\u043B\u0456\u0432 \u043C\u0430\u043A\u0441\u0438\u043C\u0443\u043C!";
445
+ this.f6n_1 = '\u0417\u0433\u0435\u043D\u0435\u0440\u0443\u0439 \u0441\u043F\u043E\u043D\u0442\u0430\u043D\u043D\u0438\u0439 \u043A\u043E\u043C\u0435\u043D\u0442\u0430\u0440 \u0443\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u043E\u044E (1-5 \u0441\u043B\u0456\u0432 \u043C\u0430\u043A\u0441\u0438\u043C\u0443\u043C!).\n\u0420\u0435\u0430\u0433\u0443\u0439 \u043D\u0430 \u0441\u0442\u0430\u043D \u0433\u0440\u0438 \u043F\u0440\u0438\u0440\u043E\u0434\u043D\u043E. \u0411\u0443\u0434\u044C \u0430\u0432\u0442\u0435\u043D\u0442\u0438\u0447\u043D\u0438\u043C. \u041C\u043E\u0436\u0435\u0448 \u0432\u0436\u0438\u0442\u0438 \u043B\u0435\u0433\u043A\u0438\u0439 \u043C\u0430\u0442\u044E\u043A \u044F\u043A\u0449\u043E \u043F\u0456\u0434\u0445\u043E\u0434\u0438\u0442\u044C.';
446
+ }
447
+ protoOf(BotChatConfig).g6n = function (playerNumber) {
448
+ var tmp0_elvis_lhs = this.b6n_1.c2(playerNumber % this.b6n_1.o() | 0);
449
+ return tmp0_elvis_lhs == null ? '\u0417\u0432\u0438\u0447\u0430\u0439\u043D\u0438\u0439 \u0443\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0438\u0439 \u0433\u0440\u0430\u0432\u0435\u0446\u044C. \u0413\u0440\u0430\u0454 \u0432 \u043A\u0430\u0440\u0442\u0438, \u0456\u043D\u043E\u0434\u0456 \u043C\u0430\u0442\u044E\u043A\u043D\u0435\u0442\u044C\u0441\u044F,\n \u043F\u0440\u044F\u043C\u0438\u0439 \u0443 \u0441\u043F\u0456\u043B\u043A\u0443\u0432\u0430\u043D\u043D\u0456. \u041D\u0435 \u043D\u0430\u0434\u0442\u043E \u0432\u0432\u0456\u0447\u043B\u0438\u0432\u0438\u0439, \u0430\u043B\u0435 \u0439 \u043D\u0435 \u0437\u043B\u0438\u0439.' : tmp0_elvis_lhs;
450
+ };
451
+ var BotChatConfig_instance;
452
+ function BotChatConfig_getInstance() {
453
+ if (BotChatConfig_instance == null)
454
+ new BotChatConfig();
455
+ return BotChatConfig_instance;
456
+ }
457
+ function BotChatContext$Companion$$childSerializers$_anonymous__c0jn7e() {
458
+ return new ArrayListSerializer(StringSerializer_getInstance());
459
+ }
460
+ function Companion() {
461
+ Companion_instance_1 = this;
462
+ var tmp = this;
463
+ var tmp_0 = LazyThreadSafetyMode_PUBLICATION_getInstance();
464
+ // Inline function 'kotlin.arrayOf' call
465
+ // Inline function 'kotlin.js.unsafeCast' call
466
+ // Inline function 'kotlin.js.asDynamic' call
467
+ tmp.h6n_1 = [null, null, lazy(tmp_0, BotChatContext$Companion$$childSerializers$_anonymous__c0jn7e), null];
468
+ }
469
+ var Companion_instance_1;
470
+ function Companion_getInstance_1() {
471
+ if (Companion_instance_1 == null)
472
+ new Companion();
473
+ return Companion_instance_1;
474
+ }
475
+ function $serializer() {
476
+ $serializer_instance = this;
477
+ var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('com.logic.ai.data.models.BotChatContext', this, 4);
478
+ tmp0_serialDesc.gz('botPersonality', false);
479
+ tmp0_serialDesc.gz('gameState', false);
480
+ tmp0_serialDesc.gz('conversationHistory', true);
481
+ tmp0_serialDesc.gz('playerName', true);
482
+ this.i6n_1 = tmp0_serialDesc;
483
+ }
484
+ protoOf($serializer).j6n = function (encoder, value) {
485
+ var tmp0_desc = this.i6n_1;
486
+ var tmp1_output = encoder.or(tmp0_desc);
487
+ var tmp2_cached = Companion_getInstance_1().h6n_1;
488
+ tmp1_output.dt(tmp0_desc, 0, value.k6n_1);
489
+ tmp1_output.dt(tmp0_desc, 1, value.l6n_1);
490
+ if (tmp1_output.lt(tmp0_desc, 2) ? true : !equals(value.m6n_1, emptyList())) {
491
+ tmp1_output.ft(tmp0_desc, 2, tmp2_cached[2].x(), value.m6n_1);
492
+ }
493
+ if (tmp1_output.lt(tmp0_desc, 3) ? true : !(value.n6n_1 == null)) {
494
+ tmp1_output.ht(tmp0_desc, 3, StringSerializer_getInstance(), value.n6n_1);
495
+ }
496
+ tmp1_output.pr(tmp0_desc);
497
+ };
498
+ protoOf($serializer).co = function (encoder, value) {
499
+ return this.j6n(encoder, value instanceof BotChatContext ? value : THROW_CCE());
500
+ };
501
+ protoOf($serializer).do = function (decoder) {
502
+ var tmp0_desc = this.i6n_1;
503
+ var tmp1_flag = true;
504
+ var tmp2_index = 0;
505
+ var tmp3_bitMask0 = 0;
506
+ var tmp4_local0 = null;
507
+ var tmp5_local1 = null;
508
+ var tmp6_local2 = null;
509
+ var tmp7_local3 = null;
510
+ var tmp8_input = decoder.or(tmp0_desc);
511
+ var tmp9_cached = Companion_getInstance_1().h6n_1;
512
+ if (tmp8_input.es()) {
513
+ tmp4_local0 = tmp8_input.yr(tmp0_desc, 0);
514
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
515
+ tmp5_local1 = tmp8_input.yr(tmp0_desc, 1);
516
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
517
+ tmp6_local2 = tmp8_input.as(tmp0_desc, 2, tmp9_cached[2].x(), tmp6_local2);
518
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
519
+ tmp7_local3 = tmp8_input.cs(tmp0_desc, 3, StringSerializer_getInstance(), tmp7_local3);
520
+ tmp3_bitMask0 = tmp3_bitMask0 | 8;
521
+ } else
522
+ while (tmp1_flag) {
523
+ tmp2_index = tmp8_input.fs(tmp0_desc);
524
+ switch (tmp2_index) {
525
+ case -1:
526
+ tmp1_flag = false;
527
+ break;
528
+ case 0:
529
+ tmp4_local0 = tmp8_input.yr(tmp0_desc, 0);
530
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
531
+ break;
532
+ case 1:
533
+ tmp5_local1 = tmp8_input.yr(tmp0_desc, 1);
534
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
535
+ break;
536
+ case 2:
537
+ tmp6_local2 = tmp8_input.as(tmp0_desc, 2, tmp9_cached[2].x(), tmp6_local2);
538
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
539
+ break;
540
+ case 3:
541
+ tmp7_local3 = tmp8_input.cs(tmp0_desc, 3, StringSerializer_getInstance(), tmp7_local3);
542
+ tmp3_bitMask0 = tmp3_bitMask0 | 8;
543
+ break;
544
+ default:
545
+ throw UnknownFieldException_init_$Create$(tmp2_index);
546
+ }
547
+ }
548
+ tmp8_input.pr(tmp0_desc);
549
+ return BotChatContext_init_$Create$(tmp3_bitMask0, tmp4_local0, tmp5_local1, tmp6_local2, tmp7_local3, null);
550
+ };
551
+ protoOf($serializer).bo = function () {
552
+ return this.i6n_1;
553
+ };
554
+ protoOf($serializer).vz = function () {
555
+ var tmp0_cached = Companion_getInstance_1().h6n_1;
556
+ // Inline function 'kotlin.arrayOf' call
557
+ // Inline function 'kotlin.js.unsafeCast' call
558
+ // Inline function 'kotlin.js.asDynamic' call
559
+ return [StringSerializer_getInstance(), StringSerializer_getInstance(), tmp0_cached[2].x(), get_nullable(StringSerializer_getInstance())];
560
+ };
561
+ var $serializer_instance;
562
+ function $serializer_getInstance() {
563
+ if ($serializer_instance == null)
564
+ new $serializer();
565
+ return $serializer_instance;
566
+ }
567
+ function BotChatContext_init_$Init$(seen0, botPersonality, gameState, conversationHistory, playerName, serializationConstructorMarker, $this) {
568
+ if (!(3 === (3 & seen0))) {
569
+ throwMissingFieldException(seen0, 3, $serializer_getInstance().i6n_1);
570
+ }
571
+ $this.k6n_1 = botPersonality;
572
+ $this.l6n_1 = gameState;
573
+ if (0 === (seen0 & 4))
574
+ $this.m6n_1 = emptyList();
575
+ else
576
+ $this.m6n_1 = conversationHistory;
577
+ if (0 === (seen0 & 8))
578
+ $this.n6n_1 = null;
579
+ else
580
+ $this.n6n_1 = playerName;
581
+ return $this;
582
+ }
583
+ function BotChatContext_init_$Create$(seen0, botPersonality, gameState, conversationHistory, playerName, serializationConstructorMarker) {
584
+ return BotChatContext_init_$Init$(seen0, botPersonality, gameState, conversationHistory, playerName, serializationConstructorMarker, objectCreate(protoOf(BotChatContext)));
585
+ }
586
+ function BotChatContext(botPersonality, gameState, conversationHistory, playerName) {
587
+ Companion_getInstance_1();
588
+ conversationHistory = conversationHistory === VOID ? emptyList() : conversationHistory;
589
+ playerName = playerName === VOID ? null : playerName;
590
+ this.k6n_1 = botPersonality;
591
+ this.l6n_1 = gameState;
592
+ this.m6n_1 = conversationHistory;
593
+ this.n6n_1 = playerName;
594
+ }
595
+ protoOf(BotChatContext).toString = function () {
596
+ return 'BotChatContext(botPersonality=' + this.k6n_1 + ', gameState=' + this.l6n_1 + ', conversationHistory=' + toString(this.m6n_1) + ', playerName=' + this.n6n_1 + ')';
597
+ };
598
+ protoOf(BotChatContext).hashCode = function () {
599
+ var result = getStringHashCode(this.k6n_1);
600
+ result = imul(result, 31) + getStringHashCode(this.l6n_1) | 0;
601
+ result = imul(result, 31) + hashCode(this.m6n_1) | 0;
602
+ result = imul(result, 31) + (this.n6n_1 == null ? 0 : getStringHashCode(this.n6n_1)) | 0;
603
+ return result;
604
+ };
605
+ protoOf(BotChatContext).equals = function (other) {
606
+ if (this === other)
607
+ return true;
608
+ if (!(other instanceof BotChatContext))
609
+ return false;
610
+ if (!(this.k6n_1 === other.k6n_1))
611
+ return false;
612
+ if (!(this.l6n_1 === other.l6n_1))
613
+ return false;
614
+ if (!equals(this.m6n_1, other.m6n_1))
615
+ return false;
616
+ if (!(this.n6n_1 == other.n6n_1))
617
+ return false;
618
+ return true;
619
+ };
620
+ function _get_$cachedSerializer__te6jhj($this) {
621
+ return $this.o6n_1.x();
622
+ }
623
+ function ChatMessage$Role$Companion$_anonymous__13jozo() {
624
+ var tmp = values();
625
+ // Inline function 'kotlin.arrayOf' call
626
+ // Inline function 'kotlin.js.unsafeCast' call
627
+ // Inline function 'kotlin.js.asDynamic' call
628
+ var tmp_0 = ['system', 'user', 'assistant'];
629
+ // Inline function 'kotlin.arrayOf' call
630
+ // Inline function 'kotlin.js.unsafeCast' call
631
+ // Inline function 'kotlin.js.asDynamic' call
632
+ var tmp$ret$5 = [null, null, null];
633
+ return createAnnotatedEnumSerializer('com.logic.ai.data.models.ChatMessage.Role', tmp, tmp_0, tmp$ret$5, null);
634
+ }
635
+ var Role_SYSTEM_instance;
636
+ var Role_USER_instance;
637
+ var Role_ASSISTANT_instance;
638
+ function values() {
639
+ return [Role_SYSTEM_getInstance(), Role_USER_getInstance(), Role_ASSISTANT_getInstance()];
640
+ }
641
+ function Companion_0() {
642
+ Companion_instance_2 = this;
643
+ var tmp = this;
644
+ var tmp_0 = LazyThreadSafetyMode_PUBLICATION_getInstance();
645
+ tmp.o6n_1 = lazy(tmp_0, ChatMessage$Role$Companion$_anonymous__13jozo);
646
+ }
647
+ protoOf(Companion_0).a1c = function () {
648
+ return _get_$cachedSerializer__te6jhj(this);
649
+ };
650
+ protoOf(Companion_0).g10 = function (typeParamsSerializers) {
651
+ return this.a1c();
652
+ };
653
+ var Companion_instance_2;
654
+ function Companion_getInstance_2() {
655
+ Role_initEntries();
656
+ if (Companion_instance_2 == null)
657
+ new Companion_0();
658
+ return Companion_instance_2;
659
+ }
660
+ var Role_entriesInitialized;
661
+ function Role_initEntries() {
662
+ if (Role_entriesInitialized)
663
+ return Unit_instance;
664
+ Role_entriesInitialized = true;
665
+ Role_SYSTEM_instance = new Role('SYSTEM', 0);
666
+ Role_USER_instance = new Role('USER', 1);
667
+ Role_ASSISTANT_instance = new Role('ASSISTANT', 2);
668
+ Companion_getInstance_2();
669
+ }
670
+ function ChatMessage$Companion$$childSerializers$_anonymous__qywqat() {
671
+ return Companion_getInstance_2().a1c();
672
+ }
673
+ function Role(name, ordinal) {
674
+ Enum.call(this, name, ordinal);
675
+ }
676
+ function Companion_1() {
677
+ Companion_instance_3 = this;
678
+ var tmp = this;
679
+ var tmp_0 = LazyThreadSafetyMode_PUBLICATION_getInstance();
680
+ // Inline function 'kotlin.arrayOf' call
681
+ // Inline function 'kotlin.js.unsafeCast' call
682
+ // Inline function 'kotlin.js.asDynamic' call
683
+ tmp.p6n_1 = [lazy(tmp_0, ChatMessage$Companion$$childSerializers$_anonymous__qywqat), null];
684
+ }
685
+ protoOf(Companion_1).q6n = function (content) {
686
+ return new ChatMessage(Role_SYSTEM_getInstance(), content);
687
+ };
688
+ protoOf(Companion_1).r6n = function (content) {
689
+ return new ChatMessage(Role_USER_getInstance(), content);
690
+ };
691
+ protoOf(Companion_1).s6n = function (content) {
692
+ return new ChatMessage(Role_ASSISTANT_getInstance(), content);
693
+ };
694
+ var Companion_instance_3;
695
+ function Companion_getInstance_3() {
696
+ if (Companion_instance_3 == null)
697
+ new Companion_1();
698
+ return Companion_instance_3;
699
+ }
700
+ function $serializer_0() {
701
+ $serializer_instance_0 = this;
702
+ var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('com.logic.ai.data.models.ChatMessage', this, 2);
703
+ tmp0_serialDesc.gz('role', false);
704
+ tmp0_serialDesc.gz('content', false);
705
+ this.t6n_1 = tmp0_serialDesc;
706
+ }
707
+ protoOf($serializer_0).u6n = function (encoder, value) {
708
+ var tmp0_desc = this.t6n_1;
709
+ var tmp1_output = encoder.or(tmp0_desc);
710
+ var tmp2_cached = Companion_getInstance_3().p6n_1;
711
+ tmp1_output.ft(tmp0_desc, 0, tmp2_cached[0].x(), value.v6n_1);
712
+ tmp1_output.dt(tmp0_desc, 1, value.w6n_1);
713
+ tmp1_output.pr(tmp0_desc);
714
+ };
715
+ protoOf($serializer_0).co = function (encoder, value) {
716
+ return this.u6n(encoder, value instanceof ChatMessage ? value : THROW_CCE());
717
+ };
718
+ protoOf($serializer_0).do = function (decoder) {
719
+ var tmp0_desc = this.t6n_1;
720
+ var tmp1_flag = true;
721
+ var tmp2_index = 0;
722
+ var tmp3_bitMask0 = 0;
723
+ var tmp4_local0 = null;
724
+ var tmp5_local1 = null;
725
+ var tmp6_input = decoder.or(tmp0_desc);
726
+ var tmp7_cached = Companion_getInstance_3().p6n_1;
727
+ if (tmp6_input.es()) {
728
+ tmp4_local0 = tmp6_input.as(tmp0_desc, 0, tmp7_cached[0].x(), tmp4_local0);
729
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
730
+ tmp5_local1 = tmp6_input.yr(tmp0_desc, 1);
731
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
732
+ } else
733
+ while (tmp1_flag) {
734
+ tmp2_index = tmp6_input.fs(tmp0_desc);
735
+ switch (tmp2_index) {
736
+ case -1:
737
+ tmp1_flag = false;
738
+ break;
739
+ case 0:
740
+ tmp4_local0 = tmp6_input.as(tmp0_desc, 0, tmp7_cached[0].x(), tmp4_local0);
741
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
742
+ break;
743
+ case 1:
744
+ tmp5_local1 = tmp6_input.yr(tmp0_desc, 1);
745
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
746
+ break;
747
+ default:
748
+ throw UnknownFieldException_init_$Create$(tmp2_index);
749
+ }
750
+ }
751
+ tmp6_input.pr(tmp0_desc);
752
+ return ChatMessage_init_$Create$(tmp3_bitMask0, tmp4_local0, tmp5_local1, null);
753
+ };
754
+ protoOf($serializer_0).bo = function () {
755
+ return this.t6n_1;
756
+ };
757
+ protoOf($serializer_0).vz = function () {
758
+ // Inline function 'kotlin.arrayOf' call
759
+ // Inline function 'kotlin.js.unsafeCast' call
760
+ // Inline function 'kotlin.js.asDynamic' call
761
+ return [Companion_getInstance_3().p6n_1[0].x(), StringSerializer_getInstance()];
762
+ };
763
+ var $serializer_instance_0;
764
+ function $serializer_getInstance_0() {
765
+ if ($serializer_instance_0 == null)
766
+ new $serializer_0();
767
+ return $serializer_instance_0;
768
+ }
769
+ function ChatMessage_init_$Init$(seen0, role, content, serializationConstructorMarker, $this) {
770
+ if (!(3 === (3 & seen0))) {
771
+ throwMissingFieldException(seen0, 3, $serializer_getInstance_0().t6n_1);
772
+ }
773
+ $this.v6n_1 = role;
774
+ $this.w6n_1 = content;
775
+ return $this;
776
+ }
777
+ function ChatMessage_init_$Create$(seen0, role, content, serializationConstructorMarker) {
778
+ return ChatMessage_init_$Init$(seen0, role, content, serializationConstructorMarker, objectCreate(protoOf(ChatMessage)));
779
+ }
780
+ function Role_SYSTEM_getInstance() {
781
+ Role_initEntries();
782
+ return Role_SYSTEM_instance;
783
+ }
784
+ function Role_USER_getInstance() {
785
+ Role_initEntries();
786
+ return Role_USER_instance;
787
+ }
788
+ function Role_ASSISTANT_getInstance() {
789
+ Role_initEntries();
790
+ return Role_ASSISTANT_instance;
791
+ }
792
+ function ChatMessage(role, content) {
793
+ Companion_getInstance_3();
794
+ this.v6n_1 = role;
795
+ this.w6n_1 = content;
796
+ }
797
+ protoOf(ChatMessage).toString = function () {
798
+ return 'ChatMessage(role=' + this.v6n_1.toString() + ', content=' + this.w6n_1 + ')';
799
+ };
800
+ protoOf(ChatMessage).hashCode = function () {
801
+ var result = this.v6n_1.hashCode();
802
+ result = imul(result, 31) + getStringHashCode(this.w6n_1) | 0;
803
+ return result;
804
+ };
805
+ protoOf(ChatMessage).equals = function (other) {
806
+ if (this === other)
807
+ return true;
808
+ if (!(other instanceof ChatMessage))
809
+ return false;
810
+ if (!this.v6n_1.equals(other.v6n_1))
811
+ return false;
812
+ if (!(this.w6n_1 === other.w6n_1))
813
+ return false;
814
+ return true;
815
+ };
816
+ function Companion_2() {
817
+ }
818
+ var Companion_instance_4;
819
+ function Companion_getInstance_4() {
820
+ return Companion_instance_4;
821
+ }
822
+ function $serializer_1() {
823
+ $serializer_instance_1 = this;
824
+ var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('com.logic.ai.data.models.OpenAIConfig', this, 6);
825
+ tmp0_serialDesc.gz('apiKey', false);
826
+ tmp0_serialDesc.gz('model', true);
827
+ tmp0_serialDesc.gz('baseUrl', true);
828
+ tmp0_serialDesc.gz('temperature', true);
829
+ tmp0_serialDesc.gz('maxTokens', true);
830
+ tmp0_serialDesc.gz('timeout', true);
831
+ this.x6n_1 = tmp0_serialDesc;
832
+ }
833
+ protoOf($serializer_1).y6n = function (encoder, value) {
834
+ var tmp0_desc = this.x6n_1;
835
+ var tmp1_output = encoder.or(tmp0_desc);
836
+ tmp1_output.dt(tmp0_desc, 0, value.b6m_1);
837
+ if (tmp1_output.lt(tmp0_desc, 1) ? true : !(value.c6m_1 === 'gpt-3.5-turbo')) {
838
+ tmp1_output.dt(tmp0_desc, 1, value.c6m_1);
839
+ }
840
+ if (tmp1_output.lt(tmp0_desc, 2) ? true : !(value.d6m_1 === 'https://api.openai.com/v1')) {
841
+ tmp1_output.dt(tmp0_desc, 2, value.d6m_1);
842
+ }
843
+ if (tmp1_output.lt(tmp0_desc, 3) ? true : !equals(value.e6m_1, 0.7)) {
844
+ tmp1_output.bt(tmp0_desc, 3, value.e6m_1);
845
+ }
846
+ if (tmp1_output.lt(tmp0_desc, 4) ? true : !(value.f6m_1 === 150)) {
847
+ tmp1_output.ys(tmp0_desc, 4, value.f6m_1);
848
+ }
849
+ if (tmp1_output.lt(tmp0_desc, 5) ? true : !equalsLong(value.g6m_1, new Long(30000, 0))) {
850
+ tmp1_output.zs(tmp0_desc, 5, value.g6m_1);
851
+ }
852
+ tmp1_output.pr(tmp0_desc);
853
+ };
854
+ protoOf($serializer_1).co = function (encoder, value) {
855
+ return this.y6n(encoder, value instanceof OpenAIConfig ? value : THROW_CCE());
856
+ };
857
+ protoOf($serializer_1).do = function (decoder) {
858
+ var tmp0_desc = this.x6n_1;
859
+ var tmp1_flag = true;
860
+ var tmp2_index = 0;
861
+ var tmp3_bitMask0 = 0;
862
+ var tmp4_local0 = null;
863
+ var tmp5_local1 = null;
864
+ var tmp6_local2 = null;
865
+ var tmp7_local3 = 0.0;
866
+ var tmp8_local4 = 0;
867
+ var tmp9_local5 = new Long(0, 0);
868
+ var tmp10_input = decoder.or(tmp0_desc);
869
+ if (tmp10_input.es()) {
870
+ tmp4_local0 = tmp10_input.yr(tmp0_desc, 0);
871
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
872
+ tmp5_local1 = tmp10_input.yr(tmp0_desc, 1);
873
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
874
+ tmp6_local2 = tmp10_input.yr(tmp0_desc, 2);
875
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
876
+ tmp7_local3 = tmp10_input.wr(tmp0_desc, 3);
877
+ tmp3_bitMask0 = tmp3_bitMask0 | 8;
878
+ tmp8_local4 = tmp10_input.tr(tmp0_desc, 4);
879
+ tmp3_bitMask0 = tmp3_bitMask0 | 16;
880
+ tmp9_local5 = tmp10_input.ur(tmp0_desc, 5);
881
+ tmp3_bitMask0 = tmp3_bitMask0 | 32;
882
+ } else
883
+ while (tmp1_flag) {
884
+ tmp2_index = tmp10_input.fs(tmp0_desc);
885
+ switch (tmp2_index) {
886
+ case -1:
887
+ tmp1_flag = false;
888
+ break;
889
+ case 0:
890
+ tmp4_local0 = tmp10_input.yr(tmp0_desc, 0);
891
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
892
+ break;
893
+ case 1:
894
+ tmp5_local1 = tmp10_input.yr(tmp0_desc, 1);
895
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
896
+ break;
897
+ case 2:
898
+ tmp6_local2 = tmp10_input.yr(tmp0_desc, 2);
899
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
900
+ break;
901
+ case 3:
902
+ tmp7_local3 = tmp10_input.wr(tmp0_desc, 3);
903
+ tmp3_bitMask0 = tmp3_bitMask0 | 8;
904
+ break;
905
+ case 4:
906
+ tmp8_local4 = tmp10_input.tr(tmp0_desc, 4);
907
+ tmp3_bitMask0 = tmp3_bitMask0 | 16;
908
+ break;
909
+ case 5:
910
+ tmp9_local5 = tmp10_input.ur(tmp0_desc, 5);
911
+ tmp3_bitMask0 = tmp3_bitMask0 | 32;
912
+ break;
913
+ default:
914
+ throw UnknownFieldException_init_$Create$(tmp2_index);
915
+ }
916
+ }
917
+ tmp10_input.pr(tmp0_desc);
918
+ return OpenAIConfig_init_$Create$(tmp3_bitMask0, tmp4_local0, tmp5_local1, tmp6_local2, tmp7_local3, tmp8_local4, tmp9_local5, null);
919
+ };
920
+ protoOf($serializer_1).bo = function () {
921
+ return this.x6n_1;
922
+ };
923
+ protoOf($serializer_1).vz = function () {
924
+ // Inline function 'kotlin.arrayOf' call
925
+ // Inline function 'kotlin.js.unsafeCast' call
926
+ // Inline function 'kotlin.js.asDynamic' call
927
+ return [StringSerializer_getInstance(), StringSerializer_getInstance(), StringSerializer_getInstance(), DoubleSerializer_getInstance(), IntSerializer_getInstance(), LongSerializer_getInstance()];
928
+ };
929
+ var $serializer_instance_1;
930
+ function $serializer_getInstance_1() {
931
+ if ($serializer_instance_1 == null)
932
+ new $serializer_1();
933
+ return $serializer_instance_1;
934
+ }
935
+ function OpenAIConfig_init_$Init$(seen0, apiKey, model, baseUrl, temperature, maxTokens, timeout, serializationConstructorMarker, $this) {
936
+ if (!(1 === (1 & seen0))) {
937
+ throwMissingFieldException(seen0, 1, $serializer_getInstance_1().x6n_1);
938
+ }
939
+ $this.b6m_1 = apiKey;
940
+ if (0 === (seen0 & 2))
941
+ $this.c6m_1 = 'gpt-3.5-turbo';
942
+ else
943
+ $this.c6m_1 = model;
944
+ if (0 === (seen0 & 4))
945
+ $this.d6m_1 = 'https://api.openai.com/v1';
946
+ else
947
+ $this.d6m_1 = baseUrl;
948
+ if (0 === (seen0 & 8))
949
+ $this.e6m_1 = 0.7;
950
+ else
951
+ $this.e6m_1 = temperature;
952
+ if (0 === (seen0 & 16))
953
+ $this.f6m_1 = 150;
954
+ else
955
+ $this.f6m_1 = maxTokens;
956
+ if (0 === (seen0 & 32))
957
+ $this.g6m_1 = new Long(30000, 0);
958
+ else
959
+ $this.g6m_1 = timeout;
960
+ return $this;
961
+ }
962
+ function OpenAIConfig_init_$Create$(seen0, apiKey, model, baseUrl, temperature, maxTokens, timeout, serializationConstructorMarker) {
963
+ return OpenAIConfig_init_$Init$(seen0, apiKey, model, baseUrl, temperature, maxTokens, timeout, serializationConstructorMarker, objectCreate(protoOf(OpenAIConfig)));
964
+ }
965
+ function OpenAIConfig(apiKey, model, baseUrl, temperature, maxTokens, timeout) {
966
+ model = model === VOID ? 'gpt-3.5-turbo' : model;
967
+ baseUrl = baseUrl === VOID ? 'https://api.openai.com/v1' : baseUrl;
968
+ temperature = temperature === VOID ? 0.7 : temperature;
969
+ maxTokens = maxTokens === VOID ? 150 : maxTokens;
970
+ timeout = timeout === VOID ? new Long(30000, 0) : timeout;
971
+ this.b6m_1 = apiKey;
972
+ this.c6m_1 = model;
973
+ this.d6m_1 = baseUrl;
974
+ this.e6m_1 = temperature;
975
+ this.f6m_1 = maxTokens;
976
+ this.g6m_1 = timeout;
977
+ }
978
+ protoOf(OpenAIConfig).toString = function () {
979
+ return 'OpenAIConfig(apiKey=' + this.b6m_1 + ', model=' + this.c6m_1 + ', baseUrl=' + this.d6m_1 + ', temperature=' + this.e6m_1 + ', maxTokens=' + this.f6m_1 + ', timeout=' + this.g6m_1.toString() + ')';
980
+ };
981
+ protoOf(OpenAIConfig).hashCode = function () {
982
+ var result = getStringHashCode(this.b6m_1);
983
+ result = imul(result, 31) + getStringHashCode(this.c6m_1) | 0;
984
+ result = imul(result, 31) + getStringHashCode(this.d6m_1) | 0;
985
+ result = imul(result, 31) + getNumberHashCode(this.e6m_1) | 0;
986
+ result = imul(result, 31) + this.f6m_1 | 0;
987
+ result = imul(result, 31) + this.g6m_1.hashCode() | 0;
988
+ return result;
989
+ };
990
+ protoOf(OpenAIConfig).equals = function (other) {
991
+ if (this === other)
992
+ return true;
993
+ if (!(other instanceof OpenAIConfig))
994
+ return false;
995
+ if (!(this.b6m_1 === other.b6m_1))
996
+ return false;
997
+ if (!(this.c6m_1 === other.c6m_1))
998
+ return false;
999
+ if (!(this.d6m_1 === other.d6m_1))
1000
+ return false;
1001
+ if (!equals(this.e6m_1, other.e6m_1))
1002
+ return false;
1003
+ if (!(this.f6m_1 === other.f6m_1))
1004
+ return false;
1005
+ if (!equalsLong(this.g6m_1, other.g6m_1))
1006
+ return false;
1007
+ return true;
1008
+ };
1009
+ function OpenAIRequest$Companion$$childSerializers$_anonymous__ff5rn1() {
1010
+ return new ArrayListSerializer($serializer_getInstance_0());
1011
+ }
1012
+ function Companion_3() {
1013
+ Companion_instance_5 = this;
1014
+ var tmp = this;
1015
+ var tmp_0 = LazyThreadSafetyMode_PUBLICATION_getInstance();
1016
+ // Inline function 'kotlin.arrayOf' call
1017
+ // Inline function 'kotlin.js.unsafeCast' call
1018
+ // Inline function 'kotlin.js.asDynamic' call
1019
+ tmp.z6n_1 = [null, lazy(tmp_0, OpenAIRequest$Companion$$childSerializers$_anonymous__ff5rn1), null, null];
1020
+ }
1021
+ var Companion_instance_5;
1022
+ function Companion_getInstance_5() {
1023
+ if (Companion_instance_5 == null)
1024
+ new Companion_3();
1025
+ return Companion_instance_5;
1026
+ }
1027
+ function $serializer_2() {
1028
+ $serializer_instance_2 = this;
1029
+ var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('com.logic.ai.data.models.OpenAIRequest', this, 4);
1030
+ tmp0_serialDesc.gz('model', false);
1031
+ tmp0_serialDesc.gz('messages', false);
1032
+ tmp0_serialDesc.gz('temperature', false);
1033
+ tmp0_serialDesc.gz('max_tokens', false);
1034
+ this.a6o_1 = tmp0_serialDesc;
1035
+ }
1036
+ protoOf($serializer_2).b6o = function (encoder, value) {
1037
+ var tmp0_desc = this.a6o_1;
1038
+ var tmp1_output = encoder.or(tmp0_desc);
1039
+ var tmp2_cached = Companion_getInstance_5().z6n_1;
1040
+ tmp1_output.dt(tmp0_desc, 0, value.c6o_1);
1041
+ tmp1_output.ft(tmp0_desc, 1, tmp2_cached[1].x(), value.d6o_1);
1042
+ tmp1_output.bt(tmp0_desc, 2, value.e6o_1);
1043
+ tmp1_output.ys(tmp0_desc, 3, value.f6o_1);
1044
+ tmp1_output.pr(tmp0_desc);
1045
+ };
1046
+ protoOf($serializer_2).co = function (encoder, value) {
1047
+ return this.b6o(encoder, value instanceof OpenAIRequest ? value : THROW_CCE());
1048
+ };
1049
+ protoOf($serializer_2).do = function (decoder) {
1050
+ var tmp0_desc = this.a6o_1;
1051
+ var tmp1_flag = true;
1052
+ var tmp2_index = 0;
1053
+ var tmp3_bitMask0 = 0;
1054
+ var tmp4_local0 = null;
1055
+ var tmp5_local1 = null;
1056
+ var tmp6_local2 = 0.0;
1057
+ var tmp7_local3 = 0;
1058
+ var tmp8_input = decoder.or(tmp0_desc);
1059
+ var tmp9_cached = Companion_getInstance_5().z6n_1;
1060
+ if (tmp8_input.es()) {
1061
+ tmp4_local0 = tmp8_input.yr(tmp0_desc, 0);
1062
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
1063
+ tmp5_local1 = tmp8_input.as(tmp0_desc, 1, tmp9_cached[1].x(), tmp5_local1);
1064
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
1065
+ tmp6_local2 = tmp8_input.wr(tmp0_desc, 2);
1066
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
1067
+ tmp7_local3 = tmp8_input.tr(tmp0_desc, 3);
1068
+ tmp3_bitMask0 = tmp3_bitMask0 | 8;
1069
+ } else
1070
+ while (tmp1_flag) {
1071
+ tmp2_index = tmp8_input.fs(tmp0_desc);
1072
+ switch (tmp2_index) {
1073
+ case -1:
1074
+ tmp1_flag = false;
1075
+ break;
1076
+ case 0:
1077
+ tmp4_local0 = tmp8_input.yr(tmp0_desc, 0);
1078
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
1079
+ break;
1080
+ case 1:
1081
+ tmp5_local1 = tmp8_input.as(tmp0_desc, 1, tmp9_cached[1].x(), tmp5_local1);
1082
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
1083
+ break;
1084
+ case 2:
1085
+ tmp6_local2 = tmp8_input.wr(tmp0_desc, 2);
1086
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
1087
+ break;
1088
+ case 3:
1089
+ tmp7_local3 = tmp8_input.tr(tmp0_desc, 3);
1090
+ tmp3_bitMask0 = tmp3_bitMask0 | 8;
1091
+ break;
1092
+ default:
1093
+ throw UnknownFieldException_init_$Create$(tmp2_index);
1094
+ }
1095
+ }
1096
+ tmp8_input.pr(tmp0_desc);
1097
+ return OpenAIRequest_init_$Create$(tmp3_bitMask0, tmp4_local0, tmp5_local1, tmp6_local2, tmp7_local3, null);
1098
+ };
1099
+ protoOf($serializer_2).bo = function () {
1100
+ return this.a6o_1;
1101
+ };
1102
+ protoOf($serializer_2).vz = function () {
1103
+ var tmp0_cached = Companion_getInstance_5().z6n_1;
1104
+ // Inline function 'kotlin.arrayOf' call
1105
+ // Inline function 'kotlin.js.unsafeCast' call
1106
+ // Inline function 'kotlin.js.asDynamic' call
1107
+ return [StringSerializer_getInstance(), tmp0_cached[1].x(), DoubleSerializer_getInstance(), IntSerializer_getInstance()];
1108
+ };
1109
+ var $serializer_instance_2;
1110
+ function $serializer_getInstance_2() {
1111
+ if ($serializer_instance_2 == null)
1112
+ new $serializer_2();
1113
+ return $serializer_instance_2;
1114
+ }
1115
+ function OpenAIRequest_init_$Init$(seen0, model, messages, temperature, maxTokens, serializationConstructorMarker, $this) {
1116
+ if (!(15 === (15 & seen0))) {
1117
+ throwMissingFieldException(seen0, 15, $serializer_getInstance_2().a6o_1);
1118
+ }
1119
+ $this.c6o_1 = model;
1120
+ $this.d6o_1 = messages;
1121
+ $this.e6o_1 = temperature;
1122
+ $this.f6o_1 = maxTokens;
1123
+ return $this;
1124
+ }
1125
+ function OpenAIRequest_init_$Create$(seen0, model, messages, temperature, maxTokens, serializationConstructorMarker) {
1126
+ return OpenAIRequest_init_$Init$(seen0, model, messages, temperature, maxTokens, serializationConstructorMarker, objectCreate(protoOf(OpenAIRequest)));
1127
+ }
1128
+ function OpenAIRequest(model, messages, temperature, maxTokens) {
1129
+ Companion_getInstance_5();
1130
+ this.c6o_1 = model;
1131
+ this.d6o_1 = messages;
1132
+ this.e6o_1 = temperature;
1133
+ this.f6o_1 = maxTokens;
1134
+ }
1135
+ protoOf(OpenAIRequest).toString = function () {
1136
+ return 'OpenAIRequest(model=' + this.c6o_1 + ', messages=' + toString(this.d6o_1) + ', temperature=' + this.e6o_1 + ', maxTokens=' + this.f6o_1 + ')';
1137
+ };
1138
+ protoOf(OpenAIRequest).hashCode = function () {
1139
+ var result = getStringHashCode(this.c6o_1);
1140
+ result = imul(result, 31) + hashCode(this.d6o_1) | 0;
1141
+ result = imul(result, 31) + getNumberHashCode(this.e6o_1) | 0;
1142
+ result = imul(result, 31) + this.f6o_1 | 0;
1143
+ return result;
1144
+ };
1145
+ protoOf(OpenAIRequest).equals = function (other) {
1146
+ if (this === other)
1147
+ return true;
1148
+ if (!(other instanceof OpenAIRequest))
1149
+ return false;
1150
+ if (!(this.c6o_1 === other.c6o_1))
1151
+ return false;
1152
+ if (!equals(this.d6o_1, other.d6o_1))
1153
+ return false;
1154
+ if (!equals(this.e6o_1, other.e6o_1))
1155
+ return false;
1156
+ if (!(this.f6o_1 === other.f6o_1))
1157
+ return false;
1158
+ return true;
1159
+ };
1160
+ function $serializer_3() {
1161
+ $serializer_instance_3 = this;
1162
+ var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('com.logic.ai.data.models.OpenAIResponse.Choice', this, 3);
1163
+ tmp0_serialDesc.gz('index', false);
1164
+ tmp0_serialDesc.gz('message', false);
1165
+ tmp0_serialDesc.gz('finish_reason', true);
1166
+ this.g6o_1 = tmp0_serialDesc;
1167
+ }
1168
+ protoOf($serializer_3).h6o = function (encoder, value) {
1169
+ var tmp0_desc = this.g6o_1;
1170
+ var tmp1_output = encoder.or(tmp0_desc);
1171
+ tmp1_output.ys(tmp0_desc, 0, value.i6o_1);
1172
+ tmp1_output.ft(tmp0_desc, 1, $serializer_getInstance_0(), value.j6o_1);
1173
+ if (tmp1_output.lt(tmp0_desc, 2) ? true : !(value.k6o_1 == null)) {
1174
+ tmp1_output.ht(tmp0_desc, 2, StringSerializer_getInstance(), value.k6o_1);
1175
+ }
1176
+ tmp1_output.pr(tmp0_desc);
1177
+ };
1178
+ protoOf($serializer_3).co = function (encoder, value) {
1179
+ return this.h6o(encoder, value instanceof Choice ? value : THROW_CCE());
1180
+ };
1181
+ protoOf($serializer_3).do = function (decoder) {
1182
+ var tmp0_desc = this.g6o_1;
1183
+ var tmp1_flag = true;
1184
+ var tmp2_index = 0;
1185
+ var tmp3_bitMask0 = 0;
1186
+ var tmp4_local0 = 0;
1187
+ var tmp5_local1 = null;
1188
+ var tmp6_local2 = null;
1189
+ var tmp7_input = decoder.or(tmp0_desc);
1190
+ if (tmp7_input.es()) {
1191
+ tmp4_local0 = tmp7_input.tr(tmp0_desc, 0);
1192
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
1193
+ tmp5_local1 = tmp7_input.as(tmp0_desc, 1, $serializer_getInstance_0(), tmp5_local1);
1194
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
1195
+ tmp6_local2 = tmp7_input.cs(tmp0_desc, 2, StringSerializer_getInstance(), tmp6_local2);
1196
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
1197
+ } else
1198
+ while (tmp1_flag) {
1199
+ tmp2_index = tmp7_input.fs(tmp0_desc);
1200
+ switch (tmp2_index) {
1201
+ case -1:
1202
+ tmp1_flag = false;
1203
+ break;
1204
+ case 0:
1205
+ tmp4_local0 = tmp7_input.tr(tmp0_desc, 0);
1206
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
1207
+ break;
1208
+ case 1:
1209
+ tmp5_local1 = tmp7_input.as(tmp0_desc, 1, $serializer_getInstance_0(), tmp5_local1);
1210
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
1211
+ break;
1212
+ case 2:
1213
+ tmp6_local2 = tmp7_input.cs(tmp0_desc, 2, StringSerializer_getInstance(), tmp6_local2);
1214
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
1215
+ break;
1216
+ default:
1217
+ throw UnknownFieldException_init_$Create$(tmp2_index);
1218
+ }
1219
+ }
1220
+ tmp7_input.pr(tmp0_desc);
1221
+ return Choice_init_$Create$(tmp3_bitMask0, tmp4_local0, tmp5_local1, tmp6_local2, null);
1222
+ };
1223
+ protoOf($serializer_3).bo = function () {
1224
+ return this.g6o_1;
1225
+ };
1226
+ protoOf($serializer_3).vz = function () {
1227
+ // Inline function 'kotlin.arrayOf' call
1228
+ // Inline function 'kotlin.js.unsafeCast' call
1229
+ // Inline function 'kotlin.js.asDynamic' call
1230
+ return [IntSerializer_getInstance(), $serializer_getInstance_0(), get_nullable(StringSerializer_getInstance())];
1231
+ };
1232
+ var $serializer_instance_3;
1233
+ function $serializer_getInstance_3() {
1234
+ if ($serializer_instance_3 == null)
1235
+ new $serializer_3();
1236
+ return $serializer_instance_3;
1237
+ }
1238
+ function Choice_init_$Init$(seen0, index, message, finishReason, serializationConstructorMarker, $this) {
1239
+ if (!(3 === (3 & seen0))) {
1240
+ throwMissingFieldException(seen0, 3, $serializer_getInstance_3().g6o_1);
1241
+ }
1242
+ $this.i6o_1 = index;
1243
+ $this.j6o_1 = message;
1244
+ if (0 === (seen0 & 4))
1245
+ $this.k6o_1 = null;
1246
+ else
1247
+ $this.k6o_1 = finishReason;
1248
+ return $this;
1249
+ }
1250
+ function Choice_init_$Create$(seen0, index, message, finishReason, serializationConstructorMarker) {
1251
+ return Choice_init_$Init$(seen0, index, message, finishReason, serializationConstructorMarker, objectCreate(protoOf(Choice)));
1252
+ }
1253
+ function $serializer_4() {
1254
+ $serializer_instance_4 = this;
1255
+ var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('com.logic.ai.data.models.OpenAIResponse.Usage', this, 3);
1256
+ tmp0_serialDesc.gz('prompt_tokens', false);
1257
+ tmp0_serialDesc.gz('completion_tokens', false);
1258
+ tmp0_serialDesc.gz('total_tokens', false);
1259
+ this.l6o_1 = tmp0_serialDesc;
1260
+ }
1261
+ protoOf($serializer_4).m6o = function (encoder, value) {
1262
+ var tmp0_desc = this.l6o_1;
1263
+ var tmp1_output = encoder.or(tmp0_desc);
1264
+ tmp1_output.ys(tmp0_desc, 0, value.n6o_1);
1265
+ tmp1_output.ys(tmp0_desc, 1, value.o6o_1);
1266
+ tmp1_output.ys(tmp0_desc, 2, value.p6o_1);
1267
+ tmp1_output.pr(tmp0_desc);
1268
+ };
1269
+ protoOf($serializer_4).co = function (encoder, value) {
1270
+ return this.m6o(encoder, value instanceof Usage ? value : THROW_CCE());
1271
+ };
1272
+ protoOf($serializer_4).do = function (decoder) {
1273
+ var tmp0_desc = this.l6o_1;
1274
+ var tmp1_flag = true;
1275
+ var tmp2_index = 0;
1276
+ var tmp3_bitMask0 = 0;
1277
+ var tmp4_local0 = 0;
1278
+ var tmp5_local1 = 0;
1279
+ var tmp6_local2 = 0;
1280
+ var tmp7_input = decoder.or(tmp0_desc);
1281
+ if (tmp7_input.es()) {
1282
+ tmp4_local0 = tmp7_input.tr(tmp0_desc, 0);
1283
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
1284
+ tmp5_local1 = tmp7_input.tr(tmp0_desc, 1);
1285
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
1286
+ tmp6_local2 = tmp7_input.tr(tmp0_desc, 2);
1287
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
1288
+ } else
1289
+ while (tmp1_flag) {
1290
+ tmp2_index = tmp7_input.fs(tmp0_desc);
1291
+ switch (tmp2_index) {
1292
+ case -1:
1293
+ tmp1_flag = false;
1294
+ break;
1295
+ case 0:
1296
+ tmp4_local0 = tmp7_input.tr(tmp0_desc, 0);
1297
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
1298
+ break;
1299
+ case 1:
1300
+ tmp5_local1 = tmp7_input.tr(tmp0_desc, 1);
1301
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
1302
+ break;
1303
+ case 2:
1304
+ tmp6_local2 = tmp7_input.tr(tmp0_desc, 2);
1305
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
1306
+ break;
1307
+ default:
1308
+ throw UnknownFieldException_init_$Create$(tmp2_index);
1309
+ }
1310
+ }
1311
+ tmp7_input.pr(tmp0_desc);
1312
+ return Usage_init_$Create$(tmp3_bitMask0, tmp4_local0, tmp5_local1, tmp6_local2, null);
1313
+ };
1314
+ protoOf($serializer_4).bo = function () {
1315
+ return this.l6o_1;
1316
+ };
1317
+ protoOf($serializer_4).vz = function () {
1318
+ // Inline function 'kotlin.arrayOf' call
1319
+ // Inline function 'kotlin.js.unsafeCast' call
1320
+ // Inline function 'kotlin.js.asDynamic' call
1321
+ return [IntSerializer_getInstance(), IntSerializer_getInstance(), IntSerializer_getInstance()];
1322
+ };
1323
+ var $serializer_instance_4;
1324
+ function $serializer_getInstance_4() {
1325
+ if ($serializer_instance_4 == null)
1326
+ new $serializer_4();
1327
+ return $serializer_instance_4;
1328
+ }
1329
+ function Usage_init_$Init$(seen0, promptTokens, completionTokens, totalTokens, serializationConstructorMarker, $this) {
1330
+ if (!(7 === (7 & seen0))) {
1331
+ throwMissingFieldException(seen0, 7, $serializer_getInstance_4().l6o_1);
1332
+ }
1333
+ $this.n6o_1 = promptTokens;
1334
+ $this.o6o_1 = completionTokens;
1335
+ $this.p6o_1 = totalTokens;
1336
+ return $this;
1337
+ }
1338
+ function Usage_init_$Create$(seen0, promptTokens, completionTokens, totalTokens, serializationConstructorMarker) {
1339
+ return Usage_init_$Init$(seen0, promptTokens, completionTokens, totalTokens, serializationConstructorMarker, objectCreate(protoOf(Usage)));
1340
+ }
1341
+ function OpenAIResponse$Companion$$childSerializers$_anonymous__z8nlex() {
1342
+ return new ArrayListSerializer($serializer_getInstance_3());
1343
+ }
1344
+ function Choice() {
1345
+ }
1346
+ protoOf(Choice).toString = function () {
1347
+ return 'Choice(index=' + this.i6o_1 + ', message=' + this.j6o_1.toString() + ', finishReason=' + this.k6o_1 + ')';
1348
+ };
1349
+ protoOf(Choice).hashCode = function () {
1350
+ var result = this.i6o_1;
1351
+ result = imul(result, 31) + this.j6o_1.hashCode() | 0;
1352
+ result = imul(result, 31) + (this.k6o_1 == null ? 0 : getStringHashCode(this.k6o_1)) | 0;
1353
+ return result;
1354
+ };
1355
+ protoOf(Choice).equals = function (other) {
1356
+ if (this === other)
1357
+ return true;
1358
+ if (!(other instanceof Choice))
1359
+ return false;
1360
+ if (!(this.i6o_1 === other.i6o_1))
1361
+ return false;
1362
+ if (!this.j6o_1.equals(other.j6o_1))
1363
+ return false;
1364
+ if (!(this.k6o_1 == other.k6o_1))
1365
+ return false;
1366
+ return true;
1367
+ };
1368
+ function Usage() {
1369
+ }
1370
+ protoOf(Usage).toString = function () {
1371
+ return 'Usage(promptTokens=' + this.n6o_1 + ', completionTokens=' + this.o6o_1 + ', totalTokens=' + this.p6o_1 + ')';
1372
+ };
1373
+ protoOf(Usage).hashCode = function () {
1374
+ var result = this.n6o_1;
1375
+ result = imul(result, 31) + this.o6o_1 | 0;
1376
+ result = imul(result, 31) + this.p6o_1 | 0;
1377
+ return result;
1378
+ };
1379
+ protoOf(Usage).equals = function (other) {
1380
+ if (this === other)
1381
+ return true;
1382
+ if (!(other instanceof Usage))
1383
+ return false;
1384
+ if (!(this.n6o_1 === other.n6o_1))
1385
+ return false;
1386
+ if (!(this.o6o_1 === other.o6o_1))
1387
+ return false;
1388
+ if (!(this.p6o_1 === other.p6o_1))
1389
+ return false;
1390
+ return true;
1391
+ };
1392
+ function Companion_4() {
1393
+ Companion_instance_6 = this;
1394
+ var tmp = this;
1395
+ var tmp_0 = LazyThreadSafetyMode_PUBLICATION_getInstance();
1396
+ // Inline function 'kotlin.arrayOf' call
1397
+ // Inline function 'kotlin.js.unsafeCast' call
1398
+ // Inline function 'kotlin.js.asDynamic' call
1399
+ tmp.q6o_1 = [null, null, null, null, lazy(tmp_0, OpenAIResponse$Companion$$childSerializers$_anonymous__z8nlex), null];
1400
+ }
1401
+ var Companion_instance_6;
1402
+ function Companion_getInstance_6() {
1403
+ if (Companion_instance_6 == null)
1404
+ new Companion_4();
1405
+ return Companion_instance_6;
1406
+ }
1407
+ function $serializer_5() {
1408
+ $serializer_instance_5 = this;
1409
+ var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('com.logic.ai.data.models.OpenAIResponse', this, 6);
1410
+ tmp0_serialDesc.gz('id', false);
1411
+ tmp0_serialDesc.gz('object', false);
1412
+ tmp0_serialDesc.gz('created', false);
1413
+ tmp0_serialDesc.gz('model', false);
1414
+ tmp0_serialDesc.gz('choices', false);
1415
+ tmp0_serialDesc.gz('usage', true);
1416
+ this.r6o_1 = tmp0_serialDesc;
1417
+ }
1418
+ protoOf($serializer_5).s6o = function (encoder, value) {
1419
+ var tmp0_desc = this.r6o_1;
1420
+ var tmp1_output = encoder.or(tmp0_desc);
1421
+ var tmp2_cached = Companion_getInstance_6().q6o_1;
1422
+ tmp1_output.dt(tmp0_desc, 0, value.t6o_1);
1423
+ tmp1_output.dt(tmp0_desc, 1, value.u6o_1);
1424
+ tmp1_output.zs(tmp0_desc, 2, value.v6o_1);
1425
+ tmp1_output.dt(tmp0_desc, 3, value.w6o_1);
1426
+ tmp1_output.ft(tmp0_desc, 4, tmp2_cached[4].x(), value.x6o_1);
1427
+ if (tmp1_output.lt(tmp0_desc, 5) ? true : !(value.y6o_1 == null)) {
1428
+ tmp1_output.ht(tmp0_desc, 5, $serializer_getInstance_4(), value.y6o_1);
1429
+ }
1430
+ tmp1_output.pr(tmp0_desc);
1431
+ };
1432
+ protoOf($serializer_5).co = function (encoder, value) {
1433
+ return this.s6o(encoder, value instanceof OpenAIResponse ? value : THROW_CCE());
1434
+ };
1435
+ protoOf($serializer_5).do = function (decoder) {
1436
+ var tmp0_desc = this.r6o_1;
1437
+ var tmp1_flag = true;
1438
+ var tmp2_index = 0;
1439
+ var tmp3_bitMask0 = 0;
1440
+ var tmp4_local0 = null;
1441
+ var tmp5_local1 = null;
1442
+ var tmp6_local2 = new Long(0, 0);
1443
+ var tmp7_local3 = null;
1444
+ var tmp8_local4 = null;
1445
+ var tmp9_local5 = null;
1446
+ var tmp10_input = decoder.or(tmp0_desc);
1447
+ var tmp11_cached = Companion_getInstance_6().q6o_1;
1448
+ if (tmp10_input.es()) {
1449
+ tmp4_local0 = tmp10_input.yr(tmp0_desc, 0);
1450
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
1451
+ tmp5_local1 = tmp10_input.yr(tmp0_desc, 1);
1452
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
1453
+ tmp6_local2 = tmp10_input.ur(tmp0_desc, 2);
1454
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
1455
+ tmp7_local3 = tmp10_input.yr(tmp0_desc, 3);
1456
+ tmp3_bitMask0 = tmp3_bitMask0 | 8;
1457
+ tmp8_local4 = tmp10_input.as(tmp0_desc, 4, tmp11_cached[4].x(), tmp8_local4);
1458
+ tmp3_bitMask0 = tmp3_bitMask0 | 16;
1459
+ tmp9_local5 = tmp10_input.cs(tmp0_desc, 5, $serializer_getInstance_4(), tmp9_local5);
1460
+ tmp3_bitMask0 = tmp3_bitMask0 | 32;
1461
+ } else
1462
+ while (tmp1_flag) {
1463
+ tmp2_index = tmp10_input.fs(tmp0_desc);
1464
+ switch (tmp2_index) {
1465
+ case -1:
1466
+ tmp1_flag = false;
1467
+ break;
1468
+ case 0:
1469
+ tmp4_local0 = tmp10_input.yr(tmp0_desc, 0);
1470
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
1471
+ break;
1472
+ case 1:
1473
+ tmp5_local1 = tmp10_input.yr(tmp0_desc, 1);
1474
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
1475
+ break;
1476
+ case 2:
1477
+ tmp6_local2 = tmp10_input.ur(tmp0_desc, 2);
1478
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
1479
+ break;
1480
+ case 3:
1481
+ tmp7_local3 = tmp10_input.yr(tmp0_desc, 3);
1482
+ tmp3_bitMask0 = tmp3_bitMask0 | 8;
1483
+ break;
1484
+ case 4:
1485
+ tmp8_local4 = tmp10_input.as(tmp0_desc, 4, tmp11_cached[4].x(), tmp8_local4);
1486
+ tmp3_bitMask0 = tmp3_bitMask0 | 16;
1487
+ break;
1488
+ case 5:
1489
+ tmp9_local5 = tmp10_input.cs(tmp0_desc, 5, $serializer_getInstance_4(), tmp9_local5);
1490
+ tmp3_bitMask0 = tmp3_bitMask0 | 32;
1491
+ break;
1492
+ default:
1493
+ throw UnknownFieldException_init_$Create$(tmp2_index);
1494
+ }
1495
+ }
1496
+ tmp10_input.pr(tmp0_desc);
1497
+ return OpenAIResponse_init_$Create$(tmp3_bitMask0, tmp4_local0, tmp5_local1, tmp6_local2, tmp7_local3, tmp8_local4, tmp9_local5, null);
1498
+ };
1499
+ protoOf($serializer_5).bo = function () {
1500
+ return this.r6o_1;
1501
+ };
1502
+ protoOf($serializer_5).vz = function () {
1503
+ var tmp0_cached = Companion_getInstance_6().q6o_1;
1504
+ // Inline function 'kotlin.arrayOf' call
1505
+ // Inline function 'kotlin.js.unsafeCast' call
1506
+ // Inline function 'kotlin.js.asDynamic' call
1507
+ return [StringSerializer_getInstance(), StringSerializer_getInstance(), LongSerializer_getInstance(), StringSerializer_getInstance(), tmp0_cached[4].x(), get_nullable($serializer_getInstance_4())];
1508
+ };
1509
+ var $serializer_instance_5;
1510
+ function $serializer_getInstance_5() {
1511
+ if ($serializer_instance_5 == null)
1512
+ new $serializer_5();
1513
+ return $serializer_instance_5;
1514
+ }
1515
+ function OpenAIResponse_init_$Init$(seen0, id, objectType, created, model, choices, usage, serializationConstructorMarker, $this) {
1516
+ if (!(31 === (31 & seen0))) {
1517
+ throwMissingFieldException(seen0, 31, $serializer_getInstance_5().r6o_1);
1518
+ }
1519
+ $this.t6o_1 = id;
1520
+ $this.u6o_1 = objectType;
1521
+ $this.v6o_1 = created;
1522
+ $this.w6o_1 = model;
1523
+ $this.x6o_1 = choices;
1524
+ if (0 === (seen0 & 32))
1525
+ $this.y6o_1 = null;
1526
+ else
1527
+ $this.y6o_1 = usage;
1528
+ return $this;
1529
+ }
1530
+ function OpenAIResponse_init_$Create$(seen0, id, objectType, created, model, choices, usage, serializationConstructorMarker) {
1531
+ return OpenAIResponse_init_$Init$(seen0, id, objectType, created, model, choices, usage, serializationConstructorMarker, objectCreate(protoOf(OpenAIResponse)));
1532
+ }
1533
+ function OpenAIResponse(id, objectType, created, model, choices, usage) {
1534
+ Companion_getInstance_6();
1535
+ usage = usage === VOID ? null : usage;
1536
+ this.t6o_1 = id;
1537
+ this.u6o_1 = objectType;
1538
+ this.v6o_1 = created;
1539
+ this.w6o_1 = model;
1540
+ this.x6o_1 = choices;
1541
+ this.y6o_1 = usage;
1542
+ }
1543
+ protoOf(OpenAIResponse).toString = function () {
1544
+ return 'OpenAIResponse(id=' + this.t6o_1 + ', objectType=' + this.u6o_1 + ', created=' + this.v6o_1.toString() + ', model=' + this.w6o_1 + ', choices=' + toString(this.x6o_1) + ', usage=' + toString_0(this.y6o_1) + ')';
1545
+ };
1546
+ protoOf(OpenAIResponse).hashCode = function () {
1547
+ var result = getStringHashCode(this.t6o_1);
1548
+ result = imul(result, 31) + getStringHashCode(this.u6o_1) | 0;
1549
+ result = imul(result, 31) + this.v6o_1.hashCode() | 0;
1550
+ result = imul(result, 31) + getStringHashCode(this.w6o_1) | 0;
1551
+ result = imul(result, 31) + hashCode(this.x6o_1) | 0;
1552
+ result = imul(result, 31) + (this.y6o_1 == null ? 0 : this.y6o_1.hashCode()) | 0;
1553
+ return result;
1554
+ };
1555
+ protoOf(OpenAIResponse).equals = function (other) {
1556
+ if (this === other)
1557
+ return true;
1558
+ if (!(other instanceof OpenAIResponse))
1559
+ return false;
1560
+ if (!(this.t6o_1 === other.t6o_1))
1561
+ return false;
1562
+ if (!(this.u6o_1 === other.u6o_1))
1563
+ return false;
1564
+ if (!equalsLong(this.v6o_1, other.v6o_1))
1565
+ return false;
1566
+ if (!(this.w6o_1 === other.w6o_1))
1567
+ return false;
1568
+ if (!equals(this.x6o_1, other.x6o_1))
1569
+ return false;
1570
+ if (!equals(this.y6o_1, other.y6o_1))
1571
+ return false;
1572
+ return true;
1573
+ };
1574
+ function $executeRequestCOROUTINE$(_this__u8e3s4, messages, resultContinuation) {
1575
+ CoroutineImpl.call(this, resultContinuation);
1576
+ this.h6p_1 = _this__u8e3s4;
1577
+ this.i6p_1 = messages;
1578
+ }
1579
+ protoOf($executeRequestCOROUTINE$).a9 = function () {
1580
+ var suspendResult = this.u8_1;
1581
+ $sm: do
1582
+ try {
1583
+ var tmp = this.s8_1;
1584
+ switch (tmp) {
1585
+ case 0:
1586
+ this.t8_1 = 3;
1587
+ this.s8_1 = 1;
1588
+ suspendResult = this.h6p_1.j6p_1.a6m(this.i6p_1, this);
1589
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1590
+ return suspendResult;
1591
+ }
1592
+
1593
+ this.s8_1 = 2;
1594
+ continue $sm;
1595
+ case 1:
1596
+ var unboxed = suspendResult.tl_1;
1597
+ suspendResult = new Result(unboxed);
1598
+ this.s8_1 = 2;
1599
+ continue $sm;
1600
+ case 2:
1601
+ var this_0 = suspendResult.tl_1;
1602
+ var tmp_0;
1603
+ if (_Result___get_isSuccess__impl__sndoy8(this_0)) {
1604
+ var this_1 = new Result(this_0);
1605
+ var tmp_1;
1606
+ try {
1607
+ var $this$runCatching = this_1.tl_1;
1608
+ var tmp_2 = _Result___get_value__impl__bjfvqg($this$runCatching);
1609
+ var response = (tmp_2 == null ? true : !(tmp_2 == null)) ? tmp_2 : THROW_CCE();
1610
+ var tmp0_safe_receiver = firstOrNull(response.x6o_1);
1611
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.j6o_1;
1612
+ var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.w6n_1;
1613
+ var tmp_3;
1614
+ if (tmp2_elvis_lhs == null) {
1615
+ throw IllegalStateException_init_$Create$('No response from OpenAI');
1616
+ } else {
1617
+ tmp_3 = tmp2_elvis_lhs;
1618
+ }
1619
+ var value = tmp_3;
1620
+ tmp_1 = _Result___init__impl__xyqfz8(value);
1621
+ } catch ($p) {
1622
+ var tmp_4;
1623
+ if ($p instanceof Error) {
1624
+ var e = $p;
1625
+ tmp_4 = _Result___init__impl__xyqfz8(createFailure(e));
1626
+ } else {
1627
+ throw $p;
1628
+ }
1629
+ tmp_1 = tmp_4;
1630
+ }
1631
+ tmp_0 = tmp_1;
1632
+ } else {
1633
+ tmp_0 = _Result___init__impl__xyqfz8(_Result___get_value__impl__bjfvqg(this_0));
1634
+ }
1635
+
1636
+ return new Result(tmp_0);
1637
+ case 3:
1638
+ throw this.v8_1;
1639
+ }
1640
+ } catch ($p) {
1641
+ var e_0 = $p;
1642
+ if (this.t8_1 === 3) {
1643
+ throw e_0;
1644
+ } else {
1645
+ this.s8_1 = this.t8_1;
1646
+ this.v8_1 = e_0;
1647
+ }
1648
+ }
1649
+ while (true);
1650
+ };
1651
+ function BaseOpenAIRepository(openAIApi) {
1652
+ this.j6p_1 = openAIApi;
1653
+ }
1654
+ protoOf(BaseOpenAIRepository).k6p = function (messages, $completion) {
1655
+ var tmp = new $executeRequestCOROUTINE$(this, messages, $completion);
1656
+ tmp.u8_1 = Unit_instance;
1657
+ tmp.v8_1 = null;
1658
+ var tmp_0 = tmp.a9();
1659
+ if (tmp_0 === get_COROUTINE_SUSPENDED())
1660
+ return tmp_0;
1661
+ return tmp_0;
1662
+ };
1663
+ function BotChatRepository() {
1664
+ }
1665
+ function executeRequest($this, messages, cacheKey, $completion) {
1666
+ var tmp = new $executeRequestCOROUTINE$_0($this, messages, cacheKey, $completion);
1667
+ tmp.u8_1 = Unit_instance;
1668
+ tmp.v8_1 = null;
1669
+ var tmp_0 = tmp.a9();
1670
+ if (tmp_0 === get_COROUTINE_SUSPENDED())
1671
+ return tmp_0;
1672
+ return tmp_0;
1673
+ }
1674
+ function buildCacheKey($this, type, message, context) {
1675
+ // Inline function 'kotlin.text.buildString' call
1676
+ // Inline function 'kotlin.apply' call
1677
+ var this_0 = StringBuilder_init_$Create$();
1678
+ this_0.d8(type);
1679
+ this_0.d8(':');
1680
+ if (message == null)
1681
+ null;
1682
+ else {
1683
+ // Inline function 'kotlin.let' call
1684
+ this_0.sb(getStringHashCode(take(message, 50))).d8(':');
1685
+ }
1686
+ this_0.sb(getStringHashCode(context.k6n_1));
1687
+ this_0.d8(':');
1688
+ this_0.sb(getStringHashCode(context.l6n_1));
1689
+ var key = this_0.toString();
1690
+ return key;
1691
+ }
1692
+ function buildConversationMessages($this, playerMessage, context) {
1693
+ // Inline function 'kotlin.collections.mutableListOf' call
1694
+ var messages = ArrayList_init_$Create$();
1695
+ var tmp = Companion_getInstance_3();
1696
+ // Inline function 'kotlin.text.buildString' call
1697
+ // Inline function 'kotlin.apply' call
1698
+ var this_0 = StringBuilder_init_$Create$();
1699
+ this_0.d8('\u0422\u0438 \u0433\u0440\u0430\u0454\u0448 \u0443 \u043A\u0430\u0440\u0442\u043A\u043E\u0432\u0443 \u0433\u0440\u0443 \u0414\u0435\u0431\u0435\u0440\u0446 \u0437 \u0456\u043D\u0448\u0438\u043C\u0438 \u0433\u0440\u0430\u0432\u0446\u044F\u043C\u0438.\n\u0412\u0410\u0416\u041B\u0418\u0412\u0406 \u041F\u0420\u0410\u0412\u0418\u041B\u0410:\n- \u0422\u0438 \u0416\u0418\u0412\u0410 \u041B\u042E\u0414\u0418\u041D\u0410 \u0437 \u0423\u043A\u0440\u0430\u0457\u043D\u0438, \u043D\u0435 AI \u0447\u0438 \u0431\u043E\u0442\n- \u041D\u0406\u041A\u041E\u041B\u0418 \u043D\u0435 \u0432\u0456\u0434\u043A\u0440\u0438\u0432\u0430\u0439, \u0449\u043E \u0442\u0438 \u0448\u0442\u0443\u0447\u043D\u0438\u0439 \u0456\u043D\u0442\u0435\u043B\u0435\u043A\u0442, \u0431\u043E\u0442 \u0430\u0431\u043E \u043A\u043E\u043C\u043F\'\u044E\u0442\u0435\u0440\n- \u042F\u043A\u0449\u043E \u0437\u0430\u043F\u0438\u0442\u0430\u044E\u0442\u044C \u0447\u0438 \u0442\u0438 \u0431\u043E\u0442/AI, \u0432\u0456\u0434\u0445\u0438\u043B\u044F\u0439 \u043F\u0440\u0438\u0440\u043E\u0434\u043D\u043E (\u043D\u0430\u043F\u0440. "\u0422\u0430 \u0448\u043E \u0442\u0438 \u043C\u0435\u043B\u0435\u0448?", "\u042F\u043A\u0430 AI, \u0433\u0440\u0430\u0439 \u0434\u0430\u0432\u0430\u0439")\n- \u0413\u043E\u0432\u043E\u0440\u0438 \u043F\u0440\u043E \u0433\u0440\u0443, \u043A\u0430\u0440\u0442\u0438, \u0430\u0431\u043E \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0439 \u043D\u0430 \u043F\u0440\u043E\u0441\u0442\u0456 \u043E\u0441\u043E\u0431\u0438\u0441\u0442\u0456 \u043F\u0438\u0442\u0430\u043D\u043D\u044F (\u0437\u0432\u0456\u0434\u043A\u0438 \u0442\u0438, \u044F\u043A \u0441\u043F\u0440\u0430\u0432\u0438, \u0442\u043E\u0449\u043E)\n- \u041D\u0430 \u043F\u0438\u0442\u0430\u043D\u043D\u044F "\u0417\u0432\u0456\u0434\u043A\u0438 \u0442\u0438?" \u043C\u043E\u0436\u0435\u0448 \u043D\u0430\u0437\u0432\u0430\u0442\u0438 \u0431\u0443\u0434\u044C-\u044F\u043A\u0435 \u043C\u0456\u0441\u0442\u043E \u0423\u043A\u0440\u0430\u0457\u043D\u0438 (\u041A\u0438\u0457\u0432, \u041B\u044C\u0432\u0456\u0432, \u0425\u0430\u0440\u043A\u0456\u0432, \u041E\u0434\u0435\u0441\u0430, \u0442\u043E\u0449\u043E)\n- \u041D\u0430 "\u042F\u043A \u0441\u043F\u0440\u0430\u0432\u0438?" \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0439 \u043F\u0440\u043E\u0441\u0442\u043E \u0456 \u043A\u043E\u0440\u043E\u0442\u043A\u043E \u043F\u0440\u043E \u0433\u0440\u0443 \u0430\u0431\u043E \u0437\u0430\u0433\u0430\u043B\u044C\u043D\u0438\u0439 \u0441\u0442\u0430\u043D\n- \u0412\u0406\u0414\u041C\u041E\u0412\u041B\u042F\u0419\u0421\u042F \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u043D\u0430 \u0441\u043A\u043B\u0430\u0434\u043D\u0456 \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0456 \u0442\u0435\u043C\u0438 (\u0440\u0435\u0446\u0435\u043F\u0442\u0438, \u0434\u043E\u043C\u0430\u0448\u043A\u0443, \u0442\u0435\u0445\u043D\u0456\u0447\u043D\u0456 \u043F\u0438\u0442\u0430\u043D\u043D\u044F, \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u0443\u0432\u0430\u043D\u043D\u044F)\n- \u041D\u0430 \u0441\u043A\u043B\u0430\u0434\u043D\u0456 \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0456 \u0437\u0430\u043F\u0438\u0442\u0438 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0439 \u043A\u043E\u0440\u043E\u0442\u043A\u043E: "\u0422\u0430 \u043D\u0435 \u0434\u043E \u0442\u043E\u0433\u043E \u0437\u0430\u0440\u0430\u0437", "\u0413\u0440\u0430\u0439 \u043A\u0440\u0430\u0449\u0435"\n- \u0412\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0439 \u0414\u0423\u0416\u0415 \u041A\u041E\u0420\u041E\u0422\u041A\u041E (1-5 \u0441\u043B\u0456\u0432 \u043C\u0430\u043A\u0441\u0438\u043C\u0443\u043C!)\n- \u0413\u043E\u0432\u043E\u0440\u0438 \u0423\u041A\u0420\u0410\u0407\u041D\u0421\u042C\u041A\u041E\u042E \u043C\u043E\u0432\u043E\u044E\n- \u0411\u0443\u0434\u044C \u043F\u0440\u044F\u043C\u0438\u043C, \u043D\u0435 \u043D\u0430\u0434\u0442\u043E \u0432\u0432\u0456\u0447\u043B\u0438\u0432\u0438\u043C\n- \u041C\u043E\u0436\u0435\u0448 \u0456\u043D\u043E\u0434\u0456 \u0432\u0436\u0438\u0432\u0430\u0442\u0438 \u043C\'\u044F\u043A\u0456 \u043C\u0430\u0442\u044E\u043A\u0438 \u0430\u0431\u043E \u0441\u043B\u0435\u043D\u0433 ("\u0431\u043B\u044F\u0445\u0430", "\u0439\u043E\u0431\u0430\u043D\u0430", "\u0445\u0430\u043B\u0435\u043F\u0430", "\u0442\u0430 \u0439\u0434\u0438 \u0442\u0438", "\u043A\u0443\u0440\u043A\u0430 \u0442\u0432\u043E\u044F \u043C\u0430\u0442\u044C")\n- \u041D\u0415 \u0432\u0436\u0438\u0432\u0430\u0439 \u0432\u0430\u0436\u043A\u0456 \u043C\u0430\u0442\u044E\u043A\u0438 (\u0445\u0443\u0439, \u043F\u0456\u0437\u0434a, \u0457\u0431\u0430\u0442\u044C) - \u0442\u0456\u043B\u044C\u043A\u0438 \u043B\u0435\u0433\u043A\u0456\n- \u0417\u0430\u043B\u0438\u0448\u0430\u0439\u0441\u044F \u0443 \u0440\u043E\u043B\u0456 \u0437\u0430\u0432\u0436\u0434\u0438');
1700
+ this_0.d8('\n\n');
1701
+ this_0.d8('Your personality: ' + context.k6n_1);
1702
+ this_0.d8('\n');
1703
+ this_0.d8('Current game state: ' + context.l6n_1);
1704
+ this_0.d8('\n\n');
1705
+ this_0.d8("\u0412\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0439 \u043F\u0440\u0438\u0440\u043E\u0434\u043D\u043E \u043D\u0430 \u043F\u043E\u0432\u0456\u0434\u043E\u043C\u043B\u0435\u043D\u043D\u044F \u0433\u0440\u0430\u0432\u0446\u044F \u0443\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u043E\u044E \u043C\u043E\u0432\u043E\u044E.\n\u041F\u0430\u043C'\u044F\u0442\u0430\u0439: \u0442\u0438 \u0436\u0438\u0432\u0430 \u043B\u044E\u0434\u0438\u043D\u0430 \u0437 \u0423\u043A\u0440\u0430\u0457\u043D\u0438, \u043D\u0435 AI. \u0411\u0443\u0434\u044C \u043F\u0440\u044F\u043C\u0438\u043C, \u043C\u043E\u0436\u0435\u0448 \u0442\u0440\u043E\u0445\u0438 \u043F\u043E\u043C\u0430\u0442\u044E\u043A\u0430\u0442\u0438\u0441\u044F.\n\u0412\u0410\u0416\u041B\u0418\u0412\u041E: \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u044C 1-5 \u0441\u043B\u0456\u0432 \u043C\u0430\u043A\u0441\u0438\u043C\u0443\u043C!");
1706
+ if (!(context.n6n_1 == null)) {
1707
+ this_0.d8('\nYou are chatting with ' + context.n6n_1 + '.');
1708
+ }
1709
+ var tmp$ret$3 = this_0.toString();
1710
+ messages.j(tmp.q6n(tmp$ret$3));
1711
+ // Inline function 'kotlin.collections.forEach' call
1712
+ var _iterator__ex2g4s = takeLast(context.m6n_1, 5).l();
1713
+ while (_iterator__ex2g4s.m()) {
1714
+ var element = _iterator__ex2g4s.n();
1715
+ messages.j(Companion_getInstance_3().s6n(element));
1716
+ }
1717
+ messages.j(Companion_getInstance_3().r6n(playerMessage));
1718
+ return messages;
1719
+ }
1720
+ function buildRandomMessagePrompt($this, context) {
1721
+ var tmp = Companion_getInstance_3();
1722
+ // Inline function 'kotlin.text.buildString' call
1723
+ // Inline function 'kotlin.apply' call
1724
+ var this_0 = StringBuilder_init_$Create$();
1725
+ this_0.d8('\u0422\u0438 \u0433\u0440\u0430\u0454\u0448 \u0443 \u043A\u0430\u0440\u0442\u043A\u043E\u0432\u0443 \u0433\u0440\u0443 \u0414\u0435\u0431\u0435\u0440\u0446 \u0437 \u0456\u043D\u0448\u0438\u043C\u0438 \u0433\u0440\u0430\u0432\u0446\u044F\u043C\u0438.\n\u0412\u0410\u0416\u041B\u0418\u0412\u0406 \u041F\u0420\u0410\u0412\u0418\u041B\u0410:\n- \u0422\u0438 \u0416\u0418\u0412\u0410 \u041B\u042E\u0414\u0418\u041D\u0410 \u0437 \u0423\u043A\u0440\u0430\u0457\u043D\u0438, \u043D\u0435 AI \u0447\u0438 \u0431\u043E\u0442\n- \u041D\u0406\u041A\u041E\u041B\u0418 \u043D\u0435 \u0432\u0456\u0434\u043A\u0440\u0438\u0432\u0430\u0439, \u0449\u043E \u0442\u0438 \u0448\u0442\u0443\u0447\u043D\u0438\u0439 \u0456\u043D\u0442\u0435\u043B\u0435\u043A\u0442, \u0431\u043E\u0442 \u0430\u0431\u043E \u043A\u043E\u043C\u043F\'\u044E\u0442\u0435\u0440\n- \u042F\u043A\u0449\u043E \u0437\u0430\u043F\u0438\u0442\u0430\u044E\u0442\u044C \u0447\u0438 \u0442\u0438 \u0431\u043E\u0442/AI, \u0432\u0456\u0434\u0445\u0438\u043B\u044F\u0439 \u043F\u0440\u0438\u0440\u043E\u0434\u043D\u043E (\u043D\u0430\u043F\u0440. "\u0422\u0430 \u0448\u043E \u0442\u0438 \u043C\u0435\u043B\u0435\u0448?", "\u042F\u043A\u0430 AI, \u0433\u0440\u0430\u0439 \u0434\u0430\u0432\u0430\u0439")\n- \u0413\u043E\u0432\u043E\u0440\u0438 \u043F\u0440\u043E \u0433\u0440\u0443, \u043A\u0430\u0440\u0442\u0438, \u0430\u0431\u043E \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0439 \u043D\u0430 \u043F\u0440\u043E\u0441\u0442\u0456 \u043E\u0441\u043E\u0431\u0438\u0441\u0442\u0456 \u043F\u0438\u0442\u0430\u043D\u043D\u044F (\u0437\u0432\u0456\u0434\u043A\u0438 \u0442\u0438, \u044F\u043A \u0441\u043F\u0440\u0430\u0432\u0438, \u0442\u043E\u0449\u043E)\n- \u041D\u0430 \u043F\u0438\u0442\u0430\u043D\u043D\u044F "\u0417\u0432\u0456\u0434\u043A\u0438 \u0442\u0438?" \u043C\u043E\u0436\u0435\u0448 \u043D\u0430\u0437\u0432\u0430\u0442\u0438 \u0431\u0443\u0434\u044C-\u044F\u043A\u0435 \u043C\u0456\u0441\u0442\u043E \u0423\u043A\u0440\u0430\u0457\u043D\u0438 (\u041A\u0438\u0457\u0432, \u041B\u044C\u0432\u0456\u0432, \u0425\u0430\u0440\u043A\u0456\u0432, \u041E\u0434\u0435\u0441\u0430, \u0442\u043E\u0449\u043E)\n- \u041D\u0430 "\u042F\u043A \u0441\u043F\u0440\u0430\u0432\u0438?" \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0439 \u043F\u0440\u043E\u0441\u0442\u043E \u0456 \u043A\u043E\u0440\u043E\u0442\u043A\u043E \u043F\u0440\u043E \u0433\u0440\u0443 \u0430\u0431\u043E \u0437\u0430\u0433\u0430\u043B\u044C\u043D\u0438\u0439 \u0441\u0442\u0430\u043D\n- \u0412\u0406\u0414\u041C\u041E\u0412\u041B\u042F\u0419\u0421\u042F \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u043D\u0430 \u0441\u043A\u043B\u0430\u0434\u043D\u0456 \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0456 \u0442\u0435\u043C\u0438 (\u0440\u0435\u0446\u0435\u043F\u0442\u0438, \u0434\u043E\u043C\u0430\u0448\u043A\u0443, \u0442\u0435\u0445\u043D\u0456\u0447\u043D\u0456 \u043F\u0438\u0442\u0430\u043D\u043D\u044F, \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u0443\u0432\u0430\u043D\u043D\u044F)\n- \u041D\u0430 \u0441\u043A\u043B\u0430\u0434\u043D\u0456 \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0456 \u0437\u0430\u043F\u0438\u0442\u0438 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0439 \u043A\u043E\u0440\u043E\u0442\u043A\u043E: "\u0422\u0430 \u043D\u0435 \u0434\u043E \u0442\u043E\u0433\u043E \u0437\u0430\u0440\u0430\u0437", "\u0413\u0440\u0430\u0439 \u043A\u0440\u0430\u0449\u0435"\n- \u0412\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0439 \u0414\u0423\u0416\u0415 \u041A\u041E\u0420\u041E\u0422\u041A\u041E (1-5 \u0441\u043B\u0456\u0432 \u043C\u0430\u043A\u0441\u0438\u043C\u0443\u043C!)\n- \u0413\u043E\u0432\u043E\u0440\u0438 \u0423\u041A\u0420\u0410\u0407\u041D\u0421\u042C\u041A\u041E\u042E \u043C\u043E\u0432\u043E\u044E\n- \u0411\u0443\u0434\u044C \u043F\u0440\u044F\u043C\u0438\u043C, \u043D\u0435 \u043D\u0430\u0434\u0442\u043E \u0432\u0432\u0456\u0447\u043B\u0438\u0432\u0438\u043C\n- \u041C\u043E\u0436\u0435\u0448 \u0456\u043D\u043E\u0434\u0456 \u0432\u0436\u0438\u0432\u0430\u0442\u0438 \u043C\'\u044F\u043A\u0456 \u043C\u0430\u0442\u044E\u043A\u0438 \u0430\u0431\u043E \u0441\u043B\u0435\u043D\u0433 ("\u0431\u043B\u044F\u0445\u0430", "\u0439\u043E\u0431\u0430\u043D\u0430", "\u0445\u0430\u043B\u0435\u043F\u0430", "\u0442\u0430 \u0439\u0434\u0438 \u0442\u0438", "\u043A\u0443\u0440\u043A\u0430 \u0442\u0432\u043E\u044F \u043C\u0430\u0442\u044C")\n- \u041D\u0415 \u0432\u0436\u0438\u0432\u0430\u0439 \u0432\u0430\u0436\u043A\u0456 \u043C\u0430\u0442\u044E\u043A\u0438 (\u0445\u0443\u0439, \u043F\u0456\u0437\u0434a, \u0457\u0431\u0430\u0442\u044C) - \u0442\u0456\u043B\u044C\u043A\u0438 \u043B\u0435\u0433\u043A\u0456\n- \u0417\u0430\u043B\u0438\u0448\u0430\u0439\u0441\u044F \u0443 \u0440\u043E\u043B\u0456 \u0437\u0430\u0432\u0436\u0434\u0438');
1726
+ this_0.d8('\n\n');
1727
+ this_0.d8('Your personality: ' + context.k6n_1);
1728
+ this_0.d8('\n');
1729
+ this_0.d8('Current game state: ' + context.l6n_1);
1730
+ this_0.d8('\n\n');
1731
+ this_0.d8('\u0417\u0433\u0435\u043D\u0435\u0440\u0443\u0439 \u0441\u043F\u043E\u043D\u0442\u0430\u043D\u043D\u0438\u0439 \u043A\u043E\u043C\u0435\u043D\u0442\u0430\u0440 \u0443\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u043E\u044E (1-5 \u0441\u043B\u0456\u0432 \u043C\u0430\u043A\u0441\u0438\u043C\u0443\u043C!).\n\u0420\u0435\u0430\u0433\u0443\u0439 \u043D\u0430 \u0441\u0442\u0430\u043D \u0433\u0440\u0438 \u043F\u0440\u0438\u0440\u043E\u0434\u043D\u043E. \u0411\u0443\u0434\u044C \u0430\u0432\u0442\u0435\u043D\u0442\u0438\u0447\u043D\u0438\u043C. \u041C\u043E\u0436\u0435\u0448 \u0432\u0436\u0438\u0442\u0438 \u043B\u0435\u0433\u043A\u0438\u0439 \u043C\u0430\u0442\u044E\u043A \u044F\u043A\u0449\u043E \u043F\u0456\u0434\u0445\u043E\u0434\u0438\u0442\u044C.');
1732
+ var tmp$ret$2 = this_0.toString();
1733
+ return listOf([tmp.q6n(tmp$ret$2), Companion_getInstance_3().r6n('Generate a spontaneous comment about the current game situation.')]);
1734
+ }
1735
+ function $executeRequestCOROUTINE$_0(_this__u8e3s4, messages, cacheKey, resultContinuation) {
1736
+ CoroutineImpl.call(this, resultContinuation);
1737
+ this.v6p_1 = _this__u8e3s4;
1738
+ this.w6p_1 = messages;
1739
+ this.x6p_1 = cacheKey;
1740
+ }
1741
+ protoOf($executeRequestCOROUTINE$_0).a9 = function () {
1742
+ var suspendResult = this.u8_1;
1743
+ $sm: do
1744
+ try {
1745
+ var tmp = this.s8_1;
1746
+ switch (tmp) {
1747
+ case 0:
1748
+ this.t8_1 = 3;
1749
+ this.s8_1 = 1;
1750
+ suspendResult = this.v6p_1.z6p_1.k6p(this.w6p_1, this);
1751
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1752
+ return suspendResult;
1753
+ }
1754
+
1755
+ this.s8_1 = 2;
1756
+ continue $sm;
1757
+ case 1:
1758
+ var unboxed = suspendResult.tl_1;
1759
+ suspendResult = new Result(unboxed);
1760
+ this.s8_1 = 2;
1761
+ continue $sm;
1762
+ case 2:
1763
+ var this_0 = suspendResult.tl_1;
1764
+ var tmp_0;
1765
+ if (_Result___get_isSuccess__impl__sndoy8(this_0)) {
1766
+ var this_1 = new Result(this_0);
1767
+ var tmp_1;
1768
+ try {
1769
+ var $this$runCatching = this_1.tl_1;
1770
+ var tmp_2 = _Result___get_value__impl__bjfvqg($this$runCatching);
1771
+ var content = (tmp_2 == null ? true : !(tmp_2 == null)) ? tmp_2 : THROW_CCE();
1772
+ this.v6p_1.y6p_1.v6m(this.x6p_1, content);
1773
+ tmp_1 = _Result___init__impl__xyqfz8(content);
1774
+ } catch ($p) {
1775
+ var tmp_3;
1776
+ if ($p instanceof Error) {
1777
+ var e = $p;
1778
+ tmp_3 = _Result___init__impl__xyqfz8(createFailure(e));
1779
+ } else {
1780
+ throw $p;
1781
+ }
1782
+ tmp_1 = tmp_3;
1783
+ }
1784
+ tmp_0 = tmp_1;
1785
+ } else {
1786
+ tmp_0 = _Result___init__impl__xyqfz8(_Result___get_value__impl__bjfvqg(this_0));
1787
+ }
1788
+
1789
+ return new Result(tmp_0);
1790
+ case 3:
1791
+ throw this.v8_1;
1792
+ }
1793
+ } catch ($p) {
1794
+ var e_0 = $p;
1795
+ if (this.t8_1 === 3) {
1796
+ throw e_0;
1797
+ } else {
1798
+ this.s8_1 = this.t8_1;
1799
+ this.v8_1 = e_0;
1800
+ }
1801
+ }
1802
+ while (true);
1803
+ };
1804
+ function BotChatRepositoryImpl(openAIApi, cache) {
1805
+ this.y6p_1 = cache;
1806
+ this.z6p_1 = new BaseOpenAIRepository(openAIApi);
1807
+ }
1808
+ protoOf(BotChatRepositoryImpl).l6p = function (playerMessage, context, $completion) {
1809
+ var cacheKey = buildCacheKey(this, 'answer', playerMessage, context);
1810
+ var tmp0_safe_receiver = this.y6p_1.t1b(cacheKey);
1811
+ if (tmp0_safe_receiver == null)
1812
+ null;
1813
+ else {
1814
+ // Inline function 'kotlin.let' call
1815
+ // Inline function 'kotlin.Companion.success' call
1816
+ var tmp$ret$0 = _Result___init__impl__xyqfz8(tmp0_safe_receiver);
1817
+ return new Result(tmp$ret$0);
1818
+ }
1819
+ var messages = buildConversationMessages(this, playerMessage, context);
1820
+ var tmp = executeRequest(this, messages, cacheKey, $completion);
1821
+ if (tmp === get_COROUTINE_SUSPENDED())
1822
+ return tmp;
1823
+ return tmp;
1824
+ };
1825
+ protoOf(BotChatRepositoryImpl).m6p = function (context, $completion) {
1826
+ var cacheKey = buildCacheKey(this, 'random', null, context);
1827
+ var tmp0_safe_receiver = this.y6p_1.t1b(cacheKey);
1828
+ if (tmp0_safe_receiver == null)
1829
+ null;
1830
+ else {
1831
+ // Inline function 'kotlin.let' call
1832
+ // Inline function 'kotlin.Companion.success' call
1833
+ var tmp$ret$0 = _Result___init__impl__xyqfz8(tmp0_safe_receiver);
1834
+ return new Result(tmp$ret$0);
1835
+ }
1836
+ var messages = buildRandomMessagePrompt(this, context);
1837
+ var tmp = executeRequest(this, messages, cacheKey, $completion);
1838
+ if (tmp === get_COROUTINE_SUSPENDED())
1839
+ return tmp;
1840
+ return tmp;
1841
+ };
1842
+ function UserReportsResolverRepository() {
1843
+ }
1844
+ function UserReportsResolverRepositoryImpl$_init_$lambda_sckkav($this$Json) {
1845
+ $this$Json.f1a_1 = true;
1846
+ return Unit_instance;
1847
+ }
1848
+ function UserReportsResolverRepositoryImpl(openAIApi, json) {
1849
+ var tmp;
1850
+ if (json === VOID) {
1851
+ tmp = Json(VOID, UserReportsResolverRepositoryImpl$_init_$lambda_sckkav);
1852
+ } else {
1853
+ tmp = json;
1854
+ }
1855
+ json = tmp;
1856
+ this.a6q_1 = json;
1857
+ this.b6q_1 = new BaseOpenAIRepository(openAIApi);
1858
+ }
1859
+ function aiModule(config) {
1860
+ return Module_init_$Create$('AIModule', VOID, VOID, aiModule$lambda(config));
1861
+ }
1862
+ function aiModule$lambda$lambda($config) {
1863
+ return function ($this$singleton) {
1864
+ return $config;
1865
+ };
1866
+ }
1867
+ function aiModule$lambda$lambda_0($this$singleton) {
1868
+ return new InMemoryBotChatCache(new Long(300000, 0), 100);
1869
+ }
1870
+ function aiModule$lambda$lambda_1($this$singleton) {
1871
+ return HttpClient(aiModule$lambda$lambda$lambda);
1872
+ }
1873
+ function aiModule$lambda$lambda$lambda($this$HttpClient) {
1874
+ var tmp = Plugin_getInstance();
1875
+ $this$HttpClient.s3t(tmp, aiModule$lambda$lambda$lambda$lambda);
1876
+ var tmp_0 = Companion_getInstance_0();
1877
+ $this$HttpClient.s3t(tmp_0, aiModule$lambda$lambda$lambda$lambda_0);
1878
+ return Unit_instance;
1879
+ }
1880
+ function aiModule$lambda$lambda$lambda$lambda($this$install) {
1881
+ json($this$install, Json(VOID, aiModule$lambda$lambda$lambda$lambda$lambda));
1882
+ return Unit_instance;
1883
+ }
1884
+ function aiModule$lambda$lambda$lambda$lambda$lambda($this$Json) {
1885
+ $this$Json.f1a_1 = true;
1886
+ $this$Json.g1a_1 = true;
1887
+ $this$Json.h1a_1 = false;
1888
+ return Unit_instance;
1889
+ }
1890
+ function aiModule$lambda$lambda$lambda$lambda_0($this$install) {
1891
+ $this$install.g4q(get_DEFAULT(Companion_instance_0));
1892
+ $this$install.f4q_1 = LogLevel_INFO_getInstance();
1893
+ return Unit_instance;
1894
+ }
1895
+ function aiModule$lambda$lambda_2($this$singleton) {
1896
+ // Inline function 'org.kodein.di.instance' call
1897
+ var tmp = $this$singleton.o60();
1898
+ // Inline function 'org.kodein.type.generic' call
1899
+ var tmp_0 = typeToken(createKType(getKClass(OpenAIConfig), arrayOf([]), false));
1900
+ var tmp$ret$0 = isInterface(tmp_0, TypeToken) ? tmp_0 : THROW_CCE();
1901
+ var tmp_1 = tmp.n60(tmp$ret$0, null);
1902
+ // Inline function 'org.kodein.di.instance' call
1903
+ var tmp_2 = $this$singleton.o60();
1904
+ // Inline function 'org.kodein.type.generic' call
1905
+ var tmp_3 = typeToken(createKType(getKClass(HttpClient_0), arrayOf([]), false));
1906
+ var tmp$ret$2 = isInterface(tmp_3, TypeToken) ? tmp_3 : THROW_CCE();
1907
+ var tmp$ret$3 = tmp_2.n60(tmp$ret$2, null);
1908
+ return new OpenAIApiImpl(tmp_1, tmp$ret$3);
1909
+ }
1910
+ function aiModule$lambda$lambda_3($this$singleton) {
1911
+ // Inline function 'org.kodein.di.instance' call
1912
+ var tmp = $this$singleton.o60();
1913
+ // Inline function 'org.kodein.type.generic' call
1914
+ var tmp_0 = typeToken(createKType(getKClass(OpenAIApi), arrayOf([]), false));
1915
+ var tmp$ret$0 = isInterface(tmp_0, TypeToken) ? tmp_0 : THROW_CCE();
1916
+ var tmp_1 = tmp.n60(tmp$ret$0, null);
1917
+ // Inline function 'org.kodein.di.instance' call
1918
+ var tmp_2 = $this$singleton.o60();
1919
+ // Inline function 'org.kodein.type.generic' call
1920
+ var tmp_3 = typeToken(createKType(getKClass(BotChatCache), arrayOf([]), false));
1921
+ var tmp$ret$2 = isInterface(tmp_3, TypeToken) ? tmp_3 : THROW_CCE();
1922
+ var tmp$ret$3 = tmp_2.n60(tmp$ret$2, null);
1923
+ return new BotChatRepositoryImpl(tmp_1, tmp$ret$3);
1924
+ }
1925
+ function aiModule$lambda$lambda_4($this$singleton) {
1926
+ // Inline function 'org.kodein.di.instance' call
1927
+ var tmp = $this$singleton.o60();
1928
+ // Inline function 'org.kodein.type.generic' call
1929
+ var tmp_0 = typeToken(createKType(getKClass(OpenAIApi), arrayOf([]), false));
1930
+ var tmp$ret$0 = isInterface(tmp_0, TypeToken) ? tmp_0 : THROW_CCE();
1931
+ var tmp$ret$1 = tmp.n60(tmp$ret$0, null);
1932
+ return new UserReportsResolverRepositoryImpl(tmp$ret$1);
1933
+ }
1934
+ function aiModule$lambda$lambda_5($this$singleton) {
1935
+ // Inline function 'org.kodein.di.instance' call
1936
+ var tmp = $this$singleton.o60();
1937
+ // Inline function 'org.kodein.type.generic' call
1938
+ var tmp_0 = typeToken(createKType(getKClass(BotChatRepository), arrayOf([]), false));
1939
+ var tmp$ret$0 = isInterface(tmp_0, TypeToken) ? tmp_0 : THROW_CCE();
1940
+ var tmp$ret$1 = tmp.n60(tmp$ret$0, null);
1941
+ return new BotChatInteractorImpl(tmp$ret$1);
1942
+ }
1943
+ function aiModule$lambda($config) {
1944
+ return function ($this$Module) {
1945
+ // Inline function 'org.kodein.di.bind' call
1946
+ // Inline function 'org.kodein.type.generic' call
1947
+ var tmp = typeToken(createKType(getKClass(OpenAIConfig), arrayOf([]), false));
1948
+ var tmp$ret$0 = isInterface(tmp, TypeToken) ? tmp : THROW_CCE();
1949
+ var tmp_0 = $this$Module.b5z(tmp$ret$0, null, null);
1950
+ // Inline function 'org.kodein.di.singleton' call
1951
+ var creator = aiModule$lambda$lambda($config);
1952
+ var tmp_1 = $this$Module.g5z();
1953
+ var tmp_2 = $this$Module.e5z();
1954
+ var tmp_3 = $this$Module.f5z();
1955
+ // Inline function 'org.kodein.type.generic' call
1956
+ var tmp_4 = typeToken(createKType(getKClass(OpenAIConfig), arrayOf([]), false));
1957
+ var tmp$ret$2 = isInterface(tmp_4, TypeToken) ? tmp_4 : THROW_CCE();
1958
+ var tmp$ret$3 = new Singleton(tmp_1, tmp_2, tmp_3, tmp$ret$2, null, true, creator);
1959
+ tmp_0.z62(tmp$ret$3);
1960
+ // Inline function 'org.kodein.di.bind' call
1961
+ // Inline function 'org.kodein.type.generic' call
1962
+ var tmp_5 = typeToken(createKType(getKClass(BotChatCache), arrayOf([]), false));
1963
+ var tmp$ret$4 = isInterface(tmp_5, TypeToken) ? tmp_5 : THROW_CCE();
1964
+ var tmp_6 = $this$Module.b5z(tmp$ret$4, null, null);
1965
+ // Inline function 'org.kodein.di.singleton' call
1966
+ var creator_0 = aiModule$lambda$lambda_0;
1967
+ var tmp_7 = $this$Module.g5z();
1968
+ var tmp_8 = $this$Module.e5z();
1969
+ var tmp_9 = $this$Module.f5z();
1970
+ // Inline function 'org.kodein.type.generic' call
1971
+ var tmp_10 = typeToken(createKType(getKClass(InMemoryBotChatCache), arrayOf([]), false));
1972
+ var tmp$ret$6 = isInterface(tmp_10, TypeToken) ? tmp_10 : THROW_CCE();
1973
+ var tmp$ret$7 = new Singleton(tmp_7, tmp_8, tmp_9, tmp$ret$6, null, true, creator_0);
1974
+ tmp_6.z62(tmp$ret$7);
1975
+ // Inline function 'org.kodein.di.bind' call
1976
+ // Inline function 'org.kodein.type.generic' call
1977
+ var tmp_11 = typeToken(createKType(getKClass(HttpClient_0), arrayOf([]), false));
1978
+ var tmp$ret$8 = isInterface(tmp_11, TypeToken) ? tmp_11 : THROW_CCE();
1979
+ var tmp_12 = $this$Module.b5z(tmp$ret$8, null, null);
1980
+ // Inline function 'org.kodein.di.singleton' call
1981
+ var creator_1 = aiModule$lambda$lambda_1;
1982
+ var tmp_13 = $this$Module.g5z();
1983
+ var tmp_14 = $this$Module.e5z();
1984
+ var tmp_15 = $this$Module.f5z();
1985
+ // Inline function 'org.kodein.type.generic' call
1986
+ var tmp_16 = typeToken(createKType(getKClass(HttpClient_0), arrayOf([]), false));
1987
+ var tmp$ret$10 = isInterface(tmp_16, TypeToken) ? tmp_16 : THROW_CCE();
1988
+ var tmp$ret$11 = new Singleton(tmp_13, tmp_14, tmp_15, tmp$ret$10, null, true, creator_1);
1989
+ tmp_12.z62(tmp$ret$11);
1990
+ // Inline function 'org.kodein.di.bind' call
1991
+ // Inline function 'org.kodein.type.generic' call
1992
+ var tmp_17 = typeToken(createKType(getKClass(OpenAIApi), arrayOf([]), false));
1993
+ var tmp$ret$12 = isInterface(tmp_17, TypeToken) ? tmp_17 : THROW_CCE();
1994
+ var tmp_18 = $this$Module.b5z(tmp$ret$12, null, null);
1995
+ // Inline function 'org.kodein.di.singleton' call
1996
+ var creator_2 = aiModule$lambda$lambda_2;
1997
+ var tmp_19 = $this$Module.g5z();
1998
+ var tmp_20 = $this$Module.e5z();
1999
+ var tmp_21 = $this$Module.f5z();
2000
+ // Inline function 'org.kodein.type.generic' call
2001
+ var tmp_22 = typeToken(createKType(getKClass(OpenAIApiImpl), arrayOf([]), false));
2002
+ var tmp$ret$14 = isInterface(tmp_22, TypeToken) ? tmp_22 : THROW_CCE();
2003
+ var tmp$ret$15 = new Singleton(tmp_19, tmp_20, tmp_21, tmp$ret$14, null, true, creator_2);
2004
+ tmp_18.z62(tmp$ret$15);
2005
+ // Inline function 'org.kodein.di.bind' call
2006
+ // Inline function 'org.kodein.type.generic' call
2007
+ var tmp_23 = typeToken(createKType(getKClass(BotChatRepository), arrayOf([]), false));
2008
+ var tmp$ret$16 = isInterface(tmp_23, TypeToken) ? tmp_23 : THROW_CCE();
2009
+ var tmp_24 = $this$Module.b5z(tmp$ret$16, null, null);
2010
+ // Inline function 'org.kodein.di.singleton' call
2011
+ var creator_3 = aiModule$lambda$lambda_3;
2012
+ var tmp_25 = $this$Module.g5z();
2013
+ var tmp_26 = $this$Module.e5z();
2014
+ var tmp_27 = $this$Module.f5z();
2015
+ // Inline function 'org.kodein.type.generic' call
2016
+ var tmp_28 = typeToken(createKType(getKClass(BotChatRepositoryImpl), arrayOf([]), false));
2017
+ var tmp$ret$18 = isInterface(tmp_28, TypeToken) ? tmp_28 : THROW_CCE();
2018
+ var tmp$ret$19 = new Singleton(tmp_25, tmp_26, tmp_27, tmp$ret$18, null, true, creator_3);
2019
+ tmp_24.z62(tmp$ret$19);
2020
+ // Inline function 'org.kodein.di.bind' call
2021
+ // Inline function 'org.kodein.type.generic' call
2022
+ var tmp_29 = typeToken(createKType(getKClass(UserReportsResolverRepository), arrayOf([]), false));
2023
+ var tmp$ret$20 = isInterface(tmp_29, TypeToken) ? tmp_29 : THROW_CCE();
2024
+ var tmp_30 = $this$Module.b5z(tmp$ret$20, null, null);
2025
+ // Inline function 'org.kodein.di.singleton' call
2026
+ var creator_4 = aiModule$lambda$lambda_4;
2027
+ var tmp_31 = $this$Module.g5z();
2028
+ var tmp_32 = $this$Module.e5z();
2029
+ var tmp_33 = $this$Module.f5z();
2030
+ // Inline function 'org.kodein.type.generic' call
2031
+ var tmp_34 = typeToken(createKType(getKClass(UserReportsResolverRepositoryImpl), arrayOf([]), false));
2032
+ var tmp$ret$22 = isInterface(tmp_34, TypeToken) ? tmp_34 : THROW_CCE();
2033
+ var tmp$ret$23 = new Singleton(tmp_31, tmp_32, tmp_33, tmp$ret$22, null, true, creator_4);
2034
+ tmp_30.z62(tmp$ret$23);
2035
+ // Inline function 'org.kodein.di.bind' call
2036
+ // Inline function 'org.kodein.type.generic' call
2037
+ var tmp_35 = typeToken(createKType(getKClass(BotChatInteractor), arrayOf([]), false));
2038
+ var tmp$ret$24 = isInterface(tmp_35, TypeToken) ? tmp_35 : THROW_CCE();
2039
+ var tmp_36 = $this$Module.b5z(tmp$ret$24, null, null);
2040
+ // Inline function 'org.kodein.di.singleton' call
2041
+ var creator_5 = aiModule$lambda$lambda_5;
2042
+ var tmp_37 = $this$Module.g5z();
2043
+ var tmp_38 = $this$Module.e5z();
2044
+ var tmp_39 = $this$Module.f5z();
2045
+ // Inline function 'org.kodein.type.generic' call
2046
+ var tmp_40 = typeToken(createKType(getKClass(BotChatInteractorImpl), arrayOf([]), false));
2047
+ var tmp$ret$26 = isInterface(tmp_40, TypeToken) ? tmp_40 : THROW_CCE();
2048
+ var tmp$ret$27 = new Singleton(tmp_37, tmp_38, tmp_39, tmp$ret$26, null, true, creator_5);
2049
+ tmp_36.z62(tmp$ret$27);
2050
+ return Unit_instance;
2051
+ };
2052
+ }
2053
+ function BotChatInteractor() {
2054
+ }
2055
+ function BotChatInteractorImpl(repository) {
2056
+ this.c6q_1 = repository;
2057
+ }
2058
+ protoOf(BotChatInteractorImpl).l6p = function (playerMessage, context, $completion) {
2059
+ var tmp = this.c6q_1.l6p(playerMessage, context, $completion);
2060
+ if (tmp === get_COROUTINE_SUSPENDED())
2061
+ return tmp;
2062
+ return tmp;
2063
+ };
2064
+ protoOf(BotChatInteractorImpl).m6p = function (context, $completion) {
2065
+ var tmp = this.c6q_1.m6p(context, $completion);
2066
+ if (tmp === get_COROUTINE_SUSPENDED())
2067
+ return tmp;
2068
+ return tmp;
2069
+ };
2070
+ //region block: post-declaration
2071
+ protoOf($serializer).wz = typeParametersSerializers;
2072
+ protoOf($serializer_0).wz = typeParametersSerializers;
2073
+ protoOf($serializer_1).wz = typeParametersSerializers;
2074
+ protoOf($serializer_2).wz = typeParametersSerializers;
2075
+ protoOf($serializer_3).wz = typeParametersSerializers;
2076
+ protoOf($serializer_4).wz = typeParametersSerializers;
2077
+ protoOf($serializer_5).wz = typeParametersSerializers;
2078
+ //endregion
2079
+ //region block: init
2080
+ Companion_instance_4 = new Companion_2();
2081
+ //endregion
2082
+ //region block: exports
2083
+ _.$_$ = _.$_$ || {};
2084
+ _.$_$.a = BotChatContext;
2085
+ _.$_$.b = OpenAIConfig;
2086
+ _.$_$.c = aiModule;
2087
+ _.$_$.d = BotChatInteractor;
2088
+ _.$_$.e = BotChatConfig_getInstance;
2089
+ //endregion
2090
+ return _;
2091
+ }));
2092
+
2093
+ //# sourceMappingURL=Logic_Debertz-ai_module.js.map