{"version":3,"file":"LogoRotator.DcjCnlL3.mjs","names":["useMemo","useState","useRef","__esmMin","init_npm_react_18_3_1","pe","ce","init_jsx_runtime","c","_e","de","motion","AnimatePresence","init_framer_motion_DhsWWWsN","init_framer_BWFVvmND","addPropertyControls","ControlType","LogoRotator","props","pool","custom","logos","l","DEFAULT_LOGOS","count","visible","slots","setSlots","s","i","nextIndex","lastTile","interval","timer","shown","prev","tile","candidate","tries","copy","style","columns","tileHeight","tileFill","borderColor","radius","slot","logoHeight","init_LogoRotator"],"sources":["https:/framerusercontent.com/modules/NtQmpCHBFNZM6C5J7FVI/BfKQO7r15wfUIIgnXc2L/LogoRotator.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useMemo,useRef,useState}from\"react\";import{motion,AnimatePresence}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";const DEFAULT_LOGOS=[\"https://framerusercontent.com/images/HGzAhlDoB9oA6zYKlONk6gEJ83s.png\",\"https://framerusercontent.com/images/1al1OlyhOlLZVb0E5KTpGTV3DE.png\",\"https://framerusercontent.com/images/F538bBXbVHrQ9DR0wc4RPbAYY.svg\",\"https://framerusercontent.com/images/JIZx1keyI1swOLelI21Am2Mr8.svg\",\"https://framerusercontent.com/images/wtaQRNCRtU2cJH3M4PcJC2TcVk.png\",\"https://framerusercontent.com/images/UKqDycFNCZkQNTWXcTt1sW8nC4.png\",\"https://framerusercontent.com/images/ZZaPNdJTyg849Ap9oFSxsVa0g.png\",\"https://framerusercontent.com/images/QlelYmTbHH1AVDqhMFMe1iU90.png\",\"https://framerusercontent.com/images/GU5jnwsXCWrtEdx16eRCIku11s.svg\",\"https://framerusercontent.com/images/QOZrvVNCYoFuX23HCtmE115oE.svg\",\"https://framerusercontent.com/images/r4CLtYnZ3eEjmMyHxeyhN0us2n4.png\",\"https://framerusercontent.com/images/uBcECxttvg56XJRb1X8PrnvAKY.png\",\"https://framerusercontent.com/images/hZdt6OjH1n081hyZcfDk9NJ74.png\",\"https://framerusercontent.com/images/iZQShXvqpwq52BPKKibGz23BWE.jpg\",\"https://framerusercontent.com/images/Wwo9ilo6xYeWpYuSpIV7JEHYzFk.webp\",\"https://framerusercontent.com/images/biXXzHy02m3601ndWJK6pjMLqV4.png\"];/**\n * Trusted-by logo grid. Shows a fixed number of tiles and swaps one tile at a time\n * to the next logo from the pool, with a soft crossfade.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function LogoRotator(props){const{logos,columns,visible,interval,tileHeight,logoHeight,gap,radius,tileFill,borderColor,style}=props;const pool=useMemo(()=>{const custom=(logos||[]).map(l=>typeof l===\"string\"?l:l&&l.src).filter(Boolean);return custom.length?custom:DEFAULT_LOGOS;},[logos]);const count=Math.max(1,Math.min(visible,pool.length));const[slots,setSlots]=useState(()=>pool.slice(0,count).map((s,i)=>({src:s,key:\"s\"+i})));const nextIndex=useRef(count);const lastTile=useRef(-1);useEffect(()=>{setSlots(pool.slice(0,count).map((s,i)=>({src:s,key:\"s\"+i})));nextIndex.current=count;},[pool,count]);useEffect(()=>{if(pool.length<=count||interval<=0)return;const timer=setInterval(()=>{setSlots(prev=>{const shown=new Set(prev.map(s=>s.src));let tile=Math.floor(Math.random()*prev.length);if(tile===lastTile.current)tile=(tile+1)%prev.length;lastTile.current=tile;let candidate=pool[nextIndex.current%pool.length];let tries=0;while(shown.has(candidate)&&tries<pool.length){nextIndex.current++;candidate=pool[nextIndex.current%pool.length];tries++;}nextIndex.current++;const copy=prev.slice();copy[tile]={src:candidate,key:candidate+Date.now()};return copy;});},interval*1e3);return()=>clearInterval(timer);},[pool,count,interval]);return /*#__PURE__*/_jsx(\"div\",{style:{...style,display:\"grid\",gridTemplateColumns:`repeat(${columns}, minmax(0, 1fr))`,gap,width:\"100%\"},children:slots.map((slot,i)=>/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",height:tileHeight,background:tileFill,border:`1px solid ${borderColor}`,borderRadius:radius,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(AnimatePresence,{initial:false,children:/*#__PURE__*/_jsx(motion.img,{src:slot.src,alt:\"\",draggable:false,initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.55,ease:\"easeOut\"},style:{position:\"absolute\",inset:0,margin:\"auto\",display:\"block\",maxHeight:logoHeight,maxWidth:\"78%\",width:\"auto\",height:\"auto\",objectFit:\"contain\"}},slot.key)})},i))});}LogoRotator.defaultProps={logos:[],columns:3,visible:9,interval:2.5,tileHeight:44,logoHeight:22,gap:8,radius:8,tileFill:\"#FFFFFF\",borderColor:\"#E9EBF1\"};addPropertyControls(LogoRotator,{logos:{type:ControlType.Array,title:\"Logos\",control:{type:ControlType.Image}},columns:{type:ControlType.Number,title:\"Columns\",min:1,max:6,step:1,displayStepper:true},visible:{type:ControlType.Number,title:\"Tiles\",min:1,max:24,step:1,displayStepper:true},interval:{type:ControlType.Number,title:\"Swap every\",min:.5,max:10,step:.5,unit:\"s\"},tileHeight:{type:ControlType.Number,title:\"Tile height\",min:24,max:120,unit:\"px\"},logoHeight:{type:ControlType.Number,title:\"Logo height\",min:10,max:80,unit:\"px\"},gap:{type:ControlType.Number,title:\"Gap\",min:0,max:40,unit:\"px\"},radius:{type:ControlType.Number,title:\"Radius\",min:0,max:40,unit:\"px\"},tileFill:{type:ControlType.Color,title:\"Tile fill\"},borderColor:{type:ControlType.Color,title:\"Border\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LogoRotator\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LogoRotator.map"],"mappings":"A,uPAMG,SAAwBiB,EAAY,EAAM,CAAC,GAAK,CAAC,QAAM,UAAQ,UAAQ,WAAS,aAAW,aAAW,MAAI,S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