{"version":3,"file":"RailSnap.IsLPSeLz.mjs","names":["useEffect","_jsxs","__esmMin","window","init_ssg_sandbox_shims","p","init_jsx_runtime","ce","init_npm_react_18_3_1","addPropertyControls","init_framer_ChujFWHC","RenderTarget","ControlType","RailSnap","props","railName","alsoName","align","inset","maxWidth","enabled","hideEmptyBlocks","blockName","cardName","names","rails","n","apply","on","el","cs","scrolls","c","hideEmpty","b","hideTimers","hideObserver","t1","t2","mo","init_RailSnap"],"sources":["https:/framerusercontent.com/modules/dWmnoy4nle9kLq4FPS0I/fy5tf0z0xgJIuSIM2n6P/RailSnap.js"],"sourcesContent":["import{jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * Rail Snap — makes the horizontal card rows on the hub snap as you swipe.\n * Finds every frame named `railName` that actually scrolls sideways and gives it\n * CSS scroll snapping, so each card settles in place instead of drifting.\n * Renders nothing on the published site; the box below is a canvas aid.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function RailSnap(props){const{railName=\"Sessions\",alsoName=\"Stimuli\",align=\"start\",inset=20,maxWidth=900,enabled=true,hideEmptyBlocks=true,blockName=\"Source Block\",cardName=\"Session Card\"}=props;useEffect(()=>{if(typeof window===\"undefined\"||!enabled)return;const names=[railName,alsoName].filter(Boolean);const rails=()=>names.flatMap(n=>Array.from(document.querySelectorAll(`[data-framer-name=\"${n}\"]`)));const apply=()=>{const on=window.innerWidth<=maxWidth;rails().forEach(el=>{const cs=getComputedStyle(el);const scrolls=(cs.overflowX===\"auto\"||cs.overflowX===\"scroll\")&&el.scrollWidth>el.clientWidth+2;if(on&&scrolls){el.style.scrollSnapType=\"x mandatory\";el.style.scrollPaddingLeft=`${inset}px`;el.style.scrollPaddingRight=`${inset}px`;el.style.overscrollBehaviorX=\"contain\";Array.from(el.children).forEach(c=>{c.style.scrollSnapAlign=align;c.style.scrollSnapStop=\"always\";});}else{el.style.scrollSnapType=\"\";el.style.scrollPaddingLeft=\"\";el.style.scrollPaddingRight=\"\";Array.from(el.children).forEach(c=>{c.style.scrollSnapAlign=\"\";c.style.scrollSnapStop=\"\";});}});};// Hide any source block whose workouts are all drafted, so a coach or team\n// never shows as a heading with nothing under it. Runs at every width.\nconst hideEmpty=()=>{if(!hideEmptyBlocks)return;const blocks=Array.from(document.querySelectorAll(`[data-framer-name=\"${blockName}\"]`));blocks.forEach(b=>{const n=b.querySelectorAll(`[data-framer-name=\"${cardName}\"]`).length;if(n===0){if(b.dataset.emptyHidden!==\"1\"){b.dataset.emptyHidden=\"1\";b.style.display=\"none\";}}else if(b.dataset.emptyHidden===\"1\"){delete b.dataset.emptyHidden;b.style.removeProperty(\"display\");}});};hideEmpty();const hideTimers=[setTimeout(hideEmpty,400),setTimeout(hideEmpty,1400)];const hideObserver=new MutationObserver(()=>hideEmpty());hideObserver.observe(document.body,{childList:true,subtree:true});apply();const t1=window.setTimeout(apply,400);const t2=window.setTimeout(apply,1500);window.addEventListener(\"resize\",apply);const mo=new MutationObserver(()=>apply());mo.observe(document.body,{childList:true,subtree:true});return()=>{hideTimers.forEach(clearTimeout);hideObserver.disconnect();window.clearTimeout(t1);window.clearTimeout(t2);window.removeEventListener(\"resize\",apply);mo.disconnect();};},[railName,alsoName,align,inset,maxWidth,enabled,hideEmptyBlocks,blockName,cardName]);if(RenderTarget.current()!==RenderTarget.canvas)return null;return /*#__PURE__*/_jsxs(\"div\",{style:{padding:12,border:\"1px dashed #999\",borderRadius:8,fontSize:12,lineHeight:1.4,color:\"#666\",background:\"#f8f9fa\",fontFamily:\"system-ui, sans-serif\"},children:[\"Rail Snap \\xb7 snaps “\",railName,\"” and “\",alsoName,\"” rows to \",align,\" below\",\" \",maxWidth,\"px \\xb7 canvas only\"]});}addPropertyControls(RailSnap,{railName:{type:ControlType.String,title:\"Rail name\",defaultValue:\"Sessions\"},alsoName:{type:ControlType.String,title:\"Also snap\",defaultValue:\"Stimuli\"},align:{type:ControlType.Enum,title:\"Snap to\",options:[\"start\",\"center\"],defaultValue:\"start\"},inset:{type:ControlType.Number,title:\"Edge inset\",defaultValue:20,min:0,max:60},maxWidth:{type:ControlType.Number,title:\"Apply below\",defaultValue:900,min:320,max:1600},enabled:{type:ControlType.Boolean,title:\"Enabled\",defaultValue:true},hideEmptyBlocks:{type:ControlType.Boolean,title:\"Hide empty sources\",defaultValue:true},blockName:{type:ControlType.String,title:\"Block layer\",defaultValue:\"Source Block\"},cardName:{type:ControlType.String,title:\"Card layer\",defaultValue:\"Session Card\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RailSnap\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RailSnap.map"],"mappings":"A,iMAQG,SAAwBa,EAASC,EAAM,CAAC,GAAK,CAACC,WAAS,WAAWC,WAAS,UAAUC,QAAM,QAAQC,QAAM,GAAGC,WAAS,IAAIC,UAAQ,GAAKC,kBAAgB,GAAKC,YAAU,eAAeC,WAAS,gBAAgBT,EAE68B,OAFv8Bd,MAAc,CAAC,GAAUG,IAAS,QAAa,CAACiB,EAAQ,OAAO,IAAMI,EAAM,CAACT,EAASC,CAAQ,CAAC,CAAC,OAAO,OAAO,EAAQS,MAAUD,EAAM,QAAQE,GAAG,MAAM,KAAK,SAAS,iBAAiB,sBAAsBA,EAAE,GAAG,CAAC,CAAC,EAAQC,MAAU,CAAC,IAAMC,EAAGzB,EAAO,YAAYgB,EAASM,EAAM,CAAC,CAAC,QAAQI,GAAI,CAAC,IAAMC,EAAG,iBAAiBD,CAAE,EAAQE,GAASD,EAAG,YAAY,QAAQA,EAAG,YAAY,WAAWD,EAAG,YAAYA,EAAG,YAAY,EAAKD,GAAIG,GAASF,EAAG,MAAM,eAAe,cAAcA,EAAG,MAAM,kBAAkB,G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