(function (_, kotlin_kotlin, kotlin_io_ktor_ktor_http, kotlin_io_ktor_ktor_serialization, kotlin_io_ktor_ktor_io, kotlin_io_ktor_ktor_client_core, kotlin_io_ktor_ktor_utils) {
  'use strict';
  //region block: imports
  var protoOf = kotlin_kotlin.$_$.od;
  var initMetadataForClass = kotlin_kotlin.$_$.pc;
  var plus = kotlin_kotlin.$_$.u8;
  var toMutableSet = kotlin_kotlin.$_$.w9;
  var ArrayList_init_$Create$ = kotlin_kotlin.$_$.l1;
  var Application_getInstance = kotlin_io_ktor_ktor_http.$_$.b;
  var register$default = kotlin_io_ktor_ktor_serialization.$_$.b;
  var Unit_instance = kotlin_kotlin.$_$.b1;
  var Configuration = kotlin_io_ktor_ktor_serialization.$_$.c;
  var VOID = kotlin_kotlin.$_$.c;
  var Exception = kotlin_kotlin.$_$.oi;
  var Exception_init_$Init$ = kotlin_kotlin.$_$.n2;
  var captureStack = kotlin_kotlin.$_$.zb;
  var toString = kotlin_kotlin.$_$.rd;
  var Charsets_getInstance = kotlin_io_ktor_ktor_io.$_$.a;
  var CoroutineImpl = kotlin_kotlin.$_$.xa;
  var THROW_CCE = kotlin_kotlin.$_$.vi;
  var TransformRequestBodyContext = kotlin_io_ktor_ktor_client_core.$_$.b;
  var HttpRequestBuilder = kotlin_io_ktor_ktor_client_core.$_$.h;
  var TypeInfo = kotlin_io_ktor_ktor_utils.$_$.l;
  var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.fa;
  var initMetadataForLambda = kotlin_kotlin.$_$.uc;
  var TransformResponseBodyContext = kotlin_io_ktor_ktor_client_core.$_$.c;
  var HttpResponse = kotlin_io_ktor_ktor_client_core.$_$.m;
  var ByteReadChannel = kotlin_io_ktor_ktor_io.$_$.j1;
  var isInterface = kotlin_kotlin.$_$.ed;
  var contentType = kotlin_io_ktor_ktor_http.$_$.m1;
  var get_request = kotlin_io_ktor_ktor_client_core.$_$.o;
  var suitableCharset = kotlin_io_ktor_ktor_serialization.$_$.e;
  var Collection = kotlin_kotlin.$_$.q5;
  var emptyList = kotlin_kotlin.$_$.k7;
  var Companion_getInstance = kotlin_io_ktor_ktor_http.$_$.c;
  var accept = kotlin_io_ktor_ktor_client_core.$_$.i;
  var OutgoingContent = kotlin_io_ktor_ktor_http.$_$.v;
  var getKClassFromExpression = kotlin_kotlin.$_$.he;
  var contentType_0 = kotlin_io_ktor_ktor_http.$_$.k1;
  var EmptyContent_getInstance = kotlin_io_ktor_ktor_client_core.$_$.a;
  var Unit = kotlin_kotlin.$_$.gj;
  var charset = kotlin_io_ktor_ktor_http.$_$.i1;
  var ensureNotNull = kotlin_kotlin.$_$.nj;
  var NullBody_instance = kotlin_io_ktor_ktor_http.$_$.a;
  var equals = kotlin_kotlin.$_$.ic;
  var joinToString = kotlin_kotlin.$_$.c8;
  var initMetadataForCoroutine = kotlin_kotlin.$_$.rc;
  var collectionSizeOrDefault = kotlin_kotlin.$_$.p6;
  var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.k1;
  var deserialize = kotlin_io_ktor_ktor_serialization.$_$.a;
  var KtorSimpleLogger = kotlin_io_ktor_ktor_utils.$_$.g;
  var PrimitiveClasses_getInstance = kotlin_kotlin.$_$.o;
  var HttpStatusCode = kotlin_io_ktor_ktor_http.$_$.a1;
  var getKClass = kotlin_kotlin.$_$.ie;
  var ClientSSESession = kotlin_io_ktor_ktor_client_core.$_$.f;
  var ClientSSESessionWithDeserialization = kotlin_io_ktor_ktor_client_core.$_$.e;
  var setOf = kotlin_kotlin.$_$.e9;
  var KtList = kotlin_kotlin.$_$.v5;
  var ContentType = kotlin_io_ktor_ktor_http.$_$.y;
  var arrayOf = kotlin_kotlin.$_$.jj;
  var createKType = kotlin_kotlin.$_$.ge;
  var createInvariantKTypeProjection = kotlin_kotlin.$_$.ee;
  var AttributeKey = kotlin_io_ktor_ktor_utils.$_$.n;
  var createClientPlugin = kotlin_io_ktor_ktor_client_core.$_$.d;
  var endsWith = kotlin_kotlin.$_$.jf;
  var initMetadataForObject = kotlin_kotlin.$_$.vc;
  var LinkedHashSet_init_$Create$ = kotlin_kotlin.$_$.w1;
  //endregion
  //region block: pre-declaration
  initMetadataForClass(ConverterRegistration, 'ConverterRegistration');
  initMetadataForClass(ContentNegotiationConfig$defaultMatcher$1);
  initMetadataForClass(ContentNegotiationConfig, 'ContentNegotiationConfig', ContentNegotiationConfig, VOID, [Configuration]);
  initMetadataForClass(ContentConverterException, 'ContentConverterException', VOID, Exception);
  initMetadataForLambda(ContentNegotiation$lambda$slambda, CoroutineImpl, VOID, [4]);
  initMetadataForLambda(ContentNegotiation$lambda$slambda_1, CoroutineImpl, VOID, [4]);
  initMetadataForCoroutine($invoke$convertRequestCOROUTINE$, CoroutineImpl);
  initMetadataForCoroutine($invoke$convertResponseCOROUTINE$, CoroutineImpl);
  initMetadataForObject(JsonContentTypeMatcher, 'JsonContentTypeMatcher');
  //endregion
  function get_LOGGER() {
    _init_properties_ContentNegotiation_kt__o183go();
    return LOGGER;
  }
  var LOGGER;
  function get_DefaultCommonIgnoredTypes() {
    _init_properties_ContentNegotiation_kt__o183go();
    return DefaultCommonIgnoredTypes;
  }
  var DefaultCommonIgnoredTypes;
  function get_ExcludedContentTypes() {
    _init_properties_ContentNegotiation_kt__o183go();
    return ExcludedContentTypes;
  }
  var ExcludedContentTypes;
  function get_ContentNegotiation() {
    _init_properties_ContentNegotiation_kt__o183go();
    return ContentNegotiation;
  }
  var ContentNegotiation;
  function ConverterRegistration(converter, contentTypeToSend, contentTypeMatcher) {
    this.p66_1 = converter;
    this.q66_1 = contentTypeToSend;
    this.r66_1 = contentTypeMatcher;
  }
  function defaultMatcher($this, pattern) {
    return new ContentNegotiationConfig$defaultMatcher$1(pattern);
  }
  function ContentNegotiationConfig$defaultMatcher$1($pattern) {
    this.s66_1 = $pattern;
  }
  protoOf(ContentNegotiationConfig$defaultMatcher$1).t66 = function (contentType) {
    return contentType.n48(this.s66_1);
  };
  function ContentNegotiationConfig() {
    this.u66_1 = toMutableSet(plus(get_DefaultIgnoredTypes(), get_DefaultCommonIgnoredTypes()));
    var tmp = this;
    // Inline function 'kotlin.collections.mutableListOf' call
    tmp.v66_1 = ArrayList_init_$Create$();
    this.w66_1 = null;
  }
  protoOf(ContentNegotiationConfig).g4y = function (contentType, converter, configuration) {
    var matcher = contentType.n48(Application_getInstance().t46_1) ? JsonContentTypeMatcher_instance : defaultMatcher(this, contentType);
    this.x66(contentType, converter, matcher, configuration);
  };
  protoOf(ContentNegotiationConfig).x66 = function (contentTypeToSend, converter, contentTypeMatcher, configuration) {
    // Inline function 'kotlin.apply' call
    configuration(converter);
    var registration = new ConverterRegistration(converter, contentTypeToSend, contentTypeMatcher);
    this.v66_1.e1(registration);
  };
  function ContentConverterException(message) {
    Exception_init_$Init$(message, this);
    captureStack(this, ContentConverterException);
  }
  function ContentNegotiationConfig$_init_$ref_1ne3ob() {
    var l = function () {
      return new ContentNegotiationConfig();
    };
    l.callableName = '<init>';
    return l;
  }
  function ContentNegotiation$lambda($this$createClientPlugin) {
    _init_properties_ContentNegotiation_kt__o183go();
    var registrations = $this$createClientPlugin.f5a_1.v66_1;
    var ignoredTypes = $this$createClientPlugin.f5a_1.u66_1;
    $this$createClientPlugin.d5s(ContentNegotiation$lambda$slambda_0(registrations, $this$createClientPlugin, ignoredTypes, null));
    $this$createClientPlugin.q5i(ContentNegotiation$lambda$slambda_2(ignoredTypes, registrations, $this$createClientPlugin, null));
    return Unit_instance;
  }
  function ContentNegotiation$lambda$convertRequest$lambda(it) {
    _init_properties_ContentNegotiation_kt__o183go();
    return toString(it.p66_1);
  }
  function invoke$convertRequest(registrations, $this_createClientPlugin, ignoredTypes, request, body, $completion) {
    var tmp = new $invoke$convertRequestCOROUTINE$(registrations, $this_createClientPlugin, ignoredTypes, request, body, $completion);
    tmp.g9_1 = Unit_instance;
    tmp.h9_1 = null;
    return tmp.m9();
  }
  function invoke$convertResponse(ignoredTypes, registrations, $this_createClientPlugin, requestUrl, info, body, responseContentType, charset, $completion) {
    charset = charset === VOID ? Charsets_getInstance().x3x_1 : charset;
    var tmp = new $invoke$convertResponseCOROUTINE$(ignoredTypes, registrations, $this_createClientPlugin, requestUrl, info, body, responseContentType, charset, $completion);
    tmp.g9_1 = Unit_instance;
    tmp.h9_1 = null;
    return tmp.m9();
  }
  function ContentNegotiation$lambda$slambda($registrations, $this_createClientPlugin, $ignoredTypes, resultContinuation) {
    this.p68_1 = $registrations;
    this.q68_1 = $this_createClientPlugin;
    this.r68_1 = $ignoredTypes;
    CoroutineImpl.call(this, resultContinuation);
  }
  protoOf(ContentNegotiation$lambda$slambda).w68 = function ($this$transformRequestBody, request, body, _unused_var__etf5q3, $completion) {
    var tmp = this.x68($this$transformRequestBody, request, body, _unused_var__etf5q3, $completion);
    tmp.g9_1 = Unit_instance;
    tmp.h9_1 = null;
    return tmp.m9();
  };
  protoOf(ContentNegotiation$lambda$slambda).v5j = function (p1, p2, p3, p4, $completion) {
    var tmp = p1 instanceof TransformRequestBodyContext ? p1 : THROW_CCE();
    var tmp_0 = p2 instanceof HttpRequestBuilder ? p2 : THROW_CCE();
    var tmp_1 = !(p3 == null) ? p3 : THROW_CCE();
    return this.w68(tmp, tmp_0, tmp_1, (p4 == null ? true : p4 instanceof TypeInfo) ? p4 : THROW_CCE(), $completion);
  };
  protoOf(ContentNegotiation$lambda$slambda).m9 = function () {
    var suspendResult = this.g9_1;
    $sm: do
      try {
        var tmp = this.e9_1;
        switch (tmp) {
          case 0:
            this.f9_1 = 2;
            this.e9_1 = 1;
            suspendResult = invoke$convertRequest(this.p68_1, this.q68_1, this.r68_1, this.t68_1, this.u68_1, this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            return suspendResult;
          case 2:
            throw this.h9_1;
        }
      } catch ($p) {
        var e = $p;
        if (this.f9_1 === 2) {
          throw e;
        } else {
          this.e9_1 = this.f9_1;
          this.h9_1 = e;
        }
      }
     while (true);
  };
  protoOf(ContentNegotiation$lambda$slambda).x68 = function ($this$transformRequestBody, request, body, _unused_var__etf5q3, completion) {
    var i = new ContentNegotiation$lambda$slambda(this.p68_1, this.q68_1, this.r68_1, completion);
    i.s68_1 = $this$transformRequestBody;
    i.t68_1 = request;
    i.u68_1 = body;
    i.v68_1 = _unused_var__etf5q3;
    return i;
  };
  function ContentNegotiation$lambda$slambda_0($registrations, $this_createClientPlugin, $ignoredTypes, resultContinuation) {
    var i = new ContentNegotiation$lambda$slambda($registrations, $this_createClientPlugin, $ignoredTypes, resultContinuation);
    var l = function ($this$transformRequestBody, request, body, _unused_var__etf5q3, $completion) {
      return i.w68($this$transformRequestBody, request, body, _unused_var__etf5q3, $completion);
    };
    l.$arity = 4;
    return l;
  }
  function ContentNegotiation$lambda$slambda_1($ignoredTypes, $registrations, $this_createClientPlugin, resultContinuation) {
    this.g69_1 = $ignoredTypes;
    this.h69_1 = $registrations;
    this.i69_1 = $this_createClientPlugin;
    CoroutineImpl.call(this, resultContinuation);
  }
  protoOf(ContentNegotiation$lambda$slambda_1).t5j = function ($this$transformResponseBody, response, body, info, $completion) {
    var tmp = this.u5j($this$transformResponseBody, response, body, info, $completion);
    tmp.g9_1 = Unit_instance;
    tmp.h9_1 = null;
    return tmp.m9();
  };
  protoOf(ContentNegotiation$lambda$slambda_1).v5j = function (p1, p2, p3, p4, $completion) {
    var tmp = p1 instanceof TransformResponseBodyContext ? p1 : THROW_CCE();
    var tmp_0 = p2 instanceof HttpResponse ? p2 : THROW_CCE();
    var tmp_1 = (!(p3 == null) ? isInterface(p3, ByteReadChannel) : false) ? p3 : THROW_CCE();
    return this.t5j(tmp, tmp_0, tmp_1, p4 instanceof TypeInfo ? p4 : THROW_CCE(), $completion);
  };
  protoOf(ContentNegotiation$lambda$slambda_1).m9 = function () {
    var suspendResult = this.g9_1;
    $sm: do
      try {
        var tmp = this.e9_1;
        switch (tmp) {
          case 0:
            this.f9_1 = 2;
            var tmp0_elvis_lhs = contentType(this.k69_1);
            var tmp_0;
            if (tmp0_elvis_lhs == null) {
              return null;
            } else {
              tmp_0 = tmp0_elvis_lhs;
            }

            var contentType_0 = tmp_0;
            var charset = suitableCharset(get_request(this.k69_1).z4c());
            this.e9_1 = 1;
            suspendResult = invoke$convertResponse(this.g69_1, this.h69_1, this.i69_1, get_request(this.k69_1).g29(), this.m69_1, this.l69_1, contentType_0, charset, this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            return suspendResult;
          case 2:
            throw this.h9_1;
        }
      } catch ($p) {
        var e = $p;
        if (this.f9_1 === 2) {
          throw e;
        } else {
          this.e9_1 = this.f9_1;
          this.h9_1 = e;
        }
      }
     while (true);
  };
  protoOf(ContentNegotiation$lambda$slambda_1).u5j = function ($this$transformResponseBody, response, body, info, completion) {
    var i = new ContentNegotiation$lambda$slambda_1(this.g69_1, this.h69_1, this.i69_1, completion);
    i.j69_1 = $this$transformResponseBody;
    i.k69_1 = response;
    i.l69_1 = body;
    i.m69_1 = info;
    return i;
  };
  function ContentNegotiation$lambda$slambda_2($ignoredTypes, $registrations, $this_createClientPlugin, resultContinuation) {
    var i = new ContentNegotiation$lambda$slambda_1($ignoredTypes, $registrations, $this_createClientPlugin, resultContinuation);
    var l = function ($this$transformResponseBody, response, body, info, $completion) {
      return i.t5j($this$transformResponseBody, response, body, info, $completion);
    };
    l.$arity = 4;
    return l;
  }
  function $invoke$convertRequestCOROUTINE$(registrations, $this_createClientPlugin, ignoredTypes, request, body, resultContinuation) {
    CoroutineImpl.call(this, resultContinuation);
    this.g67_1 = registrations;
    this.h67_1 = $this_createClientPlugin;
    this.i67_1 = ignoredTypes;
    this.j67_1 = request;
    this.k67_1 = body;
  }
  protoOf($invoke$convertRequestCOROUTINE$).m9 = function () {
    var suspendResult = this.g9_1;
    $sm: do
      try {
        var tmp = this.e9_1;
        switch (tmp) {
          case 0:
            this.f9_1 = 7;
            var tmp_0;
            if (this.j67_1.n52_1.e3z(get_ExcludedContentTypes())) {
              var excluded = this.j67_1.n52_1.c3z(get_ExcludedContentTypes());
              var tmp0 = this.g67_1;
              var destination = ArrayList_init_$Create$();
              var _iterator__ex2g4s = tmp0.t();
              while (_iterator__ex2g4s.u()) {
                var element = _iterator__ex2g4s.v();
                var tmp$ret$0;
                l$ret$1: do {
                  var tmp_1;
                  if (isInterface(excluded, Collection)) {
                    tmp_1 = excluded.r();
                  } else {
                    tmp_1 = false;
                  }
                  if (tmp_1) {
                    tmp$ret$0 = true;
                    break l$ret$1;
                  }
                  var _iterator__ex2g4s_0 = excluded.t();
                  while (_iterator__ex2g4s_0.u()) {
                    var element_0 = _iterator__ex2g4s_0.v();
                    if (element.q66_1.n48(element_0)) {
                      tmp$ret$0 = false;
                      break l$ret$1;
                    }
                  }
                  tmp$ret$0 = true;
                }
                 while (false);
                if (tmp$ret$0) {
                  destination.e1(element);
                }
              }
              tmp_0 = destination;
            } else {
              tmp_0 = this.g67_1;
            }

            var requestRegistrations = tmp_0;
            var tmp0_elvis_lhs = this.j67_1.k52_1.k41('Accept');
            var acceptHeaders = tmp0_elvis_lhs == null ? emptyList() : tmp0_elvis_lhs;
            var _iterator__ex2g4s_1 = requestRegistrations.t();
            while (_iterator__ex2g4s_1.u()) {
              var element_1 = _iterator__ex2g4s_1.v();
              var tmp$ret$2;
              l$ret$3: do {
                var tmp_2;
                if (isInterface(acceptHeaders, Collection)) {
                  tmp_2 = acceptHeaders.r();
                } else {
                  tmp_2 = false;
                }
                if (tmp_2) {
                  tmp$ret$2 = true;
                  break l$ret$3;
                }
                var _iterator__ex2g4s_2 = acceptHeaders.t();
                while (_iterator__ex2g4s_2.u()) {
                  var element_2 = _iterator__ex2g4s_2.v();
                  if (Companion_getInstance().gr(element_2).n48(element_1.q66_1)) {
                    tmp$ret$2 = false;
                    break l$ret$3;
                  }
                }
                tmp$ret$2 = true;
              }
               while (false);
              if (tmp$ret$2) {
                var qValue = this.h67_1.f5a_1.w66_1;
                var contentTypeToSend = qValue == null ? element_1.q66_1 : element_1.q66_1.l48('q', qValue.toString());
                get_LOGGER().t45('Adding Accept=' + contentTypeToSend.toString() + ' header for ' + this.j67_1.i52_1.toString());
                accept(this.j67_1, contentTypeToSend);
              }
            }

            var tmp_3;
            var tmp_4 = this.k67_1;
            if (tmp_4 instanceof OutgoingContent) {
              tmp_3 = true;
            } else {
              var tmp0_0 = this.i67_1;
              var tmp$ret$4;
              l$ret$5: do {
                var tmp_5;
                if (isInterface(tmp0_0, Collection)) {
                  tmp_5 = tmp0_0.r();
                } else {
                  tmp_5 = false;
                }
                if (tmp_5) {
                  tmp$ret$4 = false;
                  break l$ret$5;
                }
                var _iterator__ex2g4s_3 = tmp0_0.t();
                while (_iterator__ex2g4s_3.u()) {
                  var element_3 = _iterator__ex2g4s_3.v();
                  if (element_3.gb(this.k67_1)) {
                    tmp$ret$4 = true;
                    break l$ret$5;
                  }
                }
                tmp$ret$4 = false;
              }
               while (false);
              tmp_3 = tmp$ret$4;
            }

            if (tmp_3) {
              get_LOGGER().t45('Body type ' + toString(getKClassFromExpression(this.k67_1)) + ' is in ignored types. ' + ('Skipping ContentNegotiation for ' + this.j67_1.i52_1.toString() + '.'));
              return null;
            }

            var tmp_6 = this;
            var tmp0_elvis_lhs_0 = contentType_0(this.j67_1);
            var tmp_7;
            if (tmp0_elvis_lhs_0 == null) {
              this.h67_1;
              get_LOGGER().t45("Request doesn't have Content-Type header. Skipping ContentNegotiation for " + this.j67_1.i52_1.toString() + '.');
              return null;
            } else {
              tmp_7 = tmp0_elvis_lhs_0;
            }

            tmp_6.m67_1 = tmp_7;
            var tmp_8 = this.k67_1;
            if (tmp_8 instanceof Unit) {
              get_LOGGER().t45('Sending empty body for ' + this.j67_1.i52_1.toString());
              this.j67_1.k52_1.r41('Content-Type');
              return EmptyContent_getInstance();
            }

            var tmp_9 = this;
            var tmp0_1 = this.g67_1;
            var destination_0 = ArrayList_init_$Create$();
            var _iterator__ex2g4s_4 = tmp0_1.t();
            while (_iterator__ex2g4s_4.u()) {
              var element_4 = _iterator__ex2g4s_4.v();
              if (element_4.r66_1.t66(this.m67_1)) {
                destination_0.e1(element_4);
              }
            }

            var tmp_10;
            if (!destination_0.r()) {
              tmp_10 = destination_0;
            } else {
              tmp_10 = null;
            }

            var tmp1_elvis_lhs = tmp_10;
            var tmp_11;
            if (tmp1_elvis_lhs == null) {
              this.h67_1;
              get_LOGGER().t45('None of the registered converters match request Content-Type=' + this.m67_1.toString() + '. ' + ('Skipping ContentNegotiation for ' + this.j67_1.i52_1.toString() + '.'));
              return null;
            } else {
              tmp_11 = tmp1_elvis_lhs;
            }

            tmp_9.l67_1 = tmp_11;
            if (this.j67_1.l5u() == null) {
              get_LOGGER().t45('Request has unknown body type. Skipping ContentNegotiation for ' + this.j67_1.i52_1.toString() + '.');
              return null;
            }

            this.j67_1.k52_1.r41('Content-Type');
            this.q67_1 = this.l67_1;
            this.e9_1 = 1;
            continue $sm;
          case 1:
            this.p67_1 = this.q67_1.t();
            this.e9_1 = 2;
            continue $sm;
          case 2:
            if (!this.p67_1.u()) {
              this.e9_1 = 5;
              continue $sm;
            }

            var element_5 = this.p67_1.v();
            this.o67_1 = element_5;
            this.e9_1 = 3;
            var tmp0_elvis_lhs_1 = charset(this.m67_1);
            var tmp_12 = tmp0_elvis_lhs_1 == null ? Charsets_getInstance().x3x_1 : tmp0_elvis_lhs_1;
            var tmp_13 = ensureNotNull(this.j67_1.l5u());
            var this_0 = this.k67_1;
            var tmp_14;
            if (!equals(this_0, NullBody_instance)) {
              tmp_14 = this_0;
            } else {
              tmp_14 = null;
            }

            suspendResult = this.o67_1.p66_1.n69(this.m67_1, tmp_12, tmp_13, tmp_14, this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 3:
            var result = suspendResult;
            if (!(result == null)) {
              get_LOGGER().t45('Converted request body using ' + toString(this.o67_1.p66_1) + ' for ' + this.j67_1.i52_1.toString());
            }

            var result_0 = result;
            if (!(result_0 == null)) {
              this.n67_1 = result_0;
              this.e9_1 = 6;
              continue $sm;
            } else {
              this.e9_1 = 4;
              continue $sm;
            }

          case 4:
            this.e9_1 = 2;
            continue $sm;
          case 5:
            this.n67_1 = null;
            if (false) {
              this.e9_1 = 1;
              continue $sm;
            }

            this.e9_1 = 6;
            continue $sm;
          case 6:
            var tmp2_elvis_lhs = this.n67_1;
            var tmp_15;
            if (tmp2_elvis_lhs == null) {
              var tmp_16 = "Can't convert " + toString(this.k67_1) + ' with contentType ' + this.m67_1.toString() + ' using converters ';
              throw new ContentConverterException(tmp_16 + joinToString(this.l67_1, VOID, VOID, VOID, VOID, VOID, ContentNegotiation$lambda$convertRequest$lambda));
            } else {
              tmp_15 = tmp2_elvis_lhs;
            }

            var serializedContent = tmp_15;
            return serializedContent;
          case 7:
            throw this.h9_1;
        }
      } catch ($p) {
        var e = $p;
        if (this.f9_1 === 7) {
          throw e;
        } else {
          this.e9_1 = this.f9_1;
          this.h9_1 = e;
        }
      }
     while (true);
  };
  function $invoke$convertResponseCOROUTINE$(ignoredTypes, registrations, $this_createClientPlugin, requestUrl, info, body, responseContentType, charset, resultContinuation) {
    CoroutineImpl.call(this, resultContinuation);
    this.z67_1 = ignoredTypes;
    this.a68_1 = registrations;
    this.b68_1 = $this_createClientPlugin;
    this.c68_1 = requestUrl;
    this.d68_1 = info;
    this.e68_1 = body;
    this.f68_1 = responseContentType;
    this.g68_1 = charset;
  }
  protoOf($invoke$convertResponseCOROUTINE$).m9 = function () {
    var suspendResult = this.g9_1;
    $sm: do
      try {
        var tmp = this.e9_1;
        switch (tmp) {
          case 0:
            this.f9_1 = 2;
            var tmp_0 = this.e68_1;
            if (!isInterface(tmp_0, ByteReadChannel)) {
              get_LOGGER().t45('Response body is already transformed. Skipping ContentNegotiation for ' + this.c68_1.toString() + '.');
              return null;
            }

            if (this.z67_1.m1(this.d68_1.m45_1)) {
              get_LOGGER().t45('Response body type ' + toString(this.d68_1.m45_1) + ' is in ignored types. ' + ('Skipping ContentNegotiation for ' + this.c68_1.toString() + '.'));
              return null;
            }

            var tmp0 = this.a68_1;
            var destination = ArrayList_init_$Create$();
            var _iterator__ex2g4s = tmp0.t();
            while (_iterator__ex2g4s.u()) {
              var element = _iterator__ex2g4s.v();
              if (element.r66_1.t66(this.f68_1)) {
                destination.e1(element);
              }
            }

            var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10));
            var _iterator__ex2g4s_0 = destination.t();
            while (_iterator__ex2g4s_0.u()) {
              var item = _iterator__ex2g4s_0.v();
              destination_0.e1(item.p66_1);
            }

            var tmp_1;
            if (!destination_0.r()) {
              tmp_1 = destination_0;
            } else {
              tmp_1 = null;
            }

            var tmp0_elvis_lhs = tmp_1;
            var tmp_2;
            if (tmp0_elvis_lhs == null) {
              this.b68_1;
              get_LOGGER().t45('None of the registered converters match response with Content-Type=' + this.f68_1.toString() + '. ' + ('Skipping ContentNegotiation for ' + this.c68_1.toString() + '.'));
              return null;
            } else {
              tmp_2 = tmp0_elvis_lhs;
            }

            var suitableConverters = tmp_2;
            this.e9_1 = 1;
            suspendResult = deserialize(suitableConverters, this.e68_1, this.d68_1, this.g68_1, this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            var result = suspendResult;
            if (!isInterface(result, ByteReadChannel)) {
              get_LOGGER().t45('Response body was converted to ' + toString(getKClassFromExpression(result)) + ' for ' + this.c68_1.toString() + '.');
            }

            return result;
          case 2:
            throw this.h9_1;
        }
      } catch ($p) {
        var e = $p;
        if (this.f9_1 === 2) {
          throw e;
        } else {
          this.e9_1 = this.f9_1;
          this.h9_1 = e;
        }
      }
     while (true);
  };
  var properties_initialized_ContentNegotiation_kt_1ayduy;
  function _init_properties_ContentNegotiation_kt__o183go() {
    if (!properties_initialized_ContentNegotiation_kt_1ayduy) {
      properties_initialized_ContentNegotiation_kt_1ayduy = true;
      LOGGER = KtorSimpleLogger('io.ktor.client.plugins.contentnegotiation.ContentNegotiation');
      DefaultCommonIgnoredTypes = setOf([PrimitiveClasses_getInstance().lc(), PrimitiveClasses_getInstance().hc(), getKClass(HttpStatusCode), getKClass(ByteReadChannel), getKClass(OutgoingContent), getKClass(ClientSSESession), getKClass(ClientSSESessionWithDeserialization)]);
      // Inline function 'io.ktor.util.AttributeKey' call
      var name = 'ExcludedContentTypesAttr';
      // Inline function 'io.ktor.util.reflect.typeInfo' call
      var tmp = getKClass(KtList);
      // Inline function 'io.ktor.util.reflect.typeOfOrNull' call
      var tmp_0;
      try {
        tmp_0 = createKType(getKClass(KtList), arrayOf([createInvariantKTypeProjection(createKType(getKClass(ContentType), arrayOf([]), false))]), false);
      } catch ($p) {
        var tmp_1;
        if ($p instanceof Error) {
          var _unused_var__etf5q3 = $p;
          tmp_1 = null;
        } else {
          throw $p;
        }
        tmp_0 = tmp_1;
      }
      var tmp$ret$2 = tmp_0;
      var tmp$ret$1 = new TypeInfo(tmp, tmp$ret$2);
      ExcludedContentTypes = new AttributeKey(name, tmp$ret$1);
      var tmp_2 = ContentNegotiationConfig$_init_$ref_1ne3ob();
      ContentNegotiation = createClientPlugin('ContentNegotiation', tmp_2, ContentNegotiation$lambda);
    }
  }
  function JsonContentTypeMatcher() {
  }
  protoOf(JsonContentTypeMatcher).t66 = function (contentType) {
    if (contentType.n48(Application_getInstance().t46_1)) {
      return true;
    }
    var value = contentType.m48().toString();
    return Application_getInstance().n47(value) && endsWith(value, '+json', true);
  };
  var JsonContentTypeMatcher_instance;
  function JsonContentTypeMatcher_getInstance() {
    return JsonContentTypeMatcher_instance;
  }
  function get_DefaultIgnoredTypes() {
    _init_properties_DefaultIgnoredTypes_web_kt__6eddjw();
    return DefaultIgnoredTypes;
  }
  var DefaultIgnoredTypes;
  var properties_initialized_DefaultIgnoredTypes_web_kt_23uj7m;
  function _init_properties_DefaultIgnoredTypes_web_kt__6eddjw() {
    if (!properties_initialized_DefaultIgnoredTypes_web_kt_23uj7m) {
      properties_initialized_DefaultIgnoredTypes_web_kt_23uj7m = true;
      // Inline function 'kotlin.collections.mutableSetOf' call
      DefaultIgnoredTypes = LinkedHashSet_init_$Create$();
    }
  }
  //region block: post-declaration
  protoOf(ContentNegotiationConfig).h4y = register$default;
  //endregion
  //region block: init
  JsonContentTypeMatcher_instance = new JsonContentTypeMatcher();
  //endregion
  //region block: exports
  _.$_$ = _.$_$ || {};
  _.$_$.a = get_ContentNegotiation;
  //endregion
  return _;
}(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./ktor-ktor-http.js'), require('./ktor-ktor-serialization.js'), require('./ktor-ktor-io.js'), require('./ktor-ktor-client-core.js'), require('./ktor-ktor-utils.js')));

//# sourceMappingURL=ktor-ktor-client-content-negotiation.js.map
