'use strict';
import { setMemoryCache, tryGetFromMemoryCache, removeFromMemoryCache, memoryCacheHasKey } from './fd-memory-cache.js';
import { getBooleanEnvSetting } from '../../infra/env-functions.js';
import { toolboxEnvSettingKeys } from '../../infra/toolbox-env-setting-keys.js';
import { setRemoteCache, tryGetFromRemoteCache, removeFromRemoteCache, remoteCacheHasKey } from './fd-remote-cache.js';

var __defProp=Object['defineProperty'],__name=(_0x2164fb,_0x997a91)=>__defProp(_0x2164fb,'name',{'value':_0x997a91,'configurable':!![]});async function setCoreCache(_0xd2d637,_0xd75ce3,_0x51914c,_0x5b715f){const _0x34f842=getKeyWithUserId(_0xd2d637,_0x5b715f);getBooleanEnvSetting(toolboxEnvSettingKeys['useRemoteCache'])?await setRemoteCache(_0x34f842,_0xd75ce3,_0x51914c):setMemoryCache(_0x34f842,_0xd75ce3,_0x51914c);}__name(setCoreCache,'setCoreCache');async function tryGetObjectFromCoreCache(_0x2671aa){if(getBooleanEnvSetting(toolboxEnvSettingKeys['useRemoteCache']))return tryGetFromRemoteCache(_0x2671aa);return tryGetFromMemoryCache(_0x2671aa);}__name(tryGetObjectFromCoreCache,'tryGetObjectFromCoreCache');async function tryGetFromCoreCache(_0x1d027c,_0x5480d3){const _0x414dad=getKeyWithUserId(_0x1d027c,_0x5480d3);if(getBooleanEnvSetting(toolboxEnvSettingKeys['useRemoteCache']))return tryGetFromRemoteCache(_0x414dad);return tryGetFromMemoryCache(_0x414dad);}__name(tryGetFromCoreCache,'tryGetFromCoreCache');async function tryGetFromCoreCacheWithId(_0x5edf74,_0x535212){const _0x4a6279=getKeyWithUserId(_0x5edf74,_0x535212);if(getBooleanEnvSetting(toolboxEnvSettingKeys['useRemoteCache']))return tryGetFromRemoteCache(_0x4a6279);return tryGetFromMemoryCache(_0x4a6279);}__name(tryGetFromCoreCacheWithId,'tryGetFromCoreCacheWithId');async function removeFromCoreCache(_0x12fbc4,_0x1f1435){const _0x2a3112=getKeyWithUserId(_0x12fbc4,_0x1f1435);getBooleanEnvSetting(toolboxEnvSettingKeys['useRemoteCache'])?await removeFromRemoteCache(_0x2a3112):removeFromMemoryCache(_0x2a3112);}__name(removeFromCoreCache,'removeFromCoreCache');async function coreCacheHasKey(_0x110748){if(getBooleanEnvSetting(toolboxEnvSettingKeys['useRemoteCache']))return remoteCacheHasKey(_0x110748);return memoryCacheHasKey(_0x110748);}__name(coreCacheHasKey,'coreCacheHasKey');function getKeyWithUserId(_0x1c8412,_0x4cc07d){return _0x4cc07d?_0x1c8412+'_'+_0x4cc07d:_0x1c8412;}__name(getKeyWithUserId,'getKeyWithUserId');

export { coreCacheHasKey, removeFromCoreCache, setCoreCache, tryGetFromCoreCache, tryGetFromCoreCacheWithId, tryGetObjectFromCoreCache };
