import{n as s,r as f,R as g,aD as x,b9 as b,y as k,j as n,b6 as C,ba as L,B as v,D as w,aC as h}from"./index.D1HZENZx.js";const T=s("div",{target:"e1mwh7ju0"})({display:"flex",flexDirection:"column"}),y=s("a",{target:"e1mwh7ju1"})(({disabled:a,isCurrentPage:o,containerWidth:l,theme:e})=>({textDecoration:"none",width:l?"100%":"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:o?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:o?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...a?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}})),S=s("span",{target:"e1mwh7ju2"})(({disabled:a,theme:o})=>({color:o.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...a?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}:{}}));function D(a,o){return a===null&&o?!0:a===null&&!o?!1:a===!0}function P(a){const{onPageChange:o,currentPageScriptHash:l}=g.useContext(x),e=g.useContext(b),{colors:i}=k(),{disabled:t,element:r}=a,c=D(r.useContainerWidth,e),d=l===r.pageScriptHash,p=u=>{r.external?t&&u.preventDefault():(u.preventDefault(),t||o(r.pageScriptHash))};return n("div",{className:"stPageLink","data-testid":"stPageLink",children:n(C,{help:r.help,placement:L.TOP_RIGHT,containerWidth:c,children:n(T,{children:v(y,{"data-testid":"stPageLink-NavLink",disabled:t,isCurrentPage:d,containerWidth:c,href:r.page,target:r.external?"_blank":"",rel:"noreferrer",onClick:p,children:[r.icon&&n(w,{size:"lg",color:t?i.fadedText40:i.bodyText,iconValue:r.icon}),n(S,{disabled:t,children:n(h,{source:r.label,allowHTML:!1,isLabel:!0,boldLabel:d,largerLabel:!0,disableLinks:!0})})]})})})})}const j=f.memo(P);export{j as default};
