{"version":3,"file":"Carousel_Controls_Collection.DG9YXMgO.mjs","names":["useRef","useState","useMemo"],"sources":["https:/framerusercontent.com/modules/f4reHtcZudGI4BXRiTh9/mFjNN13tUrIgyfgncBgv/Carousel_Controls_Collection.js"],"sourcesContent":["// Arrow controls for scrollable Framer Collections / stacks\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useMemo,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CarouselControls(props){const{direction=\"horizontal\",arrowColor=\"#000000\",backgroundColor=\"#F5F5F5\",borderRadius=8,size=40,spacing=12,selectedCarousel=\"\",showLabels=false,previousLabel=\"Previous\",nextLabel=\"Next\",font,useCustomIcons=false,previousIcon=\"\",nextIcon=\"\"}=props;const isHorizontal=direction===\"horizontal\";const carouselRef=useRef(null);const[hasTarget,setHasTarget]=useState(false);// Find the scrollable container for a given Framer layer name\nconst findTarget=()=>{if(typeof window===\"undefined\")return null;const name=selectedCarousel?.trim();if(!name)return null;const root=document.querySelector(`[data-framer-name=\"${CSS.escape(name)}\"]`);if(!root)return null;// Internal layout container used by Collections / scrollable stacks\nconst layout=root.querySelector(\"[data-framer-collection-layout]\")||root.querySelector('[data-framer-component-type=\"Scroll\"]');return layout||root;};// Resolve the target once the Collection has rendered\nuseEffect(()=>{carouselRef.current=null;setHasTarget(false);if(!selectedCarousel.trim())return;let cancelled=false;let tries=0;const tryFind=()=>{if(cancelled)return;const el=findTarget();if(el){carouselRef.current=el;setHasTarget(true);}else if(tries<30){tries++;requestAnimationFrame(tryFind);}};tryFind();return()=>{cancelled=true;carouselRef.current=null;setHasTarget(false);};},[selectedCarousel,direction]);const scrollByArrow=type=>{let el=carouselRef.current;// Lazy resolve on first click if needed\nif(!el){el=findTarget();if(!el)return;carouselRef.current=el;setHasTarget(true);}const base=isHorizontal?el.clientWidth:el.clientHeight;const delta=base*.8*(type===\"prev\"?-1:1);if(isHorizontal){el.scrollBy({left:delta,behavior:\"smooth\"});}else{el.scrollBy({top:delta,behavior:\"smooth\"});}};const baseButtonStyle=useMemo(()=>({width:size,height:size,backgroundColor,border:\"none\",borderRadius,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",transition:\"transform .18s cubic-bezier(.4,0,.2,1), opacity .18s\",willChange:\"transform\",userSelect:\"none\",cursor:hasTarget?\"pointer\":\"default\"}),[size,backgroundColor,borderRadius,hasTarget]);const disabledStyle=useMemo(()=>({opacity:hasTarget?1:.4}),[hasTarget]);const arrowStyle=useMemo(()=>({width:size*.4,height:size*.4,fill:\"none\",stroke:arrowColor,strokeWidth:2,strokeLinecap:\"round\",strokeLinejoin:\"round\",transition:\"stroke .18s\"}),[size,arrowColor]);const containerStyle=useMemo(()=>({display:\"flex\",alignItems:\"center\",gap:spacing,flexDirection:isHorizontal?\"row\":\"column\",width:\"100%\",height:\"100%\"}),[spacing,isHorizontal]);const labelStyle=useMemo(()=>({...font||{},color:arrowColor,margin:0,userSelect:\"none\"}),[font,arrowColor]);const renderArrow=kind=>{const icon=kind===\"prev\"?previousIcon:nextIcon;if(useCustomIcons&&icon){return /*#__PURE__*/_jsx(\"img\",{src:icon,alt:kind===\"prev\"?\"previous\":\"next\",style:{width:size*.5,height:size*.5,objectFit:\"contain\",opacity:hasTarget?1:.4}});}return /*#__PURE__*/_jsx(\"svg\",{style:{...arrowStyle,stroke:hasTarget?arrowColor:\"#999999\"},viewBox:\"0 0 24 24\",\"aria-hidden\":true,children:/*#__PURE__*/_jsx(\"path\",{d:kind===\"prev\"?\"M15 18l-6-6 6-6\":\"M9 18l6-6-6-6\"})});};const onHover=(e,up)=>{if(!hasTarget)return;const el=e.currentTarget;el.style.transform=up?\"scale(1.05)\":\"scale(1)\";};return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:8,flexDirection:isHorizontal?\"row\":\"column\"},children:[/*#__PURE__*/_jsx(\"button\",{style:{...baseButtonStyle,...disabledStyle},disabled:!hasTarget,onClick:()=>scrollByArrow(\"prev\"),\"aria-label\":\"Previous\",onMouseEnter:e=>onHover(e,true),onMouseLeave:e=>onHover(e,false),children:renderArrow(\"prev\")}),showLabels&&/*#__PURE__*/_jsx(\"span\",{style:labelStyle,children:previousLabel})]}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:8,flexDirection:isHorizontal?\"row\":\"column\"},children:[/*#__PURE__*/_jsx(\"button\",{style:{...baseButtonStyle,...disabledStyle},disabled:!hasTarget,onClick:()=>scrollByArrow(\"next\"),\"aria-label\":\"Next\",onMouseEnter:e=>onHover(e,true),onMouseLeave:e=>onHover(e,false),children:renderArrow(\"next\")}),showLabels&&/*#__PURE__*/_jsx(\"span\",{style:labelStyle,children:nextLabel})]})]});}addPropertyControls(CarouselControls,{selectedCarousel:{type:ControlType.String,title:\"Collection\",defaultValue:\"\",placeholder:\"Framer layer name…\"},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"horizontal\",\"vertical\"],optionTitles:[\"↔\",\"↕\"],defaultValue:\"horizontal\",displaySegmentedControl:true},size:{type:ControlType.Number,title:\"Button Size\",defaultValue:40,min:24,max:80,step:4,unit:\"px\"},spacing:{type:ControlType.Number,title:\"Spacing\",defaultValue:12,min:0,max:40,step:2,unit:\"px\"},useCustomIcons:{type:ControlType.Boolean,title:\"Custom Icons\",defaultValue:false,enabledTitle:\"Custom\",disabledTitle:\"Default\"},previousIcon:{type:ControlType.File,title:\"Previous Icon\",allowedFileTypes:[\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\",\"svg\"],hidden:({useCustomIcons})=>!useCustomIcons},nextIcon:{type:ControlType.File,title:\"Next Icon\",allowedFileTypes:[\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\",\"svg\"],hidden:({useCustomIcons})=>!useCustomIcons},arrowColor:{type:ControlType.Color,title:\"Arrow Color\",defaultValue:\"#000000\",hidden:({useCustomIcons})=>useCustomIcons},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#F5F5F5\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,step:1,unit:\"px\"},showLabels:{type:ControlType.Boolean,title:\"Show Labels\",defaultValue:false,enabledTitle:\"Show\",disabledTitle:\"Hide\"},previousLabel:{type:ControlType.String,title:\"Previous Label\",defaultValue:\"Previous\",hidden:({showLabels})=>!showLabels},nextLabel:{type:ControlType.String,title:\"Next Label\",defaultValue:\"Next\",hidden:({showLabels})=>!showLabels},font:{type:ControlType.Font,title:\"Label Font\",defaultValue:{fontSize:\"14px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\",hidden:({showLabels})=>!showLabels}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CarouselControls\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Carousel_Controls_Collection.map"],"mappings":"qNAIG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,YAAU,aAAa,aAAW,UAAU,kBAAgB,UAAU,eAAa,EAAE,OAAK,GAAG,UAAQ,GAAG,mBAAiB,GAAG,aAAW,GAAM,gBAAc,WAAW,YAAU,OAAO,OAAK,iBAAe,GAAM,eAAa,GAAG,WAAS,IAAI,EAAY,EAAa,IAAY,aAAmB,EAAYA,EAAO,KAAK,CAAM,CAAC,EAAU,GAAcC,EAAS,GAAM,CAC/Z,MAAe,CAAC,GAAU,IAAS,OAAY,OAAO,KAAK,IAAM,EAAK,GAAkB,MAAM,CAAC,GAAG,CAAC,EAAK,OAAO,KAAK,IAAM,EAAK,SAAS,cAAc,sBAAsB,IAAI,OAAO,EAAK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