(function(root, factory) {
  if (typeof define === 'function' && define.amd) 
    define(['exports', 'kotlin', 'UstadMobile-lib-database', 'UstadMobile-lib-util', 'UstadMobile-lib-database-entities', 'klock-root-klock-js-legacy', 'Kodein-DI-kodein-di', 'kotlinx-serialization-kotlinx-serialization-core-js-legacy', 'kotlinx-coroutines-core', 'door-door-runtime', 'kotlinx-serialization-kotlinx-serialization-json-js-legacy', 'Napier-napier-js-legacy', 'ktor-ktor-client-core-js-legacy', 'ktor-ktor-http-js-legacy', 'xmlpullparserkmp-js-legacy', 'ktor-ktor-client-json-js-legacy', 'kotlin-extensions', 'moment-timezone', 'ktor-ktor-client-serialization-js-legacy', 'asmcrypto.js'], factory);
  else if (typeof exports === 'object') 
    factory(module.exports, require('kotlin'), require('UstadMobile-lib-database'), require('UstadMobile-lib-util'), require('UstadMobile-lib-database-entities'), require('klock-root-klock-js-legacy'), require('Kodein-DI-kodein-di'), require('kotlinx-serialization-kotlinx-serialization-core-js-legacy'), require('kotlinx-coroutines-core'), require('door-door-runtime'), require('kotlinx-serialization-kotlinx-serialization-json-js-legacy'), require('Napier-napier-js-legacy'), require('ktor-ktor-client-core-js-legacy'), require('ktor-ktor-http-js-legacy'), require('xmlpullparserkmp-js-legacy'), require('ktor-ktor-client-json-js-legacy'), require('kotlin-extensions'), require('moment-timezone'), require('ktor-ktor-client-serialization-js-legacy'), require('asmcrypto.js'));
  else {
    if (typeof kotlin === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'kotlin' was not found. Please, check whether 'kotlin' is loaded prior to 'UstadMobile-core'.");
    }
    if (typeof this['UstadMobile-lib-database'] === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'UstadMobile-lib-database' was not found. Please, check whether 'UstadMobile-lib-database' is loaded prior to 'UstadMobile-core'.");
    }
    if (typeof this['UstadMobile-lib-util'] === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'UstadMobile-lib-util' was not found. Please, check whether 'UstadMobile-lib-util' is loaded prior to 'UstadMobile-core'.");
    }
    if (typeof this['UstadMobile-lib-database-entities'] === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'UstadMobile-lib-database-entities' was not found. Please, check whether 'UstadMobile-lib-database-entities' is loaded prior to 'UstadMobile-core'.");
    }
    if (typeof this['klock-root-klock-js-legacy'] === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'klock-root-klock-js-legacy' was not found. Please, check whether 'klock-root-klock-js-legacy' is loaded prior to 'UstadMobile-core'.");
    }
    if (typeof this['Kodein-DI-kodein-di'] === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'Kodein-DI-kodein-di' was not found. Please, check whether 'Kodein-DI-kodein-di' is loaded prior to 'UstadMobile-core'.");
    }
    if (typeof this['kotlinx-serialization-kotlinx-serialization-core-js-legacy'] === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'kotlinx-serialization-kotlinx-serialization-core-js-legacy' was not found. Please, check whether 'kotlinx-serialization-kotlinx-serialization-core-js-legacy' is loaded prior to 'UstadMobile-core'.");
    }
    if (typeof this['kotlinx-coroutines-core'] === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'kotlinx-coroutines-core' was not found. Please, check whether 'kotlinx-coroutines-core' is loaded prior to 'UstadMobile-core'.");
    }
    if (typeof this['door-door-runtime'] === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'door-door-runtime' was not found. Please, check whether 'door-door-runtime' is loaded prior to 'UstadMobile-core'.");
    }
    if (typeof this['kotlinx-serialization-kotlinx-serialization-json-js-legacy'] === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'kotlinx-serialization-kotlinx-serialization-json-js-legacy' was not found. Please, check whether 'kotlinx-serialization-kotlinx-serialization-json-js-legacy' is loaded prior to 'UstadMobile-core'.");
    }
    if (typeof this['Napier-napier-js-legacy'] === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'Napier-napier-js-legacy' was not found. Please, check whether 'Napier-napier-js-legacy' is loaded prior to 'UstadMobile-core'.");
    }
    if (typeof this['ktor-ktor-client-core-js-legacy'] === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'ktor-ktor-client-core-js-legacy' was not found. Please, check whether 'ktor-ktor-client-core-js-legacy' is loaded prior to 'UstadMobile-core'.");
    }
    if (typeof this['ktor-ktor-http-js-legacy'] === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'ktor-ktor-http-js-legacy' was not found. Please, check whether 'ktor-ktor-http-js-legacy' is loaded prior to 'UstadMobile-core'.");
    }
    if (false) {

    }
    if (typeof this['xmlpullparserkmp-js-legacy'] === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'xmlpullparserkmp-js-legacy' was not found. Please, check whether 'xmlpullparserkmp-js-legacy' is loaded prior to 'UstadMobile-core'.");
    }
    if (typeof this['ktor-ktor-client-json-js-legacy'] === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'ktor-ktor-client-json-js-legacy' was not found. Please, check whether 'ktor-ktor-client-json-js-legacy' is loaded prior to 'UstadMobile-core'.");
    }
    if (typeof this['kotlin-extensions'] === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'kotlin-extensions' was not found. Please, check whether 'kotlin-extensions' is loaded prior to 'UstadMobile-core'.");
    }
    if (typeof moment === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'moment-timezone' was not found. Please, check whether 'moment-timezone' is loaded prior to 'UstadMobile-core'.");
    }
    if (typeof this['ktor-ktor-client-serialization-js-legacy'] === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'ktor-ktor-client-serialization-js-legacy' was not found. Please, check whether 'ktor-ktor-client-serialization-js-legacy' is loaded prior to 'UstadMobile-core'.");
    }
    if (typeof asmcrypto === 'undefined') {
      throw new Error("Error loading module 'UstadMobile-core'. Its dependency 'asmcrypto.js' was not found. Please, check whether 'asmcrypto.js' is loaded prior to 'UstadMobile-core'.");
    }
    root['UstadMobile-core'] = factory(typeof this['UstadMobile-core'] === 'undefined' ? {} : this['UstadMobile-core'], kotlin, this['UstadMobile-lib-database'], this['UstadMobile-lib-util'], this['UstadMobile-lib-database-entities'], this['klock-root-klock-js-legacy'], this['Kodein-DI-kodein-di'], this['kotlinx-serialization-kotlinx-serialization-core-js-legacy'], this['kotlinx-coroutines-core'], this['door-door-runtime'], this['kotlinx-serialization-kotlinx-serialization-json-js-legacy'], this['Napier-napier-js-legacy'], this['ktor-ktor-client-core-js-legacy'], this['ktor-ktor-http-js-legacy'], this['xmlpullparserkmp-js-legacy'], this['ktor-ktor-client-json-js-legacy'], this['kotlin-extensions'], moment, this['ktor-ktor-client-serialization-js-legacy'], asmcrypto);
  }
}(this, function(_, Kotlin, $module$UstadMobile_lib_database, $module$UstadMobile_lib_util, $module$UstadMobile_lib_database_entities, $module$klock_root_klock_js_legacy, $module$Kodein_DI_kodein_di, $module$kotlinx_serialization_kotlinx_serialization_core_js_legacy, $module$kotlinx_coroutines_core, $module$door_door_runtime, $module$kotlinx_serialization_kotlinx_serialization_json_js_legacy, $module$Napier_napier_js_legacy, $module$ktor_ktor_client_core_js_legacy, $module$ktor_ktor_http_js_legacy, $module$xmlpullparserkmp_js_legacy, $module$ktor_ktor_client_json_js_legacy, $module$kotlin_extensions, $module$moment_timezone, $module$ktor_ktor_client_serialization_js_legacy, $module$asmcrypto_js) {
  'use strict';
  var $$importsForInline$$ = _.$$importsForInline$$ || (_.$$importsForInline$$ = {});
  var to = Kotlin.kotlin.to_ujzrz7$;
  var mapOf = Kotlin.kotlin.collections.mapOf_qfcya0$;
  var toMap = Kotlin.kotlin.collections.toMap_abgq59$;
  var Kind_OBJECT = Kotlin.Kind.OBJECT;
  var Kind_CLASS = Kotlin.Kind.CLASS;
  var IllegalStateException = Kotlin.kotlin.IllegalStateException;
  var PropertyMetadata = Kotlin.PropertyMetadata;
  var COROUTINE_SUSPENDED = Kotlin.kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED;
  var CoroutineImpl = Kotlin.kotlin.coroutines.CoroutineImpl;
  var IllegalStateException_init = Kotlin.kotlin.IllegalStateException_init_pdl1vj$;
  var contentEquals = Kotlin.arrayEquals;
  var L0 = Kotlin.Long.ZERO;
  var PersonAuthDao = $module$UstadMobile_lib_database.com.ustadmobile.core.db.dao.PersonAuthDao;
  var startsWith = Kotlin.kotlin.text.startsWith_7epoxm$;
  var equals = Kotlin.equals;
  var authenticateEncryptedPassword = $module$UstadMobile_lib_util.com.ustadmobile.lib.util.authenticateEncryptedPassword_puj7f4$;
  var PersonAuth2 = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.PersonAuth2;
  var DateTime = $module$klock_root_klock_js_legacy.com.soywiz.klock.DateTime;
  var getKClass = Kotlin.getKClass;
  var createKType = Kotlin.createKType;
  var UmAppDatabase = $module$UstadMobile_lib_database.com.ustadmobile.core.db.UmAppDatabase;
  var DIAware = $module$Kodein_DI_kodein_di.org.kodein.di.DIAware;
  var On = $module$Kodein_DI_kodein_di.org.kodein.di.On_e2mfxv$;
  var DIContext = $module$Kodein_DI_kodein_di.org.kodein.di.DIContext;
  var typeToken = $module$Kodein_DI_kodein_di.$$importsForInline$$['Kodein-Type-kodein-type'].org.kodein.type.typeToken_saj79j$;
  var TypeToken = $module$Kodein_DI_kodein_di.$$importsForInline$$['Kodein-Type-kodein-type'].org.kodein.type.TypeToken;
  var throwCCE = Kotlin.throwCCE;
  var Instance = $module$Kodein_DI_kodein_di.org.kodein.di.Instance_l95o76$;
  var Collection = Kotlin.kotlin.collections.Collection;
  var NullableSerializer = $module$kotlinx_serialization_kotlinx_serialization_core_js_legacy.kotlinx.serialization.internal.NullableSerializer;
  var PluginGeneratedSerialDescriptor = $module$kotlinx_serialization_kotlinx_serialization_core_js_legacy.kotlinx.serialization.internal.PluginGeneratedSerialDescriptor;
  var Person = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.Person;
  var UnknownFieldException = $module$kotlinx_serialization_kotlinx_serialization_core_js_legacy.kotlinx.serialization.UnknownFieldException;
  var internal = $module$kotlinx_serialization_kotlinx_serialization_core_js_legacy.kotlinx.serialization.internal;
  var GeneratedSerializer = $module$kotlinx_serialization_kotlinx_serialization_core_js_legacy.kotlinx.serialization.internal.GeneratedSerializer;
  var coroutines = $module$kotlinx_coroutines_core.kotlinx.coroutines;
  var systemTimeInMillis = $module$door_door_runtime.com.ustadmobile.door.util.systemTimeInMillis;
  var Unit = Kotlin.kotlin.Unit;
  var launch = $module$kotlinx_coroutines_core.kotlinx.coroutines.launch_s496o7$;
  var SyncListener = $module$door_door_runtime.com.ustadmobile.door.SyncListener;
  var ArrayList_init = Kotlin.kotlin.collections.ArrayList_init_287e2$;
  var collectionSizeOrDefault = Kotlin.kotlin.collections.collectionSizeOrDefault_ba2ldo$;
  var ArrayList_init_0 = Kotlin.kotlin.collections.ArrayList_init_ww73n8$;
  var get_jsonObject = $module$kotlinx_serialization_kotlinx_serialization_json_js_legacy.kotlinx.serialization.json.get_jsonObject_u3sd3g$;
  var get_jsonPrimitive = $module$kotlinx_serialization_kotlinx_serialization_json_js_legacy.kotlinx.serialization.json.get_jsonPrimitive_u3sd3g$;
  var get_long = $module$kotlinx_serialization_kotlinx_serialization_json_js_legacy.kotlinx.serialization.json.get_long_59esu7$;
  var napier = $module$Napier_napier_js_legacy.io.github.aakira.napier;
  var withDoorTransactionAsync = $module$door_door_runtime.com.ustadmobile.door.ext.withDoorTransactionAsync_es2jyg$;
  var IncomingReplicationListener = $module$door_door_runtime.com.ustadmobile.door.IncomingReplicationListener;
  var MissingFieldException_init = $module$kotlinx_serialization_kotlinx_serialization_core_js_legacy.kotlinx.serialization.MissingFieldException_init_61zpoe$;
  var StandardScopeRegistry = $module$Kodein_DI_kodein_di.org.kodein.di.bindings.StandardScopeRegistry;
  var Scope = $module$Kodein_DI_kodein_di.org.kodein.di.bindings.Scope;
  var LinkedHashMap_init = Kotlin.kotlin.collections.LinkedHashMap_init_q3lmfv$;
  var PersonWithAccount = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.PersonWithAccount;
  var PersonParentJoin = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.PersonParentJoin;
  var UserSession = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.UserSession;
  var get_direct = $module$Kodein_DI_kodein_di.org.kodein.di.get_direct_utb36t$;
  var flatten = Kotlin.kotlin.collections.flatten_u0ad8z$;
  var DoorObserver = $module$door_door_runtime.com.ustadmobile.door.DoorObserver;
  var DoorMediatorLiveData = $module$door_door_runtime.com.ustadmobile.door.DoorMediatorLiveData;
  var removeSuffix = Kotlin.kotlin.text.removeSuffix_gsj5wt$;
  var url = $module$ktor_ktor_client_core_js_legacy.io.ktor.client.request.url_g8iu3v$;
  var ContentType = $module$ktor_ktor_http_js_legacy.io.ktor.http.ContentType;
  var contentType = $module$ktor_ktor_http_js_legacy.io.ktor.http.contentType_41kwpe$;
  var HttpStatement = $module$ktor_ktor_client_core_js_legacy.io.ktor.client.statement.HttpStatement;
  var Pair = Kotlin.kotlin.Pair;
  var Exception_init = Kotlin.kotlin.Exception_init_pdl1vj$;
  var withContext = $module$kotlinx_coroutines_core.kotlinx.coroutines.withContext_i5cbzn$;
  var L2000 = Kotlin.Long.fromInt(2000);
  var onRepoWithFallbackToDb = $module$door_door_runtime.com.ustadmobile.door.ext.onRepoWithFallbackToDb_5ee74f$;
  var DoorDatabaseRepository = $module$door_door_runtime.com.ustadmobile.door.DoorDatabaseRepository;
  var toHexString = $module$door_door_runtime.com.ustadmobile.door.ext.toHexString_964n91$;
  var doorMainDispatcher = $module$door_door_runtime.com.ustadmobile.door.doorMainDispatcher;
  var addIncomingReplicationListener = $module$door_door_runtime.com.ustadmobile.door.ext.addIncomingReplicationListener_nim0m8$;
  var removeIncomingReplicationListener = $module$door_door_runtime.com.ustadmobile.door.ext.removeIncomingReplicationListener_nim0m8$;
  var Json = $module$kotlinx_serialization_kotlinx_serialization_json_js_legacy.kotlinx.serialization.json.Json;
  var kotlin_js_internal_StringCompanionObject = Kotlin.kotlin.js.internal.StringCompanionObject;
  var serializer = $module$kotlinx_serialization_kotlinx_serialization_core_js_legacy.kotlinx.serialization.builtins.serializer_6eet4j$;
  var ListSerializer = $module$kotlinx_serialization_kotlinx_serialization_core_js_legacy.kotlinx.serialization.builtins.ListSerializer_swdriu$;
  var toSet = Kotlin.kotlin.collections.toSet_7wnvza$;
  var toList = Kotlin.kotlin.collections.toList_7wnvza$;
  var get_longOrNull = $module$kotlinx_serialization_kotlinx_serialization_json_js_legacy.kotlinx.serialization.json.get_longOrNull_59esu7$;
  var get_intOrNull = $module$kotlinx_serialization_kotlinx_serialization_json_js_legacy.kotlinx.serialization.json.get_intOrNull_59esu7$;
  var parameter = $module$ktor_ktor_client_core_js_legacy.io.ktor.client.request.parameter_xadl6p$;
  var header = $module$ktor_ktor_client_core_js_legacy.io.ktor.client.request.header_xadl6p$;
  var set_expectSuccess = $module$ktor_ktor_client_core_js_legacy.io.ktor.client.features.set_expectSuccess_wpsvw2$;
  var HttpResponse = $module$ktor_ktor_client_core_js_legacy.io.ktor.client.statement.HttpResponse;
  var HttpStatusCode = $module$ktor_ktor_http_js_legacy.io.ktor.http.HttpStatusCode;
  var UmAccount = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.UmAccount;
  var doorNodeAndVersionHeaders = $module$door_door_runtime.com.ustadmobile.door.ext.doorNodeAndVersionHeaders_rq8txc$;
  var Site = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.Site;
  var DoorMutableLiveData_init = $module$door_door_runtime.com.ustadmobile.door.DoorMutableLiveData_init_287e2$;
  var HttpClient = $module$ktor_ktor_client_core_js_legacy.io.ktor.client.HttpClient;
  var concurrentSafeListOf = $module$door_door_runtime.com.ustadmobile.door.ext.concurrentSafeListOf_i5x0yv$;

  var PrimitiveClasses$stringClass = Kotlin.kotlin.reflect.js.internal.PrimitiveClasses.stringClass;
  var addAll = Kotlin.kotlin.collections.addAll_ipc267$;
  var reflect = $module$ktor_ktor_client_core_js_legacy.$$importsForInline$$['ktor-ktor-utils-js-legacy'].io.ktor.util.reflect;
  var typeInfoImpl = $module$ktor_ktor_client_core_js_legacy.$$importsForInline$$['ktor-ktor-utils-js-legacy'].io.ktor.util.reflect.typeInfoImpl_1lvkm8$;
  var utils = $module$ktor_ktor_client_core_js_legacy.io.ktor.client.utils;
  var url_0 = $module$ktor_ktor_client_core_js_legacy.io.ktor.client.request.url_3rzbk2$;
  var HttpMethod = $module$ktor_ktor_client_core_js_legacy.$$importsForInline$$['ktor-ktor-http-js-legacy'].io.ktor.http.HttpMethod;
  var HttpRequestBuilder_init = $module$ktor_ktor_client_core_js_legacy.io.ktor.client.request.HttpRequestBuilder;
  var complete = $module$ktor_ktor_client_core_js_legacy.io.ktor.client.statement.complete_abn2de$;
  var chunked = Kotlin.kotlin.collections.chunked_ba2ldo$;
  var toLong = Kotlin.kotlin.text.toLong_pdl1vz$;
  var IllegalArgumentException_init = Kotlin.kotlin.IllegalArgumentException_init_pdl1vj$;
  var contains = Kotlin.kotlin.text.contains_li3zpu$;
  var ContentJobItem = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ContentJobItem;
  var emptyList = Kotlin.kotlin.collections.emptyList_287e2$;
  var Kind_INTERFACE = Kotlin.Kind.INTERFACE;
  var NotImplementedError_init = Kotlin.kotlin.NotImplementedError;
  var removePrefix = Kotlin.kotlin.text.removePrefix_gsj5wt$;
  var endsWith = Kotlin.kotlin.text.endsWith_7epoxm$;
  var listOf = Kotlin.kotlin.collections.listOf_i5x0yv$;
  var ensureNotNull = Kotlin.ensureNotNull;
  var contains_0 = Kotlin.kotlin.collections.contains_mjy6jw$;
  var xmlpullparserkmp = $module$xmlpullparserkmp_js_legacy.com.ustadmobile.xmlpullparserkmp;
  var equals_0 = Kotlin.kotlin.text.equals_igcy3c$;
  var asSequence = Kotlin.kotlin.collections.asSequence_7wnvza$;
  var map = Kotlin.kotlin.sequences.map_z5avom$;
  var Regex_init = Kotlin.kotlin.text.Regex_init_61zpoe$;
  var take = Kotlin.kotlin.collections.take_ba2ldo$;
  var copyToArray = Kotlin.kotlin.collections.copyToArray;
  var StringBuilder_init = Kotlin.kotlin.text.StringBuilder_init;
  var lastIndexOf = Kotlin.kotlin.text.lastIndexOf_8eortd$;
  var HashMap_init = Kotlin.kotlin.collections.HashMap_init_q3lmfv$;
  var Map = Kotlin.kotlin.collections.Map;
  var throwUPAE = Kotlin.throwUPAE;
  var parseRangeRequestHeader = $module$UstadMobile_lib_util.com.ustadmobile.lib.util.parseRangeRequestHeader_4wgjuj$;
  var toMap_0 = Kotlin.kotlin.collections.toMap_6hr0sd$;
  var CompletableDeferred = $module$kotlinx_coroutines_core.kotlinx.coroutines.CompletableDeferred_xptg6w$;
  var Json_0 = $module$kotlinx_serialization_kotlinx_serialization_json_js_legacy.kotlinx.serialization.json.Json_x26noe$;
  var Exception_init_0 = Kotlin.kotlin.Exception_init;
  var getValue = Kotlin.kotlin.collections.getValue_t9ocha$;
  var mutableListOf = Kotlin.kotlin.collections.mutableListOf_i5x0yv$;
  var ContainerEntryFile = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ContainerEntryFile;
  var ArrayListSerializer = $module$kotlinx_serialization_kotlinx_serialization_core_js_legacy.kotlinx.serialization.internal.ArrayListSerializer;
  var hashCode = Kotlin.hashCode;
  var substringBefore = Kotlin.kotlin.text.substringBefore_j4ogox$;
  var substringAfter = Kotlin.kotlin.text.substringAfter_j4ogox$;
  var Url = $module$ktor_ktor_http_js_legacy.io.ktor.http.Url_61zpoe$;
  var URLProtocol = $module$ktor_ktor_http_js_legacy.io.ktor.http.URLProtocol;
  var URLBuilder = $module$ktor_ktor_http_js_legacy.io.ktor.http.URLBuilder;
  var trimIndent = Kotlin.kotlin.text.trimIndent_pdl1vz$;
  var toString = Kotlin.toString;
  var numberToInt = Kotlin.numberToInt;
  var takeFrom = $module$ktor_ktor_http_js_legacy.io.ktor.http.takeFrom_jl1sg7$;
  var ContentEntryWithLanguage = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ContentEntryWithLanguage;
  var toBoolean = Kotlin.kotlin.text.toBoolean_5cw0du$;
  var mapOf_0 = Kotlin.kotlin.collections.mapOf_x2b85n$;
  var listOf_0 = Kotlin.kotlin.collections.listOf_mh5how$;
  var VerbEntity = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.VerbEntity;
  var CancellationException_init = Kotlin.kotlin.coroutines.cancellation.CancellationException_init_pdl1vj$;
  var CancellationException = Kotlin.kotlin.coroutines.cancellation.CancellationException;
  var DoorUri = $module$door_door_runtime.com.ustadmobile.door.DoorUri;
  var Mutex = $module$kotlinx_coroutines_core.kotlinx.coroutines.sync.Mutex_6taknv$;
  var lazy = Kotlin.kotlin.lazy_klfg04$;
  var get_doorIdentityHashCode = $module$door_door_runtime.com.ustadmobile.door.ext.get_doorIdentityHashCode_s8jyvk$;
  var stackTraceToString = Kotlin.kotlin.stackTraceToString_dbl4o4$;
  var Exception = Kotlin.kotlin.Exception;
  var produce = $module$kotlinx_coroutines_core.kotlinx.coroutines.channels.produce_f6xzli$;
  var toMutableMap = Kotlin.kotlin.collections.toMutableMap_abgq59$;
  var getSystemTimeInMillis = $module$UstadMobile_lib_util.com.ustadmobile.lib.util.getSystemTimeInMillis;
  var ContentEntryParentChildJoin = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ContentEntryParentChildJoin;
  var async = $module$kotlinx_coroutines_core.kotlinx.coroutines.async_pda6u4$;
  var printStackTrace = Kotlin.kotlin.printStackTrace_dbl4o4$;
  var L1000 = Kotlin.Long.fromInt(1000);
  var delay = $module$kotlinx_coroutines_core.kotlinx.coroutines.delay_s8cxhz$;
  var toProgressUpdate = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.toProgressUpdate_oht92m$;
  var coroutineScope = $module$kotlinx_coroutines_core.kotlinx.coroutines.coroutineScope_awg8ri$;
  var cancelChildren = $module$kotlinx_coroutines_core.kotlinx.coroutines.cancelChildren_xz8be$;
  var cancelAndJoin = $module$kotlinx_coroutines_core.kotlinx.coroutines.cancelAndJoin_5dx9u$;
  var first = Kotlin.kotlin.collections.first_2p1efm$;
  var dbType = $module$door_door_runtime.com.ustadmobile.door.ext.dbType_igmkyi$;
  var Channel = $module$kotlinx_coroutines_core.kotlinx.coroutines.channels.Channel_lsve6m$;
  var L500 = Kotlin.Long.fromInt(500);
  var getCallableRef = Kotlin.getCallableRef;
  var JsMath = Math;
  var joinToString = Kotlin.kotlin.collections.joinToString_fmv235$;
  var checkCountOverflow = Kotlin.kotlin.collections.checkCountOverflow_za3lpa$;
  var randomUuid = $module$door_door_runtime.com.ustadmobile.door.util.randomUuid;
  var toMutableList = Kotlin.kotlin.collections.toMutableList_4c7yge$;
  var removeAll = Kotlin.kotlin.collections.removeAll_qafx1e$;
  var replace = Kotlin.kotlin.text.replace_680rmw$;
  var DoorMutableLiveData_init_0 = $module$door_door_runtime.com.ustadmobile.door.DoorMutableLiveData_init_mh5how$;
  var Clazz$Companion$CLAZZ_FEATURE_ATTENDANCE = Kotlin.Long.ONE;
  var Clazz$Companion$CLAZZ_FEATURE_CLAZZ_ASSIGNMENT = Kotlin.Long.fromInt(8);
  var Chat_init = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.Chat_init_ivxn3r$;
  var ChatMember_init = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ChatMember_init_3pjtqy$;
  var Message_init = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.Message_init_65ss6k$;
  var ChatWithLatestMessageAndCount = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ChatWithLatestMessageAndCount;
  var Chat = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.Chat;
  var ClazzAssignmentWithCourseBlock = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ClazzAssignmentWithCourseBlock;
  var ClazzWithSchool = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ClazzWithSchool;
  var CourseAssignmentSubmissionWithAttachment = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.CourseAssignmentSubmissionWithAttachment;
  var ClazzAssignment = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ClazzAssignment;
  var Long$Companion$MAX_VALUE = Kotlin.Long.MAX_VALUE;
  var firstOrNull = Kotlin.kotlin.collections.firstOrNull_2p1efm$;
  var get_doorPrimaryKeyManager = $module$door_door_runtime.com.ustadmobile.door.ext.get_doorPrimaryKeyManager_igmkyi$;
  var CourseAssignmentSubmissionAttachment = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.CourseAssignmentSubmissionAttachment;
  var CourseAssignmentSubmission = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.CourseAssignmentSubmission;
  var retrieveAttachment = $module$door_door_runtime.com.ustadmobile.door.attachments.retrieveAttachment_cdvnrs$;
  var mutableMapOf = Kotlin.kotlin.collections.mutableMapOf_qfcya0$;
  var MutableCollection = Kotlin.kotlin.collections.MutableCollection;
  var Role$Companion$PERMISSION_PERSON_LEARNINGRECORD_SELECT = new Kotlin.Long(0, 128);
  var L_1 = Kotlin.Long.NEG_ONE;
  var CourseAssignmentMark = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.CourseAssignmentMark;
  var Enum = Kotlin.kotlin.Enum;
  var throwISE = Kotlin.throwISE;
  var CourseGroupSet = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.CourseGroupSet;
  var CourseBlockWithEntity = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.CourseBlockWithEntity;
  var toLongOrNull = Kotlin.kotlin.text.toLongOrNull_pdl1vz$;
  var getFirstValue = $module$door_door_runtime.com.ustadmobile.door.getFirstValue_ruzh93$;
  var TimeSpan = $module$klock_root_klock_js_legacy.com.soywiz.klock.TimeSpan;
  var Role$Companion$PERMISSION_CLAZZ_UPDATE = Kotlin.Long.fromInt(4);
  var Role$Companion$PERMISSION_CLAZZ_ADD_STUDENT = Kotlin.Long.fromInt(1024);
  var Role$Companion$PERMISSION_PERSON_DELEGATE = new Kotlin.Long(0, 1);
  var ClazzWithHolidayCalendarAndSchoolAndTerminology = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ClazzWithHolidayCalendarAndSchoolAndTerminology;
  var LinkedHashSet_init = Kotlin.kotlin.collections.LinkedHashSet_init_287e2$;
  var Clazz = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.Clazz;
  var plus = Kotlin.kotlin.collections.plus_iwxh38$;
  var plus_0 = Kotlin.kotlin.collections.plus_mydzjv$;
  var plus_1 = Kotlin.kotlin.collections.plus_qloxvw$;
  var Role$Companion$PERMISSION_CLAZZ_LOG_ATTENDANCE_SELECT = Kotlin.Long.fromInt(2048);
  var CoroutineScope = $module$kotlinx_coroutines_core.kotlinx.coroutines.CoroutineScope;
  var School = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.School;
  var HolidayCalendar = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.HolidayCalendar;
  var CourseTerminology = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.CourseTerminology;
  var ContentEntryWithBlockAndLanguage = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ContentEntryWithBlockAndLanguage;
  var CourseBlock = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.CourseBlock;
  var getDefaultTimeZoneId = $module$UstadMobile_lib_util.com.ustadmobile.lib.util.getDefaultTimeZoneId;
  var onDbThenRepoWithTimeout = $module$door_door_runtime.com.ustadmobile.door.ext.onDbThenRepoWithTimeout_qry4xi$;
  var CoursePicture = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.CoursePicture;
  var XObjectEntity_init = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.XObjectEntity_init;
  var CourseDiscussion = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.CourseDiscussion;
  var getOrNull = Kotlin.kotlin.collections.getOrNull_yzln2o$;
  var getPropertyCallableRef = Kotlin.getPropertyCallableRef;
  var Schedule = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.Schedule;
  var sortedWith = Kotlin.kotlin.collections.sortedWith_eknfly$;
  var wrapFunction = Kotlin.wrapFunction;
  var Comparator = Kotlin.kotlin.Comparator;
  var checkIndexOverflow = Kotlin.kotlin.collections.checkIndexOverflow_za3lpa$;
  var toInt = Kotlin.kotlin.text.toInt_pdl1vz$;
  var ClazzEnrolmentWithLeavingReason = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ClazzEnrolmentWithLeavingReason;
  var LeavingReason = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.LeavingReason;
  var Role$Companion$PERMISSION_CLAZZ_ADD_TEACHER = Kotlin.Long.fromInt(512);
  var plus_2 = Kotlin.kotlin.collections.plus_e8164j$;
  var split = Kotlin.kotlin.text.split_ip8yn$;
  var Role$Companion$PERMISSION_CLAZZ_SELECT = Kotlin.Long.fromInt(2);
  var Role$Companion$PERMISSION_CLAZZ_INSERT = Kotlin.Long.fromInt(2);
  var trim = Kotlin.kotlin.text.trim_gw00vp$;
  var emptyMap = Kotlin.kotlin.collections.emptyMap_q3lmfv$;
  var ClazzLog = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ClazzLog;
  var withTimeoutOrNull = $module$kotlinx_coroutines_core.kotlinx.coroutines.withTimeoutOrNull_ms3uf5$;
  var ClazzLogAttendanceRecordWithPerson = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ClazzLogAttendanceRecordWithPerson;
  var copyOnWriteListOf = $module$UstadMobile_lib_util.com.ustadmobile.lib.util.copyOnWriteListOf_i5x0yv$;
  var sortWith = Kotlin.kotlin.collections.sortWith_nqfjgj$;
  var toList_0 = Kotlin.kotlin.collections.toList_us0mfu$;
  var Role$Companion$PERMISSION_CLAZZ_LOG_ATTENDANCE_INSERT = Kotlin.Long.fromInt(8);
  var ClazzEnrolment = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ClazzEnrolment;
  var ContentEntryWithMostRecentContainer = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ContentEntryWithMostRecentContainer;
  var ContentEntry = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ContentEntry;
  var Role$Companion$PERMISSION_CONTENT_UPDATE = Kotlin.Long.fromInt(268435456);
  var ContentJob = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ContentJob;
  var LearnerGroup = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.LearnerGroup;
  var GroupLearningSession = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.GroupLearningSession;
  var LearnerGroupMember = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.LearnerGroupMember;
  var PrimitiveClasses$booleanClass = Kotlin.kotlin.reflect.js.internal.PrimitiveClasses.booleanClass;
  var ContentEntryPicture = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ContentEntryPicture;
  var Language = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.Language;
  var MapSerializer = $module$kotlinx_serialization_kotlinx_serialization_core_js_legacy.kotlinx.serialization.builtins.MapSerializer_2yqygg$;
  var InstanceOrNull = $module$Kodein_DI_kodein_di.org.kodein.di.InstanceOrNull_l95o76$;
  var lastOrNull = Kotlin.kotlin.collections.lastOrNull_2p1efm$;
  var Role$Companion$PERMISSION_CONTENT_INSERT = Kotlin.Long.fromInt(134217728);
  var ContentEntryWithParentChildJoinAndStatusAndMostRecentContainer = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ContentEntryWithParentChildJoinAndStatusAndMostRecentContainer;
  var isBlank = Kotlin.kotlin.text.isBlank_gw00vp$;
  var DiscussionTopic = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.DiscussionTopic;
  var CourseGroupMemberPerson = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.CourseGroupMemberPerson;
  var CourseGroupMember = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.CourseGroupMember;
  var shuffled = Kotlin.kotlin.collections.shuffled_7wnvza$;
  var TerminologyEntry = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.TerminologyEntry;
  var mapCapacity = Kotlin.kotlin.collections.mapCapacity_za3lpa$;
  var coerceAtLeast = Kotlin.kotlin.ranges.coerceAtLeast_dqglrj$;
  var LinkedHashMap_init_0 = Kotlin.kotlin.collections.LinkedHashMap_init_bwtc7$;
  var DateRangeMoment = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.DateRangeMoment;
  var Moment = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.Moment;
  var Role$Companion$PERMISSION_CLAZZ_OPEN = new Kotlin.Long(0, 2);
  var Comments_init = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.Comments_init_crfs04$;
  var Message_init_0 = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.Message_init_cd114f$;
  var DiscussionPost = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.DiscussionPost;
  var L100 = Kotlin.Long.fromInt(100);
  var XmlPullParserFactory = $module$xmlpullparserkmp_js_legacy.com.ustadmobile.xmlpullparserkmp.XmlPullParserFactory;
  var setInputString = $module$xmlpullparserkmp_js_legacy.com.ustadmobile.xmlpullparserkmp.setInputString_fde4c1$;
  var substringBeforeLast = Kotlin.kotlin.text.substringBeforeLast_j4ogox$;
  var indexOf = Kotlin.kotlin.collections.indexOf_bv23uc$;
  var substringAfterLast = Kotlin.kotlin.text.substringAfterLast_j4ogox$;
  var takeFrom_0 = $module$ktor_ktor_client_core_js_legacy.$$importsForInline$$['ktor-ktor-http-js-legacy'].io.ktor.http.takeFrom_jl1sg7$;
  var Array_0 = Array;
  var Runnable = $module$kotlinx_coroutines_core.kotlinx.coroutines.Runnable;
  var ErrorReport = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ErrorReport;
  var Holiday = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.Holiday;
  var toIntOrNull = Kotlin.kotlin.text.toIntOrNull_pdl1vz$;
  var L10000 = Kotlin.Long.fromInt(10000);
  var L5000 = Kotlin.Long.fromInt(5000);
  var PersonParentJoinWithMinorPerson = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.PersonParentJoinWithMinorPerson;
  var Role$Companion$ROLE_PARENT_PERSON_PERMISSIONS_DEFAULT = new Kotlin.Long(1048640, 20624);
  var Role$Companion$PERMISSION_RESET_PASSWORD = new Kotlin.Long(0, 16);
  var Role$Companion$PERMISSION_PERSON_UPDATE = Kotlin.Long.fromInt(256);
  var PersonPicture = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.PersonPicture;
  var PersonGroup = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.PersonGroup;
  var Role$Companion$PERMISSION_PERSON_SELECT = Kotlin.Long.fromInt(64);
  var Role$Companion$PERMISSION_PERSON_INSERT = Kotlin.Long.fromInt(128);
  var Report = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.Report;
  var ReportSeries = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ReportSeries;
  var ReportWithSeriesWithFilters_init = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ReportWithSeriesWithFilters_init_bj006k$;
  var ReportWithSeriesWithFilters = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ReportWithSeriesWithFilters;
  var ReportFilter = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ReportFilter;

  var UidAndLabel = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.UidAndLabel;
  var Report$Companion$TEMPLATE_BLANK_REPORT_UID = Kotlin.Long.fromInt(100000);
  var Role$Companion$PERMISSION_SCHOOL_UPDATE = new Kotlin.Long(-2147483648, 0);
  var SchoolWithHolidayCalendar = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.SchoolWithHolidayCalendar;
  var ScopedGrantAndName = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ScopedGrantAndName;
  var ScopedGrant = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ScopedGrant;
  var Role$Companion$ROLE_SCHOOL_STAFF_PERMISSIONS_DEFAULT = new Kotlin.Long(545279430, 66);
  var Role$Companion$ROLE_SCHOOL_STUDENT_PERMISSION_DEFAULT = Kotlin.Long.fromInt(536870912);
  var Role$Companion$PERMISSION_SCHOOL_SELECT = Kotlin.Long.fromInt(536870912);
  var Role$Companion$PERMISSION_SCHOOL_INSERT = Kotlin.Long.fromInt(1073741824);
  var Role$Companion$PERMISSION_SCHOOL_ADD_STUDENT = new Kotlin.Long(0, 64);
  var Role$Companion$PERMISSION_SCHOOL_ADD_STAFF = new Kotlin.Long(0, 32);
  var SchoolMember = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.SchoolMember;
  var Role$Companion$PERMISSION_ADD_CLASS_TO_SCHOOL = new Kotlin.Long(0, 65536);
  var Role$Companion$PERMISSION_CLAZZ_LOG_ATTENDANCE_UPDATE = Kotlin.Long.fromInt(4096);
  var Role$Companion$PERMISSION_CLAZZ_CONTENT_SELECT = new Kotlin.Long(0, 1024);
  var Role$Companion$PERMISSION_CLAZZ_CONTENT_UPDATE = new Kotlin.Long(0, 2048);
  var Role$Companion$PERMISSION_ASSIGNMENT_SELECT = Kotlin.Long.fromInt(8388608);
  var Role$Companion$PERMISSION_ASSIGNMENT_UPDATE = Kotlin.Long.fromInt(16777216);
  var Role$Companion$PERMISSION_PERSONCONTACT_SELECT = new Kotlin.Long(0, 4096);
  var Role$Companion$PERMISSION_PERSONCONTACT_UPDATE = new Kotlin.Long(0, 8192);
  var Role$Companion$PERMISSION_PERSONSOCIOECONOMIC_SELECT = new Kotlin.Long(0, 16384);
  var Role$Companion$PERMISSION_PERSONSOCIOECONOMIC_UPDATE = new Kotlin.Long(0, 32768);
  var L277631006154574 = new Kotlin.Long(25173838, 64641);
  var SiteTerms = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.SiteTerms;
  var SiteTermsWithLanguage = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.SiteTermsWithLanguage;
  var DoorLifecycleOwner = $module$door_door_runtime.com.ustadmobile.door.DoorLifecycleOwner;
  var UmLifecycleOwner = $module$UstadMobile_lib_util.com.ustadmobile.core.impl.UmLifecycleOwner;
  var VerbDisplay = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.VerbDisplay;
  var get_replicationNotificationDispatcher = $module$door_door_runtime.com.ustadmobile.door.ext.get_replicationNotificationDispatcher_igmkyi$;
  var ScopedGrant$Companion$ALL_ENTITIES = Kotlin.Long.fromInt(-2);
  var ReplicationSubscriptionManager$SubscriptionInitializedListener = $module$door_door_runtime.com.ustadmobile.door.replication.ReplicationSubscriptionManager.SubscriptionInitializedListener;
  var indexOf_0 = Kotlin.kotlin.text.indexOf_8eortd$;
  var sorted = Kotlin.kotlin.collections.sorted_exjks8$;
  var MonthSpan_init = $module$klock_root_klock_js_legacy.com.soywiz.klock.MonthSpan;
  var contentHashCode = Kotlin.arrayHashCode;
  var ContainerEntryFile_init = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ContainerEntryFile_init_yadk6l$;
  var toByte = Kotlin.toByte;
  var ContainerEntryWithMd5 = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ContainerEntryWithMd5;
  var TimezoneOffset = $module$klock_root_klock_js_legacy.com.soywiz.klock.TimezoneOffset;
  var until = $module$klock_root_klock_js_legacy.com.soywiz.klock.until_68nrlv$;
  var defineInlineFunction = Kotlin.defineInlineFunction;
  var DayOfWeek = $module$klock_root_klock_js_legacy.com.soywiz.klock.DayOfWeek;
  var JsonPrimitive = $module$kotlinx_serialization_kotlinx_serialization_json_js_legacy.kotlinx.serialization.json.JsonPrimitive_pdl1vj$;
  var JsonObject = $module$kotlinx_serialization_kotlinx_serialization_json_js_legacy.kotlinx.serialization.json.JsonObject;
  var split_0 = Kotlin.kotlin.text.split_o64adg$;
  var minOrNull = Kotlin.kotlin.collections.minOrNull_exjks8$;

  var get_isActive = $module$kotlinx_coroutines_core.kotlinx.coroutines.get_isActive_e9pf1l$;
  var cancel = $module$kotlinx_coroutines_core.kotlinx.coroutines.cancel_xz8be$;
  var indexOf_1 = Kotlin.kotlin.text.indexOf_l5u8uk$;
  var DoorMutableLiveData = $module$door_door_runtime.com.ustadmobile.door.DoorMutableLiveData;
  var TablesInvalidationListener = $module$door_door_runtime.com.ustadmobile.door.TablesInvalidationListener;
  var ChangeListenerRequest = $module$door_door_runtime.com.ustadmobile.door.ChangeListenerRequest;
  var parse = $module$klock_root_klock_js_legacy.com.soywiz.klock.parse_mabgv2$;
  var DateException = $module$klock_root_klock_js_legacy.com.soywiz.klock.DateException;
  var Year = $module$klock_root_klock_js_legacy.com.soywiz.klock.Year;
  var Month = $module$klock_root_klock_js_legacy.com.soywiz.klock.Month;
  var DateFormat = $module$klock_root_klock_js_legacy.com.soywiz.klock.DateFormat;
  var toBoxedChar = Kotlin.toBoxedChar;
  var unboxChar = Kotlin.unboxChar;
  var CharRange = Kotlin.kotlin.ranges.CharRange;
  var toChar = Kotlin.toChar;
  var StringBuilder_init_0 = Kotlin.kotlin.text.StringBuilder_init_za3lpa$;
  var round = Kotlin.kotlin.math.round_14dthe$;
  var lastIndexOf_0 = Kotlin.kotlin.text.lastIndexOf_l5u8uk$;
  var ContentType_init = $module$ktor_ktor_http_js_legacy.io.ktor.http.ContentType_init_bo4f5s$;
  var L1073741824 = Kotlin.Long.fromInt(1073741824);
  var L1048576 = Kotlin.Long.fromInt(1048576);
  var L1024 = Kotlin.Long.fromInt(1024);
  var ISO8601$IsoIntervalFormat = $module$klock_root_klock_js_legacy.com.soywiz.klock.ISO8601.IsoIntervalFormat;
  var LazyThreadSafetyMode = Kotlin.kotlin.LazyThreadSafetyMode;
  var lazy_0 = Kotlin.kotlin.lazy_kls4a0$;
  var roundToInt = Kotlin.kotlin.math.roundToInt_yrwdxr$;
  var distinct = Kotlin.kotlin.collections.distinct_7wnvza$;
  var abs = Kotlin.kotlin.math.abs_za3lpa$;
  var timeout = $module$ktor_ktor_client_core_js_legacy.io.ktor.client.features.timeout_f63vwi$;
  var defaultSerializer = $module$ktor_ktor_client_json_js_legacy.io.ktor.client.features.json.defaultSerializer;
  var TextContent = $module$ktor_ktor_http_js_legacy.io.ktor.http.content.TextContent;
  var trimMargin = Kotlin.kotlin.text.trimMargin_rjktp$;
  var StatementEntity = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.StatementEntity;
  var hexStringToByteArray = $module$door_door_runtime.com.ustadmobile.door.ext.hexStringToByteArray_pdl1vz$;
  var text = Kotlin.kotlin.text;
  var isLowerCase = Kotlin.kotlin.text.isLowerCase_myv2d0$;
  var titlecase = Kotlin.kotlin.text.titlecase_myv2d0$;
  var count = Kotlin.kotlin.sequences.count_veqyi0$;
  var PersonGroup_init = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.PersonGroup_init_61zpoe$;
  var randomString = $module$UstadMobile_lib_util.com.ustadmobile.lib.util.randomString_19mbxw$;
  var Role$Companion$ROLE_CLAZZ_TEACHER_PERMISSIONS_DEFAULT = new Kotlin.Long(25198046, 3970);
  var Role$Companion$ROLE_CLAZZ_STUDENT_PERMISSIONS_DEFAULT = new Kotlin.Long(8388674, 1026);
  var Role$Companion$ROLE_CLAZZ_PARENT_PERMISSION_DEFAULT = new Kotlin.Long(8388674, 2);
  var PersonGroupMember = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.PersonGroupMember;
  var L2500 = Kotlin.Long.fromInt(2500);
  var SchoolMemberWithPerson = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.SchoolMemberWithPerson;
  var println = Kotlin.kotlin.io.println_s8jyv4$;
  var PersonGroupMember_init = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.PersonGroupMember_init_3pjtqy$;
  var SimpleDoorQuery = $module$door_door_runtime.com.ustadmobile.door.SimpleDoorQuery;
  var SchoolMember_init = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.SchoolMember_init;
  var contains_1 = Kotlin.kotlin.collections.contains_2ws7j4$;
  var ContainerEntryWithContainerEntryFile = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ContainerEntryWithContainerEntryFile;
  var L200 = Kotlin.Long.fromInt(200);
  var NoSuchElementException_init = Kotlin.kotlin.NoSuchElementException;
  var Random = Kotlin.kotlin.random.Random;
  var NodeIdAndAuth = $module$door_door_runtime.com.ustadmobile.door.entities.NodeIdAndAuth;
  var L_4103245208651563007 = new Kotlin.Long(1, -955361223);
  var await_0 = $module$kotlinx_coroutines_core.kotlinx.coroutines.await_t11jrl$;
  var ContainerEntryWithContainerEntryFile_init = $module$UstadMobile_lib_database_entities.com.ustadmobile.lib.db.entities.ContainerEntryWithContainerEntryFile_init_t4nsby$;
  var IllegalArgumentException = Kotlin.kotlin.IllegalArgumentException;
  var toUrlQueryString = $module$door_door_runtime.com.ustadmobile.door.ext.toUrlQueryString_alv72w$;
  var LinkedHashMapSerializer = $module$kotlinx_serialization_kotlinx_serialization_core_js_legacy.kotlinx.serialization.internal.LinkedHashMapSerializer;
  var KotlinxSerializer = $module$ktor_ktor_client_serialization_js_legacy.io.ktor.client.features.json.serializer.KotlinxSerializer;
  var DoorTag = $module$door_door_runtime.com.ustadmobile.door.ext.DoorTag;
  var LogLevel = $module$Napier_napier_js_legacy.io.github.aakira.napier.LogLevel;
  var Antilog = $module$Napier_napier_js_legacy.io.github.aakira.napier.Antilog;
  AdultAccountRequiredException.prototype = Object.create(IllegalStateException.prototype);
  AdultAccountRequiredException.prototype.constructor = AdultAccountRequiredException;
  ConsentNotGrantedException.prototype = Object.create(IllegalStateException.prototype);
  ConsentNotGrantedException.prototype.constructor = ConsentNotGrantedException;
  UnauthorizedException.prototype = Object.create(IllegalStateException.prototype);
  UnauthorizedException.prototype.constructor = UnauthorizedException;
  UstadAccountManager$UserSessionMediator.prototype = Object.create(DoorMediatorLiveData.prototype);
  UstadAccountManager$UserSessionMediator.prototype.constructor = UstadAccountManager$UserSessionMediator;
  ContentEntryBranchDownloadPlugin.prototype = Object.create(AbstractContentEntryPlugin.prototype);
  ContentEntryBranchDownloadPlugin.prototype.constructor = ContentEntryBranchDownloadPlugin;
  KhanProblemInterceptor.prototype = Object.create(HarInterceptor.prototype);
  KhanProblemInterceptor.prototype.constructor = KhanProblemInterceptor;
  KhanProgressTracker.prototype = Object.create(HarInterceptor.prototype);
  KhanProgressTracker.prototype.constructor = KhanProgressTracker;
  RecorderInterceptor.prototype = Object.create(HarInterceptor.prototype);
  RecorderInterceptor.prototype.constructor = RecorderInterceptor;
  ConnectivityCancellationException.prototype = Object.create(CancellationException.prototype);
  ConnectivityCancellationException.prototype.constructor = ConnectivityCancellationException;
  ContentTypeNotSupportedException.prototype = Object.create(Exception.prototype);
  ContentTypeNotSupportedException.prototype.constructor = ContentTypeNotSupportedException;
  FatalContentJobException.prototype = Object.create(Exception.prototype);
  FatalContentJobException.prototype.constructor = FatalContentJobException;
  JobConnectivityLiveData.prototype = Object.create(DoorMediatorLiveData.prototype);
  JobConnectivityLiveData.prototype.constructor = JobConnectivityLiveData;
  AboutPresenter.prototype = Object.create(UstadBaseController.prototype);
  AboutPresenter.prototype.constructor = AboutPresenter;
  AccountListPresenter.prototype = Object.create(UstadBaseController.prototype);
  AccountListPresenter.prototype.constructor = AccountListPresenter;
  UstadSingleEntityPresenter.prototype = Object.create(UstadBaseController.prototype);
  UstadSingleEntityPresenter.prototype.constructor = UstadSingleEntityPresenter;
  UstadEditPresenter.prototype = Object.create(UstadSingleEntityPresenter.prototype);
  UstadEditPresenter.prototype.constructor = UstadEditPresenter;
  BitmaskEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  BitmaskEditPresenter.prototype.constructor = BitmaskEditPresenter;
  ChatDetailPresenter.prototype = Object.create(UstadBaseController.prototype);
  ChatDetailPresenter.prototype.constructor = ChatDetailPresenter;
  UstadListPresenter.prototype = Object.create(UstadBaseController.prototype);
  UstadListPresenter.prototype.constructor = UstadListPresenter;
  ChatListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  ChatListPresenter.prototype.constructor = ChatListPresenter;
  UstadDetailPresenter.prototype = Object.create(UstadSingleEntityPresenter.prototype);
  UstadDetailPresenter.prototype.constructor = UstadDetailPresenter;
  ClazzAssignmentDetailOverviewPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  ClazzAssignmentDetailOverviewPresenter.prototype.constructor = ClazzAssignmentDetailOverviewPresenter;
  ClazzAssignmentDetailPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  ClazzAssignmentDetailPresenter.prototype.constructor = ClazzAssignmentDetailPresenter;
  ClazzAssignmentDetailStudentProgressOverviewListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  ClazzAssignmentDetailStudentProgressOverviewListPresenter.prototype.constructor = ClazzAssignmentDetailStudentProgressOverviewListPresenter;
  ClazzAssignmentDetailStudentProgressPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  ClazzAssignmentDetailStudentProgressPresenter.prototype.constructor = ClazzAssignmentDetailStudentProgressPresenter;
  ClazzAssignmentEditPresenter$TextLimitTypeOptions.prototype = Object.create(Enum.prototype);
  ClazzAssignmentEditPresenter$TextLimitTypeOptions.prototype.constructor = ClazzAssignmentEditPresenter$TextLimitTypeOptions;
  MessageIdOption.prototype = Object.create(IdOption.prototype);
  MessageIdOption.prototype.constructor = MessageIdOption;
  ClazzAssignmentEditPresenter$TextLimitTypeOptionsMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ClazzAssignmentEditPresenter$TextLimitTypeOptionsMessageIdOption.prototype.constructor = ClazzAssignmentEditPresenter$TextLimitTypeOptionsMessageIdOption;
  ClazzAssignmentEditPresenter$CompletionCriteriaOptions.prototype = Object.create(Enum.prototype);
  ClazzAssignmentEditPresenter$CompletionCriteriaOptions.prototype.constructor = ClazzAssignmentEditPresenter$CompletionCriteriaOptions;
  ClazzAssignmentEditPresenter$CompletionCriteriaOptionsMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ClazzAssignmentEditPresenter$CompletionCriteriaOptionsMessageIdOption.prototype.constructor = ClazzAssignmentEditPresenter$CompletionCriteriaOptionsMessageIdOption;
  ClazzAssignmentEditPresenter$SubmissionPolicyOptions.prototype = Object.create(Enum.prototype);
  ClazzAssignmentEditPresenter$SubmissionPolicyOptions.prototype.constructor = ClazzAssignmentEditPresenter$SubmissionPolicyOptions;
  ClazzAssignmentEditPresenter$SubmissionPolicyOptionsMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ClazzAssignmentEditPresenter$SubmissionPolicyOptionsMessageIdOption.prototype.constructor = ClazzAssignmentEditPresenter$SubmissionPolicyOptionsMessageIdOption;
  ClazzAssignmentEditPresenter$FileTypeOptions.prototype = Object.create(Enum.prototype);
  ClazzAssignmentEditPresenter$FileTypeOptions.prototype.constructor = ClazzAssignmentEditPresenter$FileTypeOptions;
  ClazzAssignmentEditPresenter$FileTypeOptionsMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ClazzAssignmentEditPresenter$FileTypeOptionsMessageIdOption.prototype.constructor = ClazzAssignmentEditPresenter$FileTypeOptionsMessageIdOption;
  ClazzAssignmentEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  ClazzAssignmentEditPresenter.prototype.constructor = ClazzAssignmentEditPresenter;
  ClazzDetailOverviewPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  ClazzDetailOverviewPresenter.prototype.constructor = ClazzDetailOverviewPresenter;
  ClazzDetailPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  ClazzDetailPresenter.prototype.constructor = ClazzDetailPresenter;
  ClazzEdit2Presenter$EnrolmentPolicyOptions.prototype = Object.create(Enum.prototype);
  ClazzEdit2Presenter$EnrolmentPolicyOptions.prototype.constructor = ClazzEdit2Presenter$EnrolmentPolicyOptions;
  ClazzEdit2Presenter$EnrolmentPolicyOptionsMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ClazzEdit2Presenter$EnrolmentPolicyOptionsMessageIdOption.prototype.constructor = ClazzEdit2Presenter$EnrolmentPolicyOptionsMessageIdOption;
  ClazzEdit2Presenter.prototype = Object.create(UstadEditPresenter.prototype);
  ClazzEdit2Presenter.prototype.constructor = ClazzEdit2Presenter;
  ClazzEnrolmentEditPresenter$RoleOptions.prototype = Object.create(Enum.prototype);
  ClazzEnrolmentEditPresenter$RoleOptions.prototype.constructor = ClazzEnrolmentEditPresenter$RoleOptions;
  ClazzEnrolmentEditPresenter$RoleMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ClazzEnrolmentEditPresenter$RoleMessageIdOption.prototype.constructor = ClazzEnrolmentEditPresenter$RoleMessageIdOption;
  ClazzEnrolmentEditPresenter$OutcomeOptions.prototype = Object.create(Enum.prototype);
  ClazzEnrolmentEditPresenter$OutcomeOptions.prototype.constructor = ClazzEnrolmentEditPresenter$OutcomeOptions;
  ClazzEnrolmentEditPresenter$OutcomeMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ClazzEnrolmentEditPresenter$OutcomeMessageIdOption.prototype.constructor = ClazzEnrolmentEditPresenter$OutcomeMessageIdOption;
  ClazzEnrolmentEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  ClazzEnrolmentEditPresenter.prototype.constructor = ClazzEnrolmentEditPresenter;
  ClazzEnrolmentListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  ClazzEnrolmentListPresenter.prototype.constructor = ClazzEnrolmentListPresenter;
  ClazzListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  ClazzListPresenter.prototype.constructor = ClazzListPresenter;
  ClazzLogEditAttendancePresenter.prototype = Object.create(UstadEditPresenter.prototype);
  ClazzLogEditAttendancePresenter.prototype.constructor = ClazzLogEditAttendancePresenter;
  ClazzLogEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  ClazzLogEditPresenter.prototype.constructor = ClazzLogEditPresenter;
  ClazzLogListAttendancePresenter$SortOrder.prototype = Object.create(Enum.prototype);
  ClazzLogListAttendancePresenter$SortOrder.prototype.constructor = ClazzLogListAttendancePresenter$SortOrder;
  ClazzLogListAttendancePresenter$RecordAttendanceOption.prototype = Object.create(Enum.prototype);
  ClazzLogListAttendancePresenter$RecordAttendanceOption.prototype.constructor = ClazzLogListAttendancePresenter$RecordAttendanceOption;
  ClazzLogListAttendancePresenter$ClazzLogListSortOption.prototype = Object.create(MessageIdOption.prototype);
  ClazzLogListAttendancePresenter$ClazzLogListSortOption.prototype.constructor = ClazzLogListAttendancePresenter$ClazzLogListSortOption;
  ClazzLogListAttendancePresenter.prototype = Object.create(UstadListPresenter.prototype);
  ClazzLogListAttendancePresenter.prototype.constructor = ClazzLogListAttendancePresenter;
  ClazzMemberListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  ClazzMemberListPresenter.prototype.constructor = ClazzMemberListPresenter;
  ContentEntryDetailAttemptsListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  ContentEntryDetailAttemptsListPresenter.prototype.constructor = ContentEntryDetailAttemptsListPresenter;
  ContentEntryDetailOverviewPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  ContentEntryDetailOverviewPresenter.prototype.constructor = ContentEntryDetailOverviewPresenter;
  ContentEntryDetailPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  ContentEntryDetailPresenter.prototype.constructor = ContentEntryDetailPresenter;
  ContentEntryEdit2Presenter$LicenceOptions.prototype = Object.create(Enum.prototype);
  ContentEntryEdit2Presenter$LicenceOptions.prototype.constructor = ContentEntryEdit2Presenter$LicenceOptions;
  ContentEntryEdit2Presenter$CompletionCriteriaOptions.prototype = Object.create(Enum.prototype);
  ContentEntryEdit2Presenter$CompletionCriteriaOptions.prototype.constructor = ContentEntryEdit2Presenter$CompletionCriteriaOptions;
  ContentEntryEdit2Presenter$CompletionCriteriaMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ContentEntryEdit2Presenter$CompletionCriteriaMessageIdOption.prototype.constructor = ContentEntryEdit2Presenter$CompletionCriteriaMessageIdOption;
  ContentEntryEdit2Presenter$LicenceMessageIdOptions.prototype = Object.create(MessageIdOption.prototype);
  ContentEntryEdit2Presenter$LicenceMessageIdOptions.prototype.constructor = ContentEntryEdit2Presenter$LicenceMessageIdOptions;
  ContentEntryEdit2Presenter.prototype = Object.create(UstadEditPresenter.prototype);
  ContentEntryEdit2Presenter.prototype.constructor = ContentEntryEdit2Presenter;
  ContentEntryImportLinkPresenter.prototype = Object.create(UstadBaseController.prototype);
  ContentEntryImportLinkPresenter.prototype.constructor = ContentEntryImportLinkPresenter;
  ContentEntryList2Presenter.prototype = Object.create(UstadListPresenter.prototype);
  ContentEntryList2Presenter.prototype.constructor = ContentEntryList2Presenter;
  CourseDiscussionDetailPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  CourseDiscussionDetailPresenter.prototype.constructor = CourseDiscussionDetailPresenter;
  CourseDiscussionEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  CourseDiscussionEditPresenter.prototype.constructor = CourseDiscussionEditPresenter;
  CourseGroupSetDetailPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  CourseGroupSetDetailPresenter.prototype.constructor = CourseGroupSetDetailPresenter;
  CourseGroupSetEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  CourseGroupSetEditPresenter.prototype.constructor = CourseGroupSetEditPresenter;
  CourseGroupSetListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  CourseGroupSetListPresenter.prototype.constructor = CourseGroupSetListPresenter;
  CourseTerminologyEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  CourseTerminologyEditPresenter.prototype.constructor = CourseTerminologyEditPresenter;
  CourseTerminologyListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  CourseTerminologyListPresenter.prototype.constructor = CourseTerminologyListPresenter;
  DateRangePresenter$RelUnitOption.prototype = Object.create(Enum.prototype);
  DateRangePresenter$RelUnitOption.prototype.constructor = DateRangePresenter$RelUnitOption;
  DateRangePresenter$RelUnitMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  DateRangePresenter$RelUnitMessageIdOption.prototype.constructor = DateRangePresenter$RelUnitMessageIdOption;
  DateRangePresenter$RelToOption.prototype = Object.create(Enum.prototype);
  DateRangePresenter$RelToOption.prototype.constructor = DateRangePresenter$RelToOption;
  DateRangePresenter$RelToMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  DateRangePresenter$RelToMessageIdOption.prototype.constructor = DateRangePresenter$RelToMessageIdOption;
  DateRangePresenter.prototype = Object.create(UstadEditPresenter.prototype);
  DateRangePresenter.prototype.constructor = DateRangePresenter;
  DiscussionPostDetailPresenter.prototype = Object.create(UstadBaseController.prototype);
  DiscussionPostDetailPresenter.prototype.constructor = DiscussionPostDetailPresenter;
  DiscussionPostEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  DiscussionPostEditPresenter.prototype.constructor = DiscussionPostEditPresenter;
  DiscussionTopicDetailPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  DiscussionTopicDetailPresenter.prototype.constructor = DiscussionTopicDetailPresenter;
  DiscussionTopicEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  DiscussionTopicEditPresenter.prototype.constructor = DiscussionTopicEditPresenter;
  EpubContentPresenter.prototype = Object.create(UstadBaseController.prototype);
  EpubContentPresenter.prototype.constructor = EpubContentPresenter;
  ErrorReportPresenter.prototype = Object.create(UstadBaseController.prototype);
  ErrorReportPresenter.prototype.constructor = ErrorReportPresenter;
  HarContentPresenterCommon.prototype = Object.create(UstadBaseController.prototype);
  HarContentPresenterCommon.prototype.constructor = HarContentPresenterCommon;
  HolidayCalendarEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  HolidayCalendarEditPresenter.prototype.constructor = HolidayCalendarEditPresenter;
  HolidayCalendarListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  HolidayCalendarListPresenter.prototype.constructor = HolidayCalendarListPresenter;
  HolidayEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  HolidayEditPresenter.prototype.constructor = HolidayEditPresenter;
  HtmlTextViewDetailPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  HtmlTextViewDetailPresenter.prototype.constructor = HtmlTextViewDetailPresenter;
  InviteViaLinkPresenter.prototype = Object.create(UstadBaseController.prototype);
  InviteViaLinkPresenter.prototype.constructor = InviteViaLinkPresenter;
  JoinWithCodePresenter.prototype = Object.create(UstadBaseController.prototype);
  JoinWithCodePresenter.prototype.constructor = JoinWithCodePresenter;
  LanguageEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  LanguageEditPresenter.prototype.constructor = LanguageEditPresenter;
  LanguageListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  LanguageListPresenter.prototype.constructor = LanguageListPresenter;
  LearnerGroupMemberListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  LearnerGroupMemberListPresenter.prototype.constructor = LearnerGroupMemberListPresenter;
  LeavingReasonEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  LeavingReasonEditPresenter.prototype.constructor = LeavingReasonEditPresenter;
  LeavingReasonListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  LeavingReasonListPresenter.prototype.constructor = LeavingReasonListPresenter;
  Login2Presenter.prototype = Object.create(UstadBaseController.prototype);
  Login2Presenter.prototype.constructor = Login2Presenter;
  ModuleCourseBlockEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  ModuleCourseBlockEditPresenter.prototype.constructor = ModuleCourseBlockEditPresenter;
  OnBoardingPresenter.prototype = Object.create(UstadBaseController.prototype);
  OnBoardingPresenter.prototype.constructor = OnBoardingPresenter;
  ParentalConsentManagementPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  ParentalConsentManagementPresenter.prototype.constructor = ParentalConsentManagementPresenter;
  PersonAccountEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  PersonAccountEditPresenter.prototype.constructor = PersonAccountEditPresenter;
  PersonDetailPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  PersonDetailPresenter.prototype.constructor = PersonDetailPresenter;
  PersonEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  PersonEditPresenter.prototype.constructor = PersonEditPresenter;
  PersonGroupEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  PersonGroupEditPresenter.prototype.constructor = PersonGroupEditPresenter;
  PersonGroupListPresenter$SortOrder.prototype = Object.create(Enum.prototype);
  PersonGroupListPresenter$SortOrder.prototype.constructor = PersonGroupListPresenter$SortOrder;
  PersonGroupListPresenter$PersonGroupListSortOption.prototype = Object.create(MessageIdOption.prototype);
  PersonGroupListPresenter$PersonGroupListSortOption.prototype.constructor = PersonGroupListPresenter$PersonGroupListSortOption;
  PersonGroupListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  PersonGroupListPresenter.prototype.constructor = PersonGroupListPresenter;
  PersonListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  PersonListPresenter.prototype.constructor = PersonListPresenter;
  RedirectPresenter.prototype = Object.create(UstadBaseController.prototype);
  RedirectPresenter.prototype.constructor = RedirectPresenter;
  RegisterAgeRedirectPresenter.prototype = Object.create(UstadBaseController.prototype);
  RegisterAgeRedirectPresenter.prototype.constructor = RegisterAgeRedirectPresenter;
  RegisterMinorWaitForParentPresenter.prototype = Object.create(UstadBaseController.prototype);
  RegisterMinorWaitForParentPresenter.prototype.constructor = RegisterMinorWaitForParentPresenter;
  ReportDetailPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  ReportDetailPresenter.prototype.constructor = ReportDetailPresenter;
  ReportEditPresenter$VisualTypeOptions.prototype = Object.create(Enum.prototype);
  ReportEditPresenter$VisualTypeOptions.prototype.constructor = ReportEditPresenter$VisualTypeOptions;
  ReportEditPresenter$VisualTypeMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ReportEditPresenter$VisualTypeMessageIdOption.prototype.constructor = ReportEditPresenter$VisualTypeMessageIdOption;
  ReportEditPresenter$XAxisOptions.prototype = Object.create(Enum.prototype);
  ReportEditPresenter$XAxisOptions.prototype.constructor = ReportEditPresenter$XAxisOptions;
  ReportEditPresenter$XAxisMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ReportEditPresenter$XAxisMessageIdOption.prototype.constructor = ReportEditPresenter$XAxisMessageIdOption;
  ReportEditPresenter$DateRangeOptions.prototype = Object.create(Enum.prototype);
  ReportEditPresenter$DateRangeOptions.prototype.constructor = ReportEditPresenter$DateRangeOptions;
  ReportEditPresenter$SubGroupOptions.prototype = Object.create(Enum.prototype);
  ReportEditPresenter$SubGroupOptions.prototype.constructor = ReportEditPresenter$SubGroupOptions;
  ReportEditPresenter$SubGroupByMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ReportEditPresenter$SubGroupByMessageIdOption.prototype.constructor = ReportEditPresenter$SubGroupByMessageIdOption;
  ReportEditPresenter$YAxisOptions.prototype = Object.create(Enum.prototype);
  ReportEditPresenter$YAxisOptions.prototype.constructor = ReportEditPresenter$YAxisOptions;
  ReportEditPresenter$YAxisMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ReportEditPresenter$YAxisMessageIdOption.prototype.constructor = ReportEditPresenter$YAxisMessageIdOption;
  ReportEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  ReportEditPresenter.prototype.constructor = ReportEditPresenter;
  ReportFilterEditPresenter$FieldOption.prototype = Object.create(Enum.prototype);
  ReportFilterEditPresenter$FieldOption.prototype.constructor = ReportFilterEditPresenter$FieldOption;
  ReportFilterEditPresenter$FieldMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ReportFilterEditPresenter$FieldMessageIdOption.prototype.constructor = ReportFilterEditPresenter$FieldMessageIdOption;
  ReportFilterEditPresenter$ConditionOption.prototype = Object.create(Enum.prototype);
  ReportFilterEditPresenter$ConditionOption.prototype.constructor = ReportFilterEditPresenter$ConditionOption;
  ReportFilterEditPresenter$ConditionMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ReportFilterEditPresenter$ConditionMessageIdOption.prototype.constructor = ReportFilterEditPresenter$ConditionMessageIdOption;
  ReportFilterEditPresenter$ContentCompletionStatusOption.prototype = Object.create(Enum.prototype);
  ReportFilterEditPresenter$ContentCompletionStatusOption.prototype.constructor = ReportFilterEditPresenter$ContentCompletionStatusOption;
  ReportFilterEditPresenter$ContentCompletionStatusMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ReportFilterEditPresenter$ContentCompletionStatusMessageIdOption.prototype.constructor = ReportFilterEditPresenter$ContentCompletionStatusMessageIdOption;
  ReportFilterEditPresenter$FilterValueType.prototype = Object.create(Enum.prototype);
  ReportFilterEditPresenter$FilterValueType.prototype.constructor = ReportFilterEditPresenter$FilterValueType;
  ReportFilterEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  ReportFilterEditPresenter.prototype.constructor = ReportFilterEditPresenter;
  ReportListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  ReportListPresenter.prototype.constructor = ReportListPresenter;
  ReportTemplateListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  ReportTemplateListPresenter.prototype.constructor = ReportTemplateListPresenter;
  ScheduleEditPresenter$FrequencyOption.prototype = Object.create(Enum.prototype);
  ScheduleEditPresenter$FrequencyOption.prototype.constructor = ScheduleEditPresenter$FrequencyOption;
  ScheduleEditPresenter$FrequencyMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ScheduleEditPresenter$FrequencyMessageIdOption.prototype.constructor = ScheduleEditPresenter$FrequencyMessageIdOption;
  ScheduleEditPresenter$DayOptions.prototype = Object.create(Enum.prototype);
  ScheduleEditPresenter$DayOptions.prototype.constructor = ScheduleEditPresenter$DayOptions;
  ScheduleEditPresenter$DayMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ScheduleEditPresenter$DayMessageIdOption.prototype.constructor = ScheduleEditPresenter$DayMessageIdOption;
  ScheduleEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  ScheduleEditPresenter.prototype.constructor = ScheduleEditPresenter;
  SchoolDetailOverviewPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  SchoolDetailOverviewPresenter.prototype.constructor = SchoolDetailOverviewPresenter;
  SchoolDetailPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  SchoolDetailPresenter.prototype.constructor = SchoolDetailPresenter;
  SchoolEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  SchoolEditPresenter.prototype.constructor = SchoolEditPresenter;
  SchoolListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  SchoolListPresenter.prototype.constructor = SchoolListPresenter;
  SchoolMemberListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  SchoolMemberListPresenter.prototype.constructor = SchoolMemberListPresenter;
  ScopedGrantDetailPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  ScopedGrantDetailPresenter.prototype.constructor = ScopedGrantDetailPresenter;
  ScopedGrantEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  ScopedGrantEditPresenter.prototype.constructor = ScopedGrantEditPresenter;
  ScopedGrantListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  ScopedGrantListPresenter.prototype.constructor = ScopedGrantListPresenter;
  SelectExtractFilePresenterCommon.prototype = Object.create(UstadBaseController.prototype);
  SelectExtractFilePresenterCommon.prototype.constructor = SelectExtractFilePresenterCommon;
  SelectFilePresenterCommon.prototype = Object.create(UstadBaseController.prototype);
  SelectFilePresenterCommon.prototype.constructor = SelectFilePresenterCommon;
  SelectFolderPresenter.prototype = Object.create(UstadBaseController.prototype);
  SelectFolderPresenter.prototype.constructor = SelectFolderPresenter;
  SessionListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  SessionListPresenter.prototype.constructor = SessionListPresenter;
  SettingsPresenter.prototype = Object.create(UstadBaseController.prototype);
  SettingsPresenter.prototype.constructor = SettingsPresenter;
  SiteDetailPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  SiteDetailPresenter.prototype.constructor = SiteDetailPresenter;
  SiteEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  SiteEditPresenter.prototype.constructor = SiteEditPresenter;
  SiteEnterLinkPresenter.prototype = Object.create(UstadBaseController.prototype);
  SiteEnterLinkPresenter.prototype.constructor = SiteEnterLinkPresenter;
  SiteTermsDetailPresenter.prototype = Object.create(UstadDetailPresenter.prototype);
  SiteTermsDetailPresenter.prototype.constructor = SiteTermsDetailPresenter;
  SiteTermsEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  SiteTermsEditPresenter.prototype.constructor = SiteTermsEditPresenter;
  StatementListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  StatementListPresenter.prototype.constructor = StatementListPresenter;
  TextAssignmentEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  TextAssignmentEditPresenter.prototype.constructor = TextAssignmentEditPresenter;
  TextCourseBlockEditPresenter.prototype = Object.create(UstadEditPresenter.prototype);
  TextCourseBlockEditPresenter.prototype.constructor = TextCourseBlockEditPresenter;
  TimeZoneListPresenter.prototype = Object.create(UstadBaseController.prototype);
  TimeZoneListPresenter.prototype.constructor = TimeZoneListPresenter;
  UstadSingleEntityPresenter$PersistenceMode.prototype = Object.create(Enum.prototype);
  UstadSingleEntityPresenter$PersistenceMode.prototype.constructor = UstadSingleEntityPresenter$PersistenceMode;
  VerbEntityListPresenter$SortOrder.prototype = Object.create(Enum.prototype);
  VerbEntityListPresenter$SortOrder.prototype.constructor = VerbEntityListPresenter$SortOrder;
  VerbEntityListPresenter$VerbEntityListSortOption.prototype = Object.create(MessageIdOption.prototype);
  VerbEntityListPresenter$VerbEntityListSortOption.prototype.constructor = VerbEntityListPresenter$VerbEntityListSortOption;
  VerbEntityListPresenter.prototype = Object.create(UstadListPresenter.prototype);
  VerbEntityListPresenter.prototype.constructor = VerbEntityListPresenter;
  VideoContentPresenterCommon.prototype = Object.create(UstadBaseController.prototype);
  VideoContentPresenterCommon.prototype.constructor = VideoContentPresenterCommon;
  WebChunkPresenterCommon.prototype = Object.create(UstadBaseController.prototype);
  WebChunkPresenterCommon.prototype.constructor = WebChunkPresenterCommon;
  XapiPackageContentPresenter.prototype = Object.create(UstadBaseController.prototype);
  XapiPackageContentPresenter.prototype.constructor = XapiPackageContentPresenter;
  ErrorCodeException.prototype = Object.create(Exception.prototype);
  ErrorCodeException.prototype.constructor = ErrorCodeException;
  NoAppFoundException.prototype = Object.create(Exception.prototype);
  NoAppFoundException.prototype.constructor = NoAppFoundException;
  DefaultOneToManyJoinEditHelper.prototype = Object.create(OneToManyJoinEditHelper.prototype);
  DefaultOneToManyJoinEditHelper.prototype.constructor = DefaultOneToManyJoinEditHelper;
  ListFilterIdOption.prototype = Object.create(IdOption.prototype);
  ListFilterIdOption.prototype.constructor = ListFilterIdOption;
  ObjectMessageIdOption.prototype = Object.create(MessageIdOption.prototype);
  ObjectMessageIdOption.prototype.constructor = ObjectMessageIdOption;
  OneToManyJoinEditHelperMp.prototype = Object.create(DefaultOneToManyJoinEditHelper.prototype);
  OneToManyJoinEditHelperMp.prototype.constructor = OneToManyJoinEditHelperMp;
  RateLimitedLiveData.prototype = Object.create(DoorMutableLiveData.prototype);
  RateLimitedLiveData.prototype.constructor = RateLimitedLiveData;
  ScopedGrantOneToManyHelper.prototype = Object.create(DefaultOneToManyJoinEditHelper.prototype);
  ScopedGrantOneToManyHelper.prototype.constructor = ScopedGrantOneToManyHelper;
  AlreadyEnroledInClassException.prototype = Object.create(Exception.prototype);
  AlreadyEnroledInClassException.prototype.constructor = AlreadyEnroledInClassException;
  AlreadyEnroledInSchoolException.prototype = Object.create(Exception.prototype);
  AlreadyEnroledInSchoolException.prototype.constructor = AlreadyEnroledInSchoolException;
  EditButtonMode.prototype = Object.create(Enum.prototype);
  EditButtonMode.prototype.constructor = EditButtonMode;
  ListViewMode.prototype = Object.create(Enum.prototype);
  ListViewMode.prototype.constructor = ListViewMode;
  ListViewAddMode.prototype = Object.create(Enum.prototype);
  ListViewAddMode.prototype.constructor = ListViewAddMode;
  SelectionOption.prototype = Object.create(Enum.prototype);
  SelectionOption.prototype.constructor = SelectionOption;
  GetResultMode.prototype = Object.create(Enum.prototype);
  GetResultMode.prototype.constructor = GetResultMode;
  HarContentPresenter.prototype = Object.create(HarContentPresenterCommon.prototype);
  HarContentPresenter.prototype.constructor = HarContentPresenter;
  SelectExtractFilePresenter.prototype = Object.create(SelectExtractFilePresenterCommon.prototype);
  SelectExtractFilePresenter.prototype.constructor = SelectExtractFilePresenter;
  VideoContentPresenter.prototype = Object.create(VideoContentPresenterCommon.prototype);
  VideoContentPresenter.prototype.constructor = VideoContentPresenter;
  WebChunkPresenter.prototype = Object.create(WebChunkPresenterCommon.prototype);
  WebChunkPresenter.prototype.constructor = WebChunkPresenter;
  UstadMobileSystemImpl.prototype = Object.create(UstadMobileSystemCommon.prototype);
  UstadMobileSystemImpl.prototype.constructor = UstadMobileSystemImpl;
  UstadAntilog.prototype = Object.create(Antilog.prototype);
  UstadAntilog.prototype.constructor = UstadAntilog;
  function MessageIdMap() {
    MessageIdMap_instance = this;
    this.strMap_0 = mapOf([to(2018, 'cancel'), to(2787, 'my_content'), to(2640, 'sel_question_type_multiple_choice'), to(2219, 'year'), to(2838, 'upload'), to(2842, 'saved'), to(2096, 'no_video_file_found'), to(2550, 'from_to_date'), to(2190, 'score'), to(2169, 'entry_details_license'), to(2532, 'instructions_for_students'), to(2312, 'absent'), to(2454, 'not_recorded'), to(2003, 'err_registering_new_user'), to(2570, 'untitled'), to(2359, 'last_month'), to(2599, 'mark_complete'), to(2510, 'shake_feedback'), to(2962, 'assign_reviewers'), to(2063, 'optional'), to(2094, 'select_subtitle_video'), to(2784, 'anyone_with_this_can_join_school'), to(2617, 'public_comments'), to(2772, 'folder'), to(2697, 'strings_not_allowed'), to(2720, 'parent_consent_explanation'), to(2458, 'role'), to(2345, 'weekly'), to(2869, 'characters'), to(2678, 'moved_x_entries'), to(2632, 'connect_as_guest'), to(2586, 'edit_assignment'), to(2182, 'content_entry_export_message'), to(2694, 'connect'), to(2319, 'address'), to(2095, 'no_subtitle'), to(2581, 'clazz_work'), to(2000, 'app_name'), to(2478, 'edit_person'), to(2188, 'bar_chart'), to(2428, 'days'), to(2816, 'add_or_edit_assignment'), to(2162, 'download_cloud_availability'), to(2044, 'register'), to(2920, 'standard'), to(2071, 'reports'), to(2252, 'field_content_progress'), to(2886, 'edit_module'), to(2364, 'notes'), to(2740, 'continue_using_link_recommended'), to(2375, 'moved'), to(2712, 'join_school'), to(2769, 'content_entries_completed'), to(2883, 'discussion_board'), to(2256, 'condition_greater_than'), to(2950, 'submission_already_made'), to(2495, 'permission_activity_update'), to(2262, 'add_verb_filter'), to(2518, 'change_password'), to(2889, 'institution'), to(2450, 'attendance_percentage'), to(2613, 'maximum_score'), to(2789, 'grades_class_age'), to(2909, 'add_topic'), to(2940, 'post'), to(2671, 'add_student_to_school'), to(2689, 'edit_site'), to(2754, 'deleting_content'), to(2049, 'female'), to(2280, 'offline_sharing_enable_bluetooth_prompt'), to(2424, 'export'), to(2832, 'total_content_usage_duration_class'), to(2523, 'add'), to(2672, 'add_staff_to_school'), to(2180, 'content_editor_save_error'), to(2549, 'select_item'), to(2895, 'visibility'), to(2477, 'add_a_new_person'), to(2216, 'new_custom_date_range'), to(2456, 'group_setting_desc'), to(2108, 'article'), to(2436, 'users'), to(2470, 'role_name'), to(2410, 'activity_enter_any_notes'), to(2582, 'add_a_new_clazzwork'), to(2650, 'more_information'), to(2091, 'success'), to(2676, 'join_code_instructions'), to(2742, 'start_from_scratch'), to(2493, 'permission_activity_select'), to(2045, 'phone_number'), to(2809, 'error_code'), to(2512, 'send_feedback'), to(2126, 'relative_date'), to(2905, 'assign_to_random_groups'), to(2457, 'roles'), to(2777, 'use_the_public_lib_env'), to(2175, 'content_creation_folder_new_message'), to(2036, 'confirm_password'), to(2820, 'edit_clazzes'), to(2474, 'scope_by'), to(2698, 'undo'), to(2013, 'recycled'), to(2087, 'waiting_for_connection'), to(2257, 'condition_less_than'), to(2646, 'scope'), to(2196, 'average_usage_time_per_user'), to(2304, 'edit_schedule'), to(2038, 'first_name'), to(2508, 'option_value'), to(2876, 'add_block'), to(2620, 'add_class_comment'), to(2912, 'message'), to(2948, 'enrolment_policy'), to(2899, 'select_terminology'), to(2120, 'add_file_description'), to(2382, 'leaving_reason'), to(2427, 'age'), to(2034, 'username'), to(2250, 'field_content_completion'), to(2867, 'score_greater_than_zero'), to(2198, 'percent_students_completed'), to(2303, 'add_a_schedule'), to(2877, 'edit_block'), to(2228, 'xapi_options_y_axes'), to(2499, 'permission_sel_select'), to(2313, 'attendance_report'), to(2294, 'license_type_cc_0'), to(2748, 'add_from_gallery'), to(2358, 'toC'), to(2793, 'create_my_account'), to(2287, 'licence_type_cc_by'), to(2931, 'currently_enrolled'), to(2639, 'sel_question_type_free_text'), to(2171, 'multiple_choice'), to(2661, 'share_link'), to(2391, 'enrolment'), to(2529, 'schools'), to(2894, 'accept_enrolment_requests_automatically'), to(2402, 'partial'), to(2504, 'field_type'), to(2673, 'permission_password_reset'), to(2865, 'submit_grade_and_mark_next'), to(2027, 'error_opening_file'), to(2050, 'other'), to(2191, 'content_total_duration'), to(2335, 'class_description'), to(2517, 'save'), to(2440, 'gender_literal'), to(2836, 'number_of_active_users_over_time'), to(2614, 'quiz_questions'), to(2001, 'login'), to(2337, 'holiday'), to(2460, 'edit_role'), to(2500, 'permission_sel_update'), to(2701, 'content_pieces_completed'), to(2770, 'content_usage_time'), to(2082, 'share'), to(2587, 'total_score'), to(2416, 'add_activity_literal'), to(2389, 'outcome'), to(2749, 'add_video_or_audio_from_the_device_gallery'), to(2351, 'monday'), to(2713, 'what_is_your_date_of_birth'), to(2328, 'question'), to(2642, 'question_type'), to(2037, 'last_name'), to(2289, 'licence_type_cc_by_sa_nc'), to(2395, 'ascending'), to(2707, 'opening_link'), to(2338, 'add_a_holiday'), to(2598, 'completion_criteria'), to(2618, 'private_comments'), to(2560, 'permission_clazz_assignment_view'), to(2636, 'logged_in_as'), to(2946, 'submit_all_at_once_submission_policy'), to(2248, 'field_person_gender'), to(2710, 'you_are_already_in_school'), to(2594, 'points'), to(2756, 'add_educational_content_using_supported_formats_eg_pdf_xapi_h5p'), to(2858, 'file_type'), to(2471, 'members'), to(2771, 'all_permissions'), to(2431, 'all'), to(2052, 'settings'), to(2206, 'xapi_day'), to(2501, 'custom_fields'), to(2947, 'multiple_submission_allowed_submission_policy'), to(2134, 'dialog_download_from_playstore_cancel'), to(2773, 'create_a_new_learning_env'), to(2685, 'guest_login_enabled'), to(2401, 'add_a_teacher'), to(2348, 'monthly'), to(2660, 'copy_code'), to(2892, 'open_enrolment'), to(2887, 'indent'), to(2156, 'download_downloading_placeholder'), to(2735, 'view_socioeconomic_details_of_members'), to(2300, 'sort_by'), to(2379, 'new_enrolment'), to(2548, 'use_device_language'), to(2648, 'role_description'), to(2446, 'connectivity_full'), to(2400, 'teacher'), to(2828, 'percentage_of_students_attending_over_time'), to(2114, 'and'), to(2299, 'today'), to(2355, 'friday'), to(2696, 'edit_terms_and_policies'), to(2737, 'add_person_or_group'), to(2276, 'import_link_content_not_supported'), to(2542, 'due_date'), to(2596, 'automatic'), to(2073, 'save_as_template'), to(2553, 'add_to'), to(2417, 'select_one'), to(2070, 'exams'), to(2158, 'download_cancel_label'), to(2329, 'add_question'), to(2459, 'add_a_new_role'), to(2900, 'add_new_terminology'), to(2077, 'forgot_password'), to(2167, 'entry_details_author'), to(2435, 'sel_question_set_desc'), to(2277, 'import_link_big_size'), to(2318, 'basic_details'), to(2121, 'error_this_device_doesnt_support_bluetooth_sharing'), to(2229, 'xapi_options_x_axes'), to(2780, 'you_must_comply_with_license'), to(2339, 'edit_holiday'), to(2035, 'password'), to(2961, 'from_my_courses'), to(2954, 'add_discussion'), to(2747, 'add_using_a_web_link_then'), to(2932, 'past_enrollments'), to(2076, 'add_a_student'), to(2093, 'completed'), to(2818, 'edit_basic_profile_of_members'), to(2506, 'dropdown'), to(2273, 'no_account'), to(2004, 'register_empty_fields'), to(2231, 'xapi_options_filters'), to(2270, 'xapi_result_header'), to(2445, 'connectivity_limited'), to(2861, 'file_document'), to(2373, 'graduated'), to(2164, 'download_entry_state_paused'), to(2397, 'sort_by_text'), to(2246, 'id_verbentity_urlid'), to(2649, 'assign_role'), to(2485, 'permission_clazz_select'), to(2607, 'short_text'), to(2107, 'document'), to(2930, 'edit_course'), to(2075, 'students'), to(2205, 'number_unique_students_attending'), to(2845, 'dont_show_before'), to(2880, 'formatted_text_to_show_to_course_participants'), to(2960, 'disabled'), to(2334, 'class_name'), to(2609, 'quiz'), to(2057, 'languages'), to(2266, 'xapi_hours'), to(2551, 'num_items_with_name'), to(2498, 'permission_sel_question_update'), to(2524, 'refresh'), to(2574, 'not_submitted_cap'), to(2267, 'xapi_minutes'), to(2919, 'past_enrolments'), to(2238, 'report_filter_edit_field'), to(2528, 'join_existing_school'), to(2566, 'call'), to(2774, 'add_educational_content_to_new_learning_env'), to(2149, 'download_continue_stacked_label'), to(2487, 'permission_clazz_update'), to(2213, 'last_two_week_date_range'), to(2421, 'time_period'), to(2099, 'import_content'), to(2405, 'primary_user'), to(2831, 'content_usage_by_class'), to(2360, 'activity_change'), to(2629, 'organisation'), to(2563, 'add_new'), to(2852, 'edit_after_submission'), to(2404, 'participant'), to(2058, 'edit_language'), to(2315, 'mother'), to(2092, 'incomplete'), to(2340, 'holidays'), to(2766, 'app_store_link'), to(2525, 'school'), to(2385, 'view_profile'), to(2788, 'learning_environment'), to(2881, 'add_course_block_content_desc'), to(2764, 'nearby_share'), to(2368, 'sort_by_name_desc'), to(2254, 'condition_is'), to(2371, 'enroled'), to(2706, 'select_account'), to(2914, 'courses'), to(2592, 'allow_class_comments'), to(2306, 'last'), to(2763, 'recommended_for_advanced_users'), to(2012, 'downloaded'), to(2453, 'sync'), to(2744, 'add_permission_for_a_person'), to(2664, 'permission_person_delegate'), to(2141, 'onboarding_no_internet_subheadline'), to(2374, 'dropped_out'), to(2118, 'add_link_description'), to(2046, 'name'), to(2138, 'onboarding_get_started_label'), to(2112, 'unhide'), to(2715, 'we_sent_a_message_to_your_parent'), to(2031, 'next'), to(2535, 'percentage_score'), to(2797, 'almost_done'), to(2623, 'submit'), to(2792, 'add_remove_and_modify_subjects'), to(2069, 'classes'), to(2576, 'x_percent_attended'), to(2637, 'person_exists'), to(2047, 'description'), to(2699, 'video'), to(2626, 'return_and_mark_next'), to(2864, 'submit_grade'), to(2055, 'add_new_language'), to(2645, 'add_role_permission'), to(2218, 'time_range'), to(2184, 'open_folder'), to(2695, 'terms_and_policies_text'), to(2779, 'revoking_consent_will'), to(2281, 'offline_sharing_enable_wifi_promot'), to(2573, 'submitted_cap'), to(2562, 'overview'), to(2800, 'search_in'), to(2687, 'yes'), to(2014, 'libraries'), to(2327, 'student_image'), to(2432, 'holiday_calendars'), to(2197, 'number_students_completed'), to(2681, 'add_a_new_occurrence'), to(2326, 'join_existing_class'), to(2741, 'continue_using_the_link'), to(2823, 'content_already_added_to_class'), to(2847, 'require_text_submission'), to(2615, 'time'), to(2834, 'total_content_duration_gender'), to(2530, 'assignments'), to(2042, 'memory_card'), to(2105, 'interactive'), to(2544, 'add_new_content'), to(2343, 'edit_holiday_calendar'), to(2536, 'started_date'), to(2390, 'person_enrolment_in_class'), to(2555, 'items_selected'), to(2028, 'logout'), to(2388, 'in_progress'), to(2722, 'i_consent'), to(2442, 'connectivity'), to(2444, 'mobile_internet_access'), to(2507, 'options'), to(2151, 'download_wifi_only'), to(2527, 'edit_school'), to(2217, 'selected_custom_range'), to(2264, 'dashboard'), to(2386, 'class_enrolment_outcome'), to(2491, 'permission_attendance_insert'), to(2412, 'uom_duration_title'), to(2263, 'add_content_filter'), to(2350, 'sunday'), to(2067, 'phone'), to(2956, 'type_here'), to(2377, 'edit_leaving_reason'), to(2166, 'no_app_found'), to(2466, 'audit_log_setting_desc'), to(2659, 'copy_link'), to(2295, 'syncing'), to(2301, 'log'), to(2475, 'assign_to'), to(2583, 'edit_clazzwork'), to(2959, 'enabled'), to(2775, 'connect_to_an_existing_learning_environment'), to(2896, 'hidden_enrolment_via_links_code_or_invitation'), to(2145, 'onboarding_stay_organized_subheading'), to(2952, 'update_grade'), to(2271, 'xapi_score'), to(2153, 'download_state_download'), to(2514, 'start_date'), to(2855, 'not_allowed'), to(2935, 'new_group'), to(2465, 'audit_log'), to(2274, 'enter_url'), to(2008, 'confirm_delete_message'), to(2234, 'xapi_options_what'), to(2372, 'class_enrolment'), to(2447, 'prefer_not_to_say'), to(2376, 'new_leaving_reason'), to(2437, 'nomination'), to(2840, 'drag_and_drop_or_click_to_add_file'), to(2641, 'question_text'), to(2746, 'add_using_link'), to(2024, 'deleting'), to(2593, 'after_deadline_date_error'), to(2186, 'invalid_register_code'), to(2936, 'chat'), to(2010, 'login_network_error'), to(2783, 'class_setup'), to(2080, 'accounts'), to(2875, 'course_blocks'), to(2531, 'None'), to(2211, 'xapi_clear'), to(2341, 'holiday_calendar'), to(2513, 'feedback_thanks'), to(2731, 'edit_class_content'), to(2827, 'attendance_over_time_by_class'), to(2907, 'num_replies'), to(2927, 'add_module'), to(2225, 'xapi_options_data_set'), to(2684, 'manage_site_settings'), to(2122, 'share_offline_zip_checkbox_label'), to(2163, 'insufficient_space'), to(2235, 'xapi_options_when'), to(2604, 'visible_from_date'), to(2214, 'last_month_date_range'), to(2361, 'change_implemented_if_any'), to(2729, 'manage_parental_consent'), to(2357, 'day'), to(2123, 'share_offline_dialog_message'), to(2367, 'sort_by_name_asc'), to(2387, 'class_enrolment_leaving'), to(2844, 'group'), to(2601, 'marked'), to(2103, 'licence'), to(2776, 'does_your_class_already_have_learning_env'), to(2209, 'xapi_custom_date'), to(2496, 'permission_sel_question_select'), to(2015, 'pause_download'), to(2656, 'ask_your_teacher_for_code'), to(2830, 'number_of_students_completed_time'), to(2221, 'done'), to(2185, 'action_hidden'), to(2189, 'line_chart'), to(2288, 'licence_type_cc_by_sa'), to(2347, 'daily'), to(2807, 'sorry_something_went_wrong'), to(2630, 'use_public_library_site'), to(2521, 'timezone'), to(2670, 'permission_school_update'), to(2872, 'penalty_label'), to(2243, 'edit_report'), to(2863, 'max_number_of_files'), to(2278, 'import_link_error'), to(2193, 'count_session'), to(2333, 'add_class'), to(2168, 'entry_details_publisher'), to(2489, 'permission_clazz_add_student'), to(2608, 'attachment'), to(2655, 'reject'), to(2411, 'uom_frequency_title'), to(2806, 'oops'), to(2786, 'from_my_classes'), to(2903, 'course_setup'), to(2897, 'visible_for_all'), to(2110, 'move'), to(2129, 'filed_password_no_match'), to(2403, 'teachers_literal'), to(2862, 'file_image'), to(2247, 'edit_filters'), to(2415, 'add_activity'), to(2736, 'edit_socioeconomic_details_of_members'), to(2625, 'marking'), to(2953, 'update_grade_and_mark_next'), to(2307, 'last_week'), to(2668, 'permission_school_select'), to(2068, 'attendance'), to(2079, 'account'), to(2837, 'parent'), to(2259, 'condition_not_in_list'), to(2439, 'class_id'), to(2408, 'activity_went_good'), to(2750, 'add_file'), to(2483, 'permission_person_picture_insert'), to(2955, 'edit_discussion'), to(2430, 'file_selected'), to(2652, 'pending_requests'), to(2808, 'incident_id'), to(2893, 'enrolment_requests_must_be_approved'), to(2486, 'permission_clazz_insert'), to(2041, 'phone_memory'), to(2552, 'num_items_with_name_with_comma'), to(2885, 'new_module'), to(2937, 'you'), to(2286, 'repo_loading_status_failed_connection_error'), to(2131, 'profile'), to(2438, 'active'), to(2179, 'supported_files'), to(2666, 'permission_role_select'), to(2767, 'everything_works_offline'), to(2765, 'recommended_for_offline_installation'), to(2019, 'canceled'), to(2602, 'submitted'), to(2658, 'invite_link_desc'), to(2873, 'submissions'), to(2065, 'regcode'), to(2718, 'parent_child_register_message_subject'), to(2503, 'custom_fields_desc'), to(2711, 'join_class'), to(2426, 'average'), to(2183, 'show_hidden_items'), to(2462, 'role_assignment_setting_desc'), to(2176, 'content_creation_folder_update_message'), to(2738, 'lets_get_started'), to(2925, 'new_group_set'), to(2449, 'search'), to(2464, 'locations_setting_desc'), to(2381, 'add_leaving_reason'), to(2353, 'wednesday'), to(2565, 'x_teachers_y_students'), to(2125, 'fixed_date'), to(2611, 'deadline'), to(2874, 'add_text'), to(2944, 'managed_enrolment'), to(2502, 'custom_field'), to(2253, 'field_attendance_percentage'), to(2734, 'edit_contact_details_of_members'), to(2409, 'activity_went_bad'), to(2791, 'subjects'), to(2868, 'words'), to(2330, 'edit_question'), to(2354, 'thursday'), to(2564, 'staff'), to(2860, 'file_type_any'), to(2332, 'add_person'), to(2443, 'home_internet_access'), to(2546, 'student_progress'), to(2633, 'create_account'), to(2859, 'file_type_chosen'), to(2187, 'enter_register_code'), to(2021, 'deleted'), to(2059, 'two_letter_code'), to(2577, 'answer'), to(2848, 'maximum'), to(2142, 'onboarding_offline_sharing'), to(2727, 'status_consent_denied'), to(2571, 'present_late_absent'), to(2812, 'view_clazzes'), to(2072, 'choose_template'), to(2572, 'marked_cap'), to(2115, 'added'), to(2704, 'powered_by'), to(2934, 'new_chat'), to(2331, 'questions'), to(2053, 'language'), to(2160, 'download_storage_option_device'), to(2407, 'down'), to(2849, 'size_limit'), to(2882, 'add_assignment_block_content_desc'), to(2285, 'repo_loading_status_failed_noconnection'), to(2709, 'you_are_already_in_class'), to(2675, 'entity_code'), to(2922, 'course_code'), to(2595, 'minimum_score'), to(2154, 'download_state_downloading'), to(2378, 'edit_enrolment'), to(2159, 'download_pause_download'), to(2061, 'languages_description'), to(2567, 'organization_id'), to(2811, 'view_clazz'), to(2195, 'number_active_users'), to(2097, 'content_from_file'), to(2674, 'school_code'), to(2708, 'select_account_to_continue'), to(2760, 'add_subject'), to(2086, 'waiting'), to(2511, 'feedback_hint'), to(2240, 'report_filter_edit_values'), to(2324, 'edit_clazz'), to(2033, 'back'), to(2821, 'add_new_clazz_to_school'), to(2102, 'title'), to(2290, 'licence_type_cc_by_nc'), to(2543, 'content'), to(2362, 'duration'), to(2870, 'class_timezone_set'), to(2898, 'terminology'), to(2139, 'lets_get_started_label'), to(2090, 'passed'), to(2778, 'just_want_to_browse'), to(2370, 'date_left'), to(2452, 'over'), to(2249, 'field_person_age'), to(2945, 'text_file_submission_error'), to(2468, 'permission'), to(2066, 'home'), to(2686, 'registration_allowed'), to(2127, 'field_required_prompt'), to(2302, 'schedule'), to(2148, 'location_permission_details'), to(2399, 'attendance_low_to_high'), to(2728, 'other_legal_guardian'), to(2291, 'licence_type_cc_by_nc_sa'), to(2803, 'alternatively_you_can_download_the_apk'), to(2519, 'current_password'), to(2554, 'remove_from'), to(2039, 'register_now'), to(2342, 'add_a_new_holiday_calendar'), to(2150, 'download_continue_btn_label'), to(2062, 'advanced'), to(2857, 'peers'), to(2904, 'number_of_groups'), to(2245, 'add_a_new_verb'), to(2856, 'marked_by'), to(2505, 'text'), to(2739, 'looks_like_installed_app_from_link'), to(2244, 'verb'), to(2023, 'loading'), to(2902, 'your_words_for'), to(2224, 'xapi_options_visual_type'), to(2260, 'condition_between'), to(2074, 'contents'), to(2223, 'xapi_options_report_title'), to(2911, 'messages'), to(2200, 'total_absences'), to(2547, 'status'), to(2081, 'share_application'), to(2479, 'permission_person_select'), to(2575, 'submitliteral'), to(2913, 'library'), to(2472, 'member'), to(2612, 'class_timezone'), to(2866, 'graded'), to(2155, 'download_state_downloaded'), to(2383, 'leaving_reasons'), to(2242, 'create_a_new_report'), to(2279, 'supported_link'), to(2534, 'percentage_complete'), to(2908, 'topics'), to(2805, 'limited_i_avoid_downloading_too_much'), to(2152, 'download_calculating'), to(2762, 'share_apk_file'), to(2111, 'hide'), to(2104, 'ebook'), to(2683, 'terms_and_policies'), to(2393, 'error_start_date_before_previous_enrolment_date'), to(2194, 'interaction_recorded'), to(2241, 'report'), to(2516, 'last_active'), to(2665, 'this_field_is_mandatory'), to(2284, 'repo_loading_status_loading_mirror'), to(2298, 'record_attendance'), to(2481, 'permission_person_update'), to(2137, 'created_partnership'), to(2802, 'please_download_the_app'), to(2545, 'add_content'), to(2606, 'no_submission_required'), to(2433, 'holiday_calendars_desc'), to(2796, 'add_from_contacts'), to(2757, 'current_status_consent_granted'), to(2413, 'uom_boolean_title'), to(2051, 'unset'), to(2939, 'posts'), to(2752, 'importing'), to(2011, 'download'), to(2730, 'view_class_content'), to(2392, 'error_start_date_before_clazz_date'), to(2692, 'please_enter_the_linK'), to(2085, 'downloading'), to(2461, 'rols_assignment'), to(2951, 'grade_out_of_range'), to(2850, 'limit'), to(2526, 'add_a_new_school'), to(2181, 'content_entry_export_inprogress'), to(2751, 'add_folder'), to(2910, 'add_a_reply'), to(2663, 'role_not_selected_error'), to(2588, 'late_submission'), to(2634, 'my'), to(2296, 'feed'), to(2467, 'entry'), to(2957, 'deadline_has_passed'), to(2311, 'present'), to(2509, 'errors'), to(2316, 'birthday'), to(2691, 'site_link'), to(2688, 'no'), to(2568, 'student'), to(2732, 'view_class_learning_records'), to(2819, 'view_school'), to(2538, 'mixed'), to(2020, 'delete'), to(2743, 'ignore_the_link'), to(2657, 'copied_to_clipboard'), to(2906, 'add_new_groups'), to(2380, 'select_leaving_reason'), to(2755, 'add_folder_description'), to(2016, 'ok'), to(2644, 'roles_and_permissions'), to(2758, 'select_country'), to(2610, 'allow_private_comments_from_students'), to(2693, 'or'), to(2199, 'total_attendances'), to(2423, 'last_three_months'), to(2702, 'content_usage_duration'), to(2558, 'take_new_photo_from_camera'), to(2201, 'total_lates'), to(2667, 'permission_role_insert'), to(2268, 'xapi_seconds'), to(2539, 'store_title'), to(2522, 'users_settings_desc'), to(2654, 'please_wait_for_approval'), to(2088, 'queued'), to(2029, 'about'), to(2705, 'invalid_email'), to(2258, 'condition_in_list'), to(2561, 'permission_clazz_asignment_edit'), to(2638, 'incorrect_current_password'), to(2761, 'share_via'), to(2799, 'select_content'), to(2133, 'dialog_download_from_playstore_ok'), to(2147, 'location_permission_message'), to(2700, 'content_editor_create_new_category'), to(2963, 'reviews_per_user_group'), to(2321, 'edit'), to(2420, 'yes_no'), to(2647, 'scope_description'), to(2878, 'module'), to(2275, 'invalid_link'), to(2226, 'xapi_options_series'), to(2135, 'accept'), to(2813, 'enrol_and_unenrol_students'), to(2192, 'content_average_duration'), to(2540, 'store_description_short'), to(2782, 'see_supported_sites'), to(2165, 'get_app'), to(2759, 'enter_link'), to(2025, 'processing'), to(2964, 'assign_random_reviewers'), to(2627, 'return_only'), to(2043, 'device'), to(2212, 'last_week_date_range'), to(2958, 'unassigned_error'), to(2005, 'register_incorrect_email'), to(2048, 'male'), to(2631, 'create_site'), to(2515, 'end_date'), to(2835, 'unique_content_users_over_time'), to(2928, 'add_a_new_course'), to(2356, 'saturday'), to(2365, 'activity'), to(2434, 'sel_question_set'), to(2933, 'unread'), to(2100, 'update_content'), to(2853, 'allowed_till_deadline'), to(2398, 'attendance_high_to_low'), to(2600, 'late_penalty'), to(2585, 'new_assignment'), to(2369, 'date_enroll'), to(2810, 'take_me_home'), to(2109, 'audio'), to(2143, 'onboarding_offline_sharing_subheading'), to(2721, 'relationship'), to(2064, 'email'), to(2556, 'change_photo'), to(2745, 'add_permission_for_a_group'), to(2492, 'permission_attendance_update'), to(2128, 'field_password_error_min'), to(2056, 'select_language'), to(2310, 'mark_all_absent'), to(2591, 'end_of_grace_period'), to(2309, 'mark_all_present'), to(2943, 'error_too_long_text'), to(2717, 'parental_consent'), to(2537, 'started'), to(2569, 'contact_details'), to(2965, 'reviewer'), to(2643, 'add_option'), to(2297, 'people'), to(2017, 'confirm'), to(2482, 'permission_person_picture_select'), to(2177, 'error_message_load_page'), to(2578, 'of_content'), to(2317, 'first_names'), to(2022, 'new_tab'), to(2204, 'total_number_of_classes'), to(2815, 'view_assignments'), to(2726, 'status_consent_granted'), to(2269, 'xapi_verb_header'), to(2336, 'to'), to(2084, 'open'), to(2441, 'country'), to(2628, 'workspace'), to(2178, 'error_message_update_document'), to(2635, 'add_another'), to(2926, 'edit_text'), to(2854, 'allowed_till_grace'), to(2621, 'add_private_comment'), to(2174, 'file_required_prompt'), to(2841, 'extra_active_tab_warning'), to(2419, 'frequency'), to(2825, 'adult_account_required'), to(2406, 'up'), to(2233, 'xapi_options_did'), to(2106, 'collection'), to(2938, 'edit_topic'), to(2580, 'not_answered'), to(2917, 'course_comments'), to(2239, 'report_filter_edit_condition'), to(2490, 'permission_attendance_select'), to(2923, 'add_group'), to(2414, 'uom_default_title'), to(2144, 'onboarding_stay_organized_headline'), to(2346, 'once'), to(2921, 'group_number'), to(2272, 'import_title_not_entered'), to(2349, 'yearly'), to(2172, 'preview'), to(2884, 'add_discussion_board_desc'), to(2888, 'unindent'), to(2170, 'file_not_found'), to(2292, 'licence_type_public_domain'), to(2314, 'father'), to(2653, 'pending'), to(2130, 'update'), to(2669, 'permission_school_insert'), to(2790, 'add_remove_and_modify_grades'), to(2255, 'condition_is_not'), to(2207, 'xapi_week'), to(2605, 'submission_type'), to(2725, 'restore_consent'), to(2032, 'previous'), to(2429, 'apply'), to(2157, 'download_summary_title'), to(2826, 'blank_report'), to(2236, 'xapi_options_where'), to(2448, 'sel_question_set_to_use'), to(2781, 'you_can_copypaste_a_link'), to(2040, 'new_password'), to(2422, 'location'), to(2651, 'class_code'), to(2132, 'dialog_download_from_playstore_message'), to(2418, 'measurement_type'), to(2817, 'view_basic_profile_of_members'), to(2839, 'selected_file_summary'), to(2785, 'this_class'), to(2801, 'type'), to(2054, 'add_a_new_language'), to(2494, 'permission_activity_insert'), to(2060, 'three_letter_code'), to(2161, 'download_locally_availability'), to(2901, 'edit_terminology'), to(2282, 'enable'), to(2469, 'permissions'), to(2724, 'revoke_consent'), to(2222, 'xapi_options_general'), to(2480, 'permission_person_insert'), to(2814, 'enrol_and_unenrol_teachers'), to(2116, 'attempts'), to(2113, 'compress'), to(2488, 'permission_clazz_add_teacher'), to(2497, 'permission_sel_question_insert'), to(2579, 'nothing_here'), to(2768, 'swipe_to_next'), to(2879, 'course_module'), to(2584, 'clazz_assignment'), to(2265, 'activity_import_link'), to(2590, 'late_submission_penalty'), to(2146, 'location_permission_title'), to(2006, 'group_activity'), to(2941, 'individual_submission'), to(2846, 'require_file_submission'), to(2078, 'notifications'), to(2208, 'xapi_month'), to(2237, 'time_range_all'), to(2101, 'publicly_accessible'), to(2210, 'xapi_content_entry'), to(2098, 'content_from_link'), to(2215, 'last_three_months_date_range'), to(2851, 'number_of_files'), to(2918, 'currently_enroled'), to(2344, 'features_enabled'), to(2622, 'class_comments'), to(2890, 'student_enrolment_policy'), to(2559, 'select_new_photo_from_gallery'), to(2824, 'your_account_needs_approved'), to(2714, 'parents_email_address'), to(2915, 'course'), to(2394, 'time_present'), to(2929, 'join_existing_course'), to(2117, 'underRegistrationAgeError'), to(2232, 'xapi_options_who'), to(2794, 'recommend_it'), to(2924, 'edit_group'), to(2662, 'invite_with_link'), to(2007, 'select_group_members'), to(2203, 'percent_students_attended_or_late'), to(2589, 'mark_penalty'), to(2451, 'filter'), to(2473, 'role_assignment'), to(2716, 'toggle_visibility'), to(2829, 'content_completion'), to(2009, 'wrong_user_pass_combo'), to(2603, 'not_submitted'), to(2690, 'site'), to(2030, 'download_all'), to(2804, 'full_i_can_download_as_much_as_i_like'), to(2833, 'content_usage_over_time'), to(2202, 'percent_students_attended'), to(2616, 'submission'), to(2363, 'how_did_it_go'), to(2680, 'record_attendance_for_most_recent_occurrence'), to(2305, 'first'), to(2425, 'date'), to(2597, 'student_marks_content'), to(2942, 'unassigned'), to(2484, 'permission_person_picture_update'), to(2871, 'maximum_points'), to(2396, 'descending'), to(2533, 'not_started'), to(2140, 'onboarding_no_internet_headline'), to(2723, 'i_do_not_consent'), to(2916, 'reports_and_analytics'), to(2026, 'uploading'), to(2173, 'content_creation_storage_option_title'), to(2220, 'from'), to(2308, 'mark_all'), to(2366, 'sort_by_name'), to(2949, 'submission_policy'), to(2520, 'password_unchanged'), to(2843, 'individual'), to(2283, 'repo_loading_status_loading_cloud'), to(2624, 'three_num_items_with_name_with_comma'), to(2682, 'active_classes'), to(2320, 'add_person_to_class'), to(2230, 'xapi_options_subgroup'), to(2541, 'store_description_full'), to(2089, 'failed'), to(2136, 'also_available_in'), to(2679, 'end_is_before_start_error'), to(2703, 'manage_download'), to(2119, 'add_gallery_description'), to(2124, 'preparing'), to(2677, 'record_for_student'), to(2476, 'person'), to(2719, 'parent_child_register_message'), to(2891, 'teacher_enrolment_policy'), to(2083, 'send'), to(2227, 'xapi_options_axes'), to(2619, 'submit_your_answer'), to(2002, 'error'), to(2323, 'add_a_new_class'), to(2795, 'edit_permissions'), to(2293, 'licence_type_all_rights'), to(2251, 'field_content_entry'), to(2325, 'add_a_class'), to(2798, 'your_username'), to(2557, 'remove_photo'), to(2455, 'groups'), to(2384, 'leaving_reason_manage'), to(2733, 'view_contact_details_of_members'), to(2352, 'tuesday'), to(2753, 'downloading_content'), to(2463, 'locations'), to(2261, 'add_person_filter'), to(2322, 'clazz'), to(2822, 'added_to_class_content')]);
    this.idMap = toMap(this.strMap_0);
  }
  MessageIdMap.prototype.get_za3lpa$ = function(messageId) {
  return this.strMap_0.get_11rb$(messageId);
};
  MessageIdMap.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'MessageIdMap', 
  interfaces: []};
  var MessageIdMap_instance = null;
  function MessageIdMap_getInstance() {
    if (MessageIdMap_instance === null) {
      new MessageIdMap();
    }
    return MessageIdMap_instance;
  }
  function MessageID() {
    MessageID_instance = this;
    this.cancel = 2018;
    this.my_content = 2787;
    this.sel_question_type_multiple_choice = 2640;
    this.year = 2219;
    this.upload = 2838;
    this.saved = 2842;
    this.no_video_file_found = 2096;
    this.from_to_date = 2550;
    this.score = 2190;
    this.entry_details_license = 2169;
    this.instructions_for_students = 2532;
    this.absent = 2312;
    this.not_recorded = 2454;
    this.err_registering_new_user = 2003;
    this.untitled = 2570;
    this.last_month = 2359;
    this.mark_complete = 2599;
    this.shake_feedback = 2510;
    this.assign_reviewers = 2962;
    this.optional = 2063;
    this.select_subtitle_video = 2094;
    this.anyone_with_this_can_join_school = 2784;
    this.public_comments = 2617;
    this.folder = 2772;
    this.strings_not_allowed = 2697;
    this.parent_consent_explanation = 2720;
    this.role = 2458;
    this.weekly = 2345;
    this.characters = 2869;
    this.moved_x_entries = 2678;
    this.connect_as_guest = 2632;
    this.edit_assignment = 2586;
    this.content_entry_export_message = 2182;
    this.connect = 2694;
    this.address = 2319;
    this.no_subtitle = 2095;
    this.clazz_work = 2581;
    this.app_name = 2000;
    this.edit_person = 2478;
    this.bar_chart = 2188;
    this.days = 2428;
    this.add_or_edit_assignment = 2816;
    this.download_cloud_availability = 2162;
    this.register = 2044;
    this.standard = 2920;
    this.reports = 2071;
    this.field_content_progress = 2252;
    this.edit_module = 2886;
    this.notes = 2364;
    this.continue_using_link_recommended = 2740;
    this.moved = 2375;
    this.join_school = 2712;
    this.content_entries_completed = 2769;
    this.discussion_board = 2883;
    this.condition_greater_than = 2256;
    this.submission_already_made = 2950;
    this.permission_activity_update = 2495;
    this.add_verb_filter = 2262;
    this.change_password = 2518;
    this.institution = 2889;
    this.attendance_percentage = 2450;
    this.maximum_score = 2613;
    this.grades_class_age = 2789;
    this.add_topic = 2909;
    this.post = 2940;
    this.add_student_to_school = 2671;
    this.edit_site = 2689;
    this.deleting_content = 2754;
    this.female = 2049;
    this.offline_sharing_enable_bluetooth_prompt = 2280;
    this.export = 2424;
    this.total_content_usage_duration_class = 2832;
    this.add = 2523;
    this.add_staff_to_school = 2672;
    this.content_editor_save_error = 2180;
    this.select_item = 2549;
    this.visibility = 2895;
    this.add_a_new_person = 2477;
    this.new_custom_date_range = 2216;
    this.group_setting_desc = 2456;
    this.article = 2108;
    this.users = 2436;
    this.role_name = 2470;
    this.activity_enter_any_notes = 2410;
    this.add_a_new_clazzwork = 2582;
    this.more_information = 2650;
    this.success = 2091;
    this.join_code_instructions = 2676;
    this.start_from_scratch = 2742;
    this.permission_activity_select = 2493;
    this.phone_number = 2045;
    this.error_code = 2809;
    this.send_feedback = 2512;
    this.relative_date = 2126;
    this.assign_to_random_groups = 2905;
    this.roles = 2457;
    this.use_the_public_lib_env = 2777;
    this.content_creation_folder_new_message = 2175;
    this.confirm_password = 2036;
    this.edit_clazzes = 2820;
    this.scope_by = 2474;
    this.undo = 2698;
    this.recycled = 2013;
    this.waiting_for_connection = 2087;
    this.condition_less_than = 2257;
    this.scope = 2646;
    this.average_usage_time_per_user = 2196;
    this.edit_schedule = 2304;
    this.first_name = 2038;
    this.option_value = 2508;
    this.add_block = 2876;
    this.add_class_comment = 2620;
    this.message = 2912;
    this.enrolment_policy = 2948;
    this.select_terminology = 2899;
    this.add_file_description = 2120;
    this.leaving_reason = 2382;
    this.age = 2427;
    this.username = 2034;
    this.field_content_completion = 2250;
    this.score_greater_than_zero = 2867;
    this.percent_students_completed = 2198;
    this.add_a_schedule = 2303;
    this.edit_block = 2877;
    this.xapi_options_y_axes = 2228;
    this.permission_sel_select = 2499;
    this.attendance_report = 2313;
    this.license_type_cc_0 = 2294;
    this.add_from_gallery = 2748;
    this.toC = 2358;
    this.create_my_account = 2793;
    this.licence_type_cc_by = 2287;
    this.currently_enrolled = 2931;
    this.sel_question_type_free_text = 2639;
    this.multiple_choice = 2171;
    this.share_link = 2661;
    this.enrolment = 2391;
    this.schools = 2529;
    this.accept_enrolment_requests_automatically = 2894;
    this.partial = 2402;
    this.field_type = 2504;
    this.permission_password_reset = 2673;
    this.submit_grade_and_mark_next = 2865;
    this.error_opening_file = 2027;
    this.other = 2050;
    this.content_total_duration = 2191;
    this.class_description = 2335;
    this.save = 2517;
    this.gender_literal = 2440;
    this.number_of_active_users_over_time = 2836;
    this.quiz_questions = 2614;
    this.login = 2001;
    this.holiday = 2337;
    this.edit_role = 2460;
    this.permission_sel_update = 2500;
    this.content_pieces_completed = 2701;
    this.content_usage_time = 2770;
    this.share = 2082;
    this.total_score = 2587;
    this.add_activity_literal = 2416;
    this.outcome = 2389;
    this.add_video_or_audio_from_the_device_gallery = 2749;
    this.monday = 2351;
    this.what_is_your_date_of_birth = 2713;
    this.question = 2328;
    this.question_type = 2642;
    this.last_name = 2037;
    this.licence_type_cc_by_sa_nc = 2289;
    this.ascending = 2395;
    this.opening_link = 2707;
    this.add_a_holiday = 2338;
    this.completion_criteria = 2598;
    this.private_comments = 2618;
    this.permission_clazz_assignment_view = 2560;
    this.logged_in_as = 2636;
    this.submit_all_at_once_submission_policy = 2946;
    this.field_person_gender = 2248;
    this.you_are_already_in_school = 2710;
    this.points = 2594;
    this.add_educational_content_using_supported_formats_eg_pdf_xapi_h5p = 2756;
    this.file_type = 2858;
    this.members = 2471;
    this.all_permissions = 2771;
    this.all = 2431;
    this.settings = 2052;
    this.xapi_day = 2206;
    this.custom_fields = 2501;
    this.multiple_submission_allowed_submission_policy = 2947;
    this.dialog_download_from_playstore_cancel = 2134;
    this.create_a_new_learning_env = 2773;
    this.guest_login_enabled = 2685;
    this.add_a_teacher = 2401;
    this.monthly = 2348;
    this.copy_code = 2660;
    this.open_enrolment = 2892;
    this.indent = 2887;
    this.download_downloading_placeholder = 2156;
    this.view_socioeconomic_details_of_members = 2735;
    this.sort_by = 2300;
    this.new_enrolment = 2379;
    this.use_device_language = 2548;
    this.role_description = 2648;
    this.connectivity_full = 2446;
    this.teacher = 2400;
    this.percentage_of_students_attending_over_time = 2828;
    this.and = 2114;
    this.today = 2299;
    this.friday = 2355;
    this.edit_terms_and_policies = 2696;
    this.add_person_or_group = 2737;
    this.import_link_content_not_supported = 2276;
    this.due_date = 2542;
    this.automatic = 2596;
    this.save_as_template = 2073;
    this.add_to = 2553;
    this.select_one = 2417;
    this.exams = 2070;
    this.download_cancel_label = 2158;
    this.add_question = 2329;
    this.add_a_new_role = 2459;
    this.add_new_terminology = 2900;
    this.forgot_password = 2077;
    this.entry_details_author = 2167;
    this.sel_question_set_desc = 2435;
    this.import_link_big_size = 2277;
    this.basic_details = 2318;
    this.error_this_device_doesnt_support_bluetooth_sharing = 2121;
    this.xapi_options_x_axes = 2229;
    this.you_must_comply_with_license = 2780;
    this.edit_holiday = 2339;
    this.password = 2035;
    this.from_my_courses = 2961;
    this.add_discussion = 2954;
    this.add_using_a_web_link_then = 2747;
    this.past_enrollments = 2932;
    this.add_a_student = 2076;
    this.completed = 2093;
    this.edit_basic_profile_of_members = 2818;
    this.dropdown = 2506;
    this.no_account = 2273;
    this.register_empty_fields = 2004;
    this.xapi_options_filters = 2231;
    this.xapi_result_header = 2270;
    this.connectivity_limited = 2445;
    this.file_document = 2861;
    this.graduated = 2373;
    this.download_entry_state_paused = 2164;
    this.sort_by_text = 2397;
    this.id_verbentity_urlid = 2246;
    this.assign_role = 2649;
    this.permission_clazz_select = 2485;
    this.short_text = 2607;
    this.document = 2107;
    this.edit_course = 2930;
    this.students = 2075;
    this.number_unique_students_attending = 2205;
    this.dont_show_before = 2845;
    this.formatted_text_to_show_to_course_participants = 2880;
    this.disabled = 2960;
    this.class_name = 2334;
    this.quiz = 2609;
    this.languages = 2057;
    this.xapi_hours = 2266;
    this.num_items_with_name = 2551;
    this.permission_sel_question_update = 2498;
    this.refresh = 2524;
    this.not_submitted_cap = 2574;
    this.xapi_minutes = 2267;
    this.past_enrolments = 2919;
    this.report_filter_edit_field = 2238;
    this.join_existing_school = 2528;
    this.call = 2566;
    this.add_educational_content_to_new_learning_env = 2774;
    this.download_continue_stacked_label = 2149;
    this.permission_clazz_update = 2487;
    this.last_two_week_date_range = 2213;
    this.time_period = 2421;
    this.import_content = 2099;
    this.primary_user = 2405;
    this.content_usage_by_class = 2831;
    this.activity_change = 2360;
    this.organisation = 2629;
    this.add_new = 2563;
    this.edit_after_submission = 2852;
    this.participant = 2404;
    this.edit_language = 2058;
    this.mother = 2315;
    this.incomplete = 2092;
    this.holidays = 2340;
    this.app_store_link = 2766;
    this.school = 2525;
    this.view_profile = 2385;
    this.learning_environment = 2788;
    this.add_course_block_content_desc = 2881;
    this.nearby_share = 2764;
    this.sort_by_name_desc = 2368;
    this.condition_is = 2254;
    this.enroled = 2371;
    this.select_account = 2706;
    this.courses = 2914;
    this.allow_class_comments = 2592;
    this.last = 2306;
    this.recommended_for_advanced_users = 2763;
    this.downloaded = 2012;
    this.sync = 2453;
    this.add_permission_for_a_person = 2744;
    this.permission_person_delegate = 2664;
    this.onboarding_no_internet_subheadline = 2141;
    this.dropped_out = 2374;
    this.add_link_description = 2118;
    this.name = 2046;
    this.onboarding_get_started_label = 2138;
    this.unhide = 2112;
    this.we_sent_a_message_to_your_parent = 2715;
    this.next = 2031;
    this.percentage_score = 2535;
    this.almost_done = 2797;
    this.submit = 2623;
    this.add_remove_and_modify_subjects = 2792;
    this.classes = 2069;
    this.x_percent_attended = 2576;
    this.person_exists = 2637;
    this.description = 2047;
    this.video = 2699;
    this.return_and_mark_next = 2626;
    this.submit_grade = 2864;
    this.add_new_language = 2055;
    this.add_role_permission = 2645;
    this.time_range = 2218;
    this.open_folder = 2184;
    this.terms_and_policies_text = 2695;
    this.revoking_consent_will = 2779;
    this.offline_sharing_enable_wifi_promot = 2281;
    this.submitted_cap = 2573;
    this.overview = 2562;
    this.search_in = 2800;
    this.yes = 2687;
    this.libraries = 2014;
    this.student_image = 2327;
    this.holiday_calendars = 2432;
    this.number_students_completed = 2197;
    this.add_a_new_occurrence = 2681;
    this.join_existing_class = 2326;
    this.continue_using_the_link = 2741;
    this.content_already_added_to_class = 2823;
    this.require_text_submission = 2847;
    this.time = 2615;
    this.total_content_duration_gender = 2834;
    this.assignments = 2530;
    this.memory_card = 2042;
    this.interactive = 2105;
    this.add_new_content = 2544;
    this.edit_holiday_calendar = 2343;
    this.started_date = 2536;
    this.person_enrolment_in_class = 2390;
    this.items_selected = 2555;
    this.logout = 2028;
    this.in_progress = 2388;
    this.i_consent = 2722;
    this.connectivity = 2442;
    this.mobile_internet_access = 2444;
    this.options = 2507;
    this.download_wifi_only = 2151;
    this.edit_school = 2527;
    this.selected_custom_range = 2217;
    this.dashboard = 2264;
    this.class_enrolment_outcome = 2386;
    this.permission_attendance_insert = 2491;
    this.uom_duration_title = 2412;
    this.add_content_filter = 2263;
    this.sunday = 2350;
    this.phone = 2067;
    this.type_here = 2956;
    this.edit_leaving_reason = 2377;
    this.no_app_found = 2166;
    this.audit_log_setting_desc = 2466;
    this.copy_link = 2659;
    this.syncing = 2295;
    this.log = 2301;
    this.assign_to = 2475;
    this.edit_clazzwork = 2583;
    this.enabled = 2959;
    this.connect_to_an_existing_learning_environment = 2775;
    this.hidden_enrolment_via_links_code_or_invitation = 2896;
    this.onboarding_stay_organized_subheading = 2145;
    this.update_grade = 2952;
    this.xapi_score = 2271;
    this.download_state_download = 2153;
    this.start_date = 2514;
    this.not_allowed = 2855;
    this.new_group = 2935;
    this.audit_log = 2465;
    this.enter_url = 2274;
    this.confirm_delete_message = 2008;
    this.xapi_options_what = 2234;
    this.class_enrolment = 2372;
    this.prefer_not_to_say = 2447;
    this.new_leaving_reason = 2376;
    this.nomination = 2437;
    this.drag_and_drop_or_click_to_add_file = 2840;
    this.question_text = 2641;
    this.add_using_link = 2746;
    this.deleting = 2024;
    this.after_deadline_date_error = 2593;
    this.invalid_register_code = 2186;
    this.chat = 2936;
    this.login_network_error = 2010;
    this.class_setup = 2783;
    this.accounts = 2080;
    this.course_blocks = 2875;
    this.None = 2531;
    this.xapi_clear = 2211;
    this.holiday_calendar = 2341;
    this.feedback_thanks = 2513;
    this.edit_class_content = 2731;
    this.attendance_over_time_by_class = 2827;
    this.num_replies = 2907;
    this.add_module = 2927;
    this.xapi_options_data_set = 2225;
    this.manage_site_settings = 2684;
    this.share_offline_zip_checkbox_label = 2122;
    this.insufficient_space = 2163;
    this.xapi_options_when = 2235;
    this.visible_from_date = 2604;
    this.last_month_date_range = 2214;
    this.change_implemented_if_any = 2361;
    this.manage_parental_consent = 2729;
    this.day = 2357;
    this.share_offline_dialog_message = 2123;
    this.sort_by_name_asc = 2367;
    this.class_enrolment_leaving = 2387;
    this.group = 2844;
    this.marked = 2601;
    this.licence = 2103;
    this.does_your_class_already_have_learning_env = 2776;
    this.xapi_custom_date = 2209;
    this.permission_sel_question_select = 2496;
    this.pause_download = 2015;
    this.ask_your_teacher_for_code = 2656;
    this.number_of_students_completed_time = 2830;
    this.done = 2221;
    this.action_hidden = 2185;
    this.line_chart = 2189;
    this.licence_type_cc_by_sa = 2288;
    this.daily = 2347;
    this.sorry_something_went_wrong = 2807;
    this.use_public_library_site = 2630;
    this.timezone = 2521;
    this.permission_school_update = 2670;
    this.penalty_label = 2872;
    this.edit_report = 2243;
    this.max_number_of_files = 2863;
    this.import_link_error = 2278;
    this.count_session = 2193;
    this.add_class = 2333;
    this.entry_details_publisher = 2168;
    this.permission_clazz_add_student = 2489;
    this.attachment = 2608;
    this.reject = 2655;
    this.uom_frequency_title = 2411;
    this.oops = 2806;
    this.from_my_classes = 2786;
    this.course_setup = 2903;
    this.visible_for_all = 2897;
    this.move = 2110;
    this.filed_password_no_match = 2129;
    this.teachers_literal = 2403;
    this.file_image = 2862;
    this.edit_filters = 2247;
    this.add_activity = 2415;
    this.edit_socioeconomic_details_of_members = 2736;
    this.marking = 2625;
    this.update_grade_and_mark_next = 2953;
    this.last_week = 2307;
    this.permission_school_select = 2668;
    this.attendance = 2068;
    this.account = 2079;
    this.parent = 2837;
    this.condition_not_in_list = 2259;
    this.class_id = 2439;
    this.activity_went_good = 2408;
    this.add_file = 2750;
    this.permission_person_picture_insert = 2483;
    this.edit_discussion = 2955;
    this.file_selected = 2430;
    this.pending_requests = 2652;
    this.incident_id = 2808;
    this.enrolment_requests_must_be_approved = 2893;
    this.permission_clazz_insert = 2486;
    this.phone_memory = 2041;
    this.num_items_with_name_with_comma = 2552;
    this.new_module = 2885;
    this.you = 2937;
    this.repo_loading_status_failed_connection_error = 2286;
    this.profile = 2131;
    this.active = 2438;
    this.supported_files = 2179;
    this.permission_role_select = 2666;
    this.everything_works_offline = 2767;
    this.recommended_for_offline_installation = 2765;
    this.canceled = 2019;
    this.submitted = 2602;
    this.invite_link_desc = 2658;
    this.submissions = 2873;
    this.regcode = 2065;
    this.parent_child_register_message_subject = 2718;
    this.custom_fields_desc = 2503;
    this.join_class = 2711;
    this.average = 2426;
    this.show_hidden_items = 2183;
    this.role_assignment_setting_desc = 2462;
    this.content_creation_folder_update_message = 2176;
    this.lets_get_started = 2738;
    this.new_group_set = 2925;
    this.search = 2449;
    this.locations_setting_desc = 2464;
    this.add_leaving_reason = 2381;
    this.wednesday = 2353;
    this.x_teachers_y_students = 2565;
    this.fixed_date = 2125;
    this.deadline = 2611;
    this.add_text = 2874;
    this.managed_enrolment = 2944;
    this.custom_field = 2502;
    this.field_attendance_percentage = 2253;
    this.edit_contact_details_of_members = 2734;
    this.activity_went_bad = 2409;
    this.subjects = 2791;
    this.words = 2868;
    this.edit_question = 2330;
    this.thursday = 2354;
    this.staff = 2564;
    this.file_type_any = 2860;
    this.add_person = 2332;
    this.home_internet_access = 2443;
    this.student_progress = 2546;
    this.create_account = 2633;
    this.file_type_chosen = 2859;
    this.enter_register_code = 2187;
    this.deleted = 2021;
    this.two_letter_code = 2059;
    this.answer = 2577;
    this.maximum = 2848;
    this.onboarding_offline_sharing = 2142;
    this.status_consent_denied = 2727;
    this.present_late_absent = 2571;
    this.view_clazzes = 2812;
    this.choose_template = 2072;
    this.marked_cap = 2572;
    this.added = 2115;
    this.powered_by = 2704;
    this.new_chat = 2934;
    this.questions = 2331;
    this.language = 2053;
    this.download_storage_option_device = 2160;
    this.down = 2407;
    this.size_limit = 2849;
    this.add_assignment_block_content_desc = 2882;
    this.repo_loading_status_failed_noconnection = 2285;
    this.you_are_already_in_class = 2709;
    this.entity_code = 2675;
    this.course_code = 2922;
    this.minimum_score = 2595;
    this.download_state_downloading = 2154;
    this.edit_enrolment = 2378;
    this.download_pause_download = 2159;
    this.languages_description = 2061;
    this.organization_id = 2567;
    this.view_clazz = 2811;
    this.number_active_users = 2195;
    this.content_from_file = 2097;
    this.school_code = 2674;
    this.select_account_to_continue = 2708;
    this.add_subject = 2760;
    this.waiting = 2086;
    this.feedback_hint = 2511;
    this.report_filter_edit_values = 2240;
    this.edit_clazz = 2324;
    this.back = 2033;
    this.add_new_clazz_to_school = 2821;
    this.title = 2102;
    this.licence_type_cc_by_nc = 2290;
    this.content = 2543;
    this.duration = 2362;
    this.class_timezone_set = 2870;
    this.terminology = 2898;
    this.lets_get_started_label = 2139;
    this.passed = 2090;
    this.just_want_to_browse = 2778;
    this.date_left = 2370;
    this.over = 2452;
    this.field_person_age = 2249;
    this.text_file_submission_error = 2945;
    this.permission = 2468;
    this.home = 2066;
    this.registration_allowed = 2686;
    this.field_required_prompt = 2127;
    this.schedule = 2302;
    this.location_permission_details = 2148;
    this.attendance_low_to_high = 2399;
    this.other_legal_guardian = 2728;
    this.licence_type_cc_by_nc_sa = 2291;
    this.alternatively_you_can_download_the_apk = 2803;
    this.current_password = 2519;
    this.remove_from = 2554;
    this.register_now = 2039;
    this.add_a_new_holiday_calendar = 2342;
    this.download_continue_btn_label = 2150;
    this.advanced = 2062;
    this.peers = 2857;
    this.number_of_groups = 2904;
    this.add_a_new_verb = 2245;
    this.marked_by = 2856;
    this.text = 2505;
    this.looks_like_installed_app_from_link = 2739;
    this.verb = 2244;
    this.loading = 2023;
    this.your_words_for = 2902;
    this.xapi_options_visual_type = 2224;
    this.condition_between = 2260;
    this.contents = 2074;
    this.xapi_options_report_title = 2223;
    this.messages = 2911;
    this.total_absences = 2200;
    this.status = 2547;
    this.share_application = 2081;
    this.permission_person_select = 2479;
    this.submitliteral = 2575;
    this.library = 2913;
    this.member = 2472;
    this.class_timezone = 2612;
    this.graded = 2866;
    this.download_state_downloaded = 2155;
    this.leaving_reasons = 2383;
    this.create_a_new_report = 2242;
    this.supported_link = 2279;
    this.percentage_complete = 2534;
    this.topics = 2908;
    this.limited_i_avoid_downloading_too_much = 2805;
    this.download_calculating = 2152;
    this.share_apk_file = 2762;
    this.hide = 2111;
    this.ebook = 2104;
    this.terms_and_policies = 2683;
    this.error_start_date_before_previous_enrolment_date = 2393;
    this.interaction_recorded = 2194;
    this.report = 2241;
    this.last_active = 2516;
    this.this_field_is_mandatory = 2665;
    this.repo_loading_status_loading_mirror = 2284;
    this.record_attendance = 2298;
    this.permission_person_update = 2481;
    this.created_partnership = 2137;
    this.please_download_the_app = 2802;
    this.add_content = 2545;
    this.no_submission_required = 2606;
    this.holiday_calendars_desc = 2433;
    this.add_from_contacts = 2796;
    this.current_status_consent_granted = 2757;
    this.uom_boolean_title = 2413;
    this.unset = 2051;
    this.posts = 2939;
    this.importing = 2752;
    this.download = 2011;
    this.view_class_content = 2730;
    this.error_start_date_before_clazz_date = 2392;
    this.please_enter_the_linK = 2692;
    this.downloading = 2085;
    this.rols_assignment = 2461;
    this.grade_out_of_range = 2951;
    this.limit = 2850;
    this.add_a_new_school = 2526;
    this.content_entry_export_inprogress = 2181;
    this.add_folder = 2751;
    this.add_a_reply = 2910;
    this.role_not_selected_error = 2663;
    this.late_submission = 2588;
    this.my = 2634;
    this.feed = 2296;
    this.entry = 2467;
    this.deadline_has_passed = 2957;
    this.present = 2311;
    this.errors = 2509;
    this.birthday = 2316;
    this.site_link = 2691;
    this.no = 2688;
    this.student = 2568;
    this.view_class_learning_records = 2732;
    this.view_school = 2819;
    this.mixed = 2538;
    this.delete = 2020;
    this.ignore_the_link = 2743;
    this.copied_to_clipboard = 2657;
    this.add_new_groups = 2906;
    this.select_leaving_reason = 2380;
    this.add_folder_description = 2755;
    this.ok = 2016;
    this.roles_and_permissions = 2644;
    this.select_country = 2758;
    this.allow_private_comments_from_students = 2610;
    this.or = 2693;
    this.total_attendances = 2199;
    this.last_three_months = 2423;
    this.content_usage_duration = 2702;
    this.take_new_photo_from_camera = 2558;
    this.total_lates = 2201;
    this.permission_role_insert = 2667;
    this.xapi_seconds = 2268;
    this.store_title = 2539;
    this.users_settings_desc = 2522;
    this.please_wait_for_approval = 2654;
    this.queued = 2088;
    this.about = 2029;
    this.invalid_email = 2705;
    this.condition_in_list = 2258;
    this.permission_clazz_asignment_edit = 2561;
    this.incorrect_current_password = 2638;
    this.share_via = 2761;
    this.select_content = 2799;
    this.dialog_download_from_playstore_ok = 2133;
    this.location_permission_message = 2147;
    this.content_editor_create_new_category = 2700;
    this.reviews_per_user_group = 2963;
    this.edit = 2321;
    this.yes_no = 2420;
    this.scope_description = 2647;
    this.module = 2878;
    this.invalid_link = 2275;
    this.xapi_options_series = 2226;
    this.accept = 2135;
    this.enrol_and_unenrol_students = 2813;
    this.content_average_duration = 2192;
    this.store_description_short = 2540;
    this.see_supported_sites = 2782;
    this.get_app = 2165;
    this.enter_link = 2759;
    this.processing = 2025;
    this.assign_random_reviewers = 2964;
    this.return_only = 2627;
    this.device = 2043;
    this.last_week_date_range = 2212;
    this.unassigned_error = 2958;
    this.register_incorrect_email = 2005;
    this.male = 2048;
    this.create_site = 2631;
    this.end_date = 2515;
    this.unique_content_users_over_time = 2835;
    this.add_a_new_course = 2928;
    this.saturday = 2356;
    this.activity = 2365;
    this.sel_question_set = 2434;
    this.unread = 2933;
    this.update_content = 2100;
    this.allowed_till_deadline = 2853;
    this.attendance_high_to_low = 2398;
    this.late_penalty = 2600;
    this.new_assignment = 2585;
    this.date_enroll = 2369;
    this.take_me_home = 2810;
    this.audio = 2109;
    this.onboarding_offline_sharing_subheading = 2143;
    this.relationship = 2721;
    this.email = 2064;
    this.change_photo = 2556;
    this.add_permission_for_a_group = 2745;
    this.permission_attendance_update = 2492;
    this.field_password_error_min = 2128;
    this.select_language = 2056;
    this.mark_all_absent = 2310;
    this.end_of_grace_period = 2591;
    this.mark_all_present = 2309;
    this.error_too_long_text = 2943;
    this.parental_consent = 2717;
    this.started = 2537;
    this.contact_details = 2569;
    this.reviewer = 2965;
    this.add_option = 2643;
    this.people = 2297;
    this.confirm = 2017;
    this.permission_person_picture_select = 2482;
    this.error_message_load_page = 2177;
    this.of_content = 2578;
    this.first_names = 2317;
    this.new_tab = 2022;
    this.total_number_of_classes = 2204;
    this.view_assignments = 2815;
    this.status_consent_granted = 2726;
    this.xapi_verb_header = 2269;
    this.to = 2336;
    this.open = 2084;
    this.country = 2441;
    this.workspace = 2628;
    this.error_message_update_document = 2178;
    this.add_another = 2635;
    this.edit_text = 2926;
    this.allowed_till_grace = 2854;
    this.add_private_comment = 2621;
    this.file_required_prompt = 2174;
    this.extra_active_tab_warning = 2841;
    this.frequency = 2419;
    this.adult_account_required = 2825;
    this.up = 2406;
    this.xapi_options_did = 2233;
    this.collection = 2106;
    this.edit_topic = 2938;
    this.not_answered = 2580;
    this.course_comments = 2917;
    this.report_filter_edit_condition = 2239;
    this.permission_attendance_select = 2490;
    this.add_group = 2923;
    this.uom_default_title = 2414;
    this.onboarding_stay_organized_headline = 2144;
    this.once = 2346;
    this.group_number = 2921;
    this.import_title_not_entered = 2272;
    this.yearly = 2349;
    this.preview = 2172;
    this.add_discussion_board_desc = 2884;
    this.unindent = 2888;
    this.file_not_found = 2170;
    this.licence_type_public_domain = 2292;
    this.father = 2314;
    this.pending = 2653;
    this.update = 2130;
    this.permission_school_insert = 2669;
    this.add_remove_and_modify_grades = 2790;
    this.condition_is_not = 2255;
    this.xapi_week = 2207;
    this.submission_type = 2605;
    this.restore_consent = 2725;
    this.previous = 2032;
    this.apply = 2429;
    this.download_summary_title = 2157;
    this.blank_report = 2826;
    this.xapi_options_where = 2236;
    this.sel_question_set_to_use = 2448;
    this.you_can_copypaste_a_link = 2781;
    this.new_password = 2040;
    this.location = 2422;
    this.class_code = 2651;
    this.dialog_download_from_playstore_message = 2132;
    this.measurement_type = 2418;
    this.view_basic_profile_of_members = 2817;
    this.selected_file_summary = 2839;
    this.this_class = 2785;
    this.type = 2801;
    this.add_a_new_language = 2054;
    this.permission_activity_insert = 2494;
    this.three_letter_code = 2060;
    this.download_locally_availability = 2161;
    this.edit_terminology = 2901;
    this.enable = 2282;
    this.permissions = 2469;
    this.revoke_consent = 2724;
    this.xapi_options_general = 2222;
    this.permission_person_insert = 2480;
    this.enrol_and_unenrol_teachers = 2814;
    this.attempts = 2116;
    this.compress = 2113;
    this.permission_clazz_add_teacher = 2488;
    this.permission_sel_question_insert = 2497;
    this.nothing_here = 2579;
    this.swipe_to_next = 2768;
    this.course_module = 2879;
    this.clazz_assignment = 2584;
    this.activity_import_link = 2265;
    this.late_submission_penalty = 2590;
    this.location_permission_title = 2146;
    this.group_activity = 2006;
    this.individual_submission = 2941;
    this.require_file_submission = 2846;
    this.notifications = 2078;
    this.xapi_month = 2208;
    this.time_range_all = 2237;
    this.publicly_accessible = 2101;
    this.xapi_content_entry = 2210;
    this.content_from_link = 2098;
    this.last_three_months_date_range = 2215;
    this.number_of_files = 2851;
    this.currently_enroled = 2918;
    this.features_enabled = 2344;
    this.class_comments = 2622;
    this.student_enrolment_policy = 2890;
    this.select_new_photo_from_gallery = 2559;
    this.your_account_needs_approved = 2824;
    this.parents_email_address = 2714;
    this.course = 2915;
    this.time_present = 2394;
    this.join_existing_course = 2929;
    this.underRegistrationAgeError = 2117;
    this.xapi_options_who = 2232;
    this.recommend_it = 2794;
    this.edit_group = 2924;
    this.invite_with_link = 2662;
    this.select_group_members = 2007;
    this.percent_students_attended_or_late = 2203;
    this.mark_penalty = 2589;
    this.filter = 2451;
    this.role_assignment = 2473;
    this.toggle_visibility = 2716;
    this.content_completion = 2829;
    this.wrong_user_pass_combo = 2009;
    this.not_submitted = 2603;
    this.site = 2690;
    this.download_all = 2030;
    this.full_i_can_download_as_much_as_i_like = 2804;
    this.content_usage_over_time = 2833;
    this.percent_students_attended = 2202;
    this.submission = 2616;
    this.how_did_it_go = 2363;
    this.record_attendance_for_most_recent_occurrence = 2680;
    this.first = 2305;
    this.date = 2425;
    this.student_marks_content = 2597;
    this.unassigned = 2942;
    this.permission_person_picture_update = 2484;
    this.maximum_points = 2871;
    this.descending = 2396;
    this.not_started = 2533;
    this.onboarding_no_internet_headline = 2140;
    this.i_do_not_consent = 2723;
    this.reports_and_analytics = 2916;
    this.uploading = 2026;
    this.content_creation_storage_option_title = 2173;
    this.from = 2220;
    this.mark_all = 2308;
    this.sort_by_name = 2366;
    this.submission_policy = 2949;
    this.password_unchanged = 2520;
    this.individual = 2843;
    this.repo_loading_status_loading_cloud = 2283;
    this.three_num_items_with_name_with_comma = 2624;
    this.active_classes = 2682;
    this.add_person_to_class = 2320;
    this.xapi_options_subgroup = 2230;
    this.store_description_full = 2541;
    this.failed = 2089;
    this.also_available_in = 2136;
    this.end_is_before_start_error = 2679;
    this.manage_download = 2703;
    this.add_gallery_description = 2119;
    this.preparing = 2124;
    this.record_for_student = 2677;
    this.person = 2476;
    this.parent_child_register_message = 2719;
    this.teacher_enrolment_policy = 2891;
    this.send = 2083;
    this.xapi_options_axes = 2227;
    this.submit_your_answer = 2619;
    this.error = 2002;
    this.add_a_new_class = 2323;
    this.edit_permissions = 2795;
    this.licence_type_all_rights = 2293;
    this.field_content_entry = 2251;
    this.add_a_class = 2325;
    this.your_username = 2798;
    this.remove_photo = 2557;
    this.groups = 2455;
    this.leaving_reason_manage = 2384;
    this.view_contact_details_of_members = 2733;
    this.tuesday = 2352;
    this.downloading_content = 2753;
    this.locations = 2463;
    this.add_person_filter = 2261;
    this.clazz = 2322;
    this.added_to_class_content = 2822;
  }
  MessageID.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'MessageID', 
  interfaces: []};
  var MessageID_instance = null;
  function MessageID_getInstance() {
    if (MessageID_instance === null) {
      new MessageID();
    }
    return MessageID_instance;
  }
  function AccountRegisterOptions(makeAccountActive, parentJoin) {
    if (makeAccountActive === void 0) 
      makeAccountActive = true;
    if (parentJoin === void 0) 
      parentJoin = null;
    this.makeAccountActive = makeAccountActive;
    this.parentJoin = parentJoin;
  }
  AccountRegisterOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'AccountRegisterOptions', 
  interfaces: []};
  AccountRegisterOptions.prototype.component1 = function() {
  return this.makeAccountActive;
};
  AccountRegisterOptions.prototype.component2 = function() {
  return this.parentJoin;
};
  AccountRegisterOptions.prototype.copy_pn825b$ = function(makeAccountActive, parentJoin) {
  return new AccountRegisterOptions(makeAccountActive === void 0 ? this.makeAccountActive : makeAccountActive, parentJoin === void 0 ? this.parentJoin : parentJoin);
};
  AccountRegisterOptions.prototype.toString = function() {
  return 'AccountRegisterOptions(makeAccountActive=' + Kotlin.toString(this.makeAccountActive) + (', parentJoin=' + Kotlin.toString(this.parentJoin)) + ')';
};
  AccountRegisterOptions.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.makeAccountActive) | 0;
  result = result * 31 + Kotlin.hashCode(this.parentJoin) | 0;
  return result;
};
  AccountRegisterOptions.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.makeAccountActive, other.makeAccountActive) && Kotlin.equals(this.parentJoin, other.parentJoin)))));
};
  function AdultAccountRequiredException(message, cause) {
    if (message === void 0) 
      message = null;
    if (cause === void 0) 
      cause = null;
    IllegalStateException.call(this, message, cause);
    this.name = 'AdultAccountRequiredException';
  }
  AdultAccountRequiredException.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'AdultAccountRequiredException', 
  interfaces: [IllegalStateException]};
  function AuthManager(endpoint, di) {
    this.di_2byzdw$_0 = di;
    var trigger;
    trigger = this.diTrigger;
    var tmp$;
    var tmp$_0;
    this.repo_vmewjz$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$ : throwCCE(), endpoint), trigger), Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_0 : throwCCE(), 2).provideDelegate_tpuvb9$(this, AuthManager$repo_metadata);
    var trigger_0;
    trigger_0 = this.diTrigger;
    var tmp$_1;
    var tmp$_2;
    this.db_2byzjx$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$_1 : throwCCE(), endpoint), trigger_0), Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_2 : throwCCE(), 1).provideDelegate_tpuvb9$(this, AuthManager$db_metadata);
    var tmp$_3;
    this.pbkdf2Params_e3wbvo$_0 = Instance(this, Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(Pbkdf2Params), [], false)), TypeToken) ? tmp$_3 : throwCCE(), null).provideDelegate_tpuvb9$(this, AuthManager$pbkdf2Params_metadata);
    this.site_0 = null;
  }
  Object.defineProperty(AuthManager.prototype, 'di', {
  get: function() {
  return this.di_2byzdw$_0;
}});
  var AuthManager$repo_metadata = new PropertyMetadata('repo');
  Object.defineProperty(AuthManager.prototype, 'repo_0', {
  configurable: true, 
  get: function() {
  return this.repo_vmewjz$_0.value;
}});
  var AuthManager$db_metadata = new PropertyMetadata('db');
  Object.defineProperty(AuthManager.prototype, 'db_0', {
  configurable: true, 
  get: function() {
  return this.db_2byzjx$_0.value;
}});
  var AuthManager$pbkdf2Params_metadata = new PropertyMetadata('pbkdf2Params');
  Object.defineProperty(AuthManager.prototype, 'pbkdf2Params_0', {
  configurable: true, 
  get: function() {
  return this.pbkdf2Params_e3wbvo$_0.value;
}});
  function Coroutine$getSite_0($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
  }
  Coroutine$getSite_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$getSite_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$getSite_0.prototype.constructor = Coroutine$getSite_0;
  Coroutine$getSite_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if ((tmp$ = this.$this.site_0) != null) {
          return tmp$;
        } else {
          this.state_0 = 2;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        this.result_0 = this.$this.repo_0.siteDao.getSiteAsync(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        tmp$_0 = this.result_0;
        if (tmp$_0 == null) {
          throw IllegalStateException_init('No site!');
        }
        var siteVal = tmp$_0;
        this.$this.site_0 = siteVal;
        return siteVal;
      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);
};
  AuthManager.prototype.getSite_0 = function(continuation_0, suspended) {
  var instance = new Coroutine$getSite_0(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$authenticate_qz9155$($this, username_0, password_0, fallbackToOldPersonAuth_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$_3 = void 0;
    this.local$authSalt = void 0;
    this.local$passwordDoubleHashed = void 0;
    this.local$authorizedPerson = void 0;
    this.local$person = void 0;
    this.local$username = username_0;
    this.local$password = password_0;
    this.local$fallbackToOldPersonAuth = fallbackToOldPersonAuth_0;
  }
  Coroutine$authenticate_qz9155$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$authenticate_qz9155$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$authenticate_qz9155$.prototype.constructor = Coroutine$authenticate_qz9155$;
  Coroutine$authenticate_qz9155$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$fallbackToOldPersonAuth === void 0) 
          this.local$fallbackToOldPersonAuth = false;
        var tmp$, tmp$_0, tmp$_1, tmp$_2;
        var tmp$_3, tmp$_4, tmp$_5, tmp$_6, tmp$_7, tmp$_8;
        this.state_0 = 2;
        this.result_0 = this.$this.repo_0.siteDao.getSiteAsync(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        tmp$ = this.result_0;
        if (tmp$ == null) {
          throw IllegalStateException_init('No site!');
        }
        var site = tmp$;
        tmp$_0 = site.authSalt;
        if (tmp$_0 == null) {
          throw IllegalStateException_init('No auth salt!');
        }
        this.local$authSalt = tmp$_0;
        this.local$passwordDoubleHashed = doublePbkdf2Hash(this.local$password, this.local$authSalt, this.$this.pbkdf2Params_0);
        this.state_0 = 3;
        this.result_0 = this.$this.repo_0.personAuth2Dao.findByUsername_61zpoe$(this.local$username, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var personAuth2 = this.result_0;
        var authMatch = contentEquals((tmp$_1 = personAuth2 != null ? personAuth2.pauthAuth : null) != null ? base64StringToByteArray(tmp$_1) : null, this.local$passwordDoubleHashed);
        if (authMatch) {
          this.state_0 = 4;
          this.result_0 = this.$this.repo_0.personDao.findByUidAsync_s8cxhz$((tmp$_2 = personAuth2 != null ? personAuth2.pauthUid : null) != null ? tmp$_2 : L0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.local$tmp$_3 = null;
          this.state_0 = 5;
          continue;
        }
      case 4:
        this.local$tmp$_3 = this.result_0;
        this.state_0 = 5;
        continue;
      case 5:
        this.local$authorizedPerson = this.local$tmp$_3;
        if (this.local$authorizedPerson == null && this.local$fallbackToOldPersonAuth) {
          this.state_0 = 6;
          this.result_0 = this.$this.db_0.personDao.findUidAndPasswordHashAsync_61zpoe$(this.local$username, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 10;
          continue;
        }
      case 6:
        this.local$person = this.result_0;
        if (this.local$person != null) {
          var tmp$_9 = ((tmp$_3 = this.local$person.passwordHash) != null ? startsWith(tmp$_3, PersonAuthDao.Companion.PLAIN_PASS_PREFIX) : null) === true;
          if (tmp$_9) {
            tmp$_9 = equals((tmp$_4 = this.local$person.passwordHash) != null ? tmp$_4.substring(2) : null, this.local$password);
          }
          tmp$_8 = !tmp$_9 ? ((tmp$_5 = this.local$person.passwordHash) != null ? startsWith(tmp$_5, PersonAuthDao.Companion.ENCRYPTED_PASS_PREFIX) : null) === true ? authenticateEncryptedPassword(this.local$password, (tmp$_7 = (tmp$_6 = this.local$person.passwordHash) != null ? tmp$_6.substring(2) : null) != null ? tmp$_7 : '') : false : true;
        } else 
          tmp$_8 = false;
        if (tmp$_8) {
          this.state_0 = 7;
          this.result_0 = this.$this.db_0.personDao.findByUidAsync_s8cxhz$(this.local$person.personUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 9;
          continue;
        }
      case 7:
        this.local$authorizedPerson = this.result_0;
        var tmp$_10 = this.$this.repo_0.personAuth2Dao;
        var $receiver = new PersonAuth2();
        $receiver.pauthUid = this.local$person.personUid;
        $receiver.pauthMechanism = PersonAuth2.Companion.AUTH_MECH_PBKDF2_DOUBLE;
        $receiver.pauthAuth = encodeBase64(doublePbkdf2Hash(this.local$password, this.local$authSalt, this.$this.pbkdf2Params_0));
        this.state_0 = 8;
        this.result_0 = tmp$_10.insertAsync_j8byhd$($receiver, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 8:
        this.state_0 = 9;
        continue;
      case 9:
        this.state_0 = 10;
        continue;
      case 10:
        if (this.local$authorizedPerson != null && age(DateTime.Companion.invoke_s8cxhz$(this.local$authorizedPerson.dateOfBirth)) < UstadMobileConstants_getInstance().MINOR_AGE_THRESHOLD) {
          this.state_0 = 11;
          this.result_0 = this.$this.db_0.personParentJoinDao.findByMinorPersonUid_s8cxhz$(this.local$authorizedPerson.personUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 13;
          continue;
        }
      case 11:
        var parentJoins = this.result_0;
        var any$result;
        any$break:
          do {
            var tmp$_11;
            if (Kotlin.isType(parentJoins, Collection) && parentJoins.isEmpty()) {
              any$result = false;
              break any$break;
            }
            tmp$_11 = parentJoins.iterator();
            while (tmp$_11.hasNext()) {
              var element = tmp$_11.next();
              if (element.ppjStatus === 1) {
                any$result = true;
                break any$break;
              }
            }
            any$result = false;
          } while (false);
        if (!any$result) {
          return new AuthResult(null, false, 1);
        } else {
          this.state_0 = 12;
          continue;
        }
      case 12:
        this.state_0 = 13;
        continue;
      case 13:
        return new AuthResult(this.local$authorizedPerson, this.local$authorizedPerson != null);
      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);
};
  AuthManager.prototype.authenticate_qz9155$ = function(username_0, password_0, fallbackToOldPersonAuth_0, continuation_0, suspended) {
  var instance = new Coroutine$authenticate_qz9155$(this, username_0, password_0, fallbackToOldPersonAuth_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$setAuth_a4hdmt$($this, personUid_0, password_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$ = void 0;
    this.local$tmp$_0 = void 0;
    this.local$personUid = personUid_0;
    this.local$password = password_0;
  }
  Coroutine$setAuth_a4hdmt$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$setAuth_a4hdmt$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$setAuth_a4hdmt$.prototype.constructor = Coroutine$setAuth_a4hdmt$;
  Coroutine$setAuth_a4hdmt$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$tmp$_0 = this.$this.repo_0;
        this.local$tmp$ = this.$this.pbkdf2Params_0;
        this.state_0 = 2;
        this.result_0 = this.$this.getSite_0(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        this.result_0 = insertPersonAuthCredentials2(this.local$tmp$_0, this.local$personUid, this.local$password, this.local$tmp$, this.result_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        return;
      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);
};
  AuthManager.prototype.setAuth_a4hdmt$ = function(personUid_0, password_0, continuation_0, suspended) {
  var instance = new Coroutine$setAuth_a4hdmt$(this, personUid_0, password_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  AuthManager.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'AuthManager', 
  interfaces: [DIAware]};
  function AuthResult(authenticatedPerson, success, reason) {
    AuthResult$Companion_getInstance();
    if (authenticatedPerson === void 0) 
      authenticatedPerson = null;
    if (success === void 0) 
      success = false;
    if (reason === void 0) 
      reason = 0;
    this.authenticatedPerson = authenticatedPerson;
    this.success = success;
    this.reason = reason;
  }
  function AuthResult$Companion() {
    AuthResult$Companion_instance = this;
    this.REASON_NEEDS_CONSENT = 1;
  }
  AuthResult$Companion.prototype.serializer = function() {
  return AuthResult$$serializer_getInstance();
};
  AuthResult$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var AuthResult$Companion_instance = null;
  function AuthResult$Companion_getInstance() {
    if (AuthResult$Companion_instance === null) {
      new AuthResult$Companion();
    }
    return AuthResult$Companion_instance;
  }
  function AuthResult$$serializer() {
    this.descriptor_gfqjom$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.account.AuthResult', this, 3);
    this.descriptor.addElement_ivxn3r$('authenticatedPerson', true);
    this.descriptor.addElement_ivxn3r$('success', true);
    this.descriptor.addElement_ivxn3r$('reason', true);
    AuthResult$$serializer_instance = this;
  }
  Object.defineProperty(AuthResult$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_gfqjom$_0;
}});
  AuthResult$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  if (!equals(value.authenticatedPerson, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 0)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 0, Person.$serializer, value.authenticatedPerson);
  if (!equals(value.success, false) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 1)) 
    output.encodeBooleanElement_qh7jdn$(this.descriptor, 1, value.success);
  if (!equals(value.reason, 0) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 2)) 
    output.encodeIntElement_ptg7oe$(this.descriptor, 2, value.reason);
  output.endStructure_24f42q$(this.descriptor);
};
  AuthResult$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1, local2;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 0, Person.$serializer, local0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeBooleanElement_szpzho$(this.descriptor, 1);
          bitMask0 |= 2;
          break;
        case 2:
          local2 = input.decodeIntElement_szpzho$(this.descriptor, 2);
          bitMask0 |= 4;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return AuthResult_init(bitMask0, local0, local1, local2, null);
};
  AuthResult$$serializer.prototype.childSerializers = function() {
  return [new NullableSerializer(Person.$serializer), internal.BooleanSerializer, internal.IntSerializer];
};
  AuthResult$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var AuthResult$$serializer_instance = null;
  function AuthResult$$serializer_getInstance() {
    if (AuthResult$$serializer_instance === null) {
      new AuthResult$$serializer();
    }
    return AuthResult$$serializer_instance;
  }
  function AuthResult_init(seen1, authenticatedPerson, success, reason, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(AuthResult.prototype);
    if ((seen1 & 1) === 0) 
      $this.authenticatedPerson = null;
    else 
      $this.authenticatedPerson = authenticatedPerson;
    if ((seen1 & 2) === 0) 
      $this.success = false;
    else 
      $this.success = success;
    if ((seen1 & 4) === 0) 
      $this.reason = 0;
    else 
      $this.reason = reason;
    return $this;
  }
  AuthResult.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'AuthResult', 
  interfaces: []};
  AuthResult.prototype.component1 = function() {
  return this.authenticatedPerson;
};
  AuthResult.prototype.component2 = function() {
  return this.success;
};
  AuthResult.prototype.component3 = function() {
  return this.reason;
};
  AuthResult.prototype.copy_lzj6qz$ = function(authenticatedPerson, success, reason) {
  return new AuthResult(authenticatedPerson === void 0 ? this.authenticatedPerson : authenticatedPerson, success === void 0 ? this.success : success, reason === void 0 ? this.reason : reason);
};
  AuthResult.prototype.toString = function() {
  return 'AuthResult(authenticatedPerson=' + Kotlin.toString(this.authenticatedPerson) + (', success=' + Kotlin.toString(this.success)) + (', reason=' + Kotlin.toString(this.reason)) + ')';
};
  AuthResult.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.authenticatedPerson) | 0;
  result = result * 31 + Kotlin.hashCode(this.success) | 0;
  result = result * 31 + Kotlin.hashCode(this.reason) | 0;
  return result;
};
  AuthResult.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.authenticatedPerson, other.authenticatedPerson) && Kotlin.equals(this.success, other.success) && Kotlin.equals(this.reason, other.reason)))));
};
  function ClientId(id) {
    this.id = id;
  }
  ClientId.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClientId', 
  interfaces: []};
  ClientId.prototype.component1 = function() {
  return this.id;
};
  ClientId.prototype.copy_za3lpa$ = function(id) {
  return new ClientId(id === void 0 ? this.id : id);
};
  ClientId.prototype.toString = function() {
  return 'ClientId(id=' + Kotlin.toString(this.id) + ')';
};
  ClientId.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.id) | 0;
  return result;
};
  ClientId.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && Kotlin.equals(this.id, other.id))));
};
  function ConsentNotGrantedException(message, cause) {
    if (message === void 0) 
      message = null;
    if (cause === void 0) 
      cause = null;
    IllegalStateException.call(this, message, cause);
    this.name = 'ConsentNotGrantedException';
  }
  ConsentNotGrantedException.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ConsentNotGrantedException', 
  interfaces: [IllegalStateException]};
  function EndSessionParentChildJoinSyncListener(repo) {
    this.repo_0 = repo;
  }
  function Coroutine$EndSessionParentChildJoinSyncListener$onEntitiesReceived$lambda(closure$consentRevokedChildPersonUidList_0, this$EndSessionParentChildJoinSyncListener_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$consentRevokedChildPersonUidList = closure$consentRevokedChildPersonUidList_0;
    this.local$this$EndSessionParentChildJoinSyncListener = this$EndSessionParentChildJoinSyncListener_0;
    this.local$tmp$ = void 0;
  }
  Coroutine$EndSessionParentChildJoinSyncListener$onEntitiesReceived$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$EndSessionParentChildJoinSyncListener$onEntitiesReceived$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$EndSessionParentChildJoinSyncListener$onEntitiesReceived$lambda.prototype.constructor = Coroutine$EndSessionParentChildJoinSyncListener$onEntitiesReceived$lambda;
  Coroutine$EndSessionParentChildJoinSyncListener$onEntitiesReceived$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$tmp$ = this.local$closure$consentRevokedChildPersonUidList.iterator();
        this.state_0 = 2;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 4;
          continue;
        }
        var element = this.local$tmp$.next();
        this.state_0 = 3;
        this.result_0 = this.local$this$EndSessionParentChildJoinSyncListener.repo_0.userSessionDao.endOtherSessions_d2c2sj$(element, L0, 4, 2, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.state_0 = 2;
        continue;
      case 4:
        return Unit;
      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 EndSessionParentChildJoinSyncListener$onEntitiesReceived$lambda(closure$consentRevokedChildPersonUidList_0, this$EndSessionParentChildJoinSyncListener_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$EndSessionParentChildJoinSyncListener$onEntitiesReceived$lambda(closure$consentRevokedChildPersonUidList_0, this$EndSessionParentChildJoinSyncListener_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  EndSessionParentChildJoinSyncListener.prototype.onEntitiesReceived_3fo5k2$ = function(evt) {
  var tmp$;
  var $receiver = evt.entitiesReceived;
  var destination = ArrayList_init();
  var tmp$_0;
  tmp$_0 = $receiver.iterator();
  while (tmp$_0.hasNext()) {
    var element = tmp$_0.next();
    if (!equals(element.ppjParentPersonUid, L0) && element.ppjStatus !== 1) 
      destination.add_11rb$(element);
  }
  var destination_0 = ArrayList_init_0(collectionSizeOrDefault(destination, 10));
  var tmp$_1;
  tmp$_1 = destination.iterator();
  while (tmp$_1.hasNext()) {
    var item = tmp$_1.next();
    destination_0.add_11rb$(item.ppjMinorPersonUid);
  }
  var consentRevokedChildPersonUidList = destination_0;
  var $receiver_0 = coroutines.GlobalScope;
    (tmp$ = !consentRevokedChildPersonUidList.isEmpty() ? $receiver_0 : null) != null ? launch(tmp$, void 0, void 0, EndSessionParentChildJoinSyncListener$onEntitiesReceived$lambda(consentRevokedChildPersonUidList, this)) : null;
};
  EndSessionParentChildJoinSyncListener.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'EndSessionParentChildJoinSyncListener', 
  interfaces: [SyncListener]};
  function EndSessionPersonAuth2IncomingReplicationListener(db) {
    this.db_0 = db;
  }
  function Coroutine$EndSessionPersonAuth2IncomingReplicationListener$onIncomingReplicationProcessed$lambda(closure$incomingReplicationEvent_0, txDb_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$incomingReplicationEvent = closure$incomingReplicationEvent_0;
    this.local$tmp$ = void 0;
    this.local$element = void 0;
    this.local$tmp$_2 = void 0;
    this.local$tmp$_5 = void 0;
    this.local$jsonObj = void 0;
    this.local$authUid = void 0;
    this.local$txDb = txDb_0;
  }
  Coroutine$EndSessionPersonAuth2IncomingReplicationListener$onIncomingReplicationProcessed$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$EndSessionPersonAuth2IncomingReplicationListener$onIncomingReplicationProcessed$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$EndSessionPersonAuth2IncomingReplicationListener$onIncomingReplicationProcessed$lambda.prototype.constructor = Coroutine$EndSessionPersonAuth2IncomingReplicationListener$onIncomingReplicationProcessed$lambda;
  Coroutine$EndSessionPersonAuth2IncomingReplicationListener$onIncomingReplicationProcessed$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$tmp$ = this.local$closure$incomingReplicationEvent.incomingReplicationData.iterator();
        this.state_0 = 2;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 8;
          continue;
        }
        this.local$element = this.local$tmp$.next();
        this.state_0 = 3;
        continue;
      case 3:
        var tmp$, tmp$_0;
        var tmp$_1, tmp$_2;
        this.local$jsonObj = get_jsonObject(this.local$element);
        this.local$tmp$_2 = (tmp$_0 = (tmp$ = this.local$jsonObj.get_11rb$('pauthUid')) != null ? get_jsonPrimitive(tmp$) : null) != null ? get_long(tmp$_0) : null;
        if (this.local$tmp$_2 == null) {
          this.state_0 = 7;
          continue;
        } else {
          this.state_0 = 4;
          continue;
        }
      case 4:
        this.local$authUid = this.local$tmp$_2;
        this.local$tmp$_5 = (tmp$_2 = (tmp$_1 = this.local$jsonObj.get_11rb$('pauthLcb')) != null ? get_jsonPrimitive(tmp$_1) : null) != null ? get_long(tmp$_2) : null;
        if (this.local$tmp$_5 == null) {
          this.state_0 = 7;
          continue;
        } else {
          this.state_0 = 5;
          continue;
        }
      case 5:
        var pauthLcb = this.local$tmp$_5;
        napier.Napier.i_82mfvz$('PersonAuth changed: end other sessions for Person uid ' + this.local$authUid.toString() + (' except from node id ' + pauthLcb.toString() + ' (where password was changed)'));
        this.state_0 = 6;
        this.result_0 = this.local$txDb.userSessionDao.endOtherSessions_d2c2sj$(this.local$authUid, pauthLcb, 2, 3, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 6:
        var numSessionsEnded = this.result_0;
        if (!false) {
          this.state_0 = 7;
          continue;
        }
        this.state_0 = 3;
        continue;
      case 7:
        this.state_0 = 2;
        continue;
      case 8:
        return Unit;
      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 EndSessionPersonAuth2IncomingReplicationListener$onIncomingReplicationProcessed$lambda(closure$incomingReplicationEvent_0) {
    return function(txDb_0, continuation_0, suspended) {
  var instance = new Coroutine$EndSessionPersonAuth2IncomingReplicationListener$onIncomingReplicationProcessed$lambda(closure$incomingReplicationEvent_0, txDb_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onIncomingReplicationProcessed_hioxzo$($this, incomingReplicationEvent_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$incomingReplicationEvent = incomingReplicationEvent_0;
  }
  Coroutine$onIncomingReplicationProcessed_hioxzo$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onIncomingReplicationProcessed_hioxzo$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onIncomingReplicationProcessed_hioxzo$.prototype.constructor = Coroutine$onIncomingReplicationProcessed_hioxzo$;
  Coroutine$onIncomingReplicationProcessed_hioxzo$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$incomingReplicationEvent.tableId !== 678) {
          return;
        } else {
          this.state_0 = 2;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        this.result_0 = withDoorTransactionAsync(this.$this.db_0, getKClass(UmAppDatabase), EndSessionPersonAuth2IncomingReplicationListener$onIncomingReplicationProcessed$lambda(this.local$incomingReplicationEvent), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        return;
      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);
};
  EndSessionPersonAuth2IncomingReplicationListener.prototype.onIncomingReplicationProcessed_hioxzo$ = function(incomingReplicationEvent_0, continuation_0, suspended) {
  var instance = new Coroutine$onIncomingReplicationProcessed_hioxzo$(this, incomingReplicationEvent_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  EndSessionPersonAuth2IncomingReplicationListener.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'EndSessionPersonAuth2IncomingReplicationListener', 
  interfaces: [IncomingReplicationListener]};
  function Endpoint(url) {
    Endpoint$Companion_getInstance();
    this.url = url;
  }
  function Endpoint$Companion() {
    Endpoint$Companion_instance = this;
  }
  Endpoint$Companion.prototype.serializer = function() {
  return Endpoint$$serializer_getInstance();
};
  Endpoint$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var Endpoint$Companion_instance = null;
  function Endpoint$Companion_getInstance() {
    if (Endpoint$Companion_instance === null) {
      new Endpoint$Companion();
    }
    return Endpoint$Companion_instance;
  }
  function Endpoint$$serializer() {
    this.descriptor_rlzzpm$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.account.Endpoint', this, 1);
    this.descriptor.addElement_ivxn3r$('url', false);
    Endpoint$$serializer_instance = this;
  }
  Object.defineProperty(Endpoint$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_rlzzpm$_0;
}});
  Endpoint$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  output.encodeStringElement_iij8qq$(this.descriptor, 0, value.url);
  output.endStructure_24f42q$(this.descriptor);
};
  Endpoint$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeStringElement_szpzho$(this.descriptor, 0);
          bitMask0 |= 1;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return Endpoint_init(bitMask0, local0, null);
};
  Endpoint$$serializer.prototype.childSerializers = function() {
  return [internal.StringSerializer];
};
  Endpoint$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var Endpoint$$serializer_instance = null;
  function Endpoint$$serializer_getInstance() {
    if (Endpoint$$serializer_instance === null) {
      new Endpoint$$serializer();
    }
    return Endpoint$$serializer_instance;
  }
  function Endpoint_init(seen1, url, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(Endpoint.prototype);
    if ((seen1 & 1) === 0) 
      throw MissingFieldException_init('url');
    else 
      $this.url = url;
    return $this;
  }
  Endpoint.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Endpoint', 
  interfaces: []};
  Endpoint.prototype.component1 = function() {
  return this.url;
};
  Endpoint.prototype.copy_61zpoe$ = function(url) {
  return new Endpoint(url === void 0 ? this.url : url);
};
  Endpoint.prototype.toString = function() {
  return 'Endpoint(url=' + Kotlin.toString(this.url) + ')';
};
  Endpoint.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.url) | 0;
  return result;
};
  Endpoint.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && Kotlin.equals(this.url, other.url))));
};
  function EndpointScope() {
    EndpointScope$Companion_getInstance();
    this.activeEndpoints_0 = LinkedHashMap_init();
  }
  Object.defineProperty(EndpointScope.prototype, 'activeEndpointUrls', {
  configurable: true, 
  get: function() {
  return this.activeEndpoints_0.keys;
}});
  EndpointScope.prototype.getRegistry_11rb$ = function(context) {
  var $receiver = this.activeEndpoints_0;
  var key = context.url;
  var tmp$;
  var value = $receiver.get_11rb$(key);
  if (value == null) {
    var answer = new StandardScopeRegistry();
    $receiver.put_xwzc9p$(key, answer);
    tmp$ = answer;
  } else {
    tmp$ = value;
  }
  return tmp$;
};
  function EndpointScope$Companion() {
    EndpointScope$Companion_instance = this;
    this.Default = new EndpointScope();
  }
  EndpointScope$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var EndpointScope$Companion_instance = null;
  function EndpointScope$Companion_getInstance() {
    if (EndpointScope$Companion_instance === null) {
      new EndpointScope$Companion();
    }
    return EndpointScope$Companion_instance;
  }
  EndpointScope.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'EndpointScope', 
  interfaces: [Scope]};
  function Pbkdf2Params(iterations, keyLength) {
    if (iterations === void 0) 
      iterations = 10000;
    if (keyLength === void 0) 
      keyLength = 512;
    this.iterations = iterations;
    this.keyLength = keyLength;
  }
  Pbkdf2Params.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Pbkdf2Params', 
  interfaces: []};
  Pbkdf2Params.prototype.component1 = function() {
  return this.iterations;
};
  Pbkdf2Params.prototype.component2 = function() {
  return this.keyLength;
};
  Pbkdf2Params.prototype.copy_vux9f0$ = function(iterations, keyLength) {
  return new Pbkdf2Params(iterations === void 0 ? this.iterations : iterations, keyLength === void 0 ? this.keyLength : keyLength);
};
  Pbkdf2Params.prototype.toString = function() {
  return 'Pbkdf2Params(iterations=' + Kotlin.toString(this.iterations) + (', keyLength=' + Kotlin.toString(this.keyLength)) + ')';
};
  Pbkdf2Params.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.iterations) | 0;
  result = result * 31 + Kotlin.hashCode(this.keyLength) | 0;
  return result;
};
  Pbkdf2Params.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.iterations, other.iterations) && Kotlin.equals(this.keyLength, other.keyLength)))));
};
  function RegisterRequest(person, parent, endpointUrl, langCode) {
    RegisterRequest$Companion_getInstance();
    if (langCode === void 0) 
      langCode = 'en';
    this.person = person;
    this.parent = parent;
    this.endpointUrl = endpointUrl;
    this.langCode = langCode;
  }
  function RegisterRequest$Companion() {
    RegisterRequest$Companion_instance = this;
  }
  RegisterRequest$Companion.prototype.serializer = function() {
  return RegisterRequest$$serializer_getInstance();
};
  RegisterRequest$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var RegisterRequest$Companion_instance = null;
  function RegisterRequest$Companion_getInstance() {
    if (RegisterRequest$Companion_instance === null) {
      new RegisterRequest$Companion();
    }
    return RegisterRequest$Companion_instance;
  }
  function RegisterRequest$$serializer() {
    this.descriptor_cg36v5$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.account.RegisterRequest', this, 4);
    this.descriptor.addElement_ivxn3r$('person', false);
    this.descriptor.addElement_ivxn3r$('parent', false);
    this.descriptor.addElement_ivxn3r$('endpointUrl', false);
    this.descriptor.addElement_ivxn3r$('langCode', true);
    RegisterRequest$$serializer_instance = this;
  }
  Object.defineProperty(RegisterRequest$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_cg36v5$_0;
}});
  RegisterRequest$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  output.encodeSerializableElement_r4qlx7$(this.descriptor, 0, PersonWithAccount.$serializer, value.person);
  output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 1, PersonParentJoin.$serializer, value.parent);
  output.encodeStringElement_iij8qq$(this.descriptor, 2, value.endpointUrl);
  if (!equals(value.langCode, 'en') || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 3)) 
    output.encodeStringElement_iij8qq$(this.descriptor, 3, value.langCode);
  output.endStructure_24f42q$(this.descriptor);
};
  RegisterRequest$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1, local2, local3;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeSerializableElement_12e8id$(this.descriptor, 0, PersonWithAccount.$serializer, local0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 1, PersonParentJoin.$serializer, local1);
          bitMask0 |= 2;
          break;
        case 2:
          local2 = input.decodeStringElement_szpzho$(this.descriptor, 2);
          bitMask0 |= 4;
          break;
        case 3:
          local3 = input.decodeStringElement_szpzho$(this.descriptor, 3);
          bitMask0 |= 8;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return RegisterRequest_init(bitMask0, local0, local1, local2, local3, null);
};
  RegisterRequest$$serializer.prototype.childSerializers = function() {
  return [PersonWithAccount.$serializer, new NullableSerializer(PersonParentJoin.$serializer), internal.StringSerializer, internal.StringSerializer];
};
  RegisterRequest$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var RegisterRequest$$serializer_instance = null;
  function RegisterRequest$$serializer_getInstance() {
    if (RegisterRequest$$serializer_instance === null) {
      new RegisterRequest$$serializer();
    }
    return RegisterRequest$$serializer_instance;
  }
  function RegisterRequest_init(seen1, person, parent, endpointUrl, langCode, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(RegisterRequest.prototype);
    if ((seen1 & 1) === 0) 
      throw MissingFieldException_init('person');
    else 
      $this.person = person;
    if ((seen1 & 2) === 0) 
      throw MissingFieldException_init('parent');
    else 
      $this.parent = parent;
    if ((seen1 & 4) === 0) 
      throw MissingFieldException_init('endpointUrl');
    else 
      $this.endpointUrl = endpointUrl;
    if ((seen1 & 8) === 0) 
      $this.langCode = 'en';
    else 
      $this.langCode = langCode;
    return $this;
  }
  RegisterRequest.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'RegisterRequest', 
  interfaces: []};
  RegisterRequest.prototype.component1 = function() {
  return this.person;
};
  RegisterRequest.prototype.component2 = function() {
  return this.parent;
};
  RegisterRequest.prototype.component3 = function() {
  return this.endpointUrl;
};
  RegisterRequest.prototype.component4 = function() {
  return this.langCode;
};
  RegisterRequest.prototype.copy_f9tc6k$ = function(person, parent, endpointUrl, langCode) {
  return new RegisterRequest(person === void 0 ? this.person : person, parent === void 0 ? this.parent : parent, endpointUrl === void 0 ? this.endpointUrl : endpointUrl, langCode === void 0 ? this.langCode : langCode);
};
  RegisterRequest.prototype.toString = function() {
  return 'RegisterRequest(person=' + Kotlin.toString(this.person) + (', parent=' + Kotlin.toString(this.parent)) + (', endpointUrl=' + Kotlin.toString(this.endpointUrl)) + (', langCode=' + Kotlin.toString(this.langCode)) + ')';
};
  RegisterRequest.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.person) | 0;
  result = result * 31 + Kotlin.hashCode(this.parent) | 0;
  result = result * 31 + Kotlin.hashCode(this.endpointUrl) | 0;
  result = result * 31 + Kotlin.hashCode(this.langCode) | 0;
  return result;
};
  RegisterRequest.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.person, other.person) && Kotlin.equals(this.parent, other.parent) && Kotlin.equals(this.endpointUrl, other.endpointUrl) && Kotlin.equals(this.langCode, other.langCode)))));
};
  function UnauthorizedException(message, cause) {
    if (message === void 0) 
      message = null;
    if (cause === void 0) 
      cause = null;
    IllegalStateException.call(this, message, cause);
    this.name = 'UnauthorizedException';
  }
  UnauthorizedException.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UnauthorizedException', 
  interfaces: [IllegalStateException]};
  function UserSessionWithPersonAndEndpoint(userSession, person, endpoint) {
    UserSessionWithPersonAndEndpoint$Companion_getInstance();
    this.userSession = userSession;
    this.person = person;
    this.endpoint = endpoint;
  }
  UserSessionWithPersonAndEndpoint.prototype.toUmAccount = function() {
  return toUmAccount(this.person, this.endpoint.url);
};
  function UserSessionWithPersonAndEndpoint$Companion() {
    UserSessionWithPersonAndEndpoint$Companion_instance = this;
  }
  UserSessionWithPersonAndEndpoint$Companion.prototype.serializer = function() {
  return UserSessionWithPersonAndEndpoint$$serializer_getInstance();
};
  UserSessionWithPersonAndEndpoint$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var UserSessionWithPersonAndEndpoint$Companion_instance = null;
  function UserSessionWithPersonAndEndpoint$Companion_getInstance() {
    if (UserSessionWithPersonAndEndpoint$Companion_instance === null) {
      new UserSessionWithPersonAndEndpoint$Companion();
    }
    return UserSessionWithPersonAndEndpoint$Companion_instance;
  }
  function UserSessionWithPersonAndEndpoint$$serializer() {
    this.descriptor_8i84at$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.account.UserSessionWithPersonAndEndpoint', this, 3);
    this.descriptor.addElement_ivxn3r$('userSession', false);
    this.descriptor.addElement_ivxn3r$('person', false);
    this.descriptor.addElement_ivxn3r$('endpoint', false);
    UserSessionWithPersonAndEndpoint$$serializer_instance = this;
  }
  Object.defineProperty(UserSessionWithPersonAndEndpoint$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_8i84at$_0;
}});
  UserSessionWithPersonAndEndpoint$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  output.encodeSerializableElement_r4qlx7$(this.descriptor, 0, UserSession.$serializer, value.userSession);
  output.encodeSerializableElement_r4qlx7$(this.descriptor, 1, Person.$serializer, value.person);
  output.encodeSerializableElement_r4qlx7$(this.descriptor, 2, Endpoint$$serializer_getInstance(), value.endpoint);
  output.endStructure_24f42q$(this.descriptor);
};
  UserSessionWithPersonAndEndpoint$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1, local2;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeSerializableElement_12e8id$(this.descriptor, 0, UserSession.$serializer, local0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeSerializableElement_12e8id$(this.descriptor, 1, Person.$serializer, local1);
          bitMask0 |= 2;
          break;
        case 2:
          local2 = input.decodeSerializableElement_12e8id$(this.descriptor, 2, Endpoint$$serializer_getInstance(), local2);
          bitMask0 |= 4;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return UserSessionWithPersonAndEndpoint_init(bitMask0, local0, local1, local2, null);
};
  UserSessionWithPersonAndEndpoint$$serializer.prototype.childSerializers = function() {
  return [UserSession.$serializer, Person.$serializer, Endpoint$$serializer_getInstance()];
};
  UserSessionWithPersonAndEndpoint$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var UserSessionWithPersonAndEndpoint$$serializer_instance = null;
  function UserSessionWithPersonAndEndpoint$$serializer_getInstance() {
    if (UserSessionWithPersonAndEndpoint$$serializer_instance === null) {
      new UserSessionWithPersonAndEndpoint$$serializer();
    }
    return UserSessionWithPersonAndEndpoint$$serializer_instance;
  }
  function UserSessionWithPersonAndEndpoint_init(seen1, userSession, person, endpoint, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(UserSessionWithPersonAndEndpoint.prototype);
    if ((seen1 & 1) === 0) 
      throw MissingFieldException_init('userSession');
    else 
      $this.userSession = userSession;
    if ((seen1 & 2) === 0) 
      throw MissingFieldException_init('person');
    else 
      $this.person = person;
    if ((seen1 & 4) === 0) 
      throw MissingFieldException_init('endpoint');
    else 
      $this.endpoint = endpoint;
    return $this;
  }
  UserSessionWithPersonAndEndpoint.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UserSessionWithPersonAndEndpoint', 
  interfaces: []};
  UserSessionWithPersonAndEndpoint.prototype.component1 = function() {
  return this.userSession;
};
  UserSessionWithPersonAndEndpoint.prototype.component2 = function() {
  return this.person;
};
  UserSessionWithPersonAndEndpoint.prototype.component3 = function() {
  return this.endpoint;
};
  UserSessionWithPersonAndEndpoint.prototype.copy_q9g4e3$ = function(userSession, person, endpoint) {
  return new UserSessionWithPersonAndEndpoint(userSession === void 0 ? this.userSession : userSession, person === void 0 ? this.person : person, endpoint === void 0 ? this.endpoint : endpoint);
};
  UserSessionWithPersonAndEndpoint.prototype.toString = function() {
  return 'UserSessionWithPersonAndEndpoint(userSession=' + Kotlin.toString(this.userSession) + (', person=' + Kotlin.toString(this.person)) + (', endpoint=' + Kotlin.toString(this.endpoint)) + ')';
};
  UserSessionWithPersonAndEndpoint.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.userSession) | 0;
  result = result * 31 + Kotlin.hashCode(this.person) | 0;
  result = result * 31 + Kotlin.hashCode(this.endpoint) | 0;
  return result;
};
  UserSessionWithPersonAndEndpoint.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.userSession, other.userSession) && Kotlin.equals(this.person, other.person) && Kotlin.equals(this.endpoint, other.endpoint)))));
};
  function post$lambda($receiver) {
    return Unit;
  }
  function get$lambda($receiver) {
    return Unit;
  }
  function UstadAccountManager(systemImpl, appContext, di) {
    UstadAccountManager$Companion_getInstance();
    this.systemImpl_0 = systemImpl;
    this.appContext_0 = appContext;
    this.di = di;
    this.userSessionLiveDataMediator_0 = new UstadAccountManager$UserSessionMediator(this);
    this._activeUserSession_0 = null;
    this._activeUserSessionLive_0 = DoorMutableLiveData_init();
    this._activeEndpoint_0 = null;
    this._activeAccountLive_0 = DoorMutableLiveData_init();
    var tmp$;
    this.httpClient_wu80wy$_0 = Instance(this.di, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(HttpClient), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, UstadAccountManager$httpClient_metadata);
    this.endpointsWithActiveSessions_0 = concurrentSafeListOf([]);
    var tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5;
    var tmp$_6;
    if ((tmp$_0 = this.systemImpl_0.getAppPref(UstadAccountManager$Companion_getInstance().ACCOUNTS_ACTIVE_SESSION_PREFKEY, this.appContext_0)) != null) {
      var di_0 = this.di;
      var strategy = UserSessionWithPersonAndEndpoint$Companion_getInstance().serializer();
      var tmp$_7;
      var json = get_direct(di_0).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_7 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_7 : throwCCE(), null);
      tmp$_6 = json.decodeFromString_awif5v$(strategy, tmp$_0);
    } else 
      tmp$_6 = null;
    var activeUserSessionFromJson = tmp$_6;
    this._activeUserSession_0 = activeUserSessionFromJson;
    this._activeUserSessionLive_0.sendValue_11rb$(activeUserSessionFromJson);
    if ((tmp$_1 = this.systemImpl_0.getAppPref(UstadAccountManager$Companion_getInstance().ACCOUNTS_ENDPOINTS_WITH_ACTIVE_SESSION, this.appContext_0)) != null) {
      var endpointStrs = safeParseList(this.di, ListSerializer(serializer(kotlin_js_internal_StringCompanionObject)), PrimitiveClasses$stringClass, tmp$_1);
      var destination = ArrayList_init_0(collectionSizeOrDefault(endpointStrs, 10));
      var tmp$_8;
      tmp$_8 = endpointStrs.iterator();
      while (tmp$_8.hasNext()) {
        var item = tmp$_8.next();
        destination.add_11rb$(new Endpoint(item));
      }
      var allEndpoints = destination;
      this.endpointsWithActiveSessions_0.addAll_brywnq$(allEndpoints);
      launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, UstadAccountManager_init$lambda$lambda(allEndpoints, this));
    }
    var activeEndpointStr = (tmp$_3 = (tmp$_2 = this.systemImpl_0.getAppPref(UstadAccountManager$Companion_getInstance().ACCOUNTS_ACTIVE_ENDPOINT_PREFKEY, this.appContext_0)) != null ? tmp$_2 : this.systemImpl_0.getAppConfigString(AppConfig_getInstance().KEY_API_URL, UstadAccountManager$Companion_getInstance().MANIFEST_URL_FALLBACK, this.appContext_0)) != null ? tmp$_3 : UstadAccountManager$Companion_getInstance().MANIFEST_URL_FALLBACK;
    this._activeEndpoint_0 = new Endpoint(activeEndpointStr);
    this._activeAccountLive_0.sendValue_11rb$((tmp$_5 = (tmp$_4 = this._activeUserSession_0) != null ? tmp$_4.toUmAccount() : null) != null ? tmp$_5 : toUmAccount(UstadAccountManager$Companion_getInstance().GUEST_PERSON, activeEndpointStr));
    var $receiver = new DoorMediatorLiveData();
    $receiver.addSource_hfkt56$(this.userSessionLiveDataMediator_0, new DoorObserver(UstadAccountManager$storedAccountsLive$lambda$lambda($receiver)));
    this.storedAccountsLive = $receiver;
  }
  function UstadAccountManager$ResponseWithAccount(statusCode, umAccount) {
    this.statusCode = statusCode;
    this.umAccount = umAccount;
  }
  UstadAccountManager$ResponseWithAccount.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ResponseWithAccount', 
  interfaces: []};
  UstadAccountManager$ResponseWithAccount.prototype.component1 = function() {
  return this.statusCode;
};
  UstadAccountManager$ResponseWithAccount.prototype.component2 = function() {
  return this.umAccount;
};
  UstadAccountManager$ResponseWithAccount.prototype.copy_ly74qu$ = function(statusCode, umAccount) {
  return new UstadAccountManager$ResponseWithAccount(statusCode === void 0 ? this.statusCode : statusCode, umAccount === void 0 ? this.umAccount : umAccount);
};
  UstadAccountManager$ResponseWithAccount.prototype.toString = function() {
  return 'ResponseWithAccount(statusCode=' + Kotlin.toString(this.statusCode) + (', umAccount=' + Kotlin.toString(this.umAccount)) + ')';
};
  UstadAccountManager$ResponseWithAccount.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.statusCode) | 0;
  result = result * 31 + Kotlin.hashCode(this.umAccount) | 0;
  return result;
};
  UstadAccountManager$ResponseWithAccount.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.statusCode, other.statusCode) && Kotlin.equals(this.umAccount, other.umAccount)))));
};
  function UstadAccountManager$UserSessionMediator($outer) {
    this.$outer = $outer;
    DoorMediatorLiveData.call(this);
    this.endpointSessionsListMap_0 = LinkedHashMap_init();
    this.endpointSessionsLiveDataMap_0 = LinkedHashMap_init();
  }
  function UstadAccountManager$UserSessionMediator$addEndpoint$lambda(closure$endpoint, this$UserSessionMediator) {
    return function(endpointSessionList) {
  var tmp$ = this$UserSessionMediator.endpointSessionsListMap_0;
  var tmp$_0 = closure$endpoint;
  var destination = ArrayList_init_0(collectionSizeOrDefault(endpointSessionList, 10));
  var tmp$_1;
  tmp$_1 = endpointSessionList.iterator();
  while (tmp$_1.hasNext()) {
    var item = tmp$_1.next();
    destination.add_11rb$(withEndpoint(item, closure$endpoint));
  }
  tmp$.put_xwzc9p$(tmp$_0, destination);
  this$UserSessionMediator.setVal_11rb$(flatten(this$UserSessionMediator.endpointSessionsListMap_0.values));
  return Unit;
};
  }
  UstadAccountManager$UserSessionMediator.prototype.addEndpoint_trb9x7$ = function(endpoint) {
  var tmp$;
  var tmp$_0;
  var db = get_direct(this.$outer.di).directDI.On_agur4l$(DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$ : throwCCE(), endpoint)).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_0 : throwCCE(), 1);
  var liveData = db.userSessionDao.findAllLocalSessionsLive();
  this.endpointSessionsLiveDataMap_0.put_xwzc9p$(endpoint, liveData);
  this.addSource_hfkt56$(liveData, new DoorObserver(UstadAccountManager$UserSessionMediator$addEndpoint$lambda(endpoint, this)));
};
  UstadAccountManager$UserSessionMediator.prototype.removeEndpoint_trb9x7$ = function(endpoint) {
  var tmp$;
  tmp$ = this.endpointSessionsLiveDataMap_0.get_11rb$(endpoint);
  if (tmp$ == null) {
    return;
  }
  var liveData = tmp$;
  this.removeSource_6lcnak$(liveData);
};
  UstadAccountManager$UserSessionMediator.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UserSessionMediator', 
  interfaces: [DoorMediatorLiveData]};
  Object.defineProperty(UstadAccountManager.prototype, 'activeUserSessionsLive', {
  configurable: true, 
  get: function() {
  return this.userSessionLiveDataMediator_0;
}});
  Object.defineProperty(UstadAccountManager.prototype, 'activeUserSessionLive', {
  configurable: true, 
  get: function() {
  return this._activeUserSessionLive_0;
}});
  var UstadAccountManager$httpClient_metadata = new PropertyMetadata('httpClient');
  Object.defineProperty(UstadAccountManager.prototype, 'httpClient_0', {
  configurable: true, 
  get: function() {
  return this.httpClient_wu80wy$_0.value;
}});
  function UstadAccountManager$activeSessionsList$lambda(it) {
    return true;
  }
  function Coroutine$activeSessionsList_leuowt$($this, endpointFilter_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$destination = void 0;
    this.local$tmp$ = void 0;
    this.local$element = void 0;
    this.local$endpointFilter = endpointFilter_0;
  }
  Coroutine$activeSessionsList_leuowt$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$activeSessionsList_leuowt$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$activeSessionsList_leuowt$.prototype.constructor = Coroutine$activeSessionsList_leuowt$;
  Coroutine$activeSessionsList_leuowt$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$endpointFilter === void 0) 
          this.local$endpointFilter = UstadAccountManager$activeSessionsList$lambda;
        var $receiver = this.$this.endpointsWithActiveSessions_0;
        var destination = ArrayList_init();
        var tmp$;
        tmp$ = $receiver.iterator();
        while (tmp$.hasNext()) {
          var element = tmp$.next();
          if (this.local$endpointFilter(element.url)) 
            destination.add_11rb$(element);
        }
        this.local$destination = ArrayList_init();
        this.local$tmp$ = destination.iterator();
        this.state_0 = 2;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 4;
          continue;
        }
        this.local$element = this.local$tmp$.next();
        var $receiver_0 = this.$this.di;
        var trigger;
        trigger = $receiver_0.diTrigger;
        var tmp$_0;
        var tmp$_1;
        var db = get_direct(On($receiver_0, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$_0 : throwCCE(), this.local$element), trigger)).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_1 : throwCCE(), 1);
        this.state_0 = 3;
        this.result_0 = db.userSessionDao.findAllLocalSessionsAsync(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var $receiver_1 = this.result_0;
        var destination_0 = ArrayList_init_0(collectionSizeOrDefault($receiver_1, 10));
        var tmp$_2;
        tmp$_2 = $receiver_1.iterator();
        while (tmp$_2.hasNext()) {
          var item = tmp$_2.next();
          destination_0.add_11rb$(withEndpoint(item, this.local$element));
        }
        var list = destination_0;
        addAll(this.local$destination, list);
        this.state_0 = 2;
        continue;
      case 4:
        return this.local$destination;
      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);
};
  UstadAccountManager.prototype.activeSessionsList_leuowt$ = function(endpointFilter_0, continuation_0, suspended) {
  var instance = new Coroutine$activeSessionsList_leuowt$(this, endpointFilter_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function UstadAccountManager$activeSessionCount$lambda(it) {
    return true;
  }
  function Coroutine$activeSessionCount_6ttg7a$($this, maxDateOfBirth_0, endpointFilter_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$ = void 0;
    this.local$accumulator = void 0;
    this.local$total = void 0;
    this.local$maxDateOfBirth = maxDateOfBirth_0;
    this.local$endpointFilter = endpointFilter_0;
  }
  Coroutine$activeSessionCount_6ttg7a$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$activeSessionCount_6ttg7a$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$activeSessionCount_6ttg7a$.prototype.constructor = Coroutine$activeSessionCount_6ttg7a$;
  Coroutine$activeSessionCount_6ttg7a$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$maxDateOfBirth === void 0) 
          this.local$maxDateOfBirth = L0;
        if (this.local$endpointFilter === void 0) 
          this.local$endpointFilter = UstadAccountManager$activeSessionCount$lambda;
        var $receiver = this.$this.endpointsWithActiveSessions_0;
        var destination = ArrayList_init();
        var tmp$;
        tmp$ = $receiver.iterator();
        while (tmp$.hasNext()) {
          var element = tmp$.next();
          if (this.local$endpointFilter(element.url)) 
            destination.add_11rb$(element);
        }
        this.local$accumulator = 0;
        this.local$tmp$ = destination.iterator();
        this.state_0 = 2;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 4;
          continue;
        }
        var element_0 = this.local$tmp$.next();
        this.local$total = this.local$accumulator;
        var $receiver_0 = this.$this.di;
        var trigger;
        trigger = $receiver_0.diTrigger;
        var tmp$_0;
        var tmp$_1;
        var db = get_direct(On($receiver_0, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$_0 : throwCCE(), element_0), trigger)).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_1 : throwCCE(), 1);
        this.state_0 = 3;
        this.result_0 = db.userSessionDao.countAllLocalSessionsAsync_s8cxhz$(this.local$maxDateOfBirth, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$accumulator = this.local$total + this.result_0 | 0;
        this.state_0 = 2;
        continue;
      case 4:
        return this.local$accumulator;
      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);
};
  UstadAccountManager.prototype.activeSessionCount_6ttg7a$ = function(maxDateOfBirth_0, endpointFilter_0, continuation_0, suspended) {
  var instance = new Coroutine$activeSessionCount_6ttg7a$(this, maxDateOfBirth_0, endpointFilter_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  Object.defineProperty(UstadAccountManager.prototype, 'activeAccount', {
  configurable: true, 
  get: function() {
  var tmp$, tmp$_0;
  return (tmp$_0 = (tmp$ = this._activeUserSession_0) != null ? tmp$.toUmAccount() : null) != null ? tmp$_0 : toUmAccount(UstadAccountManager$Companion_getInstance().GUEST_PERSON, this._activeEndpoint_0.url);
}});
  Object.defineProperty(UstadAccountManager.prototype, 'activeSession', {
  configurable: true, 
  get: function() {
  return this._activeUserSession_0;
}, 
  set: function(value) {
  this._activeUserSession_0 = value;
  this._activeUserSessionLive_0.sendValue_11rb$(value);
  var tmp$;
  if (value != null) {
    var di = this.di;
    var strategy = UserSessionWithPersonAndEndpoint$Companion_getInstance().serializer();
    var tmp$_0;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
    tmp$ = json.encodeToString_tf03ej$(strategy, value);
  } else 
    tmp$ = null;
  var activeAccountJson = tmp$;
  this.systemImpl_0.setAppPref_5pkmrg$(UstadAccountManager$Companion_getInstance().ACCOUNTS_ACTIVE_SESSION_PREFKEY, activeAccountJson, this.appContext_0);
}});
  Object.defineProperty(UstadAccountManager.prototype, 'activeEndpoint', {
  configurable: true, 
  get: function() {
  return this._activeEndpoint_0;
}, 
  set: function(value) {
  this._activeEndpoint_0 = value;
  this.systemImpl_0.setAppPref_5pkmrg$(UstadAccountManager$Companion_getInstance().ACCOUNTS_ACTIVE_ENDPOINT_PREFKEY, value.url, this.appContext_0);
}});
  Object.defineProperty(UstadAccountManager.prototype, 'activeAccountLive', {
  configurable: true, 
  get: function() {
  return this._activeAccountLive_0;
}});
  function UstadAccountManager$register$lambda$lambda(closure$endpointUrl, closure$person, closure$parentVal) {
    return function($receiver) {
  url($receiver, removeSuffix(closure$endpointUrl, '/') + '/auth/register');
  contentType($receiver, ContentType.Application.Json);
  $receiver.body = new RegisterRequest(closure$person, closure$parentVal, closure$endpointUrl);
  return Unit;
};
  }
  function Coroutine$UstadAccountManager$register$lambda$lambda(response_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$response = response_0;
  }
  Coroutine$UstadAccountManager$register$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$UstadAccountManager$register$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$UstadAccountManager$register$lambda$lambda.prototype.constructor = Coroutine$UstadAccountManager$register$lambda$lambda;
  Coroutine$UstadAccountManager$register$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$response.status.value === 200) {
          var tmp$_1;
          var tmp$_2 = this.local$response.call;
          var typeInfo$result_0;
          typeInfo$break:
            do {
              try {
                typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(PersonWithAccount), createKType(getKClass(PersonWithAccount), [], false));
              }              catch (_) {
  typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(PersonWithAccount), null);
  break typeInfo$break;
}
            } while (false);
          this.state_0 = 2;
          this.result_0 = tmp$_2.receive_qi9ur9$(typeInfo$result_0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          return new Pair(null, this.local$response.status.value);
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.result_0 = Kotlin.isType(tmp$_1 = this.result_0, PersonWithAccount) ? tmp$_1 : throwCCE();
        return new Pair(this.result_0, 200);
      case 3:
        return;
      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 UstadAccountManager$register$lambda$lambda_0(response_0, continuation_0, suspended) {
    var instance = new Coroutine$UstadAccountManager$register$lambda$lambda(response_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function Coroutine$UstadAccountManager$register$lambda(closure$accountRegisterOptions_0, this$UstadAccountManager_0, closure$endpointUrl_0, closure$person_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 6;
    this.local$closure$accountRegisterOptions = closure$accountRegisterOptions_0;
    this.local$this$UstadAccountManager = this$UstadAccountManager_0;
    this.local$closure$endpointUrl = closure$endpointUrl_0;
    this.local$closure$person = closure$person_0;
    this.local$response = void 0;
    this.local$registeredPerson = void 0;
  }
  Coroutine$UstadAccountManager$register$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$UstadAccountManager$register$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$UstadAccountManager$register$lambda.prototype.constructor = Coroutine$UstadAccountManager$register$lambda;
  Coroutine$UstadAccountManager$register$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var parentVal = this.local$closure$accountRegisterOptions.parentJoin;
        var $receiver_0 = this.local$this$UstadAccountManager.httpClient_0;
        var block = UstadAccountManager$register$lambda$lambda(this.local$closure$endpointUrl, this.local$closure$person, parentVal);
        var host;
        var body;
        host = 'localhost';
        body = utils.EmptyContent;
        var $receiver_1 = new HttpRequestBuilder_init();
        url_0($receiver_1, 'http', host, 0, '/');
        $receiver_1.method = HttpMethod.Companion.Post;
        $receiver_1.body = body;
        block($receiver_1);
        var $this_0 = new HttpStatement($receiver_1, $receiver_0);
        var tmp$_4, tmp$_5, tmp$_6;
        tmp$_4 = getKClass(HttpStatement);
        if (equals(tmp$_4, getKClass(HttpStatement))) {
          this.result_0 = Kotlin.isType(tmp$_5 = $this_0, HttpStatement) ? tmp$_5 : throwCCE();
          this.state_0 = 9;
          continue;
        } else {
          if (equals(tmp$_4, getKClass(HttpResponse))) {
            this.state_0 = 7;
            this.result_0 = $this_0.execute(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 1;
            this.result_0 = $this_0.executeUnsafe(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          }
        }
      case 1:
        this.local$response = this.result_0;
        this.exceptionState_0 = 4;
        var tmp$_7;
        var tmp$_8 = this.local$response.call;
        var typeInfo$result_0;
        typeInfo$break:
          do {
            try {
              typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(HttpStatement), createKType(getKClass(HttpStatement), [], false));
            }            catch (_) {
  typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(HttpStatement), null);
  break typeInfo$break;
}
          } while (false);
        this.state_0 = 2;
        this.result_0 = tmp$_8.receive_qi9ur9$(typeInfo$result_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 2:
        this.result_0 = Kotlin.isType(tmp$_7 = this.result_0, HttpStatement) ? tmp$_7 : throwCCE();
        this.exceptionState_0 = 6;
        this.finallyPath_0 = [3];
        this.state_0 = 5;
        continue;
      case 3:
        this.state_0 = 8;
        continue;
      case 4:
        this.finallyPath_0 = [6];
        this.state_0 = 5;
        continue;
      case 5:
        this.exceptionState_0 = 6;
        complete(this.local$response);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 6:
        throw this.exception_0;
      case 7:
        this.result_0 = Kotlin.isType(tmp$_6 = this.result_0, HttpStatement) ? tmp$_6 : throwCCE();
        this.state_0 = 8;
        continue;
      case 8:
        this.state_0 = 9;
        continue;
      case 9:
        this.result_0;
        var httpStmt = this.result_0;
        this.state_0 = 10;
        this.result_0 = httpStmt.execute_2rh6on$(UstadAccountManager$register$lambda$lambda_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 10:
        var tmp$ = this.result_0;
        this.local$registeredPerson = tmp$.component1() , this.local$status = tmp$.component2();
        var status = tmp$.component2();
        var newPassword = this.local$closure$person.newPassword;
        if (status === 200 && this.local$registeredPerson != null && newPassword != null) {
          if (this.local$closure$accountRegisterOptions.makeAccountActive) {
            this.state_0 = 11;
            this.result_0 = this.local$this$UstadAccountManager.addSession_6qe9wg$(this.local$registeredPerson, this.local$closure$endpointUrl, newPassword, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 12;
            continue;
          }
        } else {
          if (status === 409) {
            throw IllegalStateException_init('Conflict: username already taken');
          } else {
            throw Exception_init('register request: non-OK status code: ' + status);
          }
        }
      case 11:
        var session = this.result_0;
        this.local$this$UstadAccountManager.activeSession = session;
        this.state_0 = 12;
        continue;
      case 12:
        return this.local$registeredPerson;
      case 13:
        return;
      default:
        this.state_0 = 6;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 6) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function UstadAccountManager$register$lambda(closure$accountRegisterOptions_0, this$UstadAccountManager_0, closure$endpointUrl_0, closure$person_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$UstadAccountManager$register$lambda(closure$accountRegisterOptions_0, this$UstadAccountManager_0, closure$endpointUrl_0, closure$person_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  UstadAccountManager.prototype.register_y55c4w$ = function(person, endpointUrl, accountRegisterOptions, continuation) {
  if (accountRegisterOptions === void 0) 
    accountRegisterOptions = new AccountRegisterOptions();
  return withContext(coroutines.Dispatchers.Default, UstadAccountManager$register$lambda(accountRegisterOptions, this, endpointUrl, person), continuation);
};
  function Coroutine$UstadAccountManager$addSession$lambda(it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$it = it_0;
  }
  Coroutine$UstadAccountManager$addSession$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$UstadAccountManager$addSession$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$UstadAccountManager$addSession$lambda.prototype.constructor = Coroutine$UstadAccountManager$addSession$lambda;
  Coroutine$UstadAccountManager$addSession$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.state_0 = 2;
        this.result_0 = this.local$it.siteDao.getSiteAsync(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        return (tmp$ = this.result_0) != null ? tmp$.authSalt : null;
      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 UstadAccountManager$addSession$lambda(it_0, continuation_0, suspended) {
    var instance = new Coroutine$UstadAccountManager$addSession$lambda(it_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function Coroutine$addSession_6qe9wg$($this, person_0, endpointUrl_0, password_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$endpoint = void 0;
    this.local$endpointRepo = void 0;
    this.local$pbkdf2Params = void 0;
    this.local$$receiver = void 0;
    this.local$person = person_0;
    this.local$endpointUrl = endpointUrl_0;
    this.local$password = password_0;
  }
  Coroutine$addSession_6qe9wg$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$addSession_6qe9wg$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$addSession_6qe9wg$.prototype.constructor = Coroutine$addSession_6qe9wg$;
  Coroutine$addSession_6qe9wg$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.local$endpoint = new Endpoint(this.local$endpointUrl);
        var $receiver = this.$this.di;
        var trigger;
        trigger = $receiver.diTrigger;
        var tmp$_0;
        var tmp$_1;
        this.local$endpointRepo = get_direct(On($receiver, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$_0 : throwCCE(), this.local$endpoint), trigger)).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_1 : throwCCE(), 2);
        if (!this.$this.endpointsWithActiveSessions_0.contains_11rb$(this.local$endpoint)) {
          this.state_0 = 2;
          this.result_0 = this.$this.addActiveEndpoint_0(this.local$endpoint, false, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.$this.commitActiveEndpointsToPref_0();
        this.state_0 = 3;
        continue;
      case 3:
        var tmp$_2;
        this.local$pbkdf2Params = get_direct(this.$this.di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(Pbkdf2Params), [], false)), TypeToken) ? tmp$_2 : throwCCE(), null);
        this.state_0 = 4;
        this.result_0 = onRepoWithFallbackToDb(this.local$endpointRepo, L2000, UstadAccountManager$addSession$lambda, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        tmp$ = this.result_0;
        if (tmp$ == null) {
          throw IllegalStateException_init('addSession: No auth salt!');
        }
        var authSalt = tmp$;
        this.local$$receiver = new UserSession();
        var tmp$_3, tmp$_4;
        this.local$$receiver.usClientNodeId = (Kotlin.isType(tmp$_3 = this.local$endpointRepo, DoorDatabaseRepository) ? tmp$_3 : throwCCE()).config.nodeId;
        this.local$$receiver.usPersonUid = this.local$person.personUid;
        this.local$$receiver.usStartTime = systemTimeInMillis();
        this.local$$receiver.usSessionType = 1;
        this.local$$receiver.usStatus = 1;
        this.local$$receiver.usAuth = (tmp$_4 = this.local$password != null ? encryptWithPbkdf2(this.local$password, authSalt, this.local$pbkdf2Params) : null) != null ? toHexString(tmp$_4) : null;
        this.state_0 = 5;
        this.result_0 = this.local$endpointRepo.userSessionDao.insertSession_g3losl$(this.local$$receiver, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        this.local$$receiver.usUid = this.result_0;
        var userSession = this.local$$receiver;
        return new UserSessionWithPersonAndEndpoint(userSession, this.local$person, this.local$endpoint);
      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);
};
  UstadAccountManager.prototype.addSession_6qe9wg$ = function(person_0, endpointUrl_0, password_0, continuation_0, suspended) {
  var instance = new Coroutine$addSession_6qe9wg$(this, person_0, endpointUrl_0, password_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$UstadAccountManager$addActiveEndpoint$lambda(this$UstadAccountManager_0, closure$endpoint_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$UstadAccountManager = this$UstadAccountManager_0;
    this.local$closure$endpoint = closure$endpoint_0;
  }
  Coroutine$UstadAccountManager$addActiveEndpoint$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$UstadAccountManager$addActiveEndpoint$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$UstadAccountManager$addActiveEndpoint$lambda.prototype.constructor = Coroutine$UstadAccountManager$addActiveEndpoint$lambda;
  Coroutine$UstadAccountManager$addActiveEndpoint$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var $receiver = this.local$this$UstadAccountManager.di;
        var context = this.local$closure$endpoint;
        var trigger;
        trigger = $receiver.diTrigger;
        var tmp$;
        var tmp$_0;
        var db = get_direct(On($receiver, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$ : throwCCE(), context), trigger)).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_0 : throwCCE(), 1);
        addIncomingReplicationListener(db, this.local$this$UstadAccountManager);
        return this.local$this$UstadAccountManager.userSessionLiveDataMediator_0.addEndpoint_trb9x7$(this.local$closure$endpoint) , Unit;
      case 1:
        throw this.exception_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 UstadAccountManager$addActiveEndpoint$lambda(this$UstadAccountManager_0, closure$endpoint_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$UstadAccountManager$addActiveEndpoint$lambda(this$UstadAccountManager_0, closure$endpoint_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$addActiveEndpoint_0($this, endpoint_0, commit_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$endpoint = endpoint_0;
    this.local$commit = commit_0;
  }
  Coroutine$addActiveEndpoint_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$addActiveEndpoint_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$addActiveEndpoint_0.prototype.constructor = Coroutine$addActiveEndpoint_0;
  Coroutine$addActiveEndpoint_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$commit === void 0) 
          this.local$commit = true;
        this.$this.endpointsWithActiveSessions_0.add_11rb$(this.local$endpoint);
        if (this.local$commit) 
          this.$this.commitActiveEndpointsToPref_0();
        this.state_0 = 2;
        this.result_0 = withContext(doorMainDispatcher(), UstadAccountManager$addActiveEndpoint$lambda(this.$this, this.local$endpoint), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        return;
      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);
};
  UstadAccountManager.prototype.addActiveEndpoint_0 = function(endpoint_0, commit_0, continuation_0, suspended) {
  var instance = new Coroutine$addActiveEndpoint_0(this, endpoint_0, commit_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$UstadAccountManager$removeActiveEndpoint$lambda(this$UstadAccountManager_0, closure$endpoint_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$UstadAccountManager = this$UstadAccountManager_0;
    this.local$closure$endpoint = closure$endpoint_0;
  }
  Coroutine$UstadAccountManager$removeActiveEndpoint$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$UstadAccountManager$removeActiveEndpoint$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$UstadAccountManager$removeActiveEndpoint$lambda.prototype.constructor = Coroutine$UstadAccountManager$removeActiveEndpoint$lambda;
  Coroutine$UstadAccountManager$removeActiveEndpoint$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var $receiver = this.local$this$UstadAccountManager.di;
        var context = this.local$closure$endpoint;
        var trigger;
        trigger = $receiver.diTrigger;
        var tmp$;
        var tmp$_0;
        var db = get_direct(On($receiver, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$ : throwCCE(), context), trigger)).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_0 : throwCCE(), 1);
        removeIncomingReplicationListener(db, this.local$this$UstadAccountManager);
        return this.local$this$UstadAccountManager.userSessionLiveDataMediator_0.removeEndpoint_trb9x7$(this.local$closure$endpoint) , Unit;
      case 1:
        throw this.exception_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 UstadAccountManager$removeActiveEndpoint$lambda(this$UstadAccountManager_0, closure$endpoint_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$UstadAccountManager$removeActiveEndpoint$lambda(this$UstadAccountManager_0, closure$endpoint_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$removeActiveEndpoint_0($this, endpoint_0, commit_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$endpoint = endpoint_0;
    this.local$commit = commit_0;
  }
  Coroutine$removeActiveEndpoint_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$removeActiveEndpoint_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$removeActiveEndpoint_0.prototype.constructor = Coroutine$removeActiveEndpoint_0;
  Coroutine$removeActiveEndpoint_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$commit === void 0) 
          this.local$commit = true;
        this.$this.endpointsWithActiveSessions_0.remove_11rb$(this.local$endpoint);
        if (this.local$commit) 
          this.$this.commitActiveEndpointsToPref_0();
        this.state_0 = 2;
        this.result_0 = withContext(doorMainDispatcher(), UstadAccountManager$removeActiveEndpoint$lambda(this.$this, this.local$endpoint), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        return;
      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);
};
  UstadAccountManager.prototype.removeActiveEndpoint_0 = function(endpoint_0, commit_0, continuation_0, suspended) {
  var instance = new Coroutine$removeActiveEndpoint_0(this, endpoint_0, commit_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  UstadAccountManager.prototype.commitActiveEndpointsToPref_0 = function() {
  var tmp$ = Json.Default;
  var tmp$_0 = ListSerializer(serializer(kotlin_js_internal_StringCompanionObject));
  var $receiver = toSet(this.endpointsWithActiveSessions_0);
  var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
  var tmp$_1;
  tmp$_1 = $receiver.iterator();
  while (tmp$_1.hasNext()) {
    var item = tmp$_1.next();
    destination.add_11rb$(item.url);
  }
  var json = tmp$.encodeToString_tf03ej$(tmp$_0, toList(destination));
  this.systemImpl_0.setAppPref_5pkmrg$(UstadAccountManager$Companion_getInstance().ACCOUNTS_ENDPOINTS_WITH_ACTIVE_SESSION, json, this.appContext_0);
};
  UstadAccountManager.prototype.onIncomingReplicationProcessed_hioxzo$ = function(incomingReplicationEvent, continuation) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4;
  if (incomingReplicationEvent.tableId !== 679) 
    return;
  tmp$_1 = (tmp$_0 = (tmp$ = this.activeSession) != null ? tmp$.userSession : null) != null ? tmp$_0.usUid : null;
  if (tmp$_1 == null) {
    return;
  }
  var activeSessionUid = tmp$_1;
  var $receiver = incomingReplicationEvent.incomingReplicationData;
  var firstOrNull$result;
  firstOrNull$break:
    do {
      var tmp$_5;
      tmp$_5 = $receiver.iterator();
      while (tmp$_5.hasNext()) {
        var element = tmp$_5.next();
        var tmp$_6, tmp$_7;
        if (equals((tmp$_7 = (tmp$_6 = get_jsonObject(element).get_11rb$('usUid')) != null ? get_jsonPrimitive(tmp$_6) : null) != null ? get_longOrNull(tmp$_7) : null, activeSessionUid)) {
          firstOrNull$result = element;
          break firstOrNull$break;
        }
      }
      firstOrNull$result = null;
    } while (false);
  tmp$_2 = firstOrNull$result;
  if (tmp$_2 == null) {
    return;
  }
  var activeSessionUpdate = tmp$_2;
  var activeSessionStatus = (tmp$_4 = (tmp$_3 = get_jsonObject(activeSessionUpdate).get_11rb$('usStatus')) != null ? get_jsonPrimitive(tmp$_3) : null) != null ? get_intOrNull(tmp$_4) : null;
  if (activeSessionStatus !== 1) {
    this.activeSession = null;
  }
};
  function UstadAccountManager$endSession$lambda(closure$session) {
    return function(it) {
  return equals(it, closure$session.endpoint.url);
};
  }
  function Coroutine$endSession_ymrki2$($this, session_0, endStatus_0, endReason_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$session = session_0;
    this.local$endStatus = endStatus_0;
    this.local$endReason = endReason_0;
  }
  Coroutine$endSession_ymrki2$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$endSession_ymrki2$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$endSession_ymrki2$.prototype.constructor = Coroutine$endSession_ymrki2$;
  Coroutine$endSession_ymrki2$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$endStatus === void 0) 
          this.local$endStatus = 4;
        if (this.local$endReason === void 0) 
          this.local$endReason = 1;
        var tmp$, tmp$_0, tmp$_1;
        var $receiver = this.$this.di;
        var context = this.local$session.endpoint;
        var trigger;
        trigger = $receiver.diTrigger;
        var tmp$_2;
        var tmp$_3;
        var endpointRepo = get_direct(On($receiver, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$_2 : throwCCE(), context), trigger)).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_3 : throwCCE(), 2);
        this.state_0 = 2;
        this.result_0 = endpointRepo.userSessionDao.endSession_liip7b$(this.local$session.userSession.usUid, this.local$endStatus, this.local$endReason, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (equals((tmp$_0 = (tmp$ = this.$this.activeSession) != null ? tmp$.userSession : null) != null ? tmp$_0.usUid : null, this.local$session.userSession.usUid) && equals((tmp$_1 = this.$this.activeSession) != null ? tmp$_1.endpoint : null, this.local$session.endpoint)) {
          this.$this.activeSession = null;
        }
        this.state_0 = 3;
        this.result_0 = this.$this.activeSessionsList_leuowt$(UstadAccountManager$endSession$lambda(this.local$session), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        if (this.result_0.isEmpty()) {
          this.state_0 = 4;
          this.result_0 = this.$this.removeActiveEndpoint_0(this.local$session.endpoint, void 0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 5;
          continue;
        }
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        return;
      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);
};
  UstadAccountManager.prototype.endSession_ymrki2$ = function(session_0, endStatus_0, endReason_0, continuation_0, suspended) {
  var instance = new Coroutine$endSession_ymrki2$(this, session_0, endStatus_0, endReason_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  var UstadAccountManager$login$lambda$repo_metadata = new PropertyMetadata('repo');
  var UstadAccountManager$login$lambda$db_metadata = new PropertyMetadata('db');
  function UstadAccountManager$login$lambda$lambda(closure$endpointUrl, closure$username, closure$password, closure$maxDateOfBirth, closure$nodeId) {
    return function($receiver) {
  url($receiver, removeSuffix(closure$endpointUrl, '/') + '/auth/login');
  parameter($receiver, 'username', closure$username);
  parameter($receiver, 'password', closure$password);
  parameter($receiver, 'maxDateOfBirth', closure$maxDateOfBirth);
  header($receiver, 'X-nid', closure$nodeId);
  set_expectSuccess($receiver, false);
  return Unit;
};
  }
  function UstadAccountManager$login$lambda$lambda_0(closure$endpointUrl, closure$responseAccount) {
    return function($receiver) {
  url($receiver, removeSuffix(closure$endpointUrl, '/') + '/auth/person');
  parameter($receiver, 'personUid', closure$responseAccount.personUid);
  return Unit;
};
  }
  function Coroutine$UstadAccountManager$login$lambda(this$UstadAccountManager_0, closure$endpointUrl_0, closure$username_0, closure$password_0, closure$maxDateOfBirth_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 16;
    this.local$this$UstadAccountManager = this$UstadAccountManager_0;
    this.local$closure$endpointUrl = closure$endpointUrl_0;
    this.local$closure$username = closure$username_0;
    this.local$closure$password = closure$password_0;
    this.local$closure$maxDateOfBirth = closure$maxDateOfBirth_0;
    this.local$repo = void 0;
    this.local$db = void 0;
    this.local$response = void 0;
    this.local$responseAccount = void 0;
    this.local$personInDb = void 0;
    this.local$response_0 = void 0;
    this.local$personObj = void 0;
  }
  Coroutine$UstadAccountManager$login$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$UstadAccountManager$login$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$UstadAccountManager$login$lambda.prototype.constructor = Coroutine$UstadAccountManager$login$lambda;
  Coroutine$UstadAccountManager$login$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4;
        var $receiver = this.local$this$UstadAccountManager.di;
        var context = new Endpoint(this.local$closure$endpointUrl);
        var trigger;
        trigger = $receiver.diTrigger;
        var tmp$_5;
        var tmp$_6;
        this.local$repo = Instance(On($receiver, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_5 = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$_5 : throwCCE(), context), trigger), Kotlin.isType(tmp$_6 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_6 : throwCCE(), 2).provideDelegate_tpuvb9$(this.$this, UstadAccountManager$login$lambda$repo_metadata);
        var $receiver_0 = this.local$this$UstadAccountManager.di;
        var context_0 = new Endpoint(this.local$closure$endpointUrl);
        var trigger_0;
        trigger_0 = $receiver_0.diTrigger;
        var tmp$_7;
        var tmp$_8;
        this.local$db = Instance(On($receiver_0, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_7 = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$_7 : throwCCE(), context_0), trigger_0), Kotlin.isType(tmp$_8 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_8 : throwCCE(), 1).provideDelegate_tpuvb9$(this.$this, UstadAccountManager$login$lambda$db_metadata);
        tmp$_2 = (tmp$_1 = (tmp$_0 = Kotlin.isType(tmp$ = this.local$repo.value, DoorDatabaseRepository) ? tmp$ : null) != null ? tmp$_0.config : null) != null ? tmp$_1.nodeId : null;
        if (tmp$_2 == null) {
          throw IllegalStateException_init('Could not open repo for endpoint ' + this.local$closure$endpointUrl);
        }
        var nodeId = tmp$_2;
        var $receiver_0_0 = this.local$this$UstadAccountManager.httpClient_0;
        var block = UstadAccountManager$login$lambda$lambda(this.local$closure$endpointUrl, this.local$closure$username, this.local$closure$password, this.local$closure$maxDateOfBirth, nodeId);
        var host;
        var body;
        host = 'localhost';
        body = utils.EmptyContent;
        var $receiver_1 = new HttpRequestBuilder_init();
        url_0($receiver_1, 'http', host, 0, '/');
        $receiver_1.method = HttpMethod.Companion.Post;
        $receiver_1.body = body;
        block($receiver_1);
        var $this_0 = new HttpStatement($receiver_1, $receiver_0_0);
        var tmp$_4_0, tmp$_5_0, tmp$_6_0;
        tmp$_4_0 = getKClass(HttpResponse);
        if (equals(tmp$_4_0, getKClass(HttpStatement))) {
          this.result_0 = Kotlin.isType(tmp$_5_0 = $this_0, HttpResponse) ? tmp$_5_0 : throwCCE();
          this.state_0 = 8;
          continue;
        } else {
          if (equals(tmp$_4_0, getKClass(HttpResponse))) {
            this.state_0 = 6;
            this.result_0 = $this_0.execute(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 1;
            this.result_0 = $this_0.executeUnsafe(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          }
        }
      case 1:
        this.local$response = this.result_0;
        this.exceptionState_0 = 4;
        var tmp$_7_0;
        var tmp$_8_0 = this.local$response.call;
        var typeInfo$result_0;
        typeInfo$break:
          do {
            try {
              typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(HttpResponse), createKType(getKClass(HttpResponse), [], false));
            }            catch (_) {
  typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(HttpResponse), null);
  break typeInfo$break;
}
          } while (false);
        this.state_0 = 2;
        this.result_0 = tmp$_8_0.receive_qi9ur9$(typeInfo$result_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 2:
        this.result_0 = Kotlin.isType(tmp$_7_0 = this.result_0, HttpResponse) ? tmp$_7_0 : throwCCE();
        this.exceptionState_0 = 16;
        this.finallyPath_0 = [3];
        this.state_0 = 5;
        continue;
      case 3:
        this.state_0 = 7;
        continue;
      case 4:
        this.finallyPath_0 = [16];
        this.state_0 = 5;
        continue;
      case 5:
        this.exceptionState_0 = 16;
        complete(this.local$response);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 6:
        this.result_0 = Kotlin.isType(tmp$_6_0 = this.result_0, HttpResponse) ? tmp$_6_0 : throwCCE();
        this.state_0 = 7;
        continue;
      case 7:
        this.state_0 = 8;
        continue;
      case 8:
        this.result_0;
        var loginResponse = this.result_0;
        if (loginResponse.status.value === 403) {
          throw new UnauthorizedException('Access denied');
        } else if ((tmp$_3 = loginResponse.status) != null ? tmp$_3.equals(HttpStatusCode.Companion.FailedDependency) : null) {
          throw new ConsentNotGrantedException('Parental consent required but not granted');
        } else if ((tmp$_4 = loginResponse.status) != null ? tmp$_4.equals(HttpStatusCode.Companion.Conflict) : null) {
          throw new AdultAccountRequiredException('Adult account required, credentials for child account');
        } else if (loginResponse.status.value !== 200) {
          throw IllegalStateException_init('Server error - response ' + loginResponse.status.value);
        }
        var tmp$_1_0;
        var tmp$_2_0 = loginResponse.call;
        var typeInfo$result_0_0;
        typeInfo$break:
          do {
            try {
              typeInfo$result_0_0 = typeInfoImpl(reflect.JsType, getKClass(UmAccount), createKType(getKClass(UmAccount), [], false));
            }            catch (__0) {
  typeInfo$result_0_0 = typeInfoImpl(reflect.JsType, getKClass(UmAccount), null);
  break typeInfo$break;
}
          } while (false);
        this.state_0 = 9;
        this.result_0 = tmp$_2_0.receive_qi9ur9$(typeInfo$result_0_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 9:
        this.result_0 = Kotlin.isType(tmp$_1_0 = this.result_0, UmAccount) ? tmp$_1_0 : throwCCE();
        this.local$responseAccount = this.result_0;
        this.local$responseAccount.endpointUrl = this.local$closure$endpointUrl;
        this.state_0 = 10;
        this.result_0 = this.local$db.value.personDao.findByUidAsync_s8cxhz$(this.local$responseAccount.personUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 10:
        this.local$personInDb = this.result_0;
        if (this.local$personInDb == null) {
          var $receiver_0_1 = this.local$this$UstadAccountManager.httpClient_0;
          var block_0 = UstadAccountManager$login$lambda$lambda_0(this.local$closure$endpointUrl, this.local$responseAccount);
          var host_0;
          var body_0;
          host_0 = 'localhost';
          body_0 = utils.EmptyContent;
          var $receiver_1_0 = new HttpRequestBuilder_init();
          url_0($receiver_1_0, 'http', host_0, 0, '/');
          $receiver_1_0.method = HttpMethod.Companion.Get;
          $receiver_1_0.body = body_0;
          block_0($receiver_1_0);
          var $this_0_0 = new HttpStatement($receiver_1_0, $receiver_0_1);
          var tmp$_4_1, tmp$_5_1, tmp$_6_1;
          tmp$_4_1 = getKClass(HttpResponse);
          if (equals(tmp$_4_1, getKClass(HttpStatement))) {
            this.result_0 = Kotlin.isType(tmp$_5_1 = $this_0_0, HttpResponse) ? tmp$_5_1 : throwCCE();
            this.state_0 = 19;
            continue;
          } else {
            if (equals(tmp$_4_1, getKClass(HttpResponse))) {
              this.state_0 = 17;
              this.result_0 = $this_0_0.execute(this);
              if (this.result_0 === COROUTINE_SUSPENDED) 
                return COROUTINE_SUSPENDED;
              continue;
            } else {
              this.state_0 = 11;
              this.result_0 = $this_0_0.executeUnsafe(this);
              if (this.result_0 === COROUTINE_SUSPENDED) 
                return COROUTINE_SUSPENDED;
              continue;
            }
          }
        } else {
          this.state_0 = 23;
          continue;
        }
      case 11:
        this.local$response_0 = this.result_0;
        this.exceptionState_0 = 14;
        var tmp$_7_1;
        var tmp$_8_1 = this.local$response_0.call;
        var typeInfo$result_0_1;
        typeInfo$break:
          do {
            try {
              typeInfo$result_0_1 = typeInfoImpl(reflect.JsType, getKClass(HttpResponse), createKType(getKClass(HttpResponse), [], false));
            }            catch (__1) {
  typeInfo$result_0_1 = typeInfoImpl(reflect.JsType, getKClass(HttpResponse), null);
  break typeInfo$break;
}
          } while (false);
        this.state_0 = 12;
        this.result_0 = tmp$_8_1.receive_qi9ur9$(typeInfo$result_0_1, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 12:
        this.result_0 = Kotlin.isType(tmp$_7_1 = this.result_0, HttpResponse) ? tmp$_7_1 : throwCCE();
        this.exceptionState_0 = 16;
        this.finallyPath_0 = [13];
        this.state_0 = 15;
        continue;
      case 13:
        this.state_0 = 18;
        continue;
      case 14:
        this.finallyPath_0 = [16];
        this.state_0 = 15;
        continue;
      case 15:
        this.exceptionState_0 = 16;
        complete(this.local$response_0);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 16:
        throw this.exception_0;
      case 17:
        this.result_0 = Kotlin.isType(tmp$_6_1 = this.result_0, HttpResponse) ? tmp$_6_1 : throwCCE();
        this.state_0 = 18;
        continue;
      case 18:
        this.state_0 = 19;
        continue;
      case 19:
        this.result_0;
        var personOnServerResponse = this.result_0;
        if (personOnServerResponse.status.value === 200) {
          var tmp$_1_1;
          var tmp$_2_1 = personOnServerResponse.call;
          var typeInfo$result_0_2;
          typeInfo$break:
            do {
              try {
                typeInfo$result_0_2 = typeInfoImpl(reflect.JsType, getKClass(Person), createKType(getKClass(Person), [], false));
              }              catch (__2) {
  typeInfo$result_0_2 = typeInfoImpl(reflect.JsType, getKClass(Person), null);
  break typeInfo$break;
}
            } while (false);
          this.state_0 = 20;
          this.result_0 = tmp$_2_1.receive_qi9ur9$(typeInfo$result_0_2, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          throw IllegalStateException_init('Internal error: could not get person object');
        }
      case 20:
        this.result_0 = Kotlin.isType(tmp$_1_1 = this.result_0, Person) ? tmp$_1_1 : throwCCE();
        this.local$personObj = this.result_0;
        this.state_0 = 21;
        this.result_0 = this.local$repo.value.personDao.insertAsync(this.local$personObj, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 21:
        this.local$personInDb = this.local$personObj;
        this.state_0 = 22;
        continue;
      case 22:
        this.state_0 = 23;
        continue;
      case 23:
        this.state_0 = 24;
        this.result_0 = this.local$this$UstadAccountManager.getSiteFromDbOrLoadFromHttp_0(this.local$closure$endpointUrl, this.local$repo.value, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 24:
        this.state_0 = 25;
        this.result_0 = this.local$this$UstadAccountManager.addSession_6qe9wg$(this.local$personInDb, this.local$closure$endpointUrl, this.local$closure$password, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 25:
        var newSession = this.result_0;
        this.local$this$UstadAccountManager.activeEndpoint = new Endpoint(this.local$closure$endpointUrl);
        this.local$this$UstadAccountManager.activeSession = newSession;
        return this.local$responseAccount;
      default:
        this.state_0 = 16;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 16) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function UstadAccountManager$login$lambda(this$UstadAccountManager_0, closure$endpointUrl_0, closure$username_0, closure$password_0, closure$maxDateOfBirth_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$UstadAccountManager$login$lambda(this$UstadAccountManager_0, closure$endpointUrl_0, closure$username_0, closure$password_0, closure$maxDateOfBirth_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  UstadAccountManager.prototype.login_bz5y9$ = function(username, password, endpointUrl, maxDateOfBirth, continuation) {
  if (maxDateOfBirth === void 0) 
    maxDateOfBirth = L0;
  return withContext(coroutines.Dispatchers.Default, UstadAccountManager$login$lambda(this, endpointUrl, username, password, maxDateOfBirth), continuation);
};
  function UstadAccountManager$getSiteFromDbOrLoadFromHttp$lambda(closure$repo, closure$endpointUrl) {
    return function($receiver) {
  var tmp$;
  doorNodeAndVersionHeaders($receiver, Kotlin.isType(tmp$ = closure$repo, DoorDatabaseRepository) ? tmp$ : throwCCE());
  url($receiver, removeSuffix(closure$endpointUrl, '/') + '/UmAppDatabase/SiteDao/getSiteAsync');
  return Unit;
};
  }
  function Coroutine$getSiteFromDbOrLoadFromHttp_0($this, endpointUrl_0, repo_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 7;
    this.$this = $this;
    this.local$response = void 0;
    this.local$endpointUrl = endpointUrl_0;
    this.local$repo = repo_0;
  }
  Coroutine$getSiteFromDbOrLoadFromHttp_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$getSiteFromDbOrLoadFromHttp_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$getSiteFromDbOrLoadFromHttp_0.prototype.constructor = Coroutine$getSiteFromDbOrLoadFromHttp_0;
  Coroutine$getSiteFromDbOrLoadFromHttp_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        var db = Kotlin.isType(tmp$_0 = (Kotlin.isType(tmp$ = this.local$repo, DoorDatabaseRepository) ? tmp$ : throwCCE()).db, UmAppDatabase) ? tmp$_0 : throwCCE();
        this.state_0 = 1;
        this.result_0 = db.siteDao.getSiteAsync(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        var siteInDb = this.result_0;
        if (siteInDb == null) {
          var $receiver_0 = this.$this.httpClient_0;
          var host;
          var body;
          host = 'localhost';
          body = utils.EmptyContent;
          var $receiver_1 = new HttpRequestBuilder_init();
          url_0($receiver_1, 'http', host, 0, '/');
          $receiver_1.method = HttpMethod.Companion.Get;
          $receiver_1.body = body;
          UstadAccountManager$getSiteFromDbOrLoadFromHttp$lambda(this.local$repo, this.local$endpointUrl)($receiver_1);
          var $this_0 = new HttpStatement($receiver_1, $receiver_0);
          var tmp$_4, tmp$_5, tmp$_6;
          tmp$_4 = getKClass(HttpResponse);
          if (equals(tmp$_4, getKClass(HttpStatement))) {
            this.result_0 = Kotlin.isType(tmp$_5 = $this_0, HttpResponse) ? tmp$_5 : throwCCE();
            this.state_0 = 10;
            continue;
          } else {
            if (equals(tmp$_4, getKClass(HttpResponse))) {
              this.state_0 = 8;
              this.result_0 = $this_0.execute(this);
              if (this.result_0 === COROUTINE_SUSPENDED) 
                return COROUTINE_SUSPENDED;
              continue;
            } else {
              this.state_0 = 2;
              this.result_0 = $this_0.executeUnsafe(this);
              if (this.result_0 === COROUTINE_SUSPENDED) 
                return COROUTINE_SUSPENDED;
              continue;
            }
          }
        } else {
          this.state_0 = 14;
          continue;
        }
      case 2:
        this.local$response = this.result_0;
        this.exceptionState_0 = 5;
        var tmp$_7;
        var tmp$_8 = this.local$response.call;
        var typeInfo$result_0;
        typeInfo$break:
          do {
            try {
              typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(HttpResponse), createKType(getKClass(HttpResponse), [], false));
            }            catch (_) {
  typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(HttpResponse), null);
  break typeInfo$break;
}
          } while (false);
        this.state_0 = 3;
        this.result_0 = tmp$_8.receive_qi9ur9$(typeInfo$result_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.result_0 = Kotlin.isType(tmp$_7 = this.result_0, HttpResponse) ? tmp$_7 : throwCCE();
        this.exceptionState_0 = 7;
        this.finallyPath_0 = [4];
        this.state_0 = 6;
        continue;
      case 4:
        this.state_0 = 9;
        continue;
      case 5:
        this.finallyPath_0 = [7];
        this.state_0 = 6;
        continue;
      case 6:
        this.exceptionState_0 = 7;
        complete(this.local$response);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 7:
        throw this.exception_0;
      case 8:
        this.result_0 = Kotlin.isType(tmp$_6 = this.result_0, HttpResponse) ? tmp$_6 : throwCCE();
        this.state_0 = 9;
        continue;
      case 9:
        this.state_0 = 10;
        continue;
      case 10:
        this.result_0;
        var siteResponse = this.result_0;
        if (siteResponse.status.value === 200) {
          var tmp$_1;
          var tmp$_2 = siteResponse.call;
          var typeInfo$result_0_0;
          typeInfo$break:
            do {
              try {
                typeInfo$result_0_0 = typeInfoImpl(reflect.JsType, getKClass(Site), createKType(getKClass(Site), [], false));
              }              catch (__0) {
  typeInfo$result_0_0 = typeInfoImpl(reflect.JsType, getKClass(Site), null);
  break typeInfo$break;
}
            } while (false);
          this.state_0 = 11;
          this.result_0 = tmp$_2.receive_qi9ur9$(typeInfo$result_0_0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          throw IllegalStateException_init('Internal error: no Site in database and could not fetch it from server');
        }
      case 11:
        this.result_0 = Kotlin.isType(tmp$_1 = this.result_0, Site) ? tmp$_1 : throwCCE();
        var siteObj = this.result_0;
        this.state_0 = 12;
        this.result_0 = this.local$repo.siteDao.replaceAsync_5rubkd$(siteObj, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 12:
        this.state_0 = 13;
        continue;
      case 13:
        this.state_0 = 14;
        continue;
      case 14:
        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);
};
  UstadAccountManager.prototype.getSiteFromDbOrLoadFromHttp_0 = function(endpointUrl_0, repo_0, continuation_0, suspended) {
  var instance = new Coroutine$getSiteFromDbOrLoadFromHttp_0(this, endpointUrl_0, repo_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  var UstadAccountManager$startGuestSession$repo_metadata = new PropertyMetadata('repo');
  function Coroutine$startGuestSession_61zpoe$($this, endpointUrl_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$repo = void 0;
    this.local$guestPerson = void 0;
    this.local$endpointUrl = endpointUrl_0;
  }
  Coroutine$startGuestSession_61zpoe$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$startGuestSession_61zpoe$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$startGuestSession_61zpoe$.prototype.constructor = Coroutine$startGuestSession_61zpoe$;
  Coroutine$startGuestSession_61zpoe$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var $receiver = this.$this.di;
        var context = new Endpoint(this.local$endpointUrl);
        var trigger;
        trigger = $receiver.diTrigger;
        var tmp$;
        var tmp$_0;
        this.local$repo = Instance(On($receiver, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$ : throwCCE(), context), trigger), Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_0 : throwCCE(), 2).provideDelegate_tpuvb9$(this.$this, UstadAccountManager$startGuestSession$repo_metadata);
        var tmp$_1 = this.local$repo.value;
        var $receiver_0 = new Person();
        $receiver_0.username = null;
        $receiver_0.firstNames = 'Guest';
        $receiver_0.lastName = 'User';
        this.state_0 = 2;
        this.result_0 = insertPersonAndGroup(tmp$_1, $receiver_0, 17, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$guestPerson = this.result_0;
        this.state_0 = 3;
        this.result_0 = this.$this.getSiteFromDbOrLoadFromHttp_0(this.local$endpointUrl, this.local$repo.value, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.state_0 = 4;
        this.result_0 = this.$this.addSession_6qe9wg$(this.local$guestPerson, this.local$endpointUrl, null, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.$this.activeSession = this.result_0;
        return;
      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);
};
  UstadAccountManager.prototype.startGuestSession_61zpoe$ = function(endpointUrl_0, continuation_0, suspended) {
  var instance = new Coroutine$startGuestSession_61zpoe$(this, endpointUrl_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function UstadAccountManager$Companion() {
    UstadAccountManager$Companion_instance = this;
    var $receiver = new Person();
    $receiver.personUid = L0;
    $receiver.firstNames = 'Guest';
    $receiver.lastName = 'User';
    this.GUEST_PERSON = $receiver;
    this.ACCOUNTS_ACTIVE_SESSION_PREFKEY = 'accountmgr.activesession';
    this.ACCOUNTS_ACTIVE_ENDPOINT_PREFKEY = 'accountmgr.activeendpoint';
    this.ACCOUNTS_ENDPOINTS_WITH_ACTIVE_SESSION = 'accountmgr.endpointswithsessions';
    this.MANIFEST_URL_FALLBACK = 'http://localhost/';
  }
  UstadAccountManager$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var UstadAccountManager$Companion_instance = null;
  function UstadAccountManager$Companion_getInstance() {
    if (UstadAccountManager$Companion_instance === null) {
      new UstadAccountManager$Companion();
    }
    return UstadAccountManager$Companion_instance;
  }
  function Coroutine$UstadAccountManager_init$lambda$lambda(closure$allEndpoints_0, this$UstadAccountManager_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$allEndpoints = closure$allEndpoints_0;
    this.local$this$UstadAccountManager = this$UstadAccountManager_0;
    this.local$tmp$ = void 0;
  }
  Coroutine$UstadAccountManager_init$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$UstadAccountManager_init$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$UstadAccountManager_init$lambda$lambda.prototype.constructor = Coroutine$UstadAccountManager_init$lambda$lambda;
  Coroutine$UstadAccountManager_init$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$tmp$ = this.local$closure$allEndpoints.iterator();
        this.state_0 = 2;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 4;
          continue;
        }
        var element = this.local$tmp$.next();
        this.state_0 = 3;
        this.result_0 = this.local$this$UstadAccountManager.addActiveEndpoint_0(element, void 0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.state_0 = 2;
        continue;
      case 4:
        return Unit;
      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 UstadAccountManager_init$lambda$lambda(closure$allEndpoints_0, this$UstadAccountManager_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$UstadAccountManager_init$lambda$lambda(closure$allEndpoints_0, this$UstadAccountManager_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function UstadAccountManager$storedAccountsLive$lambda$lambda(this$) {
    return function(userSessionList) {
  var tmp$ = this$;
  var destination = ArrayList_init_0(collectionSizeOrDefault(userSessionList, 10));
  var tmp$_0;
  tmp$_0 = userSessionList.iterator();
  while (tmp$_0.hasNext()) {
    var item = tmp$_0.next();
    destination.add_11rb$(item.toUmAccount());
  }
  tmp$.setVal_11rb$(destination);
  return Unit;
};
  }
  UstadAccountManager.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UstadAccountManager', 
  interfaces: [IncomingReplicationListener]};
  function ClazzAssignmentIncomingReplicationListener(site, di) {
    this.site = site;
    this.di = di;
    var $receiver = this.di;
    var context = this.site;
    var trigger;
    trigger = $receiver.diTrigger;
    var tmp$;
    var tmp$_0;
    this.db_lil1l7$_0 = Instance(On($receiver, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$ : throwCCE(), context), trigger), Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_0 : throwCCE(), 1).provideDelegate_tpuvb9$(this, ClazzAssignmentIncomingReplicationListener$db_metadata);
  }
  var ClazzAssignmentIncomingReplicationListener$db_metadata = new PropertyMetadata('db');
  Object.defineProperty(ClazzAssignmentIncomingReplicationListener.prototype, 'db', {
  configurable: true, 
  get: function() {
  return this.db_lil1l7$_0.value;
}});
  function Coroutine$onIncomingReplicationProcessed_hioxzo$_0($this, incomingReplicationEvent_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$ = void 0;
    this.local$incomingReplicationEvent = incomingReplicationEvent_0;
  }
  Coroutine$onIncomingReplicationProcessed_hioxzo$_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onIncomingReplicationProcessed_hioxzo$_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onIncomingReplicationProcessed_hioxzo$_0.prototype.constructor = Coroutine$onIncomingReplicationProcessed_hioxzo$_0;
  Coroutine$onIncomingReplicationProcessed_hioxzo$_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$incomingReplicationEvent.tableId === 520) {
          var $receiver = this.local$incomingReplicationEvent.incomingReplicationData;
          var destination = ArrayList_init();
          var tmp$;
          tmp$ = $receiver.iterator();
          while (tmp$.hasNext()) {
            var element = tmp$.next();
            var tmp$_0;
            var tmp$_1, tmp$_2;
            if ((tmp$_0 = (tmp$_2 = (tmp$_1 = get_jsonObject(element).get_11rb$('caUid')) != null ? get_jsonPrimitive(tmp$_1) : null) != null ? get_longOrNull(tmp$_2) : null) != null) {
              destination.add_11rb$(tmp$_0);
            }
          }
          var clazzAssignmentUids = destination;
          this.local$tmp$ = chunked(clazzAssignmentUids, 100).iterator();
          this.state_0 = 2;
          continue;
        } else {
          this.state_0 = 5;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 4;
          continue;
        }
        var element_0 = this.local$tmp$.next();
        this.state_0 = 3;
        this.result_0 = this.$this.db.cacheClazzAssignmentDao.invalidateCacheByAssignmentList_gox9k8$(element_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.state_0 = 2;
        continue;
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        return;
      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);
};
  ClazzAssignmentIncomingReplicationListener.prototype.onIncomingReplicationProcessed_hioxzo$ = function(incomingReplicationEvent_0, continuation_0, suspended) {
  var instance = new Coroutine$onIncomingReplicationProcessed_hioxzo$_0(this, incomingReplicationEvent_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ClazzAssignmentIncomingReplicationListener.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzAssignmentIncomingReplicationListener', 
  interfaces: [IncomingReplicationListener]};
  function AbstractContentEntryPlugin(context, endpoint, di) {
    this.context = context;
    this.endpoint = endpoint;
    this.di_3nertg$_0 = di;
    var $receiver = this.di;
    var context_0 = this.endpoint;
    var trigger;
    trigger = $receiver.diTrigger;
    var tmp$;
    var tmp$_0;
    this.repo_rmhnbb$_0 = Instance(On($receiver, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$ : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_0 : throwCCE(), 1).provideDelegate_tpuvb9$(this, AbstractContentEntryPlugin$repo_metadata);
    var $receiver_0 = this.di;
    var context_1 = this.endpoint;
    var trigger_0;
    trigger_0 = $receiver_0.diTrigger;
    var tmp$_1;
    var tmp$_2;
    this.db_3nernf$_0 = Instance(On($receiver_0, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$_1 : throwCCE(), context_1), trigger_0), Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_2 : throwCCE(), 1).provideDelegate_tpuvb9$(this, AbstractContentEntryPlugin$db_metadata);
  }
  Object.defineProperty(AbstractContentEntryPlugin.prototype, 'di', {
  get: function() {
  return this.di_3nertg$_0;
}});
  var AbstractContentEntryPlugin$repo_metadata = new PropertyMetadata('repo');
  Object.defineProperty(AbstractContentEntryPlugin.prototype, 'repo', {
  configurable: true, 
  get: function() {
  return this.repo_rmhnbb$_0.value;
}});
  var AbstractContentEntryPlugin$db_metadata = new PropertyMetadata('db');
  Object.defineProperty(AbstractContentEntryPlugin.prototype, 'db', {
  configurable: true, 
  get: function() {
  return this.db_3nernf$_0.value;
}});
  function Coroutine$updateContentEntryUidsFromSourceUrlIfNeeded_letzpf$($this, contentJobItem_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$contentJobItem = contentJobItem_0;
  }
  Coroutine$updateContentEntryUidsFromSourceUrlIfNeeded_letzpf$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$updateContentEntryUidsFromSourceUrlIfNeeded_letzpf$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$updateContentEntryUidsFromSourceUrlIfNeeded_letzpf$.prototype.constructor = Coroutine$updateContentEntryUidsFromSourceUrlIfNeeded_letzpf$;
  Coroutine$updateContentEntryUidsFromSourceUrlIfNeeded_letzpf$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        if (equals(this.local$contentJobItem.cjiContentEntryUid, L0)) {
          var urlArgs = (tmp$ = this.local$contentJobItem.sourceUri) != null ? UMFileUtil_getInstance().parseURLQueryString(tmp$) : null;
          tmp$_1 = (tmp$_0 = urlArgs != null ? urlArgs.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID) : null) != null ? toLong(tmp$_0) : null;
          if (tmp$_1 == null) {
            throw IllegalArgumentException_init('ContentJob has no contententry specified and it is not in sourceUrl');
          }
          var contentEntryUid = tmp$_1;
          this.local$contentJobItem.cjiContentEntryUid = contentEntryUid;
          this.state_0 = 2;
          this.result_0 = this.$this.db.contentJobItemDao.updateContentEntryUid_3pjtqy$(this.local$contentJobItem.cjiUid, contentEntryUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        continue;
      case 3:
        return;
      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);
};
  AbstractContentEntryPlugin.prototype.updateContentEntryUidsFromSourceUrlIfNeeded_letzpf$ = function(contentJobItem_0, continuation_0, suspended) {
  var instance = new Coroutine$updateContentEntryUidsFromSourceUrlIfNeeded_letzpf$(this, contentJobItem_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$extractMetadata_dead0s$($this, viewName_0, uri_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$_1 = void 0;
    this.local$viewName = viewName_0;
    this.local$uri = uri_0;
  }
  Coroutine$extractMetadata_dead0s$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$extractMetadata_dead0s$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$extractMetadata_dead0s$.prototype.constructor = Coroutine$extractMetadata_dead0s$;
  Coroutine$extractMetadata_dead0s$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        var uriStr = this.local$uri.toString();
        if (contains(uriStr, UstadMobileSystemCommon$Companion_getInstance().LINK_ENDPOINT_VIEWNAME_DIVIDER + this.local$viewName)) {
          var entityUid = (tmp$_0 = (tmp$ = UMFileUtil_getInstance().parseURLQueryString(uriStr).get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
          this.state_0 = 2;
          this.result_0 = this.$this.repo.contentEntryDao.findByUidWithLanguageAsync_s8cxhz$(entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          return null;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.local$tmp$_1 = this.result_0;
        if (this.local$tmp$_1 == null) {
          return null;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 3:
        var contentEntry = this.local$tmp$_1;
        return new MetadataResult(contentEntry, this.$this.pluginId);
      case 4:
        return;
      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);
};
  AbstractContentEntryPlugin.prototype.extractMetadata_dead0s$ = function(viewName_0, uri_0, continuation_0, suspended) {
  var instance = new Coroutine$extractMetadata_dead0s$(this, viewName_0, uri_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  AbstractContentEntryPlugin.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'AbstractContentEntryPlugin', 
  interfaces: [ContentPlugin, DIAware]};
  function AudioCodecInfo(sampleRate, channelCount) {
    this.sampleRate = sampleRate;
    this.channelCount = channelCount;
  }
  AudioCodecInfo.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'AudioCodecInfo', 
  interfaces: []};
  AudioCodecInfo.prototype.component1 = function() {
  return this.sampleRate;
};
  AudioCodecInfo.prototype.component2 = function() {
  return this.channelCount;
};
  AudioCodecInfo.prototype.copy_vux9f0$ = function(sampleRate, channelCount) {
  return new AudioCodecInfo(sampleRate === void 0 ? this.sampleRate : sampleRate, channelCount === void 0 ? this.channelCount : channelCount);
};
  AudioCodecInfo.prototype.toString = function() {
  return 'AudioCodecInfo(sampleRate=' + Kotlin.toString(this.sampleRate) + (', channelCount=' + Kotlin.toString(this.channelCount)) + ')';
};
  AudioCodecInfo.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.sampleRate) | 0;
  result = result * 31 + Kotlin.hashCode(this.channelCount) | 0;
  return result;
};
  AudioCodecInfo.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.sampleRate, other.sampleRate) && Kotlin.equals(this.channelCount, other.channelCount)))));
};
  function ContentEntryBranchDownloadPlugin(context, endpoint, di) {
    ContentEntryBranchDownloadPlugin$Companion_getInstance();
    AbstractContentEntryPlugin.call(this, context, endpoint, di);
  }
  Object.defineProperty(ContentEntryBranchDownloadPlugin.prototype, 'pluginId', {
  configurable: true, 
  get: function() {
  return 11;
}});
  Object.defineProperty(ContentEntryBranchDownloadPlugin.prototype, 'supportedMimeTypes', {
  configurable: true, 
  get: function() {
  return emptyList();
}});
  Object.defineProperty(ContentEntryBranchDownloadPlugin.prototype, 'supportedFileExtensions', {
  configurable: true, 
  get: function() {
  return emptyList();
}});
  ContentEntryBranchDownloadPlugin.prototype.extractMetadata_80ka5$ = function(uri, process, continuation) {
  return this.extractMetadata_dead0s$(ContentEntryList2View$Companion_getInstance().VIEW_NAME, uri, continuation);
};
  function Coroutine$processJob_12gysh$($this, jobItem_0, process_0, progress_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$contentJobItem = void 0;
    this.local$contentEntryUid = void 0;
    this.local$jobUid = void 0;
    this.local$offset = void 0;
    this.local$batchSize = void 0;
    this.local$childItemParams = void 0;
    this.local$jobItem = jobItem_0;
  }
  Coroutine$processJob_12gysh$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$processJob_12gysh$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$processJob_12gysh$.prototype.constructor = Coroutine$processJob_12gysh$;
  Coroutine$processJob_12gysh$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        tmp$ = this.local$jobItem.contentJob;
        if (tmp$ == null) {
          throw IllegalArgumentException_init('no job!');
        }
        var job = tmp$;
        tmp$_0 = this.local$jobItem.contentJobItem;
        if (tmp$_0 == null) {
          throw IllegalArgumentException_init('No job item!');
        }
        this.local$contentJobItem = tmp$_0;
        this.local$contentEntryUid = this.local$contentJobItem.cjiContentEntryUid;
        this.local$jobUid = job.cjUid;
        this.local$offset = 0;
        this.local$batchSize = 500;
        this.state_0 = 2;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        this.result_0 = this.$this.repo.contentEntryDao.getContentJobItemParamsByParentUid_liip7b$(this.local$contentEntryUid, this.local$batchSize, this.local$offset, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$childItemParams = this.result_0;
        var $receiver = this.local$childItemParams;
        var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
        var tmp$_1;
        tmp$_1 = $receiver.iterator();
        while (tmp$_1.hasNext()) {
          var item = tmp$_1.next();
          var tmp$_2 = destination.add_11rb$;
          var $receiver_0 = new ContentJobItem();
          $receiver_0.cjiItemTotal = item.mostRecentContainerSize;
          $receiver_0.cjiJobUid = this.local$jobUid;
          $receiver_0.cjiContentEntryUid = item.contentEntryUid;
          $receiver_0.sourceUri = makeContentEntryDeepLink(item.contentEntryUid, item.leaf, this.$this.endpoint);
          $receiver_0.cjiPluginId = item.leaf ? 10 : 11;
          $receiver_0.cjiStatus = 4;
          $receiver_0.cjiIsLeaf = item.leaf;
          $receiver_0.cjiConnectivityNeeded = true;
          $receiver_0.cjiParentCjiUid = this.local$contentJobItem.cjiUid;
          $receiver_0.cjiParentContentEntryUid = this.local$contentJobItem.cjiContentEntryUid;
          tmp$_2.call(destination, $receiver_0);
        }
        var jobItems = destination;
        this.state_0 = 4;
        this.result_0 = this.$this.db.contentJobItemDao.insertJobItems_xpde42$(jobItems, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.local$offset = this.local$offset + this.local$childItemParams.size | 0;
        if (this.local$childItemParams.size !== this.local$batchSize) {
          this.state_0 = 5;
          continue;
        }
        this.state_0 = 2;
        continue;
      case 5:
        return new ProcessResult(24);
      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);
};
  ContentEntryBranchDownloadPlugin.prototype.processJob_12gysh$ = function(jobItem_0, process_0, progress_0, continuation_0, suspended) {
  var instance = new Coroutine$processJob_12gysh$(this, jobItem_0, process_0, progress_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function ContentEntryBranchDownloadPlugin$Companion() {
    ContentEntryBranchDownloadPlugin$Companion_instance = this;
    this.CONTENT_ENTRY_BRANCH_DOWNLOAD_PLUGIN_ID = 11;
  }
  ContentEntryBranchDownloadPlugin$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ContentEntryBranchDownloadPlugin$Companion_instance = null;
  function ContentEntryBranchDownloadPlugin$Companion_getInstance() {
    if (ContentEntryBranchDownloadPlugin$Companion_instance === null) {
      new ContentEntryBranchDownloadPlugin$Companion();
    }
    return ContentEntryBranchDownloadPlugin$Companion_instance;
  }
  ContentEntryBranchDownloadPlugin.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContentEntryBranchDownloadPlugin', 
  interfaces: [AbstractContentEntryPlugin, DIAware]};
  function ContentTypePlugin() {
    ContentTypePlugin$Companion_getInstance();
  }
  function ContentTypePlugin$Companion() {
    ContentTypePlugin$Companion_instance = this;
    this.CONTENT_ENTRY = 'content_entry';
    this.CONTENT_MIMETYPE = 'content_mimetype';
  }
  ContentTypePlugin$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ContentTypePlugin$Companion_instance = null;
  function ContentTypePlugin$Companion_getInstance() {
    if (ContentTypePlugin$Companion_instance === null) {
      new ContentTypePlugin$Companion();
    }
    return ContentTypePlugin$Companion_instance;
  }
  ContentTypePlugin.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContentTypePlugin', 
  interfaces: []};
  function ScormTypePlugin() {
    ScormTypePlugin$Companion_getInstance();
  }
  Object.defineProperty(ScormTypePlugin.prototype, 'viewName', {
  configurable: true, 
  get: function() {
  return 'ScormViewTodo';
}});
  Object.defineProperty(ScormTypePlugin.prototype, 'mimeTypes', {
  configurable: true, 
  get: function() {
  return ScormTypePlugin$Companion_getInstance().MIME_TYPES.slice();
}});
  Object.defineProperty(ScormTypePlugin.prototype, 'fileExtensions', {
  configurable: true, 
  get: function() {
  return ['zip'];
}});
  ScormTypePlugin.prototype.extractMetadata_bm4g0d$ = function(uri, context, continuation) {
  throw new NotImplementedError_init('An operation is not implemented: ' + 'Not yet implemented');
};
  ScormTypePlugin.prototype.importToContainer_6upns4$ = function(uri, conversionParams, contentEntryUid, mimeType, containerBaseDir, context, db, repo, progressListener, continuation) {
  throw new NotImplementedError_init('An operation is not implemented: ' + 'Not yet implemented');
};
  function ScormTypePlugin$Companion() {
    ScormTypePlugin$Companion_instance = this;
    this.MIME_TYPES = ['application/scorm+zip'];
  }
  ScormTypePlugin$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ScormTypePlugin$Companion_instance = null;
  function ScormTypePlugin$Companion_getInstance() {
    if (ScormTypePlugin$Companion_instance === null) {
      new ScormTypePlugin$Companion();
    }
    return ScormTypePlugin$Companion_instance;
  }
  ScormTypePlugin.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ScormTypePlugin', 
  interfaces: [ContentTypePlugin]};
  function VideoTypePlugin() {
    VideoTypePlugin$Companion_getInstance();
  }
  Object.defineProperty(VideoTypePlugin.prototype, 'viewName', {
  configurable: true, 
  get: function() {
  return VideoContentView$Companion_getInstance().VIEW_NAME;
}});
  Object.defineProperty(VideoTypePlugin.prototype, 'supportedMimeTypes', {
  configurable: true, 
  get: function() {
  return toList(VideoContentPresenterCommon$Companion_getInstance().VIDEO_MIME_MAP.keys);
}});
  Object.defineProperty(VideoTypePlugin.prototype, 'supportedFileExtensions', {
  configurable: true, 
  get: function() {
  var $receiver = VideoContentPresenterCommon$Companion_getInstance().VIDEO_EXT_LIST;
  var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
  var tmp$;
  tmp$ = $receiver.iterator();
  while (tmp$.hasNext()) {
    var item = tmp$.next();
    destination.add_11rb$(removePrefix(item, '.'));
  }
  return destination;
}});
  Object.defineProperty(VideoTypePlugin.prototype, 'pluginId', {
  configurable: true, 
  get: function() {
  return 12;
}});
  function VideoTypePlugin$Companion() {
    VideoTypePlugin$Companion_instance = this;
    this.VIDEO_BIT_RATE = 250000;
    this.VIDEO_FRAME_INTERVAL = 5;
    this.VIDEO_FRAME_RATE = 30;
    this.AUDIO_SAMPLE_RATE = 48000;
    this.AUDIO_CHANNEL_COUNT = 2;
    this.AUDIO_BIT_RATE = 64000;
    this.PLUGIN_ID = 12;
  }
  VideoTypePlugin$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var VideoTypePlugin$Companion_instance = null;
  function VideoTypePlugin$Companion_getInstance() {
    if (VideoTypePlugin$Companion_instance === null) {
      new VideoTypePlugin$Companion();
    }
    return VideoTypePlugin$Companion_instance;
  }
  VideoTypePlugin.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'VideoTypePlugin', 
  interfaces: [ContentPlugin]};
  function CompressionFilter() {
  }
  CompressionFilter.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'CompressionFilter', 
  interfaces: []};
  function ContainerAddOptions(storageDirUri, moveFiles, compressionFilter, fileNamer, updateContainer) {
    ContainerAddOptions$Companion_getInstance();
    if (moveFiles === void 0) 
      moveFiles = false;
    if (compressionFilter === void 0) 
      compressionFilter = ContainerAddOptions$Companion_getInstance().DEFAULT_COMPRESSION_FILTER;
    if (fileNamer === void 0) 
      fileNamer = ContainerAddOptions$Companion_getInstance().DEFAULT_FILE_NAMER;
    if (updateContainer === void 0) 
      updateContainer = true;
    this.storageDirUri = storageDirUri;
    this.moveFiles = moveFiles;
    this.compressionFilter = compressionFilter;
    this.fileNamer = fileNamer;
    this.updateContainer = updateContainer;
  }
  function ContainerAddOptions$Companion() {
    ContainerAddOptions$Companion_instance = this;
    this.NEVER_COMPRESS_FILTER = new ContainerAddOptions$Companion$NEVER_COMPRESS_FILTER$ObjectLiteral();
    this.DEFAULT_COMPRESSION_FILTER = new ContainerAddOptions$Companion$DEFAULT_COMPRESSION_FILTER$ObjectLiteral();
    this.DEFAULT_FILE_NAMER = new ContainerAddOptions$Companion$DEFAULT_FILE_NAMER$ObjectLiteral();
  }
  function ContainerAddOptions$Companion$NEVER_COMPRESS_FILTER$ObjectLiteral() {
  }
  ContainerAddOptions$Companion$NEVER_COMPRESS_FILTER$ObjectLiteral.prototype.shouldCompress_jyasbz$ = function(pathInContainer, mimeType) {
  return false;
};
  ContainerAddOptions$Companion$NEVER_COMPRESS_FILTER$ObjectLiteral.$metadata$ = {
  kind: Kind_CLASS, 
  interfaces: [CompressionFilter]};
  function ContainerAddOptions$Companion$DEFAULT_COMPRESSION_FILTER$ObjectLiteral() {
    this.mediaExtensions_0 = listOf(['.mp4', '.mkv', '.webm', '.mov', '.avi', '.flv', '.mp3', '.ogg', '.wav', '.au', '.3gp', '.m4a', '.m4v']);
  }
  ContainerAddOptions$Companion$DEFAULT_COMPRESSION_FILTER$ObjectLiteral.prototype.shouldCompress_jyasbz$ = function(pathInContainer, mimeType) {
  var pathLowerCase = pathInContainer.toLowerCase();
  var $receiver = this.mediaExtensions_0;
  var any$result;
  any$break:
    do {
      var tmp$;
      if (Kotlin.isType($receiver, Collection) && $receiver.isEmpty()) {
        any$result = false;
        break any$break;
      }
      tmp$ = $receiver.iterator();
      while (tmp$.hasNext()) {
        var element = tmp$.next();
        if (endsWith(pathLowerCase, element)) {
          any$result = true;
          break any$break;
        }
      }
      any$result = false;
    } while (false);
  var isVideoExtension = any$result;
  return !isVideoExtension && (mimeType != null ? startsWith(mimeType, 'video/') : null) !== true;
};
  ContainerAddOptions$Companion$DEFAULT_COMPRESSION_FILTER$ObjectLiteral.$metadata$ = {
  kind: Kind_CLASS, 
  interfaces: [CompressionFilter]};
  function ContainerAddOptions$Companion$DEFAULT_FILE_NAMER$ObjectLiteral() {
  }
  ContainerAddOptions$Companion$DEFAULT_FILE_NAMER$ObjectLiteral.prototype.nameContainerFile_puj7f4$ = function(relPathIn, uriIn) {
  return relPathIn;
};
  ContainerAddOptions$Companion$DEFAULT_FILE_NAMER$ObjectLiteral.$metadata$ = {
  kind: Kind_CLASS, 
  interfaces: [ContainerFileNamer]};
  ContainerAddOptions$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ContainerAddOptions$Companion_instance = null;
  function ContainerAddOptions$Companion_getInstance() {
    if (ContainerAddOptions$Companion_instance === null) {
      new ContainerAddOptions$Companion();
    }
    return ContainerAddOptions$Companion_instance;
  }
  ContainerAddOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContainerAddOptions', 
  interfaces: []};
  ContainerAddOptions.prototype.component1 = function() {
  return this.storageDirUri;
};
  ContainerAddOptions.prototype.component2 = function() {
  return this.moveFiles;
};
  ContainerAddOptions.prototype.component3 = function() {
  return this.compressionFilter;
};
  ContainerAddOptions.prototype.component4 = function() {
  return this.fileNamer;
};
  ContainerAddOptions.prototype.component5 = function() {
  return this.updateContainer;
};
  ContainerAddOptions.prototype.copy_gqd0h4$ = function(storageDirUri, moveFiles, compressionFilter, fileNamer, updateContainer) {
  return new ContainerAddOptions(storageDirUri === void 0 ? this.storageDirUri : storageDirUri, moveFiles === void 0 ? this.moveFiles : moveFiles, compressionFilter === void 0 ? this.compressionFilter : compressionFilter, fileNamer === void 0 ? this.fileNamer : fileNamer, updateContainer === void 0 ? this.updateContainer : updateContainer);
};
  ContainerAddOptions.prototype.toString = function() {
  return 'ContainerAddOptions(storageDirUri=' + Kotlin.toString(this.storageDirUri) + (', moveFiles=' + Kotlin.toString(this.moveFiles)) + (', compressionFilter=' + Kotlin.toString(this.compressionFilter)) + (', fileNamer=' + Kotlin.toString(this.fileNamer)) + (', updateContainer=' + Kotlin.toString(this.updateContainer)) + ')';
};
  ContainerAddOptions.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.storageDirUri) | 0;
  result = result * 31 + Kotlin.hashCode(this.moveFiles) | 0;
  result = result * 31 + Kotlin.hashCode(this.compressionFilter) | 0;
  result = result * 31 + Kotlin.hashCode(this.fileNamer) | 0;
  result = result * 31 + Kotlin.hashCode(this.updateContainer) | 0;
  return result;
};
  ContainerAddOptions.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.storageDirUri, other.storageDirUri) && Kotlin.equals(this.moveFiles, other.moveFiles) && Kotlin.equals(this.compressionFilter, other.compressionFilter) && Kotlin.equals(this.fileNamer, other.fileNamer) && Kotlin.equals(this.updateContainer, other.updateContainer)))));
};
  function ContainerFileNamer() {
  }
  ContainerFileNamer.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContainerFileNamer', 
  interfaces: []};
  function PrefixContainerFileNamer(prefix) {
    this.prefix = prefix;
  }
  PrefixContainerFileNamer.prototype.nameContainerFile_puj7f4$ = function(relPathIn, uriIn) {
  return this.prefix + relPathIn;
};
  PrefixContainerFileNamer.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'PrefixContainerFileNamer', 
  interfaces: [ContainerFileNamer]};
  function ContentImportManager() {
  }
  ContentImportManager.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContentImportManager', 
  interfaces: []};
  function EpubNavDocument() {
    EpubNavDocument$Companion_getInstance();
    this.navItems_0 = LinkedHashMap_init();
    this.ncxNavMap_ifqhqt$_0 = null;
    this.navElements_0 = ArrayList_init();
  }
  Object.defineProperty(EpubNavDocument.prototype, 'ncxNavMap', {
  configurable: true, 
  get: function() {
  return this.ncxNavMap_ifqhqt$_0;
}, 
  set: function(ncxNavMap) {
  this.ncxNavMap_ifqhqt$_0 = ncxNavMap;
}});
  Object.defineProperty(EpubNavDocument.prototype, 'toc', {
  configurable: true, 
  get: function() {
  var tmp$;
  tmp$ = this.navElements_0.iterator();
  loop_label:
    while (tmp$.hasNext()) {
      var item = tmp$.next();
      if (item.navElEpubTypeAttr == null) 
        continue loop_label;
      var tmp$_0 = ensureNotNull(item.navElEpubTypeAttr);
      var $receiver = Regex_init('\\s+').split_905azu$(tmp$_0, 0);
      var dropLastWhile$result;
      dropLastWhile$break:
        do {
          if (!$receiver.isEmpty()) {
            var iterator = $receiver.listIterator_za3lpa$($receiver.size);
            while (iterator.hasPrevious()) {
              if (!(iterator.previous().length === 0)) {
                dropLastWhile$result = take($receiver, iterator.nextIndex() + 1 | 0);
                break dropLastWhile$break;
              }
            }
          }
          dropLastWhile$result = emptyList();
        } while (false);
      if (contains_0(copyToArray(dropLastWhile$result).slice(), EpubNavDocument$Companion_getInstance().EPUB_NAV_DOCUMENT_TYPE_TOC_0)) 
        return item;
    }
  return null;
}});
  function EpubNavDocument$load$lambda(closure$xpp, closure$evtType) {
    return function() {
  closure$evtType.v = closure$xpp.next();
  return closure$evtType.v;
};
  }
  EpubNavDocument.prototype.load_gtk95s$ = function(xpp) {
  var tmp$, tmp$_0;
  xpp.setFeature_ivxn3r$(xmlpullparserkmp.XmlPullParserConstants.FEATURE_PROCESS_NAMESPACES, true);
  var evtType = {
  v: -1};
  var currentNav = null;
  var currentItem = null;
  var itemDepth = 0;
  var tagName;
  while (EpubNavDocument$load$lambda(xpp, evtType)() !== 1) {
    switch (evtType.v) {
      case 2:
        tagName = (tmp$ = xpp.getName()) != null ? tmp$ : '';
        if (equals(tagName, 'nav')) {
          currentNav = new EpubNavItem(null, null, null, 0);
          var navTypeAttr = xpp.getAttributeValue_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_OPS_0, 'type');
          var idAttrVal = xpp.getAttributeValue_f5e6j7$(null, 'id');
          if (navTypeAttr != null) 
            currentNav.navElEpubTypeAttr = navTypeAttr;
          if (idAttrVal != null) {
            currentNav.id = idAttrVal;
            var $receiver = this.navItems_0;
            var value = currentNav;
            $receiver.put_xwzc9p$(idAttrVal, value);
          }
          this.navElements_0.add_11rb$(currentNav);
        } else if (equals_0(tagName, 'navMap', true)) {
          currentNav = new EpubNavItem(null, null, null, 0);
          this.ncxNavMap = currentNav;
        } else if (equals(tagName, 'li')) {
          currentItem = EpubNavItem_init(currentItem != null ? currentItem : currentNav, itemDepth);
          itemDepth = itemDepth + 1 | 0;
        } else if (equals(tagName, 'a')) {
                    currentItem != null ? (currentItem.href = xpp.getAttributeValue_f5e6j7$(null, 'href')) : null;
          if (xpp.next() === 4) {
                        currentItem != null ? (currentItem.title = xpp.getText()) : null;
          }
        } else if (equals_0(tagName, 'navPoint', true)) {
          currentItem = EpubNavItem_init(currentItem != null ? currentItem : currentNav, itemDepth);
        } else if (equals(tagName, 'text')) {
          if (xpp.next() === 4) {
                        currentItem != null ? (currentItem.title = xpp.getText()) : null;
          }
        } else if (equals(tagName, 'content')) {
                    currentItem != null ? (currentItem.href = xpp.getAttributeValue_f5e6j7$(null, 'src')) : null;
        }
        break;
      case 3:
        if (equals(xpp.getName(), 'nav')) {
          currentNav = null;
        } else if (equals(xpp.getName(), 'li')) {
          currentItem = currentItem != null ? currentItem.parent : null;
          itemDepth = itemDepth - 1 | 0;
        } else if (equals_0(xpp.getName(), 'navPoint', true)) {
          currentItem = currentItem != null ? currentItem.parent : null;
          tmp$_0 = itemDepth , itemDepth = tmp$_0 - 1 | 0;
        }
        break;
    }
  }
};
  EpubNavDocument.prototype.serialize_kkjgj2$ = function(xs) {
  var tmp$, tmp$_0;
  xs.startDocument_ivxn3r$('UTF-8', false);
  xs.setPrefix_puj7f4$('', EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML);
  xs.setPrefix_puj7f4$('epub', EpubNavDocument$Companion_getInstance().NAMESPACE_OPS_0);
  xs.startTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'html').startTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'head').startTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'meta').attribute_kunee3$(null, 'charset', 'UTF-8').endTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'meta').endTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'head').startTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'body');
  tmp$ = this.navElements_0.iterator();
  while (tmp$.hasNext()) {
    var navItem = tmp$.next();
    xs.startTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'nav');
    if (navItem.id != null) 
      xs.attribute_kunee3$(null, 'id', ensureNotNull(navItem.id));
    if (navItem.navElEpubTypeAttr != null) 
      xs.attribute_kunee3$(EpubNavDocument$Companion_getInstance().NAMESPACE_OPS_0, 'type', ensureNotNull(navItem.navElEpubTypeAttr));
    xs.startTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'ol');
    tmp$_0 = ensureNotNull(navItem.getChildren()).iterator();
    while (tmp$_0.hasNext()) {
      var childItem = tmp$_0.next();
      this.writeNavItem_0(childItem, xs);
    }
    xs.endTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'ol').endTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'nav');
  }
  xs.endTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'body');
  xs.endTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'html');
  xs.endDocument();
};
  EpubNavDocument.prototype.writeNavItem_0 = function(item, xs) {
  var tmp$;
  xs.startTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'li').startTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'a').attribute_kunee3$(null, 'href', ensureNotNull(item.href)).text_61zpoe$(ensureNotNull(item.title)).endTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'a');
  if (item.hasChildren()) {
    xs.startTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'ol');
    tmp$ = ensureNotNull(item.getChildren()).iterator();
    while (tmp$.hasNext()) {
      var child = tmp$.next();
      this.writeNavItem_0(child, xs);
    }
    xs.endTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'ol');
  }
  xs.endTag_f5e6j7$(EpubNavDocument$Companion_getInstance().NAMESPACE_XHTML, 'li');
};
  EpubNavDocument.prototype.getNavById_61zpoe$ = function(id) {
  var tmp$;
  if (this.navItems_0.containsKey_11rb$(id)) {
    tmp$ = this.navItems_0.get_11rb$(id);
  } else {
    tmp$ = null;
  }
  return tmp$;
};
  function EpubNavDocument$findByHref$lambda(closure$href, this$EpubNavDocument) {
    return function(it) {
  return this$EpubNavDocument.findByHref_qi7f3s$(it, closure$href);
};
  }
  EpubNavDocument.prototype.findByHref_qi7f3s$ = function($receiver, href) {
  var tmp$, tmp$_0, tmp$_1;
  if (equals($receiver.href, href)) 
    return $receiver;
  var tmp$_2;
  if ((tmp$_1 = (tmp$_0 = (tmp$ = $receiver.getChildren()) != null ? asSequence(tmp$) : null) != null ? map(tmp$_0, EpubNavDocument$findByHref$lambda(href, this)) : null) != null) {
    var firstOrNull$result;
    firstOrNull$break:
      do {
        var tmp$_3;
        tmp$_3 = tmp$_1.iterator();
        while (tmp$_3.hasNext()) {
          var element = tmp$_3.next();
          if (element != null) {
            firstOrNull$result = element;
            break firstOrNull$break;
          }
        }
        firstOrNull$result = null;
      } while (false);
    tmp$_2 = firstOrNull$result;
  } else 
    tmp$_2 = null;
  return tmp$_2;
};
  function EpubNavDocument$getNavByHref$lambda(closure$href, this$EpubNavDocument) {
    return function(it) {
  return this$EpubNavDocument.findByHref_qi7f3s$(it, closure$href);
};
  }
  EpubNavDocument.prototype.getNavByHref_61zpoe$ = function(href) {
  var tmp$, tmp$_0;
  var $receiver = map(asSequence(this.navElements_0), EpubNavDocument$getNavByHref$lambda(href, this));
  var firstOrNull$result;
  firstOrNull$break:
    do {
      var tmp$_1;
      tmp$_1 = $receiver.iterator();
      while (tmp$_1.hasNext()) {
        var element = tmp$_1.next();
        if (element != null) {
          firstOrNull$result = element;
          break firstOrNull$break;
        }
      }
      firstOrNull$result = null;
    } while (false);
  var result = (tmp$_0 = firstOrNull$result) != null ? tmp$_0 : (tmp$ = this.ncxNavMap) != null ? this.findByHref_qi7f3s$(tmp$, href) : null;
  return result;
};
  function EpubNavDocument$Companion() {
    EpubNavDocument$Companion_instance = this;
    this.EPUB_NAV_DOCUMENT_TYPE_TOC_0 = 'toc';
    this.NAMESPACE_OPS_0 = 'http://www.idpf.org/2007/ops';
    this.NAMESPACE_XHTML = 'http://www.w3.org/1999/xhtml';
  }
  EpubNavDocument$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var EpubNavDocument$Companion_instance = null;
  function EpubNavDocument$Companion_getInstance() {
    if (EpubNavDocument$Companion_instance === null) {
      new EpubNavDocument$Companion();
    }
    return EpubNavDocument$Companion_instance;
  }
  EpubNavDocument.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'EpubNavDocument', 
  interfaces: []};
  function EpubNavItem(title, href, parent, depth) {
    EpubNavItem$Companion_getInstance();
    this.title = title;
    this.href = href;
    this.parent = parent;
    this.depth = depth;
    this.id = null;
    this.children_0 = null;
    this.navElEpubTypeAttr = null;
    if (this.parent != null) {
      ensureNotNull(this.parent).addChild_97sg9z$(this);
    }
  }
  EpubNavItem.prototype.getChildren = function() {
  return this.children_0;
};
  EpubNavItem.prototype.setChildren_ekdi87$ = function(children) {
  this.children_0 = children;
};
  EpubNavItem.prototype.toString = function() {
  var tmp$;
  var sb = StringBuilder_init();
  tmp$ = this.depth;
  for (var i = 0; i < tmp$; i++) {
    sb.append_s8itvh$(32);
  }
  return sb.append_pdl1vj$(this.title).toString();
};
  EpubNavItem.prototype.addChild_97sg9z$ = function(child) {
  if (this.children_0 == null) {
    this.children_0 = ArrayList_init();
  }
  ensureNotNull(this.children_0).add_11rb$(child);
};
  EpubNavItem.prototype.size = function() {
  return this.children_0 != null ? ensureNotNull(this.children_0).size : 0;
};
  EpubNavItem.prototype.getChild_za3lpa$ = function(index) {
  return ensureNotNull(this.children_0).get_za3lpa$(index);
};
  EpubNavItem.prototype.hasChildren = function() {
  return this.children_0 != null && !ensureNotNull(this.children_0).isEmpty();
};
  function EpubNavItem$Companion() {
    EpubNavItem$Companion_instance = this;
  }
  EpubNavItem$Companion.prototype.findItemInVectorByHref_t0efi2$ = function(href, vector) {
  var itemHref;
  for (var i = 0; i !== vector.size; ++i) {
    var tmp$;
    itemHref = (Kotlin.isType(tmp$ = vector.get_za3lpa$(i), EpubNavItem) ? tmp$ : throwCCE()).href;
    if (itemHref != null && equals(UMFileUtil_getInstance().stripAnchorIfPresent_61zpoe$(itemHref), href)) {
      return i;
    }
  }
  return -1;
};
  EpubNavItem$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var EpubNavItem$Companion_instance = null;
  function EpubNavItem$Companion_getInstance() {
    if (EpubNavItem$Companion_instance === null) {
      new EpubNavItem$Companion();
    }
    return EpubNavItem$Companion_instance;
  }
  EpubNavItem.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'EpubNavItem', 
  interfaces: []};
  function EpubNavItem_init(parent, depth, $this) {
    $this = $this || Object.create(EpubNavItem.prototype);
    EpubNavItem.call($this, null, null, parent, depth);
    return $this;
  }
  function OcfDocument() {
    this.rootFiles_8be2vx$ = null;
    this.rootFiles_8be2vx$ = ArrayList_init();
  }
  OcfDocument.prototype.loadFromParser_gtk95s$ = function(xpp) {
  var evtType;
  do {
    evtType = xpp.next();
    if (evtType === 2) {
      if (equals(xpp.getName(), 'rootfile')) {
        var fullPath = xpp.getAttributeValue_f5e6j7$(null, 'full-path');
        var mediaType = xpp.getAttributeValue_f5e6j7$(null, 'media-type');
        this.rootFiles_8be2vx$.add_11rb$(new OcfRootFile(fullPath, mediaType));
      }
    }
  } while (evtType !== 1);
};
  OcfDocument.prototype.getRootFiles = function() {
  return this.rootFiles_8be2vx$;
};
  OcfDocument.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'OcfDocument', 
  interfaces: []};
  function OcfRootFile(fullPath, mediaType) {
    this.fullPath = fullPath;
    this.mediaType = mediaType;
  }
  OcfRootFile.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'OcfRootFile', 
  interfaces: []};
  function OpfCreator() {
    this.creator = null;
    this.id = null;
  }
  OpfCreator.prototype.toString = function() {
  var tmp$;
  return (tmp$ = this.creator) != null ? tmp$ : '';
};
  OpfCreator.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'OpfCreator', 
  interfaces: []};
  function OpfCreator_init($this) {
    $this = $this || Object.create(OpfCreator.prototype);
    OpfCreator.call($this);
    return $this;
  }
  function OpfCreator_init_0(creator, id, $this) {
    $this = $this || Object.create(OpfCreator.prototype);
    OpfCreator.call($this);
    $this.creator = creator;
    $this.id = id;
    return $this;
  }
  function OpfDocument() {
    OpfDocument$Companion_getInstance();
    this.spine_0 = null;
    this.manifestItems_0 = null;
    this.coverImages_0 = ArrayList_init();
    this.navItem = null;
    this.ncxItem = null;
    this.title = null;
    this.id = null;
    this.description = null;
    this.date = null;
    this.uniqueIdentifier_0 = null;
    this.links_0 = null;
    this.creators_8be2vx$ = null;
    this.languages_0 = ArrayList_init();
    this.spine_0 = ArrayList_init();
    this.manifestItems_0 = HashMap_init();
  }
  Object.defineProperty(OpfDocument.prototype, 'linearSpineHREFs', {
  configurable: true, 
  get: function() {
  var tmp$;
  var spineHREFs = ArrayList_init();
  tmp$ = this.spine_0;
  for (var i = 0; i !== tmp$.size; ++i) {
    if (ensureNotNull(this.spine_0.get_za3lpa$(i).isLinear)) {
      spineHREFs.add_11rb$(ensureNotNull(this.spine_0.get_za3lpa$(i).href));
    }
  }
  return copyToArray(spineHREFs);
}});
  Object.defineProperty(OpfDocument.prototype, 'numCreators', {
  configurable: true, 
  get: function() {
  return this.creators_8be2vx$ != null ? ensureNotNull(this.creators_8be2vx$).size : 0;
}});
  function OpfDocument$LinkElement() {
    OpfDocument$LinkElement$Companion_getInstance();
    this.rel = null;
    this.mediaType = null;
    this.href = null;
    this.id = null;
    this.refines = null;
  }
  function OpfDocument$LinkElement$Companion() {
    OpfDocument$LinkElement$Companion_instance = this;
    this.ATTR_REL_8be2vx$ = 'rel';
    this.ATTR_HREF_8be2vx$ = 'href';
    this.ATTR_MEDIA_TYPE_8be2vx$ = 'media-type';
    this.ATTR_ID_8be2vx$ = 'id';
    this.ATTR_REFINES_8be2vx$ = 'refines';
  }
  OpfDocument$LinkElement$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var OpfDocument$LinkElement$Companion_instance = null;
  function OpfDocument$LinkElement$Companion_getInstance() {
    if (OpfDocument$LinkElement$Companion_instance === null) {
      new OpfDocument$LinkElement$Companion();
    }
    return OpfDocument$LinkElement$Companion_instance;
  }
  OpfDocument$LinkElement.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'LinkElement', 
  interfaces: []};
  OpfDocument.prototype.loadFromOPF_h3yi26$ = function(xpp, parseFlags) {
  if (parseFlags === void 0) 
    parseFlags = 3;
  var tmp$, tmp$_0;
  var parseMetadata = (parseFlags & 1) === 1;
  var parseManifest = (parseFlags & 2) === 2;
  var evtType = xpp.getEventType();
  var filename;
  var itemMediaType;
  var id;
  var properties;
  var idref;
  var isLinear;
  var isLinearStrVal;
  var inMetadata = false;
  do {
    var tagName;
    var creator;
    var tagVal;
    if (parseManifest) {
      if (evtType === 2) {
        tagName = xpp.getName();
        if (tagName != null && equals(tagName, 'item')) {
          filename = ensureNotNull(xpp.getAttributeValue_f5e6j7$(null, 'href'));
          itemMediaType = ensureNotNull(xpp.getAttributeValue_f5e6j7$(null, 'media-type'));
          id = ensureNotNull(xpp.getAttributeValue_f5e6j7$(null, 'id'));
          var $receiver = xpp.getAttributeValue_f5e6j7$(null, 'properties');
          properties = $receiver == null || $receiver.length === 0 ? '' : xpp.getAttributeValue_f5e6j7$(null, 'properties');
          var item2 = new OpfItem();
          item2.href = filename;
          item2.mediaType = itemMediaType;
          item2.properties = properties;
          item2.id = id;
          if ((properties != null ? contains(properties, 'nav') : null) === true) {
            this.navItem = item2;
          }
          if ((properties != null ? contains(properties, 'cover-image') : null) === true) {
            this.addCoverImage_uvubhx$(item2);
          }
          this.manifestItems_0.put_xwzc9p$(id, item2);
        } else if (xpp.getName() != null && equals(xpp.getName(), 'itemref')) {
          idref = xpp.getAttributeValue_f5e6j7$(null, 'idref');
          isLinearStrVal = xpp.getAttributeValue_f5e6j7$(null, 'linear');
          var $receiver_0 = this.manifestItems_0;
          var tmp$_1;
          var spineItem = (Kotlin.isType(tmp$_1 = $receiver_0, Map) ? tmp$_1 : throwCCE()).get_11rb$(idref);
          if (spineItem != null) {
            if (isLinearStrVal != null) {
              var isLinearChar = isLinearStrVal.charCodeAt(0);
              isLinear = !(isLinearChar === 110 | isLinearChar === 78);
              var $receiver_1 = this.manifestItems_0;
              var tmp$_2;
                            (tmp$ = (Kotlin.isType(tmp$_2 = $receiver_1, Map) ? tmp$_2 : throwCCE()).get_11rb$(idref)) != null ? (tmp$.isLinear = isLinear) : null;
            }
            var tmp$_3 = this.spine_0;
            var $receiver_2 = this.manifestItems_0;
            var tmp$_4;
            tmp$_3.add_11rb$(ensureNotNull((Kotlin.isType(tmp$_4 = $receiver_2, Map) ? tmp$_4 : throwCCE()).get_11rb$(idref)));
          } else {
            UMLog$Companion_getInstance().l_273qip$(2, 209, idref);
          }
        } else if (equals(tagName, 'spine')) {
          this.ncxItem = (tmp$_0 = xpp.getAttributeValue_f5e6j7$(null, 'toc')) != null ? this.manifestItems_0.get_11rb$(tmp$_0) : null;
        }
      }
    }
    if (parseMetadata) {
      if (evtType === 2) {
        if (this.uniqueIdentifier_0 == null && equals(xpp.getName(), 'package')) {
          this.uniqueIdentifier_0 = xpp.getAttributeValue_f5e6j7$(null, 'unique-identifier');
        } else if (!inMetadata && equals(xpp.getName(), 'metadata')) {
          inMetadata = true;
        }
        if (inMetadata) {
          if (equals(xpp.getName(), 'dc:title')) {
            this.title = xpp.nextText();
          } else if (equals(xpp.getName(), 'dc:date')) {
            this.date = xpp.nextText();
          } else if (equals(xpp.getName(), 'dc:identifier')) {
            var idAttr = xpp.getAttributeValue_f5e6j7$(null, 'id');
            if (idAttr != null && equals(idAttr, this.uniqueIdentifier_0)) {
              this.id = xpp.nextText();
            }
          } else if (equals(xpp.getName(), 'dc:description')) {
            this.description = xpp.nextText();
          } else if (equals(xpp.getName(), 'link')) {
            var linkEl = new OpfDocument$LinkElement();
            linkEl.href = xpp.getAttributeValue_f5e6j7$(null, OpfDocument$LinkElement$Companion_getInstance().ATTR_HREF_8be2vx$);
            linkEl.id = xpp.getAttributeValue_f5e6j7$(null, OpfDocument$LinkElement$Companion_getInstance().ATTR_ID_8be2vx$);
            linkEl.mediaType = xpp.getAttributeValue_f5e6j7$(null, OpfDocument$LinkElement$Companion_getInstance().ATTR_MEDIA_TYPE_8be2vx$);
            linkEl.rel = xpp.getAttributeValue_f5e6j7$(null, OpfDocument$LinkElement$Companion_getInstance().ATTR_REL_8be2vx$);
            linkEl.refines = xpp.getAttributeValue_f5e6j7$(null, OpfDocument$LinkElement$Companion_getInstance().ATTR_REFINES_8be2vx$);
            if (this.links_0 == null) {
              this.links_0 = ArrayList_init();
            }
            ensureNotNull(this.links_0).add_11rb$(linkEl);
          } else if (equals(xpp.getName(), 'dc:creator')) {
            creator = OpfCreator_init();
            creator.id = xpp.getAttributeValue_f5e6j7$(null, OpfDocument$LinkElement$Companion_getInstance().ATTR_ID_8be2vx$);
            if (xpp.next() === 4) 
              creator.creator = xpp.getText();
            if (this.creators_8be2vx$ == null) 
              this.creators_8be2vx$ = ArrayList_init();
            ensureNotNull(this.creators_8be2vx$).add_11rb$(creator);
          } else if (equals(xpp.getName(), 'dc:language')) {
            if (xpp.next() === 4) {
              tagVal = ensureNotNull(xpp.getText());
              this.languages_0.add_11rb$(tagVal);
            }
          }
        }
      } else if (evtType === 3) {
        if (inMetadata && equals(xpp.getName(), 'metadata')) {
          inMetadata = false;
        }
      }
    }
    evtType = xpp.next();
  } while (evtType !== 1);
};
  OpfDocument.prototype.serialize_kkjgj2$ = function(xs) {
  var tmp$, tmp$_0;
  xs.startDocument_ivxn3r$('UTF-8', false);
  xs.setPrefix_puj7f4$('', OpfDocument$Companion_getInstance().NAMESPACE_OPF_0);
  xs.startTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_OPF_0, 'package');
  xs.attribute_kunee3$(null, 'version', '3.0');
  xs.attribute_kunee3$(null, 'unique-identifier', ensureNotNull(this.uniqueIdentifier_0));
  xs.setPrefix_puj7f4$('dc', OpfDocument$Companion_getInstance().NAMESPACE_DC_0);
  xs.startTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_OPF_0, 'metadata');
  xs.startTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_DC_0, 'identifier');
  xs.attribute_kunee3$(null, OpfDocument$LinkElement$Companion_getInstance().ATTR_ID_8be2vx$, ensureNotNull(this.uniqueIdentifier_0));
  xs.text_61zpoe$(ensureNotNull(this.id));
  xs.endTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_DC_0, 'identifier');
  xs.startTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_DC_0, 'title');
  xs.text_61zpoe$(ensureNotNull(this.title));
  xs.endTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_DC_0, 'title');
  if (this.date != null) {
    xs.startTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_DC_0, 'date');
    xs.text_61zpoe$(ensureNotNull(this.date));
    xs.endTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_DC_0, 'date');
  }
  if (this.description != null) {
    xs.startTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_DC_0, 'description');
    xs.text_61zpoe$(ensureNotNull(this.description));
    xs.endTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_DC_0, 'description');
  }
  var tmp$_1;
  tmp$_1 = this.languages_0.iterator();
  while (tmp$_1.hasNext()) {
    var element = tmp$_1.next();
    xs.startTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_DC_0, 'language');
    xs.text_61zpoe$(element);
    xs.endTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_DC_0, 'language');
  }
  if (this.creators_8be2vx$ != null) {
    var tmp$_2;
    tmp$_2 = ensureNotNull(this.creators_8be2vx$).iterator();
    while (tmp$_2.hasNext()) {
      var element_0 = tmp$_2.next();
      if (element_0.creator != null) {
        xs.startTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_DC_0, 'creator');
        xs.attribute_kunee3$(null, OpfDocument$LinkElement$Companion_getInstance().ATTR_ID_8be2vx$, ensureNotNull(element_0.id));
        xs.text_61zpoe$(ensureNotNull(element_0.creator));
        xs.endTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_DC_0, 'creator');
      }
    }
  }
  xs.endTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_OPF_0, 'metadata');
  xs.startTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_OPF_0, 'manifest');
  tmp$ = this.manifestItems_0.values.iterator();
  while (tmp$.hasNext()) {
    var item = tmp$.next();
    xs.startTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_OPF_0, 'item');
    xs.attribute_kunee3$(null, 'id', ensureNotNull(item.id));
    xs.attribute_kunee3$(null, 'href', ensureNotNull(item.href));
    xs.attribute_kunee3$(null, 'media-type', ensureNotNull(item.mediaType));
    if (item.properties != null) 
      xs.attribute_kunee3$(null, 'properties', ensureNotNull(item.properties));
    xs.endTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_OPF_0, 'item');
  }
  xs.endTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_OPF_0, 'manifest');
  xs.startTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_OPF_0, 'spine');
  tmp$_0 = this.spine_0.iterator();
  while (tmp$_0.hasNext()) {
    var item_0 = tmp$_0.next();
    xs.startTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_OPF_0, 'itemref');
    xs.attribute_kunee3$(null, 'idref', ensureNotNull(item_0.id));
    xs.endTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_OPF_0, 'itemref');
  }
  xs.endTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_OPF_0, 'spine');
  xs.endTag_f5e6j7$(OpfDocument$Companion_getInstance().NAMESPACE_OPF_0, 'package');
  xs.endDocument();
};
  OpfDocument.prototype.getMimeType_61zpoe$ = function(filename) {
  var item = this.findItemByHref_0(filename);
  return item != null ? item.mediaType : null;
};
  OpfDocument.prototype.findItemByHref_0 = function(href) {
  var tmp$;
  tmp$ = this.manifestItems_0.values.iterator();
  while (tmp$.hasNext()) {
    var item = tmp$.next();
    if (equals(href, item.href)) 
      return item;
  }
  return null;
};
  OpfDocument.prototype.getLinearSpinePositionByHREF_61zpoe$ = function(href) {
  var linearSpine = this.linearSpineHREFs;
  for (var i = 0; i !== linearSpine.length; ++i) {
    if (equals(linearSpine[i], href)) {
      return i;
    }
  }
  return -1;
};
  OpfDocument.prototype.addCoverImage_uvubhx$ = function(coverImage) {
  this.coverImages_0.add_11rb$(coverImage);
};
  OpfDocument.prototype.getCoverImage_61zpoe$ = function(mimeType) {
  return this.coverImages_0.isEmpty() ? null : this.coverImages_0.get_za3lpa$(0);
};
  OpfDocument.prototype.getCoverImages = function() {
  return this.coverImages_0;
};
  OpfDocument.prototype.getLinks = function() {
  return this.links_0;
};
  OpfDocument.prototype.getCreators = function() {
  return this.creators_8be2vx$;
};
  OpfDocument.prototype.getCreator_za3lpa$ = function(index) {
  var tmp$;
  return (tmp$ = this.creators_8be2vx$) != null ? tmp$.get_za3lpa$(index) : null;
};
  OpfDocument.prototype.getLanguage_za3lpa$ = function(index) {
  return this.languages_0.size > index ? this.languages_0.get_za3lpa$(index) : null;
};
  OpfDocument.prototype.getLanguages = function() {
  return this.languages_0;
};
  OpfDocument.prototype.getSpine = function() {
  return this.spine_0;
};
  OpfDocument.prototype.getManifestItems = function() {
  return this.manifestItems_0;
};
  function OpfDocument$Companion() {
    OpfDocument$Companion_instance = this;
    this.NAMESPACE_OPF_0 = 'http://www.idpf.org/2007/opf';
    this.NAMESPACE_DC_0 = 'http://purl.org/dc/elements/1.1/';
    this.PARSE_METADATA = 1;
    this.PARSE_MANIFEST = 2;
  }
  OpfDocument$Companion.prototype.getExtension_61zpoe$ = function(filename) {
  var dotPos = lastIndexOf(filename, 46);
  var tmp$;
  if (dotPos !== -1) {
    var startIndex = dotPos + 1 | 0;
    tmp$ = filename.substring(startIndex);
  } else 
    tmp$ = null;
  return tmp$;
};
  OpfDocument$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var OpfDocument$Companion_instance = null;
  function OpfDocument$Companion_getInstance() {
    if (OpfDocument$Companion_instance === null) {
      new OpfDocument$Companion();
    }
    return OpfDocument$Companion_instance;
  }
  OpfDocument.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'OpfDocument', 
  interfaces: []};
  function OpfItem() {
    this.href = '';
    this.mediaType = '';
    this.properties = '';
    this.isLinear = false;
    this.id = '';
    this.isLinear = true;
  }
  OpfItem.prototype.setMimeType_61zpoe$ = function(mediaType) {
  this.mediaType = mediaType;
};
  OpfItem.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'OpfItem', 
  interfaces: []};
  function Har(log) {
    Har$Companion_getInstance();
    this.log = log;
  }
  function Har$Companion() {
    Har$Companion_instance = this;
  }
  Har$Companion.prototype.serializer = function() {
  return Har$$serializer_getInstance();
};
  Har$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var Har$Companion_instance = null;
  function Har$Companion_getInstance() {
    if (Har$Companion_instance === null) {
      new Har$Companion();
    }
    return Har$Companion_instance;
  }
  function Har$$serializer() {
    this.descriptor_pc6e1f$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentformats.har.Har', this, 1);
    this.descriptor.addElement_ivxn3r$('log', false);
    Har$$serializer_instance = this;
  }
  Object.defineProperty(Har$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_pc6e1f$_0;
}});
  Har$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  output.encodeSerializableElement_r4qlx7$(this.descriptor, 0, HarLog$$serializer_getInstance(), value.log);
  output.endStructure_24f42q$(this.descriptor);
};
  Har$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeSerializableElement_12e8id$(this.descriptor, 0, HarLog$$serializer_getInstance(), local0);
          bitMask0 |= 1;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return Har_init(bitMask0, local0, null);
};
  Har$$serializer.prototype.childSerializers = function() {
  return [HarLog$$serializer_getInstance()];
};
  Har$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var Har$$serializer_instance = null;
  function Har$$serializer_getInstance() {
    if (Har$$serializer_instance === null) {
      new Har$$serializer();
    }
    return Har$$serializer_instance;
  }
  function Har_init(seen1, log, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(Har.prototype);
    if ((seen1 & 1) === 0) 
      throw MissingFieldException_init('log');
    else 
      $this.log = log;
    return $this;
  }
  Har.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Har', 
  interfaces: []};
  Har.prototype.component1 = function() {
  return this.log;
};
  Har.prototype.copy_f2lsxw$ = function(log) {
  return new Har(log === void 0 ? this.log : log);
};
  Har.prototype.toString = function() {
  return 'Har(log=' + Kotlin.toString(this.log) + ')';
};
  Har.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.log) | 0;
  return result;
};
  Har.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && Kotlin.equals(this.log, other.log))));
};
  function HarContainer(containerUid, entry, umAccount, db, context, localHttp, httpClient, block) {
    this.containerUid = containerUid;
    this.entry = entry;
    this.umAccount = umAccount;
    this.db = db;
    this.context = context;
    this.localHttp = localHttp;
    this.httpClient = httpClient;
    this.block = block;
    this.startingUrl_tzkjhc$_0 = this.startingUrl_tzkjhc$_0;
    this.linkPatterns_0 = LinkedHashMap_init();
    this.regexList = null;
    this.requestMap = LinkedHashMap_init();
    this.interceptors = LinkedHashMap_init();
    this.startingUrlDeferred = CompletableDeferred();
    this.json = Json_0(void 0, HarContainer$json$lambda);
    var indexEntry = this.db.containerEntryDao.findByPathInContainer_a4hdmt$(this.containerUid, 'harcontent');
    var harExtraEntry = this.db.containerEntryDao.findByPathInContainer_a4hdmt$(this.containerUid, 'harextras.json');
    if (indexEntry == null) {
      throw Exception_init_0();
    }
    launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, HarContainer_init$lambda(indexEntry, harExtraEntry, this));
  }
  Object.defineProperty(HarContainer.prototype, 'startingUrl', {
  configurable: true, 
  get: function() {
  if (this.startingUrl_tzkjhc$_0 == null) 
    return throwUPAE('startingUrl');
  return this.startingUrl_tzkjhc$_0;
}, 
  set: function(startingUrl) {
  this.startingUrl_tzkjhc$_0 = startingUrl;
}});
  function Coroutine$serve_3wva0p$($this, request_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$response = void 0;
    this.local$tmp$ = void 0;
    this.local$request = request_0;
  }
  Coroutine$serve_3wva0p$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$serve_3wva0p$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$serve_3wva0p$.prototype.constructor = Coroutine$serve_3wva0p$;
  Coroutine$serve_3wva0p$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        var regexedUrl = {
  v: (tmp$ = this.local$request.url) != null ? tmp$ : ''};
        if ((tmp$_0 = this.$this.regexList) != null) {
          var tmp$_1;
          tmp$_1 = tmp$_0.iterator();
          while (tmp$_1.hasNext()) {
            var element = tmp$_1.next();
            var $receiver = regexedUrl.v;
            var regex = Regex_init(element.regex);
            var replacement = element.replacement;
            regexedUrl.v = regex.replace_x2uqeu$($receiver, replacement);
          }
        }
        this.local$request.regexedUrl = regexedUrl.v;
        this.$this.checkWithPattern_61zpoe$(regexedUrl.v);
        this.state_0 = 2;
        this.result_0 = this.$this.getInitialResponse_0(this.local$request, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$response = {
  v: this.result_0};
        this.local$tmp$ = this.$this.interceptors.entries.iterator();
        this.state_0 = 3;
        continue;
      case 3:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 5;
          continue;
        }
        var element_0 = this.local$tmp$.next();
        this.state_0 = 4;
        this.result_0 = element_0.key.intercept_456qbw$(this.local$request, this.local$response.v, this.$this, element_0.value, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.local$response.v = this.result_0;
        this.state_0 = 3;
        continue;
      case 5:
        return this.local$response.v;
      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);
};
  HarContainer.prototype.serve_3wva0p$ = function(request_0, continuation_0, suspended) {
  var instance = new Coroutine$serve_3wva0p$(this, request_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$getInitialResponse_0($this, request_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$_2 = void 0;
    this.local$harList = void 0;
    this.local$defaultResponse = void 0;
    this.local$defaultHarContent = void 0;
    this.local$harResponse = void 0;
    this.local$entryFile = void 0;
    this.local$mutMap = void 0;
    this.local$harContent = void 0;
    this.local$request = request_0;
  }
  Coroutine$getInitialResponse_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$getInitialResponse_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$getInitialResponse_0.prototype.constructor = Coroutine$getInitialResponse_0;
  Coroutine$getInitialResponse_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        var tmp$_2;
        var $receiver = this.$this.requestMap;
        var key = new Pair(this.local$request.method, this.local$request.regexedUrl);
        var tmp$_3;
        this.local$harList = (Kotlin.isType(tmp$_3 = $receiver, Map) ? tmp$_3 : throwCCE()).get_11rb$(key);
        this.local$defaultResponse = new HarResponse();
        this.local$defaultHarContent = new HarContent();
        if (this.local$harList == null || this.local$harList.isEmpty()) {
          this.local$defaultResponse.status = 404;
          this.local$defaultResponse.statusText = 'OK';
          this.local$defaultHarContent.mimeType = '';
          this.local$defaultResponse.content = this.local$defaultHarContent;
          return this.local$defaultResponse;
        } else {
          this.state_0 = 2;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        var harEntry = this.local$harList.get_za3lpa$(0);
        this.local$harResponse = (tmp$ = harEntry.response) != null ? tmp$ : this.local$defaultResponse;
        var harText = (tmp$_0 = this.local$harResponse.content) != null ? tmp$_0.text : null;
        var containerEntry = this.$this.db.containerEntryDao.findByPathInContainer_a4hdmt$(this.$this.containerUid, harText != null ? harText : '');
        this.local$entryFile = containerEntry != null ? containerEntry.containerEntryFile : null;
        if (this.local$entryFile == null) {
          this.local$harResponse.status = 402;
          this.local$harResponse.statusText = 'Not Found';
          this.local$harResponse.content = this.local$defaultHarContent;
          return this.local$harResponse;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 3:
        this.local$mutMap = this.$this.getHeaderMap_852edo$(this.local$harResponse.headers, this.local$entryFile);
        var destination = ArrayList_init_0(this.local$mutMap.size);
        var tmp$_4;
        tmp$_4 = this.local$mutMap.entries.iterator();
        while (tmp$_4.hasNext()) {
          var item = tmp$_4.next();
          destination.add_11rb$(new HarNameValuePair(item.key, item.value));
        }
        this.local$harResponse.headers = destination;
        if (equals(this.local$request.method, 'OPTIONS')) {
          return this.local$harResponse;
        } else {
          this.state_0 = 4;
          continue;
        }
      case 4:
        this.local$harContent = (tmp$_1 = this.local$harResponse.content) != null ? tmp$_1 : this.local$defaultHarContent;
        this.local$harContent.entryFile = this.local$entryFile;
        if (isTextContent(this.local$harContent)) {
          this.state_0 = 5;
          this.result_0 = getStringFromContainerEntry(this.local$entryFile, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 6;
          continue;
        }
      case 5:
        this.local$harContent.text = this.result_0;
        this.state_0 = 6;
        continue;
      case 6:
        this.local$tmp$_2 = this.local$mutMap.get_11rb$('Range');
        if (this.local$tmp$_2 == null) {
          return this.local$harResponse;
        } else {
          this.state_0 = 7;
          continue;
        }
      case 7:
        var rangeHeader = this.local$tmp$_2;
        var totalLength = this.local$entryFile.ceTotalSize;
        var isHEADRequest = equals(this.local$request.method, 'HEAD');
        if (rangeHeader != null) {
          tmp$_2 = parseRangeRequestHeader(rangeHeader, totalLength);
        } else {
          tmp$_2 = null;
        }
        var range = tmp$_2;
        if (range != null && range.statusCode === 206) {
          var tmp$_5;
          tmp$_5 = range.responseHeaders.entries.iterator();
          while (tmp$_5.hasNext()) {
            var element = tmp$_5.next();
            var key_0 = element.key;
            var value = element.value;
            this.local$mutMap.put_xwzc9p$(key_0, value);
          }
          this.local$harResponse.status = 206;
          this.local$harResponse.statusText = 'Partial Content';
          var destination_0 = ArrayList_init_0(this.local$mutMap.size);
          var tmp$_6;
          tmp$_6 = this.local$mutMap.entries.iterator();
          while (tmp$_6.hasNext()) {
            var item_0 = tmp$_6.next();
            destination_0.add_11rb$(new HarNameValuePair(item_0.key, item_0.value));
          }
          this.local$harResponse.headers = destination_0;
          this.local$harContent.entryFile = isHEADRequest ? null : this.local$entryFile;
          this.local$harContent.text = isHEADRequest ? null : this.local$harContent.text;
          this.local$harResponse.content = this.local$harContent;
          return this.local$harResponse;
        } else {
          if ((range != null ? range.statusCode : null) === 416) {
            this.local$harResponse.status = 416;
            this.local$harResponse.statusText = isHEADRequest ? '' : 'Range request not satisfiable';
            this.local$harContent.entryFile = null;
            this.local$harContent.text = null;
            this.local$harResponse.content = this.local$harContent;
            return this.local$harResponse;
          } else {
            var key_1 = 'Content-Length';
            var value_0 = totalLength.toString();
            this.local$mutMap.put_xwzc9p$(key_1, value_0);
            var key_2 = 'Connection';
            this.local$mutMap.put_xwzc9p$(key_2, 'close');
            var destination_1 = ArrayList_init_0(this.local$mutMap.size);
            var tmp$_7;
            tmp$_7 = this.local$mutMap.entries.iterator();
            while (tmp$_7.hasNext()) {
              var item_1 = tmp$_7.next();
              destination_1.add_11rb$(new HarNameValuePair(item_1.key, item_1.value));
            }
            this.local$harResponse.headers = destination_1;
            return this.local$harResponse;
          }
        }
      case 8:
        this.state_0 = 9;
        continue;
      case 9:
        return;
      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);
};
  HarContainer.prototype.getInitialResponse_0 = function(request_0, continuation_0, suspended) {
  var instance = new Coroutine$getInitialResponse_0(this, request_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  HarContainer.prototype.getHeaderMap_852edo$ = function(harHeaders, containerEntryFile) {
  var mutMap = LinkedHashMap_init();
  var destination = ArrayList_init_0(collectionSizeOrDefault(harHeaders, 10));
  var tmp$;
  tmp$ = harHeaders.iterator();
  while (tmp$.hasNext()) {
    var item = tmp$.next();
    destination.add_11rb$(to(item.name, item.value));
  }
  mutMap.putAll_a2k3zr$(toMap_0(destination));
  if (containerEntryFile.compression === 1) {
    var key = 'Content-Encoding';
    mutMap.put_xwzc9p$(key, 'gzip');
    var key_0 = 'Content-Length';
    var value = containerEntryFile.ceCompressedSize.toString();
    mutMap.put_xwzc9p$(key_0, value);
  }
  if (!mutMap.containsKey_11rb$('access-control-allow-origin')) {
    var key_1 = 'Access-Control-Allow-Origin';
    mutMap.put_xwzc9p$(key_1, '*');
  }
  var key_2 = 'Access-Control-Allow-Headers';
  var value_0 = 'X-Requested-With';
  mutMap.put_xwzc9p$(key_2, value_0);
  return mutMap;
};
  HarContainer.prototype.checkWithPattern_61zpoe$ = function(requestUrl) {
  var tmp$;
  tmp$ = this.linkPatterns_0.keys.iterator();
  while (tmp$.hasNext()) {
    var linkPattern = tmp$.next();
    if (linkPattern.matches_6bul2c$(requestUrl)) {
      var pattern = this.linkPatterns_0.get_11rb$(linkPattern);
      if (pattern != null) {
        this.block(pattern);
      }
    }
  }
};
  function HarContainer$json$lambda($receiver) {
    $receiver.ignoreUnknownKeys = true;
    return Unit;
  }
  function Coroutine$HarContainer_init$lambda(closure$indexEntry_0, closure$harExtraEntry_0, this$HarContainer_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$indexEntry = closure$indexEntry_0;
    this.local$closure$harExtraEntry = closure$harExtraEntry_0;
    this.local$this$HarContainer = this$HarContainer_0;
    this.local$harContentData = void 0;
    this.local$harExtra = void 0;
  }
  Coroutine$HarContainer_init$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$HarContainer_init$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$HarContainer_init$lambda.prototype.constructor = Coroutine$HarContainer_init$lambda;
  Coroutine$HarContainer_init$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6;
        if ((tmp$ = this.local$closure$indexEntry.containerEntryFile) != null) {
          this.state_0 = 2;
          this.result_0 = getStringFromContainerEntry(tmp$, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        continue;
      case 3:
        tmp$_0 = this.result_0;
        if (tmp$_0 == null) {
          throw Exception_init_0();
        }
        this.local$harContentData = tmp$_0;
        this.local$harExtra = new HarExtra();
        if (this.local$closure$harExtraEntry != null) {
          if ((tmp$_1 = this.local$closure$harExtraEntry.containerEntryFile) != null) {
            this.state_0 = 4;
            this.result_0 = getStringFromContainerEntry(tmp$_1, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.result_0 = null;
            this.state_0 = 5;
            continue;
          }
        } else {
          this.state_0 = 6;
          continue;
        }
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        tmp$_2 = this.result_0;
        if (tmp$_2 == null) {
          throw Exception_init_0();
        }
        var data = tmp$_2;
        this.local$harExtra = this.local$this$HarContainer.json.decodeFromString_awif5v$(HarExtra$Companion_getInstance().serializer(), data);
        this.state_0 = 6;
        continue;
      case 6:
        this.local$this$HarContainer.regexList = this.local$harExtra.regexes;
        if ((tmp$_3 = this.local$harExtra.links) != null) {
          var tmp$_7;
          tmp$_7 = tmp$_3.iterator();
          while (tmp$_7.hasNext()) {
            var element = tmp$_7.next();
            var $receiver = this.local$this$HarContainer.linkPatterns_0;
            var key = Regex_init(element.regex);
            var value = element.replacement;
            $receiver.put_xwzc9p$(key, value);
          }
        }
        var $receiver_0 = this.local$this$HarContainer.interceptors;
        var key_0 = new RecorderInterceptor();
        $receiver_0.put_xwzc9p$(key_0, null);
        var $receiver_1 = this.local$this$HarContainer.interceptors;
        var key_1 = new KhanProgressTracker(this.local$this$HarContainer.httpClient);
        $receiver_1.put_xwzc9p$(key_1, null);
        if ((tmp$_4 = this.local$harExtra.interceptors) != null) {
          var tmp$_8;
          tmp$_8 = tmp$_4.iterator();
          loop_label:
            while (tmp$_8.hasNext()) {
              var element_0 = tmp$_8.next();
              var this$HarContainer = this.local$this$HarContainer;
              action$break:
                do {
                  var tmp$_9;
                  tmp$_9 = HarInterceptor$Companion_getInstance().interceptorMap.get_11rb$(element_0.name);
                  if (tmp$_9 == null) {
                    break action$break;
                  }
                  var key_2 = tmp$_9;
                  var $receiver_2 = this$HarContainer.interceptors;
                  var value_0 = element_0.jsonArgs;
                  $receiver_2.put_xwzc9p$(key_2, value_0);
                } while (false);
            }
        }
        var harContent = this.local$this$HarContainer.json.decodeFromString_awif5v$(Har$Companion_getInstance().serializer(), this.local$harContentData);
        var entries = harContent.log.entries;
        var tmp$_10;
        tmp$_10 = entries.iterator();
        loop_label:
          while (tmp$_10.hasNext()) {
            var element_1 = tmp$_10.next();
            var this$HarContainer_0 = this.local$this$HarContainer;
            action$break:
              do {
                var tmp$_11, tmp$_12, tmp$_13, tmp$_14;
                tmp$_12 = (tmp$_11 = element_1.request) != null ? tmp$_11.method : null;
                if (tmp$_12 == null) {
                  break action$break;
                }
                var requestMethod = tmp$_12;
                tmp$_14 = (tmp$_13 = element_1.request) != null ? tmp$_13.url : null;
                if (tmp$_14 == null) {
                  break action$break;
                }
                var requestUrl = tmp$_14;
                var pair = new Pair(requestMethod, requestUrl);
                if (this$HarContainer_0.requestMap.containsKey_11rb$(pair)) {
                  var list = getValue(this$HarContainer_0.requestMap, pair);
                  list.add_11rb$(element_1);
                } else {
                  var $receiver_3 = this$HarContainer_0.requestMap;
                  var value_1 = mutableListOf([element_1]);
                  $receiver_3.put_xwzc9p$(pair, value_1);
                }
              } while (false);
          }
        this.local$this$HarContainer.startingUrl = (tmp$_6 = (tmp$_5 = entries.get_za3lpa$(0).request) != null ? tmp$_5.url : null) != null ? tmp$_6 : '';
        return this.local$this$HarContainer.startingUrlDeferred.complete_11rb$(this.local$this$HarContainer.startingUrl);
      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 HarContainer_init$lambda(closure$indexEntry_0, closure$harExtraEntry_0, this$HarContainer_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$HarContainer_init$lambda(closure$indexEntry_0, closure$harExtraEntry_0, this$HarContainer_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  HarContainer.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'HarContainer', 
  interfaces: []};
  function HarContent() {
    HarContent$Companion_getInstance();
    this.size = null;
    this.mimeType = null;
    this.text = null;
    this.entryFile = null;
    this.encoding = null;
  }
  function HarContent$Companion() {
    HarContent$Companion_instance = this;
  }
  HarContent$Companion.prototype.serializer = function() {
  return HarContent$$serializer_getInstance();
};
  HarContent$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HarContent$Companion_instance = null;
  function HarContent$Companion_getInstance() {
    if (HarContent$Companion_instance === null) {
      new HarContent$Companion();
    }
    return HarContent$Companion_instance;
  }
  function HarContent$$serializer() {
    this.descriptor_nkj11m$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentformats.har.HarContent', this, 5);
    this.descriptor.addElement_ivxn3r$('size', true);
    this.descriptor.addElement_ivxn3r$('mimeType', true);
    this.descriptor.addElement_ivxn3r$('text', true);
    this.descriptor.addElement_ivxn3r$('entryFile', true);
    this.descriptor.addElement_ivxn3r$('encoding', true);
    HarContent$$serializer_instance = this;
  }
  Object.defineProperty(HarContent$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_nkj11m$_0;
}});
  HarContent$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  if (!equals(value.size, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 0)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 0, internal.LongSerializer, value.size);
  if (!equals(value.mimeType, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 1)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 1, internal.StringSerializer, value.mimeType);
  if (!equals(value.text, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 2)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 2, internal.StringSerializer, value.text);
  if (!equals(value.entryFile, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 3)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 3, ContainerEntryFile.$serializer, value.entryFile);
  if (!equals(value.encoding, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 4)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 4, internal.StringSerializer, value.encoding);
  output.endStructure_24f42q$(this.descriptor);
};
  HarContent$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1, local2, local3, local4;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 0, internal.LongSerializer, local0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 1, internal.StringSerializer, local1);
          bitMask0 |= 2;
          break;
        case 2:
          local2 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 2, internal.StringSerializer, local2);
          bitMask0 |= 4;
          break;
        case 3:
          local3 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 3, ContainerEntryFile.$serializer, local3);
          bitMask0 |= 8;
          break;
        case 4:
          local4 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 4, internal.StringSerializer, local4);
          bitMask0 |= 16;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return HarContent_init(bitMask0, local0, local1, local2, local3, local4, null);
};
  HarContent$$serializer.prototype.childSerializers = function() {
  return [new NullableSerializer(internal.LongSerializer), new NullableSerializer(internal.StringSerializer), new NullableSerializer(internal.StringSerializer), new NullableSerializer(ContainerEntryFile.$serializer), new NullableSerializer(internal.StringSerializer)];
};
  HarContent$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var HarContent$$serializer_instance = null;
  function HarContent$$serializer_getInstance() {
    if (HarContent$$serializer_instance === null) {
      new HarContent$$serializer();
    }
    return HarContent$$serializer_instance;
  }
  function HarContent_init(seen1, size, mimeType, text, entryFile, encoding, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(HarContent.prototype);
    if ((seen1 & 1) === 0) 
      $this.size = null;
    else 
      $this.size = size;
    if ((seen1 & 2) === 0) 
      $this.mimeType = null;
    else 
      $this.mimeType = mimeType;
    if ((seen1 & 4) === 0) 
      $this.text = null;
    else 
      $this.text = text;
    if ((seen1 & 8) === 0) 
      $this.entryFile = null;
    else 
      $this.entryFile = entryFile;
    if ((seen1 & 16) === 0) 
      $this.encoding = null;
    else 
      $this.encoding = encoding;
    return $this;
  }
  HarContent.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'HarContent', 
  interfaces: []};
  function HarEntry() {
    HarEntry$Companion_getInstance();
    this.request = null;
    this.response = null;
  }
  function HarEntry$Companion() {
    HarEntry$Companion_instance = this;
  }
  HarEntry$Companion.prototype.serializer = function() {
  return HarEntry$$serializer_getInstance();
};
  HarEntry$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HarEntry$Companion_instance = null;
  function HarEntry$Companion_getInstance() {
    if (HarEntry$Companion_instance === null) {
      new HarEntry$Companion();
    }
    return HarEntry$Companion_instance;
  }
  function HarEntry$$serializer() {
    this.descriptor_rnx0r5$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentformats.har.HarEntry', this, 2);
    this.descriptor.addElement_ivxn3r$('request', true);
    this.descriptor.addElement_ivxn3r$('response', true);
    HarEntry$$serializer_instance = this;
  }
  Object.defineProperty(HarEntry$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_rnx0r5$_0;
}});
  HarEntry$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  if (!equals(value.request, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 0)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 0, HarRequest$$serializer_getInstance(), value.request);
  if (!equals(value.response, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 1)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 1, HarResponse$$serializer_getInstance(), value.response);
  output.endStructure_24f42q$(this.descriptor);
};
  HarEntry$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 0, HarRequest$$serializer_getInstance(), local0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 1, HarResponse$$serializer_getInstance(), local1);
          bitMask0 |= 2;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return HarEntry_init(bitMask0, local0, local1, null);
};
  HarEntry$$serializer.prototype.childSerializers = function() {
  return [new NullableSerializer(HarRequest$$serializer_getInstance()), new NullableSerializer(HarResponse$$serializer_getInstance())];
};
  HarEntry$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var HarEntry$$serializer_instance = null;
  function HarEntry$$serializer_getInstance() {
    if (HarEntry$$serializer_instance === null) {
      new HarEntry$$serializer();
    }
    return HarEntry$$serializer_instance;
  }
  function HarEntry_init(seen1, request, response, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(HarEntry.prototype);
    if ((seen1 & 1) === 0) 
      $this.request = null;
    else 
      $this.request = request;
    if ((seen1 & 2) === 0) 
      $this.response = null;
    else 
      $this.response = response;
    return $this;
  }
  HarEntry.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'HarEntry', 
  interfaces: []};
  function HarRegexPair(regex, replacement) {
    HarRegexPair$Companion_getInstance();
    this.regex = regex;
    this.replacement = replacement;
  }
  function HarRegexPair$Companion() {
    HarRegexPair$Companion_instance = this;
  }
  HarRegexPair$Companion.prototype.serializer = function() {
  return HarRegexPair$$serializer_getInstance();
};
  HarRegexPair$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HarRegexPair$Companion_instance = null;
  function HarRegexPair$Companion_getInstance() {
    if (HarRegexPair$Companion_instance === null) {
      new HarRegexPair$Companion();
    }
    return HarRegexPair$Companion_instance;
  }
  function HarRegexPair$$serializer() {
    this.descriptor_hsgts2$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentformats.har.HarRegexPair', this, 2);
    this.descriptor.addElement_ivxn3r$('regex', false);
    this.descriptor.addElement_ivxn3r$('replacement', false);
    HarRegexPair$$serializer_instance = this;
  }
  Object.defineProperty(HarRegexPair$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_hsgts2$_0;
}});
  HarRegexPair$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  output.encodeStringElement_iij8qq$(this.descriptor, 0, value.regex);
  output.encodeStringElement_iij8qq$(this.descriptor, 1, value.replacement);
  output.endStructure_24f42q$(this.descriptor);
};
  HarRegexPair$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeStringElement_szpzho$(this.descriptor, 0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeStringElement_szpzho$(this.descriptor, 1);
          bitMask0 |= 2;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return HarRegexPair_init(bitMask0, local0, local1, null);
};
  HarRegexPair$$serializer.prototype.childSerializers = function() {
  return [internal.StringSerializer, internal.StringSerializer];
};
  HarRegexPair$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var HarRegexPair$$serializer_instance = null;
  function HarRegexPair$$serializer_getInstance() {
    if (HarRegexPair$$serializer_instance === null) {
      new HarRegexPair$$serializer();
    }
    return HarRegexPair$$serializer_instance;
  }
  function HarRegexPair_init(seen1, regex, replacement, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(HarRegexPair.prototype);
    if ((seen1 & 1) === 0) 
      throw MissingFieldException_init('regex');
    else 
      $this.regex = regex;
    if ((seen1 & 2) === 0) 
      throw MissingFieldException_init('replacement');
    else 
      $this.replacement = replacement;
    return $this;
  }
  HarRegexPair.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'HarRegexPair', 
  interfaces: []};
  HarRegexPair.prototype.component1 = function() {
  return this.regex;
};
  HarRegexPair.prototype.component2 = function() {
  return this.replacement;
};
  HarRegexPair.prototype.copy_puj7f4$ = function(regex, replacement) {
  return new HarRegexPair(regex === void 0 ? this.regex : regex, replacement === void 0 ? this.replacement : replacement);
};
  HarRegexPair.prototype.toString = function() {
  return 'HarRegexPair(regex=' + Kotlin.toString(this.regex) + (', replacement=' + Kotlin.toString(this.replacement)) + ')';
};
  HarRegexPair.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.regex) | 0;
  result = result * 31 + Kotlin.hashCode(this.replacement) | 0;
  return result;
};
  HarRegexPair.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.regex, other.regex) && Kotlin.equals(this.replacement, other.replacement)))));
};
  function Interceptors(name, jsonArgs) {
    Interceptors$Companion_getInstance();
    this.name = name;
    this.jsonArgs = jsonArgs;
  }
  function Interceptors$Companion() {
    Interceptors$Companion_instance = this;
  }
  Interceptors$Companion.prototype.serializer = function() {
  return Interceptors$$serializer_getInstance();
};
  Interceptors$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var Interceptors$Companion_instance = null;
  function Interceptors$Companion_getInstance() {
    if (Interceptors$Companion_instance === null) {
      new Interceptors$Companion();
    }
    return Interceptors$Companion_instance;
  }
  function Interceptors$$serializer() {
    this.descriptor_8pblz8$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentformats.har.Interceptors', this, 2);
    this.descriptor.addElement_ivxn3r$('name', false);
    this.descriptor.addElement_ivxn3r$('jsonArgs', false);
    Interceptors$$serializer_instance = this;
  }
  Object.defineProperty(Interceptors$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_8pblz8$_0;
}});
  Interceptors$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  output.encodeStringElement_iij8qq$(this.descriptor, 0, value.name);
  output.encodeStringElement_iij8qq$(this.descriptor, 1, value.jsonArgs);
  output.endStructure_24f42q$(this.descriptor);
};
  Interceptors$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeStringElement_szpzho$(this.descriptor, 0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeStringElement_szpzho$(this.descriptor, 1);
          bitMask0 |= 2;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return Interceptors_init(bitMask0, local0, local1, null);
};
  Interceptors$$serializer.prototype.childSerializers = function() {
  return [internal.StringSerializer, internal.StringSerializer];
};
  Interceptors$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var Interceptors$$serializer_instance = null;
  function Interceptors$$serializer_getInstance() {
    if (Interceptors$$serializer_instance === null) {
      new Interceptors$$serializer();
    }
    return Interceptors$$serializer_instance;
  }
  function Interceptors_init(seen1, name, jsonArgs, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(Interceptors.prototype);
    if ((seen1 & 1) === 0) 
      throw MissingFieldException_init('name');
    else 
      $this.name = name;
    if ((seen1 & 2) === 0) 
      throw MissingFieldException_init('jsonArgs');
    else 
      $this.jsonArgs = jsonArgs;
    return $this;
  }
  Interceptors.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Interceptors', 
  interfaces: []};
  Interceptors.prototype.component1 = function() {
  return this.name;
};
  Interceptors.prototype.component2 = function() {
  return this.jsonArgs;
};
  Interceptors.prototype.copy_puj7f4$ = function(name, jsonArgs) {
  return new Interceptors(name === void 0 ? this.name : name, jsonArgs === void 0 ? this.jsonArgs : jsonArgs);
};
  Interceptors.prototype.toString = function() {
  return 'Interceptors(name=' + Kotlin.toString(this.name) + (', jsonArgs=' + Kotlin.toString(this.jsonArgs)) + ')';
};
  Interceptors.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.name) | 0;
  result = result * 31 + Kotlin.hashCode(this.jsonArgs) | 0;
  return result;
};
  Interceptors.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.name, other.name) && Kotlin.equals(this.jsonArgs, other.jsonArgs)))));
};
  function HarExtra() {
    HarExtra$Companion_getInstance();
    this.regexes = emptyList();
    this.links = emptyList();
    this.interceptors = emptyList();
  }
  function HarExtra$Companion() {
    HarExtra$Companion_instance = this;
  }
  HarExtra$Companion.prototype.serializer = function() {
  return HarExtra$$serializer_getInstance();
};
  HarExtra$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HarExtra$Companion_instance = null;
  function HarExtra$Companion_getInstance() {
    if (HarExtra$Companion_instance === null) {
      new HarExtra$Companion();
    }
    return HarExtra$Companion_instance;
  }
  function HarExtra$$serializer() {
    this.descriptor_qnl6k3$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentformats.har.HarExtra', this, 3);
    this.descriptor.addElement_ivxn3r$('regexes', true);
    this.descriptor.addElement_ivxn3r$('links', true);
    this.descriptor.addElement_ivxn3r$('interceptors', true);
    HarExtra$$serializer_instance = this;
  }
  Object.defineProperty(HarExtra$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_qnl6k3$_0;
}});
  HarExtra$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  if (!equals(value.regexes, emptyList()) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 0)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 0, new ArrayListSerializer(HarRegexPair$$serializer_getInstance()), value.regexes);
  if (!equals(value.links, emptyList()) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 1)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 1, new ArrayListSerializer(HarRegexPair$$serializer_getInstance()), value.links);
  if (!equals(value.interceptors, emptyList()) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 2)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 2, new ArrayListSerializer(Interceptors$$serializer_getInstance()), value.interceptors);
  output.endStructure_24f42q$(this.descriptor);
};
  HarExtra$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1, local2;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 0, new ArrayListSerializer(HarRegexPair$$serializer_getInstance()), local0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 1, new ArrayListSerializer(HarRegexPair$$serializer_getInstance()), local1);
          bitMask0 |= 2;
          break;
        case 2:
          local2 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 2, new ArrayListSerializer(Interceptors$$serializer_getInstance()), local2);
          bitMask0 |= 4;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return HarExtra_init(bitMask0, local0, local1, local2, null);
};
  HarExtra$$serializer.prototype.childSerializers = function() {
  return [new NullableSerializer(new ArrayListSerializer(HarRegexPair$$serializer_getInstance())), new NullableSerializer(new ArrayListSerializer(HarRegexPair$$serializer_getInstance())), new NullableSerializer(new ArrayListSerializer(Interceptors$$serializer_getInstance()))];
};
  HarExtra$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var HarExtra$$serializer_instance = null;
  function HarExtra$$serializer_getInstance() {
    if (HarExtra$$serializer_instance === null) {
      new HarExtra$$serializer();
    }
    return HarExtra$$serializer_instance;
  }
  function HarExtra_init(seen1, regexes, links, interceptors, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(HarExtra.prototype);
    if ((seen1 & 1) === 0) {
      $this.regexes = emptyList();
    } else 
      $this.regexes = regexes;
    if ((seen1 & 2) === 0) {
      $this.links = emptyList();
    } else 
      $this.links = links;
    if ((seen1 & 4) === 0) {
      $this.interceptors = emptyList();
    } else 
      $this.interceptors = interceptors;
    return $this;
  }
  HarExtra.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'HarExtra', 
  interfaces: []};
  function HarInterceptor() {
    HarInterceptor$Companion_getInstance();
  }
  function HarInterceptor$Companion() {
    HarInterceptor$Companion_instance = this;
    this.KHAN_PROBLEM = 'KhanProblemInterceptor';
    this.interceptorMap = mapOf([to('RecorderInterceptor', new RecorderInterceptor()), to(this.KHAN_PROBLEM, new KhanProblemInterceptor())]);
  }
  HarInterceptor$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HarInterceptor$Companion_instance = null;
  function HarInterceptor$Companion_getInstance() {
    if (HarInterceptor$Companion_instance === null) {
      new HarInterceptor$Companion();
    }
    return HarInterceptor$Companion_instance;
  }
  HarInterceptor.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'HarInterceptor', 
  interfaces: []};
  function HarLog(entries) {
    HarLog$Companion_getInstance();
    this.entries = entries;
  }
  function HarLog$Companion() {
    HarLog$Companion_instance = this;
  }
  HarLog$Companion.prototype.serializer = function() {
  return HarLog$$serializer_getInstance();
};
  HarLog$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HarLog$Companion_instance = null;
  function HarLog$Companion_getInstance() {
    if (HarLog$Companion_instance === null) {
      new HarLog$Companion();
    }
    return HarLog$Companion_instance;
  }
  function HarLog$$serializer() {
    this.descriptor_12jmbl$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentformats.har.HarLog', this, 1);
    this.descriptor.addElement_ivxn3r$('entries', false);
    HarLog$$serializer_instance = this;
  }
  Object.defineProperty(HarLog$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_12jmbl$_0;
}});
  HarLog$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  output.encodeSerializableElement_r4qlx7$(this.descriptor, 0, new ArrayListSerializer(HarEntry$$serializer_getInstance()), value.entries);
  output.endStructure_24f42q$(this.descriptor);
};
  HarLog$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeSerializableElement_12e8id$(this.descriptor, 0, new ArrayListSerializer(HarEntry$$serializer_getInstance()), local0);
          bitMask0 |= 1;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return HarLog_init(bitMask0, local0, null);
};
  HarLog$$serializer.prototype.childSerializers = function() {
  return [new ArrayListSerializer(HarEntry$$serializer_getInstance())];
};
  HarLog$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var HarLog$$serializer_instance = null;
  function HarLog$$serializer_getInstance() {
    if (HarLog$$serializer_instance === null) {
      new HarLog$$serializer();
    }
    return HarLog$$serializer_instance;
  }
  function HarLog_init(seen1, entries, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(HarLog.prototype);
    if ((seen1 & 1) === 0) 
      throw MissingFieldException_init('entries');
    else 
      $this.entries = entries;
    return $this;
  }
  HarLog.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'HarLog', 
  interfaces: []};
  HarLog.prototype.component1 = function() {
  return this.entries;
};
  HarLog.prototype.copy_a5icvz$ = function(entries) {
  return new HarLog(entries === void 0 ? this.entries : entries);
};
  HarLog.prototype.toString = function() {
  return 'HarLog(entries=' + Kotlin.toString(this.entries) + ')';
};
  HarLog.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.entries) | 0;
  return result;
};
  HarLog.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && Kotlin.equals(this.entries, other.entries))));
};
  function HarNameValuePair(name, value) {
    HarNameValuePair$Companion_getInstance();
    this.name = name;
    this.value = value;
  }
  HarNameValuePair.prototype.equals = function(other) {
  var tmp$, tmp$_0;
  if (this === other) 
    return true;
  if (other == null || !((tmp$ = Kotlin.getKClassFromExpression(this)) != null ? tmp$.equals(Kotlin.getKClassFromExpression(other)) : null)) 
    return false;
    Kotlin.isType(tmp$_0 = other, HarNameValuePair) ? tmp$_0 : throwCCE();
  if (!equals(this.name, other.name)) 
    return false;
  if (!equals(this.value, other.value)) 
    return false;
  return true;
};
  HarNameValuePair.prototype.hashCode = function() {
  var result = hashCode(this.name);
  result = (31 * result | 0) + hashCode(this.value) | 0;
  return result;
};
  function HarNameValuePair$Companion() {
    HarNameValuePair$Companion_instance = this;
  }
  HarNameValuePair$Companion.prototype.serializer = function() {
  return HarNameValuePair$$serializer_getInstance();
};
  HarNameValuePair$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HarNameValuePair$Companion_instance = null;
  function HarNameValuePair$Companion_getInstance() {
    if (HarNameValuePair$Companion_instance === null) {
      new HarNameValuePair$Companion();
    }
    return HarNameValuePair$Companion_instance;
  }
  function HarNameValuePair$$serializer() {
    this.descriptor_lsq4nx$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentformats.har.HarNameValuePair', this, 2);
    this.descriptor.addElement_ivxn3r$('name', false);
    this.descriptor.addElement_ivxn3r$('value', false);
    HarNameValuePair$$serializer_instance = this;
  }
  Object.defineProperty(HarNameValuePair$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_lsq4nx$_0;
}});
  HarNameValuePair$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  output.encodeStringElement_iij8qq$(this.descriptor, 0, value.name);
  output.encodeStringElement_iij8qq$(this.descriptor, 1, value.value);
  output.endStructure_24f42q$(this.descriptor);
};
  HarNameValuePair$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeStringElement_szpzho$(this.descriptor, 0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeStringElement_szpzho$(this.descriptor, 1);
          bitMask0 |= 2;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return HarNameValuePair_init(bitMask0, local0, local1, null);
};
  HarNameValuePair$$serializer.prototype.childSerializers = function() {
  return [internal.StringSerializer, internal.StringSerializer];
};
  HarNameValuePair$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var HarNameValuePair$$serializer_instance = null;
  function HarNameValuePair$$serializer_getInstance() {
    if (HarNameValuePair$$serializer_instance === null) {
      new HarNameValuePair$$serializer();
    }
    return HarNameValuePair$$serializer_instance;
  }
  function HarNameValuePair_init(seen1, name, value, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(HarNameValuePair.prototype);
    if ((seen1 & 1) === 0) 
      throw MissingFieldException_init('name');
    else 
      $this.name = name;
    if ((seen1 & 2) === 0) 
      throw MissingFieldException_init('value');
    else 
      $this.value = value;
    return $this;
  }
  HarNameValuePair.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'HarNameValuePair', 
  interfaces: []};
  function HarRequest() {
    HarRequest$Companion_getInstance();
    this.method = null;
    this.url = null;
    this.regexedUrl = null;
    this.headers = emptyList();
    this.queryString = emptyList();
    this.headersSize = null;
    this.bodySize = null;
    this.body = null;
  }
  function HarRequest$Companion() {
    HarRequest$Companion_instance = this;
  }
  HarRequest$Companion.prototype.serializer = function() {
  return HarRequest$$serializer_getInstance();
};
  HarRequest$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HarRequest$Companion_instance = null;
  function HarRequest$Companion_getInstance() {
    if (HarRequest$Companion_instance === null) {
      new HarRequest$Companion();
    }
    return HarRequest$Companion_instance;
  }
  function HarRequest$$serializer() {
    this.descriptor_nahix8$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentformats.har.HarRequest', this, 8);
    this.descriptor.addElement_ivxn3r$('method', true);
    this.descriptor.addElement_ivxn3r$('url', true);
    this.descriptor.addElement_ivxn3r$('regexedUrl', true);
    this.descriptor.addElement_ivxn3r$('headers', true);
    this.descriptor.addElement_ivxn3r$('queryString', true);
    this.descriptor.addElement_ivxn3r$('headersSize', true);
    this.descriptor.addElement_ivxn3r$('bodySize', true);
    this.descriptor.addElement_ivxn3r$('body', true);
    HarRequest$$serializer_instance = this;
  }
  Object.defineProperty(HarRequest$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_nahix8$_0;
}});
  HarRequest$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  if (!equals(value.method, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 0)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 0, internal.StringSerializer, value.method);
  if (!equals(value.url, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 1)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 1, internal.StringSerializer, value.url);
  if (!equals(value.regexedUrl, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 2)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 2, internal.StringSerializer, value.regexedUrl);
  if (!equals(value.headers, emptyList()) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 3)) 
    output.encodeSerializableElement_r4qlx7$(this.descriptor, 3, new ArrayListSerializer(HarNameValuePair$$serializer_getInstance()), value.headers);
  if (!equals(value.queryString, emptyList()) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 4)) 
    output.encodeSerializableElement_r4qlx7$(this.descriptor, 4, new ArrayListSerializer(HarNameValuePair$$serializer_getInstance()), value.queryString);
  if (!equals(value.headersSize, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 5)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 5, internal.LongSerializer, value.headersSize);
  if (!equals(value.bodySize, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 6)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 6, internal.LongSerializer, value.bodySize);
  if (!equals(value.body, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 7)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 7, internal.StringSerializer, value.body);
  output.endStructure_24f42q$(this.descriptor);
};
  HarRequest$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1, local2, local3, local4, local5, local6, local7;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 0, internal.StringSerializer, local0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 1, internal.StringSerializer, local1);
          bitMask0 |= 2;
          break;
        case 2:
          local2 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 2, internal.StringSerializer, local2);
          bitMask0 |= 4;
          break;
        case 3:
          local3 = input.decodeSerializableElement_12e8id$(this.descriptor, 3, new ArrayListSerializer(HarNameValuePair$$serializer_getInstance()), local3);
          bitMask0 |= 8;
          break;
        case 4:
          local4 = input.decodeSerializableElement_12e8id$(this.descriptor, 4, new ArrayListSerializer(HarNameValuePair$$serializer_getInstance()), local4);
          bitMask0 |= 16;
          break;
        case 5:
          local5 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 5, internal.LongSerializer, local5);
          bitMask0 |= 32;
          break;
        case 6:
          local6 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 6, internal.LongSerializer, local6);
          bitMask0 |= 64;
          break;
        case 7:
          local7 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 7, internal.StringSerializer, local7);
          bitMask0 |= 128;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return HarRequest_init(bitMask0, local0, local1, local2, local3, local4, local5, local6, local7, null);
};
  HarRequest$$serializer.prototype.childSerializers = function() {
  return [new NullableSerializer(internal.StringSerializer), new NullableSerializer(internal.StringSerializer), new NullableSerializer(internal.StringSerializer), new ArrayListSerializer(HarNameValuePair$$serializer_getInstance()), new ArrayListSerializer(HarNameValuePair$$serializer_getInstance()), new NullableSerializer(internal.LongSerializer), new NullableSerializer(internal.LongSerializer), new NullableSerializer(internal.StringSerializer)];
};
  HarRequest$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var HarRequest$$serializer_instance = null;
  function HarRequest$$serializer_getInstance() {
    if (HarRequest$$serializer_instance === null) {
      new HarRequest$$serializer();
    }
    return HarRequest$$serializer_instance;
  }
  function HarRequest_init(seen1, method, url, regexedUrl, headers, queryString, headersSize, bodySize, body, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(HarRequest.prototype);
    if ((seen1 & 1) === 0) 
      $this.method = null;
    else 
      $this.method = method;
    if ((seen1 & 2) === 0) 
      $this.url = null;
    else 
      $this.url = url;
    if ((seen1 & 4) === 0) 
      $this.regexedUrl = null;
    else 
      $this.regexedUrl = regexedUrl;
    if ((seen1 & 8) === 0) {
      $this.headers = emptyList();
    } else 
      $this.headers = headers;
    if ((seen1 & 16) === 0) {
      $this.queryString = emptyList();
    } else 
      $this.queryString = queryString;
    if ((seen1 & 32) === 0) 
      $this.headersSize = null;
    else 
      $this.headersSize = headersSize;
    if ((seen1 & 64) === 0) 
      $this.bodySize = null;
    else 
      $this.bodySize = bodySize;
    if ((seen1 & 128) === 0) 
      $this.body = null;
    else 
      $this.body = body;
    return $this;
  }
  HarRequest.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'HarRequest', 
  interfaces: []};
  function HarResponse() {
    HarResponse$Companion_getInstance();
    this.status = 101;
    this.statusText = null;
    this.headers = emptyList();
    this.content = null;
    this.headersSize = null;
    this.bodySize = null;
  }
  function HarResponse$Companion() {
    HarResponse$Companion_instance = this;
  }
  HarResponse$Companion.prototype.serializer = function() {
  return HarResponse$$serializer_getInstance();
};
  HarResponse$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HarResponse$Companion_instance = null;
  function HarResponse$Companion_getInstance() {
    if (HarResponse$Companion_instance === null) {
      new HarResponse$Companion();
    }
    return HarResponse$Companion_instance;
  }
  function HarResponse$$serializer() {
    this.descriptor_ybbu8e$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentformats.har.HarResponse', this, 6);
    this.descriptor.addElement_ivxn3r$('status', true);
    this.descriptor.addElement_ivxn3r$('statusText', true);
    this.descriptor.addElement_ivxn3r$('headers', true);
    this.descriptor.addElement_ivxn3r$('content', true);
    this.descriptor.addElement_ivxn3r$('headersSize', true);
    this.descriptor.addElement_ivxn3r$('bodySize', true);
    HarResponse$$serializer_instance = this;
  }
  Object.defineProperty(HarResponse$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_ybbu8e$_0;
}});
  HarResponse$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  if (!equals(value.status, 101) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 0)) 
    output.encodeIntElement_ptg7oe$(this.descriptor, 0, value.status);
  if (!equals(value.statusText, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 1)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 1, internal.StringSerializer, value.statusText);
  if (!equals(value.headers, emptyList()) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 2)) 
    output.encodeSerializableElement_r4qlx7$(this.descriptor, 2, new ArrayListSerializer(HarNameValuePair$$serializer_getInstance()), value.headers);
  if (!equals(value.content, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 3)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 3, HarContent$$serializer_getInstance(), value.content);
  if (!equals(value.headersSize, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 4)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 4, internal.LongSerializer, value.headersSize);
  if (!equals(value.bodySize, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 5)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 5, internal.LongSerializer, value.bodySize);
  output.endStructure_24f42q$(this.descriptor);
};
  HarResponse$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1, local2, local3, local4, local5;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeIntElement_szpzho$(this.descriptor, 0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 1, internal.StringSerializer, local1);
          bitMask0 |= 2;
          break;
        case 2:
          local2 = input.decodeSerializableElement_12e8id$(this.descriptor, 2, new ArrayListSerializer(HarNameValuePair$$serializer_getInstance()), local2);
          bitMask0 |= 4;
          break;
        case 3:
          local3 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 3, HarContent$$serializer_getInstance(), local3);
          bitMask0 |= 8;
          break;
        case 4:
          local4 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 4, internal.LongSerializer, local4);
          bitMask0 |= 16;
          break;
        case 5:
          local5 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 5, internal.LongSerializer, local5);
          bitMask0 |= 32;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return HarResponse_init(bitMask0, local0, local1, local2, local3, local4, local5, null);
};
  HarResponse$$serializer.prototype.childSerializers = function() {
  return [internal.IntSerializer, new NullableSerializer(internal.StringSerializer), new ArrayListSerializer(HarNameValuePair$$serializer_getInstance()), new NullableSerializer(HarContent$$serializer_getInstance()), new NullableSerializer(internal.LongSerializer), new NullableSerializer(internal.LongSerializer)];
};
  HarResponse$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var HarResponse$$serializer_instance = null;
  function HarResponse$$serializer_getInstance() {
    if (HarResponse$$serializer_instance === null) {
      new HarResponse$$serializer();
    }
    return HarResponse$$serializer_instance;
  }
  function HarResponse_init(seen1, status, statusText, headers, content, headersSize, bodySize, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(HarResponse.prototype);
    if ((seen1 & 1) === 0) 
      $this.status = 101;
    else 
      $this.status = status;
    if ((seen1 & 2) === 0) 
      $this.statusText = null;
    else 
      $this.statusText = statusText;
    if ((seen1 & 4) === 0) {
      $this.headers = emptyList();
    } else 
      $this.headers = headers;
    if ((seen1 & 8) === 0) 
      $this.content = null;
    else 
      $this.content = content;
    if ((seen1 & 16) === 0) 
      $this.headersSize = null;
    else 
      $this.headersSize = headersSize;
    if ((seen1 & 32) === 0) 
      $this.bodySize = null;
    else 
      $this.bodySize = bodySize;
    return $this;
  }
  HarResponse.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'HarResponse', 
  interfaces: []};
  function KhanProblemBody() {
    KhanProblemBody$Companion_getInstance();
    this.operationName = null;
    this.variables = null;
  }
  function KhanProblemBody$Variable() {
    KhanProblemBody$Variable$Companion_getInstance();
    this.input = null;
  }
  function KhanProblemBody$Variable$Input() {
    KhanProblemBody$Variable$Input$Companion_getInstance();
    this.problemNumber = 0;
    this.exerciseId = null;
    this.timeTaken = L0;
    this.countHints = 0;
    this.completed = false;
    this.itemId = null;
    this.assessmentItemId = null;
    this.quizProblemNumber = null;
    this.topicId = null;
    this.skipped = false;
  }
  function KhanProblemBody$Variable$Input$Companion() {
    KhanProblemBody$Variable$Input$Companion_instance = this;
  }
  KhanProblemBody$Variable$Input$Companion.prototype.serializer = function() {
  return KhanProblemBody$Variable$Input$$serializer_getInstance();
};
  KhanProblemBody$Variable$Input$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var KhanProblemBody$Variable$Input$Companion_instance = null;
  function KhanProblemBody$Variable$Input$Companion_getInstance() {
    if (KhanProblemBody$Variable$Input$Companion_instance === null) {
      new KhanProblemBody$Variable$Input$Companion();
    }
    return KhanProblemBody$Variable$Input$Companion_instance;
  }
  function KhanProblemBody$Variable$Input$$serializer() {
    this.descriptor_n525hh$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentformats.har.KhanProblemBody.Variable.Input', this, 10);
    this.descriptor.addElement_ivxn3r$('problemNumber', true);
    this.descriptor.addElement_ivxn3r$('exerciseId', true);
    this.descriptor.addElement_ivxn3r$('timeTaken', true);
    this.descriptor.addElement_ivxn3r$('countHints', true);
    this.descriptor.addElement_ivxn3r$('completed', true);
    this.descriptor.addElement_ivxn3r$('itemId', true);
    this.descriptor.addElement_ivxn3r$('assessmentItemId', true);
    this.descriptor.addElement_ivxn3r$('quizProblemNumber', true);
    this.descriptor.addElement_ivxn3r$('topicId', true);
    this.descriptor.addElement_ivxn3r$('skipped', true);
    KhanProblemBody$Variable$Input$$serializer_instance = this;
  }
  Object.defineProperty(KhanProblemBody$Variable$Input$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_n525hh$_0;
}});
  KhanProblemBody$Variable$Input$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  if (!equals(value.problemNumber, 0) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 0)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 0, internal.IntSerializer, value.problemNumber);
  if (!equals(value.exerciseId, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 1)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 1, internal.StringSerializer, value.exerciseId);
  if (!equals(value.timeTaken, L0) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 2)) 
    output.encodeLongElement_j0o2mv$(this.descriptor, 2, value.timeTaken);
  if (!equals(value.countHints, 0) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 3)) 
    output.encodeIntElement_ptg7oe$(this.descriptor, 3, value.countHints);
  if (!equals(value.completed, false) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 4)) 
    output.encodeBooleanElement_qh7jdn$(this.descriptor, 4, value.completed);
  if (!equals(value.itemId, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 5)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 5, internal.StringSerializer, value.itemId);
  if (!equals(value.assessmentItemId, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 6)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 6, internal.StringSerializer, value.assessmentItemId);
  if (!equals(value.quizProblemNumber, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 7)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 7, internal.StringSerializer, value.quizProblemNumber);
  if (!equals(value.topicId, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 8)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 8, internal.StringSerializer, value.topicId);
  if (!equals(value.skipped, false) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 9)) 
    output.encodeBooleanElement_qh7jdn$(this.descriptor, 9, value.skipped);
  output.endStructure_24f42q$(this.descriptor);
};
  KhanProblemBody$Variable$Input$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1, local2, local3, local4, local5, local6, local7, local8, local9;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 0, internal.IntSerializer, local0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 1, internal.StringSerializer, local1);
          bitMask0 |= 2;
          break;
        case 2:
          local2 = input.decodeLongElement_szpzho$(this.descriptor, 2);
          bitMask0 |= 4;
          break;
        case 3:
          local3 = input.decodeIntElement_szpzho$(this.descriptor, 3);
          bitMask0 |= 8;
          break;
        case 4:
          local4 = input.decodeBooleanElement_szpzho$(this.descriptor, 4);
          bitMask0 |= 16;
          break;
        case 5:
          local5 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 5, internal.StringSerializer, local5);
          bitMask0 |= 32;
          break;
        case 6:
          local6 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 6, internal.StringSerializer, local6);
          bitMask0 |= 64;
          break;
        case 7:
          local7 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 7, internal.StringSerializer, local7);
          bitMask0 |= 128;
          break;
        case 8:
          local8 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 8, internal.StringSerializer, local8);
          bitMask0 |= 256;
          break;
        case 9:
          local9 = input.decodeBooleanElement_szpzho$(this.descriptor, 9);
          bitMask0 |= 512;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return KhanProblemBody$Variable$KhanProblemBody$Variable$Input_init(bitMask0, local0, local1, local2, local3, local4, local5, local6, local7, local8, local9, null);
};
  KhanProblemBody$Variable$Input$$serializer.prototype.childSerializers = function() {
  return [new NullableSerializer(internal.IntSerializer), new NullableSerializer(internal.StringSerializer), internal.LongSerializer, internal.IntSerializer, internal.BooleanSerializer, new NullableSerializer(internal.StringSerializer), new NullableSerializer(internal.StringSerializer), new NullableSerializer(internal.StringSerializer), new NullableSerializer(internal.StringSerializer), internal.BooleanSerializer];
};
  KhanProblemBody$Variable$Input$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var KhanProblemBody$Variable$Input$$serializer_instance = null;
  function KhanProblemBody$Variable$Input$$serializer_getInstance() {
    if (KhanProblemBody$Variable$Input$$serializer_instance === null) {
      new KhanProblemBody$Variable$Input$$serializer();
    }
    return KhanProblemBody$Variable$Input$$serializer_instance;
  }
  function KhanProblemBody$Variable$KhanProblemBody$Variable$Input_init(seen1, problemNumber, exerciseId, timeTaken, countHints, completed, itemId, assessmentItemId, quizProblemNumber, topicId, skipped, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(KhanProblemBody$Variable$Input.prototype);
    if ((seen1 & 1) === 0) 
      $this.problemNumber = 0;
    else 
      $this.problemNumber = problemNumber;
    if ((seen1 & 2) === 0) 
      $this.exerciseId = null;
    else 
      $this.exerciseId = exerciseId;
    if ((seen1 & 4) === 0) 
      $this.timeTaken = L0;
    else 
      $this.timeTaken = timeTaken;
    if ((seen1 & 8) === 0) 
      $this.countHints = 0;
    else 
      $this.countHints = countHints;
    if ((seen1 & 16) === 0) 
      $this.completed = false;
    else 
      $this.completed = completed;
    if ((seen1 & 32) === 0) 
      $this.itemId = null;
    else 
      $this.itemId = itemId;
    if ((seen1 & 64) === 0) 
      $this.assessmentItemId = null;
    else 
      $this.assessmentItemId = assessmentItemId;
    if ((seen1 & 128) === 0) 
      $this.quizProblemNumber = null;
    else 
      $this.quizProblemNumber = quizProblemNumber;
    if ((seen1 & 256) === 0) 
      $this.topicId = null;
    else 
      $this.topicId = topicId;
    if ((seen1 & 512) === 0) 
      $this.skipped = false;
    else 
      $this.skipped = skipped;
    return $this;
  }
  KhanProblemBody$Variable$Input.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Input', 
  interfaces: []};
  function KhanProblemBody$Variable$Companion() {
    KhanProblemBody$Variable$Companion_instance = this;
  }
  KhanProblemBody$Variable$Companion.prototype.serializer = function() {
  return KhanProblemBody$Variable$$serializer_getInstance();
};
  KhanProblemBody$Variable$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var KhanProblemBody$Variable$Companion_instance = null;
  function KhanProblemBody$Variable$Companion_getInstance() {
    if (KhanProblemBody$Variable$Companion_instance === null) {
      new KhanProblemBody$Variable$Companion();
    }
    return KhanProblemBody$Variable$Companion_instance;
  }
  function KhanProblemBody$Variable$$serializer() {
    this.descriptor_bcyayf$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentformats.har.KhanProblemBody.Variable', this, 1);
    this.descriptor.addElement_ivxn3r$('input', true);
    KhanProblemBody$Variable$$serializer_instance = this;
  }
  Object.defineProperty(KhanProblemBody$Variable$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_bcyayf$_0;
}});
  KhanProblemBody$Variable$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  if (!equals(value.input, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 0)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 0, KhanProblemBody$Variable$Input$$serializer_getInstance(), value.input);
  output.endStructure_24f42q$(this.descriptor);
};
  KhanProblemBody$Variable$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 0, KhanProblemBody$Variable$Input$$serializer_getInstance(), local0);
          bitMask0 |= 1;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return KhanProblemBody$KhanProblemBody$Variable_init(bitMask0, local0, null);
};
  KhanProblemBody$Variable$$serializer.prototype.childSerializers = function() {
  return [new NullableSerializer(KhanProblemBody$Variable$Input$$serializer_getInstance())];
};
  KhanProblemBody$Variable$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var KhanProblemBody$Variable$$serializer_instance = null;
  function KhanProblemBody$Variable$$serializer_getInstance() {
    if (KhanProblemBody$Variable$$serializer_instance === null) {
      new KhanProblemBody$Variable$$serializer();
    }
    return KhanProblemBody$Variable$$serializer_instance;
  }
  function KhanProblemBody$KhanProblemBody$Variable_init(seen1, input, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(KhanProblemBody$Variable.prototype);
    if ((seen1 & 1) === 0) 
      $this.input = null;
    else 
      $this.input = input;
    return $this;
  }
  KhanProblemBody$Variable.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Variable', 
  interfaces: []};
  function KhanProblemBody$Companion() {
    KhanProblemBody$Companion_instance = this;
  }
  KhanProblemBody$Companion.prototype.serializer = function() {
  return KhanProblemBody$$serializer_getInstance();
};
  KhanProblemBody$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var KhanProblemBody$Companion_instance = null;
  function KhanProblemBody$Companion_getInstance() {
    if (KhanProblemBody$Companion_instance === null) {
      new KhanProblemBody$Companion();
    }
    return KhanProblemBody$Companion_instance;
  }
  function KhanProblemBody$$serializer() {
    this.descriptor_cdizd7$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentformats.har.KhanProblemBody', this, 2);
    this.descriptor.addElement_ivxn3r$('operationName', true);
    this.descriptor.addElement_ivxn3r$('variables', true);
    KhanProblemBody$$serializer_instance = this;
  }
  Object.defineProperty(KhanProblemBody$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_cdizd7$_0;
}});
  KhanProblemBody$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  if (!equals(value.operationName, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 0)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 0, internal.StringSerializer, value.operationName);
  if (!equals(value.variables, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 1)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 1, KhanProblemBody$Variable$$serializer_getInstance(), value.variables);
  output.endStructure_24f42q$(this.descriptor);
};
  KhanProblemBody$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 0, internal.StringSerializer, local0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 1, KhanProblemBody$Variable$$serializer_getInstance(), local1);
          bitMask0 |= 2;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return KhanProblemBody_init(bitMask0, local0, local1, null);
};
  KhanProblemBody$$serializer.prototype.childSerializers = function() {
  return [new NullableSerializer(internal.StringSerializer), new NullableSerializer(KhanProblemBody$Variable$$serializer_getInstance())];
};
  KhanProblemBody$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var KhanProblemBody$$serializer_instance = null;
  function KhanProblemBody$$serializer_getInstance() {
    if (KhanProblemBody$$serializer_instance === null) {
      new KhanProblemBody$$serializer();
    }
    return KhanProblemBody$$serializer_instance;
  }
  function KhanProblemBody_init(seen1, operationName, variables, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(KhanProblemBody.prototype);
    if ((seen1 & 1) === 0) 
      $this.operationName = null;
    else 
      $this.operationName = operationName;
    if ((seen1 & 2) === 0) 
      $this.variables = null;
    else 
      $this.variables = variables;
    return $this;
  }
  KhanProblemBody.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'KhanProblemBody', 
  interfaces: []};
  function KhanProblemInterceptor() {
    HarInterceptor.call(this);
  }
  function Coroutine$intercept_456qbw$($this, request_0, response_0, harContainer_0, jsonArgs_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$_1 = void 0;
    this.local$tmp$_2 = void 0;
    this.local$tmp$_3 = void 0;
    this.local$tmp$_4 = void 0;
    this.local$tmp$_11 = void 0;
    this.local$harList = void 0;
    this.local$harResponse = void 0;
    this.local$containerEntryFile = void 0;
    this.local$request = request_0;
    this.local$response = response_0;
    this.local$harContainer = harContainer_0;
  }
  Coroutine$intercept_456qbw$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$intercept_456qbw$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$intercept_456qbw$.prototype.constructor = Coroutine$intercept_456qbw$;
  Coroutine$intercept_456qbw$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        var tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6;
        var tmp$_7;
        if (((tmp$ = this.local$request.regexedUrl) != null ? contains(tmp$, 'getAssessmentItem') : null) === false) {
          return this.local$response;
        } else {
          this.state_0 = 2;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        var $receiver = this.local$harContainer.requestMap;
        var key = new Pair(this.local$request.method, 'https://www.khanacademy.org/getAssessmentItem');
        var tmp$_8;
        this.local$harList = (Kotlin.isType(tmp$_8 = $receiver, Map) ? tmp$_8 : throwCCE()).get_11rb$(key);
        if (((tmp$_0 = this.local$request.regexedUrl) != null ? contains(tmp$_0, 'https://www.khanacademy.org/getAssessmentItem') : null) === true) {
          this.local$tmp$_1 = this.local$harList != null ? this.local$harList.removeAt_za3lpa$(0) : null;
          if (this.local$tmp$_1 == null) {
            return this.local$response;
          } else {
            this.state_0 = 4;
            continue;
          }
        } else {
          this.local$tmp$_2 = this.local$harList != null ? this.local$harList.get_za3lpa$(0) : null;
          if (this.local$tmp$_2 == null) {
            return this.local$response;
          } else {
            this.state_0 = 3;
            continue;
          }
        }
      case 3:
        this.local$tmp$_3 = this.local$tmp$_2;
        this.state_0 = 5;
        continue;
      case 4:
        this.local$tmp$_3 = this.local$tmp$_1;
        this.state_0 = 5;
        continue;
      case 5:
        var harEntry = this.local$tmp$_3;
        if (this.local$harList.isEmpty()) {
          this.local$harList.add_11rb$(harEntry);
        }
        this.local$tmp$_4 = harEntry.response;
        if (this.local$tmp$_4 == null) {
          return this.local$response;
        } else {
          this.state_0 = 6;
          continue;
        }
      case 6:
        this.local$harResponse = this.local$tmp$_4;
        var harText = (tmp$_2 = (tmp$_1 = this.local$harResponse.content) != null ? tmp$_1.text : null) != null ? tmp$_2 : '';
        this.local$containerEntryFile = (tmp$_5 = (tmp$_3 = this.local$harContainer.db.containerEntryDao.findByPathInContainer_a4hdmt$(this.local$harContainer.containerUid, harText)) != null ? tmp$_3.containerEntryFile : null) != null ? tmp$_5 : (tmp$_4 = this.local$harResponse.content) != null ? tmp$_4.entryFile : null;
        if (this.local$containerEntryFile == null) {
          this.local$harResponse.status = 402;
          this.local$harResponse.statusText = 'Not Found';
          this.local$harResponse.content = null;
          return this.local$harResponse;
        } else {
          this.state_0 = 7;
          continue;
        }
      case 7:
        var mutMap = this.local$harContainer.getHeaderMap_852edo$(this.local$harResponse.headers, this.local$containerEntryFile);
        var destination = ArrayList_init_0(mutMap.size);
        var tmp$_9;
        tmp$_9 = mutMap.entries.iterator();
        while (tmp$_9.hasNext()) {
          var item = tmp$_9.next();
          destination.add_11rb$(new HarNameValuePair(item.key, item.value));
        }
        this.local$harResponse.headers = destination;
        if (((tmp$_6 = this.local$harResponse.content) != null ? isTextContent(tmp$_6) : null) === true) {
          this.local$tmp$_11 = this.local$harResponse.content;
          this.state_0 = 8;
          this.result_0 = getStringFromContainerEntry(this.local$containerEntryFile, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 9;
          continue;
        }
      case 8:
                this.local$tmp$_11 != null ? (this.local$tmp$_11.text = this.result_0) : null;
        this.state_0 = 9;
        continue;
      case 9:
                (tmp$_7 = this.local$harResponse.content) != null ? (tmp$_7.entryFile = this.local$containerEntryFile) : null;
        return this.local$harResponse;
      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);
};
  KhanProblemInterceptor.prototype.intercept_456qbw$ = function(request_0, response_0, harContainer_0, jsonArgs_0, continuation_0, suspended) {
  var instance = new Coroutine$intercept_456qbw$(this, request_0, response_0, harContainer_0, jsonArgs_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  KhanProblemInterceptor.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'KhanProblemInterceptor', 
  interfaces: [HarInterceptor]};
  function put$lambda($receiver) {
    return Unit;
  }
  function ItemResponse() {
    ItemResponse$Companion_getInstance();
    this.itemData = null;
  }
  function ItemResponse$Companion() {
    ItemResponse$Companion_instance = this;
  }
  ItemResponse$Companion.prototype.serializer = function() {
  return ItemResponse$$serializer_getInstance();
};
  ItemResponse$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ItemResponse$Companion_instance = null;
  function ItemResponse$Companion_getInstance() {
    if (ItemResponse$Companion_instance === null) {
      new ItemResponse$Companion();
    }
    return ItemResponse$Companion_instance;
  }
  function ItemResponse$$serializer() {
    this.descriptor_6a2tfa$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentformats.har.ItemResponse', this, 1);
    this.descriptor.addElement_ivxn3r$('itemData', true);
    ItemResponse$$serializer_instance = this;
  }
  Object.defineProperty(ItemResponse$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_6a2tfa$_0;
}});
  ItemResponse$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  if (!equals(value.itemData, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 0)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 0, internal.StringSerializer, value.itemData);
  output.endStructure_24f42q$(this.descriptor);
};
  ItemResponse$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 0, internal.StringSerializer, local0);
          bitMask0 |= 1;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return ItemResponse_init(bitMask0, local0, null);
};
  ItemResponse$$serializer.prototype.childSerializers = function() {
  return [new NullableSerializer(internal.StringSerializer)];
};
  ItemResponse$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var ItemResponse$$serializer_instance = null;
  function ItemResponse$$serializer_getInstance() {
    if (ItemResponse$$serializer_instance === null) {
      new ItemResponse$$serializer();
    }
    return ItemResponse$$serializer_instance;
  }
  function ItemResponse_init(seen1, itemData, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(ItemResponse.prototype);
    if ((seen1 & 1) === 0) 
      $this.itemData = null;
    else 
      $this.itemData = itemData;
    return $this;
  }
  ItemResponse.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ItemResponse', 
  interfaces: []};
  function ItemData() {
    ItemData$Companion_getInstance();
    this.question = null;
  }
  function ItemData$Content() {
    ItemData$Content$Companion_getInstance();
    this.content = null;
  }
  function ItemData$Content$Companion() {
    ItemData$Content$Companion_instance = this;
  }
  ItemData$Content$Companion.prototype.serializer = function() {
  return ItemData$Content$$serializer_getInstance();
};
  ItemData$Content$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ItemData$Content$Companion_instance = null;
  function ItemData$Content$Companion_getInstance() {
    if (ItemData$Content$Companion_instance === null) {
      new ItemData$Content$Companion();
    }
    return ItemData$Content$Companion_instance;
  }
  function ItemData$Content$$serializer() {
    this.descriptor_f10asi$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentformats.har.ItemData.Content', this, 1);
    this.descriptor.addElement_ivxn3r$('content', true);
    ItemData$Content$$serializer_instance = this;
  }
  Object.defineProperty(ItemData$Content$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_f10asi$_0;
}});
  ItemData$Content$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  if (!equals(value.content, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 0)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 0, internal.StringSerializer, value.content);
  output.endStructure_24f42q$(this.descriptor);
};
  ItemData$Content$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 0, internal.StringSerializer, local0);
          bitMask0 |= 1;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return ItemData$ItemData$Content_init(bitMask0, local0, null);
};
  ItemData$Content$$serializer.prototype.childSerializers = function() {
  return [new NullableSerializer(internal.StringSerializer)];
};
  ItemData$Content$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var ItemData$Content$$serializer_instance = null;
  function ItemData$Content$$serializer_getInstance() {
    if (ItemData$Content$$serializer_instance === null) {
      new ItemData$Content$$serializer();
    }
    return ItemData$Content$$serializer_instance;
  }
  function ItemData$ItemData$Content_init(seen1, content, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(ItemData$Content.prototype);
    if ((seen1 & 1) === 0) 
      $this.content = null;
    else 
      $this.content = content;
    return $this;
  }
  ItemData$Content.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Content', 
  interfaces: []};
  function ItemData$Companion() {
    ItemData$Companion_instance = this;
  }
  ItemData$Companion.prototype.serializer = function() {
  return ItemData$$serializer_getInstance();
};
  ItemData$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ItemData$Companion_instance = null;
  function ItemData$Companion_getInstance() {
    if (ItemData$Companion_instance === null) {
      new ItemData$Companion();
    }
    return ItemData$Companion_instance;
  }
  function ItemData$$serializer() {
    this.descriptor_1ukmj1$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentformats.har.ItemData', this, 1);
    this.descriptor.addElement_ivxn3r$('question', true);
    ItemData$$serializer_instance = this;
  }
  Object.defineProperty(ItemData$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_1ukmj1$_0;
}});
  ItemData$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  if (!equals(value.question, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 0)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 0, ItemData$Content$$serializer_getInstance(), value.question);
  output.endStructure_24f42q$(this.descriptor);
};
  ItemData$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 0, ItemData$Content$$serializer_getInstance(), local0);
          bitMask0 |= 1;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return ItemData_init(bitMask0, local0, null);
};
  ItemData$$serializer.prototype.childSerializers = function() {
  return [new NullableSerializer(ItemData$Content$$serializer_getInstance())];
};
  ItemData$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var ItemData$$serializer_instance = null;
  function ItemData$$serializer_getInstance() {
    if (ItemData$$serializer_instance === null) {
      new ItemData$$serializer();
    }
    return ItemData$$serializer_instance;
  }
  function ItemData_init(seen1, question, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(ItemData.prototype);
    if ((seen1 & 1) === 0) 
      $this.question = null;
    else 
      $this.question = question;
    return $this;
  }
  ItemData.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ItemData', 
  interfaces: []};
  function KhanProgressTracker(httpClient) {
    HarInterceptor.call(this);
    this.httpClient = httpClient;
    this.exercisePath = '/api/internal/user/exercises/';
    this.itemPath = '/items/';
    this.langPath = '/assessment_item?lang=';
    this.counter = 1;
    this.numCorrect = 0;
    this.totalTime = L0;
  }
  function Coroutine$KhanProgressTracker$intercept$lambda(closure$data_0, closure$json_0, closure$bodyInput_0, this$KhanProgressTracker_0, closure$harContainer_0, closure$actor_0, closure$totalQuestions_0, closure$finalUrl_0, closure$exerciseId_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$data = closure$data_0;
    this.local$closure$json = closure$json_0;
    this.local$closure$bodyInput = closure$bodyInput_0;
    this.local$this$KhanProgressTracker = this$KhanProgressTracker_0;
    this.local$closure$harContainer = closure$harContainer_0;
    this.local$closure$actor = closure$actor_0;
    this.local$closure$totalQuestions = closure$totalQuestions_0;
    this.local$closure$finalUrl = closure$finalUrl_0;
    this.local$closure$exerciseId = closure$exerciseId_0;
    this.local$tmp$_0 = void 0;
    this.local$tmp$_1 = void 0;
    this.local$tmp$_3 = void 0;
    this.local$question = void 0;
    this.local$completed = void 0;
    this.local$timeTaken = void 0;
    this.local$verbUrl = void 0;
    this.local$verbDisplay = void 0;
  }
  Coroutine$KhanProgressTracker$intercept$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$KhanProgressTracker$intercept$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$KhanProgressTracker$intercept$lambda.prototype.constructor = Coroutine$KhanProgressTracker$intercept$lambda;
  Coroutine$KhanProgressTracker$intercept$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        var tmp$_0;
        var tmp$_1, tmp$_2;
        if ((tmp$ = this.local$closure$data.containerEntryFile) != null) {
          this.state_0 = 2;
          this.result_0 = getStringFromContainerEntry(tmp$, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        continue;
      case 3:
        this.local$tmp$_0 = this.result_0;
        if (this.local$tmp$_0 == null) {
          return;
        } else {
          this.state_0 = 4;
          continue;
        }
      case 4:
        var result = this.local$tmp$_0;
        this.local$tmp$_1 = this.local$closure$json.decodeFromString_awif5v$(ItemResponse$Companion_getInstance().serializer(), result).itemData;
        if (this.local$tmp$_1 == null) {
          return;
        } else {
          this.state_0 = 5;
          continue;
        }
      case 5:
        var itemResp = this.local$tmp$_1;
        this.local$tmp$_3 = (tmp$_0 = this.local$closure$json.decodeFromString_awif5v$(ItemData$Companion_getInstance().serializer(), itemResp).question) != null ? tmp$_0.content : null;
        if (this.local$tmp$_3 == null) {
          return;
        } else {
          this.state_0 = 6;
          continue;
        }
      case 6:
        this.local$question = this.local$tmp$_3;
        var $receiver = this.local$question;
        this.local$question = Regex_init('(\\[\\[(.*)]])|\\*|\\n|:-: \\||\\{|\\}|\\$large').replace_x2uqeu$($receiver, '');
        var skipped = this.local$closure$bodyInput.skipped;
        this.local$completed = skipped ? false : this.local$closure$bodyInput.completed;
        this.local$this$KhanProgressTracker.totalTime = this.local$this$KhanProgressTracker.totalTime.add(this.local$closure$bodyInput.timeTaken);
        this.local$timeTaken = UMTinCanUtil_getInstance().format8601Duration_s8cxhz$(this.local$closure$bodyInput.timeTaken.multiply(Kotlin.Long.fromInt(1000)));
        this.local$verbUrl = skipped ? 'http://id.tincanapi.com/verb/skipped' : 'http://adlnet.gov/expapi/verbs/answered';
        this.local$verbDisplay = skipped ? 'skipped' : 'answered';
        if (this.local$closure$bodyInput.countHints === 0 && this.local$completed) {
          tmp$_1 = this.local$this$KhanProgressTracker.numCorrect;
          this.local$this$KhanProgressTracker.numCorrect = tmp$_1 + 1 | 0;
        }
        if (this.local$closure$harContainer.umAccount == null) {
          return;
        } else {
          this.state_0 = 7;
          continue;
        }
      case 7:
        var statement = trimIndent('\n' + '\n' + '        {' + '\n' + '            ' + '"' + 'actor' + '"' + ': ' + this.local$closure$actor + ',' + '\n' + '            ' + '"' + 'verb' + '"' + ': {' + '\n' + '                ' + '"' + 'id' + '"' + ': ' + '"' + this.local$verbUrl + '"' + ',' + '\n' + '                ' + '"' + 'display' + '"' + ': {' + '\n' + '                    ' + '"' + 'en-US' + '"' + ': ' + '"' + this.local$verbDisplay + '"' + '\n' + '                }' + '\n' + '            },' + '\n' + '            ' + '"' + 'result' + '"' + ': {' + '\n' + '                ' + '"' + 'success' + '"' + ' : ' + this.local$completed + ',' + '\n' + '                ' + '"' + 'duration' + '"' + ' : ' + '"' + this.local$timeTaken + '"' + ',' + '\n' + '                 ' + '"' + 'extensions' + '"' + ': {' + '\n' + '                      ' + '"' + 'https://w3id.org/xapi/cmi5/result/extensions/progress' + '"' + ': ' + numberToInt(this.local$this$KhanProgressTracker.counter / this.local$closure$totalQuestions * 100) + '\n' + '                    }' + '\n' + '            },' + '\n' + '            ' + '"' + 'object' + '"' + ': {' + '\n' + '                ' + '"' + 'id' + '"' + ' : ' + '"' + this.local$closure$finalUrl + '"' + ',' + '\n' + '                ' + '"' + 'objectType' + '"' + ' : ' + '"' + 'Activity' + '"' + ',' + '\n' + '                ' + '"' + 'definition' + '"' + ' : {' + '\n' + '                        ' + '"' + 'name' + '"' + ': {' + '"' + 'en-US' + '"' + ':' + '"' + 'Exercise ' + this.local$closure$exerciseId + ' : Question ' + this.local$this$KhanProgressTracker.counter + '"' + '},' + '\n' + '                        ' + '"' + 'description' + '"' + ': {' + '"' + 'en-US' + '"' + ':' + '"' + this.local$question + '"' + '}' + '\n' + '                }' + '\n' + '            }' + '\n' + '        }' + '\n' + '            ' + '\n' + '        ');
        if (this.local$closure$bodyInput.completed) {
          tmp$_2 = this.local$this$KhanProgressTracker.counter;
          this.local$this$KhanProgressTracker.counter = tmp$_2 + 1 | 0;
        }
        return this.local$this$KhanProgressTracker.sendStatement_0(statement, this.local$closure$harContainer) , Unit;
      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 KhanProgressTracker$intercept$lambda(closure$data_0, closure$json_0, closure$bodyInput_0, this$KhanProgressTracker_0, closure$harContainer_0, closure$actor_0, closure$totalQuestions_0, closure$finalUrl_0, closure$exerciseId_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$KhanProgressTracker$intercept$lambda(closure$data_0, closure$json_0, closure$bodyInput_0, this$KhanProgressTracker_0, closure$harContainer_0, closure$actor_0, closure$totalQuestions_0, closure$finalUrl_0, closure$exerciseId_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  KhanProgressTracker.prototype.intercept_456qbw$ = function(request, response, harContainer, jsonArgs, continuation) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6, tmp$_7, tmp$_8, tmp$_9, tmp$_10, tmp$_11, tmp$_12, tmp$_13;
  if (((tmp$ = request.regexedUrl) != null ? contains(tmp$, 'khanacademy.org') : null) === false || (((tmp$_0 = request.regexedUrl) != null ? contains(tmp$_0, 'attempt') : null) === false && ((tmp$_1 = request.regexedUrl) != null ? contains(tmp$_1, 'getEotCardDetails') : null) === false)) {
    return response;
  }
  var lang = (tmp$_4 = (tmp$_3 = (tmp$_2 = request.url) != null ? substringBefore(tmp$_2, '.khan') : null) != null ? substringAfter(tmp$_3, '://') : null) != null ? tmp$_4 : 'en';
  if (equals(lang, 'www')) {
    lang = 'en';
  }
  var json = harContainer.json;
  var requestUrl = Url((tmp$_5 = request.url) != null ? tmp$_5 : '');
  var sourceUrl = (tmp$_6 = harContainer.entry.sourceUrl) != null ? tmp$_6 : '';
  var exerciseId = substringBefore(substringAfter(sourceUrl, 'khan-id://'), '.');
  var urlToFindTotalQuestions = (new URLBuilder(URLProtocol.Companion.HTTPS, requestUrl.host, void 0, void 0, void 0, this.exercisePath + exerciseId)).buildString();
  var $receiver = harContainer.requestMap;
  var tmp$_14;
  var result = LinkedHashMap_init();
  tmp$_14 = $receiver.entries.iterator();
  while (tmp$_14.hasNext()) {
    var entry = tmp$_14.next();
    if (startsWith(entry.key.second, urlToFindTotalQuestions)) {
      result.put_xwzc9p$(entry.key, entry.value);
    }
  }
  var totalQuestions = result.size;
  var actor = harContainer.json.encodeToString_tf03ej$(UmAccountActor$Companion_getInstance().serializer(), toXapiActorJsonObject(harContainer.umAccount, harContainer.context));
  if (((tmp$_7 = request.regexedUrl) != null ? contains(tmp$_7, 'getEotCardDetails') : null) === true) {
    var totalTimeFormat = UMTinCanUtil_getInstance().format8601Duration_s8cxhz$(this.totalTime.multiply(Kotlin.Long.fromInt(1000)));
    var completeResponse = trimIndent('\n' + '                ' + '\n' + '               {' + '\n' + '                 ' + '"' + 'errors' + '"' + ': null,' + '\n' + '                 ' + '"' + 'data' + '"' + ': {' + '\n' + '                   ' + '"' + 'user' + '"' + ': {' + '\n' + '                     ' + '"' + 'id' + '"' + ': ' + '"' + 'kaid_346437629923241310559242' + '"' + ',' + '\n' + '                     ' + '"' + 'exerciseData' + '"' + ': {' + '\n' + '                       ' + '"' + 'practiceAttempt' + '"' + ': {' + '\n' + '                         ' + '"' + 'id' + '"' + ': ' + '"' + 'ag5zfmtoYW4tYWNhZGVteXIZCxIMTGVhcm5pbmdUYXNrGICAuf7P0P8JDA' + '"' + ',' + '\n' + '                         ' + '"' + 'numAttempted' + '"' + ': ' + totalQuestions + ',' + '\n' + '                         ' + '"' + 'numCorrect' + '"' + ': ' + this.numCorrect + ',' + '\n' + '                         ' + '"' + 'startingFpmLevel' + '"' + ': ' + '"' + 'unfamiliar' + '"' + ',' + '\n' + '                         ' + '"' + 'endingFpmLevel' + '"' + ': ' + '"' + 'familiar' + '"' + ',' + '\n' + '                         ' + '"' + 'masteryLevelChange' + '"' + ': ' + '"' + 'UP' + '"' + ',' + '\n' + '                         ' + '"' + 'pointsEarned' + '"' + ': ' + (this.numCorrect * 100 | 0) + ',' + '\n' + '                         ' + '"' + '__typename' + '"' + ': ' + '"' + 'PracticeAttempt' + '"' + '\n' + '                       },' + '\n' + '                       ' + '"' + '__typename' + '"' + ': ' + '"' + 'UserExerciseData' + '"' + '\n' + '                     },' + '\n' + '                     ' + '"' + '__typename' + '"' + ': ' + '"' + 'User' + '"' + '\n' + '                   }' + '\n' + '                 }' + '\n' + '               }' + '\n' + '\n' + '            ');
    var statement = trimIndent('\n' + '                ' + '\n' + '                {' + '\n' + '                    ' + '"' + 'actor' + '"' + ': ' + actor + ',' + '\n' + '                    ' + '"' + 'verb' + '"' + ': {' + '\n' + '                        ' + '"' + 'id' + '"' + ': ' + '"' + 'http://adlnet.gov/expapi/verbs/completed' + '"' + ',' + '\n' + '                        ' + '"' + 'display' + '"' + ': {' + '\n' + '                            ' + '"' + 'en-US' + '"' + ': ' + '"' + 'completed' + '"' + '\n' + '                        }' + '\n' + '                    },' + '\n' + '                    ' + '"' + 'result' + '"' + ': {' + '\n' + '                        ' + '"' + 'completion' + '"' + ': true,' + '\n' + '                        ' + '"' + 'score' + '"' + ': {' + '\n' + '                            ' + '"' + 'scaled' + '"' + ': ' + this.numCorrect / totalQuestions + ',' + '\n' + '                            ' + '"' + 'raw' + '"' + ': ' + this.numCorrect + ',' + '\n' + '                            ' + '"' + 'min' + '"' + ': 0,' + '\n' + '                            ' + '"' + 'max' + '"' + ': ' + totalQuestions + '\n' + '                        },' + '\n' + '                        ' + '"' + 'duration' + '"' + ': ' + '"' + totalTimeFormat + '"' + ',' + '\n' + '                         ' + '"' + 'extensions' + '"' + ': {' + '\n' + '                              ' + '"' + 'https://w3id.org/xapi/cmi5/result/extensions/progress' + '"' + ': 100' + '\n' + '                         }' + '\n' + '                    },' + '\n' + '                    ' + '"' + 'object' + '"' + ': {' + '\n' + '                        ' + '"' + 'id' + '"' + ': ' + '"' + sourceUrl + '"' + ',' + '\n' + '                        ' + '"' + 'objectType' + '"' + ': ' + '"' + 'Activity' + '"' + ',' + '\n' + '                        ' + '"' + 'definition' + '"' + ': {' + '\n' + '                            ' + '"' + 'name' + '"' + ': {' + '\n' + '                                ' + '"' + 'en-US' + '"' + ': ' + '"' + toString(harContainer.entry.title) + '"' + '\n' + '                            },' + '\n' + '                            ' + '"' + 'description' + '"' + ': {' + '\n' + '                                ' + '"' + 'en-US' + '"' + ': ' + '"' + toString(harContainer.entry.description) + '"' + '\n' + '                            }' + '\n' + '                        }' + '\n' + '                    }' + '\n' + '                }' + '\n' + '                ' + '\n' + '                ' + '\n' + '            ');
    if (harContainer.umAccount != null) {
      this.sendStatement_0(statement, harContainer);
    }
    var cardDetailsContent = new HarContent();
    cardDetailsContent.text = completeResponse;
    cardDetailsContent.mimeType = 'application/json';
    cardDetailsContent.size = Kotlin.Long.fromInt(completeResponse.length);
    cardDetailsContent.encoding = 'UTF-8';
    var cardDetailsResponse = new HarResponse();
    cardDetailsResponse.content = cardDetailsContent;
    cardDetailsResponse.status = 200;
    cardDetailsResponse.statusText = 'OK';
    return cardDetailsResponse;
  }
  tmp$_8 = request.body;
  if (tmp$_8 == null) {
    return response;
  }
  var attemptBody = tmp$_8;
  var body = json.decodeFromString_awif5v$(KhanProblemBody$Companion_getInstance().serializer(), attemptBody);
  tmp$_10 = (tmp$_9 = body.variables) != null ? tmp$_9.input : null;
  if (tmp$_10 == null) {
    return response;
  }
  var bodyInput = tmp$_10;
  var finalUrl = (new URLBuilder(URLProtocol.Companion.HTTPS, requestUrl.host, void 0, void 0, void 0, this.exercisePath + exerciseId + this.itemPath + toString(bodyInput.assessmentItemId) + this.langPath + lang)).buildString();
  var harList = harContainer.requestMap.get_11rb$(new Pair('GET', finalUrl));
  if (harList == null || harList.isEmpty()) 
    return response;
  var resultEntry = harList.get_za3lpa$(0);
  var harText = (tmp$_12 = (tmp$_11 = resultEntry.response) != null ? tmp$_11.content : null) != null ? tmp$_12.text : null;
  tmp$_13 = harContainer.db.containerEntryDao.findByPathInContainer_a4hdmt$(harContainer.containerUid, harText != null ? harText : '');
  if (tmp$_13 == null) {
    return response;
  }
  var data = tmp$_13;
  launch(coroutines.GlobalScope, void 0, void 0, KhanProgressTracker$intercept$lambda(data, json, bodyInput, this, harContainer, actor, totalQuestions, finalUrl, exerciseId));
  return response;
};
  function KhanProgressTracker$sendStatement$lambda$lambda$lambda(closure$harContainer) {
    return function($receiver, it) {
  takeFrom($receiver, closure$harContainer.localHttp);
  $receiver.encodedPath = $receiver.encodedPath + 'xapi/' + closure$harContainer.entry.contentEntryUid.toString() + '/statements';
  return Unit;
};
  }
  function KhanProgressTracker$sendStatement$lambda$lambda(closure$harContainer, closure$statement) {
    return function($receiver) {
  $receiver.url_6yzzjr$(KhanProgressTracker$sendStatement$lambda$lambda$lambda(closure$harContainer));
  $receiver.body = closure$statement;
  return Unit;
};
  }
  function Coroutine$KhanProgressTracker$sendStatement$lambda(this$KhanProgressTracker_0, closure$harContainer_0, closure$statement_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 6;
    this.local$this$KhanProgressTracker = this$KhanProgressTracker_0;
    this.local$closure$harContainer = closure$harContainer_0;
    this.local$closure$statement = closure$statement_0;
    this.local$response = void 0;
  }
  Coroutine$KhanProgressTracker$sendStatement$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$KhanProgressTracker$sendStatement$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$KhanProgressTracker$sendStatement$lambda.prototype.constructor = Coroutine$KhanProgressTracker$sendStatement$lambda;
  Coroutine$KhanProgressTracker$sendStatement$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var $receiver_0 = this.local$this$KhanProgressTracker.httpClient;
        var block = KhanProgressTracker$sendStatement$lambda$lambda(this.local$closure$harContainer, this.local$closure$statement);
        var host;
        var body;
        host = 'localhost';
        body = utils.EmptyContent;
        var $receiver_1 = new HttpRequestBuilder_init();
        url_0($receiver_1, 'http', host, 0, '/');
        $receiver_1.method = HttpMethod.Companion.Put;
        $receiver_1.body = body;
        block($receiver_1);
        var $this_0 = new HttpStatement($receiver_1, $receiver_0);
        var tmp$_4, tmp$_5, tmp$_6;
        tmp$_4 = getKClass(HttpStatement);
        if (equals(tmp$_4, getKClass(HttpStatement))) {
          this.result_0 = Kotlin.isType(tmp$_5 = $this_0, HttpStatement) ? tmp$_5 : throwCCE();
          this.state_0 = 9;
          continue;
        } else {
          if (equals(tmp$_4, getKClass(HttpResponse))) {
            this.state_0 = 7;
            this.result_0 = $this_0.execute(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 1;
            this.result_0 = $this_0.executeUnsafe(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          }
        }
      case 1:
        this.local$response = this.result_0;
        this.exceptionState_0 = 4;
        var tmp$_7;
        var tmp$_8 = this.local$response.call;
        var typeInfo$result_0;
        typeInfo$break:
          do {
            try {
              typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(HttpStatement), createKType(getKClass(HttpStatement), [], false));
            }            catch (_) {
  typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(HttpStatement), null);
  break typeInfo$break;
}
          } while (false);
        this.state_0 = 2;
        this.result_0 = tmp$_8.receive_qi9ur9$(typeInfo$result_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 2:
        this.result_0 = Kotlin.isType(tmp$_7 = this.result_0, HttpStatement) ? tmp$_7 : throwCCE();
        this.exceptionState_0 = 6;
        this.finallyPath_0 = [3];
        this.state_0 = 5;
        continue;
      case 3:
        this.state_0 = 8;
        continue;
      case 4:
        this.finallyPath_0 = [6];
        this.state_0 = 5;
        continue;
      case 5:
        this.exceptionState_0 = 6;
        complete(this.local$response);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 6:
        throw this.exception_0;
      case 7:
        this.result_0 = Kotlin.isType(tmp$_6 = this.result_0, HttpStatement) ? tmp$_6 : throwCCE();
        this.state_0 = 8;
        continue;
      case 8:
        this.state_0 = 9;
        continue;
      case 9:
        this.result_0;
        this.state_0 = 10;
        this.result_0 = this.result_0.execute(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 10:
        return this.result_0;
      default:
        this.state_0 = 6;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 6) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function KhanProgressTracker$sendStatement$lambda(this$KhanProgressTracker_0, closure$harContainer_0, closure$statement_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$KhanProgressTracker$sendStatement$lambda(this$KhanProgressTracker_0, closure$harContainer_0, closure$statement_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  KhanProgressTracker.prototype.sendStatement_0 = function(statement, harContainer) {
  launch(coroutines.GlobalScope, void 0, void 0, KhanProgressTracker$sendStatement$lambda(this, harContainer, statement));
};
  KhanProgressTracker.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'KhanProgressTracker', 
  interfaces: [HarInterceptor]};
  function RecorderInterceptor() {
    HarInterceptor.call(this);
    this.worker_0 = "\n    \n     const constantMock = window.fetch;\n        window.fetch = function() {\n            // Get the parameter in arguments\n            // Intercept the parameter here\n            \n             if(arguments.length > 0){\n                 var request = arguments[0].clone()\n                console.log(request.bodyUsed)\n                if (request.method !== 'GET' && request.method !== 'HEAD') { \n                    request.text().then(function(body) {\n                            console.log(body)\n                            recorder.recordPayload(request.method, request.url, body);\n                    });\n                }\n            }\n\n            return constantMock.apply(this, arguments);\n        };\n";
    this.jsInject_0 = "<script type=\"text/javascript\">\n    \n     const constantMock = window.fetch;\n        window.fetch = function() {\n            // Get the parameter in arguments\n            // Intercept the parameter here\n            \n             if(arguments.length > 0){\n                 var request = arguments[0].clone()\n                console.log(request.bodyUsed)\n                if (request.method !== 'GET' && request.method !== 'HEAD') { \n                    request.text().then(function(body) {\n                            console.log(body)\n                            recorder.recordPayload(request.method, request.url, body);\n                    });\n                }\n            }\n\n            return constantMock.apply(this, arguments);\n        };\n</script>";
  }
  RecorderInterceptor.prototype.intercept_456qbw$ = function(request, response, harContainer, jsonArgs, continuation) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4;
  if (((tmp$_0 = (tmp$ = response.content) != null ? tmp$.mimeType : null) != null ? contains(tmp$_0, 'text/html') : null) === false) {
    return response;
  }
  var head = Regex_init('(<head([^>]*)>)');
  tmp$_2 = (tmp$_1 = response.content) != null ? tmp$_1.text : null;
  if (tmp$_2 == null) {
    return response;
  }
  var data = tmp$_2;
  var $receiver = data;
  var replacement = "$1<script type=\"text/javascript\">\n    \n     const constantMock = window.fetch;\n        window.fetch = function() {\n            // Get the parameter in arguments\n            // Intercept the parameter here\n            \n             if(arguments.length > 0){\n                 var request = arguments[0].clone()\n                console.log(request.bodyUsed)\n                if (request.method !== 'GET' && request.method !== 'HEAD') { \n                    request.text().then(function(body) {\n                            console.log(body)\n                            recorder.recordPayload(request.method, request.url, body);\n                    });\n                }\n            }\n\n            return constantMock.apply(this, arguments);\n        };\n</script>";
  data = head.replace_x2uqeu$($receiver, replacement);
    (tmp$_3 = response.content) != null ? (tmp$_3.text = data) : null;
    (tmp$_4 = response.content) != null ? (tmp$_4.size = Kotlin.Long.fromInt(data.length)) : null;
  return response;
};
  RecorderInterceptor.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'RecorderInterceptor', 
  interfaces: [HarInterceptor]};
  function ImportedContentEntryMetaData(contentEntry, mimeType, uri, scraperType) {
    ImportedContentEntryMetaData$Companion_getInstance();
    if (scraperType === void 0) 
      scraperType = null;
    this.contentEntry = contentEntry;
    this.mimeType = mimeType;
    this.uri = uri;
    this.scraperType = scraperType;
  }
  function ImportedContentEntryMetaData$Companion() {
    ImportedContentEntryMetaData$Companion_instance = this;
  }
  ImportedContentEntryMetaData$Companion.prototype.serializer = function() {
  return ImportedContentEntryMetaData$$serializer_getInstance();
};
  ImportedContentEntryMetaData$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ImportedContentEntryMetaData$Companion_instance = null;
  function ImportedContentEntryMetaData$Companion_getInstance() {
    if (ImportedContentEntryMetaData$Companion_instance === null) {
      new ImportedContentEntryMetaData$Companion();
    }
    return ImportedContentEntryMetaData$Companion_instance;
  }
  function ImportedContentEntryMetaData$$serializer() {
    this.descriptor_1oermc$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentformats.metadata.ImportedContentEntryMetaData', this, 4);
    this.descriptor.addElement_ivxn3r$('contentEntry', false);
    this.descriptor.addElement_ivxn3r$('mimeType', false);
    this.descriptor.addElement_ivxn3r$('uri', false);
    this.descriptor.addElement_ivxn3r$('scraperType', true);
    ImportedContentEntryMetaData$$serializer_instance = this;
  }
  Object.defineProperty(ImportedContentEntryMetaData$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_1oermc$_0;
}});
  ImportedContentEntryMetaData$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  output.encodeSerializableElement_r4qlx7$(this.descriptor, 0, ContentEntryWithLanguage.$serializer, value.contentEntry);
  output.encodeStringElement_iij8qq$(this.descriptor, 1, value.mimeType);
  output.encodeStringElement_iij8qq$(this.descriptor, 2, value.uri);
  if (!equals(value.scraperType, null) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 3)) 
    output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 3, internal.StringSerializer, value.scraperType);
  output.endStructure_24f42q$(this.descriptor);
};
  ImportedContentEntryMetaData$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1, local2, local3;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeSerializableElement_12e8id$(this.descriptor, 0, ContentEntryWithLanguage.$serializer, local0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeStringElement_szpzho$(this.descriptor, 1);
          bitMask0 |= 2;
          break;
        case 2:
          local2 = input.decodeStringElement_szpzho$(this.descriptor, 2);
          bitMask0 |= 4;
          break;
        case 3:
          local3 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 3, internal.StringSerializer, local3);
          bitMask0 |= 8;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return ImportedContentEntryMetaData_init(bitMask0, local0, local1, local2, local3, null);
};
  ImportedContentEntryMetaData$$serializer.prototype.childSerializers = function() {
  return [ContentEntryWithLanguage.$serializer, internal.StringSerializer, internal.StringSerializer, new NullableSerializer(internal.StringSerializer)];
};
  ImportedContentEntryMetaData$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var ImportedContentEntryMetaData$$serializer_instance = null;
  function ImportedContentEntryMetaData$$serializer_getInstance() {
    if (ImportedContentEntryMetaData$$serializer_instance === null) {
      new ImportedContentEntryMetaData$$serializer();
    }
    return ImportedContentEntryMetaData$$serializer_instance;
  }
  function ImportedContentEntryMetaData_init(seen1, contentEntry, mimeType, uri, scraperType, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(ImportedContentEntryMetaData.prototype);
    if ((seen1 & 1) === 0) 
      throw MissingFieldException_init('contentEntry');
    else 
      $this.contentEntry = contentEntry;
    if ((seen1 & 2) === 0) 
      throw MissingFieldException_init('mimeType');
    else 
      $this.mimeType = mimeType;
    if ((seen1 & 4) === 0) 
      throw MissingFieldException_init('uri');
    else 
      $this.uri = uri;
    if ((seen1 & 8) === 0) 
      $this.scraperType = null;
    else 
      $this.scraperType = scraperType;
    return $this;
  }
  ImportedContentEntryMetaData.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ImportedContentEntryMetaData', 
  interfaces: []};
  ImportedContentEntryMetaData.prototype.component1 = function() {
  return this.contentEntry;
};
  ImportedContentEntryMetaData.prototype.component2 = function() {
  return this.mimeType;
};
  ImportedContentEntryMetaData.prototype.component3 = function() {
  return this.uri;
};
  ImportedContentEntryMetaData.prototype.component4 = function() {
  return this.scraperType;
};
  ImportedContentEntryMetaData.prototype.copy_7oh3p0$ = function(contentEntry, mimeType, uri, scraperType) {
  return new ImportedContentEntryMetaData(contentEntry === void 0 ? this.contentEntry : contentEntry, mimeType === void 0 ? this.mimeType : mimeType, uri === void 0 ? this.uri : uri, scraperType === void 0 ? this.scraperType : scraperType);
};
  ImportedContentEntryMetaData.prototype.toString = function() {
  return 'ImportedContentEntryMetaData(contentEntry=' + Kotlin.toString(this.contentEntry) + (', mimeType=' + Kotlin.toString(this.mimeType)) + (', uri=' + Kotlin.toString(this.uri)) + (', scraperType=' + Kotlin.toString(this.scraperType)) + ')';
};
  ImportedContentEntryMetaData.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.contentEntry) | 0;
  result = result * 31 + Kotlin.hashCode(this.mimeType) | 0;
  result = result * 31 + Kotlin.hashCode(this.uri) | 0;
  result = result * 31 + Kotlin.hashCode(this.scraperType) | 0;
  return result;
};
  ImportedContentEntryMetaData.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.contentEntry, other.contentEntry) && Kotlin.equals(this.mimeType, other.mimeType) && Kotlin.equals(this.uri, other.uri) && Kotlin.equals(this.scraperType, other.scraperType)))));
};
  function OpdsEntry() {
    OpdsEntry$Companion_getInstance();
    this.id_43vka7$_0 = this.id_43vka7$_0;
    this.title_jfsscw$_0 = this.title_jfsscw$_0;
    this.author = null;
    this.publisher = null;
    this.license = null;
    this.updated = null;
    this.summary = null;
    this.readingLevel = null;
    this.targetName = null;
    this.linkList = ArrayList_init();
  }
  Object.defineProperty(OpdsEntry.prototype, 'id', {
  configurable: true, 
  get: function() {
  if (this.id_43vka7$_0 == null) 
    return throwUPAE('id');
  return this.id_43vka7$_0;
}, 
  set: function(id) {
  this.id_43vka7$_0 = id;
}});
  Object.defineProperty(OpdsEntry.prototype, 'title', {
  configurable: true, 
  get: function() {
  if (this.title_jfsscw$_0 == null) 
    return throwUPAE('title');
  return this.title_jfsscw$_0;
}, 
  set: function(title) {
  this.title_jfsscw$_0 = title;
}});
  function OpdsEntry$Companion() {
    OpdsEntry$Companion_instance = this;
    this.ATTR_ID = 'id';
    this.ATTR_AUTHOR = 'author';
    this.ATTR_TITLE = 'title';
    this.ATTR_PUBLISHER = 'dc:publisher';
    this.ATTR_LICENSE = 'dc:license';
    this.ATTR_UPDATED = 'updated';
    this.ATTR_SUMMARY = 'summary';
    this.ATTR_LINK = 'link';
    this.ATTR_CREATED = 'created';
    this.ATTR_LRMI = 'lrmi:educationalAlignment';
    this.ATTR_ALIGNMENT = 'alignmentType';
    this.ATTR_TARGET = 'targetName';
  }
  OpdsEntry$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var OpdsEntry$Companion_instance = null;
  function OpdsEntry$Companion_getInstance() {
    if (OpdsEntry$Companion_instance === null) {
      new OpdsEntry$Companion();
    }
    return OpdsEntry$Companion_instance;
  }
  OpdsEntry.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'OpdsEntry', 
  interfaces: []};
  function OpdsFeed() {
    OpdsFeed$Companion_getInstance();
    this.id_c8fa5b$_0 = this.id_c8fa5b$_0;
    this.title_1e3fwg$_0 = this.title_1e3fwg$_0;
    this.updated = null;
    this.author = null;
    this.category = null;
    this.summary = null;
    this.linkList = ArrayList_init();
    this.entryList = ArrayList_init();
  }
  Object.defineProperty(OpdsFeed.prototype, 'id', {
  configurable: true, 
  get: function() {
  if (this.id_c8fa5b$_0 == null) 
    return throwUPAE('id');
  return this.id_c8fa5b$_0;
}, 
  set: function(id) {
  this.id_c8fa5b$_0 = id;
}});
  Object.defineProperty(OpdsFeed.prototype, 'title', {
  configurable: true, 
  get: function() {
  if (this.title_1e3fwg$_0 == null) 
    return throwUPAE('title');
  return this.title_1e3fwg$_0;
}, 
  set: function(title) {
  this.title_1e3fwg$_0 = title;
}});
  OpdsFeed.prototype.loadFromParser_gtk95s$ = function(xpp) {
  var evtType = xpp.getEventType();
  do {
    if (evtType === 2) {
      var name = xpp.getName();
      switch (name) {
        case 'id':
          this.id = ensureNotNull(xpp.nextText());
          break;
        case 'title':
          this.title = ensureNotNull(xpp.nextText());
          break;
        case 'updated':
          this.updated = UMCalendarUtil_getInstance().parseOpdsDate_61zpoe$(ensureNotNull(xpp.nextText()));
          break;
        case 'entry':
          var entry = new OpdsEntry();
          do {
            if (evtType === 2) {
              name = xpp.getName();
              switch (name) {
                case 'id':
                  entry.id = ensureNotNull(xpp.nextText());
                  break;
                case 'title':
                  entry.title = ensureNotNull(xpp.nextText());
                  break;
                case 'link':
                  entry.linkList.add_11rb$(this.createLink_0(xpp));
                  break;
                case 'dc:publisher':
                  entry.publisher = xpp.nextText();
                  break;
                case 'summary':
                  entry.summary = xpp.nextText();
                  break;
                case 'author':
                  xpp.nextTag();
                  entry.author = xpp.nextText();
                  break;
                case 'updated':
                  entry.updated = UMCalendarUtil_getInstance().parseOpdsDate_61zpoe$(ensureNotNull(xpp.nextText()));
                  break;
                case 'created':
                  if (entry.updated == null) {
                    entry.updated = UMCalendarUtil_getInstance().parseOpdsDate_61zpoe$(ensureNotNull(xpp.nextText()));
                  }
                  break;
                case 'lrmi:educationalAlignment':
                  entry.targetName = xpp.getAttributeValue_f5e6j7$(null, OpdsEntry$Companion_getInstance().ATTR_TARGET);
                  entry.readingLevel = xpp.getAttributeValue_f5e6j7$(null, OpdsEntry$Companion_getInstance().ATTR_ALIGNMENT);
                  break;
                case 'dc:license':
                  entry.license = xpp.nextText();
                  break;
              }
            }
            evtType = xpp.next();
          } while (!(evtType === 3 && equals(xpp.getName(), 'entry')));
          this.entryList.add_11rb$(entry);
          break;
        case 'link':
          this.linkList.add_11rb$(this.createLink_0(xpp));
          break;
      }
    }
    evtType = xpp.next();
  } while (evtType !== 1);
};
  OpdsFeed.prototype.createLink_0 = function(xpp) {
  var tmp$;
  var link = new OpdsLink();
  link.href = ensureNotNull(xpp.getAttributeValue_f5e6j7$(null, OpdsLink$Companion_getInstance().ATTR_HREF));
  link.rel = ensureNotNull(xpp.getAttributeValue_f5e6j7$(null, OpdsLink$Companion_getInstance().ATTR_REL));
  link.title = xpp.getAttributeValue_f5e6j7$(null, OpdsLink$Companion_getInstance().ATTR_TITLE);
  link.type = xpp.getAttributeValue_f5e6j7$(null, OpdsLink$Companion_getInstance().ATTR_TYPE);
  link.activeFacet = (tmp$ = xpp.getAttributeValue_f5e6j7$(null, OpdsLink$Companion_getInstance().ATTR_FACET_ACTIVE)) != null ? toBoolean(tmp$) : null;
  link.facetGroup = xpp.getAttributeValue_f5e6j7$(null, OpdsLink$Companion_getInstance().ATTR_FACET_GROUP);
  return link;
};
  function OpdsFeed$Companion() {
    OpdsFeed$Companion_instance = this;
    this.TAG_ID = 'id';
    this.TAG_TITLE = 'title';
    this.TAG_UPDATED = 'updated';
    this.TAG_LINK = 'link';
    this.TAG_ENTRY = 'entry';
  }
  OpdsFeed$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var OpdsFeed$Companion_instance = null;
  function OpdsFeed$Companion_getInstance() {
    if (OpdsFeed$Companion_instance === null) {
      new OpdsFeed$Companion();
    }
    return OpdsFeed$Companion_instance;
  }
  OpdsFeed.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'OpdsFeed', 
  interfaces: []};
  function OpdsLink() {
    OpdsLink$Companion_getInstance();
    this.href_qt0itv$_0 = this.href_qt0itv$_0;
    this.rel_nru1j1$_0 = this.rel_nru1j1$_0;
    this.title = null;
    this.type = null;
    this.activeFacet = null;
    this.facetGroup = null;
    this.thrCount = -1;
  }
  Object.defineProperty(OpdsLink.prototype, 'href', {
  configurable: true, 
  get: function() {
  if (this.href_qt0itv$_0 == null) 
    return throwUPAE('href');
  return this.href_qt0itv$_0;
}, 
  set: function(href) {
  this.href_qt0itv$_0 = href;
}});
  Object.defineProperty(OpdsLink.prototype, 'rel', {
  configurable: true, 
  get: function() {
  if (this.rel_nru1j1$_0 == null) 
    return throwUPAE('rel');
  return this.rel_nru1j1$_0;
}, 
  set: function(rel) {
  this.rel_nru1j1$_0 = rel;
}});
  function OpdsLink$Companion() {
    OpdsLink$Companion_instance = this;
    this.ATTR_REL = 'rel';
    this.ATTR_HREF = 'href';
    this.ATTR_TITLE = 'title';
    this.ATTR_TYPE = 'type';
    this.ATTR_FACET_GROUP = 'opds:facetGroup';
    this.ATTR_THR_COUNT = 'thr:count';
    this.ATTR_FACET_ACTIVE = 'opds:activeFacet';
  }
  OpdsLink$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var OpdsLink$Companion_instance = null;
  function OpdsLink$Companion_getInstance() {
    if (OpdsLink$Companion_instance === null) {
      new OpdsLink$Companion();
    }
    return OpdsLink$Companion_instance;
  }
  OpdsLink.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'OpdsLink', 
  interfaces: []};
  function ScormManifest() {
    ScormManifest$Companion_getInstance();
    this.title = null;
    this.identifier = null;
    this.defaultOrganizationIdentifier_pitp02$_0 = null;
    this.organizationsMap_0 = null;
    this.resourceMap_0 = null;
    this.organizationsMap_0 = HashMap_init();
    this.resourceMap_0 = HashMap_init();
  }
  Object.defineProperty(ScormManifest.prototype, 'defaultOrganizationIdentifier', {
  configurable: true, 
  get: function() {
  return this.defaultOrganizationIdentifier_pitp02$_0;
}, 
  set: function(defaultOrganizationIdentifier) {
  this.defaultOrganizationIdentifier_pitp02$_0 = defaultOrganizationIdentifier;
}});
  Object.defineProperty(ScormManifest.prototype, 'defaultOrganization', {
  configurable: true, 
  get: function() {
  return this.getOrganizationByIdentifier_pdl1vj$(this.defaultOrganizationIdentifier);
}});
  function ScormManifest$Organization() {
    this.identifier_hybvvv$_0 = null;
    this.title_ei1lug$_0 = null;
    this.items_8be2vx$ = ArrayList_init();
  }
  Object.defineProperty(ScormManifest$Organization.prototype, 'identifier', {
  configurable: true, 
  get: function() {
  return this.identifier_hybvvv$_0;
}, 
  set: function(identifier) {
  this.identifier_hybvvv$_0 = identifier;
}});
  Object.defineProperty(ScormManifest$Organization.prototype, 'title', {
  configurable: true, 
  get: function() {
  return this.title_ei1lug$_0;
}, 
  set: function(title) {
  this.title_ei1lug$_0 = title;
}});
  ScormManifest$Organization.prototype.getItems = function() {
  return this.items_8be2vx$;
};
  ScormManifest$Organization.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Organization', 
  interfaces: []};
  function ScormManifest$OrganizationItem() {
    this.title_roo8t1$_0 = null;
    this.identifierRef_10n477$_0 = null;
    this.identifier_xhjvvm$_0 = null;
  }
  Object.defineProperty(ScormManifest$OrganizationItem.prototype, 'title', {
  configurable: true, 
  get: function() {
  return this.title_roo8t1$_0;
}, 
  set: function(title) {
  this.title_roo8t1$_0 = title;
}});
  Object.defineProperty(ScormManifest$OrganizationItem.prototype, 'identifierRef', {
  configurable: true, 
  get: function() {
  return this.identifierRef_10n477$_0;
}, 
  set: function(identifierRef) {
  this.identifierRef_10n477$_0 = identifierRef;
}});
  Object.defineProperty(ScormManifest$OrganizationItem.prototype, 'identifier', {
  configurable: true, 
  get: function() {
  return this.identifier_xhjvvm$_0;
}, 
  set: function(identifier) {
  this.identifier_xhjvvm$_0 = identifier;
}});
  ScormManifest$OrganizationItem.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'OrganizationItem', 
  interfaces: []};
  function ScormManifest$Resource() {
    this.identifier_y8pxc6$_0 = null;
    this.iType_8be2vx$ = null;
    this.scormType_k7twkv$_0 = null;
    this.href_3viikc$_0 = null;
  }
  Object.defineProperty(ScormManifest$Resource.prototype, 'identifier', {
  configurable: true, 
  get: function() {
  return this.identifier_y8pxc6$_0;
}, 
  set: function(identifier) {
  this.identifier_y8pxc6$_0 = identifier;
}});
  Object.defineProperty(ScormManifest$Resource.prototype, 'scormType', {
  configurable: true, 
  get: function() {
  return this.scormType_k7twkv$_0;
}, 
  set: function(scormType) {
  this.scormType_k7twkv$_0 = scormType;
}});
  Object.defineProperty(ScormManifest$Resource.prototype, 'href', {
  configurable: true, 
  get: function() {
  return this.href_3viikc$_0;
}, 
  set: function(href) {
  this.href_3viikc$_0 = href;
}});
  ScormManifest$Resource.prototype.getiType = function() {
  return this.iType_8be2vx$;
};
  ScormManifest$Resource.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Resource', 
  interfaces: []};
  function ScormManifest$loadFromXpp$lambda(closure$xpp, closure$evtType) {
    return function() {
  closure$evtType.v = closure$xpp.next();
  return closure$evtType.v;
};
  }
  ScormManifest.prototype.loadFromXpp_gtk95s$ = function(xpp) {
  var tmp$, tmp$_0;
  var evtType = {
  v: null};
  var tagName;
  var currentOrg = null;
  var currentOrgItem = null;
  var currentResource;
  while (ScormManifest$loadFromXpp$lambda(xpp, evtType)() !== 1) {
    switch (evtType.v) {
      case 2:
        tagName = (tmp$ = xpp.getName()) != null ? tmp$ : '';
        if (equals(ScormManifest$Companion_getInstance().TAG_MANIFEST, tagName)) {
          this.identifier = xpp.getAttributeValue_f5e6j7$(null, ScormManifest$Companion_getInstance().ATTR_IDENTIFIER);
        } else if (equals(ScormManifest$Companion_getInstance().TAG_ORGANIZATIONS, tagName)) {
          this.defaultOrganizationIdentifier = xpp.getAttributeValue_f5e6j7$(null, ScormManifest$Companion_getInstance().ATTR_DEFAULT);
        } else if (equals(ScormManifest$Companion_getInstance().TAG_ORGANIZATION, tagName)) {
          currentOrg = new ScormManifest$Organization();
          currentOrg.identifier = xpp.getAttributeValue_f5e6j7$(null, ScormManifest$Companion_getInstance().ATTR_IDENTIFIER);
          var $receiver = this.organizationsMap_0;
          var key = ensureNotNull(currentOrg.identifier);
          var value = currentOrg;
          $receiver.put_xwzc9p$(key, value);
        } else if (currentOrg != null && equals(ScormManifest$Companion_getInstance().TAG_ITEM, tagName)) {
          currentOrgItem = new ScormManifest$OrganizationItem();
          currentOrgItem.identifierRef = xpp.getAttributeValue_f5e6j7$(null, ScormManifest$Companion_getInstance().ATTR_IDENTIFIERREF);
          currentOrgItem.identifier = xpp.getAttributeValue_f5e6j7$(null, ScormManifest$Companion_getInstance().ATTR_IDENTIFIER);
          currentOrg.items_8be2vx$.add_11rb$(currentOrgItem);
        } else if (currentOrgItem != null && equals(ScormManifest$Companion_getInstance().TAG_TITLE, tagName) && xpp.next() === 4) {
          currentOrgItem.title = xpp.getText();
        } else if (currentOrg != null && equals(ScormManifest$Companion_getInstance().TAG_TITLE, tagName) && xpp.next() === 4) {
          currentOrg.title = xpp.getText();
        } else if (equals(ScormManifest$Companion_getInstance().TAG_RESOURCE, tagName)) {
          currentResource = new ScormManifest$Resource();
          currentResource.identifier = xpp.getAttributeValue_f5e6j7$(null, ScormManifest$Companion_getInstance().ATTR_IDENTIFIER);
          currentResource.iType_8be2vx$ = xpp.getAttributeValue_f5e6j7$(null, ScormManifest$Companion_getInstance().ATTR_TYPE);
          currentResource.href = xpp.getAttributeValue_f5e6j7$(null, ScormManifest$Companion_getInstance().ATTR_HREF);
          currentResource.scormType = xpp.getAttributeValue_f5e6j7$(ScormManifest$Companion_getInstance().NS_ADLCP, ScormManifest$Companion_getInstance().ATTR_SCORMTYPE);
          var $receiver_0 = this.resourceMap_0;
          var key_0 = ensureNotNull(currentResource.identifier);
          var value_0 = currentResource;
          $receiver_0.put_xwzc9p$(key_0, value_0);
        }
        break;
      case 3:
        tagName = (tmp$_0 = xpp.getName()) != null ? tmp$_0 : '';
        if (equals(ScormManifest$Companion_getInstance().TAG_ORGANIZATION, tagName)) 
          currentOrg = null;
        else if (equals(ScormManifest$Companion_getInstance().TAG_ITEM, tagName)) 
          currentOrgItem = null;
        else if (equals(ScormManifest$Companion_getInstance().TAG_RESOURCE, tagName)) 
          currentResource = null;
        break;
    }
  }
};
  ScormManifest.prototype.getOrganizationByIdentifier_pdl1vj$ = function(identifier) {
  var $receiver = this.organizationsMap_0;
  var tmp$;
  return ensureNotNull((Kotlin.isType(tmp$ = $receiver, Map) ? tmp$ : throwCCE()).get_11rb$(identifier));
};
  ScormManifest.prototype.getResourceByIdentifier_61zpoe$ = function(identifier) {
  return ensureNotNull(this.resourceMap_0.get_11rb$(identifier));
};
  function ScormManifest$Companion() {
    ScormManifest$Companion_instance = this;
    this.NS_IMS = 'http://www.imsproject.org/xsd/imscp_rootv1p1p2';
    this.NS_ADLCP = 'http://www.adlnet.org/xsd/adlcp_rootv1p2';
    this.ATTR_IDENTIFIER = 'identifier';
    this.ATTR_IDENTIFIERREF = 'identifierref';
    this.ATTR_DEFAULT = 'default';
    this.ATTR_HREF = 'href';
    this.ATTR_TYPE = 'type';
    this.ATTR_SCORMTYPE = 'scormtype';
    this.TAG_MANIFEST = 'manifest';
    this.TAG_ORGANIZATIONS = 'organizations';
    this.TAG_ORGANIZATION = 'organization';
    this.TAG_ITEM = 'item';
    this.TAG_TITLE = 'title';
    this.TAG_RESOURCE = 'resource';
  }
  ScormManifest$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ScormManifest$Companion_instance = null;
  function ScormManifest$Companion_getInstance() {
    if (ScormManifest$Companion_instance === null) {
      new ScormManifest$Companion();
    }
    return ScormManifest$Companion_instance;
  }
  ScormManifest.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ScormManifest', 
  interfaces: []};
  function Actor() {
    this.name = null;
    this.mbox = null;
    this.mbox_sha1sum = null;
    this.openid = null;
    this.objectType = null;
    this.members = null;
    this.account = null;
  }
  function Actor$Account($outer) {
    this.$outer = $outer;
    this.name = null;
    this.homePage = null;
  }
  Actor$Account.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Account', 
  interfaces: []};
  Actor.prototype.equals = function(o) {
  var tmp$, tmp$_0;
  if (this === o) 
    return true;
  if (o == null || !((tmp$ = Kotlin.getKClassFromExpression(this)) != null ? tmp$.equals(Kotlin.getKClassFromExpression(o)) : null)) 
    return false;
  var actor = (tmp$_0 = o) == null || Kotlin.isType(tmp$_0, Actor) ? tmp$_0 : throwCCE();
  if (this.name != null ? !equals(this.name, ensureNotNull(actor).name) : ensureNotNull(actor).name != null) 
    return false;
  if (this.mbox != null ? !equals(this.mbox, actor.mbox) : actor.mbox != null) 
    return false;
  if (this.mbox_sha1sum != null ? !equals(this.mbox_sha1sum, actor.mbox_sha1sum) : actor.mbox_sha1sum != null) 
    return false;
  if (this.openid != null ? !equals(this.openid, actor.openid) : actor.openid != null) 
    return false;
  if (this.objectType != null ? !equals(this.objectType, actor.objectType) : actor.objectType != null) 
    return false;
  if (this.members != null ? !equals(this.members, actor.members) : actor.members != null) 
    return false;
  return this.account != null ? equals(this.account, actor.account) : actor.account == null;
};
  Actor.prototype.hashCode = function() {
  var result = this.name != null ? hashCode(ensureNotNull(this.name)) : 0;
  result = (31 * result | 0) + (this.mbox != null ? hashCode(ensureNotNull(this.mbox)) : 0) | 0;
  result = (31 * result | 0) + (this.mbox_sha1sum != null ? hashCode(ensureNotNull(this.mbox_sha1sum)) : 0) | 0;
  result = (31 * result | 0) + (this.openid != null ? hashCode(ensureNotNull(this.openid)) : 0) | 0;
  result = (31 * result | 0) + (this.objectType != null ? hashCode(ensureNotNull(this.objectType)) : 0) | 0;
  result = (31 * result | 0) + (this.members != null ? hashCode(ensureNotNull(this.members)) : 0) | 0;
  result = (31 * result | 0) + (this.account != null ? hashCode(ensureNotNull(this.account)) : 0) | 0;
  return result;
};
  Actor.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Actor', 
  interfaces: []};
  function Attachment() {
    this.usageType = null;
    this.display = null;
    this.description = null;
    this.contentType = null;
    this.length = L0;
    this.sha2 = null;
  }
  Attachment.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Attachment', 
  interfaces: []};
  function ContextActivity() {
    this.parent = null;
    this.grouping = null;
    this.category = null;
    this.other = null;
  }
  ContextActivity.prototype.equals = function(o) {
  var tmp$, tmp$_0;
  if (this === o) 
    return true;
  if (o == null || !((tmp$ = Kotlin.getKClassFromExpression(this)) != null ? tmp$.equals(Kotlin.getKClassFromExpression(o)) : null)) 
    return false;
  var that = (tmp$_0 = o) == null || Kotlin.isType(tmp$_0, ContextActivity) ? tmp$_0 : throwCCE();
  if (this.parent != null ? !equals(this.parent, ensureNotNull(that).parent) : ensureNotNull(that).parent != null) 
    return false;
  if (this.grouping != null ? !equals(this.grouping, that.grouping) : that.grouping != null) 
    return false;
  if (this.category != null ? !equals(this.category, that.category) : that.category != null) 
    return false;
  return this.other != null ? equals(this.other, that.other) : that.other == null;
};
  ContextActivity.prototype.hashCode = function() {
  var result = this.parent != null ? hashCode(ensureNotNull(this.parent)) : 0;
  result = (31 * result | 0) + (this.grouping != null ? hashCode(ensureNotNull(this.grouping)) : 0) | 0;
  result = (31 * result | 0) + (this.category != null ? hashCode(ensureNotNull(this.category)) : 0) | 0;
  result = (31 * result | 0) + (this.other != null ? hashCode(ensureNotNull(this.other)) : 0) | 0;
  return result;
};
  ContextActivity.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContextActivity', 
  interfaces: []};
  function Definition() {
    this.name = null;
    this.description = null;
    this.type = null;
    this.extensions = null;
    this.moreInfo = null;
    this.interactionType = null;
    this.correctResponsePattern = null;
    this.choices = null;
    this.scale = null;
    this.source = null;
    this.target = null;
    this.steps = null;
  }
  function Definition$Interaction($outer) {
    this.$outer = $outer;
    this.id = null;
    this.description = null;
  }
  Definition$Interaction.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Interaction', 
  interfaces: []};
  Definition.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Definition', 
  interfaces: []};
  function Result() {
    this.completion = false;
    this.success = null;
    this.score = null;
    this.duration = null;
    this.response = null;
    this.extensions = null;
  }
  function Result$Score($outer) {
    this.$outer = $outer;
    this.scaled = 0.0;
    this.raw = L0;
    this.min = L0;
    this.max = L0;
  }
  Result$Score.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Score', 
  interfaces: []};
  Result.prototype.equals = function(o) {
  var tmp$, tmp$_0;
  if (this === o) 
    return true;
  if (o == null || !((tmp$ = Kotlin.getKClassFromExpression(this)) != null ? tmp$.equals(Kotlin.getKClassFromExpression(o)) : null)) 
    return false;
  var result = (tmp$_0 = o) == null || Kotlin.isType(tmp$_0, Result) ? tmp$_0 : throwCCE();
  if (this.completion !== ensureNotNull(result).completion) 
    return false;
  if (this.success != result.success) 
    return false;
  if (this.score != null ? !equals(this.score, result.score) : result.score != null) 
    return false;
  if (this.duration != null ? !equals(this.duration, result.duration) : result.duration != null) 
    return false;
  if (this.response != null ? !equals(this.response, result.response) : result.response != null) 
    return false;
  return this.extensions != null ? equals(this.extensions, result.extensions) : result.extensions == null;
};
  Result.prototype.hashCode = function() {
  var result = this.completion ? 1 : 0;
  result = (31 * result | 0) + (this.success != null ? hashCode(ensureNotNull(this.success)) : 0) | 0;
  result = (31 * result | 0) + (this.score != null ? hashCode(ensureNotNull(this.score)) : 0) | 0;
  result = (31 * result | 0) + (this.duration != null ? hashCode(ensureNotNull(this.duration)) : 0) | 0;
  result = (31 * result | 0) + (this.response != null ? hashCode(ensureNotNull(this.response)) : 0) | 0;
  result = (31 * result | 0) + (this.extensions != null ? hashCode(ensureNotNull(this.extensions)) : 0) | 0;
  return result;
};
  Result.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Result', 
  interfaces: []};
  function State(stateId, agent, activityId, content, registration) {
    this.stateId = stateId;
    this.agent = agent;
    this.activityId = activityId;
    this.content = content;
    this.registration = registration;
  }
  State.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'State', 
  interfaces: []};
  function Statement() {
    this.actor = null;
    this.verb = null;
    this.object = null;
    this.subStatement = null;
    this.result = null;
    this.context = null;
    this.timestamp = null;
    this.stored = null;
    this.authority = null;
    this.version = null;
    this.id = null;
    this.attachments = null;
    this.objectType = null;
  }
  Statement.prototype.equals = function(o) {
  var tmp$, tmp$_0;
  if (this === o) 
    return true;
  if (o == null || !((tmp$ = Kotlin.getKClassFromExpression(this)) != null ? tmp$.equals(Kotlin.getKClassFromExpression(o)) : null)) 
    return false;
  var statement = (tmp$_0 = o) == null || Kotlin.isType(tmp$_0, Statement) ? tmp$_0 : throwCCE();
  if (this.actor != null ? !equals(this.actor, ensureNotNull(statement).actor) : ensureNotNull(statement).actor != null) 
    return false;
  if (this.verb != null ? !equals(this.verb, statement.verb) : statement.verb != null) 
    return false;
  if (this.object != null ? !equals(this.object, statement.object) : statement.object != null) 
    return false;
  if (this.subStatement != null ? !equals(this.subStatement, statement.subStatement) : statement.subStatement != null) 
    return false;
  if (this.result != null ? !equals(this.result, statement.result) : statement.result != null) 
    return false;
  if (this.context != null ? !equals(this.context, statement.context) : statement.context != null) 
    return false;
  if (this.authority != null ? !equals(this.authority, statement.authority) : statement.authority != null) 
    return false;
  return this.objectType != null ? equals(this.objectType, statement.objectType) : statement.objectType == null;
};
  Statement.prototype.hashCode = function() {
  var result1 = this.actor != null ? ensureNotNull(this.actor).hashCode() : 0;
  result1 = (31 * result1 | 0) + (this.verb != null ? ensureNotNull(this.verb).hashCode() : 0) | 0;
  result1 = (31 * result1 | 0) + (this.object != null ? ensureNotNull(this.object).hashCode() : 0) | 0;
  result1 = (31 * result1 | 0) + (this.subStatement != null ? ensureNotNull(this.subStatement).hashCode() : 0) | 0;
  result1 = (31 * result1 | 0) + (this.result != null ? ensureNotNull(this.result).hashCode() : 0) | 0;
  result1 = (31 * result1 | 0) + (this.context != null ? ensureNotNull(this.context).hashCode() : 0) | 0;
  result1 = (31 * result1 | 0) + (this.authority != null ? ensureNotNull(this.authority).hashCode() : 0) | 0;
  result1 = (31 * result1 | 0) + (this.objectType != null ? hashCode(ensureNotNull(this.objectType)) : 0) | 0;
  return result1;
};
  Statement.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Statement', 
  interfaces: []};
  function Verb() {
    this.id = null;
    this.display = null;
  }
  Verb.prototype.equals = function(other) {
  var tmp$, tmp$_0;
  if (this === other) 
    return true;
  if (other == null || !((tmp$ = Kotlin.getKClassFromExpression(this)) != null ? tmp$.equals(Kotlin.getKClassFromExpression(other)) : null)) 
    return false;
    Kotlin.isType(tmp$_0 = other, Verb) ? tmp$_0 : throwCCE();
  if (!equals(this.id, other.id)) 
    return false;
  if (!equals(this.display, other.display)) 
    return false;
  return true;
};
  Verb.prototype.hashCode = function() {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  var result = (tmp$_0 = (tmp$ = this.id) != null ? hashCode(tmp$) : null) != null ? tmp$_0 : 0;
  result = (31 * result | 0) + ((tmp$_2 = (tmp$_1 = this.display) != null ? hashCode(tmp$_1) : null) != null ? tmp$_2 : 0) | 0;
  return result;
};
  Verb.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Verb', 
  interfaces: []};
  function XContext() {
    this.instructor = null;
    this.registration = null;
    this.language = null;
    this.platform = null;
    this.revision = null;
    this.team = null;
    this.statement = null;
    this.contextActivities = null;
    this.extensions = null;
  }
  XContext.prototype.equals = function(o) {
  var tmp$, tmp$_0;
  if (this === o) 
    return true;
  if (o == null || !((tmp$ = Kotlin.getKClassFromExpression(this)) != null ? tmp$.equals(Kotlin.getKClassFromExpression(o)) : null)) 
    return false;
  var xContext = (tmp$_0 = o) == null || Kotlin.isType(tmp$_0, XContext) ? tmp$_0 : throwCCE();
  if (this.instructor != null ? !equals(this.instructor, ensureNotNull(xContext).instructor) : ensureNotNull(xContext).instructor != null) 
    return false;
  if (this.registration != null ? !equals(this.registration, xContext.registration) : xContext.registration != null) 
    return false;
  if (this.language != null ? !equals(this.language, xContext.language) : xContext.language != null) 
    return false;
  if (this.platform != null ? !equals(this.platform, xContext.platform) : xContext.platform != null) 
    return false;
  if (this.revision != null ? !equals(this.revision, xContext.revision) : xContext.revision != null) 
    return false;
  if (this.team != null ? !equals(this.team, xContext.team) : xContext.team != null) 
    return false;
  if (this.statement != null ? !equals(this.statement, xContext.statement) : xContext.statement != null) 
    return false;
  if (this.contextActivities != null ? !equals(this.contextActivities, xContext.contextActivities) : xContext.contextActivities != null) 
    return false;
  return this.extensions != null ? equals(this.extensions, xContext.extensions) : xContext.extensions == null;
};
  XContext.prototype.hashCode = function() {
  var result = this.instructor != null ? ensureNotNull(this.instructor).hashCode() : 0;
  result = (31 * result | 0) + (this.registration != null ? hashCode(ensureNotNull(this.registration)) : 0) | 0;
  result = (31 * result | 0) + (this.language != null ? hashCode(ensureNotNull(this.language)) : 0) | 0;
  result = (31 * result | 0) + (this.platform != null ? hashCode(ensureNotNull(this.platform)) : 0) | 0;
  result = (31 * result | 0) + (this.revision != null ? hashCode(ensureNotNull(this.revision)) : 0) | 0;
  result = (31 * result | 0) + (this.team != null ? ensureNotNull(this.team).hashCode() : 0) | 0;
  result = (31 * result | 0) + (this.statement != null ? ensureNotNull(this.statement).hashCode() : 0) | 0;
  result = (31 * result | 0) + (this.contextActivities != null ? ensureNotNull(this.contextActivities).hashCode() : 0) | 0;
  result = (31 * result | 0) + (this.extensions != null ? hashCode(ensureNotNull(this.extensions)) : 0) | 0;
  return result;
};
  XContext.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'XContext', 
  interfaces: []};
  function XObject() {
    this.id = null;
    this.definition = null;
    this.objectType = null;
    this.statementRefUid = L0;
  }
  XObject.prototype.equals = function(other) {
  var tmp$, tmp$_0;
  if (this === other) 
    return true;
  if (other == null || !((tmp$ = Kotlin.getKClassFromExpression(this)) != null ? tmp$.equals(Kotlin.getKClassFromExpression(other)) : null)) 
    return false;
    Kotlin.isType(tmp$_0 = other, XObject) ? tmp$_0 : throwCCE();
  if (!equals(this.id, other.id)) 
    return false;
  if (!equals(this.objectType, other.objectType)) 
    return false;
  if (!equals(this.statementRefUid, other.statementRefUid)) 
    return false;
  return true;
};
  XObject.prototype.hashCode = function() {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  var result = (tmp$_0 = (tmp$ = this.id) != null ? hashCode(tmp$) : null) != null ? tmp$_0 : 0;
  result = (31 * result | 0) + ((tmp$_2 = (tmp$_1 = this.objectType) != null ? hashCode(tmp$_1) : null) != null ? tmp$_2 : 0) | 0;
  result = (31 * result | 0) + hashCode(this.statementRefUid) | 0;
  return result;
};
  XObject.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'XObject', 
  interfaces: []};
  function XapiStateEndpoint() {
  }
  XapiStateEndpoint.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'XapiStateEndpoint', 
  interfaces: [DIAware]};
  function XapiStatementEndpoint() {
  }
  XapiStatementEndpoint.prototype.storeStatements_208yqg$ = function(statements, statementId, contentEntryUid, clazzUid, callback$default) {
  if (contentEntryUid === void 0) 
    contentEntryUid = L0;
  if (clazzUid === void 0) 
    clazzUid = L0;
  return callback$default ? callback$default(statements, statementId, contentEntryUid, clazzUid) : this.storeStatements_208yqg$$default(statements, statementId, contentEntryUid, clazzUid);
};
  XapiStatementEndpoint.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'XapiStatementEndpoint', 
  interfaces: [DIAware]};
  function storeProgressStatement($receiver, account, entry, progress, duration, contextRegistration, clazzUid) {
    var $receiver_0 = new Statement();
    var $receiver_1 = new Actor();
    var $receiver_2 = new Actor$Account($receiver_1);
    var tmp$;
    $receiver_2.homePage = account.endpointUrl;
    $receiver_2.name = (tmp$ = account.username) != null ? tmp$ : 'guest';
    $receiver_1.account = $receiver_2;
    $receiver_0.actor = $receiver_1;
    var $receiver_3 = new Verb();
    $receiver_3.id = progress === 100 ? 'https://w3id.org/xapi/adl/verbs/satisfied' : 'http://adlnet.gov/expapi/verbs/progressed';
    $receiver_3.display = mapOf_0(to('en-US', progress === 100 ? 'satisfied' : 'progressed'));
    $receiver_0.verb = $receiver_3;
    var $receiver_4 = new XContext();
    $receiver_4.registration = contextRegistration;
    $receiver_0.context = $receiver_4;
    var $receiver_5 = new Result();
    $receiver_5.completion = progress === 100;
    $receiver_5.duration = UMTinCanUtil_getInstance().format8601Duration_s8cxhz$(duration);
    $receiver_5.extensions = mapOf_0(to('https://w3id.org/xapi/cmi5/result/extensions/progress', progress));
    $receiver_0.result = $receiver_5;
    var $receiver_6 = new XObject();
    var tmp$_0;
    $receiver_6.id = (tmp$_0 = entry.entryId) != null ? tmp$_0 : UMFileUtil_getInstance().joinPaths_vqirvp$([account.endpointUrl, '/contentEntryUid/' + entry.contentEntryUid.toString()]);
    $receiver_6.objectType = 'Activity';
    var $receiver_7 = new Definition();
    var tmp$_1, tmp$_2;
    $receiver_7.name = mapOf_0(to('en-US', (tmp$_1 = entry.title) != null ? tmp$_1 : ''));
    $receiver_7.description = mapOf_0(to('en-US', (tmp$_2 = entry.description) != null ? tmp$_2 : ''));
    $receiver_6.definition = $receiver_7;
    $receiver_0.object = $receiver_6;
    var statement = $receiver_0;
    $receiver.storeStatements_208yqg$(listOf_0(statement), '', entry.contentEntryUid, clazzUid);
  }
  function storeCompletedStatement($receiver, account, entry, contextRegistration, scoreProgress, clazzUid) {
    var $receiver_0 = new Statement();
    var $receiver_1 = new Actor();
    var $receiver_2 = new Actor$Account($receiver_1);
    $receiver_2.homePage = account.endpointUrl;
    $receiver_2.name = account.username;
    $receiver_1.account = $receiver_2;
    $receiver_0.actor = $receiver_1;
    var $receiver_3 = new Verb();
    $receiver_3.id = 'http://adlnet.gov/expapi/verbs/completed';
    $receiver_3.display = mapOf_0(to('en-US', 'completed'));
    $receiver_0.verb = $receiver_3;
    var $receiver_4 = new XContext();
    $receiver_4.registration = contextRegistration;
    $receiver_0.context = $receiver_4;
    var $receiver_5 = new Result();
    $receiver_5.completion = true;
    $receiver_5.extensions = mapOf_0(to('https://w3id.org/xapi/cmi5/result/extensions/progress', 100));
    if (scoreProgress != null) {
      $receiver_5.success = true;
      var $receiver_6 = new Result$Score($receiver_5);
      $receiver_6.raw = Kotlin.Long.fromInt(scoreProgress.resultScore);
      $receiver_6.max = Kotlin.Long.fromInt(scoreProgress.resultMax);
      $receiver_6.scaled = scoreProgress.resultScaled;
      $receiver_5.score = $receiver_6;
    }
    $receiver_0.result = $receiver_5;
    var $receiver_7 = new XObject();
    var tmp$;
    $receiver_7.id = (tmp$ = entry.entryId) != null ? tmp$ : UMFileUtil_getInstance().joinPaths_vqirvp$([account.endpointUrl, '/contentEntryUid/' + entry.contentEntryUid.toString()]);
    $receiver_7.objectType = 'Activity';
    var $receiver_8 = new Definition();
    var tmp$_0, tmp$_1;
    $receiver_8.name = mapOf_0(to('en-US', (tmp$_0 = entry.title) != null ? tmp$_0 : ''));
    $receiver_8.description = mapOf_0(to('en-US', (tmp$_1 = entry.description) != null ? tmp$_1 : ''));
    $receiver_7.definition = $receiver_8;
    $receiver_0.object = $receiver_7;
    var statement = $receiver_0;
    $receiver.storeStatements_208yqg$(listOf_0(statement), '', entry.contentEntryUid, clazzUid);
  }
  function storeSubmitSubmissionStatement($receiver, account, contextRegistration, assignment) {
    var $receiver_0 = new Statement();
    var $receiver_1 = new Actor();
    var $receiver_2 = new Actor$Account($receiver_1);
    $receiver_2.homePage = account.endpointUrl;
    $receiver_2.name = account.username;
    $receiver_1.account = $receiver_2;
    $receiver_0.actor = $receiver_1;
    var $receiver_3 = new Verb();
    $receiver_3.id = VerbEntity.Companion.VERB_SUBMITTED_URL;
    $receiver_3.display = mapOf_0(to('en-US', 'submitted'));
    $receiver_0.verb = $receiver_3;
    var $receiver_4 = new XContext();
    $receiver_4.registration = contextRegistration;
    $receiver_0.context = $receiver_4;
    var $receiver_5 = new Result();
    $receiver_5.completion = false;
    $receiver_5.success = false;
    $receiver_0.result = $receiver_5;
    var $receiver_6 = new XObject();
    $receiver_6.id = UMFileUtil_getInstance().joinPaths_vqirvp$([account.endpointUrl, '/clazzAssignment/' + assignment.caUid.toString()]);
    $receiver_6.objectType = 'Activity';
    var $receiver_7 = new Definition();
    var tmp$, tmp$_0;
    $receiver_7.name = mapOf_0(to('en-US', (tmp$ = assignment.caTitle) != null ? tmp$ : ''));
    $receiver_7.description = mapOf_0(to('en-US', (tmp$_0 = assignment.caDescription) != null ? tmp$_0 : ''));
    $receiver_6.definition = $receiver_7;
    $receiver_0.object = $receiver_6;
    var statement = $receiver_0;
    $receiver.storeStatements_208yqg$(listOf_0(statement), '', L0, assignment.caClazzUid);
  }
  function storeMarkedStatement($receiver, account, student, contextRegistration, grade, assignment, studentSubmitStatement) {
    var $receiver_0 = new Statement();
    var $receiver_1 = new Actor();
    var $receiver_2 = new Actor$Account($receiver_1);
    $receiver_2.homePage = account.endpointUrl;
    $receiver_2.name = student.username;
    $receiver_1.account = $receiver_2;
    $receiver_0.actor = $receiver_1;
    var $receiver_3 = new Verb();
    $receiver_3.id = VerbEntity.Companion.VERB_SCORED_URL;
    $receiver_3.display = mapOf_0(to('en-US', 'scored'));
    $receiver_0.verb = $receiver_3;
    var $receiver_4 = new XContext();
    $receiver_4.registration = contextRegistration;
    var $receiver_5 = new Actor();
    var $receiver_6 = new Actor$Account($receiver_5);
    $receiver_6.homePage = account.endpointUrl;
    $receiver_6.name = account.username;
    $receiver_5.account = $receiver_6;
    $receiver_4.instructor = $receiver_5;
    $receiver_0.context = $receiver_4;
    var $receiver_7 = new Result();
    $receiver_7.completion = true;
    $receiver_7.extensions = mapOf_0(to('https://w3id.org/xapi/cmi5/result/extensions/progress', 100));
    $receiver_7.success = true;
    var $receiver_8 = new Result$Score($receiver_7);
    var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
    $receiver_8.raw = Kotlin.Long.fromInt(grade);
    $receiver_8.max = (tmp$_1 = (tmp$_0 = (tmp$ = assignment.block) != null ? tmp$.cbMaxPoints : null) != null ? Kotlin.Long.fromInt(tmp$_0) : null) != null ? tmp$_1 : L0;
    $receiver_8.scaled = grade / ((tmp$_3 = (tmp$_2 = assignment.block) != null ? tmp$_2.cbMaxPoints : null) != null ? tmp$_3 : 1);
    $receiver_7.score = $receiver_8;
    $receiver_0.result = $receiver_7;
    var $receiver_9 = new XObject();
    var tmp$_4;
    $receiver_9.id = studentSubmitStatement != null ? studentSubmitStatement.statementId : null;
    $receiver_9.objectType = 'StatementRef';
    $receiver_9.statementRefUid = (tmp$_4 = studentSubmitStatement != null ? studentSubmitStatement.statementUid : null) != null ? tmp$_4 : L0;
    $receiver_0.object = $receiver_9;
    var statement = $receiver_0;
    $receiver.storeStatements_208yqg$(listOf_0(statement), '', L0, assignment.caClazzUid);
  }
  function ConnectivityCancellationException(connectivityMessage) {
    CancellationException_init(connectivityMessage, this);
    this.connectivityMessage = connectivityMessage;
    this.name = 'ConnectivityCancellationException';
  }
  ConnectivityCancellationException.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ConnectivityCancellationException', 
  interfaces: [CancellationException]};
  function ContentJobItemTransactionRunner() {
  }
  ContentJobItemTransactionRunner.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContentJobItemTransactionRunner', 
  interfaces: []};
  function ContentJobManager() {
    ContentJobManager$Companion_getInstance();
  }
  function ContentJobManager$Companion() {
    ContentJobManager$Companion_instance = this;
    this.KEY_ENDPOINT = 'endpoint';
    this.KEY_CONTENTJOB_UID = 'cjUid';
  }
  ContentJobManager$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ContentJobManager$Companion_instance = null;
  function ContentJobManager$Companion_getInstance() {
    if (ContentJobManager$Companion_instance === null) {
      new ContentJobManager$Companion();
    }
    return ContentJobManager$Companion_instance;
  }
  ContentJobManager.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContentJobManager', 
  interfaces: []};
  function ContentJobProcessContext(srcUri, tempDirUri, params, transactionRunner, di) {
    this.srcUri_0 = srcUri;
    this.tempDirUri = tempDirUri;
    this.params = params;
    this.transactionRunner_0 = transactionRunner;
    this.di_bu7bhi$_0 = di;
    this.downloadLock_xutyqg$_0 = lazy(ContentJobProcessContext$downloadLock$lambda);
    this.downloadedTmpUri_0 = null;
  }
  Object.defineProperty(ContentJobProcessContext.prototype, 'di', {
  get: function() {
  return this.di_bu7bhi$_0;
}});
  Object.defineProperty(ContentJobProcessContext.prototype, 'downloadLock_0', {
  configurable: true, 
  get: function() {
  return this.downloadLock_xutyqg$_0.value;
}});
  function Coroutine$use_eezzmt$($this, block_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 6;
    this.$this = $this;
    this.local$tmp$ = void 0;
    this.local$block = block_0;
  }
  Coroutine$use_eezzmt$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$use_eezzmt$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$use_eezzmt$.prototype.constructor = Coroutine$use_eezzmt$;
  Coroutine$use_eezzmt$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.exceptionState_0 = 3;
        this.state_0 = 1;
        this.result_0 = this.local$block(this.$this, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        this.local$tmp$ = this.result_0;
        this.exceptionState_0 = 6;
        this.finallyPath_0 = [2];
        this.state_0 = 4;
        continue;
      case 2:
        return this.local$tmp$;
      case 3:
        this.finallyPath_0 = [6];
        this.state_0 = 4;
        continue;
      case 4:
        this.exceptionState_0 = 6;
        this.state_0 = 5;
        this.result_0 = emptyRecursively(this.$this.tempDirUri, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 6:
        throw this.exception_0;
      default:
        this.state_0 = 6;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 6) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  ContentJobProcessContext.prototype.use_eezzmt$ = function(block_0, continuation_0, suspended) {
  var instance = new Coroutine$use_eezzmt$(this, block_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$withContentJobItemTransactionMutex_fk0axj$($this, block_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$block = block_0;
  }
  Coroutine$withContentJobItemTransactionMutex_fk0axj$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$withContentJobItemTransactionMutex_fk0axj$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$withContentJobItemTransactionMutex_fk0axj$.prototype.constructor = Coroutine$withContentJobItemTransactionMutex_fk0axj$;
  Coroutine$withContentJobItemTransactionMutex_fk0axj$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if ((tmp$ = this.$this.transactionRunner_0) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$.withContentJobItemTransaction_fk0axj$(this.local$block, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        continue;
      case 3:
        tmp$_0 = this.result_0;
        if (tmp$_0 == null) {
          throw IllegalStateException_init('withContentJobItemTransaction requires contentJobItemRunner');
        }
        return tmp$_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);
};
  ContentJobProcessContext.prototype.withContentJobItemTransactionMutex_fk0axj$ = function(block_0, continuation_0, suspended) {
  var instance = new Coroutine$withContentJobItemTransactionMutex_fk0axj$(this, block_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$getLocalOrCachedUri($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 10;
    this.$this = $this;
    this.local$$receiver = void 0;
    this.local$downloadDestUri = void 0;
  }
  Coroutine$getLocalOrCachedUri.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$getLocalOrCachedUri.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$getLocalOrCachedUri.prototype.constructor = Coroutine$getLocalOrCachedUri;
  Coroutine$getLocalOrCachedUri.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 1;
        this.result_0 = isRemote(this.$this.srcUri_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        if (!this.result_0) {
          return this.$this.srcUri_0;
        } else {
          this.state_0 = 2;
          continue;
        }
      case 2:
        this.local$$receiver = this.$this.downloadLock_0;
        this.state_0 = 3;
        this.result_0 = this.local$$receiver.lock_s8jyv4$(null, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.exceptionState_0 = 4;
        var downloadedTmpUriVal = this.$this.downloadedTmpUri_0;
        if (downloadedTmpUriVal != null) {
          this.exceptionState_0 = 10;
          this.finallyPath_0 = [5];
          this.state_0 = 9;
          this.$returnValue = downloadedTmpUriVal;
          continue;
        } else {
          this.state_0 = 6;
          continue;
        }
      case 4:
        this.finallyPath_0 = [10];
        this.state_0 = 9;
        continue;
      case 5:
        return this.$returnValue;
      case 6:
        this.local$downloadDestUri = DoorUri.Companion.parse_61zpoe$(UMFileUtil_getInstance().joinPaths_vqirvp$([this.$this.tempDirUri.toString(), 'tempFile']));
        this.state_0 = 7;
        this.result_0 = downloadUrlIfRemote(this.$this.srcUri_0, this.local$downloadDestUri, this.$this.di, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 7:
        this.$this.downloadedTmpUri_0 = this.local$downloadDestUri;
        this.exceptionState_0 = 10;
        this.finallyPath_0 = [8];
        this.state_0 = 9;
        this.$returnValue = this.local$downloadDestUri;
        continue;
      case 8:
        return this.$returnValue;
      case 9:
        this.exceptionState_0 = 10;
        this.local$$receiver.unlock_s8jyv4$(null);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 10:
        throw this.exception_0;
      case 11:
        return;
      default:
        this.state_0 = 10;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 10) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  ContentJobProcessContext.prototype.getLocalOrCachedUri = function(continuation_0, suspended) {
  var instance = new Coroutine$getLocalOrCachedUri(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function ContentJobProcessContext$downloadLock$lambda() {
    return Mutex();
  }
  ContentJobProcessContext.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContentJobProcessContext', 
  interfaces: [DIAware]};
  function ContentJobProgressListener(f) {
    this.function$ = f;
  }
  ContentJobProgressListener.prototype.onProgress_letzpf$ = function(contentJobItem) {
  return this.function$(contentJobItem);
};
  ContentJobProgressListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContentJobProgressListener', 
  interfaces: []};
  function ContentJobRunner(jobId, endpoint, di, numProcessors, maxItemAttempts) {
    ContentJobRunner$Companion_getInstance();
    if (numProcessors === void 0) 
      numProcessors = 10;
    if (maxItemAttempts === void 0) 
      maxItemAttempts = 5;
    this.jobId = jobId;
    this.endpoint = endpoint;
    this.di_iydpuy$_0 = di;
    this.numProcessors = numProcessors;
    this.maxItemAttempts = maxItemAttempts;
    this.checkQueueSignalChannel_0 = Channel(2147483647);
    this.activeJobItemIds_0 = concurrentSafeListOf([]);
    var context = this.endpoint;
    var trigger;
    trigger = this.diTrigger;
    var tmp$;
    var tmp$_0;
    this.db_iydq0z$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$ : throwCCE(), context), trigger), Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_0 : throwCCE(), 1).provideDelegate_tpuvb9$(this, ContentJobRunner$db_metadata);
    var context_0 = this.endpoint;
    var trigger_0;
    trigger_0 = this.diTrigger;
    var tmp$_1;
    var tmp$_2;
    this.contentPluginManager_6pdfmu$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$_1 : throwCCE(), context_0), trigger_0), Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(ContentPluginManager), [], false)), TypeToken) ? tmp$_2 : throwCCE(), null).provideDelegate_tpuvb9$(this, ContentJobRunner$contentPluginManager_metadata);
    this.eventCollator_0 = new EventCollator(L500, getCallableRef('commitProgressUpdates', function($receiver, p1, continuation) {
  return $receiver.commitProgressUpdates_0(p1, continuation);
}.bind(null, this)));
    var context_1 = this.endpoint;
    var trigger_1;
    trigger_1 = this.diTrigger;
    var tmp$_3;
    var tmp$_4;
    this.connectivityLiveData_rtid1q$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$_3 : throwCCE(), context_1), trigger_1), Kotlin.isType(tmp$_4 = typeToken(createKType(getKClass(ConnectivityLiveData), [], false)), TypeToken) ? tmp$_4 : throwCCE(), null).provideDelegate_tpuvb9$(this, ContentJobRunner$connectivityLiveData_metadata);
    this.contentJobItemUpdateMutex_0 = Mutex();
    var tmp$_5;
    this.json_vruxyl$_0 = Instance(this, Kotlin.isType(tmp$_5 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_5 : throwCCE(), null).provideDelegate_tpuvb9$(this, ContentJobRunner$json_metadata);
    var context_2 = this.endpoint;
    var trigger_2;
    trigger_2 = this.diTrigger;
    var tmp$_6;
    var tmp$_7;
    this.containerStorageManager_lnbe8q$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_6 = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$_6 : throwCCE(), context_2), trigger_2), Kotlin.isType(tmp$_7 = typeToken(createKType(getKClass(ContainerStorageManager), [], false)), TypeToken) ? tmp$_7 : throwCCE(), null).provideDelegate_tpuvb9$(this, ContentJobRunner$containerStorageManager_metadata);
    this.jobConnectivityLiveData_0 = new JobConnectivityLiveData(this.connectivityLiveData_0, this.db_0.contentJobDao.findMeteredAllowedLiveData_s8cxhz$(this.jobId));
    this.jobItemProducer_0 = null;
  }
  Object.defineProperty(ContentJobRunner.prototype, 'di', {
  get: function() {
  return this.di_iydpuy$_0;
}});
  function ContentJobRunner$ContentJobResult(status) {
    this.status = status;
  }
  ContentJobRunner$ContentJobResult.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContentJobResult', 
  interfaces: []};
  ContentJobRunner$ContentJobResult.prototype.component1 = function() {
  return this.status;
};
  ContentJobRunner$ContentJobResult.prototype.copy_za3lpa$ = function(status) {
  return new ContentJobRunner$ContentJobResult(status === void 0 ? this.status : status);
};
  ContentJobRunner$ContentJobResult.prototype.toString = function() {
  return 'ContentJobResult(status=' + Kotlin.toString(this.status) + ')';
};
  ContentJobRunner$ContentJobResult.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.status) | 0;
  return result;
};
  ContentJobRunner$ContentJobResult.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && Kotlin.equals(this.status, other.status))));
};
  var ContentJobRunner$db_metadata = new PropertyMetadata('db');
  Object.defineProperty(ContentJobRunner.prototype, 'db_0', {
  configurable: true, 
  get: function() {
  return this.db_iydq0z$_0.value;
}});
  var ContentJobRunner$contentPluginManager_metadata = new PropertyMetadata('contentPluginManager');
  Object.defineProperty(ContentJobRunner.prototype, 'contentPluginManager_0', {
  configurable: true, 
  get: function() {
  return this.contentPluginManager_6pdfmu$_0.value;
}});
  var ContentJobRunner$connectivityLiveData_metadata = new PropertyMetadata('connectivityLiveData');
  Object.defineProperty(ContentJobRunner.prototype, 'connectivityLiveData_0', {
  configurable: true, 
  get: function() {
  return this.connectivityLiveData_rtid1q$_0.value;
}});
  Object.defineProperty(ContentJobRunner.prototype, 'logPrefix_0', {
  configurable: true, 
  get: function() {
  return 'ContentJobRunner@' + get_doorIdentityHashCode(this) + ' Job#' + this.jobId.toString() + ' :';
}});
  var ContentJobRunner$json_metadata = new PropertyMetadata('json');
  Object.defineProperty(ContentJobRunner.prototype, 'json_0', {
  configurable: true, 
  get: function() {
  return this.json_vruxyl$_0.value;
}});
  var ContentJobRunner$containerStorageManager_metadata = new PropertyMetadata('containerStorageManager');
  Object.defineProperty(ContentJobRunner.prototype, 'containerStorageManager_0', {
  configurable: true, 
  get: function() {
  return this.containerStorageManager_lnbe8q$_0.value;
}});
  function Coroutine$ContentJobRunner$produceJobs$lambda$lambda(this$ContentJobRunner_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ContentJobRunner = this$ContentJobRunner_0;
  }
  Coroutine$ContentJobRunner$produceJobs$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$produceJobs$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$produceJobs$lambda$lambda.prototype.constructor = Coroutine$ContentJobRunner$produceJobs$lambda$lambda;
  Coroutine$ContentJobRunner$produceJobs$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        return this.local$this$ContentJobRunner.jobConnectivityLiveData_0.observeForever_jsfaok$(this.local$this$ContentJobRunner) , Unit;
      case 1:
        throw this.exception_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 ContentJobRunner$produceJobs$lambda$lambda(this$ContentJobRunner_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$produceJobs$lambda$lambda(this$ContentJobRunner_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentJobRunner$produceJobs$lambda$lambda_0(closure$numProcessorsAvailable_0, this$ContentJobRunner_0, closure$queueItemsToSend_0, closure$done_0, txDb_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$numProcessorsAvailable = closure$numProcessorsAvailable_0;
    this.local$this$ContentJobRunner = this$ContentJobRunner_0;
    this.local$closure$queueItemsToSend = closure$queueItemsToSend_0;
    this.local$closure$done = closure$done_0;
    this.local$queueItems = void 0;
    this.local$numJobsToAdd = void 0;
    this.local$i = void 0;
    this.local$txDb = txDb_0;
  }
  Coroutine$ContentJobRunner$produceJobs$lambda$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$produceJobs$lambda$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$produceJobs$lambda$lambda_0.prototype.constructor = Coroutine$ContentJobRunner$produceJobs$lambda$lambda_0;
  Coroutine$ContentJobRunner$produceJobs$lambda$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if (this.local$closure$numProcessorsAvailable > 0) {
          this.state_0 = 2;
          this.result_0 = this.local$txDb.contentJobItemDao.findNextItemsInQueue_yhmem3$(this.local$this$ContentJobRunner.jobId, this.local$this$ContentJobRunner.numProcessors * 2 | 0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 7;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        var $receiver = this.result_0;
        var destination = ArrayList_init();
        var tmp$_1;
        tmp$_1 = $receiver.iterator();
        while (tmp$_1.hasNext()) {
          var element = tmp$_1.next();
          var tmp$_2, tmp$_3;
          if (!this.local$this$ContentJobRunner.activeJobItemIds_0.contains_11rb$((tmp$_3 = (tmp$_2 = element.contentJobItem) != null ? tmp$_2.cjiUid : null) != null ? tmp$_3 : L0)) 
            destination.add_11rb$(element);
        }
        this.local$queueItems = destination;
        var a = this.local$closure$numProcessorsAvailable;
        var b = this.local$queueItems.size;
        this.local$numJobsToAdd = JsMath.min(a, b);
        napier.Napier.d_82mfvz$(this.local$this$ContentJobRunner.logPrefix_0 + ' num of Jobs to add :' + this.local$numJobsToAdd);
        this.local$i = 0;
        this.state_0 = 3;
        continue;
      case 3:
        if (this.local$i >= this.local$numJobsToAdd) {
          this.state_0 = 6;
          continue;
        }
        var contentJobItemUid = (tmp$_0 = (tmp$ = this.local$queueItems.get_za3lpa$(this.local$i).contentJobItem) != null ? tmp$.cjiUid : null) != null ? tmp$_0 : L0;
        this.local$this$ContentJobRunner.activeJobItemIds_0.add_11rb$(contentJobItemUid);
        this.state_0 = 4;
        this.result_0 = this.local$txDb.contentJobItemDao.updateItemStatus_yhmem3$(contentJobItemUid, 12, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        var $receiver_0 = this.local$closure$queueItemsToSend;
        var element_0 = this.local$queueItems.get_za3lpa$(this.local$i);
        $receiver_0.add_11rb$(element_0);
        this.state_0 = 5;
        continue;
      case 5:
        this.local$i++;
        this.state_0 = 3;
        continue;
      case 6:
        this.state_0 = 7;
        continue;
      case 7:
        this.state_0 = 8;
        this.result_0 = this.local$txDb.contentJobItemDao.isJobDone_s8cxhz$(this.local$this$ContentJobRunner.jobId, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 8:
        this.local$closure$done.v = this.result_0;
        napier.Napier.d_82mfvz$(this.local$this$ContentJobRunner.logPrefix_0 + ' is job Done :' + this.local$closure$done.v);
        return this.local$closure$queueItemsToSend;
      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 ContentJobRunner$produceJobs$lambda$lambda_0(closure$numProcessorsAvailable_0, this$ContentJobRunner_0, closure$queueItemsToSend_0, closure$done_0) {
    return function(txDb_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$produceJobs$lambda$lambda_0(closure$numProcessorsAvailable_0, this$ContentJobRunner_0, closure$queueItemsToSend_0, closure$done_0, txDb_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentJobRunner$produceJobs$lambda$lambda_1(this$ContentJobRunner_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ContentJobRunner = this$ContentJobRunner_0;
  }
  Coroutine$ContentJobRunner$produceJobs$lambda$lambda_1.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$produceJobs$lambda$lambda_1.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$produceJobs$lambda$lambda_1.prototype.constructor = Coroutine$ContentJobRunner$produceJobs$lambda$lambda_1;
  Coroutine$ContentJobRunner$produceJobs$lambda$lambda_1.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        return this.local$this$ContentJobRunner.jobConnectivityLiveData_0.removeObserver_jsfaok$(this.local$this$ContentJobRunner) , Unit;
      case 1:
        throw this.exception_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 ContentJobRunner$produceJobs$lambda$lambda_1(this$ContentJobRunner_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$produceJobs$lambda$lambda_1(this$ContentJobRunner_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentJobRunner$produceJobs$lambda(this$ContentJobRunner_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 15;
    this.local$this$ContentJobRunner = this$ContentJobRunner_0;
    this.local$done = void 0;
    this.local$tmp$ = void 0;
    this.local$$receiver = $receiver_0;
  }
  Coroutine$ContentJobRunner$produceJobs$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$produceJobs$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$produceJobs$lambda.prototype.constructor = Coroutine$ContentJobRunner$produceJobs$lambda;
  Coroutine$ContentJobRunner$produceJobs$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$done = {
  v: false};
        this.exceptionState_0 = 9;
        napier.Napier.d_82mfvz$(this.local$this$ContentJobRunner.logPrefix_0 + ' connectivity observer forever');
        this.state_0 = 1;
        this.result_0 = withContext(doorMainDispatcher(), ContentJobRunner$produceJobs$lambda$lambda(this.local$this$ContentJobRunner), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        this.state_0 = 2;
        continue;
      case 2:
        napier.Napier.d_82mfvz$(this.local$this$ContentJobRunner.logPrefix_0 + ' waiting for signal to check queue');
        this.state_0 = 3;
        this.result_0 = this.local$this$ContentJobRunner.checkQueueSignalChannel_0.receive(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var numProcessorsAvailable = this.local$this$ContentJobRunner.numProcessors - this.local$this$ContentJobRunner.activeJobItemIds_0.size | 0;
        napier.Napier.d_82mfvz$(this.local$this$ContentJobRunner.logPrefix_0 + ' num process available :' + numProcessorsAvailable);
        var queueItemsToSend = ArrayList_init();
        this.state_0 = 4;
        this.result_0 = this.local$this$ContentJobRunner.withContentJobItemTransaction_fk0axj$(ContentJobRunner$produceJobs$lambda$lambda_0(numProcessorsAvailable, this.local$this$ContentJobRunner, queueItemsToSend, this.local$done), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        var jobItemsToSend = this.result_0;
        this.local$tmp$ = jobItemsToSend.iterator();
        this.state_0 = 5;
        continue;
      case 5:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 7;
          continue;
        }
        var element = this.local$tmp$.next();
        this.state_0 = 6;
        this.result_0 = this.local$$receiver.send_11rb$(element, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 6:
        this.state_0 = 5;
        continue;
      case 7:
        if (this.local$done.v) {
          this.state_0 = 8;
          continue;
        }
        this.state_0 = 2;
        continue;
      case 8:
        this.exceptionState_0 = 15;
        this.finallyPath_0 = [14];
        this.state_0 = 12;
        continue;
      case 9:
        this.finallyPath_0 = [15];
        this.exceptionState_0 = 12;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          this.exceptionState_0 = 15;
          this.finallyPath_0 = [10];
          this.state_0 = 12;
          this.$returnValue = (napier.Napier.d_82mfvz$(stackTraceToString(e), e) , Unit);
          continue;
        } else {
          throw e;
        }
      case 10:
        return this.$returnValue;
      case 11:
        this.finallyPath_0 = [14];
        this.state_0 = 12;
        continue;
      case 12:
        this.exceptionState_0 = 15;
        this.state_0 = 13;
        this.result_0 = withContext(coroutines.NonCancellable.plus_1fupul$(doorMainDispatcher()), ContentJobRunner$produceJobs$lambda$lambda_1(this.local$this$ContentJobRunner), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 13:
        napier.Napier.d_82mfvz$(this.local$this$ContentJobRunner.logPrefix_0 + ' close produce job');
        this.local$$receiver.close_dbl4no$();
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 14:
        return Unit;
      case 15:
        throw this.exception_0;
      default:
        this.state_0 = 15;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 15) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function ContentJobRunner$produceJobs$lambda(this$ContentJobRunner_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$produceJobs$lambda(this$ContentJobRunner_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentJobRunner.prototype.produceJobs_0 = function($receiver) {
  return produce($receiver, void 0, void 0, ContentJobRunner$produceJobs$lambda(this));
};
  function Coroutine$ContentJobRunner$launchProcessor$lambda$lambda(closure$metadataResult_0, closure$item_0, txDb_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$metadataResult = closure$metadataResult_0;
    this.local$closure$item = closure$item_0;
    this.local$txDb = txDb_0;
  }
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda.prototype.constructor = Coroutine$ContentJobRunner$launchProcessor$lambda$lambda;
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2;
        this.state_0 = 2;
        this.result_0 = this.local$txDb.contentEntryDao.insertAsync(this.local$closure$metadataResult.v.entry, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var contentEntryUid = this.result_0;
                (tmp$ = this.local$closure$item.contentJobItem) != null ? (tmp$.cjiContentEntryUid = contentEntryUid) : null;
        this.state_0 = 3;
        this.result_0 = this.local$txDb.contentJobItemDao.updateContentEntryUid_3pjtqy$((tmp$_1 = (tmp$_0 = this.local$closure$item.contentJobItem) != null ? tmp$_0.cjiUid : null) != null ? tmp$_1 : L0, contentEntryUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        if (!equals((tmp$_2 = this.local$closure$item.contentJobItem) != null ? tmp$_2.cjiParentContentEntryUid : null, L0)) {
          var tmp$_3 = this.local$txDb.contentEntryParentChildJoinDao;
          var $receiver = new ContentEntryParentChildJoin();
          var closure$item = this.local$closure$item;
          var tmp$_4, tmp$_5, tmp$_6, tmp$_7;
          $receiver.cepcjParentContentEntryUid = (tmp$_5 = (tmp$_4 = closure$item.contentJobItem) != null ? tmp$_4.cjiParentContentEntryUid : null) != null ? tmp$_5 : L0;
          $receiver.cepcjChildContentEntryUid = (tmp$_7 = (tmp$_6 = closure$item.contentJobItem) != null ? tmp$_6.cjiContentEntryUid : null) != null ? tmp$_7 : L0;
          return tmp$_3.insert_11rb$($receiver) , Unit;
        } else {
          this.state_0 = 4;
          continue;
        }
      case 4:
        return Unit;
      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 ContentJobRunner$launchProcessor$lambda$lambda(closure$metadataResult_0, closure$item_0) {
    return function(txDb_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$launchProcessor$lambda$lambda(closure$metadataResult_0, closure$item_0, txDb_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_0(closure$plugin_0, closure$item_0, closure$processContext_0, this$ContentJobRunner_0, closure$processException_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 5;
    this.local$closure$plugin = closure$plugin_0;
    this.local$closure$item = closure$item_0;
    this.local$closure$processContext = closure$processContext_0;
    this.local$this$ContentJobRunner = this$ContentJobRunner_0;
    this.local$closure$processException = closure$processException_0;
  }
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_0.prototype.constructor = Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_0;
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.exceptionState_0 = 2;
        this.state_0 = 1;
        this.result_0 = this.local$closure$plugin.processJob_12gysh$(this.local$closure$item, this.local$closure$processContext, this.local$this$ContentJobRunner, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        return this.result_0;
      case 2:
        this.exceptionState_0 = 5;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          napier.Napier.e_82mfvz$('jobResult: caught exception', e);
          this.local$closure$processException.v = e;
          return new ProcessResult(25);
        } else {
          throw e;
        }
      case 3:
        this.state_0 = 4;
        continue;
      case 4:
        return;
      case 5:
        throw this.exception_0;
      default:
        this.state_0 = 5;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 5) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function ContentJobRunner$launchProcessor$lambda$lambda_0(closure$plugin_0, closure$item_0, closure$processContext_0, this$ContentJobRunner_0, closure$processException_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_0(closure$plugin_0, closure$item_0, closure$processContext_0, this$ContentJobRunner_0, closure$processException_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function ContentJobRunner$launchProcessor$lambda$lambda_1(closure$item, closure$jobResult) {
    return function(it) {
  var tmp$;
  var state = it.first;
  var isMeteredAllowed = it.second;
  if (((tmp$ = closure$item.contentJobItem) != null ? tmp$.cjiConnectivityNeeded : null) === true && (state === 0 || (!isMeteredAllowed && state === 3))) {
    closure$jobResult.cancel_x5z25k$(new ConnectivityCancellationException('connectivity not acceptable'));
  }
  return Unit;
};
  }
  function Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_1(this$ContentJobRunner_0, closure$mediatorObserver_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ContentJobRunner = this$ContentJobRunner_0;
    this.local$closure$mediatorObserver = closure$mediatorObserver_0;
  }
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_1.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_1.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_1.prototype.constructor = Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_1;
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_1.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        return this.local$this$ContentJobRunner.jobConnectivityLiveData_0.observeForever_jsfaok$(this.local$closure$mediatorObserver.v) , Unit;
      case 1:
        throw this.exception_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 ContentJobRunner$launchProcessor$lambda$lambda_2(this$ContentJobRunner_0, closure$mediatorObserver_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_1(this$ContentJobRunner_0, closure$mediatorObserver_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_2(closure$item_0, closure$processResult_0, txDb_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$item = closure$item_0;
    this.local$closure$processResult = closure$processResult_0;
    this.local$txDb = txDb_0;
  }
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_2.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_2.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_2.prototype.constructor = Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_2;
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_2.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2;
        this.state_0 = 2;
        this.result_0 = this.local$txDb.contentJobItemDao.updateItemStatus_yhmem3$((tmp$_0 = (tmp$ = this.local$closure$item.contentJobItem) != null ? tmp$.cjiUid : null) != null ? tmp$_0 : L0, this.local$closure$processResult.v.status, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        this.result_0 = this.local$txDb.contentJobItemDao.updateFinishTimeForJob_3pjtqy$((tmp$_2 = (tmp$_1 = this.local$closure$item.contentJobItem) != null ? tmp$_1.cjiUid : null) != null ? tmp$_2 : L0, systemTimeInMillis(), 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 ContentJobRunner$launchProcessor$lambda$lambda_3(closure$item_0, closure$processResult_0) {
    return function(txDb_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_2(closure$item_0, closure$processResult_0, txDb_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentJobRunner$launchProcessor$lambda$lambda$lambda(closure$item_0, closure$finalStatus_0, txDb_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$item = closure$item_0;
    this.local$closure$finalStatus = closure$finalStatus_0;
    this.local$txDb = txDb_0;
  }
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda$lambda.prototype.constructor = Coroutine$ContentJobRunner$launchProcessor$lambda$lambda$lambda;
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4;
        this.state_0 = 2;
        this.result_0 = this.local$txDb.contentJobItemDao.updateJobItemAttemptCountAndStatus_liip7b$((tmp$_0 = (tmp$ = this.local$closure$item.contentJobItem) != null ? tmp$.cjiUid : null) != null ? tmp$_0 : L0, (tmp$_2 = (tmp$_1 = this.local$closure$item.contentJobItem) != null ? tmp$_1.cjiAttemptCount : null) != null ? tmp$_2 : 0, this.local$closure$finalStatus, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        this.result_0 = this.local$txDb.contentJobItemDao.updateFinishTimeForJob_3pjtqy$((tmp$_4 = (tmp$_3 = this.local$closure$item.contentJobItem) != null ? tmp$_3.cjiUid : null) != null ? tmp$_4 : L0, systemTimeInMillis(), 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 ContentJobRunner$launchProcessor$lambda$lambda$lambda(closure$item_0, closure$finalStatus_0) {
    return function(txDb_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$launchProcessor$lambda$lambda$lambda(closure$item_0, closure$finalStatus_0, txDb_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_3(closure$processResult_0, closure$item_0, closure$processException_0, this$ContentJobRunner_0, closure$tmpDir_0, closure$id_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 5;
    this.local$closure$processResult = closure$processResult_0;
    this.local$closure$item = closure$item_0;
    this.local$closure$processException = closure$processException_0;
    this.local$this$ContentJobRunner = this$ContentJobRunner_0;
    this.local$closure$tmpDir = closure$tmpDir_0;
    this.local$closure$id = closure$id_0;
  }
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_3.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_3.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_3.prototype.constructor = Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_3;
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_3.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6, tmp$_7, tmp$_8, tmp$_9;
        if (this.local$closure$processException.v == null && this.local$closure$processResult.v != null) {
          if (this.local$closure$processResult.v.status !== 4) {
                        (tmp$_1 = this.local$closure$item.contentJobItem) != null ? (tmp$_1.cjiAttemptCount = ((tmp$_0 = (tmp$ = this.local$closure$item.contentJobItem) != null ? tmp$.cjiAttemptCount : null) != null ? tmp$_0 : 0) + 1 | 0) : null;
          }
          tmp$_8 = this.local$closure$processResult.v.status;
        } else if (Kotlin.isType(this.local$closure$processException.v, FatalContentJobException)) {
                    (tmp$_4 = this.local$closure$item.contentJobItem) != null ? (tmp$_4.cjiAttemptCount = ((tmp$_3 = (tmp$_2 = this.local$closure$item.contentJobItem) != null ? tmp$_2.cjiAttemptCount : null) != null ? tmp$_3 : 0) + 1 | 0) : null;
          tmp$_8 = 25;
        } else if (Kotlin.isType(this.local$closure$processException.v, ContentTypeNotSupportedException)) 
          tmp$_8 = 24;
        else if (Kotlin.isType(this.local$closure$processException.v, ConnectivityCancellationException)) 
          tmp$_8 = 4;
        else if (Kotlin.isType(this.local$closure$processException.v, CancellationException)) 
          tmp$_8 = 28;
        else {
          var tmp$_10, tmp$_11;
          if (((tmp$_11 = (tmp$_10 = this.local$closure$item.contentJobItem) != null ? tmp$_10.cjiAttemptCount : null) != null ? tmp$_11 : this.local$this$ContentJobRunner.maxItemAttempts) >= this.local$this$ContentJobRunner.maxItemAttempts) 
            tmp$_8 = 25;
          else {
                        (tmp$_7 = this.local$closure$item.contentJobItem) != null ? (tmp$_7.cjiAttemptCount = ((tmp$_6 = (tmp$_5 = this.local$closure$item.contentJobItem) != null ? tmp$_5.cjiAttemptCount : null) != null ? tmp$_6 : 0) + 1 | 0) : null;
            tmp$_8 = 4;
          }
        }
        var finalStatus = tmp$_8;
        this.state_0 = 1;
        this.result_0 = this.local$this$ContentJobRunner.withContentJobItemTransaction_fk0axj$(ContentJobRunner$launchProcessor$lambda$lambda$lambda(this.local$closure$item, finalStatus), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        var tmp$_12, tmp$_13;
        var $receiver = this.local$this$ContentJobRunner.activeJobItemIds_0;
        var element = (tmp$_13 = (tmp$_12 = this.local$closure$item.contentJobItem) != null ? tmp$_12.cjiUid : null) != null ? tmp$_13 : L0;
        $receiver.remove_11rb$(element);
        this.exceptionState_0 = 3;
        this.state_0 = 2;
        this.result_0 = emptyRecursively(this.local$closure$tmpDir, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 2:
        this.exceptionState_0 = 5;
        this.state_0 = 4;
        continue;
      case 3:
        this.exceptionState_0 = 5;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          printStackTrace(e);
        } else 
          throw e;
        this.state_0 = 4;
        continue;
      case 4:
        return napier.Napier.d_82mfvz$(this.local$this$ContentJobRunner.logPrefix_0 + ' Processor #' + this.local$closure$id + ' sending check queue signal after ' + ('finishing with #' + toString((tmp$_9 = this.local$closure$item.contentJobItem) != null ? tmp$_9.cjiUid : null))) , Unit;
      case 5:
        throw this.exception_0;
      default:
        this.state_0 = 5;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 5) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function ContentJobRunner$launchProcessor$lambda$lambda_4(closure$processResult_0, closure$item_0, closure$processException_0, this$ContentJobRunner_0, closure$tmpDir_0, closure$id_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_3(closure$processResult_0, closure$item_0, closure$processException_0, this$ContentJobRunner_0, closure$tmpDir_0, closure$id_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_4(closure$mediatorObserver_0, this$ContentJobRunner_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$mediatorObserver = closure$mediatorObserver_0;
    this.local$this$ContentJobRunner = this$ContentJobRunner_0;
  }
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_4.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_4.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_4.prototype.constructor = Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_4;
  Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_4.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        var tmp$_0;
        if ((tmp$ = this.local$closure$mediatorObserver.v) != null) {
          this.local$this$ContentJobRunner.jobConnectivityLiveData_0.removeObserver_jsfaok$(tmp$);
          tmp$_0 = Unit;
        } else 
          tmp$_0 = null;
        return tmp$_0;
      case 1:
        throw this.exception_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 ContentJobRunner$launchProcessor$lambda$lambda_5(closure$mediatorObserver_0, this$ContentJobRunner_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$launchProcessor$lambda$lambda_4(closure$mediatorObserver_0, this$ContentJobRunner_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentJobRunner$launchProcessor$lambda(closure$id_0, this$ContentJobRunner_0, closure$channel_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 27;
    this.local$closure$id = closure$id_0;
    this.local$this$ContentJobRunner = this$ContentJobRunner_0;
    this.local$closure$channel = closure$channel_0;
    this.local$tmp$ = void 0;
    this.local$tmp$_2 = void 0;
    this.local$tmp$_18 = void 0;
    this.local$tmp$_21 = void 0;
    this.local$tmpDir = void 0;
    this.local$item = void 0;
    this.local$processContext = void 0;
    this.local$processResult = void 0;
    this.local$processException = void 0;
    this.local$mediatorObserver = void 0;
    this.local$cjiUid = void 0;
    this.local$$receiver = void 0;
    this.local$sourceUri = void 0;
    this.local$metadataResult = void 0;
    this.local$jobResult = void 0;
    this.local$$receiver_0 = $receiver_0;
  }
  Coroutine$ContentJobRunner$launchProcessor$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$launchProcessor$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$launchProcessor$lambda.prototype.constructor = Coroutine$ContentJobRunner$launchProcessor$lambda;
  Coroutine$ContentJobRunner$launchProcessor$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        var tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6, tmp$_7, tmp$_8, tmp$_9, tmp$_10, tmp$_11, tmp$_12, tmp$_13, tmp$_14, tmp$_15;
        var tmp$_16, tmp$_17;
        var tmp$_18, tmp$_19;
        this.local$tmpDir = createTemporaryDir('job-' + this.local$closure$id);
        napier.Napier.d_82mfvz$(this.local$this$ContentJobRunner.logPrefix_0 + ' created tempDir job-' + this.local$closure$id);
        this.local$tmp$ = this.local$closure$channel.iterator();
        this.state_0 = 1;
        continue;
      case 1:
        this.state_0 = 2;
        this.result_0 = this.local$tmp$.hasNext(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 2:
        if (!this.result_0) {
          this.state_0 = 28;
          continue;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 3:
        this.local$item = this.local$tmp$.next();
        this.local$tmp$_2 = (tmp$_0 = (tmp$ = this.local$item.contentJobItem) != null ? tmp$.sourceUri : null) != null ? DoorUri.Companion.parse_61zpoe$(tmp$_0) : null;
        if (this.local$tmp$_2 == null) {
          this.state_0 = 1;
          continue;
        } else {
          this.state_0 = 4;
          continue;
        }
      case 4:
        var itemUri = this.local$tmp$_2;
        var processParams = (tmp$_4 = (tmp$_3 = (tmp$_2 = (tmp$_1 = this.local$item.contentJob) != null ? tmp$_1.params : null) != null ? decodeStringMapFromString(this.local$this$ContentJobRunner.json_0, tmp$_2) : null) != null ? toMutableMap(tmp$_3) : null) != null ? tmp$_4 : LinkedHashMap_init();
        this.local$processContext = new ContentJobProcessContext(itemUri, this.local$tmpDir, processParams, this.local$this$ContentJobRunner, this.local$this$ContentJobRunner.di);
        napier.Napier.d_82mfvz$(this.local$this$ContentJobRunner.logPrefix_0 + ' : ' + ('Proessor #' + this.local$closure$id + ' processing job #' + toString((tmp$_5 = this.local$item.contentJobItem) != null ? tmp$_5.cjiUid : null) + ' ') + ('attempt #' + toString((tmp$_6 = this.local$item.contentJobItem) != null ? tmp$_6.cjiAttemptCount : null)));
        this.local$processResult = {
  v: null};
        this.local$processException = {
  v: null};
        this.local$mediatorObserver = {
  v: null};
        this.exceptionState_0 = 19;
        tmp$_8 = (tmp$_7 = this.local$item.contentJobItem) != null ? tmp$_7.cjiUid : null;
        if (tmp$_8 == null) {
          throw IllegalArgumentException_init('no content job item uid');
        }
        this.local$cjiUid = tmp$_8;
        this.local$$receiver = this.local$this$ContentJobRunner.contentJobItemUpdateMutex_0;
        this.state_0 = 5;
        this.result_0 = this.local$$receiver.lock_s8jyv4$(null, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        this.exceptionState_0 = 17;
        this.state_0 = 6;
        this.result_0 = this.local$this$ContentJobRunner.db_0.contentJobItemDao.updateStartTimeForJob_3pjtqy$(this.local$cjiUid, getSystemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 6:
        this.result_0 = Unit;
        this.exceptionState_0 = 19;
        this.finallyPath_0 = [7];
        this.state_0 = 18;
        continue;
      case 7:
        tmp$_12 = (tmp$_10 = (tmp$_9 = this.local$item.contentJobItem) != null ? tmp$_9.sourceUri : null) != null ? DoorUri.Companion.parse_61zpoe$(tmp$_10) : null;
        if (tmp$_12 == null) {
          throw IllegalArgumentException_init('ContentJobItem #' + toString((tmp$_11 = this.local$item.contentJobItem) != null ? tmp$_11.cjiUid : null) + ' has no source uri!');
        }
        this.local$sourceUri = tmp$_12;
        this.local$metadataResult = {
  v: null};
        if (equals((tmp$_13 = this.local$item.contentJobItem) != null ? tmp$_13.cjiContentEntryUid : null, L0)) {
          this.state_0 = 8;
          this.result_0 = this.local$this$ContentJobRunner.contentPluginManager_0.extractMetadata_80ka5$(this.local$sourceUri, this.local$processContext, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 10;
          continue;
        }
      case 8:
        this.local$metadataResult.v = this.result_0;
        this.state_0 = 9;
        this.result_0 = this.local$this$ContentJobRunner.withContentJobItemTransaction_fk0axj$(ContentJobRunner$launchProcessor$lambda$lambda(this.local$metadataResult, this.local$item), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 9:
        this.state_0 = 10;
        continue;
      case 10:
        if (((tmp$_14 = this.local$item.contentJobItem) != null ? tmp$_14.cjiPluginId : null) === 0) {
          this.local$tmp$_18 = (tmp$_15 = this.local$metadataResult.v) != null ? tmp$_15.pluginId : null;
          if (this.local$tmp$_18 == null) {
            this.state_0 = 11;
            this.result_0 = this.local$this$ContentJobRunner.contentPluginManager_0.extractMetadata_80ka5$(this.local$sourceUri, this.local$processContext, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 12;
            continue;
          }
        } else {
          this.local$tmp$_21 = (tmp$_17 = (tmp$_16 = this.local$item.contentJobItem) != null ? tmp$_16.cjiPluginId : null) != null ? tmp$_17 : 0;
          this.state_0 = 13;
          continue;
        }
      case 11:
        this.local$tmp$_18 = this.result_0.pluginId;
        this.state_0 = 12;
        continue;
      case 12:
        this.local$tmp$_21 = this.local$tmp$_18;
        this.state_0 = 13;
        continue;
      case 13:
        var pluginId = this.local$tmp$_21;
        var plugin = this.local$this$ContentJobRunner.contentPluginManager_0.getPluginById_za3lpa$(pluginId);
        this.local$jobResult = async(this.local$$receiver_0, void 0, void 0, ContentJobRunner$launchProcessor$lambda$lambda_0(plugin, this.local$item, this.local$processContext, this.local$this$ContentJobRunner, this.local$processException));
        this.local$mediatorObserver.v = new DoorObserver(ContentJobRunner$launchProcessor$lambda$lambda_1(this.local$item, this.local$jobResult));
        this.state_0 = 14;
        this.result_0 = withContext(doorMainDispatcher(), ContentJobRunner$launchProcessor$lambda$lambda_2(this.local$this$ContentJobRunner, this.local$mediatorObserver), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 14:
        this.state_0 = 15;
        this.result_0 = this.local$jobResult.await(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 15:
        this.local$processResult.v = this.result_0;
        this.state_0 = 16;
        this.result_0 = this.local$this$ContentJobRunner.withContentJobItemTransaction_fk0axj$(ContentJobRunner$launchProcessor$lambda$lambda_3(this.local$item, this.local$processResult), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 16:
        napier.Napier.d_82mfvz$(this.local$this$ContentJobRunner.logPrefix_0 + ' Processor #' + this.local$closure$id + ' completed job #' + toString((tmp$_18 = this.local$item.contentJobItem) != null ? tmp$_18.cjiUid : null));
        this.exceptionState_0 = 27;
        this.finallyPath_0 = [22];
        this.state_0 = 23;
        continue;
      case 17:
        this.finallyPath_0 = [19];
        this.state_0 = 18;
        continue;
      case 18:
        this.exceptionState_0 = 19;
        this.local$$receiver.unlock_s8jyv4$(null);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 19:
        this.finallyPath_0 = [27];
        this.exceptionState_0 = 23;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          this.local$processException.v = e;
          printStackTrace(e);
          this.state_0 = 20;
          this.result_0 = delay(L1000, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          throw e;
        }
      case 20:
        this.state_0 = 21;
        continue;
      case 21:
        this.finallyPath_0 = [22];
        this.state_0 = 23;
        continue;
      case 22:
        this.state_0 = 1;
        continue;
      case 23:
        this.exceptionState_0 = 27;
        this.state_0 = 24;
        this.result_0 = withContext(coroutines.NonCancellable, ContentJobRunner$launchProcessor$lambda$lambda_4(this.local$processResult, this.local$item, this.local$processException, this.local$this$ContentJobRunner, this.local$tmpDir, this.local$closure$id), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 24:
        this.state_0 = 25;
        this.result_0 = withContext(coroutines.NonCancellable.plus_1fupul$(doorMainDispatcher()), ContentJobRunner$launchProcessor$lambda$lambda_5(this.local$mediatorObserver, this.local$this$ContentJobRunner), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 25:
        if (Kotlin.isType(this.local$processException.v, CancellationException) && !Kotlin.isType(this.local$processException.v, ConnectivityCancellationException)) 
          throw Kotlin.isType(tmp$_19 = this.local$processException.v, CancellationException) ? tmp$_19 : throwCCE();
        this.state_0 = 26;
        this.result_0 = this.local$this$ContentJobRunner.checkQueueSignalChannel_0.send_11rb$(true, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 26:
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 27:
        throw this.exception_0;
      case 28:
        return Unit;
      default:
        this.state_0 = 27;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 27) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function ContentJobRunner$launchProcessor$lambda(closure$id_0, this$ContentJobRunner_0, closure$channel_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$launchProcessor$lambda(closure$id_0, this$ContentJobRunner_0, closure$channel_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentJobRunner.prototype.launchProcessor_0 = function($receiver, id, channel) {
  return launch($receiver, void 0, void 0, ContentJobRunner$launchProcessor$lambda(id, this, channel));
};
  function Coroutine$withContentJobItemTransaction_fk0axj$($this, block_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 6;
    this.$this = $this;
    this.local$$receiver = void 0;
    this.local$block = block_0;
  }
  Coroutine$withContentJobItemTransaction_fk0axj$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$withContentJobItemTransaction_fk0axj$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$withContentJobItemTransaction_fk0axj$.prototype.constructor = Coroutine$withContentJobItemTransaction_fk0axj$;
  Coroutine$withContentJobItemTransaction_fk0axj$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$$receiver = this.$this.contentJobItemUpdateMutex_0;
        this.state_0 = 1;
        this.result_0 = this.local$$receiver.lock_s8jyv4$(null, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        this.exceptionState_0 = 4;
        this.state_0 = 2;
        this.result_0 = withDoorTransactionAsync(this.$this.db_0, getKClass(UmAppDatabase), this.local$block, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 2:
        this.result_0 = this.result_0;
        this.exceptionState_0 = 6;
        this.finallyPath_0 = [3];
        this.state_0 = 5;
        continue;
      case 3:
        return this.result_0;
      case 4:
        this.finallyPath_0 = [6];
        this.state_0 = 5;
        continue;
      case 5:
        this.exceptionState_0 = 6;
        this.local$$receiver.unlock_s8jyv4$(null);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 6:
        throw this.exception_0;
      default:
        this.state_0 = 6;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 6) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  ContentJobRunner.prototype.withContentJobItemTransaction_fk0axj$ = function(block_0, continuation_0, suspended) {
  var instance = new Coroutine$withContentJobItemTransaction_fk0axj$(this, block_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$ContentJobRunner$onProgress$lambda(this$ContentJobRunner_0, closure$contentJobItem_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ContentJobRunner = this$ContentJobRunner_0;
    this.local$closure$contentJobItem = closure$contentJobItem_0;
  }
  Coroutine$ContentJobRunner$onProgress$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$onProgress$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$onProgress$lambda.prototype.constructor = Coroutine$ContentJobRunner$onProgress$lambda;
  Coroutine$ContentJobRunner$onProgress$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$ContentJobRunner.eventCollator_0.send_11rb$(toProgressUpdate(this.local$closure$contentJobItem), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ContentJobRunner$onProgress$lambda(this$ContentJobRunner_0, closure$contentJobItem_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$onProgress$lambda(this$ContentJobRunner_0, closure$contentJobItem_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentJobRunner.prototype.onProgress_letzpf$ = function(contentJobItem) {
  launch(coroutines.GlobalScope, void 0, void 0, ContentJobRunner$onProgress$lambda(this, contentJobItem));
};
  function Coroutine$ContentJobRunner$commitProgressUpdates$lambda(closure$updates_0, txDb_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$updates = closure$updates_0;
    this.local$txDb = txDb_0;
  }
  Coroutine$ContentJobRunner$commitProgressUpdates$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$commitProgressUpdates$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$commitProgressUpdates$lambda.prototype.constructor = Coroutine$ContentJobRunner$commitProgressUpdates$lambda;
  Coroutine$ContentJobRunner$commitProgressUpdates$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$txDb.contentJobItemDao.commitProgressUpdates_kqtj6w$(this.local$closure$updates, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ContentJobRunner$commitProgressUpdates$lambda(closure$updates_0) {
    return function(txDb_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$commitProgressUpdates$lambda(closure$updates_0, txDb_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$commitProgressUpdates_0($this, updates_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$updates = updates_0;
  }
  Coroutine$commitProgressUpdates_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$commitProgressUpdates_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$commitProgressUpdates_0.prototype.constructor = Coroutine$commitProgressUpdates_0;
  Coroutine$commitProgressUpdates_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.$this.withContentJobItemTransaction_fk0axj$(ContentJobRunner$commitProgressUpdates$lambda(this.local$updates), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        return;
      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);
};
  ContentJobRunner.prototype.commitProgressUpdates_0 = function(updates_0, continuation_0, suspended) {
  var instance = new Coroutine$commitProgressUpdates_0(this, updates_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$ContentJobRunner$runJob$lambda$lambda(this$ContentJobRunner_0, closure$jobList_0, closure$producerVal_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ContentJobRunner = this$ContentJobRunner_0;
    this.local$closure$jobList = closure$jobList_0;
    this.local$closure$producerVal = closure$producerVal_0;
    this.local$$receiver = $receiver_0;
  }
  Coroutine$ContentJobRunner$runJob$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$runJob$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$runJob$lambda$lambda.prototype.constructor = Coroutine$ContentJobRunner$runJob$lambda$lambda;
  Coroutine$ContentJobRunner$runJob$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var times = this.local$this$ContentJobRunner.numProcessors;
        for (var index = 0; index < times; index++) {
          var this$ContentJobRunner = this.local$this$ContentJobRunner;
          var closure$jobList = this.local$closure$jobList;
          var closure$producerVal = this.local$closure$producerVal;
          napier.Napier.d_82mfvz$(this$ContentJobRunner.logPrefix_0 + ' launch processor ' + index);
          var element = this$ContentJobRunner.launchProcessor_0(this.local$$receiver, index, closure$producerVal);
          closure$jobList.add_11rb$(element);
        }
        napier.Napier.d_82mfvz$(this.local$this$ContentJobRunner.logPrefix_0 + ' run Job, send queue signal');
        this.state_0 = 2;
        this.result_0 = this.local$this$ContentJobRunner.checkQueueSignalChannel_0.send_11rb$(true, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ContentJobRunner$runJob$lambda$lambda(this$ContentJobRunner_0, closure$jobList_0, closure$producerVal_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$runJob$lambda$lambda(this$ContentJobRunner_0, closure$jobList_0, closure$producerVal_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentJobRunner$runJob$lambda$lambda$lambda(this$ContentJobRunner_0, txDb_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$this$ContentJobRunner = this$ContentJobRunner_0;
    this.local$jobDestDir = void 0;
    this.local$tmp$ = void 0;
    this.local$txDb = txDb_0;
  }
  Coroutine$ContentJobRunner$runJob$lambda$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$runJob$lambda$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$runJob$lambda$lambda$lambda.prototype.constructor = Coroutine$ContentJobRunner$runJob$lambda$lambda$lambda;
  Coroutine$ContentJobRunner$runJob$lambda$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        this.local$txDb.contentEntryDao.updateContentEntryActiveByContentJobUid_zaz62j$(this.local$this$ContentJobRunner.jobId, true, systemTimeInMillis());
        this.local$jobDestDir = (tmp$_0 = (tmp$ = this.local$txDb.contentJobDao.findByUid_s8cxhz$(this.local$this$ContentJobRunner.jobId)) != null ? tmp$.toUri : null) != null ? tmp$_0 : first(this.local$this$ContentJobRunner.containerStorageManager_0.storageList).dirUri;
        this.state_0 = 2;
        this.result_0 = this.local$txDb.contentJobItemDao.findAllContainersByJobUid_s8cxhz$(this.local$this$ContentJobRunner.jobId, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$tmp$ = this.result_0.iterator();
        this.state_0 = 3;
        continue;
      case 3:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 5;
          continue;
        }
        var element = this.local$tmp$.next();
        var dirUriToDelete = DoorUri.Companion.parse_61zpoe$(UMFileUtil_getInstance().joinPaths_vqirvp$([this.local$jobDestDir, element.toString()]));
        this.state_0 = 4;
        this.result_0 = deleteRecursively(dirUriToDelete, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.state_0 = 3;
        continue;
      case 5:
        this.state_0 = 6;
        this.result_0 = this.local$txDb.contentJobItemDao.updateAllStatusesByJobUid_yhmem3$(this.local$this$ContentJobRunner.jobId, 28, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 6:
        this.local$txDb.containerEntryDao.deleteContainerEntriesCreatedByJobs_s8cxhz$(this.local$this$ContentJobRunner.jobId);
        this.state_0 = 7;
        this.result_0 = deleteZombieContainerEntryFiles(this.local$txDb.containerEntryFileDao, dbType(this.local$this$ContentJobRunner.db_0), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 7:
        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 ContentJobRunner$runJob$lambda$lambda$lambda(this$ContentJobRunner_0) {
    return function(txDb_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$runJob$lambda$lambda$lambda(this$ContentJobRunner_0, txDb_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentJobRunner$runJob$lambda$lambda_0(closure$producerVal_0, closure$jobList_0, this$ContentJobRunner_0, closure$e_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$producerVal = closure$producerVal_0;
    this.local$closure$jobList = closure$jobList_0;
    this.local$this$ContentJobRunner = this$ContentJobRunner_0;
    this.local$closure$e = closure$e_0;
    this.local$tmp$ = void 0;
    this.local$$receiver = $receiver_0;
  }
  Coroutine$ContentJobRunner$runJob$lambda$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$runJob$lambda$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$runJob$lambda$lambda_0.prototype.constructor = Coroutine$ContentJobRunner$runJob$lambda$lambda_0;
  Coroutine$ContentJobRunner$runJob$lambda$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$closure$producerVal.cancel_x5z25k$();
        cancelChildren(this.local$$receiver.coroutineContext);
        this.local$tmp$ = this.local$closure$jobList.iterator();
        this.state_0 = 2;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 4;
          continue;
        }
        var element = this.local$tmp$.next();
        this.state_0 = 3;
        this.result_0 = cancelAndJoin(element, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.state_0 = 2;
        continue;
      case 4:
        this.state_0 = 5;
        this.result_0 = this.local$this$ContentJobRunner.withContentJobItemTransaction_fk0axj$(ContentJobRunner$runJob$lambda$lambda$lambda(this.local$this$ContentJobRunner), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        throw this.local$closure$e;
      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 ContentJobRunner$runJob$lambda$lambda_0(closure$producerVal_0, closure$jobList_0, this$ContentJobRunner_0, closure$e_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$runJob$lambda$lambda_0(closure$producerVal_0, closure$jobList_0, this$ContentJobRunner_0, closure$e_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentJobRunner$runJob$lambda(this$ContentJobRunner_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 7;
    this.local$this$ContentJobRunner = this$ContentJobRunner_0;
    this.local$producerVal = void 0;
    this.local$jobList = void 0;
    this.local$$receiver = $receiver_0;
  }
  Coroutine$ContentJobRunner$runJob$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$runJob$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$runJob$lambda.prototype.constructor = Coroutine$ContentJobRunner$runJob$lambda;
  Coroutine$ContentJobRunner$runJob$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var $receiver = this.local$this$ContentJobRunner.produceJobs_0(this.local$$receiver);
        this.local$this$ContentJobRunner.jobItemProducer_0 = $receiver;
        this.local$producerVal = $receiver;
        this.local$jobList = ArrayList_init();
        this.exceptionState_0 = 2;
        this.state_0 = 1;
        this.result_0 = coroutineScope(ContentJobRunner$runJob$lambda$lambda(this.local$this$ContentJobRunner, this.local$jobList, this.local$producerVal), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        this.exceptionState_0 = 7;
        this.state_0 = 5;
        continue;
      case 2:
        this.exceptionState_0 = 7;
        var e = this.exception_0;
        if (Kotlin.isType(e, CancellationException)) {
          this.state_0 = 3;
          this.result_0 = withContext(coroutines.NonCancellable, ContentJobRunner$runJob$lambda$lambda_0(this.local$producerVal, this.local$jobList, this.local$this$ContentJobRunner, e), this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          throw e;
        }
      case 3:
        this.state_0 = 4;
        continue;
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        napier.Napier.d_82mfvz$(this.local$this$ContentJobRunner.logPrefix_0 + ' run Job, send queue signal');
        this.state_0 = 6;
        this.result_0 = this.local$this$ContentJobRunner.checkQueueSignalChannel_0.send_11rb$(true, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 6:
        return this.result_0;
      case 7:
        throw this.exception_0;
      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);
};
  function ContentJobRunner$runJob$lambda(this$ContentJobRunner_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$runJob$lambda(this$ContentJobRunner_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentJobRunner$runJob$lambda_0(this$ContentJobRunner_0, txDb_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$this$ContentJobRunner = this$ContentJobRunner_0;
    this.local$txDb = txDb_0;
  }
  Coroutine$ContentJobRunner$runJob$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$runJob$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$runJob$lambda_0.prototype.constructor = Coroutine$ContentJobRunner$runJob$lambda_0;
  Coroutine$ContentJobRunner$runJob$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = deleteZombieContainerEntryFiles(this.local$txDb.containerEntryFileDao, dbType(this.local$this$ContentJobRunner.db_0), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ContentJobRunner$runJob$lambda_0(this$ContentJobRunner_0) {
    return function(txDb_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$runJob$lambda_0(this$ContentJobRunner_0, txDb_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$runJob($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
  }
  Coroutine$runJob.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$runJob.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$runJob.prototype.constructor = Coroutine$runJob;
  Coroutine$runJob.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = withContext(coroutines.Dispatchers.Default, ContentJobRunner$runJob$lambda(this.$this), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        this.result_0 = withDoorTransactionAsync(this.$this.db_0, getKClass(UmAppDatabase), ContentJobRunner$runJob$lambda_0(this.$this), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        return new ContentJobRunner$ContentJobResult(24);
      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);
};
  ContentJobRunner.prototype.runJob = function(continuation_0, suspended) {
  var instance = new Coroutine$runJob(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$ContentJobRunner$onChanged$lambda(closure$t_0, this$ContentJobRunner_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$t = closure$t_0;
    this.local$this$ContentJobRunner = this$ContentJobRunner_0;
  }
  Coroutine$ContentJobRunner$onChanged$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentJobRunner$onChanged$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentJobRunner$onChanged$lambda.prototype.constructor = Coroutine$ContentJobRunner$onChanged$lambda;
  Coroutine$ContentJobRunner$onChanged$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$closure$t != null) {
          this.state_0 = 2;
          this.result_0 = this.local$this$ContentJobRunner.checkQueueSignalChannel_0.send_11rb$(true, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        return Unit;
      case 3:
        return Unit;
      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 ContentJobRunner$onChanged$lambda(closure$t_0, this$ContentJobRunner_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentJobRunner$onChanged$lambda(closure$t_0, this$ContentJobRunner_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentJobRunner.prototype.onChanged_11rb$ = function(t) {
  launch(coroutines.GlobalScope, void 0, void 0, ContentJobRunner$onChanged$lambda(t, this));
};
  function ContentJobRunner$Companion() {
    ContentJobRunner$Companion_instance = this;
    this.DEFAULT_NUM_PROCESSORS = 10;
    this.DEFAULT_NUM_RETRIES = 5;
  }
  ContentJobRunner$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ContentJobRunner$Companion_instance = null;
  function ContentJobRunner$Companion_getInstance() {
    if (ContentJobRunner$Companion_instance === null) {
      new ContentJobRunner$Companion();
    }
    return ContentJobRunner$Companion_instance;
  }
  ContentJobRunner.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContentJobRunner', 
  interfaces: [ContentJobItemTransactionRunner, DoorObserver, ContentJobProgressListener, DIAware]};
  function ContentPlugin() {
  }
  ContentPlugin.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContentPlugin', 
  interfaces: [DIAware]};
  function ContentPluginIds() {
    ContentPluginIds_instance = this;
    this.CONTAINER_DOWNLOAD_PLUGIN = 10;
    this.DELETE_CONTENT_ENTRY_PLUGIN = 14;
  }
  ContentPluginIds.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'ContentPluginIds', 
  interfaces: []};
  var ContentPluginIds_instance = null;
  function ContentPluginIds_getInstance() {
    if (ContentPluginIds_instance === null) {
      new ContentPluginIds();
    }
    return ContentPluginIds_instance;
  }
  function ContentPluginManager(pluginList) {
    this.pluginList = pluginList;
    this.supportedMimeTypeList = null;
    var $receiver = this.pluginList;
    var destination = ArrayList_init();
    var tmp$;
    tmp$ = $receiver.iterator();
    loop_label:
      while (tmp$.hasNext()) {
        var element = tmp$.next();
        var $receiver_0 = this.pluginList;
        var count$result;
        count$break:
          do {
            var tmp$_0;
            if (Kotlin.isType($receiver_0, Collection) && $receiver_0.isEmpty()) {
              count$result = 0;
              break count$break;
            }
            var count = 0;
            tmp$_0 = $receiver_0.iterator();
            while (tmp$_0.hasNext()) {
              var element_0 = tmp$_0.next();
              if (element_0.pluginId === element.pluginId) 
                checkCountOverflow((count = count + 1 | 0 , count));
            }
            count$result = count;
          } while (false);
        if (count$result > 1) 
          destination.add_11rb$(element);
      }
    var pluginDuplicates = destination;
    if (!pluginDuplicates.isEmpty()) {
      throw IllegalArgumentException_init('Duplicate pluginIds in: ' + joinToString(pluginDuplicates));
    }
    var $receiver_1 = this.pluginList;
    var destination_0 = ArrayList_init();
    var tmp$_1;
    tmp$_1 = $receiver_1.iterator();
    while (tmp$_1.hasNext()) {
      var element_1 = tmp$_1.next();
      var list = element_1.supportedMimeTypes;
      addAll(destination_0, list);
    }
    this.supportedMimeTypeList = toList(toSet(destination_0));
  }
  ContentPluginManager.prototype.isMimeTypeSupported_61zpoe$ = function(mimeType) {
  return this.supportedMimeTypeList.contains_11rb$(mimeType);
};
  ContentPluginManager.prototype.getPluginById_za3lpa$ = function(id) {
  var tmp$;
  var $receiver = this.pluginList;
  var firstOrNull$result;
  firstOrNull$break:
    do {
      var tmp$_0;
      tmp$_0 = $receiver.iterator();
      while (tmp$_0.hasNext()) {
        var element = tmp$_0.next();
        if (element.pluginId === id) {
          firstOrNull$result = element;
          break firstOrNull$break;
        }
      }
      firstOrNull$result = null;
    } while (false);
  tmp$ = firstOrNull$result;
  if (tmp$ == null) {
    throw new FatalContentJobException('invalid pluginId');
  }
  return tmp$;
};
  function Coroutine$extractMetadata_80ka5$($this, uri_0, processContext_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 8;
    this.$this = $this;
    this.local$tmp$ = void 0;
    this.local$element = void 0;
    this.local$tmp$_0 = void 0;
    this.local$uri = uri_0;
    this.local$processContext = processContext_0;
  }
  Coroutine$extractMetadata_80ka5$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$extractMetadata_80ka5$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$extractMetadata_80ka5$.prototype.constructor = Coroutine$extractMetadata_80ka5$;
  Coroutine$extractMetadata_80ka5$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$tmp$ = this.$this.pluginList.iterator();
        this.state_0 = 1;
        continue;
      case 1:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 9;
          continue;
        }
        this.local$element = this.local$tmp$.next();
        this.state_0 = 2;
        continue;
      case 2:
        this.exceptionState_0 = 5;
        this.state_0 = 3;
        this.result_0 = this.local$element.extractMetadata_80ka5$(this.local$uri, this.local$processContext, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$tmp$_0 = this.result_0;
        if (this.local$tmp$_0 == null) {
          this.exceptionState_0 = 5;
          this.state_0 = 7;
          continue;
        } else {
          this.state_0 = 4;
          continue;
        }
      case 4:
        return this.local$tmp$_0;
      case 5:
        this.exceptionState_0 = 8;
        var e_0 = this.exception_0;
        if (Kotlin.isType(e_0, Exception)) {
          if (Kotlin.isType(e_0, CancellationException)) {
            throw e_0;
          }
          printStackTrace(e_0);
        } else 
          throw e_0;
        this.state_0 = 6;
        continue;
      case 6:
        if (!false) {
          this.state_0 = 7;
          continue;
        }
        this.state_0 = 2;
        continue;
      case 7:
        this.state_0 = 1;
        continue;
      case 8:
        throw this.exception_0;
      case 9:
        throw new ContentTypeNotSupportedException('no contentType plugin support found');
      default:
        this.state_0 = 8;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 8) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  ContentPluginManager.prototype.extractMetadata_80ka5$ = function(uri_0, processContext_0, continuation_0, suspended) {
  var instance = new Coroutine$extractMetadata_80ka5$(this, uri_0, processContext_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ContentPluginManager.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContentPluginManager', 
  interfaces: []};
  function ContentPluginUploader(f) {
    this.function$ = f;
  }
  ContentPluginUploader.prototype.upload_858yfi$ = function(contentJobItem, progress, httpClient, endpoint, processContext, continuation) {
  return this.function$(contentJobItem, progress, httpClient, endpoint, processContext, continuation);
};
  ContentPluginUploader.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContentPluginUploader', 
  interfaces: []};
  function ContentTypeNotSupportedException(message, cause) {
    if (message === void 0) 
      message = null;
    if (cause === void 0) 
      cause = null;
    Exception.call(this, message, cause);
    this.name = 'ContentTypeNotSupportedException';
  }
  ContentTypeNotSupportedException.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContentTypeNotSupportedException', 
  interfaces: [Exception]};
  function DefaultContentPluginUploader(di) {
    this.di_mmbs9n$_0 = di;
  }
  Object.defineProperty(DefaultContentPluginUploader.prototype, 'di', {
  get: function() {
  return this.di_mmbs9n$_0;
}});
  function Coroutine$DefaultContentPluginUploader$upload$lambda$lambda(closure$contentJobItem_0, txDb_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$contentJobItem = closure$contentJobItem_0;
    this.local$containerEntries = void 0;
    this.local$uploadSessionUuid = void 0;
    this.local$txDb = txDb_0;
  }
  Coroutine$DefaultContentPluginUploader$upload$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$DefaultContentPluginUploader$upload$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$DefaultContentPluginUploader$upload$lambda$lambda.prototype.constructor = Coroutine$DefaultContentPluginUploader$upload$lambda$lambda;
  Coroutine$DefaultContentPluginUploader$upload$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$containerEntries = this.local$txDb.containerEntryDao.findByContainer_s8cxhz$(this.local$closure$contentJobItem.cjiContainerUid);
        this.local$uploadSessionUuid = this.local$closure$contentJobItem.cjiUploadSessionUid;
        if (this.local$uploadSessionUuid == null) {
          this.local$uploadSessionUuid = randomUuid().toString();
          this.local$closure$contentJobItem.cjiUploadSessionUid = this.local$uploadSessionUuid;
          this.state_0 = 2;
          this.result_0 = this.local$txDb.contentJobItemDao.updateUploadSessionUuid_a4hdmt$(this.local$closure$contentJobItem.cjiUid, this.local$uploadSessionUuid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        continue;
      case 3:
        return to(this.local$uploadSessionUuid, this.local$containerEntries);
      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 DefaultContentPluginUploader$upload$lambda$lambda(closure$contentJobItem_0) {
    return function(txDb_0, continuation_0, suspended) {
  var instance = new Coroutine$DefaultContentPluginUploader$upload$lambda$lambda(closure$contentJobItem_0, txDb_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$DefaultContentPluginUploader$upload$lambda$lambda_0($receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
  }
  Coroutine$DefaultContentPluginUploader$upload$lambda$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$DefaultContentPluginUploader$upload$lambda$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$DefaultContentPluginUploader$upload$lambda$lambda_0.prototype.constructor = Coroutine$DefaultContentPluginUploader$upload$lambda$lambda_0;
  Coroutine$DefaultContentPluginUploader$upload$lambda$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        return Unit;
      case 1:
        throw this.exception_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 DefaultContentPluginUploader$upload$lambda$lambda_0($receiver_0, continuation_0, suspended) {
    var instance = new Coroutine$DefaultContentPluginUploader$upload$lambda$lambda_0($receiver_0, this, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function Coroutine$DefaultContentPluginUploader$upload$lambda(closure$processContext_0, closure$contentJobItem_0, closure$endpoint_0, this$DefaultContentPluginUploader_0, closure$progress_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 7;
    this.local$closure$processContext = closure$processContext_0;
    this.local$closure$contentJobItem = closure$contentJobItem_0;
    this.local$closure$endpoint = closure$endpoint_0;
    this.local$this$DefaultContentPluginUploader = this$DefaultContentPluginUploader_0;
    this.local$closure$progress = closure$progress_0;
    this.local$c = void 0;
  }
  Coroutine$DefaultContentPluginUploader$upload$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$DefaultContentPluginUploader$upload$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$DefaultContentPluginUploader$upload$lambda.prototype.constructor = Coroutine$DefaultContentPluginUploader$upload$lambda;
  Coroutine$DefaultContentPluginUploader$upload$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.exceptionState_0 = 3;
        this.state_0 = 1;
        this.result_0 = this.local$closure$processContext.withContentJobItemTransactionMutex_fk0axj$(DefaultContentPluginUploader$upload$lambda$lambda(this.local$closure$contentJobItem), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        var tmp$_0 = this.result_0;
        var uploadSessionUuid = tmp$_0.component1(), containerEntries = tmp$_0.component2();
        var destination = ArrayList_init_0(collectionSizeOrDefault(containerEntries, 10));
        var tmp$_1;
        tmp$_1 = containerEntries.iterator();
        while (tmp$_1.hasNext()) {
          var item = tmp$_1.next();
          destination.add_11rb$(toContainerEntryWithMd5(item));
        }
        var uploadRequest = new ContainerUploaderRequest2(uploadSessionUuid, destination, this.local$closure$endpoint.url);
        tmp$ = this.local$this$DefaultContentPluginUploader.di;
        this.state_0 = 2;
        this.result_0 = (new ContainerUploader2(uploadRequest, void 0, this.local$closure$endpoint, this.local$closure$progress, tmp$)).upload(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 2:
        return this.result_0;
      case 3:
        this.exceptionState_0 = 7;
        this.local$c = this.exception_0;
        if (Kotlin.isType(this.local$c, CancellationException)) {
          this.state_0 = 4;
          this.result_0 = withContext(coroutines.NonCancellable, DefaultContentPluginUploader$upload$lambda$lambda_0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          throw this.local$c;
        }
      case 4:
        throw this.local$c;
      case 5:
        this.state_0 = 6;
        continue;
      case 6:
        return;
      case 7:
        throw this.exception_0;
      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);
};
  function DefaultContentPluginUploader$upload$lambda(closure$processContext_0, closure$contentJobItem_0, closure$endpoint_0, this$DefaultContentPluginUploader_0, closure$progress_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$DefaultContentPluginUploader$upload$lambda(closure$processContext_0, closure$contentJobItem_0, closure$endpoint_0, this$DefaultContentPluginUploader_0, closure$progress_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  DefaultContentPluginUploader.prototype.upload_858yfi$ = function(contentJobItem, progress, httpClient, endpoint, processContext, continuation) {
  return withContext(coroutines.Dispatchers.Default, DefaultContentPluginUploader$upload$lambda(processContext, contentJobItem, endpoint, this, progress), continuation);
};
  DefaultContentPluginUploader.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'DefaultContentPluginUploader', 
  interfaces: [DIAware, ContentPluginUploader]};
  function DummyContentPluginUploader() {
  }
  DummyContentPluginUploader.prototype.upload_858yfi$ = function(contentJobItem, progress, httpClient, endpoint, processContext, continuation) {
  return 24;
};
  DummyContentPluginUploader.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'DummyContentPluginUploader', 
  interfaces: [ContentPluginUploader]};
  function FatalContentJobException(message, cause) {
    if (message === void 0) 
      message = null;
    if (cause === void 0) 
      cause = null;
    Exception.call(this, message, cause);
    this.name = 'FatalContentJobException';
  }
  FatalContentJobException.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'FatalContentJobException', 
  interfaces: [Exception]};
  function JobConnectivityLiveData(connectivityLiveData, meteredAllowedLiveData) {
    DoorMediatorLiveData.call(this);
    this.connectivityLiveData = connectivityLiveData;
    this.meteredAllowedLiveData = meteredAllowedLiveData;
    this.connectivityState = null;
    this.meteredConnectionAllowed = null;
    this.addSource_hfkt56$(this.connectivityLiveData.liveData, new DoorObserver(JobConnectivityLiveData_init$lambda(this)));
    this.addSource_hfkt56$(this.meteredAllowedLiveData, new DoorObserver(JobConnectivityLiveData_init$lambda_0(this)));
  }
  function JobConnectivityLiveData_init$lambda(this$JobConnectivityLiveData) {
    return function(it) {
  var tmp$;
  if (it == null || it.connectivityState === this$JobConnectivityLiveData.connectivityState) {
    return;
  }
  this$JobConnectivityLiveData.connectivityState = it.connectivityState;
  tmp$ = this$JobConnectivityLiveData.meteredConnectionAllowed;
  if (tmp$ == null) {
    return;
  }
  var meteredAllowed = tmp$;
  this$JobConnectivityLiveData.setVal_11rb$(new Pair(it.connectivityState, meteredAllowed));
  return Unit;
};
  }
  function JobConnectivityLiveData_init$lambda_0(this$JobConnectivityLiveData) {
    return function(it) {
  var tmp$;
  if (it === this$JobConnectivityLiveData.meteredConnectionAllowed) {
    return;
  }
  this$JobConnectivityLiveData.meteredConnectionAllowed = it;
  tmp$ = this$JobConnectivityLiveData.connectivityState;
  if (tmp$ == null) {
    return;
  }
  var connectivityState = tmp$;
  this$JobConnectivityLiveData.setVal_11rb$(new Pair(connectivityState, it));
  return Unit;
};
  }
  JobConnectivityLiveData.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'JobConnectivityLiveData', 
  interfaces: [DoorMediatorLiveData]};
  function MetadataResult(entry, pluginId) {
    MetadataResult$Companion_getInstance();
    this.entry = entry;
    this.pluginId = pluginId;
  }
  function MetadataResult$Companion() {
    MetadataResult$Companion_instance = this;
    this.UPLOAD_TMP_PROTO_NAME = 'upload-tmp';
    this.UPLOAD_TMP_LOCATOR_PREFIX = 'upload-tmp:///';
  }
  MetadataResult$Companion.prototype.serializer = function() {
  return MetadataResult$$serializer_getInstance();
};
  MetadataResult$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var MetadataResult$Companion_instance = null;
  function MetadataResult$Companion_getInstance() {
    if (MetadataResult$Companion_instance === null) {
      new MetadataResult$Companion();
    }
    return MetadataResult$Companion_instance;
  }
  function MetadataResult$$serializer() {
    this.descriptor_brrtsc$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentjob.MetadataResult', this, 2);
    this.descriptor.addElement_ivxn3r$('entry', false);
    this.descriptor.addElement_ivxn3r$('pluginId', false);
    MetadataResult$$serializer_instance = this;
  }
  Object.defineProperty(MetadataResult$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_brrtsc$_0;
}});
  MetadataResult$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  output.encodeSerializableElement_r4qlx7$(this.descriptor, 0, ContentEntryWithLanguage.$serializer, value.entry);
  output.encodeIntElement_ptg7oe$(this.descriptor, 1, value.pluginId);
  output.endStructure_24f42q$(this.descriptor);
};
  MetadataResult$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeSerializableElement_12e8id$(this.descriptor, 0, ContentEntryWithLanguage.$serializer, local0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeIntElement_szpzho$(this.descriptor, 1);
          bitMask0 |= 2;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return MetadataResult_init(bitMask0, local0, local1, null);
};
  MetadataResult$$serializer.prototype.childSerializers = function() {
  return [ContentEntryWithLanguage.$serializer, internal.IntSerializer];
};
  MetadataResult$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var MetadataResult$$serializer_instance = null;
  function MetadataResult$$serializer_getInstance() {
    if (MetadataResult$$serializer_instance === null) {
      new MetadataResult$$serializer();
    }
    return MetadataResult$$serializer_instance;
  }
  function MetadataResult_init(seen1, entry, pluginId, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(MetadataResult.prototype);
    if ((seen1 & 1) === 0) 
      throw MissingFieldException_init('entry');
    else 
      $this.entry = entry;
    if ((seen1 & 2) === 0) 
      throw MissingFieldException_init('pluginId');
    else 
      $this.pluginId = pluginId;
    return $this;
  }
  MetadataResult.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'MetadataResult', 
  interfaces: []};
  MetadataResult.prototype.component1 = function() {
  return this.entry;
};
  MetadataResult.prototype.component2 = function() {
  return this.pluginId;
};
  MetadataResult.prototype.copy_srzpld$ = function(entry, pluginId) {
  return new MetadataResult(entry === void 0 ? this.entry : entry, pluginId === void 0 ? this.pluginId : pluginId);
};
  MetadataResult.prototype.toString = function() {
  return 'MetadataResult(entry=' + Kotlin.toString(this.entry) + (', pluginId=' + Kotlin.toString(this.pluginId)) + ')';
};
  MetadataResult.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.entry) | 0;
  result = result * 31 + Kotlin.hashCode(this.pluginId) | 0;
  return result;
};
  MetadataResult.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.entry, other.entry) && Kotlin.equals(this.pluginId, other.pluginId)))));
};
  function ProcessResult(status, reason) {
    if (reason === void 0) 
      reason = null;
    this.status = status;
    this.reason = reason;
  }
  ProcessResult.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ProcessResult', 
  interfaces: []};
  ProcessResult.prototype.component1 = function() {
  return this.status;
};
  ProcessResult.prototype.component2 = function() {
  return this.reason;
};
  ProcessResult.prototype.copy_vqvrqt$ = function(status, reason) {
  return new ProcessResult(status === void 0 ? this.status : status, reason === void 0 ? this.reason : reason);
};
  ProcessResult.prototype.toString = function() {
  return 'ProcessResult(status=' + Kotlin.toString(this.status) + (', reason=' + Kotlin.toString(this.reason)) + ')';
};
  ProcessResult.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.status) | 0;
  result = result * 31 + Kotlin.hashCode(this.reason) | 0;
  return result;
};
  ProcessResult.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.status, other.status) && Kotlin.equals(this.reason, other.reason)))));
};
  function SupportedContent() {
    SupportedContent_instance = this;
    this.EPUB_MIME_TYPES = listOf(['application/epub+zip', 'application/octet-stream']);
    this.XAPI_MIME_TYPES = listOf(['application/tincan+zip', 'application/zip', 'application/octet-stream']);
    this.H5P_MIME_TYPES = listOf(['application/h5p-tincan+zip', 'application/tincan+zip', 'application/zip', 'application/octet-stream']);
    this.SCORM_MIME_TYPES = listOf_0('application/scorm+zip');
    this.H5P_EXTENSIONS = listOf_0('h5p');
    this.EPUB_EXTENSIONS = listOf_0('epub');
    this.ZIP_EXTENSIONS = listOf_0('zip');
  }
  SupportedContent.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'SupportedContent', 
  interfaces: []};
  var SupportedContent_instance = null;
  function SupportedContent_getInstance() {
    if (SupportedContent_instance === null) {
      new SupportedContent();
    }
    return SupportedContent_instance;
  }
  function UploadResult(status, metadataResult) {
    UploadResult$Companion_getInstance();
    this.status = status;
    this.metadataResult = metadataResult;
  }
  function UploadResult$Companion() {
    UploadResult$Companion_instance = this;
    this.UPLOAD_TMP_PROTO_NAME = 'upload-tmp';
    this.UPLOAD_TMP_LOCATOR_PREFIX = 'upload-tmp:///';
  }
  UploadResult$Companion.prototype.serializer = function() {
  return UploadResult$$serializer_getInstance();
};
  UploadResult$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var UploadResult$Companion_instance = null;
  function UploadResult$Companion_getInstance() {
    if (UploadResult$Companion_instance === null) {
      new UploadResult$Companion();
    }
    return UploadResult$Companion_instance;
  }
  function UploadResult$$serializer() {
    this.descriptor_rntcpq$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.contentjob.UploadResult', this, 2);
    this.descriptor.addElement_ivxn3r$('status', false);
    this.descriptor.addElement_ivxn3r$('metadataResult', false);
    UploadResult$$serializer_instance = this;
  }
  Object.defineProperty(UploadResult$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_rntcpq$_0;
}});
  UploadResult$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  output.encodeIntElement_ptg7oe$(this.descriptor, 0, value.status);
  output.encodeNullableSerializableElement_qw92s8$(this.descriptor, 1, MetadataResult$$serializer_getInstance(), value.metadataResult);
  output.endStructure_24f42q$(this.descriptor);
};
  UploadResult$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeIntElement_szpzho$(this.descriptor, 0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeNullableSerializableElement_8viuyw$(this.descriptor, 1, MetadataResult$$serializer_getInstance(), local1);
          bitMask0 |= 2;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return UploadResult_init(bitMask0, local0, local1, null);
};
  UploadResult$$serializer.prototype.childSerializers = function() {
  return [internal.IntSerializer, new NullableSerializer(MetadataResult$$serializer_getInstance())];
};
  UploadResult$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var UploadResult$$serializer_instance = null;
  function UploadResult$$serializer_getInstance() {
    if (UploadResult$$serializer_instance === null) {
      new UploadResult$$serializer();
    }
    return UploadResult$$serializer_instance;
  }
  function UploadResult_init(seen1, status, metadataResult, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(UploadResult.prototype);
    if ((seen1 & 1) === 0) 
      throw MissingFieldException_init('status');
    else 
      $this.status = status;
    if ((seen1 & 2) === 0) 
      throw MissingFieldException_init('metadataResult');
    else 
      $this.metadataResult = metadataResult;
    return $this;
  }
  UploadResult.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UploadResult', 
  interfaces: []};
  function AboutPresenter(context, args, view, di) {
    UstadBaseController.call(this, context, ensureNotNull(args), view, di);
    var tmp$;
    this.impl_k4ew5y$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, AboutPresenter$impl_metadata);
  }
  var AboutPresenter$impl_metadata = new PropertyMetadata('impl');
  Object.defineProperty(AboutPresenter.prototype, 'impl', {
  configurable: true, 
  get: function() {
  return this.impl_k4ew5y$_0.value;
}});
  AboutPresenter.prototype.onCreate = function(savedState) {
  UstadBaseController.prototype.onCreate.call(this, savedState);
  this.view.setVersionInfo_61zpoe$(this.impl.getVersion_za3rmp$(this.context) + ' - ' + UMCalendarUtil_getInstance().makeHTTPDate_s8cxhz$(this.impl.getBuildTimestamp_za3rmp$(this.context)) + '\n');
};
  AboutPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'AboutPresenter', 
  interfaces: [UstadBaseController]};
  function AccountListPresenter(context, arguments_0, view, di, doorLifecycleOwner) {
    UstadBaseController.call(this, context, arguments_0, view, di, false);
    this.doorLifecycleOwner = doorLifecycleOwner;
    var tmp$;
    this.accountManager_ljzzjg$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, AccountListPresenter$accountManager_metadata);
    var tmp$_0;
    this.impl_q3lbn8$_0 = Instance(this, Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, AccountListPresenter$impl_metadata);
    this.endpointFilter_0 = null;
    this.activeAccountMode_pwepa6$_0 = this.activeAccountMode_pwepa6$_0;
    this.nextDest_nas09j$_0 = this.nextDest_nas09j$_0;
    this.accountListMediator_0 = new DoorMediatorLiveData();
  }
  var AccountListPresenter$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(AccountListPresenter.prototype, 'accountManager_0', {
  configurable: true, 
  get: function() {
  return this.accountManager_ljzzjg$_0.value;
}});
  var AccountListPresenter$impl_metadata = new PropertyMetadata('impl');
  Object.defineProperty(AccountListPresenter.prototype, 'impl_0', {
  configurable: true, 
  get: function() {
  return this.impl_q3lbn8$_0.value;
}});
  Object.defineProperty(AccountListPresenter.prototype, 'activeAccountMode_0', {
  configurable: true, 
  get: function() {
  if (this.activeAccountMode_pwepa6$_0 == null) 
    return throwUPAE('activeAccountMode');
  return this.activeAccountMode_pwepa6$_0;
}, 
  set: function(activeAccountMode) {
  this.activeAccountMode_pwepa6$_0 = activeAccountMode;
}});
  Object.defineProperty(AccountListPresenter.prototype, 'nextDest_0', {
  configurable: true, 
  get: function() {
  if (this.nextDest_nas09j$_0 == null) 
    return throwUPAE('nextDest');
  return this.nextDest_nas09j$_0;
}, 
  set: function(nextDest) {
  this.nextDest_nas09j$_0 = nextDest;
}});
  function AccountListPresenter$onCreate$lambda$lambda(this$AccountListPresenter) {
    return function(it) {
  var tmp$, tmp$_0;
  return equals(it.userSession.usUid, (tmp$_0 = (tmp$ = this$AccountListPresenter.accountManager_0.activeSession) != null ? tmp$.userSession : null) != null ? tmp$_0.usUid : null);
};
  }
  function AccountListPresenter$onCreate$lambda$lambda_0(this$AccountListPresenter) {
    return function(it) {
  return !equals(it.endpoint.url, this$AccountListPresenter.endpointFilter_0);
};
  }
  function AccountListPresenter$onCreate$lambda$lambda$lambda(closure$maxDateOfBirth) {
    return function(it) {
  return it.person.dateOfBirth.compareTo_11rb$(closure$maxDateOfBirth) > 0;
};
  }
  function AccountListPresenter$onCreate$lambda(this$AccountListPresenter) {
    return function(sessionList) {
  var tmp$;
  var newList = toMutableList(sessionList);
  if (equals(this$AccountListPresenter.activeAccountMode_0, AccountListView$Companion_getInstance().ACTIVE_ACCOUNT_MODE_HEADER)) 
    removeAll(newList, AccountListPresenter$onCreate$lambda$lambda(this$AccountListPresenter));
  if (this$AccountListPresenter.endpointFilter_0 != null) {
    removeAll(newList, AccountListPresenter$onCreate$lambda$lambda_0(this$AccountListPresenter));
  }
  if ((tmp$ = this$AccountListPresenter.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_MAX_DATE_OF_BIRTH)) != null) {
    var maxDateOfBirth = toLong(tmp$);
    removeAll(newList, AccountListPresenter$onCreate$lambda$lambda$lambda(maxDateOfBirth));
  }
  this$AccountListPresenter.accountListMediator_0.sendValue_11rb$(newList);
  return Unit;
};
  }
  AccountListPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1;
  UstadBaseController.prototype.onCreate.call(this, savedState);
  this.endpointFilter_0 = this.arguments.get_11rb$(AccountListView$Companion_getInstance().ARG_FILTER_BY_ENDPOINT);
  this.activeAccountMode_0 = (tmp$ = this.arguments.get_11rb$(AccountListView$Companion_getInstance().ARG_ACTIVE_ACCOUNT_MODE)) != null ? tmp$ : AccountListView$Companion_getInstance().ACTIVE_ACCOUNT_MODE_HEADER;
  this.view.activeAccountLive = equals(this.activeAccountMode_0, AccountListView$Companion_getInstance().ACTIVE_ACCOUNT_MODE_HEADER) ? this.accountManager_0.activeUserSessionLive : null;
  this.view.accountListLive = this.accountListMediator_0;
  this.accountListMediator_0.addSource_hfkt56$(this.accountManager_0.activeUserSessionsLive, new DoorObserver(AccountListPresenter$onCreate$lambda(this)));
  this.nextDest_0 = (tmp$_0 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_NEXT)) != null ? tmp$_0 : this.impl_0.getAppConfigDefaultFirstDest_za3rmp$(this.context);
  this.view.intentMessage = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_INTENT_MESSAGE);
  this.view.title = (tmp$_1 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_TITLE)) != null ? tmp$_1 : this.impl_0.getString(2080, this.context);
};
  AccountListPresenter.prototype.handleClickAddAccount = function() {
  var tmp$;
  var filterByEndpoint = this.arguments.get_11rb$(AccountListView$Companion_getInstance().ARG_FILTER_BY_ENDPOINT);
  if (filterByEndpoint != null) {
    var args = mapOf([to(UstadView$Companion_getInstance().ARG_SERVER_URL, filterByEndpoint), to(UstadView$Companion_getInstance().ARG_NEXT, this.nextDest_0), to(UstadView$Companion_getInstance().ARG_MAX_DATE_OF_BIRTH, (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_MAX_DATE_OF_BIRTH)) != null ? tmp$ : '0')]);
    this.impl_0.go_gofqk3$(Login2View$Companion_getInstance().VIEW_NAME, args, this.context);
  } else {
    var canSelectServer = UmPlatformUtil_getInstance().isWeb ? false : this.impl_0.getAppConfigBoolean_bm4g0d$(AppConfig_getInstance().KEY_ALLOW_SERVER_SELECTION, this.context);
    var $receiver = toMutableMap(this.arguments);
    putIfNotAlreadySet($receiver, UstadView$Companion_getInstance().ARG_NEXT, this.nextDest_0);
    var args_0 = $receiver;
    this.impl_0.go_gofqk3$(canSelectServer ? SiteEnterLinkView$Companion_getInstance().VIEW_NAME : Login2View$Companion_getInstance().VIEW_NAME, args_0, this.context);
  }
};
  function Coroutine$AccountListPresenter$handleClickDeleteSession$lambda(this$AccountListPresenter_0, closure$session_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$AccountListPresenter = this$AccountListPresenter_0;
    this.local$closure$session = closure$session_0;
  }
  Coroutine$AccountListPresenter$handleClickDeleteSession$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$AccountListPresenter$handleClickDeleteSession$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$AccountListPresenter$handleClickDeleteSession$lambda.prototype.constructor = Coroutine$AccountListPresenter$handleClickDeleteSession$lambda;
  Coroutine$AccountListPresenter$handleClickDeleteSession$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$AccountListPresenter.accountManager_0.endSession_ymrki2$(this.local$closure$session, void 0, void 0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 AccountListPresenter$handleClickDeleteSession$lambda(this$AccountListPresenter_0, closure$session_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$AccountListPresenter$handleClickDeleteSession$lambda(this$AccountListPresenter_0, closure$session_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  AccountListPresenter.prototype.handleClickDeleteSession_n02xme$ = function(session) {
  launch(this.presenterScope, void 0, void 0, AccountListPresenter$handleClickDeleteSession$lambda(this, session));
};
  AccountListPresenter.prototype.handleClickProfile_s8cxhz$ = function(personUid) {
  this.impl_0.go_gofqk3$(PersonDetailView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, personUid.toString())), this.context);
};
  AccountListPresenter.prototype.handleClickAbout = function() {
  this.impl_0.goToViewLink_yzvld8$(AboutView$Companion_getInstance().VIEW_NAME, this.context);
};
  function Coroutine$AccountListPresenter$handleClickLogout$lambda(this$AccountListPresenter_0, closure$session_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$AccountListPresenter = this$AccountListPresenter_0;
    this.local$closure$session = closure$session_0;
  }
  Coroutine$AccountListPresenter$handleClickLogout$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$AccountListPresenter$handleClickLogout$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$AccountListPresenter$handleClickLogout$lambda.prototype.constructor = Coroutine$AccountListPresenter$handleClickLogout$lambda;
  Coroutine$AccountListPresenter$handleClickLogout$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$AccountListPresenter.accountManager_0.endSession_ymrki2$(this.local$closure$session, void 0, void 0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        this.result_0 = this.local$this$AccountListPresenter.navigateToStartNewUserSession(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 AccountListPresenter$handleClickLogout$lambda(this$AccountListPresenter_0, closure$session_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$AccountListPresenter$handleClickLogout$lambda(this$AccountListPresenter_0, closure$session_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  AccountListPresenter.prototype.handleClickLogout_n02xme$ = function(session) {
  launch(this.presenterScope, void 0, void 0, AccountListPresenter$handleClickLogout$lambda(this, session));
};
  AccountListPresenter.prototype.handleClickUserSession_n02xme$ = function(session) {
  var tmp$, tmp$_0;
  this.accountManager_0.activeSession = session;
  var goOptions = new UstadMobileSystemCommon$UstadGoOptions((tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_POPUPTO_ON_FINISH)) != null ? tmp$ : UstadView$Companion_getInstance().ROOT_DEST, false);
  var snackMsg = replace(replace(this.impl_0.getString(2636, this.context), '%1$s', (tmp$_0 = session.person.username) != null ? tmp$_0 : ''), '%2$s', session.endpoint.url);
  var dest = appendQueryArgs(this.nextDest_0, toQueryString(mapOf_0(to(UstadView$Companion_getInstance().ARG_SNACK_MESSAGE, snackMsg))));
  this.impl_0.goToViewLink_yzvld8$(dest, this.context, goOptions);
};
  AccountListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'AccountListPresenter', 
  interfaces: [UstadBaseController]};
  function AttemptListListener() {
  }
  AttemptListListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'AttemptListListener', 
  interfaces: []};
  function BitmaskEditPresenter(context, arguments_0, view, di, lifecycleOwner) {
    BitmaskEditPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(BitmaskEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$JSON_getInstance();
}});
  BitmaskEditPresenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
};
  BitmaskEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db, continuation) {
  var tmp$, tmp$_0;
  var entityUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  return null;
};
  BitmaskEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  var longWrapper = {
  v: null};
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = LongWrapper$Companion_getInstance().serializer();
    var tmp$;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
    longWrapper.v = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    longWrapper.v = new LongWrapper(L0);
  }
  var tmp$_0 = this.view;
  var $receiver = BitmaskEditPresenter$Companion_getInstance().FLAGS_AVAILABLE;
  var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
  var tmp$_1;
  tmp$_1 = $receiver.iterator();
  while (tmp$_1.hasNext()) {
    var item = tmp$_1.next();
    destination.add_11rb$(new BitmaskFlag(item.flagVal, item.messageId, equals(longWrapper.v.longValue.and(item.flagVal), item.flagVal)));
  }
  tmp$_0.bitmaskList = DoorMutableLiveData_init_0(destination);
  return longWrapper.v;
};
  BitmaskEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  BitmaskEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  var tmp$, tmp$_0, tmp$_1;
  var tmp$_2;
  if ((tmp$_0 = (tmp$ = this.view.bitmaskList) != null ? tmp$.getValue() : null) != null) {
    var tmp$_3;
    var accumulator = L0;
    tmp$_3 = tmp$_0.iterator();
    while (tmp$_3.hasNext()) {
      var element = tmp$_3.next();
      accumulator = accumulator.add(element.enabled ? element.flagVal : L0);
    }
    tmp$_2 = accumulator;
  } else 
    tmp$_2 = null;
  var saveVal = (tmp$_1 = tmp$_2) != null ? tmp$_1 : L0;
  var di = this.di;
  var strategy = ListSerializer(LongWrapper$Companion_getInstance().serializer());
  var entity_0 = listOf_0(new LongWrapper(saveVal));
  var tmp$_4;
  var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_4 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_4 : throwCCE(), null);
  this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity_0));
};
  function BitmaskEditPresenter$Companion() {
    BitmaskEditPresenter$Companion_instance = this;
    this.FLAGS_AVAILABLE = listOf([new BitmaskFlag(Clazz$Companion$CLAZZ_FEATURE_ATTENDANCE, 2068, false), new BitmaskFlag(Clazz$Companion$CLAZZ_FEATURE_CLAZZ_ASSIGNMENT, 2530, false)]);
  }
  BitmaskEditPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var BitmaskEditPresenter$Companion_instance = null;
  function BitmaskEditPresenter$Companion_getInstance() {
    if (BitmaskEditPresenter$Companion_instance === null) {
      new BitmaskEditPresenter$Companion();
    }
    return BitmaskEditPresenter$Companion_instance;
  }
  BitmaskEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'BitmaskEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function ChatDetailPresenter(context, arguments_0, view, di) {
    ChatDetailPresenter$Companion_getInstance();
    UstadBaseController.call(this, context, arguments_0, view, di);
    var tmp$;
    this.accountManager_394l94$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, ChatDetailPresenter$accountManager_metadata);
    var context_0 = this.accountManager.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_0;
    var tmp$_1;
    this.db_58j0x6$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_0 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_1 : throwCCE(), 1).provideDelegate_tpuvb9$(this, ChatDetailPresenter$db_metadata);
    var context_1 = this.accountManager.activeAccount;
    var trigger_0;
    trigger_0 = this.diTrigger;
    var tmp$_2;
    var tmp$_3;
    this.repo_abc2ve$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_2 : throwCCE(), context_1), trigger_0), Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_3 : throwCCE(), 2).provideDelegate_tpuvb9$(this, ChatDetailPresenter$repo_metadata);
    this.chatUid = L0;
    this.otherPersonUid = L0;
    this.loggedInPersonUid = L0;
    this.ps = this.presenterScope;
  }
  var ChatDetailPresenter$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(ChatDetailPresenter.prototype, 'accountManager', {
  configurable: true, 
  get: function() {
  return this.accountManager_394l94$_0.value;
}});
  var ChatDetailPresenter$db_metadata = new PropertyMetadata('db');
  Object.defineProperty(ChatDetailPresenter.prototype, 'db', {
  configurable: true, 
  get: function() {
  return this.db_58j0x6$_0.value;
}});
  var ChatDetailPresenter$repo_metadata = new PropertyMetadata('repo');
  Object.defineProperty(ChatDetailPresenter.prototype, 'repo', {
  configurable: true, 
  get: function() {
  return this.repo_abc2ve$_0.value;
}});
  function Coroutine$ChatDetailPresenter$onCreate$lambda(this$ChatDetailPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ChatDetailPresenter = this$ChatDetailPresenter_0;
  }
  Coroutine$ChatDetailPresenter$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ChatDetailPresenter$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ChatDetailPresenter$onCreate$lambda.prototype.constructor = Coroutine$ChatDetailPresenter$onCreate$lambda;
  Coroutine$ChatDetailPresenter$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        this.state_0 = 2;
        this.result_0 = this.local$this$ChatDetailPresenter.repo.chatDao.getTitleChat_3pjtqy$(this.local$this$ChatDetailPresenter.chatUid, this.local$this$ChatDetailPresenter.loggedInPersonUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var chatTitle = this.result_0;
        this.local$this$ChatDetailPresenter.view.title = chatTitle;
        if (equals(this.local$this$ChatDetailPresenter.chatUid, L0)) {
          this.state_0 = 3;
          this.result_0 = this.local$this$ChatDetailPresenter.repo.chatDao.getChatByOtherPerson_3pjtqy$(this.local$this$ChatDetailPresenter.otherPersonUid, this.local$this$ChatDetailPresenter.loggedInPersonUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 4;
          continue;
        }
      case 3:
        this.local$this$ChatDetailPresenter.chatUid = (tmp$_0 = (tmp$ = this.result_0) != null ? tmp$.chatUid : null) != null ? tmp$_0 : L0;
        return this.local$this$ChatDetailPresenter.view.messageList = this.local$this$ChatDetailPresenter.repo.messageDao.findAllMessagesByChatUid_ro19vi$(this.local$this$ChatDetailPresenter.chatUid, 127, this.local$this$ChatDetailPresenter.loggedInPersonUid) , Unit;
      case 4:
        return Unit;
      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 ChatDetailPresenter$onCreate$lambda(this$ChatDetailPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ChatDetailPresenter$onCreate$lambda(this$ChatDetailPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ChatDetailPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  UstadBaseController.prototype.onCreate.call(this, savedState);
  this.chatUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  this.otherPersonUid = (tmp$_2 = (tmp$_1 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_PERSON_UID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0;
  this.loggedInPersonUid = this.accountManager.activeAccount.personUid;
  this.view.messageList = this.repo.messageDao.findAllMessagesByChatUid_ro19vi$(this.chatUid, 127, this.loggedInPersonUid);
  launch(this.presenterScope, void 0, void 0, ChatDetailPresenter$onCreate$lambda(this));
};
  function Coroutine$ChatDetailPresenter$addMessage$lambda$lambda(this$ChatDetailPresenter_0, closure$isGroup_0, closure$loggedInPersonUid_0, closure$message_0, txRepo_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$this$ChatDetailPresenter = this$ChatDetailPresenter_0;
    this.local$closure$isGroup = closure$isGroup_0;
    this.local$closure$loggedInPersonUid = closure$loggedInPersonUid_0;
    this.local$closure$message = closure$message_0;
    this.local$txRepo = txRepo_0;
  }
  Coroutine$ChatDetailPresenter$addMessage$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ChatDetailPresenter$addMessage$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ChatDetailPresenter$addMessage$lambda$lambda.prototype.constructor = Coroutine$ChatDetailPresenter$addMessage$lambda$lambda;
  Coroutine$ChatDetailPresenter$addMessage$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (equals(this.local$this$ChatDetailPresenter.chatUid, L0)) {
          this.state_0 = 2;
          this.result_0 = this.local$txRepo.chatDao.insertAsync(Chat_init('', this.local$closure$isGroup), this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 6;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.local$this$ChatDetailPresenter.chatUid = this.result_0;
        this.state_0 = 3;
        this.result_0 = this.local$txRepo.chatMemberDao.insertAsync(ChatMember_init(this.local$this$ChatDetailPresenter.chatUid, this.local$closure$loggedInPersonUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        if (!this.local$closure$isGroup && !equals(this.local$this$ChatDetailPresenter.otherPersonUid, L0)) {
          this.state_0 = 4;
          this.result_0 = this.local$txRepo.chatMemberDao.insertAsync(ChatMember_init(this.local$this$ChatDetailPresenter.chatUid, this.local$this$ChatDetailPresenter.otherPersonUid), this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 5;
          continue;
        }
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        this.state_0 = 6;
        continue;
      case 6:
        this.state_0 = 7;
        this.result_0 = this.local$txRepo.messageDao.insertAsync(Message_init(this.local$closure$loggedInPersonUid, 127, this.local$this$ChatDetailPresenter.chatUid, this.local$closure$message), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 7:
        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 ChatDetailPresenter$addMessage$lambda$lambda(this$ChatDetailPresenter_0, closure$isGroup_0, closure$loggedInPersonUid_0, closure$message_0) {
    return function(txRepo_0, continuation_0, suspended) {
  var instance = new Coroutine$ChatDetailPresenter$addMessage$lambda$lambda(this$ChatDetailPresenter_0, closure$isGroup_0, closure$loggedInPersonUid_0, closure$message_0, txRepo_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ChatDetailPresenter$addMessage$lambda(this$ChatDetailPresenter_0, closure$message_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ChatDetailPresenter = this$ChatDetailPresenter_0;
    this.local$closure$message = closure$message_0;
    this.local$updateListNeeded = void 0;
    this.local$loggedInPersonUid = void 0;
  }
  Coroutine$ChatDetailPresenter$addMessage$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ChatDetailPresenter$addMessage$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ChatDetailPresenter$addMessage$lambda.prototype.constructor = Coroutine$ChatDetailPresenter$addMessage$lambda;
  Coroutine$ChatDetailPresenter$addMessage$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$updateListNeeded = equals(this.local$this$ChatDetailPresenter.chatUid, L0);
        var isGroup = this.local$this$ChatDetailPresenter.arguments.get_11rb$(ChatDetailPresenter$Companion_getInstance().ARG_CHAT_IS_GROUP) != null;
        this.local$loggedInPersonUid = this.local$this$ChatDetailPresenter.accountManager.activeAccount.personUid;
        this.state_0 = 2;
        this.result_0 = withDoorTransactionAsync(this.local$this$ChatDetailPresenter.repo, getKClass(UmAppDatabase), ChatDetailPresenter$addMessage$lambda$lambda(this.local$this$ChatDetailPresenter, isGroup, this.local$loggedInPersonUid, this.local$closure$message), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (this.local$updateListNeeded) {
          return this.local$this$ChatDetailPresenter.view.messageList = this.local$this$ChatDetailPresenter.repo.messageDao.findAllMessagesByChatUid_ro19vi$(this.local$this$ChatDetailPresenter.chatUid, 127, this.local$loggedInPersonUid) , Unit;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 3:
        return Unit;
      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 ChatDetailPresenter$addMessage$lambda(this$ChatDetailPresenter_0, closure$message_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ChatDetailPresenter$addMessage$lambda(this$ChatDetailPresenter_0, closure$message_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ChatDetailPresenter.prototype.addMessage_61zpoe$ = function(message) {
  launch(this.presenterScope, void 0, void 0, ChatDetailPresenter$addMessage$lambda(this, message));
};
  function Coroutine$ChatDetailPresenter$updateMessageRead$lambda$lambda(closure$messageRead_0, txRepo_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$messageRead = closure$messageRead_0;
    this.local$txRepo = txRepo_0;
  }
  Coroutine$ChatDetailPresenter$updateMessageRead$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ChatDetailPresenter$updateMessageRead$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ChatDetailPresenter$updateMessageRead$lambda$lambda.prototype.constructor = Coroutine$ChatDetailPresenter$updateMessageRead$lambda$lambda;
  Coroutine$ChatDetailPresenter$updateMessageRead$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$txRepo.messageReadDao.insertAsync(this.local$closure$messageRead, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ChatDetailPresenter$updateMessageRead$lambda$lambda(closure$messageRead_0) {
    return function(txRepo_0, continuation_0, suspended) {
  var instance = new Coroutine$ChatDetailPresenter$updateMessageRead$lambda$lambda(closure$messageRead_0, txRepo_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ChatDetailPresenter$updateMessageRead$lambda(this$ChatDetailPresenter_0, closure$messageRead_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ChatDetailPresenter = this$ChatDetailPresenter_0;
    this.local$closure$messageRead = closure$messageRead_0;
  }
  Coroutine$ChatDetailPresenter$updateMessageRead$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ChatDetailPresenter$updateMessageRead$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ChatDetailPresenter$updateMessageRead$lambda.prototype.constructor = Coroutine$ChatDetailPresenter$updateMessageRead$lambda;
  Coroutine$ChatDetailPresenter$updateMessageRead$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = withDoorTransactionAsync(this.local$this$ChatDetailPresenter.repo, getKClass(UmAppDatabase), ChatDetailPresenter$updateMessageRead$lambda$lambda(this.local$closure$messageRead), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ChatDetailPresenter$updateMessageRead$lambda(this$ChatDetailPresenter_0, closure$messageRead_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ChatDetailPresenter$updateMessageRead$lambda(this$ChatDetailPresenter_0, closure$messageRead_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ChatDetailPresenter.prototype.updateMessageRead_q6ck09$ = function(messageRead) {
  launch(this.presenterScope, void 0, void 0, ChatDetailPresenter$updateMessageRead$lambda(this, messageRead));
};
  function Coroutine$ChatDetailPresenter$updateMessageReadList$lambda$lambda(closure$messageReadList_0, txRepo_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$messageReadList = closure$messageReadList_0;
    this.local$txRepo = txRepo_0;
  }
  Coroutine$ChatDetailPresenter$updateMessageReadList$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ChatDetailPresenter$updateMessageReadList$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ChatDetailPresenter$updateMessageReadList$lambda$lambda.prototype.constructor = Coroutine$ChatDetailPresenter$updateMessageReadList$lambda$lambda;
  Coroutine$ChatDetailPresenter$updateMessageReadList$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        return this.local$txRepo.messageReadDao.insertList_4ezy5m$(this.local$closure$messageReadList) , Unit;
      case 1:
        throw this.exception_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 ChatDetailPresenter$updateMessageReadList$lambda$lambda(closure$messageReadList_0) {
    return function(txRepo_0, continuation_0, suspended) {
  var instance = new Coroutine$ChatDetailPresenter$updateMessageReadList$lambda$lambda(closure$messageReadList_0, txRepo_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ChatDetailPresenter$updateMessageReadList$lambda(this$ChatDetailPresenter_0, closure$messageReadList_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ChatDetailPresenter = this$ChatDetailPresenter_0;
    this.local$closure$messageReadList = closure$messageReadList_0;
  }
  Coroutine$ChatDetailPresenter$updateMessageReadList$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ChatDetailPresenter$updateMessageReadList$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ChatDetailPresenter$updateMessageReadList$lambda.prototype.constructor = Coroutine$ChatDetailPresenter$updateMessageReadList$lambda;
  Coroutine$ChatDetailPresenter$updateMessageReadList$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = withDoorTransactionAsync(this.local$this$ChatDetailPresenter.repo, getKClass(UmAppDatabase), ChatDetailPresenter$updateMessageReadList$lambda$lambda(this.local$closure$messageReadList), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ChatDetailPresenter$updateMessageReadList$lambda(this$ChatDetailPresenter_0, closure$messageReadList_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ChatDetailPresenter$updateMessageReadList$lambda(this$ChatDetailPresenter_0, closure$messageReadList_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ChatDetailPresenter.prototype.updateMessageReadList_5to0km$ = function(messageReadList) {
  launch(this.presenterScope, void 0, void 0, ChatDetailPresenter$updateMessageReadList$lambda(this, messageReadList));
};
  function ChatDetailPresenter$Companion() {
    ChatDetailPresenter$Companion_instance = this;
    this.ARG_CHAT_IS_GROUP = 'isChatGroup';
  }
  ChatDetailPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ChatDetailPresenter$Companion_instance = null;
  function ChatDetailPresenter$Companion_getInstance() {
    if (ChatDetailPresenter$Companion_instance === null) {
      new ChatDetailPresenter$Companion();
    }
    return ChatDetailPresenter$Companion_instance;
  }
  ChatDetailPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ChatDetailPresenter', 
  interfaces: [MessagesPresenter, UstadBaseController]};
  function ChatListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    ChatListPresenter$Companion_getInstance();
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.searchText = null;
    this.loggedInPersonUid = L0;
  }
  ChatListPresenter.prototype.onCreate = function(savedState) {
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.loggedInPersonUid = this.accountManager.activeAccount.personUid;
  this.updateListOnView_0();
};
  ChatListPresenter.prototype.updateListOnView_0 = function() {
  this.view.list = this.repo.chatDao.findAllChatsForUser_4wgjuj$(toQueryLikeParam(this.searchText), this.loggedInPersonUid);
};
  ChatListPresenter.prototype.onSearchSubmitted_pdl1vj$ = function(text) {
  this.searchText = text;
  this.updateListOnView_0();
};
  ChatListPresenter.prototype.handleClickEntry_11rc$ = function(entry) {
  var tmp$;
  var chatWithLatestMessageAndCount = Kotlin.isType(tmp$ = entry, ChatWithLatestMessageAndCount) ? tmp$ : throwCCE();
  switch (this.mListMode.name) {
    case 'PICKER':
      var di = this.di;
      var strategy = ListSerializer(Chat.Companion.serializer());
      var entity = listOf_0(entry);
      var tmp$_0;
      var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
      this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
      break;
    case 'BROWSER':
      this.systemImpl.go_gofqk3$(ChatDetailView$Companion_getInstance().VIEW_NAME, mapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, entry.chatUid.toString()), to(UstadView$Companion_getInstance().ARG_PERSON_UID, chatWithLatestMessageAndCount.otherPersonUid.toString())]), this.context);
      break;
  }
};
  ChatListPresenter.prototype.handleClickCreateNewFab_pdl1vj$ = function(destinationResultKey) {
  var tmp$;
  var args = mapOf([to(UstadView$Companion_getInstance().ARG_GO_TO_COMPLETE, ChatDetailView$Companion_getInstance().VIEW_NAME), to(PersonListPresenter$Companion_getInstance().ARG_HIDE_PERSON_ADD, 'true'), to(PersonListView$Companion_getInstance().ARG_EXCLUDE_PERSONUIDS_LIST, this.loggedInPersonUid.toString())]);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, PersonListView$Companion_getInstance().VIEW_NAME, getKClass(Person), Person.Companion.serializer(), destinationResultKey, true, (tmp$ = args != null ? toMutableMap(args) : null) != null ? tmp$ : LinkedHashMap_init()));
};
  ChatListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
  var tmp$;
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ChatDetailView$Companion_getInstance().VIEW_NAME, getKClass(Chat), Chat.Companion.serializer(), destinationResultKey != null ? destinationResultKey : ChatListPresenter$Companion_getInstance().CHAT_RESULT_KEY, void 0, (tmp$ = args != null ? toMutableMap(args) : null) != null ? tmp$ : toMutableMap(this.arguments)));
};
  ChatListPresenter.prototype.onClickSort_o8nuns$ = function(sortOption) {
  UstadListPresenter.prototype.onClickSort_o8nuns$.call(this, sortOption);
  this.updateListOnView_0();
};
  ChatListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  return true;
};
  ChatListPresenter.prototype.handleClickCreateNewFab = function() {
};
  function ChatListPresenter$Companion() {
    ChatListPresenter$Companion_instance = this;
    this.CHAT_RESULT_KEY = 'Chat';
    this.CHAT_RESULT_KEY_GROUP = 'ChatGroup';
  }
  ChatListPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ChatListPresenter$Companion_instance = null;
  function ChatListPresenter$Companion_getInstance() {
    if (ChatListPresenter$Companion_instance === null) {
      new ChatListPresenter$Companion();
    }
    return ChatListPresenter$Companion_instance;
  }
  ChatListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ChatListPresenter', 
  interfaces: [UstadListPresenter, OnSearchSubmitted, OnSortOptionSelected]};
  function ClazzAssignmentDetailOverviewPresenter(context, arguments_0, view, lifecycleOwner, di) {
    ClazzAssignmentDetailOverviewPresenter$Companion_getInstance();
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    var context_0 = this.accountManager.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$;
    var tmp$_0;
    this.statementEndpoint_yvvytk$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$ : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(XapiStatementEndpoint), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, ClazzAssignmentDetailOverviewPresenter$statementEndpoint_metadata);
    this.submissionList = ArrayList_init();
    var tmp$_1, tmp$_2, tmp$_3, tmp$_4;
    this.newPrivateCommentListener = new DefaultNewCommentItemListener(di, context, (tmp$_2 = (tmp$_1 = arguments_0.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0, 520, false);
    this.newClassCommentListener = new DefaultNewCommentItemListener(di, context, (tmp$_4 = (tmp$_3 = arguments_0.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$_3) : null) != null ? tmp$_4 : L0, 520, true, L0);
  }
  var ClazzAssignmentDetailOverviewPresenter$statementEndpoint_metadata = new PropertyMetadata('statementEndpoint');
  Object.defineProperty(ClazzAssignmentDetailOverviewPresenter.prototype, 'statementEndpoint', {
  configurable: true, 
  get: function() {
  return this.statementEndpoint_yvvytk$_0.value;
}});
  Object.defineProperty(ClazzAssignmentDetailOverviewPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  ClazzAssignmentDetailOverviewPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  return false;
};
  function Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$it = it_0;
  }
  Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadEntityFromDb$lambda;
  Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.clazzAssignmentDao.findByUidWithBlockAsync_s8cxhz$(this.local$closure$entityUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ClazzAssignmentDetailOverviewPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$clazzAssignment = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$;
  Coroutine$onLoadEntityFromDb_7hogkd$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        var entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, ClazzAssignmentDetailOverviewPresenter$onLoadEntityFromDb$lambda(entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$clazzAssignment = (tmp$_1 = this.result_0) != null ? tmp$_1 : new ClazzAssignmentWithCourseBlock();
        this.state_0 = 3;
        this.result_0 = this.$this.loadAssignment_0(this.local$clazzAssignment, this.local$db, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        return this.local$clazzAssignment;
      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);
};
  ClazzAssignmentDetailOverviewPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda(closure$clazzAssignment_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$clazzAssignment = closure$clazzAssignment_0;
    this.local$it = it_0;
  }
  Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda.prototype.constructor = Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda;
  Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.clazzDao.getClazzWithSchool_s8cxhz$(this.local$closure$clazzAssignment.caClazzUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda(closure$clazzAssignment_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda(closure$clazzAssignment_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_0(closure$loggedInPersonUid_0, closure$clazzAssignment_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$loggedInPersonUid = closure$loggedInPersonUid_0;
    this.local$closure$clazzAssignment = closure$clazzAssignment_0;
    this.local$it = it_0;
  }
  Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_0.prototype.constructor = Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_0;
  Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.clazzEnrolmentDao.findByPersonUidAndClazzUidAsync_3pjtqy$(this.local$closure$loggedInPersonUid, this.local$closure$clazzAssignment.caClazzUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_0(closure$loggedInPersonUid_0, closure$clazzAssignment_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_0(closure$loggedInPersonUid_0, closure$clazzAssignment_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_1(closure$clazzAssignment_0, closure$submitterUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$clazzAssignment = closure$clazzAssignment_0;
    this.local$closure$submitterUid = closure$submitterUid_0;
    this.local$it = it_0;
  }
  Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_1.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_1.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_1.prototype.constructor = Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_1;
  Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_1.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        return this.local$it.courseAssignmentSubmissionDao.getAllSubmissionsFromSubmitter_3pjtqy$(this.local$closure$clazzAssignment.caUid, this.local$closure$submitterUid);
      case 1:
        throw this.exception_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 ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_1(closure$clazzAssignment_0, closure$submitterUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_1(closure$clazzAssignment_0, closure$submitterUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_2(this$ClazzAssignmentDetailOverviewPresenter) {
    return function(it) {
  this$ClazzAssignmentDetailOverviewPresenter.view.submissionStatus = it != null ? it : 0;
  return Unit;
};
  }
  function ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_3(this$ClazzAssignmentDetailOverviewPresenter) {
    return function(it) {
  this$ClazzAssignmentDetailOverviewPresenter.view.submissionMark = it;
  return Unit;
};
  }
  function Coroutine$loadAssignment_0($this, clazzAssignment_0, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$_1 = void 0;
    this.local$loggedInPersonUid = void 0;
    this.local$submitterUid = void 0;
    this.local$clazzAssignment = clazzAssignment_0;
    this.local$db = db_0;
  }
  Coroutine$loadAssignment_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$loadAssignment_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$loadAssignment_0.prototype.constructor = Coroutine$loadAssignment_0;
  Coroutine$loadAssignment_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        this.local$loggedInPersonUid = this.$this.accountManager.activeAccount.personUid;
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda(this.local$clazzAssignment), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var clazzWithSchool = (tmp$ = this.result_0) != null ? tmp$ : new ClazzWithSchool();
        this.$this.view.timeZone = effectiveTimeZone(clazzWithSchool);
        this.state_0 = 3;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_0(this.local$loggedInPersonUid, this.local$clazzAssignment), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var clazzEnrolment = this.result_0;
        var isStudent = 1000 === ((tmp$_0 = clazzEnrolment != null ? clazzEnrolment.clazzEnrolmentRole : null) != null ? tmp$_0 : 0);
        this.$this.view.showSubmission = isStudent;
        if (isStudent) {
          this.state_0 = 4;
          this.result_0 = this.local$db.clazzAssignmentDao.getSubmitterUid_3pjtqy$(this.local$clazzAssignment.caUid, this.$this.accountManager.activeAccount.personUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 7;
          continue;
        }
      case 4:
        this.local$submitterUid = this.result_0;
        var unassignedMessage = this.$this.systemImpl.getString(2942, this.$this.context);
        this.$this.view.unassignedError = equals(this.local$submitterUid, L0) ? unassignedMessage : null;
        this.state_0 = 5;
        this.result_0 = this.$this.checkCanAddFileOrText_rmck6r$(this.local$clazzAssignment, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        this.$this.view.showPrivateComments = (this.local$clazzAssignment.caPrivateCommentsEnabled && !equals(this.local$submitterUid, L0));
        if (this.local$clazzAssignment.caPrivateCommentsEnabled) {
          this.$this.view.clazzAssignmentPrivateComments = this.local$db.commentsDao.findPrivateByEntityTypeAndUidAndForPersonLive2_h639zw$(520, this.local$clazzAssignment.caUid, this.local$submitterUid);
        }
        this.local$tmp$_1 = this.$this.view;
        this.state_0 = 6;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_1(this.local$clazzAssignment, this.local$submitterUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 6:
        this.local$tmp$_1.submittedCourseAssignmentSubmission = this.result_0;
        observeWithLifecycleOwner(this.local$db.courseAssignmentSubmissionDao.getStatusOfAssignmentForSubmitter_3pjtqy$(this.local$clazzAssignment.caUid, this.local$submitterUid), this.$this.lifecycleOwner, ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_2(this.$this));
        observeWithLifecycleOwner(this.local$db.courseAssignmentMarkDao.getMarkOfAssignmentForSubmitterLiveData_3pjtqy$(this.local$clazzAssignment.caUid, this.local$submitterUid), this.$this.lifecycleOwner, ClazzAssignmentDetailOverviewPresenter$loadAssignment$lambda_3(this.$this));
        this.state_0 = 7;
        continue;
      case 7:
        if (this.local$clazzAssignment.caClassCommentEnabled) {
          this.$this.view.clazzAssignmentClazzComments = this.local$db.commentsDao.findPublicByEntityTypeAndUidLive_6svq3l$(520, this.local$clazzAssignment.caUid);
        }
        return;
      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);
};
  ClazzAssignmentDetailOverviewPresenter.prototype.loadAssignment_0 = function(clazzAssignment_0, db_0, continuation_0, suspended) {
  var instance = new Coroutine$loadAssignment_0(this, clazzAssignment_0, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$checkCanAddFileOrText_rmck6r$($this, clazzAssignment_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$submitterUid = void 0;
    this.local$alreadySubmitted = void 0;
    this.local$hasPassedDeadline = void 0;
    this.local$clazzAssignment = clazzAssignment_0;
  }
  Coroutine$checkCanAddFileOrText_rmck6r$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$checkCanAddFileOrText_rmck6r$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$checkCanAddFileOrText_rmck6r$.prototype.constructor = Coroutine$checkCanAddFileOrText_rmck6r$;
  Coroutine$checkCanAddFileOrText_rmck6r$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.$this.repo.clazzAssignmentDao.getSubmitterUid_3pjtqy$(this.local$clazzAssignment.caUid, this.$this.accountManager.activeAccount.personUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$submitterUid = this.result_0;
        this.local$alreadySubmitted = false;
        if (this.local$clazzAssignment.caSubmissionPolicy === 1) {
          this.state_0 = 3;
          this.result_0 = this.$this.repo.courseAssignmentSubmissionDao.countSubmissionsFromSubmitter_3pjtqy$(this.local$clazzAssignment.caUid, this.local$submitterUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 4;
          continue;
        }
      case 3:
        var sizeOfSubmitted = this.result_0;
        this.local$alreadySubmitted = sizeOfSubmitted > 0;
        this.state_0 = 4;
        continue;
      case 4:
        this.local$hasPassedDeadline = this.$this.hasPassedDeadline_0(this.local$clazzAssignment);
        this.state_0 = 5;
        this.result_0 = this.$this.checkMaxFilesReached_0(this.$this.db, this.local$clazzAssignment, this.local$submitterUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        var maxFilesReached = this.result_0;
        var assignedInGroup = !equals(this.local$submitterUid, L0);
        this.$this.view.addFileSubmissionVisible = (this.local$clazzAssignment.caRequireFileSubmission && !this.local$alreadySubmitted && !maxFilesReached && !this.local$hasPassedDeadline && assignedInGroup);
        this.$this.view.addTextSubmissionVisible = (this.local$clazzAssignment.caRequireTextSubmission && !this.local$alreadySubmitted && !this.local$hasPassedDeadline && assignedInGroup);
        return;
      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);
};
  ClazzAssignmentDetailOverviewPresenter.prototype.checkCanAddFileOrText_rmck6r$ = function(clazzAssignment_0, continuation_0, suspended) {
  var instance = new Coroutine$checkCanAddFileOrText_rmck6r$(this, clazzAssignment_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadFromJson$lambda(closure$entity_0, this$ClazzAssignmentDetailOverviewPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$ClazzAssignmentDetailOverviewPresenter = this$ClazzAssignmentDetailOverviewPresenter_0;
  }
  Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadFromJson$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadFromJson$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadFromJson$lambda.prototype.constructor = Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadFromJson$lambda;
  Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadFromJson$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzAssignmentDetailOverviewPresenter.loadAssignment_0(this.local$closure$entity, this.local$this$ClazzAssignmentDetailOverviewPresenter.db, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ClazzAssignmentDetailOverviewPresenter$onLoadFromJson$lambda(closure$entity_0, this$ClazzAssignmentDetailOverviewPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadFromJson$lambda(closure$entity_0, this$ClazzAssignmentDetailOverviewPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzAssignmentDetailOverviewPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  UstadDetailPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var di = this.di;
  var strategy = ClazzAssignmentWithCourseBlock.Companion.serializer();
  var str = toString(bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON));
  var tmp$_0;
  var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
  var entity = json.decodeFromString_awif5v$(strategy, str);
  this.submissionList.addAll_brywnq$(safeParseList(this.di, ListSerializer(CourseAssignmentSubmissionWithAttachment.Companion.serializer()), getKClass(CourseAssignmentSubmissionWithAttachment), (tmp$ = bundle.get_11rb$(ClazzAssignmentDetailOverviewPresenter$Companion_getInstance().SAVED_STATE_ADD_SUBMISSION_LIST)) != null ? tmp$ : ''));
  this.view.addedCourseAssignmentSubmission = this.submissionList;
  launch(this.presenterScope, void 0, void 0, ClazzAssignmentDetailOverviewPresenter$onLoadFromJson$lambda(entity, this));
  return entity;
};
  ClazzAssignmentDetailOverviewPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadDetailPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, ClazzAssignment.Companion.serializer(), this.entity);
  putEntityAsJson(savedState, ClazzAssignmentDetailOverviewPresenter$Companion_getInstance().SAVED_STATE_ADD_SUBMISSION_LIST, ListSerializer(CourseAssignmentSubmissionWithAttachment.Companion.serializer()), this.submissionList);
};
  function Coroutine$checkMaxFilesReached_0($this, db_0, clazzAssignment_0, submitterUid_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$sizeOfAddedList = void 0;
    this.local$db = db_0;
    this.local$clazzAssignment = clazzAssignment_0;
    this.local$submitterUid = submitterUid_0;
  }
  Coroutine$checkMaxFilesReached_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$checkMaxFilesReached_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$checkMaxFilesReached_0.prototype.constructor = Coroutine$checkMaxFilesReached_0;
  Coroutine$checkMaxFilesReached_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var $receiver = this.$this.submissionList;
        var destination = ArrayList_init();
        var tmp$;
        tmp$ = $receiver.iterator();
        while (tmp$.hasNext()) {
          var element = tmp$.next();
          if (element.casType === 2) 
            destination.add_11rb$(element);
        }
        this.local$sizeOfAddedList = destination.size;
        this.state_0 = 2;
        this.result_0 = this.local$db.courseAssignmentSubmissionDao.countFileSubmissionFromStudent_3pjtqy$(this.local$clazzAssignment.caUid, this.local$submitterUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var sizeOfSubmitted = this.result_0;
        return (this.local$sizeOfAddedList + sizeOfSubmitted | 0) >= this.local$clazzAssignment.caNumberOfFiles;
      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);
};
  ClazzAssignmentDetailOverviewPresenter.prototype.checkMaxFilesReached_0 = function(db_0, clazzAssignment_0, submitterUid_0, continuation_0, suspended) {
  var instance = new Coroutine$checkMaxFilesReached_0(this, db_0, clazzAssignment_0, submitterUid_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ClazzAssignmentDetailOverviewPresenter.prototype.hasPassedDeadline_0 = function(course) {
  var tmp$, tmp$_0;
  var currentTime = systemTimeInMillis();
  return currentTime.compareTo_11rb$((tmp$_0 = (tmp$ = course.block) != null ? tmp$.cbGracePeriodDate : null) != null ? tmp$_0 : Long$Companion$MAX_VALUE) > 0;
};
  function Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda(closure$uri_0, this$ClazzAssignmentDetailOverviewPresenter_0, closure$entity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$uri = closure$uri_0;
    this.local$this$ClazzAssignmentDetailOverviewPresenter = this$ClazzAssignmentDetailOverviewPresenter_0;
    this.local$closure$entity = closure$entity_0;
    this.local$doorUri = void 0;
    this.local$$receiver = void 0;
    this.local$submission = void 0;
    this.local$$receiver_0 = void 0;
    this.local$this$ClazzAssignmentDetailOverviewPresenter_0 = void 0;
    this.local$closure$uri_0 = void 0;
  }
  Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda.prototype.constructor = Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda;
  Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$doorUri = DoorUri.Companion.parse_61zpoe$(this.local$closure$uri);
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzAssignmentDetailOverviewPresenter.repo.clazzAssignmentDao.getSubmitterUid_3pjtqy$(this.local$closure$entity.caUid, this.local$this$ClazzAssignmentDetailOverviewPresenter.accountManager.activeAccount.personUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var submitterUid = this.result_0;
        this.local$$receiver = new CourseAssignmentSubmissionWithAttachment();
        var closure$entity = this.local$closure$entity;
        var this$ClazzAssignmentDetailOverviewPresenter = this.local$this$ClazzAssignmentDetailOverviewPresenter;
        this.local$$receiver.casSubmitterUid = submitterUid;
        this.local$$receiver.casAssignmentUid = closure$entity.caUid;
        this.local$$receiver.casSubmitterPersonUid = this$ClazzAssignmentDetailOverviewPresenter.accountManager.activeAccount.personUid;
        this.local$$receiver.casType = 2;
        this.state_0 = 3;
        this.result_0 = get_doorPrimaryKeyManager(this$ClazzAssignmentDetailOverviewPresenter.db).nextIdAsync_za3lpa$(522, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$$receiver.casUid = this.result_0;
        this.local$submission = this.local$$receiver;
        this.local$$receiver_0 = new CourseAssignmentSubmissionAttachment();
        this.local$this$ClazzAssignmentDetailOverviewPresenter_0 = this.local$this$ClazzAssignmentDetailOverviewPresenter;
        this.local$closure$uri_0 = this.local$closure$uri;
        this.state_0 = 4;
        this.result_0 = get_doorPrimaryKeyManager(this.local$this$ClazzAssignmentDetailOverviewPresenter_0.db).nextIdAsync_za3lpa$(90, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.local$$receiver_0.casaUid = this.result_0;
        this.local$$receiver_0.casaSubmissionUid = this.local$submission.casUid;
        this.local$$receiver_0.casaUri = this.local$closure$uri_0;
        this.state_0 = 5;
        this.result_0 = this.local$doorUri.getFileName_za3rmp$(this.local$this$ClazzAssignmentDetailOverviewPresenter_0.context, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        this.local$$receiver_0.casaFileName = this.result_0;
        this.state_0 = 6;
        this.result_0 = guessMimeType(this.local$doorUri, this.local$this$ClazzAssignmentDetailOverviewPresenter_0.context, this.local$this$ClazzAssignmentDetailOverviewPresenter_0.di, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 6:
        this.local$$receiver_0.casaMimeType = this.result_0;
        var attachment = this.local$$receiver_0;
        this.local$submission.attachment = attachment;
        this.local$this$ClazzAssignmentDetailOverviewPresenter.submissionList.add_11rb$(this.local$submission);
        this.local$this$ClazzAssignmentDetailOverviewPresenter.view.addedCourseAssignmentSubmission = this.local$this$ClazzAssignmentDetailOverviewPresenter.submissionList;
        this.state_0 = 7;
        this.result_0 = this.local$this$ClazzAssignmentDetailOverviewPresenter.checkCanAddFileOrText_rmck6r$(this.local$closure$entity, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 7:
        return this.local$this$ClazzAssignmentDetailOverviewPresenter.requireSavedStateHandle().set_umlfku$(ClazzAssignmentDetailOverviewPresenter$Companion_getInstance().SAVED_STATE_KEY_URI, null) , Unit;
      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 ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda(closure$uri_0, this$ClazzAssignmentDetailOverviewPresenter_0, closure$entity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda(closure$uri_0, this$ClazzAssignmentDetailOverviewPresenter_0, closure$entity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda(this$ClazzAssignmentDetailOverviewPresenter) {
    return function(it) {
  var tmp$, tmp$_0;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var uri = tmp$;
  tmp$_0 = this$ClazzAssignmentDetailOverviewPresenter.entity;
  if (tmp$_0 == null) {
    return;
  }
  var entity = tmp$_0;
  launch(this$ClazzAssignmentDetailOverviewPresenter.presenterScope, doorMainDispatcher(), void 0, ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda(uri, this$ClazzAssignmentDetailOverviewPresenter, entity));
  return Unit;
};
  }
  function Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda_0(this$ClazzAssignmentDetailOverviewPresenter_0, closure$entity_0, closure$submission_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzAssignmentDetailOverviewPresenter = this$ClazzAssignmentDetailOverviewPresenter_0;
    this.local$closure$entity = closure$entity_0;
    this.local$closure$submission = closure$submission_0;
  }
  Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda_0.prototype.constructor = Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda_0;
  Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzAssignmentDetailOverviewPresenter.repo.clazzAssignmentDao.getSubmitterUid_3pjtqy$(this.local$closure$entity.caUid, this.local$this$ClazzAssignmentDetailOverviewPresenter.accountManager.activeAccount.personUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var submitterUid = this.result_0;
        var $receiver = this.local$this$ClazzAssignmentDetailOverviewPresenter.submissionList;
        var firstOrNull$result;
        firstOrNull$break:
          do {
            var tmp$;
            tmp$ = $receiver.iterator();
            while (tmp$.hasNext()) {
              var element = tmp$.next();
              var closure$submission = this.local$closure$submission;
              if (equals(element.casUid, closure$submission.casUid)) {
                firstOrNull$result = element;
                break firstOrNull$break;
              }
            }
            firstOrNull$result = null;
          } while (false);
        var existingSubmission = firstOrNull$result;
        var $receiver_0 = this.local$this$ClazzAssignmentDetailOverviewPresenter.submissionList;
        var tmp$_0;
        (Kotlin.isType(tmp$_0 = $receiver_0, MutableCollection) ? tmp$_0 : throwCCE()).remove_11rb$(existingSubmission);
        this.local$closure$submission.casAssignmentUid = this.local$closure$entity.caUid;
        this.local$closure$submission.casSubmitterUid = submitterUid;
        this.local$closure$submission.casSubmitterPersonUid = this.local$this$ClazzAssignmentDetailOverviewPresenter.accountManager.activeAccount.personUid;
        this.local$this$ClazzAssignmentDetailOverviewPresenter.submissionList.add_11rb$(this.local$closure$submission);
        this.local$this$ClazzAssignmentDetailOverviewPresenter.view.addedCourseAssignmentSubmission = this.local$this$ClazzAssignmentDetailOverviewPresenter.submissionList;
        this.state_0 = 3;
        this.result_0 = this.local$this$ClazzAssignmentDetailOverviewPresenter.checkCanAddFileOrText_rmck6r$(this.local$closure$entity, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        return this.local$this$ClazzAssignmentDetailOverviewPresenter.requireSavedStateHandle().set_umlfku$(ClazzAssignmentDetailOverviewPresenter$Companion_getInstance().SAVED_STATE_KEY_TEXT, null) , Unit;
      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 ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda_0(this$ClazzAssignmentDetailOverviewPresenter_0, closure$entity_0, closure$submission_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda_0(this$ClazzAssignmentDetailOverviewPresenter_0, closure$entity_0, closure$submission_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda_0(this$ClazzAssignmentDetailOverviewPresenter) {
    return function(it) {
  var tmp$, tmp$_0;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var submission = tmp$;
  tmp$_0 = this$ClazzAssignmentDetailOverviewPresenter.entity;
  if (tmp$_0 == null) {
    return;
  }
  var entity = tmp$_0;
  launch(this$ClazzAssignmentDetailOverviewPresenter.presenterScope, doorMainDispatcher(), void 0, ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda$lambda_0(this$ClazzAssignmentDetailOverviewPresenter, entity, submission));
  return Unit;
};
  }
  ClazzAssignmentDetailOverviewPresenter.prototype.onLoadDataComplete = function() {
  UstadDetailPresenter.prototype.onLoadDataComplete.call(this);
  this.observeSavedStateResult_27fjeh$(ClazzAssignmentDetailOverviewPresenter$Companion_getInstance().SAVED_STATE_KEY_URI, ListSerializer(serializer(kotlin_js_internal_StringCompanionObject)), PrimitiveClasses$stringClass, new DoorObserver(ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda(this)));
  this.observeSavedStateResult_27fjeh$(ClazzAssignmentDetailOverviewPresenter$Companion_getInstance().SAVED_STATE_KEY_TEXT, ListSerializer(CourseAssignmentSubmissionWithAttachment.Companion.serializer()), getKClass(CourseAssignmentSubmissionWithAttachment), new DoorObserver(ClazzAssignmentDetailOverviewPresenter$onLoadDataComplete$lambda_0(this)));
};
  function Coroutine$ClazzAssignmentDetailOverviewPresenter$handleDeleteSubmission$lambda(this$ClazzAssignmentDetailOverviewPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzAssignmentDetailOverviewPresenter = this$ClazzAssignmentDetailOverviewPresenter_0;
    this.local$tmp$ = void 0;
  }
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleDeleteSubmission$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleDeleteSubmission$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleDeleteSubmission$lambda.prototype.constructor = Coroutine$ClazzAssignmentDetailOverviewPresenter$handleDeleteSubmission$lambda;
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleDeleteSubmission$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        if ((tmp$ = this.local$this$ClazzAssignmentDetailOverviewPresenter.entity) != null) {
          this.state_0 = 2;
          this.result_0 = this.local$this$ClazzAssignmentDetailOverviewPresenter.checkCanAddFileOrText_rmck6r$(tmp$, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.local$tmp$ = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.local$tmp$ = Unit;
        this.state_0 = 3;
        continue;
      case 3:
        return this.local$tmp$;
      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 ClazzAssignmentDetailOverviewPresenter$handleDeleteSubmission$lambda(this$ClazzAssignmentDetailOverviewPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailOverviewPresenter$handleDeleteSubmission$lambda(this$ClazzAssignmentDetailOverviewPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzAssignmentDetailOverviewPresenter.prototype.handleDeleteSubmission_gh2dp9$ = function(submissionCourse) {
  this.submissionList.remove_11rb$(submissionCourse);
  this.view.addedCourseAssignmentSubmission = this.submissionList;
  launch(this.presenterScope, void 0, void 0, ClazzAssignmentDetailOverviewPresenter$handleDeleteSubmission$lambda(this));
};
  function Coroutine$ClazzAssignmentDetailOverviewPresenter$handleEditSubmission$lambda(closure$courseSubmission_0, this$ClazzAssignmentDetailOverviewPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$courseSubmission = closure$courseSubmission_0;
    this.local$this$ClazzAssignmentDetailOverviewPresenter = this$ClazzAssignmentDetailOverviewPresenter_0;
  }
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleEditSubmission$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleEditSubmission$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleEditSubmission$lambda.prototype.constructor = Coroutine$ClazzAssignmentDetailOverviewPresenter$handleEditSubmission$lambda;
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleEditSubmission$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzAssignmentDetailOverviewPresenter.openAssignmentFileAttachment_0(this.local$closure$courseSubmission, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ClazzAssignmentDetailOverviewPresenter$handleEditSubmission$lambda(closure$courseSubmission_0, this$ClazzAssignmentDetailOverviewPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailOverviewPresenter$handleEditSubmission$lambda(closure$courseSubmission_0, this$ClazzAssignmentDetailOverviewPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzAssignmentDetailOverviewPresenter.prototype.handleEditSubmission_gh2dp9$ = function(courseSubmission) {
  if (courseSubmission.casType === 1) {
    var args = LinkedHashMap_init();
    putEntityAsJson(args, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, CourseAssignmentSubmissionWithAttachment.Companion.serializer(), courseSubmission);
    var key = TextAssignmentEditView$Companion_getInstance().EDIT_ENABLED;
    var value = true.toString();
    args.put_xwzc9p$(key, value);
    this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, courseSubmission, TextAssignmentEditView$Companion_getInstance().VIEW_NAME, getKClass(CourseAssignmentSubmission), CourseAssignmentSubmission.Companion.serializer(), ClazzAssignmentDetailOverviewPresenter$Companion_getInstance().SAVED_STATE_KEY_TEXT, void 0, args));
  } else {
    launch(this.presenterScope, void 0, void 0, ClazzAssignmentDetailOverviewPresenter$handleEditSubmission$lambda(courseSubmission, this));
  }
};
  function Coroutine$ClazzAssignmentDetailOverviewPresenter$handleOpenSubmission$lambda(closure$courseSubmission_0, this$ClazzAssignmentDetailOverviewPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$courseSubmission = closure$courseSubmission_0;
    this.local$this$ClazzAssignmentDetailOverviewPresenter = this$ClazzAssignmentDetailOverviewPresenter_0;
  }
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleOpenSubmission$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleOpenSubmission$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleOpenSubmission$lambda.prototype.constructor = Coroutine$ClazzAssignmentDetailOverviewPresenter$handleOpenSubmission$lambda;
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleOpenSubmission$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        if (this.local$closure$courseSubmission.casType === 1) {
          var args = LinkedHashMap_init();
          var key = HtmlTextViewDetailView$Companion_getInstance().DISPLAY_TEXT;
          var value = (tmp$ = this.local$closure$courseSubmission.casText) != null ? tmp$ : '';
          args.put_xwzc9p$(key, value);
          return this.local$this$ClazzAssignmentDetailOverviewPresenter.requireNavController().navigate_oc2wlg$(HtmlTextViewDetailView$Companion_getInstance().VIEW_NAME, args) , Unit;
        } else {
          if (this.local$closure$courseSubmission.casType === 2) {
            this.state_0 = 2;
            this.result_0 = this.local$this$ClazzAssignmentDetailOverviewPresenter.openAssignmentFileAttachment_0(this.local$closure$courseSubmission, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 3;
            continue;
          }
        }
      case 1:
        throw this.exception_0;
      case 2:
        return Unit;
      case 3:
        this.state_0 = 4;
        continue;
      case 4:
        return Unit;
      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 ClazzAssignmentDetailOverviewPresenter$handleOpenSubmission$lambda(closure$courseSubmission_0, this$ClazzAssignmentDetailOverviewPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailOverviewPresenter$handleOpenSubmission$lambda(closure$courseSubmission_0, this$ClazzAssignmentDetailOverviewPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzAssignmentDetailOverviewPresenter.prototype.handleOpenSubmission_gh2dp9$ = function(courseSubmission) {
  launch(this.presenterScope, void 0, void 0, ClazzAssignmentDetailOverviewPresenter$handleOpenSubmission$lambda(courseSubmission, this));
};
  function Coroutine$openAssignmentFileAttachment_0($this, courseSubmission_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$ = void 0;
    this.local$tmp$_0 = void 0;
    this.local$tmp$_1 = void 0;
    this.local$fileSubmission = void 0;
    this.local$courseSubmission = courseSubmission_0;
  }
  Coroutine$openAssignmentFileAttachment_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$openAssignmentFileAttachment_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$openAssignmentFileAttachment_0.prototype.constructor = Coroutine$openAssignmentFileAttachment_0;
  Coroutine$openAssignmentFileAttachment_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.local$tmp$ = this.local$courseSubmission.attachment;
        if (this.local$tmp$ == null) {
          return;
        } else {
          this.state_0 = 2;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.local$fileSubmission = this.local$tmp$;
        this.local$tmp$_0 = this.local$fileSubmission.casaUri;
        if (this.local$tmp$_0 == null) {
          return;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 3:
        var uri = this.local$tmp$_0;
        if (startsWith(uri, 'door-attachment://')) {
          this.state_0 = 4;
          this.result_0 = retrieveAttachment(this.$this.repo, uri, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.local$tmp$_1 = DoorUri.Companion.parse_61zpoe$(uri);
          this.state_0 = 5;
          continue;
        }
      case 4:
        this.local$tmp$_1 = this.result_0;
        this.state_0 = 5;
        continue;
      case 5:
        var doorUri = this.local$tmp$_1;
        try {
          this.$this.systemImpl.openFileInDefaultViewer_t9zcln$(this.$this.context, doorUri, this.local$fileSubmission.casaMimeType, (tmp$ = this.local$courseSubmission.attachment) != null ? tmp$.casaFileName : null);
        }        catch (e) {
  if (Kotlin.isType(e, Exception)) {
    if (Kotlin.isType(e, NoAppFoundException)) {
      this.$this.view.showSnackBar_9pu0dj$(this.$this.systemImpl.getString(2166, this.$this.context));
    } else {
      var message = e.message;
      if (message != null) {
        this.$this.view.showSnackBar_9pu0dj$(message);
      }
    }
  } else 
    throw e;
}
        return;
      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);
};
  ClazzAssignmentDetailOverviewPresenter.prototype.openAssignmentFileAttachment_0 = function(courseSubmission_0, continuation_0, suspended) {
  var instance = new Coroutine$openAssignmentFileAttachment_0(this, courseSubmission_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda$lambda(this$ClazzAssignmentDetailOverviewPresenter_0, closure$entity_0, txDb_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$this$ClazzAssignmentDetailOverviewPresenter = this$ClazzAssignmentDetailOverviewPresenter_0;
    this.local$closure$entity = closure$entity_0;
    this.local$txDb = txDb_0;
  }
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda$lambda.prototype.constructor = Coroutine$ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda$lambda;
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$txDb.courseAssignmentSubmissionDao.insertListAsync(this.local$this$ClazzAssignmentDetailOverviewPresenter.submissionList, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var tmp$ = this.local$txDb.courseAssignmentSubmissionAttachmentDao;
        var $receiver = this.local$this$ClazzAssignmentDetailOverviewPresenter.submissionList;
        var destination = ArrayList_init();
        var tmp$_0;
        tmp$_0 = $receiver.iterator();
        while (tmp$_0.hasNext()) {
          var element = tmp$_0.next();
          var tmp$_0_0;
          if ((tmp$_0_0 = element.attachment) != null) {
            destination.add_11rb$(tmp$_0_0);
          }
        }
        this.state_0 = 3;
        this.result_0 = tmp$.insertListAsync(destination, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.state_0 = 4;
        this.result_0 = this.local$this$ClazzAssignmentDetailOverviewPresenter.checkCanAddFileOrText_rmck6r$(this.local$closure$entity, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        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 ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda$lambda(this$ClazzAssignmentDetailOverviewPresenter_0, closure$entity_0) {
    return function(txDb_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda$lambda(this$ClazzAssignmentDetailOverviewPresenter_0, closure$entity_0, txDb_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda(this$ClazzAssignmentDetailOverviewPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzAssignmentDetailOverviewPresenter = this$ClazzAssignmentDetailOverviewPresenter_0;
    this.local$tmp$ = void 0;
    this.local$entity = void 0;
  }
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda.prototype.constructor = Coroutine$ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda;
  Coroutine$ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$tmp$ = this.local$this$ClazzAssignmentDetailOverviewPresenter.entity;
        if (this.local$tmp$ == null) {
          return;
        } else {
          this.state_0 = 2;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.local$entity = this.local$tmp$;
        var hasPassedDeadline = this.local$this$ClazzAssignmentDetailOverviewPresenter.hasPassedDeadline_0(this.local$entity);
        if (hasPassedDeadline) {
          this.local$this$ClazzAssignmentDetailOverviewPresenter.view.showSnackBar_9pu0dj$(this.local$this$ClazzAssignmentDetailOverviewPresenter.systemImpl.getString(2957, this.local$this$ClazzAssignmentDetailOverviewPresenter.context));
          return;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 3:
        this.state_0 = 4;
        this.result_0 = this.local$this$ClazzAssignmentDetailOverviewPresenter.repo.clazzAssignmentDao.getSubmitterUid_3pjtqy$(this.local$entity.caUid, this.local$this$ClazzAssignmentDetailOverviewPresenter.accountManager.activeAccount.personUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        var submitterUid = this.result_0;
        if (this.local$entity.caSubmissionPolicy === 1) {
          this.state_0 = 5;
          this.result_0 = this.local$this$ClazzAssignmentDetailOverviewPresenter.repo.courseAssignmentSubmissionDao.countSubmissionsFromSubmitter_3pjtqy$(this.local$entity.caUid, submitterUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 7;
          continue;
        }
      case 5:
        var sizeOfSubmitted = this.result_0;
        if (sizeOfSubmitted > 0) {
          this.local$this$ClazzAssignmentDetailOverviewPresenter.view.showSnackBar_9pu0dj$(this.local$this$ClazzAssignmentDetailOverviewPresenter.systemImpl.getString(2950, this.local$this$ClazzAssignmentDetailOverviewPresenter.context));
          return;
        } else {
          this.state_0 = 6;
          continue;
        }
      case 6:
        this.state_0 = 7;
        continue;
      case 7:
        this.state_0 = 8;
        this.result_0 = withDoorTransactionAsync(this.local$this$ClazzAssignmentDetailOverviewPresenter.repo, getKClass(UmAppDatabase), ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda$lambda(this.local$this$ClazzAssignmentDetailOverviewPresenter, this.local$entity), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 8:
        this.local$this$ClazzAssignmentDetailOverviewPresenter.submissionList.clear();
        return this.local$this$ClazzAssignmentDetailOverviewPresenter.view.addedCourseAssignmentSubmission = this.local$this$ClazzAssignmentDetailOverviewPresenter.submissionList , Unit;
      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 ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda(this$ClazzAssignmentDetailOverviewPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda(this$ClazzAssignmentDetailOverviewPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzAssignmentDetailOverviewPresenter.prototype.handleSubmitButtonClicked = function() {
  launch(this.presenterScope, doorMainDispatcher(), void 0, ClazzAssignmentDetailOverviewPresenter$handleSubmitButtonClicked$lambda(this));
};
  ClazzAssignmentDetailOverviewPresenter.prototype.handleAddFileClicked = function() {
  var tmp$, tmp$_0;
  switch ((tmp$ = this.entity) != null ? tmp$.caFileType : null) {
    case 1:
      tmp$_0 = SelectFileView$Companion_getInstance().SELECTION_MODE_DOC;
      break;
    case 4:
      tmp$_0 = SelectFileView$Companion_getInstance().SELECTION_MODE_AUDIO;
      break;
    case 3:
      tmp$_0 = SelectFileView$Companion_getInstance().SELECTION_MODE_VIDEO;
      break;
    case 2:
      tmp$_0 = SelectFileView$Companion_getInstance().SELECTION_MODE_IMAGE;
      break;
    default:
      tmp$_0 = SelectFileView$Companion_getInstance().SELECTION_MODE_ANY;
      break;
  }
  var modeSelected = tmp$_0;
  var args = mutableMapOf([to(SelectFileView$Companion_getInstance().ARG_MIMETYPE_SELECTED, modeSelected)]);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, SelectFileView$Companion_getInstance().VIEW_NAME, PrimitiveClasses$stringClass, serializer(kotlin_js_internal_StringCompanionObject), ClazzAssignmentDetailOverviewPresenter$Companion_getInstance().SAVED_STATE_KEY_URI, void 0, args));
};
  ClazzAssignmentDetailOverviewPresenter.prototype.handleAddTextClicked = function() {
  var tmp$;
  var args = mutableMapOf([to(TextAssignmentEditView$Companion_getInstance().ASSIGNMENT_ID, toString((tmp$ = this.entity) != null ? tmp$.caUid : null))]);
  var key = TextAssignmentEditView$Companion_getInstance().EDIT_ENABLED;
  var value = true.toString();
  args.put_xwzc9p$(key, value);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, TextAssignmentEditView$Companion_getInstance().VIEW_NAME, getKClass(CourseAssignmentSubmission), CourseAssignmentSubmission.Companion.serializer(), ClazzAssignmentDetailOverviewPresenter$Companion_getInstance().SAVED_STATE_KEY_TEXT, void 0, args));
};
  function ClazzAssignmentDetailOverviewPresenter$Companion() {
    ClazzAssignmentDetailOverviewPresenter$Companion_instance = this;
    this.SUBMISSION_POLICY_OPTIONS = mapOf([to(2, 2947), to(1, 2946)]);
    this.SAVED_STATE_KEY_URI = 'URI';
    this.SAVED_STATE_KEY_TEXT = 'TEXT';
    this.SAVED_STATE_ADD_SUBMISSION_LIST = 'submissionList';
    this.SAVEDSTATE_KEY_CLAZZ_ASSIGNMENT = 'ClassAssignment';
  }
  ClazzAssignmentDetailOverviewPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzAssignmentDetailOverviewPresenter$Companion_instance = null;
  function ClazzAssignmentDetailOverviewPresenter$Companion_getInstance() {
    if (ClazzAssignmentDetailOverviewPresenter$Companion_instance === null) {
      new ClazzAssignmentDetailOverviewPresenter$Companion();
    }
    return ClazzAssignmentDetailOverviewPresenter$Companion_instance;
  }
  ClazzAssignmentDetailOverviewPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzAssignmentDetailOverviewPresenter', 
  interfaces: [UstadDetailPresenter]};
  function ClazzAssignmentDetailPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  ClazzAssignmentDetailPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  return false;
};
  Object.defineProperty(ClazzAssignmentDetailPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  ClazzAssignmentDetailPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  UstadDetailPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  var editEntity = null;
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = ClazzAssignment.Companion.serializer();
    var tmp$;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
    editEntity = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    editEntity = new ClazzAssignment();
  }
  this.setupTabs_0(editEntity);
  return editEntity;
};
  function Coroutine$ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda$lambda(closure$entityUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$it = it_0;
  }
  Coroutine$ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda$lambda.prototype.constructor = Coroutine$ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda$lambda;
  Coroutine$ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.clazzAssignmentDao.findByUidAsync_s8cxhz$(this.local$closure$entityUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda$lambda(closure$entityUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda$lambda(closure$entityUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda;
  Coroutine$ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$closure$db, L2000, ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda$lambda(this.local$closure$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_0($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$entityUid = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_0.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_0;
  Coroutine$onLoadEntityFromDb_7hogkd$_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        this.local$entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = withContext(coroutines.Dispatchers.Default, ClazzAssignmentDetailPresenter$onLoadEntityFromDb$lambda(this.local$db, this.local$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var tmp$_2;
        if ((tmp$_1 = this.result_0) != null) 
          tmp$_2 = tmp$_1;
        else {
          var $receiver = new ClazzAssignment();
          $receiver.caUid = this.local$entityUid;
          tmp$_2 = $receiver;
        }
        var entry = tmp$_2;
        this.$this.setupTabs_0(entry);
        return entry;
      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);
};
  ClazzAssignmentDetailPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_0(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$ClazzAssignmentDetailPresenter$setupTabs$lambda(this$ClazzAssignmentDetailPresenter_0, closure$assignment_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzAssignmentDetailPresenter = this$ClazzAssignmentDetailPresenter_0;
    this.local$closure$assignment = closure$assignment_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$ClazzAssignmentDetailPresenter$setupTabs$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailPresenter$setupTabs$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailPresenter$setupTabs$lambda.prototype.constructor = Coroutine$ClazzAssignmentDetailPresenter$setupTabs$lambda;
  Coroutine$ClazzAssignmentDetailPresenter$setupTabs$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var loggedInPersonUid = this.local$this$ClazzAssignmentDetailPresenter.accountManager.activeAccount.personUid;
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzAssignmentDetailPresenter.db.clazzDao.personHasPermissionWithClazz_b9bd0d$(loggedInPersonUid, this.local$closure$assignment.caClazzUid, Role$Companion$PERMISSION_PERSON_LEARNINGRECORD_SELECT, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var hasStudentProgressPermission = this.result_0;
        var commonArgs = mapOf([to(UstadView$Companion_getInstance().ARG_NAV_CHILD, true.toString()), to(UstadView$Companion_getInstance().ARG_ENTITY_UID, this.local$closure$entityUid.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZUID, this.local$closure$assignment.caClazzUid.toString())]);
        var coreTabs = mutableListOf([appendQueryArgs_1(ClazzAssignmentDetailOverviewView$Companion_getInstance().VIEW_NAME, commonArgs)]);
        if (hasStudentProgressPermission) {
          var element = appendQueryArgs_1(ClazzAssignmentDetailStudentProgressOverviewListView$Companion_getInstance().VIEW_NAME, commonArgs);
          coreTabs.add_11rb$(element);
        }
        return this.local$this$ClazzAssignmentDetailPresenter.view.tabs = coreTabs , Unit;
      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 ClazzAssignmentDetailPresenter$setupTabs$lambda(this$ClazzAssignmentDetailPresenter_0, closure$assignment_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailPresenter$setupTabs$lambda(this$ClazzAssignmentDetailPresenter_0, closure$assignment_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzAssignmentDetailPresenter.prototype.setupTabs_0 = function(assignment) {
  var tmp$, tmp$_0;
  var entityUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  launch(this.presenterScope, void 0, void 0, ClazzAssignmentDetailPresenter$setupTabs$lambda(this, assignment, entityUid));
};
  ClazzAssignmentDetailPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzAssignmentDetailPresenter', 
  interfaces: [UstadDetailPresenter]};
  function ClazzAssignmentDetailStudentProgressItemListener() {
  }
  ClazzAssignmentDetailStudentProgressItemListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzAssignmentDetailStudentProgressItemListener', 
  interfaces: []};
  function ClazzAssignmentDetailStudentProgressOverviewListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.clazzUid_0 = L_1;
    this.clazzAssignmentUid_0 = L_1;
    this.searchText = null;
  }
  Object.defineProperty(ClazzAssignmentDetailStudentProgressOverviewListPresenter.prototype, 'sortOptions', {
  configurable: true, 
  get: function() {
  return ContentEntryDetailAttemptsListPresenter$Companion_getInstance().SORT_OPTIONS;
}});
  ClazzAssignmentDetailStudentProgressOverviewListPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.clazzAssignmentUid_0 = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L_1;
  this.clazzUid_0 = (tmp$_2 = (tmp$_1 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L_1;
  this.selectedSortOption = ContentEntryDetailAttemptsListPresenter$Companion_getInstance().SORT_OPTIONS.get_za3lpa$(0);
  this.mLoggedInPersonUid = this.accountManager.activeAccount.personUid;
  this.updateListOnView_0();
};
  ClazzAssignmentDetailStudentProgressOverviewListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  return false;
};
  ClazzAssignmentDetailStudentProgressOverviewListPresenter.prototype.updateListOnView_0 = function() {
  this.view.progressSummary = this.repo.clazzAssignmentDao.getProgressSummaryForAssignment_jl0yiw$(this.clazzAssignmentUid_0, this.clazzUid_0, '');
  this.view.list = this.repo.clazzAssignmentDao.getSubmitterListForAssignment_gi085m$(this.clazzAssignmentUid_0, this.clazzUid_0, replace(this.systemImpl.getString(2921, this.context), '%1$s', ''), toQueryLikeParam(this.searchText));
};
  ClazzAssignmentDetailStudentProgressOverviewListPresenter.prototype.handleClickCreateNewFab = function() {
};
  ClazzAssignmentDetailStudentProgressOverviewListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
};
  ClazzAssignmentDetailStudentProgressOverviewListPresenter.prototype.onClickSort_o8nuns$ = function(sortOption) {
  UstadListPresenter.prototype.onClickSort_o8nuns$.call(this, sortOption);
  this.updateListOnView_0();
};
  ClazzAssignmentDetailStudentProgressOverviewListPresenter.prototype.onSearchSubmitted_pdl1vj$ = function(text) {
  this.searchText = text;
  this.updateListOnView_0();
};
  ClazzAssignmentDetailStudentProgressOverviewListPresenter.prototype.onClickPerson_ylddm3$ = function(personWithAttemptsSummary) {
  this.systemImpl.go_gofqk3$(ClazzAssignmentDetailStudentProgressView$Companion_getInstance().VIEW_NAME, mapOf([to(UstadView$Companion_getInstance().ARG_SUBMITER_UID, personWithAttemptsSummary.submitterUid.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZ_ASSIGNMENT_UID, this.clazzAssignmentUid_0.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZUID, this.clazzUid_0.toString())]), this.context);
};
  ClazzAssignmentDetailStudentProgressOverviewListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzAssignmentDetailStudentProgressOverviewListPresenter', 
  interfaces: [SubmissionSummaryListener, UstadListPresenter, OnSearchSubmitted, OnSortOptionSelected]};
  function ClazzAssignmentDetailStudentProgressPresenter(context, arguments_0, view, di, lifecycleOwner, newPrivateCommentListener) {
    var tmp$, tmp$_0, tmp$_1, tmp$_2;
    if (newPrivateCommentListener === void 0) {
      newPrivateCommentListener = new DefaultNewCommentItemListener(di, context, (tmp$_0 = (tmp$ = arguments_0.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZ_ASSIGNMENT_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0, 520, false, (tmp$_2 = (tmp$_1 = arguments_0.get_11rb$(UstadView$Companion_getInstance().ARG_SUBMITER_UID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0);
    }
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.newPrivateCommentListener = newPrivateCommentListener;
    var context_0 = this.accountManager.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_3;
    var tmp$_4;
    this.statementEndpoint_3hmzcf$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_3 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_4 = typeToken(createKType(getKClass(XapiStatementEndpoint), [], false)), TypeToken) ? tmp$_4 : throwCCE(), null).provideDelegate_tpuvb9$(this, ClazzAssignmentDetailStudentProgressPresenter$statementEndpoint_metadata);
    this.selectedSubmitterUid = L0;
    this.selectedClazzAssignmentUid = L0;
    this.selectedClazzUid_0 = L0;
    this.nextSubmitterToMark_0 = L0;
  }
  var ClazzAssignmentDetailStudentProgressPresenter$statementEndpoint_metadata = new PropertyMetadata('statementEndpoint');
  Object.defineProperty(ClazzAssignmentDetailStudentProgressPresenter.prototype, 'statementEndpoint', {
  configurable: true, 
  get: function() {
  return this.statementEndpoint_3hmzcf$_0.value;
}});
  ClazzAssignmentDetailStudentProgressPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  return false;
};
  Object.defineProperty(ClazzAssignmentDetailStudentProgressPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  ClazzAssignmentDetailStudentProgressPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4;
  this.selectedSubmitterUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_SUBMITER_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  this.selectedClazzAssignmentUid = (tmp$_2 = (tmp$_1 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZ_ASSIGNMENT_UID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0;
  this.selectedClazzUid_0 = (tmp$_4 = (tmp$_3 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$_3) : null) != null ? tmp$_4 : L0;
  UstadDetailPresenter.prototype.onCreate.call(this, savedState);
};
  function Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda(closure$db_0, this$ClazzAssignmentDetailStudentProgressPresenter_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$this$ClazzAssignmentDetailStudentProgressPresenter = this$ClazzAssignmentDetailStudentProgressPresenter_0;
  }
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda;
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$closure$db.clazzAssignmentDao.findByUidWithBlockAsync_s8cxhz$(this.local$this$ClazzAssignmentDetailStudentProgressPresenter.selectedClazzAssignmentUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda(closure$db_0, this$ClazzAssignmentDetailStudentProgressPresenter_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda(closure$db_0, this$ClazzAssignmentDetailStudentProgressPresenter_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_0(this$ClazzAssignmentDetailStudentProgressPresenter_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$this$ClazzAssignmentDetailStudentProgressPresenter = this$ClazzAssignmentDetailStudentProgressPresenter_0;
    this.local$it = it_0;
  }
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_0.prototype.constructor = Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_0;
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.personDao.findByUidAsync_s8cxhz$(this.local$this$ClazzAssignmentDetailStudentProgressPresenter.selectedSubmitterUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_0(this$ClazzAssignmentDetailStudentProgressPresenter_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_0(this$ClazzAssignmentDetailStudentProgressPresenter_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_1(closure$clazzAssignment_0, this$ClazzAssignmentDetailStudentProgressPresenter_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$clazzAssignment = closure$clazzAssignment_0;
    this.local$this$ClazzAssignmentDetailStudentProgressPresenter = this$ClazzAssignmentDetailStudentProgressPresenter_0;
    this.local$it = it_0;
  }
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_1.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_1.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_1.prototype.constructor = Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_1;
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_1.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        return this.local$it.courseAssignmentSubmissionDao.getAllSubmissionsFromSubmitter_3pjtqy$(this.local$closure$clazzAssignment.caUid, this.local$this$ClazzAssignmentDetailStudentProgressPresenter.selectedSubmitterUid);
      case 1:
        throw this.exception_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 ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_1(closure$clazzAssignment_0, this$ClazzAssignmentDetailStudentProgressPresenter_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_1(closure$clazzAssignment_0, this$ClazzAssignmentDetailStudentProgressPresenter_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_2(this$ClazzAssignmentDetailStudentProgressPresenter) {
    return function(it) {
  this$ClazzAssignmentDetailStudentProgressPresenter.view.submissionScore = it;
  return Unit;
};
  }
  function ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_3(this$ClazzAssignmentDetailStudentProgressPresenter) {
    return function(it) {
  this$ClazzAssignmentDetailStudentProgressPresenter.view.submissionStatus = it != null ? it : 0;
  return Unit;
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_1($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$_0 = void 0;
    this.local$tmp$_1 = void 0;
    this.local$tmp$_2 = void 0;
    this.local$clazzAssignment = void 0;
    this.local$submitButtonVisible = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_1.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_1.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_1.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_1;
  Coroutine$onLoadEntityFromDb_7hogkd$_1.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        var mLoggedInPersonUid = this.$this.accountManager.activeAccount.personUid;
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda(this.local$db, this.$this), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        tmp$ = this.result_0;
        if (tmp$ == null) {
          throw IllegalArgumentException_init('Clazz assignment uid not found');
        }
        this.local$clazzAssignment = tmp$;
        var isGroup = !equals(this.local$clazzAssignment.caGroupUid, L0);
        this.local$tmp$_1 = this.$this.view;
        if (!isGroup) {
          this.state_0 = 3;
          this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_0(this.$this), this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.local$tmp$_0 = replace(this.$this.systemImpl.getString(2921, this.$this.context), '%1$s', this.$this.selectedSubmitterUid.toString());
          this.state_0 = 4;
          continue;
        }
      case 3:
        var person = this.result_0;
        this.local$tmp$_0 = person != null ? personFullName(person) : null;
        this.state_0 = 4;
        continue;
      case 4:
        this.local$tmp$_1.submitterName = this.local$tmp$_0;
        this.local$tmp$_2 = this.$this.view;
        this.state_0 = 5;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_1(this.local$clazzAssignment, this.$this), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        this.local$tmp$_2.clazzCourseAssignmentSubmissionAttachment = this.result_0;
        observeWithLifecycleOwner(this.local$db.courseAssignmentMarkDao.getMarkOfAssignmentForSubmitterLiveData_3pjtqy$(this.local$clazzAssignment.caUid, this.$this.selectedSubmitterUid), this.$this.lifecycleOwner, ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_2(this.$this));
        observeWithLifecycleOwner(this.local$db.courseAssignmentSubmissionDao.getStatusOfAssignmentForSubmitter_3pjtqy$(this.local$clazzAssignment.caUid, this.$this.selectedSubmitterUid), this.$this.lifecycleOwner, ClazzAssignmentDetailStudentProgressPresenter$onLoadEntityFromDb$lambda_3(this.$this));
        this.state_0 = 6;
        this.result_0 = this.$this.repo.courseAssignmentSubmissionDao.countSubmissionsFromSubmitter_3pjtqy$(this.local$clazzAssignment.caUid, this.$this.selectedSubmitterUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 6:
        var submissionCount = this.result_0;
        this.local$submitButtonVisible = submissionCount > 0;
        this.$this.view.submitButtonVisible = this.local$submitButtonVisible;
        this.state_0 = 7;
        this.result_0 = this.$this.repo.courseAssignmentMarkDao.findNextSubmitterToMarkForAssignment_3pjtqy$(this.$this.selectedClazzAssignmentUid, this.$this.selectedSubmitterUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 7:
        this.$this.nextSubmitterToMark_0 = this.result_0;
        this.$this.view.markNextStudentVisible = (this.local$submitButtonVisible && !equals(this.$this.nextSubmitterToMark_0, L0));
        if (this.local$clazzAssignment.caPrivateCommentsEnabled) {
          this.$this.view.clazzAssignmentPrivateComments = this.local$db.commentsDao.findPrivateByEntityTypeAndUidAndForPersonLive2_h639zw$(520, this.local$clazzAssignment.caUid, this.$this.selectedSubmitterUid);
        }
        return this.local$clazzAssignment;
      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);
};
  ClazzAssignmentDetailStudentProgressPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_1(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickOpenSubmission$lambda(closure$submissionCourse_0, this$ClazzAssignmentDetailStudentProgressPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 10;
    this.local$closure$submissionCourse = closure$submissionCourse_0;
    this.local$this$ClazzAssignmentDetailStudentProgressPresenter = this$ClazzAssignmentDetailStudentProgressPresenter_0;
    this.local$tmp$_0 = void 0;
    this.local$tmp$_1 = void 0;
    this.local$attachment = void 0;
  }
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickOpenSubmission$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickOpenSubmission$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickOpenSubmission$lambda.prototype.constructor = Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickOpenSubmission$lambda;
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickOpenSubmission$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        var tmp$_0;
        if (this.local$closure$submissionCourse.casType === 1) {
          var args = LinkedHashMap_init();
          var key = HtmlTextViewDetailView$Companion_getInstance().DISPLAY_TEXT;
          var value = (tmp$ = this.local$closure$submissionCourse.casText) != null ? tmp$ : '';
          args.put_xwzc9p$(key, value);
          return this.local$this$ClazzAssignmentDetailStudentProgressPresenter.requireNavController().navigate_oc2wlg$(HtmlTextViewDetailView$Companion_getInstance().VIEW_NAME, args) , Unit;
        } else {
          if (this.local$closure$submissionCourse.casType === 2) {
            this.local$tmp$_0 = this.local$closure$submissionCourse.attachment;
            if (this.local$tmp$_0 == null) {
              return;
            } else {
              this.state_0 = 1;
              continue;
            }
          } else {
            this.state_0 = 9;
            continue;
          }
        }
      case 1:
        this.local$attachment = this.local$tmp$_0;
        this.local$tmp$_1 = this.local$attachment.casaUri;
        if (this.local$tmp$_1 == null) {
          return;
        } else {
          this.state_0 = 2;
          continue;
        }
      case 2:
        var uri = this.local$tmp$_1;
        this.state_0 = 3;
        this.result_0 = retrieveAttachment(this.local$this$ClazzAssignmentDetailStudentProgressPresenter.repo, uri, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var doorUri = this.result_0;
        this.exceptionState_0 = 4;
        return this.local$this$ClazzAssignmentDetailStudentProgressPresenter.systemImpl.openFileInDefaultViewer_t9zcln$(this.local$this$ClazzAssignmentDetailStudentProgressPresenter.context, doorUri, this.local$attachment.casaMimeType, (tmp$_0 = this.local$closure$submissionCourse.attachment) != null ? tmp$_0.casaFileName : null) , Unit;
      case 4:
        this.exceptionState_0 = 10;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          if (Kotlin.isType(e, NoAppFoundException)) {
            return this.local$this$ClazzAssignmentDetailStudentProgressPresenter.view.showSnackBar_9pu0dj$(this.local$this$ClazzAssignmentDetailStudentProgressPresenter.systemImpl.getString(2166, this.local$this$ClazzAssignmentDetailStudentProgressPresenter.context)) , Unit;
          } else {
            var message = e.message;
            if (message != null) {
              return this.local$this$ClazzAssignmentDetailStudentProgressPresenter.view.showSnackBar_9pu0dj$(message) , Unit;
            } else {
              this.state_0 = 5;
              continue;
            }
          }
        } else {
          throw e;
        }
      case 5:
        this.state_0 = 6;
        continue;
      case 6:
        this.state_0 = 7;
        continue;
      case 7:
        this.state_0 = 8;
        continue;
      case 8:
        this.state_0 = 9;
        continue;
      case 9:
        this.state_0 = 11;
        continue;
      case 10:
        throw this.exception_0;
      case 11:
        return Unit;
      default:
        this.state_0 = 10;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 10) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function ClazzAssignmentDetailStudentProgressPresenter$onClickOpenSubmission$lambda(closure$submissionCourse_0, this$ClazzAssignmentDetailStudentProgressPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickOpenSubmission$lambda(closure$submissionCourse_0, this$ClazzAssignmentDetailStudentProgressPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzAssignmentDetailStudentProgressPresenter.prototype.onClickOpenSubmission_gh2dp9$ = function(submissionCourse) {
  launch(this.presenterScope, void 0, void 0, ClazzAssignmentDetailStudentProgressPresenter$onClickOpenSubmission$lambda(submissionCourse, this));
};
  function Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda$lambda(this$ClazzAssignmentDetailStudentProgressPresenter_0, closure$assignment_0, closure$grade_0, txDb_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$this$ClazzAssignmentDetailStudentProgressPresenter = this$ClazzAssignmentDetailStudentProgressPresenter_0;
    this.local$closure$assignment = closure$assignment_0;
    this.local$closure$grade = closure$grade_0;
    this.local$tmp$ = void 0;
    this.local$txDb = txDb_0;
  }
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda$lambda.prototype.constructor = Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda$lambda;
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
        this.state_0 = 2;
        this.result_0 = this.local$txDb.courseAssignmentSubmissionDao.findLastSubmissionFromStudent_3pjtqy$(this.local$this$ClazzAssignmentDetailStudentProgressPresenter.selectedSubmitterUid, this.local$closure$assignment.caUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$tmp$ = this.result_0;
        if (this.local$tmp$ == null) {
          return;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 3:
        var lastSubmission = this.local$tmp$;
        var penalty = (tmp$_0 = (tmp$ = this.local$closure$assignment.block) != null ? tmp$.cbLateSubmissionPenalty : null) != null ? tmp$_0 : 0;
        if (lastSubmission.casTimestamp.compareTo_11rb$((tmp$_2 = (tmp$_1 = this.local$closure$assignment.block) != null ? tmp$_1.cbDeadlineDate : null) != null ? tmp$_2 : L0) > 0) {
          var reducedGrade = this.local$closure$grade * penalty / 100;
          tmp$_3 = roundTo(this.local$closure$grade - reducedGrade, 2);
        } else {
          tmp$_3 = roundTo(this.local$closure$grade, 2);
        }
        var gradeAfterPenalty = tmp$_3;
        var tmp$_4 = this.local$txDb.courseAssignmentMarkDao;
        var $receiver = new CourseAssignmentMark();
        var this$ClazzAssignmentDetailStudentProgressPresenter = this.local$this$ClazzAssignmentDetailStudentProgressPresenter;
        var closure$assignment = this.local$closure$assignment;
        var tmp$_5, tmp$_6;
        $receiver.camSubmitterUid = this$ClazzAssignmentDetailStudentProgressPresenter.selectedSubmitterUid;
        $receiver.camAssignmentUid = closure$assignment.caUid;
        $receiver.camMark = gradeAfterPenalty;
        $receiver.camPenalty = lastSubmission.casTimestamp.compareTo_11rb$((tmp$_6 = (tmp$_5 = closure$assignment.block) != null ? tmp$_5.cbDeadlineDate : null) != null ? tmp$_6 : L0) > 0 ? penalty : 0;
        this.state_0 = 4;
        this.result_0 = tmp$_4.insertAsync($receiver, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        return this.local$this$ClazzAssignmentDetailStudentProgressPresenter.view.showSnackBar_9pu0dj$(this.local$this$ClazzAssignmentDetailStudentProgressPresenter.systemImpl.getString(2842, this.local$this$ClazzAssignmentDetailStudentProgressPresenter.context)) , Unit;
      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 ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda$lambda(this$ClazzAssignmentDetailStudentProgressPresenter_0, closure$assignment_0, closure$grade_0) {
    return function(txDb_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda$lambda(this$ClazzAssignmentDetailStudentProgressPresenter_0, closure$assignment_0, closure$grade_0, txDb_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda(this$ClazzAssignmentDetailStudentProgressPresenter_0, closure$assignment_0, closure$grade_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzAssignmentDetailStudentProgressPresenter = this$ClazzAssignmentDetailStudentProgressPresenter_0;
    this.local$closure$assignment = closure$assignment_0;
    this.local$closure$grade = closure$grade_0;
  }
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda.prototype.constructor = Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda;
  Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = withDoorTransactionAsync(this.local$this$ClazzAssignmentDetailStudentProgressPresenter.repo, getKClass(UmAppDatabase), ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda$lambda(this.local$this$ClazzAssignmentDetailStudentProgressPresenter, this.local$closure$assignment, this.local$closure$grade), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda(this$ClazzAssignmentDetailStudentProgressPresenter_0, closure$assignment_0, closure$grade_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda(this$ClazzAssignmentDetailStudentProgressPresenter_0, closure$assignment_0, closure$grade_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzAssignmentDetailStudentProgressPresenter.prototype.onClickSubmitGrade_mx4ult$ = function(grade) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  var maxPoints = (tmp$_1 = (tmp$_0 = (tmp$ = this.entity) != null ? tmp$.block : null) != null ? tmp$_0.cbMaxPoints : null) != null ? tmp$_1 : 10;
  if (grade < 0 || grade > maxPoints) {
    this.view.submitMarkError = replace(this.systemImpl.getString(2951, this.context), '%1$s', maxPoints.toString());
    return false;
  }
  tmp$_2 = this.view.entity;
  if (tmp$_2 == null) {
    return false;
  }
  var assignment = tmp$_2;
  launch(this.presenterScope, void 0, void 0, ClazzAssignmentDetailStudentProgressPresenter$onClickSubmitGrade$lambda(this, assignment, grade));
  return true;
};
  ClazzAssignmentDetailStudentProgressPresenter.prototype.onClickSubmitGradeAndMarkNext_mx4ult$ = function(grade) {
  var isValid = this.onClickSubmitGrade_mx4ult$(grade);
  if (!isValid) {
    return;
  }
  this.systemImpl.go_henhri$(ClazzAssignmentDetailStudentProgressView$Companion_getInstance().VIEW_NAME, mapOf([to(UstadView$Companion_getInstance().ARG_SUBMITER_UID, this.nextSubmitterToMark_0.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZ_ASSIGNMENT_UID, this.selectedClazzAssignmentUid.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZUID, this.selectedClazzUid_0.toString())]), this.context, new UstadMobileSystemCommon$UstadGoOptions(UstadView$Companion_getInstance().CURRENT_DEST, true));
};
  ClazzAssignmentDetailStudentProgressPresenter.prototype.addComment_61zpoe$ = function(text) {
  return this.newPrivateCommentListener.addComment_61zpoe$(text);
};
  ClazzAssignmentDetailStudentProgressPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzAssignmentDetailStudentProgressPresenter', 
  interfaces: [NewCommentItemListener, UstadDetailPresenter]};
  function ClazzAssignmentEditPresenter(context, arguments_0, view, lifecycleOwner, di) {
    ClazzAssignmentEditPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.onLoadJsonComplete_0 = CompletableDeferred();
    var tmp$;
    this.json_59i48w$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, ClazzAssignmentEditPresenter$json_metadata);
    this.clazzUid_0 = L0;
  }
  var ClazzAssignmentEditPresenter$json_metadata = new PropertyMetadata('json');
  Object.defineProperty(ClazzAssignmentEditPresenter.prototype, 'json_0', {
  configurable: true, 
  get: function() {
  return this.json_59i48w$_0.value;
}});
  function ClazzAssignmentEditPresenter$TextLimitTypeOptions(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ClazzAssignmentEditPresenter$TextLimitTypeOptions_initFields() {
    ClazzAssignmentEditPresenter$TextLimitTypeOptions_initFields = function() {
};
    ClazzAssignmentEditPresenter$TextLimitTypeOptions$WORDS_instance = new ClazzAssignmentEditPresenter$TextLimitTypeOptions('WORDS', 0, 1, 2868);
    ClazzAssignmentEditPresenter$TextLimitTypeOptions$CHARS_instance = new ClazzAssignmentEditPresenter$TextLimitTypeOptions('CHARS', 1, 2, 2869);
  }
  var ClazzAssignmentEditPresenter$TextLimitTypeOptions$WORDS_instance;
  function ClazzAssignmentEditPresenter$TextLimitTypeOptions$WORDS_getInstance() {
    ClazzAssignmentEditPresenter$TextLimitTypeOptions_initFields();
    return ClazzAssignmentEditPresenter$TextLimitTypeOptions$WORDS_instance;
  }
  var ClazzAssignmentEditPresenter$TextLimitTypeOptions$CHARS_instance;
  function ClazzAssignmentEditPresenter$TextLimitTypeOptions$CHARS_getInstance() {
    ClazzAssignmentEditPresenter$TextLimitTypeOptions_initFields();
    return ClazzAssignmentEditPresenter$TextLimitTypeOptions$CHARS_instance;
  }
  ClazzAssignmentEditPresenter$TextLimitTypeOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'TextLimitTypeOptions', 
  interfaces: [Enum]};
  function ClazzAssignmentEditPresenter$TextLimitTypeOptions$values() {
    return [ClazzAssignmentEditPresenter$TextLimitTypeOptions$WORDS_getInstance(), ClazzAssignmentEditPresenter$TextLimitTypeOptions$CHARS_getInstance()];
  }
  ClazzAssignmentEditPresenter$TextLimitTypeOptions.values = ClazzAssignmentEditPresenter$TextLimitTypeOptions$values;
  function ClazzAssignmentEditPresenter$TextLimitTypeOptions$valueOf(name) {
    switch (name) {
      case 'WORDS':
        return ClazzAssignmentEditPresenter$TextLimitTypeOptions$WORDS_getInstance();
      case 'CHARS':
        return ClazzAssignmentEditPresenter$TextLimitTypeOptions$CHARS_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ClazzAssignmentEditPresenter.TextLimitTypeOptions.' + name);
    }
  }
  ClazzAssignmentEditPresenter$TextLimitTypeOptions.valueOf_61zpoe$ = ClazzAssignmentEditPresenter$TextLimitTypeOptions$valueOf;
  function ClazzAssignmentEditPresenter$TextLimitTypeOptionsMessageIdOption(day, context, di) {
    MessageIdOption.call(this, day.messageId, context, day.optionVal, di);
  }
  ClazzAssignmentEditPresenter$TextLimitTypeOptionsMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'TextLimitTypeOptionsMessageIdOption', 
  interfaces: [MessageIdOption]};
  function ClazzAssignmentEditPresenter$CompletionCriteriaOptions(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ClazzAssignmentEditPresenter$CompletionCriteriaOptions_initFields() {
    ClazzAssignmentEditPresenter$CompletionCriteriaOptions_initFields = function() {
};
    ClazzAssignmentEditPresenter$CompletionCriteriaOptions$SUBMITTED_instance = new ClazzAssignmentEditPresenter$CompletionCriteriaOptions('SUBMITTED', 0, 100, 2573);
    ClazzAssignmentEditPresenter$CompletionCriteriaOptions$GRADED_instance = new ClazzAssignmentEditPresenter$CompletionCriteriaOptions('GRADED', 1, 102, 2866);
  }
  var ClazzAssignmentEditPresenter$CompletionCriteriaOptions$SUBMITTED_instance;
  function ClazzAssignmentEditPresenter$CompletionCriteriaOptions$SUBMITTED_getInstance() {
    ClazzAssignmentEditPresenter$CompletionCriteriaOptions_initFields();
    return ClazzAssignmentEditPresenter$CompletionCriteriaOptions$SUBMITTED_instance;
  }
  var ClazzAssignmentEditPresenter$CompletionCriteriaOptions$GRADED_instance;
  function ClazzAssignmentEditPresenter$CompletionCriteriaOptions$GRADED_getInstance() {
    ClazzAssignmentEditPresenter$CompletionCriteriaOptions_initFields();
    return ClazzAssignmentEditPresenter$CompletionCriteriaOptions$GRADED_instance;
  }
  ClazzAssignmentEditPresenter$CompletionCriteriaOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'CompletionCriteriaOptions', 
  interfaces: [Enum]};
  function ClazzAssignmentEditPresenter$CompletionCriteriaOptions$values() {
    return [ClazzAssignmentEditPresenter$CompletionCriteriaOptions$SUBMITTED_getInstance(), ClazzAssignmentEditPresenter$CompletionCriteriaOptions$GRADED_getInstance()];
  }
  ClazzAssignmentEditPresenter$CompletionCriteriaOptions.values = ClazzAssignmentEditPresenter$CompletionCriteriaOptions$values;
  function ClazzAssignmentEditPresenter$CompletionCriteriaOptions$valueOf(name) {
    switch (name) {
      case 'SUBMITTED':
        return ClazzAssignmentEditPresenter$CompletionCriteriaOptions$SUBMITTED_getInstance();
      case 'GRADED':
        return ClazzAssignmentEditPresenter$CompletionCriteriaOptions$GRADED_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ClazzAssignmentEditPresenter.CompletionCriteriaOptions.' + name);
    }
  }
  ClazzAssignmentEditPresenter$CompletionCriteriaOptions.valueOf_61zpoe$ = ClazzAssignmentEditPresenter$CompletionCriteriaOptions$valueOf;
  function ClazzAssignmentEditPresenter$CompletionCriteriaOptionsMessageIdOption(day, context, di) {
    MessageIdOption.call(this, day.messageId, context, day.optionVal, di);
  }
  ClazzAssignmentEditPresenter$CompletionCriteriaOptionsMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'CompletionCriteriaOptionsMessageIdOption', 
  interfaces: [MessageIdOption]};
  function ClazzAssignmentEditPresenter$SubmissionPolicyOptions(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ClazzAssignmentEditPresenter$SubmissionPolicyOptions_initFields() {
    ClazzAssignmentEditPresenter$SubmissionPolicyOptions_initFields = function() {
};
    ClazzAssignmentEditPresenter$SubmissionPolicyOptions$SUBMIT_ALL_AT_ONCE_instance = new ClazzAssignmentEditPresenter$SubmissionPolicyOptions('SUBMIT_ALL_AT_ONCE', 0, 1, 2946);
    ClazzAssignmentEditPresenter$SubmissionPolicyOptions$MULTIPLE_SUBMISSIONS_instance = new ClazzAssignmentEditPresenter$SubmissionPolicyOptions('MULTIPLE_SUBMISSIONS', 1, 2, 2947);
  }
  var ClazzAssignmentEditPresenter$SubmissionPolicyOptions$SUBMIT_ALL_AT_ONCE_instance;
  function ClazzAssignmentEditPresenter$SubmissionPolicyOptions$SUBMIT_ALL_AT_ONCE_getInstance() {
    ClazzAssignmentEditPresenter$SubmissionPolicyOptions_initFields();
    return ClazzAssignmentEditPresenter$SubmissionPolicyOptions$SUBMIT_ALL_AT_ONCE_instance;
  }
  var ClazzAssignmentEditPresenter$SubmissionPolicyOptions$MULTIPLE_SUBMISSIONS_instance;
  function ClazzAssignmentEditPresenter$SubmissionPolicyOptions$MULTIPLE_SUBMISSIONS_getInstance() {
    ClazzAssignmentEditPresenter$SubmissionPolicyOptions_initFields();
    return ClazzAssignmentEditPresenter$SubmissionPolicyOptions$MULTIPLE_SUBMISSIONS_instance;
  }
  ClazzAssignmentEditPresenter$SubmissionPolicyOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SubmissionPolicyOptions', 
  interfaces: [Enum]};
  function ClazzAssignmentEditPresenter$SubmissionPolicyOptions$values() {
    return [ClazzAssignmentEditPresenter$SubmissionPolicyOptions$SUBMIT_ALL_AT_ONCE_getInstance(), ClazzAssignmentEditPresenter$SubmissionPolicyOptions$MULTIPLE_SUBMISSIONS_getInstance()];
  }
  ClazzAssignmentEditPresenter$SubmissionPolicyOptions.values = ClazzAssignmentEditPresenter$SubmissionPolicyOptions$values;
  function ClazzAssignmentEditPresenter$SubmissionPolicyOptions$valueOf(name) {
    switch (name) {
      case 'SUBMIT_ALL_AT_ONCE':
        return ClazzAssignmentEditPresenter$SubmissionPolicyOptions$SUBMIT_ALL_AT_ONCE_getInstance();
      case 'MULTIPLE_SUBMISSIONS':
        return ClazzAssignmentEditPresenter$SubmissionPolicyOptions$MULTIPLE_SUBMISSIONS_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ClazzAssignmentEditPresenter.SubmissionPolicyOptions.' + name);
    }
  }
  ClazzAssignmentEditPresenter$SubmissionPolicyOptions.valueOf_61zpoe$ = ClazzAssignmentEditPresenter$SubmissionPolicyOptions$valueOf;
  function ClazzAssignmentEditPresenter$SubmissionPolicyOptionsMessageIdOption(day, context, di) {
    MessageIdOption.call(this, day.messageId, context, day.optionVal, di);
  }
  ClazzAssignmentEditPresenter$SubmissionPolicyOptionsMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SubmissionPolicyOptionsMessageIdOption', 
  interfaces: [MessageIdOption]};
  function ClazzAssignmentEditPresenter$FileTypeOptions(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ClazzAssignmentEditPresenter$FileTypeOptions_initFields() {
    ClazzAssignmentEditPresenter$FileTypeOptions_initFields = function() {
};
    ClazzAssignmentEditPresenter$FileTypeOptions$ANY_instance = new ClazzAssignmentEditPresenter$FileTypeOptions('ANY', 0, 0, 2860);
    ClazzAssignmentEditPresenter$FileTypeOptions$DOCUMENT_instance = new ClazzAssignmentEditPresenter$FileTypeOptions('DOCUMENT', 1, 1, 2861);
    ClazzAssignmentEditPresenter$FileTypeOptions$IMAGE_instance = new ClazzAssignmentEditPresenter$FileTypeOptions('IMAGE', 2, 2, 2862);
    ClazzAssignmentEditPresenter$FileTypeOptions$VIDEO_instance = new ClazzAssignmentEditPresenter$FileTypeOptions('VIDEO', 3, 3, 2699);
    ClazzAssignmentEditPresenter$FileTypeOptions$AUDIO_instance = new ClazzAssignmentEditPresenter$FileTypeOptions('AUDIO', 4, 4, 2109);
  }
  var ClazzAssignmentEditPresenter$FileTypeOptions$ANY_instance;
  function ClazzAssignmentEditPresenter$FileTypeOptions$ANY_getInstance() {
    ClazzAssignmentEditPresenter$FileTypeOptions_initFields();
    return ClazzAssignmentEditPresenter$FileTypeOptions$ANY_instance;
  }
  var ClazzAssignmentEditPresenter$FileTypeOptions$DOCUMENT_instance;
  function ClazzAssignmentEditPresenter$FileTypeOptions$DOCUMENT_getInstance() {
    ClazzAssignmentEditPresenter$FileTypeOptions_initFields();
    return ClazzAssignmentEditPresenter$FileTypeOptions$DOCUMENT_instance;
  }
  var ClazzAssignmentEditPresenter$FileTypeOptions$IMAGE_instance;
  function ClazzAssignmentEditPresenter$FileTypeOptions$IMAGE_getInstance() {
    ClazzAssignmentEditPresenter$FileTypeOptions_initFields();
    return ClazzAssignmentEditPresenter$FileTypeOptions$IMAGE_instance;
  }
  var ClazzAssignmentEditPresenter$FileTypeOptions$VIDEO_instance;
  function ClazzAssignmentEditPresenter$FileTypeOptions$VIDEO_getInstance() {
    ClazzAssignmentEditPresenter$FileTypeOptions_initFields();
    return ClazzAssignmentEditPresenter$FileTypeOptions$VIDEO_instance;
  }
  var ClazzAssignmentEditPresenter$FileTypeOptions$AUDIO_instance;
  function ClazzAssignmentEditPresenter$FileTypeOptions$AUDIO_getInstance() {
    ClazzAssignmentEditPresenter$FileTypeOptions_initFields();
    return ClazzAssignmentEditPresenter$FileTypeOptions$AUDIO_instance;
  }
  ClazzAssignmentEditPresenter$FileTypeOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'FileTypeOptions', 
  interfaces: [Enum]};
  function ClazzAssignmentEditPresenter$FileTypeOptions$values() {
    return [ClazzAssignmentEditPresenter$FileTypeOptions$ANY_getInstance(), ClazzAssignmentEditPresenter$FileTypeOptions$DOCUMENT_getInstance(), ClazzAssignmentEditPresenter$FileTypeOptions$IMAGE_getInstance(), ClazzAssignmentEditPresenter$FileTypeOptions$VIDEO_getInstance(), ClazzAssignmentEditPresenter$FileTypeOptions$AUDIO_getInstance()];
  }
  ClazzAssignmentEditPresenter$FileTypeOptions.values = ClazzAssignmentEditPresenter$FileTypeOptions$values;
  function ClazzAssignmentEditPresenter$FileTypeOptions$valueOf(name) {
    switch (name) {
      case 'ANY':
        return ClazzAssignmentEditPresenter$FileTypeOptions$ANY_getInstance();
      case 'DOCUMENT':
        return ClazzAssignmentEditPresenter$FileTypeOptions$DOCUMENT_getInstance();
      case 'IMAGE':
        return ClazzAssignmentEditPresenter$FileTypeOptions$IMAGE_getInstance();
      case 'VIDEO':
        return ClazzAssignmentEditPresenter$FileTypeOptions$VIDEO_getInstance();
      case 'AUDIO':
        return ClazzAssignmentEditPresenter$FileTypeOptions$AUDIO_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ClazzAssignmentEditPresenter.FileTypeOptions.' + name);
    }
  }
  ClazzAssignmentEditPresenter$FileTypeOptions.valueOf_61zpoe$ = ClazzAssignmentEditPresenter$FileTypeOptions$valueOf;
  function ClazzAssignmentEditPresenter$FileTypeOptionsMessageIdOption(day, context, di) {
    MessageIdOption.call(this, day.messageId, context, day.optionVal, di);
  }
  ClazzAssignmentEditPresenter$FileTypeOptionsMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'FileTypeOptionsMessageIdOption', 
  interfaces: [MessageIdOption]};
  Object.defineProperty(ClazzAssignmentEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$JSON_getInstance();
}});
  ClazzAssignmentEditPresenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
  var tmp$ = this.view;
  var $receiver = ClazzAssignmentEditPresenter$CompletionCriteriaOptions$values();
  var destination = ArrayList_init_0($receiver.length);
  var tmp$_0;
  for (tmp$_0 = 0; tmp$_0 !== $receiver.length; ++tmp$_0) {
    var item = $receiver[tmp$_0];
    destination.add_11rb$(new ClazzAssignmentEditPresenter$CompletionCriteriaOptionsMessageIdOption(item, this.context, this.di));
  }
  tmp$.completionCriteriaOptions = destination;
  var tmp$_1 = this.view;
  var $receiver_0 = ClazzAssignmentEditPresenter$SubmissionPolicyOptions$values();
  var destination_0 = ArrayList_init_0($receiver_0.length);
  var tmp$_2;
  for (tmp$_2 = 0; tmp$_2 !== $receiver_0.length; ++tmp$_2) {
    var item_0 = $receiver_0[tmp$_2];
    destination_0.add_11rb$(new ClazzAssignmentEditPresenter$SubmissionPolicyOptionsMessageIdOption(item_0, this.context, this.di));
  }
  tmp$_1.submissionPolicyOptions = destination_0;
  var tmp$_3 = this.view;
  var $receiver_1 = ClazzAssignmentEditPresenter$FileTypeOptions$values();
  var destination_1 = ArrayList_init_0($receiver_1.length);
  var tmp$_4;
  for (tmp$_4 = 0; tmp$_4 !== $receiver_1.length; ++tmp$_4) {
    var item_1 = $receiver_1[tmp$_4];
    destination_1.add_11rb$(new ClazzAssignmentEditPresenter$FileTypeOptionsMessageIdOption(item_1, this.context, this.di));
  }
  tmp$_3.fileTypeOptions = destination_1;
  var tmp$_5 = this.view;
  var $receiver_2 = ClazzAssignmentEditPresenter$TextLimitTypeOptions$values();
  var destination_2 = ArrayList_init_0($receiver_2.length);
  var tmp$_6;
  for (tmp$_6 = 0; tmp$_6 !== $receiver_2.length; ++tmp$_6) {
    var item_2 = $receiver_2[tmp$_6];
    destination_2.add_11rb$(new ClazzAssignmentEditPresenter$TextLimitTypeOptionsMessageIdOption(item_2, this.context, this.di));
  }
  tmp$_5.textLimitTypeOptions = destination_2;
};
  function Coroutine$ClazzAssignmentEditPresenter$onLoadDataComplete$lambda$lambda(this$ClazzAssignmentEditPresenter_0, closure$group_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzAssignmentEditPresenter = this$ClazzAssignmentEditPresenter_0;
    this.local$closure$group = closure$group_0;
  }
  Coroutine$ClazzAssignmentEditPresenter$onLoadDataComplete$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentEditPresenter$onLoadDataComplete$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentEditPresenter$onLoadDataComplete$lambda$lambda.prototype.constructor = Coroutine$ClazzAssignmentEditPresenter$onLoadDataComplete$lambda$lambda;
  Coroutine$ClazzAssignmentEditPresenter$onLoadDataComplete$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzAssignmentEditPresenter.onLoadJsonComplete_0.await(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
                (tmp$_0 = (tmp$ = this.local$this$ClazzAssignmentEditPresenter.entity) != null ? tmp$.assignment : null) != null ? (tmp$_0.caGroupUid = this.local$closure$group.cgsUid) : null;
        this.local$this$ClazzAssignmentEditPresenter.view.groupSet = this.local$closure$group;
        this.local$this$ClazzAssignmentEditPresenter.view.entity = this.local$this$ClazzAssignmentEditPresenter.entity;
        return this.local$this$ClazzAssignmentEditPresenter.requireSavedStateHandle().set_umlfku$(ClazzAssignmentEditPresenter$Companion_getInstance().SAVEDSTATE_KEY_SUBMISSION_TYPE, null) , Unit;
      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 ClazzAssignmentEditPresenter$onLoadDataComplete$lambda$lambda(this$ClazzAssignmentEditPresenter_0, closure$group_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentEditPresenter$onLoadDataComplete$lambda$lambda(this$ClazzAssignmentEditPresenter_0, closure$group_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function ClazzAssignmentEditPresenter$onLoadDataComplete$lambda(this$ClazzAssignmentEditPresenter) {
    return function(it) {
  var tmp$;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var group = tmp$;
  launch(this$ClazzAssignmentEditPresenter.presenterScope, doorMainDispatcher(), void 0, ClazzAssignmentEditPresenter$onLoadDataComplete$lambda$lambda(this$ClazzAssignmentEditPresenter, group));
  return Unit;
};
  }
  ClazzAssignmentEditPresenter.prototype.onLoadDataComplete = function() {
  UstadEditPresenter.prototype.onLoadDataComplete.call(this);
  this.observeSavedStateResult_27fjeh$(ClazzAssignmentEditPresenter$Companion_getInstance().SAVEDSTATE_KEY_SUBMISSION_TYPE, ListSerializer(CourseGroupSet.Companion.serializer()), getKClass(CourseGroupSet), new DoorObserver(ClazzAssignmentEditPresenter$onLoadDataComplete$lambda(this)));
};
  function ClazzAssignmentEditPresenter$onLoadFromJson$lambda$lambda(this$ClazzAssignmentEditPresenter) {
    return function(it) {
  this$ClazzAssignmentEditPresenter.view.groupSetEnabled = (it != null ? it : true) === true;
  return Unit;
};
  }
  function Coroutine$ClazzAssignmentEditPresenter$onLoadFromJson$lambda$lambda(this$ClazzAssignmentEditPresenter_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$this$ClazzAssignmentEditPresenter = this$ClazzAssignmentEditPresenter_0;
    this.local$it = it_0;
  }
  Coroutine$ClazzAssignmentEditPresenter$onLoadFromJson$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentEditPresenter$onLoadFromJson$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentEditPresenter$onLoadFromJson$lambda$lambda.prototype.constructor = Coroutine$ClazzAssignmentEditPresenter$onLoadFromJson$lambda$lambda;
  Coroutine$ClazzAssignmentEditPresenter$onLoadFromJson$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.clazzDao.getClazzWithSchool_s8cxhz$(this.local$this$ClazzAssignmentEditPresenter.clazzUid_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ClazzAssignmentEditPresenter$onLoadFromJson$lambda$lambda_0(this$ClazzAssignmentEditPresenter_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentEditPresenter$onLoadFromJson$lambda$lambda(this$ClazzAssignmentEditPresenter_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ClazzAssignmentEditPresenter$onLoadFromJson$lambda(this$ClazzAssignmentEditPresenter_0, closure$editEntity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzAssignmentEditPresenter = this$ClazzAssignmentEditPresenter_0;
    this.local$closure$editEntity = closure$editEntity_0;
    this.local$clazzWithSchool = void 0;
  }
  Coroutine$ClazzAssignmentEditPresenter$onLoadFromJson$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentEditPresenter$onLoadFromJson$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentEditPresenter$onLoadFromJson$lambda.prototype.constructor = Coroutine$ClazzAssignmentEditPresenter$onLoadFromJson$lambda;
  Coroutine$ClazzAssignmentEditPresenter$onLoadFromJson$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6, tmp$_7, tmp$_8, tmp$_9;
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzAssignmentEditPresenter.db.courseGroupSetDao.findByUid((tmp$_0 = (tmp$ = this.local$closure$editEntity.assignment) != null ? tmp$.caGroupUid : null) != null ? tmp$_0 : L0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var group = fallbackIndividualSet(this.result_0, this.local$this$ClazzAssignmentEditPresenter.systemImpl, this.local$this$ClazzAssignmentEditPresenter.context);
        this.local$this$ClazzAssignmentEditPresenter.view.groupSet = group;
        observeWithLifecycleOwner(this.local$this$ClazzAssignmentEditPresenter.repo.courseAssignmentSubmissionDao.checkNoSubmissionsMade_s8cxhz$((tmp$_2 = (tmp$_1 = this.local$closure$editEntity.assignment) != null ? tmp$_1.caUid : null) != null ? tmp$_2 : L0), this.local$this$ClazzAssignmentEditPresenter.lifecycleOwner, ClazzAssignmentEditPresenter$onLoadFromJson$lambda$lambda(this.local$this$ClazzAssignmentEditPresenter));
        this.local$this$ClazzAssignmentEditPresenter.clazzUid_0 = (tmp$_6 = (tmp$_5 = (tmp$_3 = this.local$closure$editEntity.assignment) != null ? tmp$_3.caClazzUid : null) != null ? tmp$_5 : (tmp$_4 = this.local$this$ClazzAssignmentEditPresenter.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$_4) : null) != null ? tmp$_6 : L0;
        this.state_0 = 3;
        this.result_0 = onRepoWithFallbackToDb(this.local$this$ClazzAssignmentEditPresenter.db, L2000, ClazzAssignmentEditPresenter$onLoadFromJson$lambda$lambda_0(this.local$this$ClazzAssignmentEditPresenter), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$clazzWithSchool = (tmp$_7 = this.result_0) != null ? tmp$_7 : new ClazzWithSchool();
        var terminologyUid = (tmp$_9 = (tmp$_8 = this.local$this$ClazzAssignmentEditPresenter.arguments.get_11rb$(ClazzAssignmentEditView$Companion_getInstance().TERMINOLOGY_ID)) != null ? toLongOrNull(tmp$_8) : null) != null ? tmp$_9 : this.local$clazzWithSchool.clazzTerminologyUid;
        this.state_0 = 4;
        this.result_0 = this.local$this$ClazzAssignmentEditPresenter.db.courseTerminologyDao.findByUid(terminologyUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        var terminology = this.result_0;
        var termMap = toTermMap(terminology, this.local$this$ClazzAssignmentEditPresenter.json_0, this.local$this$ClazzAssignmentEditPresenter.systemImpl, this.local$this$ClazzAssignmentEditPresenter.context);
        this.local$this$ClazzAssignmentEditPresenter.view.markingTypeOptions = listOf([new IdOption(getValue(termMap, TerminologyKeys_getInstance().TEACHER_KEY), 1), new MessageIdOption(2857, this.local$this$ClazzAssignmentEditPresenter.context, 2, this.local$this$ClazzAssignmentEditPresenter.di)]);
        var timeZone = effectiveTimeZone(this.local$clazzWithSchool);
        this.local$this$ClazzAssignmentEditPresenter.view.timeZone = timeZone;
        this.local$this$ClazzAssignmentEditPresenter.loadEntityIntoDateTime_gqx91x$(this.local$closure$editEntity);
        return this.local$this$ClazzAssignmentEditPresenter.onLoadJsonComplete_0.complete_11rb$(true);
      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 ClazzAssignmentEditPresenter$onLoadFromJson$lambda(this$ClazzAssignmentEditPresenter_0, closure$editEntity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentEditPresenter$onLoadFromJson$lambda(this$ClazzAssignmentEditPresenter_0, closure$editEntity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzAssignmentEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = CourseBlockWithEntity.Companion.serializer();
    var tmp$_0;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    var $receiver = new CourseBlockWithEntity();
    var tmp$_1, tmp$_2, tmp$_3, tmp$_4;
    $receiver.cbUid = get_doorPrimaryKeyManager(this.db).nextId_za3lpa$(124);
    $receiver.cbClazzUid = (tmp$_2 = (tmp$_1 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0;
    $receiver.cbEntityUid = (tmp$_4 = (tmp$_3 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$_3) : null) != null ? tmp$_4 : get_doorPrimaryKeyManager(this.db).nextId_za3lpa$(520);
    $receiver.cbType = 103;
    var $receiver_0 = new ClazzAssignment();
    var tmp$_5, tmp$_6;
    $receiver_0.caUid = $receiver.cbEntityUid;
    $receiver_0.caClazzUid = (tmp$_6 = (tmp$_5 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$_5) : null) != null ? tmp$_6 : L0;
    $receiver.assignment = $receiver_0;
    tmp$ = $receiver;
  }
  var editEntity = tmp$;
  launch(this.presenterScope, void 0, void 0, ClazzAssignmentEditPresenter$onLoadFromJson$lambda(this, editEntity));
  return editEntity;
};
  ClazzAssignmentEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  if (entityVal != null) {
    this.saveDateTimeIntoEntity_gqx91x$(entityVal);
  }
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  ClazzAssignmentEditPresenter.prototype.loadEntityIntoDateTime_gqx91x$ = function(entity) {
  var tmp$;
  var timeZone = (tmp$ = this.view.timeZone) != null ? tmp$ : 'UTC';
  if (!equals(entity.cbHideUntilDate, L0)) {
    var startDateTimeMidnight = toLocalMidnight(DateTime.Companion.invoke_s8cxhz$(entity.cbHideUntilDate), timeZone).unixMillisLong;
    this.view.startDate = startDateTimeMidnight;
    this.view.startTime = entity.cbHideUntilDate.subtract(startDateTimeMidnight);
  } else {
    this.view.startDate = L0;
  }
  if (!equals(entity.cbDeadlineDate, Long$Companion$MAX_VALUE)) {
    var deadlineDateTimeMidnight = toLocalMidnight(DateTime.Companion.invoke_s8cxhz$(entity.cbDeadlineDate), timeZone).unixMillisLong;
    this.view.deadlineDate = deadlineDateTimeMidnight;
    this.view.deadlineTime = entity.cbDeadlineDate.subtract(deadlineDateTimeMidnight);
  } else {
    this.view.deadlineDate = Long$Companion$MAX_VALUE;
  }
  if (!equals(entity.cbGracePeriodDate, Long$Companion$MAX_VALUE)) {
    var gracePeriodDateTimeMidnight = toLocalMidnight(DateTime.Companion.invoke_s8cxhz$(entity.cbGracePeriodDate), timeZone).unixMillisLong;
    this.view.gracePeriodDate = gracePeriodDateTimeMidnight;
    this.view.gracePeriodTime = entity.cbGracePeriodDate.subtract(gracePeriodDateTimeMidnight);
  } else {
    this.view.gracePeriodDate = Long$Companion$MAX_VALUE;
  }
};
  ClazzAssignmentEditPresenter.prototype.saveDateTimeIntoEntity_gqx91x$ = function(entity) {
  var tmp$;
  var timeZone = (tmp$ = this.view.timeZone) != null ? tmp$ : 'UTC';
  if (!equals(this.view.startDate, L0)) {
    var $receiver = toOffsetByTimezone(DateTime.Companion.invoke_s8cxhz$(this.view.startDate), timeZone);
    var $receiver_0 = $receiver.hours;
    var tmp$_0 = TimeSpan.Companion.fromHours_14dthe$($receiver_0);
    var $receiver_1 = $receiver.minutes;
    var tmp$_1 = tmp$_0.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_1));
    var $receiver_2 = $receiver.seconds;
    var tmp$_2 = tmp$_1.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_2));
    var $receiver_3 = $receiver.milliseconds;
    entity.cbHideUntilDate = $receiver.minus_fv8bff$(tmp$_2.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_3))).utc.unixMillisLong.add(this.view.startTime);
  }
  if (!equals(this.view.deadlineDate, Long$Companion$MAX_VALUE)) {
    var $receiver_4 = toOffsetByTimezone(DateTime.Companion.invoke_s8cxhz$(this.view.deadlineDate), timeZone);
    var $receiver_5 = $receiver_4.hours;
    var tmp$_3 = TimeSpan.Companion.fromHours_14dthe$($receiver_5);
    var $receiver_6 = $receiver_4.minutes;
    var tmp$_4 = tmp$_3.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_6));
    var $receiver_7 = $receiver_4.seconds;
    var tmp$_5 = tmp$_4.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_7));
    var $receiver_8 = $receiver_4.milliseconds;
    entity.cbDeadlineDate = $receiver_4.minus_fv8bff$(tmp$_5.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_8))).utc.unixMillisLong.add(this.view.deadlineTime);
  }
  if (!equals(this.view.gracePeriodDate, Long$Companion$MAX_VALUE)) {
    var $receiver_9 = toOffsetByTimezone(DateTime.Companion.invoke_s8cxhz$(this.view.gracePeriodDate), timeZone);
    var $receiver_10 = $receiver_9.hours;
    var tmp$_6 = TimeSpan.Companion.fromHours_14dthe$($receiver_10);
    var $receiver_11 = $receiver_9.minutes;
    var tmp$_7 = tmp$_6.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_11));
    var $receiver_12 = $receiver_9.seconds;
    var tmp$_8 = tmp$_7.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_12));
    var $receiver_13 = $receiver_9.milliseconds;
    entity.cbGracePeriodDate = $receiver_9.minus_fv8bff$(tmp$_8.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_13))).utc.unixMillisLong.add(this.view.gracePeriodTime);
  }
};
  ClazzAssignmentEditPresenter.prototype.handleSubmissionTypeClicked = function() {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, CourseGroupSetListView$Companion_getInstance().VIEW_NAME, getKClass(CourseGroupSet), CourseGroupSet.Companion.serializer(), ClazzAssignmentEditPresenter$Companion_getInstance().SAVEDSTATE_KEY_SUBMISSION_TYPE, void 0, mutableMapOf([to(UstadView$Companion_getInstance().ARG_CLAZZUID, this.clazzUid_0.toString()), to(CourseGroupSetListView$Companion_getInstance().ARG_SHOW_INDIVIDUAL, true.toString())])));
};
  function Coroutine$ClazzAssignmentEditPresenter$handleClickSave$lambda(closure$entity_0, this$ClazzAssignmentEditPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$ClazzAssignmentEditPresenter = this$ClazzAssignmentEditPresenter_0;
    this.local$foundError = void 0;
  }
  Coroutine$ClazzAssignmentEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzAssignmentEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzAssignmentEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$ClazzAssignmentEditPresenter$handleClickSave$lambda;
  Coroutine$ClazzAssignmentEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6;
        this.local$this$ClazzAssignmentEditPresenter.saveDateTimeIntoEntity_gqx91x$(this.local$closure$entity);
        this.local$foundError = false;
        var $receiver = (tmp$ = this.local$closure$entity.assignment) != null ? tmp$.caTitle : null;
        if ($receiver == null || $receiver.length === 0) {
          this.local$this$ClazzAssignmentEditPresenter.view.caTitleError = this.local$this$ClazzAssignmentEditPresenter.systemImpl.getString(2127, this.local$this$ClazzAssignmentEditPresenter.context);
          this.local$foundError = true;
        } else {
          this.local$this$ClazzAssignmentEditPresenter.view.caTitleError = null;
        }
        if (this.local$closure$entity.cbMaxPoints === 0) {
          this.local$this$ClazzAssignmentEditPresenter.view.caMaxPointsError = this.local$this$ClazzAssignmentEditPresenter.systemImpl.getString(2127, this.local$this$ClazzAssignmentEditPresenter.context);
          this.local$foundError = true;
        } else {
          this.local$this$ClazzAssignmentEditPresenter.view.caMaxPointsError = null;
        }
        if (this.local$closure$entity.cbDeadlineDate.compareTo_11rb$(this.local$closure$entity.cbHideUntilDate) <= 0) {
          this.local$this$ClazzAssignmentEditPresenter.view.caDeadlineError = this.local$this$ClazzAssignmentEditPresenter.systemImpl.getString(2679, this.local$this$ClazzAssignmentEditPresenter.context);
          this.local$foundError = true;
        } else {
          this.local$this$ClazzAssignmentEditPresenter.view.caDeadlineError = null;
        }
        if (this.local$closure$entity.cbGracePeriodDate.compareTo_11rb$(this.local$closure$entity.cbDeadlineDate) < 0) {
          this.local$this$ClazzAssignmentEditPresenter.view.caGracePeriodError = this.local$this$ClazzAssignmentEditPresenter.systemImpl.getString(2593, this.local$this$ClazzAssignmentEditPresenter.context);
          this.local$foundError = true;
        } else {
          this.local$this$ClazzAssignmentEditPresenter.view.caGracePeriodError = null;
        }
        if (((tmp$_0 = this.local$closure$entity.assignment) != null ? tmp$_0.caRequireTextSubmission : null) === false && ((tmp$_1 = this.local$closure$entity.assignment) != null ? tmp$_1.caRequireFileSubmission : null) === false) {
          this.local$foundError = true;
          this.local$this$ClazzAssignmentEditPresenter.view.showSnackBar_9pu0dj$(this.local$this$ClazzAssignmentEditPresenter.systemImpl.getString(2945, this.local$this$ClazzAssignmentEditPresenter.context));
        }
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzAssignmentEditPresenter.repo.clazzAssignmentDao.getGroupUidFromAssignment_s8cxhz$((tmp$_3 = (tmp$_2 = this.local$closure$entity.assignment) != null ? tmp$_2.caUid : null) != null ? tmp$_3 : L0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var dbGroupUid = this.result_0;
        if (!equals(dbGroupUid, L_1) && !equals(dbGroupUid, (tmp$_4 = this.local$closure$entity.assignment) != null ? tmp$_4.caGroupUid : null)) {
          this.state_0 = 3;
          this.result_0 = getFirstValue(this.local$this$ClazzAssignmentEditPresenter.repo.courseAssignmentSubmissionDao.checkNoSubmissionsMade_s8cxhz$((tmp$_6 = (tmp$_5 = this.local$closure$entity.assignment) != null ? tmp$_5.caUid : null) != null ? tmp$_6 : L0), this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 4;
          continue;
        }
      case 3:
        var noSubmissionMade = this.result_0;
        if (!noSubmissionMade) {
          this.local$foundError = true;
          this.local$this$ClazzAssignmentEditPresenter.view.showSnackBar_9pu0dj$(this.local$this$ClazzAssignmentEditPresenter.systemImpl.getString(2002, this.local$this$ClazzAssignmentEditPresenter.context));
        }
        this.state_0 = 4;
        continue;
      case 4:
        if (this.local$foundError) {
          this.local$this$ClazzAssignmentEditPresenter.view.loading = false;
          this.local$this$ClazzAssignmentEditPresenter.view.fieldsEnabled = true;
          return;
        } else {
          this.state_0 = 5;
          continue;
        }
      case 5:
        if (equals(this.local$closure$entity.cbGracePeriodDate, Long$Companion$MAX_VALUE)) {
          this.local$closure$entity.cbGracePeriodDate = this.local$closure$entity.cbDeadlineDate;
        }
        var tmp$_7 = this.local$this$ClazzAssignmentEditPresenter;
        var di = this.local$this$ClazzAssignmentEditPresenter.di;
        var strategy = ListSerializer(CourseBlockWithEntity.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_8;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_8 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_8 : throwCCE(), null);
        tmp$_7.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
        return this.local$this$ClazzAssignmentEditPresenter.view.loading = false , Unit;
      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 ClazzAssignmentEditPresenter$handleClickSave$lambda(closure$entity_0, this$ClazzAssignmentEditPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzAssignmentEditPresenter$handleClickSave$lambda(closure$entity_0, this$ClazzAssignmentEditPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzAssignmentEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  if (!this.view.fieldsEnabled) 
    return;
  this.view.loading = true;
  this.view.fieldsEnabled = false;
  launch(this.presenterScope, void 0, void 0, ClazzAssignmentEditPresenter$handleClickSave$lambda(entity, this));
};
  function ClazzAssignmentEditPresenter$Companion() {
    ClazzAssignmentEditPresenter$Companion_instance = this;
    this.ARG_SAVEDSTATE_CONTENT = 'contents';
    this.SAVEDSTATE_KEY_SUBMISSION_TYPE = 'submissionType';
  }
  ClazzAssignmentEditPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzAssignmentEditPresenter$Companion_instance = null;
  function ClazzAssignmentEditPresenter$Companion_getInstance() {
    if (ClazzAssignmentEditPresenter$Companion_instance === null) {
      new ClazzAssignmentEditPresenter$Companion();
    }
    return ClazzAssignmentEditPresenter$Companion_instance;
  }
  ClazzAssignmentEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzAssignmentEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function ClazzDetailOverviewPresenter(context, arguments_0, view, di, lifecycleOwner, contentEntryListItemListener) {
    ClazzDetailOverviewPresenter$Companion_getInstance();
    var tmp$, tmp$_0;
    if (contentEntryListItemListener === void 0) {
      contentEntryListItemListener = new DefaultContentEntryListItemListener(view, void 0, void 0, (tmp$_0 = (tmp$ = arguments_0.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0, context, di);
    }
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.contentEntryListItemListener = contentEntryListItemListener;
    this.collapsedList = LinkedHashSet_init();
  }
  Object.defineProperty(ClazzDetailOverviewPresenter.prototype, 'deepLink', {
  configurable: true, 
  get: function() {
  var tmp$;
  var activeEndpoint = get_direct(this.di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$ : throwCCE(), null).activeAccount.endpointUrl;
  return toDeepLink_0(this.arguments, activeEndpoint, ClazzDetailView$Companion_getInstance().VIEW_NAME);
}});
  Object.defineProperty(ClazzDetailOverviewPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$LIVEDATA_getInstance();
}});
  ClazzDetailOverviewPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  var tmp$, tmp$_0, tmp$_1;
  return this.db.clazzDao.personHasPermissionWithClazz_b9bd0d$((tmp$ = account != null ? account.personUid : null) != null ? tmp$ : L0, (tmp$_1 = (tmp$_0 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$_0) : null) != null ? tmp$_1 : L0, Role$Companion$PERMISSION_CLAZZ_UPDATE, continuation);
};
  function Coroutine$ClazzDetailOverviewPresenter$onLoadLiveData$lambda(closure$repo_0, this$ClazzDetailOverviewPresenter_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$repo = closure$repo_0;
    this.local$this$ClazzDetailOverviewPresenter = this$ClazzDetailOverviewPresenter_0;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$tmp$ = void 0;
    this.local$tmp$_0 = void 0;
  }
  Coroutine$ClazzDetailOverviewPresenter$onLoadLiveData$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzDetailOverviewPresenter$onLoadLiveData$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzDetailOverviewPresenter$onLoadLiveData$lambda.prototype.constructor = Coroutine$ClazzDetailOverviewPresenter$onLoadLiveData$lambda;
  Coroutine$ClazzDetailOverviewPresenter$onLoadLiveData$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$tmp$ = this.local$this$ClazzDetailOverviewPresenter.view;
        this.state_0 = 2;
        this.result_0 = this.local$closure$repo.clazzDao.personHasPermissionWithClazz_b9bd0d$(this.local$this$ClazzDetailOverviewPresenter.accountManager.activeAccount.personUid, this.local$closure$entityUid, Role$Companion$PERMISSION_CLAZZ_ADD_STUDENT, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$tmp$.clazzCodeVisible = this.result_0;
        this.local$this$ClazzDetailOverviewPresenter.view.courseBlockList = this.local$closure$repo.courseBlockDao.findAllCourseBlockByClazzUidLive_uwwcm7$(this.local$closure$entityUid, this.local$this$ClazzDetailOverviewPresenter.accountManager.activeAccount.personUid, toList(this.local$this$ClazzDetailOverviewPresenter.collapsedList), systemTimeInMillis());
        this.local$tmp$_0 = this.local$this$ClazzDetailOverviewPresenter.view;
        this.state_0 = 3;
        this.result_0 = this.local$closure$repo.clazzDao.personHasPermissionWithClazz_b9bd0d$(this.local$this$ClazzDetailOverviewPresenter.accountManager.activeAccount.personUid, this.local$closure$entityUid, Role$Companion$PERMISSION_PERSON_DELEGATE, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        return this.local$tmp$_0.showPermissionButton = this.result_0 , Unit;
      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 ClazzDetailOverviewPresenter$onLoadLiveData$lambda(closure$repo_0, this$ClazzDetailOverviewPresenter_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzDetailOverviewPresenter$onLoadLiveData$lambda(closure$repo_0, this$ClazzDetailOverviewPresenter_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzDetailOverviewPresenter.prototype.onLoadLiveData_7hogkd$ = function(repo) {
  var tmp$, tmp$_0;
  var entityUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  this.view.scheduleList = repo.scheduleDao.findAllSchedulesByClazzUid_s8cxhz$(entityUid);
  launch(this.presenterScope, void 0, void 0, ClazzDetailOverviewPresenter$onLoadLiveData$lambda(repo, this, entityUid));
  return repo.clazzDao.getClazzWithDisplayDetails_3pjtqy$(entityUid, systemTimeInMillis());
};
  ClazzDetailOverviewPresenter.prototype.handleClickEdit = function() {
  var tmp$, tmp$_0;
  var entityUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ClazzEdit2View$Companion_getInstance().VIEW_NAME, getKClass(ClazzWithHolidayCalendarAndSchoolAndTerminology), ClazzWithHolidayCalendarAndSchoolAndTerminology.Companion.serializer(), ClazzDetailOverviewPresenter$Companion_getInstance().SAVEDSTATE_KEY_CLAZZ, void 0, mutableMapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, entityUid.toString())])));
};
  ClazzDetailOverviewPresenter.prototype.handleModuleExpandCollapseClicked_dk05ec$ = function(courseBlock) {
  var tmp$, tmp$_0;
  var entityUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  var $receiver = this.collapsedList;
  var firstOrNull$result;
  firstOrNull$break:
    do {
      var tmp$_1;
      tmp$_1 = $receiver.iterator();
      while (tmp$_1.hasNext()) {
        var element = tmp$_1.next();
        if (equals(element, courseBlock.cbUid)) {
          firstOrNull$result = element;
          break firstOrNull$break;
        }
      }
      firstOrNull$result = null;
    } while (false);
  var foundBlock = firstOrNull$result;
  if (foundBlock != null) {
    this.collapsedList.remove_11rb$(foundBlock);
  } else {
    this.collapsedList.add_11rb$(courseBlock.cbUid);
  }
  this.view.courseBlockList = this.repo.courseBlockDao.findAllCourseBlockByClazzUidLive_uwwcm7$(entityUid, this.accountManager.activeAccount.personUid, toList(this.collapsedList), systemTimeInMillis());
};
  ClazzDetailOverviewPresenter.prototype.handleClickAssignment_etrmwv$ = function(assignment) {
  this.requireNavController().navigate_oc2wlg$(ClazzAssignmentDetailView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, assignment.caUid.toString())));
};
  ClazzDetailOverviewPresenter.prototype.handleClickTextBlock_guofji$ = function(courseBlock) {
  var tmp$, tmp$_0;
  var args = LinkedHashMap_init();
  var key = HtmlTextViewDetailView$Companion_getInstance().DISPLAY_TEXT;
  var value = (tmp$ = courseBlock.cbDescription) != null ? tmp$ : '';
  args.put_xwzc9p$(key, value);
  var key_0 = HtmlTextViewDetailView$Companion_getInstance().DISPLAY_TITLE;
  var value_0 = (tmp$_0 = courseBlock.cbTitle) != null ? tmp$_0 : '';
  args.put_xwzc9p$(key_0, value_0);
  this.requireNavController().navigate_oc2wlg$(HtmlTextViewDetailView$Companion_getInstance().VIEW_NAME, args);
};
  ClazzDetailOverviewPresenter.prototype.handleDownloadAllClicked = function() {
};
  ClazzDetailOverviewPresenter.prototype.handleClickPermissions = function() {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  tmp$_2 = this.ustadNavController;
  tmp$ = ScopedGrantListView$Companion_getInstance().VIEW_NAME;
  tmp$_1 = mapOf([to(ScopedGrantListView$Companion_getInstance().ARG_FILTER_TABLE_ID, (6).toString()), to(ScopedGrantListView$Companion_getInstance().ARG_FILTER_ENTITY_UID, (tmp$_0 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? tmp$_0 : '0')]);
    tmp$_2 != null ? (tmp$_2.navigate_oc2wlg$(tmp$, tmp$_1) , Unit) : null;
};
  ClazzDetailOverviewPresenter.prototype.handleClickCourseDiscussion_5tqe7d$ = function(courseDiscussion) {
  var tmp$;
    (tmp$ = this.ustadNavController) != null ? (tmp$.navigate_oc2wlg$(CourseDiscussionDetailView$Companion_getInstance().VIEW_NAME, mapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, courseDiscussion.courseDiscussionUid.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZUID, courseDiscussion.courseDiscussionClazzUid.toString())])) , Unit) : null;
};
  function ClazzDetailOverviewPresenter$Companion() {
    ClazzDetailOverviewPresenter$Companion_instance = this;
    this.SAVEDSTATE_KEY_CLAZZ = 'Clazz';
  }
  ClazzDetailOverviewPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzDetailOverviewPresenter$Companion_instance = null;
  function ClazzDetailOverviewPresenter$Companion_getInstance() {
    if (ClazzDetailOverviewPresenter$Companion_instance === null) {
      new ClazzDetailOverviewPresenter$Companion();
    }
    return ClazzDetailOverviewPresenter$Companion_instance;
  }
  ClazzDetailOverviewPresenter.prototype.onClickContentEntry_dup0gu$ = function(entry) {
  return this.contentEntryListItemListener.onClickContentEntry_dup0gu$(entry);
};
  ClazzDetailOverviewPresenter.prototype.onClickDownloadContentEntry_dup0gu$ = function(entry) {
  return this.contentEntryListItemListener.onClickDownloadContentEntry_dup0gu$(entry);
};
  ClazzDetailOverviewPresenter.prototype.onClickSelectContentEntry_dup0gu$ = function(entry) {
  return this.contentEntryListItemListener.onClickSelectContentEntry_dup0gu$(entry);
};
  ClazzDetailOverviewPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzDetailOverviewPresenter', 
  interfaces: [ContentEntryListItemListener, UstadDetailPresenter]};
  function ClazzDetailPresenter(context, arguments_0, view, di, lifecycleOwner) {
    ClazzDetailPresenter$Companion_getInstance();
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    var tmp$;
    this.scope_dg6gr6$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(CoroutineScope), [], false)), TypeToken) ? tmp$ : throwCCE(), 14).provideDelegate_tpuvb9$(this, ClazzDetailPresenter$scope_metadata);
  }
  var ClazzDetailPresenter$scope_metadata = new PropertyMetadata('scope');
  Object.defineProperty(ClazzDetailPresenter.prototype, 'scope_0', {
  configurable: true, 
  get: function() {
  return this.scope_dg6gr6$_0.value;
}});
  Object.defineProperty(ClazzDetailPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  ClazzDetailPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  return false;
};
  function Coroutine$ClazzDetailPresenter$onLoadFromJson$lambda(closure$editEntity_0, this$ClazzDetailPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$editEntity = closure$editEntity_0;
    this.local$this$ClazzDetailPresenter = this$ClazzDetailPresenter_0;
  }
  Coroutine$ClazzDetailPresenter$onLoadFromJson$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzDetailPresenter$onLoadFromJson$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzDetailPresenter$onLoadFromJson$lambda.prototype.constructor = Coroutine$ClazzDetailPresenter$onLoadFromJson$lambda;
  Coroutine$ClazzDetailPresenter$onLoadFromJson$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzDetailPresenter.setupTabs_0(this.local$closure$editEntity.v, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ClazzDetailPresenter$onLoadFromJson$lambda(closure$editEntity_0, this$ClazzDetailPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzDetailPresenter$onLoadFromJson$lambda(closure$editEntity_0, this$ClazzDetailPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzDetailPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  UstadDetailPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  var tabsJson = bundle.get_11rb$(ClazzDetailView$Companion_getInstance().ARG_TABS);
  var editEntity = {
  v: null};
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = Clazz.Companion.serializer();
    var tmp$;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
    editEntity.v = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    editEntity.v = new Clazz();
  }
  if (tabsJson != null) {
    var tmp$_0 = this.view;
    var di_0 = this.di;
    var strategy_0 = ListSerializer(serializer(kotlin_js_internal_StringCompanionObject));
    var tmp$_1;
    var json_0 = get_direct(di_0).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_1 : throwCCE(), null);
    tmp$_0.tabs = json_0.decodeFromString_awif5v$(strategy_0, tabsJson);
  } else {
    launch(this.presenterScope, void 0, void 0, ClazzDetailPresenter$onLoadFromJson$lambda(editEntity, this));
  }
  return editEntity.v;
};
  ClazzDetailPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadDetailPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
  putEntityAsJson(savedState, ClazzDetailView$Companion_getInstance().ARG_TABS, null, this.view.tabs);
};
  function Coroutine$ClazzDetailPresenter$onLoadEntityFromDb$lambda$lambda(closure$entityUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$it = it_0;
  }
  Coroutine$ClazzDetailPresenter$onLoadEntityFromDb$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzDetailPresenter$onLoadEntityFromDb$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzDetailPresenter$onLoadEntityFromDb$lambda$lambda.prototype.constructor = Coroutine$ClazzDetailPresenter$onLoadEntityFromDb$lambda$lambda;
  Coroutine$ClazzDetailPresenter$onLoadEntityFromDb$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.clazzDao.findByUidAsync_s8cxhz$(this.local$closure$entityUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ClazzDetailPresenter$onLoadEntityFromDb$lambda$lambda(closure$entityUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzDetailPresenter$onLoadEntityFromDb$lambda$lambda(closure$entityUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ClazzDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$ClazzDetailPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzDetailPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzDetailPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$ClazzDetailPresenter$onLoadEntityFromDb$lambda;
  Coroutine$ClazzDetailPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$closure$db, L2000, ClazzDetailPresenter$onLoadEntityFromDb$lambda$lambda(this.local$closure$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ClazzDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_2($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$clazz = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_2.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_2.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_2.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_2;
  Coroutine$onLoadEntityFromDb_7hogkd$_2.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        var entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = withContext(coroutines.Dispatchers.Default, ClazzDetailPresenter$onLoadEntityFromDb$lambda(this.local$db, entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$clazz = (tmp$_1 = this.result_0) != null ? tmp$_1 : new Clazz();
        this.state_0 = 3;
        this.result_0 = this.$this.setupTabs_0(this.local$clazz, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        return this.local$clazz;
      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);
};
  ClazzDetailPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_2(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$ClazzDetailPresenter$setupTabs$lambda(closure$entityUid_0, closure$clazz_0, this$ClazzDetailPresenter_0, closure$personUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$closure$clazz = closure$clazz_0;
    this.local$this$ClazzDetailPresenter = this$ClazzDetailPresenter_0;
    this.local$closure$personUid = closure$personUid_0;
    this.local$commonArgs = void 0;
    this.local$coreTabs = void 0;
    this.local$destination = void 0;
    this.local$tmp$ = void 0;
    this.local$element = void 0;
  }
  Coroutine$ClazzDetailPresenter$setupTabs$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzDetailPresenter$setupTabs$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzDetailPresenter$setupTabs$lambda.prototype.constructor = Coroutine$ClazzDetailPresenter$setupTabs$lambda;
  Coroutine$ClazzDetailPresenter$setupTabs$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$commonArgs = mapOf_0(to(UstadView$Companion_getInstance().ARG_NAV_CHILD, true.toString()));
        this.local$coreTabs = listOf([appendQueryArgs_1(ClazzDetailOverviewView$Companion_getInstance().VIEW_NAME, plus(this.local$commonArgs, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, this.local$closure$entityUid.toString())))), appendQueryArgs_1(ClazzMemberListView$Companion_getInstance().VIEW_NAME, plus(this.local$commonArgs, mapOf_0(to(UstadView$Companion_getInstance().ARG_CLAZZUID, this.local$closure$entityUid.toString()))))]);
        var $receiver = ClazzDetailPresenter$Companion_getInstance().CLAZZ_FEATURES;
        this.local$destination = ArrayList_init();
        this.local$tmp$ = $receiver.iterator();
        this.state_0 = 2;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 5;
          continue;
        }
        this.local$element = this.local$tmp$.next();
        var closure$clazz = this.local$closure$clazz;
        var this$ClazzDetailPresenter = this.local$this$ClazzDetailPresenter;
        var closure$personUid = this.local$closure$personUid;
        var closure$entityUid = this.local$closure$entityUid;
        var tmp$;
        if (closure$clazz.clazzFeatures.and(this.local$element).toNumber() > 0) {
          this.state_0 = 3;
          this.result_0 = this$ClazzDetailPresenter.db.clazzDao.personHasPermissionWithClazz_b9bd0d$(closure$personUid, closure$entityUid, (tmp$ = ClazzDetailPresenter$Companion_getInstance().FEATURE_PERMISSION_MAP.get_11rb$(this.local$element)) != null ? tmp$ : L_1, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = false;
          this.state_0 = 4;
          continue;
        }
      case 3:
        this.state_0 = 4;
        continue;
      case 4:
        if (this.result_0) 
          this.local$destination.add_11rb$(this.local$element);
        this.state_0 = 2;
        continue;
      case 5:
        var destination = ArrayList_init_0(collectionSizeOrDefault(this.local$destination, 10));
        var tmp$_0;
        tmp$_0 = this.local$destination.iterator();
        while (tmp$_0.hasNext()) {
          var item = tmp$_0.next();
          var tmp$_1 = destination.add_11rb$;
          var closure$entityUid_0 = this.local$closure$entityUid;
          var tmp$_2;
          tmp$_1.call(destination, appendQueryArgs_1((tmp$_2 = ClazzDetailPresenter$Companion_getInstance().VIEWNAME_MAP.get_11rb$(item)) != null ? tmp$_2 : 'INVALID', plus(this.local$commonArgs, mapOf_0(to(UstadView$Companion_getInstance().ARG_CLAZZUID, closure$entityUid_0.toString())))));
        }
        var permissionAndFeatureBasedTabs = destination;
        var groupsTab = appendQueryArgs_1(CourseGroupSetListView$Companion_getInstance().VIEW_NAME, plus(this.local$commonArgs, mapOf_0(to(UstadView$Companion_getInstance().ARG_CLAZZUID, this.local$closure$entityUid.toString()))));
        var desiredTabs = plus_1(plus_0(this.local$coreTabs, permissionAndFeatureBasedTabs), groupsTab);
        if (!equals(this.local$this$ClazzDetailPresenter.view.tabs, desiredTabs)) {
          return this.local$this$ClazzDetailPresenter.view.tabs = desiredTabs , Unit;
        } else {
          this.state_0 = 6;
          continue;
        }
      case 6:
        return Unit;
      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 ClazzDetailPresenter$setupTabs$lambda(closure$entityUid_0, closure$clazz_0, this$ClazzDetailPresenter_0, closure$personUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzDetailPresenter$setupTabs$lambda(closure$entityUid_0, closure$clazz_0, this$ClazzDetailPresenter_0, closure$personUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzDetailPresenter.prototype.setupTabs_0 = function(clazz, continuation) {
  var tmp$, tmp$_0;
  var entityUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  var personUid = this.accountManager.activeAccount.personUid;
  launch(this.scope_0, void 0, void 0, ClazzDetailPresenter$setupTabs$lambda(entityUid, clazz, this, personUid));
};
  function ClazzDetailPresenter$Companion() {
    ClazzDetailPresenter$Companion_instance = this;
    this.CLAZZ_FEATURES = listOf_0(Clazz$Companion$CLAZZ_FEATURE_ATTENDANCE);
    this.FEATURE_PERMISSION_MAP = mapOf_0(to(Clazz$Companion$CLAZZ_FEATURE_ATTENDANCE, Role$Companion$PERMISSION_CLAZZ_LOG_ATTENDANCE_SELECT));
    this.VIEWNAME_MAP = mapOf_0(to(Clazz$Companion$CLAZZ_FEATURE_ATTENDANCE, ClazzLogListAttendanceView$Companion_getInstance().VIEW_NAME));
  }
  ClazzDetailPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzDetailPresenter$Companion_instance = null;
  function ClazzDetailPresenter$Companion_getInstance() {
    if (ClazzDetailPresenter$Companion_instance === null) {
      new ClazzDetailPresenter$Companion();
    }
    return ClazzDetailPresenter$Companion_instance;
  }
  ClazzDetailPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzDetailPresenter', 
  interfaces: [UstadDetailPresenter]};
  var compareBy$lambda = wrapFunction(function() {
  var compareValues = Kotlin.kotlin.comparisons.compareValues_s00gnj$;
  return function(closure$selector) {
  return function(a, b) {
  var selector = closure$selector;
  return compareValues(selector(a), selector(b));
};
};
});
  function asCourseBlockWithEntity$lambda(it) {
    return it.discussionTopicIndex;
  }
  function asCourseBlockWithEntity($receiver, topicList) {
    var destination = ArrayList_init();
    var tmp$;
    tmp$ = topicList.iterator();
    while (tmp$.hasNext()) {
      var element = tmp$.next();
      var tmp$_0;
      if (equals(element.discussionTopicCourseDiscussionUid, (tmp$_0 = $receiver.courseDiscussion) != null ? tmp$_0.courseDiscussionUid : null)) 
        destination.add_11rb$(element);
    }
    var relevantTopics = sortedWith(destination, new Comparator(compareBy$lambda(asCourseBlockWithEntity$lambda)));
    var courseBlockWithEntity = new CourseBlockWithEntity();
    courseBlockWithEntity.createFromDb_taxqj1$($receiver);
    courseBlockWithEntity.topics = relevantTopics;
    courseBlockWithEntity.topicUidsToRemove = emptyList();
    return courseBlockWithEntity;
  }
  function ClazzEdit2Presenter(context, arguments_0, view, di, lifecycleOwner) {
    ClazzEdit2Presenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    var tmp$;
    this.json_l0s6gp$_0 = Instance(di, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, ClazzEdit2Presenter$json_metadata);
    this.scheduleOneToManyJoinEditHelper_0 = new OneToManyJoinEditHelperMp(getPropertyCallableRef('scheduleUid', 1, function($receiver) {
  return $receiver.scheduleUid;
}, function($receiver, value) {
  $receiver.scheduleUid = value;
}), ClazzEdit2Presenter$Companion_getInstance().ARG_SAVEDSTATE_SCHEDULES, ListSerializer(Schedule.Companion.serializer()), ListSerializer(Schedule.Companion.serializer()), this, this.requireSavedStateHandle(), getKClass(Schedule), void 0, ClazzEdit2Presenter$scheduleOneToManyJoinEditHelper$lambda);
    this.scheduleOneToManyJoinListener = this.scheduleOneToManyJoinEditHelper_0.createNavigateForResultListener_g113xi$(ScheduleEditView$Companion_getInstance().VIEW_NAME, Schedule.Companion.serializer());
    this.topics_vyaq7x$_0 = this.topics_vyaq7x$_0;
    this.courseBlockOneToManyJoinEditHelper_0 = new OneToManyJoinEditHelperMp(getPropertyCallableRef('cbUid', 1, function($receiver) {
  return $receiver.cbUid;
}, function($receiver, value) {
  $receiver.cbUid = value;
}), ClazzEdit2Presenter$Companion_getInstance().ARG_SAVEDSTATE_BLOCK, ListSerializer(CourseBlockWithEntity.Companion.serializer()), ListSerializer(CourseBlockWithEntity.Companion.serializer()), this, this.requireSavedStateHandle(), getKClass(CourseBlockWithEntity), void 0, ClazzEdit2Presenter$courseBlockOneToManyJoinEditHelper$lambda);
  }
  var ClazzEdit2Presenter$json_metadata = new PropertyMetadata('json');
  Object.defineProperty(ClazzEdit2Presenter.prototype, 'json_0', {
  configurable: true, 
  get: function() {
  return this.json_l0s6gp$_0.value;
}});
  function ClazzEdit2Presenter$EnrolmentPolicyOptions(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ClazzEdit2Presenter$EnrolmentPolicyOptions_initFields() {
    ClazzEdit2Presenter$EnrolmentPolicyOptions_initFields = function() {
};
    ClazzEdit2Presenter$EnrolmentPolicyOptions$OPEN_instance = new ClazzEdit2Presenter$EnrolmentPolicyOptions('OPEN', 0, 102, 2892);
    ClazzEdit2Presenter$EnrolmentPolicyOptions$INVITE_instance = new ClazzEdit2Presenter$EnrolmentPolicyOptions('INVITE', 1, 100, 2944);
  }
  var ClazzEdit2Presenter$EnrolmentPolicyOptions$OPEN_instance;
  function ClazzEdit2Presenter$EnrolmentPolicyOptions$OPEN_getInstance() {
    ClazzEdit2Presenter$EnrolmentPolicyOptions_initFields();
    return ClazzEdit2Presenter$EnrolmentPolicyOptions$OPEN_instance;
  }
  var ClazzEdit2Presenter$EnrolmentPolicyOptions$INVITE_instance;
  function ClazzEdit2Presenter$EnrolmentPolicyOptions$INVITE_getInstance() {
    ClazzEdit2Presenter$EnrolmentPolicyOptions_initFields();
    return ClazzEdit2Presenter$EnrolmentPolicyOptions$INVITE_instance;
  }
  ClazzEdit2Presenter$EnrolmentPolicyOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'EnrolmentPolicyOptions', 
  interfaces: [Enum]};
  function ClazzEdit2Presenter$EnrolmentPolicyOptions$values() {
    return [ClazzEdit2Presenter$EnrolmentPolicyOptions$OPEN_getInstance(), ClazzEdit2Presenter$EnrolmentPolicyOptions$INVITE_getInstance()];
  }
  ClazzEdit2Presenter$EnrolmentPolicyOptions.values = ClazzEdit2Presenter$EnrolmentPolicyOptions$values;
  function ClazzEdit2Presenter$EnrolmentPolicyOptions$valueOf(name) {
    switch (name) {
      case 'OPEN':
        return ClazzEdit2Presenter$EnrolmentPolicyOptions$OPEN_getInstance();
      case 'INVITE':
        return ClazzEdit2Presenter$EnrolmentPolicyOptions$INVITE_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ClazzEdit2Presenter.EnrolmentPolicyOptions.' + name);
    }
  }
  ClazzEdit2Presenter$EnrolmentPolicyOptions.valueOf_61zpoe$ = ClazzEdit2Presenter$EnrolmentPolicyOptions$valueOf;
  function ClazzEdit2Presenter$EnrolmentPolicyOptionsMessageIdOption(day, context, di) {
    MessageIdOption.call(this, day.messageId, context, day.optionVal, di);
  }
  ClazzEdit2Presenter$EnrolmentPolicyOptionsMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'EnrolmentPolicyOptionsMessageIdOption', 
  interfaces: [MessageIdOption]};
  Object.defineProperty(ClazzEdit2Presenter.prototype, 'topics', {
  configurable: true, 
  get: function() {
  if (this.topics_vyaq7x$_0 == null) 
    return throwUPAE('topics');
  return this.topics_vyaq7x$_0;
}, 
  set: function(topics) {
  this.topics_vyaq7x$_0 = topics;
}});
  Object.defineProperty(ClazzEdit2Presenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  ClazzEdit2Presenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
  this.view.clazzSchedules = this.scheduleOneToManyJoinEditHelper_0.liveList;
  this.view.courseBlocks = this.courseBlockOneToManyJoinEditHelper_0.liveList;
  var tmp$ = this.view;
  var $receiver = ClazzEdit2Presenter$EnrolmentPolicyOptions$values();
  var destination = ArrayList_init_0($receiver.length);
  var tmp$_0;
  for (tmp$_0 = 0; tmp$_0 !== $receiver.length; ++tmp$_0) {
    var item = $receiver[tmp$_0];
    destination.add_11rb$(new ClazzEdit2Presenter$EnrolmentPolicyOptionsMessageIdOption(item, this.context, this.di));
  }
  tmp$.enrolmentPolicyOptions = destination;
};
  function ClazzEdit2Presenter$onLoadDataComplete$lambda(this$ClazzEdit2Presenter) {
    return function(it) {
  var tmp$;
  if (it == null) {
    return;
  }
  var timezone = it;
    (tmp$ = this$ClazzEdit2Presenter.entity) != null ? (tmp$.clazzTimeZone = timezone) : null;
  this$ClazzEdit2Presenter.view.entity = this$ClazzEdit2Presenter.entity;
  this$ClazzEdit2Presenter.requireSavedStateHandle().set_umlfku$(TimeZoneListPresenter$Companion_getInstance().RESULT_TIMEZONE_KEY, null);
  return Unit;
};
  }
  function ClazzEdit2Presenter$onLoadDataComplete$lambda_0(this$ClazzEdit2Presenter) {
    return function(it) {
  var tmp$, tmp$_0, tmp$_1;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var school = tmp$;
    (tmp$_0 = this$ClazzEdit2Presenter.entity) != null ? (tmp$_0.school = school) : null;
    (tmp$_1 = this$ClazzEdit2Presenter.entity) != null ? (tmp$_1.clazzSchoolUid = school.schoolUid) : null;
  this$ClazzEdit2Presenter.view.entity = this$ClazzEdit2Presenter.entity;
  this$ClazzEdit2Presenter.requireSavedStateHandle().set_umlfku$(ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_SCHOOL, null);
  return Unit;
};
  }
  function ClazzEdit2Presenter$onLoadDataComplete$lambda_1(this$ClazzEdit2Presenter) {
    return function(it) {
  var tmp$, tmp$_0, tmp$_1;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var calendar = tmp$;
    (tmp$_0 = this$ClazzEdit2Presenter.entity) != null ? (tmp$_0.holidayCalendar = calendar) : null;
    (tmp$_1 = this$ClazzEdit2Presenter.entity) != null ? (tmp$_1.clazzHolidayUMCalendarUid = calendar.umCalendarUid) : null;
  this$ClazzEdit2Presenter.view.entity = this$ClazzEdit2Presenter.entity;
  this$ClazzEdit2Presenter.requireSavedStateHandle().set_umlfku$(ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_HOLIDAYCALENDAR, null);
  return Unit;
};
  }
  function ClazzEdit2Presenter$onLoadDataComplete$lambda_2(this$ClazzEdit2Presenter) {
    return function(it) {
  var tmp$, tmp$_0, tmp$_1;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var terminology = tmp$;
    (tmp$_0 = this$ClazzEdit2Presenter.entity) != null ? (tmp$_0.clazzTerminologyUid = terminology.ctUid) : null;
    (tmp$_1 = this$ClazzEdit2Presenter.entity) != null ? (tmp$_1.terminology = terminology) : null;
  this$ClazzEdit2Presenter.view.entity = this$ClazzEdit2Presenter.entity;
  this$ClazzEdit2Presenter.requireSavedStateHandle().set_umlfku$(ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_TERMINOLOGY, null);
  return Unit;
};
  }
  function ClazzEdit2Presenter$onLoadDataComplete$lambda_3(this$ClazzEdit2Presenter) {
    return function(it) {
  var tmp$, tmp$_0;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var timeZone = tmp$;
    (tmp$_0 = this$ClazzEdit2Presenter.entity) != null ? (tmp$_0.clazzTimeZone = timeZone) : null;
  this$ClazzEdit2Presenter.view.entity = this$ClazzEdit2Presenter.entity;
  this$ClazzEdit2Presenter.requireSavedStateHandle().set_umlfku$(TimeZoneListPresenter$Companion_getInstance().RESULT_TIMEZONE_KEY, null);
  return Unit;
};
  }
  function ClazzEdit2Presenter$onLoadDataComplete$lambda_4(this$ClazzEdit2Presenter) {
    return function(it) {
  var tmp$, tmp$_0;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var wrapper = tmp$;
    (tmp$_0 = this$ClazzEdit2Presenter.entity) != null ? (tmp$_0.clazzFeatures = wrapper.longValue) : null;
  this$ClazzEdit2Presenter.view.entity = this$ClazzEdit2Presenter.entity;
  this$ClazzEdit2Presenter.requireSavedStateHandle().set_umlfku$(ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_FEATURES, null);
  return Unit;
};
  }
  function ClazzEdit2Presenter$onLoadDataComplete$lambda_5(this$ClazzEdit2Presenter) {
    return function(it) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var newAssignment = tmp$;
  var tmp$_4;
  if ((tmp$_0 = this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.liveList.getValue()) != null) {
    var firstOrNull$result;
    firstOrNull$break:
      do {
        var tmp$_5;
        tmp$_5 = tmp$_0.iterator();
        while (tmp$_5.hasNext()) {
          var element = tmp$_5.next();
          var tmp$_6, tmp$_7;
          if (equals((tmp$_6 = element.assignment) != null ? tmp$_6.caUid : null, (tmp$_7 = newAssignment.assignment) != null ? tmp$_7.caUid : null)) {
            firstOrNull$result = element;
            break firstOrNull$break;
          }
        }
        firstOrNull$result = null;
      } while (false);
    tmp$_4 = firstOrNull$result;
  } else 
    tmp$_4 = null;
  var tmp$_8;
  if ((tmp$_1 = tmp$_4) != null) 
    tmp$_8 = tmp$_1;
  else {
    var $receiver = new CourseBlockWithEntity();
    var this$ClazzEdit2Presenter_0 = this$ClazzEdit2Presenter;
    var tmp$_9, tmp$_10, tmp$_11, tmp$_12, tmp$_13, tmp$_14;
    $receiver.cbClazzUid = newAssignment.cbClazzUid;
    $receiver.cbEntityUid = (tmp$_10 = (tmp$_9 = newAssignment.assignment) != null ? tmp$_9.caUid : null) != null ? tmp$_10 : L0;
    $receiver.cbTitle = (tmp$_11 = newAssignment.assignment) != null ? tmp$_11.caTitle : null;
    $receiver.cbType = 103;
    $receiver.cbDescription = (tmp$_12 = newAssignment.assignment) != null ? tmp$_12.caDescription : null;
    $receiver.cbIndex = (tmp$_14 = (tmp$_13 = this$ClazzEdit2Presenter_0.courseBlockOneToManyJoinEditHelper_0.liveList.getValue()) != null ? tmp$_13.size : null) != null ? tmp$_14 : 0;
    $receiver.cbUid = newAssignment.cbUid;
    $receiver.cbHideUntilDate = newAssignment.cbHideUntilDate;
    $receiver.cbDeadlineDate = newAssignment.cbDeadlineDate;
    $receiver.cbGracePeriodDate = newAssignment.cbGracePeriodDate;
    $receiver.cbLateSubmissionPenalty = newAssignment.cbLateSubmissionPenalty;
    $receiver.cbCompletionCriteria = newAssignment.cbCompletionCriteria;
    $receiver.cbMaxPoints = newAssignment.cbMaxPoints;
    $receiver.assignment = newAssignment.assignment;
    tmp$_8 = $receiver;
  }
  var foundBlock = tmp$_8;
  foundBlock.assignment = newAssignment.assignment;
  foundBlock.cbTitle = (tmp$_2 = newAssignment.assignment) != null ? tmp$_2.caTitle : null;
  foundBlock.cbDescription = (tmp$_3 = newAssignment.assignment) != null ? tmp$_3.caDescription : null;
  foundBlock.cbHideUntilDate = newAssignment.cbHideUntilDate;
  foundBlock.cbDeadlineDate = newAssignment.cbDeadlineDate;
  foundBlock.cbGracePeriodDate = newAssignment.cbGracePeriodDate;
  foundBlock.cbCompletionCriteria = newAssignment.cbCompletionCriteria;
  foundBlock.cbLateSubmissionPenalty = newAssignment.cbLateSubmissionPenalty;
  foundBlock.cbMaxPoints = newAssignment.cbMaxPoints;
  this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.onEditResult_trkh7z$(foundBlock);
  this$ClazzEdit2Presenter.requireSavedStateHandle().set_umlfku$(ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_ASSIGNMENT, null);
  return Unit;
};
  }
  function ClazzEdit2Presenter$onLoadDataComplete$lambda_6(this$ClazzEdit2Presenter) {
    return function(it) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6, tmp$_7, tmp$_8, tmp$_9, tmp$_10, tmp$_11, tmp$_12, tmp$_13, tmp$_14, tmp$_15;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var newContent = tmp$;
  var tmp$_16;
  if ((tmp$_0 = this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.liveList.getValue()) != null) {
    var firstOrNull$result;
    firstOrNull$break:
      do {
        var tmp$_17;
        tmp$_17 = tmp$_0.iterator();
        while (tmp$_17.hasNext()) {
          var element = tmp$_17.next();
          var tmp$_18;
          if (equals((tmp$_18 = element.entry) != null ? tmp$_18.contentEntryUid : null, newContent.contentEntryUid)) {
            firstOrNull$result = element;
            break firstOrNull$break;
          }
        }
        firstOrNull$result = null;
      } while (false);
    tmp$_16 = firstOrNull$result;
  } else 
    tmp$_16 = null;
  var tmp$_19;
  if ((tmp$_1 = tmp$_16) != null) 
    tmp$_19 = tmp$_1;
  else {
    var $receiver = new CourseBlockWithEntity();
    var this$ClazzEdit2Presenter_0 = this$ClazzEdit2Presenter;
    var tmp$_20, tmp$_21, tmp$_22, tmp$_23, tmp$_24, tmp$_25, tmp$_26, tmp$_27, tmp$_28, tmp$_29, tmp$_30, tmp$_31, tmp$_32, tmp$_33, tmp$_34, tmp$_35, tmp$_36, tmp$_37, tmp$_38, tmp$_39;
    $receiver.cbClazzUid = (tmp$_21 = (tmp$_20 = this$ClazzEdit2Presenter_0.entity) != null ? tmp$_20.clazzUid : null) != null ? tmp$_21 : L0;
    $receiver.cbEntityUid = newContent.contentEntryUid;
    $receiver.cbTitle = newContent.title;
    $receiver.cbType = 104;
    $receiver.cbDescription = newContent.description;
    $receiver.cbIndex = (tmp$_23 = (tmp$_22 = this$ClazzEdit2Presenter_0.courseBlockOneToManyJoinEditHelper_0.liveList.getValue()) != null ? tmp$_22.size : null) != null ? tmp$_23 : 0;
    $receiver.cbUid = (tmp$_25 = (tmp$_24 = newContent.block) != null ? tmp$_24.cbUid : null) != null ? tmp$_25 : get_doorPrimaryKeyManager(this$ClazzEdit2Presenter_0.db).nextId_za3lpa$(124);
    $receiver.cbHideUntilDate = (tmp$_27 = (tmp$_26 = newContent.block) != null ? tmp$_26.cbHideUntilDate : null) != null ? tmp$_27 : L0;
    $receiver.cbDeadlineDate = (tmp$_29 = (tmp$_28 = newContent.block) != null ? tmp$_28.cbDeadlineDate : null) != null ? tmp$_29 : Long$Companion$MAX_VALUE;
    $receiver.cbGracePeriodDate = (tmp$_31 = (tmp$_30 = newContent.block) != null ? tmp$_30.cbGracePeriodDate : null) != null ? tmp$_31 : Long$Companion$MAX_VALUE;
    $receiver.cbLateSubmissionPenalty = (tmp$_33 = (tmp$_32 = newContent.block) != null ? tmp$_32.cbLateSubmissionPenalty : null) != null ? tmp$_33 : 0;
    $receiver.cbCompletionCriteria = (tmp$_35 = (tmp$_34 = newContent.block) != null ? tmp$_34.cbCompletionCriteria : null) != null ? tmp$_35 : 0;
    $receiver.cbMaxPoints = (tmp$_37 = (tmp$_36 = newContent.block) != null ? tmp$_36.cbMaxPoints : null) != null ? tmp$_37 : 10;
    $receiver.cbMinPoints = (tmp$_39 = (tmp$_38 = newContent.block) != null ? tmp$_38.cbMinPoints : null) != null ? tmp$_39 : 0;
    $receiver.entry = newContent;
    $receiver.language = newContent.language;
    tmp$_19 = $receiver;
  }
  var foundBlock = tmp$_19;
  foundBlock.entry = newContent;
  foundBlock.language = newContent.language;
  foundBlock.cbTitle = newContent.title;
  foundBlock.cbDescription = newContent.description;
  foundBlock.cbHideUntilDate = (tmp$_3 = (tmp$_2 = newContent.block) != null ? tmp$_2.cbHideUntilDate : null) != null ? tmp$_3 : L0;
  foundBlock.cbDeadlineDate = (tmp$_5 = (tmp$_4 = newContent.block) != null ? tmp$_4.cbDeadlineDate : null) != null ? tmp$_5 : Long$Companion$MAX_VALUE;
  foundBlock.cbGracePeriodDate = (tmp$_7 = (tmp$_6 = newContent.block) != null ? tmp$_6.cbGracePeriodDate : null) != null ? tmp$_7 : Long$Companion$MAX_VALUE;
  foundBlock.cbLateSubmissionPenalty = (tmp$_9 = (tmp$_8 = newContent.block) != null ? tmp$_8.cbLateSubmissionPenalty : null) != null ? tmp$_9 : 0;
  foundBlock.cbCompletionCriteria = (tmp$_11 = (tmp$_10 = newContent.block) != null ? tmp$_10.cbCompletionCriteria : null) != null ? tmp$_11 : 0;
  foundBlock.cbMaxPoints = (tmp$_13 = (tmp$_12 = newContent.block) != null ? tmp$_12.cbMaxPoints : null) != null ? tmp$_13 : 10;
  foundBlock.cbMinPoints = (tmp$_15 = (tmp$_14 = newContent.block) != null ? tmp$_14.cbMinPoints : null) != null ? tmp$_15 : 0;
  this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.onEditResult_trkh7z$(foundBlock);
  this$ClazzEdit2Presenter.requireSavedStateHandle().set_umlfku$(ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_CONTENT, null);
  return Unit;
};
  }
  function ClazzEdit2Presenter$onLoadDataComplete$lambda_7(this$ClazzEdit2Presenter) {
    return function(it) {
  var tmp$, tmp$_0, tmp$_1;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var moduleBlock = tmp$;
  var tmp$_2;
  if ((tmp$_0 = this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.liveList.getValue()) != null) {
    var firstOrNull$result;
    firstOrNull$break:
      do {
        var tmp$_3;
        tmp$_3 = tmp$_0.iterator();
        while (tmp$_3.hasNext()) {
          var element = tmp$_3.next();
          if (equals(element.cbUid, moduleBlock.cbUid)) {
            firstOrNull$result = element;
            break firstOrNull$break;
          }
        }
        firstOrNull$result = null;
      } while (false);
    tmp$_2 = firstOrNull$result;
  } else 
    tmp$_2 = null;
  var tmp$_4;
  if ((tmp$_1 = tmp$_2) != null) 
    tmp$_4 = tmp$_1;
  else {
    var $receiver = new CourseBlockWithEntity();
    var this$ClazzEdit2Presenter_0 = this$ClazzEdit2Presenter;
    var tmp$_5, tmp$_6;
    $receiver.cbClazzUid = moduleBlock.cbClazzUid;
    $receiver.cbEntityUid = moduleBlock.cbUid;
    $receiver.cbTitle = moduleBlock.cbTitle;
    $receiver.cbType = 100;
    $receiver.cbDescription = moduleBlock.cbDescription;
    $receiver.cbHideUntilDate = moduleBlock.cbHideUntilDate;
    $receiver.cbIndex = (tmp$_6 = (tmp$_5 = this$ClazzEdit2Presenter_0.courseBlockOneToManyJoinEditHelper_0.liveList.getValue()) != null ? tmp$_5.size : null) != null ? tmp$_6 : 0;
    $receiver.cbUid = moduleBlock.cbUid;
    tmp$_4 = $receiver;
  }
  var foundBlock = tmp$_4;
  foundBlock.cbTitle = moduleBlock.cbTitle;
  foundBlock.cbDescription = moduleBlock.cbDescription;
  foundBlock.cbHideUntilDate = moduleBlock.cbHideUntilDate;
  this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.onEditResult_trkh7z$(foundBlock);
  this$ClazzEdit2Presenter.requireSavedStateHandle().set_umlfku$(ClazzEdit2Presenter$Companion_getInstance().ARG_SAVEDSTATE_MODULE, null);
  return Unit;
};
  }
  function ClazzEdit2Presenter$onLoadDataComplete$lambda_8(this$ClazzEdit2Presenter) {
    return function(it) {
  var tmp$, tmp$_0, tmp$_1;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var textBlock = tmp$;
  var tmp$_2;
  if ((tmp$_0 = this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.liveList.getValue()) != null) {
    var firstOrNull$result;
    firstOrNull$break:
      do {
        var tmp$_3;
        tmp$_3 = tmp$_0.iterator();
        while (tmp$_3.hasNext()) {
          var element = tmp$_3.next();
          if (equals(element.cbUid, textBlock.cbUid)) {
            firstOrNull$result = element;
            break firstOrNull$break;
          }
        }
        firstOrNull$result = null;
      } while (false);
    tmp$_2 = firstOrNull$result;
  } else 
    tmp$_2 = null;
  var tmp$_4;
  if ((tmp$_1 = tmp$_2) != null) 
    tmp$_4 = tmp$_1;
  else {
    var $receiver = new CourseBlockWithEntity();
    var this$ClazzEdit2Presenter_0 = this$ClazzEdit2Presenter;
    var tmp$_5, tmp$_6;
    $receiver.cbClazzUid = textBlock.cbClazzUid;
    $receiver.cbEntityUid = textBlock.cbUid;
    $receiver.cbTitle = textBlock.cbTitle;
    $receiver.cbType = 102;
    $receiver.cbDescription = textBlock.cbDescription;
    $receiver.cbHideUntilDate = textBlock.cbHideUntilDate;
    $receiver.cbIndex = (tmp$_6 = (tmp$_5 = this$ClazzEdit2Presenter_0.courseBlockOneToManyJoinEditHelper_0.liveList.getValue()) != null ? tmp$_5.size : null) != null ? tmp$_6 : 0;
    $receiver.cbUid = textBlock.cbUid;
    tmp$_4 = $receiver;
  }
  var foundBlock = tmp$_4;
  foundBlock.cbTitle = textBlock.cbTitle;
  foundBlock.cbDescription = textBlock.cbDescription;
  foundBlock.cbHideUntilDate = textBlock.cbHideUntilDate;
  this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.onEditResult_trkh7z$(foundBlock);
  this$ClazzEdit2Presenter.requireSavedStateHandle().set_umlfku$(ClazzEdit2Presenter$Companion_getInstance().ARG_SAVEDSTATE_TEXT, null);
  return Unit;
};
  }
  function ClazzEdit2Presenter$onLoadDataComplete$lambda_9(this$ClazzEdit2Presenter) {
    return function(it) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var newDiscussion = tmp$;
  var tmp$_4;
  if ((tmp$_0 = this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.liveList.getValue()) != null) {
    var firstOrNull$result;
    firstOrNull$break:
      do {
        var tmp$_5;
        tmp$_5 = tmp$_0.iterator();
        while (tmp$_5.hasNext()) {
          var element = tmp$_5.next();
          var tmp$_6, tmp$_7;
          if (equals((tmp$_6 = element.courseDiscussion) != null ? tmp$_6.courseDiscussionUid : null, (tmp$_7 = newDiscussion.courseDiscussion) != null ? tmp$_7.courseDiscussionUid : null)) {
            firstOrNull$result = element;
            break firstOrNull$break;
          }
        }
        firstOrNull$result = null;
      } while (false);
    tmp$_4 = firstOrNull$result;
  } else 
    tmp$_4 = null;
  var tmp$_8;
  if ((tmp$_1 = tmp$_4) != null) 
    tmp$_8 = tmp$_1;
  else {
    var $receiver = new CourseBlockWithEntity();
    var this$ClazzEdit2Presenter_0 = this$ClazzEdit2Presenter;
    var tmp$_9, tmp$_10, tmp$_11, tmp$_12, tmp$_13, tmp$_14;
    $receiver.cbClazzUid = newDiscussion.cbClazzUid;
    $receiver.cbEntityUid = (tmp$_10 = (tmp$_9 = newDiscussion.courseDiscussion) != null ? tmp$_9.courseDiscussionUid : null) != null ? tmp$_10 : L0;
    $receiver.cbTitle = (tmp$_11 = newDiscussion.courseDiscussion) != null ? tmp$_11.courseDiscussionTitle : null;
    $receiver.cbType = 105;
    $receiver.cbDescription = (tmp$_12 = newDiscussion.courseDiscussion) != null ? tmp$_12.courseDiscussionDesc : null;
    $receiver.cbIndex = (tmp$_14 = (tmp$_13 = this$ClazzEdit2Presenter_0.courseBlockOneToManyJoinEditHelper_0.liveList.getValue()) != null ? tmp$_13.size : null) != null ? tmp$_14 : 0;
    $receiver.cbUid = newDiscussion.cbUid;
    $receiver.cbHideUntilDate = newDiscussion.cbHideUntilDate;
    $receiver.cbDeadlineDate = newDiscussion.cbDeadlineDate;
    $receiver.cbGracePeriodDate = newDiscussion.cbGracePeriodDate;
    $receiver.cbLateSubmissionPenalty = newDiscussion.cbLateSubmissionPenalty;
    $receiver.cbCompletionCriteria = newDiscussion.cbCompletionCriteria;
    $receiver.cbMaxPoints = newDiscussion.cbMaxPoints;
    $receiver.courseDiscussion = newDiscussion.courseDiscussion;
    $receiver.topics = newDiscussion.topics;
    $receiver.topicUidsToRemove = newDiscussion.topicUidsToRemove;
    tmp$_8 = $receiver;
  }
  var foundBlock = tmp$_8;
  foundBlock.courseDiscussion = newDiscussion.courseDiscussion;
  foundBlock.cbTitle = (tmp$_2 = newDiscussion.courseDiscussion) != null ? tmp$_2.courseDiscussionTitle : null;
  foundBlock.cbDescription = (tmp$_3 = newDiscussion.courseDiscussion) != null ? tmp$_3.courseDiscussionDesc : null;
  foundBlock.cbHideUntilDate = newDiscussion.cbHideUntilDate;
  foundBlock.cbDeadlineDate = newDiscussion.cbDeadlineDate;
  foundBlock.cbGracePeriodDate = newDiscussion.cbGracePeriodDate;
  foundBlock.cbCompletionCriteria = newDiscussion.cbCompletionCriteria;
  foundBlock.cbLateSubmissionPenalty = newDiscussion.cbLateSubmissionPenalty;
  foundBlock.cbMaxPoints = newDiscussion.cbMaxPoints;
  foundBlock.topics = newDiscussion.topics;
  foundBlock.topicUidsToRemove = newDiscussion.topicUidsToRemove;
  this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.onEditResult_trkh7z$(foundBlock);
  this$ClazzEdit2Presenter.requireSavedStateHandle().set_umlfku$(ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_DISCUSSION, null);
  return Unit;
};
  }
  ClazzEdit2Presenter.prototype.onLoadDataComplete = function() {
  UstadEditPresenter.prototype.onLoadDataComplete.call(this);
  this.requireSavedStateHandle().getLiveData_ytbaoo$(TimeZoneListPresenter$Companion_getInstance().RESULT_TIMEZONE_KEY).observe_igxi3b$(this.lifecycleOwner, new DoorObserver(ClazzEdit2Presenter$onLoadDataComplete$lambda(this)));
  this.observeSavedStateResult_27fjeh$(ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_SCHOOL, ListSerializer(School.Companion.serializer()), getKClass(School), new DoorObserver(ClazzEdit2Presenter$onLoadDataComplete$lambda_0(this)));
  this.observeSavedStateResult_27fjeh$(ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_HOLIDAYCALENDAR, ListSerializer(HolidayCalendar.Companion.serializer()), getKClass(HolidayCalendar), new DoorObserver(ClazzEdit2Presenter$onLoadDataComplete$lambda_1(this)));
  this.observeSavedStateResult_27fjeh$(ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_TERMINOLOGY, ListSerializer(CourseTerminology.Companion.serializer()), getKClass(CourseTerminology), new DoorObserver(ClazzEdit2Presenter$onLoadDataComplete$lambda_2(this)));
  this.observeSavedStateResult_27fjeh$(TimeZoneListPresenter$Companion_getInstance().RESULT_TIMEZONE_KEY, ListSerializer(serializer(kotlin_js_internal_StringCompanionObject)), PrimitiveClasses$stringClass, new DoorObserver(ClazzEdit2Presenter$onLoadDataComplete$lambda_3(this)));
  this.observeSavedStateResult_27fjeh$(ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_FEATURES, ListSerializer(LongWrapper$Companion_getInstance().serializer()), getKClass(LongWrapper), new DoorObserver(ClazzEdit2Presenter$onLoadDataComplete$lambda_4(this)));
  this.observeSavedStateResult_27fjeh$(ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_ASSIGNMENT, ListSerializer(CourseBlockWithEntity.Companion.serializer()), getKClass(CourseBlockWithEntity), new DoorObserver(ClazzEdit2Presenter$onLoadDataComplete$lambda_5(this)));
  this.observeSavedStateResult_27fjeh$(ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_CONTENT, ListSerializer(ContentEntryWithBlockAndLanguage.Companion.serializer()), getKClass(ContentEntryWithBlockAndLanguage), new DoorObserver(ClazzEdit2Presenter$onLoadDataComplete$lambda_6(this)));
  this.observeSavedStateResult_27fjeh$(ClazzEdit2Presenter$Companion_getInstance().ARG_SAVEDSTATE_MODULE, ListSerializer(CourseBlock.Companion.serializer()), getKClass(CourseBlock), new DoorObserver(ClazzEdit2Presenter$onLoadDataComplete$lambda_7(this)));
  this.observeSavedStateResult_27fjeh$(ClazzEdit2Presenter$Companion_getInstance().ARG_SAVEDSTATE_TEXT, ListSerializer(CourseBlock.Companion.serializer()), getKClass(CourseBlock), new DoorObserver(ClazzEdit2Presenter$onLoadDataComplete$lambda_8(this)));
  this.observeSavedStateResult_27fjeh$(ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_DISCUSSION, ListSerializer(CourseBlockWithEntity.Companion.serializer()), getKClass(CourseBlockWithEntity), new DoorObserver(ClazzEdit2Presenter$onLoadDataComplete$lambda_9(this)));
};
  function Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda(closure$clazzUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$clazzUid = closure$clazzUid_0;
    this.local$it = it_0;
  }
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda;
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        var $receiver = this.local$it.clazzDao;
        if ((tmp$ = !equals(this.local$closure$clazzUid, L0) ? $receiver : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$.findByUidWithHolidayCalendarAsync_s8cxhz$(this.local$closure$clazzUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 ClazzEdit2Presenter$onLoadEntityFromDb$lambda(closure$clazzUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda(closure$clazzUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_0(closure$clazzUid_0, dbToUse_0, f_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$clazzUid = closure$clazzUid_0;
    this.local$dbToUse = dbToUse_0;
  }
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_0.prototype.constructor = Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_0;
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if ((tmp$_0 = (tmp$ = !equals(this.local$closure$clazzUid, L0) ? this.local$dbToUse : null) != null ? tmp$.coursePictureDao : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_0.findByClazzUidAsync_s8cxhz$(this.local$closure$clazzUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 ClazzEdit2Presenter$onLoadEntityFromDb$lambda_0(closure$clazzUid_0) {
    return function(dbToUse_0, f_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_0(closure$clazzUid_0, dbToUse_0, f_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_1(closure$clazzUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$clazzUid = closure$clazzUid_0;
    this.local$it = it_0;
  }
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_1.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_1.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_1.prototype.constructor = Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_1;
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_1.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        var $receiver = this.local$it.scheduleDao;
        if ((tmp$ = !equals(this.local$closure$clazzUid, L0) ? $receiver : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$.findAllSchedulesByClazzUidAsync_s8cxhz$(this.local$closure$clazzUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 ClazzEdit2Presenter$onLoadEntityFromDb$lambda_1(closure$clazzUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_1(closure$clazzUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_2(closure$clazzUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$clazzUid = closure$clazzUid_0;
    this.local$it = it_0;
  }
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_2.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_2.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_2.prototype.constructor = Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_2;
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_2.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        var $receiver = this.local$it.courseBlockDao;
        if ((tmp$ = !equals(this.local$closure$clazzUid, L0) ? $receiver : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$.findAllCourseBlockByClazzUidAsync_s8cxhz$(this.local$closure$clazzUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 ClazzEdit2Presenter$onLoadEntityFromDb$lambda_2(closure$clazzUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_2(closure$clazzUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_3(closure$clazzUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$clazzUid = closure$clazzUid_0;
    this.local$it = it_0;
  }
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_3.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_3.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_3.prototype.constructor = Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_3;
  Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_3.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.discussionTopicDao.getTopicsByClazz_s8cxhz$(this.local$closure$clazzUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ClazzEdit2Presenter$onLoadEntityFromDb$lambda_3(closure$clazzUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzEdit2Presenter$onLoadEntityFromDb$lambda_3(closure$clazzUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_3($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$_3 = void 0;
    this.local$clazzUid = void 0;
    this.local$tmp$_6 = void 0;
    this.local$$receiver = void 0;
    this.local$clazz = void 0;
    this.local$courseBlocksDb = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_3.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_3.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_3.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_3;
  Coroutine$onLoadEntityFromDb_7hogkd$_3.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2;
        var tmp$_3, tmp$_4;
        this.local$clazzUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, ClazzEdit2Presenter$onLoadEntityFromDb$lambda(this.local$clazzUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if ((tmp$_1 = this.result_0) != null) {
          this.local$tmp$_6 = tmp$_1;
          this.state_0 = 7;
          continue;
        } else {
          this.local$$receiver = new ClazzWithHolidayCalendarAndSchoolAndTerminology();
          var tmp$_5, tmp$_6, tmp$_7, tmp$_8;
          this.local$$receiver.clazzUid = get_doorPrimaryKeyManager(this.local$db).nextId_za3lpa$(6);
          this.local$$receiver.clazzName = '';
          this.local$$receiver.isClazzActive = true;
          this.local$$receiver.clazzStartTime = systemTimeInMillis();
          this.local$$receiver.clazzTimeZone = getDefaultTimeZoneId();
          this.local$$receiver.clazzSchoolUid = (tmp$_6 = (tmp$_5 = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_SCHOOL_UID)) != null ? toLong(tmp$_5) : null) != null ? tmp$_6 : L0;
          var $receiver = this.local$db.schoolDao;
          if ((tmp$_7 = !equals(this.local$$receiver.clazzSchoolUid, L0) ? $receiver : null) != null) {
            this.state_0 = 3;
            this.result_0 = tmp$_7.findByUidAsync_s8cxhz$(this.local$$receiver.clazzSchoolUid, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.result_0 = null;
            this.state_0 = 4;
            continue;
          }
        }
      case 3:
        this.state_0 = 4;
        continue;
      case 4:
        this.local$$receiver.school = this.result_0;
        var $receiver_0 = this.local$db.courseTerminologyDao;
        if ((tmp$_8 = !equals(this.local$$receiver.clazzTerminologyUid, L0) ? $receiver_0 : null) != null) {
          this.state_0 = 5;
          this.result_0 = tmp$_8.findByUid(this.local$$receiver.clazzTerminologyUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 6;
          continue;
        }
      case 5:
        this.state_0 = 6;
        continue;
      case 6:
        this.local$$receiver.terminology = this.result_0;
        this.local$tmp$_6 = this.local$$receiver;
        this.state_0 = 7;
        continue;
      case 7:
        this.local$clazz = this.local$tmp$_6;
        this.local$tmp$_3 = this.$this.view;
        this.state_0 = 8;
        this.result_0 = onDbThenRepoWithTimeout(this.local$db, L2000, ClazzEdit2Presenter$onLoadEntityFromDb$lambda_0(this.local$clazzUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 8:
        this.local$tmp$_3.coursePicture = (tmp$_2 = this.result_0) != null ? tmp$_2 : new CoursePicture();
        this.state_0 = 9;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, ClazzEdit2Presenter$onLoadEntityFromDb$lambda_1(this.local$clazzUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 9:
        var schedules = (tmp$_3 = this.result_0) != null ? tmp$_3 : emptyList();
        this.$this.scheduleOneToManyJoinEditHelper_0.liveList.sendValue_11rb$(schedules);
        this.state_0 = 10;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, ClazzEdit2Presenter$onLoadEntityFromDb$lambda_2(this.local$clazzUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 10:
        this.local$courseBlocksDb = (tmp$_4 = this.result_0) != null ? tmp$_4 : emptyList();
        this.state_0 = 11;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, ClazzEdit2Presenter$onLoadEntityFromDb$lambda_3(this.local$clazzUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 11:
        this.$this.topics = this.result_0;
        var destination = ArrayList_init_0(collectionSizeOrDefault(this.local$courseBlocksDb, 10));
        var tmp$_9;
        tmp$_9 = this.local$courseBlocksDb.iterator();
        while (tmp$_9.hasNext()) {
          var item = tmp$_9.next();
          destination.add_11rb$(asCourseBlockWithEntity(item, this.$this.topics));
        }
        var courseBlocks = destination;
        this.$this.courseBlockOneToManyJoinEditHelper_0.liveList.sendValue_11rb$(courseBlocks);
        return this.local$clazz;
      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);
};
  ClazzEdit2Presenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_3(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ClazzEdit2Presenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$, tmp$_0;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var clazzJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (clazzJsonStr != null) {
    var di = this.di;
    var strategy = ClazzWithHolidayCalendarAndSchoolAndTerminology.Companion.serializer();
    var tmp$_1;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_1 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, clazzJsonStr);
  } else {
    tmp$ = new ClazzWithHolidayCalendarAndSchoolAndTerminology();
  }
  var clazz = tmp$;
  this.scheduleOneToManyJoinEditHelper_0.onLoadFromJsonSavedState_alv73c$(bundle);
  this.courseBlockOneToManyJoinEditHelper_0.onLoadFromJsonSavedState_alv73c$(bundle);
  this.view.coursePicture = (tmp$_0 = bundle.get_11rb$(ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_COURSEPICTURE)) != null ? this.json_0.decodeFromString_awif5v$(CoursePicture.Companion.serializer(), tmp$_0) : null;
  return clazz;
};
  ClazzEdit2Presenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  var tmp$;
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  tmp$ = this.view.entity;
  if (tmp$ == null) {
    return;
  }
  var entityVal = tmp$;
  putEntityAsJson(savedState, ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_COURSEPICTURE, null, this.view.coursePicture);
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  ClazzEdit2Presenter.prototype.handleClickTimezone = function() {
  var tmp$;
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, (tmp$ = this.entity) != null ? tmp$.clazzTimeZone : null, TimeZoneListView$Companion_getInstance().VIEW_NAME, PrimitiveClasses$stringClass, serializer(kotlin_js_internal_StringCompanionObject), TimeZoneListPresenter$Companion_getInstance().RESULT_TIMEZONE_KEY));
};
  ClazzEdit2Presenter.prototype.handleHolidayCalendarClicked = function() {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, HolidayCalendarListView$Companion_getInstance().VIEW_NAME, getKClass(HolidayCalendar), HolidayCalendar.Companion.serializer(), ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_HOLIDAYCALENDAR));
};
  ClazzEdit2Presenter.prototype.handleClickSchool = function() {
  var args = mutableMapOf([to(UstadView$Companion_getInstance().ARG_FILTER_BY_PERMISSION, Role$Companion$PERMISSION_PERSON_DELEGATE.toString())]);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, SchoolListView$Companion_getInstance().VIEW_NAME, getKClass(School), School.Companion.serializer(), ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_SCHOOL, void 0, args));
};
  ClazzEdit2Presenter.prototype.handleTerminologyClicked = function() {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, CourseTerminologyListView$Companion_getInstance().VIEW_NAME, getKClass(CourseTerminology), CourseTerminology.Companion.serializer(), ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_TERMINOLOGY));
};
  ClazzEdit2Presenter.prototype.handleClickFeatures = function() {
  var tmp$, tmp$_0;
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, new LongWrapper((tmp$_0 = (tmp$ = this.entity) != null ? tmp$.clazzFeatures : null) != null ? tmp$_0 : L0), BitmaskEditView$Companion_getInstance().VIEW_NAME, getKClass(LongWrapper), LongWrapper$Companion_getInstance().serializer(), ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_FEATURES));
};
  function ClazzEdit2Presenter$handleClickSave$lambda$lambda$lambda(closure$entity) {
    return function(it) {
  it.scheduleClazzUid = closure$entity.clazzUid;
  return Unit;
};
  }
  function Coroutine$ClazzEdit2Presenter$handleClickSave$lambda$lambda(this$ClazzEdit2Presenter_0, closure$entity_0, closure$courseBlockList_0, txDb_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$this$ClazzEdit2Presenter = this$ClazzEdit2Presenter_0;
    this.local$closure$entity = closure$entity_0;
    this.local$closure$courseBlockList = closure$courseBlockList_0;
    this.local$assignmentList = void 0;
    this.local$tmp$ = void 0;
    this.local$element = void 0;
    this.local$xobject = void 0;
    this.local$txDb = txDb_0;
  }
  Coroutine$ClazzEdit2Presenter$handleClickSave$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzEdit2Presenter$handleClickSave$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzEdit2Presenter$handleClickSave$lambda$lambda.prototype.constructor = Coroutine$ClazzEdit2Presenter$handleClickSave$lambda$lambda;
  Coroutine$ClazzEdit2Presenter$handleClickSave$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if (equals((tmp$_0 = (tmp$ = this.local$this$ClazzEdit2Presenter.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLongOrNull(tmp$) : null) != null ? tmp$_0 : L0, L0)) {
          this.state_0 = 3;
          this.result_0 = this.local$this$ClazzEdit2Presenter.db.courseTerminologyDao.findByUid(this.local$closure$entity.clazzTerminologyUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 2;
          this.result_0 = this.local$txDb.clazzDao.updateAsync_yczdf2$(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 5;
        continue;
      case 3:
        var termMap = toTermMap(this.result_0, this.local$this$ClazzEdit2Presenter.json_0, this.local$this$ClazzEdit2Presenter.systemImpl, this.local$this$ClazzEdit2Presenter.context);
        this.state_0 = 4;
        this.result_0 = createNewClazzAndGroups(this.local$txDb, this.local$closure$entity, this.local$this$ClazzEdit2Presenter.systemImpl, termMap, this.local$this$ClazzEdit2Presenter.context, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        this.state_0 = 6;
        this.result_0 = this.local$this$ClazzEdit2Presenter.scheduleOneToManyJoinEditHelper_0.commitToDatabase_kc7sxt$(this.local$txDb.scheduleDao, ClazzEdit2Presenter$handleClickSave$lambda$lambda$lambda(this.local$closure$entity), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 6:
        var $receiver = this.local$this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.entitiesToInsert;
        var destination = ArrayList_init();
        var tmp$_1;
        tmp$_1 = $receiver.iterator();
        while (tmp$_1.hasNext()) {
          var element = tmp$_1.next();
          var tmp$_0_0;
          if ((tmp$_0_0 = element.assignment) != null) {
            destination.add_11rb$(tmp$_0_0);
          }
        }
        this.local$assignmentList = destination;
        this.state_0 = 7;
        this.result_0 = this.local$txDb.clazzAssignmentDao.insertListAsync_4ezy5m$(this.local$assignmentList, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 7:
        var tmp$_2 = this.local$txDb.clazzAssignmentDao;
        var $receiver_0 = this.local$this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.entitiesToUpdate;
        var destination_0 = ArrayList_init();
        var tmp$_3;
        tmp$_3 = $receiver_0.iterator();
        while (tmp$_3.hasNext()) {
          var element_0 = tmp$_3.next();
          var tmp$_0_1;
          if ((tmp$_0_1 = element_0.assignment) != null) {
            destination_0.add_11rb$(tmp$_0_1);
          }
        }
        this.state_0 = 8;
        this.result_0 = tmp$_2.updateListAsync_4ezy5m$(destination_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 8:
        this.state_0 = 9;
        this.result_0 = this.local$txDb.clazzAssignmentDao.deactivateByUids_ejltwb$(this.local$this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.primaryKeysToDeactivate, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 9:
        this.local$tmp$ = this.local$assignmentList.iterator();
        this.state_0 = 10;
        continue;
      case 10:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 13;
          continue;
        }
        this.local$element = this.local$tmp$.next();
        var this$ClazzEdit2Presenter = this.local$this$ClazzEdit2Presenter;
        var clazzAssignmentObjectId = UMFileUtil_getInstance().joinPaths_vqirvp$([this$ClazzEdit2Presenter.accountManager.activeAccount.endpointUrl, '/clazzAssignment/' + this.local$element.caUid.toString()]);
        var $receiver_1 = XObjectEntity_init();
        $receiver_1.objectId = clazzAssignmentObjectId;
        $receiver_1.objectType = 'Activity';
        this.local$xobject = $receiver_1;
        this.state_0 = 11;
        this.result_0 = this.local$txDb.xObjectDao.insertAsync(this.local$xobject, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 11:
        this.local$xobject.xObjectUid = this.result_0;
        this.local$element.caXObjectUid = this.local$xobject.xObjectUid;
        this.state_0 = 12;
        this.result_0 = this.local$txDb.clazzAssignmentDao.updateAsync_etrmwv$(this.local$element, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 12:
        this.state_0 = 10;
        continue;
      case 13:
        var tmp$_4 = this.local$txDb.courseDiscussionDao;
        var $receiver_2 = this.local$this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.entitiesToInsert;
        var destination_1 = ArrayList_init();
        var tmp$_5;
        tmp$_5 = $receiver_2.iterator();
        while (tmp$_5.hasNext()) {
          var element_1 = tmp$_5.next();
          var tmp$_0_2;
          if ((tmp$_0_2 = element_1.courseDiscussion) != null) {
            destination_1.add_11rb$(tmp$_0_2);
          }
        }
        var $receiver_3 = this.local$this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.entitiesToUpdate;
        var destination_2 = ArrayList_init();
        var tmp$_6;
        tmp$_6 = $receiver_3.iterator();
        while (tmp$_6.hasNext()) {
          var element_2 = tmp$_6.next();
          var tmp$_0_3;
          if ((tmp$_0_3 = element_2.courseDiscussion) != null) {
            destination_2.add_11rb$(tmp$_0_3);
          }
        }
        this.state_0 = 14;
        this.result_0 = tmp$_4.replaceListAsync_4f5xb2$(plus_0(destination_1, destination_2), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 14:
        this.state_0 = 15;
        this.result_0 = this.local$txDb.courseDiscussionDao.deactivateByUids_ejltwb$(this.local$this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.primaryKeysToDeactivate, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 15:
        var $receiver_4 = this.local$closure$courseBlockList;
        var destination_3 = ArrayList_init();
        var tmp$_7;
        tmp$_7 = $receiver_4.iterator();
        while (tmp$_7.hasNext()) {
          var element_3 = tmp$_7.next();
          var tmp$_0_4;
          if ((tmp$_0_4 = element_3.topics) != null) {
            destination_3.add_11rb$(tmp$_0_4);
          }
        }
        var tti = flatten(destination_3);
        this.state_0 = 16;
        this.result_0 = this.local$txDb.discussionTopicDao.replaceListAsync_twfw7k$(tti, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 16:
        var $receiver_5 = this.local$closure$courseBlockList;
        var destination_4 = ArrayList_init();
        var tmp$_8;
        tmp$_8 = $receiver_5.iterator();
        while (tmp$_8.hasNext()) {
          var element_4 = tmp$_8.next();
          var tmp$_0_5;
          if ((tmp$_0_5 = element_4.topicUidsToRemove) != null) {
            destination_4.add_11rb$(tmp$_0_5);
          }
        }
        var topicUidsToDelete = flatten(destination_4);
        this.state_0 = 17;
        this.result_0 = this.local$txDb.discussionTopicDao.deactivateByUids_ejltwb$(topicUidsToDelete, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 17:
        this.state_0 = 18;
        this.result_0 = this.local$txDb.courseBlockDao.replaceListAsync_u9gaf9$(this.local$closure$courseBlockList, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 18:
        this.state_0 = 19;
        this.result_0 = this.local$txDb.courseBlockDao.deactivateByUids_ejltwb$(this.local$this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.primaryKeysToDeactivate, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 19:
        var coursePictureVal = this.local$this$ClazzEdit2Presenter.view.coursePicture;
        if (coursePictureVal != null) {
          coursePictureVal.coursePictureClazzUid = this.local$closure$entity.clazzUid;
          if (equals(coursePictureVal.coursePictureUid, L0)) {
            this.state_0 = 21;
            this.result_0 = this.local$txDb.coursePictureDao.insertAsync(coursePictureVal, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 20;
            this.result_0 = this.local$txDb.coursePictureDao.updateAsync_xhijq5$(coursePictureVal, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          }
        } else {
          this.state_0 = 23;
          continue;
        }
      case 20:
        return Unit;
      case 21:
        return Unit;
      case 22:
        this.state_0 = 23;
        continue;
      case 23:
        return Unit;
      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 ClazzEdit2Presenter$handleClickSave$lambda$lambda(this$ClazzEdit2Presenter_0, closure$entity_0, closure$courseBlockList_0) {
    return function(txDb_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzEdit2Presenter$handleClickSave$lambda$lambda(this$ClazzEdit2Presenter_0, closure$entity_0, closure$courseBlockList_0, txDb_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  var ClazzEdit2Presenter$handleClickSave$lambda$clazzLogCreatorManager_metadata = new PropertyMetadata('clazzLogCreatorManager');
  function Coroutine$ClazzEdit2Presenter$handleClickSave$lambda(closure$entity_0, this$ClazzEdit2Presenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$ClazzEdit2Presenter = this$ClazzEdit2Presenter_0;
  }
  Coroutine$ClazzEdit2Presenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzEdit2Presenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzEdit2Presenter$handleClickSave$lambda.prototype.constructor = Coroutine$ClazzEdit2Presenter$handleClickSave$lambda;
  Coroutine$ClazzEdit2Presenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if (equals(this.local$closure$entity.clazzStartTime, L0)) {
          this.local$this$ClazzEdit2Presenter.view.clazzStartDateError = this.local$this$ClazzEdit2Presenter.systemImpl.getString(2127, this.local$this$ClazzEdit2Presenter.context);
          this.local$this$ClazzEdit2Presenter.view.fieldsEnabled = true;
          return;
        } else {
          this.state_0 = 2;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        if (this.local$closure$entity.clazzEndTime.compareTo_11rb$(this.local$closure$entity.clazzStartTime) <= 0) {
          this.local$this$ClazzEdit2Presenter.view.clazzEndDateError = this.local$this$ClazzEdit2Presenter.systemImpl.getString(2679, this.local$this$ClazzEdit2Presenter.context);
          this.local$this$ClazzEdit2Presenter.view.fieldsEnabled = true;
          return;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 3:
        this.local$this$ClazzEdit2Presenter.view.loading = true;
        var tmp$_1 = this.local$closure$entity;
        var tmp$_2 = DateTime.Companion.invoke_s8cxhz$(this.local$closure$entity.clazzStartTime);
        var $receiver = this.local$closure$entity;
        var tmp$_3, tmp$_4, tmp$_5;
        var $receiver_0 = toOffsetByTimezone(tmp$_2, (tmp$_5 = (tmp$_4 = $receiver.clazzTimeZone) != null ? tmp$_4 : (tmp$_3 = $receiver.school) != null ? tmp$_3.schoolTimeZone : null) != null ? tmp$_5 : 'UTC');
        var $receiver_1 = $receiver_0.hours;
        var tmp$_6 = TimeSpan.Companion.fromHours_14dthe$($receiver_1);
        var $receiver_2 = $receiver_0.minutes;
        var tmp$_7 = tmp$_6.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_2));
        var $receiver_3 = $receiver_0.seconds;
        var tmp$_8 = tmp$_7.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_3));
        var $receiver_4 = $receiver_0.milliseconds;
        tmp$_1.clazzStartTime = $receiver_0.minus_fv8bff$(tmp$_8.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_4))).utc.unixMillisLong;
        if (!equals(this.local$closure$entity.clazzEndTime, Long$Companion$MAX_VALUE)) {
          var tmp$_9 = this.local$closure$entity;
          var tmp$_10 = DateTime.Companion.invoke_s8cxhz$(this.local$closure$entity.clazzEndTime);
          var $receiver_5 = this.local$closure$entity;
          var tmp$_11, tmp$_12, tmp$_13;
          var $receiver_6 = toOffsetByTimezone(tmp$_10, (tmp$_13 = (tmp$_12 = $receiver_5.clazzTimeZone) != null ? tmp$_12 : (tmp$_11 = $receiver_5.school) != null ? tmp$_11.schoolTimeZone : null) != null ? tmp$_13 : 'UTC');
          var $receiver_7 = $receiver_6.hours;
          var tmp$_14 = TimeSpan.Companion.fromHours_14dthe$($receiver_7);
          var $receiver_8 = $receiver_6.minutes;
          var tmp$_15 = tmp$_14.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_8));
          var $receiver_9 = $receiver_6.seconds;
          var tmp$_16 = tmp$_15.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_9));
          var $receiver_10 = $receiver_6.milliseconds;
          tmp$_9.clazzEndTime = $receiver_6.minus_fv8bff$(tmp$_16.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_10))).plus_fv8bff$(TimeSpan.Companion.fromHours_14dthe$(24)).minus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$(1)).utc.unixMillisLong;
        }
        var courseBlockList = (tmp$_0 = (tmp$ = this.local$this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.liveList.getValue()) != null ? toList(tmp$) : null) != null ? tmp$_0 : emptyList();
        var currentParentBlock = {
  v: null};
        var tmp$_17, tmp$_0_0;
        var index = 0;
        tmp$_17 = courseBlockList.iterator();
        while (tmp$_17.hasNext()) {
          var item = tmp$_17.next();
          var tmp$_18, tmp$_19;
          item.cbIndex = checkIndexOverflow((tmp$_0_0 = index , index = tmp$_0_0 + 1 | 0 , tmp$_0_0));
          if (item.cbType === 100) {
            currentParentBlock.v = item;
          } else if (item.cbIndentLevel !== 0) {
            item.cbModuleParentBlockUid = (tmp$_19 = (tmp$_18 = currentParentBlock.v) != null ? tmp$_18.cbUid : null) != null ? tmp$_19 : L0;
          }
        }
        this.local$this$ClazzEdit2Presenter.courseBlockOneToManyJoinEditHelper_0.liveList.sendValue_11rb$(courseBlockList);
        this.state_0 = 4;
        this.result_0 = withDoorTransactionAsync(this.local$this$ClazzEdit2Presenter.repo, getKClass(UmAppDatabase), ClazzEdit2Presenter$handleClickSave$lambda$lambda(this.local$this$ClazzEdit2Presenter, this.local$closure$entity, courseBlockList), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        var tmp$_20 = DateTime.Companion.now();
        var $receiver_11 = this.local$closure$entity;
        var tmp$_21, tmp$_22, tmp$_23;
        var $receiver_12 = toOffsetByTimezone(tmp$_20, (tmp$_23 = (tmp$_22 = $receiver_11.clazzTimeZone) != null ? tmp$_22 : (tmp$_21 = $receiver_11.school) != null ? tmp$_21.schoolTimeZone : null) != null ? tmp$_23 : 'UTC');
        var $receiver_13 = $receiver_12.hours;
        var tmp$_24 = TimeSpan.Companion.fromHours_14dthe$($receiver_13);
        var $receiver_14 = $receiver_12.minutes;
        var tmp$_25 = tmp$_24.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_14));
        var $receiver_15 = $receiver_12.seconds;
        var tmp$_26 = tmp$_25.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_15));
        var $receiver_16 = $receiver_12.milliseconds;
        var fromDateTime = $receiver_12.minus_fv8bff$(tmp$_26.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_16)));
        var tmp$_27;
        var clazzLogCreatorManager = Instance(this.local$this$ClazzEdit2Presenter.di, Kotlin.isType(tmp$_27 = typeToken(createKType(getKClass(ClazzLogCreatorManager), [], false)), TypeToken) ? tmp$_27 : throwCCE(), null).provideDelegate_tpuvb9$(this.$this, ClazzEdit2Presenter$handleClickSave$lambda$clazzLogCreatorManager_metadata);
        var tmp$_28 = clazzLogCreatorManager.value;
        var tmp$_29 = this.local$closure$entity.clazzUid;
        var tmp$_30 = this.local$this$ClazzEdit2Presenter.accountManager.activeAccount.endpointUrl;
        var tmp$_31 = fromDateTime.utc.unixMillisLong;
        var $receiver_17 = fromDateTime.hours;
        var tmp$_32 = TimeSpan.Companion.fromHours_14dthe$($receiver_17);
        var $receiver_18 = fromDateTime.minutes;
        var tmp$_33 = tmp$_32.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_18));
        var $receiver_19 = fromDateTime.seconds;
        var tmp$_34 = tmp$_33.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_19));
        var $receiver_20 = fromDateTime.milliseconds;
        tmp$_28.requestClazzLogCreation_icxydn$(tmp$_29, tmp$_30, tmp$_31, fromDateTime.minus_fv8bff$(tmp$_34.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_20))).plus_fv8bff$(TimeSpan.Companion.fromHours_14dthe$(24)).minus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$(1)).utc.unixMillisLong);
        this.local$this$ClazzEdit2Presenter.view.loading = false;
        return this.local$this$ClazzEdit2Presenter.onFinish_xcg1s8$(ClazzDetailView$Companion_getInstance().VIEW_NAME, this.local$closure$entity.clazzUid, this.local$closure$entity, ClazzWithHolidayCalendarAndSchoolAndTerminology.Companion.serializer()) , Unit;
      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 ClazzEdit2Presenter$handleClickSave$lambda(closure$entity_0, this$ClazzEdit2Presenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzEdit2Presenter$handleClickSave$lambda(closure$entity_0, this$ClazzEdit2Presenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzEdit2Presenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  if (!this.view.fieldsEnabled) 
    return;
  this.view.fieldsEnabled = false;
  launch(this.presenterScope, void 0, void 0, ClazzEdit2Presenter$handleClickSave$lambda(entity, this));
};
  ClazzEdit2Presenter.prototype.handleClickAddAssignment = function() {
  var tmp$, tmp$_0;
  var args = LinkedHashMap_init();
  var key = UstadView$Companion_getInstance().ARG_CLAZZUID;
  var value = toString((tmp$ = this.entity) != null ? tmp$.clazzUid : null);
  args.put_xwzc9p$(key, value);
  if (this.entity != null) {
    var key_0 = ClazzAssignmentEditView$Companion_getInstance().TERMINOLOGY_ID;
    var value_0 = toString((tmp$_0 = this.entity) != null ? tmp$_0.clazzTerminologyUid : null);
    args.put_xwzc9p$(key_0, value_0);
  }
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ClazzAssignmentEditView$Companion_getInstance().VIEW_NAME, getKClass(CourseBlockWithEntity), CourseBlockWithEntity.Companion.serializer(), ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_ASSIGNMENT, void 0, args));
};
  ClazzEdit2Presenter.prototype.handleClickAddContent = function() {
  var tmp$;
  var args = mutableMapOf([to(ContentEntryList2View$Companion_getInstance().ARG_SELECT_FOLDER_VISIBLE, false.toString()), to(ContentEntryList2View$Companion_getInstance().ARG_USE_CHIPS, true.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZUID, toString((tmp$ = this.entity) != null ? tmp$.clazzUid : null)), to(ContentEntryEdit2View$Companion_getInstance().BLOCK_REQUIRED, true.toString())]);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ContentEntryList2View$Companion_getInstance().VIEW_NAME, getKClass(ContentEntryWithBlockAndLanguage), ContentEntryWithBlockAndLanguage.Companion.serializer(), ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_CONTENT, void 0, args));
};
  ClazzEdit2Presenter.prototype.handleClickAddModule = function() {
  var tmp$;
  var args = LinkedHashMap_init();
  var key = UstadView$Companion_getInstance().ARG_CLAZZUID;
  var value = toString((tmp$ = this.entity) != null ? tmp$.clazzUid : null);
  args.put_xwzc9p$(key, value);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ModuleCourseBlockEditView$Companion_getInstance().VIEW_NAME, getKClass(CourseBlock), CourseBlock.Companion.serializer(), ClazzEdit2Presenter$Companion_getInstance().ARG_SAVEDSTATE_MODULE, void 0, args));
};
  ClazzEdit2Presenter.prototype.handleClickAddDiscussion = function() {
  var tmp$;
  var args = LinkedHashMap_init();
  var key = UstadView$Companion_getInstance().ARG_CLAZZUID;
  var value = toString((tmp$ = this.entity) != null ? tmp$.clazzUid : null);
  args.put_xwzc9p$(key, value);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, CourseDiscussionEditView$Companion_getInstance().VIEW_NAME, getKClass(CourseDiscussion), CourseDiscussion.Companion.serializer(), ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_DISCUSSION, void 0, args));
};
  ClazzEdit2Presenter.prototype.handleClickAddText = function() {
  var tmp$;
  var args = LinkedHashMap_init();
  var key = UstadView$Companion_getInstance().ARG_CLAZZUID;
  var value = toString((tmp$ = this.entity) != null ? tmp$.clazzUid : null);
  args.put_xwzc9p$(key, value);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, TextCourseBlockEditView$Companion_getInstance().VIEW_NAME, getKClass(CourseBlock), CourseBlock.Companion.serializer(), ClazzEdit2Presenter$Companion_getInstance().ARG_SAVEDSTATE_TEXT, void 0, args));
};
  ClazzEdit2Presenter.prototype.onClickNew = function() {
};
  ClazzEdit2Presenter.prototype.onClickEdit_11rb$ = function(joinedEntity) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6, tmp$_7, tmp$_8, tmp$_9, tmp$_10, tmp$_11, tmp$_12, tmp$_13, tmp$_14;
  switch (joinedEntity.cbType) {
    case 103:
      var args = LinkedHashMap_init();
      var key = UstadView$Companion_getInstance().ARG_CLAZZUID;
      var value = ((tmp$_2 = (tmp$_1 = (tmp$ = joinedEntity.assignment) != null ? tmp$.caClazzUid : null) != null ? tmp$_1 : (tmp$_0 = this.entity) != null ? tmp$_0.clazzUid : null) != null ? tmp$_2 : L0).toString();
      args.put_xwzc9p$(key, value);
      var key_0 = UstadView$Companion_getInstance().ARG_ENTITY_UID;
      var value_0 = ((tmp$_4 = (tmp$_3 = joinedEntity.assignment) != null ? tmp$_3.caUid : null) != null ? tmp$_4 : L0).toString();
      args.put_xwzc9p$(key_0, value_0);
      if (this.entity != null) {
        var key_1 = ClazzAssignmentEditView$Companion_getInstance().TERMINOLOGY_ID;
        var value_1 = toString((tmp$_5 = this.entity) != null ? tmp$_5.clazzTerminologyUid : null);
        args.put_xwzc9p$(key_1, value_1);
      }
      tmp$_14 = new NavigateForResultOptions(this, joinedEntity, ClazzAssignmentEditView$Companion_getInstance().VIEW_NAME, getKClass(CourseBlockWithEntity), CourseBlockWithEntity.Companion.serializer(), ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_ASSIGNMENT, void 0, args);
      break;
    case 104:
      tmp$_6 = joinedEntity.entry;
      if (tmp$_6 == null) {
        return;
      }
      var entry = tmp$_6;
      var $receiver = new ContentEntryWithBlockAndLanguage();
      $receiver.contentEntryUid = entry.contentEntryUid;
      $receiver.title = entry.title;
      $receiver.description = entry.description;
      $receiver.author = entry.author;
      $receiver.publisher = entry.publisher;
      $receiver.licenseType = entry.licenseType;
      $receiver.licenseName = entry.licenseName;
      $receiver.licenseUrl = entry.licenseUrl;
      $receiver.sourceUrl = entry.sourceUrl;
      $receiver.lastModified = entry.lastModified;
      $receiver.primaryLanguageUid = entry.primaryLanguageUid;
      $receiver.languageVariantUid = entry.languageVariantUid;
      $receiver.contentFlags = entry.contentFlags;
      $receiver.leaf = entry.leaf;
      $receiver.publik = entry.publik;
      $receiver.ceInactive = entry.ceInactive;
      $receiver.contentTypeFlag = entry.contentTypeFlag;
      $receiver.contentOwner = entry.contentOwner;
      $receiver.contentEntryLocalChangeSeqNum = entry.contentEntryLocalChangeSeqNum;
      $receiver.contentEntryMasterChangeSeqNum = entry.contentEntryMasterChangeSeqNum;
      $receiver.contentEntryLastChangedBy = entry.contentEntryLastChangedBy;
      $receiver.contentEntryLct = entry.contentEntryLct;
      $receiver.block = joinedEntity;
      $receiver.language = joinedEntity.language;
      var entity = $receiver;
      tmp$_14 = new NavigateForResultOptions(this, entity, ContentEntryEdit2View$Companion_getInstance().VIEW_NAME, getKClass(ContentEntryWithBlockAndLanguage), ContentEntryWithBlockAndLanguage.Companion.serializer(), ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_CONTENT, void 0, mutableMapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, toString((tmp$_7 = joinedEntity.entry) != null ? tmp$_7.contentEntryUid : null)), to(UstadView$Companion_getInstance().ARG_LEAF, true.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZUID, joinedEntity.cbClazzUid.toString()), to(ContentEntryEdit2View$Companion_getInstance().BLOCK_REQUIRED, true.toString())]));
      break;
    case 100:
      var args_0 = LinkedHashMap_init();
      var key_2 = UstadView$Companion_getInstance().ARG_CLAZZUID;
      var value_2 = joinedEntity.cbClazzUid.toString();
      args_0.put_xwzc9p$(key_2, value_2);
      var key_3 = UstadView$Companion_getInstance().ARG_ENTITY_UID;
      var value_3 = joinedEntity.cbUid.toString();
      args_0.put_xwzc9p$(key_3, value_3);
      tmp$_14 = new NavigateForResultOptions(this, joinedEntity, ModuleCourseBlockEditView$Companion_getInstance().VIEW_NAME, getKClass(CourseBlock), CourseBlock.Companion.serializer(), ClazzEdit2Presenter$Companion_getInstance().ARG_SAVEDSTATE_MODULE, void 0, args_0);
      break;
    case 102:
      var args_1 = LinkedHashMap_init();
      var key_4 = UstadView$Companion_getInstance().ARG_CLAZZUID;
      var value_4 = joinedEntity.cbClazzUid.toString();
      args_1.put_xwzc9p$(key_4, value_4);
      var key_5 = UstadView$Companion_getInstance().ARG_ENTITY_UID;
      var value_5 = joinedEntity.cbUid.toString();
      args_1.put_xwzc9p$(key_5, value_5);
      tmp$_14 = new NavigateForResultOptions(this, joinedEntity, TextCourseBlockEditView$Companion_getInstance().VIEW_NAME, getKClass(CourseBlock), CourseBlock.Companion.serializer(), ClazzEdit2Presenter$Companion_getInstance().ARG_SAVEDSTATE_TEXT, void 0, args_1);
      break;
    case 105:
      var args_2 = LinkedHashMap_init();
      var key_6 = UstadView$Companion_getInstance().ARG_CLAZZUID;
      var value_6 = ((tmp$_11 = (tmp$_10 = (tmp$_8 = joinedEntity.courseDiscussion) != null ? tmp$_8.courseDiscussionClazzUid : null) != null ? tmp$_10 : (tmp$_9 = this.entity) != null ? tmp$_9.clazzUid : null) != null ? tmp$_11 : L0).toString();
      args_2.put_xwzc9p$(key_6, value_6);
      var key_7 = UstadView$Companion_getInstance().ARG_ENTITY_UID;
      var value_7 = ((tmp$_13 = (tmp$_12 = joinedEntity.courseDiscussion) != null ? tmp$_12.courseDiscussionUid : null) != null ? tmp$_13 : L0).toString();
      args_2.put_xwzc9p$(key_7, value_7);
      tmp$_14 = new NavigateForResultOptions(this, joinedEntity, CourseDiscussionEditView$Companion_getInstance().VIEW_NAME, getKClass(CourseBlockWithEntity), CourseBlockWithEntity.Companion.serializer(), ClazzEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_DISCUSSION, void 0, args_2);
      break;
    default:
      return;
  }
  var navigateForResultOptions = tmp$_14;
  this.navigateForResult_r13zgt$(navigateForResultOptions);
};
  ClazzEdit2Presenter.prototype.onClickDelete_11rb$ = function(joinedEntity) {
  this.courseBlockOneToManyJoinEditHelper_0.onDeactivateEntity_trkh7z$(joinedEntity);
};
  ClazzEdit2Presenter.prototype.onClickIndent_11rb$ = function(joinedEntity) {
  var tmp$;
  if (equals(joinedEntity.cbModuleParentBlockUid, L0)) {
    var currentList = (tmp$ = this.courseBlockOneToManyJoinEditHelper_0.liveList.getValue()) != null ? tmp$ : emptyList();
    var index = currentList.indexOf_11rb$(joinedEntity);
    for (var n = index; n >= 0; n--) {
      if (currentList.get_za3lpa$(n).cbType === 100) {
        joinedEntity.cbModuleParentBlockUid = currentList.get_za3lpa$(n).cbUid;
        break;
      }
    }
  }
  joinedEntity.cbIndentLevel = joinedEntity.cbIndentLevel + 1 | 0;
  this.courseBlockOneToManyJoinEditHelper_0.onEditResult_trkh7z$(joinedEntity);
};
  ClazzEdit2Presenter.prototype.onClickUnIndent_11rb$ = function(joinedEntity) {
  var tmp$, tmp$_0, tmp$_1;
  var newList = (tmp$_0 = (tmp$ = this.courseBlockOneToManyJoinEditHelper_0.liveList.getValue()) != null ? toMutableList(tmp$) : null) != null ? tmp$_0 : ArrayList_init();
  var firstOrNull$result;
  firstOrNull$break:
    do {
      var tmp$_2;
      tmp$_2 = newList.iterator();
      while (tmp$_2.hasNext()) {
        var element = tmp$_2.next();
        if (equals(element.cbUid, joinedEntity.cbUid)) {
          firstOrNull$result = element;
          break firstOrNull$break;
        }
      }
      firstOrNull$result = null;
    } while (false);
  tmp$_1 = firstOrNull$result;
  if (tmp$_1 == null) {
    return;
  }
  var foundBlock = tmp$_1;
  foundBlock.cbIndentLevel = foundBlock.cbIndentLevel - 1 | 0;
  if (foundBlock.cbIndentLevel === 0) {
    foundBlock.cbModuleParentBlockUid = L0;
  }
  newList.set_wxm5ur$(foundBlock.cbIndex, foundBlock);
  this.courseBlockOneToManyJoinEditHelper_0.liveList.sendValue_11rb$(newList);
  this.view.courseBlocks = this.courseBlockOneToManyJoinEditHelper_0.liveList;
};
  ClazzEdit2Presenter.prototype.onClickHide_11rb$ = function(joinedEntity) {
  var tmp$, tmp$_0, tmp$_1;
  tmp$_0 = (tmp$ = this.courseBlockOneToManyJoinEditHelper_0.liveList.getValue()) != null ? toMutableList(tmp$) : null;
  if (tmp$_0 == null) {
    return;
  }
  var newList = tmp$_0;
  var firstOrNull$result;
  firstOrNull$break:
    do {
      var tmp$_2;
      tmp$_2 = newList.iterator();
      while (tmp$_2.hasNext()) {
        var element = tmp$_2.next();
        if (equals(element.cbUid, joinedEntity.cbUid)) {
          firstOrNull$result = element;
          break firstOrNull$break;
        }
      }
      firstOrNull$result = null;
    } while (false);
  tmp$_1 = firstOrNull$result;
  if (tmp$_1 == null) {
    return;
  }
  var foundBlock = tmp$_1;
  foundBlock.cbHidden = !foundBlock.cbHidden;
  newList.set_wxm5ur$(foundBlock.cbIndex, foundBlock);
  if (foundBlock.cbType === 100) {
    var tmp$_3;
    tmp$_3 = newList.iterator();
    while (tmp$_3.hasNext()) {
      var element_0 = tmp$_3.next();
      var tmp$_4;
            (tmp$_4 = equals(element_0.cbModuleParentBlockUid, foundBlock.cbUid) ? element_0 : null) != null ? (tmp$_4.cbHidden = foundBlock.cbHidden) : null;
    }
  }
  this.courseBlockOneToManyJoinEditHelper_0.liveList.sendValue_11rb$(newList);
};
  ClazzEdit2Presenter.prototype.onItemMove_vux9f0$ = function(fromPosition, toPosition) {
  var tmp$, tmp$_0;
  var currentList = (tmp$_0 = (tmp$ = this.courseBlockOneToManyJoinEditHelper_0.liveList.getValue()) != null ? toMutableList(tmp$) : null) != null ? tmp$_0 : ArrayList_init();
  var movingBlock = currentList.get_za3lpa$(fromPosition);
  var destinationBlock = currentList.get_za3lpa$(toPosition);
  var nextBlock = getOrNull(currentList, toPosition + 1 | 0);
  var isChildBlock = !equals(destinationBlock.cbModuleParentBlockUid, L0);
  var blockMovingDown = fromPosition < toPosition;
  var lastBlockInModule = !equals(destinationBlock.cbModuleParentBlockUid, nextBlock != null ? nextBlock.cbModuleParentBlockUid : null);
  if (movingBlock.cbType === 100 && isChildBlock && !lastBlockInModule) {
    this.courseBlockOneToManyJoinEditHelper_0.liveList.sendValue_11rb$(toList(currentList));
    return false;
  }
  currentList.removeAt_za3lpa$(fromPosition);
  if (movingBlock.cbType === 100) {
    var destination = ArrayList_init();
    var tmp$_1;
    tmp$_1 = currentList.iterator();
    while (tmp$_1.hasNext()) {
      var element = tmp$_1.next();
      if (equals(element.cbModuleParentBlockUid, destinationBlock.cbUid)) 
        destination.add_11rb$(element);
    }
    var destinationBlockChildren = destination;
    if (equals(destinationBlock.cbModuleParentBlockUid, L0)) {
      if (blockMovingDown) {
        addSafelyToPosition(currentList, toPosition + destinationBlockChildren.size | 0, movingBlock);
      } else {
        currentList.add_wxm5ur$(toPosition, movingBlock);
      }
    } else {
      addSafelyToPosition(currentList, toPosition + 1 | 0, movingBlock);
    }
    var destination_0 = ArrayList_init();
    var tmp$_2;
    tmp$_2 = currentList.iterator();
    while (tmp$_2.hasNext()) {
      var element_0 = tmp$_2.next();
      if (equals(element_0.cbModuleParentBlockUid, movingBlock.cbUid)) 
        destination_0.add_11rb$(element_0);
    }
    var childBlocks = destination_0;
    currentList.removeAll_brywnq$(childBlocks);
    var index = currentList.indexOf_11rb$(movingBlock) + 1 | 0;
    currentList.addAll_u57x28$(index, childBlocks);
  } else {
    currentList.add_wxm5ur$(toPosition, movingBlock);
    var previousBlock = getOrNull(currentList, toPosition - 1 | 0);
    if (previousBlock == null) {
      movingBlock.cbModuleParentBlockUid = L0;
      movingBlock.cbIndentLevel = 0;
    } else if (previousBlock.cbType === 100) {
      movingBlock.cbModuleParentBlockUid = previousBlock.cbUid;
      movingBlock.cbIndentLevel = 1;
    } else {
      movingBlock.cbModuleParentBlockUid = previousBlock.cbModuleParentBlockUid;
      movingBlock.cbIndentLevel = previousBlock.cbIndentLevel;
    }
    currentList.set_wxm5ur$(toPosition, movingBlock);
  }
  var tmp$_3, tmp$_0_0;
  var index_0 = 0;
  tmp$_3 = currentList.iterator();
  while (tmp$_3.hasNext()) {
    var item = tmp$_3.next();
    item.cbIndex = checkIndexOverflow((tmp$_0_0 = index_0 , index_0 = tmp$_0_0 + 1 | 0 , tmp$_0_0));
  }
  this.courseBlockOneToManyJoinEditHelper_0.liveList.sendValue_11rb$(toList(currentList));
  return true;
};
  ClazzEdit2Presenter.prototype.onItemDismiss_za3lpa$ = function(position) {
};
  function ClazzEdit2Presenter$Companion() {
    ClazzEdit2Presenter$Companion_instance = this;
    this.ARG_SAVEDSTATE_SCHEDULES = 'schedules';
    this.ARG_SAVEDSTATE_BLOCK = 'courseBlocks';
    this.ARG_SAVEDSTATE_MODULE = 'courseModule';
    this.ARG_SAVEDSTATE_TEXT = 'courseText';
    this.SAVEDSTATE_KEY_SCHOOL = 'School';
    this.SAVEDSTATE_KEY_ASSIGNMENT = 'Assignment';
    this.SAVEDSTATE_KEY_CONTENT = 'courseContent';
    this.SAVEDSTATE_KEY_HOLIDAYCALENDAR = 'ClazzHolidayCalendar';
    this.SAVEDSTATE_KEY_FEATURES = 'ClazzFeatures';
    this.SAVEDSTATE_KEY_TERMINOLOGY = 'ClazzTerminology';
    this.SAVEDSTATE_KEY_DISCUSSION = 'CourseDiscussion';
    this.SAVEDSTATE_KEY_COURSEPICTURE = 'CoursePicture';
  }
  ClazzEdit2Presenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzEdit2Presenter$Companion_instance = null;
  function ClazzEdit2Presenter$Companion_getInstance() {
    if (ClazzEdit2Presenter$Companion_instance === null) {
      new ClazzEdit2Presenter$Companion();
    }
    return ClazzEdit2Presenter$Companion_instance;
  }
  function ClazzEdit2Presenter$scheduleOneToManyJoinEditHelper$lambda($receiver, it) {
    $receiver.scheduleUid = it;
    return Unit;
  }
  function ClazzEdit2Presenter$courseBlockOneToManyJoinEditHelper$lambda($receiver, it) {
    $receiver.cbUid = it;
    return Unit;
  }
  ClazzEdit2Presenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzEdit2Presenter', 
  interfaces: [ItemTouchHelperListener, TreeOneToManyJoinEditListener, UstadEditPresenter]};
  function ClazzEnrolmentConstants() {
    ClazzEnrolmentConstants_instance = this;
    this.ROLE_MESSAGE_ID_OPTIONS = mapOf([to(1000, 2568), to(1001, 2400)]);
  }
  ClazzEnrolmentConstants.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'ClazzEnrolmentConstants', 
  interfaces: []};
  var ClazzEnrolmentConstants_instance = null;
  function ClazzEnrolmentConstants_getInstance() {
    if (ClazzEnrolmentConstants_instance === null) {
      new ClazzEnrolmentConstants();
    }
    return ClazzEnrolmentConstants_instance;
  }
  function ClazzEnrolmentEditPresenter(context, arguments_0, view, lifecycleOwner, di) {
    ClazzEnrolmentEditPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.selectedPerson = L0;
    this.selectedClazz = L0;
    this.selectedRole = 0;
    this.hasAddStudentPermission = false;
    this.hasAddTeacherPermission = false;
    this.loggedInPersonUid = this.accountManager.activeAccount.personUid;
  }
  Object.defineProperty(ClazzEnrolmentEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  function ClazzEnrolmentEditPresenter$RoleOptions(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ClazzEnrolmentEditPresenter$RoleOptions_initFields() {
    ClazzEnrolmentEditPresenter$RoleOptions_initFields = function() {
};
    ClazzEnrolmentEditPresenter$RoleOptions$STUDENT_instance = new ClazzEnrolmentEditPresenter$RoleOptions('STUDENT', 0, 1000, 2568);
    ClazzEnrolmentEditPresenter$RoleOptions$TEACHER_instance = new ClazzEnrolmentEditPresenter$RoleOptions('TEACHER', 1, 1001, 2400);
  }
  var ClazzEnrolmentEditPresenter$RoleOptions$STUDENT_instance;
  function ClazzEnrolmentEditPresenter$RoleOptions$STUDENT_getInstance() {
    ClazzEnrolmentEditPresenter$RoleOptions_initFields();
    return ClazzEnrolmentEditPresenter$RoleOptions$STUDENT_instance;
  }
  var ClazzEnrolmentEditPresenter$RoleOptions$TEACHER_instance;
  function ClazzEnrolmentEditPresenter$RoleOptions$TEACHER_getInstance() {
    ClazzEnrolmentEditPresenter$RoleOptions_initFields();
    return ClazzEnrolmentEditPresenter$RoleOptions$TEACHER_instance;
  }
  ClazzEnrolmentEditPresenter$RoleOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'RoleOptions', 
  interfaces: [Enum]};
  function ClazzEnrolmentEditPresenter$RoleOptions$values() {
    return [ClazzEnrolmentEditPresenter$RoleOptions$STUDENT_getInstance(), ClazzEnrolmentEditPresenter$RoleOptions$TEACHER_getInstance()];
  }
  ClazzEnrolmentEditPresenter$RoleOptions.values = ClazzEnrolmentEditPresenter$RoleOptions$values;
  function ClazzEnrolmentEditPresenter$RoleOptions$valueOf(name) {
    switch (name) {
      case 'STUDENT':
        return ClazzEnrolmentEditPresenter$RoleOptions$STUDENT_getInstance();
      case 'TEACHER':
        return ClazzEnrolmentEditPresenter$RoleOptions$TEACHER_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ClazzEnrolmentEditPresenter.RoleOptions.' + name);
    }
  }
  ClazzEnrolmentEditPresenter$RoleOptions.valueOf_61zpoe$ = ClazzEnrolmentEditPresenter$RoleOptions$valueOf;
  function ClazzEnrolmentEditPresenter$RoleMessageIdOption(day, context, di) {
    MessageIdOption.call(this, day.messageId, context, day.optionVal, di);
  }
  ClazzEnrolmentEditPresenter$RoleMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'RoleMessageIdOption', 
  interfaces: [MessageIdOption]};
  function ClazzEnrolmentEditPresenter$OutcomeOptions(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ClazzEnrolmentEditPresenter$OutcomeOptions_initFields() {
    ClazzEnrolmentEditPresenter$OutcomeOptions_initFields = function() {
};
    ClazzEnrolmentEditPresenter$OutcomeOptions$INPROGRESS_instance = new ClazzEnrolmentEditPresenter$OutcomeOptions('INPROGRESS', 0, 200, 2388);
    ClazzEnrolmentEditPresenter$OutcomeOptions$GRADUATED_instance = new ClazzEnrolmentEditPresenter$OutcomeOptions('GRADUATED', 1, 201, 2373);
    ClazzEnrolmentEditPresenter$OutcomeOptions$FAILED_instance = new ClazzEnrolmentEditPresenter$OutcomeOptions('FAILED', 2, 202, 2089);
    ClazzEnrolmentEditPresenter$OutcomeOptions$DROPPED_OUT_instance = new ClazzEnrolmentEditPresenter$OutcomeOptions('DROPPED_OUT', 3, 203, 2374);
  }
  var ClazzEnrolmentEditPresenter$OutcomeOptions$INPROGRESS_instance;
  function ClazzEnrolmentEditPresenter$OutcomeOptions$INPROGRESS_getInstance() {
    ClazzEnrolmentEditPresenter$OutcomeOptions_initFields();
    return ClazzEnrolmentEditPresenter$OutcomeOptions$INPROGRESS_instance;
  }
  var ClazzEnrolmentEditPresenter$OutcomeOptions$GRADUATED_instance;
  function ClazzEnrolmentEditPresenter$OutcomeOptions$GRADUATED_getInstance() {
    ClazzEnrolmentEditPresenter$OutcomeOptions_initFields();
    return ClazzEnrolmentEditPresenter$OutcomeOptions$GRADUATED_instance;
  }
  var ClazzEnrolmentEditPresenter$OutcomeOptions$FAILED_instance;
  function ClazzEnrolmentEditPresenter$OutcomeOptions$FAILED_getInstance() {
    ClazzEnrolmentEditPresenter$OutcomeOptions_initFields();
    return ClazzEnrolmentEditPresenter$OutcomeOptions$FAILED_instance;
  }
  var ClazzEnrolmentEditPresenter$OutcomeOptions$DROPPED_OUT_instance;
  function ClazzEnrolmentEditPresenter$OutcomeOptions$DROPPED_OUT_getInstance() {
    ClazzEnrolmentEditPresenter$OutcomeOptions_initFields();
    return ClazzEnrolmentEditPresenter$OutcomeOptions$DROPPED_OUT_instance;
  }
  ClazzEnrolmentEditPresenter$OutcomeOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'OutcomeOptions', 
  interfaces: [Enum]};
  function ClazzEnrolmentEditPresenter$OutcomeOptions$values() {
    return [ClazzEnrolmentEditPresenter$OutcomeOptions$INPROGRESS_getInstance(), ClazzEnrolmentEditPresenter$OutcomeOptions$GRADUATED_getInstance(), ClazzEnrolmentEditPresenter$OutcomeOptions$FAILED_getInstance(), ClazzEnrolmentEditPresenter$OutcomeOptions$DROPPED_OUT_getInstance()];
  }
  ClazzEnrolmentEditPresenter$OutcomeOptions.values = ClazzEnrolmentEditPresenter$OutcomeOptions$values;
  function ClazzEnrolmentEditPresenter$OutcomeOptions$valueOf(name) {
    switch (name) {
      case 'INPROGRESS':
        return ClazzEnrolmentEditPresenter$OutcomeOptions$INPROGRESS_getInstance();
      case 'GRADUATED':
        return ClazzEnrolmentEditPresenter$OutcomeOptions$GRADUATED_getInstance();
      case 'FAILED':
        return ClazzEnrolmentEditPresenter$OutcomeOptions$FAILED_getInstance();
      case 'DROPPED_OUT':
        return ClazzEnrolmentEditPresenter$OutcomeOptions$DROPPED_OUT_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ClazzEnrolmentEditPresenter.OutcomeOptions.' + name);
    }
  }
  ClazzEnrolmentEditPresenter$OutcomeOptions.valueOf_61zpoe$ = ClazzEnrolmentEditPresenter$OutcomeOptions$valueOf;
  function ClazzEnrolmentEditPresenter$OutcomeMessageIdOption(day, context, di) {
    MessageIdOption.call(this, day.messageId, context, day.optionVal, di);
  }
  ClazzEnrolmentEditPresenter$OutcomeMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'OutcomeMessageIdOption', 
  interfaces: [MessageIdOption]};
  ClazzEnrolmentEditPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4;
  this.selectedPerson = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_PERSON_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  this.selectedClazz = (tmp$_2 = (tmp$_1 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0;
  this.selectedRole = (tmp$_4 = (tmp$_3 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_FILTER_BY_ENROLMENT_ROLE)) != null ? toInt(tmp$_3) : null) != null ? tmp$_4 : 0;
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
  var tmp$_5 = this.view;
  var $receiver = ClazzEnrolmentEditPresenter$OutcomeOptions$values();
  var destination = ArrayList_init_0($receiver.length);
  var tmp$_6;
  for (tmp$_6 = 0; tmp$_6 !== $receiver.length; ++tmp$_6) {
    var item = $receiver[tmp$_6];
    destination.add_11rb$(new ClazzEnrolmentEditPresenter$OutcomeMessageIdOption(item, this.context, this.di));
  }
  tmp$_5.statusList = destination;
};
  function Coroutine$ClazzEnrolmentEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$it = it_0;
  }
  Coroutine$ClazzEnrolmentEditPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzEnrolmentEditPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzEnrolmentEditPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$ClazzEnrolmentEditPresenter$onLoadEntityFromDb$lambda;
  Coroutine$ClazzEnrolmentEditPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if ((tmp$_0 = (tmp$ = !equals(this.local$closure$entityUid, L0) ? this.local$it : null) != null ? tmp$.clazzEnrolmentDao : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_0.findEnrolmentWithLeavingReason_s8cxhz$(this.local$closure$entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 ClazzEnrolmentEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzEnrolmentEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_4($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$entityUid = void 0;
    this.local$clazzWithSchoolVal = void 0;
    this.local$clazzEnrolment = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_4.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_4.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_4.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_4;
  Coroutine$onLoadEntityFromDb_7hogkd$_4.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        this.local$entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = this.$this.repo.clazzDao.getClazzWithSchool_s8cxhz$(this.$this.selectedClazz, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$clazzWithSchoolVal = this.result_0;
        this.state_0 = 3;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, ClazzEnrolmentEditPresenter$onLoadEntityFromDb$lambda(this.local$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var tmp$_2;
        if ((tmp$_1 = this.result_0) != null) 
          tmp$_2 = tmp$_1;
        else {
          var $receiver = new ClazzEnrolmentWithLeavingReason();
          var clazzTimeZone = effectiveTimeZone(this.local$clazzWithSchoolVal);
          var $receiver_0 = toOffsetByTimezone(DateTime.Companion.now(), clazzTimeZone);
          var $receiver_1 = $receiver_0.hours;
          var tmp$_3 = TimeSpan.Companion.fromHours_14dthe$($receiver_1);
          var $receiver_2 = $receiver_0.minutes;
          var tmp$_4 = tmp$_3.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_2));
          var $receiver_3 = $receiver_0.seconds;
          var tmp$_5 = tmp$_4.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_3));
          var $receiver_4 = $receiver_0.milliseconds;
          var joinTime = $receiver_0.minus_fv8bff$(tmp$_5.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_4))).utc.unixMillisLong;
          $receiver.clazzEnrolmentDateJoined = joinTime;
          $receiver.clazzEnrolmentPersonUid = this.$this.selectedPerson;
          $receiver.clazzEnrolmentClazzUid = this.$this.selectedClazz;
          $receiver.clazzEnrolmentRole = this.$this.selectedRole;
          tmp$_2 = $receiver;
        }
        this.local$clazzEnrolment = tmp$_2;
        this.state_0 = 4;
        this.result_0 = this.$this.setupRoleListOptions_0(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        return this.local$clazzEnrolment;
      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);
};
  ClazzEnrolmentEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_4(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function ClazzEnrolmentEditPresenter$onLoadDataComplete$lambda(this$ClazzEnrolmentEditPresenter) {
    return function(it) {
  var tmp$, tmp$_0, tmp$_1;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var reason = tmp$;
    (tmp$_0 = this$ClazzEnrolmentEditPresenter.entity) != null ? (tmp$_0.leavingReason = reason) : null;
    (tmp$_1 = this$ClazzEnrolmentEditPresenter.entity) != null ? (tmp$_1.clazzEnrolmentLeavingReasonUid = reason.leavingReasonUid) : null;
  this$ClazzEnrolmentEditPresenter.view.entity = this$ClazzEnrolmentEditPresenter.entity;
  this$ClazzEnrolmentEditPresenter.requireSavedStateHandle().set_umlfku$(ClazzEnrolmentEditPresenter$Companion_getInstance().SAVEDSTATE_KEY_LEAVING_REASON, null);
  return Unit;
};
  }
  ClazzEnrolmentEditPresenter.prototype.onLoadDataComplete = function() {
  UstadEditPresenter.prototype.onLoadDataComplete.call(this);
  this.observeSavedStateResult_27fjeh$(ClazzEnrolmentEditPresenter$Companion_getInstance().SAVEDSTATE_KEY_LEAVING_REASON, ListSerializer(LeavingReason.Companion.serializer()), getKClass(LeavingReason), new DoorObserver(ClazzEnrolmentEditPresenter$onLoadDataComplete$lambda(this)));
};
  function Coroutine$setupRoleListOptions_0($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
  }
  Coroutine$setupRoleListOptions_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$setupRoleListOptions_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$setupRoleListOptions_0.prototype.constructor = Coroutine$setupRoleListOptions_0;
  Coroutine$setupRoleListOptions_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.$this.repo.clazzDao.personHasPermissionWithClazz_b9bd0d$(this.$this.loggedInPersonUid, this.$this.selectedClazz, Role$Companion$PERMISSION_CLAZZ_ADD_STUDENT, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.$this.hasAddStudentPermission = this.result_0;
        this.state_0 = 3;
        this.result_0 = this.$this.repo.clazzDao.personHasPermissionWithClazz_b9bd0d$(this.$this.loggedInPersonUid, this.$this.selectedClazz, Role$Companion$PERMISSION_CLAZZ_ADD_TEACHER, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.$this.hasAddTeacherPermission = this.result_0;
        var roleList = ArrayList_init();
        if (this.$this.hasAddStudentPermission) {
          roleList.add_11rb$(new ClazzEnrolmentEditPresenter$RoleMessageIdOption(ClazzEnrolmentEditPresenter$RoleOptions$STUDENT_getInstance(), this.$this.context, this.$this.di));
        }
        if (this.$this.hasAddTeacherPermission) {
          roleList.add_11rb$(new ClazzEnrolmentEditPresenter$RoleMessageIdOption(ClazzEnrolmentEditPresenter$RoleOptions$TEACHER_getInstance(), this.$this.context, this.$this.di));
        }
        this.$this.view.roleList = toList(roleList);
        return;
      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);
};
  ClazzEnrolmentEditPresenter.prototype.setupRoleListOptions_0 = function(continuation_0, suspended) {
  var instance = new Coroutine$setupRoleListOptions_0(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$ClazzEnrolmentEditPresenter$onLoadFromJson$lambda(this$ClazzEnrolmentEditPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzEnrolmentEditPresenter = this$ClazzEnrolmentEditPresenter_0;
  }
  Coroutine$ClazzEnrolmentEditPresenter$onLoadFromJson$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzEnrolmentEditPresenter$onLoadFromJson$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzEnrolmentEditPresenter$onLoadFromJson$lambda.prototype.constructor = Coroutine$ClazzEnrolmentEditPresenter$onLoadFromJson$lambda;
  Coroutine$ClazzEnrolmentEditPresenter$onLoadFromJson$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzEnrolmentEditPresenter.setupRoleListOptions_0(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ClazzEnrolmentEditPresenter$onLoadFromJson$lambda(this$ClazzEnrolmentEditPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzEnrolmentEditPresenter$onLoadFromJson$lambda(this$ClazzEnrolmentEditPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzEnrolmentEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  var editEntity;
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = ClazzEnrolmentWithLeavingReason.Companion.serializer();
    var tmp$;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
    editEntity = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    var $receiver = new ClazzEnrolmentWithLeavingReason();
    $receiver.clazzEnrolmentPersonUid = this.selectedPerson;
    $receiver.clazzEnrolmentClazzUid = this.selectedClazz;
    $receiver.clazzEnrolmentRole = this.selectedRole;
    editEntity = $receiver;
  }
  launch(this.presenterScope, void 0, void 0, ClazzEnrolmentEditPresenter$onLoadFromJson$lambda(this));
  return editEntity;
};
  ClazzEnrolmentEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  function Coroutine$ClazzEnrolmentEditPresenter$handleClickSave$lambda(closure$entity_0, this$ClazzEnrolmentEditPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$ClazzEnrolmentEditPresenter = this$ClazzEnrolmentEditPresenter_0;
  }
  Coroutine$ClazzEnrolmentEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzEnrolmentEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzEnrolmentEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$ClazzEnrolmentEditPresenter$handleClickSave$lambda;
  Coroutine$ClazzEnrolmentEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        if (this.local$closure$entity.clazzEnrolmentRole === 0) {
          this.local$this$ClazzEnrolmentEditPresenter.view.roleSelectionError = this.local$this$ClazzEnrolmentEditPresenter.systemImpl.getString(2127, this.local$this$ClazzEnrolmentEditPresenter.context);
          return;
        } else {
          this.state_0 = 2;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        if (equals(this.local$closure$entity.clazzEnrolmentDateJoined, L0)) {
          this.local$this$ClazzEnrolmentEditPresenter.view.startDateErrorWithDate = new Pair(this.local$this$ClazzEnrolmentEditPresenter.systemImpl.getString(2127, this.local$this$ClazzEnrolmentEditPresenter.context), L0);
          return;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 3:
        if (this.local$closure$entity.clazzEnrolmentDateLeft.compareTo_11rb$(this.local$closure$entity.clazzEnrolmentDateJoined) <= 0) {
          this.local$this$ClazzEnrolmentEditPresenter.view.endDateError = this.local$this$ClazzEnrolmentEditPresenter.systemImpl.getString(2679, this.local$this$ClazzEnrolmentEditPresenter.context);
          return;
        } else {
          this.state_0 = 4;
          continue;
        }
      case 4:
        this.state_0 = 5;
        this.result_0 = this.local$this$ClazzEnrolmentEditPresenter.repo.clazzDao.findByUidAsync_s8cxhz$(this.local$this$ClazzEnrolmentEditPresenter.selectedClazz, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        var clazzData = this.result_0;
        if (((tmp$ = clazzData != null ? clazzData.clazzStartTime : null) != null ? tmp$ : L0).compareTo_11rb$(this.local$closure$entity.clazzEnrolmentDateJoined) > 0) {
          this.local$this$ClazzEnrolmentEditPresenter.view.startDateErrorWithDate = new Pair(this.local$this$ClazzEnrolmentEditPresenter.systemImpl.getString(2392, this.local$this$ClazzEnrolmentEditPresenter.context), L0);
          return;
        } else {
          this.state_0 = 6;
          continue;
        }
      case 6:
        this.state_0 = 7;
        this.result_0 = this.local$this$ClazzEnrolmentEditPresenter.repo.clazzEnrolmentDao.findMaxEndDateForEnrolment_b9bd0d$(this.local$this$ClazzEnrolmentEditPresenter.selectedClazz, this.local$this$ClazzEnrolmentEditPresenter.selectedPerson, this.local$closure$entity.clazzEnrolmentUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 7:
        var maxDate = this.result_0;
        if (!equals(maxDate, L0) && !equals(maxDate, Long$Companion$MAX_VALUE) && this.local$closure$entity.clazzEnrolmentDateJoined.compareTo_11rb$(maxDate) < 0) {
          this.local$this$ClazzEnrolmentEditPresenter.view.startDateErrorWithDate = new Pair(this.local$this$ClazzEnrolmentEditPresenter.systemImpl.getString(2393, this.local$this$ClazzEnrolmentEditPresenter.context), maxDate);
          return;
        } else {
          this.state_0 = 8;
          continue;
        }
      case 8:
        this.local$this$ClazzEnrolmentEditPresenter.view.startDateErrorWithDate = null;
        this.local$this$ClazzEnrolmentEditPresenter.view.endDateError = null;
        if (equals(this.local$closure$entity.clazzEnrolmentUid, L0)) {
          this.state_0 = 10;
          this.result_0 = processEnrolmentIntoClass(this.local$this$ClazzEnrolmentEditPresenter.repo, this.local$closure$entity, void 0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 9;
          this.result_0 = this.local$this$ClazzEnrolmentEditPresenter.repo.clazzEnrolmentDao.updateAsync_95p8s2$(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 9:
        this.state_0 = 11;
        continue;
      case 10:
        this.state_0 = 11;
        continue;
      case 11:
        var tmp$_0 = this.local$this$ClazzEnrolmentEditPresenter;
        var di = this.local$this$ClazzEnrolmentEditPresenter.di;
        var strategy = ListSerializer(ClazzEnrolmentWithLeavingReason.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_1;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_1 : throwCCE(), null);
        return tmp$_0.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity)) , Unit;
      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 ClazzEnrolmentEditPresenter$handleClickSave$lambda(closure$entity_0, this$ClazzEnrolmentEditPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzEnrolmentEditPresenter$handleClickSave$lambda(closure$entity_0, this$ClazzEnrolmentEditPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzEnrolmentEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  launch(this.presenterScope, void 0, void 0, ClazzEnrolmentEditPresenter$handleClickSave$lambda(entity, this));
};
  ClazzEnrolmentEditPresenter.prototype.handleReasonLeavingClicked = function() {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, LeavingReasonListView$Companion_getInstance().VIEW_NAME, getKClass(LeavingReason), LeavingReason.Companion.serializer()));
};
  function ClazzEnrolmentEditPresenter$Companion() {
    ClazzEnrolmentEditPresenter$Companion_instance = this;
    this.SAVEDSTATE_KEY_LEAVING_REASON = 'LeavingReason';
  }
  ClazzEnrolmentEditPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzEnrolmentEditPresenter$Companion_instance = null;
  function ClazzEnrolmentEditPresenter$Companion_getInstance() {
    if (ClazzEnrolmentEditPresenter$Companion_instance === null) {
      new ClazzEnrolmentEditPresenter$Companion();
    }
    return ClazzEnrolmentEditPresenter$Companion_instance;
  }
  ClazzEnrolmentEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzEnrolmentEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function ClazzEnrolmentListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.selectedPerson = L0;
    this.selectedClazz = L0;
    this.loggedInPersonUid = this.accountManager.activeAccount.personUid;
  }
  ClazzEnrolmentListPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.selectedPerson = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_PERSON_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  this.selectedClazz = (tmp$_2 = (tmp$_1 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0;
  this.updateListOnView_0();
};
  function Coroutine$onCheckAddPermission_tn71rk$($this, account_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$studentPermission = void 0;
    this.local$hasPermission = void 0;
  }
  Coroutine$onCheckAddPermission_tn71rk$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onCheckAddPermission_tn71rk$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onCheckAddPermission_tn71rk$.prototype.constructor = Coroutine$onCheckAddPermission_tn71rk$;
  Coroutine$onCheckAddPermission_tn71rk$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.state_0 = 2;
        this.result_0 = this.$this.db.clazzDao.personHasPermissionWithClazz_b9bd0d$(this.$this.loggedInPersonUid, this.$this.selectedClazz, Role$Companion$PERMISSION_CLAZZ_ADD_STUDENT, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$studentPermission = this.result_0;
        this.state_0 = 3;
        this.result_0 = this.$this.db.clazzDao.personHasPermissionWithClazz_b9bd0d$(this.$this.loggedInPersonUid, this.$this.selectedClazz, Role$Companion$PERMISSION_CLAZZ_ADD_TEACHER, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var teacherPermission = this.result_0;
        this.$this.view.isStudentEnrolmentEditVisible = this.local$studentPermission;
        this.$this.view.isTeacherEnrolmentEditVisible = teacherPermission;
        this.local$hasPermission = this.local$studentPermission || teacherPermission;
        this.state_0 = 4;
        this.result_0 = this.$this.db.clazzEnrolmentDao.findMaxEndDateForEnrolment_b9bd0d$(this.$this.selectedClazz, this.$this.selectedPerson, L0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        var maxDateOfEnrolment = this.result_0;
        if (equals(maxDateOfEnrolment, Long$Companion$MAX_VALUE)) {
          tmp$ = false;
        } else {
          tmp$ = this.local$hasPermission;
        }
        return tmp$;
      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);
};
  ClazzEnrolmentListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account_0, continuation_0, suspended) {
  var instance = new Coroutine$onCheckAddPermission_tn71rk$(this, account_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$ClazzEnrolmentListPresenter$updateListOnView$lambda(this$ClazzEnrolmentListPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzEnrolmentListPresenter = this$ClazzEnrolmentListPresenter_0;
    this.local$tmp$ = void 0;
    this.local$tmp$_0 = void 0;
  }
  Coroutine$ClazzEnrolmentListPresenter$updateListOnView$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzEnrolmentListPresenter$updateListOnView$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzEnrolmentListPresenter$updateListOnView$lambda.prototype.constructor = Coroutine$ClazzEnrolmentListPresenter$updateListOnView$lambda;
  Coroutine$ClazzEnrolmentListPresenter$updateListOnView$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$tmp$ = this.local$this$ClazzEnrolmentListPresenter.view;
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzEnrolmentListPresenter.repo.personDao.findByUidAsync_s8cxhz$(this.local$this$ClazzEnrolmentListPresenter.selectedPerson, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$tmp$.person = this.result_0;
        this.local$tmp$_0 = this.local$this$ClazzEnrolmentListPresenter.view;
        this.state_0 = 3;
        this.result_0 = this.local$this$ClazzEnrolmentListPresenter.repo.clazzDao.findByUidAsync_s8cxhz$(this.local$this$ClazzEnrolmentListPresenter.selectedClazz, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$tmp$_0.clazz = this.result_0;
        return this.local$this$ClazzEnrolmentListPresenter.view.enrolmentList = this.local$this$ClazzEnrolmentListPresenter.repo.clazzEnrolmentDao.findAllEnrolmentsByPersonAndClazzUid_3pjtqy$(this.local$this$ClazzEnrolmentListPresenter.selectedPerson, this.local$this$ClazzEnrolmentListPresenter.selectedClazz) , Unit;
      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 ClazzEnrolmentListPresenter$updateListOnView$lambda(this$ClazzEnrolmentListPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzEnrolmentListPresenter$updateListOnView$lambda(this$ClazzEnrolmentListPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzEnrolmentListPresenter.prototype.updateListOnView_0 = function() {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ClazzEnrolmentListPresenter$updateListOnView$lambda(this));
};
  ClazzEnrolmentListPresenter.prototype.handleClickCreateNewFab = function() {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ClazzEnrolmentEditView$Companion_getInstance().VIEW_NAME, getKClass(ClazzEnrolmentWithLeavingReason), ClazzEnrolmentWithLeavingReason.Companion.serializer(), void 0, void 0, toMutableMap(plus_2(this.arguments, to(UstadView$Companion_getInstance().ARG_SAVE_TO_DB, true.toString())))));
};
  ClazzEnrolmentListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
  this.handleClickCreateNewFab();
};
  ClazzEnrolmentListPresenter.prototype.handleClickClazzEnrolment_oewacg$ = function(enrolment) {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, enrolment, ClazzEnrolmentEditView$Companion_getInstance().VIEW_NAME, getKClass(ClazzEnrolmentWithLeavingReason), ClazzEnrolmentWithLeavingReason.Companion.serializer(), void 0, void 0, toMutableMap(plus(mapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, enrolment.clazzEnrolmentUid.toString()), to(UstadView$Companion_getInstance().ARG_SAVE_TO_DB, true.toString())]), this.arguments))));
};
  ClazzEnrolmentListPresenter.prototype.handleClickProfile_s8cxhz$ = function(personUid) {
  this.systemImpl.go_gofqk3$(PersonDetailView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, personUid.toString())), this.context);
};
  ClazzEnrolmentListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzEnrolmentListPresenter', 
  interfaces: [UstadListPresenter]};
  function ClazzListItemListener() {
  }
  ClazzListItemListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzListItemListener', 
  interfaces: []};
  function ClazzListPresenter(context, arguments_0, view, di, lifecycleOwner, clazzList2ItemListener) {
    ClazzListPresenter$Companion_getInstance();
    if (clazzList2ItemListener === void 0) 
      clazzList2ItemListener = new DefaultClazzListItemListener(view, ListViewMode$BROWSER_getInstance(), context, arguments_0, di);
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.clazzList2ItemListener_0 = clazzList2ItemListener;
    this.loggedInPersonUid = L0;
    this.filterExcludeMembersOfSchool_0 = L0;
    this.filterAlreadySelectedList_0 = emptyList();
    this.filterByPermission_0 = L0;
    this.searchText_0 = null;
  }
  Object.defineProperty(ClazzListPresenter.prototype, 'sortOptions', {
  configurable: true, 
  get: function() {
  return ClazzListPresenter$Companion_getInstance().SORT_OPTIONS;
}});
  ClazzListPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6;
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.clazzList2ItemListener_0.presenter = this;
  this.filterExcludeMembersOfSchool_0 = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(PersonListView$Companion_getInstance().ARG_FILTER_EXCLUDE_MEMBERSOFSCHOOL)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  var tmp$_7;
  if ((tmp$_2 = (tmp$_1 = this.arguments.get_11rb$(ClazzList2View$Companion_getInstance().ARG_FILTER_EXCLUDE_SELECTED_CLASS_LIST)) != null ? split(tmp$_1, [',']) : null) != null) {
    var destination = ArrayList_init();
    var tmp$_8;
    tmp$_8 = tmp$_2.iterator();
    while (tmp$_8.hasNext()) {
      var element = tmp$_8.next();
      if (element.length > 0) 
        destination.add_11rb$(element);
    }
    tmp$_7 = destination;
  } else 
    tmp$_7 = null;
  var tmp$_9;
  if ((tmp$_3 = tmp$_7) != null) {
    var destination_0 = ArrayList_init_0(collectionSizeOrDefault(tmp$_3, 10));
    var tmp$_10;
    tmp$_10 = tmp$_3.iterator();
    while (tmp$_10.hasNext()) {
      var item = tmp$_10.next();
      var tmp$_11;
      destination_0.add_11rb$(toLong(trim(Kotlin.isCharSequence(tmp$_11 = item) ? tmp$_11 : throwCCE()).toString()));
    }
    tmp$_9 = destination_0;
  } else 
    tmp$_9 = null;
  this.filterAlreadySelectedList_0 = (tmp$_4 = tmp$_9) != null ? tmp$_4 : emptyList();
  this.clazzList2ItemListener_0.listViewMode = this.mListMode;
  this.filterByPermission_0 = (tmp$_6 = (tmp$_5 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_FILTER_BY_PERMISSION)) != null ? toLong(tmp$_5) : null) != null ? tmp$_6 : Role$Companion$PERMISSION_CLAZZ_SELECT;
  this.loggedInPersonUid = this.accountManager.activeAccount.personUid;
  this.selectedSortOption = ClazzListPresenter$Companion_getInstance().SORT_OPTIONS.get_za3lpa$(0);
  this.view.listFilterOptionChips = toListFilterOptions(ClazzListPresenter$Companion_getInstance().FILTER_OPTIONS, this.context, this.di);
  this.updateList_0();
};
  ClazzListPresenter.prototype.updateList_0 = function() {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  this.view.list = this.repo.clazzDao.findClazzesWithPermission_dchjmd$(toQueryLikeParam(this.searchText_0), this.loggedInPersonUid, this.filterAlreadySelectedList_0, this.filterExcludeMembersOfSchool_0, (tmp$_0 = (tmp$ = this.selectedSortOption) != null ? tmp$.flag : null) != null ? tmp$_0 : 0, (tmp$_2 = (tmp$_1 = this.view.checkedFilterOptionChip) != null ? tmp$_1.optionId : null) != null ? tmp$_2 : 5, systemTimeInMillis(), this.filterByPermission_0, L0);
};
  function Coroutine$onCheckAddPermission_tn71rk$_0($this, account_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$ = void 0;
  }
  Coroutine$onCheckAddPermission_tn71rk$_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onCheckAddPermission_tn71rk$_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onCheckAddPermission_tn71rk$_0.prototype.constructor = Coroutine$onCheckAddPermission_tn71rk$_0;
  Coroutine$onCheckAddPermission_tn71rk$_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.local$tmp$ = this.$this.view;
        this.state_0 = 2;
        this.result_0 = this.$this.repo.entityRoleDao.userHasTableLevelPermission_3pjtqy$(this.$this.loggedInPersonUid, Role$Companion$PERMISSION_CLAZZ_INSERT, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$tmp$.newClazzListOptionVisible = this.result_0;
        switch (this.$this.mListMode.name) {
          case 'PICKER':
            tmp$ = this.$this.view.newClazzListOptionVisible;
            break;
          case 'BROWSER':
            tmp$ = true;
            break;
          default:
            tmp$ = Kotlin.noWhenBranchMatched();
            break;
        }
        return tmp$;
      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);
};
  ClazzListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account_0, continuation_0, suspended) {
  var instance = new Coroutine$onCheckAddPermission_tn71rk$_0(this, account_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ClazzListPresenter.prototype.handleClickCreateNewFab = function() {
  this.systemImpl.go_gofqk3$(ClazzEdit2View$Companion_getInstance().VIEW_NAME, emptyMap(), this.context);
};
  ClazzListPresenter.prototype.handleClickJoinClazz = function() {
  this.systemImpl.go_gofqk3$(JoinWithCodeView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_CODE_TABLE, (6).toString())), this.context);
};
  ClazzListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
  var tmp$;
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ClazzEdit2View$Companion_getInstance().VIEW_NAME, getKClass(Clazz), Clazz.Companion.serializer(), destinationResultKey != null ? destinationResultKey : ClazzListPresenter$Companion_getInstance().CLAZZ_RESULT_KEY, true, (tmp$ = args != null ? toMutableMap(args) : null) != null ? tmp$ : toMutableMap(this.arguments)));
};
  ClazzListPresenter.prototype.onClickSort_o8nuns$ = function(sortOption) {
  UstadListPresenter.prototype.onClickSort_o8nuns$.call(this, sortOption);
  this.updateList_0();
};
  ClazzListPresenter.prototype.onSearchSubmitted_pdl1vj$ = function(text) {
  this.searchText_0 = text;
  this.updateList_0();
};
  ClazzListPresenter.prototype.onListFilterOptionSelected_5mmfk3$ = function(filterOptionId) {
  UstadListPresenter.prototype.onListFilterOptionSelected_5mmfk3$.call(this, filterOptionId);
  this.updateList_0();
};
  function ClazzListPresenter$Companion() {
    ClazzListPresenter$Companion_instance = this;
    this.CLAZZ_RESULT_KEY = 'Clazz';
    this.SORT_OPTIONS = listOf([new SortOrderOption(2046, 1, true), new SortOrderOption(2046, 2, false), new SortOrderOption(2068, 3, true), new SortOrderOption(2068, 4, false)]);
    this.FILTER_OPTIONS = listOf([to(2931, 5), to(2932, 6), to(2431, 0)]);
  }
  ClazzListPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzListPresenter$Companion_instance = null;
  function ClazzListPresenter$Companion_getInstance() {
    if (ClazzListPresenter$Companion_instance === null) {
      new ClazzListPresenter$Companion();
    }
    return ClazzListPresenter$Companion_instance;
  }
  ClazzListPresenter.prototype.onClickClazz_yczdf2$ = function(clazz) {
  return this.clazzList2ItemListener_0.onClickClazz_yczdf2$(clazz);
};
  ClazzListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzListPresenter', 
  interfaces: [ClazzListItemListener, UstadListPresenter, OnSearchSubmitted, OnSortOptionSelected]};
  var compareBy$lambda_0 = wrapFunction(function() {
  var compareValues = Kotlin.kotlin.comparisons.compareValues_s00gnj$;
  return function(closure$selector) {
  return function(a, b) {
  var selector = closure$selector;
  return compareValues(selector(a), selector(b));
};
};
});
  var compareBy$lambda_1 = wrapFunction(function() {
  var compareValues = Kotlin.kotlin.comparisons.compareValues_s00gnj$;
  return function(closure$selector) {
  return function(a, b) {
  var selector = closure$selector;
  return compareValues(selector(a), selector(b));
};
};
});
  function ClazzLogEditAttendancePresenter(context, arguments_0, view, di, lifecycleOwner) {
    ClazzLogEditAttendancePresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.attendanceRecordOneToManyJoinHelper_0 = new DefaultOneToManyJoinEditHelper(getPropertyCallableRef('clazzLogAttendanceRecordUid', 1, function($receiver) {
  return $receiver.clazzLogAttendanceRecordUid;
}, function($receiver, value) {
  $receiver.clazzLogAttendanceRecordUid = value;
}), 'state_ClazzLogAttendanceRecord_list', ListSerializer(ClazzLogAttendanceRecordWithPerson.Companion.serializer()), ListSerializer(ClazzLogAttendanceRecordWithPerson.Companion.serializer()), this, getKClass(ClazzLogAttendanceRecordWithPerson), ClazzLogEditAttendancePresenter$attendanceRecordOneToManyJoinHelper$lambda);
    this.currentClazzLogUid_0 = L0;
    this.clazzLogs_0 = copyOnWriteListOf([]);
    this.clazzAttendanceRecords_0 = copyOnWriteListOf([]);
  }
  Object.defineProperty(ClazzLogEditAttendancePresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  ClazzLogEditAttendancePresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  this.currentClazzLogUid_0 = (tmp$_2 = (tmp$_1 = (tmp$ = savedState != null ? savedState.get_11rb$(ClazzLogEditAttendancePresenter$Companion_getInstance().STATE_CURRENT_UID) : null) != null ? toLong(tmp$) : null) != null ? tmp$_1 : (tmp$_0 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$_0) : null) != null ? tmp$_2 : L0;
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
  this.view.clazzLogAttendanceRecordList = this.attendanceRecordOneToManyJoinHelper_0.liveList;
};
  function Coroutine$ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda(this$ClazzLogEditAttendancePresenter_0, closure$newClazzLog_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$this$ClazzLogEditAttendancePresenter = this$ClazzLogEditAttendancePresenter_0;
    this.local$closure$newClazzLog = closure$newClazzLog_0;
    this.local$it = it_0;
  }
  Coroutine$ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda;
  Coroutine$ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if (equals(this.local$this$ClazzLogEditAttendancePresenter.currentClazzLogUid_0, L0) && this.local$closure$newClazzLog != null) {
          return this.local$closure$newClazzLog;
        } else {
          if ((tmp$_0 = (tmp$ = !equals(this.local$this$ClazzLogEditAttendancePresenter.currentClazzLogUid_0, L0) ? this.local$it : null) != null ? tmp$.clazzLogDao : null) != null) {
            this.state_0 = 2;
            this.result_0 = tmp$_0.findByUidAsync_s8cxhz$(this.local$this$ClazzLogEditAttendancePresenter.currentClazzLogUid_0, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.result_0 = null;
            this.state_0 = 3;
            continue;
          }
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        continue;
      case 3:
        return this.result_0;
      case 4:
        return;
      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 ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda(this$ClazzLogEditAttendancePresenter_0, closure$newClazzLog_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda(this$ClazzLogEditAttendancePresenter_0, closure$newClazzLog_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda_0(closure$db_0, closure$clazzLog_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$clazzLog = closure$clazzLog_0;
  }
  Coroutine$ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda_0.prototype.constructor = Coroutine$ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda_0;
  Coroutine$ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        var $receiver = this.local$closure$db;
        if ((tmp$_0 = (tmp$ = !equals(this.local$closure$clazzLog.clazzLogClazzUid, L0) ? $receiver : null) != null ? tmp$.clazzDao : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_0.getClazzWithSchool_s8cxhz$(this.local$closure$clazzLog.clazzLogClazzUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda_0(closure$db_0, closure$clazzLog_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda_0(closure$db_0, closure$clazzLog_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda_1(it) {
    var tmp$, tmp$_0;
    return toString((tmp$ = it.person) != null ? tmp$.firstNames : null) + ' ' + toString((tmp$_0 = it.person) != null ? tmp$_0.lastName : null);
  }
  function ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda_2(it) {
    return it.logDate;
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_5($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$newClazzLog = void 0;
    this.local$clazzLog = void 0;
    this.local$clazzMembersAtTime = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_5.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_5.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_5.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_5;
  Coroutine$onLoadEntityFromDb_7hogkd$_5.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        var tmp$_2;
        if ((tmp$ = this.$this.arguments.get_11rb$(ClazzLogEditAttendanceView$Companion_getInstance().ARG_NEW_CLAZZLOG)) != null) {
          var di = this.$this.di;
          var strategy = ClazzLog.Companion.serializer();
          var tmp$_3;
          var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_3 : throwCCE(), null);
          tmp$_2 = json.decodeFromString_awif5v$(strategy, tmp$);
        } else 
          tmp$_2 = null;
        this.local$newClazzLog = tmp$_2;
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda(this.$this, this.local$newClazzLog), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$clazzLog = (tmp$_0 = this.result_0) != null ? tmp$_0 : new ClazzLog();
        this.state_0 = 3;
        this.result_0 = withTimeoutOrNull(L2000, ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda_0(this.local$db, this.local$clazzLog), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var clazzWithSchool = (tmp$_1 = this.result_0) != null ? tmp$_1 : new ClazzWithSchool();
        this.$this.view.clazzLogTimezone = effectiveTimeZone(clazzWithSchool);
        this.state_0 = 4;
        this.result_0 = this.local$db.clazzEnrolmentDao.getAllClazzEnrolledAtTimeAsync_6qtc6d$(this.local$clazzLog.clazzLogClazzUid, this.local$clazzLog.logDate, 1000, void 0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.local$clazzMembersAtTime = this.result_0;
        this.state_0 = 5;
        this.result_0 = this.local$db.clazzLogAttendanceRecordDao.findByClazzLogUid_s8cxhz$(this.$this.currentClazzLogUid_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        var clazzAttendanceLogsInDb = {
  v: this.result_0};
        var $receiver = clazzAttendanceLogsInDb.v;
        var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
        var tmp$_4;
        tmp$_4 = $receiver.iterator();
        loop_label:
          while (tmp$_4.hasNext()) {
            var item = tmp$_4.next();
            var tmp$_5 = destination.add_11rb$;
            var tmp$_6;
            var $receiver_0 = this.$this.clazzAttendanceRecords_0;
            var firstOrNull$result;
            firstOrNull$break:
              do {
                var tmp$_7;
                tmp$_7 = $receiver_0.iterator();
                while (tmp$_7.hasNext()) {
                  var element = tmp$_7.next();
                  if (equals(element.clazzLogAttendanceRecordClazzLogUid, this.local$clazzLog.clazzLogUid) && equals(item.clazzLogAttendanceRecordPersonUid, element.clazzLogAttendanceRecordPersonUid)) {
                    firstOrNull$result = element;
                    break firstOrNull$break;
                  }
                }
                firstOrNull$result = null;
              } while (false);
            tmp$_5.call(destination, (tmp$_6 = firstOrNull$result) != null ? tmp$_6 : item);
          }
        clazzAttendanceLogsInDb.v = destination;
        var destination_0 = ArrayList_init_0(collectionSizeOrDefault(this.local$clazzMembersAtTime, 10));
        var tmp$_8;
        tmp$_8 = this.local$clazzMembersAtTime.iterator();
        loop_label:
          while (tmp$_8.hasNext()) {
            var item_0 = tmp$_8.next();
            var tmp$_9 = destination_0.add_11rb$;
            var tmp$_10, tmp$_11;
            var tmp$_12;
            var $receiver_1 = this.$this.clazzAttendanceRecords_0;
            var firstOrNull$result_0;
            firstOrNull$break:
              do {
                var tmp$_13;
                tmp$_13 = $receiver_1.iterator();
                while (tmp$_13.hasNext()) {
                  var element_0 = tmp$_13.next();
                  if (equals(element_0.clazzLogAttendanceRecordPersonUid, item_0.clazzEnrolmentPersonUid) && equals(element_0.clazzLogAttendanceRecordClazzLogUid, this.$this.currentClazzLogUid_0)) {
                    firstOrNull$result_0 = element_0;
                    break firstOrNull$break;
                  }
                }
                firstOrNull$result_0 = null;
              } while (false);
            if ((tmp$_10 = firstOrNull$result_0) != null) 
              tmp$_12 = tmp$_10;
            else {
              var $receiver_2 = clazzAttendanceLogsInDb.v;
              var firstOrNull$result_1;
              firstOrNull$break:
                do {
                  var tmp$_14;
                  tmp$_14 = $receiver_2.iterator();
                  while (tmp$_14.hasNext()) {
                    var element_1 = tmp$_14.next();
                    if (equals(element_1.clazzLogAttendanceRecordPersonUid, item_0.clazzEnrolmentPersonUid) && equals(element_1.clazzLogAttendanceRecordClazzLogUid, this.$this.currentClazzLogUid_0)) {
                      firstOrNull$result_1 = element_1;
                      break firstOrNull$break;
                    }
                  }
                  firstOrNull$result_1 = null;
                } while (false);
              tmp$_12 = firstOrNull$result_1;
            }
            var tmp$_15;
            if ((tmp$_11 = tmp$_12) != null) 
              tmp$_15 = tmp$_11;
            else {
              var $receiver_3 = new ClazzLogAttendanceRecordWithPerson();
              $receiver_3.person = item_0.person;
              $receiver_3.clazzLogAttendanceRecordClazzLogUid = this.$this.currentClazzLogUid_0;
              $receiver_3.clazzLogAttendanceRecordPersonUid = item_0.clazzEnrolmentPersonUid;
              tmp$_15 = $receiver_3;
            }
            tmp$_9.call(destination_0, tmp$_15);
          }
        var allMembers = sortedWith(destination_0, new Comparator(compareBy$lambda_0(ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda_1)));
        this.$this.attendanceRecordOneToManyJoinHelper_0.liveList.sendValue_11rb$(allMembers);
        if (this.$this.view.clazzLogsList == null) {
          this.state_0 = 6;
          this.result_0 = this.$this.repo.clazzLogDao.findByClazzUidAsync_yhmem3$(this.local$clazzLog.clazzLogClazzUid, 1, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 7;
          continue;
        }
      case 6:
        var clazzLogs = toMutableList(this.result_0);
        if (this.local$newClazzLog != null) {
          clazzLogs.add_11rb$(this.local$newClazzLog);
          if (clazzLogs.size > 1) {
            sortWith(clazzLogs, new Comparator(compareBy$lambda_1(ClazzLogEditAttendancePresenter$onLoadEntityFromDb$lambda_2)));
          }
        }
        this.$this.view.clazzLogsList = toList(clazzLogs);
        this.state_0 = 7;
        continue;
      case 7:
        return this.local$clazzLog;
      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);
};
  ClazzLogEditAttendancePresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_5(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ClazzLogEditAttendancePresenter.prototype.handleClickMarkAll_za3lpa$ = function(attendanceStatus) {
  var tmp$, tmp$_0, tmp$_1;
  var tmp$_2;
  if ((tmp$_0 = (tmp$ = this.attendanceRecordOneToManyJoinHelper_0.liveList.getValue()) != null ? toList(tmp$) : null) != null) {
    var destination = ArrayList_init_0(collectionSizeOrDefault(tmp$_0, 10));
    var tmp$_3;
    tmp$_3 = tmp$_0.iterator();
    while (tmp$_3.hasNext()) {
      var item = tmp$_3.next();
      var tmp$_4 = destination.add_11rb$;
      var $receiver = item.copy();
      $receiver.attendanceStatus = attendanceStatus;
      tmp$_4.call(destination, $receiver);
    }
    tmp$_2 = destination;
  } else 
    tmp$_2 = null;
  tmp$_1 = tmp$_2;
  if (tmp$_1 == null) {
    return;
  }
  var newList = tmp$_1;
  this.attendanceRecordOneToManyJoinHelper_0.liveList.setVal_11rb$(newList);
};
  function Coroutine$ClazzLogEditAttendancePresenter$handleSelectClazzLog$lambda(this$ClazzLogEditAttendancePresenter_0, closure$next_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzLogEditAttendancePresenter = this$ClazzLogEditAttendancePresenter_0;
    this.local$closure$next = closure$next_0;
  }
  Coroutine$ClazzLogEditAttendancePresenter$handleSelectClazzLog$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzLogEditAttendancePresenter$handleSelectClazzLog$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzLogEditAttendancePresenter$handleSelectClazzLog$lambda.prototype.constructor = Coroutine$ClazzLogEditAttendancePresenter$handleSelectClazzLog$lambda;
  Coroutine$ClazzLogEditAttendancePresenter$handleSelectClazzLog$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$this$ClazzLogEditAttendancePresenter.updateAttendanceRecordsFromView_0();
        this.local$this$ClazzLogEditAttendancePresenter.view.entity = this.local$closure$next;
        this.local$this$ClazzLogEditAttendancePresenter.currentClazzLogUid_0 = this.local$closure$next.clazzLogUid;
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzLogEditAttendancePresenter.onLoadEntityFromDb_7hogkd$(this.local$this$ClazzLogEditAttendancePresenter.repo, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ClazzLogEditAttendancePresenter$handleSelectClazzLog$lambda(this$ClazzLogEditAttendancePresenter_0, closure$next_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzLogEditAttendancePresenter$handleSelectClazzLog$lambda(this$ClazzLogEditAttendancePresenter_0, closure$next_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzLogEditAttendancePresenter.prototype.handleSelectClazzLog_3aopzo$ = function(current, next) {
  launch(this.presenterScope, void 0, void 0, ClazzLogEditAttendancePresenter$handleSelectClazzLog$lambda(this, next));
};
  ClazzLogEditAttendancePresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  var editEntity = null;
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = ClazzLog.Companion.serializer();
    var tmp$;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
    editEntity = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    editEntity = new ClazzLog();
  }
  return editEntity;
};
  ClazzLogEditAttendancePresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  ClazzLogEditAttendancePresenter.prototype.updateAttendanceRecordsFromView_0 = function() {
  var tmp$;
  tmp$ = this.attendanceRecordOneToManyJoinHelper_0.liveList.getValue();
  if (tmp$ == null) {
    return;
  }
  var clazzLogAttendanceRecords = tmp$;
  var tmp$_0;
  tmp$_0 = clazzLogAttendanceRecords.iterator();
  loop_label:
    while (tmp$_0.hasNext()) {
      var element = tmp$_0.next();
      var $receiver = this.clazzAttendanceRecords_0;
      var indexOfFirst$result;
      indexOfFirst$break:
        do {
          var tmp$_1;
          var index = 0;
          tmp$_1 = $receiver.iterator();
          while (tmp$_1.hasNext()) {
            var item = tmp$_1.next();
            if (equals(item.clazzLogAttendanceRecordClazzLogUid, element.clazzLogAttendanceRecordClazzLogUid) && equals(item.clazzLogAttendanceRecordPersonUid, element.clazzLogAttendanceRecordPersonUid)) {
              indexOfFirst$result = index;
              break indexOfFirst$break;
            }
            index = index + 1 | 0;
          }
          indexOfFirst$result = -1;
        } while (false);
      var existingIndex = indexOfFirst$result;
      if (existingIndex >= 0) {
        this.clazzAttendanceRecords_0.set_wxm5ur$(existingIndex, element);
      } else {
        this.clazzAttendanceRecords_0.add_11rb$(element);
      }
    }
  var viewEntity = this.view.entity;
  var tmp$_2 = viewEntity != null;
  if (tmp$_2) {
    var $receiver_0 = this.clazzLogs_0;
    var any$result;
    any$break:
      do {
        var tmp$_3;
        if (Kotlin.isType($receiver_0, Collection) && $receiver_0.isEmpty()) {
          any$result = false;
          break any$break;
        }
        tmp$_3 = $receiver_0.iterator();
        while (tmp$_3.hasNext()) {
          var element_0 = tmp$_3.next();
          if (equals(element_0.clazzLogUid, viewEntity.clazzLogUid)) {
            any$result = true;
            break any$break;
          }
        }
        any$result = false;
      } while (false);
    tmp$_2 = !any$result;
  }
  if (tmp$_2) {
    this.clazzLogs_0.add_11rb$(viewEntity);
  }
};
  function Coroutine$commitToDatabase_0($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$ = void 0;
    this.local$element = void 0;
    this.local$entityClazzAttendanceRecords = void 0;
    this.local$insertUpdatePartition = void 0;
  }
  Coroutine$commitToDatabase_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$commitToDatabase_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$commitToDatabase_0.prototype.constructor = Coroutine$commitToDatabase_0;
  Coroutine$commitToDatabase_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        this.local$tmp$ = this.$this.clazzLogs_0.iterator();
        this.state_0 = 2;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 6;
          continue;
        }
        this.local$element = this.local$tmp$.next();
        var $receiver = this.$this.clazzAttendanceRecords_0;
        var destination = ArrayList_init();
        var tmp$_1;
        tmp$_1 = $receiver.iterator();
        while (tmp$_1.hasNext()) {
          var element = tmp$_1.next();
          if (equals(element.clazzLogAttendanceRecordClazzLogUid, this.local$element.clazzLogUid)) 
            destination.add_11rb$(element);
        }
        this.local$entityClazzAttendanceRecords = destination;
        this.local$element.clazzLogStatusFlag = 4;
        var count$result;
        count$break:
          do {
            var tmp$_2;
            if (Kotlin.isType(this.local$entityClazzAttendanceRecords, Collection) && this.local$entityClazzAttendanceRecords.isEmpty()) {
              count$result = 0;
              break count$break;
            }
            var count = 0;
            tmp$_2 = this.local$entityClazzAttendanceRecords.iterator();
            while (tmp$_2.hasNext()) {
              var element_0 = tmp$_2.next();
              if (element_0.attendanceStatus === 1) 
                checkCountOverflow((count = count + 1 | 0 , count));
            }
            count$result = count;
          } while (false);
        this.local$element.clazzLogNumPresent = count$result;
        var count$result_0;
        count$break:
          do {
            var tmp$_3;
            if (Kotlin.isType(this.local$entityClazzAttendanceRecords, Collection) && this.local$entityClazzAttendanceRecords.isEmpty()) {
              count$result_0 = 0;
              break count$break;
            }
            var count_0 = 0;
            tmp$_3 = this.local$entityClazzAttendanceRecords.iterator();
            while (tmp$_3.hasNext()) {
              var element_1 = tmp$_3.next();
              if (element_1.attendanceStatus === 2) 
                checkCountOverflow((count_0 = count_0 + 1 | 0 , count_0));
            }
            count$result_0 = count_0;
          } while (false);
        this.local$element.clazzLogNumAbsent = count$result_0;
        var count$result_1;
        count$break:
          do {
            var tmp$_4;
            if (Kotlin.isType(this.local$entityClazzAttendanceRecords, Collection) && this.local$entityClazzAttendanceRecords.isEmpty()) {
              count$result_1 = 0;
              break count$break;
            }
            var count_1 = 0;
            tmp$_4 = this.local$entityClazzAttendanceRecords.iterator();
            while (tmp$_4.hasNext()) {
              var element_2 = tmp$_4.next();
              if (element_2.attendanceStatus === 4) 
                checkCountOverflow((count_1 = count_1 + 1 | 0 , count_1));
            }
            count$result_1 = count_1;
          } while (false);
        this.local$element.clazzLogNumPartial = count$result_1;
        if (!equals(this.local$element.clazzLogUid, L0)) {
          this.state_0 = 4;
          this.result_0 = this.$this.repo.clazzLogDao.updateAsync_b1okmm$(this.local$element, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          this.result_0 = this.$this.repo.clazzLogDao.insertAsync(this.local$element, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 3:
        this.local$element.clazzLogUid = this.result_0;
        var tmp$_5;
        tmp$_5 = this.local$entityClazzAttendanceRecords.iterator();
        while (tmp$_5.hasNext()) {
          var element_3 = tmp$_5.next();
          element_3.clazzLogAttendanceRecordClazzLogUid = this.local$element.clazzLogUid;
        }
        this.state_0 = 5;
        continue;
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        this.state_0 = 2;
        continue;
      case 6:
        var $receiver_0 = this.$this.clazzAttendanceRecords_0;
        var tmp$_6;
        var first = ArrayList_init();
        var second = ArrayList_init();
        tmp$_6 = $receiver_0.iterator();
        while (tmp$_6.hasNext()) {
          var element_4 = tmp$_6.next();
          if (equals(element_4.clazzLogAttendanceRecordUid, L0)) {
            first.add_11rb$(element_4);
          } else {
            second.add_11rb$(element_4);
          }
        }
        this.local$insertUpdatePartition = new Pair(first, second);
        this.state_0 = 7;
        this.result_0 = this.$this.repo.clazzLogAttendanceRecordDao.insertListAsync_7quahr$(this.local$insertUpdatePartition.first, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 7:
        this.state_0 = 8;
        this.result_0 = this.$this.repo.clazzLogAttendanceRecordDao.updateListAsync_7quahr$(this.local$insertUpdatePartition.second, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 8:
        this.state_0 = 9;
        this.result_0 = this.$this.repo.clazzDao.updateClazzAttendanceAverageAsync_3pjtqy$((tmp$_0 = (tmp$ = firstOrNull(this.$this.clazzLogs_0)) != null ? tmp$.clazzLogClazzUid : null) != null ? tmp$_0 : L0, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 9:
        return;
      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);
};
  ClazzLogEditAttendancePresenter.prototype.commitToDatabase_0 = function(continuation_0, suspended) {
  var instance = new Coroutine$commitToDatabase_0(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$ClazzLogEditAttendancePresenter$handleClickSave$lambda(this$ClazzLogEditAttendancePresenter_0, closure$entity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzLogEditAttendancePresenter = this$ClazzLogEditAttendancePresenter_0;
    this.local$closure$entity = closure$entity_0;
  }
  Coroutine$ClazzLogEditAttendancePresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzLogEditAttendancePresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzLogEditAttendancePresenter$handleClickSave$lambda.prototype.constructor = Coroutine$ClazzLogEditAttendancePresenter$handleClickSave$lambda;
  Coroutine$ClazzLogEditAttendancePresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$this$ClazzLogEditAttendancePresenter.updateAttendanceRecordsFromView_0();
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzLogEditAttendancePresenter.commitToDatabase_0(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (this.local$this$ClazzLogEditAttendancePresenter.arguments.get_11rb$(ClazzLogEditAttendanceView$Companion_getInstance().ARG_NEW_CLAZZLOG) != null) {
          return this.local$this$ClazzLogEditAttendancePresenter.systemImpl.popBack_i9f55q$(ClazzLogEditView$Companion_getInstance().VIEW_NAME, true, this.local$this$ClazzLogEditAttendancePresenter.context) , Unit;
        } else {
          var tmp$ = this.local$this$ClazzLogEditAttendancePresenter;
          var di = this.local$this$ClazzLogEditAttendancePresenter.di;
          var strategy = ListSerializer(ClazzLog.Companion.serializer());
          var entity = listOf_0(this.local$closure$entity);
          var tmp$_0;
          var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
          return tmp$.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity)) , Unit;
        }
      case 3:
        return;
      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 ClazzLogEditAttendancePresenter$handleClickSave$lambda(this$ClazzLogEditAttendancePresenter_0, closure$entity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzLogEditAttendancePresenter$handleClickSave$lambda(this$ClazzLogEditAttendancePresenter_0, closure$entity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzLogEditAttendancePresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ClazzLogEditAttendancePresenter$handleClickSave$lambda(this, entity));
};
  function ClazzLogEditAttendancePresenter$Companion() {
    ClazzLogEditAttendancePresenter$Companion_instance = this;
    this.STATE_CURRENT_UID = 'currentUid';
  }
  ClazzLogEditAttendancePresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzLogEditAttendancePresenter$Companion_instance = null;
  function ClazzLogEditAttendancePresenter$Companion_getInstance() {
    if (ClazzLogEditAttendancePresenter$Companion_instance === null) {
      new ClazzLogEditAttendancePresenter$Companion();
    }
    return ClazzLogEditAttendancePresenter$Companion_instance;
  }
  function ClazzLogEditAttendancePresenter$attendanceRecordOneToManyJoinHelper$lambda($receiver, it) {
    $receiver.clazzLogAttendanceRecordUid = it;
    return Unit;
  }
  ClazzLogEditAttendancePresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzLogEditAttendancePresenter', 
  interfaces: [UstadEditPresenter]};
  function ClazzLogEditPresenter(context, arguments_0, view, lifecycleOwner, di) {
    ClazzLogEditPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(ClazzLogEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$JSON_getInstance();
}});
  ClazzLogEditPresenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
};
  function Coroutine$ClazzLogEditPresenter$onLoadFromJson$lambda(this$ClazzLogEditPresenter_0, closure$editEntity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzLogEditPresenter = this$ClazzLogEditPresenter_0;
    this.local$closure$editEntity = closure$editEntity_0;
  }
  Coroutine$ClazzLogEditPresenter$onLoadFromJson$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzLogEditPresenter$onLoadFromJson$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzLogEditPresenter$onLoadFromJson$lambda.prototype.constructor = Coroutine$ClazzLogEditPresenter$onLoadFromJson$lambda;
  Coroutine$ClazzLogEditPresenter$onLoadFromJson$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzLogEditPresenter.db.clazzDao.getClazzWithSchool_s8cxhz$(this.local$closure$editEntity.v.clazzLogClazzUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var timeZone = effectiveTimeZone(this.result_0);
        this.local$this$ClazzLogEditPresenter.view.timeZone = timeZone;
        var localMidnight = toLocalMidnight(DateTime.Companion.invoke_s8cxhz$(this.local$closure$editEntity.v.logDate), timeZone).unixMillisLong;
        this.local$this$ClazzLogEditPresenter.view.date = localMidnight;
        return this.local$this$ClazzLogEditPresenter.view.time = this.local$closure$editEntity.v.logDate.subtract(localMidnight) , Unit;
      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 ClazzLogEditPresenter$onLoadFromJson$lambda(this$ClazzLogEditPresenter_0, closure$editEntity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzLogEditPresenter$onLoadFromJson$lambda(this$ClazzLogEditPresenter_0, closure$editEntity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzLogEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  var editEntity = {
  v: null};
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = ClazzLog.Companion.serializer();
    var tmp$;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
    editEntity.v = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    editEntity.v = new ClazzLog();
  }
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ClazzLogEditPresenter$onLoadFromJson$lambda(this, editEntity));
  return editEntity.v;
};
  ClazzLogEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  function Coroutine$ClazzLogEditPresenter$handleClickSave$lambda(this$ClazzLogEditPresenter_0, closure$entity_0, closure$presenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzLogEditPresenter = this$ClazzLogEditPresenter_0;
    this.local$closure$entity = closure$entity_0;
    this.local$closure$presenter = closure$presenter_0;
  }
  Coroutine$ClazzLogEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzLogEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzLogEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$ClazzLogEditPresenter$handleClickSave$lambda;
  Coroutine$ClazzLogEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzLogEditPresenter.db.clazzDao.getClazzWithSchool_s8cxhz$(this.local$closure$entity.clazzLogClazzUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var effectiveTimeZone_0 = (tmp$_0 = (tmp$ = this.result_0) != null ? effectiveTimeZone(tmp$) : null) != null ? tmp$_0 : 'UTC';
        var tmp$_2 = this.local$closure$entity;
        var $receiver = toOffsetByTimezone(DateTime.Companion.invoke_s8cxhz$(this.local$this$ClazzLogEditPresenter.view.date), effectiveTimeZone_0);
        var $receiver_0 = $receiver.hours;
        var tmp$_3 = TimeSpan.Companion.fromHours_14dthe$($receiver_0);
        var $receiver_1 = $receiver.minutes;
        var tmp$_4 = tmp$_3.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_1));
        var $receiver_2 = $receiver.seconds;
        var tmp$_5 = tmp$_4.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_2));
        var $receiver_3 = $receiver.milliseconds;
        tmp$_2.logDate = $receiver.minus_fv8bff$(tmp$_5.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_3))).utc.unixMillisLong.add(this.local$this$ClazzLogEditPresenter.view.time);
        if (((tmp$_1 = this.local$this$ClazzLogEditPresenter.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_NEXT)) != null ? startsWith(tmp$_1, ClazzLogEditAttendanceView$Companion_getInstance().VIEW_NAME) : null) === true) {
          var tmp$_6 = this.local$this$ClazzLogEditPresenter;
          var tmp$_7 = this.local$closure$presenter;
          var tmp$_8 = ClazzLogEditAttendanceView$Companion_getInstance().VIEW_NAME;
          var tmp$_9 = getKClass(ClazzLog);
          var tmp$_10 = ClazzLog.Companion.serializer();
          var tmp$_11 = void 0;
          var tmp$_12 = void 0;
          var tmp$_13 = ClazzLogEditAttendanceView$Companion_getInstance().ARG_NEW_CLAZZLOG;
          var di = this.local$this$ClazzLogEditPresenter.di;
          var strategy = ClazzLog.Companion.serializer();
          var entity = this.local$closure$entity;
          var tmp$_14;
          var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_14 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_14 : throwCCE(), null);
          return tmp$_6.navigateForResult_r13zgt$(new NavigateForResultOptions(tmp$_7, null, tmp$_8, tmp$_9, tmp$_10, tmp$_11, tmp$_12, mutableMapOf([to(tmp$_13, json.encodeToString_tf03ej$(strategy, entity))]))) , Unit;
        } else {
          var tmp$_15 = this.local$this$ClazzLogEditPresenter;
          var di_0 = this.local$this$ClazzLogEditPresenter.di;
          var strategy_0 = ListSerializer(ClazzLog.Companion.serializer());
          var entity_0 = listOf_0(this.local$closure$entity);
          var tmp$_16;
          var json_0 = get_direct(di_0).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_16 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_16 : throwCCE(), null);
          return tmp$_15.finishWithResult_61zpoe$(json_0.encodeToString_tf03ej$(strategy_0, entity_0)) , Unit;
        }
      case 3:
        return;
      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 ClazzLogEditPresenter$handleClickSave$lambda(this$ClazzLogEditPresenter_0, closure$entity_0, closure$presenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzLogEditPresenter$handleClickSave$lambda(this$ClazzLogEditPresenter_0, closure$entity_0, closure$presenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzLogEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  this.view.timeError = null;
  this.view.dateError = null;
  var hasError = false;
  if (equals(this.view.date, L0)) {
    this.view.dateError = this.systemImpl.getString(2127, this.context);
    hasError = true;
  }
  if (equals(this.view.time, L0)) {
    this.view.timeError = this.systemImpl.getString(2127, this.context);
    hasError = true;
  }
  if (hasError) 
    return;
  var presenter = this;
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ClazzLogEditPresenter$handleClickSave$lambda(this, entity, presenter));
};
  function ClazzLogEditPresenter$Companion() {
    ClazzLogEditPresenter$Companion_instance = this;
  }
  ClazzLogEditPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzLogEditPresenter$Companion_instance = null;
  function ClazzLogEditPresenter$Companion_getInstance() {
    if (ClazzLogEditPresenter$Companion_instance === null) {
      new ClazzLogEditPresenter$Companion();
    }
    return ClazzLogEditPresenter$Companion_instance;
  }
  ClazzLogEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzLogEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function ClazzLogListAttendancePresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.currentSortOrder = ClazzLogListAttendancePresenter$SortOrder$ORDER_NAME_ASC_getInstance();
    this.clazzUidFilter = L0;
    this.clazzWithSchool_0 = null;
    this.graphDbData_0 = null;
    this.graphDisplayData_0 = DoorMutableLiveData_init();
    this.graphDateRange_0 = new Pair(L0, L0);
    this.clazzTimeZone_0 = null;
    this.graphObserver_0 = new ClazzLogListAttendancePresenter$graphObserver$ObjectLiteral(this);
  }
  function ClazzLogListAttendancePresenter$AttendanceGraphData(percentageAttendedSeries, percentageLateSeries, graphDateRange) {
    this.percentageAttendedSeries = percentageAttendedSeries;
    this.percentageLateSeries = percentageLateSeries;
    this.graphDateRange = graphDateRange;
  }
  ClazzLogListAttendancePresenter$AttendanceGraphData.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'AttendanceGraphData', 
  interfaces: []};
  ClazzLogListAttendancePresenter$AttendanceGraphData.prototype.component1 = function() {
  return this.percentageAttendedSeries;
};
  ClazzLogListAttendancePresenter$AttendanceGraphData.prototype.component2 = function() {
  return this.percentageLateSeries;
};
  ClazzLogListAttendancePresenter$AttendanceGraphData.prototype.component3 = function() {
  return this.graphDateRange;
};
  ClazzLogListAttendancePresenter$AttendanceGraphData.prototype.copy_rdxxrd$ = function(percentageAttendedSeries, percentageLateSeries, graphDateRange) {
  return new ClazzLogListAttendancePresenter$AttendanceGraphData(percentageAttendedSeries === void 0 ? this.percentageAttendedSeries : percentageAttendedSeries, percentageLateSeries === void 0 ? this.percentageLateSeries : percentageLateSeries, graphDateRange === void 0 ? this.graphDateRange : graphDateRange);
};
  ClazzLogListAttendancePresenter$AttendanceGraphData.prototype.toString = function() {
  return 'AttendanceGraphData(percentageAttendedSeries=' + Kotlin.toString(this.percentageAttendedSeries) + (', percentageLateSeries=' + Kotlin.toString(this.percentageLateSeries)) + (', graphDateRange=' + Kotlin.toString(this.graphDateRange)) + ')';
};
  ClazzLogListAttendancePresenter$AttendanceGraphData.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.percentageAttendedSeries) | 0;
  result = result * 31 + Kotlin.hashCode(this.percentageLateSeries) | 0;
  result = result * 31 + Kotlin.hashCode(this.graphDateRange) | 0;
  return result;
};
  ClazzLogListAttendancePresenter$AttendanceGraphData.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.percentageAttendedSeries, other.percentageAttendedSeries) && Kotlin.equals(this.percentageLateSeries, other.percentageLateSeries) && Kotlin.equals(this.graphDateRange, other.graphDateRange)))));
};
  function ClazzLogListAttendancePresenter$SortOrder(name, ordinal, messageId) {
    Enum.call(this);
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ClazzLogListAttendancePresenter$SortOrder_initFields() {
    ClazzLogListAttendancePresenter$SortOrder_initFields = function() {
};
    ClazzLogListAttendancePresenter$SortOrder$ORDER_NAME_ASC_instance = new ClazzLogListAttendancePresenter$SortOrder('ORDER_NAME_ASC', 0, 2367);
    ClazzLogListAttendancePresenter$SortOrder$ORDER_NAME_DSC_instance = new ClazzLogListAttendancePresenter$SortOrder('ORDER_NAME_DSC', 1, 2368);
  }
  var ClazzLogListAttendancePresenter$SortOrder$ORDER_NAME_ASC_instance;
  function ClazzLogListAttendancePresenter$SortOrder$ORDER_NAME_ASC_getInstance() {
    ClazzLogListAttendancePresenter$SortOrder_initFields();
    return ClazzLogListAttendancePresenter$SortOrder$ORDER_NAME_ASC_instance;
  }
  var ClazzLogListAttendancePresenter$SortOrder$ORDER_NAME_DSC_instance;
  function ClazzLogListAttendancePresenter$SortOrder$ORDER_NAME_DSC_getInstance() {
    ClazzLogListAttendancePresenter$SortOrder_initFields();
    return ClazzLogListAttendancePresenter$SortOrder$ORDER_NAME_DSC_instance;
  }
  ClazzLogListAttendancePresenter$SortOrder.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SortOrder', 
  interfaces: [Enum]};
  function ClazzLogListAttendancePresenter$SortOrder$values() {
    return [ClazzLogListAttendancePresenter$SortOrder$ORDER_NAME_ASC_getInstance(), ClazzLogListAttendancePresenter$SortOrder$ORDER_NAME_DSC_getInstance()];
  }
  ClazzLogListAttendancePresenter$SortOrder.values = ClazzLogListAttendancePresenter$SortOrder$values;
  function ClazzLogListAttendancePresenter$SortOrder$valueOf(name) {
    switch (name) {
      case 'ORDER_NAME_ASC':
        return ClazzLogListAttendancePresenter$SortOrder$ORDER_NAME_ASC_getInstance();
      case 'ORDER_NAME_DSC':
        return ClazzLogListAttendancePresenter$SortOrder$ORDER_NAME_DSC_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ClazzLogListAttendancePresenter.SortOrder.' + name);
    }
  }
  ClazzLogListAttendancePresenter$SortOrder.valueOf_61zpoe$ = ClazzLogListAttendancePresenter$SortOrder$valueOf;
  function ClazzLogListAttendancePresenter$RecordAttendanceOption(name, ordinal, commandId, messageId) {
    Enum.call(this);
    this.commandId = commandId;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ClazzLogListAttendancePresenter$RecordAttendanceOption_initFields() {
    ClazzLogListAttendancePresenter$RecordAttendanceOption_initFields = function() {
};
    ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_MOST_RECENT_SCHEDULE_instance = new ClazzLogListAttendancePresenter$RecordAttendanceOption('RECORD_ATTENDANCE_MOST_RECENT_SCHEDULE', 0, 1, 2680);
    ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_NEW_SCHEDULE_instance = new ClazzLogListAttendancePresenter$RecordAttendanceOption('RECORD_ATTENDANCE_NEW_SCHEDULE', 1, 2, 2681);
  }
  var ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_MOST_RECENT_SCHEDULE_instance;
  function ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_MOST_RECENT_SCHEDULE_getInstance() {
    ClazzLogListAttendancePresenter$RecordAttendanceOption_initFields();
    return ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_MOST_RECENT_SCHEDULE_instance;
  }
  var ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_NEW_SCHEDULE_instance;
  function ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_NEW_SCHEDULE_getInstance() {
    ClazzLogListAttendancePresenter$RecordAttendanceOption_initFields();
    return ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_NEW_SCHEDULE_instance;
  }
  ClazzLogListAttendancePresenter$RecordAttendanceOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'RecordAttendanceOption', 
  interfaces: [Enum]};
  function ClazzLogListAttendancePresenter$RecordAttendanceOption$values() {
    return [ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_MOST_RECENT_SCHEDULE_getInstance(), ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_NEW_SCHEDULE_getInstance()];
  }
  ClazzLogListAttendancePresenter$RecordAttendanceOption.values = ClazzLogListAttendancePresenter$RecordAttendanceOption$values;
  function ClazzLogListAttendancePresenter$RecordAttendanceOption$valueOf(name) {
    switch (name) {
      case 'RECORD_ATTENDANCE_MOST_RECENT_SCHEDULE':
        return ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_MOST_RECENT_SCHEDULE_getInstance();
      case 'RECORD_ATTENDANCE_NEW_SCHEDULE':
        return ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_NEW_SCHEDULE_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ClazzLogListAttendancePresenter.RecordAttendanceOption.' + name);
    }
  }
  ClazzLogListAttendancePresenter$RecordAttendanceOption.valueOf_61zpoe$ = ClazzLogListAttendancePresenter$RecordAttendanceOption$valueOf;
  function ClazzLogListAttendancePresenter$ClazzLogListSortOption(sortOrder, context, di) {
    MessageIdOption.call(this, sortOrder.messageId, context, void 0, di);
    this.sortOrder = sortOrder;
  }
  ClazzLogListAttendancePresenter$ClazzLogListSortOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzLogListSortOption', 
  interfaces: [MessageIdOption]};
  function ClazzLogListAttendancePresenter$onCreate$lambda$lambda(this$ClazzLogListAttendancePresenter) {
    return function(hasClazzLogs) {
  var tmp$, tmp$_0;
  tmp$_0 = this$ClazzLogListAttendancePresenter.view;
  if (hasClazzLogs === true) {
    tmp$ = listOf([ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_MOST_RECENT_SCHEDULE_getInstance(), ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_NEW_SCHEDULE_getInstance()]);
  } else {
    tmp$ = listOf_0(ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_NEW_SCHEDULE_getInstance());
  }
  tmp$_0.recordAttendanceOptions = tmp$;
  return Unit;
};
  }
  function Coroutine$ClazzLogListAttendancePresenter$onCreate$lambda(this$ClazzLogListAttendancePresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzLogListAttendancePresenter = this$ClazzLogListAttendancePresenter_0;
  }
  Coroutine$ClazzLogListAttendancePresenter$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzLogListAttendancePresenter$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzLogListAttendancePresenter$onCreate$lambda.prototype.constructor = Coroutine$ClazzLogListAttendancePresenter$onCreate$lambda;
  Coroutine$ClazzLogListAttendancePresenter$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzLogListAttendancePresenter.repo.clazzDao.personHasPermissionWithClazz_b9bd0d$(this.local$this$ClazzLogListAttendancePresenter.accountManager.activeAccount.personUid, this.local$this$ClazzLogListAttendancePresenter.clazzUidFilter, Role$Companion$PERMISSION_CLAZZ_LOG_ATTENDANCE_INSERT, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var hasAttendancePermission = this.result_0;
        if (!hasAttendancePermission) {
          this.local$this$ClazzLogListAttendancePresenter.view.recordAttendanceOptions = emptyList();
          return;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 3:
        return observeWithLifecycleOwner(this.local$this$ClazzLogListAttendancePresenter.repo.clazzLogDao.clazzHasScheduleLive_yhmem3$(this.local$this$ClazzLogListAttendancePresenter.clazzUidFilter, 16), this.local$this$ClazzLogListAttendancePresenter.lifecycleOwner, ClazzLogListAttendancePresenter$onCreate$lambda$lambda(this.local$this$ClazzLogListAttendancePresenter)) , Unit;
      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 ClazzLogListAttendancePresenter$onCreate$lambda(this$ClazzLogListAttendancePresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzLogListAttendancePresenter$onCreate$lambda(this$ClazzLogListAttendancePresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzLogListAttendancePresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0;
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.clazzUidFilter = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  this.updateListOnView_0();
  var tmp$_1 = this.view;
  var $receiver = toList_0(ClazzLogListAttendancePresenter$SortOrder$values());
  var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
  var tmp$_2;
  tmp$_2 = $receiver.iterator();
  while (tmp$_2.hasNext()) {
    var item = tmp$_2.next();
    destination.add_11rb$(new ClazzLogListAttendancePresenter$ClazzLogListSortOption(item, this.context, this.di));
  }
  tmp$_1.sortOptions = destination;
  this.view.graphData = this.graphDisplayData_0;
  launch(this.presenterScope, void 0, void 0, ClazzLogListAttendancePresenter$onCreate$lambda(this));
};
  ClazzLogListAttendancePresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  return true;
};
  function Coroutine$ClazzLogListAttendancePresenter$updateListOnView$lambda$lambda(this$ClazzLogListAttendancePresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzLogListAttendancePresenter = this$ClazzLogListAttendancePresenter_0;
  }
  Coroutine$ClazzLogListAttendancePresenter$updateListOnView$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzLogListAttendancePresenter$updateListOnView$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzLogListAttendancePresenter$updateListOnView$lambda$lambda.prototype.constructor = Coroutine$ClazzLogListAttendancePresenter$updateListOnView$lambda$lambda;
  Coroutine$ClazzLogListAttendancePresenter$updateListOnView$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        this.local$this$ClazzLogListAttendancePresenter.clazzTimeZone_0 = (tmp$_0 = (tmp$ = this.local$this$ClazzLogListAttendancePresenter.clazzWithSchool_0) != null ? effectiveTimeZone(tmp$) : null) != null ? tmp$_0 : 'UTC';
        if (this.local$this$ClazzLogListAttendancePresenter.view.clazzTimeZone == null) {
          this.local$this$ClazzLogListAttendancePresenter.handleClickGraphDuration_za3lpa$(7);
        }
        this.local$this$ClazzLogListAttendancePresenter.view.clazzTimeZone = this.local$this$ClazzLogListAttendancePresenter.clazzTimeZone_0;
        return this.local$this$ClazzLogListAttendancePresenter.view.list = this.local$this$ClazzLogListAttendancePresenter.repo.clazzLogDao.findByClazzUidAsFactory_yhmem3$(this.local$this$ClazzLogListAttendancePresenter.clazzUidFilter, 8) , Unit;
      case 1:
        throw this.exception_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 ClazzLogListAttendancePresenter$updateListOnView$lambda$lambda(this$ClazzLogListAttendancePresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzLogListAttendancePresenter$updateListOnView$lambda$lambda(this$ClazzLogListAttendancePresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ClazzLogListAttendancePresenter$updateListOnView$lambda(this$ClazzLogListAttendancePresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzLogListAttendancePresenter = this$ClazzLogListAttendancePresenter_0;
  }
  Coroutine$ClazzLogListAttendancePresenter$updateListOnView$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzLogListAttendancePresenter$updateListOnView$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzLogListAttendancePresenter$updateListOnView$lambda.prototype.constructor = Coroutine$ClazzLogListAttendancePresenter$updateListOnView$lambda;
  Coroutine$ClazzLogListAttendancePresenter$updateListOnView$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzLogListAttendancePresenter.repo.clazzDao.getClazzWithSchool_s8cxhz$(this.local$this$ClazzLogListAttendancePresenter.clazzUidFilter, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$this$ClazzLogListAttendancePresenter.clazzWithSchool_0 = this.result_0;
        this.state_0 = 3;
        this.result_0 = withContext(doorMainDispatcher(), ClazzLogListAttendancePresenter$updateListOnView$lambda$lambda(this.local$this$ClazzLogListAttendancePresenter), 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 ClazzLogListAttendancePresenter$updateListOnView$lambda(this$ClazzLogListAttendancePresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzLogListAttendancePresenter$updateListOnView$lambda(this$ClazzLogListAttendancePresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzLogListAttendancePresenter.prototype.updateListOnView_0 = function() {
  launch(this.presenterScope, void 0, void 0, ClazzLogListAttendancePresenter$updateListOnView$lambda(this));
};
  ClazzLogListAttendancePresenter.prototype.handleClickEntry_11rc$ = function(entry) {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ClazzLogEditAttendanceView$Companion_getInstance().VIEW_NAME, getKClass(ClazzLog), ClazzLog.Companion.serializer(), void 0, void 0, mutableMapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, entry.clazzLogUid.toString())])));
};
  function Coroutine$ClazzLogListAttendancePresenter$handleClickRecordAttendance$lambda(this$ClazzLogListAttendancePresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzLogListAttendancePresenter = this$ClazzLogListAttendancePresenter_0;
  }
  Coroutine$ClazzLogListAttendancePresenter$handleClickRecordAttendance$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzLogListAttendancePresenter$handleClickRecordAttendance$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzLogListAttendancePresenter$handleClickRecordAttendance$lambda.prototype.constructor = Coroutine$ClazzLogListAttendancePresenter$handleClickRecordAttendance$lambda;
  Coroutine$ClazzLogListAttendancePresenter$handleClickRecordAttendance$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzLogListAttendancePresenter.db.clazzLogDao.findByClazzUidWithinTimeRangeAsync_ttedgd$(this.local$this$ClazzLogListAttendancePresenter.clazzUidFilter, L0, Long$Companion$MAX_VALUE, 16, 1, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var lastLog = firstOrNull(this.result_0);
        if (lastLog != null) {
          return this.local$this$ClazzLogListAttendancePresenter.handleClickEntry_11rc$(lastLog) , Unit;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 3:
        return Unit;
      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 ClazzLogListAttendancePresenter$handleClickRecordAttendance$lambda(this$ClazzLogListAttendancePresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzLogListAttendancePresenter$handleClickRecordAttendance$lambda(this$ClazzLogListAttendancePresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzLogListAttendancePresenter.prototype.handleClickRecordAttendance_ng2yy3$ = function(option) {
  if (option === ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_MOST_RECENT_SCHEDULE_getInstance()) {
    launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ClazzLogListAttendancePresenter$handleClickRecordAttendance$lambda(this));
  } else {
    var $receiver = new ClazzLog();
    $receiver.clazzLogClazzUid = this.clazzUidFilter;
    $receiver.logDate = systemTimeInMillis();
    var newClazzLog = $receiver;
    this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, newClazzLog, ClazzLogEditView$Companion_getInstance().VIEW_NAME, getKClass(ClazzLog), ClazzLog.Companion.serializer(), void 0, void 0, mutableMapOf([to(UstadView$Companion_getInstance().ARG_NEXT, ClazzLogEditAttendanceView$Companion_getInstance().VIEW_NAME)])));
  }
};
  function Coroutine$ClazzLogListAttendancePresenter$handleClickCreateNewFab$lambda(this$ClazzLogListAttendancePresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ClazzLogListAttendancePresenter = this$ClazzLogListAttendancePresenter_0;
  }
  Coroutine$ClazzLogListAttendancePresenter$handleClickCreateNewFab$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzLogListAttendancePresenter$handleClickCreateNewFab$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzLogListAttendancePresenter$handleClickCreateNewFab$lambda.prototype.constructor = Coroutine$ClazzLogListAttendancePresenter$handleClickCreateNewFab$lambda;
  Coroutine$ClazzLogListAttendancePresenter$handleClickCreateNewFab$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$ClazzLogListAttendancePresenter.db.clazzLogDao.findByClazzUidWithinTimeRangeAsync_ttedgd$(this.local$this$ClazzLogListAttendancePresenter.clazzUidFilter, L0, Long$Companion$MAX_VALUE, 16, 1, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var lastLog = firstOrNull(this.result_0);
        if (lastLog != null) {
          return this.local$this$ClazzLogListAttendancePresenter.handleClickEntry_11rc$(lastLog) , Unit;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 3:
        return Unit;
      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 ClazzLogListAttendancePresenter$handleClickCreateNewFab$lambda(this$ClazzLogListAttendancePresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzLogListAttendancePresenter$handleClickCreateNewFab$lambda(this$ClazzLogListAttendancePresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzLogListAttendancePresenter.prototype.handleClickCreateNewFab = function() {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ClazzLogListAttendancePresenter$handleClickCreateNewFab$lambda(this));
};
  ClazzLogListAttendancePresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
};
  ClazzLogListAttendancePresenter.prototype.handleClickGraphDuration_za3lpa$ = function(days) {
  var tmp$, tmp$_0, tmp$_1;
  var $receiver = toOffsetByTimezone(DateTime.Companion.now(), (tmp$ = this.clazzTimeZone_0) != null ? tmp$ : 'UTC');
  var $receiver_0 = $receiver.hours;
  var tmp$_2 = TimeSpan.Companion.fromHours_14dthe$($receiver_0);
  var $receiver_1 = $receiver.minutes;
  var tmp$_3 = tmp$_2.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_1));
  var $receiver_2 = $receiver.seconds;
  var tmp$_4 = tmp$_3.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_2));
  var $receiver_3 = $receiver.milliseconds;
  var endOfDay = $receiver.minus_fv8bff$(tmp$_4.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_3))).plus_fv8bff$(TimeSpan.Companion.fromHours_14dthe$(24)).minus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$(1)).utc.unixMillisLong;
  this.graphDateRange_0 = to(endOfDay.subtract(TimeSpan.Companion.fromDays_14dthe$(days).millisecondsLong), endOfDay);
    (tmp$_0 = this.graphDbData_0) != null ? (tmp$_0.removeObserver_jsfaok$(this.graphObserver_0) , Unit) : null;
  this.graphDbData_0 = this.repo.clazzLogDao.findByClazzUidWithinTimeRangeLive_kxxcc5$(this.clazzUidFilter, this.graphDateRange_0.first, this.graphDateRange_0.second, 4);
    (tmp$_1 = this.graphDbData_0) != null ? (tmp$_1.observe_igxi3b$(this.lifecycleOwner, this.graphObserver_0) , Unit) : null;
};
  ClazzLogListAttendancePresenter.prototype.handleClickSortOrder_iowaj7$ = function(sortOption) {
  var tmp$, tmp$_0, tmp$_1;
  tmp$_1 = (tmp$_0 = Kotlin.isType(tmp$ = sortOption, ClazzLogListAttendancePresenter$ClazzLogListSortOption) ? tmp$ : null) != null ? tmp$_0.sortOrder : null;
  if (tmp$_1 == null) {
    return;
  }
  var sortOrder = tmp$_1;
  if (sortOrder !== this.currentSortOrder) {
    this.currentSortOrder = sortOrder;
    this.updateListOnView_0();
  }
};
  function ClazzLogListAttendancePresenter$graphObserver$ObjectLiteral(this$ClazzLogListAttendancePresenter) {
    this.this$ClazzLogListAttendancePresenter = this$ClazzLogListAttendancePresenter;
  }
  ClazzLogListAttendancePresenter$graphObserver$ObjectLiteral.prototype.onChanged_11rb$ = function(t) {
  var tmp$ = this.this$ClazzLogListAttendancePresenter.graphDisplayData_0;
  var destination = ArrayList_init_0(collectionSizeOrDefault(t, 10));
  var tmp$_0;
  tmp$_0 = t.iterator();
  while (tmp$_0.hasNext()) {
    var item = tmp$_0.next();
    destination.add_11rb$(to(item.logDate, attendancePercentage(item)));
  }
  var destination_0 = ArrayList_init_0(collectionSizeOrDefault(t, 10));
  var tmp$_1;
  tmp$_1 = t.iterator();
  while (tmp$_1.hasNext()) {
    var item_0 = tmp$_1.next();
    destination_0.add_11rb$(to(item_0.logDate, latePercentage(item_0)));
  }
  tmp$.sendValue_11rb$(new ClazzLogListAttendancePresenter$AttendanceGraphData(destination, destination_0, this.this$ClazzLogListAttendancePresenter.graphDateRange_0));
};
  ClazzLogListAttendancePresenter$graphObserver$ObjectLiteral.$metadata$ = {
  kind: Kind_CLASS, 
  interfaces: [DoorObserver]};
  ClazzLogListAttendancePresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzLogListAttendancePresenter', 
  interfaces: [UstadListPresenter]};
  function ClazzMemberListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    ClazzMemberListPresenter$Companion_getInstance();
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    var tmp$;
    this.json_33yni7$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, ClazzMemberListPresenter$json_metadata);
    this.filterByClazzUid_0 = L_1;
    this.searchText = null;
  }
  var ClazzMemberListPresenter$json_metadata = new PropertyMetadata('json');
  Object.defineProperty(ClazzMemberListPresenter.prototype, 'json_0', {
  configurable: true, 
  get: function() {
  return this.json_33yni7$_0.value;
}});
  Object.defineProperty(ClazzMemberListPresenter.prototype, 'sortOptions', {
  configurable: true, 
  get: function() {
  return ClazzMemberListPresenter$Companion_getInstance().SORT_OPTIONS;
}});
  ClazzMemberListPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0;
  this.filterByClazzUid_0 = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L_1;
  UstadListPresenter.prototype.onCreate.call(this, savedState);
};
  ClazzMemberListPresenter.prototype.onPause = function() {
  this.searchText = '';
  this.updateListOnView_0();
};
  ClazzMemberListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  return false;
};
  function Coroutine$onLoadFromDb($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$ = void 0;
    this.local$tmp$_0 = void 0;
  }
  Coroutine$onLoadFromDb.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadFromDb.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadFromDb.prototype.constructor = Coroutine$onLoadFromDb;
  Coroutine$onLoadFromDb.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = UstadListPresenter.prototype.onLoadFromDb.call(this.$this, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.$this.mLoggedInPersonUid = this.$this.accountManager.activeAccount.personUid;
        this.local$tmp$ = this.$this.view;
        this.state_0 = 3;
        this.result_0 = this.$this.db.clazzDao.personHasPermissionWithClazz_b9bd0d$(this.$this.mLoggedInPersonUid, this.$this.filterByClazzUid_0, Role$Companion$PERMISSION_CLAZZ_ADD_STUDENT, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$tmp$.addStudentVisible = this.result_0;
        this.state_0 = 4;
        this.result_0 = this.$this.db.courseTerminologyDao.getTerminologyForClazz_s8cxhz$(this.$this.filterByClazzUid_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        var terminology = this.result_0;
        this.$this.view.termMap = toTermMap(terminology, this.$this.json_0, this.$this.systemImpl, this.$this.context);
        this.$this.selectedSortOption = ClazzMemberListPresenter$Companion_getInstance().SORT_OPTIONS.get_za3lpa$(0);
        this.$this.view.listFilterOptionChips = toListFilterOptions(ClazzMemberListPresenter$Companion_getInstance().FILTER_OPTIONS, this.$this.context, this.$this.di);
        this.$this.updateListOnView_0();
        this.local$tmp$_0 = this.$this.view;
        this.state_0 = 5;
        this.result_0 = this.$this.db.clazzDao.personHasPermissionWithClazz_b9bd0d$(this.$this.mLoggedInPersonUid, this.$this.filterByClazzUid_0, Role$Companion$PERMISSION_CLAZZ_ADD_TEACHER, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        this.local$tmp$_0.addTeacherVisible = this.result_0;
        return;
      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);
};
  ClazzMemberListPresenter.prototype.onLoadFromDb = function(continuation_0, suspended) {
  var instance = new Coroutine$onLoadFromDb(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ClazzMemberListPresenter.prototype.updateListOnView_0 = function() {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6, tmp$_7, tmp$_8, tmp$_9, tmp$_10;
  this.view.list = this.repo.clazzEnrolmentDao.findByClazzUidAndRole_i7yiqk$(this.filterByClazzUid_0, 1001, (tmp$_0 = (tmp$ = this.selectedSortOption) != null ? tmp$.flag : null) != null ? tmp$_0 : 0, toQueryLikeParam(this.searchText), (tmp$_2 = (tmp$_1 = this.view.checkedFilterOptionChip) != null ? tmp$_1.optionId : null) != null ? tmp$_2 : 1, this.mLoggedInPersonUid, systemTimeInMillis());
  this.view.studentList = this.repo.clazzEnrolmentDao.findByClazzUidAndRole_i7yiqk$(this.filterByClazzUid_0, 1000, (tmp$_4 = (tmp$_3 = this.selectedSortOption) != null ? tmp$_3.flag : null) != null ? tmp$_4 : 0, toQueryLikeParam(this.searchText), (tmp$_6 = (tmp$_5 = this.view.checkedFilterOptionChip) != null ? tmp$_5.optionId : null) != null ? tmp$_6 : 1, this.mLoggedInPersonUid, systemTimeInMillis());
  if (this.view.addStudentVisible) {
    this.view.pendingStudentList = this.db.clazzEnrolmentDao.findByClazzUidAndRole_i7yiqk$(this.filterByClazzUid_0, 1002, (tmp$_8 = (tmp$_7 = this.selectedSortOption) != null ? tmp$_7.flag : null) != null ? tmp$_8 : 0, toQueryLikeParam(this.searchText), (tmp$_10 = (tmp$_9 = this.view.checkedFilterOptionChip) != null ? tmp$_9.optionId : null) != null ? tmp$_10 : 1, this.mLoggedInPersonUid, systemTimeInMillis());
  }
};
  ClazzMemberListPresenter.prototype.handleClickEntry_11rc$ = function(entry) {
  this.systemImpl.go_gofqk3$(ClazzEnrolmentListView$Companion_getInstance().VIEW_NAME, mapOf([to(UstadView$Companion_getInstance().ARG_PERSON_UID, entry.personUid.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZUID, this.filterByClazzUid_0.toString()), to(UstadView$Companion_getInstance().ARG_FILTER_BY_ENROLMENT_ROLE, entry.enrolmentRole.toString())]), this.context);
};
  function Coroutine$ClazzMemberListPresenter$handleClickPendingRequest$lambda(closure$approved_0, this$ClazzMemberListPresenter_0, closure$enrolmentDetails_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 7;
    this.local$closure$approved = closure$approved_0;
    this.local$this$ClazzMemberListPresenter = this$ClazzMemberListPresenter_0;
    this.local$closure$enrolmentDetails = closure$enrolmentDetails_0;
  }
  Coroutine$ClazzMemberListPresenter$handleClickPendingRequest$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ClazzMemberListPresenter$handleClickPendingRequest$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ClazzMemberListPresenter$handleClickPendingRequest$lambda.prototype.constructor = Coroutine$ClazzMemberListPresenter$handleClickPendingRequest$lambda;
  Coroutine$ClazzMemberListPresenter$handleClickPendingRequest$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.exceptionState_0 = 4;
        if (this.local$closure$approved) {
          this.state_0 = 2;
          this.result_0 = approvePendingClazzEnrolment(this.local$this$ClazzMemberListPresenter.repo, this.local$closure$enrolmentDetails, this.local$this$ClazzMemberListPresenter.filterByClazzUid_0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 1;
          this.result_0 = declinePendingClazzEnrolment(this.local$this$ClazzMemberListPresenter.repo, this.local$closure$enrolmentDetails, this.local$this$ClazzMemberListPresenter.filterByClazzUid_0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 1:
        return Unit;
      case 2:
        return Unit;
      case 3:
        this.exceptionState_0 = 7;
        this.state_0 = 6;
        continue;
      case 4:
        this.exceptionState_0 = 7;
        var e = this.exception_0;
        if (Kotlin.isType(e, IllegalStateException)) {
          this.local$this$ClazzMemberListPresenter.view.showSnackBar_9pu0dj$(this.local$this$ClazzMemberListPresenter.systemImpl.getString(2180, this.local$this$ClazzMemberListPresenter.context) + e.message);
          return napier.Napier.e_82mfvz$('Exception approving member', e) , Unit;
        } else {
          throw e;
        }
      case 5:
        this.state_0 = 6;
        continue;
      case 6:
        return;
      case 7:
        throw this.exception_0;
      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);
};
  function ClazzMemberListPresenter$handleClickPendingRequest$lambda(closure$approved_0, this$ClazzMemberListPresenter_0, closure$enrolmentDetails_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ClazzMemberListPresenter$handleClickPendingRequest$lambda(closure$approved_0, this$ClazzMemberListPresenter_0, closure$enrolmentDetails_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ClazzMemberListPresenter.prototype.handleClickPendingRequest_7mxlo2$ = function(enrolmentDetails, approved) {
  launch(this.presenterScope, void 0, void 0, ClazzMemberListPresenter$handleClickPendingRequest$lambda(approved, this, enrolmentDetails));
};
  ClazzMemberListPresenter.prototype.handleClickCreateNewFab = function() {
};
  ClazzMemberListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
};
  ClazzMemberListPresenter.prototype.onClickSort_o8nuns$ = function(sortOption) {
  UstadListPresenter.prototype.onClickSort_o8nuns$.call(this, sortOption);
  this.updateListOnView_0();
};
  ClazzMemberListPresenter.prototype.onSearchSubmitted_pdl1vj$ = function(text) {
  this.searchText = text;
  this.updateListOnView_0();
};
  ClazzMemberListPresenter.prototype.onListFilterOptionSelected_5mmfk3$ = function(filterOptionId) {
  UstadListPresenter.prototype.onListFilterOptionSelected_5mmfk3$.call(this, filterOptionId);
  this.updateListOnView_0();
};
  ClazzMemberListPresenter.prototype.handlePickNewMemberClicked_za3lpa$ = function(role) {
  var tmp$, tmp$_0;
  var $receiver = mutableMapOf([to(PersonListView$Companion_getInstance().ARG_FILTER_EXCLUDE_MEMBERSOFCLAZZ, this.filterByClazzUid_0.toString()), to(UstadView$Companion_getInstance().ARG_FILTER_BY_ENROLMENT_ROLE, role.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZUID, (tmp$_0 = (tmp$ = this.arguments) != null ? tmp$.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID) : null) != null ? tmp$_0 : '-1'), to(UstadView$Companion_getInstance().ARG_GO_TO_COMPLETE, ClazzEnrolmentEditView$Companion_getInstance().VIEW_NAME), to(UstadView$Companion_getInstance().ARG_POPUPTO_ON_FINISH, ClazzMemberListView$Companion_getInstance().VIEW_NAME), to(ClazzMemberListView$Companion_getInstance().ARG_HIDE_CLAZZES, true.toString()), to(UstadView$Companion_getInstance().ARG_SAVE_TO_DB, true.toString())]);
  if (role === 1000) {
    var key = UstadView$Companion_getInstance().ARG_CODE_TABLE;
    var value = (6).toString();
    $receiver.put_xwzc9p$(key, value);
  }
  var args = $receiver;
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, PersonListView$Companion_getInstance().VIEW_NAME, getKClass(ClazzEnrolment), ClazzEnrolment.Companion.serializer(), ClazzMemberListPresenter$Companion_getInstance().RESULT_PERSON_KEY, true, toMutableMap(args)));
};
  function ClazzMemberListPresenter$Companion() {
    ClazzMemberListPresenter$Companion_instance = this;
    this.SORT_OPTIONS = listOf([new SortOrderOption(2038, 1, true), new SortOrderOption(2038, 2, false), new SortOrderOption(2037, 3, true), new SortOrderOption(2037, 4, false), new SortOrderOption(2068, 5, true), new SortOrderOption(2068, 6, false), new SortOrderOption(2369, 7, true), new SortOrderOption(2369, 8, false), new SortOrderOption(2370, 9, true), new SortOrderOption(2370, 10, false)]);
    this.FILTER_OPTIONS = listOf([to(2438, 1), to(2431, 0)]);
    this.RESULT_PERSON_KEY = 'person';
  }
  ClazzMemberListPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzMemberListPresenter$Companion_instance = null;
  function ClazzMemberListPresenter$Companion_getInstance() {
    if (ClazzMemberListPresenter$Companion_instance === null) {
      new ClazzMemberListPresenter$Companion();
    }
    return ClazzMemberListPresenter$Companion_instance;
  }
  ClazzMemberListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzMemberListPresenter', 
  interfaces: [UstadListPresenter, OnSearchSubmitted, OnSortOptionSelected]};
  function CommentListener() {
  }
  CommentListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'CommentListener', 
  interfaces: []};
  function ContentEntryAddOptionsListener() {
  }
  ContentEntryAddOptionsListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContentEntryAddOptionsListener', 
  interfaces: []};
  function ContentEntryDetailAttemptsListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    ContentEntryDetailAttemptsListPresenter$Companion_getInstance();
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.contentEntryUid_0 = L0;
    this.searchText = null;
  }
  Object.defineProperty(ContentEntryDetailAttemptsListPresenter.prototype, 'sortOptions', {
  configurable: true, 
  get: function() {
  return ContentEntryDetailAttemptsListPresenter$Companion_getInstance().SORT_OPTIONS;
}});
  ContentEntryDetailAttemptsListPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0;
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.selectedSortOption = ContentEntryDetailAttemptsListPresenter$Companion_getInstance().SORT_OPTIONS.get_za3lpa$(0);
  this.contentEntryUid_0 = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
};
  ContentEntryDetailAttemptsListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  return false;
};
  function Coroutine$onLoadFromDb_0($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
  }
  Coroutine$onLoadFromDb_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadFromDb_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadFromDb_0.prototype.constructor = Coroutine$onLoadFromDb_0;
  Coroutine$onLoadFromDb_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = UstadListPresenter.prototype.onLoadFromDb.call(this.$this, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.$this.mLoggedInPersonUid = this.$this.accountManager.activeAccount.personUid;
        this.$this.updateListOnView_0();
        return;
      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);
};
  ContentEntryDetailAttemptsListPresenter.prototype.onLoadFromDb = function(continuation_0, suspended) {
  var instance = new Coroutine$onLoadFromDb_0(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ContentEntryDetailAttemptsListPresenter.prototype.onClickSort_o8nuns$ = function(sortOption) {
  UstadListPresenter.prototype.onClickSort_o8nuns$.call(this, sortOption);
  this.updateListOnView_0();
};
  ContentEntryDetailAttemptsListPresenter.prototype.updateListOnView_0 = function() {
  var tmp$, tmp$_0;
  this.view.list = this.repo.statementDao.findPersonsWithContentEntryAttempts_vqkbx2$(this.contentEntryUid_0, this.mLoggedInPersonUid, toQueryLikeParam(this.searchText), (tmp$_0 = (tmp$ = this.selectedSortOption) != null ? tmp$.flag : null) != null ? tmp$_0 : 1);
};
  ContentEntryDetailAttemptsListPresenter.prototype.onSearchSubmitted_pdl1vj$ = function(text) {
  this.searchText = text;
  this.updateListOnView_0();
};
  ContentEntryDetailAttemptsListPresenter.prototype.handleClickCreateNewFab = function() {
};
  ContentEntryDetailAttemptsListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
};
  ContentEntryDetailAttemptsListPresenter.prototype.onClickPersonWithStatementDisplay_nhm5s1$ = function(personWithAttemptsSummary) {
  this.systemImpl.go_gofqk3$(SessionListView$Companion_getInstance().VIEW_NAME, mapOf([to(UstadView$Companion_getInstance().ARG_CONTENT_ENTRY_UID, this.contentEntryUid_0.toString()), to(UstadView$Companion_getInstance().ARG_PERSON_UID, personWithAttemptsSummary.personUid.toString())]), this.context);
};
  function ContentEntryDetailAttemptsListPresenter$Companion() {
    ContentEntryDetailAttemptsListPresenter$Companion_instance = this;
    this.SORT_OPTIONS = listOf([new SortOrderOption(2038, 1, true), new SortOrderOption(2038, 2, false), new SortOrderOption(2037, 3, true), new SortOrderOption(2037, 4, false), new SortOrderOption(2516, 5, true), new SortOrderOption(2516, 6, false)]);
  }
  ContentEntryDetailAttemptsListPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ContentEntryDetailAttemptsListPresenter$Companion_instance = null;
  function ContentEntryDetailAttemptsListPresenter$Companion_getInstance() {
    if (ContentEntryDetailAttemptsListPresenter$Companion_instance === null) {
      new ContentEntryDetailAttemptsListPresenter$Companion();
    }
    return ContentEntryDetailAttemptsListPresenter$Companion_instance;
  }
  ContentEntryDetailAttemptsListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContentEntryDetailAttemptsListPresenter', 
  interfaces: [AttemptListListener, UstadListPresenter, OnSearchSubmitted, OnSortOptionSelected]};
  function ContentEntryDetailOverviewPresenter(context, arguments_0, view, di, lifecycleOwner) {
    ContentEntryDetailOverviewPresenter$Companion_getInstance();
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    var tag = UstadMobileSystemCommon$Companion_getInstance().TAG_DOWNLOAD_ENABLED;
    var tmp$;
    this.isPlatformDownloadEnabled_vgyyom$_0 = Instance(di, Kotlin.isType(tmp$ = typeToken(createKType(PrimitiveClasses$booleanClass, [], false)), TypeToken) ? tmp$ : throwCCE(), tag).provideDelegate_tpuvb9$(this, ContentEntryDetailOverviewPresenter$isPlatformDownloadEnabled_metadata);
    var context_0 = this.accountManager.activeAccount;
    var trigger;
    trigger = di.diTrigger;
    var tmp$_0;
    var tmp$_1;
    this.contentEntryOpener_xfdzvm$_0 = Instance(On(di, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_0 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(ContentEntryOpener), [], false)), TypeToken) ? tmp$_1 : throwCCE(), null).provideDelegate_tpuvb9$(this, ContentEntryDetailOverviewPresenter$contentEntryOpener_metadata);
    var context_1 = this.accountManager.activeAccount;
    var trigger_0;
    trigger_0 = this.diTrigger;
    var tmp$_2;
    var tmp$_3;
    this.statementEndpoint_mn9fry$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_2 : throwCCE(), context_1), trigger_0), Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(XapiStatementEndpoint), [], false)), TypeToken) ? tmp$_3 : throwCCE(), null).provideDelegate_tpuvb9$(this, ContentEntryDetailOverviewPresenter$statementEndpoint_metadata);
    this.contentEntryUid_0 = L0;
    this.clazzUid_0 = L0;
    this.contextRegistration_0 = null;
  }
  Object.defineProperty(ContentEntryDetailOverviewPresenter.prototype, 'deepLink', {
  configurable: true, 
  get: function() {
  var tmp$;
  var activeEndpoint = get_direct(this.di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$ : throwCCE(), null).activeAccount.endpointUrl;
  return toDeepLink_0(this.arguments, activeEndpoint, ContentEntryDetailView$Companion_getInstance().VIEW_NAME);
}});
  var ContentEntryDetailOverviewPresenter$isPlatformDownloadEnabled_metadata = new PropertyMetadata('isPlatformDownloadEnabled');
  Object.defineProperty(ContentEntryDetailOverviewPresenter.prototype, 'isPlatformDownloadEnabled_0', {
  configurable: true, 
  get: function() {
  return this.isPlatformDownloadEnabled_vgyyom$_0.value;
}});
  var ContentEntryDetailOverviewPresenter$contentEntryOpener_metadata = new PropertyMetadata('contentEntryOpener');
  Object.defineProperty(ContentEntryDetailOverviewPresenter.prototype, 'contentEntryOpener_0', {
  configurable: true, 
  get: function() {
  return this.contentEntryOpener_xfdzvm$_0.value;
}});
  Object.defineProperty(ContentEntryDetailOverviewPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  var ContentEntryDetailOverviewPresenter$statementEndpoint_metadata = new PropertyMetadata('statementEndpoint');
  Object.defineProperty(ContentEntryDetailOverviewPresenter.prototype, 'statementEndpoint', {
  configurable: true, 
  get: function() {
  return this.statementEndpoint_mn9fry$_0.value;
}});
  ContentEntryDetailOverviewPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  UstadDetailPresenter.prototype.onCreate.call(this, savedState);
  this.contentEntryUid_0 = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  this.clazzUid_0 = (tmp$_2 = (tmp$_1 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0;
};
  function Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda;
  Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$closure$db.contentEntryDao.findEntryWithContainerByEntryId_s8cxhz$(this.local$closure$entityUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_0(closure$db_0, closure$entityUid_0, this$ContentEntryDetailOverviewPresenter_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$this$ContentEntryDetailOverviewPresenter = this$ContentEntryDetailOverviewPresenter_0;
  }
  Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_0.prototype.constructor = Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_0;
  Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$closure$db.contentEntryDao.buttonsToShowForContentEntry_2gd3um$(this.local$closure$entityUid, this.local$this$ContentEntryDetailOverviewPresenter.isPlatformDownloadEnabled_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_0(closure$db_0, closure$entityUid_0, this$ContentEntryDetailOverviewPresenter_0) {
    return function(continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_0(closure$db_0, closure$entityUid_0, this$ContentEntryDetailOverviewPresenter_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_1(this$ContentEntryDetailOverviewPresenter) {
    return function(it) {
  if (it == null) 
    return;
  this$ContentEntryDetailOverviewPresenter.view.contentEntryButtons = it;
  return Unit;
};
  }
  function Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_1(closure$db_0, this$ContentEntryDetailOverviewPresenter_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$this$ContentEntryDetailOverviewPresenter = this$ContentEntryDetailOverviewPresenter_0;
  }
  Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_1.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_1.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_1.prototype.constructor = Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_1;
  Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_1.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$closure$db.contentJobItemDao.findActiveContentJobItems_s8cxhz$(this.local$this$ContentEntryDetailOverviewPresenter.contentEntryUid_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_2(closure$db_0, this$ContentEntryDetailOverviewPresenter_0) {
    return function(continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_1(closure$db_0, this$ContentEntryDetailOverviewPresenter_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_3(this$ContentEntryDetailOverviewPresenter) {
    return function(it) {
  if (it == null) {
    return;
  }
  var progress = it;
  this$ContentEntryDetailOverviewPresenter.view.activeContentJobItems = progress;
  return Unit;
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_6($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$_2 = void 0;
    this.local$entityUid = void 0;
    this.local$entity = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_6.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_6.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_6.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_6;
  Coroutine$onLoadEntityFromDb_7hogkd$_6.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        this.local$entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = withTimeoutOrNull(L2000, ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda(this.local$db, this.local$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$entity = (tmp$_1 = this.result_0) != null ? tmp$_1 : new ContentEntryWithMostRecentContainer();
        var result = this.local$db.contentEntryRelatedEntryJoinDao.findAllTranslationsWithContentEntryUid(this.local$entityUid);
        this.$this.view.availableTranslationsList = result;
        this.local$tmp$_2 = this.$this.view;
        this.state_0 = 3;
        this.result_0 = this.local$db.statementDao.getBestScoreForContentForPerson_3pjtqy$(this.local$entityUid, this.$this.accountManager.activeAccount.personUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$tmp$_2.scoreProgress = this.result_0;
        if (this.local$entity.completionCriteria === 2) {
          this.state_0 = 4;
          this.result_0 = this.local$db.statementDao.findLatestRegistrationStatement_3pjtqy$(this.$this.accountManager.activeAccount.personUid, this.local$entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.$this.view.markCompleteVisible = false;
          this.state_0 = 5;
          continue;
        }
      case 4:
        this.$this.contextRegistration_0 = this.result_0;
        this.$this.view.markCompleteVisible = this.$this.contextRegistration_0 != null;
        this.state_0 = 5;
        continue;
      case 5:
        if (!Kotlin.isType(this.local$db, DoorDatabaseRepository)) {
          observeWithLifecycleOwner(new RateLimitedLiveData(this.local$db, listOf(['Container', 'ContentEntry', 'ContentJobItem']), void 0, ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_0(this.local$db, this.local$entityUid, this.$this)), this.$this.lifecycleOwner, ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_1(this.$this));
          observeWithLifecycleOwner(new RateLimitedLiveData(this.local$db, ContentEntryDetailOverviewPresenter$Companion_getInstance().CONTENT_JOB_ITEM_TABLE_LIST_0, L1000, ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_2(this.local$db, this.$this)), this.$this.lifecycleOwner, ContentEntryDetailOverviewPresenter$onLoadEntityFromDb$lambda_3(this.$this));
        }
        return this.local$entity;
      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);
};
  ContentEntryDetailOverviewPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_6(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ContentEntryDetailOverviewPresenter.prototype.handleClickEdit = function() {
  var tmp$;
  var args = mutableMapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, toString((tmp$ = this.entity) != null ? tmp$.contentEntryUid : null)), to(UstadView$Companion_getInstance().ARG_LEAF, true.toString())]);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ContentEntryEdit2View$Companion_getInstance().VIEW_NAME, getKClass(ContentEntry), ContentEntry.Companion.serializer(), void 0, void 0, args));
};
  ContentEntryDetailOverviewPresenter.prototype.handleClickOpenButton = function() {
  this.openContentEntry_0();
};
  ContentEntryDetailOverviewPresenter.prototype.handleClickDownloadButton = function() {
  var tmp$, tmp$_0, tmp$_1;
  this.view.showDownloadDialog_y0zsll$(mapOf_0(to(UstadView$Companion_getInstance().ARG_CONTENT_ENTRY_UID, (tmp$_1 = (tmp$_0 = (tmp$ = this.entity) != null ? tmp$.contentEntryUid : null) != null ? tmp$_0.toString() : null) != null ? tmp$_1 : '0')));
};
  ContentEntryDetailOverviewPresenter.prototype.handleOnClickManageDownload = function() {
  var tmp$, tmp$_0, tmp$_1;
  this.view.showDownloadDialog_y0zsll$(mapOf_0(to(UstadView$Companion_getInstance().ARG_CONTENT_ENTRY_UID, (tmp$_1 = (tmp$_0 = (tmp$ = this.entity) != null ? tmp$.contentEntryUid : null) != null ? tmp$_0.toString() : null) != null ? tmp$_1 : '0')));
};
  function Coroutine$ContentEntryDetailOverviewPresenter$openContentEntry$lambda(this$ContentEntryDetailOverviewPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 8;
    this.local$this$ContentEntryDetailOverviewPresenter = this$ContentEntryDetailOverviewPresenter_0;
    this.local$tmp$_0 = void 0;
    this.local$tmp$_1 = void 0;
  }
  Coroutine$ContentEntryDetailOverviewPresenter$openContentEntry$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryDetailOverviewPresenter$openContentEntry$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryDetailOverviewPresenter$openContentEntry$lambda.prototype.constructor = Coroutine$ContentEntryDetailOverviewPresenter$openContentEntry$lambda;
  Coroutine$ContentEntryDetailOverviewPresenter$openContentEntry$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.exceptionState_0 = 3;
        if ((this.local$tmp$_0 = (tmp$ = this.local$this$ContentEntryDetailOverviewPresenter.entity) != null ? tmp$.contentEntryUid : null) != null) {
          var this$ContentEntryDetailOverviewPresenter = this.local$this$ContentEntryDetailOverviewPresenter;
          var tmp$_0, tmp$_1;
          this.state_0 = 1;
          this.result_0 = this$ContentEntryDetailOverviewPresenter.contentEntryOpener_0.openEntry_6luryd$(this$ContentEntryDetailOverviewPresenter.context, this.local$tmp$_0, this$ContentEntryDetailOverviewPresenter.isPlatformDownloadEnabled_0, false, (tmp$_1 = (tmp$_0 = this$ContentEntryDetailOverviewPresenter.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_NO_IFRAMES)) != null ? toBoolean(tmp$_0) : null) != null ? tmp$_1 : false, void 0, this$ContentEntryDetailOverviewPresenter.clazzUid_0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.local$tmp$_1 = null;
          this.state_0 = 2;
          continue;
        }
      case 1:
        this.local$tmp$_1 = this.local$tmp$_0;
        this.state_0 = 2;
        continue;
      case 2:
        return this.local$tmp$_1;
      case 3:
        this.exceptionState_0 = 8;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          if (Kotlin.isType(e, NoAppFoundException)) {
            return this.local$this$ContentEntryDetailOverviewPresenter.view.showSnackBar_9pu0dj$(this.local$this$ContentEntryDetailOverviewPresenter.systemImpl.getString(2166, this.local$this$ContentEntryDetailOverviewPresenter.context)) , Unit;
          } else {
            var message = e.message;
            if (message != null) {
              return this.local$this$ContentEntryDetailOverviewPresenter.view.showSnackBar_9pu0dj$(message) , Unit;
            } else {
              this.state_0 = 4;
              continue;
            }
          }
        } else {
          throw e;
        }
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        this.state_0 = 6;
        continue;
      case 6:
        this.state_0 = 7;
        continue;
      case 7:
        return Unit;
      case 8:
        throw this.exception_0;
      default:
        this.state_0 = 8;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 8) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function ContentEntryDetailOverviewPresenter$openContentEntry$lambda(this$ContentEntryDetailOverviewPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryDetailOverviewPresenter$openContentEntry$lambda(this$ContentEntryDetailOverviewPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentEntryDetailOverviewPresenter.prototype.openContentEntry_0 = function() {
  launch(this.presenterScope, doorMainDispatcher(), void 0, ContentEntryDetailOverviewPresenter$openContentEntry$lambda(this));
};
  ContentEntryDetailOverviewPresenter.prototype.handleOnTranslationClicked_s8cxhz$ = function(entryUid) {
  this.systemImpl.go_gofqk3$(ContentEntryDetailView$Companion_getInstance().VIEW_NAME, mapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, entryUid.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZUID, this.clazzUid_0.toString())]), this.context);
};
  ContentEntryDetailOverviewPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  var tmp$, tmp$_0;
  return this.db.contentEntryDao.personHasPermissionWithContentEntry_b9bd0d$(this.accountManager.activeAccount.personUid, (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0, Role$Companion$PERMISSION_CONTENT_UPDATE, continuation);
};
  function Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda$lambda(this$ContentEntryDetailOverviewPresenter_0, txDb_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$this$ContentEntryDetailOverviewPresenter = this$ContentEntryDetailOverviewPresenter_0;
    this.local$$receiver = void 0;
    this.local$job = void 0;
    this.local$txDb = txDb_0;
  }
  Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda$lambda.prototype.constructor = Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda$lambda;
  Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$$receiver = new ContentJob();
        var this$ContentEntryDetailOverviewPresenter = this.local$this$ContentEntryDetailOverviewPresenter;
        var tmp$, tmp$_0;
        this.local$$receiver.cjNotificationTitle = replace(this$ContentEntryDetailOverviewPresenter.systemImpl.getString(2754, this$ContentEntryDetailOverviewPresenter.context), '%1$s', (tmp$_0 = (tmp$ = this$ContentEntryDetailOverviewPresenter.entity) != null ? tmp$.title : null) != null ? tmp$_0 : '');
        this.state_0 = 2;
        this.result_0 = this.local$txDb.contentJobDao.insertAsync_d5tex6$(this.local$$receiver, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$$receiver.cjUid = this.result_0;
        this.local$job = this.local$$receiver;
        var tmp$_1 = this.local$txDb.contentJobItemDao;
        var $receiver = new ContentJobItem();
        var this$ContentEntryDetailOverviewPresenter_0 = this.local$this$ContentEntryDetailOverviewPresenter;
        var tmp$_2, tmp$_3, tmp$_4;
        $receiver.cjiJobUid = this.local$job.cjUid;
        $receiver.cjiContentEntryUid = (tmp$_3 = (tmp$_2 = this$ContentEntryDetailOverviewPresenter_0.entity) != null ? tmp$_2.contentEntryUid : null) != null ? tmp$_3 : L0;
        $receiver.cjiPluginId = 14;
        $receiver.cjiIsLeaf = true;
        $receiver.cjiConnectivityNeeded = false;
        $receiver.cjiStatus = 4;
        $receiver.sourceUri = (tmp$_4 = this$ContentEntryDetailOverviewPresenter_0.entity) != null ? toDeepLink(tmp$_4, this$ContentEntryDetailOverviewPresenter_0.accountManager.activeEndpoint) : null;
        this.state_0 = 3;
        this.result_0 = tmp$_1.insertJobItem_letzpf$($receiver, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        return this.local$job;
      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 ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda$lambda(this$ContentEntryDetailOverviewPresenter_0) {
    return function(txDb_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda$lambda(this$ContentEntryDetailOverviewPresenter_0, txDb_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda(this$ContentEntryDetailOverviewPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ContentEntryDetailOverviewPresenter = this$ContentEntryDetailOverviewPresenter_0;
  }
  Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda.prototype.constructor = Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda;
  Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = withDoorTransactionAsync(this.local$this$ContentEntryDetailOverviewPresenter.db, getKClass(UmAppDatabase), ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda$lambda(this.local$this$ContentEntryDetailOverviewPresenter), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var job = this.result_0;
        var tmp$;
        var contentJobManager = get_direct(this.local$this$ContentEntryDetailOverviewPresenter.di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(ContentJobManager), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
        return contentJobManager.enqueueContentJob_iy18aq$(this.local$this$ContentEntryDetailOverviewPresenter.accountManager.activeEndpoint, job.cjUid) , Unit;
      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 ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda(this$ContentEntryDetailOverviewPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda(this$ContentEntryDetailOverviewPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentEntryDetailOverviewPresenter.prototype.handleOnClickConfirmDelete = function() {
  launch(this.presenterScope, void 0, void 0, ContentEntryDetailOverviewPresenter$handleOnClickConfirmDelete$lambda(this));
};
  function Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickGroupActivityButton$lambda(this$ContentEntryDetailOverviewPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ContentEntryDetailOverviewPresenter = this$ContentEntryDetailOverviewPresenter_0;
    this.local$$receiver = void 0;
    this.local$learnerGroup = void 0;
    this.local$$receiver_0 = void 0;
    this.local$$receiver_1 = void 0;
  }
  Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickGroupActivityButton$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickGroupActivityButton$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickGroupActivityButton$lambda.prototype.constructor = Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickGroupActivityButton$lambda;
  Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickGroupActivityButton$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$$receiver = new LearnerGroup();
        this.state_0 = 2;
        this.result_0 = this.local$this$ContentEntryDetailOverviewPresenter.repo.learnerGroupDao.insertAsync(this.local$$receiver, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$$receiver.learnerGroupUid = this.result_0;
        this.local$learnerGroup = this.local$$receiver;
        this.local$$receiver_0 = new GroupLearningSession();
        var this$ContentEntryDetailOverviewPresenter = this.local$this$ContentEntryDetailOverviewPresenter;
        this.local$$receiver_0.groupLearningSessionContentUid = this$ContentEntryDetailOverviewPresenter.contentEntryUid_0;
        this.local$$receiver_0.groupLearningSessionLearnerGroupUid = this.local$learnerGroup.learnerGroupUid;
        this.state_0 = 3;
        this.result_0 = this$ContentEntryDetailOverviewPresenter.repo.groupLearningSessionDao.insertAsync(this.local$$receiver_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$$receiver_0.groupLearningSessionLearnerGroupUid = this.result_0;
        this.local$$receiver_1 = new LearnerGroupMember();
        var this$ContentEntryDetailOverviewPresenter_0 = this.local$this$ContentEntryDetailOverviewPresenter;
        this.local$$receiver_1.learnerGroupMemberRole = 1;
        this.local$$receiver_1.learnerGroupMemberLgUid = this.local$learnerGroup.learnerGroupUid;
        this.local$$receiver_1.learnerGroupMemberPersonUid = this$ContentEntryDetailOverviewPresenter_0.accountManager.activeAccount.personUid;
        this.state_0 = 4;
        this.result_0 = this$ContentEntryDetailOverviewPresenter_0.repo.learnerGroupMemberDao.insertAsync(this.local$$receiver_1, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.local$$receiver_1.learnerGroupMemberUid = this.result_0;
        return this.local$this$ContentEntryDetailOverviewPresenter.systemImpl.go_gofqk3$(LearnerGroupMemberListView$Companion_getInstance().VIEW_NAME, mapOf([to(UstadView$Companion_getInstance().ARG_CONTENT_ENTRY_UID, this.local$this$ContentEntryDetailOverviewPresenter.contentEntryUid_0.toString()), to(UstadView$Companion_getInstance().ARG_LEARNER_GROUP_UID, this.local$learnerGroup.learnerGroupUid.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZUID, this.local$this$ContentEntryDetailOverviewPresenter.clazzUid_0.toString())]), this.local$this$ContentEntryDetailOverviewPresenter.context) , Unit;
      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 ContentEntryDetailOverviewPresenter$handleOnClickGroupActivityButton$lambda(this$ContentEntryDetailOverviewPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickGroupActivityButton$lambda(this$ContentEntryDetailOverviewPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentEntryDetailOverviewPresenter.prototype.handleOnClickGroupActivityButton = function() {
  launch(this.presenterScope, doorMainDispatcher(), void 0, ContentEntryDetailOverviewPresenter$handleOnClickGroupActivityButton$lambda(this));
};
  function Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickMarkComplete$lambda(this$ContentEntryDetailOverviewPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ContentEntryDetailOverviewPresenter = this$ContentEntryDetailOverviewPresenter_0;
  }
  Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickMarkComplete$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickMarkComplete$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickMarkComplete$lambda.prototype.constructor = Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickMarkComplete$lambda;
  Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickMarkComplete$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        tmp$ = this.local$this$ContentEntryDetailOverviewPresenter.view.entity;
        if (tmp$ == null) {
          return;
        }
        var contentEntry = tmp$;
        return storeCompletedStatement(this.local$this$ContentEntryDetailOverviewPresenter.statementEndpoint, this.local$this$ContentEntryDetailOverviewPresenter.accountManager.activeAccount, contentEntry, (tmp$_0 = this.local$this$ContentEntryDetailOverviewPresenter.contextRegistration_0) != null ? tmp$_0 : '', null, this.local$this$ContentEntryDetailOverviewPresenter.clazzUid_0) , Unit;
      case 1:
        throw this.exception_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 ContentEntryDetailOverviewPresenter$handleOnClickMarkComplete$lambda(this$ContentEntryDetailOverviewPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryDetailOverviewPresenter$handleOnClickMarkComplete$lambda(this$ContentEntryDetailOverviewPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentEntryDetailOverviewPresenter.prototype.handleOnClickMarkComplete = function() {
  if (equals(this.accountManager.activeAccount.personUid, L0)) 
    return;
  launch(coroutines.GlobalScope, void 0, void 0, ContentEntryDetailOverviewPresenter$handleOnClickMarkComplete$lambda(this));
  this.view.markCompleteVisible = false;
  var scoreProgress = this.view.scoreProgress;
    scoreProgress != null ? (scoreProgress.contentComplete = true) : null;
    scoreProgress != null ? (scoreProgress.progress = 100) : null;
  this.view.scoreProgress = scoreProgress;
};
  function ContentEntryDetailOverviewPresenter$Companion() {
    ContentEntryDetailOverviewPresenter$Companion_instance = this;
    this.CONTENT_JOB_ITEM_TABLE_LIST_0 = listOf_0('ContentJobItem');
  }
  ContentEntryDetailOverviewPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ContentEntryDetailOverviewPresenter$Companion_instance = null;
  function ContentEntryDetailOverviewPresenter$Companion_getInstance() {
    if (ContentEntryDetailOverviewPresenter$Companion_instance === null) {
      new ContentEntryDetailOverviewPresenter$Companion();
    }
    return ContentEntryDetailOverviewPresenter$Companion_instance;
  }
  ContentEntryDetailOverviewPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContentEntryDetailOverviewPresenter', 
  interfaces: [UstadDetailPresenter]};
  function ContentEntryDetailPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  ContentEntryDetailPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  return false;
};
  Object.defineProperty(ContentEntryDetailPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  ContentEntryDetailPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  UstadDetailPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  var editEntity = null;
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = ContentEntry.Companion.serializer();
    var tmp$;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
    editEntity = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    editEntity = new ContentEntry();
  }
  this.setupTabs_0();
  return editEntity;
};
  function Coroutine$ContentEntryDetailPresenter$onLoadEntityFromDb$lambda$lambda(closure$entityUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$it = it_0;
  }
  Coroutine$ContentEntryDetailPresenter$onLoadEntityFromDb$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryDetailPresenter$onLoadEntityFromDb$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryDetailPresenter$onLoadEntityFromDb$lambda$lambda.prototype.constructor = Coroutine$ContentEntryDetailPresenter$onLoadEntityFromDb$lambda$lambda;
  Coroutine$ContentEntryDetailPresenter$onLoadEntityFromDb$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.contentEntryDao.findByUidAsync_s8cxhz$(this.local$closure$entityUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ContentEntryDetailPresenter$onLoadEntityFromDb$lambda$lambda(closure$entityUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryDetailPresenter$onLoadEntityFromDb$lambda$lambda(closure$entityUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentEntryDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$ContentEntryDetailPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryDetailPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryDetailPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$ContentEntryDetailPresenter$onLoadEntityFromDb$lambda;
  Coroutine$ContentEntryDetailPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$closure$db, L2000, ContentEntryDetailPresenter$onLoadEntityFromDb$lambda$lambda(this.local$closure$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ContentEntryDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_7($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_7.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_7.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_7.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_7;
  Coroutine$onLoadEntityFromDb_7hogkd$_7.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        var entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = withContext(coroutines.Dispatchers.Default, ContentEntryDetailPresenter$onLoadEntityFromDb$lambda(this.local$db, entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var entry = this.result_0;
        this.$this.setupTabs_0();
        return entry;
      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);
};
  ContentEntryDetailPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_7(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ContentEntryDetailPresenter.prototype.setupTabs_0 = function() {
  var tmp$, tmp$_0, tmp$_1;
  var entityUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  var commonArgs = mapOf([to(UstadView$Companion_getInstance().ARG_NAV_CHILD, true.toString()), to(UstadView$Companion_getInstance().ARG_ENTITY_UID, entityUid.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZUID, (tmp$_1 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? tmp$_1 : '0')]);
  this.view.tabs = listOf([appendQueryArgs_1(ContentEntryDetailOverviewView$Companion_getInstance().VIEW_NAME, commonArgs), appendQueryArgs_1(ContentEntryDetailAttemptsListView$Companion_getInstance().VIEW_NAME, commonArgs)]);
};
  ContentEntryDetailPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContentEntryDetailPresenter', 
  interfaces: [UstadDetailPresenter]};
  function post$lambda_0($receiver) {
    return Unit;
  }
  function ContentEntryEdit2Presenter(context, arguments_0, view, lifecycleOwner, di) {
    ContentEntryEdit2Presenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    var context_0 = this.accountManager.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$;
    var tmp$_0;
    this.pluginManager_l5kp0u$_0 = InstanceOrNull(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$ : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(ContentPluginManager), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, ContentEntryEdit2Presenter$pluginManager_metadata);
    var tmp$_1;
    this.contentJobManager_806y77$_0 = Instance(di, Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(ContentJobManager), [], false)), TypeToken) ? tmp$_1 : throwCCE(), null).provideDelegate_tpuvb9$(this, ContentEntryEdit2Presenter$contentJobManager_metadata);
    var tmp$_2;
    this.httpClient_n4iqvp$_0 = Instance(di, Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(HttpClient), [], false)), TypeToken) ? tmp$_2 : throwCCE(), null).provideDelegate_tpuvb9$(this, ContentEntryEdit2Presenter$httpClient_metadata);
    var context_1 = this.accountManager.activeAccount;
    var trigger_0;
    trigger_0 = this.diTrigger;
    var tmp$_3;
    var tmp$_4;
    this.containerStorageManager_w7o40p$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_3 : throwCCE(), context_1), trigger_0), Kotlin.isType(tmp$_4 = typeToken(createKType(getKClass(ContainerStorageManager), [], false)), TypeToken) ? tmp$_4 : throwCCE(), null).provideDelegate_tpuvb9$(this, ContentEntryEdit2Presenter$containerStorageManager_metadata);
    this.parentEntryUid_0 = L0;
    var tmp$_5;
    this.json_bdua0w$_0 = Instance(this, Kotlin.isType(tmp$_5 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_5 : throwCCE(), null).provideDelegate_tpuvb9$(this, ContentEntryEdit2Presenter$json_metadata);
  }
  function Coroutine$isRemoteOrServerUpload_qvpt4h$($this, $receiver_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$$receiver = $receiver_0;
  }
  Coroutine$isRemoteOrServerUpload_qvpt4h$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$isRemoteOrServerUpload_qvpt4h$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$isRemoteOrServerUpload_qvpt4h$.prototype.constructor = Coroutine$isRemoteOrServerUpload_qvpt4h$;
  Coroutine$isRemoteOrServerUpload_qvpt4h$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = isRemote(this.local$$receiver, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        return this.result_0 || startsWith(this.local$$receiver.toString(), MetadataResult$Companion_getInstance().UPLOAD_TMP_LOCATOR_PREFIX);
      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);
};
  ContentEntryEdit2Presenter.prototype.isRemoteOrServerUpload_qvpt4h$ = function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$isRemoteOrServerUpload_qvpt4h$(this, $receiver_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  var ContentEntryEdit2Presenter$pluginManager_metadata = new PropertyMetadata('pluginManager');
  Object.defineProperty(ContentEntryEdit2Presenter.prototype, 'pluginManager_0', {
  configurable: true, 
  get: function() {
  return this.pluginManager_l5kp0u$_0.value;
}});
  var ContentEntryEdit2Presenter$contentJobManager_metadata = new PropertyMetadata('contentJobManager');
  Object.defineProperty(ContentEntryEdit2Presenter.prototype, 'contentJobManager_0', {
  configurable: true, 
  get: function() {
  return this.contentJobManager_806y77$_0.value;
}});
  var ContentEntryEdit2Presenter$httpClient_metadata = new PropertyMetadata('httpClient');
  Object.defineProperty(ContentEntryEdit2Presenter.prototype, 'httpClient_0', {
  configurable: true, 
  get: function() {
  return this.httpClient_n4iqvp$_0.value;
}});
  var ContentEntryEdit2Presenter$containerStorageManager_metadata = new PropertyMetadata('containerStorageManager');
  Object.defineProperty(ContentEntryEdit2Presenter.prototype, 'containerStorageManager_0', {
  configurable: true, 
  get: function() {
  return this.containerStorageManager_w7o40p$_0.value;
}});
  function ContentEntryEdit2Presenter$LicenceOptions(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ContentEntryEdit2Presenter$LicenceOptions_initFields() {
    ContentEntryEdit2Presenter$LicenceOptions_initFields = function() {
};
    ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_instance = new ContentEntryEdit2Presenter$LicenceOptions('LICENSE_TYPE_CC_BY', 0, 1, 2287);
    ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_SA_instance = new ContentEntryEdit2Presenter$LicenceOptions('LICENSE_TYPE_CC_BY_SA', 1, 2, 2288);
    ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_SA_NC_instance = new ContentEntryEdit2Presenter$LicenceOptions('LICENSE_TYPE_CC_BY_SA_NC', 2, 3, 2289);
    ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_NC_instance = new ContentEntryEdit2Presenter$LicenceOptions('LICENSE_TYPE_CC_BY_NC', 3, 4, 2290);
    ContentEntryEdit2Presenter$LicenceOptions$ALL_RIGHTS_RESERVED_instance = new ContentEntryEdit2Presenter$LicenceOptions('ALL_RIGHTS_RESERVED', 4, 5, 2293);
    ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_NC_SA_instance = new ContentEntryEdit2Presenter$LicenceOptions('LICENSE_TYPE_CC_BY_NC_SA', 5, 6, 2291);
    ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_PUBLIC_DOMAIN_instance = new ContentEntryEdit2Presenter$LicenceOptions('LICENSE_TYPE_PUBLIC_DOMAIN', 6, 7, 2292);
    ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_OTHER_instance = new ContentEntryEdit2Presenter$LicenceOptions('LICENSE_TYPE_OTHER', 7, 8, 2050);
    ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC0_instance = new ContentEntryEdit2Presenter$LicenceOptions('LICENSE_TYPE_CC0', 8, 9, 2294);
  }
  var ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_instance;
  function ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_getInstance() {
    ContentEntryEdit2Presenter$LicenceOptions_initFields();
    return ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_instance;
  }
  var ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_SA_instance;
  function ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_SA_getInstance() {
    ContentEntryEdit2Presenter$LicenceOptions_initFields();
    return ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_SA_instance;
  }
  var ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_SA_NC_instance;
  function ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_SA_NC_getInstance() {
    ContentEntryEdit2Presenter$LicenceOptions_initFields();
    return ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_SA_NC_instance;
  }
  var ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_NC_instance;
  function ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_NC_getInstance() {
    ContentEntryEdit2Presenter$LicenceOptions_initFields();
    return ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_NC_instance;
  }
  var ContentEntryEdit2Presenter$LicenceOptions$ALL_RIGHTS_RESERVED_instance;
  function ContentEntryEdit2Presenter$LicenceOptions$ALL_RIGHTS_RESERVED_getInstance() {
    ContentEntryEdit2Presenter$LicenceOptions_initFields();
    return ContentEntryEdit2Presenter$LicenceOptions$ALL_RIGHTS_RESERVED_instance;
  }
  var ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_NC_SA_instance;
  function ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_NC_SA_getInstance() {
    ContentEntryEdit2Presenter$LicenceOptions_initFields();
    return ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_NC_SA_instance;
  }
  var ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_PUBLIC_DOMAIN_instance;
  function ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_PUBLIC_DOMAIN_getInstance() {
    ContentEntryEdit2Presenter$LicenceOptions_initFields();
    return ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_PUBLIC_DOMAIN_instance;
  }
  var ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_OTHER_instance;
  function ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_OTHER_getInstance() {
    ContentEntryEdit2Presenter$LicenceOptions_initFields();
    return ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_OTHER_instance;
  }
  var ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC0_instance;
  function ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC0_getInstance() {
    ContentEntryEdit2Presenter$LicenceOptions_initFields();
    return ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC0_instance;
  }
  ContentEntryEdit2Presenter$LicenceOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'LicenceOptions', 
  interfaces: [Enum]};
  function ContentEntryEdit2Presenter$LicenceOptions$values() {
    return [ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_getInstance(), ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_SA_getInstance(), ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_SA_NC_getInstance(), ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_NC_getInstance(), ContentEntryEdit2Presenter$LicenceOptions$ALL_RIGHTS_RESERVED_getInstance(), ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_NC_SA_getInstance(), ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_PUBLIC_DOMAIN_getInstance(), ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_OTHER_getInstance(), ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC0_getInstance()];
  }
  ContentEntryEdit2Presenter$LicenceOptions.values = ContentEntryEdit2Presenter$LicenceOptions$values;
  function ContentEntryEdit2Presenter$LicenceOptions$valueOf(name) {
    switch (name) {
      case 'LICENSE_TYPE_CC_BY':
        return ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_getInstance();
      case 'LICENSE_TYPE_CC_BY_SA':
        return ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_SA_getInstance();
      case 'LICENSE_TYPE_CC_BY_SA_NC':
        return ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_SA_NC_getInstance();
      case 'LICENSE_TYPE_CC_BY_NC':
        return ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_NC_getInstance();
      case 'ALL_RIGHTS_RESERVED':
        return ContentEntryEdit2Presenter$LicenceOptions$ALL_RIGHTS_RESERVED_getInstance();
      case 'LICENSE_TYPE_CC_BY_NC_SA':
        return ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_NC_SA_getInstance();
      case 'LICENSE_TYPE_PUBLIC_DOMAIN':
        return ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_PUBLIC_DOMAIN_getInstance();
      case 'LICENSE_TYPE_OTHER':
        return ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_OTHER_getInstance();
      case 'LICENSE_TYPE_CC0':
        return ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC0_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ContentEntryEdit2Presenter.LicenceOptions.' + name);
    }
  }
  ContentEntryEdit2Presenter$LicenceOptions.valueOf_61zpoe$ = ContentEntryEdit2Presenter$LicenceOptions$valueOf;
  function ContentEntryEdit2Presenter$CompletionCriteriaOptions(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ContentEntryEdit2Presenter$CompletionCriteriaOptions_initFields() {
    ContentEntryEdit2Presenter$CompletionCriteriaOptions_initFields = function() {
};
    ContentEntryEdit2Presenter$CompletionCriteriaOptions$AUTOMATIC_instance = new ContentEntryEdit2Presenter$CompletionCriteriaOptions('AUTOMATIC', 0, 0, 2596);
    ContentEntryEdit2Presenter$CompletionCriteriaOptions$MIN_SCORE_instance = new ContentEntryEdit2Presenter$CompletionCriteriaOptions('MIN_SCORE', 1, 1, 2595);
    ContentEntryEdit2Presenter$CompletionCriteriaOptions$STUDENTS_MARKS_COMPLETE_instance = new ContentEntryEdit2Presenter$CompletionCriteriaOptions('STUDENTS_MARKS_COMPLETE', 2, 2, 2597);
  }
  var ContentEntryEdit2Presenter$CompletionCriteriaOptions$AUTOMATIC_instance;
  function ContentEntryEdit2Presenter$CompletionCriteriaOptions$AUTOMATIC_getInstance() {
    ContentEntryEdit2Presenter$CompletionCriteriaOptions_initFields();
    return ContentEntryEdit2Presenter$CompletionCriteriaOptions$AUTOMATIC_instance;
  }
  var ContentEntryEdit2Presenter$CompletionCriteriaOptions$MIN_SCORE_instance;
  function ContentEntryEdit2Presenter$CompletionCriteriaOptions$MIN_SCORE_getInstance() {
    ContentEntryEdit2Presenter$CompletionCriteriaOptions_initFields();
    return ContentEntryEdit2Presenter$CompletionCriteriaOptions$MIN_SCORE_instance;
  }
  var ContentEntryEdit2Presenter$CompletionCriteriaOptions$STUDENTS_MARKS_COMPLETE_instance;
  function ContentEntryEdit2Presenter$CompletionCriteriaOptions$STUDENTS_MARKS_COMPLETE_getInstance() {
    ContentEntryEdit2Presenter$CompletionCriteriaOptions_initFields();
    return ContentEntryEdit2Presenter$CompletionCriteriaOptions$STUDENTS_MARKS_COMPLETE_instance;
  }
  ContentEntryEdit2Presenter$CompletionCriteriaOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'CompletionCriteriaOptions', 
  interfaces: [Enum]};
  function ContentEntryEdit2Presenter$CompletionCriteriaOptions$values() {
    return [ContentEntryEdit2Presenter$CompletionCriteriaOptions$AUTOMATIC_getInstance(), ContentEntryEdit2Presenter$CompletionCriteriaOptions$MIN_SCORE_getInstance(), ContentEntryEdit2Presenter$CompletionCriteriaOptions$STUDENTS_MARKS_COMPLETE_getInstance()];
  }
  ContentEntryEdit2Presenter$CompletionCriteriaOptions.values = ContentEntryEdit2Presenter$CompletionCriteriaOptions$values;
  function ContentEntryEdit2Presenter$CompletionCriteriaOptions$valueOf(name) {
    switch (name) {
      case 'AUTOMATIC':
        return ContentEntryEdit2Presenter$CompletionCriteriaOptions$AUTOMATIC_getInstance();
      case 'MIN_SCORE':
        return ContentEntryEdit2Presenter$CompletionCriteriaOptions$MIN_SCORE_getInstance();
      case 'STUDENTS_MARKS_COMPLETE':
        return ContentEntryEdit2Presenter$CompletionCriteriaOptions$STUDENTS_MARKS_COMPLETE_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ContentEntryEdit2Presenter.CompletionCriteriaOptions.' + name);
    }
  }
  ContentEntryEdit2Presenter$CompletionCriteriaOptions.valueOf_61zpoe$ = ContentEntryEdit2Presenter$CompletionCriteriaOptions$valueOf;
  function ContentEntryEdit2Presenter$CompletionCriteriaMessageIdOption(day, context, di) {
    MessageIdOption.call(this, day.messageId, context, day.optionVal, di);
  }
  ContentEntryEdit2Presenter$CompletionCriteriaMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'CompletionCriteriaMessageIdOption', 
  interfaces: [MessageIdOption]};
  function ContentEntryEdit2Presenter$LicenceMessageIdOptions(licence, context, di) {
    MessageIdOption.call(this, licence.messageId, context, licence.optionVal, di);
  }
  ContentEntryEdit2Presenter$LicenceMessageIdOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'LicenceMessageIdOptions', 
  interfaces: [MessageIdOption]};
  Object.defineProperty(ContentEntryEdit2Presenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  var ContentEntryEdit2Presenter$json_metadata = new PropertyMetadata('json');
  Object.defineProperty(ContentEntryEdit2Presenter.prototype, 'json_0', {
  configurable: true, 
  get: function() {
  return this.json_bdua0w$_0.value;
}});
  function Coroutine$ContentEntryEdit2Presenter$onCreate$lambda(this$ContentEntryEdit2Presenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ContentEntryEdit2Presenter = this$ContentEntryEdit2Presenter_0;
  }
  Coroutine$ContentEntryEdit2Presenter$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryEdit2Presenter$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryEdit2Presenter$onCreate$lambda.prototype.constructor = Coroutine$ContentEntryEdit2Presenter$onCreate$lambda;
  Coroutine$ContentEntryEdit2Presenter$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        return this.local$this$ContentEntryEdit2Presenter.view.storageOptions = this.local$this$ContentEntryEdit2Presenter.containerStorageManager_0.storageList , Unit;
      case 1:
        throw this.exception_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 ContentEntryEdit2Presenter$onCreate$lambda(this$ContentEntryEdit2Presenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryEdit2Presenter$onCreate$lambda(this$ContentEntryEdit2Presenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentEntryEdit2Presenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0;
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
  var tmp$_1 = this.view;
  var $receiver = ContentEntryEdit2Presenter$LicenceOptions$values();
  var destination = ArrayList_init_0($receiver.length);
  var tmp$_2;
  for (tmp$_2 = 0; tmp$_2 !== $receiver.length; ++tmp$_2) {
    var item = $receiver[tmp$_2];
    destination.add_11rb$(new ContentEntryEdit2Presenter$LicenceMessageIdOptions(item, this.context, this.di));
  }
  tmp$_1.licenceOptions = destination;
  var tmp$_3 = this.view;
  var $receiver_0 = ContentEntryEdit2Presenter$CompletionCriteriaOptions$values();
  var destination_0 = ArrayList_init_0($receiver_0.length);
  var tmp$_4;
  for (tmp$_4 = 0; tmp$_4 !== $receiver_0.length; ++tmp$_4) {
    var item_0 = $receiver_0[tmp$_4];
    destination_0.add_11rb$(new ContentEntryEdit2Presenter$CompletionCriteriaMessageIdOption(item_0, this.context, this.di));
  }
  tmp$_3.completionCriteriaOptions = destination_0;
  this.parentEntryUid_0 = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  launch(this.presenterScope, doorMainDispatcher(), void 0, ContentEntryEdit2Presenter$onCreate$lambda(this));
};
  function Coroutine$ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda;
  Coroutine$ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        var $receiver = this.local$closure$db;
        if ((tmp$_0 = (tmp$ = !equals(this.local$closure$entityUid, L0) ? $receiver : null) != null ? tmp$.contentEntryDao : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_0.findEntryWithBlockAndLanguageByUidAsync(this.local$closure$entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda_0(closure$entityUid_0, dbToUse_0, f_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$dbToUse = dbToUse_0;
  }
  Coroutine$ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda_0.prototype.constructor = Coroutine$ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda_0;
  Coroutine$ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if ((tmp$_0 = (tmp$ = !equals(this.local$closure$entityUid, L0) ? this.local$dbToUse : null) != null ? tmp$.contentEntryPictureDao : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_0.findByContentEntryUidAsync_s8cxhz$(this.local$closure$entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda_0(closure$entityUid_0) {
    return function(dbToUse_0, f_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda_0(closure$entityUid_0, dbToUse_0, f_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_8($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$_6 = void 0;
    this.local$entityUid = void 0;
    this.local$isLeaf = void 0;
    this.local$isBlockRequired = void 0;
    this.local$clazzUid = void 0;
    this.local$entry = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_8.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_8.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_8.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_8;
  Coroutine$onLoadEntityFromDb_7hogkd$_8.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5;
        var tmp$_6, tmp$_7;
        this.local$entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.local$isLeaf = (tmp$_1 = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_LEAF)) != null ? toBoolean(tmp$_1) : null;
        var metaData = this.$this.arguments.get_11rb$(ContentEntryEdit2View$Companion_getInstance().ARG_IMPORTED_METADATA);
        this.local$isBlockRequired = toBoolean(this.$this.arguments.get_11rb$(ContentEntryEdit2View$Companion_getInstance().BLOCK_REQUIRED));
        this.local$clazzUid = (tmp$_3 = (tmp$_2 = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLongOrNull(tmp$_2) : null) != null ? tmp$_3 : L0;
        this.$this.view.showUpdateContentButton = (!equals(this.local$entityUid, L0) && this.local$isLeaf === true);
        if (Kotlin.isType(this.local$db, DoorDatabaseRepository)) {
          if (metaData != null) {
            var di = this.$this.di;
            var strategy = MetadataResult$Companion_getInstance().serializer();
            var tmp$_8;
            var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_8 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_8 : throwCCE(), null);
            var metadataResult = json.decodeFromString_awif5v$(strategy, metaData);
            this.state_0 = 2;
            this.result_0 = this.$this.handleMetadataResult_0(metadataResult, this.local$isBlockRequired, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 3;
            continue;
          }
        } else {
          this.state_0 = 4;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        return this.result_0;
      case 3:
        this.state_0 = 4;
        continue;
      case 4:
        this.state_0 = 5;
        this.result_0 = withTimeoutOrNull(L2000, ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda(this.local$db, this.local$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        var tmp$_9;
        if ((tmp$_4 = this.result_0) != null) 
          tmp$_9 = tmp$_4;
        else {
          var $receiver = new ContentEntryWithBlockAndLanguage();
          $receiver.leaf = this.local$isLeaf != null ? this.local$isLeaf : $receiver.contentFlags !== 1;
          tmp$_9 = $receiver;
        }
        this.local$entry = tmp$_9;
        this.local$tmp$_6 = this.$this.view;
        this.state_0 = 6;
        this.result_0 = onDbThenRepoWithTimeout(this.local$db, L2000, ContentEntryEdit2Presenter$onLoadEntityFromDb$lambda_0(this.local$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 6:
        this.local$tmp$_6.contentEntryPicture = (tmp$_5 = this.result_0) != null ? tmp$_5 : new ContentEntryPicture();
        if (this.local$isBlockRequired) {
          var tmp$_10;
          if ((tmp$_6 = this.local$entry.block) != null) 
            tmp$_10 = tmp$_6;
          else {
            var $receiver_0 = new CourseBlock();
            $receiver_0.cbUid = get_doorPrimaryKeyManager(this.local$db).nextId_za3lpa$(124);
            $receiver_0.cbClazzUid = this.local$clazzUid;
            $receiver_0.cbType = 104;
            tmp$_10 = $receiver_0;
          }
          tmp$_7 = tmp$_10;
        } else {
          tmp$_7 = null;
        }
        this.local$entry.block = tmp$_7;
        this.state_0 = 7;
        this.result_0 = this.$this.handleBlock_0(this.local$entry, this.local$isBlockRequired, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 7:
        return this.local$entry;
      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);
};
  ContentEntryEdit2Presenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_8(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$ContentEntryEdit2Presenter$onLoadFromJson$lambda(closure$editEntity_0, closure$isBlockRequired_0, this$ContentEntryEdit2Presenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$editEntity = closure$editEntity_0;
    this.local$closure$isBlockRequired = closure$isBlockRequired_0;
    this.local$this$ContentEntryEdit2Presenter = this$ContentEntryEdit2Presenter_0;
  }
  Coroutine$ContentEntryEdit2Presenter$onLoadFromJson$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryEdit2Presenter$onLoadFromJson$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryEdit2Presenter$onLoadFromJson$lambda.prototype.constructor = Coroutine$ContentEntryEdit2Presenter$onLoadFromJson$lambda;
  Coroutine$ContentEntryEdit2Presenter$onLoadFromJson$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$ContentEntryEdit2Presenter.handleBlock_0(this.local$closure$editEntity, this.local$closure$isBlockRequired, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ContentEntryEdit2Presenter$onLoadFromJson$lambda(closure$editEntity_0, closure$isBlockRequired_0, this$ContentEntryEdit2Presenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryEdit2Presenter$onLoadFromJson$lambda(closure$editEntity_0, closure$isBlockRequired_0, this$ContentEntryEdit2Presenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentEntryEdit2Presenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  var metaDataStr = bundle.get_11rb$(ContentEntryEdit2View$Companion_getInstance().ARG_IMPORTED_METADATA);
  var isBlockRequired = toBoolean(this.arguments.get_11rb$(ContentEntryEdit2View$Companion_getInstance().BLOCK_REQUIRED));
  var clazzUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLongOrNull(tmp$) : null) != null ? tmp$_0 : L0;
  if (metaDataStr != null) {
    var tmp$_3 = this.view;
    var di = this.di;
    var strategy = MetadataResult$Companion_getInstance().serializer();
    var tmp$_4;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_4 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_4 : throwCCE(), null);
    tmp$_3.metadataResult = json.decodeFromString_awif5v$(strategy, metaDataStr);
  }
  if (entityJsonStr != null) {
    var di_0 = this.di;
    var strategy_0 = ContentEntryWithBlockAndLanguage.Companion.serializer();
    var tmp$_5;
    var json_0 = get_direct(di_0).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_5 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_5 : throwCCE(), null);
    tmp$_1 = json_0.decodeFromString_awif5v$(strategy_0, entityJsonStr);
  } else {
    var $receiver = new ContentEntryWithBlockAndLanguage();
    var tmp$_6;
    if (isBlockRequired) {
      var $receiver_0 = new CourseBlock();
      $receiver_0.cbUid = get_doorPrimaryKeyManager(this.db).nextId_za3lpa$(124);
      $receiver_0.cbClazzUid = clazzUid;
      $receiver_0.cbType = 104;
      tmp$_6 = $receiver_0;
    } else {
      tmp$_6 = null;
    }
    $receiver.block = tmp$_6;
    tmp$_1 = $receiver;
  }
  var editEntity = tmp$_1;
  launch(this.presenterScope, doorMainDispatcher(), void 0, ContentEntryEdit2Presenter$onLoadFromJson$lambda(editEntity, isBlockRequired, this));
  this.view.showUpdateContentButton = (!equals(editEntity.contentEntryUid, L0) && editEntity.leaf);
  this.view.contentEntryPicture = (tmp$_2 = bundle.get_11rb$(ContentEntryEdit2Presenter$Companion_getInstance().SAVED_STATE_CONTENTENTRY_PICTURE)) != null ? this.json_0.decodeFromString_awif5v$(ContentEntryPicture.Companion.serializer(), tmp$_2) : null;
  return editEntity;
};
  function Coroutine$ContentEntryEdit2Presenter$onLoadDataComplete$lambda$lambda(closure$metadata_0, this$ContentEntryEdit2Presenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$metadata = closure$metadata_0;
    this.local$this$ContentEntryEdit2Presenter = this$ContentEntryEdit2Presenter_0;
  }
  Coroutine$ContentEntryEdit2Presenter$onLoadDataComplete$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryEdit2Presenter$onLoadDataComplete$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryEdit2Presenter$onLoadDataComplete$lambda$lambda.prototype.constructor = Coroutine$ContentEntryEdit2Presenter$onLoadDataComplete$lambda$lambda;
  Coroutine$ContentEntryEdit2Presenter$onLoadDataComplete$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        this.state_0 = 2;
        this.result_0 = this.local$this$ContentEntryEdit2Presenter.handleMetadataResult_0(this.local$closure$metadata, void 0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var entry = this.result_0;
        entry.contentEntryUid = (tmp$_0 = (tmp$ = this.local$this$ContentEntryEdit2Presenter.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        return this.local$this$ContentEntryEdit2Presenter.view.entity = entry , Unit;
      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 ContentEntryEdit2Presenter$onLoadDataComplete$lambda$lambda(closure$metadata_0, this$ContentEntryEdit2Presenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryEdit2Presenter$onLoadDataComplete$lambda$lambda(closure$metadata_0, this$ContentEntryEdit2Presenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function ContentEntryEdit2Presenter$onLoadDataComplete$lambda(this$ContentEntryEdit2Presenter) {
    return function(it) {
  var tmp$;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var metadata = tmp$;
  this$ContentEntryEdit2Presenter.view.loading = true;
  launch(this$ContentEntryEdit2Presenter.presenterScope, doorMainDispatcher(), void 0, ContentEntryEdit2Presenter$onLoadDataComplete$lambda$lambda(metadata, this$ContentEntryEdit2Presenter));
  this$ContentEntryEdit2Presenter.requireSavedStateHandle().set_umlfku$(ContentEntryEdit2Presenter$Companion_getInstance().SAVED_STATE_KEY_METADATA, null);
  this$ContentEntryEdit2Presenter.view.fileImportErrorVisible = false;
  this$ContentEntryEdit2Presenter.view.loading = false;
  return Unit;
};
  }
  function ContentEntryEdit2Presenter$onLoadDataComplete$lambda_0(this$ContentEntryEdit2Presenter) {
    return function(it) {
  var tmp$, tmp$_0, tmp$_1;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var language = tmp$;
    (tmp$_0 = this$ContentEntryEdit2Presenter.entity) != null ? (tmp$_0.language = language) : null;
    (tmp$_1 = this$ContentEntryEdit2Presenter.entity) != null ? (tmp$_1.primaryLanguageUid = language.langUid) : null;
  this$ContentEntryEdit2Presenter.view.entity = this$ContentEntryEdit2Presenter.entity;
  this$ContentEntryEdit2Presenter.requireSavedStateHandle().set_umlfku$(ContentEntryEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_LANGUAGE, null);
  return Unit;
};
  }
  ContentEntryEdit2Presenter.prototype.onLoadDataComplete = function() {
  UstadEditPresenter.prototype.onLoadDataComplete.call(this);
  this.observeSavedStateResult_27fjeh$(ContentEntryEdit2Presenter$Companion_getInstance().SAVED_STATE_KEY_METADATA, ListSerializer(MetadataResult$Companion_getInstance().serializer()), getKClass(MetadataResult), new DoorObserver(ContentEntryEdit2Presenter$onLoadDataComplete$lambda(this)));
  this.observeSavedStateResult_27fjeh$(ContentEntryEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_LANGUAGE, ListSerializer(Language.Companion.serializer()), getKClass(Language), new DoorObserver(ContentEntryEdit2Presenter$onLoadDataComplete$lambda_0(this)));
};
  ContentEntryEdit2Presenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  putEntityAsJson(savedState, ContentEntryEdit2View$Companion_getInstance().ARG_IMPORTED_METADATA, MetadataResult$Companion_getInstance().serializer(), this.view.metadataResult);
  putEntityAsJson(savedState, ContentEntryEdit2Presenter$Companion_getInstance().SAVED_STATE_CONTENTENTRY_PICTURE, ContentEntryPicture.Companion.serializer(), this.view.contentEntryPicture);
};
  ContentEntryEdit2Presenter.prototype.loadEntityIntoDateTime_xj4pqf$ = function(entry) {
  var tmp$, tmp$_0;
  var timeZone = (tmp$ = this.view.timeZone) != null ? tmp$ : 'UTC';
  tmp$_0 = entry.block;
  if (tmp$_0 == null) {
    return;
  }
  var entity = tmp$_0;
  if (!equals(entity.cbHideUntilDate, L0)) {
    var startDateTimeMidnight = toLocalMidnight(DateTime.Companion.invoke_s8cxhz$(entity.cbHideUntilDate), timeZone).unixMillisLong;
    this.view.startDate = startDateTimeMidnight;
    this.view.startTime = entity.cbHideUntilDate.subtract(startDateTimeMidnight);
  } else {
    this.view.startDate = L0;
  }
  if (!equals(entity.cbDeadlineDate, Long$Companion$MAX_VALUE)) {
    var deadlineDateTimeMidnight = toLocalMidnight(DateTime.Companion.invoke_s8cxhz$(entity.cbDeadlineDate), timeZone).unixMillisLong;
    this.view.deadlineDate = deadlineDateTimeMidnight;
    this.view.deadlineTime = entity.cbDeadlineDate.subtract(deadlineDateTimeMidnight);
  } else {
    this.view.deadlineDate = Long$Companion$MAX_VALUE;
  }
  if (!equals(entity.cbGracePeriodDate, Long$Companion$MAX_VALUE)) {
    var gracePeriodDateTimeMidnight = toLocalMidnight(DateTime.Companion.invoke_s8cxhz$(entity.cbGracePeriodDate), timeZone).unixMillisLong;
    this.view.gracePeriodDate = gracePeriodDateTimeMidnight;
    this.view.gracePeriodTime = entity.cbGracePeriodDate.subtract(gracePeriodDateTimeMidnight);
  } else {
    this.view.gracePeriodDate = Long$Companion$MAX_VALUE;
  }
};
  ContentEntryEdit2Presenter.prototype.saveDateTimeIntoEntity_xj4pqf$ = function(entry) {
  var tmp$, tmp$_0;
  var timeZone = (tmp$ = this.view.timeZone) != null ? tmp$ : 'UTC';
  tmp$_0 = entry.block;
  if (tmp$_0 == null) {
    return;
  }
  var entity = tmp$_0;
  var $receiver = toOffsetByTimezone(DateTime.Companion.invoke_s8cxhz$(this.view.startDate), timeZone);
  var $receiver_0 = $receiver.hours;
  var tmp$_1 = TimeSpan.Companion.fromHours_14dthe$($receiver_0);
  var $receiver_1 = $receiver.minutes;
  var tmp$_2 = tmp$_1.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_1));
  var $receiver_2 = $receiver.seconds;
  var tmp$_3 = tmp$_2.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_2));
  var $receiver_3 = $receiver.milliseconds;
  entity.cbHideUntilDate = $receiver.minus_fv8bff$(tmp$_3.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_3))).utc.unixMillisLong.add(this.view.startTime);
  if (!equals(this.view.deadlineDate, Long$Companion$MAX_VALUE)) {
    var $receiver_4 = toOffsetByTimezone(DateTime.Companion.invoke_s8cxhz$(this.view.deadlineDate), timeZone);
    var $receiver_5 = $receiver_4.hours;
    var tmp$_4 = TimeSpan.Companion.fromHours_14dthe$($receiver_5);
    var $receiver_6 = $receiver_4.minutes;
    var tmp$_5 = tmp$_4.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_6));
    var $receiver_7 = $receiver_4.seconds;
    var tmp$_6 = tmp$_5.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_7));
    var $receiver_8 = $receiver_4.milliseconds;
    entity.cbDeadlineDate = $receiver_4.minus_fv8bff$(tmp$_6.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_8))).utc.unixMillisLong.add(this.view.deadlineTime);
  }
  if (!equals(this.view.gracePeriodDate, Long$Companion$MAX_VALUE)) {
    var $receiver_9 = toOffsetByTimezone(DateTime.Companion.invoke_s8cxhz$(this.view.gracePeriodDate), timeZone);
    var $receiver_10 = $receiver_9.hours;
    var tmp$_7 = TimeSpan.Companion.fromHours_14dthe$($receiver_10);
    var $receiver_11 = $receiver_9.minutes;
    var tmp$_8 = tmp$_7.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_11));
    var $receiver_12 = $receiver_9.seconds;
    var tmp$_9 = tmp$_8.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_12));
    var $receiver_13 = $receiver_9.milliseconds;
    entity.cbGracePeriodDate = $receiver_9.minus_fv8bff$(tmp$_9.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_13))).utc.unixMillisLong.add(this.view.gracePeriodTime);
  }
};
  function Coroutine$ContentEntryEdit2Presenter$handleBlock$lambda(closure$clazzUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$clazzUid = closure$clazzUid_0;
    this.local$it = it_0;
  }
  Coroutine$ContentEntryEdit2Presenter$handleBlock$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryEdit2Presenter$handleBlock$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryEdit2Presenter$handleBlock$lambda.prototype.constructor = Coroutine$ContentEntryEdit2Presenter$handleBlock$lambda;
  Coroutine$ContentEntryEdit2Presenter$handleBlock$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.clazzDao.getClazzWithSchool_s8cxhz$(this.local$closure$clazzUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ContentEntryEdit2Presenter$handleBlock$lambda(closure$clazzUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryEdit2Presenter$handleBlock$lambda(closure$clazzUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$handleBlock_0($this, entry_0, isBlockRequired_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$_0 = void 0;
    this.local$entry = entry_0;
    this.local$isBlockRequired = isBlockRequired_0;
  }
  Coroutine$handleBlock_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$handleBlock_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$handleBlock_0.prototype.constructor = Coroutine$handleBlock_0;
  Coroutine$handleBlock_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$isBlockRequired === void 0) 
          this.local$isBlockRequired = false;
        var tmp$;
        var tmp$_0;
        if (this.local$isBlockRequired) {
          this.local$tmp$_0 = (tmp$ = this.local$entry.block) != null ? tmp$.cbClazzUid : null;
          if (this.local$tmp$_0 == null) {
            return;
          } else {
            this.state_0 = 2;
            continue;
          }
        } else {
          this.state_0 = 4;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        var clazzUid = this.local$tmp$_0;
        this.state_0 = 3;
        this.result_0 = onRepoWithFallbackToDb(this.$this.db, L2000, ContentEntryEdit2Presenter$handleBlock$lambda(clazzUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var clazzWithSchool = (tmp$_0 = this.result_0) != null ? tmp$_0 : new ClazzWithSchool();
        var timeZone = effectiveTimeZone(clazzWithSchool);
        this.$this.view.timeZone = timeZone;
        this.$this.loadEntityIntoDateTime_xj4pqf$(this.local$entry);
        this.state_0 = 4;
        continue;
      case 4:
        return;
      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);
};
  ContentEntryEdit2Presenter.prototype.handleBlock_0 = function(entry_0, isBlockRequired_0, continuation_0, suspended) {
  var instance = new Coroutine$handleBlock_0(this, entry_0, isBlockRequired_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$handleMetadataResult_0($this, metadataResult_0, blockRequired_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$entityVal = void 0;
    this.local$plugin = void 0;
    this.local$uri = void 0;
    this.local$metadataResult = metadataResult_0;
    this.local$blockRequired = blockRequired_0;
  }
  Coroutine$handleMetadataResult_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$handleMetadataResult_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$handleMetadataResult_0.prototype.constructor = Coroutine$handleMetadataResult_0;
  Coroutine$handleMetadataResult_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$blockRequired === void 0) 
          this.local$blockRequired = false;
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
        var tmp$_4;
        if ((tmp$ = this.$this.view.entity) != null) 
          tmp$_4 = tmp$;
        else {
          var $receiver = new ContentEntryWithBlockAndLanguage();
          var tmp$_5;
          if (this.local$blockRequired) {
            var $receiver_0 = new CourseBlock();
            var tmp$_6, tmp$_7;
            $receiver_0.cbClazzUid = (tmp$_7 = (tmp$_6 = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLongOrNull(tmp$_6) : null) != null ? tmp$_7 : L0;
            $receiver_0.cbType = 104;
            $receiver_0.cbUid = get_doorPrimaryKeyManager(this.$this.db).nextId_za3lpa$(124);
            tmp$_5 = $receiver_0;
          } else {
            tmp$_5 = null;
          }
          $receiver.block = tmp$_5;
          tmp$_4 = $receiver;
        }
        this.local$entityVal = tmp$_4;
        this.$this.view.metadataResult = this.local$metadataResult;
        this.local$plugin = (tmp$_0 = this.$this.pluginManager_0) != null ? tmp$_0.getPluginById_za3lpa$(this.local$metadataResult.pluginId) : null;
        this.local$uri = (tmp$_1 = this.local$metadataResult.entry.sourceUrl) != null ? tmp$_1 : '';
        this.state_0 = 2;
        this.result_0 = isRemote(DoorUri.Companion.parse_61zpoe$(this.local$uri), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var isRemote_0 = this.result_0;
        if (!isRemote_0 && ((tmp$_3 = (tmp$_2 = this.local$plugin != null ? this.local$plugin.supportedMimeTypes : null) != null ? firstOrNull(tmp$_2) : null) != null ? startsWith(tmp$_3, 'video/') : null) === true) {
          this.$this.view.videoUri = this.local$uri;
        }
        this.local$entityVal.title = this.local$metadataResult.entry.title;
        this.local$entityVal.description = this.local$metadataResult.entry.description;
        this.local$entityVal.sourceUrl = this.local$metadataResult.entry.sourceUrl;
        this.local$entityVal.entryId = this.local$metadataResult.entry.entryId;
        this.local$entityVal.author = this.local$metadataResult.entry.author;
        this.local$entityVal.contentTypeFlag = this.local$metadataResult.entry.contentTypeFlag;
        this.local$entityVal.publisher = this.local$metadataResult.entry.publisher;
        this.local$entityVal.languageVariantUid = this.local$metadataResult.entry.languageVariantUid;
        this.local$entityVal.primaryLanguageUid = this.local$metadataResult.entry.primaryLanguageUid;
        this.local$entityVal.contentFlags = this.local$metadataResult.entry.contentFlags;
        this.local$entityVal.leaf = this.local$metadataResult.entry.leaf;
        return this.local$entityVal;
      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);
};
  ContentEntryEdit2Presenter.prototype.handleMetadataResult_0 = function(metadataResult_0, blockRequired_0, continuation_0, suspended) {
  var instance = new Coroutine$handleMetadataResult_0(this, metadataResult_0, blockRequired_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$ContentEntryEdit2Presenter$handleClickSave$lambda$lambda(closure$entity_0, this$ContentEntryEdit2Presenter_0, txDb_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$ContentEntryEdit2Presenter = this$ContentEntryEdit2Presenter_0;
    this.local$tmp$ = void 0;
    this.local$txDb = txDb_0;
  }
  Coroutine$ContentEntryEdit2Presenter$handleClickSave$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryEdit2Presenter$handleClickSave$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryEdit2Presenter$handleClickSave$lambda$lambda.prototype.constructor = Coroutine$ContentEntryEdit2Presenter$handleClickSave$lambda$lambda;
  Coroutine$ContentEntryEdit2Presenter$handleClickSave$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (equals(this.local$closure$entity.contentEntryUid, L0)) {
          this.local$closure$entity.contentOwner = this.local$this$ContentEntryEdit2Presenter.accountManager.activeAccount.personUid;
          this.local$tmp$ = this.local$closure$entity;
          this.state_0 = 3;
          this.result_0 = this.local$txDb.contentEntryDao.insertAsync(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 2;
          this.result_0 = this.local$txDb.contentEntryDao.updateAsync_4pedz3$(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 8;
        continue;
      case 3:
        this.local$tmp$.contentEntryUid = this.result_0;
        if (this.local$closure$entity.entryId == null) {
          this.local$closure$entity.entryId = this.local$this$ContentEntryEdit2Presenter.accountManager.activeAccount.endpointUrl + (this.local$closure$entity.contentEntryUid.toString() + '/' + randomUuid());
          this.state_0 = 4;
          this.result_0 = this.local$txDb.contentEntryDao.updateAsync_4pedz3$(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 5;
          continue;
        }
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        if (!equals(this.local$this$ContentEntryEdit2Presenter.parentEntryUid_0, L0)) {
          var $receiver = new ContentEntryParentChildJoin();
          var closure$entity = this.local$closure$entity;
          var this$ContentEntryEdit2Presenter = this.local$this$ContentEntryEdit2Presenter;
          $receiver.cepcjChildContentEntryUid = closure$entity.contentEntryUid;
          $receiver.cepcjParentContentEntryUid = this$ContentEntryEdit2Presenter.parentEntryUid_0;
          var contentEntryJoin = $receiver;
          this.state_0 = 6;
          this.result_0 = this.local$txDb.contentEntryParentChildJoinDao.insertAsync(contentEntryJoin, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 7;
          continue;
        }
      case 6:
        this.state_0 = 7;
        continue;
      case 7:
        this.state_0 = 8;
        continue;
      case 8:
        var contentEntryPictureVal = this.local$this$ContentEntryEdit2Presenter.view.contentEntryPicture;
        if (contentEntryPictureVal != null) {
          contentEntryPictureVal.cepContentEntryUid = this.local$closure$entity.contentEntryUid;
          if (equals(contentEntryPictureVal.cepUid, L0)) {
            this.state_0 = 10;
            this.result_0 = this.local$txDb.contentEntryPictureDao.insertAsync(contentEntryPictureVal, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 9;
            this.result_0 = this.local$txDb.contentEntryPictureDao.updateAsync_vfioqn$(contentEntryPictureVal, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          }
        } else {
          this.state_0 = 12;
          continue;
        }
      case 9:
        this.state_0 = 11;
        continue;
      case 10:
        this.state_0 = 11;
        continue;
      case 11:
        this.state_0 = 12;
        continue;
      case 12:
        var language = this.local$closure$entity.language;
        if (language != null && equals(language.langUid, L0)) {
          this.state_0 = 13;
          this.result_0 = this.local$txDb.languageDao.insertAsync(language, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 14;
          continue;
        }
      case 13:
        return Unit;
      case 14:
        return Unit;
      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 ContentEntryEdit2Presenter$handleClickSave$lambda$lambda(closure$entity_0, this$ContentEntryEdit2Presenter_0) {
    return function(txDb_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryEdit2Presenter$handleClickSave$lambda$lambda(closure$entity_0, this$ContentEntryEdit2Presenter_0, txDb_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function ContentEntryEdit2Presenter$handleClickSave$lambda$lambda_0(this$ContentEntryEdit2Presenter, closure$entity, closure$conversionParams) {
    return function($receiver) {
  var tmp$;
  url($receiver, UMFileUtil_getInstance().joinPaths_vqirvp$([this$ContentEntryEdit2Presenter.accountManager.activeAccount.endpointUrl, '/import/downloadLink']));
  parameter($receiver, 'parentUid', this$ContentEntryEdit2Presenter.parentEntryUid_0);
  parameter($receiver, 'pluginId', (tmp$ = this$ContentEntryEdit2Presenter.view.metadataResult) != null ? tmp$.pluginId : null);
  parameter($receiver, 'url', closure$entity.sourceUrl);
  parameter($receiver, ContentEntryEdit2Presenter$Companion_getInstance().HTTP_PARAM_CONVERSION_PARAMS, Json.Default.encodeToString_tf03ej$(MapSerializer(serializer(kotlin_js_internal_StringCompanionObject), serializer(kotlin_js_internal_StringCompanionObject)), closure$conversionParams));
  header($receiver, 'content-type', 'application/json');
  $receiver.body = closure$entity;
  return Unit;
};
  }
  function ContentEntryEdit2Presenter$handleClickSave$lambda$lambda_1() {
    return Unit;
  }
  function Coroutine$ContentEntryEdit2Presenter$handleClickSave$lambda(closure$entity_0, this$ContentEntryEdit2Presenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 20;
    this.local$closure$entity = closure$entity_0;
    this.local$this$ContentEntryEdit2Presenter = this$ContentEntryEdit2Presenter_0;
    this.local$isNewEntry = void 0;
    this.local$metaData = void 0;
    this.local$conversionParams = void 0;
    this.local$$receiver = void 0;
    this.local$job = void 0;
    this.local$$receiver_0 = void 0;
    this.local$closure$entity_0 = void 0;
    this.local$this$ContentEntryEdit2Presenter_0 = void 0;
    this.local$tmp$ = void 0;
    this.local$response = void 0;
  }
  Coroutine$ContentEntryEdit2Presenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryEdit2Presenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryEdit2Presenter$handleClickSave$lambda.prototype.constructor = Coroutine$ContentEntryEdit2Presenter$handleClickSave$lambda;
  Coroutine$ContentEntryEdit2Presenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6, tmp$_7;
        if (this.local$this$ContentEntryEdit2Presenter.isImportValid_xj4pqf$(this.local$closure$entity)) {
          this.local$this$ContentEntryEdit2Presenter.saveDateTimeIntoEntity_xj4pqf$(this.local$closure$entity);
          var block = this.local$closure$entity.block;
          if (block != null) {
            var foundError = false;
            if (block.cbMaxPoints === 0) {
              this.local$this$ContentEntryEdit2Presenter.view.caMaxPointsError = this.local$this$ContentEntryEdit2Presenter.systemImpl.getString(2127, this.local$this$ContentEntryEdit2Presenter.context);
              foundError = true;
            } else {
              this.local$this$ContentEntryEdit2Presenter.view.caMaxPointsError = null;
            }
            if (block.cbDeadlineDate.compareTo_11rb$(block.cbHideUntilDate) <= 0) {
              this.local$this$ContentEntryEdit2Presenter.view.caDeadlineError = this.local$this$ContentEntryEdit2Presenter.systemImpl.getString(2679, this.local$this$ContentEntryEdit2Presenter.context);
              foundError = true;
            } else {
              this.local$this$ContentEntryEdit2Presenter.view.caDeadlineError = null;
            }
            if (block.cbGracePeriodDate.compareTo_11rb$(block.cbDeadlineDate) < 0) {
              this.local$this$ContentEntryEdit2Presenter.view.caGracePeriodError = this.local$this$ContentEntryEdit2Presenter.systemImpl.getString(2593, this.local$this$ContentEntryEdit2Presenter.context);
              foundError = true;
            } else {
              this.local$this$ContentEntryEdit2Presenter.view.caGracePeriodError = null;
            }
            if (foundError) {
              return;
            } else {
              this.state_0 = 1;
              continue;
            }
          } else {
            this.state_0 = 2;
            continue;
          }
        } else {
          this.local$this$ContentEntryEdit2Presenter.view.titleErrorEnabled = this.local$closure$entity.title == null;
          this.local$this$ContentEntryEdit2Presenter.view.fileImportErrorVisible = (this.local$closure$entity.title != null && this.local$closure$entity.leaf && ((tmp$_7 = (tmp$_6 = this.local$this$ContentEntryEdit2Presenter.view.metadataResult) != null ? tmp$_6.entry : null) != null ? tmp$_7.sourceUrl : null) == null);
          this.local$this$ContentEntryEdit2Presenter.view.loading = false;
          return this.local$this$ContentEntryEdit2Presenter.view.fieldsEnabled = true , Unit;
        }
      case 1:
        this.state_0 = 2;
        continue;
      case 2:
        var tmp$_8 = this.local$closure$entity;
        var tmp$_9;
        if ((tmp$ = this.local$this$ContentEntryEdit2Presenter.view.licenceOptions) != null) {
          var firstOrNull$result;
          firstOrNull$break:
            do {
              var tmp$_10;
              tmp$_10 = tmp$.iterator();
              while (tmp$_10.hasNext()) {
                var element = tmp$_10.next();
                var closure$entity = this.local$closure$entity;
                if (element.code === closure$entity.licenseType) {
                  firstOrNull$result = element;
                  break firstOrNull$break;
                }
              }
              firstOrNull$result = null;
            } while (false);
          tmp$_9 = firstOrNull$result;
        } else 
          tmp$_9 = null;
        tmp$_8.licenseName = toString(tmp$_9);
        this.local$isNewEntry = equals(this.local$closure$entity.contentEntryUid, L0);
        this.state_0 = 3;
        this.result_0 = withDoorTransactionAsync(this.local$this$ContentEntryEdit2Presenter.repo, getKClass(UmAppDatabase), ContentEntryEdit2Presenter$handleClickSave$lambda$lambda(this.local$closure$entity, this.local$this$ContentEntryEdit2Presenter), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$metaData = this.local$this$ContentEntryEdit2Presenter.view.metadataResult;
        var videoDimensions = this.local$this$ContentEntryEdit2Presenter.view.videoDimensions;
        this.local$conversionParams = mapOf([to('compress', this.local$this$ContentEntryEdit2Presenter.view.compressionEnabled.toString()), to('dimensions', videoDimensions.first.toString() + 'x' + videoDimensions.second)]);
        if (this.local$metaData != null) {
          if ((tmp$_1 = (tmp$_0 = this.local$closure$entity.sourceUrl) != null ? DoorUri.Companion.parse_61zpoe$(tmp$_0) : null) != null) {
            this.state_0 = 6;
            this.result_0 = this.local$this$ContentEntryEdit2Presenter.isRemoteOrServerUpload_qvpt4h$(tmp$_1, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.result_0 = null;
            this.state_0 = 7;
            continue;
          }
        } else {
          if (this.local$this$ContentEntryEdit2Presenter.arguments.containsKey_11rb$(ContentEntryList2Presenter$Companion_getInstance().KEY_SELECTED_ITEMS)) {
            var tmp$_11;
            if ((tmp$_4 = (tmp$_3 = this.local$this$ContentEntryEdit2Presenter.arguments.get_11rb$(ContentEntryList2Presenter$Companion_getInstance().KEY_SELECTED_ITEMS)) != null ? split(tmp$_3, [',']) : null) != null) {
              var destination = ArrayList_init_0(collectionSizeOrDefault(tmp$_4, 10));
              var tmp$_12;
              tmp$_12 = tmp$_4.iterator();
              while (tmp$_12.hasNext()) {
                var item = tmp$_12.next();
                var tmp$_13;
                destination.add_11rb$(toLong(trim(Kotlin.isCharSequence(tmp$_13 = item) ? tmp$_13 : throwCCE()).toString()));
              }
              tmp$_11 = destination;
            } else 
              tmp$_11 = null;
            var selectedItems = (tmp$_5 = tmp$_11) != null ? tmp$_5 : emptyList();
            this.state_0 = 4;
            this.result_0 = this.local$this$ContentEntryEdit2Presenter.repo.contentEntryParentChildJoinDao.moveListOfEntriesToNewParent_8jtwwy$(this.local$closure$entity.contentEntryUid, selectedItems, systemTimeInMillis(), this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 5;
            continue;
          }
        }
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        this.state_0 = 26;
        continue;
      case 6:
        this.state_0 = 7;
        continue;
      case 7:
        if (this.result_0 === false) {
          this.local$$receiver = new ContentJob();
          var this$ContentEntryEdit2Presenter = this.local$this$ContentEntryEdit2Presenter;
          var closure$entity_0 = this.local$closure$entity;
          var tmp$_14, tmp$_15, tmp$_16;
          this.local$$receiver.toUri = (tmp$_15 = (tmp$_14 = this$ContentEntryEdit2Presenter.view.storageOptions) != null ? tmp$_14.get_za3lpa$(this$ContentEntryEdit2Presenter.view.selectedStorageIndex) : null) != null ? tmp$_15.dirUri : null;
          this.local$$receiver.params = encodeStringMapToString(this$ContentEntryEdit2Presenter.json_0, this.local$conversionParams);
          this.local$$receiver.cjIsMeteredAllowed = false;
          this.local$$receiver.cjNotificationTitle = replace(this$ContentEntryEdit2Presenter.systemImpl.getString(2752, this$ContentEntryEdit2Presenter.context), '%1$s', (tmp$_16 = closure$entity_0.title) != null ? tmp$_16 : '');
          this.state_0 = 21;
          this.result_0 = this$ContentEntryEdit2Presenter.db.contentJobDao.insertAsync_d5tex6$(this.local$$receiver, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.exceptionState_0 = 17;
          var $receiver_0 = this.local$this$ContentEntryEdit2Presenter.httpClient_0;
          var block_0 = ContentEntryEdit2Presenter$handleClickSave$lambda$lambda_0(this.local$this$ContentEntryEdit2Presenter, this.local$closure$entity, this.local$conversionParams);
          var host;
          var body;
          host = 'localhost';
          body = utils.EmptyContent;
          var $receiver_1 = new HttpRequestBuilder_init();
          url_0($receiver_1, 'http', host, 0, '/');
          $receiver_1.method = HttpMethod.Companion.Post;
          $receiver_1.body = body;
          block_0($receiver_1);
          var $this_0 = new HttpStatement($receiver_1, $receiver_0);
          var tmp$_4_0, tmp$_5_0, tmp$_6_0;
          tmp$_4_0 = getKClass(HttpStatement);
          if (equals(tmp$_4_0, getKClass(HttpStatement))) {
            this.result_0 = Kotlin.isType(tmp$_5_0 = $this_0, HttpStatement) ? tmp$_5_0 : throwCCE();
            this.state_0 = 15;
            continue;
          } else {
            if (equals(tmp$_4_0, getKClass(HttpResponse))) {
              this.state_0 = 13;
              this.result_0 = $this_0.execute(this);
              if (this.result_0 === COROUTINE_SUSPENDED) 
                return COROUTINE_SUSPENDED;
              continue;
            } else {
              this.state_0 = 8;
              this.result_0 = $this_0.executeUnsafe(this);
              if (this.result_0 === COROUTINE_SUSPENDED) 
                return COROUTINE_SUSPENDED;
              continue;
            }
          }
        }
      case 8:
        this.local$response = this.result_0;
        this.exceptionState_0 = 11;
        var tmp$_7_0;
        var tmp$_8_0 = this.local$response.call;
        var typeInfo$result_0;
        typeInfo$break:
          do {
            try {
              typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(HttpStatement), createKType(getKClass(HttpStatement), [], false));
            }            catch (_) {
  typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(HttpStatement), null);
  break typeInfo$break;
}
          } while (false);
        this.state_0 = 9;
        this.result_0 = tmp$_8_0.receive_qi9ur9$(typeInfo$result_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 9:
        this.result_0 = Kotlin.isType(tmp$_7_0 = this.result_0, HttpStatement) ? tmp$_7_0 : throwCCE();
        this.exceptionState_0 = 17;
        this.finallyPath_0 = [10];
        this.state_0 = 12;
        continue;
      case 10:
        this.state_0 = 14;
        continue;
      case 11:
        this.finallyPath_0 = [17];
        this.state_0 = 12;
        continue;
      case 12:
        this.exceptionState_0 = 17;
        complete(this.local$response);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 13:
        this.result_0 = Kotlin.isType(tmp$_6_0 = this.result_0, HttpStatement) ? tmp$_6_0 : throwCCE();
        this.state_0 = 14;
        continue;
      case 14:
        this.state_0 = 15;
        continue;
      case 15:
        this.result_0;
        this.state_0 = 16;
        this.result_0 = this.result_0.execute(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 16:
        this.exceptionState_0 = 20;
        this.state_0 = 19;
        continue;
      case 17:
        this.exceptionState_0 = 20;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          this.local$this$ContentEntryEdit2Presenter.view.showSnackBar_9pu0dj$(this.local$this$ContentEntryEdit2Presenter.systemImpl.getString(2002, this.local$this$ContentEntryEdit2Presenter.context) + ': ' + ((tmp$_2 = e.message) != null ? tmp$_2 : ''), ContentEntryEdit2Presenter$handleClickSave$lambda$lambda_1);
          this.local$this$ContentEntryEdit2Presenter.view.loading = false;
          this.local$this$ContentEntryEdit2Presenter.view.fieldsEnabled = true;
          return;
        } else {
          throw e;
        }
      case 18:
        this.state_0 = 19;
        continue;
      case 19:
        this.local$this$ContentEntryEdit2Presenter.view.loading = false;
        this.local$this$ContentEntryEdit2Presenter.view.fieldsEnabled = true;
        var tmp$_17 = this.local$this$ContentEntryEdit2Presenter;
        var di = this.local$this$ContentEntryEdit2Presenter.di;
        var strategy = ListSerializer(ContentEntryWithBlockAndLanguage.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_18;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_18 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_18 : throwCCE(), null);
        tmp$_17.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
        return;
      case 20:
        throw this.exception_0;
      case 21:
        this.local$$receiver.cjUid = this.result_0;
        this.local$job = this.local$$receiver;
        this.local$$receiver_0 = new ContentJobItem();
        this.local$closure$entity_0 = this.local$closure$entity;
        this.local$this$ContentEntryEdit2Presenter_0 = this.local$this$ContentEntryEdit2Presenter;
        var tmp$_19, tmp$_20;
        this.local$$receiver_0.cjiJobUid = this.local$job.cjUid;
        this.local$$receiver_0.sourceUri = this.local$closure$entity_0.sourceUrl;
        if ((tmp$_19 = this.local$$receiver_0.sourceUri) != null) {
          this.state_0 = 22;
          this.result_0 = getSize(DoorUri.Companion.parse_61zpoe$(tmp$_19), this.local$this$ContentEntryEdit2Presenter_0.context, this.local$this$ContentEntryEdit2Presenter_0.di, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.local$tmp$ = null;
          this.state_0 = 23;
          continue;
        }
      case 22:
        this.local$tmp$ = this.result_0;
        this.state_0 = 23;
        continue;
      case 23:
        this.local$$receiver_0.cjiItemTotal = (tmp$_20 = this.local$tmp$) != null ? tmp$_20 : L0;
        this.local$$receiver_0.cjiPluginId = this.local$metaData.pluginId;
        this.local$$receiver_0.cjiContentEntryUid = this.local$closure$entity_0.contentEntryUid;
        this.local$$receiver_0.cjiIsLeaf = this.local$closure$entity_0.leaf;
        this.local$$receiver_0.cjiParentContentEntryUid = this.local$this$ContentEntryEdit2Presenter_0.parentEntryUid_0;
        this.local$$receiver_0.cjiConnectivityNeeded = false;
        this.local$$receiver_0.cjiStatus = 4;
        this.local$$receiver_0.cjiContentDeletedOnCancellation = this.local$isNewEntry;
        this.state_0 = 24;
        this.result_0 = this.local$this$ContentEntryEdit2Presenter_0.db.contentJobItemDao.insertJobItem_letzpf$(this.local$$receiver_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 24:
        this.local$$receiver_0.cjiUid = this.result_0;
        this.local$this$ContentEntryEdit2Presenter.contentJobManager_0.enqueueContentJob_iy18aq$(this.local$this$ContentEntryEdit2Presenter.accountManager.activeEndpoint, this.local$job.cjUid);
        this.local$this$ContentEntryEdit2Presenter.view.loading = false;
        this.local$this$ContentEntryEdit2Presenter.view.fieldsEnabled = true;
        var tmp$_21 = this.local$this$ContentEntryEdit2Presenter;
        var di_0 = this.local$this$ContentEntryEdit2Presenter.di;
        var strategy_0 = ListSerializer(ContentEntryWithBlockAndLanguage.Companion.serializer());
        var entity_0 = listOf_0(this.local$closure$entity);
        var tmp$_22;
        var json_0 = get_direct(di_0).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_22 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_22 : throwCCE(), null);
        tmp$_21.finishWithResult_61zpoe$(json_0.encodeToString_tf03ej$(strategy_0, entity_0));
        return;
      case 25:
        this.state_0 = 26;
        continue;
      case 26:
        this.local$this$ContentEntryEdit2Presenter.view.loading = false;
        this.local$this$ContentEntryEdit2Presenter.view.fieldsEnabled = true;
        var tmp$_23 = this.local$this$ContentEntryEdit2Presenter;
        var di_1 = this.local$this$ContentEntryEdit2Presenter.di;
        var strategy_1 = ListSerializer(ContentEntryWithBlockAndLanguage.Companion.serializer());
        var entity_1 = listOf_0(this.local$closure$entity);
        var tmp$_24;
        var json_1 = get_direct(di_1).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_24 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_24 : throwCCE(), null);
        return tmp$_23.finishWithResult_61zpoe$(json_1.encodeToString_tf03ej$(strategy_1, entity_1)) , Unit;
      case 27:
        return;
      default:
        this.state_0 = 20;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 20) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function ContentEntryEdit2Presenter$handleClickSave$lambda(closure$entity_0, this$ContentEntryEdit2Presenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryEdit2Presenter$handleClickSave$lambda(closure$entity_0, this$ContentEntryEdit2Presenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentEntryEdit2Presenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  this.view.loading = true;
  this.view.fieldsEnabled = false;
  this.view.titleErrorEnabled = false;
  this.view.fileImportErrorVisible = false;
  launch(this.presenterScope, doorMainDispatcher(), void 0, ContentEntryEdit2Presenter$handleClickSave$lambda(entity, this));
};
  ContentEntryEdit2Presenter.prototype.isImportValid_xj4pqf$ = function(entity) {
  return entity.title != null && (!entity.leaf || !equals(entity.contentEntryUid, L0) || (equals(entity.contentEntryUid, L0) && this.view.metadataResult != null));
};
  ContentEntryEdit2Presenter.prototype.onClickNewFolder = function() {
};
  ContentEntryEdit2Presenter.prototype.onClickImportFile = function() {
  var tmp$, tmp$_0, tmp$_1;
  var args = mutableMapOf([to(SelectFileView$Companion_getInstance().ARG_MIMETYPE_SELECTED, (tmp$_1 = (tmp$_0 = (tmp$ = this.pluginManager_0) != null ? tmp$.supportedMimeTypeList : null) != null ? joinToString(tmp$_0, ';') : null) != null ? tmp$_1 : '*/*'), to(UstadView$Companion_getInstance().ARG_LEAF, true.toString())]);
  putFromOtherMapIfPresent(args, this.arguments, UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID);
  putFromOtherMapIfPresent(args, this.arguments, ContentEntryEdit2View$Companion_getInstance().BLOCK_REQUIRED);
  putFromOtherMapIfPresent(args, this.arguments, UstadView$Companion_getInstance().ARG_CLAZZUID);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, SelectExtractFileView$Companion_getInstance().VIEW_NAME, getKClass(MetadataResult), MetadataResult$Companion_getInstance().serializer(), ContentEntryEdit2Presenter$Companion_getInstance().SAVED_STATE_KEY_METADATA, void 0, args));
};
  ContentEntryEdit2Presenter.prototype.onClickImportLink = function() {
  var args = mutableMapOf([to(UstadView$Companion_getInstance().ARG_LEAF, true.toString())]);
  putFromOtherMapIfPresent(args, this.arguments, UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID);
  putFromOtherMapIfPresent(args, this.arguments, ContentEntryEdit2View$Companion_getInstance().BLOCK_REQUIRED);
  putFromOtherMapIfPresent(args, this.arguments, UstadView$Companion_getInstance().ARG_CLAZZUID);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ContentEntryImportLinkView$Companion_getInstance().VIEW_NAME, getKClass(MetadataResult), MetadataResult$Companion_getInstance().serializer(), ContentEntryEdit2Presenter$Companion_getInstance().SAVED_STATE_KEY_METADATA, void 0, args));
};
  ContentEntryEdit2Presenter.prototype.onClickImportGallery = function() {
  var args = mutableMapOf([to(SelectFileView$Companion_getInstance().ARG_MIMETYPE_SELECTED, SelectFileView$Companion_getInstance().SELECTION_MODE_GALLERY), to(UstadView$Companion_getInstance().ARG_LEAF, true.toString())]);
  putFromOtherMapIfPresent(args, this.arguments, UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID);
  putFromOtherMapIfPresent(args, this.arguments, ContentEntryEdit2View$Companion_getInstance().BLOCK_REQUIRED);
  putFromOtherMapIfPresent(args, this.arguments, UstadView$Companion_getInstance().ARG_CLAZZUID);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, SelectExtractFileView$Companion_getInstance().VIEW_NAME, getKClass(MetadataResult), MetadataResult$Companion_getInstance().serializer(), ContentEntryEdit2Presenter$Companion_getInstance().SAVED_STATE_KEY_METADATA, void 0, args));
};
  ContentEntryEdit2Presenter.prototype.handleClickLanguage = function() {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, LanguageListView$Companion_getInstance().VIEW_NAME, getKClass(Language), Language.Companion.serializer(), ContentEntryEdit2Presenter$Companion_getInstance().SAVEDSTATE_KEY_LANGUAGE));
};
  ContentEntryEdit2Presenter.prototype.onClickAddFolder = function() {
  var args = mutableMapOf([to(UstadView$Companion_getInstance().ARG_LEAF, true.toString())]);
  putFromOtherMapIfPresent(args, this.arguments, UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, SelectFolderView$Companion_getInstance().VIEW_NAME, PrimitiveClasses$stringClass, serializer(kotlin_js_internal_StringCompanionObject), ContentEntryEdit2Presenter$Companion_getInstance().SAVED_STATE_KEY_URI, void 0, args));
};
  function ContentEntryEdit2Presenter$Companion() {
    ContentEntryEdit2Presenter$Companion_instance = this;
    this.SAVED_STATE_KEY_URI = 'URI';
    this.SAVEDSTATE_KEY_LANGUAGE = 'Language';
    this.SAVED_STATE_KEY_METADATA = 'importedMetadata';
    this.SAVED_STATE_CONTENTENTRY_PICTURE = 'contentEntryPicture';
    this.HTTP_PARAM_CONVERSION_PARAMS = 'conversionParams';
  }
  ContentEntryEdit2Presenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ContentEntryEdit2Presenter$Companion_instance = null;
  function ContentEntryEdit2Presenter$Companion_getInstance() {
    if (ContentEntryEdit2Presenter$Companion_instance === null) {
      new ContentEntryEdit2Presenter$Companion();
    }
    return ContentEntryEdit2Presenter$Companion_instance;
  }
  ContentEntryEdit2Presenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContentEntryEdit2Presenter', 
  interfaces: [ContentEntryAddOptionsListener, UstadEditPresenter]};
  function post$lambda_1($receiver) {
    return Unit;
  }
  function ContentEntryImportLinkPresenter(context, arguments_0, view, di) {
    UstadBaseController.call(this, context, arguments_0, view, di);
    var tmp$;
    this.accountManager_roxiwp$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, ContentEntryImportLinkPresenter$accountManager_metadata);
    var tmp$_0;
    this.systemImpl_fl7ai$_0 = Instance(this, Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, ContentEntryImportLinkPresenter$systemImpl_metadata);
    var tmp$_1;
    this.currentHttpClient_hoeozz$_0 = Instance(this, Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(HttpClient), [], false)), TypeToken) ? tmp$_1 : throwCCE(), null).provideDelegate_tpuvb9$(this, ContentEntryImportLinkPresenter$currentHttpClient_metadata);
  }
  var ContentEntryImportLinkPresenter$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(ContentEntryImportLinkPresenter.prototype, 'accountManager', {
  configurable: true, 
  get: function() {
  return this.accountManager_roxiwp$_0.value;
}});
  var ContentEntryImportLinkPresenter$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(ContentEntryImportLinkPresenter.prototype, 'systemImpl', {
  configurable: true, 
  get: function() {
  return this.systemImpl_fl7ai$_0.value;
}});
  var ContentEntryImportLinkPresenter$currentHttpClient_metadata = new PropertyMetadata('currentHttpClient');
  Object.defineProperty(ContentEntryImportLinkPresenter.prototype, 'currentHttpClient_0', {
  configurable: true, 
  get: function() {
  return this.currentHttpClient_hoeozz$_0.value;
}});
  function ContentEntryImportLinkPresenter$handleClickDone$lambda$lambda(this$ContentEntryImportLinkPresenter, closure$link) {
    return function($receiver) {
  url($receiver, UMFileUtil_getInstance().joinPaths_vqirvp$([this$ContentEntryImportLinkPresenter.accountManager.activeAccount.endpointUrl, '/import/validateLink']));
  parameter($receiver, 'url', closure$link);
  set_expectSuccess($receiver, false);
  return Unit;
};
  }
  function Coroutine$ContentEntryImportLinkPresenter$handleClickDone$lambda$lambda(this$ContentEntryImportLinkPresenter_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$this$ContentEntryImportLinkPresenter = this$ContentEntryImportLinkPresenter_0;
    this.local$it = it_0;
  }
  Coroutine$ContentEntryImportLinkPresenter$handleClickDone$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryImportLinkPresenter$handleClickDone$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryImportLinkPresenter$handleClickDone$lambda$lambda.prototype.constructor = Coroutine$ContentEntryImportLinkPresenter$handleClickDone$lambda$lambda;
  Coroutine$ContentEntryImportLinkPresenter$handleClickDone$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var status = this.local$it.status;
        if (status.value !== 200) {
          this.local$this$ContentEntryImportLinkPresenter.view.validLink = false;
          this.local$this$ContentEntryImportLinkPresenter.view.inProgress = false;
          return;
        } else {
          this.state_0 = 2;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        var tmp$_1;
        var tmp$_2 = this.local$it.call;
        var typeInfo$result_0;
        typeInfo$break:
          do {
            try {
              typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(MetadataResult), createKType(getKClass(MetadataResult), [], false));
            }            catch (_) {
  typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(MetadataResult), null);
  break typeInfo$break;
}
          } while (false);
        this.state_0 = 3;
        this.result_0 = tmp$_2.receive_qi9ur9$(typeInfo$result_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.result_0 = Kotlin.isType(tmp$_1 = this.result_0, MetadataResult) ? tmp$_1 : throwCCE();
        var data = this.result_0;
        this.local$this$ContentEntryImportLinkPresenter.view.inProgress = false;
        if (equals(this.local$this$ContentEntryImportLinkPresenter.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_RESULT_DEST_VIEWNAME), ContentEntryEdit2View$Companion_getInstance().VIEW_NAME)) {
          var tmp$ = this.local$this$ContentEntryImportLinkPresenter;
          var di = this.local$this$ContentEntryImportLinkPresenter.di;
          var strategy = ListSerializer(MetadataResult$Companion_getInstance().serializer());
          var entity = listOf_0(data);
          var tmp$_0;
          var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
          return tmp$.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity)) , Unit;
        } else {
          var args = LinkedHashMap_init();
          putEntityAsJson(args, ContentEntryEdit2View$Companion_getInstance().ARG_IMPORTED_METADATA, MetadataResult$Companion_getInstance().serializer(), data);
          putFromOtherMapIfPresent(args, this.local$this$ContentEntryImportLinkPresenter.arguments, UstadView$Companion_getInstance().ARG_LEAF);
          putFromOtherMapIfPresent(args, this.local$this$ContentEntryImportLinkPresenter.arguments, UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID);
          putFromOtherMapIfPresent(args, this.local$this$ContentEntryImportLinkPresenter.arguments, ContentEntryEdit2View$Companion_getInstance().BLOCK_REQUIRED);
          putFromOtherMapIfPresent(args, this.local$this$ContentEntryImportLinkPresenter.arguments, UstadView$Companion_getInstance().ARG_CLAZZUID);
          return this.local$this$ContentEntryImportLinkPresenter.navigateForResult_r13zgt$(new NavigateForResultOptions(this.local$this$ContentEntryImportLinkPresenter, null, ContentEntryEdit2View$Companion_getInstance().VIEW_NAME, getKClass(ContentEntry), ContentEntry.Companion.serializer(), void 0, void 0, args)) , Unit;
        }
      case 4:
        return;
      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 ContentEntryImportLinkPresenter$handleClickDone$lambda$lambda_0(this$ContentEntryImportLinkPresenter_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryImportLinkPresenter$handleClickDone$lambda$lambda(this$ContentEntryImportLinkPresenter_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ContentEntryImportLinkPresenter$handleClickDone$lambda(this$ContentEntryImportLinkPresenter_0, closure$link_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 13;
    this.local$this$ContentEntryImportLinkPresenter = this$ContentEntryImportLinkPresenter_0;
    this.local$closure$link = closure$link_0;
    this.local$response = void 0;
  }
  Coroutine$ContentEntryImportLinkPresenter$handleClickDone$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryImportLinkPresenter$handleClickDone$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryImportLinkPresenter$handleClickDone$lambda.prototype.constructor = Coroutine$ContentEntryImportLinkPresenter$handleClickDone$lambda;
  Coroutine$ContentEntryImportLinkPresenter$handleClickDone$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$this$ContentEntryImportLinkPresenter.view.inProgress = true;
        this.exceptionState_0 = 10;
        var $receiver_0 = this.local$this$ContentEntryImportLinkPresenter.currentHttpClient_0;
        var block = ContentEntryImportLinkPresenter$handleClickDone$lambda$lambda(this.local$this$ContentEntryImportLinkPresenter, this.local$closure$link);
        var host;
        var body;
        host = 'localhost';
        body = utils.EmptyContent;
        var $receiver_1 = new HttpRequestBuilder_init();
        url_0($receiver_1, 'http', host, 0, '/');
        $receiver_1.method = HttpMethod.Companion.Post;
        $receiver_1.body = body;
        block($receiver_1);
        var $this_0 = new HttpStatement($receiver_1, $receiver_0);
        var tmp$_4, tmp$_5, tmp$_6;
        tmp$_4 = getKClass(HttpStatement);
        if (equals(tmp$_4, getKClass(HttpStatement))) {
          this.result_0 = Kotlin.isType(tmp$_5 = $this_0, HttpStatement) ? tmp$_5 : throwCCE();
          this.state_0 = 8;
          continue;
        } else {
          if (equals(tmp$_4, getKClass(HttpResponse))) {
            this.state_0 = 6;
            this.result_0 = $this_0.execute(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 1;
            this.result_0 = $this_0.executeUnsafe(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          }
        }
      case 1:
        this.local$response = this.result_0;
        this.exceptionState_0 = 4;
        var tmp$_7;
        var tmp$_8 = this.local$response.call;
        var typeInfo$result_0;
        typeInfo$break:
          do {
            try {
              typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(HttpStatement), createKType(getKClass(HttpStatement), [], false));
            }            catch (_) {
  typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(HttpStatement), null);
  break typeInfo$break;
}
          } while (false);
        this.state_0 = 2;
        this.result_0 = tmp$_8.receive_qi9ur9$(typeInfo$result_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 2:
        this.result_0 = Kotlin.isType(tmp$_7 = this.result_0, HttpStatement) ? tmp$_7 : throwCCE();
        this.exceptionState_0 = 10;
        this.finallyPath_0 = [3];
        this.state_0 = 5;
        continue;
      case 3:
        this.state_0 = 7;
        continue;
      case 4:
        this.finallyPath_0 = [10];
        this.state_0 = 5;
        continue;
      case 5:
        this.exceptionState_0 = 10;
        complete(this.local$response);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 6:
        this.result_0 = Kotlin.isType(tmp$_6 = this.result_0, HttpStatement) ? tmp$_6 : throwCCE();
        this.state_0 = 7;
        continue;
      case 7:
        this.state_0 = 8;
        continue;
      case 8:
        this.result_0;
        this.state_0 = 9;
        this.result_0 = this.result_0.execute_2rh6on$(ContentEntryImportLinkPresenter$handleClickDone$lambda$lambda_0(this.local$this$ContentEntryImportLinkPresenter), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 9:
        return this.result_0;
      case 10:
        this.exceptionState_0 = 13;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          this.local$this$ContentEntryImportLinkPresenter.view.inProgress = false;
          this.local$this$ContentEntryImportLinkPresenter.view.showSnackBar_9pu0dj$(this.local$this$ContentEntryImportLinkPresenter.systemImpl.getString(2278, this.local$this$ContentEntryImportLinkPresenter.context));
          return napier.Napier.e_82mfvz$('Exception attempting to input import link url', e) , Unit;
        } else {
          throw e;
        }
      case 11:
        this.state_0 = 12;
        continue;
      case 12:
        return;
      case 13:
        throw this.exception_0;
      default:
        this.state_0 = 13;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 13) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function ContentEntryImportLinkPresenter$handleClickDone$lambda(this$ContentEntryImportLinkPresenter_0, closure$link_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryImportLinkPresenter$handleClickDone$lambda(this$ContentEntryImportLinkPresenter_0, closure$link_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentEntryImportLinkPresenter.prototype.handleClickDone_61zpoe$ = function(link) {
  launch(this.presenterScope, doorMainDispatcher(), void 0, ContentEntryImportLinkPresenter$handleClickDone$lambda(this, link));
};
  ContentEntryImportLinkPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContentEntryImportLinkPresenter', 
  interfaces: [UstadBaseController]};
  function ContentEntryList2Presenter(context, arguments_0, view, di, lifecycleOwner, contentEntryListItemListener) {
    ContentEntryList2Presenter$Companion_getInstance();
    var tmp$, tmp$_0;
    if (contentEntryListItemListener === void 0) {
      contentEntryListItemListener = new DefaultContentEntryListItemListener(view, void 0, void 0, (tmp$_0 = (tmp$ = arguments_0.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0, context, di);
    }
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.contentEntryListItemListener = contentEntryListItemListener;
    var tmp$_1;
    this.navController_59tsuf$_0 = Instance(this, Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UstadNavController), [], false)), TypeToken) ? tmp$_1 : throwCCE(), null).provideDelegate_tpuvb9$(this, ContentEntryList2Presenter$navController_metadata);
    var context_0 = this.accountManager.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_2;
    var tmp$_3;
    this.pluginManager_g1g0qq$_0 = InstanceOrNull(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_2 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(ContentPluginManager), [], false)), TypeToken) ? tmp$_3 : throwCCE(), null).provideDelegate_tpuvb9$(this, ContentEntryList2Presenter$pluginManager_metadata);
    this.contentFilter_0 = ContentEntryList2View$Companion_getInstance().ARG_DISPLAY_CONTENT_BY_PARENT;
    this.onlyFolderFilter_0 = false;
    this.loggedPersonUid_0 = L0;
    this.parentEntryUidStack_0 = ArrayList_init();
    this.movingSelectedItems_0 = null;
    this.selectedChipOption_0 = 0;
    this.editVisible_0 = CompletableDeferred();
    this.showHiddenEntries_0 = false;
  }
  var ContentEntryList2Presenter$navController_metadata = new PropertyMetadata('navController');
  Object.defineProperty(ContentEntryList2Presenter.prototype, 'navController_0', {
  configurable: true, 
  get: function() {
  return this.navController_59tsuf$_0.value;
}});
  var ContentEntryList2Presenter$pluginManager_metadata = new PropertyMetadata('pluginManager');
  Object.defineProperty(ContentEntryList2Presenter.prototype, 'pluginManager_0', {
  configurable: true, 
  get: function() {
  return this.pluginManager_g1g0qq$_0.value;
}});
  Object.defineProperty(ContentEntryList2Presenter.prototype, 'parentEntryUid_0', {
  configurable: true, 
  get: function() {
  var tmp$;
  return (tmp$ = lastOrNull(this.parentEntryUidStack_0)) != null ? tmp$ : L0;
}});
  Object.defineProperty(ContentEntryList2Presenter.prototype, 'sortOptions', {
  configurable: true, 
  get: function() {
  return ContentEntryList2Presenter$Companion_getInstance().SORT_OPTIONS;
}});
  function Coroutine$ContentEntryList2Presenter$onCreate$lambda(this$ContentEntryList2Presenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ContentEntryList2Presenter = this$ContentEntryList2Presenter_0;
    this.local$tmp$ = void 0;
  }
  Coroutine$ContentEntryList2Presenter$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryList2Presenter$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryList2Presenter$onCreate$lambda.prototype.constructor = Coroutine$ContentEntryList2Presenter$onCreate$lambda;
  Coroutine$ContentEntryList2Presenter$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (equals(this.local$this$ContentEntryList2Presenter.contentFilter_0, ContentEntryList2View$Companion_getInstance().ARG_DISPLAY_CONTENT_BY_PARENT)) {
          this.local$tmp$ = this.local$this$ContentEntryList2Presenter.view;
          this.state_0 = 2;
          this.result_0 = this.local$this$ContentEntryList2Presenter.onCheckUpdatePermission(this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.local$tmp$.editOptionVisible = this.result_0;
        return this.local$this$ContentEntryList2Presenter.editVisible_0.complete_11rb$(this.local$this$ContentEntryList2Presenter.view.editOptionVisible) , Unit;
      case 3:
        return Unit;
      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 ContentEntryList2Presenter$onCreate$lambda(this$ContentEntryList2Presenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryList2Presenter$onCreate$lambda(this$ContentEntryList2Presenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentEntryList2Presenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.contentEntryListItemListener.mListMode = this.mListMode;
  this.contentEntryListItemListener.presenter = this;
  this.selectedSortOption = ContentEntryList2Presenter$Companion_getInstance().SORT_OPTIONS.get_za3lpa$(0);
  this.contentFilter_0 = (tmp$ = this.arguments.get_11rb$(ContentEntryList2View$Companion_getInstance().ARG_DISPLAY_CONTENT_BY_OPTION)) != null ? tmp$ : ContentEntryList2View$Companion_getInstance().ARG_DISPLAY_CONTENT_BY_PARENT;
  this.onlyFolderFilter_0 = (tmp$_1 = (tmp$_0 = this.arguments.get_11rb$(ContentEntryList2View$Companion_getInstance().ARG_SHOW_ONLY_FOLDER_FILTER)) != null ? toBoolean(tmp$_0) : null) != null ? tmp$_1 : false;
  var tmp$_4, tmp$_5;
  var $receiver = this.parentEntryUidStack_0;
  var element = (tmp$_5 = (tmp$_4 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID)) != null ? toLongOrNull(tmp$_4) : null) != null ? tmp$_5 : UstadView$Companion_getInstance().MASTER_SERVER_ROOT_ENTRY_UID;
  $receiver.add_11rb$(element);
  this.loggedPersonUid_0 = this.accountManager.activeAccount.personUid;
  this.showHiddenEntries_0 = false;
  tmp$_3 = this.view;
  if (equals(this.arguments.get_11rb$(ContentEntryList2View$Companion_getInstance().ARG_USE_CHIPS), true.toString())) {
    var $receiver_0 = ContentEntryList2Presenter$Companion_getInstance().PICKER_CHIP_OPTIONS;
    var destination = ArrayList_init_0(collectionSizeOrDefault($receiver_0, 10));
    var tmp$_6;
    tmp$_6 = $receiver_0.iterator();
    while (tmp$_6.hasNext()) {
      var item = tmp$_6.next();
      destination.add_11rb$(new ListFilterIdOption(this.systemImpl.getString(item.first, this.context), item.second));
    }
    tmp$_2 = destination;
  } else {
    tmp$_2 = emptyList();
  }
  tmp$_3.listFilterOptionChips = tmp$_2;
  this.getAndSetList_0();
  launch(this.presenterScope, doorMainDispatcher(), void 0, ContentEntryList2Presenter$onCreate$lambda(this));
};
  ContentEntryList2Presenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  return this.db.entityRoleDao.userHasTableLevelPermission_3pjtqy$(this.accountManager.activeAccount.personUid, Role$Companion$PERMISSION_CONTENT_INSERT, continuation);
};
  ContentEntryList2Presenter.prototype.onCheckUpdatePermission = function(continuation) {
  return this.db.entityRoleDao.userHasTableLevelPermission_3pjtqy$(this.accountManager.activeAccount.personUid, Role$Companion$PERMISSION_CONTENT_UPDATE, continuation);
};
  ContentEntryList2Presenter.prototype.onClickSort_o8nuns$ = function(sortOption) {
  UstadListPresenter.prototype.onClickSort_o8nuns$.call(this, sortOption);
  this.getAndSetList_0();
};
  function Coroutine$ContentEntryList2Presenter$getAndSetList$lambda(this$ContentEntryList2Presenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ContentEntryList2Presenter = this$ContentEntryList2Presenter_0;
  }
  Coroutine$ContentEntryList2Presenter$getAndSetList$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryList2Presenter$getAndSetList$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryList2Presenter$getAndSetList$lambda.prototype.constructor = Coroutine$ContentEntryList2Presenter$getAndSetList$lambda;
  Coroutine$ContentEntryList2Presenter$getAndSetList$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        var $receiver = this.local$this$ContentEntryList2Presenter.db;
        if ((tmp$_0 = (tmp$ = !equals(this.local$this$ContentEntryList2Presenter.parentEntryUid_0, L0) ? $receiver : null) != null ? tmp$.contentEntryDao : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_0.findTitleByUidAsync_s8cxhz$(this.local$this$ContentEntryList2Presenter.parentEntryUid_0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        continue;
      case 3:
        var tmp$_2;
        if ((tmp$_1 = this.result_0) != null) {
          var tmp$_3;
          var $receiver_0 = this.local$this$ContentEntryList2Presenter.view;
                    (tmp$_3 = !isBlank(tmp$_1) ? $receiver_0 : null) != null ? (tmp$_3.title = tmp$_1) : null;
          tmp$_2 = Unit;
        } else 
          tmp$_2 = null;
        return tmp$_2;
      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 ContentEntryList2Presenter$getAndSetList$lambda(this$ContentEntryList2Presenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryList2Presenter$getAndSetList$lambda(this$ContentEntryList2Presenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentEntryList2Presenter.prototype.getAndSetList_0 = function() {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6, tmp$_7, tmp$_8, tmp$_9, tmp$_10, tmp$_11, tmp$_12, tmp$_13, tmp$_14, tmp$_15;
  tmp$_15 = this.view;
  if (this.selectedChipOption_0 === 1) 
    tmp$_14 = this.repo.contentEntryDao.getContentByOwner_s8cxhz$(this.loggedPersonUid_0);
  else if (this.selectedChipOption_0 === 2) 
    tmp$_14 = this.repo.contentEntryDao.getContentFromMyCourses_s8cxhz$(this.loggedPersonUid_0);
  else if (this.selectedChipOption_0 === 3) {
    tmp$_5 = this.repo.contentEntryDao;
    tmp$ = this.parentEntryUid_0;
    tmp$_0 = this.loggedPersonUid_0;
    tmp$_1 = this.onlyFolderFilter_0;
    tmp$_4 = (tmp$_3 = (tmp$_2 = this.selectedSortOption) != null ? tmp$_2.flag : null) != null ? tmp$_3 : 1;
    tmp$_14 = tmp$_5.getChildrenByParentUidWithCategoryFilterOrderByNameAsc(tmp$, L0, L0, tmp$_0, false, tmp$_1, tmp$_4);
  } else if (equals(this.contentFilter_0, ContentEntryList2View$Companion_getInstance().ARG_DISPLAY_CONTENT_BY_PARENT)) {
    tmp$_13 = this.repo.contentEntryDao;
    tmp$_6 = this.parentEntryUid_0;
    tmp$_7 = this.loggedPersonUid_0;
    tmp$_8 = this.showHiddenEntries_0;
    tmp$_9 = this.onlyFolderFilter_0;
    tmp$_12 = (tmp$_11 = (tmp$_10 = this.selectedSortOption) != null ? tmp$_10.flag : null) != null ? tmp$_11 : 1;
    tmp$_14 = tmp$_13.getChildrenByParentUidWithCategoryFilterOrderByNameAsc(tmp$_6, L0, L0, tmp$_7, tmp$_8, tmp$_9, tmp$_12);
  } else 
    tmp$_14 = null;
  tmp$_15.list = tmp$_14;
  launch(this.presenterScope, doorMainDispatcher(), void 0, ContentEntryList2Presenter$getAndSetList$lambda(this));
};
  function Coroutine$onCheckListSelectionOptions_tn71rk$($this, account_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
  }
  Coroutine$onCheckListSelectionOptions_tn71rk$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onCheckListSelectionOptions_tn71rk$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onCheckListSelectionOptions_tn71rk$.prototype.constructor = Coroutine$onCheckListSelectionOptions_tn71rk$;
  Coroutine$onCheckListSelectionOptions_tn71rk$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.state_0 = 2;
        this.result_0 = this.$this.editVisible_0.await(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var isVisible = this.result_0;
        if (equals(this.$this.contentFilter_0, ContentEntryList2View$Companion_getInstance().ARG_DISPLAY_CONTENT_BY_PARENT)) {
          tmp$ = isVisible ? listOf([SelectionOption$MOVE_getInstance(), SelectionOption$HIDE_getInstance()]) : emptyList();
        } else {
          tmp$ = emptyList();
        }
        return tmp$;
      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);
};
  ContentEntryList2Presenter.prototype.onCheckListSelectionOptions_tn71rk$ = function(account_0, continuation_0, suspended) {
  var instance = new Coroutine$onCheckListSelectionOptions_tn71rk$(this, account_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ContentEntryList2Presenter.prototype.handleSelectionOptionChanged_4ezy6h$ = function(t) {
  if (!this.view.editOptionVisible) {
    return;
  }
  if (equals(this.contentFilter_0, ContentEntryList2View$Companion_getInstance().ARG_DISPLAY_CONTENT_BY_PARENT)) {
    var tmp$ = this.view;
    var all$result;
    all$break:
      do {
        var tmp$_0;
        if (Kotlin.isType(t, Collection) && t.isEmpty()) {
          all$result = true;
          break all$break;
        }
        tmp$_0 = t.iterator();
        while (tmp$_0.hasNext()) {
          var element = tmp$_0.next();
          if (!element.ceInactive) {
            all$result = false;
            break all$break;
          }
        }
        all$result = true;
      } while (false);
    tmp$.selectionOptions = all$result ? listOf([SelectionOption$MOVE_getInstance(), SelectionOption$UNHIDE_getInstance()]) : listOf([SelectionOption$MOVE_getInstance(), SelectionOption$HIDE_getInstance()]);
  }
};
  function Coroutine$ContentEntryList2Presenter$handleClickSelectionOption$lambda(closure$option_0, closure$selectedContentEntryParentChildUids_0, this$ContentEntryList2Presenter_0, closure$selectedContentEntryUids_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$option = closure$option_0;
    this.local$closure$selectedContentEntryParentChildUids = closure$selectedContentEntryParentChildUids_0;
    this.local$this$ContentEntryList2Presenter = this$ContentEntryList2Presenter_0;
    this.local$closure$selectedContentEntryUids = closure$selectedContentEntryUids_0;
  }
  Coroutine$ContentEntryList2Presenter$handleClickSelectionOption$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryList2Presenter$handleClickSelectionOption$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryList2Presenter$handleClickSelectionOption$lambda.prototype.constructor = Coroutine$ContentEntryList2Presenter$handleClickSelectionOption$lambda;
  Coroutine$ContentEntryList2Presenter$handleClickSelectionOption$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        switch (this.local$closure$option.name) {
          case 'MOVE':
            return this.local$this$ContentEntryList2Presenter.handleClickMove_0(this.local$closure$selectedContentEntryParentChildUids) , Unit;
          case 'HIDE':
            if (equals(this.local$this$ContentEntryList2Presenter.contentFilter_0, ContentEntryList2View$Companion_getInstance().ARG_DISPLAY_CONTENT_BY_PARENT)) {
              this.state_0 = 3;
              this.result_0 = this.local$this$ContentEntryList2Presenter.repo.contentEntryDao.toggleVisibilityContentEntryItems_cbj1f0$(true, this.local$closure$selectedContentEntryUids, systemTimeInMillis(), this);
              if (this.result_0 === COROUTINE_SUSPENDED) 
                return COROUTINE_SUSPENDED;
              continue;
            } else {
              this.state_0 = 4;
              continue;
            }
          case 'UNHIDE':
            this.state_0 = 2;
            this.result_0 = this.local$this$ContentEntryList2Presenter.repo.contentEntryDao.toggleVisibilityContentEntryItems_cbj1f0$(false, this.local$closure$selectedContentEntryUids, systemTimeInMillis(), this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          default:
            return Unit;
        }
      case 1:
        throw this.exception_0;
      case 2:
        return Unit;
      case 3:
        return Unit;
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        return Unit;
      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 ContentEntryList2Presenter$handleClickSelectionOption$lambda(closure$option_0, closure$selectedContentEntryParentChildUids_0, this$ContentEntryList2Presenter_0, closure$selectedContentEntryUids_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryList2Presenter$handleClickSelectionOption$lambda(closure$option_0, closure$selectedContentEntryParentChildUids_0, this$ContentEntryList2Presenter_0, closure$selectedContentEntryUids_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentEntryList2Presenter.prototype.handleClickSelectionOption_psq284$ = function(selectedItem, option) {
  var destination = ArrayList_init_0(collectionSizeOrDefault(selectedItem, 10));
  var tmp$;
  tmp$ = selectedItem.iterator();
  while (tmp$.hasNext()) {
    var item = tmp$.next();
    destination.add_11rb$(item.contentEntryUid);
  }
  var selectedContentEntryUids = destination;
  var destination_0 = ArrayList_init();
  var tmp$_0;
  tmp$_0 = selectedItem.iterator();
  while (tmp$_0.hasNext()) {
    var element = tmp$_0.next();
    var tmp$_0_0;
    var tmp$_1, tmp$_2, tmp$_3;
    if ((tmp$_0_0 = (tmp$_3 = (tmp$_2 = Kotlin.isType(tmp$_1 = element, ContentEntryWithParentChildJoinAndStatusAndMostRecentContainer) ? tmp$_1 : null) != null ? tmp$_2.contentEntryParentChildJoin : null) != null ? tmp$_3.cepcjUid : null) != null) {
      destination_0.add_11rb$(tmp$_0_0);
    }
  }
  var selectedContentEntryParentChildUids = destination_0;
  launch(this.presenterScope, doorMainDispatcher(), void 0, ContentEntryList2Presenter$handleClickSelectionOption$lambda(option, selectedContentEntryParentChildUids, this, selectedContentEntryUids));
};
  function Coroutine$ContentEntryList2Presenter$onListFilterOptionSelected$lambda(this$ContentEntryList2Presenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ContentEntryList2Presenter = this$ContentEntryList2Presenter_0;
    this.local$tmp$_0 = void 0;
  }
  Coroutine$ContentEntryList2Presenter$onListFilterOptionSelected$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryList2Presenter$onListFilterOptionSelected$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryList2Presenter$onListFilterOptionSelected$lambda.prototype.constructor = Coroutine$ContentEntryList2Presenter$onListFilterOptionSelected$lambda;
  Coroutine$ContentEntryList2Presenter$onListFilterOptionSelected$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.local$tmp$_0 = this.local$this$ContentEntryList2Presenter.view;
        this.state_0 = 2;
        this.result_0 = this.local$this$ContentEntryList2Presenter.onCheckUpdatePermission(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (this.result_0) {
          tmp$ = ListViewAddMode$FIRST_ITEM_getInstance();
        } else {
          tmp$ = ListViewAddMode$NONE_getInstance();
        }
        return this.local$tmp$_0.addMode = tmp$ , Unit;
      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 ContentEntryList2Presenter$onListFilterOptionSelected$lambda(this$ContentEntryList2Presenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryList2Presenter$onListFilterOptionSelected$lambda(this$ContentEntryList2Presenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentEntryList2Presenter.prototype.onListFilterOptionSelected_5mmfk3$ = function(filterOptionId) {
  this.selectedChipOption_0 = filterOptionId.optionId;
  this.parentEntryUidStack_0.clear();
  if (filterOptionId.optionId === 3) {
    launch(this.presenterScope, void 0, void 0, ContentEntryList2Presenter$onListFilterOptionSelected$lambda(this));
    var $receiver = this.parentEntryUidStack_0;
    var element = UstadView$Companion_getInstance().MASTER_SERVER_ROOT_ENTRY_UID;
    $receiver.add_11rb$(element);
  } else {
    var $receiver_0 = this.parentEntryUidStack_0;
    var element_0 = L0;
    $receiver_0.add_11rb$(element_0);
    this.view.addMode = ListViewAddMode$FIRST_ITEM_getInstance();
  }
  this.getAndSetList_0();
};
  ContentEntryList2Presenter.prototype.handleClickMove_0 = function(childrenToMove) {
  var args = mutableMapOf([to(UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID, UstadView$Companion_getInstance().MASTER_SERVER_ROOT_ENTRY_UID.toString()), to(ContentEntryList2View$Companion_getInstance().ARG_DISPLAY_CONTENT_BY_OPTION, ContentEntryList2View$Companion_getInstance().ARG_DISPLAY_CONTENT_BY_PARENT), to(ContentEntryList2View$Companion_getInstance().ARG_SHOW_ONLY_FOLDER_FILTER, true.toString()), to(ContentEntryList2Presenter$Companion_getInstance().KEY_SELECTED_ITEMS, joinToString(childrenToMove, ','))]);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ContentEntryList2View$Companion_getInstance().FOLDER_VIEW_NAME, getKClass(ContentEntry), ContentEntry.Companion.serializer(), ContentEntryList2Presenter$Companion_getInstance().SAVEDSTATE_KEY_FOLDER, true, args));
};
  function ContentEntryList2Presenter$handleMoveContentEntries$lambda$lambda(this$ContentEntryList2Presenter, closure$destContentEntryUid) {
    return function() {
  this$ContentEntryList2Presenter.systemImpl.go_gofqk3$(ContentEntryList2View$Companion_getInstance().VIEW_NAME, mapOf([to(UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID, closure$destContentEntryUid.toString()), to(ContentEntryList2View$Companion_getInstance().ARG_DISPLAY_CONTENT_BY_OPTION, ContentEntryList2View$Companion_getInstance().ARG_DISPLAY_CONTENT_BY_PARENT)]), this$ContentEntryList2Presenter.context);
  return Unit;
};
  }
  function Coroutine$ContentEntryList2Presenter$handleMoveContentEntries$lambda(this$ContentEntryList2Presenter_0, closure$destContentEntryUid_0, closure$parentChildJoinUids_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ContentEntryList2Presenter = this$ContentEntryList2Presenter_0;
    this.local$closure$destContentEntryUid = closure$destContentEntryUid_0;
    this.local$closure$parentChildJoinUids = closure$parentChildJoinUids_0;
  }
  Coroutine$ContentEntryList2Presenter$handleMoveContentEntries$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryList2Presenter$handleMoveContentEntries$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryList2Presenter$handleMoveContentEntries$lambda.prototype.constructor = Coroutine$ContentEntryList2Presenter$handleMoveContentEntries$lambda;
  Coroutine$ContentEntryList2Presenter$handleMoveContentEntries$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$ContentEntryList2Presenter.repo.contentEntryParentChildJoinDao.moveListOfEntriesToNewParent_8jtwwy$(this.local$closure$destContentEntryUid, this.local$closure$parentChildJoinUids, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        return this.local$this$ContentEntryList2Presenter.view.showSnackBar_9pu0dj$(replace(this.local$this$ContentEntryList2Presenter.systemImpl.getString(2678, this.local$this$ContentEntryList2Presenter.context), '%1$s', this.local$closure$parentChildJoinUids.size.toString()), ContentEntryList2Presenter$handleMoveContentEntries$lambda$lambda(this.local$this$ContentEntryList2Presenter, this.local$closure$destContentEntryUid), 2184) , Unit;
      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 ContentEntryList2Presenter$handleMoveContentEntries$lambda(this$ContentEntryList2Presenter_0, closure$destContentEntryUid_0, closure$parentChildJoinUids_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryList2Presenter$handleMoveContentEntries$lambda(this$ContentEntryList2Presenter_0, closure$destContentEntryUid_0, closure$parentChildJoinUids_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentEntryList2Presenter.prototype.handleMoveContentEntries_ejltwb$ = function(parentChildJoinUids, destContentEntryUid) {
  if (!parentChildJoinUids.isEmpty()) {
    launch(this.presenterScope, doorMainDispatcher(), void 0, ContentEntryList2Presenter$handleMoveContentEntries$lambda(this, destContentEntryUid, parentChildJoinUids));
  }
};
  ContentEntryList2Presenter.prototype.openContentEntryBranchPicker_4pedz3$ = function(entry) {
  var $receiver = this.parentEntryUidStack_0;
  var element = entry.contentEntryUid;
  $receiver.add_11rb$(element);
  this.showContentEntryListByParentUid_0();
};
  ContentEntryList2Presenter.prototype.showContentEntryListByParentUid_0 = function() {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5;
  tmp$_5 = this.view;
  tmp$_4 = this.repo.contentEntryDao;
  tmp$ = this.parentEntryUid_0;
  tmp$_0 = this.loggedPersonUid_0;
  tmp$_3 = (tmp$_2 = (tmp$_1 = this.selectedSortOption) != null ? tmp$_1.flag : null) != null ? tmp$_2 : 1;
  tmp$_5.list = tmp$_4.getChildrenByParentUidWithCategoryFilterOrderByNameAsc(tmp$, L0, L0, tmp$_0, false, false, tmp$_3);
};
  ContentEntryList2Presenter.prototype.handleOnBackPressed = function() {
  var tmp$ = this.mListMode === ListViewMode$PICKER_getInstance();
  if (tmp$) {
    tmp$ = this.parentEntryUidStack_0.size > 1;
  }
  if (tmp$) {
    this.parentEntryUidStack_0.removeAt_za3lpa$(this.parentEntryUidStack_0.size - 1 | 0);
    this.showContentEntryListByParentUid_0();
    return true;
  }
  return false;
};
  ContentEntryList2Presenter.prototype.handleEntrySelectedFromPicker_dup0gu$ = function(entry) {
  if (this.arguments.containsKey_11rb$(ContentEntryEdit2View$Companion_getInstance().BLOCK_REQUIRED)) {
    var args = LinkedHashMap_init();
    var key = UstadView$Companion_getInstance().ARG_LEAF;
    var value = true.toString();
    args.put_xwzc9p$(key, value);
    var key_0 = UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID;
    var value_0 = this.parentEntryUid_0.toString();
    args.put_xwzc9p$(key_0, value_0);
    var key_1 = UstadView$Companion_getInstance().ARG_ENTITY_UID;
    var value_1 = entry.contentEntryUid.toString();
    args.put_xwzc9p$(key_1, value_1);
    putFromOtherMapIfPresent(args, this.arguments, ContentEntryEdit2View$Companion_getInstance().BLOCK_REQUIRED);
    putFromOtherMapIfPresent(args, this.arguments, UstadView$Companion_getInstance().ARG_CLAZZUID);
    this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ContentEntryEdit2View$Companion_getInstance().VIEW_NAME, getKClass(ContentEntryWithBlockAndLanguage), ContentEntryWithBlockAndLanguage.Companion.serializer(), void 0, void 0, args));
  } else {
    var di = this.di;
    var strategy = ListSerializer(ContentEntry.Companion.serializer());
    var entity = listOf_0(entry);
    var tmp$;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
    this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
  }
};
  ContentEntryList2Presenter.prototype.handleClickCreateNewFab = function() {
  this.view.showContentEntryAddOptions();
};
  ContentEntryList2Presenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
  this.handleClickCreateNewFab();
};
  ContentEntryList2Presenter.prototype.handleClickEditFolder = function() {
  var args = mutableMapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, this.parentEntryUid_0.toString())]);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ContentEntryEdit2View$Companion_getInstance().VIEW_NAME, getKClass(ContentEntry), ContentEntry.Companion.serializer(), void 0, void 0, args));
};
  ContentEntryList2Presenter.prototype.handleClickShowHiddenItems = function() {
  this.showHiddenEntries_0 = true;
  this.getAndSetList_0();
};
  ContentEntryList2Presenter.prototype.onClickNewFolder = function() {
  var args = mutableMapOf([to(UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID, this.parentEntryUid_0.toString()), to(UstadView$Companion_getInstance().ARG_LEAF, false.toString())]);
  putFromOtherMapIfPresent(args, this.arguments, ContentEntryList2Presenter$Companion_getInstance().KEY_SELECTED_ITEMS);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ContentEntryEdit2View$Companion_getInstance().VIEW_NAME, getKClass(ContentEntry), ContentEntry.Companion.serializer(), void 0, void 0, args));
};
  ContentEntryList2Presenter.prototype.handleOnClickAddSupportedFile = function() {
  var supportedMimeTypes = joinToString(mutableListOf([joinToString(SupportedContent_getInstance().EPUB_MIME_TYPES, ';'), joinToString(SupportedContent_getInstance().EPUB_EXTENSIONS, ';'), joinToString(SupportedContent_getInstance().XAPI_MIME_TYPES, ';'), joinToString(SupportedContent_getInstance().ZIP_EXTENSIONS, ';'), joinToString(SupportedContent_getInstance().H5P_MIME_TYPES, ';'), joinToString(SupportedContent_getInstance().H5P_EXTENSIONS, ';'), SelectFileView$Companion_getInstance().SELECTION_MODE_GALLERY]), ';');
  var args = mutableMapOf([to(SelectFileView$Companion_getInstance().ARG_MIMETYPE_SELECTED, supportedMimeTypes), to(UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID, this.parentEntryUid_0.toString()), to(UstadView$Companion_getInstance().ARG_LEAF, true.toString())]);
  putFromOtherMapIfPresent(args, this.arguments, ContentEntryList2Presenter$Companion_getInstance().KEY_SELECTED_ITEMS);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, SelectFileView$Companion_getInstance().VIEW_NAME, getKClass(ContentEntry), ContentEntry.Companion.serializer(), void 0, void 0, args));
};
  ContentEntryList2Presenter.prototype.onClickImportFile = function() {
  var tmp$, tmp$_0, tmp$_1;
  var args = mutableMapOf([to(SelectFileView$Companion_getInstance().ARG_MIMETYPE_SELECTED, (tmp$_1 = (tmp$_0 = (tmp$ = this.pluginManager_0) != null ? tmp$.supportedMimeTypeList : null) != null ? joinToString(tmp$_0, ';') : null) != null ? tmp$_1 : '*/*'), to(UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID, this.parentEntryUid_0.toString()), to(UstadView$Companion_getInstance().ARG_LEAF, true.toString())]);
  putFromOtherMapIfPresent(args, this.arguments, ContentEntryList2Presenter$Companion_getInstance().KEY_SELECTED_ITEMS);
  putFromOtherMapIfPresent(args, this.arguments, ContentEntryEdit2View$Companion_getInstance().BLOCK_REQUIRED);
  putFromOtherMapIfPresent(args, this.arguments, UstadView$Companion_getInstance().ARG_CLAZZUID);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, SelectExtractFileView$Companion_getInstance().VIEW_NAME, getKClass(ContentEntry), ContentEntry.Companion.serializer(), void 0, void 0, args));
};
  ContentEntryList2Presenter.prototype.onClickImportLink = function() {
  var args = mutableMapOf([to(UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID, this.parentEntryUid_0.toString()), to(UstadView$Companion_getInstance().ARG_LEAF, true.toString())]);
  putFromOtherMapIfPresent(args, this.arguments, ContentEntryList2Presenter$Companion_getInstance().KEY_SELECTED_ITEMS);
  putFromOtherMapIfPresent(args, this.arguments, ContentEntryEdit2View$Companion_getInstance().BLOCK_REQUIRED);
  putFromOtherMapIfPresent(args, this.arguments, UstadView$Companion_getInstance().ARG_CLAZZUID);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ContentEntryImportLinkView$Companion_getInstance().VIEW_NAME, getKClass(ContentEntry), ContentEntry.Companion.serializer(), void 0, void 0, args));
};
  ContentEntryList2Presenter.prototype.onClickImportGallery = function() {
  var args = mutableMapOf([to(SelectFileView$Companion_getInstance().ARG_MIMETYPE_SELECTED, SelectFileView$Companion_getInstance().SELECTION_MODE_GALLERY), to(UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID, this.parentEntryUid_0.toString()), to(UstadView$Companion_getInstance().ARG_LEAF, true.toString())]);
  putFromOtherMapIfPresent(args, this.arguments, ContentEntryList2Presenter$Companion_getInstance().KEY_SELECTED_ITEMS);
  putFromOtherMapIfPresent(args, this.arguments, ContentEntryEdit2View$Companion_getInstance().BLOCK_REQUIRED);
  putFromOtherMapIfPresent(args, this.arguments, UstadView$Companion_getInstance().ARG_CLAZZUID);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, SelectExtractFileView$Companion_getInstance().VIEW_NAME, getKClass(ContentEntry), ContentEntry.Companion.serializer(), void 0, void 0, args));
};
  ContentEntryList2Presenter.prototype.onClickAddFolder = function() {
  var args = mutableMapOf([to(UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID, this.parentEntryUid_0.toString()), to(UstadView$Companion_getInstance().ARG_LEAF, true.toString())]);
  putFromOtherMapIfPresent(args, this.arguments, ContentEntryList2Presenter$Companion_getInstance().KEY_SELECTED_ITEMS);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, SelectFolderView$Companion_getInstance().VIEW_NAME, getKClass(ContentEntry), ContentEntry.Companion.serializer(), void 0, void 0, args));
};
  function Coroutine$ContentEntryList2Presenter$handleMoveWithSelectedEntry$lambda(this$ContentEntryList2Presenter_0, closure$entry_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ContentEntryList2Presenter = this$ContentEntryList2Presenter_0;
    this.local$closure$entry = closure$entry_0;
  }
  Coroutine$ContentEntryList2Presenter$handleMoveWithSelectedEntry$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ContentEntryList2Presenter$handleMoveWithSelectedEntry$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ContentEntryList2Presenter$handleMoveWithSelectedEntry$lambda.prototype.constructor = Coroutine$ContentEntryList2Presenter$handleMoveWithSelectedEntry$lambda;
  Coroutine$ContentEntryList2Presenter$handleMoveWithSelectedEntry$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        if (this.local$this$ContentEntryList2Presenter.arguments.containsKey_11rb$(ContentEntryList2Presenter$Companion_getInstance().KEY_SELECTED_ITEMS)) {
          var tmp$_2;
          if ((tmp$_0 = (tmp$ = this.local$this$ContentEntryList2Presenter.arguments.get_11rb$(ContentEntryList2Presenter$Companion_getInstance().KEY_SELECTED_ITEMS)) != null ? split(tmp$, [',']) : null) != null) {
            var destination = ArrayList_init_0(collectionSizeOrDefault(tmp$_0, 10));
            var tmp$_3;
            tmp$_3 = tmp$_0.iterator();
            while (tmp$_3.hasNext()) {
              var item = tmp$_3.next();
              var tmp$_4;
              destination.add_11rb$(toLong(trim(Kotlin.isCharSequence(tmp$_4 = item) ? tmp$_4 : throwCCE()).toString()));
            }
            tmp$_2 = destination;
          } else 
            tmp$_2 = null;
          var selectedItems = (tmp$_1 = tmp$_2) != null ? tmp$_1 : emptyList();
          this.state_0 = 2;
          this.result_0 = this.local$this$ContentEntryList2Presenter.repo.contentEntryParentChildJoinDao.moveListOfEntriesToNewParent_8jtwwy$(this.local$closure$entry.contentEntryUid, selectedItems, systemTimeInMillis(), this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        return Unit;
      case 3:
        return Unit;
      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 ContentEntryList2Presenter$handleMoveWithSelectedEntry$lambda(this$ContentEntryList2Presenter_0, closure$entry_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ContentEntryList2Presenter$handleMoveWithSelectedEntry$lambda(this$ContentEntryList2Presenter_0, closure$entry_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ContentEntryList2Presenter.prototype.handleMoveWithSelectedEntry_dup0gu$ = function(entry) {
  launch(this.presenterScope, doorMainDispatcher(), void 0, ContentEntryList2Presenter$handleMoveWithSelectedEntry$lambda(this, entry));
};
  function ContentEntryList2Presenter$Companion() {
    ContentEntryList2Presenter$Companion_instance = this;
    this.KEY_SELECTED_ITEMS = 'selected_items';
    this.SAVEDSTATE_KEY_FOLDER = 'Folder_ContentEntry';
    this.CHIP_ID_MY_CONTENT = 1;
    this.CHIP_ID_FROM_MY_COURSES = 2;
    this.CHIP_ID_LIBRARY = 3;
    this.SORT_OPTIONS = listOf([new SortOrderOption(2102, 1, true), new SortOrderOption(2102, 2, false)]);
    this.PICKER_CHIP_OPTIONS = listOf([to(2787, 1), to(2786, 2), to(2913, 3)]);
  }
  ContentEntryList2Presenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ContentEntryList2Presenter$Companion_instance = null;
  function ContentEntryList2Presenter$Companion_getInstance() {
    if (ContentEntryList2Presenter$Companion_instance === null) {
      new ContentEntryList2Presenter$Companion();
    }
    return ContentEntryList2Presenter$Companion_instance;
  }
  ContentEntryList2Presenter.prototype.onClickContentEntry_dup0gu$ = function(entry) {
  return this.contentEntryListItemListener.onClickContentEntry_dup0gu$(entry);
};
  ContentEntryList2Presenter.prototype.onClickDownloadContentEntry_dup0gu$ = function(entry) {
  return this.contentEntryListItemListener.onClickDownloadContentEntry_dup0gu$(entry);
};
  ContentEntryList2Presenter.prototype.onClickSelectContentEntry_dup0gu$ = function(entry) {
  return this.contentEntryListItemListener.onClickSelectContentEntry_dup0gu$(entry);
};
  ContentEntryList2Presenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContentEntryList2Presenter', 
  interfaces: [ContentEntryAddOptionsListener, ContentEntryListItemListener, UstadListPresenter]};
  function ContentEntryListItemListener() {
  }
  ContentEntryListItemListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContentEntryListItemListener', 
  interfaces: []};
  function ContentWithAttemptListener() {
  }
  ContentWithAttemptListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContentWithAttemptListener', 
  interfaces: []};
  function CourseDiscussionDetailPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(CourseDiscussionDetailPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$LIVEDATA_getInstance();
}});
  CourseDiscussionDetailPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  return false;
};
  CourseDiscussionDetailPresenter.prototype.onLoadLiveData_7hogkd$ = function(repo) {
  var tmp$, tmp$_0;
  var entityUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  this.view.topics = repo.discussionTopicDao.getListOfTopicsByDiscussion_s8cxhz$(entityUid);
  return repo.courseDiscussionDao.getCourseDiscussionByUid_s8cxhz$(entityUid);
};
  CourseDiscussionDetailPresenter.prototype.handleClickEdit = function() {
};
  CourseDiscussionDetailPresenter.prototype.onClickTopic_5oep0w$ = function(discussionTopic) {
  var tmp$, tmp$_0;
  var args = LinkedHashMap_init();
  var key = UstadView$Companion_getInstance().ARG_ENTITY_UID;
  var value = (tmp$ = discussionTopic.discussionTopicUid.toString()) != null ? tmp$ : '';
  args.put_xwzc9p$(key, value);
    (tmp$_0 = this.ustadNavController) != null ? (tmp$_0.navigate_oc2wlg$(DiscussionTopicDetailView$Companion_getInstance().VIEW_NAME, args) , Unit) : null;
};
  CourseDiscussionDetailPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'CourseDiscussionDetailPresenter', 
  interfaces: [UstadDetailPresenter]};
  function CourseDiscussionEditPresenter(context, arguments_0, view, lifecycleOwner, di) {
    CourseDiscussionEditPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.clazzUid_0 = L0;
    this.topicsOneToManyJoinEditHelper_0 = new OneToManyJoinEditHelperMp(getPropertyCallableRef('discussionTopicUid', 1, function($receiver) {
  return $receiver.discussionTopicUid;
}, function($receiver, value) {
  $receiver.discussionTopicUid = value;
}), CourseDiscussionEditPresenter$Companion_getInstance().ARG_SAVEDSTATE_DISCUSSION_TOPIC, ListSerializer(DiscussionTopic.Companion.serializer()), ListSerializer(DiscussionTopic.Companion.serializer()), this, this.requireSavedStateHandle(), getKClass(DiscussionTopic), void 0, CourseDiscussionEditPresenter$topicsOneToManyJoinEditHelper$lambda);
  }
  Object.defineProperty(CourseDiscussionEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$JSON_getInstance();
}});
  CourseDiscussionEditPresenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
  this.view.topicList = this.topicsOneToManyJoinEditHelper_0.liveList;
};
  function CourseDiscussionEditPresenter$onLoadDataComplete$lambda(this$CourseDiscussionEditPresenter) {
    return function(it) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var newTopic = tmp$;
  var tmp$_4;
  if ((tmp$_0 = this$CourseDiscussionEditPresenter.topicsOneToManyJoinEditHelper_0.liveList.getValue()) != null) {
    var firstOrNull$result;
    firstOrNull$break:
      do {
        var tmp$_5;
        tmp$_5 = tmp$_0.iterator();
        while (tmp$_5.hasNext()) {
          var element = tmp$_5.next();
          if (equals(element.discussionTopicUid, newTopic.discussionTopicUid)) {
            firstOrNull$result = element;
            break firstOrNull$break;
          }
        }
        firstOrNull$result = null;
      } while (false);
    tmp$_4 = firstOrNull$result;
  } else 
    tmp$_4 = null;
  var tmp$_6;
  if ((tmp$_1 = tmp$_4) != null) 
    tmp$_6 = tmp$_1;
  else {
    var $receiver = new DiscussionTopic();
    var this$CourseDiscussionEditPresenter_0 = this$CourseDiscussionEditPresenter;
    var tmp$_7, tmp$_8;
    $receiver.discussionTopicUid = newTopic.discussionTopicUid;
    $receiver.discussionTopicStartDate = systemTimeInMillis();
    $receiver.discussionTopicCourseDiscussionUid = (tmp$_8 = (tmp$_7 = this$CourseDiscussionEditPresenter_0.entity) != null ? tmp$_7.cbEntityUid : null) != null ? tmp$_8 : L0;
    $receiver.discussionTopicTitle = newTopic.discussionTopicTitle;
    $receiver.discussionTopicDesc = newTopic.discussionTopicDesc;
    tmp$_6 = $receiver;
  }
  var foundTopic = tmp$_6;
  foundTopic.discussionTopicTitle = newTopic.discussionTopicTitle;
  foundTopic.discussionTopicDesc = newTopic.discussionTopicDesc;
  foundTopic.discussionTopicClazzUid = (tmp$_3 = (tmp$_2 = this$CourseDiscussionEditPresenter.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$_2) : null) != null ? tmp$_3 : L0;
  this$CourseDiscussionEditPresenter.topicsOneToManyJoinEditHelper_0.onEditResult_trkh7z$(foundTopic);
  this$CourseDiscussionEditPresenter.requireSavedStateHandle().set_umlfku$(CourseDiscussionEditPresenter$Companion_getInstance().SAVEDSTATE_KEY_DISCUSSION_TOPIC, null);
  return Unit;
};
  }
  CourseDiscussionEditPresenter.prototype.onLoadDataComplete = function() {
  UstadEditPresenter.prototype.onLoadDataComplete.call(this);
  this.observeSavedStateResult_27fjeh$(CourseDiscussionEditPresenter$Companion_getInstance().SAVEDSTATE_KEY_DISCUSSION_TOPIC, ListSerializer(DiscussionTopic.Companion.serializer()), getKClass(DiscussionTopic), new DoorObserver(CourseDiscussionEditPresenter$onLoadDataComplete$lambda(this)));
};
  function Coroutine$CourseDiscussionEditPresenter$onLoadFromJson$lambda$lambda(this$CourseDiscussionEditPresenter_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$this$CourseDiscussionEditPresenter = this$CourseDiscussionEditPresenter_0;
    this.local$it = it_0;
  }
  Coroutine$CourseDiscussionEditPresenter$onLoadFromJson$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$CourseDiscussionEditPresenter$onLoadFromJson$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$CourseDiscussionEditPresenter$onLoadFromJson$lambda$lambda.prototype.constructor = Coroutine$CourseDiscussionEditPresenter$onLoadFromJson$lambda$lambda;
  Coroutine$CourseDiscussionEditPresenter$onLoadFromJson$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.clazzDao.getClazzWithSchool_s8cxhz$(this.local$this$CourseDiscussionEditPresenter.clazzUid_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 CourseDiscussionEditPresenter$onLoadFromJson$lambda$lambda(this$CourseDiscussionEditPresenter_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$CourseDiscussionEditPresenter$onLoadFromJson$lambda$lambda(this$CourseDiscussionEditPresenter_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$CourseDiscussionEditPresenter$onLoadFromJson$lambda(closure$editEntity_0, this$CourseDiscussionEditPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$editEntity = closure$editEntity_0;
    this.local$this$CourseDiscussionEditPresenter = this$CourseDiscussionEditPresenter_0;
  }
  Coroutine$CourseDiscussionEditPresenter$onLoadFromJson$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$CourseDiscussionEditPresenter$onLoadFromJson$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$CourseDiscussionEditPresenter$onLoadFromJson$lambda.prototype.constructor = Coroutine$CourseDiscussionEditPresenter$onLoadFromJson$lambda;
  Coroutine$CourseDiscussionEditPresenter$onLoadFromJson$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
        this.local$this$CourseDiscussionEditPresenter.clazzUid_0 = (tmp$_2 = (tmp$_1 = (tmp$ = this.local$closure$editEntity.courseDiscussion) != null ? tmp$.courseDiscussionClazzUid : null) != null ? tmp$_1 : (tmp$_0 = this.local$this$CourseDiscussionEditPresenter.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$_0) : null) != null ? tmp$_2 : L0;
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$this$CourseDiscussionEditPresenter.db, L2000, CourseDiscussionEditPresenter$onLoadFromJson$lambda$lambda(this.local$this$CourseDiscussionEditPresenter), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var clazzWithSchool = (tmp$_3 = this.result_0) != null ? tmp$_3 : new ClazzWithSchool();
        var timeZone = effectiveTimeZone(clazzWithSchool);
        this.local$this$CourseDiscussionEditPresenter.view.timeZone = timeZone;
        return this.local$this$CourseDiscussionEditPresenter.loadEntityIntoDateTime_gqx91x$(this.local$closure$editEntity) , Unit;
      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 CourseDiscussionEditPresenter$onLoadFromJson$lambda(closure$editEntity_0, this$CourseDiscussionEditPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$CourseDiscussionEditPresenter$onLoadFromJson$lambda(closure$editEntity_0, this$CourseDiscussionEditPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  CourseDiscussionEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$, tmp$_0;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = CourseBlockWithEntity.Companion.serializer();
    var tmp$_1;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_1 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    var $receiver = new CourseBlockWithEntity();
    var tmp$_2, tmp$_3;
    $receiver.cbUid = get_doorPrimaryKeyManager(this.db).nextId_za3lpa$(124);
    $receiver.cbClazzUid = (tmp$_3 = (tmp$_2 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$_2) : null) != null ? tmp$_3 : L0;
    $receiver.cbEntityUid = get_doorPrimaryKeyManager(this.db).nextId_za3lpa$(130);
    $receiver.cbType = 105;
    var $receiver_0 = new CourseDiscussion();
    var tmp$_4, tmp$_5;
    $receiver_0.courseDiscussionUid = $receiver.cbEntityUid;
    $receiver_0.courseDiscussionClazzUid = (tmp$_5 = (tmp$_4 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$_4) : null) != null ? tmp$_5 : L0;
    $receiver.courseDiscussion = $receiver_0;
    tmp$ = $receiver;
  }
  var editEntity = tmp$;
  this.topicsOneToManyJoinEditHelper_0.onLoadFromJsonSavedState_alv73c$(bundle);
  this.topicsOneToManyJoinEditHelper_0.liveList.sendValue_11rb$((tmp$_0 = editEntity.topics) != null ? tmp$_0 : emptyList());
  launch(this.presenterScope, void 0, void 0, CourseDiscussionEditPresenter$onLoadFromJson$lambda(editEntity, this));
  return editEntity;
};
  CourseDiscussionEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  if (entityVal != null) {
    this.saveDateTimeIntoEntity_0(entityVal);
    entityVal.topics = this.topicsOneToManyJoinEditHelper_0.liveList.getValue();
  }
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  CourseDiscussionEditPresenter.prototype.loadEntityIntoDateTime_gqx91x$ = function(entity) {
  var tmp$;
  var timeZone = (tmp$ = this.view.timeZone) != null ? tmp$ : 'UTC';
  if (!equals(entity.cbHideUntilDate, L0)) {
    var startDateTimeMidnight = toLocalMidnight(DateTime.Companion.invoke_s8cxhz$(entity.cbHideUntilDate), timeZone).unixMillisLong;
    this.view.startDate = startDateTimeMidnight;
    this.view.startTime = entity.cbHideUntilDate.subtract(startDateTimeMidnight);
  } else {
    this.view.startDate = L0;
  }
};
  CourseDiscussionEditPresenter.prototype.saveDateTimeIntoEntity_0 = function(entity) {
  var tmp$;
  var timeZone = (tmp$ = this.view.timeZone) != null ? tmp$ : 'UTC';
  var $receiver = toOffsetByTimezone(DateTime.Companion.invoke_s8cxhz$(this.view.startDate), timeZone);
  var $receiver_0 = $receiver.hours;
  var tmp$_0 = TimeSpan.Companion.fromHours_14dthe$($receiver_0);
  var $receiver_1 = $receiver.minutes;
  var tmp$_1 = tmp$_0.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_1));
  var $receiver_2 = $receiver.seconds;
  var tmp$_2 = tmp$_1.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_2));
  var $receiver_3 = $receiver.milliseconds;
  entity.cbHideUntilDate = $receiver.minus_fv8bff$(tmp$_2.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_3))).utc.unixMillisLong.add(this.view.startTime);
};
  CourseDiscussionEditPresenter.prototype.handleClickDeleteTopic_1ddffl$ = function(discussionTopic) {
  this.topicsOneToManyJoinEditHelper_0.onDeactivateEntity_trkh7z$(discussionTopic);
};
  CourseDiscussionEditPresenter.prototype.handleClickTopic_1ddffl$ = function(discussionTopic) {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, discussionTopic, DiscussionTopicEditView$Companion_getInstance().VIEW_NAME, getKClass(DiscussionTopic), DiscussionTopic.Companion.serializer(), CourseDiscussionEditPresenter$Companion_getInstance().SAVEDSTATE_KEY_DISCUSSION_TOPIC, void 0, mutableMapOf([to(UstadView$Companion_getInstance().ARG_CLAZZUID, this.clazzUid_0.toString())])));
};
  CourseDiscussionEditPresenter.prototype.handleClickAddTopic = function() {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, DiscussionTopicEditView$Companion_getInstance().VIEW_NAME, getKClass(DiscussionTopic), DiscussionTopic.Companion.serializer(), CourseDiscussionEditPresenter$Companion_getInstance().SAVEDSTATE_KEY_DISCUSSION_TOPIC, void 0, toMutableMap(this.arguments)));
};
  function Coroutine$CourseDiscussionEditPresenter$handleClickSave$lambda(closure$entity_0, this$CourseDiscussionEditPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$CourseDiscussionEditPresenter = this$CourseDiscussionEditPresenter_0;
  }
  Coroutine$CourseDiscussionEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$CourseDiscussionEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$CourseDiscussionEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$CourseDiscussionEditPresenter$handleClickSave$lambda;
  Coroutine$CourseDiscussionEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.local$this$CourseDiscussionEditPresenter.saveDateTimeIntoEntity_0(this.local$closure$entity);
        var foundError = false;
        var $receiver = (tmp$ = this.local$closure$entity.courseDiscussion) != null ? tmp$.courseDiscussionTitle : null;
        if ($receiver == null || $receiver.length === 0) {
          this.local$this$CourseDiscussionEditPresenter.view.blockTitleError = this.local$this$CourseDiscussionEditPresenter.systemImpl.getString(2127, this.local$this$CourseDiscussionEditPresenter.context);
          foundError = true;
        } else {
          this.local$this$CourseDiscussionEditPresenter.view.blockTitleError = null;
        }
        if (foundError) {
          return;
        }
        this.local$this$CourseDiscussionEditPresenter.view.loading = true;
        this.local$this$CourseDiscussionEditPresenter.view.fieldsEnabled = false;
        this.local$closure$entity.topics = plus_0(this.local$this$CourseDiscussionEditPresenter.topicsOneToManyJoinEditHelper_0.entitiesToInsert, this.local$this$CourseDiscussionEditPresenter.topicsOneToManyJoinEditHelper_0.entitiesToUpdate);
        this.local$closure$entity.topicUidsToRemove = this.local$this$CourseDiscussionEditPresenter.topicsOneToManyJoinEditHelper_0.primaryKeysToDeactivate;
        var tmp$_0 = this.local$this$CourseDiscussionEditPresenter;
        var di = this.local$this$CourseDiscussionEditPresenter.di;
        var strategy = ListSerializer(CourseBlockWithEntity.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_1;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_1 : throwCCE(), null);
        tmp$_0.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
        this.local$this$CourseDiscussionEditPresenter.view.loading = false;
        return this.local$this$CourseDiscussionEditPresenter.view.fieldsEnabled = true , Unit;
      case 1:
        throw this.exception_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 CourseDiscussionEditPresenter$handleClickSave$lambda(closure$entity_0, this$CourseDiscussionEditPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$CourseDiscussionEditPresenter$handleClickSave$lambda(closure$entity_0, this$CourseDiscussionEditPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  CourseDiscussionEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  launch(this.presenterScope, void 0, void 0, CourseDiscussionEditPresenter$handleClickSave$lambda(entity, this));
};
  CourseDiscussionEditPresenter.prototype.onItemMove_vux9f0$ = function(fromPosition, toPosition) {
  var tmp$, tmp$_0;
  var currentList = (tmp$_0 = (tmp$ = this.topicsOneToManyJoinEditHelper_0.liveList.getValue()) != null ? toMutableList(tmp$) : null) != null ? tmp$_0 : ArrayList_init();
  var movingBlock = currentList.get_za3lpa$(fromPosition);
  currentList.remove_11rb$(movingBlock);
  currentList.add_wxm5ur$(toPosition, movingBlock);
  var tmp$_1, tmp$_0_0;
  var index = 0;
  tmp$_1 = currentList.iterator();
  while (tmp$_1.hasNext()) {
    var item = tmp$_1.next();
    item.discussionTopicIndex = checkIndexOverflow((tmp$_0_0 = index , index = tmp$_0_0 + 1 | 0 , tmp$_0_0));
  }
  this.topicsOneToManyJoinEditHelper_0.liveList.sendValue_11rb$(toList(currentList));
  return true;
};
  CourseDiscussionEditPresenter.prototype.onItemDismiss_za3lpa$ = function(position) {
};
  function CourseDiscussionEditPresenter$Companion() {
    CourseDiscussionEditPresenter$Companion_instance = this;
    this.SAVEDSTATE_KEY_DISCUSSION_TOPIC = 'DiscussionTopic';
    this.ARG_SAVEDSTATE_DISCUSSION_TOPIC = 'ArgSavedStateDiscussionTopic';
  }
  CourseDiscussionEditPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var CourseDiscussionEditPresenter$Companion_instance = null;
  function CourseDiscussionEditPresenter$Companion_getInstance() {
    if (CourseDiscussionEditPresenter$Companion_instance === null) {
      new CourseDiscussionEditPresenter$Companion();
    }
    return CourseDiscussionEditPresenter$Companion_instance;
  }
  function CourseDiscussionEditPresenter$topicsOneToManyJoinEditHelper$lambda($receiver, it) {
    $receiver.discussionTopicUid = it;
    return Unit;
  }
  CourseDiscussionEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'CourseDiscussionEditPresenter', 
  interfaces: [ItemTouchHelperListener, UstadEditPresenter]};
  function CourseGroupSetDetailPresenter(context, arguments_0, view, lifecycleOwner, di) {
    CourseGroupSetDetailPresenter$Companion_getInstance();
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.clazzUid_0 = L0;
  }
  Object.defineProperty(CourseGroupSetDetailPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  CourseGroupSetDetailPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  var tmp$, tmp$_0, tmp$_1;
  this.clazzUid_0 = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  return this.repo.clazzDao.personHasPermissionWithClazz_b9bd0d$((tmp$_1 = account != null ? account.personUid : null) != null ? tmp$_1 : L0, this.clazzUid_0, Role$Companion$PERMISSION_CLAZZ_UPDATE, continuation);
};
  function Coroutine$onLoadEntityFromDb_7hogkd$_9($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$entityUid = void 0;
    this.local$entity = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_9.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_9.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_9.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_9;
  Coroutine$onLoadEntityFromDb_7hogkd$_9.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        this.local$entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = this.local$db.courseGroupSetDao.findByUid(this.local$entityUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$entity = this.result_0;
        this.state_0 = 3;
        this.result_0 = this.local$db.courseGroupMemberDao.findByGroupSetOrderedAsync_3pjtqy$(this.local$entityUid, (tmp$_1 = this.local$entity != null ? this.local$entity.cgsClazzUid : null) != null ? tmp$_1 : L0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var groupMemberList = this.result_0;
        var destination = LinkedHashMap_init();
        var tmp$_2;
        tmp$_2 = groupMemberList.iterator();
        while (tmp$_2.hasNext()) {
          var element = tmp$_2.next();
          var tmp$_3, tmp$_4;
          var key = (tmp$_4 = (tmp$_3 = element.member) != null ? tmp$_3.cgmGroupNumber : null) != null ? tmp$_4 : 0;
          var tmp$_0_0;
          var value = destination.get_11rb$(key);
          if (value == null) {
            var answer = ArrayList_init();
            destination.put_xwzc9p$(key, answer);
            tmp$_0_0 = answer;
          } else {
            tmp$_0_0 = value;
          }
          var list = tmp$_0_0;
          list.add_11rb$(element);
        }
        var groupMap = destination;
        var memberList = ArrayList_init();
        var tmp$_5;
        tmp$_5 = groupMap.entries.iterator();
        while (tmp$_5.hasNext()) {
          var element_0 = tmp$_5.next();
          var $receiver = new CourseGroupMemberPerson();
          var $receiver_0 = new CourseGroupMember();
          $receiver_0.cgmGroupNumber = element_0.key;
          $receiver.member = $receiver_0;
          memberList.add_11rb$($receiver);
          memberList.addAll_brywnq$(element_0.value);
        }
        this.$this.view.memberList = memberList;
        return this.local$entity;
      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);
};
  CourseGroupSetDetailPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_9(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  CourseGroupSetDetailPresenter.prototype.handleClickEdit = function() {
  var tmp$, tmp$_0;
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, CourseGroupSetEditView$Companion_getInstance().VIEW_NAME, getKClass(CourseGroupSet), CourseGroupSet.Companion.serializer(), ReportDetailPresenter$Companion_getInstance().RESULT_REPORT_KEY, void 0, mutableMapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, toString((tmp$ = this.entity) != null ? tmp$.cgsUid : null)), to(UstadView$Companion_getInstance().ARG_CLAZZUID, toString((tmp$_0 = this.entity) != null ? tmp$_0.cgsClazzUid : null))])));
};
  function CourseGroupSetDetailPresenter$Companion() {
    CourseGroupSetDetailPresenter$Companion_instance = this;
  }
  CourseGroupSetDetailPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var CourseGroupSetDetailPresenter$Companion_instance = null;
  function CourseGroupSetDetailPresenter$Companion_getInstance() {
    if (CourseGroupSetDetailPresenter$Companion_instance === null) {
      new CourseGroupSetDetailPresenter$Companion();
    }
    return CourseGroupSetDetailPresenter$Companion_instance;
  }
  CourseGroupSetDetailPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'CourseGroupSetDetailPresenter', 
  interfaces: [UstadDetailPresenter]};
  var compareBy$lambda_2 = wrapFunction(function() {
  var compareValues = Kotlin.kotlin.comparisons.compareValues_s00gnj$;
  return function(closure$selector) {
  return function(a, b) {
  var selector = closure$selector;
  return compareValues(selector(a), selector(b));
};
};
});
  function CourseGroupSetEditPresenter(context, arguments_0, view, lifecycleOwner, di) {
    CourseGroupSetEditPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(CourseGroupSetEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  function Coroutine$CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$it = it_0;
  }
  Coroutine$CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda;
  Coroutine$CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if ((tmp$_0 = (tmp$ = !equals(this.local$closure$entityUid, L0) ? this.local$it : null) != null ? tmp$.courseGroupSetDao : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_0.findByUid(this.local$closure$entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda_0(closure$entityUid_0, closure$clazzUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$closure$clazzUid = closure$clazzUid_0;
    this.local$it = it_0;
  }
  Coroutine$CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda_0.prototype.constructor = Coroutine$CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda_0;
  Coroutine$CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.courseGroupMemberDao.findByGroupSetAsync_3pjtqy$(this.local$closure$entityUid, this.local$closure$clazzUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda_0(closure$entityUid_0, closure$clazzUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda_0(closure$entityUid_0, closure$clazzUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_10($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$entityUid = void 0;
    this.local$clazzUid = void 0;
    this.local$entity = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_10.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_10.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_10.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_10;
  Coroutine$onLoadEntityFromDb_7hogkd$_10.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
        this.local$entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.local$clazzUid = (tmp$_2 = (tmp$_1 = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0;
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda(this.local$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var tmp$_4;
        if ((tmp$_3 = this.result_0) != null) 
          tmp$_4 = tmp$_3;
        else {
          var $receiver = new CourseGroupSet();
          $receiver.cgsClazzUid = this.local$clazzUid;
          tmp$_4 = $receiver;
        }
        this.local$entity = tmp$_4;
        this.state_0 = 3;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, CourseGroupSetEditPresenter$onLoadEntityFromDb$lambda_0(this.local$entityUid, this.local$clazzUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var members = this.result_0;
        var tmp$_5;
        tmp$_5 = members.iterator();
        while (tmp$_5.hasNext()) {
          var element = tmp$_5.next();
          var tmp$_6;
          if (element.member == null) {
            var $receiver_0 = new CourseGroupMember();
            $receiver_0.cgmPersonUid = element.personUid;
            $receiver_0.cgmSetUid = this.local$entityUid;
            tmp$_6 = $receiver_0;
          } else {
            tmp$_6 = element.member;
          }
          element.member = tmp$_6;
        }
        this.$this.view.memberList = members;
        this.$this.view.groupList = this.$this.createGroupList_0(this.local$entity.cgsTotalGroups);
        return this.local$entity;
      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);
};
  CourseGroupSetEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_10(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  CourseGroupSetEditPresenter.prototype.createGroupList_0 = function(totalGroups) {
  var groupList = ArrayList_init();
  for (var index = 0; index < totalGroups; index++) {
    groupList.add_11rb$(new IdOption(replace(this.systemImpl.getString(2921, this.context), '%1$s', (index + 1 | 0).toString()), index + 1 | 0));
  }
  return groupList;
};
  CourseGroupSetEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = CourseGroupSet.Companion.serializer();
    var tmp$_4;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_4 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_4 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    tmp$ = new CourseGroupSet();
  }
  var editEntity = tmp$;
  tmp$_3 = this.view;
  tmp$_0 = this.di;
  tmp$_1 = ListSerializer(CourseGroupMemberPerson.Companion.serializer());
  var str = (tmp$_2 = bundle.get_11rb$(CourseGroupSetEditPresenter$Companion_getInstance().SAVED_STATE_MEMBER_LIST)) != null ? tmp$_2 : '';
  var tmp$_5;
  var json_0 = get_direct(tmp$_0).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_5 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_5 : throwCCE(), null);
  tmp$_3.memberList = json_0.decodeFromString_awif5v$(tmp$_1, str);
  this.view.groupList = this.createGroupList_0(editEntity.cgsTotalGroups);
  return editEntity;
};
  CourseGroupSetEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  var tmp$;
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, CourseGroupSetEditPresenter$Companion_getInstance().SAVED_STATE_MEMBER_LIST, ListSerializer(CourseGroupMemberPerson.Companion.serializer()), (tmp$ = this.view.memberList) != null ? tmp$ : emptyList());
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  function Coroutine$CourseGroupSetEditPresenter$handleClickSave$lambda$lambda(closure$entity_0, closure$members_0, txDb_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$closure$members = closure$members_0;
    this.local$tmp$ = void 0;
    this.local$toUpdateList = void 0;
    this.local$txDb = txDb_0;
  }
  Coroutine$CourseGroupSetEditPresenter$handleClickSave$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$CourseGroupSetEditPresenter$handleClickSave$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$CourseGroupSetEditPresenter$handleClickSave$lambda$lambda.prototype.constructor = Coroutine$CourseGroupSetEditPresenter$handleClickSave$lambda$lambda;
  Coroutine$CourseGroupSetEditPresenter$handleClickSave$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2;
        if (equals(this.local$closure$entity.cgsUid, L0)) {
          this.local$tmp$ = this.local$closure$entity;
          this.state_0 = 3;
          this.result_0 = this.local$txDb.courseGroupSetDao.insertAsync(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 2;
          this.result_0 = this.local$txDb.courseGroupSetDao.updateAsync_6xk07w$(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 4;
        continue;
      case 3:
        this.local$tmp$.cgsUid = this.result_0;
        this.state_0 = 4;
        continue;
      case 4:
        var tmp$_3;
        if (this.local$closure$members != null) {
          var $receiver = this.local$closure$members;
          var destination = ArrayList_init();
          var tmp$_4;
          tmp$_4 = $receiver.iterator();
          while (tmp$_4.hasNext()) {
            var element = tmp$_4.next();
            var tmp$_5;
            if (equals((tmp$_5 = element.member) != null ? tmp$_5.cgmUid : null, L0)) 
              destination.add_11rb$(element);
          }
          tmp$_3 = destination;
        } else 
          tmp$_3 = null;
        var tmp$_6;
        if ((tmp$ = tmp$_3) != null) {
          var destination_0 = ArrayList_init();
          var tmp$_7;
          tmp$_7 = tmp$.iterator();
          while (tmp$_7.hasNext()) {
            var element_0 = tmp$_7.next();
            var tmp$_0_0;
            var closure$entity = this.local$closure$entity;
            var tmp$_8;
                        (tmp$_8 = element_0.member) != null ? (tmp$_8.cgmSetUid = closure$entity.cgsUid) : null;
            if ((tmp$_0_0 = element_0.member) != null) {
              destination_0.add_11rb$(tmp$_0_0);
            }
          }
          tmp$_6 = destination_0;
        } else 
          tmp$_6 = null;
        var toInsertList = (tmp$_0 = tmp$_6) != null ? tmp$_0 : emptyList();
        var tmp$_9;
        if (this.local$closure$members != null) {
          var $receiver_0 = this.local$closure$members;
          var destination_1 = ArrayList_init();
          var tmp$_10;
          tmp$_10 = $receiver_0.iterator();
          while (tmp$_10.hasNext()) {
            var element_1 = tmp$_10.next();
            var tmp$_11;
            if (!equals((tmp$_11 = element_1.member) != null ? tmp$_11.cgmUid : null, L0)) 
              destination_1.add_11rb$(element_1);
          }
          tmp$_9 = destination_1;
        } else 
          tmp$_9 = null;
        var tmp$_12;
        if ((tmp$_1 = tmp$_9) != null) {
          var destination_2 = ArrayList_init();
          var tmp$_13;
          tmp$_13 = tmp$_1.iterator();
          while (tmp$_13.hasNext()) {
            var element_2 = tmp$_13.next();
            var tmp$_0_1;
            if ((tmp$_0_1 = element_2.member) != null) {
              destination_2.add_11rb$(tmp$_0_1);
            }
          }
          tmp$_12 = destination_2;
        } else 
          tmp$_12 = null;
        this.local$toUpdateList = (tmp$_2 = tmp$_12) != null ? tmp$_2 : emptyList();
        this.state_0 = 5;
        this.result_0 = this.local$txDb.courseGroupMemberDao.insertListAsync_23fuft$(toInsertList, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        this.state_0 = 6;
        this.result_0 = this.local$txDb.courseGroupMemberDao.updateListAsync_23fuft$(this.local$toUpdateList, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 6:
        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 CourseGroupSetEditPresenter$handleClickSave$lambda$lambda(closure$entity_0, closure$members_0) {
    return function(txDb_0, continuation_0, suspended) {
  var instance = new Coroutine$CourseGroupSetEditPresenter$handleClickSave$lambda$lambda(closure$entity_0, closure$members_0, txDb_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$CourseGroupSetEditPresenter$handleClickSave$lambda(this$CourseGroupSetEditPresenter_0, closure$entity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$CourseGroupSetEditPresenter = this$CourseGroupSetEditPresenter_0;
    this.local$closure$entity = closure$entity_0;
  }
  Coroutine$CourseGroupSetEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$CourseGroupSetEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$CourseGroupSetEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$CourseGroupSetEditPresenter$handleClickSave$lambda;
  Coroutine$CourseGroupSetEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var members = this.local$this$CourseGroupSetEditPresenter.view.memberList;
        this.state_0 = 2;
        this.result_0 = withDoorTransactionAsync(this.local$this$CourseGroupSetEditPresenter.repo, getKClass(UmAppDatabase), CourseGroupSetEditPresenter$handleClickSave$lambda$lambda(this.local$closure$entity, members), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var tmp$ = this.local$this$CourseGroupSetEditPresenter;
        var di = this.local$this$CourseGroupSetEditPresenter.di;
        var strategy = ListSerializer(CourseGroupSet.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_0;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
        return tmp$.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity)) , Unit;
      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 CourseGroupSetEditPresenter$handleClickSave$lambda(this$CourseGroupSetEditPresenter_0, closure$entity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$CourseGroupSetEditPresenter$handleClickSave$lambda(this$CourseGroupSetEditPresenter_0, closure$entity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  CourseGroupSetEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  launch(this.presenterScope, doorMainDispatcher(), void 0, CourseGroupSetEditPresenter$handleClickSave$lambda(this, entity));
};
  function CourseGroupSetEditPresenter$handleAssignRandomGroupsClicked$lambda(it) {
    return it.firstNames;
  }
  CourseGroupSetEditPresenter.prototype.handleAssignRandomGroupsClicked = function() {
  var tmp$, tmp$_0, tmp$_1;
  var totalGroups = (tmp$_0 = (tmp$ = this.view.groupList) != null ? tmp$.size : null) != null ? tmp$_0 : 4;
  var counter = {
  v: 1};
  var studentList = (tmp$_1 = this.view.memberList) != null ? tmp$_1 : emptyList();
  var $receiver = shuffled(studentList);
  var destination = LinkedHashMap_init();
  var tmp$_2;
  tmp$_2 = $receiver.iterator();
  while (tmp$_2.hasNext()) {
    var element = tmp$_2.next();
    var tmp$_3;
    var key = (tmp$_3 = counter.v , counter.v = tmp$_3 + 1 | 0 , tmp$_3) % totalGroups + 1 | 0;
    var tmp$_0_0;
    var value = destination.get_11rb$(key);
    if (value == null) {
      var answer = ArrayList_init();
      destination.put_xwzc9p$(key, answer);
      tmp$_0_0 = answer;
    } else {
      tmp$_0_0 = value;
    }
    var list = tmp$_0_0;
    list.add_11rb$(element);
  }
  var $receiver_0 = destination.entries;
  var destination_0 = ArrayList_init();
  var tmp$_4;
  tmp$_4 = $receiver_0.iterator();
  while (tmp$_4.hasNext()) {
    var element_0 = tmp$_4.next();
    var tmp$_5;
    tmp$_5 = element_0.value.iterator();
    while (tmp$_5.hasNext()) {
      var element_1 = tmp$_5.next();
      var tmp$_6;
            (tmp$_6 = element_1.member) != null ? (tmp$_6.cgmGroupNumber = element_0.key) : null;
    }
    var list_0 = element_0.value;
    addAll(destination_0, list_0);
  }
  var assignedList = sortedWith(destination_0, new Comparator(compareBy$lambda_2(CourseGroupSetEditPresenter$handleAssignRandomGroupsClicked$lambda)));
  this.view.memberList = assignedList;
};
  CourseGroupSetEditPresenter.prototype.handleNumberOfGroupsChanged_za3lpa$ = function(number) {
  var tmp$;
  var $receiver = this.view;
    (tmp$ = number !== 0 ? $receiver : null) != null ? (tmp$.groupList = this.createGroupList_0(number)) : null;
};
  function CourseGroupSetEditPresenter$Companion() {
    CourseGroupSetEditPresenter$Companion_instance = this;
    this.SAVED_STATE_MEMBER_LIST = 'memberList';
  }
  CourseGroupSetEditPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var CourseGroupSetEditPresenter$Companion_instance = null;
  function CourseGroupSetEditPresenter$Companion_getInstance() {
    if (CourseGroupSetEditPresenter$Companion_instance === null) {
      new CourseGroupSetEditPresenter$Companion();
    }
    return CourseGroupSetEditPresenter$Companion_instance;
  }
  CourseGroupSetEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'CourseGroupSetEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function CourseGroupSetListItemListener() {
  }
  CourseGroupSetListItemListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'CourseGroupSetListItemListener', 
  interfaces: []};
  function CourseGroupSetListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.clazzUidFilter_0 = L0;
  }
  CourseGroupSetListPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1;
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.clazzUidFilter_0 = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  var group = null;
  var $receiver = this.view;
    (tmp$_1 = this.arguments.containsKey_11rb$(CourseGroupSetListView$Companion_getInstance().ARG_SHOW_INDIVIDUAL) ? $receiver : null) != null ? (tmp$_1.individualList = listOf_0(fallbackIndividualSet(group, this.systemImpl, this.context))) : null;
  this.updateListOnView_0();
};
  CourseGroupSetListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  var tmp$;
  return this.repo.clazzDao.personHasPermissionWithClazz_b9bd0d$((tmp$ = account != null ? account.personUid : null) != null ? tmp$ : L0, this.clazzUidFilter_0, Role$Companion$PERMISSION_CLAZZ_UPDATE, continuation);
};
  CourseGroupSetListPresenter.prototype.updateListOnView_0 = function() {
  this.view.list = this.repo.courseGroupSetDao.findAllCourseGroupSetForClazz_s8cxhz$(this.clazzUidFilter_0);
};
  CourseGroupSetListPresenter.prototype.handleClickCreateNewFab = function() {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, CourseGroupSetEditView$Companion_getInstance().VIEW_NAME, getKClass(CourseGroupSet), CourseGroupSet.Companion.serializer(), void 0, void 0, mutableMapOf([to(UstadView$Companion_getInstance().ARG_CLAZZUID, this.clazzUidFilter_0.toString())])));
};
  CourseGroupSetListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
  this.handleClickCreateNewFab();
};
  CourseGroupSetListPresenter.prototype.handleClickEntry_11rc$ = function(entry) {
  switch (this.mListMode.name) {
    case 'PICKER':
      var di = this.di;
      var strategy = ListSerializer(CourseGroupSet.Companion.serializer());
      var entity = listOf_0(entry);
      var tmp$;
      var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
      this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
      break;
    case 'BROWSER':
      this.systemImpl.go_gofqk3$(CourseGroupSetDetailView$Companion_getInstance().VIEW_NAME, mapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, entry.cgsUid.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZUID, entry.cgsClazzUid.toString())]), this.context);
      break;
  }
};
  CourseGroupSetListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'CourseGroupSetListPresenter', 
  interfaces: [UstadListPresenter]};
  var compareBy$lambda_3 = wrapFunction(function() {
  var compareValues = Kotlin.kotlin.comparisons.compareValues_s00gnj$;
  return function(closure$selector) {
  return function(a, b) {
  var selector = closure$selector;
  return compareValues(selector(a), selector(b));
};
};
});
  function CourseTerminologyEditPresenter(context, arguments_0, view, lifecycleOwner, di) {
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    var tmp$;
    this.json_s4l5v7$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, CourseTerminologyEditPresenter$json_metadata);
  }
  Object.defineProperty(CourseTerminologyEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  var CourseTerminologyEditPresenter$json_metadata = new PropertyMetadata('json');
  Object.defineProperty(CourseTerminologyEditPresenter.prototype, 'json_0', {
  configurable: true, 
  get: function() {
  return this.json_s4l5v7$_0.value;
}});
  function Coroutine$CourseTerminologyEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$it = it_0;
  }
  Coroutine$CourseTerminologyEditPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$CourseTerminologyEditPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$CourseTerminologyEditPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$CourseTerminologyEditPresenter$onLoadEntityFromDb$lambda;
  Coroutine$CourseTerminologyEditPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if ((tmp$_0 = (tmp$ = !equals(this.local$closure$entityUid, L0) ? this.local$it : null) != null ? tmp$.courseTerminologyDao : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_0.findByUid(this.local$closure$entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 CourseTerminologyEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$CourseTerminologyEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_11($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_11.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_11.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_11.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_11;
  Coroutine$onLoadEntityFromDb_7hogkd$_11.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        var entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, CourseTerminologyEditPresenter$onLoadEntityFromDb$lambda(entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var entity = (tmp$_1 = this.result_0) != null ? tmp$_1 : new CourseTerminology();
        this.$this.makeTermList_0(entity);
        return entity;
      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);
};
  CourseTerminologyEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_11(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function CourseTerminologyEditPresenter$makeTermList$lambda(it) {
    return it.id;
  }
  CourseTerminologyEditPresenter.prototype.makeTermList_0 = function(terminology) {
  var termMap = toTermMap(terminology, this.json_0, this.systemImpl, this.context);
  var $receiver = TerminologyKeys_getInstance().TERMINOLOGY_ENTRY_MESSAGE_ID.entries;
  var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
  var tmp$;
  tmp$ = $receiver.iterator();
  while (tmp$.hasNext()) {
    var item = tmp$.next();
    destination.add_11rb$(new TerminologyEntry(item.key, item.value, termMap.get_11rb$(item.key)));
  }
  var termList = sortedWith(destination, new Comparator(compareBy$lambda_3(CourseTerminologyEditPresenter$makeTermList$lambda)));
  this.view.terminologyTermList = termList;
};
  CourseTerminologyEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = CourseTerminology.Companion.serializer();
    var tmp$_0;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    tmp$ = new CourseTerminology();
  }
  var editEntity = tmp$;
  this.makeTermList_0(editEntity);
  return editEntity;
};
  CourseTerminologyEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  tmp$ = this.di;
  tmp$_0 = MapSerializer(serializer(kotlin_js_internal_StringCompanionObject), serializer(kotlin_js_internal_StringCompanionObject));
  var tmp$_4;
  if ((tmp$_1 = this.view.terminologyTermList) != null) {
    var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(tmp$_1, 10)), 16);
    var destination = LinkedHashMap_init_0(capacity);
    var tmp$_5;
    tmp$_5 = tmp$_1.iterator();
    while (tmp$_5.hasNext()) {
      var element = tmp$_5.next();
      var pair = to(element.id, toString(element.term));
      destination.put_xwzc9p$(pair.first, pair.second);
    }
    tmp$_4 = destination;
  } else 
    tmp$_4 = null;
  tmp$_3 = (tmp$_2 = tmp$_4) != null ? tmp$_2 : emptyMap();
  if (entityVal != null) {
    var tmp$_6;
    var json = get_direct(tmp$).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_6 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_6 : throwCCE(), null);
    entityVal.ctTerminology = json.encodeToString_tf03ej$(tmp$_0, tmp$_3);
  }
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  function Coroutine$CourseTerminologyEditPresenter$handleClickSave$lambda(this$CourseTerminologyEditPresenter_0, closure$entity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$CourseTerminologyEditPresenter = this$CourseTerminologyEditPresenter_0;
    this.local$closure$entity = closure$entity_0;
    this.local$tmp$_0 = void 0;
    this.local$termList = void 0;
  }
  Coroutine$CourseTerminologyEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$CourseTerminologyEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$CourseTerminologyEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$CourseTerminologyEditPresenter$handleClickSave$lambda;
  Coroutine$CourseTerminologyEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.local$termList = (tmp$ = this.local$this$CourseTerminologyEditPresenter.view.terminologyTermList) != null ? tmp$ : emptyList();
        var foundError = {
  v: false};
        if (this.local$closure$entity.ctTitle == null) {
          foundError.v = true;
          this.local$this$CourseTerminologyEditPresenter.view.titleErrorText = this.local$this$CourseTerminologyEditPresenter.systemImpl.getString(2127, this.local$this$CourseTerminologyEditPresenter.context);
        } else {
          this.local$this$CourseTerminologyEditPresenter.view.titleErrorText = null;
        }
        var tmp$_0;
        tmp$_0 = this.local$termList.iterator();
        while (tmp$_0.hasNext()) {
          var element = tmp$_0.next();
          var this$CourseTerminologyEditPresenter = this.local$this$CourseTerminologyEditPresenter;
          var tmp$_1;
          var $receiver = element.term;
          if ($receiver == null || $receiver.length === 0) {
            foundError.v = true;
            tmp$_1 = this$CourseTerminologyEditPresenter.systemImpl.getString(2127, this$CourseTerminologyEditPresenter.context);
          } else {
            tmp$_1 = null;
          }
          element.errorMessage = tmp$_1;
        }
        if (foundError.v) {
          this.local$this$CourseTerminologyEditPresenter.view.terminologyTermList = toList(this.local$termList);
          return;
        } else {
          this.state_0 = 2;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        var tmp$_2 = this.local$closure$entity;
        var tmp$_3 = this.local$this$CourseTerminologyEditPresenter.di;
        var tmp$_4 = MapSerializer(serializer(kotlin_js_internal_StringCompanionObject), serializer(kotlin_js_internal_StringCompanionObject));
        var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this.local$termList, 10)), 16);
        var destination = LinkedHashMap_init_0(capacity);
        var tmp$_5;
        tmp$_5 = this.local$termList.iterator();
        while (tmp$_5.hasNext()) {
          var element_0 = tmp$_5.next();
          var pair = to(element_0.id, toString(element_0.term));
          destination.put_xwzc9p$(pair.first, pair.second);
        }
        var tmp$_6;
        var json = get_direct(tmp$_3).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_6 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_6 : throwCCE(), null);
        tmp$_2.ctTerminology = json.encodeToString_tf03ej$(tmp$_4, destination);
        if (equals(this.local$closure$entity.ctUid, L0)) {
          this.local$tmp$_0 = this.local$closure$entity;
          this.state_0 = 4;
          this.result_0 = this.local$this$CourseTerminologyEditPresenter.repo.courseTerminologyDao.insertAsync(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          this.result_0 = this.local$this$CourseTerminologyEditPresenter.repo.courseTerminologyDao.updateAsync_9k9ym$(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 3:
        this.state_0 = 5;
        continue;
      case 4:
        this.local$tmp$_0.ctUid = this.result_0;
        this.state_0 = 5;
        continue;
      case 5:
        var tmp$_7 = this.local$this$CourseTerminologyEditPresenter;
        var di = this.local$this$CourseTerminologyEditPresenter.di;
        var strategy = ListSerializer(CourseTerminology.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_8;
        var json_0 = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_8 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_8 : throwCCE(), null);
        return tmp$_7.finishWithResult_61zpoe$(json_0.encodeToString_tf03ej$(strategy, entity)) , Unit;
      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 CourseTerminologyEditPresenter$handleClickSave$lambda(this$CourseTerminologyEditPresenter_0, closure$entity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$CourseTerminologyEditPresenter$handleClickSave$lambda(this$CourseTerminologyEditPresenter_0, closure$entity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  CourseTerminologyEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  launch(this.presenterScope, doorMainDispatcher(), void 0, CourseTerminologyEditPresenter$handleClickSave$lambda(this, entity));
};
  CourseTerminologyEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'CourseTerminologyEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function CourseTerminologyListItemListener() {
  }
  CourseTerminologyListItemListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'CourseTerminologyListItemListener', 
  interfaces: []};
  function CourseTerminologyListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  CourseTerminologyListPresenter.prototype.onCreate = function(savedState) {
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.updateListOnView_0();
};
  CourseTerminologyListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  return true;
};
  function Coroutine$CourseTerminologyListPresenter$updateListOnView$lambda(this$CourseTerminologyListPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$CourseTerminologyListPresenter = this$CourseTerminologyListPresenter_0;
  }
  Coroutine$CourseTerminologyListPresenter$updateListOnView$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$CourseTerminologyListPresenter$updateListOnView$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$CourseTerminologyListPresenter$updateListOnView$lambda.prototype.constructor = Coroutine$CourseTerminologyListPresenter$updateListOnView$lambda;
  Coroutine$CourseTerminologyListPresenter$updateListOnView$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        return this.local$this$CourseTerminologyListPresenter.view.list = this.local$this$CourseTerminologyListPresenter.repo.courseTerminologyDao.findAllCourseTerminology() , Unit;
      case 1:
        throw this.exception_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 CourseTerminologyListPresenter$updateListOnView$lambda(this$CourseTerminologyListPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$CourseTerminologyListPresenter$updateListOnView$lambda(this$CourseTerminologyListPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  CourseTerminologyListPresenter.prototype.updateListOnView_0 = function() {
  launch(this.presenterScope, void 0, void 0, CourseTerminologyListPresenter$updateListOnView$lambda(this));
};
  CourseTerminologyListPresenter.prototype.handleClickCreateNewFab = function() {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, CourseTerminologyEditView$Companion_getInstance().VIEW_NAME, getKClass(CourseTerminology), CourseTerminology.Companion.serializer()));
};
  CourseTerminologyListPresenter.prototype.onClickCourseTerminology_9k9ym$ = function(courseTerminology) {
  var di = this.di;
  var strategy = ListSerializer(CourseTerminology.Companion.serializer());
  var entity = listOf_0(courseTerminology);
  var tmp$;
  var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
  this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
};
  CourseTerminologyListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
  this.handleClickCreateNewFab();
};
  CourseTerminologyListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'CourseTerminologyListPresenter', 
  interfaces: [CourseTerminologyListItemListener, UstadListPresenter]};
  function DateRangePresenter(context, arguments_0, view, lifecycleOwner, di) {
    DateRangePresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(DateRangePresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$JSON_getInstance();
}});
  function DateRangePresenter$RelUnitOption(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function DateRangePresenter$RelUnitOption_initFields() {
    DateRangePresenter$RelUnitOption_initFields = function() {
};
    DateRangePresenter$RelUnitOption$DAY_instance = new DateRangePresenter$RelUnitOption('DAY', 0, 1, 2357);
    DateRangePresenter$RelUnitOption$WEEK_instance = new DateRangePresenter$RelUnitOption('WEEK', 1, 2, 2207);
    DateRangePresenter$RelUnitOption$MONTH_instance = new DateRangePresenter$RelUnitOption('MONTH', 2, 3, 2208);
    DateRangePresenter$RelUnitOption$YEAR_instance = new DateRangePresenter$RelUnitOption('YEAR', 3, 4, 2219);
  }
  var DateRangePresenter$RelUnitOption$DAY_instance;
  function DateRangePresenter$RelUnitOption$DAY_getInstance() {
    DateRangePresenter$RelUnitOption_initFields();
    return DateRangePresenter$RelUnitOption$DAY_instance;
  }
  var DateRangePresenter$RelUnitOption$WEEK_instance;
  function DateRangePresenter$RelUnitOption$WEEK_getInstance() {
    DateRangePresenter$RelUnitOption_initFields();
    return DateRangePresenter$RelUnitOption$WEEK_instance;
  }
  var DateRangePresenter$RelUnitOption$MONTH_instance;
  function DateRangePresenter$RelUnitOption$MONTH_getInstance() {
    DateRangePresenter$RelUnitOption_initFields();
    return DateRangePresenter$RelUnitOption$MONTH_instance;
  }
  var DateRangePresenter$RelUnitOption$YEAR_instance;
  function DateRangePresenter$RelUnitOption$YEAR_getInstance() {
    DateRangePresenter$RelUnitOption_initFields();
    return DateRangePresenter$RelUnitOption$YEAR_instance;
  }
  DateRangePresenter$RelUnitOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'RelUnitOption', 
  interfaces: [Enum]};
  function DateRangePresenter$RelUnitOption$values() {
    return [DateRangePresenter$RelUnitOption$DAY_getInstance(), DateRangePresenter$RelUnitOption$WEEK_getInstance(), DateRangePresenter$RelUnitOption$MONTH_getInstance(), DateRangePresenter$RelUnitOption$YEAR_getInstance()];
  }
  DateRangePresenter$RelUnitOption.values = DateRangePresenter$RelUnitOption$values;
  function DateRangePresenter$RelUnitOption$valueOf(name) {
    switch (name) {
      case 'DAY':
        return DateRangePresenter$RelUnitOption$DAY_getInstance();
      case 'WEEK':
        return DateRangePresenter$RelUnitOption$WEEK_getInstance();
      case 'MONTH':
        return DateRangePresenter$RelUnitOption$MONTH_getInstance();
      case 'YEAR':
        return DateRangePresenter$RelUnitOption$YEAR_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.DateRangePresenter.RelUnitOption.' + name);
    }
  }
  DateRangePresenter$RelUnitOption.valueOf_61zpoe$ = DateRangePresenter$RelUnitOption$valueOf;
  function DateRangePresenter$RelUnitMessageIdOption(day, context, di) {
    MessageIdOption.call(this, day.messageId, context, day.optionVal, di);
  }
  DateRangePresenter$RelUnitMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'RelUnitMessageIdOption', 
  interfaces: [MessageIdOption]};
  function DateRangePresenter$RelToOption(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function DateRangePresenter$RelToOption_initFields() {
    DateRangePresenter$RelToOption_initFields = function() {
};
    DateRangePresenter$RelToOption$DAY_instance = new DateRangePresenter$RelToOption('DAY', 0, 0, 2299);
  }
  var DateRangePresenter$RelToOption$DAY_instance;
  function DateRangePresenter$RelToOption$DAY_getInstance() {
    DateRangePresenter$RelToOption_initFields();
    return DateRangePresenter$RelToOption$DAY_instance;
  }
  DateRangePresenter$RelToOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'RelToOption', 
  interfaces: [Enum]};
  function DateRangePresenter$RelToOption$values() {
    return [DateRangePresenter$RelToOption$DAY_getInstance()];
  }
  DateRangePresenter$RelToOption.values = DateRangePresenter$RelToOption$values;
  function DateRangePresenter$RelToOption$valueOf(name) {
    switch (name) {
      case 'DAY':
        return DateRangePresenter$RelToOption$DAY_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.DateRangePresenter.RelToOption.' + name);
    }
  }
  DateRangePresenter$RelToOption.valueOf_61zpoe$ = DateRangePresenter$RelToOption$valueOf;
  function DateRangePresenter$RelToMessageIdOption(day, context, di) {
    MessageIdOption.call(this, day.messageId, context, day.optionVal, di);
  }
  DateRangePresenter$RelToMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'RelToMessageIdOption', 
  interfaces: [MessageIdOption]};
  DateRangePresenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
  var tmp$ = this.view;
  var $receiver = DateRangePresenter$RelToOption$values();
  var destination = ArrayList_init_0($receiver.length);
  var tmp$_0;
  for (tmp$_0 = 0; tmp$_0 !== $receiver.length; ++tmp$_0) {
    var item = $receiver[tmp$_0];
    destination.add_11rb$(new DateRangePresenter$RelToMessageIdOption(item, this.context, this.di));
  }
  tmp$.relToOptions = destination;
  var tmp$_1 = this.view;
  var $receiver_0 = DateRangePresenter$RelUnitOption$values();
  var destination_0 = ArrayList_init_0($receiver_0.length);
  var tmp$_2;
  for (tmp$_2 = 0; tmp$_2 !== $receiver_0.length; ++tmp$_2) {
    var item_0 = $receiver_0[tmp$_2];
    destination_0.add_11rb$(new DateRangePresenter$RelUnitMessageIdOption(item_0, this.context, this.di));
  }
  tmp$_1.relUnitOptions = destination_0;
};
  DateRangePresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = DateRangeMoment.Companion.serializer();
    var tmp$_0;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    tmp$ = new DateRangeMoment(new Moment(), new Moment());
  }
  return tmp$;
};
  DateRangePresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  var tmp$;
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  tmp$ = this.entity;
  if (tmp$ == null) {
    return;
  }
  var entityVal = tmp$;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  function Coroutine$DateRangePresenter$handleClickSave$lambda$lambda(this$DateRangePresenter_0, closure$entity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$DateRangePresenter = this$DateRangePresenter_0;
    this.local$closure$entity = closure$entity_0;
  }
  Coroutine$DateRangePresenter$handleClickSave$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$DateRangePresenter$handleClickSave$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$DateRangePresenter$handleClickSave$lambda$lambda.prototype.constructor = Coroutine$DateRangePresenter$handleClickSave$lambda$lambda;
  Coroutine$DateRangePresenter$handleClickSave$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$ = this.local$this$DateRangePresenter;
        var di = this.local$this$DateRangePresenter.di;
        var strategy = ListSerializer(DateRangeMoment.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_0;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
        return tmp$.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity)) , Unit;
      case 1:
        throw this.exception_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 DateRangePresenter$handleClickSave$lambda$lambda(this$DateRangePresenter_0, closure$entity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$DateRangePresenter$handleClickSave$lambda$lambda(this$DateRangePresenter_0, closure$entity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$DateRangePresenter$handleClickSave$lambda(this$DateRangePresenter_0, closure$entity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$DateRangePresenter = this$DateRangePresenter_0;
    this.local$closure$entity = closure$entity_0;
  }
  Coroutine$DateRangePresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$DateRangePresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$DateRangePresenter$handleClickSave$lambda.prototype.constructor = Coroutine$DateRangePresenter$handleClickSave$lambda;
  Coroutine$DateRangePresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = withContext(doorMainDispatcher(), DateRangePresenter$handleClickSave$lambda$lambda(this.local$this$DateRangePresenter, this.local$closure$entity), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 DateRangePresenter$handleClickSave$lambda(this$DateRangePresenter_0, closure$entity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$DateRangePresenter$handleClickSave$lambda(this$DateRangePresenter_0, closure$entity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  DateRangePresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  if (entity.fromMoment.typeFlag === 0) 
    if (equals(entity.fromMoment.fixedTime, L0)) {
    this.view.fromFixedDateMissing = this.systemImpl.getString(2127, this.context);
    return;
  } else {
    this.view.fromFixedDateMissing = null;
  }
  var datePair = toFixedDatePair(entity);
  switch (entity.toMoment.typeFlag) {
    case 0:
      if (equals(entity.toMoment.fixedTime, L0)) {
        this.view.toFixedDateMissing = this.systemImpl.getString(2127, this.context);
        return;
      } else if (datePair.second.compareTo_11rb$(datePair.first) <= 0) {
        this.view.toFixedDateMissing = this.systemImpl.getString(2679, this.context);
        return;
      } else {
        this.view.toFixedDateMissing = null;
      }
      break;
    case 1:
      if (datePair.second.compareTo_11rb$(datePair.first) <= 0) {
        this.view.toRelativeDateInvalid = this.systemImpl.getString(2679, this.context);
        return;
      } else {
        this.view.toRelativeDateInvalid = null;
      }
      break;
  }
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, DateRangePresenter$handleClickSave$lambda(this, entity));
};
  function DateRangePresenter$Companion() {
    DateRangePresenter$Companion_instance = this;
  }
  DateRangePresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var DateRangePresenter$Companion_instance = null;
  function DateRangePresenter$Companion_getInstance() {
    if (DateRangePresenter$Companion_instance === null) {
      new DateRangePresenter$Companion();
    }
    return DateRangePresenter$Companion_instance;
  }
  DateRangePresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'DateRangePresenter', 
  interfaces: [UstadEditPresenter]};
  function DefaultClazzAssignmentDetailStudentProgressItemListener(view, listViewMode, systemImpl, context) {
    this.view = view;
    this.listViewMode = listViewMode;
    this.systemImpl = systemImpl;
    this.context = context;
  }
  DefaultClazzAssignmentDetailStudentProgressItemListener.prototype.onClickClazzAssignment_zeh2qj$ = function(clazzAssignment) {
  if (this.listViewMode === ListViewMode$BROWSER_getInstance()) {
    this.systemImpl.go_gofqk3$(ClazzAssignmentDetailView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, clazzAssignment.contentEntryUid.toString())), this.context);
  }
};
  DefaultClazzAssignmentDetailStudentProgressItemListener.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'DefaultClazzAssignmentDetailStudentProgressItemListener', 
  interfaces: [ClazzAssignmentDetailStudentProgressItemListener]};
  function DefaultClazzListItemListener(view, listViewMode, context, arguments_0, di, presenter) {
    if (presenter === void 0) 
      presenter = null;
    this.view = view;
    this.listViewMode = listViewMode;
    this.context = context;
    this.arguments = arguments_0;
    this.di_y7m8m2$_0 = di;
    this.presenter = presenter;
    var tmp$;
    this.systemImpl_ltu4p0$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, DefaultClazzListItemListener$systemImpl_metadata);
    var tmp$_0;
    this.accountManager_fwk0wb$_0 = Instance(this, Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, DefaultClazzListItemListener$accountManager_metadata);
  }
  Object.defineProperty(DefaultClazzListItemListener.prototype, 'di', {
  get: function() {
  return this.di_y7m8m2$_0;
}});
  var DefaultClazzListItemListener$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(DefaultClazzListItemListener.prototype, 'systemImpl', {
  configurable: true, 
  get: function() {
  return this.systemImpl_ltu4p0$_0.value;
}});
  var DefaultClazzListItemListener$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(DefaultClazzListItemListener.prototype, 'accountManager', {
  configurable: true, 
  get: function() {
  return this.accountManager_fwk0wb$_0.value;
}});
  function Coroutine$DefaultClazzListItemListener$onClickClazz$lambda(closure$db_0, closure$clazz_0, this$DefaultClazzListItemListener_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$clazz = closure$clazz_0;
    this.local$this$DefaultClazzListItemListener = this$DefaultClazzListItemListener_0;
  }
  Coroutine$DefaultClazzListItemListener$onClickClazz$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$DefaultClazzListItemListener$onClickClazz$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$DefaultClazzListItemListener$onClickClazz$lambda.prototype.constructor = Coroutine$DefaultClazzListItemListener$onClickClazz$lambda;
  Coroutine$DefaultClazzListItemListener$onClickClazz$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.state_0 = 2;
        this.result_0 = this.local$closure$db.personGroupMemberDao.checkPersonBelongsToGroup_3pjtqy$(this.local$closure$clazz.clazzPendingStudentsPersonGroupUid, this.local$this$DefaultClazzListItemListener.accountManager.activeAccount.personUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var personGroupMember = this.result_0;
        if (!personGroupMember.isEmpty()) {
          this.state_0 = 3;
          this.result_0 = this.local$closure$db.clazzDao.personHasPermissionWithClazz_b9bd0d$(this.local$this$DefaultClazzListItemListener.accountManager.activeAccount.personUid, this.local$closure$clazz.clazzUid, Role$Companion$PERMISSION_CLAZZ_OPEN, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          return this.local$this$DefaultClazzListItemListener.systemImpl.go_gofqk3$(ClazzDetailView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, this.local$closure$clazz.clazzUid.toString())), this.local$this$DefaultClazzListItemListener.context) , Unit;
        }
      case 3:
        var canOpen = this.result_0;
        if (canOpen) {
          return this.local$this$DefaultClazzListItemListener.systemImpl.go_gofqk3$(ClazzDetailView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, this.local$closure$clazz.clazzUid.toString())), this.local$this$DefaultClazzListItemListener.context) , Unit;
        } else {
          return (tmp$ = this.local$this$DefaultClazzListItemListener.view) != null ? (tmp$.showSnackBar_9pu0dj$(this.local$this$DefaultClazzListItemListener.systemImpl.getString(2654, this.local$this$DefaultClazzListItemListener.context)) , Unit) : null;
        }
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        return;
      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 DefaultClazzListItemListener$onClickClazz$lambda(closure$db_0, closure$clazz_0, this$DefaultClazzListItemListener_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$DefaultClazzListItemListener$onClickClazz$lambda(closure$db_0, closure$clazz_0, this$DefaultClazzListItemListener_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  DefaultClazzListItemListener.prototype.onClickClazz_yczdf2$ = function(clazz) {
  var tmp$;
  if (this.listViewMode === ListViewMode$BROWSER_getInstance()) {
    var context = this.accountManager.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_0;
    var tmp$_1;
    var db = get_direct(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_0 : throwCCE(), context), trigger)).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_1 : throwCCE(), 1);
    launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, DefaultClazzListItemListener$onClickClazz$lambda(db, clazz, this));
  } else {
    if (this.arguments.containsKey_11rb$(UstadView$Companion_getInstance().ARG_GO_TO_COMPLETE)) {
      this.systemImpl.go_gofqk3$(toString(this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_GO_TO_COMPLETE)), plus_2(this.arguments, to(UstadView$Companion_getInstance().ARG_CLAZZUID, clazz.clazzUid.toString())), this.context);
    } else {
      if ((tmp$ = this.presenter) != null) {
        var di = this.di;
        var strategy = ListSerializer(Clazz.Companion.serializer());
        var entity = listOf_0(clazz);
        var tmp$_2;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_2 : throwCCE(), null);
        tmp$.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
      }
    }
  }
};
  DefaultClazzListItemListener.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'DefaultClazzListItemListener', 
  interfaces: [DIAware, ClazzListItemListener]};
  function DefaultContentEntryListItemListener(view, presenter, mListMode, clazzUid, context, di) {
    if (view === void 0) 
      view = null;
    if (presenter === void 0) 
      presenter = null;
    if (mListMode === void 0) 
      mListMode = ListViewMode$BROWSER_getInstance();
    this.view = view;
    this.presenter = presenter;
    this.mListMode = mListMode;
    this.clazzUid = clazzUid;
    this.context = context;
    this.di_nkloqr$_0 = di;
    var tmp$;
    this.systemImpl_zc7dl$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, DefaultContentEntryListItemListener$systemImpl_metadata);
    this.serializationStrategy = ListSerializer(ContentEntry.Companion.serializer());
  }
  Object.defineProperty(DefaultContentEntryListItemListener.prototype, 'di', {
  get: function() {
  return this.di_nkloqr$_0;
}});
  var DefaultContentEntryListItemListener$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(DefaultContentEntryListItemListener.prototype, 'systemImpl', {
  configurable: true, 
  get: function() {
  return this.systemImpl_zc7dl$_0.value;
}});
  DefaultContentEntryListItemListener.prototype.onClickContentEntry_dup0gu$ = function(entry) {
  var tmp$, tmp$_0, tmp$_1;
  if (this.mListMode === ListViewMode$PICKER_getInstance() && !entry.leaf) 
    (tmp$ = this.presenter) != null ? (tmp$.openContentEntryBranchPicker_4pedz3$(entry) , Unit) : null;
  else if (this.mListMode === ListViewMode$PICKER_getInstance() && entry.leaf) 
    (tmp$_0 = this.presenter) != null ? (tmp$_0.handleEntrySelectedFromPicker_dup0gu$(entry) , Unit) : null;
  else if (this.mListMode === ListViewMode$BROWSER_getInstance()) {
    if (entry.leaf) {
      tmp$_1 = mapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, entry.contentEntryUid.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZUID, this.clazzUid.toString()), to(UstadView$Companion_getInstance().ARG_PARENT_ENTRY_TITLE, entry.title)]);
    } else {
      tmp$_1 = mapOf([to(UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID, entry.contentEntryUid.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZUID, this.clazzUid.toString()), to(ContentEntryList2View$Companion_getInstance().ARG_DISPLAY_CONTENT_BY_OPTION, ContentEntryList2View$Companion_getInstance().ARG_DISPLAY_CONTENT_BY_PARENT)]);
    }
    var args = tmp$_1;
    this.systemImpl.go_gofqk3$(entry.leaf ? ContentEntryDetailView$Companion_getInstance().VIEW_NAME : ContentEntryList2View$Companion_getInstance().VIEW_NAME, args, this.context);
  }
};
  DefaultContentEntryListItemListener.prototype.onClickSelectContentEntry_dup0gu$ = function(entry) {
  var tmp$, tmp$_0;
    (tmp$ = this.presenter) != null ? (tmp$.handleMoveWithSelectedEntry_dup0gu$(entry) , Unit) : null;
    (tmp$_0 = this.presenter) != null ? (tmp$_0.handleEntrySelectedFromPicker_dup0gu$(entry) , Unit) : null;
};
  DefaultContentEntryListItemListener.prototype.onClickDownloadContentEntry_dup0gu$ = function(entry) {
  this.systemImpl.go_gofqk3$('DownloadDialog', mapOf_0(to(UstadView$Companion_getInstance().ARG_CONTENT_ENTRY_UID, entry.contentEntryUid.toString())), this.context);
};
  DefaultContentEntryListItemListener.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'DefaultContentEntryListItemListener', 
  interfaces: [DIAware, ContentEntryListItemListener]};
  function DefaultNewCommentItemListener(di, context, entityUid, tableId, isPublic, commentOnSubmitterUid) {
    if (commentOnSubmitterUid === void 0) 
      commentOnSubmitterUid = null;
    this.di_oo51qt$_0 = di;
    this.context = context;
    this.entityUid = entityUid;
    this.tableId = tableId;
    this.isPublic = isPublic;
    this.commentOnSubmitterUid_0 = commentOnSubmitterUid;
  }
  Object.defineProperty(DefaultNewCommentItemListener.prototype, 'di', {
  get: function() {
  return this.di_oo51qt$_0;
}});
  var DefaultNewCommentItemListener$addComment$accountManager_metadata = new PropertyMetadata('accountManager');
  var DefaultNewCommentItemListener$addComment$repo_metadata = new PropertyMetadata('repo');
  function Coroutine$DefaultNewCommentItemListener$addComment$lambda(this$DefaultNewCommentItemListener_0, closure$repo_0, closure$accountManager_0, closure$commentObj_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$DefaultNewCommentItemListener = this$DefaultNewCommentItemListener_0;
    this.local$closure$repo = closure$repo_0;
    this.local$closure$accountManager = closure$accountManager_0;
    this.local$closure$commentObj = closure$commentObj_0;
    this.local$tmp$ = void 0;
    this.local$tmp$_0 = void 0;
  }
  Coroutine$DefaultNewCommentItemListener$addComment$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$DefaultNewCommentItemListener$addComment$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$DefaultNewCommentItemListener$addComment$lambda.prototype.constructor = Coroutine$DefaultNewCommentItemListener$addComment$lambda;
  Coroutine$DefaultNewCommentItemListener$addComment$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$tmp$_0 = this.local$closure$commentObj;
        this.local$tmp$ = this.local$this$DefaultNewCommentItemListener.commentOnSubmitterUid_0;
        if (this.local$tmp$ == null) {
          this.state_0 = 2;
          this.result_0 = this.local$closure$repo.value.clazzAssignmentDao.getSubmitterUid_3pjtqy$(this.local$this$DefaultNewCommentItemListener.entityUid, this.local$closure$accountManager.value.activeAccount.personUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.local$tmp$ = this.result_0;
        this.state_0 = 3;
        continue;
      case 3:
        this.local$tmp$_0.commentSubmitterUid = this.local$tmp$;
        this.state_0 = 4;
        this.result_0 = this.local$closure$repo.value.commentsDao.insertAsync(this.local$closure$commentObj, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        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 DefaultNewCommentItemListener$addComment$lambda(this$DefaultNewCommentItemListener_0, closure$repo_0, closure$accountManager_0, closure$commentObj_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$DefaultNewCommentItemListener$addComment$lambda(this$DefaultNewCommentItemListener_0, closure$repo_0, closure$accountManager_0, closure$commentObj_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  DefaultNewCommentItemListener.prototype.addComment_61zpoe$ = function(text) {
  var tmp$;
  var accountManager = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, DefaultNewCommentItemListener$addComment$accountManager_metadata);
  var context = accountManager.value.activeAccount;
  var trigger;
  trigger = this.diTrigger;
  var tmp$_0;
  var tmp$_1;
  var repo = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_0 : throwCCE(), context), trigger), Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_1 : throwCCE(), 2).provideDelegate_tpuvb9$(this, DefaultNewCommentItemListener$addComment$repo_metadata);
  var commentObj = Comments_init(this.tableId, this.entityUid, accountManager.value.activeAccount.personUid, getSystemTimeInMillis(), text, this.isPublic);
  launch(coroutines.GlobalScope, void 0, void 0, DefaultNewCommentItemListener$addComment$lambda(this, repo, accountManager, commentObj));
};
  DefaultNewCommentItemListener.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'DefaultNewCommentItemListener', 
  interfaces: [DIAware, NewCommentItemListener]};
  function DefaultScopedGrantListItemListener(view, listViewMode, context, di) {
    this.view = view;
    this.listViewMode = listViewMode;
    this.context = context;
    this.di_v2fqti$_0 = di;
    var tmp$;
    this.systemImpl_5efu0g$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, DefaultScopedGrantListItemListener$systemImpl_metadata);
  }
  Object.defineProperty(DefaultScopedGrantListItemListener.prototype, 'di', {
  get: function() {
  return this.di_v2fqti$_0;
}});
  var DefaultScopedGrantListItemListener$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(DefaultScopedGrantListItemListener.prototype, 'systemImpl', {
  configurable: true, 
  get: function() {
  return this.systemImpl_5efu0g$_0.value;
}});
  DefaultScopedGrantListItemListener.prototype.onClickScopedGrant_ersk21$ = function(scopedGrant) {
  if (this.listViewMode === ListViewMode$BROWSER_getInstance()) {
    this.systemImpl.go_gofqk3$(ScopedGrantDetailView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, scopedGrant.sgUid.toString())), this.context);
  }
};
  DefaultScopedGrantListItemListener.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'DefaultScopedGrantListItemListener', 
  interfaces: [DIAware, ScopedGrantListItemListener]};
  function DiscussionPostDetailPresenter(context, arguments_0, view, di) {
    UstadBaseController.call(this, context, arguments_0, view, di);
    var tmp$;
    this.accountManager_ycnfc8$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, DiscussionPostDetailPresenter$accountManager_metadata);
    var context_0 = this.accountManager.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_0;
    var tmp$_1;
    this.db_ab8jh6$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_0 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_1 : throwCCE(), 1).provideDelegate_tpuvb9$(this, DiscussionPostDetailPresenter$db_metadata);
    var context_1 = this.accountManager.activeAccount;
    var trigger_0;
    trigger_0 = this.diTrigger;
    var tmp$_2;
    var tmp$_3;
    this.repo_y4zja2$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_2 : throwCCE(), context_1), trigger_0), Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_3 : throwCCE(), 2).provideDelegate_tpuvb9$(this, DiscussionPostDetailPresenter$repo_metadata);
    this.postUid = L0;
    this.loggedInPersonUid = L0;
    this.ps = this.presenterScope;
    this.clazzUid = L0;
  }
  var DiscussionPostDetailPresenter$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(DiscussionPostDetailPresenter.prototype, 'accountManager', {
  configurable: true, 
  get: function() {
  return this.accountManager_ycnfc8$_0.value;
}});
  var DiscussionPostDetailPresenter$db_metadata = new PropertyMetadata('db');
  Object.defineProperty(DiscussionPostDetailPresenter.prototype, 'db', {
  configurable: true, 
  get: function() {
  return this.db_ab8jh6$_0.value;
}});
  var DiscussionPostDetailPresenter$repo_metadata = new PropertyMetadata('repo');
  Object.defineProperty(DiscussionPostDetailPresenter.prototype, 'repo', {
  configurable: true, 
  get: function() {
  return this.repo_y4zja2$_0.value;
}});
  function Coroutine$DiscussionPostDetailPresenter$onCreate$lambda(this$DiscussionPostDetailPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$DiscussionPostDetailPresenter = this$DiscussionPostDetailPresenter_0;
  }
  Coroutine$DiscussionPostDetailPresenter$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$DiscussionPostDetailPresenter$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$DiscussionPostDetailPresenter$onCreate$lambda.prototype.constructor = Coroutine$DiscussionPostDetailPresenter$onCreate$lambda;
  Coroutine$DiscussionPostDetailPresenter$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.state_0 = 2;
        this.result_0 = this.local$this$DiscussionPostDetailPresenter.repo.discussionPostDao.getPostTitle_s8cxhz$(this.local$this$DiscussionPostDetailPresenter.postUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var postTitle = this.result_0;
        this.local$this$DiscussionPostDetailPresenter.view.title = postTitle;
        this.state_0 = 3;
        this.result_0 = this.local$this$DiscussionPostDetailPresenter.repo.discussionPostDao.findWithDetailsByUid_s8cxhz$(this.local$this$DiscussionPostDetailPresenter.postUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var post = this.result_0;
        this.local$this$DiscussionPostDetailPresenter.view.entity = post;
        return this.local$this$DiscussionPostDetailPresenter.clazzUid = (tmp$ = post != null ? post.discussionPostClazzUid : null) != null ? tmp$ : L0 , Unit;
      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 DiscussionPostDetailPresenter$onCreate$lambda(this$DiscussionPostDetailPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$DiscussionPostDetailPresenter$onCreate$lambda(this$DiscussionPostDetailPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  DiscussionPostDetailPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0;
  UstadBaseController.prototype.onCreate.call(this, savedState);
  this.postUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  this.loggedInPersonUid = this.accountManager.activeAccount.personUid;
  this.view.replies = this.repo.messageDao.findAllMessagesByChatUid_ro19vi$(this.postUid, 132, this.loggedInPersonUid);
  launch(this.presenterScope, void 0, void 0, DiscussionPostDetailPresenter$onCreate$lambda(this));
};
  function Coroutine$DiscussionPostDetailPresenter$addMessage$lambda$lambda(closure$loggedInPersonUid_0, this$DiscussionPostDetailPresenter_0, closure$message_0, txRepo_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$loggedInPersonUid = closure$loggedInPersonUid_0;
    this.local$this$DiscussionPostDetailPresenter = this$DiscussionPostDetailPresenter_0;
    this.local$closure$message = closure$message_0;
    this.local$txRepo = txRepo_0;
  }
  Coroutine$DiscussionPostDetailPresenter$addMessage$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$DiscussionPostDetailPresenter$addMessage$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$DiscussionPostDetailPresenter$addMessage$lambda$lambda.prototype.constructor = Coroutine$DiscussionPostDetailPresenter$addMessage$lambda$lambda;
  Coroutine$DiscussionPostDetailPresenter$addMessage$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$txRepo.messageDao.insertAsync(Message_init_0(this.local$closure$loggedInPersonUid, 132, this.local$this$DiscussionPostDetailPresenter.postUid, this.local$closure$message, this.local$this$DiscussionPostDetailPresenter.clazzUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 DiscussionPostDetailPresenter$addMessage$lambda$lambda(closure$loggedInPersonUid_0, this$DiscussionPostDetailPresenter_0, closure$message_0) {
    return function(txRepo_0, continuation_0, suspended) {
  var instance = new Coroutine$DiscussionPostDetailPresenter$addMessage$lambda$lambda(closure$loggedInPersonUid_0, this$DiscussionPostDetailPresenter_0, closure$message_0, txRepo_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$DiscussionPostDetailPresenter$addMessage$lambda(this$DiscussionPostDetailPresenter_0, closure$message_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$DiscussionPostDetailPresenter = this$DiscussionPostDetailPresenter_0;
    this.local$closure$message = closure$message_0;
    this.local$updateListNeeded = void 0;
    this.local$loggedInPersonUid = void 0;
  }
  Coroutine$DiscussionPostDetailPresenter$addMessage$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$DiscussionPostDetailPresenter$addMessage$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$DiscussionPostDetailPresenter$addMessage$lambda.prototype.constructor = Coroutine$DiscussionPostDetailPresenter$addMessage$lambda;
  Coroutine$DiscussionPostDetailPresenter$addMessage$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$updateListNeeded = equals(this.local$this$DiscussionPostDetailPresenter.postUid, L0);
        this.local$loggedInPersonUid = this.local$this$DiscussionPostDetailPresenter.accountManager.activeAccount.personUid;
        this.state_0 = 2;
        this.result_0 = withDoorTransactionAsync(this.local$this$DiscussionPostDetailPresenter.repo, getKClass(UmAppDatabase), DiscussionPostDetailPresenter$addMessage$lambda$lambda(this.local$loggedInPersonUid, this.local$this$DiscussionPostDetailPresenter, this.local$closure$message), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (this.local$updateListNeeded) {
          return this.local$this$DiscussionPostDetailPresenter.view.replies = this.local$this$DiscussionPostDetailPresenter.repo.messageDao.findAllMessagesByChatUid_ro19vi$(this.local$this$DiscussionPostDetailPresenter.postUid, 132, this.local$loggedInPersonUid) , Unit;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 3:
        return Unit;
      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 DiscussionPostDetailPresenter$addMessage$lambda(this$DiscussionPostDetailPresenter_0, closure$message_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$DiscussionPostDetailPresenter$addMessage$lambda(this$DiscussionPostDetailPresenter_0, closure$message_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  DiscussionPostDetailPresenter.prototype.addMessage_61zpoe$ = function(message) {
  launch(this.presenterScope, void 0, void 0, DiscussionPostDetailPresenter$addMessage$lambda(this, message));
};
  function Coroutine$DiscussionPostDetailPresenter$updateMessageRead$lambda$lambda(closure$messageRead_0, txRepo_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$messageRead = closure$messageRead_0;
    this.local$txRepo = txRepo_0;
  }
  Coroutine$DiscussionPostDetailPresenter$updateMessageRead$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$DiscussionPostDetailPresenter$updateMessageRead$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$DiscussionPostDetailPresenter$updateMessageRead$lambda$lambda.prototype.constructor = Coroutine$DiscussionPostDetailPresenter$updateMessageRead$lambda$lambda;
  Coroutine$DiscussionPostDetailPresenter$updateMessageRead$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$txRepo.messageReadDao.insertAsync(this.local$closure$messageRead, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 DiscussionPostDetailPresenter$updateMessageRead$lambda$lambda(closure$messageRead_0) {
    return function(txRepo_0, continuation_0, suspended) {
  var instance = new Coroutine$DiscussionPostDetailPresenter$updateMessageRead$lambda$lambda(closure$messageRead_0, txRepo_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$DiscussionPostDetailPresenter$updateMessageRead$lambda(this$DiscussionPostDetailPresenter_0, closure$messageRead_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$DiscussionPostDetailPresenter = this$DiscussionPostDetailPresenter_0;
    this.local$closure$messageRead = closure$messageRead_0;
  }
  Coroutine$DiscussionPostDetailPresenter$updateMessageRead$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$DiscussionPostDetailPresenter$updateMessageRead$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$DiscussionPostDetailPresenter$updateMessageRead$lambda.prototype.constructor = Coroutine$DiscussionPostDetailPresenter$updateMessageRead$lambda;
  Coroutine$DiscussionPostDetailPresenter$updateMessageRead$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = withDoorTransactionAsync(this.local$this$DiscussionPostDetailPresenter.repo, getKClass(UmAppDatabase), DiscussionPostDetailPresenter$updateMessageRead$lambda$lambda(this.local$closure$messageRead), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 DiscussionPostDetailPresenter$updateMessageRead$lambda(this$DiscussionPostDetailPresenter_0, closure$messageRead_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$DiscussionPostDetailPresenter$updateMessageRead$lambda(this$DiscussionPostDetailPresenter_0, closure$messageRead_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  DiscussionPostDetailPresenter.prototype.updateMessageRead_q6ck09$ = function(messageRead) {
  launch(this.presenterScope, void 0, void 0, DiscussionPostDetailPresenter$updateMessageRead$lambda(this, messageRead));
};
  function Coroutine$DiscussionPostDetailPresenter$updateMessageReadList$lambda$lambda(closure$messageReadList_0, txRepo_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$messageReadList = closure$messageReadList_0;
    this.local$txRepo = txRepo_0;
  }
  Coroutine$DiscussionPostDetailPresenter$updateMessageReadList$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$DiscussionPostDetailPresenter$updateMessageReadList$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$DiscussionPostDetailPresenter$updateMessageReadList$lambda$lambda.prototype.constructor = Coroutine$DiscussionPostDetailPresenter$updateMessageReadList$lambda$lambda;
  Coroutine$DiscussionPostDetailPresenter$updateMessageReadList$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        return this.local$txRepo.messageReadDao.insertList_4ezy5m$(this.local$closure$messageReadList) , Unit;
      case 1:
        throw this.exception_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 DiscussionPostDetailPresenter$updateMessageReadList$lambda$lambda(closure$messageReadList_0) {
    return function(txRepo_0, continuation_0, suspended) {
  var instance = new Coroutine$DiscussionPostDetailPresenter$updateMessageReadList$lambda$lambda(closure$messageReadList_0, txRepo_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$DiscussionPostDetailPresenter$updateMessageReadList$lambda(this$DiscussionPostDetailPresenter_0, closure$messageReadList_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$DiscussionPostDetailPresenter = this$DiscussionPostDetailPresenter_0;
    this.local$closure$messageReadList = closure$messageReadList_0;
  }
  Coroutine$DiscussionPostDetailPresenter$updateMessageReadList$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$DiscussionPostDetailPresenter$updateMessageReadList$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$DiscussionPostDetailPresenter$updateMessageReadList$lambda.prototype.constructor = Coroutine$DiscussionPostDetailPresenter$updateMessageReadList$lambda;
  Coroutine$DiscussionPostDetailPresenter$updateMessageReadList$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = withDoorTransactionAsync(this.local$this$DiscussionPostDetailPresenter.repo, getKClass(UmAppDatabase), DiscussionPostDetailPresenter$updateMessageReadList$lambda$lambda(this.local$closure$messageReadList), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 DiscussionPostDetailPresenter$updateMessageReadList$lambda(this$DiscussionPostDetailPresenter_0, closure$messageReadList_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$DiscussionPostDetailPresenter$updateMessageReadList$lambda(this$DiscussionPostDetailPresenter_0, closure$messageReadList_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  DiscussionPostDetailPresenter.prototype.updateMessageReadList_5to0km$ = function(messageReadList) {
  launch(this.presenterScope, void 0, void 0, DiscussionPostDetailPresenter$updateMessageReadList$lambda(this, messageReadList));
};
  DiscussionPostDetailPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'DiscussionPostDetailPresenter', 
  interfaces: [MessagesPresenter, UstadBaseController]};
  function DiscussionPostEditPresenter(context, arguments_0, view, di, lifecycleOwner) {
    DiscussionPostEditPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.topicUid_0 = L0;
    this.clazzUid_0 = L0;
  }
  Object.defineProperty(DiscussionPostEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  function Coroutine$DiscussionPostEditPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$DiscussionPostEditPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$DiscussionPostEditPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$DiscussionPostEditPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$DiscussionPostEditPresenter$onLoadEntityFromDb$lambda;
  Coroutine$DiscussionPostEditPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$closure$db.discussionPostDao.findByUid_s8cxhz$(this.local$closure$entityUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 DiscussionPostEditPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$DiscussionPostEditPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_12($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_12.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_12.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_12.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_12;
  Coroutine$onLoadEntityFromDb_7hogkd$_12.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5;
        var entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.$this.topicUid_0 = (tmp$_2 = (tmp$_1 = this.$this.arguments.get_11rb$(DiscussionPostEditPresenter$Companion_getInstance().ARG_DISCUSSION_TOPIC_UID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0;
        this.$this.clazzUid_0 = (tmp$_4 = (tmp$_3 = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$_3) : null) != null ? tmp$_4 : L0;
        this.state_0 = 2;
        this.result_0 = withTimeoutOrNull(L2000, DiscussionPostEditPresenter$onLoadEntityFromDb$lambda(this.local$db, entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var tmp$_6;
        if ((tmp$_5 = this.result_0) != null) 
          tmp$_6 = tmp$_5;
        else {
          var $receiver = new DiscussionPost();
          $receiver.discussionPostClazzUid = this.$this.clazzUid_0;
          $receiver.discussionPostDiscussionTopicUid = this.$this.topicUid_0;
          $receiver.discussionPostStartedPersonUid = this.$this.accountManager.activeAccount.personUid;
          $receiver.discussionPostStartDate = systemTimeInMillis();
          tmp$_6 = $receiver;
        }
        var discussionPost = tmp$_6;
        return discussionPost;
      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);
};
  DiscussionPostEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_12(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  DiscussionPostEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$, tmp$_0, tmp$_1;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  this.topicUid_0 = (tmp$_0 = (tmp$ = bundle.get_11rb$(DiscussionPostEditPresenter$Companion_getInstance().ARG_DISCUSSION_TOPIC_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = DiscussionPost.Companion.serializer();
    var tmp$_2;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_2 : throwCCE(), null);
    tmp$_1 = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    tmp$_1 = new DiscussionPost();
  }
  var editEntity = tmp$_1;
  return editEntity;
};
  DiscussionPostEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  function Coroutine$DiscussionPostEditPresenter$handleClickSave$lambda(closure$entity_0, this$DiscussionPostEditPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$DiscussionPostEditPresenter = this$DiscussionPostEditPresenter_0;
    this.local$tmp$ = void 0;
  }
  Coroutine$DiscussionPostEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$DiscussionPostEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$DiscussionPostEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$DiscussionPostEditPresenter$handleClickSave$lambda;
  Coroutine$DiscussionPostEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (equals(this.local$closure$entity.discussionPostUid, L0)) {
          this.local$tmp$ = this.local$closure$entity;
          this.state_0 = 3;
          this.result_0 = this.local$this$DiscussionPostEditPresenter.repo.discussionPostDao.insertAsync(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 2;
          this.result_0 = this.local$this$DiscussionPostEditPresenter.repo.discussionPostDao.updateAsync_ttuxpq$(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 4;
        continue;
      case 3:
        this.local$tmp$.discussionPostUid = this.result_0;
        this.state_0 = 4;
        continue;
      case 4:
        return this.local$this$DiscussionPostEditPresenter.onFinish_xcg1s8$(DiscussionPostDetailView$Companion_getInstance().VIEW_NAME, this.local$closure$entity.discussionPostUid, this.local$closure$entity, DiscussionPost.Companion.serializer()) , Unit;
      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 DiscussionPostEditPresenter$handleClickSave$lambda(closure$entity_0, this$DiscussionPostEditPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$DiscussionPostEditPresenter$handleClickSave$lambda(closure$entity_0, this$DiscussionPostEditPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  DiscussionPostEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  launch(this.presenterScope, void 0, void 0, DiscussionPostEditPresenter$handleClickSave$lambda(entity, this));
};
  function DiscussionPostEditPresenter$Companion() {
    DiscussionPostEditPresenter$Companion_instance = this;
    this.ARG_DISCUSSION_TOPIC_UID = 'ArgDiscussionPostUid';
  }
  DiscussionPostEditPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var DiscussionPostEditPresenter$Companion_instance = null;
  function DiscussionPostEditPresenter$Companion_getInstance() {
    if (DiscussionPostEditPresenter$Companion_instance === null) {
      new DiscussionPostEditPresenter$Companion();
    }
    return DiscussionPostEditPresenter$Companion_instance;
  }
  DiscussionPostEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'DiscussionPostEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function DiscussionTopicDetailPresenter(context, arguments_0, view, di, lifecycleOwner) {
    DiscussionTopicDetailPresenter$Companion_getInstance();
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(DiscussionTopicDetailPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$LIVEDATA_getInstance();
}});
  DiscussionTopicDetailPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  return true;
};
  DiscussionTopicDetailPresenter.prototype.onLoadLiveData_7hogkd$ = function(repo) {
  var tmp$, tmp$_0;
  var entityUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  this.view.posts = repo.discussionPostDao.getPostsByDiscussionTopic_s8cxhz$(entityUid);
  return repo.discussionTopicDao.getDiscussionTopicByUid_s8cxhz$(entityUid);
};
  DiscussionTopicDetailPresenter.prototype.handleClickEdit = function() {
};
  DiscussionTopicDetailPresenter.prototype.onClickAddPost = function() {
  var tmp$, tmp$_0, tmp$_1;
  var topicUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, DiscussionPostEditView$Companion_getInstance().VIEW_NAME, getKClass(DiscussionPost), DiscussionPost.Companion.serializer(), DiscussionTopicDetailPresenter$Companion_getInstance().RESULT_NEW_POST, void 0, mutableMapOf([to(DiscussionPostEditPresenter$Companion_getInstance().ARG_DISCUSSION_TOPIC_UID, topicUid.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZUID, toString((tmp$_1 = this.view.entity) != null ? tmp$_1.discussionTopicClazzUid : null))])));
};
  DiscussionTopicDetailPresenter.prototype.onClickPost_w5x7jm$ = function(discussionPost) {
  var tmp$;
  var args = LinkedHashMap_init();
  var key = UstadView$Companion_getInstance().ARG_ENTITY_UID;
  var value = discussionPost.discussionPostUid.toString();
  args.put_xwzc9p$(key, value);
    (tmp$ = this.ustadNavController) != null ? (tmp$.navigate_oc2wlg$(DiscussionPostDetailView$Companion_getInstance().VIEW_NAME, args) , Unit) : null;
};
  function DiscussionTopicDetailPresenter$Companion() {
    DiscussionTopicDetailPresenter$Companion_instance = this;
    this.RESULT_NEW_POST = 'ResultNewPost';
  }
  DiscussionTopicDetailPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var DiscussionTopicDetailPresenter$Companion_instance = null;
  function DiscussionTopicDetailPresenter$Companion_getInstance() {
    if (DiscussionTopicDetailPresenter$Companion_instance === null) {
      new DiscussionTopicDetailPresenter$Companion();
    }
    return DiscussionTopicDetailPresenter$Companion_instance;
  }
  DiscussionTopicDetailPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'DiscussionTopicDetailPresenter', 
  interfaces: [UstadDetailPresenter]};
  function DiscussionTopicEditPresenter(context, arguments_0, view, lifecycleOwner, di) {
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(DiscussionTopicEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$JSON_getInstance();
}});
  DiscussionTopicEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = DiscussionTopic.Companion.serializer();
    var tmp$_0;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    var $receiver = new DiscussionTopic();
    $receiver.discussionTopicUid = get_doorPrimaryKeyManager(this.db).nextId_za3lpa$(131);
    $receiver.discussionTopicStartDate = systemTimeInMillis();
    tmp$ = $receiver;
  }
  var editEntity = tmp$;
  return editEntity;
};
  DiscussionTopicEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  function Coroutine$DiscussionTopicEditPresenter$handleClickSave$lambda(closure$entity_0, this$DiscussionTopicEditPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$DiscussionTopicEditPresenter = this$DiscussionTopicEditPresenter_0;
  }
  Coroutine$DiscussionTopicEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$DiscussionTopicEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$DiscussionTopicEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$DiscussionTopicEditPresenter$handleClickSave$lambda;
  Coroutine$DiscussionTopicEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var $receiver = this.local$closure$entity.discussionTopicTitle;
        if ($receiver == null || $receiver.length === 0) {
          this.local$this$DiscussionTopicEditPresenter.view.blockTitleError = this.local$this$DiscussionTopicEditPresenter.systemImpl.getString(2127, this.local$this$DiscussionTopicEditPresenter.context);
          return;
        } else {
          this.local$this$DiscussionTopicEditPresenter.view.blockTitleError = null;
        }
        this.local$this$DiscussionTopicEditPresenter.view.loading = true;
        this.local$this$DiscussionTopicEditPresenter.view.fieldsEnabled = false;
        var tmp$ = this.local$this$DiscussionTopicEditPresenter;
        var di = this.local$this$DiscussionTopicEditPresenter.di;
        var strategy = ListSerializer(DiscussionTopic.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_0;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
        tmp$.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
        this.local$this$DiscussionTopicEditPresenter.view.loading = false;
        return this.local$this$DiscussionTopicEditPresenter.view.fieldsEnabled = true , Unit;
      case 1:
        throw this.exception_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 DiscussionTopicEditPresenter$handleClickSave$lambda(closure$entity_0, this$DiscussionTopicEditPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$DiscussionTopicEditPresenter$handleClickSave$lambda(closure$entity_0, this$DiscussionTopicEditPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  DiscussionTopicEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  launch(this.presenterScope, void 0, void 0, DiscussionTopicEditPresenter$handleClickSave$lambda(entity, this));
};
  DiscussionTopicEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'DiscussionTopicEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function get$lambda_0($receiver) {
    return Unit;
  }
  function Runnable$ObjectLiteral(closure$block) {
    this.closure$block = closure$block;
  }
  Runnable$ObjectLiteral.prototype.run = function() {
  this.closure$block();
};
  Runnable$ObjectLiteral.$metadata$ = {
  kind: Kind_CLASS, 
  interfaces: [Runnable]};
  function EpubContentPresenter(context, args, epubContentView, di) {
    EpubContentPresenter$Companion_getInstance();
    UstadBaseController.call(this, context, args, epubContentView, di, false);
    this.epubContentView_0 = epubContentView;
    this.clazzUid_0 = L0;
    this.ocf_0 = null;
    this.mountedPath_0 = '';
    this.mountedEndpoint_0 = '';
    this.opfBaseUrl_0 = null;
    this.linearSpineUrls_0 = [];
    var tmp$;
    this.accountManager_kjhsl2$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, EpubContentPresenter$accountManager_metadata);
    var tmp$_0;
    this.mountHandler_5bmxaz$_0 = Instance(this, Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(ContainerMounter), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, EpubContentPresenter$mountHandler_metadata);
    var tmp$_1;
    this.systemImpl_ikklll$_0 = Instance(this, Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$_1 : throwCCE(), null).provideDelegate_tpuvb9$(this, EpubContentPresenter$systemImpl_metadata);
    this.onCreateException_0 = null;
    this.isStarted_0 = false;
    this.startTime_0 = L0;
    var context_0 = this.accountManager_0.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_2;
    var tmp$_3;
    this.xapiStatementEndpoint_eeu6n8$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_2 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(XapiStatementEndpoint), [], false)), TypeToken) ? tmp$_3 : throwCCE(), null).provideDelegate_tpuvb9$(this, EpubContentPresenter$xapiStatementEndpoint_metadata);
    this.contentEntryUid = L0;
    this.maxPageReached = 0;
    this.mCurrentPage = 0;
    this.contextRegistration_5rxvbe$_0 = this.contextRegistration_5rxvbe$_0;
    this.pageTitles_0 = LinkedHashMap_init();
    this.mNavDocument_0 = null;
    var context_1 = this.accountManager_0.activeAccount;
    var trigger_0;
    trigger_0 = this.diTrigger;
    var tmp$_4;
    var tmp$_5;
    this.db_35zsi0$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_4 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_4 : throwCCE(), context_1), trigger_0), Kotlin.isType(tmp$_5 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_5 : throwCCE(), 1).provideDelegate_tpuvb9$(this, EpubContentPresenter$db_metadata);
  }
  var EpubContentPresenter$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(EpubContentPresenter.prototype, 'accountManager_0', {
  configurable: true, 
  get: function() {
  return this.accountManager_kjhsl2$_0.value;
}});
  var EpubContentPresenter$mountHandler_metadata = new PropertyMetadata('mountHandler');
  Object.defineProperty(EpubContentPresenter.prototype, 'mountHandler_0', {
  configurable: true, 
  get: function() {
  return this.mountHandler_5bmxaz$_0.value;
}});
  var EpubContentPresenter$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(EpubContentPresenter.prototype, 'systemImpl_0', {
  configurable: true, 
  get: function() {
  return this.systemImpl_ikklll$_0.value;
}});
  var EpubContentPresenter$xapiStatementEndpoint_metadata = new PropertyMetadata('xapiStatementEndpoint');
  Object.defineProperty(EpubContentPresenter.prototype, 'xapiStatementEndpoint_0', {
  configurable: true, 
  get: function() {
  return this.xapiStatementEndpoint_eeu6n8$_0.value;
}});
  Object.defineProperty(EpubContentPresenter.prototype, 'contextRegistration', {
  configurable: true, 
  get: function() {
  if (this.contextRegistration_5rxvbe$_0 == null) 
    return throwUPAE('contextRegistration');
  return this.contextRegistration_5rxvbe$_0;
}, 
  set: function(contextRegistration) {
  this.contextRegistration_5rxvbe$_0 = contextRegistration;
}});
  var EpubContentPresenter$db_metadata = new PropertyMetadata('db');
  Object.defineProperty(EpubContentPresenter.prototype, 'db_0', {
  configurable: true, 
  get: function() {
  return this.db_35zsi0$_0.value;
}});
  function Coroutine$EpubContentPresenter$onCreate$lambda$lambda(this$EpubContentPresenter_0, closure$containerUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$EpubContentPresenter = this$EpubContentPresenter_0;
    this.local$closure$containerUid = closure$containerUid_0;
  }
  Coroutine$EpubContentPresenter$onCreate$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$EpubContentPresenter$onCreate$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$EpubContentPresenter$onCreate$lambda$lambda.prototype.constructor = Coroutine$EpubContentPresenter$onCreate$lambda$lambda;
  Coroutine$EpubContentPresenter$onCreate$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$EpubContentPresenter.mountHandler_0.mountContainer_dckg8j$(this.local$this$EpubContentPresenter.accountManager_0.activeAccount.endpointUrl, this.local$closure$containerUid, 1, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$this$EpubContentPresenter.mountedPath_0 = this.result_0;
        this.state_0 = 3;
        this.result_0 = this.local$this$EpubContentPresenter.handleMountedContainer_0(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 EpubContentPresenter$onCreate$lambda$lambda(this$EpubContentPresenter_0, closure$containerUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$EpubContentPresenter$onCreate$lambda$lambda(this$EpubContentPresenter_0, closure$containerUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$EpubContentPresenter$onCreate$lambda(this$EpubContentPresenter_0, closure$containerUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$EpubContentPresenter = this$EpubContentPresenter_0;
    this.local$closure$containerUid = closure$containerUid_0;
  }
  Coroutine$EpubContentPresenter$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$EpubContentPresenter$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$EpubContentPresenter$onCreate$lambda.prototype.constructor = Coroutine$EpubContentPresenter$onCreate$lambda;
  Coroutine$EpubContentPresenter$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = withContext(coroutines.Dispatchers.Default, EpubContentPresenter$onCreate$lambda$lambda(this.local$this$EpubContentPresenter, this.local$closure$containerUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 EpubContentPresenter$onCreate$lambda(this$EpubContentPresenter_0, closure$containerUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$EpubContentPresenter$onCreate$lambda(this$EpubContentPresenter_0, closure$containerUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  EpubContentPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4;
  UstadBaseController.prototype.onCreate.call(this, savedState);
  var containerUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CONTAINER_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L100;
  this.contentEntryUid = (tmp$_2 = (tmp$_1 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CONTENT_ENTRY_UID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0;
  this.clazzUid_0 = (tmp$_4 = (tmp$_3 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$_3) : null) != null ? tmp$_4 : L0;
  this.contextRegistration = randomUuid().toString();
  this.view.setProgressBarProgress = -1;
  this.view.setProgressBarVisible = true;
  this.mountedEndpoint_0 = this.accountManager_0.activeAccount.endpointUrl;
  launch(this.presenterScope, void 0, void 0, EpubContentPresenter$onCreate$lambda(this, containerUid));
};
  EpubContentPresenter.prototype.onStart = function() {
  var tmp$;
  UstadBaseController.prototype.onStart.call(this);
  this.startTime_0 = getSystemTimeInMillis();
  this.isStarted_0 = true;
  if ((tmp$ = this.onCreateException_0) != null) {
    this.navigateToErrorScreen_3lhtaa$(tmp$);
  }
  this.onCreateException_0 = null;
};
  function Coroutine$EpubContentPresenter$onStop$lambda$lambda(this$EpubContentPresenter_0, closure$duration_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$EpubContentPresenter = this$EpubContentPresenter_0;
    this.local$closure$duration = closure$duration_0;
  }
  Coroutine$EpubContentPresenter$onStop$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$EpubContentPresenter$onStop$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$EpubContentPresenter$onStop$lambda$lambda.prototype.constructor = Coroutine$EpubContentPresenter$onStop$lambda$lambda;
  Coroutine$EpubContentPresenter$onStop$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        tmp$ = this.local$this$EpubContentPresenter.db_0.contentEntryDao.findByUid(this.local$this$EpubContentPresenter.contentEntryUid);
        if (tmp$ == null) {
          return;
        }
        var contentEntry = tmp$;
        var tmp$_0 = (this.local$this$EpubContentPresenter.maxPageReached + 1 | 0) * 100 | 0;
        var a = this.local$this$EpubContentPresenter.linearSpineUrls_0.length;
        var progress = tmp$_0 / JsMath.max(a, 1) | 0;
        return storeProgressStatement(this.local$this$EpubContentPresenter.xapiStatementEndpoint_0, this.local$this$EpubContentPresenter.accountManager_0.activeAccount, contentEntry, progress, this.local$closure$duration, this.local$this$EpubContentPresenter.contextRegistration, this.local$this$EpubContentPresenter.clazzUid_0) , Unit;
      case 1:
        throw this.exception_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 EpubContentPresenter$onStop$lambda$lambda(this$EpubContentPresenter_0, closure$duration_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$EpubContentPresenter$onStop$lambda$lambda(this$EpubContentPresenter_0, closure$duration_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$EpubContentPresenter$onStop$lambda(this$EpubContentPresenter_0, closure$duration_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$EpubContentPresenter = this$EpubContentPresenter_0;
    this.local$closure$duration = closure$duration_0;
  }
  Coroutine$EpubContentPresenter$onStop$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$EpubContentPresenter$onStop$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$EpubContentPresenter$onStop$lambda.prototype.constructor = Coroutine$EpubContentPresenter$onStop$lambda;
  Coroutine$EpubContentPresenter$onStop$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = withContext(coroutines.Dispatchers.Default, EpubContentPresenter$onStop$lambda$lambda(this.local$this$EpubContentPresenter, this.local$closure$duration), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 EpubContentPresenter$onStop$lambda(this$EpubContentPresenter_0, closure$duration_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$EpubContentPresenter$onStop$lambda(this$EpubContentPresenter_0, closure$duration_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  EpubContentPresenter.prototype.onStop = function() {
  UstadBaseController.prototype.onStop.call(this);
  var duration = getSystemTimeInMillis().subtract(this.startTime_0);
  if (equals(this.accountManager_0.activeAccount.personUid, L0)) 
    return;
  launch(this.presenterScope, void 0, void 0, EpubContentPresenter$onStop$lambda(this, duration));
};
  function EpubContentPresenter$handleMountedContainer$lambda(closure$containerTitle, this$EpubContentPresenter, closure$opfCoverImageItem, closure$authorNames) {
    return function() {
  var tmp$;
  this$EpubContentPresenter.epubContentView_0.setContainerTitle = closure$containerTitle;
  this$EpubContentPresenter.epubContentView_0.setSpineUrls = toList_0(this$EpubContentPresenter.linearSpineUrls_0);
  if (closure$opfCoverImageItem != null) {
    var tmp$_0 = this$EpubContentPresenter.epubContentView_0;
    var tmp$_1;
    if ((tmp$ = closure$opfCoverImageItem.href) != null) {
      var tmp$_2;
      tmp$_1 = (tmp$_2 = this$EpubContentPresenter.opfBaseUrl_0) != null ? UMFileUtil_getInstance().resolveLink_puj7f4$(tmp$_2, tmp$) : null;
    } else 
      tmp$_1 = null;
    tmp$_0.setCoverImage = tmp$_1;
  }
  if (closure$authorNames != null) {
    this$EpubContentPresenter.epubContentView_0.setAuthorName = closure$authorNames;
  }
  return Unit;
};
  }
  function EpubContentPresenter$handleMountedContainer$lambda_0(closure$navDocument, this$EpubContentPresenter) {
    return function() {
  var tmp$;
  this$EpubContentPresenter.epubContentView_0.setTableOfContents = (tmp$ = closure$navDocument.toc) != null ? tmp$ : closure$navDocument.ncxNavMap;
  return Unit;
};
  }
  function EpubContentPresenter$handleMountedContainer$lambda_1(this$EpubContentPresenter) {
    return function() {
  this$EpubContentPresenter.view.setProgressBarVisible = false;
  return Unit;
};
  }
  function Coroutine$handleMountedContainer_0($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 30;
    this.$this = $this;
    this.local$tmp$_10 = void 0;
    this.local$client = void 0;
    this.local$response = void 0;
    this.local$xppFactoryNsAware = void 0;
    this.local$response_0 = void 0;
    this.local$opf = void 0;
    this.local$opfCoverImageItem = void 0;
    this.local$authorNames = void 0;
    this.local$response_1 = void 0;
  }
  Coroutine$handleMountedContainer_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$handleMountedContainer_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$handleMountedContainer_0.prototype.constructor = Coroutine$handleMountedContainer_0;
  Coroutine$handleMountedContainer_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6, tmp$_7, tmp$_8, tmp$_9;
        var tmp$_10, tmp$_11, tmp$_12, tmp$_13;
        this.exceptionState_0 = 28;
        var tmp$_14;
        this.local$client = get_direct(this.$this.di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_14 = typeToken(createKType(getKClass(HttpClient), [], false)), TypeToken) ? tmp$_14 : throwCCE(), null);
        var urlString = UMFileUtil_getInstance().joinPaths_vqirvp$([this.$this.mountedPath_0, EpubContentPresenter$Companion_getInstance().OCF_CONTAINER_PATH]);
        var host_0;
        var body_0;
        host_0 = 'localhost';
        body_0 = utils.EmptyContent;
        var $receiver_1 = new HttpRequestBuilder_init();
        url_0($receiver_1, 'http', host_0, 0, '/');
        $receiver_1.method = HttpMethod.Companion.Get;
        $receiver_1.body = body_0;
        takeFrom_0($receiver_1.url, urlString);
        get$lambda_0($receiver_1);
        var $this_0 = new HttpStatement($receiver_1, this.local$client);
        var tmp$_4_0, tmp$_5_0, tmp$_6_0;
        tmp$_4_0 = PrimitiveClasses$stringClass;
        if (equals(tmp$_4_0, getKClass(HttpStatement))) {
          this.result_0 = typeof (tmp$_5_0 = $this_0) === 'string' ? tmp$_5_0 : throwCCE();
          this.state_0 = 8;
          continue;
        } else {
          if (equals(tmp$_4_0, getKClass(HttpResponse))) {
            this.state_0 = 6;
            this.result_0 = $this_0.execute(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 1;
            this.result_0 = $this_0.executeUnsafe(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          }
        }
      case 1:
        this.local$response = this.result_0;
        this.exceptionState_0 = 4;
        var tmp$_7_0;
        var tmp$_8_0 = this.local$response.call;
        var typeInfo$result_0;
        typeInfo$break:
          do {
            try {
              typeInfo$result_0 = typeInfoImpl(reflect.JsType, PrimitiveClasses$stringClass, createKType(PrimitiveClasses$stringClass, [], false));
            }            catch (_) {
  typeInfo$result_0 = typeInfoImpl(reflect.JsType, PrimitiveClasses$stringClass, null);
  break typeInfo$break;
}
          } while (false);
        this.state_0 = 2;
        this.result_0 = tmp$_8_0.receive_qi9ur9$(typeInfo$result_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 2:
        this.result_0 = typeof (tmp$_7_0 = this.result_0) === 'string' ? tmp$_7_0 : throwCCE();
        this.exceptionState_0 = 28;
        this.finallyPath_0 = [3];
        this.state_0 = 5;
        continue;
      case 3:
        this.state_0 = 7;
        continue;
      case 4:
        this.finallyPath_0 = [28];
        this.state_0 = 5;
        continue;
      case 5:
        this.exceptionState_0 = 28;
        complete(this.local$response);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 6:
        this.result_0 = typeof (tmp$_6_0 = this.result_0) === 'string' ? tmp$_6_0 : throwCCE();
        this.state_0 = 7;
        continue;
      case 7:
        this.state_0 = 8;
        continue;
      case 8:
        this.result_0;
        var ocfContent = this.result_0;
        var tmp$_15;
        this.local$xppFactoryNsAware = get_direct(this.$this.di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_15 = typeToken(createKType(getKClass(XmlPullParserFactory), [], false)), TypeToken) ? tmp$_15 : throwCCE(), 1);
        this.$this.ocf_0 = new OcfDocument();
        var ocfParser = this.local$xppFactoryNsAware.newPullParser();
        setInputString(ocfParser, ocfContent);
                (tmp$ = this.$this.ocf_0) != null ? (tmp$.loadFromParser_gtk95s$(ocfParser) , Unit) : null;
        var opfUrl = (tmp$_3 = (tmp$_2 = (tmp$_1 = (tmp$_0 = this.$this.ocf_0) != null ? tmp$_0.rootFiles_8be2vx$ : null) != null ? tmp$_1.get_za3lpa$(0) : null) != null ? tmp$_2.fullPath : null) != null ? UMFileUtil_getInstance().joinPaths_vqirvp$([this.$this.mountedPath_0, tmp$_3]) : null;
        var urlString_0 = toString(opfUrl);
        var host_0_0;
        var body_0_0;
        host_0_0 = 'localhost';
        body_0_0 = utils.EmptyContent;
        var $receiver_1_0 = new HttpRequestBuilder_init();
        url_0($receiver_1_0, 'http', host_0_0, 0, '/');
        $receiver_1_0.method = HttpMethod.Companion.Get;
        $receiver_1_0.body = body_0_0;
        takeFrom_0($receiver_1_0.url, urlString_0);
        get$lambda_0($receiver_1_0);
        var $this_0_0 = new HttpStatement($receiver_1_0, this.local$client);
        var tmp$_4_1, tmp$_5_1, tmp$_6_1;
        tmp$_4_1 = PrimitiveClasses$stringClass;
        if (equals(tmp$_4_1, getKClass(HttpStatement))) {
          this.result_0 = typeof (tmp$_5_1 = $this_0_0) === 'string' ? tmp$_5_1 : throwCCE();
          this.state_0 = 16;
          continue;
        } else {
          if (equals(tmp$_4_1, getKClass(HttpResponse))) {
            this.state_0 = 14;
            this.result_0 = $this_0_0.execute(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 9;
            this.result_0 = $this_0_0.executeUnsafe(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          }
        }
      case 9:
        this.local$response_0 = this.result_0;
        this.exceptionState_0 = 12;
        var tmp$_7_1;
        var tmp$_8_1 = this.local$response_0.call;
        var typeInfo$result_0_0;
        typeInfo$break:
          do {
            try {
              typeInfo$result_0_0 = typeInfoImpl(reflect.JsType, PrimitiveClasses$stringClass, createKType(PrimitiveClasses$stringClass, [], false));
            }            catch (__0) {
  typeInfo$result_0_0 = typeInfoImpl(reflect.JsType, PrimitiveClasses$stringClass, null);
  break typeInfo$break;
}
          } while (false);
        this.state_0 = 10;
        this.result_0 = tmp$_8_1.receive_qi9ur9$(typeInfo$result_0_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 10:
        this.result_0 = typeof (tmp$_7_1 = this.result_0) === 'string' ? tmp$_7_1 : throwCCE();
        this.exceptionState_0 = 28;
        this.finallyPath_0 = [11];
        this.state_0 = 13;
        continue;
      case 11:
        this.state_0 = 15;
        continue;
      case 12:
        this.finallyPath_0 = [28];
        this.state_0 = 13;
        continue;
      case 13:
        this.exceptionState_0 = 28;
        complete(this.local$response_0);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 14:
        this.result_0 = typeof (tmp$_6_1 = this.result_0) === 'string' ? tmp$_6_1 : throwCCE();
        this.state_0 = 15;
        continue;
      case 15:
        this.state_0 = 16;
        continue;
      case 16:
        this.result_0;
        var opfContent = this.result_0;
        this.local$opf = new OpfDocument();
        var tmp$_16;
        var xppFactoryNsUnaware = get_direct(this.$this.di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_16 = typeToken(createKType(getKClass(XmlPullParserFactory), [], false)), TypeToken) ? tmp$_16 : throwCCE(), 0);
        var opfParser = xppFactoryNsUnaware.newPullParser();
        setInputString(opfParser, opfContent);
        this.local$opf.loadFromOPF_h3yi26$(opfParser);
        var linearSpineHrefsRelative = this.local$opf.linearSpineHREFs;
        this.$this.opfBaseUrl_0 = (tmp$_8 = (tmp$_7 = (tmp$_6 = (tmp$_5 = (tmp$_4 = this.$this.ocf_0) != null ? tmp$_4.rootFiles_8be2vx$ : null) != null ? tmp$_5.get_za3lpa$(0) : null) != null ? tmp$_6.fullPath : null) != null ? UMFileUtil_getInstance().joinPaths_vqirvp$([this.$this.mountedPath_0, tmp$_7]) : null) != null ? UMFileUtil_getInstance().getParentFilename_61zpoe$(tmp$_8) : null;
        var array = Array_0(linearSpineHrefsRelative.length);
        var tmp$_17;
        tmp$_17 = array.length - 1 | 0;
        for (var i = 0; i <= tmp$_17; i++) {
          array[i] = '';
        }
        this.$this.linearSpineUrls_0 = array;
        for (var i_0 = 0; i_0 !== linearSpineHrefsRelative.length; ++i_0) {
          var tmp$_18;
          this.$this.linearSpineUrls_0[i_0] = toString((tmp$_18 = this.$this.opfBaseUrl_0) != null ? UMFileUtil_getInstance().joinPaths_vqirvp$([tmp$_18, linearSpineHrefsRelative[i_0]]) : null);
        }
        this.local$opfCoverImageItem = this.local$opf.getCoverImage_61zpoe$('');
        this.local$authorNames = this.local$opf.numCreators > 0 ? (tmp$_9 = this.local$opf.creators_8be2vx$) != null ? joinToString(tmp$_9, ',') : null : null;
        var position = this.$this.arguments.containsKey_11rb$(EpubContentView$Companion_getInstance().ARG_INITIAL_PAGE_HREF) ? this.local$opf.getLinearSpinePositionByHREF_61zpoe$(getValue(this.$this.arguments, EpubContentView$Companion_getInstance().ARG_INITIAL_PAGE_HREF)) : 0;
        var $receiver = this.local$opf.title;
        if (!($receiver == null || isBlank($receiver))) {
          this.local$tmp$_10 = this.local$opf.title;
          this.state_0 = 18;
          continue;
        } else {
          this.state_0 = 17;
          this.result_0 = this.$this.db_0.contentEntryDao.findTitleByUidAsync_s8cxhz$(this.$this.contentEntryUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 17:
        this.local$tmp$_10 = this.result_0;
        this.state_0 = 18;
        continue;
      case 18:
        var containerTitle = this.local$tmp$_10;
        this.$this.epubContentView_0.runOnUiThread_9ywmpy$(new Runnable$ObjectLiteral(EpubContentPresenter$handleMountedContainer$lambda(containerTitle, this.$this, this.local$opfCoverImageItem, this.local$authorNames)));
        var tmp$_19;
        if ((tmp$_11 = (tmp$_10 = this.local$opf.navItem) != null ? tmp$_10.href : null) != null) {
          var tmp$_20, tmp$_21, tmp$_22, tmp$_23, tmp$_24;
          tmp$_19 = (tmp$_24 = (tmp$_23 = (tmp$_22 = (tmp$_21 = (tmp$_20 = this.$this.ocf_0) != null ? tmp$_20.rootFiles_8be2vx$ : null) != null ? tmp$_21.get_za3lpa$(0) : null) != null ? tmp$_22.fullPath : null) != null ? UMFileUtil_getInstance().joinPaths_vqirvp$([this.$this.mountedPath_0, tmp$_23]) : null) != null ? UMFileUtil_getInstance().resolveLink_puj7f4$(tmp$_24, tmp$_11) : null;
        } else 
          tmp$_19 = null;
        var navXhtmlUrl = tmp$_19;
        var tmp$_25;
        if ((tmp$_13 = (tmp$_12 = this.local$opf.ncxItem) != null ? tmp$_12.href : null) != null) {
          var tmp$_26, tmp$_27, tmp$_28, tmp$_29, tmp$_30;
          tmp$_25 = (tmp$_30 = (tmp$_29 = (tmp$_28 = (tmp$_27 = (tmp$_26 = this.$this.ocf_0) != null ? tmp$_26.rootFiles_8be2vx$ : null) != null ? tmp$_27.get_za3lpa$(0) : null) != null ? tmp$_28.fullPath : null) != null ? UMFileUtil_getInstance().joinPaths_vqirvp$([this.$this.mountedPath_0, tmp$_29]) : null) != null ? UMFileUtil_getInstance().resolveLink_puj7f4$(tmp$_30, tmp$_13) : null;
        } else 
          tmp$_25 = null;
        var ncxUrl = tmp$_25;
        var navUrlToLoad = navXhtmlUrl != null ? navXhtmlUrl : ncxUrl;
        if (navUrlToLoad != null) {
          var host_0_1;
          var body_0_1;
          host_0_1 = 'localhost';
          body_0_1 = utils.EmptyContent;
          var $receiver_1_1 = new HttpRequestBuilder_init();
          url_0($receiver_1_1, 'http', host_0_1, 0, '/');
          $receiver_1_1.method = HttpMethod.Companion.Get;
          $receiver_1_1.body = body_0_1;
          takeFrom_0($receiver_1_1.url, navUrlToLoad);
          get$lambda_0($receiver_1_1);
          var $this_0_1 = new HttpStatement($receiver_1_1, this.local$client);
          var tmp$_4_2, tmp$_5_2, tmp$_6_2;
          tmp$_4_2 = PrimitiveClasses$stringClass;
          if (equals(tmp$_4_2, getKClass(HttpStatement))) {
            this.result_0 = typeof (tmp$_5_2 = $this_0_1) === 'string' ? tmp$_5_2 : throwCCE();
            this.state_0 = 26;
            continue;
          } else {
            if (equals(tmp$_4_2, getKClass(HttpResponse))) {
              this.state_0 = 24;
              this.result_0 = $this_0_1.execute(this);
              if (this.result_0 === COROUTINE_SUSPENDED) 
                return COROUTINE_SUSPENDED;
              continue;
            } else {
              this.state_0 = 19;
              this.result_0 = $this_0_1.executeUnsafe(this);
              if (this.result_0 === COROUTINE_SUSPENDED) 
                return COROUTINE_SUSPENDED;
              continue;
            }
          }
        } else {
          this.state_0 = 27;
          continue;
        }
      case 19:
        this.local$response_1 = this.result_0;
        this.exceptionState_0 = 22;
        var tmp$_7_2;
        var tmp$_8_2 = this.local$response_1.call;
        var typeInfo$result_0_1;
        typeInfo$break:
          do {
            try {
              typeInfo$result_0_1 = typeInfoImpl(reflect.JsType, PrimitiveClasses$stringClass, createKType(PrimitiveClasses$stringClass, [], false));
            }            catch (__1) {
  typeInfo$result_0_1 = typeInfoImpl(reflect.JsType, PrimitiveClasses$stringClass, null);
  break typeInfo$break;
}
          } while (false);
        this.state_0 = 20;
        this.result_0 = tmp$_8_2.receive_qi9ur9$(typeInfo$result_0_1, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 20:
        this.result_0 = typeof (tmp$_7_2 = this.result_0) === 'string' ? tmp$_7_2 : throwCCE();
        this.exceptionState_0 = 28;
        this.finallyPath_0 = [21];
        this.state_0 = 23;
        continue;
      case 21:
        this.state_0 = 25;
        continue;
      case 22:
        this.finallyPath_0 = [28];
        this.state_0 = 23;
        continue;
      case 23:
        this.exceptionState_0 = 28;
        complete(this.local$response_1);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 24:
        this.result_0 = typeof (tmp$_6_2 = this.result_0) === 'string' ? tmp$_6_2 : throwCCE();
        this.state_0 = 25;
        continue;
      case 25:
        this.state_0 = 26;
        continue;
      case 26:
        this.result_0;
        var navContent = this.result_0;
        var $receiver_0 = new EpubNavDocument();
        this.$this.mNavDocument_0 = $receiver_0;
        var navDocument = $receiver_0;
        var navParser = this.local$xppFactoryNsAware.newPullParser();
        setInputString(navParser, navContent);
        navDocument.load_gtk95s$(navParser);
        this.$this.epubContentView_0.runOnUiThread_9ywmpy$(new Runnable$ObjectLiteral(EpubContentPresenter$handleMountedContainer$lambda_0(navDocument, this.$this)));
        this.state_0 = 27;
        continue;
      case 27:
        this.$this.view.runOnUiThread_9ywmpy$(new Runnable$ObjectLiteral(EpubContentPresenter$handleMountedContainer$lambda_1(this.$this)));
        this.exceptionState_0 = 30;
        this.state_0 = 29;
        continue;
      case 28:
        this.exceptionState_0 = 30;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          if (!Kotlin.isType(e, CancellationException)) {
            if (this.$this.isStarted_0) {
              this.$this.navigateToErrorScreen_3lhtaa$(e);
            } else {
              this.$this.onCreateException_0 = e;
            }
          }
        } else 
          throw e;
        this.state_0 = 29;
        continue;
      case 29:
        return;
      case 30:
        throw this.exception_0;
      default:
        this.state_0 = 30;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 30) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  EpubContentPresenter.prototype.handleMountedContainer_0 = function(continuation_0, suspended) {
  var instance = new Coroutine$handleMountedContainer_0(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  EpubContentPresenter.prototype.handleClickNavItem = function(navItem) {
  var tmp$, tmp$_0;
  var opfUrl = this.opfBaseUrl_0;
  var tmp$_1 = opfUrl != null;
  if (tmp$_1) {
    tmp$_1 = !(this.linearSpineUrls_0.length === 0);
  }
  if (tmp$_1) {
    var navItemUrl = (tmp$ = navItem.href) != null ? UMFileUtil_getInstance().resolveLink_puj7f4$(opfUrl, substringBeforeLast(tmp$, '#')) : null;
    var hrefIndex = indexOf(listOf(this.linearSpineUrls_0.slice()), navItemUrl);
    if (hrefIndex !== -1) {
      this.epubContentView_0.scrollToSpinePosition_vqvrqt$(hrefIndex, (tmp$_0 = navItem.href) != null ? substringAfterLast(tmp$_0, '#', '') : null);
    } else {
      this.epubContentView_0.showSnackBar_9pu0dj$(this.systemImpl_0.getString(2177, this.context));
    }
  }
};
  EpubContentPresenter.prototype.handlePageChanged_za3lpa$ = function(index) {
  this.mCurrentPage = index;
  var b = this.maxPageReached;
  this.maxPageReached = JsMath.max(index, b);
  this.updateWindowTitle_0();
};
  EpubContentPresenter.prototype.handlePageTitleChanged_vqvrqt$ = function(index, title) {
  this.pageTitles_0.put_xwzc9p$(index, title);
  this.updateWindowTitle_0();
};
  EpubContentPresenter.prototype.updateWindowTitle_0 = function() {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5;
  var relativeHref = (tmp$_0 = (tmp$ = this.opfBaseUrl_0) != null ? substringAfter(this.linearSpineUrls_0[this.mCurrentPage], tmp$, '') : null) != null ? tmp$_0 : '';
  if (this.mCurrentPage === this.mCurrentPage) 
    this.view.windowTitle = (tmp$_5 = (tmp$_4 = (tmp$_3 = (tmp$_2 = (tmp$_1 = this.mNavDocument_0) != null ? tmp$_1.getNavByHref_61zpoe$(relativeHref) : null) != null ? tmp$_2.title : null) != null ? tmp$_3 : this.pageTitles_0.get_11rb$(this.mCurrentPage)) != null ? tmp$_4 : this.view.setContainerTitle) != null ? tmp$_5 : '';
};
  EpubContentPresenter.prototype.onDestroy = function() {
  this.mountedPath_0.length;
  UstadBaseController.prototype.onDestroy.call(this);
};
  function EpubContentPresenter$Companion() {
    EpubContentPresenter$Companion_instance = this;
    this.OCF_CONTAINER_PATH = 'META-INF/container.xml';
  }
  EpubContentPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var EpubContentPresenter$Companion_instance = null;
  function EpubContentPresenter$Companion_getInstance() {
    if (EpubContentPresenter$Companion_instance === null) {
      new EpubContentPresenter$Companion();
    }
    return EpubContentPresenter$Companion_instance;
  }
  EpubContentPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'EpubContentPresenter', 
  interfaces: [UstadBaseController]};
  function ErrorReportPresenter(context, args, view, di) {
    ErrorReportPresenter$Companion_getInstance();
    UstadBaseController.call(this, context, args, view, di);
    var tmp$;
    this.navController_8aiyd6$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadNavController), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, ErrorReportPresenter$navController_metadata);
    var tmp$_0;
    this.accountManager_2h09nf$_0 = Instance(this, Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, ErrorReportPresenter$accountManager_metadata);
    var context_0 = this.accountManager_0.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_1;
    var tmp$_2;
    this.db_96bpnn$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_1 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_2 : throwCCE(), 1).provideDelegate_tpuvb9$(this, ErrorReportPresenter$db_metadata);
    var context_1 = this.accountManager_0.activeAccount;
    var trigger_0;
    trigger_0 = this.diTrigger;
    var tmp$_3;
    var tmp$_4;
    this.repo_9swv2v$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_3 : throwCCE(), context_1), trigger_0), Kotlin.isType(tmp$_4 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_4 : throwCCE(), 2).provideDelegate_tpuvb9$(this, ErrorReportPresenter$repo_metadata);
    var tmp$_5;
    this.systemImpl_tj9j3o$_0 = Instance(this, Kotlin.isType(tmp$_5 = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$_5 : throwCCE(), null).provideDelegate_tpuvb9$(this, ErrorReportPresenter$systemImpl_metadata);
  }
  var ErrorReportPresenter$navController_metadata = new PropertyMetadata('navController');
  Object.defineProperty(ErrorReportPresenter.prototype, 'navController_0', {
  configurable: true, 
  get: function() {
  return this.navController_8aiyd6$_0.value;
}});
  var ErrorReportPresenter$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(ErrorReportPresenter.prototype, 'accountManager_0', {
  configurable: true, 
  get: function() {
  return this.accountManager_2h09nf$_0.value;
}});
  var ErrorReportPresenter$db_metadata = new PropertyMetadata('db');
  Object.defineProperty(ErrorReportPresenter.prototype, 'db_0', {
  configurable: true, 
  get: function() {
  return this.db_96bpnn$_0.value;
}});
  var ErrorReportPresenter$repo_metadata = new PropertyMetadata('repo');
  Object.defineProperty(ErrorReportPresenter.prototype, 'repo_0', {
  configurable: true, 
  get: function() {
  return this.repo_9swv2v$_0.value;
}});
  var ErrorReportPresenter$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(ErrorReportPresenter.prototype, 'systemImpl_0', {
  configurable: true, 
  get: function() {
  return this.systemImpl_tj9j3o$_0.value;
}});
  function Coroutine$ErrorReportPresenter$onCreate$lambda(closure$savedErrUid_0, this$ErrorReportPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$savedErrUid = closure$savedErrUid_0;
    this.local$this$ErrorReportPresenter = this$ErrorReportPresenter_0;
    this.local$tmp$ = void 0;
    this.local$$receiver = void 0;
    this.local$this$ErrorReportPresenter_0 = void 0;
  }
  Coroutine$ErrorReportPresenter$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ErrorReportPresenter$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ErrorReportPresenter$onCreate$lambda.prototype.constructor = Coroutine$ErrorReportPresenter$onCreate$lambda;
  Coroutine$ErrorReportPresenter$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (equals(this.local$closure$savedErrUid, L0)) {
          this.local$$receiver = new ErrorReport();
          this.local$this$ErrorReportPresenter_0 = this.local$this$ErrorReportPresenter;
          var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
          this.local$$receiver.errorCode = (tmp$_0 = (tmp$ = this.local$this$ErrorReportPresenter_0.arguments.get_11rb$(ErrorReportView$Companion_getInstance().ARG_ERR_CODE)) != null ? toInt(tmp$) : null) != null ? tmp$_0 : -1;
          this.local$$receiver.message = this.local$this$ErrorReportPresenter_0.arguments.get_11rb$(ErrorReportView$Companion_getInstance().ARG_MESSAGE);
          var tmp$_4;
          if ((tmp$_1 = this.local$this$ErrorReportPresenter_0.arguments.get_11rb$(ErrorReportView$Companion_getInstance().ARG_STACKTRACE_PREFKEY)) != null) {
            var tmp$_5;
            var tmp$_6;
            if ((tmp$_5 = this.local$this$ErrorReportPresenter_0.systemImpl_0.getAppPref(tmp$_1, this.local$this$ErrorReportPresenter_0.context)) != null) {
              this.local$this$ErrorReportPresenter_0.systemImpl_0.setAppPref_5pkmrg$(tmp$_1, null, this.local$this$ErrorReportPresenter_0.context);
              tmp$_6 = tmp$_5;
            } else 
              tmp$_6 = null;
            tmp$_4 = tmp$_6;
          } else 
            tmp$_4 = null;
          this.local$$receiver.stackTrace = tmp$_4;
          this.local$$receiver.presenterUri = this.local$this$ErrorReportPresenter_0.arguments.get_11rb$(ErrorReportView$Companion_getInstance().ARG_PRESENTER_URI);
          this.local$$receiver.timestamp = systemTimeInMillis();
          this.local$$receiver.appVersion = this.local$this$ErrorReportPresenter_0.systemImpl_0.getVersion_za3rmp$(this.local$this$ErrorReportPresenter_0.context);
          this.local$$receiver.operatingSys = getOs();
          this.local$$receiver.osVersion = getOsVersion();
          this.state_0 = 3;
          this.result_0 = this.local$this$ErrorReportPresenter_0.repo_0.errorReportDao.insertAsync_vn2wbu$(this.local$$receiver, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 2;
          this.result_0 = this.local$this$ErrorReportPresenter.db_0.errorReportDao.findByUidAsync_s8cxhz$(this.local$closure$savedErrUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.local$tmp$ = this.result_0;
        this.state_0 = 4;
        continue;
      case 3:
        this.local$$receiver.errUid = this.result_0;
                (tmp$_3 = (tmp$_2 = this.local$this$ErrorReportPresenter_0.navController_0.currentBackStackEntry) != null ? tmp$_2.savedStateHandle : null) != null ? (tmp$_3.set_umlfku$(ErrorReportPresenter$Companion_getInstance().KEY_ERROR_SAVED, this.local$$receiver.errUid.toString()) , Unit) : null;
        this.local$tmp$ = this.local$$receiver;
        this.state_0 = 4;
        continue;
      case 4:
        var errorReport = this.local$tmp$;
        return this.local$this$ErrorReportPresenter.view.errorReport = errorReport , Unit;
      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 ErrorReportPresenter$onCreate$lambda(closure$savedErrUid_0, this$ErrorReportPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ErrorReportPresenter$onCreate$lambda(closure$savedErrUid_0, this$ErrorReportPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ErrorReportPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4;
  UstadBaseController.prototype.onCreate.call(this, savedState);
  var savedErrUid = (tmp$_4 = (tmp$_3 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_3 : (tmp$_2 = (tmp$_1 = (tmp$_0 = this.navController_0.currentBackStackEntry) != null ? tmp$_0.savedStateHandle : null) != null ? tmp$_1.get_ytbaoo$(ErrorReportPresenter$Companion_getInstance().KEY_ERROR_SAVED) : null) != null ? toLong(tmp$_2) : null) != null ? tmp$_4 : L0;
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ErrorReportPresenter$onCreate$lambda(savedErrUid, this));
};
  ErrorReportPresenter.prototype.handleClickTakeMeHome = function() {
  var tmp$;
  this.systemImpl_0.go_henhri$(this.systemImpl_0.getAppConfigDefaultFirstDest_za3rmp$(this.context), emptyMap(), this.context, new UstadMobileSystemCommon$UstadGoOptions((tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_POPUPTO_ON_FINISH)) != null ? tmp$ : UstadView$Companion_getInstance().ROOT_DEST, false));
};
  function ErrorReportPresenter$Companion() {
    ErrorReportPresenter$Companion_instance = this;
    this.KEY_ERROR_SAVED = 'errSaved';
  }
  ErrorReportPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ErrorReportPresenter$Companion_instance = null;
  function ErrorReportPresenter$Companion_getInstance() {
    if (ErrorReportPresenter$Companion_instance === null) {
      new ErrorReportPresenter$Companion();
    }
    return ErrorReportPresenter$Companion_instance;
  }
  ErrorReportPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ErrorReportPresenter', 
  interfaces: [UstadBaseController]};
  function FileSubmissionListItemListener() {
  }
  FileSubmissionListItemListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'FileSubmissionListItemListener', 
  interfaces: []};
  function Runnable$ObjectLiteral_0(closure$block) {
    this.closure$block = closure$block;
  }
  Runnable$ObjectLiteral_0.prototype.run = function() {
  this.closure$block();
};
  Runnable$ObjectLiteral_0.$metadata$ = {
  kind: Kind_CLASS, 
  interfaces: [Runnable]};
  function HarContentPresenterCommon(context, arguments_0, view, localHttp, di) {
    UstadBaseController.call(this, context, arguments_0, view, di);
    this.localHttp = localHttp;
    this.clazzUid_klceuc$_0 = L0;
    this.harContainer_c4zuhg$_0 = this.harContainer_c4zuhg$_0;
    this.containerUid = L0;
    this.containerDeferred = CompletableDeferred();
    var tmp$;
    this.accountManager_s4i5ac$_3pb97q$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, HarContentPresenterCommon$accountManager_metadata);
    var context_0 = this.accountManager_s4i5ac$_0.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_0;
    var tmp$_1;
    this.dbRepo_bsdqs$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_0 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_1 : throwCCE(), 2).provideDelegate_tpuvb9$(this, HarContentPresenterCommon$dbRepo_metadata);
    var context_1 = this.accountManager_s4i5ac$_0.activeAccount;
    var trigger_0;
    trigger_0 = this.diTrigger;
    var tmp$_2;
    var tmp$_3;
    this.db_vcn4ua$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_2 : throwCCE(), context_1), trigger_0), Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_3 : throwCCE(), 1).provideDelegate_tpuvb9$(this, HarContentPresenterCommon$db_metadata);
    var context_2 = this.accountManager_s4i5ac$_0.activeAccount;
    var trigger_1;
    trigger_1 = di.diTrigger;
    var tmp$_4;
    var tmp$_5;
    this.contentEntryOpener_39x9v0$_q61vs$_0 = Instance(On(di, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_4 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_4 : throwCCE(), context_2), trigger_1), Kotlin.isType(tmp$_5 = typeToken(createKType(getKClass(ContentEntryOpener), [], false)), TypeToken) ? tmp$_5 : throwCCE(), null).provideDelegate_tpuvb9$(this, HarContentPresenterCommon$contentEntryOpener_metadata);
    var tmp$_6;
    this.systemImpl_8r9bvx$_u9fhf1$_0 = Instance(di, Kotlin.isType(tmp$_6 = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$_6 : throwCCE(), null).provideDelegate_tpuvb9$(this, HarContentPresenterCommon$systemImpl_metadata);
  }
  Object.defineProperty(HarContentPresenterCommon.prototype, 'harContainer', {
  configurable: true, 
  get: function() {
  if (this.harContainer_c4zuhg$_0 == null) 
    return throwUPAE('harContainer');
  return this.harContainer_c4zuhg$_0;
}, 
  set: function(harContainer) {
  this.harContainer_c4zuhg$_0 = harContainer;
}});
  var HarContentPresenterCommon$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(HarContentPresenterCommon.prototype, 'accountManager_s4i5ac$_0', {
  configurable: true, 
  get: function() {
  return this.accountManager_s4i5ac$_3pb97q$_0.value;
}});
  var HarContentPresenterCommon$dbRepo_metadata = new PropertyMetadata('dbRepo');
  Object.defineProperty(HarContentPresenterCommon.prototype, 'dbRepo', {
  configurable: true, 
  get: function() {
  return this.dbRepo_bsdqs$_0.value;
}});
  var HarContentPresenterCommon$db_metadata = new PropertyMetadata('db');
  Object.defineProperty(HarContentPresenterCommon.prototype, 'db', {
  configurable: true, 
  get: function() {
  return this.db_vcn4ua$_0.value;
}});
  var HarContentPresenterCommon$contentEntryOpener_metadata = new PropertyMetadata('contentEntryOpener');
  Object.defineProperty(HarContentPresenterCommon.prototype, 'contentEntryOpener_39x9v0$_0', {
  configurable: true, 
  get: function() {
  return this.contentEntryOpener_39x9v0$_q61vs$_0.value;
}});
  var HarContentPresenterCommon$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(HarContentPresenterCommon.prototype, 'systemImpl_8r9bvx$_0', {
  configurable: true, 
  get: function() {
  return this.systemImpl_8r9bvx$_u9fhf1$_0.value;
}});
  function HarContentPresenterCommon$onCreate$lambda$lambda(closure$result, this$HarContentPresenterCommon) {
    return function() {
  this$HarContentPresenterCommon.view.entry = closure$result;
  return Unit;
};
  }
  function HarContentPresenterCommon$onCreate$lambda$lambda_0(this$HarContentPresenterCommon) {
    return function(it) {
  this$HarContentPresenterCommon.handleUrlLinkToContentEntry(it);
  return Unit;
};
  }
  function HarContentPresenterCommon$onCreate$lambda$lambda_1(this$HarContentPresenterCommon) {
    return function() {
  this$HarContentPresenterCommon.view.showSnackBar_9pu0dj$(this$HarContentPresenterCommon.systemImpl_8r9bvx$_0.getString(2027, this$HarContentPresenterCommon.context));
  return Unit;
};
  }
  function Coroutine$HarContentPresenterCommon$onCreate$lambda(this$HarContentPresenterCommon_0, closure$entryUuid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 6;
    this.local$this$HarContentPresenterCommon = this$HarContentPresenterCommon_0;
    this.local$closure$entryUuid = closure$entryUuid_0;
  }
  Coroutine$HarContentPresenterCommon$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$HarContentPresenterCommon$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$HarContentPresenterCommon$onCreate$lambda.prototype.constructor = Coroutine$HarContentPresenterCommon$onCreate$lambda;
  Coroutine$HarContentPresenterCommon$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.exceptionState_0 = 3;
        this.state_0 = 1;
        this.result_0 = this.local$this$HarContentPresenterCommon.dbRepo.contentEntryDao.getContentByUuidAsync(this.local$closure$entryUuid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        var result = (tmp$ = this.result_0) != null ? tmp$ : new ContentEntry();
        this.local$this$HarContentPresenterCommon.view.runOnUiThread_9ywmpy$(new Runnable$ObjectLiteral_0(HarContentPresenterCommon$onCreate$lambda$lambda(result, this.local$this$HarContentPresenterCommon)));
        var tmp$_0;
        this.local$this$HarContentPresenterCommon.harContainer = new HarContainer(this.local$this$HarContentPresenterCommon.containerUid, result, this.local$this$HarContentPresenterCommon.accountManager_s4i5ac$_0.activeAccount, this.local$this$HarContentPresenterCommon.db, this.local$this$HarContentPresenterCommon.context, this.local$this$HarContentPresenterCommon.localHttp, get_direct(this.local$this$HarContentPresenterCommon.di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(HttpClient), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null), HarContentPresenterCommon$onCreate$lambda$lambda_0(this.local$this$HarContentPresenterCommon));
        this.state_0 = 2;
        this.result_0 = this.local$this$HarContentPresenterCommon.harContainer.startingUrlDeferred.await(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 2:
        this.local$this$HarContentPresenterCommon.containerDeferred.complete_11rb$(this.local$this$HarContentPresenterCommon.harContainer);
        return this.local$this$HarContentPresenterCommon.view.loadUrl(this.local$this$HarContentPresenterCommon.harContainer.startingUrl) , Unit;
      case 3:
        this.exceptionState_0 = 6;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          return this.local$this$HarContentPresenterCommon.view.runOnUiThread_9ywmpy$(new Runnable$ObjectLiteral_0(HarContentPresenterCommon$onCreate$lambda$lambda_1(this.local$this$HarContentPresenterCommon))) , Unit;
        } else {
          throw e;
        }
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        return;
      case 6:
        throw this.exception_0;
      default:
        this.state_0 = 6;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 6) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function HarContentPresenterCommon$onCreate$lambda(this$HarContentPresenterCommon_0, closure$entryUuid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$HarContentPresenterCommon$onCreate$lambda(this$HarContentPresenterCommon_0, closure$entryUuid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  HarContentPresenterCommon.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0;
  UstadBaseController.prototype.onCreate.call(this, savedState);
  var entryUuid = toLong(getValue(this.arguments, UstadView$Companion_getInstance().ARG_CONTENT_ENTRY_UID));
  this.containerUid = toLong(getValue(this.arguments, UstadView$Companion_getInstance().ARG_CONTAINER_UID));
  this.clazzUid_klceuc$_0 = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  launch(coroutines.GlobalScope, void 0, void 0, HarContentPresenterCommon$onCreate$lambda(this, entryUuid));
};
  function Coroutine$HarContentPresenterCommon$handleUrlLinkToContentEntry$lambda(this$HarContentPresenterCommon_0, closure$params_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 7;
    this.local$this$HarContentPresenterCommon = this$HarContentPresenterCommon_0;
    this.local$closure$params = closure$params_0;
  }
  Coroutine$HarContentPresenterCommon$handleUrlLinkToContentEntry$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$HarContentPresenterCommon$handleUrlLinkToContentEntry$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$HarContentPresenterCommon$handleUrlLinkToContentEntry$lambda.prototype.constructor = Coroutine$HarContentPresenterCommon$handleUrlLinkToContentEntry$lambda;
  Coroutine$HarContentPresenterCommon$handleUrlLinkToContentEntry$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
        this.exceptionState_0 = 3;
        this.state_0 = 1;
        this.result_0 = this.local$this$HarContentPresenterCommon.dbRepo.contentEntryDao.findBySourceUrlWithContentEntryStatusAsync(getValue(this.local$closure$params, 'sourceUrl'), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        tmp$ = this.result_0;
        if (tmp$ == null) {
          throw IllegalArgumentException_init('No File found');
        }
        var entry = tmp$;
        this.state_0 = 2;
        this.result_0 = this.local$this$HarContentPresenterCommon.contentEntryOpener_39x9v0$_0.openEntry_6luryd$(this.local$this$HarContentPresenterCommon.context, entry.contentEntryUid, true, true, (tmp$_1 = (tmp$_0 = this.local$this$HarContentPresenterCommon.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_NO_IFRAMES)) != null ? toBoolean(tmp$_0) : null) != null ? tmp$_1 : false, void 0, this.local$this$HarContentPresenterCommon.clazzUid_klceuc$_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 2:
        return this.result_0;
      case 3:
        this.exceptionState_0 = 7;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          if (Kotlin.isType(e, NoAppFoundException)) {
            return this.local$this$HarContentPresenterCommon.view.showErrorWithAction(this.local$this$HarContentPresenterCommon.systemImpl_8r9bvx$_0.getString(2166, this.local$this$HarContentPresenterCommon.context), 2165, (tmp$_2 = e.mimeType) != null ? tmp$_2 : '') , Unit;
          } else {
            return this.local$this$HarContentPresenterCommon.view.showSnackBar_9pu0dj$((tmp$_3 = e.message) != null ? tmp$_3 : '') , Unit;
          }
        } else {
          throw e;
        }
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        this.state_0 = 6;
        continue;
      case 6:
        return;
      case 7:
        throw this.exception_0;
      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);
};
  function HarContentPresenterCommon$handleUrlLinkToContentEntry$lambda(this$HarContentPresenterCommon_0, closure$params_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$HarContentPresenterCommon$handleUrlLinkToContentEntry$lambda(this$HarContentPresenterCommon_0, closure$params_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  HarContentPresenterCommon.prototype.handleUrlLinkToContentEntry = function(sourceUrl) {
  var dest = replace(sourceUrl, 'content-detail?', ContentEntryDetailView$Companion_getInstance().VIEW_NAME + '?');
  var params = UMFileUtil_getInstance().parseURLQueryString(dest);
  if (params.containsKey_11rb$('sourceUrl')) {
    launch(coroutines.GlobalScope, void 0, void 0, HarContentPresenterCommon$handleUrlLinkToContentEntry$lambda(this, params));
  }
};
  HarContentPresenterCommon.prototype.handleUpNavigation = function() {
};
  HarContentPresenterCommon.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'HarContentPresenterCommon', 
  interfaces: [UstadBaseController]};
  function HolidayCalendarEditPresenter(context, arguments_0, view, lifecycleOwner, di) {
    HolidayCalendarEditPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.holidayOneToManyJoinEditHelper_0 = new OneToManyJoinEditHelperMp(getPropertyCallableRef('holUid', 1, function($receiver) {
  return $receiver.holUid;
}, function($receiver, value) {
  $receiver.holUid = value;
}), HolidayCalendarEditPresenter$Companion_getInstance().ARG_SAVED_STATE_HOLIDAY, ListSerializer(Holiday.Companion.serializer()), ListSerializer(Holiday.Companion.serializer()), this, this.requireSavedStateHandle(), getKClass(Holiday), void 0, HolidayCalendarEditPresenter$holidayOneToManyJoinEditHelper$lambda);
    this.holidayToManyJoinListener = this.holidayOneToManyJoinEditHelper_0.createNavigateForResultListener_g113xi$(HolidayEditView$Companion_getInstance().VIEW_NAME, Holiday.Companion.serializer());
  }
  Object.defineProperty(HolidayCalendarEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  HolidayCalendarEditPresenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
  this.view.holidayList = this.holidayOneToManyJoinEditHelper_0.liveList;
};
  function Coroutine$HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda;
  Coroutine$HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$closure$db.holidayCalendarDao.findByUidAsync_s8cxhz$(this.local$closure$entityUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda_0(closure$db_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda_0.prototype.constructor = Coroutine$HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda_0;
  Coroutine$HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$closure$db.holidayDao.findByHolidayCalendaUidAsync_s8cxhz$(this.local$closure$entityUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda_0(closure$db_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda_0(closure$db_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_13($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$entityUid = void 0;
    this.local$holidayCalendar = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_13.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_13.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_13.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_13;
  Coroutine$onLoadEntityFromDb_7hogkd$_13.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2;
        this.local$entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = withTimeoutOrNull(L2000, HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda(this.local$db, this.local$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$holidayCalendar = (tmp$_1 = this.result_0) != null ? tmp$_1 : new HolidayCalendar();
        this.state_0 = 3;
        this.result_0 = withTimeoutOrNull(L2000, HolidayCalendarEditPresenter$onLoadEntityFromDb$lambda_0(this.local$db, this.local$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var holidayList = (tmp$_2 = this.result_0) != null ? tmp$_2 : emptyList();
        this.$this.holidayOneToManyJoinEditHelper_0.liveList.sendValue_11rb$(holidayList);
        return this.local$holidayCalendar;
      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);
};
  HolidayCalendarEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_13(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  HolidayCalendarEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  var editEntity = null;
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = HolidayCalendar.Companion.serializer();
    var tmp$_0;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    tmp$ = new HolidayCalendar();
  }
  editEntity = tmp$;
  return editEntity;
};
  HolidayCalendarEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  function HolidayCalendarEditPresenter$handleClickSave$lambda$lambda(closure$entity) {
    return function(it) {
  it.holHolidayCalendarUid = closure$entity.umCalendarUid;
  return Unit;
};
  }
  function Coroutine$HolidayCalendarEditPresenter$handleClickSave$lambda(closure$entity_0, this$HolidayCalendarEditPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$HolidayCalendarEditPresenter = this$HolidayCalendarEditPresenter_0;
    this.local$tmp$ = void 0;
  }
  Coroutine$HolidayCalendarEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$HolidayCalendarEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$HolidayCalendarEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$HolidayCalendarEditPresenter$handleClickSave$lambda;
  Coroutine$HolidayCalendarEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (equals(this.local$closure$entity.umCalendarUid, L0)) {
          this.local$tmp$ = this.local$closure$entity;
          this.state_0 = 3;
          this.result_0 = this.local$this$HolidayCalendarEditPresenter.repo.holidayCalendarDao.insertAsync(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 2;
          this.result_0 = this.local$this$HolidayCalendarEditPresenter.repo.holidayCalendarDao.updateAsync_wzqrsg$(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 4;
        continue;
      case 3:
        this.local$tmp$.umCalendarUid = this.result_0;
        this.state_0 = 4;
        continue;
      case 4:
        this.state_0 = 5;
        this.result_0 = this.local$this$HolidayCalendarEditPresenter.holidayOneToManyJoinEditHelper_0.commitToDatabase_kc7sxt$(this.local$this$HolidayCalendarEditPresenter.repo.holidayDao, HolidayCalendarEditPresenter$handleClickSave$lambda$lambda(this.local$closure$entity), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        var tmp$ = this.local$this$HolidayCalendarEditPresenter;
        var di = this.local$this$HolidayCalendarEditPresenter.di;
        var strategy = ListSerializer(HolidayCalendar.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_0;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
        return tmp$.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity)) , Unit;
      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 HolidayCalendarEditPresenter$handleClickSave$lambda(closure$entity_0, this$HolidayCalendarEditPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$HolidayCalendarEditPresenter$handleClickSave$lambda(closure$entity_0, this$HolidayCalendarEditPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  HolidayCalendarEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, HolidayCalendarEditPresenter$handleClickSave$lambda(entity, this));
};
  function HolidayCalendarEditPresenter$Companion() {
    HolidayCalendarEditPresenter$Companion_instance = this;
    this.ARG_SAVED_STATE_HOLIDAY = 'Holiday';
  }
  HolidayCalendarEditPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HolidayCalendarEditPresenter$Companion_instance = null;
  function HolidayCalendarEditPresenter$Companion_getInstance() {
    if (HolidayCalendarEditPresenter$Companion_instance === null) {
      new HolidayCalendarEditPresenter$Companion();
    }
    return HolidayCalendarEditPresenter$Companion_instance;
  }
  function HolidayCalendarEditPresenter$holidayOneToManyJoinEditHelper$lambda($receiver, it) {
    $receiver.holUid = it;
    return Unit;
  }
  HolidayCalendarEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'HolidayCalendarEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function HolidayCalendarListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    HolidayCalendarListPresenter$Companion_getInstance();
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  HolidayCalendarListPresenter.prototype.onCreate = function(savedState) {
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.updateListOnView_0();
  this.view.selectionOptions = listOf([SelectionOption$EDIT_getInstance(), SelectionOption$DELETE_getInstance()]);
};
  HolidayCalendarListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  return true;
};
  HolidayCalendarListPresenter.prototype.updateListOnView_0 = function() {
  this.view.list = this.repo.holidayCalendarDao.findAllHolidaysWithEntriesCount();
};
  HolidayCalendarListPresenter.prototype.handleClickEntry_11rc$ = function(entry) {
  switch (this.mListMode.name) {
    case 'PICKER':
      var di = this.di;
      var strategy = ListSerializer(HolidayCalendar.Companion.serializer());
      var entity = listOf_0(entry);
      var tmp$;
      var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
      this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
      break;
    case 'BROWSER':
      this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, HolidayCalendarEditView$Companion_getInstance().VIEW_NAME, getKClass(HolidayCalendar), HolidayCalendar.Companion.serializer(), HolidayCalendarListPresenter$Companion_getInstance().RESULT_DEST_KEY, void 0, mutableMapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, entry.umCalendarUid.toString())])));
      break;
  }
};
  HolidayCalendarListPresenter.prototype.handleClickCreateNewFab = function() {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, HolidayCalendarEditView$Companion_getInstance().VIEW_NAME, getKClass(HolidayCalendar), HolidayCalendar.Companion.serializer(), HolidayCalendarListPresenter$Companion_getInstance().RESULT_DEST_KEY));
};
  HolidayCalendarListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
  this.handleClickCreateNewFab();
};
  HolidayCalendarListPresenter.prototype.handleClickSortOrder_iowaj7$ = function(sortOption) {
};
  function HolidayCalendarListPresenter$Companion() {
    HolidayCalendarListPresenter$Companion_instance = this;
    this.RESULT_DEST_KEY = 'SchoolHolidayCalendar';
  }
  HolidayCalendarListPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HolidayCalendarListPresenter$Companion_instance = null;
  function HolidayCalendarListPresenter$Companion_getInstance() {
    if (HolidayCalendarListPresenter$Companion_instance === null) {
      new HolidayCalendarListPresenter$Companion();
    }
    return HolidayCalendarListPresenter$Companion_instance;
  }
  HolidayCalendarListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'HolidayCalendarListPresenter', 
  interfaces: [UstadListPresenter]};
  function HolidayEditPresenter(context, arguments_0, view, di, lifecycleOwner) {
    HolidayEditPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(HolidayEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$JSON_getInstance();
}});
  HolidayEditPresenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
};
  HolidayEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db, continuation) {
  var tmp$, tmp$_0;
  var entityUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  throw IllegalStateException_init('Holiday loads only from JSON, not from database');
};
  HolidayEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  var editEntity = null;
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = Holiday.Companion.serializer();
    var tmp$;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
    editEntity = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    editEntity = new Holiday();
  }
  return editEntity;
};
  HolidayEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  HolidayEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  var di = this.di;
  var strategy = ListSerializer(Holiday.Companion.serializer());
  var entity_0 = listOf_0(entity);
  var tmp$;
  var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
  this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity_0));
};
  function HolidayEditPresenter$Companion() {
    HolidayEditPresenter$Companion_instance = this;
  }
  HolidayEditPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HolidayEditPresenter$Companion_instance = null;
  function HolidayEditPresenter$Companion_getInstance() {
    if (HolidayEditPresenter$Companion_instance === null) {
      new HolidayEditPresenter$Companion();
    }
    return HolidayEditPresenter$Companion_instance;
  }
  HolidayEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'HolidayEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function HtmlTextViewDetailPresenter(context, arguments_0, view, lifecycleOwner, di) {
    HtmlTextViewDetailPresenter$Companion_getInstance();
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(HtmlTextViewDetailPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$JSON_getInstance();
}});
  HtmlTextViewDetailPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  return false;
};
  HtmlTextViewDetailPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  UstadDetailPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var description = bundle.get_11rb$(HtmlTextViewDetailView$Companion_getInstance().DISPLAY_TEXT);
  var title = bundle.get_11rb$(HtmlTextViewDetailView$Companion_getInstance().DISPLAY_TITLE);
  this.view.title = title;
  return description;
};
  function HtmlTextViewDetailPresenter$Companion() {
    HtmlTextViewDetailPresenter$Companion_instance = this;
  }
  HtmlTextViewDetailPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HtmlTextViewDetailPresenter$Companion_instance = null;
  function HtmlTextViewDetailPresenter$Companion_getInstance() {
    if (HtmlTextViewDetailPresenter$Companion_instance === null) {
      new HtmlTextViewDetailPresenter$Companion();
    }
    return HtmlTextViewDetailPresenter$Companion_instance;
  }
  HtmlTextViewDetailPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'HtmlTextViewDetailPresenter', 
  interfaces: [UstadDetailPresenter]};
  function InviteViaLinkPresenter(context, args, view, di) {
    UstadBaseController.call(this, context, args, view, di);
    var tmp$;
    this.accountManager_83l4p4$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, InviteViaLinkPresenter$accountManager_metadata);
    var context_0 = this.accountManager.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_0;
    var tmp$_1;
    this.dbRepo_91axm0$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_0 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_1 : throwCCE(), 2).provideDelegate_tpuvb9$(this, InviteViaLinkPresenter$dbRepo_metadata);
    var tmp$_2;
    this.systemImpl_wove53$_0 = Instance(this, Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$_2 : throwCCE(), null).provideDelegate_tpuvb9$(this, InviteViaLinkPresenter$systemImpl_metadata);
  }
  var InviteViaLinkPresenter$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(InviteViaLinkPresenter.prototype, 'accountManager', {
  configurable: true, 
  get: function() {
  return this.accountManager_83l4p4$_0.value;
}});
  var InviteViaLinkPresenter$dbRepo_metadata = new PropertyMetadata('dbRepo');
  Object.defineProperty(InviteViaLinkPresenter.prototype, 'dbRepo', {
  configurable: true, 
  get: function() {
  return this.dbRepo_91axm0$_0.value;
}});
  var InviteViaLinkPresenter$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(InviteViaLinkPresenter.prototype, 'systemImpl', {
  configurable: true, 
  get: function() {
  return this.systemImpl_wove53$_0.value;
}});
  InviteViaLinkPresenter.prototype.onCreate = function(savedState) {
  var tmp$;
  UstadBaseController.prototype.onCreate.call(this, savedState);
  var code = toString(this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CODE));
  var linkArgs = mapOf([to(UstadView$Companion_getInstance().ARG_CODE, code), to(UstadView$Companion_getInstance().ARG_CODE_TABLE, (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CODE_TABLE)) != null ? tmp$ : '')]);
  this.view.inviteLink = toDeepLink_0(linkArgs, this.accountManager.activeAccount.endpointUrl, JoinWithCodeView$Companion_getInstance().VIEW_NAME);
  this.view.inviteCode = code;
  this.view.entityName = toString(this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_NAME));
};
  InviteViaLinkPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'InviteViaLinkPresenter', 
  interfaces: [UstadBaseController]};
  function JoinWithCodePresenter(context, args, view, di) {
    JoinWithCodePresenter$Companion_getInstance();
    UstadBaseController.call(this, context, args, view, di);
    var tmp$;
    this.accountManager_v9h6j8$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, JoinWithCodePresenter$accountManager_metadata);
    var context_0 = this.accountManager.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_0;
    var tmp$_1;
    this.dbRepo_6hj1ms$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_0 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_1 : throwCCE(), 2).provideDelegate_tpuvb9$(this, JoinWithCodePresenter$dbRepo_metadata);
    var tmp$_2;
    this.systemImpl_sv701x$_0 = Instance(this, Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$_2 : throwCCE(), null).provideDelegate_tpuvb9$(this, JoinWithCodePresenter$systemImpl_metadata);
    this.entityTableId_0 = 0;
  }
  var JoinWithCodePresenter$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(JoinWithCodePresenter.prototype, 'accountManager', {
  configurable: true, 
  get: function() {
  return this.accountManager_v9h6j8$_0.value;
}});
  var JoinWithCodePresenter$dbRepo_metadata = new PropertyMetadata('dbRepo');
  Object.defineProperty(JoinWithCodePresenter.prototype, 'dbRepo', {
  configurable: true, 
  get: function() {
  return this.dbRepo_6hj1ms$_0.value;
}});
  var JoinWithCodePresenter$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(JoinWithCodePresenter.prototype, 'systemImpl', {
  configurable: true, 
  get: function() {
  return this.systemImpl_sv701x$_0.value;
}});
  JoinWithCodePresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  UstadBaseController.prototype.onCreate.call(this, savedState);
  var tableId = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CODE_TABLE)) != null ? toIntOrNull(tmp$) : null;
  var codeArg = (tmp$_0 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CODE)) != null ? tmp$_0 : '';
  this.view.code = codeArg;
  tmp$_2 = this.view;
  if (tableId === 6) {
    tmp$_1 = this.systemImpl.getString(2711, this.context);
  } else {
    tmp$_1 = this.systemImpl.getString(2712, this.context);
  }
  tmp$_2.buttonLabel = tmp$_1;
  this.entityTableId_0 = tableId != null ? tableId : 0;
};
  JoinWithCodePresenter.prototype.onStart = function() {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5;
  UstadBaseController.prototype.onStart.call(this);
  var codeFromArgsUsed = (tmp$_2 = (tmp$_1 = (tmp$_0 = (tmp$ = this.requireNavController().currentBackStackEntry) != null ? tmp$.savedStateHandle : null) != null ? tmp$_0.get_ytbaoo$(JoinWithCodePresenter$Companion_getInstance().CODE_FROM_ARGS_USED) : null) != null ? toBoolean(tmp$_1) : null) != null ? tmp$_2 : false;
  if (!codeFromArgsUsed) {
    var codeArg = (tmp$_3 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CODE)) != null ? tmp$_3 : '';
    if (codeArg.length > 0) {
            (tmp$_5 = (tmp$_4 = this.requireNavController().currentBackStackEntry) != null ? tmp$_4.savedStateHandle : null) != null ? (tmp$_5.set_umlfku$(JoinWithCodePresenter$Companion_getInstance().CODE_FROM_ARGS_USED, true.toString()) , Unit) : null;
      this.handleClickDone_61zpoe$(codeArg);
    } else {
      this.view.loading = false;
    }
  }
};
  function JoinWithCodePresenter$handleClickDone$lambda$lambda(closure$code) {
    return function() {
  var $receiver = closure$code;
  var tmp$;
  return 'attempting to join class with code ' + trim(Kotlin.isCharSequence(tmp$ = $receiver) ? tmp$ : throwCCE()).toString();
};
  }
  function JoinWithCodePresenter$handleClickDone$lambda$lambda_0(closure$clazzToJoin) {
    return function() {
  var tmp$;
  return 'JoinWithCode: attempting to join course ' + toString((tmp$ = closure$clazzToJoin.v) != null ? tmp$.clazzName : null);
};
  }
  function JoinWithCodePresenter$handleClickDone$lambda$lambda_1() {
    return 'JoinWithCode: enroling into course ';
  }
  function Coroutine$JoinWithCodePresenter$handleClickDone$lambda(this$JoinWithCodePresenter_0, closure$code_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 31;
    this.local$this$JoinWithCodePresenter = this$JoinWithCodePresenter_0;
    this.local$closure$code = closure$code_0;
    this.local$clazzToJoin = void 0;
    this.local$schoolToJoin = void 0;
  }
  Coroutine$JoinWithCodePresenter$handleClickDone$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$JoinWithCodePresenter$handleClickDone$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$JoinWithCodePresenter$handleClickDone$lambda.prototype.constructor = Coroutine$JoinWithCodePresenter$handleClickDone$lambda;
  Coroutine$JoinWithCodePresenter$handleClickDone$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6;
        if (this.local$this$JoinWithCodePresenter.entityTableId_0 === 6) {
          napier.Napier.d_9h2hdn$(void 0, void 0, JoinWithCodePresenter$handleClickDone$lambda$lambda(this.local$closure$code));
          var tmp$_7 = this.local$this$JoinWithCodePresenter.dbRepo.clazzDao;
          var $receiver = this.local$closure$code;
          var tmp$_8;
          this.state_0 = 16;
          this.result_0 = tmp$_7.findByClazzCode_61zpoe$(trim(Kotlin.isCharSequence(tmp$_8 = $receiver) ? tmp$_8 : throwCCE()).toString(), this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          if (this.local$this$JoinWithCodePresenter.entityTableId_0 === 164) {
            var tmp$_9 = this.local$this$JoinWithCodePresenter.dbRepo.schoolDao;
            var $receiver_0 = this.local$closure$code;
            var tmp$_10;
            this.state_0 = 1;
            this.result_0 = tmp$_9.findBySchoolCode_61zpoe$(trim(Kotlin.isCharSequence(tmp$_10 = $receiver_0) ? tmp$_10 : throwCCE()).toString(), this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.local$this$JoinWithCodePresenter.view.loading = false;
            return this.local$this$JoinWithCodePresenter.view.errorText = this.local$this$JoinWithCodePresenter.systemImpl.getString(2186, this.local$this$JoinWithCodePresenter.context) , Unit;
          }
        }
      case 1:
        this.local$schoolToJoin = {
  v: this.result_0};
        if (this.local$schoolToJoin.v == null) {
          this.exceptionState_0 = 5;
          var tmp$_11 = this.local$this$JoinWithCodePresenter.dbRepo.schoolDao;
          var $receiver_1 = this.local$closure$code;
          var tmp$_12;
          this.state_0 = 2;
          this.result_0 = tmp$_11.findBySchoolCodeFromWeb_61zpoe$(trim(Kotlin.isCharSequence(tmp$_12 = $receiver_1) ? tmp$_12 : throwCCE()).toString(), this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 7;
          continue;
        }
      case 2:
        this.local$schoolToJoin.v = this.result_0;
        if (this.local$schoolToJoin.v != null) {
          this.state_0 = 3;
          this.result_0 = this.local$this$JoinWithCodePresenter.dbRepo.schoolDao.insertAsync(this.local$schoolToJoin.v, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 4;
          continue;
        }
      case 3:
        this.state_0 = 4;
        continue;
      case 4:
        this.exceptionState_0 = 31;
        this.state_0 = 6;
        continue;
      case 5:
        this.exceptionState_0 = 31;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          var tmp$_13 = napier.Napier;
          var $receiver_2 = this.local$closure$code;
          var tmp$_14;
          tmp$_13.w_82mfvz$('Could not load school via http for code ' + trim(Kotlin.isCharSequence(tmp$_14 = $receiver_2) ? tmp$_14 : throwCCE()).toString(), e);
        } else 
          throw e;
        this.state_0 = 6;
        continue;
      case 6:
        this.state_0 = 7;
        continue;
      case 7:
        var $receiver_3 = this.local$this$JoinWithCodePresenter.dbRepo;
        if ((tmp$_4 = (tmp$_3 = this.local$schoolToJoin.v != null ? $receiver_3 : null) != null ? tmp$_3.personDao : null) != null) {
          this.state_0 = 8;
          this.result_0 = tmp$_4.findByUidAsync_s8cxhz$(this.local$this$JoinWithCodePresenter.accountManager.activeAccount.personUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 9;
          continue;
        }
      case 8:
        this.state_0 = 9;
        continue;
      case 9:
        var personToEnrol = this.result_0;
        this.exceptionState_0 = 12;
        if (this.local$schoolToJoin.v != null && personToEnrol != null) {
          this.state_0 = 10;
          this.result_0 = enrolPersonIntoSchoolAtLocalTimezone(this.local$this$JoinWithCodePresenter.dbRepo, personToEnrol, this.local$schoolToJoin.v.schoolUid, 1005, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.local$this$JoinWithCodePresenter.view.loading = false;
          return this.local$this$JoinWithCodePresenter.view.errorText = this.local$this$JoinWithCodePresenter.systemImpl.getString(2186, this.local$this$JoinWithCodePresenter.context) , Unit;
        }
      case 10:
        var message = this.local$this$JoinWithCodePresenter.systemImpl.getString(2654, this.local$this$JoinWithCodePresenter.context);
        return this.local$this$JoinWithCodePresenter.systemImpl.go_henhri$(SchoolListView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_SNACK_MESSAGE, message)), this.local$this$JoinWithCodePresenter.context, new UstadMobileSystemCommon$UstadGoOptions(UstadView$Companion_getInstance().CURRENT_DEST, true)) , Unit;
      case 11:
        this.exceptionState_0 = 31;
        this.state_0 = 14;
        continue;
      case 12:
        this.exceptionState_0 = 31;
        var e = this.exception_0;
        if (Kotlin.isType(e, AlreadyEnroledInSchoolException)) {
          this.local$this$JoinWithCodePresenter.view.loading = false;
          return this.local$this$JoinWithCodePresenter.view.errorText = replace(this.local$this$JoinWithCodePresenter.systemImpl.getString(2710, this.local$this$JoinWithCodePresenter.context), '%1$s', (tmp$_6 = (tmp$_5 = this.local$schoolToJoin.v) != null ? tmp$_5.schoolName : null) != null ? tmp$_6 : '') , Unit;
        } else {
          throw e;
        }
      case 13:
        this.state_0 = 14;
        continue;
      case 14:
        this.state_0 = 15;
        continue;
      case 15:
        this.state_0 = 30;
        continue;
      case 16:
        this.local$clazzToJoin = {
  v: this.result_0};
        if (this.local$clazzToJoin.v == null) {
          this.exceptionState_0 = 20;
          var tmp$_15 = this.local$this$JoinWithCodePresenter.dbRepo.clazzDao;
          var $receiver_4 = this.local$closure$code;
          var tmp$_16;
          this.state_0 = 17;
          this.result_0 = tmp$_15.findByClazzCodeFromWeb_61zpoe$(trim(Kotlin.isCharSequence(tmp$_16 = $receiver_4) ? tmp$_16 : throwCCE()).toString(), this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 22;
          continue;
        }
      case 17:
        this.local$clazzToJoin.v = this.result_0;
        if (this.local$clazzToJoin.v != null) {
          this.state_0 = 18;
          this.result_0 = this.local$this$JoinWithCodePresenter.dbRepo.clazzDao.insertAsync(this.local$clazzToJoin.v, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 19;
          continue;
        }
      case 18:
        this.state_0 = 19;
        continue;
      case 19:
        this.exceptionState_0 = 31;
        this.state_0 = 21;
        continue;
      case 20:
        this.exceptionState_0 = 31;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          var tmp$_17 = napier.Napier;
          var $receiver_5 = this.local$closure$code;
          var tmp$_18;
          tmp$_17.e_82mfvz$('Could not retrieve class using class code ' + trim(Kotlin.isCharSequence(tmp$_18 = $receiver_5) ? tmp$_18 : throwCCE()).toString() + ' by http', e);
        } else 
          throw e;
        this.state_0 = 21;
        continue;
      case 21:
        this.state_0 = 22;
        continue;
      case 22:
        napier.Napier.d_9h2hdn$(void 0, void 0, JoinWithCodePresenter$handleClickDone$lambda$lambda_0(this.local$clazzToJoin));
        var $receiver_6 = this.local$this$JoinWithCodePresenter.dbRepo;
        if ((tmp$_0 = (tmp$ = this.local$clazzToJoin.v != null ? $receiver_6 : null) != null ? tmp$.personDao : null) != null) {
          this.state_0 = 23;
          this.result_0 = tmp$_0.findByUidAsync_s8cxhz$(this.local$this$JoinWithCodePresenter.accountManager.activeAccount.personUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 24;
          continue;
        }
      case 23:
        this.state_0 = 24;
        continue;
      case 24:
        var personToEnrol_0 = this.result_0;
        this.exceptionState_0 = 27;
        if (this.local$clazzToJoin.v != null && personToEnrol_0 != null) {
          napier.Napier.d_9h2hdn$(void 0, void 0, JoinWithCodePresenter$handleClickDone$lambda$lambda_1);
          this.state_0 = 25;
          this.result_0 = enrolPersonIntoClazzAtLocalTimezone(this.local$this$JoinWithCodePresenter.dbRepo, personToEnrol_0, this.local$clazzToJoin.v.clazzUid, 1002, void 0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.local$this$JoinWithCodePresenter.view.loading = false;
          return this.local$this$JoinWithCodePresenter.view.errorText = this.local$this$JoinWithCodePresenter.systemImpl.getString(2186, this.local$this$JoinWithCodePresenter.context) , Unit;
        }
      case 25:
        var message_0 = this.local$this$JoinWithCodePresenter.systemImpl.getString(2654, this.local$this$JoinWithCodePresenter.context);
        return this.local$this$JoinWithCodePresenter.systemImpl.go_henhri$(ClazzList2View$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_SNACK_MESSAGE, message_0)), this.local$this$JoinWithCodePresenter.context, new UstadMobileSystemCommon$UstadGoOptions(UstadView$Companion_getInstance().CURRENT_DEST, true)) , Unit;
      case 26:
        this.exceptionState_0 = 31;
        this.state_0 = 29;
        continue;
      case 27:
        this.exceptionState_0 = 31;
        var e = this.exception_0;
        if (Kotlin.isType(e, AlreadyEnroledInClassException)) {
          this.local$this$JoinWithCodePresenter.view.loading = false;
          return this.local$this$JoinWithCodePresenter.view.errorText = replace(this.local$this$JoinWithCodePresenter.systemImpl.getString(2709, this.local$this$JoinWithCodePresenter.context), '%1$s', (tmp$_2 = (tmp$_1 = this.local$clazzToJoin.v) != null ? tmp$_1.clazzName : null) != null ? tmp$_2 : '') , Unit;
        } else {
          throw e;
        }
      case 28:
        this.state_0 = 29;
        continue;
      case 29:
        this.state_0 = 30;
        continue;
      case 30:
        return;
      case 31:
        throw this.exception_0;
      default:
        this.state_0 = 31;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 31) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function JoinWithCodePresenter$handleClickDone$lambda(this$JoinWithCodePresenter_0, closure$code_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$JoinWithCodePresenter$handleClickDone$lambda(this$JoinWithCodePresenter_0, closure$code_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  JoinWithCodePresenter.prototype.handleClickDone_61zpoe$ = function(code) {
  if (code.length === 0) {
    this.view.errorText = this.systemImpl.getString(2127, this.context);
    return;
  }
  this.view.loading = true;
  launch(this.presenterScope, void 0, void 0, JoinWithCodePresenter$handleClickDone$lambda(this, code));
};
  function JoinWithCodePresenter$Companion() {
    JoinWithCodePresenter$Companion_instance = this;
    this.CODE_FROM_ARGS_USED = 'codeEntered';
  }
  JoinWithCodePresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var JoinWithCodePresenter$Companion_instance = null;
  function JoinWithCodePresenter$Companion_getInstance() {
    if (JoinWithCodePresenter$Companion_instance === null) {
      new JoinWithCodePresenter$Companion();
    }
    return JoinWithCodePresenter$Companion_instance;
  }
  JoinWithCodePresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'JoinWithCodePresenter', 
  interfaces: [UstadBaseController]};
  function LanguageEditPresenter(context, arguments_0, view, lifecycleOwner, di) {
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(LanguageEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  function Coroutine$LanguageEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$it = it_0;
  }
  Coroutine$LanguageEditPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$LanguageEditPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$LanguageEditPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$LanguageEditPresenter$onLoadEntityFromDb$lambda;
  Coroutine$LanguageEditPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if ((tmp$_0 = (tmp$ = !equals(this.local$closure$entityUid, L0) ? this.local$it : null) != null ? tmp$.languageDao : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_0.findByUidAsync_s8cxhz$(this.local$closure$entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 LanguageEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$LanguageEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_14($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_14.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_14.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_14.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_14;
  Coroutine$onLoadEntityFromDb_7hogkd$_14.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        var entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, LanguageEditPresenter$onLoadEntityFromDb$lambda(entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        return (tmp$_1 = this.result_0) != null ? tmp$_1 : new Language();
      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);
};
  LanguageEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_14(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  LanguageEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = Language.Companion.serializer();
    var tmp$_0;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    tmp$ = new Language();
  }
  return tmp$;
};
  LanguageEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, Language.Companion.serializer(), entityVal);
};
  function Coroutine$LanguageEditPresenter$handleClickSave$lambda(closure$entity_0, this$LanguageEditPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$LanguageEditPresenter = this$LanguageEditPresenter_0;
    this.local$tmp$ = void 0;
  }
  Coroutine$LanguageEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$LanguageEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$LanguageEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$LanguageEditPresenter$handleClickSave$lambda;
  Coroutine$LanguageEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var $receiver = this.local$closure$entity.name;
        if ($receiver == null || $receiver.length === 0) {
          this.local$this$LanguageEditPresenter.view.langNameError = this.local$this$LanguageEditPresenter.systemImpl.getString(2127, this.local$this$LanguageEditPresenter.context);
          return;
        } else {
          this.state_0 = 2;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        if (equals(this.local$closure$entity.langUid, L0)) {
          this.local$tmp$ = this.local$closure$entity;
          this.state_0 = 4;
          this.result_0 = this.local$this$LanguageEditPresenter.repo.languageDao.insertAsync(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          this.result_0 = this.local$this$LanguageEditPresenter.repo.languageDao.updateAsync_lqiqse$(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 3:
        this.state_0 = 5;
        continue;
      case 4:
        this.local$tmp$.langUid = this.result_0;
        this.state_0 = 5;
        continue;
      case 5:
        var tmp$ = this.local$this$LanguageEditPresenter;
        var di = this.local$this$LanguageEditPresenter.di;
        var strategy = ListSerializer(Language.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_0;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
        return tmp$.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity)) , Unit;
      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 LanguageEditPresenter$handleClickSave$lambda(closure$entity_0, this$LanguageEditPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$LanguageEditPresenter$handleClickSave$lambda(closure$entity_0, this$LanguageEditPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  LanguageEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, LanguageEditPresenter$handleClickSave$lambda(entity, this));
};
  LanguageEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'LanguageEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function LanguageListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    LanguageListPresenter$Companion_getInstance();
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.loggedInPersonUid_0 = L0;
    this.searchText_0 = null;
  }
  Object.defineProperty(LanguageListPresenter.prototype, 'sortOptions', {
  configurable: true, 
  get: function() {
  return LanguageListPresenter$Companion_getInstance().SORT_OPTIONS;
}});
  LanguageListPresenter.prototype.onClickSort_o8nuns$ = function(sortOption) {
  UstadListPresenter.prototype.onClickSort_o8nuns$.call(this, sortOption);
  this.getAndSetList_0();
};
  LanguageListPresenter.prototype.onCreate = function(savedState) {
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.loggedInPersonUid_0 = this.accountManager.activeAccount.personUid;
  this.getAndSetList_0();
};
  LanguageListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  return true;
};
  LanguageListPresenter.prototype.onSearchSubmitted_pdl1vj$ = function(text) {
  this.searchText_0 = text;
  this.getAndSetList_0();
};
  LanguageListPresenter.prototype.getAndSetList_0 = function() {
  var tmp$, tmp$_0;
  this.view.list = this.repo.languageDao.findLanguagesAsSource_19mbxw$((tmp$_0 = (tmp$ = this.selectedSortOption) != null ? tmp$.flag : null) != null ? tmp$_0 : 1, toQueryLikeParam(this.searchText_0));
};
  LanguageListPresenter.prototype.handleClickEntry_11rc$ = function(entry) {
  switch (this.mListMode.name) {
    case 'PICKER':
      var di = this.di;
      var strategy = ListSerializer(Language.Companion.serializer());
      var entity = listOf_0(entry);
      var tmp$;
      var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
      this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
      break;
    case 'BROWSER':
      this.navigateToEditScreen_0(entry);
      break;
  }
};
  LanguageListPresenter.prototype.handleClickCreateNewFab = function() {
  this.navigateToEditScreen_0();
};
  LanguageListPresenter.prototype.navigateToEditScreen_0 = function(language) {
  if (language === void 0) 
    language = null;
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, language, LanguageEditView$Companion_getInstance().VIEW_NAME, getKClass(Language), Language.Companion.serializer(), LanguageListPresenter$Companion_getInstance().SAVEDSTATE_KEY_LANGUAGE));
};
  LanguageListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
  this.handleClickCreateNewFab();
};
  LanguageListPresenter.prototype.onCheckListSelectionOptions_tn71rk$ = function(account, continuation) {
  return listOf_0(SelectionOption$HIDE_getInstance());
};
  function Coroutine$LanguageListPresenter$handleClickSelectionOption$lambda$lambda$lambda(this$LanguageListPresenter_0, closure$selectedItem_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$LanguageListPresenter = this$LanguageListPresenter_0;
    this.local$closure$selectedItem = closure$selectedItem_0;
  }
  Coroutine$LanguageListPresenter$handleClickSelectionOption$lambda$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$LanguageListPresenter$handleClickSelectionOption$lambda$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$LanguageListPresenter$handleClickSelectionOption$lambda$lambda$lambda.prototype.constructor = Coroutine$LanguageListPresenter$handleClickSelectionOption$lambda$lambda$lambda;
  Coroutine$LanguageListPresenter$handleClickSelectionOption$lambda$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$ = this.local$this$LanguageListPresenter.repo.languageDao;
        var $receiver = this.local$closure$selectedItem;
        var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
        var tmp$_0;
        tmp$_0 = $receiver.iterator();
        while (tmp$_0.hasNext()) {
          var item = tmp$_0.next();
          destination.add_11rb$(item.langUid);
        }
        this.state_0 = 2;
        this.result_0 = tmp$.toggleVisibilityLanguage_cbj1f0$(false, destination, getSystemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 LanguageListPresenter$handleClickSelectionOption$lambda$lambda$lambda(this$LanguageListPresenter_0, closure$selectedItem_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$LanguageListPresenter$handleClickSelectionOption$lambda$lambda$lambda(this$LanguageListPresenter_0, closure$selectedItem_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function LanguageListPresenter$handleClickSelectionOption$lambda$lambda(this$LanguageListPresenter, closure$selectedItem) {
    return function() {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, LanguageListPresenter$handleClickSelectionOption$lambda$lambda$lambda(this$LanguageListPresenter, closure$selectedItem));
  return Unit;
};
  }
  function Coroutine$LanguageListPresenter$handleClickSelectionOption$lambda(closure$option_0, this$LanguageListPresenter_0, closure$selectedItem_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$option = closure$option_0;
    this.local$this$LanguageListPresenter = this$LanguageListPresenter_0;
    this.local$closure$selectedItem = closure$selectedItem_0;
  }
  Coroutine$LanguageListPresenter$handleClickSelectionOption$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$LanguageListPresenter$handleClickSelectionOption$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$LanguageListPresenter$handleClickSelectionOption$lambda.prototype.constructor = Coroutine$LanguageListPresenter$handleClickSelectionOption$lambda;
  Coroutine$LanguageListPresenter$handleClickSelectionOption$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (equals(this.local$closure$option, SelectionOption$HIDE_getInstance())) {
          var tmp$ = this.local$this$LanguageListPresenter.repo.languageDao;
          var $receiver = this.local$closure$selectedItem;
          var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
          var tmp$_0;
          tmp$_0 = $receiver.iterator();
          while (tmp$_0.hasNext()) {
            var item = tmp$_0.next();
            destination.add_11rb$(item.langUid);
          }
          this.state_0 = 2;
          this.result_0 = tmp$.toggleVisibilityLanguage_cbj1f0$(true, destination, getSystemTimeInMillis(), this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        return this.local$this$LanguageListPresenter.view.showSnackBar_9pu0dj$(this.local$this$LanguageListPresenter.systemImpl.getString(2185, this.local$this$LanguageListPresenter.context), LanguageListPresenter$handleClickSelectionOption$lambda$lambda(this.local$this$LanguageListPresenter, this.local$closure$selectedItem), 2698) , Unit;
      case 3:
        return Unit;
      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 LanguageListPresenter$handleClickSelectionOption$lambda(closure$option_0, this$LanguageListPresenter_0, closure$selectedItem_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$LanguageListPresenter$handleClickSelectionOption$lambda(closure$option_0, this$LanguageListPresenter_0, closure$selectedItem_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  LanguageListPresenter.prototype.handleClickSelectionOption_psq284$ = function(selectedItem, option) {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, LanguageListPresenter$handleClickSelectionOption$lambda(option, this, selectedItem));
};
  function LanguageListPresenter$Companion() {
    LanguageListPresenter$Companion_instance = this;
    this.SORT_OPTIONS = listOf([new SortOrderOption(2046, 1, true), new SortOrderOption(2046, 2, false), new SortOrderOption(2059, 3, true), new SortOrderOption(2059, 4, false), new SortOrderOption(2060, 5, true), new SortOrderOption(2060, 6, false)]);
    this.SAVEDSTATE_KEY_LANGUAGE = 'Language';
  }
  LanguageListPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var LanguageListPresenter$Companion_instance = null;
  function LanguageListPresenter$Companion_getInstance() {
    if (LanguageListPresenter$Companion_instance === null) {
      new LanguageListPresenter$Companion();
    }
    return LanguageListPresenter$Companion_instance;
  }
  LanguageListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'LanguageListPresenter', 
  interfaces: [UstadListPresenter, OnSearchSubmitted, OnSortOptionSelected]};
  function LearnerGroupMemberConstants() {
    LearnerGroupMemberConstants_instance = this;
    this.ROLE_MESSAGE_ID_OPTIONS = mapOf([to(2, 2404), to(1, 2405)]);
  }
  LearnerGroupMemberConstants.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'LearnerGroupMemberConstants', 
  interfaces: []};
  var LearnerGroupMemberConstants_instance = null;
  function LearnerGroupMemberConstants_getInstance() {
    if (LearnerGroupMemberConstants_instance === null) {
      new LearnerGroupMemberConstants();
    }
    return LearnerGroupMemberConstants_instance;
  }
  function LearnerGroupMemberListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.learnerGroupUid = L0;
    this.contentEntryUid = L0;
    this.clazzUid = L0;
    var context_0 = this.accountManager.activeAccount;
    var trigger;
    trigger = di.diTrigger;
    var tmp$;
    var tmp$_0;
    this.contentEntryOpener_lrvxvf$_0 = Instance(On(di, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$ : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(ContentEntryOpener), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, LearnerGroupMemberListPresenter$contentEntryOpener_metadata);
  }
  var LearnerGroupMemberListPresenter$contentEntryOpener_metadata = new PropertyMetadata('contentEntryOpener');
  Object.defineProperty(LearnerGroupMemberListPresenter.prototype, 'contentEntryOpener_0', {
  configurable: true, 
  get: function() {
  return this.contentEntryOpener_lrvxvf$_0.value;
}});
  LearnerGroupMemberListPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4;
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.learnerGroupUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_LEARNER_GROUP_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  this.contentEntryUid = (tmp$_2 = (tmp$_1 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CONTENT_ENTRY_UID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0;
  this.clazzUid = (tmp$_4 = (tmp$_3 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$_3) : null) != null ? tmp$_4 : L0;
  this.updateList_0();
};
  LearnerGroupMemberListPresenter.prototype.updateList_0 = function() {
  this.view.list = this.repo.learnerGroupMemberDao.findLearnerGroupMembersByGroupIdAndEntry_3pjtqy$(this.learnerGroupUid, this.contentEntryUid);
};
  LearnerGroupMemberListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  return true;
};
  LearnerGroupMemberListPresenter.prototype.handleClickCreateNewFab = function() {
};
  LearnerGroupMemberListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
};
  function Coroutine$LearnerGroupMemberListPresenter$handleNewMemberToGroup$lambda(closure$student_0, this$LearnerGroupMemberListPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$student = closure$student_0;
    this.local$this$LearnerGroupMemberListPresenter = this$LearnerGroupMemberListPresenter_0;
    this.local$$receiver = void 0;
  }
  Coroutine$LearnerGroupMemberListPresenter$handleNewMemberToGroup$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$LearnerGroupMemberListPresenter$handleNewMemberToGroup$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$LearnerGroupMemberListPresenter$handleNewMemberToGroup$lambda.prototype.constructor = Coroutine$LearnerGroupMemberListPresenter$handleNewMemberToGroup$lambda;
  Coroutine$LearnerGroupMemberListPresenter$handleNewMemberToGroup$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$$receiver = new LearnerGroupMember();
        var closure$student = this.local$closure$student;
        var this$LearnerGroupMemberListPresenter = this.local$this$LearnerGroupMemberListPresenter;
        this.local$$receiver.learnerGroupMemberPersonUid = closure$student.personUid;
        this.local$$receiver.learnerGroupMemberRole = 2;
        this.local$$receiver.learnerGroupMemberLgUid = this$LearnerGroupMemberListPresenter.learnerGroupUid;
        this.state_0 = 2;
        this.result_0 = this$LearnerGroupMemberListPresenter.repo.learnerGroupMemberDao.insertAsync(this.local$$receiver, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$$receiver.learnerGroupMemberUid = this.result_0;
        return this.local$this$LearnerGroupMemberListPresenter.updateList_0() , Unit;
      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 LearnerGroupMemberListPresenter$handleNewMemberToGroup$lambda(closure$student_0, this$LearnerGroupMemberListPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$LearnerGroupMemberListPresenter$handleNewMemberToGroup$lambda(closure$student_0, this$LearnerGroupMemberListPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  LearnerGroupMemberListPresenter.prototype.handleNewMemberToGroup_6c9i1n$ = function(student) {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, LearnerGroupMemberListPresenter$handleNewMemberToGroup$lambda(student, this));
};
  function Coroutine$LearnerGroupMemberListPresenter$handleClickGroupSelectionDone$lambda(this$LearnerGroupMemberListPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 7;
    this.local$this$LearnerGroupMemberListPresenter = this$LearnerGroupMemberListPresenter_0;
  }
  Coroutine$LearnerGroupMemberListPresenter$handleClickGroupSelectionDone$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$LearnerGroupMemberListPresenter$handleClickGroupSelectionDone$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$LearnerGroupMemberListPresenter$handleClickGroupSelectionDone$lambda.prototype.constructor = Coroutine$LearnerGroupMemberListPresenter$handleClickGroupSelectionDone$lambda;
  Coroutine$LearnerGroupMemberListPresenter$handleClickGroupSelectionDone$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        this.exceptionState_0 = 2;
        this.state_0 = 1;
        this.result_0 = this.local$this$LearnerGroupMemberListPresenter.contentEntryOpener_0.openEntry_6luryd$(this.local$this$LearnerGroupMemberListPresenter.context, this.local$this$LearnerGroupMemberListPresenter.contentEntryUid, true, false, (tmp$_0 = (tmp$ = this.local$this$LearnerGroupMemberListPresenter.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_NO_IFRAMES)) != null ? toBoolean(tmp$) : null) != null ? tmp$_0 : false, this.local$this$LearnerGroupMemberListPresenter.learnerGroupUid, this.local$this$LearnerGroupMemberListPresenter.clazzUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        return this.result_0;
      case 2:
        this.exceptionState_0 = 7;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          if (Kotlin.isType(e, NoAppFoundException)) {
            return this.local$this$LearnerGroupMemberListPresenter.view.showSnackBar_9pu0dj$(this.local$this$LearnerGroupMemberListPresenter.systemImpl.getString(2166, this.local$this$LearnerGroupMemberListPresenter.context)) , Unit;
          } else {
            var message = e.message;
            if (message != null) {
              return this.local$this$LearnerGroupMemberListPresenter.view.showSnackBar_9pu0dj$(message) , Unit;
            } else {
              this.state_0 = 3;
              continue;
            }
          }
        } else {
          throw e;
        }
      case 3:
        this.state_0 = 4;
        continue;
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        this.state_0 = 6;
        continue;
      case 6:
        return Unit;
      case 7:
        throw this.exception_0;
      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);
};
  function LearnerGroupMemberListPresenter$handleClickGroupSelectionDone$lambda(this$LearnerGroupMemberListPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$LearnerGroupMemberListPresenter$handleClickGroupSelectionDone$lambda(this$LearnerGroupMemberListPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  LearnerGroupMemberListPresenter.prototype.handleClickGroupSelectionDone = function() {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, LearnerGroupMemberListPresenter$handleClickGroupSelectionDone$lambda(this));
};
  LearnerGroupMemberListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'LearnerGroupMemberListPresenter', 
  interfaces: [UstadListPresenter]};
  function LeavingReasonEditPresenter(context, arguments_0, view, lifecycleOwner, di) {
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(LeavingReasonEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  function Coroutine$LeavingReasonEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$it = it_0;
  }
  Coroutine$LeavingReasonEditPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$LeavingReasonEditPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$LeavingReasonEditPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$LeavingReasonEditPresenter$onLoadEntityFromDb$lambda;
  Coroutine$LeavingReasonEditPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if ((tmp$_0 = (tmp$ = !equals(this.local$closure$entityUid, L0) ? this.local$it : null) != null ? tmp$.leavingReasonDao : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_0.findByUid(this.local$closure$entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 LeavingReasonEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$LeavingReasonEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_15($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_15.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_15.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_15.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_15;
  Coroutine$onLoadEntityFromDb_7hogkd$_15.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        var entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, LeavingReasonEditPresenter$onLoadEntityFromDb$lambda(entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        return (tmp$_1 = this.result_0) != null ? tmp$_1 : new LeavingReason();
      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);
};
  LeavingReasonEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_15(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  LeavingReasonEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = LeavingReason.Companion.serializer();
    var tmp$_0;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    tmp$ = new LeavingReason();
  }
  return tmp$;
};
  LeavingReasonEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, LeavingReason.Companion.serializer(), entityVal);
};
  function Coroutine$LeavingReasonEditPresenter$handleClickSave$lambda(closure$entity_0, this$LeavingReasonEditPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$LeavingReasonEditPresenter = this$LeavingReasonEditPresenter_0;
    this.local$tmp$ = void 0;
  }
  Coroutine$LeavingReasonEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$LeavingReasonEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$LeavingReasonEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$LeavingReasonEditPresenter$handleClickSave$lambda;
  Coroutine$LeavingReasonEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var $receiver = this.local$closure$entity.leavingReasonTitle;
        if ($receiver == null || $receiver.length === 0) {
          this.local$this$LeavingReasonEditPresenter.view.reasonTitleError = this.local$this$LeavingReasonEditPresenter.systemImpl.getString(2127, this.local$this$LeavingReasonEditPresenter.context);
          return;
        } else {
          this.state_0 = 2;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        if (equals(this.local$closure$entity.leavingReasonUid, L0)) {
          this.local$tmp$ = this.local$closure$entity;
          this.state_0 = 4;
          this.result_0 = this.local$this$LeavingReasonEditPresenter.repo.leavingReasonDao.insertAsync(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          this.result_0 = this.local$this$LeavingReasonEditPresenter.repo.leavingReasonDao.updateAsync_e9c2s2$(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 3:
        this.state_0 = 5;
        continue;
      case 4:
        this.local$tmp$.leavingReasonUid = this.result_0;
        this.state_0 = 5;
        continue;
      case 5:
        var tmp$ = this.local$this$LeavingReasonEditPresenter;
        var di = this.local$this$LeavingReasonEditPresenter.di;
        var strategy = ListSerializer(LeavingReason.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_0;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
        return tmp$.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity)) , Unit;
      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 LeavingReasonEditPresenter$handleClickSave$lambda(closure$entity_0, this$LeavingReasonEditPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$LeavingReasonEditPresenter$handleClickSave$lambda(closure$entity_0, this$LeavingReasonEditPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  LeavingReasonEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, LeavingReasonEditPresenter$handleClickSave$lambda(entity, this));
};
  LeavingReasonEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'LeavingReasonEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function LeavingReasonListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  LeavingReasonListPresenter.prototype.onCreate = function(savedState) {
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.updateListOnView_0();
};
  LeavingReasonListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  return true;
};
  function Coroutine$LeavingReasonListPresenter$updateListOnView$lambda(this$LeavingReasonListPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$LeavingReasonListPresenter = this$LeavingReasonListPresenter_0;
  }
  Coroutine$LeavingReasonListPresenter$updateListOnView$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$LeavingReasonListPresenter$updateListOnView$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$LeavingReasonListPresenter$updateListOnView$lambda.prototype.constructor = Coroutine$LeavingReasonListPresenter$updateListOnView$lambda;
  Coroutine$LeavingReasonListPresenter$updateListOnView$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        return this.local$this$LeavingReasonListPresenter.view.list = this.local$this$LeavingReasonListPresenter.repo.leavingReasonDao.findAllReasons() , Unit;
      case 1:
        throw this.exception_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 LeavingReasonListPresenter$updateListOnView$lambda(this$LeavingReasonListPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$LeavingReasonListPresenter$updateListOnView$lambda(this$LeavingReasonListPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  LeavingReasonListPresenter.prototype.updateListOnView_0 = function() {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, LeavingReasonListPresenter$updateListOnView$lambda(this));
};
  LeavingReasonListPresenter.prototype.handleClickCreateNewFab = function() {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, LeavingReasonEditView$Companion_getInstance().VIEW_NAME, getKClass(LeavingReason), LeavingReason.Companion.serializer()));
};
  LeavingReasonListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
  this.handleClickCreateNewFab();
};
  LeavingReasonListPresenter.prototype.onClickLeavingReason_e9c2s2$ = function(leavingReason) {
  switch (this.mListMode.name) {
    case 'PICKER':
      var di = this.di;
      var strategy = ListSerializer(LeavingReason.Companion.serializer());
      var entity = listOf_0(leavingReason);
      var tmp$;
      var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
      this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
      break;
    case 'BROWSER':
      this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, leavingReason, LeavingReasonEditView$Companion_getInstance().VIEW_NAME, getKClass(LeavingReason), LeavingReason.Companion.serializer(), void 0, void 0, toMutableMap(mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, leavingReason.leavingReasonUid.toString())))));
      break;
  }
};
  LeavingReasonListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'LeavingReasonListPresenter', 
  interfaces: [UstadListPresenter]};
  function Login2Presenter(context, arguments_0, view, di) {
    UstadBaseController.call(this, context, arguments_0, view, di, false);
    this.nextDestination_c0wqof$_0 = this.nextDestination_c0wqof$_0;
    this.serverUrl_1y4nsw$_0 = this.serverUrl_1y4nsw$_0;
    var tmp$;
    this.impl_ty2vq0$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, Login2Presenter$impl_metadata);
    var tmp$_0;
    this.accountManager_px48g8$_0 = Instance(this, Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, Login2Presenter$accountManager_metadata);
    var tmp$_1;
    this.httpClient_jbq9vv$_0 = Instance(this, Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(HttpClient), [], false)), TypeToken) ? tmp$_1 : throwCCE(), null).provideDelegate_tpuvb9$(this, Login2Presenter$httpClient_metadata);
    this.workSpace_0 = null;
    this.siteLoadJob_0 = null;
  }
  Object.defineProperty(Login2Presenter.prototype, 'nextDestination_0', {
  configurable: true, 
  get: function() {
  if (this.nextDestination_c0wqof$_0 == null) 
    return throwUPAE('nextDestination');
  return this.nextDestination_c0wqof$_0;
}, 
  set: function(nextDestination) {
  this.nextDestination_c0wqof$_0 = nextDestination;
}});
  Object.defineProperty(Login2Presenter.prototype, 'serverUrl_0', {
  configurable: true, 
  get: function() {
  if (this.serverUrl_1y4nsw$_0 == null) 
    return throwUPAE('serverUrl');
  return this.serverUrl_1y4nsw$_0;
}, 
  set: function(serverUrl) {
  this.serverUrl_1y4nsw$_0 = serverUrl;
}});
  var Login2Presenter$impl_metadata = new PropertyMetadata('impl');
  Object.defineProperty(Login2Presenter.prototype, 'impl_0', {
  configurable: true, 
  get: function() {
  return this.impl_ty2vq0$_0.value;
}});
  var Login2Presenter$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(Login2Presenter.prototype, 'accountManager_0', {
  configurable: true, 
  get: function() {
  return this.accountManager_px48g8$_0.value;
}});
  var Login2Presenter$httpClient_metadata = new PropertyMetadata('httpClient');
  Object.defineProperty(Login2Presenter.prototype, 'httpClient_0', {
  configurable: true, 
  get: function() {
  return this.httpClient_jbq9vv$_0.value;
}});
  function Coroutine$Login2Presenter$onCreate$lambda(this$Login2Presenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 7;
    this.local$this$Login2Presenter = this$Login2Presenter_0;
  }
  Coroutine$Login2Presenter$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$Login2Presenter$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$Login2Presenter$onCreate$lambda.prototype.constructor = Coroutine$Login2Presenter$onCreate$lambda;
  Coroutine$Login2Presenter$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 1;
        continue;
      case 1:
        if (this.local$this$Login2Presenter.workSpace_0 != null) {
          this.state_0 = 8;
          continue;
        }
        this.exceptionState_0 = 3;
        this.state_0 = 2;
        this.result_0 = verifySite(this.local$this$Login2Presenter.httpClient_0, this.local$this$Login2Presenter.serverUrl_0, L10000, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 2:
        var site = this.result_0;
        this.local$this$Login2Presenter.onVerifySite_5rubkd$(site);
        this.exceptionState_0 = 7;
        this.state_0 = 6;
        continue;
      case 3:
        this.exceptionState_0 = 7;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          napier.Napier.w_82mfvz$('Could not load site object for ' + this.local$this$Login2Presenter.serverUrl_0, e);
          this.local$this$Login2Presenter.view.errorMessage = this.local$this$Login2Presenter.impl_0.getString(2010, this.local$this$Login2Presenter.context);
          this.state_0 = 4;
          this.result_0 = delay(L10000, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          throw e;
        }
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        this.state_0 = 6;
        continue;
      case 6:
        this.state_0 = 1;
        continue;
      case 7:
        throw this.exception_0;
      case 8:
        return Unit;
      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);
};
  function Login2Presenter$onCreate$lambda(this$Login2Presenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$Login2Presenter$onCreate$lambda(this$Login2Presenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  Login2Presenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1;
  UstadBaseController.prototype.onCreate.call(this, savedState);
  this.nextDestination_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_NEXT)) != null ? tmp$ : this.impl_0.getAppConfigDefaultFirstDest_za3rmp$(this.context);
  if (this.arguments.containsKey_11rb$(UstadView$Companion_getInstance().ARG_SERVER_URL)) {
    tmp$_1 = getValue(this.arguments, UstadView$Companion_getInstance().ARG_SERVER_URL);
  } else {
    tmp$_1 = (tmp$_0 = this.impl_0.getAppConfigString(AppConfig_getInstance().KEY_API_URL, 'http://localhost', this.context)) != null ? tmp$_0 : '';
  }
  this.serverUrl_0 = tmp$_1;
  this.view.versionInfo = this.impl_0.getVersion_za3rmp$(this.context);
  this.serverUrl_0 = requirePostfix(this.serverUrl_0, '/');
  this.view.loginIntentMessage = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_INTENT_MESSAGE);
  var mSite = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_SITE);
  if (mSite != null) {
    var di = this.di;
    var strategy = Site.Companion.serializer();
    var tmp$_2;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_2 : throwCCE(), null);
    this.onVerifySite_5rubkd$(json.decodeFromString_awif5v$(strategy, mSite));
  } else {
    this.view.loading = true;
    this.view.inProgress = true;
    this.siteLoadJob_0 = launch(this.presenterScope, void 0, void 0, Login2Presenter$onCreate$lambda(this));
  }
};
  Login2Presenter.prototype.onVerifySite_5rubkd$ = function(site) {
  this.workSpace_0 = site;
  this.view.createAccountVisible = site.registrationAllowed;
  this.view.connectAsGuestVisible = site.guestLogin;
  this.view.loading = false;
  this.view.inProgress = false;
  if (equals(this.view.errorMessage, this.impl_0.getString(2010, this.context))) 
    this.view.errorMessage = '';
};
  function Login2Presenter$goToNextDestAfterLoginOrGuestSelected$lambda(this$Login2Presenter) {
    return function() {
  return 'LoginPresenter: go to next destination: ' + this$Login2Presenter.nextDestination_0;
};
  }
  Login2Presenter.prototype.goToNextDestAfterLoginOrGuestSelected_0 = function() {
  var tmp$;
  var goOptions = new UstadMobileSystemCommon$UstadGoOptions((tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_POPUPTO_ON_FINISH)) != null ? tmp$ : UstadView$Companion_getInstance().ROOT_DEST, false);
  napier.Napier.d_9h2hdn$(void 0, void 0, Login2Presenter$goToNextDestAfterLoginOrGuestSelected$lambda(this));
  this.impl_0.go_henhri$(this.nextDestination_0, emptyMap(), this.context, goOptions);
};
  function Coroutine$Login2Presenter$handleLogin$lambda(this$Login2Presenter_0, closure$username_0, closure$password_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 14;
    this.local$this$Login2Presenter = this$Login2Presenter_0;
    this.local$closure$username = closure$username_0;
    this.local$closure$password = closure$password_0;
  }
  Coroutine$Login2Presenter$handleLogin$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$Login2Presenter$handleLogin$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$Login2Presenter$handleLogin$lambda.prototype.constructor = Coroutine$Login2Presenter$handleLogin$lambda;
  Coroutine$Login2Presenter$handleLogin$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2;
        this.exceptionState_0 = 3;
        tmp$_2 = this.local$this$Login2Presenter.accountManager_0;
        var $receiver = this.local$closure$username;
        var tmp$_3;
        tmp$ = trim(Kotlin.isCharSequence(tmp$_3 = $receiver) ? tmp$_3 : throwCCE()).toString();
        var $receiver_0 = this.local$closure$password;
        var tmp$_4;
        this.state_0 = 1;
        this.result_0 = tmp$_2.login_bz5y9$(tmp$, trim(Kotlin.isCharSequence(tmp$_4 = $receiver_0) ? tmp$_4 : throwCCE()).toString(), this.local$this$Login2Presenter.serverUrl_0, (tmp$_1 = (tmp$_0 = this.local$this$Login2Presenter.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_MAX_DATE_OF_BIRTH)) != null ? toLong(tmp$_0) : null) != null ? tmp$_1 : L0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        this.exceptionState_0 = 14;
        this.finallyPath_0 = [2];
        this.state_0 = 12;
        this.$returnValue = (this.local$this$Login2Presenter.goToNextDestAfterLoginOrGuestSelected_0() , Unit);
        continue;
      case 2:
        return this.$returnValue;
      case 3:
        this.finallyPath_0 = [14];
        this.exceptionState_0 = 12;
        var e = this.exception_0;
        if (Kotlin.isType(e, AdultAccountRequiredException)) {
          this.exceptionState_0 = 14;
          this.finallyPath_0 = [10];
          this.state_0 = 12;
          this.$returnValue = (this.local$this$Login2Presenter.view.errorMessage = this.local$this$Login2Presenter.impl_0.getString(2825, this.local$this$Login2Presenter.context) , Unit);
          continue;
        } else {
          if (Kotlin.isType(e, UnauthorizedException)) {
            this.exceptionState_0 = 14;
            this.finallyPath_0 = [8];
            this.state_0 = 12;
            this.$returnValue = (this.local$this$Login2Presenter.view.errorMessage = this.local$this$Login2Presenter.impl_0.getString(2009, this.local$this$Login2Presenter.context) , Unit);
            continue;
          } else {
            if (Kotlin.isType(e, ConsentNotGrantedException)) {
              this.exceptionState_0 = 14;
              this.finallyPath_0 = [6];
              this.state_0 = 12;
              this.$returnValue = (this.local$this$Login2Presenter.view.errorMessage = this.local$this$Login2Presenter.impl_0.getString(2824, this.local$this$Login2Presenter.context) , Unit);
              continue;
            } else {
              if (Kotlin.isType(e, Exception)) {
                napier.Napier.e_82mfvz$('Error logging in', e);
                this.exceptionState_0 = 14;
                this.finallyPath_0 = [4];
                this.state_0 = 12;
                this.$returnValue = (this.local$this$Login2Presenter.view.errorMessage = this.local$this$Login2Presenter.impl_0.getString(2010, this.local$this$Login2Presenter.context) , Unit);
                continue;
              } else {
                throw e;
              }
            }
          }
        }
      case 4:
        return this.$returnValue;
      case 5:
        this.state_0 = 7;
        continue;
      case 6:
        return this.$returnValue;
      case 7:
        this.state_0 = 9;
        continue;
      case 8:
        return this.$returnValue;
      case 9:
        this.state_0 = 11;
        continue;
      case 10:
        return this.$returnValue;
      case 11:
        this.finallyPath_0 = [13];
        this.state_0 = 12;
        continue;
      case 12:
        this.exceptionState_0 = 14;
        this.local$this$Login2Presenter.view.inProgress = false;
        this.local$this$Login2Presenter.view.loading = false;
        this.local$this$Login2Presenter.view.clearFields();
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 13:
        return;
      case 14:
        throw this.exception_0;
      default:
        this.state_0 = 14;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 14) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function Login2Presenter$handleLogin$lambda(this$Login2Presenter_0, closure$username_0, closure$password_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$Login2Presenter$handleLogin$lambda(this$Login2Presenter_0, closure$username_0, closure$password_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  Login2Presenter.prototype.handleLogin_rkkr90$ = function(username, password) {
  this.view.inProgress = true;
  this.view.loading = true;
  var tmp$ = this.view;
  var tmp$_0 = username == null;
  if (!tmp$_0) {
    tmp$_0 = username.length === 0;
  }
  tmp$.isEmptyUsername = tmp$_0;
  var tmp$_1 = this.view;
  var tmp$_2 = password == null;
  if (!tmp$_2) {
    tmp$_2 = password.length === 0;
  }
  tmp$_1.isEmptyPassword = tmp$_2;
  var tmp$_3 = username != null;
  if (tmp$_3) {
    tmp$_3 = username.length > 0;
  }
  var tmp$_4 = tmp$_3 && password != null;
  if (tmp$_4) {
    tmp$_4 = password.length > 0;
  }
  if (tmp$_4) {
    launch(this.presenterScope, void 0, void 0, Login2Presenter$handleLogin$lambda(this, username, password));
  } else {
    this.view.inProgress = false;
    this.view.loading = false;
  }
};
  Login2Presenter.prototype.handleCreateAccount = function() {
  var tmp$;
  var args = mutableMapOf([to(UstadView$Companion_getInstance().ARG_SERVER_URL, this.serverUrl_0), to(SiteTermsDetailView$Companion_getInstance().ARG_SHOW_ACCEPT_BUTTON, true.toString()), to(SiteTermsDetailView$Companion_getInstance().ARG_USE_DISPLAY_LOCALE, true.toString()), to(UstadView$Companion_getInstance().ARG_POPUPTO_ON_FINISH, (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_POPUPTO_ON_FINISH)) != null ? tmp$ : Login2View$Companion_getInstance().VIEW_NAME)]);
  putFromOtherMapIfPresent(args, this.arguments, UstadView$Companion_getInstance().ARG_NEXT);
  putFromOtherMapIfPresent(args, this.arguments, PersonEditView$Companion_getInstance().REGISTER_VIA_LINK);
  this.impl_0.go_gofqk3$(RegisterAgeRedirectView$Companion_getInstance().VIEW_NAME, args, this.context);
};
  function Coroutine$Login2Presenter$handleConnectAsGuest$lambda(this$Login2Presenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$Login2Presenter = this$Login2Presenter_0;
  }
  Coroutine$Login2Presenter$handleConnectAsGuest$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$Login2Presenter$handleConnectAsGuest$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$Login2Presenter$handleConnectAsGuest$lambda.prototype.constructor = Coroutine$Login2Presenter$handleConnectAsGuest$lambda;
  Coroutine$Login2Presenter$handleConnectAsGuest$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$Login2Presenter.accountManager_0.startGuestSession_61zpoe$(this.local$this$Login2Presenter.serverUrl_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        return this.local$this$Login2Presenter.goToNextDestAfterLoginOrGuestSelected_0() , Unit;
      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 Login2Presenter$handleConnectAsGuest$lambda(this$Login2Presenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$Login2Presenter$handleConnectAsGuest$lambda(this$Login2Presenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  Login2Presenter.prototype.handleConnectAsGuest = function() {
  launch(this.presenterScope, void 0, void 0, Login2Presenter$handleConnectAsGuest$lambda(this));
};
  Login2Presenter.prototype.onDestroy = function() {
  var tmp$;
    (tmp$ = this.siteLoadJob_0) != null ? (tmp$.cancel_x5z25k$() , Unit) : null;
  this.siteLoadJob_0 = null;
  UstadBaseController.prototype.onDestroy.call(this);
};
  Login2Presenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Login2Presenter', 
  interfaces: [UstadBaseController]};
  function MessagesPresenter() {
  }
  MessagesPresenter.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'MessagesPresenter', 
  interfaces: []};
  function ModuleCourseBlockEditPresenter(context, args, view, di, lifecycleOwner) {
    UstadEditPresenter.call(this, context, args, view, di, lifecycleOwner);
  }
  Object.defineProperty(ModuleCourseBlockEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  function Coroutine$ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$it = it_0;
  }
  Coroutine$ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda;
  Coroutine$ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if ((tmp$_0 = (tmp$ = !equals(this.local$closure$entityUid, L0) ? this.local$it : null) != null ? tmp$.courseBlockDao : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_0.findByUid(this.local$closure$entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0(closure$entity_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$it = it_0;
  }
  Coroutine$ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0.prototype.constructor = Coroutine$ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0;
  Coroutine$ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.clazzDao.getClazzWithSchool_s8cxhz$(this.local$closure$entity.cbClazzUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0(closure$entity_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0(closure$entity_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_16($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$clazzUid = void 0;
    this.local$tmp$ = void 0;
    this.local$$receiver = void 0;
    this.local$entity = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_16.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_16.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_16.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_16;
  Coroutine$onLoadEntityFromDb_7hogkd$_16.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4;
        var entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLongOrNull(tmp$) : null) != null ? tmp$_0 : L0;
        this.local$clazzUid = (tmp$_2 = (tmp$_1 = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLongOrNull(tmp$_1) : null) != null ? tmp$_2 : L0;
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda(entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if ((tmp$_3 = this.result_0) != null) {
          this.local$tmp$ = tmp$_3;
          this.state_0 = 4;
          continue;
        } else {
          this.local$$receiver = new CourseBlock();
          this.state_0 = 3;
          this.result_0 = get_doorPrimaryKeyManager(this.local$db).nextIdAsync_za3lpa$(124, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 3:
        this.local$$receiver.cbUid = this.result_0;
        this.local$$receiver.cbClazzUid = this.local$clazzUid;
        this.local$$receiver.cbType = 100;
        this.local$$receiver.cbEntityUid = this.local$$receiver.cbUid;
        this.local$tmp$ = this.local$$receiver;
        this.state_0 = 4;
        continue;
      case 4:
        this.local$entity = this.local$tmp$;
        this.state_0 = 5;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, ModuleCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0(this.local$entity), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        var clazzWithSchool = (tmp$_4 = this.result_0) != null ? tmp$_4 : new ClazzWithSchool();
        var timeZone = effectiveTimeZone(clazzWithSchool);
        this.$this.view.timeZone = timeZone;
        if (!equals(this.local$entity.cbHideUntilDate, L0)) {
          var startDateTimeMidnight = toLocalMidnight(DateTime.Companion.invoke_s8cxhz$(this.local$entity.cbHideUntilDate), timeZone).unixMillisLong;
          this.$this.view.startDate = startDateTimeMidnight;
          this.$this.view.startTime = this.local$entity.cbHideUntilDate.subtract(startDateTimeMidnight);
        } else {
          this.$this.view.startDate = L0;
        }
        return this.local$entity;
      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);
};
  ModuleCourseBlockEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_16(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$ModuleCourseBlockEditPresenter$onLoadFromJson$lambda$lambda(closure$caClazzUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$caClazzUid = closure$caClazzUid_0;
    this.local$it = it_0;
  }
  Coroutine$ModuleCourseBlockEditPresenter$onLoadFromJson$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ModuleCourseBlockEditPresenter$onLoadFromJson$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ModuleCourseBlockEditPresenter$onLoadFromJson$lambda$lambda.prototype.constructor = Coroutine$ModuleCourseBlockEditPresenter$onLoadFromJson$lambda$lambda;
  Coroutine$ModuleCourseBlockEditPresenter$onLoadFromJson$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.clazzDao.getClazzWithSchool_s8cxhz$(this.local$closure$caClazzUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ModuleCourseBlockEditPresenter$onLoadFromJson$lambda$lambda(closure$caClazzUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ModuleCourseBlockEditPresenter$onLoadFromJson$lambda$lambda(closure$caClazzUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ModuleCourseBlockEditPresenter$onLoadFromJson$lambda(this$ModuleCourseBlockEditPresenter_0, closure$entity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ModuleCourseBlockEditPresenter = this$ModuleCourseBlockEditPresenter_0;
    this.local$closure$entity = closure$entity_0;
  }
  Coroutine$ModuleCourseBlockEditPresenter$onLoadFromJson$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ModuleCourseBlockEditPresenter$onLoadFromJson$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ModuleCourseBlockEditPresenter$onLoadFromJson$lambda.prototype.constructor = Coroutine$ModuleCourseBlockEditPresenter$onLoadFromJson$lambda;
  Coroutine$ModuleCourseBlockEditPresenter$onLoadFromJson$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        var caClazzUid = (tmp$_0 = (tmp$ = this.local$this$ModuleCourseBlockEditPresenter.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : this.local$closure$entity.cbClazzUid;
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$this$ModuleCourseBlockEditPresenter.db, L2000, ModuleCourseBlockEditPresenter$onLoadFromJson$lambda$lambda(caClazzUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var clazzWithSchool = (tmp$_1 = this.result_0) != null ? tmp$_1 : new ClazzWithSchool();
        var timeZone = effectiveTimeZone(clazzWithSchool);
        this.local$this$ModuleCourseBlockEditPresenter.view.timeZone = timeZone;
        if (!equals(this.local$closure$entity.cbHideUntilDate, L0)) {
          var startDateTimeMidnight = toLocalMidnight(DateTime.Companion.invoke_s8cxhz$(this.local$closure$entity.cbHideUntilDate), timeZone).unixMillisLong;
          this.local$this$ModuleCourseBlockEditPresenter.view.startDate = startDateTimeMidnight;
          return this.local$this$ModuleCourseBlockEditPresenter.view.startTime = this.local$closure$entity.cbHideUntilDate.subtract(startDateTimeMidnight) , Unit;
        } else {
          return this.local$this$ModuleCourseBlockEditPresenter.view.startDate = L0 , Unit;
        }
      case 3:
        return;
      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 ModuleCourseBlockEditPresenter$onLoadFromJson$lambda(this$ModuleCourseBlockEditPresenter_0, closure$entity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ModuleCourseBlockEditPresenter$onLoadFromJson$lambda(this$ModuleCourseBlockEditPresenter_0, closure$entity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ModuleCourseBlockEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = CourseBlock.Companion.serializer();
    var tmp$_0;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    tmp$ = new CourseBlock();
  }
  var entity = tmp$;
  launch(this.presenterScope, void 0, void 0, ModuleCourseBlockEditPresenter$onLoadFromJson$lambda(this, entity));
  return entity;
};
  function Coroutine$ModuleCourseBlockEditPresenter$handleClickSave$lambda(closure$entity_0, this$ModuleCourseBlockEditPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$ModuleCourseBlockEditPresenter = this$ModuleCourseBlockEditPresenter_0;
  }
  Coroutine$ModuleCourseBlockEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ModuleCourseBlockEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ModuleCourseBlockEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$ModuleCourseBlockEditPresenter$handleClickSave$lambda;
  Coroutine$ModuleCourseBlockEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        var $receiver = this.local$closure$entity.cbTitle;
        if ($receiver == null || $receiver.length === 0) {
          this.local$this$ModuleCourseBlockEditPresenter.view.blockTitleError = this.local$this$ModuleCourseBlockEditPresenter.systemImpl.getString(2127, this.local$this$ModuleCourseBlockEditPresenter.context);
          this.local$this$ModuleCourseBlockEditPresenter.view.fieldsEnabled = true;
          this.local$this$ModuleCourseBlockEditPresenter.view.loading = false;
          return;
        }
        var timeZone = (tmp$ = this.local$this$ModuleCourseBlockEditPresenter.view.timeZone) != null ? tmp$ : 'UTC';
        var tmp$_0 = this.local$closure$entity;
        var $receiver_0 = toOffsetByTimezone(DateTime.Companion.invoke_s8cxhz$(this.local$this$ModuleCourseBlockEditPresenter.view.startDate), timeZone);
        var $receiver_1 = $receiver_0.hours;
        var tmp$_1 = TimeSpan.Companion.fromHours_14dthe$($receiver_1);
        var $receiver_2 = $receiver_0.minutes;
        var tmp$_2 = tmp$_1.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_2));
        var $receiver_3 = $receiver_0.seconds;
        var tmp$_3 = tmp$_2.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_3));
        var $receiver_4 = $receiver_0.milliseconds;
        tmp$_0.cbHideUntilDate = $receiver_0.minus_fv8bff$(tmp$_3.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_4))).utc.unixMillisLong.add(this.local$this$ModuleCourseBlockEditPresenter.view.startTime);
        var tmp$_4 = this.local$this$ModuleCourseBlockEditPresenter;
        var di = this.local$this$ModuleCourseBlockEditPresenter.di;
        var strategy = ListSerializer(CourseBlock.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_5;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_5 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_5 : throwCCE(), null);
        tmp$_4.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
        return this.local$this$ModuleCourseBlockEditPresenter.view.loading = false , Unit;
      case 1:
        throw this.exception_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 ModuleCourseBlockEditPresenter$handleClickSave$lambda(closure$entity_0, this$ModuleCourseBlockEditPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ModuleCourseBlockEditPresenter$handleClickSave$lambda(closure$entity_0, this$ModuleCourseBlockEditPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ModuleCourseBlockEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  this.view.fieldsEnabled = false;
  this.view.loading = true;
  launch(this.presenterScope, void 0, void 0, ModuleCourseBlockEditPresenter$handleClickSave$lambda(entity, this));
};
  ModuleCourseBlockEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ModuleCourseBlockEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function NewCommentItemListener() {
  }
  NewCommentItemListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'NewCommentItemListener', 
  interfaces: []};
  function OnBoardingPresenter(context, arguments_0, view, di) {
    UstadBaseController.call(this, context, arguments_0, view, di, false);
    var tmp$;
    this.impl_kh162$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, OnBoardingPresenter$impl_metadata);
    this.languageOptions_0 = this.impl_0.getAllUiLanguagesList(context);
  }
  var OnBoardingPresenter$impl_metadata = new PropertyMetadata('impl');
  Object.defineProperty(OnBoardingPresenter.prototype, 'impl_0', {
  configurable: true, 
  get: function() {
  return this.impl_kh162$_0.value;
}});
  OnBoardingPresenter.prototype.onCreate = function(savedState) {
  UstadBaseController.prototype.onCreate.call(this, savedState);
  var $receiver = this.languageOptions_0;
  var indexOfFirst$result;
  indexOfFirst$break:
    do {
      var tmp$;
      var index = 0;
      tmp$ = $receiver.iterator();
      while (tmp$.hasNext()) {
        var item = tmp$.next();
        if (equals(item.first, this.impl_0.getLocale(this.context))) {
          indexOfFirst$result = index;
          break indexOfFirst$break;
        }
        index = index + 1 | 0;
      }
      indexOfFirst$result = -1;
    } while (false);
  var selectedLocaleIndex = indexOfFirst$result;
  var tmp$_0 = this.view;
  var $receiver_0 = this.languageOptions_0;
  var destination = ArrayList_init_0(collectionSizeOrDefault($receiver_0, 10));
  var tmp$_1;
  tmp$_1 = $receiver_0.iterator();
  while (tmp$_1.hasNext()) {
    var item_0 = tmp$_1.next();
    destination.add_11rb$(item_0.second);
  }
  tmp$_0.setLanguageOptions_8zkr97$(destination, this.languageOptions_0.get_za3lpa$(selectedLocaleIndex).second);
};
  OnBoardingPresenter.prototype.handleLanguageSelected_za3lpa$ = function(position) {
  var tmp$, tmp$_0;
  var newLocaleCode = this.languageOptions_0.get_za3lpa$(position).first;
  if (equals(newLocaleCode, UstadMobileSystemCommon$Companion_getInstance().LOCALE_USE_SYSTEM)) {
    tmp$ = this.impl_0.getSystemLocale(this.context).substring(0, 2);
  } else {
    tmp$ = newLocaleCode;
  }
  var newLocaleToDisplay = tmp$;
  var needsRestart = !equals(this.impl_0.getDisplayedLocale_za3rmp$(this.context), newLocaleToDisplay);
  if (!equals(newLocaleCode, this.impl_0.getLocale(this.context))) {
    this.impl_0.setLocale(newLocaleCode, this.context);
  }
  var $receiver = this.view;
    (tmp$_0 = needsRestart ? $receiver : null) != null ? (tmp$_0.restartUI() , Unit) : null;
};
  OnBoardingPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'OnBoardingPresenter', 
  interfaces: [UstadBaseController]};
  function OnSearchSubmitted() {
  }
  OnSearchSubmitted.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'OnSearchSubmitted', 
  interfaces: []};
  function OnSortOptionSelected() {
  }
  OnSortOptionSelected.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'OnSortOptionSelected', 
  interfaces: []};
  function ParentalConsentManagementPresenter(context, arguments_0, view, lifecycleOwner, di) {
    ParentalConsentManagementPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(ParentalConsentManagementPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  ParentalConsentManagementPresenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
  this.view.relationshipFieldOptions = listOf([new MessageIdOption(2315, this.context, 1, this.di), new MessageIdOption(2314, this.context, 2, this.di), new MessageIdOption(2728, this.context, 4, this.di)]);
};
  function Coroutine$ParentalConsentManagementPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$it = it_0;
  }
  Coroutine$ParentalConsentManagementPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ParentalConsentManagementPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ParentalConsentManagementPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$ParentalConsentManagementPresenter$onLoadEntityFromDb$lambda;
  Coroutine$ParentalConsentManagementPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.personParentJoinDao.findByUidWithMinorAsync_s8cxhz$(this.local$closure$entityUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ParentalConsentManagementPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ParentalConsentManagementPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_17($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 13;
    this.$this = $this;
    this.local$tmp$_2 = void 0;
    this.local$entityUid = void 0;
    this.local$personParentJoin = void 0;
    this.local$minorPersonFromWeb = void 0;
    this.local$minorPerson = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_17.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_17.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_17.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_17;
  Coroutine$onLoadEntityFromDb_7hogkd$_17.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        var tmp$_2, tmp$_3, tmp$_4, tmp$_5;
        this.local$entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 1;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L5000, ParentalConsentManagementPresenter$onLoadEntityFromDb$lambda(this.local$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        this.local$personParentJoin = this.result_0;
        if (this.local$personParentJoin == null && Kotlin.isType(this.local$db, DoorDatabaseRepository)) {
          this.exceptionState_0 = 8;
          this.state_0 = 2;
          this.result_0 = this.local$db.personParentJoinDao.findByUidWithMinorAsyncFromWeb_s8cxhz$(this.local$entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 10;
          continue;
        }
      case 2:
        this.local$personParentJoin = this.result_0;
        if (this.local$personParentJoin != null) {
          this.state_0 = 3;
          this.result_0 = this.local$db.personParentJoinDao.insertAsync_ei4fsf$(this.local$personParentJoin, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 4;
          continue;
        }
      case 3:
        this.state_0 = 4;
        continue;
      case 4:
        this.local$minorPersonFromWeb = this.local$personParentJoin != null ? this.local$personParentJoin.minorPerson : null;
        this.state_0 = 5;
        this.result_0 = this.local$db.personDao.findByUidAsync_s8cxhz$((tmp$_1 = this.local$personParentJoin != null ? this.local$personParentJoin.ppjMinorPersonUid : null) != null ? tmp$_1 : L0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        var minorPerson = this.result_0;
        if (minorPerson == null && this.local$minorPersonFromWeb != null) {
          this.state_0 = 6;
          this.result_0 = this.local$db.personDao.insertAsync(this.local$minorPersonFromWeb, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 7;
          continue;
        }
      case 6:
        this.state_0 = 7;
        continue;
      case 7:
        this.exceptionState_0 = 13;
        this.state_0 = 9;
        continue;
      case 8:
        this.exceptionState_0 = 13;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          napier.Napier.w_82mfvz$('Could not load personparentjoin from web for ' + this.local$entityUid.toString(), e);
        } else 
          throw e;
        this.state_0 = 9;
        continue;
      case 9:
        this.state_0 = 10;
        continue;
      case 10:
        if (this.local$personParentJoin == null && !Kotlin.isType(this.local$db, DoorDatabaseRepository)) {
          return null;
        } else {
          if (this.local$personParentJoin == null) {
            throw new ErrorCodeException(10024, 'Child registration not found for ' + this.local$entityUid.toString());
          }
          this.state_0 = 11;
          continue;
        }
      case 11:
        this.local$minorPerson = this.local$personParentJoin.minorPerson;
        if (this.local$minorPerson == null && Kotlin.isType(this.local$db, DoorDatabaseRepository)) {
          throw IllegalStateException_init('1022: Could not find minor for ppj ' + this.local$entityUid.toString());
        }
        this.local$tmp$_2 = this.$this.view;
        this.state_0 = 12;
        this.result_0 = this.local$db.siteTermsDao.findSiteTerms_61zpoe$(this.$this.systemImpl.getDisplayedLocale_za3rmp$(this.$this.context), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 12:
        this.local$tmp$_2.siteTerms = this.result_0;
        if (equals(this.local$personParentJoin.ppjParentPersonUid, L0)) {
          this.$this.view.infoText = replace(replace(replace(this.$this.systemImpl.getString(2720, this.$this.context), '%1$s', (tmp$_2 = this.local$minorPerson != null ? this.local$minorPerson.fullName() : null) != null ? tmp$_2 : ''), '%2$s', (tmp$_4 = (tmp$_3 = this.local$minorPerson != null ? this.local$minorPerson.dateOfBirth : null) != null ? formatDate(tmp$_3, this.$this.context) : null) != null ? tmp$_4 : ''), '%3$s', this.$this.systemImpl.getString(2000, this.$this.context));
        } else if (Kotlin.isType(this.local$db, DoorDatabaseRepository) && !equals(this.local$personParentJoin.ppjParentPersonUid, L0)) {
          if (equals(this.local$personParentJoin.ppjParentPersonUid, this.$this.accountManager.activeAccount.personUid)) {
            if (this.local$personParentJoin.ppjStatus === 1) {
              tmp$_5 = 2726;
            } else {
              tmp$_5 = 2727;
            }
            var messageId = tmp$_5;
            this.$this.view.infoText = replace(this.$this.systemImpl.getString(messageId, this.$this.context), '%1$s', formatDate(this.local$personParentJoin.ppjApprovalTiemstamp, this.$this.context));
          } else {
            throw IllegalStateException_init('Active user is not the parent!');
          }
        }
        return this.local$personParentJoin;
      case 13:
        throw this.exception_0;
      default:
        this.state_0 = 13;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 13) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  ParentalConsentManagementPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_17(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ParentalConsentManagementPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = PersonParentJoinWithMinorPerson.Companion.serializer();
    var tmp$_0;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    tmp$ = new PersonParentJoinWithMinorPerson();
  }
  return tmp$;
};
  ParentalConsentManagementPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  function Coroutine$ParentalConsentManagementPresenter$handleClickSave$lambda(this$ParentalConsentManagementPresenter_0, closure$entity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ParentalConsentManagementPresenter = this$ParentalConsentManagementPresenter_0;
    this.local$closure$entity = closure$entity_0;
    this.local$activeSession = void 0;
    this.local$classCheckRequired = void 0;
    this.local$tmp$ = void 0;
  }
  Coroutine$ParentalConsentManagementPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ParentalConsentManagementPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ParentalConsentManagementPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$ParentalConsentManagementPresenter$handleClickSave$lambda;
  Coroutine$ParentalConsentManagementPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.local$this$ParentalConsentManagementPresenter.view.relationshipFieldError = null;
        if (this.local$closure$entity.ppjRelationship === 0) {
          this.local$this$ParentalConsentManagementPresenter.view.relationshipFieldError = this.local$this$ParentalConsentManagementPresenter.systemImpl.getString(2127, this.local$this$ParentalConsentManagementPresenter.context);
          return;
        } else {
          this.state_0 = 2;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        tmp$ = this.local$this$ParentalConsentManagementPresenter.accountManager.activeSession;
        if (tmp$ == null) {
          throw IllegalStateException_init('Could not find person group uid!');
        }
        this.local$activeSession = tmp$;
        this.local$classCheckRequired = false;
        if (equals(this.local$closure$entity.ppjParentPersonUid, L0)) {
          this.local$closure$entity.ppjParentPersonUid = this.local$activeSession.person.personUid;
          this.state_0 = 3;
          this.result_0 = grantScopedPermission_0(this.local$this$ParentalConsentManagementPresenter.repo, this.local$activeSession.person, Role$Companion$ROLE_PARENT_PERSON_PERMISSIONS_DEFAULT, 9, this.local$closure$entity.ppjMinorPersonUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 4;
          continue;
        }
      case 3:
        this.local$classCheckRequired = true;
        this.state_0 = 4;
        continue;
      case 4:
        this.local$closure$entity.ppjApprovalTiemstamp = systemTimeInMillis();
        this.state_0 = 5;
        this.result_0 = this.local$this$ParentalConsentManagementPresenter.repo.personParentJoinDao.updateAsync_ei4fsf$(this.local$closure$entity, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        if (this.local$classCheckRequired) {
          this.state_0 = 6;
          this.result_0 = this.local$this$ParentalConsentManagementPresenter.repo.personParentJoinDao.findByMinorPersonUidWhereParentNotEnrolledInClazz_3pjtqy$(this.local$closure$entity.ppjMinorPersonUid, L0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 10;
          continue;
        }
      case 6:
        var parentEnrolmentsRequired = this.result_0;
        this.local$tmp$ = parentEnrolmentsRequired.iterator();
        this.state_0 = 7;
        continue;
      case 7:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 9;
          continue;
        }
        var element = this.local$tmp$.next();
        this.state_0 = 8;
        this.result_0 = enrolPersonIntoClazzAtLocalTimezone(this.local$this$ParentalConsentManagementPresenter.repo, this.local$activeSession.person, element.clazzUid, 1003, void 0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 8:
        this.state_0 = 7;
        continue;
      case 9:
        this.state_0 = 10;
        continue;
      case 10:
        if (equals(this.local$this$ParentalConsentManagementPresenter.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_NEXT), UstadView$Companion_getInstance().CURRENT_DEST)) {
          return this.local$this$ParentalConsentManagementPresenter.systemImpl.popBack_i9f55q$(UstadView$Companion_getInstance().CURRENT_DEST, true, this.local$this$ParentalConsentManagementPresenter.context) , Unit;
        } else {
          return this.local$this$ParentalConsentManagementPresenter.systemImpl.go_henhri$(PersonListView$Companion_getInstance().VIEW_NAME, emptyMap(), this.local$this$ParentalConsentManagementPresenter.context, new UstadMobileSystemCommon$UstadGoOptions(UstadView$Companion_getInstance().ROOT_DEST, false)) , Unit;
        }
      case 11:
        return;
      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 ParentalConsentManagementPresenter$handleClickSave$lambda(this$ParentalConsentManagementPresenter_0, closure$entity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ParentalConsentManagementPresenter$handleClickSave$lambda(this$ParentalConsentManagementPresenter_0, closure$entity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ParentalConsentManagementPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  launch(this.presenterScope, doorMainDispatcher(), void 0, ParentalConsentManagementPresenter$handleClickSave$lambda(this, entity));
};
  function ParentalConsentManagementPresenter$Companion() {
    ParentalConsentManagementPresenter$Companion_instance = this;
  }
  ParentalConsentManagementPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ParentalConsentManagementPresenter$Companion_instance = null;
  function ParentalConsentManagementPresenter$Companion_getInstance() {
    if (ParentalConsentManagementPresenter$Companion_instance === null) {
      new ParentalConsentManagementPresenter$Companion();
    }
    return ParentalConsentManagementPresenter$Companion_instance;
  }
  ParentalConsentManagementPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ParentalConsentManagementPresenter', 
  interfaces: [UstadEditPresenter]};
  function PersonAccountEditPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.serverUrl_spjmtp$_0 = this.serverUrl_spjmtp$_0;
    var tmp$;
    this.impl_9i9f6z$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, PersonAccountEditPresenter$impl_metadata);
    var context_0 = this.accountManager.activeEndpoint;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_0;
    var tmp$_1;
    this.authManager_3wqwuy$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$_0 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(AuthManager), [], false)), TypeToken) ? tmp$_1 : throwCCE(), null).provideDelegate_tpuvb9$(this, PersonAccountEditPresenter$authManager_metadata);
    this.createAccount_0 = false;
    this.activeUserHasPasswordResetPermission_0 = false;
  }
  Object.defineProperty(PersonAccountEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  Object.defineProperty(PersonAccountEditPresenter.prototype, 'serverUrl_0', {
  configurable: true, 
  get: function() {
  if (this.serverUrl_spjmtp$_0 == null) 
    return throwUPAE('serverUrl');
  return this.serverUrl_spjmtp$_0;
}, 
  set: function(serverUrl) {
  this.serverUrl_spjmtp$_0 = serverUrl;
}});
  var PersonAccountEditPresenter$impl_metadata = new PropertyMetadata('impl');
  Object.defineProperty(PersonAccountEditPresenter.prototype, 'impl_0', {
  configurable: true, 
  get: function() {
  return this.impl_9i9f6z$_0.value;
}});
  var PersonAccountEditPresenter$authManager_metadata = new PropertyMetadata('authManager');
  Object.defineProperty(PersonAccountEditPresenter.prototype, 'authManager_0', {
  configurable: true, 
  get: function() {
  return this.authManager_3wqwuy$_0.value;
}});
  PersonAccountEditPresenter.prototype.onCreate = function(savedState) {
  var tmp$;
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
  this.serverUrl_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_SERVER_URL)) != null ? tmp$ : this.accountManager.activeAccount.endpointUrl;
};
  function Coroutine$PersonAccountEditPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$activePersonUid_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$activePersonUid = closure$activePersonUid_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$PersonAccountEditPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$PersonAccountEditPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$PersonAccountEditPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$PersonAccountEditPresenter$onLoadEntityFromDb$lambda;
  Coroutine$PersonAccountEditPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$closure$db.personDao.personHasPermissionAsync_b9bd0d$(this.local$closure$activePersonUid, this.local$closure$entityUid, Role$Companion$PERMISSION_RESET_PASSWORD, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 PersonAccountEditPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$activePersonUid_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$PersonAccountEditPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$activePersonUid_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$PersonAccountEditPresenter$onLoadEntityFromDb$lambda_0(closure$db_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$PersonAccountEditPresenter$onLoadEntityFromDb$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$PersonAccountEditPresenter$onLoadEntityFromDb$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$PersonAccountEditPresenter$onLoadEntityFromDb$lambda_0.prototype.constructor = Coroutine$PersonAccountEditPresenter$onLoadEntityFromDb$lambda_0;
  Coroutine$PersonAccountEditPresenter$onLoadEntityFromDb$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        var $receiver = this.local$closure$db;
        if ((tmp$_0 = (tmp$ = !equals(this.local$closure$entityUid, L0) ? $receiver : null) != null ? tmp$.personDao : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_0.findPersonAccountByUid(this.local$closure$entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 PersonAccountEditPresenter$onLoadEntityFromDb$lambda_0(closure$db_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$PersonAccountEditPresenter$onLoadEntityFromDb$lambda_0(closure$db_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_18($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$_2 = void 0;
    this.local$entityUid = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_18.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_18.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_18.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_18;
  Coroutine$onLoadEntityFromDb_7hogkd$_18.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        var tmp$_2;
        this.local$entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        var activePersonUid = this.$this.accountManager.activeAccount.personUid;
        if (!equals(activePersonUid, this.local$entityUid)) {
          this.state_0 = 2;
          this.result_0 = withTimeoutOrNull(L2000, PersonAccountEditPresenter$onLoadEntityFromDb$lambda(this.local$db, activePersonUid, this.local$entityUid), this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.local$tmp$_2 = false;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.local$tmp$_2 = (tmp$_1 = this.result_0) != null ? tmp$_1 : false;
        this.state_0 = 3;
        continue;
      case 3:
        this.$this.activeUserHasPasswordResetPermission_0 = this.local$tmp$_2;
        this.$this.view.currentPasswordVisible = !this.$this.activeUserHasPasswordResetPermission_0;
        this.state_0 = 4;
        this.result_0 = withTimeoutOrNull(L2000, PersonAccountEditPresenter$onLoadEntityFromDb$lambda_0(this.local$db, this.local$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        var person = (tmp$_2 = this.result_0) != null ? tmp$_2 : new PersonWithAccount();
        var $receiver = person.username;
        this.$this.createAccount_0 = $receiver == null || $receiver.length === 0;
        var tmp$_3 = this.$this.view;
        var $receiver_0 = person.username;
        tmp$_3.usernameVisible = $receiver_0 == null || isBlank($receiver_0);
        return person;
      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);
};
  PersonAccountEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_18(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  PersonAccountEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = PersonWithAccount.Companion.serializer();
    var tmp$_0;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    tmp$ = new PersonWithAccount();
  }
  return tmp$;
};
  PersonAccountEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  function Coroutine$PersonAccountEditPresenter$handleClickSave$lambda(closure$entity_0, this$PersonAccountEditPresenter_0, closure$newPassword_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$PersonAccountEditPresenter = this$PersonAccountEditPresenter_0;
    this.local$closure$newPassword = closure$newPassword_0;
    this.local$entityUsername = void 0;
  }
  Coroutine$PersonAccountEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$PersonAccountEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$PersonAccountEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$PersonAccountEditPresenter$handleClickSave$lambda;
  Coroutine$PersonAccountEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$entityUsername = this.local$closure$entity.username;
        var currentPassword = this.local$closure$entity.currentPassword;
        if (!this.local$this$PersonAccountEditPresenter.activeUserHasPasswordResetPermission_0 && !this.local$this$PersonAccountEditPresenter.createAccount_0) {
          if (this.local$entityUsername == null || currentPassword == null) 
            throw IllegalStateException_init('Should have been an error');
          this.state_0 = 2;
          this.result_0 = this.local$this$PersonAccountEditPresenter.authManager_0.authenticate_qz9155$(this.local$entityUsername, currentPassword, void 0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 4;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        if (!this.result_0.success) {
          this.local$this$PersonAccountEditPresenter.view.currentPasswordError = this.local$this$PersonAccountEditPresenter.impl_0.getString(2638, this.local$this$PersonAccountEditPresenter.context);
          return;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 3:
        this.state_0 = 4;
        continue;
      case 4:
        if (this.local$this$PersonAccountEditPresenter.createAccount_0) {
          if (this.local$entityUsername == null) 
            throw IllegalStateException_init('Cannot create new user with null username');
          this.state_0 = 5;
          this.result_0 = this.local$this$PersonAccountEditPresenter.repo.personDao.findByUsernameCount_61zpoe$(this.local$entityUsername, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 8;
          continue;
        }
      case 5:
        if (this.result_0 === 0) {
          this.state_0 = 6;
          this.result_0 = this.local$this$PersonAccountEditPresenter.repo.personDao.updateAsync_6c9i1n$(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.local$this$PersonAccountEditPresenter.view.usernameError = this.local$this$PersonAccountEditPresenter.impl_0.getString(2637, this.local$this$PersonAccountEditPresenter.context);
          return;
        }
      case 6:
        this.state_0 = 7;
        continue;
      case 7:
        this.state_0 = 8;
        continue;
      case 8:
        this.state_0 = 9;
        this.result_0 = this.local$this$PersonAccountEditPresenter.authManager_0.setAuth_a4hdmt$(this.local$closure$entity.personUid, this.local$closure$newPassword, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 9:
        var tmp$ = this.local$this$PersonAccountEditPresenter;
        var di = this.local$this$PersonAccountEditPresenter.di;
        var strategy = ListSerializer(PersonWithAccount.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_0;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
        return tmp$.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity)) , Unit;
      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 PersonAccountEditPresenter$handleClickSave$lambda(closure$entity_0, this$PersonAccountEditPresenter_0, closure$newPassword_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$PersonAccountEditPresenter$handleClickSave$lambda(closure$entity_0, this$PersonAccountEditPresenter_0, closure$newPassword_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  PersonAccountEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  var tmp$;
  var tmp$_0 = !this.activeUserHasPasswordResetPermission_0;
  if (tmp$_0) {
    var $receiver = entity.currentPassword;
    tmp$_0 = $receiver == null || $receiver.length === 0;
  }
  var tmp$_1 = tmp$_0 && !this.createAccount_0;
  if (!tmp$_1) {
    var $receiver_0 = entity.newPassword;
    tmp$_1 = $receiver_0 == null || $receiver_0.length === 0;
  }
  var tmp$_2 = tmp$_1;
  if (!tmp$_2) {
    var $receiver_1 = entity.confirmedPassword;
    tmp$_2 = $receiver_1 == null || $receiver_1.length === 0;
  }
  var tmp$_3 = tmp$_2;
  if (!tmp$_3) {
    var $receiver_2 = entity.username;
    tmp$_3 = $receiver_2 == null || $receiver_2.length === 0;
  }
  var hasErrors = tmp$_3 || !equals(entity.confirmedPassword, entity.newPassword);
  if (hasErrors) {
    var requiredFieldMessage = this.impl_0.getString(2127, this.context);
    var tmp$_4 = this.view;
    var $receiver_3 = entity.username;
    tmp$_4.usernameError = $receiver_3 == null || $receiver_3.length === 0 ? requiredFieldMessage : null;
    var tmp$_5 = this.view;
    var tmp$_6 = !equals(entity.confirmedPassword, entity.newPassword);
    if (tmp$_6) {
      var $receiver_4 = entity.confirmedPassword;
      tmp$_6 = !($receiver_4 == null || $receiver_4.length === 0);
    }
    var tmp$_7 = tmp$_6;
    if (tmp$_7) {
      var $receiver_5 = entity.newPassword;
      tmp$_7 = !($receiver_5 == null || $receiver_5.length === 0);
    }
    tmp$_5.noPasswordMatchError = tmp$_7 ? this.impl_0.getString(2129, this.context) : null;
    var $receiver_6 = entity.currentPassword;
    this.view.currentPasswordError = ($receiver_6 == null || $receiver_6.length === 0) && !this.activeUserHasPasswordResetPermission_0 && !this.createAccount_0 ? requiredFieldMessage : null;
    var $receiver_7 = entity.newPassword;
    this.view.newPasswordError = $receiver_7 == null || $receiver_7.length === 0 ? requiredFieldMessage : this.view.newPasswordError;
    var $receiver_8 = entity.confirmedPassword;
    this.view.confirmedPasswordError = $receiver_8 == null || $receiver_8.length === 0 ? requiredFieldMessage : this.view.confirmedPasswordError;
    return;
  }
  tmp$ = entity.newPassword;
  if (tmp$ == null) {
    throw IllegalStateException_init('Not possible! hasErrors checked false');
  }
  var newPassword = tmp$;
  launch(this.presenterScope, void 0, void 0, PersonAccountEditPresenter$handleClickSave$lambda(entity, this, newPassword));
};
  PersonAccountEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'PersonAccountEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function PersonConstants() {
    PersonConstants_instance = this;
    this.GENDER_MESSAGE_ID_MAP = mapOf([to(1, 2049), to(2, 2048), to(4, 2050)]);
  }
  PersonConstants.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'PersonConstants', 
  interfaces: []};
  var PersonConstants_instance = null;
  function PersonConstants_getInstance() {
    if (PersonConstants_instance === null) {
      new PersonConstants();
    }
    return PersonConstants_instance;
  }
  function PersonDetailPresenter(context, arguments_0, view, di, lifecycleOwner) {
    PersonDetailPresenter$Companion_getInstance();
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(PersonDetailPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$LIVEDATA_getInstance();
}});
  function Coroutine$PersonDetailPresenter$onLoadLiveData$lambda$lambda(closure$entityUid_0, dbToUse_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$dbToUse = dbToUse_0;
  }
  Coroutine$PersonDetailPresenter$onLoadLiveData$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$PersonDetailPresenter$onLoadLiveData$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$PersonDetailPresenter$onLoadLiveData$lambda$lambda.prototype.constructor = Coroutine$PersonDetailPresenter$onLoadLiveData$lambda$lambda;
  Coroutine$PersonDetailPresenter$onLoadLiveData$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if ((tmp$_0 = (tmp$ = !equals(this.local$closure$entityUid, L0) ? this.local$dbToUse : null) != null ? tmp$.personDao : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_0.findByUidAsync_s8cxhz$(this.local$closure$entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 PersonDetailPresenter$onLoadLiveData$lambda$lambda(closure$entityUid_0) {
    return function(dbToUse_0, continuation_0, suspended) {
  var instance = new Coroutine$PersonDetailPresenter$onLoadLiveData$lambda$lambda(closure$entityUid_0, dbToUse_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$PersonDetailPresenter$onLoadLiveData$lambda(closure$repo_0, closure$entityUid_0, closure$activePersonUid_0, this$PersonDetailPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$repo = closure$repo_0;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$closure$activePersonUid = closure$activePersonUid_0;
    this.local$this$PersonDetailPresenter = this$PersonDetailPresenter_0;
    this.local$person = void 0;
  }
  Coroutine$PersonDetailPresenter$onLoadLiveData$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$PersonDetailPresenter$onLoadLiveData$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$PersonDetailPresenter$onLoadLiveData$lambda.prototype.constructor = Coroutine$PersonDetailPresenter$onLoadLiveData$lambda;
  Coroutine$PersonDetailPresenter$onLoadLiveData$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$closure$repo, L5000, PersonDetailPresenter$onLoadLiveData$lambda$lambda(this.local$closure$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$person = (tmp$ = this.result_0) != null ? tmp$ : new Person();
        this.state_0 = 3;
        this.result_0 = this.local$closure$repo.personDao.personHasPermissionAsync_b9bd0d$(this.local$closure$activePersonUid, this.local$closure$entityUid, Role$Companion$PERMISSION_RESET_PASSWORD, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var hasAuthPermission = this.result_0;
        this.local$this$PersonDetailPresenter.view.changePasswordVisible = (this.local$person.username != null && (equals(this.local$closure$activePersonUid, this.local$closure$entityUid) || hasAuthPermission));
        this.local$this$PersonDetailPresenter.view.chatVisibility = !equals(this.local$person.personUid, this.local$closure$activePersonUid);
        return this.local$this$PersonDetailPresenter.view.showCreateAccountVisible = (this.local$person.username == null && hasAuthPermission) , Unit;
      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 PersonDetailPresenter$onLoadLiveData$lambda(closure$repo_0, closure$entityUid_0, closure$activePersonUid_0, this$PersonDetailPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$PersonDetailPresenter$onLoadLiveData$lambda(closure$repo_0, closure$entityUid_0, closure$activePersonUid_0, this$PersonDetailPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  PersonDetailPresenter.prototype.onLoadLiveData_7hogkd$ = function(repo) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
  var entityUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  this.view.clazzes = repo.clazzEnrolmentDao.findAllClazzesByPersonWithClazz_s8cxhz$(entityUid);
  var activePersonUid = (tmp$_3 = (tmp$_2 = (tmp$_1 = this.accountManager.activeSession) != null ? tmp$_1.person : null) != null ? tmp$_2.personUid : null) != null ? tmp$_3 : L_1;
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, PersonDetailPresenter$onLoadLiveData$lambda(repo, entityUid, activePersonUid, this));
  return repo.personDao.findByUidWithDisplayDetailsLive_3pjtqy$(entityUid, activePersonUid);
};
  PersonDetailPresenter.prototype.handleClickClazz_yflbhc$ = function(clazz) {
  this.systemImpl.go_gofqk3$(ClazzDetailView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, clazz.clazzEnrolmentClazzUid.toString())), this.context);
};
  PersonDetailPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  var tmp$, tmp$_0, tmp$_1;
  return this.repo.personDao.personHasPermissionAsync_b9bd0d$((tmp$ = account != null ? account.personUid : null) != null ? tmp$ : L0, (tmp$_1 = (tmp$_0 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$_0) : null) != null ? tmp$_1 : L0, Role$Companion$PERMISSION_PERSON_UPDATE, continuation);
};
  PersonDetailPresenter.prototype.handleClickEdit = function() {
  this.navigateToEditScreen_0(PersonEditView$Companion_getInstance().VIEW_NAME);
};
  PersonDetailPresenter.prototype.handleChangePassword = function() {
  this.navigateToEditScreen_0();
};
  PersonDetailPresenter.prototype.handleCreateAccount = function() {
  this.navigateToEditScreen_0();
};
  PersonDetailPresenter.prototype.navigateToEditScreen_0 = function(destination) {
  if (destination === void 0) 
    destination = PersonAccountEditView$Companion_getInstance().VIEW_NAME;
  var tmp$, tmp$_0;
  tmp$_0 = (tmp$ = this.view.entity) != null ? tmp$.personUid : null;
  if (tmp$_0 == null) {
    return;
  }
  var personUid = tmp$_0;
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, destination, getKClass(PersonWithAccount), PersonWithAccount.Companion.serializer(), PersonDetailPresenter$Companion_getInstance().SAVEDSTATE_KEY_PERSON, void 0, mutableMapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, personUid.toString())])));
};
  PersonDetailPresenter.prototype.handleClickChat = function() {
  var tmp$, tmp$_0;
  this.systemImpl.go_gofqk3$(ChatDetailView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_PERSON_UID, ((tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0).toString())), this.context);
};
  PersonDetailPresenter.prototype.handleClickManageParentalConsent = function() {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  var ppjUid = (tmp$_2 = (tmp$_1 = (tmp$_0 = (tmp$ = this.entityLiveData) != null ? tmp$.getValue() : null) != null ? tmp$_0.parentJoin : null) != null ? tmp$_1.ppjUid : null) != null ? tmp$_2 : L0;
  if (!equals(ppjUid, L0)) {
    this.systemImpl.go_gofqk3$(ParentalConsentManagementView$Companion_getInstance().VIEW_NAME, mapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, ppjUid.toString()), to(UstadView$Companion_getInstance().ARG_NEXT, UstadView$Companion_getInstance().CURRENT_DEST)]), this.context);
  } else {
    this.view.showSnackBar_9pu0dj$(this.systemImpl.getString(2002, this.context));
  }
};
  function PersonDetailPresenter$Companion() {
    PersonDetailPresenter$Companion_instance = this;
    this.SAVEDSTATE_KEY_PERSON = 'Person';
  }
  PersonDetailPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var PersonDetailPresenter$Companion_instance = null;
  function PersonDetailPresenter$Companion_getInstance() {
    if (PersonDetailPresenter$Companion_instance === null) {
      new PersonDetailPresenter$Companion();
    }
    return PersonDetailPresenter$Companion_instance;
  }
  PersonDetailPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'PersonDetailPresenter', 
  interfaces: [UstadDetailPresenter]};
  function PersonEditPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner, !arguments_0.containsKey_11rb$(PersonEditView$Companion_getInstance().ARG_REGISTRATION_MODE));
    this.serverUrl_3sqfvu$_0 = this.serverUrl_3sqfvu$_0;
    var tmp$;
    this.impl_9gfq0e$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, PersonEditPresenter$impl_metadata);
    this.nextDestination_8xt98n$_0 = this.nextDestination_8xt98n$_0;
    this.registrationModeFlags_0 = 0;
    this.loggedInPerson_0 = null;
    this.regViaLink_0 = false;
    this.mPersonParentJoin_8be2vx$ = null;
  }
  Object.defineProperty(PersonEditPresenter.prototype, 'serverUrl_0', {
  configurable: true, 
  get: function() {
  if (this.serverUrl_3sqfvu$_0 == null) 
    return throwUPAE('serverUrl');
  return this.serverUrl_3sqfvu$_0;
}, 
  set: function(serverUrl) {
  this.serverUrl_3sqfvu$_0 = serverUrl;
}});
  var PersonEditPresenter$impl_metadata = new PropertyMetadata('impl');
  Object.defineProperty(PersonEditPresenter.prototype, 'impl_0', {
  configurable: true, 
  get: function() {
  return this.impl_9gfq0e$_0.value;
}});
  Object.defineProperty(PersonEditPresenter.prototype, 'nextDestination_0', {
  configurable: true, 
  get: function() {
  if (this.nextDestination_8xt98n$_0 == null) 
    return throwUPAE('nextDestination');
  return this.nextDestination_8xt98n$_0;
}, 
  set: function(nextDestination) {
  this.nextDestination_8xt98n$_0 = nextDestination;
}});
  Object.defineProperty(PersonEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  PersonEditPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6;
  this.registrationModeFlags_0 = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(PersonEditView$Companion_getInstance().ARG_REGISTRATION_MODE)) != null ? toInt(tmp$) : null) != null ? tmp$_0 : 0;
  this.regViaLink_0 = (tmp$_2 = (tmp$_1 = this.arguments.get_11rb$(PersonEditView$Companion_getInstance().REGISTER_VIA_LINK)) != null ? toBoolean(tmp$_1) : null) != null ? tmp$_2 : false;
  if (this.arguments.containsKey_11rb$(UstadView$Companion_getInstance().ARG_SERVER_URL)) {
    tmp$_4 = getValue(this.arguments, UstadView$Companion_getInstance().ARG_SERVER_URL);
  } else {
    tmp$_4 = (tmp$_3 = this.impl_0.getAppConfigString(AppConfig_getInstance().KEY_API_URL, 'http://localhost', this.context)) != null ? tmp$_3 : '';
  }
  this.serverUrl_0 = tmp$_4;
  this.nextDestination_0 = (tmp$_6 = (tmp$_5 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_NEXT)) != null ? tmp$_5 : this.impl_0.getAppConfigString(AppConfig_getInstance().KEY_FIRST_DEST, ContentEntryList2View$Companion_getInstance().VIEW_NAME, this.context)) != null ? tmp$_6 : ContentEntryList2View$Companion_getInstance().VIEW_NAME;
  this.view.registrationMode = this.registrationModeFlags_0;
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
  this.view.genderOptions = listOf([new MessageIdOption(2049, this.context, 1, this.di), new MessageIdOption(2048, this.context, 2, this.di), new MessageIdOption(2050, this.context, 4, this.di)]);
};
  function Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda;
  Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        var $receiver = this.local$closure$db;
        if ((tmp$_0 = (tmp$ = !equals(this.local$closure$entityUid, L0) ? $receiver : null) != null ? tmp$.personDao : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_0.findPersonAccountByUid(this.local$closure$entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 PersonEditPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda_0(closure$entityUid_0, dbToUse_0, f_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$dbToUse = dbToUse_0;
  }
  Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda_0.prototype.constructor = Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda_0;
  Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if ((tmp$_0 = (tmp$ = !equals(this.local$closure$entityUid, L0) ? this.local$dbToUse : null) != null ? tmp$.personPictureDao : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_0.findByPersonUidAsync_s8cxhz$(this.local$closure$entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 PersonEditPresenter$onLoadEntityFromDb$lambda_0(closure$entityUid_0) {
    return function(dbToUse_0, f_0, continuation_0, suspended) {
  var instance = new Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda_0(closure$entityUid_0, dbToUse_0, f_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda_1(closure$db_0, closure$loggedInPersonUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$loggedInPersonUid = closure$loggedInPersonUid_0;
  }
  Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda_1.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda_1.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda_1.prototype.constructor = Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda_1;
  Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda_1.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$closure$db.personDao.findByUidAsync_s8cxhz$(this.local$closure$loggedInPersonUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 PersonEditPresenter$onLoadEntityFromDb$lambda_1(closure$db_0, closure$loggedInPersonUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$PersonEditPresenter$onLoadEntityFromDb$lambda_1(closure$db_0, closure$loggedInPersonUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_19($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$_3 = void 0;
    this.local$entityUid = void 0;
    this.local$person = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_19.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_19.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_19.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_19;
  Coroutine$onLoadEntityFromDb_7hogkd$_19.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2;
        this.local$entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = withTimeoutOrNull(L2000, PersonEditPresenter$onLoadEntityFromDb$lambda(this.local$db, this.local$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var tmp$_3;
        if ((tmp$_1 = this.result_0) != null) 
          tmp$_3 = tmp$_1;
        else {
          var $receiver = new PersonWithAccount();
          var tmp$_4, tmp$_5;
          $receiver.dateOfBirth = (tmp$_5 = (tmp$_4 = this.$this.arguments.get_11rb$(PersonEditView$Companion_getInstance().ARG_DATE_OF_BIRTH)) != null ? toLong(tmp$_4) : null) != null ? tmp$_5 : L0;
          tmp$_3 = $receiver;
        }
        this.local$person = tmp$_3;
        this.local$tmp$_3 = this.$this.view;
        this.state_0 = 3;
        this.result_0 = onDbThenRepoWithTimeout(this.local$db, L2000, PersonEditPresenter$onLoadEntityFromDb$lambda_0(this.local$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$tmp$_3.personPicture = (tmp$_2 = this.result_0) != null ? tmp$_2 : new PersonPicture();
        if (hasFlag(this.$this.registrationModeFlags_0, 2) && !Kotlin.isType(this.local$db, DoorDatabaseRepository)) {
          this.$this.mPersonParentJoin_8be2vx$ = new PersonParentJoin();
          this.$this.view.approvalPersonParentJoin = this.$this.mPersonParentJoin_8be2vx$;
        }
        var loggedInPersonUid = this.$this.accountManager.activeAccount.personUid;
        this.state_0 = 4;
        this.result_0 = withTimeoutOrNull(L2000, PersonEditPresenter$onLoadEntityFromDb$lambda_1(this.local$db, loggedInPersonUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.$this.loggedInPerson_0 = this.result_0;
        return this.local$person;
      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);
};
  PersonEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_19(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  PersonEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = PersonWithAccount.Companion.serializer();
    var tmp$_0;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    tmp$ = new PersonWithAccount();
  }
  return tmp$;
};
  PersonEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  PersonEditPresenter.prototype.hasErrors_0 = function($receiver) {
  return $receiver.usernameError != null || $receiver.passwordError != null || $receiver.confirmError != null || $receiver.dateOfBirthError != null || $receiver.noMatchPasswordError != null || $receiver.firstNamesFieldError != null || $receiver.lastNameFieldError != null || $receiver.genderFieldError != null || $receiver.firstNameError != null || $receiver.lastNameError != null || $receiver.emailError != null || $receiver.parentContactError != null;
};
  function Coroutine$PersonEditPresenter$handleClickSave$lambda$lambda(closure$entity_0, this$PersonEditPresenter_0, txRepo_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$PersonEditPresenter = this$PersonEditPresenter_0;
    this.local$txRepo = txRepo_0;
  }
  Coroutine$PersonEditPresenter$handleClickSave$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$PersonEditPresenter$handleClickSave$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$PersonEditPresenter$handleClickSave$lambda$lambda.prototype.constructor = Coroutine$PersonEditPresenter$handleClickSave$lambda$lambda;
  Coroutine$PersonEditPresenter$handleClickSave$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (equals(this.local$closure$entity.personUid, L0)) {
          this.state_0 = 3;
          this.result_0 = insertPersonAndGroup(this.local$txRepo, this.local$closure$entity, void 0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 2;
          this.result_0 = this.local$txRepo.personDao.updateAsync_6c9i1n$(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 4;
        continue;
      case 3:
        var personWithGroup = this.result_0;
        this.local$closure$entity.personGroupUid = personWithGroup.personGroupUid;
        this.local$closure$entity.personUid = personWithGroup.personUid;
        this.state_0 = 4;
        continue;
      case 4:
        var dateBirthDateTime = DateTime.Companion.invoke_s8cxhz$(this.local$closure$entity.dateOfBirth);
        if (age(dateBirthDateTime) < UstadMobileConstants_getInstance().MINOR_AGE_THRESHOLD) {
          this.state_0 = 5;
          this.result_0 = this.local$txRepo.personParentJoinDao.isMinorApproved_s8cxhz$(this.local$closure$entity.personUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 8;
          continue;
        }
      case 5:
        var approved = this.result_0;
        if (!approved) {
          var tmp$ = this.local$txRepo.personParentJoinDao;
          var $receiver = new PersonParentJoin();
          var closure$entity = this.local$closure$entity;
          var this$PersonEditPresenter = this.local$this$PersonEditPresenter;
          $receiver.ppjMinorPersonUid = closure$entity.personUid;
          $receiver.ppjParentPersonUid = this$PersonEditPresenter.accountManager.activeAccount.personUid;
          $receiver.ppjStatus = 1;
          $receiver.ppjApprovalTiemstamp = systemTimeInMillis();
          this.state_0 = 6;
          this.result_0 = tmp$.insertAsync_ei4fsf$($receiver, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 7;
          continue;
        }
      case 6:
        return Unit;
      case 7:
        this.state_0 = 8;
        continue;
      case 8:
        return Unit;
      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 PersonEditPresenter$handleClickSave$lambda$lambda(closure$entity_0, this$PersonEditPresenter_0) {
    return function(txRepo_0, continuation_0, suspended) {
  var instance = new Coroutine$PersonEditPresenter$handleClickSave$lambda$lambda(closure$entity_0, this$PersonEditPresenter_0, txRepo_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$PersonEditPresenter$handleClickSave$lambda(this$PersonEditPresenter_0, closure$entity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 19;
    this.local$this$PersonEditPresenter = this$PersonEditPresenter_0;
    this.local$closure$entity = closure$entity_0;
    this.local$requiredFieldMessage = void 0;
  }
  Coroutine$PersonEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$PersonEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$PersonEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$PersonEditPresenter$handleClickSave$lambda;
  Coroutine$PersonEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6, tmp$_7, tmp$_8, tmp$_9, tmp$_10, tmp$_11, tmp$_12;
        this.local$this$PersonEditPresenter.view.usernameError = null;
        this.local$this$PersonEditPresenter.view.passwordError = null;
        this.local$this$PersonEditPresenter.view.emailError = null;
        this.local$this$PersonEditPresenter.view.confirmError = null;
        this.local$this$PersonEditPresenter.view.dateOfBirthError = null;
        this.local$this$PersonEditPresenter.view.noMatchPasswordError = null;
        this.local$this$PersonEditPresenter.view.parentContactError = null;
        this.local$this$PersonEditPresenter.view.firstNamesFieldError = null;
        this.local$this$PersonEditPresenter.view.lastNameFieldError = null;
        this.local$this$PersonEditPresenter.view.genderFieldError = null;
        this.local$requiredFieldMessage = this.local$this$PersonEditPresenter.impl_0.getString(2127, this.local$this$PersonEditPresenter.context);
        var formatError = this.local$this$PersonEditPresenter.impl_0.getString(2705, this.local$this$PersonEditPresenter.context);
        var $receiver = this.local$this$PersonEditPresenter.view;
        var $receiver_0 = this.local$closure$entity.firstNames;
                (tmp$ = $receiver_0 == null || $receiver_0.length === 0 ? $receiver : null) != null ? (tmp$.firstNamesFieldError = this.local$requiredFieldMessage) : null;
        var $receiver_1 = this.local$this$PersonEditPresenter.view;
        var $receiver_2 = this.local$closure$entity.lastName;
                (tmp$_0 = $receiver_2 == null || $receiver_2.length === 0 ? $receiver_1 : null) != null ? (tmp$_0.lastNameFieldError = this.local$requiredFieldMessage) : null;
        var $receiver_3 = this.local$this$PersonEditPresenter.view;
                (tmp$_1 = this.local$closure$entity.gender === 0 ? $receiver_3 : null) != null ? (tmp$_1.genderFieldError = this.local$requiredFieldMessage) : null;
        if (this.local$closure$entity.gender !== 0) {
          this.local$this$PersonEditPresenter.view.genderFieldError = null;
        }
        this.local$this$PersonEditPresenter.view.firstNameError = null;
        this.local$this$PersonEditPresenter.view.lastNameError = null;
        var email = (tmp$_2 = this.local$closure$entity.emailAddr) != null ? tmp$_2 : '';
        if (email.length > 0 && !validEmail(email)) {
          this.local$this$PersonEditPresenter.view.emailError = formatError;
        }
        var $receiver_4 = this.local$this$PersonEditPresenter.view;
        var $receiver_5 = this.local$closure$entity.firstNames;
                (tmp$_3 = $receiver_5 == null || $receiver_5.length === 0 ? $receiver_4 : null) != null ? (tmp$_3.firstNameError = this.local$requiredFieldMessage) : null;
        var $receiver_6 = this.local$this$PersonEditPresenter.view;
        var $receiver_7 = this.local$closure$entity.lastName;
                (tmp$_4 = $receiver_7 == null || $receiver_7.length === 0 ? $receiver_6 : null) != null ? (tmp$_4.lastNameError = this.local$requiredFieldMessage) : null;
        if (this.local$this$PersonEditPresenter.hasErrors_0(this.local$this$PersonEditPresenter.view)) {
          this.local$this$PersonEditPresenter.view.loading = false;
          this.local$this$PersonEditPresenter.view.fieldsEnabled = true;
          return;
        } else {
          this.state_0 = 1;
          continue;
        }
      case 1:
        if (hasFlag(this.local$this$PersonEditPresenter.registrationModeFlags_0, 1)) {
          var $receiver_8 = this.local$this$PersonEditPresenter.view;
          var $receiver_9 = this.local$closure$entity.username;
                    (tmp$_5 = $receiver_9 == null || $receiver_9.length === 0 ? $receiver_8 : null) != null ? (tmp$_5.usernameError = this.local$requiredFieldMessage) : null;
          var $receiver_10 = this.local$this$PersonEditPresenter.view;
          var $receiver_11 = this.local$closure$entity.newPassword;
                    (tmp$_6 = $receiver_11 == null || $receiver_11.length === 0 ? $receiver_10 : null) != null ? (tmp$_6.passwordError = this.local$requiredFieldMessage) : null;
          var $receiver_12 = this.local$this$PersonEditPresenter.view;
          var $receiver_13 = this.local$closure$entity.confirmedPassword;
                    (tmp$_7 = $receiver_13 == null || $receiver_13.length === 0 ? $receiver_12 : null) != null ? (tmp$_7.confirmError = this.local$requiredFieldMessage) : null;
          if (!hasFlag(this.local$this$PersonEditPresenter.registrationModeFlags_0, 2)) 
            tmp$_8 = 0;
          else {
            var tmp$_13;
            var $receiver_14 = (tmp$_13 = this.local$this$PersonEditPresenter.mPersonParentJoin_8be2vx$) != null ? tmp$_13.ppjEmail : null;
            if ($receiver_14 == null || isBlank($receiver_14)) 
              tmp$_8 = 2127;
            else {
              var tmp$_14, tmp$_15;
              if (((tmp$_15 = (tmp$_14 = this.local$this$PersonEditPresenter.mPersonParentJoin_8be2vx$) != null ? tmp$_14.ppjEmail : null) != null ? validEmail(tmp$_15) : null) !== true) 
                tmp$_8 = 2705;
              else 
                tmp$_8 = 0;
            }
          }
          var parentEmailError = tmp$_8;
          var $receiver_15 = this.local$this$PersonEditPresenter.view;
                    (tmp$_9 = parentEmailError !== 0 ? $receiver_15 : null) != null ? (tmp$_9.parentContactError = this.local$this$PersonEditPresenter.systemImpl.getString(parentEmailError, this.local$this$PersonEditPresenter.context)) : null;
          var $receiver_16 = this.local$this$PersonEditPresenter.view;
                    (tmp$_10 = equals(this.local$closure$entity.dateOfBirth, L0) ? $receiver_16 : null) != null ? (tmp$_10.dateOfBirthError = this.local$requiredFieldMessage) : null;
          var $receiver_17 = this.local$this$PersonEditPresenter.view;
          var closure$entity = this.local$closure$entity;
                    (tmp$_11 = !equals(closure$entity.confirmedPassword, closure$entity.newPassword) ? $receiver_17 : null) != null ? (tmp$_11.noMatchPasswordError = this.local$this$PersonEditPresenter.impl_0.getString(2129, this.local$this$PersonEditPresenter.context)) : null;
          if (this.local$this$PersonEditPresenter.hasErrors_0(this.local$this$PersonEditPresenter.view)) {
            this.local$this$PersonEditPresenter.view.loading = false;
            this.local$this$PersonEditPresenter.view.fieldsEnabled = true;
            return;
          } else {
            this.state_0 = 8;
            continue;
          }
        } else {
          this.state_0 = 2;
          this.result_0 = withDoorTransactionAsync(this.local$this$PersonEditPresenter.repo, getKClass(UmAppDatabase), PersonEditPresenter$handleClickSave$lambda$lambda(this.local$closure$entity, this.local$this$PersonEditPresenter), this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 2:
        var personPictureVal = this.local$this$PersonEditPresenter.view.personPicture;
        if (personPictureVal != null) {
          personPictureVal.personPicturePersonUid = this.local$closure$entity.personUid;
          if (equals(personPictureVal.personPictureUid, L0)) {
            this.state_0 = 4;
            this.result_0 = this.local$this$PersonEditPresenter.repo.personPictureDao.insertAsync(personPictureVal, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 3;
            this.result_0 = this.local$this$PersonEditPresenter.repo.personPictureDao.updateAsync_c8xyxp$(personPictureVal, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          }
        } else {
          this.state_0 = 6;
          continue;
        }
      case 3:
        this.state_0 = 5;
        continue;
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        this.state_0 = 6;
        continue;
      case 6:
        if (this.local$this$PersonEditPresenter.arguments.containsKey_11rb$(UstadView$Companion_getInstance().ARG_GO_TO_COMPLETE)) {
          return this.local$this$PersonEditPresenter.systemImpl.go_gofqk3$(toString(this.local$this$PersonEditPresenter.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_GO_TO_COMPLETE)), plus_2(this.local$this$PersonEditPresenter.arguments, to(UstadView$Companion_getInstance().ARG_PERSON_UID, this.local$closure$entity.personUid.toString())), this.local$this$PersonEditPresenter.context) , Unit;
        } else {
          return this.local$this$PersonEditPresenter.onFinish_xcg1s8$(PersonDetailView$Companion_getInstance().VIEW_NAME, this.local$closure$entity.personUid, this.local$closure$entity, PersonWithAccount.Companion.serializer()) , Unit;
        }
      case 7:
        this.state_0 = 18;
        continue;
      case 8:
        this.exceptionState_0 = 13;
        this.state_0 = 9;
        this.result_0 = this.local$this$PersonEditPresenter.accountManager.register_y55c4w$(this.local$closure$entity, this.local$this$PersonEditPresenter.serverUrl_0, new AccountRegisterOptions(!hasFlag(this.local$this$PersonEditPresenter.registrationModeFlags_0, 2), this.local$this$PersonEditPresenter.mPersonParentJoin_8be2vx$), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 9:
        var popUpToViewName = (tmp$_12 = this.local$this$PersonEditPresenter.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_POPUPTO_ON_FINISH)) != null ? tmp$_12 : UstadView$Companion_getInstance().CURRENT_DEST;
        if (hasFlag(this.local$this$PersonEditPresenter.registrationModeFlags_0, 2)) {
          var goOptions = new UstadMobileSystemCommon$UstadGoOptions(RegisterAgeRedirectView$Companion_getInstance().VIEW_NAME, true);
          this.local$this$PersonEditPresenter.nextDestination_0 = 'RegisterMinorWaitForParent';
          var $receiver_18 = LinkedHashMap_init();
          var closure$entity_0 = this.local$closure$entity;
          var this$PersonEditPresenter = this.local$this$PersonEditPresenter;
          var tmp$_16, tmp$_17, tmp$_18, tmp$_19;
          var key = RegisterMinorWaitForParentView$Companion_getInstance().ARG_USERNAME;
          var value = (tmp$_16 = closure$entity_0.username) != null ? tmp$_16 : '';
          $receiver_18.put_xwzc9p$(key, value);
          var key_0 = RegisterMinorWaitForParentView$Companion_getInstance().ARG_PARENT_CONTACT;
          var value_0 = (tmp$_18 = (tmp$_17 = this$PersonEditPresenter.mPersonParentJoin_8be2vx$) != null ? tmp$_17.ppjEmail : null) != null ? tmp$_18 : '';
          $receiver_18.put_xwzc9p$(key_0, value_0);
          var key_1 = RegisterMinorWaitForParentView$Companion_getInstance().ARG_PASSWORD;
          var value_1 = (tmp$_19 = closure$entity_0.newPassword) != null ? tmp$_19 : '';
          $receiver_18.put_xwzc9p$(key_1, value_1);
          putFromOtherMapIfPresent($receiver_18, this$PersonEditPresenter.arguments, UstadView$Companion_getInstance().ARG_POPUPTO_ON_FINISH);
          var args = $receiver_18;
          this.exceptionState_0 = 19;
          this.finallyPath_0 = [11];
          this.state_0 = 16;
          this.$returnValue = (this.local$this$PersonEditPresenter.impl_0.go_henhri$(RegisterMinorWaitForParentView$Companion_getInstance().VIEW_NAME, args, this.local$this$PersonEditPresenter.context, goOptions) , Unit);
          continue;
        } else {
          var goOptions_0 = new UstadMobileSystemCommon$UstadGoOptions(popUpToViewName, true);
          this.exceptionState_0 = 19;
          this.finallyPath_0 = [10];
          this.state_0 = 16;
          this.$returnValue = (this.local$this$PersonEditPresenter.impl_0.go_henhri$(this.local$this$PersonEditPresenter.nextDestination_0, emptyMap(), this.local$this$PersonEditPresenter.context, goOptions_0) , Unit);
          continue;
        }
      case 10:
        return this.$returnValue;
      case 11:
        return this.$returnValue;
      case 12:
        this.exceptionState_0 = 19;
        this.finallyPath_0 = [17];
        this.state_0 = 16;
        continue;
      case 13:
        this.finallyPath_0 = [19];
        this.exceptionState_0 = 16;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          if (Kotlin.isType(e, IllegalStateException)) {
            this.local$this$PersonEditPresenter.view.usernameError = this.local$this$PersonEditPresenter.impl_0.getString(2637, this.local$this$PersonEditPresenter.context);
          } else {
            this.local$this$PersonEditPresenter.view.showSnackBar_9pu0dj$(this.local$this$PersonEditPresenter.impl_0.getString(2010, this.local$this$PersonEditPresenter.context));
          }
          this.exceptionState_0 = 19;
          this.finallyPath_0 = [14];
          this.state_0 = 16;
          continue;
        } else {
          throw e;
        }
      case 14:
        return;
      case 15:
        this.finallyPath_0 = [17];
        this.state_0 = 16;
        continue;
      case 16:
        this.exceptionState_0 = 19;
        this.local$this$PersonEditPresenter.view.loading = false;
        this.local$this$PersonEditPresenter.view.fieldsEnabled = true;
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 17:
        this.state_0 = 18;
        continue;
      case 18:
        return;
      case 19:
        throw this.exception_0;
      default:
        this.state_0 = 19;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 19) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function PersonEditPresenter$handleClickSave$lambda(this$PersonEditPresenter_0, closure$entity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$PersonEditPresenter$handleClickSave$lambda(this$PersonEditPresenter_0, closure$entity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  PersonEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  this.view.loading = true;
  this.view.fieldsEnabled = false;
  launch(this.presenterScope, void 0, void 0, PersonEditPresenter$handleClickSave$lambda(this, entity));
};
  PersonEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'PersonEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function PersonGroupEditPresenter(context, arguments_0, view, lifecycleOwner, di) {
    PersonGroupEditPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(PersonGroupEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  throw new NotImplementedError_init('An operation is not implemented: ' + 'PERSISTENCE_MODE.DB OR PERSISTENCE_MODE.JSON');
}});
  PersonGroupEditPresenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
};
  PersonGroupEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db, continuation) {
  var tmp$, tmp$_0;
  var entityUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  throw new NotImplementedError_init('An operation is not implemented: ' + 'Implement load from Database or return null if using PERSISTENCE_MODE.JSON');
};
  PersonGroupEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  var editEntity = null;
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = PersonGroup.Companion.serializer();
    var tmp$_0;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    tmp$ = new PersonGroup();
  }
  editEntity = tmp$;
  return editEntity;
};
  PersonGroupEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  function Coroutine$PersonGroupEditPresenter$handleClickSave$lambda(closure$entity_0, this$PersonGroupEditPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$PersonGroupEditPresenter = this$PersonGroupEditPresenter_0;
    this.local$tmp$ = void 0;
  }
  Coroutine$PersonGroupEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$PersonGroupEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$PersonGroupEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$PersonGroupEditPresenter$handleClickSave$lambda;
  Coroutine$PersonGroupEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (equals(this.local$closure$entity.groupUid, L0)) {
          this.local$tmp$ = this.local$closure$entity;
          this.state_0 = 3;
          this.result_0 = this.local$this$PersonGroupEditPresenter.repo.personGroupDao.insertAsync(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 2;
          this.result_0 = this.local$this$PersonGroupEditPresenter.repo.personGroupDao.updateAsync_j5378c$(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 4;
        continue;
      case 3:
        this.local$tmp$.groupUid = this.result_0;
        this.state_0 = 4;
        continue;
      case 4:
        var tmp$ = this.local$this$PersonGroupEditPresenter;
        var di = this.local$this$PersonGroupEditPresenter.di;
        var strategy = ListSerializer(PersonGroup.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_0;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
        return tmp$.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity)) , Unit;
      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 PersonGroupEditPresenter$handleClickSave$lambda(closure$entity_0, this$PersonGroupEditPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$PersonGroupEditPresenter$handleClickSave$lambda(closure$entity_0, this$PersonGroupEditPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  PersonGroupEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, PersonGroupEditPresenter$handleClickSave$lambda(entity, this));
};
  function PersonGroupEditPresenter$Companion() {
    PersonGroupEditPresenter$Companion_instance = this;
  }
  PersonGroupEditPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var PersonGroupEditPresenter$Companion_instance = null;
  function PersonGroupEditPresenter$Companion_getInstance() {
    if (PersonGroupEditPresenter$Companion_instance === null) {
      new PersonGroupEditPresenter$Companion();
    }
    return PersonGroupEditPresenter$Companion_instance;
  }
  PersonGroupEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'PersonGroupEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function PersonGroupListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.currentSortOrder = PersonGroupListPresenter$SortOrder$ORDER_NAME_ASC_getInstance();
  }
  function PersonGroupListPresenter$SortOrder(name, ordinal, messageId) {
    Enum.call(this);
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function PersonGroupListPresenter$SortOrder_initFields() {
    PersonGroupListPresenter$SortOrder_initFields = function() {
};
    PersonGroupListPresenter$SortOrder$ORDER_NAME_ASC_instance = new PersonGroupListPresenter$SortOrder('ORDER_NAME_ASC', 0, 2367);
    PersonGroupListPresenter$SortOrder$ORDER_NAME_DSC_instance = new PersonGroupListPresenter$SortOrder('ORDER_NAME_DSC', 1, 2368);
  }
  var PersonGroupListPresenter$SortOrder$ORDER_NAME_ASC_instance;
  function PersonGroupListPresenter$SortOrder$ORDER_NAME_ASC_getInstance() {
    PersonGroupListPresenter$SortOrder_initFields();
    return PersonGroupListPresenter$SortOrder$ORDER_NAME_ASC_instance;
  }
  var PersonGroupListPresenter$SortOrder$ORDER_NAME_DSC_instance;
  function PersonGroupListPresenter$SortOrder$ORDER_NAME_DSC_getInstance() {
    PersonGroupListPresenter$SortOrder_initFields();
    return PersonGroupListPresenter$SortOrder$ORDER_NAME_DSC_instance;
  }
  PersonGroupListPresenter$SortOrder.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SortOrder', 
  interfaces: [Enum]};
  function PersonGroupListPresenter$SortOrder$values() {
    return [PersonGroupListPresenter$SortOrder$ORDER_NAME_ASC_getInstance(), PersonGroupListPresenter$SortOrder$ORDER_NAME_DSC_getInstance()];
  }
  PersonGroupListPresenter$SortOrder.values = PersonGroupListPresenter$SortOrder$values;
  function PersonGroupListPresenter$SortOrder$valueOf(name) {
    switch (name) {
      case 'ORDER_NAME_ASC':
        return PersonGroupListPresenter$SortOrder$ORDER_NAME_ASC_getInstance();
      case 'ORDER_NAME_DSC':
        return PersonGroupListPresenter$SortOrder$ORDER_NAME_DSC_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.PersonGroupListPresenter.SortOrder.' + name);
    }
  }
  PersonGroupListPresenter$SortOrder.valueOf_61zpoe$ = PersonGroupListPresenter$SortOrder$valueOf;
  function PersonGroupListPresenter$PersonGroupListSortOption(sortOrder, context, di) {
    MessageIdOption.call(this, sortOrder.messageId, context, void 0, di);
    this.sortOrder = sortOrder;
  }
  PersonGroupListPresenter$PersonGroupListSortOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'PersonGroupListSortOption', 
  interfaces: [MessageIdOption]};
  PersonGroupListPresenter.prototype.onCreate = function(savedState) {
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.updateListOnView_0();
  var tmp$ = this.view;
  var $receiver = toList_0(PersonGroupListPresenter$SortOrder$values());
  var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
  var tmp$_0;
  tmp$_0 = $receiver.iterator();
  while (tmp$_0.hasNext()) {
    var item = tmp$_0.next();
    destination.add_11rb$(new PersonGroupListPresenter$PersonGroupListSortOption(item, this.context, this.di));
  }
  tmp$.sortOptions = destination;
};
  PersonGroupListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  return true;
};
  PersonGroupListPresenter.prototype.updateListOnView_0 = function() {
};
  PersonGroupListPresenter.prototype.handleClickEntry_11rc$ = function(entry) {
  switch (this.mListMode.name) {
    case 'PICKER':
      var di = this.di;
      var strategy = ListSerializer(PersonGroup.Companion.serializer());
      var entity = listOf_0(entry);
      var tmp$;
      var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
      this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
      break;
    case 'BROWSER':
      this.systemImpl.go_gofqk3$(PersonGroupEditView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, entry.groupUid.toString())), this.context);
      break;
  }
};
  PersonGroupListPresenter.prototype.handleClickCreateNewFab = function() {
  this.systemImpl.go_gofqk3$(PersonGroupEditView$Companion_getInstance().VIEW_NAME, emptyMap(), this.context);
};
  PersonGroupListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
};
  PersonGroupListPresenter.prototype.handleClickSortOrder_iowaj7$ = function(sortOption) {
  var tmp$, tmp$_0, tmp$_1;
  tmp$_1 = (tmp$_0 = Kotlin.isType(tmp$ = sortOption, PersonGroupListPresenter$PersonGroupListSortOption) ? tmp$ : null) != null ? tmp$_0.sortOrder : null;
  if (tmp$_1 == null) {
    return;
  }
  var sortOrder = tmp$_1;
  if (sortOrder !== this.currentSortOrder) {
    this.currentSortOrder = sortOrder;
    this.updateListOnView_0();
  }
};
  PersonGroupListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'PersonGroupListPresenter', 
  interfaces: [UstadListPresenter]};
  function Runnable$ObjectLiteral_1(closure$block) {
    this.closure$block = closure$block;
  }
  Runnable$ObjectLiteral_1.prototype.run = function() {
  this.closure$block();
};
  Runnable$ObjectLiteral_1.$metadata$ = {
  kind: Kind_CLASS, 
  interfaces: [Runnable]};
  function PersonListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    PersonListPresenter$Companion_getInstance();
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.filterExcludeMembersOfClazz_0 = L0;
    this.filterExcludeMemberOfSchool_0 = L0;
    this.filterAlreadySelectedList_0 = emptyList();
    this.filterByPermission_0 = L0;
    this.searchText = null;
  }
  Object.defineProperty(PersonListPresenter.prototype, 'sortOptions', {
  configurable: true, 
  get: function() {
  return PersonListPresenter$Companion_getInstance().SORT_OPTIONS;
}});
  PersonListPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6, tmp$_7, tmp$_8, tmp$_9;
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.filterExcludeMembersOfClazz_0 = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(PersonListView$Companion_getInstance().ARG_FILTER_EXCLUDE_MEMBERSOFCLAZZ)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  this.filterExcludeMemberOfSchool_0 = (tmp$_2 = (tmp$_1 = this.arguments.get_11rb$(PersonListView$Companion_getInstance().ARG_FILTER_EXCLUDE_MEMBERSOFSCHOOL)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0;
  var tmp$_10;
  if ((tmp$_4 = (tmp$_3 = this.arguments.get_11rb$(PersonListView$Companion_getInstance().ARG_EXCLUDE_PERSONUIDS_LIST)) != null ? split(tmp$_3, [',']) : null) != null) {
    var destination = ArrayList_init();
    var tmp$_11;
    tmp$_11 = tmp$_4.iterator();
    while (tmp$_11.hasNext()) {
      var element = tmp$_11.next();
      if (element.length > 0) 
        destination.add_11rb$(element);
    }
    tmp$_10 = destination;
  } else 
    tmp$_10 = null;
  var tmp$_12;
  if ((tmp$_5 = tmp$_10) != null) {
    var destination_0 = ArrayList_init_0(collectionSizeOrDefault(tmp$_5, 10));
    var tmp$_13;
    tmp$_13 = tmp$_5.iterator();
    while (tmp$_13.hasNext()) {
      var item = tmp$_13.next();
      var tmp$_14;
      destination_0.add_11rb$(toLong(trim(Kotlin.isCharSequence(tmp$_14 = item) ? tmp$_14 : throwCCE()).toString()));
    }
    tmp$_12 = destination_0;
  } else 
    tmp$_12 = null;
  this.filterAlreadySelectedList_0 = (tmp$_6 = tmp$_12) != null ? tmp$_6 : emptyList();
  var tmp$_15;
  if ((tmp$_7 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_FILTER_BY_PERMISSION)) != null) {
    var tmp$_16;
    tmp$_15 = trim(Kotlin.isCharSequence(tmp$_16 = tmp$_7) ? tmp$_16 : throwCCE()).toString();
  } else 
    tmp$_15 = null;
  this.filterByPermission_0 = (tmp$_9 = (tmp$_8 = tmp$_15) != null ? toLong(tmp$_8) : null) != null ? tmp$_9 : Role$Companion$PERMISSION_PERSON_SELECT;
  this.selectedSortOption = PersonListPresenter$Companion_getInstance().SORT_OPTIONS.get_za3lpa$(0);
  this.updateListOnView_0();
};
  function Coroutine$onCheckAddPermission_tn71rk$_1($this, account_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$_0 = void 0;
    this.local$account = account_0;
  }
  Coroutine$onCheckAddPermission_tn71rk$_1.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onCheckAddPermission_tn71rk$_1.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onCheckAddPermission_tn71rk$_1.prototype.constructor = Coroutine$onCheckAddPermission_tn71rk$_1;
  Coroutine$onCheckAddPermission_tn71rk$_1.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        if (this.$this.arguments.get_11rb$(PersonListPresenter$Companion_getInstance().ARG_HIDE_PERSON_ADD) !== null) {
          this.local$tmp$_0 = false;
          this.state_0 = 3;
          continue;
        } else {
          this.state_0 = 2;
          this.result_0 = this.$this.db.entityRoleDao.userHasTableLevelPermission_3pjtqy$((tmp$ = this.local$account != null ? this.local$account.personUid : null) != null ? tmp$ : L0, Role$Companion$PERMISSION_PERSON_INSERT, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.local$tmp$_0 = this.result_0;
        this.state_0 = 3;
        continue;
      case 3:
        return this.local$tmp$_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);
};
  PersonListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account_0, continuation_0, suspended) {
  var instance = new Coroutine$onCheckAddPermission_tn71rk$_1(this, account_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  PersonListPresenter.prototype.updateListOnView_0 = function() {
  var tmp$, tmp$_0;
  this.view.list = this.repo.personDao.findPersonsWithPermission_gs5uuz$(getSystemTimeInMillis(), this.filterExcludeMembersOfClazz_0, this.filterExcludeMemberOfSchool_0, this.filterAlreadySelectedList_0, this.accountManager.activeAccount.personUid, (tmp$_0 = (tmp$ = this.selectedSortOption) != null ? tmp$.flag : null) != null ? tmp$_0 : 0, toQueryLikeParam(this.searchText));
};
  PersonListPresenter.prototype.handleClickEntry_11rc$ = function(entry) {
  switch (this.mListMode.name) {
    case 'PICKER':
      var goToViewOnComplete = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_GO_TO_COMPLETE);
      if (equals(goToViewOnComplete, ScopedGrantEditView$Companion_getInstance().VIEW_NAME)) {
        var args = plus_2(this.arguments, to(ScopedGrantEditView$Companion_getInstance().ARG_GRANT_TO_GROUPUID, entry.personGroupUid.toString()));
        this.systemImpl.go_gofqk3$(goToViewOnComplete, args, this.context);
      } else if (goToViewOnComplete != null) {
        var args_0 = plus_2(this.arguments, to(UstadView$Companion_getInstance().ARG_PERSON_UID, entry.personUid.toString()));
        this.systemImpl.go_gofqk3$(goToViewOnComplete, args_0, this.context);
      } else {
        var di = this.di;
        var strategy = ListSerializer(Person.Companion.serializer());
        var entity = listOf_0(entry);
        var tmp$;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
        this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
      }
      break;
    case 'BROWSER':
      this.systemImpl.go_gofqk3$(PersonDetailView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, entry.personUid.toString())), this.context);
      break;
  }
};
  PersonListPresenter.prototype.handleClickCreateNewFab = function() {
  this.systemImpl.go_gofqk3$(PersonEditView$Companion_getInstance().VIEW_NAME, emptyMap(), this.context);
};
  PersonListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
  var tmp$;
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, PersonEditView$Companion_getInstance().VIEW_NAME, getKClass(Person), Person.Companion.serializer(), destinationResultKey != null ? destinationResultKey : PersonListPresenter$Companion_getInstance().RESULT_PERSON_KEY, void 0, (tmp$ = args != null ? toMutableMap(args) : null) != null ? tmp$ : toMutableMap(this.arguments)));
};
  PersonListPresenter.prototype.onClickSort_o8nuns$ = function(sortOption) {
  UstadListPresenter.prototype.onClickSort_o8nuns$.call(this, sortOption);
  this.updateListOnView_0();
};
  PersonListPresenter.prototype.onSearchSubmitted_pdl1vj$ = function(text) {
  this.searchText = text;
  this.updateListOnView_0();
};
  function PersonListPresenter$handleClickInviteWithLink$lambda$lambda(this$PersonListPresenter, closure$tableId, closure$code, closure$entityName) {
    return function() {
  this$PersonListPresenter.systemImpl.go_gofqk3$(InviteViaLinkView$Companion_getInstance().VIEW_NAME, mapOf([to(UstadView$Companion_getInstance().ARG_CODE_TABLE, closure$tableId.toString()), to(UstadView$Companion_getInstance().ARG_CODE, closure$code), to(UstadView$Companion_getInstance().ARG_ENTITY_NAME, closure$entityName)]), this$PersonListPresenter.context);
  return Unit;
};
  }
  function Coroutine$PersonListPresenter$handleClickInviteWithLink$lambda(this$PersonListPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$PersonListPresenter = this$PersonListPresenter_0;
    this.local$code = void 0;
    this.local$entityName = void 0;
    this.local$tableId = void 0;
  }
  Coroutine$PersonListPresenter$handleClickInviteWithLink$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$PersonListPresenter$handleClickInviteWithLink$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$PersonListPresenter$handleClickInviteWithLink$lambda.prototype.constructor = Coroutine$PersonListPresenter$handleClickInviteWithLink$lambda;
  Coroutine$PersonListPresenter$handleClickInviteWithLink$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (!equals(this.local$this$PersonListPresenter.filterExcludeMembersOfClazz_0, L0)) {
          this.state_0 = 4;
          this.result_0 = this.local$this$PersonListPresenter.db.clazzDao.findByUidAsync_s8cxhz$(this.local$this$PersonListPresenter.filterExcludeMembersOfClazz_0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          if (!equals(this.local$this$PersonListPresenter.filterExcludeMemberOfSchool_0, L0)) {
            this.state_0 = 2;
            this.result_0 = this.local$this$PersonListPresenter.db.schoolDao.findByUidAsync_s8cxhz$(this.local$this$PersonListPresenter.filterExcludeMemberOfSchool_0, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.local$code = '';
            this.local$entityName = '';
            this.local$tableId = 0;
            this.state_0 = 3;
            continue;
          }
        }
      case 1:
        throw this.exception_0;
      case 2:
        var school = this.result_0;
        this.local$code = school != null ? school.schoolCode : null;
        this.local$entityName = school != null ? school.schoolName : null;
        this.local$tableId = 164;
        this.state_0 = 3;
        continue;
      case 3:
        this.state_0 = 5;
        continue;
      case 4:
        var clazz = this.result_0;
        this.local$code = clazz != null ? clazz.clazzCode : null;
        this.local$entityName = clazz != null ? clazz.clazzName : null;
        this.local$tableId = 6;
        this.state_0 = 5;
        continue;
      case 5:
        return this.local$this$PersonListPresenter.view.runOnUiThread_9ywmpy$(new Runnable$ObjectLiteral_1(PersonListPresenter$handleClickInviteWithLink$lambda$lambda(this.local$this$PersonListPresenter, this.local$tableId, this.local$code, this.local$entityName))) , Unit;
      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 PersonListPresenter$handleClickInviteWithLink$lambda(this$PersonListPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$PersonListPresenter$handleClickInviteWithLink$lambda(this$PersonListPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  PersonListPresenter.prototype.handleClickInviteWithLink = function() {
  launch(coroutines.GlobalScope, void 0, void 0, PersonListPresenter$handleClickInviteWithLink$lambda(this));
};
  function PersonListPresenter$Companion() {
    PersonListPresenter$Companion_instance = this;
    this.SORT_OPTIONS = listOf([new SortOrderOption(2038, 1, true), new SortOrderOption(2038, 2, false), new SortOrderOption(2037, 3, true), new SortOrderOption(2037, 4, false)]);
    this.RESULT_PERSON_KEY = 'Person';
    this.ARG_HIDE_PERSON_ADD = 'ArgHidePersonAdd';
  }
  PersonListPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var PersonListPresenter$Companion_instance = null;
  function PersonListPresenter$Companion_getInstance() {
    if (PersonListPresenter$Companion_instance === null) {
      new PersonListPresenter$Companion();
    }
    return PersonListPresenter$Companion_instance;
  }
  PersonListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'PersonListPresenter', 
  interfaces: [UstadListPresenter, OnSearchSubmitted, OnSortOptionSelected]};
  function RedirectPresenter(context, arguments_0, view, di) {
    UstadBaseController.call(this, context, arguments_0, view, di);
    var tmp$;
    this.systemImpl_4x4752$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, RedirectPresenter$systemImpl_metadata);
    var tmp$_0;
    this.accountManager_p47x11$_0 = Instance(this, Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, RedirectPresenter$accountManager_metadata);
  }
  var RedirectPresenter$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(RedirectPresenter.prototype, 'systemImpl', {
  configurable: true, 
  get: function() {
  return this.systemImpl_4x4752$_0.value;
}});
  var RedirectPresenter$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(RedirectPresenter.prototype, 'accountManager', {
  configurable: true, 
  get: function() {
  return this.accountManager_p47x11$_0.value;
}});
  function RedirectPresenter$onCreate$lambda(closure$deepLink) {
    return function() {
  return 'Redirect: Go to deep link: ' + toString(closure$deepLink);
};
  }
  function RedirectPresenter$onCreate$lambda_0(closure$nextViewArg) {
    return function() {
  return 'Redirect: Go to nextViewArg: ' + toString(closure$nextViewArg);
};
  }
  function RedirectPresenter$onCreate$lambda_1() {
    return 'Redirect: go to ContentEntryListHome';
  }
  function RedirectPresenter$onCreate$lambda_2() {
    return 'Redirect: go to start new user session';
  }
  function Coroutine$RedirectPresenter$onCreate$lambda(this$RedirectPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$RedirectPresenter = this$RedirectPresenter_0;
  }
  Coroutine$RedirectPresenter$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$RedirectPresenter$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$RedirectPresenter$onCreate$lambda.prototype.constructor = Coroutine$RedirectPresenter$onCreate$lambda;
  Coroutine$RedirectPresenter$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$RedirectPresenter.navigateToStartNewUserSession(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 RedirectPresenter$onCreate$lambda_3(this$RedirectPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$RedirectPresenter$onCreate$lambda(this$RedirectPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  RedirectPresenter.prototype.onCreate = function(savedState) {
  UstadBaseController.prototype.onCreate.call(this, savedState);
  var nextViewArg = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_NEXT);
  var deepLink = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_DEEPLINK);
  if ((deepLink != null ? deepLink.length > 0 : null) === true) {
    napier.Napier.d_9h2hdn$(void 0, void 0, RedirectPresenter$onCreate$lambda(deepLink));
    this.systemImpl.goToDeepLink_dfpk30$(deepLink, this.accountManager, this.context);
  } else if (nextViewArg != null) {
    napier.Napier.d_9h2hdn$(void 0, void 0, RedirectPresenter$onCreate$lambda_0(nextViewArg));
    this.systemImpl.goToViewLink_yzvld8$(nextViewArg, this.context);
  } else if (this.accountManager.activeSession != null) {
    napier.Napier.d_9h2hdn$(void 0, void 0, RedirectPresenter$onCreate$lambda_1);
    this.systemImpl.setAppPref_5pkmrg$(RedirectView$Companion_getInstance().TAG_REDIRECTED, 'true', this.context);
    this.systemImpl.goToViewLink_yzvld8$(ContentEntryList2View$Companion_getInstance().VIEW_NAME_HOME, this.context);
  } else {
    napier.Napier.d_9h2hdn$(void 0, void 0, RedirectPresenter$onCreate$lambda_2);
    launch(this.presenterScope, void 0, void 0, RedirectPresenter$onCreate$lambda_3(this));
  }
};
  RedirectPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'RedirectPresenter', 
  interfaces: [UstadBaseController]};
  function RegisterAgeRedirectPresenter(context, arguments_0, view, di) {
    UstadBaseController.call(this, context, arguments_0, view, di, false);
    var tmp$;
    this.systemImpl_hk5y8g$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, RegisterAgeRedirectPresenter$systemImpl_metadata);
  }
  var RegisterAgeRedirectPresenter$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(RegisterAgeRedirectPresenter.prototype, 'systemImpl', {
  configurable: true, 
  get: function() {
  return this.systemImpl_hk5y8g$_0.value;
}});
  RegisterAgeRedirectPresenter.prototype.onCreate = function(savedState) {
  UstadBaseController.prototype.onCreate.call(this, savedState);
  this.view.dateOfBirth = systemTimeInMillis();
};
  RegisterAgeRedirectPresenter.prototype.handleClickNext = function() {
  var tmp$;
  var ageDateTime = DateTime.Companion.invoke_s8cxhz$(this.view.dateOfBirth);
  var args = toMutableMap(this.arguments);
  var key = PersonEditView$Companion_getInstance().ARG_DATE_OF_BIRTH;
  var value = this.view.dateOfBirth.toString();
  args.put_xwzc9p$(key, value);
  if (age(ageDateTime) < UstadMobileConstants_getInstance().MINOR_AGE_THRESHOLD) {
    var key_0 = PersonEditView$Companion_getInstance().ARG_REGISTRATION_MODE;
    var value_0 = (3).toString();
    args.put_xwzc9p$(key_0, value_0);
    tmp$ = PersonEditView$Companion_getInstance().VIEW_NAME_REGISTER;
  } else {
    var key_1 = PersonEditView$Companion_getInstance().ARG_REGISTRATION_MODE;
    var value_1 = (1).toString();
    args.put_xwzc9p$(key_1, value_1);
    tmp$ = SiteTermsDetailView$Companion_getInstance().VIEW_NAME_ACCEPT_TERMS;
  }
  var viewName = tmp$;
  this.systemImpl.go_gofqk3$(viewName, args, this.context);
};
  RegisterAgeRedirectPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'RegisterAgeRedirectPresenter', 
  interfaces: [UstadBaseController]};
  function RegisterMinorWaitForParentPresenter(context, arguments_0, view, di) {
    UstadBaseController.call(this, context, arguments_0, view, di, false);
    var tmp$;
    this.systemImpl_rg25ii$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, RegisterMinorWaitForParentPresenter$systemImpl_metadata);
  }
  var RegisterMinorWaitForParentPresenter$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(RegisterMinorWaitForParentPresenter.prototype, 'systemImpl', {
  configurable: true, 
  get: function() {
  return this.systemImpl_rg25ii$_0.value;
}});
  RegisterMinorWaitForParentPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1;
  UstadBaseController.prototype.onCreate.call(this, savedState);
  this.view.username = (tmp$ = this.arguments.get_11rb$(RegisterMinorWaitForParentView$Companion_getInstance().ARG_USERNAME)) != null ? tmp$ : 'invalid';
  this.view.password = (tmp$_0 = this.arguments.get_11rb$(RegisterMinorWaitForParentView$Companion_getInstance().ARG_PASSWORD)) != null ? tmp$_0 : 'invalid';
  this.view.parentContact = (tmp$_1 = this.arguments.get_11rb$(RegisterMinorWaitForParentView$Companion_getInstance().ARG_PARENT_CONTACT)) != null ? tmp$_1 : 'invalid';
};
  RegisterMinorWaitForParentPresenter.prototype.handleClickTogglePasswordVisibility = function() {
  this.view.passwordVisible = !this.view.passwordVisible;
};
  RegisterMinorWaitForParentPresenter.prototype.handleClickOk = function() {
  this.systemImpl.popBack_i9f55q$(UstadView$Companion_getInstance().CURRENT_DEST, true, this.context);
};
  RegisterMinorWaitForParentPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'RegisterMinorWaitForParentPresenter', 
  interfaces: [UstadBaseController]};
  function ReportDetailPresenter(context, arguments_0, view, di, lifecycleOwner) {
    ReportDetailPresenter$Companion_getInstance();
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.loggedInPerson_0 = null;
    this.loggedInPersonUid = this.accountManager.activeAccount.personUid;
  }
  Object.defineProperty(ReportDetailPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  function Coroutine$ReportDetailPresenter$onCreate$lambda($receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
  }
  Coroutine$ReportDetailPresenter$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ReportDetailPresenter$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ReportDetailPresenter$onCreate$lambda.prototype.constructor = Coroutine$ReportDetailPresenter$onCreate$lambda;
  Coroutine$ReportDetailPresenter$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        return Unit;
      case 1:
        throw this.exception_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 ReportDetailPresenter$onCreate$lambda($receiver_0, continuation_0, suspended) {
    var instance = new Coroutine$ReportDetailPresenter$onCreate$lambda($receiver_0, this, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  ReportDetailPresenter.prototype.onCreate = function(savedState) {
  UstadDetailPresenter.prototype.onCreate.call(this, savedState);
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ReportDetailPresenter$onCreate$lambda);
};
  function Coroutine$ReportDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$ReportDetailPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ReportDetailPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ReportDetailPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$ReportDetailPresenter$onLoadEntityFromDb$lambda;
  Coroutine$ReportDetailPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$closure$db.reportDao.findByUid_s8cxhz$(this.local$closure$entityUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ReportDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ReportDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_20($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_20.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_20.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_20.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_20;
  Coroutine$onLoadEntityFromDb_7hogkd$_20.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
        var entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = withTimeoutOrNull(L2000, ReportDetailPresenter$onLoadEntityFromDb$lambda(this.local$db, entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var report = (tmp$_1 = this.result_0) != null ? tmp$_1 : new Report();
        var $receiver = report.reportSeries;
        if (!($receiver == null || $receiver.length === 0)) {
          tmp$_3 = safeParseList(this.$this.di, ListSerializer(ReportSeries.Companion.serializer()), getKClass(ReportSeries), (tmp$_2 = report.reportSeries) != null ? tmp$_2 : '');
        } else {
          tmp$_3 = emptyList();
        }
        var series = tmp$_3;
        var reportWithFilter = ReportWithSeriesWithFilters_init(report, series);
        this.$this.setReportData_0(reportWithFilter);
        return reportWithFilter;
      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);
};
  ReportDetailPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_20(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ReportDetailPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  UstadDetailPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  var editEntity = null;
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = ReportWithSeriesWithFilters.Companion.serializer();
    var tmp$;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
    editEntity = json.decodeFromString_awif5v$(strategy, entityJsonStr);
    this.setReportData_0(editEntity);
  }
  return editEntity;
};
  function Coroutine$ReportDetailPresenter$setReportData$lambda$lambda(this$ReportDetailPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ReportDetailPresenter = this$ReportDetailPresenter_0;
  }
  Coroutine$ReportDetailPresenter$setReportData$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ReportDetailPresenter$setReportData$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ReportDetailPresenter$setReportData$lambda$lambda.prototype.constructor = Coroutine$ReportDetailPresenter$setReportData$lambda$lambda;
  Coroutine$ReportDetailPresenter$setReportData$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$ReportDetailPresenter.db.personDao.findByUidAsync_s8cxhz$(this.local$this$ReportDetailPresenter.loggedInPersonUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ReportDetailPresenter$setReportData$lambda$lambda(this$ReportDetailPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ReportDetailPresenter$setReportData$lambda$lambda(this$ReportDetailPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ReportDetailPresenter$setReportData$lambda(this$ReportDetailPresenter_0, closure$reportWithFilters_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ReportDetailPresenter = this$ReportDetailPresenter_0;
    this.local$closure$reportWithFilters = closure$reportWithFilters_0;
  }
  Coroutine$ReportDetailPresenter$setReportData$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ReportDetailPresenter$setReportData$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ReportDetailPresenter$setReportData$lambda.prototype.constructor = Coroutine$ReportDetailPresenter$setReportData$lambda;
  Coroutine$ReportDetailPresenter$setReportData$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        this.state_0 = 2;
        this.result_0 = generateChartData(this.local$this$ReportDetailPresenter.db, this.local$closure$reportWithFilters, this.local$this$ReportDetailPresenter.context, this.local$this$ReportDetailPresenter.systemImpl, this.local$this$ReportDetailPresenter.loggedInPersonUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var chartData = this.result_0;
        var statementList = generateStatementList(this.local$this$ReportDetailPresenter.db, this.local$closure$reportWithFilters, this.local$this$ReportDetailPresenter.loggedInPersonUid);
        this.local$this$ReportDetailPresenter.view.chartData = chartData;
        this.local$this$ReportDetailPresenter.view.statementListDetails = statementList;
        this.local$this$ReportDetailPresenter.view.loading = false;
        this.state_0 = 3;
        this.result_0 = withTimeoutOrNull(L2000, ReportDetailPresenter$setReportData$lambda$lambda(this.local$this$ReportDetailPresenter), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$this$ReportDetailPresenter.loggedInPerson_0 = this.result_0;
        return this.local$this$ReportDetailPresenter.view.saveAsTemplateVisible = (tmp$_0 = (tmp$ = this.local$this$ReportDetailPresenter.loggedInPerson_0) != null ? tmp$.admin : null) != null ? tmp$_0 : false , Unit;
      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 ReportDetailPresenter$setReportData$lambda(this$ReportDetailPresenter_0, closure$reportWithFilters_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ReportDetailPresenter$setReportData$lambda(this$ReportDetailPresenter_0, closure$reportWithFilters_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ReportDetailPresenter.prototype.setReportData_0 = function(reportWithFilters) {
  this.view.loading = true;
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ReportDetailPresenter$setReportData$lambda(this, reportWithFilters));
};
  ReportDetailPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  return true;
};
  ReportDetailPresenter.prototype.handleClickEdit = function() {
  var tmp$, tmp$_0;
  tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null;
  if (tmp$_0 == null) {
    return;
  }
  var report = tmp$_0;
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ReportEditView$Companion_getInstance().VIEW_NAME, getKClass(Report), Report.Companion.serializer(), ReportDetailPresenter$Companion_getInstance().RESULT_REPORT_KEY, void 0, mutableMapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, report.toString())])));
};
  function Coroutine$ReportDetailPresenter$handleOnClickAddFromDashboard$lambda(this$ReportDetailPresenter_0, closure$report_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ReportDetailPresenter = this$ReportDetailPresenter_0;
    this.local$closure$report = closure$report_0;
  }
  Coroutine$ReportDetailPresenter$handleOnClickAddFromDashboard$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ReportDetailPresenter$handleOnClickAddFromDashboard$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ReportDetailPresenter$handleOnClickAddFromDashboard$lambda.prototype.constructor = Coroutine$ReportDetailPresenter$handleOnClickAddFromDashboard$lambda;
  Coroutine$ReportDetailPresenter$handleOnClickAddFromDashboard$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$closure$report.reportOwnerUid = this.local$this$ReportDetailPresenter.loggedInPersonUid;
        this.state_0 = 2;
        this.result_0 = this.local$this$ReportDetailPresenter.repo.reportDao.insertAsync(this.local$closure$report, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ReportDetailPresenter$handleOnClickAddFromDashboard$lambda(this$ReportDetailPresenter_0, closure$report_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ReportDetailPresenter$handleOnClickAddFromDashboard$lambda(this$ReportDetailPresenter_0, closure$report_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ReportDetailPresenter.prototype.handleOnClickAddFromDashboard_281ov6$ = function(report) {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ReportDetailPresenter$handleOnClickAddFromDashboard$lambda(this, report));
};
  function Coroutine$ReportDetailPresenter$handleOnClickAddAsTemplate$lambda(closure$report_0, this$ReportDetailPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$report = closure$report_0;
    this.local$this$ReportDetailPresenter = this$ReportDetailPresenter_0;
  }
  Coroutine$ReportDetailPresenter$handleOnClickAddAsTemplate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ReportDetailPresenter$handleOnClickAddAsTemplate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ReportDetailPresenter$handleOnClickAddAsTemplate$lambda.prototype.constructor = Coroutine$ReportDetailPresenter$handleOnClickAddAsTemplate$lambda;
  Coroutine$ReportDetailPresenter$handleOnClickAddAsTemplate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$closure$report.isTemplate = true;
        this.local$closure$report.reportUid = L0;
        this.local$closure$report.reportOwnerUid = L0;
        this.state_0 = 2;
        this.result_0 = this.local$this$ReportDetailPresenter.repo.reportDao.insertAsync(this.local$closure$report, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ReportDetailPresenter$handleOnClickAddAsTemplate$lambda(closure$report_0, this$ReportDetailPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ReportDetailPresenter$handleOnClickAddAsTemplate$lambda(closure$report_0, this$ReportDetailPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ReportDetailPresenter.prototype.handleOnClickAddAsTemplate_281ov6$ = function(report) {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ReportDetailPresenter$handleOnClickAddAsTemplate$lambda(report, this));
};
  function ReportDetailPresenter$Companion() {
    ReportDetailPresenter$Companion_instance = this;
    this.RESULT_REPORT_KEY = 'Report';
  }
  ReportDetailPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ReportDetailPresenter$Companion_instance = null;
  function ReportDetailPresenter$Companion_getInstance() {
    if (ReportDetailPresenter$Companion_instance === null) {
      new ReportDetailPresenter$Companion();
    }
    return ReportDetailPresenter$Companion_instance;
  }
  ReportDetailPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ReportDetailPresenter', 
  interfaces: [UstadDetailPresenter]};
  function ReportEditPresenter(context, arguments_0, view, di, lifecycleOwner) {
    ReportEditPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.seriesCounter_0 = 1;
    this.filterCounter_0 = 1;
  }
  Object.defineProperty(ReportEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  function ReportEditPresenter$VisualTypeOptions(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ReportEditPresenter$VisualTypeOptions_initFields() {
    ReportEditPresenter$VisualTypeOptions_initFields = function() {
};
    ReportEditPresenter$VisualTypeOptions$BAR_CHART_instance = new ReportEditPresenter$VisualTypeOptions('BAR_CHART', 0, 100, 2188);
    ReportEditPresenter$VisualTypeOptions$LINE_GRAPH_instance = new ReportEditPresenter$VisualTypeOptions('LINE_GRAPH', 1, 101, 2189);
  }
  var ReportEditPresenter$VisualTypeOptions$BAR_CHART_instance;
  function ReportEditPresenter$VisualTypeOptions$BAR_CHART_getInstance() {
    ReportEditPresenter$VisualTypeOptions_initFields();
    return ReportEditPresenter$VisualTypeOptions$BAR_CHART_instance;
  }
  var ReportEditPresenter$VisualTypeOptions$LINE_GRAPH_instance;
  function ReportEditPresenter$VisualTypeOptions$LINE_GRAPH_getInstance() {
    ReportEditPresenter$VisualTypeOptions_initFields();
    return ReportEditPresenter$VisualTypeOptions$LINE_GRAPH_instance;
  }
  ReportEditPresenter$VisualTypeOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'VisualTypeOptions', 
  interfaces: [Enum]};
  function ReportEditPresenter$VisualTypeOptions$values() {
    return [ReportEditPresenter$VisualTypeOptions$BAR_CHART_getInstance(), ReportEditPresenter$VisualTypeOptions$LINE_GRAPH_getInstance()];
  }
  ReportEditPresenter$VisualTypeOptions.values = ReportEditPresenter$VisualTypeOptions$values;
  function ReportEditPresenter$VisualTypeOptions$valueOf(name) {
    switch (name) {
      case 'BAR_CHART':
        return ReportEditPresenter$VisualTypeOptions$BAR_CHART_getInstance();
      case 'LINE_GRAPH':
        return ReportEditPresenter$VisualTypeOptions$LINE_GRAPH_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ReportEditPresenter.VisualTypeOptions.' + name);
    }
  }
  ReportEditPresenter$VisualTypeOptions.valueOf_61zpoe$ = ReportEditPresenter$VisualTypeOptions$valueOf;
  function ReportEditPresenter$VisualTypeMessageIdOption(day, context, di) {
    MessageIdOption.call(this, day.messageId, context, day.optionVal, di);
  }
  ReportEditPresenter$VisualTypeMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'VisualTypeMessageIdOption', 
  interfaces: [MessageIdOption]};
  function ReportEditPresenter$XAxisOptions(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ReportEditPresenter$XAxisOptions_initFields() {
    ReportEditPresenter$XAxisOptions_initFields = function() {
};
    ReportEditPresenter$XAxisOptions$DAY_instance = new ReportEditPresenter$XAxisOptions('DAY', 0, 300, 2357);
    ReportEditPresenter$XAxisOptions$WEEK_instance = new ReportEditPresenter$XAxisOptions('WEEK', 1, 301, 2207);
    ReportEditPresenter$XAxisOptions$MONTH_instance = new ReportEditPresenter$XAxisOptions('MONTH', 2, 302, 2208);
    ReportEditPresenter$XAxisOptions$CONTENT_ENTRY_instance = new ReportEditPresenter$XAxisOptions('CONTENT_ENTRY', 3, 304, 2210);
    ReportEditPresenter$XAxisOptions$GENDER_instance = new ReportEditPresenter$XAxisOptions('GENDER', 4, 306, 2440);
    ReportEditPresenter$XAxisOptions$CLASS_instance = new ReportEditPresenter$XAxisOptions('CLASS', 5, 307, 2322);
    ReportEditPresenter$XAxisOptions$ENROLMENT_OUTCOME_instance = new ReportEditPresenter$XAxisOptions('ENROLMENT_OUTCOME', 6, 308, 2386);
    ReportEditPresenter$XAxisOptions$ENROLMENT_LEAVING_instance = new ReportEditPresenter$XAxisOptions('ENROLMENT_LEAVING', 7, 309, 2387);
  }
  var ReportEditPresenter$XAxisOptions$DAY_instance;
  function ReportEditPresenter$XAxisOptions$DAY_getInstance() {
    ReportEditPresenter$XAxisOptions_initFields();
    return ReportEditPresenter$XAxisOptions$DAY_instance;
  }
  var ReportEditPresenter$XAxisOptions$WEEK_instance;
  function ReportEditPresenter$XAxisOptions$WEEK_getInstance() {
    ReportEditPresenter$XAxisOptions_initFields();
    return ReportEditPresenter$XAxisOptions$WEEK_instance;
  }
  var ReportEditPresenter$XAxisOptions$MONTH_instance;
  function ReportEditPresenter$XAxisOptions$MONTH_getInstance() {
    ReportEditPresenter$XAxisOptions_initFields();
    return ReportEditPresenter$XAxisOptions$MONTH_instance;
  }
  var ReportEditPresenter$XAxisOptions$CONTENT_ENTRY_instance;
  function ReportEditPresenter$XAxisOptions$CONTENT_ENTRY_getInstance() {
    ReportEditPresenter$XAxisOptions_initFields();
    return ReportEditPresenter$XAxisOptions$CONTENT_ENTRY_instance;
  }
  var ReportEditPresenter$XAxisOptions$GENDER_instance;
  function ReportEditPresenter$XAxisOptions$GENDER_getInstance() {
    ReportEditPresenter$XAxisOptions_initFields();
    return ReportEditPresenter$XAxisOptions$GENDER_instance;
  }
  var ReportEditPresenter$XAxisOptions$CLASS_instance;
  function ReportEditPresenter$XAxisOptions$CLASS_getInstance() {
    ReportEditPresenter$XAxisOptions_initFields();
    return ReportEditPresenter$XAxisOptions$CLASS_instance;
  }
  var ReportEditPresenter$XAxisOptions$ENROLMENT_OUTCOME_instance;
  function ReportEditPresenter$XAxisOptions$ENROLMENT_OUTCOME_getInstance() {
    ReportEditPresenter$XAxisOptions_initFields();
    return ReportEditPresenter$XAxisOptions$ENROLMENT_OUTCOME_instance;
  }
  var ReportEditPresenter$XAxisOptions$ENROLMENT_LEAVING_instance;
  function ReportEditPresenter$XAxisOptions$ENROLMENT_LEAVING_getInstance() {
    ReportEditPresenter$XAxisOptions_initFields();
    return ReportEditPresenter$XAxisOptions$ENROLMENT_LEAVING_instance;
  }
  ReportEditPresenter$XAxisOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'XAxisOptions', 
  interfaces: [Enum]};
  function ReportEditPresenter$XAxisOptions$values() {
    return [ReportEditPresenter$XAxisOptions$DAY_getInstance(), ReportEditPresenter$XAxisOptions$WEEK_getInstance(), ReportEditPresenter$XAxisOptions$MONTH_getInstance(), ReportEditPresenter$XAxisOptions$CONTENT_ENTRY_getInstance(), ReportEditPresenter$XAxisOptions$GENDER_getInstance(), ReportEditPresenter$XAxisOptions$CLASS_getInstance(), ReportEditPresenter$XAxisOptions$ENROLMENT_OUTCOME_getInstance(), ReportEditPresenter$XAxisOptions$ENROLMENT_LEAVING_getInstance()];
  }
  ReportEditPresenter$XAxisOptions.values = ReportEditPresenter$XAxisOptions$values;
  function ReportEditPresenter$XAxisOptions$valueOf(name) {
    switch (name) {
      case 'DAY':
        return ReportEditPresenter$XAxisOptions$DAY_getInstance();
      case 'WEEK':
        return ReportEditPresenter$XAxisOptions$WEEK_getInstance();
      case 'MONTH':
        return ReportEditPresenter$XAxisOptions$MONTH_getInstance();
      case 'CONTENT_ENTRY':
        return ReportEditPresenter$XAxisOptions$CONTENT_ENTRY_getInstance();
      case 'GENDER':
        return ReportEditPresenter$XAxisOptions$GENDER_getInstance();
      case 'CLASS':
        return ReportEditPresenter$XAxisOptions$CLASS_getInstance();
      case 'ENROLMENT_OUTCOME':
        return ReportEditPresenter$XAxisOptions$ENROLMENT_OUTCOME_getInstance();
      case 'ENROLMENT_LEAVING':
        return ReportEditPresenter$XAxisOptions$ENROLMENT_LEAVING_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ReportEditPresenter.XAxisOptions.' + name);
    }
  }
  ReportEditPresenter$XAxisOptions.valueOf_61zpoe$ = ReportEditPresenter$XAxisOptions$valueOf;
  function ReportEditPresenter$XAxisMessageIdOption(day, context, di) {
    MessageIdOption.call(this, day.messageId, context, day.optionVal, di);
  }
  ReportEditPresenter$XAxisMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'XAxisMessageIdOption', 
  interfaces: [MessageIdOption]};
  function ReportEditPresenter$DateRangeOptions(name, ordinal, code, messageId, dateRange) {
    Enum.call(this);
    this.code = code;
    this.messageId = messageId;
    this.dateRange = dateRange;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ReportEditPresenter$DateRangeOptions_initFields() {
    ReportEditPresenter$DateRangeOptions_initFields = function() {
};
    ReportEditPresenter$DateRangeOptions$EVERYTHING_instance = new ReportEditPresenter$DateRangeOptions('EVERYTHING', 0, 0, 2237, new DateRangeMoment(new Moment(), new Moment()));
    var $receiver = new Moment();
    $receiver.typeFlag = 1;
    $receiver.relUnit = 2;
    $receiver.relOffSet = -1;
    var $receiver_0 = new Moment();
    $receiver_0.typeFlag = 1;
    ReportEditPresenter$DateRangeOptions$LAST_WEEK_instance = new ReportEditPresenter$DateRangeOptions('LAST_WEEK', 1, 800, 2212, new DateRangeMoment($receiver, $receiver_0));
    var $receiver_1 = new Moment();
    $receiver_1.typeFlag = 1;
    $receiver_1.relUnit = 2;
    $receiver_1.relOffSet = -2;
    var $receiver_2 = new Moment();
    $receiver_2.typeFlag = 1;
    ReportEditPresenter$DateRangeOptions$LAST_TWO_WEEKS_instance = new ReportEditPresenter$DateRangeOptions('LAST_TWO_WEEKS', 2, 801, 2213, new DateRangeMoment($receiver_1, $receiver_2));
    var $receiver_3 = new Moment();
    $receiver_3.typeFlag = 1;
    $receiver_3.relUnit = 3;
    $receiver_3.relOffSet = -1;
    var $receiver_4 = new Moment();
    $receiver_4.typeFlag = 1;
    ReportEditPresenter$DateRangeOptions$LAST_MONTH_instance = new ReportEditPresenter$DateRangeOptions('LAST_MONTH', 3, 802, 2214, new DateRangeMoment($receiver_3, $receiver_4));
    var $receiver_5 = new Moment();
    $receiver_5.typeFlag = 1;
    $receiver_5.relUnit = 3;
    $receiver_5.relOffSet = -3;
    var $receiver_6 = new Moment();
    $receiver_6.typeFlag = 1;
    ReportEditPresenter$DateRangeOptions$LAST_THREE_MONTHS_instance = new ReportEditPresenter$DateRangeOptions('LAST_THREE_MONTHS', 4, 803, 2215, new DateRangeMoment($receiver_5, $receiver_6));
    ReportEditPresenter$DateRangeOptions$CUSTOM_RANGE_instance = new ReportEditPresenter$DateRangeOptions('CUSTOM_RANGE', 5, 805, 2217, null);
    var $receiver_7 = new Moment();
    $receiver_7.typeFlag = 1;
    $receiver_7.relUnit = 2;
    var $receiver_8 = new Moment();
    $receiver_8.typeFlag = 1;
    ReportEditPresenter$DateRangeOptions$NEW_CUSTOM_RANGE_instance = new ReportEditPresenter$DateRangeOptions('NEW_CUSTOM_RANGE', 6, 804, 2216, new DateRangeMoment($receiver_7, $receiver_8));
  }
  var ReportEditPresenter$DateRangeOptions$EVERYTHING_instance;
  function ReportEditPresenter$DateRangeOptions$EVERYTHING_getInstance() {
    ReportEditPresenter$DateRangeOptions_initFields();
    return ReportEditPresenter$DateRangeOptions$EVERYTHING_instance;
  }
  var ReportEditPresenter$DateRangeOptions$LAST_WEEK_instance;
  function ReportEditPresenter$DateRangeOptions$LAST_WEEK_getInstance() {
    ReportEditPresenter$DateRangeOptions_initFields();
    return ReportEditPresenter$DateRangeOptions$LAST_WEEK_instance;
  }
  var ReportEditPresenter$DateRangeOptions$LAST_TWO_WEEKS_instance;
  function ReportEditPresenter$DateRangeOptions$LAST_TWO_WEEKS_getInstance() {
    ReportEditPresenter$DateRangeOptions_initFields();
    return ReportEditPresenter$DateRangeOptions$LAST_TWO_WEEKS_instance;
  }
  var ReportEditPresenter$DateRangeOptions$LAST_MONTH_instance;
  function ReportEditPresenter$DateRangeOptions$LAST_MONTH_getInstance() {
    ReportEditPresenter$DateRangeOptions_initFields();
    return ReportEditPresenter$DateRangeOptions$LAST_MONTH_instance;
  }
  var ReportEditPresenter$DateRangeOptions$LAST_THREE_MONTHS_instance;
  function ReportEditPresenter$DateRangeOptions$LAST_THREE_MONTHS_getInstance() {
    ReportEditPresenter$DateRangeOptions_initFields();
    return ReportEditPresenter$DateRangeOptions$LAST_THREE_MONTHS_instance;
  }
  var ReportEditPresenter$DateRangeOptions$CUSTOM_RANGE_instance;
  function ReportEditPresenter$DateRangeOptions$CUSTOM_RANGE_getInstance() {
    ReportEditPresenter$DateRangeOptions_initFields();
    return ReportEditPresenter$DateRangeOptions$CUSTOM_RANGE_instance;
  }
  var ReportEditPresenter$DateRangeOptions$NEW_CUSTOM_RANGE_instance;
  function ReportEditPresenter$DateRangeOptions$NEW_CUSTOM_RANGE_getInstance() {
    ReportEditPresenter$DateRangeOptions_initFields();
    return ReportEditPresenter$DateRangeOptions$NEW_CUSTOM_RANGE_instance;
  }
  ReportEditPresenter$DateRangeOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'DateRangeOptions', 
  interfaces: [Enum]};
  function ReportEditPresenter$DateRangeOptions$values() {
    return [ReportEditPresenter$DateRangeOptions$EVERYTHING_getInstance(), ReportEditPresenter$DateRangeOptions$LAST_WEEK_getInstance(), ReportEditPresenter$DateRangeOptions$LAST_TWO_WEEKS_getInstance(), ReportEditPresenter$DateRangeOptions$LAST_MONTH_getInstance(), ReportEditPresenter$DateRangeOptions$LAST_THREE_MONTHS_getInstance(), ReportEditPresenter$DateRangeOptions$CUSTOM_RANGE_getInstance(), ReportEditPresenter$DateRangeOptions$NEW_CUSTOM_RANGE_getInstance()];
  }
  ReportEditPresenter$DateRangeOptions.values = ReportEditPresenter$DateRangeOptions$values;
  function ReportEditPresenter$DateRangeOptions$valueOf(name) {
    switch (name) {
      case 'EVERYTHING':
        return ReportEditPresenter$DateRangeOptions$EVERYTHING_getInstance();
      case 'LAST_WEEK':
        return ReportEditPresenter$DateRangeOptions$LAST_WEEK_getInstance();
      case 'LAST_TWO_WEEKS':
        return ReportEditPresenter$DateRangeOptions$LAST_TWO_WEEKS_getInstance();
      case 'LAST_MONTH':
        return ReportEditPresenter$DateRangeOptions$LAST_MONTH_getInstance();
      case 'LAST_THREE_MONTHS':
        return ReportEditPresenter$DateRangeOptions$LAST_THREE_MONTHS_getInstance();
      case 'CUSTOM_RANGE':
        return ReportEditPresenter$DateRangeOptions$CUSTOM_RANGE_getInstance();
      case 'NEW_CUSTOM_RANGE':
        return ReportEditPresenter$DateRangeOptions$NEW_CUSTOM_RANGE_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ReportEditPresenter.DateRangeOptions.' + name);
    }
  }
  ReportEditPresenter$DateRangeOptions.valueOf_61zpoe$ = ReportEditPresenter$DateRangeOptions$valueOf;
  function ReportEditPresenter$SubGroupOptions(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ReportEditPresenter$SubGroupOptions_initFields() {
    ReportEditPresenter$SubGroupOptions_initFields = function() {
};
    ReportEditPresenter$SubGroupOptions$NONE_instance = new ReportEditPresenter$SubGroupOptions('NONE', 0, 0, 2531);
    ReportEditPresenter$SubGroupOptions$DAY_instance = new ReportEditPresenter$SubGroupOptions('DAY', 1, 300, 2357);
    ReportEditPresenter$SubGroupOptions$WEEK_instance = new ReportEditPresenter$SubGroupOptions('WEEK', 2, 301, 2207);
    ReportEditPresenter$SubGroupOptions$MONTH_instance = new ReportEditPresenter$SubGroupOptions('MONTH', 3, 302, 2208);
    ReportEditPresenter$SubGroupOptions$CONTENT_ENTRY_instance = new ReportEditPresenter$SubGroupOptions('CONTENT_ENTRY', 4, 304, 2210);
    ReportEditPresenter$SubGroupOptions$GENDER_instance = new ReportEditPresenter$SubGroupOptions('GENDER', 5, 306, 2440);
    ReportEditPresenter$SubGroupOptions$CLASS_instance = new ReportEditPresenter$SubGroupOptions('CLASS', 6, 307, 2322);
    ReportEditPresenter$SubGroupOptions$ENROLMENT_OUTCOME_instance = new ReportEditPresenter$SubGroupOptions('ENROLMENT_OUTCOME', 7, 308, 2386);
    ReportEditPresenter$SubGroupOptions$ENROLMENT_LEAVING_instance = new ReportEditPresenter$SubGroupOptions('ENROLMENT_LEAVING', 8, 309, 2387);
  }
  var ReportEditPresenter$SubGroupOptions$NONE_instance;
  function ReportEditPresenter$SubGroupOptions$NONE_getInstance() {
    ReportEditPresenter$SubGroupOptions_initFields();
    return ReportEditPresenter$SubGroupOptions$NONE_instance;
  }
  var ReportEditPresenter$SubGroupOptions$DAY_instance;
  function ReportEditPresenter$SubGroupOptions$DAY_getInstance() {
    ReportEditPresenter$SubGroupOptions_initFields();
    return ReportEditPresenter$SubGroupOptions$DAY_instance;
  }
  var ReportEditPresenter$SubGroupOptions$WEEK_instance;
  function ReportEditPresenter$SubGroupOptions$WEEK_getInstance() {
    ReportEditPresenter$SubGroupOptions_initFields();
    return ReportEditPresenter$SubGroupOptions$WEEK_instance;
  }
  var ReportEditPresenter$SubGroupOptions$MONTH_instance;
  function ReportEditPresenter$SubGroupOptions$MONTH_getInstance() {
    ReportEditPresenter$SubGroupOptions_initFields();
    return ReportEditPresenter$SubGroupOptions$MONTH_instance;
  }
  var ReportEditPresenter$SubGroupOptions$CONTENT_ENTRY_instance;
  function ReportEditPresenter$SubGroupOptions$CONTENT_ENTRY_getInstance() {
    ReportEditPresenter$SubGroupOptions_initFields();
    return ReportEditPresenter$SubGroupOptions$CONTENT_ENTRY_instance;
  }
  var ReportEditPresenter$SubGroupOptions$GENDER_instance;
  function ReportEditPresenter$SubGroupOptions$GENDER_getInstance() {
    ReportEditPresenter$SubGroupOptions_initFields();
    return ReportEditPresenter$SubGroupOptions$GENDER_instance;
  }
  var ReportEditPresenter$SubGroupOptions$CLASS_instance;
  function ReportEditPresenter$SubGroupOptions$CLASS_getInstance() {
    ReportEditPresenter$SubGroupOptions_initFields();
    return ReportEditPresenter$SubGroupOptions$CLASS_instance;
  }
  var ReportEditPresenter$SubGroupOptions$ENROLMENT_OUTCOME_instance;
  function ReportEditPresenter$SubGroupOptions$ENROLMENT_OUTCOME_getInstance() {
    ReportEditPresenter$SubGroupOptions_initFields();
    return ReportEditPresenter$SubGroupOptions$ENROLMENT_OUTCOME_instance;
  }
  var ReportEditPresenter$SubGroupOptions$ENROLMENT_LEAVING_instance;
  function ReportEditPresenter$SubGroupOptions$ENROLMENT_LEAVING_getInstance() {
    ReportEditPresenter$SubGroupOptions_initFields();
    return ReportEditPresenter$SubGroupOptions$ENROLMENT_LEAVING_instance;
  }
  ReportEditPresenter$SubGroupOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SubGroupOptions', 
  interfaces: [Enum]};
  function ReportEditPresenter$SubGroupOptions$values() {
    return [ReportEditPresenter$SubGroupOptions$NONE_getInstance(), ReportEditPresenter$SubGroupOptions$DAY_getInstance(), ReportEditPresenter$SubGroupOptions$WEEK_getInstance(), ReportEditPresenter$SubGroupOptions$MONTH_getInstance(), ReportEditPresenter$SubGroupOptions$CONTENT_ENTRY_getInstance(), ReportEditPresenter$SubGroupOptions$GENDER_getInstance(), ReportEditPresenter$SubGroupOptions$CLASS_getInstance(), ReportEditPresenter$SubGroupOptions$ENROLMENT_OUTCOME_getInstance(), ReportEditPresenter$SubGroupOptions$ENROLMENT_LEAVING_getInstance()];
  }
  ReportEditPresenter$SubGroupOptions.values = ReportEditPresenter$SubGroupOptions$values;
  function ReportEditPresenter$SubGroupOptions$valueOf(name) {
    switch (name) {
      case 'NONE':
        return ReportEditPresenter$SubGroupOptions$NONE_getInstance();
      case 'DAY':
        return ReportEditPresenter$SubGroupOptions$DAY_getInstance();
      case 'WEEK':
        return ReportEditPresenter$SubGroupOptions$WEEK_getInstance();
      case 'MONTH':
        return ReportEditPresenter$SubGroupOptions$MONTH_getInstance();
      case 'CONTENT_ENTRY':
        return ReportEditPresenter$SubGroupOptions$CONTENT_ENTRY_getInstance();
      case 'GENDER':
        return ReportEditPresenter$SubGroupOptions$GENDER_getInstance();
      case 'CLASS':
        return ReportEditPresenter$SubGroupOptions$CLASS_getInstance();
      case 'ENROLMENT_OUTCOME':
        return ReportEditPresenter$SubGroupOptions$ENROLMENT_OUTCOME_getInstance();
      case 'ENROLMENT_LEAVING':
        return ReportEditPresenter$SubGroupOptions$ENROLMENT_LEAVING_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ReportEditPresenter.SubGroupOptions.' + name);
    }
  }
  ReportEditPresenter$SubGroupOptions.valueOf_61zpoe$ = ReportEditPresenter$SubGroupOptions$valueOf;
  function ReportEditPresenter$SubGroupByMessageIdOption(day, context, di) {
    MessageIdOption.call(this, day.messageId, context, day.optionVal, di);
  }
  ReportEditPresenter$SubGroupByMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SubGroupByMessageIdOption', 
  interfaces: [MessageIdOption]};
  function ReportEditPresenter$YAxisOptions(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ReportEditPresenter$YAxisOptions_initFields() {
    ReportEditPresenter$YAxisOptions_initFields = function() {
};
    ReportEditPresenter$YAxisOptions$TOTAL_DURATION_instance = new ReportEditPresenter$YAxisOptions('TOTAL_DURATION', 0, 200, 2191);
    ReportEditPresenter$YAxisOptions$AVERAGE_DURATION_instance = new ReportEditPresenter$YAxisOptions('AVERAGE_DURATION', 1, 201, 2192);
    ReportEditPresenter$YAxisOptions$NUMBER_SESSIONS_instance = new ReportEditPresenter$YAxisOptions('NUMBER_SESSIONS', 2, 202, 2193);
    ReportEditPresenter$YAxisOptions$INTERACTIONS_RECORDED_instance = new ReportEditPresenter$YAxisOptions('INTERACTIONS_RECORDED', 3, 203, 2194);
    ReportEditPresenter$YAxisOptions$NUMBER_ACTIVE_USERS_instance = new ReportEditPresenter$YAxisOptions('NUMBER_ACTIVE_USERS', 4, 204, 2195);
    ReportEditPresenter$YAxisOptions$AVERAGE_USAGE_TIME_PER_USER_instance = new ReportEditPresenter$YAxisOptions('AVERAGE_USAGE_TIME_PER_USER', 5, 205, 2196);
    ReportEditPresenter$YAxisOptions$NUMBER_STUDENTS_COMPLETED_instance = new ReportEditPresenter$YAxisOptions('NUMBER_STUDENTS_COMPLETED', 6, 206, 2197);
    ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_COMPLETED_instance = new ReportEditPresenter$YAxisOptions('PERCENT_STUDENTS_COMPLETED', 7, 207, 2198);
    ReportEditPresenter$YAxisOptions$TOTAL_ATTENDANCE_instance = new ReportEditPresenter$YAxisOptions('TOTAL_ATTENDANCE', 8, 208, 2199);
    ReportEditPresenter$YAxisOptions$TOTAL_ABSENCES_instance = new ReportEditPresenter$YAxisOptions('TOTAL_ABSENCES', 9, 209, 2200);
    ReportEditPresenter$YAxisOptions$TOTAL_LATES_instance = new ReportEditPresenter$YAxisOptions('TOTAL_LATES', 10, 210, 2201);
    ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_ATTENDED_instance = new ReportEditPresenter$YAxisOptions('PERCENT_STUDENTS_ATTENDED', 11, 211, 2202);
    ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_ATTENDED_OR_LATE_instance = new ReportEditPresenter$YAxisOptions('PERCENT_STUDENTS_ATTENDED_OR_LATE', 12, 212, 2203);
    ReportEditPresenter$YAxisOptions$TOTAL_CLASSES_instance = new ReportEditPresenter$YAxisOptions('TOTAL_CLASSES', 13, 213, 2204);
    ReportEditPresenter$YAxisOptions$UNIQUE_STUDENTS_ATTENDING_instance = new ReportEditPresenter$YAxisOptions('UNIQUE_STUDENTS_ATTENDING', 14, 214, 2205);
  }
  var ReportEditPresenter$YAxisOptions$TOTAL_DURATION_instance;
  function ReportEditPresenter$YAxisOptions$TOTAL_DURATION_getInstance() {
    ReportEditPresenter$YAxisOptions_initFields();
    return ReportEditPresenter$YAxisOptions$TOTAL_DURATION_instance;
  }
  var ReportEditPresenter$YAxisOptions$AVERAGE_DURATION_instance;
  function ReportEditPresenter$YAxisOptions$AVERAGE_DURATION_getInstance() {
    ReportEditPresenter$YAxisOptions_initFields();
    return ReportEditPresenter$YAxisOptions$AVERAGE_DURATION_instance;
  }
  var ReportEditPresenter$YAxisOptions$NUMBER_SESSIONS_instance;
  function ReportEditPresenter$YAxisOptions$NUMBER_SESSIONS_getInstance() {
    ReportEditPresenter$YAxisOptions_initFields();
    return ReportEditPresenter$YAxisOptions$NUMBER_SESSIONS_instance;
  }
  var ReportEditPresenter$YAxisOptions$INTERACTIONS_RECORDED_instance;
  function ReportEditPresenter$YAxisOptions$INTERACTIONS_RECORDED_getInstance() {
    ReportEditPresenter$YAxisOptions_initFields();
    return ReportEditPresenter$YAxisOptions$INTERACTIONS_RECORDED_instance;
  }
  var ReportEditPresenter$YAxisOptions$NUMBER_ACTIVE_USERS_instance;
  function ReportEditPresenter$YAxisOptions$NUMBER_ACTIVE_USERS_getInstance() {
    ReportEditPresenter$YAxisOptions_initFields();
    return ReportEditPresenter$YAxisOptions$NUMBER_ACTIVE_USERS_instance;
  }
  var ReportEditPresenter$YAxisOptions$AVERAGE_USAGE_TIME_PER_USER_instance;
  function ReportEditPresenter$YAxisOptions$AVERAGE_USAGE_TIME_PER_USER_getInstance() {
    ReportEditPresenter$YAxisOptions_initFields();
    return ReportEditPresenter$YAxisOptions$AVERAGE_USAGE_TIME_PER_USER_instance;
  }
  var ReportEditPresenter$YAxisOptions$NUMBER_STUDENTS_COMPLETED_instance;
  function ReportEditPresenter$YAxisOptions$NUMBER_STUDENTS_COMPLETED_getInstance() {
    ReportEditPresenter$YAxisOptions_initFields();
    return ReportEditPresenter$YAxisOptions$NUMBER_STUDENTS_COMPLETED_instance;
  }
  var ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_COMPLETED_instance;
  function ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_COMPLETED_getInstance() {
    ReportEditPresenter$YAxisOptions_initFields();
    return ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_COMPLETED_instance;
  }
  var ReportEditPresenter$YAxisOptions$TOTAL_ATTENDANCE_instance;
  function ReportEditPresenter$YAxisOptions$TOTAL_ATTENDANCE_getInstance() {
    ReportEditPresenter$YAxisOptions_initFields();
    return ReportEditPresenter$YAxisOptions$TOTAL_ATTENDANCE_instance;
  }
  var ReportEditPresenter$YAxisOptions$TOTAL_ABSENCES_instance;
  function ReportEditPresenter$YAxisOptions$TOTAL_ABSENCES_getInstance() {
    ReportEditPresenter$YAxisOptions_initFields();
    return ReportEditPresenter$YAxisOptions$TOTAL_ABSENCES_instance;
  }
  var ReportEditPresenter$YAxisOptions$TOTAL_LATES_instance;
  function ReportEditPresenter$YAxisOptions$TOTAL_LATES_getInstance() {
    ReportEditPresenter$YAxisOptions_initFields();
    return ReportEditPresenter$YAxisOptions$TOTAL_LATES_instance;
  }
  var ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_ATTENDED_instance;
  function ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_ATTENDED_getInstance() {
    ReportEditPresenter$YAxisOptions_initFields();
    return ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_ATTENDED_instance;
  }
  var ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_ATTENDED_OR_LATE_instance;
  function ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_ATTENDED_OR_LATE_getInstance() {
    ReportEditPresenter$YAxisOptions_initFields();
    return ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_ATTENDED_OR_LATE_instance;
  }
  var ReportEditPresenter$YAxisOptions$TOTAL_CLASSES_instance;
  function ReportEditPresenter$YAxisOptions$TOTAL_CLASSES_getInstance() {
    ReportEditPresenter$YAxisOptions_initFields();
    return ReportEditPresenter$YAxisOptions$TOTAL_CLASSES_instance;
  }
  var ReportEditPresenter$YAxisOptions$UNIQUE_STUDENTS_ATTENDING_instance;
  function ReportEditPresenter$YAxisOptions$UNIQUE_STUDENTS_ATTENDING_getInstance() {
    ReportEditPresenter$YAxisOptions_initFields();
    return ReportEditPresenter$YAxisOptions$UNIQUE_STUDENTS_ATTENDING_instance;
  }
  ReportEditPresenter$YAxisOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'YAxisOptions', 
  interfaces: [Enum]};
  function ReportEditPresenter$YAxisOptions$values() {
    return [ReportEditPresenter$YAxisOptions$TOTAL_DURATION_getInstance(), ReportEditPresenter$YAxisOptions$AVERAGE_DURATION_getInstance(), ReportEditPresenter$YAxisOptions$NUMBER_SESSIONS_getInstance(), ReportEditPresenter$YAxisOptions$INTERACTIONS_RECORDED_getInstance(), ReportEditPresenter$YAxisOptions$NUMBER_ACTIVE_USERS_getInstance(), ReportEditPresenter$YAxisOptions$AVERAGE_USAGE_TIME_PER_USER_getInstance(), ReportEditPresenter$YAxisOptions$NUMBER_STUDENTS_COMPLETED_getInstance(), ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_COMPLETED_getInstance(), ReportEditPresenter$YAxisOptions$TOTAL_ATTENDANCE_getInstance(), ReportEditPresenter$YAxisOptions$TOTAL_ABSENCES_getInstance(), ReportEditPresenter$YAxisOptions$TOTAL_LATES_getInstance(), ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_ATTENDED_getInstance(), ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_ATTENDED_OR_LATE_getInstance(), ReportEditPresenter$YAxisOptions$TOTAL_CLASSES_getInstance(), ReportEditPresenter$YAxisOptions$UNIQUE_STUDENTS_ATTENDING_getInstance()];
  }
  ReportEditPresenter$YAxisOptions.values = ReportEditPresenter$YAxisOptions$values;
  function ReportEditPresenter$YAxisOptions$valueOf(name) {
    switch (name) {
      case 'TOTAL_DURATION':
        return ReportEditPresenter$YAxisOptions$TOTAL_DURATION_getInstance();
      case 'AVERAGE_DURATION':
        return ReportEditPresenter$YAxisOptions$AVERAGE_DURATION_getInstance();
      case 'NUMBER_SESSIONS':
        return ReportEditPresenter$YAxisOptions$NUMBER_SESSIONS_getInstance();
      case 'INTERACTIONS_RECORDED':
        return ReportEditPresenter$YAxisOptions$INTERACTIONS_RECORDED_getInstance();
      case 'NUMBER_ACTIVE_USERS':
        return ReportEditPresenter$YAxisOptions$NUMBER_ACTIVE_USERS_getInstance();
      case 'AVERAGE_USAGE_TIME_PER_USER':
        return ReportEditPresenter$YAxisOptions$AVERAGE_USAGE_TIME_PER_USER_getInstance();
      case 'NUMBER_STUDENTS_COMPLETED':
        return ReportEditPresenter$YAxisOptions$NUMBER_STUDENTS_COMPLETED_getInstance();
      case 'PERCENT_STUDENTS_COMPLETED':
        return ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_COMPLETED_getInstance();
      case 'TOTAL_ATTENDANCE':
        return ReportEditPresenter$YAxisOptions$TOTAL_ATTENDANCE_getInstance();
      case 'TOTAL_ABSENCES':
        return ReportEditPresenter$YAxisOptions$TOTAL_ABSENCES_getInstance();
      case 'TOTAL_LATES':
        return ReportEditPresenter$YAxisOptions$TOTAL_LATES_getInstance();
      case 'PERCENT_STUDENTS_ATTENDED':
        return ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_ATTENDED_getInstance();
      case 'PERCENT_STUDENTS_ATTENDED_OR_LATE':
        return ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_ATTENDED_OR_LATE_getInstance();
      case 'TOTAL_CLASSES':
        return ReportEditPresenter$YAxisOptions$TOTAL_CLASSES_getInstance();
      case 'UNIQUE_STUDENTS_ATTENDING':
        return ReportEditPresenter$YAxisOptions$UNIQUE_STUDENTS_ATTENDING_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ReportEditPresenter.YAxisOptions.' + name);
    }
  }
  ReportEditPresenter$YAxisOptions.valueOf_61zpoe$ = ReportEditPresenter$YAxisOptions$valueOf;
  function ReportEditPresenter$YAxisMessageIdOption(data, context, di) {
    MessageIdOption.call(this, data.messageId, context, data.optionVal, di);
  }
  ReportEditPresenter$YAxisMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'YAxisMessageIdOption', 
  interfaces: [MessageIdOption]};
  ReportEditPresenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
  var tmp$ = this.view;
  var $receiver = ReportEditPresenter$VisualTypeOptions$values();
  var destination = ArrayList_init_0($receiver.length);
  var tmp$_0;
  for (tmp$_0 = 0; tmp$_0 !== $receiver.length; ++tmp$_0) {
    var item = $receiver[tmp$_0];
    destination.add_11rb$(new ReportEditPresenter$VisualTypeMessageIdOption(item, this.context, this.di));
  }
  tmp$.visualTypeOptions = destination;
  var tmp$_1 = this.view;
  var $receiver_0 = ReportEditPresenter$XAxisOptions$values();
  var destination_0 = ArrayList_init_0($receiver_0.length);
  var tmp$_2;
  for (tmp$_2 = 0; tmp$_2 !== $receiver_0.length; ++tmp$_2) {
    var item_0 = $receiver_0[tmp$_2];
    destination_0.add_11rb$(new ReportEditPresenter$XAxisMessageIdOption(item_0, this.context, this.di));
  }
  tmp$_1.xAxisOptions = destination_0;
  var tmp$_3 = this.view;
  var $receiver_1 = ReportEditPresenter$YAxisOptions$values();
  var destination_1 = ArrayList_init_0($receiver_1.length);
  var tmp$_4;
  for (tmp$_4 = 0; tmp$_4 !== $receiver_1.length; ++tmp$_4) {
    var item_1 = $receiver_1[tmp$_4];
    destination_1.add_11rb$(new ReportEditPresenter$YAxisMessageIdOption(item_1, this.context, this.di));
  }
  tmp$_3.yAxisOptions = destination_1;
  var tmp$_5 = this.view;
  var $receiver_2 = ReportEditPresenter$DateRangeOptions$values();
  var destination_2 = ArrayList_init();
  var tmp$_6;
  for (tmp$_6 = 0; tmp$_6 !== $receiver_2.length; ++tmp$_6) {
    var element = $receiver_2[tmp$_6];
    if (element.dateRange != null) 
      destination_2.add_11rb$(element);
  }
  var destination_3 = ArrayList_init_0(collectionSizeOrDefault(destination_2, 10));
  var tmp$_7;
  tmp$_7 = destination_2.iterator();
  while (tmp$_7.hasNext()) {
    var item_2 = tmp$_7.next();
    destination_3.add_11rb$(new ObjectMessageIdOption(item_2.messageId, this.context, item_2.code, item_2.dateRange, this.di));
  }
  tmp$_5.dateRangeOptions = destination_3;
};
  function ReportEditPresenter$onLoadDataComplete$lambda(this$ReportEditPresenter) {
    return function(it) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var newFilter = tmp$;
  var entityVal = this$ReportEditPresenter.entity;
  var newSeriesList = (tmp$_1 = (tmp$_0 = entityVal != null ? entityVal.reportSeriesWithFiltersList : null) != null ? toMutableList(tmp$_0) : null) != null ? tmp$_1 : ArrayList_init();
  var firstOrNull$result;
  firstOrNull$break:
    do {
      var tmp$_5;
      tmp$_5 = newSeriesList.iterator();
      while (tmp$_5.hasNext()) {
        var element = tmp$_5.next();
        if (element.reportSeriesUid === newFilter.reportFilterSeriesUid) {
          firstOrNull$result = element;
          break firstOrNull$break;
        }
      }
      firstOrNull$result = null;
    } while (false);
  tmp$_2 = firstOrNull$result;
  if (tmp$_2 == null) {
    return;
  }
  var seriesToAddFilter = tmp$_2;
  newSeriesList.remove_11rb$(seriesToAddFilter);
  var newFilterList = (tmp$_4 = (tmp$_3 = seriesToAddFilter.reportSeriesFilters) != null ? toMutableList(tmp$_3) : null) != null ? tmp$_4 : ArrayList_init();
  if (newFilter.reportFilterUid === 0) {
    newFilter.reportFilterUid = (function(scope) {
  return ++this$ReportEditPresenter.filterCounter_0;
})(this);
    newFilterList.add_11rb$(newFilter);
  } else {
    var indexOfFirst$result;
    indexOfFirst$break:
      do {
        var tmp$_6;
        var index = 0;
        tmp$_6 = newFilterList.iterator();
        while (tmp$_6.hasNext()) {
          var item = tmp$_6.next();
          if (item.reportFilterUid === newFilter.reportFilterUid) {
            indexOfFirst$result = index;
            break indexOfFirst$break;
          }
          index = index + 1 | 0;
        }
        indexOfFirst$result = -1;
      } while (false);
    var indexOfFilter = indexOfFirst$result;
    newFilterList.set_wxm5ur$(indexOfFilter, newFilter);
  }
  var $receiver = new ReportSeries();
  $receiver.reportSeriesUid = seriesToAddFilter.reportSeriesUid;
  $receiver.reportSeriesVisualType = seriesToAddFilter.reportSeriesVisualType;
  $receiver.reportSeriesYAxis = seriesToAddFilter.reportSeriesYAxis;
  $receiver.reportSeriesSubGroup = seriesToAddFilter.reportSeriesSubGroup;
  $receiver.reportSeriesName = seriesToAddFilter.reportSeriesName;
  $receiver.reportSeriesFilters = toList(newFilterList);
  newSeriesList.add_11rb$($receiver);
    entityVal != null ? (entityVal.reportSeriesWithFiltersList = toList(newSeriesList)) : null;
  this$ReportEditPresenter.view.entity = entityVal;
  this$ReportEditPresenter.requireSavedStateHandle().set_umlfku$(ReportEditPresenter$Companion_getInstance().RESULT_REPORT_FILTER_KEY, null);
  return Unit;
};
  }
  function ReportEditPresenter$onLoadDataComplete$lambda_0(this$ReportEditPresenter) {
    return function(it) {
  var tmp$;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var dateRangeMoment = tmp$;
  this$ReportEditPresenter.handleAddCustomRange_uod4eh$(dateRangeMoment);
  this$ReportEditPresenter.requireSavedStateHandle().set_umlfku$(ReportEditPresenter$Companion_getInstance().RESULT_DATE_RANGE_KEY, null);
  return Unit;
};
  }
  ReportEditPresenter.prototype.onLoadDataComplete = function() {
  UstadEditPresenter.prototype.onLoadDataComplete.call(this);
  this.observeSavedStateResult_27fjeh$(ReportEditPresenter$Companion_getInstance().RESULT_REPORT_FILTER_KEY, ListSerializer(ReportFilter.Companion.serializer()), getKClass(ReportFilter), new DoorObserver(ReportEditPresenter$onLoadDataComplete$lambda(this)));
  this.observeSavedStateResult_27fjeh$(ReportEditPresenter$Companion_getInstance().RESULT_DATE_RANGE_KEY, ListSerializer(DateRangeMoment.Companion.serializer()), getKClass(DateRangeMoment), new DoorObserver(ReportEditPresenter$onLoadDataComplete$lambda_0(this)));
};
  function Coroutine$ReportEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$it = it_0;
  }
  Coroutine$ReportEditPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ReportEditPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ReportEditPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$ReportEditPresenter$onLoadEntityFromDb$lambda;
  Coroutine$ReportEditPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if ((tmp$_0 = (tmp$ = !equals(this.local$closure$entityUid, L0) ? this.local$it : null) != null ? tmp$.reportDao : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_0.findByUid_s8cxhz$(this.local$closure$entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 ReportEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$ReportEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_21($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_21.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_21.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_21.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_21;
  Coroutine$onLoadEntityFromDb_7hogkd$_21.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
        var entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, ReportEditPresenter$onLoadEntityFromDb$lambda(entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var report = (tmp$_1 = this.result_0) != null ? tmp$_1 : new Report();
        var $receiver = ReportEditPresenter$XAxisOptions$values();
        var destination = ArrayList_init_0($receiver.length);
        var tmp$_4;
        for (tmp$_4 = 0; tmp$_4 !== $receiver.length; ++tmp$_4) {
          var item = $receiver[tmp$_4];
          destination.add_11rb$(new ReportEditPresenter$XAxisMessageIdOption(item, this.$this.context, this.$this.di));
        }
        var firstOrNull$result;
        firstOrNull$break:
          do {
            var tmp$_5;
            tmp$_5 = destination.iterator();
            while (tmp$_5.hasNext()) {
              var element = tmp$_5.next();
              if (element.code === report.xAxis) {
                firstOrNull$result = element;
                break firstOrNull$break;
              }
            }
            firstOrNull$result = null;
          } while (false);
        this.$this.handleXAxisSelected_iowaj7$(Kotlin.isType(tmp$_2 = firstOrNull$result, MessageIdOption) ? tmp$_2 : throwCCE());
        if (report.reportDateRangeSelection === 805) {
          this.$this.handleAddCustomRange_uod4eh$(toDateRangeMoment(report));
        }
        var reportSeries = report.reportSeries;
        var reportSeriesList = emptyList();
        if (!(reportSeries == null || isBlank(reportSeries))) {
          reportSeriesList = safeParseList(this.$this.di, ListSerializer(ReportSeries.Companion.serializer()), getKClass(ReportSeries), reportSeries);
          var $receiver_0 = reportSeriesList;
          var maxByOrNull$result;
          maxByOrNull$break:
            do {
              var iterator = $receiver_0.iterator();
              if (!iterator.hasNext()) {
                maxByOrNull$result = null;
                break maxByOrNull$break;
              }
              var maxElem = iterator.next();
              if (!iterator.hasNext()) {
                maxByOrNull$result = maxElem;
                break maxByOrNull$break;
              }
              var maxValue = maxElem.reportSeriesUid;
              do {
                var e_0 = iterator.next();
                var v = e_0.reportSeriesUid;
                if (Kotlin.compareTo(maxValue, v) < 0) {
                  maxElem = e_0;
                  maxValue = v;
                }
              } while (iterator.hasNext());
              maxByOrNull$result = maxElem;
            } while (false);
          var maxSeries = maxByOrNull$result;
          var currentMaxFilter = {
  v: 0};
          var tmp$_6;
          tmp$_6 = reportSeriesList.iterator();
          loop_label:
            while (tmp$_6.hasNext()) {
              var element_0 = tmp$_6.next();
              var tmp$_7, tmp$_8, tmp$_9;
              var tmp$_10;
              if ((tmp$_7 = element_0.reportSeriesFilters) != null) {
                var maxByOrNull$result_0;
                maxByOrNull$break:
                  do {
                    var iterator_0 = tmp$_7.iterator();
                    if (!iterator_0.hasNext()) {
                      maxByOrNull$result_0 = null;
                      break maxByOrNull$break;
                    }
                    var maxElem_0 = iterator_0.next();
                    if (!iterator_0.hasNext()) {
                      maxByOrNull$result_0 = maxElem_0;
                      break maxByOrNull$break;
                    }
                    var maxValue_0 = maxElem_0.reportFilterUid;
                    do {
                      var e_1 = iterator_0.next();
                      var v_0 = e_1.reportFilterUid;
                      if (Kotlin.compareTo(maxValue_0, v_0) < 0) {
                        maxElem_0 = e_1;
                        maxValue_0 = v_0;
                      }
                    } while (iterator_0.hasNext());
                    maxByOrNull$result_0 = maxElem_0;
                  } while (false);
                tmp$_10 = maxByOrNull$result_0;
              } else 
                tmp$_10 = null;
              var maxFilter = (tmp$_9 = (tmp$_8 = tmp$_10) != null ? tmp$_8.reportFilterUid : null) != null ? tmp$_9 : 0;
              var a = currentMaxFilter.v;
              currentMaxFilter.v = JsMath.max(a, maxFilter);
            }
          var nextSeries = (tmp$_3 = maxSeries != null ? maxSeries.reportSeriesUid : null) != null ? tmp$_3 : 1;
          this.$this.seriesCounter_0 = nextSeries;
          this.$this.filterCounter_0 = currentMaxFilter.v + 1 | 0;
        } else {
          var $receiver_1 = new ReportSeries();
          var id = (function(scope) {
  return scope.$this.seriesCounter_0++;
})(this);
          $receiver_1.reportSeriesName = 'Series ' + id;
          $receiver_1.reportSeriesUid = id;
          reportSeriesList = listOf_0($receiver_1);
        }
        return ReportWithSeriesWithFilters_init(report, reportSeriesList);
      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);
};
  ReportEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_21(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ReportEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = ReportWithSeriesWithFilters.Companion.serializer();
    var tmp$_3;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_3 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    tmp$ = new ReportWithSeriesWithFilters();
  }
  var editEntity = tmp$;
  var $receiver = ReportEditPresenter$XAxisOptions$values();
  var destination = ArrayList_init_0($receiver.length);
  var tmp$_4;
  for (tmp$_4 = 0; tmp$_4 !== $receiver.length; ++tmp$_4) {
    var item = $receiver[tmp$_4];
    destination.add_11rb$(new ReportEditPresenter$XAxisMessageIdOption(item, this.context, this.di));
  }
  var firstOrNull$result;
  firstOrNull$break:
    do {
      var tmp$_5;
      tmp$_5 = destination.iterator();
      while (tmp$_5.hasNext()) {
        var element = tmp$_5.next();
        if (element.code === editEntity.xAxis) {
          firstOrNull$result = element;
          break firstOrNull$break;
        }
      }
      firstOrNull$result = null;
    } while (false);
  this.handleXAxisSelected_iowaj7$(Kotlin.isType(tmp$_0 = firstOrNull$result, MessageIdOption) ? tmp$_0 : throwCCE());
  if (editEntity.reportDateRangeSelection === 805) {
    this.handleAddCustomRange_uod4eh$(toDateRangeMoment(editEntity));
  }
  var reportSeries = editEntity.reportSeries;
  var reportSeriesList;
  if (!(reportSeries == null || isBlank(reportSeries))) {
    reportSeriesList = safeParseList(this.di, ListSerializer(ReportSeries.Companion.serializer()), getKClass(ReportSeries), reportSeries);
    var $receiver_0 = reportSeriesList;
    var maxByOrNull$result;
    maxByOrNull$break:
      do {
        var iterator = $receiver_0.iterator();
        if (!iterator.hasNext()) {
          maxByOrNull$result = null;
          break maxByOrNull$break;
        }
        var maxElem = iterator.next();
        if (!iterator.hasNext()) {
          maxByOrNull$result = maxElem;
          break maxByOrNull$break;
        }
        var maxValue = maxElem.reportSeriesUid;
        do {
          var e = iterator.next();
          var v = e.reportSeriesUid;
          if (Kotlin.compareTo(maxValue, v) < 0) {
            maxElem = e;
            maxValue = v;
          }
        } while (iterator.hasNext());
        maxByOrNull$result = maxElem;
      } while (false);
    var max = maxByOrNull$result;
    var nextSeries = ((tmp$_1 = max != null ? max.reportSeriesUid : null) != null ? tmp$_1 : 0) + 1 | 0;
    this.seriesCounter_0 = nextSeries;
    var currentMaxFilter = {
  v: 0};
    var tmp$_6;
    tmp$_6 = reportSeriesList.iterator();
    loop_label:
      while (tmp$_6.hasNext()) {
        var element_0 = tmp$_6.next();
        var tmp$_7, tmp$_8, tmp$_9;
        var tmp$_10;
        if ((tmp$_7 = element_0.reportSeriesFilters) != null) {
          var maxByOrNull$result_0;
          maxByOrNull$break:
            do {
              var iterator_0 = tmp$_7.iterator();
              if (!iterator_0.hasNext()) {
                maxByOrNull$result_0 = null;
                break maxByOrNull$break;
              }
              var maxElem_0 = iterator_0.next();
              if (!iterator_0.hasNext()) {
                maxByOrNull$result_0 = maxElem_0;
                break maxByOrNull$break;
              }
              var maxValue_0 = maxElem_0.reportFilterUid;
              do {
                var e_0 = iterator_0.next();
                var v_0 = e_0.reportFilterUid;
                if (Kotlin.compareTo(maxValue_0, v_0) < 0) {
                  maxElem_0 = e_0;
                  maxValue_0 = v_0;
                }
              } while (iterator_0.hasNext());
              maxByOrNull$result_0 = maxElem_0;
            } while (false);
          tmp$_10 = maxByOrNull$result_0;
        } else 
          tmp$_10 = null;
        var maxFilter = (tmp$_9 = (tmp$_8 = tmp$_10) != null ? tmp$_8.reportFilterUid : null) != null ? tmp$_9 : 0;
        var a = currentMaxFilter.v;
        currentMaxFilter.v = JsMath.max(a, maxFilter);
      }
    this.filterCounter_0 = currentMaxFilter.v + 1 | 0;
    editEntity.reportSeriesWithFiltersList = reportSeriesList;
  } else {
    var tmp$_11 = editEntity.reportSeriesWithFiltersList == null;
    if (!tmp$_11) {
      tmp$_11 = ((tmp$_2 = editEntity.reportSeriesWithFiltersList) != null ? tmp$_2 == null || tmp$_2.isEmpty() : null) === true;
    }
    if (tmp$_11) {
      var $receiver_1 = new ReportSeries();
      var id = (function(scope) {
  return scope.seriesCounter_0++;
})(this);
      $receiver_1.reportSeriesName = 'Series ' + id;
      $receiver_1.reportSeriesUid = id;
      reportSeriesList = listOf_0($receiver_1);
      editEntity.reportSeriesWithFiltersList = reportSeriesList;
    }
  }
  return editEntity;
};
  ReportEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  tmp$ = this.entity;
  if (tmp$ == null) {
    return;
  }
  var entityVal = tmp$;
  tmp$_0 = this.di;
  tmp$_1 = ListSerializer(ReportSeries.Companion.serializer());
  var entity = (tmp$_2 = entityVal.reportSeriesWithFiltersList) != null ? tmp$_2 : emptyList();
  var tmp$_3;
  var json = get_direct(tmp$_0).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_3 : throwCCE(), null);
  entityVal.reportSeries = json.encodeToString_tf03ej$(tmp$_1, entity);
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  ReportEditPresenter.prototype.handleAddCustomRange_uod4eh$ = function(dateRangeMoment) {
  var tmp$;
  var tmp$_0 = this.view;
  var $receiver = ReportEditPresenter$DateRangeOptions$values();
  var destination = ArrayList_init_0($receiver.length);
  var tmp$_1;
  for (tmp$_1 = 0; tmp$_1 !== $receiver.length; ++tmp$_1) {
    var item = $receiver[tmp$_1];
    var tmp$_2;
    destination.add_11rb$(new ObjectMessageIdOption(item.messageId, this.context, item.code, (tmp$_2 = item.dateRange) != null ? tmp$_2 : dateRangeMoment, this.di, item.dateRange != null ? null : toDisplayString(dateRangeMoment)));
  }
  tmp$_0.dateRangeOptions = destination;
  this.view.selectedDateRangeMoment = dateRangeMoment;
  tmp$ = this.entity;
  if (tmp$ == null) {
    return;
  }
  var entityVal = tmp$;
  entityVal.reportDateRangeSelection = 805;
  this.view.entity = entityVal;
};
  ReportEditPresenter.prototype.handleRemoveSeries_13jbm9$ = function(series) {
  var tmp$, tmp$_0;
  var entityVal = this.entity;
  var newList = (tmp$_0 = (tmp$ = entityVal != null ? entityVal.reportSeriesWithFiltersList : null) != null ? toMutableList(tmp$) : null) != null ? tmp$_0 : ArrayList_init();
  newList.remove_11rb$(series);
    entityVal != null ? (entityVal.reportSeriesWithFiltersList = toList(newList)) : null;
  this.view.entity = entityVal;
};
  ReportEditPresenter.prototype.handleClickAddSeries = function() {
  var tmp$, tmp$_0;
  var $receiver = new ReportSeries();
  var id = (function(scope) {
  return scope.seriesCounter_0++;
})(this);
  $receiver.reportSeriesName = 'Series ' + id;
  $receiver.reportSeriesUid = id;
  var series = $receiver;
  var entityVal = this.entity;
  var newList = (tmp$_0 = (tmp$ = entityVal != null ? entityVal.reportSeriesWithFiltersList : null) != null ? toMutableList(tmp$) : null) != null ? tmp$_0 : ArrayList_init();
  newList.add_11rb$(series);
    entityVal != null ? (entityVal.reportSeriesWithFiltersList = toList(newList)) : null;
  this.view.entity = entityVal;
};
  ReportEditPresenter.prototype.handleRemoveFilter_4zy6we$ = function(filter) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  var entityVal = this.entity;
  var newSeriesList = (tmp$_0 = (tmp$ = entityVal != null ? entityVal.reportSeriesWithFiltersList : null) != null ? toMutableList(tmp$) : null) != null ? tmp$_0 : ArrayList_init();
  var firstOrNull$result;
  firstOrNull$break:
    do {
      var tmp$_3;
      tmp$_3 = newSeriesList.iterator();
      while (tmp$_3.hasNext()) {
        var element = tmp$_3.next();
        if (element.reportSeriesUid === filter.reportFilterSeriesUid) {
          firstOrNull$result = element;
          break firstOrNull$break;
        }
      }
      firstOrNull$result = null;
    } while (false);
  tmp$_1 = firstOrNull$result;
  if (tmp$_1 == null) {
    return;
  }
  var seriesToRemoveFilter = tmp$_1;
  newSeriesList.remove_11rb$(seriesToRemoveFilter);
  var newFilterList = (tmp$_2 = seriesToRemoveFilter.reportSeriesFilters) != null ? toMutableList(tmp$_2) : null;
    newFilterList != null ? newFilterList.remove_11rb$(filter) : null;
  var $receiver = new ReportSeries();
  $receiver.reportSeriesUid = seriesToRemoveFilter.reportSeriesUid;
  $receiver.reportSeriesVisualType = seriesToRemoveFilter.reportSeriesVisualType;
  $receiver.reportSeriesYAxis = seriesToRemoveFilter.reportSeriesYAxis;
  $receiver.reportSeriesSubGroup = seriesToRemoveFilter.reportSeriesSubGroup;
  $receiver.reportSeriesName = seriesToRemoveFilter.reportSeriesName;
  $receiver.reportSeriesFilters = newFilterList != null ? toList(newFilterList) : null;
  newSeriesList.add_11rb$($receiver);
    entityVal != null ? (entityVal.reportSeriesWithFiltersList = toList(newSeriesList)) : null;
  this.view.entity = entityVal;
};
  ReportEditPresenter.prototype.handleOnFilterClicked_4zy6we$ = function(filter) {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, filter, ReportFilterEditView$Companion_getInstance().VIEW_NAME, getKClass(ReportFilter), ReportFilter.Companion.serializer(), ReportEditPresenter$Companion_getInstance().RESULT_REPORT_FILTER_KEY));
};
  ReportEditPresenter.prototype.handleDateRangeChange = function() {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, XapiPackageContentView$Companion_getInstance().VIEW_NAME, getKClass(DateRangeMoment), DateRangeMoment.Companion.serializer(), ReportEditPresenter$Companion_getInstance().RESULT_DATE_RANGE_KEY));
};
  function Coroutine$ReportEditPresenter$handleClickSave$lambda$lambda(this$ReportEditPresenter_0, closure$entity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ReportEditPresenter = this$ReportEditPresenter_0;
    this.local$closure$entity = closure$entity_0;
  }
  Coroutine$ReportEditPresenter$handleClickSave$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ReportEditPresenter$handleClickSave$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ReportEditPresenter$handleClickSave$lambda$lambda.prototype.constructor = Coroutine$ReportEditPresenter$handleClickSave$lambda$lambda;
  Coroutine$ReportEditPresenter$handleClickSave$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$ = this.local$this$ReportEditPresenter;
        var di = this.local$this$ReportEditPresenter.di;
        var strategy = ListSerializer(ReportWithSeriesWithFilters.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_0;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
        return tmp$.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity)) , Unit;
      case 1:
        throw this.exception_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 ReportEditPresenter$handleClickSave$lambda$lambda(this$ReportEditPresenter_0, closure$entity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ReportEditPresenter$handleClickSave$lambda$lambda(this$ReportEditPresenter_0, closure$entity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ReportEditPresenter$handleClickSave$lambda(closure$entity_0, this$ReportEditPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$ReportEditPresenter = this$ReportEditPresenter_0;
  }
  Coroutine$ReportEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ReportEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ReportEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$ReportEditPresenter$handleClickSave$lambda;
  Coroutine$ReportEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (!equals(this.local$closure$entity.reportUid, L0)) {
          this.state_0 = 2;
          this.result_0 = this.local$this$ReportEditPresenter.repo.reportDao.updateAsync_7abdyy$(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          var tmp$ = this.local$this$ReportEditPresenter.systemImpl;
          var tmp$_0 = ReportDetailView$Companion_getInstance().VIEW_NAME;
          var tmp$_1 = UstadEditView$Companion_getInstance().ARG_ENTITY_JSON;
          var di = this.local$this$ReportEditPresenter.di;
          var strategy = ReportWithSeriesWithFilters.Companion.serializer();
          var entity = this.local$closure$entity;
          var tmp$_2;
          var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_2 : throwCCE(), null);
          return tmp$.go_gofqk3$(tmp$_0, mapOf_0(to(tmp$_1, json.encodeToString_tf03ej$(strategy, entity))), this.local$this$ReportEditPresenter.context) , Unit;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        this.result_0 = withContext(doorMainDispatcher(), ReportEditPresenter$handleClickSave$lambda$lambda(this.local$this$ReportEditPresenter, this.local$closure$entity), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        return Unit;
      case 4:
        return;
      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 ReportEditPresenter$handleClickSave$lambda(closure$entity_0, this$ReportEditPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ReportEditPresenter$handleClickSave$lambda(closure$entity_0, this$ReportEditPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ReportEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  var tmp$, tmp$_0, tmp$_1;
  var $receiver = entity.reportTitle;
  if ($receiver == null || $receiver.length === 0) {
    this.view.titleErrorText = this.systemImpl.getString(2127, this.context);
    return;
  } else {
    this.view.titleErrorText = null;
  }
  tmp$ = this.di;
  tmp$_0 = ListSerializer(ReportSeries.Companion.serializer());
  var entity_0 = (tmp$_1 = entity.reportSeriesWithFiltersList) != null ? tmp$_1 : emptyList();
  var tmp$_2;
  var json = get_direct(tmp$).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_2 : throwCCE(), null);
  entity.reportSeries = json.encodeToString_tf03ej$(tmp$_0, entity_0);
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ReportEditPresenter$handleClickSave$lambda(entity, this));
};
  ReportEditPresenter.prototype.handleXAxisSelected_iowaj7$ = function(selectedOption) {
  if (selectedOption.optionId === 300 || selectedOption.optionId === 302 || selectedOption.optionId === 301) {
    var tmp$ = this.view;
    var $receiver = ReportEditPresenter$SubGroupOptions$values();
    var destination = ArrayList_init_0($receiver.length);
    var tmp$_0;
    for (tmp$_0 = 0; tmp$_0 !== $receiver.length; ++tmp$_0) {
      var item = $receiver[tmp$_0];
      destination.add_11rb$(new ReportEditPresenter$SubGroupByMessageIdOption(item, this.context, this.di));
    }
    var destination_0 = ArrayList_init();
    var tmp$_1;
    tmp$_1 = destination.iterator();
    while (tmp$_1.hasNext()) {
      var element = tmp$_1.next();
      if (element.code === 306 || element.code === 304 || element.code === 307 || element.code === 0 || element.code === 309 || element.code === 308) 
        destination_0.add_11rb$(element);
    }
    tmp$.subGroupOptions = destination_0;
  } else if (selectedOption.optionId === 307 || selectedOption.optionId === 304 || selectedOption.optionId === 306 || selectedOption.optionId === 309 || selectedOption.optionId === 308) {
    var tmp$_2 = this.view;
    var $receiver_0 = ReportEditPresenter$SubGroupOptions$values();
    var destination_1 = ArrayList_init_0($receiver_0.length);
    var tmp$_3;
    for (tmp$_3 = 0; tmp$_3 !== $receiver_0.length; ++tmp$_3) {
      var item_0 = $receiver_0[tmp$_3];
      destination_1.add_11rb$(new ReportEditPresenter$SubGroupByMessageIdOption(item_0, this.context, this.di));
    }
    tmp$_2.subGroupOptions = destination_1;
  }
};
  ReportEditPresenter.prototype.handleDateRangeSelected_iowaj7$ = function(selectedOption) {
  var tmp$, tmp$_0;
  if (selectedOption.optionId === ReportEditPresenter$DateRangeOptions$NEW_CUSTOM_RANGE_getInstance().code) {
    return;
  }
  var tmp$_1;
  if ((tmp$ = this.view.dateRangeOptions) != null) {
    var firstOrNull$result;
    firstOrNull$break:
      do {
        var tmp$_2;
        tmp$_2 = tmp$.iterator();
        while (tmp$_2.hasNext()) {
          var element = tmp$_2.next();
          if (element.code === selectedOption.optionId) {
            firstOrNull$result = element;
            break firstOrNull$break;
          }
        }
        firstOrNull$result = null;
      } while (false);
    tmp$_1 = firstOrNull$result;
  } else 
    tmp$_1 = null;
  tmp$_0 = tmp$_1;
  if (tmp$_0 == null) {
    return;
  }
  var dateRangeFound = tmp$_0;
  this.view.selectedDateRangeMoment = dateRangeFound.obj;
};
  function ReportEditPresenter$Companion() {
    ReportEditPresenter$Companion_instance = this;
    this.RESULT_REPORT_FILTER_KEY = 'Filters';
    this.RESULT_DATE_RANGE_KEY = 'DateRanges';
  }
  ReportEditPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ReportEditPresenter$Companion_instance = null;
  function ReportEditPresenter$Companion_getInstance() {
    if (ReportEditPresenter$Companion_instance === null) {
      new ReportEditPresenter$Companion();
    }
    return ReportEditPresenter$Companion_instance;
  }
  ReportEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ReportEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function ReportFilterEditPresenter(context, arguments_0, view, di, lifecycleOwner) {
    ReportFilterEditPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.fieldRequiredText_0 = this.systemImpl.getString(2127, context);
    this.uidhelperDeferred_0 = CompletableDeferred();
    this.uidAndLabelOneToManyHelper_0 = new DefaultOneToManyJoinEditHelper(getPropertyCallableRef('uid', 1, function($receiver) {
  return $receiver.uid;
}, function($receiver, value) {
  $receiver.uid = value;
}), 'state_uid_list', ListSerializer(UidAndLabel.Companion.serializer()), ListSerializer(UidAndLabel.Companion.serializer()), this, getKClass(UidAndLabel), ReportFilterEditPresenter$uidAndLabelOneToManyHelper$lambda);
  }
  Object.defineProperty(ReportFilterEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$JSON_getInstance();
}});
  function ReportFilterEditPresenter$FieldOption(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ReportFilterEditPresenter$FieldOption_initFields() {
    ReportFilterEditPresenter$FieldOption_initFields = function() {
};
    ReportFilterEditPresenter$FieldOption$PERSON_GENDER_instance = new ReportFilterEditPresenter$FieldOption('PERSON_GENDER', 0, 100, 2248);
    ReportFilterEditPresenter$FieldOption$PERSON_AGE_instance = new ReportFilterEditPresenter$FieldOption('PERSON_AGE', 1, 101, 2249);
    ReportFilterEditPresenter$FieldOption$CONTENT_COMPLETION_instance = new ReportFilterEditPresenter$FieldOption('CONTENT_COMPLETION', 2, 102, 2250);
    ReportFilterEditPresenter$FieldOption$CONTENT_ENTRY_instance = new ReportFilterEditPresenter$FieldOption('CONTENT_ENTRY', 3, 103, 2251);
    ReportFilterEditPresenter$FieldOption$CONTENT_PROGRESS_instance = new ReportFilterEditPresenter$FieldOption('CONTENT_PROGRESS', 4, 104, 2252);
    ReportFilterEditPresenter$FieldOption$ATTENDANCE_PERCENTAGE_instance = new ReportFilterEditPresenter$FieldOption('ATTENDANCE_PERCENTAGE', 5, 105, 2253);
    ReportFilterEditPresenter$FieldOption$ENROLMENT_OUTCOME_instance = new ReportFilterEditPresenter$FieldOption('ENROLMENT_OUTCOME', 6, 106, 2386);
    ReportFilterEditPresenter$FieldOption$ENROLMENT_LEAVING_REASON_instance = new ReportFilterEditPresenter$FieldOption('ENROLMENT_LEAVING_REASON', 7, 107, 2387);
  }
  var ReportFilterEditPresenter$FieldOption$PERSON_GENDER_instance;
  function ReportFilterEditPresenter$FieldOption$PERSON_GENDER_getInstance() {
    ReportFilterEditPresenter$FieldOption_initFields();
    return ReportFilterEditPresenter$FieldOption$PERSON_GENDER_instance;
  }
  var ReportFilterEditPresenter$FieldOption$PERSON_AGE_instance;
  function ReportFilterEditPresenter$FieldOption$PERSON_AGE_getInstance() {
    ReportFilterEditPresenter$FieldOption_initFields();
    return ReportFilterEditPresenter$FieldOption$PERSON_AGE_instance;
  }
  var ReportFilterEditPresenter$FieldOption$CONTENT_COMPLETION_instance;
  function ReportFilterEditPresenter$FieldOption$CONTENT_COMPLETION_getInstance() {
    ReportFilterEditPresenter$FieldOption_initFields();
    return ReportFilterEditPresenter$FieldOption$CONTENT_COMPLETION_instance;
  }
  var ReportFilterEditPresenter$FieldOption$CONTENT_ENTRY_instance;
  function ReportFilterEditPresenter$FieldOption$CONTENT_ENTRY_getInstance() {
    ReportFilterEditPresenter$FieldOption_initFields();
    return ReportFilterEditPresenter$FieldOption$CONTENT_ENTRY_instance;
  }
  var ReportFilterEditPresenter$FieldOption$CONTENT_PROGRESS_instance;
  function ReportFilterEditPresenter$FieldOption$CONTENT_PROGRESS_getInstance() {
    ReportFilterEditPresenter$FieldOption_initFields();
    return ReportFilterEditPresenter$FieldOption$CONTENT_PROGRESS_instance;
  }
  var ReportFilterEditPresenter$FieldOption$ATTENDANCE_PERCENTAGE_instance;
  function ReportFilterEditPresenter$FieldOption$ATTENDANCE_PERCENTAGE_getInstance() {
    ReportFilterEditPresenter$FieldOption_initFields();
    return ReportFilterEditPresenter$FieldOption$ATTENDANCE_PERCENTAGE_instance;
  }
  var ReportFilterEditPresenter$FieldOption$ENROLMENT_OUTCOME_instance;
  function ReportFilterEditPresenter$FieldOption$ENROLMENT_OUTCOME_getInstance() {
    ReportFilterEditPresenter$FieldOption_initFields();
    return ReportFilterEditPresenter$FieldOption$ENROLMENT_OUTCOME_instance;
  }
  var ReportFilterEditPresenter$FieldOption$ENROLMENT_LEAVING_REASON_instance;
  function ReportFilterEditPresenter$FieldOption$ENROLMENT_LEAVING_REASON_getInstance() {
    ReportFilterEditPresenter$FieldOption_initFields();
    return ReportFilterEditPresenter$FieldOption$ENROLMENT_LEAVING_REASON_instance;
  }
  ReportFilterEditPresenter$FieldOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'FieldOption', 
  interfaces: [Enum]};
  function ReportFilterEditPresenter$FieldOption$values() {
    return [ReportFilterEditPresenter$FieldOption$PERSON_GENDER_getInstance(), ReportFilterEditPresenter$FieldOption$PERSON_AGE_getInstance(), ReportFilterEditPresenter$FieldOption$CONTENT_COMPLETION_getInstance(), ReportFilterEditPresenter$FieldOption$CONTENT_ENTRY_getInstance(), ReportFilterEditPresenter$FieldOption$CONTENT_PROGRESS_getInstance(), ReportFilterEditPresenter$FieldOption$ATTENDANCE_PERCENTAGE_getInstance(), ReportFilterEditPresenter$FieldOption$ENROLMENT_OUTCOME_getInstance(), ReportFilterEditPresenter$FieldOption$ENROLMENT_LEAVING_REASON_getInstance()];
  }
  ReportFilterEditPresenter$FieldOption.values = ReportFilterEditPresenter$FieldOption$values;
  function ReportFilterEditPresenter$FieldOption$valueOf(name) {
    switch (name) {
      case 'PERSON_GENDER':
        return ReportFilterEditPresenter$FieldOption$PERSON_GENDER_getInstance();
      case 'PERSON_AGE':
        return ReportFilterEditPresenter$FieldOption$PERSON_AGE_getInstance();
      case 'CONTENT_COMPLETION':
        return ReportFilterEditPresenter$FieldOption$CONTENT_COMPLETION_getInstance();
      case 'CONTENT_ENTRY':
        return ReportFilterEditPresenter$FieldOption$CONTENT_ENTRY_getInstance();
      case 'CONTENT_PROGRESS':
        return ReportFilterEditPresenter$FieldOption$CONTENT_PROGRESS_getInstance();
      case 'ATTENDANCE_PERCENTAGE':
        return ReportFilterEditPresenter$FieldOption$ATTENDANCE_PERCENTAGE_getInstance();
      case 'ENROLMENT_OUTCOME':
        return ReportFilterEditPresenter$FieldOption$ENROLMENT_OUTCOME_getInstance();
      case 'ENROLMENT_LEAVING_REASON':
        return ReportFilterEditPresenter$FieldOption$ENROLMENT_LEAVING_REASON_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ReportFilterEditPresenter.FieldOption.' + name);
    }
  }
  ReportFilterEditPresenter$FieldOption.valueOf_61zpoe$ = ReportFilterEditPresenter$FieldOption$valueOf;
  function ReportFilterEditPresenter$FieldMessageIdOption(day, context, di) {
    MessageIdOption.call(this, day.messageId, context, day.optionVal, di);
  }
  ReportFilterEditPresenter$FieldMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'FieldMessageIdOption', 
  interfaces: [MessageIdOption]};
  function ReportFilterEditPresenter$ConditionOption(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ReportFilterEditPresenter$ConditionOption_initFields() {
    ReportFilterEditPresenter$ConditionOption_initFields = function() {
};
    ReportFilterEditPresenter$ConditionOption$IS_CONDITION_instance = new ReportFilterEditPresenter$ConditionOption('IS_CONDITION', 0, 200, 2254);
    ReportFilterEditPresenter$ConditionOption$IS_NOT_CONDITION_instance = new ReportFilterEditPresenter$ConditionOption('IS_NOT_CONDITION', 1, 201, 2255);
    ReportFilterEditPresenter$ConditionOption$GREATER_THAN_CONDITION_instance = new ReportFilterEditPresenter$ConditionOption('GREATER_THAN_CONDITION', 2, 202, 2256);
    ReportFilterEditPresenter$ConditionOption$LESS_THAN_CONDITION_instance = new ReportFilterEditPresenter$ConditionOption('LESS_THAN_CONDITION', 3, 203, 2257);
    ReportFilterEditPresenter$ConditionOption$BETWEEN_CONDITION_instance = new ReportFilterEditPresenter$ConditionOption('BETWEEN_CONDITION', 4, 205, 2260);
    ReportFilterEditPresenter$ConditionOption$IN_LIST_CONDITION_instance = new ReportFilterEditPresenter$ConditionOption('IN_LIST_CONDITION', 5, 206, 2258);
    ReportFilterEditPresenter$ConditionOption$NOT_IN_LIST_CONDITION_instance = new ReportFilterEditPresenter$ConditionOption('NOT_IN_LIST_CONDITION', 6, 207, 2259);
  }
  var ReportFilterEditPresenter$ConditionOption$IS_CONDITION_instance;
  function ReportFilterEditPresenter$ConditionOption$IS_CONDITION_getInstance() {
    ReportFilterEditPresenter$ConditionOption_initFields();
    return ReportFilterEditPresenter$ConditionOption$IS_CONDITION_instance;
  }
  var ReportFilterEditPresenter$ConditionOption$IS_NOT_CONDITION_instance;
  function ReportFilterEditPresenter$ConditionOption$IS_NOT_CONDITION_getInstance() {
    ReportFilterEditPresenter$ConditionOption_initFields();
    return ReportFilterEditPresenter$ConditionOption$IS_NOT_CONDITION_instance;
  }
  var ReportFilterEditPresenter$ConditionOption$GREATER_THAN_CONDITION_instance;
  function ReportFilterEditPresenter$ConditionOption$GREATER_THAN_CONDITION_getInstance() {
    ReportFilterEditPresenter$ConditionOption_initFields();
    return ReportFilterEditPresenter$ConditionOption$GREATER_THAN_CONDITION_instance;
  }
  var ReportFilterEditPresenter$ConditionOption$LESS_THAN_CONDITION_instance;
  function ReportFilterEditPresenter$ConditionOption$LESS_THAN_CONDITION_getInstance() {
    ReportFilterEditPresenter$ConditionOption_initFields();
    return ReportFilterEditPresenter$ConditionOption$LESS_THAN_CONDITION_instance;
  }
  var ReportFilterEditPresenter$ConditionOption$BETWEEN_CONDITION_instance;
  function ReportFilterEditPresenter$ConditionOption$BETWEEN_CONDITION_getInstance() {
    ReportFilterEditPresenter$ConditionOption_initFields();
    return ReportFilterEditPresenter$ConditionOption$BETWEEN_CONDITION_instance;
  }
  var ReportFilterEditPresenter$ConditionOption$IN_LIST_CONDITION_instance;
  function ReportFilterEditPresenter$ConditionOption$IN_LIST_CONDITION_getInstance() {
    ReportFilterEditPresenter$ConditionOption_initFields();
    return ReportFilterEditPresenter$ConditionOption$IN_LIST_CONDITION_instance;
  }
  var ReportFilterEditPresenter$ConditionOption$NOT_IN_LIST_CONDITION_instance;
  function ReportFilterEditPresenter$ConditionOption$NOT_IN_LIST_CONDITION_getInstance() {
    ReportFilterEditPresenter$ConditionOption_initFields();
    return ReportFilterEditPresenter$ConditionOption$NOT_IN_LIST_CONDITION_instance;
  }
  ReportFilterEditPresenter$ConditionOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ConditionOption', 
  interfaces: [Enum]};
  function ReportFilterEditPresenter$ConditionOption$values() {
    return [ReportFilterEditPresenter$ConditionOption$IS_CONDITION_getInstance(), ReportFilterEditPresenter$ConditionOption$IS_NOT_CONDITION_getInstance(), ReportFilterEditPresenter$ConditionOption$GREATER_THAN_CONDITION_getInstance(), ReportFilterEditPresenter$ConditionOption$LESS_THAN_CONDITION_getInstance(), ReportFilterEditPresenter$ConditionOption$BETWEEN_CONDITION_getInstance(), ReportFilterEditPresenter$ConditionOption$IN_LIST_CONDITION_getInstance(), ReportFilterEditPresenter$ConditionOption$NOT_IN_LIST_CONDITION_getInstance()];
  }
  ReportFilterEditPresenter$ConditionOption.values = ReportFilterEditPresenter$ConditionOption$values;
  function ReportFilterEditPresenter$ConditionOption$valueOf(name) {
    switch (name) {
      case 'IS_CONDITION':
        return ReportFilterEditPresenter$ConditionOption$IS_CONDITION_getInstance();
      case 'IS_NOT_CONDITION':
        return ReportFilterEditPresenter$ConditionOption$IS_NOT_CONDITION_getInstance();
      case 'GREATER_THAN_CONDITION':
        return ReportFilterEditPresenter$ConditionOption$GREATER_THAN_CONDITION_getInstance();
      case 'LESS_THAN_CONDITION':
        return ReportFilterEditPresenter$ConditionOption$LESS_THAN_CONDITION_getInstance();
      case 'BETWEEN_CONDITION':
        return ReportFilterEditPresenter$ConditionOption$BETWEEN_CONDITION_getInstance();
      case 'IN_LIST_CONDITION':
        return ReportFilterEditPresenter$ConditionOption$IN_LIST_CONDITION_getInstance();
      case 'NOT_IN_LIST_CONDITION':
        return ReportFilterEditPresenter$ConditionOption$NOT_IN_LIST_CONDITION_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ReportFilterEditPresenter.ConditionOption.' + name);
    }
  }
  ReportFilterEditPresenter$ConditionOption.valueOf_61zpoe$ = ReportFilterEditPresenter$ConditionOption$valueOf;
  function ReportFilterEditPresenter$ConditionMessageIdOption(day, context, di) {
    MessageIdOption.call(this, day.messageId, context, day.optionVal, di);
  }
  ReportFilterEditPresenter$ConditionMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ConditionMessageIdOption', 
  interfaces: [MessageIdOption]};
  function ReportFilterEditPresenter$ContentCompletionStatusOption(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ReportFilterEditPresenter$ContentCompletionStatusOption_initFields() {
    ReportFilterEditPresenter$ContentCompletionStatusOption_initFields = function() {
};
    ReportFilterEditPresenter$ContentCompletionStatusOption$COMPLETED_instance = new ReportFilterEditPresenter$ContentCompletionStatusOption('COMPLETED', 0, 100, 2093);
    ReportFilterEditPresenter$ContentCompletionStatusOption$PASSED_instance = new ReportFilterEditPresenter$ContentCompletionStatusOption('PASSED', 1, 102, 2090);
    ReportFilterEditPresenter$ContentCompletionStatusOption$FAILED_instance = new ReportFilterEditPresenter$ContentCompletionStatusOption('FAILED', 2, 103, 2089);
  }
  var ReportFilterEditPresenter$ContentCompletionStatusOption$COMPLETED_instance;
  function ReportFilterEditPresenter$ContentCompletionStatusOption$COMPLETED_getInstance() {
    ReportFilterEditPresenter$ContentCompletionStatusOption_initFields();
    return ReportFilterEditPresenter$ContentCompletionStatusOption$COMPLETED_instance;
  }
  var ReportFilterEditPresenter$ContentCompletionStatusOption$PASSED_instance;
  function ReportFilterEditPresenter$ContentCompletionStatusOption$PASSED_getInstance() {
    ReportFilterEditPresenter$ContentCompletionStatusOption_initFields();
    return ReportFilterEditPresenter$ContentCompletionStatusOption$PASSED_instance;
  }
  var ReportFilterEditPresenter$ContentCompletionStatusOption$FAILED_instance;
  function ReportFilterEditPresenter$ContentCompletionStatusOption$FAILED_getInstance() {
    ReportFilterEditPresenter$ContentCompletionStatusOption_initFields();
    return ReportFilterEditPresenter$ContentCompletionStatusOption$FAILED_instance;
  }
  ReportFilterEditPresenter$ContentCompletionStatusOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContentCompletionStatusOption', 
  interfaces: [Enum]};
  function ReportFilterEditPresenter$ContentCompletionStatusOption$values() {
    return [ReportFilterEditPresenter$ContentCompletionStatusOption$COMPLETED_getInstance(), ReportFilterEditPresenter$ContentCompletionStatusOption$PASSED_getInstance(), ReportFilterEditPresenter$ContentCompletionStatusOption$FAILED_getInstance()];
  }
  ReportFilterEditPresenter$ContentCompletionStatusOption.values = ReportFilterEditPresenter$ContentCompletionStatusOption$values;
  function ReportFilterEditPresenter$ContentCompletionStatusOption$valueOf(name) {
    switch (name) {
      case 'COMPLETED':
        return ReportFilterEditPresenter$ContentCompletionStatusOption$COMPLETED_getInstance();
      case 'PASSED':
        return ReportFilterEditPresenter$ContentCompletionStatusOption$PASSED_getInstance();
      case 'FAILED':
        return ReportFilterEditPresenter$ContentCompletionStatusOption$FAILED_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ReportFilterEditPresenter.ContentCompletionStatusOption.' + name);
    }
  }
  ReportFilterEditPresenter$ContentCompletionStatusOption.valueOf_61zpoe$ = ReportFilterEditPresenter$ContentCompletionStatusOption$valueOf;
  function ReportFilterEditPresenter$ContentCompletionStatusMessageIdOption(day, context, di) {
    MessageIdOption.call(this, day.messageId, context, day.optionVal, di);
  }
  ReportFilterEditPresenter$ContentCompletionStatusMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContentCompletionStatusMessageIdOption', 
  interfaces: [MessageIdOption]};
  function ReportFilterEditPresenter$FilterValueType(name, ordinal) {
    Enum.call(this);
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ReportFilterEditPresenter$FilterValueType_initFields() {
    ReportFilterEditPresenter$FilterValueType_initFields = function() {
};
    ReportFilterEditPresenter$FilterValueType$DROPDOWN_instance = new ReportFilterEditPresenter$FilterValueType('DROPDOWN', 0);
    ReportFilterEditPresenter$FilterValueType$INTEGER_instance = new ReportFilterEditPresenter$FilterValueType('INTEGER', 1);
    ReportFilterEditPresenter$FilterValueType$BETWEEN_instance = new ReportFilterEditPresenter$FilterValueType('BETWEEN', 2);
    ReportFilterEditPresenter$FilterValueType$LIST_instance = new ReportFilterEditPresenter$FilterValueType('LIST', 3);
  }
  var ReportFilterEditPresenter$FilterValueType$DROPDOWN_instance;
  function ReportFilterEditPresenter$FilterValueType$DROPDOWN_getInstance() {
    ReportFilterEditPresenter$FilterValueType_initFields();
    return ReportFilterEditPresenter$FilterValueType$DROPDOWN_instance;
  }
  var ReportFilterEditPresenter$FilterValueType$INTEGER_instance;
  function ReportFilterEditPresenter$FilterValueType$INTEGER_getInstance() {
    ReportFilterEditPresenter$FilterValueType_initFields();
    return ReportFilterEditPresenter$FilterValueType$INTEGER_instance;
  }
  var ReportFilterEditPresenter$FilterValueType$BETWEEN_instance;
  function ReportFilterEditPresenter$FilterValueType$BETWEEN_getInstance() {
    ReportFilterEditPresenter$FilterValueType_initFields();
    return ReportFilterEditPresenter$FilterValueType$BETWEEN_instance;
  }
  var ReportFilterEditPresenter$FilterValueType$LIST_instance;
  function ReportFilterEditPresenter$FilterValueType$LIST_getInstance() {
    ReportFilterEditPresenter$FilterValueType_initFields();
    return ReportFilterEditPresenter$FilterValueType$LIST_instance;
  }
  ReportFilterEditPresenter$FilterValueType.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'FilterValueType', 
  interfaces: [Enum]};
  function ReportFilterEditPresenter$FilterValueType$values() {
    return [ReportFilterEditPresenter$FilterValueType$DROPDOWN_getInstance(), ReportFilterEditPresenter$FilterValueType$INTEGER_getInstance(), ReportFilterEditPresenter$FilterValueType$BETWEEN_getInstance(), ReportFilterEditPresenter$FilterValueType$LIST_getInstance()];
  }
  ReportFilterEditPresenter$FilterValueType.values = ReportFilterEditPresenter$FilterValueType$values;
  function ReportFilterEditPresenter$FilterValueType$valueOf(name) {
    switch (name) {
      case 'DROPDOWN':
        return ReportFilterEditPresenter$FilterValueType$DROPDOWN_getInstance();
      case 'INTEGER':
        return ReportFilterEditPresenter$FilterValueType$INTEGER_getInstance();
      case 'BETWEEN':
        return ReportFilterEditPresenter$FilterValueType$BETWEEN_getInstance();
      case 'LIST':
        return ReportFilterEditPresenter$FilterValueType$LIST_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ReportFilterEditPresenter.FilterValueType.' + name);
    }
  }
  ReportFilterEditPresenter$FilterValueType.valueOf_61zpoe$ = ReportFilterEditPresenter$FilterValueType$valueOf;
  function Coroutine$ReportFilterEditPresenter$handleAddOrEditUidAndLabel$lambda(this$ReportFilterEditPresenter_0, closure$entry_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ReportFilterEditPresenter = this$ReportFilterEditPresenter_0;
    this.local$closure$entry = closure$entry_0;
  }
  Coroutine$ReportFilterEditPresenter$handleAddOrEditUidAndLabel$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ReportFilterEditPresenter$handleAddOrEditUidAndLabel$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ReportFilterEditPresenter$handleAddOrEditUidAndLabel$lambda.prototype.constructor = Coroutine$ReportFilterEditPresenter$handleAddOrEditUidAndLabel$lambda;
  Coroutine$ReportFilterEditPresenter$handleAddOrEditUidAndLabel$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$ReportFilterEditPresenter.uidhelperDeferred_0.await(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        return this.local$this$ReportFilterEditPresenter.uidAndLabelOneToManyHelper_0.onEditResult_trkh7z$(this.local$closure$entry) , Unit;
      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 ReportFilterEditPresenter$handleAddOrEditUidAndLabel$lambda(this$ReportFilterEditPresenter_0, closure$entry_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ReportFilterEditPresenter$handleAddOrEditUidAndLabel$lambda(this$ReportFilterEditPresenter_0, closure$entry_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ReportFilterEditPresenter.prototype.handleAddOrEditUidAndLabel_0 = function(entry) {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ReportFilterEditPresenter$handleAddOrEditUidAndLabel$lambda(this, entry));
};
  ReportFilterEditPresenter.prototype.handleRemoveUidAndLabel_f7ipix$ = function(entry) {
  this.uidAndLabelOneToManyHelper_0.onDeactivateEntity_trkh7z$(entry);
};
  ReportFilterEditPresenter.prototype.clearUidAndLabelList = function() {
  var tmp$;
  this.uidAndLabelOneToManyHelper_0.entitiesToInsert;
  if ((tmp$ = this.uidAndLabelOneToManyHelper_0.liveList.getValue()) != null) {
    var tmp$_0;
    tmp$_0 = tmp$.iterator();
    while (tmp$_0.hasNext()) {
      var element = tmp$_0.next();
      this.uidAndLabelOneToManyHelper_0.onDeactivateEntity_trkh7z$(element);
    }
  }
};
  ReportFilterEditPresenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
  var tmp$ = this.view;
  var $receiver = ReportFilterEditPresenter$FieldOption$values();
  var destination = ArrayList_init_0($receiver.length);
  var tmp$_0;
  for (tmp$_0 = 0; tmp$_0 !== $receiver.length; ++tmp$_0) {
    var item = $receiver[tmp$_0];
    destination.add_11rb$(new ReportFilterEditPresenter$FieldMessageIdOption(item, this.context, this.di));
  }
  tmp$.fieldOptions = destination;
  this.view.uidAndLabelList = this.uidAndLabelOneToManyHelper_0.liveList;
};
  function Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda$lambda(this$ReportFilterEditPresenter_0, closure$entity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ReportFilterEditPresenter = this$ReportFilterEditPresenter_0;
    this.local$closure$entity = closure$entity_0;
  }
  Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda$lambda.prototype.constructor = Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda$lambda;
  Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2;
        tmp$_2 = this.local$this$ReportFilterEditPresenter.db.contentEntryDao;
        var tmp$_3;
        if ((tmp$_0 = (tmp$ = this.local$closure$entity.reportFilterValue) != null ? split(tmp$, [', ']) : null) != null) {
          var destination = ArrayList_init_0(collectionSizeOrDefault(tmp$_0, 10));
          var tmp$_4;
          tmp$_4 = tmp$_0.iterator();
          while (tmp$_4.hasNext()) {
            var item = tmp$_4.next();
            destination.add_11rb$(toLong(item));
          }
          tmp$_3 = destination;
        } else 
          tmp$_3 = null;
        this.state_0 = 2;
        this.result_0 = tmp$_2.getContentEntryFromUids_gox9k8$((tmp$_1 = tmp$_3) != null ? tmp$_1 : emptyList(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ReportFilterEditPresenter$onLoadFromJson$lambda$lambda(this$ReportFilterEditPresenter_0, closure$entity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda$lambda(this$ReportFilterEditPresenter_0, closure$entity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda$lambda_0(this$ReportFilterEditPresenter_0, closure$entity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ReportFilterEditPresenter = this$ReportFilterEditPresenter_0;
    this.local$closure$entity = closure$entity_0;
  }
  Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda$lambda_0.prototype.constructor = Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda$lambda_0;
  Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2;
        tmp$_2 = this.local$this$ReportFilterEditPresenter.db.leavingReasonDao;
        var tmp$_3;
        if ((tmp$_0 = (tmp$ = this.local$closure$entity.reportFilterValue) != null ? split(tmp$, [', ']) : null) != null) {
          var destination = ArrayList_init_0(collectionSizeOrDefault(tmp$_0, 10));
          var tmp$_4;
          tmp$_4 = tmp$_0.iterator();
          while (tmp$_4.hasNext()) {
            var item = tmp$_4.next();
            destination.add_11rb$(toLong(item));
          }
          tmp$_3 = destination;
        } else 
          tmp$_3 = null;
        this.state_0 = 2;
        this.result_0 = tmp$_2.getReasonsFromUids((tmp$_1 = tmp$_3) != null ? tmp$_1 : emptyList(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ReportFilterEditPresenter$onLoadFromJson$lambda$lambda_0(this$ReportFilterEditPresenter_0, closure$entity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda$lambda_0(this$ReportFilterEditPresenter_0, closure$entity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda(closure$entity_0, this$ReportFilterEditPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$ReportFilterEditPresenter = this$ReportFilterEditPresenter_0;
  }
  Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda.prototype.constructor = Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda;
  Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2;
        if (this.local$closure$entity.reportFilterField === 103) {
          var tmp$_3 = this.local$closure$entity.reportFilterValue != null;
          if (tmp$_3) {
            tmp$_3 = ((tmp$ = this.local$closure$entity.reportFilterValue) != null ? tmp$.length > 0 : null) === true;
          }
          if (tmp$_3) {
            this.state_0 = 5;
            this.result_0 = withTimeoutOrNull(L2000, ReportFilterEditPresenter$onLoadFromJson$lambda$lambda(this.local$this$ReportFilterEditPresenter, this.local$closure$entity), this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 6;
            continue;
          }
        } else {
          if (this.local$closure$entity.reportFilterField === 107) {
            var tmp$_4 = this.local$closure$entity.reportFilterValue != null;
            if (tmp$_4) {
              tmp$_4 = ((tmp$_1 = this.local$closure$entity.reportFilterValue) != null ? tmp$_1.length > 0 : null) === true;
            }
            if (tmp$_4) {
              this.state_0 = 2;
              this.result_0 = withTimeoutOrNull(L2000, ReportFilterEditPresenter$onLoadFromJson$lambda$lambda_0(this.local$this$ReportFilterEditPresenter, this.local$closure$entity), this);
              if (this.result_0 === COROUTINE_SUSPENDED) 
                return COROUTINE_SUSPENDED;
              continue;
            } else {
              this.state_0 = 3;
              continue;
            }
          } else {
            this.state_0 = 4;
            continue;
          }
        }
      case 1:
        throw this.exception_0;
      case 2:
        var reasons = (tmp$_2 = this.result_0) != null ? tmp$_2 : emptyList();
        this.local$this$ReportFilterEditPresenter.uidAndLabelOneToManyHelper_0.liveList.sendValue_11rb$(reasons);
        this.state_0 = 3;
        continue;
      case 3:
        this.state_0 = 4;
        continue;
      case 4:
        this.state_0 = 7;
        continue;
      case 5:
        var entries = (tmp$_0 = this.result_0) != null ? tmp$_0 : emptyList();
        this.local$this$ReportFilterEditPresenter.uidAndLabelOneToManyHelper_0.liveList.sendValue_11rb$(entries);
        this.state_0 = 6;
        continue;
      case 6:
        this.state_0 = 7;
        continue;
      case 7:
        return this.local$this$ReportFilterEditPresenter.uidhelperDeferred_0.complete_11rb$(true);
      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 ReportFilterEditPresenter$onLoadFromJson$lambda(closure$entity_0, this$ReportFilterEditPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ReportFilterEditPresenter$onLoadFromJson$lambda(closure$entity_0, this$ReportFilterEditPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ReportFilterEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$, tmp$_0, tmp$_1;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = (tmp$ = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON)) != null ? tmp$ : '';
  var di = this.di;
  var strategy = ReportFilter.Companion.serializer();
  var tmp$_2;
  var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_2 : throwCCE(), null);
  var entity = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  if (entity.reportFilterField !== 0) {
    var $receiver = ReportFilterEditPresenter$FieldOption$values();
    var destination = ArrayList_init_0($receiver.length);
    var tmp$_3;
    for (tmp$_3 = 0; tmp$_3 !== $receiver.length; ++tmp$_3) {
      var item = $receiver[tmp$_3];
      destination.add_11rb$(new ReportFilterEditPresenter$FieldMessageIdOption(item, this.context, this.di));
    }
    var firstOrNull$result;
    firstOrNull$break:
      do {
        var tmp$_4;
        tmp$_4 = destination.iterator();
        while (tmp$_4.hasNext()) {
          var element = tmp$_4.next();
          if (element.code === entity.reportFilterField) {
            firstOrNull$result = element;
            break firstOrNull$break;
          }
        }
        firstOrNull$result = null;
      } while (false);
    this.handleFieldOptionSelected_iowaj7$(Kotlin.isType(tmp$_0 = firstOrNull$result, MessageIdOption) ? tmp$_0 : throwCCE());
  }
  if (entity.reportFilterCondition !== 0) {
    var $receiver_0 = ReportFilterEditPresenter$ConditionOption$values();
    var destination_0 = ArrayList_init_0($receiver_0.length);
    var tmp$_5;
    for (tmp$_5 = 0; tmp$_5 !== $receiver_0.length; ++tmp$_5) {
      var item_0 = $receiver_0[tmp$_5];
      destination_0.add_11rb$(new ReportFilterEditPresenter$ConditionMessageIdOption(item_0, this.context, this.di));
    }
    var firstOrNull$result_0;
    firstOrNull$break:
      do {
        var tmp$_6;
        tmp$_6 = destination_0.iterator();
        while (tmp$_6.hasNext()) {
          var element_0 = tmp$_6.next();
          if (element_0.code === entity.reportFilterCondition) {
            firstOrNull$result_0 = element_0;
            break firstOrNull$break;
          }
        }
        firstOrNull$result_0 = null;
      } while (false);
    this.handleConditionOptionSelected_iowaj7$(Kotlin.isType(tmp$_1 = firstOrNull$result_0, MessageIdOption) ? tmp$_1 : throwCCE());
  }
  this.uidAndLabelOneToManyHelper_0.onLoadFromJsonSavedState_alv73c$(bundle);
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ReportFilterEditPresenter$onLoadFromJson$lambda(entity, this));
  return entity;
};
  ReportFilterEditPresenter.prototype.handleFieldOptionSelected_iowaj7$ = function(fieldOption) {
  switch (fieldOption.optionId) {
    case 100:
      var tmp$ = this.view;
      var $receiver = listOf([ReportFilterEditPresenter$ConditionOption$IS_CONDITION_getInstance(), ReportFilterEditPresenter$ConditionOption$IS_NOT_CONDITION_getInstance()]);
      var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
      var tmp$_0;
      tmp$_0 = $receiver.iterator();
      while (tmp$_0.hasNext()) {
        var item = tmp$_0.next();
        destination.add_11rb$(new ReportFilterEditPresenter$ConditionMessageIdOption(item, this.context, this.di));
      }
      tmp$.conditionsOptions = destination;
      this.view.valueType = ReportFilterEditPresenter$FilterValueType$DROPDOWN_getInstance();
      var tmp$_1 = this.view;
      var $receiver_0 = ReportFilterEditPresenter$Companion_getInstance().genderMap;
      var destination_0 = ArrayList_init_0($receiver_0.size);
      var tmp$_2;
      tmp$_2 = $receiver_0.entries.iterator();
      while (tmp$_2.hasNext()) {
        var item_0 = tmp$_2.next();
        destination_0.add_11rb$(new MessageIdOption(item_0.value, this.context, item_0.key, this.di));
      }
      tmp$_1.dropDownValueOptions = destination_0;
      break;
    case 101:
      var tmp$_3 = this.view;
      var $receiver_1 = listOf([ReportFilterEditPresenter$ConditionOption$GREATER_THAN_CONDITION_getInstance(), ReportFilterEditPresenter$ConditionOption$LESS_THAN_CONDITION_getInstance(), ReportFilterEditPresenter$ConditionOption$BETWEEN_CONDITION_getInstance()]);
      var destination_1 = ArrayList_init_0(collectionSizeOrDefault($receiver_1, 10));
      var tmp$_4;
      tmp$_4 = $receiver_1.iterator();
      while (tmp$_4.hasNext()) {
        var item_1 = tmp$_4.next();
        destination_1.add_11rb$(new ReportFilterEditPresenter$ConditionMessageIdOption(item_1, this.context, this.di));
      }
      tmp$_3.conditionsOptions = destination_1;
      this.view.valueType = ReportFilterEditPresenter$FilterValueType$INTEGER_getInstance();
      break;
    case 102:
      var tmp$_5 = this.view;
      var $receiver_2 = listOf_0(ReportFilterEditPresenter$ConditionOption$IS_CONDITION_getInstance());
      var destination_2 = ArrayList_init_0(collectionSizeOrDefault($receiver_2, 10));
      var tmp$_6;
      tmp$_6 = $receiver_2.iterator();
      while (tmp$_6.hasNext()) {
        var item_2 = tmp$_6.next();
        destination_2.add_11rb$(new ReportFilterEditPresenter$ConditionMessageIdOption(item_2, this.context, this.di));
      }
      tmp$_5.conditionsOptions = destination_2;
      this.view.valueType = ReportFilterEditPresenter$FilterValueType$DROPDOWN_getInstance();
      var tmp$_7 = this.view;
      var $receiver_3 = ReportFilterEditPresenter$ContentCompletionStatusOption$values();
      var destination_3 = ArrayList_init_0($receiver_3.length);
      var tmp$_8;
      for (tmp$_8 = 0; tmp$_8 !== $receiver_3.length; ++tmp$_8) {
        var item_3 = $receiver_3[tmp$_8];
        destination_3.add_11rb$(new ReportFilterEditPresenter$ContentCompletionStatusMessageIdOption(item_3, this.context, this.di));
      }
      tmp$_7.dropDownValueOptions = destination_3;
      break;
    case 103:
      var tmp$_9 = this.view;
      var $receiver_4 = listOf([ReportFilterEditPresenter$ConditionOption$IN_LIST_CONDITION_getInstance(), ReportFilterEditPresenter$ConditionOption$NOT_IN_LIST_CONDITION_getInstance()]);
      var destination_4 = ArrayList_init_0(collectionSizeOrDefault($receiver_4, 10));
      var tmp$_10;
      tmp$_10 = $receiver_4.iterator();
      while (tmp$_10.hasNext()) {
        var item_4 = tmp$_10.next();
        destination_4.add_11rb$(new ReportFilterEditPresenter$ConditionMessageIdOption(item_4, this.context, this.di));
      }
      tmp$_9.conditionsOptions = destination_4;
      this.view.valueType = ReportFilterEditPresenter$FilterValueType$LIST_getInstance();
      this.view.createNewFilter = this.systemImpl.getString(2263, this.context);
      break;
    case 105:
    case 104:
      var tmp$_11 = this.view;
      var $receiver_5 = listOf_0(ReportFilterEditPresenter$ConditionOption$BETWEEN_CONDITION_getInstance());
      var destination_5 = ArrayList_init_0(collectionSizeOrDefault($receiver_5, 10));
      var tmp$_12;
      tmp$_12 = $receiver_5.iterator();
      while (tmp$_12.hasNext()) {
        var item_5 = tmp$_12.next();
        destination_5.add_11rb$(new ReportFilterEditPresenter$ConditionMessageIdOption(item_5, this.context, this.di));
      }
      tmp$_11.conditionsOptions = destination_5;
      this.view.valueType = ReportFilterEditPresenter$FilterValueType$BETWEEN_getInstance();
      break;
    case 106:
      var tmp$_13 = this.view;
      var $receiver_6 = listOf([ReportFilterEditPresenter$ConditionOption$IS_CONDITION_getInstance(), ReportFilterEditPresenter$ConditionOption$IS_NOT_CONDITION_getInstance()]);
      var destination_6 = ArrayList_init_0(collectionSizeOrDefault($receiver_6, 10));
      var tmp$_14;
      tmp$_14 = $receiver_6.iterator();
      while (tmp$_14.hasNext()) {
        var item_6 = tmp$_14.next();
        destination_6.add_11rb$(new ReportFilterEditPresenter$ConditionMessageIdOption(item_6, this.context, this.di));
      }
      tmp$_13.conditionsOptions = destination_6;
      this.view.valueType = ReportFilterEditPresenter$FilterValueType$DROPDOWN_getInstance();
      var tmp$_15 = this.view;
      var $receiver_7 = OUTCOME_TO_MESSAGE_ID_MAP;
      var destination_7 = ArrayList_init_0($receiver_7.size);
      var tmp$_16;
      tmp$_16 = $receiver_7.entries.iterator();
      while (tmp$_16.hasNext()) {
        var item_7 = tmp$_16.next();
        destination_7.add_11rb$(new MessageIdOption(item_7.value, this.context, item_7.key, this.di));
      }
      tmp$_15.dropDownValueOptions = destination_7;
      break;
    case 107:
      var tmp$_17 = this.view;
      var $receiver_8 = listOf([ReportFilterEditPresenter$ConditionOption$IN_LIST_CONDITION_getInstance(), ReportFilterEditPresenter$ConditionOption$NOT_IN_LIST_CONDITION_getInstance()]);
      var destination_8 = ArrayList_init_0(collectionSizeOrDefault($receiver_8, 10));
      var tmp$_18;
      tmp$_18 = $receiver_8.iterator();
      while (tmp$_18.hasNext()) {
        var item_8 = tmp$_18.next();
        destination_8.add_11rb$(new ReportFilterEditPresenter$ConditionMessageIdOption(item_8, this.context, this.di));
      }
      tmp$_17.conditionsOptions = destination_8;
      this.view.valueType = ReportFilterEditPresenter$FilterValueType$LIST_getInstance();
      this.view.createNewFilter = this.systemImpl.getString(2381, this.context);
      break;
  }
};
  ReportFilterEditPresenter.prototype.handleConditionOptionSelected_iowaj7$ = function(conditionOption) {
  switch (conditionOption.optionId) {
    case 202:
    case 203:
      this.view.valueType = ReportFilterEditPresenter$FilterValueType$INTEGER_getInstance();
      break;
    case 205:
      this.view.valueType = ReportFilterEditPresenter$FilterValueType$BETWEEN_getInstance();
      break;
  }
};
  function ReportFilterEditPresenter$onSaveInstanceState$lambda(it) {
    return it.uid.toString();
  }
  ReportFilterEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  var tmp$;
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  if ((entityVal != null ? entityVal.reportFilterField : null) === 103 || (entityVal != null ? entityVal.reportFilterField : null) === 107) {
    entityVal.reportFilterValue = (tmp$ = this.uidAndLabelOneToManyHelper_0.liveList.getValue()) != null ? joinToString(tmp$, void 0, void 0, void 0, void 0, void 0, ReportFilterEditPresenter$onSaveInstanceState$lambda) : null;
  }
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, ReportFilter.Companion.serializer(), entityVal);
};
  function ReportFilterEditPresenter$onLoadDataComplete$lambda(this$ReportFilterEditPresenter) {
    return function(it) {
  var tmp$;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var reason = tmp$;
  var tmp$_0 = this$ReportFilterEditPresenter;
  var $receiver = new UidAndLabel();
  $receiver.uid = reason.leavingReasonUid;
  $receiver.labelName = reason.leavingReasonTitle;
  tmp$_0.handleAddOrEditUidAndLabel_0($receiver);
  return Unit;
};
  }
  function ReportFilterEditPresenter$onLoadDataComplete$lambda_0(this$ReportFilterEditPresenter) {
    return function(it) {
  var tmp$;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var entry = tmp$;
  var tmp$_0 = this$ReportFilterEditPresenter;
  var $receiver = new UidAndLabel();
  $receiver.uid = entry.contentEntryUid;
  $receiver.labelName = entry.title;
  tmp$_0.handleAddOrEditUidAndLabel_0($receiver);
  return Unit;
};
  }
  ReportFilterEditPresenter.prototype.onLoadDataComplete = function() {
  UstadEditPresenter.prototype.onLoadDataComplete.call(this);
  this.observeSavedStateResult_27fjeh$(ReportFilterEditPresenter$Companion_getInstance().RESULT_LEAVING_REASON_KEY, ListSerializer(LeavingReason.Companion.serializer()), getKClass(LeavingReason), new DoorObserver(ReportFilterEditPresenter$onLoadDataComplete$lambda(this)));
  this.observeSavedStateResult_27fjeh$(ReportFilterEditPresenter$Companion_getInstance().RESULT_CONTENT_KEY, ListSerializer(ContentEntry.Companion.serializer()), getKClass(ContentEntry), new DoorObserver(ReportFilterEditPresenter$onLoadDataComplete$lambda_0(this)));
};
  ReportFilterEditPresenter.prototype.handleAddLeavingReasonClicked = function() {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, LeavingReasonListView$Companion_getInstance().VIEW_NAME, getKClass(LeavingReason), LeavingReason.Companion.serializer(), ReportFilterEditPresenter$Companion_getInstance().RESULT_LEAVING_REASON_KEY));
};
  ReportFilterEditPresenter.prototype.handleAddContentClicked = function() {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ContentEntryList2View$Companion_getInstance().VIEW_NAME, getKClass(ContentEntry), ContentEntry.Companion.serializer(), ReportFilterEditPresenter$Companion_getInstance().RESULT_CONTENT_KEY, void 0, mutableMapOf([to(ContentEntryList2View$Companion_getInstance().ARG_DISPLAY_CONTENT_BY_OPTION, ContentEntryList2View$Companion_getInstance().ARG_DISPLAY_CONTENT_BY_PARENT), to(UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID, UstadView$Companion_getInstance().MASTER_SERVER_ROOT_ENTRY_UID.toString())])));
};
  function ReportFilterEditPresenter$handleClickSave$lambda(it) {
    return it.uid.toString();
  }
  ReportFilterEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  var tmp$;
  if (entity.reportFilterField === 0) {
    this.view.fieldErrorText = this.fieldRequiredText_0;
    return;
  } else {
    this.view.fieldErrorText = null;
  }
  if (entity.reportFilterCondition === 0) {
    this.view.conditionsErrorText = this.fieldRequiredText_0;
    return;
  } else {
    this.view.conditionsErrorText = null;
  }
  if (entity.reportFilterField === 103 || entity.reportFilterField === 107) {
    entity.reportFilterValue = (tmp$ = this.uidAndLabelOneToManyHelper_0.liveList.getValue()) != null ? joinToString(tmp$, void 0, void 0, void 0, void 0, void 0, ReportFilterEditPresenter$handleClickSave$lambda) : null;
  }
  var tmp$_0 = entity.reportFilterDropDownValue === 0;
  if (tmp$_0) {
    var $receiver = entity.reportFilterValue;
    tmp$_0 = $receiver == null || isBlank($receiver);
  }
  var tmp$_1 = tmp$_0;
  if (tmp$_1) {
    var $receiver_0 = entity.reportFilterValueBetweenX;
    var tmp$_2 = $receiver_0 == null || $receiver_0.length === 0;
    if (!tmp$_2) {
      var $receiver_1 = entity.reportFilterValueBetweenY;
      tmp$_2 = $receiver_1 == null || $receiver_1.length === 0;
    }
    tmp$_1 = tmp$_2;
  }
  if (tmp$_1) {
    this.view.valuesErrorText = this.fieldRequiredText_0;
    return;
  } else {
    this.view.valuesErrorText = null;
  }
  var di = this.di;
  var strategy = ListSerializer(ReportFilter.Companion.serializer());
  var entity_0 = listOf_0(entity);
  var tmp$_3;
  var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_3 : throwCCE(), null);
  var serializedResult = json.encodeToString_tf03ej$(strategy, entity_0);
  this.finishWithResult_61zpoe$(serializedResult);
};
  function ReportFilterEditPresenter$Companion() {
    ReportFilterEditPresenter$Companion_instance = this;
    this.genderMap = PersonConstants_getInstance().GENDER_MESSAGE_ID_MAP;
    this.RESULT_CONTENT_KEY = 'Content';
    this.RESULT_LEAVING_REASON_KEY = 'LeavingReason';
  }
  ReportFilterEditPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ReportFilterEditPresenter$Companion_instance = null;
  function ReportFilterEditPresenter$Companion_getInstance() {
    if (ReportFilterEditPresenter$Companion_instance === null) {
      new ReportFilterEditPresenter$Companion();
    }
    return ReportFilterEditPresenter$Companion_instance;
  }
  function ReportFilterEditPresenter$uidAndLabelOneToManyHelper$lambda($receiver, it) {
    $receiver.uid = it;
    return Unit;
  }
  ReportFilterEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ReportFilterEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function ReportListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    ReportListPresenter$Companion_getInstance();
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.loggedInPersonUid = L0;
    this.searchText = null;
  }
  Object.defineProperty(ReportListPresenter.prototype, 'sortOptions', {
  configurable: true, 
  get: function() {
  return ReportListPresenter$Companion_getInstance().SORT_OPTIONS;
}});
  ReportListPresenter.prototype.onCreate = function(savedState) {
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.selectedSortOption = ReportListPresenter$Companion_getInstance().SORT_OPTIONS.get_za3lpa$(0);
  this.loggedInPersonUid = this.accountManager.activeAccount.personUid;
  this.updateListOnView_0();
};
  ReportListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  return true;
};
  ReportListPresenter.prototype.updateListOnView_0 = function() {
  var tmp$, tmp$_0;
  this.view.list = this.repo.reportDao.findAllActiveReport_dw84ek$(toQueryLikeParam(this.searchText), this.loggedInPersonUid, (tmp$_0 = (tmp$ = this.selectedSortOption) != null ? tmp$.flag : null) != null ? tmp$_0 : 1, false);
};
  ReportListPresenter.prototype.onClickSort_o8nuns$ = function(sortOption) {
  UstadListPresenter.prototype.onClickSort_o8nuns$.call(this, sortOption);
  this.updateListOnView_0();
};
  ReportListPresenter.prototype.onSearchSubmitted_pdl1vj$ = function(text) {
  this.searchText = text;
  this.updateListOnView_0();
};
  ReportListPresenter.prototype.handleClickEntry_11rc$ = function(entry) {
  switch (this.mListMode.name) {
    case 'PICKER':
      var di = this.di;
      var strategy = ListSerializer(Report.Companion.serializer());
      var entity = listOf_0(entry);
      var tmp$;
      var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
      this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
      break;
    case 'BROWSER':
      this.systemImpl.go_gofqk3$(ReportDetailView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, entry.reportUid.toString())), this.context);
      break;
  }
};
  ReportListPresenter.prototype.handleClickCreateNewFab = function() {
  this.systemImpl.go_gofqk3$(ReportTemplateListView$Companion_getInstance().VIEW_NAME, emptyMap(), this.context);
};
  ReportListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
  var tmp$;
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ReportEditView$Companion_getInstance().VIEW_NAME, getKClass(Report), Report.Companion.serializer(), destinationResultKey, void 0, (tmp$ = args != null ? toMutableMap(args) : null) != null ? tmp$ : LinkedHashMap_init()));
};
  ReportListPresenter.prototype.onCheckListSelectionOptions_tn71rk$ = function(account, continuation) {
  return listOf_0(SelectionOption$HIDE_getInstance());
};
  function Coroutine$ReportListPresenter$handleClickSelectionOption$lambda$lambda$lambda(this$ReportListPresenter_0, closure$selectedItem_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ReportListPresenter = this$ReportListPresenter_0;
    this.local$closure$selectedItem = closure$selectedItem_0;
  }
  Coroutine$ReportListPresenter$handleClickSelectionOption$lambda$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ReportListPresenter$handleClickSelectionOption$lambda$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ReportListPresenter$handleClickSelectionOption$lambda$lambda$lambda.prototype.constructor = Coroutine$ReportListPresenter$handleClickSelectionOption$lambda$lambda$lambda;
  Coroutine$ReportListPresenter$handleClickSelectionOption$lambda$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$ = this.local$this$ReportListPresenter.repo.reportDao;
        var $receiver = this.local$closure$selectedItem;
        var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
        var tmp$_0;
        tmp$_0 = $receiver.iterator();
        while (tmp$_0.hasNext()) {
          var item = tmp$_0.next();
          destination.add_11rb$(item.reportUid);
        }
        this.state_0 = 2;
        this.result_0 = tmp$.toggleVisibilityReportItems_cbj1f0$(false, destination, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ReportListPresenter$handleClickSelectionOption$lambda$lambda$lambda(this$ReportListPresenter_0, closure$selectedItem_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ReportListPresenter$handleClickSelectionOption$lambda$lambda$lambda(this$ReportListPresenter_0, closure$selectedItem_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function ReportListPresenter$handleClickSelectionOption$lambda$lambda(this$ReportListPresenter, closure$selectedItem) {
    return function() {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ReportListPresenter$handleClickSelectionOption$lambda$lambda$lambda(this$ReportListPresenter, closure$selectedItem));
  return Unit;
};
  }
  function Coroutine$ReportListPresenter$handleClickSelectionOption$lambda(closure$option_0, this$ReportListPresenter_0, closure$selectedItem_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$option = closure$option_0;
    this.local$this$ReportListPresenter = this$ReportListPresenter_0;
    this.local$closure$selectedItem = closure$selectedItem_0;
  }
  Coroutine$ReportListPresenter$handleClickSelectionOption$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ReportListPresenter$handleClickSelectionOption$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ReportListPresenter$handleClickSelectionOption$lambda.prototype.constructor = Coroutine$ReportListPresenter$handleClickSelectionOption$lambda;
  Coroutine$ReportListPresenter$handleClickSelectionOption$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (equals(this.local$closure$option, SelectionOption$HIDE_getInstance())) {
          var tmp$ = this.local$this$ReportListPresenter.repo.reportDao;
          var $receiver = this.local$closure$selectedItem;
          var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
          var tmp$_0;
          tmp$_0 = $receiver.iterator();
          while (tmp$_0.hasNext()) {
            var item = tmp$_0.next();
            destination.add_11rb$(item.reportUid);
          }
          this.state_0 = 2;
          this.result_0 = tmp$.toggleVisibilityReportItems_cbj1f0$(true, destination, systemTimeInMillis(), this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        return this.local$this$ReportListPresenter.view.showSnackBar_9pu0dj$(this.local$this$ReportListPresenter.systemImpl.getString(2185, this.local$this$ReportListPresenter.context), ReportListPresenter$handleClickSelectionOption$lambda$lambda(this.local$this$ReportListPresenter, this.local$closure$selectedItem), 2698) , Unit;
      case 3:
        return Unit;
      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 ReportListPresenter$handleClickSelectionOption$lambda(closure$option_0, this$ReportListPresenter_0, closure$selectedItem_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ReportListPresenter$handleClickSelectionOption$lambda(closure$option_0, this$ReportListPresenter_0, closure$selectedItem_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ReportListPresenter.prototype.handleClickSelectionOption_psq284$ = function(selectedItem, option) {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ReportListPresenter$handleClickSelectionOption$lambda(option, this, selectedItem));
};
  function ReportListPresenter$Companion() {
    ReportListPresenter$Companion_instance = this;
    this.REPORT_RESULT_KEY = 'Report';
    this.SORT_OPTIONS = listOf([new SortOrderOption(2102, 1, true), new SortOrderOption(2102, 2, false)]);
  }
  ReportListPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ReportListPresenter$Companion_instance = null;
  function ReportListPresenter$Companion_getInstance() {
    if (ReportListPresenter$Companion_instance === null) {
      new ReportListPresenter$Companion();
    }
    return ReportListPresenter$Companion_instance;
  }
  ReportListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ReportListPresenter', 
  interfaces: [UstadListPresenter, OnSearchSubmitted, OnSortOptionSelected]};
  function ReportTemplateListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  ReportTemplateListPresenter.prototype.onCreate = function(savedState) {
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.updateListOnView_0();
};
  ReportTemplateListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  return false;
};
  ReportTemplateListPresenter.prototype.updateListOnView_0 = function() {
  this.view.list = this.repo.reportDao.findAllActiveReport_dw84ek$(toQueryLikeParam(''), L0, 1, true);
};
  ReportTemplateListPresenter.prototype.handleClickEntry_11rc$ = function(entry) {
  entry.reportUid = L0;
  entry.isTemplate = false;
  var tmp$ = this.systemImpl;
  var tmp$_0 = ReportEditView$Companion_getInstance().VIEW_NAME;
  var tmp$_1 = UstadEditView$Companion_getInstance().ARG_ENTITY_JSON;
  var di = this.di;
  var strategy = Report.Companion.serializer();
  var tmp$_2;
  var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_2 : throwCCE(), null);
  tmp$.go_gofqk3$(tmp$_0, mapOf_0(to(tmp$_1, json.encodeToString_tf03ej$(strategy, entry))), this.context);
};
  ReportTemplateListPresenter.prototype.onCheckListSelectionOptions_tn71rk$ = function(account, continuation) {
  return listOf_0(SelectionOption$HIDE_getInstance());
};
  function Coroutine$ReportTemplateListPresenter$handleClickSelectionOption$lambda$lambda$lambda(this$ReportTemplateListPresenter_0, closure$listToHide_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ReportTemplateListPresenter = this$ReportTemplateListPresenter_0;
    this.local$closure$listToHide = closure$listToHide_0;
  }
  Coroutine$ReportTemplateListPresenter$handleClickSelectionOption$lambda$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ReportTemplateListPresenter$handleClickSelectionOption$lambda$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ReportTemplateListPresenter$handleClickSelectionOption$lambda$lambda$lambda.prototype.constructor = Coroutine$ReportTemplateListPresenter$handleClickSelectionOption$lambda$lambda$lambda;
  Coroutine$ReportTemplateListPresenter$handleClickSelectionOption$lambda$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$ReportTemplateListPresenter.repo.reportDao.toggleVisibilityReportItems_cbj1f0$(false, this.local$closure$listToHide, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 ReportTemplateListPresenter$handleClickSelectionOption$lambda$lambda$lambda(this$ReportTemplateListPresenter_0, closure$listToHide_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ReportTemplateListPresenter$handleClickSelectionOption$lambda$lambda$lambda(this$ReportTemplateListPresenter_0, closure$listToHide_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function ReportTemplateListPresenter$handleClickSelectionOption$lambda$lambda(this$ReportTemplateListPresenter, closure$listToHide) {
    return function() {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ReportTemplateListPresenter$handleClickSelectionOption$lambda$lambda$lambda(this$ReportTemplateListPresenter, closure$listToHide));
  return Unit;
};
  }
  function Coroutine$ReportTemplateListPresenter$handleClickSelectionOption$lambda(closure$option_0, closure$selectedItem_0, this$ReportTemplateListPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$option = closure$option_0;
    this.local$closure$selectedItem = closure$selectedItem_0;
    this.local$this$ReportTemplateListPresenter = this$ReportTemplateListPresenter_0;
    this.local$listToHide = void 0;
  }
  Coroutine$ReportTemplateListPresenter$handleClickSelectionOption$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ReportTemplateListPresenter$handleClickSelectionOption$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ReportTemplateListPresenter$handleClickSelectionOption$lambda.prototype.constructor = Coroutine$ReportTemplateListPresenter$handleClickSelectionOption$lambda;
  Coroutine$ReportTemplateListPresenter$handleClickSelectionOption$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (equals(this.local$closure$option, SelectionOption$HIDE_getInstance())) {
          var $receiver = this.local$closure$selectedItem;
          var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
          var tmp$;
          tmp$ = $receiver.iterator();
          while (tmp$.hasNext()) {
            var item = tmp$.next();
            destination.add_11rb$(item.reportUid);
          }
          var destination_0 = ArrayList_init();
          var tmp$_0;
          tmp$_0 = destination.iterator();
          while (tmp$_0.hasNext()) {
            var element = tmp$_0.next();
            if (!equals(element, Report$Companion$TEMPLATE_BLANK_REPORT_UID)) 
              destination_0.add_11rb$(element);
          }
          this.local$listToHide = destination_0;
          if (!this.local$listToHide.isEmpty()) {
            this.state_0 = 2;
            this.result_0 = this.local$this$ReportTemplateListPresenter.repo.reportDao.toggleVisibilityReportItems_cbj1f0$(true, this.local$listToHide, systemTimeInMillis(), this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 3;
            continue;
          }
        } else {
          this.state_0 = 4;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        return this.local$this$ReportTemplateListPresenter.view.showSnackBar_9pu0dj$(this.local$this$ReportTemplateListPresenter.systemImpl.getString(2185, this.local$this$ReportTemplateListPresenter.context), ReportTemplateListPresenter$handleClickSelectionOption$lambda$lambda(this.local$this$ReportTemplateListPresenter, this.local$listToHide), 2698) , Unit;
      case 3:
        this.state_0 = 4;
        continue;
      case 4:
        return Unit;
      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 ReportTemplateListPresenter$handleClickSelectionOption$lambda(closure$option_0, closure$selectedItem_0, this$ReportTemplateListPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ReportTemplateListPresenter$handleClickSelectionOption$lambda(closure$option_0, closure$selectedItem_0, this$ReportTemplateListPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ReportTemplateListPresenter.prototype.handleClickSelectionOption_psq284$ = function(selectedItem, option) {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ReportTemplateListPresenter$handleClickSelectionOption$lambda(option, selectedItem, this));
};
  ReportTemplateListPresenter.prototype.handleClickCreateNewFab = function() {
};
  ReportTemplateListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
};
  ReportTemplateListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ReportTemplateListPresenter', 
  interfaces: [UstadListPresenter]};
  function ScheduleEditPresenter(context, args, view, di, lifecycleOwner) {
    UstadEditPresenter.call(this, context, args, view, di, lifecycleOwner);
    this.schedule = null;
  }
  Object.defineProperty(ScheduleEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$JSON_getInstance();
}});
  function ScheduleEditPresenter$FrequencyOption(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ScheduleEditPresenter$FrequencyOption_initFields() {
    ScheduleEditPresenter$FrequencyOption_initFields = function() {
};
    ScheduleEditPresenter$FrequencyOption$DAILY_instance = new ScheduleEditPresenter$FrequencyOption('DAILY', 0, Schedule.Companion.SCHEDULE_FREQUENCY_DAILY, 2347);
    ScheduleEditPresenter$FrequencyOption$WEEKLY_instance = new ScheduleEditPresenter$FrequencyOption('WEEKLY', 1, Schedule.Companion.SCHEDULE_FREQUENCY_WEEKLY, 2345);
  }
  var ScheduleEditPresenter$FrequencyOption$DAILY_instance;
  function ScheduleEditPresenter$FrequencyOption$DAILY_getInstance() {
    ScheduleEditPresenter$FrequencyOption_initFields();
    return ScheduleEditPresenter$FrequencyOption$DAILY_instance;
  }
  var ScheduleEditPresenter$FrequencyOption$WEEKLY_instance;
  function ScheduleEditPresenter$FrequencyOption$WEEKLY_getInstance() {
    ScheduleEditPresenter$FrequencyOption_initFields();
    return ScheduleEditPresenter$FrequencyOption$WEEKLY_instance;
  }
  ScheduleEditPresenter$FrequencyOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'FrequencyOption', 
  interfaces: [Enum]};
  function ScheduleEditPresenter$FrequencyOption$values() {
    return [ScheduleEditPresenter$FrequencyOption$DAILY_getInstance(), ScheduleEditPresenter$FrequencyOption$WEEKLY_getInstance()];
  }
  ScheduleEditPresenter$FrequencyOption.values = ScheduleEditPresenter$FrequencyOption$values;
  function ScheduleEditPresenter$FrequencyOption$valueOf(name) {
    switch (name) {
      case 'DAILY':
        return ScheduleEditPresenter$FrequencyOption$DAILY_getInstance();
      case 'WEEKLY':
        return ScheduleEditPresenter$FrequencyOption$WEEKLY_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ScheduleEditPresenter.FrequencyOption.' + name);
    }
  }
  ScheduleEditPresenter$FrequencyOption.valueOf_61zpoe$ = ScheduleEditPresenter$FrequencyOption$valueOf;
  function ScheduleEditPresenter$FrequencyMessageIdOption(frequency, context, di) {
    MessageIdOption.call(this, frequency.messageId, context, frequency.optionVal, di);
  }
  ScheduleEditPresenter$FrequencyMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'FrequencyMessageIdOption', 
  interfaces: [MessageIdOption]};
  function ScheduleEditPresenter$DayOptions(name, ordinal, optionVal, messageId) {
    Enum.call(this);
    this.optionVal = optionVal;
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ScheduleEditPresenter$DayOptions_initFields() {
    ScheduleEditPresenter$DayOptions_initFields = function() {
};
    ScheduleEditPresenter$DayOptions$SUNDAY_instance = new ScheduleEditPresenter$DayOptions('SUNDAY', 0, Schedule.Companion.DAY_SUNDAY, 2350);
    ScheduleEditPresenter$DayOptions$MONDAY_instance = new ScheduleEditPresenter$DayOptions('MONDAY', 1, Schedule.Companion.DAY_MONDAY, 2351);
    ScheduleEditPresenter$DayOptions$TUESDAY_instance = new ScheduleEditPresenter$DayOptions('TUESDAY', 2, Schedule.Companion.DAY_TUESDAY, 2352);
    ScheduleEditPresenter$DayOptions$WEDNESDAY_instance = new ScheduleEditPresenter$DayOptions('WEDNESDAY', 3, Schedule.Companion.DAY_WEDNESDAY, 2353);
    ScheduleEditPresenter$DayOptions$THURSDAY_instance = new ScheduleEditPresenter$DayOptions('THURSDAY', 4, Schedule.Companion.DAY_THURSDAY, 2354);
    ScheduleEditPresenter$DayOptions$FRIDAY_instance = new ScheduleEditPresenter$DayOptions('FRIDAY', 5, Schedule.Companion.DAY_FRIDAY, 2355);
    ScheduleEditPresenter$DayOptions$SATURDAY_instance = new ScheduleEditPresenter$DayOptions('SATURDAY', 6, Schedule.Companion.DAY_SATURDAY, 2356);
  }
  var ScheduleEditPresenter$DayOptions$SUNDAY_instance;
  function ScheduleEditPresenter$DayOptions$SUNDAY_getInstance() {
    ScheduleEditPresenter$DayOptions_initFields();
    return ScheduleEditPresenter$DayOptions$SUNDAY_instance;
  }
  var ScheduleEditPresenter$DayOptions$MONDAY_instance;
  function ScheduleEditPresenter$DayOptions$MONDAY_getInstance() {
    ScheduleEditPresenter$DayOptions_initFields();
    return ScheduleEditPresenter$DayOptions$MONDAY_instance;
  }
  var ScheduleEditPresenter$DayOptions$TUESDAY_instance;
  function ScheduleEditPresenter$DayOptions$TUESDAY_getInstance() {
    ScheduleEditPresenter$DayOptions_initFields();
    return ScheduleEditPresenter$DayOptions$TUESDAY_instance;
  }
  var ScheduleEditPresenter$DayOptions$WEDNESDAY_instance;
  function ScheduleEditPresenter$DayOptions$WEDNESDAY_getInstance() {
    ScheduleEditPresenter$DayOptions_initFields();
    return ScheduleEditPresenter$DayOptions$WEDNESDAY_instance;
  }
  var ScheduleEditPresenter$DayOptions$THURSDAY_instance;
  function ScheduleEditPresenter$DayOptions$THURSDAY_getInstance() {
    ScheduleEditPresenter$DayOptions_initFields();
    return ScheduleEditPresenter$DayOptions$THURSDAY_instance;
  }
  var ScheduleEditPresenter$DayOptions$FRIDAY_instance;
  function ScheduleEditPresenter$DayOptions$FRIDAY_getInstance() {
    ScheduleEditPresenter$DayOptions_initFields();
    return ScheduleEditPresenter$DayOptions$FRIDAY_instance;
  }
  var ScheduleEditPresenter$DayOptions$SATURDAY_instance;
  function ScheduleEditPresenter$DayOptions$SATURDAY_getInstance() {
    ScheduleEditPresenter$DayOptions_initFields();
    return ScheduleEditPresenter$DayOptions$SATURDAY_instance;
  }
  ScheduleEditPresenter$DayOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'DayOptions', 
  interfaces: [Enum]};
  function ScheduleEditPresenter$DayOptions$values() {
    return [ScheduleEditPresenter$DayOptions$SUNDAY_getInstance(), ScheduleEditPresenter$DayOptions$MONDAY_getInstance(), ScheduleEditPresenter$DayOptions$TUESDAY_getInstance(), ScheduleEditPresenter$DayOptions$WEDNESDAY_getInstance(), ScheduleEditPresenter$DayOptions$THURSDAY_getInstance(), ScheduleEditPresenter$DayOptions$FRIDAY_getInstance(), ScheduleEditPresenter$DayOptions$SATURDAY_getInstance()];
  }
  ScheduleEditPresenter$DayOptions.values = ScheduleEditPresenter$DayOptions$values;
  function ScheduleEditPresenter$DayOptions$valueOf(name) {
    switch (name) {
      case 'SUNDAY':
        return ScheduleEditPresenter$DayOptions$SUNDAY_getInstance();
      case 'MONDAY':
        return ScheduleEditPresenter$DayOptions$MONDAY_getInstance();
      case 'TUESDAY':
        return ScheduleEditPresenter$DayOptions$TUESDAY_getInstance();
      case 'WEDNESDAY':
        return ScheduleEditPresenter$DayOptions$WEDNESDAY_getInstance();
      case 'THURSDAY':
        return ScheduleEditPresenter$DayOptions$THURSDAY_getInstance();
      case 'FRIDAY':
        return ScheduleEditPresenter$DayOptions$FRIDAY_getInstance();
      case 'SATURDAY':
        return ScheduleEditPresenter$DayOptions$SATURDAY_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.ScheduleEditPresenter.DayOptions.' + name);
    }
  }
  ScheduleEditPresenter$DayOptions.valueOf_61zpoe$ = ScheduleEditPresenter$DayOptions$valueOf;
  function ScheduleEditPresenter$DayMessageIdOption(day, context, di) {
    MessageIdOption.call(this, day.messageId, context, day.optionVal, di);
  }
  ScheduleEditPresenter$DayMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'DayMessageIdOption', 
  interfaces: [MessageIdOption]};
  ScheduleEditPresenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
  var tmp$ = this.view;
  var $receiver = ScheduleEditPresenter$DayOptions$values();
  var destination = ArrayList_init_0($receiver.length);
  var tmp$_0;
  for (tmp$_0 = 0; tmp$_0 !== $receiver.length; ++tmp$_0) {
    var item = $receiver[tmp$_0];
    destination.add_11rb$(new ScheduleEditPresenter$DayMessageIdOption(item, this.context, this.di));
  }
  tmp$.dayOptions = destination;
};
  ScheduleEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  var scheduleData = this.arguments.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (scheduleData != null) {
    var di = this.di;
    var strategy = Schedule.Companion.serializer();
    var tmp$_0;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, scheduleData);
  } else {
    var $receiver = new Schedule();
    $receiver.scheduleActive = true;
    $receiver.scheduleFrequency = Schedule.Companion.SCHEDULE_FREQUENCY_WEEKLY;
    tmp$ = $receiver;
  }
  return tmp$;
};
  ScheduleEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  this.view.fromTimeError = null;
  this.view.toTimeError = null;
  if (equals(entity.sceduleStartTime, L0)) {
    this.view.fromTimeError = this.systemImpl.getString(2127, this.context);
    return;
  } else if (equals(entity.scheduleEndTime, L0)) {
    this.view.toTimeError = this.systemImpl.getString(2127, this.context);
    return;
  } else if (entity.scheduleEndTime.compareTo_11rb$(entity.sceduleStartTime) <= 0) {
    this.view.toTimeError = this.systemImpl.getString(2679, this.context);
    return;
  } else {
    var di = this.di;
    var strategy = ListSerializer(Schedule.Companion.serializer());
    var entity_0 = listOf_0(entity);
    var tmp$;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
    this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity_0));
  }
};
  ScheduleEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ScheduleEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function SchoolDetailOverviewPresenter(context, arguments_0, view, di, lifecycleOwner) {
    SchoolDetailOverviewPresenter$Companion_getInstance();
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.loggedInPersonUid = L0;
  }
  Object.defineProperty(SchoolDetailOverviewPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  function Coroutine$SchoolDetailOverviewPresenter$onCreate$lambda(this$SchoolDetailOverviewPresenter_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$SchoolDetailOverviewPresenter = this$SchoolDetailOverviewPresenter_0;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$tmp$ = void 0;
  }
  Coroutine$SchoolDetailOverviewPresenter$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SchoolDetailOverviewPresenter$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SchoolDetailOverviewPresenter$onCreate$lambda.prototype.constructor = Coroutine$SchoolDetailOverviewPresenter$onCreate$lambda;
  Coroutine$SchoolDetailOverviewPresenter$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$tmp$ = this.local$this$SchoolDetailOverviewPresenter.view;
        this.state_0 = 2;
        this.result_0 = this.local$this$SchoolDetailOverviewPresenter.repo.schoolDao.personHasPermissionWithSchool_b9bd0d$(this.local$this$SchoolDetailOverviewPresenter.accountManager.activeAccount.personUid, this.local$closure$entityUid, Role$Companion$PERMISSION_SCHOOL_UPDATE, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        return this.local$tmp$.schoolCodeVisible = this.result_0 , Unit;
      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 SchoolDetailOverviewPresenter$onCreate$lambda(this$SchoolDetailOverviewPresenter_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$SchoolDetailOverviewPresenter$onCreate$lambda(this$SchoolDetailOverviewPresenter_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  SchoolDetailOverviewPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0;
  UstadDetailPresenter.prototype.onCreate.call(this, savedState);
  var entityUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  this.loggedInPersonUid = this.accountManager.activeAccount.personUid;
  launch(coroutines.GlobalScope, void 0, void 0, SchoolDetailOverviewPresenter$onCreate$lambda(this, entityUid));
};
  function Coroutine$SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda;
  Coroutine$SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$closure$db.schoolDao.findByUidWithHolidayCalendarAsync_s8cxhz$(this.local$closure$entityUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda_0(this$SchoolDetailOverviewPresenter_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$SchoolDetailOverviewPresenter = this$SchoolDetailOverviewPresenter_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda_0.prototype.constructor = Coroutine$SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda_0;
  Coroutine$SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        return this.local$this$SchoolDetailOverviewPresenter.repo.clazzDao.findClazzesWithPermission_dchjmd$(toQueryLikeParam(''), this.local$this$SchoolDetailOverviewPresenter.loggedInPersonUid, emptyList(), L0, 0, 0, systemTimeInMillis(), Role$Companion$PERMISSION_CLAZZ_SELECT, this.local$closure$entityUid);
      case 1:
        throw this.exception_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 SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda_0(this$SchoolDetailOverviewPresenter_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda_0(this$SchoolDetailOverviewPresenter_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_22($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$entityUid = void 0;
    this.local$schoolWithHolidayCalendar = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_22.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_22.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_22.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_22;
  Coroutine$onLoadEntityFromDb_7hogkd$_22.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        this.local$entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = withTimeoutOrNull(L2000, SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda(this.local$db, this.local$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$schoolWithHolidayCalendar = (tmp$_1 = this.result_0) != null ? tmp$_1 : new SchoolWithHolidayCalendar();
        this.state_0 = 3;
        this.result_0 = withTimeoutOrNull(L2000, SchoolDetailOverviewPresenter$onLoadEntityFromDb$lambda_0(this.$this, this.local$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var clazzes = this.result_0;
        this.$this.view.schoolClazzes = clazzes;
        return this.local$schoolWithHolidayCalendar;
      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);
};
  SchoolDetailOverviewPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_22(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  SchoolDetailOverviewPresenter.prototype.handleClickEdit = function() {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, SchoolEditView$Companion_getInstance().VIEW_NAME, getKClass(SchoolWithHolidayCalendar), SchoolWithHolidayCalendar.Companion.serializer(), SchoolDetailOverviewPresenter$Companion_getInstance().SAVEDSTATE_KEY_SCHOOL, void 0, toMutableMap(this.arguments)));
};
  SchoolDetailOverviewPresenter.prototype.handleClickClazz_yczdf2$ = function(clazz) {
  this.systemImpl.go_gofqk3$(ClazzDetailView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, clazz.clazzUid.toString())), this.context);
};
  SchoolDetailOverviewPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  var tmp$, tmp$_0, tmp$_1;
  napier.Napier.d_82mfvz$(toString(account != null ? account.personUid : null));
  return this.db.schoolDao.personHasPermissionWithSchool_b9bd0d$((tmp$ = account != null ? account.personUid : null) != null ? tmp$ : L0, (tmp$_1 = (tmp$_0 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$_0) : null) != null ? tmp$_1 : L0, Role$Companion$PERMISSION_SCHOOL_UPDATE, continuation);
};
  function SchoolDetailOverviewPresenter$Companion() {
    SchoolDetailOverviewPresenter$Companion_instance = this;
    this.SAVEDSTATE_KEY_SCHOOL = 'School';
  }
  SchoolDetailOverviewPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SchoolDetailOverviewPresenter$Companion_instance = null;
  function SchoolDetailOverviewPresenter$Companion_getInstance() {
    if (SchoolDetailOverviewPresenter$Companion_instance === null) {
      new SchoolDetailOverviewPresenter$Companion();
    }
    return SchoolDetailOverviewPresenter$Companion_instance;
  }
  SchoolDetailOverviewPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SchoolDetailOverviewPresenter', 
  interfaces: [UstadDetailPresenter]};
  function SchoolDetailPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(SchoolDetailPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  function Coroutine$SchoolDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$SchoolDetailPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SchoolDetailPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SchoolDetailPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$SchoolDetailPresenter$onLoadEntityFromDb$lambda;
  Coroutine$SchoolDetailPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$closure$db.schoolDao.findByUidAsync_s8cxhz$(this.local$closure$entityUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 SchoolDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$SchoolDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_23($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_23.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_23.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_23.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_23;
  Coroutine$onLoadEntityFromDb_7hogkd$_23.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2;
        var entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = withTimeoutOrNull(L2000, SchoolDetailPresenter$onLoadEntityFromDb$lambda(this.local$db, entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var school = (tmp$_1 = this.result_0) != null ? tmp$_1 : new School();
        this.$this.view.title = (tmp$_2 = school.schoolName) != null ? tmp$_2 : '';
        return school;
      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);
};
  SchoolDetailPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_23(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  SchoolDetailPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  return false;
};
  SchoolDetailPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SchoolDetailPresenter', 
  interfaces: [UstadDetailPresenter]};
  function SchoolEditPresenter(context, arguments_0, view, di, lifecycleOwner) {
    SchoolEditPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.scopedGrantOneToManyHelper = new ScopedGrantOneToManyHelper(this.repo, this, this.requireBackStackEntry().savedStateHandle, 164);
  }
  Object.defineProperty(SchoolEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  SchoolEditPresenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
  this.view.scopedGrants = this.scopedGrantOneToManyHelper.liveList;
};
  function SchoolEditPresenter$onLoadDataComplete$lambda(this$SchoolEditPresenter) {
    return function(it) {
  var tmp$, tmp$_0, tmp$_1;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var calendar = tmp$;
    (tmp$_0 = this$SchoolEditPresenter.entity) != null ? (tmp$_0.holidayCalendar = calendar) : null;
    (tmp$_1 = this$SchoolEditPresenter.entity) != null ? (tmp$_1.schoolHolidayCalendarUid = calendar.umCalendarUid) : null;
  this$SchoolEditPresenter.view.entity = this$SchoolEditPresenter.entity;
  this$SchoolEditPresenter.requireSavedStateHandle().set_umlfku$(SchoolEditPresenter$Companion_getInstance().SAVEDSTATE_KEY_HOLIDAYCALENDAR, null);
  return Unit;
};
  }
  function SchoolEditPresenter$onLoadDataComplete$lambda_0(this$SchoolEditPresenter) {
    return function(it) {
  var tmp$, tmp$_0;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var timeZone = tmp$;
    (tmp$_0 = this$SchoolEditPresenter.entity) != null ? (tmp$_0.schoolTimeZone = timeZone) : null;
  this$SchoolEditPresenter.view.entity = this$SchoolEditPresenter.entity;
  this$SchoolEditPresenter.requireSavedStateHandle().set_umlfku$(TimeZoneListPresenter$Companion_getInstance().RESULT_TIMEZONE_KEY, null);
  return Unit;
};
  }
  SchoolEditPresenter.prototype.onLoadDataComplete = function() {
  UstadEditPresenter.prototype.onLoadDataComplete.call(this);
  this.observeSavedStateResult_27fjeh$(SchoolEditPresenter$Companion_getInstance().SAVEDSTATE_KEY_HOLIDAYCALENDAR, ListSerializer(HolidayCalendar.Companion.serializer()), getKClass(HolidayCalendar), new DoorObserver(SchoolEditPresenter$onLoadDataComplete$lambda(this)));
  this.observeSavedStateResult_27fjeh$(TimeZoneListPresenter$Companion_getInstance().RESULT_TIMEZONE_KEY, ListSerializer(serializer(kotlin_js_internal_StringCompanionObject)), PrimitiveClasses$stringClass, new DoorObserver(SchoolEditPresenter$onLoadDataComplete$lambda_0(this)));
};
  function Coroutine$SchoolEditPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$SchoolEditPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SchoolEditPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SchoolEditPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$SchoolEditPresenter$onLoadEntityFromDb$lambda;
  Coroutine$SchoolEditPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$closure$db.schoolDao.findByUidWithHolidayCalendarAsync_s8cxhz$(this.local$closure$entityUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 SchoolEditPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$SchoolEditPresenter$onLoadEntityFromDb$lambda(closure$db_0, closure$entityUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$SchoolEditPresenter$onLoadEntityFromDb$lambda_0(closure$entityUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$it = it_0;
  }
  Coroutine$SchoolEditPresenter$onLoadEntityFromDb$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SchoolEditPresenter$onLoadEntityFromDb$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SchoolEditPresenter$onLoadEntityFromDb$lambda_0.prototype.constructor = Coroutine$SchoolEditPresenter$onLoadEntityFromDb$lambda_0;
  Coroutine$SchoolEditPresenter$onLoadEntityFromDb$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.scopedGrantDao.findByTableIdAndEntityUid_6svq3l$(164, this.local$closure$entityUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 SchoolEditPresenter$onLoadEntityFromDb$lambda_0(closure$entityUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$SchoolEditPresenter$onLoadEntityFromDb$lambda_0(closure$entityUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_24($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$entityUid = void 0;
    this.local$school = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_24.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_24.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_24.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_24;
  Coroutine$onLoadEntityFromDb_7hogkd$_24.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        this.local$entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = withTimeoutOrNull(L2000, SchoolEditPresenter$onLoadEntityFromDb$lambda(this.local$db, this.local$entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$school = (tmp$_1 = this.result_0) != null ? tmp$_1 : new SchoolWithHolidayCalendar();
        if (!equals(this.local$entityUid, L0)) {
          this.state_0 = 3;
          this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, SchoolEditPresenter$onLoadEntityFromDb$lambda_0(this.local$entityUid), this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          if (Kotlin.isType(this.local$db, DoorDatabaseRepository)) {
            var tmp$_2 = this.$this.scopedGrantOneToManyHelper;
            var $receiver = new ScopedGrantAndName();
            $receiver.name = 'Teachers';
            var $receiver_0 = new ScopedGrant();
            $receiver_0.sgFlags = 9;
            $receiver_0.sgPermissions = Role$Companion$ROLE_SCHOOL_STAFF_PERMISSIONS_DEFAULT;
            $receiver.scopedGrant = $receiver_0;
            tmp$_2.onEditResult_trkh7z$($receiver);
            var tmp$_3 = this.$this.scopedGrantOneToManyHelper;
            var $receiver_1 = new ScopedGrantAndName();
            $receiver_1.name = 'Students';
            var $receiver_2 = new ScopedGrant();
            $receiver_2.sgFlags = 17;
            $receiver_2.sgPermissions = Role$Companion$ROLE_SCHOOL_STUDENT_PERMISSION_DEFAULT;
            $receiver_1.scopedGrant = $receiver_2;
            tmp$_3.onEditResult_trkh7z$($receiver_1);
          }
          this.state_0 = 4;
          continue;
        }
      case 3:
        var scopedGrants = this.result_0;
        this.$this.scopedGrantOneToManyHelper.liveList.setVal_11rb$(scopedGrants);
        this.state_0 = 4;
        continue;
      case 4:
        return this.local$school;
      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);
};
  SchoolEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_24(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  SchoolEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = SchoolWithHolidayCalendar.Companion.serializer();
    var tmp$_0;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    tmp$ = new SchoolWithHolidayCalendar();
  }
  var editEntity = tmp$;
  return editEntity;
};
  SchoolEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  function Coroutine$SchoolEditPresenter$handleClickSave$lambda(closure$entity_0, this$SchoolEditPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$SchoolEditPresenter = this$SchoolEditPresenter_0;
    this.local$tmp$ = void 0;
  }
  Coroutine$SchoolEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SchoolEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SchoolEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$SchoolEditPresenter$handleClickSave$lambda;
  Coroutine$SchoolEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (equals(this.local$closure$entity.schoolUid, L0)) {
          this.local$closure$entity.schoolActive = true;
          this.local$tmp$ = this.local$closure$entity;
          this.state_0 = 3;
          this.result_0 = createNewSchoolAndGroups(this.local$this$SchoolEditPresenter.repo, this.local$closure$entity, this.local$this$SchoolEditPresenter.systemImpl, this.local$this$SchoolEditPresenter.context, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 2;
          this.result_0 = this.local$this$SchoolEditPresenter.repo.schoolDao.updateAsync_7q4b7e$(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 4;
        continue;
      case 3:
        this.local$tmp$.schoolUid = this.result_0;
        this.state_0 = 4;
        continue;
      case 4:
        this.state_0 = 5;
        this.result_0 = this.local$this$SchoolEditPresenter.scopedGrantOneToManyHelper.commitToDatabase_pqsauo$(this.local$this$SchoolEditPresenter.repo, this.local$closure$entity.schoolUid, mapOf([to(8, this.local$closure$entity.schoolTeachersPersonGroupUid), to(16, this.local$closure$entity.schoolStudentsPersonGroupUid)]), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        return this.local$this$SchoolEditPresenter.onFinish_xcg1s8$(SchoolDetailView$Companion_getInstance().VIEW_NAME, this.local$closure$entity.schoolUid, this.local$closure$entity, SchoolWithHolidayCalendar.Companion.serializer()) , Unit;
      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 SchoolEditPresenter$handleClickSave$lambda(closure$entity_0, this$SchoolEditPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$SchoolEditPresenter$handleClickSave$lambda(closure$entity_0, this$SchoolEditPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  SchoolEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, SchoolEditPresenter$handleClickSave$lambda(entity, this));
};
  SchoolEditPresenter.prototype.handleTimeZoneClicked = function() {
  var tmp$;
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, (tmp$ = this.entity) != null ? tmp$.schoolTimeZone : null, TimeZoneListView$Companion_getInstance().VIEW_NAME, PrimitiveClasses$stringClass, serializer(kotlin_js_internal_StringCompanionObject), TimeZoneListPresenter$Companion_getInstance().RESULT_TIMEZONE_KEY));
};
  SchoolEditPresenter.prototype.handleHolidayCalendarClicked = function() {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, HolidayCalendarListView$Companion_getInstance().VIEW_NAME, getKClass(HolidayCalendar), HolidayCalendar.Companion.serializer(), SchoolEditPresenter$Companion_getInstance().SAVEDSTATE_KEY_HOLIDAYCALENDAR));
};
  function SchoolEditPresenter$Companion() {
    SchoolEditPresenter$Companion_instance = this;
    this.SAVEDSTATE_KEY_HOLIDAYCALENDAR = 'SchoolHolidayCalendar';
  }
  SchoolEditPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SchoolEditPresenter$Companion_instance = null;
  function SchoolEditPresenter$Companion_getInstance() {
    if (SchoolEditPresenter$Companion_instance === null) {
      new SchoolEditPresenter$Companion();
    }
    return SchoolEditPresenter$Companion_instance;
  }
  SchoolEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SchoolEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function SchoolListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    SchoolListPresenter$Companion_getInstance();
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.searchText = null;
    this.loggedInPersonUid = L0;
    this.filterByPermission_0 = L0;
  }
  Object.defineProperty(SchoolListPresenter.prototype, 'sortOptions', {
  configurable: true, 
  get: function() {
  return SchoolListPresenter$Companion_getInstance().SORT_OPTIONS;
}});
  SchoolListPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0;
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.selectedSortOption = SchoolListPresenter$Companion_getInstance().SORT_OPTIONS.get_za3lpa$(0);
  this.loggedInPersonUid = this.accountManager.activeAccount.personUid;
  this.filterByPermission_0 = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_FILTER_BY_PERMISSION)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : Role$Companion$PERMISSION_SCHOOL_SELECT;
  this.updateListOnView_0();
};
  function Coroutine$onCheckAddPermission_tn71rk$_2($this, account_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$_0 = void 0;
    this.local$account = account_0;
  }
  Coroutine$onCheckAddPermission_tn71rk$_2.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onCheckAddPermission_tn71rk$_2.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onCheckAddPermission_tn71rk$_2.prototype.constructor = Coroutine$onCheckAddPermission_tn71rk$_2;
  Coroutine$onCheckAddPermission_tn71rk$_2.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.local$tmp$_0 = this.$this.view;
        this.state_0 = 2;
        this.result_0 = this.$this.db.entityRoleDao.userHasTableLevelPermission_3pjtqy$((tmp$ = this.local$account != null ? this.local$account.personUid : null) != null ? tmp$ : L0, Role$Companion$PERMISSION_SCHOOL_INSERT, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$tmp$_0.newSchoolListOptionVisible = this.result_0;
        return true;
      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);
};
  SchoolListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account_0, continuation_0, suspended) {
  var instance = new Coroutine$onCheckAddPermission_tn71rk$_2(this, account_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  SchoolListPresenter.prototype.updateListOnView_0 = function() {
  var tmp$, tmp$_0;
  this.view.list = this.repo.schoolDao.findAllActiveSchoolWithMemberCountAndLocationName_gx19nu$(toQueryLikeParam(this.searchText), this.loggedInPersonUid, this.filterByPermission_0, (tmp$_0 = (tmp$ = this.selectedSortOption) != null ? tmp$.flag : null) != null ? tmp$_0 : 1);
};
  SchoolListPresenter.prototype.handleClickEntry_11rc$ = function(entry) {
  switch (this.mListMode.name) {
    case 'PICKER':
      var di = this.di;
      var strategy = ListSerializer(School.Companion.serializer());
      var entity = listOf_0(entry);
      var tmp$;
      var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
      this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
      break;
    case 'BROWSER':
      this.systemImpl.go_gofqk3$(SchoolDetailView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, entry.schoolUid.toString())), this.context);
      break;
  }
};
  SchoolListPresenter.prototype.handleClickCreateNewFab = function() {
  this.systemImpl.go_gofqk3$(SchoolEditView$Companion_getInstance().VIEW_NAME, emptyMap(), this.context);
};
  SchoolListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
  var tmp$;
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, SchoolEditView$Companion_getInstance().VIEW_NAME, getKClass(School), School.Companion.serializer(), destinationResultKey != null ? destinationResultKey : SchoolListPresenter$Companion_getInstance().SCHOOL_RESULT_KEY, void 0, (tmp$ = args != null ? toMutableMap(args) : null) != null ? tmp$ : toMutableMap(this.arguments)));
};
  SchoolListPresenter.prototype.onClickSort_o8nuns$ = function(sortOption) {
  UstadListPresenter.prototype.onClickSort_o8nuns$.call(this, sortOption);
  this.updateListOnView_0();
};
  SchoolListPresenter.prototype.onSearchSubmitted_pdl1vj$ = function(text) {
  this.searchText = text;
  this.updateListOnView_0();
};
  SchoolListPresenter.prototype.handleClickJoinSchool = function() {
  this.systemImpl.go_gofqk3$(JoinWithCodeView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_CODE_TABLE, (164).toString())), this.context);
};
  function SchoolListPresenter$Companion() {
    SchoolListPresenter$Companion_instance = this;
    this.SCHOOL_RESULT_KEY = 'School';
    this.SORT_OPTIONS = listOf([new SortOrderOption(2046, 1, true), new SortOrderOption(2046, 2, false)]);
  }
  SchoolListPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SchoolListPresenter$Companion_instance = null;
  function SchoolListPresenter$Companion_getInstance() {
    if (SchoolListPresenter$Companion_instance === null) {
      new SchoolListPresenter$Companion();
    }
    return SchoolListPresenter$Companion_instance;
  }
  SchoolListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SchoolListPresenter', 
  interfaces: [UstadListPresenter, OnSearchSubmitted, OnSortOptionSelected]};
  function SchoolMemberListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    SchoolMemberListPresenter$Companion_getInstance();
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.searchText = null;
  }
  Object.defineProperty(SchoolMemberListPresenter.prototype, 'sortOptions', {
  configurable: true, 
  get: function() {
  return SchoolMemberListPresenter$Companion_getInstance().SORT_OPTIONS;
}});
  SchoolMemberListPresenter.prototype.onCreate = function(savedState) {
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.mLoggedInPersonUid = this.accountManager.activeAccount.personUid;
  this.selectedSortOption = SchoolMemberListPresenter$Companion_getInstance().SORT_OPTIONS.get_za3lpa$(0);
  this.updateListOnView_0();
};
  SchoolMemberListPresenter.prototype.onPause = function() {
  this.searchText = '';
  this.updateListOnView_0();
};
  SchoolMemberListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6;
  tmp$_6 = this.db.schoolDao;
  tmp$_0 = (tmp$ = account != null ? account.personUid : null) != null ? tmp$ : L0;
  tmp$_3 = (tmp$_2 = (tmp$_1 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_FILTER_BY_SCHOOLUID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0;
  if (((tmp$_4 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_FILTER_BY_ROLE)) != null ? toInt(tmp$_4) : null) === 1003) {
    tmp$_5 = Role$Companion$PERMISSION_SCHOOL_ADD_STUDENT;
  } else {
    tmp$_5 = Role$Companion$PERMISSION_SCHOOL_ADD_STAFF;
  }
  return tmp$_6.personHasPermissionWithSchool_b9bd0d$(tmp$_0, tmp$_3, tmp$_5, continuation);
};
  function Coroutine$onLoadFromDb_1($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
  }
  Coroutine$onLoadFromDb_1.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadFromDb_1.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadFromDb_1.prototype.constructor = Coroutine$onLoadFromDb_1;
  Coroutine$onLoadFromDb_1.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = UstadListPresenter.prototype.onLoadFromDb.call(this.$this, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.$this.updateListOnView_0();
        return;
      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);
};
  SchoolMemberListPresenter.prototype.onLoadFromDb = function(continuation_0, suspended) {
  var instance = new Coroutine$onLoadFromDb_1(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$SchoolMemberListPresenter$updateListOnView$lambda(this$SchoolMemberListPresenter_0, closure$schoolUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$SchoolMemberListPresenter = this$SchoolMemberListPresenter_0;
    this.local$closure$schoolUid = closure$schoolUid_0;
  }
  Coroutine$SchoolMemberListPresenter$updateListOnView$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SchoolMemberListPresenter$updateListOnView$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SchoolMemberListPresenter$updateListOnView$lambda.prototype.constructor = Coroutine$SchoolMemberListPresenter$updateListOnView$lambda;
  Coroutine$SchoolMemberListPresenter$updateListOnView$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6, tmp$_7;
        this.state_0 = 2;
        this.result_0 = this.local$this$SchoolMemberListPresenter.db.schoolDao.personHasPermissionWithSchool_b9bd0d$(this.local$this$SchoolMemberListPresenter.accountManager.activeAccount.personUid, (tmp$_0 = (tmp$ = this.local$this$SchoolMemberListPresenter.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_FILTER_BY_SCHOOLUID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0, Role$Companion$PERMISSION_SCHOOL_ADD_STUDENT, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var hasAddStudentPermission = this.result_0;
        var $receiver = this.local$this$SchoolMemberListPresenter.view;
        tmp$_7 = hasAddStudentPermission ? $receiver : null;
        tmp$_6 = this.local$this$SchoolMemberListPresenter.db.schoolMemberDao;
        tmp$_3 = (tmp$_2 = (tmp$_1 = this.local$this$SchoolMemberListPresenter.selectedSortOption) != null ? tmp$_1.flag : null) != null ? tmp$_2 : 0;
        tmp$_4 = toQueryLikeParam(this.local$this$SchoolMemberListPresenter.searchText);
        tmp$_5 = this.local$this$SchoolMemberListPresenter.mLoggedInPersonUid;
        return tmp$_7 != null && (tmp$_7.pendingStudentList = tmp$_6.findAllActiveMembersBySchoolAndRoleUid_de0qyg$(this.local$closure$schoolUid, 1005, tmp$_3, tmp$_4, tmp$_5)) , Unit;
      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 SchoolMemberListPresenter$updateListOnView$lambda(this$SchoolMemberListPresenter_0, closure$schoolUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$SchoolMemberListPresenter$updateListOnView$lambda(this$SchoolMemberListPresenter_0, closure$schoolUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  SchoolMemberListPresenter.prototype.updateListOnView_0 = function() {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5;
  var schoolRole = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_FILTER_BY_ROLE)) != null ? toInt(tmp$) : null) != null ? tmp$_0 : 0;
  var schoolUid = (tmp$_2 = (tmp$_1 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_FILTER_BY_SCHOOLUID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0;
  if (((tmp$_3 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_FILTER_BY_ROLE)) != null ? toInt(tmp$_3) : null) === 1003) {
    launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, SchoolMemberListPresenter$updateListOnView$lambda(this, schoolUid));
  }
  this.view.list = this.repo.schoolMemberDao.findAllActiveMembersBySchoolAndRoleUid_de0qyg$(schoolUid, schoolRole, (tmp$_5 = (tmp$_4 = this.selectedSortOption) != null ? tmp$_4.flag : null) != null ? tmp$_5 : 0, toQueryLikeParam(this.searchText), this.mLoggedInPersonUid);
};
  function Coroutine$SchoolMemberListPresenter$handleEnrolMember$lambda(this$SchoolMemberListPresenter_0, closure$schoolUid_0, closure$personUid_0, closure$role_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$SchoolMemberListPresenter = this$SchoolMemberListPresenter_0;
    this.local$closure$schoolUid = closure$schoolUid_0;
    this.local$closure$personUid = closure$personUid_0;
    this.local$closure$role = closure$role_0;
  }
  Coroutine$SchoolMemberListPresenter$handleEnrolMember$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SchoolMemberListPresenter$handleEnrolMember$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SchoolMemberListPresenter$handleEnrolMember$lambda.prototype.constructor = Coroutine$SchoolMemberListPresenter$handleEnrolMember$lambda;
  Coroutine$SchoolMemberListPresenter$handleEnrolMember$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = enrollPersonToSchool(this.local$this$SchoolMemberListPresenter.repo, this.local$closure$schoolUid, this.local$closure$personUid, this.local$closure$role, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 SchoolMemberListPresenter$handleEnrolMember$lambda(this$SchoolMemberListPresenter_0, closure$schoolUid_0, closure$personUid_0, closure$role_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$SchoolMemberListPresenter$handleEnrolMember$lambda(this$SchoolMemberListPresenter_0, closure$schoolUid_0, closure$personUid_0, closure$role_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  SchoolMemberListPresenter.prototype.handleEnrolMember_foc3l4$ = function(schoolUid, personUid, role) {
  launch(coroutines.GlobalScope, void 0, void 0, SchoolMemberListPresenter$handleEnrolMember$lambda(this, schoolUid, personUid, role));
};
  SchoolMemberListPresenter.prototype.handleClickEntry_11rc$ = function(entry) {
  switch (this.mListMode.name) {
    case 'PICKER':
      var di = this.di;
      var strategy = ListSerializer(SchoolMember.Companion.serializer());
      var entity = listOf_0(entry);
      var tmp$;
      var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
      this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
      break;
    case 'BROWSER':
      this.systemImpl.go_gofqk3$(PersonDetailView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, entry.schoolMemberPersonUid.toString())), this.context);
      break;
  }
};
  function Coroutine$SchoolMemberListPresenter$handleClickPendingRequest$lambda(closure$approved_0, this$SchoolMemberListPresenter_0, closure$member_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$approved = closure$approved_0;
    this.local$this$SchoolMemberListPresenter = this$SchoolMemberListPresenter_0;
    this.local$closure$member = closure$member_0;
  }
  Coroutine$SchoolMemberListPresenter$handleClickPendingRequest$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SchoolMemberListPresenter$handleClickPendingRequest$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SchoolMemberListPresenter$handleClickPendingRequest$lambda.prototype.constructor = Coroutine$SchoolMemberListPresenter$handleClickPendingRequest$lambda;
  Coroutine$SchoolMemberListPresenter$handleClickPendingRequest$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$closure$approved) {
          this.state_0 = 3;
          this.result_0 = approvePendingSchoolMember(this.local$this$SchoolMemberListPresenter.repo, this.local$closure$member, void 0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          var tmp$ = this.local$this$SchoolMemberListPresenter.repo.schoolMemberDao;
          var $receiver = this.local$closure$member;
          $receiver.schoolMemberActive = false;
          this.state_0 = 2;
          this.result_0 = tmp$.updateAsync_nzwwdw$($receiver, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        return this.result_0;
      case 3:
        return this.result_0;
      case 4:
        return;
      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 SchoolMemberListPresenter$handleClickPendingRequest$lambda(closure$approved_0, this$SchoolMemberListPresenter_0, closure$member_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$SchoolMemberListPresenter$handleClickPendingRequest$lambda(closure$approved_0, this$SchoolMemberListPresenter_0, closure$member_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  SchoolMemberListPresenter.prototype.handleClickPendingRequest_k3brcd$ = function(member, approved) {
  launch(coroutines.GlobalScope, void 0, void 0, SchoolMemberListPresenter$handleClickPendingRequest$lambda(approved, this, member));
};
  SchoolMemberListPresenter.prototype.handleClickCreateNewFab = function() {
  this.view.addMember();
};
  SchoolMemberListPresenter.prototype.onClickSort_o8nuns$ = function(sortOption) {
  UstadListPresenter.prototype.onClickSort_o8nuns$.call(this, sortOption);
  this.updateListOnView_0();
};
  SchoolMemberListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
  var tmp$;
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, PersonListView$Companion_getInstance().VIEW_NAME, getKClass(Person), Person.Companion.serializer(), destinationResultKey, true, (tmp$ = args != null ? toMutableMap(args) : null) != null ? tmp$ : LinkedHashMap_init()));
};
  SchoolMemberListPresenter.prototype.onSearchSubmitted_pdl1vj$ = function(text) {
  this.searchText = text;
  this.updateListOnView_0();
};
  function SchoolMemberListPresenter$Companion() {
    SchoolMemberListPresenter$Companion_instance = this;
    this.SORT_OPTIONS = listOf([new SortOrderOption(2038, 1, true), new SortOrderOption(2038, 2, false), new SortOrderOption(2037, 3, true), new SortOrderOption(2037, 4, false)]);
  }
  SchoolMemberListPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SchoolMemberListPresenter$Companion_instance = null;
  function SchoolMemberListPresenter$Companion_getInstance() {
    if (SchoolMemberListPresenter$Companion_instance === null) {
      new SchoolMemberListPresenter$Companion();
    }
    return SchoolMemberListPresenter$Companion_instance;
  }
  SchoolMemberListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SchoolMemberListPresenter', 
  interfaces: [UstadListPresenter, OnSearchSubmitted, OnSortOptionSelected]};
  function ScopedGrantDetailPresenter(context, arguments_0, view, lifecycleOwner, di) {
    ScopedGrantDetailPresenter$Companion_getInstance();
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(ScopedGrantDetailPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$LIVEDATA_getInstance();
}});
  ScopedGrantDetailPresenter.prototype.onCreate = function(savedState) {
  UstadDetailPresenter.prototype.onCreate.call(this, savedState);
};
  ScopedGrantDetailPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  return true;
};
  ScopedGrantDetailPresenter.prototype.onLoadLiveData_7hogkd$ = function(repo) {
  var tmp$, tmp$_0;
  return repo.scopedGrantDao.findByUidLiveWithName_s8cxhz$((tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0);
};
  ScopedGrantDetailPresenter.prototype.handleClickEdit = function() {
  var tmp$, tmp$_0, tmp$_1;
  this.requireNavController().navigate_oc2wlg$(ScopedGrantEditView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, (tmp$_1 = (tmp$_0 = (tmp$ = this.entity) != null ? tmp$.sgUid : null) != null ? tmp$_0.toString() : null) != null ? tmp$_1 : '0')));
};
  function ScopedGrantDetailPresenter$Companion() {
    ScopedGrantDetailPresenter$Companion_instance = this;
  }
  ScopedGrantDetailPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ScopedGrantDetailPresenter$Companion_instance = null;
  function ScopedGrantDetailPresenter$Companion_getInstance() {
    if (ScopedGrantDetailPresenter$Companion_instance === null) {
      new ScopedGrantDetailPresenter$Companion();
    }
    return ScopedGrantDetailPresenter$Companion_instance;
  }
  ScopedGrantDetailPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ScopedGrantDetailPresenter', 
  interfaces: [UstadDetailPresenter]};
  function ScopedGrantEditPresenter(context, arguments_0, view, lifecycleOwner, di) {
    ScopedGrantEditPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(ScopedGrantEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  ScopedGrantEditPresenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
};
  function Coroutine$onLoadEntityFromDb_7hogkd$_25($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$scopedGrant = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_25.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_25.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_25.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_25;
  Coroutine$onLoadEntityFromDb_7hogkd$_25.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2;
        var sgUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        var $receiver = this.local$db.scopedGrantDao;
        if ((tmp$_1 = !equals(sgUid, L0) ? $receiver : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_1.findByUid_s8cxhz$(sgUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        continue;
      case 3:
        var tmp$_3;
        if ((tmp$_2 = this.result_0) != null) 
          tmp$_3 = tmp$_2;
        else {
          var $receiver_0 = new ScopedGrant();
          var tmp$_4, tmp$_5, tmp$_6, tmp$_7, tmp$_8, tmp$_9;
          $receiver_0.sgEntityUid = (tmp$_5 = (tmp$_4 = this.$this.arguments.get_11rb$(ScopedGrantEditView$Companion_getInstance().ARG_GRANT_ON_ENTITY_UID)) != null ? toLong(tmp$_4) : null) != null ? tmp$_5 : L0;
          $receiver_0.sgGroupUid = (tmp$_7 = (tmp$_6 = this.$this.arguments.get_11rb$(ScopedGrantEditView$Companion_getInstance().ARG_GRANT_TO_GROUPUID)) != null ? toLong(tmp$_6) : null) != null ? tmp$_7 : L0;
          $receiver_0.sgTableId = (tmp$_9 = (tmp$_8 = this.$this.arguments.get_11rb$(ScopedGrantEditView$Companion_getInstance().ARG_GRANT_ON_TABLE_ID)) != null ? toInt(tmp$_8) : null) != null ? tmp$_9 : 0;
          tmp$_3 = $receiver_0;
        }
        this.local$scopedGrant = tmp$_3;
        this.state_0 = 4;
        this.result_0 = this.$this.setAvailablePermissionsOnView_0(this.local$scopedGrant, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        return this.local$scopedGrant;
      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);
};
  ScopedGrantEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_25(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$setAvailablePermissionsOnView_0($this, scopedGrant_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$ = void 0;
    this.local$scopedGrant = scopedGrant_0;
  }
  Coroutine$setAvailablePermissionsOnView_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$setAvailablePermissionsOnView_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$setAvailablePermissionsOnView_0.prototype.constructor = Coroutine$setAvailablePermissionsOnView_0;
  Coroutine$setAvailablePermissionsOnView_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$scopedGrant.sgTableId === 6) {
          this.state_0 = 2;
          this.result_0 = this.$this.db.clazzDao.selectDelegatablePermissions_3pjtqy$(this.$this.accountManager.activeAccount.personUid, this.local$scopedGrant.sgEntityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.local$tmp$ = L0;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.local$tmp$ = foldWithBinaryOr(this.result_0).and(ScopedGrantEditPresenter$Companion_getInstance().COURSE_PERMISSIONS);
        this.state_0 = 3;
        continue;
      case 3:
        var availablePermissions = this.local$tmp$;
        var tmp$ = this.$this.view;
        var $receiver = ScopedGrantEditPresenter$Companion_getInstance().PERMISSION_MESSAGE_ID_LIST;
        var destination = ArrayList_init();
        var tmp$_0;
        tmp$_0 = $receiver.iterator();
        while (tmp$_0.hasNext()) {
          var element = tmp$_0.next();
          if (hasFlag_0(availablePermissions, element.flagVal)) 
            destination.add_11rb$(element);
        }
        var destination_0 = ArrayList_init_0(collectionSizeOrDefault(destination, 10));
        var tmp$_1;
        tmp$_1 = destination.iterator();
        while (tmp$_1.hasNext()) {
          var item = tmp$_1.next();
          destination_0.add_11rb$(item.toBitmaskFlag_s8cxhz$(this.local$scopedGrant.sgPermissions));
        }
        tmp$.bitmaskList = DoorMutableLiveData_init_0(destination_0);
        return;
      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);
};
  ScopedGrantEditPresenter.prototype.setAvailablePermissionsOnView_0 = function(scopedGrant_0, continuation_0, suspended) {
  var instance = new Coroutine$setAvailablePermissionsOnView_0(this, scopedGrant_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ScopedGrantEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$, tmp$_0, tmp$_1;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  var editEntity;
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = ScopedGrant.Companion.serializer();
    var tmp$_2;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_2 : throwCCE(), null);
    editEntity = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    var $receiver = new ScopedGrant();
    var tmp$_3, tmp$_4;
    $receiver.sgGroupUid = (tmp$_4 = (tmp$_3 = this.arguments.get_11rb$(ScopedGrantEditView$Companion_getInstance().ARG_GRANT_TO_GROUPUID)) != null ? toLong(tmp$_3) : null) != null ? tmp$_4 : L0;
    editEntity = $receiver;
  }
  tmp$_0 = (tmp$ = this.arguments.get_11rb$(ScopedGrantEditView$Companion_getInstance().ARG_PERMISSION_LIST)) != null ? toInt(tmp$) : null;
  if (tmp$_0 == null) {
    throw IllegalArgumentException_init('Invalid permission list flag');
  }
  var permissionListKey = tmp$_0;
  tmp$_1 = ScopedGrantEditPresenter$Companion_getInstance().PERMISSION_LIST_MAP.get_11rb$(permissionListKey);
  if (tmp$_1 == null) {
    throw IllegalArgumentException_init('Invalid permission list key');
  }
  var permissionList = tmp$_1;
  var tmp$_5 = this.view;
  var destination = ArrayList_init_0(collectionSizeOrDefault(permissionList, 10));
  var tmp$_6;
  tmp$_6 = permissionList.iterator();
  while (tmp$_6.hasNext()) {
    var item = tmp$_6.next();
    destination.add_11rb$(item.toBitmaskFlag_s8cxhz$(editEntity.sgPermissions));
  }
  tmp$_5.bitmaskList = DoorMutableLiveData_init_0(destination);
  return editEntity;
};
  ScopedGrantEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  function Coroutine$ScopedGrantEditPresenter$handleClickSave$lambda(closure$entity_0, this$ScopedGrantEditPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$ScopedGrantEditPresenter = this$ScopedGrantEditPresenter_0;
    this.local$tmp$ = void 0;
  }
  Coroutine$ScopedGrantEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ScopedGrantEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ScopedGrantEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$ScopedGrantEditPresenter$handleClickSave$lambda;
  Coroutine$ScopedGrantEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (equals(this.local$closure$entity.sgUid, L0)) {
          this.local$tmp$ = this.local$closure$entity;
          this.state_0 = 3;
          this.result_0 = this.local$this$ScopedGrantEditPresenter.db.scopedGrantDao.insertAsync_y0tj3a$(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 2;
          this.result_0 = this.local$this$ScopedGrantEditPresenter.db.scopedGrantDao.updateAsync_y0tj3a$(this.local$closure$entity, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 4;
        continue;
      case 3:
        this.local$tmp$.sgUid = this.result_0;
        this.state_0 = 4;
        continue;
      case 4:
        return this.local$this$ScopedGrantEditPresenter.onFinish_xcg1s8$(ScopedGrantDetailView$Companion_getInstance().VIEW_NAME, this.local$closure$entity.sgUid, this.local$closure$entity, ScopedGrant.Companion.serializer()) , Unit;
      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 ScopedGrantEditPresenter$handleClickSave$lambda(closure$entity_0, this$ScopedGrantEditPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ScopedGrantEditPresenter$handleClickSave$lambda(closure$entity_0, this$ScopedGrantEditPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  ScopedGrantEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  var tmp$, tmp$_0;
  tmp$_0 = (tmp$ = this.view.bitmaskList) != null ? tmp$.getValue() : null;
  if (tmp$_0 == null) {
    throw IllegalStateException_init('No bitmask list');
  }
  var permissionsList = tmp$_0;
  entity.sgPermissions = get_combinedFlagValue(permissionsList);
  launch(this.presenterScope, void 0, void 0, ScopedGrantEditPresenter$handleClickSave$lambda(entity, this));
};
  function ScopedGrantEditPresenter$Companion() {
    ScopedGrantEditPresenter$Companion_instance = this;
    this.PERMISSION_MESSAGE_ID_LIST = listOf([new BitmaskMessageId(Role$Companion$PERMISSION_PERSON_DELEGATE, 2664), new BitmaskMessageId(Role$Companion$PERMISSION_SCHOOL_SELECT, 2819), new BitmaskMessageId(Role$Companion$PERMISSION_SCHOOL_UPDATE, 2527), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_ADD_STUDENT, 2813), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_ADD_TEACHER, 2814), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_SELECT, 2812), new BitmaskMessageId(Role$Companion$PERMISSION_ADD_CLASS_TO_SCHOOL, 2821), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_UPDATE, 2820), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_LOG_ATTENDANCE_INSERT, 2491), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_LOG_ATTENDANCE_SELECT, 2490), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_LOG_ATTENDANCE_UPDATE, 2492), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_CONTENT_SELECT, 2730), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_CONTENT_UPDATE, 2731), new BitmaskMessageId(Role$Companion$PERMISSION_ASSIGNMENT_SELECT, 2815), new BitmaskMessageId(Role$Companion$PERMISSION_ASSIGNMENT_UPDATE, 2816), new BitmaskMessageId(Role$Companion$PERMISSION_PERSON_LEARNINGRECORD_SELECT, 2732), new BitmaskMessageId(Role$Companion$PERMISSION_PERSON_SELECT, 2817), new BitmaskMessageId(Role$Companion$PERMISSION_PERSON_UPDATE, 2818), new BitmaskMessageId(Role$Companion$PERMISSION_PERSONCONTACT_SELECT, 2733), new BitmaskMessageId(Role$Companion$PERMISSION_PERSONCONTACT_UPDATE, 2734), new BitmaskMessageId(Role$Companion$PERMISSION_PERSONSOCIOECONOMIC_SELECT, 2735), new BitmaskMessageId(Role$Companion$PERMISSION_PERSONSOCIOECONOMIC_UPDATE, 2736)]);
    this.COURSE_PERMISSIONS = L277631006154574;
    this.PERMISSION_LIST_MAP = mapOf([to(6, listOf([new BitmaskMessageId(Role$Companion$PERMISSION_PERSON_DELEGATE, 2664), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_SELECT, 2811), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_UPDATE, 2324), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_ADD_STUDENT, 2813), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_ADD_TEACHER, 2814), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_LOG_ATTENDANCE_SELECT, 2490), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_LOG_ATTENDANCE_UPDATE, 2492), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_CONTENT_SELECT, 2730), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_CONTENT_UPDATE, 2731), new BitmaskMessageId(Role$Companion$PERMISSION_ASSIGNMENT_SELECT, 2815), new BitmaskMessageId(Role$Companion$PERMISSION_ASSIGNMENT_UPDATE, 2816), new BitmaskMessageId(Role$Companion$PERMISSION_PERSON_LEARNINGRECORD_SELECT, 2732), new BitmaskMessageId(Role$Companion$PERMISSION_PERSON_SELECT, 2817), new BitmaskMessageId(Role$Companion$PERMISSION_PERSON_UPDATE, 2818), new BitmaskMessageId(Role$Companion$PERMISSION_PERSONCONTACT_SELECT, 2733), new BitmaskMessageId(Role$Companion$PERMISSION_PERSONCONTACT_UPDATE, 2734), new BitmaskMessageId(Role$Companion$PERMISSION_PERSONSOCIOECONOMIC_SELECT, 2735), new BitmaskMessageId(Role$Companion$PERMISSION_PERSONSOCIOECONOMIC_UPDATE, 2736)])), to(164, listOf([new BitmaskMessageId(Role$Companion$PERMISSION_PERSON_DELEGATE, 2664), new BitmaskMessageId(Role$Companion$PERMISSION_SCHOOL_SELECT, 2819), new BitmaskMessageId(Role$Companion$PERMISSION_SCHOOL_UPDATE, 2527), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_ADD_STUDENT, 2813), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_ADD_TEACHER, 2814), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_SELECT, 2812), new BitmaskMessageId(Role$Companion$PERMISSION_ADD_CLASS_TO_SCHOOL, 2821), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_UPDATE, 2820), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_LOG_ATTENDANCE_SELECT, 2490), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_LOG_ATTENDANCE_UPDATE, 2492), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_CONTENT_SELECT, 2730), new BitmaskMessageId(Role$Companion$PERMISSION_CLAZZ_CONTENT_UPDATE, 2731), new BitmaskMessageId(Role$Companion$PERMISSION_ASSIGNMENT_SELECT, 2815), new BitmaskMessageId(Role$Companion$PERMISSION_ASSIGNMENT_UPDATE, 2816), new BitmaskMessageId(Role$Companion$PERMISSION_PERSON_LEARNINGRECORD_SELECT, 2732), new BitmaskMessageId(Role$Companion$PERMISSION_PERSON_SELECT, 2817), new BitmaskMessageId(Role$Companion$PERMISSION_PERSON_UPDATE, 2818), new BitmaskMessageId(Role$Companion$PERMISSION_PERSONCONTACT_SELECT, 2733), new BitmaskMessageId(Role$Companion$PERMISSION_PERSONCONTACT_UPDATE, 2734), new BitmaskMessageId(Role$Companion$PERMISSION_PERSONSOCIOECONOMIC_SELECT, 2735), new BitmaskMessageId(Role$Companion$PERMISSION_PERSONSOCIOECONOMIC_UPDATE, 2736)]))]);
  }
  ScopedGrantEditPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ScopedGrantEditPresenter$Companion_instance = null;
  function ScopedGrantEditPresenter$Companion_getInstance() {
    if (ScopedGrantEditPresenter$Companion_instance === null) {
      new ScopedGrantEditPresenter$Companion();
    }
    return ScopedGrantEditPresenter$Companion_instance;
  }
  ScopedGrantEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ScopedGrantEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function ScopedGrantListItemListener() {
  }
  ScopedGrantListItemListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ScopedGrantListItemListener', 
  interfaces: []};
  function ScopedGrantListPresenter(context, arguments_0, view, di, lifecycleOwner, scopedGrantItemListener) {
    if (scopedGrantItemListener === void 0) 
      scopedGrantItemListener = new DefaultScopedGrantListItemListener(view, ListViewMode$BROWSER_getInstance(), context, di);
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.scopedGrantItemListener_0 = scopedGrantItemListener;
    this.tableId_0 = 0;
    this.entityUid_0 = L0;
  }
  ScopedGrantListPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  this.tableId_0 = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(ScopedGrantListView$Companion_getInstance().ARG_FILTER_TABLE_ID)) != null ? toInt(tmp$) : null) != null ? tmp$_0 : 0;
  this.entityUid_0 = (tmp$_2 = (tmp$_1 = this.arguments.get_11rb$(ScopedGrantListView$Companion_getInstance().ARG_FILTER_ENTITY_UID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0;
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  this.updateListOnView_0();
  this.scopedGrantItemListener_0.listViewMode = this.mListMode;
};
  ScopedGrantListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
};
  function Coroutine$onCheckAddPermission_tn71rk$_3($this, account_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$_0 = void 0;
    this.local$account = account_0;
  }
  Coroutine$onCheckAddPermission_tn71rk$_3.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onCheckAddPermission_tn71rk$_3.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onCheckAddPermission_tn71rk$_3.prototype.constructor = Coroutine$onCheckAddPermission_tn71rk$_3;
  Coroutine$onCheckAddPermission_tn71rk$_3.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        if (this.$this.tableId_0 === 6) {
          this.state_0 = 2;
          this.result_0 = this.$this.repo.clazzDao.personHasPermissionWithClazz_b9bd0d$((tmp$ = this.local$account != null ? this.local$account.personUid : null) != null ? tmp$ : L0, this.$this.entityUid_0, Role$Companion$PERMISSION_PERSON_DELEGATE, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.local$tmp$_0 = false;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.local$tmp$_0 = this.result_0;
        this.state_0 = 3;
        continue;
      case 3:
        return this.local$tmp$_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);
};
  ScopedGrantListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account_0, continuation_0, suspended) {
  var instance = new Coroutine$onCheckAddPermission_tn71rk$_3(this, account_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ScopedGrantListPresenter.prototype.updateListOnView_0 = function() {
  var tmp$, tmp$_0;
  this.view.list = this.repo.scopedGrantDao.findByTableIdAndEntityUidWithNameAsDataSource_6svq3l$(this.tableId_0, (tmp$_0 = (tmp$ = this.arguments.get_11rb$(ScopedGrantListView$Companion_getInstance().ARG_FILTER_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0);
};
  ScopedGrantListPresenter.prototype.handleClickCreateNewFab = function() {
  var args = mutableMapOf([to(ScopedGrantEditView$Companion_getInstance().ARG_GRANT_ON_TABLE_ID, this.tableId_0.toString()), to(ScopedGrantEditView$Companion_getInstance().ARG_GRANT_ON_ENTITY_UID, this.entityUid_0.toString()), to(UstadView$Companion_getInstance().ARG_GO_TO_COMPLETE, ScopedGrantEditView$Companion_getInstance().VIEW_NAME), to(UstadView$Companion_getInstance().ARG_LISTMODE, ListViewMode$PICKER_getInstance().toString())]);
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, PersonListView$Companion_getInstance().VIEW_NAME, getKClass(ScopedGrant), ScopedGrant.Companion.serializer(), void 0, void 0, args));
};
  ScopedGrantListPresenter.prototype.onClickScopedGrant_ersk21$ = function(scopedGrant) {
  return this.scopedGrantItemListener_0.onClickScopedGrant_ersk21$(scopedGrant);
};
  ScopedGrantListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ScopedGrantListPresenter', 
  interfaces: [ScopedGrantListItemListener, UstadListPresenter]};
  function SelectExtractFilePresenterCommon(context, arguments_0, view, di) {
    UstadBaseController.call(this, context, arguments_0, view, di);
    var tmp$;
    this.accountManager_t9qujl$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, SelectExtractFilePresenterCommon$accountManager_metadata);
    var context_0 = this.accountManager.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_0;
    var tmp$_1;
    this.repo_y8v1pr$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_0 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_1 : throwCCE(), 2).provideDelegate_tpuvb9$(this, SelectExtractFilePresenterCommon$repo_metadata);
    var tmp$_2;
    this.systemImpl_n9q7ce$_0 = Instance(this, Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$_2 : throwCCE(), null).provideDelegate_tpuvb9$(this, SelectExtractFilePresenterCommon$systemImpl_metadata);
  }
  var SelectExtractFilePresenterCommon$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(SelectExtractFilePresenterCommon.prototype, 'accountManager', {
  configurable: true, 
  get: function() {
  return this.accountManager_t9qujl$_0.value;
}});
  var SelectExtractFilePresenterCommon$repo_metadata = new PropertyMetadata('repo');
  Object.defineProperty(SelectExtractFilePresenterCommon.prototype, 'repo', {
  configurable: true, 
  get: function() {
  return this.repo_y8v1pr$_0.value;
}});
  var SelectExtractFilePresenterCommon$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(SelectExtractFilePresenterCommon.prototype, 'systemImpl', {
  configurable: true, 
  get: function() {
  return this.systemImpl_n9q7ce$_0.value;
}});
  SelectExtractFilePresenterCommon.prototype.onCreate = function(savedState) {
  UstadBaseController.prototype.onCreate.call(this, savedState);
  this.view.acceptedMimeTypes = split(toString(this.arguments.get_11rb$(SelectFileView$Companion_getInstance().ARG_MIMETYPE_SELECTED)), [';']);
};
  function SelectExtractFilePresenterCommon$handleUriSelected$lambda$lambda(closure$uri) {
    return function() {
  return 'SelectExtractFilePresenterCommon: Extracting metadata from ' + toString(closure$uri) + ' ';
};
  }
  function Coroutine$SelectExtractFilePresenterCommon$handleUriSelected$lambda(this$SelectExtractFilePresenterCommon_0, closure$uri_0, closure$filename_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 7;
    this.local$this$SelectExtractFilePresenterCommon = this$SelectExtractFilePresenterCommon_0;
    this.local$closure$uri = closure$uri_0;
    this.local$closure$filename = closure$filename_0;
  }
  Coroutine$SelectExtractFilePresenterCommon$handleUriSelected$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SelectExtractFilePresenterCommon$handleUriSelected$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SelectExtractFilePresenterCommon$handleUriSelected$lambda.prototype.constructor = Coroutine$SelectExtractFilePresenterCommon$handleUriSelected$lambda;
  Coroutine$SelectExtractFilePresenterCommon$handleUriSelected$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$this$SelectExtractFilePresenterCommon.view.loading = true;
        this.exceptionState_0 = 3;
        napier.Napier.d_9h2hdn$(void 0, void 0, SelectExtractFilePresenterCommon$handleUriSelected$lambda$lambda(this.local$closure$uri));
        this.state_0 = 1;
        this.result_0 = this.local$this$SelectExtractFilePresenterCommon.extractMetadata_puj7f4$(this.local$closure$uri, this.local$closure$filename, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        var metadata = this.result_0;
        this.local$this$SelectExtractFilePresenterCommon.view.loading = false;
        if (equals(this.local$this$SelectExtractFilePresenterCommon.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_RESULT_DEST_VIEWNAME), ContentEntryEdit2View$Companion_getInstance().VIEW_NAME)) {
          var tmp$ = this.local$this$SelectExtractFilePresenterCommon;
          var di = this.local$this$SelectExtractFilePresenterCommon.di;
          var strategy = ListSerializer(MetadataResult$Companion_getInstance().serializer());
          var entity = listOf_0(metadata);
          var tmp$_0;
          var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
          return tmp$.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity)) , Unit;
        } else {
          var args = LinkedHashMap_init();
          putEntityAsJson(args, ContentEntryEdit2View$Companion_getInstance().ARG_IMPORTED_METADATA, MetadataResult$Companion_getInstance().serializer(), metadata);
          putFromOtherMapIfPresent(args, this.local$this$SelectExtractFilePresenterCommon.arguments, UstadView$Companion_getInstance().ARG_LEAF);
          putFromOtherMapIfPresent(args, this.local$this$SelectExtractFilePresenterCommon.arguments, UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID);
          putFromOtherMapIfPresent(args, this.local$this$SelectExtractFilePresenterCommon.arguments, ContentEntryEdit2View$Companion_getInstance().BLOCK_REQUIRED);
          putFromOtherMapIfPresent(args, this.local$this$SelectExtractFilePresenterCommon.arguments, UstadView$Companion_getInstance().ARG_CLAZZUID);
          return this.local$this$SelectExtractFilePresenterCommon.navigateForResult_r13zgt$(new NavigateForResultOptions(this.local$this$SelectExtractFilePresenterCommon, null, ContentEntryEdit2View$Companion_getInstance().VIEW_NAME, getKClass(ContentEntry), ContentEntry.Companion.serializer(), void 0, void 0, args)) , Unit;
        }
      case 2:
        this.exceptionState_0 = 7;
        this.state_0 = 6;
        continue;
      case 3:
        this.exceptionState_0 = 7;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          this.local$this$SelectExtractFilePresenterCommon.view.loading = false;
          this.local$this$SelectExtractFilePresenterCommon.view.unSupportedFileError = this.local$this$SelectExtractFilePresenterCommon.systemImpl.getString(2276, this.local$this$SelectExtractFilePresenterCommon.context);
          napier.Napier.e_82mfvz$('Error extracting metadata', e);
          this.state_0 = 4;
          this.result_0 = logErrorReport(this.local$this$SelectExtractFilePresenterCommon.repo.errorReportDao, 2, e, this.local$this$SelectExtractFilePresenterCommon, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          throw e;
        }
      case 4:
        return this.result_0;
      case 5:
        this.state_0 = 6;
        continue;
      case 6:
        return;
      case 7:
        throw this.exception_0;
      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);
};
  function SelectExtractFilePresenterCommon$handleUriSelected$lambda(this$SelectExtractFilePresenterCommon_0, closure$uri_0, closure$filename_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$SelectExtractFilePresenterCommon$handleUriSelected$lambda(this$SelectExtractFilePresenterCommon_0, closure$uri_0, closure$filename_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  SelectExtractFilePresenterCommon.prototype.handleUriSelected_rkkr90$ = function(uri, filename) {
  var tmp$, tmp$_0;
  if (uri == null || filename == null) {
    if ((tmp$_0 = (tmp$ = this.requireNavController().currentBackStackEntry) != null ? tmp$.viewName : null) != null) {
      this.requireNavController().popBackStack_ivxn3r$(tmp$_0, true);
    }
    return;
  }
  launch(this.presenterScope, void 0, void 0, SelectExtractFilePresenterCommon$handleUriSelected$lambda(this, uri, filename));
};
  SelectExtractFilePresenterCommon.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SelectExtractFilePresenterCommon', 
  interfaces: [UstadBaseController]};
  function SelectFilePresenterCommon(context, arguments_0, view, di) {
    UstadBaseController.call(this, context, arguments_0, view, di);
  }
  SelectFilePresenterCommon.prototype.onCreate = function(savedState) {
  UstadBaseController.prototype.onCreate.call(this, savedState);
  this.view.acceptedMimeTypes = split(toString(this.arguments.get_11rb$(SelectFileView$Companion_getInstance().ARG_MIMETYPE_SELECTED)), [';']);
};
  SelectFilePresenterCommon.prototype.handleUriSelected_pdl1vj$ = function(uri) {
  var tmp$, tmp$_0;
  if (uri == null) {
    if ((tmp$_0 = (tmp$ = this.requireNavController().currentBackStackEntry) != null ? tmp$.viewName : null) != null) {
      this.requireNavController().popBackStack_ivxn3r$(tmp$_0, true);
    }
  } else if (equals(this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_RESULT_DEST_VIEWNAME), ClazzAssignmentDetailView$Companion_getInstance().VIEW_NAME)) {
    var di = this.di;
    var strategy = ListSerializer(serializer(kotlin_js_internal_StringCompanionObject));
    var entity = listOf_0(uri);
    var tmp$_1;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_1 : throwCCE(), null);
    this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
  }
};
  SelectFilePresenterCommon.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SelectFilePresenterCommon', 
  interfaces: [UstadBaseController]};
  function SelectFolderPresenter(context, arguments_0, view, di) {
    UstadBaseController.call(this, context, arguments_0, view, di);
  }
  SelectFolderPresenter.prototype.handleUriSelected_pdl1vj$ = function(uri) {
  var tmp$, tmp$_0;
  if (uri == null) {
    if ((tmp$_0 = (tmp$ = this.requireNavController().currentBackStackEntry) != null ? tmp$.viewName : null) != null) {
      this.requireNavController().popBackStack_ivxn3r$(tmp$_0, true);
    }
  } else if (equals(this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_RESULT_DEST_VIEWNAME), ContentEntryEdit2View$Companion_getInstance().VIEW_NAME)) {
    var di = this.di;
    var strategy = ListSerializer(serializer(kotlin_js_internal_StringCompanionObject));
    var entity = listOf_0(uri);
    var tmp$_1;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_1 : throwCCE(), null);
    this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
  } else {
    var args = LinkedHashMap_init();
    var key = ContentEntryEdit2View$Companion_getInstance().ARG_URI;
    args.put_xwzc9p$(key, uri);
    putFromOtherMapIfPresent(args, this.arguments, UstadView$Companion_getInstance().ARG_LEAF);
    putFromOtherMapIfPresent(args, this.arguments, UstadView$Companion_getInstance().ARG_PARENT_ENTRY_UID);
    this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, ContentEntryEdit2View$Companion_getInstance().VIEW_NAME, getKClass(ContentEntry), ContentEntry.Companion.serializer(), void 0, void 0, args));
  }
};
  SelectFolderPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SelectFolderPresenter', 
  interfaces: [UstadBaseController]};
  function SessionListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.contentEntryUid_0 = L0;
    this.selectedPersonUid_0 = L0;
  }
  SessionListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  return false;
};
  function Coroutine$SessionListPresenter$onLoadFromDb$lambda(this$SessionListPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$SessionListPresenter = this$SessionListPresenter_0;
    this.local$person = void 0;
  }
  Coroutine$SessionListPresenter$onLoadFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SessionListPresenter$onLoadFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SessionListPresenter$onLoadFromDb$lambda.prototype.constructor = Coroutine$SessionListPresenter$onLoadFromDb$lambda;
  Coroutine$SessionListPresenter$onLoadFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$SessionListPresenter.db.personDao.findByUidAsync_s8cxhz$(this.local$this$SessionListPresenter.selectedPersonUid_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$person = this.result_0;
        this.state_0 = 3;
        this.result_0 = this.local$this$SessionListPresenter.db.contentEntryDao.findByUidAsync_s8cxhz$(this.local$this$SessionListPresenter.contentEntryUid_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var entry = this.result_0;
        return this.local$this$SessionListPresenter.view.personWithContentTitle = toString(this.local$person != null ? this.local$person.fullName() : null) + ' - ' + toString(entry != null ? entry.title : null) , Unit;
      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 SessionListPresenter$onLoadFromDb$lambda(this$SessionListPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$SessionListPresenter$onLoadFromDb$lambda(this$SessionListPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadFromDb_2($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
  }
  Coroutine$onLoadFromDb_2.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadFromDb_2.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadFromDb_2.prototype.constructor = Coroutine$onLoadFromDb_2;
  Coroutine$onLoadFromDb_2.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2;
        this.state_0 = 2;
        this.result_0 = UstadListPresenter.prototype.onLoadFromDb.call(this.$this, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.$this.contentEntryUid_0 = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CONTENT_ENTRY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.$this.selectedPersonUid_0 = (tmp$_2 = (tmp$_1 = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_PERSON_UID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0;
        this.$this.mLoggedInPersonUid = this.$this.accountManager.activeAccount.personUid;
        launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, SessionListPresenter$onLoadFromDb$lambda(this.$this));
        this.$this.updateListOnView_0();
        return;
      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);
};
  SessionListPresenter.prototype.onLoadFromDb = function(continuation_0, suspended) {
  var instance = new Coroutine$onLoadFromDb_2(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  SessionListPresenter.prototype.updateListOnView_0 = function() {
  this.view.list = this.repo.statementDao.findSessionsForPerson_b9bd0d$(this.contentEntryUid_0, this.mLoggedInPersonUid, this.selectedPersonUid_0);
};
  SessionListPresenter.prototype.handleClickCreateNewFab = function() {
};
  SessionListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
};
  SessionListPresenter.prototype.onClickPersonWithSessionDisplay_lvxw6c$ = function(personWithStatementDisplay) {
  this.systemImpl.go_gofqk3$(StatementListView$Companion_getInstance().VIEW_NAME, mapOf([to(UstadView$Companion_getInstance().ARG_CONTENT_ENTRY_UID, this.contentEntryUid_0.toString()), to(UstadView$Companion_getInstance().ARG_PERSON_UID, this.selectedPersonUid_0.toString()), to(SessionListView$Companion_getInstance().ARG_CONTEXT_REGISTRATION, personWithStatementDisplay.contextRegistration)]), this.context);
};
  SessionListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SessionListPresenter', 
  interfaces: [UstadListPresenter]};
  function SettingsPresenter(context, arguments_0, view, di) {
    UstadBaseController.call(this, context, arguments_0, view, di);
    var tmp$;
    this.impl_4pm4a6$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, SettingsPresenter$impl_metadata);
    var tmp$_0;
    this.accountManager_5worda$_0 = Instance(this, Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, SettingsPresenter$accountManager_metadata);
    var context_0 = this.accountManager.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_1;
    var tmp$_2;
    this.repo_4uf5ss$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_1 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_2 : throwCCE(), 2).provideDelegate_tpuvb9$(this, SettingsPresenter$repo_metadata);
  }
  var SettingsPresenter$impl_metadata = new PropertyMetadata('impl');
  Object.defineProperty(SettingsPresenter.prototype, 'impl_0', {
  configurable: true, 
  get: function() {
  return this.impl_4pm4a6$_0.value;
}});
  var SettingsPresenter$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(SettingsPresenter.prototype, 'accountManager', {
  configurable: true, 
  get: function() {
  return this.accountManager_5worda$_0.value;
}});
  var SettingsPresenter$repo_metadata = new PropertyMetadata('repo');
  Object.defineProperty(SettingsPresenter.prototype, 'repo', {
  configurable: true, 
  get: function() {
  return this.repo_4uf5ss$_0.value;
}});
  function Coroutine$SettingsPresenter$onCreate$lambda(this$SettingsPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$SettingsPresenter = this$SettingsPresenter_0;
  }
  Coroutine$SettingsPresenter$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SettingsPresenter$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SettingsPresenter$onCreate$lambda.prototype.constructor = Coroutine$SettingsPresenter$onCreate$lambda;
  Coroutine$SettingsPresenter$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$SettingsPresenter.repo.personDao.personIsAdmin_s8cxhz$(this.local$this$SettingsPresenter.accountManager.activeAccount.personUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var isAdmin = this.result_0;
        this.local$this$SettingsPresenter.view.workspaceSettingsVisible = isAdmin;
        this.local$this$SettingsPresenter.view.holidayCalendarVisible = true;
        this.local$this$SettingsPresenter.view.reasonLeavingVisible = true;
        return this.local$this$SettingsPresenter.view.langListVisible = true , Unit;
      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 SettingsPresenter$onCreate$lambda(this$SettingsPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$SettingsPresenter$onCreate$lambda(this$SettingsPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  SettingsPresenter.prototype.onCreate = function(savedState) {
  UstadBaseController.prototype.onCreate.call(this, savedState);
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, SettingsPresenter$onCreate$lambda(this));
};
  SettingsPresenter.prototype.goToHolidayCalendarList = function() {
  this.impl_0.go_gofqk3$(HolidayCalendarListView$Companion_getInstance().VIEW_NAME, emptyMap(), this.context);
};
  SettingsPresenter.prototype.goToPeopleList = function() {
  this.impl_0.go_gofqk3$(PersonListView$Companion_getInstance().VIEW_NAME, emptyMap(), this.context);
};
  SettingsPresenter.prototype.handleClickWorkspace = function() {
  this.impl_0.go_gofqk3$(SiteDetailView$Companion_getInstance().VIEW_NAME, emptyMap(), this.context);
};
  SettingsPresenter.prototype.handleClickLeavingReason = function() {
  this.impl_0.go_gofqk3$(LeavingReasonListView$Companion_getInstance().VIEW_NAME, emptyMap(), this.context);
};
  SettingsPresenter.prototype.handleClickLangList = function() {
  this.impl_0.go_gofqk3$(LanguageListView$Companion_getInstance().VIEW_NAME, emptyMap(), this.context);
};
  SettingsPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SettingsPresenter', 
  interfaces: [UstadBaseController]};
  function SiteDetailPresenter(context, arguments_0, view, lifecycleOwner, di) {
    SiteDetailPresenter$Companion_getInstance();
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(SiteDetailPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  SiteDetailPresenter.prototype.onCreate = function(savedState) {
  UstadDetailPresenter.prototype.onCreate.call(this, savedState);
};
  SiteDetailPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  return true;
};
  function Coroutine$SiteDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$db = closure$db_0;
  }
  Coroutine$SiteDetailPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SiteDetailPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SiteDetailPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$SiteDetailPresenter$onLoadEntityFromDb$lambda;
  Coroutine$SiteDetailPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$closure$db.siteDao.getSiteAsync(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 SiteDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$SiteDetailPresenter$onLoadEntityFromDb$lambda(closure$db_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_26($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_26.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_26.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_26.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_26;
  Coroutine$onLoadEntityFromDb_7hogkd$_26.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.state_0 = 2;
        this.result_0 = withTimeoutOrNull(L5000, SiteDetailPresenter$onLoadEntityFromDb$lambda(this.local$db), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var workspace = (tmp$ = this.result_0) != null ? tmp$ : new Site();
        if (!Kotlin.isType(this.local$db, DoorDatabaseRepository)) {
          this.$this.view.siteTermsList = this.$this.repo.siteTermsDao.findAllTermsAsFactory();
        }
        return workspace;
      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);
};
  SiteDetailPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_26(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  SiteDetailPresenter.prototype.handleClickEdit = function() {
  var tmp$, tmp$_0;
  tmp$_0 = (tmp$ = this.entity) != null ? tmp$.siteUid : null;
  if (tmp$_0 == null) {
    return;
  }
  var siteUid = tmp$_0;
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, this.entity, SiteEditView$Companion_getInstance().VIEW_NAME, getKClass(Site), Site.Companion.serializer(), void 0, void 0, mutableMapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, siteUid.toString())])));
};
  SiteDetailPresenter.prototype.handleClickTerms_x1vg61$ = function(terms) {
  var tmp$;
  this.systemImpl.go_gofqk3$(SiteTermsDetailView$Companion_getInstance().VIEW_NAME, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, (tmp$ = terms != null ? terms.sTermsUid : null) != null ? tmp$.toString() : null)), this.context);
};
  function SiteDetailPresenter$Companion() {
    SiteDetailPresenter$Companion_instance = this;
  }
  SiteDetailPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SiteDetailPresenter$Companion_instance = null;
  function SiteDetailPresenter$Companion_getInstance() {
    if (SiteDetailPresenter$Companion_instance === null) {
      new SiteDetailPresenter$Companion();
    }
    return SiteDetailPresenter$Companion_instance;
  }
  SiteDetailPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SiteDetailPresenter', 
  interfaces: [UstadDetailPresenter]};
  function SiteEditPresenter(context, arguments_0, view, lifecycleOwner, di) {
    SiteEditPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.siteTermsOneToManyJoinEditHelper_0 = new OneToManyJoinEditHelperMp(getPropertyCallableRef('sTermsUid', 1, function($receiver) {
  return $receiver.sTermsUid;
}, function($receiver, value) {
  $receiver.sTermsUid = value;
}), SiteEditPresenter$Companion_getInstance().ARG_SAVEDSTATE_TERMS, ListSerializer(SiteTerms.Companion.serializer()), ListSerializer(SiteTermsWithLanguage.Companion.serializer()), this, this.requireSavedStateHandle(), getKClass(SiteTermsWithLanguage), void 0, SiteEditPresenter$siteTermsOneToManyJoinEditHelper$lambda);
    this.siteTermsOneToManyJoinListener = this.siteTermsOneToManyJoinEditHelper_0.createNavigateForResultListener_g113xi$(SiteTermsEditView$Companion_getInstance().VIEW_NAME, SiteTermsWithLanguage.Companion.serializer());
  }
  Object.defineProperty(SiteEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  SiteEditPresenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
  this.view.siteTermsList = this.siteTermsOneToManyJoinEditHelper_0.liveList;
};
  function Coroutine$SiteEditPresenter$onLoadEntityFromDb$lambda(it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$it = it_0;
  }
  Coroutine$SiteEditPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SiteEditPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SiteEditPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$SiteEditPresenter$onLoadEntityFromDb$lambda;
  Coroutine$SiteEditPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.siteDao.getSiteAsync(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 SiteEditPresenter$onLoadEntityFromDb$lambda(it_0, continuation_0, suspended) {
    var instance = new Coroutine$SiteEditPresenter$onLoadEntityFromDb$lambda(it_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function Coroutine$SiteEditPresenter$onLoadEntityFromDb$lambda_0(it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$it = it_0;
  }
  Coroutine$SiteEditPresenter$onLoadEntityFromDb$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SiteEditPresenter$onLoadEntityFromDb$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SiteEditPresenter$onLoadEntityFromDb$lambda_0.prototype.constructor = Coroutine$SiteEditPresenter$onLoadEntityFromDb$lambda_0;
  Coroutine$SiteEditPresenter$onLoadEntityFromDb$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.siteTermsDao.findAllWithLanguageAsList(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 SiteEditPresenter$onLoadEntityFromDb$lambda_0(it_0, continuation_0, suspended) {
    var instance = new Coroutine$SiteEditPresenter$onLoadEntityFromDb$lambda_0(it_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_27($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$site = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_27.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_27.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_27.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_27;
  Coroutine$onLoadEntityFromDb_7hogkd$_27.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        var entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L5000, SiteEditPresenter$onLoadEntityFromDb$lambda, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$site = (tmp$_1 = this.result_0) != null ? tmp$_1 : new Site();
        this.state_0 = 3;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L5000, SiteEditPresenter$onLoadEntityFromDb$lambda_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var siteTerms = this.result_0;
        this.$this.siteTermsOneToManyJoinEditHelper_0.liveList.sendValue_11rb$(siteTerms);
        return this.local$site;
      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);
};
  SiteEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_27(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  SiteEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  var editEntity = null;
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = Site.Companion.serializer();
    var tmp$;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
    editEntity = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    editEntity = new Site();
  }
  return editEntity;
};
  SiteEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  function SiteEditPresenter$handleClickSave$lambda$lambda(it) {
    return Unit;
  }
  function Coroutine$SiteEditPresenter$handleClickSave$lambda(this$SiteEditPresenter_0, closure$entity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$SiteEditPresenter = this$SiteEditPresenter_0;
    this.local$closure$entity = closure$entity_0;
  }
  Coroutine$SiteEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SiteEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SiteEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$SiteEditPresenter$handleClickSave$lambda;
  Coroutine$SiteEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$SiteEditPresenter.repo.siteDao.updateAsync_5rubkd$(this.local$closure$entity, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        this.result_0 = this.local$this$SiteEditPresenter.siteTermsOneToManyJoinEditHelper_0.commitToDatabase_kc7sxt$(this.local$this$SiteEditPresenter.repo.siteTermsDao, SiteEditPresenter$handleClickSave$lambda$lambda, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var tmp$ = this.local$this$SiteEditPresenter;
        var di = this.local$this$SiteEditPresenter.di;
        var strategy = ListSerializer(Site.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_0;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
        return tmp$.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity)) , Unit;
      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 SiteEditPresenter$handleClickSave$lambda(this$SiteEditPresenter_0, closure$entity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$SiteEditPresenter$handleClickSave$lambda(this$SiteEditPresenter_0, closure$entity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  SiteEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, SiteEditPresenter$handleClickSave$lambda(this, entity));
};
  function SiteEditPresenter$Companion() {
    SiteEditPresenter$Companion_instance = this;
    this.ARG_SAVEDSTATE_TERMS = 'terms';
  }
  SiteEditPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SiteEditPresenter$Companion_instance = null;
  function SiteEditPresenter$Companion_getInstance() {
    if (SiteEditPresenter$Companion_instance === null) {
      new SiteEditPresenter$Companion();
    }
    return SiteEditPresenter$Companion_instance;
  }
  function SiteEditPresenter$siteTermsOneToManyJoinEditHelper$lambda($receiver, it) {
    $receiver.sTermsUid = it;
    return Unit;
  }
  SiteEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SiteEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function SiteEnterLinkPresenter(context, arguments_0, view, di) {
    SiteEnterLinkPresenter$Companion_getInstance();
    UstadBaseController.call(this, context, arguments_0, view, di, false);
    this.site_0 = null;
    this.checkTextLinkJob_0 = null;
    var tmp$;
    this.impl_ubr30s$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, SiteEnterLinkPresenter$impl_metadata);
    var tmp$_0;
    this.httpClient_r7ruxz$_0 = Instance(this, Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(HttpClient), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, SiteEnterLinkPresenter$httpClient_metadata);
    this.validatedLink_0 = null;
  }
  var SiteEnterLinkPresenter$impl_metadata = new PropertyMetadata('impl');
  Object.defineProperty(SiteEnterLinkPresenter.prototype, 'impl_0', {
  configurable: true, 
  get: function() {
  return this.impl_ubr30s$_0.value;
}});
  var SiteEnterLinkPresenter$httpClient_metadata = new PropertyMetadata('httpClient');
  Object.defineProperty(SiteEnterLinkPresenter.prototype, 'httpClient_0', {
  configurable: true, 
  get: function() {
  return this.httpClient_r7ruxz$_0.value;
}});
  SiteEnterLinkPresenter.prototype.handleClickNext = function() {
  var mSite = this.site_0;
  var validatedLinkVal = this.validatedLink_0;
  if (mSite != null && validatedLinkVal != null) {
    var $receiver = toMutableMap(this.arguments);
    var siteLink = this.view.siteLink;
    if (siteLink != null) {
      var key = UstadView$Companion_getInstance().ARG_SERVER_URL;
      $receiver.put_xwzc9p$(key, validatedLinkVal);
    }
    var key_0 = UstadView$Companion_getInstance().ARG_SITE;
    var value = Json.Default.encodeToString_tf03ej$(Site.Companion.serializer(), mSite);
    $receiver.put_xwzc9p$(key_0, value);
    var args = $receiver;
    this.impl_0.go_gofqk3$(Login2View$Companion_getInstance().VIEW_NAME, args, this.context);
  }
};
  function Coroutine$SiteEnterLinkPresenter$handleCheckLinkText$lambda(closure$href_0, this$SiteEnterLinkPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 4;
    this.local$closure$href = closure$href_0;
    this.local$this$SiteEnterLinkPresenter = this$SiteEnterLinkPresenter_0;
    this.local$endpointUrl = void 0;
  }
  Coroutine$SiteEnterLinkPresenter$handleCheckLinkText$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SiteEnterLinkPresenter$handleCheckLinkText$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SiteEnterLinkPresenter$handleCheckLinkText$lambda.prototype.constructor = Coroutine$SiteEnterLinkPresenter$handleCheckLinkText$lambda;
  Coroutine$SiteEnterLinkPresenter$handleCheckLinkText$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.exceptionState_0 = 2;
        this.local$endpointUrl = requirePostfix(requireHttpPrefix(this.local$closure$href), '/');
        this.state_0 = 1;
        this.result_0 = verifySite(this.local$this$SiteEnterLinkPresenter.httpClient_0, this.local$endpointUrl, void 0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        this.local$this$SiteEnterLinkPresenter.site_0 = this.result_0;
        this.local$this$SiteEnterLinkPresenter.view.validLink = this.local$this$SiteEnterLinkPresenter.site_0 != null;
        this.local$this$SiteEnterLinkPresenter.validatedLink_0 = this.local$endpointUrl;
        this.exceptionState_0 = 4;
        this.state_0 = 3;
        continue;
      case 2:
        this.exceptionState_0 = 4;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          this.local$this$SiteEnterLinkPresenter.view.validLink = false;
        } else 
          throw e;
        this.state_0 = 3;
        continue;
      case 3:
        this.local$this$SiteEnterLinkPresenter.view.progressVisible = false;
        this.local$this$SiteEnterLinkPresenter.checkTextLinkJob_0 = null;
        return;
      case 4:
        throw this.exception_0;
      default:
        this.state_0 = 4;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 4) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function SiteEnterLinkPresenter$handleCheckLinkText$lambda(closure$href_0, this$SiteEnterLinkPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$SiteEnterLinkPresenter$handleCheckLinkText$lambda(closure$href_0, this$SiteEnterLinkPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  SiteEnterLinkPresenter.prototype.handleCheckLinkText_61zpoe$ = function(href) {
  var tmp$;
  if (this.checkTextLinkJob_0 != null) {
        (tmp$ = this.checkTextLinkJob_0) != null ? (tmp$.cancel_x5z25k$() , Unit) : null;
    this.checkTextLinkJob_0 = null;
  }
  this.checkTextLinkJob_0 = async(this.presenterScope, void 0, void 0, SiteEnterLinkPresenter$handleCheckLinkText$lambda(href, this));
};
  SiteEnterLinkPresenter.prototype.handleClickUsePublicLibrary = function() {
  var $receiver = toMutableMap(this.arguments);
  var key = UstadView$Companion_getInstance().ARG_SERVER_URL;
  var value = 'https://library.ustadmobile.app/';
  $receiver.put_xwzc9p$(key, value);
  var tmp$ = UstadView$Companion_getInstance().ARG_SITE;
  var tmp$_0 = this.di;
  var tmp$_1 = Site.Companion.serializer();
  var $receiver_0 = new Site();
  $receiver_0.registrationAllowed = true;
  $receiver_0.guestLogin = true;
  var tmp$_2;
  var json = get_direct(tmp$_0).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_2 : throwCCE(), null);
  var value_0 = json.encodeToString_tf03ej$(tmp$_1, $receiver_0);
  $receiver.put_xwzc9p$(tmp$, value_0);
  var args = $receiver;
  putIfNotAlreadySet(args, UstadView$Companion_getInstance().ARG_POPUPTO_ON_FINISH, SiteEnterLinkView$Companion_getInstance().VIEW_NAME);
  this.impl_0.go_gofqk3$(Login2View$Companion_getInstance().VIEW_NAME, args, this.context);
};
  SiteEnterLinkPresenter.prototype.handleClickCreateNewSite = function() {
  this.impl_0.openLinkInBrowser_bm4g0d$('https://www.ustadmobile.com/', this.context);
};
  SiteEnterLinkPresenter.prototype.onDestroy = function() {
  this.checkTextLinkJob_0 = null;
  this.site_0 = null;
  UstadBaseController.prototype.onDestroy.call(this);
};
  function SiteEnterLinkPresenter$Companion() {
    SiteEnterLinkPresenter$Companion_instance = this;
    this.LINK_REQUEST_TIMEOUT = L10000;
  }
  SiteEnterLinkPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SiteEnterLinkPresenter$Companion_instance = null;
  function SiteEnterLinkPresenter$Companion_getInstance() {
    if (SiteEnterLinkPresenter$Companion_instance === null) {
      new SiteEnterLinkPresenter$Companion();
    }
    return SiteEnterLinkPresenter$Companion_instance;
  }
  SiteEnterLinkPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SiteEnterLinkPresenter', 
  interfaces: [UstadBaseController]};
  function SiteTermsDetailPresenter(context, arguments_0, view, lifecycleOwner, di) {
    SiteTermsDetailPresenter$Companion_getInstance();
    UstadDetailPresenter.call(this, context, arguments_0, view, di, lifecycleOwner, false);
  }
  Object.defineProperty(SiteTermsDetailPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  SiteTermsDetailPresenter.prototype.onCreate = function(savedState) {
  var tmp$;
  UstadDetailPresenter.prototype.onCreate.call(this, savedState);
  this.view.acceptButtonVisible = ((tmp$ = this.arguments.get_11rb$(SiteTermsDetailView$Companion_getInstance().ARG_SHOW_ACCEPT_BUTTON)) != null ? toBoolean(tmp$) : null) === true;
};
  SiteTermsDetailPresenter.prototype.onCheckEditPermission_tn71rk$ = function(account, continuation) {
  return false;
};
  function Coroutine$SiteTermsDetailPresenter$onLoadEntityFromDb$lambda(this$SiteTermsDetailPresenter_0, closure$db_0, closure$displayedLocale_0, closure$entityUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$this$SiteTermsDetailPresenter = this$SiteTermsDetailPresenter_0;
    this.local$closure$db = closure$db_0;
    this.local$closure$displayedLocale = closure$displayedLocale_0;
    this.local$closure$entityUid = closure$entityUid_0;
  }
  Coroutine$SiteTermsDetailPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SiteTermsDetailPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SiteTermsDetailPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$SiteTermsDetailPresenter$onLoadEntityFromDb$lambda;
  Coroutine$SiteTermsDetailPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        if (((tmp$ = this.local$this$SiteTermsDetailPresenter.arguments.get_11rb$(SiteTermsDetailView$Companion_getInstance().ARG_USE_DISPLAY_LOCALE)) != null ? toBoolean(tmp$) : null) === true) {
          this.state_0 = 3;
          this.result_0 = this.local$closure$db.siteTermsDao.findSiteTerms_61zpoe$(this.local$closure$displayedLocale, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 2;
          this.result_0 = this.local$closure$db.siteTermsDao.findByUidAsync_s8cxhz$(this.local$closure$entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        return this.result_0;
      case 3:
        return this.result_0;
      case 4:
        return;
      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 SiteTermsDetailPresenter$onLoadEntityFromDb$lambda(this$SiteTermsDetailPresenter_0, closure$db_0, closure$displayedLocale_0, closure$entityUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$SiteTermsDetailPresenter$onLoadEntityFromDb$lambda(this$SiteTermsDetailPresenter_0, closure$db_0, closure$displayedLocale_0, closure$entityUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  SiteTermsDetailPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db, continuation) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  var serverUrl = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_SERVER_URL)) != null ? tmp$ : this.accountManager.activeAccount.endpointUrl;
  var endpoint = new Endpoint(serverUrl);
  if (Kotlin.isType(db, DoorDatabaseRepository)) {
    var $receiver = this.di;
    var trigger;
    trigger = $receiver.diTrigger;
    var tmp$_3;
    var tmp$_4;
    tmp$_0 = get_direct(On($receiver, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$_3 : throwCCE(), endpoint), trigger)).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_4 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_4 : throwCCE(), 2);
  } else {
    var $receiver_0 = this.di;
    var trigger_0;
    trigger_0 = $receiver_0.diTrigger;
    var tmp$_5;
    var tmp$_6;
    tmp$_0 = get_direct(On($receiver_0, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_5 = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$_5 : throwCCE(), endpoint), trigger_0)).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_6 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_6 : throwCCE(), 1);
  }
  var dbToUse = tmp$_0;
  var entityUid = (tmp$_2 = (tmp$_1 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0;
  var displayedLocale = this.systemImpl.getDisplayedLocale_za3rmp$(this.context);
  return onRepoWithFallbackToDb(dbToUse, L5000, SiteTermsDetailPresenter$onLoadEntityFromDb$lambda(this, db, displayedLocale, entityUid), continuation);
};
  SiteTermsDetailPresenter.prototype.handleClickAccept = function() {
  this.systemImpl.go_gofqk3$(PersonEditView$Companion_getInstance().VIEW_NAME_REGISTER, this.arguments, this.context);
};
  function SiteTermsDetailPresenter$Companion() {
    SiteTermsDetailPresenter$Companion_instance = this;
  }
  SiteTermsDetailPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SiteTermsDetailPresenter$Companion_instance = null;
  function SiteTermsDetailPresenter$Companion_getInstance() {
    if (SiteTermsDetailPresenter$Companion_instance === null) {
      new SiteTermsDetailPresenter$Companion();
    }
    return SiteTermsDetailPresenter$Companion_instance;
  }
  SiteTermsDetailPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SiteTermsDetailPresenter', 
  interfaces: [UstadDetailPresenter]};
  function SiteTermsEditPresenter(context, arguments_0, view, lifecycleOwner, di) {
    SiteTermsEditPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(SiteTermsEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$JSON_getInstance();
}});
  SiteTermsEditPresenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
};
  function SiteTermsEditPresenter$onLoadDataComplete$lambda(this$SiteTermsEditPresenter) {
    return function(it) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var selectedLang = tmp$;
    (tmp$_0 = this$SiteTermsEditPresenter.entity) != null ? (tmp$_0.stLanguage = selectedLang) : null;
    (tmp$_1 = this$SiteTermsEditPresenter.entity) != null ? (tmp$_1.sTermsLang = selectedLang.iso_639_1_standard) : null;
    (tmp$_2 = this$SiteTermsEditPresenter.entity) != null ? (tmp$_2.sTermsLangUid = selectedLang.langUid) : null;
  this$SiteTermsEditPresenter.view.entity = this$SiteTermsEditPresenter.entity;
  this$SiteTermsEditPresenter.requireSavedStateHandle().set_umlfku$(SiteTermsEditPresenter$Companion_getInstance().SAVEDSTATE_KEY_LANGUAGE, null);
  return Unit;
};
  }
  SiteTermsEditPresenter.prototype.onLoadDataComplete = function() {
  UstadEditPresenter.prototype.onLoadDataComplete.call(this);
  this.observeSavedStateResult_27fjeh$(SiteTermsEditPresenter$Companion_getInstance().SAVEDSTATE_KEY_LANGUAGE, ListSerializer(Language.Companion.serializer()), getKClass(Language), new DoorObserver(SiteTermsEditPresenter$onLoadDataComplete$lambda(this)));
};
  function Coroutine$SiteTermsEditPresenter$onLoadFromJson$lambda$lambda(closure$displayLocale_0, closure$editEntity_0, this$SiteTermsEditPresenter_0, db_0, lastResult_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$displayLocale = closure$displayLocale_0;
    this.local$closure$editEntity = closure$editEntity_0;
    this.local$this$SiteTermsEditPresenter = this$SiteTermsEditPresenter_0;
    this.local$db = db_0;
    this.local$lastResult = lastResult_0;
  }
  Coroutine$SiteTermsEditPresenter$onLoadFromJson$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SiteTermsEditPresenter$onLoadFromJson$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SiteTermsEditPresenter$onLoadFromJson$lambda$lambda.prototype.constructor = Coroutine$SiteTermsEditPresenter$onLoadFromJson$lambda$lambda;
  Coroutine$SiteTermsEditPresenter$onLoadFromJson$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        var $receiver = this.local$db.languageDao;
        if ((tmp$ = this.local$lastResult == null ? $receiver : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$.findByTwoCodeAsync_61zpoe$(this.local$closure$displayLocale, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        continue;
      case 3:
        var uiLanguage = this.result_0;
        if (uiLanguage != null) {
          this.local$closure$editEntity.v.stLanguage = uiLanguage;
          this.local$closure$editEntity.v.sTermsLang = this.local$closure$displayLocale;
          this.local$closure$editEntity.v.sTermsLangUid = uiLanguage.langUid;
          return this.local$this$SiteTermsEditPresenter.view.entity = this.local$closure$editEntity.v , Unit;
        } else {
          this.state_0 = 4;
          continue;
        }
      case 4:
        return Unit;
      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 SiteTermsEditPresenter$onLoadFromJson$lambda$lambda(closure$displayLocale_0, closure$editEntity_0, this$SiteTermsEditPresenter_0) {
    return function(db_0, lastResult_0, continuation_0, suspended) {
  var instance = new Coroutine$SiteTermsEditPresenter$onLoadFromJson$lambda$lambda(closure$displayLocale_0, closure$editEntity_0, this$SiteTermsEditPresenter_0, db_0, lastResult_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$SiteTermsEditPresenter$onLoadFromJson$lambda(this$SiteTermsEditPresenter_0, closure$editEntity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$SiteTermsEditPresenter = this$SiteTermsEditPresenter_0;
    this.local$closure$editEntity = closure$editEntity_0;
  }
  Coroutine$SiteTermsEditPresenter$onLoadFromJson$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SiteTermsEditPresenter$onLoadFromJson$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SiteTermsEditPresenter$onLoadFromJson$lambda.prototype.constructor = Coroutine$SiteTermsEditPresenter$onLoadFromJson$lambda;
  Coroutine$SiteTermsEditPresenter$onLoadFromJson$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var displayLocale = this.local$this$SiteTermsEditPresenter.systemImpl.getDisplayedLocale_za3rmp$(this.local$this$SiteTermsEditPresenter.context);
        this.state_0 = 2;
        this.result_0 = onDbThenRepoWithTimeout(this.local$this$SiteTermsEditPresenter.repo, L5000, SiteTermsEditPresenter$onLoadFromJson$lambda$lambda(displayLocale, this.local$closure$editEntity, this.local$this$SiteTermsEditPresenter), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 SiteTermsEditPresenter$onLoadFromJson$lambda(this$SiteTermsEditPresenter_0, closure$editEntity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$SiteTermsEditPresenter$onLoadFromJson$lambda(this$SiteTermsEditPresenter_0, closure$editEntity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  SiteTermsEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  var editEntity = {
  v: null};
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = SiteTermsWithLanguage.Companion.serializer();
    var tmp$;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
    editEntity.v = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    var $receiver = new SiteTermsWithLanguage();
    $receiver.termsHtml = this.systemImpl.getString(2695, this.context);
    editEntity.v = $receiver;
    launch(this.presenterScope, void 0, void 0, SiteTermsEditPresenter$onLoadFromJson$lambda(this, editEntity));
  }
  return editEntity.v;
};
  SiteTermsEditPresenter.prototype.handleClickLanguage = function() {
  this.navigateForResult_r13zgt$(new NavigateForResultOptions(this, null, LanguageListView$Companion_getInstance().VIEW_NAME, getKClass(Language), Language.Companion.serializer(), SiteTermsEditPresenter$Companion_getInstance().SAVEDSTATE_KEY_LANGUAGE));
};
  SiteTermsEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  function Coroutine$SiteTermsEditPresenter$handleClickSave$lambda(this$SiteTermsEditPresenter_0, closure$entity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$SiteTermsEditPresenter = this$SiteTermsEditPresenter_0;
    this.local$closure$entity = closure$entity_0;
  }
  Coroutine$SiteTermsEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$SiteTermsEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$SiteTermsEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$SiteTermsEditPresenter$handleClickSave$lambda;
  Coroutine$SiteTermsEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var di = this.local$this$SiteTermsEditPresenter.di;
        var strategy = ListSerializer(SiteTermsWithLanguage.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
        var serializedResult = json.encodeToString_tf03ej$(strategy, entity);
        return this.local$this$SiteTermsEditPresenter.finishWithResult_61zpoe$(serializedResult) , Unit;
      case 1:
        throw this.exception_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 SiteTermsEditPresenter$handleClickSave$lambda(this$SiteTermsEditPresenter_0, closure$entity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$SiteTermsEditPresenter$handleClickSave$lambda(this$SiteTermsEditPresenter_0, closure$entity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  SiteTermsEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  this.view.languageError = null;
  if (entity.stLanguage == null) {
    this.view.languageError = this.systemImpl.getString(2127, this.context);
    return;
  }
  launch(this.presenterScope, void 0, void 0, SiteTermsEditPresenter$handleClickSave$lambda(this, entity));
};
  function SiteTermsEditPresenter$Companion() {
    SiteTermsEditPresenter$Companion_instance = this;
    this.SAVEDSTATE_KEY_LANGUAGE = 'Language';
  }
  SiteTermsEditPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SiteTermsEditPresenter$Companion_instance = null;
  function SiteTermsEditPresenter$Companion_getInstance() {
    if (SiteTermsEditPresenter$Companion_instance === null) {
      new SiteTermsEditPresenter$Companion();
    }
    return SiteTermsEditPresenter$Companion_instance;
  }
  SiteTermsEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SiteTermsEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function StatementConstants() {
    StatementConstants_instance = this;
    this.STATEMENT_RESULT_OPTIONS = mapOf([to(2, 2091), to(1, 2089), to(0, 2051)]);
  }
  StatementConstants.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'StatementConstants', 
  interfaces: []};
  var StatementConstants_instance = null;
  function StatementConstants_getInstance() {
    if (StatementConstants_instance === null) {
      new StatementConstants();
    }
    return StatementConstants_instance;
  }
  function StatementListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.contentEntryUid_0 = L0;
    this.selectedPersonUid_0 = L0;
    this.selectedSession_0 = '';
  }
  StatementListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  return false;
};
  function Coroutine$StatementListPresenter$onLoadFromDb$lambda(this$StatementListPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$StatementListPresenter = this$StatementListPresenter_0;
    this.local$person = void 0;
  }
  Coroutine$StatementListPresenter$onLoadFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$StatementListPresenter$onLoadFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$StatementListPresenter$onLoadFromDb$lambda.prototype.constructor = Coroutine$StatementListPresenter$onLoadFromDb$lambda;
  Coroutine$StatementListPresenter$onLoadFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$StatementListPresenter.db.personDao.findByUidAsync_s8cxhz$(this.local$this$StatementListPresenter.selectedPersonUid_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$person = this.result_0;
        this.state_0 = 3;
        this.result_0 = this.local$this$StatementListPresenter.db.contentEntryDao.findByUidAsync_s8cxhz$(this.local$this$StatementListPresenter.contentEntryUid_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var entry = this.result_0;
        return this.local$this$StatementListPresenter.view.personWithContentTitle = toString(this.local$person != null ? this.local$person.fullName() : null) + ' - ' + toString(entry != null ? entry.title : null) , Unit;
      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 StatementListPresenter$onLoadFromDb$lambda(this$StatementListPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$StatementListPresenter$onLoadFromDb$lambda(this$StatementListPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadFromDb_3($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
  }
  Coroutine$onLoadFromDb_3.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadFromDb_3.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadFromDb_3.prototype.constructor = Coroutine$onLoadFromDb_3;
  Coroutine$onLoadFromDb_3.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
        this.state_0 = 2;
        this.result_0 = UstadListPresenter.prototype.onLoadFromDb.call(this.$this, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.$this.contentEntryUid_0 = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CONTENT_ENTRY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
        this.$this.selectedPersonUid_0 = (tmp$_2 = (tmp$_1 = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_PERSON_UID)) != null ? toLong(tmp$_1) : null) != null ? tmp$_2 : L0;
        this.$this.selectedSession_0 = (tmp$_3 = this.$this.arguments.get_11rb$(SessionListView$Companion_getInstance().ARG_CONTEXT_REGISTRATION)) != null ? tmp$_3 : '';
        this.$this.mLoggedInPersonUid = this.$this.accountManager.activeAccount.personUid;
        launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, StatementListPresenter$onLoadFromDb$lambda(this.$this));
        this.$this.updateListOnView_0();
        return;
      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);
};
  StatementListPresenter.prototype.onLoadFromDb = function(continuation_0, suspended) {
  var instance = new Coroutine$onLoadFromDb_3(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  StatementListPresenter.prototype.onClickSort_o8nuns$ = function(sortOption) {
  UstadListPresenter.prototype.onClickSort_o8nuns$.call(this, sortOption);
  this.updateListOnView_0();
};
  StatementListPresenter.prototype.updateListOnView_0 = function() {
  this.view.list = this.repo.statementDao.findSessionDetailForPerson_pkyi17$(this.contentEntryUid_0, this.mLoggedInPersonUid, this.selectedPersonUid_0, this.selectedSession_0);
};
  StatementListPresenter.prototype.handleClickCreateNewFab = function() {
};
  StatementListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
};
  StatementListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'StatementListPresenter', 
  interfaces: [UstadListPresenter]};
  function SubmissionConstants() {
    SubmissionConstants_instance = this;
    this.FILE_TYPE_MAP = mapOf([to(0, 2860), to(4, 2109), to(1, 2861), to(2, 2862), to(3, 2699)]);
    this.STATUS_MAP = mapOf([to(0, 2574), to(1, 2573), to(2, 2572)]);
  }
  SubmissionConstants.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'SubmissionConstants', 
  interfaces: []};
  var SubmissionConstants_instance = null;
  function SubmissionConstants_getInstance() {
    if (SubmissionConstants_instance === null) {
      new SubmissionConstants();
    }
    return SubmissionConstants_instance;
  }
  function SubmissionSummaryListener() {
  }
  SubmissionSummaryListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'SubmissionSummaryListener', 
  interfaces: []};
  function TerminologyKeys() {
    TerminologyKeys_instance = this;
    this.TEACHER_KEY = 'Teacher';
    this.STUDENT_KEY = 'Student';
    this.TEACHERS_KEY = 'Teachers';
    this.STUDENTS_KEY = 'Students';
    this.ADD_TEACHER_KEY = 'AddTeacher';
    this.ADD_STUDENT_KEY = 'AddStudent';
    this.TERMINOLOGY_ENTRY_MESSAGE_ID = mapOf([to(this.TEACHER_KEY, 2400), to(this.STUDENT_KEY, 2568), to(this.TEACHERS_KEY, 2403), to(this.STUDENTS_KEY, 2075), to(this.ADD_TEACHER_KEY, 2401), to(this.ADD_STUDENT_KEY, 2076)]);
  }
  TerminologyKeys.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'TerminologyKeys', 
  interfaces: []};
  var TerminologyKeys_instance = null;
  function TerminologyKeys_getInstance() {
    if (TerminologyKeys_instance === null) {
      new TerminologyKeys();
    }
    return TerminologyKeys_instance;
  }
  function TextAssignmentEditPresenter(context, arguments_0, view, lifecycleOwner, di) {
    TextAssignmentEditPresenter$Companion_getInstance();
    UstadEditPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
  }
  Object.defineProperty(TextAssignmentEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$JSON_getInstance();
}});
  TextAssignmentEditPresenter.prototype.onCreate = function(savedState) {
  UstadEditPresenter.prototype.onCreate.call(this, savedState);
};
  function Coroutine$TextAssignmentEditPresenter$onLoadFromJson$lambda(this$TextAssignmentEditPresenter_0, closure$editEntity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$TextAssignmentEditPresenter = this$TextAssignmentEditPresenter_0;
    this.local$closure$editEntity = closure$editEntity_0;
    this.local$tmp$ = void 0;
  }
  Coroutine$TextAssignmentEditPresenter$onLoadFromJson$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$TextAssignmentEditPresenter$onLoadFromJson$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$TextAssignmentEditPresenter$onLoadFromJson$lambda.prototype.constructor = Coroutine$TextAssignmentEditPresenter$onLoadFromJson$lambda;
  Coroutine$TextAssignmentEditPresenter$onLoadFromJson$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$tmp$ = this.local$this$TextAssignmentEditPresenter.view;
        this.state_0 = 2;
        this.result_0 = this.local$this$TextAssignmentEditPresenter.db.clazzAssignmentDao.findByUidAsync_s8cxhz$(this.local$closure$editEntity.casAssignmentUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        return this.local$tmp$.clazzAssignment = this.result_0 , Unit;
      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 TextAssignmentEditPresenter$onLoadFromJson$lambda(this$TextAssignmentEditPresenter_0, closure$editEntity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$TextAssignmentEditPresenter$onLoadFromJson$lambda(this$TextAssignmentEditPresenter_0, closure$editEntity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  TextAssignmentEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = CourseAssignmentSubmission.Companion.serializer();
    var tmp$_0;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    var $receiver = new CourseAssignmentSubmission();
    var tmp$_1, tmp$_2;
    $receiver.casAssignmentUid = (tmp$_2 = (tmp$_1 = bundle.get_11rb$(TextAssignmentEditView$Companion_getInstance().ASSIGNMENT_ID)) != null ? toLongOrNull(tmp$_1) : null) != null ? tmp$_2 : L0;
    $receiver.casSubmitterUid = this.accountManager.activeAccount.personUid;
    $receiver.casType = 1;
    $receiver.casUid = get_doorPrimaryKeyManager(this.db).nextId_za3lpa$(522);
    tmp$ = $receiver;
  }
  var editEntity = tmp$;
  launch(this.presenterScope, void 0, void 0, TextAssignmentEditPresenter$onLoadFromJson$lambda(this, editEntity));
  return editEntity;
};
  TextAssignmentEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
  var entityVal = this.entity;
  putEntityAsJson(savedState, UstadEditView$Companion_getInstance().ARG_ENTITY_JSON, null, entityVal);
};
  function Coroutine$TextAssignmentEditPresenter$handleClickSave$lambda(this$TextAssignmentEditPresenter_0, closure$entity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$TextAssignmentEditPresenter = this$TextAssignmentEditPresenter_0;
    this.local$closure$entity = closure$entity_0;
  }
  Coroutine$TextAssignmentEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$TextAssignmentEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$TextAssignmentEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$TextAssignmentEditPresenter$handleClickSave$lambda;
  Coroutine$TextAssignmentEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$ = this.local$this$TextAssignmentEditPresenter;
        var di = this.local$this$TextAssignmentEditPresenter.di;
        var strategy = ListSerializer(CourseAssignmentSubmission.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_0;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
        return tmp$.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity)) , Unit;
      case 1:
        throw this.exception_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 TextAssignmentEditPresenter$handleClickSave$lambda(this$TextAssignmentEditPresenter_0, closure$entity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$TextAssignmentEditPresenter$handleClickSave$lambda(this$TextAssignmentEditPresenter_0, closure$entity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  TextAssignmentEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  var tmp$, tmp$_0;
  tmp$ = this.view.clazzAssignment;
  if (tmp$ == null) {
    return;
  }
  var assignment = tmp$;
  var text = (tmp$_0 = entity.casText) != null ? tmp$_0 : '';
  var textLength = assignment.caTextLimitType === 2 ? text.length : countWords(text);
  if (textLength > assignment.caTextLimit) {
    this.view.showSnackBar_9pu0dj$(this.systemImpl.getString(2943, this.context));
    return;
  }
  launch(this.presenterScope, void 0, void 0, TextAssignmentEditPresenter$handleClickSave$lambda(this, entity));
};
  function TextAssignmentEditPresenter$Companion() {
    TextAssignmentEditPresenter$Companion_instance = this;
  }
  TextAssignmentEditPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var TextAssignmentEditPresenter$Companion_instance = null;
  function TextAssignmentEditPresenter$Companion_getInstance() {
    if (TextAssignmentEditPresenter$Companion_instance === null) {
      new TextAssignmentEditPresenter$Companion();
    }
    return TextAssignmentEditPresenter$Companion_instance;
  }
  TextAssignmentEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'TextAssignmentEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function TextCourseBlockEditPresenter(context, args, view, di, lifecycleOwner) {
    UstadEditPresenter.call(this, context, args, view, di, lifecycleOwner);
  }
  Object.defineProperty(TextCourseBlockEditPresenter.prototype, 'persistenceMode', {
  configurable: true, 
  get: function() {
  return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
}});
  function Coroutine$TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entityUid = closure$entityUid_0;
    this.local$it = it_0;
  }
  Coroutine$TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda.prototype.constructor = Coroutine$TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda;
  Coroutine$TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        if ((tmp$_0 = (tmp$ = !equals(this.local$closure$entityUid, L0) ? this.local$it : null) != null ? tmp$.courseBlockDao : null) != null) {
          this.state_0 = 2;
          this.result_0 = tmp$_0.findByUid(this.local$closure$entityUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        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 TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda(closure$entityUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0(closure$entity_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$it = it_0;
  }
  Coroutine$TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0.prototype.constructor = Coroutine$TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0;
  Coroutine$TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.clazzDao.getClazzWithSchool_s8cxhz$(this.local$closure$entity.cbClazzUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0(closure$entity_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0(closure$entity_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onLoadEntityFromDb_7hogkd$_28($this, db_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$clazzUid = void 0;
    this.local$tmp$ = void 0;
    this.local$$receiver = void 0;
    this.local$entity = void 0;
    this.local$db = db_0;
  }
  Coroutine$onLoadEntityFromDb_7hogkd$_28.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadEntityFromDb_7hogkd$_28.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadEntityFromDb_7hogkd$_28.prototype.constructor = Coroutine$onLoadEntityFromDb_7hogkd$_28;
  Coroutine$onLoadEntityFromDb_7hogkd$_28.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4;
        var entityUid = (tmp$_0 = (tmp$ = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLongOrNull(tmp$) : null) != null ? tmp$_0 : L0;
        this.local$clazzUid = (tmp$_2 = (tmp$_1 = this.$this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLongOrNull(tmp$_1) : null) != null ? tmp$_2 : L0;
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda(entityUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if ((tmp$_3 = this.result_0) != null) {
          this.local$tmp$ = tmp$_3;
          this.state_0 = 4;
          continue;
        } else {
          this.local$$receiver = new CourseBlock();
          this.state_0 = 3;
          this.result_0 = get_doorPrimaryKeyManager(this.local$db).nextIdAsync_za3lpa$(124, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 3:
        this.local$$receiver.cbUid = this.result_0;
        this.local$$receiver.cbClazzUid = this.local$clazzUid;
        this.local$$receiver.cbType = 102;
        this.local$$receiver.cbEntityUid = this.local$$receiver.cbUid;
        this.local$tmp$ = this.local$$receiver;
        this.state_0 = 4;
        continue;
      case 4:
        this.local$entity = this.local$tmp$;
        this.state_0 = 5;
        this.result_0 = onRepoWithFallbackToDb(this.local$db, L2000, TextCourseBlockEditPresenter$onLoadEntityFromDb$lambda_0(this.local$entity), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        var clazzWithSchool = (tmp$_4 = this.result_0) != null ? tmp$_4 : new ClazzWithSchool();
        var timeZone = effectiveTimeZone(clazzWithSchool);
        this.$this.view.timeZone = timeZone;
        if (!equals(this.local$entity.cbHideUntilDate, L0)) {
          var startDateTimeMidnight = toLocalMidnight(DateTime.Companion.invoke_s8cxhz$(this.local$entity.cbHideUntilDate), timeZone).unixMillisLong;
          this.$this.view.startDate = startDateTimeMidnight;
          this.$this.view.startTime = this.local$entity.cbHideUntilDate.subtract(startDateTimeMidnight);
        } else {
          this.$this.view.startDate = L0;
        }
        return this.local$entity;
      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);
};
  TextCourseBlockEditPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db_0, continuation_0, suspended) {
  var instance = new Coroutine$onLoadEntityFromDb_7hogkd$_28(this, db_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$TextCourseBlockEditPresenter$onLoadFromJson$lambda$lambda(closure$caClazzUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$caClazzUid = closure$caClazzUid_0;
    this.local$it = it_0;
  }
  Coroutine$TextCourseBlockEditPresenter$onLoadFromJson$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$TextCourseBlockEditPresenter$onLoadFromJson$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$TextCourseBlockEditPresenter$onLoadFromJson$lambda$lambda.prototype.constructor = Coroutine$TextCourseBlockEditPresenter$onLoadFromJson$lambda$lambda;
  Coroutine$TextCourseBlockEditPresenter$onLoadFromJson$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.clazzDao.getClazzWithSchool_s8cxhz$(this.local$closure$caClazzUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 TextCourseBlockEditPresenter$onLoadFromJson$lambda$lambda(closure$caClazzUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$TextCourseBlockEditPresenter$onLoadFromJson$lambda$lambda(closure$caClazzUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$TextCourseBlockEditPresenter$onLoadFromJson$lambda(this$TextCourseBlockEditPresenter_0, closure$entity_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$TextCourseBlockEditPresenter = this$TextCourseBlockEditPresenter_0;
    this.local$closure$entity = closure$entity_0;
  }
  Coroutine$TextCourseBlockEditPresenter$onLoadFromJson$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$TextCourseBlockEditPresenter$onLoadFromJson$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$TextCourseBlockEditPresenter$onLoadFromJson$lambda.prototype.constructor = Coroutine$TextCourseBlockEditPresenter$onLoadFromJson$lambda;
  Coroutine$TextCourseBlockEditPresenter$onLoadFromJson$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        var caClazzUid = (tmp$_0 = (tmp$ = this.local$this$TextCourseBlockEditPresenter.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : this.local$closure$entity.cbClazzUid;
        this.state_0 = 2;
        this.result_0 = onRepoWithFallbackToDb(this.local$this$TextCourseBlockEditPresenter.db, L2000, TextCourseBlockEditPresenter$onLoadFromJson$lambda$lambda(caClazzUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var clazzWithSchool = (tmp$_1 = this.result_0) != null ? tmp$_1 : new ClazzWithSchool();
        var timeZone = effectiveTimeZone(clazzWithSchool);
        this.local$this$TextCourseBlockEditPresenter.view.timeZone = timeZone;
        if (!equals(this.local$closure$entity.cbHideUntilDate, L0)) {
          var startDateTimeMidnight = toLocalMidnight(DateTime.Companion.invoke_s8cxhz$(this.local$closure$entity.cbHideUntilDate), timeZone).unixMillisLong;
          this.local$this$TextCourseBlockEditPresenter.view.startDate = startDateTimeMidnight;
          return this.local$this$TextCourseBlockEditPresenter.view.startTime = this.local$closure$entity.cbHideUntilDate.subtract(startDateTimeMidnight) , Unit;
        } else {
          return this.local$this$TextCourseBlockEditPresenter.view.startDate = L0 , Unit;
        }
      case 3:
        return;
      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 TextCourseBlockEditPresenter$onLoadFromJson$lambda(this$TextCourseBlockEditPresenter_0, closure$entity_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$TextCourseBlockEditPresenter$onLoadFromJson$lambda(this$TextCourseBlockEditPresenter_0, closure$entity_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  TextCourseBlockEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
  var entityJsonStr = bundle.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
  if (entityJsonStr != null) {
    var di = this.di;
    var strategy = CourseBlock.Companion.serializer();
    var tmp$_0;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
    tmp$ = json.decodeFromString_awif5v$(strategy, entityJsonStr);
  } else {
    tmp$ = new CourseBlock();
  }
  var entity = tmp$;
  launch(this.presenterScope, void 0, void 0, TextCourseBlockEditPresenter$onLoadFromJson$lambda(this, entity));
  return entity;
};
  function Coroutine$TextCourseBlockEditPresenter$handleClickSave$lambda(closure$entity_0, this$TextCourseBlockEditPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$entity = closure$entity_0;
    this.local$this$TextCourseBlockEditPresenter = this$TextCourseBlockEditPresenter_0;
  }
  Coroutine$TextCourseBlockEditPresenter$handleClickSave$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$TextCourseBlockEditPresenter$handleClickSave$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$TextCourseBlockEditPresenter$handleClickSave$lambda.prototype.constructor = Coroutine$TextCourseBlockEditPresenter$handleClickSave$lambda;
  Coroutine$TextCourseBlockEditPresenter$handleClickSave$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        var $receiver = this.local$closure$entity.cbTitle;
        if ($receiver == null || $receiver.length === 0) {
          this.local$this$TextCourseBlockEditPresenter.view.blockTitleError = this.local$this$TextCourseBlockEditPresenter.systemImpl.getString(2127, this.local$this$TextCourseBlockEditPresenter.context);
          this.local$this$TextCourseBlockEditPresenter.view.fieldsEnabled = true;
          return;
        }
        var timeZone = (tmp$ = this.local$this$TextCourseBlockEditPresenter.view.timeZone) != null ? tmp$ : 'UTC';
        var tmp$_0 = this.local$closure$entity;
        var $receiver_0 = toOffsetByTimezone(DateTime.Companion.invoke_s8cxhz$(this.local$this$TextCourseBlockEditPresenter.view.startDate), timeZone);
        var $receiver_1 = $receiver_0.hours;
        var tmp$_1 = TimeSpan.Companion.fromHours_14dthe$($receiver_1);
        var $receiver_2 = $receiver_0.minutes;
        var tmp$_2 = tmp$_1.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_2));
        var $receiver_3 = $receiver_0.seconds;
        var tmp$_3 = tmp$_2.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_3));
        var $receiver_4 = $receiver_0.milliseconds;
        tmp$_0.cbHideUntilDate = $receiver_0.minus_fv8bff$(tmp$_3.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_4))).utc.unixMillisLong.add(this.local$this$TextCourseBlockEditPresenter.view.startTime);
        var tmp$_4 = this.local$this$TextCourseBlockEditPresenter;
        var di = this.local$this$TextCourseBlockEditPresenter.di;
        var strategy = ListSerializer(CourseBlock.Companion.serializer());
        var entity = listOf_0(this.local$closure$entity);
        var tmp$_5;
        var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_5 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_5 : throwCCE(), null);
        tmp$_4.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
        return this.local$this$TextCourseBlockEditPresenter.view.loading = false , Unit;
      case 1:
        throw this.exception_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 TextCourseBlockEditPresenter$handleClickSave$lambda(closure$entity_0, this$TextCourseBlockEditPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$TextCourseBlockEditPresenter$handleClickSave$lambda(closure$entity_0, this$TextCourseBlockEditPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  TextCourseBlockEditPresenter.prototype.handleClickSave_nqi3in$ = function(entity) {
  this.view.fieldsEnabled = false;
  launch(this.presenterScope, void 0, void 0, TextCourseBlockEditPresenter$handleClickSave$lambda(entity, this));
};
  TextCourseBlockEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'TextCourseBlockEditPresenter', 
  interfaces: [UstadEditPresenter]};
  function TimeZoneListPresenter(context, args, view, di) {
    TimeZoneListPresenter$Companion_getInstance();
    UstadBaseController.call(this, context, args, view, di);
  }
  TimeZoneListPresenter.prototype.handleClickTimeZone_61zpoe$ = function(timeZoneId) {
  this.finishWithResult_61zpoe$(timeZoneId);
};
  function TimeZoneListPresenter$Companion() {
    TimeZoneListPresenter$Companion_instance = this;
    this.RESULT_TIMEZONE_KEY = 'timezone';
  }
  TimeZoneListPresenter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var TimeZoneListPresenter$Companion_instance = null;
  function TimeZoneListPresenter$Companion_getInstance() {
    if (TimeZoneListPresenter$Companion_instance === null) {
      new TimeZoneListPresenter$Companion();
    }
    return TimeZoneListPresenter$Companion_instance;
  }
  TimeZoneListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'TimeZoneListPresenter', 
  interfaces: [UstadBaseController]};
  function UstadBaseController(context, arguments_0, view, di, activeSessionRequired) {
    UstadBaseController$Companion_getInstance();
    if (activeSessionRequired === void 0) 
      activeSessionRequired = true;
    this.context_q1ad5i$_0 = context;
    this.arguments = arguments_0;
    this.view = view;
    this.di_e16k3a$_0 = di;
    this.activeSessionRequired_saonpy$_0 = activeSessionRequired;
    this.lifecycleListeners_8u2l5y$_0 = ArrayList_init();
    this.lifecycleStatus_83v1qv$_0 = 0;
    this.created_5i8cn7$_0 = false;
    this.savedState_muv61n$_0 = null;
    var tmp$;
    this.ustadNavController_71yvih$_0 = InstanceOrNull(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadNavController), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, UstadBaseController$ustadNavController_metadata);
    this.backStackEntry_xwcn9e$_0 = null;
    this.lastStateSaveTime_afpd5s$_0 = L0;
    var tmp$_0;
    this.presenterScope_ptz1el$_0 = Instance(this, Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(CoroutineScope), [], false)), TypeToken) ? tmp$_0 : throwCCE(), 14).provideDelegate_tpuvb9$(this, UstadBaseController$presenterScope_metadata);
    this.activeSessionObserver_hlvfb5$_0 = new DoorObserver(UstadBaseController$activeSessionObserver$lambda(this));
  }
  Object.defineProperty(UstadBaseController.prototype, 'context', {
  get: function() {
  return this.context_q1ad5i$_0;
}});
  Object.defineProperty(UstadBaseController.prototype, 'di', {
  get: function() {
  return this.di_e16k3a$_0;
}});
  Object.defineProperty(UstadBaseController.prototype, 'activeSessionRequired', {
  get: function() {
  return this.activeSessionRequired_saonpy$_0;
}});
  Object.defineProperty(UstadBaseController.prototype, 'savedState', {
  configurable: true, 
  get: function() {
  return this.savedState_muv61n$_0;
}, 
  set: function(savedState) {
  this.savedState_muv61n$_0 = savedState;
}});
  var UstadBaseController$ustadNavController_metadata = new PropertyMetadata('ustadNavController');
  Object.defineProperty(UstadBaseController.prototype, 'ustadNavController', {
  configurable: true, 
  get: function() {
  return this.ustadNavController_71yvih$_0.value;
}});
  Object.defineProperty(UstadBaseController.prototype, 'lastStateSaveTime', {
  configurable: true, 
  get: function() {
  return this.lastStateSaveTime_afpd5s$_0;
}, 
  set: function(lastStateSaveTime) {
  this.lastStateSaveTime_afpd5s$_0 = lastStateSaveTime;
}});
  Object.defineProperty(UstadBaseController.prototype, 'navChild', {
  configurable: true, 
  get: function() {
  var tmp$;
  return ((tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_NAV_CHILD)) != null ? toBoolean(tmp$) : null) === true;
}});
  var UstadBaseController$presenterScope_metadata = new PropertyMetadata('presenterScope');
  Object.defineProperty(UstadBaseController.prototype, 'presenterScope', {
  configurable: true, 
  get: function() {
  return this.presenterScope_ptz1el$_0.value;
}});
  UstadBaseController.prototype.requireNavController = function() {
  var tmp$;
  tmp$ = this.ustadNavController;
  if (tmp$ == null) {
    throw IllegalStateException_init('RequireNavController: ustadNavController is null');
  }
  return tmp$;
};
  UstadBaseController.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0;
  if (this.created_5i8cn7$_0) 
    throw IllegalStateException_init('onCreate must be called ONCE AND ONLY ONCE! It has already been called');
  this.created_5i8cn7$_0 = true;
  this.savedState = savedState;
  this.backStackEntry_xwcn9e$_0 = (tmp$ = this.ustadNavController) != null ? tmp$.currentBackStackEntry : null;
  tmp$_0 = this.lifecycleListeners_8u2l5y$_0.iterator();
  while (tmp$_0.hasNext()) {
    var listener = tmp$_0.next();
    listener.onLifecycleCreate_skkcg$(this);
  }
  this.lifecycleStatus_83v1qv$_0 = 1;
  if (this.activeSessionRequired && !this.navChild) {
    var tmp$_1;
    var accountManager = get_direct(this).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$_1 : throwCCE(), null);
    var tmp$_2;
    var lifecycleOwner = get_direct(this).directDI.InstanceOrNull_ohrpre$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(DoorLifecycleOwner), [], false)), TypeToken) ? tmp$_2 : throwCCE(), null);
    if (lifecycleOwner != null) {
      accountManager.activeUserSessionLive.observe_igxi3b$(lifecycleOwner, this.activeSessionObserver_hlvfb5$_0);
    }
  }
};
  UstadBaseController.prototype.onStart = function() {
  var tmp$;
  tmp$ = this.lifecycleListeners_8u2l5y$_0.iterator();
  while (tmp$.hasNext()) {
    var listener = tmp$.next();
    listener.onLifecycleStart_skkcg$(this);
  }
  this.lifecycleStatus_83v1qv$_0 = 2;
};
  UstadBaseController.prototype.onResume = function() {
  var tmp$;
  tmp$ = this.lifecycleListeners_8u2l5y$_0.iterator();
  while (tmp$.hasNext()) {
    var listener = tmp$.next();
    listener.onLifecycleResume_skkcg$(this);
  }
  this.lifecycleStatus_83v1qv$_0 = 3;
};
  UstadBaseController.prototype.onPause = function() {
  var tmp$;
  tmp$ = this.lifecycleListeners_8u2l5y$_0.iterator();
  while (tmp$.hasNext()) {
    var listener = tmp$.next();
    listener.onLifecyclePause_skkcg$(this);
  }
  this.lifecycleStatus_83v1qv$_0 = 4;
};
  UstadBaseController.prototype.onStop = function() {
  var tmp$;
  tmp$ = this.lifecycleListeners_8u2l5y$_0.iterator();
  while (tmp$.hasNext()) {
    var listener = tmp$.next();
    listener.onLifecycleStop_skkcg$(this);
  }
  this.lifecycleStatus_83v1qv$_0 = 5;
};
  UstadBaseController.prototype.onDestroy = function() {
  var tmp$;
  tmp$ = this.lifecycleListeners_8u2l5y$_0.iterator();
  while (tmp$.hasNext()) {
    var listener = tmp$.next();
    listener.onLifecycleDestroy_skkcg$(this);
  }
  this.lifecycleStatus_83v1qv$_0 = 6;
  this.backStackEntry_xwcn9e$_0 = null;
};
  UstadBaseController.prototype.addLifecycleListener_4jljd3$ = function(listener) {
  this.lifecycleListeners_8u2l5y$_0.add_11rb$(listener);
  switch (this.lifecycleStatus_83v1qv$_0) {
    case 1:
      listener.onLifecycleCreate_skkcg$(this);
      break;
    case 2:
      listener.onLifecycleStart_skkcg$(this);
      break;
    case 3:
      listener.onLifecycleResume_skkcg$(this);
      break;
    case 4:
      listener.onLifecyclePause_skkcg$(this);
      break;
    case 5:
      listener.onLifecycleStop_skkcg$(this);
      break;
    case 6:
      listener.onLifecycleDestroy_skkcg$(this);
      break;
  }
};
  UstadBaseController.prototype.removeLifecycleListener_4jljd3$ = function(listener) {
  this.lifecycleListeners_8u2l5y$_0.remove_11rb$(listener);
};
  UstadBaseController.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
};
  UstadBaseController.prototype.saveStateToNavController = function() {
  var tmp$;
  var stateMap = LinkedHashMap_init();
  this.onSaveInstanceState_gtra9a$(stateMap);
  var stateHandle = (tmp$ = this.backStackEntry_xwcn9e$_0) != null ? tmp$.savedStateHandle : null;
  if (stateHandle != null) {
    var tmp$_0;
    tmp$_0 = stateMap.entries.iterator();
    while (tmp$_0.hasNext()) {
      var element = tmp$_0.next();
      stateHandle.set_umlfku$(element.key, element.value);
    }
  }
  this.lastStateSaveTime = systemTimeInMillis();
};
  UstadBaseController.prototype.finishWithResult_61zpoe$ = function(result) {
  var tmp$;
  var saveToViewName = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_RESULT_DEST_VIEWNAME);
  var saveToKey = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_RESULT_DEST_KEY);
  if (saveToViewName != null && saveToKey != null) {
    var destBackStackEntry = this.requireNavController().getBackStackEntry_61zpoe$(saveToViewName);
        (tmp$ = destBackStackEntry != null ? destBackStackEntry.savedStateHandle : null) != null ? (tmp$.set_umlfku$(saveToKey, result) , Unit) : null;
    this.requireNavController().popBackStack_ivxn3r$(saveToViewName, false);
  } else {
    this.requireNavController().popBackStack_ivxn3r$(UstadView$Companion_getInstance().CURRENT_DEST, true);
  }
};
  UstadBaseController.prototype.requireSavedStateHandle = function() {
  var tmp$, tmp$_0;
  tmp$_0 = (tmp$ = this.requireNavController().currentBackStackEntry) != null ? tmp$.savedStateHandle : null;
  if (tmp$_0 == null) {
    throw IllegalStateException_init('Require saved state handle: no current back stack entry');
  }
  return tmp$_0;
};
  UstadBaseController.prototype.putPresenterResultDestInfo_sj9503$_0 = function($receiver) {
  var tmp$, tmp$_0;
  var currentBackStackEntryVal = this.backStackEntry_xwcn9e$_0;
  tmp$_0 = (tmp$ = $receiver.destinationResultKey) != null ? tmp$ : $receiver.entityClass.simpleName;
  if (tmp$_0 == null) {
    throw IllegalArgumentException_init('putPresenterResultDestInfo: no destination key and no class name');
  }
  var effectiveResultKey = tmp$_0;
  if (currentBackStackEntryVal != null) {
    putResultDestInfo($receiver.arguments, currentBackStackEntryVal, effectiveResultKey, $receiver.overwriteDestination);
  }
};
  UstadBaseController.prototype.navigateForResult_r13zgt$ = function(options) {
  this.saveStateToNavController();
  this.putPresenterResultDestInfo_sj9503$_0(options);
  var currentEntityValue = options.currentEntityValue;
  if (currentEntityValue != null) {
    var $receiver = options.arguments;
    var key = UstadEditView$Companion_getInstance().ARG_ENTITY_JSON;
    var value = safeStringify(this.di, options.serializationStrategy, options.entityClass, currentEntityValue);
    $receiver.put_xwzc9p$(key, value);
  }
  this.requireNavController().navigate_oc2wlg$(options.destinationViewName, options.arguments);
};
  UstadBaseController.prototype.navigateToErrorScreen_3lhtaa$ = function(exception) {
  navigateToErrorScreen(this.requireNavController(), exception, this.di, this.context);
};
  function Coroutine$navigateToStartNewUserSession($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$impl = void 0;
  }
  Coroutine$navigateToStartNewUserSession.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$navigateToStartNewUserSession.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$navigateToStartNewUserSession.prototype.constructor = Coroutine$navigateToStartNewUserSession;
  Coroutine$navigateToStartNewUserSession.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        var accountManager = get_direct(this.$this).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
        var tmp$_0;
        this.local$impl = get_direct(this.$this).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null);
        this.state_0 = 2;
        this.result_0 = accountManager.activeSessionCount_6ttg7a$(void 0, void 0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var numAccountsRemaining = this.result_0;
        var canSelectServer = UmPlatformUtil_getInstance().isWeb ? false : this.local$impl.getAppConfigBoolean_bm4g0d$(AppConfig_getInstance().KEY_ALLOW_SERVER_SELECTION, this.$this.context);
        var goOptions = new UstadMobileSystemCommon$UstadGoOptions(UstadView$Companion_getInstance().ROOT_DEST, false);
        if (numAccountsRemaining === 0 && canSelectServer) {
          this.local$impl.go_henhri$(SiteEnterLinkView$Companion_getInstance().VIEW_NAME, emptyMap(), this.$this.context, goOptions);
        } else if (numAccountsRemaining === 0 && !canSelectServer) {
          this.local$impl.go_henhri$(Login2View$Companion_getInstance().VIEW_NAME, emptyMap(), this.$this.context, goOptions);
        } else if (numAccountsRemaining > 0) 
          this.local$impl.go_henhri$(AccountListView$Companion_getInstance().VIEW_NAME, mapOf([to(AccountListView$Companion_getInstance().ARG_ACTIVE_ACCOUNT_MODE, AccountListView$Companion_getInstance().ACTIVE_ACCOUNT_MODE_INLIST), to(UstadView$Companion_getInstance().ARG_TITLE, this.local$impl.getString(2706, this.$this.context)), to(UstadView$Companion_getInstance().ARG_LISTMODE, ListViewMode$PICKER_getInstance().toString())]), this.$this.context, goOptions);
        return;
      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);
};
  UstadBaseController.prototype.navigateToStartNewUserSession = function(continuation_0, suspended) {
  var instance = new Coroutine$navigateToStartNewUserSession(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function UstadBaseController$Companion() {
    UstadBaseController$Companion_instance = this;
    this.NOT_CREATED = 0;
    this.CREATED = 1;
    this.STARTED = 2;
    this.RESUMED = 3;
    this.PAUSED = 4;
    this.STOPPED = 5;
    this.DESTROYED = 6;
  }
  UstadBaseController$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var UstadBaseController$Companion_instance = null;
  function UstadBaseController$Companion_getInstance() {
    if (UstadBaseController$Companion_instance === null) {
      new UstadBaseController$Companion();
    }
    return UstadBaseController$Companion_instance;
  }
  function Coroutine$UstadBaseController$activeSessionObserver$lambda$lambda(this$UstadBaseController_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$UstadBaseController = this$UstadBaseController_0;
  }
  Coroutine$UstadBaseController$activeSessionObserver$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$UstadBaseController$activeSessionObserver$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$UstadBaseController$activeSessionObserver$lambda$lambda.prototype.constructor = Coroutine$UstadBaseController$activeSessionObserver$lambda$lambda;
  Coroutine$UstadBaseController$activeSessionObserver$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$UstadBaseController.navigateToStartNewUserSession(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 UstadBaseController$activeSessionObserver$lambda$lambda(this$UstadBaseController_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$UstadBaseController$activeSessionObserver$lambda$lambda(this$UstadBaseController_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function UstadBaseController$activeSessionObserver$lambda(this$UstadBaseController) {
    return function(it) {
  if (it == null) {
    launch(this$UstadBaseController.presenterScope, void 0, void 0, UstadBaseController$activeSessionObserver$lambda$lambda(this$UstadBaseController));
  }
  return Unit;
};
  }
  UstadBaseController.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UstadBaseController', 
  interfaces: [DIAware, UmLifecycleOwner]};
  function UstadDetailPresenter(context, arguments_0, view, di, lifecycleOwner, activeSessionRequired) {
    if (activeSessionRequired === void 0) 
      activeSessionRequired = true;
    UstadSingleEntityPresenter.call(this, context, arguments_0, view, di, lifecycleOwner, activeSessionRequired);
  }
  UstadDetailPresenter.prototype.onCreate = function(savedState) {
  UstadSingleEntityPresenter.prototype.onCreate.call(this, savedState);
  this.updateFabDisplay();
};
  function Coroutine$UstadDetailPresenter$updateFabDisplay$lambda(this$UstadDetailPresenter_0, closure$detailView_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$UstadDetailPresenter = this$UstadDetailPresenter_0;
    this.local$closure$detailView = closure$detailView_0;
  }
  Coroutine$UstadDetailPresenter$updateFabDisplay$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$UstadDetailPresenter$updateFabDisplay$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$UstadDetailPresenter$updateFabDisplay$lambda.prototype.constructor = Coroutine$UstadDetailPresenter$updateFabDisplay$lambda;
  Coroutine$UstadDetailPresenter$updateFabDisplay$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$UstadDetailPresenter.onCheckEditPermission_tn71rk$(this.local$this$UstadDetailPresenter.accountManager.activeAccount, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var canEdit = this.result_0;
        return this.local$closure$detailView.editButtonMode = canEdit ? EditButtonMode$FAB_getInstance() : EditButtonMode$GONE_getInstance() , Unit;
      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 UstadDetailPresenter$updateFabDisplay$lambda(this$UstadDetailPresenter_0, closure$detailView_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$UstadDetailPresenter$updateFabDisplay$lambda(this$UstadDetailPresenter_0, closure$detailView_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  UstadDetailPresenter.prototype.updateFabDisplay = function() {
  var tmp$, tmp$_0;
  tmp$_0 = Kotlin.isType(tmp$ = this.view, UstadDetailView) ? tmp$ : null;
  if (tmp$_0 == null) {
    return;
  }
  var detailView = tmp$_0;
  launch(this.presenterScope, void 0, void 0, UstadDetailPresenter$updateFabDisplay$lambda(this, detailView));
};
  UstadDetailPresenter.prototype.handleClickEdit = function() {
};
  UstadDetailPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UstadDetailPresenter', 
  interfaces: [UstadSingleEntityPresenter]};
  function UstadEditPresenter(context, arguments_0, view, di, lifecycleOwner, activeSessionRequired) {
    if (activeSessionRequired === void 0) 
      activeSessionRequired = true;
    UstadSingleEntityPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.activeSessionRequired_wtt4b3$_0 = activeSessionRequired;
    this.jsonLoadListeners_4rpsj3$_0 = copyOnWriteListOf([]);
  }
  Object.defineProperty(UstadEditPresenter.prototype, 'activeSessionRequired', {
  get: function() {
  return this.activeSessionRequired_wtt4b3$_0;
}});
  function UstadEditPresenter$JsonLoadListener() {
  }
  UstadEditPresenter$JsonLoadListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'JsonLoadListener', 
  interfaces: []};
  UstadEditPresenter.prototype.addJsonLoadListener_ypapg8$ = function(loadListener) {
  return this.jsonLoadListeners_4rpsj3$_0.add_11rb$(loadListener);
};
  UstadEditPresenter.prototype.removeJsonLoadListener_ypapg8$ = function(loadListener) {
  return this.jsonLoadListeners_4rpsj3$_0.remove_11rb$(loadListener);
};
  UstadEditPresenter.prototype.requireBackStackEntry = function() {
  var tmp$;
  tmp$ = this.requireNavController().currentBackStackEntry;
  if (tmp$ == null) {
    throw IllegalStateException_init('requirebackstackentry: no currentbackstackentry!');
  }
  return tmp$;
};
  UstadEditPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  var tmp$;
  tmp$ = this.jsonLoadListeners_4rpsj3$_0.iterator();
  while (tmp$.hasNext()) {
    var element = tmp$.next();
    element.onLoadFromJsonSavedState_alv73c$(bundle);
  }
  return UstadSingleEntityPresenter.prototype.onLoadFromJson_y0zsll$.call(this, bundle);
};
  UstadEditPresenter.prototype.onSaveInstanceState_gtra9a$ = function(savedState) {
  var tmp$;
  tmp$ = this.jsonLoadListeners_4rpsj3$_0.iterator();
  while (tmp$.hasNext()) {
    var element = tmp$.next();
    element.onSaveState_gtra9a$(savedState);
  }
  UstadSingleEntityPresenter.prototype.onSaveInstanceState_gtra9a$.call(this, savedState);
};
  Object.defineProperty(UstadEditPresenter.prototype, 'isExistingEntityOrPickerMode', {
  configurable: true, 
  get: function() {
  var tmp$, tmp$_0;
  return !equals((tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_ENTITY_UID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0, L0) || this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_RESULT_DEST_ID) != null || this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_RESULT_DEST_VIEWNAME) != null;
}});
  UstadEditPresenter.prototype.onFinish_xcg1s8$ = function(detailViewName, entityUid, entity, serializer) {
  if (!this.isExistingEntityOrPickerMode) {
    this.systemImpl.go_henhri$(detailViewName, mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, entityUid.toString())), this.context, new UstadMobileSystemCommon$UstadGoOptions(UstadView$Companion_getInstance().CURRENT_DEST, true));
  } else {
    var di = this.di;
    var strategy = ListSerializer(serializer);
    var entity_0 = listOf_0(entity);
    var tmp$;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
    this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity_0));
  }
};
  UstadEditPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UstadEditPresenter', 
  interfaces: [UstadSingleEntityPresenter]};
  function UstadListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadBaseController.call(this, context, arguments_0, view, di);
    this.lifecycleOwner = lifecycleOwner;
    this.mListMode_c7twx2$_0 = lazy(UstadListPresenter$mListMode$lambda(arguments_0));
    this.mLoggedInPersonUid = L0;
    this.mSearchQuery = '%';
    var tmp$;
    this.accountManager_sxtfc0$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, UstadListPresenter$accountManager_metadata);
    var tmp$_0;
    this.systemImpl_4olhn5$_0 = Instance(this, Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, UstadListPresenter$systemImpl_metadata);
    var context_0 = this.accountManager.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_1;
    var tmp$_2;
    this.db_jblc0u$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_1 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_2 : throwCCE(), 1).provideDelegate_tpuvb9$(this, UstadListPresenter$db_metadata);
    var context_1 = this.accountManager.activeAccount;
    var trigger_0;
    trigger_0 = this.diTrigger;
    var tmp$_3;
    var tmp$_4;
    this.repo_t6beoi$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_3 : throwCCE(), context_1), trigger_0), Kotlin.isType(tmp$_4 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_4 : throwCCE(), 2).provideDelegate_tpuvb9$(this, UstadListPresenter$repo_metadata);
    this.selectedSortOption = null;
  }
  Object.defineProperty(UstadListPresenter.prototype, 'mListMode', {
  configurable: true, 
  get: function() {
  return this.mListMode_c7twx2$_0.value;
}});
  var UstadListPresenter$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(UstadListPresenter.prototype, 'accountManager', {
  configurable: true, 
  get: function() {
  return this.accountManager_sxtfc0$_0.value;
}});
  var UstadListPresenter$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(UstadListPresenter.prototype, 'systemImpl', {
  configurable: true, 
  get: function() {
  return this.systemImpl_4olhn5$_0.value;
}});
  var UstadListPresenter$db_metadata = new PropertyMetadata('db');
  Object.defineProperty(UstadListPresenter.prototype, 'db', {
  configurable: true, 
  get: function() {
  return this.db_jblc0u$_0.value;
}});
  var UstadListPresenter$repo_metadata = new PropertyMetadata('repo');
  Object.defineProperty(UstadListPresenter.prototype, 'repo', {
  configurable: true, 
  get: function() {
  return this.repo_t6beoi$_0.value;
}});
  Object.defineProperty(UstadListPresenter.prototype, 'sortOptions', {
  configurable: true, 
  get: function() {
  return emptyList();
}});
  function Coroutine$UstadListPresenter$onCreate$lambda(this$UstadListPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$UstadListPresenter = this$UstadListPresenter_0;
  }
  Coroutine$UstadListPresenter$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$UstadListPresenter$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$UstadListPresenter$onCreate$lambda.prototype.constructor = Coroutine$UstadListPresenter$onCreate$lambda;
  Coroutine$UstadListPresenter$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$UstadListPresenter.onLoadFromDb(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 UstadListPresenter$onCreate$lambda(this$UstadListPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$UstadListPresenter$onCreate$lambda(this$UstadListPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  UstadListPresenter.prototype.onCreate = function(savedState) {
  UstadBaseController.prototype.onCreate.call(this, savedState);
  launch(this.presenterScope, doorMainDispatcher(), void 0, UstadListPresenter$onCreate$lambda(this));
};
  function Coroutine$onLoadFromDb_4($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$tmp$_0 = void 0;
    this.local$listView = void 0;
  }
  Coroutine$onLoadFromDb_4.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onLoadFromDb_4.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onLoadFromDb_4.prototype.constructor = Coroutine$onLoadFromDb_4;
  Coroutine$onLoadFromDb_4.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        var tmp$_0;
        this.local$tmp$_0 = Kotlin.isType(tmp$ = this.$this.view, UstadListView) ? tmp$ : null;
        if (this.local$tmp$_0 == null) {
          return;
        } else {
          this.state_0 = 2;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.local$listView = this.local$tmp$_0;
        this.state_0 = 3;
        this.result_0 = this.$this.onCheckAddPermission_tn71rk$(this.$this.accountManager.activeAccount, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var hasAddPermission = this.result_0;
        if (hasAddPermission && this.$this.mListMode === ListViewMode$BROWSER_getInstance()) 
          tmp$_0 = ListViewAddMode$FAB_getInstance();
        else if (hasAddPermission && this.$this.mListMode === ListViewMode$PICKER_getInstance()) 
          tmp$_0 = ListViewAddMode$FIRST_ITEM_getInstance();
        else 
          tmp$_0 = ListViewAddMode$NONE_getInstance();
        this.local$listView.addMode = tmp$_0;
        this.state_0 = 4;
        this.result_0 = this.$this.onCheckListSelectionOptions_tn71rk$(this.$this.accountManager.activeAccount, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.local$listView.selectionOptions = this.result_0;
        return;
      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);
};
  UstadListPresenter.prototype.onLoadFromDb = function(continuation_0, suspended) {
  var instance = new Coroutine$onLoadFromDb_4(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  UstadListPresenter.prototype.handleClickEntry_11rc$ = function(entry) {
};
  UstadListPresenter.prototype.handleClickSelectionOption_psq284$ = function(selectedItem, option) {
};
  UstadListPresenter.prototype.onCheckListSelectionOptions_tn71rk$ = function(account, continuation) {
  return emptyList();
};
  UstadListPresenter.prototype.handleClickSortOrder_iowaj7$ = function(sortOption) {
};
  UstadListPresenter.prototype.onClickSort_o8nuns$ = function(sortOption) {
  this.selectedSortOption = sortOption;
};
  UstadListPresenter.prototype.onSearchSubmitted_pdl1vj$ = function(text) {
};
  UstadListPresenter.prototype.onListFilterOptionSelected_5mmfk3$ = function(filterOptionId) {
};
  UstadListPresenter.prototype.handleClickAddNewItem_a4m1mt$ = function(args, destinationResultKey, callback$default) {
  if (args === void 0) 
    args = null;
  if (destinationResultKey === void 0) 
    destinationResultKey = null;
    callback$default ? callback$default(args, destinationResultKey) : this.handleClickAddNewItem_a4m1mt$$default(args, destinationResultKey);
};
  UstadListPresenter.prototype.handleSelectionOptionChanged_4ezy6h$ = function(t) {
};
  function UstadListPresenter$mListMode$lambda(closure$arguments) {
    return function() {
  return determineListMode(closure$arguments);
};
  }
  UstadListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UstadListPresenter', 
  interfaces: [OnListFilterOptionSelectedListener, OnSearchSubmitted, OnSortOptionSelected, UstadBaseController, DIAware]};
  function UstadSingleEntityPresenter(context, arguments_0, view, di, lifecycleOwner, activeSessionRequired) {
    if (activeSessionRequired === void 0) 
      activeSessionRequired = true;
    UstadBaseController.call(this, context, arguments_0, view, di, activeSessionRequired);
    this.lifecycleOwner = lifecycleOwner;
    this.dataLoadCompleted_s6xaue$_0 = false;
    this.onCreateException_k2ploz$_0 = null;
    this.isStarted_z8t786$_0 = false;
    this.entity = null;
    this.entityLiveData = null;
    this.entityLiveDataObserver = null;
    var tmp$;
    this.systemImpl_xwab5w$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, UstadSingleEntityPresenter$systemImpl_metadata);
    var tmp$_0;
    this.accountManager_cy139v$_0 = Instance(this, Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, UstadSingleEntityPresenter$accountManager_metadata);
    var context_0 = this.accountManager.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_1;
    var tmp$_2;
    this.db_vk9xlh$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_1 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_2 : throwCCE(), 1).provideDelegate_tpuvb9$(this, UstadSingleEntityPresenter$db_metadata);
    var context_1 = this.accountManager.activeAccount;
    var trigger_0;
    trigger_0 = this.diTrigger;
    var tmp$_3;
    var tmp$_4;
    this.repo_29umqp$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_3 : throwCCE(), context_1), trigger_0), Kotlin.isType(tmp$_4 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_4 : throwCCE(), 2).provideDelegate_tpuvb9$(this, UstadSingleEntityPresenter$repo_metadata);
    this.onLoadCompletedListeners_rznugq$_0 = concurrentSafeListOf([]);
    this.logPrefix_bl0gl1$_0 = 'UstadSingleEntityPresenter(' + toString(Kotlin.getKClassFromExpression(this).simpleName) + '): ';
  }
  function UstadSingleEntityPresenter$OnLoadDataCompletedListener(f) {
    this.function$ = f;
  }
  UstadSingleEntityPresenter$OnLoadDataCompletedListener.prototype.onLoadDataCompleted_fsdvh1$ = function(editPresenter) {
  return this.function$(editPresenter);
};
  UstadSingleEntityPresenter$OnLoadDataCompletedListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'OnLoadDataCompletedListener', 
  interfaces: []};
  function UstadSingleEntityPresenter$PersistenceMode(name, ordinal) {
    Enum.call(this);
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function UstadSingleEntityPresenter$PersistenceMode_initFields() {
    UstadSingleEntityPresenter$PersistenceMode_initFields = function() {
};
    UstadSingleEntityPresenter$PersistenceMode$DB_instance = new UstadSingleEntityPresenter$PersistenceMode('DB', 0);
    UstadSingleEntityPresenter$PersistenceMode$JSON_instance = new UstadSingleEntityPresenter$PersistenceMode('JSON', 1);
    UstadSingleEntityPresenter$PersistenceMode$LIVEDATA_instance = new UstadSingleEntityPresenter$PersistenceMode('LIVEDATA', 2);
  }
  var UstadSingleEntityPresenter$PersistenceMode$DB_instance;
  function UstadSingleEntityPresenter$PersistenceMode$DB_getInstance() {
    UstadSingleEntityPresenter$PersistenceMode_initFields();
    return UstadSingleEntityPresenter$PersistenceMode$DB_instance;
  }
  var UstadSingleEntityPresenter$PersistenceMode$JSON_instance;
  function UstadSingleEntityPresenter$PersistenceMode$JSON_getInstance() {
    UstadSingleEntityPresenter$PersistenceMode_initFields();
    return UstadSingleEntityPresenter$PersistenceMode$JSON_instance;
  }
  var UstadSingleEntityPresenter$PersistenceMode$LIVEDATA_instance;
  function UstadSingleEntityPresenter$PersistenceMode$LIVEDATA_getInstance() {
    UstadSingleEntityPresenter$PersistenceMode_initFields();
    return UstadSingleEntityPresenter$PersistenceMode$LIVEDATA_instance;
  }
  UstadSingleEntityPresenter$PersistenceMode.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'PersistenceMode', 
  interfaces: [Enum]};
  function UstadSingleEntityPresenter$PersistenceMode$values() {
    return [UstadSingleEntityPresenter$PersistenceMode$DB_getInstance(), UstadSingleEntityPresenter$PersistenceMode$JSON_getInstance(), UstadSingleEntityPresenter$PersistenceMode$LIVEDATA_getInstance()];
  }
  UstadSingleEntityPresenter$PersistenceMode.values = UstadSingleEntityPresenter$PersistenceMode$values;
  function UstadSingleEntityPresenter$PersistenceMode$valueOf(name) {
    switch (name) {
      case 'DB':
        return UstadSingleEntityPresenter$PersistenceMode$DB_getInstance();
      case 'JSON':
        return UstadSingleEntityPresenter$PersistenceMode$JSON_getInstance();
      case 'LIVEDATA':
        return UstadSingleEntityPresenter$PersistenceMode$LIVEDATA_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.UstadSingleEntityPresenter.PersistenceMode.' + name);
    }
  }
  UstadSingleEntityPresenter$PersistenceMode.valueOf_61zpoe$ = UstadSingleEntityPresenter$PersistenceMode$valueOf;
  var UstadSingleEntityPresenter$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(UstadSingleEntityPresenter.prototype, 'systemImpl', {
  configurable: true, 
  get: function() {
  return this.systemImpl_xwab5w$_0.value;
}});
  var UstadSingleEntityPresenter$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(UstadSingleEntityPresenter.prototype, 'accountManager', {
  configurable: true, 
  get: function() {
  return this.accountManager_cy139v$_0.value;
}});
  var UstadSingleEntityPresenter$db_metadata = new PropertyMetadata('db');
  Object.defineProperty(UstadSingleEntityPresenter.prototype, 'db', {
  configurable: true, 
  get: function() {
  return this.db_vk9xlh$_0.value;
}});
  var UstadSingleEntityPresenter$repo_metadata = new PropertyMetadata('repo');
  Object.defineProperty(UstadSingleEntityPresenter.prototype, 'repo', {
  configurable: true, 
  get: function() {
  return this.repo_29umqp$_0.value;
}});
  function Coroutine$UstadSingleEntityPresenter$onCreate$lambda(this$UstadSingleEntityPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 9;
    this.local$this$UstadSingleEntityPresenter = this$UstadSingleEntityPresenter_0;
    this.local$tmp$ = void 0;
    this.local$this$UstadSingleEntityPresenter_0 = void 0;
  }
  Coroutine$UstadSingleEntityPresenter$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$UstadSingleEntityPresenter$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$UstadSingleEntityPresenter$onCreate$lambda.prototype.constructor = Coroutine$UstadSingleEntityPresenter$onCreate$lambda;
  Coroutine$UstadSingleEntityPresenter$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        this.exceptionState_0 = 4;
        this.local$tmp$ = listOf([this.local$this$UstadSingleEntityPresenter.db, this.local$this$UstadSingleEntityPresenter.repo]).iterator();
        this.state_0 = 1;
        continue;
      case 1:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 3;
          continue;
        }
        var element = this.local$tmp$.next();
        this.local$this$UstadSingleEntityPresenter_0 = this.local$this$UstadSingleEntityPresenter;
        this.state_0 = 2;
        this.result_0 = this.local$this$UstadSingleEntityPresenter_0.onLoadEntityFromDb_7hogkd$(element, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 2:
        this.local$this$UstadSingleEntityPresenter_0.entity = this.result_0;
        this.local$this$UstadSingleEntityPresenter_0.view.entity = this.local$this$UstadSingleEntityPresenter_0.entity;
        this.state_0 = 1;
        continue;
      case 3:
        this.local$this$UstadSingleEntityPresenter.view.loading = false;
                (tmp$_0 = Kotlin.isType(tmp$ = this.local$this$UstadSingleEntityPresenter.view, UstadEditView) ? tmp$ : null) != null ? (tmp$_0.fieldsEnabled = true) : null;
        return this.local$this$UstadSingleEntityPresenter.onLoadDataComplete() , Unit;
      case 4:
        this.exceptionState_0 = 9;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          if (!Kotlin.isType(e, CancellationException)) {
            napier.Napier.e_82mfvz$(this.local$this$UstadSingleEntityPresenter.logPrefix_bl0gl1$_0 + ' load exception', e);
            if (this.local$this$UstadSingleEntityPresenter.isStarted_z8t786$_0) {
              return this.local$this$UstadSingleEntityPresenter.navigateToErrorScreen_3lhtaa$(e) , Unit;
            } else {
              return this.local$this$UstadSingleEntityPresenter.onCreateException_k2ploz$_0 = e , Unit;
            }
          } else {
            this.state_0 = 6;
            continue;
          }
        } else {
          throw e;
        }
      case 5:
        this.state_0 = 6;
        continue;
      case 6:
        this.state_0 = 7;
        continue;
      case 7:
        this.state_0 = 8;
        continue;
      case 8:
        return Unit;
      case 9:
        throw this.exception_0;
      default:
        this.state_0 = 9;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 9) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function UstadSingleEntityPresenter$onCreate$lambda(this$UstadSingleEntityPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$UstadSingleEntityPresenter$onCreate$lambda(this$UstadSingleEntityPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function UstadSingleEntityPresenter$onCreate$ObjectLiteral(this$UstadSingleEntityPresenter) {
    this.this$UstadSingleEntityPresenter = this$UstadSingleEntityPresenter;
  }
  UstadSingleEntityPresenter$onCreate$ObjectLiteral.prototype.onChanged_11rb$ = function(t) {
  var tmp$;
  this.this$UstadSingleEntityPresenter.entity = t;
  this.this$UstadSingleEntityPresenter.view.entity = this.this$UstadSingleEntityPresenter.entity;
  var $receiver = this.this$UstadSingleEntityPresenter.view;
    (tmp$ = t != null ? $receiver : null) != null ? (tmp$.loading = false) : null;
};
  UstadSingleEntityPresenter$onCreate$ObjectLiteral.$metadata$ = {
  kind: Kind_CLASS, 
  interfaces: [DoorObserver]};
  UstadSingleEntityPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5;
  UstadBaseController.prototype.onCreate.call(this, savedState);
  if ((savedState != null ? savedState.containsKey_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON) : null) === true) {
    napier.Napier.d_82mfvz$(this.logPrefix_bl0gl1$_0 + ' found savedState contains ARG_ENTITY_JSON');
    tmp$ = savedState;
  } else if (this.arguments.containsKey_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON)) {
    napier.Napier.d_82mfvz$(this.logPrefix_bl0gl1$_0 + ' arguments contain ' + UstadEditView$Companion_getInstance().ARG_ENTITY_JSON);
    tmp$ = this.arguments;
  } else {
    tmp$ = null;
  }
  var mapWithEntityJson = tmp$;
  if (mapWithEntityJson != null && mapWithEntityJson.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON) != null) {
    napier.Napier.d_82mfvz$(this.logPrefix_bl0gl1$_0 + ' Json present in args or savedstate. ' + ('Load from JSON: ' + toString(mapWithEntityJson.get_11rb$(UstadEditView$Companion_getInstance().ARG_ENTITY_JSON))));
    this.entity = this.onLoadFromJson_y0zsll$(mapWithEntityJson);
    this.view.entity = this.entity;
        (tmp$_1 = Kotlin.isType(tmp$_0 = this.view, UstadEditView) ? tmp$_0 : null) != null ? (tmp$_1.fieldsEnabled = true) : null;
    this.onLoadDataComplete();
  } else if (this.persistenceMode === UstadSingleEntityPresenter$PersistenceMode$DB_getInstance()) {
    napier.Napier.d_82mfvz$(this.logPrefix_bl0gl1$_0 + ' Load from DB');
    this.view.loading = true;
        (tmp$_3 = Kotlin.isType(tmp$_2 = this.view, UstadEditView) ? tmp$_2 : null) != null ? (tmp$_3.fieldsEnabled = false) : null;
    launch(this.presenterScope, void 0, void 0, UstadSingleEntityPresenter$onCreate$lambda(this));
  } else if (this.persistenceMode === UstadSingleEntityPresenter$PersistenceMode$JSON_getInstance()) {
    napier.Napier.d_82mfvz$(this.logPrefix_bl0gl1$_0 + ' PersistenceMode = JSON, load');
    this.entity = this.onLoadFromJson_y0zsll$(this.arguments);
    this.view.entity = this.entity;
        (tmp$_5 = Kotlin.isType(tmp$_4 = this.view, UstadEditView) ? tmp$_4 : null) != null ? (tmp$_5.fieldsEnabled = true) : null;
    this.onLoadDataComplete();
  } else if (this.persistenceMode === UstadSingleEntityPresenter$PersistenceMode$LIVEDATA_getInstance()) {
    napier.Napier.d_82mfvz$(this.logPrefix_bl0gl1$_0 + ' PersistenceMode = LiveData, load');
    this.entityLiveData = this.onLoadLiveData_7hogkd$(this.repo);
    this.view.loading = true;
    if (this.entityLiveData != null) {
      var $receiver = new UstadSingleEntityPresenter$onCreate$ObjectLiteral(this);
      var tmp$_6;
            (tmp$_6 = this.entityLiveData) != null ? (tmp$_6.observe_igxi3b$(this.lifecycleOwner, $receiver) , Unit) : null;
      this.onLoadDataComplete();
      this.entityLiveDataObserver = $receiver;
    }
  }
};
  UstadSingleEntityPresenter.prototype.onStart = function() {
  var tmp$;
  UstadBaseController.prototype.onStart.call(this);
  this.isStarted_z8t786$_0 = true;
  if ((tmp$ = this.onCreateException_k2ploz$_0) != null) {
    this.navigateToErrorScreen_3lhtaa$(tmp$);
  }
  this.onCreateException_k2ploz$_0 = null;
};
  UstadSingleEntityPresenter.prototype.onLoadDataComplete = function() {
  this.dataLoadCompleted_s6xaue$_0 = true;
  var tmp$;
  tmp$ = this.onLoadCompletedListeners_rznugq$_0.iterator();
  while (tmp$.hasNext()) {
    var element = tmp$.next();
    element.onLoadDataCompleted_fsdvh1$(this);
  }
  this.onLoadCompletedListeners_rznugq$_0.clear();
};
  UstadSingleEntityPresenter.prototype.addOnLoadDataCompletedListener_3l0549$ = function(listener) {
  if (this.dataLoadCompleted_s6xaue$_0) 
    listener.onLoadDataCompleted_fsdvh1$(this);
  else {
    this.onLoadCompletedListeners_rznugq$_0.add_11rb$(listener);
  }
};
  UstadSingleEntityPresenter.prototype.removeOnLoadDataCompletedListener_3l0549$ = function(listener) {
  this.onLoadCompletedListeners_rznugq$_0.remove_11rb$(listener);
};
  UstadSingleEntityPresenter.prototype.onLoadEntityFromDb_7hogkd$ = function(db, continuation) {
  return null;
};
  UstadSingleEntityPresenter.prototype.onLoadLiveData_7hogkd$ = function(repo) {
  return null;
};
  UstadSingleEntityPresenter.prototype.onLoadFromJson_y0zsll$ = function(bundle) {
  return null;
};
  function UstadSingleEntityPresenter$getSavedStateResultLiveData$lambda$lambda$lambda(closure$wrapper, this$UstadSingleEntityPresenter, closure$deserializationStrategy, closure$resultClass) {
    return function(it) {
  if (it == null) {
    closure$wrapper.sendValue_11rb$(emptyList());
    return;
  }
  var deserialized = safeParseList(this$UstadSingleEntityPresenter.di, closure$deserializationStrategy, closure$resultClass, it);
  closure$wrapper.sendValue_11rb$(deserialized);
  return Unit;
};
  }
  function UstadSingleEntityPresenter$getSavedStateResultLiveData$lambda$lambda(closure$savedState, closure$keyName, closure$lifecycle, closure$wrapper, this$UstadSingleEntityPresenter, closure$deserializationStrategy, closure$resultClass) {
    return function(it) {
  closure$savedState.getLiveData_ytbaoo$(closure$keyName).observe_igxi3b$(closure$lifecycle, new DoorObserver(UstadSingleEntityPresenter$getSavedStateResultLiveData$lambda$lambda$lambda(closure$wrapper, this$UstadSingleEntityPresenter, closure$deserializationStrategy, closure$resultClass)));
  return Unit;
};
  }
  function Coroutine$UstadSingleEntityPresenter$getSavedStateResultLiveData$lambda(closure$savedState_0, closure$keyName_0, closure$lifecycle_0, closure$wrapper_0, this$UstadSingleEntityPresenter_0, closure$deserializationStrategy_0, closure$resultClass_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$savedState = closure$savedState_0;
    this.local$closure$keyName = closure$keyName_0;
    this.local$closure$lifecycle = closure$lifecycle_0;
    this.local$closure$wrapper = closure$wrapper_0;
    this.local$this$UstadSingleEntityPresenter = this$UstadSingleEntityPresenter_0;
    this.local$closure$deserializationStrategy = closure$deserializationStrategy_0;
    this.local$closure$resultClass = closure$resultClass_0;
  }
  Coroutine$UstadSingleEntityPresenter$getSavedStateResultLiveData$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$UstadSingleEntityPresenter$getSavedStateResultLiveData$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$UstadSingleEntityPresenter$getSavedStateResultLiveData$lambda.prototype.constructor = Coroutine$UstadSingleEntityPresenter$getSavedStateResultLiveData$lambda;
  Coroutine$UstadSingleEntityPresenter$getSavedStateResultLiveData$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        return this.local$this$UstadSingleEntityPresenter.addOnLoadDataCompletedListener_3l0549$(new UstadSingleEntityPresenter$OnLoadDataCompletedListener(UstadSingleEntityPresenter$getSavedStateResultLiveData$lambda$lambda(this.local$closure$savedState, this.local$closure$keyName, this.local$closure$lifecycle, this.local$closure$wrapper, this.local$this$UstadSingleEntityPresenter, this.local$closure$deserializationStrategy, this.local$closure$resultClass))) , Unit;
      case 1:
        throw this.exception_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 UstadSingleEntityPresenter$getSavedStateResultLiveData$lambda(closure$savedState_0, closure$keyName_0, closure$lifecycle_0, closure$wrapper_0, this$UstadSingleEntityPresenter_0, closure$deserializationStrategy_0, closure$resultClass_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$UstadSingleEntityPresenter$getSavedStateResultLiveData$lambda(closure$savedState_0, closure$keyName_0, closure$lifecycle_0, closure$wrapper_0, this$UstadSingleEntityPresenter_0, closure$deserializationStrategy_0, closure$resultClass_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  UstadSingleEntityPresenter.prototype.getSavedStateResultLiveData_dgkpuc$ = function(keyName, deserializationStrategy, resultClass) {
  var wrapper = DoorMutableLiveData_init();
  var savedState = this.requireSavedStateHandle();
  var lifecycle = this.lifecycleOwner;
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, UstadSingleEntityPresenter$getSavedStateResultLiveData$lambda(savedState, keyName, lifecycle, wrapper, this, deserializationStrategy, resultClass));
  return wrapper;
};
  UstadSingleEntityPresenter.prototype.observeSavedStateResult_27fjeh$ = function(keyName, deserializationStrategy, resultClass, observer) {
  this.getSavedStateResultLiveData_dgkpuc$(keyName, deserializationStrategy, resultClass).observe_igxi3b$(this.lifecycleOwner, observer);
};
  UstadSingleEntityPresenter.prototype.onDestroy = function() {
  var entityLiveDataObserverVal = this.entityLiveDataObserver;
  var entityLiveDataVal = this.entityLiveData;
  if (entityLiveDataObserverVal != null && entityLiveDataVal != null) {
    entityLiveDataVal.removeObserver_jsfaok$(entityLiveDataObserverVal);
  }
  this.entityLiveData = null;
  this.entityLiveDataObserver = null;
  UstadBaseController.prototype.onDestroy.call(this);
};
  UstadSingleEntityPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UstadSingleEntityPresenter', 
  interfaces: [UstadBaseController]};
  function VerbEntityListPresenter(context, arguments_0, view, di, lifecycleOwner) {
    UstadListPresenter.call(this, context, arguments_0, view, di, lifecycleOwner);
    this.currentSortOrder = VerbEntityListPresenter$SortOrder$ORDER_NAME_ASC_getInstance();
    this.filterExcludeList_0 = emptyList();
  }
  function VerbEntityListPresenter$SortOrder(name, ordinal, messageId) {
    Enum.call(this);
    this.messageId = messageId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function VerbEntityListPresenter$SortOrder_initFields() {
    VerbEntityListPresenter$SortOrder_initFields = function() {
};
    VerbEntityListPresenter$SortOrder$ORDER_NAME_ASC_instance = new VerbEntityListPresenter$SortOrder('ORDER_NAME_ASC', 0, 2367);
    VerbEntityListPresenter$SortOrder$ORDER_NAME_DSC_instance = new VerbEntityListPresenter$SortOrder('ORDER_NAME_DSC', 1, 2368);
  }
  var VerbEntityListPresenter$SortOrder$ORDER_NAME_ASC_instance;
  function VerbEntityListPresenter$SortOrder$ORDER_NAME_ASC_getInstance() {
    VerbEntityListPresenter$SortOrder_initFields();
    return VerbEntityListPresenter$SortOrder$ORDER_NAME_ASC_instance;
  }
  var VerbEntityListPresenter$SortOrder$ORDER_NAME_DSC_instance;
  function VerbEntityListPresenter$SortOrder$ORDER_NAME_DSC_getInstance() {
    VerbEntityListPresenter$SortOrder_initFields();
    return VerbEntityListPresenter$SortOrder$ORDER_NAME_DSC_instance;
  }
  VerbEntityListPresenter$SortOrder.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SortOrder', 
  interfaces: [Enum]};
  function VerbEntityListPresenter$SortOrder$values() {
    return [VerbEntityListPresenter$SortOrder$ORDER_NAME_ASC_getInstance(), VerbEntityListPresenter$SortOrder$ORDER_NAME_DSC_getInstance()];
  }
  VerbEntityListPresenter$SortOrder.values = VerbEntityListPresenter$SortOrder$values;
  function VerbEntityListPresenter$SortOrder$valueOf(name) {
    switch (name) {
      case 'ORDER_NAME_ASC':
        return VerbEntityListPresenter$SortOrder$ORDER_NAME_ASC_getInstance();
      case 'ORDER_NAME_DSC':
        return VerbEntityListPresenter$SortOrder$ORDER_NAME_DSC_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.controller.VerbEntityListPresenter.SortOrder.' + name);
    }
  }
  VerbEntityListPresenter$SortOrder.valueOf_61zpoe$ = VerbEntityListPresenter$SortOrder$valueOf;
  function VerbEntityListPresenter$VerbEntityListSortOption(sortOrder, context, di) {
    MessageIdOption.call(this, sortOrder.messageId, context, void 0, di);
    this.sortOrder = sortOrder;
  }
  VerbEntityListPresenter$VerbEntityListSortOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'VerbEntityListSortOption', 
  interfaces: [MessageIdOption]};
  VerbEntityListPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2;
  UstadListPresenter.prototype.onCreate.call(this, savedState);
  var tmp$_3;
  if ((tmp$_0 = (tmp$ = this.arguments.get_11rb$(VerbEntityListView$Companion_getInstance().ARG_EXCLUDE_VERBUIDS_LIST)) != null ? split(tmp$, [',']) : null) != null) {
    var destination = ArrayList_init();
    var tmp$_4;
    tmp$_4 = tmp$_0.iterator();
    while (tmp$_4.hasNext()) {
      var element = tmp$_4.next();
      if (element.length > 0) 
        destination.add_11rb$(element);
    }
    tmp$_3 = destination;
  } else 
    tmp$_3 = null;
  var tmp$_5;
  if ((tmp$_1 = tmp$_3) != null) {
    var destination_0 = ArrayList_init_0(collectionSizeOrDefault(tmp$_1, 10));
    var tmp$_6;
    tmp$_6 = tmp$_1.iterator();
    while (tmp$_6.hasNext()) {
      var item = tmp$_6.next();
      destination_0.add_11rb$(toLong(item));
    }
    tmp$_5 = destination_0;
  } else 
    tmp$_5 = null;
  this.filterExcludeList_0 = (tmp$_2 = tmp$_5) != null ? tmp$_2 : emptyList();
  this.updateListOnView_0();
  var tmp$_7 = this.view;
  var $receiver = toList_0(VerbEntityListPresenter$SortOrder$values());
  var destination_1 = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
  var tmp$_8;
  tmp$_8 = $receiver.iterator();
  while (tmp$_8.hasNext()) {
    var item_0 = tmp$_8.next();
    destination_1.add_11rb$(new VerbEntityListPresenter$VerbEntityListSortOption(item_0, this.context, this.di));
  }
  tmp$_7.sortOptions = destination_1;
};
  VerbEntityListPresenter.prototype.onCheckAddPermission_tn71rk$ = function(account, continuation) {
  return false;
};
  VerbEntityListPresenter.prototype.updateListOnView_0 = function() {
  var tmp$, tmp$_0;
  tmp$_0 = this.view;
  switch (this.currentSortOrder.name) {
    case 'ORDER_NAME_ASC':
      tmp$ = this.repo.verbDao.findAllVerbsAsc_gox9k8$(this.filterExcludeList_0);
      break;
    case 'ORDER_NAME_DSC':
      tmp$ = this.repo.verbDao.findAllVerbsDesc_gox9k8$(this.filterExcludeList_0);
      break;
    default:
      tmp$ = Kotlin.noWhenBranchMatched();
      break;
  }
  tmp$_0.list = tmp$;
};
  VerbEntityListPresenter.prototype.handleClickSortOrder_iowaj7$ = function(sortOption) {
  var tmp$, tmp$_0, tmp$_1;
  tmp$_1 = (tmp$_0 = Kotlin.isType(tmp$ = sortOption, VerbEntityListPresenter$VerbEntityListSortOption) ? tmp$ : null) != null ? tmp$_0.sortOrder : null;
  if (tmp$_1 == null) {
    return;
  }
  var sortOrder = tmp$_1;
  if (sortOrder !== this.currentSortOrder) {
    this.currentSortOrder = sortOrder;
    this.updateListOnView_0();
  }
};
  VerbEntityListPresenter.prototype.handleClickCreateNewFab = function() {
};
  VerbEntityListPresenter.prototype.handleClickAddNewItem_a4m1mt$$default = function(args, destinationResultKey) {
};
  VerbEntityListPresenter.prototype.handleClickEntry_11rc$ = function(entry) {
  var di = this.di;
  var strategy = ListSerializer(VerbDisplay.Companion.serializer());
  var entity = listOf_0(entry);
  var tmp$;
  var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
  this.finishWithResult_61zpoe$(json.encodeToString_tf03ej$(strategy, entity));
};
  VerbEntityListPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'VerbEntityListPresenter', 
  interfaces: [UstadListPresenter]};
  function VideoContentPresenterCommon(context, arguments_0, view, di) {
    VideoContentPresenterCommon$Companion_getInstance();
    UstadBaseController.call(this, context, arguments_0, view, di);
    this.entry_ipkzbw$_0 = null;
    this.entryUuid_pvfy5l$_0 = L0;
    this.containerUid_8be2vx$ = L0;
    this.clazzUid = L0;
    var tmp$;
    this.accountManager_r6f9ya$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, VideoContentPresenterCommon$accountManager_metadata);
    var context_0 = this.accountManager.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_0;
    var tmp$_1;
    this.db_syfysg$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_0 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_1 : throwCCE(), 1).provideDelegate_tpuvb9$(this, VideoContentPresenterCommon$db_metadata);
    var context_1 = this.accountManager.activeAccount;
    var trigger_0;
    trigger_0 = this.diTrigger;
    var tmp$_2;
    var tmp$_3;
    this.repo_gg5l04$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_2 : throwCCE(), context_1), trigger_0), Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_3 : throwCCE(), 2).provideDelegate_tpuvb9$(this, VideoContentPresenterCommon$repo_metadata);
    var context_2 = this.accountManager.activeAccount;
    var trigger_1;
    trigger_1 = this.diTrigger;
    var tmp$_4;
    var tmp$_5;
    this.statementEndpoint_6ecqlu$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_4 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_4 : throwCCE(), context_2), trigger_1), Kotlin.isType(tmp$_5 = typeToken(createKType(getKClass(XapiStatementEndpoint), [], false)), TypeToken) ? tmp$_5 : throwCCE(), null).provideDelegate_tpuvb9$(this, VideoContentPresenterCommon$statementEndpoint_metadata);
    this.timeVideoPlayed = L0;
    this.contextRegistration_zdcvv2$_0 = this.contextRegistration_zdcvv2$_0;
    this.audioEntry = null;
    this.videoPath_8be2vx$ = null;
    this.srtMap_8be2vx$ = LinkedHashMap_init();
    this.srtLangList_8be2vx$ = ArrayList_init();
  }
  var VideoContentPresenterCommon$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(VideoContentPresenterCommon.prototype, 'accountManager', {
  configurable: true, 
  get: function() {
  return this.accountManager_r6f9ya$_0.value;
}});
  var VideoContentPresenterCommon$db_metadata = new PropertyMetadata('db');
  Object.defineProperty(VideoContentPresenterCommon.prototype, 'db', {
  configurable: true, 
  get: function() {
  return this.db_syfysg$_0.value;
}});
  var VideoContentPresenterCommon$repo_metadata = new PropertyMetadata('repo');
  Object.defineProperty(VideoContentPresenterCommon.prototype, 'repo', {
  configurable: true, 
  get: function() {
  return this.repo_gg5l04$_0.value;
}});
  var VideoContentPresenterCommon$statementEndpoint_metadata = new PropertyMetadata('statementEndpoint');
  Object.defineProperty(VideoContentPresenterCommon.prototype, 'statementEndpoint', {
  configurable: true, 
  get: function() {
  return this.statementEndpoint_6ecqlu$_0.value;
}});
  Object.defineProperty(VideoContentPresenterCommon.prototype, 'contextRegistration', {
  configurable: true, 
  get: function() {
  if (this.contextRegistration_zdcvv2$_0 == null) 
    return throwUPAE('contextRegistration');
  return this.contextRegistration_zdcvv2$_0;
}, 
  set: function(contextRegistration) {
  this.contextRegistration_zdcvv2$_0 = contextRegistration;
}});
  function VideoContentPresenterCommon$VideoParams(videoPath, audioPath, srtLangList, srtMap) {
    if (videoPath === void 0) 
      videoPath = null;
    if (audioPath === void 0) 
      audioPath = null;
    if (srtLangList === void 0) {
      srtLangList = ArrayList_init();
    }
    if (srtMap === void 0) {
      srtMap = LinkedHashMap_init();
    }
    this.videoPath = videoPath;
    this.audioPath = audioPath;
    this.srtLangList = srtLangList;
    this.srtMap = srtMap;
  }
  VideoContentPresenterCommon$VideoParams.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'VideoParams', 
  interfaces: []};
  VideoContentPresenterCommon$VideoParams.prototype.component1 = function() {
  return this.videoPath;
};
  VideoContentPresenterCommon$VideoParams.prototype.component2 = function() {
  return this.audioPath;
};
  VideoContentPresenterCommon$VideoParams.prototype.component3 = function() {
  return this.srtLangList;
};
  VideoContentPresenterCommon$VideoParams.prototype.component4 = function() {
  return this.srtMap;
};
  VideoContentPresenterCommon$VideoParams.prototype.copy_lincaq$ = function(videoPath, audioPath, srtLangList, srtMap) {
  return new VideoContentPresenterCommon$VideoParams(videoPath === void 0 ? this.videoPath : videoPath, audioPath === void 0 ? this.audioPath : audioPath, srtLangList === void 0 ? this.srtLangList : srtLangList, srtMap === void 0 ? this.srtMap : srtMap);
};
  VideoContentPresenterCommon$VideoParams.prototype.toString = function() {
  return 'VideoParams(videoPath=' + Kotlin.toString(this.videoPath) + (', audioPath=' + Kotlin.toString(this.audioPath)) + (', srtLangList=' + Kotlin.toString(this.srtLangList)) + (', srtMap=' + Kotlin.toString(this.srtMap)) + ')';
};
  VideoContentPresenterCommon$VideoParams.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.videoPath) | 0;
  result = result * 31 + Kotlin.hashCode(this.audioPath) | 0;
  result = result * 31 + Kotlin.hashCode(this.srtLangList) | 0;
  result = result * 31 + Kotlin.hashCode(this.srtMap) | 0;
  return result;
};
  VideoContentPresenterCommon$VideoParams.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.videoPath, other.videoPath) && Kotlin.equals(this.audioPath, other.audioPath) && Kotlin.equals(this.srtLangList, other.srtLangList) && Kotlin.equals(this.srtMap, other.srtMap)))));
};
  function Coroutine$VideoContentPresenterCommon$onCreate$lambda(this$VideoContentPresenterCommon_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$VideoContentPresenterCommon = this$VideoContentPresenterCommon_0;
  }
  Coroutine$VideoContentPresenterCommon$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$VideoContentPresenterCommon$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$VideoContentPresenterCommon$onCreate$lambda.prototype.constructor = Coroutine$VideoContentPresenterCommon$onCreate$lambda;
  Coroutine$VideoContentPresenterCommon$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$VideoContentPresenterCommon.db.contentEntryDao.findByUidAsync_s8cxhz$(this.local$this$VideoContentPresenterCommon.entryUuid_pvfy5l$_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$this$VideoContentPresenterCommon.entry_ipkzbw$_0 = this.result_0;
        return this.local$this$VideoContentPresenterCommon.view.entry = this.local$this$VideoContentPresenterCommon.entry_ipkzbw$_0 , Unit;
      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 VideoContentPresenterCommon$onCreate$lambda(this$VideoContentPresenterCommon_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$VideoContentPresenterCommon$onCreate$lambda(this$VideoContentPresenterCommon_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  VideoContentPresenterCommon.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0;
  UstadBaseController.prototype.onCreate.call(this, savedState);
  this.contextRegistration = randomUuid().toString();
  this.entryUuid_pvfy5l$_0 = toLong(getValue(this.arguments, UstadView$Companion_getInstance().ARG_CONTENT_ENTRY_UID));
  this.containerUid_8be2vx$ = toLong(getValue(this.arguments, UstadView$Companion_getInstance().ARG_CONTAINER_UID));
  this.clazzUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  this.view.loading = true;
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, VideoContentPresenterCommon$onCreate$lambda(this));
};
  VideoContentPresenterCommon.prototype.onResume = function() {
  UstadBaseController.prototype.onResume.call(this);
  this.handleOnResume();
};
  function Coroutine$VideoContentPresenterCommon$updateProgress$lambda(closure$position_0, closure$videoLength_0, this$VideoContentPresenterCommon_0, closure$playerPlayedVideoDuration_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$position = closure$position_0;
    this.local$closure$videoLength = closure$videoLength_0;
    this.local$this$VideoContentPresenterCommon = this$VideoContentPresenterCommon_0;
    this.local$closure$playerPlayedVideoDuration = closure$playerPlayedVideoDuration_0;
  }
  Coroutine$VideoContentPresenterCommon$updateProgress$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$VideoContentPresenterCommon$updateProgress$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$VideoContentPresenterCommon$updateProgress$lambda.prototype.constructor = Coroutine$VideoContentPresenterCommon$updateProgress$lambda;
  Coroutine$VideoContentPresenterCommon$updateProgress$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        var progress = numberToInt(this.local$closure$position.toNumber() / this.local$closure$videoLength.toNumber() * 100);
        var tmp$_0;
        if ((tmp$ = this.local$this$VideoContentPresenterCommon.entry_ipkzbw$_0) != null) {
          var this$VideoContentPresenterCommon = this.local$this$VideoContentPresenterCommon;
          var closure$playerPlayedVideoDuration = this.local$closure$playerPlayedVideoDuration;
          storeProgressStatement(this$VideoContentPresenterCommon.statementEndpoint, this$VideoContentPresenterCommon.accountManager.activeAccount, tmp$, progress, closure$playerPlayedVideoDuration.v, this$VideoContentPresenterCommon.contextRegistration, this$VideoContentPresenterCommon.clazzUid);
          tmp$_0 = tmp$;
        } else 
          tmp$_0 = null;
        return tmp$_0;
      case 1:
        throw this.exception_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 VideoContentPresenterCommon$updateProgress$lambda(closure$position_0, closure$videoLength_0, this$VideoContentPresenterCommon_0, closure$playerPlayedVideoDuration_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$VideoContentPresenterCommon$updateProgress$lambda(closure$position_0, closure$videoLength_0, this$VideoContentPresenterCommon_0, closure$playerPlayedVideoDuration_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  VideoContentPresenterCommon.prototype.updateProgress_6o1nvj$ = function(position, videoLength, playerStarted) {
  if (playerStarted === void 0) 
    playerStarted = false;
  if (equals(this.accountManager.activeAccount.personUid, L0)) {
    return;
  }
  var playerPlayedVideoDuration = {
  v: L0};
  if (playerStarted) {
    this.timeVideoPlayed = systemTimeInMillis();
  } else if (equals(this.timeVideoPlayed, L0)) {
    return;
  } else if (!playerStarted && this.timeVideoPlayed.toNumber() > 0) {
    playerPlayedVideoDuration.v = systemTimeInMillis().subtract(this.timeVideoPlayed);
    this.timeVideoPlayed = L0;
  } else {
    return;
  }
  launch(coroutines.GlobalScope, void 0, void 0, VideoContentPresenterCommon$updateProgress$lambda(position, videoLength, this, playerPlayedVideoDuration));
};
  function VideoContentPresenterCommon$Companion() {
    VideoContentPresenterCommon$Companion_instance = this;
    this.VIDEO_EXT_LIST = listOf(['.mp4', '.mkv', '.webm', '.m4v']);
    this.VIDEO_MIME_MAP = mapOf([to('video/mp4', '.mp4'), to('video/x-matroska', '.mkv'), to('video/webm', '.webm'), to('video/x-m4v', '.m4v')]);
  }
  VideoContentPresenterCommon$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var VideoContentPresenterCommon$Companion_instance = null;
  function VideoContentPresenterCommon$Companion_getInstance() {
    if (VideoContentPresenterCommon$Companion_instance === null) {
      new VideoContentPresenterCommon$Companion();
    }
    return VideoContentPresenterCommon$Companion_instance;
  }
  VideoContentPresenterCommon.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'VideoContentPresenterCommon', 
  interfaces: [UstadBaseController]};
  function Runnable$ObjectLiteral_2(closure$block) {
    this.closure$block = closure$block;
  }
  Runnable$ObjectLiteral_2.prototype.run = function() {
  this.closure$block();
};
  Runnable$ObjectLiteral_2.$metadata$ = {
  kind: Kind_CLASS, 
  interfaces: [Runnable]};
  function IndexLog() {
    this.title = null;
    this.entries = null;
    this.links = null;
  }
  function IndexLog$IndexEntry($outer) {
    this.$outer = $outer;
    this.url = '';
    this.mimeType = null;
    this.path = null;
    this.headers = null;
    this.requestHeaders = null;
  }
  IndexLog$IndexEntry.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'IndexEntry', 
  interfaces: []};
  IndexLog.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'IndexLog', 
  interfaces: []};
  function WebChunkPresenterCommon(context, arguments_0, view, di) {
    UstadBaseController.call(this, context, arguments_0, view, di);
    this.clazzUid_r9df85$_0 = L0;
    this.containerUid_8be2vx$ = null;
    var tmp$;
    this.contentEntryOpener_4w7kzx$_5k543h$_0 = Instance(di, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(ContentEntryOpener), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, WebChunkPresenterCommon$contentEntryOpener_metadata);
    var tmp$_0;
    this.accountManager_av4p31$_0 = Instance(this, Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, WebChunkPresenterCommon$accountManager_metadata);
    var context_0 = this.accountManager.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_1;
    var tmp$_2;
    this.db_oe2u11$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_1 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_2 : throwCCE(), 1).provideDelegate_tpuvb9$(this, WebChunkPresenterCommon$db_metadata);
    var context_1 = this.accountManager.activeAccount;
    var trigger_0;
    trigger_0 = this.diTrigger;
    var tmp$_3;
    var tmp$_4;
    this.repo_5qaen$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_3 : throwCCE(), context_1), trigger_0), Kotlin.isType(tmp$_4 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_4 : throwCCE(), 2).provideDelegate_tpuvb9$(this, WebChunkPresenterCommon$repo_metadata);
    var tmp$_5;
    this.systemImpl_l8iu30$_hr029o$_0 = Instance(di, Kotlin.isType(tmp$_5 = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$_5 : throwCCE(), null).provideDelegate_tpuvb9$(this, WebChunkPresenterCommon$systemImpl_metadata);
  }
  var WebChunkPresenterCommon$contentEntryOpener_metadata = new PropertyMetadata('contentEntryOpener');
  Object.defineProperty(WebChunkPresenterCommon.prototype, 'contentEntryOpener_4w7kzx$_0', {
  configurable: true, 
  get: function() {
  return this.contentEntryOpener_4w7kzx$_5k543h$_0.value;
}});
  var WebChunkPresenterCommon$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(WebChunkPresenterCommon.prototype, 'accountManager', {
  configurable: true, 
  get: function() {
  return this.accountManager_av4p31$_0.value;
}});
  var WebChunkPresenterCommon$db_metadata = new PropertyMetadata('db');
  Object.defineProperty(WebChunkPresenterCommon.prototype, 'db', {
  configurable: true, 
  get: function() {
  return this.db_oe2u11$_0.value;
}});
  var WebChunkPresenterCommon$repo_metadata = new PropertyMetadata('repo');
  Object.defineProperty(WebChunkPresenterCommon.prototype, 'repo', {
  configurable: true, 
  get: function() {
  return this.repo_5qaen$_0.value;
}});
  var WebChunkPresenterCommon$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(WebChunkPresenterCommon.prototype, 'systemImpl_l8iu30$_0', {
  configurable: true, 
  get: function() {
  return this.systemImpl_l8iu30$_hr029o$_0.value;
}});
  function WebChunkPresenterCommon$onCreate$lambda$lambda(closure$result, this$WebChunkPresenterCommon) {
    return function() {
  this$WebChunkPresenterCommon.view.entry = closure$result;
  return Unit;
};
  }
  function WebChunkPresenterCommon$onCreate$lambda$lambda_0(this$WebChunkPresenterCommon) {
    return function() {
  this$WebChunkPresenterCommon.view.showSnackBar_9pu0dj$(this$WebChunkPresenterCommon.systemImpl_l8iu30$_0.getString(2027, this$WebChunkPresenterCommon.context));
  return Unit;
};
  }
  function Coroutine$WebChunkPresenterCommon$onCreate$lambda(this$WebChunkPresenterCommon_0, closure$entryUuid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 5;
    this.local$this$WebChunkPresenterCommon = this$WebChunkPresenterCommon_0;
    this.local$closure$entryUuid = closure$entryUuid_0;
  }
  Coroutine$WebChunkPresenterCommon$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$WebChunkPresenterCommon$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$WebChunkPresenterCommon$onCreate$lambda.prototype.constructor = Coroutine$WebChunkPresenterCommon$onCreate$lambda;
  Coroutine$WebChunkPresenterCommon$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.exceptionState_0 = 2;
        this.state_0 = 1;
        this.result_0 = this.local$this$WebChunkPresenterCommon.repo.contentEntryDao.getContentByUuidAsync(this.local$closure$entryUuid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        var result = this.result_0;
        this.local$this$WebChunkPresenterCommon.view.runOnUiThread_9ywmpy$(new Runnable$ObjectLiteral_2(WebChunkPresenterCommon$onCreate$lambda$lambda(result, this.local$this$WebChunkPresenterCommon)));
        this.exceptionState_0 = 5;
        this.state_0 = 3;
        continue;
      case 2:
        this.exceptionState_0 = 5;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          this.local$this$WebChunkPresenterCommon.view.runOnUiThread_9ywmpy$(new Runnable$ObjectLiteral_2(WebChunkPresenterCommon$onCreate$lambda$lambda_0(this.local$this$WebChunkPresenterCommon)));
        } else 
          throw e;
        this.state_0 = 3;
        continue;
      case 3:
        this.state_0 = 4;
        this.result_0 = this.local$this$WebChunkPresenterCommon.handleMountChunk(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        return this.result_0;
      case 5:
        throw this.exception_0;
      default:
        this.state_0 = 5;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 5) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function WebChunkPresenterCommon$onCreate$lambda(this$WebChunkPresenterCommon_0, closure$entryUuid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$WebChunkPresenterCommon$onCreate$lambda(this$WebChunkPresenterCommon_0, closure$entryUuid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  WebChunkPresenterCommon.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0;
  UstadBaseController.prototype.onCreate.call(this, savedState);
  var entryUuid = toLong(getValue(this.arguments, UstadView$Companion_getInstance().ARG_CONTENT_ENTRY_UID));
  this.containerUid_8be2vx$ = toLong(getValue(this.arguments, UstadView$Companion_getInstance().ARG_CONTAINER_UID));
  this.clazzUid_r9df85$_0 = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLong(tmp$) : null) != null ? tmp$_0 : L0;
  launch(coroutines.GlobalScope, void 0, void 0, WebChunkPresenterCommon$onCreate$lambda(this, entryUuid));
};
  function Coroutine$WebChunkPresenterCommon$handleUrlLinkToContentEntry$lambda(this$WebChunkPresenterCommon_0, closure$params_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 7;
    this.local$this$WebChunkPresenterCommon = this$WebChunkPresenterCommon_0;
    this.local$closure$params = closure$params_0;
  }
  Coroutine$WebChunkPresenterCommon$handleUrlLinkToContentEntry$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$WebChunkPresenterCommon$handleUrlLinkToContentEntry$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$WebChunkPresenterCommon$handleUrlLinkToContentEntry$lambda.prototype.constructor = Coroutine$WebChunkPresenterCommon$handleUrlLinkToContentEntry$lambda;
  Coroutine$WebChunkPresenterCommon$handleUrlLinkToContentEntry$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
        this.exceptionState_0 = 3;
        this.state_0 = 1;
        this.result_0 = this.local$this$WebChunkPresenterCommon.repo.contentEntryDao.findBySourceUrlWithContentEntryStatusAsync(getValue(this.local$closure$params, 'sourceUrl'), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        tmp$ = this.result_0;
        if (tmp$ == null) {
          throw IllegalArgumentException_init('No File found');
        }
        var entry = tmp$;
        this.state_0 = 2;
        this.result_0 = this.local$this$WebChunkPresenterCommon.contentEntryOpener_4w7kzx$_0.openEntry_6luryd$(this.local$this$WebChunkPresenterCommon.context, entry.contentEntryUid, true, true, (tmp$_1 = (tmp$_0 = this.local$this$WebChunkPresenterCommon.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_NO_IFRAMES)) != null ? toBoolean(tmp$_0) : null) != null ? tmp$_1 : false, void 0, this.local$this$WebChunkPresenterCommon.clazzUid_r9df85$_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 2:
        return this.result_0;
      case 3:
        this.exceptionState_0 = 7;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          if (Kotlin.isType(e, NoAppFoundException)) {
            return this.local$this$WebChunkPresenterCommon.view.showNoAppFoundError_h6sd2a$(this.local$this$WebChunkPresenterCommon.systemImpl_l8iu30$_0.getString(2166, this.local$this$WebChunkPresenterCommon.context), 2165, (tmp$_2 = e.mimeType) != null ? tmp$_2 : '') , Unit;
          } else {
            return this.local$this$WebChunkPresenterCommon.view.showSnackBar_9pu0dj$((tmp$_3 = e.message) != null ? tmp$_3 : '') , Unit;
          }
        } else {
          throw e;
        }
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        this.state_0 = 6;
        continue;
      case 6:
        return;
      case 7:
        throw this.exception_0;
      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);
};
  function WebChunkPresenterCommon$handleUrlLinkToContentEntry$lambda(this$WebChunkPresenterCommon_0, closure$params_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$WebChunkPresenterCommon$handleUrlLinkToContentEntry$lambda(this$WebChunkPresenterCommon_0, closure$params_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  WebChunkPresenterCommon.prototype.handleUrlLinkToContentEntry = function(sourceUrl) {
  var dest = replace(sourceUrl, 'content-detail?', ContentEntryDetailView$Companion_getInstance().VIEW_NAME + '?');
  var params = UMFileUtil_getInstance().parseURLQueryString(dest);
  if (params.containsKey_11rb$('sourceUrl')) {
    launch(coroutines.GlobalScope, void 0, void 0, WebChunkPresenterCommon$handleUrlLinkToContentEntry$lambda(this, params));
  }
};
  WebChunkPresenterCommon.prototype.handleUpNavigation = function() {
};
  WebChunkPresenterCommon.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'WebChunkPresenterCommon', 
  interfaces: [UstadBaseController]};
  function get$lambda_1($receiver) {
    return Unit;
  }
  function XapiPackageContentPresenter(context, args, view, di) {
    UstadBaseController.call(this, context, args, view, di);
    this.tinCanXml_0 = null;
    this.mountedPath_0 = '';
    var tmp$;
    this.mounter_cd6g42$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(ContainerMounter), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, XapiPackageContentPresenter$mounter_metadata);
    var tmp$_0;
    this.accountManager_qrl1y4$_0 = Instance(this, Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UstadAccountManager), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, XapiPackageContentPresenter$accountManager_metadata);
    this.mountedEndpoint_v5ll11$_0 = this.mountedEndpoint_v5ll11$_0;
    this.contextRegistration_5wj2z4$_0 = this.contextRegistration_5wj2z4$_0;
    this.contentEntryUid_0 = L0;
    this.clazzUid_0 = L0;
    this.onCreateException_0 = null;
    this.isStarted_0 = false;
    var context_0 = this.accountManager_0.activeAccount;
    var trigger;
    trigger = this.diTrigger;
    var tmp$_1;
    var tmp$_2;
    this.repo_hwps16$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_1 : throwCCE(), context_0), trigger), Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_2 : throwCCE(), 2).provideDelegate_tpuvb9$(this, XapiPackageContentPresenter$repo_metadata);
    var context_1 = this.accountManager_0.activeAccount;
    var trigger_0;
    trigger_0 = this.diTrigger;
    var tmp$_3;
    var tmp$_4;
    this.db_6ph7fm$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_3 : throwCCE(), context_1), trigger_0), Kotlin.isType(tmp$_4 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_4 : throwCCE(), 1).provideDelegate_tpuvb9$(this, XapiPackageContentPresenter$db_metadata);
    var context_2 = this.accountManager_0.activeAccount;
    var trigger_1;
    trigger_1 = this.diTrigger;
    var tmp$_5;
    var tmp$_6;
    this.statementEndpoint_1bhd1o$_0 = Instance(On(this, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$_5 = typeToken(createKType(getKClass(UmAccount), [], false)), TypeToken) ? tmp$_5 : throwCCE(), context_2), trigger_1), Kotlin.isType(tmp$_6 = typeToken(createKType(getKClass(XapiStatementEndpoint), [], false)), TypeToken) ? tmp$_6 : throwCCE(), null).provideDelegate_tpuvb9$(this, XapiPackageContentPresenter$statementEndpoint_metadata);
  }
  var XapiPackageContentPresenter$mounter_metadata = new PropertyMetadata('mounter');
  Object.defineProperty(XapiPackageContentPresenter.prototype, 'mounter_0', {
  configurable: true, 
  get: function() {
  return this.mounter_cd6g42$_0.value;
}});
  var XapiPackageContentPresenter$accountManager_metadata = new PropertyMetadata('accountManager');
  Object.defineProperty(XapiPackageContentPresenter.prototype, 'accountManager_0', {
  configurable: true, 
  get: function() {
  return this.accountManager_qrl1y4$_0.value;
}});
  Object.defineProperty(XapiPackageContentPresenter.prototype, 'mountedEndpoint_0', {
  configurable: true, 
  get: function() {
  if (this.mountedEndpoint_v5ll11$_0 == null) 
    return throwUPAE('mountedEndpoint');
  return this.mountedEndpoint_v5ll11$_0;
}, 
  set: function(mountedEndpoint) {
  this.mountedEndpoint_v5ll11$_0 = mountedEndpoint;
}});
  Object.defineProperty(XapiPackageContentPresenter.prototype, 'contextRegistration_0', {
  configurable: true, 
  get: function() {
  if (this.contextRegistration_5wj2z4$_0 == null) 
    return throwUPAE('contextRegistration');
  return this.contextRegistration_5wj2z4$_0;
}, 
  set: function(contextRegistration) {
  this.contextRegistration_5wj2z4$_0 = contextRegistration;
}});
  var XapiPackageContentPresenter$repo_metadata = new PropertyMetadata('repo');
  Object.defineProperty(XapiPackageContentPresenter.prototype, 'repo', {
  configurable: true, 
  get: function() {
  return this.repo_hwps16$_0.value;
}});
  var XapiPackageContentPresenter$db_metadata = new PropertyMetadata('db');
  Object.defineProperty(XapiPackageContentPresenter.prototype, 'db_0', {
  configurable: true, 
  get: function() {
  return this.db_6ph7fm$_0.value;
}});
  var XapiPackageContentPresenter$statementEndpoint_metadata = new PropertyMetadata('statementEndpoint');
  Object.defineProperty(XapiPackageContentPresenter.prototype, 'statementEndpoint', {
  configurable: true, 
  get: function() {
  return this.statementEndpoint_1bhd1o$_0.value;
}});
  function XapiPackageContentPresenter$onCreate$lambda$lambda(closure$tinCanPath) {
    return function() {
  return 'XapiPackageContentPresenter: Loading ' + closure$tinCanPath + ' ';
};
  }
  function XapiPackageContentPresenter$onCreate$lambda$lambda_0(closure$launchHref) {
    return function() {
  return 'XapiPackageContentPresenter: Launch HREF = ' + toString(closure$launchHref);
};
  }
  function XapiPackageContentPresenter$onCreate$lambda$lambda_1(closure$launchUrl) {
    return function() {
  return 'XapiPackageContentPresenter: opening launch url = ' + closure$launchUrl;
};
  }
  function XapiPackageContentPresenter$onCreate$lambda$lambda_2() {
    return 'XapiPackageContentPresenter: ERR: launchHref = null';
  }
  function Coroutine$XapiPackageContentPresenter$onCreate$lambda(this$XapiPackageContentPresenter_0, closure$activeEndpoint_0, closure$containerUid_0, closure$learnerGroupUid_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 18;
    this.local$this$XapiPackageContentPresenter = this$XapiPackageContentPresenter_0;
    this.local$closure$activeEndpoint = closure$activeEndpoint_0;
    this.local$closure$containerUid = closure$containerUid_0;
    this.local$closure$learnerGroupUid = closure$learnerGroupUid_0;
    this.local$tmp$_1 = void 0;
    this.local$response = void 0;
    this.local$launchHref = void 0;
  }
  Coroutine$XapiPackageContentPresenter$onCreate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$XapiPackageContentPresenter$onCreate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$XapiPackageContentPresenter$onCreate$lambda.prototype.constructor = Coroutine$XapiPackageContentPresenter$onCreate$lambda;
  Coroutine$XapiPackageContentPresenter$onCreate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        var tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6, tmp$_7, tmp$_8;
        this.exceptionState_0 = 13;
        this.state_0 = 1;
        this.result_0 = this.local$this$XapiPackageContentPresenter.mounter_0.mountContainer_dckg8j$(this.local$closure$activeEndpoint, this.local$closure$containerUid, void 0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        this.local$this$XapiPackageContentPresenter.mountedPath_0 = this.result_0;
        var tmp$_9;
        var client = get_direct(this.local$this$XapiPackageContentPresenter.di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_9 = typeToken(createKType(getKClass(HttpClient), [], false)), TypeToken) ? tmp$_9 : throwCCE(), null);
        var tinCanPath = UMFileUtil_getInstance().joinPaths_vqirvp$([this.local$this$XapiPackageContentPresenter.mountedPath_0, 'tincan.xml']);
        napier.Napier.d_9h2hdn$(void 0, void 0, XapiPackageContentPresenter$onCreate$lambda$lambda(tinCanPath));
        var host_0;
        var body_0;
        host_0 = 'localhost';
        body_0 = utils.EmptyContent;
        var $receiver_1 = new HttpRequestBuilder_init();
        url_0($receiver_1, 'http', host_0, 0, '/');
        $receiver_1.method = HttpMethod.Companion.Get;
        $receiver_1.body = body_0;
        takeFrom_0($receiver_1.url, tinCanPath);
        get$lambda_1($receiver_1);
        var $this_0 = new HttpStatement($receiver_1, client);
        var tmp$_4_0, tmp$_5_0, tmp$_6_0;
        tmp$_4_0 = PrimitiveClasses$stringClass;
        if (equals(tmp$_4_0, getKClass(HttpStatement))) {
          this.result_0 = typeof (tmp$_5_0 = $this_0) === 'string' ? tmp$_5_0 : throwCCE();
          this.state_0 = 9;
          continue;
        } else {
          if (equals(tmp$_4_0, getKClass(HttpResponse))) {
            this.state_0 = 7;
            this.result_0 = $this_0.execute(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 2;
            this.result_0 = $this_0.executeUnsafe(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          }
        }
      case 2:
        this.local$response = this.result_0;
        this.exceptionState_0 = 5;
        var tmp$_7_0;
        var tmp$_8_0 = this.local$response.call;
        var typeInfo$result_0;
        typeInfo$break:
          do {
            try {
              typeInfo$result_0 = typeInfoImpl(reflect.JsType, PrimitiveClasses$stringClass, createKType(PrimitiveClasses$stringClass, [], false));
            }            catch (_) {
  typeInfo$result_0 = typeInfoImpl(reflect.JsType, PrimitiveClasses$stringClass, null);
  break typeInfo$break;
}
          } while (false);
        this.state_0 = 3;
        this.result_0 = tmp$_8_0.receive_qi9ur9$(typeInfo$result_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.result_0 = typeof (tmp$_7_0 = this.result_0) === 'string' ? tmp$_7_0 : throwCCE();
        this.exceptionState_0 = 13;
        this.finallyPath_0 = [4];
        this.state_0 = 6;
        continue;
      case 4:
        this.state_0 = 8;
        continue;
      case 5:
        this.finallyPath_0 = [13];
        this.state_0 = 6;
        continue;
      case 6:
        this.exceptionState_0 = 13;
        complete(this.local$response);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 7:
        this.result_0 = typeof (tmp$_6_0 = this.result_0) === 'string' ? tmp$_6_0 : throwCCE();
        this.state_0 = 8;
        continue;
      case 8:
        this.state_0 = 9;
        continue;
      case 9:
        this.result_0;
        var tincanContent = this.result_0;
        var tmp$_10;
        var xppFactory = get_direct(this.local$this$XapiPackageContentPresenter.di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_10 = typeToken(createKType(getKClass(XmlPullParserFactory), [], false)), TypeToken) ? tmp$_10 : throwCCE(), 1);
        var xpp = xppFactory.newPullParser();
        setInputString(xpp, tincanContent);
        this.local$this$XapiPackageContentPresenter.tinCanXml_0 = TinCanXML$Companion_getInstance().loadFromXML_h3yi26$(xpp);
        this.local$launchHref = (tmp$_0 = (tmp$ = this.local$this$XapiPackageContentPresenter.tinCanXml_0) != null ? tmp$.launchActivity : null) != null ? tmp$_0.launchUrl : null;
        napier.Napier.d_9h2hdn$(void 0, void 0, XapiPackageContentPresenter$onCreate$lambda$lambda_0(this.local$launchHref));
        if (equals(this.local$closure$learnerGroupUid, L0)) {
          this.local$tmp$_1 = Json.Default.encodeToString_tf03ej$(UmAccountActor$Companion_getInstance().serializer(), toXapiActorJsonObject(this.local$this$XapiPackageContentPresenter.accountManager_0.activeAccount, this.local$this$XapiPackageContentPresenter.context));
          this.state_0 = 11;
          continue;
        } else {
          this.state_0 = 10;
          this.result_0 = this.local$this$XapiPackageContentPresenter.repo.learnerGroupMemberDao.findLearnerGroupMembersByGroupIdAndEntryList_3pjtqy$(this.local$closure$learnerGroupUid, this.local$this$XapiPackageContentPresenter.contentEntryUid_0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        }
      case 10:
        var memberList = this.result_0;
        this.local$tmp$_1 = Json.Default.encodeToString_tf03ej$(UmAccountGroupActor$Companion_getInstance().serializer(), toXapiGroupJsonObject(this.local$this$XapiPackageContentPresenter.accountManager_0.activeAccount, memberList));
        this.state_0 = 11;
        continue;
      case 11:
        var actorJsonStr = this.local$tmp$_1;
        var endpointPart = 'xapi/' + this.local$this$XapiPackageContentPresenter.contentEntryUid_0.toString() + '/' + this.local$this$XapiPackageContentPresenter.clazzUid_0.toString() + '/';
        if (UmPlatformUtil_getInstance().isWeb) {
          tmp$_1 = UMFileUtil_getInstance().resolveLink_puj7f4$(UMURLEncoder$Companion_getInstance().encodeUTF8_61zpoe$(this.local$closure$activeEndpoint), endpointPart);
        } else {
          tmp$_1 = UMFileUtil_getInstance().resolveLink_puj7f4$(this.local$this$XapiPackageContentPresenter.mountedPath_0, '/' + UMURLEncoder$Companion_getInstance().encodeUTF8_61zpoe$(this.local$closure$activeEndpoint) + '/' + endpointPart);
        }
        var xapiEndPoint = tmp$_1;
        var launchMethodParams = mapOf([to('actor', actorJsonStr), to('endpoint', xapiEndPoint), to('auth', 'OjFjMGY4NTYxNzUwOGI4YWY0NjFkNzU5MWUxMzE1ZGQ1'), to('registration', this.local$this$XapiPackageContentPresenter.contextRegistration_0), to('activity_id', (tmp$_4 = (tmp$_3 = (tmp$_2 = this.local$this$XapiPackageContentPresenter.tinCanXml_0) != null ? tmp$_2.launchActivity : null) != null ? tmp$_3.id : null) != null ? tmp$_4 : 'xapi_id')]);
        if (this.local$launchHref != null) {
          if (UmPlatformUtil_getInstance().isWeb) {
            tmp$_5 = '';
          } else {
            tmp$_5 = '?' + toQueryString(launchMethodParams);
          }
          var launchParams = tmp$_5;
          var launchUrl = UMFileUtil_getInstance().joinPaths_vqirvp$([this.local$this$XapiPackageContentPresenter.mountedPath_0, this.local$launchHref]) + launchParams;
          napier.Napier.d_9h2hdn$(void 0, void 0, XapiPackageContentPresenter$onCreate$lambda$lambda_1(launchUrl));
          this.local$this$XapiPackageContentPresenter.view.setTitle = (tmp$_8 = (tmp$_7 = (tmp$_6 = this.local$this$XapiPackageContentPresenter.tinCanXml_0) != null ? tmp$_6.launchActivity : null) != null ? tmp$_7.name : null) != null ? tmp$_8 : '';
          return this.local$this$XapiPackageContentPresenter.view.url = launchUrl , Unit;
        } else {
          return napier.Napier.e_9h2hdn$(void 0, void 0, XapiPackageContentPresenter$onCreate$lambda$lambda_2) , Unit;
        }
      case 12:
        this.exceptionState_0 = 18;
        this.state_0 = 17;
        continue;
      case 13:
        this.exceptionState_0 = 18;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          if (!Kotlin.isType(e, CancellationException)) {
            if (this.local$this$XapiPackageContentPresenter.isStarted_0) {
              return this.local$this$XapiPackageContentPresenter.navigateToErrorScreen_3lhtaa$(e) , Unit;
            } else {
              return this.local$this$XapiPackageContentPresenter.onCreateException_0 = e , Unit;
            }
          } else {
            this.state_0 = 15;
            continue;
          }
        } else {
          throw e;
        }
      case 14:
        this.state_0 = 15;
        continue;
      case 15:
        this.state_0 = 16;
        continue;
      case 16:
        this.state_0 = 17;
        continue;
      case 17:
        return Unit;
      case 18:
        throw this.exception_0;
      default:
        this.state_0 = 18;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 18) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function XapiPackageContentPresenter$onCreate$lambda(this$XapiPackageContentPresenter_0, closure$activeEndpoint_0, closure$containerUid_0, closure$learnerGroupUid_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$XapiPackageContentPresenter$onCreate$lambda(this$XapiPackageContentPresenter_0, closure$activeEndpoint_0, closure$containerUid_0, closure$learnerGroupUid_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  XapiPackageContentPresenter.prototype.onCreate = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6;
  UstadBaseController.prototype.onCreate.call(this, savedState);
  var containerUid = (tmp$_0 = (tmp$ = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CONTAINER_UID)) != null ? toLongOrNull(tmp$) : null) != null ? tmp$_0 : L0;
  this.contentEntryUid_0 = (tmp$_2 = (tmp$_1 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CONTENT_ENTRY_UID)) != null ? toLongOrNull(tmp$_1) : null) != null ? tmp$_2 : L0;
  var learnerGroupUid = (tmp$_4 = (tmp$_3 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_LEARNER_GROUP_UID)) != null ? toLongOrNull(tmp$_3) : null) != null ? tmp$_4 : L0;
  this.clazzUid_0 = (tmp$_6 = (tmp$_5 = this.arguments.get_11rb$(UstadView$Companion_getInstance().ARG_CLAZZUID)) != null ? toLongOrNull(tmp$_5) : null) != null ? tmp$_6 : L0;
  var $receiver = this.accountManager_0.activeAccount.endpointUrl;
  this.mountedEndpoint_0 = $receiver;
  var activeEndpoint = $receiver;
  this.contextRegistration_0 = randomUuid().toString();
  launch(this.presenterScope, void 0, void 0, XapiPackageContentPresenter$onCreate$lambda(this, activeEndpoint, containerUid, learnerGroupUid));
};
  XapiPackageContentPresenter.prototype.onStart = function() {
  var tmp$;
  UstadBaseController.prototype.onStart.call(this);
  this.isStarted_0 = true;
  if ((tmp$ = this.onCreateException_0) != null) {
    this.navigateToErrorScreen_3lhtaa$(tmp$);
  }
  this.onCreateException_0 = null;
};
  function Coroutine$XapiPackageContentPresenter$onStop$lambda(this$XapiPackageContentPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$XapiPackageContentPresenter = this$XapiPackageContentPresenter_0;
    this.local$tmp$ = void 0;
    this.local$tmp$_2 = void 0;
    this.local$tmp$_3 = void 0;
    this.local$contentEntry = void 0;
    this.local$scoreTotal = void 0;
  }
  Coroutine$XapiPackageContentPresenter$onStop$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$XapiPackageContentPresenter$onStop$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$XapiPackageContentPresenter$onStop$lambda.prototype.constructor = Coroutine$XapiPackageContentPresenter$onStop$lambda;
  Coroutine$XapiPackageContentPresenter$onStop$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        this.state_0 = 2;
        this.result_0 = this.local$this$XapiPackageContentPresenter.db_0.contentEntryDao.findByUidAsync_s8cxhz$(this.local$this$XapiPackageContentPresenter.contentEntryUid_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$tmp$ = this.result_0;
        if (this.local$tmp$ == null) {
          return;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 3:
        this.local$contentEntry = this.local$tmp$;
        if (this.local$contentEntry.completionCriteria !== 1) {
          return;
        } else {
          this.state_0 = 4;
          continue;
        }
      case 4:
        this.state_0 = 5;
        this.result_0 = this.local$this$XapiPackageContentPresenter.db_0.statementDao.findCompletedScoreForSession_61zpoe$(this.local$this$XapiPackageContentPresenter.contextRegistration_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        var completedScore = this.result_0;
        this.local$scoreTotal = (tmp$ = completedScore != null ? completedScore.resultScore : null) != null ? tmp$ : 0;
        if (((tmp$_0 = completedScore != null ? completedScore.resultScaled : null) != null ? tmp$_0 : 0.0) === 0.0) {
          this.state_0 = 6;
          this.result_0 = this.local$this$XapiPackageContentPresenter.db_0.statementDao.calculateScoreForSession_61zpoe$(this.local$this$XapiPackageContentPresenter.contextRegistration_0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.local$tmp$_3 = completedScore;
          this.state_0 = 8;
          continue;
        }
      case 6:
        this.local$tmp$_2 = this.result_0;
        if (this.local$tmp$_2 == null) {
          return;
        } else {
          this.state_0 = 7;
          continue;
        }
      case 7:
        var score = this.local$tmp$_2;
        this.local$scoreTotal = score.resultScore;
        score.resultScaled = score.resultScore / score.resultMax;
        this.local$tmp$_3 = score;
        this.state_0 = 8;
        continue;
      case 8:
        var scoreForSession = this.local$tmp$_3;
        if (this.local$scoreTotal >= this.local$contentEntry.minScore) {
          return storeCompletedStatement(this.local$this$XapiPackageContentPresenter.statementEndpoint, this.local$this$XapiPackageContentPresenter.accountManager_0.activeAccount, this.local$contentEntry, this.local$this$XapiPackageContentPresenter.contextRegistration_0, scoreForSession, this.local$this$XapiPackageContentPresenter.clazzUid_0) , Unit;
        } else {
          this.state_0 = 9;
          continue;
        }
      case 9:
        return Unit;
      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 XapiPackageContentPresenter$onStop$lambda(this$XapiPackageContentPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$XapiPackageContentPresenter$onStop$lambda(this$XapiPackageContentPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  XapiPackageContentPresenter.prototype.onStop = function() {
  UstadBaseController.prototype.onStop.call(this);
  if (equals(this.accountManager_0.activeAccount.personUid, L0)) 
    return;
  launch(this.presenterScope, void 0, void 0, XapiPackageContentPresenter$onStop$lambda(this));
};
  function Coroutine$XapiPackageContentPresenter$onDestroy$lambda(this$XapiPackageContentPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$XapiPackageContentPresenter = this$XapiPackageContentPresenter_0;
  }
  Coroutine$XapiPackageContentPresenter$onDestroy$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$XapiPackageContentPresenter$onDestroy$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$XapiPackageContentPresenter$onDestroy$lambda.prototype.constructor = Coroutine$XapiPackageContentPresenter$onDestroy$lambda;
  Coroutine$XapiPackageContentPresenter$onDestroy$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$this$XapiPackageContentPresenter.mountedPath_0.length > 0) {
          this.state_0 = 2;
          this.result_0 = this.local$this$XapiPackageContentPresenter.mounter_0.unMountContainer_puj7f4$(this.local$this$XapiPackageContentPresenter.mountedEndpoint_0, this.local$this$XapiPackageContentPresenter.mountedPath_0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        return Unit;
      case 3:
        return Unit;
      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 XapiPackageContentPresenter$onDestroy$lambda(this$XapiPackageContentPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$XapiPackageContentPresenter$onDestroy$lambda(this$XapiPackageContentPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  XapiPackageContentPresenter.prototype.onDestroy = function() {
  launch(this.presenterScope, doorMainDispatcher(), void 0, XapiPackageContentPresenter$onDestroy$lambda(this));
  UstadBaseController.prototype.onDestroy.call(this);
};
  XapiPackageContentPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'XapiPackageContentPresenter', 
  interfaces: [UstadBaseController]};
  function PermissionManagementIncomingReplicationListener(db) {
    this.db_0 = db;
  }
  PermissionManagementIncomingReplicationListener.prototype.mapLongPropertyOrThrow_0 = function($receiver, propName) {
  var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
  var tmp$;
  tmp$ = $receiver.iterator();
  while (tmp$.hasNext()) {
    var item = tmp$.next();
    var tmp$_0 = destination.add_11rb$;
    var tmp$_1, tmp$_2, tmp$_3;
    tmp$_3 = (tmp$_2 = (tmp$_1 = get_jsonObject(item).get_11rb$(propName)) != null ? get_jsonPrimitive(tmp$_1) : null) != null ? get_long(tmp$_2) : null;
    if (tmp$_3 == null) {
      throw IllegalArgumentException_init('JsonArray does not have valid long property: ' + propName);
    }
    tmp$_0.call(destination, tmp$_3);
  }
  return destination;
};
  function Coroutine$onIncomingReplicationProcessed_hioxzo$_1($this, incomingReplicationEvent_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$destination = void 0;
    this.local$tmp$ = void 0;
    this.local$destination_0 = void 0;
    this.local$tmp$_0 = void 0;
    this.local$clazzUids = void 0;
    this.local$destination_1 = void 0;
    this.local$tmp$_1 = void 0;
    this.local$schoolUids = void 0;
    this.local$destination_2 = void 0;
    this.local$tmp$_2 = void 0;
    this.local$incomingReplicationEvent = incomingReplicationEvent_0;
  }
  Coroutine$onIncomingReplicationProcessed_hioxzo$_1.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onIncomingReplicationProcessed_hioxzo$_1.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onIncomingReplicationProcessed_hioxzo$_1.prototype.constructor = Coroutine$onIncomingReplicationProcessed_hioxzo$_1;
  Coroutine$onIncomingReplicationProcessed_hioxzo$_1.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var jsonArray = this.local$incomingReplicationEvent.incomingReplicationData;
        switch (this.local$incomingReplicationEvent.tableId) {
          case 679:
            var affectedNodes = this.$this.mapLongPropertyOrThrow_0(jsonArray, 'usClientNodeId');
            var tmp$;
            tmp$ = affectedNodes.iterator();
            while (tmp$.hasNext()) {
              var element = tmp$.next();
              get_replicationNotificationDispatcher(this.$this.db_0).onNewDoorNode_a4hdmt$(element, '');
            }
            this.state_0 = 16;
            continue;
          case 48:
            var affectedGroups = this.$this.mapLongPropertyOrThrow_0(jsonArray, 'sgGroupUid');
            var $receiver = chunked(affectedGroups, 100);
            this.local$destination = ArrayList_init();
            this.local$tmp$ = $receiver.iterator();
            this.state_0 = 13;
            continue;
          case 44:
            var personUids = this.$this.mapLongPropertyOrThrow_0(jsonArray, 'groupMemberPersonUid');
            var $receiver_0 = chunked(personUids, 100);
            this.local$destination_0 = ArrayList_init();
            this.local$tmp$_0 = $receiver_0.iterator();
            this.state_0 = 10;
            continue;
          case 6:
            this.local$clazzUids = this.$this.mapLongPropertyOrThrow_0(jsonArray, 'clazzUid');
            var $receiver_1 = chunked(this.local$clazzUids, 100);
            this.local$destination_1 = ArrayList_init();
            this.local$tmp$_1 = $receiver_1.iterator();
            this.state_0 = 7;
            continue;
          case 164:
            this.local$schoolUids = this.$this.mapLongPropertyOrThrow_0(jsonArray, 'schoolUid');
            var $receiver_2 = chunked(this.local$schoolUids, 100);
            this.local$destination_2 = ArrayList_init();
            this.local$tmp$_2 = $receiver_2.iterator();
            this.state_0 = 4;
            continue;
          case 65:
            var clazzUids = this.$this.mapLongPropertyOrThrow_0(jsonArray, 'clazzEnrolmentClazzUid');
            this.state_0 = 3;
            this.result_0 = this.$this.db_0.userSessionDao.findAllActiveNodeIdsWithClazzBasedPermission_gox9k8$(clazzUids, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          case 200:
            var schoolUids = this.$this.mapLongPropertyOrThrow_0(jsonArray, 'schoolMemberSchoolUid');
            this.state_0 = 2;
            this.result_0 = this.$this.db_0.userSessionDao.findAllActiveNodeIdsWithSchoolBasedPermission_gox9k8$(schoolUids, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        var affectedNodes_0 = this.result_0;
        var tmp$_0;
        tmp$_0 = affectedNodes_0.iterator();
        while (tmp$_0.hasNext()) {
          var element_0 = tmp$_0.next();
          get_replicationNotificationDispatcher(this.$this.db_0).onNewDoorNode_a4hdmt$(element_0, '');
        }
        this.state_0 = 16;
        continue;
      case 3:
        var affectedNodes_1 = this.result_0;
        var tmp$_1;
        tmp$_1 = affectedNodes_1.iterator();
        while (tmp$_1.hasNext()) {
          var element_1 = tmp$_1.next();
          get_replicationNotificationDispatcher(this.$this.db_0).onNewDoorNode_a4hdmt$(element_1, '');
        }
        this.state_0 = 16;
        continue;
      case 4:
        if (!this.local$tmp$_2.hasNext()) {
          this.state_0 = 6;
          continue;
        }
        var element_2 = this.local$tmp$_2.next();
        this.state_0 = 5;
        this.result_0 = this.$this.db_0.userSessionDao.findAllActiveNodeIdsWithSchoolBasedPermission_gox9k8$(this.local$schoolUids, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        var list = this.result_0;
        addAll(this.local$destination_2, list);
        this.state_0 = 4;
        continue;
      case 6:
        var affectedNodes_2 = this.local$destination_2;
        var tmp$_2;
        tmp$_2 = affectedNodes_2.iterator();
        while (tmp$_2.hasNext()) {
          var element_3 = tmp$_2.next();
          get_replicationNotificationDispatcher(this.$this.db_0).onNewDoorNode_a4hdmt$(element_3, '');
        }
        this.state_0 = 16;
        continue;
      case 7:
        if (!this.local$tmp$_1.hasNext()) {
          this.state_0 = 9;
          continue;
        }
        var element_4 = this.local$tmp$_1.next();
        this.state_0 = 8;
        this.result_0 = this.$this.db_0.userSessionDao.findAllActiveNodeIdsWithClazzBasedPermission_gox9k8$(this.local$clazzUids, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 8:
        var list_0 = this.result_0;
        addAll(this.local$destination_1, list_0);
        this.state_0 = 7;
        continue;
      case 9:
        var affectedNodes_3 = toSet(this.local$destination_1);
        var tmp$_3;
        tmp$_3 = affectedNodes_3.iterator();
        while (tmp$_3.hasNext()) {
          var element_5 = tmp$_3.next();
          get_replicationNotificationDispatcher(this.$this.db_0).onNewDoorNode_a4hdmt$(element_5, '');
        }
        this.state_0 = 16;
        continue;
      case 10:
        if (!this.local$tmp$_0.hasNext()) {
          this.state_0 = 12;
          continue;
        }
        var element_6 = this.local$tmp$_0.next();
        this.state_0 = 11;
        this.result_0 = this.$this.db_0.userSessionDao.findActiveNodeIdsByPersonUids_gox9k8$(element_6, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 11:
        var list_1 = this.result_0;
        addAll(this.local$destination_0, list_1);
        this.state_0 = 10;
        continue;
      case 12:
        var affectedNodes_4 = toSet(this.local$destination_0);
        var tmp$_4;
        tmp$_4 = affectedNodes_4.iterator();
        while (tmp$_4.hasNext()) {
          var element_7 = tmp$_4.next();
          get_replicationNotificationDispatcher(this.$this.db_0).onNewDoorNode_a4hdmt$(element_7, '');
        }
        this.state_0 = 16;
        continue;
      case 13:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 15;
          continue;
        }
        var element_8 = this.local$tmp$.next();
        this.state_0 = 14;
        this.result_0 = this.$this.db_0.userSessionDao.findActiveNodesIdsByGroupUids_gox9k8$(element_8, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 14:
        var list_2 = this.result_0;
        addAll(this.local$destination, list_2);
        this.state_0 = 13;
        continue;
      case 15:
        var affectedNodes_5 = toSet(this.local$destination);
        var tmp$_5;
        tmp$_5 = affectedNodes_5.iterator();
        while (tmp$_5.hasNext()) {
          var element_9 = tmp$_5.next();
          get_replicationNotificationDispatcher(this.$this.db_0).onNewDoorNode_a4hdmt$(element_9, '');
        }
        this.state_0 = 16;
        continue;
      case 16:
        return;
      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);
};
  PermissionManagementIncomingReplicationListener.prototype.onIncomingReplicationProcessed_hioxzo$ = function(incomingReplicationEvent_0, continuation_0, suspended) {
  var instance = new Coroutine$onIncomingReplicationProcessed_hioxzo$_1(this, incomingReplicationEvent_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  PermissionManagementIncomingReplicationListener.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'PermissionManagementIncomingReplicationListener', 
  interfaces: [IncomingReplicationListener]};
  function RepSubscriptionInitListener() {
  }
  function Coroutine$RepSubscriptionInitListener$onSubscriptionInitialized$lambda(closure$remoteNodeId_0, closure$repo_0, transactDb_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$remoteNodeId = closure$remoteNodeId_0;
    this.local$closure$repo = closure$repo_0;
    this.local$systemPerson = void 0;
    this.local$transactDb = transactDb_0;
  }
  Coroutine$RepSubscriptionInitListener$onSubscriptionInitialized$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$RepSubscriptionInitListener$onSubscriptionInitialized$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$RepSubscriptionInitListener$onSubscriptionInitialized$lambda.prototype.constructor = Coroutine$RepSubscriptionInitListener$onSubscriptionInitialized$lambda;
  Coroutine$RepSubscriptionInitListener$onSubscriptionInitialized$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$transactDb.personDao.findSystemAccount_s8cxhz$(this.local$closure$remoteNodeId, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (this.result_0 == null) {
          var $receiver = new Person();
          var closure$repo = this.local$closure$repo;
          var closure$remoteNodeId = this.local$closure$remoteNodeId;
          $receiver.username = closure$repo.config.endpoint;
          $receiver.personType = 1;
          $receiver.dateOfBirth = closure$remoteNodeId;
          this.state_0 = 3;
          this.result_0 = insertPersonAndGroup(this.local$transactDb, $receiver, void 0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 6;
          continue;
        }
      case 3:
        this.local$systemPerson = this.result_0;
        this.state_0 = 4;
        this.result_0 = grantScopedPermission_0(this.local$transactDb, this.local$systemPerson, Long$Companion$MAX_VALUE, -2, ScopedGrant$Companion$ALL_ENTITIES, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        var tmp$ = this.local$transactDb.userSessionDao;
        var $receiver_0 = new UserSession();
        $receiver_0.usClientNodeId = this.local$closure$remoteNodeId;
        $receiver_0.usPersonUid = this.local$systemPerson.personUid;
        $receiver_0.usEndTime = Long$Companion$MAX_VALUE;
        $receiver_0.usStartTime = systemTimeInMillis();
        $receiver_0.usStatus = 1;
        $receiver_0.usSessionType = 2;
        this.state_0 = 5;
        this.result_0 = tmp$.insertSession_g3losl$($receiver_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        return Unit;
      case 6:
        return Unit;
      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 RepSubscriptionInitListener$onSubscriptionInitialized$lambda(closure$remoteNodeId_0, closure$repo_0) {
    return function(transactDb_0, continuation_0, suspended) {
  var instance = new Coroutine$RepSubscriptionInitListener$onSubscriptionInitialized$lambda(closure$remoteNodeId_0, closure$repo_0, transactDb_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$onSubscriptionInitialized_v2eoxc$($this, repo_0, remoteNodeId_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$repo = repo_0;
    this.local$remoteNodeId = remoteNodeId_0;
  }
  Coroutine$onSubscriptionInitialized_v2eoxc$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$onSubscriptionInitialized_v2eoxc$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$onSubscriptionInitialized_v2eoxc$.prototype.constructor = Coroutine$onSubscriptionInitialized_v2eoxc$;
  Coroutine$onSubscriptionInitialized_v2eoxc$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.state_0 = 2;
        this.result_0 = withDoorTransactionAsync(Kotlin.isType(tmp$ = this.local$repo, UmAppDatabase) ? tmp$ : throwCCE(), getKClass(UmAppDatabase), RepSubscriptionInitListener$onSubscriptionInitialized$lambda(this.local$remoteNodeId, this.local$repo), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        return;
      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);
};
  RepSubscriptionInitListener.prototype.onSubscriptionInitialized_v2eoxc$ = function(repo_0, remoteNodeId_0, continuation_0, suspended) {
  var instance = new Coroutine$onSubscriptionInitialized_v2eoxc$(this, repo_0, remoteNodeId_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  RepSubscriptionInitListener.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'RepSubscriptionInitListener', 
  interfaces: [ReplicationSubscriptionManager$SubscriptionInitializedListener]};
  function AppConfig() {
    AppConfig_instance = this;
    this.KEY_CONTENT_DIR_NAME = 'content_dir';
    this.KEY_LOGIN_REQUIRED_FOR_CONTENT_OPEN = 'app.login_before_open';
    this.KEY_LOGIN_REQUIRED_FOR_CONTENT_DOWNLOAD = 'login_before_download';
    this.KEY_FIRST_DEST = 'first_dest';
    this.KEY_FIRST_DEST_LOGIN_REQUIRED = 'first_dest_login_required';
    this.KEY_API_URL = 'apiUrl';
    this.KEY_APP_BASE_NAME = 'appBaseName';
    this.KEY_SUPPORTED_LANGUAGES = 'app.ui_languages';
    this.KEY_DEFAULT_LANGUAGE = 'app.ui_default_language';
    this.KEY_ALLOW_GUEST_LOGIN = 'app.guest_allowed';
    this.KEY_ALLOW_REGISTRATION = 'app.register_allowed';
    this.KEY_ALLOW_SERVER_SELECTION = 'app.select_server';
    this.KEY_NO_IFRAME = 'app.no_iframe_domans';
    this.KEY_CONTENT_ONLY_MODE = 'app.content_only_mode';
    this.KEY_PBKDF2_ITERATIONS = 'pbkdf2.iterations';
    this.KEY_PBKDF2_KEYLENGTH = 'pbkdf2.keylength';
  }
  AppConfig.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'AppConfig', 
  interfaces: []};
  var AppConfig_instance = null;
  function AppConfig_getInstance() {
    if (AppConfig_instance === null) {
      new AppConfig();
    }
    return AppConfig_instance;
  }
  function AppErrorCode() {
    AppErrorCode_instance = this;
    this.ERROR_PARENT_JOIN_NOT_FOUND = 10024;
  }
  AppErrorCode.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'AppErrorCode', 
  interfaces: []};
  var AppErrorCode_instance = null;
  function AppErrorCode_getInstance() {
    if (AppErrorCode_instance === null) {
      new AppErrorCode();
    }
    return AppErrorCode_instance;
  }
  function ContainerMountRequest(containerUri, isEpubMode) {
    this.containerUri = containerUri;
    this.isEpubMode = isEpubMode;
  }
  ContainerMountRequest.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContainerMountRequest', 
  interfaces: []};
  function ContainerStorageDir(dirUri, name, usableSpace, removableMedia) {
    if (name === void 0) 
      name = null;
    if (usableSpace === void 0) 
      usableSpace = L_1;
    if (removableMedia === void 0) 
      removableMedia = false;
    this.dirUri = dirUri;
    this.name = name;
    this.usableSpace = usableSpace;
    this.removableMedia = removableMedia;
  }
  ContainerStorageDir.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContainerStorageDir', 
  interfaces: []};
  function ErrorCodeException(errorCode, message, cause) {
    if (cause === void 0) 
      cause = null;
    Exception.call(this, message, cause);
    this.errorCode = errorCode;
    this.name = 'ErrorCodeException';
  }
  ErrorCodeException.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ErrorCodeException', 
  interfaces: [Exception]};
  function NavigateForResultOptions(fromPresenter, currentEntityValue, destinationViewName, entityClass, serializationStrategy, destinationResultKey, overwriteDestination, arguments_0) {
    if (destinationResultKey === void 0) 
      destinationResultKey = null;
    if (overwriteDestination === void 0) 
      overwriteDestination = null;
    if (arguments_0 === void 0) {
      arguments_0 = LinkedHashMap_init();
    }
    this.fromPresenter = fromPresenter;
    this.currentEntityValue = currentEntityValue;
    this.destinationViewName = destinationViewName;
    this.entityClass = entityClass;
    this.serializationStrategy = serializationStrategy;
    this.destinationResultKey = destinationResultKey;
    this.arguments = arguments_0;
    this.overwriteDestination = overwriteDestination != null ? overwriteDestination : Kotlin.isType(this.fromPresenter, UstadEditPresenter);
  }
  NavigateForResultOptions.prototype.copy_xs9go5$ = function(newEntityValue, newArguments) {
  if (newArguments === void 0) 
    newArguments = this.arguments;
  return new NavigateForResultOptions(this.fromPresenter, newEntityValue, this.destinationViewName, this.entityClass, this.serializationStrategy, this.destinationResultKey, this.overwriteDestination, newArguments);
};
  NavigateForResultOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'NavigateForResultOptions', 
  interfaces: []};
  function NoAppFoundException(message, mimeType) {
    Exception_init(message, this);
    this.mimeType = mimeType;
    this.name = 'NoAppFoundException';
  }
  NoAppFoundException.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'NoAppFoundException', 
  interfaces: [Exception]};
  function UMLog() {
    UMLog$Companion_getInstance();
  }
  function UMLog$Companion() {
    UMLog$Companion_instance = this;
    this.CRITICAL = 0;
    this.ERROR = 1;
    this.WARN = 2;
    this.INFO = 3;
    this.VERBOSE = 4;
    this.DEBUG = 5;
  }
  UMLog$Companion.prototype.l_svtel2$ = function(level, code, message, exception) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5;
  var logMessage = code.toString() + ' : ' + toString(message);
  switch (level) {
    case 5:
      napier.Napier.d_82mfvz$(logMessage, Kotlin.isType(tmp$ = exception, Exception) ? tmp$ : throwCCE());
      break;
    case 3:
      napier.Napier.i_82mfvz$(logMessage, Kotlin.isType(tmp$_0 = exception, Exception) ? tmp$_0 : throwCCE());
      break;
    case 0:
      napier.Napier.wtf_82mfvz$(logMessage, Kotlin.isType(tmp$_1 = exception, Exception) ? tmp$_1 : throwCCE());
      break;
    case 2:
      napier.Napier.w_82mfvz$(logMessage, Kotlin.isType(tmp$_2 = exception, Exception) ? tmp$_2 : throwCCE());
      break;
    case 4:
      napier.Napier.v_82mfvz$(logMessage, Kotlin.isType(tmp$_3 = exception, Exception) ? tmp$_3 : throwCCE());
      break;
    case 1:
      napier.Napier.e_82mfvz$(logMessage, Kotlin.isType(tmp$_4 = exception, Exception) ? tmp$_4 : throwCCE());
      break;
    default:
      napier.Napier.d_82mfvz$(logMessage, Kotlin.isType(tmp$_5 = exception, Exception) ? tmp$_5 : throwCCE());
      break;
  }
};
  UMLog$Companion.prototype.l_273qip$ = function(level, code, message) {
  var logMessage = code.toString() + ' : ' + toString(message);
  switch (level) {
    case 5:
      napier.Napier.d_82mfvz$(logMessage);
      break;
    case 3:
      napier.Napier.i_82mfvz$(logMessage);
      break;
    case 0:
      napier.Napier.wtf_82mfvz$(logMessage);
      break;
    case 2:
      napier.Napier.w_82mfvz$(logMessage);
      break;
    case 4:
      napier.Napier.v_82mfvz$(logMessage);
      break;
    case 1:
      napier.Napier.e_82mfvz$(logMessage);
      break;
    default:
      napier.Napier.d_82mfvz$(logMessage);
      break;
  }
};
  UMLog$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var UMLog$Companion_instance = null;
  function UMLog$Companion_getInstance() {
    if (UMLog$Companion_instance === null) {
      new UMLog$Companion();
    }
    return UMLog$Companion_instance;
  }
  UMLog.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UMLog', 
  interfaces: []};
  function UstadMobileConstants() {
    UstadMobileConstants_instance = this;
    this.UTF8 = 'UTF-8';
    this.LOCALE_CODE = 0;
    this.LANGUAGE_NAMES = mapOf([to('en', 'English'), to('tg', '\u0422\u043e\u04b7\u0438\u043a\u04e3'), to('ps', '\u067e\u069a\u062a\u0648'), to('fa', '\u062f\u0631\u06cc'), to('ar', '\u0627\u0644\u0639\u0631\u0628\u064a\u0629'), to('bn', '\u09ac\u09be\u0982\u09b2\u09be'), to('ne', '\u0928\u0947\u092a\u093e\u0932\u0940'), to('my', '\u1019\u103c\u1014\u103a\u1019\u102c\u1005\u102c'), to('ru', '\u0420\u0443\u0441\u0441\u043a\u0438\u0439'), to('rw', 'Kinyarwanda')]);
    this.RTL_LANGUAGES = ['ar', 'arc', 'dv', 'fa', 'ha', 'he', 'khw', 'ks', 'ku', 'ps', 'ur', 'yi'];
    this.MINOR_AGE_THRESHOLD = 13;
    this.ADULT_AGE_THRESHOLD = 18;
    this.PBKDF2_ITERATIONS = 10000;
    this.PBKDF2_KEYLENGTH = 512;
  }
  UstadMobileConstants.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'UstadMobileConstants', 
  interfaces: []};
  var UstadMobileConstants_instance = null;
  function UstadMobileConstants_getInstance() {
    if (UstadMobileConstants_instance === null) {
      new UstadMobileConstants();
    }
    return UstadMobileConstants_instance;
  }
  function UstadMobileDefaults() {
    UstadMobileDefaults_instance = this;
    this.DEFAULT_XAPI_STATEMENTS_PATH = '/statements/';
    this.DEFAULT_OPDS_SERVER = '/opds/';
    this.DEFAULT_REGISTER_SERVER = '/phoneinappreg/';
    this.DEFAULT_GEOIP_SERVER = 'https://freegeoip.net/json/';
    this.DEFAULT_TINCAN_PREFIX = 'http://www.ustadmobile.com/um-tincan/';
    this.DEFAULT_ROLE_ENDPOINT = '/isteacher/';
    this.DEFAULT_CLASSLIST_ENDPOINT = '/teacherclasses/';
    this.DEFAULT_STUDENTLIST_ENDPOINT = '/allclassstudents/';
  }
  UstadMobileDefaults.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'UstadMobileDefaults', 
  interfaces: []};
  var UstadMobileDefaults_instance = null;
  function UstadMobileDefaults_getInstance() {
    if (UstadMobileDefaults_instance === null) {
      new UstadMobileDefaults();
    }
    return UstadMobileDefaults_instance;
  }
  function UstadMobileSystemCommon() {
    UstadMobileSystemCommon$Companion_getInstance();
    this.networkManager = null;
    this.locale_67r8vs$_0 = '';
    this.lastDestination_8be2vx$ = null;
  }
  function UstadMobileSystemCommon$LastGoToDest(viewName, args) {
    this.viewName = viewName;
    this.args = args;
  }
  UstadMobileSystemCommon$LastGoToDest.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'LastGoToDest', 
  interfaces: []};
  UstadMobileSystemCommon$LastGoToDest.prototype.component1 = function() {
  return this.viewName;
};
  UstadMobileSystemCommon$LastGoToDest.prototype.component2 = function() {
  return this.args;
};
  UstadMobileSystemCommon$LastGoToDest.prototype.copy_158qjc$ = function(viewName, args) {
  return new UstadMobileSystemCommon$LastGoToDest(viewName === void 0 ? this.viewName : viewName, args === void 0 ? this.args : args);
};
  UstadMobileSystemCommon$LastGoToDest.prototype.toString = function() {
  return 'LastGoToDest(viewName=' + Kotlin.toString(this.viewName) + (', args=' + Kotlin.toString(this.args)) + ')';
};
  UstadMobileSystemCommon$LastGoToDest.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.viewName) | 0;
  result = result * 31 + Kotlin.hashCode(this.args) | 0;
  return result;
};
  UstadMobileSystemCommon$LastGoToDest.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.viewName, other.viewName) && Kotlin.equals(this.args, other.args)))));
};
  function UstadMobileSystemCommon$UstadGoOptions(popUpToViewName, popUpToInclusive, serializer) {
    UstadMobileSystemCommon$UstadGoOptions$Companion_getInstance();
    if (popUpToViewName === void 0) 
      popUpToViewName = null;
    if (popUpToInclusive === void 0) 
      popUpToInclusive = false;
    if (serializer === void 0) 
      serializer = null;
    this.popUpToViewName = popUpToViewName;
    this.popUpToInclusive = popUpToInclusive;
    this.serializer = serializer;
  }
  function UstadMobileSystemCommon$UstadGoOptions$Companion() {
    UstadMobileSystemCommon$UstadGoOptions$Companion_instance = this;
    this.Default = new UstadMobileSystemCommon$UstadGoOptions(null, false);
  }
  UstadMobileSystemCommon$UstadGoOptions$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var UstadMobileSystemCommon$UstadGoOptions$Companion_instance = null;
  function UstadMobileSystemCommon$UstadGoOptions$Companion_getInstance() {
    if (UstadMobileSystemCommon$UstadGoOptions$Companion_instance === null) {
      new UstadMobileSystemCommon$UstadGoOptions$Companion();
    }
    return UstadMobileSystemCommon$UstadGoOptions$Companion_instance;
  }
  UstadMobileSystemCommon$UstadGoOptions.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UstadGoOptions', 
  interfaces: []};
  UstadMobileSystemCommon$UstadGoOptions.prototype.component1 = function() {
  return this.popUpToViewName;
};
  UstadMobileSystemCommon$UstadGoOptions.prototype.component2 = function() {
  return this.popUpToInclusive;
};
  UstadMobileSystemCommon$UstadGoOptions.prototype.component3 = function() {
  return this.serializer;
};
  UstadMobileSystemCommon$UstadGoOptions.prototype.copy_1cimlr$ = function(popUpToViewName, popUpToInclusive, serializer) {
  return new UstadMobileSystemCommon$UstadGoOptions(popUpToViewName === void 0 ? this.popUpToViewName : popUpToViewName, popUpToInclusive === void 0 ? this.popUpToInclusive : popUpToInclusive, serializer === void 0 ? this.serializer : serializer);
};
  UstadMobileSystemCommon$UstadGoOptions.prototype.toString = function() {
  return 'UstadGoOptions(popUpToViewName=' + Kotlin.toString(this.popUpToViewName) + (', popUpToInclusive=' + Kotlin.toString(this.popUpToInclusive)) + (', serializer=' + Kotlin.toString(this.serializer)) + ')';
};
  UstadMobileSystemCommon$UstadGoOptions.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.popUpToViewName) | 0;
  result = result * 31 + Kotlin.hashCode(this.popUpToInclusive) | 0;
  result = result * 31 + Kotlin.hashCode(this.serializer) | 0;
  return result;
};
  UstadMobileSystemCommon$UstadGoOptions.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.popUpToViewName, other.popUpToViewName) && Kotlin.equals(this.popUpToInclusive, other.popUpToInclusive) && Kotlin.equals(this.serializer, other.serializer)))));
};
  UstadMobileSystemCommon.prototype.getAppConfigDefaultFirstDest_za3rmp$ = function(context) {
  var tmp$;
  return (tmp$ = this.getAppConfigString(AppConfig_getInstance().KEY_FIRST_DEST, null, context)) != null ? tmp$ : ContentEntryList2View$Companion_getInstance().VIEW_NAME_HOME;
};
  function UstadMobileSystemCommon$goToDeepLink$lambda$lambda(closure$endpointUrl) {
    return function(it) {
  return equals(it, closure$endpointUrl);
};
  }
  function Coroutine$UstadMobileSystemCommon$goToDeepLink$lambda(closure$accountManager_0, closure$maxDateOfBirth_0, closure$endpointUrl_0, closure$viewUri_0, closure$context_0, this$UstadMobileSystemCommon_0, closure$intentMessage_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$accountManager = closure$accountManager_0;
    this.local$closure$maxDateOfBirth = closure$maxDateOfBirth_0;
    this.local$closure$endpointUrl = closure$endpointUrl_0;
    this.local$closure$viewUri = closure$viewUri_0;
    this.local$closure$context = closure$context_0;
    this.local$this$UstadMobileSystemCommon = this$UstadMobileSystemCommon_0;
    this.local$closure$intentMessage = closure$intentMessage_0;
  }
  Coroutine$UstadMobileSystemCommon$goToDeepLink$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$UstadMobileSystemCommon$goToDeepLink$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$UstadMobileSystemCommon$goToDeepLink$lambda.prototype.constructor = Coroutine$UstadMobileSystemCommon$goToDeepLink$lambda;
  Coroutine$UstadMobileSystemCommon$goToDeepLink$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$closure$accountManager.activeSessionCount_6ttg7a$(this.local$closure$maxDateOfBirth, UstadMobileSystemCommon$goToDeepLink$lambda$lambda(this.local$closure$endpointUrl), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (this.result_0 > 0) {
          var args = mapOf([to(UstadView$Companion_getInstance().ARG_NEXT, this.local$closure$viewUri), to(AccountListView$Companion_getInstance().ARG_FILTER_BY_ENDPOINT, this.local$closure$endpointUrl), to(AccountListView$Companion_getInstance().ARG_ACTIVE_ACCOUNT_MODE, AccountListView$Companion_getInstance().ACTIVE_ACCOUNT_MODE_INLIST), to(UstadView$Companion_getInstance().ARG_TITLE, this.local$this$UstadMobileSystemCommon.getString(2706, this.local$closure$context)), to(UstadView$Companion_getInstance().ARG_INTENT_MESSAGE, this.local$closure$intentMessage), to(UstadView$Companion_getInstance().ARG_LISTMODE, ListViewMode$PICKER_getInstance().toString()), to(UstadView$Companion_getInstance().ARG_MAX_DATE_OF_BIRTH, this.local$closure$maxDateOfBirth.toString())]);
          return this.local$this$UstadMobileSystemCommon.go_gofqk3$(AccountListView$Companion_getInstance().VIEW_NAME, args, this.local$closure$context) , Unit;
        } else {
          var args_0 = mapOf([to(UstadView$Companion_getInstance().ARG_NEXT, this.local$closure$viewUri), to(UstadView$Companion_getInstance().ARG_INTENT_MESSAGE, this.local$closure$intentMessage), to(UstadView$Companion_getInstance().ARG_SERVER_URL, this.local$closure$endpointUrl)]);
          return this.local$this$UstadMobileSystemCommon.go_gofqk3$(Login2View$Companion_getInstance().VIEW_NAME, args_0, this.local$closure$context) , Unit;
        }
      case 3:
        return;
      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 UstadMobileSystemCommon$goToDeepLink$lambda(closure$accountManager_0, closure$maxDateOfBirth_0, closure$endpointUrl_0, closure$viewUri_0, closure$context_0, this$UstadMobileSystemCommon_0, closure$intentMessage_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$UstadMobileSystemCommon$goToDeepLink$lambda(closure$accountManager_0, closure$maxDateOfBirth_0, closure$endpointUrl_0, closure$viewUri_0, closure$context_0, this$UstadMobileSystemCommon_0, closure$intentMessage_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  UstadMobileSystemCommon.prototype.goToDeepLink_dfpk30$ = function(deepLink, accountManager, context) {
  var tmp$;
  if (contains(deepLink, UstadMobileSystemCommon$Companion_getInstance().LINK_ENDPOINT_VIEWNAME_DIVIDER)) {
    var endpointUrl = requirePostfix(substringBefore(deepLink, UstadMobileSystemCommon$Companion_getInstance().LINK_ENDPOINT_VIEWNAME_DIVIDER), '/');
    var viewUri = substringAfter(deepLink, UstadMobileSystemCommon$Companion_getInstance().LINK_ENDPOINT_VIEWNAME_DIVIDER);
    var intentMessage = replace(this.getString(2707, context), '%1$s', deepLink);
    if (startsWith(viewUri, ParentalConsentManagementView$Companion_getInstance().VIEW_NAME)) {
      tmp$ = DateTime.Companion.now().minus_glepj8$(new MonthSpan_init(12 * UstadMobileConstants_getInstance().ADULT_AGE_THRESHOLD | 0)).unixMillisLong;
    } else {
      tmp$ = L0;
    }
    var maxDateOfBirth = tmp$;
    launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, UstadMobileSystemCommon$goToDeepLink$lambda(accountManager, maxDateOfBirth, endpointUrl, viewUri, context, this, intentMessage));
  }
};
  UstadMobileSystemCommon.prototype.goToViewLink_yzvld8$$default = function(destination, context, ustadGoOptions) {
  var destinationQueryPos = indexOf_0(destination, 63);
  if (destinationQueryPos === -1) {
    this.go_henhri$(destination, emptyMap(), context, ustadGoOptions);
  } else {
    var destArgs = UMFileUtil_getInstance().parseURLQueryString(destination);
    this.go_henhri$(destination.substring(0, destinationQueryPos), destArgs, context, ustadGoOptions);
  }
};
  UstadMobileSystemCommon.prototype.goToViewLink_yzvld8$ = function(destination, context, ustadGoOptions, callback$default) {
  if (ustadGoOptions === void 0) 
    ustadGoOptions = new UstadMobileSystemCommon$UstadGoOptions();
    callback$default ? callback$default(destination, context, ustadGoOptions) : this.goToViewLink_yzvld8$$default(destination, context, ustadGoOptions);
};
  UstadMobileSystemCommon.prototype.go_gofqk3$ = function(viewName, args, context) {
  this.go(viewName, args, context, 0, new UstadMobileSystemCommon$UstadGoOptions(null, false));
};
  UstadMobileSystemCommon.prototype.go_henhri$ = function(viewName, args, context, ustadGoOptions) {
  this.go(viewName, args, context, 0, ustadGoOptions);
};
  UstadMobileSystemCommon.prototype.getLocale = function(context) {
  return this.getAppPref_rjah4r$(UstadMobileSystemCommon$Companion_getInstance().PREFKEY_LOCALE, UstadMobileSystemCommon$Companion_getInstance().LOCALE_USE_SYSTEM, context);
};
  UstadMobileSystemCommon.prototype.setLocale = function(locale, context) {
  this.setAppPref_5pkmrg$(UstadMobileSystemCommon$Companion_getInstance().PREFKEY_LOCALE, locale, context);
};
  UstadMobileSystemCommon.prototype.getAppPref_rjah4r$ = function(key, defaultVal, context) {
  var valFound = this.getAppPref(key, context);
  return valFound != null ? valFound : defaultVal;
};
  UstadMobileSystemCommon.prototype.getOrPutAppPref_ymr649$ = function(key, context, block) {
  var tmp$;
  var tmp$_0;
  if ((tmp$ = this.getAppPref(key, context)) != null) 
    tmp$_0 = tmp$;
  else {
    var $receiver = block();
    this.setAppPref_5pkmrg$(key, $receiver, context);
    tmp$_0 = $receiver;
  }
  return tmp$_0;
};
  UstadMobileSystemCommon.prototype.getDisplayedLocale_za3rmp$ = function(context) {
  var locale = this.getLocale(context);
  if (equals(locale, UstadMobileSystemCommon$Companion_getInstance().LOCALE_USE_SYSTEM)) 
    locale = this.getSystemLocale(context);
  return locale.substring(0, 2);
};
  UstadMobileSystemCommon.prototype.getAllUiLanguage = function(context) {
  var tmp$;
  tmp$ = this.getAppConfigString(AppConfig_getInstance().KEY_SUPPORTED_LANGUAGES, '', context);
  if (tmp$ == null) {
    throw IllegalStateException_init('No SUPPORTED LANGUAGES IN APPCONFIG!');
  }
  var languagesConfigVal = tmp$;
  var languageList = split(languagesConfigVal, [',']);
  var destination = ArrayList_init_0(collectionSizeOrDefault(languageList, 10));
  var tmp$_0;
  tmp$_0 = languageList.iterator();
  while (tmp$_0.hasNext()) {
    var item = tmp$_0.next();
    var tmp$_1;
    destination.add_11rb$(to(item, (tmp$_1 = UstadMobileConstants_getInstance().LANGUAGE_NAMES.get_11rb$(item)) != null ? tmp$_1 : item));
  }
  return toMap_0(destination);
};
  UstadMobileSystemCommon.prototype.getAllUiLanguagesList = function(context) {
  var tmp$;
  tmp$ = this.getAppConfigString(AppConfig_getInstance().KEY_SUPPORTED_LANGUAGES, '', context);
  if (tmp$ == null) {
    throw IllegalStateException_init('No SUPPORTED LANGUAGES IN APPCONFIG!');
  }
  var languagesConfigVal = tmp$;
  var availableLangs = sorted(split(languagesConfigVal, [',']));
  var tmp$_0 = listOf_0(to(UstadMobileSystemCommon$Companion_getInstance().LOCALE_USE_SYSTEM, this.getString(2548, context)));
  var destination = ArrayList_init_0(collectionSizeOrDefault(availableLangs, 10));
  var tmp$_1;
  tmp$_1 = availableLangs.iterator();
  while (tmp$_1.hasNext()) {
    var item = tmp$_1.next();
    var tmp$_2;
    destination.add_11rb$(to(item, (tmp$_2 = UstadMobileConstants_getInstance().LANGUAGE_NAMES.get_11rb$(item)) != null ? tmp$_2 : item));
  }
  return plus_0(tmp$_0, destination);
};
  UstadMobileSystemCommon.prototype.getMimeTypeFromExtension_61zpoe$ = function(extension) {
  return UstadMobileSystemCommon$Companion_getInstance().MIME_TYPES_REVERSE_0.containsKey_11rb$(extension) ? UstadMobileSystemCommon$Companion_getInstance().MIME_TYPES_REVERSE_0.get_11rb$(extension) : null;
};
  UstadMobileSystemCommon.prototype.getExtensionFromMimeType_61zpoe$ = function(mimeType) {
  var tmp$;
  if (UstadMobileSystemCommon$Companion_getInstance().MIME_TYPES_0.containsKey_11rb$(mimeType)) {
    tmp$ = UstadMobileSystemCommon$Companion_getInstance().MIME_TYPES_0.get_11rb$(mimeType);
  } else 
    tmp$ = null;
  return tmp$;
};
  UstadMobileSystemCommon.prototype.getAppConfigBoolean_k4he51$_0 = function(key, defaultVal, context) {
  var tmp$;
  var strVal = this.getAppConfigString(key, null, context);
  return (tmp$ = strVal != null ? toBoolean(strVal) : null) != null ? tmp$ : defaultVal;
};
  UstadMobileSystemCommon.prototype.getAppConfigBoolean_bm4g0d$ = function(key, context) {
  return this.getAppConfigBoolean_k4he51$_0(key, false, context);
};
  UstadMobileSystemCommon.prototype.getAppConfigInt_3m4wor$ = function(key, defaultVal, context) {
  return toInt(ensureNotNull(this.getAppConfigString(key, '' + toString(defaultVal), context)));
};
  UstadMobileSystemCommon.prototype.hasDisplayedLocaleChanged_9d61t6$ = function(oldLocale, context) {
  var currentlyDisplayedLocale = this.getDisplayedLocale_za3rmp$(context);
  var tmp$ = currentlyDisplayedLocale != null && oldLocale != null;
  if (tmp$) {
    tmp$ = equals(oldLocale.substring(0, 2), currentlyDisplayedLocale.substring(0, 2));
  }
  return !tmp$;
};
  UstadMobileSystemCommon.prototype.getContentDirName_za3rmp$ = function(context) {
  return this.getAppConfigString(AppConfig_getInstance().KEY_CONTENT_DIR_NAME, UstadMobileSystemCommon$Companion_getInstance().DEFAULT_CONTENT_DIR_NAME_0, context);
};
  UstadMobileSystemCommon.prototype.handleClickLink_dfpk30$ = function(url, accountManager, context) {
  if (contains(url, UstadMobileSystemCommon$Companion_getInstance().LINK_ENDPOINT_VIEWNAME_DIVIDER)) {
    var components = UstadUrlComponents$Companion_getInstance().parse_puj7f4$(url);
    if (equals(components.endpoint, accountManager.activeEndpoint.url)) {
      this.goToViewLink_yzvld8$(components.viewUri, context);
    } else {
      this.goToDeepLink_dfpk30$(url, accountManager, context);
    }
  } else {
    this.openLinkInBrowser_bm4g0d$(url, context);
  }
};
  UstadMobileSystemCommon.prototype.openFileInDefaultViewer_t9zcln$ = function(context, doorUri, mimeType, fileName, callback$default) {
  if (fileName === void 0) 
    fileName = null;
    callback$default ? callback$default(context, doorUri, mimeType, fileName) : this.openFileInDefaultViewer_t9zcln$$default(context, doorUri, mimeType, fileName);
};
  function UstadMobileSystemCommon$Companion() {
    UstadMobileSystemCommon$Companion_instance = this;
    this.MIME_TYPES_0 = mapOf([to('image/jpg', 'jpg'), to('image/jpg', 'jpg'), to('image/jpeg', 'jpg'), to('image/png', 'png'), to('image/gif', 'gif'), to('image/svg', 'svg'), to('application/epub+zip', 'epub')]);
    var $receiver = this.MIME_TYPES_0.entries;
    var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault($receiver, 10)), 16);
    var destination = LinkedHashMap_init_0(capacity);
    var tmp$;
    tmp$ = $receiver.iterator();
    while (tmp$.hasNext()) {
      var element = tmp$.next();
      destination.put_xwzc9p$(element.value, element.key);
    }
    this.MIME_TYPES_REVERSE_0 = destination;
    this.DEFAULT_CONTENT_DIR_NAME_0 = 'ustadmobileContent';
    this.LOCALE_USE_SYSTEM = '';
    this.PREFKEY_LOCALE = 'locale';
    this.USER_RESOURCE = 2;
    this.SHARED_RESOURCE = 4;
    this.ARG_REFERRER = 'ref';
    this.GO_FLAG_CLEAR_TOP = 67108864;
    this.TAG_DOWNLOAD_ENABLED = 'dlenabled';
    this.TAG_MAIN_COROUTINE_CONTEXT = 16;
    this.TAG_DLMGR_SINGLETHREAD_CONTEXT = 32;
    this.TAG_LOCAL_HTTP_PORT = 64;
    this.LINK_INTENT_FILTER = 'umclient';
    this.LINK_ENDPOINT_VIEWNAME_DIVIDER = '/umapp/#/';
    this.SUBDIR_SITEDATA_NAME = 'sitedata';
    this.SUBDIR_CONTAINER_NAME = 'container';
    this.SUBDIR_ATTACHMENTS_NAME = 'attachments';
    this.PREF_ROOT_VIEWNAME = 'rootViewName';
    this.TAG_CLIENT_ID = 'client_id';
  }
  UstadMobileSystemCommon$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var UstadMobileSystemCommon$Companion_instance = null;
  function UstadMobileSystemCommon$Companion_getInstance() {
    if (UstadMobileSystemCommon$Companion_instance === null) {
      new UstadMobileSystemCommon$Companion();
    }
    return UstadMobileSystemCommon$Companion_instance;
  }
  UstadMobileSystemCommon.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UstadMobileSystemCommon', 
  interfaces: []};
  function StringsXml(xpp, xppFactory, idMap, stringsXmlName, fallback, commentsEnabled, trackMessageIdOrder) {
    if (stringsXmlName === void 0) 
      stringsXmlName = '';
    if (fallback === void 0) 
      fallback = null;
    if (commentsEnabled === void 0) 
      commentsEnabled = false;
    if (trackMessageIdOrder === void 0) 
      trackMessageIdOrder = false;
    this.stringsXmlName = stringsXmlName;
    this.fallback = fallback;
    this.commentsEnabled = commentsEnabled;
    this.trackMessageIdOrder_0 = trackMessageIdOrder;
    this.messageMap_0 = null;
    this.commentMap_0 = null;
    this._messageIdOrder_0 = null;
    var tmp$, tmp$_0;
    var mutableMap = LinkedHashMap_init();
    var mutableCommentMap = LinkedHashMap_init();
    var mutableMessageIdList = ArrayList_init();
    var nextEvt = {
  v: null};
    var commentString = '';
    while (true) {
      var $receiver = xpp.nextToken();
      nextEvt.v = $receiver;
      if (!($receiver !== 1)) 
        break;
      if (this.commentsEnabled && nextEvt.v === 9) {
        commentString += xpp.getText();
      }
      if (nextEvt.v !== 2) 
        continue;
      var tagName = xpp.getName();
      if (!equals(tagName, 'string')) 
        continue;
      tmp$ = xpp.getAttributeValue_f5e6j7$(null, 'name');
      if (tmp$ == null) {
        throw IllegalArgumentException_init('string in xml ' + this.stringsXmlName + ' has no name!');
      }
      var stringName = tmp$;
      var stringValue = innerXml(xpp, xppFactory);
      tmp$_0 = idMap.get_11rb$(stringName);
      if (tmp$_0 == null) {
        continue;
      }
      var stringId = tmp$_0;
      if (this.trackMessageIdOrder_0) {
        mutableMessageIdList.add_11rb$(stringId);
      }
      mutableMap.put_xwzc9p$(stringId, stringValue);
      if (this.commentsEnabled && !equals(commentString, '')) {
        var value = commentString;
        mutableCommentMap.put_xwzc9p$(stringId, value);
        commentString = '';
      }
    }
    this.messageMap_0 = toMap(mutableMap);
    this.commentMap_0 = toMap(mutableCommentMap);
    this._messageIdOrder_0 = toList(mutableMessageIdList);
  }
  Object.defineProperty(StringsXml.prototype, 'messageIdOrder', {
  configurable: true, 
  get: function() {
  if (!this.trackMessageIdOrder_0) 
    throw IllegalStateException_init('StringsXml.messgaeIdOrder: trackMessageIdOrder was not enabled');
  return this._messageIdOrder_0;
}});
  StringsXml.prototype.get_za3lpa$ = function(messageId) {
  var tmp$, tmp$_0, tmp$_1;
  tmp$_1 = (tmp$_0 = this.messageMap_0.get_11rb$(messageId)) != null ? tmp$_0 : (tmp$ = this.fallback) != null ? tmp$.get_za3lpa$(messageId) : null;
  if (tmp$_1 == null) {
    throw IllegalArgumentException_init(this.stringsXmlName + ' does not contain');
  }
  return tmp$_1;
};
  StringsXml.prototype.getComment_za3lpa$ = function(messageId) {
  if (!this.commentsEnabled) 
    throw IllegalStateException_init('StringsXml.getComment: commentsEnabled = false');
  return this.commentMap_0.get_11rb$(messageId);
};
  StringsXml.prototype.getIdByString_ivxn3r$ = function(str, ignoreCase) {
  if (ignoreCase === void 0) 
    ignoreCase = false;
  var tmp$, tmp$_0;
  var tmp$_1;
  var strTrimmed = trim(Kotlin.isCharSequence(tmp$_1 = str) ? tmp$_1 : throwCCE()).toString();
  var $receiver = this.messageMap_0.entries;
  var firstOrNull$result;
  firstOrNull$break:
    do {
      var tmp$_2;
      tmp$_2 = $receiver.iterator();
      while (tmp$_2.hasNext()) {
        var element = tmp$_2.next();
        if (equals_0(element.value, strTrimmed, ignoreCase)) {
          firstOrNull$result = element;
          break firstOrNull$break;
        }
      }
      firstOrNull$result = null;
    } while (false);
  return (tmp$_0 = (tmp$ = firstOrNull$result) != null ? tmp$.key : null) != null ? tmp$_0 : -1;
};
  StringsXml.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'StringsXml', 
  interfaces: []};
  function UstadBackStackEntry() {
  }
  UstadBackStackEntry.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'UstadBackStackEntry', 
  interfaces: []};
  function get_viewUri($receiver) {
    return $receiver.viewName + '?' + toQueryString($receiver.arguments);
  }
  function UstadNavController() {
  }
  UstadNavController.prototype.navigate_oc2wlg$ = function(viewName, args, goOptions, callback$default) {
  if (goOptions === void 0) 
    goOptions = UstadMobileSystemCommon$UstadGoOptions$Companion_getInstance().Default;
    callback$default ? callback$default(viewName, args, goOptions) : this.navigate_oc2wlg$$default(viewName, args, goOptions);
};
  UstadNavController.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'UstadNavController', 
  interfaces: []};
  function navigateToErrorScreen($receiver, exception, di, context) {
    var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
    var errorCode = (tmp$_1 = (tmp$_0 = Kotlin.isType(tmp$ = exception, ErrorCodeException) ? tmp$ : null) != null ? tmp$_0.errorCode : null) != null ? tmp$_1 : 0;
    var message = exception.message;
    var tmp$_4;
    var systemImpl = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_4 = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$_4 : throwCCE(), null);
    var stackTraceKey = 'trace_' + systemTimeInMillis().toString();
    systemImpl.setAppPref_5pkmrg$(stackTraceKey, stackTraceToString(exception), context);
    var presenterUri = (tmp$_3 = (tmp$_2 = $receiver.currentBackStackEntry) != null ? tmp$_2.viewName + '?' + toQueryString(tmp$_2.arguments) : null) != null ? tmp$_3 : 'unknown-uri';
    $receiver.navigate_oc2wlg$(ErrorReportView$Companion_getInstance().VIEW_NAME, mapOf([to(ErrorReportView$Companion_getInstance().ARG_PRESENTER_URI, presenterUri), to(ErrorReportView$Companion_getInstance().ARG_STACKTRACE_PREFKEY, stackTraceKey), to(ErrorReportView$Companion_getInstance().ARG_ERR_CODE, errorCode.toString()), to(ErrorReportView$Companion_getInstance().ARG_MESSAGE, message != null ? message : '')]));
  }
  function UstadSavedStateHandle() {
  }
  UstadSavedStateHandle.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'UstadSavedStateHandle', 
  interfaces: []};
  function ConcatenatedEntry(md5, compression, compressedSize, totalSize, lastModified) {
    ConcatenatedEntry$Companion_getInstance();
    this.md5 = md5;
    this.compression = compression;
    this.compressedSize = compressedSize;
    this.totalSize = totalSize;
    this.lastModified = lastModified;
  }
  Object.defineProperty(ConcatenatedEntry.prototype, 'isCompressed', {
  configurable: true, 
  get: function() {
  return this.compression === ConcatenatedEntry$Companion_getInstance().COMPRESSION_GZIP;
}});
  ConcatenatedEntry.prototype.equals = function(other) {
  if (this === other) 
    return true;
  if (!Kotlin.isType(other, ConcatenatedEntry)) 
    return false;
  if (!contentEquals(this.md5, other.md5)) 
    return false;
  if (this.compression !== other.compression) 
    return false;
  if (!equals(this.compressedSize, other.compressedSize)) 
    return false;
  if (!equals(this.totalSize, other.totalSize)) 
    return false;
  if (!equals(this.lastModified, other.lastModified)) 
    return false;
  return true;
};
  ConcatenatedEntry.prototype.hashCode = function() {
  var result = contentHashCode(this.md5);
  result = (31 * result | 0) + this.compression;
  result = (31 * result | 0) + hashCode(this.compressedSize) | 0;
  result = (31 * result | 0) + hashCode(this.totalSize) | 0;
  result = (31 * result | 0) + hashCode(this.lastModified) | 0;
  return result;
};
  ConcatenatedEntry.prototype.toContainerEntryFile = function() {
  return ContainerEntryFile_init(encodeBase64(this.md5), this.totalSize, this.compressedSize, this.compression, this.lastModified);
};
  function ConcatenatedEntry$Companion() {
    ConcatenatedEntry$Companion_instance = this;
    this.SIZE = 41;
    this.COMPRESSION_NONE = toByte(0);
    this.COMPRESSION_GZIP = toByte(1);
  }
  ConcatenatedEntry$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ConcatenatedEntry$Companion_instance = null;
  function ConcatenatedEntry$Companion_getInstance() {
    if (ConcatenatedEntry$Companion_instance === null) {
      new ConcatenatedEntry$Companion();
    }
    return ConcatenatedEntry$Companion_instance;
  }
  ConcatenatedEntry.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ConcatenatedEntry', 
  interfaces: []};
  function UploadSessionParams(md5sRequired, startFrom) {
    UploadSessionParams$Companion_getInstance();
    this.md5sRequired = md5sRequired;
    this.startFrom = startFrom;
  }
  function UploadSessionParams$Companion() {
    UploadSessionParams$Companion_instance = this;
  }
  UploadSessionParams$Companion.prototype.serializer = function() {
  return UploadSessionParams$$serializer_getInstance();
};
  UploadSessionParams$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var UploadSessionParams$Companion_instance = null;
  function UploadSessionParams$Companion_getInstance() {
    if (UploadSessionParams$Companion_instance === null) {
      new UploadSessionParams$Companion();
    }
    return UploadSessionParams$Companion_instance;
  }
  function UploadSessionParams$$serializer() {
    this.descriptor_tu6rt3$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.io.UploadSessionParams', this, 2);
    this.descriptor.addElement_ivxn3r$('md5sRequired', false);
    this.descriptor.addElement_ivxn3r$('startFrom', false);
    UploadSessionParams$$serializer_instance = this;
  }
  Object.defineProperty(UploadSessionParams$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_tu6rt3$_0;
}});
  UploadSessionParams$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  output.encodeSerializableElement_r4qlx7$(this.descriptor, 0, new ArrayListSerializer(internal.StringSerializer), value.md5sRequired);
  output.encodeLongElement_j0o2mv$(this.descriptor, 1, value.startFrom);
  output.endStructure_24f42q$(this.descriptor);
};
  UploadSessionParams$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeSerializableElement_12e8id$(this.descriptor, 0, new ArrayListSerializer(internal.StringSerializer), local0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeLongElement_szpzho$(this.descriptor, 1);
          bitMask0 |= 2;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return UploadSessionParams_init(bitMask0, local0, local1, null);
};
  UploadSessionParams$$serializer.prototype.childSerializers = function() {
  return [new ArrayListSerializer(internal.StringSerializer), internal.LongSerializer];
};
  UploadSessionParams$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var UploadSessionParams$$serializer_instance = null;
  function UploadSessionParams$$serializer_getInstance() {
    if (UploadSessionParams$$serializer_instance === null) {
      new UploadSessionParams$$serializer();
    }
    return UploadSessionParams$$serializer_instance;
  }
  function UploadSessionParams_init(seen1, md5sRequired, startFrom, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(UploadSessionParams.prototype);
    if ((seen1 & 1) === 0) 
      throw MissingFieldException_init('md5sRequired');
    else 
      $this.md5sRequired = md5sRequired;
    if ((seen1 & 2) === 0) 
      throw MissingFieldException_init('startFrom');
    else 
      $this.startFrom = startFrom;
    return $this;
  }
  UploadSessionParams.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UploadSessionParams', 
  interfaces: []};
  UploadSessionParams.prototype.component1 = function() {
  return this.md5sRequired;
};
  UploadSessionParams.prototype.component2 = function() {
  return this.startFrom;
};
  UploadSessionParams.prototype.copy_im2ve8$ = function(md5sRequired, startFrom) {
  return new UploadSessionParams(md5sRequired === void 0 ? this.md5sRequired : md5sRequired, startFrom === void 0 ? this.startFrom : startFrom);
};
  UploadSessionParams.prototype.toString = function() {
  return 'UploadSessionParams(md5sRequired=' + Kotlin.toString(this.md5sRequired) + (', startFrom=' + Kotlin.toString(this.startFrom)) + ')';
};
  UploadSessionParams.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.md5sRequired) | 0;
  result = result * 31 + Kotlin.hashCode(this.startFrom) | 0;
  return result;
};
  UploadSessionParams.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.md5sRequired, other.md5sRequired) && Kotlin.equals(this.startFrom, other.startFrom)))));
};
  function toConcatenatedEntry($receiver) {
    var tmp$;
    tmp$ = $receiver.cefMd5;
    if (tmp$ == null) {
      throw IllegalArgumentException_init('toConcatEntry must have md5');
    }
    var md5Val = tmp$;
    return new ConcatenatedEntry(base64StringToByteArray(md5Val), toByte($receiver.compression), $receiver.ceCompressedSize, $receiver.ceTotalSize, $receiver.lastModified);
  }
  function toContainerEntryWithMd5($receiver) {
    var $receiver_0 = new ContainerEntryWithMd5();
    var tmp$;
    $receiver_0.ceUid = $receiver.ceUid;
    $receiver_0.cePath = $receiver.cePath;
    $receiver_0.ceCefUid = $receiver.ceCefUid;
    $receiver_0.ceContainerUid = $receiver.ceContainerUid;
    $receiver_0.cefMd5 = (tmp$ = $receiver.containerEntryFile) != null ? tmp$.cefMd5 : null;
    return $receiver_0;
  }
  function BitmaskFlag(flagVal, messageId, enabled) {
    BitmaskFlag$Companion_getInstance();
    if (enabled === void 0) 
      enabled = false;
    this.flagVal = flagVal;
    this.messageId = messageId;
    this.enabled = enabled;
  }
  function BitmaskFlag$Companion() {
    BitmaskFlag$Companion_instance = this;
  }
  BitmaskFlag$Companion.prototype.serializer = function() {
  return BitmaskFlag$$serializer_getInstance();
};
  BitmaskFlag$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var BitmaskFlag$Companion_instance = null;
  function BitmaskFlag$Companion_getInstance() {
    if (BitmaskFlag$Companion_instance === null) {
      new BitmaskFlag$Companion();
    }
    return BitmaskFlag$Companion_instance;
  }
  function BitmaskFlag$$serializer() {
    this.descriptor_mk05y$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.model.BitmaskFlag', this, 3);
    this.descriptor.addElement_ivxn3r$('flagVal', false);
    this.descriptor.addElement_ivxn3r$('messageId', false);
    this.descriptor.addElement_ivxn3r$('enabled', true);
    BitmaskFlag$$serializer_instance = this;
  }
  Object.defineProperty(BitmaskFlag$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_mk05y$_0;
}});
  BitmaskFlag$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  output.encodeLongElement_j0o2mv$(this.descriptor, 0, value.flagVal);
  output.encodeIntElement_ptg7oe$(this.descriptor, 1, value.messageId);
  if (!equals(value.enabled, false) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 2)) 
    output.encodeBooleanElement_qh7jdn$(this.descriptor, 2, value.enabled);
  output.endStructure_24f42q$(this.descriptor);
};
  BitmaskFlag$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1, local2;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeLongElement_szpzho$(this.descriptor, 0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeIntElement_szpzho$(this.descriptor, 1);
          bitMask0 |= 2;
          break;
        case 2:
          local2 = input.decodeBooleanElement_szpzho$(this.descriptor, 2);
          bitMask0 |= 4;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return BitmaskFlag_init(bitMask0, local0, local1, local2, null);
};
  BitmaskFlag$$serializer.prototype.childSerializers = function() {
  return [internal.LongSerializer, internal.IntSerializer, internal.BooleanSerializer];
};
  BitmaskFlag$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var BitmaskFlag$$serializer_instance = null;
  function BitmaskFlag$$serializer_getInstance() {
    if (BitmaskFlag$$serializer_instance === null) {
      new BitmaskFlag$$serializer();
    }
    return BitmaskFlag$$serializer_instance;
  }
  function BitmaskFlag_init(seen1, flagVal, messageId, enabled, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(BitmaskFlag.prototype);
    if ((seen1 & 1) === 0) 
      throw MissingFieldException_init('flagVal');
    else 
      $this.flagVal = flagVal;
    if ((seen1 & 2) === 0) 
      throw MissingFieldException_init('messageId');
    else 
      $this.messageId = messageId;
    if ((seen1 & 4) === 0) 
      $this.enabled = false;
    else 
      $this.enabled = enabled;
    return $this;
  }
  BitmaskFlag.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'BitmaskFlag', 
  interfaces: []};
  BitmaskFlag.prototype.component1 = function() {
  return this.flagVal;
};
  BitmaskFlag.prototype.component2 = function() {
  return this.messageId;
};
  BitmaskFlag.prototype.component3 = function() {
  return this.enabled;
};
  BitmaskFlag.prototype.copy_90jq3i$ = function(flagVal, messageId, enabled) {
  return new BitmaskFlag(flagVal === void 0 ? this.flagVal : flagVal, messageId === void 0 ? this.messageId : messageId, enabled === void 0 ? this.enabled : enabled);
};
  BitmaskFlag.prototype.toString = function() {
  return 'BitmaskFlag(flagVal=' + Kotlin.toString(this.flagVal) + (', messageId=' + Kotlin.toString(this.messageId)) + (', enabled=' + Kotlin.toString(this.enabled)) + ')';
};
  BitmaskFlag.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.flagVal) | 0;
  result = result * 31 + Kotlin.hashCode(this.messageId) | 0;
  result = result * 31 + Kotlin.hashCode(this.enabled) | 0;
  return result;
};
  BitmaskFlag.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.flagVal, other.flagVal) && Kotlin.equals(this.messageId, other.messageId) && Kotlin.equals(this.enabled, other.enabled)))));
};
  function BitmaskMessageId(flagVal, messageId) {
    this.flagVal = flagVal;
    this.messageId = messageId;
  }
  BitmaskMessageId.prototype.toBitmaskFlag_s8cxhz$ = function(value) {
  return new BitmaskFlag(this.flagVal, this.messageId, hasFlag_0(value, this.flagVal));
};
  BitmaskMessageId.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'BitmaskMessageId', 
  interfaces: []};
  BitmaskMessageId.prototype.component1 = function() {
  return this.flagVal;
};
  BitmaskMessageId.prototype.component2 = function() {
  return this.messageId;
};
  BitmaskMessageId.prototype.copy_yhmem3$ = function(flagVal, messageId) {
  return new BitmaskMessageId(flagVal === void 0 ? this.flagVal : flagVal, messageId === void 0 ? this.messageId : messageId);
};
  BitmaskMessageId.prototype.toString = function() {
  return 'BitmaskMessageId(flagVal=' + Kotlin.toString(this.flagVal) + (', messageId=' + Kotlin.toString(this.messageId)) + ')';
};
  BitmaskMessageId.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.flagVal) | 0;
  result = result * 31 + Kotlin.hashCode(this.messageId) | 0;
  return result;
};
  BitmaskMessageId.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.flagVal, other.flagVal) && Kotlin.equals(this.messageId, other.messageId)))));
};
  function HeadResponse(status, headers) {
    this.status = status;
    this.headers = headers;
  }
  HeadResponse.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'HeadResponse', 
  interfaces: []};
  HeadResponse.prototype.component1 = function() {
  return this.status;
};
  HeadResponse.prototype.component2 = function() {
  return this.headers;
};
  HeadResponse.prototype.copy_rqd2ss$ = function(status, headers) {
  return new HeadResponse(status === void 0 ? this.status : status, headers === void 0 ? this.headers : headers);
};
  HeadResponse.prototype.toString = function() {
  return 'HeadResponse(status=' + Kotlin.toString(this.status) + (', headers=' + Kotlin.toString(this.headers)) + ')';
};
  HeadResponse.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.status) | 0;
  result = result * 31 + Kotlin.hashCode(this.headers) | 0;
  return result;
};
  HeadResponse.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.status, other.status) && Kotlin.equals(this.headers, other.headers)))));
};
  function NetworkProgressListener(f) {
    this.function$ = f;
  }
  NetworkProgressListener.prototype.onProgress_3pjtqy$ = function(bytesCompleted, totalBytes) {
  return this.function$(bytesCompleted, totalBytes);
};
  NetworkProgressListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'NetworkProgressListener', 
  interfaces: []};
  function NetworkProgressListenerAdapter(contentJobProgressListener, contentJobItem, progressBase) {
    if (progressBase === void 0) 
      progressBase = contentJobItem.cjiItemProgress;
    this.contentJobProgressListener_0 = contentJobProgressListener;
    this.contentJobItem_0 = contentJobItem;
    this.progressBase_0 = progressBase;
  }
  NetworkProgressListenerAdapter.prototype.onProgress_3pjtqy$ = function(bytesCompleted, totalBytes) {
  this.contentJobItem_0.cjiItemProgress = this.progressBase_0.add(bytesCompleted);
  this.contentJobItem_0.cjiItemTotal = this.progressBase_0.add(totalBytes);
  this.contentJobProgressListener_0.onProgress_letzpf$(this.contentJobItem_0);
};
  NetworkProgressListenerAdapter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'NetworkProgressListenerAdapter', 
  interfaces: [NetworkProgressListener]};
  function ContainerFetcherListener2() {
  }
  ContainerFetcherListener2.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContainerFetcherListener2', 
  interfaces: []};
  function ContainerFetcherRequest2(entriesToDownload, siteUrl, mirrorUrl, destDirUri) {
    this.entriesToDownload = entriesToDownload;
    this.siteUrl = siteUrl;
    this.mirrorUrl = mirrorUrl;
    this.destDirUri = destDirUri;
  }
  ContainerFetcherRequest2.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContainerFetcherRequest2', 
  interfaces: []};
  function ContainerUploaderListener() {
  }
  ContainerUploaderListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContainerUploaderListener', 
  interfaces: []};
  function ContainerUploaderRequest2(uploadUuid, entriesToUpload, siteUrl) {
    this.uploadUuid = uploadUuid;
    this.entriesToUpload = entriesToUpload;
    this.siteUrl = siteUrl;
  }
  ContainerUploaderRequest2.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContainerUploaderRequest2', 
  interfaces: []};
  ContainerUploaderRequest2.prototype.component1 = function() {
  return this.uploadUuid;
};
  ContainerUploaderRequest2.prototype.component2 = function() {
  return this.entriesToUpload;
};
  ContainerUploaderRequest2.prototype.component3 = function() {
  return this.siteUrl;
};
  ContainerUploaderRequest2.prototype.copy_mjdmms$ = function(uploadUuid, entriesToUpload, siteUrl) {
  return new ContainerUploaderRequest2(uploadUuid === void 0 ? this.uploadUuid : uploadUuid, entriesToUpload === void 0 ? this.entriesToUpload : entriesToUpload, siteUrl === void 0 ? this.siteUrl : siteUrl);
};
  ContainerUploaderRequest2.prototype.toString = function() {
  return 'ContainerUploaderRequest2(uploadUuid=' + Kotlin.toString(this.uploadUuid) + (', entriesToUpload=' + Kotlin.toString(this.entriesToUpload)) + (', siteUrl=' + Kotlin.toString(this.siteUrl)) + ')';
};
  ContainerUploaderRequest2.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.uploadUuid) | 0;
  result = result * 31 + Kotlin.hashCode(this.entriesToUpload) | 0;
  result = result * 31 + Kotlin.hashCode(this.siteUrl) | 0;
  return result;
};
  ContainerUploaderRequest2.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.uploadUuid, other.uploadUuid) && Kotlin.equals(this.entriesToUpload, other.entriesToUpload) && Kotlin.equals(this.siteUrl, other.siteUrl)))));
};
  function ConnectivityLiveData(liveData) {
    this.liveData = liveData;
  }
  ConnectivityLiveData.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ConnectivityLiveData', 
  interfaces: []};
  function AvailabilityMonitorRequest(containerUidsToMonitor, onContainerAvailabilityChanged) {
    if (onContainerAvailabilityChanged === void 0) 
      onContainerAvailabilityChanged = AvailabilityMonitorRequest_init$lambda;
    this.containerUidsToMonitor = containerUidsToMonitor;
    this.onContainerAvailabilityChanged = onContainerAvailabilityChanged;
  }
  function AvailabilityMonitorRequest_init$lambda(it) {
    return Unit;
  }
  AvailabilityMonitorRequest.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'AvailabilityMonitorRequest', 
  interfaces: []};
  function createClazzLogs$lambda$lambda$lambda(it) {
    var tmp$;
    return (tmp$ = it.first.holName) != null ? tmp$ : '';
  }
  function createClazzLogs($receiver, fromTime, toTime, clazzFilter, matchLocalFromDay) {
    if (clazzFilter === void 0) 
      clazzFilter = L0;
    if (matchLocalFromDay === void 0) 
      matchLocalFromDay = false;
    var holidayCalendarHolidayLists = LinkedHashMap_init();
    var toDateTime = DateTime.Companion.fromUnix_s8cxhz$(toTime);
    var tmp$;
    tmp$ = $receiver.clazzDao.findClazzesWithEffectiveHolidayCalendarAndFilter_s8cxhz$(clazzFilter).iterator();
    while (tmp$.hasNext()) {
      var element = tmp$.next();
      var tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5;
      var alreadyCreatedClazzLogs = $receiver.clazzLogDao.findByClazzUidWithinTimeRange_ttedgd$(element.clazzUid, fromTime, toTime);
      var effectiveTimeZone = (tmp$_2 = (tmp$_1 = element.clazzTimeZone) != null ? tmp$_1 : (tmp$_0 = element.school) != null ? tmp$_0.schoolTimeZone : null) != null ? tmp$_2 : 'UTC';
      var startTimeOffset = getTimezoneOffset(effectiveTimeZone, fromTime);
      var fromTimeLocal = DateTime.Companion.fromUnix_s8cxhz$(fromTime).toOffset_q6c6ai$(new TimezoneOffset(startTimeOffset));
      var fromDayOfWeekLocal = fromTimeLocal.dayOfWeek;
      var holCalendarUid = (tmp$_4 = (tmp$_3 = element.holidayCalendar) != null ? tmp$_3.umCalendarUid : null) != null ? tmp$_4 : L0;
      var tmp$_6;
      var value = holidayCalendarHolidayLists.get_11rb$(holCalendarUid);
      if (value == null) {
        var answer = $receiver.holidayDao.findByHolidayCalendaUid_s8cxhz$(holCalendarUid);
        holidayCalendarHolidayLists.put_xwzc9p$(holCalendarUid, answer);
        tmp$_6 = answer;
      } else {
        tmp$_6 = value;
      }
      var clazzHolidayList = tmp$_6;
      tmp$_5 = $receiver.scheduleDao.findAllSchedulesByClazzUidAsList_s8cxhz$(element.clazzUid).iterator();
      loop_label:
        while (tmp$_5.hasNext()) {
          var schedule = tmp$_5.next();
          var scheduleNextInstance = nextOccurence(schedule, effectiveTimeZone, fromTime);
          if (scheduleNextInstance.compareTo_11rb$(toDateTime) >= 0) {
            continue loop_label;
          }
          var scheduleNextInstanceDateTimeTz = toOffsetByTimezone(scheduleNextInstance.from, effectiveTimeZone);
          if (matchLocalFromDay && scheduleNextInstanceDateTimeTz.dayOfWeek !== fromDayOfWeekLocal) {
            continue loop_label;
          }
          var destination = ArrayList_init_0(collectionSizeOrDefault(clazzHolidayList, 10));
          var tmp$_7;
          tmp$_7 = clazzHolidayList.iterator();
          while (tmp$_7.hasNext()) {
            var item = tmp$_7.next();
            var tmp$_8 = destination.add_11rb$;
            var timezoneOffset = getTimezoneOffset(effectiveTimeZone, item.holStartTime);
            tmp$_8.call(destination, new Pair(item, until(DateTime.Companion.fromUnix_s8cxhz$(item.holStartTime.subtract(Kotlin.Long.fromInt(timezoneOffset))), DateTime.Companion.fromUnix_s8cxhz$(item.holEndTime.subtract(Kotlin.Long.fromInt(timezoneOffset))))));
          }
          var holidayAndDateTimeRange = destination;
          var destination_0 = ArrayList_init();
          var tmp$_9;
          tmp$_9 = holidayAndDateTimeRange.iterator();
          while (tmp$_9.hasNext()) {
            var element_0 = tmp$_9.next();
            if (element_0.second.contains_r8ew1g$(scheduleNextInstance)) 
              destination_0.add_11rb$(element_0);
          }
          var overlappingHolidays = destination_0;
          var clazzLogDate = scheduleNextInstance.from.unixMillisLong;
          var $receiver_0 = new ClazzLog();
          $receiver_0.logDate = clazzLogDate;
          $receiver_0.clazzLogClazzUid = element.clazzUid;
          $receiver_0.clazzLogScheduleUid = schedule.scheduleUid;
          $receiver_0.clazzLogUid = generateUid($receiver_0);
          $receiver_0.clazzLogCancelled = !overlappingHolidays.isEmpty();
          if ($receiver_0.clazzLogCancelled) {
            $receiver_0.cancellationNote = joinToString(overlappingHolidays, void 0, void 0, void 0, void 0, void 0, createClazzLogs$lambda$lambda$lambda);
          }
          var clazzLog = $receiver_0;
          var destination_1 = ArrayList_init();
          var tmp$_10;
          tmp$_10 = alreadyCreatedClazzLogs.iterator();
          while (tmp$_10.hasNext()) {
            var element_1 = tmp$_10.next();
            if (equals(element_1.clazzLogScheduleUid, schedule.scheduleUid) && !equals(element_1.clazzLogUid, clazzLog.clazzLogUid)) 
              destination_1.add_11rb$(element_1);
          }
          var logsToReschedule = destination_1;
          var tmp$_11;
          tmp$_11 = logsToReschedule.iterator();
          while (tmp$_11.hasNext()) {
            var element_2 = tmp$_11.next();
            $receiver.clazzLogDao.updateStatusByClazzLogUid_ro19vi$(element_2.clazzLogUid, 8, systemTimeInMillis());
            $receiver.clazzLogAttendanceRecordDao.updateRescheduledClazzLogUids_b9bd0d$(element_2.clazzLogUid, clazzLog.clazzLogUid, systemTimeInMillis());
          }
          var any$result;
          any$break:
            do {
              var tmp$_12;
              if (Kotlin.isType(alreadyCreatedClazzLogs, Collection) && alreadyCreatedClazzLogs.isEmpty()) {
                any$result = false;
                break any$break;
              }
              tmp$_12 = alreadyCreatedClazzLogs.iterator();
              while (tmp$_12.hasNext()) {
                var element_3 = tmp$_12.next();
                if (equals(element_3.clazzLogUid, clazzLog.clazzLogUid)) {
                  any$result = true;
                  break any$break;
                }
              }
              any$result = false;
            } while (false);
          if (!any$result) {
            $receiver.clazzLogDao.insert_11rb$(clazzLog);
          }
        }
    }
  }
  function ClazzLogCreatorManager() {
    ClazzLogCreatorManager$Companion_getInstance();
  }
  function ClazzLogCreatorManager$Companion() {
    ClazzLogCreatorManager$Companion_instance = this;
    this.DAY_IN_MS = 86400000;
    this.INPUT_ENDPOINTURL = 'dbName';
    this.INPUT_FROMTIME = 'fromTime';
    this.INPUT_TOTIME = 'toTime';
    this.INPUT_CLAZZUID = 'clazzUidFilter';
  }
  ClazzLogCreatorManager$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzLogCreatorManager$Companion_instance = null;
  function ClazzLogCreatorManager$Companion_getInstance() {
    if (ClazzLogCreatorManager$Companion_instance === null) {
      new ClazzLogCreatorManager$Companion();
    }
    return ClazzLogCreatorManager$Companion_instance;
  }
  ClazzLogCreatorManager.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzLogCreatorManager', 
  interfaces: []};
  function generateUid($receiver) {
    return Kotlin.Long.fromInt(hashCode($receiver.clazzLogClazzUid)).shiftLeft(32).or(Kotlin.Long.fromInt(hashCode($receiver.logDate)));
  }
  function toOffsetByTimezone($receiver, timezoneId) {
    return $receiver.toOffset_q6c6ai$(new TimezoneOffset(getTimezoneOffset(timezoneId, $receiver.unixMillisLong)));
  }
  function toLocalMidnight($receiver, timeZoneId) {
    var $receiver_0 = toOffsetByTimezone($receiver, timeZoneId);
    var $receiver_1 = $receiver_0.hours;
    var tmp$ = TimeSpan.Companion.fromHours_14dthe$($receiver_1);
    var $receiver_2 = $receiver_0.minutes;
    var tmp$_0 = tmp$.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_2));
    var $receiver_3 = $receiver_0.seconds;
    var tmp$_1 = tmp$_0.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_3));
    var $receiver_4 = $receiver_0.milliseconds;
    return $receiver_0.minus_fv8bff$(tmp$_1.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_4))).utc;
  }
  function age($receiver) {
    var tmp$;
    var dateNow = DateTime.Companion.now();
    var age = dateNow.yearInt - $receiver.yearInt | 0;
    if ($receiver.month0 < dateNow.month0) {
      age = age - 1 | 0;
    } else if ($receiver.month0 === dateNow.month0 && $receiver.dayOfYear > dateNow.dayOfYear) {
      tmp$ = age , age = tmp$ - 1 | 0;
    }
    return age;
  }
  var get_localMidnight = defineInlineFunction('UstadMobile-core.com.ustadmobile.core.schedule.get_localMidnight_ksqbhc$', wrapFunction(function() {
  var TimeSpan = _.$$importsForInline$$['klock-root-klock-js-legacy'].com.soywiz.klock.TimeSpan;
  return function($receiver) {
  var $receiver_0 = $receiver.hours;
  var tmp$ = TimeSpan.Companion.fromHours_14dthe$($receiver_0);
  var $receiver_1 = $receiver.minutes;
  var tmp$_0 = tmp$.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_1));
  var $receiver_2 = $receiver.seconds;
  var tmp$_1 = tmp$_0.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_2));
  var $receiver_3 = $receiver.milliseconds;
  return $receiver.minus_fv8bff$(tmp$_1.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_3)));
};
}));
  var get_localEndOfDay = defineInlineFunction('UstadMobile-core.com.ustadmobile.core.schedule.get_localEndOfDay_ksqbhc$', wrapFunction(function() {
  var TimeSpan = _.$$importsForInline$$['klock-root-klock-js-legacy'].com.soywiz.klock.TimeSpan;
  return function($receiver) {
  var $receiver_0 = $receiver.hours;
  var tmp$ = TimeSpan.Companion.fromHours_14dthe$($receiver_0);
  var $receiver_1 = $receiver.minutes;
  var tmp$_0 = tmp$.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_1));
  var $receiver_2 = $receiver.seconds;
  var tmp$_1 = tmp$_0.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_2));
  var $receiver_3 = $receiver.milliseconds;
  return $receiver.minus_fv8bff$(tmp$_1.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_3))).plus_fv8bff$(TimeSpan.Companion.fromHours_14dthe$(24)).minus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$(1));
};
}));
  function nextDayOfWeek($receiver, dayOfWeek) {
    var dateTimeTmp = $receiver;
    while (dateTimeTmp.dayOfWeek !== dayOfWeek) {
      dateTimeTmp = dateTimeTmp.plus_fv8bff$(TimeSpan.Companion.fromDays_14dthe$(1));
    }
    return dateTimeTmp;
  }
  function nextOccurence($receiver, timezoneName, after) {
    if (after === void 0) 
      after = getSystemTimeInMillis();
    var rawTzOffset = getRawTimezoneOffset(timezoneName);
    var $receiver_0 = DateTime.Companion.fromUnix_s8cxhz$(after).toOffset_q6c6ai$(new TimezoneOffset(rawTzOffset));
    var $receiver_1 = $receiver_0.hours;
    var tmp$ = TimeSpan.Companion.fromHours_14dthe$($receiver_1);
    var $receiver_2 = $receiver_0.minutes;
    var tmp$_0 = tmp$.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_2));
    var $receiver_3 = $receiver_0.seconds;
    var tmp$_1 = tmp$_0.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_3));
    var $receiver_4 = $receiver_0.milliseconds;
    var dateTimeStart = $receiver_0.minus_fv8bff$(tmp$_1.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_4))).plus_fv8bff$(TimeSpan.Companion.fromHours_14dthe$(2));
    var nextOccurenceDay = nextDayOfWeek(dateTimeStart, DayOfWeek.Companion.get_za3lpa$($receiver.scheduleDay));
    var daylightSavingsDelta = rawTzOffset - getTimezoneOffset(timezoneName, nextOccurenceDay.utc.unixMillisLong) | 0;
    var $receiver_5 = nextOccurenceDay.hours;
    var tmp$_2 = TimeSpan.Companion.fromHours_14dthe$($receiver_5);
    var $receiver_6 = nextOccurenceDay.minutes;
    var tmp$_3 = tmp$_2.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_6));
    var $receiver_7 = nextOccurenceDay.seconds;
    var tmp$_4 = tmp$_3.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_7));
    var $receiver_8 = nextOccurenceDay.milliseconds;
    var occurenceDayLocalMidnight = nextOccurenceDay.minus_fv8bff$(tmp$_4.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_8)));
    var tmp$_5 = occurenceDayLocalMidnight.utc;
    var $receiver_9 = $receiver.sceduleStartTime;
    var tmp$_6 = tmp$_5.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_9.toNumber())).plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$(daylightSavingsDelta));
    var tmp$_7 = occurenceDayLocalMidnight.utc;
    var $receiver_10 = $receiver.scheduleEndTime;
    return until(tmp$_6, tmp$_7.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_10.toNumber())).plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$(daylightSavingsDelta)));
  }
  function Activity(id, aType, lang) {
    if (lang === void 0) 
      lang = 'en';
    this.aType_8be2vx$ = aType;
    this.lang_8be2vx$ = lang;
    this.id_qb20q0$_0 = null;
    this.desc_5xvcge$_0 = null;
    this.name_5sg2vc$_0 = null;
    this.launchUrl_m14eyz$_0 = null;
    this.extensions_0 = null;
    this.activityJSON = new JsonObject(mapOf_0(to('id', JsonPrimitive(id))));
    this.id = id;
  }
  Object.defineProperty(Activity.prototype, 'id', {
  configurable: true, 
  get: function() {
  return this.id_qb20q0$_0;
}, 
  set: function(id) {
  this.id_qb20q0$_0 = id;
}});
  Object.defineProperty(Activity.prototype, 'desc', {
  configurable: true, 
  get: function() {
  return this.desc_5xvcge$_0;
}, 
  set: function(desc) {
  this.desc_5xvcge$_0 = desc;
}});
  Object.defineProperty(Activity.prototype, 'name', {
  configurable: true, 
  get: function() {
  return this.name_5sg2vc$_0;
}, 
  set: function(name) {
  this.name_5sg2vc$_0 = name;
}});
  Object.defineProperty(Activity.prototype, 'launchUrl', {
  configurable: true, 
  get: function() {
  return this.launchUrl_m14eyz$_0;
}, 
  set: function(launchUrl) {
  this.launchUrl_m14eyz$_0 = launchUrl;
}});
  Activity.prototype.setExtension_puj7f4$ = function(key, value) {
  var $receiver = this.extensions_0;
  if ($receiver == null || $receiver.isEmpty()) {
    this.extensions_0 = LinkedHashMap_init();
  }
  ensureNotNull(this.extensions_0).put_xwzc9p$(key, value);
};
  Activity.prototype.getExtension_61zpoe$ = function(key) {
  var tmp$;
  if (this.extensions_0 == null) {
    tmp$ = null;
  } else if (!ensureNotNull(this.extensions_0).containsKey_11rb$(key)) {
    tmp$ = null;
  } else {
    tmp$ = toString(ensureNotNull(this.extensions_0).get_11rb$(key));
  }
  return tmp$;
};
  Activity.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Activity', 
  interfaces: []};
  function Registration(uuid, desc, dateStarted) {
    this.uuid = uuid;
    this.desc = desc;
    this.dateStarted = dateStarted;
  }
  Registration.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Registration', 
  interfaces: []};
  function TinCanResult() {
  }
  TinCanResult.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'TinCanResult', 
  interfaces: []};
  function TinCanXML() {
    TinCanXML$Companion_getInstance();
    this.launchActivity_pb401q$_0 = null;
    this.isRegistrationResumable_0 = false;
    this.activities_0 = null;
  }
  Object.defineProperty(TinCanXML.prototype, 'launchActivity', {
  configurable: true, 
  get: function() {
  return this.launchActivity_pb401q$_0;
}, 
  set: function(launchActivity) {
  this.launchActivity_pb401q$_0 = launchActivity;
}});
  function TinCanXML$Companion() {
    TinCanXML$Companion_instance = this;
    this.PARSE_POPULATE_ACTIVITIES = 1;
  }
  TinCanXML$Companion.prototype.loadFromXML_h3yi26$ = function(xpp, parseFlags) {
  if (parseFlags === void 0) 
    parseFlags = 0;
  var tmp$, tmp$_0;
  var tcxml = new TinCanXML();
  var activity = null;
  var evtType = xpp.getEventType();
  var storeActivities = (parseFlags & this.PARSE_POPULATE_ACTIVITIES) === this.PARSE_POPULATE_ACTIVITIES;
  var inExtensions = false;
  var tagName;
  var extKey;
  var extVal;
  do {
    if (evtType === 2 && xpp.getName() != null) {
      tagName = ensureNotNull(xpp.getName());
      if (!inExtensions) {
        if (equals(tagName, 'activity')) {
          activity = new Activity(ensureNotNull(xpp.getAttributeValue_f5e6j7$(null, 'id')), ensureNotNull(xpp.getAttributeValue_f5e6j7$(null, 'type')));
        } else if (equals(tagName, 'launch') && xpp.next() === 4) {
          ensureNotNull(activity).launchUrl = xpp.getText();
        } else if (equals(tagName, 'name') && xpp.next() === 4) {
          ensureNotNull(activity).name = xpp.getText();
        } else if (equals(tagName, 'description') && xpp.next() === 4) {
          ensureNotNull(activity).desc = xpp.getText();
        } else if (equals(xpp.getName(), 'extensions')) {
          inExtensions = true;
        }
      } else {
        if (equals(tagName, 'extension')) {
          extKey = ensureNotNull(xpp.getAttributeValue_f5e6j7$(null, 'key'));
          if (xpp.next() === 4) {
            tmp$_0 = (tmp$ = xpp.getText()) != null ? tmp$ : '';
          } else {
            tmp$_0 = '';
          }
          extVal = tmp$_0;
          ensureNotNull(activity).setExtension_puj7f4$(extKey, extVal);
        }
      }
    } else if (evtType === 3) {
      if (xpp.getName() != null) {
        if (equals(xpp.getName(), 'activity')) {
          if (ensureNotNull(activity).launchUrl != null) {
            tcxml.launchActivity = activity;
            if (!storeActivities) {
              break;
            }
          }
        } else if (equals(xpp.getName(), 'extensions')) {
          inExtensions = false;
        }
      }
    }
    evtType = xpp.next();
  } while (evtType !== 1);
  return tcxml;
};
  TinCanXML$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var TinCanXML$Companion_instance = null;
  function TinCanXML$Companion_getInstance() {
    if (TinCanXML$Companion_instance === null) {
      new TinCanXML$Companion();
    }
    return TinCanXML$Companion_instance;
  }
  TinCanXML.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'TinCanXML', 
  interfaces: []};
  function UmAccountActor(objectType, account) {
    UmAccountActor$Companion_getInstance();
    if (objectType === void 0) 
      objectType = 'Actor';
    if (account === void 0) 
      account = new UmAccountActor$Account();
    this.objectType = objectType;
    this.account = account;
  }
  function UmAccountActor$Account(homePage, name) {
    UmAccountActor$Account$Companion_getInstance();
    if (homePage === void 0) 
      homePage = '';
    if (name === void 0) 
      name = '';
    this.homePage = homePage;
    this.name = name;
  }
  function UmAccountActor$Account$Companion() {
    UmAccountActor$Account$Companion_instance = this;
  }
  UmAccountActor$Account$Companion.prototype.serializer = function() {
  return UmAccountActor$Account$$serializer_getInstance();
};
  UmAccountActor$Account$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var UmAccountActor$Account$Companion_instance = null;
  function UmAccountActor$Account$Companion_getInstance() {
    if (UmAccountActor$Account$Companion_instance === null) {
      new UmAccountActor$Account$Companion();
    }
    return UmAccountActor$Account$Companion_instance;
  }
  function UmAccountActor$Account$$serializer() {
    this.descriptor_5q52r0$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.tincan.UmAccountActor.Account', this, 2);
    this.descriptor.addElement_ivxn3r$('homePage', true);
    this.descriptor.addElement_ivxn3r$('name', true);
    UmAccountActor$Account$$serializer_instance = this;
  }
  Object.defineProperty(UmAccountActor$Account$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_5q52r0$_0;
}});
  UmAccountActor$Account$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  if (!equals(value.homePage, '') || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 0)) 
    output.encodeStringElement_iij8qq$(this.descriptor, 0, value.homePage);
  if (!equals(value.name, '') || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 1)) 
    output.encodeStringElement_iij8qq$(this.descriptor, 1, value.name);
  output.endStructure_24f42q$(this.descriptor);
};
  UmAccountActor$Account$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeStringElement_szpzho$(this.descriptor, 0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeStringElement_szpzho$(this.descriptor, 1);
          bitMask0 |= 2;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return UmAccountActor$UmAccountActor$Account_init(bitMask0, local0, local1, null);
};
  UmAccountActor$Account$$serializer.prototype.childSerializers = function() {
  return [internal.StringSerializer, internal.StringSerializer];
};
  UmAccountActor$Account$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var UmAccountActor$Account$$serializer_instance = null;
  function UmAccountActor$Account$$serializer_getInstance() {
    if (UmAccountActor$Account$$serializer_instance === null) {
      new UmAccountActor$Account$$serializer();
    }
    return UmAccountActor$Account$$serializer_instance;
  }
  function UmAccountActor$UmAccountActor$Account_init(seen1, homePage, name, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(UmAccountActor$Account.prototype);
    if ((seen1 & 1) === 0) 
      $this.homePage = '';
    else 
      $this.homePage = homePage;
    if ((seen1 & 2) === 0) 
      $this.name = '';
    else 
      $this.name = name;
    return $this;
  }
  UmAccountActor$Account.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'Account', 
  interfaces: []};
  function UmAccountActor$Companion() {
    UmAccountActor$Companion_instance = this;
  }
  UmAccountActor$Companion.prototype.serializer = function() {
  return UmAccountActor$$serializer_getInstance();
};
  UmAccountActor$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var UmAccountActor$Companion_instance = null;
  function UmAccountActor$Companion_getInstance() {
    if (UmAccountActor$Companion_instance === null) {
      new UmAccountActor$Companion();
    }
    return UmAccountActor$Companion_instance;
  }
  function UmAccountActor$$serializer() {
    this.descriptor_w58h71$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.tincan.UmAccountActor', this, 2);
    this.descriptor.addElement_ivxn3r$('objectType', true);
    this.descriptor.addElement_ivxn3r$('account', true);
    UmAccountActor$$serializer_instance = this;
  }
  Object.defineProperty(UmAccountActor$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_w58h71$_0;
}});
  UmAccountActor$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  if (!equals(value.objectType, 'Actor') || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 0)) 
    output.encodeStringElement_iij8qq$(this.descriptor, 0, value.objectType);
  if (!equals(value.account, new UmAccountActor$Account()) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 1)) 
    output.encodeSerializableElement_r4qlx7$(this.descriptor, 1, UmAccountActor$Account$$serializer_getInstance(), value.account);
  output.endStructure_24f42q$(this.descriptor);
};
  UmAccountActor$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeStringElement_szpzho$(this.descriptor, 0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeSerializableElement_12e8id$(this.descriptor, 1, UmAccountActor$Account$$serializer_getInstance(), local1);
          bitMask0 |= 2;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return UmAccountActor_init(bitMask0, local0, local1, null);
};
  UmAccountActor$$serializer.prototype.childSerializers = function() {
  return [internal.StringSerializer, UmAccountActor$Account$$serializer_getInstance()];
};
  UmAccountActor$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var UmAccountActor$$serializer_instance = null;
  function UmAccountActor$$serializer_getInstance() {
    if (UmAccountActor$$serializer_instance === null) {
      new UmAccountActor$$serializer();
    }
    return UmAccountActor$$serializer_instance;
  }
  function UmAccountActor_init(seen1, objectType, account, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(UmAccountActor.prototype);
    if ((seen1 & 1) === 0) 
      $this.objectType = 'Actor';
    else 
      $this.objectType = objectType;
    if ((seen1 & 2) === 0) 
      $this.account = new UmAccountActor$Account();
    else 
      $this.account = account;
    return $this;
  }
  UmAccountActor.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UmAccountActor', 
  interfaces: []};
  function UmAccountGroupActor(objectType, account, members) {
    UmAccountGroupActor$Companion_getInstance();
    if (objectType === void 0) 
      objectType = 'Group';
    if (account === void 0) 
      account = new UmAccountActor$Account();
    if (members === void 0) {
      members = emptyList();
    }
    this.objectType = objectType;
    this.account = account;
    this.members = members;
  }
  function UmAccountGroupActor$Companion() {
    UmAccountGroupActor$Companion_instance = this;
  }
  UmAccountGroupActor$Companion.prototype.serializer = function() {
  return UmAccountGroupActor$$serializer_getInstance();
};
  UmAccountGroupActor$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var UmAccountGroupActor$Companion_instance = null;
  function UmAccountGroupActor$Companion_getInstance() {
    if (UmAccountGroupActor$Companion_instance === null) {
      new UmAccountGroupActor$Companion();
    }
    return UmAccountGroupActor$Companion_instance;
  }
  function UmAccountGroupActor$$serializer() {
    this.descriptor_chtfgo$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.tincan.UmAccountGroupActor', this, 3);
    this.descriptor.addElement_ivxn3r$('objectType', true);
    this.descriptor.addElement_ivxn3r$('account', true);
    this.descriptor.addElement_ivxn3r$('members', true);
    UmAccountGroupActor$$serializer_instance = this;
  }
  Object.defineProperty(UmAccountGroupActor$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_chtfgo$_0;
}});
  UmAccountGroupActor$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  if (!equals(value.objectType, 'Group') || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 0)) 
    output.encodeStringElement_iij8qq$(this.descriptor, 0, value.objectType);
  if (!equals(value.account, new UmAccountActor$Account()) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 1)) 
    output.encodeSerializableElement_r4qlx7$(this.descriptor, 1, UmAccountActor$Account$$serializer_getInstance(), value.account);
  if (!equals(value.members, emptyList()) || output.shouldEncodeElementDefault_szpzho$(this.descriptor, 2)) 
    output.encodeSerializableElement_r4qlx7$(this.descriptor, 2, new ArrayListSerializer(UmAccountActor$$serializer_getInstance()), value.members);
  output.endStructure_24f42q$(this.descriptor);
};
  UmAccountGroupActor$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1, local2;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeStringElement_szpzho$(this.descriptor, 0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeSerializableElement_12e8id$(this.descriptor, 1, UmAccountActor$Account$$serializer_getInstance(), local1);
          bitMask0 |= 2;
          break;
        case 2:
          local2 = input.decodeSerializableElement_12e8id$(this.descriptor, 2, new ArrayListSerializer(UmAccountActor$$serializer_getInstance()), local2);
          bitMask0 |= 4;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return UmAccountGroupActor_init(bitMask0, local0, local1, local2, null);
};
  UmAccountGroupActor$$serializer.prototype.childSerializers = function() {
  return [internal.StringSerializer, UmAccountActor$Account$$serializer_getInstance(), new ArrayListSerializer(UmAccountActor$$serializer_getInstance())];
};
  UmAccountGroupActor$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var UmAccountGroupActor$$serializer_instance = null;
  function UmAccountGroupActor$$serializer_getInstance() {
    if (UmAccountGroupActor$$serializer_instance === null) {
      new UmAccountGroupActor$$serializer();
    }
    return UmAccountGroupActor$$serializer_instance;
  }
  function UmAccountGroupActor_init(seen1, objectType, account, members, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(UmAccountGroupActor.prototype);
    if ((seen1 & 1) === 0) 
      $this.objectType = 'Group';
    else 
      $this.objectType = objectType;
    if ((seen1 & 2) === 0) 
      $this.account = new UmAccountActor$Account();
    else 
      $this.account = account;
    if ((seen1 & 4) === 0) {
      $this.members = emptyList();
    } else 
      $this.members = members;
    return $this;
  }
  UmAccountGroupActor.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UmAccountGroupActor', 
  interfaces: []};
  var mimeTypeToViewNameMap;
  var mimeTypeToPlayStoreIdMap;
  function ContentEntryOpener(di, endpoint) {
    this.di_m535g$_0 = di;
    this.endpoint = endpoint;
    var $receiver = this.di;
    var context = this.endpoint;
    var trigger;
    trigger = $receiver.diTrigger;
    var tmp$;
    var tmp$_0;
    this.umAppDatabase_ph35vb$_0 = Instance(On($receiver, DIContext.Companion.invoke_np530x$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Endpoint), [], false)), TypeToken) ? tmp$ : throwCCE(), context), trigger), Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(UmAppDatabase), [], false)), TypeToken) ? tmp$_0 : throwCCE(), 1).provideDelegate_tpuvb9$(this, ContentEntryOpener$umAppDatabase_metadata);
    var tmp$_1;
    this.systemImpl_4e7p4m$_0 = Instance(this.di, Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$_1 : throwCCE(), null).provideDelegate_tpuvb9$(this, ContentEntryOpener$systemImpl_metadata);
  }
  Object.defineProperty(ContentEntryOpener.prototype, 'di', {
  get: function() {
  return this.di_m535g$_0;
}});
  var ContentEntryOpener$umAppDatabase_metadata = new PropertyMetadata('umAppDatabase');
  Object.defineProperty(ContentEntryOpener.prototype, 'umAppDatabase_0', {
  configurable: true, 
  get: function() {
  return this.umAppDatabase_ph35vb$_0.value;
}});
  var ContentEntryOpener$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(ContentEntryOpener.prototype, 'systemImpl_0', {
  configurable: true, 
  get: function() {
  return this.systemImpl_4e7p4m$_0.value;
}});
  function Coroutine$openEntry_6luryd$($this, context_0, contentEntryUid_0, downloadRequired_0, goToContentEntryDetailViewIfNotDownloaded_0, noIframe_0, learnerGroupUid_0, clazzUid_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$containerToOpen = void 0;
    this.local$context = context_0;
    this.local$contentEntryUid = contentEntryUid_0;
    this.local$downloadRequired = downloadRequired_0;
    this.local$goToContentEntryDetailViewIfNotDownloaded = goToContentEntryDetailViewIfNotDownloaded_0;
    this.local$noIframe = noIframe_0;
    this.local$learnerGroupUid = learnerGroupUid_0;
    this.local$clazzUid = clazzUid_0;
  }
  Coroutine$openEntry_6luryd$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$openEntry_6luryd$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$openEntry_6luryd$.prototype.constructor = Coroutine$openEntry_6luryd$;
  Coroutine$openEntry_6luryd$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$learnerGroupUid === void 0) 
          this.local$learnerGroupUid = L0;
        if (this.local$clazzUid === void 0) 
          this.local$clazzUid = L0;
        var tmp$, tmp$_0;
        this.state_0 = 2;
        this.result_0 = this.$this.umAppDatabase_0.containerDao.getMostRecentAvailableContainerUidAndMimeType_2gd3um$(this.local$contentEntryUid, this.local$downloadRequired, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$containerToOpen = this.result_0;
        if (!equals(this.local$learnerGroupUid, L0)) {
          tmp$ = new UstadMobileSystemCommon$UstadGoOptions('', true);
        } else {
          tmp$ = new UstadMobileSystemCommon$UstadGoOptions('', false);
        }
        var goToOptions = tmp$;
        if (this.local$containerToOpen != null) {
          var $receiver = mimeTypeToViewNameMap;
          var key = this.local$containerToOpen.mimeType;
          var tmp$_1;
          var viewName = (Kotlin.isType(tmp$_1 = $receiver, Map) ? tmp$_1 : throwCCE()).get_11rb$(key);
          if (viewName != null) {
            var args = mapOf([to(UstadView$Companion_getInstance().ARG_NO_IFRAMES, this.local$noIframe.toString()), to(UstadView$Companion_getInstance().ARG_CONTENT_ENTRY_UID, this.local$contentEntryUid.toString()), to(UstadView$Companion_getInstance().ARG_CONTAINER_UID, this.local$containerToOpen.containerUid.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZUID, this.local$clazzUid.toString()), to(UstadView$Companion_getInstance().ARG_LEARNER_GROUP_UID, this.local$learnerGroupUid.toString())]);
            this.$this.systemImpl_0.go_henhri$(viewName, args, this.local$context, goToOptions);
            this.state_0 = 4;
            continue;
          } else {
            this.state_0 = 3;
            this.result_0 = this.$this.umAppDatabase_0.containerEntryDao.findByContainerAsync_s8cxhz$(this.local$containerToOpen.containerUid, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          }
        } else {
          if (this.local$goToContentEntryDetailViewIfNotDownloaded) 
            this.$this.systemImpl_0.go_henhri$(ContentEntryDetailView$Companion_getInstance().VIEW_NAME, mapOf([to(UstadView$Companion_getInstance().ARG_ENTITY_UID, this.local$contentEntryUid.toString()), to(UstadView$Companion_getInstance().ARG_CLAZZUID, this.local$clazzUid.toString())]), this.local$context, goToOptions);
          else {
            throw IllegalArgumentException_init('No file found');
          }
          this.state_0 = 5;
          continue;
        }
      case 3:
        var container = this.result_0;
        if (!!container.isEmpty()) {
          var message = 'No file found';
          throw IllegalArgumentException_init(message.toString());
        }
        var containerEntryFilePath = (tmp$_0 = container.get_za3lpa$(0).containerEntryFile) != null ? tmp$_0.cefPath : null;
        if (containerEntryFilePath != null) {
          this.$this.systemImpl_0.openFileInDefaultViewer_t9zcln$(this.local$context, DoorUri.Companion.parse_61zpoe$(containerEntryFilePath), this.local$containerToOpen.mimeType);
        } else {
          throw IllegalArgumentException_init('No file found in container');
        }
        return;
      case 4:
        this.state_0 = 5;
        continue;
      case 5:
        return;
      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);
};
  ContentEntryOpener.prototype.openEntry_6luryd$ = function(context_0, contentEntryUid_0, downloadRequired_0, goToContentEntryDetailViewIfNotDownloaded_0, noIframe_0, learnerGroupUid_0, clazzUid_0, continuation_0, suspended) {
  var instance = new Coroutine$openEntry_6luryd$(this, context_0, contentEntryUid_0, downloadRequired_0, goToContentEntryDetailViewIfNotDownloaded_0, noIframe_0, learnerGroupUid_0, clazzUid_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ContentEntryOpener.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContentEntryOpener', 
  interfaces: [DIAware]};
  function DefaultOneToManyJoinEditHelper(pkGetter, serializationKey, serializationStrategy, deserializationStrategy, editPresenter, entityClass, pkSetter) {
    OneToManyJoinEditHelper.call(this, pkGetter, serializationKey, serializationStrategy, deserializationStrategy, L0, editPresenter, entityClass, pkSetter, DefaultOneToManyJoinEditHelper_init$lambda);
    this.atomicLong_kaczvn$_0 = L0;
  }
  DefaultOneToManyJoinEditHelper.prototype.onLoadFromJsonSavedState_alv73c$ = function(savedState) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5;
  OneToManyJoinEditHelper.prototype.onLoadFromJsonSavedState_alv73c$.call(this, savedState);
  if ((tmp$_0 = (tmp$ = savedState != null ? savedState.get_11rb$(this.serializationKey + OneToManyJoinEditHelper$Companion_getInstance().SUFFIX_PKS_TO_INSERT) : null) != null ? tmp$.length > 0 ? tmp$ : null : null) != null) {
    var tmp$_6 = this.pksToInsert;
    var $receiver = split_0(tmp$_0, Kotlin.charArrayOf(44));
    var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
    var tmp$_7;
    tmp$_7 = $receiver.iterator();
    while (tmp$_7.hasNext()) {
      var item = tmp$_7.next();
      destination.add_11rb$(toLong(item));
    }
    tmp$_6.addAll_brywnq$(destination);
  }
  if ((tmp$_2 = (tmp$_1 = savedState != null ? savedState.get_11rb$(this.serializationKey + OneToManyJoinEditHelper$Companion_getInstance().SUFFIX_PKS_TO_DEACTIVATE) : null) != null ? tmp$_1.length > 0 ? tmp$_1 : null : null) != null) {
    var tmp$_8 = this.pksToDeactivate;
    var $receiver_0 = split_0(tmp$_2, Kotlin.charArrayOf(44));
    var destination_0 = ArrayList_init_0(collectionSizeOrDefault($receiver_0, 10));
    var tmp$_9;
    tmp$_9 = $receiver_0.iterator();
    while (tmp$_9.hasNext()) {
      var item_0 = tmp$_9.next();
      destination_0.add_11rb$(toLong(item_0));
    }
    tmp$_8.addAll_brywnq$(destination_0);
  }
  var tmp$_10;
  if ((tmp$_3 = this.liveList.getValue()) != null) {
    var destination_1 = ArrayList_init_0(collectionSizeOrDefault(tmp$_3, 10));
    var tmp$_11;
    tmp$_11 = tmp$_3.iterator();
    while (tmp$_11.hasNext()) {
      var item_1 = tmp$_11.next();
      destination_1.add_11rb$(this.pkGetter(item_1));
    }
    tmp$_10 = destination_1;
  } else 
    tmp$_10 = null;
  var fakePkStartVal = ((tmp$_5 = (tmp$_4 = tmp$_10) != null ? minOrNull(tmp$_4) : null) != null ? tmp$_5 : L0).subtract(Kotlin.Long.fromInt(1));
  this.atomicLong_kaczvn$_0 = fakePkStartVal;
};
  function DefaultOneToManyJoinEditHelper$get_DefaultOneToManyJoinEditHelper$fakePkGenerator$lambda(this$DefaultOneToManyJoinEditHelper) {
    return function() {
  return (function(scope) {
  return this$DefaultOneToManyJoinEditHelper.atomicLong_kaczvn$_0 = this$DefaultOneToManyJoinEditHelper.atomicLong_kaczvn$_0.dec();
})(this);
};
  }
  Object.defineProperty(DefaultOneToManyJoinEditHelper.prototype, 'fakePkGenerator', {
  configurable: true, 
  get: function() {
  return DefaultOneToManyJoinEditHelper$get_DefaultOneToManyJoinEditHelper$fakePkGenerator$lambda(this);
}});
  function Coroutine$commitToDatabase_kc7sxt$($this, dao_0, fkSetter_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$dao = dao_0;
    this.local$fkSetter = fkSetter_0;
  }
  Coroutine$commitToDatabase_kc7sxt$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$commitToDatabase_kc7sxt$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$commitToDatabase_kc7sxt$.prototype.constructor = Coroutine$commitToDatabase_kc7sxt$;
  Coroutine$commitToDatabase_kc7sxt$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = OneToManyJoinEditHelper.prototype.commitToDatabase_kc7sxt$.call(this.$this, this.local$dao, this.local$fkSetter, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        this.result_0 = this.local$dao.deactivateByUids_ejltwb$(this.$this.primaryKeysToDeactivate, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        return;
      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);
};
  DefaultOneToManyJoinEditHelper.prototype.commitToDatabase_kc7sxt$ = function(dao_0, fkSetter_0, continuation_0, suspended) {
  var instance = new Coroutine$commitToDatabase_kc7sxt$(this, dao_0, fkSetter_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  DefaultOneToManyJoinEditHelper.prototype.doesNewEntityRequireFakePk_11rc$ = function(pk) {
  return equals(pk, L0);
};
  DefaultOneToManyJoinEditHelper.prototype.onSaveState_gtra9a$ = function(outState) {
  OneToManyJoinEditHelper.prototype.onSaveState_gtra9a$.call(this, outState);
  var key = this.serializationKey + OneToManyJoinEditHelper$Companion_getInstance().SUFFIX_PKS_TO_INSERT;
  var value = joinToString(this.pksToInsert, ',');
  outState.put_xwzc9p$(key, value);
  var key_0 = this.serializationKey + OneToManyJoinEditHelper$Companion_getInstance().SUFFIX_PKS_TO_DEACTIVATE;
  var value_0 = joinToString(this.pksToDeactivate, ',');
  outState.put_xwzc9p$(key_0, value_0);
};
  function DefaultOneToManyJoinEditHelper_init$lambda() {
    return L_1;
  }
  DefaultOneToManyJoinEditHelper.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'DefaultOneToManyJoinEditHelper', 
  interfaces: [OneToManyJoinEditHelper]};
  function DiTag() {
    DiTag_instance = this;
    this.TAG_CONTEXT_DATA_ROOT = 13;
    this.TAG_DEFAULT_CONTAINER_DIR = 11;
    this.TAG_GOOGLE_API = 12;
    this.TAG_PRESENTER_COROUTINE_SCOPE = 14;
    this.XPP_FACTORY_NSAWARE = 1;
    this.XPP_FACTORY_NSUNAWARE = 0;
    this.TAG_FILE_FFMPEG = 30;
    this.TAG_FILE_FFPROBE = 31;
    this.TAG_FILE_UPLOAD_TMP_DIR = 32;
  }
  DiTag.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'DiTag', 
  interfaces: []};
  var DiTag_instance = null;
  function DiTag_getInstance() {
    if (DiTag_instance === null) {
      new DiTag();
    }
    return DiTag_instance;
  }
  function EventCollator(maxWait, onCollate) {
    this.maxWait = maxWait;
    this.onCollate_0 = onCollate;
    this.channel_0 = Channel(2147483647);
    this.runJob_0 = null;
    this.mutex_0 = Mutex();
  }
  function Coroutine$collateAndFire_0($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
  }
  Coroutine$collateAndFire_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$collateAndFire_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$collateAndFire_0.prototype.constructor = Coroutine$collateAndFire_0;
  Coroutine$collateAndFire_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var fireList = LinkedHashSet_init();
        var channelResult;
        do {
          channelResult = this.$this.channel_0.tryReceive();
          if (channelResult.isSuccess) {
            var element = channelResult.getOrThrow();
            fireList.add_11rb$(element);
          }
        } while (channelResult.isSuccess);
        this.state_0 = 2;
        this.result_0 = this.$this.onCollate_0(toList(fireList), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        return;
      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);
};
  EventCollator.prototype.collateAndFire_0 = function(continuation_0, suspended) {
  var instance = new Coroutine$collateAndFire_0(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$EventCollator$send$lambda$lambda(this$EventCollator_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$EventCollator = this$EventCollator_0;
  }
  Coroutine$EventCollator$send$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$EventCollator$send$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$EventCollator$send$lambda$lambda.prototype.constructor = Coroutine$EventCollator$send$lambda$lambda;
  Coroutine$EventCollator$send$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = delay(this.local$this$EventCollator.maxWait, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$this$EventCollator.runJob_0 = null;
        this.state_0 = 3;
        this.result_0 = this.local$this$EventCollator.collateAndFire_0(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 EventCollator$send$lambda$lambda(this$EventCollator_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$EventCollator$send$lambda$lambda(this$EventCollator_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$send_11rb$($this, event_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$$receiver = void 0;
    this.local$event = event_0;
  }
  Coroutine$send_11rb$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$send_11rb$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$send_11rb$.prototype.constructor = Coroutine$send_11rb$;
  Coroutine$send_11rb$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.$this.channel_0.send_11rb$(this.local$event, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$$receiver = this.$this.mutex_0;
        this.state_0 = 3;
        this.result_0 = this.local$$receiver.lock_s8jyv4$(null, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        try {
          if (this.$this.runJob_0 == null) {
            this.$this.runJob_0 = launch(coroutines.GlobalScope, void 0, void 0, EventCollator$send$lambda$lambda(this.$this));
          }
          this.result_0 = Unit;
        } finally         {
          this.local$$receiver.unlock_s8jyv4$(null);
        }
        return;
      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);
};
  EventCollator.prototype.send_11rb$ = function(event_0, continuation_0, suspended) {
  var instance = new Coroutine$send_11rb$(this, event_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  EventCollator.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'EventCollator', 
  interfaces: []};
  function IdOption(description, optionId) {
    this.description = description;
    this.optionId = optionId;
  }
  IdOption.prototype.toString = function() {
  return this.description;
};
  IdOption.prototype.equals = function(other) {
  if (this === other) 
    return true;
  if (!Kotlin.isType(other, IdOption)) 
    return false;
  if (!equals(this.description, other.description)) 
    return false;
  if (this.optionId !== other.optionId) 
    return false;
  return true;
};
  IdOption.prototype.hashCode = function() {
  var result = hashCode(this.description);
  result = (31 * result | 0) + this.optionId | 0;
  return result;
};
  IdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'IdOption', 
  interfaces: []};
  function ListFilterIdOption(description, optionId) {
    IdOption.call(this, description, optionId);
  }
  ListFilterIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ListFilterIdOption', 
  interfaces: [IdOption]};
  function LiveDataWorkQueue(liveDataSource, sameItemFn, numProcessors, coroutineScope, mainDispatcher, onItemStarted, onItemFinished, onQueueEmpty, itemRunner) {
    if (numProcessors === void 0) 
      numProcessors = 1;
    if (coroutineScope === void 0) 
      coroutineScope = coroutines.GlobalScope;
    if (mainDispatcher === void 0) 
      mainDispatcher = coroutines.Dispatchers.Default;
    if (onItemStarted === void 0) 
      onItemStarted = LiveDataWorkQueue_init$lambda;
    if (onItemFinished === void 0) 
      onItemFinished = LiveDataWorkQueue_init$lambda_0;
    if (onQueueEmpty === void 0) 
      onQueueEmpty = LiveDataWorkQueue_init$lambda_1;
    this.liveDataSource_0 = liveDataSource;
    this.sameItemFn_0 = sameItemFn;
    this.numProcessors_0 = numProcessors;
    this.coroutineScope_0 = coroutineScope;
    this.mainDispatcher_0 = mainDispatcher;
    this.onItemStarted_0 = onItemStarted;
    this.onItemFinished_0 = onItemFinished;
    this.onQueueEmpty_0 = onQueueEmpty;
    this.itemRunner_0 = itemRunner;
    this.channel_0 = Channel(2147483647);
    this.queuedOrActiveItems_0 = copyOnWriteListOf([]);
    this.coroutineCtx_cfq6q2$_0 = this.coroutineCtx_cfq6q2$_0;
  }
  Object.defineProperty(LiveDataWorkQueue.prototype, 'coroutineCtx_0', {
  configurable: true, 
  get: function() {
  if (this.coroutineCtx_cfq6q2$_0 == null) 
    return throwUPAE('coroutineCtx');
  return this.coroutineCtx_cfq6q2$_0;
}, 
  set: function(coroutineCtx) {
  this.coroutineCtx_cfq6q2$_0 = coroutineCtx;
}});
  function Coroutine$LiveDataWorkQueue$start$lambda$lambda$lambda(this$LiveDataWorkQueue_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 7;
    this.local$this$LiveDataWorkQueue = this$LiveDataWorkQueue_0;
    this.local$nextItem = void 0;
    this.local$$receiver = $receiver_0;
  }
  Coroutine$LiveDataWorkQueue$start$lambda$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$LiveDataWorkQueue$start$lambda$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$LiveDataWorkQueue$start$lambda$lambda$lambda.prototype.constructor = Coroutine$LiveDataWorkQueue$start$lambda$lambda$lambda;
  Coroutine$LiveDataWorkQueue$start$lambda$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 1;
        continue;
      case 1:
        if (!get_isActive(this.local$$receiver)) {
          this.state_0 = 8;
          continue;
        }
        this.state_0 = 2;
        this.result_0 = this.local$this$LiveDataWorkQueue.channel_0.receive(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 2:
        this.local$nextItem = this.result_0;
        this.exceptionState_0 = 4;
        this.local$this$LiveDataWorkQueue.onItemStarted_0(this.local$nextItem);
        this.state_0 = 3;
        this.result_0 = this.local$this$LiveDataWorkQueue.itemRunner_0(this.local$nextItem, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.exceptionState_0 = 7;
        this.finallyPath_0 = [6];
        this.state_0 = 5;
        continue;
      case 4:
        this.finallyPath_0 = [7];
        this.exceptionState_0 = 5;
        var e = this.exception_0;
        if (Kotlin.isType(e, Exception)) {
          napier.Napier.e_82mfvz$('LiveDataWorkQueue: exception running item ' + this.local$nextItem, e);
        } else 
          throw e;
        this.finallyPath_0 = [6];
        this.state_0 = 5;
        continue;
      case 5:
        this.exceptionState_0 = 7;
        this.local$this$LiveDataWorkQueue.queuedOrActiveItems_0.remove_11rb$(this.local$nextItem);
        this.local$this$LiveDataWorkQueue.onItemFinished_0(this.local$nextItem);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 6:
        if (this.local$this$LiveDataWorkQueue.queuedOrActiveItems_0.isEmpty() && this.local$this$LiveDataWorkQueue.channel_0.isEmpty) 
          this.local$this$LiveDataWorkQueue.onQueueEmpty_0(this.local$nextItem);
        this.state_0 = 1;
        continue;
      case 7:
        throw this.exception_0;
      case 8:
        return Unit;
      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);
};
  function LiveDataWorkQueue$start$lambda$lambda$lambda(this$LiveDataWorkQueue_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$LiveDataWorkQueue$start$lambda$lambda$lambda(this$LiveDataWorkQueue_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$LiveDataWorkQueue$start$lambda(this$LiveDataWorkQueue_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$LiveDataWorkQueue = this$LiveDataWorkQueue_0;
    this.local$$receiver = $receiver_0;
  }
  Coroutine$LiveDataWorkQueue$start$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$LiveDataWorkQueue$start$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$LiveDataWorkQueue$start$lambda.prototype.constructor = Coroutine$LiveDataWorkQueue$start$lambda;
  Coroutine$LiveDataWorkQueue$start$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var times = this.local$this$LiveDataWorkQueue.numProcessors_0;
        for (var index = 0; index < times; index++) {
          launch(this.local$$receiver, void 0, void 0, LiveDataWorkQueue$start$lambda$lambda$lambda(this.local$this$LiveDataWorkQueue));
        }
        return Unit;
      case 1:
        throw this.exception_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 LiveDataWorkQueue$start$lambda(this$LiveDataWorkQueue_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$LiveDataWorkQueue$start$lambda(this$LiveDataWorkQueue_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$LiveDataWorkQueue$start$lambda_0(this$LiveDataWorkQueue_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$LiveDataWorkQueue = this$LiveDataWorkQueue_0;
  }
  Coroutine$LiveDataWorkQueue$start$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$LiveDataWorkQueue$start$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$LiveDataWorkQueue$start$lambda_0.prototype.constructor = Coroutine$LiveDataWorkQueue$start$lambda_0;
  Coroutine$LiveDataWorkQueue$start$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        return this.local$this$LiveDataWorkQueue.liveDataSource_0.observeForever_jsfaok$(this.local$this$LiveDataWorkQueue) , Unit;
      case 1:
        throw this.exception_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 LiveDataWorkQueue$start$lambda_0(this$LiveDataWorkQueue_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$LiveDataWorkQueue$start$lambda_0(this$LiveDataWorkQueue_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$start($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
  }
  Coroutine$start.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$start.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$start.prototype.constructor = Coroutine$start;
  Coroutine$start.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.$this.coroutineCtx_0 = this.context;
        launch(this.$this.coroutineScope_0, void 0, void 0, LiveDataWorkQueue$start$lambda(this.$this));
        this.state_0 = 2;
        this.result_0 = withContext(this.$this.mainDispatcher_0, LiveDataWorkQueue$start$lambda_0(this.$this), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        return;
      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);
};
  LiveDataWorkQueue.prototype.start = function(continuation_0, suspended) {
  var instance = new Coroutine$start(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function Coroutine$LiveDataWorkQueue$onChanged$lambda(closure$itemsToQueue_0, this$LiveDataWorkQueue_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$itemsToQueue = closure$itemsToQueue_0;
    this.local$this$LiveDataWorkQueue = this$LiveDataWorkQueue_0;
    this.local$tmp$ = void 0;
  }
  Coroutine$LiveDataWorkQueue$onChanged$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$LiveDataWorkQueue$onChanged$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$LiveDataWorkQueue$onChanged$lambda.prototype.constructor = Coroutine$LiveDataWorkQueue$onChanged$lambda;
  Coroutine$LiveDataWorkQueue$onChanged$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$tmp$ = this.local$closure$itemsToQueue.iterator();
        this.state_0 = 2;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 4;
          continue;
        }
        var element = this.local$tmp$.next();
        this.state_0 = 3;
        this.result_0 = this.local$this$LiveDataWorkQueue.channel_0.send_11rb$(element, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.state_0 = 2;
        continue;
      case 4:
        return Unit;
      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 LiveDataWorkQueue$onChanged$lambda(closure$itemsToQueue_0, this$LiveDataWorkQueue_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$LiveDataWorkQueue$onChanged$lambda(closure$itemsToQueue_0, this$LiveDataWorkQueue_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  LiveDataWorkQueue.prototype.onChanged_11rb$ = function(t) {
  var destination = ArrayList_init();
  var tmp$;
  tmp$ = t.iterator();
  loop_label:
    while (tmp$.hasNext()) {
      var element = tmp$.next();
      var $receiver = this.queuedOrActiveItems_0;
      var any$result;
      any$break:
        do {
          var tmp$_0;
          if (Kotlin.isType($receiver, Collection) && $receiver.isEmpty()) {
            any$result = false;
            break any$break;
          }
          tmp$_0 = $receiver.iterator();
          while (tmp$_0.hasNext()) {
            var element_0 = tmp$_0.next();
            if (this.sameItemFn_0(element_0, element)) {
              any$result = true;
              break any$break;
            }
          }
          any$result = false;
        } while (false);
      if (!any$result) 
        destination.add_11rb$(element);
    }
  var itemsToQueue = destination;
  this.queuedOrActiveItems_0.addAll_brywnq$(itemsToQueue);
  launch(this.coroutineScope_0, void 0, void 0, LiveDataWorkQueue$onChanged$lambda(itemsToQueue, this));
};
  function Coroutine$LiveDataWorkQueue$stop$lambda(this$LiveDataWorkQueue_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$LiveDataWorkQueue = this$LiveDataWorkQueue_0;
  }
  Coroutine$LiveDataWorkQueue$stop$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$LiveDataWorkQueue$stop$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$LiveDataWorkQueue$stop$lambda.prototype.constructor = Coroutine$LiveDataWorkQueue$stop$lambda;
  Coroutine$LiveDataWorkQueue$stop$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        return this.local$this$LiveDataWorkQueue.liveDataSource_0.removeObserver_jsfaok$(this.local$this$LiveDataWorkQueue) , Unit;
      case 1:
        throw this.exception_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 LiveDataWorkQueue$stop$lambda(this$LiveDataWorkQueue_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$LiveDataWorkQueue$stop$lambda(this$LiveDataWorkQueue_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$stop($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
  }
  Coroutine$stop.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$stop.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$stop.prototype.constructor = Coroutine$stop;
  Coroutine$stop.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = withContext(this.$this.mainDispatcher_0, LiveDataWorkQueue$stop$lambda(this.$this), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        cancel(this.$this.coroutineCtx_0);
        return;
      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);
};
  LiveDataWorkQueue.prototype.stop = function(continuation_0, suspended) {
  var instance = new Coroutine$stop(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  function LiveDataWorkQueue_init$lambda(it) {
    return Unit;
  }
  function LiveDataWorkQueue_init$lambda_0(it) {
    return Unit;
  }
  function LiveDataWorkQueue_init$lambda_1(it) {
    return Unit;
  }
  LiveDataWorkQueue.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'LiveDataWorkQueue', 
  interfaces: [DoorObserver]};
  function LocaleUtil() {
    LocaleUtil_instance = this;
    this.SUBONE = '%s';
  }
  LocaleUtil.prototype.chooseSystemLocale_ea4b5j$ = function(userPrefLocale, systemLocale, supportedLocales, fallbackLang) {
  var i;
  if (userPrefLocale != null && !equals(userPrefLocale, '')) {
    i = 0;
    while (i < supportedLocales.length) {
      if (equals(supportedLocales[i][0], userPrefLocale)) {
        return userPrefLocale;
      }
      i = i + 1 | 0;
    }
  }
  var systemLocaleShort = systemLocale.substring(0, 2);
  i = 0;
  while (i < supportedLocales.length) {
    if (startsWith(supportedLocales[i][0], systemLocaleShort)) {
      return supportedLocales[i][0];
    }
    i = i + 1 | 0;
  }
  return fallbackLang;
};
  LocaleUtil.prototype.formatMessage_puj7f4$ = function(message, substitution) {
  var i = indexOf_1(message, this.SUBONE);
  if (i === -1) {
    return message;
  }
  var sb = StringBuilder_init();
  if (i !== 0) {
    sb.append_pdl1vj$(message.substring(0, i));
  }
  sb.append_pdl1vj$(substitution);
  if (i < (message.length - 1 | 0)) {
    var startIndex = i + 2 | 0;
    sb.append_pdl1vj$(message.substring(startIndex));
  }
  return sb.toString();
};
  LocaleUtil.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'LocaleUtil', 
  interfaces: []};
  var LocaleUtil_instance = null;
  function LocaleUtil_getInstance() {
    if (LocaleUtil_instance === null) {
      new LocaleUtil();
    }
    return LocaleUtil_instance;
  }
  function min(x, y) {
    return x.compareTo_11rb$(y) < 0 ? x : y;
  }
  function LongWrapper(longValue) {
    LongWrapper$Companion_getInstance();
    this.longValue = longValue;
  }
  function LongWrapper$Companion() {
    LongWrapper$Companion_instance = this;
  }
  LongWrapper$Companion.prototype.serializer = function() {
  return LongWrapper$$serializer_getInstance();
};
  LongWrapper$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var LongWrapper$Companion_instance = null;
  function LongWrapper$Companion_getInstance() {
    if (LongWrapper$Companion_instance === null) {
      new LongWrapper$Companion();
    }
    return LongWrapper$Companion_instance;
  }
  function LongWrapper$$serializer() {
    this.descriptor_dwx6lb$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.util.LongWrapper', this, 1);
    this.descriptor.addElement_ivxn3r$('longValue', false);
    LongWrapper$$serializer_instance = this;
  }
  Object.defineProperty(LongWrapper$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_dwx6lb$_0;
}});
  LongWrapper$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  output.encodeLongElement_j0o2mv$(this.descriptor, 0, value.longValue);
  output.endStructure_24f42q$(this.descriptor);
};
  LongWrapper$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeLongElement_szpzho$(this.descriptor, 0);
          bitMask0 |= 1;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return LongWrapper_init(bitMask0, local0, null);
};
  LongWrapper$$serializer.prototype.childSerializers = function() {
  return [internal.LongSerializer];
};
  LongWrapper$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var LongWrapper$$serializer_instance = null;
  function LongWrapper$$serializer_getInstance() {
    if (LongWrapper$$serializer_instance === null) {
      new LongWrapper$$serializer();
    }
    return LongWrapper$$serializer_instance;
  }
  function LongWrapper_init(seen1, longValue, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(LongWrapper.prototype);
    if ((seen1 & 1) === 0) 
      throw MissingFieldException_init('longValue');
    else 
      $this.longValue = longValue;
    return $this;
  }
  LongWrapper.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'LongWrapper', 
  interfaces: []};
  LongWrapper.prototype.component1 = function() {
  return this.longValue;
};
  LongWrapper.prototype.copy_s8cxhz$ = function(longValue) {
  return new LongWrapper(longValue === void 0 ? this.longValue : longValue);
};
  LongWrapper.prototype.toString = function() {
  return 'LongWrapper(longValue=' + Kotlin.toString(this.longValue) + ')';
};
  LongWrapper.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.longValue) | 0;
  return result;
};
  LongWrapper.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && Kotlin.equals(this.longValue, other.longValue))));
};
  function MessageIdOption(messageId, context, code, di) {
    if (code === void 0) 
      code = messageId;
    IdOption.call(this, '', code);
    this.messageId = messageId;
    this.code = code;
    var tmp$;
    this.messageStr = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$ : throwCCE(), null).getString(this.messageId, context);
  }
  MessageIdOption.prototype.toString = function() {
  return this.messageStr;
};
  MessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'MessageIdOption', 
  interfaces: [IdOption]};
  function NavigateForResultOneToManyJoinEditListener(navigateForResultOptions, joinEditHelper) {
    this.navigateForResultOptions_6sub83$_0 = navigateForResultOptions;
    this.joinEditHelper_h13zmu$_0 = joinEditHelper;
  }
  NavigateForResultOneToManyJoinEditListener.prototype.onClickNew = function() {
  this.navigateForResultOptions_6sub83$_0.fromPresenter.navigateForResult_r13zgt$(this.navigateForResultOptions_6sub83$_0);
};
  NavigateForResultOneToManyJoinEditListener.prototype.onClickEdit_11rb$ = function(joinedEntity) {
  var navOptions = this.navigateForResultOptions_6sub83$_0.copy_xs9go5$(joinedEntity);
  navOptions.fromPresenter.navigateForResult_r13zgt$(navOptions);
};
  NavigateForResultOneToManyJoinEditListener.prototype.onClickDelete_11rb$ = function(joinedEntity) {
  this.joinEditHelper_h13zmu$_0.onDeactivateEntity_trkh7z$(joinedEntity);
};
  NavigateForResultOneToManyJoinEditListener.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'NavigateForResultOneToManyJoinEditListener', 
  interfaces: [OneToManyJoinEditListener]};
  function ObjectMessageIdOption(messageId, context, code, obj, di, displayString) {
    if (code === void 0) 
      code = messageId;
    if (displayString === void 0) 
      displayString = null;
    MessageIdOption.call(this, messageId, context, code, di);
    this.obj = obj;
    this.displayString_5pal2y$_0 = displayString;
  }
  ObjectMessageIdOption.prototype.toString = function() {
  var tmp$;
  return (tmp$ = this.displayString_5pal2y$_0) != null ? tmp$ : MessageIdOption.prototype.toString.call(this);
};
  ObjectMessageIdOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ObjectMessageIdOption', 
  interfaces: [MessageIdOption]};
  function OnListFilterOptionSelectedListener() {
  }
  OnListFilterOptionSelectedListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'OnListFilterOptionSelectedListener', 
  interfaces: []};
  function OneToManyJoinEditHelper(pkGetter, serializationKey, serializationStrategy, deserializationStrategy, newPk, editPresenter, entityClass, pkSetter, fakePkGenerator) {
    OneToManyJoinEditHelper$Companion_getInstance();
    if (serializationStrategy === void 0) 
      serializationStrategy = null;
    if (deserializationStrategy === void 0) 
      deserializationStrategy = null;
    this.pkGetter = pkGetter;
    this.serializationKey = serializationKey;
    this.serializationStrategy = serializationStrategy;
    this.deserializationStrategy = deserializationStrategy;
    this.newPk = newPk;
    this.entityClass = entityClass;
    this.pkSetter = pkSetter;
    this.fakePkGenerator_othtz4$_0 = fakePkGenerator;
    this.liveList = DoorMutableLiveData_init_0(emptyList());
    this.pksToInsert = ArrayList_init();
    this.pksToDeactivate = ArrayList_init();
    this.di_467vw4$_0 = null;
    this.di_467vw4$_0 = editPresenter.di;
    editPresenter.addJsonLoadListener_ypapg8$(this);
  }
  Object.defineProperty(OneToManyJoinEditHelper.prototype, 'fakePkGenerator', {
  get: function() {
  return this.fakePkGenerator_othtz4$_0;
}});
  OneToManyJoinEditHelper.prototype.onEditResult_trkh7z$ = function(entity) {
  var tmp$, tmp$_0;
  var pk = this.pkGetter(entity);
  tmp$ = this.liveList.getValue();
  if (tmp$ == null) {
    return;
  }
  var currentList = tmp$;
  var indexOfFirst$result;
  indexOfFirst$break:
    do {
      var tmp$_1;
      var index = 0;
      tmp$_1 = currentList.iterator();
      while (tmp$_1.hasNext()) {
        var item = tmp$_1.next();
        if (equals(this.pkGetter(item), pk)) {
          indexOfFirst$result = index;
          break indexOfFirst$break;
        }
        index = index + 1 | 0;
      }
      indexOfFirst$result = -1;
    } while (false);
  var entityIndex = indexOfFirst$result;
  if (entityIndex === -1) {
    if (this.doesNewEntityRequireFakePk_11rc$(this.pkGetter(entity))) {
      this.pkSetter(entity, this.fakePkGenerator());
    }
    var $receiver = this.pksToInsert;
    var element = this.pkGetter(entity);
    $receiver.add_11rb$(element);
    tmp$_0 = this.liveList.getValue();
    if (tmp$_0 == null) {
      return;
    }
    var listVal = tmp$_0;
    var newList = plus_1(listVal, entity);
    this.liveList.setVal_11rb$(newList);
  } else {
    var newList_0 = toMutableList(currentList);
    newList_0.set_wxm5ur$(entityIndex, entity);
    this.liveList.setVal_11rb$(newList_0);
  }
};
  OneToManyJoinEditHelper.prototype.onDeactivateEntity_trkh7z$ = function(entity) {
  var tmp$, tmp$_0;
  tmp$_0 = (tmp$ = this.liveList.getValue()) != null ? toMutableList(tmp$) : null;
  if (tmp$_0 == null) {
    return;
  }
  var listVal = tmp$_0;
  var pkToRemove = this.pkGetter(entity);
  var tmp$_1 = this.liveList;
  var destination = ArrayList_init();
  var tmp$_2;
  tmp$_2 = listVal.iterator();
  while (tmp$_2.hasNext()) {
    var element = tmp$_2.next();
    if (!equals(this.pkGetter(element), pkToRemove)) 
      destination.add_11rb$(element);
  }
  tmp$_1.sendValue_11rb$(destination);
  this.pksToDeactivate.add_11rb$(pkToRemove);
};
  Object.defineProperty(OneToManyJoinEditHelper.prototype, 'entitiesToInsert', {
  configurable: true, 
  get: function() {
  var tmp$;
  tmp$ = this.liveList.getValue();
  if (tmp$ == null) {
    return emptyList();
  }
  var listVal = tmp$;
  var destination = ArrayList_init();
  var tmp$_0;
  tmp$_0 = listVal.iterator();
  while (tmp$_0.hasNext()) {
    var element = tmp$_0.next();
    if (this.pksToInsert.contains_11rb$(this.pkGetter(element))) 
      destination.add_11rb$(element);
  }
  return destination;
}});
  Object.defineProperty(OneToManyJoinEditHelper.prototype, 'entitiesToUpdate', {
  configurable: true, 
  get: function() {
  var tmp$, tmp$_0;
  var tmp$_1;
  if ((tmp$ = this.liveList.getValue()) != null) {
    var destination = ArrayList_init();
    var tmp$_2;
    tmp$_2 = tmp$.iterator();
    while (tmp$_2.hasNext()) {
      var element = tmp$_2.next();
      if (!this.pksToInsert.contains_11rb$(this.pkGetter(element))) 
        destination.add_11rb$(element);
    }
    tmp$_1 = destination;
  } else 
    tmp$_1 = null;
  return (tmp$_0 = tmp$_1) != null ? tmp$_0 : emptyList();
}});
  Object.defineProperty(OneToManyJoinEditHelper.prototype, 'primaryKeysToDeactivate', {
  configurable: true, 
  get: function() {
  return toList(this.pksToDeactivate);
}});
  OneToManyJoinEditHelper.prototype.onSaveState_gtra9a$ = function(outState) {
  var tmp$, tmp$_0;
  tmp$ = this.liveList.getValue();
  if (tmp$ == null) {
    return;
  }
  var listVal = tmp$;
  tmp$_0 = this.serializationStrategy;
  if (tmp$_0 == null) {
    return;
  }
  var serializer = tmp$_0;
  var tmp$_1 = this.serializationKey;
  var di = this.di_467vw4$_0;
  var strategy = this.serializationStrategy;
  var tmp$_2;
  var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$_2 = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$_2 : throwCCE(), null);
  var value = json.encodeToString_tf03ej$(strategy, listVal);
  outState.put_xwzc9p$(tmp$_1, value);
};
  OneToManyJoinEditHelper.prototype.onLoadFromJsonSavedState_alv73c$ = function(savedState) {
  var tmp$, tmp$_0;
  tmp$ = savedState != null ? savedState.get_11rb$(this.serializationKey) : null;
  if (tmp$ == null) {
    return;
  }
  var listJsonStr = tmp$;
  tmp$_0 = this.deserializationStrategy;
  if (tmp$_0 == null) {
    return;
  }
  var deserializer = tmp$_0;
  var listVal = safeParseList(this.di_467vw4$_0, deserializer, this.entityClass, listJsonStr);
  this.liveList.setVal_11rb$(listVal);
};
  function Coroutine$commitToDatabase_kc7sxt$_0($this, dao_0, fkSetter_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$dao = dao_0;
    this.local$fkSetter = fkSetter_0;
  }
  Coroutine$commitToDatabase_kc7sxt$_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$commitToDatabase_kc7sxt$_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$commitToDatabase_kc7sxt$_0.prototype.constructor = Coroutine$commitToDatabase_kc7sxt$_0;
  Coroutine$commitToDatabase_kc7sxt$_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var $receiver = this.$this.entitiesToInsert;
        var tmp$;
        tmp$ = $receiver.iterator();
        while (tmp$.hasNext()) {
          var element = tmp$.next();
          this.local$fkSetter(element);
          this.$this.pkSetter(element, this.$this.newPk);
        }
        this.state_0 = 2;
        this.result_0 = this.local$dao.insertListAsync_4ezy5m$($receiver, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var $receiver_0 = this.$this.entitiesToUpdate;
        var tmp$_0;
        tmp$_0 = $receiver_0.iterator();
        while (tmp$_0.hasNext()) {
          var element_0 = tmp$_0.next();
          this.local$fkSetter(element_0);
        }
        this.state_0 = 3;
        this.result_0 = this.local$dao.updateListAsync_4ezy5m$($receiver_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        return;
      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);
};
  OneToManyJoinEditHelper.prototype.commitToDatabase_kc7sxt$ = function(dao_0, fkSetter_0, continuation_0, suspended) {
  var instance = new Coroutine$commitToDatabase_kc7sxt$_0(this, dao_0, fkSetter_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  OneToManyJoinEditHelper.prototype.doesNewEntityRequireFakePk_11rc$ = function(pk) {
  return true;
};
  function OneToManyJoinEditHelper$Companion() {
    OneToManyJoinEditHelper$Companion_instance = this;
    this.SUFFIX_PKS_TO_INSERT = '_pksToInsert';
    this.SUFFIX_PKS_TO_DEACTIVATE = '_pksToDeactivate';
  }
  OneToManyJoinEditHelper$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var OneToManyJoinEditHelper$Companion_instance = null;
  function OneToManyJoinEditHelper$Companion_getInstance() {
    if (OneToManyJoinEditHelper$Companion_instance === null) {
      new OneToManyJoinEditHelper$Companion();
    }
    return OneToManyJoinEditHelper$Companion_instance;
  }
  OneToManyJoinEditHelper.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'OneToManyJoinEditHelper', 
  interfaces: [UstadEditPresenter$JsonLoadListener]};
  function OneToManyJoinEditHelperMp(pkGetter, serializationKey, serializationStrategy, deserializationStrategy, editPresenter, savedStateHandle, entityClass, returnSavedStateKey, pkSetter) {
    OneToManyJoinEditHelperMp$Companion_getInstance();
    if (returnSavedStateKey === void 0) 
      returnSavedStateKey = serializationKey + OneToManyJoinEditHelperMp$Companion_getInstance().SUFFIX_RETKEY_DEFAULT;
    DefaultOneToManyJoinEditHelper.call(this, pkGetter, serializationKey, serializationStrategy, deserializationStrategy, editPresenter, entityClass, pkSetter);
    this.editPresenter_ptf7gi$_0 = editPresenter;
    this.savedStateHandle = savedStateHandle;
    this.returnSavedStateKey = returnSavedStateKey;
    this.editPresenter_ptf7gi$_0.observeSavedStateResult_27fjeh$(this.returnSavedStateKey, deserializationStrategy, entityClass, new DoorObserver(OneToManyJoinEditHelperMp_init$lambda(this)));
  }
  OneToManyJoinEditHelperMp.prototype.createNavigateForResultOptions_g113xi$ = function(destinationViewName, serializationStrategy, arguments_0) {
  if (arguments_0 === void 0) {
    arguments_0 = LinkedHashMap_init();
  }
  return new NavigateForResultOptions(this.editPresenter_ptf7gi$_0, null, destinationViewName, this.entityClass, serializationStrategy, this.returnSavedStateKey, true, arguments_0);
};
  OneToManyJoinEditHelperMp.prototype.createNavigateForResultListener_g113xi$ = function(editViewName, serializationStrategy, arguments_0) {
  if (arguments_0 === void 0) {
    arguments_0 = LinkedHashMap_init();
  }
  return new NavigateForResultOneToManyJoinEditListener(this.createNavigateForResultOptions_g113xi$(editViewName, serializationStrategy, arguments_0), this);
};
  function OneToManyJoinEditHelperMp$Companion() {
    OneToManyJoinEditHelperMp$Companion_instance = this;
    this.SUFFIX_RETKEY_DEFAULT = '_ret';
  }
  OneToManyJoinEditHelperMp$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var OneToManyJoinEditHelperMp$Companion_instance = null;
  function OneToManyJoinEditHelperMp$Companion_getInstance() {
    if (OneToManyJoinEditHelperMp$Companion_instance === null) {
      new OneToManyJoinEditHelperMp$Companion();
    }
    return OneToManyJoinEditHelperMp$Companion_instance;
  }
  function OneToManyJoinEditHelperMp_init$lambda(this$OneToManyJoinEditHelperMp) {
    return function(it) {
  var tmp$;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var newValue = tmp$;
  this$OneToManyJoinEditHelperMp.onEditResult_trkh7z$(newValue);
  this$OneToManyJoinEditHelperMp.savedStateHandle.set_umlfku$(this$OneToManyJoinEditHelperMp.returnSavedStateKey, null);
  return Unit;
};
  }
  OneToManyJoinEditHelperMp.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'OneToManyJoinEditHelperMp', 
  interfaces: [DefaultOneToManyJoinEditHelper]};
  function OneToManyJoinEditListener() {
  }
  OneToManyJoinEditListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'OneToManyJoinEditListener', 
  interfaces: []};
  function RateLimitedLiveData(db, tableNames, interval, getter) {
    if (interval === void 0) 
      interval = L1000;
    DoorMutableLiveData_init(this);
    this.db_0 = db;
    this.interval_0 = interval;
    this.getter_0 = getter;
    this.changeListenerRequest_0 = new ChangeListenerRequest(tableNames, new TablesInvalidationListener(RateLimitedLiveData$changeListenerRequest$lambda(this)));
    this.lastCheckTime_0 = L0;
    this.refreshCheckJob_0 = null;
  }
  function Coroutine$RateLimitedLiveData$invalidate$lambda(this$RateLimitedLiveData_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$RateLimitedLiveData = this$RateLimitedLiveData_0;
  }
  Coroutine$RateLimitedLiveData$invalidate$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$RateLimitedLiveData$invalidate$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$RateLimitedLiveData$invalidate$lambda.prototype.constructor = Coroutine$RateLimitedLiveData$invalidate$lambda;
  Coroutine$RateLimitedLiveData$invalidate$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$RateLimitedLiveData.refresh_0(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 RateLimitedLiveData$invalidate$lambda(this$RateLimitedLiveData_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$RateLimitedLiveData$invalidate$lambda(this$RateLimitedLiveData_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$RateLimitedLiveData$invalidate$lambda_0(this$RateLimitedLiveData_0, closure$timeNow_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$RateLimitedLiveData = this$RateLimitedLiveData_0;
    this.local$closure$timeNow = closure$timeNow_0;
  }
  Coroutine$RateLimitedLiveData$invalidate$lambda_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$RateLimitedLiveData$invalidate$lambda_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$RateLimitedLiveData$invalidate$lambda_0.prototype.constructor = Coroutine$RateLimitedLiveData$invalidate$lambda_0;
  Coroutine$RateLimitedLiveData$invalidate$lambda_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = delay(this.local$this$RateLimitedLiveData.lastCheckTime_0.add(this.local$this$RateLimitedLiveData.interval_0).subtract(this.local$closure$timeNow), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        this.result_0 = this.local$this$RateLimitedLiveData.refresh_0(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 RateLimitedLiveData$invalidate$lambda_0(this$RateLimitedLiveData_0, closure$timeNow_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$RateLimitedLiveData$invalidate$lambda_0(this$RateLimitedLiveData_0, closure$timeNow_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  RateLimitedLiveData.prototype.invalidate_0 = function() {
  var timeNow = systemTimeInMillis();
  if (timeNow.subtract(this.lastCheckTime_0).compareTo_11rb$(this.interval_0) >= 0) {
    launch(coroutines.GlobalScope, void 0, void 0, RateLimitedLiveData$invalidate$lambda(this));
  } else if (this.refreshCheckJob_0 == null) {
    this.refreshCheckJob_0 = launch(coroutines.GlobalScope, void 0, void 0, RateLimitedLiveData$invalidate$lambda_0(this, timeNow));
  }
};
  function Coroutine$refresh_0($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
  }
  Coroutine$refresh_0.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$refresh_0.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$refresh_0.prototype.constructor = Coroutine$refresh_0;
  Coroutine$refresh_0.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.$this.refreshCheckJob_0 = null;
        this.$this.lastCheckTime_0 = systemTimeInMillis();
        this.state_0 = 2;
        this.result_0 = this.$this.getter_0(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.$this.sendValue_11rb$(this.result_0);
        return;
      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);
};
  RateLimitedLiveData.prototype.refresh_0 = function(continuation_0, suspended) {
  var instance = new Coroutine$refresh_0(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  RateLimitedLiveData.prototype.onActive2 = function() {
  DoorMutableLiveData.prototype.onActive2.call(this);
  addInvalidationListener(this.db_0, this.changeListenerRequest_0);
  this.invalidate_0();
};
  RateLimitedLiveData.prototype.onInactive2 = function() {
  DoorMutableLiveData.prototype.onInactive2.call(this);
  removeInvalidationListener(this.db_0, this.changeListenerRequest_0);
};
  function RateLimitedLiveData$changeListenerRequest$lambda(this$RateLimitedLiveData) {
    return function(it) {
  this$RateLimitedLiveData.invalidate_0();
  return Unit;
};
  }
  RateLimitedLiveData.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'RateLimitedLiveData', 
  interfaces: [DoorMutableLiveData]};
  function safeStringify(di, strategy, klass, entity) {
    return Json.Default.encodeToString_tf03ej$(strategy, entity);
  }
  var MS_PER_HOUR;
  var MS_PER_MIN;
  function millisSinceMidnightToHoursAndMins(millisSinceMidnight) {
    return new Pair(millisSinceMidnight / MS_PER_HOUR | 0, millisSinceMidnight % MS_PER_HOUR / MS_PER_MIN | 0);
  }
  function hoursAndMinsToMillisSinceMidnight(hours, mins) {
    return Kotlin.imul(hours, MS_PER_HOUR) + Kotlin.imul(mins, MS_PER_MIN) | 0;
  }
  function ScopedGrantOneToManyHelper(repo, editPresenter, savedStateHandle, entityTableId) {
    ScopedGrantOneToManyHelper$Companion_getInstance();
    DefaultOneToManyJoinEditHelper.call(this, ScopedGrantOneToManyHelper_init$lambda, 'ScopedGrantAndName', ListSerializer(ScopedGrantAndName.Companion.serializer()), ListSerializer(ScopedGrantAndName.Companion.serializer()), editPresenter, getKClass(ScopedGrantAndName), ScopedGrantOneToManyHelper_init$lambda_0);
    this.repo = repo;
    this.editPresenter = editPresenter;
    this.savedStateHandle = savedStateHandle;
    this.entityTableId = entityTableId;
    this.editPresenter.observeSavedStateResult_27fjeh$(ScopedGrantOneToManyHelper$Companion_getInstance().SAVEDSTATE_KEY_SCOPEDGRANT_RESULTS, ListSerializer(ScopedGrant.Companion.serializer()), getKClass(ScopedGrant), new DoorObserver(ScopedGrantOneToManyHelper_init$lambda_1(this)));
  }
  ScopedGrantOneToManyHelper.prototype.get_defaultNameByFlag_ar9drr$ = function($receiver) {
  if (hasFlag($receiver.sgFlags, 8)) 
    return 'Teachers';
  else if (hasFlag($receiver.sgFlags, 16)) 
    return 'Students';
  else 
    return null;
};
  function Coroutine$commitToDatabase_pqsauo$($this, repo_0, entityUid_0, flagToGroupMap_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$repo = repo_0;
    this.local$entityUid = entityUid_0;
    this.local$flagToGroupMap = flagToGroupMap_0;
  }
  Coroutine$commitToDatabase_pqsauo$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$commitToDatabase_pqsauo$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$commitToDatabase_pqsauo$.prototype.constructor = Coroutine$commitToDatabase_pqsauo$;
  Coroutine$commitToDatabase_pqsauo$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$flagToGroupMap === void 0) {
          this.local$flagToGroupMap = emptyMap();
        }
        var entitiesToInsertVal = this.$this.entitiesToInsert;
        var tmp$;
        tmp$ = entitiesToInsertVal.iterator();
        loop_label:
          while (tmp$.hasNext()) {
            var element = tmp$.next();
            var tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6, tmp$_7;
            if ((tmp$_0 = element.scopedGrant) != null) {
              var tmp$_8, tmp$_9;
              if (equals(tmp$_0.sgGroupUid, L0)) {
                var $receiver = this.local$flagToGroupMap.entries;
                var firstOrNull$result;
                firstOrNull$break:
                  do {
                    var tmp$_10;
                    tmp$_10 = $receiver.iterator();
                    while (tmp$_10.hasNext()) {
                      var element_0 = tmp$_10.next();
                      if (hasFlag(tmp$_0.sgFlags, element_0.key)) {
                        firstOrNull$result = element_0;
                        break firstOrNull$break;
                      }
                    }
                    firstOrNull$result = null;
                  } while (false);
                tmp$_0.sgGroupUid = (tmp$_9 = (tmp$_8 = firstOrNull$result) != null ? tmp$_8.value : null) != null ? tmp$_9 : L0;
              }
            }
            var groupToAssign = (tmp$_3 = this.local$flagToGroupMap.get_11rb$((tmp$_2 = (tmp$_1 = element.scopedGrant) != null ? tmp$_1.sgFlags : null) != null ? tmp$_2 : 0)) != null ? tmp$_3 : L_1;
                        (tmp$_5 = (tmp$_4 = element.scopedGrant) != null ? equals(tmp$_4.sgGroupUid, L0) && !equals(groupToAssign, L_1) ? tmp$_4 : null : null) != null ? (tmp$_5.sgGroupUid = groupToAssign) : null;
                        (tmp$_6 = element.scopedGrant) != null ? (tmp$_6.sgUid = L0) : null;
            if ((tmp$_7 = element.scopedGrant) != null) {
              tmp$_7.sgTableId = this.$this.entityTableId;
              tmp$_7.sgEntityUid = this.local$entityUid;
            }
          }
        var tmp$_11 = this.local$repo.scopedGrantDao;
        var destination = ArrayList_init();
        var tmp$_12;
        tmp$_12 = entitiesToInsertVal.iterator();
        while (tmp$_12.hasNext()) {
          var element_1 = tmp$_12.next();
          var tmp$_0_0;
          if ((tmp$_0_0 = element_1.scopedGrant) != null) {
            destination.add_11rb$(tmp$_0_0);
          }
        }
        this.state_0 = 2;
        this.result_0 = tmp$_11.insertListAsync_djn83v$(destination, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var tmp$_13 = this.local$repo.scopedGrantDao;
        var $receiver_0 = this.$this.entitiesToUpdate;
        var destination_0 = ArrayList_init();
        var tmp$_14;
        tmp$_14 = $receiver_0.iterator();
        while (tmp$_14.hasNext()) {
          var element_2 = tmp$_14.next();
          var tmp$_0_1;
          if ((tmp$_0_1 = element_2.scopedGrant) != null) {
            destination_0.add_11rb$(tmp$_0_1);
          }
        }
        this.state_0 = 3;
        this.result_0 = tmp$_13.updateListAsync_djn83v$(destination_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        return;
      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);
};
  ScopedGrantOneToManyHelper.prototype.commitToDatabase_pqsauo$ = function(repo_0, entityUid_0, flagToGroupMap_0, continuation_0, suspended) {
  var instance = new Coroutine$commitToDatabase_pqsauo$(this, repo_0, entityUid_0, flagToGroupMap_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  ScopedGrantOneToManyHelper.prototype.onClickNew = function() {
  this.editPresenter.saveStateToNavController();
  var args = mutableMapOf([to(ScopedGrantEditView$Companion_getInstance().ARG_PERMISSION_LIST, this.entityTableId.toString()), to(UstadView$Companion_getInstance().ARG_GO_TO_COMPLETE, ScopedGrantEditView$Companion_getInstance().VIEW_NAME), to(UstadView$Companion_getInstance().ARG_LISTMODE, ListViewMode$PICKER_getInstance().toString())]);
  this.editPresenter.navigateForResult_r13zgt$(new NavigateForResultOptions(this.editPresenter, null, PersonListView$Companion_getInstance().VIEW_NAME, getKClass(ScopedGrant), ScopedGrant.Companion.serializer(), ScopedGrantOneToManyHelper$Companion_getInstance().SAVEDSTATE_KEY_SCOPEDGRANT_RESULTS, void 0, args));
};
  ScopedGrantOneToManyHelper.prototype.onClickEdit_11rb$ = function(joinedEntity) {
  var args = mutableMapOf([to(ScopedGrantEditView$Companion_getInstance().ARG_PERMISSION_LIST, this.entityTableId.toString())]);
  this.editPresenter.navigateForResult_r13zgt$(new NavigateForResultOptions(this.editPresenter, joinedEntity.scopedGrant, ScopedGrantEditView$Companion_getInstance().VIEW_NAME, getKClass(ScopedGrant), ScopedGrant.Companion.serializer(), ScopedGrantOneToManyHelper$Companion_getInstance().SAVEDSTATE_KEY_SCOPEDGRANT_RESULTS, void 0, args));
};
  ScopedGrantOneToManyHelper.prototype.onClickDelete_11rb$ = function(joinedEntity) {
  this.onDeactivateEntity_trkh7z$(joinedEntity);
};
  function ScopedGrantOneToManyHelper$Companion() {
    ScopedGrantOneToManyHelper$Companion_instance = this;
    this.SAVEDSTATE_KEY_SCOPEDGRANT_RESULTS = 'ScopedGrant_result';
  }
  ScopedGrantOneToManyHelper$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ScopedGrantOneToManyHelper$Companion_instance = null;
  function ScopedGrantOneToManyHelper$Companion_getInstance() {
    if (ScopedGrantOneToManyHelper$Companion_instance === null) {
      new ScopedGrantOneToManyHelper$Companion();
    }
    return ScopedGrantOneToManyHelper$Companion_instance;
  }
  function ScopedGrantOneToManyHelper_init$lambda(it) {
    var tmp$, tmp$_0;
    return (tmp$_0 = (tmp$ = it.scopedGrant) != null ? tmp$.sgUid : null) != null ? tmp$_0 : L0;
  }
  function ScopedGrantOneToManyHelper_init$lambda_0($receiver, it) {
    var tmp$;
        (tmp$ = $receiver.scopedGrant) != null ? (tmp$.sgUid = it) : null;
    return Unit;
  }
  function Coroutine$ScopedGrantOneToManyHelper_init$lambda$lambda(this$ScopedGrantOneToManyHelper_0, closure$newValue_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$ScopedGrantOneToManyHelper = this$ScopedGrantOneToManyHelper_0;
    this.local$closure$newValue = closure$newValue_0;
  }
  Coroutine$ScopedGrantOneToManyHelper_init$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$ScopedGrantOneToManyHelper_init$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$ScopedGrantOneToManyHelper_init$lambda$lambda.prototype.constructor = Coroutine$ScopedGrantOneToManyHelper_init$lambda$lambda;
  Coroutine$ScopedGrantOneToManyHelper_init$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$ScopedGrantOneToManyHelper.repo.personGroupDao.findNameByGroupUid_s8cxhz$(this.local$closure$newValue.sgGroupUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var groupName = this.result_0;
        var tmp$ = this.local$this$ScopedGrantOneToManyHelper;
        var $receiver = new ScopedGrantAndName();
        var closure$newValue = this.local$closure$newValue;
        var this$ScopedGrantOneToManyHelper = this.local$this$ScopedGrantOneToManyHelper;
        var tmp$_0;
        $receiver.scopedGrant = closure$newValue;
        $receiver.name = groupName != null ? groupName : (tmp$_0 = $receiver.scopedGrant) != null ? this$ScopedGrantOneToManyHelper.get_defaultNameByFlag_ar9drr$(tmp$_0) : null;
        tmp$.onEditResult_trkh7z$($receiver);
        return this.local$this$ScopedGrantOneToManyHelper.savedStateHandle.set_umlfku$(ScopedGrantOneToManyHelper$Companion_getInstance().SAVEDSTATE_KEY_SCOPEDGRANT_RESULTS, null) , Unit;
      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 ScopedGrantOneToManyHelper_init$lambda$lambda(this$ScopedGrantOneToManyHelper_0, closure$newValue_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$ScopedGrantOneToManyHelper_init$lambda$lambda(this$ScopedGrantOneToManyHelper_0, closure$newValue_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function ScopedGrantOneToManyHelper_init$lambda_1(this$ScopedGrantOneToManyHelper) {
    return function(it) {
  var tmp$;
  tmp$ = firstOrNull(it);
  if (tmp$ == null) {
    return;
  }
  var newValue = tmp$;
  launch(coroutines.GlobalScope, doorMainDispatcher(), void 0, ScopedGrantOneToManyHelper_init$lambda$lambda(this$ScopedGrantOneToManyHelper, newValue));
  return Unit;
};
  }
  ScopedGrantOneToManyHelper.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ScopedGrantOneToManyHelper', 
  interfaces: [OneToManyJoinEditListener, DefaultOneToManyJoinEditHelper]};
  function SortOrderOption(fieldMessageId, flag, order) {
    this.fieldMessageId = fieldMessageId;
    this.flag = flag;
    this.order = order;
  }
  SortOrderOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SortOrderOption', 
  interfaces: []};
  SortOrderOption.prototype.component1 = function() {
  return this.fieldMessageId;
};
  SortOrderOption.prototype.component2 = function() {
  return this.flag;
};
  SortOrderOption.prototype.component3 = function() {
  return this.order;
};
  SortOrderOption.prototype.copy_ydzd23$ = function(fieldMessageId, flag, order) {
  return new SortOrderOption(fieldMessageId === void 0 ? this.fieldMessageId : fieldMessageId, flag === void 0 ? this.flag : flag, order === void 0 ? this.order : order);
};
  SortOrderOption.prototype.toString = function() {
  return 'SortOrderOption(fieldMessageId=' + Kotlin.toString(this.fieldMessageId) + (', flag=' + Kotlin.toString(this.flag)) + (', order=' + Kotlin.toString(this.order)) + ')';
};
  SortOrderOption.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.fieldMessageId) | 0;
  result = result * 31 + Kotlin.hashCode(this.flag) | 0;
  result = result * 31 + Kotlin.hashCode(this.order) | 0;
  return result;
};
  SortOrderOption.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.fieldMessageId, other.fieldMessageId) && Kotlin.equals(this.flag, other.flag) && Kotlin.equals(this.order, other.order)))));
};
  function TreeOneToManyJoinEditListener() {
  }
  TreeOneToManyJoinEditListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'TreeOneToManyJoinEditListener', 
  interfaces: [OneToManyJoinEditListener]};
  function UMCalendarUtil() {
    UMCalendarUtil_instance = this;
    this.httpDateFormat_0 = DateFormat.Companion.invoke_61zpoe$('EEE, dd MMM yyyy HH:mm:ss z');
    this.httpDateFormat2_0 = DateFormat.Companion.invoke_61zpoe$('EEE, dd-MMM-yyyy HH:mm:ss z');
    this.iso8601DateFormat_0 = DateFormat.Companion.invoke_61zpoe$("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
    this.opdsDateFormat_0 = DateFormat.Companion.invoke_61zpoe$("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
    this.otherOpdsFormat_0 = DateFormat.Companion.invoke_61zpoe$("yyyy-MM-dd'T'HH:mm:ss'Z'");
    this.listOfFormats_0 = listOf([this.httpDateFormat_0, this.httpDateFormat2_0, this.iso8601DateFormat_0, this.opdsDateFormat_0, this.otherOpdsFormat_0]);
  }
  UMCalendarUtil.prototype.makeHTTPDate_s8cxhz$ = function(time) {
  var cal = DateTime.Companion.invoke_s8cxhz$(time);
  return cal.format_cgtbg3$(this.httpDateFormat_0);
};
  UMCalendarUtil.prototype.parseOpdsDate_61zpoe$ = function(data) {
  var tmp$;
  tmp$ = this.listOfFormats_0.iterator();
  while (tmp$.hasNext()) {
    var element = tmp$.next();
    try {
      return parse(element, data).local;
    }    catch (e) {
  if (!Kotlin.isType(e, DateException)) 
    throw e;
}
  }
  throw IllegalArgumentException_init('no date format found for the following date: ' + data);
};
  UMCalendarUtil.prototype.parse8601Timestamp_61zpoe$ = function(timestamp) {
  var date = DateTime.Companion.invoke_4lrum3$(new Year(toInt(timestamp.substring(0, 4))), Month.Companion.invoke_za3lpa$(toInt(timestamp.substring(5, 7))), toInt(timestamp.substring(8, 10)), toInt(timestamp.substring(11, 13)), toInt(timestamp.substring(14, 16)), toInt(timestamp.substring(17, 19)), 0);
  return date.unixMillisLong;
};
  UMCalendarUtil.prototype.parse8601TimestampOrDefault_67ydmm$ = function(timestamp, defaultTime) {
  if (defaultTime === void 0) 
    defaultTime = getSystemTimeInMillis();
  var tmp$;
  if (timestamp != null) {
    tmp$ = this.parse8601Timestamp_61zpoe$(timestamp);
  } else {
    tmp$ = defaultTime;
  }
  return tmp$;
};
  UMCalendarUtil.prototype.getPrettyDateWithTimeFromLongSimple_s8cxhz$ = function(thisDate) {
  var format = DateFormat.Companion.invoke_61zpoe$('HH:mm,  dd MMM yy');
  var cal = DateTime.Companion.invoke_s8cxhz$(thisDate);
  return cal.format_cgtbg3$(format);
};
  UMCalendarUtil.prototype.getDateInMilliPlusDays_za3lpa$ = function(nDays) {
  var now = DateTime.Companion.now();
  var duration = TimeSpan.Companion.fromDays_14dthe$(nDays);
  var then = now.plus_fv8bff$(duration);
  return then.unixMillisLong;
};
  UMCalendarUtil.prototype.getLongDateFromStringAndFormat_18o3fo$ = function(dateString, format, locale) {
  try {
    var formatted = DateFormat.Companion.invoke_61zpoe$(format);
    var date = parse(formatted, dateString);
    return Kotlin.Long.fromNumber(date.local.unixMillis);
  }  catch (e) {
  if (Kotlin.isType(e, DateException)) {
    return L0;
  } else 
    throw e;
}
};
  UMCalendarUtil.prototype.getDateInMilliPlusDaysRelativeTo_yhmem3$ = function(dateLong, days) {
  var givenCal = DateTime.Companion.invoke_s8cxhz$(dateLong);
  var duration = TimeSpan.Companion.fromDays_14dthe$(days);
  var then = givenCal.plus_fv8bff$(duration);
  return then.unixMillisLong;
};
  UMCalendarUtil.prototype.getToday000000 = function() {
  var cal = DateTime.Companion.now();
  var ntcal = DateTime.Companion.invoke_4lrum3$(cal.year, cal.month, cal.dayOfMonth, 0, 0, 0, 0);
  return ntcal.unixMillisLong;
};
  UMCalendarUtil.prototype.getToday235959 = function() {
  var cal = DateTime.Companion.now();
  var ntcal = DateTime.Companion.invoke_4lrum3$(cal.year, cal.month, cal.dayOfMonth, 23, 59, 59);
  return ntcal.unixMillisLong;
};
  UMCalendarUtil.prototype.isToday_s8cxhz$ = function(dateLong) {
  var givenCal = DateTime.Companion.invoke_s8cxhz$(dateLong);
  var todayCal = DateTime.Companion.now();
  return givenCal.dayOfYear === todayCal.dayOfYear && givenCal.dayOfMonth === todayCal.dayOfMonth && givenCal.dayOfWeekInt === todayCal.dayOfWeekInt;
};
  UMCalendarUtil.prototype.getDateLongFromYMD_qt1dr2$ = function(year, month, day) {
  var cal = DateTime.Companion.invoke_ui44o2$(year, month, day);
  return cal.unixMillisLong;
};
  UMCalendarUtil.prototype.getPrettyDateSuperSimpleFromLong_s8cxhz$ = function(thisDate) {
  var format = DateFormat.Companion.invoke_61zpoe$('dd/MMM/yyyy');
  var cal = DateTime.Companion.invoke_s8cxhz$(thisDate);
  return cal.format_cgtbg3$(format);
};
  UMCalendarUtil.prototype.showTimeForGivenLongDate_s8cxhz$ = function(thisDate) {
  var format = DateFormat.Companion.invoke_61zpoe$('HH:mm');
  var cal = DateTime.Companion.invoke_s8cxhz$(thisDate);
  return cal.format_cgtbg3$(format);
};
  UMCalendarUtil.prototype.zeroOutTimeForGivenLongDate_s8cxhz$ = function(thisDate) {
  var cal = DateTime.Companion.invoke_s8cxhz$(thisDate);
  var ntcal = DateTime.Companion.invoke_4lrum3$(cal.year, cal.month, cal.dayOfMonth, 0, 0, 0, 0);
  return ntcal.unixMillisLong;
};
  UMCalendarUtil.prototype.changeDatetoThis_3pjtqy$ = function(thisDate, startTimeMins) {
  var cal = DateTime.Companion.invoke_s8cxhz$(thisDate);
  var ntcal = DateTime.Companion.invoke_4lrum3$(cal.year, cal.month, cal.dayOfMonth, startTimeMins.div(Kotlin.Long.fromInt(60)).toInt(), startTimeMins.modulo(Kotlin.Long.fromInt(60)).toInt(), 0, 0);
  return ntcal.unixMillisLong;
};
  UMCalendarUtil.prototype.normalizeSecondsAndMillis_s8cxhz$ = function(thisDate) {
  var cal = DateTime.Companion.invoke_s8cxhz$(thisDate);
  var ntcal = DateTime.Companion.invoke_4lrum3$(cal.year, cal.month, cal.dayOfMonth, cal.hours, cal.minutes, 0, 0);
  return ntcal.unixMillisLong;
};
  UMCalendarUtil.prototype.getHourOfDay24_s8cxhz$ = function(thisDate) {
  var cal = DateTime.Companion.invoke_s8cxhz$(thisDate);
  return cal.hours;
};
  UMCalendarUtil.prototype.getMinuteOfDay_s8cxhz$ = function(thisDate) {
  var cal = DateTime.Companion.invoke_s8cxhz$(thisDate);
  return cal.minutes;
};
  UMCalendarUtil.prototype.getDayOfWeek_s8cxhz$ = function(thisDate) {
  var cal = DateTime.Companion.invoke_s8cxhz$(thisDate);
  return cal.dayOfWeekInt;
};
  UMCalendarUtil.prototype.setDayOfWeek_yhmem3$ = function(thisDate, dow) {
  var cal = DateTime.Companion.invoke_s8cxhz$(thisDate);
  var currentDOW = cal.dayOfWeekInt;
  if (currentDOW === dow) {
    return this.getDateInMilliPlusDaysRelativeTo_yhmem3$(thisDate, 7);
  } else if (currentDOW < dow) {
    return this.getDateInMilliPlusDaysRelativeTo_yhmem3$(thisDate, dow - currentDOW | 0);
  } else if (currentDOW > dow) {
    var plus = 7 - currentDOW + dow | 0;
    return this.getDateInMilliPlusDaysRelativeTo_yhmem3$(thisDate, plus);
  } else {
    return this.getDateInMilliPlusDaysRelativeTo_yhmem3$(thisDate, 0);
  }
};
  UMCalendarUtil.prototype.getPrettyTimeFromLong_3pqv43$ = function(thisDate, locale) {
  var format = DateFormat.Companion.invoke_61zpoe$('HH:mm');
  var cal = DateTime.Companion.invoke_s8cxhz$(thisDate);
  return cal.format_cgtbg3$(format);
};
  UMCalendarUtil.prototype.getPrettyDateFromLong_3pqv43$ = function(thisDate, locale) {
  var format = DateFormat.Companion.invoke_61zpoe$('EEE, dd/MMM/yyyy');
  var cal = DateTime.Companion.invoke_s8cxhz$(thisDate);
  return cal.format_cgtbg3$(format);
};
  UMCalendarUtil.prototype.getSimpleDayFromLongDate_3pqv43$ = function(thisDate, locale) {
  var format = DateFormat.Companion.invoke_61zpoe$('EEEE');
  var cal = DateTime.Companion.invoke_s8cxhz$(thisDate);
  return cal.format_cgtbg3$(format);
};
  UMCalendarUtil.prototype.getPrettyDateSuperSimpleFromLong_3pqv43$ = function(thisDate, locale) {
  return this.getPrettyDateSuperSimpleFromLong_s8cxhz$(thisDate);
};
  UMCalendarUtil.prototype.getPrettyDateSimpleWithoutYearFromLong_3pqv43$ = function(thisDate, locale) {
  var format = DateFormat.Companion.invoke_61zpoe$('dd/MMM');
  var cal = DateTime.Companion.invoke_s8cxhz$(thisDate);
  return cal.format_cgtbg3$(format);
};
  UMCalendarUtil.prototype.getPrettySuperSimpleDateSimpleWithoutYearFromLong_s8cxhz$ = function(thisDate) {
  return this.getPrettyDateSimpleWithoutYearFromLong_3pqv43$(thisDate, null);
};
  UMCalendarUtil.prototype.getPrettyDateSimpleFromLong_3pqv43$ = function(thisDate, locale) {
  return this.getPrettyDateSuperSimpleFromLong_s8cxhz$(thisDate);
};
  UMCalendarUtil.prototype.setDate_qt1dr2$ = function(year, month, dayOfMonth) {
  return DateTime.Companion.invoke_ui44o2$(year, month, dayOfMonth);
};
  UMCalendarUtil.prototype.copyCalendarAndAdvanceTo_90jq3i$ = function(dateTime, dayOfWeek, incToday) {
  var calendar = DateTime.Companion.invoke_s8cxhz$(dateTime);
  var comparisonCalendarLong = calendar.unixMillisLong;
  var comparisonCalendar = DateTime.Companion.invoke_s8cxhz$(comparisonCalendarLong);
  var today = this.getDayOfWeek_s8cxhz$(dateTime);
  if (today === dayOfWeek) {
    if (!incToday) {
      var newLong = dateTime.add(Kotlin.Long.fromInt(604800000));
      comparisonCalendar = DateTime.Companion.invoke_s8cxhz$(newLong);
    }
    if (comparisonCalendar.dayOfWeekInt === calendar.dayOfWeekInt && calendar.dayOfWeekInt === dayOfWeek) {
      return comparisonCalendar.unixMillisLong;
    }
    comparisonCalendarLong = this.setDayOfWeek_yhmem3$(comparisonCalendar.unixMillisLong, dayOfWeek);
    return comparisonCalendarLong;
  }
  var deltaDays;
  if (dayOfWeek > today) {
    deltaDays = dayOfWeek - today | 0;
  } else {
    deltaDays = 7 - today + dayOfWeek | 0;
  }
  comparisonCalendarLong = calendar.unixMillisLong.add(Kotlin.Long.fromInt((((deltaDays * 1000 | 0) * 60 | 0) * 60 | 0) * 24 | 0));
  return comparisonCalendarLong;
};
  UMCalendarUtil.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'UMCalendarUtil', 
  interfaces: []};
  var UMCalendarUtil_instance = null;
  function UMCalendarUtil_getInstance() {
    if (UMCalendarUtil_instance === null) {
      new UMCalendarUtil();
    }
    return UMCalendarUtil_instance;
  }
  function UMFileUtil() {
    UMFileUtil_instance = this;
    this.FILE_SEP = toBoxedChar(47);
    this.PROTOCOL_FILE = 'file:///';
    this.UNIT_GB_0 = L1073741824;
    this.UNIT_MB_0 = L1048576;
    this.UNIT_KB_0 = L1024;
  }
  UMFileUtil.prototype.joinPaths_vqirvp$ = function(paths) {
  var result = StringBuilder_init();
  for (var i = 0; i !== paths.length; ++i) {
    var pathComp = paths[i];
    var tmp$ = i > 0;
    if (tmp$) {
      tmp$ = pathComp.length > 0;
    }
    if (tmp$ && pathComp.charCodeAt(0) === unboxChar(this.FILE_SEP)) {
      pathComp = pathComp.substring(1);
    }
    result.append_pdl1vj$(pathComp);
    if (i < (paths.length - 1 | 0) && pathComp.charCodeAt(pathComp.length - 1 | 0) !== unboxChar(this.FILE_SEP)) {
      result.append_s8itvh$(unboxChar(this.FILE_SEP));
    }
  }
  return result.toString();
};
  UMFileUtil.prototype.resolveLink_puj7f4$ = function(baseLink, link) {
  var tmp$;
  var base = baseLink;
  var linkLower = link.toLowerCase();
  var charFoundIndex;
  charFoundIndex = indexOf_1(linkLower, '://');
  if (charFoundIndex !== -1) {
    var isAllChars = true;
    var cc;
    tmp$ = charFoundIndex;
    for (var i = 0; i < tmp$; i++) {
      cc = linkLower.charCodeAt(i);
      isAllChars = isAllChars & (cc > 97 && cc < 122 || (cc > 48 && cc < 57) || cc === 43 || cc === 46 || cc === 45);
    }
    if (isAllChars) {
      return link;
    }
  }
  if (startsWith(link, 'data:')) {
    return link;
  }
  if (link.length > 2 && link.charCodeAt(0) === 47 && link.charCodeAt(1) === 47) {
    var $receiver = base;
    var endIndex = indexOf_0(base, 58) + 1 | 0;
    return $receiver.substring(0, endIndex) + link;
  }
  if (link.length > 1 && link.charCodeAt(0) === 47) {
    var serverStartPos = indexOf_1(base, '://') + 3 | 0;
    var serverFinishPos = indexOf_0(base, 47, serverStartPos + 1 | 0);
    return base.substring(0, serverFinishPos) + link;
  }
  charFoundIndex = indexOf_0(base, 63);
  if (charFoundIndex !== -1) {
    var $receiver_0 = base;
    var endIndex_0 = charFoundIndex;
    base = $receiver_0.substring(0, endIndex_0);
  }
  charFoundIndex = lastIndexOf(base, unboxChar(this.FILE_SEP));
  if (charFoundIndex === -1) {
    return link;
  }
  var $receiver_1 = base;
  var endIndex_1 = charFoundIndex;
  base = $receiver_1.substring(0, endIndex_1);
  var baseParts = this.splitString_0(base, unboxChar(this.FILE_SEP));
  var linkParts = this.splitString_0(link, unboxChar(this.FILE_SEP));
  var resultVector = ArrayList_init();
  for (var i_0 = 0; i_0 !== baseParts.length; ++i_0) {
    resultVector.add_11rb$(ensureNotNull(baseParts[i_0]));
  }
  for (var i_1 = 0; i_1 !== linkParts.length; ++i_1) {
    if (equals(linkParts[i_1], '.')) {
      continue;
    }
    if (equals(linkParts[i_1], '..')) {
      resultVector.removeAt_za3lpa$(resultVector.size - 1 | 0);
    } else {
      resultVector.add_11rb$(ensureNotNull(linkParts[i_1]));
    }
  }
  var resultSB = StringBuilder_init();
  var numElements = resultVector.size;
  for (var i_2 = 0; i_2 < numElements; i_2++) {
    resultSB.append_pdl1vj$(resultVector.get_za3lpa$(i_2));
    if (i_2 < (numElements - 1 | 0)) {
      resultSB.append_s8itvh$(unboxChar(this.FILE_SEP));
    }
  }
  return resultSB.toString();
};
  UMFileUtil.prototype.isUriAbsoluteLcase_0 = function(uriLower) {
  var charFoundIndex = indexOf_1(uriLower, '://');
  if (charFoundIndex !== -1) {
    var isAllChars = true;
    var cc;
    for (var i = 0; i < charFoundIndex; i++) {
      cc = uriLower.charCodeAt(i);
      isAllChars = isAllChars & ((new CharRange(98, 121)).contains_mef7kx$(cc) || (new CharRange(49, 56)).contains_mef7kx$(cc) || cc === 43 || cc === 46 || cc === 45);
    }
    if (isAllChars) {
      return true;
    }
  }
  return false;
};
  UMFileUtil.prototype.isUriAbsolute_61zpoe$ = function(uri) {
  return this.isUriAbsoluteLcase_0(uri.toLowerCase());
};
  UMFileUtil.prototype.splitString_0 = function(str, splitChar) {
  var tmp$;
  var numParts = this.countChar_0(str, splitChar);
  var splitStr = Kotlin.newArray(numParts + 1 | 0, null);
  var buffer = StringBuilder_init();
  var partCounter = 0;
  var currentChar;
  tmp$ = str.length;
  for (var i = 0; i < tmp$; i++) {
    currentChar = str.charCodeAt(i);
    if (currentChar === splitChar) {
      splitStr[partCounter] = buffer.toString();
      partCounter = partCounter + 1 | 0;
      buffer = StringBuilder_init();
    } else {
      buffer.append_s8itvh$(currentChar);
    }
  }
  splitStr[partCounter] = buffer.toString();
  return splitStr;
};
  UMFileUtil.prototype.joinString_xuuq2v$ = function(strArr, joinChar) {
  var resultSB = StringBuilder_init();
  var numElements = strArr.length;
  for (var i = 0; i < numElements; i++) {
    resultSB.append_pdl1vj$(strArr[i]);
    if (i < (numElements - 1 | 0)) {
      resultSB.append_s8itvh$(joinChar);
    }
  }
  return resultSB.toString();
};
  UMFileUtil.prototype.countChar_0 = function(str, c) {
  var count = 0;
  var strLen = str.length;
  for (var i = 0; i < strLen; i++) {
    if (str.charCodeAt(i) === c) {
      count = count + 1 | 0;
    }
  }
  return count;
};
  UMFileUtil.prototype.getFilename_61zpoe$ = function(url) {
  if (url.length === 1) {
    return equals(url, '/') ? '' : url;
  }
  var charPos = lastIndexOf(url, 47, url.length - 2 | 0);
  var retVal = url;
  if (charPos !== -1) {
    var startIndex = charPos + 1 | 0;
    retVal = url.substring(startIndex);
  }
  charPos = indexOf_1(retVal, '?');
  if (charPos !== -1) {
    var endIndex = charPos;
    retVal = url.substring(0, endIndex);
  }
  return retVal;
};
  UMFileUtil.prototype.parseParams_4wanh1$ = function(str, deliminator) {
  var paramName = null;
  var params = HashMap_init();
  var inQuotes = false;
  var strLen = str.length;
  var sb = StringBuilder_init();
  var c;
  var lastChar = toChar(0);
  for (var i = 0; i < strLen; i++) {
    c = str.charCodeAt(i);
    if (c === 34) {
      if (!inQuotes) {
        inQuotes = true;
      } else if (inQuotes && lastChar !== 92) {
        inQuotes = false;
      }
    }
    if ((!this.isWhiteSpace_0(c) || inQuotes) && (c !== 34 || i >= (strLen - 1 | 0))) 
      if (c === deliminator || i === (strLen - 1 | 0)) {
      if (i === (strLen - 1 | 0) && c !== 34) {
        sb.append_s8itvh$(c);
      }
      if (paramName != null) {
        var key = paramName;
        var value = sb.toString();
        params.put_xwzc9p$(key, value);
      } else {
        var key_0 = sb.toString();
        params.put_xwzc9p$(key_0, '');
      }
      sb = StringBuilder_init();
      paramName = null;
    } else if (c === 61) {
      paramName = sb.toString();
      sb = StringBuilder_init();
    } else {
      sb.append_s8itvh$(c);
    }
    lastChar = c;
  }
  return params;
};
  UMFileUtil.prototype.parseURLQueryString = function(urlQuery) {
  var retVal = urlQuery;
  var queryPos = indexOf_0(retVal, 63);
  if (queryPos !== -1) {
    var $receiver = retVal;
    var startIndex = queryPos + 1 | 0;
    retVal = $receiver.substring(startIndex);
  }
  var parsedParams = this.parseParams_4wanh1$(retVal, 38);
  var destination = ArrayList_init_0(parsedParams.size);
  var tmp$;
  tmp$ = parsedParams.entries.iterator();
  while (tmp$.hasNext()) {
    var item = tmp$.next();
    destination.add_11rb$(to(UMURLEncoder$Companion_getInstance().decodeUTF8_61zpoe$(item.key), UMURLEncoder$Companion_getInstance().decodeUTF8_61zpoe$(item.value)));
  }
  return toMap_0(destination);
};
  UMFileUtil.prototype.mapToQueryString = function(ht) {
  var tmp$;
  var sb = StringBuilder_init();
  if (ht.isEmpty()) {
    return '';
  }
  var keys = ht.keys.iterator();
  var key;
  var firstEl = true;
  while (keys.hasNext()) {
    if (!firstEl) {
      sb.append_s8itvh$(38);
    } else {
      firstEl = false;
    }
    key = keys.next();
    sb.append_pdl1vj$(UMURLEncoder$Companion_getInstance().encodeUTF8_61zpoe$(key)).append_s8itvh$(61);
    sb.append_pdl1vj$(UMURLEncoder$Companion_getInstance().encodeUTF8_61zpoe$(typeof (tmp$ = ht.get_11rb$(key)) === 'string' ? tmp$ : throwCCE()));
  }
  return sb.toString();
};
  UMFileUtil.prototype.parseTypeWithParamHeader_61zpoe$ = function(header) {
  var tmp$;
  var result = null;
  var semiPos = indexOf_0(header, 59);
  var typeStr;
  var params = null;
  if (semiPos === -1) {
    var tmp$_0;
    var $receiver_0 = Kotlin.isCharSequence(tmp$_0 = header) ? tmp$_0 : throwCCE();
    var startIndex = 0;
    var endIndex = $receiver_0.length - 1 | 0;
    var startFound = false;
    while (startIndex <= endIndex) {
      var index = !startFound ? startIndex : endIndex;
      var match = unboxChar(toBoxedChar($receiver_0.charCodeAt(index))) <= 32;
      if (!startFound) {
        if (!match) 
          startFound = true;
        else 
          startIndex = startIndex + 1 | 0;
      } else {
        if (!match) 
          break;
        else 
          endIndex = endIndex - 1 | 0;
      }
    }
    tmp$ = Kotlin.subSequence($receiver_0, startIndex, endIndex + 1 | 0).toString();
  } else {
    var $receiver = header.substring(0, semiPos);
    var tmp$_1;
    var $receiver_0_0 = Kotlin.isCharSequence(tmp$_1 = $receiver) ? tmp$_1 : throwCCE();
    var startIndex_0 = 0;
    var endIndex_0 = $receiver_0_0.length - 1 | 0;
    var startFound_0 = false;
    while (startIndex_0 <= endIndex_0) {
      var index_0 = !startFound_0 ? startIndex_0 : endIndex_0;
      var match_0 = unboxChar(toBoxedChar($receiver_0_0.charCodeAt(index_0))) <= 32;
      if (!startFound_0) {
        if (!match_0) 
          startFound_0 = true;
        else 
          startIndex_0 = startIndex_0 + 1 | 0;
      } else {
        if (!match_0) 
          break;
        else 
          endIndex_0 = endIndex_0 - 1 | 0;
      }
    }
    tmp$ = Kotlin.subSequence($receiver_0_0, startIndex_0, endIndex_0 + 1 | 0).toString();
  }
  typeStr = tmp$;
  if (semiPos !== -1 && semiPos < (header.length - 1 | 0)) {
    params = this.parseParams_4wanh1$(header.substring(semiPos), 59);
  }
  return new UMFileUtil$TypeWithParamHeader(typeStr, params);
};
  UMFileUtil.prototype.filterFilename_61zpoe$ = function(filename) {
  var tmp$;
  var newStr = StringBuilder_init_0(filename.length);
  var c;
  tmp$ = filename.length;
  for (var i = 0; i < tmp$; i++) {
    c = filename.charCodeAt(i);
    if (!(c === 58 || c === 47 || c === 92 || c === 42 || c === 62 || c === 60 || c === 63)) {
      newStr.append_s8itvh$(c);
    }
  }
  return newStr.toString();
};
  function UMFileUtil$TypeWithParamHeader(typeName, params) {
    this.typeName = typeName;
    this.params = params;
  }
  UMFileUtil$TypeWithParamHeader.prototype.getParam_61zpoe$ = function(paramName) {
  var tmp$, tmp$_0;
  if (this.params != null && ensureNotNull(this.params).containsKey_11rb$(paramName)) {
    tmp$_0 = typeof (tmp$ = ensureNotNull(this.params).get_11rb$(paramName)) === 'string' ? tmp$ : throwCCE();
  } else {
    tmp$_0 = null;
  }
  return tmp$_0;
};
  UMFileUtil$TypeWithParamHeader.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'TypeWithParamHeader', 
  interfaces: []};
  UMFileUtil.prototype.isWhiteSpace_0 = function(c) {
  return c === 32 || c === 10 || c === 9 || c === 13;
};
  UMFileUtil.prototype.getParentFilename_61zpoe$ = function(uri) {
  var tmp$;
  if (uri.length === 1) {
    return null;
  }
  var charPos = lastIndexOf(uri, 47, uri.length - 2 | 0);
  if (charPos !== -1) {
    var endIndex = charPos + 1 | 0;
    tmp$ = uri.substring(0, endIndex);
  } else {
    tmp$ = null;
  }
  return tmp$;
};
  UMFileUtil.prototype.getExtension_61zpoe$ = function(uri) {
  var tmp$;
  var filename = this.getFilename_61zpoe$(uri);
  var lastDot = lastIndexOf(filename, 46);
  if (lastDot !== -1 && lastDot !== (filename.length - 1 | 0)) {
    var startIndex = lastDot + 1 | 0;
    tmp$ = filename.substring(startIndex);
  } else {
    tmp$ = null;
  }
  return tmp$;
};
  UMFileUtil.prototype.stripAnchorIfPresent_61zpoe$ = function(uri) {
  var tmp$;
  var charPos = lastIndexOf(uri, 35);
  if (charPos !== -1) {
    tmp$ = uri.substring(0, charPos);
  } else {
    tmp$ = uri;
  }
  return tmp$;
};
  UMFileUtil.prototype.formatFileSize_s8cxhz$ = function(fileSize) {
  var unit;
  var factor;
  if (fileSize.compareTo_11rb$(this.UNIT_GB_0) > 0) {
    factor = this.UNIT_GB_0;
    unit = 'GB';
  } else if (fileSize.compareTo_11rb$(this.UNIT_MB_0) > 0) {
    factor = this.UNIT_MB_0;
    unit = 'MB';
  } else if (fileSize.compareTo_11rb$(this.UNIT_KB_0) > 0) {
    factor = this.UNIT_KB_0;
    unit = 'kB';
  } else {
    factor = Clazz$Companion$CLAZZ_FEATURE_ATTENDANCE;
    unit = 'bytes';
  }
  var unitSize = fileSize.toNumber() / factor.toNumber();
  unitSize = round(unitSize * 100) / 100.0;
  return unitSize.toString() + ' ' + unit;
};
  UMFileUtil.prototype.stripExtensionIfPresent_61zpoe$ = function(uri) {
  var tmp$;
  var lastSlashPos = lastIndexOf(uri, 47);
  var lastDotPos = lastIndexOf(uri, 46);
  if (lastDotPos !== -1 && lastDotPos > lastSlashPos) {
    tmp$ = uri.substring(0, lastDotPos);
  } else {
    tmp$ = uri;
  }
  return tmp$;
};
  UMFileUtil.prototype.clearTopFromReferrerPath_pukaju$ = function(viewname, args, referrerPath) {
  var tmp$;
  var lastIndex = lastIndexOf_0(referrerPath, '/' + viewname + '?');
  if (lastIndex !== -1) {
    var endIndex = indexOf_1(referrerPath, '/', lastIndex);
    tmp$ = referrerPath.substring(0, endIndex);
  } else {
    tmp$ = '/' + viewname + '?' + this.mapToQueryString(args);
  }
  return tmp$;
};
  UMFileUtil.prototype.getContentType_61zpoe$ = function(filePath) {
  var tmp$;
  var startIndex = lastIndexOf_0(filePath, '.');
  var extension = filePath.substring(startIndex).toLowerCase();
  var extensionMap = mapOf([to('.html', ContentType.Text.Html), to('.xml', ContentType.Text.Xml), to('.css', ContentType.Text.CSS), to('.js', ContentType.Text.JavaScript), to('.json', ContentType.Application.Json), to('.txt', ContentType.Text.Html), to('.xhtml', ContentType.Text.Html), to('.jpg', ContentType.Image.JPEG), to('.png', ContentType.Image.PNG), to('.gif', ContentType.Image.GIF), to('.webp', ContentType_init('image', 'webp')), to('.mp4', ContentType.Video.MP4), to('.mpeg', ContentType.Video.MPEG), to('.m4v', ContentType_init('video', 'x-m4v')), to('.webm', ContentType_init('video', 'webm')), to('.ogv', ContentType_init('video', 'ogg')), to('.mp3', ContentType.Audio.MPEG), to('.ogg', ContentType_init('audio', 'ogg'))]);
  return (tmp$ = extensionMap.get_11rb$(extension)) != null ? tmp$ : ContentType.Companion.Any;
};
  UMFileUtil.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'UMFileUtil', 
  interfaces: []};
  var UMFileUtil_instance = null;
  function UMFileUtil_getInstance() {
    if (UMFileUtil_instance === null) {
      new UMFileUtil();
    }
    return UMFileUtil_instance;
  }
  function UMTinCanUtil() {
    UMTinCanUtil_instance = this;
    this.ADL_PREFIX_VERB = 'http://adlnet.gov/expapi/verbs/';
    this.VERB_PASSED = this.ADL_PREFIX_VERB + 'passed';
    this.VERB_FAILED = this.ADL_PREFIX_VERB + 'failed';
    this.VERB_ANSWERED = this.ADL_PREFIX_VERB + 'answered';
  }
  UMTinCanUtil.prototype.format8601Duration_s8cxhz$ = function(duration) {
  var msPerHour = 3600000;
  var x = duration.div(Kotlin.Long.fromInt(msPerHour)).toNumber();
  var hours = numberToInt(JsMath.floor(x));
  var durationRemaining = duration.modulo(Kotlin.Long.fromInt(msPerHour));
  var msPerMin = 60000;
  var x_0 = durationRemaining.div(Kotlin.Long.fromInt(msPerMin)).toNumber();
  var mins = numberToInt(JsMath.floor(x_0));
  durationRemaining = durationRemaining.modulo(Kotlin.Long.fromInt(msPerMin));
  var msPerS = 1000;
  var x_1 = durationRemaining.div(Kotlin.Long.fromInt(msPerS)).toNumber();
  var secs = numberToInt(JsMath.floor(x_1));
  return 'PT' + toString(hours) + 'H' + toString(mins) + 'M' + toString(secs) + 'S';
};
  UMTinCanUtil.prototype.parse8601Duration_61zpoe$ = function(duration) {
  var tmp$, tmp$_0;
  var time = (new ISO8601$IsoIntervalFormat('PTnnHnnMnnS')).tryParse_ivxn3r$(duration, false);
  return (tmp$_0 = (tmp$ = time != null ? time.totalMilliseconds : null) != null ? Kotlin.Long.fromNumber(tmp$) : null) != null ? tmp$_0 : L0;
};
  UMTinCanUtil.prototype.parse8601DurationOrDefault_67ydmm$ = function(duration, defaultDuration) {
  if (defaultDuration === void 0) 
    defaultDuration = L0;
  var tmp$;
  if (duration != null) {
    tmp$ = this.parse8601Duration_61zpoe$(duration);
  } else {
    tmp$ = defaultDuration;
  }
  return tmp$;
};
  UMTinCanUtil.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'UMTinCanUtil', 
  interfaces: []};
  var UMTinCanUtil_instance = null;
  function UMTinCanUtil_getInstance() {
    if (UMTinCanUtil_instance === null) {
      new UMTinCanUtil();
    }
    return UMTinCanUtil_instance;
  }
  function UstadUrlComponents(endpoint, viewName, queryString) {
    UstadUrlComponents$Companion_getInstance();
    this.endpoint = endpoint;
    this.viewName = viewName;
    this.queryString = queryString;
    this.arguments_ow7pmx$_0 = lazy_0(LazyThreadSafetyMode.NONE, UstadUrlComponents$arguments$lambda(this));
    this.viewUri_99m8nc$_0 = lazy(UstadUrlComponents$viewUri$lambda(this));
  }
  Object.defineProperty(UstadUrlComponents.prototype, 'arguments', {
  configurable: true, 
  get: function() {
  return this.arguments_ow7pmx$_0.value;
}});
  Object.defineProperty(UstadUrlComponents.prototype, 'viewUri', {
  configurable: true, 
  get: function() {
  return this.viewUri_99m8nc$_0.value;
}});
  function UstadUrlComponents$Companion() {
    UstadUrlComponents$Companion_instance = this;
    this.DEFAULT_DIVIDER = '/#/';
  }
  UstadUrlComponents$Companion.prototype.parse_puj7f4$ = function(url, divider) {
  if (divider === void 0) 
    divider = this.DEFAULT_DIVIDER;
  var dividerIndex = indexOf_1(url, divider);
  if (dividerIndex === -1) 
    throw IllegalArgumentException_init('Not a valid UstadUrl: ' + url);
  var endIndex = dividerIndex + 1 | 0;
  var endpoint = removeSuffix(url.substring(0, endIndex), 'umapp/');
  var queryIndex = indexOf_1(url, '?', dividerIndex);
  var viewName;
  var queryString;
  if (queryIndex === -1 || queryIndex === (url.length - 1 | 0)) {
    var startIndex = dividerIndex + divider.length | 0;
    viewName = removeSuffix(url.substring(startIndex), '?');
    queryString = '';
  } else {
    var startIndex_0 = dividerIndex + divider.length | 0;
    viewName = url.substring(startIndex_0, queryIndex);
    var startIndex_1 = queryIndex + 1 | 0;
    queryString = url.substring(startIndex_1);
  }
  return new UstadUrlComponents(endpoint, viewName, queryString);
};
  UstadUrlComponents$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var UstadUrlComponents$Companion_instance = null;
  function UstadUrlComponents$Companion_getInstance() {
    if (UstadUrlComponents$Companion_instance === null) {
      new UstadUrlComponents$Companion();
    }
    return UstadUrlComponents$Companion_instance;
  }
  function UstadUrlComponents$arguments$lambda(this$UstadUrlComponents) {
    return function() {
  var parsedParams = UMFileUtil_getInstance().parseParams_4wanh1$(this$UstadUrlComponents.queryString, 38);
  var destination = ArrayList_init_0(parsedParams.size);
  var tmp$;
  tmp$ = parsedParams.entries.iterator();
  while (tmp$.hasNext()) {
    var item = tmp$.next();
    destination.add_11rb$(to(UMURLEncoder$Companion_getInstance().decodeUTF8_61zpoe$(item.key), UMURLEncoder$Companion_getInstance().decodeUTF8_61zpoe$(item.value)));
  }
  return toMap_0(destination);
};
  }
  function UstadUrlComponents$viewUri$lambda(this$UstadUrlComponents) {
    return function() {
  if (this$UstadUrlComponents.queryString.length === 0) {
    return this$UstadUrlComponents.viewName;
  } else {
    return this$UstadUrlComponents.viewName + '?' + this$UstadUrlComponents.queryString;
  }
};
  }
  UstadUrlComponents.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UstadUrlComponents', 
  interfaces: []};
  UstadUrlComponents.prototype.component1 = function() {
  return this.endpoint;
};
  UstadUrlComponents.prototype.component2 = function() {
  return this.viewName;
};
  UstadUrlComponents.prototype.component3 = function() {
  return this.queryString;
};
  UstadUrlComponents.prototype.copy_6hosri$ = function(endpoint, viewName, queryString) {
  return new UstadUrlComponents(endpoint === void 0 ? this.endpoint : endpoint, viewName === void 0 ? this.viewName : viewName, queryString === void 0 ? this.queryString : queryString);
};
  UstadUrlComponents.prototype.toString = function() {
  return 'UstadUrlComponents(endpoint=' + Kotlin.toString(this.endpoint) + (', viewName=' + Kotlin.toString(this.viewName)) + (', queryString=' + Kotlin.toString(this.queryString)) + ')';
};
  UstadUrlComponents.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.endpoint) | 0;
  result = result * 31 + Kotlin.hashCode(this.viewName) | 0;
  result = result * 31 + Kotlin.hashCode(this.queryString) | 0;
  return result;
};
  UstadUrlComponents.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.endpoint, other.endpoint) && Kotlin.equals(this.viewName, other.viewName) && Kotlin.equals(this.queryString, other.queryString)))));
};
  function XmlPullParserHandle() {
  }
  XmlPullParserHandle.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'XmlPullParserHandle', 
  interfaces: []};
  function AlreadyEnroledInClassException(existingClazzEnrolment) {
    Exception_init_0(this);
    this.existingClazzEnrolment = existingClazzEnrolment;
    this.name = 'AlreadyEnroledInClassException';
  }
  AlreadyEnroledInClassException.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'AlreadyEnroledInClassException', 
  interfaces: [Exception]};
  function AlreadyEnroledInSchoolException(existingMember) {
    Exception_init_0(this);
    this.existingMember = existingMember;
    this.name = 'AlreadyEnroledInSchoolException';
  }
  AlreadyEnroledInSchoolException.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'AlreadyEnroledInSchoolException', 
  interfaces: [Exception]};
  function get_combinedFlagValue($receiver) {
    var tmp$;
    var accumulator = L0;
    tmp$ = $receiver.iterator();
    while (tmp$.hasNext()) {
      var element = tmp$.next();
      var accVal = accumulator;
      var operation$result;
      if (element.enabled) {
        operation$result = accVal.or(element.flagVal);
      } else {
        operation$result = accVal;
      }
      accumulator = operation$result;
    }
    return accumulator;
  }
  var ROLE_TO_MESSAGEID_MAP;
  function roleToString($receiver, context, systemImpl) {
    var tmp$;
    var roleMessageId = (tmp$ = ROLE_TO_MESSAGEID_MAP.get_11rb$($receiver.clazzEnrolmentRole)) != null ? tmp$ : 0;
    var roleStr = systemImpl.getString(roleMessageId, context);
    if ($receiver.clazzEnrolmentRole === 1002) {
      roleStr += '(' + systemImpl.getString(2653, context) + ')';
    }
    return roleStr;
  }
  var OUTCOME_TO_MESSAGE_ID_MAP;
  function outcomeToString($receiver, context, systemImpl) {
    var tmp$, tmp$_0;
    var outcomeMessageId = (tmp$ = OUTCOME_TO_MESSAGE_ID_MAP.get_11rb$($receiver.clazzEnrolmentOutcome)) != null ? tmp$ : 0;
    var outcomeStr = systemImpl.getString(outcomeMessageId, context);
    if (Kotlin.isType($receiver, ClazzEnrolmentWithLeavingReason)) {
      if (!equals($receiver.clazzEnrolmentLeavingReasonUid, L0)) {
        outcomeStr += ' (' + toString((tmp$_0 = $receiver.leavingReason) != null ? tmp$_0.leavingReasonTitle : null) + ')';
      }
    }
    return outcomeStr;
  }
  function isRolePending($receiver) {
    return $receiver.clazzEnrolmentRole === 1002;
  }
  function isAttendanceEnabledAndRecorded($receiver) {
    return equals($receiver.clazzFeatures.and(Clazz$Companion$CLAZZ_FEATURE_ATTENDANCE), Clazz$Companion$CLAZZ_FEATURE_ATTENDANCE) && $receiver.attendanceAverage >= 0.0;
  }
  function isStartOrEndTimeSet($receiver) {
    return $receiver != null && (!equals($receiver.clazzStartTime, L0) || (!equals($receiver.clazzEndTime, L0) && !equals($receiver.clazzEndTime, Long$Companion$MAX_VALUE)));
  }
  function totalStudents($receiver) {
    return $receiver.clazzLogNumPresent + $receiver.clazzLogNumAbsent + $receiver.clazzLogNumPartial | 0;
  }
  function attendancePercentage($receiver) {
    return ($receiver.clazzLogNumPresent + $receiver.clazzLogNumPartial) / totalStudents($receiver);
  }
  function latePercentage($receiver) {
    return $receiver.clazzLogNumPartial / totalStudents($receiver);
  }
  var get_effectiveTimeZone = defineInlineFunction('UstadMobile-core.com.ustadmobile.core.util.ext.get_effectiveTimeZone_e6cu1y$', function($receiver) {
  var tmp$, tmp$_0, tmp$_1;
  return (tmp$_1 = (tmp$_0 = $receiver.clazzTimeZone) != null ? tmp$_0 : (tmp$ = $receiver.school) != null ? tmp$.schoolTimeZone : null) != null ? tmp$_1 : 'UTC';
});
  function effectiveTimeZone($receiver, fallback) {
    if (fallback === void 0) 
      fallback = 'UTC';
    var tmp$, tmp$_0, tmp$_1;
    return (tmp$_1 = (tmp$_0 = $receiver != null ? $receiver.clazzTimeZone : null) != null ? tmp$_0 : (tmp$ = $receiver != null ? $receiver.school : null) != null ? tmp$.schoolTimeZone : null) != null ? tmp$_1 : fallback;
  }
  function roundTo($receiver, decimalPlaces) {
    if (decimalPlaces === void 0) 
      decimalPlaces = 0;
    var factor = JsMath.pow(10.0, decimalPlaces);
    return roundToInt($receiver * factor) / factor;
  }
  function Coroutine$deleteZombieContainerEntryFiles($receiver_0, dbType_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$notDeleted = void 0;
    this.local$zombies = void 0;
    this.local$maxChunkSize = void 0;
    this.local$deletedZombies = void 0;
    this.local$tmp$ = void 0;
    this.local$$receiver = $receiver_0;
    this.local$dbType = dbType_0;
  }
  Coroutine$deleteZombieContainerEntryFiles.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$deleteZombieContainerEntryFiles.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$deleteZombieContainerEntryFiles.prototype.constructor = Coroutine$deleteZombieContainerEntryFiles;
  Coroutine$deleteZombieContainerEntryFiles.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        this.local$notDeleted = ArrayList_init();
        this.state_0 = 2;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        this.result_0 = this.local$$receiver.findZombieUidsAndPath_za3lpa$(1000, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$zombies = this.result_0;
        if (this.local$dbType === 1) {
          tmp$ = 100;
        } else {
          tmp$ = 2147483647;
        }
        this.local$maxChunkSize = tmp$;
        this.state_0 = 4;
        this.result_0 = deleteContainerEntryFilePaths(this.local$zombies, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.local$deletedZombies = this.result_0;
        if (this.local$deletedZombies.second.isEmpty()) {
          tmp$_0 = this.local$deletedZombies.first;
        } else {
          tmp$_0 = plus_0(this.local$deletedZombies.first, this.local$deletedZombies.second);
        }
        var entriesToDeleteFromDb = tmp$_0;
        this.local$tmp$ = chunked(entriesToDeleteFromDb, this.local$maxChunkSize).iterator();
        this.state_0 = 5;
        continue;
      case 5:
        if (!this.local$tmp$.hasNext()) {
          this.state_0 = 7;
          continue;
        }
        var element = this.local$tmp$.next();
        var destination = ArrayList_init_0(collectionSizeOrDefault(element, 10));
        var tmp$_1;
        tmp$_1 = element.iterator();
        while (tmp$_1.hasNext()) {
          var item = tmp$_1.next();
          destination.add_11rb$(item.cefUid);
        }
        this.state_0 = 6;
        this.result_0 = this.local$$receiver.deleteByUidList_gox9k8$(destination, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 6:
        this.state_0 = 5;
        continue;
      case 7:
        addAll(this.local$notDeleted, this.local$deletedZombies.second);
        if (!!this.local$zombies.isEmpty()) {
          this.state_0 = 8;
          continue;
        }
        this.state_0 = 2;
        continue;
      case 8:
        return this.local$notDeleted;
      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 deleteZombieContainerEntryFiles($receiver_0, dbType_0, continuation_0, suspended) {
    var instance = new Coroutine$deleteZombieContainerEntryFiles($receiver_0, dbType_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function distinctMds5sSorted($receiver) {
    var destination = ArrayList_init();
    var tmp$;
    tmp$ = $receiver.iterator();
    while (tmp$.hasNext()) {
      var element = tmp$.next();
      var tmp$_0;
      if ((tmp$_0 = element.cefMd5) != null) {
        destination.add_11rb$(tmp$_0);
      }
    }
    return sorted(distinct(destination));
  }
  function distinctMd5sSortedAsJoinedQueryParam($receiver) {
    var $receiver_0 = distinctMds5sSorted($receiver);
    var destination = ArrayList_init_0(collectionSizeOrDefault($receiver_0, 10));
    var tmp$;
    tmp$ = $receiver_0.iterator();
    while (tmp$.hasNext()) {
      var item = tmp$.next();
      destination.add_11rb$(base64EncodedToHexString(item));
    }
    return joinToString(destination, ';');
  }
  function toDeepLink($receiver, endpoint) {
    return makeContentEntryDeepLink($receiver.contentEntryUid, $receiver.leaf, endpoint);
  }
  function makeContentEntryDeepLink(contentEntryUid, leaf, endpoint) {
    var tmp$;
    if (leaf) {
      tmp$ = ContentEntryDetailView$Companion_getInstance().VIEW_NAME;
    } else {
      tmp$ = ContentEntryList2View$Companion_getInstance().VIEW_NAME;
    }
    var viewName = tmp$;
    return toDeepLink_0(mapOf_0(to(UstadView$Companion_getInstance().ARG_ENTITY_UID, contentEntryUid.toString())), endpoint.url, viewName);
  }
  function isContentComplete($receiver) {
    var tmp$;
    if ($receiver.contentComplete) {
      switch ($receiver.success) {
        case 2:
          tmp$ = 102;
          break;
        case 1:
          tmp$ = 103;
          break;
        case 0:
          tmp$ = 100;
          break;
        default:
          tmp$ = 100;
          break;
      }
      return tmp$;
    }
    return 101;
  }
  function calculateScoreWithPenalty($receiver) {
    return numberToInt($receiver.resultScore / $receiver.resultMax * 100 * ($receiver.totalCompletedContent / $receiver.totalContent) * (1 - $receiver.penalty / 100));
  }
  function calculateScoreWithWeight($receiver) {
    return numberToInt($receiver.resultScaled / $receiver.resultWeight * ($receiver.totalCompletedContent / $receiver.totalContent));
  }
  function isStatusPaused($receiver) {
    return $receiver === 3;
  }
  function isStatusCompleted($receiver) {
    return $receiver >= 21;
  }
  function isStatusActiveOrQueued($receiver) {
    return $receiver >= 4 && $receiver < 21;
  }
  function isStatusQueuedOrDownloading($receiver) {
    var tmp$, tmp$_0;
    return (tmp$_0 = (tmp$ = $receiver != null ? $receiver.cjiRecursiveStatus : null) != null ? tmp$ >= 4 && tmp$ < 21 : null) != null ? tmp$_0 : false;
  }
  function isStatusPaused_0($receiver) {
    var tmp$, tmp$_0;
    return (tmp$_0 = (tmp$ = $receiver != null ? $receiver.cjiRecursiveStatus : null) != null ? isStatusPaused(tmp$) : null) != null ? tmp$_0 : false;
  }
  function isStatusCompletedSuccessfully($receiver) {
    var tmp$, tmp$_0;
    return (tmp$_0 = (tmp$ = $receiver != null ? $receiver.cjiRecursiveStatus : null) != null ? tmp$ === 24 : null) != null ? tmp$_0 : false;
  }
  function isStatusCompleted_0($receiver) {
    var tmp$, tmp$_0;
    return (tmp$_0 = (tmp$ = $receiver != null ? $receiver.cjiRecursiveStatus : null) != null ? isStatusCompleted(tmp$) : null) != null ? tmp$_0 : false;
  }
  function isStatusPausedOrQueuedOrDownloading($receiver) {
    var tmp$, tmp$_0;
    return (tmp$_0 = (tmp$ = $receiver != null ? $receiver.cjiRecursiveStatus : null) != null ? tmp$ >= 3 && tmp$ < 21 : null) != null ? tmp$_0 : false;
  }
  var statusToMessageIdMap;
  function downloadJobStatusStr($receiver, systemImpl, context) {
    var tmp$;
    var messageId = statusToMessageIdMap.get_11rb$($receiver);
    if (messageId != null) {
      tmp$ = systemImpl.getString(messageId, context);
    } else {
      tmp$ = '';
    }
    return tmp$;
  }
  function toStatusString($receiver, systemImpl, context) {
    var tmp$, tmp$_0;
    return (tmp$_0 = (tmp$ = $receiver != null ? $receiver.cjiRecursiveStatus : null) != null ? downloadJobStatusStr(tmp$, systemImpl, context) : null) != null ? tmp$_0 : '';
  }
  function Coroutine$updateTotalFromLocalUriIfNeeded($receiver_0, uri_0, uploadNeeded_0, progressListener_0, context_0, di_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$$receiver = $receiver_0;
    this.local$uri = uri_0;
    this.local$uploadNeeded = uploadNeeded_0;
    this.local$progressListener = progressListener_0;
    this.local$context = context_0;
    this.local$di = di_0;
  }
  Coroutine$updateTotalFromLocalUriIfNeeded.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$updateTotalFromLocalUriIfNeeded.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$updateTotalFromLocalUriIfNeeded.prototype.constructor = Coroutine$updateTotalFromLocalUriIfNeeded;
  Coroutine$updateTotalFromLocalUriIfNeeded.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (equals(this.local$$receiver.cjiItemTotal, L0)) {
          this.state_0 = 2;
          this.result_0 = getSize(this.local$uri, this.local$context, this.local$di, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.local$$receiver.cjiItemTotal = this.result_0;
        if (this.local$uploadNeeded) 
          this.local$$receiver.cjiItemTotal = this.local$$receiver.cjiItemTotal.multiply(Kotlin.Long.fromInt(2));
                this.local$progressListener != null ? (this.local$progressListener.onProgress_letzpf$(this.local$$receiver) , Unit) : null;
        this.state_0 = 3;
        continue;
      case 3:
        return;
      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 updateTotalFromLocalUriIfNeeded($receiver_0, uri_0, uploadNeeded_0, progressListener_0, context_0, di_0, continuation_0, suspended) {
    var instance = new Coroutine$updateTotalFromLocalUriIfNeeded($receiver_0, uri_0, uploadNeeded_0, progressListener_0, context_0, di_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function Coroutine$updateTotalFromContainerSize($receiver_0, uploadNeeded_0, db_0, progressListener_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$$receiver = $receiver_0;
    this.local$uploadNeeded = uploadNeeded_0;
    this.local$db = db_0;
    this.local$progressListener = progressListener_0;
  }
  Coroutine$updateTotalFromContainerSize.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$updateTotalFromContainerSize.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$updateTotalFromContainerSize.prototype.constructor = Coroutine$updateTotalFromContainerSize;
  Coroutine$updateTotalFromContainerSize.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.state_0 = 2;
        this.result_0 = this.local$db.containerDao.findSizeByUid_s8cxhz$(this.local$$receiver.cjiContainerUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var containerSize = this.result_0;
        if (this.local$uploadNeeded) {
          tmp$ = containerSize.multiply(Kotlin.Long.fromInt(2));
        } else {
          tmp$ = containerSize;
        }
        this.local$$receiver.cjiItemTotal = tmp$;
        this.local$$receiver.cjiItemProgress = containerSize;
        this.local$progressListener.onProgress_letzpf$(this.local$$receiver);
        return;
      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 updateTotalFromContainerSize($receiver_0, uploadNeeded_0, db_0, progressListener_0, continuation_0, suspended) {
    var instance = new Coroutine$updateTotalFromContainerSize($receiver_0, uploadNeeded_0, db_0, progressListener_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function fallbackIndividualSet($receiver, systemImpl, context) {
    var tmp$;
    if ($receiver != null) 
      tmp$ = $receiver;
    else {
      var $receiver_0 = new CourseGroupSet();
      $receiver_0.cgsName = systemImpl.getString(2941, context);
      tmp$ = $receiver_0;
    }
    return tmp$;
  }
  function toTermMap($receiver, json, systemImpl, context) {
    var tmp$, tmp$_0;
    var $receiver_0 = TerminologyKeys_getInstance().TERMINOLOGY_ENTRY_MESSAGE_ID;
    var destination = LinkedHashMap_init_0(mapCapacity($receiver_0.size));
    var tmp$_1;
    tmp$_1 = $receiver_0.entries.iterator();
    while (tmp$_1.hasNext()) {
      var element = tmp$_1.next();
      destination.put_xwzc9p$(element.key, systemImpl.getString(element.value, context));
    }
    var defaultMap = destination;
    var map = toMutableMap((tmp$_0 = (tmp$ = $receiver != null ? $receiver.ctTerminology : null) != null ? decodeStringMapFromString(json, tmp$) : null) != null ? tmp$_0 : defaultMap);
    var tmp$_2;
    tmp$_2 = defaultMap.entries.iterator();
    while (tmp$_2.hasNext()) {
      var element_0 = tmp$_2.next();
      var tmp$_3;
      var key = element_0.key;
      var value = (tmp$_3 = map.get_11rb$(element_0.key)) != null ? tmp$_3 : element_0.value;
      map.put_xwzc9p$(key, value);
    }
    return map;
  }
  function toFixedDatePair($receiver) {
    var fromDate = toFixedDate($receiver.fromMoment);
    var toDate = toFixedDate($receiver.toMoment);
    return new Pair(fromDate, toDate);
  }
  function toFixedDate($receiver) {
    var tmp$;
    if ($receiver.typeFlag === 0) {
      return $receiver.fixedTime;
    } else {
      if ($receiver.relUnit === 1 && $receiver.relOffSet === 0) {
        return DateTime.Companion.now().startOfDay.unixMillisLong;
      }
      var timeNow = DateTime.Companion.now().startOfDay;
      switch ($receiver.relUnit) {
        case 1:
          var $receiver_0 = abs($receiver.relOffSet);
          tmp$ = timeNow.minus_fv8bff$(TimeSpan.Companion.fromDays_14dthe$($receiver_0));
          break;
        case 3:
          tmp$ = timeNow.minus_glepj8$(new MonthSpan_init(abs($receiver.relOffSet)));
          break;
        case 2:
          var $receiver_1 = abs($receiver.relOffSet);
          tmp$ = timeNow.minus_fv8bff$(TimeSpan.Companion.fromWeeks_14dthe$($receiver_1));
          break;
        case 4:
          tmp$ = timeNow.minus_glepj8$(new MonthSpan_init(12 * abs($receiver.relOffSet) | 0));
          break;
        default:
          tmp$ = timeNow;
          break;
      }
      var timeOffset = tmp$;
      return timeOffset.unixMillisLong;
    }
  }
  function toDisplayString($receiver) {
    var str = 'Custom range: from ';
    str += toDisplayString_0($receiver.fromMoment);
    str += ' until ' + toDisplayString_0($receiver.toMoment);
    return str;
  }
  function toDisplayString_0($receiver) {
    var str = '';
    switch ($receiver.typeFlag) {
      case 0:
        str += DateTime.Companion.invoke_s8cxhz$($receiver.fixedTime).format_61zpoe$('dd/MM/yyyy');
        break;
      case 1:
        if ($receiver.relUnit === 1 && $receiver.relOffSet === 0) {
          str += 'now';
        } else {
          str += abs($receiver.relOffSet).toString();
          switch ($receiver.relUnit) {
            case 1:
              str += ' days ago';
              break;
            case 3:
              str += ' months ago';
              break;
            case 2:
              str += ' weeks ago';
              break;
            case 4:
              str += ' years ago';
              break;
          }
        }
        break;
    }
    return str;
  }
  function logErrorReport($receiver, severityLevel, e, presenter, continuation) {
    if (presenter === void 0) 
      presenter = null;
    var tmp$, tmp$_0, tmp$_1;
    var errorCodeException = Kotlin.isType(tmp$ = e, ErrorCodeException) ? tmp$ : null;
    var tmp$_2;
    if ((tmp$_1 = (tmp$_0 = presenter != null ? presenter.di : null) != null ? get_direct(tmp$_0) : null) != null) {
      var tmp$_3;
      tmp$_2 = tmp$_1.directDI.Instance_ohrpre$(Kotlin.isType(tmp$_3 = typeToken(createKType(getKClass(UstadNavController), [], false)), TypeToken) ? tmp$_3 : throwCCE(), null);
    } else 
      tmp$_2 = null;
    var navController = tmp$_2;
    var $receiver_0 = new ErrorReport();
    var tmp$_4, tmp$_5;
    $receiver_0.errorCode = (tmp$_4 = errorCodeException != null ? errorCodeException.errorCode : null) != null ? tmp$_4 : 0;
    $receiver_0.severity = severityLevel;
    $receiver_0.message = e.message;
    $receiver_0.stackTrace = stackTraceToString(e);
    $receiver_0.osVersion = getOsVersion();
    $receiver_0.operatingSys = getOs();
    $receiver_0.timestamp = systemTimeInMillis();
    $receiver_0.presenterUri = (tmp$_5 = navController != null ? navController.currentBackStackEntry : null) != null ? get_viewUri(tmp$_5) : null;
    var errorReport = $receiver_0;
    return $receiver.insertAsync_vn2wbu$(errorReport, continuation);
  }
  function isTextContent($receiver) {
    var tmp$, tmp$_0;
    return ((tmp$ = $receiver.mimeType) != null ? startsWith(tmp$, 'text/') : null) === true || ((tmp$_0 = $receiver.mimeType) != null ? startsWith(tmp$_0, 'application/json') : null) === true;
  }
  function get$lambda_2($receiver) {
    return Unit;
  }
  function verifySite$lambda$lambda(closure$timeout) {
    return function($receiver) {
  $receiver.requestTimeoutMillis = closure$timeout;
  return Unit;
};
  }
  function verifySite$lambda(closure$timeout) {
    return function($receiver) {
  timeout($receiver, verifySite$lambda$lambda(closure$timeout));
  return Unit;
};
  }
  function Coroutine$verifySite($receiver_0, endpointUrl_0, timeout_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 6;
    this.local$response = void 0;
    this.local$$receiver = $receiver_0;
    this.local$endpointUrl = endpointUrl_0;
    this.local$timeout = timeout_0;
  }
  Coroutine$verifySite.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$verifySite.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$verifySite.prototype.constructor = Coroutine$verifySite;
  Coroutine$verifySite.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$timeout === void 0) 
          this.local$timeout = SiteEnterLinkPresenter$Companion_getInstance().LINK_REQUEST_TIMEOUT;
        var siteVerifyUrl = UMFileUtil_getInstance().joinPaths_vqirvp$([this.local$endpointUrl, 'Site', 'verify']);
        var host_0;
        var body_0;
        host_0 = 'localhost';
        body_0 = utils.EmptyContent;
        var $receiver_1 = new HttpRequestBuilder_init();
        url_0($receiver_1, 'http', host_0, 0, '/');
        $receiver_1.method = HttpMethod.Companion.Get;
        $receiver_1.body = body_0;
        takeFrom_0($receiver_1.url, siteVerifyUrl);
        verifySite$lambda(this.local$timeout)($receiver_1);
        var $this_0 = new HttpStatement($receiver_1, this.local$$receiver);
        var tmp$_4, tmp$_5, tmp$_6;
        tmp$_4 = getKClass(Site);
        if (equals(tmp$_4, getKClass(HttpStatement))) {
          this.result_0 = Kotlin.isType(tmp$_5 = $this_0, Site) ? tmp$_5 : throwCCE();
          this.state_0 = 9;
          continue;
        } else {
          if (equals(tmp$_4, getKClass(HttpResponse))) {
            this.state_0 = 7;
            this.result_0 = $this_0.execute(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 1;
            this.result_0 = $this_0.executeUnsafe(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          }
        }
      case 1:
        this.local$response = this.result_0;
        this.exceptionState_0 = 4;
        var tmp$_7;
        var tmp$_8 = this.local$response.call;
        var typeInfo$result_0;
        typeInfo$break:
          do {
            try {
              typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(Site), createKType(getKClass(Site), [], false));
            }            catch (_) {
  typeInfo$result_0 = typeInfoImpl(reflect.JsType, getKClass(Site), null);
  break typeInfo$break;
}
          } while (false);
        this.state_0 = 2;
        this.result_0 = tmp$_8.receive_qi9ur9$(typeInfo$result_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 2:
        this.result_0 = Kotlin.isType(tmp$_7 = this.result_0, Site) ? tmp$_7 : throwCCE();
        this.exceptionState_0 = 6;
        this.finallyPath_0 = [3];
        this.state_0 = 5;
        continue;
      case 3:
        this.state_0 = 8;
        continue;
      case 4:
        this.finallyPath_0 = [6];
        this.state_0 = 5;
        continue;
      case 5:
        this.exceptionState_0 = 6;
        complete(this.local$response);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 6:
        throw this.exception_0;
      case 7:
        this.result_0 = Kotlin.isType(tmp$_6 = this.result_0, Site) ? tmp$_6 : throwCCE();
        this.state_0 = 8;
        continue;
      case 8:
        this.state_0 = 9;
        continue;
      case 9:
        this.result_0;
        return this.result_0;
      default:
        this.state_0 = 6;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 6) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  function verifySite($receiver_0, endpointUrl_0, timeout_0, continuation_0, suspended) {
    var instance = new Coroutine$verifySite($receiver_0, endpointUrl_0, timeout_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function alternative($receiver, alternative) {
    return $receiver === 0 ? alternative : $receiver;
  }
  function alternative_0($receiver, alternative) {
    return equals($receiver, L0) ? alternative : $receiver;
  }
  function hasFlag($receiver, flag) {
    return ($receiver & flag) === flag;
  }
  function foldWithBinaryOr($receiver) {
    var tmp$;
    var accumulator = L0;
    tmp$ = $receiver.iterator();
    while (tmp$.hasNext()) {
      var element = tmp$.next();
      accumulator = accumulator.or(element);
    }
    return accumulator;
  }
  function encodeStringMapToString($receiver, stringMap) {
    return $receiver.encodeToString_tf03ej$(MapSerializer(serializer(kotlin_js_internal_StringCompanionObject), serializer(kotlin_js_internal_StringCompanionObject)), stringMap);
  }
  function decodeStringMapFromString($receiver, string) {
    return $receiver.decodeFromString_awif5v$(MapSerializer(serializer(kotlin_js_internal_StringCompanionObject), serializer(kotlin_js_internal_StringCompanionObject)), string);
  }
  function toListFilterOptions($receiver, context, di) {
    var tmp$;
    var systemImpl = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
    var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
    var tmp$_0;
    tmp$_0 = $receiver.iterator();
    while (tmp$_0.hasNext()) {
      var item = tmp$_0.next();
      destination.add_11rb$(new ListFilterIdOption(systemImpl.getString(item.first, context), item.second));
    }
    return destination;
  }
  function hasFlag_0($receiver, flag) {
    return equals($receiver.and(flag), flag);
  }
  function toQueryString($receiver) {
    var $receiver_0 = $receiver.entries;
    var destination = ArrayList_init_0(collectionSizeOrDefault($receiver_0, 10));
    var tmp$;
    tmp$ = $receiver_0.iterator();
    while (tmp$.hasNext()) {
      var item = tmp$.next();
      destination.add_11rb$(UMURLEncoder$Companion_getInstance().encodeUTF8_61zpoe$(item.key) + '=' + UMURLEncoder$Companion_getInstance().encodeUTF8_61zpoe$(item.value));
    }
    return joinToString(destination, '&');
  }
  function toDeepLink_0($receiver, endpointUrl, viewName) {
    var endpointAndDividerAndView = UMFileUtil_getInstance().joinPaths_vqirvp$([endpointUrl, UstadMobileSystemCommon$Companion_getInstance().LINK_ENDPOINT_VIEWNAME_DIVIDER]) + viewName;
    return appendQueryArgs(endpointAndDividerAndView, toQueryString($receiver));
  }
  function putEntityAsJson($receiver, key, serializer, entity) {
    var tmp$, tmp$_0, tmp$_1;
    if (entity == null) {
      return;
    }
    var entityVal = entity;
    tmp$_1 = (tmp$_0 = Kotlin.isType(tmp$ = defaultSerializer().write_za3rmp$(entityVal), TextContent) ? tmp$ : null) != null ? tmp$_0.text : null;
    if (tmp$_1 == null) {
      return;
    }
    var jsonStr = tmp$_1;
    $receiver.put_xwzc9p$(key, jsonStr);
  }
  function putFromOtherMapIfPresent($receiver, otherMap, keyVal) {
    var otherMapVal = otherMap.get_11rb$(keyVal);
    if (otherMapVal != null) {
      $receiver.put_xwzc9p$(keyVal, otherMapVal);
    }
  }
  function putIfNotAlreadySet($receiver, key, keyVal) {
    if (!$receiver.containsKey_11rb$(key)) 
      $receiver.put_xwzc9p$(key, keyVal);
  }
  function putResultDestInfo($receiver, backState, destinationResultKey, overwriteDest) {
    if (overwriteDest === void 0) 
      overwriteDest = false;
    var tmp$, tmp$_0, tmp$_1, tmp$_2;
    var backStateArgs = backState.arguments;
    var effectiveDestViewName = (tmp$_0 = (tmp$ = !overwriteDest ? backStateArgs : null) != null ? tmp$.get_11rb$(UstadView$Companion_getInstance().ARG_RESULT_DEST_VIEWNAME) : null) != null ? tmp$_0 : backState.viewName;
    $receiver.put_xwzc9p$(UstadView$Companion_getInstance().ARG_RESULT_DEST_VIEWNAME, effectiveDestViewName);
    var effectiveDestinationKey = (tmp$_2 = (tmp$_1 = !overwriteDest ? backStateArgs : null) != null ? tmp$_1.get_11rb$(UstadView$Companion_getInstance().ARG_RESULT_DEST_KEY) : null) != null ? tmp$_2 : destinationResultKey;
    $receiver.put_xwzc9p$(UstadView$Companion_getInstance().ARG_RESULT_DEST_KEY, effectiveDestinationKey);
  }
  function determineListMode($receiver) {
    var listModeArg = $receiver.get_11rb$(UstadView$Companion_getInstance().ARG_LISTMODE);
    if (listModeArg != null) {
      return ListViewMode$valueOf(listModeArg);
    }
    if ($receiver.containsKey_11rb$(UstadView$Companion_getInstance().ARG_RESULT_DEST_KEY)) 
      return ListViewMode$PICKER_getInstance();
    else 
      return ListViewMode$BROWSER_getInstance();
  }
  function addSafelyToPosition($receiver, position, content) {
    if (position < 0) 
      $receiver.add_wxm5ur$(0, content);
    else if (position > $receiver.size) 
      $receiver.add_11rb$(content);
    else {
      $receiver.add_wxm5ur$(position, content);
    }
  }
  function addAllSafelyToPosition($receiver, position, content) {
    if (position < 0) 
      $receiver.addAll_u57x28$(0, content);
    else if (position > $receiver.size) 
      $receiver.addAll_brywnq$(content);
    else {
      $receiver.addAll_u57x28$(position, content);
    }
  }
  var VALID_RESOLUTIONS;
  function variance($receiver, other) {
    return abs($receiver.first - other.first | 0) + abs($receiver.second - other.second | 0) | 0;
  }
  function fitWithin($receiver, maxDimension) {
    if (maxDimension === void 0) 
      maxDimension = 640;
    var tmp$, tmp$_0, tmp$_1;
    var originalWidth = $receiver.first;
    var originalHeight = $receiver.second;
    if (originalWidth >= originalHeight && originalWidth > maxDimension) {
      var ratio = maxDimension / originalWidth;
      var newPair = new Pair(maxDimension, numberToInt(originalHeight * ratio));
      var $receiver_0 = VALID_RESOLUTIONS;
      var minByOrNull$result;
      minByOrNull$break:
        do {
          var iterator = $receiver_0.iterator();
          if (!iterator.hasNext()) {
            minByOrNull$result = null;
            break minByOrNull$break;
          }
          var minElem = iterator.next();
          if (!iterator.hasNext()) {
            minByOrNull$result = minElem;
            break minByOrNull$break;
          }
          var minValue = variance(minElem, newPair);
          do {
            var e = iterator.next();
            var v = variance(e, newPair);
            if (Kotlin.compareTo(minValue, v) > 0) {
              minElem = e;
              minValue = v;
            }
          } while (iterator.hasNext());
          minByOrNull$result = minElem;
        } while (false);
      return (tmp$ = minByOrNull$result) != null ? tmp$ : newPair;
    } else if (originalHeight > originalWidth && originalHeight > maxDimension) {
      var ratio_0 = maxDimension / originalHeight;
      var newPair_0 = new Pair(numberToInt(originalWidth * ratio_0), maxDimension);
      var $receiver_1 = VALID_RESOLUTIONS;
      var minByOrNull$result_0;
      minByOrNull$break:
        do {
          var iterator_0 = $receiver_1.iterator();
          if (!iterator_0.hasNext()) {
            minByOrNull$result_0 = null;
            break minByOrNull$break;
          }
          var minElem_0 = iterator_0.next();
          if (!iterator_0.hasNext()) {
            minByOrNull$result_0 = minElem_0;
            break minByOrNull$break;
          }
          var minValue_0 = variance(minElem_0, newPair_0);
          do {
            var e_0 = iterator_0.next();
            var v_0 = variance(e_0, newPair_0);
            if (Kotlin.compareTo(minValue_0, v_0) > 0) {
              minElem_0 = e_0;
              minValue_0 = v_0;
            }
          } while (iterator_0.hasNext());
          minByOrNull$result_0 = minElem_0;
        } while (false);
      return (tmp$_0 = minByOrNull$result_0) != null ? tmp$_0 : newPair_0;
    }
    var $receiver_2 = VALID_RESOLUTIONS;
    var minByOrNull$result_1;
    minByOrNull$break:
      do {
        var iterator_1 = $receiver_2.iterator();
        if (!iterator_1.hasNext()) {
          minByOrNull$result_1 = null;
          break minByOrNull$break;
        }
        var minElem_1 = iterator_1.next();
        if (!iterator_1.hasNext()) {
          minByOrNull$result_1 = minElem_1;
          break minByOrNull$break;
        }
        var minValue_1 = variance(minElem_1, $receiver);
        do {
          var e_1 = iterator_1.next();
          var v_1 = variance(e_1, $receiver);
          if (Kotlin.compareTo(minValue_1, v_1) > 0) {
            minElem_1 = e_1;
            minValue_1 = v_1;
          }
        } while (iterator_1.hasNext());
        minByOrNull$result_1 = minElem_1;
      } while (false);
    return (tmp$_1 = minByOrNull$result_1) != null ? tmp$_1 : $receiver;
  }
  function personFullName($receiver) {
    return toString($receiver.firstNames) + ' ' + toString($receiver.lastName);
  }
  function toUmAccount($receiver, endpointUrl) {
    return new UmAccount($receiver.personUid, $receiver.username, '', endpointUrl, $receiver.firstNames, $receiver.lastName, $receiver.admin);
  }
  function get_isMinor($receiver) {
    return age(DateTime.Companion.invoke_s8cxhz$($receiver.dateOfBirth)) < UstadMobileConstants_getInstance().MINOR_AGE_THRESHOLD;
  }
  function toUmAccount_0($receiver, endpointUrl, username) {
    return new UmAccount($receiver.personUid, username, '', endpointUrl, $receiver.firstNames, $receiver.lastName, $receiver.admin);
  }
  function toDateRangeMoment($receiver) {
    var $receiver_0 = new Moment();
    $receiver_0.typeFlag = equals($receiver.fromDate, L0) ? 1 : 0;
    $receiver_0.fixedTime = $receiver.fromDate;
    $receiver_0.relTo = $receiver.fromRelTo;
    $receiver_0.relUnit = $receiver.fromRelUnit;
    $receiver_0.relOffSet = $receiver.fromRelOffSet;
    var $receiver_1 = new Moment();
    $receiver_1.typeFlag = equals($receiver.toDate, L0) ? 1 : 0;
    $receiver_1.fixedTime = $receiver.toDate;
    $receiver_1.relTo = $receiver.toRelTo;
    $receiver_1.relUnit = $receiver.toRelUnit;
    $receiver_1.relOffSet = $receiver.toRelOffSet;
    return new DateRangeMoment($receiver_0, $receiver_1);
  }
  function toDisplayString_1($receiver, systemImpl, context) {
    var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
    var $receiver_0 = ReportFilterEditPresenter$FieldOption$values();
    var firstOrNull$result;
    firstOrNull$break:
      do {
        var tmp$_4;
        for (tmp$_4 = 0; tmp$_4 !== $receiver_0.length; ++tmp$_4) {
          var element = $receiver_0[tmp$_4];
          if (element.optionVal === $receiver.reportFilterField) {
            firstOrNull$result = element;
            break firstOrNull$break;
          }
        }
        firstOrNull$result = null;
      } while (false);
    tmp$ = firstOrNull$result;
    if (tmp$ == null) {
      return '';
    }
    var fieldOption = tmp$;
    var $receiver_1 = ReportFilterEditPresenter$ConditionOption$values();
    var firstOrNull$result_0;
    firstOrNull$break:
      do {
        var tmp$_5;
        for (tmp$_5 = 0; tmp$_5 !== $receiver_1.length; ++tmp$_5) {
          var element_0 = $receiver_1[tmp$_5];
          if (element_0.optionVal === $receiver.reportFilterCondition) {
            firstOrNull$result_0 = element_0;
            break firstOrNull$break;
          }
        }
        firstOrNull$result_0 = null;
      } while (false);
    tmp$_0 = firstOrNull$result_0;
    if (tmp$_0 == null) {
      return '';
    }
    var conditionOption = tmp$_0;
    var fieldValue = systemImpl.getString(fieldOption.messageId, context);
    var conditionValue = systemImpl.getString(conditionOption.messageId, context);
    var valueString = $receiver.reportFilterValue;
    if (100 === $receiver.reportFilterField) {
      var $receiver_2 = ReportFilterEditPresenter$Companion_getInstance().genderMap.entries;
      var firstOrNull$result_1;
      firstOrNull$break:
        do {
          var tmp$_6;
          tmp$_6 = $receiver_2.iterator();
          while (tmp$_6.hasNext()) {
            var element_1 = tmp$_6.next();
            if (element_1.key === $receiver.reportFilterDropDownValue) {
              firstOrNull$result_1 = element_1;
              break firstOrNull$break;
            }
          }
          firstOrNull$result_1 = null;
        } while (false);
      var selectedOption = firstOrNull$result_1;
      valueString = systemImpl.getString((tmp$_1 = selectedOption != null ? selectedOption.value : null) != null ? tmp$_1 : 0, context);
    } else if (106 === $receiver.reportFilterField) {
      var $receiver_3 = OUTCOME_TO_MESSAGE_ID_MAP.entries;
      var firstOrNull$result_2;
      firstOrNull$break:
        do {
          var tmp$_7;
          tmp$_7 = $receiver_3.iterator();
          while (tmp$_7.hasNext()) {
            var element_2 = tmp$_7.next();
            if (element_2.key === $receiver.reportFilterDropDownValue) {
              firstOrNull$result_2 = element_2;
              break firstOrNull$break;
            }
          }
          firstOrNull$result_2 = null;
        } while (false);
      var selectedOption_0 = firstOrNull$result_2;
      valueString = systemImpl.getString((tmp$_2 = selectedOption_0 != null ? selectedOption_0.value : null) != null ? tmp$_2 : 0, context);
    } else if (102 === $receiver.reportFilterField) {
      var $receiver_4 = ReportFilterEditPresenter$ContentCompletionStatusOption$values();
      var firstOrNull$result_3;
      firstOrNull$break:
        do {
          var tmp$_8;
          for (tmp$_8 = 0; tmp$_8 !== $receiver_4.length; ++tmp$_8) {
            var element_3 = $receiver_4[tmp$_8];
            if (element_3.optionVal === $receiver.reportFilterDropDownValue) {
              firstOrNull$result_3 = element_3;
              break firstOrNull$break;
            }
          }
          firstOrNull$result_3 = null;
        } while (false);
      var selectedOption_1 = firstOrNull$result_3;
      valueString = systemImpl.getString((tmp$_3 = selectedOption_1 != null ? selectedOption_1.messageId : null) != null ? tmp$_3 : 0, context);
    } else if ($receiver.reportFilterCondition === 205) 
      valueString = toString($receiver.reportFilterValueBetweenX) + ' ' + systemImpl.getString(2114, context) + ' ' + toString($receiver.reportFilterValueBetweenY);
    else if ($receiver.reportFilterField === 103 || $receiver.reportFilterField === 107) 
      valueString = '...';
    return fieldValue + ' ' + conditionValue + ' ' + toString(valueString);
  }
  function QueryParts(sqlStr, sqlListStr, queryParams) {
    this.sqlStr = sqlStr;
    this.sqlListStr = sqlListStr;
    this.queryParams = queryParams;
  }
  QueryParts.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'QueryParts', 
  interfaces: []};
  QueryParts.prototype.component1 = function() {
  return this.sqlStr;
};
  QueryParts.prototype.component2 = function() {
  return this.sqlListStr;
};
  QueryParts.prototype.component3 = function() {
  return this.queryParams;
};
  QueryParts.prototype.copy_gc47or$ = function(sqlStr, sqlListStr, queryParams) {
  return new QueryParts(sqlStr === void 0 ? this.sqlStr : sqlStr, sqlListStr === void 0 ? this.sqlListStr : sqlListStr, queryParams === void 0 ? this.queryParams : queryParams);
};
  QueryParts.prototype.toString = function() {
  return 'QueryParts(sqlStr=' + Kotlin.toString(this.sqlStr) + (', sqlListStr=' + Kotlin.toString(this.sqlListStr)) + (', queryParams=' + Kotlin.toString(this.queryParams)) + ')';
};
  QueryParts.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.sqlStr) | 0;
  result = result * 31 + Kotlin.hashCode(this.sqlListStr) | 0;
  result = result * 31 + Kotlin.hashCode(this.queryParams) | 0;
  return result;
};
  QueryParts.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.sqlStr, other.sqlStr) && Kotlin.equals(this.sqlListStr, other.sqlListStr) && Kotlin.equals(this.queryParams, other.queryParams)))));
};
  function toSql($receiver, report, accountPersonUid, dbType) {
    var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5, tmp$_6;
    var paramList = ArrayList_init();
    switch ($receiver.reportSeriesYAxis) {
      case 200:
        tmp$ = 'SUM(ResultSource.resultDuration) AS yAxis, ';
        break;
      case 201:
        tmp$ = trimMargin('SUM(ResultSource.resultDuration) / COUNT(DISTINCT \n            ResultSource.contextRegistration) AS yAxis, ');
        break;
      case 202:
        tmp$ = 'COUNT(DISTINCT ResultSource.contextRegistration) As yAxis, ';
        break;
      case 203:
        tmp$ = 'COUNT(ResultSource.statementId) AS yAxis, ';
        break;
      case 204:
        tmp$ = 'COUNT(DISTINCT ResultSource.statementPersonUid) As yAxis, ';
        break;
      case 205:
        tmp$ = trimMargin('SUM(ResultSource.resultDuration) / COUNT(DISTINCT \n            ResultSource.statementPersonUid) As yAxis, ');
        break;
      case 208:
        tmp$ = 'COUNT(DISTINCT CASE WHEN \n            ResultSource.attendanceStatus = 1 \n            THEN ResultSource.clazzLogAttendanceRecordUid ELSE NULL END) As yAxis, ';
        break;
      case 209:
        tmp$ = 'COUNT(DISTINCT CASE WHEN \n            ResultSource.attendanceStatus = 2 \n            THEN ResultSource.clazzLogAttendanceRecordUid ELSE NULL END) As yAxis, ';
        break;
      case 210:
        tmp$ = 'COUNT(DISTINCT CASE WHEN \n            ResultSource.attendanceStatus = 4 \n            THEN ResultSource.clazzLogAttendanceRecordUid ELSE NULL END) As yAxis, ';
        break;
      case 211:
        tmp$ = trimMargin('((CAST(COUNT(DISTINCT CASE WHEN \n            ResultSource.attendanceStatus = 1 \n            THEN ResultSource.clazzLogAttendanceRecordUid ELSE NULL END) \n            AS REAL) / MAX(COUNT(DISTINCT ResultSource.clazzLogAttendanceRecordUid),1)) * 100)  as yAxis, ');
        break;
      case 212:
        tmp$ = trimMargin('((CAST(COUNT(DISTINCT CASE WHEN \n            ResultSource.attendanceStatus = 1 \n            OR ResultSource.attendanceStatus = 4 \n            THEN ResultSource.clazzLogAttendanceRecordUid ELSE NULL END) \n            AS REAL) / MAX(COUNT(DISTINCT ResultSource.clazzLogAttendanceRecordUid),1)) * 100) as yAxis, ');
        break;
      case 213:
        tmp$ = 'COUNT(DISTINCT ResultSource.clazzLogAttendanceRecordClazzLogUid) As yAxis, ';
        break;
      case 214:
        tmp$ = trimMargin('COUNT(DISTINCT CASE WHEN \n            ResultSource.attendanceStatus = 1 THEN\n            ResultSource.clazzLogAttendanceRecordPersonUid ELSE NULL END) As yAxis, ');
        break;
      case 206:
        tmp$ = trimMargin('COUNT(DISTINCT CASE WHEN (ResultSource.resultCompletion \n            AND ResultSource.contentEntryRoot AND ResultSource.statementVerbUid = 10001)\n            THEN ResultSource.statementPersonUid ELSE NULL END) as yAxis, ');
        break;
      case 207:
        tmp$ = '((CAST(COUNT(DISTINCT CASE WHEN \n            (ResultSource.resultCompletion AND ResultSource.contentEntryRoot \n            AND ResultSource.statementVerbUid = 10001)\n            THEN ResultSource.statementPersonUid ELSE NULL END) \n            AS REAL) / MAX(COUNT(DISTINCT ResultSource.statementPersonUid),1)) * 100) as yAxis, ';
        break;
      default:
        tmp$ = '';
        break;
    }
    var sql = 'SELECT ' + tmp$;
    var queryType = 0;
    switch ($receiver.reportSeriesYAxis) {
      case 208:
      case 209:
      case 210:
      case 213:
      case 211:
      case 212:
      case 214:
        queryType = 101;
        break;
      case 200:
      case 201:
      case 203:
      case 204:
      case 205:
      case 206:
      case 207:
      case 202:
        queryType = 100;
        break;
    }
    sql += groupBy(report.xAxis, queryType, dbType) + 'AS xAxis ';
    if ($receiver.reportSeriesSubGroup !== 0) {
      sql += ' , ' + groupBy($receiver.reportSeriesSubGroup, queryType, dbType) + 'AS subgroup ';
    }
    sql += 'FROM (SELECT ';
    var tmp$_7;
    if ((tmp$_0 = $receiver.reportSeriesFilters) != null) {
      var destination = ArrayList_init_0(collectionSizeOrDefault(tmp$_0, 10));
      var tmp$_8;
      tmp$_8 = tmp$_0.iterator();
      while (tmp$_8.hasNext()) {
        var item = tmp$_8.next();
        destination.add_11rb$(item.reportFilterField);
      }
      tmp$_7 = destination;
    } else 
      tmp$_7 = null;
    var filterFieldList = tmp$_7;
    var tmp$_9;
    if (filterFieldList != null) {
      var any$result;
      any$break:
        do {
          var tmp$_10;
          if (Kotlin.isType(filterFieldList, Collection) && filterFieldList.isEmpty()) {
            any$result = false;
            break any$break;
          }
          tmp$_10 = filterFieldList.iterator();
          while (tmp$_10.hasNext()) {
            var element = tmp$_10.next();
            if (element === 106 || element === 107) {
              any$result = true;
              break any$break;
            }
          }
          any$result = false;
        } while (false);
      tmp$_9 = any$result;
    } else 
      tmp$_9 = null;
    var hasFilterEnrolment = (tmp$_1 = tmp$_9) != null ? tmp$_1 : false;
    var tmp$_11;
    if (filterFieldList != null) {
      var any$result_0;
      any$break:
        do {
          var tmp$_12;
          if (Kotlin.isType(filterFieldList, Collection) && filterFieldList.isEmpty()) {
            any$result_0 = false;
            break any$break;
          }
          tmp$_12 = filterFieldList.iterator();
          while (tmp$_12.hasNext()) {
            var element_0 = tmp$_12.next();
            if (element_0 === 104 || element_0 === 103 || element_0 === 102) {
              any$result_0 = true;
              break any$break;
            }
          }
          any$result_0 = false;
        } while (false);
      tmp$_11 = any$result_0;
    } else 
      tmp$_11 = null;
    var hasFilterStatement = (tmp$_2 = tmp$_11) != null ? tmp$_2 : false;
    var addEnrolmentJoin = report.xAxis === 308 || $receiver.reportSeriesSubGroup === 308 || report.xAxis === 309 || $receiver.reportSeriesSubGroup === 309 || report.xAxis === 307 || $receiver.reportSeriesSubGroup === 307 || hasFilterEnrolment;
    var addClassJoin = report.xAxis === 307 || $receiver.reportSeriesSubGroup === 307;
    var addEntryJoin = hasFilterStatement || report.xAxis === 304 || $receiver.reportSeriesSubGroup === 304;
    if (addEnrolmentJoin) {
      sql += 'ClazzEnrolment.clazzEnrolmentOutcome, ClazzEnrolment.clazzEnrolmentLeavingReasonUid, ';
      if (addClassJoin) {
        sql += 'Clazz.clazzUid, ';
      }
    }
    if (addEntryJoin && queryType !== 100) {
      sql += 'StatementEntity.*, ';
    }
    switch (queryType) {
      case 101:
        sql += trimIndent('\n               ClazzLogAttendanceRecord.*, ClazzLog.logDate , Person.* \n            ');
        break;
      case 100:
        sql += trimMargin('\n                StatementEntity.* , Person.* \n            ');
        break;
    }
    var personPermission = '\n        FROM PersonGroupMember\n            \n            JOIN ScopedGrant\n                 ON ScopedGrant.sgGroupUid = PersonGroupMember.groupMemberGroupUid\n                    AND (ScopedGrant.sgPermissions & \n                549755813888 \n                                                    ) > 0\n            JOIN Person \n                 ON \n                ((ScopedGrant.sgTableId = -2\n                    AND ScopedGrant.sgEntityUid = -2)\n                 OR (ScopedGrant.sgTableId = 9\n                    AND ScopedGrant.sgEntityUid = Person.personUid)\n                 OR (ScopedGrant.sgTableId = 6       \n                    AND Person.personUid IN (\n                        SELECT DISTINCT clazzEnrolmentPersonUid\n                          FROM ClazzEnrolment\n                         WHERE clazzEnrolmentClazzUid =ScopedGrant.sgEntityUid \n                           AND ClazzEnrolment.clazzEnrolmentActive))\n                 OR (ScopedGrant.sgTableId = 164\n                    AND Person.personUid IN (\n                        SELECT DISTINCT schoolMemberPersonUid\n                          FROM SchoolMember\n                         WHERE schoolMemberSchoolUid = ScopedGrant.sgEntityUid\n                           AND schoolMemberActive))\n                           )    \n        \n        \n         ';
    var sqlList = 'SELECT  Person.* , XLangMapEntry.* ,StatementEntity.* \n                \n        FROM PersonGroupMember\n            \n            JOIN ScopedGrant\n                 ON ScopedGrant.sgGroupUid = PersonGroupMember.groupMemberGroupUid\n                    AND (ScopedGrant.sgPermissions & \n                549755813888 \n                                                    ) > 0\n            JOIN Person \n                 ON \n                ((ScopedGrant.sgTableId = -2\n                    AND ScopedGrant.sgEntityUid = -2)\n                 OR (ScopedGrant.sgTableId = 9\n                    AND ScopedGrant.sgEntityUid = Person.personUid)\n                 OR (ScopedGrant.sgTableId = 6       \n                    AND Person.personUid IN (\n                        SELECT DISTINCT clazzEnrolmentPersonUid\n                          FROM ClazzEnrolment\n                         WHERE clazzEnrolmentClazzUid =ScopedGrant.sgEntityUid \n                           AND ClazzEnrolment.clazzEnrolmentActive))\n                 OR (ScopedGrant.sgTableId = 164\n                    AND Person.personUid IN (\n                        SELECT DISTINCT schoolMemberPersonUid\n                          FROM SchoolMember\n                         WHERE schoolMemberSchoolUid = ScopedGrant.sgEntityUid\n                           AND schoolMemberActive))\n                           )    \n        \n        \n          LEFT JOIN StatementEntity ON \n                StatementEntity.statementPersonUid = Person.personUid \n                LEFT JOIN XLangMapEntry ON XLangMapEntry.statementLangMapUid = \n                (SELECT statementLangMapUid FROM XLangMapEntry \n                WHERE statementVerbUid = StatementEntity.statementVerbUid LIMIT 1) ';
    sql += personPermission;
    if (queryType === 101) {
      sql += trimMargin('LEFT JOIN ClazzLogAttendanceRecord ON\n            Person.personUid  = ClazzLogAttendanceRecord.clazzLogAttendanceRecordPersonUid \n            LEFT JOIN ClazzLog ON ClazzLogAttendanceRecord.clazzLogAttendanceRecordClazzLogUid = ClazzLog.clazzLogUid ');
    }
    if (addEntryJoin || queryType === 100) {
      sql += 'LEFT JOIN StatementEntity ON Person.personUid = StatementEntity.statementPersonUid ';
    }
    if (addEnrolmentJoin) {
      var joinEnrolment = trimMargin('LEFT JOIN ClazzEnrolment ON \n                    Person.personUid = ClazzEnrolment.clazzEnrolmentPersonUid ');
      sql += joinEnrolment;
      if (hasFilterEnrolment) {
        sqlList += joinEnrolment;
      }
      if (addClassJoin) {
        tmp$_4 = sql;
        if (queryType === 101) {
          tmp$_3 = 'LEFT JOIN Clazz ON ClazzLog.clazzLogClazzUid = Clazz.clazzUid ';
        } else {
          tmp$_3 = 'LEFT JOIN Clazz ON Clazz.clazzUid = ClazzEnrolment.clazzEnrolmentClazzUid ';
        }
        sql = tmp$_4 + tmp$_3;
      }
    }
    var where = ' WHERE PersonGroupMember.groupMemberPersonUid = ? ';
    sql += where;
    sqlList += where;
    paramList.add_11rb$(accountPersonUid);
    var tmp$_13 = report.reportDateRangeSelection !== 0;
    if (!tmp$_13) {
      tmp$_13 = ((tmp$_5 = $receiver.reportSeriesFilters) != null ? !tmp$_5.isEmpty() : null) === true;
    }
    if (tmp$_13) {
      var whereList = ArrayList_init();
      if ((tmp$_6 = $receiver.reportSeriesFilters) != null) {
        var tmp$_14;
        tmp$_14 = tmp$_6.iterator();
        while (tmp$_14.hasNext()) {
          var element_1 = tmp$_14.next();
          var tmp$_15, tmp$_16, tmp$_17, tmp$_18, tmp$_19, tmp$_20, tmp$_21, tmp$_22;
          switch (element_1.reportFilterField) {
            case 101:
              var filterString = 'Person.dateOfBirth ';
              var age = (tmp$_16 = (tmp$_15 = element_1.reportFilterValue) != null ? toInt(tmp$_15) : null) != null ? tmp$_16 : 13;
              var betweenAgeX = (tmp$_18 = (tmp$_17 = element_1.reportFilterValueBetweenX) != null ? toInt(tmp$_17) : null) != null ? tmp$_18 : 13;
              var betweenAgeY = (tmp$_20 = (tmp$_19 = element_1.reportFilterValueBetweenY) != null ? toInt(tmp$_19) : null) != null ? tmp$_20 : 18;
              var now = DateTime.Companion.now();
              var dateTimeAgeNow = now.minus_glepj8$(new MonthSpan_init(12 * age | 0));
              var dateTimeAgeX = now.minus_glepj8$(new MonthSpan_init(12 * betweenAgeX | 0));
              var dateTimeAgeY = now.minus_glepj8$(new MonthSpan_init(12 * betweenAgeY | 0));
              filterString += handleCondition(element_1.reportFilterCondition);
              switch (element_1.reportFilterCondition) {
                case 202:
                  filterString += dateTimeAgeNow.dateDayStart.unixMillisLong.toString() + ' ';
                  break;
                case 203:
                  filterString += dateTimeAgeNow.dateDayStart.unixMillisLong.toString() + ' ';
                  break;
                case 205:
                  filterString += ' ' + dateTimeAgeX.dateDayStart.unixMillisLong.toString() + ' ' + '\n' + '                                AND ' + dateTimeAgeY.dateDayStart.unixMillisDouble + ' ';
                  break;
              }
              whereList.add_11rb$(filterString);
              break;
            case 100:
              var filterString_0 = 'Person.gender ';
              filterString_0 += handleCondition(element_1.reportFilterCondition);
              filterString_0 += element_1.reportFilterDropDownValue.toString() + ' ';
              whereList.add_11rb$(filterString_0);
              break;
            case 102:
              var filterString_1 = '(StatementEntity.contentEntryRoot AND StatementEntity.resultCompletion ';
              tmp$_22 = filterString_1;
              switch (element_1.reportFilterDropDownValue) {
                case 100:
                  tmp$_21 = ')';
                  break;
                case 102:
                  tmp$_21 = 'AND StatementEntity.resultSuccess ' + handleCondition(element_1.reportFilterCondition) + ' ' + StatementEntity.Companion.RESULT_SUCCESS + ') ';
                  break;
                case 103:
                  tmp$_21 = 'AND StatementEntity.resultSuccess ' + handleCondition(element_1.reportFilterCondition) + ' ' + StatementEntity.Companion.RESULT_FAILURE + ') ';
                  break;
                default:
                  tmp$_21 = '';
                  break;
              }
              filterString_1 = tmp$_22 + tmp$_21;
              var element_2 = filterString_1;
              whereList.add_11rb$(element_2);
              break;
            case 103:
              var filterString_2 = 'StatementEntity.statementContentEntryUid ';
              filterString_2 += handleCondition(element_1.reportFilterCondition);
              filterString_2 += '(' + toString(element_1.reportFilterValue) + ') ';
              whereList.add_11rb$(filterString_2);
              break;
            case 105:
              var filterString_3 = '(SELECT ((CAST(COUNT(DISTINCT CASE WHEN \n            ClazzLogAttendanceRecord.attendanceStatus = 1 \n            THEN ClazzLogAttendanceRecord.clazzLogAttendanceRecordUid ELSE NULL END) \n            AS REAL) / MAX(COUNT(DISTINCT ClazzLogAttendanceRecord.clazzLogAttendanceRecordUid),1)) * 100) as attendance FROM ClazzLogAttendanceRecord) ';
              filterString_3 += handleCondition(element_1.reportFilterCondition);
              filterString_3 += ' ' + toString(element_1.reportFilterValueBetweenX) + ' ' + '\n' + '                        AND ' + toString(element_1.reportFilterValueBetweenY) + ' ';
              whereList.add_11rb$(filterString_3);
              break;
            case 104:
              var filterString_4 = 'StatementEntity.extensionProgress ';
              filterString_4 += handleCondition(element_1.reportFilterCondition);
              filterString_4 += ' ' + toString(element_1.reportFilterValueBetweenX) + ' ' + '\n' + '                        AND ' + toString(element_1.reportFilterValueBetweenY) + ' ';
              whereList.add_11rb$(filterString_4);
              break;
            case 107:
              var filterString_5 = 'ClazzEnrolment.clazzEnrolmentLeavingReasonUid ';
              filterString_5 += handleCondition(element_1.reportFilterCondition);
              filterString_5 += '(' + toString(element_1.reportFilterValue) + ') ';
              whereList.add_11rb$(filterString_5);
              break;
            case 106:
              var filterString_6 = 'ClazzEnrolment.clazzEnrolmentOutcome ';
              filterString_6 += handleCondition(element_1.reportFilterCondition);
              filterString_6 += element_1.reportFilterDropDownValue.toString() + ' ';
              whereList.add_11rb$(filterString_6);
              break;
          }
        }
      }
      if (report.reportDateRangeSelection !== 0) {
        var dateRangeMoment = toFixedDatePair(toDateRangeMoment(report));
        whereList.add_11rb$('(StatementEntity.timestamp >= ? AND StatementEntity.timestamp <= ?) ');
        paramList.add_11rb$(dateRangeMoment.first);
        paramList.add_11rb$(dateRangeMoment.second);
      }
      var whereListStr = ' AND ' + joinToString(whereList, ' AND ');
      sql += whereListStr;
      sqlList += whereListStr;
    }
    switch (queryType) {
      case 101:
        sql += trimIndent('\n                GROUP BY ClazzLogAttendanceRecord.clazzLogAttendanceRecordUid, \n                         ClazzLog.clazzLogUid, Person.personUid \n            ');
        break;
      case 100:
        sql += trimMargin('\n                GROUP BY StatementEntity.statementUid, Person.personUid \n            ');
        break;
    }
    if (addEnrolmentJoin) {
      sql += ',ClazzEnrolment.clazzEnrolmentUid ';
      if (addClassJoin) {
        sql += ',Clazz.clazzUid ';
      }
    }
    if (addEntryJoin || queryType === 100) {
      sql += ', StatementEntity.statementUid ';
    }
    sql += ') AS ResultSource ';
    sql += ' GROUP BY xAxis ';
    if ($receiver.reportSeriesSubGroup !== 0) {
      sql += ' , subgroup ';
    }
    sqlList += ' GROUP BY StatementEntity.statementUid ORDER BY StatementEntity.timestamp DESC';
    return new QueryParts(sql, sqlList, copyToArray(paramList));
  }
  function handleCondition(conditionOption) {
    var tmp$;
    switch (conditionOption) {
      case 206:
        tmp$ = 'IN ';
        break;
      case 207:
        tmp$ = 'NOT IN ';
        break;
      case 200:
        tmp$ = '= ';
        break;
      case 201:
        tmp$ = '!= ';
        break;
      case 202:
        tmp$ = '>= ';
        break;
      case 203:
        tmp$ = '<= ';
        break;
      case 205:
        tmp$ = 'BETWEEN ';
        break;
      default:
        tmp$ = '';
        break;
    }
    return tmp$;
  }
  function groupBy(value, queryType, dbType) {
    var tmp$, tmp$_0, tmp$_1, tmp$_2;
    switch (value) {
      case 300:
        switch (queryType) {
          case 100:
            tmp$ = 'ResultSource.timestamp';
            break;
          case 101:
            tmp$ = 'ResultSource.logDate';
            break;
          default:
            tmp$ = '';
            break;
        }
        var field = tmp$;
        switch (dbType) {
          case 1:
            tmp$_2 = "strftime('%d/%m/%Y', " + field + "/1000, 'unixepoch') ";
            break;
          case 2:
            tmp$_2 = 'TO_CHAR(TO_TIMESTAMP(' + field + "/1000), 'DD/MM/YYYY') ";
            break;
          default:
            tmp$_2 = '';
            break;
        }
        break;
      case 301:
        switch (queryType) {
          case 100:
            tmp$_0 = 'ResultSource.timestamp';
            break;
          case 101:
            tmp$_0 = 'ResultSource.logDate';
            break;
          default:
            tmp$_0 = '';
            break;
        }
        var field_0 = tmp$_0;
        switch (dbType) {
          case 1:
            tmp$_2 = "strftime('%d/%m/%Y', " + field_0 + "/1000, 'unixepoch', 'weekday 6', '-5 day') ";
            break;
          case 2:
            tmp$_2 = "TO_CHAR(DATE(DATE_TRUNC('week', TO_TIMESTAMP(" + field_0 + "/1000))), 'DD/MM/YYYY') ";
            break;
          default:
            tmp$_2 = '';
            break;
        }
        break;
      case 302:
        switch (queryType) {
          case 100:
            tmp$_1 = 'ResultSource.timestamp';
            break;
          case 101:
            tmp$_1 = 'ResultSource.logDate';
            break;
          default:
            tmp$_1 = '';
            break;
        }
        var field_1 = tmp$_1;
        switch (dbType) {
          case 1:
            tmp$_2 = "strftime('%m/%Y', " + field_1 + "/1000, 'unixepoch') ";
            break;
          case 2:
            tmp$_2 = 'TO_CHAR(TO_TIMESTAMP(' + field_1 + "/1000), 'MM/YYYY') ";
            break;
          default:
            tmp$_2 = '';
            break;
        }
        break;
      case 304:
        tmp$_2 = 'ResultSource.statementContentEntryUid ';
        break;
      case 306:
        tmp$_2 = 'ResultSource.gender ';
        break;
      case 307:
        tmp$_2 = 'ResultSource.clazzUid ';
        break;
      case 308:
        tmp$_2 = 'ResultSource.clazzEnrolmentOutcome ';
        break;
      case 309:
        tmp$_2 = 'ResultSource.clazzEnrolmentLeavingReasonUid ';
        break;
      default:
        tmp$_2 = '';
        break;
    }
    return tmp$_2;
  }
  function generateSql($receiver, accountPersonUid, dbType) {
    var tmp$;
    var queryPartsList = LinkedHashMap_init();
    if ((tmp$ = $receiver.reportSeriesWithFiltersList) != null) {
      var tmp$_0;
      tmp$_0 = tmp$.iterator();
      while (tmp$_0.hasNext()) {
        var element = tmp$_0.next();
        var value = toSql(element, $receiver, accountPersonUid, dbType);
        queryPartsList.put_xwzc9p$(element, value);
      }
    }
    return toMap(queryPartsList);
  }
  function toBitmaskFlagList($receiver) {
    var tmp$;
    if ($receiver.sgTableId === 6) 
      tmp$ = ScopedGrantEditPresenter$Companion_getInstance().COURSE_PERMISSIONS;
    else 
      tmp$ = L0;
    var tableAvailablePermissions = tmp$;
    var $receiver_0 = ScopedGrantEditPresenter$Companion_getInstance().PERMISSION_MESSAGE_ID_LIST;
    var destination = ArrayList_init();
    var tmp$_0;
    tmp$_0 = $receiver_0.iterator();
    while (tmp$_0.hasNext()) {
      var element = tmp$_0.next();
      if (hasFlag_0(tableAvailablePermissions, element.flagVal)) 
        destination.add_11rb$(element);
    }
    var destination_0 = ArrayList_init_0(collectionSizeOrDefault(destination, 10));
    var tmp$_1;
    tmp$_1 = destination.iterator();
    while (tmp$_1.hasNext()) {
      var item = tmp$_1.next();
      destination_0.add_11rb$(item.toBitmaskFlag_s8cxhz$($receiver.sgPermissions));
    }
    return destination_0;
  }
  function encryptWithPbkdf2($receiver, salt, pbkdf2Params) {
    return encryptWithPbkdf2_0($receiver, salt, pbkdf2Params.iterations, pbkdf2Params.keyLength);
  }
  function doublePbkdf2Hash($receiver, salt, pbkdf2Params) {
    var round1 = encryptWithPbkdf2($receiver, salt, pbkdf2Params);
    return encryptWithPbkdf2(toHexString(round1), salt, pbkdf2Params);
  }
  function inBrackets($receiver) {
    return '(' + $receiver + ')';
  }
  function toQueryLikeParam($receiver) {
    return $receiver == null || $receiver.length === 0 ? '%' : '%' + toString($receiver) + '%';
  }
  function requirePostfix($receiver, postFix, ignoreCase) {
    if (ignoreCase === void 0) 
      ignoreCase = false;
    return endsWith($receiver, postFix, ignoreCase) ? $receiver : $receiver + postFix;
  }
  function alternative_1($receiver, alternative) {
    return $receiver == null || $receiver.length === 0 ? alternative : $receiver;
  }
  function hexStringToBase64Encoded($receiver) {
    return encodeBase64(hexStringToByteArray($receiver));
  }
  function base64EncodedToHexString($receiver) {
    return toHexString(base64StringToByteArray($receiver));
  }
  function truncate($receiver, maxLength) {
    if (maxLength === void 0) 
      maxLength = 24;
    var tmp$;
    if ($receiver.length > maxLength) {
      tmp$ = $receiver.substring(0, maxLength) + String.fromCharCode(text.Typography.ellipsis);
    } else {
      tmp$ = $receiver;
    }
    return tmp$;
  }
  function startsWithHttpProtocol($receiver) {
    var it = $receiver.toLowerCase();
    return startsWith(it, 'http://') || startsWith(it, 'https://');
  }
  function requireHttpPrefix($receiver, defaultProtocol) {
    if (defaultProtocol === void 0) 
      defaultProtocol = 'https';
    if (startsWithHttpProtocol($receiver)) 
      return $receiver;
    else 
      return defaultProtocol + '://' + $receiver;
  }
  function appendQueryArgs($receiver, queryArgs) {
    var retVal = $receiver;
    if (contains($receiver, '?')) 
      retVal += '&';
    else 
      retVal += '?';
    retVal += queryArgs;
    return retVal;
  }
  function appendQueryArgs_0($receiver, pairs) {
    return appendQueryArgs($receiver, toQueryString(mapOf(pairs.slice())));
  }
  function appendQueryArgs_1($receiver, args) {
    return appendQueryArgs($receiver, toQueryString(args));
  }
  function capitalizeFirstLetter($receiver) {
    var tmp$;
    if ($receiver.length > 0) {
      var it = toBoxedChar($receiver.charCodeAt(0));
      tmp$ = (isLowerCase(unboxChar(it)) ? titlecase(unboxChar(it)) : String.fromCharCode(unboxChar(it))).toString() + $receiver.substring(1);
    } else 
      tmp$ = $receiver;
    return tmp$;
  }
  function countWords($receiver) {
    var tmp$;
    return count(Regex_init('(\\s+|(\\r\\n|\\r|\\n))').findAll_905azu$(trim(Kotlin.isCharSequence(tmp$ = $receiver) ? tmp$ : throwCCE()).toString())) + 1 | 0;
  }
  function toXapiActorJsonObject($receiver, context) {
    var tmp$, tmp$_0;
    var server = (tmp$ = $receiver != null ? $receiver.endpointUrl : null) != null ? tmp$ : 'http://localhost';
    return new UmAccountActor(void 0, new UmAccountActor$Account(server, (tmp$_0 = $receiver != null ? $receiver.username : null) != null ? tmp$_0 : 'anonymous'));
  }
  function toXapiGroupJsonObject($receiver, memberList) {
    var tmp$;
    var endpoint = (tmp$ = $receiver != null ? $receiver.endpointUrl : null) != null ? tmp$ : 'http://localhost';
    var tmp$_0 = void 0;
    var tmp$_1 = new UmAccountActor$Account(endpoint, 'group:' + memberList.get_za3lpa$(0).learnerGroupMemberLgUid.toString());
    var destination = ArrayList_init_0(collectionSizeOrDefault(memberList, 10));
    var tmp$_2;
    tmp$_2 = memberList.iterator();
    while (tmp$_2.hasNext()) {
      var item = tmp$_2.next();
      var tmp$_3, tmp$_4;
      destination.add_11rb$(new UmAccountActor(void 0, new UmAccountActor$Account(endpoint, (tmp$_4 = (tmp$_3 = item.person) != null ? tmp$_3.username : null) != null ? tmp$_4 : 'anonymous')));
    }
    return new UmAccountGroupActor(tmp$_0, tmp$_1, destination);
  }
  function get_userAtServer($receiver) {
    return toString($receiver.username) + '@' + $receiver.endpointUrl;
  }
  function asPerson($receiver, admin) {
    if (admin === void 0) 
      admin = false;
    var $receiver_0 = new Person();
    $receiver_0.firstNames = $receiver.firstName;
    $receiver_0.lastName = $receiver.lastName;
    $receiver_0.personUid = $receiver.personUid;
    $receiver_0.admin = admin;
    return $receiver_0;
  }
  function Coroutine$runPreload$lambda(this$runPreload_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$this$runPreload = this$runPreload_0;
  }
  Coroutine$runPreload$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$runPreload$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$runPreload$lambda.prototype.constructor = Coroutine$runPreload$lambda;
  Coroutine$runPreload$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$runPreload.preload(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 runPreload$lambda(this$runPreload_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$runPreload$lambda(this$runPreload_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function runPreload($receiver) {
    launch(coroutines.GlobalScope, void 0, void 0, runPreload$lambda($receiver));
  }
  function Coroutine$createNewClazzAndGroups($receiver_0, clazz_0, impl_0, termMap_0, context_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$$receiver = $receiver_0;
    this.local$clazz = clazz_0;
    this.local$impl = impl_0;
    this.local$termMap = termMap_0;
    this.local$context = context_0;
  }
  Coroutine$createNewClazzAndGroups.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$createNewClazzAndGroups.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$createNewClazzAndGroups.prototype.constructor = Coroutine$createNewClazzAndGroups;
  Coroutine$createNewClazzAndGroups.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.state_0 = 2;
        this.result_0 = this.local$$receiver.personGroupDao.insertAsync(PersonGroup_init(toString(this.local$clazz.clazzName) + ' - ' + this.local$termMap.get_11rb$(TerminologyKeys_getInstance().TEACHER_KEY)), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$clazz.clazzTeachersPersonGroupUid = this.result_0;
        this.state_0 = 3;
        this.result_0 = this.local$$receiver.personGroupDao.insertAsync(PersonGroup_init(toString(this.local$clazz.clazzName) + ' - ' + this.local$termMap.get_11rb$(TerminologyKeys_getInstance().STUDENTS_KEY)), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$clazz.clazzStudentsPersonGroupUid = this.result_0;
        this.state_0 = 4;
        this.result_0 = this.local$$receiver.personGroupDao.insertAsync(PersonGroup_init(toString(this.local$clazz.clazzName) + ' - ' + this.local$impl.getString(2652, this.local$context)), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.local$clazz.clazzPendingStudentsPersonGroupUid = this.result_0;
        this.state_0 = 5;
        this.result_0 = this.local$$receiver.personGroupDao.insertAsync(PersonGroup_init(toString(this.local$clazz.clazzName) + ' - ' + this.local$impl.getString(2837, this.local$context)), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        this.local$clazz.clazzParentsPersonGroupUid = this.result_0;
                (tmp$ = this.local$clazz.clazzCode == null ? this.local$clazz : null) != null ? (tmp$.clazzCode = randomString(6)) : null;
        var tmp$_0 = this.local$$receiver.scopedGrantDao;
        var $receiver = new ScopedGrant();
        $receiver.sgFlags = 9;
        $receiver.sgPermissions = Role$Companion$ROLE_CLAZZ_TEACHER_PERMISSIONS_DEFAULT;
        $receiver.sgGroupUid = this.local$clazz.clazzTeachersPersonGroupUid;
        $receiver.sgEntityUid = this.local$clazz.clazzUid;
        $receiver.sgTableId = 6;
        var $receiver_0 = new ScopedGrant();
        $receiver_0.sgFlags = 17;
        $receiver_0.sgPermissions = Role$Companion$ROLE_CLAZZ_STUDENT_PERMISSIONS_DEFAULT;
        $receiver_0.sgGroupUid = this.local$clazz.clazzStudentsPersonGroupUid;
        $receiver_0.sgEntityUid = this.local$clazz.clazzUid;
        $receiver_0.sgTableId = 6;
        var $receiver_1 = new ScopedGrant();
        $receiver_1.sgFlags = 65;
        $receiver_1.sgPermissions = Role$Companion$ROLE_CLAZZ_PARENT_PERMISSION_DEFAULT;
        $receiver_1.sgGroupUid = this.local$clazz.clazzParentsPersonGroupUid;
        $receiver_1.sgEntityUid = this.local$clazz.clazzUid;
        $receiver_1.sgTableId = 6;
        this.state_0 = 6;
        this.result_0 = tmp$_0.insertListAsync_djn83v$(listOf([$receiver, $receiver_0, $receiver_1]), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 6:
        this.state_0 = 7;
        this.result_0 = this.local$$receiver.clazzDao.insertAsync(this.local$clazz, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 7:
        this.local$clazz.clazzUid = this.result_0;
        return;
      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 createNewClazzAndGroups($receiver_0, clazz_0, impl_0, termMap_0, context_0, continuation_0, suspended) {
    var instance = new Coroutine$createNewClazzAndGroups($receiver_0, clazz_0, impl_0, termMap_0, context_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function Coroutine$enrolPersonIntoClazzAtLocalTimezone($receiver_0, personToEnrol_0, clazzUid_0, role_0, clazzWithSchool_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$clazzWithSchoolVal = void 0;
    this.local$$receiver = $receiver_0;
    this.local$personToEnrol = personToEnrol_0;
    this.local$clazzUid = clazzUid_0;
    this.local$role = role_0;
    this.local$clazzWithSchool = clazzWithSchool_0;
  }
  Coroutine$enrolPersonIntoClazzAtLocalTimezone.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$enrolPersonIntoClazzAtLocalTimezone.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$enrolPersonIntoClazzAtLocalTimezone.prototype.constructor = Coroutine$enrolPersonIntoClazzAtLocalTimezone;
  Coroutine$enrolPersonIntoClazzAtLocalTimezone.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$clazzWithSchool === void 0) 
          this.local$clazzWithSchool = null;
        if (this.local$clazzWithSchool == null) {
          this.state_0 = 2;
          this.result_0 = this.local$$receiver.clazzDao.getClazzWithSchool_s8cxhz$(this.local$clazzUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.local$clazzWithSchool = this.result_0;
        this.state_0 = 3;
        continue;
      case 3:
        if (this.local$clazzWithSchool == null) {
          throw IllegalArgumentException_init('Class does not exist');
        }
        this.local$clazzWithSchoolVal = this.local$clazzWithSchool;
        this.state_0 = 4;
        this.result_0 = this.local$$receiver.clazzEnrolmentDao.getAllClazzEnrolledAtTimeAsync_6qtc6d$(this.local$clazzUid, systemTimeInMillis(), 0, this.local$personToEnrol.personUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        var existingEnrolments = this.result_0;
        if (!existingEnrolments.isEmpty()) {
          throw new AlreadyEnroledInClassException(first(existingEnrolments));
        }
        var clazzTimeZone = effectiveTimeZone(this.local$clazzWithSchoolVal);
        var $receiver = toOffsetByTimezone(DateTime.Companion.now(), clazzTimeZone);
        var $receiver_0 = $receiver.hours;
        var tmp$ = TimeSpan.Companion.fromHours_14dthe$($receiver_0);
        var $receiver_1 = $receiver.minutes;
        var tmp$_0 = tmp$.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_1));
        var $receiver_2 = $receiver.seconds;
        var tmp$_1 = tmp$_0.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_2));
        var $receiver_3 = $receiver.milliseconds;
        var joinTime = $receiver.minus_fv8bff$(tmp$_1.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_3))).utc.unixMillisLong;
        var $receiver_4 = new ClazzEnrolment();
        $receiver_4.clazzEnrolmentPersonUid = this.local$personToEnrol.personUid;
        $receiver_4.clazzEnrolmentClazzUid = this.local$clazzUid;
        $receiver_4.clazzEnrolmentRole = this.local$role;
        $receiver_4.clazzEnrolmentActive = true;
        $receiver_4.clazzEnrolmentDateJoined = joinTime;
        var clazzEnrolment = $receiver_4;
        this.state_0 = 5;
        this.result_0 = processEnrolmentIntoClass(this.local$$receiver, clazzEnrolment, this.local$clazzWithSchoolVal, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        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 enrolPersonIntoClazzAtLocalTimezone($receiver_0, personToEnrol_0, clazzUid_0, role_0, clazzWithSchool_0, continuation_0, suspended) {
    var instance = new Coroutine$enrolPersonIntoClazzAtLocalTimezone($receiver_0, personToEnrol_0, clazzUid_0, role_0, clazzWithSchool_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function Coroutine$processEnrolmentIntoClass$lambda(closure$enrolment_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$enrolment = closure$enrolment_0;
    this.local$it = it_0;
  }
  Coroutine$processEnrolmentIntoClass$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$processEnrolmentIntoClass$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$processEnrolmentIntoClass$lambda.prototype.constructor = Coroutine$processEnrolmentIntoClass$lambda;
  Coroutine$processEnrolmentIntoClass$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.personParentJoinDao.findByMinorPersonUidWhereParentNotEnrolledInClazz_3pjtqy$(this.local$closure$enrolment.clazzEnrolmentPersonUid, this.local$closure$enrolment.clazzEnrolmentClazzUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 processEnrolmentIntoClass$lambda(closure$enrolment_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$processEnrolmentIntoClass$lambda(closure$enrolment_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$processEnrolmentIntoClass$lambda$lambda(closure$parentJoin_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$closure$parentJoin = closure$parentJoin_0;
    this.local$it = it_0;
  }
  Coroutine$processEnrolmentIntoClass$lambda$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$processEnrolmentIntoClass$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$processEnrolmentIntoClass$lambda$lambda.prototype.constructor = Coroutine$processEnrolmentIntoClass$lambda$lambda;
  Coroutine$processEnrolmentIntoClass$lambda$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$it.personDao.findByUidAsync_s8cxhz$(this.local$closure$parentJoin.parentPersonUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        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 processEnrolmentIntoClass$lambda$lambda(closure$parentJoin_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$processEnrolmentIntoClass$lambda$lambda(closure$parentJoin_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$processEnrolmentIntoClass($receiver_0, enrolment_0, clazzWithSchool_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$tmp$_1 = void 0;
    this.local$clazzWithSchoolVal = void 0;
    this.local$personGroupUid = void 0;
    this.local$tmp$_2 = void 0;
    this.local$$receiver = $receiver_0;
    this.local$enrolment = enrolment_0;
    this.local$clazzWithSchool = clazzWithSchool_0;
  }
  Coroutine$processEnrolmentIntoClass.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$processEnrolmentIntoClass.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$processEnrolmentIntoClass.prototype.constructor = Coroutine$processEnrolmentIntoClass;
  Coroutine$processEnrolmentIntoClass.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$clazzWithSchool === void 0) 
          this.local$clazzWithSchool = null;
        var tmp$, tmp$_0;
        if (this.local$clazzWithSchool == null) {
          this.state_0 = 2;
          this.result_0 = this.local$$receiver.clazzDao.getClazzWithSchool_s8cxhz$(this.local$enrolment.clazzEnrolmentClazzUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.local$clazzWithSchool = this.result_0;
        this.state_0 = 3;
        continue;
      case 3:
        if (this.local$clazzWithSchool == null) {
          throw IllegalArgumentException_init('processEnrolmentIntoClass: Class does not exist');
        }
        this.local$clazzWithSchoolVal = this.local$clazzWithSchool;
        var clazzTimeZone = effectiveTimeZone(this.local$clazzWithSchoolVal);
        var $receiver = toOffsetByTimezone(DateTime.Companion.invoke_s8cxhz$(this.local$enrolment.clazzEnrolmentDateJoined), clazzTimeZone);
        var $receiver_0 = $receiver.hours;
        var tmp$_1 = TimeSpan.Companion.fromHours_14dthe$($receiver_0);
        var $receiver_1 = $receiver.minutes;
        var tmp$_2 = tmp$_1.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_1));
        var $receiver_2 = $receiver.seconds;
        var tmp$_3 = tmp$_2.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_2));
        var $receiver_3 = $receiver.milliseconds;
        this.local$enrolment.clazzEnrolmentDateJoined = $receiver.minus_fv8bff$(tmp$_3.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_3))).utc.unixMillisLong;
        if (!equals(this.local$enrolment.clazzEnrolmentDateLeft, Long$Companion$MAX_VALUE)) {
          var $receiver_4 = toOffsetByTimezone(DateTime.Companion.invoke_s8cxhz$(this.local$enrolment.clazzEnrolmentDateLeft), clazzTimeZone);
          var $receiver_5 = $receiver_4.hours;
          var tmp$_4 = TimeSpan.Companion.fromHours_14dthe$($receiver_5);
          var $receiver_6 = $receiver_4.minutes;
          var tmp$_5 = tmp$_4.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_6));
          var $receiver_7 = $receiver_4.seconds;
          var tmp$_6 = tmp$_5.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_7));
          var $receiver_8 = $receiver_4.milliseconds;
          this.local$enrolment.clazzEnrolmentDateLeft = $receiver_4.minus_fv8bff$(tmp$_6.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_8))).plus_fv8bff$(TimeSpan.Companion.fromHours_14dthe$(24)).minus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$(1)).utc.unixMillisLong;
        }
        this.state_0 = 4;
        this.result_0 = this.local$$receiver.clazzEnrolmentDao.insertAsync(this.local$enrolment, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.local$enrolment.clazzEnrolmentUid = this.result_0;
        switch (this.local$enrolment.clazzEnrolmentRole) {
          case 1001:
            tmp$ = this.local$clazzWithSchoolVal.clazzTeachersPersonGroupUid;
            break;
          case 1000:
            tmp$ = this.local$clazzWithSchoolVal.clazzStudentsPersonGroupUid;
            break;
          case 1003:
            tmp$ = this.local$clazzWithSchoolVal.clazzParentsPersonGroupUid;
            break;
          case 1002:
            tmp$ = this.local$clazzWithSchoolVal.clazzPendingStudentsPersonGroupUid;
            break;
          default:
            tmp$ = L_1;
            break;
        }
        this.local$personGroupUid = tmp$;
        if (!equals(this.local$personGroupUid, L_1)) {
          this.state_0 = 5;
          this.result_0 = this.local$$receiver.personGroupMemberDao.checkPersonBelongsToGroup_3pjtqy$(this.local$personGroupUid, this.local$enrolment.clazzEnrolmentPersonUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 8;
          continue;
        }
      case 5:
        var existingGroupMemberships = this.result_0;
        var $receiver_9 = this.local$$receiver.personGroupMemberDao;
        if ((tmp$_0 = existingGroupMemberships.isEmpty() ? $receiver_9 : null) != null) {
          var $receiver_10 = new PersonGroupMember();
          $receiver_10.groupMemberPersonUid = this.local$enrolment.clazzEnrolmentPersonUid;
          $receiver_10.groupMemberGroupUid = this.local$personGroupUid;
          this.state_0 = 6;
          this.result_0 = tmp$_0.insertAsync($receiver_10, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.result_0 = null;
          this.state_0 = 7;
          continue;
        }
      case 6:
        this.state_0 = 7;
        continue;
      case 7:
        this.state_0 = 8;
        continue;
      case 8:
        if (this.local$enrolment.clazzEnrolmentRole === 1000) {
          this.state_0 = 9;
          this.result_0 = onRepoWithFallbackToDb(this.local$$receiver, L2500, processEnrolmentIntoClass$lambda(this.local$enrolment), this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.local$tmp$_1 = emptyList();
          this.state_0 = 10;
          continue;
        }
      case 9:
        this.local$tmp$_1 = this.result_0;
        this.state_0 = 10;
        continue;
      case 10:
        var parentsToEnrol = this.local$tmp$_1;
        this.local$tmp$_2 = parentsToEnrol.iterator();
        this.state_0 = 11;
        continue;
      case 11:
        if (!this.local$tmp$_2.hasNext()) {
          this.state_0 = 15;
          continue;
        }
        var element = this.local$tmp$_2.next();
        var tmp$_7;
        this.state_0 = 12;
        this.result_0 = onRepoWithFallbackToDb(this.local$$receiver, L2500, processEnrolmentIntoClass$lambda$lambda(element), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 12:
        if ((tmp$_7 = this.result_0) != null) {
          this.state_0 = 13;
          this.result_0 = enrolPersonIntoClazzAtLocalTimezone(this.local$$receiver, tmp$_7, this.local$enrolment.clazzEnrolmentClazzUid, 1003, this.local$clazzWithSchoolVal, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 14;
          continue;
        }
      case 13:
        this.state_0 = 14;
        continue;
      case 14:
        this.state_0 = 11;
        continue;
      case 15:
        return this.local$enrolment;
      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 processEnrolmentIntoClass($receiver_0, enrolment_0, clazzWithSchool_0, continuation_0, suspended) {
    var instance = new Coroutine$processEnrolmentIntoClass($receiver_0, enrolment_0, clazzWithSchool_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function Coroutine$enrolPersonIntoSchoolAtLocalTimezone($receiver_0, personToEnrol_0, schoolUid_0, role_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$schoolVal = void 0;
    this.local$$receiver_0 = void 0;
    this.local$schoolMember = void 0;
    this.local$$receiver = $receiver_0;
    this.local$personToEnrol = personToEnrol_0;
    this.local$schoolUid = schoolUid_0;
    this.local$role = role_0;
  }
  Coroutine$enrolPersonIntoSchoolAtLocalTimezone.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$enrolPersonIntoSchoolAtLocalTimezone.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$enrolPersonIntoSchoolAtLocalTimezone.prototype.constructor = Coroutine$enrolPersonIntoSchoolAtLocalTimezone;
  Coroutine$enrolPersonIntoSchoolAtLocalTimezone.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1;
        this.state_0 = 2;
        this.result_0 = this.local$$receiver.schoolDao.findByUidAsync_s8cxhz$(this.local$schoolUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        tmp$ = this.result_0;
        if (tmp$ == null) {
          throw IllegalArgumentException_init('School does not exist');
        }
        this.local$schoolVal = tmp$;
        this.state_0 = 3;
        this.result_0 = this.local$$receiver.schoolMemberDao.findBySchoolAndPersonAndRole_6qtc6d$(this.local$schoolUid, this.local$personToEnrol.personUid, 0, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var existingEnrolment = this.result_0;
        if (!existingEnrolment.isEmpty()) 
          throw new AlreadyEnroledInSchoolException(first(existingEnrolment));
        var schoolTimeZone = (tmp$_0 = this.local$schoolVal.schoolTimeZone) != null ? tmp$_0 : 'UTC';
        var $receiver = toOffsetByTimezone(DateTime.Companion.now(), schoolTimeZone);
        var $receiver_0 = $receiver.hours;
        var tmp$_2 = TimeSpan.Companion.fromHours_14dthe$($receiver_0);
        var $receiver_1 = $receiver.minutes;
        var tmp$_3 = tmp$_2.plus_fv8bff$(TimeSpan.Companion.fromMinutes_14dthe$($receiver_1));
        var $receiver_2 = $receiver.seconds;
        var tmp$_4 = tmp$_3.plus_fv8bff$(TimeSpan.Companion.fromSeconds_14dthe$($receiver_2));
        var $receiver_3 = $receiver.milliseconds;
        var joinTime = $receiver.minus_fv8bff$(tmp$_4.plus_fv8bff$(TimeSpan.Companion.fromMilliseconds_14dthe$($receiver_3))).utc.unixMillisLong;
        this.local$$receiver_0 = new SchoolMemberWithPerson();
        this.local$$receiver_0.schoolMemberPersonUid = this.local$personToEnrol.personUid;
        this.local$$receiver_0.schoolMemberSchoolUid = this.local$schoolUid;
        this.local$$receiver_0.schoolMemberRole = this.local$role;
        this.local$$receiver_0.schoolMemberActive = true;
        this.local$$receiver_0.schoolMemberJoinDate = joinTime;
        this.local$$receiver_0.person = this.local$personToEnrol;
        this.state_0 = 4;
        this.result_0 = this.local$$receiver.schoolMemberDao.insertAsync(this.local$$receiver_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.local$$receiver_0.schoolMemberUid = this.result_0;
        this.local$schoolMember = this.local$$receiver_0;
        switch (this.local$role) {
          case 1004:
            tmp$_1 = this.local$schoolVal.schoolTeachersPersonGroupUid;
            break;
          case 1003:
            tmp$_1 = this.local$schoolVal.schoolStudentsPersonGroupUid;
            break;
          case 1005:
            tmp$_1 = this.local$schoolVal.schoolPendingStudentsPersonGroupUid;
            break;
          default:
            tmp$_1 = null;
            break;
        }
        var personGroupUid = tmp$_1;
        if (personGroupUid != null) {
          var tmp$_5 = this.local$$receiver.personGroupMemberDao;
          var $receiver_4 = new PersonGroupMember();
          $receiver_4.groupMemberPersonUid = this.local$personToEnrol.personUid;
          $receiver_4.groupMemberGroupUid = personGroupUid;
          this.state_0 = 5;
          this.result_0 = tmp$_5.insertAsync($receiver_4, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 6;
          continue;
        }
      case 5:
        this.state_0 = 6;
        continue;
      case 6:
        return this.local$schoolMember;
      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 enrolPersonIntoSchoolAtLocalTimezone($receiver_0, personToEnrol_0, schoolUid_0, role_0, continuation_0, suspended) {
    var instance = new Coroutine$enrolPersonIntoSchoolAtLocalTimezone($receiver_0, personToEnrol_0, schoolUid_0, role_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function Coroutine$approvePendingClazzEnrolment($receiver_0, enrolment_0, clazzUid_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$$receiver = $receiver_0;
    this.local$enrolment = enrolment_0;
    this.local$clazzUid = clazzUid_0;
  }
  Coroutine$approvePendingClazzEnrolment.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$approvePendingClazzEnrolment.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$approvePendingClazzEnrolment.prototype.constructor = Coroutine$approvePendingClazzEnrolment;
  Coroutine$approvePendingClazzEnrolment.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.state_0 = 2;
        this.result_0 = this.local$$receiver.clazzDao.findByUidAsync_s8cxhz$(this.local$clazzUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        tmp$ = this.result_0;
        if (tmp$ == null) {
          throw IllegalStateException_init('Class does not exist');
        }
        var effectiveClazz = tmp$;
        this.state_0 = 3;
        this.result_0 = this.local$$receiver.personGroupMemberDao.moveGroupAsync_9xn71c$(this.local$enrolment.personUid, effectiveClazz.clazzStudentsPersonGroupUid, effectiveClazz.clazzPendingStudentsPersonGroupUid, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var numGroupUpdates = this.result_0;
        if (numGroupUpdates !== 1) {
          throw IllegalStateException_init("Approve pending clazz member - no membership of clazz's pending group!");
        }
        this.state_0 = 4;
        this.result_0 = this.local$$receiver.clazzEnrolmentDao.updateClazzEnrolmentRole_d2c2sj$(this.local$enrolment.personUid, this.local$clazzUid, 1000, 1002, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        var enrolmentUpdateCount = this.result_0;
        if (enrolmentUpdateCount !== 1) {
          throw IllegalStateException_init('Approve pending clazz member - no update of enrolment!');
        }
        return;
      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 approvePendingClazzEnrolment($receiver_0, enrolment_0, clazzUid_0, continuation_0, suspended) {
    var instance = new Coroutine$approvePendingClazzEnrolment($receiver_0, enrolment_0, clazzUid_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function Coroutine$declinePendingClazzEnrolment($receiver_0, enrolment_0, clazzUid_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$effectiveClazz = void 0;
    this.local$$receiver = $receiver_0;
    this.local$enrolment = enrolment_0;
    this.local$clazzUid = clazzUid_0;
  }
  Coroutine$declinePendingClazzEnrolment.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$declinePendingClazzEnrolment.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$declinePendingClazzEnrolment.prototype.constructor = Coroutine$declinePendingClazzEnrolment;
  Coroutine$declinePendingClazzEnrolment.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.state_0 = 2;
        this.result_0 = this.local$$receiver.clazzDao.findByUidAsync_s8cxhz$(this.local$clazzUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        tmp$ = this.result_0;
        if (tmp$ == null) {
          throw IllegalStateException_init('Class does not exist');
        }
        this.local$effectiveClazz = tmp$;
        this.state_0 = 3;
        this.result_0 = this.local$$receiver.clazzEnrolmentDao.updateClazzEnrolmentActiveForPersonAndClazz_mpc0bo$(this.local$enrolment.personUid, this.local$clazzUid, 1002, false, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.state_0 = 4;
        this.result_0 = this.local$$receiver.personGroupMemberDao.updateGroupMemberActive_u4hhv2$(false, this.local$enrolment.personUid, this.local$effectiveClazz.clazzPendingStudentsPersonGroupUid, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        return;
      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 declinePendingClazzEnrolment($receiver_0, enrolment_0, clazzUid_0, continuation_0, suspended) {
    var instance = new Coroutine$declinePendingClazzEnrolment($receiver_0, enrolment_0, clazzUid_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function Coroutine$approvePendingSchoolMember($receiver_0, member_0, school_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$effectiveClazz = void 0;
    this.local$$receiver = $receiver_0;
    this.local$member = member_0;
    this.local$school = school_0;
  }
  Coroutine$approvePendingSchoolMember.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$approvePendingSchoolMember.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$approvePendingSchoolMember.prototype.constructor = Coroutine$approvePendingSchoolMember;
  Coroutine$approvePendingSchoolMember.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$school === void 0) 
          this.local$school = null;
        if (this.local$school == null) {
          this.state_0 = 2;
          this.result_0 = this.local$$receiver.schoolDao.findByUidAsync_s8cxhz$(this.local$member.schoolMemberSchoolUid, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 1:
        throw this.exception_0;
      case 2:
        this.local$school = this.result_0;
        this.state_0 = 3;
        continue;
      case 3:
        if (this.local$school == null) {
          throw IllegalStateException_init('Class does not exist');
        }
        this.local$effectiveClazz = this.local$school;
        this.local$member.schoolMemberRole = 1003;
        this.state_0 = 4;
        this.result_0 = this.local$$receiver.schoolMemberDao.updateAsync_nzwwdw$(this.local$member, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.state_0 = 5;
        this.result_0 = this.local$$receiver.personGroupMemberDao.moveGroupAsync_9xn71c$(this.local$member.schoolMemberPersonUid, this.local$effectiveClazz.schoolStudentsPersonGroupUid, this.local$effectiveClazz.schoolPendingStudentsPersonGroupUid, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        var numGroupUpdates = this.result_0;
        if (numGroupUpdates !== 1) {
          println('No group update?');
        }
        return;
      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 approvePendingSchoolMember($receiver_0, member_0, school_0, continuation_0, suspended) {
    var instance = new Coroutine$approvePendingSchoolMember($receiver_0, member_0, school_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function Coroutine$insertPersonAndGroup($receiver_0, entity_0, groupFlag_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$groupPerson = void 0;
    this.local$$receiver = $receiver_0;
    this.local$entity = entity_0;
    this.local$groupFlag = groupFlag_0;
  }
  Coroutine$insertPersonAndGroup.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$insertPersonAndGroup.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$insertPersonAndGroup.prototype.constructor = Coroutine$insertPersonAndGroup;
  Coroutine$insertPersonAndGroup.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$groupFlag === void 0) 
          this.local$groupFlag = 1;
        var $receiver = new PersonGroup();
        $receiver.groupName = 'Person individual group';
        $receiver.personGroupFlag = this.local$groupFlag;
        this.local$groupPerson = $receiver;
        this.state_0 = 2;
        this.result_0 = this.local$$receiver.personGroupDao.insertAsync(this.local$groupPerson, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$groupPerson.groupUid = this.result_0;
        this.local$entity.personGroupUid = this.local$groupPerson.groupUid;
        this.state_0 = 3;
        this.result_0 = this.local$$receiver.personDao.insertAsync(this.local$entity, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$entity.personUid = this.result_0;
        this.state_0 = 4;
        this.result_0 = this.local$$receiver.personGroupMemberDao.insertAsync(PersonGroupMember_init(this.local$entity.personUid, this.local$entity.personGroupUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.state_0 = 5;
        this.result_0 = grantScopedPermission_0(this.local$$receiver, this.local$entity, Long$Companion$MAX_VALUE, 9, this.local$entity.personUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        return this.local$entity;
      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 insertPersonAndGroup($receiver_0, entity_0, groupFlag_0, continuation_0, suspended) {
    var instance = new Coroutine$insertPersonAndGroup($receiver_0, entity_0, groupFlag_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function insertPersonOnlyAndGroup($receiver, entity) {
    var $receiver_0 = new PersonGroup();
    $receiver_0.groupName = 'Person individual group';
    $receiver_0.personGroupFlag = 1;
    var groupPerson = $receiver_0;
    groupPerson.groupUid = $receiver.personGroupDao.insert_11rb$(groupPerson);
    entity.personGroupUid = groupPerson.groupUid;
    entity.personUid = $receiver.personDao.insert_11rb$(entity);
    $receiver.personGroupMemberDao.insert_11rb$(PersonGroupMember_init(entity.personUid, entity.personGroupUid));
    return entity;
  }
  function Coroutine$generateChartData($receiver_0, report_0, context_0, impl_0, loggedInPersonUid_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$tmp$ = void 0;
    this.local$seriesDataList = void 0;
    this.local$yAxisValueFormatter = void 0;
    this.local$xAxisList = void 0;
    this.local$tmp$_0 = void 0;
    this.local$element = void 0;
    this.local$tmp$_1 = void 0;
    this.local$reportList = void 0;
    this.local$series = void 0;
    this.local$$receiver = $receiver_0;
    this.local$report = report_0;
    this.local$context = context_0;
    this.local$impl = impl_0;
    this.local$loggedInPersonUid = loggedInPersonUid_0;
  }
  Coroutine$generateChartData.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$generateChartData.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$generateChartData.prototype.constructor = Coroutine$generateChartData;
  Coroutine$generateChartData.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var queries = generateSql(this.local$report, this.local$loggedInPersonUid, dbType(this.local$$receiver));
        this.local$seriesDataList = ArrayList_init();
        this.local$yAxisValueFormatter = {
  v: null};
        this.local$xAxisList = LinkedHashSet_init();
        this.local$tmp$_0 = queries.entries.iterator();
        this.state_0 = 2;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (!this.local$tmp$_0.hasNext()) {
          this.state_0 = 8;
          continue;
        }
        this.local$element = this.local$tmp$_0.next();
        this.state_0 = 3;
        this.result_0 = this.local$$receiver.statementDao.getResults_pjwf99$(this.local$element.value.sqlStr, this.local$element.value.queryParams, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$reportList = this.result_0;
        this.local$series = this.local$element.key;
        var destination = ArrayList_init();
        var tmp$;
        tmp$ = this.local$reportList.iterator();
        while (tmp$.hasNext()) {
          var element = tmp$.next();
          var tmp$_0;
          if ((tmp$_0 = element.xAxis) != null) {
            destination.add_11rb$(tmp$_0);
          }
        }
        this.local$xAxisList.addAll_brywnq$(toSet(destination));
        if (this.local$series.reportSeriesYAxis === 201 || this.local$series.reportSeriesYAxis === 200) {
          this.local$yAxisValueFormatter.v = new TimeFormatter();
        }
        switch (this.local$series.reportSeriesSubGroup) {
          case 307:
            var destination_0 = ArrayList_init();
            var tmp$_1;
            tmp$_1 = this.local$reportList.iterator();
            while (tmp$_1.hasNext()) {
              var element_0 = tmp$_1.next();
              var tmp$_0_0;
              var tmp$_2;
              if ((tmp$_0_0 = (tmp$_2 = element_0.subgroup) != null ? toLong(tmp$_2) : null) != null) {
                destination_0.add_11rb$(tmp$_0_0);
              }
            }
            var listOfUids = toList(toSet(destination_0));
            this.state_0 = 6;
            this.result_0 = this.local$$receiver.clazzDao.getClassNamesFromListOfIds_gox9k8$(listOfUids, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          case 306:
            var $receiver = ReportFilterEditPresenter$Companion_getInstance().genderMap;
            var destination_1 = LinkedHashMap_init_0(mapCapacity($receiver.size));
            var tmp$_3;
            tmp$_3 = $receiver.entries.iterator();
            while (tmp$_3.hasNext()) {
              var element_1 = tmp$_3.next();
              destination_1.put_xwzc9p$(element_1.key.toString(), element_1.value);
            }
            this.local$tmp$_1 = new MessageIdFormatter(destination_1, this.local$impl, this.local$context);
            this.state_0 = 7;
            continue;
          case 304:
            var destination_2 = ArrayList_init();
            var tmp$_4;
            tmp$_4 = this.local$reportList.iterator();
            while (tmp$_4.hasNext()) {
              var element_2 = tmp$_4.next();
              var tmp$_0_1;
              var tmp$_5;
              if ((tmp$_0_1 = (tmp$_5 = element_2.subgroup) != null ? toLong(tmp$_5) : null) != null) {
                destination_2.add_11rb$(tmp$_0_1);
              }
            }
            var listOfUids_0 = toList(toSet(destination_2));
            this.state_0 = 5;
            this.result_0 = this.local$$receiver.contentEntryDao.getContentEntryFromUids_gox9k8$(listOfUids_0, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          case 309:
            var destination_3 = ArrayList_init();
            var tmp$_6;
            tmp$_6 = this.local$reportList.iterator();
            while (tmp$_6.hasNext()) {
              var element_3 = tmp$_6.next();
              var tmp$_0_2;
              var tmp$_7;
              if ((tmp$_0_2 = (tmp$_7 = element_3.subgroup) != null ? toLong(tmp$_7) : null) != null) {
                destination_3.add_11rb$(tmp$_0_2);
              }
            }
            var listOfUids_1 = toList(toSet(destination_3));
            this.state_0 = 4;
            this.result_0 = this.local$$receiver.leavingReasonDao.getReasonsFromUids(listOfUids_1, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          case 308:
            var $receiver_0 = OUTCOME_TO_MESSAGE_ID_MAP;
            var destination_4 = LinkedHashMap_init_0(mapCapacity($receiver_0.size));
            var tmp$_8;
            tmp$_8 = $receiver_0.entries.iterator();
            while (tmp$_8.hasNext()) {
              var element_4 = tmp$_8.next();
              destination_4.put_xwzc9p$(element_4.key.toString(), element_4.value);
            }
            this.local$tmp$_1 = new MessageIdFormatter(destination_4, this.local$impl, this.local$context);
            this.state_0 = 7;
            continue;
          default:
            this.local$tmp$_1 = null;
            this.state_0 = 7;
            continue;
        }
      case 4:
        var $receiver_1 = this.result_0;
        var destination_5 = ArrayList_init_0(collectionSizeOrDefault($receiver_1, 10));
        var tmp$_9;
        tmp$_9 = $receiver_1.iterator();
        while (tmp$_9.hasNext()) {
          var item = tmp$_9.next();
          destination_5.add_11rb$(to(item.uid, item.labelName));
        }
        var reasonLabelList = toMap_0(destination_5);
        this.local$tmp$_1 = new UidAndLabelFormatter(reasonLabelList);
        this.state_0 = 7;
        continue;
      case 5:
        var $receiver_2 = this.result_0;
        var destination_6 = ArrayList_init_0(collectionSizeOrDefault($receiver_2, 10));
        var tmp$_10;
        tmp$_10 = $receiver_2.iterator();
        while (tmp$_10.hasNext()) {
          var item_0 = tmp$_10.next();
          destination_6.add_11rb$(to(item_0.uid, item_0.labelName));
        }
        var entryLabelList = toMap_0(destination_6);
        this.local$tmp$_1 = new UidAndLabelFormatter(entryLabelList);
        this.state_0 = 7;
        continue;
      case 6:
        var $receiver_3 = this.result_0;
        var destination_7 = ArrayList_init_0(collectionSizeOrDefault($receiver_3, 10));
        var tmp$_11;
        tmp$_11 = $receiver_3.iterator();
        while (tmp$_11.hasNext()) {
          var item_1 = tmp$_11.next();
          destination_7.add_11rb$(to(item_1.uid, item_1.labelName));
        }
        var clazzLabelList = toMap_0(destination_7);
        this.local$tmp$_1 = new UidAndLabelFormatter(clazzLabelList);
        this.state_0 = 7;
        continue;
      case 7:
        var subGroupFormatter = this.local$tmp$_1;
        this.local$seriesDataList.add_11rb$(new SeriesData(this.local$reportList, subGroupFormatter, this.local$series));
        this.state_0 = 2;
        continue;
      case 8:
        switch (this.local$report.xAxis) {
          case 307:
            var tmp$_12 = this.local$$receiver.clazzDao;
            var destination_8 = ArrayList_init_0(collectionSizeOrDefault(this.local$xAxisList, 10));
            var tmp$_13;
            tmp$_13 = this.local$xAxisList.iterator();
            while (tmp$_13.hasNext()) {
              var item_2 = tmp$_13.next();
              destination_8.add_11rb$(toLong(item_2));
            }
            this.state_0 = 11;
            this.result_0 = tmp$_12.getClassNamesFromListOfIds_gox9k8$(destination_8, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          case 306:
            var $receiver_4 = ReportFilterEditPresenter$Companion_getInstance().genderMap;
            var destination_9 = LinkedHashMap_init_0(mapCapacity($receiver_4.size));
            var tmp$_14;
            tmp$_14 = $receiver_4.entries.iterator();
            while (tmp$_14.hasNext()) {
              var element_5 = tmp$_14.next();
              destination_9.put_xwzc9p$(element_5.key.toString(), element_5.value);
            }
            this.local$tmp$ = new MessageIdFormatter(destination_9, this.local$impl, this.local$context);
            this.state_0 = 12;
            continue;
          case 304:
            var tmp$_15 = this.local$$receiver.contentEntryDao;
            var destination_10 = ArrayList_init_0(collectionSizeOrDefault(this.local$xAxisList, 10));
            var tmp$_16;
            tmp$_16 = this.local$xAxisList.iterator();
            while (tmp$_16.hasNext()) {
              var item_3 = tmp$_16.next();
              destination_10.add_11rb$(toLong(item_3));
            }
            this.state_0 = 10;
            this.result_0 = tmp$_15.getContentEntryFromUids_gox9k8$(destination_10, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          case 308:
            var $receiver_5 = OUTCOME_TO_MESSAGE_ID_MAP;
            var destination_11 = LinkedHashMap_init_0(mapCapacity($receiver_5.size));
            var tmp$_17;
            tmp$_17 = $receiver_5.entries.iterator();
            while (tmp$_17.hasNext()) {
              var element_6 = tmp$_17.next();
              destination_11.put_xwzc9p$(element_6.key.toString(), element_6.value);
            }
            this.local$tmp$ = new MessageIdFormatter(destination_11, this.local$impl, this.local$context);
            this.state_0 = 12;
            continue;
          case 309:
            var tmp$_18 = this.local$$receiver.leavingReasonDao;
            var destination_12 = ArrayList_init_0(collectionSizeOrDefault(this.local$xAxisList, 10));
            var tmp$_19;
            tmp$_19 = this.local$xAxisList.iterator();
            while (tmp$_19.hasNext()) {
              var item_4 = tmp$_19.next();
              destination_12.add_11rb$(toLong(item_4));
            }
            this.state_0 = 9;
            this.result_0 = tmp$_18.getReasonsFromUids(destination_12, this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          default:
            this.local$tmp$ = null;
            this.state_0 = 12;
            continue;
        }
      case 9:
        var $receiver_6 = this.result_0;
        var destination_13 = ArrayList_init_0(collectionSizeOrDefault($receiver_6, 10));
        var tmp$_20;
        tmp$_20 = $receiver_6.iterator();
        while (tmp$_20.hasNext()) {
          var item_5 = tmp$_20.next();
          destination_13.add_11rb$(to(item_5.uid, item_5.labelName));
        }
        var reasonLabelList_0 = plus_2(toMap_0(destination_13), to(L0, this.local$impl.getString(2051, this.local$context)));
        this.local$tmp$ = new UidAndLabelFormatter(reasonLabelList_0);
        this.state_0 = 12;
        continue;
      case 10:
        var $receiver_7 = this.result_0;
        var destination_14 = ArrayList_init_0(collectionSizeOrDefault($receiver_7, 10));
        var tmp$_21;
        tmp$_21 = $receiver_7.iterator();
        while (tmp$_21.hasNext()) {
          var item_6 = tmp$_21.next();
          destination_14.add_11rb$(to(item_6.uid, item_6.labelName));
        }
        var entryLabelList_0 = toMap_0(destination_14);
        this.local$tmp$ = new UidAndLabelFormatter(entryLabelList_0);
        this.state_0 = 12;
        continue;
      case 11:
        var $receiver_8 = this.result_0;
        var destination_15 = ArrayList_init_0(collectionSizeOrDefault($receiver_8, 10));
        var tmp$_22;
        tmp$_22 = $receiver_8.iterator();
        while (tmp$_22.hasNext()) {
          var item_7 = tmp$_22.next();
          destination_15.add_11rb$(to(item_7.uid, item_7.labelName));
        }
        var clazzLabelList_0 = toMap_0(destination_15);
        this.local$tmp$ = new UidAndLabelFormatter(clazzLabelList_0);
        this.state_0 = 12;
        continue;
      case 12:
        var xAxisFormatter = this.local$tmp$;
        return new ChartData(toList(this.local$seriesDataList), this.local$report, this.local$yAxisValueFormatter.v, xAxisFormatter);
      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 generateChartData($receiver_0, report_0, context_0, impl_0, loggedInPersonUid_0, continuation_0, suspended) {
    var instance = new Coroutine$generateChartData($receiver_0, report_0, context_0, impl_0, loggedInPersonUid_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function generateStatementList($receiver, report, loggedInPersonUid) {
    var queries = generateSql(report, loggedInPersonUid, dbType($receiver));
    var statementDataSourceList = ArrayList_init();
    var tmp$;
    tmp$ = queries.entries.iterator();
    while (tmp$.hasNext()) {
      var element = tmp$.next();
      statementDataSourceList.add_11rb$($receiver.statementDao.getListResults_j49vja$(new SimpleDoorQuery(element.value.sqlListStr, element.value.queryParams)));
    }
    return toList(statementDataSourceList);
  }
  function ChartData(seriesData, reportWithFilters, yAxisValueFormatter, xAxisValueFormatter) {
    this.seriesData = seriesData;
    this.reportWithFilters = reportWithFilters;
    this.yAxisValueFormatter = yAxisValueFormatter;
    this.xAxisValueFormatter = xAxisValueFormatter;
  }
  ChartData.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ChartData', 
  interfaces: []};
  ChartData.prototype.component1 = function() {
  return this.seriesData;
};
  ChartData.prototype.component2 = function() {
  return this.reportWithFilters;
};
  ChartData.prototype.component3 = function() {
  return this.yAxisValueFormatter;
};
  ChartData.prototype.component4 = function() {
  return this.xAxisValueFormatter;
};
  ChartData.prototype.copy_n90rta$ = function(seriesData, reportWithFilters, yAxisValueFormatter, xAxisValueFormatter) {
  return new ChartData(seriesData === void 0 ? this.seriesData : seriesData, reportWithFilters === void 0 ? this.reportWithFilters : reportWithFilters, yAxisValueFormatter === void 0 ? this.yAxisValueFormatter : yAxisValueFormatter, xAxisValueFormatter === void 0 ? this.xAxisValueFormatter : xAxisValueFormatter);
};
  ChartData.prototype.toString = function() {
  return 'ChartData(seriesData=' + Kotlin.toString(this.seriesData) + (', reportWithFilters=' + Kotlin.toString(this.reportWithFilters)) + (', yAxisValueFormatter=' + Kotlin.toString(this.yAxisValueFormatter)) + (', xAxisValueFormatter=' + Kotlin.toString(this.xAxisValueFormatter)) + ')';
};
  ChartData.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.seriesData) | 0;
  result = result * 31 + Kotlin.hashCode(this.reportWithFilters) | 0;
  result = result * 31 + Kotlin.hashCode(this.yAxisValueFormatter) | 0;
  result = result * 31 + Kotlin.hashCode(this.xAxisValueFormatter) | 0;
  return result;
};
  ChartData.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.seriesData, other.seriesData) && Kotlin.equals(this.reportWithFilters, other.reportWithFilters) && Kotlin.equals(this.yAxisValueFormatter, other.yAxisValueFormatter) && Kotlin.equals(this.xAxisValueFormatter, other.xAxisValueFormatter)))));
};
  function SeriesData(dataList, subGroupFormatter, series) {
    this.dataList = dataList;
    this.subGroupFormatter = subGroupFormatter;
    this.series = series;
  }
  SeriesData.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SeriesData', 
  interfaces: []};
  SeriesData.prototype.component1 = function() {
  return this.dataList;
};
  SeriesData.prototype.component2 = function() {
  return this.subGroupFormatter;
};
  SeriesData.prototype.component3 = function() {
  return this.series;
};
  SeriesData.prototype.copy_24ij0n$ = function(dataList, subGroupFormatter, series) {
  return new SeriesData(dataList === void 0 ? this.dataList : dataList, subGroupFormatter === void 0 ? this.subGroupFormatter : subGroupFormatter, series === void 0 ? this.series : series);
};
  SeriesData.prototype.toString = function() {
  return 'SeriesData(dataList=' + Kotlin.toString(this.dataList) + (', subGroupFormatter=' + Kotlin.toString(this.subGroupFormatter)) + (', series=' + Kotlin.toString(this.series)) + ')';
};
  SeriesData.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.dataList) | 0;
  result = result * 31 + Kotlin.hashCode(this.subGroupFormatter) | 0;
  result = result * 31 + Kotlin.hashCode(this.series) | 0;
  return result;
};
  SeriesData.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.dataList, other.dataList) && Kotlin.equals(this.subGroupFormatter, other.subGroupFormatter) && Kotlin.equals(this.series, other.series)))));
};
  function Coroutine$createNewSchoolAndGroups($receiver_0, school_0, impl_0, context_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$$receiver = $receiver_0;
    this.local$school = school_0;
    this.local$impl = impl_0;
    this.local$context = context_0;
  }
  Coroutine$createNewSchoolAndGroups.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$createNewSchoolAndGroups.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$createNewSchoolAndGroups.prototype.constructor = Coroutine$createNewSchoolAndGroups;
  Coroutine$createNewSchoolAndGroups.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$;
        this.state_0 = 2;
        this.result_0 = this.local$$receiver.personGroupDao.insertAsync(PersonGroup_init(toString(this.local$school.schoolName) + ' - ' + this.local$impl.getString(2403, this.local$context)), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.local$school.schoolTeachersPersonGroupUid = this.result_0;
        this.state_0 = 3;
        this.result_0 = this.local$$receiver.personGroupDao.insertAsync(PersonGroup_init(toString(this.local$school.schoolName) + ' - ' + this.local$impl.getString(2075, this.local$context)), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$school.schoolStudentsPersonGroupUid = this.result_0;
        this.state_0 = 4;
        this.result_0 = this.local$$receiver.personGroupDao.insertAsync(PersonGroup_init(toString(this.local$school.schoolName) + ' - ' + this.local$impl.getString(2652, this.local$context)), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.local$school.schoolPendingStudentsPersonGroupUid = this.result_0;
                (tmp$ = this.local$school.schoolCode == null ? this.local$school : null) != null ? (tmp$.schoolCode = randomString(6)) : null;
        this.state_0 = 5;
        this.result_0 = this.local$$receiver.schoolDao.insertAsync(this.local$school, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        this.local$school.schoolUid = this.result_0;
        return this.local$school.schoolUid;
      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 createNewSchoolAndGroups($receiver_0, school_0, impl_0, context_0, continuation_0, suspended) {
    var instance = new Coroutine$createNewSchoolAndGroups($receiver_0, school_0, impl_0, context_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function Coroutine$enrollPersonToSchool($receiver_0, schoolUid_0, personUid_0, role_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$school = void 0;
    this.local$$receiver_0 = void 0;
    this.local$schoolMember = void 0;
    this.local$$receiver = $receiver_0;
    this.local$schoolUid = schoolUid_0;
    this.local$personUid = personUid_0;
    this.local$role = role_0;
  }
  Coroutine$enrollPersonToSchool.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$enrollPersonToSchool.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$enrollPersonToSchool.prototype.constructor = Coroutine$enrollPersonToSchool;
  Coroutine$enrollPersonToSchool.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0;
        this.state_0 = 2;
        this.result_0 = this.local$$receiver.schoolDao.findByUidAsync_s8cxhz$(this.local$schoolUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        tmp$ = this.result_0;
        if (tmp$ == null) {
          throw IllegalArgumentException_init('School does not exist');
        }
        this.local$school = tmp$;
        this.state_0 = 3;
        this.result_0 = this.local$$receiver.schoolMemberDao.findBySchoolAndPersonAndRole_6qtc6d$(this.local$schoolUid, this.local$personUid, this.local$role, void 0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var matches = this.result_0;
        if (matches.isEmpty()) {
          this.local$$receiver_0 = SchoolMember_init();
          this.local$$receiver_0.schoolMemberActive = true;
          this.local$$receiver_0.schoolMemberPersonUid = this.local$personUid;
          this.local$$receiver_0.schoolMemberSchoolUid = this.local$schoolUid;
          this.local$$receiver_0.schoolMemberRole = this.local$role;
          this.local$$receiver_0.schoolMemberJoinDate = systemTimeInMillis();
          this.state_0 = 4;
          this.result_0 = this.local$$receiver.schoolMemberDao.insertAsync(this.local$$receiver_0, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          return matches.get_za3lpa$(0);
        }
      case 4:
        this.local$$receiver_0.schoolMemberUid = this.result_0;
        this.local$schoolMember = this.local$$receiver_0;
        switch (this.local$role) {
          case 1004:
            tmp$_0 = this.local$school.schoolTeachersPersonGroupUid;
            break;
          case 1003:
            tmp$_0 = this.local$school.schoolStudentsPersonGroupUid;
            break;
          case 1005:
            tmp$_0 = this.local$school.schoolPendingStudentsPersonGroupUid;
            break;
          default:
            tmp$_0 = null;
            break;
        }
        var personGroupUid = tmp$_0;
        if (personGroupUid != null) {
          var tmp$_1 = this.local$$receiver.personGroupMemberDao;
          var $receiver = new PersonGroupMember();
          $receiver.groupMemberPersonUid = this.local$schoolMember.schoolMemberPersonUid;
          $receiver.groupMemberGroupUid = personGroupUid;
          this.state_0 = 5;
          this.result_0 = tmp$_1.insertAsync($receiver, this);
          if (this.result_0 === COROUTINE_SUSPENDED) 
            return COROUTINE_SUSPENDED;
          continue;
        } else {
          this.state_0 = 6;
          continue;
        }
      case 5:
        this.state_0 = 6;
        continue;
      case 6:
        return this.local$schoolMember;
      case 7:
        return;
      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 enrollPersonToSchool($receiver_0, schoolUid_0, personUid_0, role_0, continuation_0, suspended) {
    var instance = new Coroutine$enrollPersonToSchool($receiver_0, schoolUid_0, personUid_0, role_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function get_maxQueryParamListSize($receiver) {
    return dbType($receiver) === 1 ? 99 : -1;
  }
  function ContainerEntryWithMd5Partition(entriesWithMatchingFile, entriesWithoutMatchingFile) {
    this.entriesWithMatchingFile = entriesWithMatchingFile;
    this.entriesWithoutMatchingFile = entriesWithoutMatchingFile;
  }
  ContainerEntryWithMd5Partition.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContainerEntryWithMd5Partition', 
  interfaces: []};
  ContainerEntryWithMd5Partition.prototype.component1 = function() {
  return this.entriesWithMatchingFile;
};
  ContainerEntryWithMd5Partition.prototype.component2 = function() {
  return this.entriesWithoutMatchingFile;
};
  ContainerEntryWithMd5Partition.prototype.copy_lzost7$ = function(entriesWithMatchingFile, entriesWithoutMatchingFile) {
  return new ContainerEntryWithMd5Partition(entriesWithMatchingFile === void 0 ? this.entriesWithMatchingFile : entriesWithMatchingFile, entriesWithoutMatchingFile === void 0 ? this.entriesWithoutMatchingFile : entriesWithoutMatchingFile);
};
  ContainerEntryWithMd5Partition.prototype.toString = function() {
  return 'ContainerEntryWithMd5Partition(entriesWithMatchingFile=' + Kotlin.toString(this.entriesWithMatchingFile) + (', entriesWithoutMatchingFile=' + Kotlin.toString(this.entriesWithoutMatchingFile)) + ')';
};
  ContainerEntryWithMd5Partition.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.entriesWithMatchingFile) | 0;
  result = result * 31 + Kotlin.hashCode(this.entriesWithoutMatchingFile) | 0;
  return result;
};
  ContainerEntryWithMd5Partition.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.entriesWithMatchingFile, other.entriesWithMatchingFile) && Kotlin.equals(this.entriesWithoutMatchingFile, other.entriesWithoutMatchingFile)))));
};
  function ContainerEntryPartition(entriesWithMatchingFile, entriesWithoutMatchingFile, existingFiles) {
    this.entriesWithMatchingFile = entriesWithMatchingFile;
    this.entriesWithoutMatchingFile = entriesWithoutMatchingFile;
    this.existingFiles = existingFiles;
  }
  ContainerEntryPartition.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContainerEntryPartition', 
  interfaces: []};
  ContainerEntryPartition.prototype.component1 = function() {
  return this.entriesWithMatchingFile;
};
  ContainerEntryPartition.prototype.component2 = function() {
  return this.entriesWithoutMatchingFile;
};
  ContainerEntryPartition.prototype.component3 = function() {
  return this.existingFiles;
};
  ContainerEntryPartition.prototype.copy_imbagg$ = function(entriesWithMatchingFile, entriesWithoutMatchingFile, existingFiles) {
  return new ContainerEntryPartition(entriesWithMatchingFile === void 0 ? this.entriesWithMatchingFile : entriesWithMatchingFile, entriesWithoutMatchingFile === void 0 ? this.entriesWithoutMatchingFile : entriesWithoutMatchingFile, existingFiles === void 0 ? this.existingFiles : existingFiles);
};
  ContainerEntryPartition.prototype.toString = function() {
  return 'ContainerEntryPartition(entriesWithMatchingFile=' + Kotlin.toString(this.entriesWithMatchingFile) + (', entriesWithoutMatchingFile=' + Kotlin.toString(this.entriesWithoutMatchingFile)) + (', existingFiles=' + Kotlin.toString(this.existingFiles)) + ')';
};
  ContainerEntryPartition.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.entriesWithMatchingFile) | 0;
  result = result * 31 + Kotlin.hashCode(this.entriesWithoutMatchingFile) | 0;
  result = result * 31 + Kotlin.hashCode(this.existingFiles) | 0;
  return result;
};
  ContainerEntryPartition.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.entriesWithMatchingFile, other.entriesWithMatchingFile) && Kotlin.equals(this.entriesWithoutMatchingFile, other.entriesWithoutMatchingFile) && Kotlin.equals(this.existingFiles, other.existingFiles)))));
};
  function Coroutine$partitionContainerEntriesWithMd5($receiver_0, containerEntryFiles_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$$receiver = $receiver_0;
    this.local$containerEntryFiles = containerEntryFiles_0;
  }
  Coroutine$partitionContainerEntriesWithMd5.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$partitionContainerEntriesWithMd5.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$partitionContainerEntriesWithMd5.prototype.constructor = Coroutine$partitionContainerEntriesWithMd5;
  Coroutine$partitionContainerEntriesWithMd5.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$ = this.local$$receiver.containerEntryFileDao;
        var destination = ArrayList_init();
        var tmp$_0;
        tmp$_0 = this.local$containerEntryFiles.iterator();
        while (tmp$_0.hasNext()) {
          var element = tmp$_0.next();
          var tmp$_0_0;
          if ((tmp$_0_0 = element.cefMd5) != null) {
            destination.add_11rb$(tmp$_0_0);
          }
        }
        this.state_0 = 2;
        this.result_0 = tmp$.findEntriesByMd5SumsSafeAsync_udy8vv$(destination, get_maxQueryParamListSize(this.local$$receiver), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var existingFiles = this.result_0;
        var destination_0 = ArrayList_init();
        var tmp$_1;
        tmp$_1 = existingFiles.iterator();
        while (tmp$_1.hasNext()) {
          var element_0 = tmp$_1.next();
          var tmp$_0_1;
          if ((tmp$_0_1 = element_0.cefMd5) != null) {
            destination_0.add_11rb$(tmp$_0_1);
          }
        }
        var existingMd5s = toSet(destination_0);
        var tmp$_2;
        var first = ArrayList_init();
        var second = ArrayList_init();
        tmp$_2 = this.local$containerEntryFiles.iterator();
        while (tmp$_2.hasNext()) {
          var element_1 = tmp$_2.next();
          if (contains_1(existingMd5s, element_1.cefMd5)) {
            first.add_11rb$(element_1);
          } else {
            second.add_11rb$(element_1);
          }
        }
        var tmp$_3 = new Pair(first, second);
        var entriesWithFile = tmp$_3.component1(), entriesNeedDownloaded = tmp$_3.component2();
        return new ContainerEntryPartition(entriesWithFile, entriesNeedDownloaded, existingFiles);
      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 partitionContainerEntriesWithMd5($receiver_0, containerEntryFiles_0, continuation_0, suspended) {
    var instance = new Coroutine$partitionContainerEntriesWithMd5($receiver_0, containerEntryFiles_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function Coroutine$linkExistingContainerEntries($receiver_0, containerUid_0, containerEntryFiles_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$entriesWithFile = void 0;
    this.local$entriesNeedDownloaded = void 0;
    this.local$existingFiles = void 0;
    this.local$$receiver = $receiver_0;
    this.local$containerUid = containerUid_0;
    this.local$containerEntryFiles = containerEntryFiles_0;
  }
  Coroutine$linkExistingContainerEntries.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$linkExistingContainerEntries.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$linkExistingContainerEntries.prototype.constructor = Coroutine$linkExistingContainerEntries;
  Coroutine$linkExistingContainerEntries.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = partitionContainerEntriesWithMd5(this.local$$receiver, this.local$containerEntryFiles, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var tmp$ = this.result_0;
        this.local$entriesWithFile = tmp$.component1() , this.local$entriesNeedDownloaded = tmp$.component2() , this.local$existingFiles = tmp$.component3();
        this.state_0 = 3;
        this.result_0 = this.local$$receiver.containerEntryDao.findByContainerAsync_s8cxhz$(this.local$containerUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var alreadyLinkedEntries = this.result_0;
        var destination = ArrayList_init();
        var tmp$_0;
        tmp$_0 = this.local$entriesWithFile.iterator();
        loop_label:
          while (tmp$_0.hasNext()) {
            var element = tmp$_0.next();
            var any$result;
            any$break:
              do {
                var tmp$_1;
                if (Kotlin.isType(alreadyLinkedEntries, Collection) && alreadyLinkedEntries.isEmpty()) {
                  any$result = false;
                  break any$break;
                }
                tmp$_1 = alreadyLinkedEntries.iterator();
                while (tmp$_1.hasNext()) {
                  var element_0 = tmp$_1.next();
                  if (equals(element_0.cePath, element.cePath)) {
                    any$result = true;
                    break any$break;
                  }
                }
                any$result = false;
              } while (false);
            if (!any$result) 
              destination.add_11rb$(element);
          }
        var tmp$_2;
        tmp$_2 = destination.iterator();
        loop_label:
          while (tmp$_2.hasNext()) {
            var element_1 = tmp$_2.next();
            element_1.ceUid = L0;
            var first$result;
            first$break:
              do {
                var tmp$_3;
                tmp$_3 = this.local$existingFiles.iterator();
                while (tmp$_3.hasNext()) {
                  var element_2 = tmp$_3.next();
                  if (equals(element_2.cefMd5, element_1.cefMd5)) {
                    first$result = element_2;
                    break first$break;
                  }
                }
                throw new NoSuchElementException_init('Collection contains no element matching the predicate.');
              } while (false);
            element_1.ceCefUid = first$result.cefUid;
          }
        var entriesToLink = destination;
        this.state_0 = 4;
        this.result_0 = this.local$$receiver.containerEntryDao.insertListAsync_oe4mvo$(entriesToLink, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        var destination_0 = ArrayList_init_0(collectionSizeOrDefault(this.local$entriesWithFile, 10));
        var tmp$_4;
        tmp$_4 = this.local$entriesWithFile.iterator();
        loop_label:
          while (tmp$_4.hasNext()) {
            var item = tmp$_4.next();
            var tmp$_5 = destination_0.add_11rb$;
            var $receiver = new ContainerEntryWithContainerEntryFile();
            var tmp$_6, tmp$_7;
            var firstOrNull$result;
            firstOrNull$break:
              do {
                var tmp$_8;
                tmp$_8 = this.local$existingFiles.iterator();
                while (tmp$_8.hasNext()) {
                  var element_3 = tmp$_8.next();
                  if (equals(element_3.cefMd5, item.cefMd5)) {
                    firstOrNull$result = element_3;
                    break firstOrNull$break;
                  }
                }
                firstOrNull$result = null;
              } while (false);
            $receiver.containerEntryFile = firstOrNull$result;
            $receiver.ceUid = item.ceUid;
            $receiver.ceContainerUid = this.local$containerUid;
            $receiver.ceCefUid = (tmp$_7 = (tmp$_6 = $receiver.containerEntryFile) != null ? tmp$_6.cefUid : null) != null ? tmp$_7 : L0;
            $receiver.cePath = item.cePath;
            tmp$_5.call(destination_0, $receiver);
          }
        var entriesWithValRetList = destination_0;
        return new ContainerEntryWithMd5Partition(entriesWithValRetList, this.local$entriesNeedDownloaded);
      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 linkExistingContainerEntries($receiver_0, containerUid_0, containerEntryFiles_0, continuation_0, suspended) {
    var instance = new Coroutine$linkExistingContainerEntries($receiver_0, containerUid_0, containerEntryFiles_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function ScopedGrantResult(sgUid) {
    this.sgUid = sgUid;
  }
  ScopedGrantResult.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ScopedGrantResult', 
  interfaces: []};
  ScopedGrantResult.prototype.component1 = function() {
  return this.sgUid;
};
  ScopedGrantResult.prototype.copy_s8cxhz$ = function(sgUid) {
  return new ScopedGrantResult(sgUid === void 0 ? this.sgUid : sgUid);
};
  ScopedGrantResult.prototype.toString = function() {
  return 'ScopedGrantResult(sgUid=' + Kotlin.toString(this.sgUid) + ')';
};
  ScopedGrantResult.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.sgUid) | 0;
  return result;
};
  ScopedGrantResult.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && Kotlin.equals(this.sgUid, other.sgUid))));
};
  function Coroutine$grantScopedPermission($receiver_0, toGroupUid_0, permissions_0, scopeTableId_0, scopeEntityUid_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$$receiver = $receiver_0;
    this.local$toGroupUid = toGroupUid_0;
    this.local$permissions = permissions_0;
    this.local$scopeTableId = scopeTableId_0;
    this.local$scopeEntityUid = scopeEntityUid_0;
  }
  Coroutine$grantScopedPermission.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$grantScopedPermission.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$grantScopedPermission.prototype.constructor = Coroutine$grantScopedPermission;
  Coroutine$grantScopedPermission.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$ = this.local$$receiver.scopedGrantDao;
        var $receiver = new ScopedGrant();
        $receiver.sgGroupUid = this.local$toGroupUid;
        $receiver.sgPermissions = this.local$permissions;
        $receiver.sgTableId = this.local$scopeTableId;
        $receiver.sgEntityUid = this.local$scopeEntityUid;
        this.state_0 = 2;
        this.result_0 = tmp$.insertAsync_y0tj3a$($receiver, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var sgUid = this.result_0;
        return new ScopedGrantResult(sgUid);
      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 grantScopedPermission($receiver_0, toGroupUid_0, permissions_0, scopeTableId_0, scopeEntityUid_0, continuation_0, suspended) {
    var instance = new Coroutine$grantScopedPermission($receiver_0, toGroupUid_0, permissions_0, scopeTableId_0, scopeEntityUid_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function grantScopedPermission_0($receiver, toPerson, permissions, scopeTableId, scopeEntityUid, continuation) {
    return grantScopedPermission($receiver, toPerson.personGroupUid, permissions, scopeTableId, scopeEntityUid, continuation);
  }
  function Coroutine$insertPersonAuthCredentials2($receiver_0, personUid_0, password_0, pbkdf2Params_0, site_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$authSalt = void 0;
    this.local$$receiver = $receiver_0;
    this.local$personUid = personUid_0;
    this.local$password = password_0;
    this.local$pbkdf2Params = pbkdf2Params_0;
    this.local$site = site_0;
  }
  Coroutine$insertPersonAuthCredentials2.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$insertPersonAuthCredentials2.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$insertPersonAuthCredentials2.prototype.constructor = Coroutine$insertPersonAuthCredentials2;
  Coroutine$insertPersonAuthCredentials2.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$site === void 0) 
          this.local$site = null;
        var tmp$, tmp$_0, tmp$_1;
        var db = Kotlin.isType(tmp$_0 = (Kotlin.isType(tmp$ = this.local$$receiver, DoorDatabaseRepository) ? tmp$ : throwCCE()).db, UmAppDatabase) ? tmp$_0 : throwCCE();
        var effectiveSite = this.local$site != null ? this.local$site : db.siteDao.getSite();
        tmp$_1 = effectiveSite != null ? effectiveSite.authSalt : null;
        if (tmp$_1 == null) {
          throw IllegalStateException_init('insertAuthCredentials: No auth salt!');
        }
        this.local$authSalt = tmp$_1;
        this.state_0 = 2;
        this.result_0 = db.syncNodeDao.getLocalNodeClientId(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var lastChangedBy = this.result_0;
        var tmp$_2 = this.local$$receiver.personAuth2Dao;
        var $receiver = new PersonAuth2();
        $receiver.pauthUid = this.local$personUid;
        $receiver.pauthMechanism = PersonAuth2.Companion.AUTH_MECH_PBKDF2_DOUBLE;
        $receiver.pauthAuth = encodeBase64(doublePbkdf2Hash(this.local$password, this.local$authSalt, this.local$pbkdf2Params));
        $receiver.pauthLcb = lastChangedBy;
        this.state_0 = 3;
        this.result_0 = tmp$_2.insertAsync_j8byhd$($receiver, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        return;
      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 insertPersonAuthCredentials2($receiver_0, personUid_0, password_0, pbkdf2Params_0, site_0, continuation_0, suspended) {
    var instance = new Coroutine$insertPersonAuthCredentials2($receiver_0, personUid_0, password_0, pbkdf2Params_0, site_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function Coroutine$validateAndUpdateContainerSize$lambda(this$validateAndUpdateContainerSize_0, closure$containerUid_0, it_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$this$validateAndUpdateContainerSize = this$validateAndUpdateContainerSize_0;
    this.local$closure$containerUid = closure$containerUid_0;
  }
  Coroutine$validateAndUpdateContainerSize$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$validateAndUpdateContainerSize$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$validateAndUpdateContainerSize$lambda.prototype.constructor = Coroutine$validateAndUpdateContainerSize$lambda;
  Coroutine$validateAndUpdateContainerSize$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$this$validateAndUpdateContainerSize.containerDao.getContainerSizeByUid_s8cxhz$(this.local$closure$containerUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        var currentSize = this.result_0;
        if (!equals(currentSize, L0)) {
          return currentSize;
        } else {
          this.state_0 = 3;
          continue;
        }
      case 3:
        this.state_0 = 4;
        this.result_0 = this.local$this$validateAndUpdateContainerSize.containerDao.updateContainerSizeAndNumEntriesAsync_3pjtqy$(this.local$closure$containerUid, systemTimeInMillis(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        this.state_0 = 5;
        this.result_0 = this.local$this$validateAndUpdateContainerSize.containerDao.getContainerSizeByUid_s8cxhz$(this.local$closure$containerUid, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        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 validateAndUpdateContainerSize$lambda(this$validateAndUpdateContainerSize_0, closure$containerUid_0) {
    return function(it_0, continuation_0, suspended) {
  var instance = new Coroutine$validateAndUpdateContainerSize$lambda(this$validateAndUpdateContainerSize_0, closure$containerUid_0, it_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  function Coroutine$validateAndUpdateContainerSize($receiver_0, containerUid_0, attempts_0, waitInterval_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$containerSize = void 0;
    this.local$i = void 0;
    this.local$$receiver = $receiver_0;
    this.local$containerUid = containerUid_0;
    this.local$attempts = attempts_0;
    this.local$waitInterval = waitInterval_0;
  }
  Coroutine$validateAndUpdateContainerSize.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$validateAndUpdateContainerSize.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$validateAndUpdateContainerSize.prototype.constructor = Coroutine$validateAndUpdateContainerSize;
  Coroutine$validateAndUpdateContainerSize.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        if (this.local$attempts === void 0) 
          this.local$attempts = 3;
        if (this.local$waitInterval === void 0) 
          this.local$waitInterval = L200;
        this.local$containerSize = L0;
        this.local$i = 0;
        this.state_0 = 2;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        if (this.local$i >= this.local$attempts) {
          this.state_0 = 7;
          continue;
        }
        this.state_0 = 3;
        this.result_0 = withDoorTransactionAsync(this.local$$receiver, getKClass(UmAppDatabase), validateAndUpdateContainerSize$lambda(this.local$$receiver, this.local$containerUid), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.local$containerSize = this.result_0;
        if (!equals(this.local$containerSize, L0)) {
          return this.local$containerSize;
        } else {
          this.state_0 = 4;
          continue;
        }
      case 4:
        this.state_0 = 5;
        this.result_0 = delay(this.local$waitInterval, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        this.state_0 = 6;
        continue;
      case 6:
        this.local$i++;
        this.state_0 = 2;
        continue;
      case 7:
        return this.local$containerSize;
      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 validateAndUpdateContainerSize($receiver_0, containerUid_0, attempts_0, waitInterval_0, continuation_0, suspended) {
    var instance = new Coroutine$validateAndUpdateContainerSize($receiver_0, containerUid_0, attempts_0, waitInterval_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function withEndpoint($receiver, endpoint) {
    var tmp$, tmp$_0;
    tmp$ = $receiver.userSession;
    if (tmp$ == null) {
      throw IllegalArgumentException_init('session withendpoint : usersession must not be null');
    }
    tmp$_0 = $receiver.person;
    if (tmp$_0 == null) {
      throw IllegalArgumentException_init('session withendpoint: person msut not be null');
    }
    return new UserSessionWithPersonAndEndpoint(tmp$, tmp$_0, endpoint);
  }
  function getOrGenerateNodeIdAndAuth$lambda() {
    return Random.Default.nextLong_3pjtqy$(L0, Long$Companion$MAX_VALUE).toString();
  }
  function getOrGenerateNodeIdAndAuth$lambda_0() {
    return randomUuid().toString();
  }
  function getOrGenerateNodeIdAndAuth($receiver, contextPrefix, context) {
    var nodeId = $receiver.getOrPutAppPref_ymr649$(contextPrefix + '_nodeId', context, getOrGenerateNodeIdAndAuth$lambda);
    var nodeAuth = $receiver.getOrPutAppPref_ymr649$(contextPrefix + '_nodeAuth', context, getOrGenerateNodeIdAndAuth$lambda_0);
    return new NodeIdAndAuth(toLong(nodeId), nodeAuth);
  }
  function LabelValueFormatter() {
  }
  LabelValueFormatter.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'LabelValueFormatter', 
  interfaces: []};
  function MessageIdFormatter(map, systemImpl, context) {
    this.map = map;
    this.systemImpl = systemImpl;
    this.context = context;
  }
  MessageIdFormatter.prototype.format_za3rmp$ = function(option) {
  var tmp$, tmp$_0;
  return this.systemImpl.getString((tmp$_0 = this.map.get_11rb$(typeof (tmp$ = option) === 'string' ? tmp$ : throwCCE())) != null ? tmp$_0 : 2051, this.context);
};
  MessageIdFormatter.prototype.formatAsList_pqjuzw$ = function(option) {
  var destination = ArrayList_init_0(collectionSizeOrDefault(option, 10));
  var tmp$;
  tmp$ = option.iterator();
  while (tmp$.hasNext()) {
    var item = tmp$.next();
    destination.add_11rb$(this.format_za3rmp$(item));
  }
  return destination;
};
  MessageIdFormatter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'MessageIdFormatter', 
  interfaces: [LabelValueFormatter]};
  function TimeFormatter() {
  }
  TimeFormatter.prototype.format_za3rmp$ = function(option) {
  var tmp$;
  return ((typeof (tmp$ = option) === 'number' ? tmp$ : throwCCE()) / 3600000).toString();
};
  TimeFormatter.prototype.formatAsList_pqjuzw$ = function(option) {
  var destination = ArrayList_init_0(collectionSizeOrDefault(option, 10));
  var tmp$;
  tmp$ = option.iterator();
  while (tmp$.hasNext()) {
    var item = tmp$.next();
    destination.add_11rb$(this.format_za3rmp$(item));
  }
  return destination;
};
  TimeFormatter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'TimeFormatter', 
  interfaces: [LabelValueFormatter]};
  function UidAndLabelFormatter(uidMap) {
    this.uidMap = uidMap;
  }
  UidAndLabelFormatter.prototype.format_za3rmp$ = function(option) {
  var tmp$, tmp$_0;
  return (tmp$_0 = this.uidMap.get_11rb$(toLong(typeof (tmp$ = option) === 'string' ? tmp$ : throwCCE()))) != null ? tmp$_0 : 'label not found: ' + option.toString();
};
  UidAndLabelFormatter.prototype.formatAsList_pqjuzw$ = function(option) {
  var destination = ArrayList_init_0(collectionSizeOrDefault(option, 10));
  var tmp$;
  tmp$ = option.iterator();
  while (tmp$.hasNext()) {
    var item = tmp$.next();
    destination.add_11rb$(truncate(this.format_za3rmp$(item)));
  }
  return destination;
};
  UidAndLabelFormatter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UidAndLabelFormatter', 
  interfaces: [LabelValueFormatter]};
  function AboutView() {
    AboutView$Companion_getInstance();
  }
  function AboutView$Companion() {
    AboutView$Companion_instance = this;
    this.VIEW_NAME = 'About';
  }
  AboutView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var AboutView$Companion_instance = null;
  function AboutView$Companion_getInstance() {
    if (AboutView$Companion_instance === null) {
      new AboutView$Companion();
    }
    return AboutView$Companion_instance;
  }
  AboutView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'AboutView', 
  interfaces: [UstadView]};
  function AccountListView() {
    AccountListView$Companion_getInstance();
  }
  function AccountListView$Companion() {
    AccountListView$Companion_instance = this;
    this.VIEW_NAME = 'AccountListView';
    this.ARG_FILTER_BY_ENDPOINT = 'filterByEndpoint';
    this.ARG_ACTIVE_ACCOUNT_MODE = 'activeAccountMode';
    this.ACTIVE_ACCOUNT_MODE_HEADER = 'header';
    this.ACTIVE_ACCOUNT_MODE_INLIST = 'inlist';
  }
  AccountListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var AccountListView$Companion_instance = null;
  function AccountListView$Companion_getInstance() {
    if (AccountListView$Companion_instance === null) {
      new AccountListView$Companion();
    }
    return AccountListView$Companion_instance;
  }
  AccountListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'AccountListView', 
  interfaces: [UstadView]};
  function BitmaskEditView() {
    BitmaskEditView$Companion_getInstance();
  }
  function BitmaskEditView$Companion() {
    BitmaskEditView$Companion_instance = this;
    this.VIEW_NAME = 'BitmaskEditView';
  }
  BitmaskEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var BitmaskEditView$Companion_instance = null;
  function BitmaskEditView$Companion_getInstance() {
    if (BitmaskEditView$Companion_instance === null) {
      new BitmaskEditView$Companion();
    }
    return BitmaskEditView$Companion_instance;
  }
  BitmaskEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'BitmaskEditView', 
  interfaces: [UstadEditView]};
  function ChatDetailView() {
    ChatDetailView$Companion_getInstance();
  }
  function ChatDetailView$Companion() {
    ChatDetailView$Companion_instance = this;
    this.VIEW_NAME = 'ChatDetailView';
  }
  ChatDetailView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ChatDetailView$Companion_instance = null;
  function ChatDetailView$Companion_getInstance() {
    if (ChatDetailView$Companion_instance === null) {
      new ChatDetailView$Companion();
    }
    return ChatDetailView$Companion_instance;
  }
  ChatDetailView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ChatDetailView', 
  interfaces: [UstadDetailView]};
  function ChatListView() {
    ChatListView$Companion_getInstance();
  }
  function ChatListView$Companion() {
    ChatListView$Companion_instance = this;
    this.VIEW_NAME = 'ChatListView';
  }
  ChatListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ChatListView$Companion_instance = null;
  function ChatListView$Companion_getInstance() {
    if (ChatListView$Companion_instance === null) {
      new ChatListView$Companion();
    }
    return ChatListView$Companion_instance;
  }
  ChatListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ChatListView', 
  interfaces: [UstadListView]};
  function ClazzAssignmentDetailOverviewView() {
    ClazzAssignmentDetailOverviewView$Companion_getInstance();
  }
  function ClazzAssignmentDetailOverviewView$Companion() {
    ClazzAssignmentDetailOverviewView$Companion_instance = this;
    this.VIEW_NAME = 'CourseAssignmentDetailOverviewView';
  }
  ClazzAssignmentDetailOverviewView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzAssignmentDetailOverviewView$Companion_instance = null;
  function ClazzAssignmentDetailOverviewView$Companion_getInstance() {
    if (ClazzAssignmentDetailOverviewView$Companion_instance === null) {
      new ClazzAssignmentDetailOverviewView$Companion();
    }
    return ClazzAssignmentDetailOverviewView$Companion_instance;
  }
  ClazzAssignmentDetailOverviewView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzAssignmentDetailOverviewView', 
  interfaces: [UstadDetailView]};
  function ClazzAssignmentDetailStudentProgressOverviewListView() {
    ClazzAssignmentDetailStudentProgressOverviewListView$Companion_getInstance();
  }
  function ClazzAssignmentDetailStudentProgressOverviewListView$Companion() {
    ClazzAssignmentDetailStudentProgressOverviewListView$Companion_instance = this;
    this.VIEW_NAME = 'CourseAssignmentDetailStudentProgressOverviewListView';
  }
  ClazzAssignmentDetailStudentProgressOverviewListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzAssignmentDetailStudentProgressOverviewListView$Companion_instance = null;
  function ClazzAssignmentDetailStudentProgressOverviewListView$Companion_getInstance() {
    if (ClazzAssignmentDetailStudentProgressOverviewListView$Companion_instance === null) {
      new ClazzAssignmentDetailStudentProgressOverviewListView$Companion();
    }
    return ClazzAssignmentDetailStudentProgressOverviewListView$Companion_instance;
  }
  ClazzAssignmentDetailStudentProgressOverviewListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzAssignmentDetailStudentProgressOverviewListView', 
  interfaces: [UstadListView]};
  function ClazzAssignmentDetailStudentProgressView() {
    ClazzAssignmentDetailStudentProgressView$Companion_getInstance();
  }
  function ClazzAssignmentDetailStudentProgressView$Companion() {
    ClazzAssignmentDetailStudentProgressView$Companion_instance = this;
    this.VIEW_NAME = 'CourseAssignmentDetailStudentProgressListView';
  }
  ClazzAssignmentDetailStudentProgressView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzAssignmentDetailStudentProgressView$Companion_instance = null;
  function ClazzAssignmentDetailStudentProgressView$Companion_getInstance() {
    if (ClazzAssignmentDetailStudentProgressView$Companion_instance === null) {
      new ClazzAssignmentDetailStudentProgressView$Companion();
    }
    return ClazzAssignmentDetailStudentProgressView$Companion_instance;
  }
  ClazzAssignmentDetailStudentProgressView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzAssignmentDetailStudentProgressView', 
  interfaces: [UstadDetailView]};
  function ClazzAssignmentDetailView() {
    ClazzAssignmentDetailView$Companion_getInstance();
  }
  function ClazzAssignmentDetailView$Companion() {
    ClazzAssignmentDetailView$Companion_instance = this;
    this.VIEW_NAME = 'CourseAssignmentDetailView';
  }
  ClazzAssignmentDetailView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzAssignmentDetailView$Companion_instance = null;
  function ClazzAssignmentDetailView$Companion_getInstance() {
    if (ClazzAssignmentDetailView$Companion_instance === null) {
      new ClazzAssignmentDetailView$Companion();
    }
    return ClazzAssignmentDetailView$Companion_instance;
  }
  ClazzAssignmentDetailView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzAssignmentDetailView', 
  interfaces: [UstadDetailView]};
  function ClazzAssignmentEditView() {
    ClazzAssignmentEditView$Companion_getInstance();
  }
  function ClazzAssignmentEditView$Companion() {
    ClazzAssignmentEditView$Companion_instance = this;
    this.VIEW_NAME = 'CourseAssignmentEditView';
    this.TERMINOLOGY_ID = 'clazzTerminologyId';
  }
  ClazzAssignmentEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzAssignmentEditView$Companion_instance = null;
  function ClazzAssignmentEditView$Companion_getInstance() {
    if (ClazzAssignmentEditView$Companion_instance === null) {
      new ClazzAssignmentEditView$Companion();
    }
    return ClazzAssignmentEditView$Companion_instance;
  }
  ClazzAssignmentEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzAssignmentEditView', 
  interfaces: [UstadEditView]};
  function ClazzDetailOverviewView() {
    ClazzDetailOverviewView$Companion_getInstance();
  }
  function ClazzDetailOverviewView$Companion() {
    ClazzDetailOverviewView$Companion_instance = this;
    this.VIEW_NAME = 'CourseDetailOverviewView';
  }
  ClazzDetailOverviewView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzDetailOverviewView$Companion_instance = null;
  function ClazzDetailOverviewView$Companion_getInstance() {
    if (ClazzDetailOverviewView$Companion_instance === null) {
      new ClazzDetailOverviewView$Companion();
    }
    return ClazzDetailOverviewView$Companion_instance;
  }
  ClazzDetailOverviewView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzDetailOverviewView', 
  interfaces: [UstadDetailView]};
  function ClazzDetailView() {
    ClazzDetailView$Companion_getInstance();
  }
  function ClazzDetailView$Companion() {
    ClazzDetailView$Companion_instance = this;
    this.VIEW_NAME = 'CourseDetailView';
    this.ARG_TABS = 'courseTabs';
  }
  ClazzDetailView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzDetailView$Companion_instance = null;
  function ClazzDetailView$Companion_getInstance() {
    if (ClazzDetailView$Companion_instance === null) {
      new ClazzDetailView$Companion();
    }
    return ClazzDetailView$Companion_instance;
  }
  ClazzDetailView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzDetailView', 
  interfaces: [UstadDetailView]};
  function ClazzEdit2View() {
    ClazzEdit2View$Companion_getInstance();
  }
  function ClazzEdit2View$Companion() {
    ClazzEdit2View$Companion_instance = this;
    this.VIEW_NAME = 'CourseEditView';
  }
  ClazzEdit2View$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzEdit2View$Companion_instance = null;
  function ClazzEdit2View$Companion_getInstance() {
    if (ClazzEdit2View$Companion_instance === null) {
      new ClazzEdit2View$Companion();
    }
    return ClazzEdit2View$Companion_instance;
  }
  ClazzEdit2View.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzEdit2View', 
  interfaces: [UstadEditView]};
  function ClazzEnrolmentEditView() {
    ClazzEnrolmentEditView$Companion_getInstance();
  }
  function ClazzEnrolmentEditView$Companion() {
    ClazzEnrolmentEditView$Companion_instance = this;
    this.VIEW_NAME = 'CourseEnrolmentEditView';
  }
  ClazzEnrolmentEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzEnrolmentEditView$Companion_instance = null;
  function ClazzEnrolmentEditView$Companion_getInstance() {
    if (ClazzEnrolmentEditView$Companion_instance === null) {
      new ClazzEnrolmentEditView$Companion();
    }
    return ClazzEnrolmentEditView$Companion_instance;
  }
  ClazzEnrolmentEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzEnrolmentEditView', 
  interfaces: [UstadEditView]};
  function ClazzEnrolmentListView() {
    ClazzEnrolmentListView$Companion_getInstance();
  }
  function ClazzEnrolmentListView$Companion() {
    ClazzEnrolmentListView$Companion_instance = this;
    this.VIEW_NAME = 'CourseEnrolmentListView';
  }
  ClazzEnrolmentListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzEnrolmentListView$Companion_instance = null;
  function ClazzEnrolmentListView$Companion_getInstance() {
    if (ClazzEnrolmentListView$Companion_instance === null) {
      new ClazzEnrolmentListView$Companion();
    }
    return ClazzEnrolmentListView$Companion_instance;
  }
  ClazzEnrolmentListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzEnrolmentListView', 
  interfaces: [UstadListView]};
  function ClazzList2View() {
    ClazzList2View$Companion_getInstance();
  }
  function ClazzList2View$Companion() {
    ClazzList2View$Companion_instance = this;
    this.VIEW_NAME = 'Courses';
    this.VIEW_NAME_HOME = 'CoursesHome';
    this.ARG_FILTER_EXCLUDE_SELECTED_CLASS_LIST = 'excludeAlreadySelectedClazzList';
  }
  ClazzList2View$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzList2View$Companion_instance = null;
  function ClazzList2View$Companion_getInstance() {
    if (ClazzList2View$Companion_instance === null) {
      new ClazzList2View$Companion();
    }
    return ClazzList2View$Companion_instance;
  }
  ClazzList2View.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzList2View', 
  interfaces: [UstadListView]};
  function ClazzLogEditAttendanceView() {
    ClazzLogEditAttendanceView$Companion_getInstance();
  }
  function ClazzLogEditAttendanceView$Companion() {
    ClazzLogEditAttendanceView$Companion_instance = this;
    this.VIEW_NAME = 'CourseLogEditAttendanceEditView';
    this.ARG_NEW_CLAZZLOG = 'newclazzlog';
  }
  ClazzLogEditAttendanceView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzLogEditAttendanceView$Companion_instance = null;
  function ClazzLogEditAttendanceView$Companion_getInstance() {
    if (ClazzLogEditAttendanceView$Companion_instance === null) {
      new ClazzLogEditAttendanceView$Companion();
    }
    return ClazzLogEditAttendanceView$Companion_instance;
  }
  ClazzLogEditAttendanceView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzLogEditAttendanceView', 
  interfaces: [UstadEditView]};
  function ClazzLogEditView() {
    ClazzLogEditView$Companion_getInstance();
  }
  function ClazzLogEditView$Companion() {
    ClazzLogEditView$Companion_instance = this;
    this.VIEW_NAME = 'CourseLogEditView';
  }
  ClazzLogEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzLogEditView$Companion_instance = null;
  function ClazzLogEditView$Companion_getInstance() {
    if (ClazzLogEditView$Companion_instance === null) {
      new ClazzLogEditView$Companion();
    }
    return ClazzLogEditView$Companion_instance;
  }
  ClazzLogEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzLogEditView', 
  interfaces: [UstadEditView]};
  function ClazzLogListAttendanceView() {
    ClazzLogListAttendanceView$Companion_getInstance();
  }
  function ClazzLogListAttendanceView$Companion() {
    ClazzLogListAttendanceView$Companion_instance = this;
    this.VIEW_NAME = 'CourseLogListAttendanceView';
  }
  ClazzLogListAttendanceView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzLogListAttendanceView$Companion_instance = null;
  function ClazzLogListAttendanceView$Companion_getInstance() {
    if (ClazzLogListAttendanceView$Companion_instance === null) {
      new ClazzLogListAttendanceView$Companion();
    }
    return ClazzLogListAttendanceView$Companion_instance;
  }
  ClazzLogListAttendanceView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzLogListAttendanceView', 
  interfaces: [UstadListView]};
  function ClazzMemberListView() {
    ClazzMemberListView$Companion_getInstance();
  }
  function ClazzMemberListView$Companion() {
    ClazzMemberListView$Companion_instance = this;
    this.ARG_HIDE_CLAZZES = 'hideClazzes';
    this.VIEW_NAME = 'CourseMemberListView';
  }
  ClazzMemberListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ClazzMemberListView$Companion_instance = null;
  function ClazzMemberListView$Companion_getInstance() {
    if (ClazzMemberListView$Companion_instance === null) {
      new ClazzMemberListView$Companion();
    }
    return ClazzMemberListView$Companion_instance;
  }
  ClazzMemberListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ClazzMemberListView', 
  interfaces: [UstadListView]};
  function ContainerMounter() {
    ContainerMounter$Companion_getInstance();
  }
  ContainerMounter.prototype.mountContainer_dckg8j$ = function(endpointUrl, containerUid, filterMode, continuation, callback$default) {
  if (filterMode === void 0) 
    filterMode = 0;
  return callback$default ? callback$default(endpointUrl, containerUid, filterMode, continuation) : this.mountContainer_dckg8j$$default(endpointUrl, containerUid, filterMode, continuation);
};
  function ContainerMounter$Companion() {
    ContainerMounter$Companion_instance = this;
    this.FILTER_MODE_NONE = 0;
    this.FILTER_MODE_EPUB = 1;
  }
  ContainerMounter$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ContainerMounter$Companion_instance = null;
  function ContainerMounter$Companion_getInstance() {
    if (ContainerMounter$Companion_instance === null) {
      new ContainerMounter$Companion();
    }
    return ContainerMounter$Companion_instance;
  }
  ContainerMounter.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContainerMounter', 
  interfaces: []};
  function ContentEntryAddOptionsView() {
    ContentEntryAddOptionsView$Companion_getInstance();
  }
  function ContentEntryAddOptionsView$Companion() {
    ContentEntryAddOptionsView$Companion_instance = this;
    this.VIEW_NAME = 'ContentEntryAddOptionsView';
  }
  ContentEntryAddOptionsView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ContentEntryAddOptionsView$Companion_instance = null;
  function ContentEntryAddOptionsView$Companion_getInstance() {
    if (ContentEntryAddOptionsView$Companion_instance === null) {
      new ContentEntryAddOptionsView$Companion();
    }
    return ContentEntryAddOptionsView$Companion_instance;
  }
  ContentEntryAddOptionsView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContentEntryAddOptionsView', 
  interfaces: []};
  function ContentEntryDetailAttemptsListView() {
    ContentEntryDetailAttemptsListView$Companion_getInstance();
  }
  function ContentEntryDetailAttemptsListView$Companion() {
    ContentEntryDetailAttemptsListView$Companion_instance = this;
    this.VIEW_NAME = 'PersonWithStatementDisplayListView';
  }
  ContentEntryDetailAttemptsListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ContentEntryDetailAttemptsListView$Companion_instance = null;
  function ContentEntryDetailAttemptsListView$Companion_getInstance() {
    if (ContentEntryDetailAttemptsListView$Companion_instance === null) {
      new ContentEntryDetailAttemptsListView$Companion();
    }
    return ContentEntryDetailAttemptsListView$Companion_instance;
  }
  ContentEntryDetailAttemptsListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContentEntryDetailAttemptsListView', 
  interfaces: [UstadListView]};
  function ContentEntryDetailOverviewView() {
    ContentEntryDetailOverviewView$Companion_getInstance();
  }
  function ContentEntryDetailOverviewView$Companion() {
    ContentEntryDetailOverviewView$Companion_instance = this;
    this.VIEW_NAME = 'ContentEntryDetailOverviewView';
  }
  ContentEntryDetailOverviewView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ContentEntryDetailOverviewView$Companion_instance = null;
  function ContentEntryDetailOverviewView$Companion_getInstance() {
    if (ContentEntryDetailOverviewView$Companion_instance === null) {
      new ContentEntryDetailOverviewView$Companion();
    }
    return ContentEntryDetailOverviewView$Companion_instance;
  }
  ContentEntryDetailOverviewView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContentEntryDetailOverviewView', 
  interfaces: [UstadDetailView]};
  function ContentEntryDetailView() {
    ContentEntryDetailView$Companion_getInstance();
  }
  function ContentEntryDetailView$Companion() {
    ContentEntryDetailView$Companion_instance = this;
    this.VIEW_NAME = 'ContentEntryDetail';
  }
  ContentEntryDetailView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ContentEntryDetailView$Companion_instance = null;
  function ContentEntryDetailView$Companion_getInstance() {
    if (ContentEntryDetailView$Companion_instance === null) {
      new ContentEntryDetailView$Companion();
    }
    return ContentEntryDetailView$Companion_instance;
  }
  ContentEntryDetailView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContentEntryDetailView', 
  interfaces: [UstadDetailView]};
  function ContentEntryEdit2View() {
    ContentEntryEdit2View$Companion_getInstance();
  }
  function ContentEntryEdit2View$Companion() {
    ContentEntryEdit2View$Companion_instance = this;
    this.VIEW_NAME = 'ContentEntryEditView';
    this.ARG_IMPORTED_METADATA = 'metadata';
    this.ARG_URI = 'uri';
    this.BLOCK_REQUIRED = 'isBlockRequired';
  }
  ContentEntryEdit2View$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ContentEntryEdit2View$Companion_instance = null;
  function ContentEntryEdit2View$Companion_getInstance() {
    if (ContentEntryEdit2View$Companion_instance === null) {
      new ContentEntryEdit2View$Companion();
    }
    return ContentEntryEdit2View$Companion_instance;
  }
  ContentEntryEdit2View.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContentEntryEdit2View', 
  interfaces: [UstadEditView]};
  function ContentEntryImportLinkView() {
    ContentEntryImportLinkView$Companion_getInstance();
  }
  function ContentEntryImportLinkView$Companion() {
    ContentEntryImportLinkView$Companion_instance = this;
    this.CONTENT_ENTRY_PARENT_UID = 'ContentEntryParentUid';
    this.VIEW_NAME = 'ContentEntryImportLinkView';
    this.END_POINT_URL = 'endpointUrl';
  }
  ContentEntryImportLinkView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ContentEntryImportLinkView$Companion_instance = null;
  function ContentEntryImportLinkView$Companion_getInstance() {
    if (ContentEntryImportLinkView$Companion_instance === null) {
      new ContentEntryImportLinkView$Companion();
    }
    return ContentEntryImportLinkView$Companion_instance;
  }
  ContentEntryImportLinkView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContentEntryImportLinkView', 
  interfaces: [UstadView]};
  function ContentEntryList2View() {
    ContentEntryList2View$Companion_getInstance();
  }
  function ContentEntryList2View$Companion() {
    ContentEntryList2View$Companion_instance = this;
    this.ARG_SHOW_ONLY_FOLDER_FILTER = 'folder';
    this.ARG_DISPLAY_CONTENT_BY_OPTION = 'displayOption';
    this.ARG_DISPLAY_CONTENT_BY_PARENT = 'displayContentByParent';
    this.VIEW_NAME_HOME = 'ContentEntryListHome';
    this.VIEW_NAME = 'ContentEntryListView';
    this.FOLDER_VIEW_NAME = 'ContentEntryListFolderView';
    this.ARG_MOVING_CONTENT = 'SelectedItems';
    this.ARG_MOVING_COUNT = 'moveCount';
    this.ARG_SELECT_FOLDER_VISIBLE = 'selectFolderVisible';
    this.ARG_USE_CHIPS = 'contentEntryListChips';
  }
  ContentEntryList2View$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ContentEntryList2View$Companion_instance = null;
  function ContentEntryList2View$Companion_getInstance() {
    if (ContentEntryList2View$Companion_instance === null) {
      new ContentEntryList2View$Companion();
    }
    return ContentEntryList2View$Companion_instance;
  }
  ContentEntryList2View.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ContentEntryList2View', 
  interfaces: [UstadListView]};
  function CourseDiscussionDetailView() {
    CourseDiscussionDetailView$Companion_getInstance();
  }
  function CourseDiscussionDetailView$Companion() {
    CourseDiscussionDetailView$Companion_instance = this;
    this.VIEW_NAME = 'CourseDiscussionDetailView';
  }
  CourseDiscussionDetailView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var CourseDiscussionDetailView$Companion_instance = null;
  function CourseDiscussionDetailView$Companion_getInstance() {
    if (CourseDiscussionDetailView$Companion_instance === null) {
      new CourseDiscussionDetailView$Companion();
    }
    return CourseDiscussionDetailView$Companion_instance;
  }
  CourseDiscussionDetailView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'CourseDiscussionDetailView', 
  interfaces: [UstadDetailView]};
  function CourseDiscussionEditView() {
    CourseDiscussionEditView$Companion_getInstance();
  }
  function CourseDiscussionEditView$Companion() {
    CourseDiscussionEditView$Companion_instance = this;
    this.VIEW_NAME = 'CourseDiscussionBlockEdit';
  }
  CourseDiscussionEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var CourseDiscussionEditView$Companion_instance = null;
  function CourseDiscussionEditView$Companion_getInstance() {
    if (CourseDiscussionEditView$Companion_instance === null) {
      new CourseDiscussionEditView$Companion();
    }
    return CourseDiscussionEditView$Companion_instance;
  }
  CourseDiscussionEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'CourseDiscussionEditView', 
  interfaces: [UstadEditView]};
  function CourseGroupSetDetailView() {
    CourseGroupSetDetailView$Companion_getInstance();
  }
  function CourseGroupSetDetailView$Companion() {
    CourseGroupSetDetailView$Companion_instance = this;
    this.VIEW_NAME = 'CourseGroupSetDetailView';
  }
  CourseGroupSetDetailView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var CourseGroupSetDetailView$Companion_instance = null;
  function CourseGroupSetDetailView$Companion_getInstance() {
    if (CourseGroupSetDetailView$Companion_instance === null) {
      new CourseGroupSetDetailView$Companion();
    }
    return CourseGroupSetDetailView$Companion_instance;
  }
  CourseGroupSetDetailView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'CourseGroupSetDetailView', 
  interfaces: [UstadDetailView]};
  function CourseGroupSetEditView() {
    CourseGroupSetEditView$Companion_getInstance();
  }
  function CourseGroupSetEditView$Companion() {
    CourseGroupSetEditView$Companion_instance = this;
    this.VIEW_NAME = 'CourseGroupSetEditView';
  }
  CourseGroupSetEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var CourseGroupSetEditView$Companion_instance = null;
  function CourseGroupSetEditView$Companion_getInstance() {
    if (CourseGroupSetEditView$Companion_instance === null) {
      new CourseGroupSetEditView$Companion();
    }
    return CourseGroupSetEditView$Companion_instance;
  }
  CourseGroupSetEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'CourseGroupSetEditView', 
  interfaces: [UstadEditView]};
  function CourseGroupSetListView() {
    CourseGroupSetListView$Companion_getInstance();
  }
  function CourseGroupSetListView$Companion() {
    CourseGroupSetListView$Companion_instance = this;
    this.VIEW_NAME = 'CourseGroupSetListView';
    this.ARG_SHOW_INDIVIDUAL = 'individualSubmission';
  }
  CourseGroupSetListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var CourseGroupSetListView$Companion_instance = null;
  function CourseGroupSetListView$Companion_getInstance() {
    if (CourseGroupSetListView$Companion_instance === null) {
      new CourseGroupSetListView$Companion();
    }
    return CourseGroupSetListView$Companion_instance;
  }
  CourseGroupSetListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'CourseGroupSetListView', 
  interfaces: [UstadListView]};
  function CourseTerminologyEditView() {
    CourseTerminologyEditView$Companion_getInstance();
  }
  function CourseTerminologyEditView$Companion() {
    CourseTerminologyEditView$Companion_instance = this;
    this.VIEW_NAME = 'CourseTerminologyEditView';
  }
  CourseTerminologyEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var CourseTerminologyEditView$Companion_instance = null;
  function CourseTerminologyEditView$Companion_getInstance() {
    if (CourseTerminologyEditView$Companion_instance === null) {
      new CourseTerminologyEditView$Companion();
    }
    return CourseTerminologyEditView$Companion_instance;
  }
  CourseTerminologyEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'CourseTerminologyEditView', 
  interfaces: [UstadEditView]};
  function CourseTerminologyListView() {
    CourseTerminologyListView$Companion_getInstance();
  }
  function CourseTerminologyListView$Companion() {
    CourseTerminologyListView$Companion_instance = this;
    this.VIEW_NAME = 'CourseTerminologyListView';
  }
  CourseTerminologyListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var CourseTerminologyListView$Companion_instance = null;
  function CourseTerminologyListView$Companion_getInstance() {
    if (CourseTerminologyListView$Companion_instance === null) {
      new CourseTerminologyListView$Companion();
    }
    return CourseTerminologyListView$Companion_instance;
  }
  CourseTerminologyListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'CourseTerminologyListView', 
  interfaces: [UstadListView]};
  function DateRangeView() {
    DateRangeView$Companion_getInstance();
  }
  function DateRangeView$Companion() {
    DateRangeView$Companion_instance = this;
    this.VIEW_NAME = 'DateRangeEditView';
  }
  DateRangeView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var DateRangeView$Companion_instance = null;
  function DateRangeView$Companion_getInstance() {
    if (DateRangeView$Companion_instance === null) {
      new DateRangeView$Companion();
    }
    return DateRangeView$Companion_instance;
  }
  DateRangeView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'DateRangeView', 
  interfaces: [UstadEditView]};
  function DialogResultListener() {
  }
  DialogResultListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'DialogResultListener', 
  interfaces: []};
  function DiscussionPostDetailView() {
    DiscussionPostDetailView$Companion_getInstance();
  }
  function DiscussionPostDetailView$Companion() {
    DiscussionPostDetailView$Companion_instance = this;
    this.VIEW_NAME = 'DiscussionPostDetailView';
  }
  DiscussionPostDetailView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var DiscussionPostDetailView$Companion_instance = null;
  function DiscussionPostDetailView$Companion_getInstance() {
    if (DiscussionPostDetailView$Companion_instance === null) {
      new DiscussionPostDetailView$Companion();
    }
    return DiscussionPostDetailView$Companion_instance;
  }
  DiscussionPostDetailView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'DiscussionPostDetailView', 
  interfaces: [UstadDetailView]};
  function DiscussionPostEditView() {
    DiscussionPostEditView$Companion_getInstance();
  }
  function DiscussionPostEditView$Companion() {
    DiscussionPostEditView$Companion_instance = this;
    this.VIEW_NAME = 'DiscussionPostEdit';
  }
  DiscussionPostEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var DiscussionPostEditView$Companion_instance = null;
  function DiscussionPostEditView$Companion_getInstance() {
    if (DiscussionPostEditView$Companion_instance === null) {
      new DiscussionPostEditView$Companion();
    }
    return DiscussionPostEditView$Companion_instance;
  }
  DiscussionPostEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'DiscussionPostEditView', 
  interfaces: [UstadEditView]};
  function DiscussionTopicDetailView() {
    DiscussionTopicDetailView$Companion_getInstance();
  }
  function DiscussionTopicDetailView$Companion() {
    DiscussionTopicDetailView$Companion_instance = this;
    this.VIEW_NAME = 'DiscussionTopicDetailView';
  }
  DiscussionTopicDetailView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var DiscussionTopicDetailView$Companion_instance = null;
  function DiscussionTopicDetailView$Companion_getInstance() {
    if (DiscussionTopicDetailView$Companion_instance === null) {
      new DiscussionTopicDetailView$Companion();
    }
    return DiscussionTopicDetailView$Companion_instance;
  }
  DiscussionTopicDetailView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'DiscussionTopicDetailView', 
  interfaces: [UstadDetailView]};
  function DiscussionTopicEditView() {
    DiscussionTopicEditView$Companion_getInstance();
  }
  function DiscussionTopicEditView$Companion() {
    DiscussionTopicEditView$Companion_instance = this;
    this.VIEW_NAME = 'DiscussionTopicEdit';
  }
  DiscussionTopicEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var DiscussionTopicEditView$Companion_instance = null;
  function DiscussionTopicEditView$Companion_getInstance() {
    if (DiscussionTopicEditView$Companion_instance === null) {
      new DiscussionTopicEditView$Companion();
    }
    return DiscussionTopicEditView$Companion_instance;
  }
  DiscussionTopicEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'DiscussionTopicEditView', 
  interfaces: [UstadEditView]};
  function DismissableDialog() {
  }
  DismissableDialog.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'DismissableDialog', 
  interfaces: []};
  function EpubContentView() {
    EpubContentView$Companion_getInstance();
  }
  EpubContentView.prototype.scrollToSpinePosition_vqvrqt$ = function(spinePosition, hashAnchor, callback$default) {
  if (hashAnchor === void 0) 
    hashAnchor = null;
    callback$default ? callback$default(spinePosition, hashAnchor) : this.scrollToSpinePosition_vqvrqt$$default(spinePosition, hashAnchor);
};
  function EpubContentView$Companion() {
    EpubContentView$Companion_instance = this;
    this.VIEW_NAME = 'EpubContentView';
    this.ARG_INITIAL_PAGE_HREF = 'initialPageHref';
  }
  EpubContentView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var EpubContentView$Companion_instance = null;
  function EpubContentView$Companion_getInstance() {
    if (EpubContentView$Companion_instance === null) {
      new EpubContentView$Companion();
    }
    return EpubContentView$Companion_instance;
  }
  EpubContentView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'EpubContentView', 
  interfaces: [UstadView]};
  function ErrorReportView() {
    ErrorReportView$Companion_getInstance();
  }
  function ErrorReportView$Companion() {
    ErrorReportView$Companion_instance = this;
    this.ARG_ERR_CODE = 'errCode';
    this.ARG_MESSAGE = 'msg';
    this.ARG_STACKTRACE_PREFKEY = 'stacktraceKey';
    this.ARG_PRESENTER_URI = 'fromUri';
    this.VIEW_NAME = 'ErrorReport';
  }
  ErrorReportView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ErrorReportView$Companion_instance = null;
  function ErrorReportView$Companion_getInstance() {
    if (ErrorReportView$Companion_instance === null) {
      new ErrorReportView$Companion();
    }
    return ErrorReportView$Companion_instance;
  }
  ErrorReportView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ErrorReportView', 
  interfaces: [UstadView]};
  function HarView() {
    HarView$Companion_getInstance();
  }
  function HarView$Companion() {
    HarView$Companion_instance = this;
    this.VIEW_NAME = 'HarView';
    this.ARG_CONTENT_ENTRY_ID = 'entryId';
    this.ARG_CONTAINER_UID = 'containerUid';
  }
  HarView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HarView$Companion_instance = null;
  function HarView$Companion_getInstance() {
    if (HarView$Companion_instance === null) {
      new HarView$Companion();
    }
    return HarView$Companion_instance;
  }
  HarView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'HarView', 
  interfaces: [UstadView]};
  function HolidayCalendarEditView() {
    HolidayCalendarEditView$Companion_getInstance();
  }
  function HolidayCalendarEditView$Companion() {
    HolidayCalendarEditView$Companion_instance = this;
    this.VIEW_NAME = 'HolidayCalendarEditView';
  }
  HolidayCalendarEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HolidayCalendarEditView$Companion_instance = null;
  function HolidayCalendarEditView$Companion_getInstance() {
    if (HolidayCalendarEditView$Companion_instance === null) {
      new HolidayCalendarEditView$Companion();
    }
    return HolidayCalendarEditView$Companion_instance;
  }
  HolidayCalendarEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'HolidayCalendarEditView', 
  interfaces: [UstadEditView]};
  function HolidayCalendarListView() {
    HolidayCalendarListView$Companion_getInstance();
  }
  function HolidayCalendarListView$Companion() {
    HolidayCalendarListView$Companion_instance = this;
    this.VIEW_NAME = 'HolidayCalendarListView';
  }
  HolidayCalendarListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HolidayCalendarListView$Companion_instance = null;
  function HolidayCalendarListView$Companion_getInstance() {
    if (HolidayCalendarListView$Companion_instance === null) {
      new HolidayCalendarListView$Companion();
    }
    return HolidayCalendarListView$Companion_instance;
  }
  HolidayCalendarListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'HolidayCalendarListView', 
  interfaces: [UstadListView]};
  function HolidayEditView() {
    HolidayEditView$Companion_getInstance();
  }
  function HolidayEditView$Companion() {
    HolidayEditView$Companion_instance = this;
    this.VIEW_NAME = 'HolidayEditView';
  }
  HolidayEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HolidayEditView$Companion_instance = null;
  function HolidayEditView$Companion_getInstance() {
    if (HolidayEditView$Companion_instance === null) {
      new HolidayEditView$Companion();
    }
    return HolidayEditView$Companion_instance;
  }
  HolidayEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'HolidayEditView', 
  interfaces: [UstadEditView]};
  function HtmlTextViewDetailView() {
    HtmlTextViewDetailView$Companion_getInstance();
  }
  function HtmlTextViewDetailView$Companion() {
    HtmlTextViewDetailView$Companion_instance = this;
    this.VIEW_NAME = 'StringDetailView';
    this.DISPLAY_TEXT = 'textToDisplay';
    this.DISPLAY_TITLE = 'titleToDisplay';
  }
  HtmlTextViewDetailView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var HtmlTextViewDetailView$Companion_instance = null;
  function HtmlTextViewDetailView$Companion_getInstance() {
    if (HtmlTextViewDetailView$Companion_instance === null) {
      new HtmlTextViewDetailView$Companion();
    }
    return HtmlTextViewDetailView$Companion_instance;
  }
  HtmlTextViewDetailView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'HtmlTextViewDetailView', 
  interfaces: [UstadDetailView]};
  function InviteViaLinkView() {
    InviteViaLinkView$Companion_getInstance();
  }
  function InviteViaLinkView$Companion() {
    InviteViaLinkView$Companion_instance = this;
    this.VIEW_NAME = 'InviteViaLink';
  }
  InviteViaLinkView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var InviteViaLinkView$Companion_instance = null;
  function InviteViaLinkView$Companion_getInstance() {
    if (InviteViaLinkView$Companion_instance === null) {
      new InviteViaLinkView$Companion();
    }
    return InviteViaLinkView$Companion_instance;
  }
  InviteViaLinkView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'InviteViaLinkView', 
  interfaces: [UstadView]};
  function ItemTouchHelperListener() {
  }
  ItemTouchHelperListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ItemTouchHelperListener', 
  interfaces: []};
  function JoinWithCodeView() {
    JoinWithCodeView$Companion_getInstance();
  }
  function JoinWithCodeView$Companion() {
    JoinWithCodeView$Companion_instance = this;
    this.VIEW_NAME = 'JoinWithCode';
  }
  JoinWithCodeView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var JoinWithCodeView$Companion_instance = null;
  function JoinWithCodeView$Companion_getInstance() {
    if (JoinWithCodeView$Companion_instance === null) {
      new JoinWithCodeView$Companion();
    }
    return JoinWithCodeView$Companion_instance;
  }
  JoinWithCodeView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'JoinWithCodeView', 
  interfaces: [UstadView]};
  function LanguageEditView() {
    LanguageEditView$Companion_getInstance();
  }
  function LanguageEditView$Companion() {
    LanguageEditView$Companion_instance = this;
    this.VIEW_NAME = 'LanguageEditEditView';
  }
  LanguageEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var LanguageEditView$Companion_instance = null;
  function LanguageEditView$Companion_getInstance() {
    if (LanguageEditView$Companion_instance === null) {
      new LanguageEditView$Companion();
    }
    return LanguageEditView$Companion_instance;
  }
  LanguageEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'LanguageEditView', 
  interfaces: [UstadEditView]};
  function LanguageListView() {
    LanguageListView$Companion_getInstance();
  }
  function LanguageListView$Companion() {
    LanguageListView$Companion_instance = this;
    this.VIEW_NAME = 'LanguageListView';
  }
  LanguageListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var LanguageListView$Companion_instance = null;
  function LanguageListView$Companion_getInstance() {
    if (LanguageListView$Companion_instance === null) {
      new LanguageListView$Companion();
    }
    return LanguageListView$Companion_instance;
  }
  LanguageListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'LanguageListView', 
  interfaces: [UstadListView]};
  function LearnerGroupMemberListView() {
    LearnerGroupMemberListView$Companion_getInstance();
  }
  function LearnerGroupMemberListView$Companion() {
    LearnerGroupMemberListView$Companion_instance = this;
    this.VIEW_NAME = 'LearnerGroupMemberList';
  }
  LearnerGroupMemberListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var LearnerGroupMemberListView$Companion_instance = null;
  function LearnerGroupMemberListView$Companion_getInstance() {
    if (LearnerGroupMemberListView$Companion_instance === null) {
      new LearnerGroupMemberListView$Companion();
    }
    return LearnerGroupMemberListView$Companion_instance;
  }
  LearnerGroupMemberListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'LearnerGroupMemberListView', 
  interfaces: [UstadListView]};
  function LeavingReasonEditView() {
    LeavingReasonEditView$Companion_getInstance();
  }
  function LeavingReasonEditView$Companion() {
    LeavingReasonEditView$Companion_instance = this;
    this.VIEW_NAME = 'LeavingReasonEditEditView';
  }
  LeavingReasonEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var LeavingReasonEditView$Companion_instance = null;
  function LeavingReasonEditView$Companion_getInstance() {
    if (LeavingReasonEditView$Companion_instance === null) {
      new LeavingReasonEditView$Companion();
    }
    return LeavingReasonEditView$Companion_instance;
  }
  LeavingReasonEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'LeavingReasonEditView', 
  interfaces: [UstadEditView]};
  function LeavingReasonListView() {
    LeavingReasonListView$Companion_getInstance();
  }
  function LeavingReasonListView$Companion() {
    LeavingReasonListView$Companion_instance = this;
    this.VIEW_NAME = 'LeavingReasonListView';
  }
  LeavingReasonListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var LeavingReasonListView$Companion_instance = null;
  function LeavingReasonListView$Companion_getInstance() {
    if (LeavingReasonListView$Companion_instance === null) {
      new LeavingReasonListView$Companion();
    }
    return LeavingReasonListView$Companion_instance;
  }
  LeavingReasonListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'LeavingReasonListView', 
  interfaces: [UstadListView]};
  function Login2View() {
    Login2View$Companion_getInstance();
  }
  function Login2View$Companion() {
    Login2View$Companion_instance = this;
    this.VIEW_NAME = 'LoginView';
    this.ARG_NO_GUEST = 'NoGuest';
  }
  Login2View$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var Login2View$Companion_instance = null;
  function Login2View$Companion_getInstance() {
    if (Login2View$Companion_instance === null) {
      new Login2View$Companion();
    }
    return Login2View$Companion_instance;
  }
  Login2View.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'Login2View', 
  interfaces: [UstadView]};
  function ModuleCourseBlockEditView() {
    ModuleCourseBlockEditView$Companion_getInstance();
  }
  function ModuleCourseBlockEditView$Companion() {
    ModuleCourseBlockEditView$Companion_instance = this;
    this.VIEW_NAME = 'ModuleCourseBlockEdit';
  }
  ModuleCourseBlockEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ModuleCourseBlockEditView$Companion_instance = null;
  function ModuleCourseBlockEditView$Companion_getInstance() {
    if (ModuleCourseBlockEditView$Companion_instance === null) {
      new ModuleCourseBlockEditView$Companion();
    }
    return ModuleCourseBlockEditView$Companion_instance;
  }
  ModuleCourseBlockEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ModuleCourseBlockEditView', 
  interfaces: [UstadEditView]};
  function OnBoardingView() {
    OnBoardingView$Companion_getInstance();
  }
  function OnBoardingView$Companion() {
    OnBoardingView$Companion_instance = this;
    this.VIEW_NAME = 'OnBoardingView';
    this.PREF_TAG = 'onboaring_screen';
  }
  OnBoardingView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var OnBoardingView$Companion_instance = null;
  function OnBoardingView$Companion_getInstance() {
    if (OnBoardingView$Companion_instance === null) {
      new OnBoardingView$Companion();
    }
    return OnBoardingView$Companion_instance;
  }
  OnBoardingView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'OnBoardingView', 
  interfaces: [UstadView]};
  function OnClickNewListItemListener() {
  }
  OnClickNewListItemListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'OnClickNewListItemListener', 
  interfaces: []};
  function ParentalConsentManagementView() {
    ParentalConsentManagementView$Companion_getInstance();
  }
  function ParentalConsentManagementView$Companion() {
    ParentalConsentManagementView$Companion_instance = this;
    this.VIEW_NAME = 'ParentConsentManagement';
  }
  ParentalConsentManagementView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ParentalConsentManagementView$Companion_instance = null;
  function ParentalConsentManagementView$Companion_getInstance() {
    if (ParentalConsentManagementView$Companion_instance === null) {
      new ParentalConsentManagementView$Companion();
    }
    return ParentalConsentManagementView$Companion_instance;
  }
  ParentalConsentManagementView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ParentalConsentManagementView', 
  interfaces: [UstadEditView]};
  function PersonAccountEditView() {
    PersonAccountEditView$Companion_getInstance();
  }
  function PersonAccountEditView$Companion() {
    PersonAccountEditView$Companion_instance = this;
    this.VIEW_NAME = 'PersonAccountEditView';
    this.BLOCK_CHARACTER_SET = '~!#$%^&*()_+-[]\'\\/,|"{} ';
  }
  PersonAccountEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var PersonAccountEditView$Companion_instance = null;
  function PersonAccountEditView$Companion_getInstance() {
    if (PersonAccountEditView$Companion_instance === null) {
      new PersonAccountEditView$Companion();
    }
    return PersonAccountEditView$Companion_instance;
  }
  PersonAccountEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'PersonAccountEditView', 
  interfaces: [UstadEditView]};
  function PersonDetailView() {
    PersonDetailView$Companion_getInstance();
  }
  function PersonDetailView$Companion() {
    PersonDetailView$Companion_instance = this;
    this.VIEW_NAME = 'PersonDetailView';
  }
  PersonDetailView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var PersonDetailView$Companion_instance = null;
  function PersonDetailView$Companion_getInstance() {
    if (PersonDetailView$Companion_instance === null) {
      new PersonDetailView$Companion();
    }
    return PersonDetailView$Companion_instance;
  }
  PersonDetailView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'PersonDetailView', 
  interfaces: [UstadDetailView]};
  function PersonEditView() {
    PersonEditView$Companion_getInstance();
  }
  function PersonEditView$Companion() {
    PersonEditView$Companion_instance = this;
    this.VIEW_NAME = 'PersonEditView';
    this.VIEW_NAME_REGISTER = 'PersonEditRegisterView';
    this.ARG_REGISTRATION_MODE = 'RegMode';
    this.ARG_DATE_OF_BIRTH = 'DateOfBirth';
    this.REGISTER_VIA_LINK = 'RegViaLink';
    this.REGISTER_MODE_NONE = 0;
    this.REGISTER_MODE_ENABLED = 1;
    this.REGISTER_MODE_MINOR = 2;
  }
  PersonEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var PersonEditView$Companion_instance = null;
  function PersonEditView$Companion_getInstance() {
    if (PersonEditView$Companion_instance === null) {
      new PersonEditView$Companion();
    }
    return PersonEditView$Companion_instance;
  }
  PersonEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'PersonEditView', 
  interfaces: [UstadEditView]};
  function PersonGroupEditView() {
    PersonGroupEditView$Companion_getInstance();
  }
  function PersonGroupEditView$Companion() {
    PersonGroupEditView$Companion_instance = this;
    this.VIEW_NAME = 'PersonGroupEditView';
  }
  PersonGroupEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var PersonGroupEditView$Companion_instance = null;
  function PersonGroupEditView$Companion_getInstance() {
    if (PersonGroupEditView$Companion_instance === null) {
      new PersonGroupEditView$Companion();
    }
    return PersonGroupEditView$Companion_instance;
  }
  PersonGroupEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'PersonGroupEditView', 
  interfaces: [UstadEditView]};
  function PersonGroupListView() {
    PersonGroupListView$Companion_getInstance();
  }
  function PersonGroupListView$Companion() {
    PersonGroupListView$Companion_instance = this;
    this.VIEW_NAME = 'PersonGroupListView';
  }
  PersonGroupListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var PersonGroupListView$Companion_instance = null;
  function PersonGroupListView$Companion_getInstance() {
    if (PersonGroupListView$Companion_instance === null) {
      new PersonGroupListView$Companion();
    }
    return PersonGroupListView$Companion_instance;
  }
  PersonGroupListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'PersonGroupListView', 
  interfaces: [UstadListView]};
  function PersonListView() {
    PersonListView$Companion_getInstance();
  }
  function PersonListView$Companion() {
    PersonListView$Companion_instance = this;
    this.VIEW_NAME = 'PersonListView';
    this.VIEW_NAME_HOME = 'PersonListHome';
    this.ARG_FILTER_EXCLUDE_MEMBERSOFCLAZZ = 'exlcudeFromClazz';
    this.ARG_FILTER_EXCLUDE_MEMBERSOFSCHOOL = 'excludeFromSchool';
    this.ARG_EXCLUDE_PERSONUIDS_LIST = 'excludeAlreadySelectedList';
  }
  PersonListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var PersonListView$Companion_instance = null;
  function PersonListView$Companion_getInstance() {
    if (PersonListView$Companion_instance === null) {
      new PersonListView$Companion();
    }
    return PersonListView$Companion_instance;
  }
  PersonListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'PersonListView', 
  interfaces: [UstadListView]};
  function RedirectView() {
    RedirectView$Companion_getInstance();
  }
  function RedirectView$Companion() {
    RedirectView$Companion_instance = this;
    this.VIEW_NAME = 'RedirectView';
    this.TAG_REDIRECTED = 'app.redirected';
  }
  RedirectView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var RedirectView$Companion_instance = null;
  function RedirectView$Companion_getInstance() {
    if (RedirectView$Companion_instance === null) {
      new RedirectView$Companion();
    }
    return RedirectView$Companion_instance;
  }
  RedirectView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'RedirectView', 
  interfaces: [UstadView]};
  function RegisterAgeRedirectView() {
    RegisterAgeRedirectView$Companion_getInstance();
  }
  function RegisterAgeRedirectView$Companion() {
    RegisterAgeRedirectView$Companion_instance = this;
    this.VIEW_NAME = 'RegisterAgeRedirect';
  }
  RegisterAgeRedirectView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var RegisterAgeRedirectView$Companion_instance = null;
  function RegisterAgeRedirectView$Companion_getInstance() {
    if (RegisterAgeRedirectView$Companion_instance === null) {
      new RegisterAgeRedirectView$Companion();
    }
    return RegisterAgeRedirectView$Companion_instance;
  }
  RegisterAgeRedirectView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'RegisterAgeRedirectView', 
  interfaces: [UstadView]};
  function RegisterMinorWaitForParentView() {
    RegisterMinorWaitForParentView$Companion_getInstance();
  }
  function RegisterMinorWaitForParentView$Companion() {
    RegisterMinorWaitForParentView$Companion_instance = this;
    this.ARG_USERNAME = 'username';
    this.ARG_PASSWORD = 'password';
    this.ARG_PARENT_CONTACT = 'parentContact';
    this.VIEW_NAME = 'RegisterMinorWaitForParent';
  }
  RegisterMinorWaitForParentView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var RegisterMinorWaitForParentView$Companion_instance = null;
  function RegisterMinorWaitForParentView$Companion_getInstance() {
    if (RegisterMinorWaitForParentView$Companion_instance === null) {
      new RegisterMinorWaitForParentView$Companion();
    }
    return RegisterMinorWaitForParentView$Companion_instance;
  }
  RegisterMinorWaitForParentView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'RegisterMinorWaitForParentView', 
  interfaces: [UstadView]};
  function ReportDashboardView() {
    ReportDashboardView$Companion_getInstance();
  }
  function ReportDashboardView$Companion() {
    ReportDashboardView$Companion_instance = this;
    this.VIEW_NAME = 'ReportDashboardView';
  }
  ReportDashboardView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ReportDashboardView$Companion_instance = null;
  function ReportDashboardView$Companion_getInstance() {
    if (ReportDashboardView$Companion_instance === null) {
      new ReportDashboardView$Companion();
    }
    return ReportDashboardView$Companion_instance;
  }
  ReportDashboardView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ReportDashboardView', 
  interfaces: [UstadView]};
  function ReportDetailView() {
    ReportDetailView$Companion_getInstance();
  }
  function ReportDetailView$Companion() {
    ReportDetailView$Companion_instance = this;
    this.VIEW_NAME = 'ReportDetailView';
  }
  ReportDetailView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ReportDetailView$Companion_instance = null;
  function ReportDetailView$Companion_getInstance() {
    if (ReportDetailView$Companion_instance === null) {
      new ReportDetailView$Companion();
    }
    return ReportDetailView$Companion_instance;
  }
  ReportDetailView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ReportDetailView', 
  interfaces: [UstadDetailView]};
  function ReportEditView() {
    ReportEditView$Companion_getInstance();
  }
  function ReportEditView$Companion() {
    ReportEditView$Companion_instance = this;
    this.VIEW_NAME = 'ReportEditView';
  }
  ReportEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ReportEditView$Companion_instance = null;
  function ReportEditView$Companion_getInstance() {
    if (ReportEditView$Companion_instance === null) {
      new ReportEditView$Companion();
    }
    return ReportEditView$Companion_instance;
  }
  ReportEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ReportEditView', 
  interfaces: [UstadEditView]};
  function ReportFilterEditView() {
    ReportFilterEditView$Companion_getInstance();
  }
  function ReportFilterEditView$Companion() {
    ReportFilterEditView$Companion_instance = this;
    this.VIEW_NAME = 'ReportFilterEditView';
  }
  ReportFilterEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ReportFilterEditView$Companion_instance = null;
  function ReportFilterEditView$Companion_getInstance() {
    if (ReportFilterEditView$Companion_instance === null) {
      new ReportFilterEditView$Companion();
    }
    return ReportFilterEditView$Companion_instance;
  }
  ReportFilterEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ReportFilterEditView', 
  interfaces: [UstadEditView]};
  function ReportListView() {
    ReportListView$Companion_getInstance();
  }
  function ReportListView$Companion() {
    ReportListView$Companion_instance = this;
    this.VIEW_NAME = 'ReportListView';
  }
  ReportListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ReportListView$Companion_instance = null;
  function ReportListView$Companion_getInstance() {
    if (ReportListView$Companion_instance === null) {
      new ReportListView$Companion();
    }
    return ReportListView$Companion_instance;
  }
  ReportListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ReportListView', 
  interfaces: [UstadListView]};
  function ReportTemplateListView() {
    ReportTemplateListView$Companion_getInstance();
  }
  function ReportTemplateListView$Companion() {
    ReportTemplateListView$Companion_instance = this;
    this.VIEW_NAME = 'ReportTemplateListView';
  }
  ReportTemplateListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ReportTemplateListView$Companion_instance = null;
  function ReportTemplateListView$Companion_getInstance() {
    if (ReportTemplateListView$Companion_instance === null) {
      new ReportTemplateListView$Companion();
    }
    return ReportTemplateListView$Companion_instance;
  }
  ReportTemplateListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ReportTemplateListView', 
  interfaces: [UstadListView]};
  function ScheduleEditView() {
    ScheduleEditView$Companion_getInstance();
  }
  function ScheduleEditView$Companion() {
    ScheduleEditView$Companion_instance = this;
    this.VIEW_NAME = 'ScheduleEdit';
    this.ARG_SCHEDULE = 'schedule';
  }
  ScheduleEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ScheduleEditView$Companion_instance = null;
  function ScheduleEditView$Companion_getInstance() {
    if (ScheduleEditView$Companion_instance === null) {
      new ScheduleEditView$Companion();
    }
    return ScheduleEditView$Companion_instance;
  }
  ScheduleEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ScheduleEditView', 
  interfaces: [UstadEditView]};
  function SchoolDetailOverviewView() {
    SchoolDetailOverviewView$Companion_getInstance();
  }
  function SchoolDetailOverviewView$Companion() {
    SchoolDetailOverviewView$Companion_instance = this;
    this.VIEW_NAME = 'SchoolWithHolidayCalendarDetailView';
  }
  SchoolDetailOverviewView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SchoolDetailOverviewView$Companion_instance = null;
  function SchoolDetailOverviewView$Companion_getInstance() {
    if (SchoolDetailOverviewView$Companion_instance === null) {
      new SchoolDetailOverviewView$Companion();
    }
    return SchoolDetailOverviewView$Companion_instance;
  }
  SchoolDetailOverviewView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'SchoolDetailOverviewView', 
  interfaces: [UstadDetailView]};
  function SchoolDetailView() {
    SchoolDetailView$Companion_getInstance();
  }
  function SchoolDetailView$Companion() {
    SchoolDetailView$Companion_instance = this;
    this.VIEW_NAME = 'SchoolDetailView';
  }
  SchoolDetailView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SchoolDetailView$Companion_instance = null;
  function SchoolDetailView$Companion_getInstance() {
    if (SchoolDetailView$Companion_instance === null) {
      new SchoolDetailView$Companion();
    }
    return SchoolDetailView$Companion_instance;
  }
  SchoolDetailView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'SchoolDetailView', 
  interfaces: [UstadDetailView]};
  function SchoolEditView() {
    SchoolEditView$Companion_getInstance();
  }
  function SchoolEditView$Companion() {
    SchoolEditView$Companion_instance = this;
    this.VIEW_NAME = 'InstitutionEditView';
  }
  SchoolEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SchoolEditView$Companion_instance = null;
  function SchoolEditView$Companion_getInstance() {
    if (SchoolEditView$Companion_instance === null) {
      new SchoolEditView$Companion();
    }
    return SchoolEditView$Companion_instance;
  }
  SchoolEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'SchoolEditView', 
  interfaces: [UstadEditView]};
  function SchoolListView() {
    SchoolListView$Companion_getInstance();
  }
  function SchoolListView$Companion() {
    SchoolListView$Companion_instance = this;
    this.VIEW_NAME = 'InstitutionListView';
  }
  SchoolListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SchoolListView$Companion_instance = null;
  function SchoolListView$Companion_getInstance() {
    if (SchoolListView$Companion_instance === null) {
      new SchoolListView$Companion();
    }
    return SchoolListView$Companion_instance;
  }
  SchoolListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'SchoolListView', 
  interfaces: [UstadListView]};
  function SchoolMemberListView() {
    SchoolMemberListView$Companion_getInstance();
  }
  function SchoolMemberListView$Companion() {
    SchoolMemberListView$Companion_instance = this;
    this.VIEW_NAME = 'SchoolMemberListView';
  }
  SchoolMemberListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SchoolMemberListView$Companion_instance = null;
  function SchoolMemberListView$Companion_getInstance() {
    if (SchoolMemberListView$Companion_instance === null) {
      new SchoolMemberListView$Companion();
    }
    return SchoolMemberListView$Companion_instance;
  }
  SchoolMemberListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'SchoolMemberListView', 
  interfaces: [UstadListView]};
  function ScopedGrantDetailView() {
    ScopedGrantDetailView$Companion_getInstance();
  }
  function ScopedGrantDetailView$Companion() {
    ScopedGrantDetailView$Companion_instance = this;
    this.VIEW_NAME = 'ScopedGrantDetail';
  }
  ScopedGrantDetailView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ScopedGrantDetailView$Companion_instance = null;
  function ScopedGrantDetailView$Companion_getInstance() {
    if (ScopedGrantDetailView$Companion_instance === null) {
      new ScopedGrantDetailView$Companion();
    }
    return ScopedGrantDetailView$Companion_instance;
  }
  ScopedGrantDetailView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ScopedGrantDetailView', 
  interfaces: [UstadDetailView]};
  function ScopedGrantEditView() {
    ScopedGrantEditView$Companion_getInstance();
  }
  function ScopedGrantEditView$Companion() {
    ScopedGrantEditView$Companion_instance = this;
    this.VIEW_NAME = 'ScopedGrantEdit';
    this.ARG_GRANT_TO_GROUPUID = 'grantToGroup';
    this.ARG_GRANT_TO_NAME = 'grantToName';
    this.ARG_GRANT_ON_TABLE_ID = 'grantTableId';
    this.ARG_GRANT_ON_ENTITY_UID = 'grantEntityUid';
    this.ARG_PERMISSION_LIST = 'permissionList';
  }
  ScopedGrantEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ScopedGrantEditView$Companion_instance = null;
  function ScopedGrantEditView$Companion_getInstance() {
    if (ScopedGrantEditView$Companion_instance === null) {
      new ScopedGrantEditView$Companion();
    }
    return ScopedGrantEditView$Companion_instance;
  }
  ScopedGrantEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ScopedGrantEditView', 
  interfaces: [UstadEditView]};
  function ScopedGrantListView() {
    ScopedGrantListView$Companion_getInstance();
  }
  function ScopedGrantListView$Companion() {
    ScopedGrantListView$Companion_instance = this;
    this.VIEW_NAME = 'ScopedGrantList';
    this.ARG_FILTER_TABLE_ID = 'filterTable';
    this.ARG_FILTER_ENTITY_UID = 'filterEntity';
  }
  ScopedGrantListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var ScopedGrantListView$Companion_instance = null;
  function ScopedGrantListView$Companion_getInstance() {
    if (ScopedGrantListView$Companion_instance === null) {
      new ScopedGrantListView$Companion();
    }
    return ScopedGrantListView$Companion_instance;
  }
  ScopedGrantListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'ScopedGrantListView', 
  interfaces: [UstadListView]};
  function SelectExtractFileView() {
    SelectExtractFileView$Companion_getInstance();
  }
  function SelectExtractFileView$Companion() {
    SelectExtractFileView$Companion_instance = this;
    this.VIEW_NAME = 'SelectExtractFileView';
  }
  SelectExtractFileView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SelectExtractFileView$Companion_instance = null;
  function SelectExtractFileView$Companion_getInstance() {
    if (SelectExtractFileView$Companion_instance === null) {
      new SelectExtractFileView$Companion();
    }
    return SelectExtractFileView$Companion_instance;
  }
  SelectExtractFileView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'SelectExtractFileView', 
  interfaces: [UstadEditView]};
  function SelectFileView() {
    SelectFileView$Companion_getInstance();
  }
  function SelectFileView$Companion() {
    SelectFileView$Companion_instance = this;
    this.VIEW_NAME = 'SelectFileView';
    this.ARG_MIMETYPE_SELECTED = 'selectMimeTypeMode';
    this.SELECTION_MODE_GALLERY = 'video/*;audio/*';
    this.SELECTION_MODE_VIDEO = 'video/*';
    this.SELECTION_MODE_AUDIO = 'audio/*';
    this.SELECTION_MODE_IMAGE = 'image/*';
    this.SELECTION_MODE_ANY = '*/*';
    this.SELECTION_MODE_DOC = joinToString(listOf(['application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.presentation', 'application/msword', 'application/vnd.ms-powerpoint', 'application/pdf', 'application/octet-stream']), ';');
  }
  SelectFileView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SelectFileView$Companion_instance = null;
  function SelectFileView$Companion_getInstance() {
    if (SelectFileView$Companion_instance === null) {
      new SelectFileView$Companion();
    }
    return SelectFileView$Companion_instance;
  }
  SelectFileView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'SelectFileView', 
  interfaces: [UstadEditView]};
  function SelectFolderView() {
    SelectFolderView$Companion_getInstance();
  }
  function SelectFolderView$Companion() {
    SelectFolderView$Companion_instance = this;
    this.VIEW_NAME = 'SelectFolderView';
  }
  SelectFolderView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SelectFolderView$Companion_instance = null;
  function SelectFolderView$Companion_getInstance() {
    if (SelectFolderView$Companion_instance === null) {
      new SelectFolderView$Companion();
    }
    return SelectFolderView$Companion_instance;
  }
  SelectFolderView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'SelectFolderView', 
  interfaces: [UstadView]};
  function SessionListView() {
    SessionListView$Companion_getInstance();
  }
  function SessionListView$Companion() {
    SessionListView$Companion_instance = this;
    this.VIEW_NAME = 'PersonWithSessionListView';
    this.ARG_CONTEXT_REGISTRATION = 'contextRegistration';
  }
  SessionListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SessionListView$Companion_instance = null;
  function SessionListView$Companion_getInstance() {
    if (SessionListView$Companion_instance === null) {
      new SessionListView$Companion();
    }
    return SessionListView$Companion_instance;
  }
  SessionListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'SessionListView', 
  interfaces: [UstadListView]};
  function SettingsView() {
    SettingsView$Companion_getInstance();
  }
  function SettingsView$Companion() {
    SettingsView$Companion_instance = this;
    this.VIEW_NAME = 'SettingsFromToolbar';
  }
  SettingsView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SettingsView$Companion_instance = null;
  function SettingsView$Companion_getInstance() {
    if (SettingsView$Companion_instance === null) {
      new SettingsView$Companion();
    }
    return SettingsView$Companion_instance;
  }
  SettingsView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'SettingsView', 
  interfaces: [UstadView]};
  function SiteDetailView() {
    SiteDetailView$Companion_getInstance();
  }
  function SiteDetailView$Companion() {
    SiteDetailView$Companion_instance = this;
    this.VIEW_NAME = 'SiteDetailView';
    this.ARG_SHOW_BY_DISPLAYED_LOCALE = 'showByDisplayedLocale';
  }
  SiteDetailView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SiteDetailView$Companion_instance = null;
  function SiteDetailView$Companion_getInstance() {
    if (SiteDetailView$Companion_instance === null) {
      new SiteDetailView$Companion();
    }
    return SiteDetailView$Companion_instance;
  }
  SiteDetailView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'SiteDetailView', 
  interfaces: [UstadDetailView]};
  function SiteEditView() {
    SiteEditView$Companion_getInstance();
  }
  function SiteEditView$Companion() {
    SiteEditView$Companion_instance = this;
    this.VIEW_NAME = 'SiteEditView';
  }
  SiteEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SiteEditView$Companion_instance = null;
  function SiteEditView$Companion_getInstance() {
    if (SiteEditView$Companion_instance === null) {
      new SiteEditView$Companion();
    }
    return SiteEditView$Companion_instance;
  }
  SiteEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'SiteEditView', 
  interfaces: [UstadEditView]};
  function SiteEnterLinkView() {
    SiteEnterLinkView$Companion_getInstance();
  }
  function SiteEnterLinkView$Companion() {
    SiteEnterLinkView$Companion_instance = this;
    this.VIEW_NAME = 'SiteEnterLinkView';
  }
  SiteEnterLinkView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SiteEnterLinkView$Companion_instance = null;
  function SiteEnterLinkView$Companion_getInstance() {
    if (SiteEnterLinkView$Companion_instance === null) {
      new SiteEnterLinkView$Companion();
    }
    return SiteEnterLinkView$Companion_instance;
  }
  SiteEnterLinkView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'SiteEnterLinkView', 
  interfaces: [UstadView]};
  function SiteTermsDetailView() {
    SiteTermsDetailView$Companion_getInstance();
  }
  function SiteTermsDetailView$Companion() {
    SiteTermsDetailView$Companion_instance = this;
    this.VIEW_NAME = 'SiteTermsDetailView';
    this.VIEW_NAME_ACCEPT_TERMS = 'SiteTermsDetailAcceptTerms';
    this.ARG_USE_DISPLAY_LOCALE = 'useDisplayLocale';
    this.ARG_SHOW_ACCEPT_BUTTON = 'showAccept';
  }
  SiteTermsDetailView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SiteTermsDetailView$Companion_instance = null;
  function SiteTermsDetailView$Companion_getInstance() {
    if (SiteTermsDetailView$Companion_instance === null) {
      new SiteTermsDetailView$Companion();
    }
    return SiteTermsDetailView$Companion_instance;
  }
  SiteTermsDetailView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'SiteTermsDetailView', 
  interfaces: [UstadDetailView]};
  function SiteTermsEditView() {
    SiteTermsEditView$Companion_getInstance();
  }
  function SiteTermsEditView$Companion() {
    SiteTermsEditView$Companion_instance = this;
    this.VIEW_NAME = 'SiteTermsEditView';
  }
  SiteTermsEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SiteTermsEditView$Companion_instance = null;
  function SiteTermsEditView$Companion_getInstance() {
    if (SiteTermsEditView$Companion_instance === null) {
      new SiteTermsEditView$Companion();
    }
    return SiteTermsEditView$Companion_instance;
  }
  SiteTermsEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'SiteTermsEditView', 
  interfaces: [UstadEditView]};
  function SplashScreenView() {
    SplashScreenView$Companion_getInstance();
  }
  function SplashScreenView$Companion() {
    SplashScreenView$Companion_instance = this;
    this.VIEW_NAME = 'SplashScreenView';
  }
  SplashScreenView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var SplashScreenView$Companion_instance = null;
  function SplashScreenView$Companion_getInstance() {
    if (SplashScreenView$Companion_instance === null) {
      new SplashScreenView$Companion();
    }
    return SplashScreenView$Companion_instance;
  }
  SplashScreenView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'SplashScreenView', 
  interfaces: [UstadView]};
  function StatementListView() {
    StatementListView$Companion_getInstance();
  }
  function StatementListView$Companion() {
    StatementListView$Companion_instance = this;
    this.VIEW_NAME = 'StatementListView';
  }
  StatementListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var StatementListView$Companion_instance = null;
  function StatementListView$Companion_getInstance() {
    if (StatementListView$Companion_instance === null) {
      new StatementListView$Companion();
    }
    return StatementListView$Companion_instance;
  }
  StatementListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'StatementListView', 
  interfaces: [UstadListView]};
  function TextAssignmentEditView() {
    TextAssignmentEditView$Companion_getInstance();
  }
  function TextAssignmentEditView$Companion() {
    TextAssignmentEditView$Companion_instance = this;
    this.VIEW_NAME = 'TextAssignmentEditView';
    this.ASSIGNMENT_ID = 'assignment';
    this.EDIT_ENABLED = 'editEnabled';
  }
  TextAssignmentEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var TextAssignmentEditView$Companion_instance = null;
  function TextAssignmentEditView$Companion_getInstance() {
    if (TextAssignmentEditView$Companion_instance === null) {
      new TextAssignmentEditView$Companion();
    }
    return TextAssignmentEditView$Companion_instance;
  }
  TextAssignmentEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'TextAssignmentEditView', 
  interfaces: [UstadEditView]};
  function TextCourseBlockEditView() {
    TextCourseBlockEditView$Companion_getInstance();
  }
  function TextCourseBlockEditView$Companion() {
    TextCourseBlockEditView$Companion_instance = this;
    this.VIEW_NAME = 'TextCourseBlockEdit';
  }
  TextCourseBlockEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var TextCourseBlockEditView$Companion_instance = null;
  function TextCourseBlockEditView$Companion_getInstance() {
    if (TextCourseBlockEditView$Companion_instance === null) {
      new TextCourseBlockEditView$Companion();
    }
    return TextCourseBlockEditView$Companion_instance;
  }
  TextCourseBlockEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'TextCourseBlockEditView', 
  interfaces: [UstadEditView]};
  function TimeZoneListView() {
    TimeZoneListView$Companion_getInstance();
  }
  function TimeZoneListView$Companion() {
    TimeZoneListView$Companion_instance = this;
    this.VIEW_NAME = 'TimeZoneListView';
  }
  TimeZoneListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var TimeZoneListView$Companion_instance = null;
  function TimeZoneListView$Companion_getInstance() {
    if (TimeZoneListView$Companion_instance === null) {
      new TimeZoneListView$Companion();
    }
    return TimeZoneListView$Companion_instance;
  }
  TimeZoneListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'TimeZoneListView', 
  interfaces: [UstadView]};
  function EditButtonMode(name, ordinal) {
    Enum.call(this);
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function EditButtonMode_initFields() {
    EditButtonMode_initFields = function() {
};
    EditButtonMode$GONE_instance = new EditButtonMode('GONE', 0);
    EditButtonMode$FAB_instance = new EditButtonMode('FAB', 1);
  }
  var EditButtonMode$GONE_instance;
  function EditButtonMode$GONE_getInstance() {
    EditButtonMode_initFields();
    return EditButtonMode$GONE_instance;
  }
  var EditButtonMode$FAB_instance;
  function EditButtonMode$FAB_getInstance() {
    EditButtonMode_initFields();
    return EditButtonMode$FAB_instance;
  }
  EditButtonMode.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'EditButtonMode', 
  interfaces: [Enum]};
  function EditButtonMode$values() {
    return [EditButtonMode$GONE_getInstance(), EditButtonMode$FAB_getInstance()];
  }
  EditButtonMode.values = EditButtonMode$values;
  function EditButtonMode$valueOf(name) {
    switch (name) {
      case 'GONE':
        return EditButtonMode$GONE_getInstance();
      case 'FAB':
        return EditButtonMode$FAB_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.view.EditButtonMode.' + name);
    }
  }
  EditButtonMode.valueOf_61zpoe$ = EditButtonMode$valueOf;
  function UstadDetailView() {
  }
  UstadDetailView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'UstadDetailView', 
  interfaces: [UstadSingleEntityView]};
  function UstadEditView() {
    UstadEditView$Companion_getInstance();
  }
  function UstadEditView$Companion() {
    UstadEditView$Companion_instance = this;
    this.ARG_ENTITY_JSON = 'entity';
  }
  UstadEditView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var UstadEditView$Companion_instance = null;
  function UstadEditView$Companion_getInstance() {
    if (UstadEditView$Companion_instance === null) {
      new UstadEditView$Companion();
    }
    return UstadEditView$Companion_instance;
  }
  UstadEditView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'UstadEditView', 
  interfaces: [UstadSingleEntityView]};
  function ListViewMode(name, ordinal, mode) {
    Enum.call(this);
    this.mode = mode;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ListViewMode_initFields() {
    ListViewMode_initFields = function() {
};
    ListViewMode$BROWSER_instance = new ListViewMode('BROWSER', 0, 'browser');
    ListViewMode$PICKER_instance = new ListViewMode('PICKER', 1, 'picker');
  }
  var ListViewMode$BROWSER_instance;
  function ListViewMode$BROWSER_getInstance() {
    ListViewMode_initFields();
    return ListViewMode$BROWSER_instance;
  }
  var ListViewMode$PICKER_instance;
  function ListViewMode$PICKER_getInstance() {
    ListViewMode_initFields();
    return ListViewMode$PICKER_instance;
  }
  ListViewMode.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ListViewMode', 
  interfaces: [Enum]};
  function ListViewMode$values() {
    return [ListViewMode$BROWSER_getInstance(), ListViewMode$PICKER_getInstance()];
  }
  ListViewMode.values = ListViewMode$values;
  function ListViewMode$valueOf(name) {
    switch (name) {
      case 'BROWSER':
        return ListViewMode$BROWSER_getInstance();
      case 'PICKER':
        return ListViewMode$PICKER_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.view.ListViewMode.' + name);
    }
  }
  ListViewMode.valueOf_61zpoe$ = ListViewMode$valueOf;
  function ListViewAddMode(name, ordinal) {
    Enum.call(this);
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function ListViewAddMode_initFields() {
    ListViewAddMode_initFields = function() {
};
    ListViewAddMode$FIRST_ITEM_instance = new ListViewAddMode('FIRST_ITEM', 0);
    ListViewAddMode$FAB_instance = new ListViewAddMode('FAB', 1);
    ListViewAddMode$NONE_instance = new ListViewAddMode('NONE', 2);
  }
  var ListViewAddMode$FIRST_ITEM_instance;
  function ListViewAddMode$FIRST_ITEM_getInstance() {
    ListViewAddMode_initFields();
    return ListViewAddMode$FIRST_ITEM_instance;
  }
  var ListViewAddMode$FAB_instance;
  function ListViewAddMode$FAB_getInstance() {
    ListViewAddMode_initFields();
    return ListViewAddMode$FAB_instance;
  }
  var ListViewAddMode$NONE_instance;
  function ListViewAddMode$NONE_getInstance() {
    ListViewAddMode_initFields();
    return ListViewAddMode$NONE_instance;
  }
  ListViewAddMode.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ListViewAddMode', 
  interfaces: [Enum]};
  function ListViewAddMode$values() {
    return [ListViewAddMode$FIRST_ITEM_getInstance(), ListViewAddMode$FAB_getInstance(), ListViewAddMode$NONE_getInstance()];
  }
  ListViewAddMode.values = ListViewAddMode$values;
  function ListViewAddMode$valueOf(name) {
    switch (name) {
      case 'FIRST_ITEM':
        return ListViewAddMode$FIRST_ITEM_getInstance();
      case 'FAB':
        return ListViewAddMode$FAB_getInstance();
      case 'NONE':
        return ListViewAddMode$NONE_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.view.ListViewAddMode.' + name);
    }
  }
  ListViewAddMode.valueOf_61zpoe$ = ListViewAddMode$valueOf;
  function SelectionOption(name, ordinal, messageId, commandId) {
    Enum.call(this);
    this.messageId = messageId;
    this.commandId = commandId;
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function SelectionOption_initFields() {
    SelectionOption_initFields = function() {
};
    SelectionOption$EDIT_instance = new SelectionOption('EDIT', 0, 2321, 1);
    SelectionOption$DELETE_instance = new SelectionOption('DELETE', 1, 2020, 2);
    SelectionOption$MOVE_instance = new SelectionOption('MOVE', 2, 2110, 3);
    SelectionOption$HIDE_instance = new SelectionOption('HIDE', 3, 2111, 4);
    SelectionOption$UNHIDE_instance = new SelectionOption('UNHIDE', 4, 2112, 5);
  }
  var SelectionOption$EDIT_instance;
  function SelectionOption$EDIT_getInstance() {
    SelectionOption_initFields();
    return SelectionOption$EDIT_instance;
  }
  var SelectionOption$DELETE_instance;
  function SelectionOption$DELETE_getInstance() {
    SelectionOption_initFields();
    return SelectionOption$DELETE_instance;
  }
  var SelectionOption$MOVE_instance;
  function SelectionOption$MOVE_getInstance() {
    SelectionOption_initFields();
    return SelectionOption$MOVE_instance;
  }
  var SelectionOption$HIDE_instance;
  function SelectionOption$HIDE_getInstance() {
    SelectionOption_initFields();
    return SelectionOption$HIDE_instance;
  }
  var SelectionOption$UNHIDE_instance;
  function SelectionOption$UNHIDE_getInstance() {
    SelectionOption_initFields();
    return SelectionOption$UNHIDE_instance;
  }
  SelectionOption.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SelectionOption', 
  interfaces: [Enum]};
  function SelectionOption$values() {
    return [SelectionOption$EDIT_getInstance(), SelectionOption$DELETE_getInstance(), SelectionOption$MOVE_getInstance(), SelectionOption$HIDE_getInstance(), SelectionOption$UNHIDE_getInstance()];
  }
  SelectionOption.values = SelectionOption$values;
  function SelectionOption$valueOf(name) {
    switch (name) {
      case 'EDIT':
        return SelectionOption$EDIT_getInstance();
      case 'DELETE':
        return SelectionOption$DELETE_getInstance();
      case 'MOVE':
        return SelectionOption$MOVE_getInstance();
      case 'HIDE':
        return SelectionOption$HIDE_getInstance();
      case 'UNHIDE':
        return SelectionOption$UNHIDE_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.view.SelectionOption.' + name);
    }
  }
  SelectionOption.valueOf_61zpoe$ = SelectionOption$valueOf;
  function UstadListView() {
  }
  UstadListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'UstadListView', 
  interfaces: [UstadView]};
  function UstadSingleEntityView() {
  }
  UstadSingleEntityView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'UstadSingleEntityView', 
  interfaces: [UstadView]};
  function GetResultMode(name, ordinal) {
    Enum.call(this);
    this.name$ = name;
    this.ordinal$ = ordinal;
  }
  function GetResultMode_initFields() {
    GetResultMode_initFields = function() {
};
    GetResultMode$EDITORNEW_instance = new GetResultMode('EDITORNEW', 0);
    GetResultMode$FROMLIST_instance = new GetResultMode('FROMLIST', 1);
  }
  var GetResultMode$EDITORNEW_instance;
  function GetResultMode$EDITORNEW_getInstance() {
    GetResultMode_initFields();
    return GetResultMode$EDITORNEW_instance;
  }
  var GetResultMode$FROMLIST_instance;
  function GetResultMode$FROMLIST_getInstance() {
    GetResultMode_initFields();
    return GetResultMode$FROMLIST_instance;
  }
  GetResultMode.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'GetResultMode', 
  interfaces: [Enum]};
  function GetResultMode$values() {
    return [GetResultMode$EDITORNEW_getInstance(), GetResultMode$FROMLIST_getInstance()];
  }
  GetResultMode.values = GetResultMode$values;
  function GetResultMode$valueOf(name) {
    switch (name) {
      case 'EDITORNEW':
        return GetResultMode$EDITORNEW_getInstance();
      case 'FROMLIST':
        return GetResultMode$FROMLIST_getInstance();
      default:
        throwISE('No enum constant com.ustadmobile.core.view.GetResultMode.' + name);
    }
  }
  GetResultMode.valueOf_61zpoe$ = GetResultMode$valueOf;
  function UstadView() {
    UstadView$Companion_getInstance();
  }
  function UstadView$showSnackBar$lambda() {
    return Unit;
  }
  UstadView.prototype.showSnackBar_9pu0dj$ = function(message, action, actionMessageId, callback$default) {
  if (action === void 0) 
    action = UstadView$showSnackBar$lambda;
  if (actionMessageId === void 0) 
    actionMessageId = 0;
    callback$default ? callback$default(message, action, actionMessageId) : this.showSnackBar_9pu0dj$$default(message, action, actionMessageId);
};
  function UstadView$Companion() {
    UstadView$Companion_instance = this;
    this.ARG_ENTITY_UID = 'entityUid';
    this.ARG_CONTAINER_UID = 'containerUid';
    this.ARG_PARENT_ENTRY_UID = 'parentUid';
    this.ARG_PARENT_ENTRY_TITLE = 'parentTitle';
    this.ARG_CONTENT_ENTRY_UID = 'entryid';
    this.ARG_LEARNER_GROUP_UID = 'learnerGroupUid';
    this.ARG_NO_IFRAMES = 'noiframe';
    this.ARG_SCHOOL_UID = 'schoolUid';
    this.ARG_LEAF = 'content_type';
    this.ARG_FILTER_BY_SCHOOLUID = 'filterBySchoolUid';
    this.ARG_FILTER_BY_ROLE = 'filterByRole';
    this.ARG_LISTMODE = 'listMode';
    this.ARG_GETRESULTMODE = 'getResultMode';
    this.ARG_LISTADDMODE = 'listAddMode';
    this.ARG_FILTER_BY_PERMISSION = 'filterByPermission';
    this.ARG_CLAZZUID = 'clazzUid';
    this.ARG_FILTER_BY_PERSONGROUPUID = 'filterByPersonGroupUid';
    this.ARG_FILTER_BY_ENROLMENT_ROLE = 'filterByEnrolmentRole';
    this.ARG_CLAZZ_ASSIGNMENT_UID = 'clazzAssignmentUid';
    this.ARG_SUBMITER_UID = 'clazzAssignmentSubmitterUid';
    this.ARG_PERSON_UID = 'personUid';
    this.ARG_NEXT = 'next';
    this.ARG_SITE = 'site';
    this.ARG_SERVER_URL = 'serverUrl';
    this.ARG_DEEPLINK = 'argIntent';
    this.ARG_SNACK_MESSAGE = 'snack_message';
    this.ARG_CODE = 'argCode';
    this.ARG_CODE_TABLE = 'argCodeTable';
    this.ARG_ENTITY_NAME = 'argEntityName';
    this.CURRENT_DEST = '';
    this.ROOT_DEST = 'root';
    this.ARG_CURRENT = 'current';
    this.ARG_GO_TO_COMPLETE = 'goToComplete';
    this.ARG_SAVE_TO_DB = 'saveDb';
    this.ARG_POPUPTO_ON_FINISH = 'popUpToOnFinish';
    this.ARG_RESULT_DEST_ID = 'result_dest';
    this.ARG_RESULT_DEST_VIEWNAME = 'result_viewname';
    this.ARG_REGISTRATION_ALLOWED = 'registration_allowed';
    this.ARG_RESULT_DEST_KEY = 'result_key';
    this.ARG_INTENT_MESSAGE = 'intMsg';
    this.ARG_TITLE = 'title';
    this.ARG_NAV_CHILD = 'navChild';
    this.ARG_ACTIVE_TAB_INDEX = 'activeTabIndex';
    this.ARG_MAX_DATE_OF_BIRTH = 'maxDob';
    this.MASTER_SERVER_ROOT_ENTRY_UID = L_4103245208651563007;
  }
  UstadView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var UstadView$Companion_instance = null;
  function UstadView$Companion_getInstance() {
    if (UstadView$Companion_instance === null) {
      new UstadView$Companion();
    }
    return UstadView$Companion_instance;
  }
  UstadView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'UstadView', 
  interfaces: []};
  function UstadViewChoiceDialogListener(f) {
    this.function$ = f;
  }
  UstadViewChoiceDialogListener.prototype.onChoiceSelected_za3lpa$ = function(which) {
  return this.function$(which);
};
  UstadViewChoiceDialogListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'UstadViewChoiceDialogListener', 
  interfaces: []};
  function UstadViewWithProgressDialog() {
  }
  UstadViewWithProgressDialog.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'UstadViewWithProgressDialog', 
  interfaces: [UstadView]};
  function VerbEntityListView() {
    VerbEntityListView$Companion_getInstance();
  }
  function VerbEntityListView$Companion() {
    VerbEntityListView$Companion_instance = this;
    this.VIEW_NAME = 'VerbEntityListView';
    this.ARG_EXCLUDE_VERBUIDS_LIST = 'excludeAlreadySelectedList';
  }
  VerbEntityListView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var VerbEntityListView$Companion_instance = null;
  function VerbEntityListView$Companion_getInstance() {
    if (VerbEntityListView$Companion_instance === null) {
      new VerbEntityListView$Companion();
    }
    return VerbEntityListView$Companion_instance;
  }
  VerbEntityListView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'VerbEntityListView', 
  interfaces: [UstadListView]};
  function VideoContentView() {
    VideoContentView$Companion_getInstance();
  }
  function VideoContentView$Companion() {
    VideoContentView$Companion_instance = this;
    this.VIEW_NAME = 'VideoContentView';
  }
  VideoContentView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var VideoContentView$Companion_instance = null;
  function VideoContentView$Companion_getInstance() {
    if (VideoContentView$Companion_instance === null) {
      new VideoContentView$Companion();
    }
    return VideoContentView$Companion_instance;
  }
  VideoContentView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'VideoContentView', 
  interfaces: [UstadView]};
  function WebChunkView() {
    WebChunkView$Companion_getInstance();
  }
  function WebChunkView$Companion() {
    WebChunkView$Companion_instance = this;
    this.VIEW_NAME = 'WebChunkView';
  }
  WebChunkView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var WebChunkView$Companion_instance = null;
  function WebChunkView$Companion_getInstance() {
    if (WebChunkView$Companion_instance === null) {
      new WebChunkView$Companion();
    }
    return WebChunkView$Companion_instance;
  }
  WebChunkView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'WebChunkView', 
  interfaces: [UstadView]};
  function XapiPackageContentView() {
    XapiPackageContentView$Companion_getInstance();
  }
  function XapiPackageContentView$Companion() {
    XapiPackageContentView$Companion_instance = this;
    this.VIEW_NAME = 'XapiPackageContentView';
  }
  XapiPackageContentView$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var XapiPackageContentView$Companion_instance = null;
  function XapiPackageContentView$Companion_getInstance() {
    if (XapiPackageContentView$Companion_instance === null) {
      new XapiPackageContentView$Companion();
    }
    return XapiPackageContentView$Companion_instance;
  }
  XapiPackageContentView.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'XapiPackageContentView', 
  interfaces: [UstadView]};
  function HarContentPresenter(context, arguments_0, view, localHttp, di) {
    HarContentPresenterCommon.call(this, context, arguments_0, view, localHttp, di);
  }
  HarContentPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'HarContentPresenter', 
  interfaces: [HarContentPresenterCommon]};
  function SelectExtractFilePresenter(context, arguments_0, view, di) {
    SelectExtractFilePresenterCommon.call(this, context, arguments_0, view, di);
    var tmp$;
    this.json_2s7tke$_0 = Instance(this, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, SelectExtractFilePresenter$json_metadata);
  }
  var SelectExtractFilePresenter$json_metadata = new PropertyMetadata('json');
  Object.defineProperty(SelectExtractFilePresenter.prototype, 'json_0', {
  configurable: true, 
  get: function() {
  return this.json_2s7tke$_0.value;
}});
  function SelectExtractFilePresenter$extractMetadata$lambda(closure$uri) {
    return function() {
  return 'SelectExtractFilePresenter: Reading uri : ' + closure$uri;
};
  }
  function SelectExtractFilePresenter$extractMetadata$lambda_0(closure$uri) {
    return function() {
  return 'SelectExtractFilePresenter: starting upload : ' + closure$uri;
};
  }
  function SelectExtractFilePresenter$extractMetadata$lambda$lambda() {
    return 'SelectExtractFilePresenter: response ready ';
  }
  function SelectExtractFilePresenter$extractMetadata$lambda_1(closure$request, this$SelectExtractFilePresenter, closure$completeableMetadataResult) {
    return function(it) {
  if (closure$request.readyState === 4) {
    napier.Napier.d_9h2hdn$(void 0, void 0, SelectExtractFilePresenter$extractMetadata$lambda$lambda);
    var response = this$SelectExtractFilePresenter.json_0.decodeFromString_awif5v$(MetadataResult$Companion_getInstance().serializer(), closure$request.responseText);
    closure$completeableMetadataResult.complete_11rb$(response);
  }
  return Unit;
};
  }
  function Coroutine$extractMetadata_puj7f4$($this, uri_0, fileName_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.$this = $this;
    this.local$completeableMetadataResult = void 0;
    this.local$uri = uri_0;
    this.local$fileName = fileName_0;
  }
  Coroutine$extractMetadata_puj7f4$.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$extractMetadata_puj7f4$.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$extractMetadata_puj7f4$.prototype.constructor = Coroutine$extractMetadata_puj7f4$;
  Coroutine$extractMetadata_puj7f4$.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$completeableMetadataResult = CompletableDeferred();
        napier.Napier.d_9h2hdn$(void 0, void 0, SelectExtractFilePresenter$extractMetadata$lambda(this.local$uri));
        this.state_0 = 2;
        this.result_0 = await_0(window.fetch(this.local$uri), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        this.state_0 = 3;
        this.result_0 = await_0(this.result_0.blob(), this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var blob = this.result_0;
        napier.Napier.d_9h2hdn$(void 0, void 0, SelectExtractFilePresenter$extractMetadata$lambda_0(this.local$uri));
        var formData = new FormData();
        formData.append('file', blob, this.local$fileName);
        var request = new XMLHttpRequest();
        var endPoint = this.$this.accountManager.activeEndpoint.url + 'contentupload/upload';
        request.open('POST', endPoint);
        request.send(formData);
        request.onreadystatechange = SelectExtractFilePresenter$extractMetadata$lambda_1(request, this.$this, this.local$completeableMetadataResult);
        this.state_0 = 4;
        this.result_0 = this.local$completeableMetadataResult.await(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 4:
        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);
};
  SelectExtractFilePresenter.prototype.extractMetadata_puj7f4$ = function(uri_0, fileName_0, continuation_0, suspended) {
  var instance = new Coroutine$extractMetadata_puj7f4$(this, uri_0, fileName_0, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  SelectExtractFilePresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'SelectExtractFilePresenter', 
  interfaces: [SelectExtractFilePresenterCommon]};
  function get$lambda_3($receiver) {
    return Unit;
  }
  function VideoContentPresenter(context, arguments_0, view, di) {
    VideoContentPresenterCommon.call(this, context, arguments_0, view, di);
    var tmp$;
    this.httpClient_j2ejeo$_0 = Instance(di, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(HttpClient), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, VideoContentPresenter$httpClient_metadata);
    var tmp$_0;
    this.mountHandler_s6cmki$_0 = Instance(this, Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(ContainerMounter), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, VideoContentPresenter$mountHandler_metadata);
  }
  var VideoContentPresenter$httpClient_metadata = new PropertyMetadata('httpClient');
  Object.defineProperty(VideoContentPresenter.prototype, 'httpClient_0', {
  configurable: true, 
  get: function() {
  return this.httpClient_j2ejeo$_0.value;
}});
  var VideoContentPresenter$mountHandler_metadata = new PropertyMetadata('mountHandler');
  Object.defineProperty(VideoContentPresenter.prototype, 'mountHandler_0', {
  configurable: true, 
  get: function() {
  return this.mountHandler_s6cmki$_0.value;
}});
  function Coroutine$VideoContentPresenter$handleOnResume$lambda(this$VideoContentPresenter_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 7;
    this.local$this$VideoContentPresenter = this$VideoContentPresenter_0;
    this.local$baseMountUrl = void 0;
    this.local$response = void 0;
  }
  Coroutine$VideoContentPresenter$handleOnResume$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$VideoContentPresenter$handleOnResume$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$VideoContentPresenter$handleOnResume$lambda.prototype.constructor = Coroutine$VideoContentPresenter$handleOnResume$lambda;
  Coroutine$VideoContentPresenter$handleOnResume$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2;
        this.state_0 = 1;
        this.result_0 = this.local$this$VideoContentPresenter.mountHandler_0.mountContainer_dckg8j$(this.local$this$VideoContentPresenter.accountManager.activeAccount.endpointUrl, this.local$this$VideoContentPresenter.containerUid_8be2vx$, void 0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        this.local$baseMountUrl = this.result_0;
        var $receiver_0 = this.local$this$VideoContentPresenter.httpClient_0;
        var urlString = UMFileUtil_getInstance().joinPaths_vqirvp$([this.local$baseMountUrl, '/videoParams']);
        var host_0;
        var body_0;
        host_0 = 'localhost';
        body_0 = utils.EmptyContent;
        var $receiver_1 = new HttpRequestBuilder_init();
        url_0($receiver_1, 'http', host_0, 0, '/');
        $receiver_1.method = HttpMethod.Companion.Get;
        $receiver_1.body = body_0;
        takeFrom_0($receiver_1.url, urlString);
        get$lambda_3($receiver_1);
        var $this_0 = new HttpStatement($receiver_1, $receiver_0);
        var tmp$_4, tmp$_5, tmp$_6;
        tmp$_4 = PrimitiveClasses$stringClass;
        if (equals(tmp$_4, getKClass(HttpStatement))) {
          this.result_0 = typeof (tmp$_5 = $this_0) === 'string' ? tmp$_5 : throwCCE();
          this.state_0 = 10;
          continue;
        } else {
          if (equals(tmp$_4, getKClass(HttpResponse))) {
            this.state_0 = 8;
            this.result_0 = $this_0.execute(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 2;
            this.result_0 = $this_0.executeUnsafe(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          }
        }
      case 2:
        this.local$response = this.result_0;
        this.exceptionState_0 = 5;
        var tmp$_7;
        var tmp$_8 = this.local$response.call;
        var typeInfo$result_0;
        typeInfo$break:
          do {
            try {
              typeInfo$result_0 = typeInfoImpl(reflect.JsType, PrimitiveClasses$stringClass, createKType(PrimitiveClasses$stringClass, [], false));
            }            catch (_) {
  typeInfo$result_0 = typeInfoImpl(reflect.JsType, PrimitiveClasses$stringClass, null);
  break typeInfo$break;
}
          } while (false);
        this.state_0 = 3;
        this.result_0 = tmp$_8.receive_qi9ur9$(typeInfo$result_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        this.result_0 = typeof (tmp$_7 = this.result_0) === 'string' ? tmp$_7 : throwCCE();
        this.exceptionState_0 = 7;
        this.finallyPath_0 = [4];
        this.state_0 = 6;
        continue;
      case 4:
        this.state_0 = 9;
        continue;
      case 5:
        this.finallyPath_0 = [7];
        this.state_0 = 6;
        continue;
      case 6:
        this.exceptionState_0 = 7;
        complete(this.local$response);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 7:
        throw this.exception_0;
      case 8:
        this.result_0 = typeof (tmp$_6 = this.result_0) === 'string' ? tmp$_6 : throwCCE();
        this.state_0 = 9;
        continue;
      case 9:
        this.state_0 = 10;
        continue;
      case 10:
        this.result_0;
        var videoContent = this.result_0;
        var params = JSON.parse(videoContent);
        var videoPath = UMFileUtil_getInstance().joinPaths_vqirvp$([this.local$baseMountUrl, (tmp$ = params.videoPath) != null ? tmp$ : '']);
        var audioPath = null;
        if (!equals((tmp$_0 = params.audioPath) != null ? tmp$_0.ceUid : null, L0)) {
          audioPath = ContainerEntryWithContainerEntryFile_init((tmp$_2 = (tmp$_1 = params.audioPath) != null ? tmp$_1.cePath : null) != null ? tmp$_2 : '');
        }
        this.local$this$VideoContentPresenter.view.videoParams = new VideoContentPresenterCommon$VideoParams(videoPath, audioPath, params.srtLangList, params.srtMap);
        return this.local$this$VideoContentPresenter.view.loading = false , Unit;
      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);
};
  function VideoContentPresenter$handleOnResume$lambda(this$VideoContentPresenter_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$VideoContentPresenter$handleOnResume$lambda(this$VideoContentPresenter_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  VideoContentPresenter.prototype.handleOnResume = function() {
  launch(coroutines.GlobalScope, void 0, void 0, VideoContentPresenter$handleOnResume$lambda(this));
};
  VideoContentPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'VideoContentPresenter', 
  interfaces: [VideoContentPresenterCommon]};
  function get$lambda_4($receiver) {
    return Unit;
  }
  function WebChunkPresenter(context, arguments_0, view, di) {
    WebChunkPresenterCommon.call(this, context, arguments_0, view, di);
    var tmp$;
    this.httpClient_2rz8t7$_0 = Instance(di, Kotlin.isType(tmp$ = typeToken(createKType(getKClass(HttpClient), [], false)), TypeToken) ? tmp$ : throwCCE(), null).provideDelegate_tpuvb9$(this, WebChunkPresenter$httpClient_metadata);
    var tmp$_0;
    this.mountHandler_fd9ms9$_0 = Instance(this, Kotlin.isType(tmp$_0 = typeToken(createKType(getKClass(ContainerMounter), [], false)), TypeToken) ? tmp$_0 : throwCCE(), null).provideDelegate_tpuvb9$(this, WebChunkPresenter$mountHandler_metadata);
    var tmp$_1;
    this.systemImpl_e5tokp$_0 = Instance(this, Kotlin.isType(tmp$_1 = typeToken(createKType(getKClass(UstadMobileSystemImpl), [], false)), TypeToken) ? tmp$_1 : throwCCE(), null).provideDelegate_tpuvb9$(this, WebChunkPresenter$systemImpl_metadata);
  }
  var WebChunkPresenter$httpClient_metadata = new PropertyMetadata('httpClient');
  Object.defineProperty(WebChunkPresenter.prototype, 'httpClient_0', {
  configurable: true, 
  get: function() {
  return this.httpClient_2rz8t7$_0.value;
}});
  var WebChunkPresenter$mountHandler_metadata = new PropertyMetadata('mountHandler');
  Object.defineProperty(WebChunkPresenter.prototype, 'mountHandler_0', {
  configurable: true, 
  get: function() {
  return this.mountHandler_fd9ms9$_0.value;
}});
  var WebChunkPresenter$systemImpl_metadata = new PropertyMetadata('systemImpl');
  Object.defineProperty(WebChunkPresenter.prototype, 'systemImpl_0', {
  configurable: true, 
  get: function() {
  return this.systemImpl_e5tokp$_0.value;
}});
  function Coroutine$handleMountChunk($this, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 9;
    this.$this = $this;
    this.local$response = void 0;
  }
  Coroutine$handleMountChunk.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$handleMountChunk.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$handleMountChunk.prototype.constructor = Coroutine$handleMountChunk;
  Coroutine$handleMountChunk.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3;
        this.state_0 = 1;
        this.result_0 = this.$this.repo.containerDao.findByUidAsync_s8cxhz$((tmp$ = this.$this.containerUid_8be2vx$) != null ? tmp$ : L0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        var container = this.result_0;
        if (container == null) {
          this.$this.view.showSnackBar_9pu0dj$(this.$this.systemImpl_0.getString(2027, this.$this));
          return;
        } else {
          this.state_0 = 2;
          continue;
        }
      case 2:
        this.state_0 = 3;
        this.result_0 = this.$this.mountHandler_0.mountContainer_dckg8j$(this.$this.accountManager.activeAccount.endpointUrl, (tmp$_0 = this.$this.containerUid_8be2vx$) != null ? tmp$_0 : L0, void 0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 3:
        var baseMountUrl = this.result_0;
        var $receiver_0 = this.$this.httpClient_0;
        var urlString = UMFileUtil_getInstance().joinPaths_vqirvp$([baseMountUrl, 'index.json']);
        var host_0;
        var body_0;
        host_0 = 'localhost';
        body_0 = utils.EmptyContent;
        var $receiver_1 = new HttpRequestBuilder_init();
        url_0($receiver_1, 'http', host_0, 0, '/');
        $receiver_1.method = HttpMethod.Companion.Get;
        $receiver_1.body = body_0;
        takeFrom_0($receiver_1.url, urlString);
        get$lambda_4($receiver_1);
        var $this_0 = new HttpStatement($receiver_1, $receiver_0);
        var tmp$_4, tmp$_5, tmp$_6;
        tmp$_4 = PrimitiveClasses$stringClass;
        if (equals(tmp$_4, getKClass(HttpStatement))) {
          this.result_0 = typeof (tmp$_5 = $this_0) === 'string' ? tmp$_5 : throwCCE();
          this.state_0 = 12;
          continue;
        } else {
          if (equals(tmp$_4, getKClass(HttpResponse))) {
            this.state_0 = 10;
            this.result_0 = $this_0.execute(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          } else {
            this.state_0 = 4;
            this.result_0 = $this_0.executeUnsafe(this);
            if (this.result_0 === COROUTINE_SUSPENDED) 
              return COROUTINE_SUSPENDED;
            continue;
          }
        }
      case 4:
        this.local$response = this.result_0;
        this.exceptionState_0 = 7;
        var tmp$_7;
        var tmp$_8 = this.local$response.call;
        var typeInfo$result_0;
        typeInfo$break:
          do {
            try {
              typeInfo$result_0 = typeInfoImpl(reflect.JsType, PrimitiveClasses$stringClass, createKType(PrimitiveClasses$stringClass, [], false));
            }            catch (_) {
  typeInfo$result_0 = typeInfoImpl(reflect.JsType, PrimitiveClasses$stringClass, null);
  break typeInfo$break;
}
          } while (false);
        this.state_0 = 5;
        this.result_0 = tmp$_8.receive_qi9ur9$(typeInfo$result_0, this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 5:
        this.result_0 = typeof (tmp$_7 = this.result_0) === 'string' ? tmp$_7 : throwCCE();
        this.exceptionState_0 = 9;
        this.finallyPath_0 = [6];
        this.state_0 = 8;
        continue;
      case 6:
        this.state_0 = 11;
        continue;
      case 7:
        this.finallyPath_0 = [9];
        this.state_0 = 8;
        continue;
      case 8:
        this.exceptionState_0 = 9;
        complete(this.local$response);
        this.state_0 = this.finallyPath_0.shift();
        continue;
      case 9:
        throw this.exception_0;
      case 10:
        this.result_0 = typeof (tmp$_6 = this.result_0) === 'string' ? tmp$_6 : throwCCE();
        this.state_0 = 11;
        continue;
      case 11:
        this.state_0 = 12;
        continue;
      case 12:
        this.result_0;
        var indexContent = this.result_0;
        var indexLog = JSON.parse(indexContent);
        this.$this.view.url = (tmp$_3 = (tmp$_2 = (tmp$_1 = indexLog.entries) != null ? tmp$_1.get_za3lpa$(0) : null) != null ? tmp$_2.url : null) != null ? tmp$_3 : '';
        this.$this.view.loading = false;
        return;
      default:
        this.state_0 = 9;
        throw new Error('State Machine Unreachable execution');
    }
  }  catch (e) {
  if (this.state_0 === 9) {
    this.exceptionState_0 = this.state_0;
    throw e;
  } else {
    this.state_0 = this.exceptionState_0;
    this.exception_0 = e;
  }
} while (true);
};
  WebChunkPresenter.prototype.handleMountChunk = function(continuation_0, suspended) {
  var instance = new Coroutine$handleMountChunk(this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  WebChunkPresenter.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'WebChunkPresenter', 
  interfaces: [WebChunkPresenterCommon]};
  function ContainerStorageManager(endpoint, di) {
    this.storages_0 = ArrayList_init();
    var storage = StorageUtil_getInstance().getStorage();
    var times = storage.length;
    for (var index = 0; index < times; index++) {
      this.storages_0.add_11rb$(new ContainerStorageDir('/'));
    }
  }
  Object.defineProperty(ContainerStorageManager.prototype, 'storageList', {
  configurable: true, 
  get: function() {
  return this.storages_0;
}});
  ContainerStorageManager.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContainerStorageManager', 
  interfaces: []};
  function getOs() {
    var tmp$;
    var userAgent = window.navigator.userAgent;
    var platform = window.navigator.platform;
    var macosPlatforms = listOf(['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K']);
    var windowsPlatforms = listOf(['Win32', 'Win64', 'Windows', 'WinCE']);
    var iosPlatforms = listOf(['iPhone', 'iPad', 'iPod']);
    if (macosPlatforms.indexOf_11rb$(platform) !== -1) 
      tmp$ = 'Mac OS';
    else if (iosPlatforms.indexOf_11rb$(platform) !== -1) 
      tmp$ = 'iOS';
    else if (windowsPlatforms.indexOf_11rb$(platform) !== -1) 
      tmp$ = 'Windows';
    else {
      var tmp$_0;
      if (typeof (tmp$_0 = /Android/.test(userAgent)) === 'boolean' ? tmp$_0 : throwCCE()) 
        tmp$ = 'Android';
      else 
        tmp$ = 'Linux';
    }
    return tmp$;
  }
  function getOsVersion() {
    return getOs() + '-unknown';
  }
  function UstadMobileSystemImpl(xppFactory, navController, defaultStringsXmlStr, displayLocaleStringsXmlStr) {
    UstadMobileSystemImpl$Companion_getInstance();
    UstadMobileSystemCommon.call(this);
    this.xppFactory_no9bj9$_0 = xppFactory;
    this.navController_fs6o2$_0 = navController;
    this.messageIdMapFlipped_dv2r8r$_db0j30$_0 = lazy(UstadMobileSystemImpl$messageIdMapFlipped$lambda);
    this.defaultStringsXml_8d1izr$_0 = null;
    this.displayLocaleStringsXml_mp424$_0 = null;
    var tmp$;
    var defaultXpp = this.xppFactory_no9bj9$_0.newPullParser();
    setInputString(defaultXpp, defaultStringsXmlStr);
    this.defaultStringsXml_8d1izr$_0 = new StringsXml(defaultXpp, this.xppFactory_no9bj9$_0, this.messageIdMapFlipped_dv2r8r$_0, 'en');
    if (displayLocaleStringsXmlStr != null) {
      var foreignXpp = this.xppFactory_no9bj9$_0.newPullParser();
      setInputString(foreignXpp, displayLocaleStringsXmlStr);
      tmp$ = new StringsXml(foreignXpp, this.xppFactory_no9bj9$_0, this.messageIdMapFlipped_dv2r8r$_0, UstadMobileSystemImpl$Companion_getInstance().displayedLocale, this.defaultStringsXml_8d1izr$_0);
    } else {
      tmp$ = null;
    }
    this.displayLocaleStringsXml_mp424$_0 = tmp$;
  }
  Object.defineProperty(UstadMobileSystemImpl.prototype, 'messageIdMapFlipped_dv2r8r$_0', {
  configurable: true, 
  get: function() {
  return this.messageIdMapFlipped_dv2r8r$_db0j30$_0.value;
}});
  UstadMobileSystemImpl.prototype.getString = function(messageCode, context) {
  var tmp$;
  return ((tmp$ = this.displayLocaleStringsXml_mp424$_0) != null ? tmp$ : this.defaultStringsXml_8d1izr$_0).get_za3lpa$(messageCode);
};
  UstadMobileSystemImpl.prototype.getSystemLocale = function(context) {
  return UstadMobileSystemImpl$Companion_getInstance().systemLocale_0;
};
  UstadMobileSystemImpl.prototype.getAppPref = function(key, context) {
  return localStorage.getItem(key);
};
  UstadMobileSystemImpl.prototype.getAppSetupFile = function(context, zip, continuation) {
  throw new NotImplementedError_init('An operation is not implemented: ' + 'not implemented');
};
  UstadMobileSystemImpl.prototype.setAppPref_5pkmrg$ = function(key, value, context) {
  if (value == null) {
    localStorage.removeItem(key);
  } else {
    localStorage.setItem(key, value);
  }
};
  UstadMobileSystemImpl.prototype.getVersion_za3rmp$ = function(context) {
  return '';
};
  UstadMobileSystemImpl.prototype.getBuildTimestamp_za3rmp$ = function(context) {
  return Kotlin.Long.fromNumber((new Date()).getTime());
};
  UstadMobileSystemImpl.prototype.getAppConfigString = function(key, defaultVal, context) {
  var value = localStorage.getItem(key);
  return value != null ? value : defaultVal;
};
  function Coroutine$UstadMobileSystemImpl$openFileInDefaultViewer$lambda(closure$aElement_0, closure$doorUri_0, closure$fileName_0, $receiver_0, controller, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.$controller = controller;
    this.exceptionState_0 = 1;
    this.local$closure$aElement = closure$aElement_0;
    this.local$closure$doorUri = closure$doorUri_0;
    this.local$closure$fileName = closure$fileName_0;
  }
  Coroutine$UstadMobileSystemImpl$openFileInDefaultViewer$lambda.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$UstadMobileSystemImpl$openFileInDefaultViewer$lambda.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$UstadMobileSystemImpl$openFileInDefaultViewer$lambda.prototype.constructor = Coroutine$UstadMobileSystemImpl$openFileInDefaultViewer$lambda;
  Coroutine$UstadMobileSystemImpl$openFileInDefaultViewer$lambda.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.local$closure$aElement.style.display = 'none';
        this.local$closure$aElement.href = this.local$closure$doorUri.toString();
        if (this.local$closure$fileName != null) {
          var $receiver = this.local$closure$fileName;
          this.local$closure$aElement.download = $receiver;
        }
        return this.local$closure$aElement.click() , Unit;
      case 1:
        throw this.exception_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 UstadMobileSystemImpl$openFileInDefaultViewer$lambda(closure$aElement_0, closure$doorUri_0, closure$fileName_0) {
    return function($receiver_0, continuation_0, suspended) {
  var instance = new Coroutine$UstadMobileSystemImpl$openFileInDefaultViewer$lambda(closure$aElement_0, closure$doorUri_0, closure$fileName_0, $receiver_0, this, continuation_0);
  if (suspended) 
    return instance;
  else 
    return instance.doResume(null);
};
  }
  UstadMobileSystemImpl.prototype.openFileInDefaultViewer_t9zcln$$default = function(context, doorUri, mimeType, fileName) {
  var tmp$;
  var aElement = Kotlin.isType(tmp$ = document.createElement('a'), HTMLAnchorElement) ? tmp$ : throwCCE();
  launch(coroutines.GlobalScope, void 0, void 0, UstadMobileSystemImpl$openFileInDefaultViewer$lambda(aElement, doorUri, fileName));
};
  UstadMobileSystemImpl.prototype.go = function(viewName, args, context, flags, ustadGoOptions) {
  var tmp$;
  this.navController_fs6o2$_0.navigate_oc2wlg$(viewName, Kotlin.isType(tmp$ = args, Map) ? tmp$ : throwCCE(), ustadGoOptions);
};
  UstadMobileSystemImpl.prototype.popBack_i9f55q$ = function(popUpToViewName, popUpInclusive, context) {
  this.navController_fs6o2$_0.popBackStack_ivxn3r$(popUpToViewName, popUpInclusive);
};
  UstadMobileSystemImpl.prototype.openLinkInBrowser_bm4g0d$ = function(url, context) {
  window.open(url, '_blank');
};
  UstadMobileSystemImpl.prototype.isRtlActive = function() {
  return contains_0(UstadMobileConstants_getInstance().RTL_LANGUAGES, UstadMobileSystemImpl$Companion_getInstance().displayedLocale);
};
  function UstadMobileSystemImpl$Companion() {
    UstadMobileSystemImpl$Companion_instance = this;
  }
  Object.defineProperty(UstadMobileSystemImpl$Companion.prototype, 'systemLocale_0', {
  configurable: true, 
  get: function() {
  return window.navigator.language + '.UTF-8';
}});
  Object.defineProperty(UstadMobileSystemImpl$Companion.prototype, 'displayedLocale', {
  configurable: true, 
  get: function() {
  var tmp$, tmp$_0;
  var localePref = (tmp$ = localStorage.getItem(UstadMobileSystemCommon$Companion_getInstance().PREFKEY_LOCALE)) != null ? tmp$ : UstadMobileSystemCommon$Companion_getInstance().LOCALE_USE_SYSTEM;
  if (equals(localePref, UstadMobileSystemCommon$Companion_getInstance().LOCALE_USE_SYSTEM)) {
    tmp$_0 = this.systemLocale_0.substring(0, 2);
  } else {
    tmp$_0 = localePref;
  }
  return tmp$_0;
}});
  UstadMobileSystemImpl$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var UstadMobileSystemImpl$Companion_instance = null;
  function UstadMobileSystemImpl$Companion_getInstance() {
    if (UstadMobileSystemImpl$Companion_instance === null) {
      new UstadMobileSystemImpl$Companion();
    }
    return UstadMobileSystemImpl$Companion_instance;
  }
  function UstadMobileSystemImpl$messageIdMapFlipped$lambda() {
    var $receiver = MessageIdMap_getInstance().idMap.entries;
    var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault($receiver, 10)), 16);
    var destination = LinkedHashMap_init_0(capacity);
    var tmp$;
    tmp$ = $receiver.iterator();
    while (tmp$.hasNext()) {
      var element = tmp$.next();
      var k = element.key;
      var v = element.value;
      var pair = to(v, k);
      destination.put_xwzc9p$(pair.first, pair.second);
    }
    return destination;
  }
  UstadMobileSystemImpl.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UstadMobileSystemImpl', 
  interfaces: [UstadMobileSystemCommon]};
  function getStringFromContainerEntry($receiver, continuation) {
    throw new NotImplementedError_init('An operation is not implemented: ' + 'Not yet implemented');
  }
  function getSize($receiver, context, di, continuation) {
    throw new NotImplementedError_init('An operation is not implemented: ' + 'Not yet implemented');
  }
  function guessMimeType($receiver, context, di, continuation) {
    var tmp$, tmp$_0;
    return (tmp$_0 = (tmp$ = DoorUri.Companion.getDoorUriProps_61zpoe$($receiver.uri.toString())) != null ? tmp$.mimeType : null) != null ? tmp$_0 : 'application/octet-stream';
  }
  function downloadUrlIfRemote($receiver, destination, di, continuation) {
    throw new NotImplementedError_init('An operation is not implemented: ' + 'Not yet implemented');
  }
  function isRemote($receiver, continuation) {
    var prefix = substringBefore($receiver.uri.toString(), '//').toLowerCase();
    return startsWith(prefix, 'http:') || startsWith(prefix, 'https:');
  }
  function emptyRecursively($receiver, continuation) {
    throw new NotImplementedError_init('An operation is not implemented: ' + 'Not yet implemented');
  }
  function deleteRecursively($receiver, continuation) {
    throw new NotImplementedError_init('An operation is not implemented: ' + 'Not yet implemented');
  }
  function addDirToContainer($receiver, containerUid, dirUri, recursive, context, di, addOptions, continuation) {
    if (recursive === void 0) 
      recursive = true;
  }
  function addFileToContainer($receiver, containerUid, fileUri, pathInContainer, context, di, addOptions, continuation) {
  }
  function addEntriesToContainerFromZip($receiver, containerUid, zipUri, addOptions, context, continuation) {
  }
  function NavControllerJs(ustadUrlDivider, storagePrefix, json) {
    NavControllerJs$Companion_getInstance();
    if (ustadUrlDivider === void 0) 
      ustadUrlDivider = UstadUrlComponents$Companion_getInstance().DEFAULT_DIVIDER;
    if (storagePrefix === void 0) 
      storagePrefix = 'ustadnav_';
    this.ustadUrlDivider_0 = ustadUrlDivider;
    this.storagePrefix_0 = storagePrefix;
    this.json_0 = json;
    this.logPrefix_0 = 'NavControllerJs: ';
    this.navStack_0 = ArrayList_init();
    this.pendingNavigation_0 = null;
    this.hashChangeListener_0 = NavControllerJs$hashChangeListener$lambda(this);
    var tmp$, tmp$_0, tmp$_1;
    napier.Napier.d_82mfvz$('NavControllerJs: : init');
    var storedStackSize = (tmp$_0 = (tmp$ = sessionStorage.getItem(this.storagePrefix_0 + '.' + NavControllerJs$Companion_getInstance().SUBKEY_STACKSIZE_0)) != null ? toInt(tmp$) : null) != null ? tmp$_0 : 0;
    if (storedStackSize !== 0) {
      napier.Napier.d_82mfvz$('NavControllerJs: : loading stack from session storage');
      for (var i = 0; i < storedStackSize; i++) {
        this.navStack_0.add_11rb$(UstadBackStackEntryJs$Companion_getInstance().loadFromSessionStorage_rrylbp$(this.storagePrefix_0 + '.' + NavControllerJs$Companion_getInstance().SUBKEY_STACKITEMS_0 + '.' + i, this.json_0));
      }
    }
    napier.Napier.d_82mfvz$('NavControllerJs: : creating new stack');
    var initUrlComponents;
    try {
      initUrlComponents = UstadUrlComponents$Companion_getInstance().parse_puj7f4$(window.location.href, this.ustadUrlDivider_0);
    }    catch (e) {
  if (Kotlin.isType(e, Exception)) {
    initUrlComponents = new UstadUrlComponents(window.location.href, RedirectView$Companion_getInstance().VIEW_NAME, '');
  } else 
    throw e;
}
    if (!equals((tmp$_1 = lastOrNull(this.navStack_0)) != null ? tmp$_1.jsViewUri_8be2vx$ : null, initUrlComponents.viewUri)) {
      var $receiver = this.navStack_0;
      var element = new UstadBackStackEntryJs(initUrlComponents.viewName, initUrlComponents.arguments, initUrlComponents.viewUri, this.storagePrefix_0 + '.' + NavControllerJs$Companion_getInstance().SUBKEY_STACKITEMS_0 + '.' + this.navStack_0.size, this.json_0);
      $receiver.add_11rb$(element);
      this.set_stateIndex_0(window.history, this.navStack_0.size - 1 | 0);
      this.saveStackSizeAndIndex_0();
    }
    napier.Napier.d_82mfvz$(this.logPrefix_0 + ': init: navStack = ' + this.dumpNavStackToString_0());
    window.addEventListener('hashchange', this.hashChangeListener_0);
  }
  function NavControllerJs$get_NavControllerJs$currentStackIndex$lambda() {
    return 'NavControllerJs: current location is not yet an ustadurl ';
  }
  Object.defineProperty(NavControllerJs.prototype, 'currentStackIndex_0', {
  configurable: true, 
  get: function() {
  var historyStateIndex = this.get_stateIndex_0(window.history);
  if (historyStateIndex !== -1) {
    return historyStateIndex;
  } else {
    try {
      var currentViewUri = UstadUrlComponents$Companion_getInstance().parse_puj7f4$(window.location.href, this.ustadUrlDivider_0).viewUri;
      var $receiver = this.navStack_0;
      var indexOfLast$result;
      indexOfLast$break:
        do {
          var iterator = $receiver.listIterator_za3lpa$($receiver.size);
          while (iterator.hasPrevious()) {
            if (equals(iterator.previous().jsViewUri_8be2vx$, currentViewUri)) {
              indexOfLast$result = iterator.nextIndex();
              break indexOfLast$break;
            }
          }
          indexOfLast$result = -1;
        } while (false);
      var index = indexOfLast$result;
      napier.Napier.d_82mfvz$('NavControllerJs: CurrentStackIndex index=' + index);
      return index;
    }    catch (e) {
  if (Kotlin.isType(e, IllegalArgumentException)) {
    napier.Napier.d_9h2hdn$(e, void 0, NavControllerJs$get_NavControllerJs$currentStackIndex$lambda);
    return -1;
  } else 
    throw e;
}
  }
}});
  NavControllerJs.prototype.get_stateIndex_0 = function($receiver) {
  var currentState = $receiver.state;
  var stackIndex = $receiver.state != null ? currentState.stateIndex : -1;
  var stackIndexVal = stackIndex != undefined ? stackIndex : -1;
  return stackIndexVal;
};
  NavControllerJs.prototype.set_stateIndex_0 = function($receiver, value) {
  var tmp$;
  var tmp$_0;
  if ((tmp$ = $receiver.state) != null) 
    tmp$_0 = tmp$;
  else {
    var $receiver_0 = {};
    tmp$_0 = $receiver_0;
  }
  var newStateObj = tmp$_0;
  newStateObj.stateIndex = value;
  window.history.replaceState(newStateObj, '');
};
  NavControllerJs.prototype.saveStackSizeAndIndex_0 = function() {
  sessionStorage.setItem(this.storagePrefix_0 + '.' + NavControllerJs$Companion_getInstance().SUBKEY_STACKSIZE_0, this.navStack_0.size.toString());
  sessionStorage.setItem(this.storagePrefix_0 + '.' + NavControllerJs$Companion_getInstance().SUBKEY_STACKINDEX_0, this.currentStackIndex_0.toString());
};
  Object.defineProperty(NavControllerJs.prototype, 'currentBackStackEntry', {
  configurable: true, 
  get: function() {
  return getOrNull(this.navStack_0, this.currentStackIndex_0);
}});
  NavControllerJs.prototype.dumpNavStackToString_0 = function() {
  var stackIndexVal = this.currentStackIndex_0;
  var $receiver = this.navStack_0;
  var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
  var tmp$, tmp$_0;
  var index = 0;
  tmp$ = $receiver.iterator();
  while (tmp$.hasNext()) {
    var item = tmp$.next();
    var tmp$_1 = destination.add_11rb$;
    var transform$result;
    if (checkIndexOverflow((tmp$_0 = index , index = tmp$_0 + 1 | 0 , tmp$_0)) === stackIndexVal) {
      transform$result = '*' + item.viewName + '*';
    } else {
      transform$result = item.viewName;
    }
    tmp$_1.call(destination, transform$result);
  }
  return '(' + joinToString(destination) + (' index=' + stackIndexVal + ')');
};
  NavControllerJs.prototype.popOffNavStackFrom_0 = function(index) {
  for (var i = this.navStack_0.size - 1 | 0; i >= index; i--) {
    var currentEntry = this.navStack_0.get_za3lpa$(i);
    this.navStack_0.removeAt_za3lpa$(i);
    napier.Napier.d_82mfvz$(this.logPrefix_0 + ': remove ' + currentEntry.viewName);
  }
};
  NavControllerJs.prototype.stackStorageKey_0 = function(index) {
  return this.storagePrefix_0 + '.' + NavControllerJs$Companion_getInstance().SUBKEY_STACKITEMS_0 + '.' + this.navStack_0.size;
};
  NavControllerJs.prototype.handleHashChange_9lovpo$ = function(newUrl, oldUrl) {
  try {
    var newStackIndexVal = this.get_stateIndex_0(window.history);
    if (newStackIndexVal === -1) {
      this.set_stateIndex_0(window.history, this.navStack_0.size - 1 | 0);
      napier.Napier.d_82mfvz$(this.logPrefix_0 + ': user went forwards to ' + newUrl + ' . ' + ('stack=(' + this.dumpNavStackToString_0() + ')'));
    } else {
      napier.Napier.d_82mfvz$(this.logPrefix_0 + ': user went back. new stack = (' + this.dumpNavStackToString_0() + ')');
      var pendingNavVal = this.pendingNavigation_0;
      if (pendingNavVal != null) {
        this.pendingNavigation_0 = null;
        napier.Napier.d_82mfvz$(this.logPrefix_0 + ' : run pending navigation to ' + toString(pendingNavVal) + (' stack=' + this.dumpNavStackToString_0()));
        window.location.replace('#/' + toString(pendingNavVal));
      }
    }
  }  catch (e) {
  if (Kotlin.isType(e, Exception)) {
    napier.Napier.d_82mfvz$(this.logPrefix_0 + ' Not an ustad url: ignoring ' + newUrl);
  } else 
    throw e;
}
};
  NavControllerJs.prototype.getBackStackEntry_61zpoe$ = function(viewName) {
  var $receiver = this.navStack_0;
  var lastOrNull$result;
  lastOrNull$break:
    do {
      var iterator = $receiver.listIterator_za3lpa$($receiver.size);
      while (iterator.hasPrevious()) {
        var element = iterator.previous();
        if (equals(element.viewName, viewName)) {
          lastOrNull$result = element;
          break lastOrNull$break;
        }
      }
      lastOrNull$result = null;
    } while (false);
  return lastOrNull$result;
};
  NavControllerJs.prototype.calcNumStepsToGoBack_0 = function(viewName, inclusive) {
  var tmp$, tmp$_0, tmp$_1, tmp$_2, tmp$_3, tmp$_4, tmp$_5;
  switch (viewName) {
    case 'root':
      tmp$_3 = (tmp$_0 = (tmp$ = firstOrNull(this.navStack_0)) != null ? tmp$.viewName : null) != null ? tmp$_0 : RedirectView$Companion_getInstance().VIEW_NAME;
      break;
    case '':
      tmp$_3 = (tmp$_2 = (tmp$_1 = lastOrNull(this.navStack_0)) != null ? tmp$_1.viewName : null) != null ? tmp$_2 : RedirectView$Companion_getInstance().VIEW_NAME;
      break;
    default:
      tmp$_3 = viewName;
      break;
  }
  var resolvedPopViewname = tmp$_3;
  var navStackUpToCurrent = this.navStack_0.subList_vux9f0$(0, this.currentStackIndex_0 + 1 | 0);
  var indexOfLast$result;
  indexOfLast$break:
    do {
      var iterator = navStackUpToCurrent.listIterator_za3lpa$(navStackUpToCurrent.size);
      while (iterator.hasPrevious()) {
        if (equals(iterator.previous().viewName, resolvedPopViewname)) {
          indexOfLast$result = iterator.nextIndex();
          break indexOfLast$break;
        }
      }
      indexOfLast$result = -1;
    } while (false);
  var a = indexOfLast$result;
  var viewNameIndex = JsMath.max(a, 0);
  var deltaIndex = navStackUpToCurrent.size - 1 - viewNameIndex | 0;
  if (inclusive) {
    tmp$_4 = deltaIndex + 1 | 0;
  } else {
    tmp$_4 = deltaIndex;
  }
  tmp$_5 = navStackUpToCurrent.size;
  var a_0 = tmp$_4;
  return JsMath.min(a_0, tmp$_5);
};
  NavControllerJs.prototype.popBackStack_ivxn3r$ = function(viewName, inclusive) {
  var numToGoBack = this.calcNumStepsToGoBack_0(viewName, inclusive);
  napier.Napier.d_82mfvz$(this.logPrefix_0 + ": POPBACKSTACK to: '" + viewName + "' (inclusive = " + inclusive + ') ' + ('go back ' + numToGoBack + ' steps navStack=' + this.dumpNavStackToString_0()));
  if (numToGoBack !== 0) {
    window.history.go(numToGoBack * -1 | 0);
  }
};
  NavControllerJs.prototype.navigate_oc2wlg$$default = function(viewName, args, goOptions) {
  var tmp$, tmp$_0;
  napier.Napier.d_82mfvz$(this.logPrefix_0 + ' NAVIGATE to ' + viewName + " popUpTo='" + toString(goOptions.popUpToViewName) + "' " + ('(inclusive=' + goOptions.popUpToInclusive + ') Current Stack=' + this.dumpNavStackToString_0()));
  var popUpToViewName = goOptions.popUpToViewName;
  if (popUpToViewName != null) {
    tmp$ = this.calcNumStepsToGoBack_0(popUpToViewName, goOptions.popUpToInclusive);
  } else {
    tmp$ = 0;
  }
  var stepsToGoBack = tmp$;
  if (args.isEmpty()) 
    tmp$_0 = '';
  else 
    tmp$_0 = '?' + toUrlQueryString(args);
  var params = tmp$_0;
  var viewUri = viewName + params;
  var currentStackIndexVal = this.currentStackIndex_0;
  if (stepsToGoBack === 0) {
    this.popOffNavStackFrom_0(currentStackIndexVal + 1 | 0);
    var newBackStackEntry = new UstadBackStackEntryJs(viewName, args, viewUri, this.stackStorageKey_0(currentStackIndexVal + 1 | 0), this.json_0);
    this.navStack_0.add_11rb$(newBackStackEntry);
    this.saveStackSizeAndIndex_0();
    napier.Napier.d_82mfvz$('UstadNavController: navigate directly to #/' + viewUri + ' ' + ('navStack=' + this.dumpNavStackToString_0()));
    window.location.assign('#/' + viewUri);
  } else if (stepsToGoBack === 1) {
    sessionStorage.removeItem(this.stackStorageKey_0(currentStackIndexVal));
    this.navStack_0.set_wxm5ur$(this.currentStackIndex_0, new UstadBackStackEntryJs(viewName, args, viewUri, this.stackStorageKey_0(currentStackIndexVal), this.json_0));
    this.saveStackSizeAndIndex_0();
    napier.Napier.d_82mfvz$('UstadNavController: navigate using location.replace to #/' + viewUri + ' ' + ('navStack=' + this.dumpNavStackToString_0()));
    window.location.replace('#/' + viewUri);
  } else {
    this.pendingNavigation_0 = viewUri;
    this.popOffNavStackFrom_0(this.navStack_0.size - stepsToGoBack | 0);
    var $receiver = this.navStack_0;
    var element = new UstadBackStackEntryJs(viewName, args, viewUri, this.stackStorageKey_0(this.navStack_0.size), this.json_0);
    $receiver.add_11rb$(element);
    this.saveStackSizeAndIndex_0();
    napier.Napier.d_82mfvz$('UstadNavController: popoff, then navigate using replace. ' + ('Go ' + (stepsToGoBack - 1 | 0) + ' steps back first. navStack=' + this.dumpNavStackToString_0()));
    window.history.go(-(stepsToGoBack - 1 | 0) | 0);
  }
};
  NavControllerJs.prototype.navigateUp = function() {
  napier.Napier.d_82mfvz$('NavControllerJs: : NAVIGATEUP');
  window.history.go(-1);
  return true;
};
  NavControllerJs.prototype.unplug = function() {
  window.removeEventListener('hashchange', this.hashChangeListener_0);
};
  function NavControllerJs$Companion() {
    NavControllerJs$Companion_instance = this;
    this.SUBKEY_STACKITEMS_0 = 'stackitems';
    this.SUBKEY_STACKSIZE_0 = 'stacksize';
    this.SUBKEY_STACKINDEX_0 = 'stackindex';
  }
  NavControllerJs$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var NavControllerJs$Companion_instance = null;
  function NavControllerJs$Companion_getInstance() {
    if (NavControllerJs$Companion_instance === null) {
      new NavControllerJs$Companion();
    }
    return NavControllerJs$Companion_instance;
  }
  function NavControllerJs$hashChangeListener$lambda(this$NavControllerJs) {
    return function(it) {
  var tmp$;
  var hashEvt = Kotlin.isType(tmp$ = it, HashChangeEvent) ? tmp$ : throwCCE();
  console.log(this$NavControllerJs.logPrefix_0 + ': hashchange new=' + hashEvt.newURL + ' old=' + hashEvt.oldURL + ' ');
  this$NavControllerJs.handleHashChange_9lovpo$(hashEvt.newURL, hashEvt.oldURL);
  return Unit;
};
  }
  NavControllerJs.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'NavControllerJs', 
  interfaces: [UstadNavController]};
  function BackStackEntryInfo(viewName, arguments_0, jsViewUri, stateHandle) {
    BackStackEntryInfo$Companion_getInstance();
    this.viewName = viewName;
    this.arguments = arguments_0;
    this.jsViewUri = jsViewUri;
    this.stateHandle = stateHandle;
  }
  function BackStackEntryInfo$Companion() {
    BackStackEntryInfo$Companion_instance = this;
  }
  BackStackEntryInfo$Companion.prototype.serializer = function() {
  return BackStackEntryInfo$$serializer_getInstance();
};
  BackStackEntryInfo$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var BackStackEntryInfo$Companion_instance = null;
  function BackStackEntryInfo$Companion_getInstance() {
    if (BackStackEntryInfo$Companion_instance === null) {
      new BackStackEntryInfo$Companion();
    }
    return BackStackEntryInfo$Companion_instance;
  }
  function BackStackEntryInfo$$serializer() {
    this.descriptor_4xczin$_0 = new PluginGeneratedSerialDescriptor('com.ustadmobile.core.navigation.BackStackEntryInfo', this, 4);
    this.descriptor.addElement_ivxn3r$('viewName', false);
    this.descriptor.addElement_ivxn3r$('arguments', false);
    this.descriptor.addElement_ivxn3r$('jsViewUri', false);
    this.descriptor.addElement_ivxn3r$('stateHandle', false);
    BackStackEntryInfo$$serializer_instance = this;
  }
  Object.defineProperty(BackStackEntryInfo$$serializer.prototype, 'descriptor', {
  configurable: true, 
  get: function() {
  return this.descriptor_4xczin$_0;
}});
  BackStackEntryInfo$$serializer.prototype.serialize_55azsf$ = function(encoder, value) {
  var output = encoder.beginStructure_24f42q$(this.descriptor);
  output.encodeStringElement_iij8qq$(this.descriptor, 0, value.viewName);
  output.encodeSerializableElement_r4qlx7$(this.descriptor, 1, new LinkedHashMapSerializer(internal.StringSerializer, internal.StringSerializer), value.arguments);
  output.encodeStringElement_iij8qq$(this.descriptor, 2, value.jsViewUri);
  output.encodeSerializableElement_r4qlx7$(this.descriptor, 3, new LinkedHashMapSerializer(internal.StringSerializer, internal.StringSerializer), value.stateHandle);
  output.endStructure_24f42q$(this.descriptor);
};
  BackStackEntryInfo$$serializer.prototype.deserialize_bq71mq$ = function(decoder) {
  var index;
  var bitMask0 = 0;
  var local0, local1, local2, local3;
  var input = decoder.beginStructure_24f42q$(this.descriptor);
  loopLabel:
    while (true) {
      index = input.decodeElementIndex_24f42q$(this.descriptor);
      switch (index) {
        case 0:
          local0 = input.decodeStringElement_szpzho$(this.descriptor, 0);
          bitMask0 |= 1;
          break;
        case 1:
          local1 = input.decodeSerializableElement_12e8id$(this.descriptor, 1, new LinkedHashMapSerializer(internal.StringSerializer, internal.StringSerializer), local1);
          bitMask0 |= 2;
          break;
        case 2:
          local2 = input.decodeStringElement_szpzho$(this.descriptor, 2);
          bitMask0 |= 4;
          break;
        case 3:
          local3 = input.decodeSerializableElement_12e8id$(this.descriptor, 3, new LinkedHashMapSerializer(internal.StringSerializer, internal.StringSerializer), local3);
          bitMask0 |= 8;
          break;
        case -1:
          break loopLabel;
        default:
          throw new UnknownFieldException(index);
      }
    }
  input.endStructure_24f42q$(this.descriptor);
  return BackStackEntryInfo_init(bitMask0, local0, local1, local2, local3, null);
};
  BackStackEntryInfo$$serializer.prototype.childSerializers = function() {
  return [internal.StringSerializer, new LinkedHashMapSerializer(internal.StringSerializer, internal.StringSerializer), internal.StringSerializer, new LinkedHashMapSerializer(internal.StringSerializer, internal.StringSerializer)];
};
  BackStackEntryInfo$$serializer.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: '$serializer', 
  interfaces: [GeneratedSerializer]};
  var BackStackEntryInfo$$serializer_instance = null;
  function BackStackEntryInfo$$serializer_getInstance() {
    if (BackStackEntryInfo$$serializer_instance === null) {
      new BackStackEntryInfo$$serializer();
    }
    return BackStackEntryInfo$$serializer_instance;
  }
  function BackStackEntryInfo_init(seen1, viewName, arguments_0, jsViewUri, stateHandle, serializationConstructorMarker) {
    var $this = serializationConstructorMarker || Object.create(BackStackEntryInfo.prototype);
    if ((seen1 & 1) === 0) 
      throw MissingFieldException_init('viewName');
    else 
      $this.viewName = viewName;
    if ((seen1 & 2) === 0) 
      throw MissingFieldException_init('arguments');
    else 
      $this.arguments = arguments_0;
    if ((seen1 & 4) === 0) 
      throw MissingFieldException_init('jsViewUri');
    else 
      $this.jsViewUri = jsViewUri;
    if ((seen1 & 8) === 0) 
      throw MissingFieldException_init('stateHandle');
    else 
      $this.stateHandle = stateHandle;
    return $this;
  }
  BackStackEntryInfo.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'BackStackEntryInfo', 
  interfaces: []};
  BackStackEntryInfo.prototype.component1 = function() {
  return this.viewName;
};
  BackStackEntryInfo.prototype.component2 = function() {
  return this.arguments;
};
  BackStackEntryInfo.prototype.component3 = function() {
  return this.jsViewUri;
};
  BackStackEntryInfo.prototype.component4 = function() {
  return this.stateHandle;
};
  BackStackEntryInfo.prototype.copy_8hqv3o$ = function(viewName, arguments_0, jsViewUri, stateHandle) {
  return new BackStackEntryInfo(viewName === void 0 ? this.viewName : viewName, arguments_0 === void 0 ? this.arguments : arguments_0, jsViewUri === void 0 ? this.jsViewUri : jsViewUri, stateHandle === void 0 ? this.stateHandle : stateHandle);
};
  BackStackEntryInfo.prototype.toString = function() {
  return 'BackStackEntryInfo(viewName=' + Kotlin.toString(this.viewName) + (', arguments=' + Kotlin.toString(this.arguments)) + (', jsViewUri=' + Kotlin.toString(this.jsViewUri)) + (', stateHandle=' + Kotlin.toString(this.stateHandle)) + ')';
};
  BackStackEntryInfo.prototype.hashCode = function() {
  var result = 0;
  result = result * 31 + Kotlin.hashCode(this.viewName) | 0;
  result = result * 31 + Kotlin.hashCode(this.arguments) | 0;
  result = result * 31 + Kotlin.hashCode(this.jsViewUri) | 0;
  result = result * 31 + Kotlin.hashCode(this.stateHandle) | 0;
  return result;
};
  BackStackEntryInfo.prototype.equals = function(other) {
  return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.viewName, other.viewName) && Kotlin.equals(this.arguments, other.arguments) && Kotlin.equals(this.jsViewUri, other.jsViewUri) && Kotlin.equals(this.stateHandle, other.stateHandle)))));
};
  function UstadBackStackEntryJs(viewName, arguments_0, jsViewUri, storageKey, json, stateHandleValues, saveToStorageOnInit) {
    UstadBackStackEntryJs$Companion_getInstance();
    if (stateHandleValues === void 0) 
      stateHandleValues = null;
    if (saveToStorageOnInit === void 0) 
      saveToStorageOnInit = true;
    this.viewName_s1uxms$_0 = viewName;
    this.arguments_1jkc5m$_0 = arguments_0;
    this.jsViewUri_8be2vx$ = jsViewUri;
    this.storageKey_0 = storageKey;
    this.json_0 = json;
    this.savedStateHandle_s5k0xu$_0 = new UstadSavedStateHandleJs(stateHandleValues, this);
    if (saveToStorageOnInit) 
      this.saveToSessionStorage_0();
  }
  Object.defineProperty(UstadBackStackEntryJs.prototype, 'viewName', {
  get: function() {
  return this.viewName_s1uxms$_0;
}});
  Object.defineProperty(UstadBackStackEntryJs.prototype, 'arguments', {
  get: function() {
  return this.arguments_1jkc5m$_0;
}});
  Object.defineProperty(UstadBackStackEntryJs.prototype, 'savedStateHandle', {
  configurable: true, 
  get: function() {
  return this.savedStateHandle_s5k0xu$_0;
}});
  UstadBackStackEntryJs.prototype.onCommit = function() {
  this.saveToSessionStorage_0();
};
  UstadBackStackEntryJs.prototype.saveToSessionStorage_0 = function() {
  var tmp$;
  tmp$ = this.json_0;
  if (tmp$ == null) {
    throw IllegalStateException_init('StackEntry JSON is null');
  }
  var jsonVal = tmp$;
  var entryInfo = new BackStackEntryInfo(this.viewName, this.arguments, this.jsViewUri_8be2vx$, this.savedStateHandle.currentValues_8be2vx$);
  sessionStorage.setItem(this.storageKey_0, jsonVal.encodeToString_tf03ej$(BackStackEntryInfo$Companion_getInstance().serializer(), entryInfo));
};
  function UstadBackStackEntryJs$Companion() {
    UstadBackStackEntryJs$Companion_instance = this;
  }
  UstadBackStackEntryJs$Companion.prototype.loadFromSessionStorage_rrylbp$ = function(storageKey, json) {
  var tmp$;
  tmp$ = sessionStorage.getItem(storageKey);
  if (tmp$ == null) {
    throw IllegalStateException_init('loadFromSessionStorage: ' + storageKey + ' is empty');
  }
  var storedJson = tmp$;
  var storedEntry = json.decodeFromString_awif5v$(BackStackEntryInfo$Companion_getInstance().serializer(), storedJson);
  return new UstadBackStackEntryJs(storedEntry.viewName, storedEntry.arguments, storedEntry.jsViewUri, storageKey, json, storedEntry.stateHandle, false);
};
  UstadBackStackEntryJs$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var UstadBackStackEntryJs$Companion_instance = null;
  function UstadBackStackEntryJs$Companion_getInstance() {
    if (UstadBackStackEntryJs$Companion_instance === null) {
      new UstadBackStackEntryJs$Companion();
    }
    return UstadBackStackEntryJs$Companion_instance;
  }
  UstadBackStackEntryJs.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UstadBackStackEntryJs', 
  interfaces: [UstadSavedStateHandleJs$CommitListener, UstadBackStackEntry]};
  function UstadSavedStateHandleJs(initialValues, commitListener) {
    if (initialValues === void 0) 
      initialValues = null;
    if (commitListener === void 0) 
      commitListener = null;
    this.commitListener_0 = commitListener;
    this.mLiveData_8be2vx$ = LinkedHashMap_init();
    if (initialValues != null) {
      var tmp$;
      tmp$ = initialValues.entries.iterator();
      while (tmp$.hasNext()) {
        var element = tmp$.next();
        var $receiver = this.mLiveData_8be2vx$;
        var key = element.key;
        var value = DoorMutableLiveData_init_0(element.value);
        $receiver.put_xwzc9p$(key, value);
      }
    }
  }
  function UstadSavedStateHandleJs$CommitListener() {
  }
  UstadSavedStateHandleJs$CommitListener.$metadata$ = {
  kind: Kind_INTERFACE, 
  simpleName: 'CommitListener', 
  interfaces: []};
  Object.defineProperty(UstadSavedStateHandleJs.prototype, 'currentValues_8be2vx$', {
  configurable: true, 
  get: function() {
  var $receiver = this.mLiveData_8be2vx$;
  var destination = ArrayList_init_0($receiver.size);
  var tmp$;
  tmp$ = $receiver.entries.iterator();
  while (tmp$.hasNext()) {
    var item = tmp$.next();
    var tmp$_0, tmp$_1;
    destination.add_11rb$(to(item.key, (tmp$_1 = (tmp$_0 = item.value) != null ? tmp$_0.getValue() : null) != null ? tmp$_1.toString() : null));
  }
  var destination_0 = ArrayList_init();
  var tmp$_2;
  tmp$_2 = destination.iterator();
  while (tmp$_2.hasNext()) {
    var element = tmp$_2.next();
    if (element.second != null) 
      destination_0.add_11rb$(element);
  }
  var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(destination_0, 10)), 16);
  var destination_1 = LinkedHashMap_init_0(capacity);
  var tmp$_3;
  tmp$_3 = destination_0.iterator();
  while (tmp$_3.hasNext()) {
    var element_0 = tmp$_3.next();
    var pair = element_0;
    destination_1.put_xwzc9p$(pair.first, pair.second);
  }
  return destination_1;
}});
  UstadSavedStateHandleJs.prototype.set_umlfku$ = function(key, value) {
  var tmp$;
  var $receiver = this.mLiveData_8be2vx$;
  var value_0 = DoorMutableLiveData_init_0(value);
  $receiver.put_xwzc9p$(key, value_0);
    (tmp$ = this.commitListener_0) != null ? (tmp$.onCommit() , Unit) : null;
};
  UstadSavedStateHandleJs.prototype.get_ytbaoo$ = function(key) {
  var tmp$;
  return (tmp$ = this.mLiveData_8be2vx$.get_11rb$(key)) != null ? tmp$.getValue() : null;
};
  UstadSavedStateHandleJs.prototype.getLiveData_ytbaoo$ = function(key) {
  var $receiver = this.mLiveData_8be2vx$;
  var tmp$;
  var value = $receiver.get_11rb$(key);
  if (value == null) {
    var answer = DoorMutableLiveData_init_0(null);
    $receiver.put_xwzc9p$(key, answer);
    tmp$ = answer;
  } else {
    tmp$ = value;
  }
  return tmp$;
};
  function UstadSavedStateHandleJs$dumpToString$lambda(it) {
    return it.first + '=' + toString(it.second);
  }
  UstadSavedStateHandleJs.prototype.dumpToString = function() {
  var $receiver = this.mLiveData_8be2vx$.entries;
  var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
  var tmp$;
  tmp$ = $receiver.iterator();
  while (tmp$.hasNext()) {
    var item = tmp$.next();
    var tmp$_0;
    destination.add_11rb$(to(item.key, (tmp$_0 = item.value) != null ? tmp$_0.getValue() : null));
  }
  return joinToString(destination, void 0, void 0, void 0, void 0, void 0, UstadSavedStateHandleJs$dumpToString$lambda);
};
  UstadSavedStateHandleJs.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UstadSavedStateHandleJs', 
  interfaces: [UstadSavedStateHandle]};
  function ContainerUploader2(request, chunkSize, endpoint, progressListener, di) {
    if (chunkSize === void 0) 
      chunkSize = 204800;
  }
  ContainerUploader2.prototype.upload = function(continuation) {
  throw new NotImplementedError_init('An operation is not implemented: ' + 'Not yet implemented');
};
  ContainerUploader2.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ContainerUploader2', 
  interfaces: []};
  function ClazzLogCreatorManagerJs() {
  }
  ClazzLogCreatorManagerJs.prototype.requestClazzLogCreation_icxydn$ = function(clazzUid, endpointUrl, fromTime, toTime) {
};
  ClazzLogCreatorManagerJs.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'ClazzLogCreatorManagerJs', 
  interfaces: [ClazzLogCreatorManager]};
  function getTimezoneOffset(timezoneName, timeUtc) {
    return $module$moment_timezone(new Date(timeUtc)).tz(timezoneName).utcOffset();
  }
  function getRawTimezoneOffset(timezoneName) {
    return $module$moment_timezone().tz(timezoneName).utcOffset() * 1000;
  }
  function createTemporaryDir(prefix) {
    if (prefix === void 0) 
      prefix = '';
    return DoorUri.Companion.parse_61zpoe$(StorageUtil_getInstance().createTempDir_61zpoe$(prefix));
  }
  function defaultJsonSerializer() {
    println(getKClass(KotlinxSerializer));
  }
  var safeParse = defineInlineFunction('UstadMobile-core.com.ustadmobile.core.util.safeParse_7hyvyd$', wrapFunction(function() {
  var get_direct = _.$$importsForInline$$['Kodein-DI-kodein-di'].org.kodein.di.get_direct_utb36t$;
  var Json = _.$$importsForInline$$['kotlinx-serialization-kotlinx-serialization-json-js-legacy'].kotlinx.serialization.json.Json;
  var getKClass = Kotlin.getKClass;
  var createKType = Kotlin.createKType;
  var typeToken = _.$$importsForInline$$['Kodein-DI-kodein-di'].$$importsForInline$$['Kodein-Type-kodein-type'].org.kodein.type.typeToken_saj79j$;
  var TypeToken = _.$$importsForInline$$['Kodein-DI-kodein-di'].$$importsForInline$$['Kodein-Type-kodein-type'].org.kodein.type.TypeToken;
  var throwCCE = Kotlin.throwCCE;
  return function(T_0, isT, di, strategy, str) {
  var tmp$;
  var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
  return json.decodeFromString_awif5v$(strategy, str);
};
}));
  var safeStringify_0 = defineInlineFunction('UstadMobile-core.com.ustadmobile.core.util.safeStringify_n8erst$', wrapFunction(function() {
  var get_direct = _.$$importsForInline$$['Kodein-DI-kodein-di'].org.kodein.di.get_direct_utb36t$;
  var Json = _.$$importsForInline$$['kotlinx-serialization-kotlinx-serialization-json-js-legacy'].kotlinx.serialization.json.Json;
  var getKClass = Kotlin.getKClass;
  var createKType = Kotlin.createKType;
  var typeToken = _.$$importsForInline$$['Kodein-DI-kodein-di'].$$importsForInline$$['Kodein-Type-kodein-type'].org.kodein.type.typeToken_saj79j$;
  var TypeToken = _.$$importsForInline$$['Kodein-DI-kodein-di'].$$importsForInline$$['Kodein-Type-kodein-type'].org.kodein.type.TypeToken;
  var throwCCE = Kotlin.throwCCE;
  return function(T_0, isT, di, strategy, entity) {
  var tmp$;
  var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
  return json.encodeToString_tf03ej$(strategy, entity);
};
}));
  function safeParseList(di, strategy, klass, str) {
    var tmp$;
    var json = get_direct(di).directDI.Instance_ohrpre$(Kotlin.isType(tmp$ = typeToken(createKType(getKClass(Json), [], false)), TypeToken) ? tmp$ : throwCCE(), null);
    return toList(json.decodeFromString_awif5v$(strategy, str));
  }
  function StorageUtil() {
    StorageUtil_instance = this;
  }
  StorageUtil.prototype.getStorage = function() {
  return [];
};
  StorageUtil.prototype.deleteFile_61zpoe$ = function(path) {
  return false;
};
  StorageUtil.prototype.createDir_61zpoe$ = function(path) {
};
  StorageUtil.prototype.createTempDir_61zpoe$ = function(prefix) {
  return '';
};
  StorageUtil.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'StorageUtil', 
  interfaces: []};
  var StorageUtil_instance = null;
  function StorageUtil_getInstance() {
    if (StorageUtil_instance === null) {
      new StorageUtil();
    }
    return StorageUtil_instance;
  }
  function parse8601Duration(duration) {
    throw new NotImplementedError_init('An operation is not implemented: ' + 'parse8601Duration not implemented on javascript yet');
  }
  function UMURLEncoder() {
    UMURLEncoder$Companion_getInstance();
  }
  function UMURLEncoder$Companion() {
    UMURLEncoder$Companion_instance = this;
  }
  UMURLEncoder$Companion.prototype.encodeUTF8_61zpoe$ = function(text) {
  return encodeURIComponent(text);
};
  UMURLEncoder$Companion.prototype.decodeUTF8_61zpoe$ = function(text) {
  return decodeURIComponent(text);
};
  UMURLEncoder$Companion.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'Companion', 
  interfaces: []};
  var UMURLEncoder$Companion_instance = null;
  function UMURLEncoder$Companion_getInstance() {
    if (UMURLEncoder$Companion_instance === null) {
      new UMURLEncoder$Companion();
    }
    return UMURLEncoder$Companion_instance;
  }
  UMURLEncoder.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UMURLEncoder', 
  interfaces: []};
  function UmPlatformUtil() {
    UmPlatformUtil_instance = this;
    this.isWeb = true;
  }
  UmPlatformUtil.prototype.run_o14v8n$ = function(block) {
};
  UmPlatformUtil.prototype.runAsync_3q5nlj$ = function(block, continuation) {
};
  UmPlatformUtil.prototype.debug = function() {
  debugger;
};
  UmPlatformUtil.prototype.log_za3rmp$ = function(content) {
  console.log('JS-LOG', JSON.stringify(content));
};
  UmPlatformUtil.prototype.runIfNotJsAsync_g2bo5h$ = function(block, continuation) {
};
  UmPlatformUtil.prototype.runIfNotJs_o14v8n$ = function(block) {
};
  UmPlatformUtil.$metadata$ = {
  kind: Kind_OBJECT, 
  simpleName: 'UmPlatformUtil', 
  interfaces: []};
  var UmPlatformUtil_instance = null;
  function UmPlatformUtil_getInstance() {
    if (UmPlatformUtil_instance === null) {
      new UmPlatformUtil();
    }
    return UmPlatformUtil_instance;
  }
  function UstadAntilog(defaultTag) {
    if (defaultTag === void 0) 
      defaultTag = 'NoTag';
    Antilog.call(this);
    this.defaultTag_0 = defaultTag;
  }
  UstadAntilog.prototype.isEnable_flj0vq$ = function(priority, tag) {
  var tmp$;
  if (equals(tag, DoorTag.Companion.LOG_TAG) && (priority === LogLevel.DEBUG || priority === LogLevel.VERBOSE)) 
    tmp$ = false;
  else 
    tmp$ = true;
  return tmp$;
};
  UstadAntilog.prototype.performLog_9kjzw7$ = function(priority, tag, throwable, message) {
  var tmp$, tmp$_0;
  var logTag = tag != null ? tag : this.defaultTag_0;
  if (message != null) {
    if (throwable != null) {
      tmp$_0 = toString(message) + '\n' + toString(throwable.message);
    } else {
      tmp$_0 = message;
    }
  } else {
    tmp$ = throwable != null ? throwable.message : null;
    if (tmp$ == null) {
      return;
    }
    tmp$_0 = tmp$;
  }
  var fullMessage = tmp$_0;
  switch (priority.name) {
    case 'VERBOSE':
      console.log('VERBOSE ' + logTag + ' : ' + fullMessage);
      break;
    case 'DEBUG':
      console.log('DEBUG ' + logTag + ' : ' + fullMessage);
      break;
    case 'INFO':
      console.info('INFO ' + logTag + ' : ' + fullMessage);
      break;
    case 'WARNING':
      console.warn('WARNING ' + logTag + ' : ' + fullMessage);
      break;
    case 'ERROR':
      console.error('ERROR ' + logTag + ' : ' + fullMessage);
      break;
    case 'ASSERT':
      console.error('ASSERT ' + logTag + ' : ' + fullMessage);
      break;
  }
};
  UstadAntilog.$metadata$ = {
  kind: Kind_CLASS, 
  simpleName: 'UstadAntilog', 
  interfaces: [Antilog]};
  function encodeBase64($receiver) {
    var buffer = $receiver;
    return Buffer.from(buffer).toString('base64').toString();
  }
  function deleteContainerEntryFilePaths(containerEntries, continuation) {
    throw new NotImplementedError_init('An operation is not implemented: ' + 'Not yet implemented');
  }
  function Coroutine$withWifiLock($receiver_0, context_0, block_0, continuation_0) {
    CoroutineImpl.call(this, continuation_0);
    this.exceptionState_0 = 1;
    this.local$block = block_0;
  }
  Coroutine$withWifiLock.$metadata$ = {
  kind: Kotlin.Kind.CLASS, 
  simpleName: null, 
  interfaces: [CoroutineImpl]};
  Coroutine$withWifiLock.prototype = Object.create(CoroutineImpl.prototype);
  Coroutine$withWifiLock.prototype.constructor = Coroutine$withWifiLock;
  Coroutine$withWifiLock.prototype.doResume = function() {
  do try {
    switch (this.state_0) {
      case 0:
        this.state_0 = 2;
        this.result_0 = this.local$block(this);
        if (this.result_0 === COROUTINE_SUSPENDED) 
          return COROUTINE_SUSPENDED;
        continue;
      case 1:
        throw this.exception_0;
      case 2:
        return;
      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 withWifiLock($receiver_0, context_0, block_0, continuation_0, suspended) {
    var instance = new Coroutine$withWifiLock($receiver_0, context_0, block_0, continuation_0);
    if (suspended) 
      return instance;
    else 
      return instance.doResume(null);
  }
  function addInvalidationListener($receiver, changeListenerRequest) {
    $receiver.addChangeListener_nttubv$(changeListenerRequest);
  }
  function removeInvalidationListener($receiver, changeListenerRequest) {
    $receiver.removeChangeListener_nttubv$(changeListenerRequest);
  }
  function observeWithLifecycleOwner$ObjectLiteral(closure$observer) {
    this.closure$observer = closure$observer;
  }
  observeWithLifecycleOwner$ObjectLiteral.prototype.onChanged_11rb$ = function(t) {
  this.closure$observer(t);
};
  observeWithLifecycleOwner$ObjectLiteral.$metadata$ = {
  kind: Kind_CLASS, 
  interfaces: [DoorObserver]};
  function observeWithLifecycleOwner($receiver, lifecycleOwner, observer) {
    $receiver.observe_igxi3b$(lifecycleOwner, new observeWithLifecycleOwner$ObjectLiteral(observer));
  }
  function getOrPut($receiver, key, block) {
    var tmp$;
    var tmp$_0;
    if ((tmp$ = $receiver.getItem(key)) != null) 
      tmp$_0 = tmp$;
    else {
      var $receiver_0 = block();
      $receiver.setItem(key, $receiver_0);
      tmp$_0 = $receiver_0;
    }
    return tmp$_0;
  }
  function formatDate($receiver, context) {
    var date = new Date($receiver);
    return date.getDate().toString() + '-' + date.getMonth() + '-' + date.getFullYear();
  }
  function setAllFromMap($receiver, stringMap) {
    var tmp$;
    tmp$ = stringMap.entries.iterator();
    while (tmp$.hasNext()) {
      var element = tmp$.next();
      $receiver.set_umlfku$(element.key, element.value);
    }
  }
  function observeResult$lambda(closure$serializer, closure$resultKey, this$observeResult, closure$block) {
    return function(it) {
  if (!(it == null || isBlank(it))) {
    var entity = Json.Default.decodeFromString_awif5v$(ListSerializer(closure$serializer), it);
    this$observeResult.set_umlfku$(closure$resultKey, null);
    closure$block(entity);
  }
  return Unit;
};
  }
  function observeResult($receiver, lifecycleOwner, serializer, resultKey, block) {
    $receiver.getLiveData_ytbaoo$(resultKey).observe_igxi3b$(lifecycleOwner, new DoorObserver(observeResult$lambda(serializer, resultKey, $receiver, block)));
  }
  function toStringMap($receiver) {
    var $receiver_0 = LinkedHashMap_init();
    var tmp$;
    tmp$ = $receiver.mLiveData_8be2vx$.keys.iterator();
    while (tmp$.hasNext()) {
      var element = tmp$.next();
      var strVal = $receiver.get_ytbaoo$(element);
      if (strVal != null) {
        $receiver_0.put_xwzc9p$(element, strVal);
      }
    }
    return $receiver_0;
  }
  function encryptWithPbkdf2_0($receiver, salt, iterations, keyLength) {
    if (iterations === void 0) 
      iterations = 10000;
    if (keyLength === void 0) 
      keyLength = 512;
    var password = $receiver;
    var uint8ArrayVal = $module$asmcrypto_js.Pbkdf2HmacSha1((new TextEncoder()).encode(password), (new TextEncoder()).encode(salt), iterations, keyLength / 8 | 0);
    var buffer = Buffer.from(new Uint8Array(uint8ArrayVal));
    return buffer;
  }
  function base64StringToByteArray($receiver) {
    throw new NotImplementedError_init('An operation is not implemented: ' + 'Not implemented on JS yet');
  }
  function validEmail($receiver) {
    var value = $receiver;
    var valid = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(value);
    return valid;
  }
  function showChoiceDialog($receiver, context, title, items, listener) {
  }
  function innerXml($receiver, xppFactory) {
    var tmp$, tmp$_0;
    if ($receiver.getEventType() !== 2) 
      throw IllegalStateException_init('innerXml only works on a START_TAG event!');
    var value = (tmp$_0 = (tmp$ = $receiver.getNode()) != null ? tmp$.textContent : null) != null ? tmp$_0 : '';
    $receiver.next();
    return value.substring(0, value.length - 4 | 0).toString();
  }
  var package$com = _.com || (_.com = {});
  var package$ustadmobile = package$com.ustadmobile || (package$com.ustadmobile = {});
  var package$core = package$ustadmobile.core || (package$ustadmobile.core = {});
  var package$generated = package$core.generated || (package$core.generated = {});
  var package$locale = package$generated.locale || (package$generated.locale = {});
  Object.defineProperty(package$locale, 'MessageIdMap', {
  get: MessageIdMap_getInstance});
  Object.defineProperty(package$locale, 'MessageID', {
  get: MessageID_getInstance});
  var package$account = package$core.account || (package$core.account = {});
  package$account.AccountRegisterOptions = AccountRegisterOptions;
  package$account.AdultAccountRequiredException = AdultAccountRequiredException;
  $$importsForInline$$['Kodein-DI-kodein-di'] = $module$Kodein_DI_kodein_di;
  package$account.AuthManager = AuthManager;
  Object.defineProperty(AuthResult, 'Companion', {
  get: AuthResult$Companion_getInstance});
  Object.defineProperty(AuthResult, '$serializer', {
  get: AuthResult$$serializer_getInstance});
  package$account.AuthResult_init_337u9i$ = AuthResult_init;
  package$account.AuthResult = AuthResult;
  package$account.ClientId = ClientId;
  package$account.ConsentNotGrantedException = ConsentNotGrantedException;
  package$account.EndSessionParentChildJoinSyncListener = EndSessionParentChildJoinSyncListener;
  package$account.EndSessionPersonAuth2IncomingReplicationListener = EndSessionPersonAuth2IncomingReplicationListener;
  Object.defineProperty(Endpoint, 'Companion', {
  get: Endpoint$Companion_getInstance});
  Object.defineProperty(Endpoint, '$serializer', {
  get: Endpoint$$serializer_getInstance});
  package$account.Endpoint_init_q11ckg$ = Endpoint_init;
  package$account.Endpoint = Endpoint;
  Object.defineProperty(EndpointScope, 'Companion', {
  get: EndpointScope$Companion_getInstance});
  package$account.EndpointScope = EndpointScope;
  package$account.Pbkdf2Params = Pbkdf2Params;
  Object.defineProperty(RegisterRequest, 'Companion', {
  get: RegisterRequest$Companion_getInstance});
  Object.defineProperty(RegisterRequest, '$serializer', {
  get: RegisterRequest$$serializer_getInstance});
  package$account.RegisterRequest_init_l4ipzq$ = RegisterRequest_init;
  package$account.RegisterRequest = RegisterRequest;
  package$account.UnauthorizedException = UnauthorizedException;
  Object.defineProperty(UserSessionWithPersonAndEndpoint, 'Companion', {
  get: UserSessionWithPersonAndEndpoint$Companion_getInstance});
  Object.defineProperty(UserSessionWithPersonAndEndpoint, '$serializer', {
  get: UserSessionWithPersonAndEndpoint$$serializer_getInstance});
  package$account.UserSessionWithPersonAndEndpoint_init_bdaarl$ = UserSessionWithPersonAndEndpoint_init;
  package$account.UserSessionWithPersonAndEndpoint = UserSessionWithPersonAndEndpoint;
  UstadAccountManager.ResponseWithAccount = UstadAccountManager$ResponseWithAccount;
  $$importsForInline$$['UstadMobile-core'] = _;
  $$importsForInline$$['ktor-ktor-client-core-js-legacy'] = $module$ktor_ktor_client_core_js_legacy;
  Object.defineProperty(UstadAccountManager, 'Companion', {
  get: UstadAccountManager$Companion_getInstance});
  package$account.UstadAccountManager = UstadAccountManager;
  var package$assignment = package$core.assignment || (package$core.assignment = {});
  package$assignment.ClazzAssignmentIncomingReplicationListener = ClazzAssignmentIncomingReplicationListener;
  var package$catalog = package$core.catalog || (package$core.catalog = {});
  var package$contenttype = package$catalog.contenttype || (package$catalog.contenttype = {});
  package$contenttype.AbstractContentEntryPlugin = AbstractContentEntryPlugin;
  package$contenttype.AudioCodecInfo = AudioCodecInfo;
  Object.defineProperty(ContentEntryBranchDownloadPlugin, 'Companion', {
  get: ContentEntryBranchDownloadPlugin$Companion_getInstance});
  package$contenttype.ContentEntryBranchDownloadPlugin = ContentEntryBranchDownloadPlugin;
  Object.defineProperty(ContentTypePlugin, 'Companion', {
  get: ContentTypePlugin$Companion_getInstance});
  package$contenttype.ContentTypePlugin = ContentTypePlugin;
  Object.defineProperty(ScormTypePlugin, 'Companion', {
  get: ScormTypePlugin$Companion_getInstance});
  package$contenttype.ScormTypePlugin = ScormTypePlugin;
  Object.defineProperty(VideoTypePlugin, 'Companion', {
  get: VideoTypePlugin$Companion_getInstance});
  package$contenttype.VideoTypePlugin = VideoTypePlugin;
  var package$container = package$core.container || (package$core.container = {});
  package$container.CompressionFilter = CompressionFilter;
  Object.defineProperty(ContainerAddOptions, 'Companion', {
  get: ContainerAddOptions$Companion_getInstance});
  package$container.ContainerAddOptions = ContainerAddOptions;
  package$container.ContainerFileNamer = ContainerFileNamer;
  package$container.PrefixContainerFileNamer = PrefixContainerFileNamer;
  var package$contentformats = package$core.contentformats || (package$core.contentformats = {});
  package$contentformats.ContentImportManager = ContentImportManager;
  Object.defineProperty(EpubNavDocument, 'Companion', {
  get: EpubNavDocument$Companion_getInstance});
  var package$epub = package$contentformats.epub || (package$contentformats.epub = {});
  var package$nav = package$epub.nav || (package$epub.nav = {});
  package$nav.EpubNavDocument = EpubNavDocument;
  Object.defineProperty(EpubNavItem, 'Companion', {
  get: EpubNavItem$Companion_getInstance});
  package$nav.EpubNavItem_init_js8l4o$ = EpubNavItem_init;
  package$nav.EpubNavItem = EpubNavItem;
  var package$ocf = package$epub.ocf || (package$epub.ocf = {});
  package$ocf.OcfDocument = OcfDocument;
  package$ocf.OcfRootFile = OcfRootFile;
  var package$opf = package$epub.opf || (package$epub.opf = {});
  package$opf.OpfCreator_init = OpfCreator_init;
  package$opf.OpfCreator_init_rkkr90$ = OpfCreator_init_0;
  package$opf.OpfCreator = OpfCreator;
  Object.defineProperty(OpfDocument$LinkElement, 'Companion', {
  get: OpfDocument$LinkElement$Companion_getInstance});
  OpfDocument.LinkElement = OpfDocument$LinkElement;
  Object.defineProperty(OpfDocument, 'Companion', {
  get: OpfDocument$Companion_getInstance});
  package$opf.OpfDocument = OpfDocument;
  package$opf.OpfItem = OpfItem;
  Object.defineProperty(Har, 'Companion', {
  get: Har$Companion_getInstance});
  Object.defineProperty(Har, '$serializer', {
  get: Har$$serializer_getInstance});
  var package$har = package$contentformats.har || (package$contentformats.har = {});
  package$har.Har_init_yh3ysy$ = Har_init;
  package$har.Har = Har;
  package$har.HarContainer = HarContainer;
  Object.defineProperty(HarContent, 'Companion', {
  get: HarContent$Companion_getInstance});
  Object.defineProperty(HarContent, '$serializer', {
  get: HarContent$$serializer_getInstance});
  package$har.HarContent_init_xmwg5a$ = HarContent_init;
  package$har.HarContent = HarContent;
  Object.defineProperty(HarEntry, 'Companion', {
  get: HarEntry$Companion_getInstance});
  Object.defineProperty(HarEntry, '$serializer', {
  get: HarEntry$$serializer_getInstance});
  package$har.HarEntry_init_gduh9l$ = HarEntry_init;
  package$har.HarEntry = HarEntry;
  Object.defineProperty(HarRegexPair, 'Companion', {
  get: HarRegexPair$Companion_getInstance});
  Object.defineProperty(HarRegexPair, '$serializer', {
  get: HarRegexPair$$serializer_getInstance});
  package$har.HarRegexPair_init_1jgqbb$ = HarRegexPair_init;
  package$har.HarRegexPair = HarRegexPair;
  Object.defineProperty(Interceptors, 'Companion', {
  get: Interceptors$Companion_getInstance});
  Object.defineProperty(Interceptors, '$serializer', {
  get: Interceptors$$serializer_getInstance});
  package$har.Interceptors_init_1jgqbb$ = Interceptors_init;
  package$har.Interceptors = Interceptors;
  Object.defineProperty(HarExtra, 'Companion', {
  get: HarExtra$Companion_getInstance});
  Object.defineProperty(HarExtra, '$serializer', {
  get: HarExtra$$serializer_getInstance});
  package$har.HarExtra_init_9ru01s$ = HarExtra_init;
  package$har.HarExtra = HarExtra;
  Object.defineProperty(HarInterceptor, 'Companion', {
  get: HarInterceptor$Companion_getInstance});
  package$har.HarInterceptor = HarInterceptor;
  Object.defineProperty(HarLog, 'Companion', {
  get: HarLog$Companion_getInstance});
  Object.defineProperty(HarLog, '$serializer', {
  get: HarLog$$serializer_getInstance});
  package$har.HarLog_init_1vt6o9$ = HarLog_init;
  package$har.HarLog = HarLog;
  Object.defineProperty(HarNameValuePair, 'Companion', {
  get: HarNameValuePair$Companion_getInstance});
  Object.defineProperty(HarNameValuePair, '$serializer', {
  get: HarNameValuePair$$serializer_getInstance});
  package$har.HarNameValuePair_init_1jgqbb$ = HarNameValuePair_init;
  package$har.HarNameValuePair = HarNameValuePair;
  Object.defineProperty(HarRequest, 'Companion', {
  get: HarRequest$Companion_getInstance});
  Object.defineProperty(HarRequest, '$serializer', {
  get: HarRequest$$serializer_getInstance});
  package$har.HarRequest_init_nlrdt5$ = HarRequest_init;
  package$har.HarRequest = HarRequest;
  Object.defineProperty(HarResponse, 'Companion', {
  get: HarResponse$Companion_getInstance});
  Object.defineProperty(HarResponse, '$serializer', {
  get: HarResponse$$serializer_getInstance});
  package$har.HarResponse_init_5gooo$ = HarResponse_init;
  package$har.HarResponse = HarResponse;
  Object.defineProperty(KhanProblemBody$Variable$Input, 'Companion', {
  get: KhanProblemBody$Variable$Input$Companion_getInstance});
  Object.defineProperty(KhanProblemBody$Variable$Input, '$serializer', {
  get: KhanProblemBody$Variable$Input$$serializer_getInstance});
  KhanProblemBody$Variable.Input_init_q7dq7g$ = KhanProblemBody$Variable$KhanProblemBody$Variable$Input_init;
  KhanProblemBody$Variable.Input = KhanProblemBody$Variable$Input;
  Object.defineProperty(KhanProblemBody$Variable, 'Companion', {
  get: KhanProblemBody$Variable$Companion_getInstance});
  Object.defineProperty(KhanProblemBody$Variable, '$serializer', {
  get: KhanProblemBody$Variable$$serializer_getInstance});
  KhanProblemBody.Variable_init_m7p9ca$ = KhanProblemBody$KhanProblemBody$Variable_init;
  KhanProblemBody.Variable = KhanProblemBody$Variable;
  Object.defineProperty(KhanProblemBody, 'Companion', {
  get: KhanProblemBody$Companion_getInstance});
  Object.defineProperty(KhanProblemBody, '$serializer', {
  get: KhanProblemBody$$serializer_getInstance});
  package$har.KhanProblemBody_init_656irz$ = KhanProblemBody_init;
  package$har.KhanProblemBody = KhanProblemBody;
  package$har.KhanProblemInterceptor = KhanProblemInterceptor;
  Object.defineProperty(ItemResponse, 'Companion', {
  get: ItemResponse$Companion_getInstance});
  Object.defineProperty(ItemResponse, '$serializer', {
  get: ItemResponse$$serializer_getInstance});
  package$har.ItemResponse_init_q11ckg$ = ItemResponse_init;
  package$har.ItemResponse = ItemResponse;
  Object.defineProperty(ItemData$Content, 'Companion', {
  get: ItemData$Content$Companion_getInstance});
  Object.defineProperty(ItemData$Content, '$serializer', {
  get: ItemData$Content$$serializer_getInstance});
  ItemData.Content_init_q11ckg$ = ItemData$ItemData$Content_init;
  ItemData.Content = ItemData$Content;
  Object.defineProperty(ItemData, 'Companion', {
  get: ItemData$Companion_getInstance});
  Object.defineProperty(ItemData, '$serializer', {
  get: ItemData$$serializer_getInstance});
  package$har.ItemData_init_8h6n01$ = ItemData_init;
  package$har.ItemData = ItemData;
  package$har.KhanProgressTracker = KhanProgressTracker;
  package$har.RecorderInterceptor = RecorderInterceptor;
  Object.defineProperty(ImportedContentEntryMetaData, 'Companion', {
  get: ImportedContentEntryMetaData$Companion_getInstance});
  Object.defineProperty(ImportedContentEntryMetaData, '$serializer', {
  get: ImportedContentEntryMetaData$$serializer_getInstance});
  var package$metadata = package$contentformats.metadata || (package$contentformats.metadata = {});
  package$metadata.ImportedContentEntryMetaData_init_sd55li$ = ImportedContentEntryMetaData_init;
  package$metadata.ImportedContentEntryMetaData = ImportedContentEntryMetaData;
  Object.defineProperty(OpdsEntry, 'Companion', {
  get: OpdsEntry$Companion_getInstance});
  var package$opds = package$contentformats.opds || (package$contentformats.opds = {});
  package$opds.OpdsEntry = OpdsEntry;
  Object.defineProperty(OpdsFeed, 'Companion', {
  get: OpdsFeed$Companion_getInstance});
  package$opds.OpdsFeed = OpdsFeed;
  Object.defineProperty(OpdsLink, 'Companion', {
  get: OpdsLink$Companion_getInstance});
  package$opds.OpdsLink = OpdsLink;
  ScormManifest.Organization = ScormManifest$Organization;
  ScormManifest.OrganizationItem = ScormManifest$OrganizationItem;
  ScormManifest.Resource = ScormManifest$Resource;
  Object.defineProperty(ScormManifest, 'Companion', {
  get: ScormManifest$Companion_getInstance});
  var package$scorm = package$contentformats.scorm || (package$contentformats.scorm = {});
  package$scorm.ScormManifest = ScormManifest;
  Actor.Account = Actor$Account;
  var package$xapi = package$contentformats.xapi || (package$contentformats.xapi = {});
  package$xapi.Actor = Actor;
  package$xapi.Attachment = Attachment;
  package$xapi.ContextActivity = ContextActivity;
  Definition.Interaction = Definition$Interaction;
  package$xapi.Definition = Definition;
  Result.Score = Result$Score;
  package$xapi.Result = Result;
  package$xapi.State = State;
  package$xapi.Statement = Statement;
  package$xapi.Verb = Verb;
  package$xapi.XContext = XContext;
  package$xapi.XObject = XObject;
  var package$endpoints = package$xapi.endpoints || (package$xapi.endpoints = {});
  package$endpoints.XapiStateEndpoint = XapiStateEndpoint;
  package$endpoints.XapiStatementEndpoint = XapiStatementEndpoint;
  package$endpoints.storeProgressStatement_5hz4b3$ = storeProgressStatement;
  package$endpoints.storeCompletedStatement_c8sais$ = storeCompletedStatement;
  package$endpoints.storeSubmitSubmissionStatement_z4t0vt$ = storeSubmitSubmissionStatement;
  package$endpoints.storeMarkedStatement_52uee5$ = storeMarkedStatement;
  var package$contentjob = package$core.contentjob || (package$core.contentjob = {});
  package$contentjob.ConnectivityCancellationException = ConnectivityCancellationException;
  package$contentjob.ContentJobItemTransactionRunner = ContentJobItemTransactionRunner;
  Object.defineProperty(ContentJobManager, 'Companion', {
  get: ContentJobManager$Companion_getInstance});
  package$contentjob.ContentJobManager = ContentJobManager;
  $$importsForInline$$['kotlinx-coroutines-core'] = $module$kotlinx_coroutines_core;
  package$contentjob.ContentJobProcessContext = ContentJobProcessContext;
  package$contentjob.ContentJobProgressListener = ContentJobProgressListener;
  ContentJobRunner.ContentJobResult = ContentJobRunner$ContentJobResult;
  Object.defineProperty(ContentJobRunner, 'Companion', {
  get: ContentJobRunner$Companion_getInstance});
  package$contentjob.ContentJobRunner = ContentJobRunner;
  package$contentjob.ContentPlugin = ContentPlugin;
  Object.defineProperty(package$contentjob, 'ContentPluginIds', {
  get: ContentPluginIds_getInstance});
  package$contentjob.ContentPluginManager = ContentPluginManager;
  package$contentjob.ContentPluginUploader = ContentPluginUploader;
  package$contentjob.ContentTypeNotSupportedException = ContentTypeNotSupportedException;
  package$contentjob.DefaultContentPluginUploader = DefaultContentPluginUploader;
  package$contentjob.DummyContentPluginUploader = DummyContentPluginUploader;
  package$contentjob.FatalContentJobException = FatalContentJobException;
  package$contentjob.JobConnectivityLiveData = JobConnectivityLiveData;
  Object.defineProperty(MetadataResult, 'Companion', {
  get: MetadataResult$Companion_getInstance});
  Object.defineProperty(MetadataResult, '$serializer', {
  get: MetadataResult$$serializer_getInstance});
  package$contentjob.MetadataResult_init_4600l1$ = MetadataResult_init;
  package$contentjob.MetadataResult = MetadataResult;
  package$contentjob.ProcessResult = ProcessResult;
  Object.defineProperty(package$contentjob, 'SupportedContent', {
  get: SupportedContent_getInstance});
  Object.defineProperty(UploadResult, 'Companion', {
  get: UploadResult$Companion_getInstance});
  Object.defineProperty(UploadResult, '$serializer', {
  get: UploadResult$$serializer_getInstance});
  package$contentjob.UploadResult_init_5zlsd$ = UploadResult_init;
  package$contentjob.UploadResult = UploadResult;
  var package$controller = package$core.controller || (package$core.controller = {});
  package$controller.AboutPresenter = AboutPresenter;
  package$controller.AccountListPresenter = AccountListPresenter;
  package$controller.AttemptListListener = AttemptListListener;
  Object.defineProperty(BitmaskEditPresenter, 'Companion', {
  get: BitmaskEditPresenter$Companion_getInstance});
  package$controller.BitmaskEditPresenter = BitmaskEditPresenter;
  Object.defineProperty(ChatDetailPresenter, 'Companion', {
  get: ChatDetailPresenter$Companion_getInstance});
  package$controller.ChatDetailPresenter = ChatDetailPresenter;
  Object.defineProperty(ChatListPresenter, 'Companion', {
  get: ChatListPresenter$Companion_getInstance});
  package$controller.ChatListPresenter = ChatListPresenter;
  Object.defineProperty(ClazzAssignmentDetailOverviewPresenter, 'Companion', {
  get: ClazzAssignmentDetailOverviewPresenter$Companion_getInstance});
  package$controller.ClazzAssignmentDetailOverviewPresenter = ClazzAssignmentDetailOverviewPresenter;
  package$controller.ClazzAssignmentDetailPresenter = ClazzAssignmentDetailPresenter;
  package$controller.ClazzAssignmentDetailStudentProgressItemListener = ClazzAssignmentDetailStudentProgressItemListener;
  package$controller.ClazzAssignmentDetailStudentProgressOverviewListPresenter = ClazzAssignmentDetailStudentProgressOverviewListPresenter;
  package$controller.ClazzAssignmentDetailStudentProgressPresenter = ClazzAssignmentDetailStudentProgressPresenter;
  Object.defineProperty(ClazzAssignmentEditPresenter$TextLimitTypeOptions, 'WORDS', {
  get: ClazzAssignmentEditPresenter$TextLimitTypeOptions$WORDS_getInstance});
  Object.defineProperty(ClazzAssignmentEditPresenter$TextLimitTypeOptions, 'CHARS', {
  get: ClazzAssignmentEditPresenter$TextLimitTypeOptions$CHARS_getInstance});
  ClazzAssignmentEditPresenter.TextLimitTypeOptions = ClazzAssignmentEditPresenter$TextLimitTypeOptions;
  ClazzAssignmentEditPresenter.TextLimitTypeOptionsMessageIdOption = ClazzAssignmentEditPresenter$TextLimitTypeOptionsMessageIdOption;
  Object.defineProperty(ClazzAssignmentEditPresenter$CompletionCriteriaOptions, 'SUBMITTED', {
  get: ClazzAssignmentEditPresenter$CompletionCriteriaOptions$SUBMITTED_getInstance});
  Object.defineProperty(ClazzAssignmentEditPresenter$CompletionCriteriaOptions, 'GRADED', {
  get: ClazzAssignmentEditPresenter$CompletionCriteriaOptions$GRADED_getInstance});
  ClazzAssignmentEditPresenter.CompletionCriteriaOptions = ClazzAssignmentEditPresenter$CompletionCriteriaOptions;
  ClazzAssignmentEditPresenter.CompletionCriteriaOptionsMessageIdOption = ClazzAssignmentEditPresenter$CompletionCriteriaOptionsMessageIdOption;
  Object.defineProperty(ClazzAssignmentEditPresenter$SubmissionPolicyOptions, 'SUBMIT_ALL_AT_ONCE', {
  get: ClazzAssignmentEditPresenter$SubmissionPolicyOptions$SUBMIT_ALL_AT_ONCE_getInstance});
  Object.defineProperty(ClazzAssignmentEditPresenter$SubmissionPolicyOptions, 'MULTIPLE_SUBMISSIONS', {
  get: ClazzAssignmentEditPresenter$SubmissionPolicyOptions$MULTIPLE_SUBMISSIONS_getInstance});
  ClazzAssignmentEditPresenter.SubmissionPolicyOptions = ClazzAssignmentEditPresenter$SubmissionPolicyOptions;
  ClazzAssignmentEditPresenter.SubmissionPolicyOptionsMessageIdOption = ClazzAssignmentEditPresenter$SubmissionPolicyOptionsMessageIdOption;
  Object.defineProperty(ClazzAssignmentEditPresenter$FileTypeOptions, 'ANY', {
  get: ClazzAssignmentEditPresenter$FileTypeOptions$ANY_getInstance});
  Object.defineProperty(ClazzAssignmentEditPresenter$FileTypeOptions, 'DOCUMENT', {
  get: ClazzAssignmentEditPresenter$FileTypeOptions$DOCUMENT_getInstance});
  Object.defineProperty(ClazzAssignmentEditPresenter$FileTypeOptions, 'IMAGE', {
  get: ClazzAssignmentEditPresenter$FileTypeOptions$IMAGE_getInstance});
  Object.defineProperty(ClazzAssignmentEditPresenter$FileTypeOptions, 'VIDEO', {
  get: ClazzAssignmentEditPresenter$FileTypeOptions$VIDEO_getInstance});
  Object.defineProperty(ClazzAssignmentEditPresenter$FileTypeOptions, 'AUDIO', {
  get: ClazzAssignmentEditPresenter$FileTypeOptions$AUDIO_getInstance});
  ClazzAssignmentEditPresenter.FileTypeOptions = ClazzAssignmentEditPresenter$FileTypeOptions;
  ClazzAssignmentEditPresenter.FileTypeOptionsMessageIdOption = ClazzAssignmentEditPresenter$FileTypeOptionsMessageIdOption;
  Object.defineProperty(ClazzAssignmentEditPresenter, 'Companion', {
  get: ClazzAssignmentEditPresenter$Companion_getInstance});
  package$controller.ClazzAssignmentEditPresenter = ClazzAssignmentEditPresenter;
  Object.defineProperty(ClazzDetailOverviewPresenter, 'Companion', {
  get: ClazzDetailOverviewPresenter$Companion_getInstance});
  package$controller.ClazzDetailOverviewPresenter = ClazzDetailOverviewPresenter;
  Object.defineProperty(ClazzDetailPresenter, 'Companion', {
  get: ClazzDetailPresenter$Companion_getInstance});
  package$controller.ClazzDetailPresenter = ClazzDetailPresenter;
  package$controller.asCourseBlockWithEntity_31v1o$ = asCourseBlockWithEntity;
  Object.defineProperty(ClazzEdit2Presenter$EnrolmentPolicyOptions, 'OPEN', {
  get: ClazzEdit2Presenter$EnrolmentPolicyOptions$OPEN_getInstance});
  Object.defineProperty(ClazzEdit2Presenter$EnrolmentPolicyOptions, 'INVITE', {
  get: ClazzEdit2Presenter$EnrolmentPolicyOptions$INVITE_getInstance});
  ClazzEdit2Presenter.EnrolmentPolicyOptions = ClazzEdit2Presenter$EnrolmentPolicyOptions;
  ClazzEdit2Presenter.EnrolmentPolicyOptionsMessageIdOption = ClazzEdit2Presenter$EnrolmentPolicyOptionsMessageIdOption;
  Object.defineProperty(ClazzEdit2Presenter, 'Companion', {
  get: ClazzEdit2Presenter$Companion_getInstance});
  package$controller.ClazzEdit2Presenter = ClazzEdit2Presenter;
  Object.defineProperty(package$controller, 'ClazzEnrolmentConstants', {
  get: ClazzEnrolmentConstants_getInstance});
  Object.defineProperty(ClazzEnrolmentEditPresenter$RoleOptions, 'STUDENT', {
  get: ClazzEnrolmentEditPresenter$RoleOptions$STUDENT_getInstance});
  Object.defineProperty(ClazzEnrolmentEditPresenter$RoleOptions, 'TEACHER', {
  get: ClazzEnrolmentEditPresenter$RoleOptions$TEACHER_getInstance});
  ClazzEnrolmentEditPresenter.RoleOptions = ClazzEnrolmentEditPresenter$RoleOptions;
  ClazzEnrolmentEditPresenter.RoleMessageIdOption = ClazzEnrolmentEditPresenter$RoleMessageIdOption;
  Object.defineProperty(ClazzEnrolmentEditPresenter$OutcomeOptions, 'INPROGRESS', {
  get: ClazzEnrolmentEditPresenter$OutcomeOptions$INPROGRESS_getInstance});
  Object.defineProperty(ClazzEnrolmentEditPresenter$OutcomeOptions, 'GRADUATED', {
  get: ClazzEnrolmentEditPresenter$OutcomeOptions$GRADUATED_getInstance});
  Object.defineProperty(ClazzEnrolmentEditPresenter$OutcomeOptions, 'FAILED', {
  get: ClazzEnrolmentEditPresenter$OutcomeOptions$FAILED_getInstance});
  Object.defineProperty(ClazzEnrolmentEditPresenter$OutcomeOptions, 'DROPPED_OUT', {
  get: ClazzEnrolmentEditPresenter$OutcomeOptions$DROPPED_OUT_getInstance});
  ClazzEnrolmentEditPresenter.OutcomeOptions = ClazzEnrolmentEditPresenter$OutcomeOptions;
  ClazzEnrolmentEditPresenter.OutcomeMessageIdOption = ClazzEnrolmentEditPresenter$OutcomeMessageIdOption;
  Object.defineProperty(ClazzEnrolmentEditPresenter, 'Companion', {
  get: ClazzEnrolmentEditPresenter$Companion_getInstance});
  package$controller.ClazzEnrolmentEditPresenter = ClazzEnrolmentEditPresenter;
  package$controller.ClazzEnrolmentListPresenter = ClazzEnrolmentListPresenter;
  package$controller.ClazzListItemListener = ClazzListItemListener;
  Object.defineProperty(ClazzListPresenter, 'Companion', {
  get: ClazzListPresenter$Companion_getInstance});
  package$controller.ClazzListPresenter = ClazzListPresenter;
  Object.defineProperty(ClazzLogEditAttendancePresenter, 'Companion', {
  get: ClazzLogEditAttendancePresenter$Companion_getInstance});
  package$controller.ClazzLogEditAttendancePresenter = ClazzLogEditAttendancePresenter;
  Object.defineProperty(ClazzLogEditPresenter, 'Companion', {
  get: ClazzLogEditPresenter$Companion_getInstance});
  package$controller.ClazzLogEditPresenter = ClazzLogEditPresenter;
  ClazzLogListAttendancePresenter.AttendanceGraphData = ClazzLogListAttendancePresenter$AttendanceGraphData;
  Object.defineProperty(ClazzLogListAttendancePresenter$SortOrder, 'ORDER_NAME_ASC', {
  get: ClazzLogListAttendancePresenter$SortOrder$ORDER_NAME_ASC_getInstance});
  Object.defineProperty(ClazzLogListAttendancePresenter$SortOrder, 'ORDER_NAME_DSC', {
  get: ClazzLogListAttendancePresenter$SortOrder$ORDER_NAME_DSC_getInstance});
  ClazzLogListAttendancePresenter.SortOrder = ClazzLogListAttendancePresenter$SortOrder;
  Object.defineProperty(ClazzLogListAttendancePresenter$RecordAttendanceOption, 'RECORD_ATTENDANCE_MOST_RECENT_SCHEDULE', {
  get: ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_MOST_RECENT_SCHEDULE_getInstance});
  Object.defineProperty(ClazzLogListAttendancePresenter$RecordAttendanceOption, 'RECORD_ATTENDANCE_NEW_SCHEDULE', {
  get: ClazzLogListAttendancePresenter$RecordAttendanceOption$RECORD_ATTENDANCE_NEW_SCHEDULE_getInstance});
  ClazzLogListAttendancePresenter.RecordAttendanceOption = ClazzLogListAttendancePresenter$RecordAttendanceOption;
  ClazzLogListAttendancePresenter.ClazzLogListSortOption = ClazzLogListAttendancePresenter$ClazzLogListSortOption;
  $$importsForInline$$['klock-root-klock-js-legacy'] = $module$klock_root_klock_js_legacy;
  package$controller.ClazzLogListAttendancePresenter = ClazzLogListAttendancePresenter;
  Object.defineProperty(ClazzMemberListPresenter, 'Companion', {
  get: ClazzMemberListPresenter$Companion_getInstance});
  package$controller.ClazzMemberListPresenter = ClazzMemberListPresenter;
  package$controller.CommentListener = CommentListener;
  package$controller.ContentEntryAddOptionsListener = ContentEntryAddOptionsListener;
  Object.defineProperty(ContentEntryDetailAttemptsListPresenter, 'Companion', {
  get: ContentEntryDetailAttemptsListPresenter$Companion_getInstance});
  package$controller.ContentEntryDetailAttemptsListPresenter = ContentEntryDetailAttemptsListPresenter;
  Object.defineProperty(ContentEntryDetailOverviewPresenter, 'Companion', {
  get: ContentEntryDetailOverviewPresenter$Companion_getInstance});
  package$controller.ContentEntryDetailOverviewPresenter = ContentEntryDetailOverviewPresenter;
  package$controller.ContentEntryDetailPresenter = ContentEntryDetailPresenter;
  Object.defineProperty(ContentEntryEdit2Presenter$LicenceOptions, 'LICENSE_TYPE_CC_BY', {
  get: ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_getInstance});
  Object.defineProperty(ContentEntryEdit2Presenter$LicenceOptions, 'LICENSE_TYPE_CC_BY_SA', {
  get: ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_SA_getInstance});
  Object.defineProperty(ContentEntryEdit2Presenter$LicenceOptions, 'LICENSE_TYPE_CC_BY_SA_NC', {
  get: ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_SA_NC_getInstance});
  Object.defineProperty(ContentEntryEdit2Presenter$LicenceOptions, 'LICENSE_TYPE_CC_BY_NC', {
  get: ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_NC_getInstance});
  Object.defineProperty(ContentEntryEdit2Presenter$LicenceOptions, 'ALL_RIGHTS_RESERVED', {
  get: ContentEntryEdit2Presenter$LicenceOptions$ALL_RIGHTS_RESERVED_getInstance});
  Object.defineProperty(ContentEntryEdit2Presenter$LicenceOptions, 'LICENSE_TYPE_CC_BY_NC_SA', {
  get: ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC_BY_NC_SA_getInstance});
  Object.defineProperty(ContentEntryEdit2Presenter$LicenceOptions, 'LICENSE_TYPE_PUBLIC_DOMAIN', {
  get: ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_PUBLIC_DOMAIN_getInstance});
  Object.defineProperty(ContentEntryEdit2Presenter$LicenceOptions, 'LICENSE_TYPE_OTHER', {
  get: ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_OTHER_getInstance});
  Object.defineProperty(ContentEntryEdit2Presenter$LicenceOptions, 'LICENSE_TYPE_CC0', {
  get: ContentEntryEdit2Presenter$LicenceOptions$LICENSE_TYPE_CC0_getInstance});
  ContentEntryEdit2Presenter.LicenceOptions = ContentEntryEdit2Presenter$LicenceOptions;
  Object.defineProperty(ContentEntryEdit2Presenter$CompletionCriteriaOptions, 'AUTOMATIC', {
  get: ContentEntryEdit2Presenter$CompletionCriteriaOptions$AUTOMATIC_getInstance});
  Object.defineProperty(ContentEntryEdit2Presenter$CompletionCriteriaOptions, 'MIN_SCORE', {
  get: ContentEntryEdit2Presenter$CompletionCriteriaOptions$MIN_SCORE_getInstance});
  Object.defineProperty(ContentEntryEdit2Presenter$CompletionCriteriaOptions, 'STUDENTS_MARKS_COMPLETE', {
  get: ContentEntryEdit2Presenter$CompletionCriteriaOptions$STUDENTS_MARKS_COMPLETE_getInstance});
  ContentEntryEdit2Presenter.CompletionCriteriaOptions = ContentEntryEdit2Presenter$CompletionCriteriaOptions;
  ContentEntryEdit2Presenter.CompletionCriteriaMessageIdOption = ContentEntryEdit2Presenter$CompletionCriteriaMessageIdOption;
  ContentEntryEdit2Presenter.LicenceMessageIdOptions = ContentEntryEdit2Presenter$LicenceMessageIdOptions;
  Object.defineProperty(ContentEntryEdit2Presenter, 'Companion', {
  get: ContentEntryEdit2Presenter$Companion_getInstance});
  package$controller.ContentEntryEdit2Presenter = ContentEntryEdit2Presenter;
  package$controller.ContentEntryImportLinkPresenter = ContentEntryImportLinkPresenter;
  Object.defineProperty(ContentEntryList2Presenter, 'Companion', {
  get: ContentEntryList2Presenter$Companion_getInstance});
  package$controller.ContentEntryList2Presenter = ContentEntryList2Presenter;
  package$controller.ContentEntryListItemListener = ContentEntryListItemListener;
  package$controller.ContentWithAttemptListener = ContentWithAttemptListener;
  package$controller.CourseDiscussionDetailPresenter = CourseDiscussionDetailPresenter;
  Object.defineProperty(CourseDiscussionEditPresenter, 'Companion', {
  get: CourseDiscussionEditPresenter$Companion_getInstance});
  package$controller.CourseDiscussionEditPresenter = CourseDiscussionEditPresenter;
  Object.defineProperty(CourseGroupSetDetailPresenter, 'Companion', {
  get: CourseGroupSetDetailPresenter$Companion_getInstance});
  package$controller.CourseGroupSetDetailPresenter = CourseGroupSetDetailPresenter;
  Object.defineProperty(CourseGroupSetEditPresenter, 'Companion', {
  get: CourseGroupSetEditPresenter$Companion_getInstance});
  package$controller.CourseGroupSetEditPresenter = CourseGroupSetEditPresenter;
  package$controller.CourseGroupSetListItemListener = CourseGroupSetListItemListener;
  package$controller.CourseGroupSetListPresenter = CourseGroupSetListPresenter;
  package$controller.CourseTerminologyEditPresenter = CourseTerminologyEditPresenter;
  package$controller.CourseTerminologyListItemListener = CourseTerminologyListItemListener;
  package$controller.CourseTerminologyListPresenter = CourseTerminologyListPresenter;
  Object.defineProperty(DateRangePresenter$RelUnitOption, 'DAY', {
  get: DateRangePresenter$RelUnitOption$DAY_getInstance});
  Object.defineProperty(DateRangePresenter$RelUnitOption, 'WEEK', {
  get: DateRangePresenter$RelUnitOption$WEEK_getInstance});
  Object.defineProperty(DateRangePresenter$RelUnitOption, 'MONTH', {
  get: DateRangePresenter$RelUnitOption$MONTH_getInstance});
  Object.defineProperty(DateRangePresenter$RelUnitOption, 'YEAR', {
  get: DateRangePresenter$RelUnitOption$YEAR_getInstance});
  DateRangePresenter.RelUnitOption = DateRangePresenter$RelUnitOption;
  DateRangePresenter.RelUnitMessageIdOption = DateRangePresenter$RelUnitMessageIdOption;
  Object.defineProperty(DateRangePresenter$RelToOption, 'DAY', {
  get: DateRangePresenter$RelToOption$DAY_getInstance});
  DateRangePresenter.RelToOption = DateRangePresenter$RelToOption;
  DateRangePresenter.RelToMessageIdOption = DateRangePresenter$RelToMessageIdOption;
  Object.defineProperty(DateRangePresenter, 'Companion', {
  get: DateRangePresenter$Companion_getInstance});
  package$controller.DateRangePresenter = DateRangePresenter;
  package$controller.DefaultClazzAssignmentDetailStudentProgressItemListener = DefaultClazzAssignmentDetailStudentProgressItemListener;
  package$controller.DefaultClazzListItemListener = DefaultClazzListItemListener;
  package$controller.DefaultContentEntryListItemListener = DefaultContentEntryListItemListener;
  package$controller.DefaultNewCommentItemListener = DefaultNewCommentItemListener;
  package$controller.DefaultScopedGrantListItemListener = DefaultScopedGrantListItemListener;
  package$controller.DiscussionPostDetailPresenter = DiscussionPostDetailPresenter;
  Object.defineProperty(DiscussionPostEditPresenter, 'Companion', {
  get: DiscussionPostEditPresenter$Companion_getInstance});
  package$controller.DiscussionPostEditPresenter = DiscussionPostEditPresenter;
  Object.defineProperty(DiscussionTopicDetailPresenter, 'Companion', {
  get: DiscussionTopicDetailPresenter$Companion_getInstance});
  package$controller.DiscussionTopicDetailPresenter = DiscussionTopicDetailPresenter;
  package$controller.DiscussionTopicEditPresenter = DiscussionTopicEditPresenter;
  Object.defineProperty(EpubContentPresenter, 'Companion', {
  get: EpubContentPresenter$Companion_getInstance});
  package$controller.EpubContentPresenter = EpubContentPresenter;
  Object.defineProperty(ErrorReportPresenter, 'Companion', {
  get: ErrorReportPresenter$Companion_getInstance});
  package$controller.ErrorReportPresenter = ErrorReportPresenter;
  package$controller.FileSubmissionListItemListener = FileSubmissionListItemListener;
  package$controller.HarContentPresenterCommon = HarContentPresenterCommon;
  Object.defineProperty(HolidayCalendarEditPresenter, 'Companion', {
  get: HolidayCalendarEditPresenter$Companion_getInstance});
  package$controller.HolidayCalendarEditPresenter = HolidayCalendarEditPresenter;
  Object.defineProperty(HolidayCalendarListPresenter, 'Companion', {
  get: HolidayCalendarListPresenter$Companion_getInstance});
  package$controller.HolidayCalendarListPresenter = HolidayCalendarListPresenter;
  Object.defineProperty(HolidayEditPresenter, 'Companion', {
  get: HolidayEditPresenter$Companion_getInstance});
  package$controller.HolidayEditPresenter = HolidayEditPresenter;
  Object.defineProperty(HtmlTextViewDetailPresenter, 'Companion', {
  get: HtmlTextViewDetailPresenter$Companion_getInstance});
  package$controller.HtmlTextViewDetailPresenter = HtmlTextViewDetailPresenter;
  package$controller.InviteViaLinkPresenter = InviteViaLinkPresenter;
  Object.defineProperty(JoinWithCodePresenter, 'Companion', {
  get: JoinWithCodePresenter$Companion_getInstance});
  package$controller.JoinWithCodePresenter = JoinWithCodePresenter;
  package$controller.LanguageEditPresenter = LanguageEditPresenter;
  Object.defineProperty(LanguageListPresenter, 'Companion', {
  get: LanguageListPresenter$Companion_getInstance});
  package$controller.LanguageListPresenter = LanguageListPresenter;
  Object.defineProperty(package$controller, 'LearnerGroupMemberConstants', {
  get: LearnerGroupMemberConstants_getInstance});
  package$controller.LearnerGroupMemberListPresenter = LearnerGroupMemberListPresenter;
  package$controller.LeavingReasonEditPresenter = LeavingReasonEditPresenter;
  package$controller.LeavingReasonListPresenter = LeavingReasonListPresenter;
  package$controller.Login2Presenter = Login2Presenter;
  package$controller.MessagesPresenter = MessagesPresenter;
  package$controller.ModuleCourseBlockEditPresenter = ModuleCourseBlockEditPresenter;
  package$controller.NewCommentItemListener = NewCommentItemListener;
  package$controller.OnBoardingPresenter = OnBoardingPresenter;
  package$controller.OnSearchSubmitted = OnSearchSubmitted;
  package$controller.OnSortOptionSelected = OnSortOptionSelected;
  Object.defineProperty(ParentalConsentManagementPresenter, 'Companion', {
  get: ParentalConsentManagementPresenter$Companion_getInstance});
  package$controller.ParentalConsentManagementPresenter = ParentalConsentManagementPresenter;
  package$controller.PersonAccountEditPresenter = PersonAccountEditPresenter;
  Object.defineProperty(package$controller, 'PersonConstants', {
  get: PersonConstants_getInstance});
  Object.defineProperty(PersonDetailPresenter, 'Companion', {
  get: PersonDetailPresenter$Companion_getInstance});
  package$controller.PersonDetailPresenter = PersonDetailPresenter;
  package$controller.PersonEditPresenter = PersonEditPresenter;
  Object.defineProperty(PersonGroupEditPresenter, 'Companion', {
  get: PersonGroupEditPresenter$Companion_getInstance});
  package$controller.PersonGroupEditPresenter = PersonGroupEditPresenter;
  Object.defineProperty(PersonGroupListPresenter$SortOrder, 'ORDER_NAME_ASC', {
  get: PersonGroupListPresenter$SortOrder$ORDER_NAME_ASC_getInstance});
  Object.defineProperty(PersonGroupListPresenter$SortOrder, 'ORDER_NAME_DSC', {
  get: PersonGroupListPresenter$SortOrder$ORDER_NAME_DSC_getInstance});
  PersonGroupListPresenter.SortOrder = PersonGroupListPresenter$SortOrder;
  PersonGroupListPresenter.PersonGroupListSortOption = PersonGroupListPresenter$PersonGroupListSortOption;
  package$controller.PersonGroupListPresenter = PersonGroupListPresenter;
  Object.defineProperty(PersonListPresenter, 'Companion', {
  get: PersonListPresenter$Companion_getInstance});
  package$controller.PersonListPresenter = PersonListPresenter;
  package$controller.RedirectPresenter = RedirectPresenter;
  package$controller.RegisterAgeRedirectPresenter = RegisterAgeRedirectPresenter;
  package$controller.RegisterMinorWaitForParentPresenter = RegisterMinorWaitForParentPresenter;
  Object.defineProperty(ReportDetailPresenter, 'Companion', {
  get: ReportDetailPresenter$Companion_getInstance});
  package$controller.ReportDetailPresenter = ReportDetailPresenter;
  Object.defineProperty(ReportEditPresenter$VisualTypeOptions, 'BAR_CHART', {
  get: ReportEditPresenter$VisualTypeOptions$BAR_CHART_getInstance});
  Object.defineProperty(ReportEditPresenter$VisualTypeOptions, 'LINE_GRAPH', {
  get: ReportEditPresenter$VisualTypeOptions$LINE_GRAPH_getInstance});
  ReportEditPresenter.VisualTypeOptions = ReportEditPresenter$VisualTypeOptions;
  ReportEditPresenter.VisualTypeMessageIdOption = ReportEditPresenter$VisualTypeMessageIdOption;
  Object.defineProperty(ReportEditPresenter$XAxisOptions, 'DAY', {
  get: ReportEditPresenter$XAxisOptions$DAY_getInstance});
  Object.defineProperty(ReportEditPresenter$XAxisOptions, 'WEEK', {
  get: ReportEditPresenter$XAxisOptions$WEEK_getInstance});
  Object.defineProperty(ReportEditPresenter$XAxisOptions, 'MONTH', {
  get: ReportEditPresenter$XAxisOptions$MONTH_getInstance});
  Object.defineProperty(ReportEditPresenter$XAxisOptions, 'CONTENT_ENTRY', {
  get: ReportEditPresenter$XAxisOptions$CONTENT_ENTRY_getInstance});
  Object.defineProperty(ReportEditPresenter$XAxisOptions, 'GENDER', {
  get: ReportEditPresenter$XAxisOptions$GENDER_getInstance});
  Object.defineProperty(ReportEditPresenter$XAxisOptions, 'CLASS', {
  get: ReportEditPresenter$XAxisOptions$CLASS_getInstance});
  Object.defineProperty(ReportEditPresenter$XAxisOptions, 'ENROLMENT_OUTCOME', {
  get: ReportEditPresenter$XAxisOptions$ENROLMENT_OUTCOME_getInstance});
  Object.defineProperty(ReportEditPresenter$XAxisOptions, 'ENROLMENT_LEAVING', {
  get: ReportEditPresenter$XAxisOptions$ENROLMENT_LEAVING_getInstance});
  ReportEditPresenter.XAxisOptions = ReportEditPresenter$XAxisOptions;
  ReportEditPresenter.XAxisMessageIdOption = ReportEditPresenter$XAxisMessageIdOption;
  Object.defineProperty(ReportEditPresenter$DateRangeOptions, 'EVERYTHING', {
  get: ReportEditPresenter$DateRangeOptions$EVERYTHING_getInstance});
  Object.defineProperty(ReportEditPresenter$DateRangeOptions, 'LAST_WEEK', {
  get: ReportEditPresenter$DateRangeOptions$LAST_WEEK_getInstance});
  Object.defineProperty(ReportEditPresenter$DateRangeOptions, 'LAST_TWO_WEEKS', {
  get: ReportEditPresenter$DateRangeOptions$LAST_TWO_WEEKS_getInstance});
  Object.defineProperty(ReportEditPresenter$DateRangeOptions, 'LAST_MONTH', {
  get: ReportEditPresenter$DateRangeOptions$LAST_MONTH_getInstance});
  Object.defineProperty(ReportEditPresenter$DateRangeOptions, 'LAST_THREE_MONTHS', {
  get: ReportEditPresenter$DateRangeOptions$LAST_THREE_MONTHS_getInstance});
  Object.defineProperty(ReportEditPresenter$DateRangeOptions, 'CUSTOM_RANGE', {
  get: ReportEditPresenter$DateRangeOptions$CUSTOM_RANGE_getInstance});
  Object.defineProperty(ReportEditPresenter$DateRangeOptions, 'NEW_CUSTOM_RANGE', {
  get: ReportEditPresenter$DateRangeOptions$NEW_CUSTOM_RANGE_getInstance});
  ReportEditPresenter.DateRangeOptions = ReportEditPresenter$DateRangeOptions;
  Object.defineProperty(ReportEditPresenter$SubGroupOptions, 'NONE', {
  get: ReportEditPresenter$SubGroupOptions$NONE_getInstance});
  Object.defineProperty(ReportEditPresenter$SubGroupOptions, 'DAY', {
  get: ReportEditPresenter$SubGroupOptions$DAY_getInstance});
  Object.defineProperty(ReportEditPresenter$SubGroupOptions, 'WEEK', {
  get: ReportEditPresenter$SubGroupOptions$WEEK_getInstance});
  Object.defineProperty(ReportEditPresenter$SubGroupOptions, 'MONTH', {
  get: ReportEditPresenter$SubGroupOptions$MONTH_getInstance});
  Object.defineProperty(ReportEditPresenter$SubGroupOptions, 'CONTENT_ENTRY', {
  get: ReportEditPresenter$SubGroupOptions$CONTENT_ENTRY_getInstance});
  Object.defineProperty(ReportEditPresenter$SubGroupOptions, 'GENDER', {
  get: ReportEditPresenter$SubGroupOptions$GENDER_getInstance});
  Object.defineProperty(ReportEditPresenter$SubGroupOptions, 'CLASS', {
  get: ReportEditPresenter$SubGroupOptions$CLASS_getInstance});
  Object.defineProperty(ReportEditPresenter$SubGroupOptions, 'ENROLMENT_OUTCOME', {
  get: ReportEditPresenter$SubGroupOptions$ENROLMENT_OUTCOME_getInstance});
  Object.defineProperty(ReportEditPresenter$SubGroupOptions, 'ENROLMENT_LEAVING', {
  get: ReportEditPresenter$SubGroupOptions$ENROLMENT_LEAVING_getInstance});
  ReportEditPresenter.SubGroupOptions = ReportEditPresenter$SubGroupOptions;
  ReportEditPresenter.SubGroupByMessageIdOption = ReportEditPresenter$SubGroupByMessageIdOption;
  Object.defineProperty(ReportEditPresenter$YAxisOptions, 'TOTAL_DURATION', {
  get: ReportEditPresenter$YAxisOptions$TOTAL_DURATION_getInstance});
  Object.defineProperty(ReportEditPresenter$YAxisOptions, 'AVERAGE_DURATION', {
  get: ReportEditPresenter$YAxisOptions$AVERAGE_DURATION_getInstance});
  Object.defineProperty(ReportEditPresenter$YAxisOptions, 'NUMBER_SESSIONS', {
  get: ReportEditPresenter$YAxisOptions$NUMBER_SESSIONS_getInstance});
  Object.defineProperty(ReportEditPresenter$YAxisOptions, 'INTERACTIONS_RECORDED', {
  get: ReportEditPresenter$YAxisOptions$INTERACTIONS_RECORDED_getInstance});
  Object.defineProperty(ReportEditPresenter$YAxisOptions, 'NUMBER_ACTIVE_USERS', {
  get: ReportEditPresenter$YAxisOptions$NUMBER_ACTIVE_USERS_getInstance});
  Object.defineProperty(ReportEditPresenter$YAxisOptions, 'AVERAGE_USAGE_TIME_PER_USER', {
  get: ReportEditPresenter$YAxisOptions$AVERAGE_USAGE_TIME_PER_USER_getInstance});
  Object.defineProperty(ReportEditPresenter$YAxisOptions, 'NUMBER_STUDENTS_COMPLETED', {
  get: ReportEditPresenter$YAxisOptions$NUMBER_STUDENTS_COMPLETED_getInstance});
  Object.defineProperty(ReportEditPresenter$YAxisOptions, 'PERCENT_STUDENTS_COMPLETED', {
  get: ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_COMPLETED_getInstance});
  Object.defineProperty(ReportEditPresenter$YAxisOptions, 'TOTAL_ATTENDANCE', {
  get: ReportEditPresenter$YAxisOptions$TOTAL_ATTENDANCE_getInstance});
  Object.defineProperty(ReportEditPresenter$YAxisOptions, 'TOTAL_ABSENCES', {
  get: ReportEditPresenter$YAxisOptions$TOTAL_ABSENCES_getInstance});
  Object.defineProperty(ReportEditPresenter$YAxisOptions, 'TOTAL_LATES', {
  get: ReportEditPresenter$YAxisOptions$TOTAL_LATES_getInstance});
  Object.defineProperty(ReportEditPresenter$YAxisOptions, 'PERCENT_STUDENTS_ATTENDED', {
  get: ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_ATTENDED_getInstance});
  Object.defineProperty(ReportEditPresenter$YAxisOptions, 'PERCENT_STUDENTS_ATTENDED_OR_LATE', {
  get: ReportEditPresenter$YAxisOptions$PERCENT_STUDENTS_ATTENDED_OR_LATE_getInstance});
  Object.defineProperty(ReportEditPresenter$YAxisOptions, 'TOTAL_CLASSES', {
  get: ReportEditPresenter$YAxisOptions$TOTAL_CLASSES_getInstance});
  Object.defineProperty(ReportEditPresenter$YAxisOptions, 'UNIQUE_STUDENTS_ATTENDING', {
  get: ReportEditPresenter$YAxisOptions$UNIQUE_STUDENTS_ATTENDING_getInstance});
  ReportEditPresenter.YAxisOptions = ReportEditPresenter$YAxisOptions;
  ReportEditPresenter.YAxisMessageIdOption = ReportEditPresenter$YAxisMessageIdOption;
  Object.defineProperty(ReportEditPresenter, 'Companion', {
  get: ReportEditPresenter$Companion_getInstance});
  package$controller.ReportEditPresenter = ReportEditPresenter;
  Object.defineProperty(ReportFilterEditPresenter$FieldOption, 'PERSON_GENDER', {
  get: ReportFilterEditPresenter$FieldOption$PERSON_GENDER_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$FieldOption, 'PERSON_AGE', {
  get: ReportFilterEditPresenter$FieldOption$PERSON_AGE_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$FieldOption, 'CONTENT_COMPLETION', {
  get: ReportFilterEditPresenter$FieldOption$CONTENT_COMPLETION_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$FieldOption, 'CONTENT_ENTRY', {
  get: ReportFilterEditPresenter$FieldOption$CONTENT_ENTRY_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$FieldOption, 'CONTENT_PROGRESS', {
  get: ReportFilterEditPresenter$FieldOption$CONTENT_PROGRESS_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$FieldOption, 'ATTENDANCE_PERCENTAGE', {
  get: ReportFilterEditPresenter$FieldOption$ATTENDANCE_PERCENTAGE_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$FieldOption, 'ENROLMENT_OUTCOME', {
  get: ReportFilterEditPresenter$FieldOption$ENROLMENT_OUTCOME_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$FieldOption, 'ENROLMENT_LEAVING_REASON', {
  get: ReportFilterEditPresenter$FieldOption$ENROLMENT_LEAVING_REASON_getInstance});
  ReportFilterEditPresenter.FieldOption = ReportFilterEditPresenter$FieldOption;
  ReportFilterEditPresenter.FieldMessageIdOption = ReportFilterEditPresenter$FieldMessageIdOption;
  Object.defineProperty(ReportFilterEditPresenter$ConditionOption, 'IS_CONDITION', {
  get: ReportFilterEditPresenter$ConditionOption$IS_CONDITION_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$ConditionOption, 'IS_NOT_CONDITION', {
  get: ReportFilterEditPresenter$ConditionOption$IS_NOT_CONDITION_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$ConditionOption, 'GREATER_THAN_CONDITION', {
  get: ReportFilterEditPresenter$ConditionOption$GREATER_THAN_CONDITION_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$ConditionOption, 'LESS_THAN_CONDITION', {
  get: ReportFilterEditPresenter$ConditionOption$LESS_THAN_CONDITION_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$ConditionOption, 'BETWEEN_CONDITION', {
  get: ReportFilterEditPresenter$ConditionOption$BETWEEN_CONDITION_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$ConditionOption, 'IN_LIST_CONDITION', {
  get: ReportFilterEditPresenter$ConditionOption$IN_LIST_CONDITION_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$ConditionOption, 'NOT_IN_LIST_CONDITION', {
  get: ReportFilterEditPresenter$ConditionOption$NOT_IN_LIST_CONDITION_getInstance});
  ReportFilterEditPresenter.ConditionOption = ReportFilterEditPresenter$ConditionOption;
  ReportFilterEditPresenter.ConditionMessageIdOption = ReportFilterEditPresenter$ConditionMessageIdOption;
  Object.defineProperty(ReportFilterEditPresenter$ContentCompletionStatusOption, 'COMPLETED', {
  get: ReportFilterEditPresenter$ContentCompletionStatusOption$COMPLETED_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$ContentCompletionStatusOption, 'PASSED', {
  get: ReportFilterEditPresenter$ContentCompletionStatusOption$PASSED_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$ContentCompletionStatusOption, 'FAILED', {
  get: ReportFilterEditPresenter$ContentCompletionStatusOption$FAILED_getInstance});
  ReportFilterEditPresenter.ContentCompletionStatusOption = ReportFilterEditPresenter$ContentCompletionStatusOption;
  ReportFilterEditPresenter.ContentCompletionStatusMessageIdOption = ReportFilterEditPresenter$ContentCompletionStatusMessageIdOption;
  Object.defineProperty(ReportFilterEditPresenter$FilterValueType, 'DROPDOWN', {
  get: ReportFilterEditPresenter$FilterValueType$DROPDOWN_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$FilterValueType, 'INTEGER', {
  get: ReportFilterEditPresenter$FilterValueType$INTEGER_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$FilterValueType, 'BETWEEN', {
  get: ReportFilterEditPresenter$FilterValueType$BETWEEN_getInstance});
  Object.defineProperty(ReportFilterEditPresenter$FilterValueType, 'LIST', {
  get: ReportFilterEditPresenter$FilterValueType$LIST_getInstance});
  ReportFilterEditPresenter.FilterValueType = ReportFilterEditPresenter$FilterValueType;
  Object.defineProperty(ReportFilterEditPresenter, 'Companion', {
  get: ReportFilterEditPresenter$Companion_getInstance});
  package$controller.ReportFilterEditPresenter = ReportFilterEditPresenter;
  Object.defineProperty(ReportListPresenter, 'Companion', {
  get: ReportListPresenter$Companion_getInstance});
  package$controller.ReportListPresenter = ReportListPresenter;
  package$controller.ReportTemplateListPresenter = ReportTemplateListPresenter;
  Object.defineProperty(ScheduleEditPresenter$FrequencyOption, 'DAILY', {
  get: ScheduleEditPresenter$FrequencyOption$DAILY_getInstance});
  Object.defineProperty(ScheduleEditPresenter$FrequencyOption, 'WEEKLY', {
  get: ScheduleEditPresenter$FrequencyOption$WEEKLY_getInstance});
  ScheduleEditPresenter.FrequencyOption = ScheduleEditPresenter$FrequencyOption;
  ScheduleEditPresenter.FrequencyMessageIdOption = ScheduleEditPresenter$FrequencyMessageIdOption;
  Object.defineProperty(ScheduleEditPresenter$DayOptions, 'SUNDAY', {
  get: ScheduleEditPresenter$DayOptions$SUNDAY_getInstance});
  Object.defineProperty(ScheduleEditPresenter$DayOptions, 'MONDAY', {
  get: ScheduleEditPresenter$DayOptions$MONDAY_getInstance});
  Object.defineProperty(ScheduleEditPresenter$DayOptions, 'TUESDAY', {
  get: ScheduleEditPresenter$DayOptions$TUESDAY_getInstance});
  Object.defineProperty(ScheduleEditPresenter$DayOptions, 'WEDNESDAY', {
  get: ScheduleEditPresenter$DayOptions$WEDNESDAY_getInstance});
  Object.defineProperty(ScheduleEditPresenter$DayOptions, 'THURSDAY', {
  get: ScheduleEditPresenter$DayOptions$THURSDAY_getInstance});
  Object.defineProperty(ScheduleEditPresenter$DayOptions, 'FRIDAY', {
  get: ScheduleEditPresenter$DayOptions$FRIDAY_getInstance});
  Object.defineProperty(ScheduleEditPresenter$DayOptions, 'SATURDAY', {
  get: ScheduleEditPresenter$DayOptions$SATURDAY_getInstance});
  ScheduleEditPresenter.DayOptions = ScheduleEditPresenter$DayOptions;
  ScheduleEditPresenter.DayMessageIdOption = ScheduleEditPresenter$DayMessageIdOption;
  package$controller.ScheduleEditPresenter = ScheduleEditPresenter;
  Object.defineProperty(SchoolDetailOverviewPresenter, 'Companion', {
  get: SchoolDetailOverviewPresenter$Companion_getInstance});
  package$controller.SchoolDetailOverviewPresenter = SchoolDetailOverviewPresenter;
  package$controller.SchoolDetailPresenter = SchoolDetailPresenter;
  Object.defineProperty(SchoolEditPresenter, 'Companion', {
  get: SchoolEditPresenter$Companion_getInstance});
  package$controller.SchoolEditPresenter = SchoolEditPresenter;
  Object.defineProperty(SchoolListPresenter, 'Companion', {
  get: SchoolListPresenter$Companion_getInstance});
  package$controller.SchoolListPresenter = SchoolListPresenter;
  Object.defineProperty(SchoolMemberListPresenter, 'Companion', {
  get: SchoolMemberListPresenter$Companion_getInstance});
  package$controller.SchoolMemberListPresenter = SchoolMemberListPresenter;
  Object.defineProperty(ScopedGrantDetailPresenter, 'Companion', {
  get: ScopedGrantDetailPresenter$Companion_getInstance});
  package$controller.ScopedGrantDetailPresenter = ScopedGrantDetailPresenter;
  Object.defineProperty(ScopedGrantEditPresenter, 'Companion', {
  get: ScopedGrantEditPresenter$Companion_getInstance});
  package$controller.ScopedGrantEditPresenter = ScopedGrantEditPresenter;
  package$controller.ScopedGrantListItemListener = ScopedGrantListItemListener;
  package$controller.ScopedGrantListPresenter = ScopedGrantListPresenter;
  package$controller.SelectExtractFilePresenterCommon = SelectExtractFilePresenterCommon;
  package$controller.SelectFilePresenterCommon = SelectFilePresenterCommon;
  package$controller.SelectFolderPresenter = SelectFolderPresenter;
  package$controller.SessionListPresenter = SessionListPresenter;
  package$controller.SettingsPresenter = SettingsPresenter;
  Object.defineProperty(SiteDetailPresenter, 'Companion', {
  get: SiteDetailPresenter$Companion_getInstance});
  package$controller.SiteDetailPresenter = SiteDetailPresenter;
  Object.defineProperty(SiteEditPresenter, 'Companion', {
  get: SiteEditPresenter$Companion_getInstance});
  package$controller.SiteEditPresenter = SiteEditPresenter;
  Object.defineProperty(SiteEnterLinkPresenter, 'Companion', {
  get: SiteEnterLinkPresenter$Companion_getInstance});
  package$controller.SiteEnterLinkPresenter = SiteEnterLinkPresenter;
  Object.defineProperty(SiteTermsDetailPresenter, 'Companion', {
  get: SiteTermsDetailPresenter$Companion_getInstance});
  package$controller.SiteTermsDetailPresenter = SiteTermsDetailPresenter;
  Object.defineProperty(SiteTermsEditPresenter, 'Companion', {
  get: SiteTermsEditPresenter$Companion_getInstance});
  package$controller.SiteTermsEditPresenter = SiteTermsEditPresenter;
  Object.defineProperty(package$controller, 'StatementConstants', {
  get: StatementConstants_getInstance});
  package$controller.StatementListPresenter = StatementListPresenter;
  Object.defineProperty(package$controller, 'SubmissionConstants', {
  get: SubmissionConstants_getInstance});
  package$controller.SubmissionSummaryListener = SubmissionSummaryListener;
  Object.defineProperty(package$controller, 'TerminologyKeys', {
  get: TerminologyKeys_getInstance});
  Object.defineProperty(TextAssignmentEditPresenter, 'Companion', {
  get: TextAssignmentEditPresenter$Companion_getInstance});
  package$controller.TextAssignmentEditPresenter = TextAssignmentEditPresenter;
  package$controller.TextCourseBlockEditPresenter = TextCourseBlockEditPresenter;
  Object.defineProperty(TimeZoneListPresenter, 'Companion', {
  get: TimeZoneListPresenter$Companion_getInstance});
  package$controller.TimeZoneListPresenter = TimeZoneListPresenter;
  Object.defineProperty(UstadBaseController, 'Companion', {
  get: UstadBaseController$Companion_getInstance});
  package$controller.UstadBaseController = UstadBaseController;
  package$controller.UstadDetailPresenter = UstadDetailPresenter;
  UstadEditPresenter.JsonLoadListener = UstadEditPresenter$JsonLoadListener;
  package$controller.UstadEditPresenter = UstadEditPresenter;
  package$controller.UstadListPresenter = UstadListPresenter;
  UstadSingleEntityPresenter.OnLoadDataCompletedListener = UstadSingleEntityPresenter$OnLoadDataCompletedListener;
  Object.defineProperty(UstadSingleEntityPresenter$PersistenceMode, 'DB', {
  get: UstadSingleEntityPresenter$PersistenceMode$DB_getInstance});
  Object.defineProperty(UstadSingleEntityPresenter$PersistenceMode, 'JSON', {
  get: UstadSingleEntityPresenter$PersistenceMode$JSON_getInstance});
  Object.defineProperty(UstadSingleEntityPresenter$PersistenceMode, 'LIVEDATA', {
  get: UstadSingleEntityPresenter$PersistenceMode$LIVEDATA_getInstance});
  UstadSingleEntityPresenter.PersistenceMode = UstadSingleEntityPresenter$PersistenceMode;
  package$controller.UstadSingleEntityPresenter = UstadSingleEntityPresenter;
  Object.defineProperty(VerbEntityListPresenter$SortOrder, 'ORDER_NAME_ASC', {
  get: VerbEntityListPresenter$SortOrder$ORDER_NAME_ASC_getInstance});
  Object.defineProperty(VerbEntityListPresenter$SortOrder, 'ORDER_NAME_DSC', {
  get: VerbEntityListPresenter$SortOrder$ORDER_NAME_DSC_getInstance});
  VerbEntityListPresenter.SortOrder = VerbEntityListPresenter$SortOrder;
  VerbEntityListPresenter.VerbEntityListSortOption = VerbEntityListPresenter$VerbEntityListSortOption;
  package$controller.VerbEntityListPresenter = VerbEntityListPresenter;
  VideoContentPresenterCommon.VideoParams = VideoContentPresenterCommon$VideoParams;
  Object.defineProperty(VideoContentPresenterCommon, 'Companion', {
  get: VideoContentPresenterCommon$Companion_getInstance});
  package$controller.VideoContentPresenterCommon = VideoContentPresenterCommon;
  IndexLog.IndexEntry = IndexLog$IndexEntry;
  package$controller.IndexLog = IndexLog;
  package$controller.WebChunkPresenterCommon = WebChunkPresenterCommon;
  package$controller.XapiPackageContentPresenter = XapiPackageContentPresenter;
  var package$db = package$core.db || (package$core.db = {});
  package$db.PermissionManagementIncomingReplicationListener = PermissionManagementIncomingReplicationListener;
  package$db.RepSubscriptionInitListener = RepSubscriptionInitListener;
  var package$impl = package$core.impl || (package$core.impl = {});
  Object.defineProperty(package$impl, 'AppConfig', {
  get: AppConfig_getInstance});
  Object.defineProperty(package$impl, 'AppErrorCode', {
  get: AppErrorCode_getInstance});
  package$impl.ContainerMountRequest = ContainerMountRequest;
  package$impl.ContainerStorageDir = ContainerStorageDir;
  package$impl.ErrorCodeException = ErrorCodeException;
  package$impl.NavigateForResultOptions = NavigateForResultOptions;
  package$impl.NoAppFoundException = NoAppFoundException;
  Object.defineProperty(UMLog, 'Companion', {
  get: UMLog$Companion_getInstance});
  package$impl.UMLog = UMLog;
  Object.defineProperty(package$impl, 'UstadMobileConstants', {
  get: UstadMobileConstants_getInstance});
  Object.defineProperty(package$impl, 'UstadMobileDefaults', {
  get: UstadMobileDefaults_getInstance});
  UstadMobileSystemCommon.LastGoToDest = UstadMobileSystemCommon$LastGoToDest;
  Object.defineProperty(UstadMobileSystemCommon$UstadGoOptions, 'Companion', {
  get: UstadMobileSystemCommon$UstadGoOptions$Companion_getInstance});
  UstadMobileSystemCommon.UstadGoOptions = UstadMobileSystemCommon$UstadGoOptions;
  Object.defineProperty(UstadMobileSystemCommon, 'Companion', {
  get: UstadMobileSystemCommon$Companion_getInstance});
  package$impl.UstadMobileSystemCommon = UstadMobileSystemCommon;
  var package$locale_0 = package$impl.locale || (package$impl.locale = {});
  package$locale_0.StringsXml = StringsXml;
  var package$nav_0 = package$impl.nav || (package$impl.nav = {});
  package$nav_0.UstadBackStackEntry = UstadBackStackEntry;
  package$nav_0.get_viewUri_valqi9$ = get_viewUri;
  package$nav_0.UstadNavController = UstadNavController;
  package$nav_0.navigateToErrorScreen_hfsw9g$ = navigateToErrorScreen;
  package$nav_0.UstadSavedStateHandle = UstadSavedStateHandle;
  Object.defineProperty(ConcatenatedEntry, 'Companion', {
  get: ConcatenatedEntry$Companion_getInstance});
  var package$io = package$core.io || (package$core.io = {});
  package$io.ConcatenatedEntry = ConcatenatedEntry;
  Object.defineProperty(UploadSessionParams, 'Companion', {
  get: UploadSessionParams$Companion_getInstance});
  Object.defineProperty(UploadSessionParams, '$serializer', {
  get: UploadSessionParams$$serializer_getInstance});
  package$io.UploadSessionParams_init_tyi0co$ = UploadSessionParams_init;
  package$io.UploadSessionParams = UploadSessionParams;
  var package$ext = package$io.ext || (package$io.ext = {});
  package$ext.toConcatenatedEntry_i6o7gc$ = toConcatenatedEntry;
  package$ext.toContainerEntryWithMd5_pvt63f$ = toContainerEntryWithMd5;
  Object.defineProperty(BitmaskFlag, 'Companion', {
  get: BitmaskFlag$Companion_getInstance});
  Object.defineProperty(BitmaskFlag, '$serializer', {
  get: BitmaskFlag$$serializer_getInstance});
  var package$model = package$core.model || (package$core.model = {});
  package$model.BitmaskFlag_init_48owkz$ = BitmaskFlag_init;
  package$model.BitmaskFlag = BitmaskFlag;
  package$model.BitmaskMessageId = BitmaskMessageId;
  package$model.HeadResponse = HeadResponse;
  var package$network = package$core.network || (package$core.network = {});
  package$network.NetworkProgressListener = NetworkProgressListener;
  package$network.NetworkProgressListenerAdapter = NetworkProgressListenerAdapter;
  var package$containerfetcher = package$network.containerfetcher || (package$network.containerfetcher = {});
  package$containerfetcher.ContainerFetcherListener2 = ContainerFetcherListener2;
  package$containerfetcher.ContainerFetcherRequest2 = ContainerFetcherRequest2;
  var package$containeruploader = package$network.containeruploader || (package$network.containeruploader = {});
  package$containeruploader.ContainerUploaderListener = ContainerUploaderListener;
  package$containeruploader.ContainerUploaderRequest2 = ContainerUploaderRequest2;
  var package$networkmanager = package$core.networkmanager || (package$core.networkmanager = {});
  package$networkmanager.ConnectivityLiveData = ConnectivityLiveData;
  package$networkmanager.AvailabilityMonitorRequest = AvailabilityMonitorRequest;
  var package$schedule = package$core.schedule || (package$core.schedule = {});
  package$schedule.createClazzLogs_fqesr4$ = createClazzLogs;
  Object.defineProperty(ClazzLogCreatorManager, 'Companion', {
  get: ClazzLogCreatorManager$Companion_getInstance});
  package$schedule.ClazzLogCreatorManager = ClazzLogCreatorManager;
  package$schedule.generateUid_cpeifx$ = generateUid;
  package$schedule.toOffsetByTimezone_ok0rt4$ = toOffsetByTimezone;
  package$schedule.toLocalMidnight_ok0rt4$ = toLocalMidnight;
  package$schedule.age_m2ds6$ = age;
  package$schedule.get_localMidnight_ksqbhc$ = get_localMidnight;
  package$schedule.get_localEndOfDay_ksqbhc$ = get_localEndOfDay;
  package$schedule.nextDayOfWeek_f0ivx5$ = nextDayOfWeek;
  package$schedule.nextOccurence_b7i187$ = nextOccurence;
  var package$tincan = package$core.tincan || (package$core.tincan = {});
  package$tincan.Activity = Activity;
  package$tincan.Registration = Registration;
  package$tincan.TinCanResult = TinCanResult;
  Object.defineProperty(TinCanXML, 'Companion', {
  get: TinCanXML$Companion_getInstance});
  package$tincan.TinCanXML = TinCanXML;
  Object.defineProperty(UmAccountActor$Account, 'Companion', {
  get: UmAccountActor$Account$Companion_getInstance});
  Object.defineProperty(UmAccountActor$Account, '$serializer', {
  get: UmAccountActor$Account$$serializer_getInstance});
  UmAccountActor.Account_init_1jgqbb$ = UmAccountActor$UmAccountActor$Account_init;
  UmAccountActor.Account = UmAccountActor$Account;
  Object.defineProperty(UmAccountActor, 'Companion', {
  get: UmAccountActor$Companion_getInstance});
  Object.defineProperty(UmAccountActor, '$serializer', {
  get: UmAccountActor$$serializer_getInstance});
  package$tincan.UmAccountActor_init_4f88fg$ = UmAccountActor_init;
  package$tincan.UmAccountActor = UmAccountActor;
  Object.defineProperty(UmAccountGroupActor, 'Companion', {
  get: UmAccountGroupActor$Companion_getInstance});
  Object.defineProperty(UmAccountGroupActor, '$serializer', {
  get: UmAccountGroupActor$$serializer_getInstance});
  package$tincan.UmAccountGroupActor_init_ux5f7o$ = UmAccountGroupActor_init;
  package$tincan.UmAccountGroupActor = UmAccountGroupActor;
  var package$util = package$core.util || (package$core.util = {});
  Object.defineProperty(package$util, 'mimeTypeToPlayStoreIdMap', {
  get: function() {
  return mimeTypeToPlayStoreIdMap;
}});
  package$util.ContentEntryOpener = ContentEntryOpener;
  package$util.DefaultOneToManyJoinEditHelper = DefaultOneToManyJoinEditHelper;
  Object.defineProperty(package$util, 'DiTag', {
  get: DiTag_getInstance});
  package$util.EventCollator = EventCollator;
  package$util.IdOption = IdOption;
  package$util.ListFilterIdOption = ListFilterIdOption;
  package$util.LiveDataWorkQueue = LiveDataWorkQueue;
  Object.defineProperty(package$util, 'LocaleUtil', {
  get: LocaleUtil_getInstance});
  package$util.min_3pjtqy$ = min;
  Object.defineProperty(LongWrapper, 'Companion', {
  get: LongWrapper$Companion_getInstance});
  Object.defineProperty(LongWrapper, '$serializer', {
  get: LongWrapper$$serializer_getInstance});
  package$util.LongWrapper_init_oaprxw$ = LongWrapper_init;
  package$util.LongWrapper = LongWrapper;
  package$util.MessageIdOption = MessageIdOption;
  package$util.NavigateForResultOneToManyJoinEditListener = NavigateForResultOneToManyJoinEditListener;
  package$util.ObjectMessageIdOption = ObjectMessageIdOption;
  package$util.OnListFilterOptionSelectedListener = OnListFilterOptionSelectedListener;
  Object.defineProperty(OneToManyJoinEditHelper, 'Companion', {
  get: OneToManyJoinEditHelper$Companion_getInstance});
  package$util.OneToManyJoinEditHelper = OneToManyJoinEditHelper;
  Object.defineProperty(OneToManyJoinEditHelperMp, 'Companion', {
  get: OneToManyJoinEditHelperMp$Companion_getInstance});
  package$util.OneToManyJoinEditHelperMp = OneToManyJoinEditHelperMp;
  package$util.OneToManyJoinEditListener = OneToManyJoinEditListener;
  package$util.RateLimitedLiveData = RateLimitedLiveData;
  package$util.safeStringify_e1gqcp$ = safeStringify;
  package$util.millisSinceMidnightToHoursAndMins_za3lpa$ = millisSinceMidnightToHoursAndMins;
  package$util.hoursAndMinsToMillisSinceMidnight_vux9f0$ = hoursAndMinsToMillisSinceMidnight;
  Object.defineProperty(ScopedGrantOneToManyHelper, 'Companion', {
  get: ScopedGrantOneToManyHelper$Companion_getInstance});
  package$util.ScopedGrantOneToManyHelper = ScopedGrantOneToManyHelper;
  package$util.SortOrderOption = SortOrderOption;
  package$util.TreeOneToManyJoinEditListener = TreeOneToManyJoinEditListener;
  Object.defineProperty(package$util, 'UMCalendarUtil', {
  get: UMCalendarUtil_getInstance});
  UMFileUtil.prototype.TypeWithParamHeader = UMFileUtil$TypeWithParamHeader;
  Object.defineProperty(package$util, 'UMFileUtil', {
  get: UMFileUtil_getInstance});
  Object.defineProperty(package$util, 'UMTinCanUtil', {
  get: UMTinCanUtil_getInstance});
  Object.defineProperty(UstadUrlComponents, 'Companion', {
  get: UstadUrlComponents$Companion_getInstance});
  package$util.UstadUrlComponents = UstadUrlComponents;
  package$util.XmlPullParserHandle = XmlPullParserHandle;
  var package$ext_0 = package$util.ext || (package$util.ext = {});
  package$ext_0.AlreadyEnroledInClassException = AlreadyEnroledInClassException;
  package$ext_0.AlreadyEnroledInSchoolException = AlreadyEnroledInSchoolException;
  package$ext_0.get_combinedFlagValue_vqgi3$ = get_combinedFlagValue;
  Object.defineProperty(package$ext_0, 'ROLE_TO_MESSAGEID_MAP', {
  get: function() {
  return ROLE_TO_MESSAGEID_MAP;
}});
  package$ext_0.roleToString_jnztfp$ = roleToString;
  Object.defineProperty(package$ext_0, 'OUTCOME_TO_MESSAGE_ID_MAP', {
  get: function() {
  return OUTCOME_TO_MESSAGE_ID_MAP;
}});
  package$ext_0.outcomeToString_jnztfp$ = outcomeToString;
  package$ext_0.isRolePending_7pnpf$ = isRolePending;
  package$ext_0.isAttendanceEnabledAndRecorded_a89p9$ = isAttendanceEnabledAndRecorded;
  package$ext_0.isStartOrEndTimeSet_8t4d5u$ = isStartOrEndTimeSet;
  package$ext_0.attendancePercentage_cpeifx$ = attendancePercentage;
  package$ext_0.latePercentage_cpeifx$ = latePercentage;
  package$ext_0.get_effectiveTimeZone_e6cu1y$ = get_effectiveTimeZone;
  package$ext_0.effectiveTimeZone_drggv2$ = effectiveTimeZone;
  package$ext_0.roundTo_lcymw2$ = roundTo;
  package$ext_0.deleteZombieContainerEntryFiles_ebxut3$ = deleteZombieContainerEntryFiles;
  package$ext_0.distinctMds5sSorted_x3bfnl$ = distinctMds5sSorted;
  package$ext_0.distinctMd5sSortedAsJoinedQueryParam_x3bfnl$ = distinctMd5sSortedAsJoinedQueryParam;
  package$ext_0.toDeepLink_894xf9$ = toDeepLink;
  package$ext_0.makeContentEntryDeepLink_et378p$ = makeContentEntryDeepLink;
  package$ext_0.isContentComplete_jw4k00$ = isContentComplete;
  package$ext_0.calculateScoreWithPenalty_jw4k00$ = calculateScoreWithPenalty;
  package$ext_0.calculateScoreWithWeight_jw4k00$ = calculateScoreWithWeight;
  package$ext_0.isStatusPaused_s8ev3n$ = isStatusPaused;
  package$ext_0.isStatusCompleted_s8ev3n$ = isStatusCompleted;
  package$ext_0.isStatusActiveOrQueued_s8ev3n$ = isStatusActiveOrQueued;
  package$ext_0.isStatusQueuedOrDownloading_m01swd$ = isStatusQueuedOrDownloading;
  package$ext_0.isStatusPaused_m01swd$ = isStatusPaused_0;
  package$ext_0.isStatusCompletedSuccessfully_m01swd$ = isStatusCompletedSuccessfully;
  package$ext_0.isStatusCompleted_m01swd$ = isStatusCompleted_0;
  package$ext_0.isStatusPausedOrQueuedOrDownloading_m01swd$ = isStatusPausedOrQueuedOrDownloading;
  package$ext_0.toStatusString_e47v2r$ = toStatusString;
  package$ext_0.updateTotalFromLocalUriIfNeeded_k8ajr3$ = updateTotalFromLocalUriIfNeeded;
  package$ext_0.updateTotalFromContainerSize_wprv60$ = updateTotalFromContainerSize;
  package$ext_0.fallbackIndividualSet_fl2ch8$ = fallbackIndividualSet;
  package$ext_0.toTermMap_te2ciz$ = toTermMap;
  package$ext_0.toFixedDatePair_rku2ti$ = toFixedDatePair;
  package$ext_0.toFixedDate_f47ve1$ = toFixedDate;
  package$ext_0.toDisplayString_rku2ti$ = toDisplayString;
  package$ext_0.toDisplayString_f47ve1$ = toDisplayString_0;
  package$ext_0.logErrorReport_kcov3e$ = logErrorReport;
  package$ext_0.isTextContent_hvno4e$ = isTextContent;
  package$ext_0.verifySite_9qxg48$ = verifySite;
  package$ext_0.alternative_dqglrj$ = alternative;
  package$ext_0.alternative_2p08ub$ = alternative_0;
  package$ext_0.hasFlag_dqglrj$ = hasFlag;
  package$ext_0.foldWithBinaryOr_dmxgdv$ = foldWithBinaryOr;
  package$ext_0.encodeStringMapToString_lzia5$ = encodeStringMapToString;
  package$ext_0.decodeStringMapFromString_abqhco$ = decodeStringMapFromString;
  package$ext_0.toListFilterOptions_2w9qm0$ = toListFilterOptions;
  package$ext_0.hasFlag_2p08ub$ = hasFlag_0;
  package$ext_0.toQueryString_alv72w$ = toQueryString;
  package$ext_0.toDeepLink_t6f5fs$ = toDeepLink_0;
  package$ext_0.putEntityAsJson_hkgq1x$ = putEntityAsJson;
  package$ext_0.putFromOtherMapIfPresent_8kfss9$ = putFromOtherMapIfPresent;
  package$ext_0.putIfNotAlreadySet_6y9eq4$ = putIfNotAlreadySet;
  package$ext_0.putResultDestInfo_g2y97u$ = putResultDestInfo;
  package$ext_0.determineListMode_alv72w$ = determineListMode;
  package$ext_0.addSafelyToPosition_yd8n6p$ = addSafelyToPosition;
  package$ext_0.addAllSafelyToPosition_bjnc78$ = addAllSafelyToPosition;
  Object.defineProperty(package$ext_0, 'VALID_RESOLUTIONS', {
  get: function() {
  return VALID_RESOLUTIONS;
}});
  package$ext_0.variance_mp9nht$ = variance;
  package$ext_0.fitWithin_lzxux8$ = fitWithin;
  package$ext_0.personFullName_gj5mh8$ = personFullName;
  package$ext_0.toUmAccount_w5ztqi$ = toUmAccount;
  package$ext_0.get_isMinor_gj5mh8$ = get_isMinor;
  package$ext_0.toUmAccount_vi6a8k$ = toUmAccount_0;
  package$ext_0.toDateRangeMoment_csgv79$ = toDateRangeMoment;
  package$ext_0.toDisplayString_c3h9dv$ = toDisplayString_1;
  package$ext_0.QueryParts = QueryParts;
  package$ext_0.toSql_5vl1q1$ = toSql;
  package$ext_0.generateSql_fmioye$ = generateSql;
  package$ext_0.toBitmaskFlagList_ar9drr$ = toBitmaskFlagList;
  package$ext_0.encryptWithPbkdf2_w2y7qm$ = encryptWithPbkdf2;
  package$ext_0.doublePbkdf2Hash_w2y7qm$ = doublePbkdf2Hash;
  package$ext_0.inBrackets_pdl1vz$ = inBrackets;
  package$ext_0.toQueryLikeParam_5cw0du$ = toQueryLikeParam;
  package$ext_0.requirePostfix_7epoxm$ = requirePostfix;
  package$ext_0.alternative_9xlg28$ = alternative_1;
  package$ext_0.hexStringToBase64Encoded_pdl1vz$ = hexStringToBase64Encoded;
  package$ext_0.base64EncodedToHexString_pdl1vz$ = base64EncodedToHexString;
  package$ext_0.truncate_6ic1pp$ = truncate;
  package$ext_0.startsWithHttpProtocol_pdl1vz$ = startsWithHttpProtocol;
  package$ext_0.requireHttpPrefix_rjktp$ = requireHttpPrefix;
  package$ext_0.appendQueryArgs_rjktp$ = appendQueryArgs;
  package$ext_0.appendQueryArgs_mnrph9$ = appendQueryArgs_0;
  package$ext_0.appendQueryArgs_nnfx2g$ = appendQueryArgs_1;
  package$ext_0.capitalizeFirstLetter_pdl1vz$ = capitalizeFirstLetter;
  package$ext_0.countWords_pdl1vz$ = countWords;
  package$ext_0.toXapiActorJsonObject_h2wjj6$ = toXapiActorJsonObject;
  package$ext_0.toXapiGroupJsonObject_27ua1t$ = toXapiGroupJsonObject;
  package$ext_0.get_userAtServer_tn71r4$ = get_userAtServer;
  package$ext_0.asPerson_iqb5q3$ = asPerson;
  package$ext_0.runPreload_j4q3kk$ = runPreload;
  package$ext_0.createNewClazzAndGroups_4mnsqb$ = createNewClazzAndGroups;
  package$ext_0.enrolPersonIntoClazzAtLocalTimezone_auo0vf$ = enrolPersonIntoClazzAtLocalTimezone;
  package$ext_0.processEnrolmentIntoClass_c3yi0x$ = processEnrolmentIntoClass;
  package$ext_0.enrolPersonIntoSchoolAtLocalTimezone_v4blca$ = enrolPersonIntoSchoolAtLocalTimezone;
  package$ext_0.approvePendingClazzEnrolment_v1bshy$ = approvePendingClazzEnrolment;
  package$ext_0.declinePendingClazzEnrolment_v1bshy$ = declinePendingClazzEnrolment;
  package$ext_0.approvePendingSchoolMember_ow92mf$ = approvePendingSchoolMember;
  package$ext_0.insertPersonAndGroup_bv3nbr$ = insertPersonAndGroup;
  package$ext_0.insertPersonOnlyAndGroup_nvunll$ = insertPersonOnlyAndGroup;
  package$ext_0.generateChartData_nbeg7f$ = generateChartData;
  package$ext_0.generateStatementList_yun2cv$ = generateStatementList;
  package$ext_0.ChartData = ChartData;
  package$ext_0.SeriesData = SeriesData;
  package$ext_0.createNewSchoolAndGroups_b3a7l2$ = createNewSchoolAndGroups;
  package$ext_0.enrollPersonToSchool_6n6bfw$ = enrollPersonToSchool;
  package$ext_0.get_maxQueryParamListSize_twslah$ = get_maxQueryParamListSize;
  package$ext_0.ContainerEntryWithMd5Partition = ContainerEntryWithMd5Partition;
  package$ext_0.ContainerEntryPartition = ContainerEntryPartition;
  package$ext_0.partitionContainerEntriesWithMd5_lh2cak$ = partitionContainerEntriesWithMd5;
  package$ext_0.linkExistingContainerEntries_ym7u2n$ = linkExistingContainerEntries;
  package$ext_0.ScopedGrantResult = ScopedGrantResult;
  package$ext_0.grantScopedPermission_b1uxqp$ = grantScopedPermission;
  package$ext_0.grantScopedPermission_xejr0n$ = grantScopedPermission_0;
  package$ext_0.insertPersonAuthCredentials2_4a01e2$ = insertPersonAuthCredentials2;
  package$ext_0.validateAndUpdateContainerSize_l1kd2m$ = validateAndUpdateContainerSize;
  package$ext_0.withEndpoint_yhqvnh$ = withEndpoint;
  package$ext_0.getOrGenerateNodeIdAndAuth_wygjn3$ = getOrGenerateNodeIdAndAuth;
  var package$graph = package$util.graph || (package$util.graph = {});
  package$graph.LabelValueFormatter = LabelValueFormatter;
  package$graph.MessageIdFormatter = MessageIdFormatter;
  package$graph.TimeFormatter = TimeFormatter;
  package$graph.UidAndLabelFormatter = UidAndLabelFormatter;
  Object.defineProperty(AboutView, 'Companion', {
  get: AboutView$Companion_getInstance});
  var package$view = package$core.view || (package$core.view = {});
  package$view.AboutView = AboutView;
  Object.defineProperty(AccountListView, 'Companion', {
  get: AccountListView$Companion_getInstance});
  package$view.AccountListView = AccountListView;
  Object.defineProperty(BitmaskEditView, 'Companion', {
  get: BitmaskEditView$Companion_getInstance});
  package$view.BitmaskEditView = BitmaskEditView;
  Object.defineProperty(ChatDetailView, 'Companion', {
  get: ChatDetailView$Companion_getInstance});
  package$view.ChatDetailView = ChatDetailView;
  Object.defineProperty(ChatListView, 'Companion', {
  get: ChatListView$Companion_getInstance});
  package$view.ChatListView = ChatListView;
  Object.defineProperty(ClazzAssignmentDetailOverviewView, 'Companion', {
  get: ClazzAssignmentDetailOverviewView$Companion_getInstance});
  package$view.ClazzAssignmentDetailOverviewView = ClazzAssignmentDetailOverviewView;
  Object.defineProperty(ClazzAssignmentDetailStudentProgressOverviewListView, 'Companion', {
  get: ClazzAssignmentDetailStudentProgressOverviewListView$Companion_getInstance});
  package$view.ClazzAssignmentDetailStudentProgressOverviewListView = ClazzAssignmentDetailStudentProgressOverviewListView;
  Object.defineProperty(ClazzAssignmentDetailStudentProgressView, 'Companion', {
  get: ClazzAssignmentDetailStudentProgressView$Companion_getInstance});
  package$view.ClazzAssignmentDetailStudentProgressView = ClazzAssignmentDetailStudentProgressView;
  Object.defineProperty(ClazzAssignmentDetailView, 'Companion', {
  get: ClazzAssignmentDetailView$Companion_getInstance});
  package$view.ClazzAssignmentDetailView = ClazzAssignmentDetailView;
  Object.defineProperty(ClazzAssignmentEditView, 'Companion', {
  get: ClazzAssignmentEditView$Companion_getInstance});
  package$view.ClazzAssignmentEditView = ClazzAssignmentEditView;
  Object.defineProperty(ClazzDetailOverviewView, 'Companion', {
  get: ClazzDetailOverviewView$Companion_getInstance});
  package$view.ClazzDetailOverviewView = ClazzDetailOverviewView;
  Object.defineProperty(ClazzDetailView, 'Companion', {
  get: ClazzDetailView$Companion_getInstance});
  package$view.ClazzDetailView = ClazzDetailView;
  Object.defineProperty(ClazzEdit2View, 'Companion', {
  get: ClazzEdit2View$Companion_getInstance});
  package$view.ClazzEdit2View = ClazzEdit2View;
  Object.defineProperty(ClazzEnrolmentEditView, 'Companion', {
  get: ClazzEnrolmentEditView$Companion_getInstance});
  package$view.ClazzEnrolmentEditView = ClazzEnrolmentEditView;
  Object.defineProperty(ClazzEnrolmentListView, 'Companion', {
  get: ClazzEnrolmentListView$Companion_getInstance});
  package$view.ClazzEnrolmentListView = ClazzEnrolmentListView;
  Object.defineProperty(ClazzList2View, 'Companion', {
  get: ClazzList2View$Companion_getInstance});
  package$view.ClazzList2View = ClazzList2View;
  Object.defineProperty(ClazzLogEditAttendanceView, 'Companion', {
  get: ClazzLogEditAttendanceView$Companion_getInstance});
  package$view.ClazzLogEditAttendanceView = ClazzLogEditAttendanceView;
  Object.defineProperty(ClazzLogEditView, 'Companion', {
  get: ClazzLogEditView$Companion_getInstance});
  package$view.ClazzLogEditView = ClazzLogEditView;
  Object.defineProperty(ClazzLogListAttendanceView, 'Companion', {
  get: ClazzLogListAttendanceView$Companion_getInstance});
  package$view.ClazzLogListAttendanceView = ClazzLogListAttendanceView;
  Object.defineProperty(ClazzMemberListView, 'Companion', {
  get: ClazzMemberListView$Companion_getInstance});
  package$view.ClazzMemberListView = ClazzMemberListView;
  Object.defineProperty(ContainerMounter, 'Companion', {
  get: ContainerMounter$Companion_getInstance});
  package$view.ContainerMounter = ContainerMounter;
  Object.defineProperty(ContentEntryAddOptionsView, 'Companion', {
  get: ContentEntryAddOptionsView$Companion_getInstance});
  package$view.ContentEntryAddOptionsView = ContentEntryAddOptionsView;
  Object.defineProperty(ContentEntryDetailAttemptsListView, 'Companion', {
  get: ContentEntryDetailAttemptsListView$Companion_getInstance});
  package$view.ContentEntryDetailAttemptsListView = ContentEntryDetailAttemptsListView;
  Object.defineProperty(ContentEntryDetailOverviewView, 'Companion', {
  get: ContentEntryDetailOverviewView$Companion_getInstance});
  package$view.ContentEntryDetailOverviewView = ContentEntryDetailOverviewView;
  Object.defineProperty(ContentEntryDetailView, 'Companion', {
  get: ContentEntryDetailView$Companion_getInstance});
  package$view.ContentEntryDetailView = ContentEntryDetailView;
  Object.defineProperty(ContentEntryEdit2View, 'Companion', {
  get: ContentEntryEdit2View$Companion_getInstance});
  package$view.ContentEntryEdit2View = ContentEntryEdit2View;
  Object.defineProperty(ContentEntryImportLinkView, 'Companion', {
  get: ContentEntryImportLinkView$Companion_getInstance});
  package$view.ContentEntryImportLinkView = ContentEntryImportLinkView;
  Object.defineProperty(ContentEntryList2View, 'Companion', {
  get: ContentEntryList2View$Companion_getInstance});
  package$view.ContentEntryList2View = ContentEntryList2View;
  Object.defineProperty(CourseDiscussionDetailView, 'Companion', {
  get: CourseDiscussionDetailView$Companion_getInstance});
  package$view.CourseDiscussionDetailView = CourseDiscussionDetailView;
  Object.defineProperty(CourseDiscussionEditView, 'Companion', {
  get: CourseDiscussionEditView$Companion_getInstance});
  package$view.CourseDiscussionEditView = CourseDiscussionEditView;
  Object.defineProperty(CourseGroupSetDetailView, 'Companion', {
  get: CourseGroupSetDetailView$Companion_getInstance});
  package$view.CourseGroupSetDetailView = CourseGroupSetDetailView;
  Object.defineProperty(CourseGroupSetEditView, 'Companion', {
  get: CourseGroupSetEditView$Companion_getInstance});
  package$view.CourseGroupSetEditView = CourseGroupSetEditView;
  Object.defineProperty(CourseGroupSetListView, 'Companion', {
  get: CourseGroupSetListView$Companion_getInstance});
  package$view.CourseGroupSetListView = CourseGroupSetListView;
  Object.defineProperty(CourseTerminologyEditView, 'Companion', {
  get: CourseTerminologyEditView$Companion_getInstance});
  package$view.CourseTerminologyEditView = CourseTerminologyEditView;
  Object.defineProperty(CourseTerminologyListView, 'Companion', {
  get: CourseTerminologyListView$Companion_getInstance});
  package$view.CourseTerminologyListView = CourseTerminologyListView;
  Object.defineProperty(DateRangeView, 'Companion', {
  get: DateRangeView$Companion_getInstance});
  package$view.DateRangeView = DateRangeView;
  package$view.DialogResultListener = DialogResultListener;
  Object.defineProperty(DiscussionPostDetailView, 'Companion', {
  get: DiscussionPostDetailView$Companion_getInstance});
  package$view.DiscussionPostDetailView = DiscussionPostDetailView;
  Object.defineProperty(DiscussionPostEditView, 'Companion', {
  get: DiscussionPostEditView$Companion_getInstance});
  package$view.DiscussionPostEditView = DiscussionPostEditView;
  Object.defineProperty(DiscussionTopicDetailView, 'Companion', {
  get: DiscussionTopicDetailView$Companion_getInstance});
  package$view.DiscussionTopicDetailView = DiscussionTopicDetailView;
  Object.defineProperty(DiscussionTopicEditView, 'Companion', {
  get: DiscussionTopicEditView$Companion_getInstance});
  package$view.DiscussionTopicEditView = DiscussionTopicEditView;
  package$view.DismissableDialog = DismissableDialog;
  Object.defineProperty(EpubContentView, 'Companion', {
  get: EpubContentView$Companion_getInstance});
  package$view.EpubContentView = EpubContentView;
  Object.defineProperty(ErrorReportView, 'Companion', {
  get: ErrorReportView$Companion_getInstance});
  package$view.ErrorReportView = ErrorReportView;
  Object.defineProperty(HarView, 'Companion', {
  get: HarView$Companion_getInstance});
  package$view.HarView = HarView;
  Object.defineProperty(HolidayCalendarEditView, 'Companion', {
  get: HolidayCalendarEditView$Companion_getInstance});
  package$view.HolidayCalendarEditView = HolidayCalendarEditView;
  Object.defineProperty(HolidayCalendarListView, 'Companion', {
  get: HolidayCalendarListView$Companion_getInstance});
  package$view.HolidayCalendarListView = HolidayCalendarListView;
  Object.defineProperty(HolidayEditView, 'Companion', {
  get: HolidayEditView$Companion_getInstance});
  package$view.HolidayEditView = HolidayEditView;
  Object.defineProperty(HtmlTextViewDetailView, 'Companion', {
  get: HtmlTextViewDetailView$Companion_getInstance});
  package$view.HtmlTextViewDetailView = HtmlTextViewDetailView;
  Object.defineProperty(InviteViaLinkView, 'Companion', {
  get: InviteViaLinkView$Companion_getInstance});
  package$view.InviteViaLinkView = InviteViaLinkView;
  package$view.ItemTouchHelperListener = ItemTouchHelperListener;
  Object.defineProperty(JoinWithCodeView, 'Companion', {
  get: JoinWithCodeView$Companion_getInstance});
  package$view.JoinWithCodeView = JoinWithCodeView;
  Object.defineProperty(LanguageEditView, 'Companion', {
  get: LanguageEditView$Companion_getInstance});
  package$view.LanguageEditView = LanguageEditView;
  Object.defineProperty(LanguageListView, 'Companion', {
  get: LanguageListView$Companion_getInstance});
  package$view.LanguageListView = LanguageListView;
  Object.defineProperty(LearnerGroupMemberListView, 'Companion', {
  get: LearnerGroupMemberListView$Companion_getInstance});
  package$view.LearnerGroupMemberListView = LearnerGroupMemberListView;
  Object.defineProperty(LeavingReasonEditView, 'Companion', {
  get: LeavingReasonEditView$Companion_getInstance});
  package$view.LeavingReasonEditView = LeavingReasonEditView;
  Object.defineProperty(LeavingReasonListView, 'Companion', {
  get: LeavingReasonListView$Companion_getInstance});
  package$view.LeavingReasonListView = LeavingReasonListView;
  Object.defineProperty(Login2View, 'Companion', {
  get: Login2View$Companion_getInstance});
  package$view.Login2View = Login2View;
  Object.defineProperty(ModuleCourseBlockEditView, 'Companion', {
  get: ModuleCourseBlockEditView$Companion_getInstance});
  package$view.ModuleCourseBlockEditView = ModuleCourseBlockEditView;
  Object.defineProperty(OnBoardingView, 'Companion', {
  get: OnBoardingView$Companion_getInstance});
  package$view.OnBoardingView = OnBoardingView;
  package$view.OnClickNewListItemListener = OnClickNewListItemListener;
  Object.defineProperty(ParentalConsentManagementView, 'Companion', {
  get: ParentalConsentManagementView$Companion_getInstance});
  package$view.ParentalConsentManagementView = ParentalConsentManagementView;
  Object.defineProperty(PersonAccountEditView, 'Companion', {
  get: PersonAccountEditView$Companion_getInstance});
  package$view.PersonAccountEditView = PersonAccountEditView;
  Object.defineProperty(PersonDetailView, 'Companion', {
  get: PersonDetailView$Companion_getInstance});
  package$view.PersonDetailView = PersonDetailView;
  Object.defineProperty(PersonEditView, 'Companion', {
  get: PersonEditView$Companion_getInstance});
  package$view.PersonEditView = PersonEditView;
  Object.defineProperty(PersonGroupEditView, 'Companion', {
  get: PersonGroupEditView$Companion_getInstance});
  package$view.PersonGroupEditView = PersonGroupEditView;
  Object.defineProperty(PersonGroupListView, 'Companion', {
  get: PersonGroupListView$Companion_getInstance});
  package$view.PersonGroupListView = PersonGroupListView;
  Object.defineProperty(PersonListView, 'Companion', {
  get: PersonListView$Companion_getInstance});
  package$view.PersonListView = PersonListView;
  Object.defineProperty(RedirectView, 'Companion', {
  get: RedirectView$Companion_getInstance});
  package$view.RedirectView = RedirectView;
  Object.defineProperty(RegisterAgeRedirectView, 'Companion', {
  get: RegisterAgeRedirectView$Companion_getInstance});
  package$view.RegisterAgeRedirectView = RegisterAgeRedirectView;
  Object.defineProperty(RegisterMinorWaitForParentView, 'Companion', {
  get: RegisterMinorWaitForParentView$Companion_getInstance});
  package$view.RegisterMinorWaitForParentView = RegisterMinorWaitForParentView;
  Object.defineProperty(ReportDashboardView, 'Companion', {
  get: ReportDashboardView$Companion_getInstance});
  package$view.ReportDashboardView = ReportDashboardView;
  Object.defineProperty(ReportDetailView, 'Companion', {
  get: ReportDetailView$Companion_getInstance});
  package$view.ReportDetailView = ReportDetailView;
  Object.defineProperty(ReportEditView, 'Companion', {
  get: ReportEditView$Companion_getInstance});
  package$view.ReportEditView = ReportEditView;
  Object.defineProperty(ReportFilterEditView, 'Companion', {
  get: ReportFilterEditView$Companion_getInstance});
  package$view.ReportFilterEditView = ReportFilterEditView;
  Object.defineProperty(ReportListView, 'Companion', {
  get: ReportListView$Companion_getInstance});
  package$view.ReportListView = ReportListView;
  Object.defineProperty(ReportTemplateListView, 'Companion', {
  get: ReportTemplateListView$Companion_getInstance});
  package$view.ReportTemplateListView = ReportTemplateListView;
  Object.defineProperty(ScheduleEditView, 'Companion', {
  get: ScheduleEditView$Companion_getInstance});
  package$view.ScheduleEditView = ScheduleEditView;
  Object.defineProperty(SchoolDetailOverviewView, 'Companion', {
  get: SchoolDetailOverviewView$Companion_getInstance});
  package$view.SchoolDetailOverviewView = SchoolDetailOverviewView;
  Object.defineProperty(SchoolDetailView, 'Companion', {
  get: SchoolDetailView$Companion_getInstance});
  package$view.SchoolDetailView = SchoolDetailView;
  Object.defineProperty(SchoolEditView, 'Companion', {
  get: SchoolEditView$Companion_getInstance});
  package$view.SchoolEditView = SchoolEditView;
  Object.defineProperty(SchoolListView, 'Companion', {
  get: SchoolListView$Companion_getInstance});
  package$view.SchoolListView = SchoolListView;
  Object.defineProperty(SchoolMemberListView, 'Companion', {
  get: SchoolMemberListView$Companion_getInstance});
  package$view.SchoolMemberListView = SchoolMemberListView;
  Object.defineProperty(ScopedGrantDetailView, 'Companion', {
  get: ScopedGrantDetailView$Companion_getInstance});
  package$view.ScopedGrantDetailView = ScopedGrantDetailView;
  Object.defineProperty(ScopedGrantEditView, 'Companion', {
  get: ScopedGrantEditView$Companion_getInstance});
  package$view.ScopedGrantEditView = ScopedGrantEditView;
  Object.defineProperty(ScopedGrantListView, 'Companion', {
  get: ScopedGrantListView$Companion_getInstance});
  package$view.ScopedGrantListView = ScopedGrantListView;
  Object.defineProperty(SelectExtractFileView, 'Companion', {
  get: SelectExtractFileView$Companion_getInstance});
  package$view.SelectExtractFileView = SelectExtractFileView;
  Object.defineProperty(SelectFileView, 'Companion', {
  get: SelectFileView$Companion_getInstance});
  package$view.SelectFileView = SelectFileView;
  Object.defineProperty(SelectFolderView, 'Companion', {
  get: SelectFolderView$Companion_getInstance});
  package$view.SelectFolderView = SelectFolderView;
  Object.defineProperty(SessionListView, 'Companion', {
  get: SessionListView$Companion_getInstance});
  package$view.SessionListView = SessionListView;
  Object.defineProperty(SettingsView, 'Companion', {
  get: SettingsView$Companion_getInstance});
  package$view.SettingsView = SettingsView;
  Object.defineProperty(SiteDetailView, 'Companion', {
  get: SiteDetailView$Companion_getInstance});
  package$view.SiteDetailView = SiteDetailView;
  Object.defineProperty(SiteEditView, 'Companion', {
  get: SiteEditView$Companion_getInstance});
  package$view.SiteEditView = SiteEditView;
  Object.defineProperty(SiteEnterLinkView, 'Companion', {
  get: SiteEnterLinkView$Companion_getInstance});
  package$view.SiteEnterLinkView = SiteEnterLinkView;
  Object.defineProperty(SiteTermsDetailView, 'Companion', {
  get: SiteTermsDetailView$Companion_getInstance});
  package$view.SiteTermsDetailView = SiteTermsDetailView;
  Object.defineProperty(SiteTermsEditView, 'Companion', {
  get: SiteTermsEditView$Companion_getInstance});
  package$view.SiteTermsEditView = SiteTermsEditView;
  Object.defineProperty(SplashScreenView, 'Companion', {
  get: SplashScreenView$Companion_getInstance});
  package$view.SplashScreenView = SplashScreenView;
  Object.defineProperty(StatementListView, 'Companion', {
  get: StatementListView$Companion_getInstance});
  package$view.StatementListView = StatementListView;
  Object.defineProperty(TextAssignmentEditView, 'Companion', {
  get: TextAssignmentEditView$Companion_getInstance});
  package$view.TextAssignmentEditView = TextAssignmentEditView;
  Object.defineProperty(TextCourseBlockEditView, 'Companion', {
  get: TextCourseBlockEditView$Companion_getInstance});
  package$view.TextCourseBlockEditView = TextCourseBlockEditView;
  Object.defineProperty(TimeZoneListView, 'Companion', {
  get: TimeZoneListView$Companion_getInstance});
  package$view.TimeZoneListView = TimeZoneListView;
  Object.defineProperty(EditButtonMode, 'GONE', {
  get: EditButtonMode$GONE_getInstance});
  Object.defineProperty(EditButtonMode, 'FAB', {
  get: EditButtonMode$FAB_getInstance});
  package$view.EditButtonMode = EditButtonMode;
  package$view.UstadDetailView = UstadDetailView;
  Object.defineProperty(UstadEditView, 'Companion', {
  get: UstadEditView$Companion_getInstance});
  package$view.UstadEditView = UstadEditView;
  Object.defineProperty(ListViewMode, 'BROWSER', {
  get: ListViewMode$BROWSER_getInstance});
  Object.defineProperty(ListViewMode, 'PICKER', {
  get: ListViewMode$PICKER_getInstance});
  package$view.ListViewMode = ListViewMode;
  Object.defineProperty(ListViewAddMode, 'FIRST_ITEM', {
  get: ListViewAddMode$FIRST_ITEM_getInstance});
  Object.defineProperty(ListViewAddMode, 'FAB', {
  get: ListViewAddMode$FAB_getInstance});
  Object.defineProperty(ListViewAddMode, 'NONE', {
  get: ListViewAddMode$NONE_getInstance});
  package$view.ListViewAddMode = ListViewAddMode;
  Object.defineProperty(SelectionOption, 'EDIT', {
  get: SelectionOption$EDIT_getInstance});
  Object.defineProperty(SelectionOption, 'DELETE', {
  get: SelectionOption$DELETE_getInstance});
  Object.defineProperty(SelectionOption, 'MOVE', {
  get: SelectionOption$MOVE_getInstance});
  Object.defineProperty(SelectionOption, 'HIDE', {
  get: SelectionOption$HIDE_getInstance});
  Object.defineProperty(SelectionOption, 'UNHIDE', {
  get: SelectionOption$UNHIDE_getInstance});
  package$view.SelectionOption = SelectionOption;
  package$view.UstadListView = UstadListView;
  package$view.UstadSingleEntityView = UstadSingleEntityView;
  Object.defineProperty(GetResultMode, 'EDITORNEW', {
  get: GetResultMode$EDITORNEW_getInstance});
  Object.defineProperty(GetResultMode, 'FROMLIST', {
  get: GetResultMode$FROMLIST_getInstance});
  package$view.GetResultMode = GetResultMode;
  Object.defineProperty(UstadView, 'Companion', {
  get: UstadView$Companion_getInstance});
  package$view.UstadView = UstadView;
  package$view.UstadViewChoiceDialogListener = UstadViewChoiceDialogListener;
  package$view.UstadViewWithProgressDialog = UstadViewWithProgressDialog;
  Object.defineProperty(VerbEntityListView, 'Companion', {
  get: VerbEntityListView$Companion_getInstance});
  package$view.VerbEntityListView = VerbEntityListView;
  Object.defineProperty(VideoContentView, 'Companion', {
  get: VideoContentView$Companion_getInstance});
  package$view.VideoContentView = VideoContentView;
  Object.defineProperty(WebChunkView, 'Companion', {
  get: WebChunkView$Companion_getInstance});
  package$view.WebChunkView = WebChunkView;
  Object.defineProperty(XapiPackageContentView, 'Companion', {
  get: XapiPackageContentView$Companion_getInstance});
  package$view.XapiPackageContentView = XapiPackageContentView;
  package$controller.HarContentPresenter = HarContentPresenter;
  package$controller.SelectExtractFilePresenter = SelectExtractFilePresenter;
  package$controller.VideoContentPresenter = VideoContentPresenter;
  package$controller.WebChunkPresenter = WebChunkPresenter;
  package$impl.ContainerStorageManager = ContainerStorageManager;
  package$impl.getOs = getOs;
  package$impl.getOsVersion = getOsVersion;
  Object.defineProperty(UstadMobileSystemImpl, 'Companion', {
  get: UstadMobileSystemImpl$Companion_getInstance});
  package$impl.UstadMobileSystemImpl = UstadMobileSystemImpl;
  package$ext.getStringFromContainerEntry_i6o7gc$ = getStringFromContainerEntry;
  package$ext.getSize_posmfk$ = getSize;
  package$ext.guessMimeType_posmfk$ = guessMimeType;
  package$ext.downloadUrlIfRemote_49o3wx$ = downloadUrlIfRemote;
  package$ext.isRemote_qvpt4h$ = isRemote;
  package$ext.emptyRecursively_qvpt4h$ = emptyRecursively;
  package$ext.deleteRecursively_qvpt4h$ = deleteRecursively;
  package$ext.addDirToContainer_y9scap$ = addDirToContainer;
  package$ext.addFileToContainer_8e174q$ = addFileToContainer;
  package$ext.addEntriesToContainerFromZip_y06rpy$ = addEntriesToContainerFromZip;
  $$importsForInline$$['kotlin-extensions'] = $module$kotlin_extensions;
  Object.defineProperty(NavControllerJs, 'Companion', {
  get: NavControllerJs$Companion_getInstance});
  var package$navigation = package$core.navigation || (package$core.navigation = {});
  package$navigation.NavControllerJs = NavControllerJs;
  Object.defineProperty(BackStackEntryInfo, 'Companion', {
  get: BackStackEntryInfo$Companion_getInstance});
  Object.defineProperty(BackStackEntryInfo, '$serializer', {
  get: BackStackEntryInfo$$serializer_getInstance});
  package$navigation.BackStackEntryInfo_init_tqjek7$ = BackStackEntryInfo_init;
  package$navigation.BackStackEntryInfo = BackStackEntryInfo;
  Object.defineProperty(UstadBackStackEntryJs, 'Companion', {
  get: UstadBackStackEntryJs$Companion_getInstance});
  package$navigation.UstadBackStackEntryJs = UstadBackStackEntryJs;
  UstadSavedStateHandleJs.CommitListener = UstadSavedStateHandleJs$CommitListener;
  package$navigation.UstadSavedStateHandleJs = UstadSavedStateHandleJs;
  package$containeruploader.ContainerUploader2 = ContainerUploader2;
  package$schedule.ClazzLogCreatorManagerJs = ClazzLogCreatorManagerJs;
  package$schedule.getTimezoneOffset_4wgjuj$ = getTimezoneOffset;
  package$schedule.getRawTimezoneOffset_61zpoe$ = getRawTimezoneOffset;
  package$util.createTemporaryDir_61zpoe$ = createTemporaryDir;
  package$util.defaultJsonSerializer = defaultJsonSerializer;
  $$importsForInline$$['kotlinx-serialization-kotlinx-serialization-json-js-legacy'] = $module$kotlinx_serialization_kotlinx_serialization_json_js_legacy;
  package$util.safeParseList_478ej0$ = safeParseList;
  Object.defineProperty(package$util, 'StorageUtil', {
  get: StorageUtil_getInstance});
  package$util.parse8601Duration_61zpoe$ = parse8601Duration;
  Object.defineProperty(UMURLEncoder, 'Companion', {
  get: UMURLEncoder$Companion_getInstance});
  package$util.UMURLEncoder = UMURLEncoder;
  Object.defineProperty(package$util, 'UmPlatformUtil', {
  get: UmPlatformUtil_getInstance});
  package$util.UstadAntilog = UstadAntilog;
  package$ext_0.encodeBase64_964n91$ = encodeBase64;
  package$ext_0.deleteContainerEntryFilePaths_a4uzp3$ = deleteContainerEntryFilePaths;
  package$ext_0.withWifiLock_t1gg6u$ = withWifiLock;
  package$ext_0.addInvalidationListener_m4ko5r$ = addInvalidationListener;
  package$ext_0.removeInvalidationListener_m4ko5r$ = removeInvalidationListener;
  package$ext_0.observeWithLifecycleOwner_y8vmej$ = observeWithLifecycleOwner;
  package$ext_0.getOrPut_kxerl3$ = getOrPut;
  package$ext_0.formatDate_if0ts5$ = formatDate;
  package$ext_0.setAllFromMap_5s544b$ = setAllFromMap;
  package$ext_0.observeResult_d048xl$ = observeResult;
  package$ext_0.toStringMap_pvbo06$ = toStringMap;
  package$ext_0.encryptWithPbkdf2_ddkhil$ = encryptWithPbkdf2_0;
  package$ext_0.base64StringToByteArray_pdl1vz$ = base64StringToByteArray;
  package$ext_0.validEmail_5cw0du$ = validEmail;
  package$ext_0.showChoiceDialog_tbaibo$ = showChoiceDialog;
  package$ext_0.innerXml_o1t5ut$ = innerXml;
  Object.defineProperty(AuthManager.prototype, 'diContext', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diContext'));
  Object.defineProperty(AuthManager.prototype, 'diTrigger', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diTrigger'));
  AuthResult$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  Endpoint$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  RegisterRequest$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  UserSessionWithPersonAndEndpoint$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  Object.defineProperty(ContentPlugin.prototype, 'diContext', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diContext'));
  Object.defineProperty(ContentPlugin.prototype, 'diTrigger', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diTrigger'));
  Object.defineProperty(AbstractContentEntryPlugin.prototype, 'diContext', Object.getOwnPropertyDescriptor(ContentPlugin.prototype, 'diContext'));
  Object.defineProperty(AbstractContentEntryPlugin.prototype, 'diTrigger', Object.getOwnPropertyDescriptor(ContentPlugin.prototype, 'diTrigger'));
  Object.defineProperty(VideoTypePlugin.prototype, 'diContext', Object.getOwnPropertyDescriptor(ContentPlugin.prototype, 'diContext'));
  Object.defineProperty(VideoTypePlugin.prototype, 'diTrigger', Object.getOwnPropertyDescriptor(ContentPlugin.prototype, 'diTrigger'));
  Har$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  HarContent$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  HarEntry$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  HarRegexPair$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  Interceptors$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  HarExtra$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  HarLog$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  HarNameValuePair$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  HarRequest$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  HarResponse$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  KhanProblemBody$Variable$Input$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  KhanProblemBody$Variable$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  KhanProblemBody$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  ItemResponse$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  ItemData$Content$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  ItemData$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  ImportedContentEntryMetaData$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  Object.defineProperty(XapiStateEndpoint.prototype, 'diContext', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diContext'));
  Object.defineProperty(XapiStateEndpoint.prototype, 'diTrigger', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diTrigger'));
  Object.defineProperty(XapiStatementEndpoint.prototype, 'diContext', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diContext'));
  Object.defineProperty(XapiStatementEndpoint.prototype, 'diTrigger', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diTrigger'));
  Object.defineProperty(ContentJobProcessContext.prototype, 'diContext', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diContext'));
  Object.defineProperty(ContentJobProcessContext.prototype, 'diTrigger', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diTrigger'));
  Object.defineProperty(ContentJobRunner.prototype, 'diContext', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diContext'));
  Object.defineProperty(ContentJobRunner.prototype, 'diTrigger', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diTrigger'));
  Object.defineProperty(DefaultContentPluginUploader.prototype, 'diContext', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diContext'));
  Object.defineProperty(DefaultContentPluginUploader.prototype, 'diTrigger', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diTrigger'));
  MetadataResult$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  UploadResult$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  Object.defineProperty(UstadBaseController.prototype, 'diContext', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diContext'));
  Object.defineProperty(UstadBaseController.prototype, 'diTrigger', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diTrigger'));
  Object.defineProperty(DefaultClazzListItemListener.prototype, 'diContext', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diContext'));
  Object.defineProperty(DefaultClazzListItemListener.prototype, 'diTrigger', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diTrigger'));
  Object.defineProperty(DefaultContentEntryListItemListener.prototype, 'diContext', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diContext'));
  Object.defineProperty(DefaultContentEntryListItemListener.prototype, 'diTrigger', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diTrigger'));
  Object.defineProperty(DefaultNewCommentItemListener.prototype, 'diContext', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diContext'));
  Object.defineProperty(DefaultNewCommentItemListener.prototype, 'diTrigger', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diTrigger'));
  Object.defineProperty(DefaultScopedGrantListItemListener.prototype, 'diContext', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diContext'));
  Object.defineProperty(DefaultScopedGrantListItemListener.prototype, 'diTrigger', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diTrigger'));
  UploadSessionParams$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  BitmaskFlag$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  UmAccountActor$Account$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  UmAccountActor$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  UmAccountGroupActor$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  Object.defineProperty(ContentEntryOpener.prototype, 'diContext', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diContext'));
  Object.defineProperty(ContentEntryOpener.prototype, 'diTrigger', Object.getOwnPropertyDescriptor(DIAware.prototype, 'diTrigger'));
  LongWrapper$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  AboutView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  AccountListView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  UstadSingleEntityView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  UstadEditView.prototype.showSnackBar_9pu0dj$ = UstadSingleEntityView.prototype.showSnackBar_9pu0dj$;
  BitmaskEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  UstadDetailView.prototype.showSnackBar_9pu0dj$ = UstadSingleEntityView.prototype.showSnackBar_9pu0dj$;
  ChatDetailView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  UstadListView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  ChatListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  ClazzAssignmentDetailOverviewView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  ClazzAssignmentDetailStudentProgressOverviewListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  ClazzAssignmentDetailStudentProgressView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  ClazzAssignmentDetailView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  ClazzAssignmentEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  ClazzDetailOverviewView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  ClazzDetailView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  ClazzEdit2View.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  ClazzEnrolmentEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  ClazzEnrolmentListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  ClazzList2View.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  ClazzLogEditAttendanceView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  ClazzLogEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  ClazzLogListAttendanceView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  ClazzMemberListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  ContentEntryDetailAttemptsListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  ContentEntryDetailOverviewView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  ContentEntryDetailView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  ContentEntryEdit2View.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  ContentEntryImportLinkView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  ContentEntryList2View.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  CourseDiscussionDetailView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  CourseDiscussionEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  CourseGroupSetDetailView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  CourseGroupSetEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  CourseGroupSetListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  CourseTerminologyEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  CourseTerminologyListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  DateRangeView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  DiscussionPostDetailView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  DiscussionPostEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  DiscussionTopicDetailView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  DiscussionTopicEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  EpubContentView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  ErrorReportView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  HarView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  HolidayCalendarEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  HolidayCalendarListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  HolidayEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  HtmlTextViewDetailView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  InviteViaLinkView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  JoinWithCodeView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  LanguageEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  LanguageListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  LearnerGroupMemberListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  LeavingReasonEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  LeavingReasonListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  Login2View.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  ModuleCourseBlockEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  OnBoardingView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  ParentalConsentManagementView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  PersonAccountEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  PersonDetailView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  PersonEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  PersonGroupEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  PersonGroupListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  PersonListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  RedirectView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  RegisterAgeRedirectView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  RegisterMinorWaitForParentView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  ReportDashboardView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  ReportDetailView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  ReportEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  ReportFilterEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  ReportListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  ReportTemplateListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  ScheduleEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  SchoolDetailOverviewView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  SchoolDetailView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  SchoolEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  SchoolListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  SchoolMemberListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  ScopedGrantDetailView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  ScopedGrantEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  ScopedGrantListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  SelectExtractFileView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  SelectFileView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  SelectFolderView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  SessionListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  SettingsView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  SiteDetailView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  SiteEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  SiteEnterLinkView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  SiteTermsDetailView.prototype.showSnackBar_9pu0dj$ = UstadDetailView.prototype.showSnackBar_9pu0dj$;
  SiteTermsEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  SplashScreenView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  StatementListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  TextAssignmentEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  TextCourseBlockEditView.prototype.showSnackBar_9pu0dj$ = UstadEditView.prototype.showSnackBar_9pu0dj$;
  TimeZoneListView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  UstadViewWithProgressDialog.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  VerbEntityListView.prototype.showSnackBar_9pu0dj$ = UstadListView.prototype.showSnackBar_9pu0dj$;
  VideoContentView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  WebChunkView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  XapiPackageContentView.prototype.showSnackBar_9pu0dj$ = UstadView.prototype.showSnackBar_9pu0dj$;
  NavControllerJs.prototype.navigate_oc2wlg$ = UstadNavController.prototype.navigate_oc2wlg$;
  BackStackEntryInfo$$serializer.prototype.typeParametersSerializers = GeneratedSerializer.prototype.typeParametersSerializers;
  var tmp$ = mapOf([to('application/tincan+zip', XapiPackageContentView$Companion_getInstance().VIEW_NAME), to('application/khan-video+zip', VideoContentView$Companion_getInstance().VIEW_NAME), to('application/webchunk+zip', WebChunkView$Companion_getInstance().VIEW_NAME), to('application/epub+zip', EpubContentView$Companion_getInstance().VIEW_NAME), to('application/har+zip', HarView$Companion_getInstance().VIEW_NAME), to('application/h5p-tincan+zip', XapiPackageContentView$Companion_getInstance().VIEW_NAME)]);
  var $receiver = VideoContentPresenterCommon$Companion_getInstance().VIDEO_MIME_MAP.keys;
  var destination = ArrayList_init_0(collectionSizeOrDefault($receiver, 10));
  var tmp$_0;
  tmp$_0 = $receiver.iterator();
  while (tmp$_0.hasNext()) {
    var item = tmp$_0.next();
    destination.add_11rb$(to(item, VideoContentView$Companion_getInstance().VIEW_NAME));
  }
  mimeTypeToViewNameMap = plus(tmp$, toMap_0(destination));
  mimeTypeToPlayStoreIdMap = mapOf([to('text/plain', 'com.microsoft.office.word'), to('audio/mpeg', 'music.musicplayer'), to('application/pdf', 'com.adobe.reader'), to('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'com.microsoft.office.powerpoint'), to('com.microsoft.office.powerpoint', 'com.microsoft.office.powerpoint'), to('image/jpeg', 'com.pcvirt.ImageViewer'), to('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'com.microsoft.office.word')]);
  MS_PER_HOUR = 3600000;
  MS_PER_MIN = 60000;
  ROLE_TO_MESSAGEID_MAP = mapOf([to(1000, 2568), to(1002, 2568), to(1001, 2400), to(1003, 2837)]);
  OUTCOME_TO_MESSAGE_ID_MAP = mapOf([to(200, 2388), to(203, 2374), to(202, 2089), to(201, 2373)]);
  statusToMessageIdMap = mapOf([to(3, 2164), to(4, 2088), to(12, 2388), to(5, 2086), to(28, 2019), to(24, 2093), to(25, 2089)]);
  VALID_RESOLUTIONS = listOf([new Pair(480, 360), new Pair(360, 480), new Pair(176, 144), new Pair(144, 176), new Pair(640, 360), new Pair(360, 640), new Pair(320, 180), new Pair(180, 320), new Pair(480, 270), new Pair(270, 480), new Pair(480, 480), new Pair(240, 240)]);
  Kotlin.defineModule('UstadMobile-core', _);
  return _;
}));
