{"version":3,"file":"OSSpecificElement.DM4txeS8.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\":\"O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