(function (_, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_atomicfu) { 'use strict'; //region block: imports var imul = Math.imul; var VOID = kotlin_kotlin.$_$.f; var ArrayList_init_$Create$ = kotlin_kotlin.$_$.m; var Unit_instance = kotlin_kotlin.$_$.n5; var protoOf = kotlin_kotlin.$_$.xc; var toList = kotlin_kotlin.$_$.u9; var classMeta = kotlin_kotlin.$_$.mb; var setMetadataFor = kotlin_kotlin.$_$.yc; var objectMeta = kotlin_kotlin.$_$.wc; var objectCreate = kotlin_kotlin.$_$.vc; var emptyList = kotlin_kotlin.$_$.j7; var trimMargin = kotlin_kotlin.$_$.ih; var hashCode = kotlin_kotlin.$_$.xb; var THROW_CCE = kotlin_kotlin.$_$.ii; var equals = kotlin_kotlin.$_$.pb; var toString = kotlin_kotlin.$_$.cd; var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.u1; var firstOrNull = kotlin_kotlin.$_$.o7; var lastOrNull = kotlin_kotlin.$_$.h8; var ReentrantLock = kotlin_org_jetbrains_kotlinx_atomicfu.$_$.a; //endregion //region block: pre-declaration setMetadataFor(InvalidateCallbackTracker, 'InvalidateCallbackTracker', classMeta); setMetadataFor(LoadParams, 'LoadParams', classMeta); setMetadataFor(Refresh, 'Refresh', classMeta, LoadParams); setMetadataFor(Append, 'Append', classMeta, LoadParams); setMetadataFor(Prepend, 'Prepend', classMeta, LoadParams); setMetadataFor(Companion, 'Companion', objectMeta); setMetadataFor(Companion_0, 'Companion', objectMeta); setMetadataFor(LoadResult, 'LoadResult', classMeta); setMetadataFor(Error_0, 'Error', classMeta, LoadResult); setMetadataFor(Invalid, 'Invalid', classMeta, LoadResult, VOID, Invalid); setMetadataFor(Page, 'Page', classMeta, LoadResult); setMetadataFor(PagingSource, 'PagingSource', classMeta, VOID, VOID, VOID, VOID, VOID, [1]); setMetadataFor(PagingLogger, 'PagingLogger', objectMeta); setMetadataFor(ReentrantLock_0, 'ReentrantLock', classMeta, VOID, VOID, ReentrantLock_0); //endregion function InvalidateCallbackTracker(callbackInvoker, invalidGetter) { invalidGetter = invalidGetter === VOID ? null : invalidGetter; this.z53_1 = callbackInvoker; this.a54_1 = invalidGetter; this.b54_1 = new ReentrantLock_0(); var tmp = this; // Inline function 'kotlin.collections.mutableListOf' call tmp.c54_1 = ArrayList_init_$Create$(); this.d54_1 = false; } protoOf(InvalidateCallbackTracker).e54 = function (callback) { var tmp0_safe_receiver = this.a54_1; if ((tmp0_safe_receiver == null ? null : tmp0_safe_receiver()) === true) { this.f54(); } if (this.d54_1) { this.z53_1(callback); return Unit_instance; } var tmp$ret$1; $l$block: { // Inline function 'androidx.paging.internal.withLock' call var this_0 = this.b54_1; // Inline function 'kotlin.contracts.contract' call try { this_0.h54(); // Inline function 'androidx.paging.InvalidateCallbackTracker.registerInvalidatedCallback.' call var tmp; if (this.d54_1) { tmp = true; } else { this.c54_1.i1(callback); tmp = false; } tmp$ret$1 = tmp; break $l$block; }finally { this_0.i54(); } } var callImmediately = tmp$ret$1; if (callImmediately) { this.z53_1(callback); } }; protoOf(InvalidateCallbackTracker).j54 = function (callback) { $l$block: { // Inline function 'androidx.paging.internal.withLock' call var this_0 = this.b54_1; // Inline function 'kotlin.contracts.contract' call try { this_0.h54(); // Inline function 'androidx.paging.InvalidateCallbackTracker.unregisterInvalidatedCallback.' call this.c54_1.j1(callback); break $l$block; }finally { this_0.i54(); } } }; protoOf(InvalidateCallbackTracker).f54 = function () { if (this.d54_1) return false; $l$block: { // Inline function 'androidx.paging.internal.withLock' call var this_0 = this.b54_1; // Inline function 'kotlin.contracts.contract' call try { this_0.h54(); // Inline function 'androidx.paging.InvalidateCallbackTracker.invalidate.' call if (this.d54_1) return false; this.d54_1 = true; // Inline function 'kotlin.also' call var this_1 = toList(this.c54_1); // Inline function 'kotlin.contracts.contract' call // Inline function 'androidx.paging.InvalidateCallbackTracker.invalidate..' call this.c54_1.n1(); break $l$block; }finally { this_0.i54(); } } var callbacksToInvoke = this_1; // Inline function 'kotlin.collections.forEach' call var action = this.z53_1; var tmp0_iterator = callbacksToInvoke.w(); while (tmp0_iterator.f()) { var element = tmp0_iterator.e(); action(element); } return true; }; function get_DEBUG() { return DEBUG; } var DEBUG; function Refresh(key, loadSize, placeholdersEnabled) { LoadParams.call(this, loadSize, placeholdersEnabled); this.m54_1 = key; } protoOf(Refresh).s2 = function () { return this.m54_1; }; function Append(key, loadSize, placeholdersEnabled) { LoadParams.call(this, loadSize, placeholdersEnabled); this.p54_1 = key; } protoOf(Append).s2 = function () { return this.p54_1; }; function Prepend(key, loadSize, placeholdersEnabled) { LoadParams.call(this, loadSize, placeholdersEnabled); this.s54_1 = key; } protoOf(Prepend).s2 = function () { return this.s54_1; }; function Companion() { } var Companion_instance; function Companion_getInstance() { return Companion_instance; } function Page_init_$Init$(data, prevKey, nextKey, $this) { Page.call($this, data, prevKey, nextKey, -2147483648, -2147483648); return $this; } function Page_init_$Create$(data, prevKey, nextKey) { return Page_init_$Init$(data, prevKey, nextKey, objectCreate(protoOf(Page))); } function Companion_0() { Companion_instance_0 = this; this.t54_1 = -2147483648; this.u54_1 = new Page(emptyList(), null, null, 0, 0); } var Companion_instance_0; function Companion_getInstance_0() { if (Companion_instance_0 == null) new Companion_0(); return Companion_instance_0; } function Error_0(throwable) { LoadResult.call(this); this.v54_1 = throwable; } protoOf(Error_0).toString = function () { return trimMargin('LoadResult.Error(\n | throwable: ' + this.v54_1 + '\n |) '); }; protoOf(Error_0).hashCode = function () { return hashCode(this.v54_1); }; protoOf(Error_0).equals = function (other) { if (this === other) return true; if (!(other instanceof Error_0)) return false; var tmp0_other_with_cast = other instanceof Error_0 ? other : THROW_CCE(); if (!equals(this.v54_1, tmp0_other_with_cast.v54_1)) return false; return true; }; function Invalid() { LoadResult.call(this); } protoOf(Invalid).toString = function () { return 'LoadResult.Invalid'; }; function Page(data, prevKey, nextKey, itemsBefore, itemsAfter) { Companion_getInstance_0(); itemsBefore = itemsBefore === VOID ? -2147483648 : itemsBefore; itemsAfter = itemsAfter === VOID ? -2147483648 : itemsAfter; LoadResult.call(this); this.w54_1 = data; this.x54_1 = prevKey; this.y54_1 = nextKey; this.z54_1 = itemsBefore; this.a55_1 = itemsAfter; // Inline function 'kotlin.require' call // Inline function 'kotlin.contracts.contract' call if (!(this.z54_1 === -2147483648 ? true : this.z54_1 >= 0)) { // Inline function 'androidx.paging.Page.' call var message = 'itemsBefore cannot be negative'; throw IllegalArgumentException_init_$Create$(toString(message)); } // Inline function 'kotlin.require' call // Inline function 'kotlin.contracts.contract' call if (!(this.a55_1 === -2147483648 ? true : this.a55_1 >= 0)) { // Inline function 'androidx.paging.Page.' call var message_0 = 'itemsAfter cannot be negative'; throw IllegalArgumentException_init_$Create$(toString(message_0)); } } protoOf(Page).w = function () { return this.w54_1.y(); }; protoOf(Page).toString = function () { return trimMargin('LoadResult.Page(\n | data size: ' + this.w54_1.u() + '\n | first Item: ' + firstOrNull(this.w54_1) + '\n | last Item: ' + lastOrNull(this.w54_1) + '\n | nextKey: ' + this.y54_1 + '\n | prevKey: ' + this.x54_1 + '\n | itemsBefore: ' + this.z54_1 + '\n | itemsAfter: ' + this.a55_1 + '\n |) '); }; protoOf(Page).hashCode = function () { var result = hashCode(this.w54_1); result = imul(result, 31) + (this.x54_1 == null ? 0 : hashCode(this.x54_1)) | 0; result = imul(result, 31) + (this.y54_1 == null ? 0 : hashCode(this.y54_1)) | 0; result = imul(result, 31) + this.z54_1 | 0; result = imul(result, 31) + this.a55_1 | 0; return result; }; protoOf(Page).equals = function (other) { if (this === other) return true; if (!(other instanceof Page)) return false; var tmp0_other_with_cast = other instanceof Page ? other : THROW_CCE(); if (!equals(this.w54_1, tmp0_other_with_cast.w54_1)) return false; if (!equals(this.x54_1, tmp0_other_with_cast.x54_1)) return false; if (!equals(this.y54_1, tmp0_other_with_cast.y54_1)) return false; if (!(this.z54_1 === tmp0_other_with_cast.z54_1)) return false; if (!(this.a55_1 === tmp0_other_with_cast.a55_1)) return false; return true; }; function LoadParams(loadSize, placeholdersEnabled) { this.b55_1 = loadSize; this.c55_1 = placeholdersEnabled; } function LoadResult() { } function PagingSource$invalidateCallbackTracker$lambda(it) { it(); return Unit_instance; } function PagingSource() { var tmp = this; tmp.d55_1 = new InvalidateCallbackTracker(PagingSource$invalidateCallbackTracker$lambda); } protoOf(PagingSource).e55 = function () { if (this.d55_1.f54()) { // Inline function 'androidx.paging.log' call var level = get_DEBUG(); var logger = PagingLogger_instance; if (logger.g55(level)) { // Inline function 'androidx.paging.PagingSource.invalidate.' call var tmp$ret$0 = 'Invalidated PagingSource ' + this; logger.f55(level, tmp$ret$0, null); } } }; protoOf(PagingSource).h55 = function (onInvalidatedCallback) { this.d55_1.e54(onInvalidatedCallback); }; protoOf(PagingSource).i55 = function (onInvalidatedCallback) { this.d55_1.j54(onInvalidatedCallback); }; function PagingLogger() { } protoOf(PagingLogger).g55 = function (level) { return false; }; protoOf(PagingLogger).f55 = function (level, message, tr) { }; var PagingLogger_instance; function PagingLogger_getInstance() { return PagingLogger_instance; } function ReentrantLock_0() { this.g54_1 = new ReentrantLock(); } protoOf(ReentrantLock_0).h54 = function () { // Inline function 'kotlinx.atomicfu.locks.ReentrantLock.lock' call this.g54_1; }; protoOf(ReentrantLock_0).i54 = function () { // Inline function 'kotlinx.atomicfu.locks.ReentrantLock.unlock' call this.g54_1; }; //region block: init DEBUG = 3; Companion_instance = new Companion(); PagingLogger_instance = new PagingLogger(); //endregion //region block: exports _.$_$ = _.$_$ || {}; _.$_$.a = Append; _.$_$.b = Prepend; _.$_$.c = Refresh; _.$_$.d = LoadParams; _.$_$.e = Error_0; _.$_$.f = Invalid; _.$_$.g = Page; _.$_$.h = LoadResult; _.$_$.i = PagingSource; _.$_$.j = Page_init_$Create$; //endregion return _; }(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kotlinx-atomicfu.js'))); //# sourceMappingURL=multiplatform-paging-root-paging-common.js.map