{"version":3,"file":"BlogLinks.B_We44Bm.mjs","names":["useRef","useCallback","__esmMin","init_ssg_sandbox_shims","init_npm_react_18_3_1","window","ce","init_jsx_runtime","ne","J","de","cityBlogHref","match","withCityBlogLink","ref","setRef","el","forwardedRef","href","Component","props","init_BlogLinks"],"sources":["https:/framerusercontent.com/modules/3Ctz9bwipsBZql9UytZH/ZLz0hbM9Tfj8V6ptq8xP/BlogLinks.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback,useEffect,useRef}from\"react\";// withCityBlogLink → a link to /blog on a city page (/internships/<city-slug>). Points it at the\n// blog filtered to that city: /blog?destination=<city-slug>. The blog's Destination filter reads\n// that query parameter. The plain /blog link stays as the fallback before JavaScript runs.\nfunction cityBlogHref(){const match=window.location.pathname.match(/\\/internships\\/([^/?#]+)/);return match?`/blog?destination=${encodeURIComponent(match[1])}`:null;}export function withCityBlogLink(Component){return /*#__PURE__*/forwardRef((props,forwardedRef)=>{const ref=useRef(null);const setRef=useCallback(el=>{ref.current=el;if(typeof forwardedRef===\"function\")forwardedRef(el);else if(forwardedRef)forwardedRef.current=el;},[forwardedRef]);useEffect(()=>{const href=cityBlogHref();const el=ref.current;if(!href||!el)return;const anchor=el.tagName===\"A\"?el:el.querySelector(\"a\")??el.closest(\"a\");anchor?.setAttribute(\"href\",href);},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:setRef,onClick:e=>{props.onClick?.(e);const href=cityBlogHref();if(!href||e.metaKey||e.ctrlKey||e.shiftKey)return;e.preventDefault();window.location.href=href;},style:{...props.style,cursor:\"pointer\"}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withCityBlogLink\":{\"type\":\"reactHoc\",\"name\":\"withCityBlogLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BlogLinks.map"],"mappings":"A,qJAGA,SAASW,GAAc,CAAC,IAAMC,EAAMP,EAAO,SAAS,SAAS,MAAM,0BAA0B,EAAE,OAAOO,EAAM,qBAAqB,mBAAmBA,EAAM,EAAE,IAAI,IAAK,CAAC,SAAgBC,EAAiB,EAAU,CAAC,MAAoB,iBAAY,EAAM,IAAe,CAAC,IAAMC,EAAId,EAAO,IAAI,EAAQe,EAAOd,EAAY,GAAI,CAAC,EAAI,QAAQe,EAAM,OAAOC,GAAe,WAAWA,EAAaD,CAAE,EAAUC,IAAa,EAAa,QAAQD,EAAG,EAAE,CAACC,CAAY,CAAC,EAAqM,OAAnMX,MAAc,CAAC,IAAMY,EAAKP,EAAa,EAAQK,EAAGF,EAAI,QAAYI,GAAOF,IAAuBA,EAAG,UAAU,IAAIA,EAAGA,EAAG,cAAc,GAAG,GAAGA,EAAG,QAAQ,GAAG,EAAA,EAAU,aAAa,OAAOE,CAAI,CAAE,EAAE,CAAC,CAAC,EAAsB,gBAAKC,EAAU,CAAC,GAAGC,EAAM,IAAIL,EAAO,QAAQ,GAAG,CAACK,EAAM,UAAU,CAAC,EAAE,IAAMF,EAAKP,EAAa,EAAK,CAACO,GAAM,EAAE,SAAS,EAAE,SAAS,EAAE,WAAgB,EAAE,eAAe,EAAE,EAAO,SAAS,KAAKA,EAAK,EAAE,MAAM,CAAC,GAAGE,EAAM,MAAM,OAAO,SAAS,CAAC,CAAC,CAAE,CAAC,CAAE,C"}