Files
xin-school/public/assets/index-CFsVFAkS.js
T
2026-05-30 17:38:49 +08:00

2 lines
11 KiB
JavaScript

import{r,L as N,bg as yt,P as nt,z as rt,G as Nt,bh as st,bi as T,a3 as w,H as at,J as it,K as lt,bj as ct,a9 as xt,a8 as O}from"./index-B-sDl1ER.js";const ot=t=>{const{prefixCls:e,value:m,current:s,offset:o=0}=t;let a;return o&&(a={position:"absolute",top:`${o}00%`,left:0}),r.createElement("span",{style:a,className:N(`${e}-only-unit`,{current:s})},m)};function wt(t,e,m){let s=t,o=0;for(;(s+10)%10!==e;)s+=m,o+=m;return o}const Et=t=>{const{prefixCls:e,count:m,value:s}=t,o=Number(s),a=Math.abs(m),[n,i]=r.useState(o),[d,f]=r.useState(a),c=()=>{i(o),f(a)};r.useEffect(()=>{const b=setTimeout(c,1e3);return()=>clearTimeout(b)},[o]);let p,y;if(n===o||Number.isNaN(o)||Number.isNaN(n))p=[r.createElement(ot,{...t,key:o,current:!0})],y={transition:"none"};else{p=[];const b=o+10,l=[];for(let $=o;$<=b;$+=1)l.push($);const h=d<a?1:-1,C=l.findIndex($=>$%10===n);p=(h<0?l.slice(0,C+1):l.slice(C)).map(($,S)=>{const E=$%10;return r.createElement(ot,{...t,key:$,value:E,offset:h<0?S-C:S,current:S===C})}),y={transform:`translateY(${-wt(n,o,h)}00%)`}}return r.createElement("span",{className:`${e}-only`,style:y,onTransitionEnd:c},p)},vt=r.forwardRef((t,e)=>{const{prefixCls:m,count:s,className:o,motionClassName:a,style:n,title:i,show:d,component:f="sup",children:c,...p}=t,{getPrefixCls:y}=r.useContext(yt),b=y("scroll-number",m),l={...p,"data-show":d,style:n,className:N(b,o,a),title:i};let h=s;if(s&&Number(s)%1===0){const C=String(s).split("");h=r.createElement("bdi",null,C.map((g,$)=>r.createElement(Et,{prefixCls:b,count:Number(s),value:g,key:C.length-$})))}return n?.borderColor&&(l.style={...n,boxShadow:`0 0 0 1px ${n.borderColor} inset`}),c?nt(c,C=>({className:N(`${b}-custom-component`,C?.className,a)})):r.createElement(f,{...l,ref:e},h)}),zt=new T("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),Pt=new T("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),Tt=new T("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),It=new T("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),Bt=new T("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),Rt=new T("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),Dt=t=>{const{componentCls:e,iconCls:m,antCls:s,badgeShadowSize:o,textFontSize:a,textFontSizeSM:n,statusSize:i,dotSize:d,textFontWeight:f,indicatorHeight:c,indicatorHeightSM:p,marginXS:y,calc:b}=t,l=`${s}-scroll-number`,h=st(t,(C,{darkColor:g})=>({[`&${e} ${e}-color-${C}`]:{background:g,[`&:not(${e}-count)`]:{color:g},"a:hover &":{background:g}}}));return{[e]:{...at(t),position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,[`${e}-count`]:{display:"inline-flex",justifyContent:"center",zIndex:t.indicatorZIndex,minWidth:c,height:c,color:t.badgeTextColor,fontWeight:f,fontSize:a,lineHeight:w(c),whiteSpace:"nowrap",textAlign:"center",background:t.badgeColor,borderRadius:b(c).div(2).equal(),boxShadow:`0 0 0 ${w(o)} ${t.badgeShadowColor}`,transition:`background-color ${t.motionDurationMid}`,a:{color:t.badgeTextColor},"a:hover":{color:t.badgeTextColor},"a:hover &":{background:t.badgeColorHover}},[`${e}-count-sm`]:{minWidth:p,height:p,fontSize:n,lineHeight:w(p),borderRadius:b(p).div(2).equal()},[`${e}-multiple-words`]:{padding:`0 ${w(t.paddingXS)}`,bdi:{unicodeBidi:"plaintext"}},[`${e}-dot`]:{zIndex:t.indicatorZIndex,width:d,minWidth:d,height:d,background:t.badgeColor,borderRadius:"100%",boxShadow:`0 0 0 ${w(o)} ${t.badgeShadowColor}`},[`${e}-count, ${e}-dot, ${l}-custom-component`]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",[`&${m}-spin`]:{animationName:Rt,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&${e}-status`]:{lineHeight:"inherit",verticalAlign:"baseline",[`${e}-status-dot`]:{position:"relative",top:-1,display:"inline-block",width:i,height:i,verticalAlign:"middle",borderRadius:"50%"},[`${e}-status-success`]:{backgroundColor:t.colorSuccess},[`${e}-status-processing`]:{overflow:"visible",color:t.colorInfo,backgroundColor:t.colorInfo,borderColor:"currentcolor","&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:o,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:zt,animationDuration:t.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},[`${e}-status-default`]:{backgroundColor:t.colorTextPlaceholder},[`${e}-status-error`]:{backgroundColor:t.colorError},[`${e}-status-warning`]:{backgroundColor:t.colorWarning},[`${e}-status-text`]:{marginInlineStart:y,color:t.colorText,fontSize:t.fontSize}},...h,[`${e}-zoom-appear, ${e}-zoom-enter`]:{animationName:Pt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`${e}-zoom-leave`]:{animationName:Tt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`&${e}-not-a-wrapper`]:{[`${e}-zoom-appear, ${e}-zoom-enter`]:{animationName:It,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},[`${e}-zoom-leave`]:{animationName:Bt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},[`&:not(${e}-status)`]:{verticalAlign:"middle"},[`${l}-custom-component, ${e}-count`]:{transform:"none"},[`${l}-custom-component, ${l}`]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[l]:{overflow:"hidden",transition:`all ${t.motionDurationMid} ${t.motionEaseOutBack}`,[`${l}-only`]:{position:"relative",display:"inline-block",height:c,transition:`all ${t.motionDurationSlow} ${t.motionEaseOutBack}`,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",[`> p${l}-only-unit`]:{height:c,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},[`${l}-symbol`]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",[`${e}-count, ${e}-dot, ${l}-custom-component`]:{transform:"translate(-50%, -50%)"}}}}},mt=t=>{const{fontHeight:e,lineWidth:m,marginXS:s,colorBorderBg:o}=t,a=e,n=m,i=t.colorTextLightSolid,d=t.colorError,f=t.colorErrorHover;return Nt(t,{badgeFontHeight:a,badgeShadowSize:n,badgeTextColor:i,badgeColor:d,badgeColorHover:f,badgeShadowColor:o,badgeProcessingDuration:"1.2s",badgeRibbonOffset:s,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},ut=t=>{const{fontSize:e,lineHeight:m,fontSizeSM:s,lineWidth:o}=t;return{indicatorZIndex:"auto",indicatorHeight:Math.round(e*m)-2*o,indicatorHeightSM:e,dotSize:s/2,textFontSize:s,textFontSizeSM:s,textFontWeight:"normal",statusSize:s/2}},Ht=rt("Badge",t=>{const e=mt(t);return Dt(e)},ut),Ot=r.forwardRef((t,e)=>{const{prefixCls:m,scrollNumberPrefixCls:s,children:o,status:a,text:n,color:i,count:d=null,overflowCount:f=99,dot:c=!1,size:p="medium",title:y,offset:b,style:l,className:h,rootClassName:C,classNames:g,styles:$,showZero:S=!1,...E}=t,{getPrefixCls:W,direction:I,className:B,style:v,classNames:A,styles:F}=it("badge"),u=W("badge",m),[dt,bt]=Ht(u),gt={...t,overflowCount:f,size:p,dot:c,showZero:S},[q,M]=lt([A,g],[F,$],{props:gt}),X=d>f?`${f}+`:d,R=X==="0"||X===0||n==="0"||n===0,G=d===null||R&&!S,U=(O(a)||O(i))&&G,pt=O(a)||!R,D=c&&!R,H=D?"":X,z=r.useMemo(()=>((!O(H)||H==="")&&(!O(n)||n==="")||R&&!S)&&!D,[H,R,S,D,n]),J=r.useRef(d);z||(J.current=d);const P=J.current,Q=r.useRef(H);z||(Q.current=H);const j=Q.current,_=r.useRef(D);z||(_.current=D);const Z=r.useMemo(()=>{if(!b)return{...v,...l};const x=Number.parseInt(b[0],10);return{...{marginTop:b[1],insetInlineEnd:-x},...v,...l}},[b,l,v]),ft=y??(typeof P=="string"||typeof P=="number"?P:void 0),k=!z&&(n===0?S:!!n&&n!==!0),Ct=k?r.createElement("span",{className:`${u}-status-text`},n):null,$t=!P||typeof P!="object"?void 0:nt(P,x=>({style:{...Z,...x.style}})),L=ct(i,!1),ht=N(q.indicator,{[`${u}-status-dot`]:U,[`${u}-status-${a}`]:!!a,[`${u}-color-${i}`]:L}),K={};i&&!L&&(K.color=i,K.background=i);const tt=N(u,{[`${u}-status`]:U,[`${u}-not-a-wrapper`]:!o,[`${u}-rtl`]:I==="rtl"},h,C,B,q.root,dt,bt);if(!o&&U&&(n||pt||!G)){const x=Z.color;return r.createElement("span",{ref:e,...E,className:tt,style:{...M.root,...Z}},r.createElement("span",{className:ht,style:{...M.indicator,...K}}),k&&r.createElement("span",{style:{color:x},className:`${u}-status-text`},n))}return r.createElement("span",{ref:e,...E,className:tt,style:M.root},o,r.createElement(xt,{visible:!z,motionName:`${u}-zoom`,motionAppear:!1,motionDeadline:1e3},({className:x})=>{const et=W("scroll-number",s),Y=_.current,St=N(q.indicator,{[`${u}-dot`]:Y,[`${u}-count`]:!Y,[`${u}-count-sm`]:p==="small",[`${u}-multiple-words`]:!Y&&j&&j.toString().length>1,[`${u}-status-${a}`]:!!a,[`${u}-color-${i}`]:L});let V={...M.indicator,...Z};return i&&!L&&(V=V||{},V.background=i),r.createElement(vt,{prefixCls:et,show:!z,motionClassName:x,className:St,count:j,title:ft,style:V,key:"scrollNumber"},$t)}),Ct)}),Wt=t=>{const{antCls:e,badgeFontHeight:m,marginXS:s,badgeRibbonOffset:o,calc:a}=t,n=`${e}-ribbon`,i=`${e}-ribbon-wrapper`,d=st(t,(f,{darkColor:c})=>({[`&${n}-color-${f}`]:{background:c,color:c}}));return{[i]:{position:"relative"},[n]:{...at(t),position:"absolute",top:s,padding:`0 ${w(t.paddingXS)}`,color:t.colorPrimary,lineHeight:w(m),whiteSpace:"nowrap",backgroundColor:t.colorPrimary,borderRadius:t.borderRadiusSM,[`${n}-content`]:{color:t.badgeTextColor},[`${n}-corner`]:{position:"absolute",top:"100%",width:o,height:o,color:"currentcolor",border:`${w(a(o).div(2).equal())} solid`,transform:t.badgeRibbonCornerTransform,transformOrigin:"top",filter:t.badgeRibbonCornerFilter},...d,[`&${n}-placement-end`]:{insetInlineEnd:a(o).mul(-1).equal(),borderEndEndRadius:0,[`${n}-corner`]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},[`&${n}-placement-start`]:{insetInlineStart:a(o).mul(-1).equal(),borderEndStartRadius:0,[`${n}-corner`]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}}}},Ft=rt(["Badge","Ribbon"],t=>{const e=mt(t);return Wt(e)},ut),Mt=t=>{const{className:e,prefixCls:m,style:s,color:o,children:a,text:n,placement:i="end",rootClassName:d,styles:f,classNames:c}=t,{getPrefixCls:p,direction:y,className:b,style:l,classNames:h,styles:C}=it("ribbon"),g=p("ribbon",m),$=`${g}-wrapper`,[S,E]=Ft(g,$),W={...t,placement:i},[I,B]=lt([h,c],[C,f],{props:W}),v=ct(o,!1),A=N(g,`${g}-placement-${i}`,{[`${g}-rtl`]:y==="rtl",[`${g}-color-${o}`]:v},e,b,I.indicator),F={},u={};return o&&!v&&(F.background=o,u.color=o),r.createElement("div",{className:N($,d,S,E,I.root),style:B.root},a,r.createElement("div",{className:N(A,S),style:{...F,...B.indicator,...l,...s}},r.createElement("span",{className:N(`${g}-content`,I.content),style:B.content},n),r.createElement("div",{className:`${g}-corner`,style:u})))},Zt=Ot;Zt.Ribbon=Mt;export{Zt as B};