import{Ei as e,ki as a}from"./vendor-frame-CwiylG4Y.js";import{bp as t,rv as s}from"./shared-1-3-6x7RKF.js";import{rn as n}from"./vendor-all-2-BJdkbLSj.js";import{R as r}from"./shared-frame-DbQbH4Yr.js";import{st as i}from"./shared-13-Uoqh3mCb.js";var o=a();function l({allHref:e,allLabel:a,name:t,nameAriaLabel:s,onRename:l}){const d=n(),{isEditing:c,editValue:m,setEditValue:f,optimisticLabel:u,inputRef:p,startEdit:x,submitEdit:h,cancelEdit:b,handleBlur:g}=i(l,t),v=u??t;return(0,o.jsxs)("div",{className:"text-secondary flex max-w-[480px] min-w-0 items-center",children:[(0,o.jsx)(r,{variant:"ghost",size:"sm",href:e,className:"-ml-1 min-w-0 shrink df-link-card",children:(0,o.jsx)("span",{className:"min-w-0 truncate font-base-bold",children:a})}),(0,o.jsx)("span",{className:"opacity-50 px-0.5","aria-hidden":!0,children:"/"}),c?(0,o.jsx)("div",{className:"flex h-7 max-w-full items-center rounded-md bg-bg-000 px-1.5 ring-1 ring-inset ring-accent-100",children:(0,o.jsx)("input",{ref:p,type:"text",value:m,onChange:e=>f(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.isComposing||("Enter"===e.key?(e.preventDefault(),h()):"Escape"===e.key&&(e.preventDefault(),b()))},onBlur:g,className:"min-w-[3rem] max-w-full border-none bg-transparent font-base-bold text-text-000 outline-none [field-sizing:content] focus:border-transparent focus:outline-none focus:ring-0",style:{outline:"none",boxShadow:"none"},"aria-label":s??d.formatMessage({defaultMessage:"Name",id:"HAlOn1ZsuY"})})}):l?(0,o.jsx)("button",{type:"button",onClick:x,className:"min-w-0 truncate rounded-md px-1.5 py-1 text-left font-base-bold text-text-100 transition-colors hover:bg-fill-ghost-hover","aria-label":d.formatMessage({defaultMessage:"Rename {name}",id:"NZmMEEjudP"},{name:v}),children:v}):(0,o.jsx)("span",{className:"min-w-0 truncate pl-1.5 font-base-bold text-text-100",children:v})]})}function d({href:a,ddActionName:n,title:r,titleEnd:i,description:l,footer:d,chin:c,overlay:m}){const f=s();return(0,o.jsxs)("div",{className:"group relative h-full transition-transform duration-base ease-out has-[a:active]:scale-[0.98] has-[a:active]:duration-fast",children:[(0,o.jsxs)(t,{href:a,"data-primary":!0,className:e("flex h-full w-full flex-col gap-xs rounded-card bg-surface-1 p-lg shadow-card-ring [--cds-ring-inner:1px] [--cds-ring-outer:0px] group-hover:bg-surface-2","outline-none focus-visible:shadow-focus","[scroll-margin-top:var(--list-header-scroll-offset)]","df-link-card"),"data-dd-action-name":n,children:[(0,o.jsxs)("div",{className:"flex items-center overflow-hidden pr-10",children:[(0,o.jsx)("div",{className:"truncate text-body font-medium text-primary",children:r}),i]}),l&&(0,o.jsx)("div",{className:"mb-md line-clamp-3 text-body text-secondary",children:l}),(0,o.jsx)("div",{className:"mt-auto flex justify-between text-footnote text-muted",children:d}),c&&(0,o.jsx)("div",{className:"-mx-pad-lg -mb-pad-lg mt-xs flex min-w-0 items-center justify-between gap-xs border-t px-lg py-sm",children:c})]}),(0,o.jsx)("div",{className:e("absolute right-3 top-3",f?"opacity-100":"opacity-0 group-hover:opacity-100 group-has-[:focus-visible]:opacity-100 has-[[aria-expanded=true]]:opacity-100"),children:m})]})}export{l as n,d as t};