import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import t,{forwardRef as l,useRef as s,useCallback as o,useMemo as n}from"react";import"prop-types";import p from"classnames";import i from"../../hooks/useMergeRefs.js";import r from"../Icon/Icon.js";import m from"../Icon/Icons/components/Check.js";import a from"../Divider/Divider.js";import{NOOP as c}from"../../utils/function-utils.js";import u from"./components/StepIndicator/StepIndicator.js";import{TEXT_PLACEMENTS as f,MULTI_STEP_TYPES as d,STEP_STATUSES as C}from"./MultiStepConstants.js";import"./MultiStepIndicator.scss.js";var I=l((function(l,r){var m=l.className,c=l.type,d=l.steps,C=l.stepComponentClassName,I=l.dividerComponentClassName,S=l.fulfilledStepIcon,y=l.fulfilledStepIconType,N=l.isFulfilledStepDisplayNumber,v=l.onClick,j=l.textPlacement,D=s(null),b=i({refs:[r,D]}),g="multi-step-indicator--wrapper",P="".concat(g,"__divider"),h=o((function(l,s){return t.createElement(t.Fragment,null,t.createElement(u,e({},l,{stepNumber:s+1,type:c,stepComponentClassName:C,fulfilledStepIcon:S,fulfilledStepIconType:y,onClick:v,isFulfilledStepDisplayNumber:N})),s!==d.length-1&&t.createElement(a,{classname:p(P,I)}))}),[v,N,c,C,S,y,I,P,d.length]),k=o((function(l,s){return t.createElement(u,e({},l,{stepNumber:s+1,type:c,stepComponentClassName:C,fulfilledStepIcon:S,fulfilledStepIconType:y,onClick:v,isFollowedByDivider:s!==d.length-1,stepDividerClassName:p(P,I),isVertical:!0,isFulfilledStepDisplayNumber:N}))}),[v,N,c,C,S,y,I,P,d.length]),x=n((function(){return j===f.VERTICAL?k:h}),[j,k,h]);return t.createElement("ol",{ref:b,className:p(g,m)},d.map(x))}));I.types=d,I.stepStatuses=C,I.textPlacements=f,I.defaultProps={className:"",stepComponentClassName:"",dividerComponentClassName:"",type:I.types.PRIMARY,steps:[],fulfilledStepIcon:m,fulfilledStepIconType:r.type.SVG,isFulfilledStepDisplayNumber:!1,onClick:c,textPlacement:I.textPlacements.HORIZONTAL};var S=I;export{S as default};
