{"version":3,"file":"Static_Master_Swiper.DCZFpyAp.mjs","names":["useState","useRef","e"],"sources":["https:/framerusercontent.com/modules/P3JO40bZR69ou1TLoLd0/pJxOOLJ1Z1fAPQT708LY/Static_Master_Swiper.js"],"sourcesContent":["// Carousel component with static slides support, navigation buttons, heading, and responsive configuration\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useRef,useState,startTransition}from\"react\";import React from\"react\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function StaticSwiper(props){const{swiperWrapper,heading,previousButton,nextButton,slidesPerViewDesktop=3,slidesPerViewMobile=1,slideGap=20,enableDrag=true,componentGapDesktop=40,componentGapMobile=24,autoplay=false,autoplayDelay=3e3}=props;const[currentIndex,setCurrentIndex]=useState(0);const[isDragging,setIsDragging]=useState(false);const[startX,setStartX]=useState(0);const[translateX,setTranslateX]=useState(0);const[dragOffset,setDragOffset]=useState(0);const[isMobile,setIsMobile]=useState(false);const containerRef=useRef(null);const slidesRef=useRef(null);const isCanvas=RenderTarget.current()===RenderTarget.canvas;// Extract slides from wrapper by looking for children with aria-label=\"swiper-slide\"\nlet slides=[];// Handle if swiperWrapper is an array (Framer sometimes wraps in array)\nconst wrapperElement=Array.isArray(swiperWrapper)?swiperWrapper[0]:swiperWrapper;console.log(\"Static Swiper - Wrapper element:\",wrapperElement);if(wrapperElement&&/*#__PURE__*/React.isValidElement(wrapperElement)){// Get direct children of the wrapper\nconst children=wrapperElement.props?.children;console.log(\"Static Swiper - Children:\",children);if(children){React.Children.forEach(children,child=>{if(!/*#__PURE__*/React.isValidElement(child))return;const ariaLabel=child.props?.[\"aria-label\"]||child.props?.ariaLabel;console.log(\"Static Swiper - Child aria-label:\",ariaLabel,\"Child:\",child);if(ariaLabel===\"swiper-slide\"){slides.push(child);}});}}// Debug: log what we found\nconsole.log(\"Static Swiper - Total slides found:\",slides.length);const totalSlides=slides.length;useEffect(()=>{if(typeof window===\"undefined\")return;const checkMobile=()=>{startTransition(()=>setIsMobile(window.innerWidth<768));};checkMobile();window.addEventListener(\"resize\",checkMobile);return()=>window.removeEventListener(\"resize\",checkMobile);},[]);const slidesPerView=isMobile?slidesPerViewMobile:slidesPerViewDesktop;const maxIndex=Math.max(0,totalSlides-slidesPerView);const componentGap=isMobile?componentGapMobile:componentGapDesktop;useEffect(()=>{if(containerRef.current){const containerWidth=containerRef.current.offsetWidth;const totalGapWidth=slideGap*(slidesPerView-1);const slideWidth=(containerWidth-totalGapWidth)/slidesPerView;const newTranslate=-(currentIndex*(slideWidth+slideGap));startTransition(()=>setTranslateX(newTranslate));}},[currentIndex,slidesPerView,slideGap,isMobile]);// Autoplay functionality\nuseEffect(()=>{if(!autoplay||isDragging)return;const interval=setInterval(()=>{setCurrentIndex(prev=>{// Loop back to start when reaching the end\nif(prev>=maxIndex){return 0;}return prev+1;});},autoplayDelay);return()=>clearInterval(interval);},[autoplay,autoplayDelay,maxIndex,isDragging]);const handlePrevious=()=>{startTransition(()=>setCurrentIndex(prev=>Math.max(0,prev-1)));};const handleNext=()=>{startTransition(()=>setCurrentIndex(prev=>Math.min(maxIndex,prev+1)));};const handleMouseDown=e=>{if(!enableDrag)return;setIsDragging(true);setStartX(e.clientX);setDragOffset(0);};const handleMouseMove=e=>{if(!isDragging||!enableDrag)return;const diff=e.clientX-startX;setDragOffset(diff);};const handleMouseUp=()=>{if(!isDragging||!enableDrag)return;setIsDragging(false);const threshold=50;if(Math.abs(dragOffset)>threshold){if(dragOffset>0){handlePrevious();}else{handleNext();}}setDragOffset(0);};const handleTouchStart=e=>{if(!enableDrag)return;setIsDragging(true);setStartX(e.touches[0].clientX);setDragOffset(0);};const handleTouchMove=e=>{if(!isDragging||!enableDrag)return;const diff=e.touches[0].clientX-startX;setDragOffset(diff);};const handleTouchEnd=()=>{if(!isDragging||!enableDrag)return;setIsDragging(false);const threshold=50;if(Math.abs(dragOffset)>threshold){if(dragOffset>0){handlePrevious();}else{handleNext();}}setDragOffset(0);};return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",display:\"flex\",flexDirection:\"column\",gap:componentGap},children:[/*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\",flexWrap:\"wrap\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{flex:1},children:heading}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",gap:12,alignItems:\"center\"},children:[/*#__PURE__*/_jsx(\"div\",{onClick:handlePrevious,style:{cursor:currentIndex>0?\"pointer\":\"not-allowed\",opacity:currentIndex>0?1:.3,pointerEvents:currentIndex>0?\"auto\":\"none\"},children:previousButton}),/*#__PURE__*/_jsx(\"div\",{onClick:handleNext,style:{cursor:currentIndex<maxIndex?\"pointer\":\"not-allowed\",opacity:currentIndex<maxIndex?1:.3,pointerEvents:currentIndex<maxIndex?\"auto\":\"none\"},children:nextButton})]})]}),/*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{width:\"100%\",overflow:\"visible\",position:\"relative\"},children:totalSlides===0?/*#__PURE__*/_jsx(\"div\",{style:{padding:\"40px\",textAlign:\"center\",background:\"#f5f5f5\",borderRadius:\"8px\",color:\"#666\"},children:'No slides found. Add components with aria-label=\"swiper-slide\" to the Swiper Wrapper slot.'}):/*#__PURE__*/_jsx(\"div\",{ref:slidesRef,onMouseDown:handleMouseDown,onMouseMove:handleMouseMove,onMouseUp:handleMouseUp,onMouseLeave:handleMouseUp,onTouchStart:handleTouchStart,onTouchMove:handleTouchMove,onTouchEnd:handleTouchEnd,style:{display:\"flex\",alignItems:\"stretch\",gap:slideGap,transform:`translateX(${translateX+dragOffset}px)`,transition:isDragging?\"none\":\"transform 0.3s ease-out\",cursor:enableDrag?isDragging?\"grabbing\":\"grab\":\"default\",userSelect:\"none\"},children:slides.map((slide,index)=>/*#__PURE__*/_jsx(\"div\",{style:{flex:`0 0 calc((100% - ${slideGap*(slidesPerView-1)}px) / ${slidesPerView})`,minWidth:0,maxWidth:`calc((100% - ${slideGap*(slidesPerView-1)}px) / ${slidesPerView})`,display:\"flex\",flexDirection:\"column\"},children:/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\"},children:/*#__PURE__*/React.isValidElement(slide)?/*#__PURE__*/React.cloneElement(slide,{style:{...slide.props.style||{},width:\"100%\",height:\"100%\",flex:1}}):slide})},index))})})]});}StaticSwiper.displayName=\"Static Swiper\";addPropertyControls(StaticSwiper,{swiperWrapper:{type:ControlType.ComponentInstance,title:\"Swiper Wrapper\"},heading:{type:ControlType.ComponentInstance,title:\"Heading\"},previousButton:{type:ControlType.ComponentInstance,title:\"Previous Button\"},nextButton:{type:ControlType.ComponentInstance,title:\"Next Button\"},slidesPerViewDesktop:{type:ControlType.Number,title:\"Slides (Desktop)\",defaultValue:3,min:1,max:10,step:.1,displayStepper:true},slidesPerViewMobile:{type:ControlType.Number,title:\"Slides (Mobile)\",defaultValue:1,min:1,max:5,step:.1,displayStepper:true},slideGap:{type:ControlType.Number,title:\"Slide Gap\",defaultValue:20,min:0,max:100,step:1,unit:\"px\"},enableDrag:{type:ControlType.Boolean,title:\"Enable Drag\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},componentGapDesktop:{type:ControlType.Number,title:\"Component Gap (Desktop)\",defaultValue:40,min:0,max:100,step:1,unit:\"px\"},componentGapMobile:{type:ControlType.Number,title:\"Component Gap (Mobile)\",defaultValue:24,min:0,max:100,step:1,unit:\"px\"},autoplay:{type:ControlType.Boolean,title:\"Autoplay\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},autoplayDelay:{type:ControlType.Number,title:\"Autoplay Delay\",defaultValue:3e3,min:500,max:1e4,step:100,unit:\"ms\",hidden:props=>!props.autoplay}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StaticSwiper\",\"slots\":[\"swiperWrapper\",\"heading\",\"previousButton\",\"nextButton\"],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Static_Master_Swiper.map"],"mappings":"8NAIG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,gBAAc,UAAQ,iBAAe,aAAW,uBAAqB,EAAE,sBAAoB,EAAE,WAAS,GAAG,aAAW,GAAK,sBAAoB,GAAG,qBAAmB,GAAG,WAAS,GAAM,gBAAc,KAAK,EAAW,CAAC,EAAa,GAAiBA,EAAS,EAAE,CAAM,CAAC,EAAW,GAAeA,EAAS,GAAM,CAAM,CAAC,EAAO,GAAWA,EAAS,EAAE,CAAM,CAAC,EAAW,GAAeA,EAAS,EAAE,CAAM,CAAC,EAAW,GAAeA,EAAS,EAAE,CAAM,CAAC,EAAS,GAAaA,EAAS,GAAM,CAAO,EAAaC,EAAO,KAAK,CAAO,EAAUA,EAAO,KAAK,CAAgB,EAAa,SAAS,CAAG,EAAa,OAC7nB,IAAI,EAAO,EAAE,CACP,EAAe,MAAM,QAAQ,EAAc,CAAC,EAAc,GAAG,EAA6E,GAA/D,QAAQ,IAAI,mCAAmC,EAAe,CAAI,GAA6B,EAAM,eAAe,EAAe,CAAC,CACrN,IAAM,EAAS,EAAe,OAAO,SAAS,QAAQ,IAAI,4BAA4B,EAAS,CAAI,GAAU,EAAM,SAAS,QAAQ,EAAS,GAAO,CAAC,GAAG,CAAc,EAAM,eAAe,EAAM,CAAC,OAAO,IAAM,EAAU,EAAM,QAAQ,eAAe,EAAM,OAAO,UAAU,QAAQ,IAAI,oCAAoC,EAAU,SAAS,EAAM,CAAI,IAAY,gBAAgB,EAAO,KAAK,EAAM,EAAI,CAC5Y,QAAQ,IAAI,sCAAsC,EAAO,OAAO,CAAC,IAAM,EAAY,EAAO,OAAO,MAAc,CAAC,GAAU,IAAS,OAAY,OAA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