UNPKG

git-rest-wrapper

Version:

A "universal" / normalized API wrapper for common git hosting services.

953 lines (950 loc) 715 kB
(function(root, factory) { if (typeof define === 'function' && define.amd) define(['exports', 'kotlin', 'kotlinx-coroutines-core', 'ktor-ktor-utils-jsLegacy', 'ktor-ktor-io-jsLegacy', 'ktor-ktor-http-jsLegacy', 'ktor-ktor-http-cio-jsLegacy'], factory); else if (typeof exports === 'object') factory(module.exports, require('kotlin'), require('kotlinx-coroutines-core'), require('ktor-ktor-utils-jsLegacy'), require('ktor-ktor-io-jsLegacy'), require('ktor-ktor-http-jsLegacy'), require('ktor-ktor-http-cio-jsLegacy')); else { if (typeof kotlin === 'undefined') { throw new Error("Error loading module 'ktor-ktor-client-core-jsLegacy'. Its dependency 'kotlin' was not found. Please, check whether 'kotlin' is loaded prior to 'ktor-ktor-client-core-jsLegacy'."); } if (typeof this['kotlinx-coroutines-core'] === 'undefined') { throw new Error("Error loading module 'ktor-ktor-client-core-jsLegacy'. Its dependency 'kotlinx-coroutines-core' was not found. Please, check whether 'kotlinx-coroutines-core' is loaded prior to 'ktor-ktor-client-core-jsLegacy'."); } if (typeof this['ktor-ktor-utils-jsLegacy'] === 'undefined') { throw new Error("Error loading module 'ktor-ktor-client-core-jsLegacy'. Its dependency 'ktor-ktor-utils-jsLegacy' was not found. Please, check whether 'ktor-ktor-utils-jsLegacy' is loaded prior to 'ktor-ktor-client-core-jsLegacy'."); } if (typeof this['ktor-ktor-io-jsLegacy'] === 'undefined') { throw new Error("Error loading module 'ktor-ktor-client-core-jsLegacy'. Its dependency 'ktor-ktor-io-jsLegacy' was not found. Please, check whether 'ktor-ktor-io-jsLegacy' is loaded prior to 'ktor-ktor-client-core-jsLegacy'."); } if (false) { } if (typeof this['ktor-ktor-http-jsLegacy'] === 'undefined') { throw new Error("Error loading module 'ktor-ktor-client-core-jsLegacy'. Its dependency 'ktor-ktor-http-jsLegacy' was not found. Please, check whether 'ktor-ktor-http-jsLegacy' is loaded prior to 'ktor-ktor-client-core-jsLegacy'."); } if (typeof this['ktor-ktor-http-cio-jsLegacy'] === 'undefined') { throw new Error("Error loading module 'ktor-ktor-client-core-jsLegacy'. Its dependency 'ktor-ktor-http-cio-jsLegacy' was not found. Please, check whether 'ktor-ktor-http-cio-jsLegacy' is loaded prior to 'ktor-ktor-client-core-jsLegacy'."); } root['ktor-ktor-client-core-jsLegacy'] = factory(typeof this['ktor-ktor-client-core-jsLegacy'] === 'undefined' ? {} : this['ktor-ktor-client-core-jsLegacy'], kotlin, this['kotlinx-coroutines-core'], this['ktor-ktor-utils-jsLegacy'], this['ktor-ktor-io-jsLegacy'], this['ktor-ktor-http-jsLegacy'], this['ktor-ktor-http-cio-jsLegacy']); } }(this, function(_, Kotlin, $module$kotlinx_coroutines_core, $module$ktor_ktor_utils_jsLegacy, $module$ktor_ktor_io_jsLegacy, $module$ktor_ktor_http_jsLegacy, $module$ktor_ktor_http_cio_jsLegacy) { 'use strict'; var $$importsForInline$$ = _.$$importsForInline$$ || (_.$$importsForInline$$ = {}); var Unit = Kotlin.kotlin.Unit; var Job = $module$kotlinx_coroutines_core.kotlinx.coroutines.Job; var ensureNotNull = Kotlin.ensureNotNull; var PropertyMetadata = Kotlin.PropertyMetadata; var COROUTINE_SUSPENDED = Kotlin.kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED; var CoroutineImpl = Kotlin.kotlin.coroutines.CoroutineImpl; var throwCCE = Kotlin.throwCCE; var AttributeKey = $module$ktor_ktor_utils_jsLegacy.io.ktor.util.AttributeKey; var Closeable = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.core.Closeable; var Job_0 = $module$kotlinx_coroutines_core.kotlinx.coroutines.Job_5dx9e$; var Attributes = $module$ktor_ktor_utils_jsLegacy.io.ktor.util.AttributesJsFn; var ChildJob = $module$kotlinx_coroutines_core.kotlinx.coroutines.ChildJob; var makeShared = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.makeShared_s8jyvk$; var Kind_CLASS = Kotlin.Kind.CLASS; var CoroutineScope = $module$kotlinx_coroutines_core.kotlinx.coroutines.CoroutineScope; var ReadWriteProperty = Kotlin.kotlin.properties.ReadWriteProperty; var IllegalStateException_init = Kotlin.kotlin.IllegalStateException_init_pdl1vj$; var Any = Object; var Annotation = Kotlin.kotlin.Annotation; var ByteReadChannel = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.ByteReadChannel; var throwUPAE = Kotlin.throwUPAE; var cancel = $module$kotlinx_coroutines_core.kotlinx.coroutines.cancel_n4wjt3$; var Throwable = Error; var Kind_OBJECT = Kotlin.Kind.OBJECT; var threadLocal = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.concurrent.threadLocal_issdgt$; var defineInlineFunction = Kotlin.defineInlineFunction; var wrapFunction = Kotlin.wrapFunction; var IllegalStateException_init_0 = Kotlin.kotlin.IllegalStateException_init; var IllegalStateException = Kotlin.kotlin.IllegalStateException; var UnsupportedOperationException_init = Kotlin.kotlin.UnsupportedOperationException_init; var flattenEntries = $module$ktor_ktor_utils_jsLegacy.io.ktor.util.flattenEntries_vr6bp2$; var joinToString = Kotlin.kotlin.collections.joinToString_fmv235$; var trimMargin = Kotlin.kotlin.text.trimMargin_rjktp$; var UnsupportedOperationException = Kotlin.kotlin.UnsupportedOperationException; var getReifiedTypeParameterKType = Kotlin.getReifiedTypeParameterKType; var getKClass = Kotlin.getKClass; var ByteReadChannel_0 = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.ByteReadChannel_fqrh44$; var readRemaining = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.readRemaining_3dmw3p$; var readBytes = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.core.readBytes_xc9h3n$; var IllegalArgumentException_init = Kotlin.kotlin.IllegalArgumentException_init_pdl1vj$; var IllegalArgumentException = Kotlin.kotlin.IllegalArgumentException; var CoroutineName = $module$kotlinx_coroutines_core.kotlinx.coroutines.CoroutineName; var emptySet = Kotlin.kotlin.collections.emptySet_287e2$; var async = $module$kotlinx_coroutines_core.kotlinx.coroutines.async_pda6u4$; var Kind_INTERFACE = Kotlin.Kind.INTERFACE; var http = $module$ktor_ktor_http_jsLegacy.io.ktor.http; var UnsafeHeaderException = $module$ktor_ktor_http_jsLegacy.io.ktor.http.UnsafeHeaderException; var CompletableJob = $module$kotlinx_coroutines_core.kotlinx.coroutines.CompletableJob; var SilentSupervisor = $module$ktor_ktor_utils_jsLegacy.io.ktor.util.SilentSupervisor_5dx9e$; var lazy = Kotlin.kotlin.lazy_klfg04$; var setOf = Kotlin.kotlin.collections.setOf_mh5how$; var Enum = Kotlin.kotlin.Enum; var throwISE = Kotlin.throwISE; var Url = $module$ktor_ktor_http_jsLegacy.io.ktor.http.Url_61zpoe$; var equals = Kotlin.equals; var CoroutineContext$Key = Kotlin.kotlin.coroutines.CoroutineContext.Key; var CoroutineContext$Element = Kotlin.kotlin.coroutines.CoroutineContext.Element; var CancellationException_init = $module$kotlinx_coroutines_core.kotlinx.coroutines.CancellationException_init_pdl1vj$; var util = $module$ktor_ktor_utils_jsLegacy.io.ktor.util; var ContentType = $module$ktor_ktor_http_jsLegacy.io.ktor.http.ContentType; var TextContent = $module$ktor_ktor_http_jsLegacy.io.ktor.http.content.TextContent; var OutgoingContent$ByteArrayContent = $module$ktor_ktor_http_jsLegacy.io.ktor.http.content.OutgoingContent.ByteArrayContent; var OutgoingContent$ReadChannelContent = $module$ktor_ktor_http_jsLegacy.io.ktor.http.content.OutgoingContent.ReadChannelContent; var toLong = Kotlin.kotlin.text.toLong_pdl1vz$; var Long$Companion$MAX_VALUE = Kotlin.Long.MAX_VALUE; var cancel_0 = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.cancel_3dmw3p$; var kotlin = Kotlin.kotlin; var toInt = Kotlin.kotlin.text.toInt_pdl1vz$; var PrimitiveClasses$intClass = Kotlin.kotlin.reflect.js.internal.PrimitiveClasses.intClass; var ByteReadPacket = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.core.ByteReadPacket; var Input = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.core.Input; var readRemaining_0 = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.readRemaining_b56lbm$; var PrimitiveClasses$byteArrayClass = Kotlin.kotlin.reflect.js.internal.PrimitiveClasses.byteArrayClass; var copyTo = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.copyTo_47ygvz$; var cancel_1 = $module$kotlinx_coroutines_core.kotlinx.coroutines.cancel_jnvdxk$; var CancellationException = $module$kotlinx_coroutines_core.kotlinx.coroutines.CancellationException; var writer = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.writer_x9a1ni$; var HttpStatusCode = $module$ktor_ktor_http_jsLegacy.io.ktor.http.HttpStatusCode; var reversed = Kotlin.kotlin.collections.reversed_7wnvza$; var PipelinePhase = $module$ktor_ktor_utils_jsLegacy.io.ktor.util.pipeline.PipelinePhase; var ArrayList_init = Kotlin.kotlin.collections.ArrayList_init_287e2$; var rangeTo = Kotlin.kotlin.ranges.rangeTo_38ydlf$; var contains = Kotlin.kotlin.ranges.contains_u6rtyw$; var charsets = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.charsets; var contentType = $module$ktor_ktor_http_jsLegacy.io.ktor.http.contentType_jzzg3d$; var charset = $module$ktor_ktor_http_jsLegacy.io.ktor.http.charset_10ldo9$; var PrimitiveClasses$stringClass = Kotlin.kotlin.reflect.js.internal.PrimitiveClasses.stringClass; var withCharset = $module$ktor_ktor_http_jsLegacy.io.ktor.http.withCharset_73qf4i$; var charset_0 = $module$ktor_ktor_http_jsLegacy.io.ktor.http.charset_v1wgmc$; var readText = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.core.readText_1lnizf$; var toList = Kotlin.kotlin.collections.toList_abgq59$; var get_name = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.charsets.get_name_2sg7fd$; var firstOrNull = Kotlin.kotlin.collections.firstOrNull_2p1efm$; var sortedWith = Kotlin.kotlin.collections.sortedWith_eknfly$; var Comparator = Kotlin.kotlin.Comparator; var StringBuilder_init = Kotlin.kotlin.text.StringBuilder_init; var roundToInt = Kotlin.kotlin.math.roundToInt_yrwdxr$; var LinkedHashSet_init = Kotlin.kotlin.collections.LinkedHashSet_init_287e2$; var LinkedHashMap_init = Kotlin.kotlin.collections.LinkedHashMap_init_q3lmfv$; var HttpMethod = $module$ktor_ktor_http_jsLegacy.io.ktor.http.HttpMethod; var setOf_0 = Kotlin.kotlin.collections.setOf_i5x0yv$; var get_authority = $module$ktor_ktor_http_jsLegacy.io.ktor.http.get_authority_5y8s0c$; var takeFrom = $module$ktor_ktor_http_jsLegacy.io.ktor.http.takeFrom_jl1sg7$; var isSecure = $module$ktor_ktor_http_jsLegacy.io.ktor.http.isSecure_v5fpbg$; var get_authority_0 = $module$ktor_ktor_http_jsLegacy.io.ktor.http.get_authority_3q1sfd$; var cancel_2 = $module$kotlinx_coroutines_core.kotlinx.coroutines.cancel_6dgle8$; var OutgoingContent = $module$ktor_ktor_http_jsLegacy.io.ktor.http.content.OutgoingContent; var hashCode = Kotlin.hashCode; var L0 = Kotlin.Long.ZERO; var delay = $module$kotlinx_coroutines_core.kotlinx.coroutines.delay_s8cxhz$; var launch = $module$kotlinx_coroutines_core.kotlinx.coroutines.launch_s496o7$; var HeaderValue = $module$ktor_ktor_http_jsLegacy.io.ktor.http.HeaderValue; var OutgoingContent$NoContent = $module$ktor_ktor_http_jsLegacy.io.ktor.http.content.OutgoingContent.NoContent; var isSuccess = $module$ktor_ktor_http_jsLegacy.io.ktor.http.isSuccess_b3he4c$; var cacheControl = $module$ktor_ktor_http_jsLegacy.io.ktor.http.cacheControl_v1wgmc$; var getCallableRef = Kotlin.getCallableRef; var Url_0 = $module$ktor_ktor_http_jsLegacy.io.ktor.http.Url_pboq08$; var plus = Kotlin.kotlin.collections.plus_khz7k3$; var emptyList = Kotlin.kotlin.collections.emptyList_287e2$; var vary = $module$ktor_ktor_http_jsLegacy.io.ktor.http.vary_v1wgmc$; var emptyMap = Kotlin.kotlin.collections.emptyMap_q3lmfv$; var GMTDate = $module$ktor_ktor_utils_jsLegacy.io.ktor.util.date.GMTDate_mts6q2$; var startsWith = Kotlin.kotlin.text.startsWith_7epoxm$; var split = Kotlin.kotlin.text.split_ip8yn$; var L1000 = Kotlin.Long.fromInt(1000); var plus_0 = $module$ktor_ktor_utils_jsLegacy.io.ktor.util.date.plus_e4j7mw$; var isBlank = Kotlin.kotlin.text.isBlank_gw00vp$; var fromHttpToGmtDate = $module$ktor_ktor_http_jsLegacy.io.ktor.http.fromHttpToGmtDate_pdl1vz$; var parseHeaderValue = $module$ktor_ktor_http_jsLegacy.io.ktor.http.parseHeaderValue_pdl1vj$; var HeadersBuilder_init = $module$ktor_ktor_http_jsLegacy.io.ktor.http.HeadersBuilder; var ConcurrentSet = $module$ktor_ktor_utils_jsLegacy.io.ktor.util.collections.ConcurrentSet; var ConcurrentMap = $module$ktor_ktor_utils_jsLegacy.io.ktor.util.collections.ConcurrentMap; var removeAll = Kotlin.kotlin.collections.removeAll_qafx1e$; var Mutex = $module$kotlinx_coroutines_core.kotlinx.coroutines.sync.Mutex_6taknv$; var URLBuilder = $module$ktor_ktor_http_jsLegacy.io.ktor.http.URLBuilder; var toList_0 = Kotlin.kotlin.collections.toList_7wnvza$; var ArrayList_init_0 = Kotlin.kotlin.collections.ArrayList_init_ww73n8$; var toLowerCasePreservingASCIIRules = $module$ktor_ktor_utils_jsLegacy.io.ktor.util.toLowerCasePreservingASCIIRules_pdl1vz$; var trimStart = Kotlin.kotlin.text.trimStart_wqw3xr$; var endsWith = Kotlin.kotlin.text.endsWith_sgbm27$; var toString = Kotlin.toString; var hostIsIp = $module$ktor_ktor_http_jsLegacy.io.ktor.http.hostIsIp_61zpoe$; var endsWith_0 = Kotlin.kotlin.text.endsWith_7epoxm$; var clone = $module$ktor_ktor_http_jsLegacy.io.ktor.http.clone_3q1sfd$; var setCookie = $module$ktor_ktor_http_jsLegacy.io.ktor.http.setCookie_v1wgmc$; var coroutines = $module$kotlinx_coroutines_core.kotlinx.coroutines; var encodeCookieValue = $module$ktor_ktor_http_jsLegacy.io.ktor.http.encodeCookieValue_n9y13p$; var split_0 = $module$ktor_ktor_utils_jsLegacy.io.ktor.util.split_o3z30d$; var discard = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.discard_3dmw3p$; var WebSocketSession = $module$ktor_ktor_http_cio_jsLegacy.io.ktor.http.cio.websocket.WebSocketSession; var DefaultWebSocketSession = $module$ktor_ktor_http_cio_jsLegacy.io.ktor.http.cio.websocket.DefaultWebSocketSession; var websocketServerAccept = $module$ktor_ktor_http_jsLegacy.io.ktor.http.websocket.websocketServerAccept_61zpoe$; var generateNonce = $module$ktor_ktor_utils_jsLegacy.io.ktor.util.generateNonce_za3lpa$; var encodeBase64 = $module$ktor_ktor_utils_jsLegacy.io.ktor.util.encodeBase64_964n91$; var L_1 = Kotlin.Long.NEG_ONE; var L2147483647 = Kotlin.Long.fromInt(2147483647); var isWebsocket = $module$ktor_ktor_http_jsLegacy.io.ktor.http.isWebsocket_v5fpbg$; var DefaultWebSocketSession_0 = $module$ktor_ktor_http_cio_jsLegacy.io.ktor.http.cio.websocket.DefaultWebSocketSession_23cfxb$; var URLProtocol = $module$ktor_ktor_http_jsLegacy.io.ktor.http.URLProtocol; var createKType = Kotlin.createKType; var close = $module$ktor_ktor_http_cio_jsLegacy.io.ktor.http.cio.websocket.close_icv0wc$; var copyAndClose = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.copyAndClose_47ygvz$; var ByteChannel = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.ByteChannel_6taknv$; var HttpMessage = $module$ktor_ktor_http_jsLegacy.io.ktor.http.HttpMessage; var takeFrom_0 = $module$ktor_ktor_http_jsLegacy.io.ktor.http.takeFrom_rs9g2p$; var appendAll = $module$ktor_ktor_utils_jsLegacy.io.ktor.util.appendAll_k10e8h$; var SupervisorJob = $module$kotlinx_coroutines_core.kotlinx.coroutines.SupervisorJob_5dx9e$; var HttpMessageBuilder = $module$ktor_ktor_http_jsLegacy.io.ktor.http.HttpMessageBuilder; var takeFrom_1 = $module$ktor_ktor_http_jsLegacy.io.ktor.http.takeFrom_wol2ee$; var Pipeline = $module$ktor_ktor_utils_jsLegacy.io.ktor.util.pipeline.Pipeline; var formUrlEncode = $module$ktor_ktor_http_jsLegacy.io.ktor.http.formUrlEncode_invt95$; var writeFully = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.writeFully_4scpqu$; var close_0 = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.close_x5qia6$; var OutgoingContent$WriteChannelContent = $module$ktor_ktor_http_jsLegacy.io.ktor.http.content.OutgoingContent.WriteChannelContent; var BytePacketBuilder = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.core.BytePacketBuilder_za3lpa$; var writeText = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.core.writeText_t153jy$; var writeFully_0 = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.core.writeFully_i6snlg$; var PartData$FileItem = $module$ktor_ktor_http_jsLegacy.io.ktor.http.content.PartData.FileItem; var PartData$BinaryItem = $module$ktor_ktor_http_jsLegacy.io.ktor.http.content.PartData.BinaryItem; var PartData$FormItem = $module$ktor_ktor_http_jsLegacy.io.ktor.http.content.PartData.FormItem; var Random = Kotlin.kotlin.random.Random; var toString_0 = Kotlin.kotlin.text.toString_dqglrj$; var take = Kotlin.kotlin.text.take_6ic1pp$; var readAvailable = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.core.readAvailable_czhrh1$; var encodeToByteArray = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.charsets.encodeToByteArray_fj4osb$; var collectionSizeOrDefault = Kotlin.kotlin.collections.collectionSizeOrDefault_ba2ldo$; var requestWriteBuffer = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.requestWriteBuffer_9tm6dw$; var Buffer = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.core.Buffer; var completeWriting = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.completeWriting_oczduq$; var Parameters = $module$ktor_ktor_http_jsLegacy.io.ktor.http.Parameters; var Headers = $module$ktor_ktor_http_jsLegacy.io.ktor.http.Headers; var ByteReadPacket_0 = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.core.ByteReadPacket_1qge3v$; var copyToArray = Kotlin.kotlin.collections.copyToArray; var decode = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.charsets.decode_lb8wo3$; var readFully = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.readFully_vg4m8x$; var OutgoingContent$ProtocolUpgrade = $module$ktor_ktor_http_jsLegacy.io.ktor.http.content.OutgoingContent.ProtocolUpgrade; var ConcurrentList = $module$ktor_ktor_utils_jsLegacy.io.ktor.util.collections.ConcurrentList; var writer_0 = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.writer_tkzhm5$; var numberToInt = Kotlin.numberToInt; var HttpProtocolVersion = $module$ktor_ktor_http_jsLegacy.io.ktor.http.HttpProtocolVersion; var CoroutineScope_0 = $module$kotlinx_coroutines_core.kotlinx.coroutines.CoroutineScope_1fupul$; var cancel_3 = $module$kotlinx_coroutines_core.kotlinx.coroutines.cancel_x105z1$; var Result = Kotlin.kotlin.Result; var createFailure = Kotlin.kotlin.createFailure_tcv7n7$; var intercepted = Kotlin.kotlin.coroutines.intrinsics.intercepted_f9mg25$; var CancellableContinuationImpl_init = $module$kotlinx_coroutines_core.kotlinx.coroutines.CancellableContinuationImpl; var toTypedArray = Kotlin.kotlin.collections.toTypedArray_964n91$; var Error_0 = Kotlin.kotlin.Error; var Error_init = Kotlin.kotlin.Error_init_pdl1vj$; var Channel = $module$kotlinx_coroutines_core.kotlinx.coroutines.channels.Channel_ww73n8$; var CompletableDeferred = $module$kotlinx_coroutines_core.kotlinx.coroutines.CompletableDeferred_xptg6w$; var Frame$Binary = $module$ktor_ktor_http_cio_jsLegacy.io.ktor.http.cio.websocket.Frame.Binary; var Frame$Frame$Text_init = $module$ktor_ktor_http_cio_jsLegacy.io.ktor.http.cio.websocket.Frame.Text_init_61zpoe$; var CloseReason = $module$ktor_ktor_http_cio_jsLegacy.io.ktor.http.cio.websocket.CloseReason; var Frame$Frame$Close_init = $module$ktor_ktor_http_cio_jsLegacy.io.ktor.http.cio.websocket.Frame.Close_init_p695es$; var String_0 = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.core.String_xge8xe$; var readShort = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.core.readShort_7wsnj1$; var CloseReason$Codes = $module$ktor_ktor_http_cio_jsLegacy.io.ktor.http.cio.websocket.CloseReason.Codes; var cancelConsumed = $module$kotlinx_coroutines_core.kotlinx.coroutines.channels.cancelConsumed_v57n85$; var IOException = $module$ktor_ktor_io_jsLegacy.io.ktor.utils.io.errors.IOException; DoubleReceiveException.prototype = Object.create(IllegalStateException.prototype); DoubleReceiveException.prototype.constructor = DoubleReceiveException; ReceivePipelineException.prototype = Object.create(IllegalStateException.prototype); ReceivePipelineException.prototype.constructor = ReceivePipelineException; NoTransformationFoundException.prototype = Object.create(UnsupportedOperationException.prototype); NoTransformationFoundException.prototype.constructor = NoTransformationFoundException; SavedHttpCall.prototype = Object.create(HttpClientCall_0.prototype); SavedHttpCall.prototype.constructor = SavedHttpCall; SavedHttpResponse.prototype = Object.create(HttpResponse_0.prototype); SavedHttpResponse.prototype.constructor = SavedHttpResponse; UnsupportedContentTypeException.prototype = Object.create(IllegalStateException.prototype); UnsupportedContentTypeException.prototype.constructor = UnsupportedContentTypeException; UnsupportedUpgradeProtocolException.prototype = Object.create(IllegalArgumentException.prototype); UnsupportedUpgradeProtocolException.prototype.constructor = UnsupportedUpgradeProtocolException; ClientEngineClosedException.prototype = Object.create(IllegalStateException.prototype); ClientEngineClosedException.prototype.constructor = ClientEngineClosedException; ProxyType.prototype = Object.create(Enum.prototype); ProxyType.prototype.constructor = ProxyType; ResponseException.prototype = Object.create(IllegalStateException.prototype); ResponseException.prototype.constructor = ResponseException; RedirectResponseException.prototype = Object.create(ResponseException.prototype); RedirectResponseException.prototype.constructor = RedirectResponseException; ServerResponseException.prototype = Object.create(ResponseException.prototype); ServerResponseException.prototype.constructor = ServerResponseException; ClientRequestException.prototype = Object.create(ResponseException.prototype); ClientRequestException.prototype.constructor = ClientRequestException; defaultTransformers$lambda$ObjectLiteral.prototype = Object.create(OutgoingContent$ByteArrayContent.prototype); defaultTransformers$lambda$ObjectLiteral.prototype.constructor = defaultTransformers$lambda$ObjectLiteral; defaultTransformers$lambda$ObjectLiteral_0.prototype = Object.create(OutgoingContent$ReadChannelContent.prototype); defaultTransformers$lambda$ObjectLiteral_0.prototype.constructor = defaultTransformers$lambda$ObjectLiteral_0; SendCountExceedException.prototype = Object.create(IllegalStateException.prototype); SendCountExceedException.prototype.constructor = SendCountExceedException; HttpRequestTimeoutException.prototype = Object.create(CancellationException.prototype); HttpRequestTimeoutException.prototype.constructor = HttpRequestTimeoutException; InvalidCacheStateException.prototype = Object.create(IllegalStateException.prototype); InvalidCacheStateException.prototype.constructor = InvalidCacheStateException; DisabledCacheStorage.prototype = Object.create(HttpCacheStorage.prototype); DisabledCacheStorage.prototype.constructor = DisabledCacheStorage; UnlimitedCacheStorage.prototype = Object.create(HttpCacheStorage.prototype); UnlimitedCacheStorage.prototype.constructor = UnlimitedCacheStorage; DelegatedCall.prototype = Object.create(HttpClientCall_0.prototype); DelegatedCall.prototype.constructor = DelegatedCall; DelegatedResponse.prototype = Object.create(HttpResponse_0.prototype); DelegatedResponse.prototype.constructor = DelegatedResponse; ClientUpgradeContent.prototype = Object.create(OutgoingContent$NoContent.prototype); ClientUpgradeContent.prototype.constructor = ClientUpgradeContent; WebSocketContent.prototype = Object.create(ClientUpgradeContent.prototype); WebSocketContent.prototype.constructor = WebSocketContent; WebSocketException.prototype = Object.create(IllegalStateException.prototype); WebSocketException.prototype.constructor = WebSocketException; HttpRequestPipeline.prototype = Object.create(Pipeline.prototype); HttpRequestPipeline.prototype.constructor = HttpRequestPipeline; HttpSendPipeline.prototype = Object.create(Pipeline.prototype); HttpSendPipeline.prototype.constructor = HttpSendPipeline; FormDataContent.prototype = Object.create(OutgoingContent$ByteArrayContent.prototype); FormDataContent.prototype.constructor = FormDataContent; MultiPartFormDataContent.prototype = Object.create(OutgoingContent$WriteChannelContent.prototype); MultiPartFormDataContent.prototype.constructor = MultiPartFormDataContent; DefaultHttpResponse.prototype = Object.create(HttpResponse_0.prototype); DefaultHttpResponse.prototype.constructor = DefaultHttpResponse; HttpResponsePipeline.prototype = Object.create(Pipeline.prototype); HttpResponsePipeline.prototype.constructor = HttpResponsePipeline; HttpReceivePipeline.prototype = Object.create(Pipeline.prototype); HttpReceivePipeline.prototype.constructor = HttpReceivePipeline; EmptyContent.prototype = Object.create(OutgoingContent$NoContent.prototype); EmptyContent.prototype.constructor = EmptyContent; wrapHeaders$ObjectLiteral.prototype = Object.create(OutgoingContent$NoContent.prototype); wrapHeaders$ObjectLiteral.prototype.constructor = wrapHeaders$ObjectLiteral; wrapHeaders$ObjectLiteral_0.prototype = Object.create(OutgoingContent$ReadChannelContent.prototype); wrapHeaders$ObjectLiteral_0.prototype.constructor = wrapHeaders$ObjectLiteral_0; wrapHeaders$ObjectLiteral_1.prototype = Object.create(OutgoingContent$WriteChannelContent.prototype); wrapHeaders$ObjectLiteral_1.prototype.constructor = wrapHeaders$ObjectLiteral_1; wrapHeaders$ObjectLiteral_2.prototype = Object.create(OutgoingContent$ByteArrayContent.prototype); wrapHeaders$ObjectLiteral_2.prototype.constructor = wrapHeaders$ObjectLiteral_2; wrapHeaders$ObjectLiteral_3.prototype = Object.create(OutgoingContent$ProtocolUpgrade.prototype); wrapHeaders$ObjectLiteral_3.prototype.constructor = wrapHeaders$ObjectLiteral_3; JsClientEngine.prototype = Object.create(HttpClientEngineBase.prototype); JsClientEngine.prototype.constructor = JsClientEngine; JsError.prototype = Object.create(Throwable.prototype); JsError.prototype.constructor = JsError; ConnectTimeoutException_1.prototype = Object.create(IOException.prototype); ConnectTimeoutException_1.prototype.constructor = ConnectTimeoutException_1; SocketTimeoutException_0.prototype = Object.create(IOException.prototype); SocketTimeoutException_0.prototype.constructor = SocketTimeoutException_0; function shared$ObjectLiteral(closure$value) { this.value_0 = closure$value; } shared$ObjectLiteral.prototype.getValue_lrcp0p$ = function(thisRef, property) { return this.value_0; }; shared$ObjectLiteral.prototype.setValue_9rddgb$ = function(thisRef, property, value) { this.value_0 = value; }; shared$ObjectLiteral.$metadata$ = { kind: Kind_CLASS, interfaces: [ReadWriteProperty]}; function HttpClient$lambda($receiver) { return Unit; } function HttpClient$lambda_0(closure$engine) { return function(it) { closure$engine.close(); return Unit; }; } function HttpClient(engineFactory, block) { if (block === void 0) block = HttpClient$lambda; var $receiver = new HttpClientConfig(); block($receiver); var config = $receiver; var engine = engineFactory.create_dxyxif$(config.engineConfig_8be2vx$); var client = HttpClient_init(engine, config, true); ensureNotNull(client.coroutineContext.get_j3r2sn$(Job.Key)).invokeOnCompletion_f05bi3$(HttpClient$lambda_0(engine)); return client; } function HttpClient_0(engine, block) { var $receiver = new HttpClientConfig(); block($receiver); return HttpClient_init(engine, $receiver, false); } function HttpClient_1(engine, userConfig) { if (userConfig === void 0) userConfig = new HttpClientConfig(); this.engine = engine; this.userConfig_0 = userConfig; this.manageEngine_ry3wwv$_0 = new shared$ObjectLiteral(false); this.closed_0 = false; this.clientJob_0 = Job_0(); this.coroutineContext_94yqr5$_0 = this.engine.coroutineContext.plus_1fupul$(this.clientJob_0); this.requestPipeline = new HttpRequestPipeline(); this.responsePipeline = new HttpResponsePipeline(); this.sendPipeline = new HttpSendPipeline(); this.receivePipeline = new HttpReceivePipeline(); this.attributes = Attributes(true); this.engineConfig = this.engine.config; this.config_8be2vx$ = new HttpClientConfig(); var tmp$; checkCoroutinesVersion(); var engineJob = ensureNotNull(this.engine.coroutineContext.get_j3r2sn$(Job.Key)); this.clientJob_0.attachChild_kx8v25$(Kotlin.isType(tmp$ = engineJob, ChildJob) ? tmp$ : throwCCE()); this.engine.install_k5i6f8$(this); this.sendPipeline.intercept_h71y74$(HttpSendPipeline$Phases_getInstance().Receive, HttpClient_init$lambda(this)); var $receiver = this.userConfig_0; this.config_8be2vx$.install_xlxg29$(HttpRequestLifecycle$Feature_getInstance()); if ($receiver.useDefaultTransformers) { this.config_8be2vx$.install_xlxg29$(HttpPlainText$Feature_getInstance()); this.config_8be2vx$.install_q2ual$('DefaultTransformers', HttpClient_init$lambda$lambda); } if ($receiver.expectSuccess) { addDefaultResponseValidation(this.config_8be2vx$); } this.config_8be2vx$.install_xlxg29$(HttpSend$Feature_getInstance()); if ($receiver.followRedirects) { this.config_8be2vx$.install_xlxg29$(HttpRedirect$Feature_getInstance()); } this.config_8be2vx$.plusAssign_bi476h$($receiver); this.config_8be2vx$.install_k5i6f8$(this); makeShared(this); } var HttpClient$manageEngine_metadata = new PropertyMetadata('manageEngine'); Object.defineProperty(HttpClient_1.prototype, 'manageEngine_0', { configurable: true, get: function() { return this.manageEngine_ry3wwv$_0.getValue_lrcp0p$(this, HttpClient$manageEngine_metadata); }, set: function(manageEngine) { this.manageEngine_ry3wwv$_0.setValue_9rddgb$(this, HttpClient$manageEngine_metadata, manageEngine); }}); Object.defineProperty(HttpClient_1.prototype, 'coroutineContext', { configurable: true, get: function() { return this.coroutineContext_94yqr5$_0; }}); Object.defineProperty(HttpClient_1.prototype, 'dispatcher', { configurable: true, get: function() { return this.engine.dispatcher; }}); function Coroutine$execute_s9rlw$($this, builder_0, continuation_0) { CoroutineImpl.call(this, continuation_0); this.exceptionState_0 = 1; this.$this = $this; this.local$builder = builder_0; } Coroutine$execute_s9rlw$.$metadata$ = { kind: Kotlin.Kind.CLASS, simpleName: null, interfaces: [CoroutineImpl]}; Coroutine$execute_s9rlw$.prototype = Object.create(CoroutineImpl.prototype); Coroutine$execute_s9rlw$.prototype.constructor = Coroutine$execute_s9rlw$; Coroutine$execute_s9rlw$.prototype.doResume = function() { do try { switch (this.state_0) { case 0: var tmp$; this.state_0 = 2; this.result_0 = this.$this.requestPipeline.execute_8pmvt0$(this.local$builder, this.local$builder.body, this); if (this.result_0 === COROUTINE_SUSPENDED) return COROUTINE_SUSPENDED; continue; case 1: throw this.exception_0; case 2: return Kotlin.isType(tmp$ = this.result_0, HttpClientCall_0) ? tmp$ : throwCCE(); default: this.state_0 = 1; throw new Error('State Machine Unreachable execution'); } } catch (e) { if (this.state_0 === 1) { this.exceptionState_0 = this.state_0; throw e; } else { this.state_0 = this.exceptionState_0; this.exception_0 = e; } } while (true); }; HttpClient_1.prototype.execute_s9rlw$ = function(builder_0, continuation_0, suspended) { var instance = new Coroutine$execute_s9rlw$(this, builder_0, continuation_0); if (suspended) return instance; else return instance.doResume(null); }; HttpClient_1.prototype.isSupported_tlxpog$ = function(capability) { return this.engine.supportedCapabilities.contains_11rb$(capability); }; HttpClient_1.prototype.config_f0veat$ = function(block) { var tmp$ = this.engine; var $receiver = new HttpClientConfig(); $receiver.plusAssign_bi476h$(this.userConfig_0); block($receiver); return HttpClient_init(tmp$, $receiver, this.manageEngine_0); }; HttpClient_1.prototype.close = function() { var success = (function(scope) { return scope.closed_0 === false ? function() { scope.closed_0 = true; return true; }() : false; })(this); if (!success) return; var tmp$; tmp$ = this.attributes.allKeys.iterator(); while (tmp$.hasNext()) { var element = tmp$.next(); var tmp$_0; var feature = this.attributes.get_yzaw86$(Kotlin.isType(tmp$_0 = element, AttributeKey) ? tmp$_0 : throwCCE()); if (Kotlin.isType(feature, Closeable)) { feature.close(); } } this.clientJob_0.complete(); if (this.manageEngine_0) { this.engine.close(); } }; HttpClient_1.prototype.toString = function() { return 'HttpClient[' + this.engine + ']'; }; function Coroutine$HttpClient_init$lambda(this$HttpClient_0, $receiver_0, call_0, controller, continuation_0) { CoroutineImpl.call(this, continuation_0); this.$controller = controller; this.exceptionState_0 = 1; this.local$this$HttpClient = this$HttpClient_0; this.local$$receiver = $receiver_0; this.local$call = call_0; } Coroutine$HttpClient_init$lambda.$metadata$ = { kind: Kotlin.Kind.CLASS, simpleName: null, interfaces: [CoroutineImpl]}; Coroutine$HttpClient_init$lambda.prototype = Object.create(CoroutineImpl.prototype); Coroutine$HttpClient_init$lambda.prototype.constructor = Coroutine$HttpClient_init$lambda; Coroutine$HttpClient_init$lambda.prototype.doResume = function() { do try { switch (this.state_0) { case 0: if (!Kotlin.isType(this.local$call, HttpClientCall_0)) { var message = 'Error: HttpClientCall expected, but found ' + this.local$call.toString() + '(' + Kotlin.getKClassFromExpression(this.local$call) + ').'; throw IllegalStateException_init(message.toString()); } this.state_0 = 2; this.result_0 = this.local$this$HttpClient.receivePipeline.execute_8pmvt0$(this.local$call, this.local$call.response, this); if (this.result_0 === COROUTINE_SUSPENDED) return COROUTINE_SUSPENDED; continue; case 1: throw this.exception_0; case 2: var receivedCall = this.result_0.call; this.state_0 = 3; this.result_0 = this.local$$receiver.proceedWith_trkh7z$(receivedCall, this); if (this.result_0 === COROUTINE_SUSPENDED) return COROUTINE_SUSPENDED; continue; case 3: return this.result_0; default: this.state_0 = 1; throw new Error('State Machine Unreachable execution'); } } catch (e) { if (this.state_0 === 1) { this.exceptionState_0 = this.state_0; throw e; } else { this.state_0 = this.exceptionState_0; this.exception_0 = e; } } while (true); }; function HttpClient_init$lambda(this$HttpClient_0) { return function($receiver_0, call_0, continuation_0, suspended) { var instance = new Coroutine$HttpClient_init$lambda(this$HttpClient_0, $receiver_0, call_0, this, continuation_0); if (suspended) return instance; else return instance.doResume(null); }; } function HttpClient_init$lambda$lambda($receiver) { defaultTransformers($receiver); return Unit; } HttpClient_1.$metadata$ = { kind: Kind_CLASS, simpleName: 'HttpClient', interfaces: [Closeable, CoroutineScope]}; function HttpClient_init(engine, userConfig, manageEngine, $this) { $this = $this || Object.create(HttpClient_1.prototype); HttpClient_1.call($this, engine, userConfig); $this.manageEngine_0 = manageEngine; return $this; } function shared$ObjectLiteral_0(closure$value) { this.value_0 = closure$value; } shared$ObjectLiteral_0.prototype.getValue_lrcp0p$ = function(thisRef, property) { return this.value_0; }; shared$ObjectLiteral_0.prototype.setValue_9rddgb$ = function(thisRef, property, value) { this.value_0 = value; }; shared$ObjectLiteral_0.$metadata$ = { kind: Kind_CLASS, interfaces: [ReadWriteProperty]}; function HttpClientConfig() { this.features_0 = sharedMap(); this.featureConfigurations_0 = sharedMap(); this.customInterceptors_0 = sharedMap(); this.engineConfig_8be2vx$_8hwuhy$_0 = new shared$ObjectLiteral_0(HttpClientConfig$engineConfig$lambda); this.followRedirects_u64lb0$_0 = new shared$ObjectLiteral_0(true); this.useDefaultTransformers_4nse22$_0 = new shared$ObjectLiteral_0(true); this.expectSuccess_kppdwg$_0 = new shared$ObjectLiteral_0(true); } var HttpClientConfig$engineConfig_metadata = new PropertyMetadata('engineConfig'); Object.defineProperty(HttpClientConfig.prototype, 'engineConfig_8be2vx$', { configurable: true, get: function() { return this.engineConfig_8be2vx$_8hwuhy$_0.getValue_lrcp0p$(this, HttpClientConfig$engineConfig_metadata); }, set: function(engineConfig) { this.engineConfig_8be2vx$_8hwuhy$_0.setValue_9rddgb$(this, HttpClientConfig$engineConfig_metadata, engineConfig); }}); function HttpClientConfig$engine$lambda(closure$oldConfig, closure$block) { return function($receiver) { closure$oldConfig($receiver); closure$block($receiver); return Unit; }; } HttpClientConfig.prototype.engine_dxyxif$ = function(block) { var oldConfig = this.engineConfig_8be2vx$; this.engineConfig_8be2vx$ = HttpClientConfig$engine$lambda(oldConfig, block); }; var HttpClientConfig$followRedirects_metadata = new PropertyMetadata('followRedirects'); Object.defineProperty(HttpClientConfig.prototype, 'followRedirects', { configurable: true, get: function() { return this.followRedirects_u64lb0$_0.getValue_lrcp0p$(this, HttpClientConfig$followRedirects_metadata); }, set: function(followRedirects) { this.followRedirects_u64lb0$_0.setValue_9rddgb$(this, HttpClientConfig$followRedirects_metadata, followRedirects); }}); var HttpClientConfig$useDefaultTransformers_metadata = new PropertyMetadata('useDefaultTransformers'); Object.defineProperty(HttpClientConfig.prototype, 'useDefaultTransformers', { configurable: true, get: function() { return this.useDefaultTransformers_4nse22$_0.getValue_lrcp0p$(this, HttpClientConfig$useDefaultTransformers_metadata); }, set: function(useDefaultTransformers) { this.useDefaultTransformers_4nse22$_0.setValue_9rddgb$(this, HttpClientConfig$useDefaultTransformers_metadata, useDefaultTransformers); }}); var HttpClientConfig$expectSuccess_metadata = new PropertyMetadata('expectSuccess'); Object.defineProperty(HttpClientConfig.prototype, 'expectSuccess', { configurable: true, get: function() { return this.expectSuccess_kppdwg$_0.getValue_lrcp0p$(this, HttpClientConfig$expectSuccess_metadata); }, set: function(expectSuccess) { this.expectSuccess_kppdwg$_0.setValue_9rddgb$(this, HttpClientConfig$expectSuccess_metadata, expectSuccess); }}); function HttpClientConfig$install$lambda($receiver) { return Unit; } function HttpClientConfig$install$lambda_0(closure$previousConfigBlock, closure$configure) { return function($receiver) { var tmp$; closure$previousConfigBlock != null ? closure$previousConfigBlock($receiver) : null; closure$configure(Kotlin.isType(tmp$ = $receiver, Any) ? tmp$ : throwCCE()); return Unit; }; } function HttpClientConfig$install$lambda$lambda() { return Attributes(true); } function HttpClientConfig$install$lambda_1(closure$feature) { return function(scope) { var attributes = scope.attributes.computeIfAbsent_u4q9l2$(FEATURE_INSTALLED_LIST, HttpClientConfig$install$lambda$lambda); var config = ensureNotNull(scope.config_8be2vx$.featureConfigurations_0.get_11rb$(closure$feature.key)); var featureData = closure$feature.prepare_oh3mgy$(config); closure$feature.install_wojrb5$(featureData, scope); attributes.put_uuntuo$(closure$feature.key, featureData); return Unit; }; } HttpClientConfig.prototype.install_xlxg29$ = function(feature, configure) { if (configure === void 0) configure = HttpClientConfig$install$lambda; var previousConfigBlock = this.featureConfigurations_0.get_11rb$(feature.key); var $receiver = this.featureConfigurations_0; var key = feature.key; $receiver.put_xwzc9p$(key, HttpClientConfig$install$lambda_0(previousConfigBlock, configure)); if (this.features_0.containsKey_11rb$(feature.key)) return; var $receiver_0 = this.features_0; var key_0 = feature.key; $receiver_0.put_xwzc9p$(key_0, HttpClientConfig$install$lambda_1(feature)); }; HttpClientConfig.prototype.install_q2ual$ = function(key, block) { this.customInterceptors_0.put_xwzc9p$(key, block); }; HttpClientConfig.prototype.install_k5i6f8$ = function(client) { var tmp$; tmp$ = this.features_0.values.iterator(); while (tmp$.hasNext()) { var element = tmp$.next(); element(client); } var tmp$_0; tmp$_0 = this.customInterceptors_0.values.iterator(); while (tmp$_0.hasNext()) { var element_0 = tmp$_0.next(); element_0(client); } }; HttpClientConfig.prototype.clone = function() { var result = new HttpClientConfig(); result.plusAssign_bi476h$(this); return result; }; HttpClientConfig.prototype.plusAssign_bi476h$ = function(other) { this.followRedirects = other.followRedirects; this.useDefaultTransformers = other.useDefaultTransformers; this.expectSuccess = other.expectSuccess; var $receiver = this.features_0; var map = other.features_0; $receiver.putAll_a2k3zr$(map); var $receiver_0 = this.featureConfigurations_0; var map_0 = other.featureConfigurations_0; $receiver_0.putAll_a2k3zr$(map_0); var $receiver_1 = this.customInterceptors_0; var map_1 = other.customInterceptors_0; $receiver_1.putAll_a2k3zr$(map_1); }; function HttpClientConfig$engineConfig$lambda($receiver) { return Unit; } HttpClientConfig.$metadata$ = { kind: Kind_CLASS, simpleName: 'HttpClientConfig', interfaces: []}; function HttpClientDsl() { } HttpClientDsl.$metadata$ = { kind: Kind_CLASS, simpleName: 'HttpClientDsl', interfaces: [Annotation]}; function HttpClientCall(client, requestData, responseData) { var $receiver = new HttpClientCall_0(client); $receiver.request = new DefaultHttpRequest($receiver, requestData); $receiver.response = new DefaultHttpResponse($receiver, responseData); if (!Kotlin.isType(responseData.body, ByteReadChannel)) { $receiver.attributes.put_uuntuo$(HttpClientCall$Companion_getInstance().CustomResponse, responseData.body); } return $receiver; } function HttpClientCall_0(client) { HttpClientCall$Companion_getInstance(); this.received_8b75r7$_0 = false; this.client_77eog7$_0 = threadLocal(client); this.request_vta333$_0 = this.request_vta333$_0; this.response_zcvbsz$_0 = this.response_zcvbsz$_0; } var HttpClientCall$client_metadata = new PropertyMetadata('client'); Object.defineProperty(HttpClientCall_0.prototype, 'client', { configurable: true, get: function() { return this.client_77eog7$_0.getValue_lrcp0p$(this, HttpClientCall$client_metadata); }}); Object.defineProperty(HttpClientCall_0.prototype, 'coroutineContext', { configurable: true, get: function() { return this.response.coroutineContext; }}); Object.defineProperty(HttpClientCall_0.prototype, 'attributes', { configurable: true, get: function() { return this.request.attributes; }}); Object.defineProperty(HttpClientCall_0.prototype, 'request', { configurable: true, get: function() { if (this.request_vta333$_0 == null) return throwUPAE('request'); return this.request_vta333$_0; }, set: function(request) { this.request_vta333$_0 = request; }}); Object.defineProperty(HttpClientCall_0.prototype, 'response', { configurable: true, get: function() { if (this.response_zcvbsz$_0 == null) return throwUPAE('response'); return this.response_zcvbsz$_0; }, set: function(response) { this.response_zcvbsz$_0 = response; }}); function Coroutine$receive_jo9acv$($this, info_0, continuation_0) { CoroutineImpl.call(this, continuation_0); this.exceptionState_0 = 7; this.$this = $this; this.local$info = info_0; } Coroutine$receive_jo9acv$.$metadata$ = { kind: Kotlin.Kind.CLASS, simpleName: null, interfaces: [CoroutineImpl]}; Coroutine$receive_jo9acv$.prototype = Object.create(CoroutineImpl.prototype); Coroutine$receive_jo9acv$.prototype.constructor = Coroutine$receive_jo9acv$; Coroutine$receive_jo9acv$.prototype.doResume = function() { do try { switch (this.state_0) { case 0: var tmp$, tmp$_0; this.exceptionState_0 = 1; if (instanceOf(this.$this.response, this.local$info.type)) { this.exceptionState_0 = 7; this.finallyPath_0 = [2]; this.state_0 = 6; this.$returnValue = this.$this.response; continue; } else { this.state_0 = 3; continue; } case 1: this.finallyPath_0 = [7]; this.exceptionState_0 = 6; var cause = this.exception_0; if (Kotlin.isType(cause, Throwable)) { cancel(this.$this.response, 'Receive failed', cause); throw cause; } else throw cause; case 2: return this.$returnValue; case 3: if (!(function(scope) { return scope.$this.received_8b75r7$_0 === false ? function() { scope.$this.received_8b75r7$_0 = true; return true; }() : false; })(this)) throw new DoubleReceiveException(this.$this); var responseData = (tmp$ = this.$this.attributes.getOrNull_yzaw86$(HttpClientCall$Companion_getInstance().CustomResponse)) != null ? tmp$ : this.$this.response.content; var subject = new HttpResponseContainer(this.local$info, responseData); var tmp$_1; if ((tmp$_0 = this.$this.client) != null) tmp$_1 = tmp$_0; else { throw IllegalStateException_init(('Failed to receive call(' + this.$this + ') in different native thread.').toString()); } var currentClient = tmp$_1; this.state_0 = 4; this.result_0 = currentClient.responsePipeline.execute_8pmvt0$(this.$this, subject, this); if (this.result_0 === COROUTINE_SUSPENDED) return COROUTINE_SUSPENDED; continue; case 4: var result = this.result_0.response; if (!instanceOf(result, this.local$info.type)) { var from = Kotlin.getKClassFromExpression(result); var to = this.local$info.type; throw new NoTransformationFoundException(this.$this.response, from, to); } this.exceptionState_0 = 7; this.finallyPath_0 = [5]; this.state_0 = 6; this.$returnValue = result; continue; case 5: return this.$returnValue; case 6: this.exceptionState_0 = 7; complete(this.$this.response); this.state_0 = this.finallyPath_0.shift(); continue; case 7: throw this.exception_0; case 8: return; default: this.state_0 = 7; throw new Error('State Machine Unreachable execution'); } } catch (e) { if (this.state_0 === 7) { this.exceptionState_0 = this.state_0; throw e; } else { this.state_0 = this.exceptionState_0; this.exception_0 = e; } } while (true); }; HttpClientCall_0.prototype.receive_jo9acv$ = function(info_0, continuation_0, suspended) { var instance = new Coroutine$receive_jo9acv$(this, info_0, continuation_0); if (suspended) return instance; else return instance.doResume(null); }; HttpClientCall_0.prototype.toString = function() { return 'HttpClientCall[' + this.request.url + ', ' + this.response.status + ']'; }; function HttpClientCall$Companion() { HttpClientCall$Companion_instance = this; this.CustomResponse = new AttributeKey('CustomResponse'); } HttpClientCall$Companion.$metadata$ = { kind: Kind_OBJECT, simpleName: 'Companion', interfaces: []}; var HttpClientCall$Companion_instance = null; function HttpClientCall$Companion_getInstance() { if (HttpClientCall$Companion_instance === null) { new HttpClientCall$Companion(); } return HttpClientCall$Companion_instance; } HttpClientCall_0.$metadata$ = { kind: Kind_CLASS, simpleName: 'HttpClientCall', interfaces: [CoroutineScope]}; function HttpEngineCall(request, response) { this.request = request; this.response = response; } HttpEngineCall.$metadata$ = { kind: Kind_CLASS, simpleName: 'HttpEngineCall', interfaces: []}; HttpEngineCall.prototype.component1 = function() { return this.request; }; HttpEngineCall.prototype.component2 = function() { return this.response; }; HttpEngineCall.prototype.copy_ukxvzw$ = function(request, response) { return new HttpEngineCall(request === void 0 ? this.request : request, response === void 0 ? this.response : response); }; HttpEngineCall.prototype.toString = function() { return 'HttpEngineCall(request=' + Kotlin.toString(this.request) + (', response=' + Kotlin.toString(this.response)) + ')'; }; HttpEngineCall.prototype.hashCode = function() { var result = 0; result = result * 31 + Kotlin.hashCode(this.request) | 0; result = result * 31 + Kotlin.hashCode(this.response) | 0; return result; }; HttpEngineCall.prototype.equals = function(other) { return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.request, other.r