{"version":3,"file":"ProjectCarousel.vGurMD33.mjs","names":["useRef","useState","useCallback","React.useId"],"sources":["https:/framerusercontent.com/modules/frePmi1ZAfBXCk2SadJh/HDHXJm35avsQTdt15A2A/ProjectCarousel.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{useState,useEffect,useRef,useCallback}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/* dotted arrow, same dot unit as the client ticker's mark */function DottedArrow({flip,size=20}){const dots=[[1.3,12.7],[6.6,12.7],[12,12.7],[17.3,12.7],[22.6,12.7],[27.9,12.7],[33.2,12.7],[27.9,6.3],[22.6,1.3],[27.9,19.1],[22.6,24.1]];return /*#__PURE__*/_jsx(\"svg\",{width:size,height:Math.round(size*26/35),viewBox:\"0 0 35 26\",fill:\"none\",\"aria-hidden\":\"true\",style:{display:\"block\",transform:flip?\"scaleX(-1)\":undefined},children:dots.map(([cx,cy],i)=>/*#__PURE__*/_jsx(\"circle\",{cx:cx,cy:cy,r:1.33,fill:\"currentColor\"},i))});}const TRACK_ATTR=\"data-carousel-track\";/* ---------------- track override ----------------\n * Applied to the CMS Collection List. Slots cannot be wired from the canvas\n * DSL — a slot reference must be a direct child of the page node, which only\n * holds breakpoints — so the list stays a normal canvas layer and the\n * carousel behaviour is added here instead.\n */export function withCarouselTrack(Component){return function WithCarouselTrack(props){const ref=useRef(null);const isStatic=useIsStaticRenderer();useEffect(()=>{if(typeof window===\"undefined\")return;const el=ref.current;if(!el)return;el.setAttribute(TRACK_ATTR,\"\");const prev={overflowX:el.style.overflowX,scrollSnapType:el.style.scrollSnapType,flexWrap:el.style.flexWrap};el.style.overflowX=\"auto\";/* explicit: with overflow-x auto the browser computes overflow-y\n               to auto as well, making the track eat vertical wheel events and\n               blocking the page from scrolling over it */el.style.overflowY=\"hidden\";el.style.overscrollBehaviorX=\"contain\";el.style.touchAction=\"pan-y\";el.style.scrollSnapType=\"x mandatory\";el.style.flexWrap=\"nowrap\";el.style.scrollbarWidth=\"none\";Array.from(el.children).forEach(c=>{const k=c;k.style.scrollSnapAlign=\"start\";/* keep each slide at its canvas-set width — the home cards\n                   are 84% there, the blog cards 24.5% — instead of forcing\n                   every track to the home layout */k.style.flexShrink=\"0\";k.style.flexGrow=\"0\";});window.dispatchEvent(new Event(\"carousel-track-ready\"));return()=>{el.removeAttribute(TRACK_ATTR);el.style.overflowX=prev.overflowX;el.style.scrollSnapType=prev.scrollSnapType;el.style.flexWrap=prev.flexWrap;};},[isStatic]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref});};}/**\n * Carousel Nav — counter and prev/next for the tagged track.\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 130\n * @framerIntrinsicHeight 80\n */export default function CarouselNav(props){const{autoplay,interval,colors,fontMeta,arrowSize}=props;const isStatic=useIsStaticRenderer();const[index,setIndex]=useState(0);const[count,setCount]=useState(1);const track=useCallback(()=>typeof document===\"undefined\"?null:document.querySelector(\"[\"+TRACK_ATTR+\"]\"),[]);useEffect(()=>{if(isStatic)return;let el=null;const sync=()=>{el=track();if(!el)return;const kids=Array.from(el.children);setCount(Math.max(1,kids.length));let best=0;let bestD=Infinity;kids.forEach((k,i)=>{const d=Math.abs(k.offsetLeft-el.scrollLeft);if(d<bestD){bestD=d;best=i;}});setIndex(best);};sync();const t=window.setInterval(sync,400);window.addEventListener(\"scroll\",sync,{passive:true});window.addEventListener(\"carousel-track-ready\",sync);const onTrackScroll=()=>sync();const attach=window.setTimeout(()=>{const e=track();if(e)e.addEventListener(\"scroll\",onTrackScroll,{passive:true});},100);return()=>{window.clearInterval(t);window.clearTimeout(attach);window.removeEventListener(\"scroll\",sync);window.removeEventListener(\"carousel-track-ready\",sync);const e=track();if(e)e.removeEventListener(\"scroll\",onTrackScroll);};},[isStatic,track]);const go=useCallback((dir,wrap)=>{const el=track();if(!el)return;const kids=Array.from(el.children);if(!kids.length)return;let next=index+dir;if(wrap)next=(next+kids.length)%kids.length;next=Math.max(0,Math.min(kids.length-1,next));el.scrollTo({left:kids[next].offsetLeft,behavior:\"smooth\"});},[index,track]);/* autoplay, paused while the pointer rests on the track */useEffect(()=>{if(isStatic||!autoplay)return;const el=track();let paused=false;const enter=()=>paused=true;const leave=()=>paused=false;if(el){el.addEventListener(\"mouseenter\",enter);el.addEventListener(\"mouseleave\",leave);el.addEventListener(\"pointerdown\",enter);}const reduce=window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;if(reduce)return;const id=window.setInterval(()=>{if(!paused)go(1,true);},Math.max(1,interval)*1e3);return()=>{window.clearInterval(id);if(el){el.removeEventListener(\"mouseenter\",enter);el.removeEventListener(\"mouseleave\",leave);el.removeEventListener(\"pointerdown\",enter);}};},[isStatic,autoplay,interval,go,track]);const pad=n=>String(n).padStart(2,\"0\");const rawId=React.useId();const uid=\"cn\"+rawId.replace(/[^a-zA-Z0-9]/g,\"\");const ease=\"cubic-bezier(0.22, 0.61, 0.24, 1)\";/* same masked-arrow language as the CTA: the mark leaves through the edge\n       of its box while a second copy arrives from the other side */const css=`\n.${uid}-btn {\n    width: 52px; height: 52px;\n    display: inline-flex; align-items: center; justify-content: center;\n    border: none; border-radius: 8px; padding: 0; cursor: pointer;\n    background: ${colors.button};\n    color: ${colors.buttonInk};\n    transition: background-color 0.4s ${ease}, color 0.4s ${ease};\n}\n.${uid}-mask {\n    position: relative;\n    width: ${arrowSize}px; height: ${Math.round(arrowSize*26/35)}px;\n    overflow: hidden; display: block;\n}\n.${uid}-mask > span {\n    position: absolute; inset: 0; display: block;\n    transition: transform 0.45s ${ease};\n}\n.${uid}-next .in { transform: translateX(-140%); }\n.${uid}-prev .in { transform: translateX(140%); }\n@media (hover: hover) {\n    .${uid}-btn:hover {\n        background: ${colors.buttonInk};\n        color: ${colors.button};\n    }\n    .${uid}-next:hover .out { transform: translateX(140%); }\n    .${uid}-prev:hover .out { transform: translateX(-140%); }\n    .${uid}-btn:hover .in { transform: translateX(0); }\n}\n.${uid}-btn:disabled { opacity: 0.35; cursor: default; }\n@media (prefers-reduced-motion: reduce) {\n    .${uid}-btn, .${uid}-mask > span { transition: none !important; }\n}\n`;return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style,textAlign:\"right\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:{...fontMeta,color:colors.meta,marginBottom:16},children:[pad(index+1),\"/\",pad(count)]}),/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:css}}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",gap:8,justifyContent:\"flex-end\"},children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Previous project\",onClick:()=>go(-1,true),className:`${uid}-btn ${uid}-prev`,children:/*#__PURE__*/_jsxs(\"span\",{className:`${uid}-mask`,children:[/*#__PURE__*/_jsx(\"span\",{className:\"out\",children:/*#__PURE__*/_jsx(DottedArrow,{flip:true,size:arrowSize})}),/*#__PURE__*/_jsx(\"span\",{className:\"in\",children:/*#__PURE__*/_jsx(DottedArrow,{flip:true,size:arrowSize})})]})}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Next project\",onClick:()=>go(1,true),className:`${uid}-btn ${uid}-next`,children:/*#__PURE__*/_jsxs(\"span\",{className:`${uid}-mask`,children:[/*#__PURE__*/_jsx(\"span\",{className:\"out\",children:/*#__PURE__*/_jsx(DottedArrow,{size:arrowSize})}),/*#__PURE__*/_jsx(\"span\",{className:\"in\",children:/*#__PURE__*/_jsx(DottedArrow,{size:arrowSize})})]})})]})]});}CarouselNav.displayName=\"Carousel Nav\";addPropertyControls(CarouselNav,{autoplay:{type:ControlType.Boolean,title:\"Autoplay\",defaultValue:true},interval:{type:ControlType.Number,title:\"Interval\",defaultValue:6,min:2,max:20,step:1,unit:\"s\"},arrowSize:{type:ControlType.Number,title:\"Arrow Size\",defaultValue:20,min:12,max:36,step:1,unit:\"px\"},colors:{type:ControlType.Object,title:\"Colors\",icon:\"color\",controls:{meta:{type:ControlType.Color,title:\"Counter\",defaultValue:\"#595959\"},button:{type:ControlType.Color,title:\"Button\",defaultValue:\"#F5F5F5\"},buttonInk:{type:ControlType.Color,title:\"Mark\",defaultValue:\"#121212\"}},defaultValue:{meta:\"#595959\",button:\"#F5F5F5\",buttonInk:\"#121212\"}},fontMeta:{type:ControlType.Font,title:\"Counter Font\",controls:\"extended\",defaultFontType:\"monospace\",defaultValue:{fontSize:\"13px\",letterSpacing:\"0.04em\",lineHeight:\"1.2em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"withCarouselTrack\":{\"type\":\"reactHoc\",\"name\":\"withCarouselTrack\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"CarouselNav\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"130\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"80\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ProjectCarousel.map"],"mappings":"mOAAmR,SAAS,EAAY,CAAC,OAAK,OAAK,IAAI,CAA4I,OAAoB,EAAK,MAAM,CAAC,MAAM,EAAK,OAAO,KAAK,MAAM,EAAK,GAAG,EAAE,EAAE,QAAQ,YAAY,KAAK,OAAO,cAAc,OAAO,MAAM,CAAC,QAAQ,QAAQ,UAAU,EAAK,aAAa,IAAA,EAAS,EAAE,SAAS,CAApU,CAAC,IAAI,IAAI,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,KAAK,IAAI,CAA2M,CAAC,CAAC,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