{"version":3,"file":"GradientText.DoscD6be.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/23p2soLbGzfRoGSrMpbA/T4Rl4mahA7RomQK7vlnO/GradientText.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect}from\"react\";function GradientText(props){const{text=\"Understand how AI talks about your brand\",textDK=\"\",highlightWords=\"AI talks\",highlightWordsDK=\"\",baseColor=\"rgb(2, 10, 15)\",highlightColor1=\"rgb(94, 67, 217)\",highlightColor2=\"rgb(27, 101, 190)\",fontSize=64,fontWeight=600,lineHeight=1.2,textAlign=\"center\",tag=\"h1\",style}=props;// Post-mount settling re-render.\n// Forces one extra render pass after hydration so React reconciles\n// any layout state. On Danish locale this happens naturally because\n// the text swaps from English (server-rendered) to Danish (client),\n// which triggers a re-render. On English no swap happens, so without\n// this hook the layout never gets the same reconciliation pass and\n// subtle inconsistencies persist as scroll-jumping bugs.\n// To revert: delete the useState line and the useEffect block below.\nconst[,setHydrated]=useState(false);useEffect(()=>{setHydrated(true);},[]);// Detect locale — Framer sets html[lang] on locale pages\nlet isDK=false;if(typeof document!==\"undefined\"){const lang=document.documentElement.lang;const path=window.location.pathname;isDK=lang===\"da\"||lang===\"da-DK\"||path.startsWith(\"/dk/\")||path===\"/dk\";}const activeText=isDK&&textDK?textDK:text;const activeHighlightWords=isDK&&highlightWordsDK?highlightWordsDK:highlightWords;const highlights=activeHighlightWords.split(\",\").map(w=>w.trim()).filter(Boolean);const Tag=tag;const renderText=()=>{if(highlights.length===0)return activeText;let remaining=activeText;const parts=[];let keyIndex=0;for(const word of highlights){const idx=remaining.toLowerCase().indexOf(word.toLowerCase());if(idx===-1)continue;if(idx>0){parts.push(/*#__PURE__*/_jsx(\"span\",{children:remaining.substring(0,idx)},keyIndex++));}parts.push(/*#__PURE__*/_jsx(\"span\",{style:{background:`linear-gradient(135deg, ${highlightColor1}, ${highlightColor2})`,WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundClip:\"text\"},children:remaining.substring(idx,idx+word.length)},keyIndex++));remaining=remaining.substring(idx+word.length);}if(remaining){parts.push(/*#__PURE__*/_jsx(\"span\",{children:remaining},keyIndex++));}return parts.length>0?parts:activeText;};return /*#__PURE__*/_jsx(Tag,{style:{margin:0,fontFamily:\"'Inter', sans-serif\",fontSize,fontWeight,lineHeight,textAlign,color:baseColor,letterSpacing:\"-0.02em\",// NOTE: removed `width: \"100%\"` so the rendered tag respects\n// whatever width the Framer wrapper layer is set to,\n// instead of always filling its parent. This prevents a\n// layout-flicker bug where the wrapper width and inner\n// tag width could disagree on mobile (e.g. wrapper at 66%\n// vs inner at 100% caused the heading to resize on scroll\n// on /agency English).\n// To revert: add `width: \"100%\",` back here.\n...style},children:renderText()});}addPropertyControls(GradientText,{text:{title:\"Text\",type:ControlType.String,defaultValue:\"Understand how AI talks about your brand\"},textDK:{title:\"Text\",type:ControlType.String,defaultValue:\"\",description:\"Danish (DK) version of the text. Leave empty to use EN.\"},highlightWords:{title:\"Highlight Words\",type:ControlType.String,defaultValue:\"AI talks\",description:\"Comma-separated words to highlight (EN)\"},highlightWordsDK:{title:\"Highlight Words\",type:ControlType.String,defaultValue:\"\",description:\"Comma-separated words to highlight (DK). Leave empty to use EN.\"},baseColor:{title:\"Base Color\",type:ControlType.Color,defaultValue:\"rgb(2, 10, 15)\"},highlightColor1:{title:\"Gradient Start\",type:ControlType.Color,defaultValue:\"rgb(94, 67, 217)\"},highlightColor2:{title:\"Gradient End\",type:ControlType.Color,defaultValue:\"rgb(27, 101, 190)\"},fontSize:{title:\"Font Size\",type:ControlType.Number,defaultValue:64,min:12,max:120,step:1},fontWeight:{title:\"Font Weight\",type:ControlType.Number,defaultValue:600,min:100,max:900,step:100},lineHeight:{title:\"Line Height\",type:ControlType.Number,defaultValue:1.2,min:.8,max:2,step:.05},textAlign:{title:\"Text Align\",type:ControlType.Enum,defaultValue:\"center\",options:[\"left\",\"center\",\"right\"],displaySegmentedControl:true},tag:{title:\"HTML Tag\",type:ControlType.Enum,defaultValue:\"h1\",options:[\"h1\",\"h2\",\"h3\",\"h4\",\"p\"]}});export default GradientText;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GradientText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GradientText.map"],"mappings":"2LAAqI,SAAS,EAAa,EAAM,CAAC,GAAK,CAAC,OAAK,2CAA2C,SAAO,GAAG,iBAAe,WAAW,mBAAiB,GAAG,YAAU,iBAAiB,kBAAgB,mBAAmB,kBAAgB,oBAAoB,WAAS,GAAG,aAAW,IAAI,aAAW,IAAI,YAAU,SAAS,MAAI,KAAK,SAAO,EAQ1b,EAAE,GAAaA,EAAS,GAAM,CAAC,MAAc,CAAC,EAAY,GAAK,EAAG,EAAE,CAAC,CAC1E,IAAI,EAAK,GAAM,GAAG,OAAO,SAAW,IAAY,CAAC,IAAM,EAAK,SAAS,gBAAgB,KAAW,EAAK,EAAO,SAAS,SAAS,EAAK,IAAO,MAAM,IAAO,SAAS,EAAK,WAAW,OAAO,EAAE,IAAO,MAAO,IAAM,EAAW,GAAM,EAAO,EAAO,EAA6F,GAA7D,GAAM,EAAiB,EAAiB,GAAqD,MAAM,IAAI,CAAC,IAAI,GAAG,EAAE,MAAM,CAAC,CAAC,OAAO,QAAQ,CAAO,EAAI,EAAU,MAAe,CAAC,GAAG,EAAW,SAAS,EAAE,OAAO,EAAW,IAAI,EAAU,EAAiB,EAAM,EAAE,CAAK,EAAS,EAAE,IAAI,IAAM,KAAQ,EAAW,CAAC,IAAM,EAAI,EAAU,aAAa,CAAC,QAAQ,EAAK,aAAa,CAAC,CAAI,IAAM,KAAe,EAAI,GAAG,EAAM,KAAkB,EAAK,OAAO,CAAC,SAAS,EAAU,UAAU,EAAE,EAAI,CAAC,CAAC,IAAW,CAAC,CAAE,EAAM,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