{"version":3,"file":"Breadcrumbs.CsWM_UnD.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/8YhJnwrJB1CJoeiJ15LG/MHX8U16qU9CBp91GACW1/Breadcrumbs.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * @framerDisableUnlink\n */export default function Breadcrumbs(props){const{showLevel1=true,level1Label=\"Home\",level1Url=\"/\",showLevel2=true,level2Label=\"Products\",level2Url=\"/products\",showLevel3=true,level3Label=\"Electronics\",level3Url=\"/products/electronics\",showLevel4=true,level4Label=\"Smartphones\",level4Url=\"/products/electronics/smartphones\",config={separator:\"chevron\",showEllipsis:true,maxItems:4,truncateLimit:20},container={showBackground:true,backgroundColor:\"#F5F5F5\",padding:\"12px 16px\",borderRadius:8},colors={textColor:\"#666666\",linkColor:\"#0066FF\",linkHoverColor:\"#0044CC\",currentPageColor:\"#000000\",separatorColor:\"#CCCCCC\"},font,style}=props;const{separator,showEllipsis,maxItems,truncateLimit}=config;// Fonction de troncature\nconst truncate=(text,limit)=>{if(!text||limit<=0||text.length<=limit)return text;return text.slice(0,limit)+\"…\";};// Construction des items\nconst items=useMemo(()=>{const breadcrumbItems=[];if(showLevel1)breadcrumbItems.push({label:level1Label,url:level1Url});if(showLevel2)breadcrumbItems.push({label:level2Label,url:level2Url});if(showLevel3)breadcrumbItems.push({label:level3Label,url:level3Url});if(showLevel4)breadcrumbItems.push({label:level4Label,url:level4Url});return breadcrumbItems;},[showLevel1,level1Label,level1Url,showLevel2,level2Label,level2Url,showLevel3,level3Label,level3Url,showLevel4,level4Label,level4Url]);// Logique d'affichage (Ellipsis + Troncature)\nconst processedItems=useMemo(()=>{let currentItems=[...items];// Appliquer la troncature uniquement sur le dernier élément\nif(currentItems.length>0&&truncateLimit>0){const lastIdx=currentItems.length-1;currentItems[lastIdx]={...currentItems[lastIdx],label:truncate(currentItems[lastIdx].label,truncateLimit)};}if(!showEllipsis||currentItems.length<=maxItems)return currentItems;if(maxItems<=2)return currentItems.length>0?[currentItems[0],currentItems[currentItems.length-1]]:currentItems;const firstItem=currentItems[0];const lastItems=currentItems.slice(-(maxItems-2));return[firstItem,{label:\"...\",url:\"\"},...lastItems];},[items,showEllipsis,maxItems,truncateLimit]);const separatorIcons={chevron:\"›\",slash:\"/\",dot:\"•\"};// Vérification de la largeur définie par Framer\nconst isFixedWidth=style?.width===\"100%\";if(items.length===0)return null;return(// 1. RACINE : Reçoit uniquement le style de positionnement de Framer\n/*#__PURE__*/_jsx(\"nav\",{style:style,children:/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",alignItems:\"center\",flexWrap:\"wrap\",width:isFixedWidth?\"100%\":\"max-content\",// Styles du conteneur\n...container.showBackground&&{backgroundColor:container.backgroundColor,padding:container.padding,borderRadius:`${container.borderRadius}px`},// Styles de police hérités\n...font},children:/*#__PURE__*/_jsx(\"ol\",{style:{display:\"flex\",alignItems:\"center\",flexWrap:\"wrap\",gap:\"8px\",listStyle:\"none\",margin:0,padding:0},children:processedItems.map((item,index)=>{const isLast=index===processedItems.length-1;const isEllipsis=item.label===\"...\";const isClickable=!isLast&&!isEllipsis&&item.url;return /*#__PURE__*/_jsxs(\"li\",{style:{display:\"flex\",alignItems:\"center\",gap:\"8px\"},children:[isEllipsis?/*#__PURE__*/_jsx(\"span\",{style:{color:colors.separatorColor},children:item.label}):isClickable?/*#__PURE__*/_jsx(\"button\",{onClick:()=>{if(typeof window!==\"undefined\"&&item.url){if(/^https?:\\/\\/|^\\/|^\\?|^#/.test(item.url))window.open(item.url,\"_self\");}},style:{color:colors.linkColor,textDecoration:\"none\",cursor:\"pointer\",background:\"none\",border:\"none\",padding:0,font:\"inherit\",transition:\"color 0.2s\"},onMouseEnter:e=>{e.currentTarget.style.textDecoration=\"underline\";e.currentTarget.style.color=colors.linkHoverColor;},onMouseLeave:e=>{e.currentTarget.style.textDecoration=\"none\";e.currentTarget.style.color=colors.linkColor;},children:item.label}):/*#__PURE__*/_jsx(\"span\",{style:{color:isLast?colors.currentPageColor:colors.textColor,fontWeight:isLast?\"600\":\"inherit\"},children:item.label}),!isLast&&/*#__PURE__*/_jsx(\"span\",{style:{color:colors.separatorColor},children:separatorIcons[separator]})]},`${item.label}-${index}`);})})})}));}addPropertyControls(Breadcrumbs,{showLevel1:{type:ControlType.Boolean,title:\"Niveau 1\",defaultValue:true},level1Label:{type:ControlType.String,title:\"↳ Label 1\",defaultValue:\"Home\",hidden:p=>!p.showLevel1},level1Url:{type:ControlType.Link,title:\"↳ URL 1\",defaultValue:\"/\",hidden:p=>!p.showLevel1},showLevel2:{type:ControlType.Boolean,title:\"Niveau 2\",defaultValue:true},level2Label:{type:ControlType.String,title:\"↳ Label 2\",defaultValue:\"Products\",hidden:p=>!p.showLevel2},level2Url:{type:ControlType.Link,title:\"↳ URL 2\",defaultValue:\"/products\",hidden:p=>!p.showLevel2},showLevel3:{type:ControlType.Boolean,title:\"Niveau 3\",defaultValue:true},level3Label:{type:ControlType.String,title:\"↳ Label 3\",defaultValue:\"Electronics\",hidden:p=>!p.showLevel3},level3Url:{type:ControlType.Link,title:\"↳ URL 3\",defaultValue:\"/products/electronics\",hidden:p=>!p.showLevel3},showLevel4:{type:ControlType.Boolean,title:\"Niveau 4\",defaultValue:true},level4Label:{type:ControlType.String,title:\"↳ Label 4\",defaultValue:\"Smartphones\",hidden:p=>!p.showLevel4},level4Url:{type:ControlType.Link,title:\"↳ URL 4\",defaultValue:\"/products/electronics/smartphones\",hidden:p=>!p.showLevel4},config:{type:ControlType.Object,title:\"Options\",controls:{separator:{type:ControlType.Enum,title:\"S\\xe9parateur\",options:[\"chevron\",\"slash\",\"dot\"],defaultValue:\"chevron\",displaySegmentedControl:true},showEllipsis:{type:ControlType.Boolean,title:\"Ellipsis\",defaultValue:true},maxItems:{type:ControlType.Number,title:\"Max Items\",defaultValue:4,min:2,max:10,hidden:p=>!p.showEllipsis},truncateLimit:{type:ControlType.Number,title:\"Couper \\xe0 (caract.)\",defaultValue:20,min:0,max:100,help:\"0 = pas de limite\"}}},container:{type:ControlType.Object,title:\"Apparence\",controls:{showBackground:{type:ControlType.Boolean,title:\"Fond\",defaultValue:true},backgroundColor:{type:ControlType.Color,title:\"Couleur\",defaultValue:\"#F5F5F5\",hidden:p=>!p.showBackground},borderRadius:{type:ControlType.Number,title:\"Rayon\",defaultValue:8,hidden:p=>!p.showBackground},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"12px 16px\",hidden:p=>!p.showBackground}}},colors:{type:ControlType.Object,title:\"Couleurs\",controls:{textColor:{type:ControlType.Color,title:\"Texte\",defaultValue:\"#666666\"},linkColor:{type:ControlType.Color,title:\"Liens\",defaultValue:\"#0066FF\"},linkHoverColor:{type:ControlType.Color,title:\"Survol\",defaultValue:\"#0044CC\"},currentPageColor:{type:ControlType.Color,title:\"Actif\",defaultValue:\"#000000\"},separatorColor:{type:ControlType.Color,title:\"S\\xe9parateur\",defaultValue:\"#CCCCCC\"}}},font:{type:ControlType.Font,title:\"Police\",controls:\"extended\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Breadcrumbs\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Breadcrumbs.map"],"mappings":"gMAEG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,aAAW,GAAK,cAAY,OAAO,YAAU,IAAI,aAAW,GAAK,cAAY,WAAW,YAAU,YAAY,aAAW,GAAK,cAAY,cAAc,YAAU,wBAAwB,aAAW,GAAK,cAAY,cAAc,YAAU,oCAAoC,SAAO,CAAC,UAAU,UAAU,aAAa,GAAK,SAAS,EAAE,cAAc,EAAE,EAAE,YAAU,CAAC,eAAe,GAAK,gBAAgB,UAAU,QAAQ,YAAY,aAAa,CAAC,EAAE,SAAO,CAAC,UAAU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