{"version":3,"file":"PageZoom.T-ME4tsk.mjs","names":[],"sources":["https:/framerusercontent.com/modules/yL9u60zhWgLim3iXybe4/25o9h1VAh6fxE80bUt6Q/PageZoom.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";// \"Go into the photo\" page transition. Framer runs page effects through the browser's\n// View Transitions API. When a visitor presses an image card, withZoomSource gives that\n// card's photo a shared transition name; the destination page's hero photo carries the\n// same name through withZoomTarget, so the browser morphs one into the other while the\n// rest of the page runs the site's normal page effect. Browsers without View\n// Transitions, modified clicks (new tab) and reduced-motion visitors get the normal\n// behavior.\nconst NAME=\"dn-zoom\";const STYLE_ID=\"dn-zoom-vt\";let named=null;let clearTimer=0;function supported(){return typeof document!==\"undefined\"&&typeof document.startViewTransition===\"function\";}function ensureStyle(){if(typeof document===\"undefined\"||document.getElementById(STYLE_ID))return;const el=document.createElement(\"style\");el.id=STYLE_ID;el.textContent=`\n::view-transition-group(${NAME}){animation-duration:.85s;animation-timing-function:cubic-bezier(.2,.9,.3,1)}\n::view-transition-old(${NAME}),::view-transition-new(${NAME}){width:100%;height:100%;object-fit:cover;overflow:clip;animation-duration:.85s;animation-timing-function:cubic-bezier(.2,.9,.3,1)}\n@media (prefers-reduced-motion: reduce){::view-transition-group(${NAME}),::view-transition-old(${NAME}),::view-transition-new(${NAME}){animation:none!important}}\n`;document.head.appendChild(el);}function clearNamed(){if(named){named.style.removeProperty(\"view-transition-name\");named=null;}}// Pages whose hero photo sits behind the text take no part in the morph: the photo\n// would be drawn over the whole page until the transition ends.\nfunction leadsToPlainPage(card){const anchor=card.closest(\"a\")||card.querySelector(\"a\");const href=anchor?anchor.getAttribute(\"href\")||\"\":\"\";return/(^|\\/)locations\\//.test(href);}function markPhoto(card){if(!card||!supported()||leadsToPlainPage(card))return;const wrapper=card.querySelector(\"[data-framer-background-image-wrapper]\");if(!wrapper)return;let photo=wrapper.parentElement;if(!photo||photo===card)photo=wrapper;ensureStyle();clearNamed();photo.style.setProperty(\"view-transition-name\",NAME);named=photo;window.clearTimeout(clearTimer);clearTimer=window.setTimeout(clearNamed,2500);}export function withZoomSource(Component){return /*#__PURE__*/React.forwardRef(function ZoomSource(props,ref){return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onPointerDown:event=>{if(props.onPointerDown)props.onPointerDown(event);if(event.button===0&&!event.metaKey&&!event.ctrlKey&&!event.shiftKey&&!event.altKey)markPhoto(event.currentTarget);},onKeyDown:event=>{if(props.onKeyDown)props.onKeyDown(event);if(event.key===\"Enter\")markPhoto(event.currentTarget);}});});}export function withZoomTarget(Component){return /*#__PURE__*/React.forwardRef(function ZoomTarget(props,ref){React.useEffect(()=>{if(supported())ensureStyle();},[]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:{...props.style,viewTransitionName:NAME}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withZoomSource\":{\"type\":\"reactHoc\",\"name\":\"withZoomSource\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withZoomTarget\":{\"type\":\"reactHoc\",\"name\":\"withZoomTarget\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PageZoom.map"],"mappings":"uIAOiF,SAAS,GAAW,CAAC,OAAO,OAAO,SAAW,KAAa,OAAO,SAAS,qBAAsB,UAAW,CAAC,SAAS,GAAa,CAAC,GAAG,OAAO,SAAW,KAAa,SAAS,eAAe,CAAQ,EAAE,OAAO,IAAM,EAAG,SAAS,cAAc,OAAO,EAAE,EAAG,GAAG,EAAS,EAAG,YAAY;0BAC7U,EAAK;wBACP,EAAK,0BAA0B,EAAK;kEACM,EAAK,0BAA0B,EAAK,0BAA0B,EAAK;EACnI,SAAS,KAAK,YAAY,CAAE,CAAE,CAAC,SAAS,GAAY,CAAC,AAA6D,KAAnD,EAAM,MAAM,eAAe,sBAAsB,EAAQ,KAAM,CAEhI,SAAS,EAAiB,EAAK,CAAC,IAAM,EAAO,EAA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