import{BreadcrumbHomeTemplate as e}from"./templates/home.js";import{BreadcrumbLadingTemplate as o}from"./templates/landing.js";import{BreadcrumbProductTemplate as t}from"./templates/product.js";import{BreadcrumbCollectionTemplate as m}from"./templates/collection.js";import{BreadcrumbArticleTemplate as r}from"./templates/article.js";import{generateBreadcrumbChildIconStyles as s,getBreadcrumbChildItemStyles as p}from"../common/styles.js";import{createStyle as l,createClass as i}from"@gem-sdk/system";import{getBreadcrumbSecondItemClasses as a,getBreadcrumbContainerChildItemClasses as n,getBreadcrumbChildItemClasses as c,generateBreadcrumbClasses as d}from"../common/classes.js";import{composeAppendTypoStyle as f,composeAppendTypoClass as g}from"../common/helpers.js";let u=u=>{let{breadcrumbItemIndex:y,lengthOfBreadcrumb:j,setting:$,styles:C}=u,{fontWeight:b,labelColor:S,hideCurrentPage:h}=$??{},x=l({...s($?.iconWidth,$?.color)}),P=l({...p({breadcrumbItemIndex:y,lengthOfBreadcrumb:j,appendTypoStyle:f(C?.typo),fontWeight:b,labelColor:S})}),I=l({...p({breadcrumbItemIndex:0,lengthOfBreadcrumb:j,appendTypoStyle:f(C?.typo),fontWeight:b,labelColor:S})}),N=i({...a(y,h,j)}),k=i({...n()}),v=i({...c(y,j,g(C?.typo))}),T=y+1===j&&"home"!==u.templateName,B=i({...d(h,{extendCondition:T})}),H=i({...a(y,{desktop:!1,tablet:!1,mobile:!1},j)}),W=u.templateName?({home:e,landing:o,product:t,collection:m,article:r})[u.templateName]({getBreadcrumbChildIconStyles:x,breadcrumbChildItemStyles:P,breadcrumbSecondItemClasses:N,breadcrumbChildItemClasses:v,breadcrumbChildSecondItemStyles:I,breadcrumbContainerChildItemClasses:k,composePageClasses:T?`${v} ${B}`.trim():v,composeHomePageClasses:(()=>{let e=i({...d(h,{extendCondition:!0})});return`${v} ${e}`.trim()})(),composePageSecondClasses:`${v} ${B}`.trim(),composeSubPageClasses:(()=>{let e=i({...d(h,{extendCondition:!1})});return`${v} ${e}`.trim()})(),breadcrumbSubPageIconItemClasses:H,iconSvg:$?.iconSvg}):null;return W};export{u as BreadcrumbItem};
