{"version":3,"file":"BASTicketLocale.MP6fCv_I.mjs","names":["useMemo","useRef","useCallback","__esmMin","pe","init_npm_react_18_3_1","ne","init_ssg_sandbox_shims","window","J","init_jsx_runtime","ce","de","init_framer_Cb9Z_4vX","useLocaleInfo","normalizeLocaleCode","normalized","code","resolveLocaleCodeFromFramer","activeLocale","buildTicketUrl","BASE_TICKET_URL","locale","isBelgiumAutoShowPath","segments","pathname","part","maybeLocale","useTicketLink","localeCode","scopeToBelgiumAutoShow","createBASTicketLocaleOverride","rootRef","ticketUrl","mergeRefs","node","ref","root","applyAnchorAttributes","anchors","nearestAncestor","anchor","SAME_TAB_TARGET","observer","Component","props","withBASTicketLocale","withBASTicketLocaleScoped","withBASTicketImageContain","init_BASTicketLocale"],"sources":["https:/framerusercontent.com/modules/xoKnCrcVhWH0T0RpdqvZ/2MfZ099H7Qv7mAfX3xML/BASTicketLocale.js"],"sourcesContent":["// User request: Create BASTicketLocale.tsx reusable HOC code override with withBASTicketLocale for existing native Framer Frame/RichText links. Use Framer native useLocaleInfo activeLocale, active locale code en/nl/fr with en fallback. URLs https://tickets.402online.com/tickets/belgiumautoshow2027/{en|nl|fr}. Preserve all props styling refs children animations onTap (menu close). Set native href/link destination and target blank rel noopener noreferrer; ensure click cannot follow old hardcoded link, handle anchor semantics and ctrl/meta normally, avoid double popup. No extra visible wrappers/new buttons. For shared countdown component also export withBASTicketLocaleScoped that ONLY changes links while current pathname corresponds to /belgium-auto-show (locale prefix optional); leaves Paris untouched otherwise. Prefer prop override native links plus DOM anchor update only if necessary, no global document click hacks. Existing nodes htmlTag button may be wrapped by Framer link; ensure actual anchor destination/newtab works. Do not change other files.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback,useEffect,useMemo,useRef}from\"react\";import{useLocaleInfo}from\"framer\";const BASE_TICKET_URL=\"https://tickets.402online.com/tickets/belgiumautoshow2027\";const SAME_TAB_TARGET=\"_self\";function normalizeLocaleCode(code){const normalized=code?.trim().toLowerCase().split(/[-_]/)[0];if(normalized===\"nl\"||normalized===\"fr\"||normalized===\"en\")return normalized;return\"en\";}function resolveLocaleCodeFromFramer(activeLocale){return normalizeLocaleCode(activeLocale?.code);}function buildTicketUrl(locale){return`${BASE_TICKET_URL}/${locale}`;}function isBelgiumAutoShowPath(pathname){const segments=pathname.split(\"/\").filter(Boolean).map(part=>part.toLowerCase());if(segments.length===0)return false;const maybeLocale=segments[0];const offset=maybeLocale===\"en\"||maybeLocale===\"nl\"||maybeLocale===\"fr\"?1:0;return segments[offset]===\"belgium-auto-show\";}function useTicketLink(scopeToBelgiumAutoShow){const{activeLocale}=useLocaleInfo();const localeCode=useMemo(()=>resolveLocaleCodeFromFramer(activeLocale),[activeLocale]);const allowedByPath=useMemo(()=>{if(!scopeToBelgiumAutoShow)return true;if(typeof window===\"undefined\")return false;return isBelgiumAutoShowPath(window.location.pathname);},[scopeToBelgiumAutoShow]);if(!allowedByPath)return null;return buildTicketUrl(localeCode);}function createBASTicketLocaleOverride(scopeToBelgiumAutoShow){return function withTicketLocale(Component){return /*#__PURE__*/forwardRef(function BASTicketLocaleOverride(props,ref){const rootRef=useRef(null);const ticketUrl=useTicketLink(scopeToBelgiumAutoShow);const mergeRefs=useCallback(node=>{rootRef.current=node;if(typeof ref===\"function\"){ref(node);}else if(ref&&typeof ref===\"object\"){ref.current=node;}},[ref]);useEffect(()=>{if(typeof document===\"undefined\")return;if(!ticketUrl)return;const root=rootRef.current;if(!root)return;const applyAnchorAttributes=()=>{const anchors=new Set;if(root instanceof HTMLAnchorElement)anchors.add(root);const nearestAncestor=root.closest(\"a[href]\");if(nearestAncestor instanceof HTMLAnchorElement){anchors.add(nearestAncestor);}Array.from(root.querySelectorAll(\"a[href]\")).forEach(anchor=>anchors.add(anchor));for(const anchor of anchors){if(anchor.href!==ticketUrl){anchor.href=ticketUrl;}if(anchor.target!==SAME_TAB_TARGET){anchor.target=SAME_TAB_TARGET;}if(anchor.rel){anchor.removeAttribute(\"rel\");}}};applyAnchorAttributes();if(typeof MutationObserver===\"undefined\")return;const observer=new MutationObserver(()=>{applyAnchorAttributes();});observer.observe(root,{subtree:true,childList:true,attributes:true,attributeFilter:[\"href\",\"target\",\"rel\"]});return()=>{observer.disconnect();};},[ticketUrl]);if(!ticketUrl){return /*#__PURE__*/_jsx(Component,{ref:mergeRefs,...props});}return(// Keep native interactions (e.g. onTap handlers) untouched while forcing destination.\n/*#__PURE__*/_jsx(Component,{ref:mergeRefs,...props,link:{...typeof props.link===\"object\"&&props.link?props.link:{},href:ticketUrl,openInNewTab:false,smoothScroll:false},href:ticketUrl,target:SAME_TAB_TARGET,rel:\"\"}));});};}export function withBASTicketLocale(Component){return createBASTicketLocaleOverride(false)(Component);}export function withBASTicketLocaleScoped(Component){return createBASTicketLocaleOverride(true)(Component);}export function withBASTicketImageContain(Component){return /*#__PURE__*/forwardRef(function BASTicketImageContainOverride(props,ref){return /*#__PURE__*/_jsx(Component,{...props,ref:ref,style:{...props.style??{},backgroundSize:\"contain\",backgroundRepeat:\"no-repeat\",backgroundPosition:\"center\"}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withBASTicketImageContain\":{\"type\":\"reactHoc\",\"name\":\"withBASTicketImageContain\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBASTicketLocale\":{\"type\":\"reactHoc\",\"name\":\"withBASTicketLocale\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBASTicketLocaleScoped\":{\"type\":\"reactHoc\",\"name\":\"withBASTicketLocaleScoped\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BASTicketLocale.map"],"mappings":"A,yMACgQ,SAASe,EAAoB,EAAK,CAAC,IAAMC,EAAWC,GAAM,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,MAAM,CAAC,CAAC,GAAgF,OAA1ED,IAAa,MAAMA,IAAa,MAAMA,IAAa,KAAYA,EAAiB,IAAK,CAAC,SAASE,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