{"version":3,"file":"BreadcrumbsCode.6QHNhA3O.mjs","names":["useMemo","useCallback"],"sources":["https:/framerusercontent.com/modules/CwuUkUk8PbksSKplj700/nra6Arsksv5R71KJB54i/BreadcrumbsCode.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget,useLocaleInfo}from\"framer\";import{useMemo,useCallback}from\"react\";// Locale-aware links: the site serves locales under URL prefixes. A crumb link\n// like \"/customers\" must become \"/nl/customers\" on the Dutch site, otherwise\n// breadcrumbs silently kick visitors back to the English pages.\nconst LOCALE_SEGMENTS=[\"nl\",\"de\",\"fr\",\"es\",\"it\",\"uk\",\"us\"];const LOCALE_CODE_TO_PREFIX={nl:\"/nl\",de:\"/de\",fr:\"/fr\",es:\"/es\",it:\"/it\",\"en-gb\":\"/uk\",\"en-us\":\"/us\",uk:\"/uk\",us:\"/us\"};function currentLocalePrefix(localeCode){const code=(localeCode||\"\").toLowerCase();if(code&&LOCALE_CODE_TO_PREFIX[code])return LOCALE_CODE_TO_PREFIX[code];if(code)return\"\"// default locale (EU English) lives at the root\n;// Fallback for contexts without locale info: derive from the URL.\nif(typeof window!==\"undefined\"){const seg=(window.location.pathname.split(\"/\")[1]||\"\").toLowerCase();if(LOCALE_SEGMENTS.includes(seg))return\"/\"+seg;}return\"\";}function localizeLink(link,prefix){if(!prefix||!link)return link;if(!link.startsWith(\"/\"))return link// absolute/externe links onaangeroerd\n;const seg=(link.split(\"/\")[1]||\"\").toLowerCase();if(LOCALE_SEGMENTS.includes(seg))return link// al geprefixt\n;return link===\"/\"?prefix+\"/\":prefix+link;}const DEFAULT_ITEMS=[{title:\"Home\",link:\"/\"},{title:\"Resources\",link:\"/resources\"},{title:\"Merch Calendar\",link:\"/merch-calendar\"}];function unwrapValue(input){if(input&&typeof input===\"object\"&&\"value\"in input){return unwrapValue(input.value);}return input;}function toStringValue(input){const unwrapped=unwrapValue(input);return typeof unwrapped===\"string\"?unwrapped:\"\";}function toNumberValue(input,fallback){const unwrapped=unwrapValue(input);return typeof unwrapped===\"number\"&&Number.isFinite(unwrapped)?unwrapped:fallback;}function normalizeAlign(input){const value=toStringValue(input).toLowerCase();if(value===\"center\")return\"center\";if(value===\"right\")return\"right\";return\"left\";}function isColorLike(value){const v=value.trim().toLowerCase();return v.startsWith(\"#\")||v.startsWith(\"rgb\")||v.startsWith(\"hsl\")||v.startsWith(\"var(\");}function normalizeLink(input){const unwrapped=unwrapValue(input);if(typeof unwrapped===\"string\")return unwrapped;if(unwrapped&&typeof unwrapped===\"object\"){const candidate=unwrapped;const url=toStringValue(candidate.url);if(url)return url;const href=toStringValue(candidate.href);if(href)return href;const nested=normalizeLink(candidate.value);if(nested)return nested;}return\"\";}function normalizeBaseLink(input){if(typeof input===\"string\")return input;if(!input||typeof input!==\"object\")return\"\";const candidate=input;// Strict behavior: for Link-like payloads we always prefer the base/default value.\n// Intentionally ignore valueLocalized for href resolution.\nif(\"value\"in candidate){const fromValue=normalizeBaseLink(candidate.value);if(fromValue)return fromValue;}const url=typeof candidate.url===\"string\"?candidate.url:\"\";if(url)return url;const href=typeof candidate.href===\"string\"?candidate.href:\"\";if(href)return href;return\"\";}// Parent crumbs come from flat Title/Link pairs instead of one Array-of-Object\n// control. Two reasons: a Link control cannot be auto-translated the way a String\n// control can, and Framer can only write link values that sit at this level, so the\n// whole chain stays editable and scriptable. An empty title skips that level.\nconst LEVEL_COUNT=4;function levelItems(props){const out=[];for(let n=1;n<=LEVEL_COUNT;n++){const title=toStringValue(props[`level${n}Title`]).trim();if(!title)continue;const raw=props[`level${n}Link`];const link=normalizeBaseLink(raw)||normalizeLink(raw);out.push({title,link});}return out;}/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function BreadcrumbsCode(props){const localeInfo=typeof useLocaleInfo===\"function\"?useLocaleInfo():null;const localePrefix=currentLocalePrefix(localeInfo?.activeLocale?.code||\"\");const isCanvas=RenderTarget.current()===RenderTarget.canvas;const baseItems=useMemo(()=>levelItems(props),[props]);// Top-level CMS-bindable props for the current page crumb\nconst cmsTitle=toStringValue(props.cmsTitle).trim();const cmsLink=normalizeBaseLink(props.cmsLink)||normalizeLink(props.cmsLink);// Nothing configured: show sample crumbs on the canvas so the component stays\n// visible to edit, but render nothing on the published site. A wrong breadcrumb\n// is worse than none.\nconst safeItems=useMemo(()=>{const parents=baseItems.length>0?baseItems:isCanvas?DEFAULT_ITEMS:[];if(!cmsTitle)return parents;return[...parents,{title:cmsTitle,link:cmsLink}];},[baseItems,cmsTitle,cmsLink,isCanvas]);const textColor=toStringValue(props.textColor??props.text)||\"#000000\";const separatorRaw=toStringValue(props.separator);const separatorColor=toStringValue(props.separatorColor??props.sepColor)||(isColorLike(separatorRaw)?separatorRaw:\"\")||\"#CCCCCC\";const fontSize=toNumberValue(props.fontSize??props.size,12);const fontWeight=toNumberValue(props.fontWeight??props.weight,400);const gap=toNumberValue(props.gap,4);const separator=toStringValue(props.sep)||(isColorLike(separatorRaw)?\"\":separatorRaw)||\"/\";const align=normalizeAlign(props.align);const justifyContent=useMemo(()=>{if(align===\"center\")return\"center\";if(align===\"right\")return\"flex-end\";return\"flex-start\";},[align]);const handleMouseEnter=useCallback(event=>{event.currentTarget.style.textDecoration=\"underline\";},[]);const handleMouseLeave=useCallback(event=>{event.currentTarget.style.textDecoration=\"none\";},[]);if(safeItems.length===0)return null;return /*#__PURE__*/_jsx(\"nav\",{\"aria-label\":\"Breadcrumb\",style:{position:\"relative\",display:\"block\",minHeight:20,width:\"max-content\",maxWidth:\"100%\",fontFamily:\"Inter, sans-serif\",color:textColor},children:/*#__PURE__*/_jsx(\"ol\",{style:{listStyle:\"none\",margin:0,padding:0,display:\"flex\",flexWrap:\"wrap\",alignItems:\"center\",justifyContent,gap:`${gap}px`,color:textColor,fontSize:`${fontSize}px`,fontWeight,lineHeight:\"20px\"},children:safeItems.map((item,index)=>{const isCurrent=index===safeItems.length-1;return /*#__PURE__*/_jsxs(\"li\",{style:{display:\"inline-flex\",alignItems:\"center\",gap:`${gap}px`,opacity:isCurrent?1:.7},children:[isCurrent?/*#__PURE__*/_jsx(\"span\",{\"aria-current\":\"page\",style:{color:textColor},children:item.title}):/*#__PURE__*/_jsx(\"a\",{href:localizeLink(item.link,localePrefix)||\"#\",style:{color:textColor,textDecoration:\"none\"},onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,children:item.title}),!isCurrent&&/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{color:separatorColor},children:separator})]},`${item.title}-${index}`);})})});}addPropertyControls(BreadcrumbsCode,{level1Title:{type:ControlType.String,title:\"Level 1 Title\",defaultValue:\"\",placeholder:\"Leave empty to skip\"},level1Link:{type:ControlType.Link,title:\"Level 1 Link\"},level2Title:{type:ControlType.String,title:\"Level 2 Title\",defaultValue:\"\",placeholder:\"Leave empty to skip\"},level2Link:{type:ControlType.Link,title:\"Level 2 Link\"},level3Title:{type:ControlType.String,title:\"Level 3 Title\",defaultValue:\"\",placeholder:\"Leave empty to skip\"},level3Link:{type:ControlType.Link,title:\"Level 3 Link\"},level4Title:{type:ControlType.String,title:\"Level 4 Title\",defaultValue:\"\",placeholder:\"Leave empty to skip\"},level4Link:{type:ControlType.Link,title:\"Level 4 Link\"},cmsTitle:{type:ControlType.String,title:\"CMS Title\",defaultValue:\"\",placeholder:\"Bind to CMS title\"},cmsLink:{type:ControlType.Link,title:\"CMS Link\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#000000\"},separatorColor:{type:ControlType.Color,title:\"Separator\",defaultValue:\"#CCCCCC\"},fontSize:{type:ControlType.Number,title:\"Size\",defaultValue:12,min:10,max:24,step:1,unit:\"px\"},fontWeight:{type:ControlType.Number,title:\"Weight\",defaultValue:400,min:300,max:800,step:100},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:4,min:0,max:24,step:1,unit:\"px\"},separator:{type:ControlType.String,title:\"Sep\",defaultValue:\"/\",preventLocalization:true},align:{type:ControlType.Enum,title:\"Align\",defaultValue:\"left\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],displaySegmentedControl:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BreadcrumbsCode\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BreadcrumbsCode.map"],"mappings":"iNAGoL,SAAS,EAAoB,EAAW,CAAC,IAAM,GAAM,GAAY,GAAA,CAAI,YAAY,EAAE,GAAG,GAAM,EAAsB,GAAM,OAAO,EAAsB,GAAM,GAAG,EAAK,MAAM,GAE7V,GAAU,IAAS,OAAY,CAAC,IAAM,GAAK,EAAO,SAAS,SAAS,MAAM,GAAG,CAAC,CAAC,IAAI,GAAA,CAAI,YAAY,EAAE,GAAG,EAAgB,SAAS,CAAG,EAAE,MAAM,IAAI,CAAI,CAAC,MAAM,EAAG,CAAC,SAAS,EAAa,EAAK,EAAO,CAA+B,GAA3B,CAAC,GAAQ,CAAC,GAAoB,CAAC,EAAK,WAAW,GAAG,EAAE,OAAO,EAC/P,IAAM,GAAK,EAAK,MAAM,GAAG,CAAC,CAAC,IAAI,GAAA,CAAI,YAAY,EAC/C,OADoD,EAAgB,SAAS,CAAG,EAAS,EAClF,IAAO,IAAI,EAAO,IAAI,EAAO,CAAK,CAAqI,SAAS,EAAY,EAAM,CAAsF,OAAlF,GAAO,OAAO,GAAQ,UAAU,UAAU,EAAc,EAAY,EAAM,KAAK,EAAU,CAAM,CAAC,SAAS,EAAc,EAAM,CAAC,IAAM,EAAU,EAAY,CAAK,EAAE,OAAO,OAAO,GAAY,SAAS,EAAU,EAAG,CAAC,SAAS,EAAc,EAAM,EAAS,CAAC,IAAM,EAAU,EAAY,CAAK,EAAE,OAAO,OAAO,GAAY,UAAU,O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