{"version":3,"file":"SnapScroll.DdSFZnFm.mjs","names":[],"sources":["https:/framerusercontent.com/modules/mwpavbYqs5TA1dEoY9ik/GM5VsYKqwZAPIZYzLEPW/SnapScroll.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Framer's native frame model does not expose CSS scroll snapping, so this\n// zero-size helper adds it to named layers. It renders no visible interface.\n/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 0\n * @framerIntrinsicHeight 0\n * @framerDisableUnlink\n */export default function SnapScroll(props){const{targets=\"Estate Selector List, Posters\",align:alignRaw=\"start\",strictness:strictRaw=\"mandatory\",dragTargets=\"\",sliderTargets=\"\"}=props;const align=String(alignRaw).toLowerCase(),strictness=String(strictRaw).toLowerCase();const names=String(targets).split(\",\").map(s=>s.trim()).filter(Boolean);const estateName=\"Estate Selector List\";const otherNames=names.filter(name=>name!==estateName);const otherSelectors=otherNames.map(name=>'[data-framer-name=\"'+name+'\"]').join(\", \");const otherChildren=otherNames.flatMap(name=>['[data-framer-name=\"'+name+'\"] > *','[data-framer-name=\"'+name+'\"] > * > *']).join(\", \");const sliderNames=String(sliderTargets).split(\",\").map(s=>s.trim()).filter(Boolean);const sliderSel=sliderNames.map(n=>'[data-framer-name=\"'+n+'\"]');// Same track rules as EstateSlider: full-bleed row, hidden scrollbar, no vertical scroll, 40px inset (24 on phones).\nconst sliderCss=sliderNames.length?sliderSel.join(\", \")+\"{display:flex;overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x \"+strictness+\";scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;padding:0 40px!important;scroll-padding-inline:40px;box-sizing:border-box;cursor:grab}\"+sliderSel.map(s=>s+\"::-webkit-scrollbar\").join(\", \")+\"{display:none;height:0}\"+sliderSel.map(s=>s+\" > *\").join(\", \")+\"{flex:none;scroll-snap-align:\"+align+\"}\"+\".vw-snap-arrow{position:absolute;top:50%;transform:translateY(-50%);width:54px;height:54px;border-radius:50%;border:1px solid rgba(28,22,17,0.12);background:#FBF6EC;color:#1C1611;box-shadow:0 2px 10px rgba(28,22,17,0.14);font-size:26px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);z-index:3;padding:0;transition:background 180ms ease,border-color 180ms ease}\"+\".vw-snap-arrow:hover{background:#FFFFFF;border-color:rgba(28,22,17,0.22)}\"+\"@media (max-width:809px){.vw-snap-arrow{display:none!important}\"+sliderSel.join(\", \")+\"{padding:0 24px!important;scroll-padding-inline:24px}}\":\"\";// Arrows for slider targets, placed on the row's parent like EstateSlider's.\nReact.useEffect(()=>{const rows=sliderNames.flatMap(n=>Array.from(document.querySelectorAll('[data-framer-name=\"'+n+'\"]')).map(el=>({el,name:n})));const made=rows.map(({el,name})=>{const host=el.parentElement;if(!host)return()=>{};const live=()=>host.querySelector('[data-framer-name=\"'+name+'\"]')||el;const prevPos=host.style.position;if(getComputedStyle(host).position===\"static\")host.style.position=\"relative\";const step=dir=>{const row=live();const card=row.firstElementChild;const gap=parseFloat(getComputedStyle(row).columnGap||getComputedStyle(row).gap||\"0\")||0;row.scrollBy({left:dir*(card?card.offsetWidth+gap:row.clientWidth*.8),behavior:\"smooth\"});};const mk=(dir,label,glyph,side)=>{const b=document.createElement(\"button\");b.className=\"vw-snap-arrow\";b.type=\"button\";b.setAttribute(\"aria-label\",label);b.textContent=glyph;b.style[side]=\"16px\";b.addEventListener(\"click\",()=>step(dir));host.appendChild(b);return b;};const prev=mk(-1,\"Previous\",\"‹\",\"left\"),nxt=mk(1,\"Next\",\"›\",\"right\");return()=>{prev.remove();nxt.remove();host.style.position=prevPos;};});return()=>made.forEach(off=>off());},[sliderTargets]);const sharedCss=otherNames.length?otherSelectors+\"{scroll-snap-type:x \"+strictness+\";overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none}\"+otherNames.map(name=>'[data-framer-name=\"'+name+'\"]::-webkit-scrollbar').join(\", \")+\"{display:none}\"+otherChildren+\"{scroll-snap-align:\"+align+\";scroll-snap-stop:always}\":\"\";const estateCss=names.includes(estateName)?\"@media (max-width:767px){\"+'[data-framer-name=\"Estate Selector List\"]{'+\"display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;\"+\"align-items:flex-start!important;justify-content:flex-start!important;gap:16px!important;\"+\"overflow-x:auto!important;overflow-y:hidden!important;overscroll-behavior-x:contain;\"+\"-webkit-overflow-scrolling:touch;scroll-snap-type:x \"+strictness+\";\"+\"scroll-padding-inline:0;padding-left:0!important;padding-right:0!important;\"+\"box-sizing:border-box!important;scrollbar-width:none}\"+'[data-framer-name=\"Estate Selector List\"]::-webkit-scrollbar{display:none}'+'[data-framer-name=\"Estate Selector List\"] > *{'+\"flex:0 0 calc(100% - 32px)!important;width:calc(100% - 32px)!important;\"+\"min-width:calc(100% - 32px)!important;scroll-snap-align:start;scroll-snap-stop:always}\"+\"}\":\"\";// Mouse drag for the layers named in \"Drag targets\". Touch and trackpad already scroll natively.\nReact.useEffect(()=>{const dragNames=(String(dragTargets)+\",\"+String(sliderTargets)).split(\",\").map(s=>s.trim()).filter(Boolean);const els=dragNames.flatMap(n=>Array.from(document.querySelectorAll('[data-framer-name=\"'+n+'\"]')));const offs=els.map(el=>{let down=false,moved=false,startX=0,startLeft=0;const onDown=e=>{if(e.pointerType!==\"mouse\"||e.button!==0)return;down=true;moved=false;startX=e.clientX;startLeft=el.scrollLeft;};const onMove=e=>{if(!down)return;const dx=e.clientX-startX;if(!moved&&Math.abs(dx)>4){moved=true;el.style.scrollSnapType=\"none\";el.style.cursor=\"grabbing\";}if(moved)el.scrollLeft=startLeft-dx;};const onUp=()=>{if(!down)return;down=false;el.style.scrollSnapType=\"\";el.style.cursor=\"grab\";};// A drag must not open the card's link.\nconst onClick=e=>{if(moved){e.preventDefault();e.stopPropagation();moved=false;}};const onDragStart=e=>e.preventDefault();el.style.cursor=\"grab\";el.addEventListener(\"pointerdown\",onDown);window.addEventListener(\"pointermove\",onMove);window.addEventListener(\"pointerup\",onUp);el.addEventListener(\"click\",onClick,true);el.addEventListener(\"dragstart\",onDragStart);return()=>{el.style.cursor=\"\";el.removeEventListener(\"pointerdown\",onDown);window.removeEventListener(\"pointermove\",onMove);window.removeEventListener(\"pointerup\",onUp);el.removeEventListener(\"click\",onClick,true);el.removeEventListener(\"dragstart\",onDragStart);};});return()=>offs.forEach(off=>off());},[dragTargets,sliderTargets]);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:0,height:0,pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(\"style\",{children:sharedCss+estateCss+sliderCss})});}addPropertyControls(SnapScroll,{align:{type:ControlType.Enum,title:\"Align\",options:[\"start\",\"center\"],optionTitles:[\"Start\",\"Center\"],defaultValue:\"start\"},targets:{type:ControlType.String,title:\"Targets\",defaultValue:\"Estate Selector List, Posters\",description:\"Comma-separated layer names to snap\"},sliderTargets:{type:ControlType.String,title:\"Slider targets\",defaultValue:\"\",description:\"Rows that get the estate-slider treatment: full-bleed track, arrows, drag, no vertical scroll\"},dragTargets:{type:ControlType.String,title:\"Drag targets\",defaultValue:\"\",description:\"Comma-separated layer names that can be dragged with a mouse\"},strictness:{type:ControlType.Enum,title:\"Snap\",options:[\"mandatory\",\"proximity\"],optionTitles:[\"Mandatory\",\"Proximity\"],defaultValue:\"mandatory\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SnapScroll\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerIntrinsicWidth\":\"0\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicHeight\":\"0\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SnapScroll.map"],"mappings":"wLAQG,SAAwB,EAAW,EAAM,CA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