{"version":3,"file":"StoreTap.DMsk9ZIi.mjs","names":[],"sources":["https:/framerusercontent.com/modules/kOl1IkXp82nY2vfQ9gzp/VJaZOfVVwAXVZgRBfUp4/StoreTap.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";const APP_STORE=\"https://apps.apple.com/app/poteau/id1664764947\";const PLAY_STORE=\"https://play.google.com/store/apps/details?id=com.krank.club\";// App Store Connect provider token (App Analytics > Acquisition > Campaigns > \"Generate a\n// campaign link\", the pt= value). While empty, iOS links carry no campaign.\nconst APPLE_PROVIDER_TOKEN=\"117784615\";// Campaign name for downloads reports: which button, from which part of the site\n// (home, blog, venue pages, or anywhere else).\n// Play Console shows installs by utm_campaign; App Store Connect by ct (opted-in users only).\nfunction campaign(href){const button=/find-games/.test(href)?\"find-games\":\"download\";const seg=window.location.pathname.split(\"/\").filter(Boolean).find(x=>!/^(en|es|it)$/.test(x))||\"home\";const section=seg===\"blog\"?\"blog\":seg===\"home\"?\"home\":/^(center|venue-preview)$/.test(seg)?\"venue\":\"site\";return section+\"-\"+button;}// Tablets (iPad, including iPadOS's Mac user agent with touch; Android without\n// \"Mobile\") get the computer behaviour: the app exists on iPad only because the\n// App Store requires it, and we never push a tablet to install (Tim, 2026-10-02).\nfunction isTablet(ua){return/iPad/.test(ua)||/Macintosh/.test(ua)&&typeof navigator!==\"undefined\"&&navigator.maxTouchPoints>1||/Android/.test(ua)&&!/Mobile/.test(ua);}// The download card (QR code to scan with a phone), in the page's language.\nfunction downloadPage(){const m=typeof window!==\"undefined\"?/^\\/(en|es|it)(?=\\/|$)/.exec(window.location.pathname):null;return(m?\"/\"+m[1]:\"\")+\"/redirect\";}// On a phone, which store page to send the visitor to; on a tablet, the\n// download card; null on a computer (Branch handles it).\nfunction phoneStore(href){if(typeof navigator===\"undefined\")return null;const ua=navigator.userAgent||\"\";if(isTablet(ua))return downloadPage();const iOS=/iPhone|iPod/.test(ua);const c=campaign(href);if(iOS)return APPLE_PROVIDER_TOKEN?APP_STORE+\"?pt=\"+APPLE_PROVIDER_TOKEN+\"&ct=\"+c+\"&mt=8\":APP_STORE;if(/Android/.test(ua))return PLAY_STORE+\"&referrer=\"+encodeURIComponent(\"utm_source=poteau-app.com&utm_medium=website&utm_campaign=\"+c);return null;}// Store buttons: report a Google Ads conversion when the visitor has accepted\n// cookies (the consent banner only defines a working gtag after \"Ok, vas-y\").\n// Without consent, nothing is sent.\n//\n// On a phone, a Branch link (poteau.app.link) goes straight to the store page\n// instead. Branch opened the link in a new tab and redirected by script, and\n// iOS then opened the App Store on its home page rather than on Poteau.\n// A direct link followed from the tap itself lands on the product page.\n// Direct store links (the badges) and desktop visits are left as they are.\nexport function withStoreTap(Component){return props=>/*#__PURE__*/_jsx(Component,{...props,onTap:()=>{const w=typeof window!==\"undefined\"?window:null;if(w&&typeof w.gtag_report_conversion===\"function\")w.gtag_report_conversion();},onClick:e=>{if(props.onClick)props.onClick(e);const target=e&&e.target&&e.target.closest?e.target.closest(\"a[href]\"):null;const href=target?target.getAttribute(\"href\")||\"\":\"\";if(!/poteau\\.app\\.link/.test(href))return;const store=phoneStore(href);if(!store)return;e.preventDefault();window.location.href=store;}});}\nexport const __FramerMetadata__ = {\"exports\":{\"withStoreTap\":{\"type\":\"reactHoc\",\"name\":\"withStoreTap\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StoreTap.map"],"mappings":"yHAKA,SAAS,EAAS,EAAK,CAAC,IAAM,EAAO,aAAa,KAAK,CAAI,EAAE,aAAa,WAAiB,EAAI,EAAO,SAAS,SAAS,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,eAAe,KAAK,CAAC,CAAC,GAAG,OAAiH,OAA5F,IAAM,OAAO,OAAO,IAAM,OAAO,OAAO,2BAA2B,KAAK,CAAG,EAAE,QAAQ,QAAsB,IAAI,CAAO,CAGhU,SAAS,EAAS,EAAG,CA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