{"version":3,"file":"RowPreviewHover.BcNXStrP.mjs","names":["React.useState","React.useRef","React.startTransition","EVENT","React.useRef"],"sources":["https:/framerusercontent.com/modules/wr4xDSGv6WBiaaYFOQqy/cumFGfmw844y4TjEzpb9/RowPreview.js","https:/framerusercontent.com/modules/dSAmETYkKkZ2Qwi6LBhU/UilE0BLXqVnGAjn1CRL3/RowPreviewHover.js"],"sourcesContent":["// Advisory: floating row preview.\n// Brief: when you hover an Engagement or Thinking row, its CMS Preview image floats\n// next to the cursor, follows it on a soft spring, tilts slightly with horizontal\n// speed (capped at ±4°), and crossfades when you move to another row.\n// Place ONE instance on each page that has rows (Home, /engagements, /thinking).\n// Rows talk to it through the \"withRowPreview\" override (RowPreviewHover.tsx).\n// Desktop pointer only. Respects reduced motion.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{createPortal}from\"react-dom\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,AnimatePresence,useMotionValue,useSpring,useVelocity,useTransform,useReducedMotion}from\"framer-motion\";const EVENT=\"advisory-row-preview\";const LEAVE_GRACE_MS=90;/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerDisableUnlink\n */export default function RowPreview(props){const{cardWidth,ratio,radius,maxTilt,offsetX,offsetY,shadow}=props;const isStatic=useIsStaticRenderer();const reduce=useReducedMotion();const width=Number(cardWidth)||280;const height=Math.round(width/(Number(ratio)||1.4));const[mounted,setMounted]=React.useState(false);const[enabled,setEnabled]=React.useState(false);const[src,setSrc]=React.useState(\"\");const[active,setActive]=React.useState(false);const leaveTimer=React.useRef(null);const x=useMotionValue(-9999);const y=useMotionValue(-9999);const springCfg=reduce?{stiffness:1e3,damping:100,mass:.2}:{stiffness:260,damping:30,mass:.6};const sx=useSpring(x,springCfg);const sy=useSpring(y,springCfg);const vx=useVelocity(x);const tiltRaw=useTransform(vx,[-1600,0,1600],reduce?[0,0,0]:[-maxTilt,0,maxTilt],{clamp:true});const tilt=useSpring(tiltRaw,{stiffness:180,damping:22});const fade=useSpring(0,{stiffness:300,damping:34});const pop=useSpring(.92,{stiffness:300,damping:30});React.useEffect(()=>{fade.set(active?1:0);pop.set(active?1:.92);if(reduce){fade.jump(active?1:0);pop.jump(1);}},[active,reduce,fade,pop]);React.useEffect(()=>{if(typeof window===\"undefined\")return;setMounted(true);const mq=window.matchMedia(\"(hover: hover) and (pointer: fine)\");const update=()=>React.startTransition(()=>setEnabled(mq.matches));update();mq.addEventListener?.(\"change\",update);return()=>mq.removeEventListener?.(\"change\",update);},[]);React.useEffect(()=>{if(typeof window===\"undefined\"||!enabled)return;const clearLeave=()=>{if(leaveTimer.current!==null){window.clearTimeout(leaveTimer.current);leaveTimer.current=null;}};const onMove=e=>{x.set(e.clientX+offsetX);y.set(e.clientY+offsetY);};const onPreview=e=>{const d=e.detail;if(!d)return;if(d.active&&d.src){clearLeave();React.startTransition(()=>{setSrc(d.src);setActive(true);});}else{clearLeave();leaveTimer.current=window.setTimeout(()=>{leaveTimer.current=null;React.startTransition(()=>setActive(false));},LEAVE_GRACE_MS);}};const onScroll=()=>{clearLeave();React.startTransition(()=>setActive(false));};window.addEventListener(\"pointermove\",onMove,{passive:true});window.addEventListener(EVENT,onPreview);window.addEventListener(\"scroll\",onScroll,{passive:true});return()=>{clearLeave();window.removeEventListener(\"pointermove\",onMove);window.removeEventListener(EVENT,onPreview);window.removeEventListener(\"scroll\",onScroll);};},[enabled,offsetX,offsetY,x,y]);// Canvas: a labelled placeholder so the layer is easy to find.\nif(isStatic){return /*#__PURE__*/_jsx(\"div\",{style:{...props.style,position:\"relative\",width,height,borderRadius:radius,border:\"1px dashed rgba(26,23,21,0.35)\",background:\"rgba(26,23,21,0.04)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",font:\"500 11px/1.3 'IBM Plex Mono', monospace\",letterSpacing:\"0.06em\",textTransform:\"uppercase\",color:\"rgba(26,23,21,0.55)\",textAlign:\"center\",padding:12,boxSizing:\"border-box\"},children:\"Row preview \\xb7 appears on row hover\"});}const floating=mounted&&enabled?/*#__PURE__*/_jsx(motion.div,{\"aria-hidden\":true,style:{position:\"fixed\",left:0,top:0,x:sx,y:sy,rotate:tilt,width,height,marginLeft:-width/2,marginTop:-height/2,pointerEvents:\"none\",zIndex:9999,opacity:fade,scale:pop},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",borderRadius:radius,overflow:\"hidden\",boxShadow:shadow?\"0 18px 40px -16px rgba(26,23,21,0.35)\":\"none\",background:\"rgba(26,23,21,0.06)\"},children:/*#__PURE__*/_jsx(AnimatePresence,{initial:false,children:src?/*#__PURE__*/_jsx(motion.img,{src:src,alt:\"\",draggable:false,initial:{opacity:0,scale:1.06},animate:{opacity:1,scale:1},exit:{opacity:0},transition:{duration:reduce?0:.4,ease:[.22,1,.36,1]},style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"}},src):null})})}):null;return /*#__PURE__*/_jsx(\"div\",{style:{...props.style,position:\"relative\",width:1,height:1,pointerEvents:\"none\"},children:floating&&typeof document!==\"undefined\"?/*#__PURE__*/createPortal(floating,document.body):null});}RowPreview.displayName=\"Row Preview\";addPropertyControls(RowPreview,{cardWidth:{type:ControlType.Number,title:\"Card width\",defaultValue:280,min:120,max:520,unit:\"px\",step:4},ratio:{type:ControlType.Number,title:\"Ratio\",defaultValue:1.4,min:.6,max:2.4,step:.05},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:2,min:0,max:24,unit:\"px\"},maxTilt:{type:ControlType.Number,title:\"Max tilt\",defaultValue:4,min:0,max:12,unit:\"\\xb0\",step:.5},offsetX:{type:ControlType.Number,title:\"Offset X\",defaultValue:48,min:-400,max:400,unit:\"px\"},offsetY:{type:ControlType.Number,title:\"Offset Y\",defaultValue:0,min:-400,max:400,unit:\"px\"},shadow:{type:ControlType.Boolean,title:\"Shadow\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RowPreview\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RowPreview.map","// Advisory: override for Engagement and Thinking rows.\n// Apply \"withRowPreview\" to the row component instance inside each CMS list.\n// On hover it reads the row's Preview image (the CMS-bound image property on the\n// instance, with a DOM fallback) and tells the Row Preview component on the page\n// to show it. On leave it hides it.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";const EVENT=\"advisory-row-preview\";function srcFromProps(props){if(!props)return\"\";for(const key of Object.keys(props)){const v=props[key];if(v&&typeof v===\"object\"&&typeof v.src===\"string\"&&v.src)return v.src;}return\"\";}function srcFromDom(el){if(!el)return\"\";const img=el.querySelector(\"img\");if(img){if(img.currentSrc)return img.currentSrc;if(img.src)return img.src;const set=img.getAttribute(\"srcset\");if(set)return set.split(\",\")[0].trim().split(\" \")[0];}if(typeof window!==\"undefined\"){const nodes=el.querySelectorAll(\"*\");for(const n of Array.from(nodes)){const bg=window.getComputedStyle(n).backgroundImage;const m=bg&&bg!==\"none\"?bg.match(/url\\([\"']?(.*?)[\"']?\\)/):null;if(m&&m[1])return m[1];}}return\"\";}function send(src,active){if(typeof window===\"undefined\")return;window.dispatchEvent(new CustomEvent(EVENT,{detail:{src,active}}));}export function withRowPreview(Component){return /*#__PURE__*/React.forwardRef(function RowPreviewHover(props,ref){const wrap=React.useRef(null);const propsRef=React.useRef(props);propsRef.current=props;React.useEffect(()=>{const el=wrap.current;if(!el)return;let inside=false;const onOver=()=>{if(inside)return;inside=true;send(srcFromProps(propsRef.current)||srcFromDom(el),true);};const onOut=e=>{const to=e.relatedTarget;if(to&&el.contains(to))return;inside=false;send(\"\",false);};el.addEventListener(\"pointerover\",onOver);el.addEventListener(\"pointerout\",onOut);return()=>{el.removeEventListener(\"pointerover\",onOver);el.removeEventListener(\"pointerout\",onOut);};},[]);return /*#__PURE__*/_jsx(\"div\",{ref:wrap,style:{display:\"contents\"},children:/*#__PURE__*/_jsx(Component,{...props,ref:ref})});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withRowPreview\":{\"type\":\"reactHoc\",\"name\":\"withRowPreview\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RowPreviewHover.map"],"mappings":"gUAWG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,YAAU,QAAM,SAAO,UAAQ,UAAQ,UAAQ,UAAQ,EAAY,EAAS,EAAoB,EAAQ,EAAO,EAAiB,EAAQ,EAAM,OAAO,CAAS,GAAG,IAAU,EAAO,KAAK,MAAM,GAAO,OAAO,CAAK,GAAG,IAAI,EAAO,CAAC,EAAQ,GAAYA,EAAe,EAAK,EAAO,CAAC,EAAQ,GAAYA,EAAe,EAAK,EAAO,CAAC,EAAI,GAAQA,EAAe,EAAE,EAAO,CAAC,EAAO,GAAWA,EAAe,EAAK,EAAQ,EAAWC,EAAa,IAAI,EAAQ,EAAE,EAAe,KAAK,EAAQ,EAAE,EAAe,KAAK,EAAQ,EAAU,EAAO,CAAC,UAAU,IAAI,QAAQ,IAAI,KAAK,EAAE,EAAE,CAAC,UAAU,IAAI,QAAQ,GAAG,KAAK,EAAE,EAAQ,EAAG,EAAU,EAAE,CAAS,EAAQ,EAAG,EAAU,EAAE,CAAS,EAA+H,EAAK,EAA5F,EAA7B,EAAY,CAA+B,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAO,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAQ,EAAE,CAAO,EAAE,CAAC,MAAM,EAAI,CAA8B,EAAE,CAAC,UAAU,IAAI,QAAQ,EAAE,CAAC,EAAQ,EAAK,EAAU,EAAE,CAAC,UAAU,IAAI,QAAQ,EAAE,C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