{"version":3,"file":"CarouselControl.XxgtyCvC.mjs","names":["useState","useCallback","el"],"sources":["https:/framerusercontent.com/modules/15HmtsUTAYylOf91Rie8/zwFsnhIrgNP2r6zECQyS/tp6T62ef3.js","https:/framerusercontent.com/modules/yOAp2Ls0LskJYakR0Syz/qtWCZthi22CywRDo6La4/CarouselControl.js"],"sourcesContent":["// Generated by Framer (5c21306)\nimport{fontStore}from\"framer\";fontStore.loadFonts([\"GF;Chivo Mono-regular\",\"GF;Chivo Mono-600\",\"GF;Chivo Mono-700italic\",\"GF;Chivo Mono-italic\"]);export const fonts=[{explicitInter:true,fonts:[{cssFamilyName:\"Chivo Mono\",source:\"google\",style:\"normal\",uiFamilyName:\"Chivo Mono\",url:\"https://fonts.gstatic.com/s/chivomono/v11/mFThWbgRxKvF_Z5eQMO9qRMrJJrnKNtC3D7hr6fQKphL03l4.woff2\",weight:\"400\"},{cssFamilyName:\"Chivo Mono\",source:\"google\",style:\"normal\",uiFamilyName:\"Chivo Mono\",url:\"https://fonts.gstatic.com/s/chivomono/v11/mFThWbgRxKvF_Z5eQMO9qRMrJJrnKNtC3D4_qKfQKphL03l4.woff2\",weight:\"600\"},{cssFamilyName:\"Chivo Mono\",source:\"google\",style:\"italic\",uiFamilyName:\"Chivo Mono\",url:\"https://fonts.gstatic.com/s/chivomono/v11/mFTjWbgRxKvF_Z5eQMO9gxoZ20KOQ0Hs2ysp7KiRIJlp1ml4imo.woff2\",weight:\"700\"},{cssFamilyName:\"Chivo Mono\",source:\"google\",style:\"italic\",uiFamilyName:\"Chivo Mono\",url:\"https://fonts.gstatic.com/s/chivomono/v11/mFTjWbgRxKvF_Z5eQMO9gxoZ20KOQ0Hs2ysp7E-WIJlp1ml4imo.woff2\",weight:\"400\"}]}];export const css=['.framer-pZrjv .framer-styles-preset-ygpcx1:not(.rich-text-wrapper), .framer-pZrjv .framer-styles-preset-ygpcx1.rich-text-wrapper p { --framer-font-family: \"Chivo Mono\", monospace; --framer-font-family-bold: \"Chivo Mono\", monospace; --framer-font-family-bold-italic: \"Chivo Mono\", monospace; --framer-font-family-italic: \"Chivo Mono\", monospace; --framer-font-open-type-features: normal; --framer-font-size: 14px; --framer-font-style: normal; --framer-font-style-bold: normal; --framer-font-style-bold-italic: italic; --framer-font-style-italic: italic; --framer-font-variation-axes: normal; --framer-font-weight: 400; --framer-font-weight-bold: 600; --framer-font-weight-bold-italic: 700; --framer-font-weight-italic: 400; --framer-letter-spacing: -0.02em; --framer-line-height: 1.2em; --framer-paragraph-spacing: 20px; --framer-text-alignment: left; --framer-text-color: var(--token-6c14d33d-5292-443c-9d9c-84f21b75c6d7, #101010); --framer-text-decoration: none; --framer-text-stroke-color: initial; --framer-text-stroke-width: initial; --framer-text-transform: uppercase; }'];export const className=\"framer-pZrjv\";\nexport const __FramerMetadata__ = {\"exports\":{\"fonts\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"css\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"className\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Carousel Control Button for Framer\n// Takes a carousel name input and emits a custom event to control a matching carousel on the page\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useCallback,useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * CarouselControl\n *\n * A control button for carousels. Emits a custom event containing the carousel name and action, to be handled by a listening Carousel component.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function CarouselControl(props){const{carouselName,action,label,backgroundColor,textColor,font,borderRadius,border,useIcon=false,icon=\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",style}=props;const[isEnabled,setIsEnabled]=useState(true);// Check if the carousel can navigate in the specified direction\nconst checkCarouselState=useCallback(()=>{if(typeof window===\"undefined\")return;const name=carouselName?.trim();if(!name)return;let el=null;// Find carousel element\nel=document.querySelector(`[data-framer-name=\"${CSS.escape(name)}\"]`);if(!el){el=Array.from(document.querySelectorAll('[class*=\"carousel\" i]')).find(el=>el.className.toLowerCase().includes(name.toLowerCase()))||null;}if(!el){el=Array.from(document.querySelectorAll('[role*=\"carousel\" i], [aria-label*=\"carousel\" i]')).find(el=>(el.getAttribute(\"aria-label\")||el.getAttribute(\"role\")||\"\").toLowerCase().includes(name.toLowerCase()))||null;}if(!el){startTransition(()=>setIsEnabled(false));return;}// Check if it's a scroll container\nconst isScrollable=el.scrollWidth>el.clientWidth||el.scrollHeight>el.clientHeight;if(isScrollable){// For scroll containers, check scroll position\nif(action===\"prev\"){startTransition(()=>setIsEnabled(el.scrollLeft>1||el.scrollTop>1));}else{const maxScrollLeft=el.scrollWidth-el.clientWidth;const maxScrollTop=el.scrollHeight-el.clientHeight;startTransition(()=>setIsEnabled(el.scrollLeft<maxScrollLeft-1||el.scrollTop<maxScrollTop-1));}return;}// Check for navigation buttons\nconst target=action===\"prev\"?el.querySelector(\"[aria-label*='previous' i], .carousel-prev, .prev\"):el.querySelector(\"[aria-label*='next' i], .carousel-next, .next\");if(target){const disabled=target.hasAttribute(\"disabled\")||target.hasAttribute(\"aria-disabled\");startTransition(()=>setIsEnabled(!disabled));return;}// Check indicators/slides\nconst indicators=el.querySelectorAll('[role=\"tab\"], .carousel-indicator, .slide-indicator');if(indicators.length){const active=el.querySelector('[role=\"tab\"][aria-selected=\"true\"], .carousel-indicator.active, .slide-indicator.active');if(active){const list=Array.from(indicators);const currentIndex=list.indexOf(active);if(action===\"prev\"){startTransition(()=>setIsEnabled(currentIndex>0));}else{startTransition(()=>setIsEnabled(currentIndex<list.length-1));}return;}}// Check slides in container\nconst slideContainer=el.querySelector('.carousel-inner, .slides-container, [data-framer-name*=\"slide\" i]');if(slideContainer){const slides=Array.from(slideContainer.children);const active=slideContainer.querySelector('.active, .current, [aria-current=\"true\"]');if(active){const currentIndex=slides.indexOf(active);if(action===\"prev\"){startTransition(()=>setIsEnabled(currentIndex>0));}else{startTransition(()=>setIsEnabled(currentIndex<slides.length-1));}return;}}// Default to enabled if we can't determine state\nstartTransition(()=>setIsEnabled(true));},[carouselName,action]);// Check state on mount and when carousel name changes\nuseEffect(()=>{checkCarouselState();// Set up mutation observer to watch for changes\nif(typeof window===\"undefined\")return;const name=carouselName?.trim();if(!name)return;let el=document.querySelector(`[data-framer-name=\"${CSS.escape(name)}\"]`);if(!el)return;const observer=new MutationObserver(()=>{checkCarouselState();});observer.observe(el,{subtree:true,childList:true,attributes:true,attributeFilter:[\"class\",\"aria-selected\",\"aria-current\",\"disabled\",\"aria-disabled\"]});// Also listen for scroll events\nconst handleScroll=()=>checkCarouselState();el.addEventListener(\"scroll\",handleScroll,{passive:true});return()=>{observer.disconnect();el?.removeEventListener(\"scroll\",handleScroll);};},[carouselName,checkCarouselState]);// Custom event emission for controlling carousel by name\nconst handleClick=useCallback(()=>{if(!isEnabled)return;if(typeof window!==\"undefined\"){// Try to find a carousel by data-framer-name or fallback selectors for broad support\nconst name=carouselName?.trim();let el=null;if(name){el=document.querySelector(`[data-framer-name=\"${CSS.escape(name)}\"]`);if(!el){el=Array.from(document.querySelectorAll('[class*=\"carousel\" i]')).find(el=>el.className.toLowerCase().includes(name.toLowerCase()))||null;}if(!el){el=Array.from(document.querySelectorAll('[role*=\"carousel\" i], [aria-label*=\"carousel\" i]')).find(el=>(el.getAttribute(\"aria-label\")||el.getAttribute(\"role\")||\"\").toLowerCase().includes(name.toLowerCase()))||null;}}if(el){// Prefer native controls (aria/role-based)\nlet target=null;if(action===\"prev\"){target=el.querySelector(\"[aria-label*='previous' i], .carousel-prev, .prev\");}else{target=el.querySelector(\"[aria-label*='next' i], .carousel-next, .next\");}if(target&&!target.hasAttribute(\"disabled\")&&!target.hasAttribute(\"aria-disabled\")){target.click();// Re-check state after click\nsetTimeout(checkCarouselState,100);return;}// Try keyboard navigation as fallback\nconst isHorizontal=true// Assume horizontal for fallback\n;const focusable=el.querySelector('[tabindex], button, [role=\"button\"]');if(focusable){focusable.focus();const key=isHorizontal?action===\"prev\"?\"ArrowLeft\":\"ArrowRight\":action===\"prev\"?\"ArrowUp\":\"ArrowDown\";const ev=new KeyboardEvent(\"keydown\",{key,bubbles:true});focusable.dispatchEvent(ev);// Re-check state after keyboard event\nsetTimeout(checkCarouselState,100);return;}}// Fallback: emit the original custom event\nwindow.dispatchEvent(new CustomEvent(\"framer-carousel-control\",{detail:{carouselName,action}}));// Re-check state after custom event\nsetTimeout(checkCarouselState,100);}},[carouselName,action,isEnabled,checkCarouselState]);return /*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:handleClick,\"aria-label\":`${action} on ${carouselName} carousel`,disabled:!isEnabled,style:{...style,display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",background:backgroundColor,color:textColor,border:\"none\",borderRadius,padding:\"10px 20px\",cursor:isEnabled?\"pointer\":\"not-allowed\",opacity:isEnabled?1:.5,...border,...font},children:useIcon?/*#__PURE__*/_jsx(\"img\",{src:icon,alt:label,style:{objectFit:\"cover\",opacity:isEnabled?1:.5}}):label});}addPropertyControls(CarouselControl,{carouselName:{type:ControlType.String,title:\"Carousel Name\",defaultValue:\"main-carousel\",placeholder:\"Enter carousel name…\"},action:{type:ControlType.Enum,options:[\"next\",\"prev\"],optionTitles:[\"Next\",\"Previous\"],title:\"Action\",defaultValue:\"next\",displaySegmentedControl:true},useIcon:{type:ControlType.Boolean,title:\"Use Icon\",defaultValue:false,enabledTitle:\"Icon\",disabledTitle:\"Text\"},icon:{type:ControlType.File,title:\"Icon\",allowedFileTypes:[\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\",\"svg\"],hidden:({useIcon})=>!useIcon},label:{type:ControlType.String,title:\"Label\",defaultValue:\"→\",hidden:({useIcon})=>useIcon},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\",hidden:({useIcon})=>useIcon},border:{type:ControlType.Border,title:\"Border\",defaultValue:{borderWidth:1,borderStyle:\"solid\",borderColor:\"#CCCCCC\"}},font:{type:ControlType.Font,title:\"Font\",defaultFontType:\"sans-serif\",controls:\"extended\",defaultValue:{fontSize:\"18px\",variant:\"Bold\",letterSpacing:\"0em\",lineHeight:\"1em\"},hidden:({useIcon})=>useIcon},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CarouselControl\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CarouselControl.map"],"mappings":"2OAC8B,GAAU,UAAU,CAAC,wBAAwB,oBAAoB,0BAA0B,uBAAuB,CAAC,CAAc,EAAM,CAAC,CAAC,cAAc,GAAK,MAAM,CAAC,CAAC,cAAc,aAAa,OAAO,SAAS,MAAM,SAAS,aAAa,aAAa,IAAI,mGAAmG,OAAO,MAAM,CAAC,CAAC,cAAc,aAAa,OAAO,SAAS,MAAM,SAAS,aAAa,aAAa,IAAI,mGAAmG,OAAO,MAAM,CAAC,CAAC,cAAc,aAAa,OAAO,SAAS,MAAM,SAAS,aAAa,aAAa,IAAI,sGAAsG,OAAO,MAAM,CAAC,CAAC,cAAc,aAAa,OAAO,SAAS,MAAM,SAAS,aAAa,aAAa,IAAI,sGAAsG,OAAO,MAAM,CAAC,CAAC,CAAC,CAAc,EAAI,CAAC,sjCAAsjC,CAAc,EAAU,kBCQ/kE,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,eAAa,SAAO,QAAM,kBAAgB,YAAU,OAAK,eAAa,SAAO,UAAQ,GAAM,OAAK,sEAAsE,SAAO,EAAW,CAAC,EAAU,GAAcA,EAAS,GAAK,CACjR,EAAmBC,MAAgB,CAAC,GAAU,IAAS,OAAY,O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