import{A as e,D as t,_ as n,n as r,pt as i,tt as a}from"./vue.runtime.esm-bundler-gHHLlCcd.js";import{Zt as o,_ as s,en as c,g as l,h as u,in as d,it as f,on as p,rt as m,tn as h,w as g}from"./_plugin-vue_export-helper-BgFcNt9i.js";import{t as _}from"./use-compitable-1-huPEAU.js";import{n as v}from"./index-BBxzgjes.js";var y=c([c(`@keyframes spin-rotate`,`
 from {
 transform: rotate(0);
 }
 to {
 transform: rotate(360deg);
 }
 `),h(`spin-container`,`
 position: relative;
 `,[h(`spin-body`,`
 position: absolute;
 top: 50%;
 left: 50%;
 transform: translateX(-50%) translateY(-50%);
 `,[u()])]),h(`spin-body`,`
 display: inline-flex;
 align-items: center;
 justify-content: center;
 flex-direction: column;
 `),h(`spin`,`
 display: inline-flex;
 height: var(--n-size);
 width: var(--n-size);
 font-size: var(--n-size);
 color: var(--n-color);
 `,[d(`rotate`,`
 animation: spin-rotate 2s linear infinite;
 `)]),h(`spin-description`,`
 display: inline-block;
 font-size: var(--n-font-size);
 color: var(--n-text-color);
 transition: color .3s var(--n-bezier);
 margin-top: 8px;
 `),h(`spin-content`,`
 opacity: 1;
 transition: opacity .3s var(--n-bezier);
 pointer-events: all;
 `,[d(`spinning`,`
 user-select: none;
 -webkit-user-select: none;
 pointer-events: none;
 opacity: var(--n-opacity-spinning);
 `)])]),b={small:20,medium:18,large:16},x=t({name:`Spin`,props:Object.assign(Object.assign(Object.assign({},g.props),{contentClass:String,contentStyle:[Object,String],description:String,size:{type:[String,Number],default:`medium`},show:{type:Boolean,default:!0},rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0},delay:Number}),s),slots:Object,setup(e){let{mergedClsPrefixRef:t,inlineThemeDisabled:r}=f(e),s=g(`Spin`,`-spin`,y,v,e,t),c=n(()=>{let{size:t}=e,{common:{cubicBezierEaseInOut:n},self:r}=s.value,{opacitySpinning:i,color:a,textColor:c}=r;return{"--n-bezier":n,"--n-opacity-spinning":i,"--n-size":typeof t==`number`?o(t):r[p(`size`,t)],"--n-color":a,"--n-text-color":c}}),l=r?m(`spin`,n(()=>{let{size:t}=e;return typeof t==`number`?String(t):t[0]}),c,e):void 0,u=_(e,[`spinning`,`show`]),d=i(!1);return a(t=>{let n;if(u.value){let{delay:r}=e;if(r){n=window.setTimeout(()=>{d.value=!0},r),t(()=>{clearTimeout(n)});return}}d.value=u.value}),{mergedClsPrefix:t,active:d,mergedStrokeWidth:n(()=>{let{strokeWidth:t}=e;if(t!==void 0)return t;let{size:n}=e;return b[typeof n==`number`?`medium`:n]}),cssVars:r?void 0:c,themeClass:l?.themeClass,onRender:l?.onRender}},render(){var t;let{$slots:n,mergedClsPrefix:i,description:a}=this,o=n.icon&&this.rotate,s=(a||n.description)&&e(`div`,{class:`${i}-spin-description`},a||n.description?.call(n)),c=n.icon?e(`div`,{class:[`${i}-spin-body`,this.themeClass]},e(`div`,{class:[`${i}-spin`,o&&`${i}-spin--rotate`],style:n.default?``:this.cssVars},n.icon()),s):e(`div`,{class:[`${i}-spin-body`,this.themeClass]},e(l,{clsPrefix:i,style:n.default?``:this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,radius:this.radius,scale:this.scale,class:`${i}-spin`}),s);return(t=this.onRender)==null||t.call(this),n.default?e(`div`,{class:[`${i}-spin-container`,this.themeClass],style:this.cssVars},e(`div`,{class:[`${i}-spin-content`,this.active&&`${i}-spin-content--spinning`,this.contentClass],style:this.contentStyle},n),e(r,{name:`fade-in-transition`},{default:()=>this.active?c:null})):c}});export{x as t};