{"version":3,"file":"nmO3BT1ni.Co-RxFwT.mjs","names":["useMemo","parts"],"sources":["https:/framerusercontent.com/modules/VeDQFb9XcktzPuJyjY4y/zdkFHbKZMuSihtK8svWw/TextHighlighter.js","https:/framerusercontent.com/modules/lVFwhVKZOiHCIcbp9hrA/BKolKEAh4JSSjCMGUP1h/nmO3BT1ni.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * TextEditor\n *\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth any-prefer-auto\n * @framerSupportedLayoutHeight any-prefer-auto\n */export default function TextEditor(props){const{text,font,fontColor,highlightColor,variableFont,style,tag}=props;const regex=/\\{([^}]+)\\}/g;const parts=useMemo(()=>{const parts=[];let lastIndex=0;let match;while((match=regex.exec(text))!==null){if(match.index>lastIndex){parts.push({text:text.slice(lastIndex,match.index),highlight:false});}parts.push({text:match[1],highlight:true});lastIndex=regex.lastIndex;}if(lastIndex<text.length){parts.push({text:text.slice(lastIndex),highlight:false});}return parts;},[text]);const variableFontStyle=useMemo(()=>({fontVariationSettings:`'opsz' ${variableFont.opticalSize}, 'wght' ${variableFont.weight}`}),[variableFont.opticalSize,variableFont.weight]);const Tag=tag;return /*#__PURE__*/_jsx(Tag,{style:{...style,color:fontColor,...font,...variableFontStyle,whiteSpace:\"pre-wrap\",wordBreak:\"break-word\",margin:0,padding:0,display:\"block\",lineHeight:font.lineHeight||\"normal\",minWidth:style?.width?undefined:\"max-content\"},children:parts.map((part,i)=>part.highlight?/*#__PURE__*/_jsx(\"span\",{style:{color:highlightColor},children:part.text},i):/*#__PURE__*/_jsx(\"span\",{children:part.text},i))});}addPropertyControls(TextEditor,{tag:{type:ControlType.Enum,title:\"Tag\",options:[\"p\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"],optionTitles:[\"p\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"],defaultValue:\"p\"},text:{type:ControlType.String,title:\"Text\",description:\"Text put within {brackets} will be highlighted.\",displayTextArea:true,defaultValue:\"This is {highlighted} text.\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:22,variant:\"Regular\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},variableFont:{type:ControlType.Object,title:\"Variable\",controls:{opticalSize:{type:ControlType.Number,title:\"Optical\",min:14,max:32,defaultValue:14,step:1},weight:{type:ControlType.Number,title:\"Weight\",min:100,max:900,defaultValue:400,step:1}},defaultValue:{opticalSize:14,weight:400}},fontColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},highlightColor:{type:ControlType.Color,title:\"Highlight\",defaultValue:\"#FFFB8F\"}});TextEditor.displayName=\"Text Highlighter\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextEditor\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-auto\",\"framerDisableUnlink\":\"*\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextHighlighter.map","// Generated by Framer (0784c89)\nimport{fontStore}from\"framer\";fontStore.loadFonts([\"BI;Raveo Variable/variable/v0\",\"BI;Raveo Variable/variable/v0VF=Im9wc3oiIDE0LCAid2dodCIgNTUw\",\"BI;Raveo Variable/variable/v0VF=Im9wc3oiIDE0LCAid2dodCIgNTUw\",\"BI;Raveo Variable/variable/v0VF=Im9wc3oiIDE0LCAid2dodCIgNTUw\"]);const variationAxes=[{defaultValue:14,maxValue:32,minValue:14,name:\"Optical size\",tag:\"opsz\"},{defaultValue:400,maxValue:900,minValue:100,name:\"Weight\",tag:\"wght\"}];export const fonts=[{explicitInter:true,fonts:[{family:\"Raveo Variable\",source:\"builtIn\",style:\"normal\",url:\"https://framerusercontent.com/assets/JEdA86oNqHX1i1CLD92Q7jTxV8.woff2\",variationAxes,weight:\"1000\"}]}];export const css=['.framer-ZogxA .framer-styles-preset-yplpmu:not(.rich-text-wrapper), .framer-ZogxA .framer-styles-preset-yplpmu.rich-text-wrapper p { --framer-font-family: \"Raveo Variable Variable\", sans-serif; --framer-font-family-bold: \"Raveo Variable Variable\", sans-serif; --framer-font-family-bold-italic: \"Raveo Variable Variable\", sans-serif; --framer-font-family-italic: \"Raveo Variable Variable\", sans-serif; --framer-font-open-type-features: normal; --framer-font-size: 16px; --framer-font-style: normal; --framer-font-style-bold: normal; --framer-font-style-bold-italic: normal; --framer-font-style-italic: normal; --framer-font-variation-axes: \"opsz\" 14, \"wght\" 550; --framer-font-variation-axes-bold: \"opsz\" 14, \"wght\" 550; --framer-font-variation-axes-bold-italic: \"opsz\" 14, \"wght\" 550; --framer-font-variation-axes-italic: \"opsz\" 14, \"wght\" 550; --framer-font-weight: 1000; --framer-font-weight-bold: 1000; --framer-font-weight-bold-italic: 1000; --framer-font-weight-italic: 1000; --framer-letter-spacing: -0.01em; --framer-line-height: 1.5em; --framer-paragraph-spacing: 20px; --framer-text-alignment: left; --framer-text-color: var(--token-4fef9130-aa55-4351-8ed5-cfba481137a7, #ffffff); --framer-text-decoration: none; --framer-text-stroke-color: initial; --framer-text-stroke-width: initial; --framer-text-transform: none; }'];export const className=\"framer-ZogxA\";\nexport const __FramerMetadata__ = {\"exports\":{\"className\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"css\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"fonts\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"iLAOG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,OAAK,OAAK,YAAU,iBAAe,eAAa,QAAM,OAAK,EAAY,EAAM,eAAqB,EAAMA,MAAY,CAAC,IAAMC,EAAM,EAAE,CAAK,EA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