var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
import RNAsyncStorage from '@react-native-async-storage/async-storage';
/**
 * ParaStorageAdapter backed by React Native AsyncStorage.
 * Used by the core Zustand store for state persistence.
 */
export const asyncStorageAdapter = {
    getItem: (key) => __awaiter(void 0, void 0, void 0, function* () {
        try {
            return yield RNAsyncStorage.getItem(key);
        }
        catch (error) {
            console.warn('[Para] Error reading from AsyncStorage:', error);
            return null;
        }
    }),
    setItem: (key, value) => __awaiter(void 0, void 0, void 0, function* () {
        try {
            yield RNAsyncStorage.setItem(key, value);
        }
        catch (error) {
            console.warn(`[Para] Error writing to AsyncStorage (key: ${key}):`, error);
        }
    }),
    removeItem: (key) => __awaiter(void 0, void 0, void 0, function* () {
        try {
            yield RNAsyncStorage.removeItem(key);
        }
        catch (error) {
            console.warn(`[Para] Error removing from AsyncStorage (key: ${key}):`, error);
        }
    }),
};
