import{o as e}from"./chunk-jRWAZmH_.js";import{n as t}from"./jsx-runtime-CEixWuwE.js";import{A as n,Wn as r,Y as i,cr as a,sr as o}from"./axios-v6FV69Ne.js";import{n as s,t as c}from"./slicedToArray-YLaz90ka.js";import{n as l,t as u}from"./typeof-BUNGcdwP.js";import{i as d,r as f}from"./asyncToGenerator-DHhZBkop.js";import{n as p,r as m,t as h}from"./useFlexGapSupport-D3W_g-1w.js";a(),l(),d();var g=e(r()),_=e(t()),v=(0,_.createContext)({}),y=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function b(e){return typeof e==`number`?`${e} ${e} auto`:/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?`0 0 ${e}`:e}var x=[`xs`,`sm`,`md`,`lg`,`xl`,`xxl`],S=_.forwardRef(function(e,t){var n=_.useContext(i),r=n.getPrefixCls,a=n.direction,s=_.useContext(v),c=s.gutter,l=s.wrap,d=s.supportFlexGap,p=e.prefixCls,m=e.span,h=e.order,S=e.offset,C=e.push,w=e.pull,T=e.className,E=e.children,D=e.flex,O=e.style,k=y(e,[`prefixCls`,`span`,`order`,`offset`,`push`,`pull`,`className`,`children`,`flex`,`style`]),A=r(`col`,p),j={};x.forEach(function(t){var n={},r=e[t];typeof r==`number`?n.span=r:u(r)===`object`&&(n=r||{}),delete k[t],j=o(o({},j),f(f(f(f(f(f({},`${A}-${t}-${n.span}`,n.span!==void 0),`${A}-${t}-order-${n.order}`,n.order||n.order===0),`${A}-${t}-offset-${n.offset}`,n.offset||n.offset===0),`${A}-${t}-push-${n.push}`,n.push||n.push===0),`${A}-${t}-pull-${n.pull}`,n.pull||n.pull===0),`${A}-rtl`,a===`rtl`))});var M=(0,g.default)(A,f(f(f(f(f({},`${A}-${m}`,m!==void 0),`${A}-order-${h}`,h),`${A}-offset-${S}`,S),`${A}-push-${C}`,C),`${A}-pull-${w}`,w),T,j),N={};if(c&&c[0]>0){var P=c[0]/2;N.paddingLeft=P,N.paddingRight=P}if(c&&c[1]>0&&!d){var F=c[1]/2;N.paddingTop=F,N.paddingBottom=F}return D&&(N.flex=b(D),l===!1&&!N.minWidth&&(N.minWidth=0)),_.createElement(`div`,o({},k,{style:o(o({},N),O),className:M,ref:t}),E)});a(),d(),l(),s();var C=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};n(`top`,`middle`,`bottom`,`stretch`),n(`start`,`end`,`center`,`space-around`,`space-between`,`space-evenly`);function w(e,t){var n=c(_.useState(typeof e==`string`?e:``),2),r=n[0],i=n[1],a=function(){if(typeof e==`string`&&i(e),u(e)===`object`)for(var n=0;n<p.length;n++){var r=p[n];if(t[r]){var a=e[r];if(a!==void 0){i(a);return}}}};return _.useEffect(function(){a()},[JSON.stringify(e),t]),r}var T=_.forwardRef(function(e,t){var n=e.prefixCls,r=e.justify,a=e.align,s=e.className,l=e.style,d=e.children,y=e.gutter,b=y===void 0?0:y,x=e.wrap,S=C(e,[`prefixCls`,`justify`,`align`,`className`,`style`,`children`,`gutter`,`wrap`]),T=_.useContext(i),E=T.getPrefixCls,D=T.direction,O=c(_.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),2),k=O[0],A=O[1],j=c(_.useState({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),2),M=j[0],N=j[1],P=w(a,M),F=w(r,M),I=h(),L=_.useRef(b);_.useEffect(function(){var e=m.subscribe(function(e){N(e);var t=L.current||0;(!Array.isArray(t)&&u(t)===`object`||Array.isArray(t)&&(u(t[0])===`object`||u(t[1])===`object`))&&A(e)});return function(){return m.unsubscribe(e)}},[]);var R=function(){var e=[void 0,void 0];return(Array.isArray(b)?b:[b,void 0]).forEach(function(t,n){if(u(t)===`object`)for(var r=0;r<p.length;r++){var i=p[r];if(k[i]&&t[i]!==void 0){e[n]=t[i];break}}else e[n]=t}),e},z=E(`row`,n),B=R(),V=(0,g.default)(z,f(f(f(f({},`${z}-no-wrap`,x===!1),`${z}-${F}`,F),`${z}-${P}`,P),`${z}-rtl`,D===`rtl`),s),H={},U=B[0]!=null&&B[0]>0?B[0]/-2:void 0,W=B[1]!=null&&B[1]>0?B[1]/-2:void 0;U&&(H.marginLeft=U,H.marginRight=U),I?H.rowGap=c(B,2)[1]:W&&(H.marginTop=W,H.marginBottom=W);var G=c(B,2),K=G[0],q=G[1],J=_.useMemo(function(){return{gutter:[K,q],wrap:x,supportFlexGap:I}},[K,q,x,I]);return _.createElement(v.Provider,{value:J},_.createElement(`div`,o({},S,{className:V,style:o(o({},H),l),ref:t}),d))});export{S as n,T as t};