'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),useBreadcrumb=require("../hooks/useBreadcrumb.js"),BreadcrumbItem=require("./BreadcrumbItem.js"),system=require("@gem-sdk/system"),attrs=require("../common/attrs.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),core=require("@gem-sdk/core");const Breadcrumb=({className:e,setting:s={},style:t,styles:r={},builderAttrs:a,builderProps:c,advanced:m})=>{let{background:l,align:u}=s||{},{currentBreadcrumb:i}=useBreadcrumb.useBreadcrumb(),d=React.useMemo(()=>{let e=i.length;return i.length?i.map((t,a)=>jsxRuntime.jsx(BreadcrumbItem.default,{lengthOfBreadcrumb:e,templateName:t,breadcrumbItemIndex:a,setting:s,styles:r},a)):null},[i,s,r]),n=system.createAttr({...attrs.getAttr({uid:c?.uid??"",builderAttrs:a})}),y=system.createStyle({...styles.getBreadcrumbStyles(t,{background:l,align:u})}),o=system.createClass({...classes.getBreadcrumbClasses(e),...m?.cssClass&&{[m.cssClass]:!0}}),b=system.createClass({...classes.getNavClasses()}),g=system.createAttr({...attrs.getNavAttr()}),j=system.createStyle({...core.makeGlobalSize(s?.globalSize).padding,...styles.getSpacingStyles(s?.spacing),...core.makeStyleResponsive("jc",u)});return jsxRuntime.jsx("div",{...n,style:y,className:o,children:jsxRuntime.jsx("nav",{style:j,className:b,...g,children:d})})};exports.default=Breadcrumb;
