"use strict";

import { Platform } from 'react-native';
/**
 * Returns the provided styles only on web, undefined on native.
 */
export function web(styles) {
  if (Platform.OS === 'web') {
    return styles;
  }
  return undefined;
}

/**
 * Returns the provided styles only on native (iOS + Android), undefined on web.
 */
export function native(styles) {
  if (Platform.OS !== 'web') {
    return styles;
  }
  return undefined;
}

/**
 * Returns the provided styles only on iOS, undefined elsewhere.
 */
export function ios(styles) {
  if (Platform.OS === 'ios') {
    return styles;
  }
  return undefined;
}

/**
 * Returns the provided styles only on Android, undefined elsewhere.
 */
export function android(styles) {
  if (Platform.OS === 'android') {
    return styles;
  }
  return undefined;
}

/**
 * Returns platform-specific styles.
 */
export function platform(specifics) {
  if (Platform.OS === 'web') {
    return specifics.web;
  }
  if (Platform.OS === 'ios') {
    return specifics.ios ?? specifics.native;
  }
  if (Platform.OS === 'android') {
    return specifics.android ?? specifics.native;
  }
  return specifics.native;
}

/**
 * Select a value based on theme name.
 */
export function select(themeName, options) {
  return options[themeName] ?? options['light'] ?? Object.values(options)[0];
}
//# sourceMappingURL=platform.js.map