{"version":3,"file":"SegmentCarousel.C3eBMsHc.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/hVD5h4rC5Smxpay0wkBA/XloX3kmAWLJk3ZrifQEH/SegmentCarousel.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";const TEXT=\"#06122A\";const SUBTLE=\"rgba(34,48,74,0.68)\";const HAIRLINE=\"rgba(6,18,42,0.12)\";const SANS=\"'IBM Plex Sans','Helvetica Neue',Arial,sans-serif\";const MONO=\"'IBM Plex Mono',monospace\";const TRANSITION_MS=520;/**\n * Segment Carousel\n *\n * An auto-looping, self-contained carousel of segment cards with a\n * discreet dot-progress indicator that doubles as a countdown (fills\n * over the dwell time) and a manual jump control. Card sizing is fully\n * responsive via container queries, independent of Framer's own\n * breakpoints, so it fits cleanly at any embed width.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function SegmentCarousel(props){const{items,autoplayMs,accentColor,style}=props;const safeItems=items&&items.length>0?items:[];const isStatic=useIsStaticRenderer();const wrapRef=useRef(null);const[position,setPosition]=useState(0);const[noTransition,setNoTransition]=useState(false);const[hovered,setHovered]=useState(false);const[reducedMotion,setReducedMotion]=useState(false);const count=safeItems.length;// Largest number of cards shown at once across breakpoints (2 on mobile,\n// 4 from tablet up). Cloning this many items — instead of just one — at\n// the tail means the clone block never becomes part of a *resting* view:\n// it only ever appears mid-slide, for the single step right before the\n// wrap-reset snaps back. With just one clone, a 4-up viewport would rest\n// on a window mixing real + cloned cards for several autoplay ticks in a\n// row, which reads as a duplicate card rather than a loop.\nconst MAX_VISIBLE=4;const cloneCount=Math.min(count,MAX_VISIBLE);const displayItems=count>0?[...safeItems,...safeItems.slice(0,cloneCount)]:[];const activeIndex=count>0?position%count:0;// First position whose visible window rests entirely on the cloned\n// block, i.e. mirrors the position-0 window card-for-card. Resetting\n// any earlier — e.g. the moment a clone first enters the window — snaps\n// to position 0 while a mix of real and cloned cards is still resting\n// on screen, which reads as a jump-cut to an unrelated set of cards\n// instead of an invisible loop.\nconst resetAt=count>0?cloneCount>=MAX_VISIBLE?count:Math.max(1,count-cloneCount+1):0;useEffect(()=>{if(typeof window===\"undefined\")return;const mq=window.matchMedia(\"(prefers-reduced-motion: reduce)\");setReducedMotion(mq.matches);const onChange=()=>setReducedMotion(mq.matches);mq.addEventListener?.(\"change\",onChange);return()=>mq.removeEventListener?.(\"change\",onChange);},[]);const playing=!isStatic&&!reducedMotion&&!hovered&&count>1;// Own timer for the loop-wrap reset instead of relying on the DOM\n// `transitionend` event, which some embedding/rendering contexts\n// never fire — this keeps the seamless wrap reliable everywhere.\nuseEffect(()=>{if(position<resetAt)return;const t=setTimeout(()=>{setNoTransition(true);setPosition(0);requestAnimationFrame(()=>{requestAnimationFrame(()=>setNoTransition(false));});},TRANSITION_MS);return()=>clearTimeout(t);},[position,resetAt]);useEffect(()=>{if(!playing)return;const t=setTimeout(()=>{setPosition(p=>p+1);},autoplayMs||2800);return()=>clearTimeout(t);},[position,playing,autoplayMs]);function goTo(i){setPosition(i);}if(count===0)return null;return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",...style},onMouseEnter:()=>setHovered(true),onMouseLeave:()=>setHovered(false),children:[/*#__PURE__*/_jsx(\"style\",{children:`\n        .vn-sc-outer{ container-type:inline-size; container-name:vn-sc; }\n        .vn-sc-track{\n          --gap: 16px;\n          --item-width: calc((100cqw - 1 * 16px) / 2);\n        }\n        @container vn-sc (min-width:640px){\n          .vn-sc-track{ --gap: 32px; --item-width: calc((100cqw - 3 * 32px) / 4); }\n        }\n        .vn-sc-item{\n          flex: 0 0 var(--item-width);\n          margin-right: var(--gap);\n        }\n        .vn-sc-desc{ max-width: var(--item-width); }\n        @keyframes vn-sc-fill{ from{ width:0% } to{ width:100% } }\n      `}),/*#__PURE__*/_jsx(\"div\",{ref:wrapRef,className:\"vn-sc-outer\",style:{overflow:\"hidden\",width:\"100%\"},children:/*#__PURE__*/_jsx(\"div\",{className:\"vn-sc-track\",style:{display:\"flex\",alignItems:\"flex-start\",transform:`translateX(calc(-1 * ${position} * (var(--item-width) + var(--gap))))`,transition:noTransition||reducedMotion?\"none\":\"transform 0.52s cubic-bezier(.16,1,.3,1)\",willChange:\"transform\"},children:displayItems.map((item,i)=>{const isClone=i>=count;return /*#__PURE__*/_jsxs(\"div\",{className:\"vn-sc-item\",\"aria-hidden\":isClone?\"true\":undefined,children:[/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",aspectRatio:\"0.85\",borderRadius:0,overflow:\"hidden\",background:\"#16294A\"},children:[item.imageUrl?/*#__PURE__*/_jsx(\"img\",{src:item.imageUrl,alt:item.label,loading:\"eager\",decoding:\"async\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",filter:item.roadmap?\"grayscale(1) brightness(0.9)\":undefined}}):null,/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:0,right:0,bottom:0,height:\"46%\",background:\"linear-gradient(180deg, rgba(6,18,42,0) 0%, rgba(6,18,42,0.82) 100%)\"}}),item.roadmap?/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:12,top:12,padding:\"5px 9px\",borderRadius:0,background:\"rgba(6,18,42,0.55)\",border:\"1px solid rgba(255,255,255,0.3)\",backdropFilter:\"blur(4px)\"},children:/*#__PURE__*/_jsx(\"p\",{style:{fontFamily:MONO,fontSize:11,letterSpacing:\"0.08em\",textTransform:\"uppercase\",color:\"#FFFFFF\",margin:0},children:\"Roadmap\"})}):null,/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:0,right:0,bottom:0,padding:18},children:/*#__PURE__*/_jsx(\"p\",{style:{fontFamily:MONO,fontSize:12,letterSpacing:\"0.06em\",textTransform:\"uppercase\",color:item.roadmap?\"rgba(255,255,255,0.72)\":\"#FFFFFF\",margin:0},children:item.label})})]}),/*#__PURE__*/_jsx(\"p\",{className:\"vn-sc-desc\",style:{fontFamily:SANS,fontSize:13,fontWeight:400,lineHeight:1.45,color:item.roadmap?\"rgba(34,48,74,0.45)\":SUBTLE,margin:\"12px 0 0\"},children:item.description})]},i);})})}),count>1?/*#__PURE__*/_jsx(\"div\",{role:\"group\",\"aria-label\":\"Slideshow progress\",style:{display:\"flex\",justifyContent:\"center\",alignItems:\"center\",gap:6,marginTop:26},children:safeItems.map((item,i)=>{const isActive=i===activeIndex;return /*#__PURE__*/_jsx(\"button\",{onClick:()=>goTo(i),\"aria-label\":`Go to ${item.label}`,\"aria-current\":isActive,style:{position:\"relative\",width:isActive?22:6,height:4,borderRadius:0,padding:0,border:\"none\",cursor:\"pointer\",background:HAIRLINE,overflow:\"hidden\",transition:reducedMotion?\"none\":\"width 0.16s cubic-bezier(.2,0,.2,1), background 0.16s cubic-bezier(.2,0,.2,1)\",flex:\"none\"},children:isActive?/*#__PURE__*/_jsx(\"span\",{style:{display:\"block\",height:\"100%\",width:count>1&&playing?undefined:\"0%\",background:accentColor,animationName:count>1?\"vn-sc-fill\":\"none\",animationDuration:`${autoplayMs||2800}ms`,animationTimingFunction:\"linear\",animationFillMode:\"forwards\",animationPlayState:playing?\"running\":\"paused\"}},position):null},i);})}):null]});}addPropertyControls(SegmentCarousel,{items:{type:ControlType.Array,title:\"Items\",control:{type:ControlType.Object,controls:{imageUrl:{type:ControlType.String,title:\"Image URL\",defaultValue:\"\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Segment\"},description:{type:ControlType.String,title:\"Description\",defaultValue:\"\",displayTextArea:true},roadmap:{type:ControlType.Boolean,title:\"Roadmap\",defaultValue:false}}},defaultValue:[{imageUrl:\"https://framerusercontent.com/images/E7GOMZFBgWii2guee1kAVbDLtY.jpg\",label:\"Payments\",description:\"Interchange, scheme and processing fees, reconciled down to the transaction.\"},{imageUrl:\"https://framerusercontent.com/images/tTL1txOHq7NeEEuwuCaKp2wdsU.jpg\",label:\"Market Infrastructure\",description:\"Exchange, clearing and data fees, priced to volume and connectivity tier.\"},{imageUrl:\"https://framerusercontent.com/images/7sT0C6fJuin9MP5XjPIylkumN8.jpg\",label:\"Retail\",description:\"Account and transaction pricing, held consistent across every channel and tier.\"},{imageUrl:\"https://framerusercontent.com/images/3rNHw1pQCNRKfV8aOocEjENx0.jpg\",label:\"Fintech\",description:\"Usage-based and tiered pricing, defensible as volumes and margins shift.\"},{imageUrl:\"https://framerusercontent.com/images/BQgR1oS0GsiN24vtsuLanAXqOag.jpg\",label:\"Asset Management\",description:\"Fee schedules that move with AUM, benchmarks and mandate terms.\"},{imageUrl:\"https://framerusercontent.com/images/oX8W6zyOEVCpkHOhL6gwY0Dxt0s.jpg\",label:\"Insurance\",description:\"Premium and commission structures, modelled against loss ratios.\"}],maxCount:12},autoplayMs:{type:ControlType.Number,title:\"Autoplay (ms)\",defaultValue:2800,min:1200,max:1e4,step:250},accentColor:{type:ControlType.Color,title:\"Accent\",defaultValue:\"#2B4EE6\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SegmentCarousel\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SegmentCarousel.map"],"mappings":"qNAWG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,QAAM,aAAW,cAAY,SAAO,EAAY,EAAU,GAAO,EAAM,OAAO,EAAE,EAAM,CAAC,EAAQ,EAAS,EAAoB,EAAQ,EAAQA,EAAO,IAAI,EAAO,CAAC,EAAS,GAAaC,EAAS,CAAC,EAAO,CAAC,EAAa,GAAiBA,EAAS,EAAK,EAAO,CAAC,EAAQ,GAAYA,EAAS,EAAK,EAAO,CAAC,EAAc,GAAkBA,EAAS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