import{au as L,av as I,_ as V,aj as W,ak as z,aw as X,ax as B,ay as A,az as q,aA as H,aB as J,X as K,c as Q,aC as Y,P as Z,L as ee,aD as $,s as te,O as oe}from"./defaultI18nProvider-C_r1y4tu.js";import{_ as l,j as se}from"./assertThisInitialized-ClXgY4BW.js";import{r as E}from"./index-BP8_t0zE.js";const re=["ownerState"],ne=["variants"],ie=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function ae(e){return Object.keys(e).length===0}function ce(e){return typeof e=="string"&&e.charCodeAt(0)>96}function D(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const le=L(),ue=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function F({defaultTheme:e,theme:s,themeId:t}){return ae(s)?e:s[t]||s}function pe(e){return e?(s,t)=>t[e]:null}function O(e,s){let{ownerState:t}=s,n=V(s,re);const a=typeof e=="function"?e(l({ownerState:t},n)):e;if(Array.isArray(a))return a.flatMap(i=>O(i,l({ownerState:t},n)));if(a&&typeof a=="object"&&Array.isArray(a.variants)){const{variants:i=[]}=a;let p=V(a,ne);return i.forEach(o=>{let r=!0;typeof o.props=="function"?r=o.props(l({ownerState:t},n,t)):Object.keys(o.props).forEach(f=>{(t==null?void 0:t[f])!==o.props[f]&&n[f]!==o.props[f]&&(r=!1)}),r&&(Array.isArray(p)||(p=[p]),p.push(typeof o.style=="function"?o.style(l({ownerState:t},n,t)):o.style))}),p}return a}function fe(e={}){const{themeId:s,defaultTheme:t=le,rootShouldForwardProp:n=D,slotShouldForwardProp:a=D}=e,i=u=>z(l({},u,{theme:F(l({},u,{defaultTheme:t,themeId:s}))}));return i.__mui_systemSx=!0,(u,p={})=>{I(u,c=>c.filter(m=>!(m!=null&&m.__mui_systemSx)));const{name:o,slot:r,skipVariantsResolver:f,skipSx:S,overridesResolver:y=pe(ue(r))}=p,w=V(p,ie),T=f!==void 0?f:r&&r!=="Root"&&r!=="root"||!1,_=S||!1;let C,v=D;r==="Root"||r==="root"?v=n:r?v=a:ce(u)&&(v=void 0);const x=W(u,l({shouldForwardProp:v,label:C},w)),P=c=>typeof c=="function"&&c.__emotion_real!==c||X(c)?m=>O(c,l({},m,{theme:F({theme:m.theme,defaultTheme:t,themeId:s})})):c,j=(c,...m)=>{let b=P(c);const k=m?m.map(P):[];o&&y&&k.push(h=>{const d=F(l({},h,{defaultTheme:t,themeId:s}));if(!d.components||!d.components[o]||!d.components[o].styleOverrides)return null;const R=d.components[o].styleOverrides,g={};return Object.entries(R).forEach(([G,U])=>{g[G]=O(U,l({},h,{theme:d}))}),y(h,g)}),o&&!T&&k.push(h=>{var d;const R=F(l({},h,{defaultTheme:t,themeId:s})),g=R==null||(d=R.components)==null||(d=d[o])==null?void 0:d.variants;return O({variants:g},l({},h,{theme:R}))}),_||k.push(i);const N=k.length-m.length;if(Array.isArray(c)&&N>0){const h=new Array(N).fill("");b=[...c,...h],b.raw=[...c.raw,...h]}const M=x(b,...k);return u.muiName&&(M.muiName=u.muiName),M};return x.withConfig&&(j.withConfig=x.withConfig),j}}const de=fe(),me=["component","direction","spacing","divider","children","className","useFlexGap"],he=L(),ye=de("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,s)=>s.root});function ve(e){return Y({props:e,name:"MuiStack",defaultTheme:he})}function Se(e,s){const t=E.Children.toArray(e).filter(Boolean);return t.reduce((n,a,i)=>(n.push(a),i<t.length-1&&n.push(E.cloneElement(s,{key:`separator-${i}`})),n),[])}const xe=e=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],ke=({ownerState:e,theme:s})=>{let t=l({display:"flex",flexDirection:"column"},B({theme:s},A({values:e.direction,breakpoints:s.breakpoints.values}),n=>({flexDirection:n})));if(e.spacing){const n=q(s),a=Object.keys(s.breakpoints.values).reduce((o,r)=>((typeof e.spacing=="object"&&e.spacing[r]!=null||typeof e.direction=="object"&&e.direction[r]!=null)&&(o[r]=!0),o),{}),i=A({values:e.direction,base:a}),u=A({values:e.spacing,base:a});typeof i=="object"&&Object.keys(i).forEach((o,r,f)=>{if(!i[o]){const y=r>0?i[f[r-1]]:"column";i[o]=y}}),t=H(t,B({theme:s},u,(o,r)=>e.useFlexGap?{gap:$(n,o)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${xe(r?i[r]:e.direction)}`]:$(n,o)}}))}return t=J(s.breakpoints,t),t};function Re(e={}){const{createStyledComponent:s=ye,useThemeProps:t=ve,componentName:n="MuiStack"}=e,a=()=>Z({root:["root"]},o=>ee(n,o),{}),i=s(ke);return E.forwardRef(function(o,r){const f=t(o),S=K(f),{component:y="div",direction:w="column",spacing:T=0,divider:_,children:C,className:v,useFlexGap:x=!1}=S,P=V(S,me),j={direction:w,spacing:T,useFlexGap:x},c=a();return se.jsx(i,l({as:y,ownerState:j,ref:r,className:Q(c.root,v)},P,{children:_?Se(C,_):C}))})}const je=Re({createStyledComponent:te("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,s)=>s.root}),useThemeProps:e=>oe({props:e,name:"MuiStack"})});export{je as S};
