{"version":3,"file":"TextIcon.TceKnnSt.mjs","names":["parts"],"sources":["https:/framerusercontent.com/modules/U3rELnG1mPk7rEtnDlwQ/QUtAMoh9jO3LAyYGJe94/TextIcon.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";export default function TextWithIcons(props){const{text,fontSize,lineHeight,color,iconSize,iconVerticalOffset,font,icons,textAlign,letterSpacing}=props;const parseText=input=>{const parts=[];const regex=/\\{\\{(\\d+)\\}\\}/g;let lastIndex=0;let match;while((match=regex.exec(input))!==null){if(match.index>lastIndex){parts.push({type:\"text\",content:input.substring(lastIndex,match.index)});}const iconIndex=parseInt(match[1]);parts.push({type:\"icon\",index:iconIndex,image:icons[iconIndex]||null});lastIndex=regex.lastIndex;}if(lastIndex<input.length){parts.push({type:\"text\",content:input.substring(lastIndex)});}return parts;};const parts=parseText(text);const containerStyle={fontSize:fontSize,lineHeight:lineHeight,color:color,display:\"block\",whiteSpace:\"pre-wrap\",textAlign:textAlign,fontFamily:font?.fontFamily,fontWeight:font?.fontWeight,fontStyle:font?.fontStyle,letterSpacing:`${letterSpacing}em`,textTransform:font?.textTransform};return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:parts.map((part,index)=>{if(part.type===\"text\"){return /*#__PURE__*/_jsx(\"span\",{children:part.content},index);}else{return part.image?/*#__PURE__*/_jsx(\"img\",{src:part.image,alt:\"\",style:{width:iconSize,height:iconSize,display:\"inline-block\",verticalAlign:\"baseline\",transform:`translateY(${iconVerticalOffset}px)`,margin:\"0 4px\"}},index):null;}})});}TextWithIcons.defaultProps={text:\"I interview the candidates {{0}} day or {{1}} night.\",fontSize:22,lineHeight:1.5,color:\"#FFFFFF\",iconSize:24,iconVerticalOffset:4,font:\"Inter\",icons:[],textAlign:\"left\",letterSpacing:0};addPropertyControls(TextWithIcons,{text:{type:ControlType.String,title:\"Texte\",displayTextArea:true,description:\"Utilisez {{0}}, {{1}}, {{2}}... pour les ic\\xf4nes\"},icons:{type:ControlType.Array,title:\"Ic\\xf4nes\",control:{type:ControlType.Image}},font:{type:ControlType.Font,title:\"Police\"},fontSize:{type:ControlType.Number,title:\"Taille police\",min:10,max:1e3,step:1},lineHeight:{type:ControlType.Number,title:\"Hauteur ligne\",min:-2,max:3,step:.05},letterSpacing:{type:ControlType.Number,title:\"Letter Spacing\",min:-.2,max:1,step:.01,displayStepper:true,description:\"En em (0 = normal, -0.05 = serr\\xe9, 0.1 = a\\xe9r\\xe9)\"},color:{type:ControlType.Color,title:\"Couleur\"},textAlign:{type:ControlType.Enum,title:\"Alignement\",options:[\"left\",\"center\",\"right\",\"justify\"],optionTitles:[\"Gauche\",\"Centre\",\"Droite\",\"Justifi\\xe9\"],displaySegmentedControl:true},iconSize:{type:ControlType.Number,title:\"Taille ic\\xf4ne\",min:12,max:640,step:1},iconVerticalOffset:{type:ControlType.Number,title:\"D\\xe9calage vertical\",min:-20,max:20,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextWithIcons\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextIcon.map"],"mappings":"4JAA+F,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,OAAK,WAAS,aAAW,QAAM,WAAS,qBAAmB,OAAK,QAAM,YAAU,iBAAe,EAAme,GAA7c,GAAO,CAAC,IAAMA,EAAM,EAAE,CAAO,EAAM,iBAAqB,EAAU,EAAM,EAAM,MAAO,EAAM,EAAM,KAAK,EAAM,IAAI,MAAK,CAAI,EAAM,MAAM,GAAW,EAAM,KAAK,CAAC,KAAK,OAAO,QAAQ,EAAM,UAAU,EAAU,EAAM,MAAM,CAAC,CAAC,CAAE,IAAM,EAAU,SAAS,EAAM,GAAG,CAAC,EAAM,KAAK,CAAC,KAAK,OAAO,MAAM,EAAU,MAAM,EAAM,IAAY,KAAK,CAAC,CAAC,EAAU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