{"version":3,"file":"OSSpecificElement.ChQTPQXG.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/y70M6tuPyI5nhbPqIjmW/4vRTv5tTAXoeDBIw2gFA/OSSpecificElement.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{cloneElement,useState,useEffect,useRef}from\"react\";//import { isDesktop, isIOS, isAndroid } from \"react-device-detect\"\nfunction getPlatform(){if(!window)return\"other\";const ua=navigator.userAgent||navigator.vendor||window.opera;if(/android/i.test(ua)){return\"android\";}if(/iPad|iPhone|iPod/.test(ua)&&!window.MSStream){return\"ios\";}if(/Macintosh|Mac OS X/.test(ua)){return\"mac\";}if(/Windows NT/.test(ua)){return\"windows\";}return\"other\";}export default function OSSpecificElement(props){const{os,element}=props;const[visible,setVisible]=useState(false);const mainRef=useRef();const platform=getPlatform();const isDesktop=platform===\"windows\"||platform===\"mac\"||platform===\"other\";const isIOS=platform===\"ios\";const isAndroid=platform===\"android\";const getVisible=()=>{switch(os){case\"ios\":return isIOS||isDesktop;case\"android\":return isAndroid||isDesktop;case\"desktop\":return isDesktop;case\"only_ios\":return isIOS;case\"only_android\":return isAndroid;default:return false;}};useEffect(()=>{if(!mainRef.current)return;const parent=mainRef.current.parentElement;if(!parent)return;parent.style.display=visible?\"flex\":\"none\";},[visible]);useEffect(()=>{setVisible(getVisible());},[]);return /*#__PURE__*/_jsx(motion.div,{ref:mainRef,style:{display:visible?\"flex\":\"none\"},children:element&&element[0]&&/*#__PURE__*/cloneElement(element[0])});}addPropertyControls(OSSpecificElement,{os:{type:ControlType.Enum,options:[\"ios\",\"android\",\"desktop\",\"only_ios\",\"only_android\"],optionTitles:[\"IOS\",\"Android\",\"Desktop\",\"Only IOS\",\"Only Android\"],defaultValue:\"desktop\"},element:{type:ControlType.Slot,maxCount:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"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