{"version":3,"file":"ImageAnimator.A80GoYu6.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/jhCWnAr1xqA0Ae5EcTbT/xszpsnFnOqkMTAPkAVcB/ImageAnimator.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,useRef,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerDisableUnlink\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerIntrinsicWidth auto\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicHeight auto\n */export default function GIFStyleImageAnimator(props){const{images=[],delay=500,backgroundColor=\"#FFFFFF\",borderRadius=8,padding=\"0px\",objectFit=\"cover\",shadows=\"\"}=props;const isStatic=useIsStaticRenderer();const[index,setIndex]=useState(0);const timer=useRef(null);// Fallback default images if none provided\nconst fallbackImages=[{src:\"https://assets.lummi.ai/assets/QmPMpwSUHWz4kvfpTn7CmXY4Wjf5yqt3kP9ii9Pj9Nv8jV?auto=format&w=1500\"},{src:\"https://assets.lummi.ai/assets/QmaMkjxCinCmhuZ3sH3f5Efs67S8XpNwfgpjmWjFtxcgnm?auto=format&w=1500\"},{src:\"https://assets.lummi.ai/assets/QmbkXk5ACkbxG8rUoLwRjjG1RNS2wd1mHp5x3az8TrpsgZ?auto=format&w=1500\"}];const imgs=images.length>0?images:fallbackImages;useEffect(()=>{if(typeof window===\"undefined\"||isStatic||imgs.length<=1)return;const startTimer=()=>{if(timer.current)clearTimeout(timer.current);timer.current=window.setTimeout(()=>{startTransition(()=>setIndex(i=>(i+1)%imgs.length));},Math.max(100,delay));};startTimer();return()=>{if(timer.current)clearTimeout(timer.current);};},[imgs.length,isStatic,delay]);// Separate effect for index changes to restart timer\nuseEffect(()=>{if(typeof window===\"undefined\"||isStatic||imgs.length<=1)return;if(timer.current)clearTimeout(timer.current);timer.current=window.setTimeout(()=>{startTransition(()=>setIndex(i=>(i+1)%imgs.length));},Math.max(100,delay));},[index,imgs.length,isStatic,delay]);const current=imgs[index];return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",minWidth:\"100px\",minHeight:\"100px\",maxWidth:\"100%\",maxHeight:\"100%\",position:\"relative\",overflow:\"hidden\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxShadow:shadows,borderRadius:borderRadius},children:/*#__PURE__*/_jsx(\"div\",{style:{...props.style,width:\"100%\",height:\"100%\",overflow:props.overflow,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:backgroundColor,borderRadius:borderRadius,padding:padding,boxSizing:\"border-box\"},children:/*#__PURE__*/_jsx(\"img\",{src:current.src,alt:\"\",style:{width:\"100%\",height:\"100%\",objectFit:objectFit,display:\"block\",maxWidth:\"100%\",maxHeight:\"100%\",// Radius gambar disesuaikan dengan mengurangi padding\nborderRadius:`max(0px, ${borderRadius}px - ${parseInt(padding)||0}px)`},onError:e=>{e.currentTarget.src=fallbackImages[0].src;}})})});}addPropertyControls(GIFStyleImageAnimator,{images:{type:ControlType.Array,title:\"Images\",control:{type:ControlType.ResponsiveImage},defaultValue:[{src:\"https://assets.lummi.ai/assets/QmPMpwSUHWz4kvfpTn7CmXY4Wjf5yqt3kP9ii9Pj9Nv8jV?auto=format&w=1500\",alt:\"\"},{src:\"https://assets.lummi.ai/assets/QmaMkjxCinCmhuZ3sH3f5Efs67S8XpNwfgpjmWjFtxcgnm?auto=format&w=1500\",alt:\"\"},{src:\"https://assets.lummi.ai/assets/QmbkXk5ACkbxG8rUoLwRjjG1RNS2wd1mHp5x3az8TrpsgZ?auto=format&w=1500\",alt:\"\"}],maxCount:10},delay:{type:ControlType.Number,title:\"Delay (ms)\",defaultValue:500,min:100,max:5e3,step:50},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:64,step:1},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"0px\"},objectFit:{type:ControlType.Enum,title:\"Image Fit\",options:[\"cover\",\"contain\",\"fill\",\"none\",\"scale-down\"],optionTitles:[\"Cover\",\"Contain\",\"Fill\",\"None\",\"Scale Down\"],defaultValue:\"cover\"},overflow:{type:ControlType.Enum,title:\"Overflow\",options:[\"visible\",\"hidden\",\"scroll\",\"auto\"],optionTitles:[\"Visible\",\"Hidden\",\"Scroll\",\"Auto\"],defaultValue:\"hidden\"},shadows:{type:ControlType.BoxShadow,title:\"Shadows\"}});GIFStyleImageAnimator.displayName=\"GIF Image Animator\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GIFStyleImageAnimator\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"auto\",\"framerIntrinsicHeight\":\"auto\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerDisableUnlink\":\"* @framerSupportedLayoutWidth any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageAnimator.map"],"mappings":"qNAMG,SAAwB,EAAsB,EAAM,CAAC,GAAK,CAAC,SAAO,EAAE,CAAC,QAAM,IAAI,kBAAgB,UAAU,eAAa,EAAE,UAAQ,MAAM,YAAU,QAAQ,UAAQ,IAAI,EAAY,EAAS,GAAqB,CAAM,CAAC,EAAM,GAAUA,EAAS,EAAE,CAAO,EAAMC,EAAO,KAAK,CACtQ,EAAe,CAAC,CAAC,IAAI,mGAAmG,CAAC,CAAC,IAAI,mGAAmG,CAAC,CAAC,IAAI,mGAAmG,CAAC,CAAO,EAAK,EAAO,OAAO,EAAE,EAAO,EAAe,MAAyB,IAAS,QAAa,GAAU,EAAK,QAAQ,EAAE,QAAgC,EAAM,SAAQ,aAAa,EAAM,QAAQ,CAAC,EAAM,QAAQ,EAAO,eAAe,CAAC,MAAoB,EAAS,IAAI,EAAE,GAAG,EAAK,OAAO,CAAC,EAAG,KAAK,IAAI,IAAI,EAA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