import{a9 as r,r as P,a7 as k,am as y,j as C,aU as b,aj as z}from"./index-91e9700c.js";import{g as _,a as B,s as N,u as R}from"./useThemeProps-1bc4d723.js";import{u as U}from"./useSlot-6d750ee3.js";function j(e){return _("MuiDivider",e)}B("MuiDivider",["root","horizontal","vertical","insetContext","insetNone"]);const I=["className","children","component","inset","orientation","role","slots","slotProps"],E=e=>{const{orientation:i,inset:t}=e,o={root:["root",i,t&&`inset${b(t)}`]};return z(o,j,{})},J=N("hr",{name:"JoyDivider",slot:"Root",overridesResolver:(e,i)=>i.root})(({theme:e,ownerState:i})=>r({"--Divider-thickness":"1px","--Divider-lineColor":e.vars.palette.divider},i.inset==="none"&&{"--_Divider-inset":"0px"},i.inset==="context"&&{"--_Divider-inset":"var(--Divider-inset, 0px)"},{margin:"initial",marginInline:i.orientation==="vertical"?"initial":"var(--_Divider-inset)",marginBlock:i.orientation==="vertical"?"var(--_Divider-inset)":"initial",position:"relative",alignSelf:"stretch",flexShrink:0},i.children?r({"--Divider-gap":e.spacing(1),"--Divider-childPosition":"50%",display:"flex",flexDirection:i.orientation==="vertical"?"column":"row",alignItems:"center",whiteSpace:"nowrap",textAlign:"center",border:0},e.typography["body-sm"],{"&::before, &::after":{position:"relative",inlineSize:i.orientation==="vertical"?"var(--Divider-thickness)":"initial",blockSize:i.orientation==="vertical"?"initial":"var(--Divider-thickness)",backgroundColor:"var(--Divider-lineColor)",content:'""'},"&::before":{marginInlineEnd:i.orientation==="vertical"?"initial":"min(var(--Divider-childPosition) * 999, var(--Divider-gap))",marginBlockEnd:i.orientation==="vertical"?"min(var(--Divider-childPosition) * 999, var(--Divider-gap))":"initial",flexBasis:"var(--Divider-childPosition)"},"&::after":{marginInlineStart:i.orientation==="vertical"?"initial":"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))",marginBlockStart:i.orientation==="vertical"?"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))":"initial",flexBasis:"calc(100% - var(--Divider-childPosition))"}}):{border:"none",listStyle:"none",backgroundColor:"var(--Divider-lineColor)",inlineSize:i.orientation==="vertical"?"var(--Divider-thickness)":"initial",blockSize:i.orientation==="vertical"?"initial":"var(--Divider-thickness)"})),v=P.forwardRef(function(i,t){const o=R({props:i,name:"JoyDivider"}),{className:d,children:a,component:n=a!=null?"div":"hr",inset:p,orientation:l="horizontal",role:s=n!=="hr"?"separator":void 0,slots:D={},slotProps:m={}}=o,h=k(o,I),c=r({},o,{inset:p,role:s,orientation:l,component:n}),g=E(c),u=r({},h,{component:n,slots:D,slotProps:m}),[f,x]=U("root",{ref:t,className:y(g.root,d),elementType:J,externalForwardedProps:u,ownerState:c,additionalProps:r({as:n,role:s},s==="separator"&&l==="vertical"&&{"aria-orientation":"vertical"})});return C(f,r({},x,{children:a}))});v.muiName="Divider";const A=v;export{A as D};
