{"version":3,"file":"HighlightSweep.C-X-qM5s.mjs","names":["React.useRef","React.useState","__esmMin","init_ssg_sandbox_shims","init_npm_react_18_3_1","window","_e","de","init_jsx_runtime","ce","init_framer_DcxuU94H","addPropertyControls","ControlType","num","v","fallback","HighlightSweep","ref","on","setOn","node","io","entries","max","fontSize","min","minFontSize","lh","lineHeight","offset","barOffset","bar","barHeight","fluid","style","DISPLAY","highlight","duration","delay","text","init_HighlightSweep"],"sources":["https:/framerusercontent.com/modules/8hcFuJK8FTmowuiXC5Mn/ComVoag38Bu25iMNtOXX/HighlightSweep.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";const DISPLAY='\"TT Hoves Pro Trl Cnd Black\", \"Arial Narrow\", Impact, sans-serif';// Guard every numeric prop. A missing one makes clamp() or calc() invalid,\n// and the browser then drops the whole declaration rather than degrading.\nfunction num(v,fallback){const n=Number(v);return Number.isFinite(n)?n:fallback;}/**\n * Headline with a yellow bar that wipes in behind it, like a marker stroke.\n * Fires once when the block scrolls into view. Honours prefers-reduced-motion,\n * in which case the bar is simply already there.\n *\n * Geometry note: because box-decoration-break gives every line its own bar,\n * lineHeight must exceed barOffset + barHeight, or the next line's bar paints\n * over the bottom of the line above and clips the letterforms.\n *\n * Naming note: no property control here is called `width` or `height`, since\n * those collide with the layout props Framer injects into every component.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function HighlightSweep({text,fontSize,minFontSize,lineHeight,barHeight,barOffset,highlight,color,delay,duration,style}){const ref=React.useRef(null);const[on,setOn]=React.useState(false);React.useEffect(()=>{const node=ref.current;if(!node)return;const reduce=typeof window!==\"undefined\"&&window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches;if(reduce){setOn(true);return;}const io=new IntersectionObserver(entries=>{if(entries.some(e=>e.isIntersecting)){setOn(true);io.disconnect();}},{threshold:.35});io.observe(node);return()=>io.disconnect();},[]);const max=num(fontSize,64);const min=Math.min(num(minFontSize,34),max);const lh=num(lineHeight,1.06);const offset=num(barOffset,.16);// Never let the bar reach past the line box, or it clips the line above.\nconst bar=Math.max(.1,Math.min(num(barHeight,.84),lh-offset-.04));const fluid=`clamp(${min}px, ${(max/1200*100).toFixed(2)}vw, ${max}px)`;return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{width:\"100%\",...style},children:/*#__PURE__*/_jsx(\"span\",{style:{position:\"relative\",display:\"inline\",fontFamily:DISPLAY,fontSize:fluid,lineHeight:`${lh}em`,letterSpacing:\"-0.03em\",color,backgroundImage:`linear-gradient(${highlight}, ${highlight})`,backgroundRepeat:\"no-repeat\",backgroundPosition:`0 ${offset}em`,backgroundSize:on?`100% ${bar}em`:`0% ${bar}em`,transition:`background-size ${num(duration,900)}ms cubic-bezier(0.16, 1, 0.3, 1) ${num(delay,150)}ms`,boxDecorationBreak:\"clone\",WebkitBoxDecorationBreak:\"clone\",padding:\"0 0.06em\"},children:text})});}HighlightSweep.defaultProps={text:\"Give to the theatre that stays with you.\",fontSize:64,minFontSize:34,lineHeight:1.06,barHeight:.84,barOffset:.16,highlight:\"rgb(238, 242, 0)\",color:\"rgb(0, 0, 0)\",delay:150,duration:900};addPropertyControls(HighlightSweep,{text:{type:ControlType.String,title:\"Text\",displayTextArea:true},fontSize:{type:ControlType.Number,title:\"Max size\",min:16,max:200,step:2,unit:\"px\"},minFontSize:{type:ControlType.Number,title:\"Min size\",min:12,max:120,step:2,unit:\"px\"},lineHeight:{type:ControlType.Number,title:\"Line height\",min:.8,max:2,step:.01,description:\"Must exceed bar top plus bar height\"},barHeight:{type:ControlType.Number,title:\"Bar height\",min:.2,max:1.4,step:.02},barOffset:{type:ControlType.Number,title:\"Bar top\",min:0,max:.6,step:.02},highlight:{type:ControlType.Color,title:\"Bar\"},color:{type:ControlType.Color,title:\"Text colour\"},delay:{type:ControlType.Number,title:\"Delay\",min:0,max:2e3,step:50,unit:\"ms\"},duration:{type:ControlType.Number,title:\"Duration\",min:200,max:3e3,step:50,unit:\"ms\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HighlightSweep\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HighlightSweep.map"],"mappings":"A,iMAEA,SAASa,EAAI,EAAE,EAAS,CAAC,IAAM,EAAE,OAAOC,CAAC,EAAE,OAAO,OAAO,SAAS,CAAC,EAAE,EAAEC,CAAS,CAc7E,SAAwBC,EAAe,CAAC,OAAK,WAAS,cAAY,aAAW,YAAU,YAAU,YAAU,QAAM,QAAM,WAAS,SAAO,CAAC,IAAMC,EAAIjB,EAAa,IAAI,EAAO,CAACkB,EAAGC,GAAOlB,EAAe,EAAK,EAAEQ,MAAoB,CAAC,IAAMW,EAAKH,EAAI,QAAQ,GAAG,CAACG,EAAK,OAAiH,GAAtFf,IAAS,QAAaA,EAAO,aAAa,kCAAkC,CAAC,CAAC,QAAkB,CAACc,EAAM,EAAI,EAAE,MAAO,CAAC,IAAME,EAAG,IAAI,qBAAqB,GAAS,CAAIC,EAAQ,KAAK,GAAG,EAAE,cAAc,IAAGH,EAAM,EAAI,EAAEE,EAAG,WAAW,EAAG,EAAE,CAAC,UAAU,GAAG,CAAC,EAAmB,OAAjBA,EAAG,QAAQD,CAAI,MAAYC,EAAG,WAAW,CAAE,EAAE,CAAC,CAAC,EAAE,IAAME,EAAIV,EAAIW,EAAS,EAAE,EAAQC,EAAI,KAAK,IAAIZ,EAAIa,EAAY,EAAE,EAAEH,CAAG,EAAQI,EAAGd,EAAIe,EAAW,IAAI,EAAQC,EAAOhB,EAAIiB,EAAU,GAAG,EACnsBC,EAAI,KAAK,IAAI,GAAG,KAAK,IAAIlB,EAAImB,EAAU,GAAG,EAAEL,EAAGE,EAAO,GAAG,CAAC,EAAQI,EAA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