{"version":3,"file":"UseCaseCarousel.VYPyCsbb.mjs","names":["useRef","startTransition","useState"],"sources":["https:/framerusercontent.com/modules/LrY58n8giK4BRUz1T0eU/0fLuK9IlsAkEOAK1rwsI/UseCaseCarousel.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{forwardRef,startTransition,useEffect,useRef,useState}from\"react\";// @ts-ignore URL module resolved at runtime by Framer\nimport{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";// Horizontal snap carousel that bleeds to the right edge of the viewport.\n// The shell registers its scroller in a store; the Prev/Next overrides read it.\n// Copy of BleedCarousel with bleed + buttons; the original stays untouched.\n// One store tick for every carousel on the page; each arrow finds its own scroller\n// (the nearest ancestor that contains a .uc-carousel) so several carousels can coexist.\nconst useStore=createStore({tick:0});function findScroller(from){let node=from;while(node){const found=node.querySelector(\".uc-carousel\");if(found)return found;node=node.parentElement;}return null;}function step(scroller){const list=scroller.firstElementChild;const card=list?.firstElementChild;const gap=list?parseFloat(getComputedStyle(list).columnGap||\"0\")||0:0;return card?card.offsetWidth+gap:scroller.clientWidth*.8;}const CSS=`.uc-carousel{scrollbar-width:none;-ms-overflow-style:none;scroll-snap-type:x mandatory;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}\n\n.uc-carousel::-webkit-scrollbar{display:none}\n.uc-carousel > * > *{scroll-snap-align:start}`;/** @framerDisableUnlink */export function withUseCaseCarousel(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const holder=useRef(null);const[,setStore]=useStore();useEffect(()=>{const el=holder.current?.firstElementChild;if(!el)return;const update=()=>startTransition(()=>setStore(s=>({tick:s.tick+1})));update();el.addEventListener(\"scroll\",update,{passive:true});const ro=typeof ResizeObserver!==\"undefined\"?new ResizeObserver(update):undefined;ro?.observe(el);return()=>{el.removeEventListener(\"scroll\",update);ro?.disconnect();};},[setStore]);return /*#__PURE__*/_jsxs(\"div\",{ref:holder,style:{display:\"contents\"},children:[/*#__PURE__*/_jsx(Component,{...props,ref:ref,className:`${props.className??\"\"} uc-carousel`,style:{...props.style,// ponytail: bleed = extend the right edge to the viewport, keep the left aligned\n// Full-viewport scroller: margin box = min(1200px, parent) so a centered\n// stack keeps it in place; padding puts the first card on the container's\n// left edge, and scrolled cards run under both sides without clipping.\n// Site container: 1240px max incl. 20px sides (1200px content centred),\n// 20px minimum side margin below 1240px. First card sits on that edge.\nwidth:\"100vw\",marginLeft:\"calc(50% - 50vw)\",marginRight:\"calc(50% - 50vw)\",maxWidth:\"none\",paddingLeft:\"max(20px, calc(50vw - 600px))\",paddingRight:\"max(20px, calc(50vw - 600px))\",scrollPaddingLeft:\"max(20px, calc(50vw - 600px))\"}}),/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:CSS}})]});});}function withArrow(dir){return Component=>/*#__PURE__*/forwardRef((props,ref)=>{const[store]=useStore();const holder=useRef(null);const[enabled,setEnabled]=useState(true);useEffect(()=>{const el=findScroller(holder.current);if(!el)return;const max=el.scrollWidth-el.clientWidth-1;setEnabled(dir<0?el.scrollLeft>1:el.scrollLeft<max);},[store.tick,dir]);return /*#__PURE__*/_jsx(\"div\",{ref:holder,style:{display:\"contents\"},children:/*#__PURE__*/_jsx(Component,{...props,ref:ref,style:{...props.style,opacity:enabled?1:.3,cursor:enabled?\"pointer\":\"default\",transition:\"opacity 0.2s\"},onClick:()=>{const el=findScroller(holder.current);el?.scrollBy({left:dir*step(el),behavior:\"smooth\"});}})});});}/** @framerDisableUnlink */export function withCarouselPrev(Component){return withArrow(-1)(Component);}/** @framerDisableUnlink */export function withCarouselNext(Component){return withArrow(1)(Component);}\nexport const __FramerMetadata__ = {\"exports\":{\"withCarouselPrev\":{\"type\":\"reactHoc\",\"name\":\"withCarouselPrev\",\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"withUseCaseCarousel\":{\"type\":\"reactHoc\",\"name\":\"withUseCaseCarousel\",\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"withCarouselNext\":{\"type\":\"reactHoc\",\"name\":\"withCarouselNext\",\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./UseCaseCarousel.map"],"mappings":"wMAMqC,SAAS,EAAa,EAAK,CAAC,IAAI,EAAK,EAAK,KAAM,GAAK,CAAC,IAAM,EAAM,EAAK,cAAc,cAAc,EAAE,GAAG,EAAM,OAAO,EAAM,EAAK,EAAK,aAAc,CAAC,OAAO,IAAK,CAAC,SAAS,EAAK,EAAS,CAAC,IAAM,EAAK,EAAS,kBAAwB,EAAK,GAAM,kBAAwB,EAAI,GAAK,WAAW,iBAAiB,CAAI,CAAC,CAAC,WAAW,GAAG,GAAK,EAAE,OAAO,EAAK,EAAK,YAAY,EAAI,EAAS,YAAY,EAAG,CAG5V,SAAgB,EAAoB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,IAAM,EAAOA,EAAO,IAAI,EAAO,EAAE,GAAU,EAAS,EAAkY,OAAhY,MAAc,CAAC,IAAM,EAAG,EAAO,SAAS,kBAAkB,GAAG,CAAC,EAAG,OAAO,IAAM,MAAWC,MAAoB,EAAS,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,EAAO,EAAE,EAAG,iBAAiB,SAAS,EAAO,CAAC,QAAQ,EAAI,CAAC,EAAE,IAAM,EAAG,OAAO,eAAiB,IAAY,IAAI,eAAe,CAAM,EAAE,IAAA,GAA0B,OAAhB,GAAI,QAAQ,CAAE,MAAY,CAAC,EAAG,oBAAoB,SAAS,CAAM,EAAE,GAAI,WAAW,CAAE,CAAE,EAAE,CAAC,CAAQ,CAAC,EAAsB,EAAM,MAAM,CAAC,IAAI,EAAO,MAAM,CAAC,QAAQ,UAAU,EAAE,SAAS,CAAc,EAAK,EAAU,CAAC,GAAG,EAAU,MAAI,UAAU,GAAG,EAAM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