{"version":3,"file":"isIOS.mjs","names":[],"sources":["../../../src/utils/isIOS/isIOS.ts"],"sourcesContent":["import { isServer } from '../isServer/index.ts';\n\n/**\n * @description\n * `isIOS` is a utility function that detects whether the current device is running iOS or iPadOS.\n *\n * Notes on platform inconsistencies:\n * - Prior to iPadOS 13, iPads reported their platform as \"iPad\" (or matched /iPad/ in UA).\n * - Starting from iPadOS 13, Apple changed the platform string to \"MacIntel\"\n *   to make websites treat iPadOS as desktop-class Safari.\n *   However, these devices still expose multi-touch capabilities.\n *\n * @param {string} [userAgent] - Optional user agent string to check. Defaults to `navigator.userAgent`.\n *\n * @returns {boolean} `true` if the device is running iOS or iPadOS, `false` otherwise.\n * Returns `false` on server-side rendering environments.\n *\n * @example\n * if (isIOS()) {\n *   // iOS-specific code\n *   enableIOSOptimizations();\n * }\n *\n * @example\n * // With custom user agent\n * const isIOSDevice = isIOS('Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X)');\n */\nexport function isIOS(userAgent?: string): boolean {\n  if (isServer()) {\n    return false;\n  }\n\n  const ua = userAgent ?? navigator.userAgent;\n  const platform = navigator.platform;\n  const maxTouchPoints = navigator.maxTouchPoints;\n\n  const matchesClassicIOS = /iPhone|iPad|iPod/i.test(ua);\n  const matchesModernIPad = platform === 'MacIntel' && typeof maxTouchPoints === 'number' && maxTouchPoints > 1;\n\n  return matchesClassicIOS || matchesModernIPad;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,MAAM,WAA6B;CACjD,IAAI,SAAS,GACX,OAAO;CAGT,MAAM,KAAK,aAAa,UAAU;CAClC,MAAM,WAAW,UAAU;CAC3B,MAAM,iBAAiB,UAAU;CAKjC,OAH0B,oBAAoB,KAAK,EAG5B,KAFG,aAAa,cAAc,OAAO,mBAAmB,YAAY,iBAAiB;AAG9G"}