{"version":3,"file":"GradientHighlightText.BT_x73MN.mjs","names":["React.useCallback","React.useMemo"],"sources":["https:/framerusercontent.com/modules/9Q0KYR6hnIBD1iIJTftr/Tki4Un3fPwBPLBAqrrXg/GradientHighlightText.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function GradientHighlightText(props){const{before,highlight,after,fillType,solidColor,gradientAngle,gradientColors,baseColor,font,fontSize,lineHeight,letterSpacing,textAlign,fontWeightBase,fontWeightHighlight,style}=props;const mergedFontFamily=font?.fontFamily||\"Manrope\";const mergedFontStyle=font?.fontStyle||\"normal\";React.useEffect(()=>{if(typeof document===\"undefined\")return;const styleId=\"ght-gradient-clip-style\";if(document.getElementById(styleId))return;const styleElement=document.createElement(\"style\");styleElement.id=styleId;styleElement.textContent=`\n            .ght-gradient-clip {\n                background-clip: text;\n                -webkit-background-clip: text;\n                -webkit-text-fill-color: transparent;\n                color: transparent;\n            }\n        `;document.head.appendChild(styleElement);},[]);const normalizeColor=React.useCallback(entry=>{if(typeof entry===\"string\"&&entry.trim().length>0)return entry;if(entry&&typeof entry===\"object\"){if(typeof entry.value===\"string\"&&entry.value.trim().length>0)return entry.value;if(typeof entry.color===\"string\"&&entry.color.trim().length>0)return entry.color;}return null;},[]);const paragraphStyle=React.useMemo(()=>{return{position:\"relative\",margin:0,width:\"100%\",color:baseColor,textAlign:textAlign??font?.textAlign??\"center\",fontFamily:mergedFontFamily,fontStyle:mergedFontStyle,fontSize:fontSize??(font?.fontSize)??60,lineHeight:lineHeight??(font?.lineHeight)??\"130%\",letterSpacing:letterSpacing??(font?.letterSpacing)??\"0em\",fontWeight:fontWeightBase??400,whiteSpace:\"pre-wrap\",overflowWrap:\"break-word\",...style};},[baseColor,textAlign,mergedFontFamily,mergedFontStyle,fontSize,font,lineHeight,letterSpacing,fontWeightBase,style]);const highlightPresentation=React.useMemo(()=>{const fallbackGradientColors=[\"rgb(108, 188, 211)\",\"rgb(120, 210, 175)\",\"rgb(150, 224, 120)\",\"rgb(214, 232, 90)\"];const normalizedGradientColors=(gradientColors&&gradientColors.length>0?gradientColors:fallbackGradientColors).map(entry=>normalizeColor(entry)).filter(value=>Boolean(value));const normalizedSolidColor=normalizeColor(solidColor)||\"rgb(120, 210, 175)\";if(fillType===\"solid\"){return{style:{color:normalizedSolidColor,WebkitTextFillColor:normalizedSolidColor,fontWeight:fontWeightHighlight??600},useGradientClipClass:false};}if(normalizedGradientColors.length<=1){const fallbackColor=normalizedGradientColors[0]||normalizedSolidColor;return{style:{color:fallbackColor,WebkitTextFillColor:fallbackColor,fontWeight:fontWeightHighlight??600},useGradientClipClass:false};}const backgroundValue=`linear-gradient(${gradientAngle??90}deg, ${normalizedGradientColors.map((color,index)=>{const stop=index/(normalizedGradientColors.length-1)*100;return`${color} ${stop}%`;}).join(\", \")})`;return{style:{backgroundImage:backgroundValue,fontWeight:fontWeightHighlight??600},useGradientClipClass:true};},[fillType,gradientAngle,gradientColors,solidColor,fontWeightHighlight,normalizeColor]);return /*#__PURE__*/_jsxs(\"p\",{style:paragraphStyle,children:[/*#__PURE__*/_jsx(\"span\",{children:before}),/*#__PURE__*/_jsx(\"span\",{className:highlightPresentation.useGradientClipClass?\"ght-gradient-clip\":undefined,style:highlightPresentation.style,children:highlight}),/*#__PURE__*/_jsx(\"span\",{children:after})]});}addPropertyControls(GradientHighlightText,{before:{type:ControlType.String,title:\"Before\",displayTextArea:true,defaultValue:\"Jeder 3. Verbraucher plant, in den n\\xe4chsten 12 Monaten den Energieversorger zu wechseln. \"},highlight:{type:ControlType.String,title:\"Highlight\",displayTextArea:true,defaultValue:\"40 % davon wegen fehlendem Dialog oder Servicequalit\\xe4t\"},after:{type:ControlType.String,title:\"After\",displayTextArea:true,defaultValue:\".\"},fillType:{type:ControlType.Enum,title:\"Highlight Fill\",options:[\"solid\",\"gradient\"],optionTitles:[\"Solid\",\"Gradient\"],defaultValue:\"gradient\"},solidColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"rgb(120, 210, 175)\",hidden:props=>props.fillType!==\"solid\"},gradientAngle:{type:ControlType.Number,title:\"Angle\",min:0,max:360,step:1,unit:\"deg\",defaultValue:90,hidden:props=>props.fillType!==\"gradient\"},gradientColors:{type:ControlType.Array,title:\"Gradient Colors\",maxCount:8,defaultValue:[\"rgb(108, 188, 211)\",\"rgb(120, 210, 175)\",\"rgb(150, 224, 120)\",\"rgb(214, 232, 90)\"],control:{type:ControlType.Color,defaultValue:\"rgb(108, 188, 211)\"},hidden:props=>props.fillType!==\"gradient\"},baseColor:{type:ControlType.Color,title:\"Base Color\",defaultValue:\"rgb(20, 28, 41)\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:60,variant:\"Regular\",lineHeight:\"130%\",letterSpacing:\"0em\",textAlign:\"center\"}},fontSize:{type:ControlType.Number,title:\"Size\",min:8,max:200,unit:\"px\",step:1,defaultValue:60},lineHeight:{type:ControlType.String,title:\"Line Height\",defaultValue:\"130%\"},letterSpacing:{type:ControlType.String,title:\"Letter Sp\",defaultValue:\"0em\"},textAlign:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\"},fontWeightBase:{type:ControlType.Number,title:\"Weight Base\",min:100,max:900,step:100,defaultValue:400},fontWeightHighlight:{type:ControlType.Number,title:\"Weight High\",min:100,max:900,step:100,defaultValue:600}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GradientHighlightText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./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