"use strict";var DesignSystem;(globalThis.webpackChunkDesignSystem=globalThis.webpackChunkDesignSystem||[]).push([[8],{1238:(e,t,s)=>{s.d(t,{A:()=>l});var n=s(2485),c=s.n(n),i=s(1637),d=s(5901);const l=e=>{let{ariaHidden:t,className:s,children:n,description:l,id:r,inversed:o,title:a,viewBox:p,...m}=e;const u=c()("ds-c-icon",{"ds-c-icon--inverse":o},s),h=(0,i.A)("icon--",r),x=`${h}__title`,b=`${h}__desc`,T=l?`${x} ${b}`:x,v=!t,S={};return v&&(S["aria-labelledby"]=T,S.role="img"),(0,d.FD)("svg",{"aria-hidden":t,className:u,id:r??v?h:void 0,viewBox:p,xmlns:"http://www.w3.org/2000/svg",...S,...m,children:[v&&(0,d.Y)("title",{id:x,children:a}),v&&l&&(0,d.Y)("desc",{id:b,children:l}),n]})};l.defaultProps={ariaHidden:!0,inversed:!1}},524:(e,t,s)=>{var n=s(7142),c=s(5901);const i=e=>{const t=e.component??"a";return(0,c.FD)(t,{href:e.href,onClick:function(t){e.onClick&&(t.preventDefault(),e.onClick(e.href,e.stepId))},className:e.className,children:[e.children,e.screenReaderText&&(0,c.FD)("span",{className:"ds-u-visibility--screen-reader",children:[" ",e.screenReaderText]})]})},d=e=>{let{step:t,...s}=e;return(0,c.FD)("li",{role:"listitem",className:"ds-c-substep",children:[(0,c.Y)("div",{className:"ds-c-substep__heading",children:t.heading}),(t.completed||t.started)&&(0,c.Y)(i,{component:t.component,href:t.href,stepId:t.id,screenReaderText:t.heading,onClick:t.onClick||s.onStepLinkClick,className:"ds-c-substep__edit",children:t.linkText||s.editText}),t.steps&&s.showSubSubSteps&&(0,c.Y)("ul",{role:"list",children:t.steps.map(((e,t)=>(0,c.Y)(d,{step:e,...s},e.id||t)))})]})},l=d;var r=s(2485),o=s.n(r),a=s(4987),p=s(1238);const m={className:"",viewBox:"0 0 16 12"};function u(e){const t=`ds-c-icon--check ${e.className||""}`;return(0,c.Y)(p.A,{title:(0,a.t)("icons.check"),...m,...e,className:t,children:(0,c.Y)("path",{d:"M16 2.343a.969.969 0 00-.289-.686L14.307.283a1.012 1.012 0 00-1.404 0L6.132 6.919 3.097 3.94a1.012 1.012 0 00-1.404 0L.289 5.313A.969.969 0 000 6c0 .253.103.505.289.687l5.14 5.03a1.012 1.012 0 001.405 0L15.71 3.03A.969.969 0 0016 2.343z"})})}const h=e=>{let{step:t,...s}=e;const n=`h${t.headingLevel||"2"}`,d=t.isNextStep,r=t.started&&!t.completed,a=o()("ds-c-step",{"ds-c-step--current":d||r,"ds-c-step--completed":t.completed}),p=o()("ds-c-step__content",{"ds-c-step__content--with-content":t.description||t.steps});let m,h;return t.completed&&!t.steps?m=t.linkText||s.editText:d?m=t.linkText||s.startText:r&&(m=t.linkText||s.resumeText),(d||r)&&(h="ds-c-button ds-c-button--solid ds-c-button--main ds-c-button--on-light"),(0,c.FD)("li",{role:"listitem",className:a,children:[(0,c.FD)("div",{className:p,children:[(0,c.Y)(n,{className:"ds-c-step__heading",children:t.heading}),t.description&&(0,c.Y)("div",{className:"ds-c-step__description",role:"region",children:t.description}),t.steps&&(0,c.Y)("ol",{role:"list",className:"ds-c-step__substeps",children:t.steps.map(((e,n)=>(0,c.Y)(l,{step:{...e,component:t.component||e.component},...s},e.id||n)))})]}),(0,c.FD)("div",{className:"ds-c-step__actions",role:"region",children:[t.completed&&(0,c.FD)("div",{className:"ds-c-step__completed-text",children:[(0,c.Y)(u,{className:"ds-c-icon-color--success"}),s.completedText]}),m&&(0,c.Y)(i,{component:t.component,href:t.href,stepId:t.id,screenReaderText:t.heading,onClick:t.onClick||s.onStepLinkClick,className:h,children:m})]})]})},x=e=>{let{steps:t,component:s,showSubSubSteps:n=!1,completedText:i="Completed",editText:d="Edit",resumeText:l="Resume",startText:r="Start",...o}=e;return(0,c.Y)("ol",{role:"list",className:"ds-c-step-list",children:t.map(((e,t)=>(0,c.Y)(h,{step:{...e,component:s||e.component},showSubSubSteps:n,completedText:i,editText:d,resumeText:l,startText:r,...o},e.id||t)))})};var b=s(5590);const T=e=>{let{steps:t="[]",showSubSubSteps:s,completedText:n,editText:i,resumeText:d,startText:l,actionsLabelText:r,substepsLabelText:o,...a}=e;return(0,c.Y)(x,{steps:JSON.parse(t),showSubSubSteps:(0,b.$Q)(s),completedText:n,editText:i,resumeText:d,startText:l,actionsLabelText:r,substepsLabelText:o,...a})};(0,n.E)("ds-step-list",(()=>T),{attributes:["steps","show-sub-sub-steps","completed-text","edit-text","resume-text","start-text","actions-label-text","substeps-label-text"]})},5590:(e,t,s)=>{function n(e){return void 0!==e&&"false"!==e}function c(e){return e?new Date(e):void 0}function i(e){if(void 0!==e)return parseInt(e)}function d(e){return(e=>{try{JSON.parse(e)}catch(e){return!1}return!0})(e)?JSON.parse(e):e}s.d(t,{$Q:()=>n,Rk:()=>d,Tt:()=>i,tv:()=>c})},5901:(e,t,s)=>{s.d(t,{FD:()=>n.FD,FK:()=>n.FK,Y:()=>n.Y}),s(7402);var n=s(201)}},e=>{var t=e(e.s=524);DesignSystem=t}]);
//# sourceMappingURL=ds-step-list.js.map