{"version":3,"file":"GradientHighlightText.CCPyy-vQ.mjs","names":["React.useCallback","React.useMemo","__esmMin","pe","init_npm_react_18_3_1","ne","p","c","init_jsx_runtime","ce","addPropertyControls","useLocaleInfo","ControlType","init_framer_BL70qLPA","addSoftHyphens","value","word","part","vowels","points","index","previous","current","next","result","GradientHighlightText","props","lang","activeLocale","mergedFontFamily","font","mergedFontStyle","styleId","styleElement","normalizeColor","entry","hyphenationStyle","hyphenationEnabled","displayedBefore","before","displayedHighlight","highlight","displayedAfter","after","paragraphStyle","baseColor","textAlign","fontSize","lineHeight","letterSpacing","fontWeightBase","style","highlightPresentation","normalizedGradientColors","gradientColors","normalizedSolidColor","solidColor","fillType","fontWeightHighlight","fallbackColor","gradientAngle","color","init_GradientHighlightText"],"sources":["https:/framerusercontent.com/modules/6ookojjZxLrdMIg5dGYh/Zs0zsMCrmpQZm6YaLzbi/GradientHighlightText.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useLocaleInfo}from\"framer\";// User request: Fix highlight fill bug by normalizing color picker values that may arrive as objects, and add client-friendly controls for either a solid highlight color or a gradient highlight with angle + color pickers.\nfunction addSoftHyphens(value){return value.replace(/[A-Za-zÄÖÜäöüß]{8,}/g,word=>{if(/^Wasserversorgung$/i.test(word)){return word.replace(/Wasser/i,part=>part+\"\\xad\");}if(/^[A-ZÄÖÜß]+$/.test(word)||word.includes(\"\\xad\"))return word;const vowels=\"aeiouy\\xe4\\xf6\\xfcAEIOUY\\xc4\\xd6\\xdc\";const points=[];for(let index=3;index<word.length-2;index++){const previous=word[index-1];const current=word[index];const next=word[index+1];if(vowels.includes(previous)&&!vowels.includes(current)&&vowels.includes(next)&&word.length-index>=3){points.push(index);}}if(points.length===0)return word;let result=\"\";for(let index=0;index<word.length;index++){if(points.includes(index))result+=\"\\xad\";result+=word[index];}return result;});}/**\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,hyphenationEnabled}=props;const{activeLocale}=useLocaleInfo();const lang=activeLocale?.code??\"de\";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 hyphenationStyle=hyphenationEnabled?{hyphens:\"auto\",overflowWrap:\"anywhere\",wordBreak:\"break-word\"}:undefined;const displayedBefore=hyphenationEnabled?addSoftHyphens(before):before;const displayedHighlight=hyphenationEnabled?addSoftHyphens(highlight):highlight;const displayedAfter=hyphenationEnabled?addSoftHyphens(after):after;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,...hyphenationEnabled?{hyphens:\"auto\",WebkitHyphenateLimitBefore:3,WebkitHyphenateLimitAfter:3,WebkitHyphenateLimitChars:\"6 3 3\",hyphenateLimitChars:\"6 3 3\",overflowWrap:\"anywhere\",wordBreak:\"break-word\"}:{}};},[baseColor,textAlign,mergedFontFamily,mergedFontStyle,fontSize,font,lineHeight,letterSpacing,fontWeightBase,style,hyphenationEnabled]);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\",{lang:hyphenationEnabled?lang:undefined,style:paragraphStyle,children:[/*#__PURE__*/_jsx(\"span\",{lang:hyphenationEnabled?\"de\":undefined,style:hyphenationStyle,children:displayedBefore}),/*#__PURE__*/_jsx(\"span\",{className:highlightPresentation.useGradientClipClass?\"ght-gradient-clip\":undefined,style:{...highlightPresentation.style,...hyphenationStyle},lang:hyphenationEnabled?\"de\":undefined,children:displayedHighlight}),/*#__PURE__*/_jsx(\"span\",{lang:hyphenationEnabled?\"de\":undefined,style:hyphenationStyle,children:displayedAfter})]});}addPropertyControls(GradientHighlightText,{hyphenationEnabled:{type:ControlType.Boolean,title:\"Hyphenation\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},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\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GradientHighlightText.map"],"mappings":"A,uMACA,SAASc,EAAe,EAAM,CAAC,OAAOC,EAAM,QAAQ,uBAAuB,GAAM,CAAC,GAAG,sBAAsB,KAAKC,CAAI,EAAG,OAAOA,EAAK,QAAQ,UAAU,GAAMC,EAAK,GAAM,EAAG,GAAG,eAAe,KAAKD,CAAI,GAAGA,EAAK,SAAS,GAAM,EAAE,OAAOA,EAAK,IAAME,EAAO,qBAA6CC,EAAO,CAAC,EAAE,IAAI,IAAIC,EAAM,EAAEA,EAAMJ,EAAK,OAAO,EAAE,IAAQ,CAAC,IAAMK,EAASL,EAAKI,EAAM,GAASE,EAAQN,EAAKI,GAAaG,EAAKP,EAAKI,EAAM,GAAMF,EAAO,SAASG,CAAQ,GAAG,CAACH,EAAO,SAASI,CAAO,GAAGJ,EAAO,SAASK,CAAI,GAAGP,EAAK,OAAOI,GAAO,GAAGD,EAAO,KAAKC,CAAK,CAAG,CAAC,GAAGD,EAAO,SAAS,EAAE,OAAOH,EAAK,IAAIQ,EAAO,GAAG,IAAI,IAAIJ,EAAM,EAAEA,EAAMJ,EAAK,OAAO,IAAYG,EAAO,SAASC,CAAK,IAAE,GAAQ,KAAO,GAAQJ,EAAKI,GAAQ,OAAOI,CAAO,CAAC,CAAE,CAG3sB,SAAwBC,EAAsB,EAAM,CAAC,GAAK,CAAC,SAAO,YAAU,QAAM,WAA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