{"version":3,"file":"AppStoreDetector.BPytJ7j4.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/g0bfJ7WS187NroE7IUd8/QqvGj6k4JNQSNuWrwyS1/AppStoreDetector.js"],"sourcesContent":["// Custom download button that detects user's device and redirects to appropriate app store\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Smart Download Button\n *\n * @framerIntrinsicWidth 280\n * @framerIntrinsicHeight 56\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function SmartDownloadButton(props){const{appStoreUrl,playStoreUrl,buttonText,fallbackText,showBothOnDesktop,backgroundColor,textColor,hoverColor,borderRadius,buttonFont}=props;const[deviceType,setDeviceType]=useState(\"desktop\");useEffect(()=>{if(typeof window!==\"undefined\"){const userAgent=window.navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(userAgent)){startTransition(()=>setDeviceType(\"ios\"));}else if(/android/.test(userAgent)){startTransition(()=>setDeviceType(\"android\"));}else{startTransition(()=>setDeviceType(\"desktop\"));}}},[]);const handleDownload=url=>{if(typeof window!==\"undefined\"){window.open(url,\"_blank\");}};const buttonBaseStyle={display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:8,padding:\"12px 20px\",backgroundColor,color:textColor,border:\"none\",borderRadius,cursor:\"pointer\",transition:\"all 0.2s ease\",textDecoration:\"none\",...buttonFont,minHeight:44};const AppleIcon=()=>/*#__PURE__*/_jsx(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 24 24\",fill:\"currentColor\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z\"})});const GooglePlayIcon=()=>/*#__PURE__*/_jsx(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 24 24\",fill:\"currentColor\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M3,20.5V3.5C3,2.91 3.34,2.39 3.84,2.15L13.69,12L3.84,21.85C3.34,21.6 3,21.09 3,20.5M16.81,15.12L6.05,21.34L14.54,12.85L16.81,15.12M20.16,10.81C20.5,11.08 20.75,11.5 20.75,12C20.75,12.5 20.53,12.9 20.18,13.18L17.89,14.5L15.39,12L17.89,9.5L20.16,10.81M6.05,2.66L16.81,8.88L14.54,11.15L6.05,2.66Z\"})});if(deviceType===\"ios\"){return /*#__PURE__*/_jsxs(\"button\",{style:{...buttonBaseStyle,...props.style},onClick:()=>handleDownload(appStoreUrl),onMouseEnter:e=>{e.currentTarget.style.transform=\"translateY(-1px)\";e.currentTarget.style.boxShadow=\"0 4px 12px rgba(0,0,0,0.15)\";e.currentTarget.style.backgroundColor=hoverColor;},onMouseLeave:e=>{e.currentTarget.style.transform=\"translateY(0)\";e.currentTarget.style.boxShadow=\"none\";e.currentTarget.style.backgroundColor=backgroundColor;},children:[/*#__PURE__*/_jsx(AppleIcon,{}),buttonText]});}if(deviceType===\"android\"){return /*#__PURE__*/_jsxs(\"button\",{style:{...buttonBaseStyle,...props.style},onClick:()=>handleDownload(playStoreUrl),onMouseEnter:e=>{e.currentTarget.style.transform=\"translateY(-1px)\";e.currentTarget.style.boxShadow=\"0 4px 12px rgba(0,0,0,0.15)\";e.currentTarget.style.backgroundColor=hoverColor;},onMouseLeave:e=>{e.currentTarget.style.transform=\"translateY(0)\";e.currentTarget.style.boxShadow=\"none\";e.currentTarget.style.backgroundColor=backgroundColor;},children:[/*#__PURE__*/_jsx(GooglePlayIcon,{}),buttonText]});}// Desktop view\nif(showBothOnDesktop){return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",gap:12,width:\"100%\",...props.style},children:[/*#__PURE__*/_jsxs(\"button\",{style:{...buttonBaseStyle,flex:1},onClick:()=>handleDownload(appStoreUrl),onMouseEnter:e=>{e.currentTarget.style.transform=\"translateY(-1px)\";e.currentTarget.style.boxShadow=\"0 4px 12px rgba(0,0,0,0.15)\";e.currentTarget.style.backgroundColor=hoverColor;},onMouseLeave:e=>{e.currentTarget.style.transform=\"translateY(0)\";e.currentTarget.style.boxShadow=\"none\";e.currentTarget.style.backgroundColor=backgroundColor;},children:[/*#__PURE__*/_jsx(AppleIcon,{}),\"App Store\"]}),/*#__PURE__*/_jsxs(\"button\",{style:{...buttonBaseStyle,flex:1},onClick:()=>handleDownload(playStoreUrl),onMouseEnter:e=>{e.currentTarget.style.transform=\"translateY(-1px)\";e.currentTarget.style.boxShadow=\"0 4px 12px rgba(0,0,0,0.15)\";e.currentTarget.style.backgroundColor=hoverColor;},onMouseLeave:e=>{e.currentTarget.style.transform=\"translateY(0)\";e.currentTarget.style.boxShadow=\"none\";e.currentTarget.style.backgroundColor=backgroundColor;},children:[/*#__PURE__*/_jsx(GooglePlayIcon,{}),\"Google Play\"]})]});}return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:\"12px 20px\",backgroundColor,color:textColor,borderRadius,...buttonFont,...props.style},children:fallbackText});}addPropertyControls(SmartDownloadButton,{appStoreUrl:{type:ControlType.String,title:\"App Store URL\",defaultValue:\"https://apps.apple.com/app/your-app\",placeholder:\"https://apps.apple.com/app/your-app\"},playStoreUrl:{type:ControlType.String,title:\"Google Play URL\",defaultValue:\"https://play.google.com/store/apps/details?id=your.app\",placeholder:\"https://play.google.com/store/apps/details?id=your.app\"},buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Download App\"},fallbackText:{type:ControlType.String,title:\"Fallback Text\",defaultValue:\"Download our mobile app\"},showBothOnDesktop:{type:ControlType.Boolean,title:\"Show Both on Desktop\",defaultValue:true,enabledTitle:\"Both Buttons\",disabledTitle:\"Fallback Text\"},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#000000\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},hoverColor:{type:ControlType.Color,title:\"Hover Color\",defaultValue:\"#333333\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:32,unit:\"px\"},buttonFont:{type:ControlType.Font,title:\"Button Font\",defaultValue:{fontSize:\"16px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmartDownloadButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"280\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"56\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AppStoreDetector.map"],"mappings":"6MASG,SAAwB,EAAoB,EAAM,CAAC,GAAK,CAAC,cAAY,eAAa,aAAW,eAAa,oBAAkB,kBAAgB,YAAU,aAAW,eAAa,cAAY,EAAW,CAAC,EAAW,GAAeA,EAAS,UAAU,CAAC,MAAc,CAAC,GAAU,IAAS,OAAY,CAAC,IAAM,EAAU,EAAO,UAAU,UAAU,aAAa,CAAI,mBAAmB,KAAK,EAAU,CAAE,MAAoB,EAAc,MAAM,CAAC,CAAU,UAAU,KAAK,EAAU,CAAE,MAAoB,EAAc,UAAU,CAAC,CAAO,MAAo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