2026-07-20 16:05:17 +00:00
// Module ID: 1589
2026-07-21 22:01:30 +00:00
// Function ID: 17732
2026-07-20 16:05:17 +00:00
// Name: runWorkletOnJS
// Dependencies: []
// Exports: executeOnUIRuntimeSync
// Module 1589 (runWorkletOnJS)
function runWorkletOnJS ( apply ) {
const length = arguments . length ;
let num = 0 ;
if ( length > 1 ) {
num = length - 1 ;
}
const array = new Array ( num ) ;
for ( let num2 = 1 ; num2 < length ; num2 = num2 + 1 ) {
array [ num2 - 1 ] = arguments [ num2 ] ;
}
apply . apply ( undefined , array ) ;
}
let closure _3 = importDefault ( dependencyMap [ 0 ] ) ;
let closure _4 = importDefault ( dependencyMap [ 1 ] ) ;
let obj = arg1 ( dependencyMap [ 2 ] ) ;
let closure _5 = obj . isJest ( ) ;
const shouldBeUseWebResult = arg1 ( dependencyMap [ 2 ] ) . shouldBeUseWeb ( ) ;
let closure _7 = [ ] ;
let closure _8 = { code : "function setupMicrotasks_Pnpm_threadsTs1(){let microtasksQueue=[];let isExecutingMicrotasksQueue=false;global.queueMicrotask=function(callback){microtasksQueue.push(callback);};global.__callMicrotasks=function(){if(isExecutingMicrotasksQueue){return;}try{isExecutingMicrotasksQueue=true;for(let index=0;index<microtasksQueue.length;index+=1){microtasksQueue[index]();}microtasksQueue=[];global._maybeFlushUIUpdatesQueue();}finally{isExecutingMicrotasksQueue=false;}};}" } ;
let closure _9 = { code : "function callMicrotasksOnUIThread_Pnpm_threadsTs2(){global.__callMicrotasks();}" } ;
const obj2 = arg1 ( dependencyMap [ 2 ] ) ;
let fn = ( ) => {
function callMicrotasksOnUIThread ( ) {
closure _0 . _ _callMicrotasks ( ) ;
}
callMicrotasksOnUIThread . _ _closure = { } ;
callMicrotasksOnUIThread . _ _workletHash = 741957556389 ;
callMicrotasksOnUIThread . _ _initData = closure _9 ;
return callMicrotasksOnUIThread ;
} ( ) ;
if ( shouldBeUseWebResult ) {
fn = ( ) => {
} ;
}
let closure _11 = { code : "function runOnUI_Pnpm_threadsTs3(worklet){const{__DEV__,SHOULD_BE_USE_WEB,isWorkletFunction,IS_JEST,ReanimatedModule,makeShareableCloneRecursive,callMicrotasks}=this.__closure;if(__DEV__&&!SHOULD_BE_USE_WEB&&_WORKLET){throw new ReanimatedError('`runOnUI` cannot be called on the UI runtime. Please call the function synchronously or use `queueMicrotask` or `requestAnimationFrame` instead.');}if(__DEV__&&!SHOULD_BE_USE_WEB&&!isWorkletFunction(worklet)){throw new ReanimatedError('`runOnUI` can only be used with worklets.');}return function(...args){if(IS_JEST){ReanimatedModule.scheduleOnUI(makeShareableCloneRecursive(function(){'worklet';worklet(...args);}));return;}if(__DEV__){makeShareableCloneRecursive(worklet);makeShareableCloneRecursive(args);}_runOnUIQueue.push([worklet,args]);if(_runOnUIQueue.length===1){queueMicrotask(function(){const queue=_runOnUIQueue;_runOnUIQueue=[];ReanimatedModule.scheduleOnUI(makeShareableCloneRecursive(function(){'worklet';queue.forEach(function([worklet,args]){worklet(...args);});callMicrotasks();}));});}};}" } ;
let closure _12 = { code : "function pnpm_threadsTs4(){const{worklet,args}=this.__closure;worklet(...args);}" } ;
let closure _13 = { code : "function pnpm_threadsTs5(){const{queue,callMicrotasks}=this.__closure;queue.forEach(function([worklet,args]){worklet(...args);});callMicrotasks();}" } ;
let closure _14 = { code : "function pnpm_threadsTs6(){const{worklet,args,makeShareableCloneOnUIRecursive}=this.__closure;const result=worklet(...args);return makeShareableCloneOnUIRecursive(result);}" } ;
let closure _15 = { code : "function runOnUIImmediately_Pnpm_threadsTs7(worklet){const{__DEV__,SHOULD_BE_USE_WEB,isWorkletFunction,ReanimatedModule,makeShareableCloneRecursive}=this.__closure;if(__DEV__&&!SHOULD_BE_USE_WEB&&_WORKLET){throw new ReanimatedError('`runOnUIImmediately` cannot be called on the UI runtime. Please call the function synchronously or use `queueMicrotask` or `requestAnimationFrame` instead.');}if(__DEV__&&!SHOULD_BE_USE_WEB&&!isWorkletFunction(worklet)){throw new ReanimatedError('`runOnUIImmediately` can only be used with worklets.');}return function(...args){ReanimatedModule.scheduleOnUI(makeShareableCloneRecursive(function(){'worklet';worklet(...args);}));};}" } ;
let closure _16 = { code : "function pnpm_threadsTs8(){const{worklet,args}=this.__closure;worklet(...args);}" } ;
const tmp3 = ( ) => {
function setupMicrotasks ( ) {
let closure _0 = [ ] ;
let closure _1 = false ;
closure _0 . queueMicrotask = ( arg0 ) => {
} ;
closure _0 . _ _callMicrotasks = ( ) => {
let length ;
let sum ;
if ( ! closure _1 ) {
closure _1 = true ;
let num2 = 0 ;
if ( 0 < arr . length ) {
do {
let tmp2 = closure _0 ;
let tmp3 = num2 ;
let tmp4 = closure _0 [ num2 ] ( ) ;
sum = num2 + 1 ;
num2 = sum ;
let tmp6 = closure _0 ;
length = closure _0 . length ;
} while ( sum < length ) ;
}
const arr = [ ] ;
const result = arr . _maybeFlushUIUpdatesQueue ( ) ;
closure _1 = false ;
}
} ;
}
setupMicrotasks . _ _closure = { } ;
setupMicrotasks . _ _workletHash = 2487728156345 ;
setupMicrotasks . _ _initData = closure _8 ;
return setupMicrotasks ;
} ( ) ;
function runOnJS ( _ _remoteFunction ) {
let global = _ _remoteFunction ;
if ( ! shouldBeUseWebResult ) {
if ( globalThis . _WORKLET ) {
if ( obj . isWorkletFunction ( _ _remoteFunction ) ) {
return ( ) => {
const length = arguments . length ;
const array = new Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
array [ num ] = arguments [ num ] ;
}
const items = [ _ _remoteFunction ] ;
return callback ( closure _18 ) . apply ( undefined , items . concat ( array ) ) ;
} ;
} else {
let tmp4 = _ _remoteFunction ;
if ( _ _remoteFunction . _ _remoteFunction ) {
_ _remoteFunction = _ _remoteFunction . _ _remoteFunction ;
global = _ _remoteFunction ;
tmp4 = _ _remoteFunction ;
}
if ( "function" === typeof tmp4 ) {
let _scheduleRemoteFunctionOnJS = global . _scheduleHostFunctionOnJS ;
} else {
_scheduleRemoteFunctionOnJS = global . _scheduleRemoteFunctionOnJS ;
}
const arg1 = _scheduleRemoteFunctionOnJS ;
return ( ) => {
const length = arguments . length ;
const arr = new Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
arr [ num ] = arguments [ num ] ;
}
let shareableCloneOnUIRecursive ;
if ( arr . length > 0 ) {
shareableCloneOnUIRecursive = _scheduleRemoteFunctionOnJS ( closure _2 [ 4 ] ) . makeShareableCloneOnUIRecursive ( arr ) ;
const obj = _scheduleRemoteFunctionOnJS ( closure _2 [ 4 ] ) ;
}
_scheduleRemoteFunctionOnJS ( _ _remoteFunction , shareableCloneOnUIRecursive ) ;
} ;
}
const obj = arg1 ( dependencyMap [ 5 ] ) ;
}
}
return ( ) => {
const length = arguments . length ;
const arr = new Array ( length ) ;
const _ _remoteFunction = arr ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
arr [ num ] = arguments [ num ] ;
}
return queueMicrotask ( arr . length ? ( ) => arr . apply ( undefined , arr ) : _ _remoteFunction ) ;
} ;
}
obj = { SHOULD _BE _USE _WEB : shouldBeUseWebResult } ;
const tmp4 = ( ) => {
function runOnUI ( fn ) {
return ( ) => {
const length = arguments . length ;
const array = new Array ( length ) ;
const arg0 = array ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
array [ num ] = arguments [ num ] ;
}
if ( closure _5 ) {
const ReanimatedModule = callback ( closure _2 [ 3 ] ) . ReanimatedModule ;
let obj = callback ( closure _2 [ 4 ] ) ;
/* worklet (recovered source) */ function pnpm _threadsTs4 ( ) { const { worklet , args } = this . _ _closure ; worklet ( ... args ) ; }
obj = { worklet : arg0 , args : array } ;
pnpm _threadsTs4 . _ _closure = obj ;
pnpm _threadsTs4 . _ _workletHash = 10268384484340 ;
pnpm _threadsTs4 . _ _initData = closure _12 ;
ReanimatedModule . scheduleOnUI ( obj . makeShareableCloneRecursive ( pnpm _threadsTs4 ) ) ;
} else {
const items = [ arg0 , array ] ;
const arr = arr . push ( items ) ;
if ( 1 === arr . length ) {
const _queueMicrotask = queueMicrotask ;
queueMicrotask ( ( ) => {
let closure _0 = closure _7 ;
closure _7 = [ ] ;
const ReanimatedModule = callback ( closure _2 [ 3 ] ) . ReanimatedModule ;
let obj = callback ( closure _2 [ 4 ] ) ;
/* worklet (recovered source) */ function pnpm _threadsTs5 ( ) { const { queue , callMicrotasks } = this . _ _closure ; queue . forEach ( function ( [ worklet , args ] ) { worklet ( ... args ) ; } ) ; callMicrotasks ( ) ; }
obj = { queue : closure _7 , callMicrotasks : closure _10 } ;
pnpm _threadsTs5 . _ _closure = obj ;
pnpm _threadsTs5 . _ _workletHash = 2773761092576 ;
pnpm _threadsTs5 . _ _initData = closure _13 ;
ReanimatedModule . scheduleOnUI ( obj . makeShareableCloneRecursive ( pnpm _threadsTs5 ) ) ;
} ) ;
}
}
} ;
}
runOnUI . _ _closure = { _ _DEV _ _ : false , SHOULD _BE _USE _WEB : shouldBeUseWebResult , isWorkletFunction : arg1 ( dependencyMap [ 5 ] ) . isWorkletFunction , IS _JEST : closure _5 , ReanimatedModule : arg1 ( dependencyMap [ 3 ] ) . ReanimatedModule , makeShareableCloneRecursive : arg1 ( dependencyMap [ 4 ] ) . makeShareableCloneRecursive , callMicrotasks : fn } ;
runOnUI . _ _workletHash = 8710271011487 ;
runOnUI . _ _initData = closure _11 ;
return runOnUI ;
} ( ) ;
obj . isWorkletFunction = arg1 ( dependencyMap [ 5 ] ) . isWorkletFunction ;
obj . runWorkletOnJS = runWorkletOnJS ;
obj . makeShareableCloneOnUIRecursive = arg1 ( dependencyMap [ 4 ] ) . makeShareableCloneOnUIRecursive ;
runOnJS . _ _closure = obj ;
runOnJS . _ _workletHash = 4576792393858 ;
runOnJS . _ _initData = { code : "function runOnJS_Pnpm_threadsTs9(fun){const runOnJS_Pnpm_threadsTs9=this._recur;const{SHOULD_BE_USE_WEB,isWorkletFunction,runWorkletOnJS,makeShareableCloneOnUIRecursive}=this.__closure;if(SHOULD_BE_USE_WEB||!_WORKLET){return function(...args){return queueMicrotask(args.length?function(){return fun(...args);}:fun);};}if(isWorkletFunction(fun)){return function(...args){return runOnJS_Pnpm_threadsTs9(runWorkletOnJS)(fun,...args);};}if(fun.__remoteFunction){fun=fun.__remoteFunction;}const scheduleOnJS=typeof fun==='function'?global._scheduleHostFunctionOnJS:global._scheduleRemoteFunctionOnJS;return function(...args){scheduleOnJS(fun,args.length>0?makeShareableCloneOnUIRecursive(args):undefined);};}" } ;
export const setupMicrotasks = tmp3 ;
export const callMicrotasks = fn ;
export const runOnUI = tmp4 ;
export function executeOnUIRuntimeSync ( arg0 ) {
const global = arg0 ;
return ( ) => {
const length = arguments . length ;
const array = new Array ( length ) ;
const arg0 = array ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
array [ num ] = arguments [ num ] ;
}
const ReanimatedModule = callback ( closure _2 [ 3 ] ) . ReanimatedModule ;
let obj = callback ( closure _2 [ 4 ] ) ;
/* worklet (recovered source) */ function pnpm _threadsTs6 ( ) { const { worklet , args , makeShareableCloneOnUIRecursive } = this . _ _closure ; const result = worklet ( ... args ) ; return makeShareableCloneOnUIRecursive ( result ) ; }
obj = { worklet : arg0 , args : array , makeShareableCloneOnUIRecursive : callback ( closure _2 [ 4 ] ) . makeShareableCloneOnUIRecursive } ;
pnpm _threadsTs6 . _ _closure = obj ;
pnpm _threadsTs6 . _ _workletHash = 6038069575410 ;
pnpm _threadsTs6 . _ _initData = closure _14 ;
return ReanimatedModule . executeOnUIRuntimeSync ( obj . makeShareableCloneRecursive ( pnpm _threadsTs6 ) ) ;
} ;
}
export const runOnUIImmediately = ( ) => {
function runOnUIImmediately ( pnpm _FrameCallbackRegistryUITs1 ) {
return ( ) => {
const length = arguments . length ;
const array = new Array ( length ) ;
const arg0 = array ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
array [ num ] = arguments [ num ] ;
}
const ReanimatedModule = callback ( closure _2 [ 3 ] ) . ReanimatedModule ;
let obj = callback ( closure _2 [ 4 ] ) ;
/* worklet (recovered source) */ function pnpm _threadsTs8 ( ) { const { worklet , args } = this . _ _closure ; worklet ( ... args ) ; }
obj = { worklet : arg0 , args : array } ;
pnpm _threadsTs8 . _ _closure = obj ;
pnpm _threadsTs8 . _ _workletHash = 6969436050040 ;
pnpm _threadsTs8 . _ _initData = closure _16 ;
ReanimatedModule . scheduleOnUI ( obj . makeShareableCloneRecursive ( pnpm _threadsTs8 ) ) ;
} ;
}
runOnUIImmediately . _ _closure = { _ _DEV _ _ : false , SHOULD _BE _USE _WEB : shouldBeUseWebResult , isWorkletFunction : arg1 ( dependencyMap [ 5 ] ) . isWorkletFunction , ReanimatedModule : arg1 ( dependencyMap [ 3 ] ) . ReanimatedModule , makeShareableCloneRecursive : arg1 ( dependencyMap [ 4 ] ) . makeShareableCloneRecursive } ;
runOnUIImmediately . _ _workletHash = 3385146413149 ;
runOnUIImmediately . _ _initData = closure _15 ;
return runOnUIImmediately ;
} ( ) ;
export { runOnJS } ;