import{e as H,f as R,w as F,h as O,g as S,j as V,i as L,a1 as W,a2 as B,a3 as G,D as K,a4 as _,n as U,H as q,r as C,v as z,a5 as J}from"./react-dom-C0IJc3nR.js";import{c as Q,d as X}from"./index-CjmGjyN8.js";import{j as n,h as E}from"./codemirror-core-DIzFijqu.js";var Y=s=>n.jsxs("svg",{"aria-hidden":"true",fill:"none",focusable:"false",height:"1em",shapeRendering:"geometricPrecision",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 24 24",width:"1em",...s,children:[n.jsx("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),n.jsx("path",{d:"M15 3h6v6"}),n.jsx("path",{d:"M10 14L21 3"})]});const re="/webui/assets/logo-C2MGgWT2.png";function Z(s,r){let{elementType:o="a",onPress:t,onPressStart:i,onPressEnd:c,onClick:a,role:f,isDisabled:l,...u}=s,b={};o!=="a"&&(b={role:"link",tabIndex:l?void 0:0});let p=H()||R();a&&typeof a=="function"&&f!=="button"&&F("onClick is deprecated, please use onPress instead. See: https://github.com/heroui-inc/heroui/issues/4292","useLink");const m=e=>{p&&(a==null||a(e)),t==null||t(e)};let{focusableProps:x}=O(s,r),{pressProps:d,isPressed:h}=S({onPress:m,onPressStart:i,onPressEnd:c,isDisabled:l,ref:r}),v=V(u,{labelable:!0,isLink:o==="a"}),P=L(x,d),$=W(),g=B(s);return{isPressed:h,linkProps:L(v,g,{...P,...b,"aria-disabled":l||void 0,"aria-current":s["aria-current"],onClick:e=>{var k;(k=d.onClick)==null||k.call(d,e),!p&&a&&a(e),!$.isNative&&e.currentTarget instanceof HTMLAnchorElement&&e.currentTarget.href&&!e.isDefaultPrevented()&&G(e.currentTarget,e)&&s.href&&(e.preventDefault(),$.open(e.currentTarget,e,s.href,s.routerOptions))}})}}function ee(s){var r,o,t,i;const c=Q(),[a,f]=K(s,_.variantKeys),{ref:l,as:u,children:b,anchorIcon:p,isExternal:m=!1,showAnchorIcon:x=!1,autoFocus:d=!1,className:h,onPress:v,onPressStart:P,onPressEnd:$,onClick:g,...e}=a,k=u||"a",j=X(l),A=(o=(r=s==null?void 0:s.disableAnimation)!=null?r:c==null?void 0:c.disableAnimation)!=null?o:!1,{linkProps:D}=Z({...e,onPress:v,onPressStart:P,onPressEnd:$,onClick:g,isDisabled:s.isDisabled,elementType:`${u}`},j),{isFocused:T,isFocusVisible:w,focusProps:M}=U({autoFocus:d});m&&(e.rel=(t=e.rel)!=null?t:"noopener noreferrer",e.target=(i=e.target)!=null?i:"_blank");const I=E.useMemo(()=>_({...f,disableAnimation:A,className:h}),[q(f),A,h]),y=E.useCallback(()=>({ref:j,className:I,"data-focus":C(T),"data-disabled":C(s.isDisabled),"data-focus-visible":C(w),...L(M,D,e)}),[I,T,w,M,D,e]);return{Component:k,children:b,anchorIcon:p,showAnchorIcon:x,getLinkProps:y}}var N=z((s,r)=>{const{Component:o,children:t,showAnchorIcon:i,anchorIcon:c=n.jsx(Y,{className:J}),getLinkProps:a}=ee({ref:r,...s});return n.jsx(o,{...a(),children:n.jsxs(n.Fragment,{children:[t,i&&c]})})});N.displayName="HeroUI.Link";var oe=N;export{oe as a,re as l};
