'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),helpers=require("../common/helpers.js"),system=require("@gem-sdk/system"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),React=require("react");const BreadcrumbItem=e=>{let{breadcrumbItemIndex:s,lengthOfBreadcrumb:t,setting:r,templateName:a,styles:l}=e,{hideCurrentPage:m,labelColor:c,fontWeight:n,iconSvg:o}=r??{},i=system.createClass({...classes.getBreadcrumbChildItemClasses(s,t,helpers.composeAppendTypoClass(l?.typo))}),u=system.createStyle({...styles.getBreadcrumbChildItemStyles({breadcrumbItemIndex:s,lengthOfBreadcrumb:t,fontWeight:n,appendTypoStyle:helpers.composeAppendTypoStyle(l?.typo),labelColor:c})}),d=system.createStyle({...styles.generateBreadcrumbChildIconStyles(r?.iconWidth,r?.color)}),y=system.createClass({...classes.getBreadcrumbSecondItemClasses(s+1,m,t)}),p=React.useMemo(()=>s+1===t,[s,t]),j=system.createClass({...classes.generateBreadcrumbClasses(r?.hideCurrentPage,{indexOffset:s??0,lengthOfBreadcrumb:t,extendCondition:p})}),x=React.useMemo(()=>p?`${i} ${j}`.trim():i,[i,j,p]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:x,style:u,children:jsxRuntime.jsx("span",{children:a})}),system.If(!!(o&&!p),jsxRuntime.jsx("span",{style:d,className:y,dangerouslySetInnerHTML:{__html:o??""}}))]})};exports.default=BreadcrumbItem;
