(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.$_$.m5; var protoOf = kotlin_kotlin.$_$.uc; var toList = kotlin_kotlin.$_$.r9; var classMeta = kotlin_kotlin.$_$.jb; var setMetadataFor = kotlin_kotlin.$_$.vc; var objectMeta = kotlin_kotlin.$_$.tc; var objectCreate = kotlin_kotlin.$_$.sc; var emptyList = kotlin_kotlin.$_$.i7; var trimMargin = kotlin_kotlin.$_$.ch; var hashCode = kotlin_kotlin.$_$.ub; var THROW_CCE = kotlin_kotlin.$_$.ci; var equals = kotlin_kotlin.$_$.mb; var toString = kotlin_kotlin.$_$.zc; var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.u1; var firstOrNull = kotlin_kotlin.$_$.n7; var lastOrNull = kotlin_kotlin.$_$.f8; 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.s52_1 = callbackInvoker; this.t52_1 = invalidGetter; this.u52_1 = new ReentrantLock_0(); var tmp = this; // Inline function 'kotlin.collections.mutableListOf' call tmp.v52_1 = ArrayList_init_$Create$(); this.w52_1 = false; } protoOf(InvalidateCallbackTracker).x52 = function (callback) { var tmp0_safe_receiver = this.t52_1; if ((tmp0_safe_receiver == null ? null : tmp0_safe_receiver()) === true) { this.y52(); } if (this.w52_1) { this.s52_1(callback); return Unit_instance; } var tmp$ret$1; $l$block: { // Inline function 'androidx.paging.internal.withLock' call var this_0 = this.u52_1; // Inline function 'kotlin.contracts.contract' call try { this_0.a53(); // Inline function 'androidx.paging.InvalidateCallbackTracker.registerInvalidatedCallback.' call var tmp; if (this.w52_1) { tmp = true; } else { this.v52_1.i1(callback); tmp = false; } tmp$ret$1 = tmp; break $l$block; }finally { this_0.b53(); } } var callImmediately = tmp$ret$1; if (callImmediately) { this.s52_1(callback); } }; protoOf(InvalidateCallbackTracker).c53 = function (callback) { $l$block: { // Inline function 'androidx.paging.internal.withLock' call var this_0 = this.u52_1; // Inline function 'kotlin.contracts.contract' call try { this_0.a53(); // Inline function 'androidx.paging.InvalidateCallbackTracker.unregisterInvalidatedCallback.' call this.v52_1.j1(callback); break $l$block; }finally { this_0.b53(); } } }; protoOf(InvalidateCallbackTracker).y52 = function () { if (this.w52_1) return false; $l$block: { // Inline function 'androidx.paging.internal.withLock' call var this_0 = this.u52_1; // Inline function 'kotlin.contracts.contract' call try { this_0.a53(); // Inline function 'androidx.paging.InvalidateCallbackTracker.invalidate.' call if (this.w52_1) return false; this.w52_1 = true; // Inline function 'kotlin.also' call var this_1 = toList(this.v52_1); // Inline function 'kotlin.contracts.contract' call // Inline function 'androidx.paging.InvalidateCallbackTracker.invalidate..' call this.v52_1.n1(); break $l$block; }finally { this_0.b53(); } } var callbacksToInvoke = this_1; // Inline function 'kotlin.collections.forEach' call var action = this.s52_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.f53_1 = key; } protoOf(Refresh).s2 = function () { return this.f53_1; }; function Append(key, loadSize, placeholdersEnabled) { LoadParams.call(this, loadSize, placeholdersEnabled); this.i53_1 = key; } protoOf(Append).s2 = function () { return this.i53_1; }; function Prepend(key, loadSize, placeholdersEnabled) { LoadParams.call(this, loadSize, placeholdersEnabled); this.l53_1 = key; } protoOf(Prepend).s2 = function () { return this.l53_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.m53_1 = -2147483648; this.n53_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.o53_1 = throwable; } protoOf(Error_0).toString = function () { return trimMargin('LoadResult.Error(\n | throwable: ' + this.o53_1 + '\n |) '); }; protoOf(Error_0).hashCode = function () { return hashCode(this.o53_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.o53_1, tmp0_other_with_cast.o53_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.p53_1 = data; this.q53_1 = prevKey; this.r53_1 = nextKey; this.s53_1 = itemsBefore; this.t53_1 = itemsAfter; // Inline function 'kotlin.require' call // Inline function 'kotlin.contracts.contract' call if (!(this.s53_1 === -2147483648 ? true : this.s53_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.t53_1 === -2147483648 ? true : this.t53_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.p53_1.y(); }; protoOf(Page).toString = function () { return trimMargin('LoadResult.Page(\n | data size: ' + this.p53_1.u() + '\n | first Item: ' + firstOrNull(this.p53_1) + '\n | last Item: ' + lastOrNull(this.p53_1) + '\n | nextKey: ' + this.r53_1 + '\n | prevKey: ' + this.q53_1 + '\n | itemsBefore: ' + this.s53_1 + '\n | itemsAfter: ' + this.t53_1 + '\n |) '); }; protoOf(Page).hashCode = function () { var result = hashCode(this.p53_1); result = imul(result, 31) + (this.q53_1 == null ? 0 : hashCode(this.q53_1)) | 0; result = imul(result, 31) + (this.r53_1 == null ? 0 : hashCode(this.r53_1)) | 0; result = imul(result, 31) + this.s53_1 | 0; result = imul(result, 31) + this.t53_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.p53_1, tmp0_other_with_cast.p53_1)) return false; if (!equals(this.q53_1, tmp0_other_with_cast.q53_1)) return false; if (!equals(this.r53_1, tmp0_other_with_cast.r53_1)) return false; if (!(this.s53_1 === tmp0_other_with_cast.s53_1)) return false; if (!(this.t53_1 === tmp0_other_with_cast.t53_1)) return false; return true; }; function LoadParams(loadSize, placeholdersEnabled) { this.u53_1 = loadSize; this.v53_1 = placeholdersEnabled; } function LoadResult() { } function PagingSource$invalidateCallbackTracker$lambda(it) { it(); return Unit_instance; } function PagingSource() { var tmp = this; tmp.w53_1 = new InvalidateCallbackTracker(PagingSource$invalidateCallbackTracker$lambda); } protoOf(PagingSource).x53 = function () { if (this.w53_1.y52()) { // Inline function 'androidx.paging.log' call var level = get_DEBUG(); var logger = PagingLogger_instance; if (logger.z53(level)) { // Inline function 'androidx.paging.PagingSource.invalidate.' call var tmp$ret$0 = 'Invalidated PagingSource ' + this; logger.y53(level, tmp$ret$0, null); } } }; protoOf(PagingSource).a54 = function (onInvalidatedCallback) { this.w53_1.x52(onInvalidatedCallback); }; protoOf(PagingSource).b54 = function (onInvalidatedCallback) { this.w53_1.c53(onInvalidatedCallback); }; function PagingLogger() { } protoOf(PagingLogger).z53 = function (level) { return false; }; protoOf(PagingLogger).y53 = function (level, message, tr) { }; var PagingLogger_instance; function PagingLogger_getInstance() { return PagingLogger_instance; } function ReentrantLock_0() { this.z52_1 = new ReentrantLock(); } protoOf(ReentrantLock_0).a53 = function () { // Inline function 'kotlinx.atomicfu.locks.ReentrantLock.lock' call this.z52_1; }; protoOf(ReentrantLock_0).b53 = function () { // Inline function 'kotlinx.atomicfu.locks.ReentrantLock.unlock' call this.z52_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