import{n as e,o as t}from"./rolldown-runtime-C0FnF6B9.js";import{t as n}from"./react-C21x__mS.js";import{n as r}from"./iframe-GrlyTB2d.js";import{t as i}from"./react-dom-2o2phaJG.js";import{a,i as o}from"./utils-DUM89eIj.js";import{a as s,c,d as l,g as u,i as d,l as f,m as p,o as m,p as h,r as g,s as _}from"./floating-ui.react-TvNkEeW6.js";function v(e,t){if(!t?.arrow)return{};let{x:n,y:r}=t.arrow,i=e.split(`-`)[0],a={top:`bottom`,right:`left`,bottom:`top`,left:`right`}[i],o={top:`rotate(180deg)`,right:`rotate(-90deg)`,bottom:`rotate(0deg)`,left:`rotate(90deg)`}[i];return{pointerEvents:`none`,position:`absolute`,zIndex:-5,width:`16px`,height:`16px`,left:n==null?``:`${n}px`,top:r==null?``:`${r}px`,transform:o,[a]:`-16px`}}var y,b,x;function S(){return(S=e((()=>{y=n(),b=r(),x=(0,y.forwardRef)(({placement:e,middlewareData:t},n)=>(0,b.jsx)(`div`,{ref:n,style:v(e,t),children:(0,b.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`var(--border-2)`,stroke:`var(--border-2)`,strokeWidth:`var(--border-width)`,style:{display:`block`},children:(0,b.jsx)(`polygon`,{points:`8,8 16,16 0,16`})})})),x.__docgenInfo={description:``,methods:[],displayName:`FloatingArrow`,props:{placement:{required:!0,tsType:{name:`Placement`},description:``},middlewareData:{required:!0,tsType:{name:`MiddlewareData`},description:``}}}})))()}var C,w,T,E,D,O,k,A;function j(){return(j=e((()=>{C=`sZ0x6w`,w=`_538Ejd`,T=`fqciCO`,E=`sHkUiQ`,D=`bpGNoX`,O=`tYnRg-`,k=`_8lflEh`,A={tooltipPanel:C,tooltip:w,negative:T,information:E,error:D,warning:O,success:k}})))()}var M,N,P,F;function I(){return(I=e((()=>{M=t(n(),1),g(),o(),N=i(),S(),j(),P=r(),F=({content:e,children:t,openOnHover:n=!0,placement:r=`bottom`,openDelay:i=200,closeDelay:o=100,maxWidth:g,state:v,tooltip:y,positionUpdateKey:b})=>{let[S,C]=(0,M.useState)(!1),w=(0,M.useRef)(null),{refs:T,floatingStyles:E,middlewareData:D,context:O,placement:k,update:j}=s({open:S,onOpenChange:C,placement:r,middleware:[h(8),l({fallbackAxisSideDirection:`end`,fallbackPlacements:[`top`,`right`,`bottom`]}),p({padding:8}),f({element:w,padding:8})],whileElementsMounted:u});(0,M.useLayoutEffect)(()=>{S&&j()},[S,b,j]);let F=m(O,{enabled:n,move:!1,delay:{open:i,close:o}}),I=d(O),L=c(O),{getReferenceProps:R,getFloatingProps:z}=_([F,I,L]);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{ref:T.setReference,...R(),style:{lineHeight:1},children:t}),S&&(0,N.createPortal)((0,P.jsxs)(`div`,{ref:T.setFloating,style:{...E,zIndex:`var(--z-tooltip)`,maxWidth:g?`${g}em`:void 0},...z(),role:`tooltip`,className:a(A.tooltipPanel,y&&A.tooltip,v&&A[v]),children:[e,(0,P.jsx)(x,{ref:w,placement:k,middlewareData:D})]}),document.body)]})},F.__docgenInfo={description:``,methods:[],displayName:`FloatingPopover`,props:{content:{required:!0,tsType:{name:`ReactReactNode`,raw:`React.ReactNode`},description:``},children:{required:!0,tsType:{name:`ReactReactNode`,raw:`React.ReactNode`},description:``},openOnHover:{required:!1,tsType:{name:`boolean`},description:``,defaultValue:{value:`true`,computed:!1}},placement:{required:!1,tsType:{name:`Placement`},description:``,defaultValue:{value:`"bottom"`,computed:!1}},openDelay:{required:!1,tsType:{name:`number`},description:``,defaultValue:{value:`200`,computed:!1}},closeDelay:{required:!1,tsType:{name:`number`},description:``,defaultValue:{value:`100`,computed:!1}},maxWidth:{required:!1,tsType:{name:`number`},description:``},state:{required:!1,tsType:{name:`union`,raw:`"information" | "error" | "warning" | "success" | "negative"`,elements:[{name:`literal`,value:`"information"`},{name:`literal`,value:`"error"`},{name:`literal`,value:`"warning"`},{name:`literal`,value:`"success"`},{name:`literal`,value:`"negative"`}]},description:``},tooltip:{required:!1,tsType:{name:`literal`,value:`true`},description:``},positionUpdateKey:{required:!1,tsType:{name:`unknown`},description:"Изменяется вместе с CSS-координатой trigger, когда её изменение не отслеживается `autoUpdate`.\nПосле commit React выполняется повторный расчёт позиции открытой floating-панели."}}}})))()}export{S as i,I as n,x as r,F as t};