import"./chunk-QTnfLwEv.js";import{n as e}from"./index-7yDgay5u.js";import{a as t,i as n,n as r,o as i,r as a,t as o}from"./jsx-runtime-DHSfUA5-.js";import{P as s,_ as c}from"./test.id-DxQrYxPk.js";import{t as l}from"./navigationService-BNBSAd9W.js";import{n as u,u as d}from"./route-CPr17rXr.js";var f=r(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),p=r(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),m=r(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),h=r(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);i();var g=o(),_={ellipsis:{Icon:p,size:24},plus:{Icon:m,size:22},refresh:{Icon:h,size:21}};function v({item:e}){if(e.hide)return null;let{Icon:t,size:r}=_[e.icon];return(0,g.jsx)(`button`,{className:n.Button.Icon,type:`button`,"data-test-id":e.testId,title:e.label,"aria-label":e.label,disabled:e.disabled||e.loading,onClick:e.onClick,children:(0,g.jsx)(t,{size:r,strokeWidth:e.icon===`ellipsis`?2:void 0,className:e.loading?n.Common.Spin:void 0})})}function y({left:e}){return e?(0,g.jsx)(v,{item:e}):null}function b({total:e,current:t}){return(0,g.jsx)(`div`,{className:n.StepDots.Root,"aria-hidden":`true`,children:Array.from({length:e},(e,t)=>t+1).map(e=>(0,g.jsx)(`span`,{className:a(n.StepDots.Dot,e<=t?n.StepDots.DotActive:n.StepDots.DotInactive)},e))})}function x({item:e}){return e.hide?null:e.type===`button`?(0,g.jsx)(`button`,{className:n.Button.HeaderSave,type:`button`,"data-test-id":e.testId,disabled:e.disabled||e.loading,onClick:e.onClick,children:e.label}):e.type===`icon`?(0,g.jsx)(v,{item:e}):(0,g.jsx)(b,{total:e.total,current:e.current})}function S({right:e}){return e?(0,g.jsx)(g.Fragment,{children:(Array.isArray(e)?e:[e]).map((e,t)=>(0,g.jsx)(x,{item:e},t))}):null}function C({title:r=``,showBack:i,left:o,right:p,tone:m=`nav`}){let h=s(l),_=d(),v=u(_.pathname,_.search);return(0,g.jsxs)(`header`,{className:a(n.Header.Root,m===`surface`?n.PageHeader.ToneSurface:n.PageHeader.ToneNav),"data-test-id":c.root,style:{zIndex:t.pageHeader},children:[(0,g.jsxs)(`div`,{className:n.PageHeader.Left,"data-test-id":c.left,children:[(0,g.jsx)(y,{left:o}),i&&(0,g.jsx)(`button`,{className:n.Button.Icon,type:`button`,"data-test-id":c.back,title:e(`common.back`,`Back`),"aria-label":e(`common.back`,`Back`),onClick:()=>h.goBack({fallbackPath:v}),children:(0,g.jsx)(f,{size:24,strokeWidth:2})})]}),(0,g.jsx)(`div`,{className:n.Header.Title,"data-test-id":c.title,children:r}),(0,g.jsx)(`div`,{className:n.PageHeader.Right,"data-test-id":c.right,children:(0,g.jsx)(S,{right:p})})]})}export{h as n,f as r,C as t};
//# sourceMappingURL=PageHeader-CzIJsNRF.js.map