{"version":3,"file":"CollectionSlideshow.zjwmxHAt.mjs","names":["React","_Fragment"],"sources":["https:/framerusercontent.com/modules/xOqAG4IvZ0rkSHvA1bRm/fVrfgQw7xoBVpDfATcDs/CollectionSlideshow.js"],"sourcesContent":["// Ignore import errors\n// @ts-nocheck\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import React from\"react\";export function CollectionSlideshow({collection,showArrows=true,autoPlay=false,autoPlayInterval=3e3,arrowColor=\"#000000\",scrollDistance=0}){const containerRef=React.useRef(null);const autoPlayRef=React.useRef(null);const[canScrollLeft,setCanScrollLeft]=React.useState(false);const[canScrollRight,setCanScrollRight]=React.useState(true);const scrollToNext=()=>{if(containerRef.current){const container=containerRef.current;const scrollWidth=container.scrollWidth;const clientWidth=container.clientWidth;const currentScroll=container.scrollLeft;// Use custom scroll distance or fall back to child width\nlet scrollAmount=scrollDistance;if(scrollDistance===0){const firstChild=container.firstElementChild;if(firstChild){scrollAmount=firstChild.clientWidth;}}const newScroll=Math.min(currentScroll+scrollAmount,scrollWidth-clientWidth);container.scrollTo({left:newScroll,behavior:\"smooth\"});// Update scroll state after scrolling\nsetTimeout(updateScrollState,100);}};const scrollToPrevious=()=>{if(containerRef.current){const container=containerRef.current;const currentScroll=container.scrollLeft;// Use custom scroll distance or fall back to child width\nlet scrollAmount=scrollDistance;if(scrollDistance===0){const firstChild=container.firstElementChild;if(firstChild){scrollAmount=firstChild.clientWidth;}}const newScroll=Math.max(currentScroll-scrollAmount,0);container.scrollTo({left:newScroll,behavior:\"smooth\"});// Update scroll state after scrolling\nsetTimeout(updateScrollState,100);}};const updateScrollState=()=>{if(containerRef.current){const container=containerRef.current;const currentScroll=container.scrollLeft;const scrollWidth=container.scrollWidth;const clientWidth=container.clientWidth;setCanScrollLeft(currentScroll>0);setCanScrollRight(currentScroll<scrollWidth-clientWidth-1)// -1 for rounding tolerance\n;}};// Auto-play functionality\nReact.useEffect(()=>{if(autoPlay){autoPlayRef.current=setInterval(()=>{scrollToNext();},autoPlayInterval);}return()=>{if(autoPlayRef.current){clearInterval(autoPlayRef.current);}};},[autoPlay,autoPlayInterval]);// Pause auto-play on hover\nconst handleMouseEnter=()=>{if(autoPlayRef.current){clearInterval(autoPlayRef.current);}};const handleMouseLeave=()=>{if(autoPlay){autoPlayRef.current=setInterval(()=>{scrollToNext();},autoPlayInterval);}};// Handle keyboard navigation\nReact.useEffect(()=>{const handleKeyDown=event=>{switch(event.key){case\"ArrowLeft\":scrollToPrevious();break;case\"ArrowRight\":scrollToNext();break;}};window.addEventListener(\"keydown\",handleKeyDown);return()=>window.removeEventListener(\"keydown\",handleKeyDown);},[]);// Update scroll state when scrolling\nReact.useEffect(()=>{const container=containerRef.current;if(container){container.addEventListener(\"scroll\",updateScrollState);// Initial state update\nupdateScrollState();return()=>container.removeEventListener(\"scroll\",updateScrollState);}},[]);return /*#__PURE__*/_jsxs(\"div\",{role:\"region\",\"aria-roledescription\":\"carousel\",\"aria-label\":\"Collection slideshow\",style:{width:\"100%\",position:\"relative\"},onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,children:[/*#__PURE__*/_jsx(\"div\",{ref:containerRef,id:\"collection-slideshow-slides\",role:\"group\",\"aria-label\":\"Slides\",\"aria-live\":autoPlay?\"off\":\"polite\",style:{width:\"100%\",overflow:\"auto\",scrollbarWidth:\"none\",msOverflowStyle:\"none\"},children:collection}),showArrows&&/*#__PURE__*/_jsxs(_Fragment,{children:[canScrollLeft&&/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:scrollToPrevious,\"aria-label\":\"Previous slide\",\"aria-controls\":\"collection-slideshow-slides\",style:{position:\"absolute\",left:\"16px\",top:\"50%\",transform:\"translateY(-50%)\",width:\"48px\",height:\"48px\",backgroundColor:\"rgba(255, 255, 255, 0.9)\",backdropFilter:\"blur(8px)\",border:\"none\",borderRadius:\"50%\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:4,boxShadow:\"0 2px 8px rgba(0, 0, 0, 0.1)\",transition:\"all 0.2s ease\",cursor:\"pointer\"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=\"rgba(255, 255, 255, 1)\";e.currentTarget.style.transform=\"translateY(-50%) scale(1.1)\";},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=\"rgba(255, 255, 255, 0.9)\";e.currentTarget.style.transform=\"translateY(-50%) scale(1)\";},children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",\"aria-hidden\":\"true\",focusable:\"false\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M15 18L9 12L15 6\",stroke:arrowColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})}),canScrollRight&&/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:scrollToNext,\"aria-label\":\"Next slide\",\"aria-controls\":\"collection-slideshow-slides\",style:{position:\"absolute\",right:\"16px\",top:\"50%\",transform:\"translateY(-50%)\",width:\"48px\",height:\"48px\",backgroundColor:\"rgba(255, 255, 255, 0.9)\",backdropFilter:\"blur(8px)\",border:\"none\",borderRadius:\"50%\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:10,boxShadow:\"0 2px 8px rgba(0, 0, 0, 0.1)\",transition:\"all 0.2s ease\",cursor:\"pointer\"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=\"rgba(255, 255, 255, 1)\";e.currentTarget.style.transform=\"translateY(-50%) scale(1.1)\";},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=\"rgba(255, 255, 255, 0.9)\";e.currentTarget.style.transform=\"translateY(-50%) scale(1)\";},children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",\"aria-hidden\":\"true\",focusable:\"false\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M9 18L15 12L9 6\",stroke:arrowColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})})]})]});}// Property Controls\naddPropertyControls(CollectionSlideshow,{collection:{type:ControlType.ComponentInstance,title:\"Collection\"},showArrows:{type:ControlType.Boolean,title:\"Show Arrows\",defaultValue:true},autoPlay:{type:ControlType.Boolean,title:\"Auto Play\",defaultValue:false},autoPlayInterval:{type:ControlType.Number,title:\"Auto Play Interval (ms)\",defaultValue:3e3,min:1e3,max:1e4,step:500,hidden:props=>!props.autoPlay},arrowColor:{type:ControlType.Color,title:\"Arrow Color\",defaultValue:\"#000000\",hidden:props=>!props.showArrows},scrollDistance:{type:ControlType.Number,title:\"Scroll Distance (px)\",defaultValue:0,min:0,max:1e3,step:10,helpText:\"0 = auto (child width), or set custom pixel value\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"CollectionSlideshow\":{\"type\":\"reactComponent\",\"name\":\"CollectionSlideshow\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CollectionSlideshow.map"],"mappings":"sMAE4J,SAAgB,EAAoB,CAAC,aAAW,aAAW,GAAK,WAAS,GAAM,mBAAiB,IAAI,aAAW,UAAU,iBAAe,GAAG,CAAC,IAAM,EAAaA,EAAM,OAAO,IAAI,EAAQ,EAAYA,EAAM,OAAO,IAAI,EAAO,CAAC,EAAc,GAAkBA,EAAM,SAAS,EAAK,EAAO,CAAC,EAAe,GAAmBA,EAAM,SAAS,EAAI,EAAQ,MAAiB,CAAC,GAAG,EAAa,QAAQ,CAAC,IAAM,EAAU,EAAa,QAAc,EAAY,EAAU,YAAkB,EAAY,EAAU,YAAkB,EAAc,EAAU,WAC5qB,EAAa,EAAe,GAAG,IAAiB,EAAE,CAAC,IAAM,EAAW,EAAU,kBAAqB,IAAY,EAAa,EAAW,YAAa,CAAC,IAAM,EAAU,KAAK,IAAI,EAAc,EAAa,EAAY,CAAW,EAAE,EAA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