'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

/** 判断是否是 PixUI
 * @example
 * ```ts
 * if (isPixUI()) {
 *   console.log('当前是 PixUI 环境');
 * }
 * ```
 */
function isPixUI() {
  return /PixUI/i.test(navigator.userAgent) && /_sdk_info=openplatform_/i.test(location.search);
}
/** 判断是否是模拟器
 * @example
 * ```ts
 * if (isSimulatorInPixui()) {
 *   console.log('当前是 PixUI 模拟器环境');
 * }
 * ```
 */
function isSimulatorInPixui() {
  return /PixUI/i.test(navigator.userAgent) && !/_sdk_info=openplatform_/i.test(location.search);
}
/** 判断是否是普通浏览器
 * @example
 * ```ts
 * if (isBrowserInPixui()) {
 *   localStorage.setItem('foo', 'bar');
 * }
 * ```
 */
function isBrowserInPixui() {
  return !/PixUI/i.test(navigator.userAgent);
}

exports.isBrowserInPixui = isBrowserInPixui;
exports.isPixUI = isPixUI;
exports.isSimulatorInPixui = isSimulatorInPixui;
