{"version":3,"file":"CustomSlideshow.BYG9Kvsi.mjs","names":["React.useState","useRef","useState","__esmMin","init_ssg_sandbox_shims","init_npm_react_18_3_1","window","j","de","init_jsx_runtime","K","p","ce","_e","motion","init_framer_motion_DhsWWWsN","init_framer_DJ_0WPVq","addPropertyControls","ControlType","useMediaQuery","matches","setMatches","media","query","listener","CustomSlideshow","containerRef","containerSize","setContainerSize","startIndex","setStartIndex","isMobile","items","content","totalSlides","visibleSlides","slidesDesktop","resizeObserver","entry","entries","activeIndex","current","handlePrev","prev","handleNext","effectiveWidth","slideWidth","gap","effectiveHeight","slideHeight","stride","isActive","i","sizedChild","child","arrowStyle","bottomPosition","topPosition","arrowsRight","init_CustomSlideshow"],"sources":["https:/framerusercontent.com/modules/4S0Wv92upIhxKHEsFF6k/plgZ3hcHjLeCPOLuzPpL/CustomSlideshow.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect,useRef}from\"react\";function useMediaQuery(query){const[matches,setMatches]=React.useState(false);React.useEffect(()=>{const media=window.matchMedia(query);if(media.matches!==matches){setMatches(media.matches);}const listener=()=>setMatches(media.matches);media.addEventListener(\"change\",listener);return()=>media.removeEventListener(\"change\",listener);},[matches,query]);return matches;}export function CustomSlideshow({content,gap,padding,slidesDesktop,current,arrowsRight,slideWidth,slideHeight,bottomPosition,topPosition}){const containerRef=useRef(null);const[containerSize,setContainerSize]=useState({width:0,height:0});const[startIndex,setStartIndex]=useState(0);const isMobile=useMediaQuery(\"(max-width: 768px)\");const items=React.Children.toArray(content);const totalSlides=items.length;const visibleSlides=isMobile?1:slidesDesktop;// measure parent size\nuseEffect(()=>{if(!containerRef.current)return;const resizeObserver=new ResizeObserver(entries=>{for(let entry of entries){const{width,height}=entry.contentRect;setContainerSize({width,height});}});resizeObserver.observe(containerRef.current);return()=>resizeObserver.disconnect();},[]);// active = the first (leftmost) visible slide\nconst activeIndex=Math.min(startIndex,totalSlides-1);// sync with external prop\nuseEffect(()=>{if(current>=0&&current<totalSlides){setStartIndex(Math.min(Math.max(0,current),totalSlides-1));}},[current,totalSlides,isMobile]);const handlePrev=()=>{setStartIndex(prev=>Math.max(0,prev-1));};const handleNext=()=>{setStartIndex(prev=>prev<totalSlides-1?prev+1:totalSlides-1);};// Calculate slide size\nconst effectiveWidth=slideWidth??(containerSize.width-gap*visibleSlides)/visibleSlides;const effectiveHeight=slideHeight??containerSize.height;const stride=effectiveWidth-effectiveWidth*.2/2*2+gap;return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"visible\"},children:[/*#__PURE__*/_jsx(motion.div,{animate:{x:`-${startIndex*stride}px`},transition:{type:\"spring\",stiffness:300,damping:30},style:{display:\"flex\",gap,padding,height:\"100%\"},children:items.map((child,i)=>{const isActive=i===activeIndex;// clone child to enforce 100% sizing\nconst sizedChild=/*#__PURE__*/React.isValidElement(child)?/*#__PURE__*/React.cloneElement(child,{style:{...child.props.style||{},width:\"100%\",height:\"100%\"}}):child;return /*#__PURE__*/_jsx(motion.div,{animate:{scale:isActive?1:.8},transition:{duration:.3},style:{width:effectiveWidth,height:effectiveHeight,flex:\"0 0 auto\",cursor:\"pointer\",transformOrigin:\"center\",marginLeft:isActive?0:-(effectiveWidth*.2)/2,marginRight:isActive?0:-(effectiveWidth*.2)/2},children:sizedChild},i);})}),isMobile?/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",top:-50,left:\"50%\",transform:\"translateX(-50%)\",display:\"flex\",gap:10,zIndex:2},children:[/*#__PURE__*/_jsxs(motion.button,{style:arrowStyle,onClick:handlePrev,whileTap:{scale:.9},transition:{type:\"spring\",stiffness:400,damping:17},children:[/*#__PURE__*/_jsx(\"path\",{d:\"M39.333 30.6665L22.6663 30.6665M22.6663 30.6665L30.6663 22.6665M22.6663 30.6665L30.6663 38.6665\",stroke:\"#102C47\",\"stroke-width\":\"1.5\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\"}),/*#__PURE__*/_jsx(\"circle\",{cx:\"30\",cy:\"30\",r:\"29.25\",stroke:\"#102C47\",\"stroke-width\":\"1.5\"})]}),/*#__PURE__*/_jsx(motion.button,{style:arrowStyle,onClick:handleNext,whileTap:{scale:.9},transition:{type:\"spring\",stiffness:400,damping:17},children:/*#__PURE__*/_jsxs(\"svg\",{width:\"60\",height:\"60\",viewBox:\"0 0 60 60\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M20.667 29.3335L37.3337 29.3335M37.3337 29.3335L29.3337 37.3335M37.3337 29.3335L29.3337 21.3335\",stroke:\"#102C47\",\"stroke-width\":\"1.5\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\"}),/*#__PURE__*/_jsx(\"circle\",{cx:\"30\",cy:\"30\",r:\"29.25\",transform:\"rotate(-180 30 30)\",stroke:\"#102C47\",\"stroke-width\":\"1.5\"})]})})]}):/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",bottom:bottomPosition,top:topPosition,right:arrowsRight,display:\"flex\",gap:10,zIndex:2},children:[/*#__PURE__*/_jsx(motion.button,{style:arrowStyle,onClick:handlePrev,whileTap:{scale:.9},transition:{type:\"spring\",stiffness:400,damping:17},children:/*#__PURE__*/_jsxs(\"svg\",{width:\"60\",height:\"60\",viewBox:\"0 0 60 60\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M39.333 30.6665L22.6663 30.6665M22.6663 30.6665L30.6663 22.6665M22.6663 30.6665L30.6663 38.6665\",stroke:\"#102C47\",\"stroke-width\":\"1.5\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\"}),/*#__PURE__*/_jsx(\"circle\",{cx:\"30\",cy:\"30\",r:\"29.25\",stroke:\"#102C47\",\"stroke-width\":\"1.5\"})]})}),/*#__PURE__*/_jsx(motion.button,{style:arrowStyle,onClick:handleNext,whileTap:{scale:.9},transition:{type:\"spring\",stiffness:400,damping:17},children:/*#__PURE__*/_jsxs(\"svg\",{width:\"60\",height:\"60\",viewBox:\"0 0 60 60\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M20.667 29.3335L37.3337 29.3335M37.3337 29.3335L29.3337 37.3335M37.3337 29.3335L29.3337 21.3335\",stroke:\"#102C47\",\"stroke-width\":\"1.5\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\"}),/*#__PURE__*/_jsx(\"circle\",{cx:\"30\",cy:\"30\",r:\"29.25\",transform:\"rotate(-180 30 30)\",stroke:\"#102C47\",\"stroke-width\":\"1.5\"})]})})]})]});}const arrowStyle={background:\"transparent\",border:\"0\",width:40,height:40,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"pointer\",padding:0,zIndex:10};addPropertyControls(CustomSlideshow,{content:{type:ControlType.Array,title:\"Content\",propertyControl:{type:ControlType.ComponentInstance}},gap:{type:ControlType.Number,defaultValue:16,min:0,max:100},padding:{type:ControlType.Padding},slidesDesktop:{type:ControlType.Number,title:\"Slides (Desktop)\",defaultValue:4,min:2,max:6,step:1,displayStepper:true},current:{type:ControlType.Number,title:\"Current\",defaultValue:0,min:0,step:1,displayStepper:true},arrowsRight:{type:ControlType.Number,title:\"Arrows Right\",defaultValue:100},slideWidth:{type:ControlType.Number,title:\"Slide Width\",defaultValue:360},slideHeight:{type:ControlType.Number,title:\"Slide Height\",defaultValue:575},topPosition:{type:ControlType.String,title:\"Top Position\",defaultValue:\"auto\"},bottomPosition:{type:ControlType.String,title:\"Bottom Position\",defaultValue:\"-50\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"CustomSlideshow\":{\"type\":\"reactComponent\",\"name\":\"CustomSlideshow\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\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