{"version":3,"file":"GradH1.DoRcyJ1c.mjs","names":["highlights","text","React.Fragment"],"sources":["https:/framerusercontent.com/modules/HrTqL7Xf7xmhtAoMheQe/kTh9T4JEnTzoPxDauueO/GradH1.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export function GradientHeadline(props){const{text,highlight,gradient,fontSize,lineHeight,color,textAlign,fontFamily}=props;const safeText=text||\"Your headline here\";const highlights=highlight?.split(\",\").map(s=>s.trim()).filter(Boolean)||[];function renderWithHighlights(text,highlights){if(highlights.length===0)return text;const escaped=highlights.map(h=>h.replace(/[-[\\]/{}()*+?.\\\\^$|]/g,\"\\\\$&\"));const regex=new RegExp(`(${escaped.join(\"|\")})`,\"gi\");const parts=text.split(regex);return parts.map((part,index)=>{const match=highlights.find(h=>h.toLowerCase()===part.toLowerCase());if(match){return /*#__PURE__*/_jsx(\"span\",{style:{background:gradient,WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundClip:\"text\",color:\"transparent\",display:\"inline\",fontWeight:400},children:part},index);}return /*#__PURE__*/_jsx(React.Fragment,{children:part},index);});}function renderLineBreaksWithHighlights(text,highlights){const lines=text.split(\"\\n\");return lines.map((line,lineIndex)=>/*#__PURE__*/_jsxs(React.Fragment,{children:[renderWithHighlights(line,highlights),lineIndex<lines.length-1&&/*#__PURE__*/_jsx(\"br\",{})]},lineIndex));}return /*#__PURE__*/_jsx(\"h1\",{style:{fontSize,lineHeight:`${lineHeight}px`,textAlign,color,fontFamily,fontWeight:400,margin:0,whiteSpace:\"normal\"},children:renderLineBreaksWithHighlights(safeText,highlights)});}addPropertyControls(GradientHeadline,{text:{type:ControlType.String,title:\"Full Text\",defaultValue:\"Unlocking the\\nPower of Sleep\",displayTextArea:true},highlight:{type:ControlType.String,title:\"Highlight Words\",defaultValue:\"Power of Sleep\",placeholder:\"Separate multiple with commas\"},gradient:{type:ControlType.String,title:\"Gradient\",defaultValue:\"linear-gradient(90deg, #1FDCB3, #4D3BCD)\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:48,min:10},lineHeight:{type:ControlType.Number,title:\"Line Height\",defaultValue:56,min:10},textAlign:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"left\"},color:{type:ControlType.Color,title:\"Fallback Color\",defaultValue:\"#000000\"},fontFamily:{type:ControlType.String,title:\"Font\",defaultValue:\"Gotham Book, sans-serif\",placeholder:\"e.g. Gotham Book, sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"GradientHeadline\":{\"type\":\"reactComponent\",\"name\":\"GradientHeadline\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GradH1.map"],"mappings":"iLAAyI,SAAgB,EAAiB,EAAM,CAAC,GAAK,CAAC,OAAK,YAAU,WAAS,WAAS,aAAW,QAAM,YAAU,cAAY,EAAY,EAAS,GAAM,qBAA2B,EAAW,GAAW,MAAM,IAAI,CAAC,IAAI,GAAG,EAAE,MAAM,CAAC,CAAC,OAAO,QAAQ,EAAE,EAAE,CAAC,SAAS,EAAqB,EAAK,EAAW,CAAC,GAAGA,EAAW,SAAS,EAAE,OAAOC,EAAK,IAAM,EAAQD,EAAW,IAAI,GAAG,EAAE,QAAQ,wBAAwB,OAAO,CAAC,CAAO,EAAU,OAAO,IAAI,EAAQ,KAAK,IAAI,CAAC,GAAG,KAAK,CAA+B,OAAlBC,EAAK,MAAM,EAAM,CAAc,KAAK,EAAK,IAAqBD,EAAW,KAAK,GAAG,EAAE,aAAa,GAAG,EAAK,aAAa,CAAC,CAA+B,EAAK,OAAO,CAAC,MAAM,CAAC,WAAW,EAAS,qBAAqB,OAAO,oBAAoB,cAAc,eAAe,OAAO,MAAM,cAAc,QAAQ,SAAS,WAAW,IAAI,CAAC,SA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