New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@devvit/multiplatform

Package Overview
Dependencies
Maintainers
7
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@devvit/multiplatform - npm Package Compare versions

Comparing version 0.0.1-20240524-5d552a12 to 0.0.1-20240529-491771c9

15

kotlin/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js

@@ -1,15 +0,4 @@

(function (root, factory) {
if (typeof define === 'function' && define.amd)
define(['exports'], factory);
else if (typeof exports === 'object')
factory(module.exports);
else
root.kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat = factory(typeof kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat === 'undefined' ? {} : kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat);
}(globalThis, function (_) {
'use strict';
//region block: pre-declaration
//endregion
return _;
}));
//region block: pre-declaration
//endregion
//# sourceMappingURL=kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map

275

kotlin/ui-shared-shared.d.ts
type Nullable<T> = T | null | undefined
export declare namespace net.devvit {
class SubscribeCallbackParams<Req, Rsp> {
constructor(request: Req, response: Rsp, mode: net.devvit.Mode);
get request(): Req;
get response(): Rsp;
get mode(): net.devvit.Mode;
copy(request?: Req, response?: Rsp, mode?: net.devvit.Mode): net.devvit.SubscribeCallbackParams<Req, Rsp>;
toString(): string;
hashCode(): number;
equals(other: Nullable<any>): boolean;
}
abstract class Mode {
private constructor();
static get SYNC(): net.devvit.Mode & {
get name(): "SYNC";
get ordinal(): 0;
};
static get ASYNC(): net.devvit.Mode & {
get name(): "ASYNC";
get ordinal(): 1;
};
static get SPEC(): net.devvit.Mode & {
get name(): "SPEC";
get ordinal(): 2;
};
get name(): "SYNC" | "ASYNC" | "SPEC";
get ordinal(): 0 | 1 | 2;
static values(): Array<net.devvit.Mode>;
static valueOf(value: string): net.devvit.Mode;
}
export declare class SubscribeCallbackParams<Req, Rsp> {
constructor(request: Req, response: Rsp, mode: Mode);
get request(): Req;
get response(): Rsp;
get mode(): Mode;
copy(request?: Req, response?: Rsp, mode?: Mode): SubscribeCallbackParams<Req, Rsp>;
toString(): string;
hashCode(): number;
equals(other: Nullable<any>): boolean;
}
export declare namespace net.devvit {
class EmptyOptions implements net.devvit.DispatcherOptions {
constructor();
get logger(): net.devvit.config.Logger;
set logger(value: net.devvit.config.Logger);
get errorHandler(): (p0: Error) => void;
set errorHandler(value: (p0: Error) => void);
get featureFlags(): net.devvit.config.FeatureFlags;
set featureFlags(value: net.devvit.config.FeatureFlags);
}
export declare abstract class Mode {
private constructor();
static get SYNC(): Mode & {
get name(): "SYNC";
get ordinal(): 0;
};
static get ASYNC(): Mode & {
get name(): "ASYNC";
get ordinal(): 1;
};
static get SPEC(): Mode & {
get name(): "SPEC";
get ordinal(): 2;
};
get name(): "SYNC" | "ASYNC" | "SPEC";
get ordinal(): 0 | 1 | 2;
static values(): Array<Mode>;
static valueOf(value: string): Mode;
}
export declare namespace net.devvit {
class DispatcherSnapshot<State, Event, RuntimeSnapshot, TimerSnapshot> {
constructor(state: State, syncQueue: Array<any>, asyncQueue: Array<any>, localSnapshot: RuntimeSnapshot, remoteSnapshot: RuntimeSnapshot, timerSnapshot: TimerSnapshot);
get state(): State;
get syncQueue(): Array<any>;
get asyncQueue(): Array<any>;
get localSnapshot(): RuntimeSnapshot;
get remoteSnapshot(): RuntimeSnapshot;
get timerSnapshot(): TimerSnapshot;
copy(state?: State, syncQueue?: Array<any>, asyncQueue?: Array<any>, localSnapshot?: RuntimeSnapshot, remoteSnapshot?: RuntimeSnapshot, timerSnapshot?: TimerSnapshot): net.devvit.DispatcherSnapshot<State, Event, RuntimeSnapshot, TimerSnapshot>;
toString(): string;
hashCode(): number;
equals(other: Nullable<any>): boolean;
}
export declare class EmptyOptions implements DispatcherOptions {
constructor();
get logger(): Logger;
set logger(value: Logger);
get errorHandler(): (p0: Error) => void;
set errorHandler(value: (p0: Error) => void);
get featureFlags(): FeatureFlags;
set featureFlags(value: FeatureFlags);
}
export declare namespace net.devvit.timer {
class TimerDefinition {
constructor(id: string, duration: number);
get id(): string;
get duration(): number;
copy(id?: string, duration?: number): net.devvit.timer.TimerDefinition;
toString(): string;
hashCode(): number;
equals(other: Nullable<any>): boolean;
}
export declare class DispatcherSnapshot<State, Event, RuntimeSnapshot, TimerSnapshot> {
constructor(state: State, syncQueue: Array<any>, asyncQueue: Array<any>, localSnapshot: RuntimeSnapshot, remoteSnapshot: RuntimeSnapshot, timerSnapshot: TimerSnapshot);
get state(): State;
get syncQueue(): Array<any>;
get asyncQueue(): Array<any>;
get localSnapshot(): RuntimeSnapshot;
get remoteSnapshot(): RuntimeSnapshot;
get timerSnapshot(): TimerSnapshot;
copy(state?: State, syncQueue?: Array<any>, asyncQueue?: Array<any>, localSnapshot?: RuntimeSnapshot, remoteSnapshot?: RuntimeSnapshot, timerSnapshot?: TimerSnapshot): DispatcherSnapshot<State, Event, RuntimeSnapshot, TimerSnapshot>;
toString(): string;
hashCode(): number;
equals(other: Nullable<any>): boolean;
}
export declare namespace net.devvit {
interface Dispatcher<State extends any, Ev extends net.devvit.Event, RuntimeSnapshot> {
state: State;
init(local: net.devvit.Runtime<State, Ev, RuntimeSnapshot>, remote: net.devvit.Runtime<State, Ev, RuntimeSnapshot>, timers: net.devvit.timer.TimerDelegate): void;
reset(): void;
snapshot(): net.devvit.DispatcherSnapshot<State, Ev, RuntimeSnapshot, Array<net.devvit.timer.TimerDefinition>>;
pause(): net.devvit.DispatcherSnapshot<State, Ev, RuntimeSnapshot, Array<net.devvit.timer.TimerDefinition>>;
resume(snap: net.devvit.DispatcherSnapshot<State, Ev, RuntimeSnapshot, Array<net.devvit.timer.TimerDefinition>>): void;
submit(events: Array<Ev>): void;
subscribe<Req extends net.devvit.Request<State, Ev>, Rsp extends net.devvit.Response<State, Ev>>(callback: (p0: net.devvit.SubscribeCallbackParams<Req, Rsp>) => void): net.devvit.Unsubscriber;
}
export declare class TimerDefinition {
constructor(id: string, duration: number);
get id(): string;
get duration(): number;
copy(id?: string, duration?: number): TimerDefinition;
toString(): string;
hashCode(): number;
equals(other: Nullable<any>): boolean;
}
export declare namespace net.devvit {
interface DispatcherOptions {
logger: net.devvit.config.Logger;
errorHandler: (p0: Error) => void;
featureFlags: net.devvit.config.FeatureFlags;
}
export declare interface Dispatcher<State extends any, Ev extends Event, RuntimeSnapshot> {
state: State;
init(local: Runtime<State, Ev, RuntimeSnapshot>, remote: Runtime<State, Ev, RuntimeSnapshot>, timers: TimerDelegate): void;
reset(): void;
snapshot(): DispatcherSnapshot<State, Ev, RuntimeSnapshot, Array<TimerDefinition>>;
pause(): DispatcherSnapshot<State, Ev, RuntimeSnapshot, Array<TimerDefinition>>;
resume(snap: DispatcherSnapshot<State, Ev, RuntimeSnapshot, Array<TimerDefinition>>): void;
submit(events: Array<Ev>): void;
subscribe<Req extends Request<State, Ev>, Rsp extends Response<State, Ev>>(callback: (p0: SubscribeCallbackParams<Req, Rsp>) => void): Unsubscriber;
}
export declare namespace net.devvit {
interface Event {
readonly async?: Nullable<boolean>;
remoteOnly?: Nullable<boolean>;
retry?: Nullable<boolean>;
readonly hook?: Nullable<string>;
}
export declare interface DispatcherOptions {
logger: Logger;
errorHandler: (p0: Error) => void;
featureFlags: FeatureFlags;
}
export declare namespace net.devvit {
interface JsRequestBuilder<State, Event> {
build(state: State, events: Array<Event>): net.devvit.Request<State, Event>;
}
export declare interface Event {
readonly async?: Nullable<boolean>;
remoteOnly?: Nullable<boolean>;
retry?: Nullable<boolean>;
readonly hook?: Nullable<string>;
}
export declare namespace net.devvit {
interface Request<State, Event> {
readonly events: Array<Event>;
readonly state?: State;
}
export declare interface JsRequestBuilder<State, Event> {
build(state: State, events: Array<Event>): Request<State, Event>;
}
export declare namespace net.devvit {
interface Response<State, Event> {
readonly replay: Array<Event>;
readonly state?: State;
}
export declare interface Request<State, Event> {
readonly events: Array<Event>;
readonly state?: State;
}
export declare namespace net.devvit {
interface Runtime<State, Ev extends net.devvit.Event, RuntimeSnapshot> {
isReady(): boolean;
handle(method: string, req: net.devvit.Request<State, Ev>, cb: (p0: net.devvit.Response<State, Ev>) => void, err: (p0: Error) => void): void;
reset(): void;
snapshot(): RuntimeSnapshot;
pause(): RuntimeSnapshot;
resume(snapshot: RuntimeSnapshot): void;
}
export declare interface Response<State, Event> {
readonly replay: Array<Event>;
readonly state?: State;
}
export declare namespace net.devvit {
interface StateOperations<T extends any> {
merge(target: T, src: T): T;
clone(obj: T): T;
}
export declare interface Runtime<State, Ev extends Event, RuntimeSnapshot> {
isReady(): boolean;
handle(method: string, req: Request<State, Ev>, cb: (p0: Response<State, Ev>) => void, err: (p0: Error) => void): void;
reset(): void;
snapshot(): RuntimeSnapshot;
pause(): RuntimeSnapshot;
resume(snapshot: RuntimeSnapshot): void;
}
export declare namespace net.devvit {
interface Unsubscriber {
unsubscribe(): void;
}
export declare interface StateOperations<T extends any> {
merge(target: T, src: T): T;
clone(obj: T): T;
}
export declare namespace net.devvit.config {
interface FeatureFlags {
readonly isSpeculativeExecutionEnabled: boolean;
}
export declare interface Unsubscriber {
unsubscribe(): void;
}
export declare namespace net.devvit.config {
interface Logger {
info(messages: Array<any>): void;
error(messages: Array<any>): void;
warn(messages: Array<any>): void;
debug(messages: Array<any>): void;
}
export declare interface FeatureFlags {
readonly isSpeculativeExecutionEnabled: boolean;
}
export declare namespace net.devvit.timer {
interface TimerDelegate {
apply(snapshot: Array<net.devvit.timer.TimerDefinition>): void;
resumeAll(snapshot: Array<net.devvit.timer.TimerDefinition>): void;
pauseAll(): Array<net.devvit.timer.TimerDefinition>;
add(def: net.devvit.timer.TimerDefinition): void;
list(): Array<net.devvit.timer.TimerDefinition>;
remove(id: string): void;
clear(): void;
}
export declare interface Logger {
info(messages: Array<any>): void;
error(messages: Array<any>): void;
warn(messages: Array<any>): void;
debug(messages: Array<any>): void;
}
export declare namespace net.devvit {
class JsDispatcherImpl<Ev extends net.devvit.Event> /* extends net.devvit.DispatcherImpl<Json, Ev, Json> */ implements net.devvit.Dispatcher<Json, Ev, Json> {
constructor(state: Json, requestBuilder: net.devvit.JsRequestBuilder<Json, Ev>, method?: string, options?: net.devvit.DispatcherOptions);
get state(): Json;
set state(value: Json);
init(local: net.devvit.Runtime<Json, Ev, Json>, remote: net.devvit.Runtime<Json, Ev, Json>, timers: net.devvit.timer.TimerDelegate): void;
subscribe<Req extends net.devvit.Request<Json, Ev>, Rsp extends net.devvit.Response<Json, Ev>>(callback: (p0: net.devvit.SubscribeCallbackParams<Req, Rsp>) => void): net.devvit.Unsubscriber;
submit(events: Array<Ev>): void;
reset(): void;
snapshot(): net.devvit.DispatcherSnapshot<Json, Ev, Json, Array<net.devvit.timer.TimerDefinition>>;
pause(): net.devvit.DispatcherSnapshot<Json, Ev, Json, Array<net.devvit.timer.TimerDefinition>>;
resume(snap: net.devvit.DispatcherSnapshot<Json, Ev, Json, Array<net.devvit.timer.TimerDefinition>>): void;
}
export declare interface TimerDelegate {
apply(snapshot: Array<TimerDefinition>): void;
resumeAll(snapshot: Array<TimerDefinition>): void;
pauseAll(): Array<TimerDefinition>;
add(def: TimerDefinition): void;
list(): Array<TimerDefinition>;
remove(id: string): void;
clear(): void;
}
export as namespace ui_shared_shared;
export declare class JsDispatcherImpl<Ev extends Event> /* extends DispatcherImpl<Json, Ev, Json> */ implements Dispatcher<Json, Ev, Json> {
constructor(state: Json, requestBuilder: JsRequestBuilder<Json, Ev>, method?: string, options?: DispatcherOptions);
get state(): Json;
set state(value: Json);
init(local: Runtime<Json, Ev, Json>, remote: Runtime<Json, Ev, Json>, timers: TimerDelegate): void;
subscribe<Req extends Request<Json, Ev>, Rsp extends Response<Json, Ev>>(callback: (p0: SubscribeCallbackParams<Req, Rsp>) => void): Unsubscriber;
submit(events: Array<Ev>): void;
reset(): void;
snapshot(): DispatcherSnapshot<Json, Ev, Json, Array<TimerDefinition>>;
pause(): DispatcherSnapshot<Json, Ev, Json, Array<TimerDefinition>>;
resume(snap: DispatcherSnapshot<Json, Ev, Json, Array<TimerDefinition>>): void;
}

@@ -1,540 +0,330 @@

(function (root, factory) {
if (typeof define === 'function' && define.amd)
define(['exports', './kotlin-kotlin-stdlib.js'], factory);
else if (typeof exports === 'object')
factory(module.exports, require('./kotlin-kotlin-stdlib.js'));
else {
if (typeof this['kotlin-kotlin-stdlib'] === 'undefined') {
throw new Error("Error loading module 'ui-shared:shared'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'ui-shared:shared'.");
}
root['ui-shared:shared'] = factory(typeof this['ui-shared:shared'] === 'undefined' ? {} : this['ui-shared:shared'], this['kotlin-kotlin-stdlib']);
import {
listOfvhqybd2zx248 as listOf,
emptyList1g2z5xcrvp2zy as emptyList,
protoOf180f3jzyo7rfj as protoOf,
initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
VOID7hggqo3abtya as VOID,
toString30pk9tzaqopn as toString,
hashCodeq5arwsb9dgti as hashCode,
THROW_CCE2g6jy02ryeudk as THROW_CCE,
equals2au1ep9vhcato as equals,
THROW_IAE23kobfj9wdoxr as THROW_IAE,
Unit_instance104q5opgivhr8 as Unit_instance,
Enum3alwj03lh1n41 as Enum,
defineProp3hxgpk2knu2px as defineProp,
toString1pkumu07cwy4m as toString_0,
first58ocm7j58k3q as first,
toList383f556t1dixk as toList,
LinkedHashMap_init_$Create$lekvnime2dmr as LinkedHashMap_init_$Create$,
ArrayList_init_$Create$2hwtrqzmqvr3h as ArrayList_init_$Create$,
copyToArray2j022khrow2yi as copyToArray,
arrayConcat3qsij7vh68m69 as arrayConcat,
ArrayDeque_init_$Create$3ktziwtnbfgso as ArrayDeque_init_$Create$,
throwUninitializedPropertyAccessExceptionyynx7gkm73wd as throwUninitializedPropertyAccessException,
Paire9pteg33gng7 as Pair,
isArray1hxjqtqy632bc as isArray,
addAll21mdhg523wnoa as addAll,
initMetadataForObject1cxne3s9w65el as initMetadataForObject,
getStringHashCode26igk1bx568vk as getStringHashCode,
ArrayList_init_$Create$1dzpfgeb9gvvy as ArrayList_init_$Create$_0,
to2cs3ny02qtbcb as to,
} from './kotlin-kotlin-stdlib.js';
//region block: imports
var imul = Math.imul;
//endregion
//region block: pre-declaration
initMetadataForClass(OneAtATimeAssembler, 'OneAtATimeAssembler');
initMetadataForClass(NoOpDeduper, 'NoOpDeduper', NoOpDeduper);
initMetadataForClass(SubscribeCallbackParams, 'SubscribeCallbackParams');
initMetadataForClass(Mode, 'Mode', VOID, Enum);
initMetadataForClass(Callback, 'Callback');
initMetadataForClass(DispatcherImpl$subscribe$1);
initMetadataForClass(DispatcherImpl, 'DispatcherImpl');
initMetadataForClass(EmptyOptions, 'EmptyOptions', EmptyOptions);
initMetadataForClass(DispatcherSnapshot, 'DispatcherSnapshot');
initMetadataForObject(Disabled, 'Disabled');
initMetadataForClass(NiceLogger, 'NiceLogger');
initMetadataForClass(NoOpLogger, 'NoOpLogger', NoOpLogger);
initMetadataForClass(TimerDefinition, 'TimerDefinition');
initMetadataForClass(JsDispatcherImpl, 'JsDispatcherImpl', VOID, DispatcherImpl);
initMetadataForClass(JsRequestBuilderAdapter, 'JsRequestBuilderAdapter');
initMetadataForClass(JsonStateOperations, 'JsonStateOperations', JsonStateOperations);
//endregion
function OneAtATimeAssembler(logger) {
this.t5_1 = logger;
}
protoOf(OneAtATimeAssembler).u5 = function (queue, mode) {
var tmp;
if (queue.e()) {
tmp = emptyList();
} else {
var item = queue.f5();
this.t5_1.w5([mode, 'building batch of ', item]);
tmp = listOf(item);
}
}(globalThis, function (_, kotlin_kotlin) {
'use strict';
//region block: imports
var imul = Math.imul;
var listOf = kotlin_kotlin.$_$.l;
var emptyList = kotlin_kotlin.$_$.j;
var protoOf = kotlin_kotlin.$_$.u;
var initMetadataForClass = kotlin_kotlin.$_$.r;
var VOID = kotlin_kotlin.$_$.b;
var toString = kotlin_kotlin.$_$.b1;
var hashCode = kotlin_kotlin.$_$.q;
var THROW_CCE = kotlin_kotlin.$_$.y;
var equals = kotlin_kotlin.$_$.o;
var THROW_IAE = kotlin_kotlin.$_$.z;
var Unit_instance = kotlin_kotlin.$_$.g;
var Enum = kotlin_kotlin.$_$.w;
var defineProp = kotlin_kotlin.$_$.n;
var toString_0 = kotlin_kotlin.$_$.v;
var first = kotlin_kotlin.$_$.k;
var toList = kotlin_kotlin.$_$.m;
var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.f;
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.e;
var copyToArray = kotlin_kotlin.$_$.i;
var arrayConcat = kotlin_kotlin.$_$.a;
var ArrayDeque_init_$Create$ = kotlin_kotlin.$_$.c;
var throwUninitializedPropertyAccessException = kotlin_kotlin.$_$.a1;
var Pair = kotlin_kotlin.$_$.x;
var isArray = kotlin_kotlin.$_$.t;
var addAll = kotlin_kotlin.$_$.h;
var initMetadataForObject = kotlin_kotlin.$_$.s;
var getStringHashCode = kotlin_kotlin.$_$.p;
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.d;
var to = kotlin_kotlin.$_$.c1;
//endregion
//region block: pre-declaration
initMetadataForClass(OneAtATimeAssembler, 'OneAtATimeAssembler');
initMetadataForClass(NoOpDeduper, 'NoOpDeduper', NoOpDeduper);
initMetadataForClass(SubscribeCallbackParams, 'SubscribeCallbackParams');
initMetadataForClass(Mode, 'Mode', VOID, Enum);
initMetadataForClass(Callback, 'Callback');
initMetadataForClass(DispatcherImpl$subscribe$1);
initMetadataForClass(DispatcherImpl, 'DispatcherImpl');
initMetadataForClass(EmptyOptions, 'EmptyOptions', EmptyOptions);
initMetadataForClass(DispatcherSnapshot, 'DispatcherSnapshot');
initMetadataForObject(Disabled, 'Disabled');
initMetadataForClass(NiceLogger, 'NiceLogger');
initMetadataForClass(NoOpLogger, 'NoOpLogger', NoOpLogger);
initMetadataForClass(TimerDefinition, 'TimerDefinition');
initMetadataForClass(JsDispatcherImpl, 'JsDispatcherImpl', VOID, DispatcherImpl);
initMetadataForClass(JsRequestBuilderAdapter, 'JsRequestBuilderAdapter');
initMetadataForClass(JsonStateOperations, 'JsonStateOperations', JsonStateOperations);
//endregion
function OneAtATimeAssembler(logger) {
this.t5_1 = logger;
return tmp;
};
function NoOpDeduper() {
}
protoOf(NoOpDeduper).x5 = function (events) {
return events;
};
function SubscribeCallbackParams(request, response, mode) {
this.request = request;
this.response = response;
this.mode = mode;
}
protoOf(SubscribeCallbackParams).y5 = function () {
return this.request;
};
protoOf(SubscribeCallbackParams).z5 = function () {
return this.response;
};
protoOf(SubscribeCallbackParams).a6 = function () {
return this.mode;
};
protoOf(SubscribeCallbackParams).b6 = function () {
return this.request;
};
protoOf(SubscribeCallbackParams).c6 = function () {
return this.response;
};
protoOf(SubscribeCallbackParams).d6 = function () {
return this.mode;
};
protoOf(SubscribeCallbackParams).e6 = function (request, response, mode) {
return new SubscribeCallbackParams(request, response, mode);
};
protoOf(SubscribeCallbackParams).copy = function (request, response, mode, $super) {
request = request === VOID ? this.request : request;
response = response === VOID ? this.response : response;
mode = mode === VOID ? this.mode : mode;
return this.e6(request, response, mode);
};
protoOf(SubscribeCallbackParams).toString = function () {
return 'SubscribeCallbackParams(request=' + toString(this.request) + ', response=' + toString(this.response) + ', mode=' + this.mode.toString() + ')';
};
protoOf(SubscribeCallbackParams).hashCode = function () {
var result = this.request == null ? 0 : hashCode(this.request);
result = imul(result, 31) + (this.response == null ? 0 : hashCode(this.response)) | 0;
result = imul(result, 31) + this.mode.hashCode() | 0;
return result;
};
protoOf(SubscribeCallbackParams).equals = function (other) {
if (this === other)
return true;
if (!(other instanceof SubscribeCallbackParams))
return false;
var tmp0_other_with_cast = other instanceof SubscribeCallbackParams ? other : THROW_CCE();
if (!equals(this.request, tmp0_other_with_cast.request))
return false;
if (!equals(this.response, tmp0_other_with_cast.response))
return false;
if (!this.mode.equals(tmp0_other_with_cast.mode))
return false;
return true;
};
var Mode_SYNC_instance;
var Mode_ASYNC_instance;
var Mode_SPEC_instance;
function values() {
return [Mode_SYNC_getInstance(), Mode_ASYNC_getInstance(), Mode_SPEC_getInstance()];
}
function valueOf(value) {
switch (value) {
case 'SYNC':
return Mode_SYNC_getInstance();
case 'ASYNC':
return Mode_ASYNC_getInstance();
case 'SPEC':
return Mode_SPEC_getInstance();
default:
Mode_initEntries();
THROW_IAE('No enum constant value.');
break;
}
protoOf(OneAtATimeAssembler).u5 = function (queue, mode) {
var tmp;
if (queue.e()) {
tmp = emptyList();
} else {
var item = queue.f5();
this.t5_1.w5([mode, 'building batch of ', item]);
tmp = listOf(item);
}
return tmp;
};
function NoOpDeduper() {
}
protoOf(NoOpDeduper).x5 = function (events) {
return events;
};
function SubscribeCallbackParams(request, response, mode) {
this.request = request;
this.response = response;
this.mode = mode;
}
protoOf(SubscribeCallbackParams).y5 = function () {
return this.request;
};
protoOf(SubscribeCallbackParams).z5 = function () {
return this.response;
};
protoOf(SubscribeCallbackParams).a6 = function () {
return this.mode;
};
protoOf(SubscribeCallbackParams).b6 = function () {
return this.request;
};
protoOf(SubscribeCallbackParams).c6 = function () {
return this.response;
};
protoOf(SubscribeCallbackParams).d6 = function () {
return this.mode;
};
protoOf(SubscribeCallbackParams).e6 = function (request, response, mode) {
return new SubscribeCallbackParams(request, response, mode);
};
protoOf(SubscribeCallbackParams).copy = function (request, response, mode, $super) {
request = request === VOID ? this.request : request;
response = response === VOID ? this.response : response;
mode = mode === VOID ? this.mode : mode;
return this.e6(request, response, mode);
};
protoOf(SubscribeCallbackParams).toString = function () {
return 'SubscribeCallbackParams(request=' + toString(this.request) + ', response=' + toString(this.response) + ', mode=' + this.mode.toString() + ')';
};
protoOf(SubscribeCallbackParams).hashCode = function () {
var result = this.request == null ? 0 : hashCode(this.request);
result = imul(result, 31) + (this.response == null ? 0 : hashCode(this.response)) | 0;
result = imul(result, 31) + this.mode.hashCode() | 0;
return result;
};
protoOf(SubscribeCallbackParams).equals = function (other) {
if (this === other)
return true;
if (!(other instanceof SubscribeCallbackParams))
return false;
var tmp0_other_with_cast = other instanceof SubscribeCallbackParams ? other : THROW_CCE();
if (!equals(this.request, tmp0_other_with_cast.request))
return false;
if (!equals(this.response, tmp0_other_with_cast.response))
return false;
if (!this.mode.equals(tmp0_other_with_cast.mode))
return false;
}
var Mode_entriesInitialized;
function Mode_initEntries() {
if (Mode_entriesInitialized)
return Unit_instance;
Mode_entriesInitialized = true;
Mode_SYNC_instance = new Mode('SYNC', 0);
Mode_ASYNC_instance = new Mode('ASYNC', 1);
Mode_SPEC_instance = new Mode('SPEC', 2);
}
function Mode(name, ordinal) {
Enum.call(this, name, ordinal);
}
function Mode_SYNC_getInstance() {
Mode_initEntries();
return Mode_SYNC_instance;
}
function Mode_ASYNC_getInstance() {
Mode_initEntries();
return Mode_ASYNC_instance;
}
function Mode_SPEC_getInstance() {
Mode_initEntries();
return Mode_SPEC_instance;
}
function Callback(success, failure) {
this.h6_1 = success;
this.i6_1 = failure;
}
protoOf(Callback).toString = function () {
return 'Callback(success=' + toString_0(this.h6_1) + ', failure=' + toString_0(this.i6_1) + ')';
};
protoOf(Callback).hashCode = function () {
var result = hashCode(this.h6_1);
result = imul(result, 31) + hashCode(this.i6_1) | 0;
return result;
};
protoOf(Callback).equals = function (other) {
if (this === other)
return true;
};
var Mode_SYNC_instance;
var Mode_ASYNC_instance;
var Mode_SPEC_instance;
function values() {
return [Mode_SYNC_getInstance(), Mode_ASYNC_getInstance(), Mode_SPEC_getInstance()];
if (!(other instanceof Callback))
return false;
var tmp0_other_with_cast = other instanceof Callback ? other : THROW_CCE();
if (!equals(this.h6_1, tmp0_other_with_cast.h6_1))
return false;
if (!equals(this.i6_1, tmp0_other_with_cast.i6_1))
return false;
return true;
};
function recalculateSpeculativeWork($this) {
resetSpeculation($this);
$this.e7_1 = true;
$this.o6_1.w5(['recalculateSpeculativeWork']);
var iterator = $this.s6_1.b();
var index = 0;
$l$loop_1: while (iterator.c()) {
var i = index;
index = index + 1 | 0;
var item = iterator.d();
if (i === 0)
continue $l$loop_1;
if (item.retry === true || item.async === true || item.remoteOnly === true)
continue $l$loop_1;
if ($this.u6_1.a5_1 > 10)
break $l$loop_1;
$this.u6_1.l1(item);
}
function valueOf(value) {
switch (value) {
case 'SYNC':
return Mode_SYNC_getInstance();
case 'ASYNC':
return Mode_ASYNC_getInstance();
case 'SPEC':
return Mode_SPEC_getInstance();
default:
Mode_initEntries();
THROW_IAE('No enum constant value.');
break;
}
}
function cancelSpeculation($this) {
$this.o6_1.w5(['cancelSpeculation']);
$this.e7_1 = false;
resetSpeculation($this);
}
function resetSpeculation($this) {
$this.u6_1.i5();
$this.c7_1 = $this.l6_1.clone($this.state);
$this.d7_1 = $this.d7_1 + 1 | 0;
}
function processBatch($this, batch, mode) {
if (batch.e()) {
return Unit_instance;
}
var Mode_entriesInitialized;
function Mode_initEntries() {
if (Mode_entriesInitialized)
return Unit_instance;
Mode_entriesInitialized = true;
Mode_SYNC_instance = new Mode('SYNC', 0);
Mode_ASYNC_instance = new Mode('ASYNC', 1);
Mode_SPEC_instance = new Mode('SPEC', 2);
var tmp;
var tmp0_elvis_lhs = first(batch).remoteOnly;
if (tmp0_elvis_lhs == null ? false : tmp0_elvis_lhs) {
tmp = true;
} else {
tmp = !$this.f7().isReady();
}
function Mode(name, ordinal) {
Enum.call(this, name, ordinal);
var isRemote = tmp;
if (mode.equals(Mode_SYNC_getInstance()))
$this.v6_1 = true;
var request = $this.k6_1.g7(mode.equals(Mode_SPEC_getInstance()) ? $this.c7_1 : $this.state, batch);
var runtime = isRemote ? $this.h7() : $this.f7();
var _unary__edvuaz = $this.p6_1;
$this.p6_1 = _unary__edvuaz + 1 | 0;
var requestId = _unary__edvuaz;
var intendedGeneration = $this.d7_1;
var tmp_0 = DispatcherImpl$processBatch$lambda($this, mode, isRemote, request, intendedGeneration, requestId);
var cbs = new Callback(tmp_0, DispatcherImpl$processBatch$lambda_0($this, mode, isRemote, request, requestId, batch));
// Inline function 'kotlin.collections.set' call
$this.w6_1.d2(requestId, cbs);
runtime.handle($this.m6_1, request, cbs.h6_1, cbs.i6_1);
}
function reset($this, isResettingTimers) {
$this.state = $this.l6_1.clone($this.b7_1);
$this.t6_1.i5();
$this.s6_1.i5();
$this.f7().reset();
$this.h7().reset();
cancelSpeculation($this);
if (isResettingTimers) {
$this.i7().clear();
}
function Mode_SYNC_getInstance() {
Mode_initEntries();
return Mode_SYNC_instance;
}
function Mode_ASYNC_getInstance() {
Mode_initEntries();
return Mode_ASYNC_instance;
}
function Mode_SPEC_getInstance() {
Mode_initEntries();
return Mode_SPEC_instance;
}
function Callback(success, failure) {
this.h6_1 = success;
this.i6_1 = failure;
}
protoOf(Callback).toString = function () {
return 'Callback(success=' + toString_0(this.h6_1) + ', failure=' + toString_0(this.i6_1) + ')';
};
protoOf(Callback).hashCode = function () {
var result = hashCode(this.h6_1);
result = imul(result, 31) + hashCode(this.i6_1) | 0;
return result;
};
protoOf(Callback).equals = function (other) {
if (this === other)
return true;
if (!(other instanceof Callback))
return false;
var tmp0_other_with_cast = other instanceof Callback ? other : THROW_CCE();
if (!equals(this.h6_1, tmp0_other_with_cast.h6_1))
return false;
if (!equals(this.i6_1, tmp0_other_with_cast.i6_1))
return false;
return true;
};
function recalculateSpeculativeWork($this) {
resetSpeculation($this);
$this.e7_1 = true;
$this.o6_1.w5(['recalculateSpeculativeWork']);
var iterator = $this.s6_1.b();
var index = 0;
$l$loop_1: while (iterator.c()) {
var i = index;
index = index + 1 | 0;
var item = iterator.d();
if (i === 0)
continue $l$loop_1;
if (item.retry === true || item.async === true || item.remoteOnly === true)
continue $l$loop_1;
if ($this.u6_1.a5_1 > 10)
break $l$loop_1;
$this.u6_1.l1(item);
}
}
function cancelSpeculation($this) {
$this.o6_1.w5(['cancelSpeculation']);
$this.e7_1 = false;
resetSpeculation($this);
}
function resetSpeculation($this) {
$this.u6_1.i5();
$this.c7_1 = $this.l6_1.clone($this.state);
$this.d7_1 = $this.d7_1 + 1 | 0;
}
function processBatch($this, batch, mode) {
if (batch.e()) {
}
function DispatcherImpl$subscribe$1(this$0, $typedCallback) {
this.j7_1 = this$0;
this.k7_1 = $typedCallback;
}
protoOf(DispatcherImpl$subscribe$1).unsubscribe = function () {
this.j7_1.x6_1.m1(this.k7_1);
};
function DispatcherImpl$processBatch$lambda(this$0, $mode, $isRemote, $request, $intendedGeneration, $requestId) {
return function (rsp) {
this$0.o6_1.w5([$mode, $isRemote ? 'remote' : 'local', 'runtime success', $request, rsp]);
var tmp;
if ($mode.equals(Mode_SPEC_getInstance()) && !(this$0.d7_1 === $intendedGeneration)) {
this$0.o6_1.w5(['throwing away stale speculative results']);
return Unit_instance;
}
var tmp;
var tmp0_elvis_lhs = first(batch).remoteOnly;
if (tmp0_elvis_lhs == null ? false : tmp0_elvis_lhs) {
tmp = true;
} else {
tmp = !$this.f7().isReady();
this$0.w6_1.e2($requestId);
this$0.o6_1.w5([$mode, 'responding', new SubscribeCallbackParams($request, rsp, $mode)]);
var tmp0_iterator = this$0.x6_1.b();
while (tmp0_iterator.c()) {
var element = tmp0_iterator.d();
// Inline function 'net.devvit.DispatcherImpl.processBatch.<anonymous>.<anonymous>' call
element(new SubscribeCallbackParams($request, rsp, $mode));
}
var isRemote = tmp;
if (mode.equals(Mode_SYNC_getInstance()))
$this.v6_1 = true;
var request = $this.k6_1.g7(mode.equals(Mode_SPEC_getInstance()) ? $this.c7_1 : $this.state, batch);
var runtime = isRemote ? $this.h7() : $this.f7();
var _unary__edvuaz = $this.p6_1;
$this.p6_1 = _unary__edvuaz + 1 | 0;
var requestId = _unary__edvuaz;
var intendedGeneration = $this.d7_1;
var tmp_0 = DispatcherImpl$processBatch$lambda($this, mode, isRemote, request, intendedGeneration, requestId);
var cbs = new Callback(tmp_0, DispatcherImpl$processBatch$lambda_0($this, mode, isRemote, request, requestId, batch));
// Inline function 'kotlin.collections.set' call
$this.w6_1.d2(requestId, cbs);
runtime.handle($this.m6_1, request, cbs.h6_1, cbs.i6_1);
}
function reset($this, isResettingTimers) {
$this.state = $this.l6_1.clone($this.b7_1);
$this.t6_1.i5();
$this.s6_1.i5();
$this.f7().reset();
$this.h7().reset();
cancelSpeculation($this);
if (isResettingTimers) {
$this.i7().clear();
var tmp_0;
if ($mode.equals(Mode_SYNC_getInstance())) {
this$0.state = this$0.l6_1.merge(this$0.state, rsp.state);
this$0.v6_1 = false;
tmp_0 = Unit_instance;
} else if ($mode.equals(Mode_SPEC_getInstance())) {
this$0.c7_1 = this$0.l6_1.merge(this$0.c7_1, rsp.state);
tmp_0 = Unit_instance;
}
}
function DispatcherImpl$subscribe$1(this$0, $typedCallback) {
this.j7_1 = this$0;
this.k7_1 = $typedCallback;
}
protoOf(DispatcherImpl$subscribe$1).unsubscribe = function () {
this.j7_1.x6_1.m1(this.k7_1);
};
function DispatcherImpl$processBatch$lambda(this$0, $mode, $isRemote, $request, $intendedGeneration, $requestId) {
return function (rsp) {
this$0.o6_1.w5([$mode, $isRemote ? 'remote' : 'local', 'runtime success', $request, rsp]);
var tmp;
if ($mode.equals(Mode_SPEC_getInstance()) && !(this$0.d7_1 === $intendedGeneration)) {
this$0.o6_1.w5(['throwing away stale speculative results']);
return Unit_instance;
}
this$0.w6_1.e2($requestId);
this$0.o6_1.w5([$mode, 'responding', new SubscribeCallbackParams($request, rsp, $mode)]);
var tmp0_iterator = this$0.x6_1.b();
while (tmp0_iterator.c()) {
var element = tmp0_iterator.d();
// Inline function 'net.devvit.DispatcherImpl.processBatch.<anonymous>.<anonymous>' call
element(new SubscribeCallbackParams($request, rsp, $mode));
}
var tmp_0;
if ($mode.equals(Mode_SYNC_getInstance())) {
this$0.state = this$0.l6_1.merge(this$0.state, rsp.state);
this$0.v6_1 = false;
tmp_0 = Unit_instance;
} else if ($mode.equals(Mode_SPEC_getInstance())) {
this$0.c7_1 = this$0.l6_1.merge(this$0.c7_1, rsp.state);
tmp_0 = Unit_instance;
}
this$0.l7(toList(rsp.replay), $mode);
var tmp_1;
if ($mode.equals(Mode_SYNC_getInstance())) {
recalculateSpeculativeWork(this$0);
tmp_1 = Unit_instance;
}
this$0.m7();
return Unit_instance;
};
}
function DispatcherImpl$processBatch$lambda_0(this$0, $mode, $isRemote, $request, $requestId, $batch) {
return function (err) {
this$0.o6_1.n7([$mode, $isRemote ? 'remote' : 'local', 'runtime error', err, $request]);
this$0.w6_1.e2($requestId);
var tmp;
if ($mode.equals(Mode_SYNC_getInstance())) {
this$0.v6_1 = false;
tmp = Unit_instance;
}
var tmp_0;
if ($mode.equals(Mode_SPEC_getInstance())) {
cancelSpeculation(this$0);
this$0.m7();
return Unit_instance;
}
// Inline function 'kotlin.collections.groupBy' call
// Inline function 'kotlin.collections.groupByTo' call
var this_0 = $batch;
var destination = LinkedHashMap_init_$Create$();
var tmp0_iterator = this_0.b();
while (tmp0_iterator.c()) {
var element = tmp0_iterator.d();
// Inline function 'net.devvit.DispatcherImpl.processBatch.<anonymous>.<anonymous>' call
var key = !(element.remoteOnly === true) && !(element.retry === true);
// Inline function 'kotlin.collections.getOrPut' call
var value = destination.m(key);
var tmp_1;
if (value == null) {
// Inline function 'kotlin.collections.groupByTo.<anonymous>' call
var answer = ArrayList_init_$Create$();
destination.d2(key, answer);
tmp_1 = answer;
} else {
tmp_1 = value;
}
var list = tmp_1;
list.l1(element);
}
var replayable = destination;
var tmp_2;
// Inline function 'kotlin.collections.isNullOrEmpty' call
var this_1 = replayable.m(false);
// Inline function 'kotlin.contracts.contract' call
if (!(this_1 == null || this_1.e())) {
// Inline function 'kotlin.collections.toTypedArray' call
var tmp0_elvis_lhs = replayable.m(false);
var this_2 = tmp0_elvis_lhs == null ? emptyList() : tmp0_elvis_lhs;
var events = copyToArray(this_2);
this$0.o6_1.w5(arrayConcat([['unretryable', err], events]));
tmp_2 = this$0.n6_1.errorHandler(err);
}
var tmp_3;
// Inline function 'kotlin.collections.isNullOrEmpty' call
var this_3 = replayable.m(true);
// Inline function 'kotlin.contracts.contract' call
if (!(this_3 == null || this_3.e())) {
var tmp0_safe_receiver = replayable.m(true);
if (tmp0_safe_receiver == null)
null;
else {
// Inline function 'kotlin.collections.forEach' call
var tmp0_iterator_0 = tmp0_safe_receiver.b();
while (tmp0_iterator_0.c()) {
var element_0 = tmp0_iterator_0.d();
// Inline function 'net.devvit.DispatcherImpl.processBatch.<anonymous>.<anonymous>' call
element_0.retry = true;
element_0.remoteOnly = true;
}
}
var tmp1_elvis_lhs = replayable.m(true);
this$0.l7(tmp1_elvis_lhs == null ? emptyList() : tmp1_elvis_lhs, $mode);
if ($mode.equals(Mode_SYNC_getInstance())) {
recalculateSpeculativeWork(this$0);
}
this$0.m7();
tmp_3 = Unit_instance;
}
return Unit_instance;
};
}
function DispatcherImpl(state, requestBuilder, stateOperations, method, options) {
method = method === VOID ? 'RenderPostContent' : method;
options = options === VOID ? new EmptyOptions() : options;
this.j6_1 = state;
this.k6_1 = requestBuilder;
this.l6_1 = stateOperations;
this.m6_1 = method;
this.n6_1 = options;
this.o6_1 = new NiceLogger(this.n6_1.logger);
this.p6_1 = 0;
this.q6_1 = new NoOpDeduper();
this.r6_1 = new OneAtATimeAssembler(this.o6_1);
this.s6_1 = ArrayDeque_init_$Create$();
this.t6_1 = ArrayDeque_init_$Create$();
this.u6_1 = ArrayDeque_init_$Create$();
this.v6_1 = false;
var tmp = this;
// Inline function 'kotlin.collections.mutableMapOf' call
tmp.w6_1 = LinkedHashMap_init_$Create$();
var tmp_0 = this;
// Inline function 'kotlin.collections.mutableListOf' call
tmp_0.x6_1 = ArrayList_init_$Create$();
this.b7_1 = this.l6_1.clone(this.state);
this.c7_1 = this.l6_1.clone(this.b7_1);
this.d7_1 = 0;
this.e7_1 = true;
this.o6_1.w5(['constructed Dispatcher v2']);
}
protoOf(DispatcherImpl).o7 = function (_set____db54di) {
this.j6_1 = _set____db54di;
};
protoOf(DispatcherImpl).p7 = function () {
return this.j6_1;
};
protoOf(DispatcherImpl).q7 = function () {
return this.s6_1;
};
protoOf(DispatcherImpl).r7 = function () {
return this.t6_1;
};
protoOf(DispatcherImpl).s7 = function () {
return this.u6_1;
};
protoOf(DispatcherImpl).t7 = function (_set____db54di) {
this.y6_1 = _set____db54di;
};
protoOf(DispatcherImpl).f7 = function () {
var tmp = this.y6_1;
if (!(tmp == null))
return tmp;
else {
throwUninitializedPropertyAccessException('local');
this$0.l7(toList(rsp.replay), $mode);
var tmp_1;
if ($mode.equals(Mode_SYNC_getInstance())) {
recalculateSpeculativeWork(this$0);
tmp_1 = Unit_instance;
}
this$0.m7();
return Unit_instance;
};
protoOf(DispatcherImpl).u7 = function (_set____db54di) {
this.z6_1 = _set____db54di;
};
protoOf(DispatcherImpl).h7 = function () {
var tmp = this.z6_1;
if (!(tmp == null))
return tmp;
else {
throwUninitializedPropertyAccessException('remote');
}
function DispatcherImpl$processBatch$lambda_0(this$0, $mode, $isRemote, $request, $requestId, $batch) {
return function (err) {
this$0.o6_1.n7([$mode, $isRemote ? 'remote' : 'local', 'runtime error', err, $request]);
this$0.w6_1.e2($requestId);
var tmp;
if ($mode.equals(Mode_SYNC_getInstance())) {
this$0.v6_1 = false;
tmp = Unit_instance;
}
};
protoOf(DispatcherImpl).v7 = function (_set____db54di) {
this.a7_1 = _set____db54di;
};
protoOf(DispatcherImpl).i7 = function () {
var tmp = this.a7_1;
if (!(tmp == null))
return tmp;
else {
throwUninitializedPropertyAccessException('timers');
}
};
protoOf(DispatcherImpl).w7 = function () {
return this.b7_1;
};
protoOf(DispatcherImpl).x7 = function (_set____db54di) {
this.c7_1 = _set____db54di;
};
protoOf(DispatcherImpl).y7 = function () {
return this.c7_1;
};
protoOf(DispatcherImpl).z7 = function (_set____db54di) {
this.d7_1 = _set____db54di;
};
protoOf(DispatcherImpl).a8 = function () {
return this.d7_1;
};
protoOf(DispatcherImpl).b8 = function (_set____db54di) {
this.e7_1 = _set____db54di;
};
protoOf(DispatcherImpl).c8 = function () {
return this.e7_1 && this.n6_1.featureFlags.isSpeculativeExecutionEnabled;
};
protoOf(DispatcherImpl).init = function (local, remote, timers) {
this.o6_1.w5(['Initializing Dispatcher', local, remote]);
this.y6_1 = local;
this.z6_1 = remote;
this.a7_1 = timers;
this.m7();
};
protoOf(DispatcherImpl).subscribe = function (callback) {
var typedCallback = typeof callback === 'function' ? callback : THROW_CCE();
this.x6_1.l1(typedCallback);
return new DispatcherImpl$subscribe$1(this, typedCallback);
};
protoOf(DispatcherImpl).m7 = function () {
this.o6_1.w5(['ticking', this.v6_1, this.t6_1.a5_1, this.s6_1.a5_1, this.u6_1.a5_1]);
if (!this.f7().isReady() && !this.h7().isReady() && !(this.s6_1.e() && this.t6_1.e())) {
this.o6_1.n7(['ticking with events and no runtime, deferring...']);
var tmp_0;
if ($mode.equals(Mode_SPEC_getInstance())) {
cancelSpeculation(this$0);
this$0.m7();
return Unit_instance;
}
if (!this.v6_1) {
var batch = this.r6_1.u5(this.s6_1, Mode_SYNC_getInstance());
processBatch(this, batch, Mode_SYNC_getInstance());
} else if (this.c8()) {
var batch_0 = this.r6_1.u5(this.u6_1, Mode_SPEC_getInstance());
processBatch(this, batch_0, Mode_SPEC_getInstance());
}
if (!this.t6_1.e()) {
while (!this.t6_1.e()) {
var batch_1 = this.r6_1.u5(this.t6_1, Mode_ASYNC_getInstance());
processBatch(this, batch_1, Mode_ASYNC_getInstance());
}
this.m7();
}
};
protoOf(DispatcherImpl).l7 = function (events, fromMode) {
if (events.e() || fromMode.equals(Mode_SPEC_getInstance())) {
return Unit_instance;
}
this.o6_1.w5(['replaying events', events]);
// Inline function 'kotlin.collections.groupBy' call
// Inline function 'kotlin.collections.groupByTo' call
var this_0 = $batch;
var destination = LinkedHashMap_init_$Create$();
var tmp0_iterator = events.b();
var tmp0_iterator = this_0.b();
while (tmp0_iterator.c()) {
var element = tmp0_iterator.d();
// Inline function 'net.devvit.DispatcherImpl.replayEvents.<anonymous>' call
var key = new Pair(element.async === true, element.retry === true);
// Inline function 'net.devvit.DispatcherImpl.processBatch.<anonymous>.<anonymous>' call
var key = !(element.remoteOnly === true) && !(element.retry === true);
// Inline function 'kotlin.collections.getOrPut' call
var value = destination.m(key);
var tmp;
var tmp_1;
if (value == null) {

@@ -544,410 +334,568 @@ // Inline function 'kotlin.collections.groupByTo.<anonymous>' call

destination.d2(key, answer);
tmp = answer;
tmp_1 = answer;
} else {
tmp = value;
tmp_1 = value;
}
var list = tmp;
var list = tmp_1;
list.l1(element);
}
var grouped = destination;
var tmp0_elvis_lhs = grouped.m(new Pair(true, true));
this.t6_1.h5(0, tmp0_elvis_lhs == null ? emptyList() : tmp0_elvis_lhs);
var tmp1_elvis_lhs = grouped.m(new Pair(true, false));
this.t6_1.p1(tmp1_elvis_lhs == null ? emptyList() : tmp1_elvis_lhs);
var tmp2_elvis_lhs = grouped.m(new Pair(false, true));
this.s6_1.h5(0, tmp2_elvis_lhs == null ? emptyList() : tmp2_elvis_lhs);
var tmp3_elvis_lhs = grouped.m(new Pair(false, false));
this.s6_1.p1(tmp3_elvis_lhs == null ? emptyList() : tmp3_elvis_lhs);
};
protoOf(DispatcherImpl).submit = function (events) {
this.o6_1.w5(arrayConcat([['submitted'], events]));
var deduped = this.q6_1.x5(toList(events));
// Inline function 'kotlin.collections.forEach' call
var tmp0_iterator = deduped.b();
while (tmp0_iterator.c()) {
var element = tmp0_iterator.d();
// Inline function 'net.devvit.DispatcherImpl.submit.<anonymous>' call
if (element.async === true) {
this.t6_1.l1(element);
} else {
this.s6_1.l1(element);
if (this.v6_1 && this.c8()) {
this.u6_1.l1(element);
var replayable = destination;
var tmp_2;
// Inline function 'kotlin.collections.isNullOrEmpty' call
var this_1 = replayable.m(false);
// Inline function 'kotlin.contracts.contract' call
if (!(this_1 == null || this_1.e())) {
// Inline function 'kotlin.collections.toTypedArray' call
var tmp0_elvis_lhs = replayable.m(false);
var this_2 = tmp0_elvis_lhs == null ? emptyList() : tmp0_elvis_lhs;
var events = copyToArray(this_2);
this$0.o6_1.w5(arrayConcat([['unretryable', err], events]));
tmp_2 = this$0.n6_1.errorHandler(err);
}
var tmp_3;
// Inline function 'kotlin.collections.isNullOrEmpty' call
var this_3 = replayable.m(true);
// Inline function 'kotlin.contracts.contract' call
if (!(this_3 == null || this_3.e())) {
var tmp0_safe_receiver = replayable.m(true);
if (tmp0_safe_receiver == null)
null;
else {
// Inline function 'kotlin.collections.forEach' call
var tmp0_iterator_0 = tmp0_safe_receiver.b();
while (tmp0_iterator_0.c()) {
var element_0 = tmp0_iterator_0.d();
// Inline function 'net.devvit.DispatcherImpl.processBatch.<anonymous>.<anonymous>' call
element_0.retry = true;
element_0.remoteOnly = true;
}
}
var tmp1_elvis_lhs = replayable.m(true);
this$0.l7(tmp1_elvis_lhs == null ? emptyList() : tmp1_elvis_lhs, $mode);
if ($mode.equals(Mode_SYNC_getInstance())) {
recalculateSpeculativeWork(this$0);
}
this$0.m7();
tmp_3 = Unit_instance;
}
this.m7();
};
protoOf(DispatcherImpl).reset = function () {
reset(this, true);
};
protoOf(DispatcherImpl).snapshot = function () {
var tmp = this.l6_1.clone(this.state);
// Inline function 'kotlin.collections.toTypedArray' call
var this_0 = this.s6_1;
var tmp_0 = copyToArray(this_0);
// Inline function 'kotlin.collections.toTypedArray' call
var this_1 = this.t6_1;
var tmp$ret$1 = copyToArray(this_1);
return new DispatcherSnapshot(tmp, tmp_0, tmp$ret$1, this.f7().snapshot(), this.h7().snapshot(), this.i7().list());
};
protoOf(DispatcherImpl).pause = function () {
var snap = this.snapshot();
this.i7().pauseAll();
reset(this, false);
return snap;
};
protoOf(DispatcherImpl).resume = function (snap) {
this.state = this.l6_1.clone(snap.state);
this.t6_1.i5();
var tmp = snap.asyncQueue;
addAll(this.t6_1, isArray(tmp) ? tmp : THROW_CCE());
this.s6_1.i5();
var tmp_0 = snap.syncQueue;
addAll(this.s6_1, isArray(tmp_0) ? tmp_0 : THROW_CCE());
cancelSpeculation(this);
this.f7().resume(snap.localSnapshot);
this.h7().resume(snap.remoteSnapshot);
this.i7().resumeAll(snap.timerSnapshot);
};
function EmptyOptions$errorHandler$lambda(it) {
return Unit_instance;
}
function EmptyOptions() {
this.d8_1 = new NoOpLogger();
var tmp = this;
tmp.e8_1 = EmptyOptions$errorHandler$lambda;
this.f8_1 = Disabled_instance;
}
protoOf(EmptyOptions).g8 = function (_set____db54di) {
this.d8_1 = _set____db54di;
};
protoOf(EmptyOptions).h8 = function () {
return this.d8_1;
};
protoOf(EmptyOptions).i8 = function (_set____db54di) {
this.e8_1 = _set____db54di;
};
protoOf(EmptyOptions).j8 = function () {
return this.e8_1;
};
protoOf(EmptyOptions).k8 = function (_set____db54di) {
this.f8_1 = _set____db54di;
};
protoOf(EmptyOptions).l8 = function () {
return this.f8_1;
};
function DispatcherSnapshot(state, syncQueue, asyncQueue, localSnapshot, remoteSnapshot, timerSnapshot) {
this.state = state;
this.syncQueue = syncQueue;
this.asyncQueue = asyncQueue;
this.localSnapshot = localSnapshot;
this.remoteSnapshot = remoteSnapshot;
this.timerSnapshot = timerSnapshot;
}
function DispatcherImpl(state, requestBuilder, stateOperations, method, options) {
method = method === VOID ? 'RenderPostContent' : method;
options = options === VOID ? new EmptyOptions() : options;
this.j6_1 = state;
this.k6_1 = requestBuilder;
this.l6_1 = stateOperations;
this.m6_1 = method;
this.n6_1 = options;
this.o6_1 = new NiceLogger(this.n6_1.logger);
this.p6_1 = 0;
this.q6_1 = new NoOpDeduper();
this.r6_1 = new OneAtATimeAssembler(this.o6_1);
this.s6_1 = ArrayDeque_init_$Create$();
this.t6_1 = ArrayDeque_init_$Create$();
this.u6_1 = ArrayDeque_init_$Create$();
this.v6_1 = false;
var tmp = this;
// Inline function 'kotlin.collections.mutableMapOf' call
tmp.w6_1 = LinkedHashMap_init_$Create$();
var tmp_0 = this;
// Inline function 'kotlin.collections.mutableListOf' call
tmp_0.x6_1 = ArrayList_init_$Create$();
this.b7_1 = this.l6_1.clone(this.state);
this.c7_1 = this.l6_1.clone(this.b7_1);
this.d7_1 = 0;
this.e7_1 = true;
this.o6_1.w5(['constructed Dispatcher v2']);
}
protoOf(DispatcherImpl).o7 = function (_set____db54di) {
this.j6_1 = _set____db54di;
};
protoOf(DispatcherImpl).p7 = function () {
return this.j6_1;
};
protoOf(DispatcherImpl).q7 = function () {
return this.s6_1;
};
protoOf(DispatcherImpl).r7 = function () {
return this.t6_1;
};
protoOf(DispatcherImpl).s7 = function () {
return this.u6_1;
};
protoOf(DispatcherImpl).t7 = function (_set____db54di) {
this.y6_1 = _set____db54di;
};
protoOf(DispatcherImpl).f7 = function () {
var tmp = this.y6_1;
if (!(tmp == null))
return tmp;
else {
throwUninitializedPropertyAccessException('local');
}
protoOf(DispatcherSnapshot).p7 = function () {
return this.state;
};
protoOf(DispatcherSnapshot).m8 = function () {
return this.syncQueue;
};
protoOf(DispatcherSnapshot).n8 = function () {
return this.asyncQueue;
};
protoOf(DispatcherSnapshot).o8 = function () {
return this.localSnapshot;
};
protoOf(DispatcherSnapshot).p8 = function () {
return this.remoteSnapshot;
};
protoOf(DispatcherSnapshot).q8 = function () {
return this.timerSnapshot;
};
protoOf(DispatcherSnapshot).b6 = function () {
return this.state;
};
protoOf(DispatcherSnapshot).c6 = function () {
return this.syncQueue;
};
protoOf(DispatcherSnapshot).d6 = function () {
return this.asyncQueue;
};
protoOf(DispatcherSnapshot).r8 = function () {
return this.localSnapshot;
};
protoOf(DispatcherSnapshot).s8 = function () {
return this.remoteSnapshot;
};
protoOf(DispatcherSnapshot).t8 = function () {
return this.timerSnapshot;
};
protoOf(DispatcherSnapshot).u8 = function (state, syncQueue, asyncQueue, localSnapshot, remoteSnapshot, timerSnapshot) {
return new DispatcherSnapshot(state, syncQueue, asyncQueue, localSnapshot, remoteSnapshot, timerSnapshot);
};
protoOf(DispatcherSnapshot).copy = function (state, syncQueue, asyncQueue, localSnapshot, remoteSnapshot, timerSnapshot, $super) {
state = state === VOID ? this.state : state;
syncQueue = syncQueue === VOID ? this.syncQueue : syncQueue;
asyncQueue = asyncQueue === VOID ? this.asyncQueue : asyncQueue;
localSnapshot = localSnapshot === VOID ? this.localSnapshot : localSnapshot;
remoteSnapshot = remoteSnapshot === VOID ? this.remoteSnapshot : remoteSnapshot;
timerSnapshot = timerSnapshot === VOID ? this.timerSnapshot : timerSnapshot;
return this.u8(state, syncQueue, asyncQueue, localSnapshot, remoteSnapshot, timerSnapshot);
};
protoOf(DispatcherSnapshot).toString = function () {
return 'DispatcherSnapshot(state=' + toString(this.state) + ', syncQueue=' + toString_0(this.syncQueue) + ', asyncQueue=' + toString_0(this.asyncQueue) + ', localSnapshot=' + toString(this.localSnapshot) + ', remoteSnapshot=' + toString(this.remoteSnapshot) + ', timerSnapshot=' + toString(this.timerSnapshot) + ')';
};
protoOf(DispatcherSnapshot).hashCode = function () {
var result = this.state == null ? 0 : hashCode(this.state);
result = imul(result, 31) + hashCode(this.syncQueue) | 0;
result = imul(result, 31) + hashCode(this.asyncQueue) | 0;
result = imul(result, 31) + (this.localSnapshot == null ? 0 : hashCode(this.localSnapshot)) | 0;
result = imul(result, 31) + (this.remoteSnapshot == null ? 0 : hashCode(this.remoteSnapshot)) | 0;
result = imul(result, 31) + (this.timerSnapshot == null ? 0 : hashCode(this.timerSnapshot)) | 0;
return result;
};
protoOf(DispatcherSnapshot).equals = function (other) {
if (this === other)
return true;
if (!(other instanceof DispatcherSnapshot))
return false;
var tmp0_other_with_cast = other instanceof DispatcherSnapshot ? other : THROW_CCE();
if (!equals(this.state, tmp0_other_with_cast.state))
return false;
if (!equals(this.syncQueue, tmp0_other_with_cast.syncQueue))
return false;
if (!equals(this.asyncQueue, tmp0_other_with_cast.asyncQueue))
return false;
if (!equals(this.localSnapshot, tmp0_other_with_cast.localSnapshot))
return false;
if (!equals(this.remoteSnapshot, tmp0_other_with_cast.remoteSnapshot))
return false;
if (!equals(this.timerSnapshot, tmp0_other_with_cast.timerSnapshot))
return false;
return true;
};
function Disabled() {
this.v8_1 = false;
};
protoOf(DispatcherImpl).u7 = function (_set____db54di) {
this.z6_1 = _set____db54di;
};
protoOf(DispatcherImpl).h7 = function () {
var tmp = this.z6_1;
if (!(tmp == null))
return tmp;
else {
throwUninitializedPropertyAccessException('remote');
}
protoOf(Disabled).w8 = function () {
return this.v8_1;
};
var Disabled_instance;
function Disabled_getInstance() {
return Disabled_instance;
};
protoOf(DispatcherImpl).v7 = function (_set____db54di) {
this.a7_1 = _set____db54di;
};
protoOf(DispatcherImpl).i7 = function () {
var tmp = this.a7_1;
if (!(tmp == null))
return tmp;
else {
throwUninitializedPropertyAccessException('timers');
}
function NiceLogger(logger) {
this.v5_1 = logger;
};
protoOf(DispatcherImpl).w7 = function () {
return this.b7_1;
};
protoOf(DispatcherImpl).x7 = function (_set____db54di) {
this.c7_1 = _set____db54di;
};
protoOf(DispatcherImpl).y7 = function () {
return this.c7_1;
};
protoOf(DispatcherImpl).z7 = function (_set____db54di) {
this.d7_1 = _set____db54di;
};
protoOf(DispatcherImpl).a8 = function () {
return this.d7_1;
};
protoOf(DispatcherImpl).b8 = function (_set____db54di) {
this.e7_1 = _set____db54di;
};
protoOf(DispatcherImpl).c8 = function () {
return this.e7_1 && this.n6_1.featureFlags.isSpeculativeExecutionEnabled;
};
protoOf(DispatcherImpl).init = function (local, remote, timers) {
this.o6_1.w5(['Initializing Dispatcher', local, remote]);
this.y6_1 = local;
this.z6_1 = remote;
this.a7_1 = timers;
this.m7();
};
protoOf(DispatcherImpl).subscribe = function (callback) {
var typedCallback = typeof callback === 'function' ? callback : THROW_CCE();
this.x6_1.l1(typedCallback);
return new DispatcherImpl$subscribe$1(this, typedCallback);
};
protoOf(DispatcherImpl).m7 = function () {
this.o6_1.w5(['ticking', this.v6_1, this.t6_1.a5_1, this.s6_1.a5_1, this.u6_1.a5_1]);
if (!this.f7().isReady() && !this.h7().isReady() && !(this.s6_1.e() && this.t6_1.e())) {
this.o6_1.n7(['ticking with events and no runtime, deferring...']);
return Unit_instance;
}
protoOf(NiceLogger).n7 = function (messages) {
this.v5_1.warn(messages);
};
protoOf(NiceLogger).w5 = function (messages) {
this.v5_1.debug(messages);
};
function NoOpLogger() {
if (!this.v6_1) {
var batch = this.r6_1.u5(this.s6_1, Mode_SYNC_getInstance());
processBatch(this, batch, Mode_SYNC_getInstance());
} else if (this.c8()) {
var batch_0 = this.r6_1.u5(this.u6_1, Mode_SPEC_getInstance());
processBatch(this, batch_0, Mode_SPEC_getInstance());
}
protoOf(NoOpLogger).info = function (messages) {
};
protoOf(NoOpLogger).error = function (messages) {
};
protoOf(NoOpLogger).warn = function (messages) {
};
protoOf(NoOpLogger).debug = function (messages) {
};
function TimerDefinition(id, duration) {
this.id = id;
this.duration = duration;
if (!this.t6_1.e()) {
while (!this.t6_1.e()) {
var batch_1 = this.r6_1.u5(this.t6_1, Mode_ASYNC_getInstance());
processBatch(this, batch_1, Mode_ASYNC_getInstance());
}
this.m7();
}
protoOf(TimerDefinition).x8 = function () {
return this.id;
};
protoOf(TimerDefinition).y8 = function () {
return this.duration;
};
protoOf(TimerDefinition).b6 = function () {
return this.id;
};
protoOf(TimerDefinition).c6 = function () {
return this.duration;
};
protoOf(TimerDefinition).z8 = function (id, duration) {
return new TimerDefinition(id, duration);
};
protoOf(TimerDefinition).copy = function (id, duration, $super) {
id = id === VOID ? this.id : id;
duration = duration === VOID ? this.duration : duration;
return this.z8(id, duration);
};
protoOf(TimerDefinition).toString = function () {
return 'TimerDefinition(id=' + this.id + ', duration=' + this.duration + ')';
};
protoOf(TimerDefinition).hashCode = function () {
var result = getStringHashCode(this.id);
result = imul(result, 31) + this.duration | 0;
return result;
};
protoOf(TimerDefinition).equals = function (other) {
if (this === other)
return true;
if (!(other instanceof TimerDefinition))
return false;
var tmp0_other_with_cast = other instanceof TimerDefinition ? other : THROW_CCE();
if (!(this.id === tmp0_other_with_cast.id))
return false;
if (!(this.duration === tmp0_other_with_cast.duration))
return false;
return true;
};
function JsDispatcherImpl(state, requestBuilder, method, options) {
method = method === VOID ? 'RenderPostContent' : method;
options = options === VOID ? new EmptyOptions() : options;
DispatcherImpl.call(this, state, new JsRequestBuilderAdapter(requestBuilder), new JsonStateOperations(), method, options);
this.w9_1 = method;
this.x9_1 = options;
};
protoOf(DispatcherImpl).l7 = function (events, fromMode) {
if (events.e() || fromMode.equals(Mode_SPEC_getInstance())) {
return Unit_instance;
}
function JsRequestBuilderAdapter(jsRequestBuilder) {
this.y9_1 = jsRequestBuilder;
this.o6_1.w5(['replaying events', events]);
// Inline function 'kotlin.collections.groupBy' call
// Inline function 'kotlin.collections.groupByTo' call
var destination = LinkedHashMap_init_$Create$();
var tmp0_iterator = events.b();
while (tmp0_iterator.c()) {
var element = tmp0_iterator.d();
// Inline function 'net.devvit.DispatcherImpl.replayEvents.<anonymous>' call
var key = new Pair(element.async === true, element.retry === true);
// Inline function 'kotlin.collections.getOrPut' call
var value = destination.m(key);
var tmp;
if (value == null) {
// Inline function 'kotlin.collections.groupByTo.<anonymous>' call
var answer = ArrayList_init_$Create$();
destination.d2(key, answer);
tmp = answer;
} else {
tmp = value;
}
var list = tmp;
list.l1(element);
}
protoOf(JsRequestBuilderAdapter).z9 = function (state, events) {
// Inline function 'kotlin.collections.toTypedArray' call
var tmp$ret$0 = copyToArray(events);
return this.y9_1.build(state, tmp$ret$0);
};
protoOf(JsRequestBuilderAdapter).g7 = function (state, events) {
return this.z9((!(state == null) ? !(state == null) : false) ? state : THROW_CCE(), events);
};
function entriesOf(jsObject) {
// Inline function 'kotlin.collections.map' call
var tmp = Object.entries;
var this_0 = ((!(tmp == null) ? typeof tmp === 'function' : false) ? tmp : THROW_CCE())(jsObject);
// Inline function 'kotlin.collections.mapTo' call
var destination = ArrayList_init_$Create$_0(this_0.length);
var inductionVariable = 0;
var last = this_0.length;
while (inductionVariable < last) {
var item = this_0[inductionVariable];
inductionVariable = inductionVariable + 1 | 0;
// Inline function 'net.devvit.entriesOf.<anonymous>' call
var tmp_0 = item[0];
var tmp$ret$0 = to((!(tmp_0 == null) ? typeof tmp_0 === 'string' : false) ? tmp_0 : THROW_CCE(), item[1]);
destination.l1(tmp$ret$0);
var grouped = destination;
var tmp0_elvis_lhs = grouped.m(new Pair(true, true));
this.t6_1.h5(0, tmp0_elvis_lhs == null ? emptyList() : tmp0_elvis_lhs);
var tmp1_elvis_lhs = grouped.m(new Pair(true, false));
this.t6_1.p1(tmp1_elvis_lhs == null ? emptyList() : tmp1_elvis_lhs);
var tmp2_elvis_lhs = grouped.m(new Pair(false, true));
this.s6_1.h5(0, tmp2_elvis_lhs == null ? emptyList() : tmp2_elvis_lhs);
var tmp3_elvis_lhs = grouped.m(new Pair(false, false));
this.s6_1.p1(tmp3_elvis_lhs == null ? emptyList() : tmp3_elvis_lhs);
};
protoOf(DispatcherImpl).submit = function (events) {
this.o6_1.w5(arrayConcat([['submitted'], events]));
var deduped = this.q6_1.x5(toList(events));
// Inline function 'kotlin.collections.forEach' call
var tmp0_iterator = deduped.b();
while (tmp0_iterator.c()) {
var element = tmp0_iterator.d();
// Inline function 'net.devvit.DispatcherImpl.submit.<anonymous>' call
if (element.async === true) {
this.t6_1.l1(element);
} else {
this.s6_1.l1(element);
if (this.v6_1 && this.c8()) {
this.u6_1.l1(element);
}
}
return destination;
}
function JsonStateOperations() {
this.m7();
};
protoOf(DispatcherImpl).reset = function () {
reset(this, true);
};
protoOf(DispatcherImpl).snapshot = function () {
var tmp = this.l6_1.clone(this.state);
// Inline function 'kotlin.collections.toTypedArray' call
var this_0 = this.s6_1;
var tmp_0 = copyToArray(this_0);
// Inline function 'kotlin.collections.toTypedArray' call
var this_1 = this.t6_1;
var tmp$ret$1 = copyToArray(this_1);
return new DispatcherSnapshot(tmp, tmp_0, tmp$ret$1, this.f7().snapshot(), this.h7().snapshot(), this.i7().list());
};
protoOf(DispatcherImpl).pause = function () {
var snap = this.snapshot();
this.i7().pauseAll();
reset(this, false);
return snap;
};
protoOf(DispatcherImpl).resume = function (snap) {
this.state = this.l6_1.clone(snap.state);
this.t6_1.i5();
var tmp = snap.asyncQueue;
addAll(this.t6_1, isArray(tmp) ? tmp : THROW_CCE());
this.s6_1.i5();
var tmp_0 = snap.syncQueue;
addAll(this.s6_1, isArray(tmp_0) ? tmp_0 : THROW_CCE());
cancelSpeculation(this);
this.f7().resume(snap.localSnapshot);
this.h7().resume(snap.remoteSnapshot);
this.i7().resumeAll(snap.timerSnapshot);
};
function EmptyOptions$errorHandler$lambda(it) {
return Unit_instance;
}
function EmptyOptions() {
this.d8_1 = new NoOpLogger();
var tmp = this;
tmp.e8_1 = EmptyOptions$errorHandler$lambda;
this.f8_1 = Disabled_instance;
}
protoOf(EmptyOptions).g8 = function (_set____db54di) {
this.d8_1 = _set____db54di;
};
protoOf(EmptyOptions).h8 = function () {
return this.d8_1;
};
protoOf(EmptyOptions).i8 = function (_set____db54di) {
this.e8_1 = _set____db54di;
};
protoOf(EmptyOptions).j8 = function () {
return this.e8_1;
};
protoOf(EmptyOptions).k8 = function (_set____db54di) {
this.f8_1 = _set____db54di;
};
protoOf(EmptyOptions).l8 = function () {
return this.f8_1;
};
function DispatcherSnapshot(state, syncQueue, asyncQueue, localSnapshot, remoteSnapshot, timerSnapshot) {
this.state = state;
this.syncQueue = syncQueue;
this.asyncQueue = asyncQueue;
this.localSnapshot = localSnapshot;
this.remoteSnapshot = remoteSnapshot;
this.timerSnapshot = timerSnapshot;
}
protoOf(DispatcherSnapshot).p7 = function () {
return this.state;
};
protoOf(DispatcherSnapshot).m8 = function () {
return this.syncQueue;
};
protoOf(DispatcherSnapshot).n8 = function () {
return this.asyncQueue;
};
protoOf(DispatcherSnapshot).o8 = function () {
return this.localSnapshot;
};
protoOf(DispatcherSnapshot).p8 = function () {
return this.remoteSnapshot;
};
protoOf(DispatcherSnapshot).q8 = function () {
return this.timerSnapshot;
};
protoOf(DispatcherSnapshot).b6 = function () {
return this.state;
};
protoOf(DispatcherSnapshot).c6 = function () {
return this.syncQueue;
};
protoOf(DispatcherSnapshot).d6 = function () {
return this.asyncQueue;
};
protoOf(DispatcherSnapshot).r8 = function () {
return this.localSnapshot;
};
protoOf(DispatcherSnapshot).s8 = function () {
return this.remoteSnapshot;
};
protoOf(DispatcherSnapshot).t8 = function () {
return this.timerSnapshot;
};
protoOf(DispatcherSnapshot).u8 = function (state, syncQueue, asyncQueue, localSnapshot, remoteSnapshot, timerSnapshot) {
return new DispatcherSnapshot(state, syncQueue, asyncQueue, localSnapshot, remoteSnapshot, timerSnapshot);
};
protoOf(DispatcherSnapshot).copy = function (state, syncQueue, asyncQueue, localSnapshot, remoteSnapshot, timerSnapshot, $super) {
state = state === VOID ? this.state : state;
syncQueue = syncQueue === VOID ? this.syncQueue : syncQueue;
asyncQueue = asyncQueue === VOID ? this.asyncQueue : asyncQueue;
localSnapshot = localSnapshot === VOID ? this.localSnapshot : localSnapshot;
remoteSnapshot = remoteSnapshot === VOID ? this.remoteSnapshot : remoteSnapshot;
timerSnapshot = timerSnapshot === VOID ? this.timerSnapshot : timerSnapshot;
return this.u8(state, syncQueue, asyncQueue, localSnapshot, remoteSnapshot, timerSnapshot);
};
protoOf(DispatcherSnapshot).toString = function () {
return 'DispatcherSnapshot(state=' + toString(this.state) + ', syncQueue=' + toString_0(this.syncQueue) + ', asyncQueue=' + toString_0(this.asyncQueue) + ', localSnapshot=' + toString(this.localSnapshot) + ', remoteSnapshot=' + toString(this.remoteSnapshot) + ', timerSnapshot=' + toString(this.timerSnapshot) + ')';
};
protoOf(DispatcherSnapshot).hashCode = function () {
var result = this.state == null ? 0 : hashCode(this.state);
result = imul(result, 31) + hashCode(this.syncQueue) | 0;
result = imul(result, 31) + hashCode(this.asyncQueue) | 0;
result = imul(result, 31) + (this.localSnapshot == null ? 0 : hashCode(this.localSnapshot)) | 0;
result = imul(result, 31) + (this.remoteSnapshot == null ? 0 : hashCode(this.remoteSnapshot)) | 0;
result = imul(result, 31) + (this.timerSnapshot == null ? 0 : hashCode(this.timerSnapshot)) | 0;
return result;
};
protoOf(DispatcherSnapshot).equals = function (other) {
if (this === other)
return true;
if (!(other instanceof DispatcherSnapshot))
return false;
var tmp0_other_with_cast = other instanceof DispatcherSnapshot ? other : THROW_CCE();
if (!equals(this.state, tmp0_other_with_cast.state))
return false;
if (!equals(this.syncQueue, tmp0_other_with_cast.syncQueue))
return false;
if (!equals(this.asyncQueue, tmp0_other_with_cast.asyncQueue))
return false;
if (!equals(this.localSnapshot, tmp0_other_with_cast.localSnapshot))
return false;
if (!equals(this.remoteSnapshot, tmp0_other_with_cast.remoteSnapshot))
return false;
if (!equals(this.timerSnapshot, tmp0_other_with_cast.timerSnapshot))
return false;
return true;
};
function Disabled() {
this.v8_1 = false;
}
protoOf(Disabled).w8 = function () {
return this.v8_1;
};
var Disabled_instance;
function Disabled_getInstance() {
return Disabled_instance;
}
function NiceLogger(logger) {
this.v5_1 = logger;
}
protoOf(NiceLogger).n7 = function (messages) {
this.v5_1.warn(messages);
};
protoOf(NiceLogger).w5 = function (messages) {
this.v5_1.debug(messages);
};
function NoOpLogger() {
}
protoOf(NoOpLogger).info = function (messages) {
};
protoOf(NoOpLogger).error = function (messages) {
};
protoOf(NoOpLogger).warn = function (messages) {
};
protoOf(NoOpLogger).debug = function (messages) {
};
function TimerDefinition(id, duration) {
this.id = id;
this.duration = duration;
}
protoOf(TimerDefinition).x8 = function () {
return this.id;
};
protoOf(TimerDefinition).y8 = function () {
return this.duration;
};
protoOf(TimerDefinition).b6 = function () {
return this.id;
};
protoOf(TimerDefinition).c6 = function () {
return this.duration;
};
protoOf(TimerDefinition).z8 = function (id, duration) {
return new TimerDefinition(id, duration);
};
protoOf(TimerDefinition).copy = function (id, duration, $super) {
id = id === VOID ? this.id : id;
duration = duration === VOID ? this.duration : duration;
return this.z8(id, duration);
};
protoOf(TimerDefinition).toString = function () {
return 'TimerDefinition(id=' + this.id + ', duration=' + this.duration + ')';
};
protoOf(TimerDefinition).hashCode = function () {
var result = getStringHashCode(this.id);
result = imul(result, 31) + this.duration | 0;
return result;
};
protoOf(TimerDefinition).equals = function (other) {
if (this === other)
return true;
if (!(other instanceof TimerDefinition))
return false;
var tmp0_other_with_cast = other instanceof TimerDefinition ? other : THROW_CCE();
if (!(this.id === tmp0_other_with_cast.id))
return false;
if (!(this.duration === tmp0_other_with_cast.duration))
return false;
return true;
};
function JsDispatcherImpl(state, requestBuilder, method, options) {
method = method === VOID ? 'RenderPostContent' : method;
options = options === VOID ? new EmptyOptions() : options;
DispatcherImpl.call(this, state, new JsRequestBuilderAdapter(requestBuilder), new JsonStateOperations(), method, options);
this.w9_1 = method;
this.x9_1 = options;
}
function JsRequestBuilderAdapter(jsRequestBuilder) {
this.y9_1 = jsRequestBuilder;
}
protoOf(JsRequestBuilderAdapter).z9 = function (state, events) {
// Inline function 'kotlin.collections.toTypedArray' call
var tmp$ret$0 = copyToArray(events);
return this.y9_1.build(state, tmp$ret$0);
};
protoOf(JsRequestBuilderAdapter).g7 = function (state, events) {
return this.z9((!(state == null) ? !(state == null) : false) ? state : THROW_CCE(), events);
};
function entriesOf(jsObject) {
// Inline function 'kotlin.collections.map' call
var tmp = Object.entries;
var this_0 = ((!(tmp == null) ? typeof tmp === 'function' : false) ? tmp : THROW_CCE())(jsObject);
// Inline function 'kotlin.collections.mapTo' call
var destination = ArrayList_init_$Create$_0(this_0.length);
var inductionVariable = 0;
var last = this_0.length;
while (inductionVariable < last) {
var item = this_0[inductionVariable];
inductionVariable = inductionVariable + 1 | 0;
// Inline function 'net.devvit.entriesOf.<anonymous>' call
var tmp_0 = item[0];
var tmp$ret$0 = to((!(tmp_0 == null) ? typeof tmp_0 === 'string' : false) ? tmp_0 : THROW_CCE(), item[1]);
destination.l1(tmp$ret$0);
}
protoOf(JsonStateOperations).clone = function (obj) {
return JSON.parse(JSON.stringify(obj));
};
protoOf(JsonStateOperations).merge = function (target, src) {
var tmp = {};
var result = (!(tmp == null) ? !(tmp == null) : false) ? tmp : THROW_CCE();
// Inline function 'kotlin.collections.forEach' call
var tmp0_iterator = entriesOf(target).b();
while (tmp0_iterator.c()) {
var element = tmp0_iterator.d();
// Inline function 'net.devvit.JsonStateOperations.merge.<anonymous>' call
result[element.r5_1] = element.s5_1;
}
// Inline function 'kotlin.collections.forEach' call
var tmp0_iterator_0 = entriesOf(src).b();
while (tmp0_iterator_0.c()) {
var element_0 = tmp0_iterator_0.d();
// Inline function 'net.devvit.JsonStateOperations.merge.<anonymous>' call
result[element_0.r5_1] = element_0.s5_1;
}
return result;
};
//region block: post-declaration
defineProp(protoOf(Mode), 'name', protoOf(Mode).q);
defineProp(protoOf(Mode), 'ordinal', protoOf(Mode).r);
defineProp(protoOf(DispatcherImpl), 'state', function () {
return this.p7();
}, function (value) {
this.o7(value);
});
defineProp(protoOf(EmptyOptions), 'logger', function () {
return this.h8();
}, function (value) {
this.g8(value);
});
defineProp(protoOf(EmptyOptions), 'errorHandler', function () {
return this.j8();
}, function (value) {
this.i8(value);
});
defineProp(protoOf(EmptyOptions), 'featureFlags', function () {
return this.l8();
}, function (value) {
this.k8(value);
});
defineProp(protoOf(Disabled), 'isSpeculativeExecutionEnabled', function () {
return this.w8();
});
defineProp(protoOf(JsDispatcherImpl), 'state', function () {
return this.p7();
}, function (value) {
this.o7(value);
});
//endregion
//region block: init
Disabled_instance = new Disabled();
//endregion
//region block: exports
function $jsExportAll$(_) {
var $net = _.net || (_.net = {});
var $net$devvit = $net.devvit || ($net.devvit = {});
$net$devvit.SubscribeCallbackParams = SubscribeCallbackParams;
$net$devvit.Mode = Mode;
$net$devvit.Mode.values = values;
$net$devvit.Mode.valueOf = valueOf;
defineProp($net$devvit.Mode, 'SYNC', Mode_SYNC_getInstance);
defineProp($net$devvit.Mode, 'ASYNC', Mode_ASYNC_getInstance);
defineProp($net$devvit.Mode, 'SPEC', Mode_SPEC_getInstance);
var $net = _.net || (_.net = {});
var $net$devvit = $net.devvit || ($net.devvit = {});
$net$devvit.EmptyOptions = EmptyOptions;
var $net = _.net || (_.net = {});
var $net$devvit = $net.devvit || ($net.devvit = {});
$net$devvit.DispatcherSnapshot = DispatcherSnapshot;
var $net = _.net || (_.net = {});
var $net$devvit = $net.devvit || ($net.devvit = {});
var $net$devvit$timer = $net$devvit.timer || ($net$devvit.timer = {});
$net$devvit$timer.TimerDefinition = TimerDefinition;
var $net = _.net || (_.net = {});
var $net$devvit = $net.devvit || ($net.devvit = {});
var $net = _.net || (_.net = {});
var $net$devvit = $net.devvit || ($net.devvit = {});
var $net = _.net || (_.net = {});
var $net$devvit = $net.devvit || ($net.devvit = {});
var $net = _.net || (_.net = {});
var $net$devvit = $net.devvit || ($net.devvit = {});
var $net = _.net || (_.net = {});
var $net$devvit = $net.devvit || ($net.devvit = {});
var $net = _.net || (_.net = {});
var $net$devvit = $net.devvit || ($net.devvit = {});
var $net = _.net || (_.net = {});
var $net$devvit = $net.devvit || ($net.devvit = {});
var $net = _.net || (_.net = {});
var $net$devvit = $net.devvit || ($net.devvit = {});
var $net = _.net || (_.net = {});
var $net$devvit = $net.devvit || ($net.devvit = {});
var $net = _.net || (_.net = {});
var $net$devvit = $net.devvit || ($net.devvit = {});
var $net$devvit$config = $net$devvit.config || ($net$devvit.config = {});
var $net = _.net || (_.net = {});
var $net$devvit = $net.devvit || ($net.devvit = {});
var $net$devvit$config = $net$devvit.config || ($net$devvit.config = {});
var $net = _.net || (_.net = {});
var $net$devvit = $net.devvit || ($net.devvit = {});
var $net$devvit$timer = $net$devvit.timer || ($net$devvit.timer = {});
var $net = _.net || (_.net = {});
var $net$devvit = $net.devvit || ($net.devvit = {});
$net$devvit.JsDispatcherImpl = JsDispatcherImpl;
return destination;
}
function JsonStateOperations() {
}
protoOf(JsonStateOperations).clone = function (obj) {
return JSON.parse(JSON.stringify(obj));
};
protoOf(JsonStateOperations).merge = function (target, src) {
var tmp = {};
var result = (!(tmp == null) ? !(tmp == null) : false) ? tmp : THROW_CCE();
// Inline function 'kotlin.collections.forEach' call
var tmp0_iterator = entriesOf(target).b();
while (tmp0_iterator.c()) {
var element = tmp0_iterator.d();
// Inline function 'net.devvit.JsonStateOperations.merge.<anonymous>' call
result[element.r5_1] = element.s5_1;
}
$jsExportAll$(_);
//endregion
return _;
}));
// Inline function 'kotlin.collections.forEach' call
var tmp0_iterator_0 = entriesOf(src).b();
while (tmp0_iterator_0.c()) {
var element_0 = tmp0_iterator_0.d();
// Inline function 'net.devvit.JsonStateOperations.merge.<anonymous>' call
result[element_0.r5_1] = element_0.s5_1;
}
return result;
};
//region block: post-declaration
defineProp(protoOf(Mode), 'name', protoOf(Mode).q);
defineProp(protoOf(Mode), 'ordinal', protoOf(Mode).r);
defineProp(protoOf(DispatcherImpl), 'state', function () {
return this.p7();
}, function (value) {
this.o7(value);
});
defineProp(protoOf(EmptyOptions), 'logger', function () {
return this.h8();
}, function (value) {
this.g8(value);
});
defineProp(protoOf(EmptyOptions), 'errorHandler', function () {
return this.j8();
}, function (value) {
this.i8(value);
});
defineProp(protoOf(EmptyOptions), 'featureFlags', function () {
return this.l8();
}, function (value) {
this.k8(value);
});
defineProp(protoOf(Disabled), 'isSpeculativeExecutionEnabled', function () {
return this.w8();
});
defineProp(protoOf(JsDispatcherImpl), 'state', function () {
return this.p7();
}, function (value) {
this.o7(value);
});
//endregion
//region block: init
Disabled_instance = new Disabled();
//endregion
//region block: exports
Mode.values = values;
Mode.valueOf = valueOf;
defineProp(Mode, 'SYNC', Mode_SYNC_getInstance);
defineProp(Mode, 'ASYNC', Mode_ASYNC_getInstance);
defineProp(Mode, 'SPEC', Mode_SPEC_getInstance);
export {
SubscribeCallbackParams as SubscribeCallbackParams,
Mode as Mode,
EmptyOptions as EmptyOptions,
DispatcherSnapshot as DispatcherSnapshot,
TimerDefinition as TimerDefinition,
JsDispatcherImpl as JsDispatcherImpl,
};
//endregion
//# sourceMappingURL=ui-shared-shared.js.map
{
"name": "@devvit/multiplatform",
"version": "0.0.1-20240524-5d552a12",
"main": "kotlin/ui-shared-shared.js",
"version": "0.0.1-20240529-491771c9",
"main": "kotlin/ui-shared-shared.mjs",
"devDependencies": {

@@ -22,3 +22,10 @@ "webpack": "5.91.0",

"url": "https://developers.reddit.com/"
}
},
"type": "module",
"exports": {
"./*": "./kotlin/*"
},
"files": [
"kotlin/**"
]
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc