{"version":3,"file":"FacebookWeb2App.D1YG8jWi.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/vUJdKaIYoulUAuJa6CKS/X2iZ6dRcqWPRXuYVgL5g/FacebookWeb2App.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{ControlType}from\"framer\";import*as React from\"react\";export function FullPageRedirectWeb2App({appLink=\"https://apps.apple.com/us/developer/tappz/id1667518573\"}){const[redirectUrl,setRedirectUrl]=React.useState(\"\");React.useEffect(()=>{// Parse URL parameters from the current page\nconst urlParams=new URLSearchParams(window.location.search);// Tracker token (p0), defaulting to \"\" if not provided\nconst trackerToken=urlParams.get(\"p0\")||\"\";// Facebook data via URL parameters (p1 to p6)\nconst campaignName=urlParams.get(\"p1\")||\"\";const campaignId=urlParams.get(\"p2\")||\"\";const adsetName=urlParams.get(\"p3\")||\"\";const adsetId=urlParams.get(\"p4\")||\"\";const adName=urlParams.get(\"p5\")||\"\";const adId=urlParams.get(\"p6\")||\"\";// Automatically appended FB parameters\nconst fbclid=urlParams.get(\"fbclid\");const fbpid=urlParams.get(\"fbpid\");// Helper function to URL-encode values\nconst encodeParam=value=>encodeURIComponent(value);// Build the parameters in the format \"Name (ID)\"\nconst campaignParam=encodeParam(`${campaignName} (${campaignId})`);const adgroupParam=encodeParam(`${adsetName} (${adsetId})`);const creativeParam=encodeParam(`${adName} (${adId})`);// Construct the Adjust tracker URL\nconst baseAdjustUrl=`https://app.adjust.com/${trackerToken}`;let adjustUrl=`${baseAdjustUrl}?campaign=${campaignParam}&adgroup=${adgroupParam}&creative=${creativeParam}`;// Append fbclid and fbpid if they exist\nif(fbclid){adjustUrl+=`&fbclid=${encodeParam(fbclid)}`;}if(fbpid){adjustUrl+=`&fbpid=${encodeParam(fbpid)}`;}// If no p1-p6 or Facebook parameters are provided, use the backup link\nconst hasParams=campaignName||campaignId||adsetName||adsetId||adName||adId||fbclid||fbpid;if(!hasParams){adjustUrl=appLink// Replace with your actual backup URL\n;}// Store the URL for use when tapped\nsetRedirectUrl(adjustUrl);},[appLink]);// Trigger the redirect when the overlay is tapped\nconst handleRedirect=()=>{if(redirectUrl){window.location.href=redirectUrl;}};return /*#__PURE__*/_jsx(\"div\",{onClick:handleRedirect,style:{position:\"fixed\",top:0,left:0,width:\"100%\",height:\"100%\",cursor:\"pointer\"}});}// Default props for the component\nFullPageRedirectWeb2App.defaultProps={backupLink:\"https://apps.apple.com/us/developer/tappz/id1667518573\"};// Framer Property Controls to set the backupLink in the UI\nFullPageRedirectWeb2App.propertyControls={backupLink:{type:ControlType.String,title:\"App URL\",defaultValue:\"https://apps.apple.com/us/developer/tappz/id1667518573\"}};\nexport const __FramerMetadata__ = {\"exports\":{\"FullPageRedirectWeb2App\":{\"type\":\"reactComponent\",\"name\":\"FullPageRedirectWeb2App\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FacebookWeb2App.map"],"mappings":"wLAAuG,SAAgB,EAAwB,CAAC,UAAQ,0DAA0D,CAAC,GAAK,CAAC,EAAY,GAAgBA,EAAe,GAAG,CAYzL,OAZ0L,MAAoB,CAC5R,IAAM,EAAU,IAAI,gBAAgB,EAAO,SAAS,OAAO,CACrD,EAAa,EAAU,IAAI,KAAK,EAAE,GAClC,EAAa,EAAU,IAAI,KAAK,EAAE,GAAS,EAAW,EAAU,IAAI,KAAK,EAAE,GAAS,EAAU,EAAU,IAAI,KAAK,EAAE,GAAS,EAAQ,EAAU,IAAI,KAAK,EAAE,GAAS,EAAO,EAAU,IAAI,KAAK,EAAE,GAAS,EAAK,EAAU,IAAI,KAAK,EAAE,GACjO,EAAO,EAAU,IAAI,SAAS,CAAO,EAAM,EAAU,IAAI,QAAQ,CACjE,EAAY,GAAO,mBAAmB,EAAM,CAC5C,EAAc,EAAY,GAAG,EAAa,IAAI,EAAW,GAAG,CAAO,EAAa,EAAY,GAAG,EAAU,IAAI,EAAQ,GAAG,CAAO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