import{t as E,d as V,w as F,c as R,m as H,e as O,o as S,f as y,g as z}from"./index-GtUymKue.js";import{e as W,f as G,h as K,g as Q,j as U,i as w,N as q,P as J,Q as X,k as Y}from"./react-dom-CwaHFgt6.js";import{j as s,h as M}from"./codemirror-core-vkcnXJgD.js";var I=E({base:["relative inline-flex items-center outline-none tap-highlight-transparent",...V],variants:{size:{sm:"text-small",md:"text-medium",lg:"text-large"},color:{foreground:"text-foreground",primary:"text-primary",secondary:"text-secondary",success:"text-success",warning:"text-warning",danger:"text-danger"},underline:{none:"no-underline",hover:"hover:underline",always:"underline",active:"active:underline",focus:"focus:underline"},isBlock:{true:["px-2","py-1","hover:after:opacity-100","after:content-['']","after:inset-0","after:opacity-0","after:w-full","after:h-full","after:rounded-xl","after:transition-background","after:absolute"],false:"hover:opacity-80 active:opacity-disabled transition-opacity"},isDisabled:{true:"opacity-disabled cursor-default pointer-events-none"},disableAnimation:{true:"after:transition-none transition-none"}},compoundVariants:[{isBlock:!0,color:"foreground",class:"hover:after:bg-foreground/10"},{isBlock:!0,color:"primary",class:"hover:after:bg-primary/20"},{isBlock:!0,color:"secondary",class:"hover:after:bg-secondary/20"},{isBlock:!0,color:"success",class:"hover:after:bg-success/20"},{isBlock:!0,color:"warning",class:"hover:after:bg-warning/20"},{isBlock:!0,color:"danger",class:"hover:after:bg-danger/20"},{underline:["hover","always","active","focus"],class:"underline-offset-4"}],defaultVariants:{color:"primary",size:"md",isBlock:!1,underline:"none",isDisabled:!1}}),Z="flex mx-1 text-current self-center",ee=r=>s.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",...r,children:[s.jsx("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),s.jsx("path",{d:"M15 3h6v6"}),s.jsx("path",{d:"M10 14L21 3"})]});const oe="/webui/assets/logo-C2MGgWT2.png";function re(r,t){let{elementType:n="a",onPress:o,onPressStart:i,onPressEnd:l,onClick:a,role:u,isDisabled:c,...f}=r,b={};n!=="a"&&(b={role:"link",tabIndex:c?void 0:0});let p=W()||G();a&&typeof a=="function"&&u!=="button"&&F("onClick is deprecated, please use onPress instead. See: https://github.com/heroui-inc/heroui/issues/4292","useLink");const x=e=>{p&&(a==null||a(e)),o==null||o(e)};let{focusableProps:g}=K(r,t),{pressProps:d,isPressed:h}=Q({onPress:x,onPressStart:i,onPressEnd:l,isDisabled:c,ref:t}),k=U(f,{labelable:!0,isLink:n==="a"}),$=w(g,d),m=q(),P=J(r);return{isPressed:h,linkProps:w(k,P,{...$,...b,"aria-disabled":c||void 0,"aria-current":r["aria-current"],onClick:e=>{var v;(v=d.onClick)==null||v.call(d,e),!p&&a&&a(e),!m.isNative&&e.currentTarget instanceof HTMLAnchorElement&&e.currentTarget.href&&!e.isDefaultPrevented()&&X(e.currentTarget,e)&&r.href&&(e.preventDefault(),m.open(e.currentTarget,e,r.href,r.routerOptions))}})}}function ae(r){var t,n,o,i;const l=R(),[a,u]=H(r,I.variantKeys),{ref:c,as:f,children:b,anchorIcon:p,isExternal:x=!1,showAnchorIcon:g=!1,autoFocus:d=!1,className:h,onPress:k,onPressStart:$,onPressEnd:m,onClick:P,...e}=a,v=f||"a",C=O(c),L=(n=(t=r==null?void 0:r.disableAnimation)!=null?t:l==null?void 0:l.disableAnimation)!=null?n:!1,{linkProps:j}=re({...e,onPress:k,onPressStart:$,onPressEnd:m,onClick:P,isDisabled:r.isDisabled,elementType:`${f}`},C),{isFocused:A,isFocusVisible:D,focusProps:B}=Y({autoFocus:d});x&&(e.rel=(o=e.rel)!=null?o:"noopener noreferrer",e.target=(i=e.target)!=null?i:"_blank");const T=M.useMemo(()=>I({...u,disableAnimation:L,className:h}),[S(u),L,h]),_=M.useCallback(()=>({ref:C,className:T,"data-focus":y(A),"data-disabled":y(r.isDisabled),"data-focus-visible":y(D),...w(B,j,e)}),[T,A,D,B,j,e]);return{Component:v,children:b,anchorIcon:p,showAnchorIcon:g,getLinkProps:_}}var N=z((r,t)=>{const{Component:n,children:o,showAnchorIcon:i,anchorIcon:l=s.jsx(ee,{className:Z}),getLinkProps:a}=ae({ref:t,...r});return s.jsx(n,{...a(),children:s.jsxs(s.Fragment,{children:[o,i&&l]})})});N.displayName="HeroUI.Link";var ie=N;export{ie as a,oe as l};
